diff --git a/.gitignore b/.gitignore index 18fd71443c6e3a9569a6bd490c9f2c1c1aa8670b..e5c155121d351706c4f36cd2b5bdaf8e7a372cdd 100644 --- a/.gitignore +++ b/.gitignore @@ -2,4 +2,5 @@ node_modules/ bower_components/ .idea/ cesium/ -npm-debug.log \ No newline at end of file +npm-debug.log +*.map diff --git a/package.json b/package.json index 1c58d655dd39ba599b06a039e986d90dcaf05d45..bd2ff4006eeaa9a8f74079bbd9a9e0350e24b575 100644 --- a/package.json +++ b/package.json @@ -26,18 +26,22 @@ "url": "https://github.com/duniter/duniter-ui/issues" }, "dependencies": { + "adm-zip": "0.4.7", + "request": "2.31.0", "body-parser": "1.15.2", "bower": "1.8.0", "brunch": "2.4.2", "co": "4.6.0", "express": "4.14.0", + "fs-extra": "1.0.0", "materialize-css": "0.97.5", "moment": "2.6.0", "node-pre-gyp": "0.6.32", + "rimraf": "2.5.4", + "tmp": "0.0.29", "underscore": "1.8.3" }, "devDependencies": { - "adm-zip": "0.4.7", "auto-reload-brunch": "2.0.0", "babel-brunch": "6.0.1", "babel-polyfill": "6.3.14", @@ -47,18 +51,14 @@ "css-brunch": "2.0.0", "duniter": "file:../duniter", "fb-flo-brunch": "1.7.22", - "fs-extra": "1.0.0", "jade-brunch": "2.0.0", "javascript-brunch": "2.0.0", "json-brunch": "1.5.4", "mocha": "2.2.5", "process-nextick-args": "1.0.7", - "request": "2.31.0", - "rimraf": "2.5.4", "sass-brunch": "2.0.0", "should": "11.1.0", "stylus-brunch": "2.0.0", - "tmp": "0.0.29", "uglify-js-brunch": "2.0.1", "util-deprecate": "1.0.2" } diff --git a/public/libraries.js.map b/public/libraries.js.map deleted file mode 100644 index 0687ef9bf0a48a5256af65996936aee88f399983..0000000000000000000000000000000000000000 --- a/public/libraries.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["node_modules/browser-resolve/empty.js","node_modules/co/index.js","node_modules/moment/moment.js","node_modules/underscore/underscore.js","bower_components/angular/angular.js","bower_components/angular-cookies/angular-cookies.js","bower_components/angular-resource/angular-resource.js","bower_components/angular-sanitize/angular-sanitize.js","bower_components/angular-translate/angular-translate.js","bower_components/angular-ui-router/release/angular-ui-router.js","bower_components/jquery/jquery.js","bower_components/ng-file-upload/ng-file-upload.js","runtime.js","vendor/browser.js","vendor/highcharts.js","vendor/materialize.js","vendor/q.js","vendor/sjcl.js"],"names":["f","exports","module","define","amd","g","window","global","self","jade","e","t","n","r","s","o","u","a","require","i","Error","code","l","call","length","merge","b","arguments","attrs","ac","bc","Array","isArray","concat","filter","nulls","key","val","joinClasses","map","Object","keys","join","cls","classes","escaped","buf","push","escape","text","style","attr","terse","indexOf","JSON","stringify","console","warn","toISOString","replace","obj","jade_encode_html_rules","jade_match_html","jade_encode_char","c","jade_escape","html","result","String","rethrow","err","filename","lineno","str","message","readFileSync","ex","context","lines","split","start","Math","max","end","min","slice","line","curr","path","DebugItem"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAAA;AACA;AACA;AACA;AACA;AACA;ACLA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;ACpPA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;ACh8EA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;KCnhDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;ACh5nBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AC1MA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;ACrjBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AC9mBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AC/rGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AC17IA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AC7nRA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;AC30EA,CAAC,UAASA,CAAT,EAAW;AAAC,MAAG,QAAOC,OAAP,yCAAOA,OAAP,OAAiB,QAAjB,IAA2B,OAAOC,MAAP,KAAgB,WAA9C,EAA0D;AAACA,WAAOD,OAAP,GAAeD,GAAf;AAAmB,GAA9E,MAAmF,IAAG,OAAOG,MAAP,KAAgB,UAAhB,IAA4BA,OAAOC,GAAtC,EAA0C;AAACD,WAAO,EAAP,EAAUH,CAAV;AAAa,GAAxD,MAA4D;AAAC,QAAIK,CAAJ,CAAM,IAAG,OAAOC,MAAP,KAAgB,WAAnB,EAA+B;AAACD,UAAEC,MAAF;AAAS,KAAzC,MAA8C,IAAG,OAAOC,MAAP,KAAgB,WAAnB,EAA+B;AAACF,UAAEE,MAAF;AAAS,KAAzC,MAA8C,IAAG,OAAOC,IAAP,KAAc,WAAjB,EAA6B;AAACH,UAAEG,IAAF;AAAO,KAArC,MAAyC;AAACH,UAAE,IAAF;AAAO,OAAEI,IAAF,GAAST,GAAT;AAAa;AAAC,CAA9T,EAAgU,YAAU;AAAC,MAAIG,MAAJ,EAAWD,MAAX,EAAkBD,OAAlB,CAA0B,OAAQ,SAASS,CAAT,CAAWC,CAAX,EAAaC,CAAb,EAAeC,CAAf,EAAiB;AAAC,aAASC,CAAT,CAAWC,CAAX,EAAaC,CAAb,EAAe;AAAC,UAAG,CAACJ,EAAEG,CAAF,CAAJ,EAAS;AAAC,YAAG,CAACJ,EAAEI,CAAF,CAAJ,EAAS;AAAC,cAAIE,IAAE,OAAOC,OAAP,IAAgB,UAAhB,IAA4BA,OAAlC,CAA0C,IAAG,CAACF,CAAD,IAAIC,CAAP,EAAS,OAAOA,EAAEF,CAAF,EAAI,CAAC,CAAL,CAAP,CAAe,IAAGI,CAAH,EAAK,OAAOA,EAAEJ,CAAF,EAAI,CAAC,CAAL,CAAP,CAAe,IAAIf,IAAE,IAAIoB,KAAJ,CAAU,yBAAuBL,CAAvB,GAAyB,GAAnC,CAAN,CAA8C,MAAMf,EAAEqB,IAAF,GAAO,kBAAP,EAA0BrB,CAAhC;AAAkC,aAAIsB,IAAEV,EAAEG,CAAF,IAAK,EAACd,SAAQ,EAAT,EAAX,CAAwBU,EAAEI,CAAF,EAAK,CAAL,EAAQQ,IAAR,CAAaD,EAAErB,OAAf,EAAuB,UAASS,CAAT,EAAW;AAAC,cAAIE,IAAED,EAAEI,CAAF,EAAK,CAAL,EAAQL,CAAR,CAAN,CAAiB,OAAOI,EAAEF,IAAEA,CAAF,GAAIF,CAAN,CAAP;AAAgB,SAApE,EAAqEY,CAArE,EAAuEA,EAAErB,OAAzE,EAAiFS,CAAjF,EAAmFC,CAAnF,EAAqFC,CAArF,EAAuFC,CAAvF;AAA0F,cAAOD,EAAEG,CAAF,EAAKd,OAAZ;AAAoB,SAAIkB,IAAE,OAAOD,OAAP,IAAgB,UAAhB,IAA4BA,OAAlC,CAA0C,KAAI,IAAIH,IAAE,CAAV,EAAYA,IAAEF,EAAEW,MAAhB,EAAuBT,GAAvB;AAA2BD,QAAED,EAAEE,CAAF,CAAF;AAA3B,KAAmC,OAAOD,CAAP;AAAS,GAAzb,CAA2b,EAAC,GAAE,CAAC,UAASI,OAAT,EAAiBhB,MAAjB,EAAwBD,OAAxB,EAAgC;AAC30B;;AAEA;;;;;;;;;;;;AAYAA,cAAQwB,KAAR,GAAgB,SAASA,KAAT,CAAeR,CAAf,EAAkBS,CAAlB,EAAqB;AACnC,YAAIC,UAAUH,MAAV,KAAqB,CAAzB,EAA4B;AAC1B,cAAII,QAAQX,EAAE,CAAF,CAAZ;AACA,eAAK,IAAIE,IAAI,CAAb,EAAgBA,IAAIF,EAAEO,MAAtB,EAA8BL,GAA9B,EAAmC;AACjCS,oBAAQH,MAAMG,KAAN,EAAaX,EAAEE,CAAF,CAAb,CAAR;AACD;AACD,iBAAOS,KAAP;AACD;AACD,YAAIC,KAAKZ,EAAE,OAAF,CAAT;AACA,YAAIa,KAAKJ,EAAE,OAAF,CAAT;;AAEA,YAAIG,MAAMC,EAAV,EAAc;AACZD,eAAKA,MAAM,EAAX;AACAC,eAAKA,MAAM,EAAX;AACA,cAAI,CAACC,MAAMC,OAAN,CAAcH,EAAd,CAAL,EAAwBA,KAAK,CAACA,EAAD,CAAL;AACxB,cAAI,CAACE,MAAMC,OAAN,CAAcF,EAAd,CAAL,EAAwBA,KAAK,CAACA,EAAD,CAAL;AACxBb,YAAE,OAAF,IAAaY,GAAGI,MAAH,CAAUH,EAAV,EAAcI,MAAd,CAAqBC,KAArB,CAAb;AACD;;AAED,aAAK,IAAIC,GAAT,IAAgBV,CAAhB,EAAmB;AACjB,cAAIU,OAAO,OAAX,EAAoB;AAClBnB,cAAEmB,GAAF,IAASV,EAAEU,GAAF,CAAT;AACD;AACF;;AAED,eAAOnB,CAAP;AACD,OA1BD;;AA4BA;;;;;;;;AAQA,eAASkB,KAAT,CAAeE,GAAf,EAAoB;AAClB,eAAOA,OAAO,IAAP,IAAeA,QAAQ,EAA9B;AACD;;AAED;;;;;;AAMApC,cAAQqC,WAAR,GAAsBA,WAAtB;AACA,eAASA,WAAT,CAAqBD,GAArB,EAA0B;AACxB,eAAO,CAACN,MAAMC,OAAN,CAAcK,GAAd,IAAqBA,IAAIE,GAAJ,CAAQD,WAAR,CAArB,GACLD,OAAO,QAAOA,GAAP,yCAAOA,GAAP,OAAe,QAAvB,GAAmCG,OAAOC,IAAP,CAAYJ,GAAZ,EAAiBH,MAAjB,CAAwB,UAAUE,GAAV,EAAe;AAAE,iBAAOC,IAAID,GAAJ,CAAP;AAAkB,SAA3D,CAAnC,GACA,CAACC,GAAD,CAFK,EAEEH,MAFF,CAESC,KAFT,EAEgBO,IAFhB,CAEqB,GAFrB,CAAP;AAGD;;AAED;;;;;;;AAOAzC,cAAQ0C,GAAR,GAAc,SAASA,GAAT,CAAaC,OAAb,EAAsBC,OAAtB,EAA+B;AAC3C,YAAIC,MAAM,EAAV;AACA,aAAK,IAAI3B,IAAI,CAAb,EAAgBA,IAAIyB,QAAQpB,MAA5B,EAAoCL,GAApC,EAAyC;AACvC,cAAI0B,WAAWA,QAAQ1B,CAAR,CAAf,EAA2B;AACzB2B,gBAAIC,IAAJ,CAAS9C,QAAQ+C,MAAR,CAAeV,YAAY,CAACM,QAAQzB,CAAR,CAAD,CAAZ,CAAf,CAAT;AACD,WAFD,MAEO;AACL2B,gBAAIC,IAAJ,CAAST,YAAYM,QAAQzB,CAAR,CAAZ,CAAT;AACD;AACF;AACD,YAAI8B,OAAOX,YAAYQ,GAAZ,CAAX;AACA,YAAIG,KAAKzB,MAAT,EAAiB;AACf,iBAAO,aAAayB,IAAb,GAAoB,GAA3B;AACD,SAFD,MAEO;AACL,iBAAO,EAAP;AACD;AACF,OAfD;;AAkBAhD,cAAQiD,KAAR,GAAgB,UAAUb,GAAV,EAAe;AAC7B,YAAIA,OAAO,QAAOA,GAAP,yCAAOA,GAAP,OAAe,QAA1B,EAAoC;AAClC,iBAAOG,OAAOC,IAAP,CAAYJ,GAAZ,EAAiBE,GAAjB,CAAqB,UAAUW,KAAV,EAAiB;AAC3C,mBAAOA,QAAQ,GAAR,GAAcb,IAAIa,KAAJ,CAArB;AACD,WAFM,EAEJR,IAFI,CAEC,GAFD,CAAP;AAGD,SAJD,MAIO;AACL,iBAAOL,GAAP;AACD;AACF,OARD;AASA;;;;;;;;;AASApC,cAAQkD,IAAR,GAAe,SAASA,IAAT,CAAcf,GAAd,EAAmBC,GAAnB,EAAwBQ,OAAxB,EAAiCO,KAAjC,EAAwC;AACrD,YAAIhB,QAAQ,OAAZ,EAAqB;AACnBC,gBAAMpC,QAAQiD,KAAR,CAAcb,GAAd,CAAN;AACD;AACD,YAAI,aAAa,OAAOA,GAApB,IAA2B,QAAQA,GAAvC,EAA4C;AAC1C,cAAIA,GAAJ,EAAS;AACP,mBAAO,OAAOe,QAAQhB,GAAR,GAAcA,MAAM,IAAN,GAAaA,GAAb,GAAmB,GAAxC,CAAP;AACD,WAFD,MAEO;AACL,mBAAO,EAAP;AACD;AACF,SAND,MAMO,IAAI,KAAKA,IAAIiB,OAAJ,CAAY,MAAZ,CAAL,IAA4B,YAAY,OAAOhB,GAAnD,EAAwD;AAC7D,cAAIiB,KAAKC,SAAL,CAAelB,GAAf,EAAoBgB,OAApB,CAA4B,GAA5B,MAAqC,CAAC,CAA1C,EAA6C;AAC3CG,oBAAQC,IAAR,CAAa,2DACA,4BADb;AAED;AACD,cAAIpB,OAAO,OAAOA,IAAIqB,WAAX,KAA2B,UAAtC,EAAkD;AAChDF,oBAAQC,IAAR,CAAa,2DACA,sBADb;AAED;AACD,iBAAO,MAAMrB,GAAN,GAAY,IAAZ,GAAmBkB,KAAKC,SAAL,CAAelB,GAAf,EAAoBsB,OAApB,CAA4B,IAA5B,EAAkC,QAAlC,CAAnB,GAAiE,GAAxE;AACD,SAVM,MAUA,IAAId,OAAJ,EAAa;AAClB,cAAIR,OAAO,OAAOA,IAAIqB,WAAX,KAA2B,UAAtC,EAAkD;AAChDF,oBAAQC,IAAR,CAAa,mDAAb;AACD;AACD,iBAAO,MAAMrB,GAAN,GAAY,IAAZ,GAAmBnC,QAAQ+C,MAAR,CAAeX,GAAf,CAAnB,GAAyC,GAAhD;AACD,SALM,MAKA;AACL,cAAIA,OAAO,OAAOA,IAAIqB,WAAX,KAA2B,UAAtC,EAAkD;AAChDF,oBAAQC,IAAR,CAAa,mDAAb;AACD;AACD,iBAAO,MAAMrB,GAAN,GAAY,IAAZ,GAAmBC,GAAnB,GAAyB,GAAhC;AACD;AACF,OA/BD;;AAiCA;;;;;;;AAOApC,cAAQ2B,KAAR,GAAgB,SAASA,KAAT,CAAegC,GAAf,EAAoBR,KAApB,EAA0B;AACxC,YAAIN,MAAM,EAAV;;AAEA,YAAIL,OAAOD,OAAOC,IAAP,CAAYmB,GAAZ,CAAX;;AAEA,YAAInB,KAAKjB,MAAT,EAAiB;AACf,eAAK,IAAIL,IAAI,CAAb,EAAgBA,IAAIsB,KAAKjB,MAAzB,EAAiC,EAAEL,CAAnC,EAAsC;AACpC,gBAAIiB,MAAMK,KAAKtB,CAAL,CAAV;AAAA,gBACIkB,MAAMuB,IAAIxB,GAAJ,CADV;;AAGA,gBAAI,WAAWA,GAAf,EAAoB;AAClB,kBAAIC,MAAMC,YAAYD,GAAZ,CAAV,EAA4B;AAC1BS,oBAAIC,IAAJ,CAAS,MAAMX,GAAN,GAAY,IAAZ,GAAmBC,GAAnB,GAAyB,GAAlC;AACD;AACF,aAJD,MAIO;AACLS,kBAAIC,IAAJ,CAAS9C,QAAQkD,IAAR,CAAaf,GAAb,EAAkBC,GAAlB,EAAuB,KAAvB,EAA8Be,KAA9B,CAAT;AACD;AACF;AACF;;AAED,eAAON,IAAIJ,IAAJ,CAAS,EAAT,CAAP;AACD,OArBD;;AAuBA;;;;;;;;AAQA,UAAImB,yBAAyB;AAC3B,aAAK,OADsB;AAE3B,aAAK,MAFsB;AAG3B,aAAK,MAHsB;AAI3B,aAAK;AAJsB,OAA7B;AAMA,UAAIC,kBAAkB,SAAtB;;AAEA,eAASC,gBAAT,CAA0BC,CAA1B,EAA6B;AAC3B,eAAOH,uBAAuBG,CAAvB,KAA6BA,CAApC;AACD;;AAED/D,cAAQ+C,MAAR,GAAiBiB,WAAjB;AACA,eAASA,WAAT,CAAqBC,IAArB,EAA0B;AACxB,YAAIC,SAASC,OAAOF,IAAP,EAAaP,OAAb,CAAqBG,eAArB,EAAsCC,gBAAtC,CAAb;AACA,YAAII,WAAW,KAAKD,IAApB,EAA0B,OAAOA,IAAP,CAA1B,KACK,OAAOC,MAAP;AACN;;AAED;;;;;;;;;;AAUAlE,cAAQoE,OAAR,GAAkB,SAASA,OAAT,CAAiBC,GAAjB,EAAsBC,QAAtB,EAAgCC,MAAhC,EAAwCC,GAAxC,EAA4C;AAC5D,YAAI,EAAEH,eAAelD,KAAjB,CAAJ,EAA6B,MAAMkD,GAAN;AAC7B,YAAI,CAAC,OAAOhE,MAAP,IAAiB,WAAjB,IAAgC,CAACiE,QAAlC,KAA+C,CAACE,GAApD,EAAyD;AACvDH,cAAII,OAAJ,IAAe,cAAcF,MAA7B;AACA,gBAAMF,GAAN;AACD;AACD,YAAI;AACFG,gBAAMA,OAAOvD,QAAQ,IAAR,EAAcyD,YAAd,CAA2BJ,QAA3B,EAAqC,MAArC,CAAb;AACD,SAFD,CAEE,OAAOK,EAAP,EAAW;AACXP,kBAAQC,GAAR,EAAa,IAAb,EAAmBE,MAAnB;AACD;AACD,YAAIK,UAAU,CAAd;AAAA,YACIC,QAAQL,IAAIM,KAAJ,CAAU,IAAV,CADZ;AAAA,YAEIC,QAAQC,KAAKC,GAAL,CAASV,SAASK,OAAlB,EAA2B,CAA3B,CAFZ;AAAA,YAGIM,MAAMF,KAAKG,GAAL,CAASN,MAAMtD,MAAf,EAAuBgD,SAASK,OAAhC,CAHV;;AAKA;AACA,YAAIA,UAAUC,MAAMO,KAAN,CAAYL,KAAZ,EAAmBG,GAAnB,EAAwB5C,GAAxB,CAA4B,UAAS+C,IAAT,EAAenE,CAAf,EAAiB;AACzD,cAAIoE,OAAOpE,IAAI6D,KAAJ,GAAY,CAAvB;AACA,iBAAO,CAACO,QAAQf,MAAR,GAAiB,MAAjB,GAA0B,MAA3B,IACHe,IADG,GAEH,IAFG,GAGHD,IAHJ;AAID,SANa,EAMX5C,IANW,CAMN,IANM,CAAd;;AAQA;AACA4B,YAAIkB,IAAJ,GAAWjB,QAAX;AACAD,YAAII,OAAJ,GAAc,CAACH,YAAY,MAAb,IAAuB,GAAvB,GAA6BC,MAA7B,GACV,IADU,GACHK,OADG,GACO,MADP,GACgBP,IAAII,OADlC;AAEA,cAAMJ,GAAN;AACD,OA9BD;;AAgCArE,cAAQwF,SAAR,GAAoB,SAASA,SAAT,CAAmBjB,MAAnB,EAA2BD,QAA3B,EAAqC;AACvD,aAAKC,MAAL,GAAcA,MAAd;AACA,aAAKD,QAAL,GAAgBA,QAAhB;AACD,OAHD;AAKC,KAxPyyB,EAwPxyB,EAAC,MAAK,CAAN,EAxPwyB,CAAH,EAwP3xB,GAAE,CAAC,UAASrD,OAAT,EAAiBhB,MAAjB,EAAwBD,OAAxB,EAAgC,CAE9C,CAFa,EAEZ,EAFY,CAxPyxB,EAA3b,EA0PrW,EA1PqW,EA0PlW,CAAC,CAAD,CA1PkW,EA0P7V,CA1P6V,CAAP;AA2PpW,CA3PD;ACAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AChxIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;ACx0iBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AC7qNA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AChgEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","file":"public/libraries.js","sourcesContent":["require.register('browser-resolve/empty', function(exports,req,module){\n var require = __makeRequire((req), {}, 'browser-resolve');\n (function(exports,require,module) {\n \n })(exports,require,module);\n });","require.register('co', function(exports,req,module){\n var require = __makeRequire((function(n) { return req(n.replace('./', 'co//')); }), {}, 'co');\n (function(exports,require,module) {\n \n/**\n * slice() reference.\n */\n\nvar slice = Array.prototype.slice;\n\n/**\n * Expose `co`.\n */\n\nmodule.exports = co['default'] = co.co = co;\n\n/**\n * Wrap the given generator `fn` into a\n * function that returns a promise.\n * This is a separate function so that\n * every `co()` call doesn't create a new,\n * unnecessary closure.\n *\n * @param {GeneratorFunction} fn\n * @return {Function}\n * @api public\n */\n\nco.wrap = function (fn) {\n createPromise.__generatorFunction__ = fn;\n return createPromise;\n function createPromise() {\n return co.call(this, fn.apply(this, arguments));\n }\n};\n\n/**\n * Execute the generator function or a generator\n * and return a promise.\n *\n * @param {Function} fn\n * @return {Promise}\n * @api public\n */\n\nfunction co(gen) {\n var ctx = this;\n var args = slice.call(arguments, 1)\n\n // we wrap everything in a promise to avoid promise chaining,\n // which leads to memory leak errors.\n // see https://github.com/tj/co/issues/180\n return new Promise(function(resolve, reject) {\n if (typeof gen === 'function') gen = gen.apply(ctx, args);\n if (!gen || typeof gen.next !== 'function') return resolve(gen);\n\n onFulfilled();\n\n /**\n * @param {Mixed} res\n * @return {Promise}\n * @api private\n */\n\n function onFulfilled(res) {\n var ret;\n try {\n ret = gen.next(res);\n } catch (e) {\n return reject(e);\n }\n next(ret);\n }\n\n /**\n * @param {Error} err\n * @return {Promise}\n * @api private\n */\n\n function onRejected(err) {\n var ret;\n try {\n ret = gen.throw(err);\n } catch (e) {\n return reject(e);\n }\n next(ret);\n }\n\n /**\n * Get the next value in the generator,\n * return a promise.\n *\n * @param {Object} ret\n * @return {Promise}\n * @api private\n */\n\n function next(ret) {\n if (ret.done) return resolve(ret.value);\n var value = toPromise.call(ctx, ret.value);\n if (value && isPromise(value)) return value.then(onFulfilled, onRejected);\n return onRejected(new TypeError('You may only yield a function, promise, generator, array, or object, '\n + 'but the following object was passed: \"' + String(ret.value) + '\"'));\n }\n });\n}\n\n/**\n * Convert a `yield`ed value into a promise.\n *\n * @param {Mixed} obj\n * @return {Promise}\n * @api private\n */\n\nfunction toPromise(obj) {\n if (!obj) return obj;\n if (isPromise(obj)) return obj;\n if (isGeneratorFunction(obj) || isGenerator(obj)) return co.call(this, obj);\n if ('function' == typeof obj) return thunkToPromise.call(this, obj);\n if (Array.isArray(obj)) return arrayToPromise.call(this, obj);\n if (isObject(obj)) return objectToPromise.call(this, obj);\n return obj;\n}\n\n/**\n * Convert a thunk to a promise.\n *\n * @param {Function}\n * @return {Promise}\n * @api private\n */\n\nfunction thunkToPromise(fn) {\n var ctx = this;\n return new Promise(function (resolve, reject) {\n fn.call(ctx, function (err, res) {\n if (err) return reject(err);\n if (arguments.length > 2) res = slice.call(arguments, 1);\n resolve(res);\n });\n });\n}\n\n/**\n * Convert an array of \"yieldables\" to a promise.\n * Uses `Promise.all()` internally.\n *\n * @param {Array} obj\n * @return {Promise}\n * @api private\n */\n\nfunction arrayToPromise(obj) {\n return Promise.all(obj.map(toPromise, this));\n}\n\n/**\n * Convert an object of \"yieldables\" to a promise.\n * Uses `Promise.all()` internally.\n *\n * @param {Object} obj\n * @return {Promise}\n * @api private\n */\n\nfunction objectToPromise(obj){\n var results = new obj.constructor();\n var keys = Object.keys(obj);\n var promises = [];\n for (var i = 0; i < keys.length; i++) {\n var key = keys[i];\n var promise = toPromise.call(this, obj[key]);\n if (promise && isPromise(promise)) defer(promise, key);\n else results[key] = obj[key];\n }\n return Promise.all(promises).then(function () {\n return results;\n });\n\n function defer(promise, key) {\n // predefine the key in the result\n results[key] = undefined;\n promises.push(promise.then(function (res) {\n results[key] = res;\n }));\n }\n}\n\n/**\n * Check if `obj` is a promise.\n *\n * @param {Object} obj\n * @return {Boolean}\n * @api private\n */\n\nfunction isPromise(obj) {\n return 'function' == typeof obj.then;\n}\n\n/**\n * Check if `obj` is a generator.\n *\n * @param {Mixed} obj\n * @return {Boolean}\n * @api private\n */\n\nfunction isGenerator(obj) {\n return 'function' == typeof obj.next && 'function' == typeof obj.throw;\n}\n\n/**\n * Check if `obj` is a generator function.\n *\n * @param {Mixed} obj\n * @return {Boolean}\n * @api private\n */\nfunction isGeneratorFunction(obj) {\n var constructor = obj.constructor;\n if (!constructor) return false;\n if ('GeneratorFunction' === constructor.name || 'GeneratorFunction' === constructor.displayName) return true;\n return isGenerator(constructor.prototype);\n}\n\n/**\n * Check for plain object.\n *\n * @param {Mixed} val\n * @return {Boolean}\n * @api private\n */\n\nfunction isObject(val) {\n return Object == val.constructor;\n}\n\n })(exports,require,module);\n });require.register('co/index', function(exports,require,module) {\n module.exports = require('co');\n });","require.register('moment', function(exports,req,module){\n var require = __makeRequire((function(n) { return req(n.replace('./', 'moment//')); }), {}, 'moment');\n (function(exports,require,module) {\n //! moment.js\n//! version : 2.6.0\n//! authors : Tim Wood, Iskren Chernev, Moment.js contributors\n//! license : MIT\n//! momentjs.com\n\n(function (undefined) {\n\n /************************************\n Constants\n ************************************/\n\n var moment,\n VERSION = \"2.6.0\",\n // the global-scope this is NOT the global object in Node.js\n globalScope = typeof global !== 'undefined' ? global : this,\n oldGlobalMoment,\n round = Math.round,\n i,\n\n YEAR = 0,\n MONTH = 1,\n DATE = 2,\n HOUR = 3,\n MINUTE = 4,\n SECOND = 5,\n MILLISECOND = 6,\n\n // internal storage for language config files\n languages = {},\n\n // moment internal properties\n momentProperties = {\n _isAMomentObject: null,\n _i : null,\n _f : null,\n _l : null,\n _strict : null,\n _isUTC : null,\n _offset : null, // optional. Combine with _isUTC\n _pf : null,\n _lang : null // optional\n },\n\n // check for nodeJS\n hasModule = (typeof module !== 'undefined' && module.exports),\n\n // ASP.NET json date format regex\n aspNetJsonRegex = /^\\/?Date\\((\\-?\\d+)/i,\n aspNetTimeSpanJsonRegex = /(\\-)?(?:(\\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 isoDurationRegex = /^(-)?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 // format tokens\n 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|zz?|ZZ?|.)/g,\n localFormattingTokens = /(\\[[^\\[]*\\])|(\\\\)?(LT|LL?L?L?|l{1,4})/g,\n\n // parsing token regexes\n parseTokenOneOrTwoDigits = /\\d\\d?/, // 0 - 99\n parseTokenOneToThreeDigits = /\\d{1,3}/, // 0 - 999\n parseTokenOneToFourDigits = /\\d{1,4}/, // 0 - 9999\n parseTokenOneToSixDigits = /[+\\-]?\\d{1,6}/, // -999,999 - 999,999\n parseTokenDigits = /\\d+/, // nonzero number of digits\n parseTokenWord = /[0-9]*['a-z\\u00A0-\\u05FF\\u0700-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]+|[\\u0600-\\u06FF\\/]+(\\s*?[\\u0600-\\u06FF]+){1,2}/i, // any word (or two) characters or numbers including two/three word month in arabic.\n parseTokenTimezone = /Z|[\\+\\-]\\d\\d:?\\d\\d/gi, // +00:00 -00:00 +0000 -0000 or Z\n parseTokenT = /T/i, // T (ISO separator)\n parseTokenTimestampMs = /[\\+\\-]?\\d+(\\.\\d{1,3})?/, // 123456789 123456789.123\n parseTokenOrdinal = /\\d{1,2}/,\n\n //strict parsing regexes\n parseTokenOneDigit = /\\d/, // 0 - 9\n parseTokenTwoDigits = /\\d\\d/, // 00 - 99\n parseTokenThreeDigits = /\\d{3}/, // 000 - 999\n parseTokenFourDigits = /\\d{4}/, // 0000 - 9999\n parseTokenSixDigits = /[+-]?\\d{6}/, // -999,999 - 999,999\n parseTokenSignedNumber = /[+-]?\\d+/, // -inf - inf\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)\n 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 isoFormat = 'YYYY-MM-DDTHH:mm:ssZ',\n\n 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 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 // timezone chunker \"+10:00\" > [\"10\", \"00\"] or \"-1530\" > [\"-15\", \"30\"]\n parseTimezoneChunker = /([\\+\\-]|\\d\\d)/gi,\n\n // getter and setter names\n proxyGettersAndSetters = 'Date|Hours|Minutes|Seconds|Milliseconds'.split('|'),\n unitMillisecondFactors = {\n 'Milliseconds' : 1,\n 'Seconds' : 1e3,\n 'Minutes' : 6e4,\n 'Hours' : 36e5,\n 'Days' : 864e5,\n 'Months' : 2592e6,\n 'Years' : 31536e6\n },\n\n unitAliases = {\n ms : 'millisecond',\n s : 'second',\n m : 'minute',\n h : 'hour',\n d : 'day',\n D : 'date',\n w : 'week',\n W : 'isoWeek',\n M : 'month',\n Q : 'quarter',\n y : 'year',\n DDD : 'dayOfYear',\n e : 'weekday',\n E : 'isoWeekday',\n gg: 'weekYear',\n GG: 'isoWeekYear'\n },\n\n camelFunctions = {\n dayofyear : 'dayOfYear',\n isoweekday : 'isoWeekday',\n isoweek : 'isoWeek',\n weekyear : 'weekYear',\n isoweekyear : 'isoWeekYear'\n },\n\n // format function strings\n formatFunctions = {},\n\n // tokens to ordinalize and pad\n ordinalizeTokens = 'DDD w W M D d'.split(' '),\n paddedTokens = 'M D H h m s w W'.split(' '),\n\n formatTokenFunctions = {\n M : function () {\n return this.month() + 1;\n },\n MMM : function (format) {\n return this.lang().monthsShort(this, format);\n },\n MMMM : function (format) {\n return this.lang().months(this, format);\n },\n D : function () {\n return this.date();\n },\n DDD : function () {\n return this.dayOfYear();\n },\n d : function () {\n return this.day();\n },\n dd : function (format) {\n return this.lang().weekdaysMin(this, format);\n },\n ddd : function (format) {\n return this.lang().weekdaysShort(this, format);\n },\n dddd : function (format) {\n return this.lang().weekdays(this, format);\n },\n w : function () {\n return this.week();\n },\n W : function () {\n return this.isoWeek();\n },\n YY : function () {\n return leftZeroFill(this.year() % 100, 2);\n },\n YYYY : function () {\n return leftZeroFill(this.year(), 4);\n },\n YYYYY : function () {\n return leftZeroFill(this.year(), 5);\n },\n YYYYYY : function () {\n var y = this.year(), sign = y >= 0 ? '+' : '-';\n return sign + leftZeroFill(Math.abs(y), 6);\n },\n gg : function () {\n return leftZeroFill(this.weekYear() % 100, 2);\n },\n gggg : function () {\n return leftZeroFill(this.weekYear(), 4);\n },\n ggggg : function () {\n return leftZeroFill(this.weekYear(), 5);\n },\n GG : function () {\n return leftZeroFill(this.isoWeekYear() % 100, 2);\n },\n GGGG : function () {\n return leftZeroFill(this.isoWeekYear(), 4);\n },\n GGGGG : function () {\n return leftZeroFill(this.isoWeekYear(), 5);\n },\n e : function () {\n return this.weekday();\n },\n E : function () {\n return this.isoWeekday();\n },\n a : function () {\n return this.lang().meridiem(this.hours(), this.minutes(), true);\n },\n A : function () {\n return this.lang().meridiem(this.hours(), this.minutes(), false);\n },\n H : function () {\n return this.hours();\n },\n h : function () {\n return this.hours() % 12 || 12;\n },\n m : function () {\n return this.minutes();\n },\n s : function () {\n return this.seconds();\n },\n S : function () {\n return toInt(this.milliseconds() / 100);\n },\n SS : function () {\n return leftZeroFill(toInt(this.milliseconds() / 10), 2);\n },\n SSS : function () {\n return leftZeroFill(this.milliseconds(), 3);\n },\n SSSS : function () {\n return leftZeroFill(this.milliseconds(), 3);\n },\n Z : function () {\n var a = -this.zone(),\n b = \"+\";\n if (a < 0) {\n a = -a;\n b = \"-\";\n }\n return b + leftZeroFill(toInt(a / 60), 2) + \":\" + leftZeroFill(toInt(a) % 60, 2);\n },\n ZZ : function () {\n var a = -this.zone(),\n b = \"+\";\n if (a < 0) {\n a = -a;\n b = \"-\";\n }\n return b + leftZeroFill(toInt(a / 60), 2) + leftZeroFill(toInt(a) % 60, 2);\n },\n z : function () {\n return this.zoneAbbr();\n },\n zz : function () {\n return this.zoneName();\n },\n X : function () {\n return this.unix();\n },\n Q : function () {\n return this.quarter();\n }\n },\n\n lists = ['months', 'monthsShort', 'weekdays', 'weekdaysShort', 'weekdaysMin'];\n\n function defaultParsingFlags() {\n // We need to deep clone this object, and es5 standard is not very\n // helpful.\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 deprecate(msg, fn) {\n var firstTime = true;\n function printMsg() {\n if (moment.suppressDeprecationWarnings === false &&\n typeof console !== 'undefined' && console.warn) {\n console.warn(\"Deprecation warning: \" + msg);\n }\n }\n return extend(function () {\n if (firstTime) {\n printMsg();\n firstTime = false;\n }\n return fn.apply(this, arguments);\n }, fn);\n }\n\n function padToken(func, count) {\n return function (a) {\n return leftZeroFill(func.call(this, a), count);\n };\n }\n function ordinalizeToken(func, period) {\n return function (a) {\n return this.lang().ordinal(func.call(this, a), period);\n };\n }\n\n while (ordinalizeTokens.length) {\n i = ordinalizeTokens.pop();\n formatTokenFunctions[i + 'o'] = ordinalizeToken(formatTokenFunctions[i], i);\n }\n while (paddedTokens.length) {\n i = paddedTokens.pop();\n formatTokenFunctions[i + i] = padToken(formatTokenFunctions[i], 2);\n }\n formatTokenFunctions.DDDD = padToken(formatTokenFunctions.DDD, 3);\n\n\n /************************************\n Constructors\n ************************************/\n\n function Language() {\n\n }\n\n // Moment prototype object\n function Moment(config) {\n checkOverflow(config);\n extend(this, config);\n }\n\n // Duration Constructor\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._bubble();\n }\n\n /************************************\n Helpers\n ************************************/\n\n\n function extend(a, b) {\n for (var i in b) {\n if (b.hasOwnProperty(i)) {\n a[i] = b[i];\n }\n }\n\n if (b.hasOwnProperty(\"toString\")) {\n a.toString = b.toString;\n }\n\n if (b.hasOwnProperty(\"valueOf\")) {\n a.valueOf = b.valueOf;\n }\n\n return a;\n }\n\n function cloneMoment(m) {\n var result = {}, i;\n for (i in m) {\n if (m.hasOwnProperty(i) && momentProperties.hasOwnProperty(i)) {\n result[i] = m[i];\n }\n }\n\n return result;\n }\n\n function absRound(number) {\n if (number < 0) {\n return Math.ceil(number);\n } else {\n return Math.floor(number);\n }\n }\n\n // left zero fill a number\n // see http://jsperf.com/left-zero-filling for performance comparison\n function leftZeroFill(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 // helper function for _.addTime and _.subtractTime\n function addOrSubtractDurationFromMoment(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 rawSetter(mom, 'Date', rawGetter(mom, 'Date') + days * isAdding);\n }\n if (months) {\n rawMonthSetter(mom, rawGetter(mom, 'Month') + months * isAdding);\n }\n if (updateOffset) {\n moment.updateOffset(mom, days || months);\n }\n }\n\n // check if is an array\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]' ||\n input instanceof Date;\n }\n\n // compare two arrays, return the number of differences\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 normalizeUnits(units) {\n if (units) {\n var lowered = units.toLowerCase().replace(/(.)s$/, '$1');\n units = unitAliases[units] || camelFunctions[lowered] || lowered;\n }\n return units;\n }\n\n function normalizeObjectUnits(inputObject) {\n var normalizedInput = {},\n normalizedProp,\n prop;\n\n for (prop in inputObject) {\n if (inputObject.hasOwnProperty(prop)) {\n normalizedProp = normalizeUnits(prop);\n if (normalizedProp) {\n normalizedInput[normalizedProp] = inputObject[prop];\n }\n }\n }\n\n return normalizedInput;\n }\n\n function makeList(field) {\n var count, setter;\n\n if (field.indexOf('week') === 0) {\n count = 7;\n setter = 'day';\n }\n else if (field.indexOf('month') === 0) {\n count = 12;\n setter = 'month';\n }\n else {\n return;\n }\n\n moment[field] = function (format, index) {\n var i, getter,\n method = moment.fn._lang[field],\n results = [];\n\n if (typeof format === 'number') {\n index = format;\n format = undefined;\n }\n\n getter = function (i) {\n var m = moment().utc().set(setter, i);\n return method.call(moment.fn._lang, m, format || '');\n };\n\n if (index != null) {\n return getter(index);\n }\n else {\n for (i = 0; i < count; i++) {\n results.push(getter(i));\n }\n return results;\n }\n };\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 daysInMonth(year, month) {\n return new Date(Date.UTC(year, month + 1, 0)).getUTCDate();\n }\n\n function weeksInYear(year, dow, doy) {\n return weekOfYear(moment([year, 11, 31 + dow - doy]), dow, doy).week;\n }\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 function checkOverflow(m) {\n var overflow;\n if (m._a && m._pf.overflow === -2) {\n overflow =\n m._a[MONTH] < 0 || m._a[MONTH] > 11 ? MONTH :\n m._a[DATE] < 1 || m._a[DATE] > daysInMonth(m._a[YEAR], m._a[MONTH]) ? DATE :\n m._a[HOUR] < 0 || m._a[HOUR] > 23 ? HOUR :\n m._a[MINUTE] < 0 || m._a[MINUTE] > 59 ? MINUTE :\n m._a[SECOND] < 0 || m._a[SECOND] > 59 ? SECOND :\n m._a[MILLISECOND] < 0 || m._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\n 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 }\n }\n return m._isValid;\n }\n\n function normalizeLanguage(key) {\n return key ? key.toLowerCase().replace('_', '-') : key;\n }\n\n // Return a moment from input, that is local/utc/zone equivalent to model.\n function makeAs(input, model) {\n return model._isUTC ? moment(input).zone(model._offset || 0) :\n moment(input).local();\n }\n\n /************************************\n Languages\n ************************************/\n\n\n extend(Language.prototype, {\n\n set : function (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 },\n\n _months : \"January_February_March_April_May_June_July_August_September_October_November_December\".split(\"_\"),\n months : function (m) {\n return this._months[m.month()];\n },\n\n _monthsShort : \"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec\".split(\"_\"),\n monthsShort : function (m) {\n return this._monthsShort[m.month()];\n },\n\n monthsParse : function (monthName) {\n var i, mom, regex;\n\n if (!this._monthsParse) {\n this._monthsParse = [];\n }\n\n for (i = 0; i < 12; i++) {\n // make the regex if we don't have it already\n if (!this._monthsParse[i]) {\n mom = moment.utc([2000, 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 (this._monthsParse[i].test(monthName)) {\n return i;\n }\n }\n },\n\n _weekdays : \"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday\".split(\"_\"),\n weekdays : function (m) {\n return this._weekdays[m.day()];\n },\n\n _weekdaysShort : \"Sun_Mon_Tue_Wed_Thu_Fri_Sat\".split(\"_\"),\n weekdaysShort : function (m) {\n return this._weekdaysShort[m.day()];\n },\n\n _weekdaysMin : \"Su_Mo_Tu_We_Th_Fr_Sa\".split(\"_\"),\n weekdaysMin : function (m) {\n return this._weekdaysMin[m.day()];\n },\n\n weekdaysParse : function (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 = moment([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 _longDateFormat : {\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 longDateFormat : function (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 isPM : function (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 _meridiemParse : /[ap]\\.?m?\\.?/i,\n meridiem : function (hours, minutes, isLower) {\n if (hours > 11) {\n return isLower ? 'pm' : 'PM';\n } else {\n return isLower ? 'am' : 'AM';\n }\n },\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 calendar : function (key, mom) {\n var output = this._calendar[key];\n return typeof output === 'function' ? output.apply(mom) : output;\n },\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 relativeTime : function (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 pastFuture : function (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 ordinal : function (number) {\n return this._ordinal.replace(\"%d\", number);\n },\n _ordinal : \"%d\",\n\n preparse : function (string) {\n return string;\n },\n\n postformat : function (string) {\n return string;\n },\n\n week : function (mom) {\n return weekOfYear(mom, this._week.dow, this._week.doy).week;\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 _invalidDate: 'Invalid date',\n invalidDate: function () {\n return this._invalidDate;\n }\n });\n\n // Loads a language definition into the `languages` cache. The function\n // takes a key and optionally values. If not in the browser and no values\n // are provided, it will load the language file module. As a convenience,\n // this function also returns the language values.\n function loadLang(key, values) {\n values.abbr = key;\n if (!languages[key]) {\n languages[key] = new Language();\n }\n languages[key].set(values);\n return languages[key];\n }\n\n // Remove a language from the `languages` cache. Mostly useful in tests.\n function unloadLang(key) {\n delete languages[key];\n }\n\n // Determines which language definition to use and returns it.\n //\n // With no parameters, it will return the global language. If you\n // pass in a language key, such as 'en', it will return the\n // definition for 'en', so long as 'en' has already been loaded using\n // moment.lang.\n function getLangDefinition(key) {\n var i = 0, j, lang, next, split,\n get = function (k) {\n if (!languages[k] && hasModule) {\n try {\n require('./lang/' + k);\n } catch (e) { }\n }\n return languages[k];\n };\n\n if (!key) {\n return moment.fn._lang;\n }\n\n if (!isArray(key)) {\n //short-circuit everything else\n lang = get(key);\n if (lang) {\n return lang;\n }\n key = [key];\n }\n\n //pick the language 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 while (i < key.length) {\n split = normalizeLanguage(key[i]).split('-');\n j = split.length;\n next = normalizeLanguage(key[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n lang = get(split.slice(0, j).join('-'));\n if (lang) {\n return lang;\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 moment.fn._lang;\n }\n\n /************************************\n Formatting\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\n if (!m.isValid()) {\n return m.lang().invalidDate();\n }\n\n format = expandFormat(format, m.lang());\n\n if (!formatFunctions[format]) {\n formatFunctions[format] = makeFormatFunction(format);\n }\n\n return formatFunctions[format](m);\n }\n\n function expandFormat(format, lang) {\n var i = 5;\n\n function replaceLongDateFormatTokens(input) {\n return lang.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\n /************************************\n Parsing\n ************************************/\n\n\n // get the regex to find the next token\n function getParseRegexForToken(token, config) {\n var a, strict = config._strict;\n switch (token) {\n case 'Q':\n return parseTokenOneDigit;\n case 'DDDD':\n return parseTokenThreeDigits;\n case 'YYYY':\n case 'GGGG':\n case 'gggg':\n return strict ? parseTokenFourDigits : parseTokenOneToFourDigits;\n case 'Y':\n case 'G':\n case 'g':\n return parseTokenSignedNumber;\n case 'YYYYYY':\n case 'YYYYY':\n case 'GGGGG':\n case 'ggggg':\n return strict ? parseTokenSixDigits : parseTokenOneToSixDigits;\n case 'S':\n if (strict) { return parseTokenOneDigit; }\n /* falls through */\n case 'SS':\n if (strict) { return parseTokenTwoDigits; }\n /* falls through */\n case 'SSS':\n if (strict) { return parseTokenThreeDigits; }\n /* falls through */\n case 'DDD':\n return parseTokenOneToThreeDigits;\n case 'MMM':\n case 'MMMM':\n case 'dd':\n case 'ddd':\n case 'dddd':\n return parseTokenWord;\n case 'a':\n case 'A':\n return getLangDefinition(config._l)._meridiemParse;\n case 'X':\n return parseTokenTimestampMs;\n case 'Z':\n case 'ZZ':\n return parseTokenTimezone;\n case 'T':\n return parseTokenT;\n case 'SSSS':\n return parseTokenDigits;\n case 'MM':\n case 'DD':\n case 'YY':\n case 'GG':\n case 'gg':\n case 'HH':\n case 'hh':\n case 'mm':\n case 'ss':\n case 'ww':\n case 'WW':\n return strict ? parseTokenTwoDigits : parseTokenOneOrTwoDigits;\n case 'M':\n case 'D':\n case 'd':\n case 'H':\n case 'h':\n case 'm':\n case 's':\n case 'w':\n case 'W':\n case 'e':\n case 'E':\n return parseTokenOneOrTwoDigits;\n case 'Do':\n return parseTokenOrdinal;\n default :\n a = new RegExp(regexpEscape(unescapeFormat(token.replace('\\\\', '')), \"i\"));\n return a;\n }\n }\n\n function timezoneMinutesFromString(string) {\n string = string || \"\";\n var possibleTzMatches = (string.match(parseTokenTimezone) || []),\n tzChunk = possibleTzMatches[possibleTzMatches.length - 1] || [],\n parts = (tzChunk + '').match(parseTimezoneChunker) || ['-', 0, 0],\n minutes = +(parts[1] * 60) + toInt(parts[2]);\n\n return parts[0] === '+' ? -minutes : minutes;\n }\n\n // function to convert string input to date\n function addTimeToArrayFromToken(token, input, config) {\n var a, datePartArray = config._a;\n\n switch (token) {\n // QUARTER\n case 'Q':\n if (input != null) {\n datePartArray[MONTH] = (toInt(input) - 1) * 3;\n }\n break;\n // MONTH\n case 'M' : // fall through to MM\n case 'MM' :\n if (input != null) {\n datePartArray[MONTH] = toInt(input) - 1;\n }\n break;\n case 'MMM' : // fall through to MMMM\n case 'MMMM' :\n a = getLangDefinition(config._l).monthsParse(input);\n // if we didn't find a month name, mark the date as invalid.\n if (a != null) {\n datePartArray[MONTH] = a;\n } else {\n config._pf.invalidMonth = input;\n }\n break;\n // DAY OF MONTH\n case 'D' : // fall through to DD\n case 'DD' :\n if (input != null) {\n datePartArray[DATE] = toInt(input);\n }\n break;\n case 'Do' :\n if (input != null) {\n datePartArray[DATE] = toInt(parseInt(input, 10));\n }\n break;\n // DAY OF YEAR\n case 'DDD' : // fall through to DDDD\n case 'DDDD' :\n if (input != null) {\n config._dayOfYear = toInt(input);\n }\n\n break;\n // YEAR\n case 'YY' :\n datePartArray[YEAR] = moment.parseTwoDigitYear(input);\n break;\n case 'YYYY' :\n case 'YYYYY' :\n case 'YYYYYY' :\n datePartArray[YEAR] = toInt(input);\n break;\n // AM / PM\n case 'a' : // fall through to A\n case 'A' :\n config._isPm = getLangDefinition(config._l).isPM(input);\n break;\n // 24 HOUR\n case 'H' : // fall through to hh\n case 'HH' : // fall through to hh\n case 'h' : // fall through to hh\n case 'hh' :\n datePartArray[HOUR] = toInt(input);\n break;\n // MINUTE\n case 'm' : // fall through to mm\n case 'mm' :\n datePartArray[MINUTE] = toInt(input);\n break;\n // SECOND\n case 's' : // fall through to ss\n case 'ss' :\n datePartArray[SECOND] = toInt(input);\n break;\n // MILLISECOND\n case 'S' :\n case 'SS' :\n case 'SSS' :\n case 'SSSS' :\n datePartArray[MILLISECOND] = toInt(('0.' + input) * 1000);\n break;\n // UNIX TIMESTAMP WITH MS\n case 'X':\n config._d = new Date(parseFloat(input) * 1000);\n break;\n // TIMEZONE\n case 'Z' : // fall through to ZZ\n case 'ZZ' :\n config._useUTC = true;\n config._tzm = timezoneMinutesFromString(input);\n break;\n case 'w':\n case 'ww':\n case 'W':\n case 'WW':\n case 'd':\n case 'dd':\n case 'ddd':\n case 'dddd':\n case 'e':\n case 'E':\n token = token.substr(0, 1);\n /* falls through */\n case 'gg':\n case 'gggg':\n case 'GG':\n case 'GGGG':\n case 'GGGGG':\n token = token.substr(0, 2);\n if (input) {\n config._w = config._w || {};\n config._w[token] = input;\n }\n break;\n }\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 dateFromConfig(config) {\n var i, date, input = [], currentDate,\n yearToUse, fixYear, w, temp, lang, weekday, week;\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 fixYear = function (val) {\n var intVal = parseInt(val, 10);\n return val ?\n (val.length < 3 ? (intVal > 68 ? 1900 + intVal : 2000 + intVal) : intVal) :\n (config._a[YEAR] == null ? moment().weekYear() : config._a[YEAR]);\n };\n\n w = config._w;\n if (w.GG != null || w.W != null || w.E != null) {\n temp = dayOfYearFromWeeks(fixYear(w.GG), w.W || 1, w.E, 4, 1);\n }\n else {\n lang = getLangDefinition(config._l);\n weekday = w.d != null ? parseWeekday(w.d, lang) :\n (w.e != null ? parseInt(w.e, 10) + lang._week.dow : 0);\n\n week = parseInt(w.w, 10) || 1;\n\n //if we're parsing 'd', then the low day numbers may be next week\n if (w.d != null && weekday < lang._week.dow) {\n week++;\n }\n\n temp = dayOfYearFromWeeks(fixYear(w.gg), week, weekday, lang._week.doy, lang._week.dow);\n }\n\n config._a[YEAR] = temp.year;\n config._dayOfYear = temp.dayOfYear;\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = config._a[YEAR] == null ? currentDate[YEAR] : config._a[YEAR];\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n config._pf._overflowDayOfYear = true;\n }\n\n date = makeUTCDate(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 // add the offsets to the time to be parsed so that we can have a clean array for checking isValid\n input[HOUR] += toInt((config._tzm || 0) / 60);\n input[MINUTE] += toInt((config._tzm || 0) % 60);\n\n config._d = (config._useUTC ? makeUTCDate : makeDate).apply(null, input);\n }\n\n function dateFromObject(config) {\n var normalizedInput;\n\n if (config._d) {\n return;\n }\n\n normalizedInput = normalizeObjectUnits(config._i);\n config._a = [\n normalizedInput.year,\n normalizedInput.month,\n normalizedInput.day,\n normalizedInput.hour,\n normalizedInput.minute,\n normalizedInput.second,\n normalizedInput.millisecond\n ];\n\n dateFromConfig(config);\n }\n\n function currentDateArray(config) {\n var now = new Date();\n if (config._useUTC) {\n return [\n now.getUTCFullYear(),\n now.getUTCMonth(),\n now.getUTCDate()\n ];\n } else {\n return [now.getFullYear(), now.getMonth(), now.getDate()];\n }\n }\n\n // date from string and format string\n function makeDateFromStringAndFormat(config) {\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 lang = getLangDefinition(config._l),\n string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, lang).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 // handle am pm\n if (config._isPm && config._a[HOUR] < 12) {\n config._a[HOUR] += 12;\n }\n // if is 12 am, change hours to 0\n if (config._isPm === false && config._a[HOUR] === 12) {\n config._a[HOUR] = 0;\n }\n\n dateFromConfig(config);\n checkOverflow(config);\n }\n\n function unescapeFormat(s) {\n return s.replace(/\\\\(\\[)|\\\\(\\])|\\[([^\\]\\[]*)\\]|\\\\(.)/g, function (matched, p1, p2, p3, p4) {\n return p1 || p2 || p3 || p4;\n });\n }\n\n // Code from http://stackoverflow.com/questions/3561493/is-there-a-regexp-escape-function-in-javascript\n function regexpEscape(s) {\n return s.replace(/[-\\/\\\\^$*+?.()|[\\]{}]/g, '\\\\$&');\n }\n\n // date from string and array of format strings\n function makeDateFromStringAndArray(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 = extend({}, config);\n tempConfig._pf = defaultParsingFlags();\n tempConfig._f = config._f[i];\n makeDateFromStringAndFormat(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\n // date from iso format\n function makeDateFromString(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(parseTokenTimezone)) {\n config._f += \"Z\";\n }\n makeDateFromStringAndFormat(config);\n }\n else {\n moment.createFromInputFallback(config);\n }\n }\n\n function makeDateFromInput(config) {\n var input = config._i,\n matched = aspNetJsonRegex.exec(input);\n\n if (input === undefined) {\n config._d = new Date();\n } else if (matched) {\n config._d = new Date(+matched[1]);\n } else if (typeof input === 'string') {\n makeDateFromString(config);\n } else if (isArray(input)) {\n config._a = input.slice(0);\n dateFromConfig(config);\n } else if (isDate(input)) {\n config._d = new Date(+input);\n } else if (typeof(input) === 'object') {\n dateFromObject(config);\n } else if (typeof(input) === 'number') {\n // from milliseconds\n config._d = new Date(input);\n } else {\n moment.createFromInputFallback(config);\n }\n }\n\n function makeDate(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 makeUTCDate(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 function parseWeekday(input, language) {\n if (typeof input === 'string') {\n if (!isNaN(input)) {\n input = parseInt(input, 10);\n }\n else {\n input = language.weekdaysParse(input);\n if (typeof input !== 'number') {\n return null;\n }\n }\n }\n return input;\n }\n\n /************************************\n Relative Time\n ************************************/\n\n\n // helper function for moment.fn.from, moment.fn.fromNow, and moment.duration.fn.humanize\n function substituteTimeAgo(string, number, withoutSuffix, isFuture, lang) {\n return lang.relativeTime(number || 1, !!withoutSuffix, string, isFuture);\n }\n\n function relativeTime(milliseconds, withoutSuffix, lang) {\n var seconds = round(Math.abs(milliseconds) / 1000),\n minutes = round(seconds / 60),\n hours = round(minutes / 60),\n days = round(hours / 24),\n years = round(days / 365),\n args = seconds < 45 && ['s', seconds] ||\n minutes === 1 && ['m'] ||\n minutes < 45 && ['mm', minutes] ||\n hours === 1 && ['h'] ||\n hours < 22 && ['hh', hours] ||\n days === 1 && ['d'] ||\n days <= 25 && ['dd', days] ||\n days <= 45 && ['M'] ||\n days < 345 && ['MM', round(days / 30)] ||\n years === 1 && ['y'] || ['yy', years];\n args[2] = withoutSuffix;\n args[3] = milliseconds > 0;\n args[4] = lang;\n return substituteTimeAgo.apply({}, args);\n }\n\n\n /************************************\n Week of Year\n ************************************/\n\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 = moment(mom).add('d', daysToDayOfWeek);\n return {\n week: Math.ceil(adjustedMoment.dayOfYear() / 7),\n year: adjustedMoment.year()\n };\n }\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 = makeUTCDate(year, 0, 1).getUTCDay(), daysToAdd, dayOfYear;\n\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 /************************************\n Top Level Functions\n ************************************/\n\n function makeMoment(config) {\n var input = config._i,\n format = config._f;\n\n if (input === null || (format === undefined && input === '')) {\n return moment.invalid({nullInput: true});\n }\n\n if (typeof input === 'string') {\n config._i = input = getLangDefinition().preparse(input);\n }\n\n if (moment.isMoment(input)) {\n config = cloneMoment(input);\n\n config._d = new Date(+input._d);\n } else if (format) {\n if (isArray(format)) {\n makeDateFromStringAndArray(config);\n } else {\n makeDateFromStringAndFormat(config);\n }\n } else {\n makeDateFromInput(config);\n }\n\n return new Moment(config);\n }\n\n moment = function (input, format, lang, strict) {\n var c;\n\n if (typeof(lang) === \"boolean\") {\n strict = lang;\n lang = undefined;\n }\n // object construction must be done this way.\n // https://github.com/moment/moment/issues/1423\n c = {};\n c._isAMomentObject = true;\n c._i = input;\n c._f = format;\n c._l = lang;\n c._strict = strict;\n c._isUTC = false;\n c._pf = defaultParsingFlags();\n\n return makeMoment(c);\n };\n\n moment.suppressDeprecationWarnings = false;\n\n moment.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);\n });\n\n // creating with utc\n moment.utc = function (input, format, lang, strict) {\n var c;\n\n if (typeof(lang) === \"boolean\") {\n strict = lang;\n lang = undefined;\n }\n // object construction must be done this way.\n // https://github.com/moment/moment/issues/1423\n c = {};\n c._isAMomentObject = true;\n c._useUTC = true;\n c._isUTC = true;\n c._l = lang;\n c._i = input;\n c._f = format;\n c._strict = strict;\n c._pf = defaultParsingFlags();\n\n return makeMoment(c).utc();\n };\n\n // creating with unix timestamp (in seconds)\n moment.unix = function (input) {\n return moment(input * 1000);\n };\n\n // duration\n moment.duration = function (input, key) {\n var duration = input,\n // matching against regexp is expensive, do it on demand\n match = null,\n sign,\n ret,\n parseIso;\n\n if (moment.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 = aspNetTimeSpanJsonRegex.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 = isoDurationRegex.exec(input))) {\n sign = (match[1] === \"-\") ? -1 : 1;\n parseIso = function (inp) {\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 duration = {\n y: parseIso(match[2]),\n M: parseIso(match[3]),\n d: parseIso(match[4]),\n h: parseIso(match[5]),\n m: parseIso(match[6]),\n s: parseIso(match[7]),\n w: parseIso(match[8])\n };\n }\n\n ret = new Duration(duration);\n\n if (moment.isDuration(input) && input.hasOwnProperty('_lang')) {\n ret._lang = input._lang;\n }\n\n return ret;\n };\n\n // version number\n moment.version = VERSION;\n\n // default format\n moment.defaultFormat = isoFormat;\n\n // Plugins that add properties should also add the key here (null value),\n // so we can properly clone ourselves.\n moment.momentProperties = momentProperties;\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 moment.updateOffset = function () {};\n\n // This function will load languages and then set the global language. If\n // no arguments are passed in, it will simply return the current global\n // language key.\n moment.lang = function (key, values) {\n var r;\n if (!key) {\n return moment.fn._lang._abbr;\n }\n if (values) {\n loadLang(normalizeLanguage(key), values);\n } else if (values === null) {\n unloadLang(key);\n key = 'en';\n } else if (!languages[key]) {\n getLangDefinition(key);\n }\n r = moment.duration.fn._lang = moment.fn._lang = getLangDefinition(key);\n return r._abbr;\n };\n\n // returns language data\n moment.langData = function (key) {\n if (key && key._lang && key._lang._abbr) {\n key = key._lang._abbr;\n }\n return getLangDefinition(key);\n };\n\n // compare moment object\n moment.isMoment = function (obj) {\n return obj instanceof Moment ||\n (obj != null && obj.hasOwnProperty('_isAMomentObject'));\n };\n\n // for typechecking Duration objects\n moment.isDuration = function (obj) {\n return obj instanceof Duration;\n };\n\n for (i = lists.length - 1; i >= 0; --i) {\n makeList(lists[i]);\n }\n\n moment.normalizeUnits = function (units) {\n return normalizeUnits(units);\n };\n\n moment.invalid = function (flags) {\n var m = moment.utc(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 moment.parseZone = function () {\n return moment.apply(null, arguments).parseZone();\n };\n\n moment.parseTwoDigitYear = function (input) {\n return toInt(input) + (toInt(input) > 68 ? 1900 : 2000);\n };\n\n /************************************\n Moment Prototype\n ************************************/\n\n\n extend(moment.fn = Moment.prototype, {\n\n clone : function () {\n return moment(this);\n },\n\n valueOf : function () {\n return +this._d + ((this._offset || 0) * 60000);\n },\n\n unix : function () {\n return Math.floor(+this / 1000);\n },\n\n toString : function () {\n return this.clone().lang('en').format(\"ddd MMM DD YYYY HH:mm:ss [GMT]ZZ\");\n },\n\n toDate : function () {\n return this._offset ? new Date(+this) : this._d;\n },\n\n toISOString : function () {\n var m = moment(this).utc();\n if (0 < m.year() && m.year() <= 9999) {\n return formatMoment(m, 'YYYY-MM-DD[T]HH:mm:ss.SSS[Z]');\n } else {\n return formatMoment(m, 'YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]');\n }\n },\n\n toArray : function () {\n var m = this;\n return [\n m.year(),\n m.month(),\n m.date(),\n m.hours(),\n m.minutes(),\n m.seconds(),\n m.milliseconds()\n ];\n },\n\n isValid : function () {\n return isValid(this);\n },\n\n isDSTShifted : function () {\n\n if (this._a) {\n return this.isValid() && compareArrays(this._a, (this._isUTC ? moment.utc(this._a) : moment(this._a)).toArray()) > 0;\n }\n\n return false;\n },\n\n parsingFlags : function () {\n return extend({}, this._pf);\n },\n\n invalidAt: function () {\n return this._pf.overflow;\n },\n\n utc : function () {\n return this.zone(0);\n },\n\n local : function () {\n this.zone(0);\n this._isUTC = false;\n return this;\n },\n\n format : function (inputString) {\n var output = formatMoment(this, inputString || moment.defaultFormat);\n return this.lang().postformat(output);\n },\n\n add : function (input, val) {\n var dur;\n // switch args to support add('s', 1) and add(1, 's')\n if (typeof input === 'string') {\n dur = moment.duration(+val, input);\n } else {\n dur = moment.duration(input, val);\n }\n addOrSubtractDurationFromMoment(this, dur, 1);\n return this;\n },\n\n subtract : function (input, val) {\n var dur;\n // switch args to support subtract('s', 1) and subtract(1, 's')\n if (typeof input === 'string') {\n dur = moment.duration(+val, input);\n } else {\n dur = moment.duration(input, val);\n }\n addOrSubtractDurationFromMoment(this, dur, -1);\n return this;\n },\n\n diff : function (input, units, asFloat) {\n var that = makeAs(input, this),\n zoneDiff = (this.zone() - that.zone()) * 6e4,\n diff, output;\n\n units = normalizeUnits(units);\n\n if (units === 'year' || units === 'month') {\n // average number of days in the months in the given dates\n diff = (this.daysInMonth() + that.daysInMonth()) * 432e5; // 24 * 60 * 60 * 1000 / 2\n // difference in months\n output = ((this.year() - that.year()) * 12) + (this.month() - that.month());\n // adjust by taking difference in days, average number of days\n // and dst in the given months.\n output += ((this - moment(this).startOf('month')) -\n (that - moment(that).startOf('month'))) / diff;\n // same as above but with zones, to negate all dst\n output -= ((this.zone() - moment(this).startOf('month').zone()) -\n (that.zone() - moment(that).startOf('month').zone())) * 6e4 / diff;\n if (units === 'year') {\n output = output / 12;\n }\n } else {\n diff = (this - that);\n output = units === 'second' ? diff / 1e3 : // 1000\n units === 'minute' ? diff / 6e4 : // 1000 * 60\n units === 'hour' ? diff / 36e5 : // 1000 * 60 * 60\n units === 'day' ? (diff - zoneDiff) / 864e5 : // 1000 * 60 * 60 * 24, negate dst\n units === 'week' ? (diff - zoneDiff) / 6048e5 : // 1000 * 60 * 60 * 24 * 7, negate dst\n diff;\n }\n return asFloat ? output : absRound(output);\n },\n\n from : function (time, withoutSuffix) {\n return moment.duration(this.diff(time)).lang(this.lang()._abbr).humanize(!withoutSuffix);\n },\n\n fromNow : function (withoutSuffix) {\n return this.from(moment(), withoutSuffix);\n },\n\n calendar : function () {\n // We want to compare the start of today, vs this.\n // Getting start-of-today depends on whether we're zone'd or not.\n var sod = makeAs(moment(), 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.lang().calendar(format, this));\n },\n\n isLeapYear : function () {\n return isLeapYear(this.year());\n },\n\n isDST : function () {\n return (this.zone() < this.clone().month(0).zone() ||\n this.zone() < this.clone().month(5).zone());\n },\n\n day : function (input) {\n var day = this._isUTC ? this._d.getUTCDay() : this._d.getDay();\n if (input != null) {\n input = parseWeekday(input, this.lang());\n return this.add({ d : input - day });\n } else {\n return day;\n }\n },\n\n month : makeAccessor('Month', true),\n\n startOf: function (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 /* falls through */\n }\n\n // weeks are a special case\n if (units === 'week') {\n this.weekday(0);\n } else 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 endOf: function (units) {\n units = normalizeUnits(units);\n return this.startOf(units).add((units === 'isoWeek' ? 'week' : units), 1).subtract('ms', 1);\n },\n\n isAfter: function (input, units) {\n units = typeof units !== 'undefined' ? units : 'millisecond';\n return +this.clone().startOf(units) > +moment(input).startOf(units);\n },\n\n isBefore: function (input, units) {\n units = typeof units !== 'undefined' ? units : 'millisecond';\n return +this.clone().startOf(units) < +moment(input).startOf(units);\n },\n\n isSame: function (input, units) {\n units = units || 'ms';\n return +this.clone().startOf(units) === +makeAs(input, this).startOf(units);\n },\n\n min: function (other) {\n other = moment.apply(null, arguments);\n return other < this ? this : other;\n },\n\n max: function (other) {\n other = moment.apply(null, arguments);\n return other > this ? this : other;\n },\n\n // keepTime = true means only change the timezone, without affecting\n // the local hour. So 5:31:26 +0300 --[zone(2, true)]--> 5:31:26 +0200\n // It is possible that 5:31:26 doesn't exist int zone +0200, so we\n // 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 zone : function (input, keepTime) {\n var offset = this._offset || 0;\n if (input != null) {\n if (typeof input === \"string\") {\n input = timezoneMinutesFromString(input);\n }\n if (Math.abs(input) < 16) {\n input = input * 60;\n }\n this._offset = input;\n this._isUTC = true;\n if (offset !== input) {\n if (!keepTime || this._changeInProgress) {\n addOrSubtractDurationFromMoment(this,\n moment.duration(offset - input, 'm'), 1, false);\n } else if (!this._changeInProgress) {\n this._changeInProgress = true;\n moment.updateOffset(this, true);\n this._changeInProgress = null;\n }\n }\n } else {\n return this._isUTC ? offset : this._d.getTimezoneOffset();\n }\n return this;\n },\n\n zoneAbbr : function () {\n return this._isUTC ? \"UTC\" : \"\";\n },\n\n zoneName : function () {\n return this._isUTC ? \"Coordinated Universal Time\" : \"\";\n },\n\n parseZone : function () {\n if (this._tzm) {\n this.zone(this._tzm);\n } else if (typeof this._i === 'string') {\n this.zone(this._i);\n }\n return this;\n },\n\n hasAlignedHourOffset : function (input) {\n if (!input) {\n input = 0;\n }\n else {\n input = moment(input).zone();\n }\n\n return (this.zone() - input) % 60 === 0;\n },\n\n daysInMonth : function () {\n return daysInMonth(this.year(), this.month());\n },\n\n dayOfYear : function (input) {\n var dayOfYear = round((moment(this).startOf('day') - moment(this).startOf('year')) / 864e5) + 1;\n return input == null ? dayOfYear : this.add(\"d\", (input - dayOfYear));\n },\n\n quarter : function (input) {\n return input == null ? Math.ceil((this.month() + 1) / 3) : this.month((input - 1) * 3 + this.month() % 3);\n },\n\n weekYear : function (input) {\n var year = weekOfYear(this, this.lang()._week.dow, this.lang()._week.doy).year;\n return input == null ? year : this.add(\"y\", (input - year));\n },\n\n isoWeekYear : function (input) {\n var year = weekOfYear(this, 1, 4).year;\n return input == null ? year : this.add(\"y\", (input - year));\n },\n\n week : function (input) {\n var week = this.lang().week(this);\n return input == null ? week : this.add(\"d\", (input - week) * 7);\n },\n\n isoWeek : function (input) {\n var week = weekOfYear(this, 1, 4).week;\n return input == null ? week : this.add(\"d\", (input - week) * 7);\n },\n\n weekday : function (input) {\n var weekday = (this.day() + 7 - this.lang()._week.dow) % 7;\n return input == null ? weekday : this.add(\"d\", input - weekday);\n },\n\n isoWeekday : function (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 isoWeeksInYear : function () {\n return weeksInYear(this.year(), 1, 4);\n },\n\n weeksInYear : function () {\n var weekInfo = this._lang._week;\n return weeksInYear(this.year(), weekInfo.dow, weekInfo.doy);\n },\n\n get : function (units) {\n units = normalizeUnits(units);\n return this[units]();\n },\n\n set : function (units, value) {\n units = normalizeUnits(units);\n if (typeof this[units] === 'function') {\n this[units](value);\n }\n return this;\n },\n\n // If passed a language key, it will set the language for this\n // instance. Otherwise, it will return the language configuration\n // variables for this instance.\n lang : function (key) {\n if (key === undefined) {\n return this._lang;\n } else {\n this._lang = getLangDefinition(key);\n return this;\n }\n }\n });\n\n function rawMonthSetter(mom, value) {\n var dayOfMonth;\n\n // TODO: Move this out of here!\n if (typeof value === 'string') {\n value = mom.lang().monthsParse(value);\n // TODO: Another silent failure?\n if (typeof value !== 'number') {\n return mom;\n }\n }\n\n dayOfMonth = Math.min(mom.date(),\n daysInMonth(mom.year(), value));\n mom._d['set' + (mom._isUTC ? 'UTC' : '') + 'Month'](value, dayOfMonth);\n return mom;\n }\n\n function rawGetter(mom, unit) {\n return mom._d['get' + (mom._isUTC ? 'UTC' : '') + unit]();\n }\n\n function rawSetter(mom, unit, value) {\n if (unit === 'Month') {\n return rawMonthSetter(mom, value);\n } else {\n return mom._d['set' + (mom._isUTC ? 'UTC' : '') + unit](value);\n }\n }\n\n function makeAccessor(unit, keepTime) {\n return function (value) {\n if (value != null) {\n rawSetter(this, unit, value);\n moment.updateOffset(this, keepTime);\n return this;\n } else {\n return rawGetter(this, unit);\n }\n };\n }\n\n moment.fn.millisecond = moment.fn.milliseconds = makeAccessor('Milliseconds', false);\n moment.fn.second = moment.fn.seconds = makeAccessor('Seconds', false);\n moment.fn.minute = moment.fn.minutes = makeAccessor('Minutes', false);\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 moment.fn.hour = moment.fn.hours = makeAccessor('Hours', true);\n // moment.fn.month is defined separately\n moment.fn.date = makeAccessor('Date', true);\n moment.fn.dates = deprecate(\"dates accessor is deprecated. Use date instead.\", makeAccessor('Date', true));\n moment.fn.year = makeAccessor('FullYear', true);\n moment.fn.years = deprecate(\"years accessor is deprecated. Use year instead.\", makeAccessor('FullYear', true));\n\n // add plural methods\n moment.fn.days = moment.fn.day;\n moment.fn.months = moment.fn.month;\n moment.fn.weeks = moment.fn.week;\n moment.fn.isoWeeks = moment.fn.isoWeek;\n moment.fn.quarters = moment.fn.quarter;\n\n // add aliased format methods\n moment.fn.toJSON = moment.fn.toISOString;\n\n /************************************\n Duration Prototype\n ************************************/\n\n\n extend(moment.duration.fn = Duration.prototype, {\n\n _bubble : function () {\n var milliseconds = this._milliseconds,\n days = this._days,\n months = this._months,\n data = this._data,\n seconds, minutes, hours, years;\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 = absRound(milliseconds / 1000);\n data.seconds = seconds % 60;\n\n minutes = absRound(seconds / 60);\n data.minutes = minutes % 60;\n\n hours = absRound(minutes / 60);\n data.hours = hours % 24;\n\n days += absRound(hours / 24);\n data.days = days % 30;\n\n months += absRound(days / 30);\n data.months = months % 12;\n\n years = absRound(months / 12);\n data.years = years;\n },\n\n weeks : function () {\n return absRound(this.days() / 7);\n },\n\n valueOf : function () {\n return this._milliseconds +\n this._days * 864e5 +\n (this._months % 12) * 2592e6 +\n toInt(this._months / 12) * 31536e6;\n },\n\n humanize : function (withSuffix) {\n var difference = +this,\n output = relativeTime(difference, !withSuffix, this.lang());\n\n if (withSuffix) {\n output = this.lang().pastFuture(difference, output);\n }\n\n return this.lang().postformat(output);\n },\n\n add : function (input, val) {\n // supports only 2.0-style add(1, 's') or add(moment)\n var dur = moment.duration(input, val);\n\n this._milliseconds += dur._milliseconds;\n this._days += dur._days;\n this._months += dur._months;\n\n this._bubble();\n\n return this;\n },\n\n subtract : function (input, val) {\n var dur = moment.duration(input, val);\n\n this._milliseconds -= dur._milliseconds;\n this._days -= dur._days;\n this._months -= dur._months;\n\n this._bubble();\n\n return this;\n },\n\n get : function (units) {\n units = normalizeUnits(units);\n return this[units.toLowerCase() + 's']();\n },\n\n as : function (units) {\n units = normalizeUnits(units);\n return this['as' + units.charAt(0).toUpperCase() + units.slice(1) + 's']();\n },\n\n lang : moment.fn.lang,\n\n toIsoString : function () {\n // inspired by https://github.com/dordille/moment-isoduration/blob/master/moment.isoduration.js\n var years = Math.abs(this.years()),\n months = Math.abs(this.months()),\n days = Math.abs(this.days()),\n hours = Math.abs(this.hours()),\n minutes = Math.abs(this.minutes()),\n seconds = Math.abs(this.seconds() + this.milliseconds() / 1000);\n\n if (!this.asSeconds()) {\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 (this.asSeconds() < 0 ? '-' : '') +\n 'P' +\n (years ? years + 'Y' : '') +\n (months ? months + 'M' : '') +\n (days ? days + 'D' : '') +\n ((hours || minutes || seconds) ? 'T' : '') +\n (hours ? hours + 'H' : '') +\n (minutes ? minutes + 'M' : '') +\n (seconds ? seconds + 'S' : '');\n }\n });\n\n function makeDurationGetter(name) {\n moment.duration.fn[name] = function () {\n return this._data[name];\n };\n }\n\n function makeDurationAsGetter(name, factor) {\n moment.duration.fn['as' + name] = function () {\n return +this / factor;\n };\n }\n\n for (i in unitMillisecondFactors) {\n if (unitMillisecondFactors.hasOwnProperty(i)) {\n makeDurationAsGetter(i, unitMillisecondFactors[i]);\n makeDurationGetter(i.toLowerCase());\n }\n }\n\n makeDurationAsGetter('Weeks', 6048e5);\n moment.duration.fn.asMonths = function () {\n return (+this - this.years() * 31536e6) / 2592e6 + this.years() * 12;\n };\n\n\n /************************************\n Default Lang\n ************************************/\n\n\n // Set default language, other languages will inherit from English.\n moment.lang('en', {\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 /* EMBED_LANGUAGES */\n\n /************************************\n Exposing Moment\n ************************************/\n\n function makeGlobal(shouldDeprecate) {\n /*global ender:false */\n if (typeof ender !== 'undefined') {\n return;\n }\n oldGlobalMoment = globalScope.moment;\n if (shouldDeprecate) {\n globalScope.moment = deprecate(\n \"Accessing Moment through the global scope is \" +\n \"deprecated, and will be removed in an upcoming \" +\n \"release.\",\n moment);\n } else {\n globalScope.moment = moment;\n }\n }\n\n // CommonJS module is defined\n if (hasModule) {\n module.exports = moment;\n } else if (typeof define === \"function\" && define.amd) {\n define(\"moment\", function (require, exports, module) {\n if (module.config && module.config() && module.config().noGlobal === true) {\n // release the global variable\n globalScope.moment = oldGlobalMoment;\n }\n\n return moment;\n });\n makeGlobal(true);\n } else {\n makeGlobal();\n }\n}).call(this);\n\n })(exports,require,module);\n });require.register('moment/moment', function(exports,require,module) {\n module.exports = require('moment');\n });","require.register('underscore', function(exports,req,module){\n var require = __makeRequire((function(n) { return req(n.replace('./', 'underscore//')); }), {}, 'underscore');\n (function(exports,require,module) {\n // Underscore.js 1.8.3\n// http://underscorejs.org\n// (c) 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n// Underscore may be freely distributed under the MIT license.\n\n(function() {\n\n // Baseline setup\n // --------------\n\n // Establish the root object, `window` in the browser, or `exports` on the server.\n var root = this;\n\n // Save the previous value of the `_` variable.\n var previousUnderscore = root._;\n\n // Save bytes in the minified (but not gzipped) version:\n var ArrayProto = Array.prototype, ObjProto = Object.prototype, FuncProto = Function.prototype;\n\n // Create quick reference variables for speed access to core prototypes.\n var\n push = ArrayProto.push,\n slice = ArrayProto.slice,\n toString = ObjProto.toString,\n hasOwnProperty = ObjProto.hasOwnProperty;\n\n // All **ECMAScript 5** native function implementations that we hope to use\n // are declared here.\n var\n nativeIsArray = Array.isArray,\n nativeKeys = Object.keys,\n nativeBind = FuncProto.bind,\n nativeCreate = Object.create;\n\n // Naked function reference for surrogate-prototype-swapping.\n var Ctor = function(){};\n\n // Create a safe reference to the Underscore object for use below.\n var _ = function(obj) {\n if (obj instanceof _) return obj;\n if (!(this instanceof _)) return new _(obj);\n this._wrapped = obj;\n };\n\n // Export the Underscore object for **Node.js**, with\n // backwards-compatibility for the old `require()` API. If we're in\n // the browser, add `_` as a global object.\n if (typeof exports !== 'undefined') {\n if (typeof module !== 'undefined' && module.exports) {\n exports = module.exports = _;\n }\n exports._ = _;\n } else {\n root._ = _;\n }\n\n // Current version.\n _.VERSION = '1.8.3';\n\n // Internal function that returns an efficient (for current engines) version\n // of the passed-in callback, to be repeatedly applied in other Underscore\n // functions.\n var optimizeCb = function(func, context, argCount) {\n if (context === void 0) return func;\n switch (argCount == null ? 3 : argCount) {\n case 1: return function(value) {\n return func.call(context, value);\n };\n case 2: return function(value, other) {\n return func.call(context, value, other);\n };\n case 3: return function(value, index, collection) {\n return func.call(context, value, index, collection);\n };\n case 4: return function(accumulator, value, index, collection) {\n return func.call(context, accumulator, value, index, collection);\n };\n }\n return function() {\n return func.apply(context, arguments);\n };\n };\n\n // A mostly-internal function to generate callbacks that can be applied\n // to each element in a collection, returning the desired result — either\n // identity, an arbitrary callback, a property matcher, or a property accessor.\n var cb = function(value, context, argCount) {\n if (value == null) return _.identity;\n if (_.isFunction(value)) return optimizeCb(value, context, argCount);\n if (_.isObject(value)) return _.matcher(value);\n return _.property(value);\n };\n _.iteratee = function(value, context) {\n return cb(value, context, Infinity);\n };\n\n // An internal function for creating assigner functions.\n var createAssigner = function(keysFunc, undefinedOnly) {\n return function(obj) {\n var length = arguments.length;\n if (length < 2 || obj == null) return obj;\n for (var index = 1; index < length; index++) {\n var source = arguments[index],\n keys = keysFunc(source),\n l = keys.length;\n for (var i = 0; i < l; i++) {\n var key = keys[i];\n if (!undefinedOnly || obj[key] === void 0) obj[key] = source[key];\n }\n }\n return obj;\n };\n };\n\n // An internal function for creating a new object that inherits from another.\n var baseCreate = function(prototype) {\n if (!_.isObject(prototype)) return {};\n if (nativeCreate) return nativeCreate(prototype);\n Ctor.prototype = prototype;\n var result = new Ctor;\n Ctor.prototype = null;\n return result;\n };\n\n var property = function(key) {\n return function(obj) {\n return obj == null ? void 0 : obj[key];\n };\n };\n\n // Helper for collection methods to determine whether a collection\n // should be iterated as an array or as an object\n // Related: http://people.mozilla.org/~jorendorff/es6-draft.html#sec-tolength\n // Avoids a very nasty iOS 8 JIT bug on ARM-64. #2094\n var MAX_ARRAY_INDEX = Math.pow(2, 53) - 1;\n var getLength = property('length');\n var isArrayLike = function(collection) {\n var length = getLength(collection);\n return typeof length == 'number' && length >= 0 && length <= MAX_ARRAY_INDEX;\n };\n\n // Collection Functions\n // --------------------\n\n // The cornerstone, an `each` implementation, aka `forEach`.\n // Handles raw objects in addition to array-likes. Treats all\n // sparse array-likes as if they were dense.\n _.each = _.forEach = function(obj, iteratee, context) {\n iteratee = optimizeCb(iteratee, context);\n var i, length;\n if (isArrayLike(obj)) {\n for (i = 0, length = obj.length; i < length; i++) {\n iteratee(obj[i], i, obj);\n }\n } else {\n var keys = _.keys(obj);\n for (i = 0, length = keys.length; i < length; i++) {\n iteratee(obj[keys[i]], keys[i], obj);\n }\n }\n return obj;\n };\n\n // Return the results of applying the iteratee to each element.\n _.map = _.collect = function(obj, iteratee, context) {\n iteratee = cb(iteratee, context);\n var keys = !isArrayLike(obj) && _.keys(obj),\n length = (keys || obj).length,\n results = Array(length);\n for (var index = 0; index < length; index++) {\n var currentKey = keys ? keys[index] : index;\n results[index] = iteratee(obj[currentKey], currentKey, obj);\n }\n return results;\n };\n\n // Create a reducing function iterating left or right.\n function createReduce(dir) {\n // Optimized iterator function as using arguments.length\n // in the main function will deoptimize the, see #1991.\n function iterator(obj, iteratee, memo, keys, index, length) {\n for (; index >= 0 && index < length; index += dir) {\n var currentKey = keys ? keys[index] : index;\n memo = iteratee(memo, obj[currentKey], currentKey, obj);\n }\n return memo;\n }\n\n return function(obj, iteratee, memo, context) {\n iteratee = optimizeCb(iteratee, context, 4);\n var keys = !isArrayLike(obj) && _.keys(obj),\n length = (keys || obj).length,\n index = dir > 0 ? 0 : length - 1;\n // Determine the initial value if none is provided.\n if (arguments.length < 3) {\n memo = obj[keys ? keys[index] : index];\n index += dir;\n }\n return iterator(obj, iteratee, memo, keys, index, length);\n };\n }\n\n // **Reduce** builds up a single result from a list of values, aka `inject`,\n // or `foldl`.\n _.reduce = _.foldl = _.inject = createReduce(1);\n\n // The right-associative version of reduce, also known as `foldr`.\n _.reduceRight = _.foldr = createReduce(-1);\n\n // Return the first value which passes a truth test. Aliased as `detect`.\n _.find = _.detect = function(obj, predicate, context) {\n var key;\n if (isArrayLike(obj)) {\n key = _.findIndex(obj, predicate, context);\n } else {\n key = _.findKey(obj, predicate, context);\n }\n if (key !== void 0 && key !== -1) return obj[key];\n };\n\n // Return all the elements that pass a truth test.\n // Aliased as `select`.\n _.filter = _.select = function(obj, predicate, context) {\n var results = [];\n predicate = cb(predicate, context);\n _.each(obj, function(value, index, list) {\n if (predicate(value, index, list)) results.push(value);\n });\n return results;\n };\n\n // Return all the elements for which a truth test fails.\n _.reject = function(obj, predicate, context) {\n return _.filter(obj, _.negate(cb(predicate)), context);\n };\n\n // Determine whether all of the elements match a truth test.\n // Aliased as `all`.\n _.every = _.all = function(obj, predicate, context) {\n predicate = cb(predicate, context);\n var keys = !isArrayLike(obj) && _.keys(obj),\n length = (keys || obj).length;\n for (var index = 0; index < length; index++) {\n var currentKey = keys ? keys[index] : index;\n if (!predicate(obj[currentKey], currentKey, obj)) return false;\n }\n return true;\n };\n\n // Determine if at least one element in the object matches a truth test.\n // Aliased as `any`.\n _.some = _.any = function(obj, predicate, context) {\n predicate = cb(predicate, context);\n var keys = !isArrayLike(obj) && _.keys(obj),\n length = (keys || obj).length;\n for (var index = 0; index < length; index++) {\n var currentKey = keys ? keys[index] : index;\n if (predicate(obj[currentKey], currentKey, obj)) return true;\n }\n return false;\n };\n\n // Determine if the array or object contains a given item (using `===`).\n // Aliased as `includes` and `include`.\n _.contains = _.includes = _.include = function(obj, item, fromIndex, guard) {\n if (!isArrayLike(obj)) obj = _.values(obj);\n if (typeof fromIndex != 'number' || guard) fromIndex = 0;\n return _.indexOf(obj, item, fromIndex) >= 0;\n };\n\n // Invoke a method (with arguments) on every item in a collection.\n _.invoke = function(obj, method) {\n var args = slice.call(arguments, 2);\n var isFunc = _.isFunction(method);\n return _.map(obj, function(value) {\n var func = isFunc ? method : value[method];\n return func == null ? func : func.apply(value, args);\n });\n };\n\n // Convenience version of a common use case of `map`: fetching a property.\n _.pluck = function(obj, key) {\n return _.map(obj, _.property(key));\n };\n\n // Convenience version of a common use case of `filter`: selecting only objects\n // containing specific `key:value` pairs.\n _.where = function(obj, attrs) {\n return _.filter(obj, _.matcher(attrs));\n };\n\n // Convenience version of a common use case of `find`: getting the first object\n // containing specific `key:value` pairs.\n _.findWhere = function(obj, attrs) {\n return _.find(obj, _.matcher(attrs));\n };\n\n // Return the maximum element (or element-based computation).\n _.max = function(obj, iteratee, context) {\n var result = -Infinity, lastComputed = -Infinity,\n value, computed;\n if (iteratee == null && obj != null) {\n obj = isArrayLike(obj) ? obj : _.values(obj);\n for (var i = 0, length = obj.length; i < length; i++) {\n value = obj[i];\n if (value > result) {\n result = value;\n }\n }\n } else {\n iteratee = cb(iteratee, context);\n _.each(obj, function(value, index, list) {\n computed = iteratee(value, index, list);\n if (computed > lastComputed || computed === -Infinity && result === -Infinity) {\n result = value;\n lastComputed = computed;\n }\n });\n }\n return result;\n };\n\n // Return the minimum element (or element-based computation).\n _.min = function(obj, iteratee, context) {\n var result = Infinity, lastComputed = Infinity,\n value, computed;\n if (iteratee == null && obj != null) {\n obj = isArrayLike(obj) ? obj : _.values(obj);\n for (var i = 0, length = obj.length; i < length; i++) {\n value = obj[i];\n if (value < result) {\n result = value;\n }\n }\n } else {\n iteratee = cb(iteratee, context);\n _.each(obj, function(value, index, list) {\n computed = iteratee(value, index, list);\n if (computed < lastComputed || computed === Infinity && result === Infinity) {\n result = value;\n lastComputed = computed;\n }\n });\n }\n return result;\n };\n\n // Shuffle a collection, using the modern version of the\n // [Fisher-Yates shuffle](http://en.wikipedia.org/wiki/Fisher–Yates_shuffle).\n _.shuffle = function(obj) {\n var set = isArrayLike(obj) ? obj : _.values(obj);\n var length = set.length;\n var shuffled = Array(length);\n for (var index = 0, rand; index < length; index++) {\n rand = _.random(0, index);\n if (rand !== index) shuffled[index] = shuffled[rand];\n shuffled[rand] = set[index];\n }\n return shuffled;\n };\n\n // Sample **n** random values from a collection.\n // If **n** is not specified, returns a single random element.\n // The internal `guard` argument allows it to work with `map`.\n _.sample = function(obj, n, guard) {\n if (n == null || guard) {\n if (!isArrayLike(obj)) obj = _.values(obj);\n return obj[_.random(obj.length - 1)];\n }\n return _.shuffle(obj).slice(0, Math.max(0, n));\n };\n\n // Sort the object's values by a criterion produced by an iteratee.\n _.sortBy = function(obj, iteratee, context) {\n iteratee = cb(iteratee, context);\n return _.pluck(_.map(obj, function(value, index, list) {\n return {\n value: value,\n index: index,\n criteria: iteratee(value, index, list)\n };\n }).sort(function(left, right) {\n var a = left.criteria;\n var b = right.criteria;\n if (a !== b) {\n if (a > b || a === void 0) return 1;\n if (a < b || b === void 0) return -1;\n }\n return left.index - right.index;\n }), 'value');\n };\n\n // An internal function used for aggregate \"group by\" operations.\n var group = function(behavior) {\n return function(obj, iteratee, context) {\n var result = {};\n iteratee = cb(iteratee, context);\n _.each(obj, function(value, index) {\n var key = iteratee(value, index, obj);\n behavior(result, value, key);\n });\n return result;\n };\n };\n\n // Groups the object's values by a criterion. Pass either a string attribute\n // to group by, or a function that returns the criterion.\n _.groupBy = group(function(result, value, key) {\n if (_.has(result, key)) result[key].push(value); else result[key] = [value];\n });\n\n // Indexes the object's values by a criterion, similar to `groupBy`, but for\n // when you know that your index values will be unique.\n _.indexBy = group(function(result, value, key) {\n result[key] = value;\n });\n\n // Counts instances of an object that group by a certain criterion. Pass\n // either a string attribute to count by, or a function that returns the\n // criterion.\n _.countBy = group(function(result, value, key) {\n if (_.has(result, key)) result[key]++; else result[key] = 1;\n });\n\n // Safely create a real, live array from anything iterable.\n _.toArray = function(obj) {\n if (!obj) return [];\n if (_.isArray(obj)) return slice.call(obj);\n if (isArrayLike(obj)) return _.map(obj, _.identity);\n return _.values(obj);\n };\n\n // Return the number of elements in an object.\n _.size = function(obj) {\n if (obj == null) return 0;\n return isArrayLike(obj) ? obj.length : _.keys(obj).length;\n };\n\n // Split a collection into two arrays: one whose elements all satisfy the given\n // predicate, and one whose elements all do not satisfy the predicate.\n _.partition = function(obj, predicate, context) {\n predicate = cb(predicate, context);\n var pass = [], fail = [];\n _.each(obj, function(value, key, obj) {\n (predicate(value, key, obj) ? pass : fail).push(value);\n });\n return [pass, fail];\n };\n\n // Array Functions\n // ---------------\n\n // Get the first element of an array. Passing **n** will return the first N\n // values in the array. Aliased as `head` and `take`. The **guard** check\n // allows it to work with `_.map`.\n _.first = _.head = _.take = function(array, n, guard) {\n if (array == null) return void 0;\n if (n == null || guard) return array[0];\n return _.initial(array, array.length - n);\n };\n\n // Returns everything but the last entry of the array. Especially useful on\n // the arguments object. Passing **n** will return all the values in\n // the array, excluding the last N.\n _.initial = function(array, n, guard) {\n return slice.call(array, 0, Math.max(0, array.length - (n == null || guard ? 1 : n)));\n };\n\n // Get the last element of an array. Passing **n** will return the last N\n // values in the array.\n _.last = function(array, n, guard) {\n if (array == null) return void 0;\n if (n == null || guard) return array[array.length - 1];\n return _.rest(array, Math.max(0, array.length - n));\n };\n\n // Returns everything but the first entry of the array. Aliased as `tail` and `drop`.\n // Especially useful on the arguments object. Passing an **n** will return\n // the rest N values in the array.\n _.rest = _.tail = _.drop = function(array, n, guard) {\n return slice.call(array, n == null || guard ? 1 : n);\n };\n\n // Trim out all falsy values from an array.\n _.compact = function(array) {\n return _.filter(array, _.identity);\n };\n\n // Internal implementation of a recursive `flatten` function.\n var flatten = function(input, shallow, strict, startIndex) {\n var output = [], idx = 0;\n for (var i = startIndex || 0, length = getLength(input); i < length; i++) {\n var value = input[i];\n if (isArrayLike(value) && (_.isArray(value) || _.isArguments(value))) {\n //flatten current level of array or arguments object\n if (!shallow) value = flatten(value, shallow, strict);\n var j = 0, len = value.length;\n output.length += len;\n while (j < len) {\n output[idx++] = value[j++];\n }\n } else if (!strict) {\n output[idx++] = value;\n }\n }\n return output;\n };\n\n // Flatten out an array, either recursively (by default), or just one level.\n _.flatten = function(array, shallow) {\n return flatten(array, shallow, false);\n };\n\n // Return a version of the array that does not contain the specified value(s).\n _.without = function(array) {\n return _.difference(array, slice.call(arguments, 1));\n };\n\n // Produce a duplicate-free version of the array. If the array has already\n // been sorted, you have the option of using a faster algorithm.\n // Aliased as `unique`.\n _.uniq = _.unique = function(array, isSorted, iteratee, context) {\n if (!_.isBoolean(isSorted)) {\n context = iteratee;\n iteratee = isSorted;\n isSorted = false;\n }\n if (iteratee != null) iteratee = cb(iteratee, context);\n var result = [];\n var seen = [];\n for (var i = 0, length = getLength(array); i < length; i++) {\n var value = array[i],\n computed = iteratee ? iteratee(value, i, array) : value;\n if (isSorted) {\n if (!i || seen !== computed) result.push(value);\n seen = computed;\n } else if (iteratee) {\n if (!_.contains(seen, computed)) {\n seen.push(computed);\n result.push(value);\n }\n } else if (!_.contains(result, value)) {\n result.push(value);\n }\n }\n return result;\n };\n\n // Produce an array that contains the union: each distinct element from all of\n // the passed-in arrays.\n _.union = function() {\n return _.uniq(flatten(arguments, true, true));\n };\n\n // Produce an array that contains every item shared between all the\n // passed-in arrays.\n _.intersection = function(array) {\n var result = [];\n var argsLength = arguments.length;\n for (var i = 0, length = getLength(array); i < length; i++) {\n var item = array[i];\n if (_.contains(result, item)) continue;\n for (var j = 1; j < argsLength; j++) {\n if (!_.contains(arguments[j], item)) break;\n }\n if (j === argsLength) result.push(item);\n }\n return result;\n };\n\n // Take the difference between one array and a number of other arrays.\n // Only the elements present in just the first array will remain.\n _.difference = function(array) {\n var rest = flatten(arguments, true, true, 1);\n return _.filter(array, function(value){\n return !_.contains(rest, value);\n });\n };\n\n // Zip together multiple lists into a single array -- elements that share\n // an index go together.\n _.zip = function() {\n return _.unzip(arguments);\n };\n\n // Complement of _.zip. Unzip accepts an array of arrays and groups\n // each array's elements on shared indices\n _.unzip = function(array) {\n var length = array && _.max(array, getLength).length || 0;\n var result = Array(length);\n\n for (var index = 0; index < length; index++) {\n result[index] = _.pluck(array, index);\n }\n return result;\n };\n\n // Converts lists into objects. Pass either a single array of `[key, value]`\n // pairs, or two parallel arrays of the same length -- one of keys, and one of\n // the corresponding values.\n _.object = function(list, values) {\n var result = {};\n for (var i = 0, length = getLength(list); i < length; i++) {\n if (values) {\n result[list[i]] = values[i];\n } else {\n result[list[i][0]] = list[i][1];\n }\n }\n return result;\n };\n\n // Generator function to create the findIndex and findLastIndex functions\n function createPredicateIndexFinder(dir) {\n return function(array, predicate, context) {\n predicate = cb(predicate, context);\n var length = getLength(array);\n var index = dir > 0 ? 0 : length - 1;\n for (; index >= 0 && index < length; index += dir) {\n if (predicate(array[index], index, array)) return index;\n }\n return -1;\n };\n }\n\n // Returns the first index on an array-like that passes a predicate test\n _.findIndex = createPredicateIndexFinder(1);\n _.findLastIndex = createPredicateIndexFinder(-1);\n\n // Use a comparator function to figure out the smallest index at which\n // an object should be inserted so as to maintain order. Uses binary search.\n _.sortedIndex = function(array, obj, iteratee, context) {\n iteratee = cb(iteratee, context, 1);\n var value = iteratee(obj);\n var low = 0, high = getLength(array);\n while (low < high) {\n var mid = Math.floor((low + high) / 2);\n if (iteratee(array[mid]) < value) low = mid + 1; else high = mid;\n }\n return low;\n };\n\n // Generator function to create the indexOf and lastIndexOf functions\n function createIndexFinder(dir, predicateFind, sortedIndex) {\n return function(array, item, idx) {\n var i = 0, length = getLength(array);\n if (typeof idx == 'number') {\n if (dir > 0) {\n i = idx >= 0 ? idx : Math.max(idx + length, i);\n } else {\n length = idx >= 0 ? Math.min(idx + 1, length) : idx + length + 1;\n }\n } else if (sortedIndex && idx && length) {\n idx = sortedIndex(array, item);\n return array[idx] === item ? idx : -1;\n }\n if (item !== item) {\n idx = predicateFind(slice.call(array, i, length), _.isNaN);\n return idx >= 0 ? idx + i : -1;\n }\n for (idx = dir > 0 ? i : length - 1; idx >= 0 && idx < length; idx += dir) {\n if (array[idx] === item) return idx;\n }\n return -1;\n };\n }\n\n // Return the position of the first occurrence of an item in an array,\n // or -1 if the item is not included in the array.\n // If the array is large and already in sort order, pass `true`\n // for **isSorted** to use binary search.\n _.indexOf = createIndexFinder(1, _.findIndex, _.sortedIndex);\n _.lastIndexOf = createIndexFinder(-1, _.findLastIndex);\n\n // Generate an integer Array containing an arithmetic progression. A port of\n // the native Python `range()` function. See\n // [the Python documentation](http://docs.python.org/library/functions.html#range).\n _.range = function(start, stop, step) {\n if (stop == null) {\n stop = start || 0;\n start = 0;\n }\n step = step || 1;\n\n var length = Math.max(Math.ceil((stop - start) / step), 0);\n var range = Array(length);\n\n for (var idx = 0; idx < length; idx++, start += step) {\n range[idx] = start;\n }\n\n return range;\n };\n\n // Function (ahem) Functions\n // ------------------\n\n // Determines whether to execute a function as a constructor\n // or a normal function with the provided arguments\n var executeBound = function(sourceFunc, boundFunc, context, callingContext, args) {\n if (!(callingContext instanceof boundFunc)) return sourceFunc.apply(context, args);\n var self = baseCreate(sourceFunc.prototype);\n var result = sourceFunc.apply(self, args);\n if (_.isObject(result)) return result;\n return self;\n };\n\n // Create a function bound to a given object (assigning `this`, and arguments,\n // optionally). Delegates to **ECMAScript 5**'s native `Function.bind` if\n // available.\n _.bind = function(func, context) {\n if (nativeBind && func.bind === nativeBind) return nativeBind.apply(func, slice.call(arguments, 1));\n if (!_.isFunction(func)) throw new TypeError('Bind must be called on a function');\n var args = slice.call(arguments, 2);\n var bound = function() {\n return executeBound(func, bound, context, this, args.concat(slice.call(arguments)));\n };\n return bound;\n };\n\n // Partially apply a function by creating a version that has had some of its\n // arguments pre-filled, without changing its dynamic `this` context. _ acts\n // as a placeholder, allowing any combination of arguments to be pre-filled.\n _.partial = function(func) {\n var boundArgs = slice.call(arguments, 1);\n var bound = function() {\n var position = 0, length = boundArgs.length;\n var args = Array(length);\n for (var i = 0; i < length; i++) {\n args[i] = boundArgs[i] === _ ? arguments[position++] : boundArgs[i];\n }\n while (position < arguments.length) args.push(arguments[position++]);\n return executeBound(func, bound, this, this, args);\n };\n return bound;\n };\n\n // Bind a number of an object's methods to that object. Remaining arguments\n // are the method names to be bound. Useful for ensuring that all callbacks\n // defined on an object belong to it.\n _.bindAll = function(obj) {\n var i, length = arguments.length, key;\n if (length <= 1) throw new Error('bindAll must be passed function names');\n for (i = 1; i < length; i++) {\n key = arguments[i];\n obj[key] = _.bind(obj[key], obj);\n }\n return obj;\n };\n\n // Memoize an expensive function by storing its results.\n _.memoize = function(func, hasher) {\n var memoize = function(key) {\n var cache = memoize.cache;\n var address = '' + (hasher ? hasher.apply(this, arguments) : key);\n if (!_.has(cache, address)) cache[address] = func.apply(this, arguments);\n return cache[address];\n };\n memoize.cache = {};\n return memoize;\n };\n\n // Delays a function for the given number of milliseconds, and then calls\n // it with the arguments supplied.\n _.delay = function(func, wait) {\n var args = slice.call(arguments, 2);\n return setTimeout(function(){\n return func.apply(null, args);\n }, wait);\n };\n\n // Defers a function, scheduling it to run after the current call stack has\n // cleared.\n _.defer = _.partial(_.delay, _, 1);\n\n // Returns a function, that, when invoked, will only be triggered at most once\n // during a given window of time. Normally, the throttled function will run\n // as much as it can, without ever going more than once per `wait` duration;\n // but if you'd like to disable the execution on the leading edge, pass\n // `{leading: false}`. To disable execution on the trailing edge, ditto.\n _.throttle = function(func, wait, options) {\n var context, args, result;\n var timeout = null;\n var previous = 0;\n if (!options) options = {};\n var later = function() {\n previous = options.leading === false ? 0 : _.now();\n timeout = null;\n result = func.apply(context, args);\n if (!timeout) context = args = null;\n };\n return function() {\n var now = _.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 || remaining > wait) {\n if (timeout) {\n clearTimeout(timeout);\n timeout = null;\n }\n previous = now;\n result = func.apply(context, args);\n if (!timeout) context = args = null;\n } else if (!timeout && options.trailing !== false) {\n timeout = setTimeout(later, remaining);\n }\n return result;\n };\n };\n\n // Returns a function, that, as long as it continues to be invoked, will not\n // be triggered. The function will be called after it stops being called for\n // N milliseconds. If `immediate` is passed, trigger the function on the\n // leading edge, instead of the trailing.\n _.debounce = function(func, wait, immediate) {\n var timeout, args, context, timestamp, result;\n\n var later = function() {\n var last = _.now() - timestamp;\n\n if (last < wait && last >= 0) {\n timeout = setTimeout(later, wait - last);\n } else {\n timeout = null;\n if (!immediate) {\n result = func.apply(context, args);\n if (!timeout) context = args = null;\n }\n }\n };\n\n return function() {\n context = this;\n args = arguments;\n timestamp = _.now();\n var callNow = immediate && !timeout;\n if (!timeout) timeout = setTimeout(later, wait);\n if (callNow) {\n result = func.apply(context, args);\n context = args = null;\n }\n\n return result;\n };\n };\n\n // Returns the first function passed as an argument to the second,\n // allowing you to adjust arguments, run code before and after, and\n // conditionally execute the original function.\n _.wrap = function(func, wrapper) {\n return _.partial(wrapper, func);\n };\n\n // Returns a negated version of the passed-in predicate.\n _.negate = function(predicate) {\n return function() {\n return !predicate.apply(this, arguments);\n };\n };\n\n // Returns a function that is the composition of a list of functions, each\n // consuming the return value of the function that follows.\n _.compose = function() {\n var args = arguments;\n var start = args.length - 1;\n return function() {\n var i = start;\n var result = args[start].apply(this, arguments);\n while (i--) result = args[i].call(this, result);\n return result;\n };\n };\n\n // Returns a function that will only be executed on and after the Nth call.\n _.after = function(times, func) {\n return function() {\n if (--times < 1) {\n return func.apply(this, arguments);\n }\n };\n };\n\n // Returns a function that will only be executed up to (but not including) the Nth call.\n _.before = function(times, func) {\n var memo;\n return function() {\n if (--times > 0) {\n memo = func.apply(this, arguments);\n }\n if (times <= 1) func = null;\n return memo;\n };\n };\n\n // Returns a function that will be executed at most one time, no matter how\n // often you call it. Useful for lazy initialization.\n _.once = _.partial(_.before, 2);\n\n // Object Functions\n // ----------------\n\n // Keys in IE < 9 that won't be iterated by `for key in ...` and thus missed.\n var hasEnumBug = !{toString: null}.propertyIsEnumerable('toString');\n var nonEnumerableProps = ['valueOf', 'isPrototypeOf', 'toString',\n 'propertyIsEnumerable', 'hasOwnProperty', 'toLocaleString'];\n\n function collectNonEnumProps(obj, keys) {\n var nonEnumIdx = nonEnumerableProps.length;\n var constructor = obj.constructor;\n var proto = (_.isFunction(constructor) && constructor.prototype) || ObjProto;\n\n // Constructor is a special case.\n var prop = 'constructor';\n if (_.has(obj, prop) && !_.contains(keys, prop)) keys.push(prop);\n\n while (nonEnumIdx--) {\n prop = nonEnumerableProps[nonEnumIdx];\n if (prop in obj && obj[prop] !== proto[prop] && !_.contains(keys, prop)) {\n keys.push(prop);\n }\n }\n }\n\n // Retrieve the names of an object's own properties.\n // Delegates to **ECMAScript 5**'s native `Object.keys`\n _.keys = function(obj) {\n if (!_.isObject(obj)) return [];\n if (nativeKeys) return nativeKeys(obj);\n var keys = [];\n for (var key in obj) if (_.has(obj, key)) keys.push(key);\n // Ahem, IE < 9.\n if (hasEnumBug) collectNonEnumProps(obj, keys);\n return keys;\n };\n\n // Retrieve all the property names of an object.\n _.allKeys = function(obj) {\n if (!_.isObject(obj)) return [];\n var keys = [];\n for (var key in obj) keys.push(key);\n // Ahem, IE < 9.\n if (hasEnumBug) collectNonEnumProps(obj, keys);\n return keys;\n };\n\n // Retrieve the values of an object's properties.\n _.values = function(obj) {\n var keys = _.keys(obj);\n var length = keys.length;\n var values = Array(length);\n for (var i = 0; i < length; i++) {\n values[i] = obj[keys[i]];\n }\n return values;\n };\n\n // Returns the results of applying the iteratee to each element of the object\n // In contrast to _.map it returns an object\n _.mapObject = function(obj, iteratee, context) {\n iteratee = cb(iteratee, context);\n var keys = _.keys(obj),\n length = keys.length,\n results = {},\n currentKey;\n for (var index = 0; index < length; index++) {\n currentKey = keys[index];\n results[currentKey] = iteratee(obj[currentKey], currentKey, obj);\n }\n return results;\n };\n\n // Convert an object into a list of `[key, value]` pairs.\n _.pairs = function(obj) {\n var keys = _.keys(obj);\n var length = keys.length;\n var pairs = Array(length);\n for (var i = 0; i < length; i++) {\n pairs[i] = [keys[i], obj[keys[i]]];\n }\n return pairs;\n };\n\n // Invert the keys and values of an object. The values must be serializable.\n _.invert = function(obj) {\n var result = {};\n var keys = _.keys(obj);\n for (var i = 0, length = keys.length; i < length; i++) {\n result[obj[keys[i]]] = keys[i];\n }\n return result;\n };\n\n // Return a sorted list of the function names available on the object.\n // Aliased as `methods`\n _.functions = _.methods = function(obj) {\n var names = [];\n for (var key in obj) {\n if (_.isFunction(obj[key])) names.push(key);\n }\n return names.sort();\n };\n\n // Extend a given object with all the properties in passed-in object(s).\n _.extend = createAssigner(_.allKeys);\n\n // Assigns a given object with all the own properties in the passed-in object(s)\n // (https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/assign)\n _.extendOwn = _.assign = createAssigner(_.keys);\n\n // Returns the first key on an object that passes a predicate test\n _.findKey = function(obj, predicate, context) {\n predicate = cb(predicate, context);\n var keys = _.keys(obj), key;\n for (var i = 0, length = keys.length; i < length; i++) {\n key = keys[i];\n if (predicate(obj[key], key, obj)) return key;\n }\n };\n\n // Return a copy of the object only containing the whitelisted properties.\n _.pick = function(object, oiteratee, context) {\n var result = {}, obj = object, iteratee, keys;\n if (obj == null) return result;\n if (_.isFunction(oiteratee)) {\n keys = _.allKeys(obj);\n iteratee = optimizeCb(oiteratee, context);\n } else {\n keys = flatten(arguments, false, false, 1);\n iteratee = function(value, key, obj) { return key in obj; };\n obj = Object(obj);\n }\n for (var i = 0, length = keys.length; i < length; i++) {\n var key = keys[i];\n var value = obj[key];\n if (iteratee(value, key, obj)) result[key] = value;\n }\n return result;\n };\n\n // Return a copy of the object without the blacklisted properties.\n _.omit = function(obj, iteratee, context) {\n if (_.isFunction(iteratee)) {\n iteratee = _.negate(iteratee);\n } else {\n var keys = _.map(flatten(arguments, false, false, 1), String);\n iteratee = function(value, key) {\n return !_.contains(keys, key);\n };\n }\n return _.pick(obj, iteratee, context);\n };\n\n // Fill in a given object with default properties.\n _.defaults = createAssigner(_.allKeys, true);\n\n // Creates an object that inherits from the given prototype object.\n // If additional properties are provided then they will be added to the\n // created object.\n _.create = function(prototype, props) {\n var result = baseCreate(prototype);\n if (props) _.extendOwn(result, props);\n return result;\n };\n\n // Create a (shallow-cloned) duplicate of an object.\n _.clone = function(obj) {\n if (!_.isObject(obj)) return obj;\n return _.isArray(obj) ? obj.slice() : _.extend({}, obj);\n };\n\n // Invokes interceptor with the obj, and then returns obj.\n // The primary purpose of this method is to \"tap into\" a method chain, in\n // order to perform operations on intermediate results within the chain.\n _.tap = function(obj, interceptor) {\n interceptor(obj);\n return obj;\n };\n\n // Returns whether an object has a given set of `key:value` pairs.\n _.isMatch = function(object, attrs) {\n var keys = _.keys(attrs), length = keys.length;\n if (object == null) return !length;\n var obj = Object(object);\n for (var i = 0; i < length; i++) {\n var key = keys[i];\n if (attrs[key] !== obj[key] || !(key in obj)) return false;\n }\n return true;\n };\n\n\n // Internal recursive comparison function for `isEqual`.\n var eq = function(a, b, aStack, bStack) {\n // Identical objects are equal. `0 === -0`, but they aren't identical.\n // See the [Harmony `egal` proposal](http://wiki.ecmascript.org/doku.php?id=harmony:egal).\n if (a === b) return a !== 0 || 1 / a === 1 / b;\n // A strict comparison is necessary because `null == undefined`.\n if (a == null || b == null) return a === b;\n // Unwrap any wrapped objects.\n if (a instanceof _) a = a._wrapped;\n if (b instanceof _) b = b._wrapped;\n // Compare `[[Class]]` names.\n var className = toString.call(a);\n if (className !== toString.call(b)) return false;\n switch (className) {\n // Strings, numbers, regular expressions, dates, and booleans are compared by value.\n case '[object RegExp]':\n // RegExps are coerced to strings for comparison (Note: '' + /a/i === '/a/i')\n case '[object String]':\n // Primitives and their corresponding object wrappers are equivalent; thus, `\"5\"` is\n // equivalent to `new String(\"5\")`.\n return '' + a === '' + b;\n case '[object Number]':\n // `NaN`s are equivalent, but non-reflexive.\n // Object(NaN) is equivalent to NaN\n if (+a !== +a) return +b !== +b;\n // An `egal` comparison is performed for other numeric values.\n return +a === 0 ? 1 / +a === 1 / b : +a === +b;\n case '[object Date]':\n case '[object Boolean]':\n // Coerce dates and booleans to numeric primitive values. Dates are compared by their\n // millisecond representations. Note that invalid dates with millisecond representations\n // of `NaN` are not equivalent.\n return +a === +b;\n }\n\n var areArrays = className === '[object Array]';\n if (!areArrays) {\n if (typeof a != 'object' || typeof b != 'object') return false;\n\n // Objects with different constructors are not equivalent, but `Object`s or `Array`s\n // from different frames are.\n var aCtor = a.constructor, bCtor = b.constructor;\n if (aCtor !== bCtor && !(_.isFunction(aCtor) && aCtor instanceof aCtor &&\n _.isFunction(bCtor) && bCtor instanceof bCtor)\n && ('constructor' in a && 'constructor' in b)) {\n return false;\n }\n }\n // Assume equality for cyclic structures. The algorithm for detecting cyclic\n // structures is adapted from ES 5.1 section 15.12.3, abstract operation `JO`.\n\n // Initializing stack of traversed objects.\n // It's done here since we only need them for objects and arrays comparison.\n aStack = aStack || [];\n bStack = bStack || [];\n var length = aStack.length;\n while (length--) {\n // Linear search. Performance is inversely proportional to the number of\n // unique nested structures.\n if (aStack[length] === a) return bStack[length] === b;\n }\n\n // Add the first object to the stack of traversed objects.\n aStack.push(a);\n bStack.push(b);\n\n // Recursively compare objects and arrays.\n if (areArrays) {\n // Compare array lengths to determine if a deep comparison is necessary.\n length = a.length;\n if (length !== b.length) return false;\n // Deep compare the contents, ignoring non-numeric properties.\n while (length--) {\n if (!eq(a[length], b[length], aStack, bStack)) return false;\n }\n } else {\n // Deep compare objects.\n var keys = _.keys(a), key;\n length = keys.length;\n // Ensure that both objects contain the same number of properties before comparing deep equality.\n if (_.keys(b).length !== length) return false;\n while (length--) {\n // Deep compare each member\n key = keys[length];\n if (!(_.has(b, key) && eq(a[key], b[key], aStack, bStack))) return false;\n }\n }\n // Remove the first object from the stack of traversed objects.\n aStack.pop();\n bStack.pop();\n return true;\n };\n\n // Perform a deep comparison to check if two objects are equal.\n _.isEqual = function(a, b) {\n return eq(a, b);\n };\n\n // Is a given array, string, or object empty?\n // An \"empty\" object has no enumerable own-properties.\n _.isEmpty = function(obj) {\n if (obj == null) return true;\n if (isArrayLike(obj) && (_.isArray(obj) || _.isString(obj) || _.isArguments(obj))) return obj.length === 0;\n return _.keys(obj).length === 0;\n };\n\n // Is a given value a DOM element?\n _.isElement = function(obj) {\n return !!(obj && obj.nodeType === 1);\n };\n\n // Is a given value an array?\n // Delegates to ECMA5's native Array.isArray\n _.isArray = nativeIsArray || function(obj) {\n return toString.call(obj) === '[object Array]';\n };\n\n // Is a given variable an object?\n _.isObject = function(obj) {\n var type = typeof obj;\n return type === 'function' || type === 'object' && !!obj;\n };\n\n // Add some isType methods: isArguments, isFunction, isString, isNumber, isDate, isRegExp, isError.\n _.each(['Arguments', 'Function', 'String', 'Number', 'Date', 'RegExp', 'Error'], function(name) {\n _['is' + name] = function(obj) {\n return toString.call(obj) === '[object ' + name + ']';\n };\n });\n\n // Define a fallback version of the method in browsers (ahem, IE < 9), where\n // there isn't any inspectable \"Arguments\" type.\n if (!_.isArguments(arguments)) {\n _.isArguments = function(obj) {\n return _.has(obj, 'callee');\n };\n }\n\n // Optimize `isFunction` if appropriate. Work around some typeof bugs in old v8,\n // IE 11 (#1621), and in Safari 8 (#1929).\n if (typeof /./ != 'function' && typeof Int8Array != 'object') {\n _.isFunction = function(obj) {\n return typeof obj == 'function' || false;\n };\n }\n\n // Is a given object a finite number?\n _.isFinite = function(obj) {\n return isFinite(obj) && !isNaN(parseFloat(obj));\n };\n\n // Is the given value `NaN`? (NaN is the only number which does not equal itself).\n _.isNaN = function(obj) {\n return _.isNumber(obj) && obj !== +obj;\n };\n\n // Is a given value a boolean?\n _.isBoolean = function(obj) {\n return obj === true || obj === false || toString.call(obj) === '[object Boolean]';\n };\n\n // Is a given value equal to null?\n _.isNull = function(obj) {\n return obj === null;\n };\n\n // Is a given variable undefined?\n _.isUndefined = function(obj) {\n return obj === void 0;\n };\n\n // Shortcut function for checking if an object has a given property directly\n // on itself (in other words, not on a prototype).\n _.has = function(obj, key) {\n return obj != null && hasOwnProperty.call(obj, key);\n };\n\n // Utility Functions\n // -----------------\n\n // Run Underscore.js in *noConflict* mode, returning the `_` variable to its\n // previous owner. Returns a reference to the Underscore object.\n _.noConflict = function() {\n root._ = previousUnderscore;\n return this;\n };\n\n // Keep the identity function around for default iteratees.\n _.identity = function(value) {\n return value;\n };\n\n // Predicate-generating functions. Often useful outside of Underscore.\n _.constant = function(value) {\n return function() {\n return value;\n };\n };\n\n _.noop = function(){};\n\n _.property = property;\n\n // Generates a function for a given object that returns a given property.\n _.propertyOf = function(obj) {\n return obj == null ? function(){} : function(key) {\n return obj[key];\n };\n };\n\n // Returns a predicate for checking whether an object has a given set of\n // `key:value` pairs.\n _.matcher = _.matches = function(attrs) {\n attrs = _.extendOwn({}, attrs);\n return function(obj) {\n return _.isMatch(obj, attrs);\n };\n };\n\n // Run a function **n** times.\n _.times = function(n, iteratee, context) {\n var accum = Array(Math.max(0, n));\n iteratee = optimizeCb(iteratee, context, 1);\n for (var i = 0; i < n; i++) accum[i] = iteratee(i);\n return accum;\n };\n\n // Return a random integer between min and max (inclusive).\n _.random = function(min, max) {\n if (max == null) {\n max = min;\n min = 0;\n }\n return min + Math.floor(Math.random() * (max - min + 1));\n };\n\n // A (possibly faster) way to get the current timestamp as an integer.\n _.now = Date.now || function() {\n return new Date().getTime();\n };\n\n // List of HTML entities for escaping.\n var escapeMap = {\n '&': '&',\n '<': '<',\n '>': '>',\n '\"': '"',\n \"'\": ''',\n '`': '`'\n };\n var unescapeMap = _.invert(escapeMap);\n\n // Functions for escaping and unescaping strings to/from HTML interpolation.\n var createEscaper = function(map) {\n var escaper = function(match) {\n return map[match];\n };\n // Regexes for identifying a key that needs to be escaped\n var source = '(?:' + _.keys(map).join('|') + ')';\n var testRegexp = RegExp(source);\n var replaceRegexp = RegExp(source, 'g');\n return function(string) {\n string = string == null ? '' : '' + string;\n return testRegexp.test(string) ? string.replace(replaceRegexp, escaper) : string;\n };\n };\n _.escape = createEscaper(escapeMap);\n _.unescape = createEscaper(unescapeMap);\n\n // If the value of the named `property` is a function then invoke it with the\n // `object` as context; otherwise, return it.\n _.result = function(object, property, fallback) {\n var value = object == null ? void 0 : object[property];\n if (value === void 0) {\n value = fallback;\n }\n return _.isFunction(value) ? value.call(object) : value;\n };\n\n // Generate a unique integer id (unique within the entire client session).\n // Useful for temporary DOM ids.\n var idCounter = 0;\n _.uniqueId = function(prefix) {\n var id = ++idCounter + '';\n return prefix ? prefix + id : id;\n };\n\n // By default, Underscore uses ERB-style template delimiters, change the\n // following template settings to use alternative delimiters.\n _.templateSettings = {\n evaluate : /<%([\\s\\S]+?)%>/g,\n interpolate : /<%=([\\s\\S]+?)%>/g,\n escape : /<%-([\\s\\S]+?)%>/g\n };\n\n // When customizing `templateSettings`, if you don't want to define an\n // interpolation, evaluation or escaping regex, we need one that is\n // guaranteed not to match.\n var noMatch = /(.)^/;\n\n // Certain characters need to be escaped so that they can be put into a\n // string literal.\n var escapes = {\n \"'\": \"'\",\n '\\\\': '\\\\',\n '\\r': 'r',\n '\\n': 'n',\n '\\u2028': 'u2028',\n '\\u2029': 'u2029'\n };\n\n var escaper = /\\\\|'|\\r|\\n|\\u2028|\\u2029/g;\n\n var escapeChar = function(match) {\n return '\\\\' + escapes[match];\n };\n\n // JavaScript micro-templating, similar to John Resig's implementation.\n // Underscore templating handles arbitrary delimiters, preserves whitespace,\n // and correctly escapes quotes within interpolated code.\n // NB: `oldSettings` only exists for backwards compatibility.\n _.template = function(text, settings, oldSettings) {\n if (!settings && oldSettings) settings = oldSettings;\n settings = _.defaults({}, settings, _.templateSettings);\n\n // Combine delimiters into one regular expression via alternation.\n var matcher = RegExp([\n (settings.escape || noMatch).source,\n (settings.interpolate || noMatch).source,\n (settings.evaluate || noMatch).source\n ].join('|') + '|$', 'g');\n\n // Compile the template source, escaping string literals appropriately.\n var index = 0;\n var source = \"__p+='\";\n text.replace(matcher, function(match, escape, interpolate, evaluate, offset) {\n source += text.slice(index, offset).replace(escaper, escapeChar);\n index = offset + match.length;\n\n if (escape) {\n source += \"'+\\n((__t=(\" + escape + \"))==null?'':_.escape(__t))+\\n'\";\n } else if (interpolate) {\n source += \"'+\\n((__t=(\" + interpolate + \"))==null?'':__t)+\\n'\";\n } else if (evaluate) {\n source += \"';\\n\" + evaluate + \"\\n__p+='\";\n }\n\n // Adobe VMs need the match returned to produce the correct offest.\n return match;\n });\n source += \"';\\n\";\n\n // If a variable is not specified, place data values in local scope.\n if (!settings.variable) source = 'with(obj||{}){\\n' + source + '}\\n';\n\n source = \"var __t,__p='',__j=Array.prototype.join,\" +\n \"print=function(){__p+=__j.call(arguments,'');};\\n\" +\n source + 'return __p;\\n';\n\n try {\n var render = new Function(settings.variable || 'obj', '_', source);\n } catch (e) {\n e.source = source;\n throw e;\n }\n\n var template = function(data) {\n return render.call(this, data, _);\n };\n\n // Provide the compiled source as a convenience for precompilation.\n var argument = settings.variable || 'obj';\n template.source = 'function(' + argument + '){\\n' + source + '}';\n\n return template;\n };\n\n // Add a \"chain\" function. Start chaining a wrapped Underscore object.\n _.chain = function(obj) {\n var instance = _(obj);\n instance._chain = true;\n return instance;\n };\n\n // OOP\n // ---------------\n // If Underscore is called as a function, it returns a wrapped object that\n // can be used OO-style. This wrapper holds altered versions of all the\n // underscore functions. Wrapped objects may be chained.\n\n // Helper function to continue chaining intermediate results.\n var result = function(instance, obj) {\n return instance._chain ? _(obj).chain() : obj;\n };\n\n // Add your own custom functions to the Underscore object.\n _.mixin = function(obj) {\n _.each(_.functions(obj), function(name) {\n var func = _[name] = obj[name];\n _.prototype[name] = function() {\n var args = [this._wrapped];\n push.apply(args, arguments);\n return result(this, func.apply(_, args));\n };\n });\n };\n\n // Add all of the Underscore functions to the wrapper object.\n _.mixin(_);\n\n // Add all mutator Array functions to the wrapper.\n _.each(['pop', 'push', 'reverse', 'shift', 'sort', 'splice', 'unshift'], function(name) {\n var method = ArrayProto[name];\n _.prototype[name] = function() {\n var obj = this._wrapped;\n method.apply(obj, arguments);\n if ((name === 'shift' || name === 'splice') && obj.length === 0) delete obj[0];\n return result(this, obj);\n };\n });\n\n // Add all accessor Array functions to the wrapper.\n _.each(['concat', 'join', 'slice'], function(name) {\n var method = ArrayProto[name];\n _.prototype[name] = function() {\n return result(this, method.apply(this._wrapped, arguments));\n };\n });\n\n // Extracts the result from a wrapped and chained object.\n _.prototype.value = function() {\n return this._wrapped;\n };\n\n // Provide unwrapping proxy for some methods used in engine operations\n // such as arithmetic and JSON stringification.\n _.prototype.valueOf = _.prototype.toJSON = _.prototype.value;\n\n _.prototype.toString = function() {\n return '' + this._wrapped;\n };\n\n // AMD registration happens at the end for compatibility with AMD loaders\n // that may not enforce next-turn semantics on modules. Even though general\n // practice for AMD registration is to be anonymous, underscore registers\n // as a named module because, like jQuery, it is a base library that is\n // popular enough to be bundled in a third party lib, but not be part of\n // an AMD load request. Those cases could generate an error when an\n // anonymous define() is called outside of a loader request.\n if (typeof define === 'function' && define.amd) {\n define('underscore', [], function() {\n return _;\n });\n }\n}.call(this));\n\n })(exports,require,module);\n });require.register('underscore/underscore', function(exports,require,module) {\n module.exports = require('underscore');\n });","/**\n * @license AngularJS v1.2.5\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 * @returns {function(string, string, ...): Error} instance\n */\n\nfunction minErr(module) {\n return function () {\n var code = arguments[0],\n prefix = '[' + (module ? module + ':' : '') + code + '] ',\n template = arguments[1],\n templateArgs = arguments,\n stringify = function (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 JSON.stringify(obj);\n }\n return obj;\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 arg = templateArgs[index + 2];\n if (typeof arg === 'function') {\n return arg.toString().replace(/ ?\\{[\\s\\S]*$/, '');\n } else if (typeof arg === 'undefined') {\n return 'undefined';\n } else if (typeof arg !== 'string') {\n return toJson(arg);\n }\n return arg;\n }\n return match;\n });\n\n message = message + '\\nhttp://errors.angularjs.org/1.2.5/' +\n (module ? module + '/' : '') + code;\n for (i = 2; i < arguments.length; i++) {\n message = message + (i == 2 ? '?' : '&') + 'p' + (i-2) + '=' +\n encodeURIComponent(stringify(arguments[i]));\n }\n\n return new Error(message);\n };\n}\n\n/* We need to tell jshint what variables are being exported */\n/* global\n -angular,\n -msie,\n -jqLite,\n -jQuery,\n -slice,\n -push,\n -toString,\n -ngMinErr,\n -_angular,\n -angularModule,\n -nodeName_,\n -uid,\n\n -lowercase,\n -uppercase,\n -manualLowercase,\n -manualUppercase,\n -nodeName_,\n -isArrayLike,\n -forEach,\n -sortedKeys,\n -forEachSorted,\n -reverseParams,\n -nextUid,\n -setHashKey,\n -extend,\n -int,\n -inherit,\n -noop,\n -identity,\n -valueFn,\n -isUndefined,\n -isDefined,\n -isObject,\n -isString,\n -isNumber,\n -isDate,\n -isArray,\n -isFunction,\n -isRegExp,\n -isWindow,\n -isScope,\n -isFile,\n -isBoolean,\n -trim,\n -isElement,\n -makeMap,\n -map,\n -size,\n -includes,\n -indexOf,\n -arrayRemove,\n -isLeafNode,\n -copy,\n -shallowCopy,\n -equals,\n -csp,\n -concat,\n -sliceArgs,\n -bind,\n -toJsonReplacer,\n -toJson,\n -fromJson,\n -toBoolean,\n -startingTag,\n -tryDecodeURIComponent,\n -parseKeyValue,\n -toKeyValue,\n -encodeUriSegment,\n -encodeUriQuery,\n -angularInit,\n -bootstrap,\n -snake_case,\n -bindJQuery,\n -assertArg,\n -assertArgFn,\n -assertNotHasOwnProperty,\n -getter,\n -getBlockElements,\n\n*/\n\n////////////////////////////////////\n\n/**\n * @ngdoc function\n * @name angular.lowercase\n * @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;};\n\n\n/**\n * @ngdoc function\n * @name angular.uppercase\n * @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 /** holds major version number for IE or NaN for real browsers */\n msie,\n jqLite, // delay binding since jQuery could be loaded after us.\n jQuery, // delay binding\n slice = [].slice,\n push = [].push,\n toString = Object.prototype.toString,\n ngMinErr = minErr('ng'),\n\n\n _angular = window.angular,\n /** @name angular */\n angular = window.angular || (window.angular = {}),\n angularModule,\n nodeName_,\n uid = ['0', '0', '0'];\n\n/**\n * IE 11 changed the format of the UserAgent string.\n * See http://msdn.microsoft.com/en-us/library/ms537503.aspx\n */\nmsie = int((/msie (\\d+)/.exec(lowercase(navigator.userAgent)) || [])[1]);\nif (isNaN(msie)) {\n msie = int((/trident\\/.*; rv:(\\d+)/.exec(lowercase(navigator.userAgent)) || [])[1]);\n}\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 === 1 && 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 * @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)`, where `value`\n * is the value of an object property or an array element and `key` is the object property key or\n * array element index. Specifying a `context` for the function is optional.\n *\n * Note: this function was previously known as `angular.foreach`.\n *\n <pre>\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 </pre>\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 */\nfunction forEach(obj, iterator, context) {\n var key;\n if (obj) {\n if (isFunction(obj)){\n for (key in obj) {\n if (key != 'prototype' && key != 'length' && key != 'name' && obj.hasOwnProperty(key)) {\n iterator.call(context, obj[key], key);\n }\n }\n } else if (obj.forEach && obj.forEach !== forEach) {\n obj.forEach(iterator, context);\n } else if (isArrayLike(obj)) {\n for (key = 0; key < obj.length; key++)\n iterator.call(context, obj[key], key);\n } else {\n for (key in obj) {\n if (obj.hasOwnProperty(key)) {\n iterator.call(context, obj[key], key);\n }\n }\n }\n }\n return obj;\n}\n\nfunction sortedKeys(obj) {\n var keys = [];\n for (var key in obj) {\n if (obj.hasOwnProperty(key)) {\n keys.push(key);\n }\n }\n return keys.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. The ID is a sequence of alpha numeric\n * characters such as '012ABC'. The reason why we are not using simply a number counter is that\n * the number string gets longer over time, and it can also overflow, where as the nextId\n * will grow much slower, it is a string, and it will never overflow.\n *\n * @returns an unique alpha-numeric string\n */\nfunction nextUid() {\n var index = uid.length;\n var digit;\n\n while(index) {\n index--;\n digit = uid[index].charCodeAt(0);\n if (digit == 57 /*'9'*/) {\n uid[index] = 'A';\n return uid.join('');\n }\n if (digit == 90 /*'Z'*/) {\n uid[index] = '0';\n } else {\n uid[index] = String.fromCharCode(digit + 1);\n return uid.join('');\n }\n }\n uid.unshift('0');\n return uid.join('');\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 }\n else {\n delete obj.$$hashKey;\n }\n}\n\n/**\n * @ngdoc function\n * @name angular.extend\n * @function\n *\n * @description\n * Extends the destination object `dst` by copying all of the properties from the `src` object(s)\n * to `dst`. You can specify multiple `src` objects.\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 forEach(arguments, function(obj){\n if (obj !== dst) {\n forEach(obj, function(value, key){\n dst[key] = value;\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(new (extend(function() {}, {prototype:parent}))(), extra);\n}\n\n/**\n * @ngdoc function\n * @name angular.noop\n * @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 <pre>\n function foo(callback) {\n var result = calculateResult();\n (callback || angular.noop)(result);\n }\n </pre>\n */\nfunction noop() {}\nnoop.$inject = [];\n\n\n/**\n * @ngdoc function\n * @name angular.identity\n * @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 <pre>\n function transformer(transformationFn, value) {\n return (transformationFn || angular.identity)(value);\n };\n </pre>\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 * @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 * @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 * @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.\n *\n * @param {*} value Reference to check.\n * @returns {boolean} True if `value` is an `Object` but not `null`.\n */\nfunction isObject(value){return value != null && typeof value === 'object';}\n\n\n/**\n * @ngdoc function\n * @name angular.isString\n * @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 * @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 * @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 * @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 */\nfunction isArray(value) {\n return toString.call(value) === '[object Array]';\n}\n\n\n/**\n * @ngdoc function\n * @name angular.isFunction\n * @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.document && obj.location && obj.alert && obj.setInterval;\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 isBoolean(value) {\n return typeof value === 'boolean';\n}\n\n\nvar trim = (function() {\n // native trim is way faster: http://jsperf.com/angular-trim-test\n // but IE doesn't have it... :-(\n // TODO: we should move this into IE/ES5 polyfill\n if (!String.prototype.trim) {\n return function(value) {\n return isString(value) ? value.replace(/^\\s\\s*/, '').replace(/\\s\\s*$/, '') : value;\n };\n }\n return function(value) {\n return isString(value) ? value.trim() : value;\n };\n})();\n\n\n/**\n * @ngdoc function\n * @name angular.isElement\n * @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.on && 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\nif (msie < 9) {\n nodeName_ = function(element) {\n element = element.nodeName ? element : element[0];\n return (element.scopeName && element.scopeName != 'HTML')\n ? uppercase(element.scopeName + ':' + element.nodeName) : element.nodeName;\n };\n} else {\n nodeName_ = function(element) {\n return element.nodeName ? element.nodeName : element[0].nodeName;\n };\n}\n\n\nfunction map(obj, iterator, context) {\n var results = [];\n forEach(obj, function(value, index, list) {\n results.push(iterator.call(context, value, index, list));\n });\n return results;\n}\n\n\n/**\n * @description\n * Determines the number of elements in an array, the number of properties an object has, or\n * the length of a string.\n *\n * Note: This function is used to augment the Object type in Angular expressions. See\n * {@link angular.Object} for more information about Angular arrays.\n *\n * @param {Object|Array|string} obj Object, array, or string to inspect.\n * @param {boolean} [ownPropsOnly=false] Count only \"own\" properties in an object\n * @returns {number} The size of `obj` or `0` if `obj` is neither an object nor an array.\n */\nfunction size(obj, ownPropsOnly) {\n var count = 0, key;\n\n if (isArray(obj) || isString(obj)) {\n return obj.length;\n } else if (isObject(obj)){\n for (key in obj)\n if (!ownPropsOnly || obj.hasOwnProperty(key))\n count++;\n }\n\n return count;\n}\n\n\nfunction includes(array, obj) {\n return indexOf(array, obj) != -1;\n}\n\nfunction indexOf(array, obj) {\n if (array.indexOf) return array.indexOf(obj);\n\n for (var i = 0; i < array.length; i++) {\n if (obj === array[i]) return i;\n }\n return -1;\n}\n\nfunction arrayRemove(array, value) {\n var index = indexOf(array, value);\n if (index >=0)\n array.splice(index, 1);\n return value;\n}\n\nfunction isLeafNode (node) {\n if (node) {\n switch (node.nodeName) {\n case \"OPTION\":\n case \"PRE\":\n case \"TITLE\":\n return true;\n }\n }\n return false;\n}\n\n/**\n * @ngdoc function\n * @name angular.copy\n * @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 array) 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 <doc:example>\n <doc:source>\n <div ng-controller=\"Controller\">\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 function Controller($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 </doc:source>\n </doc:example>\n */\nfunction copy(source, destination){\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, []);\n } else if (isDate(source)) {\n destination = new Date(source.getTime());\n } else if (isRegExp(source)) {\n destination = new RegExp(source.source);\n } else if (isObject(source)) {\n destination = copy(source, {});\n }\n }\n } else {\n if (source === destination) throw ngMinErr('cpi',\n \"Can't copy! Source and destination are identical.\");\n if (isArray(source)) {\n destination.length = 0;\n for ( var i = 0; i < source.length; i++) {\n destination.push(copy(source[i]));\n }\n } else {\n var h = destination.$$hashKey;\n forEach(destination, function(value, key){\n delete destination[key];\n });\n for ( var key in source) {\n destination[key] = copy(source[key]);\n }\n setHashKey(destination,h);\n }\n }\n return destination;\n}\n\n/**\n * Create a shallow copy of an object\n */\nfunction shallowCopy(src, dst) {\n dst = dst || {};\n\n for(var key in src) {\n // shallowCopy is only ever called by $compile nodeLinkFn, which has control over src\n // so we don't need to worry about using our custom hasOwnProperty here\n if (src.hasOwnProperty(key) && key.substr(0, 2) !== '$$') {\n dst[key] = src[key];\n }\n }\n\n return dst;\n}\n\n\n/**\n * @ngdoc function\n * @name angular.equals\n * @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 JavasScript,\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 return isDate(o2) && 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\n\nfunction csp() {\n return (document.securityPolicy && document.securityPolicy.isActive) ||\n (document.querySelector &&\n !!(document.querySelector('[ng-csp]') || document.querySelector('[data-ng-csp]')));\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 * @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, curryArgs.concat(slice.call(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) === '$') {\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 * @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=} pretty If set to true, the JSON output will contain newlines and whitespace.\n * @returns {string|undefined} JSON-ified string representing `obj`.\n */\nfunction toJson(obj, pretty) {\n if (typeof obj === 'undefined') return undefined;\n return JSON.stringify(obj, toJsonReplacer, pretty ? ' ' : null);\n}\n\n\n/**\n * @ngdoc function\n * @name angular.fromJson\n * @function\n *\n * @description\n * Deserializes a JSON string.\n *\n * @param {string} json JSON string to deserialize.\n * @returns {Object|Array|Date|string|number} Deserialized thingy.\n */\nfunction fromJson(json) {\n return isString(json)\n ? JSON.parse(json)\n : json;\n}\n\n\nfunction toBoolean(value) {\n if (value && value.length !== 0) {\n var v = lowercase(\"\" + value);\n value = !(v == 'f' || v == '0' || v == 'false' || v == 'no' || v == 'n' || v == '[]');\n } else {\n value = false;\n }\n return value;\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 // As Per DOM Standards\n var TEXT_NODE = 3;\n var elemHtml = jqLite('<div>').append(element).html();\n try {\n return element[0].nodeType === TEXT_NODE ? 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)>\n */\nfunction parseKeyValue(/**string*/keyValue) {\n var obj = {}, key_value, key;\n forEach((keyValue || \"\").split('&'), function(keyValue){\n if ( keyValue ) {\n key_value = keyValue.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 (!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(/%20/g, (pctEncodeSpaces ? '%20' : '+'));\n}\n\n\n/**\n * @ngdoc directive\n * @name ng.directive:ngApp\n *\n * @element ANY\n * @param {angular.Module} ngApp an optional application\n * {@link angular.module module} name to load.\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 and\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 </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 */\nfunction angularInit(element, bootstrap) {\n var elements = [element],\n appElement,\n module,\n names = ['ng:app', 'ng-app', 'x-ng-app', 'data-ng-app'],\n NG_APP_CLASS_REGEXP = /\\sng[:\\-]app(:\\s*([\\w\\d_]+);?)?\\s/;\n\n function append(element) {\n element && elements.push(element);\n }\n\n forEach(names, function(name) {\n names[name] = true;\n append(document.getElementById(name));\n name = name.replace(':', '\\\\:');\n if (element.querySelectorAll) {\n forEach(element.querySelectorAll('.' + name), append);\n forEach(element.querySelectorAll('.' + name + '\\\\:'), append);\n forEach(element.querySelectorAll('[' + name + ']'), append);\n }\n });\n\n forEach(elements, function(element) {\n if (!appElement) {\n var className = ' ' + element.className + ' ';\n var match = NG_APP_CLASS_REGEXP.exec(className);\n if (match) {\n appElement = element;\n module = (match[2] || '').replace(/\\s+/g, ',');\n } else {\n forEach(element.attributes, function(attr) {\n if (!appElement && names[attr.name]) {\n appElement = element;\n module = attr.value;\n }\n });\n }\n }\n });\n if (appElement) {\n bootstrap(appElement, module ? [module] : []);\n }\n}\n\n/**\n * @ngdoc function\n * @name angular.bootstrap\n * @description\n * Use this function to manually start up angular application.\n *\n * See: {@link guide/bootstrap Bootstrap}\n *\n * Note that ngScenario-based end-to-end tests cannot use this function to bootstrap manually.\n * They must use {@link api/ng.directive:ngApp ngApp}.\n *\n * @param {Element} 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 run block.\n * See: {@link angular.module modules}\n * @returns {AUTO.$injector} Returns the newly created injector for this app.\n */\nfunction bootstrap(element, modules) {\n var doBootstrap = function() {\n element = jqLite(element);\n\n if (element.injector()) {\n var tag = (element[0] === document) ? 'document' : startingTag(element);\n throw ngMinErr('btstrpd', \"App Already Bootstrapped with this Element '{0}'\", tag);\n }\n\n modules = modules || [];\n modules.unshift(['$provide', function($provide) {\n $provide.value('$rootElement', element);\n }]);\n modules.unshift('ng');\n var injector = createInjector(modules);\n injector.invoke(['$rootScope', '$rootElement', '$compile', '$injector', '$animate',\n function(scope, element, compile, injector, animate) {\n scope.$apply(function() {\n element.data('$injector', injector);\n compile(element)(scope);\n });\n }]\n );\n return injector;\n };\n\n var NG_DEFER_BOOTSTRAP = /^NG_DEFER_BOOTSTRAP!/;\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 doBootstrap();\n };\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\nfunction bindJQuery() {\n // bind to jQuery if present;\n jQuery = window.jQuery;\n // reset to jQuery or default to us.\n if (jQuery) {\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 // Method signature:\n // jqLitePatchJQueryRemove(name, dispatchThis, filterElems, getterIfNoArguments)\n jqLitePatchJQueryRemove('remove', true, true, false);\n jqLitePatchJQueryRemove('empty', false, false, false);\n jqLitePatchJQueryRemove('html', false, false, true);\n } else {\n jqLite = JQLite;\n }\n angular.element = jqLite;\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=true} bindFnToScope\n * @returns 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 object containing the elements\n */\nfunction getBlockElements(nodes) {\n var startNode = nodes[0],\n endNode = nodes[nodes.length - 1];\n if (startNode === endNode) {\n return jqLite(startNode);\n }\n\n var element = startNode;\n var elements = [element];\n\n do {\n element = element.nextSibling;\n if (!element) break;\n elements.push(element);\n } while (element !== endNode);\n\n return jqLite(elements);\n}\n\n/**\n * @ngdoc interface\n * @name angular.Module\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 * @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, filters, and configuration information.\n * `angular.module` is used to configure the {@link AUTO.$injector $injector}.\n *\n * <pre>\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(function($locationProvider) {\n * // Configure existing providers\n * $locationProvider.hashPrefix('!');\n * });\n * </pre>\n *\n * Then you can create an injector and load your modules like this:\n *\n * <pre>\n * var injector = angular.injector(['ng', 'MyModule'])\n * </pre>\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 the module is being retrieved for further configuration.\n * @param {Function} configFn Optional configuration function for the module. Same as\n * {@link angular.Module#methods_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 runBlocks = [];\n\n var config = invokeLater('$injector', 'invoke');\n\n /** @type {angular.Module} */\n var moduleInstance = {\n // Private state\n _invokeQueue: invokeQueue,\n _runBlocks: runBlocks,\n\n /**\n * @ngdoc property\n * @name angular.Module#requires\n * @propertyOf angular.Module\n * @returns {Array.<string>} List of module names which must be loaded before this module.\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 * @propertyOf angular.Module\n * @returns {string} Name of the module.\n * @description\n */\n name: name,\n\n\n /**\n * @ngdoc method\n * @name angular.Module#provider\n * @methodOf angular.Module\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 * @methodOf angular.Module\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 * @methodOf angular.Module\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 * @methodOf angular.Module\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 * @methodOf angular.Module\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 * @methodOf angular.Module\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 * <pre>\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 * </pre>\n *\n * See {@link ngAnimate.$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 * @methodOf angular.Module\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 * @methodOf angular.Module\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 * @methodOf angular.Module\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#methods_directive $compileProvider.directive()}.\n */\n directive: invokeLater('$compileProvider', 'directive'),\n\n /**\n * @ngdoc method\n * @name angular.Module#config\n * @methodOf angular.Module\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 */\n config: config,\n\n /**\n * @ngdoc method\n * @name angular.Module#run\n * @methodOf angular.Module\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) {\n return function() {\n invokeQueue[insertMethod || 'push']([provider, method, arguments]);\n return moduleInstance;\n };\n }\n });\n };\n });\n\n}\n\n/* global\n 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 requiredDirective,\n requiredDirective,\n ngValueDirective,\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 $$SanitizeUriProvider,\n $SceProvider,\n $SceDelegateProvider,\n $SnifferProvider,\n $TemplateCacheProvider,\n $TimeoutProvider,\n $WindowProvider\n*/\n\n\n/**\n * @ngdoc property\n * @name angular.version\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.2.5', // all of these placeholder strings will be replaced by grunt's\n major: 1, // package task\n minor: 2,\n dot: 5,\n codeName: 'singularity-expansion'\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 '$$minErr': minErr,\n '$$csp': csp\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 required: requiredDirective,\n ngRequired: requiredDirective,\n ngValue: ngValueDirective\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 $sce: $SceProvider,\n $sceDelegate: $SceDelegateProvider,\n $sniffer: $SnifferProvider,\n $templateCache: $TemplateCacheProvider,\n $timeout: $TimeoutProvider,\n $window: $WindowProvider\n });\n }\n ]);\n}\n\n/* global\n\n -JQLitePrototype,\n -addEventListenerFn,\n -removeEventListenerFn,\n -BOOLEAN_ATTR\n*/\n\n//////////////////////////////////\n//JQLite\n//////////////////////////////////\n\n/**\n * @ngdoc function\n * @name angular.element\n * @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/)\n * - [`bind()`](http://api.jquery.com/on/) - 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/)\n * - [`data()`](http://api.jquery.com/data/)\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 * - [`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/off/) - 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 api/ng.$rootScope.Scope scope} of the current\n * element or its parent.\n * - `isolateScope()` - retrieves an isolate {@link api/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 * - `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\nvar jqCache = JQLite.cache = {},\n jqName = JQLite.expando = 'ng-' + new Date().getTime(),\n jqId = 1,\n addEventListenerFn = (window.document.addEventListener\n ? function(element, type, fn) {element.addEventListener(type, fn, false);}\n : function(element, type, fn) {element.attachEvent('on' + type, fn);}),\n removeEventListenerFn = (window.document.removeEventListener\n ? function(element, type, fn) {element.removeEventListener(type, fn, false); }\n : function(element, type, fn) {element.detachEvent('on' + type, fn); });\n\nfunction jqNextId() { return ++jqId; }\n\n\nvar SPECIAL_CHARS_REGEXP = /([\\:\\-\\_]+(.))/g;\nvar MOZ_HACK_REGEXP = /^moz([A-Z])/;\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\n/////////////////////////////////////////////\n// jQuery mutation patch\n//\n// In conjunction with bindJQuery intercepts all jQuery's DOM destruction apis and fires a\n// $destroy event on all DOM nodes being removed.\n//\n/////////////////////////////////////////////\n\nfunction jqLitePatchJQueryRemove(name, dispatchThis, filterElems, getterIfNoArguments) {\n var originalJqFn = jQuery.fn[name];\n originalJqFn = originalJqFn.$original || originalJqFn;\n removePatch.$original = originalJqFn;\n jQuery.fn[name] = removePatch;\n\n function removePatch(param) {\n // jshint -W040\n var list = filterElems && param ? [this.filter(param)] : [this],\n fireEvent = dispatchThis,\n set, setIndex, setLength,\n element, childIndex, childLength, children;\n\n if (!getterIfNoArguments || param != null) {\n while(list.length) {\n set = list.shift();\n for(setIndex = 0, setLength = set.length; setIndex < setLength; setIndex++) {\n element = jqLite(set[setIndex]);\n if (fireEvent) {\n element.triggerHandler('$destroy');\n } else {\n fireEvent = !fireEvent;\n }\n for(childIndex = 0, childLength = (children = element.children()).length;\n childIndex < childLength;\n childIndex++) {\n list.push(jQuery(children[childIndex]));\n }\n }\n }\n }\n return originalJqFn.apply(this, arguments);\n }\n}\n\n/////////////////////////////////////////////\nfunction JQLite(element) {\n if (element instanceof JQLite) {\n return element;\n }\n if (!(this instanceof JQLite)) {\n if (isString(element) && 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 (isString(element)) {\n var div = document.createElement('div');\n // Read about the NoScope elements here:\n // http://msdn.microsoft.com/en-us/library/ms533897(VS.85).aspx\n div.innerHTML = '<div> </div>' + element; // IE insanity to make NoScope elements work!\n div.removeChild(div.firstChild); // remove the superfluous div\n jqLiteAddNodes(this, div.childNodes);\n var fragment = jqLite(document.createDocumentFragment());\n fragment.append(this); // detach the elements from the temporary DOM div.\n } else {\n jqLiteAddNodes(this, element);\n }\n}\n\nfunction jqLiteClone(element) {\n return element.cloneNode(true);\n}\n\nfunction jqLiteDealoc(element){\n jqLiteRemoveData(element);\n for ( var i = 0, children = element.childNodes || []; i < children.length; i++) {\n jqLiteDealoc(children[i]);\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 events = jqLiteExpandoStore(element, 'events'),\n handle = jqLiteExpandoStore(element, 'handle');\n\n if (!handle) return; //no listeners registered\n\n if (isUndefined(type)) {\n forEach(events, function(eventHandler, type) {\n removeEventListenerFn(element, type, eventHandler);\n delete events[type];\n });\n } else {\n forEach(type.split(' '), function(type) {\n if (isUndefined(fn)) {\n removeEventListenerFn(element, type, events[type]);\n delete events[type];\n } else {\n arrayRemove(events[type] || [], fn);\n }\n });\n }\n}\n\nfunction jqLiteRemoveData(element, name) {\n var expandoId = element[jqName],\n expandoStore = jqCache[expandoId];\n\n if (expandoStore) {\n if (name) {\n delete jqCache[expandoId].data[name];\n return;\n }\n\n if (expandoStore.handle) {\n expandoStore.events.$destroy && expandoStore.handle({}, '$destroy');\n jqLiteOff(element);\n }\n delete jqCache[expandoId];\n element[jqName] = undefined; // ie does not allow deletion of attributes on elements.\n }\n}\n\nfunction jqLiteExpandoStore(element, key, value) {\n var expandoId = element[jqName],\n expandoStore = jqCache[expandoId || -1];\n\n if (isDefined(value)) {\n if (!expandoStore) {\n element[jqName] = expandoId = jqNextId();\n expandoStore = jqCache[expandoId] = {};\n }\n expandoStore[key] = value;\n } else {\n return expandoStore && expandoStore[key];\n }\n}\n\nfunction jqLiteData(element, key, value) {\n var data = jqLiteExpandoStore(element, 'data'),\n isSetter = isDefined(value),\n keyDefined = !isSetter && isDefined(key),\n isSimpleGetter = keyDefined && !isObject(key);\n\n if (!data && !isSimpleGetter) {\n jqLiteExpandoStore(element, 'data', data = {});\n }\n\n if (isSetter) {\n data[key] = value;\n } else {\n if (keyDefined) {\n if (isSimpleGetter) {\n // don't create data in this case.\n return data && data[key];\n } else {\n extend(data, key);\n }\n } else {\n return data;\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\nfunction jqLiteAddNodes(root, elements) {\n if (elements) {\n elements = (!elements.nodeName && isDefined(elements.length) && !isWindow(elements))\n ? elements\n : [ elements ];\n for(var i=0; i < elements.length; i++) {\n root.push(elements[i]);\n }\n }\n}\n\nfunction jqLiteController(element, name) {\n return jqLiteInheritedData(element, '$' + (name || 'ngController' ) + 'Controller');\n}\n\nfunction jqLiteInheritedData(element, name, value) {\n element = jqLite(element);\n\n // if element is the document object work with the html element instead\n // this makes $(document).scope() possible\n if(element[0].nodeType == 9) {\n element = element.find('html');\n }\n var names = isArray(name) ? name : [name];\n\n while (element.length) {\n\n for (var i = 0, ii = names.length; i < ii; i++) {\n if ((value = element.data(names[i])) !== undefined) return value;\n }\n element = element.parent();\n }\n}\n\nfunction jqLiteEmpty(element) {\n for (var i = 0, childNodes = element.childNodes; i < childNodes.length; i++) {\n jqLiteDealoc(childNodes[i]);\n }\n while (element.firstChild) {\n element.removeChild(element.firstChild);\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 already is 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[uppercase(value)] = true;\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[element.nodeName] && booleanAttr;\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(element).data('$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(element).data('$isolateScope') || jqLite(element).data('$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 var val;\n\n if (msie <= 8) {\n // this is some IE specific weirdness that jQuery 1.6.4 does not sure why\n val = element.currentStyle && element.currentStyle[name];\n if (val === '') val = 'auto';\n }\n\n val = val || element.style[name];\n\n if (msie <= 8) {\n // jquery weirdness :-/\n val = (val === '') ? undefined : val;\n }\n\n return val;\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 var NODE_TYPE_TEXT_PROPERTY = [];\n if (msie < 9) {\n NODE_TYPE_TEXT_PROPERTY[1] = 'innerText'; /** Element **/\n NODE_TYPE_TEXT_PROPERTY[3] = 'nodeValue'; /** Text **/\n } else {\n NODE_TYPE_TEXT_PROPERTY[1] = /** Element **/\n NODE_TYPE_TEXT_PROPERTY[3] = 'textContent'; /** Text **/\n }\n getText.$dv = '';\n return getText;\n\n function getText(element, value) {\n var textProp = NODE_TYPE_TEXT_PROPERTY[element.nodeType];\n if (isUndefined(value)) {\n return textProp ? element[textProp] : '';\n }\n element[textProp] = value;\n }\n })(),\n\n val: function(element, value) {\n if (isUndefined(value)) {\n if (nodeName_(element) === 'SELECT' && element.multiple) {\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 for (var i = 0, childNodes = element.childNodes; i < childNodes.length; i++) {\n jqLiteDealoc(childNodes[i]);\n }\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\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 < this.length; 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 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(this.length, 1) : this.length;\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 < this.length; 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 if (!event.preventDefault) {\n event.preventDefault = function() {\n event.returnValue = false; //ie\n };\n }\n\n if (!event.stopPropagation) {\n event.stopPropagation = function() {\n event.cancelBubble = true; //ie\n };\n }\n\n if (!event.target) {\n event.target = event.srcElement || document;\n }\n\n if (isUndefined(event.defaultPrevented)) {\n var prevent = event.preventDefault;\n event.preventDefault = function() {\n event.defaultPrevented = true;\n prevent.call(event);\n };\n event.defaultPrevented = false;\n }\n\n event.isDefaultPrevented = function() {\n return event.defaultPrevented || event.returnValue === false;\n };\n\n forEach(events[type || event.type], function(fn) {\n fn.call(element, event);\n });\n\n // Remove monkey-patched methods (IE),\n // as they would cause memory leaks in IE8.\n if (msie <= 8) {\n // IE7/8 does not allow to delete property on native object\n event.preventDefault = null;\n event.stopPropagation = null;\n event.isDefaultPrevented = null;\n } else {\n // It shouldn't affect normal browsers (native methods are defined on prototype).\n delete event.preventDefault;\n delete event.stopPropagation;\n delete event.isDefaultPrevented;\n }\n };\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 dealoc: jqLiteDealoc,\n\n on: function onFn(element, type, fn, unsupported){\n if (isDefined(unsupported)) throw jqLiteMinErr('onargs', 'jqLite#on() does not support the `selector` or `eventData` parameters');\n\n var events = jqLiteExpandoStore(element, 'events'),\n handle = jqLiteExpandoStore(element, 'handle');\n\n if (!events) jqLiteExpandoStore(element, 'events', events = {});\n if (!handle) jqLiteExpandoStore(element, 'handle', handle = createEventHandler(element, events));\n\n forEach(type.split(' '), function(type){\n var eventFns = events[type];\n\n if (!eventFns) {\n if (type == 'mouseenter' || type == 'mouseleave') {\n var contains = document.body.contains || document.body.compareDocumentPosition ?\n function( a, b ) {\n // jshint bitwise: false\n var adown = a.nodeType === 9 ? a.documentElement : a,\n bup = b && b.parentNode;\n return a === bup || !!( bup && bup.nodeType === 1 && (\n adown.contains ?\n adown.contains( bup ) :\n a.compareDocumentPosition && a.compareDocumentPosition( bup ) & 16\n ));\n } :\n function( a, b ) {\n if ( b ) {\n while ( (b = b.parentNode) ) {\n if ( b === a ) {\n return true;\n }\n }\n }\n return false;\n };\n\n events[type] = [];\n\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 var eventmap = { mouseleave : \"mouseout\", mouseenter : \"mouseover\"};\n\n onFn(element, eventmap[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 && !contains(target, related)) ){\n handle(event, type);\n }\n });\n\n } else {\n addEventListenerFn(element, type, handle);\n events[type] = [];\n }\n eventFns = events[type];\n }\n eventFns.push(fn);\n });\n },\n\n off: jqLiteOff,\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 === 1)\n children.push(element);\n });\n return children;\n },\n\n contents: function(element) {\n return element.childNodes || [];\n },\n\n append: function(element, node) {\n forEach(new JQLite(node), function(child){\n if (element.nodeType === 1 || element.nodeType === 11) {\n element.appendChild(child);\n }\n });\n },\n\n prepend: function(element, node) {\n if (element.nodeType === 1) {\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)[0];\n var parent = element.parentNode;\n if (parent) {\n parent.replaceChild(wrapNode, element);\n }\n wrapNode.appendChild(element);\n },\n\n remove: function(element) {\n jqLiteDealoc(element);\n var parent = element.parentNode;\n if (parent) parent.removeChild(element);\n },\n\n after: function(element, newElement) {\n var index = element, parent = element.parentNode;\n forEach(new JQLite(newElement), function(node){\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 (isUndefined(condition)) {\n condition = !jqLiteHasClass(element, selector);\n }\n (condition ? jqLiteAddClass : jqLiteRemoveClass)(element, selector);\n },\n\n parent: function(element) {\n var parent = element.parentNode;\n return parent && parent.nodeType !== 11 ? parent : null;\n },\n\n next: function(element) {\n if (element.nextElementSibling) {\n return element.nextElementSibling;\n }\n\n // IE8 doesn't have nextElementSibling\n var elm = element.nextSibling;\n while (elm != null && elm.nodeType !== 1) {\n elm = elm.nextSibling;\n }\n return elm;\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, eventName, eventData) {\n var eventFns = (jqLiteExpandoStore(element, 'events') || {})[eventName];\n\n eventData = eventData || [];\n\n var event = [{\n preventDefault: noop,\n stopPropagation: noop\n }];\n\n forEach(eventFns, function(fn) {\n fn.apply(element, event.concat(eventData));\n });\n }\n}, function(fn, name){\n /**\n * chaining functions\n */\n JQLite.prototype[name] = function(arg1, arg2, arg3) {\n var value;\n for(var i=0; i < this.length; 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 * 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) {\n var objType = typeof obj,\n key;\n\n if (objType == 'object' && obj !== null) {\n if (typeof (key = obj.$$hashKey) == 'function') {\n // must invoke on object to keep the right this\n key = obj.$$hashKey();\n } else if (key === undefined) {\n key = obj.$$hashKey = nextUid();\n }\n } else {\n key = obj;\n }\n\n return objType + ':' + key;\n}\n\n/**\n * HashMap which can use objects as keys\n */\nfunction HashMap(array){\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)] = value;\n },\n\n /**\n * @param key\n * @returns the value for the key\n */\n get: function(key) {\n return this[hashKey(key)];\n },\n\n /**\n * Remove the key/value pair\n * @param key\n */\n remove: function(key) {\n var value = this[key = hashKey(key)];\n delete this[key];\n return value;\n }\n};\n\n/**\n * @ngdoc function\n * @name angular.injector\n * @function\n *\n * @description\n * Creates an injector function that can be used for retrieving services as well as for\n * dependency injection (see {@link guide/di dependency injection}).\n *\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 * @returns {function()} Injector function. See {@link AUTO.$injector $injector}.\n *\n * @example\n * Typical usage\n * <pre>\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 * </pre>\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 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 * <pre>\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 * </pre>\n */\n\n\n/**\n * @ngdoc overview\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');\nfunction annotate(fn) {\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 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 object\n * @name AUTO.$injector\n * @function\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 * <pre>\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 * </pre>\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 * <pre>\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 * </pre>\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. *NOTE:* This does not work with\n * minification, and obfuscation tools since these tools change the argument names.\n *\n * ## `$inject` Annotation\n * By adding a `$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 AUTO.$injector#get\n * @methodOf AUTO.$injector\n *\n * @description\n * Return an instance of the service.\n *\n * @param {string} name The name of the instance to retrieve.\n * @return {*} The instance.\n */\n\n/**\n * @ngdoc method\n * @name AUTO.$injector#invoke\n * @methodOf AUTO.$injector\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 AUTO.$injector#has\n * @methodOf AUTO.$injector\n *\n * @description\n * Allows the user to query if the particular service exist.\n *\n * @param {string} Name of the service to query.\n * @returns {boolean} returns true if injector has given service.\n */\n\n/**\n * @ngdoc method\n * @name AUTO.$injector#instantiate\n * @methodOf AUTO.$injector\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 AUTO.$injector#annotate\n * @methodOf AUTO.$injector\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 * <pre>\n * // Given\n * function MyController($scope, $route) {\n * // ...\n * }\n *\n * // Then\n * expect(injector.annotate(MyController)).toEqual(['$scope', '$route']);\n * </pre>\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 * <pre>\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 * </pre>\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 * <pre>\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 * </pre>\n *\n * @param {function|Array.<string|Function>} fn Function for which dependent service names need to\n * be retrieved as described above.\n *\n * @returns {Array.<string>} The names of the services which the function requires.\n */\n\n\n\n\n/**\n * @ngdoc object\n * @name AUTO.$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#methods_provider provider(provider)} - registers a **service provider** with the\n * {@link AUTO.$injector $injector}\n * * {@link AUTO.$provide#methods_constant constant(obj)} - registers a value/object that can be accessed by\n * providers and services.\n * * {@link AUTO.$provide#methods_value value(obj)} - registers a value/object that can only be accessed by\n * services, not providers.\n * * {@link AUTO.$provide#methods_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#methods_service service(class)} - registers a **constructor function**, `class` that\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 AUTO.$provide#provider\n * @methodOf AUTO.$provide\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\n * created.\n * - `Constructor`: a new instance of the provider will be created using\n * {@link AUTO.$injector#instantiate $injector.instantiate()}, then treated as\n * `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#methods_provider $provide.provider()}.\n *\n * <pre>\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 * </pre>\n */\n\n/**\n * @ngdoc method\n * @name AUTO.$provide#factory\n * @methodOf AUTO.$provide\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 * <pre>\n * $provide.factory('ping', ['$http', function($http) {\n * return function ping() {\n * return $http.send('/ping');\n * };\n * }]);\n * </pre>\n * You would then inject and use this service like this:\n * <pre>\n * someModule.controller('Ctrl', ['ping', function(ping) {\n * ping();\n * }]);\n * </pre>\n */\n\n\n/**\n * @ngdoc method\n * @name AUTO.$provide#service\n * @methodOf AUTO.$provide\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#methods_service $provide.service(class)} if you define your service\n * as a type/class. This is common when using {@link http://coffeescript.org CoffeeScript}.\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#methods_service $provide.service(class)} that is defined as a CoffeeScript class.\n * <pre>\n * class Ping\n * constructor: (@$http)->\n * send: ()=>\n * @$http.get('/ping')\n *\n * $provide.service('ping', ['$http', Ping])\n * </pre>\n * You would then inject and use this service like this:\n * <pre>\n * someModule.controller 'Ctrl', ['ping', (ping)->\n * ping.send()\n * ]\n * </pre>\n */\n\n\n/**\n * @ngdoc method\n * @name AUTO.$provide#value\n * @methodOf AUTO.$provide\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 * <pre>\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 * </pre>\n */\n\n\n/**\n * @ngdoc method\n * @name AUTO.$provide#constant\n * @methodOf AUTO.$provide\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 * <pre>\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 * </pre>\n */\n\n\n/**\n * @ngdoc method\n * @name AUTO.$provide#decorator\n * @methodOf AUTO.$provide\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 * <pre>\n * $provider.decorator('$log', ['$delegate', function($delegate) {\n * $delegate.warn = $delegate.error;\n * return $delegate;\n * }]);\n * </pre>\n */\n\n\nfunction createInjector(modulesToLoad) {\n var INSTANTIATING = {},\n providerSuffix = 'Provider',\n path = [],\n loadedModules = new HashMap(),\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() {\n throw $injectorMinErr('unpr', \"Unknown provider: {0}\", path.join(' <- '));\n })),\n instanceCache = {},\n instanceInjector = (instanceCache.$injector =\n createInternalInjector(instanceCache, function(servicename) {\n var provider = providerInjector.get(servicename + providerSuffix);\n return instanceInjector.invoke(provider.$get, provider);\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 factory(name, factoryFn) { return provider(name, { $get: factoryFn }); }\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)); }\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, invokeQueue, i, ii;\n forEach(modulesToLoad, function(module) {\n if (loadedModules.get(module)) return;\n loadedModules.put(module, true);\n\n try {\n if (isString(module)) {\n moduleFn = angularModule(module);\n runBlocks = runBlocks.concat(loadModules(moduleFn.requires)).concat(moduleFn._runBlocks);\n\n for(invokeQueue = moduleFn._invokeQueue, i = 0, ii = invokeQueue.length; i < ii; i++) {\n var invokeArgs = invokeQueue[i],\n provider = providerInjector.get(invokeArgs[0]);\n\n provider[invokeArgs[1]].apply(provider, invokeArgs[2]);\n }\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) {\n if (cache.hasOwnProperty(serviceName)) {\n if (cache[serviceName] === INSTANTIATING) {\n throw $injectorMinErr('cdep', 'Circular dependency found: {0}', 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);\n } finally {\n path.shift();\n }\n }\n }\n\n function invoke(fn, self, locals){\n var args = [],\n $inject = annotate(fn),\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)\n );\n }\n if (!fn.$inject) {\n // this means that we must be an array.\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) {\n var Constructor = function() {},\n instance, returnedValue;\n\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 Constructor.prototype = (isArray(Type) ? Type[Type.length - 1] : Type).prototype;\n instance = new Constructor();\n returnedValue = invoke(Type, instance, locals);\n\n return isObject(returnedValue) || isFunction(returnedValue) ? returnedValue : instance;\n }\n\n return {\n invoke: invoke,\n instantiate: instantiate,\n get: getService,\n annotate: annotate,\n has: function(name) {\n return providerCache.hasOwnProperty(name + providerSuffix) || cache.hasOwnProperty(name);\n }\n };\n }\n}\n\n/**\n * @ngdoc function\n * @name ng.$anchorScroll\n * @requires $window\n * @requires $location\n * @requires $rootScope\n *\n * @description\n * When called, it checks current value of `$location.hash()` and scroll to related element,\n * according to rules specified in\n * {@link http://dev.w3.org/html5/spec/Overview.html#the-indicated-part-of-the-document Html5 spec}.\n *\n * It also watches the `$location.hash()` and scrolls whenever it changes to match any anchor.\n * This can be disabled by calling `$anchorScrollProvider.disableAutoScrolling()`.\n * \n * @example\n <example>\n <file name=\"index.html\">\n <div id=\"scrollArea\" ng-controller=\"ScrollCtrl\">\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 function ScrollCtrl($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: 350px;\n overflow: auto;\n }\n\n #bottom {\n display: block;\n margin-top: 2000px;\n }\n </file>\n </example>\n */\nfunction $AnchorScrollProvider() {\n\n var autoScrollingEnabled = true;\n\n this.disableAutoScrolling = function() {\n autoScrollingEnabled = false;\n };\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 // can't use filter.filter, as it accepts only instances of Array\n // and IE can't convert NodeList to an array using [].slice\n // TODO(vojta): use filter if we change it to accept lists as well\n function getFirstAnchor(list) {\n var result = null;\n forEach(list, function(element) {\n if (!result && lowercase(element.nodeName) === 'a') result = element;\n });\n return result;\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) $window.scrollTo(0, 0);\n\n // element with given id\n else if ((elm = document.getElementById(hash))) elm.scrollIntoView();\n\n // first anchor with given name :-D\n else if ((elm = getFirstAnchor(document.getElementsByName(hash)))) elm.scrollIntoView();\n\n // no element and hash == 'top', scroll to the top of the page\n else if (hash === 'top') $window.scrollTo(0, 0);\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() {\n $rootScope.$evalAsync(scroll);\n });\n }\n\n return scroll;\n }];\n}\n\nvar $animateMinErr = minErr('$animate');\n\n/**\n * @ngdoc object\n * @name ng.$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 function\n * @name ng.$animateProvider#register\n * @methodOf ng.$animateProvider\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 *<pre>\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 *</pre>\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 this.$get = ['$timeout', function($timeout) {\n\n /**\n *\n * @ngdoc object\n * @name ng.$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\n /**\n *\n * @ngdoc function\n * @name ng.$animate#enter\n * @methodOf ng.$animate\n * @function\n * @description Inserts the element into the DOM either after the `after` element or within\n * the `parent` element. Once complete, the done() callback will be fired (if provided).\n * @param {jQuery/jqLite element} element the element which will be inserted into the DOM\n * @param {jQuery/jqLite element} parent the parent element which will append the element as\n * a child (if the after element is not present)\n * @param {jQuery/jqLite element} after the sibling element which will append the element\n * after itself\n * @param {function=} done callback function that will be called after the element has been\n * inserted into the DOM\n */\n enter : function(element, parent, after, done) {\n if (after) {\n after.after(element);\n } else {\n if (!parent || !parent[0]) {\n parent = after.parent();\n }\n parent.append(element);\n }\n done && $timeout(done, 0, false);\n },\n\n /**\n *\n * @ngdoc function\n * @name ng.$animate#leave\n * @methodOf ng.$animate\n * @function\n * @description Removes the element from the DOM. Once complete, the done() callback will be\n * fired (if provided).\n * @param {jQuery/jqLite element} element the element which will be removed from the DOM\n * @param {function=} done callback function that will be called after the element has been\n * removed from the DOM\n */\n leave : function(element, done) {\n element.remove();\n done && $timeout(done, 0, false);\n },\n\n /**\n *\n * @ngdoc function\n * @name ng.$animate#move\n * @methodOf ng.$animate\n * @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. Once complete, the\n * done() callback will be fired (if provided).\n * \n * @param {jQuery/jqLite element} element the element which will be moved around within the\n * DOM\n * @param {jQuery/jqLite element} parent the parent element where the element will be\n * inserted into (if the after element is not present)\n * @param {jQuery/jqLite element} after the sibling element where the element will be\n * positioned next to\n * @param {function=} done the callback function (if provided) that will be fired after the\n * element has been moved to its new position\n */\n move : function(element, parent, after, done) {\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 this.enter(element, parent, after, done);\n },\n\n /**\n *\n * @ngdoc function\n * @name ng.$animate#addClass\n * @methodOf ng.$animate\n * @function\n * @description Adds the provided className CSS class value to the provided element. Once\n * complete, the done() callback will be fired (if provided).\n * @param {jQuery/jqLite element} 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 {function=} done the callback function (if provided) that will be fired after the\n * className value has been added to the element\n */\n addClass : function(element, className, done) {\n className = isString(className) ?\n className :\n isArray(className) ? className.join(' ') : '';\n forEach(element, function (element) {\n jqLiteAddClass(element, className);\n });\n done && $timeout(done, 0, false);\n },\n\n /**\n *\n * @ngdoc function\n * @name ng.$animate#removeClass\n * @methodOf ng.$animate\n * @function\n * @description Removes the provided className CSS class value from the provided element.\n * Once complete, the done() callback will be fired (if provided).\n * @param {jQuery/jqLite element} 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 {function=} done the callback function (if provided) that will be fired after the\n * className value has been removed from the element\n */\n removeClass : function(element, className, done) {\n className = isString(className) ?\n className :\n isArray(className) ? className.join(' ') : '';\n forEach(element, function (element) {\n jqLiteRemoveClass(element, className);\n });\n done && $timeout(done, 0, false);\n },\n\n enabled : noop\n };\n }];\n}];\n\n/**\n * ! This is a private undocumented service !\n *\n * @name ng.$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 {function()} XHR XMLHttpRequest constructor.\n * @param {object} $log console.log 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 /**\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 ng.$browser#addPollFn\n * @methodOf ng.$browser\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 lastBrowserUrl = location.href,\n baseElement = document.find('base'),\n newLocation = null;\n\n /**\n * @name ng.$browser#url\n * @methodOf ng.$browser\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 */\n self.url = function(url, replace) {\n // Android Browser BFCache causes location reference to become stale.\n if (location !== window.location) location = window.location;\n\n // setter\n if (url) {\n if (lastBrowserUrl == url) return;\n lastBrowserUrl = url;\n if ($sniffer.history) {\n if (replace) history.replaceState(null, '', url);\n else {\n history.pushState(null, '', url);\n // Crazy Opera Bug: http://my.opera.com/community/forums/topic.dml?id=1185462\n baseElement.attr('href', baseElement.attr('href'));\n }\n } else {\n newLocation = url;\n if (replace) {\n location.replace(url);\n } else {\n location.href = url;\n }\n }\n return self;\n // getter\n } else {\n // - newLocation is a workaround for an IE7-9 issue with location.replace and location.href\n // methods not updating location.href synchronously.\n // - the replacement is a workaround for https://bugzilla.mozilla.org/show_bug.cgi?id=407172\n return newLocation || location.href.replace(/%27/g,\"'\");\n }\n };\n\n var urlChangeListeners = [],\n urlChangeInit = false;\n\n function fireUrlChange() {\n newLocation = null;\n if (lastBrowserUrl == self.url()) return;\n\n lastBrowserUrl = self.url();\n forEach(urlChangeListeners, function(listener) {\n listener(self.url());\n });\n }\n\n /**\n * @name ng.$browser#onUrlChange\n * @methodOf ng.$browser\n * @TODO(vojta): refactor to use node's syntax for events\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 by 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 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', fireUrlChange);\n // hashchange event\n if ($sniffer.hashchange) jqLite(window).on('hashchange', fireUrlChange);\n // polling\n else self.addPollFn(fireUrlChange);\n\n urlChangeInit = true;\n }\n\n urlChangeListeners.push(callback);\n return callback;\n };\n\n //////////////////////////////////////////////////////////////\n // Misc API\n //////////////////////////////////////////////////////////////\n\n /**\n * @name ng.$browser#baseHref\n * @methodOf ng.$browser\n * \n * @description\n * Returns current <base href>\n * (always relative - without domain)\n *\n * @returns {string=} 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 /**\n * @name ng.$browser#cookies\n * @methodOf ng.$browser\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 /* global escape: false, unescape: false */\n var cookieLength, cookieArray, cookie, i, index;\n\n if (name) {\n if (value === undefined) {\n rawDocument.cookie = escape(name) + \"=;path=\" + cookiePath +\n \";expires=Thu, 01 Jan 1970 00:00:00 GMT\";\n } else {\n if (isString(value)) {\n cookieLength = (rawDocument.cookie = escape(name) + '=' + escape(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 = unescape(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] = unescape(cookie.substring(index + 1));\n }\n }\n }\n }\n return lastCookies;\n }\n };\n\n\n /**\n * @name ng.$browser#defer\n * @methodOf ng.$browser\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 ng.$browser#defer.cancel\n * @methodOf ng.$browser.defer\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 object\n * @name ng.$cacheFactory\n *\n * @description\n * Factory that constructs cache objects and gives access to them.\n * \n * <pre>\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 * </pre>\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 */\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 return caches[cacheId] = {\n\n put: function(key, value) {\n var lruEntry = lruHash[key] || (lruHash[key] = {key: key});\n\n refresh(lruEntry);\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 get: function(key) {\n var lruEntry = lruHash[key];\n\n if (!lruEntry) return;\n\n refresh(lruEntry);\n\n return data[key];\n },\n\n\n remove: function(key) {\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 delete data[key];\n size--;\n },\n\n\n removeAll: function() {\n data = {};\n size = 0;\n lruHash = {};\n freshEnd = staleEnd = null;\n },\n\n\n destroy: function() {\n data = null;\n stats = null;\n lruHash = null;\n delete caches[cacheId];\n },\n\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 ng.$cacheFactory#info\n * @methodOf ng.$cacheFactory\n *\n * @description\n * Get information about all the of 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 ng.$cacheFactory#get\n * @methodOf ng.$cacheFactory\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 object\n * @name ng.$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 * <pre>\n * <html ng-app>\n * <head>\n * <script type=\"text/ng-template\" id=\"templateId.html\">\n * This is the content of the template\n * </script>\n * </head>\n * ...\n * </html>\n * </pre>\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 below the `ng-app` definition.\n * \n * Adding via the $templateCache service:\n * \n * <pre>\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 * </pre>\n * \n * To retrieve the template later, simply use it in your HTML:\n * <pre>\n * <div ng-include=\" 'templateId.html' \"></div>\n * </pre>\n * \n * or get it via Javascript:\n * <pre>\n * $templateCache.get('templateId.html')\n * </pre>\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 function\n * @name ng.$compile\n * @function\n *\n * @description\n * Compiles a piece of 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#methods_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 * <pre>\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 * replace: false,\n * transclude: false,\n * restrict: 'A',\n * scope: false,\n * controller: function($scope, $element, $attrs, $transclude, otherInjectables) { ... },\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 * </pre>\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 * <pre>\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 * </pre>\n *\n *\n *\n * ### Directive Definition Object\n *\n * The directive definition object provides instructions to the {@link api/ng.$compile\n * compiler}. The attributes are:\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).\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.\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 and 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 *\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 * The scope can be overridden by an optional first argument.\n * `function([scope], cloneLinkingFn)`.\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's parents. Throw an error if not found.\n * * `?^` - Attempt to locate the required controller by searching the element's parents or pass `null` to the\n * `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 default (attributes only) is used.\n *\n * * `E` - Element name: `<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 * #### `template`\n * replace the current element with the contents of the HTML. The replacement process\n * migrates all of the attributes / classes from the old element to the new one. See the\n * {@link guide/directive#creating-custom-directives_creating-directives_template-expanding-directive\n * Directives Guide} for an example.\n *\n * You can specify `template` as a string representing the template or as a function which takes\n * two arguments `tElement` and `tAttrs` (described in the `compile` function api below) and\n * returns a string value representing the template.\n *\n *\n * #### `templateUrl`\n * Same as `template` but the template is loaded from the specified URL. Because\n * the template loading is asynchronous the compilation/linking is suspended until the template\n * is loaded.\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 * api/ng.$sce#methods_getTrustedResourceUrl $sce.getTrustedResourceUrl}.\n *\n *\n * #### `replace`\n * specify where the template should be inserted. Defaults to `false`.\n *\n * * `true` - the template will replace the current element.\n * * `false` - the template will replace the contents of the current element.\n *\n *\n * #### `transclude`\n * compile the content of the element and make it available to the directive.\n * Typically used with {@link api/ng.directive:ngTransclude\n * ngTransclude}. The advantage of transclusion is that the linking function receives a\n * transclusion function which is pre-bound to the correct scope. In a typical setup the widget\n * creates an `isolate` scope, but the transclusion is not a child, but a sibling of the `isolate`\n * scope. This makes it possible for the widget to have private state, and the transclusion to\n * be bound to the parent (pre-`isolate`) scope.\n *\n * * `true` - transclude the content of the directive.\n * * `'element'` - transclude the whole element including any directives defined at lower priority.\n *\n *\n * #### `compile`\n *\n * <pre>\n * function compile(tElement, tAttrs, transclude) { ... }\n * </pre>\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. Examples that require compile functions are\n * directives that transform template DOM, such as {@link\n * api/ng.directive:ngRepeat ngRepeat}, or load the contents\n * asynchronously, such as {@link api/ngRoute.directive:ngView ngView}. The\n * 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-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 * <pre>\n * function link(scope, iElement, iAttrs, controller, transcludeFn) { ... }\n * </pre>\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 api/ng.$rootScope.Scope Scope} - The scope to be used by the\n * directive for registering {@link api/ng.$rootScope.Scope#methods_$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 * The scope can be overridden by an optional first argument. This is the same as the `$transclude`\n * parameter of directive controllers.\n * `function([scope], cloneLinkingFn)`.\n *\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. It is safe to do DOM transformation in the post-linking function.\n *\n * <a name=\"Attributes\"></a>\n * ### Attributes\n *\n * The {@link api/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 * <pre>\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 * </pre>\n *\n * Below is an example using `$compileProvider`.\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 <doc:example module=\"compile\">\n <doc:source>\n <script>\n angular.module('compile', [], 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\n function Ctrl($scope) {\n $scope.name = 'Angular';\n $scope.html = 'Hello {{name}}';\n }\n </script>\n <div ng-controller=\"Ctrl\">\n <input ng-model=\"name\"> <br>\n <textarea ng-model=\"html\"></textarea> <br>\n <div compile=\"html\"></div>\n </div>\n </doc:source>\n <doc:scenario>\n it('should auto compile', function() {\n expect(element('div[compile]').text()).toBe('Hello Angular');\n input('html').enter('{{name}}!');\n expect(element('div[compile]').text()).toBe('Angular!');\n });\n </doc:scenario>\n </doc: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.\n * @param {number} maxPriority only apply directives lower then given priority (Only effects the\n * root element(s), not their children)\n * @returns {function(scope[, cloneAttachFn])} 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 * 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 * <pre>\n * var element = $compile('<p>{{total}}</p>')(scope);\n * </pre>\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 * <pre>\n * var templateHTML = angular.element('<p>{{total}}</p>'),\n * scope = ....;\n *\n * var clonedElement = $compile(templateHTML)(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 `clone`\n * </pre>\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 service\n * @name ng.$compileProvider\n * @function\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*([\\d\\w\\-_]+)\\s+(.*)$/,\n CLASS_DIRECTIVE_REGEXP = /(([\\d\\w\\-_]+)(?:\\:([^;]+))?;?)/;\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 /**\n * @ngdoc function\n * @name ng.$compileProvider#directive\n * @methodOf ng.$compileProvider\n * @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 || 'A';\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 function\n * @name ng.$compileProvider#aHrefSanitizationWhitelist\n * @methodOf ng.$compileProvider\n * @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 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 $$sanitizeUriProvider.aHrefSanitizationWhitelist(regexp);\n return this;\n } else {\n return $$sanitizeUriProvider.aHrefSanitizationWhitelist();\n }\n };\n\n\n /**\n * @ngdoc function\n * @name ng.$compileProvider#imgSrcSanitizationWhitelist\n * @methodOf ng.$compileProvider\n * @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 this.$get = [\n '$injector', '$interpolate', '$exceptionHandler', '$http', '$templateCache', '$parse',\n '$controller', '$rootScope', '$document', '$sce', '$animate', '$$sanitizeUri',\n function($injector, $interpolate, $exceptionHandler, $http, $templateCache, $parse,\n $controller, $rootScope, $document, $sce, $animate, $$sanitizeUri) {\n\n var Attributes = function(element, attr) {\n this.$$element = element;\n this.$attr = attr || {};\n };\n\n Attributes.prototype = {\n $normalize: directiveNormalize,\n\n\n /**\n * @ngdoc function\n * @name ng.$compile.directive.Attributes#$addClass\n * @methodOf ng.$compile.directive.Attributes\n * @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 function\n * @name ng.$compile.directive.Attributes#$removeClass\n * @methodOf ng.$compile.directive.Attributes\n * @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 function\n * @name ng.$compile.directive.Attributes#$updateClass\n * @methodOf ng.$compile.directive.Attributes\n * @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 this.$removeClass(tokenDifference(oldClasses, newClasses));\n this.$addClass(tokenDifference(newClasses, oldClasses));\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 booleanKey = getBooleanAttrName(this.$$element[0], key),\n normalizedVal,\n nodeName;\n\n if (booleanKey) {\n this.$$element.prop(key, value);\n attrName = booleanKey;\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 // sanitize a[href] and img[src] values\n if ((nodeName === 'A' && key === 'href') ||\n (nodeName === 'IMG' && key === 'src')) {\n this[key] = value = $$sanitizeUri(value, key === 'src');\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[key], function(fn) {\n try {\n fn(value);\n } catch (e) {\n $exceptionHandler(e);\n }\n });\n },\n\n\n /**\n * @ngdoc function\n * @name ng.$compile.directive.Attributes#$observe\n * @methodOf ng.$compile.directive.Attributes\n * @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#Attributes Directives} guide for more info.\n * @returns {function()} the `fn` parameter.\n */\n $observe: function(key, fn) {\n var attrs = this,\n $$observers = (attrs.$$observers || (attrs.$$observers = {})),\n listeners = ($$observers[key] || ($$observers[key] = []));\n\n listeners.push(fn);\n $rootScope.$evalAsync(function() {\n if (!listeners.$$inter) {\n // no one registered attribute interpolation function, so lets call it manually\n fn(attrs[key]);\n }\n });\n return fn;\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\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 == 3 /* text node */ && node.nodeValue.match(/\\S+/) /* non-empty */ ) {\n $compileNodes[index] = node = jqLite(node).wrap('<span></span>').parent()[0];\n }\n });\n var compositeLinkFn =\n compileNodes($compileNodes, transcludeFn, $compileNodes,\n maxPriority, ignoreDirective, previousCompileContext);\n return function publicLinkFn(scope, cloneConnectFn, transcludeControllers){\n assertArg(scope, 'scope');\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 var $linkNode = cloneConnectFn\n ? JQLitePrototype.clone.call($compileNodes) // IMPORTANT!!!\n : $compileNodes;\n\n forEach(transcludeControllers, function(instance, name) {\n $linkNode.data('$' + name + 'Controller', instance);\n });\n\n // Attach scope only to non-text nodes.\n for(var i = 0, ii = $linkNode.length; i<ii; i++) {\n var node = $linkNode[i];\n if (node.nodeType == 1 /* element */ || node.nodeType == 9 /* document */) {\n $linkNode.eq(i).data('$scope', scope);\n }\n }\n safeAddClass($linkNode, 'ng-scope');\n if (cloneConnectFn) cloneConnectFn($linkNode, scope);\n if (compositeLinkFn) compositeLinkFn(scope, $linkNode, $linkNode);\n return $linkNode;\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 * 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=} 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 nodeLinkFn, childLinkFn, directives, attrs, linkFnFound;\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 childLinkFn = (nodeLinkFn && nodeLinkFn.terminal ||\n !nodeList[i].childNodes ||\n !nodeList[i].childNodes.length)\n ? null\n : compileNodes(nodeList[i].childNodes,\n nodeLinkFn ? nodeLinkFn.transclude : transcludeFn);\n\n linkFns.push(nodeLinkFn);\n linkFns.push(childLinkFn);\n linkFnFound = (linkFnFound || nodeLinkFn || childLinkFn);\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, boundTranscludeFn) {\n var nodeLinkFn, childLinkFn, node, $node, childScope, childTranscludeFn, i, ii, n;\n\n // copy nodeList so that linking doesn't break due to live list updates.\n var stableNodeList = [];\n for (i = 0, ii = nodeList.length; i < ii; i++) {\n stableNodeList.push(nodeList[i]);\n }\n\n for(i = 0, n = 0, ii = linkFns.length; i < ii; n++) {\n node = stableNodeList[n];\n nodeLinkFn = linkFns[i++];\n childLinkFn = linkFns[i++];\n $node = jqLite(node);\n\n if (nodeLinkFn) {\n if (nodeLinkFn.scope) {\n childScope = scope.$new();\n $node.data('$scope', childScope);\n safeAddClass($node, 'ng-scope');\n } else {\n childScope = scope;\n }\n childTranscludeFn = nodeLinkFn.transclude;\n if (childTranscludeFn || (!boundTranscludeFn && transcludeFn)) {\n nodeLinkFn(childLinkFn, childScope, node, $rootElement,\n createBoundTranscludeFn(scope, childTranscludeFn || transcludeFn)\n );\n } else {\n nodeLinkFn(childLinkFn, childScope, node, $rootElement, boundTranscludeFn);\n }\n } else if (childLinkFn) {\n childLinkFn(scope, node.childNodes, undefined, boundTranscludeFn);\n }\n }\n }\n }\n\n function createBoundTranscludeFn(scope, transcludeFn) {\n return function boundTranscludeFn(transcludedScope, cloneFn, controllers) {\n var scopeCreated = false;\n\n if (!transcludedScope) {\n transcludedScope = scope.$new();\n transcludedScope.$$transcluded = true;\n scopeCreated = true;\n }\n\n var clone = transcludeFn(transcludedScope, cloneFn, controllers);\n if (scopeCreated) {\n clone.on('$destroy', bind(transcludedScope, transcludedScope.$destroy));\n }\n return clone;\n };\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 1: /* Element */\n // use the node name: <directive>\n addDirective(directives,\n directiveNormalize(nodeName_(node).toLowerCase()), 'E', maxPriority, ignoreDirective);\n\n // iterate over the attributes\n for (var attr, name, nName, ngAttrName, value, 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 if (!msie || msie >= 8 || attr.specified) {\n name = attr.name;\n // support ngAttr attribute binding\n ngAttrName = directiveNormalize(name);\n if (NG_ATTR_BINDING.test(ngAttrName)) {\n name = snake_case(ngAttrName.substr(6), '-');\n }\n\n var directiveNName = ngAttrName.replace(/(Start|End)$/, '');\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 nName = directiveNormalize(name.toLowerCase());\n attrsMap[nName] = name;\n attrs[nName] = value = trim((msie && name == 'href')\n ? decodeURIComponent(node.getAttribute(name, 2))\n : attr.value);\n if (getBooleanAttrName(node, nName)) {\n attrs[nName] = true; // presence means true\n }\n addAttrInterpolateDirective(node, directives, value, nName);\n addDirective(directives, nName, 'A', maxPriority, ignoreDirective, attrStartName,\n attrEndName);\n }\n }\n\n // use class as directive\n className = node.className;\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 3: /* Text Node */\n addTextInterpolateDirective(directives, node.nodeValue);\n break;\n case 8: /* 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 var startNode = node;\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 == 1 /** 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 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 newIsolateScopeDirective = previousCompileContext.newIsolateScopeDirective,\n templateDirective = previousCompileContext.templateDirective,\n nonTlbTranscludeDirective = previousCompileContext.nonTlbTranscludeDirective,\n hasTranscludeDirective = false,\n hasElementTranscludeDirective = false,\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 newScopeDirective = newScopeDirective || directive;\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 assertNoDuplicate('new/isolated scope', newIsolateScopeDirective, directive,\n $compileNode);\n if (isObject(directiveValue)) {\n newIsolateScopeDirective = directive;\n }\n }\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 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 = groupScan(compileNode, attrStart, attrEnd);\n $compileNode = templateAttrs.$$element =\n jqLite(document.createComment(' ' + directiveName + ': ' +\n templateAttrs[directiveName] + ' '));\n compileNode = $compileNode[0];\n replaceWith(jqCollection, jqLite(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 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 $template = jqLite('<div>' +\n trim(directiveValue) +\n '</div>').contents();\n compileNode = $template[0];\n\n if ($template.length != 1 || compileNode.nodeType !== 1) {\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 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, 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.transclude = hasTranscludeDirective && childTranscludeFn;\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 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 if (newIsolateScopeDirective === directive || directive.$$isolateScope) {\n post = cloneAndAnnotateFn(post, {isolateScope: true});\n }\n postLinkFns.push(post);\n }\n }\n\n\n function getControllers(require, $element, elementControllers) {\n var value, retrievalMethod = 'data', optional = false;\n if (isString(require)) {\n while((value = require.charAt(0)) == '^' || value == '?') {\n require = require.substr(1);\n if (value == '^') {\n retrievalMethod = 'inheritedData';\n }\n optional = optional || value == '?';\n }\n value = null;\n\n if (elementControllers && retrievalMethod === 'data') {\n value = elementControllers[require];\n }\n value = value || $element[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;\n } else if (isArray(require)) {\n value = [];\n forEach(require, function(require) {\n value.push(getControllers(require, $element, elementControllers));\n });\n }\n return value;\n }\n\n\n function nodeLinkFn(childLinkFn, scope, linkNode, $rootElement, boundTranscludeFn) {\n var attrs, $element, i, ii, linkFn, controller, isolateScope, elementControllers = {}, transcludeFn;\n\n if (compileNode === linkNode) {\n attrs = templateAttrs;\n } else {\n attrs = shallowCopy(templateAttrs, new Attributes(jqLite(linkNode), templateAttrs.$attr));\n }\n $element = attrs.$$element;\n\n if (newIsolateScopeDirective) {\n var LOCAL_REGEXP = /^\\s*([@=&])(\\??)\\s*(\\w*)\\s*$/;\n var $linkNode = jqLite(linkNode);\n\n isolateScope = scope.$new(true);\n\n if (templateDirective && (templateDirective === newIsolateScopeDirective.$$originalDirective)) {\n $linkNode.data('$isolateScope', isolateScope) ;\n } else {\n $linkNode.data('$isolateScopeNoTemplate', isolateScope);\n }\n\n\n\n safeAddClass($linkNode, 'ng-isolate-scope');\n\n forEach(newIsolateScopeDirective.scope, function(definition, scopeName) {\n var match = definition.match(LOCAL_REGEXP) || [],\n attrName = match[3] || scopeName,\n optional = (match[2] == '?'),\n mode = match[1], // @, =, or &\n lastValue,\n parentGet, parentSet, compare;\n\n isolateScope.$$isolateBindings[scopeName] = mode + attrName;\n\n switch (mode) {\n\n case '@':\n attrs.$observe(attrName, function(value) {\n isolateScope[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 isolateScope[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; };\n }\n parentSet = parentGet.assign || function() {\n // reset the change, or we will throw this exception on every $digest\n lastValue = isolateScope[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 = isolateScope[scopeName] = parentGet(scope);\n isolateScope.$watch(function parentValueWatch() {\n var parentValue = parentGet(scope);\n if (!compare(parentValue, isolateScope[scopeName])) {\n // we are out of sync and need to copy\n if (!compare(parentValue, lastValue)) {\n // parent changed and it has precedence\n isolateScope[scopeName] = parentValue;\n } else {\n // if the parent can be assigned then do so\n parentSet(scope, parentValue = isolateScope[scopeName]);\n }\n }\n return lastValue = parentValue;\n }, null, parentGet.literal);\n break;\n\n case '&':\n parentGet = $parse(attrs[attrName]);\n isolateScope[scopeName] = function(locals) {\n return parentGet(scope, locals);\n };\n break;\n\n default:\n throw $compileMinErr('iscp',\n \"Invalid isolate scope definition for directive '{0}'.\" +\n \" Definition: {... {1}: '{2}' ...}\",\n newIsolateScopeDirective.name, scopeName, definition);\n }\n });\n }\n transcludeFn = boundTranscludeFn && controllersBoundTransclude;\n if (controllerDirectives) {\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);\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);\n }\n\n if (directive.controllerAs) {\n locals.$scope[directive.controllerAs] = controllerInstance;\n }\n });\n }\n\n // PRELINKING\n for(i = 0, ii = preLinkFns.length; i < ii; i++) {\n try {\n linkFn = preLinkFns[i];\n linkFn(linkFn.isolateScope ? isolateScope : scope, $element, attrs,\n linkFn.require && getControllers(linkFn.require, $element, elementControllers), transcludeFn);\n } catch (e) {\n $exceptionHandler(e, startingTag($element));\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 try {\n linkFn = postLinkFns[i];\n linkFn(linkFn.isolateScope ? isolateScope : scope, $element, attrs,\n linkFn.require && getControllers(linkFn.require, $element, elementControllers), transcludeFn);\n } catch (e) {\n $exceptionHandler(e, startingTag($element));\n }\n }\n\n // This is the function that is injected as `$transclude`.\n function controllersBoundTransclude(scope, cloneAttachFn) {\n var transcludeControllers;\n\n // no scope passed\n if (arguments.length < 2) {\n cloneAttachFn = scope;\n scope = undefined;\n }\n\n if (hasElementTranscludeDirective) {\n transcludeControllers = elementControllers;\n }\n\n return boundTranscludeFn(scope, cloneAttachFn, transcludeControllers);\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 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 * 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]) {\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 // The fact that we have to copy and patch the directive seems wrong!\n derivedSyncDirective = extend({}, 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\n $compileNode.empty();\n\n $http.get($sce.getTrustedResourceUrl(templateUrl), {cache: $templateCache}).\n success(function(content) {\n var compileNode, tempTemplateAttrs, $template, childBoundTranscludeFn;\n\n content = denormalizeTemplate(content);\n\n if (origAsyncDirective.replace) {\n $template = jqLite('<div>' + trim(content) + '</div>').contents();\n compileNode = $template[0];\n\n if ($template.length != 1 || compileNode.nodeType !== 1) {\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\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 (beforeTemplateLinkNode !== beforeTemplateCompileNode) {\n // it was cloned therefore we have to clone as well.\n linkNode = jqLiteClone(compileNode);\n replaceWith(linkRootElement, jqLite(beforeTemplateLinkNode), linkNode);\n }\n if (afterTemplateNodeLinkFn.transclude) {\n childBoundTranscludeFn = createBoundTranscludeFn(scope, afterTemplateNodeLinkFn.transclude);\n } else {\n childBoundTranscludeFn = boundTranscludeFn;\n }\n afterTemplateNodeLinkFn(afterTemplateChildLinkFn, scope, linkNode, $rootElement,\n childBoundTranscludeFn);\n }\n linkQueue = null;\n }).\n error(function(response, code, headers, config) {\n throw $compileMinErr('tpload', 'Failed to load template: {0}', config.url);\n });\n\n return function delayedNodeLinkFn(ignoreChildLinkFn, scope, node, rootElement, boundTranscludeFn) {\n if (linkQueue) {\n linkQueue.push(scope);\n linkQueue.push(node);\n linkQueue.push(rootElement);\n linkQueue.push(boundTranscludeFn);\n } else {\n afterTemplateNodeLinkFn(afterTemplateChildLinkFn, scope, node, rootElement, boundTranscludeFn);\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: valueFn(function textInterpolateLinkFn(scope, node) {\n var parent = node.parent(),\n bindings = parent.data('$binding') || [];\n bindings.push(interpolateFn);\n safeAddClass(parent.data('$binding', bindings), 'ng-binding');\n scope.$watch(interpolateFn, function interpolateFnWatchAction(value) {\n node[0].nodeValue = value;\n });\n })\n });\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) {\n var interpolateFn = $interpolate(value, true);\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 // we need to interpolate again, in case the attribute value has been updated\n // (e.g. by another directive's compile function)\n interpolateFn = $interpolate(attr[name], true, getTrustedContext(node, name));\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 // TODO(i): this should likely be attr.$set(name, iterpolateFn(scope) so that we reset the\n // actual attr value\n attr[name] = interpolateFn(scope);\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 break;\n }\n }\n }\n\n if (parent) {\n parent.replaceChild(newNode, firstElementToRemove);\n }\n var fragment = document.createDocumentFragment();\n fragment.appendChild(firstElementToRemove);\n newNode[jqLite.expando] = firstElementToRemove[jqLite.expando];\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\nvar PREFIX_REGEXP = /^(x[\\:\\-_]|data[\\:\\-_])/i;\n/**\n * Converts all accepted directives format into proper directive name.\n * All of these will become 'myDirective':\n * my:Directive\n * my-directive\n * x-my-directive\n * data-my:directive\n *\n * Also there is special case for Moz prefix starting with upper case letter.\n * @param name Name to normalize\n */\nfunction directiveNormalize(name) {\n return camelCase(name.replace(PREFIX_REGEXP, ''));\n}\n\n/**\n * @ngdoc object\n * @name ng.$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 * <span ng:bind=\"a\" ng-bind=\"a\" data-ng-bind=\"a\" x-ng-bind=\"a\">\n */\n\n/**\n * @ngdoc property\n * @name ng.$compile.directive.Attributes#$attr\n * @propertyOf ng.$compile.directive.Attributes\n * @returns {object} 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 function\n * @name ng.$compile.directive.Attributes#$set\n * @methodOf ng.$compile.directive.Attributes\n * @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 * revers 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\n/**\n * @ngdoc object\n * @name ng.$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#methods_register register} method.\n */\nfunction $ControllerProvider() {\n var controllers = {},\n CNTRL_REG = /^(\\S+)(\\s+as\\s+(\\w+))?$/;\n\n\n /**\n * @ngdoc function\n * @name ng.$controllerProvider#register\n * @methodOf ng.$controllerProvider\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 this.$get = ['$injector', '$window', function($injector, $window) {\n\n /**\n * @ngdoc function\n * @name ng.$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 * * check `window[constructor]` on the global `window` object\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 {@link https://gist.github.com/1649788\n * BC version}.\n */\n return function(expression, locals) {\n var instance, match, constructor, identifier;\n\n if(isString(expression)) {\n match = expression.match(CNTRL_REG),\n constructor = match[1],\n identifier = match[3];\n expression = controllers.hasOwnProperty(constructor)\n ? controllers[constructor]\n : getter(locals.$scope, constructor, true) || getter($window, constructor, true);\n\n assertArgFn(expression, constructor, true);\n }\n\n instance = $injector.instantiate(expression, locals);\n\n if (identifier) {\n if (!(locals && typeof locals.$scope == 'object')) {\n throw minErr('$controller')('noscp',\n \"Cannot export controller '{0}' as '{1}'! No $scope object provided via `locals`.\",\n constructor || expression.name, identifier);\n }\n\n locals.$scope[identifier] = instance;\n }\n\n return instance;\n };\n }];\n}\n\n/**\n * @ngdoc object\n * @name ng.$document\n * @requires $window\n *\n * @description\n * A {@link angular.element jQuery (lite)}-wrapped reference to the browser's `window.document`\n * element.\n */\nfunction $DocumentProvider(){\n this.$get = ['$window', function(window){\n return jqLite(window.document);\n }];\n}\n\n/**\n * @ngdoc function\n * @name ng.$exceptionHandler\n * @requires $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 * <pre>\n * angular.module('exceptionOverride', []).factory('$exceptionHandler', function () {\n * return function (exception, cause) {\n * exception.message += ' (caused by \"' + cause + '\")';\n * throw exception;\n * };\n * });\n * </pre>\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 * @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\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 = {}, 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 if (parsed[key]) {\n parsed[key] += ', ' + val;\n } else {\n parsed[key] = val;\n }\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 return headersObj[lowercase(name)] || null;\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 {(function|Array.<function>)} fns Function or an array of functions.\n * @returns {*} Transformed data.\n */\nfunction transformData(data, headers, fns) {\n if (isFunction(fns))\n return fns(data, headers);\n\n forEach(fns, function(fn) {\n data = fn(data, headers);\n });\n\n return data;\n}\n\n\nfunction isSuccess(status) {\n return 200 <= status && status < 300;\n}\n\n\nfunction $HttpProvider() {\n var JSON_START = /^\\s*(\\[|\\{[^\\{])/,\n JSON_END = /[\\}\\]]\\s*$/,\n PROTECTION_PREFIX = /^\\)\\]\\}',?\\n/,\n CONTENT_TYPE_APPLICATION_JSON = {'Content-Type': 'application/json;charset=utf-8'};\n\n var defaults = this.defaults = {\n // transform incoming response data\n transformResponse: [function(data) {\n if (isString(data)) {\n // strip json vulnerability protection prefix\n data = data.replace(PROTECTION_PREFIX, '');\n if (JSON_START.test(data) && JSON_END.test(data))\n data = fromJson(data);\n }\n return data;\n }],\n\n // transform outgoing request data\n transformRequest: [function(d) {\n return isObject(d) && !isFile(d) ? toJson(d) : d;\n }],\n\n // default headers\n headers: {\n common: {\n 'Accept': 'application/json, text/plain, */*'\n },\n post: CONTENT_TYPE_APPLICATION_JSON,\n put: CONTENT_TYPE_APPLICATION_JSON,\n patch: CONTENT_TYPE_APPLICATION_JSON\n },\n\n xsrfCookieName: 'XSRF-TOKEN',\n xsrfHeaderName: 'X-XSRF-TOKEN'\n };\n\n /**\n * 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 var interceptorFactories = this.interceptors = [];\n\n /**\n * For historical reasons, response interceptors are ordered by the order in which\n * they are applied to the response. (This is the opposite of interceptorFactories)\n */\n var responseInterceptorFactories = this.responseInterceptors = [];\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 forEach(responseInterceptorFactories, function(interceptorFactory, index) {\n var responseFn = isString(interceptorFactory)\n ? $injector.get(interceptorFactory)\n : $injector.invoke(interceptorFactory);\n\n /**\n * Response interceptors go before \"around\" interceptors (no real reason, just\n * had to pick one.) But they are already reversed, so we can't use unshift, hence\n * the splice.\n */\n reversedInterceptors.splice(index, 0, {\n response: function(response) {\n return responseFn($q.when(response));\n },\n responseError: function(response) {\n return responseFn($q.reject(response));\n }\n });\n });\n\n\n /**\n * @ngdoc function\n * @name ng.$http\n * @requires $httpBackend\n * @requires $browser\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 {@link https://developer.mozilla.org/en/xmlhttprequest\n * XMLHttpRequest} object or via {@link http://en.wikipedia.org/wiki/JSONP 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 * <pre>\n * $http({method: 'GET', url: '/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 * </pre>\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 * # Calling $http from outside AngularJS\n * The `$http` service will not actually send the request until the next `$digest()` is\n * executed. Normally this is not an issue, since almost all the time your call to `$http` will\n * be from within a `$apply()` block.\n * If you are calling `$http` from outside Angular, then you should wrap it in a call to\n * `$apply` to cause a $digest to occur and also to handle errors in the block correctly.\n *\n * ```\n * $scope.$apply(function() {\n * $http(...);\n * });\n * ```\n *\n * # Writing Unit Tests that use $http\n * When unit testing you are mostly responsible for scheduling the `$digest` cycle. If you do\n * not trigger a `$digest` before calling `$httpBackend.flush()` then the request will not have\n * been made and `$httpBackend.expect(...)` expectations will fail. The solution is to run the\n * code that calls the `$http()` method inside a $apply block as explained in the previous\n * section.\n *\n * ```\n * $httpBackend.expectGET(...);\n * $scope.$apply(function() {\n * $http.get(...);\n * });\n * $httpBackend.flush();\n * ```\n *\n * # Shortcut methods\n *\n * Since all invocations of the $http service require passing in an HTTP method and URL, and\n * POST/PUT requests require request data to be provided as well, shortcut methods\n * were created:\n *\n * <pre>\n * $http.get('/someUrl').success(successCallback);\n * $http.post('/someUrl', data).success(successCallback);\n * </pre>\n *\n * Complete list of shortcut methods:\n *\n * - {@link ng.$http#methods_get $http.get}\n * - {@link ng.$http#methods_head $http.head}\n * - {@link ng.$http#methods_post $http.post}\n * - {@link ng.$http#methods_put $http.put}\n * - {@link ng.$http#methods_delete $http.delete}\n * - {@link ng.$http#methods_jsonp $http.jsonp}\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. 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 *\n * # Transforming Requests and Responses\n *\n * Both requests and responses can be transformed using transform functions. By default, Angular\n * applies these transformations:\n *\n * Request transformations:\n *\n * - If the `data` property of the request configuration object contains an object, serialize it\n * into JSON format.\n *\n * Response transformations:\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 * To globally augment or override the default transforms, modify the\n * `$httpProvider.defaults.transformRequest` and `$httpProvider.defaults.transformResponse`\n * properties. These properties are by default an array of transform functions, which allows you\n * to `push` or `unshift` a new transformation function into the transformation chain. You can\n * also decide to completely override any default transformations by assigning your\n * transformation functions to these properties directly without the array wrapper.\n *\n * Similarly, to locally override the request/response transforms, augment the\n * `transformRequest` and/or `transformResponse` properties of the configuration object passed\n * into `$http`.\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#properties_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 http `config` object. The function is free to\n * modify the `config` or create a new one. The function needs to return the `config`\n * directly or as a promise.\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` or create a new one. The function needs to return the `response`\n * directly or as a promise.\n * * `responseError`: interceptor gets called when a previous interceptor threw an error or\n * resolved with a rejection.\n *\n *\n * <pre>\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 || $q.when(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 || $q.when(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 * // 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 * 'response': function(response) {\n * // same as above\n * }\n * };\n * });\n * </pre>\n *\n * # Response interceptors (DEPRECATED)\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 preprocessing of received responses, it is desirable to be able to intercept\n * responses for http requests before they are handed over to the application code that\n * initiated these requests. The response interceptors leverage the {@link ng.$q\n * promise apis} to fulfil this need for both synchronous and asynchronous preprocessing.\n *\n * The interceptors are service factories that are registered with the $httpProvider by\n * adding them to the `$httpProvider.responseInterceptors` array. The factory is called and\n * injected with dependencies (if specified) and returns the interceptor — a function that\n * takes a {@link ng.$q promise} and returns the original or a new promise.\n *\n * <pre>\n * // register the interceptor as a service\n * $provide.factory('myHttpInterceptor', function($q, dependency1, dependency2) {\n * return function(promise) {\n * return promise.then(function(response) {\n * // do something on success\n * return response;\n * }, function(response) {\n * // do something on error\n * if (canRecover(response)) {\n * return responseOrNewPromise\n * }\n * return $q.reject(response);\n * });\n * }\n * });\n *\n * $httpProvider.responseInterceptors.push('myHttpInterceptor');\n *\n *\n * // register the interceptor via an anonymous factory\n * $httpProvider.responseInterceptors.push(function($q, dependency1, dependency2) {\n * return function(promise) {\n * // same as above\n * }\n * });\n * </pre>\n *\n *\n * # Security Considerations\n *\n * When designing web applications, consider security threats from:\n *\n * - {@link http://haacked.com/archive/2008/11/20/anatomy-of-a-subtle-json-vulnerability.aspx\n * JSON vulnerability}\n * - {@link http://en.wikipedia.org/wiki/Cross-site_request_forgery XSRF}\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 {@link http://haacked.com/archive/2008/11/20/anatomy-of-a-subtle-json-vulnerability.aspx\n * JSON vulnerability} allows third party website to turn your JSON resource URL into\n * {@link http://en.wikipedia.org/wiki/JSONP 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 * <pre>\n * ['one','two']\n * </pre>\n *\n * which is vulnerable to attack, your server can return:\n * <pre>\n * )]}',\n * ['one','two']\n * </pre>\n *\n * Angular will strip the prefix, before processing the JSON.\n *\n *\n * ## Cross Site Request Forgery (XSRF) Protection\n *\n * {@link http://en.wikipedia.org/wiki/Cross-site_request_forgery XSRF} 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 {@link https://en.wikipedia.org/wiki/Salt_(cryptography) salt}\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, 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 * - **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 * - **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 to set the `withCredentials` flag on the\n * XHR object. See {@link https://developer.mozilla.org/en/http_access_control#section_5\n * requests with credentials} for more information.\n * - **responseType** - `{string}` - see {@link\n * https://developer.mozilla.org/en-US/docs/DOM/XMLHttpRequest#responseType requestType}.\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 *\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>\n<file name=\"index.html\">\n <div ng-controller=\"FetchCtrl\">\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 ng-click=\"fetch()\">fetch</button><br>\n <button ng-click=\"updateModel('GET', 'http-hello.html')\">Sample GET</button>\n <button\n ng-click=\"updateModel('JSONP',\n 'http://angularjs.org/greet.php?callback=JSON_CALLBACK&name=Super%20Hero')\">\n Sample JSONP\n </button>\n <button\n ng-click=\"updateModel('JSONP', 'http://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 function FetchCtrl($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=\"scenario.js\">\n it('should make an xhr GET request', function() {\n element(':button:contains(\"Sample GET\")').click();\n element(':button:contains(\"fetch\")').click();\n expect(binding('status')).toBe('200');\n expect(binding('data')).toMatch(/Hello, \\$http!/);\n });\n\n it('should make a JSONP request to angularjs.org', function() {\n element(':button:contains(\"Sample JSONP\")').click();\n element(':button:contains(\"fetch\")').click();\n expect(binding('status')).toBe('200');\n expect(binding('data')).toMatch(/Super Hero!/);\n });\n\n it('should make JSONP request to invalid URL and invoke the error handler',\n function() {\n element(':button:contains(\"Invalid JSONP\")').click();\n element(':button:contains(\"fetch\")').click();\n expect(binding('status')).toBe('0');\n expect(binding('data')).toBe('Request failed');\n });\n</file>\n</example>\n */\n function $http(requestConfig) {\n var config = {\n transformRequest: defaults.transformRequest,\n transformResponse: defaults.transformResponse\n };\n var headers = mergeHeaders(requestConfig);\n\n extend(config, requestConfig);\n config.headers = headers;\n config.method = uppercase(config.method);\n\n var xsrfValue = urlIsSameOrigin(config.url)\n ? $browser.cookies()[config.xsrfCookieName || defaults.xsrfCookieName]\n : undefined;\n if (xsrfValue) {\n headers[(config.xsrfHeaderName || defaults.xsrfHeaderName)] = xsrfValue;\n }\n\n\n var serverRequest = function(config) {\n headers = config.headers;\n var reqData = transformData(config.data, headersGetter(headers), config.transformRequest);\n\n // strip content-type if data is undefined\n if (isUndefined(config.data)) {\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, headers).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 data: transformData(response.data, response.headers, config.transformResponse)\n });\n return (isSuccess(response.status))\n ? resp\n : $q.reject(resp);\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 // execute if header value is function\n execHeaders(defHeaders);\n execHeaders(reqHeaders);\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 return reqHeaders;\n\n function execHeaders(headers) {\n var headerContent;\n\n forEach(headers, function(headerFn, header) {\n if (isFunction(headerFn)) {\n headerContent = headerFn();\n if (headerContent != null) {\n headers[header] = headerContent;\n } else {\n delete headers[header];\n }\n }\n });\n }\n }\n }\n\n $http.pendingRequests = [];\n\n /**\n * @ngdoc method\n * @name ng.$http#get\n * @methodOf ng.$http\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 ng.$http#delete\n * @methodOf ng.$http\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 ng.$http#head\n * @methodOf ng.$http\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 ng.$http#jsonp\n * @methodOf ng.$http\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 * Should contain `JSON_CALLBACK` string.\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 ng.$http#post\n * @methodOf ng.$http\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 ng.$http#put\n * @methodOf ng.$http\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 createShortMethodsWithData('post', 'put');\n\n /**\n * @ngdoc property\n * @name ng.$http#defaults\n * @propertyOf ng.$http\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, reqHeaders) {\n var deferred = $q.defer(),\n promise = deferred.promise,\n cache,\n cachedResp,\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 && config.method == 'GET') {\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 (cachedResp.then) {\n // cached request has already been sent, but there is no response yet\n cachedResp.then(removePendingReq, removePendingReq);\n return cachedResp;\n } else {\n // serving from cache\n if (isArray(cachedResp)) {\n resolvePromise(cachedResp[1], cachedResp[0], copy(cachedResp[2]));\n } else {\n resolvePromise(cachedResp, 200, {});\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 // if we won't have the response in cache, send the request to the backend\n if (isUndefined(cachedResp)) {\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) {\n if (cache) {\n if (isSuccess(status)) {\n cache.put(url, [status, response, parseHeaders(headersString)]);\n } else {\n // remove promise from the cache\n cache.remove(url);\n }\n }\n\n resolvePromise(response, status, headersString);\n if (!$rootScope.$$phase) $rootScope.$apply();\n }\n\n\n /**\n * Resolves the raw $http promise.\n */\n function resolvePromise(response, status, headers) {\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 });\n }\n\n\n function removePendingReq() {\n var idx = indexOf($http.pendingRequests, 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 v = toJson(v);\n }\n parts.push(encodeUriQuery(key) + '=' +\n encodeUriQuery(v));\n });\n });\n return url + ((url.indexOf('?') == -1) ? '?' : '&') + parts.join('&');\n }\n\n\n }];\n}\n\nvar XHR = window.XMLHttpRequest || function() {\n /* global ActiveXObject */\n try { return new ActiveXObject(\"Msxml2.XMLHTTP.6.0\"); } catch (e1) {}\n try { return new ActiveXObject(\"Msxml2.XMLHTTP.3.0\"); } catch (e2) {}\n try { return new ActiveXObject(\"Msxml2.XMLHTTP\"); } catch (e3) {}\n throw minErr('$httpBackend')('noxhr', \"This browser does not support XMLHttpRequest.\");\n};\n\n\n/**\n * @ngdoc object\n * @name ng.$httpBackend\n * @requires $browser\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, XHR, $browser.defer, $window.angular.callbacks, $document[0]);\n }];\n}\n\nfunction createHttpBackend($browser, XHR, $browserDefer, callbacks, rawDocument) {\n var ABORTED = -1;\n\n // TODO(vojta): fix the signature\n return function(method, url, post, callback, headers, timeout, withCredentials, responseType) {\n var status;\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 };\n\n var jsonpDone = jsonpReq(url.replace('JSON_CALLBACK', 'angular.callbacks.' + callbackId),\n function() {\n if (callbacks[callbackId].data) {\n completeRequest(callback, 200, callbacks[callbackId].data);\n } else {\n completeRequest(callback, status || -2);\n }\n delete callbacks[callbackId];\n });\n } else {\n var xhr = new XHR();\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 // In IE6 and 7, this might be called synchronously when xhr.send below is called and the\n // response is in the cache. the promise api will ensure that to the app code the api is\n // always async\n xhr.onreadystatechange = function() {\n if (xhr.readyState == 4) {\n var responseHeaders = null,\n response = null;\n\n if(status !== ABORTED) {\n responseHeaders = xhr.getAllResponseHeaders();\n response = xhr.responseType ? xhr.response : xhr.responseText;\n }\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 completeRequest(callback,\n status || xhr.status,\n response,\n responseHeaders);\n }\n };\n\n if (withCredentials) {\n xhr.withCredentials = true;\n }\n\n if (responseType) {\n xhr.responseType = responseType;\n }\n\n xhr.send(post || null);\n }\n\n if (timeout > 0) {\n var timeoutId = $browserDefer(timeoutRequest, timeout);\n } else if (timeout && timeout.then) {\n timeout.then(timeoutRequest);\n }\n\n\n function timeoutRequest() {\n status = ABORTED;\n jsonpDone && jsonpDone();\n xhr && xhr.abort();\n }\n\n function completeRequest(callback, status, response, headersString) {\n var protocol = urlResolve(url).protocol;\n\n // cancel timeout and subsequent timeout promise resolution\n timeoutId && $browserDefer.cancel(timeoutId);\n jsonpDone = xhr = null;\n\n // fix status code for file protocol (it's always 0)\n status = (protocol == 'file' && status === 0) ? (response ? 200 : 404) : status;\n\n // normalize IE bug (http://bugs.jquery.com/ticket/1450)\n status = status == 1223 ? 204 : status;\n\n callback(status, response, headersString);\n $browser.$$completeOutstandingRequest(noop);\n }\n };\n\n function jsonpReq(url, 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'),\n doneWrapper = function() {\n script.onreadystatechange = script.onload = script.onerror = null;\n rawDocument.body.removeChild(script);\n if (done) done();\n };\n\n script.type = 'text/javascript';\n script.src = url;\n\n if (msie && msie <= 8) {\n script.onreadystatechange = function() {\n if (/loaded|complete/.test(script.readyState)) {\n doneWrapper();\n }\n };\n } else {\n script.onload = script.onerror = function() {\n doneWrapper();\n };\n }\n\n rawDocument.body.appendChild(script);\n return doneWrapper;\n }\n}\n\nvar $interpolateMinErr = minErr('$interpolate');\n\n/**\n * @ngdoc object\n * @name ng.$interpolateProvider\n * @function\n *\n * @description\n *\n * Used for configuring the interpolation markup. Defaults to `{{` and `}}`.\n *\n * @example\n<doc:example module=\"customInterpolationApp\">\n<doc:source>\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 DemoController() {\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</doc:source>\n<doc:scenario>\n it('should interpolate binding with custom symbols', function() {\n expect(binding('demo.label')).toBe('This binding is brought you by // interpolation symbols.');\n });\n</doc:scenario>\n</doc:example>\n */\nfunction $InterpolateProvider() {\n var startSymbol = '{{';\n var endSymbol = '}}';\n\n /**\n * @ngdoc method\n * @name ng.$interpolateProvider#startSymbol\n * @methodOf ng.$interpolateProvider\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 ng.$interpolateProvider#endSymbol\n * @methodOf ng.$interpolateProvider\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\n /**\n * @ngdoc function\n * @name ng.$interpolate\n * @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 <pre>\n var $interpolate = ...; // injected\n var exp = $interpolate('Hello {{name | uppercase}}!');\n expect(exp({name:'Angular'}).toEqual('Hello ANGULAR!');\n </pre>\n *\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#methods_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 * @returns {function(context)} an interpolation function which is used to compute the\n * interpolated string. The function has these parameters:\n *\n * * `context`: an object against which any expressions embedded in the strings are evaluated\n * against.\n *\n */\n function $interpolate(text, mustHaveExpression, trustedContext) {\n var startIndex,\n endIndex,\n index = 0,\n parts = [],\n length = text.length,\n hasInterpolation = false,\n fn,\n exp,\n concat = [];\n\n while(index < length) {\n if ( ((startIndex = text.indexOf(startSymbol, index)) != -1) &&\n ((endIndex = text.indexOf(endSymbol, startIndex + startSymbolLength)) != -1) ) {\n (index != startIndex) && parts.push(text.substring(index, startIndex));\n parts.push(fn = $parse(exp = text.substring(startIndex + startSymbolLength, endIndex)));\n fn.exp = exp;\n index = endIndex + endSymbolLength;\n hasInterpolation = true;\n } else {\n // we did not find anything, so we have to add the remainder to the parts array\n (index != length) && parts.push(text.substring(index));\n index = length;\n }\n }\n\n if (!(length = parts.length)) {\n // we added, nothing, must have been an empty string.\n parts.push('');\n length = 1;\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 && parts.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 || hasInterpolation) {\n concat.length = length;\n fn = function(context) {\n try {\n for(var i = 0, ii = length, part; i<ii; i++) {\n if (typeof (part = parts[i]) == 'function') {\n part = part(context);\n if (trustedContext) {\n part = $sce.getTrusted(trustedContext, part);\n } else {\n part = $sce.valueOf(part);\n }\n if (part === null || isUndefined(part)) {\n part = '';\n } else if (typeof part != 'string') {\n part = toJson(part);\n }\n }\n concat[i] = part;\n }\n return concat.join('');\n }\n catch(err) {\n var newErr = $interpolateMinErr('interr', \"Can't interpolate: {0}\\n{1}\", text,\n err.toString());\n $exceptionHandler(newErr);\n }\n };\n fn.exp = text;\n fn.parts = parts;\n return fn;\n }\n }\n\n\n /**\n * @ngdoc method\n * @name ng.$interpolate#startSymbol\n * @methodOf ng.$interpolate\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 ng.$interpolate#endSymbol\n * @methodOf ng.$interpolate\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} start 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',\n function($rootScope, $window, $q) {\n var intervals = {};\n\n\n /**\n * @ngdoc function\n * @name ng.$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#methods_flush `$interval.flush(millis)`} to\n * move forward by `millis` milliseconds and trigger any functions scheduled to run in that\n * time.\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#methods_$apply $apply} block.\n * @returns {promise} A promise which will be notified on each iteration.\n */\n function interval(fn, delay, count, invokeApply) {\n var setInterval = $window.setInterval,\n clearInterval = $window.clearInterval,\n deferred = $q.defer(),\n promise = deferred.promise,\n iteration = 0,\n skipApply = (isDefined(invokeApply) && !invokeApply);\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 function\n * @name ng.$interval#cancel\n * @methodOf ng.$interval\n *\n * @description\n * Cancels a task associated with the `promise`.\n *\n * @param {number} 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 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 object\n * @name ng.$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, appBase) {\n var parsedUrl = urlResolve(absoluteUrl, appBase);\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, appBase) {\n var prefixed = (relativeUrl.charAt(0) !== '/');\n if (prefixed) {\n relativeUrl = '/' + relativeUrl;\n }\n var match = urlResolve(relativeUrl, appBase);\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\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, appBase);\n\n\n /**\n * Parse given html5 (regular) url string into properties\n * @param {string} newAbsoluteUrl 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, appBase);\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.$$rewrite = function(url) {\n var appUrl, prevAppUrl;\n\n if ( (appUrl = beginsWith(appBase, url)) !== undefined ) {\n prevAppUrl = appUrl;\n if ( (appUrl = beginsWith(basePrefix, appUrl)) !== undefined ) {\n return appBaseNoFile + (beginsWith('/', appUrl) || appUrl);\n } else {\n return appBase + prevAppUrl;\n }\n } else if ( (appUrl = beginsWith(appBaseNoFile, url)) !== undefined ) {\n return appBaseNoFile + appUrl;\n } else if (appBaseNoFile == url + '/') {\n return appBaseNoFile;\n }\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, appBase);\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 = withoutBaseUrl.charAt(0) == '#'\n ? beginsWith(hashPrefix, withoutBaseUrl)\n : (this.$$html5)\n ? withoutBaseUrl\n : '';\n\n if (!isString(withoutHashUrl)) {\n throw $locationMinErr('ihshprfx', 'Invalid url \"{0}\", missing hash prefix \"{1}\".', url,\n hashPrefix);\n }\n parseAppUrl(withoutHashUrl, this, appBase);\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 = /^\\/?.*?:(\\/.*)/;\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 /*\n * The input URL intentionally contains a\n * first path segment that ends with a colon.\n */\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.$$rewrite = function(url) {\n if(stripHash(appBase) == stripHash(url)) {\n return url;\n }\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.$$rewrite = function(url) {\n var appUrl;\n\n if ( appBase == stripHash(url) ) {\n return url;\n } else if ( (appUrl = beginsWith(appBaseNoFile, url)) ) {\n return appBase + hashPrefix + appUrl;\n } else if ( appBaseNoFile === url + '/') {\n return appBaseNoFile;\n }\n };\n}\n\n\nLocationHashbangInHtml5Url.prototype =\n LocationHashbangUrl.prototype =\n LocationHtml5Url.prototype = {\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 ng.$location#absUrl\n * @methodOf ng.$location\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 * {@link http://www.ietf.org/rfc/rfc3986.txt RFC 3986}.\n *\n * @return {string} full url\n */\n absUrl: locationGetter('$$absUrl'),\n\n /**\n * @ngdoc method\n * @name ng.$location#url\n * @methodOf ng.$location\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 * @param {string=} url New url without base prefix (e.g. `/path?a=b#hash`)\n * @param {string=} replace The path that will be changed\n * @return {string} url\n */\n url: function(url, replace) {\n if (isUndefined(url))\n return this.$$url;\n\n var match = PATH_MATCH.exec(url);\n if (match[1]) this.path(decodeURIComponent(match[1]));\n if (match[2] || match[1]) this.search(match[3] || '');\n this.hash(match[5] || '', replace);\n\n return this;\n },\n\n /**\n * @ngdoc method\n * @name ng.$location#protocol\n * @methodOf ng.$location\n *\n * @description\n * This method is getter only.\n *\n * Return protocol of current url.\n *\n * @return {string} protocol of current url\n */\n protocol: locationGetter('$$protocol'),\n\n /**\n * @ngdoc method\n * @name ng.$location#host\n * @methodOf ng.$location\n *\n * @description\n * This method is getter only.\n *\n * Return host of current url.\n *\n * @return {string} host of current url.\n */\n host: locationGetter('$$host'),\n\n /**\n * @ngdoc method\n * @name ng.$location#port\n * @methodOf ng.$location\n *\n * @description\n * This method is getter only.\n *\n * Return port of current url.\n *\n * @return {Number} port\n */\n port: locationGetter('$$port'),\n\n /**\n * @ngdoc method\n * @name ng.$location#path\n * @methodOf ng.$location\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 * @param {string=} path New path\n * @return {string} path\n */\n path: locationGetterSetter('$$path', function(path) {\n return path.charAt(0) == '/' ? path : '/' + path;\n }),\n\n /**\n * @ngdoc method\n * @name ng.$location#search\n * @methodOf ng.$location\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 * @param {string|Object.<string>|Object.<Array.<string>>} search New search params - string or\n * hash object. Hash object may contain an array of values, which will be decoded as duplicates in\n * the url.\n *\n * @param {(string|Array<string>)=} paramValue If `search` is a string, then `paramValue` will override only a\n * single search parameter. If `paramValue` is an array, it will set the parameter as a\n * comma-separated value. If `paramValue` is `null`, the parameter will be deleted.\n *\n * @return {string} search\n */\n search: function(search, paramValue) {\n switch (arguments.length) {\n case 0:\n return this.$$search;\n case 1:\n if (isString(search)) {\n this.$$search = parseKeyValue(search);\n } else if (isObject(search)) {\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 ng.$location#hash\n * @methodOf ng.$location\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 * @param {string=} hash New hash fragment\n * @return {string} hash\n */\n hash: locationGetterSetter('$$hash', identity),\n\n /**\n * @ngdoc method\n * @name ng.$location#replace\n * @methodOf ng.$location\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\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 object\n * @name ng.$location\n *\n * @requires $browser\n * @requires $sniffer\n * @requires $rootElement\n *\n * @description\n * The $location service parses the URL in the browser address bar (based on the\n * {@link https://developer.mozilla.org/en/window.location 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/dev_guide.services.$location Developer Guide: Angular\n * Services: Using $location}\n */\n\n/**\n * @ngdoc object\n * @name ng.$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 = false;\n\n /**\n * @ngdoc property\n * @name ng.$locationProvider#hashPrefix\n * @methodOf ng.$locationProvider\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 property\n * @name ng.$locationProvider#html5Mode\n * @methodOf ng.$locationProvider\n * @description\n * @param {boolean=} mode Use HTML5 strategy if available.\n * @returns {*} current value if used as getter or itself (chaining) if used as setter\n */\n this.html5Mode = function(mode) {\n if (isDefined(mode)) {\n html5Mode = mode;\n return this;\n } else {\n return html5Mode;\n }\n };\n\n /**\n * @ngdoc event\n * @name ng.$location#$locationChangeStart\n * @eventOf ng.$location\n * @eventType broadcast on root scope\n * @description\n * Broadcasted before a URL will change. 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 * @param {Object} angularEvent Synthetic event object.\n * @param {string} newUrl New URL\n * @param {string=} oldUrl URL that was before it was changed.\n */\n\n /**\n * @ngdoc event\n * @name ng.$location#$locationChangeSuccess\n * @eventOf ng.$location\n * @eventType broadcast on root scope\n * @description\n * Broadcasted after a URL was changed.\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 */\n\n this.$get = ['$rootScope', '$browser', '$sniffer', '$rootElement',\n function( $rootScope, $browser, $sniffer, $rootElement) {\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) {\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.$$parse($location.$$rewrite(initialUrl));\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 (event.ctrlKey || event.metaKey || event.which == 2) return;\n\n var elm = jqLite(event.target);\n\n // traverse the DOM up to find first A tag\n while (lowercase(elm[0].nodeName) !== '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 var rewrittenUrl = $location.$$rewrite(absHref);\n\n if (absHref && !elm.attr('target') && rewrittenUrl && !event.isDefaultPrevented()) {\n event.preventDefault();\n if (rewrittenUrl != $browser.url()) {\n // update location manually\n $location.$$parse(rewrittenUrl);\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 // rewrite hashbang url <> html5 url\n if ($location.absUrl() != initialUrl) {\n $browser.url($location.absUrl(), true);\n }\n\n // update $location when $browser url changes\n $browser.onUrlChange(function(newUrl) {\n if ($location.absUrl() != newUrl) {\n if ($rootScope.$broadcast('$locationChangeStart', newUrl,\n $location.absUrl()).defaultPrevented) {\n $browser.url($location.absUrl());\n return;\n }\n $rootScope.$evalAsync(function() {\n var oldUrl = $location.absUrl();\n\n $location.$$parse(newUrl);\n afterLocationChange(oldUrl);\n });\n if (!$rootScope.$$phase) $rootScope.$digest();\n }\n });\n\n // update browser\n var changeCounter = 0;\n $rootScope.$watch(function $locationWatch() {\n var oldUrl = $browser.url();\n var currentReplace = $location.$$replace;\n\n if (!changeCounter || oldUrl != $location.absUrl()) {\n changeCounter++;\n $rootScope.$evalAsync(function() {\n if ($rootScope.$broadcast('$locationChangeStart', $location.absUrl(), oldUrl).\n defaultPrevented) {\n $location.$$parse(oldUrl);\n } else {\n $browser.url($location.absUrl(), currentReplace);\n afterLocationChange(oldUrl);\n }\n });\n }\n $location.$$replace = false;\n\n return changeCounter;\n });\n\n return $location;\n\n function afterLocationChange(oldUrl) {\n $rootScope.$broadcast('$locationChangeSuccess', $location.absUrl(), oldUrl);\n }\n}];\n}\n\n/**\n * @ngdoc object\n * @name ng.$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>\n <file name=\"script.js\">\n function LogCtrl($scope, $log) {\n $scope.$log = $log;\n $scope.message = 'Hello World!';\n }\n </file>\n <file name=\"index.html\">\n <div ng-controller=\"LogCtrl\">\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 object\n * @name ng.$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 property\n * @name ng.$logProvider#debugEnabled\n * @methodOf ng.$logProvider\n * @description\n * @param {string=} 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 ng.$log#log\n * @methodOf ng.$log\n *\n * @description\n * Write a log message\n */\n log: consoleLog('log'),\n\n /**\n * @ngdoc method\n * @name ng.$log#info\n * @methodOf ng.$log\n *\n * @description\n * Write an information message\n */\n info: consoleLog('info'),\n\n /**\n * @ngdoc method\n * @name ng.$log#warn\n * @methodOf ng.$log\n *\n * @description\n * Write a warning message\n */\n warn: consoleLog('warn'),\n\n /**\n * @ngdoc method\n * @name ng.$log#error\n * @methodOf ng.$log\n *\n * @description\n * Write an error message\n */\n error: consoleLog('error'),\n \n /**\n * @ngdoc method\n * @name ng.$log#debug\n * @methodOf ng.$log\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\n if (logFn.apply) {\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');\nvar promiseWarningCache = {};\nvar promiseWarning;\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// We want to prevent this type of access. For the sake of performance, during the lexing phase we\n// disallow any \"dotted\" access to any member named \"constructor\".\n//\n// For reflective calls (a[b]) we check that the value of the lookup is not the Function constructor\n// while evaluating the expression, which is a stronger but more expensive test. Since reflective\n// calls are expensive anyway, this is not such a big deal compared to static dereferencing.\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// A developer could foil the name check by aliasing the Function constructor under a different\n// name on the scope.\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\nfunction ensureSafeMemberName(name, fullExpression) {\n if (name === \"constructor\") {\n throw $parseMinErr('isecfld',\n 'Referencing \"constructor\" field in Angular expressions is disallowed! Expression: {0}',\n 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.document && obj.location && obj.alert && obj.setInterval) {\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.on && obj.find))) {\n throw $parseMinErr('isecdom',\n 'Referencing DOM nodes in Angular expressions is disallowed! Expression: {0}',\n fullExpression);\n }\n }\n return obj;\n}\n\nvar OPERATORS = {\n /* jshint bitwise : false */\n 'null':function(){return null;},\n 'true':function(){return true;},\n 'false':function(){return false;},\n undefined:noop,\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 '=':noop,\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|b;},\n '|':function(self, locals, a,b){return b(self, locals)(self, locals, a(self, locals));},\n '!':function(self, locals, a){return !a(self, locals);}\n};\n/* jshint bitwise: true */\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\n this.index = 0;\n this.ch = undefined;\n this.lastCh = ':'; // can start regexp\n\n this.tokens = [];\n\n var token;\n var json = [];\n\n while (this.index < this.text.length) {\n this.ch = this.text.charAt(this.index);\n if (this.is('\"\\'')) {\n this.readString(this.ch);\n } else if (this.isNumber(this.ch) || this.is('.') && this.isNumber(this.peek())) {\n this.readNumber();\n } else if (this.isIdent(this.ch)) {\n this.readIdent();\n // identifiers can only be if the preceding char was a { or ,\n if (this.was('{,') && json[0] === '{' &&\n (token = this.tokens[this.tokens.length - 1])) {\n token.json = token.text.indexOf('.') === -1;\n }\n } else if (this.is('(){}[].,;:?')) {\n this.tokens.push({\n index: this.index,\n text: this.ch,\n json: (this.was(':[,') && this.is('{[')) || this.is('}]:,')\n });\n if (this.is('{[')) json.unshift(this.ch);\n if (this.is('}]')) json.shift();\n this.index++;\n } else if (this.isWhitespace(this.ch)) {\n this.index++;\n continue;\n } else {\n var ch2 = this.ch + this.peek();\n var ch3 = ch2 + this.peek(2);\n var fn = OPERATORS[this.ch];\n var fn2 = OPERATORS[ch2];\n var fn3 = OPERATORS[ch3];\n if (fn3) {\n this.tokens.push({index: this.index, text: ch3, fn: fn3});\n this.index += 3;\n } else if (fn2) {\n this.tokens.push({index: this.index, text: ch2, fn: fn2});\n this.index += 2;\n } else if (fn) {\n this.tokens.push({\n index: this.index,\n text: this.ch,\n fn: fn,\n json: (this.was('[,:') && this.is('+-'))\n });\n this.index += 1;\n } else {\n this.throwError('Unexpected next character ', this.index, this.index + 1);\n }\n }\n this.lastCh = this.ch;\n }\n return this.tokens;\n },\n\n is: function(chars) {\n return chars.indexOf(this.ch) !== -1;\n },\n\n was: function(chars) {\n return chars.indexOf(this.lastCh) !== -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');\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 number = 1 * number;\n this.tokens.push({\n index: start,\n text: number,\n json: true,\n fn: function() { return number; }\n });\n },\n\n readIdent: function() {\n var parser = this;\n\n var ident = '';\n var start = this.index;\n\n var lastDot, peekIndex, methodName, ch;\n\n while (this.index < this.text.length) {\n ch = this.text.charAt(this.index);\n if (ch === '.' || this.isIdent(ch) || this.isNumber(ch)) {\n if (ch === '.') lastDot = this.index;\n ident += ch;\n } else {\n break;\n }\n this.index++;\n }\n\n //check if this is not a method invocation and if it is back out to last dot\n if (lastDot) {\n peekIndex = this.index;\n while (peekIndex < this.text.length) {\n ch = this.text.charAt(peekIndex);\n if (ch === '(') {\n methodName = ident.substr(lastDot - start + 1);\n ident = ident.substr(0, lastDot - start);\n this.index = peekIndex;\n break;\n }\n if (this.isWhitespace(ch)) {\n peekIndex++;\n } else {\n break;\n }\n }\n }\n\n\n var token = {\n index: start,\n text: ident\n };\n\n // OPERATORS is our own object so we don't need to use special hasOwnPropertyFn\n if (OPERATORS.hasOwnProperty(ident)) {\n token.fn = OPERATORS[ident];\n token.json = OPERATORS[ident];\n } else {\n var getter = getterFn(ident, this.options, this.text);\n token.fn = extend(function(self, locals) {\n return (getter(self, locals));\n }, {\n assign: function(self, value) {\n return setter(self, ident, value, parser.text, parser.options);\n }\n });\n }\n\n this.tokens.push(token);\n\n if (methodName) {\n this.tokens.push({\n index:lastDot,\n text: '.',\n json: false\n });\n this.tokens.push({\n index: lastDot + 1,\n text: methodName,\n json: false\n });\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 if (rep) {\n string += rep;\n } else {\n string += ch;\n }\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 string: string,\n json: true,\n fn: function() { return string; }\n });\n return;\n } else {\n string += ch;\n }\n this.index++;\n }\n this.throwError('Unterminated quote', start);\n }\n};\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 = function () { return 0; };\n\nParser.prototype = {\n constructor: Parser,\n\n parse: function (text, json) {\n this.text = text;\n\n //TODO(i): strip all the obsolte json stuff from this file\n this.json = json;\n\n this.tokens = this.lexer.lex(text);\n\n if (json) {\n // The extra level of aliasing is here, just in case the lexer misses something, so that\n // we prevent any accidental execution in JSON.\n this.assignment = this.logicalOR;\n\n this.functionCall =\n this.fieldAccess =\n this.objectIndex =\n this.filterChain = function() {\n this.throwError('is not valid json', {text: text, index: 0});\n };\n }\n\n var value = json ? this.primary() : 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 {\n var token = this.expect();\n primary = token.fn;\n if (!primary) {\n this.throwError('not a primary expression', token);\n }\n if (token.json) {\n primary.constant = true;\n primary.literal = true;\n }\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 if (this.tokens.length > 0) {\n var token = this.tokens[0];\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 if (this.json && !token.json) {\n this.throwError('is not valid json', token);\n }\n this.tokens.shift();\n return token;\n }\n return false;\n },\n\n consume: function(e1){\n if (!this.expect(e1)) {\n this.throwError('is unexpected, expecting [' + e1 + ']', this.peek());\n }\n },\n\n unaryFn: function(fn, right) {\n return extend(function(self, locals) {\n return fn(self, locals, right);\n }, {\n constant:right.constant\n });\n },\n\n ternaryFn: function(left, middle, right){\n return extend(function(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 binaryFn: function(left, fn, right) {\n return extend(function(self, locals) {\n return fn(self, locals, left, right);\n }, {\n constant:left.constant && right.constant\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(self, locals) {\n var value;\n for (var i = 0; i < statements.length; i++) {\n var statement = statements[i];\n if (statement) {\n value = statement(self, locals);\n }\n }\n return value;\n };\n }\n }\n },\n\n filterChain: function() {\n var left = this.expression();\n var token;\n while (true) {\n if ((token = this.expect('|'))) {\n left = this.binaryFn(left, token.fn, this.filter());\n } else {\n return left;\n }\n }\n },\n\n filter: function() {\n var token = this.expect();\n var fn = this.$filter(token.text);\n var argsFn = [];\n while (true) {\n if ((token = this.expect(':'))) {\n argsFn.push(this.expression());\n } else {\n var fnInvoke = function(self, locals, input) {\n var args = [input];\n for (var i = 0; i < argsFn.length; i++) {\n args.push(argsFn[i](self, locals));\n }\n return fn.apply(self, args);\n };\n return function() {\n return fnInvoke;\n };\n }\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 function(scope, locals) {\n return left.assign(scope, right(scope, locals), locals);\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.ternary();\n if ((token = this.expect(':'))) {\n return this.ternaryFn(left, middle, this.ternary());\n } else {\n this.throwError('expected :', token);\n }\n } else {\n return left;\n }\n },\n\n logicalOR: function() {\n var left = this.logicalAND();\n var token;\n while (true) {\n if ((token = this.expect('||'))) {\n left = this.binaryFn(left, token.fn, this.logicalAND());\n } else {\n return left;\n }\n }\n },\n\n logicalAND: function() {\n var left = this.equality();\n var token;\n if ((token = this.expect('&&'))) {\n left = this.binaryFn(left, token.fn, this.logicalAND());\n }\n return left;\n },\n\n equality: function() {\n var left = this.relational();\n var token;\n if ((token = this.expect('==','!=','===','!=='))) {\n left = this.binaryFn(left, token.fn, this.equality());\n }\n return left;\n },\n\n relational: function() {\n var left = this.additive();\n var token;\n if ((token = this.expect('<', '>', '<=', '>='))) {\n left = this.binaryFn(left, token.fn, this.relational());\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.fn, 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.fn, 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.fn, this.unary());\n } else if ((token = this.expect('!'))) {\n return this.unaryFn(token.fn, this.unary());\n } else {\n return this.primary();\n }\n },\n\n fieldAccess: function(object) {\n var parser = this;\n var field = this.expect().text;\n var getter = getterFn(field, this.options, this.text);\n\n return extend(function(scope, locals, self) {\n return getter(self || object(scope, locals), locals);\n }, {\n assign: function(scope, value, locals) {\n return setter(object(scope, locals), field, value, parser.text, parser.options);\n }\n });\n },\n\n objectIndex: function(obj) {\n var parser = this;\n\n var indexFn = this.expression();\n this.consume(']');\n\n return extend(function(self, locals) {\n var o = obj(self, locals),\n i = indexFn(self, locals),\n v, p;\n\n if (!o) return undefined;\n v = ensureSafeObject(o[i], parser.text);\n if (v && v.then && parser.options.unwrapPromises) {\n p = v;\n if (!('$$v' in v)) {\n p.$$v = undefined;\n p.then(function(val) { p.$$v = val; });\n }\n v = v.$$v;\n }\n return v;\n }, {\n assign: function(self, value, locals) {\n var key = indexFn(self, locals);\n // prevent overwriting of Function.constructor which would break ensureSafeObject check\n var safe = ensureSafeObject(obj(self, locals), parser.text);\n return safe[key] = value;\n }\n });\n },\n\n functionCall: function(fn, 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 parser = this;\n\n return function(scope, locals) {\n var args = [];\n var context = contextGetter ? contextGetter(scope, locals) : scope;\n\n for (var i = 0; i < argsFn.length; i++) {\n args.push(argsFn[i](scope, locals));\n }\n var fnPtr = fn(scope, locals, context) || noop;\n\n ensureSafeObject(context, parser.text);\n ensureSafeObject(fnPtr, parser.text);\n\n // IE stupidity! (IE doesn't have apply for some native functions)\n var v = fnPtr.apply\n ? fnPtr.apply(context, args)\n : fnPtr(args[0], args[1], args[2], args[3], args[4]);\n\n return ensureSafeObject(v, parser.text);\n };\n },\n\n // This is used with json array declaration\n arrayDeclaration: function () {\n var elementFns = [];\n var allConstant = true;\n if (this.peekToken().text !== ']') {\n do {\n var elementFn = this.expression();\n elementFns.push(elementFn);\n if (!elementFn.constant) {\n allConstant = false;\n }\n } while (this.expect(','));\n }\n this.consume(']');\n\n return extend(function(self, locals) {\n var array = [];\n for (var i = 0; i < elementFns.length; i++) {\n array.push(elementFns[i](self, locals));\n }\n return array;\n }, {\n literal: true,\n constant: allConstant\n });\n },\n\n object: function () {\n var keyValues = [];\n var allConstant = true;\n if (this.peekToken().text !== '}') {\n do {\n var token = this.expect(),\n key = token.string || token.text;\n this.consume(':');\n var value = this.expression();\n keyValues.push({key: key, value: value});\n if (!value.constant) {\n allConstant = false;\n }\n } while (this.expect(','));\n }\n this.consume('}');\n\n return extend(function(self, locals) {\n var object = {};\n for (var i = 0; i < keyValues.length; i++) {\n var keyValue = keyValues[i];\n object[keyValue.key] = keyValue.value(self, locals);\n }\n return object;\n }, {\n literal: true,\n constant: allConstant\n });\n }\n};\n\n\n//////////////////////////////////////////////////\n// Parser helper functions\n//////////////////////////////////////////////////\n\nfunction setter(obj, path, setValue, fullExp, options) {\n //needed?\n options = options || {};\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 = obj[key];\n if (!propertyObj) {\n propertyObj = {};\n obj[key] = propertyObj;\n }\n obj = propertyObj;\n if (obj.then && options.unwrapPromises) {\n promiseWarning(fullExp);\n if (!(\"$$v\" in obj)) {\n (function(promise) {\n promise.then(function(val) { promise.$$v = val; }); }\n )(obj);\n }\n if (obj.$$v === undefined) {\n obj.$$v = {};\n }\n obj = obj.$$v;\n }\n }\n key = ensureSafeMemberName(element.shift(), fullExp);\n obj[key] = setValue;\n return setValue;\n}\n\nvar getterFnCache = {};\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, options) {\n ensureSafeMemberName(key0, fullExp);\n ensureSafeMemberName(key1, fullExp);\n ensureSafeMemberName(key2, fullExp);\n ensureSafeMemberName(key3, fullExp);\n ensureSafeMemberName(key4, fullExp);\n\n return !options.unwrapPromises\n ? function cspSafeGetter(scope, locals) {\n var pathVal = (locals && locals.hasOwnProperty(key0)) ? locals : scope;\n\n if (pathVal === null || pathVal === undefined) return pathVal;\n pathVal = pathVal[key0];\n\n if (!key1 || pathVal === null || pathVal === undefined) return pathVal;\n pathVal = pathVal[key1];\n\n if (!key2 || pathVal === null || pathVal === undefined) return pathVal;\n pathVal = pathVal[key2];\n\n if (!key3 || pathVal === null || pathVal === undefined) return pathVal;\n pathVal = pathVal[key3];\n\n if (!key4 || pathVal === null || pathVal === undefined) return pathVal;\n pathVal = pathVal[key4];\n\n return pathVal;\n }\n : function cspSafePromiseEnabledGetter(scope, locals) {\n var pathVal = (locals && locals.hasOwnProperty(key0)) ? locals : scope,\n promise;\n\n if (pathVal === null || pathVal === undefined) return pathVal;\n\n pathVal = pathVal[key0];\n if (pathVal && pathVal.then) {\n promiseWarning(fullExp);\n if (!(\"$$v\" in pathVal)) {\n promise = pathVal;\n promise.$$v = undefined;\n promise.then(function(val) { promise.$$v = val; });\n }\n pathVal = pathVal.$$v;\n }\n if (!key1 || pathVal === null || pathVal === undefined) return pathVal;\n\n pathVal = pathVal[key1];\n if (pathVal && pathVal.then) {\n promiseWarning(fullExp);\n if (!(\"$$v\" in pathVal)) {\n promise = pathVal;\n promise.$$v = undefined;\n promise.then(function(val) { promise.$$v = val; });\n }\n pathVal = pathVal.$$v;\n }\n if (!key2 || pathVal === null || pathVal === undefined) return pathVal;\n\n pathVal = pathVal[key2];\n if (pathVal && pathVal.then) {\n promiseWarning(fullExp);\n if (!(\"$$v\" in pathVal)) {\n promise = pathVal;\n promise.$$v = undefined;\n promise.then(function(val) { promise.$$v = val; });\n }\n pathVal = pathVal.$$v;\n }\n if (!key3 || pathVal === null || pathVal === undefined) return pathVal;\n\n pathVal = pathVal[key3];\n if (pathVal && pathVal.then) {\n promiseWarning(fullExp);\n if (!(\"$$v\" in pathVal)) {\n promise = pathVal;\n promise.$$v = undefined;\n promise.then(function(val) { promise.$$v = val; });\n }\n pathVal = pathVal.$$v;\n }\n if (!key4 || pathVal === null || pathVal === undefined) return pathVal;\n\n pathVal = pathVal[key4];\n if (pathVal && pathVal.then) {\n promiseWarning(fullExp);\n if (!(\"$$v\" in pathVal)) {\n promise = pathVal;\n promise.$$v = undefined;\n promise.then(function(val) { promise.$$v = val; });\n }\n pathVal = pathVal.$$v;\n }\n return pathVal;\n };\n}\n\nfunction getterFn(path, options, fullExp) {\n // Check whether the cache has this getter already.\n // We can use hasOwnProperty directly on the cache because we ensure,\n // see below, that the cache never stores a path called 'hasOwnProperty'\n if (getterFnCache.hasOwnProperty(path)) {\n return getterFnCache[path];\n }\n\n var pathKeys = path.split('.'),\n pathKeysLength = pathKeys.length,\n fn;\n\n if (options.csp) {\n if (pathKeysLength < 6) {\n fn = cspSafeGetterFn(pathKeys[0], pathKeys[1], pathKeys[2], pathKeys[3], pathKeys[4], fullExp,\n options);\n } else {\n fn = function(scope, locals) {\n var i = 0, val;\n do {\n val = cspSafeGetterFn(pathKeys[i++], pathKeys[i++], pathKeys[i++], pathKeys[i++],\n pathKeys[i++], fullExp, options)(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 = 'var l, fn, p;\\n';\n forEach(pathKeys, function(key, index) {\n ensureSafeMemberName(key, fullExp);\n code += 'if(s === null || s === undefined) return s;\\n' +\n 'l=s;\\n' +\n 's='+ (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 : '((k&&k.hasOwnProperty(\"' + key + '\"))?k:s)') + '[\"' + key + '\"]' + ';\\n' +\n (options.unwrapPromises\n ? 'if (s && s.then) {\\n' +\n ' pw(\"' + fullExp.replace(/([\"\\r\\n])/g, '\\\\$1') + '\");\\n' +\n ' if (!(\"$$v\" in s)) {\\n' +\n ' p=s;\\n' +\n ' p.$$v = undefined;\\n' +\n ' p.then(function(v) {p.$$v=v;});\\n' +\n '}\\n' +\n ' s=s.$$v\\n' +\n '}\\n'\n : '');\n });\n code += 'return s;';\n\n /* jshint -W054 */\n var evaledFnGetter = new Function('s', 'k', 'pw', code); // s=scope, k=locals, pw=promiseWarning\n /* jshint +W054 */\n evaledFnGetter.toString = function() { return code; };\n fn = function(scope, locals) {\n return evaledFnGetter(scope, locals, promiseWarning);\n };\n }\n\n // Only cache the value if it's not going to mess up the cache object\n // This is more performant that using Object.prototype.hasOwnProperty.call\n if (path !== 'hasOwnProperty') {\n getterFnCache[path] = fn;\n }\n return fn;\n}\n\n///////////////////////////////////\n\n/**\n * @ngdoc function\n * @name ng.$parse\n * @function\n *\n * @description\n *\n * Converts Angular {@link guide/expression expression} into a function.\n *\n * <pre>\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 * </pre>\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 object\n * @name ng.$parseProvider\n * @function\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 cache = {};\n\n var $parseOptions = {\n csp: false,\n unwrapPromises: false,\n logPromiseWarnings: true\n };\n\n\n /**\n * @deprecated Promise unwrapping via $parse is deprecated and will be removed in the future.\n *\n * @ngdoc method\n * @name ng.$parseProvider#unwrapPromises\n * @methodOf ng.$parseProvider\n * @description\n *\n * **This feature is deprecated, see deprecation notes below for more info**\n *\n * If set to true (default is false), $parse will unwrap promises automatically when a promise is\n * found at any part of the expression. In other words, if set to true, the expression will always\n * result in a non-promise value.\n *\n * While the promise is unresolved, it's treated as undefined, but once resolved and fulfilled,\n * the fulfillment value is used in place of the promise while evaluating the expression.\n *\n * **Deprecation notice**\n *\n * This is a feature that didn't prove to be wildly useful or popular, primarily because of the\n * dichotomy between data access in templates (accessed as raw values) and controller code\n * (accessed as promises).\n *\n * In most code we ended up resolving promises manually in controllers anyway and thus unifying\n * the model access there.\n *\n * Other downsides of automatic promise unwrapping:\n *\n * - when building components it's often desirable to receive the raw promises\n * - adds complexity and slows down expression evaluation\n * - makes expression code pre-generation unattractive due to the amount of code that needs to be\n * generated\n * - makes IDE auto-completion and tool support hard\n *\n * **Warning Logs**\n *\n * If the unwrapping is enabled, Angular will log a warning about each expression that unwraps a\n * promise (to reduce the noise, each expression is logged only once). To disable this logging use\n * `$parseProvider.logPromiseWarnings(false)` api.\n *\n *\n * @param {boolean=} value New value.\n * @returns {boolean|self} Returns the current setting when used as getter and self if used as\n * setter.\n */\n this.unwrapPromises = function(value) {\n if (isDefined(value)) {\n $parseOptions.unwrapPromises = !!value;\n return this;\n } else {\n return $parseOptions.unwrapPromises;\n }\n };\n\n\n /**\n * @deprecated Promise unwrapping via $parse is deprecated and will be removed in the future.\n *\n * @ngdoc method\n * @name ng.$parseProvider#logPromiseWarnings\n * @methodOf ng.$parseProvider\n * @description\n *\n * Controls whether Angular should log a warning on any encounter of a promise in an expression.\n *\n * The default is set to `true`.\n *\n * This setting applies only if `$parseProvider.unwrapPromises` setting is set to true as well.\n *\n * @param {boolean=} value New value.\n * @returns {boolean|self} Returns the current setting when used as getter and self if used as\n * setter.\n */\n this.logPromiseWarnings = function(value) {\n if (isDefined(value)) {\n $parseOptions.logPromiseWarnings = value;\n return this;\n } else {\n return $parseOptions.logPromiseWarnings;\n }\n };\n\n\n this.$get = ['$filter', '$sniffer', '$log', function($filter, $sniffer, $log) {\n $parseOptions.csp = $sniffer.csp;\n\n promiseWarning = function promiseWarningFn(fullExp) {\n if (!$parseOptions.logPromiseWarnings || promiseWarningCache.hasOwnProperty(fullExp)) return;\n promiseWarningCache[fullExp] = true;\n $log.warn('[$parse] Promise found in the expression `' + fullExp + '`. ' +\n 'Automatic unwrapping of promises in Angular expressions is deprecated.');\n };\n\n return function(exp) {\n var parsedExpression;\n\n switch (typeof exp) {\n case 'string':\n\n if (cache.hasOwnProperty(exp)) {\n return cache[exp];\n }\n\n var lexer = new Lexer($parseOptions);\n var parser = new Parser(lexer, $filter, $parseOptions);\n parsedExpression = parser.parse(exp, false);\n\n if (exp !== 'hasOwnProperty') {\n // Only cache the value if it's not going to mess up the cache object\n // This is more performant that using Object.prototype.hasOwnProperty.call\n cache[exp] = parsedExpression;\n }\n\n return parsedExpression;\n\n case 'function':\n return exp;\n\n default:\n return noop;\n }\n };\n }];\n}\n\n/**\n * @ngdoc service\n * @name ng.$q\n * @requires $rootScope\n *\n * @description\n * A promise/deferred implementation inspired by [Kris Kowal's Q](https://github.com/kriskowal/q).\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 * <pre>\n * // for the purpose of this example let's assume that variables `$q` and `scope` are\n * // 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 * // since this fn executes async in a future turn of the event loop, we need to wrap\n * // our code into an $apply call so that the model changes are properly observed.\n * scope.$apply(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 * });\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 * </pre>\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 *\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 promises 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 can not be resolved or rejected from the notifyCallback\n * method.\n *\n * - `catch(errorCallback)` – shorthand for `promise.then(null, errorCallback)`\n *\n * - `finally(callback)` – 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 * Because `finally` is a reserved word in JavaScript and reserved keywords are not supported as\n * property names by ES3, you'll need to invoke the method like `promise['finally'](callback)` to\n * make your code IE8 compatible.\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 * <pre>\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 * </pre>\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 * <pre>\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 * </pre>\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\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\n /**\n * @ngdoc\n * @name ng.$q#defer\n * @methodOf ng.$q\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 var pending = [],\n value, deferred;\n\n deferred = {\n\n resolve: function(val) {\n if (pending) {\n var callbacks = pending;\n pending = undefined;\n value = ref(val);\n\n if (callbacks.length) {\n nextTick(function() {\n var callback;\n for (var i = 0, ii = callbacks.length; i < ii; i++) {\n callback = callbacks[i];\n value.then(callback[0], callback[1], callback[2]);\n }\n });\n }\n }\n },\n\n\n reject: function(reason) {\n deferred.resolve(reject(reason));\n },\n\n\n notify: function(progress) {\n if (pending) {\n var callbacks = pending;\n\n if (pending.length) {\n nextTick(function() {\n var callback;\n for (var i = 0, ii = callbacks.length; i < ii; i++) {\n callback = callbacks[i];\n callback[2](progress);\n }\n });\n }\n }\n },\n\n\n promise: {\n then: function(callback, errback, progressback) {\n var result = defer();\n\n var wrappedCallback = function(value) {\n try {\n result.resolve((isFunction(callback) ? callback : defaultCallback)(value));\n } catch(e) {\n result.reject(e);\n exceptionHandler(e);\n }\n };\n\n var wrappedErrback = function(reason) {\n try {\n result.resolve((isFunction(errback) ? errback : defaultErrback)(reason));\n } catch(e) {\n result.reject(e);\n exceptionHandler(e);\n }\n };\n\n var wrappedProgressback = function(progress) {\n try {\n result.notify((isFunction(progressback) ? progressback : defaultCallback)(progress));\n } catch(e) {\n exceptionHandler(e);\n }\n };\n\n if (pending) {\n pending.push([wrappedCallback, wrappedErrback, wrappedProgressback]);\n } else {\n value.then(wrappedCallback, wrappedErrback, wrappedProgressback);\n }\n\n return result.promise;\n },\n\n \"catch\": function(callback) {\n return this.then(null, callback);\n },\n\n \"finally\": function(callback) {\n\n function makePromise(value, resolved) {\n var result = defer();\n if (resolved) {\n result.resolve(value);\n } else {\n result.reject(value);\n }\n return result.promise;\n }\n\n function handleCallback(value, isResolved) {\n var callbackOutput = null;\n try {\n callbackOutput = (callback ||defaultCallback)();\n } catch(e) {\n return makePromise(e, false);\n }\n if (callbackOutput && isFunction(callbackOutput.then)) {\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 return this.then(function(value) {\n return handleCallback(value, true);\n }, function(error) {\n return handleCallback(error, false);\n });\n }\n }\n };\n\n return deferred;\n };\n\n\n var ref = function(value) {\n if (value && isFunction(value.then)) return value;\n return {\n then: function(callback) {\n var result = defer();\n nextTick(function() {\n result.resolve(callback(value));\n });\n return result.promise;\n }\n };\n };\n\n\n /**\n * @ngdoc\n * @name ng.$q#reject\n * @methodOf ng.$q\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 * <pre>\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 * </pre>\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 return {\n then: function(callback, errback) {\n var result = defer();\n nextTick(function() {\n try {\n result.resolve((isFunction(errback) ? errback : defaultErrback)(reason));\n } catch(e) {\n result.reject(e);\n exceptionHandler(e);\n }\n });\n return result.promise;\n }\n };\n };\n\n\n /**\n * @ngdoc\n * @name ng.$q#when\n * @methodOf ng.$q\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 var when = function(value, callback, errback, progressback) {\n var result = defer(),\n done;\n\n var wrappedCallback = function(value) {\n try {\n return (isFunction(callback) ? callback : defaultCallback)(value);\n } catch (e) {\n exceptionHandler(e);\n return reject(e);\n }\n };\n\n var wrappedErrback = function(reason) {\n try {\n return (isFunction(errback) ? errback : defaultErrback)(reason);\n } catch (e) {\n exceptionHandler(e);\n return reject(e);\n }\n };\n\n var wrappedProgressback = function(progress) {\n try {\n return (isFunction(progressback) ? progressback : defaultCallback)(progress);\n } catch (e) {\n exceptionHandler(e);\n }\n };\n\n nextTick(function() {\n ref(value).then(function(value) {\n if (done) return;\n done = true;\n result.resolve(ref(value).then(wrappedCallback, wrappedErrback, wrappedProgressback));\n }, function(reason) {\n if (done) return;\n done = true;\n result.resolve(wrappedErrback(reason));\n }, function(progress) {\n if (done) return;\n result.notify(wrappedProgressback(progress));\n });\n });\n\n return result.promise;\n };\n\n\n function defaultCallback(value) {\n return value;\n }\n\n\n function defaultErrback(reason) {\n return reject(reason);\n }\n\n\n /**\n * @ngdoc\n * @name ng.$q#all\n * @methodOf ng.$q\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 function all(promises) {\n var deferred = defer(),\n counter = 0,\n results = isArray(promises) ? [] : {};\n\n forEach(promises, function(promise, key) {\n counter++;\n ref(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 return {\n defer: defer,\n reject: reject,\n when: when,\n all: all\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 (shift) 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 object\n * @name ng.$rootScopeProvider\n * @description\n *\n * Provider for the $rootScope service.\n */\n\n/**\n * @ngdoc function\n * @name ng.$rootScopeProvider#digestTtl\n * @methodOf ng.$rootScopeProvider\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 object\n * @name ng.$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\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 function\n * @name ng.$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#methods_$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 * <pre>\n * <file src=\"./test/ng/rootScopeSpec.js\" tag=\"docs1\" />\n * </pre>\n *\n * # Inheritance\n * A scope can inherit from a parent scope, as in this example:\n * <pre>\n var parent = $rootScope;\n var child = parent.$new();\n\n parent.salutation = \"Hello\";\n child.name = \"World\";\n expect(child.salutation).toEqual('Hello');\n\n child.salutation = \"Welcome\";\n expect(child.salutation).toEqual('Welcome');\n expect(parent.salutation).toEqual('Hello');\n * </pre>\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['this'] = this.$root = this;\n this.$$destroyed = false;\n this.$$asyncQueue = [];\n this.$$postDigestQueue = [];\n this.$$listeners = {};\n this.$$isolateBindings = {};\n }\n\n /**\n * @ngdoc property\n * @name ng.$rootScope.Scope#$id\n * @propertyOf ng.$rootScope.Scope\n * @returns {number} Unique scope ID (monotonically increasing alphanumeric sequence) useful for\n * debugging.\n */\n\n\n Scope.prototype = {\n constructor: Scope,\n /**\n * @ngdoc function\n * @name ng.$rootScope.Scope#$new\n * @methodOf ng.$rootScope.Scope\n * @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#methods_$digest $digest()} and\n * {@link ng.$rootScope.Scope#methods_$digest $digest()} events. The scope can be removed from the\n * scope hierarchy using {@link ng.$rootScope.Scope#methods_$destroy $destroy()}.\n *\n * {@link ng.$rootScope.Scope#methods_$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 * @returns {Object} The newly created child scope.\n *\n */\n $new: function(isolate) {\n var ChildScope,\n child;\n\n if (isolate) {\n child = new Scope();\n child.$root = this.$root;\n // ensure that there is just one async queue per $rootScope and its children\n child.$$asyncQueue = this.$$asyncQueue;\n child.$$postDigestQueue = this.$$postDigestQueue;\n } else {\n ChildScope = function() {}; // should be anonymous; This is so that when the minifier munges\n // the name it does not become random set of chars. This will then show up as class\n // name in the debugger.\n ChildScope.prototype = this;\n child = new ChildScope();\n child.$id = nextUid();\n }\n child['this'] = child;\n child.$$listeners = {};\n child.$parent = this;\n child.$$watchers = child.$$nextSibling = child.$$childHead = child.$$childTail = null;\n child.$$prevSibling = this.$$childTail;\n if (this.$$childHead) {\n this.$$childTail.$$nextSibling = child;\n this.$$childTail = child;\n } else {\n this.$$childHead = this.$$childTail = child;\n }\n return child;\n },\n\n /**\n * @ngdoc function\n * @name ng.$rootScope.Scope#$watch\n * @methodOf ng.$rootScope.Scope\n * @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#methods_$digest\n * $digest()} and should return the value that will be watched. (Since\n * {@link ng.$rootScope.Scope#methods_$digest $digest()} reruns when it detects changes the\n * `watchExpression` can execute multiple times per\n * {@link ng.$rootScope.Scope#methods_$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). The inequality is determined according to\n * {@link angular.equals} function. To save the value of the object for later comparison,\n * the {@link angular.copy} function is used. It also means that watching complex options\n * 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#methods_$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#methods_$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#methods_$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 * The example below contains an illustration of using a function as your $watch listener\n *\n *\n * # Example\n * <pre>\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 // no variable change\n expect(scope.counter).toEqual(0);\n\n scope.name = 'adam';\n scope.$digest();\n expect(scope.counter).toEqual(1);\n\n\n\n // Using a listener function\n var food;\n scope.foodCounter = 0;\n expect(scope.foodCounter).toEqual(0);\n scope.$watch(\n // This is the listener function\n function() { return food; },\n // This is the change handler\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 cout 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 * </pre>\n *\n *\n *\n * @param {(function()|string)} watchExpression Expression that is evaluated on each\n * {@link ng.$rootScope.Scope#methods_$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()|string)=} listener Callback called whenever the return value of\n * the `watchExpression` changes.\n *\n * - `string`: Evaluated as {@link guide/expression expression}\n * - `function(newValue, oldValue, scope)`: called with current and previous values as\n * parameters.\n *\n * @param {boolean=} objectEquality Compare object for equality rather than for reference.\n * @returns {function()} Returns a deregistration function for this listener.\n */\n $watch: function(watchExp, listener, objectEquality) {\n var scope = this,\n get = compileToFn(watchExp, 'watch'),\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 // in the case user pass string, we need to compile it, do we really need this ?\n if (!isFunction(listener)) {\n var listenFn = compileToFn(listener || noop, 'listener');\n watcher.fn = function(newVal, oldVal, scope) {listenFn(scope);};\n }\n\n if (typeof watchExp == 'string' && get.constant) {\n var originalFn = watcher.fn;\n watcher.fn = function(newVal, oldVal, scope) {\n originalFn.call(this, newVal, oldVal, scope);\n arrayRemove(array, watcher);\n };\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() {\n arrayRemove(array, watcher);\n };\n },\n\n\n /**\n * @ngdoc function\n * @name ng.$rootScope.Scope#$watchCollection\n * @methodOf ng.$rootScope.Scope\n * @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 * <pre>\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 * </pre>\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#methods_$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 that is\n * fired with both the `newCollection` and `oldCollection` as parameters.\n * The `newCollection` object is the newly modified data obtained from the `obj` expression\n * and the `oldCollection` object is a copy of the former collection data.\n * The `scope` 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 var self = this;\n var oldValue;\n var newValue;\n var changeDetected = 0;\n var objGetter = $parse(obj);\n var internalArray = [];\n var internalObject = {};\n var oldLength = 0;\n\n function $watchCollectionWatch() {\n newValue = objGetter(self);\n var newLength, key;\n\n if (!isObject(newValue)) {\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 if (oldValue[i] !== newValue[i]) {\n changeDetected++;\n oldValue[i] = newValue[i];\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 if (oldValue.hasOwnProperty(key)) {\n if (oldValue[key] !== newValue[key]) {\n changeDetected++;\n oldValue[key] = newValue[key];\n }\n } else {\n oldLength++;\n oldValue[key] = newValue[key];\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 (oldValue.hasOwnProperty(key) && !newValue.hasOwnProperty(key)) {\n oldLength--;\n delete oldValue[key];\n }\n }\n }\n }\n return changeDetected;\n }\n\n function $watchCollectionAction() {\n listener(newValue, oldValue, self);\n }\n\n return this.$watch($watchCollectionWatch, $watchCollectionAction);\n },\n\n /**\n * @ngdoc function\n * @name ng.$rootScope.Scope#$digest\n * @methodOf ng.$rootScope.Scope\n * @function\n *\n * @description\n * Processes all of the {@link ng.$rootScope.Scope#methods_$watch watchers} of the current scope and\n * its children. Because a {@link ng.$rootScope.Scope#methods_$watch watcher}'s listener can change\n * the model, the `$digest()` keeps calling the {@link ng.$rootScope.Scope#methods_$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#methods_directive directives}.\n * Instead, you should call {@link ng.$rootScope.Scope#methods_$apply $apply()} (typically from within\n * a {@link ng.$compileProvider#methods_directive directives}), 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#methods_$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 * <pre>\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 // no variable change\n expect(scope.counter).toEqual(0);\n\n scope.name = 'adam';\n scope.$digest();\n expect(scope.counter).toEqual(1);\n * </pre>\n *\n */\n $digest: function() {\n var watch, value, last,\n watchers,\n asyncQueue = this.$$asyncQueue,\n postDigestQueue = this.$$postDigestQueue,\n length,\n dirty, ttl = TTL,\n next, current, target = this,\n watchLog = [],\n logIdx, logMsg, asyncTask;\n\n beginPhase('$digest');\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);\n } catch (e) {\n clearPhase();\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) : 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 logMsg = (isFunction(watch.exp))\n ? 'fn: ' + (watch.exp.name || watch.exp.toString())\n : watch.exp;\n logMsg += '; newVal: ' + toJson(value) + '; oldVal: ' + toJson(last);\n watchLog[logIdx].push(logMsg);\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 clearPhase();\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 && !(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, toJson(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 ng.$rootScope.Scope#$destroy\n * @eventOf ng.$rootScope.Scope\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 function\n * @name ng.$rootScope.Scope#$destroy\n * @methodOf ng.$rootScope.Scope\n * @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#methods_$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 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 // This is bogus code that works around Chrome's GC leak\n // see: https://github.com/angular/angular.js/issues/1313#issuecomment-10378451\n this.$parent = this.$$nextSibling = this.$$prevSibling = this.$$childHead =\n this.$$childTail = null;\n },\n\n /**\n * @ngdoc function\n * @name ng.$rootScope.Scope#$eval\n * @methodOf ng.$rootScope.Scope\n * @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 * <pre>\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 * </pre>\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 function\n * @name ng.$rootScope.Scope#$evalAsync\n * @methodOf ng.$rootScope.Scope\n * @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#methods_$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 */\n $evalAsync: function(expr) {\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 && !$rootScope.$$asyncQueue.length) {\n $browser.defer(function() {\n if ($rootScope.$$asyncQueue.length) {\n $rootScope.$digest();\n }\n });\n }\n\n this.$$asyncQueue.push({scope: this, expression: expr});\n },\n\n $$postDigest : function(fn) {\n this.$$postDigestQueue.push(fn);\n },\n\n /**\n * @ngdoc function\n * @name ng.$rootScope.Scope#$apply\n * @methodOf ng.$rootScope.Scope\n * @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#methods_$digest executing watches}.\n *\n * ## Life cycle\n *\n * # Pseudo-Code of `$apply()`\n * <pre>\n function $apply(expr) {\n try {\n return $eval(expr);\n } catch (e) {\n $exceptionHandler(e);\n } finally {\n $root.$digest();\n }\n }\n * </pre>\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#methods_$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#methods_$watch watch} listeners are fired immediately after the\n * expression was executed using the {@link ng.$rootScope.Scope#methods_$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 function\n * @name ng.$rootScope.Scope#$on\n * @methodOf ng.$rootScope.Scope\n * @function\n *\n * @description\n * Listens on events of a given type. See {@link ng.$rootScope.Scope#methods_$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 current scope which is handling the event.\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 return function() {\n namedListeners[indexOf(namedListeners, listener)] = null;\n };\n },\n\n\n /**\n * @ngdoc function\n * @name ng.$rootScope.Scope#$emit\n * @methodOf ng.$rootScope.Scope\n * @function\n *\n * @description\n * Dispatches an event `name` upwards through the scope hierarchy notifying the\n * registered {@link ng.$rootScope.Scope#methods_$on} listeners.\n *\n * The event life cycle starts at the scope on which `$emit` was called. All\n * {@link ng.$rootScope.Scope#methods_$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#methods_$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 set of arguments which will be passed onto the event listeners.\n * @return {Object} Event object (see {@link ng.$rootScope.Scope#methods_$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) return event;\n //traverse upwards\n scope = scope.$parent;\n } while (scope);\n\n return event;\n },\n\n\n /**\n * @ngdoc function\n * @name ng.$rootScope.Scope#$broadcast\n * @methodOf ng.$rootScope.Scope\n * @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#methods_$on} listeners.\n *\n * The event life cycle starts at the scope on which `$broadcast` was called. All\n * {@link ng.$rootScope.Scope#methods_$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#methods_$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 set of arguments which will be passed onto the event listeners.\n * @return {Object} Event object, see {@link ng.$rootScope.Scope#methods_$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 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 do {\n 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 if (!(next = (current.$$childHead || (current !== target && current.$$nextSibling)))) {\n while(current !== target && !(next = current.$$nextSibling)) {\n current = current.$parent;\n }\n }\n } while ((current = next));\n\n return event;\n }\n };\n\n var $rootScope = new Scope();\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 function compileToFn(exp, name) {\n var fn = $parse(exp);\n assertArgFn(fn, name);\n return fn;\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}\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):|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 // NOTE: urlResolve() doesn't support IE < 8 so we don't sanitize for that case.\n if (!msie || msie >= 8 ) {\n normalizedVal = urlResolve(uri).href;\n if (normalizedVal !== '' && !normalizedVal.match(regex)) {\n return 'unsafe:'+normalizedVal;\n }\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\n// Copied from:\n// http://docs.closure-library.googlecode.com/git/closure_goog_string_string.js.source.html#line962\n// Prereq: s is a string.\nfunction escapeForRegexp(s) {\n return s.replace(/([-()\\[\\]{}+?*.$\\^|,:#<!\\\\])/g, '\\\\$1').\n replace(/\\x08/g, '\\\\x08');\n}\n\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 ng.$sceDelegate\n * @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#methods_resourceUrlWhitelist\n * $sceDelegateProvider.resourceUrlWhitelist} and {@link\n * ng.$sceDelegateProvider#methods_resourceUrlBlacklist $sceDelegateProvider.resourceUrlBlacklist}\n */\n\n/**\n * @ngdoc object\n * @name ng.$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#methods_resourceUrlWhitelist $sceDelegateProvider.resourceUrlWhitelist} and\n * {@link ng.$sceDelegateProvider#methods_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 * <pre class=\"prettyprint\">\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 * // The blacklist overrides the whitelist so the open redirect here is blocked.\n * $sceDelegateProvider.resourceUrlBlacklist([\n * 'http://myapp.example.com/clickThru**']);\n * });\n * </pre>\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 function\n * @name ng.sceDelegateProvider#resourceUrlWhitelist\n * @methodOf ng.$sceDelegateProvider\n * @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 function\n * @name ng.sceDelegateProvider#resourceUrlBlacklist\n * @methodOf ng.$sceDelegateProvider\n * @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 ng.$sceDelegate#trustAs\n * @methodOf ng.$sceDelegate\n *\n * @description\n * Returns an object that is trusted by angular for use in specified strict\n * contextual escaping contexts (such as ng-html-bind-unsafe, 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 ng.$sceDelegate#valueOf\n * @methodOf ng.$sceDelegate\n *\n * @description\n * If the passed parameter had been returned by a prior call to {@link ng.$sceDelegate#methods_trustAs\n * `$sceDelegate.trustAs`}, returns the value that had been passed to {@link\n * ng.$sceDelegate#methods_trustAs `$sceDelegate.trustAs`}.\n *\n * If the passed parameter is not a value that had been returned by {@link\n * ng.$sceDelegate#methods_trustAs `$sceDelegate.trustAs`}, returns it as-is.\n *\n * @param {*} value The result of a prior {@link ng.$sceDelegate#methods_trustAs `$sceDelegate.trustAs`}\n * call or anything else.\n * @returns {*} The value the was originally provided to {@link ng.$sceDelegate#methods_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 ng.$sceDelegate#getTrusted\n * @methodOf ng.$sceDelegate\n *\n * @description\n * Takes the result of a {@link ng.$sceDelegate#methods_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#methods_trustAs\n * `$sceDelegate.trustAs`} call.\n * @returns {*} The value the was originally provided to {@link ng.$sceDelegate#methods_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 object\n * @name ng.$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 ng.$sce\n * @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), IE8 in quirks mode is not supported. In this mode, IE8 allows\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 * <pre class=\"prettyprint\">\n * <input ng-model=\"userHtml\">\n * <div ng-bind-html=\"userHtml\">\n * </pre>\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#methods_trustAs $sce.trustAs} \n * (and shorthand methods such as {@link ng.$sce#methods_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#methods_getTrusted\n * $sce.getTrusted(context, value)} rather than to the value directly. Directives use {@link\n * ng.$sce#methods_parse $sce.parseAs} rather than `$parse` to watch attribute bindings, which performs the\n * {@link ng.$sce#methods_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#methods_parseAsHtml $sce.parseAsHtml(binding expression)}. Here's the actual code (slightly\n * simplified):\n *\n * <pre class=\"prettyprint\">\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 * </pre>\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#methods_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#methods_resourceUrlWhitelist whitelist\n * them} or {@link ng.$sce#methods_trustAsResourceUrl wrap it} into a trusted value.\n *\n * *Please note*:\n * The browser's\n * {@link https://code.google.com/p/browsersec/wiki/Part2#Same-origin_policy_for_XMLHttpRequest\n * Same Origin Policy} and {@link http://www.w3.org/TR/cors/ Cross-Origin Resource Sharing (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 for the developer?\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. (e.g.\n * `<div ng-html-bind-unsafe=\"'<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#methods_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#methods_resourceUrlWhitelist whitelists} and {@link\n * ng.$sceDelegateProvider#methods_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. |\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 consititute an SCE context. |\n * | `$sce.RESOURCE_URL` | For URLs that are not only safe to follow as links, but whose contens 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#methods_resourceUrlWhitelist resourceUrlWhitelist}/{@link ng.$sceDelegateProvider#methods_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 occurances 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 occurances 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.) It's 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\n<example module=\"mySceApp\">\n<file name=\"index.html\">\n <div ng-controller=\"myAppController 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 var mySceApp = angular.module('mySceApp', ['ngSanitize']);\n\n mySceApp.controller(\"myAppController\", function myAppController($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="Explicitly trusted HTML bypasses ' +\n 'sanitization."\">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=\"scenario.js\">\n describe('SCE doc demo', function() {\n it('should sanitize untrusted values', function() {\n expect(element('.htmlComment').html()).toBe('<span>Is <i>anyone</i> reading this?</span>');\n });\n it('should NOT sanitize explicitly trusted values', function() {\n expect(element('#explicitlyTrustedHtml').html()).toBe(\n '<span onmouseover=\"this.textContent="Explicitly trusted HTML bypasses ' +\n 'sanitization."\">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 * <pre class=\"prettyprint\">\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 * </pre>\n *\n */\n/* jshint maxlen: 100 */\n\nfunction $SceProvider() {\n var enabled = true;\n\n /**\n * @ngdoc function\n * @name ng.sceProvider#enabled\n * @methodOf ng.$sceProvider\n * @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', '$sniffer', '$sceDelegate', function(\n $parse, $sniffer, $sceDelegate) {\n // Prereq: Ensure that we're not running in IE8 quirks mode. In that mode, IE allows\n // the \"expression(javascript expression)\" syntax which is insecure.\n if (enabled && $sniffer.msie && $sniffer.msieDocumentMode < 8) {\n throw $sceMinErr('iequirks',\n 'Strict Contextual Escaping does not support Internet Explorer version < 9 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 = copy(SCE_CONTEXTS);\n\n /**\n * @ngdoc function\n * @name ng.sce#isEnabled\n * @methodOf ng.$sce\n * @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 ng.$sce#parse\n * @methodOf ng.$sce\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#methods_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 function sceParseAsTrusted(self, locals) {\n return sce.getTrusted(type, parsed(self, locals));\n };\n }\n };\n\n /**\n * @ngdoc method\n * @name ng.$sce#trustAs\n * @methodOf ng.$sce\n *\n * @description\n * Delegates to {@link ng.$sceDelegate#methods_trustAs `$sceDelegate.trustAs`}. As such,\n * returns an objectthat is trusted by angular for use in specified strict contextual\n * escaping contexts (such as ng-html-bind-unsafe, 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 ng.$sce#trustAsHtml\n * @methodOf ng.$sce\n *\n * @description\n * Shorthand method. `$sce.trustAsHtml(value)` →\n * {@link ng.$sceDelegate#methods_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#methods_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#methods_trustAs $sce.trustAs}.)\n */\n\n /**\n * @ngdoc method\n * @name ng.$sce#trustAsUrl\n * @methodOf ng.$sce\n *\n * @description\n * Shorthand method. `$sce.trustAsUrl(value)` →\n * {@link ng.$sceDelegate#methods_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#methods_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#methods_trustAs $sce.trustAs}.)\n */\n\n /**\n * @ngdoc method\n * @name ng.$sce#trustAsResourceUrl\n * @methodOf ng.$sce\n *\n * @description\n * Shorthand method. `$sce.trustAsResourceUrl(value)` →\n * {@link ng.$sceDelegate#methods_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#methods_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#methods_trustAs $sce.trustAs}.)\n */\n\n /**\n * @ngdoc method\n * @name ng.$sce#trustAsJs\n * @methodOf ng.$sce\n *\n * @description\n * Shorthand method. `$sce.trustAsJs(value)` →\n * {@link ng.$sceDelegate#methods_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#methods_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#methods_trustAs $sce.trustAs}.)\n */\n\n /**\n * @ngdoc method\n * @name ng.$sce#getTrusted\n * @methodOf ng.$sce\n *\n * @description\n * Delegates to {@link ng.$sceDelegate#methods_getTrusted `$sceDelegate.getTrusted`}. As such,\n * takes the result of a {@link ng.$sce#methods_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#methods_trustAs `$sce.trustAs`}\n * call.\n * @returns {*} The value the was originally provided to\n * {@link ng.$sce#methods_trustAs `$sce.trustAs`} if valid in this context.\n * Otherwise, throws an exception.\n */\n\n /**\n * @ngdoc method\n * @name ng.$sce#getTrustedHtml\n * @methodOf ng.$sce\n *\n * @description\n * Shorthand method. `$sce.getTrustedHtml(value)` →\n * {@link ng.$sceDelegate#methods_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 ng.$sce#getTrustedCss\n * @methodOf ng.$sce\n *\n * @description\n * Shorthand method. `$sce.getTrustedCss(value)` →\n * {@link ng.$sceDelegate#methods_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 ng.$sce#getTrustedUrl\n * @methodOf ng.$sce\n *\n * @description\n * Shorthand method. `$sce.getTrustedUrl(value)` →\n * {@link ng.$sceDelegate#methods_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 ng.$sce#getTrustedResourceUrl\n * @methodOf ng.$sce\n *\n * @description\n * Shorthand method. `$sce.getTrustedResourceUrl(value)` →\n * {@link ng.$sceDelegate#methods_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 ng.$sce#getTrustedJs\n * @methodOf ng.$sce\n *\n * @description\n * Shorthand method. `$sce.getTrustedJs(value)` →\n * {@link ng.$sceDelegate#methods_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 ng.$sce#parseAsHtml\n * @methodOf ng.$sce\n *\n * @description\n * Shorthand method. `$sce.parseAsHtml(expression string)` →\n * {@link ng.$sce#methods_parse `$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 ng.$sce#parseAsCss\n * @methodOf ng.$sce\n *\n * @description\n * Shorthand method. `$sce.parseAsCss(value)` →\n * {@link ng.$sce#methods_parse `$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 ng.$sce#parseAsUrl\n * @methodOf ng.$sce\n *\n * @description\n * Shorthand method. `$sce.parseAsUrl(value)` →\n * {@link ng.$sce#methods_parse `$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 ng.$sce#parseAsResourceUrl\n * @methodOf ng.$sce\n *\n * @description\n * Shorthand method. `$sce.parseAsResourceUrl(value)` →\n * {@link ng.$sce#methods_parse `$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 ng.$sce#parseAsJs\n * @methodOf ng.$sce\n *\n * @description\n * Shorthand method. `$sce.parseAsJs(value)` →\n * {@link ng.$sce#methods_parse `$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 ng.$sniffer\n * @requires $window\n * @requires $document\n *\n * @property {boolean} history Does the browser support html5 history api ?\n * @property {boolean} hashchange Does the browser support hashchange event ?\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 documentMode = document.documentMode,\n vendorPrefix,\n vendorRegex = /^(Moz|webkit|O|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 webit 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 hashchange: 'onhashchange' in $window &&\n // IE8 compatible mode lies\n (!documentMode || documentMode > 7),\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 if (event == 'input' && msie == 9) 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 msie : msie,\n msieDocumentMode: documentMode\n };\n }];\n}\n\nfunction $TimeoutProvider() {\n this.$get = ['$rootScope', '$browser', '$q', '$exceptionHandler',\n function($rootScope, $browser, $q, $exceptionHandler) {\n var deferreds = {};\n\n\n /**\n * @ngdoc function\n * @name ng.$timeout\n * @requires $browser\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#methods_$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 * @example\n <doc:example module=\"time\">\n <doc:source>\n <script>\n function Ctrl2($scope,$timeout) {\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 stop = $timeout(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 $scope.fight();\n } else {\n $timeout.cancel(stop);\n }\n }, 100);\n };\n\n $scope.stopFight = function() {\n $timeout.cancel(stop);\n };\n\n $scope.resetFight = function() {\n $scope.blood_1 = 100;\n $scope.blood_2 = 120;\n }\n }\n\n angular.module('time', [])\n // Register the 'myCurrentTime' directive factory method.\n // We inject $timeout and dateFilter service since the factory method is DI.\n .directive('myCurrentTime', function($timeout, dateFilter) {\n // return the directive link function. (compile function not needed)\n return function(scope, element, attrs) {\n var format, // date format\n timeoutId; // timeoutId, 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 // schedule update in one second\n function updateLater() {\n // save the timeoutId for canceling\n timeoutId = $timeout(function() {\n updateTime(); // update DOM\n updateLater(); // schedule another update\n }, 1000);\n }\n\n // listen on DOM destroy (removal) event, and cancel the next UI update\n // to prevent updating time ofter the DOM element was removed.\n element.bind('$destroy', function() {\n $timeout.cancel(timeoutId);\n });\n\n updateLater(); // kick off the UI update process.\n }\n });\n </script>\n\n <div>\n <div ng-controller=\"Ctrl2\">\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 </doc:source>\n </doc:example>\n */\n function timeout(fn, delay, invokeApply) {\n var deferred = $q.defer(),\n promise = deferred.promise,\n skipApply = (isDefined(invokeApply) && !invokeApply),\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 function\n * @name ng.$timeout#cancel\n * @methodOf ng.$timeout\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, true);\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 * @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, base) {\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 object\n * @name ng.$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 <doc:example>\n <doc:source>\n <script>\n function Ctrl($scope, $window) {\n $scope.greeting = 'Hello, World!';\n $scope.doGreeting = function(greeting) {\n $window.alert(greeting);\n };\n }\n </script>\n <div ng-controller=\"Ctrl\">\n <input type=\"text\" ng-model=\"greeting\" />\n <button ng-click=\"doGreeting(greeting)\">ALERT</button>\n </div>\n </doc:source>\n <doc:scenario>\n it('should display the greeting in the input box', function() {\n input('greeting').enter('Hello, E2E Tests');\n // If we click the button it will block the test runner\n // element(':button').click();\n });\n </doc:scenario>\n </doc:example>\n */\nfunction $WindowProvider(){\n this.$get = valueFn(window);\n}\n\n/**\n * @ngdoc object\n * @name ng.$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 * <pre>\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 * </pre>\n *\n * The filter function is registered with the `$injector` under the filter name suffix with\n * `Filter`.\n * \n * <pre>\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 * </pre>\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 * @ngdoc method\n * @name ng.$filterProvider#register\n * @methodOf ng.$filterProvider\n * @description\n * Register filter factory function.\n *\n * @param {String} name Name of the filter.\n * @param {function} fn The filter factory function which is injectable.\n */\n\n\n/**\n * @ngdoc function\n * @name ng.$filter\n * @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 */\n$FilterProvider.$inject = ['$provide'];\nfunction $FilterProvider($provide) {\n var suffix = 'Filter';\n\n /**\n * @ngdoc function\n * @name ng.$controllerProvider#register\n * @methodOf ng.$controllerProvider\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 ng.filter:filter\n * @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`: Predicate that results in a substring match using the value of `expression`\n * string. All strings or objects with string properties in `array` that contain this string\n * will be returned. 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. That's equivalent to the simple substring match with a `string`\n * as described above.\n *\n * - `function`: A predicate function can be used to write arbitrary filters. The function is\n * called for each element of `array`. The final result is an array of those elements that\n * the predicate returned true for.\n *\n * @param {function(expected, actual)|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(expected, actual)`:\n * The function will be given the object value and the predicate value to compare and\n * should return true if the item should be included in filtered result.\n *\n * - `true`: A shorthand for `function(expected, actual) { return angular.equals(expected, actual)}`.\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 <doc:example>\n <doc:source>\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=\"friend in friends | filter:search:strict\">\n <td>{{friend.name}}</td>\n <td>{{friend.phone}}</td>\n </tr>\n </table>\n </doc:source>\n <doc:scenario>\n it('should search across all fields when filtering with a string', function() {\n input('searchText').enter('m');\n expect(repeater('#searchTextResults tr', 'friend in friends').column('friend.name')).\n toEqual(['Mary', 'Mike', 'Adam']);\n\n input('searchText').enter('76');\n expect(repeater('#searchTextResults tr', 'friend in friends').column('friend.name')).\n toEqual(['John', 'Julie']);\n });\n\n it('should search in specific fields when filtering with a predicate object', function() {\n input('search.$').enter('i');\n expect(repeater('#searchObjResults tr', 'friend in friends').column('friend.name')).\n toEqual(['Mary', 'Mike', 'Julie', 'Juliette']);\n });\n it('should use a equal comparison when comparator is true', function() {\n input('search.name').enter('Julie');\n input('strict').check();\n expect(repeater('#searchObjResults tr', 'friend in friends').column('friend.name')).\n toEqual(['Julie']);\n });\n </doc:scenario>\n </doc:example>\n */\nfunction filterFilter() {\n return function(array, expression, comparator) {\n if (!isArray(array)) return array;\n\n var comparatorType = typeof(comparator),\n predicates = [];\n\n predicates.check = function(value) {\n for (var j = 0; j < predicates.length; j++) {\n if(!predicates[j](value)) {\n return false;\n }\n }\n return true;\n };\n\n if (comparatorType !== 'function') {\n if (comparatorType === 'boolean' && comparator) {\n comparator = function(obj, text) {\n return angular.equals(obj, text);\n };\n } else {\n comparator = function(obj, text) {\n text = (''+text).toLowerCase();\n return (''+obj).toLowerCase().indexOf(text) > -1;\n };\n }\n }\n\n var search = function(obj, text){\n if (typeof text == 'string' && text.charAt(0) === '!') {\n return !search(obj, text.substr(1));\n }\n switch (typeof obj) {\n case \"boolean\":\n case \"number\":\n case \"string\":\n return comparator(obj, text);\n case \"object\":\n switch (typeof text) {\n case \"object\":\n return comparator(obj, text);\n default:\n for ( var objKey in obj) {\n if (objKey.charAt(0) !== '$' && search(obj[objKey], text)) {\n return true;\n }\n }\n break;\n }\n return false;\n case \"array\":\n for ( var i = 0; i < obj.length; i++) {\n if (search(obj[i], text)) {\n return true;\n }\n }\n return false;\n default:\n return false;\n }\n };\n switch (typeof expression) {\n case \"boolean\":\n case \"number\":\n case \"string\":\n // Set up expression object and fall through\n expression = {$:expression};\n // jshint -W086\n case \"object\":\n // jshint +W086\n for (var key in expression) {\n if (key == '$') {\n (function() {\n if (!expression[key]) return;\n var path = key;\n predicates.push(function(value) {\n return search(value, expression[path]);\n });\n })();\n } else {\n (function() {\n if (typeof(expression[key]) == 'undefined') { return; }\n var path = key;\n predicates.push(function(value) {\n return search(getter(value,path), expression[path]);\n });\n })();\n }\n }\n break;\n case 'function':\n predicates.push(expression);\n break;\n default:\n return array;\n }\n var filtered = [];\n for ( var j = 0; j < array.length; j++) {\n var value = array[j];\n if (predicates.check(value)) {\n filtered.push(value);\n }\n }\n return filtered;\n };\n}\n\n/**\n * @ngdoc filter\n * @name ng.filter:currency\n * @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 * @returns {string} Formatted number.\n *\n *\n * @example\n <doc:example>\n <doc:source>\n <script>\n function Ctrl($scope) {\n $scope.amount = 1234.56;\n }\n </script>\n <div ng-controller=\"Ctrl\">\n <input type=\"number\" ng-model=\"amount\"> <br>\n default currency symbol ($): {{amount | currency}}<br>\n custom currency identifier (USD$): {{amount | currency:\"USD$\"}}\n </div>\n </doc:source>\n <doc:scenario>\n it('should init with 1234.56', function() {\n expect(binding('amount | currency')).toBe('$1,234.56');\n expect(binding('amount | currency:\"USD$\"')).toBe('USD$1,234.56');\n });\n it('should update', function() {\n input('amount').enter('-1234');\n expect(binding('amount | currency')).toBe('($1,234.00)');\n expect(binding('amount | currency:\"USD$\"')).toBe('(USD$1,234.00)');\n });\n </doc:scenario>\n </doc:example>\n */\ncurrencyFilter.$inject = ['$locale'];\nfunction currencyFilter($locale) {\n var formats = $locale.NUMBER_FORMATS;\n return function(amount, currencySymbol){\n if (isUndefined(currencySymbol)) currencySymbol = formats.CURRENCY_SYM;\n return formatNumber(amount, formats.PATTERNS[1], formats.GROUP_SEP, formats.DECIMAL_SEP, 2).\n replace(/\\u00A4/g, currencySymbol);\n };\n}\n\n/**\n * @ngdoc filter\n * @name ng.filter:number\n * @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 <doc:example>\n <doc:source>\n <script>\n function Ctrl($scope) {\n $scope.val = 1234.56789;\n }\n </script>\n <div ng-controller=\"Ctrl\">\n Enter number: <input ng-model='val'><br>\n Default formatting: {{val | number}}<br>\n No fractions: {{val | number:0}}<br>\n Negative number: {{-val | number:4}}\n </div>\n </doc:source>\n <doc:scenario>\n it('should format numbers', function() {\n expect(binding('val | number')).toBe('1,234.568');\n expect(binding('val | number:0')).toBe('1,235');\n expect(binding('-val | number:4')).toBe('-1,234.5679');\n });\n\n it('should update', function() {\n input('val').enter('3374.333');\n expect(binding('val | number')).toBe('3,374.333');\n expect(binding('val | number:0')).toBe('3,374');\n expect(binding('-val | number:4')).toBe('-3,374.3330');\n });\n </doc:scenario>\n </doc:example>\n */\n\n\nnumberFilter.$inject = ['$locale'];\nfunction numberFilter($locale) {\n var formats = $locale.NUMBER_FORMATS;\n return function(number, fractionSize) {\n return 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 (isNaN(number) || !isFinite(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 numStr = '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 var pow = Math.pow(10, fractionSize);\n number = Math.round(number * pow) / pow;\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\n if (fractionSize > 0 && number > -1 && number < 1) {\n formatedText = number.toFixed(fractionSize);\n }\n }\n\n parts.push(isNegative ? pattern.negPre : pattern.posPre);\n parts.push(formatedText);\n parts.push(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 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};\n\nvar DATE_FORMATS_SPLIT = /((?:[^yMdHhmsaZE']+)|(?:'(?:[^']|'')*')|(?:E+|y+|M+|d+|H+|h+|m+|s+|a|Z))(.*)/,\n NUMBER_STRING = /^\\-?\\d+$/;\n\n/**\n * @ngdoc filter\n * @name ng.filter:date\n * @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' or ',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 *\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 quoted with single quotes (e.g.\n * `\"h 'in the morning'\"`). In order to output single quote, use 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 * @returns {string} Formatted string or the input if input is not recognized as date/millis.\n *\n * @example\n <doc:example>\n <doc:source>\n <span ng-non-bindable>{{1288323623006 | date:'medium'}}</span>:\n {{1288323623006 | date:'medium'}}<br>\n <span ng-non-bindable>{{1288323623006 | date:'yyyy-MM-dd HH:mm:ss Z'}}</span>:\n {{1288323623006 | date:'yyyy-MM-dd HH:mm:ss Z'}}<br>\n <span ng-non-bindable>{{1288323623006 | date:'MM/dd/yyyy @ h:mma'}}</span>:\n {{'1288323623006' | date:'MM/dd/yyyy @ h:mma'}}<br>\n </doc:source>\n <doc:scenario>\n it('should format date', function() {\n expect(binding(\"1288323623006 | date:'medium'\")).\n toMatch(/Oct 2\\d, 2010 \\d{1,2}:\\d{2}:\\d{2} (AM|PM)/);\n expect(binding(\"1288323623006 | date:'yyyy-MM-dd HH:mm:ss Z'\")).\n toMatch(/2010\\-10\\-2\\d \\d{2}:\\d{2}:\\d{2} (\\-|\\+)?\\d{4}/);\n expect(binding(\"'1288323623006' | date:'MM/dd/yyyy @ h:mma'\")).\n toMatch(/10\\/2\\d\\/2010 @ \\d{1,2}:\\d{2}(AM|PM)/);\n });\n </doc:scenario>\n </doc: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) {\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 if (NUMBER_STRING.test(date)) {\n date = int(date);\n } else {\n date = jsonStringToDate(date);\n }\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 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 ng.filter:json\n * @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 * @returns {string} JSON string.\n *\n *\n * @example:\n <doc:example>\n <doc:source>\n <pre>{{ {'name':'value'} | json }}</pre>\n </doc:source>\n <doc:scenario>\n it('should jsonify filtered objects', function() {\n expect(binding(\"{'name':'value'}\")).toMatch(/\\{\\n \"name\": ?\"value\"\\n}/);\n });\n </doc:scenario>\n </doc:example>\n *\n */\nfunction jsonFilter() {\n return function(object) {\n return toJson(object, true);\n };\n}\n\n\n/**\n * @ngdoc filter\n * @name ng.filter:lowercase\n * @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 ng.filter:uppercase\n * @function\n * @description\n * Converts string to uppercase.\n * @see angular.uppercase\n */\nvar uppercaseFilter = valueFn(uppercase);\n\n/**\n * @ngdoc function\n * @name ng.filter:limitTo\n * @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 or string, as specified by\n * the value and sign (positive or negative) of `limit`.\n *\n * @param {Array|string} input Source array or string 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 <doc:example>\n <doc:source>\n <script>\n function Ctrl($scope) {\n $scope.numbers = [1,2,3,4,5,6,7,8,9];\n $scope.letters = \"abcdefghi\";\n $scope.numLimit = 3;\n $scope.letterLimit = 3;\n }\n </script>\n <div ng-controller=\"Ctrl\">\n Limit {{numbers}} to: <input type=\"integer\" ng-model=\"numLimit\">\n <p>Output numbers: {{ numbers | limitTo:numLimit }}</p>\n Limit {{letters}} to: <input type=\"integer\" ng-model=\"letterLimit\">\n <p>Output letters: {{ letters | limitTo:letterLimit }}</p>\n </div>\n </doc:source>\n <doc:scenario>\n it('should limit the number array to first three items', function() {\n expect(element('.doc-example-live input[ng-model=numLimit]').val()).toBe('3');\n expect(element('.doc-example-live input[ng-model=letterLimit]').val()).toBe('3');\n expect(binding('numbers | limitTo:numLimit')).toEqual('[1,2,3]');\n expect(binding('letters | limitTo:letterLimit')).toEqual('abc');\n });\n\n it('should update the output when -3 is entered', function() {\n input('numLimit').enter(-3);\n input('letterLimit').enter(-3);\n expect(binding('numbers | limitTo:numLimit')).toEqual('[7,8,9]');\n expect(binding('letters | limitTo:letterLimit')).toEqual('ghi');\n });\n\n it('should not exceed the maximum size of input array', function() {\n input('numLimit').enter(100);\n input('letterLimit').enter(100);\n expect(binding('numbers | limitTo:numLimit')).toEqual('[1,2,3,4,5,6,7,8,9]');\n expect(binding('letters | limitTo:letterLimit')).toEqual('abcdefghi');\n });\n </doc:scenario>\n </doc:example>\n */\nfunction limitToFilter(){\n return function(input, limit) {\n if (!isArray(input) && !isString(input)) return input;\n \n limit = int(limit);\n\n if (isString(input)) {\n //NaN check on limit\n if (limit) {\n return limit >= 0 ? input.slice(0, limit) : input.slice(limit, input.length);\n } else {\n return \"\";\n }\n }\n\n var out = [],\n i, n;\n\n // if abs(limit) exceeds maximum length, trim it\n if (limit > input.length)\n limit = input.length;\n else if (limit < -input.length)\n limit = -input.length;\n\n if (limit > 0) {\n i = 0;\n n = limit;\n } else {\n i = input.length + limit;\n n = input.length;\n }\n\n for (; i<n; i++) {\n out.push(input[i]);\n }\n\n return out;\n };\n}\n\n/**\n * @ngdoc function\n * @name ng.filter:orderBy\n * @function\n *\n * @description\n * Orders a specified `array` by the `expression` predicate.\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 which evaluates to an object to order by, such as 'name'\n * to sort by a property called 'name'. Optionally prefixed with `+` or `-` to control\n * ascending or descending sort order (for example, +name or -name).\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 * @param {boolean=} reverse Reverse the order the array.\n * @returns {Array} Sorted copy of the source array.\n *\n * @example\n <doc:example>\n <doc:source>\n <script>\n function Ctrl($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=\"Ctrl\">\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 </doc:source>\n <doc:scenario>\n it('should be reverse ordered by aged', function() {\n expect(binding('predicate')).toBe('-age');\n expect(repeater('table.friend', 'friend in friends').column('friend.age')).\n toEqual(['35', '29', '21', '19', '10']);\n expect(repeater('table.friend', 'friend in friends').column('friend.name')).\n toEqual(['Adam', 'Julie', 'Mike', 'Mary', 'John']);\n });\n\n it('should reorder the table when user selects different predicate', function() {\n element('.doc-example-live a:contains(\"Name\")').click();\n expect(repeater('table.friend', 'friend in friends').column('friend.name')).\n toEqual(['Adam', 'John', 'Julie', 'Mary', 'Mike']);\n expect(repeater('table.friend', 'friend in friends').column('friend.age')).\n toEqual(['35', '10', '29', '19', '21']);\n\n element('.doc-example-live a:contains(\"Phone\")').click();\n expect(repeater('table.friend', 'friend in friends').column('friend.phone')).\n toEqual(['555-9876', '555-8765', '555-5678', '555-4321', '555-1212']);\n expect(repeater('table.friend', 'friend in friends').column('friend.name')).\n toEqual(['Mary', 'Julie', 'Adam', 'Mike', 'John']);\n });\n </doc:scenario>\n </doc:example>\n */\norderByFilter.$inject = ['$parse'];\nfunction orderByFilter($parse){\n return function(array, sortPredicate, reverseOrder) {\n if (!isArray(array)) return array;\n if (!sortPredicate) return array;\n sortPredicate = isArray(sortPredicate) ? sortPredicate: [sortPredicate];\n sortPredicate = map(sortPredicate, 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 get = $parse(predicate);\n }\n return reverseComparator(function(a,b){\n return compare(get(a),get(b));\n }, descending);\n });\n var arrayCopy = [];\n for ( var i = 0; i < array.length; i++) { arrayCopy.push(array[i]); }\n return arrayCopy.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 toBoolean(descending)\n ? function(a,b){return comp(b,a);}\n : comp;\n }\n function compare(v1, v2){\n var t1 = typeof v1;\n var t2 = typeof v2;\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 ng.directive: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\n if (msie <= 8) {\n\n // turn <a href ng-click=\"..\">link</a> into a stylable link in IE\n // but only if it doesn't have name attribute, in which case it's an anchor\n if (!attr.href && !attr.name) {\n attr.$set('href', '');\n }\n\n // add a comment node to anchors to workaround IE bug that causes element content to be reset\n // to new attribute content if attribute is updated with value containing @ and element also\n // contains value with @\n // see issue #1949\n element.append(document.createComment('IE fix'));\n }\n\n if (!attr.href && !attr.name) {\n return function(scope, element) {\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 ng.directive:ngHref\n * @restrict A\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.\n *\n * The `ngHref` directive solves this problem.\n *\n * The wrong way to write it:\n * <pre>\n * <a href=\"http://www.gravatar.com/avatar/{{hash}}\"/>\n * </pre>\n *\n * The correct way to write it:\n * <pre>\n * <a ng-href=\"http://www.gravatar.com/avatar/{{hash}}\"/>\n * </pre>\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 <doc:example>\n <doc:source>\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 </doc:source>\n <doc:scenario>\n it('should execute ng-click but not reload when href without value', function() {\n element('#link-1').click();\n expect(input('value').val()).toEqual('1');\n expect(element('#link-1').attr('href')).toBe(\"\");\n });\n\n it('should execute ng-click but not reload when href empty string', function() {\n element('#link-2').click();\n expect(input('value').val()).toEqual('2');\n expect(element('#link-2').attr('href')).toBe(\"\");\n });\n\n it('should execute ng-click and change url when ng-href specified', function() {\n expect(element('#link-3').attr('href')).toBe(\"/123\");\n\n element('#link-3').click();\n expect(browser().window().path()).toEqual('/123');\n });\n\n it('should execute ng-click but not reload when href empty string and name specified', function() {\n element('#link-4').click();\n expect(input('value').val()).toEqual('4');\n expect(element('#link-4').attr('href')).toBe('');\n });\n\n it('should execute ng-click but not reload when no href but name specified', function() {\n element('#link-5').click();\n expect(input('value').val()).toEqual('5');\n expect(element('#link-5').attr('href')).toBe(undefined);\n });\n\n it('should only change url when only ng-href', function() {\n input('value').enter('6');\n expect(element('#link-6').attr('href')).toBe('6');\n\n element('#link-6').click();\n expect(browser().location().url()).toEqual('/6');\n });\n </doc:scenario>\n </doc:example>\n */\n\n/**\n * @ngdoc directive\n * @name ng.directive:ngSrc\n * @restrict A\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 * <pre>\n * <img src=\"http://www.gravatar.com/avatar/{{hash}}\"/>\n * </pre>\n *\n * The correct way to write it:\n * <pre>\n * <img ng-src=\"http://www.gravatar.com/avatar/{{hash}}\"/>\n * </pre>\n *\n * @element IMG\n * @param {template} ngSrc any string which can contain `{{}}` markup.\n */\n\n/**\n * @ngdoc directive\n * @name ng.directive:ngSrcset\n * @restrict A\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 * <pre>\n * <img srcset=\"http://www.gravatar.com/avatar/{{hash}} 2x\"/>\n * </pre>\n *\n * The correct way to write it:\n * <pre>\n * <img ng-srcset=\"http://www.gravatar.com/avatar/{{hash}} 2x\"/>\n * </pre>\n *\n * @element IMG\n * @param {template} ngSrcset any string which can contain `{{}}` markup.\n */\n\n/**\n * @ngdoc directive\n * @name ng.directive:ngDisabled\n * @restrict A\n *\n * @description\n *\n * The following markup will make the button enabled on Chrome/Firefox but not on IE8 and older IEs:\n * <pre>\n * <div ng-init=\"scope = { isDisabled: false }\">\n * <button disabled=\"{{scope.isDisabled}}\">Disabled</button>\n * </div>\n * </pre>\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 <doc:example>\n <doc:source>\n Click me to toggle: <input type=\"checkbox\" ng-model=\"checked\"><br/>\n <button ng-model=\"button\" ng-disabled=\"checked\">Button</button>\n </doc:source>\n <doc:scenario>\n it('should toggle button', function() {\n expect(element('.doc-example-live :button').prop('disabled')).toBeFalsy();\n input('checked').check();\n expect(element('.doc-example-live :button').prop('disabled')).toBeTruthy();\n });\n </doc:scenario>\n </doc: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 ng.directive:ngChecked\n * @restrict A\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 <doc:example>\n <doc:source>\n Check me to check both: <input type=\"checkbox\" ng-model=\"master\"><br/>\n <input id=\"checkSlave\" type=\"checkbox\" ng-checked=\"master\">\n </doc:source>\n <doc:scenario>\n it('should check both checkBoxes', function() {\n expect(element('.doc-example-live #checkSlave').prop('checked')).toBeFalsy();\n input('master').check();\n expect(element('.doc-example-live #checkSlave').prop('checked')).toBeTruthy();\n });\n </doc:scenario>\n </doc: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 ng.directive:ngReadonly\n * @restrict A\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\n * @example\n <doc:example>\n <doc:source>\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 </doc:source>\n <doc:scenario>\n it('should toggle readonly attr', function() {\n expect(element('.doc-example-live :text').prop('readonly')).toBeFalsy();\n input('checked').check();\n expect(element('.doc-example-live :text').prop('readonly')).toBeTruthy();\n });\n </doc:scenario>\n </doc: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 ng.directive:ngSelected\n * @restrict A\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` atttribute.\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 <doc:example>\n <doc:source>\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 </doc:source>\n <doc:scenario>\n it('should select Greetings!', function() {\n expect(element('.doc-example-live #greet').prop('selected')).toBeFalsy();\n input('selected').check();\n expect(element('.doc-example-live #greet').prop('selected')).toBeTruthy();\n });\n </doc:scenario>\n </doc: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 ng.directive:ngOpen\n * @restrict A\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\n *\n * @example\n <doc:example>\n <doc:source>\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 </doc:source>\n <doc:scenario>\n it('should toggle open', function() {\n expect(element('#details').prop('open')).toBeFalsy();\n input('open').check();\n expect(element('#details').prop('open')).toBeTruthy();\n });\n </doc:scenario>\n </doc: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 priority: 100,\n compile: function() {\n return function(scope, element, attr) {\n scope.$watch(attr[normalized], function ngBooleanAttrWatchAction(value) {\n attr.$set(attrName, !!value);\n });\n };\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 attr.$observe(normalized, function(value) {\n if (!value)\n return;\n\n attr.$set(attrName, 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) element.prop(attrName, attr[attrName]);\n });\n }\n };\n };\n});\n\n/* global -nullFormCtrl */\nvar nullFormCtrl = {\n $addControl: noop,\n $removeControl: noop,\n $setValidity: noop,\n $setDirty: noop,\n $setPristine: noop\n};\n\n/**\n * @ngdoc object\n * @name ng.directive: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 *\n * @property {Object} $error Is an object hash, containing references to all invalid controls or\n * forms, where:\n *\n * - keys are validation tokens (error names),\n * - values are arrays of controls or forms that are invalid for given error name.\n *\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 * \n * @description\n * `FormController` keeps track of all its controls and nested forms as well as 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'];\nfunction FormController(element, attrs) {\n var form = this,\n parentForm = element.parent().controller('form') || nullFormCtrl,\n invalidCount = 0, // used to easily determine if we are valid\n errors = form.$error = {},\n controls = [];\n\n // init state\n form.$name = attrs.name || attrs.ngForm;\n form.$dirty = false;\n form.$pristine = true;\n form.$valid = true;\n form.$invalid = false;\n\n parentForm.$addControl(form);\n\n // Setup initial state of the control\n element.addClass(PRISTINE_CLASS);\n toggleValidCss(true);\n\n // convenience method for easy toggling of classes\n function toggleValidCss(isValid, validationErrorKey) {\n validationErrorKey = validationErrorKey ? '-' + snake_case(validationErrorKey, '-') : '';\n element.\n removeClass((isValid ? INVALID_CLASS : VALID_CLASS) + validationErrorKey).\n addClass((isValid ? VALID_CLASS : INVALID_CLASS) + validationErrorKey);\n }\n\n /**\n * @ngdoc function\n * @name ng.directive:form.FormController#$addControl\n * @methodOf ng.directive:form.FormController\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 /**\n * @ngdoc function\n * @name ng.directive:form.FormController#$removeControl\n * @methodOf ng.directive:form.FormController\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(errors, function(queue, validationToken) {\n form.$setValidity(validationToken, true, control);\n });\n\n arrayRemove(controls, control);\n };\n\n /**\n * @ngdoc function\n * @name ng.directive:form.FormController#$setValidity\n * @methodOf ng.directive:form.FormController\n *\n * @description\n * Sets the validity of a form control.\n *\n * This method will also propagate to parent forms.\n */\n form.$setValidity = function(validationToken, isValid, control) {\n var queue = errors[validationToken];\n\n if (isValid) {\n if (queue) {\n arrayRemove(queue, control);\n if (!queue.length) {\n invalidCount--;\n if (!invalidCount) {\n toggleValidCss(isValid);\n form.$valid = true;\n form.$invalid = false;\n }\n errors[validationToken] = false;\n toggleValidCss(true, validationToken);\n parentForm.$setValidity(validationToken, true, form);\n }\n }\n\n } else {\n if (!invalidCount) {\n toggleValidCss(isValid);\n }\n if (queue) {\n if (includes(queue, control)) return;\n } else {\n errors[validationToken] = queue = [];\n invalidCount++;\n toggleValidCss(false, validationToken);\n parentForm.$setValidity(validationToken, false, form);\n }\n queue.push(control);\n\n form.$valid = false;\n form.$invalid = true;\n }\n };\n\n /**\n * @ngdoc function\n * @name ng.directive:form.FormController#$setDirty\n * @methodOf ng.directive:form.FormController\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 element.removeClass(PRISTINE_CLASS).addClass(DIRTY_CLASS);\n form.$dirty = true;\n form.$pristine = false;\n parentForm.$setDirty();\n };\n\n /**\n * @ngdoc function\n * @name ng.directive:form.FormController#$setPristine\n * @methodOf ng.directive:form.FormController\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 element.removeClass(DIRTY_CLASS).addClass(PRISTINE_CLASS);\n form.$dirty = false;\n form.$pristine = true;\n forEach(controls, function(control) {\n control.$setPristine();\n });\n };\n}\n\n\n/**\n * @ngdoc directive\n * @name ng.directive: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 * @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 ng.directive:form\n * @restrict E\n *\n * @description\n * Directive that instantiates\n * {@link ng.directive: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 *\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 * @param {string=} name Name of the form. If specified, the form controller will be published into\n * related scope, under this name.\n *\n * @example\n <doc:example>\n <doc:source>\n <script>\n function Ctrl($scope) {\n $scope.userType = 'guest';\n }\n </script>\n <form name=\"myForm\" ng-controller=\"Ctrl\">\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 </doc:source>\n <doc:scenario>\n it('should initialize to model', function() {\n expect(binding('userType')).toEqual('guest');\n expect(binding('myForm.input.$valid')).toEqual('true');\n });\n\n it('should be invalid if empty', function() {\n input('userType').enter('');\n expect(binding('userType')).toEqual('');\n expect(binding('myForm.input.$valid')).toEqual('false');\n });\n </doc:scenario>\n </doc:example>\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() {\n return {\n pre: function(scope, formElement, attr, controller) {\n if (!attr.action) {\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 preventDefaultListener = function(event) {\n event.preventDefault\n ? event.preventDefault()\n : event.returnValue = false; // IE\n };\n\n addEventListenerFn(formElement[0], 'submit', preventDefaultListener);\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', preventDefaultListener);\n }, 0, false);\n });\n }\n\n var parentFormCtrl = formElement.parent().controller('form'),\n alias = attr.name || attr.ngForm;\n\n if (alias) {\n setter(scope, alias, controller, alias);\n }\n if (parentFormCtrl) {\n formElement.on('$destroy', function() {\n parentFormCtrl.$removeControl(controller);\n if (alias) {\n setter(scope, alias, undefined, alias);\n }\n extend(controller, nullFormCtrl); //stop propagating child destruction handlers upwards\n });\n }\n }\n };\n }\n };\n\n return formDirective;\n }];\n};\n\nvar formDirective = formDirectiveFactory();\nvar ngFormDirective = formDirectiveFactory(true);\n\n/* global\n\n -VALID_CLASS,\n -INVALID_CLASS,\n -PRISTINE_CLASS,\n -DIRTY_CLASS\n*/\n\nvar URL_REGEXP = /^(ftp|http|https):\\/\\/(\\w+:{0,1}\\w*@)?(\\S+)(:[0-9]+)?(\\/|\\/([\\w#!:.?+=&%@!\\-\\/]))?$/;\nvar EMAIL_REGEXP = /^[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,6}$/;\nvar NUMBER_REGEXP = /^\\s*(\\-|\\+)?(\\d+|(\\d*(\\.\\d*)))\\s*$/;\n\nvar inputType = {\n\n /**\n * @ngdoc inputType\n * @name ng.directive:input.text\n *\n * @description\n * Standard HTML text input with angular data binding.\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.\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 * @example\n <doc:example>\n <doc:source>\n <script>\n function Ctrl($scope) {\n $scope.text = 'guest';\n $scope.word = /^\\s*\\w*\\s*$/;\n }\n </script>\n <form name=\"myForm\" ng-controller=\"Ctrl\">\n Single word: <input type=\"text\" name=\"input\" ng-model=\"text\"\n ng-pattern=\"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 = {{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 </doc:source>\n <doc:scenario>\n it('should initialize to model', function() {\n expect(binding('text')).toEqual('guest');\n expect(binding('myForm.input.$valid')).toEqual('true');\n });\n\n it('should be invalid if empty', function() {\n input('text').enter('');\n expect(binding('text')).toEqual('');\n expect(binding('myForm.input.$valid')).toEqual('false');\n });\n\n it('should be invalid if multi word', function() {\n input('text').enter('hello world');\n expect(binding('myForm.input.$valid')).toEqual('false');\n });\n\n it('should not be trimmed', function() {\n input('text').enter('untrimmed ');\n expect(binding('text')).toEqual('untrimmed ');\n expect(binding('myForm.input.$valid')).toEqual('true');\n });\n </doc:scenario>\n </doc:example>\n */\n 'text': textInputType,\n\n\n /**\n * @ngdoc inputType\n * @name ng.directive: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 * @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.\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 *\n * @example\n <doc:example>\n <doc:source>\n <script>\n function Ctrl($scope) {\n $scope.value = 12;\n }\n </script>\n <form name=\"myForm\" ng-controller=\"Ctrl\">\n Number: <input type=\"number\" name=\"input\" ng-model=\"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 = {{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 </doc:source>\n <doc:scenario>\n it('should initialize to model', function() {\n expect(binding('value')).toEqual('12');\n expect(binding('myForm.input.$valid')).toEqual('true');\n });\n\n it('should be invalid if empty', function() {\n input('value').enter('');\n expect(binding('value')).toEqual('');\n expect(binding('myForm.input.$valid')).toEqual('false');\n });\n\n it('should be invalid if over max', function() {\n input('value').enter('123');\n expect(binding('value')).toEqual('');\n expect(binding('myForm.input.$valid')).toEqual('false');\n });\n </doc:scenario>\n </doc:example>\n */\n 'number': numberInputType,\n\n\n /**\n * @ngdoc inputType\n * @name ng.directive: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 * @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.\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 *\n * @example\n <doc:example>\n <doc:source>\n <script>\n function Ctrl($scope) {\n $scope.text = 'http://google.com';\n }\n </script>\n <form name=\"myForm\" ng-controller=\"Ctrl\">\n URL: <input type=\"url\" name=\"input\" ng-model=\"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 = {{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 </doc:source>\n <doc:scenario>\n it('should initialize to model', function() {\n expect(binding('text')).toEqual('http://google.com');\n expect(binding('myForm.input.$valid')).toEqual('true');\n });\n\n it('should be invalid if empty', function() {\n input('text').enter('');\n expect(binding('text')).toEqual('');\n expect(binding('myForm.input.$valid')).toEqual('false');\n });\n\n it('should be invalid if not url', function() {\n input('text').enter('xxx');\n expect(binding('myForm.input.$valid')).toEqual('false');\n });\n </doc:scenario>\n </doc:example>\n */\n 'url': urlInputType,\n\n\n /**\n * @ngdoc inputType\n * @name ng.directive: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 * @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.\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 *\n * @example\n <doc:example>\n <doc:source>\n <script>\n function Ctrl($scope) {\n $scope.text = 'me@example.com';\n }\n </script>\n <form name=\"myForm\" ng-controller=\"Ctrl\">\n Email: <input type=\"email\" name=\"input\" ng-model=\"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 = {{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 </doc:source>\n <doc:scenario>\n it('should initialize to model', function() {\n expect(binding('text')).toEqual('me@example.com');\n expect(binding('myForm.input.$valid')).toEqual('true');\n });\n\n it('should be invalid if empty', function() {\n input('text').enter('');\n expect(binding('text')).toEqual('');\n expect(binding('myForm.input.$valid')).toEqual('false');\n });\n\n it('should be invalid if not email', function() {\n input('text').enter('xxx');\n expect(binding('myForm.input.$valid')).toEqual('false');\n });\n </doc:scenario>\n </doc:example>\n */\n 'email': emailInputType,\n\n\n /**\n * @ngdoc inputType\n * @name ng.directive: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 *\n * @example\n <doc:example>\n <doc:source>\n <script>\n function Ctrl($scope) {\n $scope.color = 'blue';\n }\n </script>\n <form name=\"myForm\" ng-controller=\"Ctrl\">\n <input type=\"radio\" ng-model=\"color\" value=\"red\"> Red <br/>\n <input type=\"radio\" ng-model=\"color\" value=\"green\"> Green <br/>\n <input type=\"radio\" ng-model=\"color\" value=\"blue\"> Blue <br/>\n <tt>color = {{color}}</tt><br/>\n </form>\n </doc:source>\n <doc:scenario>\n it('should change state', function() {\n expect(binding('color')).toEqual('blue');\n\n input('color').select('red');\n expect(binding('color')).toEqual('red');\n });\n </doc:scenario>\n </doc:example>\n */\n 'radio': radioInputType,\n\n\n /**\n * @ngdoc inputType\n * @name ng.directive: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 {string=} ngTrueValue The value to which the expression should be set when selected.\n * @param {string=} 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 <doc:example>\n <doc:source>\n <script>\n function Ctrl($scope) {\n $scope.value1 = true;\n $scope.value2 = 'YES'\n }\n </script>\n <form name=\"myForm\" ng-controller=\"Ctrl\">\n Value1: <input type=\"checkbox\" ng-model=\"value1\"> <br/>\n Value2: <input type=\"checkbox\" ng-model=\"value2\"\n ng-true-value=\"YES\" ng-false-value=\"NO\"> <br/>\n <tt>value1 = {{value1}}</tt><br/>\n <tt>value2 = {{value2}}</tt><br/>\n </form>\n </doc:source>\n <doc:scenario>\n it('should change state', function() {\n expect(binding('value1')).toEqual('true');\n expect(binding('value2')).toEqual('YES');\n\n input('value1').check();\n input('value2').check();\n expect(binding('value1')).toEqual('false');\n expect(binding('value2')).toEqual('NO');\n });\n </doc:scenario>\n </doc:example>\n */\n 'checkbox': checkboxInputType,\n\n 'hidden': noop,\n 'button': noop,\n 'submit': noop,\n 'reset': noop\n};\n\n\nfunction textInputType(scope, element, attr, ctrl, $sniffer, $browser) {\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 var composing = false;\n\n element.on('compositionstart', function() {\n composing = true;\n });\n\n element.on('compositionend', function() {\n composing = false;\n });\n\n var listener = function() {\n if (composing) return;\n var value = element.val();\n\n // By default we will trim the value\n // If the attribute ng-trim exists we will avoid trimming\n // e.g. <input ng-model=\"foo\" ng-trim=\"false\">\n if (toBoolean(attr.ngTrim || 'T')) {\n value = trim(value);\n }\n\n if (ctrl.$viewValue !== value) {\n scope.$apply(function() {\n ctrl.$setViewValue(value);\n });\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() {\n if (!timeout) {\n timeout = $browser.defer(function() {\n listener();\n timeout = null;\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();\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 // pattern validator\n var pattern = attr.ngPattern,\n patternValidator,\n match;\n\n var validate = function(regexp, value) {\n if (ctrl.$isEmpty(value) || regexp.test(value)) {\n ctrl.$setValidity('pattern', true);\n return value;\n } else {\n ctrl.$setValidity('pattern', false);\n return undefined;\n }\n };\n\n if (pattern) {\n match = pattern.match(/^\\/(.*)\\/([gim]*)$/);\n if (match) {\n pattern = new RegExp(match[1], match[2]);\n patternValidator = function(value) {\n return validate(pattern, value);\n };\n } else {\n patternValidator = function(value) {\n var patternObj = scope.$eval(pattern);\n\n if (!patternObj || !patternObj.test) {\n throw minErr('ngPattern')('noregexp',\n 'Expected {0} to be a RegExp but was {1}. Element: {2}', pattern,\n patternObj, startingTag(element));\n }\n return validate(patternObj, value);\n };\n }\n\n ctrl.$formatters.push(patternValidator);\n ctrl.$parsers.push(patternValidator);\n }\n\n // min length validator\n if (attr.ngMinlength) {\n var minlength = int(attr.ngMinlength);\n var minLengthValidator = function(value) {\n if (!ctrl.$isEmpty(value) && value.length < minlength) {\n ctrl.$setValidity('minlength', false);\n return undefined;\n } else {\n ctrl.$setValidity('minlength', true);\n return value;\n }\n };\n\n ctrl.$parsers.push(minLengthValidator);\n ctrl.$formatters.push(minLengthValidator);\n }\n\n // max length validator\n if (attr.ngMaxlength) {\n var maxlength = int(attr.ngMaxlength);\n var maxLengthValidator = function(value) {\n if (!ctrl.$isEmpty(value) && value.length > maxlength) {\n ctrl.$setValidity('maxlength', false);\n return undefined;\n } else {\n ctrl.$setValidity('maxlength', true);\n return value;\n }\n };\n\n ctrl.$parsers.push(maxLengthValidator);\n ctrl.$formatters.push(maxLengthValidator);\n }\n}\n\nfunction numberInputType(scope, element, attr, ctrl, $sniffer, $browser) {\n textInputType(scope, element, attr, ctrl, $sniffer, $browser);\n\n ctrl.$parsers.push(function(value) {\n var empty = ctrl.$isEmpty(value);\n if (empty || NUMBER_REGEXP.test(value)) {\n ctrl.$setValidity('number', true);\n return value === '' ? null : (empty ? value : parseFloat(value));\n } else {\n ctrl.$setValidity('number', false);\n return undefined;\n }\n });\n\n ctrl.$formatters.push(function(value) {\n return ctrl.$isEmpty(value) ? '' : '' + value;\n });\n\n if (attr.min) {\n var minValidator = function(value) {\n var min = parseFloat(attr.min);\n if (!ctrl.$isEmpty(value) && value < min) {\n ctrl.$setValidity('min', false);\n return undefined;\n } else {\n ctrl.$setValidity('min', true);\n return value;\n }\n };\n\n ctrl.$parsers.push(minValidator);\n ctrl.$formatters.push(minValidator);\n }\n\n if (attr.max) {\n var maxValidator = function(value) {\n var max = parseFloat(attr.max);\n if (!ctrl.$isEmpty(value) && value > max) {\n ctrl.$setValidity('max', false);\n return undefined;\n } else {\n ctrl.$setValidity('max', true);\n return value;\n }\n };\n\n ctrl.$parsers.push(maxValidator);\n ctrl.$formatters.push(maxValidator);\n }\n\n ctrl.$formatters.push(function(value) {\n\n if (ctrl.$isEmpty(value) || isNumber(value)) {\n ctrl.$setValidity('number', true);\n return value;\n } else {\n ctrl.$setValidity('number', false);\n return undefined;\n }\n });\n}\n\nfunction urlInputType(scope, element, attr, ctrl, $sniffer, $browser) {\n textInputType(scope, element, attr, ctrl, $sniffer, $browser);\n\n var urlValidator = function(value) {\n if (ctrl.$isEmpty(value) || URL_REGEXP.test(value)) {\n ctrl.$setValidity('url', true);\n return value;\n } else {\n ctrl.$setValidity('url', false);\n return undefined;\n }\n };\n\n ctrl.$formatters.push(urlValidator);\n ctrl.$parsers.push(urlValidator);\n}\n\nfunction emailInputType(scope, element, attr, ctrl, $sniffer, $browser) {\n textInputType(scope, element, attr, ctrl, $sniffer, $browser);\n\n var emailValidator = function(value) {\n if (ctrl.$isEmpty(value) || EMAIL_REGEXP.test(value)) {\n ctrl.$setValidity('email', true);\n return value;\n } else {\n ctrl.$setValidity('email', false);\n return undefined;\n }\n };\n\n ctrl.$formatters.push(emailValidator);\n ctrl.$parsers.push(emailValidator);\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 element.on('click', function() {\n if (element[0].checked) {\n scope.$apply(function() {\n ctrl.$setViewValue(attr.value);\n });\n }\n });\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 checkboxInputType(scope, element, attr, ctrl) {\n var trueValue = attr.ngTrueValue,\n falseValue = attr.ngFalseValue;\n\n if (!isString(trueValue)) trueValue = true;\n if (!isString(falseValue)) falseValue = false;\n\n element.on('click', function() {\n scope.$apply(function() {\n ctrl.$setViewValue(element[0].checked);\n });\n });\n\n ctrl.$render = function() {\n element[0].checked = ctrl.$viewValue;\n };\n\n // Override the standard `$isEmpty` because a value of `false` means empty in a checkbox.\n ctrl.$isEmpty = function(value) {\n return value !== trueValue;\n };\n\n ctrl.$formatters.push(function(value) {\n return 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 ng.directive: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.\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 */\n\n\n/**\n * @ngdoc directive\n * @name ng.directive:input\n * @restrict E\n *\n * @description\n * HTML input element control with angular data-binding. Input control follows HTML5 input types\n * and polyfills the HTML5 validation behavior for older browsers.\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.\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 *\n * @example\n <doc:example>\n <doc:source>\n <script>\n function Ctrl($scope) {\n $scope.user = {name: 'guest', last: 'visitor'};\n }\n </script>\n <div ng-controller=\"Ctrl\">\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 </doc:source>\n <doc:scenario>\n it('should initialize to model', function() {\n expect(binding('user')).toEqual('{\"name\":\"guest\",\"last\":\"visitor\"}');\n expect(binding('myForm.userName.$valid')).toEqual('true');\n expect(binding('myForm.$valid')).toEqual('true');\n });\n\n it('should be invalid if empty when required', function() {\n input('user.name').enter('');\n expect(binding('user')).toEqual('{\"last\":\"visitor\"}');\n expect(binding('myForm.userName.$valid')).toEqual('false');\n expect(binding('myForm.$valid')).toEqual('false');\n });\n\n it('should be valid if empty when min length is set', function() {\n input('user.last').enter('');\n expect(binding('user')).toEqual('{\"name\":\"guest\",\"last\":\"\"}');\n expect(binding('myForm.lastName.$valid')).toEqual('true');\n expect(binding('myForm.$valid')).toEqual('true');\n });\n\n it('should be invalid if less than required min length', function() {\n input('user.last').enter('xx');\n expect(binding('user')).toEqual('{\"name\":\"guest\"}');\n expect(binding('myForm.lastName.$valid')).toEqual('false');\n expect(binding('myForm.lastName.$error')).toMatch(/minlength/);\n expect(binding('myForm.$valid')).toEqual('false');\n });\n\n it('should be invalid if longer than max length', function() {\n input('user.last').enter('some ridiculously long name');\n expect(binding('user'))\n .toEqual('{\"name\":\"guest\"}');\n expect(binding('myForm.lastName.$valid')).toEqual('false');\n expect(binding('myForm.lastName.$error')).toMatch(/maxlength/);\n expect(binding('myForm.$valid')).toEqual('false');\n });\n </doc:scenario>\n </doc:example>\n */\nvar inputDirective = ['$browser', '$sniffer', function($browser, $sniffer) {\n return {\n restrict: 'E',\n require: '?ngModel',\n link: function(scope, element, attr, ctrl) {\n if (ctrl) {\n (inputType[lowercase(attr.type)] || inputType.text)(scope, element, attr, ctrl, $sniffer,\n $browser);\n }\n }\n };\n}];\n\nvar VALID_CLASS = 'ng-valid',\n INVALID_CLASS = 'ng-invalid',\n PRISTINE_CLASS = 'ng-pristine',\n DIRTY_CLASS = 'ng-dirty';\n\n/**\n * @ngdoc object\n * @name ng.directive: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. Each function is called, in turn, passing the value\n through to the next. Used to sanitize / convert the value as well as validation.\n For validation, the parsers should update the validity state using\n {@link ng.directive:ngModel.NgModelController#methods_$setValidity $setValidity()},\n and return `undefined` for invalid values.\n\n *\n * @property {Array.<Function>} $formatters Array of functions to execute, as a pipeline, whenever\n the model value changes. Each function is called, in turn, passing the value through to the\n next. Used to format / convert values for display in the control and validation.\n * <pre>\n * function formatter(value) {\n * if (value) {\n * return value.toUpperCase();\n * }\n * }\n * ngModel.$formatters.push(formatter);\n * </pre>\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 errors as keys.\n *\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 *\n * @description\n *\n * `NgModelController` provides API for the `ng-model` directive. The controller contains\n * services for data-binding, validation, CSS updates, and value formatting and parsing. It\n * purposefully does not contain any logic which deals with DOM rendering or listening to\n * DOM events. Such DOM related logic should be provided by other directives which make use of\n * `NgModelController` for data-binding.\n *\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 * <example module=\"customControl\">\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', []).\n directive('contenteditable', function() {\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(ngModel.$viewValue || '');\n };\n\n // Listen for change events to enable binding\n element.on('blur keyup change', function() {\n scope.$apply(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=\"scenario.js\">\n it('should data-bind and become invalid', function() {\n var contentEditable = element('[contenteditable]');\n\n expect(contentEditable.text()).toEqual('Change me!');\n input('userContent').enter('');\n expect(contentEditable.text()).toEqual('');\n expect(contentEditable.prop('className')).toMatch(/ng-invalid-required/);\n });\n </file>\n * </example>\n *\n *\n */\nvar NgModelController = ['$scope', '$exceptionHandler', '$attrs', '$element', '$parse',\n function($scope, $exceptionHandler, $attr, $element, $parse) {\n this.$viewValue = Number.NaN;\n this.$modelValue = Number.NaN;\n this.$parsers = [];\n this.$formatters = [];\n this.$viewChangeListeners = [];\n this.$pristine = true;\n this.$dirty = false;\n this.$valid = true;\n this.$invalid = false;\n this.$name = $attr.name;\n\n var ngModelGet = $parse($attr.ngModel),\n ngModelSet = ngModelGet.assign;\n\n if (!ngModelSet) {\n throw minErr('ngModel')('nonassign', \"Expression '{0}' is non-assignable. Element: {1}\",\n $attr.ngModel, startingTag($element));\n }\n\n /**\n * @ngdoc function\n * @name ng.directive:ngModel.NgModelController#$render\n * @methodOf ng.directive:ngModel.NgModelController\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 this.$render = noop;\n\n /**\n * @ngdoc function\n * @name { ng.directive:ngModel.NgModelController#$isEmpty\n * @methodOf ng.directive:ngModel.NgModelController\n *\n * @description\n * This is called when we need to determine if the value of the input is empty.\n *\n * For instance, the required directive does this to work out if the input has data or not.\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 this.$isEmpty = function(value) {\n return isUndefined(value) || value === '' || value === null || value !== value;\n };\n\n var parentForm = $element.inheritedData('$formController') || nullFormCtrl,\n invalidCount = 0, // used to easily determine if we are valid\n $error = this.$error = {}; // keep invalid keys here\n\n\n // Setup initial state of the control\n $element.addClass(PRISTINE_CLASS);\n toggleValidCss(true);\n\n // convenience method for easy toggling of classes\n function toggleValidCss(isValid, validationErrorKey) {\n validationErrorKey = validationErrorKey ? '-' + snake_case(validationErrorKey, '-') : '';\n $element.\n removeClass((isValid ? INVALID_CLASS : VALID_CLASS) + validationErrorKey).\n addClass((isValid ? VALID_CLASS : INVALID_CLASS) + validationErrorKey);\n }\n\n /**\n * @ngdoc function\n * @name ng.directive:ngModel.NgModelController#$setValidity\n * @methodOf ng.directive:ngModel.NgModelController\n *\n * @description\n * Change the validity state, and notifies the form when the control changes validity. (i.e. it\n * does not notify form if given validator is already marked as invalid).\n *\n * This method should be called by validators - i.e. the parser or formatter functions.\n *\n * @param {string} validationErrorKey Name of the validator. the `validationErrorKey` will assign\n * to `$error[validationErrorKey]=isValid` 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) or invalid (false).\n */\n this.$setValidity = function(validationErrorKey, isValid) {\n // Purposeful use of ! here to cast isValid to boolean in case it is undefined\n // jshint -W018\n if ($error[validationErrorKey] === !isValid) return;\n // jshint +W018\n\n if (isValid) {\n if ($error[validationErrorKey]) invalidCount--;\n if (!invalidCount) {\n toggleValidCss(true);\n this.$valid = true;\n this.$invalid = false;\n }\n } else {\n toggleValidCss(false);\n this.$invalid = true;\n this.$valid = false;\n invalidCount++;\n }\n\n $error[validationErrorKey] = !isValid;\n toggleValidCss(isValid, validationErrorKey);\n\n parentForm.$setValidity(validationErrorKey, isValid, this);\n };\n\n /**\n * @ngdoc function\n * @name ng.directive:ngModel.NgModelController#$setPristine\n * @methodOf ng.directive:ngModel.NgModelController\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).\n */\n this.$setPristine = function () {\n this.$dirty = false;\n this.$pristine = true;\n $element.removeClass(DIRTY_CLASS).addClass(PRISTINE_CLASS);\n };\n\n /**\n * @ngdoc function\n * @name ng.directive:ngModel.NgModelController#$setViewValue\n * @methodOf ng.directive:ngModel.NgModelController\n *\n * @description\n * Update the view value.\n *\n * This method should be called when the view value changes, typically from within a DOM event handler.\n * For example {@link ng.directive:input input} and\n * {@link ng.directive:select select} directives call it.\n *\n * It will update the $viewValue, then pass this value through each of the functions in `$parsers`,\n * which includes any validators. The value that comes out of this `$parsers` pipeline, be applied to\n * `$modelValue` and the **expression** specified in the `ng-model` attribute.\n *\n * Lastly, all the registered change listeners, in the `$viewChangeListeners` list, are called.\n *\n * Note that calling this function does not trigger a `$digest`.\n *\n * @param {string} value Value from the view.\n */\n this.$setViewValue = function(value) {\n this.$viewValue = value;\n\n // change to dirty\n if (this.$pristine) {\n this.$dirty = true;\n this.$pristine = false;\n $element.removeClass(PRISTINE_CLASS).addClass(DIRTY_CLASS);\n parentForm.$setDirty();\n }\n\n forEach(this.$parsers, function(fn) {\n value = fn(value);\n });\n\n if (this.$modelValue !== value) {\n this.$modelValue = value;\n ngModelSet($scope, value);\n forEach(this.$viewChangeListeners, function(listener) {\n try {\n listener();\n } catch(e) {\n $exceptionHandler(e);\n }\n });\n }\n };\n\n // model -> value\n var ctrl = this;\n\n $scope.$watch(function ngModelWatch() {\n var value = ngModelGet($scope);\n\n // if scope model value and ngModel value are out of sync\n if (ctrl.$modelValue !== value) {\n\n var formatters = ctrl.$formatters,\n idx = formatters.length;\n\n ctrl.$modelValue = value;\n while(idx--) {\n value = formatters[idx](value);\n }\n\n if (ctrl.$viewValue !== value) {\n ctrl.$viewValue = value;\n ctrl.$render();\n }\n }\n\n return value;\n });\n}];\n\n\n/**\n * @ngdoc directive\n * @name ng.directive:ngModel\n *\n * @element input\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 ng.directive: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, validation errors).\n * - Setting related css classes on the element (`ng-valid`, `ng-invalid`, `ng-dirty`, `ng-pristine`).\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 * - {@link 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 ng.directive:input.text text}\n * - {@link ng.directive:input.checkbox checkbox}\n * - {@link ng.directive:input.radio radio}\n * - {@link ng.directive:input.number number}\n * - {@link ng.directive:input.email email}\n * - {@link ng.directive:input.url url}\n * - {@link ng.directive:select select}\n * - {@link ng.directive:textarea textarea}\n *\n */\nvar ngModelDirective = function() {\n return {\n require: ['ngModel', '^?form'],\n controller: NgModelController,\n link: function(scope, element, attr, ctrls) {\n // notify others, especially parent forms\n\n var modelCtrl = ctrls[0],\n formCtrl = ctrls[1] || nullFormCtrl;\n\n formCtrl.$addControl(modelCtrl);\n\n scope.$on('$destroy', function() {\n formCtrl.$removeControl(modelCtrl);\n });\n }\n };\n};\n\n\n/**\n * @ngdoc directive\n * @name ng.directive:ngChange\n *\n * @description\n * Evaluate given expression when user changes the input.\n * The expression is not evaluated when the value change is coming from the model.\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 * <doc:example>\n * <doc:source>\n * <script>\n * function Controller($scope) {\n * $scope.counter = 0;\n * $scope.change = function() {\n * $scope.counter++;\n * };\n * }\n * </script>\n * <div ng-controller=\"Controller\">\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 * debug = {{confirmed}}<br />\n * counter = {{counter}}\n * </div>\n * </doc:source>\n * <doc:scenario>\n * it('should evaluate the expression if changing from view', function() {\n * expect(binding('counter')).toEqual('0');\n * element('#ng-change-example1').click();\n * expect(binding('counter')).toEqual('1');\n * expect(binding('confirmed')).toEqual('true');\n * });\n *\n * it('should not evaluate the expression if changing from model', function() {\n * element('#ng-change-example2').click();\n * expect(binding('counter')).toEqual('0');\n * expect(binding('confirmed')).toEqual('true');\n * });\n * </doc:scenario>\n * </doc:example>\n */\nvar ngChangeDirective = valueFn({\n require: 'ngModel',\n link: function(scope, element, attr, ctrl) {\n ctrl.$viewChangeListeners.push(function() {\n scope.$eval(attr.ngChange);\n });\n }\n});\n\n\nvar requiredDirective = function() {\n return {\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 var validator = function(value) {\n if (attr.required && ctrl.$isEmpty(value)) {\n ctrl.$setValidity('required', false);\n return;\n } else {\n ctrl.$setValidity('required', true);\n return value;\n }\n };\n\n ctrl.$formatters.push(validator);\n ctrl.$parsers.unshift(validator);\n\n attr.$observe('required', function() {\n validator(ctrl.$viewValue);\n });\n }\n };\n};\n\n\n/**\n * @ngdoc directive\n * @name ng.directive:ngList\n *\n * @description\n * Text input that converts between a delimited string and an array of strings. The delimiter\n * can be a fixed string (by default a comma) or a regular expression.\n *\n * @element input\n * @param {string=} ngList optional delimiter that should be used to split the value. If\n * specified in form `/something/` then the value will be converted into a regular expression.\n *\n * @example\n <doc:example>\n <doc:source>\n <script>\n function Ctrl($scope) {\n $scope.names = ['igor', 'misko', 'vojta'];\n }\n </script>\n <form name=\"myForm\" ng-controller=\"Ctrl\">\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 </doc:source>\n <doc:scenario>\n it('should initialize to model', function() {\n expect(binding('names')).toEqual('[\"igor\",\"misko\",\"vojta\"]');\n expect(binding('myForm.namesInput.$valid')).toEqual('true');\n expect(element('span.error').css('display')).toBe('none');\n });\n\n it('should be invalid if empty', function() {\n input('names').enter('');\n expect(binding('names')).toEqual('');\n expect(binding('myForm.namesInput.$valid')).toEqual('false');\n expect(element('span.error').css('display')).not().toBe('none');\n });\n </doc:scenario>\n </doc:example>\n */\nvar ngListDirective = function() {\n return {\n require: 'ngModel',\n link: function(scope, element, attr, ctrl) {\n var match = /\\/(.*)\\//.exec(attr.ngList),\n separator = match && new RegExp(match[1]) || attr.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(trim(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(', ');\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\nvar CONSTANT_VALUE_REGEXP = /^(true|false|\\d+)$/;\n/**\n * @ngdoc directive\n * @name ng.directive:ngValue\n *\n * @description\n * Binds the given expression to the value of `input[select]` or `input[radio]`, so\n * that when the element is selected, the `ngModel` of that element is set to the\n * bound value.\n *\n * `ngValue` is useful when dynamically generating lists of radio buttons using `ng-repeat`, as\n * shown below.\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 <doc:example>\n <doc:source>\n <script>\n function Ctrl($scope) {\n $scope.names = ['pizza', 'unicorns', 'robots'];\n $scope.my = { favorite: 'unicorns' };\n }\n </script>\n <form ng-controller=\"Ctrl\">\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 </doc:source>\n <doc:scenario>\n it('should initialize to model', function() {\n expect(binding('my.favorite')).toEqual('unicorns');\n });\n it('should bind the values to the inputs', function() {\n input('my.favorite').select('pizza');\n expect(binding('my.favorite')).toEqual('pizza');\n });\n </doc:scenario>\n </doc:example>\n */\nvar ngValueDirective = function() {\n return {\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 ng.directive: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 preferrable to use `ngBind` instead of `{{ expression }}` when 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 <doc:example>\n <doc:source>\n <script>\n function Ctrl($scope) {\n $scope.name = 'Whirled';\n }\n </script>\n <div ng-controller=\"Ctrl\">\n Enter name: <input type=\"text\" ng-model=\"name\"><br>\n Hello <span ng-bind=\"name\"></span>!\n </div>\n </doc:source>\n <doc:scenario>\n it('should check ng-bind', function() {\n expect(using('.doc-example-live').binding('name')).toBe('Whirled');\n using('.doc-example-live').input('name').enter('world');\n expect(using('.doc-example-live').binding('name')).toBe('world');\n });\n </doc:scenario>\n </doc:example>\n */\nvar ngBindDirective = ngDirective(function(scope, element, attr) {\n element.addClass('ng-binding').data('$binding', attr.ngBind);\n scope.$watch(attr.ngBind, function ngBindWatchAction(value) {\n // We are purposefully using == here rather than === because we want to\n // catch when value is \"null or undefined\"\n // jshint -W041\n element.text(value == undefined ? '' : value);\n });\n});\n\n\n/**\n * @ngdoc directive\n * @name ng.directive: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 <doc:example>\n <doc:source>\n <script>\n function Ctrl($scope) {\n $scope.salutation = 'Hello';\n $scope.name = 'World';\n }\n </script>\n <div ng-controller=\"Ctrl\">\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 </doc:source>\n <doc:scenario>\n it('should check ng-bind', function() {\n expect(using('.doc-example-live').binding('salutation')).\n toBe('Hello');\n expect(using('.doc-example-live').binding('name')).\n toBe('World');\n using('.doc-example-live').input('salutation').enter('Greetings');\n using('.doc-example-live').input('name').enter('user');\n expect(using('.doc-example-live').binding('salutation')).\n toBe('Greetings');\n expect(using('.doc-example-live').binding('name')).\n toBe('user');\n });\n </doc:scenario>\n </doc:example>\n */\nvar ngBindTemplateDirective = ['$interpolate', function($interpolate) {\n return function(scope, element, attr) {\n // TODO: move this to scenario runner\n var interpolateFn = $interpolate(element.attr(attr.$attr.ngBindTemplate));\n element.addClass('ng-binding').data('$binding', interpolateFn);\n attr.$observe('ngBindTemplate', function(value) {\n element.text(value);\n });\n };\n}];\n\n\n/**\n * @ngdoc directive\n * @name ng.directive:ngBindHtml\n *\n * @description\n * Creates a binding that will innerHTML the result of evaluating the `expression` into the current\n * element in a secure way. By default, the innerHTML-ed content will be sanitized using the {@link\n * ngSanitize.$sanitize $sanitize} service. To utilize this functionality, ensure that `$sanitize`\n * is available, for example, by including {@link ngSanitize} in your module's dependencies (not in\n * core Angular.) 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#methods_trustAsHtml $sce.trustAsHtml}. See the example\n * under {@link ng.$sce#Example 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 Try it here: enter text in text box and watch the greeting change.\n \n <example module=\"ngBindHtmlExample\" deps=\"angular-sanitize.js\">\n <file name=\"index.html\">\n <div ng-controller=\"ngBindHtmlCtrl\">\n <p ng-bind-html=\"myHTML\"></p>\n </div>\n </file>\n \n <file name=\"script.js\">\n angular.module('ngBindHtmlExample', ['ngSanitize'])\n\n .controller('ngBindHtmlCtrl', ['$scope', function ngBindHtmlCtrl($scope) {\n $scope.myHTML =\n 'I am an <code>HTML</code>string with <a href=\"#\">links!</a> and other <em>stuff</em>';\n }]);\n </file>\n\n <file name=\"scenario.js\">\n it('should check ng-bind-html', function() {\n expect(using('.doc-example-live').binding('myHTML')).\n toBe(\n 'I am an <code>HTML</code>string with <a href=\"#\">links!</a> and other <em>stuff</em>'\n );\n });\n </file>\n </example>\n */\nvar ngBindHtmlDirective = ['$sce', '$parse', function($sce, $parse) {\n return function(scope, element, attr) {\n element.addClass('ng-binding').data('$binding', attr.ngBindHtml);\n\n var parsed = $parse(attr.ngBindHtml);\n function getStringValue() { return (parsed(scope) || '').toString(); }\n\n scope.$watch(getStringValue, function ngBindHtmlWatchAction(value) {\n element.html($sce.getTrustedHtml(parsed(scope)) || '');\n });\n };\n}];\n\nfunction classDirective(name, selector) {\n name = 'ngClass' + name;\n return function() {\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 = flattenClasses(scope.$eval(attr[name]));\n mod === selector ?\n attr.$addClass(classes) :\n attr.$removeClass(classes);\n }\n });\n }\n\n\n function ngClassWatchAction(newVal) {\n if (selector === true || scope.$index % 2 === selector) {\n var newClasses = flattenClasses(newVal || '');\n if(!oldVal) {\n attr.$addClass(newClasses);\n } else if(!equals(newVal,oldVal)) {\n attr.$updateClass(newClasses, flattenClasses(oldVal));\n }\n }\n oldVal = copy(newVal);\n }\n\n\n function flattenClasses(classVal) {\n if(isArray(classVal)) {\n return classVal.join(' ');\n } else if (isObject(classVal)) {\n var classes = [], i = 0;\n forEach(classVal, function(v, k) {\n if (v) {\n classes.push(k);\n }\n });\n return classes.join(' ');\n }\n\n return classVal;\n }\n }\n };\n };\n}\n\n/**\n * @ngdoc directive\n * @name ng.directive: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 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 element\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=\"scenario.js\">\n it('should let you toggle the class', function() {\n\n expect(element('.doc-example-live p:first').prop('className')).not().toMatch(/bold/);\n expect(element('.doc-example-live p:first').prop('className')).not().toMatch(/red/);\n\n input('important').check();\n expect(element('.doc-example-live p:first').prop('className')).toMatch(/bold/);\n\n input('error').check();\n expect(element('.doc-example-live p:first').prop('className')).toMatch(/red/);\n });\n\n it('should let you toggle string example', function() {\n expect(element('.doc-example-live p:nth-of-type(2)').prop('className')).toBe('');\n input('style').enter('red');\n expect(element('.doc-example-live p:nth-of-type(2)').prop('className')).toBe('red');\n });\n\n it('array example should have 3 classes', function() {\n expect(element('.doc-example-live p:last').prop('className')).toBe('');\n input('style1').enter('bold');\n input('style2').enter('strike');\n input('style3').enter('red');\n expect(element('.doc-example-live p:last').prop('className')).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 animations=\"true\">\n <file name=\"index.html\">\n <input type=\"button\" value=\"set\" ng-click=\"myVar='my-class'\">\n <input 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=\"scenario.js\">\n it('should check ng-class', function() {\n expect(element('.doc-example-live span').prop('className')).not().\n toMatch(/my-class/);\n\n using('.doc-example-live').element(':button:first').click();\n\n expect(element('.doc-example-live span').prop('className')).\n toMatch(/my-class/);\n\n using('.doc-example-live').element(':button:last').click();\n\n expect(element('.doc-example-live span').prop('className')).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 ngAnimate.$animate#methods_addclass $animate.addClass} and\n {@link ngAnimate.$animate#methods_removeclass $animate.removeClass}.\n */\nvar ngClassDirective = classDirective('', true);\n\n/**\n * @ngdoc directive\n * @name ng.directive: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=\"scenario.js\">\n it('should check ng-class-odd and ng-class-even', function() {\n expect(element('.doc-example-live li:first span').prop('className')).\n toMatch(/odd/);\n expect(element('.doc-example-live li:last span').prop('className')).\n toMatch(/even/);\n });\n </file>\n </example>\n */\nvar ngClassOddDirective = classDirective('Odd', 0);\n\n/**\n * @ngdoc directive\n * @name ng.directive: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}} \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=\"scenario.js\">\n it('should check ng-class-odd and ng-class-even', function() {\n expect(element('.doc-example-live li:first span').prop('className')).\n toMatch(/odd/);\n expect(element('.doc-example-live li:last span').prop('className')).\n toMatch(/even/);\n });\n </file>\n </example>\n */\nvar ngClassEvenDirective = classDirective('Even', 1);\n\n/**\n * @ngdoc directive\n * @name ng.directive: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 * <pre>\n * [ng\\:cloak], [ng-cloak], [data-ng-cloak], [x-ng-cloak], .ng-cloak, .x-ng-cloak {\n * display: none !important;\n * }\n * </pre>\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 `ngCloak` in addition to the `ngCloak` directive as shown in the example below.\n *\n * @element ANY\n *\n * @example\n <doc:example>\n <doc:source>\n <div id=\"template1\" ng-cloak>{{ 'hello' }}</div>\n <div id=\"template2\" ng-cloak class=\"ng-cloak\">{{ 'hello IE7' }}</div>\n </doc:source>\n <doc:scenario>\n it('should remove the template directive and css class', function() {\n expect(element('.doc-example-live #template1').attr('ng-cloak')).\n not().toBeDefined();\n expect(element('.doc-example-live #template2').attr('ng-cloak')).\n not().toBeDefined();\n });\n </doc:scenario>\n </doc: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 ng.directive: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 — The Model is scope properties; 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 * @param {expression} ngController Name of a globally accessible constructor function or an\n * {@link guide/expression expression} that on the current scope evaluates to a\n * constructor function. The controller instance can be published into a scope property\n * by specifying `as propertyName`.\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. Notice that the scope becomes the `this` for the\n * controller's instance. This allows for easy access to the view data from the controller. Also\n * notice that any changes to the data are automatically reflected in the View without the need\n * for a manual update. The example is shown in two different declaration styles you may use\n * according to preference.\n <doc:example>\n <doc:source>\n <script>\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 </script>\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 </doc:source>\n <doc:scenario>\n it('should check controller as', function() {\n expect(element('#ctrl-as-exmpl>:input').val()).toBe('John Smith');\n expect(element('#ctrl-as-exmpl li:nth-child(1) input').val())\n .toBe('408 555 1212');\n expect(element('#ctrl-as-exmpl li:nth-child(2) input').val())\n .toBe('john.smith@example.org');\n\n element('#ctrl-as-exmpl li:first a:contains(\"clear\")').click();\n expect(element('#ctrl-as-exmpl li:first input').val()).toBe('');\n\n element('#ctrl-as-exmpl li:last a:contains(\"add\")').click();\n expect(element('#ctrl-as-exmpl li:nth-child(3) input').val())\n .toBe('yourname@example.org');\n });\n </doc:scenario>\n </doc:example>\n <doc:example>\n <doc:source>\n <script>\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(this.name);\n };\n\n $scope.addContact = function() {\n this.contacts.push({type:'email', value:'yourname@example.org'});\n };\n\n $scope.removeContact = function(contactToRemove) {\n var index = this.contacts.indexOf(contactToRemove);\n this.contacts.splice(index, 1);\n };\n\n $scope.clearContact = function(contact) {\n contact.type = 'phone';\n contact.value = '';\n };\n }\n </script>\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 </doc:source>\n <doc:scenario>\n it('should check controller', function() {\n expect(element('#ctrl-exmpl>:input').val()).toBe('John Smith');\n expect(element('#ctrl-exmpl li:nth-child(1) input').val())\n .toBe('408 555 1212');\n expect(element('#ctrl-exmpl li:nth-child(2) input').val())\n .toBe('john.smith@example.org');\n\n element('#ctrl-exmpl li:first a:contains(\"clear\")').click();\n expect(element('#ctrl-exmpl li:first input').val()).toBe('');\n\n element('#ctrl-exmpl li:last a:contains(\"add\")').click();\n expect(element('#ctrl-exmpl li:nth-child(3) input').val())\n .toBe('yourname@example.org');\n });\n </doc:scenario>\n </doc:example>\n\n */\nvar ngControllerDirective = [function() {\n return {\n scope: true,\n controller: '@',\n priority: 500\n };\n}];\n\n/**\n * @ngdoc directive\n * @name ng.directive: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.\n *\n * CSP forbids apps to use `eval` or `Function(string)` generated functions (among other things).\n * For us to be compatible, we just need to implement the \"getterFn\" in $parse without violating\n * any of these restrictions.\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 * In order to use this feature put the `ngCsp` directive on the root element of the application.\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 <pre>\n <!doctype html>\n <html ng-app ng-csp>\n ...\n ...\n </html>\n </pre>\n */\n\n// ngCsp is not implemented as a proper directive any more, because we need it be processed while we bootstrap\n// the system (before $parse is instantiated), for this reason we just have a csp() fn that looks for ng-csp attribute\n// anywhere in the current doc\n\n/**\n * @ngdoc directive\n * @name ng.directive: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 * @param {expression} ngClick {@link guide/expression Expression} to evaluate upon\n * click. (Event object is available as `$event`)\n *\n * @example\n <doc:example>\n <doc:source>\n <button ng-click=\"count = count + 1\" ng-init=\"count=0\">\n Increment\n </button>\n count: {{count}}\n </doc:source>\n <doc:scenario>\n it('should check ng-click', function() {\n expect(binding('count')).toBe('0');\n element('.doc-example-live :button').click();\n expect(binding('count')).toBe('1');\n });\n </doc:scenario>\n </doc:example>\n */\n/*\n * A directive that allows creation of custom onclick handlers that are defined as angular\n * expressions and are compiled and executed within the current scope.\n *\n * Events that are handled via these handler are always configured not to propagate further.\n */\nvar ngEventDirectives = {};\nforEach(\n 'click dblclick mousedown mouseup mouseover mouseout mousemove mouseenter mouseleave keydown keyup keypress submit focus blur copy cut paste'.split(' '),\n function(name) {\n var directiveName = directiveNormalize('ng-' + name);\n ngEventDirectives[directiveName] = ['$parse', function($parse) {\n return {\n compile: function($element, attr) {\n var fn = $parse(attr[directiveName]);\n return function(scope, element, attr) {\n element.on(lowercase(name), function(event) {\n scope.$apply(function() {\n fn(scope, {$event:event});\n });\n });\n };\n }\n };\n }];\n }\n);\n\n/**\n * @ngdoc directive\n * @name ng.directive:ngDblclick\n *\n * @description\n * The `ngDblclick` directive allows you to specify custom behavior on a dblclick event.\n *\n * @element ANY\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 * See {@link ng.directive:ngClick ngClick}\n */\n\n\n/**\n * @ngdoc directive\n * @name ng.directive:ngMousedown\n *\n * @description\n * The ngMousedown directive allows you to specify custom behavior on mousedown event.\n *\n * @element ANY\n * @param {expression} ngMousedown {@link guide/expression Expression} to evaluate upon\n * mousedown. (Event object is available as `$event`)\n *\n * @example\n * See {@link ng.directive:ngClick ngClick}\n */\n\n\n/**\n * @ngdoc directive\n * @name ng.directive:ngMouseup\n *\n * @description\n * Specify custom behavior on mouseup event.\n *\n * @element ANY\n * @param {expression} ngMouseup {@link guide/expression Expression} to evaluate upon\n * mouseup. (Event object is available as `$event`)\n *\n * @example\n * See {@link ng.directive:ngClick ngClick}\n */\n\n/**\n * @ngdoc directive\n * @name ng.directive:ngMouseover\n *\n * @description\n * Specify custom behavior on mouseover event.\n *\n * @element ANY\n * @param {expression} ngMouseover {@link guide/expression Expression} to evaluate upon\n * mouseover. (Event object is available as `$event`)\n *\n * @example\n * See {@link ng.directive:ngClick ngClick}\n */\n\n\n/**\n * @ngdoc directive\n * @name ng.directive:ngMouseenter\n *\n * @description\n * Specify custom behavior on mouseenter event.\n *\n * @element ANY\n * @param {expression} ngMouseenter {@link guide/expression Expression} to evaluate upon\n * mouseenter. (Event object is available as `$event`)\n *\n * @example\n * See {@link ng.directive:ngClick ngClick}\n */\n\n\n/**\n * @ngdoc directive\n * @name ng.directive:ngMouseleave\n *\n * @description\n * Specify custom behavior on mouseleave event.\n *\n * @element ANY\n * @param {expression} ngMouseleave {@link guide/expression Expression} to evaluate upon\n * mouseleave. (Event object is available as `$event`)\n *\n * @example\n * See {@link ng.directive:ngClick ngClick}\n */\n\n\n/**\n * @ngdoc directive\n * @name ng.directive:ngMousemove\n *\n * @description\n * Specify custom behavior on mousemove event.\n *\n * @element ANY\n * @param {expression} ngMousemove {@link guide/expression Expression} to evaluate upon\n * mousemove. (Event object is available as `$event`)\n *\n * @example\n * See {@link ng.directive:ngClick ngClick}\n */\n\n\n/**\n * @ngdoc directive\n * @name ng.directive:ngKeydown\n *\n * @description\n * Specify custom behavior on keydown event.\n *\n * @element ANY\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 * See {@link ng.directive:ngClick ngClick}\n */\n\n\n/**\n * @ngdoc directive\n * @name ng.directive:ngKeyup\n *\n * @description\n * Specify custom behavior on keyup event.\n *\n * @element ANY\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 * See {@link ng.directive:ngClick ngClick}\n */\n\n\n/**\n * @ngdoc directive\n * @name ng.directive: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. (Event object is available as `$event` and can be interrogated for keyCode, altKey, etc.)\n *\n * @example\n * See {@link ng.directive:ngClick ngClick}\n */\n\n\n/**\n * @ngdoc directive\n * @name ng.directive: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 an `action`\n * attribute**.\n *\n * @element form\n * @param {expression} ngSubmit {@link guide/expression Expression} to eval. (Event object is available as `$event`)\n *\n * @example\n <doc:example>\n <doc:source>\n <script>\n function Ctrl($scope) {\n $scope.list = [];\n $scope.text = 'hello';\n $scope.submit = function() {\n if (this.text) {\n this.list.push(this.text);\n this.text = '';\n }\n };\n }\n </script>\n <form ng-submit=\"submit()\" ng-controller=\"Ctrl\">\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 </doc:source>\n <doc:scenario>\n it('should check ng-submit', function() {\n expect(binding('list')).toBe('[]');\n element('.doc-example-live #submit').click();\n expect(binding('list')).toBe('[\"hello\"]');\n expect(input('text').val()).toBe('');\n });\n it('should ignore empty strings', function() {\n expect(binding('list')).toBe('[]');\n element('.doc-example-live #submit').click();\n element('.doc-example-live #submit').click();\n expect(binding('list')).toBe('[\"hello\"]');\n });\n </doc:scenario>\n </doc:example>\n */\n\n/**\n * @ngdoc directive\n * @name ng.directive:ngFocus\n *\n * @description\n * Specify custom behavior on focus event.\n *\n * @element window, input, select, textarea, a\n * @param {expression} ngFocus {@link guide/expression Expression} to evaluate upon\n * focus. (Event object is available as `$event`)\n *\n * @example\n * See {@link ng.directive:ngClick ngClick}\n */\n\n/**\n * @ngdoc directive\n * @name ng.directive:ngBlur\n *\n * @description\n * Specify custom behavior on blur event.\n *\n * @element window, input, select, textarea, a\n * @param {expression} ngBlur {@link guide/expression Expression} to evaluate upon\n * blur. (Event object is available as `$event`)\n *\n * @example\n * See {@link ng.directive:ngClick ngClick}\n */\n\n/**\n * @ngdoc directive\n * @name ng.directive:ngCopy\n *\n * @description\n * Specify custom behavior on copy event.\n *\n * @element window, input, select, textarea, a\n * @param {expression} ngCopy {@link guide/expression Expression} to evaluate upon\n * copy. (Event object is available as `$event`)\n *\n * @example\n * See {@link ng.directive:ngClick ngClick}\n */\n\n/**\n * @ngdoc directive\n * @name ng.directive:ngCut\n *\n * @description\n * Specify custom behavior on cut event.\n *\n * @element window, input, select, textarea, a\n * @param {expression} ngCut {@link guide/expression Expression} to evaluate upon\n * cut. (Event object is available as `$event`)\n *\n * @example\n * See {@link ng.directive:ngClick ngClick}\n */\n\n/**\n * @ngdoc directive\n * @name ng.directive:ngPaste\n *\n * @description\n * Specify custom behavior on paste event.\n *\n * @element window, input, select, textarea, a\n * @param {expression} ngPaste {@link guide/expression Expression} to evaluate upon\n * paste. (Event object is available as `$event`)\n *\n * @example\n * See {@link ng.directive:ngClick ngClick}\n */\n\n/**\n * @ngdoc directive\n * @name ng.directive: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 * {@link https://github.com/angular/angular.js/wiki/The-Nuances-of-Scope-Prototypal-Inheritance 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 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 I'm 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 /*\n The transition styles can also be placed on the CSS base class above\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 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;\n $scope.$watch($attr.ngIf, function ngIfWatchAction(value) {\n\n if (toBoolean(value)) {\n if (!childScope) {\n childScope = $scope.$new();\n $transclude(childScope, function (clone) {\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 it's template arrives.\n block = {\n clone: clone\n };\n $animate.enter(clone, $element.parent(), $element);\n });\n }\n } else {\n\n if (childScope) {\n childScope.$destroy();\n childScope = null;\n }\n\n if (block) {\n $animate.leave(getBlockElements(block.clone));\n block = null;\n }\n }\n });\n }\n };\n}];\n\n/**\n * @ngdoc directive\n * @name ng.directive: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 ng.$sce#methods_getTrustedResourceUrl\n * $sce.getTrustedResourceUrl} on it. To load templates from other domains or protocols\n * you may either {@link ng.$sceDelegateProvider#methods_resourceUrlWhitelist whitelist them} or\n * {@link ng.$sce#methods_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 * {@link https://code.google.com/p/browsersec/wiki/Part2#Same-origin_policy_for_XMLHttpRequest\n * Same Origin Policy} and {@link http://www.w3.org/TR/cors/ Cross-Origin Resource Sharing\n * (CORS)} 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 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 animations=\"true\">\n <file name=\"index.html\">\n <div ng-controller=\"Ctrl\">\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: <tt>{{template.url}}</tt>\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 function Ctrl($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=\"scenario.js\">\n it('should load template1.html', function() {\n expect(element('.doc-example-live [ng-include]').text()).\n toMatch(/Content of template1.html/);\n });\n it('should load template2.html', function() {\n select('template').option('1');\n expect(element('.doc-example-live [ng-include]').text()).\n toMatch(/Content of template2.html/);\n });\n it('should change to blank', function() {\n select('template').option('');\n expect(element('.doc-example-live [ng-include]')).toBe(undefined);\n });\n </file>\n </example>\n */\n\n\n/**\n * @ngdoc event\n * @name ng.directive:ngInclude#$includeContentRequested\n * @eventOf ng.directive:ngInclude\n * @eventType emit on the scope ngInclude was declared in\n * @description\n * Emitted every time the ngInclude content is requested.\n */\n\n\n/**\n * @ngdoc event\n * @name ng.directive:ngInclude#$includeContentLoaded\n * @eventOf ng.directive:ngInclude\n * @eventType emit on the current ngInclude scope\n * @description\n * Emitted every time the ngInclude content is reloaded.\n */\nvar ngIncludeDirective = ['$http', '$templateCache', '$anchorScroll', '$animate', '$sce',\n function($http, $templateCache, $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 currentElement;\n\n var cleanupLastIncludeContent = function() {\n if (currentScope) {\n currentScope.$destroy();\n currentScope = null;\n }\n if(currentElement) {\n $animate.leave(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 $http.get(src, {cache: $templateCache}).success(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, afterAnimation);\n });\n\n currentScope = newScope;\n currentElement = clone;\n\n currentScope.$emit('$includeContentLoaded');\n scope.$eval(onloadExp);\n }).error(function() {\n if (thisChangeId === changeCounter) cleanupLastIncludeContent();\n });\n scope.$emit('$includeContentRequested');\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 $element.html(ctrl.template);\n $compile($element.contents())(scope);\n }\n };\n }];\n\n/**\n * @ngdoc directive\n * @name ng.directive: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` for aliasing special properties of\n * {@link api/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 *\n * @priority 450\n *\n * @element ANY\n * @param {expression} ngInit {@link guide/expression Expression} to eval.\n *\n * @example\n <doc:example>\n <doc:source>\n <script>\n function Ctrl($scope) {\n $scope.list = [['a', 'b'], ['c', 'd']];\n }\n </script>\n <div ng-controller=\"Ctrl\">\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 </doc:source>\n <doc:scenario>\n it('should alias index positions', function() {\n expect(element('.example-init').text())\n .toBe('list[ 0 ][ 0 ] = a;' +\n 'list[ 0 ][ 1 ] = b;' +\n 'list[ 1 ][ 0 ] = c;' +\n 'list[ 1 ][ 1 ] = d;');\n });\n </doc:scenario>\n </doc: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 ng.directive: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 <doc:example>\n <doc:source>\n <div>Normal: {{1 + 2}}</div>\n <div ng-non-bindable>Ignored: {{1 + 2}}</div>\n </doc:source>\n <doc:scenario>\n it('should check ng-non-bindable', function() {\n expect(using('.doc-example-live').binding('1 + 2')).toBe('3');\n expect(using('.doc-example-live').element('div:last').text()).\n toMatch(/1 \\+ 2/);\n });\n </doc:scenario>\n </doc:example>\n */\nvar ngNonBindableDirective = ngDirective({ terminal: true, priority: 1000 });\n\n/**\n * @ngdoc directive\n * @name ng.directive:ngPluralize\n * @restrict EA\n *\n * @description\n * # Overview\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 * {@link http://unicode.org/repos/cldr-tmp/trunk/diff/supplemental/language_plural_rules.html\n * plural categories} and the strings to be displayed.\n *\n * # Plural categories and explicit number rules\n * There are two\n * {@link http://unicode.org/repos/cldr-tmp/trunk/diff/supplemental/language_plural_rules.html\n * plural categories} 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 * <pre>\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 *</pre>\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 * <pre>\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 * </pre>\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, Marry 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 bounded 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 <doc:example>\n <doc:source>\n <script>\n function Ctrl($scope) {\n $scope.person1 = 'Igor';\n $scope.person2 = 'Misko';\n $scope.personCount = 1;\n }\n </script>\n <div ng-controller=\"Ctrl\">\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 </doc:source>\n <doc:scenario>\n it('should show correct pluralized string', function() {\n expect(element('.doc-example-live ng-pluralize:first').text()).\n toBe('1 person is viewing.');\n expect(element('.doc-example-live ng-pluralize:last').text()).\n toBe('Igor is viewing.');\n\n using('.doc-example-live').input('personCount').enter('0');\n expect(element('.doc-example-live ng-pluralize:first').text()).\n toBe('Nobody is viewing.');\n expect(element('.doc-example-live ng-pluralize:last').text()).\n toBe('Nobody is viewing.');\n\n using('.doc-example-live').input('personCount').enter('2');\n expect(element('.doc-example-live ng-pluralize:first').text()).\n toBe('2 people are viewing.');\n expect(element('.doc-example-live ng-pluralize:last').text()).\n toBe('Igor and Misko are viewing.');\n\n using('.doc-example-live').input('personCount').enter('3');\n expect(element('.doc-example-live ng-pluralize:first').text()).\n toBe('3 people are viewing.');\n expect(element('.doc-example-live ng-pluralize:last').text()).\n toBe('Igor, Misko and one other person are viewing.');\n\n using('.doc-example-live').input('personCount').enter('4');\n expect(element('.doc-example-live ng-pluralize:first').text()).\n toBe('4 people are viewing.');\n expect(element('.doc-example-live ng-pluralize:last').text()).\n toBe('Igor, Misko and 2 other people are viewing.');\n });\n\n it('should show data-binded names', function() {\n using('.doc-example-live').input('personCount').enter('4');\n expect(element('.doc-example-live ng-pluralize:last').text()).\n toBe('Igor, Misko and 2 other people are viewing.');\n\n using('.doc-example-live').input('person1').enter('Di');\n using('.doc-example-live').input('person2').enter('Vojta');\n expect(element('.doc-example-live ng-pluralize:last').text()).\n toBe('Di, Vojta and 2 other people are viewing.');\n });\n </doc:scenario>\n </doc:example>\n */\nvar ngPluralizeDirective = ['$locale', '$interpolate', function($locale, $interpolate) {\n var BRACE = /{}/g;\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 isWhen = /^when(Minus)?(.+)$/;\n\n forEach(attr, function(expression, attributeName) {\n if (isWhen.test(attributeName)) {\n whens[lowercase(attributeName.replace('when', '').replace('Minus', '-'))] =\n element.attr(attr.$attr[attributeName]);\n }\n });\n forEach(whens, function(expression, key) {\n whensExpFns[key] =\n $interpolate(expression.replace(BRACE, startSymbol + numberExp + '-' +\n offset + endSymbol));\n });\n\n scope.$watch(function ngPluralizeWatch() {\n var value = parseFloat(scope.$eval(numberExp));\n\n if (!isNaN(value)) {\n //if explicit number rule such as 1, 2, 3... is defined, just use it. Otherwise,\n //check it against pluralization rules in $locale service\n if (!(value in whens)) value = $locale.pluralCat(value - offset);\n return whensExpFns[value](scope, element, true);\n } else {\n return '';\n }\n }, function ngPluralizeWatchAction(newVal) {\n element.text(newVal);\n });\n }\n };\n}];\n\n/**\n * @ngdoc directive\n * @name ng.directive: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 *\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 * <pre>\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 * </pre>\n *\n * And with an input of {@type ['A','B']} for the items variable in the example above, the output will evaluate to:\n * <pre>\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 * </pre>\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 * leave - when an item is removed from the list or when an item is filtered out\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 * @example\n * This example initializes the scope to a list of names and\n * then uses `ngRepeat` to display every person:\n <example 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\">\n [{{$index + 1}}] {{friend.name}} who is {{friend.age}} years old.\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=\"scenario.js\">\n it('should render initial data set', function() {\n var r = using('.doc-example-live').repeater('ul li');\n expect(r.count()).toBe(10);\n expect(r.row(0)).toEqual([\"1\",\"John\",\"25\"]);\n expect(r.row(1)).toEqual([\"2\",\"Jessie\",\"30\"]);\n expect(r.row(9)).toEqual([\"10\",\"Samantha\",\"60\"]);\n expect(binding('friends.length')).toBe(\"10\");\n });\n\n it('should update repeater when filter predicate changes', function() {\n var r = using('.doc-example-live').repeater('ul li');\n expect(r.count()).toBe(10);\n\n input('q').enter('ma');\n\n expect(r.count()).toBe(2);\n expect(r.row(0)).toEqual([\"1\",\"Mary\",\"28\"]);\n expect(r.row(1)).toEqual([\"2\",\"Samantha\",\"60\"]);\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 return {\n transclude: 'element',\n priority: 1000,\n terminal: true,\n $$tlb: true,\n link: function($scope, $element, $attr, ctrl, $transclude){\n var expression = $attr.ngRepeat;\n var match = expression.match(/^\\s*(.+)\\s+in\\s+(.*?)\\s*(\\s+track\\s+by\\s+(.+)\\s*)?$/),\n trackByExp, trackByExpGetter, trackByIdExpFn, trackByIdArrayFn, trackByIdObjFn,\n lhs, rhs, valueIdentifier, keyIdentifier,\n hashFnLocals = {$id: hashKey};\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 lhs = match[1];\n rhs = match[2];\n trackByExp = match[4];\n\n if (trackByExp) {\n trackByExpGetter = $parse(trackByExp);\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 } else {\n trackByIdArrayFn = function(key, value) {\n return hashKey(value);\n };\n trackByIdObjFn = function(key) {\n return key;\n };\n }\n\n match = lhs.match(/^(?:([\\$\\w]+)|\\(([\\$\\w]+)\\s*,\\s*([\\$\\w]+)\\))$/);\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 valueIdentifier = match[3] || match[1];\n keyIdentifier = match[2];\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 var lastBlockMap = {};\n\n //watch props\n $scope.$watchCollection(rhs, function ngRepeatAction(collection){\n var index, length,\n previousNode = $element[0], // current position of the node\n nextNode,\n // Same as lastBlockMap but it has the current state. It will become the\n // lastBlockMap on the next iteration.\n nextBlockMap = {},\n arrayLength,\n childScope,\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\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 (key in collection) {\n if (collection.hasOwnProperty(key) && key.charAt(0) != '$') {\n collectionKeys.push(key);\n }\n }\n collectionKeys.sort();\n }\n\n arrayLength = collectionKeys.length;\n\n // locate existing items\n length = nextBlockOrder.length = collectionKeys.length;\n for(index = 0; index < length; index++) {\n key = (collection === collectionKeys) ? index : collectionKeys[index];\n value = collection[key];\n trackById = trackByIdFn(key, value, index);\n assertNotHasOwnProperty(trackById, '`track by` id');\n if(lastBlockMap.hasOwnProperty(trackById)) {\n block = lastBlockMap[trackById];\n delete lastBlockMap[trackById];\n nextBlockMap[trackById] = block;\n nextBlockOrder[index] = block;\n } else if (nextBlockMap.hasOwnProperty(trackById)) {\n // restore lastBlockMap\n forEach(nextBlockOrder, function(block) {\n if (block && block.scope) lastBlockMap[block.id] = block;\n });\n // This is a duplicate and we need to throw an error\n throw ngRepeatMinErr('dupes', \"Duplicates in a repeater are not allowed. Use 'track by' expression to specify unique keys. Repeater: {0}, Duplicate key: {1}\",\n expression, trackById);\n } else {\n // new never before seen block\n nextBlockOrder[index] = { id: trackById };\n nextBlockMap[trackById] = false;\n }\n }\n\n // remove existing items\n for (key in lastBlockMap) {\n // lastBlockMap is our own object so we don't need to use special hasOwnPropertyFn\n if (lastBlockMap.hasOwnProperty(key)) {\n block = lastBlockMap[key];\n elementsToRemove = getBlockElements(block.clone);\n $animate.leave(elementsToRemove);\n forEach(elementsToRemove, function(element) { element[NG_REMOVED] = true; });\n block.scope.$destroy();\n }\n }\n\n // we are not using forEach for perf reasons (trying to avoid #call)\n for (index = 0, length = collectionKeys.length; index < length; index++) {\n key = (collection === collectionKeys) ? index : collectionKeys[index];\n value = collection[key];\n block = nextBlockOrder[index];\n if (nextBlockOrder[index - 1]) previousNode = getBlockEnd(nextBlockOrder[index - 1]);\n\n if (block.scope) {\n // if we have already seen this object, then we need to reuse the\n // associated scope/element\n childScope = block.scope;\n\n nextNode = previousNode;\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(getBlockElements(block.clone), null, jqLite(previousNode));\n }\n previousNode = getBlockEnd(block);\n } else {\n // new item which we don't know about\n childScope = $scope.$new();\n }\n\n childScope[valueIdentifier] = value;\n if (keyIdentifier) childScope[keyIdentifier] = key;\n childScope.$index = index;\n childScope.$first = (index === 0);\n childScope.$last = (index === (arrayLength - 1));\n childScope.$middle = !(childScope.$first || childScope.$last);\n // jshint bitwise: false\n childScope.$odd = !(childScope.$even = (index&1) === 0);\n // jshint bitwise: true\n\n if (!block.scope) {\n $transclude(childScope, function(clone) {\n clone[clone.length++] = document.createComment(' end ngRepeat: ' + expression + ' ');\n $animate.enter(clone, null, jqLite(previousNode));\n previousNode = clone;\n block.scope = childScope;\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 it's template arrives.\n block.clone = clone;\n nextBlockMap[block.id] = block;\n });\n }\n }\n lastBlockMap = nextBlockMap;\n });\n }\n };\n\n function getBlockStart(block) {\n return block.clone[0];\n }\n\n function getBlockEnd(block) {\n return block.clone[block.clone.length - 1];\n }\n}];\n\n/**\n * @ngdoc directive\n * @name ng.directive: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 * <pre>\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 * </pre>\n *\n * When the ngShow expression evaluates to false then the ng-hide CSS class is added to the class attribute\n * on the element causing it to become hidden. When true, 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 * If you wish to change the hide behavior with ngShow/ngHide then this can be achieved by\n * restating the styles for the .ng-hide class in CSS:\n * <pre>\n * .ng-hide {\n * //!annotate CSS Specificity|Not to worry, this will override the AngularJS default...\n * display:block!important;\n *\n * //this is just another form of hiding an element\n * position:absolute;\n * top:-9999px;\n * left:-9999px;\n * }\n * </pre>\n *\n * Just remember to include the important flag so the CSS override will function.\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 * <pre>\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 * display:block!important;\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 * </pre>\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 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=\"icon-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=\"icon-thumbs-down\"></span> I hide when your checkbox is checked.\n </div>\n </div>\n </file>\n <file name=\"animations.css\">\n .animate-show {\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-show.ng-hide-add,\n .animate-show.ng-hide-remove {\n display:block!important;\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=\"scenario.js\">\n it('should check ng-show / ng-hide', function() {\n expect(element('.doc-example-live span:first:hidden').count()).toEqual(1);\n expect(element('.doc-example-live span:last:visible').count()).toEqual(1);\n\n input('checked').check();\n\n expect(element('.doc-example-live span:first:visible').count()).toEqual(1);\n expect(element('.doc-example-live span:last:hidden').count()).toEqual(1);\n });\n </file>\n </example>\n */\nvar ngShowDirective = ['$animate', function($animate) {\n return function(scope, element, attr) {\n scope.$watch(attr.ngShow, function ngShowWatchAction(value){\n $animate[toBoolean(value) ? 'removeClass' : 'addClass'](element, 'ng-hide');\n });\n };\n}];\n\n\n/**\n * @ngdoc directive\n * @name ng.directive: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 * <pre>\n * <!-- when $scope.myValue is truthy (element is hidden) -->\n * <div ng-hide=\"myValue\"></div>\n *\n * <!-- when $scope.myValue is falsy (element is visible) -->\n * <div ng-hide=\"myValue\" class=\"ng-hide\"></div>\n * </pre>\n *\n * When the ngHide expression evaluates to true then the .ng-hide CSS class is added to the class attribute\n * on the element causing it to become hidden. When false, 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 * If you wish to change the hide behavior with ngShow/ngHide then this can be achieved by\n * restating the styles for the .ng-hide class in CSS:\n * <pre>\n * .ng-hide {\n * //!annotate CSS Specificity|Not to worry, this will override the AngularJS default...\n * display:block!important;\n *\n * //this is just another form of hiding an element\n * position:absolute;\n * top:-9999px;\n * left:-9999px;\n * }\n * </pre>\n *\n * Just remember to include the important flag so the CSS override will function.\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\n * you must also include the !important flag to override the display property so\n * that you can perform an animation when the element is hidden during the time of the animation.\n *\n * <pre>\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 * display:block!important;\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 * </pre>\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 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=\"icon-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=\"icon-thumbs-down\"></span> I hide when your checkbox is checked.\n </div>\n </div>\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-add,\n .animate-hide.ng-hide-remove {\n display:block!important;\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=\"scenario.js\">\n it('should check ng-show / ng-hide', function() {\n expect(element('.doc-example-live .check-element:first:hidden').count()).toEqual(1);\n expect(element('.doc-example-live .check-element:last:visible').count()).toEqual(1);\n\n input('checked').check();\n\n expect(element('.doc-example-live .check-element:first:visible').count()).toEqual(1);\n expect(element('.doc-example-live .check-element:last:hidden').count()).toEqual(1);\n });\n </file>\n </example>\n */\nvar ngHideDirective = ['$animate', function($animate) {\n return function(scope, element, attr) {\n scope.$watch(attr.ngHide, function ngHideWatchAction(value){\n $animate[toBoolean(value) ? 'addClass' : 'removeClass'](element, 'ng-hide');\n });\n };\n}];\n\n/**\n * @ngdoc directive\n * @name ng.directive: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 {@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 * @example\n <example>\n <file name=\"index.html\">\n <input type=\"button\" value=\"set\" ng-click=\"myStyle={color:'red'}\">\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=\"scenario.js\">\n it('should check ng-style', function() {\n expect(element('.doc-example-live span').css('color')).toBe('rgb(0, 0, 0)');\n element('.doc-example-live :button[value=set]').click();\n expect(element('.doc-example-live span').css('color')).toBe('rgb(255, 0, 0)');\n element('.doc-example-live :button[value=clear]').click();\n expect(element('.doc-example-live span').css('color')).toBe('rgb(0, 0, 0)');\n });\n </file>\n </example>\n */\nvar ngStyleDirective = ngDirective(function(scope, element, attr) {\n scope.$watch(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 }, true);\n});\n\n/**\n * @ngdoc directive\n * @name ng.directive: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 choses 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 * <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 * @scope\n * @priority 800\n * @param {*} ngSwitch|on expression to match against <tt>ng-switch-when</tt>.\n * @paramDescription\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 animations=\"true\">\n <file name=\"index.html\">\n <div ng-controller=\"Ctrl\">\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 function Ctrl($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=\"scenario.js\">\n it('should start in settings', function() {\n expect(element('.doc-example-live [ng-switch]').text()).toMatch(/Settings Div/);\n });\n it('should change to home', function() {\n select('selection').option('home');\n expect(element('.doc-example-live [ng-switch]').text()).toMatch(/Home Span/);\n });\n it('should select default', function() {\n select('selection').option('other');\n expect(element('.doc-example-live [ng-switch]').text()).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 selectedScopes = [];\n\n scope.$watch(watchExpr, function ngSwitchWatchAction(value) {\n for (var i= 0, ii=selectedScopes.length; i<ii; i++) {\n selectedScopes[i].$destroy();\n $animate.leave(selectedElements[i]);\n }\n\n selectedElements = [];\n selectedScopes = [];\n\n if ((selectedTranscludes = ngSwitchController.cases['!' + value] || ngSwitchController.cases['?'])) {\n scope.$eval(attr.change);\n forEach(selectedTranscludes, function(selectedTransclude) {\n var selectedScope = scope.$new();\n selectedScopes.push(selectedScope);\n selectedTransclude.transclude(selectedScope, function(caseElement) {\n var anchor = selectedTransclude.element;\n\n selectedElements.push(caseElement);\n $animate.enter(caseElement, anchor.parent(), anchor);\n });\n });\n }\n });\n }\n };\n}];\n\nvar ngSwitchWhenDirective = ngDirective({\n transclude: 'element',\n priority: 800,\n require: '^ngSwitch',\n compile: function(element, attrs) {\n return function(scope, element, attr, ctrl, $transclude) {\n ctrl.cases['!' + attrs.ngSwitchWhen] = (ctrl.cases['!' + attrs.ngSwitchWhen] || []);\n ctrl.cases['!' + attrs.ngSwitchWhen].push({ transclude: $transclude, element: element });\n };\n }\n});\n\nvar ngSwitchDefaultDirective = ngDirective({\n transclude: 'element',\n priority: 800,\n require: '^ngSwitch',\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 ng.directive:ngTransclude\n * @restrict AC\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 <doc:example module=\"transclude\">\n <doc:source>\n <script>\n function Ctrl($scope) {\n $scope.title = 'Lorem Ipsum';\n $scope.text = 'Neque porro quisquam est qui dolorem ipsum quia dolor...';\n }\n\n angular.module('transclude', [])\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 '<div ng-transclude></div>' +\n '</div>'\n };\n });\n </script>\n <div ng-controller=\"Ctrl\">\n <input ng-model=\"title\"><br>\n <textarea ng-model=\"text\"></textarea> <br/>\n <pane title=\"{{title}}\">{{text}}</pane>\n </div>\n </doc:source>\n <doc:scenario>\n it('should have transcluded', function() {\n input('title').enter('TITLE');\n input('text').enter('TEXT');\n expect(binding('title')).toEqual('TITLE');\n expect(binding('text')).toEqual('TEXT');\n });\n </doc:scenario>\n </doc:example>\n *\n */\nvar ngTranscludeDirective = ngDirective({\n controller: ['$element', '$transclude', function($element, $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 // remember the transclusion fn but call it during linking so that we don't process transclusion before directives on\n // the parent element even when the transclusion replaces the current element. (we can't use priority here because\n // that applies only to compile fns and not controllers\n this.$transclude = $transclude;\n }],\n\n link: function($scope, $element, $attrs, controller) {\n controller.$transclude(function(clone) {\n $element.empty();\n $element.append(clone);\n });\n }\n});\n\n/**\n * @ngdoc directive\n * @name ng.directive:script\n * @restrict E\n *\n * @description\n * Load content of a script tag, with type `text/ng-template`, into `$templateCache`, so that the\n * template can be used by `ngInclude`, `ngView` or directive templates.\n *\n * @param {'text/ng-template'} type must be set to `'text/ng-template'`\n *\n * @example\n <doc:example>\n <doc:source>\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 </doc:source>\n <doc:scenario>\n it('should load template defined inside script tag', function() {\n element('#tpl-link').click();\n expect(element('#tpl-content').text()).toMatch(/Content of the template/);\n });\n </doc:scenario>\n </doc: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 // IE is not consistent, in scripts we have to read .text but in other nodes we have to read .textContent\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 ng.directive: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 * 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 * Note: `ngOptions` provides iterator facility for `<option>` element which should be used instead\n * of {@link ng.directive:ngRepeat ngRepeat} when you want the\n * `select` model to be bound to a non-string value. This is because an option element can only\n * be bound to string values at present.\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 * * `select` **`as`** `label` **`group by`** `group` **`for`** `value` **`in`** `array` **`track by`** `trackexpr`\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`).\n *\n * @example\n <doc:example>\n <doc:source>\n <script>\n function MyCntrl($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.color = $scope.colors[2]; // red\n }\n </script>\n <div ng-controller=\"MyCntrl\">\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=\"color\" ng-options=\"c.name for c in colors\"></select><br>\n\n Color (null allowed):\n <span class=\"nullable\">\n <select ng-model=\"color\" ng-options=\"c.name for c in colors\">\n <option value=\"\">-- choose color --</option>\n </select>\n </span><br/>\n\n Color grouped by shade:\n <select ng-model=\"color\" ng-options=\"c.name group by c.shade for c in colors\">\n </select><br/>\n\n\n Select <a href ng-click=\"color={name:'not in list'}\">bogus</a>.<br>\n <hr/>\n Currently selected: {{ {selected_color:color} }}\n <div style=\"border:solid 1px black; height:20px\"\n ng-style=\"{'background-color':color.name}\">\n </div>\n </div>\n </doc:source>\n <doc:scenario>\n it('should check ng-options', function() {\n expect(binding('{selected_color:color}')).toMatch('red');\n select('color').option('0');\n expect(binding('{selected_color:color}')).toMatch('black');\n using('.nullable').select('color').option('');\n expect(binding('{selected_color:color}')).toMatch('null');\n });\n </doc:scenario>\n </doc:example>\n */\n\nvar ngOptionsDirective = valueFn({ terminal: true });\n// jshint maxlen: false\nvar selectDirective = ['$compile', '$parse', function($compile, $parse) {\n //0000111110000000000022220000000000000000000000333300000000000000444444444444444000000000555555555555555000000066666666666666600000000000000007777000000000000000000088888\n var NG_OPTIONS_REGEXP = /^\\s*(.*?)(?:\\s+as\\s+(.*?))?(?:\\s+group\\s+by\\s+(.*))?\\s+for\\s+(?:([\\$\\w][\\$\\w]*)|(?:\\(\\s*([\\$\\w][\\$\\w]*)\\s*,\\s*([\\$\\w][\\$\\w]*)\\s*\\)))\\s+in\\s+(.*?)(?:\\s+track\\s+by\\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) {\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 };\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 // 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 && (attr.required || attr.ngRequired)) {\n var requiredValidator = function(value) {\n ngModelCtrl.$setValidity('required', !attr.required || (value && value.length));\n return value;\n };\n\n ngModelCtrl.$parsers.push(requiredValidator);\n ngModelCtrl.$formatters.unshift(requiredValidator);\n\n attr.$observe('required', function() {\n requiredValidator(ngModelCtrl.$viewValue);\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 = copy(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 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 // 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\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', function() {\n scope.$apply(function() {\n var optionGroup,\n collection = valuesFn(scope) || [],\n locals = {},\n key, value, optionElement, index, groupIndex, length, groupLength, trackIndex;\n\n if (multiple) {\n value = [];\n for (groupIndex = 0, groupLength = optionGroupsCache.length;\n groupIndex < groupLength;\n groupIndex++) {\n // list of options for that group. (first item has the parent)\n optionGroup = optionGroupsCache[groupIndex];\n\n for(index = 1, length = optionGroup.length; index < length; index++) {\n if ((optionElement = optionGroup[index].element)[0].selected) {\n key = optionElement.val();\n if (keyName) locals[keyName] = key;\n if (trackFn) {\n for (trackIndex = 0; trackIndex < collection.length; trackIndex++) {\n locals[valueName] = collection[trackIndex];\n if (trackFn(scope, locals) == key) break;\n }\n } else {\n locals[valueName] = collection[key];\n }\n value.push(valueFn(scope, locals));\n }\n }\n }\n } else {\n key = selectElement.val();\n if (key == '?') {\n value = undefined;\n } else if (key === ''){\n value = null;\n } else {\n if (trackFn) {\n for (trackIndex = 0; trackIndex < collection.length; trackIndex++) {\n locals[valueName] = collection[trackIndex];\n if (trackFn(scope, locals) == key) {\n value = valueFn(scope, locals);\n break;\n }\n }\n } else {\n locals[valueName] = collection[key];\n if (keyName) locals[keyName] = key;\n value = valueFn(scope, locals);\n }\n }\n }\n ctrl.$setViewValue(value);\n });\n });\n\n ctrl.$render = render;\n\n // TODO(vojta): can't we optimize this ?\n scope.$watch(render);\n\n function render() {\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 modelValue = ctrl.$modelValue,\n values = valuesFn(scope) || [],\n keys = keyName ? sortedKeys(values) : values,\n key,\n groupLength, length,\n groupIndex, index,\n locals = {},\n selected,\n selectedSet = false, // nothing is selected yet\n lastElement,\n element,\n label;\n\n if (multiple) {\n if (trackFn && isArray(modelValue)) {\n selectedSet = new HashMap([]);\n for (var trackIndex = 0; trackIndex < modelValue.length; trackIndex++) {\n locals[valueName] = modelValue[trackIndex];\n selectedSet.put(trackFn(scope, locals), modelValue[trackIndex]);\n }\n } else {\n selectedSet = new HashMap(modelValue);\n }\n }\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 \n key = index;\n if (keyName) {\n key = keys[index];\n if ( key.charAt(0) === '$' ) continue;\n locals[keyName] = key;\n }\n\n locals[valueName] = values[key];\n\n optionGroupName = groupByFn(scope, locals) || '';\n if (!(optionGroup = optionGroups[optionGroupName])) {\n optionGroup = optionGroups[optionGroupName] = [];\n optionGroupNames.push(optionGroupName);\n }\n if (multiple) {\n selected = isDefined(\n selectedSet.remove(trackFn ? trackFn(scope, locals) : valueFn(scope, locals))\n );\n } else {\n if (trackFn) {\n var modelCast = {};\n modelCast[valueName] = modelValue;\n selected = trackFn(scope, modelCast) === trackFn(scope, locals);\n } else {\n selected = modelValue === valueFn(scope, locals);\n }\n selectedSet = selectedSet || selected; // see if at least one item is selected\n }\n label = displayFn(scope, locals); // what will be seen by the user\n\n // doing displayFn(scope, locals) || '' overwrites zero values\n label = isDefined(label) ? label : '';\n optionGroup.push({\n // either the index into array or key from object\n id: trackFn ? trackFn(scope, locals) : (keyName ? keys[index] : index),\n label: label,\n selected: selected // determine if we should be selected\n });\n }\n if (!multiple) {\n if (nullOption || modelValue === null) {\n // insert null option if we have a placeholder, or the model is null\n optionGroups[''].unshift({id:'', label:'', selected:!selectedSet});\n } else if (!selectedSet) {\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 lastElement.text(existingOption.label = option.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 }\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 .attr('selected', option.selected)\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 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 existingOptions.pop().element.remove();\n }\n }\n // remove any excessive OPTGROUPs from select\n while(optionGroupsCache.length > groupIndex) {\n optionGroupsCache.pop()[0].element.remove();\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 // For some reason Opera defaults to true and if not overridden this messes up the repeater.\n // We don't want the view to drive the initialization of the model anyway.\n element.prop('selected', false);\n } else {\n selectCtrl = nullSelectCtrl;\n }\n\n if (interpolateFn) {\n scope.$watch(interpolateFn, function interpolateWatchAction(newVal, oldVal) {\n attr.$set('value', newVal);\n if (newVal !== oldVal) selectCtrl.removeOption(oldVal);\n selectCtrl.addOption(newVal);\n });\n } else {\n selectCtrl.addOption(attr.value);\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: true\n});\n\n //try to bind to jquery now so that one can write angular.element().read()\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!angular.$$csp() && 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{display:none !important;}ng\\\\:form{display:block;}.ng-animate-start{border-spacing:1px 1px;-ms-zoom:1.0001;}.ng-animate-active{border-spacing:0px 0px;-ms-zoom:1;}</style>');","/**\n * @license AngularJS v1.2.5\n * (c) 2010-2014 Google, Inc. http://angularjs.org\n * License: MIT\n */\n(function(window, angular, undefined) {'use strict';\n\n/**\n * @ngdoc overview\n * @name ngCookies\n * @description\n *\n * # ngCookies\n *\n * The `ngCookies` module provides a convenient wrapper for reading and writing browser cookies. \n *\n * {@installModule cookies}\n *\n * <div doc-module-components=\"ngCookies\"></div>\n *\n * See {@link ngCookies.$cookies `$cookies`} and\n * {@link ngCookies.$cookieStore `$cookieStore`} for usage.\n */\n\n\nangular.module('ngCookies', ['ng']).\n /**\n * @ngdoc object\n * @name ngCookies.$cookies\n * @requires $browser\n *\n * @description\n * Provides read/write access to browser's cookies.\n *\n * Only a simple Object is exposed and by adding or removing properties to/from\n * this object, new cookies are created/deleted at the end of current $eval.\n *\n * Requires the {@link ngCookies `ngCookies`} module to be installed.\n *\n * @example\n <doc:example>\n <doc:source>\n <script>\n function ExampleController($cookies) {\n // Retrieving a cookie\n var favoriteCookie = $cookies.myFavorite;\n // Setting a cookie\n $cookies.myFavorite = 'oatmeal';\n }\n </script>\n </doc:source>\n </doc:example>\n */\n factory('$cookies', ['$rootScope', '$browser', function ($rootScope, $browser) {\n var cookies = {},\n lastCookies = {},\n lastBrowserCookies,\n runEval = false,\n copy = angular.copy,\n isUndefined = angular.isUndefined;\n\n //creates a poller fn that copies all cookies from the $browser to service & inits the service\n $browser.addPollFn(function() {\n var currentCookies = $browser.cookies();\n if (lastBrowserCookies != currentCookies) { //relies on browser.cookies() impl\n lastBrowserCookies = currentCookies;\n copy(currentCookies, lastCookies);\n copy(currentCookies, cookies);\n if (runEval) $rootScope.$apply();\n }\n })();\n\n runEval = true;\n\n //at the end of each eval, push cookies\n //TODO: this should happen before the \"delayed\" watches fire, because if some cookies are not\n // strings or browser refuses to store some cookies, we update the model in the push fn.\n $rootScope.$watch(push);\n\n return cookies;\n\n\n /**\n * Pushes all the cookies from the service to the browser and verifies if all cookies were\n * stored.\n */\n function push() {\n var name,\n value,\n browserCookies,\n updated;\n\n //delete any cookies deleted in $cookies\n for (name in lastCookies) {\n if (isUndefined(cookies[name])) {\n $browser.cookies(name, undefined);\n }\n }\n\n //update all cookies updated in $cookies\n for(name in cookies) {\n value = cookies[name];\n if (!angular.isString(value)) {\n if (angular.isDefined(lastCookies[name])) {\n cookies[name] = lastCookies[name];\n } else {\n delete cookies[name];\n }\n } else if (value !== lastCookies[name]) {\n $browser.cookies(name, value);\n updated = true;\n }\n }\n\n //verify what was actually stored\n if (updated){\n updated = false;\n browserCookies = $browser.cookies();\n\n for (name in cookies) {\n if (cookies[name] !== browserCookies[name]) {\n //delete or reset all cookies that the browser dropped from $cookies\n if (isUndefined(browserCookies[name])) {\n delete cookies[name];\n } else {\n cookies[name] = browserCookies[name];\n }\n updated = true;\n }\n }\n }\n }\n }]).\n\n\n /**\n * @ngdoc object\n * @name ngCookies.$cookieStore\n * @requires $cookies\n *\n * @description\n * Provides a key-value (string-object) storage, that is backed by session cookies.\n * Objects put or retrieved from this storage are automatically serialized or\n * deserialized by angular's toJson/fromJson.\n *\n * Requires the {@link ngCookies `ngCookies`} module to be installed.\n *\n * @example\n */\n factory('$cookieStore', ['$cookies', function($cookies) {\n\n return {\n /**\n * @ngdoc method\n * @name ngCookies.$cookieStore#get\n * @methodOf ngCookies.$cookieStore\n *\n * @description\n * Returns the value of given cookie key\n *\n * @param {string} key Id to use for lookup.\n * @returns {Object} Deserialized cookie value.\n */\n get: function(key) {\n var value = $cookies[key];\n return value ? angular.fromJson(value) : value;\n },\n\n /**\n * @ngdoc method\n * @name ngCookies.$cookieStore#put\n * @methodOf ngCookies.$cookieStore\n *\n * @description\n * Sets a value for given cookie key\n *\n * @param {string} key Id for the `value`.\n * @param {Object} value Value to be stored.\n */\n put: function(key, value) {\n $cookies[key] = angular.toJson(value);\n },\n\n /**\n * @ngdoc method\n * @name ngCookies.$cookieStore#remove\n * @methodOf ngCookies.$cookieStore\n *\n * @description\n * Remove given cookie\n *\n * @param {string} key Id of the key-value pair to delete.\n */\n remove: function(key) {\n delete $cookies[key];\n }\n };\n\n }]);\n\n\n})(window, window.angular);\n","/**\n * @license AngularJS v1.2.5\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.substr(0, 2) !== '$$') {\n dst[key] = src[key];\n }\n }\n\n return dst;\n}\n\n/**\n * @ngdoc overview\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 * {@installModule resource}\n *\n * <div doc-module-components=\"ngResource\"></div>\n *\n * See {@link ngResource.$resource `$resource`} for usage.\n */\n\n/**\n * @ngdoc object\n * @name ngResource.$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 * @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 of that parameter is extracted from\n * the data object (useful for non-GET operations).\n *\n * @param {Object.<Object>=} actions Hash with declaration of custom action that should extend the\n * default set of resource actions. The declaration should be created in the format of {@link\n * ng.$http#usage_parameters $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} – HTTP request method. Valid methods are: `GET`, `POST`, `PUT`,\n * `DELETE`, and `JSONP`.\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 * - **`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 * - **`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 {@link https://developer.mozilla.org/en/http_access_control#section_5\n * requests with credentials} for more information.\n * - **`responseType`** - `{string}` - see {@link\n * https://developer.mozilla.org/en-US/docs/DOM/XMLHttpRequest#responseType requestType}.\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 * @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 *\n * { 'get': {method:'GET'},\n * 'save': {method:'POST'},\n * 'query': {method:'GET', isArray:true},\n * 'remove': {method:'DELETE'},\n * 'delete': {method:'DELETE'} };\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 * <pre>\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 </pre>\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 * 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 * - `$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 * <pre>\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:'01234', name: 'Mike Smith'};\n expect(newCard.id).toEqual(789);\n * </pre>\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 <pre>\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 </pre>\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 <pre>\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 </pre>\n */\nangular.module('ngResource', ['ng']).\n factory('$resource', ['$http', '$q', function($http, $q) {\n\n var DEFAULT_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 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 (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 */\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 = 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\"), encodedVal + \"$1\");\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\n url = url.replace(/\\/+$/, '');\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) {\n var route = new Route(url);\n\n actions = extend({}, DEFAULT_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 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', 'Error in resource configuration. Expected ' +\n 'response to contain an {0} but got an {1}',\n action.isArray?'array':'object', angular.isArray(data)?'array':'object');\n }\n // jshint +W018\n if (action.isArray) {\n value.length = 0;\n forEach(data, function(item) {\n value.push(new Resource(item));\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})(window, window.angular);\n","/**\n * @license AngularJS v1.2.5\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 overview\n * @name ngSanitize\n * @description\n *\n * # ngSanitize\n *\n * The `ngSanitize` module provides functionality to sanitize HTML.\n *\n * {@installModule sanitize}\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 ngSanitize.$sanitize\n * @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.\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 <doc:example module=\"ngSanitize\">\n <doc:source>\n <script>\n function Ctrl($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=\"Ctrl\">\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><div ng-bind-html=\"snippet\"><br/></div></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><div ng-bind-html=\"deliberatelyTrustDangerousSnippet()\">\n</div></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><div ng-bind=\"snippet\"><br/></div></pre></td>\n <td><div ng-bind=\"snippet\"></div></td>\n </tr>\n </table>\n </div>\n </doc:source>\n <doc:scenario>\n it('should sanitize the html snippet by default', function() {\n expect(using('#bind-html-with-sanitize').element('div').html()).\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(using('#bind-html-with-trust').element(\"div\").html()).\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(using('#bind-default').element('div').html()).\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 update', function() {\n input('snippet').enter('new <b onclick=\"alert(1)\">text</b>');\n expect(using('#bind-html-with-sanitize').element('div').html()).toBe('new <b>text</b>');\n expect(using('#bind-html-with-trust').element('div').html()).toBe(\n 'new <b onclick=\"alert(1)\">text</b>');\n expect(using('#bind-default').element('div').html()).toBe(\n \"new <b onclick=\\\"alert(1)\\\">text</b>\");\n });\n </doc:scenario>\n </doc: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 /^<\\s*([\\w:-]+)((?:\\s+[\\w:-]+(?:\\s*=\\s*(?:(?:\"[^\"]*\")|(?:'[^']*')|[^>\\s]+))?)*)\\s*(\\/?)\\s*>/,\n END_TAG_REGEXP = /^<\\s*\\/\\s*([\\w:-]+)[^>]*>/,\n ATTR_REGEXP = /([\\w:-]+)(?:\\s*=\\s*(?:(?:\"((?:[^\"])*)\")|(?:'((?:[^'])*)')|([^>\\s]+)))?/g,\n BEGIN_TAG_REGEXP = /^</,\n BEGING_END_TAGE_REGEXP = /^<\\s*\\//,\n COMMENT_REGEXP = /<!--(.*?)-->/g,\n DOCTYPE_REGEXP = /<!DOCTYPE([^>]*?)>/i,\n CDATA_REGEXP = /<!\\[CDATA\\[(.*?)]]>/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\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\n//Attributes that have href and hence need to be sanitized\nvar uriAttrs = makeMap(\"background,cite,href,longdesc,src,usemap\");\nvar validAttrs = angular.extend({}, uriAttrs, makeMap(\n '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,span,start,summary,target,title,type,'+\n 'valign,value,vspace,width'));\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 var index, chars, match, stack = [], last = html;\n stack.last = function() { return stack[ stack.length - 1 ]; };\n\n while ( html ) {\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 html = html.substring( match[0].length );\n match[0].replace( START_TAG_REGEXP, parseStartTag );\n chars = false;\n }\n }\n\n if ( chars ) {\n index = html.indexOf(\"<\");\n\n var 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 html = html.replace(new RegExp(\"(.*)<\\\\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,\"<\");\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 escaped text\n */\nfunction encodeEntities(value) {\n return value.\n replace(/&/g, '&').\n replace(NON_ALPHANUMERIC_REGEXP, function(value){\n return '&#' + value.charCodeAt(0) + ';';\n }).\n replace(/</g, '<').\n replace(/>/g, '>');\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 ngSanitize.filter:linky\n * @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 <doc:example module=\"ngSanitize\">\n <doc:source>\n <script>\n function Ctrl($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=\"Ctrl\">\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><div ng-bind-html=\"snippet | linky\"><br></div></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><div ng-bind-html=\"snippetWithTarget | linky:'_blank'\"><br></div></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><div ng-bind=\"snippet\"><br></div></pre></td>\n <td><div ng-bind=\"snippet\"></div></td>\n </tr>\n </table>\n </doc:source>\n <doc:scenario>\n it('should linkify the snippet with urls', function() {\n expect(using('#linky-filter').binding('snippet | linky')).\n toBe('Pretty text with some links: ' +\n '<a href=\"http://angularjs.org/\">http://angularjs.org/</a>, ' +\n '<a href=\"mailto:us@somewhere.org\">us@somewhere.org</a>, ' +\n '<a href=\"mailto:another@somewhere.org\">another@somewhere.org</a>, ' +\n 'and one more: <a href=\"ftp://127.0.0.1/\">ftp://127.0.0.1/</a>.');\n });\n\n it ('should not linkify snippet without the linky filter', function() {\n expect(using('#escaped-html').binding('snippet')).\n toBe(\"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 });\n\n it('should update', function() {\n input('snippet').enter('new http://link.');\n expect(using('#linky-filter').binding('snippet | linky')).\n toBe('new <a href=\"http://link\">http://link</a>.');\n expect(using('#escaped-html').binding('snippet')).toBe('new http://link.');\n });\n\n it('should work with the target property', function() {\n expect(using('#linky-target').binding(\"snippetWithTarget | linky:'_blank'\")).\n toBe('<a target=\"_blank\" href=\"http://angularjs.org/\">http://angularjs.org/</a>');\n });\n </doc:scenario>\n </doc:example>\n */\nangular.module('ngSanitize').filter('linky', ['$sanitize', function($sanitize) {\n var LINKY_URL_REGEXP =\n /((ftp|https?):\\/\\/|(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/mailto then assume mailto\n if (match[2] == match[3]) url = 'mailto:' + url;\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 html.push(target);\n html.push('\" ');\n }\n html.push('href=\"');\n html.push(url);\n html.push('\">');\n addText(text);\n html.push('</a>');\n }\n };\n}]);\n\n\n})(window, window.angular);\n","/*!\n * angular-translate - v2.10.0 - 2016-02-28\n * \n * Copyright (c) 2016 The angular-translate team, Pascal Precht; Licensed MIT\n */\n(function (root, factory) {\n if (typeof define === 'function' && define.amd) {\n // AMD. Register as an anonymous module unless amdModuleId is set\n define([], function () {\n return (factory());\n });\n } else if (typeof exports === 'object') {\n // Node. Does not work with strict CommonJS, but\n // only CommonJS-like environments that support module.exports,\n // like Node.\n module.exports = factory();\n } else {\n factory();\n }\n}(this, function () {\n\n/**\n * @ngdoc overview\n * @name pascalprecht.translate\n *\n * @description\n * The main module which holds everything together.\n */\nangular.module('pascalprecht.translate', ['ng'])\n .run(runTranslate);\n\nfunction runTranslate($translate) {\n\n 'use strict';\n\n var key = $translate.storageKey(),\n storage = $translate.storage();\n\n var fallbackFromIncorrectStorageValue = function () {\n var preferred = $translate.preferredLanguage();\n if (angular.isString(preferred)) {\n $translate.use(preferred);\n // $translate.use() will also remember the language.\n // So, we don't need to call storage.put() here.\n } else {\n storage.put(key, $translate.use());\n }\n };\n\n fallbackFromIncorrectStorageValue.displayName = 'fallbackFromIncorrectStorageValue';\n\n if (storage) {\n if (!storage.get(key)) {\n fallbackFromIncorrectStorageValue();\n } else {\n $translate.use(storage.get(key))['catch'](fallbackFromIncorrectStorageValue);\n }\n } else if (angular.isString($translate.preferredLanguage())) {\n $translate.use($translate.preferredLanguage());\n }\n}\nrunTranslate.$inject = ['$translate'];\n\nrunTranslate.displayName = 'runTranslate';\n\n/**\n * @ngdoc object\n * @name pascalprecht.translate.$translateSanitizationProvider\n *\n * @description\n *\n * Configurations for $translateSanitization\n */\nangular.module('pascalprecht.translate').provider('$translateSanitization', $translateSanitizationProvider);\n\nfunction $translateSanitizationProvider () {\n\n 'use strict';\n\n var $sanitize,\n currentStrategy = null, // TODO change to either 'sanitize', 'escape' or ['sanitize', 'escapeParameters'] in 3.0.\n hasConfiguredStrategy = false,\n hasShownNoStrategyConfiguredWarning = false,\n strategies;\n\n /**\n * Definition of a sanitization strategy function\n * @callback StrategyFunction\n * @param {string|object} value - value to be sanitized (either a string or an interpolated value map)\n * @param {string} mode - either 'text' for a string (translation) or 'params' for the interpolated params\n * @return {string|object}\n */\n\n /**\n * @ngdoc property\n * @name strategies\n * @propertyOf pascalprecht.translate.$translateSanitizationProvider\n *\n * @description\n * Following strategies are built-in:\n * <dl>\n * <dt>sanitize</dt>\n * <dd>Sanitizes HTML in the translation text using $sanitize</dd>\n * <dt>escape</dt>\n * <dd>Escapes HTML in the translation</dd>\n * <dt>sanitizeParameters</dt>\n * <dd>Sanitizes HTML in the values of the interpolation parameters using $sanitize</dd>\n * <dt>escapeParameters</dt>\n * <dd>Escapes HTML in the values of the interpolation parameters</dd>\n * <dt>escaped</dt>\n * <dd>Support legacy strategy name 'escaped' for backwards compatibility (will be removed in 3.0)</dd>\n * </dl>\n *\n */\n\n strategies = {\n sanitize: function (value, mode) {\n if (mode === 'text') {\n value = htmlSanitizeValue(value);\n }\n return value;\n },\n escape: function (value, mode) {\n if (mode === 'text') {\n value = htmlEscapeValue(value);\n }\n return value;\n },\n sanitizeParameters: function (value, mode) {\n if (mode === 'params') {\n value = mapInterpolationParameters(value, htmlSanitizeValue);\n }\n return value;\n },\n escapeParameters: function (value, mode) {\n if (mode === 'params') {\n value = mapInterpolationParameters(value, htmlEscapeValue);\n }\n return value;\n }\n };\n // Support legacy strategy name 'escaped' for backwards compatibility.\n // TODO should be removed in 3.0\n strategies.escaped = strategies.escapeParameters;\n\n /**\n * @ngdoc function\n * @name pascalprecht.translate.$translateSanitizationProvider#addStrategy\n * @methodOf pascalprecht.translate.$translateSanitizationProvider\n *\n * @description\n * Adds a sanitization strategy to the list of known strategies.\n *\n * @param {string} strategyName - unique key for a strategy\n * @param {StrategyFunction} strategyFunction - strategy function\n * @returns {object} this\n */\n this.addStrategy = function (strategyName, strategyFunction) {\n strategies[strategyName] = strategyFunction;\n return this;\n };\n\n /**\n * @ngdoc function\n * @name pascalprecht.translate.$translateSanitizationProvider#removeStrategy\n * @methodOf pascalprecht.translate.$translateSanitizationProvider\n *\n * @description\n * Removes a sanitization strategy from the list of known strategies.\n *\n * @param {string} strategyName - unique key for a strategy\n * @returns {object} this\n */\n this.removeStrategy = function (strategyName) {\n delete strategies[strategyName];\n return this;\n };\n\n /**\n * @ngdoc function\n * @name pascalprecht.translate.$translateSanitizationProvider#useStrategy\n * @methodOf pascalprecht.translate.$translateSanitizationProvider\n *\n * @description\n * Selects a sanitization strategy. When an array is provided the strategies will be executed in order.\n *\n * @param {string|StrategyFunction|array} strategy The sanitization strategy / strategies which should be used. Either a name of an existing strategy, a custom strategy function, or an array consisting of multiple names and / or custom functions.\n * @returns {object} this\n */\n this.useStrategy = function (strategy) {\n hasConfiguredStrategy = true;\n currentStrategy = strategy;\n return this;\n };\n\n /**\n * @ngdoc object\n * @name pascalprecht.translate.$translateSanitization\n * @requires $injector\n * @requires $log\n *\n * @description\n * Sanitizes interpolation parameters and translated texts.\n *\n */\n this.$get = ['$injector', '$log', function ($injector, $log) {\n\n var cachedStrategyMap = {};\n\n var applyStrategies = function (value, mode, selectedStrategies) {\n angular.forEach(selectedStrategies, function (selectedStrategy) {\n if (angular.isFunction(selectedStrategy)) {\n value = selectedStrategy(value, mode);\n } else if (angular.isFunction(strategies[selectedStrategy])) {\n value = strategies[selectedStrategy](value, mode);\n } else if (angular.isString(strategies[selectedStrategy])) {\n if (!cachedStrategyMap[strategies[selectedStrategy]]) {\n try {\n cachedStrategyMap[strategies[selectedStrategy]] = $injector.get(strategies[selectedStrategy]);\n } catch (e) {\n cachedStrategyMap[strategies[selectedStrategy]] = function() {};\n throw new Error('pascalprecht.translate.$translateSanitization: Unknown sanitization strategy: \\'' + selectedStrategy + '\\'');\n }\n }\n value = cachedStrategyMap[strategies[selectedStrategy]](value, mode);\n } else {\n throw new Error('pascalprecht.translate.$translateSanitization: Unknown sanitization strategy: \\'' + selectedStrategy + '\\'');\n }\n });\n return value;\n };\n\n // TODO: should be removed in 3.0\n var showNoStrategyConfiguredWarning = function () {\n if (!hasConfiguredStrategy && !hasShownNoStrategyConfiguredWarning) {\n $log.warn('pascalprecht.translate.$translateSanitization: No sanitization strategy has been configured. This can have serious security implications. See http://angular-translate.github.io/docs/#/guide/19_security for details.');\n hasShownNoStrategyConfiguredWarning = true;\n }\n };\n\n if ($injector.has('$sanitize')) {\n $sanitize = $injector.get('$sanitize');\n }\n\n return {\n /**\n * @ngdoc function\n * @name pascalprecht.translate.$translateSanitization#useStrategy\n * @methodOf pascalprecht.translate.$translateSanitization\n *\n * @description\n * Selects a sanitization strategy. When an array is provided the strategies will be executed in order.\n *\n * @param {string|StrategyFunction|array} strategy The sanitization strategy / strategies which should be used. Either a name of an existing strategy, a custom strategy function, or an array consisting of multiple names and / or custom functions.\n */\n useStrategy: (function (self) {\n return function (strategy) {\n self.useStrategy(strategy);\n };\n })(this),\n\n /**\n * @ngdoc function\n * @name pascalprecht.translate.$translateSanitization#sanitize\n * @methodOf pascalprecht.translate.$translateSanitization\n *\n * @description\n * Sanitizes a value.\n *\n * @param {string|object} value The value which should be sanitized.\n * @param {string} mode The current sanitization mode, either 'params' or 'text'.\n * @param {string|StrategyFunction|array} [strategy] Optional custom strategy which should be used instead of the currently selected strategy.\n * @returns {string|object} sanitized value\n */\n sanitize: function (value, mode, strategy) {\n if (!currentStrategy) {\n showNoStrategyConfiguredWarning();\n }\n\n if (arguments.length < 3) {\n strategy = currentStrategy;\n }\n\n if (!strategy) {\n return value;\n }\n\n var selectedStrategies = angular.isArray(strategy) ? strategy : [strategy];\n return applyStrategies(value, mode, selectedStrategies);\n }\n };\n }];\n\n var htmlEscapeValue = function (value) {\n var element = angular.element('<div></div>');\n element.text(value); // not chainable, see #1044\n return element.html();\n };\n\n var htmlSanitizeValue = function (value) {\n if (!$sanitize) {\n throw new Error('pascalprecht.translate.$translateSanitization: Error cannot find $sanitize service. Either include the ngSanitize module (https://docs.angularjs.org/api/ngSanitize) or use a sanitization strategy which does not depend on $sanitize, such as \\'escape\\'.');\n }\n return $sanitize(value);\n };\n\n var mapInterpolationParameters = function (value, iteratee, stack) {\n if (angular.isObject(value)) {\n var result = angular.isArray(value) ? [] : {};\n\n if (!stack) {\n stack = [];\n } else {\n if (stack.indexOf(value) > -1) {\n throw new Error('pascalprecht.translate.$translateSanitization: Error cannot interpolate parameter due recursive object');\n }\n }\n\n stack.push(value);\n angular.forEach(value, function (propertyValue, propertyKey) {\n result[propertyKey] = mapInterpolationParameters(propertyValue, iteratee, stack);\n });\n stack.splice(-1, 1); // remove last\n\n return result;\n } else if (angular.isNumber(value)) {\n return value;\n } else {\n return iteratee(value);\n }\n };\n}\n\n/**\n * @ngdoc object\n * @name pascalprecht.translate.$translateProvider\n * @description\n *\n * $translateProvider allows developers to register translation-tables, asynchronous loaders\n * and similar to configure translation behavior directly inside of a module.\n *\n */\nangular.module('pascalprecht.translate')\n.constant('pascalprechtTranslateOverrider', {})\n.provider('$translate', $translate);\n\nfunction $translate($STORAGE_KEY, $windowProvider, $translateSanitizationProvider, pascalprechtTranslateOverrider) {\n\n 'use strict';\n\n var $translationTable = {},\n $preferredLanguage,\n $availableLanguageKeys = [],\n $languageKeyAliases,\n $fallbackLanguage,\n $fallbackWasString,\n $uses,\n $nextLang,\n $storageFactory,\n $storageKey = $STORAGE_KEY,\n $storagePrefix,\n $missingTranslationHandlerFactory,\n $interpolationFactory,\n $interpolatorFactories = [],\n $loaderFactory,\n $cloakClassName = 'translate-cloak',\n $loaderOptions,\n $notFoundIndicatorLeft,\n $notFoundIndicatorRight,\n $postCompilingEnabled = false,\n $forceAsyncReloadEnabled = false,\n $nestedObjectDelimeter = '.',\n $isReady = false,\n loaderCache,\n directivePriority = 0,\n statefulFilter = true,\n uniformLanguageTagResolver = 'default',\n languageTagResolver = {\n 'default': function (tag) {\n return (tag || '').split('-').join('_');\n },\n java: function (tag) {\n var temp = (tag || '').split('-').join('_');\n var parts = temp.split('_');\n return parts.length > 1 ? (parts[0].toLowerCase() + '_' + parts[1].toUpperCase()) : temp;\n },\n bcp47: function (tag) {\n var temp = (tag || '').split('_').join('-');\n var parts = temp.split('-');\n return parts.length > 1 ? (parts[0].toLowerCase() + '-' + parts[1].toUpperCase()) : temp;\n }\n };\n\n var version = '2.10.0';\n\n // tries to determine the browsers language\n var getFirstBrowserLanguage = function () {\n\n // internal purpose only\n if (angular.isFunction(pascalprechtTranslateOverrider.getLocale)) {\n return pascalprechtTranslateOverrider.getLocale();\n }\n\n var nav = $windowProvider.$get().navigator,\n browserLanguagePropertyKeys = ['language', 'browserLanguage', 'systemLanguage', 'userLanguage'],\n i,\n language;\n\n // support for HTML 5.1 \"navigator.languages\"\n if (angular.isArray(nav.languages)) {\n for (i = 0; i < nav.languages.length; i++) {\n language = nav.languages[i];\n if (language && language.length) {\n return language;\n }\n }\n }\n\n // support for other well known properties in browsers\n for (i = 0; i < browserLanguagePropertyKeys.length; i++) {\n language = nav[browserLanguagePropertyKeys[i]];\n if (language && language.length) {\n return language;\n }\n }\n\n return null;\n };\n getFirstBrowserLanguage.displayName = 'angular-translate/service: getFirstBrowserLanguage';\n\n // tries to determine the browsers locale\n var getLocale = function () {\n var locale = getFirstBrowserLanguage() || '';\n if (languageTagResolver[uniformLanguageTagResolver]) {\n locale = languageTagResolver[uniformLanguageTagResolver](locale);\n }\n return locale;\n };\n getLocale.displayName = 'angular-translate/service: getLocale';\n\n /**\n * @name indexOf\n * @private\n *\n * @description\n * indexOf polyfill. Kinda sorta.\n *\n * @param {array} array Array to search in.\n * @param {string} searchElement Element to search for.\n *\n * @returns {int} Index of search element.\n */\n var indexOf = function(array, searchElement) {\n for (var i = 0, len = array.length; i < len; i++) {\n if (array[i] === searchElement) {\n return i;\n }\n }\n return -1;\n };\n\n /**\n * @name trim\n * @private\n *\n * @description\n * trim polyfill\n *\n * @returns {string} The string stripped of whitespace from both ends\n */\n var trim = function() {\n return this.toString().replace(/^\\s+|\\s+$/g, '');\n };\n\n var negotiateLocale = function (preferred) {\n if(!preferred) {\n return;\n }\n\n var avail = [],\n locale = angular.lowercase(preferred),\n i = 0,\n n = $availableLanguageKeys.length;\n\n for (; i < n; i++) {\n avail.push(angular.lowercase($availableLanguageKeys[i]));\n }\n\n // Check for an exact match in our list of available keys\n if (indexOf(avail, locale) > -1) {\n return preferred;\n }\n\n if ($languageKeyAliases) {\n var alias;\n for (var langKeyAlias in $languageKeyAliases) {\n var hasWildcardKey = false;\n var hasExactKey = Object.prototype.hasOwnProperty.call($languageKeyAliases, langKeyAlias) &&\n angular.lowercase(langKeyAlias) === angular.lowercase(preferred);\n\n if (langKeyAlias.slice(-1) === '*') {\n hasWildcardKey = langKeyAlias.slice(0, -1) === preferred.slice(0, langKeyAlias.length-1);\n }\n if (hasExactKey || hasWildcardKey) {\n alias = $languageKeyAliases[langKeyAlias];\n if (indexOf(avail, angular.lowercase(alias)) > -1) {\n return alias;\n }\n }\n }\n }\n\n // Check for a language code without region\n var parts = preferred.split('_');\n\n if (parts.length > 1 && indexOf(avail, angular.lowercase(parts[0])) > -1) {\n return parts[0];\n }\n\n // If everything fails, return undefined.\n return;\n };\n\n /**\n * @ngdoc function\n * @name pascalprecht.translate.$translateProvider#translations\n * @methodOf pascalprecht.translate.$translateProvider\n *\n * @description\n * Registers a new translation table for specific language key.\n *\n * To register a translation table for specific language, pass a defined language\n * key as first parameter.\n *\n * <pre>\n * // register translation table for language: 'de_DE'\n * $translateProvider.translations('de_DE', {\n * 'GREETING': 'Hallo Welt!'\n * });\n *\n * // register another one\n * $translateProvider.translations('en_US', {\n * 'GREETING': 'Hello world!'\n * });\n * </pre>\n *\n * When registering multiple translation tables for for the same language key,\n * the actual translation table gets extended. This allows you to define module\n * specific translation which only get added, once a specific module is loaded in\n * your app.\n *\n * Invoking this method with no arguments returns the translation table which was\n * registered with no language key. Invoking it with a language key returns the\n * related translation table.\n *\n * @param {string} key A language key.\n * @param {object} translationTable A plain old JavaScript object that represents a translation table.\n *\n */\n var translations = function (langKey, translationTable) {\n\n if (!langKey && !translationTable) {\n return $translationTable;\n }\n\n if (langKey && !translationTable) {\n if (angular.isString(langKey)) {\n return $translationTable[langKey];\n }\n } else {\n if (!angular.isObject($translationTable[langKey])) {\n $translationTable[langKey] = {};\n }\n angular.extend($translationTable[langKey], flatObject(translationTable));\n }\n return this;\n };\n\n this.translations = translations;\n\n /**\n * @ngdoc function\n * @name pascalprecht.translate.$translateProvider#cloakClassName\n * @methodOf pascalprecht.translate.$translateProvider\n *\n * @description\n *\n * Let's you change the class name for `translate-cloak` directive.\n * Default class name is `translate-cloak`.\n *\n * @param {string} name translate-cloak class name\n */\n this.cloakClassName = function (name) {\n if (!name) {\n return $cloakClassName;\n }\n $cloakClassName = name;\n return this;\n };\n\n /**\n * @ngdoc function\n * @name pascalprecht.translate.$translateProvider#nestedObjectDelimeter\n * @methodOf pascalprecht.translate.$translateProvider\n *\n * @description\n *\n * Let's you change the delimiter for namespaced translations.\n * Default delimiter is `.`.\n *\n * @param {string} delimiter namespace separator\n */\n this.nestedObjectDelimeter = function (delimiter) {\n if (!delimiter) {\n return $nestedObjectDelimeter;\n }\n $nestedObjectDelimeter = delimiter;\n return this;\n };\n\n /**\n * @name flatObject\n * @private\n *\n * @description\n * Flats an object. This function is used to flatten given translation data with\n * namespaces, so they are later accessible via dot notation.\n */\n var flatObject = function (data, path, result, prevKey) {\n var key, keyWithPath, keyWithShortPath, val;\n\n if (!path) {\n path = [];\n }\n if (!result) {\n result = {};\n }\n for (key in data) {\n if (!Object.prototype.hasOwnProperty.call(data, key)) {\n continue;\n }\n val = data[key];\n if (angular.isObject(val)) {\n flatObject(val, path.concat(key), result, key);\n } else {\n keyWithPath = path.length ? ('' + path.join($nestedObjectDelimeter) + $nestedObjectDelimeter + key) : key;\n if(path.length && key === prevKey){\n // Create shortcut path (foo.bar == foo.bar.bar)\n keyWithShortPath = '' + path.join($nestedObjectDelimeter);\n // Link it to original path\n result[keyWithShortPath] = '@:' + keyWithPath;\n }\n result[keyWithPath] = val;\n }\n }\n return result;\n };\n flatObject.displayName = 'flatObject';\n\n /**\n * @ngdoc function\n * @name pascalprecht.translate.$translateProvider#addInterpolation\n * @methodOf pascalprecht.translate.$translateProvider\n *\n * @description\n * Adds interpolation services to angular-translate, so it can manage them.\n *\n * @param {object} factory Interpolation service factory\n */\n this.addInterpolation = function (factory) {\n $interpolatorFactories.push(factory);\n return this;\n };\n\n /**\n * @ngdoc function\n * @name pascalprecht.translate.$translateProvider#useMessageFormatInterpolation\n * @methodOf pascalprecht.translate.$translateProvider\n *\n * @description\n * Tells angular-translate to use interpolation functionality of messageformat.js.\n * This is useful when having high level pluralization and gender selection.\n */\n this.useMessageFormatInterpolation = function () {\n return this.useInterpolation('$translateMessageFormatInterpolation');\n };\n\n /**\n * @ngdoc function\n * @name pascalprecht.translate.$translateProvider#useInterpolation\n * @methodOf pascalprecht.translate.$translateProvider\n *\n * @description\n * Tells angular-translate which interpolation style to use as default, application-wide.\n * Simply pass a factory/service name. The interpolation service has to implement\n * the correct interface.\n *\n * @param {string} factory Interpolation service name.\n */\n this.useInterpolation = function (factory) {\n $interpolationFactory = factory;\n return this;\n };\n\n /**\n * @ngdoc function\n * @name pascalprecht.translate.$translateProvider#useSanitizeStrategy\n * @methodOf pascalprecht.translate.$translateProvider\n *\n * @description\n * Simply sets a sanitation strategy type.\n *\n * @param {string} value Strategy type.\n */\n this.useSanitizeValueStrategy = function (value) {\n $translateSanitizationProvider.useStrategy(value);\n return this;\n };\n\n /**\n * @ngdoc function\n * @name pascalprecht.translate.$translateProvider#preferredLanguage\n * @methodOf pascalprecht.translate.$translateProvider\n *\n * @description\n * Tells the module which of the registered translation tables to use for translation\n * at initial startup by passing a language key. Similar to `$translateProvider#use`\n * only that it says which language to **prefer**.\n *\n * @param {string} langKey A language key.\n */\n this.preferredLanguage = function(langKey) {\n if (langKey) {\n setupPreferredLanguage(langKey);\n return this;\n }\n return $preferredLanguage;\n };\n var setupPreferredLanguage = function (langKey) {\n if (langKey) {\n $preferredLanguage = langKey;\n }\n return $preferredLanguage;\n };\n /**\n * @ngdoc function\n * @name pascalprecht.translate.$translateProvider#translationNotFoundIndicator\n * @methodOf pascalprecht.translate.$translateProvider\n *\n * @description\n * Sets an indicator which is used when a translation isn't found. E.g. when\n * setting the indicator as 'X' and one tries to translate a translation id\n * called `NOT_FOUND`, this will result in `X NOT_FOUND X`.\n *\n * Internally this methods sets a left indicator and a right indicator using\n * `$translateProvider.translationNotFoundIndicatorLeft()` and\n * `$translateProvider.translationNotFoundIndicatorRight()`.\n *\n * **Note**: These methods automatically add a whitespace between the indicators\n * and the translation id.\n *\n * @param {string} indicator An indicator, could be any string.\n */\n this.translationNotFoundIndicator = function (indicator) {\n this.translationNotFoundIndicatorLeft(indicator);\n this.translationNotFoundIndicatorRight(indicator);\n return this;\n };\n\n /**\n * ngdoc function\n * @name pascalprecht.translate.$translateProvider#translationNotFoundIndicatorLeft\n * @methodOf pascalprecht.translate.$translateProvider\n *\n * @description\n * Sets an indicator which is used when a translation isn't found left to the\n * translation id.\n *\n * @param {string} indicator An indicator.\n */\n this.translationNotFoundIndicatorLeft = function (indicator) {\n if (!indicator) {\n return $notFoundIndicatorLeft;\n }\n $notFoundIndicatorLeft = indicator;\n return this;\n };\n\n /**\n * ngdoc function\n * @name pascalprecht.translate.$translateProvider#translationNotFoundIndicatorLeft\n * @methodOf pascalprecht.translate.$translateProvider\n *\n * @description\n * Sets an indicator which is used when a translation isn't found right to the\n * translation id.\n *\n * @param {string} indicator An indicator.\n */\n this.translationNotFoundIndicatorRight = function (indicator) {\n if (!indicator) {\n return $notFoundIndicatorRight;\n }\n $notFoundIndicatorRight = indicator;\n return this;\n };\n\n /**\n * @ngdoc function\n * @name pascalprecht.translate.$translateProvider#fallbackLanguage\n * @methodOf pascalprecht.translate.$translateProvider\n *\n * @description\n * Tells the module which of the registered translation tables to use when missing translations\n * at initial startup by passing a language key. Similar to `$translateProvider#use`\n * only that it says which language to **fallback**.\n *\n * @param {string||array} langKey A language key.\n *\n */\n this.fallbackLanguage = function (langKey) {\n fallbackStack(langKey);\n return this;\n };\n\n var fallbackStack = function (langKey) {\n if (langKey) {\n if (angular.isString(langKey)) {\n $fallbackWasString = true;\n $fallbackLanguage = [ langKey ];\n } else if (angular.isArray(langKey)) {\n $fallbackWasString = false;\n $fallbackLanguage = langKey;\n }\n if (angular.isString($preferredLanguage) && indexOf($fallbackLanguage, $preferredLanguage) < 0) {\n $fallbackLanguage.push($preferredLanguage);\n }\n\n return this;\n } else {\n if ($fallbackWasString) {\n return $fallbackLanguage[0];\n } else {\n return $fallbackLanguage;\n }\n }\n };\n\n /**\n * @ngdoc function\n * @name pascalprecht.translate.$translateProvider#use\n * @methodOf pascalprecht.translate.$translateProvider\n *\n * @description\n * Set which translation table to use for translation by given language key. When\n * trying to 'use' a language which isn't provided, it'll throw an error.\n *\n * You actually don't have to use this method since `$translateProvider#preferredLanguage`\n * does the job too.\n *\n * @param {string} langKey A language key.\n */\n this.use = function (langKey) {\n if (langKey) {\n if (!$translationTable[langKey] && (!$loaderFactory)) {\n // only throw an error, when not loading translation data asynchronously\n throw new Error('$translateProvider couldn\\'t find translationTable for langKey: \\'' + langKey + '\\'');\n }\n $uses = langKey;\n return this;\n }\n return $uses;\n };\n\n /**\n * @ngdoc function\n * @name pascalprecht.translate.$translateProvider#storageKey\n * @methodOf pascalprecht.translate.$translateProvider\n *\n * @description\n * Tells the module which key must represent the choosed language by a user in the storage.\n *\n * @param {string} key A key for the storage.\n */\n var storageKey = function(key) {\n if (!key) {\n if ($storagePrefix) {\n return $storagePrefix + $storageKey;\n }\n return $storageKey;\n }\n $storageKey = key;\n return this;\n };\n\n this.storageKey = storageKey;\n\n /**\n * @ngdoc function\n * @name pascalprecht.translate.$translateProvider#useUrlLoader\n * @methodOf pascalprecht.translate.$translateProvider\n *\n * @description\n * Tells angular-translate to use `$translateUrlLoader` extension service as loader.\n *\n * @param {string} url Url\n * @param {Object=} options Optional configuration object\n */\n this.useUrlLoader = function (url, options) {\n return this.useLoader('$translateUrlLoader', angular.extend({ url: url }, options));\n };\n\n /**\n * @ngdoc function\n * @name pascalprecht.translate.$translateProvider#useStaticFilesLoader\n * @methodOf pascalprecht.translate.$translateProvider\n *\n * @description\n * Tells angular-translate to use `$translateStaticFilesLoader` extension service as loader.\n *\n * @param {Object=} options Optional configuration object\n */\n this.useStaticFilesLoader = function (options) {\n return this.useLoader('$translateStaticFilesLoader', options);\n };\n\n /**\n * @ngdoc function\n * @name pascalprecht.translate.$translateProvider#useLoader\n * @methodOf pascalprecht.translate.$translateProvider\n *\n * @description\n * Tells angular-translate to use any other service as loader.\n *\n * @param {string} loaderFactory Factory name to use\n * @param {Object=} options Optional configuration object\n */\n this.useLoader = function (loaderFactory, options) {\n $loaderFactory = loaderFactory;\n $loaderOptions = options || {};\n return this;\n };\n\n /**\n * @ngdoc function\n * @name pascalprecht.translate.$translateProvider#useLocalStorage\n * @methodOf pascalprecht.translate.$translateProvider\n *\n * @description\n * Tells angular-translate to use `$translateLocalStorage` service as storage layer.\n *\n */\n this.useLocalStorage = function () {\n return this.useStorage('$translateLocalStorage');\n };\n\n /**\n * @ngdoc function\n * @name pascalprecht.translate.$translateProvider#useCookieStorage\n * @methodOf pascalprecht.translate.$translateProvider\n *\n * @description\n * Tells angular-translate to use `$translateCookieStorage` service as storage layer.\n */\n this.useCookieStorage = function () {\n return this.useStorage('$translateCookieStorage');\n };\n\n /**\n * @ngdoc function\n * @name pascalprecht.translate.$translateProvider#useStorage\n * @methodOf pascalprecht.translate.$translateProvider\n *\n * @description\n * Tells angular-translate to use custom service as storage layer.\n */\n this.useStorage = function (storageFactory) {\n $storageFactory = storageFactory;\n return this;\n };\n\n /**\n * @ngdoc function\n * @name pascalprecht.translate.$translateProvider#storagePrefix\n * @methodOf pascalprecht.translate.$translateProvider\n *\n * @description\n * Sets prefix for storage key.\n *\n * @param {string} prefix Storage key prefix\n */\n this.storagePrefix = function (prefix) {\n if (!prefix) {\n return prefix;\n }\n $storagePrefix = prefix;\n return this;\n };\n\n /**\n * @ngdoc function\n * @name pascalprecht.translate.$translateProvider#useMissingTranslationHandlerLog\n * @methodOf pascalprecht.translate.$translateProvider\n *\n * @description\n * Tells angular-translate to use built-in log handler when trying to translate\n * a translation Id which doesn't exist.\n *\n * This is actually a shortcut method for `useMissingTranslationHandler()`.\n *\n */\n this.useMissingTranslationHandlerLog = function () {\n return this.useMissingTranslationHandler('$translateMissingTranslationHandlerLog');\n };\n\n /**\n * @ngdoc function\n * @name pascalprecht.translate.$translateProvider#useMissingTranslationHandler\n * @methodOf pascalprecht.translate.$translateProvider\n *\n * @description\n * Expects a factory name which later gets instantiated with `$injector`.\n * This method can be used to tell angular-translate to use a custom\n * missingTranslationHandler. Just build a factory which returns a function\n * and expects a translation id as argument.\n *\n * Example:\n * <pre>\n * app.config(function ($translateProvider) {\n * $translateProvider.useMissingTranslationHandler('customHandler');\n * });\n *\n * app.factory('customHandler', function (dep1, dep2) {\n * return function (translationId) {\n * // something with translationId and dep1 and dep2\n * };\n * });\n * </pre>\n *\n * @param {string} factory Factory name\n */\n this.useMissingTranslationHandler = function (factory) {\n $missingTranslationHandlerFactory = factory;\n return this;\n };\n\n /**\n * @ngdoc function\n * @name pascalprecht.translate.$translateProvider#usePostCompiling\n * @methodOf pascalprecht.translate.$translateProvider\n *\n * @description\n * If post compiling is enabled, all translated values will be processed\n * again with AngularJS' $compile.\n *\n * Example:\n * <pre>\n * app.config(function ($translateProvider) {\n * $translateProvider.usePostCompiling(true);\n * });\n * </pre>\n *\n * @param {string} factory Factory name\n */\n this.usePostCompiling = function (value) {\n $postCompilingEnabled = !(!value);\n return this;\n };\n\n /**\n * @ngdoc function\n * @name pascalprecht.translate.$translateProvider#forceAsyncReload\n * @methodOf pascalprecht.translate.$translateProvider\n *\n * @description\n * If force async reload is enabled, async loader will always be called\n * even if $translationTable already contains the language key, adding\n * possible new entries to the $translationTable.\n *\n * Example:\n * <pre>\n * app.config(function ($translateProvider) {\n * $translateProvider.forceAsyncReload(true);\n * });\n * </pre>\n *\n * @param {boolean} value - valid values are true or false\n */\n this.forceAsyncReload = function (value) {\n $forceAsyncReloadEnabled = !(!value);\n return this;\n };\n\n /**\n * @ngdoc function\n * @name pascalprecht.translate.$translateProvider#uniformLanguageTag\n * @methodOf pascalprecht.translate.$translateProvider\n *\n * @description\n * Tells angular-translate which language tag should be used as a result when determining\n * the current browser language.\n *\n * This setting must be set before invoking {@link pascalprecht.translate.$translateProvider#methods_determinePreferredLanguage determinePreferredLanguage()}.\n *\n * <pre>\n * $translateProvider\n * .uniformLanguageTag('bcp47')\n * .determinePreferredLanguage()\n * </pre>\n *\n * The resolver currently supports:\n * * default\n * (traditionally: hyphens will be converted into underscores, i.e. en-US => en_US)\n * en-US => en_US\n * en_US => en_US\n * en-us => en_us\n * * java\n * like default, but the second part will be always in uppercase\n * en-US => en_US\n * en_US => en_US\n * en-us => en_US\n * * BCP 47 (RFC 4646 & 4647)\n * en-US => en-US\n * en_US => en-US\n * en-us => en-US\n *\n * See also:\n * * http://en.wikipedia.org/wiki/IETF_language_tag\n * * http://www.w3.org/International/core/langtags/\n * * http://tools.ietf.org/html/bcp47\n *\n * @param {string|object} options - options (or standard)\n * @param {string} options.standard - valid values are 'default', 'bcp47', 'java'\n */\n this.uniformLanguageTag = function (options) {\n\n if (!options) {\n options = {};\n } else if (angular.isString(options)) {\n options = {\n standard: options\n };\n }\n\n uniformLanguageTagResolver = options.standard;\n\n return this;\n };\n\n /**\n * @ngdoc function\n * @name pascalprecht.translate.$translateProvider#determinePreferredLanguage\n * @methodOf pascalprecht.translate.$translateProvider\n *\n * @description\n * Tells angular-translate to try to determine on its own which language key\n * to set as preferred language. When `fn` is given, angular-translate uses it\n * to determine a language key, otherwise it uses the built-in `getLocale()`\n * method.\n *\n * The `getLocale()` returns a language key in the format `[lang]_[country]` or\n * `[lang]` depending on what the browser provides.\n *\n * Use this method at your own risk, since not all browsers return a valid\n * locale (see {@link pascalprecht.translate.$translateProvider#methods_uniformLanguageTag uniformLanguageTag()}).\n *\n * @param {Function=} fn Function to determine a browser's locale\n */\n this.determinePreferredLanguage = function (fn) {\n\n var locale = (fn && angular.isFunction(fn)) ? fn() : getLocale();\n\n if (!$availableLanguageKeys.length) {\n $preferredLanguage = locale;\n } else {\n $preferredLanguage = negotiateLocale(locale) || locale;\n }\n\n return this;\n };\n\n /**\n * @ngdoc function\n * @name pascalprecht.translate.$translateProvider#registerAvailableLanguageKeys\n * @methodOf pascalprecht.translate.$translateProvider\n *\n * @description\n * Registers a set of language keys the app will work with. Use this method in\n * combination with\n * {@link pascalprecht.translate.$translateProvider#determinePreferredLanguage determinePreferredLanguage}.\n * When available languages keys are registered, angular-translate\n * tries to find the best fitting language key depending on the browsers locale,\n * considering your language key convention.\n *\n * @param {object} languageKeys Array of language keys the your app will use\n * @param {object=} aliases Alias map.\n */\n this.registerAvailableLanguageKeys = function (languageKeys, aliases) {\n if (languageKeys) {\n $availableLanguageKeys = languageKeys;\n if (aliases) {\n $languageKeyAliases = aliases;\n }\n return this;\n }\n return $availableLanguageKeys;\n };\n\n /**\n * @ngdoc function\n * @name pascalprecht.translate.$translateProvider#useLoaderCache\n * @methodOf pascalprecht.translate.$translateProvider\n *\n * @description\n * Registers a cache for internal $http based loaders.\n * {@link pascalprecht.translate.$translationCache $translationCache}.\n * When false the cache will be disabled (default). When true or undefined\n * the cache will be a default (see $cacheFactory). When an object it will\n * be treat as a cache object itself: the usage is $http({cache: cache})\n *\n * @param {object} cache boolean, string or cache-object\n */\n this.useLoaderCache = function (cache) {\n if (cache === false) {\n // disable cache\n loaderCache = undefined;\n } else if (cache === true) {\n // enable cache using AJS defaults\n loaderCache = true;\n } else if (typeof(cache) === 'undefined') {\n // enable cache using default\n loaderCache = '$translationCache';\n } else if (cache) {\n // enable cache using given one (see $cacheFactory)\n loaderCache = cache;\n }\n return this;\n };\n\n /**\n * @ngdoc function\n * @name pascalprecht.translate.$translateProvider#directivePriority\n * @methodOf pascalprecht.translate.$translateProvider\n *\n * @description\n * Sets the default priority of the translate directive. The standard value is `0`.\n * Calling this function without an argument will return the current value.\n *\n * @param {number} priority for the translate-directive\n */\n this.directivePriority = function (priority) {\n if (priority === undefined) {\n // getter\n return directivePriority;\n } else {\n // setter with chaining\n directivePriority = priority;\n return this;\n }\n };\n\n /**\n * @ngdoc function\n * @name pascalprecht.translate.$translateProvider#statefulFilter\n * @methodOf pascalprecht.translate.$translateProvider\n *\n * @description\n * Since AngularJS 1.3, filters which are not stateless (depending at the scope)\n * have to explicit define this behavior.\n * Sets whether the translate filter should be stateful or stateless. The standard value is `true`\n * meaning being stateful.\n * Calling this function without an argument will return the current value.\n *\n * @param {boolean} state - defines the state of the filter\n */\n this.statefulFilter = function (state) {\n if (state === undefined) {\n // getter\n return statefulFilter;\n } else {\n // setter with chaining\n statefulFilter = state;\n return this;\n }\n };\n\n /**\n * @ngdoc object\n * @name pascalprecht.translate.$translate\n * @requires $interpolate\n * @requires $log\n * @requires $rootScope\n * @requires $q\n *\n * @description\n * The `$translate` service is the actual core of angular-translate. It expects a translation id\n * and optional interpolate parameters to translate contents.\n *\n * <pre>\n * $translate('HEADLINE_TEXT').then(function (translation) {\n * $scope.translatedText = translation;\n * });\n * </pre>\n *\n * @param {string|array} translationId A token which represents a translation id\n * This can be optionally an array of translation ids which\n * results that the function returns an object where each key\n * is the translation id and the value the translation.\n * @param {object=} interpolateParams An object hash for dynamic values\n * @param {string} interpolationId The id of the interpolation to use\n * @param {string} forceLanguage A language to be used instead of the current language\n * @returns {object} promise\n */\n this.$get = [\n '$log',\n '$injector',\n '$rootScope',\n '$q',\n function ($log, $injector, $rootScope, $q) {\n\n var Storage,\n defaultInterpolator = $injector.get($interpolationFactory || '$translateDefaultInterpolation'),\n pendingLoader = false,\n interpolatorHashMap = {},\n langPromises = {},\n fallbackIndex,\n startFallbackIteration;\n\n var $translate = function (translationId, interpolateParams, interpolationId, defaultTranslationText, forceLanguage) {\n\n var uses = (forceLanguage && forceLanguage !== $uses) ? // we don't want to re-negotiate $uses\n (negotiateLocale(forceLanguage) || forceLanguage) : $uses;\n\n // Duck detection: If the first argument is an array, a bunch of translations was requested.\n // The result is an object.\n if (angular.isArray(translationId)) {\n // Inspired by Q.allSettled by Kris Kowal\n // https://github.com/kriskowal/q/blob/b0fa72980717dc202ffc3cbf03b936e10ebbb9d7/q.js#L1553-1563\n // This transforms all promises regardless resolved or rejected\n var translateAll = function (translationIds) {\n var results = {}; // storing the actual results\n var promises = []; // promises to wait for\n // Wraps the promise a) being always resolved and b) storing the link id->value\n var translate = function (translationId) {\n var deferred = $q.defer();\n var regardless = function (value) {\n results[translationId] = value;\n deferred.resolve([translationId, value]);\n };\n // we don't care whether the promise was resolved or rejected; just store the values\n $translate(translationId, interpolateParams, interpolationId, defaultTranslationText, forceLanguage).then(regardless, regardless);\n return deferred.promise;\n };\n for (var i = 0, c = translationIds.length; i < c; i++) {\n promises.push(translate(translationIds[i]));\n }\n // wait for all (including storing to results)\n return $q.all(promises).then(function () {\n // return the results\n return results;\n });\n };\n return translateAll(translationId);\n }\n\n var deferred = $q.defer();\n\n // trim off any whitespace\n if (translationId) {\n translationId = trim.apply(translationId);\n }\n\n var promiseToWaitFor = (function () {\n var promise = $preferredLanguage ?\n langPromises[$preferredLanguage] :\n langPromises[uses];\n\n fallbackIndex = 0;\n\n if ($storageFactory && !promise) {\n // looks like there's no pending promise for $preferredLanguage or\n // $uses. Maybe there's one pending for a language that comes from\n // storage.\n var langKey = Storage.get($storageKey);\n promise = langPromises[langKey];\n\n if ($fallbackLanguage && $fallbackLanguage.length) {\n var index = indexOf($fallbackLanguage, langKey);\n // maybe the language from storage is also defined as fallback language\n // we increase the fallback language index to not search in that language\n // as fallback, since it's probably the first used language\n // in that case the index starts after the first element\n fallbackIndex = (index === 0) ? 1 : 0;\n\n // but we can make sure to ALWAYS fallback to preferred language at least\n if (indexOf($fallbackLanguage, $preferredLanguage) < 0) {\n $fallbackLanguage.push($preferredLanguage);\n }\n }\n }\n return promise;\n }());\n\n if (!promiseToWaitFor) {\n // no promise to wait for? okay. Then there's no loader registered\n // nor is a one pending for language that comes from storage.\n // We can just translate.\n determineTranslation(translationId, interpolateParams, interpolationId, defaultTranslationText, uses).then(deferred.resolve, deferred.reject);\n } else {\n var promiseResolved = function () {\n // $uses may have changed while waiting\n if (!forceLanguage) {\n uses = $uses;\n }\n determineTranslation(translationId, interpolateParams, interpolationId, defaultTranslationText, uses).then(deferred.resolve, deferred.reject);\n };\n promiseResolved.displayName = 'promiseResolved';\n\n promiseToWaitFor['finally'](promiseResolved);\n }\n return deferred.promise;\n };\n\n /**\n * @name applyNotFoundIndicators\n * @private\n *\n * @description\n * Applies not fount indicators to given translation id, if needed.\n * This function gets only executed, if a translation id doesn't exist,\n * which is why a translation id is expected as argument.\n *\n * @param {string} translationId Translation id.\n * @returns {string} Same as given translation id but applied with not found\n * indicators.\n */\n var applyNotFoundIndicators = function (translationId) {\n // applying notFoundIndicators\n if ($notFoundIndicatorLeft) {\n translationId = [$notFoundIndicatorLeft, translationId].join(' ');\n }\n if ($notFoundIndicatorRight) {\n translationId = [translationId, $notFoundIndicatorRight].join(' ');\n }\n return translationId;\n };\n\n /**\n * @name useLanguage\n * @private\n *\n * @description\n * Makes actual use of a language by setting a given language key as used\n * language and informs registered interpolators to also use the given\n * key as locale.\n *\n * @param {key} Locale key.\n */\n var useLanguage = function (key) {\n $uses = key;\n\n // make sure to store new language key before triggering success event\n if ($storageFactory) {\n Storage.put($translate.storageKey(), $uses);\n }\n\n $rootScope.$emit('$translateChangeSuccess', {language: key});\n\n // inform default interpolator\n defaultInterpolator.setLocale($uses);\n\n var eachInterpolator = function (interpolator, id) {\n interpolatorHashMap[id].setLocale($uses);\n };\n eachInterpolator.displayName = 'eachInterpolatorLocaleSetter';\n\n // inform all others too!\n angular.forEach(interpolatorHashMap, eachInterpolator);\n $rootScope.$emit('$translateChangeEnd', {language: key});\n };\n\n /**\n * @name loadAsync\n * @private\n *\n * @description\n * Kicks of registered async loader using `$injector` and applies existing\n * loader options. When resolved, it updates translation tables accordingly\n * or rejects with given language key.\n *\n * @param {string} key Language key.\n * @return {Promise} A promise.\n */\n var loadAsync = function (key) {\n if (!key) {\n throw 'No language key specified for loading.';\n }\n\n var deferred = $q.defer();\n\n $rootScope.$emit('$translateLoadingStart', {language: key});\n pendingLoader = true;\n\n var cache = loaderCache;\n if (typeof(cache) === 'string') {\n // getting on-demand instance of loader\n cache = $injector.get(cache);\n }\n\n var loaderOptions = angular.extend({}, $loaderOptions, {\n key: key,\n $http: angular.extend({}, {\n cache: cache\n }, $loaderOptions.$http)\n });\n\n var onLoaderSuccess = function (data) {\n var translationTable = {};\n $rootScope.$emit('$translateLoadingSuccess', {language: key});\n\n if (angular.isArray(data)) {\n angular.forEach(data, function (table) {\n angular.extend(translationTable, flatObject(table));\n });\n } else {\n angular.extend(translationTable, flatObject(data));\n }\n pendingLoader = false;\n deferred.resolve({\n key: key,\n table: translationTable\n });\n $rootScope.$emit('$translateLoadingEnd', {language: key});\n };\n onLoaderSuccess.displayName = 'onLoaderSuccess';\n\n var onLoaderError = function (key) {\n $rootScope.$emit('$translateLoadingError', {language: key});\n deferred.reject(key);\n $rootScope.$emit('$translateLoadingEnd', {language: key});\n };\n onLoaderError.displayName = 'onLoaderError';\n\n $injector.get($loaderFactory)(loaderOptions)\n .then(onLoaderSuccess, onLoaderError);\n\n return deferred.promise;\n };\n\n if ($storageFactory) {\n Storage = $injector.get($storageFactory);\n\n if (!Storage.get || !Storage.put) {\n throw new Error('Couldn\\'t use storage \\'' + $storageFactory + '\\', missing get() or put() method!');\n }\n }\n\n // if we have additional interpolations that were added via\n // $translateProvider.addInterpolation(), we have to map'em\n if ($interpolatorFactories.length) {\n var eachInterpolationFactory = function (interpolatorFactory) {\n var interpolator = $injector.get(interpolatorFactory);\n // setting initial locale for each interpolation service\n interpolator.setLocale($preferredLanguage || $uses);\n // make'em recognizable through id\n interpolatorHashMap[interpolator.getInterpolationIdentifier()] = interpolator;\n };\n eachInterpolationFactory.displayName = 'interpolationFactoryAdder';\n\n angular.forEach($interpolatorFactories, eachInterpolationFactory);\n }\n\n /**\n * @name getTranslationTable\n * @private\n *\n * @description\n * Returns a promise that resolves to the translation table\n * or is rejected if an error occurred.\n *\n * @param langKey\n * @returns {Q.promise}\n */\n var getTranslationTable = function (langKey) {\n var deferred = $q.defer();\n if (Object.prototype.hasOwnProperty.call($translationTable, langKey)) {\n deferred.resolve($translationTable[langKey]);\n } else if (langPromises[langKey]) {\n var onResolve = function (data) {\n translations(data.key, data.table);\n deferred.resolve(data.table);\n };\n onResolve.displayName = 'translationTableResolver';\n langPromises[langKey].then(onResolve, deferred.reject);\n } else {\n deferred.reject();\n }\n return deferred.promise;\n };\n\n /**\n * @name getFallbackTranslation\n * @private\n *\n * @description\n * Returns a promise that will resolve to the translation\n * or be rejected if no translation was found for the language.\n * This function is currently only used for fallback language translation.\n *\n * @param langKey The language to translate to.\n * @param translationId\n * @param interpolateParams\n * @param Interpolator\n * @returns {Q.promise}\n */\n var getFallbackTranslation = function (langKey, translationId, interpolateParams, Interpolator) {\n var deferred = $q.defer();\n\n var onResolve = function (translationTable) {\n if (Object.prototype.hasOwnProperty.call(translationTable, translationId)) {\n Interpolator.setLocale(langKey);\n var translation = translationTable[translationId];\n if (translation.substr(0, 2) === '@:') {\n getFallbackTranslation(langKey, translation.substr(2), interpolateParams, Interpolator)\n .then(deferred.resolve, deferred.reject);\n } else {\n deferred.resolve(Interpolator.interpolate(translationTable[translationId], interpolateParams));\n }\n Interpolator.setLocale($uses);\n } else {\n deferred.reject();\n }\n };\n onResolve.displayName = 'fallbackTranslationResolver';\n\n getTranslationTable(langKey).then(onResolve, deferred.reject);\n\n return deferred.promise;\n };\n\n /**\n * @name getFallbackTranslationInstant\n * @private\n *\n * @description\n * Returns a translation\n * This function is currently only used for fallback language translation.\n *\n * @param langKey The language to translate to.\n * @param translationId\n * @param interpolateParams\n * @param Interpolator\n * @returns {string} translation\n */\n var getFallbackTranslationInstant = function (langKey, translationId, interpolateParams, Interpolator) {\n var result, translationTable = $translationTable[langKey];\n\n if (translationTable && Object.prototype.hasOwnProperty.call(translationTable, translationId)) {\n Interpolator.setLocale(langKey);\n result = Interpolator.interpolate(translationTable[translationId], interpolateParams);\n if (result.substr(0, 2) === '@:') {\n return getFallbackTranslationInstant(langKey, result.substr(2), interpolateParams, Interpolator);\n }\n Interpolator.setLocale($uses);\n }\n\n return result;\n };\n\n\n /**\n * @name translateByHandler\n * @private\n *\n * Translate by missing translation handler.\n *\n * @param translationId\n * @returns translation created by $missingTranslationHandler or translationId is $missingTranslationHandler is\n * absent\n */\n var translateByHandler = function (translationId, interpolateParams) {\n // If we have a handler factory - we might also call it here to determine if it provides\n // a default text for a translationid that can't be found anywhere in our tables\n if ($missingTranslationHandlerFactory) {\n var resultString = $injector.get($missingTranslationHandlerFactory)(translationId, $uses, interpolateParams);\n if (resultString !== undefined) {\n return resultString;\n } else {\n return translationId;\n }\n } else {\n return translationId;\n }\n };\n\n /**\n * @name resolveForFallbackLanguage\n * @private\n *\n * Recursive helper function for fallbackTranslation that will sequentially look\n * for a translation in the fallbackLanguages starting with fallbackLanguageIndex.\n *\n * @param fallbackLanguageIndex\n * @param translationId\n * @param interpolateParams\n * @param Interpolator\n * @returns {Q.promise} Promise that will resolve to the translation.\n */\n var resolveForFallbackLanguage = function (fallbackLanguageIndex, translationId, interpolateParams, Interpolator, defaultTranslationText) {\n var deferred = $q.defer();\n\n if (fallbackLanguageIndex < $fallbackLanguage.length) {\n var langKey = $fallbackLanguage[fallbackLanguageIndex];\n getFallbackTranslation(langKey, translationId, interpolateParams, Interpolator).then(\n deferred.resolve,\n function () {\n // Look in the next fallback language for a translation.\n // It delays the resolving by passing another promise to resolve.\n resolveForFallbackLanguage(fallbackLanguageIndex + 1, translationId, interpolateParams, Interpolator, defaultTranslationText).then(deferred.resolve);\n }\n );\n } else {\n // No translation found in any fallback language\n // if a default translation text is set in the directive, then return this as a result\n if (defaultTranslationText) {\n deferred.resolve(defaultTranslationText);\n } else {\n // if no default translation is set and an error handler is defined, send it to the handler\n // and then return the result\n deferred.resolve(translateByHandler(translationId, interpolateParams));\n }\n }\n return deferred.promise;\n };\n\n /**\n * @name resolveForFallbackLanguageInstant\n * @private\n *\n * Recursive helper function for fallbackTranslation that will sequentially look\n * for a translation in the fallbackLanguages starting with fallbackLanguageIndex.\n *\n * @param fallbackLanguageIndex\n * @param translationId\n * @param interpolateParams\n * @param Interpolator\n * @returns {string} translation\n */\n var resolveForFallbackLanguageInstant = function (fallbackLanguageIndex, translationId, interpolateParams, Interpolator) {\n var result;\n\n if (fallbackLanguageIndex < $fallbackLanguage.length) {\n var langKey = $fallbackLanguage[fallbackLanguageIndex];\n result = getFallbackTranslationInstant(langKey, translationId, interpolateParams, Interpolator);\n if (!result) {\n result = resolveForFallbackLanguageInstant(fallbackLanguageIndex + 1, translationId, interpolateParams, Interpolator);\n }\n }\n return result;\n };\n\n /**\n * Translates with the usage of the fallback languages.\n *\n * @param translationId\n * @param interpolateParams\n * @param Interpolator\n * @returns {Q.promise} Promise, that resolves to the translation.\n */\n var fallbackTranslation = function (translationId, interpolateParams, Interpolator, defaultTranslationText) {\n // Start with the fallbackLanguage with index 0\n return resolveForFallbackLanguage((startFallbackIteration>0 ? startFallbackIteration : fallbackIndex), translationId, interpolateParams, Interpolator, defaultTranslationText);\n };\n\n /**\n * Translates with the usage of the fallback languages.\n *\n * @param translationId\n * @param interpolateParams\n * @param Interpolator\n * @returns {String} translation\n */\n var fallbackTranslationInstant = function (translationId, interpolateParams, Interpolator) {\n // Start with the fallbackLanguage with index 0\n return resolveForFallbackLanguageInstant((startFallbackIteration>0 ? startFallbackIteration : fallbackIndex), translationId, interpolateParams, Interpolator);\n };\n\n var determineTranslation = function (translationId, interpolateParams, interpolationId, defaultTranslationText, uses) {\n\n var deferred = $q.defer();\n\n var table = uses ? $translationTable[uses] : $translationTable,\n Interpolator = (interpolationId) ? interpolatorHashMap[interpolationId] : defaultInterpolator;\n\n // if the translation id exists, we can just interpolate it\n if (table && Object.prototype.hasOwnProperty.call(table, translationId)) {\n var translation = table[translationId];\n\n // If using link, rerun $translate with linked translationId and return it\n if (translation.substr(0, 2) === '@:') {\n\n $translate(translation.substr(2), interpolateParams, interpolationId, defaultTranslationText, uses)\n .then(deferred.resolve, deferred.reject);\n } else {\n deferred.resolve(Interpolator.interpolate(translation, interpolateParams));\n }\n } else {\n var missingTranslationHandlerTranslation;\n // for logging purposes only (as in $translateMissingTranslationHandlerLog), value is not returned to promise\n if ($missingTranslationHandlerFactory && !pendingLoader) {\n missingTranslationHandlerTranslation = translateByHandler(translationId, interpolateParams);\n }\n\n // since we couldn't translate the inital requested translation id,\n // we try it now with one or more fallback languages, if fallback language(s) is\n // configured.\n if (uses && $fallbackLanguage && $fallbackLanguage.length) {\n fallbackTranslation(translationId, interpolateParams, Interpolator, defaultTranslationText)\n .then(function (translation) {\n deferred.resolve(translation);\n }, function (_translationId) {\n deferred.reject(applyNotFoundIndicators(_translationId));\n });\n } else if ($missingTranslationHandlerFactory && !pendingLoader && missingTranslationHandlerTranslation) {\n // looks like the requested translation id doesn't exists.\n // Now, if there is a registered handler for missing translations and no\n // asyncLoader is pending, we execute the handler\n if (defaultTranslationText) {\n deferred.resolve(defaultTranslationText);\n } else {\n deferred.resolve(missingTranslationHandlerTranslation);\n }\n } else {\n if (defaultTranslationText) {\n deferred.resolve(defaultTranslationText);\n } else {\n deferred.reject(applyNotFoundIndicators(translationId));\n }\n }\n }\n return deferred.promise;\n };\n\n var determineTranslationInstant = function (translationId, interpolateParams, interpolationId, uses) {\n\n var result, table = uses ? $translationTable[uses] : $translationTable,\n Interpolator = defaultInterpolator;\n\n // if the interpolation id exists use custom interpolator\n if (interpolatorHashMap && Object.prototype.hasOwnProperty.call(interpolatorHashMap, interpolationId)) {\n Interpolator = interpolatorHashMap[interpolationId];\n }\n\n // if the translation id exists, we can just interpolate it\n if (table && Object.prototype.hasOwnProperty.call(table, translationId)) {\n var translation = table[translationId];\n\n // If using link, rerun $translate with linked translationId and return it\n if (translation.substr(0, 2) === '@:') {\n result = determineTranslationInstant(translation.substr(2), interpolateParams, interpolationId, uses);\n } else {\n result = Interpolator.interpolate(translation, interpolateParams);\n }\n } else {\n var missingTranslationHandlerTranslation;\n // for logging purposes only (as in $translateMissingTranslationHandlerLog), value is not returned to promise\n if ($missingTranslationHandlerFactory && !pendingLoader) {\n missingTranslationHandlerTranslation = translateByHandler(translationId, interpolateParams);\n }\n\n // since we couldn't translate the inital requested translation id,\n // we try it now with one or more fallback languages, if fallback language(s) is\n // configured.\n if (uses && $fallbackLanguage && $fallbackLanguage.length) {\n fallbackIndex = 0;\n result = fallbackTranslationInstant(translationId, interpolateParams, Interpolator);\n } else if ($missingTranslationHandlerFactory && !pendingLoader && missingTranslationHandlerTranslation) {\n // looks like the requested translation id doesn't exists.\n // Now, if there is a registered handler for missing translations and no\n // asyncLoader is pending, we execute the handler\n result = missingTranslationHandlerTranslation;\n } else {\n result = applyNotFoundIndicators(translationId);\n }\n }\n\n return result;\n };\n\n var clearNextLangAndPromise = function(key) {\n if ($nextLang === key) {\n $nextLang = undefined;\n }\n langPromises[key] = undefined;\n };\n\n /**\n * @ngdoc function\n * @name pascalprecht.translate.$translate#preferredLanguage\n * @methodOf pascalprecht.translate.$translate\n *\n * @description\n * Returns the language key for the preferred language.\n *\n * @param {string} langKey language String or Array to be used as preferredLanguage (changing at runtime)\n *\n * @return {string} preferred language key\n */\n $translate.preferredLanguage = function (langKey) {\n if(langKey) {\n setupPreferredLanguage(langKey);\n }\n return $preferredLanguage;\n };\n\n /**\n * @ngdoc function\n * @name pascalprecht.translate.$translate#cloakClassName\n * @methodOf pascalprecht.translate.$translate\n *\n * @description\n * Returns the configured class name for `translate-cloak` directive.\n *\n * @return {string} cloakClassName\n */\n $translate.cloakClassName = function () {\n return $cloakClassName;\n };\n\n /**\n * @ngdoc function\n * @name pascalprecht.translate.$translate#nestedObjectDelimeter\n * @methodOf pascalprecht.translate.$translate\n *\n * @description\n * Returns the configured delimiter for nested namespaces.\n *\n * @return {string} nestedObjectDelimeter\n */\n $translate.nestedObjectDelimeter = function () {\n return $nestedObjectDelimeter;\n };\n\n /**\n * @ngdoc function\n * @name pascalprecht.translate.$translate#fallbackLanguage\n * @methodOf pascalprecht.translate.$translate\n *\n * @description\n * Returns the language key for the fallback languages or sets a new fallback stack.\n *\n * @param {string=} langKey language String or Array of fallback languages to be used (to change stack at runtime)\n *\n * @return {string||array} fallback language key\n */\n $translate.fallbackLanguage = function (langKey) {\n if (langKey !== undefined && langKey !== null) {\n fallbackStack(langKey);\n\n // as we might have an async loader initiated and a new translation language might have been defined\n // we need to add the promise to the stack also. So - iterate.\n if ($loaderFactory) {\n if ($fallbackLanguage && $fallbackLanguage.length) {\n for (var i = 0, len = $fallbackLanguage.length; i < len; i++) {\n if (!langPromises[$fallbackLanguage[i]]) {\n langPromises[$fallbackLanguage[i]] = loadAsync($fallbackLanguage[i]);\n }\n }\n }\n }\n $translate.use($translate.use());\n }\n if ($fallbackWasString) {\n return $fallbackLanguage[0];\n } else {\n return $fallbackLanguage;\n }\n\n };\n\n /**\n * @ngdoc function\n * @name pascalprecht.translate.$translate#useFallbackLanguage\n * @methodOf pascalprecht.translate.$translate\n *\n * @description\n * Sets the first key of the fallback language stack to be used for translation.\n * Therefore all languages in the fallback array BEFORE this key will be skipped!\n *\n * @param {string=} langKey Contains the langKey the iteration shall start with. Set to false if you want to\n * get back to the whole stack\n */\n $translate.useFallbackLanguage = function (langKey) {\n if (langKey !== undefined && langKey !== null) {\n if (!langKey) {\n startFallbackIteration = 0;\n } else {\n var langKeyPosition = indexOf($fallbackLanguage, langKey);\n if (langKeyPosition > -1) {\n startFallbackIteration = langKeyPosition;\n }\n }\n\n }\n\n };\n\n /**\n * @ngdoc function\n * @name pascalprecht.translate.$translate#proposedLanguage\n * @methodOf pascalprecht.translate.$translate\n *\n * @description\n * Returns the language key of language that is currently loaded asynchronously.\n *\n * @return {string} language key\n */\n $translate.proposedLanguage = function () {\n return $nextLang;\n };\n\n /**\n * @ngdoc function\n * @name pascalprecht.translate.$translate#storage\n * @methodOf pascalprecht.translate.$translate\n *\n * @description\n * Returns registered storage.\n *\n * @return {object} Storage\n */\n $translate.storage = function () {\n return Storage;\n };\n\n /**\n * @ngdoc function\n * @name pascalprecht.translate.$translate#negotiateLocale\n * @methodOf pascalprecht.translate.$translate\n *\n * @description\n * Returns a language key based on available languages and language aliases. If a\n * language key cannot be resolved, returns undefined.\n *\n * If no or a falsy key is given, returns undefined.\n *\n * @param {string} [key] Language key\n * @return {string|undefined} Language key or undefined if no language key is found.\n */\n $translate.negotiateLocale = negotiateLocale;\n\n /**\n * @ngdoc function\n * @name pascalprecht.translate.$translate#use\n * @methodOf pascalprecht.translate.$translate\n *\n * @description\n * Tells angular-translate which language to use by given language key. This method is\n * used to change language at runtime. It also takes care of storing the language\n * key in a configured store to let your app remember the choosed language.\n *\n * When trying to 'use' a language which isn't available it tries to load it\n * asynchronously with registered loaders.\n *\n * Returns promise object with loaded language file data or string of the currently used language.\n *\n * If no or a falsy key is given it returns the currently used language key.\n * The returned string will be ```undefined``` if setting up $translate hasn't finished.\n * @example\n * $translate.use(\"en_US\").then(function(data){\n * $scope.text = $translate(\"HELLO\");\n * });\n *\n * @param {string} [key] Language key\n * @return {object|string} Promise with loaded language data or the language key if a falsy param was given.\n */\n $translate.use = function (key) {\n if (!key) {\n return $uses;\n }\n\n var deferred = $q.defer();\n\n $rootScope.$emit('$translateChangeStart', {language: key});\n\n // Try to get the aliased language key\n var aliasedKey = negotiateLocale(key);\n if (aliasedKey) {\n key = aliasedKey;\n }\n\n // if there isn't a translation table for the language we've requested,\n // we load it asynchronously\n $nextLang = key;\n if (($forceAsyncReloadEnabled || !$translationTable[key]) && $loaderFactory && !langPromises[key]) {\n langPromises[key] = loadAsync(key).then(function (translation) {\n translations(translation.key, translation.table);\n deferred.resolve(translation.key);\n if ($nextLang === key) {\n useLanguage(translation.key);\n }\n return translation;\n }, function (key) {\n $rootScope.$emit('$translateChangeError', {language: key});\n deferred.reject(key);\n $rootScope.$emit('$translateChangeEnd', {language: key});\n return $q.reject(key);\n });\n langPromises[key]['finally'](function () {\n clearNextLangAndPromise(key);\n });\n } else if (langPromises[key]) {\n // we are already loading this asynchronously\n // resolve our new deferred when the old langPromise is resolved\n langPromises[key].then(function (translation) {\n if ($nextLang === translation.key) {\n useLanguage(translation.key);\n }\n deferred.resolve(translation.key);\n return translation;\n }, function (key) {\n // find first available fallback language if that request has failed\n if (!$uses && $fallbackLanguage && $fallbackLanguage.length > 0) {\n return $translate.use($fallbackLanguage[0]).then(deferred.resolve, deferred.reject);\n } else {\n return deferred.reject(key);\n }\n });\n } else {\n deferred.resolve(key);\n useLanguage(key);\n }\n\n return deferred.promise;\n };\n\n /**\n * @ngdoc function\n * @name pascalprecht.translate.$translate#storageKey\n * @methodOf pascalprecht.translate.$translate\n *\n * @description\n * Returns the key for the storage.\n *\n * @return {string} storage key\n */\n $translate.storageKey = function () {\n return storageKey();\n };\n\n /**\n * @ngdoc function\n * @name pascalprecht.translate.$translate#isPostCompilingEnabled\n * @methodOf pascalprecht.translate.$translate\n *\n * @description\n * Returns whether post compiling is enabled or not\n *\n * @return {bool} storage key\n */\n $translate.isPostCompilingEnabled = function () {\n return $postCompilingEnabled;\n };\n\n /**\n * @ngdoc function\n * @name pascalprecht.translate.$translate#isForceAsyncReloadEnabled\n * @methodOf pascalprecht.translate.$translate\n *\n * @description\n * Returns whether force async reload is enabled or not\n *\n * @return {boolean} forceAsyncReload value\n */\n $translate.isForceAsyncReloadEnabled = function () {\n return $forceAsyncReloadEnabled;\n };\n\n /**\n * @ngdoc function\n * @name pascalprecht.translate.$translate#refresh\n * @methodOf pascalprecht.translate.$translate\n *\n * @description\n * Refreshes a translation table pointed by the given langKey. If langKey is not specified,\n * the module will drop all existent translation tables and load new version of those which\n * are currently in use.\n *\n * Refresh means that the module will drop target translation table and try to load it again.\n *\n * In case there are no loaders registered the refresh() method will throw an Error.\n *\n * If the module is able to refresh translation tables refresh() method will broadcast\n * $translateRefreshStart and $translateRefreshEnd events.\n *\n * @example\n * // this will drop all currently existent translation tables and reload those which are\n * // currently in use\n * $translate.refresh();\n * // this will refresh a translation table for the en_US language\n * $translate.refresh('en_US');\n *\n * @param {string} langKey A language key of the table, which has to be refreshed\n *\n * @return {promise} Promise, which will be resolved in case a translation tables refreshing\n * process is finished successfully, and reject if not.\n */\n $translate.refresh = function (langKey) {\n if (!$loaderFactory) {\n throw new Error('Couldn\\'t refresh translation table, no loader registered!');\n }\n\n var deferred = $q.defer();\n\n function resolve() {\n deferred.resolve();\n $rootScope.$emit('$translateRefreshEnd', {language: langKey});\n }\n\n function reject() {\n deferred.reject();\n $rootScope.$emit('$translateRefreshEnd', {language: langKey});\n }\n\n $rootScope.$emit('$translateRefreshStart', {language: langKey});\n\n if (!langKey) {\n // if there's no language key specified we refresh ALL THE THINGS!\n var tables = [], loadingKeys = {};\n\n // reload registered fallback languages\n if ($fallbackLanguage && $fallbackLanguage.length) {\n for (var i = 0, len = $fallbackLanguage.length; i < len; i++) {\n tables.push(loadAsync($fallbackLanguage[i]));\n loadingKeys[$fallbackLanguage[i]] = true;\n }\n }\n\n // reload currently used language\n if ($uses && !loadingKeys[$uses]) {\n tables.push(loadAsync($uses));\n }\n\n var allTranslationsLoaded = function (tableData) {\n $translationTable = {};\n angular.forEach(tableData, function (data) {\n translations(data.key, data.table);\n });\n if ($uses) {\n useLanguage($uses);\n }\n resolve();\n };\n allTranslationsLoaded.displayName = 'refreshPostProcessor';\n\n $q.all(tables).then(allTranslationsLoaded, reject);\n\n } else if ($translationTable[langKey]) {\n\n var oneTranslationsLoaded = function (data) {\n translations(data.key, data.table);\n if (langKey === $uses) {\n useLanguage($uses);\n }\n resolve();\n };\n oneTranslationsLoaded.displayName = 'refreshPostProcessor';\n\n loadAsync(langKey).then(oneTranslationsLoaded, reject);\n\n } else {\n reject();\n }\n return deferred.promise;\n };\n\n /**\n * @ngdoc function\n * @name pascalprecht.translate.$translate#instant\n * @methodOf pascalprecht.translate.$translate\n *\n * @description\n * Returns a translation instantly from the internal state of loaded translation. All rules\n * regarding the current language, the preferred language of even fallback languages will be\n * used except any promise handling. If a language was not found, an asynchronous loading\n * will be invoked in the background.\n *\n * @param {string|array} translationId A token which represents a translation id\n * This can be optionally an array of translation ids which\n * results that the function's promise returns an object where\n * each key is the translation id and the value the translation.\n * @param {object} interpolateParams Params\n * @param {string} interpolationId The id of the interpolation to use\n * @param {string} forceLanguage A language to be used instead of the current language\n *\n * @return {string|object} translation\n */\n $translate.instant = function (translationId, interpolateParams, interpolationId, forceLanguage) {\n\n // we don't want to re-negotiate $uses\n var uses = (forceLanguage && forceLanguage !== $uses) ? // we don't want to re-negotiate $uses\n (negotiateLocale(forceLanguage) || forceLanguage) : $uses;\n\n // Detect undefined and null values to shorten the execution and prevent exceptions\n if (translationId === null || angular.isUndefined(translationId)) {\n return translationId;\n }\n\n // Duck detection: If the first argument is an array, a bunch of translations was requested.\n // The result is an object.\n if (angular.isArray(translationId)) {\n var results = {};\n for (var i = 0, c = translationId.length; i < c; i++) {\n results[translationId[i]] = $translate.instant(translationId[i], interpolateParams, interpolationId, forceLanguage);\n }\n return results;\n }\n\n // We discarded unacceptable values. So we just need to verify if translationId is empty String\n if (angular.isString(translationId) && translationId.length < 1) {\n return translationId;\n }\n\n // trim off any whitespace\n if (translationId) {\n translationId = trim.apply(translationId);\n }\n\n var result, possibleLangKeys = [];\n if ($preferredLanguage) {\n possibleLangKeys.push($preferredLanguage);\n }\n if (uses) {\n possibleLangKeys.push(uses);\n }\n if ($fallbackLanguage && $fallbackLanguage.length) {\n possibleLangKeys = possibleLangKeys.concat($fallbackLanguage);\n }\n for (var j = 0, d = possibleLangKeys.length; j < d; j++) {\n var possibleLangKey = possibleLangKeys[j];\n if ($translationTable[possibleLangKey]) {\n if (typeof $translationTable[possibleLangKey][translationId] !== 'undefined') {\n result = determineTranslationInstant(translationId, interpolateParams, interpolationId, uses);\n }\n }\n if (typeof result !== 'undefined') {\n break;\n }\n }\n\n if (!result && result !== '') {\n if ($notFoundIndicatorLeft || $notFoundIndicatorRight) {\n result = applyNotFoundIndicators(translationId);\n } else {\n // Return translation of default interpolator if not found anything.\n result = defaultInterpolator.interpolate(translationId, interpolateParams);\n if ($missingTranslationHandlerFactory && !pendingLoader) {\n result = translateByHandler(translationId, interpolateParams);\n }\n }\n }\n\n return result;\n };\n\n /**\n * @ngdoc function\n * @name pascalprecht.translate.$translate#versionInfo\n * @methodOf pascalprecht.translate.$translate\n *\n * @description\n * Returns the current version information for the angular-translate library\n *\n * @return {string} angular-translate version\n */\n $translate.versionInfo = function () {\n return version;\n };\n\n /**\n * @ngdoc function\n * @name pascalprecht.translate.$translate#loaderCache\n * @methodOf pascalprecht.translate.$translate\n *\n * @description\n * Returns the defined loaderCache.\n *\n * @return {boolean|string|object} current value of loaderCache\n */\n $translate.loaderCache = function () {\n return loaderCache;\n };\n\n // internal purpose only\n $translate.directivePriority = function () {\n return directivePriority;\n };\n\n // internal purpose only\n $translate.statefulFilter = function () {\n return statefulFilter;\n };\n\n /**\n * @ngdoc function\n * @name pascalprecht.translate.$translate#isReady\n * @methodOf pascalprecht.translate.$translate\n *\n * @description\n * Returns whether the service is \"ready\" to translate (i.e. loading 1st language).\n *\n * See also {@link pascalprecht.translate.$translate#methods_onReady onReady()}.\n *\n * @return {boolean} current value of ready\n */\n $translate.isReady = function () {\n return $isReady;\n };\n\n var $onReadyDeferred = $q.defer();\n $onReadyDeferred.promise.then(function () {\n $isReady = true;\n });\n\n /**\n * @ngdoc function\n * @name pascalprecht.translate.$translate#onReady\n * @methodOf pascalprecht.translate.$translate\n *\n * @description\n * Returns whether the service is \"ready\" to translate (i.e. loading 1st language).\n *\n * See also {@link pascalprecht.translate.$translate#methods_isReady isReady()}.\n *\n * @param {Function=} fn Function to invoke when service is ready\n * @return {object} Promise resolved when service is ready\n */\n $translate.onReady = function (fn) {\n var deferred = $q.defer();\n if (angular.isFunction(fn)) {\n deferred.promise.then(fn);\n }\n if ($isReady) {\n deferred.resolve();\n } else {\n $onReadyDeferred.promise.then(deferred.resolve);\n }\n return deferred.promise;\n };\n\n // Whenever $translateReady is being fired, this will ensure the state of $isReady\n var globalOnReadyListener = $rootScope.$on('$translateReady', function () {\n $onReadyDeferred.resolve();\n globalOnReadyListener(); // one time only\n globalOnReadyListener = null;\n });\n var globalOnChangeListener = $rootScope.$on('$translateChangeEnd', function () {\n $onReadyDeferred.resolve();\n globalOnChangeListener(); // one time only\n globalOnChangeListener = null;\n });\n\n if ($loaderFactory) {\n\n // If at least one async loader is defined and there are no\n // (default) translations available we should try to load them.\n if (angular.equals($translationTable, {})) {\n if ($translate.use()) {\n $translate.use($translate.use());\n }\n }\n\n // Also, if there are any fallback language registered, we start\n // loading them asynchronously as soon as we can.\n if ($fallbackLanguage && $fallbackLanguage.length) {\n var processAsyncResult = function (translation) {\n translations(translation.key, translation.table);\n $rootScope.$emit('$translateChangeEnd', { language: translation.key });\n return translation;\n };\n for (var i = 0, len = $fallbackLanguage.length; i < len; i++) {\n var fallbackLanguageId = $fallbackLanguage[i];\n if ($forceAsyncReloadEnabled || !$translationTable[fallbackLanguageId]) {\n langPromises[fallbackLanguageId] = loadAsync(fallbackLanguageId).then(processAsyncResult);\n }\n }\n }\n } else {\n $rootScope.$emit('$translateReady', { language: $translate.use() });\n }\n\n return $translate;\n }\n ];\n}\n$translate.$inject = ['$STORAGE_KEY', '$windowProvider', '$translateSanitizationProvider', 'pascalprechtTranslateOverrider'];\n\n$translate.displayName = 'displayName';\n\n/**\n * @ngdoc object\n * @name pascalprecht.translate.$translateDefaultInterpolation\n * @requires $interpolate\n *\n * @description\n * Uses angular's `$interpolate` services to interpolate strings against some values.\n *\n * Be aware to configure a proper sanitization strategy.\n *\n * See also:\n * * {@link pascalprecht.translate.$translateSanitization}\n *\n * @return {object} $translateDefaultInterpolation Interpolator service\n */\nangular.module('pascalprecht.translate').factory('$translateDefaultInterpolation', $translateDefaultInterpolation);\n\nfunction $translateDefaultInterpolation ($interpolate, $translateSanitization) {\n\n 'use strict';\n\n var $translateInterpolator = {},\n $locale,\n $identifier = 'default';\n\n /**\n * @ngdoc function\n * @name pascalprecht.translate.$translateDefaultInterpolation#setLocale\n * @methodOf pascalprecht.translate.$translateDefaultInterpolation\n *\n * @description\n * Sets current locale (this is currently not use in this interpolation).\n *\n * @param {string} locale Language key or locale.\n */\n $translateInterpolator.setLocale = function (locale) {\n $locale = locale;\n };\n\n /**\n * @ngdoc function\n * @name pascalprecht.translate.$translateDefaultInterpolation#getInterpolationIdentifier\n * @methodOf pascalprecht.translate.$translateDefaultInterpolation\n *\n * @description\n * Returns an identifier for this interpolation service.\n *\n * @returns {string} $identifier\n */\n $translateInterpolator.getInterpolationIdentifier = function () {\n return $identifier;\n };\n\n /**\n * @deprecated will be removed in 3.0\n * @see {@link pascalprecht.translate.$translateSanitization}\n */\n $translateInterpolator.useSanitizeValueStrategy = function (value) {\n $translateSanitization.useStrategy(value);\n return this;\n };\n\n /**\n * @ngdoc function\n * @name pascalprecht.translate.$translateDefaultInterpolation#interpolate\n * @methodOf pascalprecht.translate.$translateDefaultInterpolation\n *\n * @description\n * Interpolates given string agains given interpolate params using angulars\n * `$interpolate` service.\n *\n * @returns {string} interpolated string.\n */\n $translateInterpolator.interpolate = function (string, interpolationParams) {\n interpolationParams = interpolationParams || {};\n interpolationParams = $translateSanitization.sanitize(interpolationParams, 'params');\n\n var interpolatedText = $interpolate(string)(interpolationParams);\n interpolatedText = $translateSanitization.sanitize(interpolatedText, 'text');\n\n return interpolatedText;\n };\n\n return $translateInterpolator;\n}\n$translateDefaultInterpolation.$inject = ['$interpolate', '$translateSanitization'];\n\n$translateDefaultInterpolation.displayName = '$translateDefaultInterpolation';\n\nangular.module('pascalprecht.translate').constant('$STORAGE_KEY', 'NG_TRANSLATE_LANG_KEY');\n\nangular.module('pascalprecht.translate')\n/**\n * @ngdoc directive\n * @name pascalprecht.translate.directive:translate\n * @requires $compile\n * @requires $filter\n * @requires $interpolate\n * @restrict AE\n *\n * @description\n * Translates given translation id either through attribute or DOM content.\n * Internally it uses `translate` filter to translate translation id. It possible to\n * pass an optional `translate-values` object literal as string into translation id.\n *\n * @param {string=} translate Translation id which could be either string or interpolated string.\n * @param {string=} translate-values Values to pass into translation id. Can be passed as object literal string or interpolated object.\n * @param {string=} translate-attr-ATTR translate Translation id and put it into ATTR attribute.\n * @param {string=} translate-default will be used unless translation was successful\n * @param {boolean=} translate-compile (default true if present) defines locally activation of {@link pascalprecht.translate.$translateProvider#methods_usePostCompiling}\n *\n * @example\n <example module=\"ngView\">\n <file name=\"index.html\">\n <div ng-controller=\"TranslateCtrl\">\n\n <pre translate=\"TRANSLATION_ID\"></pre>\n <pre translate>TRANSLATION_ID</pre>\n <pre translate translate-attr-title=\"TRANSLATION_ID\"></pre>\n <pre translate=\"{{translationId}}\"></pre>\n <pre translate>{{translationId}}</pre>\n <pre translate=\"WITH_VALUES\" translate-values=\"{value: 5}\"></pre>\n <pre translate translate-values=\"{value: 5}\">WITH_VALUES</pre>\n <pre translate=\"WITH_VALUES\" translate-values=\"{{values}}\"></pre>\n <pre translate translate-values=\"{{values}}\">WITH_VALUES</pre>\n <pre translate translate-attr-title=\"WITH_VALUES\" translate-values=\"{{values}}\"></pre>\n\n </div>\n </file>\n <file name=\"script.js\">\n angular.module('ngView', ['pascalprecht.translate'])\n\n .config(function ($translateProvider) {\n\n $translateProvider.translations('en',{\n 'TRANSLATION_ID': 'Hello there!',\n 'WITH_VALUES': 'The following value is dynamic: {{value}}'\n }).preferredLanguage('en');\n\n });\n\n angular.module('ngView').controller('TranslateCtrl', function ($scope) {\n $scope.translationId = 'TRANSLATION_ID';\n\n $scope.values = {\n value: 78\n };\n });\n </file>\n <file name=\"scenario.js\">\n it('should translate', function () {\n inject(function ($rootScope, $compile) {\n $rootScope.translationId = 'TRANSLATION_ID';\n\n element = $compile('<p translate=\"TRANSLATION_ID\"></p>')($rootScope);\n $rootScope.$digest();\n expect(element.text()).toBe('Hello there!');\n\n element = $compile('<p translate=\"{{translationId}}\"></p>')($rootScope);\n $rootScope.$digest();\n expect(element.text()).toBe('Hello there!');\n\n element = $compile('<p translate>TRANSLATION_ID</p>')($rootScope);\n $rootScope.$digest();\n expect(element.text()).toBe('Hello there!');\n\n element = $compile('<p translate>{{translationId}}</p>')($rootScope);\n $rootScope.$digest();\n expect(element.text()).toBe('Hello there!');\n\n element = $compile('<p translate translate-attr-title=\"TRANSLATION_ID\"></p>')($rootScope);\n $rootScope.$digest();\n expect(element.attr('title')).toBe('Hello there!');\n });\n });\n </file>\n </example>\n */\n.directive('translate', translateDirective);\nfunction translateDirective($translate, $q, $interpolate, $compile, $parse, $rootScope) {\n\n 'use strict';\n\n /**\n * @name trim\n * @private\n *\n * @description\n * trim polyfill\n *\n * @returns {string} The string stripped of whitespace from both ends\n */\n var trim = function() {\n return this.toString().replace(/^\\s+|\\s+$/g, '');\n };\n\n return {\n restrict: 'AE',\n scope: true,\n priority: $translate.directivePriority(),\n compile: function (tElement, tAttr) {\n\n var translateValuesExist = (tAttr.translateValues) ?\n tAttr.translateValues : undefined;\n\n var translateInterpolation = (tAttr.translateInterpolation) ?\n tAttr.translateInterpolation : undefined;\n\n var translateValueExist = tElement[0].outerHTML.match(/translate-value-+/i);\n\n var interpolateRegExp = '^(.*)(' + $interpolate.startSymbol() + '.*' + $interpolate.endSymbol() + ')(.*)',\n watcherRegExp = '^(.*)' + $interpolate.startSymbol() + '(.*)' + $interpolate.endSymbol() + '(.*)';\n\n return function linkFn(scope, iElement, iAttr) {\n\n scope.interpolateParams = {};\n scope.preText = '';\n scope.postText = '';\n scope.translateNamespace = getTranslateNamespace(scope);\n var translationIds = {};\n\n var initInterpolationParams = function (interpolateParams, iAttr, tAttr) {\n // initial setup\n if (iAttr.translateValues) {\n angular.extend(interpolateParams, $parse(iAttr.translateValues)(scope.$parent));\n }\n // initially fetch all attributes if existing and fill the params\n if (translateValueExist) {\n for (var attr in tAttr) {\n if (Object.prototype.hasOwnProperty.call(iAttr, attr) && attr.substr(0, 14) === 'translateValue' && attr !== 'translateValues') {\n var attributeName = angular.lowercase(attr.substr(14, 1)) + attr.substr(15);\n interpolateParams[attributeName] = tAttr[attr];\n }\n }\n }\n };\n\n // Ensures any change of the attribute \"translate\" containing the id will\n // be re-stored to the scope's \"translationId\".\n // If the attribute has no content, the element's text value (white spaces trimmed off) will be used.\n var observeElementTranslation = function (translationId) {\n\n // Remove any old watcher\n if (angular.isFunction(observeElementTranslation._unwatchOld)) {\n observeElementTranslation._unwatchOld();\n observeElementTranslation._unwatchOld = undefined;\n }\n\n if (angular.equals(translationId , '') || !angular.isDefined(translationId)) {\n var iElementText = trim.apply(iElement.text());\n\n // Resolve translation id by inner html if required\n var interpolateMatches = iElementText.match(interpolateRegExp);\n // Interpolate translation id if required\n if (angular.isArray(interpolateMatches)) {\n scope.preText = interpolateMatches[1];\n scope.postText = interpolateMatches[3];\n translationIds.translate = $interpolate(interpolateMatches[2])(scope.$parent);\n var watcherMatches = iElementText.match(watcherRegExp);\n if (angular.isArray(watcherMatches) && watcherMatches[2] && watcherMatches[2].length) {\n observeElementTranslation._unwatchOld = scope.$watch(watcherMatches[2], function (newValue) {\n translationIds.translate = newValue;\n updateTranslations();\n });\n }\n } else {\n // do not assigne the translation id if it is empty.\n translationIds.translate = !iElementText ? undefined : iElementText;\n }\n } else {\n translationIds.translate = translationId;\n }\n updateTranslations();\n };\n\n var observeAttributeTranslation = function (translateAttr) {\n iAttr.$observe(translateAttr, function (translationId) {\n translationIds[translateAttr] = translationId;\n updateTranslations();\n });\n };\n\n // initial setup with values\n initInterpolationParams(scope.interpolateParams, iAttr, tAttr);\n\n var firstAttributeChangedEvent = true;\n iAttr.$observe('translate', function (translationId) {\n if (typeof translationId === 'undefined') {\n // case of element \"<translate>xyz</translate>\"\n observeElementTranslation('');\n } else {\n // case of regular attribute\n if (translationId !== '' || !firstAttributeChangedEvent) {\n translationIds.translate = translationId;\n updateTranslations();\n }\n }\n firstAttributeChangedEvent = false;\n });\n\n for (var translateAttr in iAttr) {\n if (iAttr.hasOwnProperty(translateAttr) && translateAttr.substr(0, 13) === 'translateAttr') {\n observeAttributeTranslation(translateAttr);\n }\n }\n\n iAttr.$observe('translateDefault', function (value) {\n scope.defaultText = value;\n updateTranslations();\n });\n\n if (translateValuesExist) {\n iAttr.$observe('translateValues', function (interpolateParams) {\n if (interpolateParams) {\n scope.$parent.$watch(function () {\n angular.extend(scope.interpolateParams, $parse(interpolateParams)(scope.$parent));\n });\n }\n });\n }\n\n if (translateValueExist) {\n var observeValueAttribute = function (attrName) {\n iAttr.$observe(attrName, function (value) {\n var attributeName = angular.lowercase(attrName.substr(14, 1)) + attrName.substr(15);\n scope.interpolateParams[attributeName] = value;\n });\n };\n for (var attr in iAttr) {\n if (Object.prototype.hasOwnProperty.call(iAttr, attr) && attr.substr(0, 14) === 'translateValue' && attr !== 'translateValues') {\n observeValueAttribute(attr);\n }\n }\n }\n\n // Master update function\n var updateTranslations = function () {\n for (var key in translationIds) {\n\n if (translationIds.hasOwnProperty(key) && translationIds[key] !== undefined) {\n updateTranslation(key, translationIds[key], scope, scope.interpolateParams, scope.defaultText, scope.translateNamespace);\n }\n }\n };\n\n // Put translation processing function outside loop\n var updateTranslation = function(translateAttr, translationId, scope, interpolateParams, defaultTranslationText, translateNamespace) {\n if (translationId) {\n // if translation id starts with '.' and translateNamespace given, prepend namespace\n if (translateNamespace && translationId.charAt(0) === '.') {\n translationId = translateNamespace + translationId;\n }\n\n $translate(translationId, interpolateParams, translateInterpolation, defaultTranslationText, scope.translateLanguage)\n .then(function (translation) {\n applyTranslation(translation, scope, true, translateAttr);\n }, function (translationId) {\n applyTranslation(translationId, scope, false, translateAttr);\n });\n } else {\n // as an empty string cannot be translated, we can solve this using successful=false\n applyTranslation(translationId, scope, false, translateAttr);\n }\n };\n\n var applyTranslation = function (value, scope, successful, translateAttr) {\n if (translateAttr === 'translate') {\n // default translate into innerHTML\n if (!successful && typeof scope.defaultText !== 'undefined') {\n value = scope.defaultText;\n }\n iElement.empty().append(scope.preText + value + scope.postText);\n var globallyEnabled = $translate.isPostCompilingEnabled();\n var locallyDefined = typeof tAttr.translateCompile !== 'undefined';\n var locallyEnabled = locallyDefined && tAttr.translateCompile !== 'false';\n if ((globallyEnabled && !locallyDefined) || locallyEnabled) {\n $compile(iElement.contents())(scope);\n }\n } else {\n // translate attribute\n if (!successful && typeof scope.defaultText !== 'undefined') {\n value = scope.defaultText;\n }\n var attributeName = iAttr.$attr[translateAttr];\n if (attributeName.substr(0, 5) === 'data-') {\n // ensure html5 data prefix is stripped\n attributeName = attributeName.substr(5);\n }\n attributeName = attributeName.substr(15);\n iElement.attr(attributeName, value);\n }\n };\n\n if (translateValuesExist || translateValueExist || iAttr.translateDefault) {\n scope.$watch('interpolateParams', updateTranslations, true);\n }\n scope.$watch('translateLanguage', updateTranslations);\n\n // Ensures the text will be refreshed after the current language was changed\n // w/ $translate.use(...)\n var unbind = $rootScope.$on('$translateChangeSuccess', updateTranslations);\n\n // ensure translation will be looked up at least one\n if (iElement.text().length) {\n if (iAttr.translate) {\n observeElementTranslation(iAttr.translate);\n } else {\n observeElementTranslation('');\n }\n } else if (iAttr.translate) {\n // ensure attribute will be not skipped\n observeElementTranslation(iAttr.translate);\n }\n updateTranslations();\n scope.$on('$destroy', unbind);\n };\n }\n };\n}\ntranslateDirective.$inject = ['$translate', '$q', '$interpolate', '$compile', '$parse', '$rootScope'];\n\n/**\n * Returns the scope's namespace.\n * @private\n * @param scope\n * @returns {string}\n */\nfunction getTranslateNamespace(scope) {\n 'use strict';\n if (scope.translateNamespace) {\n return scope.translateNamespace;\n }\n if (scope.$parent) {\n return getTranslateNamespace(scope.$parent);\n }\n}\n\ntranslateDirective.displayName = 'translateDirective';\n\nangular.module('pascalprecht.translate')\n/**\n * @ngdoc directive\n * @name pascalprecht.translate.directive:translateCloak\n * @requires $rootScope\n * @requires $translate\n * @restrict A\n *\n * $description\n * Adds a `translate-cloak` class name to the given element where this directive\n * is applied initially and removes it, once a loader has finished loading.\n *\n * This directive can be used to prevent initial flickering when loading translation\n * data asynchronously.\n *\n * The class name is defined in\n * {@link pascalprecht.translate.$translateProvider#cloakClassName $translate.cloakClassName()}.\n *\n * @param {string=} translate-cloak If a translationId is provided, it will be used for showing\n * or hiding the cloak. Basically it relies on the translation\n * resolve.\n */\n.directive('translateCloak', translateCloakDirective);\n\nfunction translateCloakDirective($translate, $rootScope) {\n\n 'use strict';\n\n return {\n compile: function (tElement) {\n var applyCloak = function () {\n tElement.addClass($translate.cloakClassName());\n },\n removeCloak = function () {\n tElement.removeClass($translate.cloakClassName());\n };\n $translate.onReady(function () {\n removeCloak();\n });\n applyCloak();\n\n return function linkFn(scope, iElement, iAttr) {\n if (iAttr.translateCloak && iAttr.translateCloak.length) {\n // Register a watcher for the defined translation allowing a fine tuned cloak\n iAttr.$observe('translateCloak', function (translationId) {\n $translate(translationId).then(removeCloak, applyCloak);\n });\n // Register for change events as this is being another indicicator revalidating the cloak)\n $rootScope.$on('$translateChangeSuccess', function () {\n $translate(iAttr.translateCloak).then(removeCloak, applyCloak);\n });\n }\n };\n }\n };\n}\ntranslateCloakDirective.$inject = ['$translate', '$rootScope'];\n\ntranslateCloakDirective.displayName = 'translateCloakDirective';\n\nangular.module('pascalprecht.translate')\n/**\n * @ngdoc directive\n * @name pascalprecht.translate.directive:translateNamespace\n * @restrict A\n *\n * @description\n * Translates given translation id either through attribute or DOM content.\n * Internally it uses `translate` filter to translate translation id. It possible to\n * pass an optional `translate-values` object literal as string into translation id.\n *\n * @param {string=} translate namespace name which could be either string or interpolated string.\n *\n * @example\n <example module=\"ngView\">\n <file name=\"index.html\">\n <div translate-namespace=\"CONTENT\">\n\n <div>\n <h1 translate>.HEADERS.TITLE</h1>\n <h1 translate>.HEADERS.WELCOME</h1>\n </div>\n\n <div translate-namespace=\".HEADERS\">\n <h1 translate>.TITLE</h1>\n <h1 translate>.WELCOME</h1>\n </div>\n\n </div>\n </file>\n <file name=\"script.js\">\n angular.module('ngView', ['pascalprecht.translate'])\n\n .config(function ($translateProvider) {\n\n $translateProvider.translations('en',{\n 'TRANSLATION_ID': 'Hello there!',\n 'CONTENT': {\n 'HEADERS': {\n TITLE: 'Title'\n }\n },\n 'CONTENT.HEADERS.WELCOME': 'Welcome'\n }).preferredLanguage('en');\n\n });\n\n </file>\n </example>\n */\n.directive('translateNamespace', translateNamespaceDirective);\n\nfunction translateNamespaceDirective() {\n\n 'use strict';\n\n return {\n restrict: 'A',\n scope: true,\n compile: function () {\n return {\n pre: function (scope, iElement, iAttrs) {\n scope.translateNamespace = getTranslateNamespace(scope);\n\n if (scope.translateNamespace && iAttrs.translateNamespace.charAt(0) === '.') {\n scope.translateNamespace += iAttrs.translateNamespace;\n } else {\n scope.translateNamespace = iAttrs.translateNamespace;\n }\n }\n };\n }\n };\n}\n\n/**\n * Returns the scope's namespace.\n * @private\n * @param scope\n * @returns {string}\n */\nfunction getTranslateNamespace(scope) {\n 'use strict';\n if (scope.translateNamespace) {\n return scope.translateNamespace;\n }\n if (scope.$parent) {\n return getTranslateNamespace(scope.$parent);\n }\n}\n\ntranslateNamespaceDirective.displayName = 'translateNamespaceDirective';\n\nangular.module('pascalprecht.translate')\n/**\n * @ngdoc directive\n * @name pascalprecht.translate.directive:translateLanguage\n * @restrict A\n *\n * @description\n * Forces the language to the directives in the underlying scope.\n *\n * @param {string=} translate language that will be negotiated.\n *\n * @example\n <example module=\"ngView\">\n <file name=\"index.html\">\n <div>\n\n <div>\n <h1 translate>HELLO</h1>\n </div>\n\n <div translate-language=\"de\">\n <h1 translate>HELLO</h1>\n </div>\n\n </div>\n </file>\n <file name=\"script.js\">\n angular.module('ngView', ['pascalprecht.translate'])\n\n .config(function ($translateProvider) {\n\n $translateProvider\n .translations('en',{\n 'HELLO': 'Hello world!'\n })\n .translations('de',{\n 'HELLO': 'Hallo Welt!'\n })\n .translations(.preferredLanguage('en');\n\n });\n\n </file>\n </example>\n */\n.directive('translateLanguage', translateLanguageDirective);\n\nfunction translateLanguageDirective() {\n\n 'use strict';\n\n return {\n restrict: 'A',\n scope: true,\n compile: function () {\n return function linkFn(scope, iElement, iAttrs) {\n iAttrs.$observe('translateLanguage', function (newTranslateLanguage) {\n scope.translateLanguage = newTranslateLanguage;\n });\n };\n }\n };\n}\n\ntranslateLanguageDirective.displayName = 'translateLanguageDirective';\n\n\nangular.module('pascalprecht.translate')\n/**\n * @ngdoc filter\n * @name pascalprecht.translate.filter:translate\n * @requires $parse\n * @requires pascalprecht.translate.$translate\n * @function\n *\n * @description\n * Uses `$translate` service to translate contents. Accepts interpolate parameters\n * to pass dynamized values though translation.\n *\n * @param {string} translationId A translation id to be translated.\n * @param {*=} interpolateParams Optional object literal (as hash or string) to pass values into translation.\n *\n * @returns {string} Translated text.\n *\n * @example\n <example module=\"ngView\">\n <file name=\"index.html\">\n <div ng-controller=\"TranslateCtrl\">\n\n <pre>{{ 'TRANSLATION_ID' | translate }}</pre>\n <pre>{{ translationId | translate }}</pre>\n <pre>{{ 'WITH_VALUES' | translate:'{value: 5}' }}</pre>\n <pre>{{ 'WITH_VALUES' | translate:values }}</pre>\n\n </div>\n </file>\n <file name=\"script.js\">\n angular.module('ngView', ['pascalprecht.translate'])\n\n .config(function ($translateProvider) {\n\n $translateProvider.translations('en', {\n 'TRANSLATION_ID': 'Hello there!',\n 'WITH_VALUES': 'The following value is dynamic: {{value}}'\n });\n $translateProvider.preferredLanguage('en');\n\n });\n\n angular.module('ngView').controller('TranslateCtrl', function ($scope) {\n $scope.translationId = 'TRANSLATION_ID';\n\n $scope.values = {\n value: 78\n };\n });\n </file>\n </example>\n */\n.filter('translate', translateFilterFactory);\n\nfunction translateFilterFactory($parse, $translate) {\n\n 'use strict';\n\n var translateFilter = function (translationId, interpolateParams, interpolation, forceLanguage) {\n\n if (!angular.isObject(interpolateParams)) {\n interpolateParams = $parse(interpolateParams)(this);\n }\n\n return $translate.instant(translationId, interpolateParams, interpolation, forceLanguage);\n };\n\n if ($translate.statefulFilter()) {\n translateFilter.$stateful = true;\n }\n\n return translateFilter;\n}\ntranslateFilterFactory.$inject = ['$parse', '$translate'];\n\ntranslateFilterFactory.displayName = 'translateFilterFactory';\n\nangular.module('pascalprecht.translate')\n\n/**\n * @ngdoc object\n * @name pascalprecht.translate.$translationCache\n * @requires $cacheFactory\n *\n * @description\n * The first time a translation table is used, it is loaded in the translation cache for quick retrieval. You\n * can load translation tables directly into the cache by consuming the\n * `$translationCache` service directly.\n *\n * @return {object} $cacheFactory object.\n */\n .factory('$translationCache', $translationCache);\n\nfunction $translationCache($cacheFactory) {\n\n 'use strict';\n\n return $cacheFactory('translations');\n}\n$translationCache.$inject = ['$cacheFactory'];\n\n$translationCache.displayName = '$translationCache';\nreturn 'pascalprecht.translate';\n\n}));\n","/**\n * State-based routing for AngularJS\n * @version v0.2.18\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 toJson = angular.toJson;\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 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] || !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 cause `$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\\[\\]]+)(?:\\:\\s*( ... ))?\\} - 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\\[\\]]+)(?:\\:\\s*((?:[^{}\\\\]+|\\\\.|\\{(?:[^{}\\\\]+|\\\\.)*\\})+))?\\}/g,\n searchPlaceholder = /([:]?)([\\w\\[\\].-]+)|\\{([\\w\\[\\].-]+)(?:\\:\\s*((?:[^{}\\\\]+|\\\\.|\\{(?:[^{}\\\\]+|\\\\.)*\\})+))?\\}/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, optional) {\n var surroundPattern = ['',''], result = string.replace(/[\\\\\\[\\]\\^$*+?.()|{}]/g, \"\\\\$&\");\n if (!pattern) return result;\n switch(squash) {\n case false: surroundPattern = ['(', ')' + (optional ? \"?\" : \"\")]; break;\n case true:\n result = result.replace(/\\/$/, '');\n surroundPattern = ['(?:\\/(', ')|\\/)?'];\n 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\n if (regexp) {\n type = $$UMFP.type(regexp) || inherit($$UMFP.type(\"string\"), { pattern: new RegExp(regexp, config.caseInsensitive ? 'i' : undefined) });\n }\n\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, param.isOptional);\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(/\\\\-/g, \"-\"); }\n\n var split = reverseString(string).split(/-(?!\\\\)/);\n var allReversed = map(split, reverseString);\n return map(allReversed, unquoteDashes).reverse();\n }\n\n var param, paramVal;\n for (i = 0; i < nPath; i++) {\n paramName = paramNames[i];\n param = this.params[paramName];\n 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.length; j++) {\n if (param.replace[j].from === paramVal) paramVal = param.replace[j].to;\n }\n if (paramVal && param.array === true) paramVal = decodePathArray(paramVal);\n if (isDefined(paramVal)) paramVal = param.type.decode(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 param = this.params[paramName];\n paramVal = searchParams[paramName];\n for (j = 0; j < param.replace.length; j++) {\n if (param.replace[j].from === paramVal) paramVal = param.replace[j].to;\n }\n if (isDefined(paramVal)) paramVal = param.type.decode(paramVal);\n values[paramName] = param.value(paramVal);\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#validates\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 var isFinalPathParam = i + 1 === nPath;\n\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\n if (isFinalPathParam && param.squash === true && result.slice(-1) === '/') result = result.slice(0, -1);\n } else {\n if (encoded == null || (isDefaultValue && squash !== false)) continue;\n if (!isArray(encoded)) encoded = [ encoded ];\n if (encoded.length === 0) continue;\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/** Given an encoded string, or a decoded object, returns a decoded object */\nType.prototype.$normalize = function(val) {\n return this.is(val) ? val : this.decode(val);\n};\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\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 if (isArray(val) && val.length === 0) return 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.$normalize = arrayHandler(bindTo(type, '$normalize'));\n this.name = type.name;\n this.$arrayMode = mode;\n }\n\n return new ArrayType(this, mode);\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 // Use tildes to pre-encode slashes.\n // If the slashes are simply URLEncoded, the browser can choose to pre-decode them,\n // and bidirectional encoding/decoding fails.\n // Tilde was chosen because it's not a RFC 3986 section 2.2 Reserved Character\n function valToString(val) { return val != null ? val.toString().replace(/~/g, \"~~\").replace(/\\//g, \"~2F\") : val; }\n function valFromString(val) { return val != null ? val.toString().replace(/~2F/g, \"/\").replace(/~~/g, \"~\") : val; }\n\n var $types = {}, enqueue = true, typeQueue = [], injector, defaultTypes = {\n \"string\": {\n encode: valToString,\n decode: valFromString,\n // TODO: in 1.0, make string .is() return false if value is undefined/null by default.\n // In 0.2.x, string params are optional by default for backwards compat\n is: function(val) { return val == null || !isDefined(val) || typeof val === \"string\"; },\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 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\n if (angular.isString(config.type))\n return $types[config.type];\n if (config.type instanceof Type)\n return config.type;\n return 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 var defaultValue = injector.invoke(config.$$fn);\n if (defaultValue !== null && defaultValue !== undefined && !self.type.is(defaultValue))\n throw new Error(\"Default value (\" + defaultValue + \") for parameter '\" + self.id + \"' is not an instance of Type (\" + self.type.name + \")\");\n return defaultValue;\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) ? $$getDefaultValue() : self.type.$normalize(value);\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 keys = this.$$keys(), i, param, rawVal, normalized, encoded;\n for (i = 0; i < keys.length; i++) {\n param = this[keys[i]];\n rawVal = paramValues[keys[i]];\n if ((rawVal === undefined || rawVal === null) && param.isOptional)\n break; // There was no parameter value, but the param is optional\n normalized = param.type.$normalize(rawVal);\n if (!param.type.is(normalized))\n return false; // The value was not of the correct Type, and could not be decoded to the correct Type\n encoded = param.type.encode(normalized);\n if (angular.isString(encoded) && !param.type.pattern.exec(encoded))\n return false; // The value was of the correct type, but when encoded, did not match the Type's regexp\n }\n return true;\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 {function} 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|function} 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. \n * \n * If the handler 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|function} 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', '$sniffer'];\n function $get( $location, $rootScope, $injector, $browser, $sniffer) {\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 // TODO: Re-implement this in 1.0 for https://github.com/angular-ui/ui-router/issues/1573\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 var url = urlMatcher.format(params || {});\n\n // Handle the special hash param, if needed\n if (url !== null && params && params['#']) {\n url += '#' + params['#'];\n }\n\n $location.url(url);\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 isHtml5 = isHtml5 && $sniffer.history;\n \n var url = urlMatcher.format(params);\n options = options || {};\n\n if (!isHtml5 && url !== null) {\n url = \"#\" + $locationProvider.hashPrefix() + url;\n }\n\n // Handle special hash param, if needed\n if (url !== null && params && params['#']) {\n url += '#' + params['#'];\n }\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 = inherit(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 var ownParams = pick(state.ownParams, state.ownParams.$$keys());\n return state.parent && state.parent.params ? extend(state.parent.params.$$new(), 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 single stars\n for (var i = 0, l = globSegments.length; i < l; i++) {\n if (globSegments[i] === '*') {\n segments[i] = '*';\n }\n }\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 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.<object>} - 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.<object>} - 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 {string|object=} stateConfig.parent\n * <a id='parent'></a>\n * Optionally specifies the parent state of this state.\n *\n * <pre>parent: 'parentState'</pre>\n * <pre>parent: parentState // JS variable</pre>\n *\n * @param {object=} stateConfig.resolve\n * <a id='resolve'></a>\n *\n * An optional map<string, function> 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 * (See {@link ui.router.util.type:UrlMatcher UrlMatcher} `UrlMatcher`} for\n * more details on acceptable patterns )\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}\"\n * url: \"/messages/:mailboxid?{before:date}&{after:date}\"\n * </pre>\n *\n * @param {object=} stateConfig.views\n * <a id='views'></a>\n * an optional map<string, object> 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 explicitly 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 explicitly 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,\n * controllers reinstantiated, and events re-fired.\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 * @param {string=|object=} state - A state name or a state object, which is the root of the resolves to be re-resolved.\n * @example\n * <pre>\n * //assuming app application consists of 3 states: 'contacts', 'contacts.detail', 'contacts.detail.item' \n * //and current state is 'contacts.detail.item'\n * var app angular.module('app', ['ui.router']);\n *\n * app.controller('ctrl', function ($scope, $state) {\n * $scope.reload = function(){\n * //will reload 'contact.detail' and 'contact.detail.item' states\n * $state.reload('contact.detail');\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(state) {\n return $state.transitionTo($state.current, $stateParams, { reload: state || 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. Only parameters specified in the state definition can be overridden, new \n * parameters will be ignored. 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|string|object}, If `true` will force transition even if no state or params\n * have changed. It will reload the resolves and views of the current state and parent states.\n * If `reload` is a string (or state object), the state object is fetched (by name, or object reference); and \\\n * the transition reloads the resolves and views for that matched state, and all its children states.\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|string=|object=}, 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 * if String, then will reload the state with the name given in reload, and any children.\n * if Object, then a stateObj is expected, will reload the state found in stateObj, and any children.\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 // Store the hash param for later (since it will be stripped out by various methods)\n var hash = toParams['#'];\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 } else if (isString(options.reload) || isObject(options.reload)) {\n if (isObject(options.reload) && !options.reload.name) {\n throw new Error('Invalid reload state object');\n }\n \n var reloadState = options.reload === true ? fromPath[0] : findState(options.reload);\n if (options.reload && !reloadState) {\n throw new Error(\"No such reload state '\" + (isString(options.reload) ? options.reload : options.reload.name) + \"'\");\n }\n\n while (state && state === fromPath[keep] && state !== reloadState) {\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 (shouldSkipReload(to, toParams, from, fromParams, locals, options)) {\n if (hash) toParams['#'] = hash;\n $state.params = toParams;\n copy($state.params, $stateParams);\n copy(filterByKeys(to.params.$$keys(), $stateParams), to.locals.globals.$stateParams);\n if (options.location && to.navigable && to.navigable.url) {\n $urlRouter.push(to.navigable.url, toParams, {\n $$avoidResync: true, replace: options.location === 'replace'\n });\n $urlRouter.update(true);\n }\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 // Re-add the saved hash before we start returning things or broadcasting $stateChangeStart\n if (hash) toParams['#'] = hash;\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, options).defaultPrevented) {\n $rootScope.$broadcast('$stateChangeCancel', to.self, toParams, from.self, fromParams);\n //Don't update and resync url if there's been a new transition started. see issue #2238, #600\n if ($state.transition == null) $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().concat('#'), 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 function resolveViews() {\n var viewsPromises = [];\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: dst.globals, params: $stateParams, notify: options.notify }) || '';\n }];\n\n viewsPromises.push($resolve.resolve(injectables, dst.globals, 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, dst.globals);\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 return $q.all(viewsPromises).then(function(){\n return dst.globals;\n });\n }\n\n // Wait for all the promises and then return the activation object\n return $q.all(promises).then(resolveViews).then(function (values) {\n return dst;\n });\n }\n\n return $state;\n }\n\n function shouldSkipReload(to, toParams, from, fromParams, locals, options) {\n // Return true if there are no differences in non-search (path/object) params, false if there are differences\n function nonSearchParamsEqual(fromAndToState, fromParams, toParams) {\n // Identify whether all the parameters that differ between `fromParams` and `toParams` were search params.\n function notSearchParam(key) {\n return fromAndToState.params[key].location != \"search\";\n }\n var nonQueryParamKeys = fromAndToState.params.$$keys().filter(notSearchParam);\n var nonQueryParams = pick.apply({}, [fromAndToState.params].concat(nonQueryParamKeys));\n var nonQueryParamSet = new $$UMFP.ParamSet(nonQueryParams);\n return nonQueryParamSet.$$equals(fromParams, toParams);\n }\n\n // If reload was not explicitly requested\n // and we're transitioning to the same state we're already in\n // and the locals didn't change\n // or they changed in a way that doesn't merit reloading\n // (reloadOnParams:false, or reloadOnSearch.false and only search params changed)\n // Then return true.\n if (!options.reload && to === from &&\n (locals === from.locals || (to.self.reloadOnSearch === false && nonSearchParamsEqual(from, fromParams, toParams)))) {\n return true;\n }\n }\n}\n\nangular.module('ui.router.state')\n .factory('$stateParams', function () { return {}; })\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 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 return $timeout(function () {\n $element[0].scrollIntoView();\n }, 0, false);\n };\n }];\n}\n\nangular.module('ui.router.state').provider('$uiViewScroll', $ViewScrollProvider);\n\nvar ngMajorVer = angular.version.major;\nvar ngMinorVer = angular.version.minor;\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 * @param {string=} noanimation If truthy, the non-animated renderer will be selected (no animations\n * will be applied to the ui-view)\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 = {\n enter: function (element, target, cb) { target.after(element); cb(); },\n leave: function (element, cb) { element.remove(); cb(); }\n };\n\n if (!!attrs.noanimation) return statics;\n\n function animEnabled(element) {\n if (ngMajorVer === 1 && ngMinorVer >= 4) return !!$animate.enabled(element);\n if (ngMajorVer === 1 && ngMinorVer >= 2) return !!$animate.enabled();\n return (!!$animator);\n }\n\n // ng 1.2+\n if ($animate) {\n return {\n enter: function(element, target, cb) {\n if (!animEnabled(element)) {\n statics.enter(element, target, cb);\n } else if (angular.version.minor > 2) {\n $animate.enter(element, null, target).then(cb);\n } else {\n $animate.enter(element, null, target, cb);\n }\n },\n leave: function(element, cb) {\n if (!animEnabled(element)) {\n statics.leave(element, cb);\n } else if (angular.version.minor > 2) {\n $animate.leave(element).then(cb);\n } else {\n $animate.leave(element, cb);\n }\n }\n };\n }\n\n // ng 1.1.5\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\n updateView(true);\n\n function cleanupLastView() {\n var _previousEl = previousEl;\n var _currentScope = currentScope;\n\n if (_currentScope) {\n _currentScope._willBeDestroyed = true;\n }\n\n function cleanOld() {\n if (_previousEl) {\n _previousEl.remove();\n }\n\n if (_currentScope) {\n _currentScope.$destroy();\n }\n }\n\n if (currentEl) {\n renderer.leave(currentEl, function() {\n cleanOld();\n previousEl = null;\n });\n\n previousEl = currentEl;\n } else {\n cleanOld();\n previousEl = null;\n }\n\n currentEl = null;\n currentScope = null;\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 || scope._willBeDestroyed) return; // nothing to do\n newScope = scope.$new();\n latestLocals = $state.$current.locals[name];\n\n /**\n * @ngdoc event\n * @name ui.router.state.directive:ui-view#$viewContentLoading\n * @eventOf ui.router.state.directive:ui-view\n * @eventType emits on ui-view directive 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 {string} viewName Name of the view.\n */\n newScope.$emit('$viewContentLoading', 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 * @param {string} viewName Name of the view.\n */\n currentScope.$emit('$viewContentLoaded', name);\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 locals.$element = $element;\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\nfunction getTypeInfo(el) {\n // SVGAElement does not use the href attribute, but rather the 'xlinkHref' attribute.\n var isSvg = Object.prototype.toString.call(el.prop('href')) === '[object SVGAnimatedString]';\n var isForm = el[0].nodeName === \"FORM\";\n\n return {\n attr: isForm ? \"action\" : (isSvg ? 'xlink:href' : 'href'),\n isAnchor: el.prop(\"tagName\").toUpperCase() === \"A\",\n clickable: !isForm\n };\n}\n\nfunction clickHook(el, $state, $timeout, type, current) {\n return function(e) {\n var button = e.which || e.button, target = current();\n\n if (!(button > 1 || e.ctrlKey || e.metaKey || e.shiftKey || el.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(target.state, target.params, target.options);\n });\n e.preventDefault();\n\n // if the state has no URL, ignore one preventDefault from the <a> directive.\n var ignorePreventDefaultCount = type.isAnchor && !target.href ? 1: 0;\n\n e.preventDefault = function() {\n if (ignorePreventDefaultCount-- <= 0) $timeout.cancel(transition);\n };\n }\n };\n}\n\nfunction defaultOpts(el, $state) {\n return { relative: stateContext(el) || $state.$current, inherit: true };\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 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 def = { state: ref.state, href: null, params: null };\n var type = getTypeInfo(element);\n var active = uiSrefActive[1] || uiSrefActive[0];\n\n def.options = extend(defaultOpts(element, $state), attrs.uiSrefOpts ? scope.$eval(attrs.uiSrefOpts) : {});\n\n var update = function(val) {\n if (val) def.params = angular.copy(val);\n def.href = $state.href(ref.state, def.params, def.options);\n\n if (active) active.$$addStateInfo(ref.state, def.params);\n if (def.href !== null) attrs.$set(type.attr, def.href);\n };\n\n if (ref.paramExpr) {\n scope.$watch(ref.paramExpr, function(val) { if (val !== def.params) update(val); }, true);\n def.params = angular.copy(scope.$eval(ref.paramExpr));\n }\n update();\n\n if (!type.clickable) return;\n element.bind(\"click\", clickHook(element, $state, $timeout, type, function() { return def; }));\n }\n };\n}\n\n/**\n * @ngdoc directive\n * @name ui.router.state.directive:ui-state\n *\n * @requires ui.router.state.uiSref\n *\n * @restrict A\n *\n * @description\n * Much like ui-sref, but will accept named $scope properties to evaluate for a state definition,\n * params and override options.\n *\n * @param {string} ui-state 'stateName' can be any valid absolute or relative state\n * @param {Object} ui-state-params params to pass to {@link ui.router.state.$state#href $state.href()}\n * @param {Object} ui-state-opts options to pass to {@link ui.router.state.$state#go $state.go()}\n */\n$StateRefDynamicDirective.$inject = ['$state', '$timeout'];\nfunction $StateRefDynamicDirective($state, $timeout) {\n return {\n restrict: 'A',\n require: ['?^uiSrefActive', '?^uiSrefActiveEq'],\n link: function(scope, element, attrs, uiSrefActive) {\n var type = getTypeInfo(element);\n var active = uiSrefActive[1] || uiSrefActive[0];\n var group = [attrs.uiState, attrs.uiStateParams || null, attrs.uiStateOpts || null];\n var watch = '[' + group.map(function(val) { return val || 'null'; }).join(', ') + ']';\n var def = { state: null, params: null, options: null, href: null };\n\n function runStateRefLink (group) {\n def.state = group[0]; def.params = group[1]; def.options = group[2];\n def.href = $state.href(def.state, def.params, def.options);\n\n if (active) active.$$addStateInfo(def.state, def.params);\n if (def.href) attrs.$set(type.attr, def.href);\n }\n\n scope.$watch(watch, runStateRefLink, true);\n runStateRefLink(scope.$eval(watch));\n\n if (!type.clickable) return;\n element.bind(\"click\", clickHook(element, $state, $timeout, type, function() { return def; }));\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 * It is also possible to pass ui-sref-active an expression that evaluates\n * to an object hash, whose keys represent active class names and whose\n * values represent the respective state names/globs.\n * ui-sref-active will match if the current active state **includes** any of\n * the specified state names/globs, even the abstract ones.\n *\n * @Example\n * Given the following template, with \"admin\" being an abstract state:\n * <pre>\n * <div ui-sref-active=\"{'active': 'admin.*'}\">\n * <a ui-sref-active=\"active\" ui-sref=\"admin.roles\">Roles</a>\n * </div>\n * </pre>\n *\n * When the current state is \"admin.roles\" the \"active\" class will be applied\n * to both the <div> and <a> elements. It is important to note that the state\n * names/globs passed to ui-sref-active shadow the state provided by ui-sref.\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', '$timeout', function ($scope, $element, $attrs, $timeout) {\n var states = [], activeClasses = {}, activeEqClass, uiSrefActive;\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 activeEqClass = $interpolate($attrs.uiSrefActiveEq || '', false)($scope);\n\n try {\n uiSrefActive = $scope.$eval($attrs.uiSrefActive);\n } catch (e) {\n // Do nothing. uiSrefActive is not a valid expression.\n // Fall back to using $interpolate below\n }\n uiSrefActive = uiSrefActive || $interpolate($attrs.uiSrefActive || '', false)($scope);\n if (isObject(uiSrefActive)) {\n forEach(uiSrefActive, function(stateOrName, activeClass) {\n if (isString(stateOrName)) {\n var ref = parseStateRef(stateOrName, $state.current.name);\n addState(ref.state, $scope.$eval(ref.paramExpr), activeClass);\n }\n });\n }\n\n // Allow uiSref to communicate with uiSrefActive[Equals]\n this.$$addStateInfo = function (newState, newParams) {\n // we already got an explicit state provided by ui-sref-active, so we\n // shadow the one that comes from ui-sref\n if (isObject(uiSrefActive) && states.length > 0) {\n return;\n }\n addState(newState, newParams, uiSrefActive);\n update();\n };\n\n $scope.$on('$stateChangeSuccess', update);\n\n function addState(stateName, stateParams, activeClass) {\n var state = $state.get(stateName, stateContext($element));\n var stateHash = createStateHash(stateName, stateParams);\n\n states.push({\n state: state || { name: stateName },\n params: stateParams,\n hash: stateHash\n });\n\n activeClasses[stateHash] = activeClass;\n }\n\n /**\n * @param {string} state\n * @param {Object|string} [params]\n * @return {string}\n */\n function createStateHash(state, params) {\n if (!isString(state)) {\n throw new Error('state should be a string');\n }\n if (isObject(params)) {\n return state + toJson(params);\n }\n params = $scope.$eval(params);\n if (isObject(params)) {\n return state + toJson(params);\n }\n return state;\n }\n\n // Update route state\n function update() {\n for (var i = 0; i < states.length; i++) {\n if (anyMatch(states[i].state, states[i].params)) {\n addClass($element, activeClasses[states[i].hash]);\n } else {\n removeClass($element, activeClasses[states[i].hash]);\n }\n\n if (exactMatch(states[i].state, states[i].params)) {\n addClass($element, activeEqClass);\n } else {\n removeClass($element, activeEqClass);\n }\n }\n }\n\n function addClass(el, className) { $timeout(function () { el.addClass(className); }); }\n function removeClass(el, className) { el.removeClass(className); }\n function anyMatch(state, params) { return $state.includes(state.name, params); }\n function exactMatch(state, params) { return $state.is(state.name, params); }\n\n update();\n }]\n };\n}\n\nangular.module('ui.router.state')\n .directive('uiSref', $StateRefDirective)\n .directive('uiSrefActive', $StateRefActiveDirective)\n .directive('uiSrefActiveEq', $StateRefActiveDirective)\n .directive('uiState', $StateRefDynamicDirective);\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, params) {\n return $state.is(state, params);\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, params, options) {\n return $state.includes(state, params, options);\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 * jQuery JavaScript Library v2.0.3\n * http://jquery.com/\n *\n * Includes Sizzle.js\n * http://sizzlejs.com/\n *\n * Copyright 2005, 2013 jQuery Foundation, Inc. and other contributors\n * Released under the MIT license\n * http://jquery.org/license\n *\n * Date: 2013-07-03T13:30Z\n */\n(function( window, undefined ) {\n\n// Can't do this because several apps including ASP.NET trace\n// the stack via arguments.caller.callee and Firefox dies if\n// you try to trace through \"use strict\" call chains. (#13335)\n// Support: Firefox 18+\n//\"use strict\";\nvar\n\t// A central reference to the root jQuery(document)\n\trootjQuery,\n\n\t// The deferred used on DOM ready\n\treadyList,\n\n\t// Support: IE9\n\t// For `typeof xmlNode.method` instead of `xmlNode.method !== undefined`\n\tcore_strundefined = typeof undefined,\n\n\t// Use the correct document accordingly with window argument (sandbox)\n\tlocation = window.location,\n\tdocument = window.document,\n\tdocElem = document.documentElement,\n\n\t// Map over jQuery in case of overwrite\n\t_jQuery = window.jQuery,\n\n\t// Map over the $ in case of overwrite\n\t_$ = window.$,\n\n\t// [[Class]] -> type pairs\n\tclass2type = {},\n\n\t// List of deleted data cache ids, so we can reuse them\n\tcore_deletedIds = [],\n\n\tcore_version = \"2.0.3\",\n\n\t// Save a reference to some core methods\n\tcore_concat = core_deletedIds.concat,\n\tcore_push = core_deletedIds.push,\n\tcore_slice = core_deletedIds.slice,\n\tcore_indexOf = core_deletedIds.indexOf,\n\tcore_toString = class2type.toString,\n\tcore_hasOwn = class2type.hasOwnProperty,\n\tcore_trim = core_version.trim,\n\n\t// Define a local copy of jQuery\n\tjQuery = function( selector, context ) {\n\t\t// The jQuery object is actually just the init constructor 'enhanced'\n\t\treturn new jQuery.fn.init( selector, context, rootjQuery );\n\t},\n\n\t// Used for matching numbers\n\tcore_pnum = /[+-]?(?:\\d*\\.|)\\d+(?:[eE][+-]?\\d+|)/.source,\n\n\t// Used for splitting on whitespace\n\tcore_rnotwhite = /\\S+/g,\n\n\t// A simple way to check for HTML strings\n\t// Prioritize #id over <tag> to avoid XSS via location.hash (#9521)\n\t// Strict HTML recognition (#11290: must start with <)\n\trquickExpr = /^(?:\\s*(<[\\w\\W]+>)[^>]*|#([\\w-]*))$/,\n\n\t// Match a standalone tag\n\trsingleTag = /^<(\\w+)\\s*\\/?>(?:<\\/\\1>|)$/,\n\n\t// Matches dashed string for camelizing\n\trmsPrefix = /^-ms-/,\n\trdashAlpha = /-([\\da-z])/gi,\n\n\t// Used by jQuery.camelCase as callback to replace()\n\tfcamelCase = function( all, letter ) {\n\t\treturn letter.toUpperCase();\n\t},\n\n\t// The ready event handler and self cleanup method\n\tcompleted = function() {\n\t\tdocument.removeEventListener( \"DOMContentLoaded\", completed, false );\n\t\twindow.removeEventListener( \"load\", completed, false );\n\t\tjQuery.ready();\n\t};\n\njQuery.fn = jQuery.prototype = {\n\t// The current version of jQuery being used\n\tjquery: core_version,\n\n\tconstructor: jQuery,\n\tinit: function( selector, context, rootjQuery ) {\n\t\tvar match, elem;\n\n\t\t// HANDLE: $(\"\"), $(null), $(undefined), $(false)\n\t\tif ( !selector ) {\n\t\t\treturn this;\n\t\t}\n\n\t\t// Handle HTML strings\n\t\tif ( typeof selector === \"string\" ) {\n\t\t\tif ( selector.charAt(0) === \"<\" && selector.charAt( selector.length - 1 ) === \">\" && selector.length >= 3 ) {\n\t\t\t\t// Assume that strings that start and end with <> are HTML and skip the regex check\n\t\t\t\tmatch = [ null, selector, null ];\n\n\t\t\t} else {\n\t\t\t\tmatch = rquickExpr.exec( selector );\n\t\t\t}\n\n\t\t\t// Match html or make sure no context is specified for #id\n\t\t\tif ( match && (match[1] || !context) ) {\n\n\t\t\t\t// HANDLE: $(html) -> $(array)\n\t\t\t\tif ( match[1] ) {\n\t\t\t\t\tcontext = context instanceof jQuery ? context[0] : context;\n\n\t\t\t\t\t// scripts is true for back-compat\n\t\t\t\t\tjQuery.merge( this, jQuery.parseHTML(\n\t\t\t\t\t\tmatch[1],\n\t\t\t\t\t\tcontext && context.nodeType ? context.ownerDocument || context : document,\n\t\t\t\t\t\ttrue\n\t\t\t\t\t) );\n\n\t\t\t\t\t// HANDLE: $(html, props)\n\t\t\t\t\tif ( rsingleTag.test( match[1] ) && jQuery.isPlainObject( context ) ) {\n\t\t\t\t\t\tfor ( match in context ) {\n\t\t\t\t\t\t\t// Properties of context are called as methods if possible\n\t\t\t\t\t\t\tif ( jQuery.isFunction( this[ match ] ) ) {\n\t\t\t\t\t\t\t\tthis[ match ]( context[ match ] );\n\n\t\t\t\t\t\t\t// ...and otherwise set as attributes\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tthis.attr( match, context[ match ] );\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\treturn this;\n\n\t\t\t\t// HANDLE: $(#id)\n\t\t\t\t} else {\n\t\t\t\t\telem = document.getElementById( match[2] );\n\n\t\t\t\t\t// Check parentNode to catch when Blackberry 4.6 returns\n\t\t\t\t\t// nodes that are no longer in the document #6963\n\t\t\t\t\tif ( elem && elem.parentNode ) {\n\t\t\t\t\t\t// Inject the element directly into the jQuery object\n\t\t\t\t\t\tthis.length = 1;\n\t\t\t\t\t\tthis[0] = elem;\n\t\t\t\t\t}\n\n\t\t\t\t\tthis.context = document;\n\t\t\t\t\tthis.selector = selector;\n\t\t\t\t\treturn this;\n\t\t\t\t}\n\n\t\t\t// HANDLE: $(expr, $(...))\n\t\t\t} else if ( !context || context.jquery ) {\n\t\t\t\treturn ( context || rootjQuery ).find( selector );\n\n\t\t\t// HANDLE: $(expr, context)\n\t\t\t// (which is just equivalent to: $(context).find(expr)\n\t\t\t} else {\n\t\t\t\treturn this.constructor( context ).find( selector );\n\t\t\t}\n\n\t\t// HANDLE: $(DOMElement)\n\t\t} else if ( selector.nodeType ) {\n\t\t\tthis.context = this[0] = selector;\n\t\t\tthis.length = 1;\n\t\t\treturn this;\n\n\t\t// HANDLE: $(function)\n\t\t// Shortcut for document ready\n\t\t} else if ( jQuery.isFunction( selector ) ) {\n\t\t\treturn rootjQuery.ready( selector );\n\t\t}\n\n\t\tif ( selector.selector !== undefined ) {\n\t\t\tthis.selector = selector.selector;\n\t\t\tthis.context = selector.context;\n\t\t}\n\n\t\treturn jQuery.makeArray( selector, this );\n\t},\n\n\t// Start with an empty selector\n\tselector: \"\",\n\n\t// The default length of a jQuery object is 0\n\tlength: 0,\n\n\ttoArray: function() {\n\t\treturn core_slice.call( this );\n\t},\n\n\t// Get the Nth element in the matched element set OR\n\t// Get the whole matched element set as a clean array\n\tget: function( num ) {\n\t\treturn num == null ?\n\n\t\t\t// Return a 'clean' array\n\t\t\tthis.toArray() :\n\n\t\t\t// Return just the object\n\t\t\t( num < 0 ? this[ this.length + num ] : this[ num ] );\n\t},\n\n\t// Take an array of elements and push it onto the stack\n\t// (returning the new matched element set)\n\tpushStack: function( elems ) {\n\n\t\t// Build a new jQuery matched element set\n\t\tvar ret = jQuery.merge( this.constructor(), elems );\n\n\t\t// Add the old object onto the stack (as a reference)\n\t\tret.prevObject = this;\n\t\tret.context = this.context;\n\n\t\t// Return the newly-formed element set\n\t\treturn ret;\n\t},\n\n\t// Execute a callback for every element in the matched set.\n\t// (You can seed the arguments with an array of args, but this is\n\t// only used internally.)\n\teach: function( callback, args ) {\n\t\treturn jQuery.each( this, callback, args );\n\t},\n\n\tready: function( fn ) {\n\t\t// Add the callback\n\t\tjQuery.ready.promise().done( fn );\n\n\t\treturn this;\n\t},\n\n\tslice: function() {\n\t\treturn this.pushStack( core_slice.apply( this, arguments ) );\n\t},\n\n\tfirst: function() {\n\t\treturn this.eq( 0 );\n\t},\n\n\tlast: function() {\n\t\treturn this.eq( -1 );\n\t},\n\n\teq: function( i ) {\n\t\tvar len = this.length,\n\t\t\tj = +i + ( i < 0 ? len : 0 );\n\t\treturn this.pushStack( j >= 0 && j < len ? [ this[j] ] : [] );\n\t},\n\n\tmap: function( callback ) {\n\t\treturn this.pushStack( jQuery.map(this, function( elem, i ) {\n\t\t\treturn callback.call( elem, i, elem );\n\t\t}));\n\t},\n\n\tend: function() {\n\t\treturn this.prevObject || this.constructor(null);\n\t},\n\n\t// For internal use only.\n\t// Behaves like an Array's method, not like a jQuery method.\n\tpush: core_push,\n\tsort: [].sort,\n\tsplice: [].splice\n};\n\n// Give the init function the jQuery prototype for later instantiation\njQuery.fn.init.prototype = jQuery.fn;\n\njQuery.extend = jQuery.fn.extend = function() {\n\tvar options, name, src, copy, copyIsArray, clone,\n\t\ttarget = arguments[0] || {},\n\t\ti = 1,\n\t\tlength = arguments.length,\n\t\tdeep = false;\n\n\t// Handle a deep copy situation\n\tif ( typeof target === \"boolean\" ) {\n\t\tdeep = target;\n\t\ttarget = arguments[1] || {};\n\t\t// skip the boolean and the target\n\t\ti = 2;\n\t}\n\n\t// Handle case when target is a string or something (possible in deep copy)\n\tif ( typeof target !== \"object\" && !jQuery.isFunction(target) ) {\n\t\ttarget = {};\n\t}\n\n\t// extend jQuery itself if only one argument is passed\n\tif ( length === i ) {\n\t\ttarget = this;\n\t\t--i;\n\t}\n\n\tfor ( ; i < length; i++ ) {\n\t\t// Only deal with non-null/undefined values\n\t\tif ( (options = arguments[ i ]) != null ) {\n\t\t\t// Extend the base object\n\t\t\tfor ( name in options ) {\n\t\t\t\tsrc = target[ name ];\n\t\t\t\tcopy = options[ name ];\n\n\t\t\t\t// Prevent never-ending loop\n\t\t\t\tif ( target === copy ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t// Recurse if we're merging plain objects or arrays\n\t\t\t\tif ( deep && copy && ( jQuery.isPlainObject(copy) || (copyIsArray = jQuery.isArray(copy)) ) ) {\n\t\t\t\t\tif ( copyIsArray ) {\n\t\t\t\t\t\tcopyIsArray = false;\n\t\t\t\t\t\tclone = src && jQuery.isArray(src) ? src : [];\n\n\t\t\t\t\t} else {\n\t\t\t\t\t\tclone = src && jQuery.isPlainObject(src) ? src : {};\n\t\t\t\t\t}\n\n\t\t\t\t\t// Never move original objects, clone them\n\t\t\t\t\ttarget[ name ] = jQuery.extend( deep, clone, copy );\n\n\t\t\t\t// Don't bring in undefined values\n\t\t\t\t} else if ( copy !== undefined ) {\n\t\t\t\t\ttarget[ name ] = copy;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t// Return the modified object\n\treturn target;\n};\n\njQuery.extend({\n\t// Unique for each copy of jQuery on the page\n\texpando: \"jQuery\" + ( core_version + Math.random() ).replace( /\\D/g, \"\" ),\n\n\tnoConflict: function( deep ) {\n\t\tif ( window.$ === jQuery ) {\n\t\t\twindow.$ = _$;\n\t\t}\n\n\t\tif ( deep && window.jQuery === jQuery ) {\n\t\t\twindow.jQuery = _jQuery;\n\t\t}\n\n\t\treturn jQuery;\n\t},\n\n\t// Is the DOM ready to be used? Set to true once it occurs.\n\tisReady: false,\n\n\t// A counter to track how many items to wait for before\n\t// the ready event fires. See #6781\n\treadyWait: 1,\n\n\t// Hold (or release) the ready event\n\tholdReady: function( hold ) {\n\t\tif ( hold ) {\n\t\t\tjQuery.readyWait++;\n\t\t} else {\n\t\t\tjQuery.ready( true );\n\t\t}\n\t},\n\n\t// Handle when the DOM is ready\n\tready: function( wait ) {\n\n\t\t// Abort if there are pending holds or we're already ready\n\t\tif ( wait === true ? --jQuery.readyWait : jQuery.isReady ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Remember that the DOM is ready\n\t\tjQuery.isReady = true;\n\n\t\t// If a normal DOM Ready event fired, decrement, and wait if need be\n\t\tif ( wait !== true && --jQuery.readyWait > 0 ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// If there are functions bound, to execute\n\t\treadyList.resolveWith( document, [ jQuery ] );\n\n\t\t// Trigger any bound ready events\n\t\tif ( jQuery.fn.trigger ) {\n\t\t\tjQuery( document ).trigger(\"ready\").off(\"ready\");\n\t\t}\n\t},\n\n\t// See test/unit/core.js for details concerning isFunction.\n\t// Since version 1.3, DOM methods and functions like alert\n\t// aren't supported. They return false on IE (#2968).\n\tisFunction: function( obj ) {\n\t\treturn jQuery.type(obj) === \"function\";\n\t},\n\n\tisArray: Array.isArray,\n\n\tisWindow: function( obj ) {\n\t\treturn obj != null && obj === obj.window;\n\t},\n\n\tisNumeric: function( obj ) {\n\t\treturn !isNaN( parseFloat(obj) ) && isFinite( obj );\n\t},\n\n\ttype: function( obj ) {\n\t\tif ( obj == null ) {\n\t\t\treturn String( obj );\n\t\t}\n\t\t// Support: Safari <= 5.1 (functionish RegExp)\n\t\treturn typeof obj === \"object\" || typeof obj === \"function\" ?\n\t\t\tclass2type[ core_toString.call(obj) ] || \"object\" :\n\t\t\ttypeof obj;\n\t},\n\n\tisPlainObject: function( obj ) {\n\t\t// Not plain objects:\n\t\t// - Any object or value whose internal [[Class]] property is not \"[object Object]\"\n\t\t// - DOM nodes\n\t\t// - window\n\t\tif ( jQuery.type( obj ) !== \"object\" || obj.nodeType || jQuery.isWindow( obj ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Support: Firefox <20\n\t\t// The try/catch suppresses exceptions thrown when attempting to access\n\t\t// the \"constructor\" property of certain host objects, ie. |window.location|\n\t\t// https://bugzilla.mozilla.org/show_bug.cgi?id=814622\n\t\ttry {\n\t\t\tif ( obj.constructor &&\n\t\t\t\t\t!core_hasOwn.call( obj.constructor.prototype, \"isPrototypeOf\" ) ) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t} catch ( e ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// If the function hasn't returned already, we're confident that\n\t\t// |obj| is a plain object, created by {} or constructed with new Object\n\t\treturn true;\n\t},\n\n\tisEmptyObject: function( obj ) {\n\t\tvar name;\n\t\tfor ( name in obj ) {\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t},\n\n\terror: function( msg ) {\n\t\tthrow new Error( msg );\n\t},\n\n\t// data: string of html\n\t// context (optional): If specified, the fragment will be created in this context, defaults to document\n\t// keepScripts (optional): If true, will include scripts passed in the html string\n\tparseHTML: function( data, context, keepScripts ) {\n\t\tif ( !data || typeof data !== \"string\" ) {\n\t\t\treturn null;\n\t\t}\n\t\tif ( typeof context === \"boolean\" ) {\n\t\t\tkeepScripts = context;\n\t\t\tcontext = false;\n\t\t}\n\t\tcontext = context || document;\n\n\t\tvar parsed = rsingleTag.exec( data ),\n\t\t\tscripts = !keepScripts && [];\n\n\t\t// Single tag\n\t\tif ( parsed ) {\n\t\t\treturn [ context.createElement( parsed[1] ) ];\n\t\t}\n\n\t\tparsed = jQuery.buildFragment( [ data ], context, scripts );\n\n\t\tif ( scripts ) {\n\t\t\tjQuery( scripts ).remove();\n\t\t}\n\n\t\treturn jQuery.merge( [], parsed.childNodes );\n\t},\n\n\tparseJSON: JSON.parse,\n\n\t// Cross-browser xml parsing\n\tparseXML: function( data ) {\n\t\tvar xml, tmp;\n\t\tif ( !data || typeof data !== \"string\" ) {\n\t\t\treturn null;\n\t\t}\n\n\t\t// Support: IE9\n\t\ttry {\n\t\t\ttmp = new DOMParser();\n\t\t\txml = tmp.parseFromString( data , \"text/xml\" );\n\t\t} catch ( e ) {\n\t\t\txml = undefined;\n\t\t}\n\n\t\tif ( !xml || xml.getElementsByTagName( \"parsererror\" ).length ) {\n\t\t\tjQuery.error( \"Invalid XML: \" + data );\n\t\t}\n\t\treturn xml;\n\t},\n\n\tnoop: function() {},\n\n\t// Evaluates a script in a global context\n\tglobalEval: function( code ) {\n\t\tvar script,\n\t\t\t\tindirect = eval;\n\n\t\tcode = jQuery.trim( code );\n\n\t\tif ( code ) {\n\t\t\t// If the code includes a valid, prologue position\n\t\t\t// strict mode pragma, execute code by injecting a\n\t\t\t// script tag into the document.\n\t\t\tif ( code.indexOf(\"use strict\") === 1 ) {\n\t\t\t\tscript = document.createElement(\"script\");\n\t\t\t\tscript.text = code;\n\t\t\t\tdocument.head.appendChild( script ).parentNode.removeChild( script );\n\t\t\t} else {\n\t\t\t// Otherwise, avoid the DOM node creation, insertion\n\t\t\t// and removal by using an indirect global eval\n\t\t\t\tindirect( code );\n\t\t\t}\n\t\t}\n\t},\n\n\t// Convert dashed to camelCase; used by the css and data modules\n\t// Microsoft forgot to hump their vendor prefix (#9572)\n\tcamelCase: function( string ) {\n\t\treturn string.replace( rmsPrefix, \"ms-\" ).replace( rdashAlpha, fcamelCase );\n\t},\n\n\tnodeName: function( elem, name ) {\n\t\treturn elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase();\n\t},\n\n\t// args is for internal usage only\n\teach: function( obj, callback, args ) {\n\t\tvar value,\n\t\t\ti = 0,\n\t\t\tlength = obj.length,\n\t\t\tisArray = isArraylike( obj );\n\n\t\tif ( args ) {\n\t\t\tif ( isArray ) {\n\t\t\t\tfor ( ; i < length; i++ ) {\n\t\t\t\t\tvalue = callback.apply( obj[ i ], args );\n\n\t\t\t\t\tif ( value === false ) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tfor ( i in obj ) {\n\t\t\t\t\tvalue = callback.apply( obj[ i ], args );\n\n\t\t\t\t\tif ( value === false ) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t// A special, fast, case for the most common use of each\n\t\t} else {\n\t\t\tif ( isArray ) {\n\t\t\t\tfor ( ; i < length; i++ ) {\n\t\t\t\t\tvalue = callback.call( obj[ i ], i, obj[ i ] );\n\n\t\t\t\t\tif ( value === false ) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tfor ( i in obj ) {\n\t\t\t\t\tvalue = callback.call( obj[ i ], i, obj[ i ] );\n\n\t\t\t\t\tif ( value === false ) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn obj;\n\t},\n\n\ttrim: function( text ) {\n\t\treturn text == null ? \"\" : core_trim.call( text );\n\t},\n\n\t// results is for internal usage only\n\tmakeArray: function( arr, results ) {\n\t\tvar ret = results || [];\n\n\t\tif ( arr != null ) {\n\t\t\tif ( isArraylike( Object(arr) ) ) {\n\t\t\t\tjQuery.merge( ret,\n\t\t\t\t\ttypeof arr === \"string\" ?\n\t\t\t\t\t[ arr ] : arr\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\tcore_push.call( ret, arr );\n\t\t\t}\n\t\t}\n\n\t\treturn ret;\n\t},\n\n\tinArray: function( elem, arr, i ) {\n\t\treturn arr == null ? -1 : core_indexOf.call( arr, elem, i );\n\t},\n\n\tmerge: function( first, second ) {\n\t\tvar l = second.length,\n\t\t\ti = first.length,\n\t\t\tj = 0;\n\n\t\tif ( typeof l === \"number\" ) {\n\t\t\tfor ( ; j < l; j++ ) {\n\t\t\t\tfirst[ i++ ] = second[ j ];\n\t\t\t}\n\t\t} else {\n\t\t\twhile ( second[j] !== undefined ) {\n\t\t\t\tfirst[ i++ ] = second[ j++ ];\n\t\t\t}\n\t\t}\n\n\t\tfirst.length = i;\n\n\t\treturn first;\n\t},\n\n\tgrep: function( elems, callback, inv ) {\n\t\tvar retVal,\n\t\t\tret = [],\n\t\t\ti = 0,\n\t\t\tlength = elems.length;\n\t\tinv = !!inv;\n\n\t\t// Go through the array, only saving the items\n\t\t// that pass the validator function\n\t\tfor ( ; i < length; i++ ) {\n\t\t\tretVal = !!callback( elems[ i ], i );\n\t\t\tif ( inv !== retVal ) {\n\t\t\t\tret.push( elems[ i ] );\n\t\t\t}\n\t\t}\n\n\t\treturn ret;\n\t},\n\n\t// arg is for internal usage only\n\tmap: function( elems, callback, arg ) {\n\t\tvar value,\n\t\t\ti = 0,\n\t\t\tlength = elems.length,\n\t\t\tisArray = isArraylike( elems ),\n\t\t\tret = [];\n\n\t\t// Go through the array, translating each of the items to their\n\t\tif ( isArray ) {\n\t\t\tfor ( ; i < length; i++ ) {\n\t\t\t\tvalue = callback( elems[ i ], i, arg );\n\n\t\t\t\tif ( value != null ) {\n\t\t\t\t\tret[ ret.length ] = value;\n\t\t\t\t}\n\t\t\t}\n\n\t\t// Go through every key on the object,\n\t\t} else {\n\t\t\tfor ( i in elems ) {\n\t\t\t\tvalue = callback( elems[ i ], i, arg );\n\n\t\t\t\tif ( value != null ) {\n\t\t\t\t\tret[ ret.length ] = value;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Flatten any nested arrays\n\t\treturn core_concat.apply( [], ret );\n\t},\n\n\t// A global GUID counter for objects\n\tguid: 1,\n\n\t// Bind a function to a context, optionally partially applying any\n\t// arguments.\n\tproxy: function( fn, context ) {\n\t\tvar tmp, args, proxy;\n\n\t\tif ( typeof context === \"string\" ) {\n\t\t\ttmp = fn[ context ];\n\t\t\tcontext = fn;\n\t\t\tfn = tmp;\n\t\t}\n\n\t\t// Quick check to determine if target is callable, in the spec\n\t\t// this throws a TypeError, but we will just return undefined.\n\t\tif ( !jQuery.isFunction( fn ) ) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\t// Simulated bind\n\t\targs = core_slice.call( arguments, 2 );\n\t\tproxy = function() {\n\t\t\treturn fn.apply( context || this, args.concat( core_slice.call( arguments ) ) );\n\t\t};\n\n\t\t// Set the guid of unique handler to the same of original handler, so it can be removed\n\t\tproxy.guid = fn.guid = fn.guid || jQuery.guid++;\n\n\t\treturn proxy;\n\t},\n\n\t// Multifunctional method to get and set values of a collection\n\t// The value/s can optionally be executed if it's a function\n\taccess: function( elems, fn, key, value, chainable, emptyGet, raw ) {\n\t\tvar i = 0,\n\t\t\tlength = elems.length,\n\t\t\tbulk = key == null;\n\n\t\t// Sets many values\n\t\tif ( jQuery.type( key ) === \"object\" ) {\n\t\t\tchainable = true;\n\t\t\tfor ( i in key ) {\n\t\t\t\tjQuery.access( elems, fn, i, key[i], true, emptyGet, raw );\n\t\t\t}\n\n\t\t// Sets one value\n\t\t} else if ( value !== undefined ) {\n\t\t\tchainable = true;\n\n\t\t\tif ( !jQuery.isFunction( value ) ) {\n\t\t\t\traw = true;\n\t\t\t}\n\n\t\t\tif ( bulk ) {\n\t\t\t\t// Bulk operations run against the entire set\n\t\t\t\tif ( raw ) {\n\t\t\t\t\tfn.call( elems, value );\n\t\t\t\t\tfn = null;\n\n\t\t\t\t// ...except when executing function values\n\t\t\t\t} else {\n\t\t\t\t\tbulk = fn;\n\t\t\t\t\tfn = function( elem, key, value ) {\n\t\t\t\t\t\treturn bulk.call( jQuery( elem ), value );\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ( fn ) {\n\t\t\t\tfor ( ; i < length; i++ ) {\n\t\t\t\t\tfn( elems[i], key, raw ? value : value.call( elems[i], i, fn( elems[i], key ) ) );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn chainable ?\n\t\t\telems :\n\n\t\t\t// Gets\n\t\t\tbulk ?\n\t\t\t\tfn.call( elems ) :\n\t\t\t\tlength ? fn( elems[0], key ) : emptyGet;\n\t},\n\n\tnow: Date.now,\n\n\t// A method for quickly swapping in/out CSS properties to get correct calculations.\n\t// Note: this method belongs to the css module but it's needed here for the support module.\n\t// If support gets modularized, this method should be moved back to the css module.\n\tswap: function( elem, options, callback, args ) {\n\t\tvar ret, name,\n\t\t\told = {};\n\n\t\t// Remember the old values, and insert the new ones\n\t\tfor ( name in options ) {\n\t\t\told[ name ] = elem.style[ name ];\n\t\t\telem.style[ name ] = options[ name ];\n\t\t}\n\n\t\tret = callback.apply( elem, args || [] );\n\n\t\t// Revert the old values\n\t\tfor ( name in options ) {\n\t\t\telem.style[ name ] = old[ name ];\n\t\t}\n\n\t\treturn ret;\n\t}\n});\n\njQuery.ready.promise = function( obj ) {\n\tif ( !readyList ) {\n\n\t\treadyList = jQuery.Deferred();\n\n\t\t// Catch cases where $(document).ready() is called after the browser event has already occurred.\n\t\t// we once tried to use readyState \"interactive\" here, but it caused issues like the one\n\t\t// discovered by ChrisS here: http://bugs.jquery.com/ticket/12282#comment:15\n\t\tif ( document.readyState === \"complete\" ) {\n\t\t\t// Handle it asynchronously to allow scripts the opportunity to delay ready\n\t\t\tsetTimeout( jQuery.ready );\n\n\t\t} else {\n\n\t\t\t// Use the handy event callback\n\t\t\tdocument.addEventListener( \"DOMContentLoaded\", completed, false );\n\n\t\t\t// A fallback to window.onload, that will always work\n\t\t\twindow.addEventListener( \"load\", completed, false );\n\t\t}\n\t}\n\treturn readyList.promise( obj );\n};\n\n// Populate the class2type map\njQuery.each(\"Boolean Number String Function Array Date RegExp Object Error\".split(\" \"), function(i, name) {\n\tclass2type[ \"[object \" + name + \"]\" ] = name.toLowerCase();\n});\n\nfunction isArraylike( obj ) {\n\tvar length = obj.length,\n\t\ttype = jQuery.type( obj );\n\n\tif ( jQuery.isWindow( obj ) ) {\n\t\treturn false;\n\t}\n\n\tif ( obj.nodeType === 1 && length ) {\n\t\treturn true;\n\t}\n\n\treturn type === \"array\" || type !== \"function\" &&\n\t\t( length === 0 ||\n\t\ttypeof length === \"number\" && length > 0 && ( length - 1 ) in obj );\n}\n\n// All jQuery objects should point back to these\nrootjQuery = jQuery(document);\n/*!\n * Sizzle CSS Selector Engine v1.9.4-pre\n * http://sizzlejs.com/\n *\n * Copyright 2013 jQuery Foundation, Inc. and other contributors\n * Released under the MIT license\n * http://jquery.org/license\n *\n * Date: 2013-06-03\n */\n(function( window, undefined ) {\n\nvar i,\n\tsupport,\n\tcachedruns,\n\tExpr,\n\tgetText,\n\tisXML,\n\tcompile,\n\toutermostContext,\n\tsortInput,\n\n\t// Local document vars\n\tsetDocument,\n\tdocument,\n\tdocElem,\n\tdocumentIsHTML,\n\trbuggyQSA,\n\trbuggyMatches,\n\tmatches,\n\tcontains,\n\n\t// Instance-specific data\n\texpando = \"sizzle\" + -(new Date()),\n\tpreferredDoc = window.document,\n\tdirruns = 0,\n\tdone = 0,\n\tclassCache = createCache(),\n\ttokenCache = createCache(),\n\tcompilerCache = createCache(),\n\thasDuplicate = false,\n\tsortOrder = function( a, b ) {\n\t\tif ( a === b ) {\n\t\t\thasDuplicate = true;\n\t\t\treturn 0;\n\t\t}\n\t\treturn 0;\n\t},\n\n\t// General-purpose constants\n\tstrundefined = typeof undefined,\n\tMAX_NEGATIVE = 1 << 31,\n\n\t// Instance methods\n\thasOwn = ({}).hasOwnProperty,\n\tarr = [],\n\tpop = arr.pop,\n\tpush_native = arr.push,\n\tpush = arr.push,\n\tslice = arr.slice,\n\t// Use a stripped-down indexOf if we can't use a native one\n\tindexOf = arr.indexOf || function( elem ) {\n\t\tvar i = 0,\n\t\t\tlen = this.length;\n\t\tfor ( ; i < len; i++ ) {\n\t\t\tif ( this[i] === elem ) {\n\t\t\t\treturn i;\n\t\t\t}\n\t\t}\n\t\treturn -1;\n\t},\n\n\tbooleans = \"checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped\",\n\n\t// Regular expressions\n\n\t// Whitespace characters http://www.w3.org/TR/css3-selectors/#whitespace\n\twhitespace = \"[\\\\x20\\\\t\\\\r\\\\n\\\\f]\",\n\t// http://www.w3.org/TR/css3-syntax/#characters\n\tcharacterEncoding = \"(?:\\\\\\\\.|[\\\\w-]|[^\\\\x00-\\\\xa0])+\",\n\n\t// Loosely modeled on CSS identifier characters\n\t// An unquoted value should be a CSS identifier http://www.w3.org/TR/css3-selectors/#attribute-selectors\n\t// Proper syntax: http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier\n\tidentifier = characterEncoding.replace( \"w\", \"w#\" ),\n\n\t// Acceptable operators http://www.w3.org/TR/selectors/#attribute-selectors\n\tattributes = \"\\\\[\" + whitespace + \"*(\" + characterEncoding + \")\" + whitespace +\n\t\t\"*(?:([*^$|!~]?=)\" + whitespace + \"*(?:(['\\\"])((?:\\\\\\\\.|[^\\\\\\\\])*?)\\\\3|(\" + identifier + \")|)|)\" + whitespace + \"*\\\\]\",\n\n\t// Prefer arguments quoted,\n\t// then not containing pseudos/brackets,\n\t// then attribute selectors/non-parenthetical expressions,\n\t// then anything else\n\t// These preferences are here to reduce the number of selectors\n\t// needing tokenize in the PSEUDO preFilter\n\tpseudos = \":(\" + characterEncoding + \")(?:\\\\(((['\\\"])((?:\\\\\\\\.|[^\\\\\\\\])*?)\\\\3|((?:\\\\\\\\.|[^\\\\\\\\()[\\\\]]|\" + attributes.replace( 3, 8 ) + \")*)|.*)\\\\)|)\",\n\n\t// Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter\n\trtrim = new RegExp( \"^\" + whitespace + \"+|((?:^|[^\\\\\\\\])(?:\\\\\\\\.)*)\" + whitespace + \"+$\", \"g\" ),\n\n\trcomma = new RegExp( \"^\" + whitespace + \"*,\" + whitespace + \"*\" ),\n\trcombinators = new RegExp( \"^\" + whitespace + \"*([>+~]|\" + whitespace + \")\" + whitespace + \"*\" ),\n\n\trsibling = new RegExp( whitespace + \"*[+~]\" ),\n\trattributeQuotes = new RegExp( \"=\" + whitespace + \"*([^\\\\]'\\\"]*)\" + whitespace + \"*\\\\]\", \"g\" ),\n\n\trpseudo = new RegExp( pseudos ),\n\tridentifier = new RegExp( \"^\" + identifier + \"$\" ),\n\n\tmatchExpr = {\n\t\t\"ID\": new RegExp( \"^#(\" + characterEncoding + \")\" ),\n\t\t\"CLASS\": new RegExp( \"^\\\\.(\" + characterEncoding + \")\" ),\n\t\t\"TAG\": new RegExp( \"^(\" + characterEncoding.replace( \"w\", \"w*\" ) + \")\" ),\n\t\t\"ATTR\": new RegExp( \"^\" + attributes ),\n\t\t\"PSEUDO\": new RegExp( \"^\" + pseudos ),\n\t\t\"CHILD\": new RegExp( \"^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\\\(\" + whitespace +\n\t\t\t\"*(even|odd|(([+-]|)(\\\\d*)n|)\" + whitespace + \"*(?:([+-]|)\" + whitespace +\n\t\t\t\"*(\\\\d+)|))\" + whitespace + \"*\\\\)|)\", \"i\" ),\n\t\t\"bool\": new RegExp( \"^(?:\" + booleans + \")$\", \"i\" ),\n\t\t// For use in libraries implementing .is()\n\t\t// We use this for POS matching in `select`\n\t\t\"needsContext\": new RegExp( \"^\" + whitespace + \"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\\\(\" +\n\t\t\twhitespace + \"*((?:-\\\\d)?\\\\d*)\" + whitespace + \"*\\\\)|)(?=[^-]|$)\", \"i\" )\n\t},\n\n\trnative = /^[^{]+\\{\\s*\\[native \\w/,\n\n\t// Easily-parseable/retrievable ID or TAG or CLASS selectors\n\trquickExpr = /^(?:#([\\w-]+)|(\\w+)|\\.([\\w-]+))$/,\n\n\trinputs = /^(?:input|select|textarea|button)$/i,\n\trheader = /^h\\d$/i,\n\n\trescape = /'|\\\\/g,\n\n\t// CSS escapes http://www.w3.org/TR/CSS21/syndata.html#escaped-characters\n\trunescape = new RegExp( \"\\\\\\\\([\\\\da-f]{1,6}\" + whitespace + \"?|(\" + whitespace + \")|.)\", \"ig\" ),\n\tfunescape = function( _, escaped, escapedWhitespace ) {\n\t\tvar high = \"0x\" + escaped - 0x10000;\n\t\t// NaN means non-codepoint\n\t\t// Support: Firefox\n\t\t// Workaround erroneous numeric interpretation of +\"0x\"\n\t\treturn high !== high || escapedWhitespace ?\n\t\t\tescaped :\n\t\t\t// BMP codepoint\n\t\t\thigh < 0 ?\n\t\t\t\tString.fromCharCode( high + 0x10000 ) :\n\t\t\t\t// Supplemental Plane codepoint (surrogate pair)\n\t\t\t\tString.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 );\n\t};\n\n// Optimize for push.apply( _, NodeList )\ntry {\n\tpush.apply(\n\t\t(arr = slice.call( preferredDoc.childNodes )),\n\t\tpreferredDoc.childNodes\n\t);\n\t// Support: Android<4.0\n\t// Detect silently failing push.apply\n\tarr[ preferredDoc.childNodes.length ].nodeType;\n} catch ( e ) {\n\tpush = { apply: arr.length ?\n\n\t\t// Leverage slice if possible\n\t\tfunction( target, els ) {\n\t\t\tpush_native.apply( target, slice.call(els) );\n\t\t} :\n\n\t\t// Support: IE<9\n\t\t// Otherwise append directly\n\t\tfunction( target, els ) {\n\t\t\tvar j = target.length,\n\t\t\t\ti = 0;\n\t\t\t// Can't trust NodeList.length\n\t\t\twhile ( (target[j++] = els[i++]) ) {}\n\t\t\ttarget.length = j - 1;\n\t\t}\n\t};\n}\n\nfunction Sizzle( selector, context, results, seed ) {\n\tvar match, elem, m, nodeType,\n\t\t// QSA vars\n\t\ti, groups, old, nid, newContext, newSelector;\n\n\tif ( ( context ? context.ownerDocument || context : preferredDoc ) !== document ) {\n\t\tsetDocument( context );\n\t}\n\n\tcontext = context || document;\n\tresults = results || [];\n\n\tif ( !selector || typeof selector !== \"string\" ) {\n\t\treturn results;\n\t}\n\n\tif ( (nodeType = context.nodeType) !== 1 && nodeType !== 9 ) {\n\t\treturn [];\n\t}\n\n\tif ( documentIsHTML && !seed ) {\n\n\t\t// Shortcuts\n\t\tif ( (match = rquickExpr.exec( selector )) ) {\n\t\t\t// Speed-up: Sizzle(\"#ID\")\n\t\t\tif ( (m = match[1]) ) {\n\t\t\t\tif ( nodeType === 9 ) {\n\t\t\t\t\telem = context.getElementById( m );\n\t\t\t\t\t// Check parentNode to catch when Blackberry 4.6 returns\n\t\t\t\t\t// nodes that are no longer in the document #6963\n\t\t\t\t\tif ( elem && elem.parentNode ) {\n\t\t\t\t\t\t// Handle the case where IE, Opera, and Webkit return items\n\t\t\t\t\t\t// by name instead of ID\n\t\t\t\t\t\tif ( elem.id === m ) {\n\t\t\t\t\t\t\tresults.push( elem );\n\t\t\t\t\t\t\treturn results;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn results;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t// Context is not a document\n\t\t\t\t\tif ( context.ownerDocument && (elem = context.ownerDocument.getElementById( m )) &&\n\t\t\t\t\t\tcontains( context, elem ) && elem.id === m ) {\n\t\t\t\t\t\tresults.push( elem );\n\t\t\t\t\t\treturn results;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t// Speed-up: Sizzle(\"TAG\")\n\t\t\t} else if ( match[2] ) {\n\t\t\t\tpush.apply( results, context.getElementsByTagName( selector ) );\n\t\t\t\treturn results;\n\n\t\t\t// Speed-up: Sizzle(\".CLASS\")\n\t\t\t} else if ( (m = match[3]) && support.getElementsByClassName && context.getElementsByClassName ) {\n\t\t\t\tpush.apply( results, context.getElementsByClassName( m ) );\n\t\t\t\treturn results;\n\t\t\t}\n\t\t}\n\n\t\t// QSA path\n\t\tif ( support.qsa && (!rbuggyQSA || !rbuggyQSA.test( selector )) ) {\n\t\t\tnid = old = expando;\n\t\t\tnewContext = context;\n\t\t\tnewSelector = nodeType === 9 && selector;\n\n\t\t\t// qSA works strangely on Element-rooted queries\n\t\t\t// We can work around this by specifying an extra ID on the root\n\t\t\t// and working up from there (Thanks to Andrew Dupont for the technique)\n\t\t\t// IE 8 doesn't work on object elements\n\t\t\tif ( nodeType === 1 && context.nodeName.toLowerCase() !== \"object\" ) {\n\t\t\t\tgroups = tokenize( selector );\n\n\t\t\t\tif ( (old = context.getAttribute(\"id\")) ) {\n\t\t\t\t\tnid = old.replace( rescape, \"\\\\$&\" );\n\t\t\t\t} else {\n\t\t\t\t\tcontext.setAttribute( \"id\", nid );\n\t\t\t\t}\n\t\t\t\tnid = \"[id='\" + nid + \"'] \";\n\n\t\t\t\ti = groups.length;\n\t\t\t\twhile ( i-- ) {\n\t\t\t\t\tgroups[i] = nid + toSelector( groups[i] );\n\t\t\t\t}\n\t\t\t\tnewContext = rsibling.test( selector ) && context.parentNode || context;\n\t\t\t\tnewSelector = groups.join(\",\");\n\t\t\t}\n\n\t\t\tif ( newSelector ) {\n\t\t\t\ttry {\n\t\t\t\t\tpush.apply( results,\n\t\t\t\t\t\tnewContext.querySelectorAll( newSelector )\n\t\t\t\t\t);\n\t\t\t\t\treturn results;\n\t\t\t\t} catch(qsaError) {\n\t\t\t\t} finally {\n\t\t\t\t\tif ( !old ) {\n\t\t\t\t\t\tcontext.removeAttribute(\"id\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t// All others\n\treturn select( selector.replace( rtrim, \"$1\" ), context, results, seed );\n}\n\n/**\n * Create key-value caches of limited size\n * @returns {Function(string, Object)} Returns the Object data after storing it on itself with\n *\tproperty name the (space-suffixed) string and (if the cache is larger than Expr.cacheLength)\n *\tdeleting the oldest entry\n */\nfunction createCache() {\n\tvar keys = [];\n\n\tfunction cache( key, value ) {\n\t\t// Use (key + \" \") to avoid collision with native prototype properties (see Issue #157)\n\t\tif ( keys.push( key += \" \" ) > Expr.cacheLength ) {\n\t\t\t// Only keep the most recent entries\n\t\t\tdelete cache[ keys.shift() ];\n\t\t}\n\t\treturn (cache[ key ] = value);\n\t}\n\treturn cache;\n}\n\n/**\n * Mark a function for special use by Sizzle\n * @param {Function} fn The function to mark\n */\nfunction markFunction( fn ) {\n\tfn[ expando ] = true;\n\treturn fn;\n}\n\n/**\n * Support testing using an element\n * @param {Function} fn Passed the created div and expects a boolean result\n */\nfunction assert( fn ) {\n\tvar div = document.createElement(\"div\");\n\n\ttry {\n\t\treturn !!fn( div );\n\t} catch (e) {\n\t\treturn false;\n\t} finally {\n\t\t// Remove from its parent by default\n\t\tif ( div.parentNode ) {\n\t\t\tdiv.parentNode.removeChild( div );\n\t\t}\n\t\t// release memory in IE\n\t\tdiv = null;\n\t}\n}\n\n/**\n * Adds the same handler for all of the specified attrs\n * @param {String} attrs Pipe-separated list of attributes\n * @param {Function} handler The method that will be applied\n */\nfunction addHandle( attrs, handler ) {\n\tvar arr = attrs.split(\"|\"),\n\t\ti = attrs.length;\n\n\twhile ( i-- ) {\n\t\tExpr.attrHandle[ arr[i] ] = handler;\n\t}\n}\n\n/**\n * Checks document order of two siblings\n * @param {Element} a\n * @param {Element} b\n * @returns {Number} Returns less than 0 if a precedes b, greater than 0 if a follows b\n */\nfunction siblingCheck( a, b ) {\n\tvar cur = b && a,\n\t\tdiff = cur && a.nodeType === 1 && b.nodeType === 1 &&\n\t\t\t( ~b.sourceIndex || MAX_NEGATIVE ) -\n\t\t\t( ~a.sourceIndex || MAX_NEGATIVE );\n\n\t// Use IE sourceIndex if available on both nodes\n\tif ( diff ) {\n\t\treturn diff;\n\t}\n\n\t// Check if b follows a\n\tif ( cur ) {\n\t\twhile ( (cur = cur.nextSibling) ) {\n\t\t\tif ( cur === b ) {\n\t\t\t\treturn -1;\n\t\t\t}\n\t\t}\n\t}\n\n\treturn a ? 1 : -1;\n}\n\n/**\n * Returns a function to use in pseudos for input types\n * @param {String} type\n */\nfunction createInputPseudo( type ) {\n\treturn function( elem ) {\n\t\tvar name = elem.nodeName.toLowerCase();\n\t\treturn name === \"input\" && elem.type === type;\n\t};\n}\n\n/**\n * Returns a function to use in pseudos for buttons\n * @param {String} type\n */\nfunction createButtonPseudo( type ) {\n\treturn function( elem ) {\n\t\tvar name = elem.nodeName.toLowerCase();\n\t\treturn (name === \"input\" || name === \"button\") && elem.type === type;\n\t};\n}\n\n/**\n * Returns a function to use in pseudos for positionals\n * @param {Function} fn\n */\nfunction createPositionalPseudo( fn ) {\n\treturn markFunction(function( argument ) {\n\t\targument = +argument;\n\t\treturn markFunction(function( seed, matches ) {\n\t\t\tvar j,\n\t\t\t\tmatchIndexes = fn( [], seed.length, argument ),\n\t\t\t\ti = matchIndexes.length;\n\n\t\t\t// Match elements found at the specified indexes\n\t\t\twhile ( i-- ) {\n\t\t\t\tif ( seed[ (j = matchIndexes[i]) ] ) {\n\t\t\t\t\tseed[j] = !(matches[j] = seed[j]);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t});\n}\n\n/**\n * Detect xml\n * @param {Element|Object} elem An element or a document\n */\nisXML = Sizzle.isXML = function( elem ) {\n\t// documentElement is verified for cases where it doesn't yet exist\n\t// (such as loading iframes in IE - #4833)\n\tvar documentElement = elem && (elem.ownerDocument || elem).documentElement;\n\treturn documentElement ? documentElement.nodeName !== \"HTML\" : false;\n};\n\n// Expose support vars for convenience\nsupport = Sizzle.support = {};\n\n/**\n * Sets document-related variables once based on the current document\n * @param {Element|Object} [doc] An element or document object to use to set the document\n * @returns {Object} Returns the current document\n */\nsetDocument = Sizzle.setDocument = function( node ) {\n\tvar doc = node ? node.ownerDocument || node : preferredDoc,\n\t\tparent = doc.defaultView;\n\n\t// If no document and documentElement is available, return\n\tif ( doc === document || doc.nodeType !== 9 || !doc.documentElement ) {\n\t\treturn document;\n\t}\n\n\t// Set our document\n\tdocument = doc;\n\tdocElem = doc.documentElement;\n\n\t// Support tests\n\tdocumentIsHTML = !isXML( doc );\n\n\t// Support: IE>8\n\t// If iframe document is assigned to \"document\" variable and if iframe has been reloaded,\n\t// IE will throw \"permission denied\" error when accessing \"document\" variable, see jQuery #13936\n\t// IE6-8 do not support the defaultView property so parent will be undefined\n\tif ( parent && parent.attachEvent && parent !== parent.top ) {\n\t\tparent.attachEvent( \"onbeforeunload\", function() {\n\t\t\tsetDocument();\n\t\t});\n\t}\n\n\t/* Attributes\n\t---------------------------------------------------------------------- */\n\n\t// Support: IE<8\n\t// Verify that getAttribute really returns attributes and not properties (excepting IE8 booleans)\n\tsupport.attributes = assert(function( div ) {\n\t\tdiv.className = \"i\";\n\t\treturn !div.getAttribute(\"className\");\n\t});\n\n\t/* getElement(s)By*\n\t---------------------------------------------------------------------- */\n\n\t// Check if getElementsByTagName(\"*\") returns only elements\n\tsupport.getElementsByTagName = assert(function( div ) {\n\t\tdiv.appendChild( doc.createComment(\"\") );\n\t\treturn !div.getElementsByTagName(\"*\").length;\n\t});\n\n\t// Check if getElementsByClassName can be trusted\n\tsupport.getElementsByClassName = assert(function( div ) {\n\t\tdiv.innerHTML = \"<div class='a'></div><div class='a i'></div>\";\n\n\t\t// Support: Safari<4\n\t\t// Catch class over-caching\n\t\tdiv.firstChild.className = \"i\";\n\t\t// Support: Opera<10\n\t\t// Catch gEBCN failure to find non-leading classes\n\t\treturn div.getElementsByClassName(\"i\").length === 2;\n\t});\n\n\t// Support: IE<10\n\t// Check if getElementById returns elements by name\n\t// The broken getElementById methods don't pick up programatically-set names,\n\t// so use a roundabout getElementsByName test\n\tsupport.getById = assert(function( div ) {\n\t\tdocElem.appendChild( div ).id = expando;\n\t\treturn !doc.getElementsByName || !doc.getElementsByName( expando ).length;\n\t});\n\n\t// ID find and filter\n\tif ( support.getById ) {\n\t\tExpr.find[\"ID\"] = function( id, context ) {\n\t\t\tif ( typeof context.getElementById !== strundefined && documentIsHTML ) {\n\t\t\t\tvar m = context.getElementById( id );\n\t\t\t\t// Check parentNode to catch when Blackberry 4.6 returns\n\t\t\t\t// nodes that are no longer in the document #6963\n\t\t\t\treturn m && m.parentNode ? [m] : [];\n\t\t\t}\n\t\t};\n\t\tExpr.filter[\"ID\"] = function( id ) {\n\t\t\tvar attrId = id.replace( runescape, funescape );\n\t\t\treturn function( elem ) {\n\t\t\t\treturn elem.getAttribute(\"id\") === attrId;\n\t\t\t};\n\t\t};\n\t} else {\n\t\t// Support: IE6/7\n\t\t// getElementById is not reliable as a find shortcut\n\t\tdelete Expr.find[\"ID\"];\n\n\t\tExpr.filter[\"ID\"] = function( id ) {\n\t\t\tvar attrId = id.replace( runescape, funescape );\n\t\t\treturn function( elem ) {\n\t\t\t\tvar node = typeof elem.getAttributeNode !== strundefined && elem.getAttributeNode(\"id\");\n\t\t\t\treturn node && node.value === attrId;\n\t\t\t};\n\t\t};\n\t}\n\n\t// Tag\n\tExpr.find[\"TAG\"] = support.getElementsByTagName ?\n\t\tfunction( tag, context ) {\n\t\t\tif ( typeof context.getElementsByTagName !== strundefined ) {\n\t\t\t\treturn context.getElementsByTagName( tag );\n\t\t\t}\n\t\t} :\n\t\tfunction( tag, context ) {\n\t\t\tvar elem,\n\t\t\t\ttmp = [],\n\t\t\t\ti = 0,\n\t\t\t\tresults = context.getElementsByTagName( tag );\n\n\t\t\t// Filter out possible comments\n\t\t\tif ( tag === \"*\" ) {\n\t\t\t\twhile ( (elem = results[i++]) ) {\n\t\t\t\t\tif ( elem.nodeType === 1 ) {\n\t\t\t\t\t\ttmp.push( elem );\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\treturn tmp;\n\t\t\t}\n\t\t\treturn results;\n\t\t};\n\n\t// Class\n\tExpr.find[\"CLASS\"] = support.getElementsByClassName && function( className, context ) {\n\t\tif ( typeof context.getElementsByClassName !== strundefined && documentIsHTML ) {\n\t\t\treturn context.getElementsByClassName( className );\n\t\t}\n\t};\n\n\t/* QSA/matchesSelector\n\t---------------------------------------------------------------------- */\n\n\t// QSA and matchesSelector support\n\n\t// matchesSelector(:active) reports false when true (IE9/Opera 11.5)\n\trbuggyMatches = [];\n\n\t// qSa(:focus) reports false when true (Chrome 21)\n\t// We allow this because of a bug in IE8/9 that throws an error\n\t// whenever `document.activeElement` is accessed on an iframe\n\t// So, we allow :focus to pass through QSA all the time to avoid the IE error\n\t// See http://bugs.jquery.com/ticket/13378\n\trbuggyQSA = [];\n\n\tif ( (support.qsa = rnative.test( doc.querySelectorAll )) ) {\n\t\t// Build QSA regex\n\t\t// Regex strategy adopted from Diego Perini\n\t\tassert(function( div ) {\n\t\t\t// Select is set to empty string on purpose\n\t\t\t// This is to test IE's treatment of not explicitly\n\t\t\t// setting a boolean content attribute,\n\t\t\t// since its presence should be enough\n\t\t\t// http://bugs.jquery.com/ticket/12359\n\t\t\tdiv.innerHTML = \"<select><option selected=''></option></select>\";\n\n\t\t\t// Support: IE8\n\t\t\t// Boolean attributes and \"value\" are not treated correctly\n\t\t\tif ( !div.querySelectorAll(\"[selected]\").length ) {\n\t\t\t\trbuggyQSA.push( \"\\\\[\" + whitespace + \"*(?:value|\" + booleans + \")\" );\n\t\t\t}\n\n\t\t\t// Webkit/Opera - :checked should return selected option elements\n\t\t\t// http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked\n\t\t\t// IE8 throws error here and will not see later tests\n\t\t\tif ( !div.querySelectorAll(\":checked\").length ) {\n\t\t\t\trbuggyQSA.push(\":checked\");\n\t\t\t}\n\t\t});\n\n\t\tassert(function( div ) {\n\n\t\t\t// Support: Opera 10-12/IE8\n\t\t\t// ^= $= *= and empty values\n\t\t\t// Should not select anything\n\t\t\t// Support: Windows 8 Native Apps\n\t\t\t// The type attribute is restricted during .innerHTML assignment\n\t\t\tvar input = doc.createElement(\"input\");\n\t\t\tinput.setAttribute( \"type\", \"hidden\" );\n\t\t\tdiv.appendChild( input ).setAttribute( \"t\", \"\" );\n\n\t\t\tif ( div.querySelectorAll(\"[t^='']\").length ) {\n\t\t\t\trbuggyQSA.push( \"[*^$]=\" + whitespace + \"*(?:''|\\\"\\\")\" );\n\t\t\t}\n\n\t\t\t// FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled)\n\t\t\t// IE8 throws error here and will not see later tests\n\t\t\tif ( !div.querySelectorAll(\":enabled\").length ) {\n\t\t\t\trbuggyQSA.push( \":enabled\", \":disabled\" );\n\t\t\t}\n\n\t\t\t// Opera 10-11 does not throw on post-comma invalid pseudos\n\t\t\tdiv.querySelectorAll(\"*,:x\");\n\t\t\trbuggyQSA.push(\",.*:\");\n\t\t});\n\t}\n\n\tif ( (support.matchesSelector = rnative.test( (matches = docElem.webkitMatchesSelector ||\n\t\tdocElem.mozMatchesSelector ||\n\t\tdocElem.oMatchesSelector ||\n\t\tdocElem.msMatchesSelector) )) ) {\n\n\t\tassert(function( div ) {\n\t\t\t// Check to see if it's possible to do matchesSelector\n\t\t\t// on a disconnected node (IE 9)\n\t\t\tsupport.disconnectedMatch = matches.call( div, \"div\" );\n\n\t\t\t// This should fail with an exception\n\t\t\t// Gecko does not error, returns false instead\n\t\t\tmatches.call( div, \"[s!='']:x\" );\n\t\t\trbuggyMatches.push( \"!=\", pseudos );\n\t\t});\n\t}\n\n\trbuggyQSA = rbuggyQSA.length && new RegExp( rbuggyQSA.join(\"|\") );\n\trbuggyMatches = rbuggyMatches.length && new RegExp( rbuggyMatches.join(\"|\") );\n\n\t/* Contains\n\t---------------------------------------------------------------------- */\n\n\t// Element contains another\n\t// Purposefully does not implement inclusive descendent\n\t// As in, an element does not contain itself\n\tcontains = rnative.test( docElem.contains ) || docElem.compareDocumentPosition ?\n\t\tfunction( a, b ) {\n\t\t\tvar adown = a.nodeType === 9 ? a.documentElement : a,\n\t\t\t\tbup = b && b.parentNode;\n\t\t\treturn a === bup || !!( bup && bup.nodeType === 1 && (\n\t\t\t\tadown.contains ?\n\t\t\t\t\tadown.contains( bup ) :\n\t\t\t\t\ta.compareDocumentPosition && a.compareDocumentPosition( bup ) & 16\n\t\t\t));\n\t\t} :\n\t\tfunction( a, b ) {\n\t\t\tif ( b ) {\n\t\t\t\twhile ( (b = b.parentNode) ) {\n\t\t\t\t\tif ( b === a ) {\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn false;\n\t\t};\n\n\t/* Sorting\n\t---------------------------------------------------------------------- */\n\n\t// Document order sorting\n\tsortOrder = docElem.compareDocumentPosition ?\n\tfunction( a, b ) {\n\n\t\t// Flag for duplicate removal\n\t\tif ( a === b ) {\n\t\t\thasDuplicate = true;\n\t\t\treturn 0;\n\t\t}\n\n\t\tvar compare = b.compareDocumentPosition && a.compareDocumentPosition && a.compareDocumentPosition( b );\n\n\t\tif ( compare ) {\n\t\t\t// Disconnected nodes\n\t\t\tif ( compare & 1 ||\n\t\t\t\t(!support.sortDetached && b.compareDocumentPosition( a ) === compare) ) {\n\n\t\t\t\t// Choose the first element that is related to our preferred document\n\t\t\t\tif ( a === doc || contains(preferredDoc, a) ) {\n\t\t\t\t\treturn -1;\n\t\t\t\t}\n\t\t\t\tif ( b === doc || contains(preferredDoc, b) ) {\n\t\t\t\t\treturn 1;\n\t\t\t\t}\n\n\t\t\t\t// Maintain original order\n\t\t\t\treturn sortInput ?\n\t\t\t\t\t( indexOf.call( sortInput, a ) - indexOf.call( sortInput, b ) ) :\n\t\t\t\t\t0;\n\t\t\t}\n\n\t\t\treturn compare & 4 ? -1 : 1;\n\t\t}\n\n\t\t// Not directly comparable, sort on existence of method\n\t\treturn a.compareDocumentPosition ? -1 : 1;\n\t} :\n\tfunction( a, b ) {\n\t\tvar cur,\n\t\t\ti = 0,\n\t\t\taup = a.parentNode,\n\t\t\tbup = b.parentNode,\n\t\t\tap = [ a ],\n\t\t\tbp = [ b ];\n\n\t\t// Exit early if the nodes are identical\n\t\tif ( a === b ) {\n\t\t\thasDuplicate = true;\n\t\t\treturn 0;\n\n\t\t// Parentless nodes are either documents or disconnected\n\t\t} else if ( !aup || !bup ) {\n\t\t\treturn a === doc ? -1 :\n\t\t\t\tb === doc ? 1 :\n\t\t\t\taup ? -1 :\n\t\t\t\tbup ? 1 :\n\t\t\t\tsortInput ?\n\t\t\t\t( indexOf.call( sortInput, a ) - indexOf.call( sortInput, b ) ) :\n\t\t\t\t0;\n\n\t\t// If the nodes are siblings, we can do a quick check\n\t\t} else if ( aup === bup ) {\n\t\t\treturn siblingCheck( a, b );\n\t\t}\n\n\t\t// Otherwise we need full lists of their ancestors for comparison\n\t\tcur = a;\n\t\twhile ( (cur = cur.parentNode) ) {\n\t\t\tap.unshift( cur );\n\t\t}\n\t\tcur = b;\n\t\twhile ( (cur = cur.parentNode) ) {\n\t\t\tbp.unshift( cur );\n\t\t}\n\n\t\t// Walk down the tree looking for a discrepancy\n\t\twhile ( ap[i] === bp[i] ) {\n\t\t\ti++;\n\t\t}\n\n\t\treturn i ?\n\t\t\t// Do a sibling check if the nodes have a common ancestor\n\t\t\tsiblingCheck( ap[i], bp[i] ) :\n\n\t\t\t// Otherwise nodes in our document sort first\n\t\t\tap[i] === preferredDoc ? -1 :\n\t\t\tbp[i] === preferredDoc ? 1 :\n\t\t\t0;\n\t};\n\n\treturn doc;\n};\n\nSizzle.matches = function( expr, elements ) {\n\treturn Sizzle( expr, null, null, elements );\n};\n\nSizzle.matchesSelector = function( elem, expr ) {\n\t// Set document vars if needed\n\tif ( ( elem.ownerDocument || elem ) !== document ) {\n\t\tsetDocument( elem );\n\t}\n\n\t// Make sure that attribute selectors are quoted\n\texpr = expr.replace( rattributeQuotes, \"='$1']\" );\n\n\tif ( support.matchesSelector && documentIsHTML &&\n\t\t( !rbuggyMatches || !rbuggyMatches.test( expr ) ) &&\n\t\t( !rbuggyQSA || !rbuggyQSA.test( expr ) ) ) {\n\n\t\ttry {\n\t\t\tvar ret = matches.call( elem, expr );\n\n\t\t\t// IE 9's matchesSelector returns false on disconnected nodes\n\t\t\tif ( ret || support.disconnectedMatch ||\n\t\t\t\t\t// As well, disconnected nodes are said to be in a document\n\t\t\t\t\t// fragment in IE 9\n\t\t\t\t\telem.document && elem.document.nodeType !== 11 ) {\n\t\t\t\treturn ret;\n\t\t\t}\n\t\t} catch(e) {}\n\t}\n\n\treturn Sizzle( expr, document, null, [elem] ).length > 0;\n};\n\nSizzle.contains = function( context, elem ) {\n\t// Set document vars if needed\n\tif ( ( context.ownerDocument || context ) !== document ) {\n\t\tsetDocument( context );\n\t}\n\treturn contains( context, elem );\n};\n\nSizzle.attr = function( elem, name ) {\n\t// Set document vars if needed\n\tif ( ( elem.ownerDocument || elem ) !== document ) {\n\t\tsetDocument( elem );\n\t}\n\n\tvar fn = Expr.attrHandle[ name.toLowerCase() ],\n\t\t// Don't get fooled by Object.prototype properties (jQuery #13807)\n\t\tval = fn && hasOwn.call( Expr.attrHandle, name.toLowerCase() ) ?\n\t\t\tfn( elem, name, !documentIsHTML ) :\n\t\t\tundefined;\n\n\treturn val === undefined ?\n\t\tsupport.attributes || !documentIsHTML ?\n\t\t\telem.getAttribute( name ) :\n\t\t\t(val = elem.getAttributeNode(name)) && val.specified ?\n\t\t\t\tval.value :\n\t\t\t\tnull :\n\t\tval;\n};\n\nSizzle.error = function( msg ) {\n\tthrow new Error( \"Syntax error, unrecognized expression: \" + msg );\n};\n\n/**\n * Document sorting and removing duplicates\n * @param {ArrayLike} results\n */\nSizzle.uniqueSort = function( results ) {\n\tvar elem,\n\t\tduplicates = [],\n\t\tj = 0,\n\t\ti = 0;\n\n\t// Unless we *know* we can detect duplicates, assume their presence\n\thasDuplicate = !support.detectDuplicates;\n\tsortInput = !support.sortStable && results.slice( 0 );\n\tresults.sort( sortOrder );\n\n\tif ( hasDuplicate ) {\n\t\twhile ( (elem = results[i++]) ) {\n\t\t\tif ( elem === results[ i ] ) {\n\t\t\t\tj = duplicates.push( i );\n\t\t\t}\n\t\t}\n\t\twhile ( j-- ) {\n\t\t\tresults.splice( duplicates[ j ], 1 );\n\t\t}\n\t}\n\n\treturn results;\n};\n\n/**\n * Utility function for retrieving the text value of an array of DOM nodes\n * @param {Array|Element} elem\n */\ngetText = Sizzle.getText = function( elem ) {\n\tvar node,\n\t\tret = \"\",\n\t\ti = 0,\n\t\tnodeType = elem.nodeType;\n\n\tif ( !nodeType ) {\n\t\t// If no nodeType, this is expected to be an array\n\t\tfor ( ; (node = elem[i]); i++ ) {\n\t\t\t// Do not traverse comment nodes\n\t\t\tret += getText( node );\n\t\t}\n\t} else if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) {\n\t\t// Use textContent for elements\n\t\t// innerText usage removed for consistency of new lines (see #11153)\n\t\tif ( typeof elem.textContent === \"string\" ) {\n\t\t\treturn elem.textContent;\n\t\t} else {\n\t\t\t// Traverse its children\n\t\t\tfor ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {\n\t\t\t\tret += getText( elem );\n\t\t\t}\n\t\t}\n\t} else if ( nodeType === 3 || nodeType === 4 ) {\n\t\treturn elem.nodeValue;\n\t}\n\t// Do not include comment or processing instruction nodes\n\n\treturn ret;\n};\n\nExpr = Sizzle.selectors = {\n\n\t// Can be adjusted by the user\n\tcacheLength: 50,\n\n\tcreatePseudo: markFunction,\n\n\tmatch: matchExpr,\n\n\tattrHandle: {},\n\n\tfind: {},\n\n\trelative: {\n\t\t\">\": { dir: \"parentNode\", first: true },\n\t\t\" \": { dir: \"parentNode\" },\n\t\t\"+\": { dir: \"previousSibling\", first: true },\n\t\t\"~\": { dir: \"previousSibling\" }\n\t},\n\n\tpreFilter: {\n\t\t\"ATTR\": function( match ) {\n\t\t\tmatch[1] = match[1].replace( runescape, funescape );\n\n\t\t\t// Move the given value to match[3] whether quoted or unquoted\n\t\t\tmatch[3] = ( match[4] || match[5] || \"\" ).replace( runescape, funescape );\n\n\t\t\tif ( match[2] === \"~=\" ) {\n\t\t\t\tmatch[3] = \" \" + match[3] + \" \";\n\t\t\t}\n\n\t\t\treturn match.slice( 0, 4 );\n\t\t},\n\n\t\t\"CHILD\": function( match ) {\n\t\t\t/* matches from matchExpr[\"CHILD\"]\n\t\t\t\t1 type (only|nth|...)\n\t\t\t\t2 what (child|of-type)\n\t\t\t\t3 argument (even|odd|\\d*|\\d*n([+-]\\d+)?|...)\n\t\t\t\t4 xn-component of xn+y argument ([+-]?\\d*n|)\n\t\t\t\t5 sign of xn-component\n\t\t\t\t6 x of xn-component\n\t\t\t\t7 sign of y-component\n\t\t\t\t8 y of y-component\n\t\t\t*/\n\t\t\tmatch[1] = match[1].toLowerCase();\n\n\t\t\tif ( match[1].slice( 0, 3 ) === \"nth\" ) {\n\t\t\t\t// nth-* requires argument\n\t\t\t\tif ( !match[3] ) {\n\t\t\t\t\tSizzle.error( match[0] );\n\t\t\t\t}\n\n\t\t\t\t// numeric x and y parameters for Expr.filter.CHILD\n\t\t\t\t// remember that false/true cast respectively to 0/1\n\t\t\t\tmatch[4] = +( match[4] ? match[5] + (match[6] || 1) : 2 * ( match[3] === \"even\" || match[3] === \"odd\" ) );\n\t\t\t\tmatch[5] = +( ( match[7] + match[8] ) || match[3] === \"odd\" );\n\n\t\t\t// other types prohibit arguments\n\t\t\t} else if ( match[3] ) {\n\t\t\t\tSizzle.error( match[0] );\n\t\t\t}\n\n\t\t\treturn match;\n\t\t},\n\n\t\t\"PSEUDO\": function( match ) {\n\t\t\tvar excess,\n\t\t\t\tunquoted = !match[5] && match[2];\n\n\t\t\tif ( matchExpr[\"CHILD\"].test( match[0] ) ) {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\t// Accept quoted arguments as-is\n\t\t\tif ( match[3] && match[4] !== undefined ) {\n\t\t\t\tmatch[2] = match[4];\n\n\t\t\t// Strip excess characters from unquoted arguments\n\t\t\t} else if ( unquoted && rpseudo.test( unquoted ) &&\n\t\t\t\t// Get excess from tokenize (recursively)\n\t\t\t\t(excess = tokenize( unquoted, true )) &&\n\t\t\t\t// advance to the next closing parenthesis\n\t\t\t\t(excess = unquoted.indexOf( \")\", unquoted.length - excess ) - unquoted.length) ) {\n\n\t\t\t\t// excess is a negative index\n\t\t\t\tmatch[0] = match[0].slice( 0, excess );\n\t\t\t\tmatch[2] = unquoted.slice( 0, excess );\n\t\t\t}\n\n\t\t\t// Return only captures needed by the pseudo filter method (type and argument)\n\t\t\treturn match.slice( 0, 3 );\n\t\t}\n\t},\n\n\tfilter: {\n\n\t\t\"TAG\": function( nodeNameSelector ) {\n\t\t\tvar nodeName = nodeNameSelector.replace( runescape, funescape ).toLowerCase();\n\t\t\treturn nodeNameSelector === \"*\" ?\n\t\t\t\tfunction() { return true; } :\n\t\t\t\tfunction( elem ) {\n\t\t\t\t\treturn elem.nodeName && elem.nodeName.toLowerCase() === nodeName;\n\t\t\t\t};\n\t\t},\n\n\t\t\"CLASS\": function( className ) {\n\t\t\tvar pattern = classCache[ className + \" \" ];\n\n\t\t\treturn pattern ||\n\t\t\t\t(pattern = new RegExp( \"(^|\" + whitespace + \")\" + className + \"(\" + whitespace + \"|$)\" )) &&\n\t\t\t\tclassCache( className, function( elem ) {\n\t\t\t\t\treturn pattern.test( typeof elem.className === \"string\" && elem.className || typeof elem.getAttribute !== strundefined && elem.getAttribute(\"class\") || \"\" );\n\t\t\t\t});\n\t\t},\n\n\t\t\"ATTR\": function( name, operator, check ) {\n\t\t\treturn function( elem ) {\n\t\t\t\tvar result = Sizzle.attr( elem, name );\n\n\t\t\t\tif ( result == null ) {\n\t\t\t\t\treturn operator === \"!=\";\n\t\t\t\t}\n\t\t\t\tif ( !operator ) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\n\t\t\t\tresult += \"\";\n\n\t\t\t\treturn operator === \"=\" ? result === check :\n\t\t\t\t\toperator === \"!=\" ? result !== check :\n\t\t\t\t\toperator === \"^=\" ? check && result.indexOf( check ) === 0 :\n\t\t\t\t\toperator === \"*=\" ? check && result.indexOf( check ) > -1 :\n\t\t\t\t\toperator === \"$=\" ? check && result.slice( -check.length ) === check :\n\t\t\t\t\toperator === \"~=\" ? ( \" \" + result + \" \" ).indexOf( check ) > -1 :\n\t\t\t\t\toperator === \"|=\" ? result === check || result.slice( 0, check.length + 1 ) === check + \"-\" :\n\t\t\t\t\tfalse;\n\t\t\t};\n\t\t},\n\n\t\t\"CHILD\": function( type, what, argument, first, last ) {\n\t\t\tvar simple = type.slice( 0, 3 ) !== \"nth\",\n\t\t\t\tforward = type.slice( -4 ) !== \"last\",\n\t\t\t\tofType = what === \"of-type\";\n\n\t\t\treturn first === 1 && last === 0 ?\n\n\t\t\t\t// Shortcut for :nth-*(n)\n\t\t\t\tfunction( elem ) {\n\t\t\t\t\treturn !!elem.parentNode;\n\t\t\t\t} :\n\n\t\t\t\tfunction( elem, context, xml ) {\n\t\t\t\t\tvar cache, outerCache, node, diff, nodeIndex, start,\n\t\t\t\t\t\tdir = simple !== forward ? \"nextSibling\" : \"previousSibling\",\n\t\t\t\t\t\tparent = elem.parentNode,\n\t\t\t\t\t\tname = ofType && elem.nodeName.toLowerCase(),\n\t\t\t\t\t\tuseCache = !xml && !ofType;\n\n\t\t\t\t\tif ( parent ) {\n\n\t\t\t\t\t\t// :(first|last|only)-(child|of-type)\n\t\t\t\t\t\tif ( simple ) {\n\t\t\t\t\t\t\twhile ( dir ) {\n\t\t\t\t\t\t\t\tnode = elem;\n\t\t\t\t\t\t\t\twhile ( (node = node[ dir ]) ) {\n\t\t\t\t\t\t\t\t\tif ( ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1 ) {\n\t\t\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t// Reverse direction for :only-* (if we haven't yet done so)\n\t\t\t\t\t\t\t\tstart = dir = type === \"only\" && !start && \"nextSibling\";\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tstart = [ forward ? parent.firstChild : parent.lastChild ];\n\n\t\t\t\t\t\t// non-xml :nth-child(...) stores cache data on `parent`\n\t\t\t\t\t\tif ( forward && useCache ) {\n\t\t\t\t\t\t\t// Seek `elem` from a previously-cached index\n\t\t\t\t\t\t\touterCache = parent[ expando ] || (parent[ expando ] = {});\n\t\t\t\t\t\t\tcache = outerCache[ type ] || [];\n\t\t\t\t\t\t\tnodeIndex = cache[0] === dirruns && cache[1];\n\t\t\t\t\t\t\tdiff = cache[0] === dirruns && cache[2];\n\t\t\t\t\t\t\tnode = nodeIndex && parent.childNodes[ nodeIndex ];\n\n\t\t\t\t\t\t\twhile ( (node = ++nodeIndex && node && node[ dir ] ||\n\n\t\t\t\t\t\t\t\t// Fallback to seeking `elem` from the start\n\t\t\t\t\t\t\t\t(diff = nodeIndex = 0) || start.pop()) ) {\n\n\t\t\t\t\t\t\t\t// When found, cache indexes on `parent` and break\n\t\t\t\t\t\t\t\tif ( node.nodeType === 1 && ++diff && node === elem ) {\n\t\t\t\t\t\t\t\t\touterCache[ type ] = [ dirruns, nodeIndex, diff ];\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Use previously-cached element index if available\n\t\t\t\t\t\t} else if ( useCache && (cache = (elem[ expando ] || (elem[ expando ] = {}))[ type ]) && cache[0] === dirruns ) {\n\t\t\t\t\t\t\tdiff = cache[1];\n\n\t\t\t\t\t\t// xml :nth-child(...) or :nth-last-child(...) or :nth(-last)?-of-type(...)\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// Use the same loop as above to seek `elem` from the start\n\t\t\t\t\t\t\twhile ( (node = ++nodeIndex && node && node[ dir ] ||\n\t\t\t\t\t\t\t\t(diff = nodeIndex = 0) || start.pop()) ) {\n\n\t\t\t\t\t\t\t\tif ( ( ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1 ) && ++diff ) {\n\t\t\t\t\t\t\t\t\t// Cache the index of each encountered element\n\t\t\t\t\t\t\t\t\tif ( useCache ) {\n\t\t\t\t\t\t\t\t\t\t(node[ expando ] || (node[ expando ] = {}))[ type ] = [ dirruns, diff ];\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\tif ( node === elem ) {\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t}\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\n\t\t\t\t\t\t// Incorporate the offset, then check against cycle size\n\t\t\t\t\t\tdiff -= last;\n\t\t\t\t\t\treturn diff === first || ( diff % first === 0 && diff / first >= 0 );\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t},\n\n\t\t\"PSEUDO\": function( pseudo, argument ) {\n\t\t\t// pseudo-class names are case-insensitive\n\t\t\t// http://www.w3.org/TR/selectors/#pseudo-classes\n\t\t\t// Prioritize by case sensitivity in case custom pseudos are added with uppercase letters\n\t\t\t// Remember that setFilters inherits from pseudos\n\t\t\tvar args,\n\t\t\t\tfn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] ||\n\t\t\t\t\tSizzle.error( \"unsupported pseudo: \" + pseudo );\n\n\t\t\t// The user may use createPseudo to indicate that\n\t\t\t// arguments are needed to create the filter function\n\t\t\t// just as Sizzle does\n\t\t\tif ( fn[ expando ] ) {\n\t\t\t\treturn fn( argument );\n\t\t\t}\n\n\t\t\t// But maintain support for old signatures\n\t\t\tif ( fn.length > 1 ) {\n\t\t\t\targs = [ pseudo, pseudo, \"\", argument ];\n\t\t\t\treturn Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ?\n\t\t\t\t\tmarkFunction(function( seed, matches ) {\n\t\t\t\t\t\tvar idx,\n\t\t\t\t\t\t\tmatched = fn( seed, argument ),\n\t\t\t\t\t\t\ti = matched.length;\n\t\t\t\t\t\twhile ( i-- ) {\n\t\t\t\t\t\t\tidx = indexOf.call( seed, matched[i] );\n\t\t\t\t\t\t\tseed[ idx ] = !( matches[ idx ] = matched[i] );\n\t\t\t\t\t\t}\n\t\t\t\t\t}) :\n\t\t\t\t\tfunction( elem ) {\n\t\t\t\t\t\treturn fn( elem, 0, args );\n\t\t\t\t\t};\n\t\t\t}\n\n\t\t\treturn fn;\n\t\t}\n\t},\n\n\tpseudos: {\n\t\t// Potentially complex pseudos\n\t\t\"not\": markFunction(function( selector ) {\n\t\t\t// Trim the selector passed to compile\n\t\t\t// to avoid treating leading and trailing\n\t\t\t// spaces as combinators\n\t\t\tvar input = [],\n\t\t\t\tresults = [],\n\t\t\t\tmatcher = compile( selector.replace( rtrim, \"$1\" ) );\n\n\t\t\treturn matcher[ expando ] ?\n\t\t\t\tmarkFunction(function( seed, matches, context, xml ) {\n\t\t\t\t\tvar elem,\n\t\t\t\t\t\tunmatched = matcher( seed, null, xml, [] ),\n\t\t\t\t\t\ti = seed.length;\n\n\t\t\t\t\t// Match elements unmatched by `matcher`\n\t\t\t\t\twhile ( i-- ) {\n\t\t\t\t\t\tif ( (elem = unmatched[i]) ) {\n\t\t\t\t\t\t\tseed[i] = !(matches[i] = elem);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}) :\n\t\t\t\tfunction( elem, context, xml ) {\n\t\t\t\t\tinput[0] = elem;\n\t\t\t\t\tmatcher( input, null, xml, results );\n\t\t\t\t\treturn !results.pop();\n\t\t\t\t};\n\t\t}),\n\n\t\t\"has\": markFunction(function( selector ) {\n\t\t\treturn function( elem ) {\n\t\t\t\treturn Sizzle( selector, elem ).length > 0;\n\t\t\t};\n\t\t}),\n\n\t\t\"contains\": markFunction(function( text ) {\n\t\t\treturn function( elem ) {\n\t\t\t\treturn ( elem.textContent || elem.innerText || getText( elem ) ).indexOf( text ) > -1;\n\t\t\t};\n\t\t}),\n\n\t\t// \"Whether an element is represented by a :lang() selector\n\t\t// is based solely on the element's language value\n\t\t// being equal to the identifier C,\n\t\t// or beginning with the identifier C immediately followed by \"-\".\n\t\t// The matching of C against the element's language value is performed case-insensitively.\n\t\t// The identifier C does not have to be a valid language name.\"\n\t\t// http://www.w3.org/TR/selectors/#lang-pseudo\n\t\t\"lang\": markFunction( function( lang ) {\n\t\t\t// lang value must be a valid identifier\n\t\t\tif ( !ridentifier.test(lang || \"\") ) {\n\t\t\t\tSizzle.error( \"unsupported lang: \" + lang );\n\t\t\t}\n\t\t\tlang = lang.replace( runescape, funescape ).toLowerCase();\n\t\t\treturn function( elem ) {\n\t\t\t\tvar elemLang;\n\t\t\t\tdo {\n\t\t\t\t\tif ( (elemLang = documentIsHTML ?\n\t\t\t\t\t\telem.lang :\n\t\t\t\t\t\telem.getAttribute(\"xml:lang\") || elem.getAttribute(\"lang\")) ) {\n\n\t\t\t\t\t\telemLang = elemLang.toLowerCase();\n\t\t\t\t\t\treturn elemLang === lang || elemLang.indexOf( lang + \"-\" ) === 0;\n\t\t\t\t\t}\n\t\t\t\t} while ( (elem = elem.parentNode) && elem.nodeType === 1 );\n\t\t\t\treturn false;\n\t\t\t};\n\t\t}),\n\n\t\t// Miscellaneous\n\t\t\"target\": function( elem ) {\n\t\t\tvar hash = window.location && window.location.hash;\n\t\t\treturn hash && hash.slice( 1 ) === elem.id;\n\t\t},\n\n\t\t\"root\": function( elem ) {\n\t\t\treturn elem === docElem;\n\t\t},\n\n\t\t\"focus\": function( elem ) {\n\t\t\treturn elem === document.activeElement && (!document.hasFocus || document.hasFocus()) && !!(elem.type || elem.href || ~elem.tabIndex);\n\t\t},\n\n\t\t// Boolean properties\n\t\t\"enabled\": function( elem ) {\n\t\t\treturn elem.disabled === false;\n\t\t},\n\n\t\t\"disabled\": function( elem ) {\n\t\t\treturn elem.disabled === true;\n\t\t},\n\n\t\t\"checked\": function( elem ) {\n\t\t\t// In CSS3, :checked should return both checked and selected elements\n\t\t\t// http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked\n\t\t\tvar nodeName = elem.nodeName.toLowerCase();\n\t\t\treturn (nodeName === \"input\" && !!elem.checked) || (nodeName === \"option\" && !!elem.selected);\n\t\t},\n\n\t\t\"selected\": function( elem ) {\n\t\t\t// Accessing this property makes selected-by-default\n\t\t\t// options in Safari work properly\n\t\t\tif ( elem.parentNode ) {\n\t\t\t\telem.parentNode.selectedIndex;\n\t\t\t}\n\n\t\t\treturn elem.selected === true;\n\t\t},\n\n\t\t// Contents\n\t\t\"empty\": function( elem ) {\n\t\t\t// http://www.w3.org/TR/selectors/#empty-pseudo\n\t\t\t// :empty is only affected by element nodes and content nodes(including text(3), cdata(4)),\n\t\t\t// not comment, processing instructions, or others\n\t\t\t// Thanks to Diego Perini for the nodeName shortcut\n\t\t\t// Greater than \"@\" means alpha characters (specifically not starting with \"#\" or \"?\")\n\t\t\tfor ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {\n\t\t\t\tif ( elem.nodeName > \"@\" || elem.nodeType === 3 || elem.nodeType === 4 ) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn true;\n\t\t},\n\n\t\t\"parent\": function( elem ) {\n\t\t\treturn !Expr.pseudos[\"empty\"]( elem );\n\t\t},\n\n\t\t// Element/input types\n\t\t\"header\": function( elem ) {\n\t\t\treturn rheader.test( elem.nodeName );\n\t\t},\n\n\t\t\"input\": function( elem ) {\n\t\t\treturn rinputs.test( elem.nodeName );\n\t\t},\n\n\t\t\"button\": function( elem ) {\n\t\t\tvar name = elem.nodeName.toLowerCase();\n\t\t\treturn name === \"input\" && elem.type === \"button\" || name === \"button\";\n\t\t},\n\n\t\t\"text\": function( elem ) {\n\t\t\tvar attr;\n\t\t\t// IE6 and 7 will map elem.type to 'text' for new HTML5 types (search, etc)\n\t\t\t// use getAttribute instead to test this case\n\t\t\treturn elem.nodeName.toLowerCase() === \"input\" &&\n\t\t\t\telem.type === \"text\" &&\n\t\t\t\t( (attr = elem.getAttribute(\"type\")) == null || attr.toLowerCase() === elem.type );\n\t\t},\n\n\t\t// Position-in-collection\n\t\t\"first\": createPositionalPseudo(function() {\n\t\t\treturn [ 0 ];\n\t\t}),\n\n\t\t\"last\": createPositionalPseudo(function( matchIndexes, length ) {\n\t\t\treturn [ length - 1 ];\n\t\t}),\n\n\t\t\"eq\": createPositionalPseudo(function( matchIndexes, length, argument ) {\n\t\t\treturn [ argument < 0 ? argument + length : argument ];\n\t\t}),\n\n\t\t\"even\": createPositionalPseudo(function( matchIndexes, length ) {\n\t\t\tvar i = 0;\n\t\t\tfor ( ; i < length; i += 2 ) {\n\t\t\t\tmatchIndexes.push( i );\n\t\t\t}\n\t\t\treturn matchIndexes;\n\t\t}),\n\n\t\t\"odd\": createPositionalPseudo(function( matchIndexes, length ) {\n\t\t\tvar i = 1;\n\t\t\tfor ( ; i < length; i += 2 ) {\n\t\t\t\tmatchIndexes.push( i );\n\t\t\t}\n\t\t\treturn matchIndexes;\n\t\t}),\n\n\t\t\"lt\": createPositionalPseudo(function( matchIndexes, length, argument ) {\n\t\t\tvar i = argument < 0 ? argument + length : argument;\n\t\t\tfor ( ; --i >= 0; ) {\n\t\t\t\tmatchIndexes.push( i );\n\t\t\t}\n\t\t\treturn matchIndexes;\n\t\t}),\n\n\t\t\"gt\": createPositionalPseudo(function( matchIndexes, length, argument ) {\n\t\t\tvar i = argument < 0 ? argument + length : argument;\n\t\t\tfor ( ; ++i < length; ) {\n\t\t\t\tmatchIndexes.push( i );\n\t\t\t}\n\t\t\treturn matchIndexes;\n\t\t})\n\t}\n};\n\nExpr.pseudos[\"nth\"] = Expr.pseudos[\"eq\"];\n\n// Add button/input type pseudos\nfor ( i in { radio: true, checkbox: true, file: true, password: true, image: true } ) {\n\tExpr.pseudos[ i ] = createInputPseudo( i );\n}\nfor ( i in { submit: true, reset: true } ) {\n\tExpr.pseudos[ i ] = createButtonPseudo( i );\n}\n\n// Easy API for creating new setFilters\nfunction setFilters() {}\nsetFilters.prototype = Expr.filters = Expr.pseudos;\nExpr.setFilters = new setFilters();\n\nfunction tokenize( selector, parseOnly ) {\n\tvar matched, match, tokens, type,\n\t\tsoFar, groups, preFilters,\n\t\tcached = tokenCache[ selector + \" \" ];\n\n\tif ( cached ) {\n\t\treturn parseOnly ? 0 : cached.slice( 0 );\n\t}\n\n\tsoFar = selector;\n\tgroups = [];\n\tpreFilters = Expr.preFilter;\n\n\twhile ( soFar ) {\n\n\t\t// Comma and first run\n\t\tif ( !matched || (match = rcomma.exec( soFar )) ) {\n\t\t\tif ( match ) {\n\t\t\t\t// Don't consume trailing commas as valid\n\t\t\t\tsoFar = soFar.slice( match[0].length ) || soFar;\n\t\t\t}\n\t\t\tgroups.push( tokens = [] );\n\t\t}\n\n\t\tmatched = false;\n\n\t\t// Combinators\n\t\tif ( (match = rcombinators.exec( soFar )) ) {\n\t\t\tmatched = match.shift();\n\t\t\ttokens.push({\n\t\t\t\tvalue: matched,\n\t\t\t\t// Cast descendant combinators to space\n\t\t\t\ttype: match[0].replace( rtrim, \" \" )\n\t\t\t});\n\t\t\tsoFar = soFar.slice( matched.length );\n\t\t}\n\n\t\t// Filters\n\t\tfor ( type in Expr.filter ) {\n\t\t\tif ( (match = matchExpr[ type ].exec( soFar )) && (!preFilters[ type ] ||\n\t\t\t\t(match = preFilters[ type ]( match ))) ) {\n\t\t\t\tmatched = match.shift();\n\t\t\t\ttokens.push({\n\t\t\t\t\tvalue: matched,\n\t\t\t\t\ttype: type,\n\t\t\t\t\tmatches: match\n\t\t\t\t});\n\t\t\t\tsoFar = soFar.slice( matched.length );\n\t\t\t}\n\t\t}\n\n\t\tif ( !matched ) {\n\t\t\tbreak;\n\t\t}\n\t}\n\n\t// Return the length of the invalid excess\n\t// if we're just parsing\n\t// Otherwise, throw an error or return tokens\n\treturn parseOnly ?\n\t\tsoFar.length :\n\t\tsoFar ?\n\t\t\tSizzle.error( selector ) :\n\t\t\t// Cache the tokens\n\t\t\ttokenCache( selector, groups ).slice( 0 );\n}\n\nfunction toSelector( tokens ) {\n\tvar i = 0,\n\t\tlen = tokens.length,\n\t\tselector = \"\";\n\tfor ( ; i < len; i++ ) {\n\t\tselector += tokens[i].value;\n\t}\n\treturn selector;\n}\n\nfunction addCombinator( matcher, combinator, base ) {\n\tvar dir = combinator.dir,\n\t\tcheckNonElements = base && dir === \"parentNode\",\n\t\tdoneName = done++;\n\n\treturn combinator.first ?\n\t\t// Check against closest ancestor/preceding element\n\t\tfunction( elem, context, xml ) {\n\t\t\twhile ( (elem = elem[ dir ]) ) {\n\t\t\t\tif ( elem.nodeType === 1 || checkNonElements ) {\n\t\t\t\t\treturn matcher( elem, context, xml );\n\t\t\t\t}\n\t\t\t}\n\t\t} :\n\n\t\t// Check against all ancestor/preceding elements\n\t\tfunction( elem, context, xml ) {\n\t\t\tvar data, cache, outerCache,\n\t\t\t\tdirkey = dirruns + \" \" + doneName;\n\n\t\t\t// We can't set arbitrary data on XML nodes, so they don't benefit from dir caching\n\t\t\tif ( xml ) {\n\t\t\t\twhile ( (elem = elem[ dir ]) ) {\n\t\t\t\t\tif ( elem.nodeType === 1 || checkNonElements ) {\n\t\t\t\t\t\tif ( matcher( elem, context, xml ) ) {\n\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\twhile ( (elem = elem[ dir ]) ) {\n\t\t\t\t\tif ( elem.nodeType === 1 || checkNonElements ) {\n\t\t\t\t\t\touterCache = elem[ expando ] || (elem[ expando ] = {});\n\t\t\t\t\t\tif ( (cache = outerCache[ dir ]) && cache[0] === dirkey ) {\n\t\t\t\t\t\t\tif ( (data = cache[1]) === true || data === cachedruns ) {\n\t\t\t\t\t\t\t\treturn data === true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tcache = outerCache[ dir ] = [ dirkey ];\n\t\t\t\t\t\t\tcache[1] = matcher( elem, context, xml ) || cachedruns;\n\t\t\t\t\t\t\tif ( cache[1] === true ) {\n\t\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t};\n}\n\nfunction elementMatcher( matchers ) {\n\treturn matchers.length > 1 ?\n\t\tfunction( elem, context, xml ) {\n\t\t\tvar i = matchers.length;\n\t\t\twhile ( i-- ) {\n\t\t\t\tif ( !matchers[i]( elem, context, xml ) ) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn true;\n\t\t} :\n\t\tmatchers[0];\n}\n\nfunction condense( unmatched, map, filter, context, xml ) {\n\tvar elem,\n\t\tnewUnmatched = [],\n\t\ti = 0,\n\t\tlen = unmatched.length,\n\t\tmapped = map != null;\n\n\tfor ( ; i < len; i++ ) {\n\t\tif ( (elem = unmatched[i]) ) {\n\t\t\tif ( !filter || filter( elem, context, xml ) ) {\n\t\t\t\tnewUnmatched.push( elem );\n\t\t\t\tif ( mapped ) {\n\t\t\t\t\tmap.push( i );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn newUnmatched;\n}\n\nfunction setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) {\n\tif ( postFilter && !postFilter[ expando ] ) {\n\t\tpostFilter = setMatcher( postFilter );\n\t}\n\tif ( postFinder && !postFinder[ expando ] ) {\n\t\tpostFinder = setMatcher( postFinder, postSelector );\n\t}\n\treturn markFunction(function( seed, results, context, xml ) {\n\t\tvar temp, i, elem,\n\t\t\tpreMap = [],\n\t\t\tpostMap = [],\n\t\t\tpreexisting = results.length,\n\n\t\t\t// Get initial elements from seed or context\n\t\t\telems = seed || multipleContexts( selector || \"*\", context.nodeType ? [ context ] : context, [] ),\n\n\t\t\t// Prefilter to get matcher input, preserving a map for seed-results synchronization\n\t\t\tmatcherIn = preFilter && ( seed || !selector ) ?\n\t\t\t\tcondense( elems, preMap, preFilter, context, xml ) :\n\t\t\t\telems,\n\n\t\t\tmatcherOut = matcher ?\n\t\t\t\t// If we have a postFinder, or filtered seed, or non-seed postFilter or preexisting results,\n\t\t\t\tpostFinder || ( seed ? preFilter : preexisting || postFilter ) ?\n\n\t\t\t\t\t// ...intermediate processing is necessary\n\t\t\t\t\t[] :\n\n\t\t\t\t\t// ...otherwise use results directly\n\t\t\t\t\tresults :\n\t\t\t\tmatcherIn;\n\n\t\t// Find primary matches\n\t\tif ( matcher ) {\n\t\t\tmatcher( matcherIn, matcherOut, context, xml );\n\t\t}\n\n\t\t// Apply postFilter\n\t\tif ( postFilter ) {\n\t\t\ttemp = condense( matcherOut, postMap );\n\t\t\tpostFilter( temp, [], context, xml );\n\n\t\t\t// Un-match failing elements by moving them back to matcherIn\n\t\t\ti = temp.length;\n\t\t\twhile ( i-- ) {\n\t\t\t\tif ( (elem = temp[i]) ) {\n\t\t\t\t\tmatcherOut[ postMap[i] ] = !(matcherIn[ postMap[i] ] = elem);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif ( seed ) {\n\t\t\tif ( postFinder || preFilter ) {\n\t\t\t\tif ( postFinder ) {\n\t\t\t\t\t// Get the final matcherOut by condensing this intermediate into postFinder contexts\n\t\t\t\t\ttemp = [];\n\t\t\t\t\ti = matcherOut.length;\n\t\t\t\t\twhile ( i-- ) {\n\t\t\t\t\t\tif ( (elem = matcherOut[i]) ) {\n\t\t\t\t\t\t\t// Restore matcherIn since elem is not yet a final match\n\t\t\t\t\t\t\ttemp.push( (matcherIn[i] = elem) );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tpostFinder( null, (matcherOut = []), temp, xml );\n\t\t\t\t}\n\n\t\t\t\t// Move matched elements from seed to results to keep them synchronized\n\t\t\t\ti = matcherOut.length;\n\t\t\t\twhile ( i-- ) {\n\t\t\t\t\tif ( (elem = matcherOut[i]) &&\n\t\t\t\t\t\t(temp = postFinder ? indexOf.call( seed, elem ) : preMap[i]) > -1 ) {\n\n\t\t\t\t\t\tseed[temp] = !(results[temp] = elem);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t// Add elements to results, through postFinder if defined\n\t\t} else {\n\t\t\tmatcherOut = condense(\n\t\t\t\tmatcherOut === results ?\n\t\t\t\t\tmatcherOut.splice( preexisting, matcherOut.length ) :\n\t\t\t\t\tmatcherOut\n\t\t\t);\n\t\t\tif ( postFinder ) {\n\t\t\t\tpostFinder( null, results, matcherOut, xml );\n\t\t\t} else {\n\t\t\t\tpush.apply( results, matcherOut );\n\t\t\t}\n\t\t}\n\t});\n}\n\nfunction matcherFromTokens( tokens ) {\n\tvar checkContext, matcher, j,\n\t\tlen = tokens.length,\n\t\tleadingRelative = Expr.relative[ tokens[0].type ],\n\t\timplicitRelative = leadingRelative || Expr.relative[\" \"],\n\t\ti = leadingRelative ? 1 : 0,\n\n\t\t// The foundational matcher ensures that elements are reachable from top-level context(s)\n\t\tmatchContext = addCombinator( function( elem ) {\n\t\t\treturn elem === checkContext;\n\t\t}, implicitRelative, true ),\n\t\tmatchAnyContext = addCombinator( function( elem ) {\n\t\t\treturn indexOf.call( checkContext, elem ) > -1;\n\t\t}, implicitRelative, true ),\n\t\tmatchers = [ function( elem, context, xml ) {\n\t\t\treturn ( !leadingRelative && ( xml || context !== outermostContext ) ) || (\n\t\t\t\t(checkContext = context).nodeType ?\n\t\t\t\t\tmatchContext( elem, context, xml ) :\n\t\t\t\t\tmatchAnyContext( elem, context, xml ) );\n\t\t} ];\n\n\tfor ( ; i < len; i++ ) {\n\t\tif ( (matcher = Expr.relative[ tokens[i].type ]) ) {\n\t\t\tmatchers = [ addCombinator(elementMatcher( matchers ), matcher) ];\n\t\t} else {\n\t\t\tmatcher = Expr.filter[ tokens[i].type ].apply( null, tokens[i].matches );\n\n\t\t\t// Return special upon seeing a positional matcher\n\t\t\tif ( matcher[ expando ] ) {\n\t\t\t\t// Find the next relative operator (if any) for proper handling\n\t\t\t\tj = ++i;\n\t\t\t\tfor ( ; j < len; j++ ) {\n\t\t\t\t\tif ( Expr.relative[ tokens[j].type ] ) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn setMatcher(\n\t\t\t\t\ti > 1 && elementMatcher( matchers ),\n\t\t\t\t\ti > 1 && toSelector(\n\t\t\t\t\t\t// If the preceding token was a descendant combinator, insert an implicit any-element `*`\n\t\t\t\t\t\ttokens.slice( 0, i - 1 ).concat({ value: tokens[ i - 2 ].type === \" \" ? \"*\" : \"\" })\n\t\t\t\t\t).replace( rtrim, \"$1\" ),\n\t\t\t\t\tmatcher,\n\t\t\t\t\ti < j && matcherFromTokens( tokens.slice( i, j ) ),\n\t\t\t\t\tj < len && matcherFromTokens( (tokens = tokens.slice( j )) ),\n\t\t\t\t\tj < len && toSelector( tokens )\n\t\t\t\t);\n\t\t\t}\n\t\t\tmatchers.push( matcher );\n\t\t}\n\t}\n\n\treturn elementMatcher( matchers );\n}\n\nfunction matcherFromGroupMatchers( elementMatchers, setMatchers ) {\n\t// A counter to specify which element is currently being matched\n\tvar matcherCachedRuns = 0,\n\t\tbySet = setMatchers.length > 0,\n\t\tbyElement = elementMatchers.length > 0,\n\t\tsuperMatcher = function( seed, context, xml, results, expandContext ) {\n\t\t\tvar elem, j, matcher,\n\t\t\t\tsetMatched = [],\n\t\t\t\tmatchedCount = 0,\n\t\t\t\ti = \"0\",\n\t\t\t\tunmatched = seed && [],\n\t\t\t\toutermost = expandContext != null,\n\t\t\t\tcontextBackup = outermostContext,\n\t\t\t\t// We must always have either seed elements or context\n\t\t\t\telems = seed || byElement && Expr.find[\"TAG\"]( \"*\", expandContext && context.parentNode || context ),\n\t\t\t\t// Use integer dirruns iff this is the outermost matcher\n\t\t\t\tdirrunsUnique = (dirruns += contextBackup == null ? 1 : Math.random() || 0.1);\n\n\t\t\tif ( outermost ) {\n\t\t\t\toutermostContext = context !== document && context;\n\t\t\t\tcachedruns = matcherCachedRuns;\n\t\t\t}\n\n\t\t\t// Add elements passing elementMatchers directly to results\n\t\t\t// Keep `i` a string if there are no elements so `matchedCount` will be \"00\" below\n\t\t\tfor ( ; (elem = elems[i]) != null; i++ ) {\n\t\t\t\tif ( byElement && elem ) {\n\t\t\t\t\tj = 0;\n\t\t\t\t\twhile ( (matcher = elementMatchers[j++]) ) {\n\t\t\t\t\t\tif ( matcher( elem, context, xml ) ) {\n\t\t\t\t\t\t\tresults.push( elem );\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif ( outermost ) {\n\t\t\t\t\t\tdirruns = dirrunsUnique;\n\t\t\t\t\t\tcachedruns = ++matcherCachedRuns;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Track unmatched elements for set filters\n\t\t\t\tif ( bySet ) {\n\t\t\t\t\t// They will have gone through all possible matchers\n\t\t\t\t\tif ( (elem = !matcher && elem) ) {\n\t\t\t\t\t\tmatchedCount--;\n\t\t\t\t\t}\n\n\t\t\t\t\t// Lengthen the array for every element, matched or not\n\t\t\t\t\tif ( seed ) {\n\t\t\t\t\t\tunmatched.push( elem );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Apply set filters to unmatched elements\n\t\t\tmatchedCount += i;\n\t\t\tif ( bySet && i !== matchedCount ) {\n\t\t\t\tj = 0;\n\t\t\t\twhile ( (matcher = setMatchers[j++]) ) {\n\t\t\t\t\tmatcher( unmatched, setMatched, context, xml );\n\t\t\t\t}\n\n\t\t\t\tif ( seed ) {\n\t\t\t\t\t// Reintegrate element matches to eliminate the need for sorting\n\t\t\t\t\tif ( matchedCount > 0 ) {\n\t\t\t\t\t\twhile ( i-- ) {\n\t\t\t\t\t\t\tif ( !(unmatched[i] || setMatched[i]) ) {\n\t\t\t\t\t\t\t\tsetMatched[i] = pop.call( results );\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\t// Discard index placeholder values to get only actual matches\n\t\t\t\t\tsetMatched = condense( setMatched );\n\t\t\t\t}\n\n\t\t\t\t// Add matches to results\n\t\t\t\tpush.apply( results, setMatched );\n\n\t\t\t\t// Seedless set matches succeeding multiple successful matchers stipulate sorting\n\t\t\t\tif ( outermost && !seed && setMatched.length > 0 &&\n\t\t\t\t\t( matchedCount + setMatchers.length ) > 1 ) {\n\n\t\t\t\t\tSizzle.uniqueSort( results );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Override manipulation of globals by nested matchers\n\t\t\tif ( outermost ) {\n\t\t\t\tdirruns = dirrunsUnique;\n\t\t\t\toutermostContext = contextBackup;\n\t\t\t}\n\n\t\t\treturn unmatched;\n\t\t};\n\n\treturn bySet ?\n\t\tmarkFunction( superMatcher ) :\n\t\tsuperMatcher;\n}\n\ncompile = Sizzle.compile = function( selector, group /* Internal Use Only */ ) {\n\tvar i,\n\t\tsetMatchers = [],\n\t\telementMatchers = [],\n\t\tcached = compilerCache[ selector + \" \" ];\n\n\tif ( !cached ) {\n\t\t// Generate a function of recursive functions that can be used to check each element\n\t\tif ( !group ) {\n\t\t\tgroup = tokenize( selector );\n\t\t}\n\t\ti = group.length;\n\t\twhile ( i-- ) {\n\t\t\tcached = matcherFromTokens( group[i] );\n\t\t\tif ( cached[ expando ] ) {\n\t\t\t\tsetMatchers.push( cached );\n\t\t\t} else {\n\t\t\t\telementMatchers.push( cached );\n\t\t\t}\n\t\t}\n\n\t\t// Cache the compiled function\n\t\tcached = compilerCache( selector, matcherFromGroupMatchers( elementMatchers, setMatchers ) );\n\t}\n\treturn cached;\n};\n\nfunction multipleContexts( selector, contexts, results ) {\n\tvar i = 0,\n\t\tlen = contexts.length;\n\tfor ( ; i < len; i++ ) {\n\t\tSizzle( selector, contexts[i], results );\n\t}\n\treturn results;\n}\n\nfunction select( selector, context, results, seed ) {\n\tvar i, tokens, token, type, find,\n\t\tmatch = tokenize( selector );\n\n\tif ( !seed ) {\n\t\t// Try to minimize operations if there is only one group\n\t\tif ( match.length === 1 ) {\n\n\t\t\t// Take a shortcut and set the context if the root selector is an ID\n\t\t\ttokens = match[0] = match[0].slice( 0 );\n\t\t\tif ( tokens.length > 2 && (token = tokens[0]).type === \"ID\" &&\n\t\t\t\t\tsupport.getById && context.nodeType === 9 && documentIsHTML &&\n\t\t\t\t\tExpr.relative[ tokens[1].type ] ) {\n\n\t\t\t\tcontext = ( Expr.find[\"ID\"]( token.matches[0].replace(runescape, funescape), context ) || [] )[0];\n\t\t\t\tif ( !context ) {\n\t\t\t\t\treturn results;\n\t\t\t\t}\n\t\t\t\tselector = selector.slice( tokens.shift().value.length );\n\t\t\t}\n\n\t\t\t// Fetch a seed set for right-to-left matching\n\t\t\ti = matchExpr[\"needsContext\"].test( selector ) ? 0 : tokens.length;\n\t\t\twhile ( i-- ) {\n\t\t\t\ttoken = tokens[i];\n\n\t\t\t\t// Abort if we hit a combinator\n\t\t\t\tif ( Expr.relative[ (type = token.type) ] ) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif ( (find = Expr.find[ type ]) ) {\n\t\t\t\t\t// Search, expanding context for leading sibling combinators\n\t\t\t\t\tif ( (seed = find(\n\t\t\t\t\t\ttoken.matches[0].replace( runescape, funescape ),\n\t\t\t\t\t\trsibling.test( tokens[0].type ) && context.parentNode || context\n\t\t\t\t\t)) ) {\n\n\t\t\t\t\t\t// If seed is empty or no tokens remain, we can return early\n\t\t\t\t\t\ttokens.splice( i, 1 );\n\t\t\t\t\t\tselector = seed.length && toSelector( tokens );\n\t\t\t\t\t\tif ( !selector ) {\n\t\t\t\t\t\t\tpush.apply( results, seed );\n\t\t\t\t\t\t\treturn results;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t// Compile and execute a filtering function\n\t// Provide `match` to avoid retokenization if we modified the selector above\n\tcompile( selector, match )(\n\t\tseed,\n\t\tcontext,\n\t\t!documentIsHTML,\n\t\tresults,\n\t\trsibling.test( selector )\n\t);\n\treturn results;\n}\n\n// One-time assignments\n\n// Sort stability\nsupport.sortStable = expando.split(\"\").sort( sortOrder ).join(\"\") === expando;\n\n// Support: Chrome<14\n// Always assume duplicates if they aren't passed to the comparison function\nsupport.detectDuplicates = hasDuplicate;\n\n// Initialize against the default document\nsetDocument();\n\n// Support: Webkit<537.32 - Safari 6.0.3/Chrome 25 (fixed in Chrome 27)\n// Detached nodes confoundingly follow *each other*\nsupport.sortDetached = assert(function( div1 ) {\n\t// Should return 1, but returns 4 (following)\n\treturn div1.compareDocumentPosition( document.createElement(\"div\") ) & 1;\n});\n\n// Support: IE<8\n// Prevent attribute/property \"interpolation\"\n// http://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx\nif ( !assert(function( div ) {\n\tdiv.innerHTML = \"<a href='#'></a>\";\n\treturn div.firstChild.getAttribute(\"href\") === \"#\" ;\n}) ) {\n\taddHandle( \"type|href|height|width\", function( elem, name, isXML ) {\n\t\tif ( !isXML ) {\n\t\t\treturn elem.getAttribute( name, name.toLowerCase() === \"type\" ? 1 : 2 );\n\t\t}\n\t});\n}\n\n// Support: IE<9\n// Use defaultValue in place of getAttribute(\"value\")\nif ( !support.attributes || !assert(function( div ) {\n\tdiv.innerHTML = \"<input/>\";\n\tdiv.firstChild.setAttribute( \"value\", \"\" );\n\treturn div.firstChild.getAttribute( \"value\" ) === \"\";\n}) ) {\n\taddHandle( \"value\", function( elem, name, isXML ) {\n\t\tif ( !isXML && elem.nodeName.toLowerCase() === \"input\" ) {\n\t\t\treturn elem.defaultValue;\n\t\t}\n\t});\n}\n\n// Support: IE<9\n// Use getAttributeNode to fetch booleans when getAttribute lies\nif ( !assert(function( div ) {\n\treturn div.getAttribute(\"disabled\") == null;\n}) ) {\n\taddHandle( booleans, function( elem, name, isXML ) {\n\t\tvar val;\n\t\tif ( !isXML ) {\n\t\t\treturn (val = elem.getAttributeNode( name )) && val.specified ?\n\t\t\t\tval.value :\n\t\t\t\telem[ name ] === true ? name.toLowerCase() : null;\n\t\t}\n\t});\n}\n\njQuery.find = Sizzle;\njQuery.expr = Sizzle.selectors;\njQuery.expr[\":\"] = jQuery.expr.pseudos;\njQuery.unique = Sizzle.uniqueSort;\njQuery.text = Sizzle.getText;\njQuery.isXMLDoc = Sizzle.isXML;\njQuery.contains = Sizzle.contains;\n\n\n})( window );\n// String to Object options format cache\nvar optionsCache = {};\n\n// Convert String-formatted options into Object-formatted ones and store in cache\nfunction createOptions( options ) {\n\tvar object = optionsCache[ options ] = {};\n\tjQuery.each( options.match( core_rnotwhite ) || [], function( _, flag ) {\n\t\tobject[ flag ] = true;\n\t});\n\treturn object;\n}\n\n/*\n * Create a callback list using the following parameters:\n *\n *\toptions: an optional list of space-separated options that will change how\n *\t\t\tthe callback list behaves or a more traditional option object\n *\n * By default a callback list will act like an event callback list and can be\n * \"fired\" multiple times.\n *\n * Possible options:\n *\n *\tonce:\t\t\twill ensure the callback list can only be fired once (like a Deferred)\n *\n *\tmemory:\t\t\twill keep track of previous values and will call any callback added\n *\t\t\t\t\tafter the list has been fired right away with the latest \"memorized\"\n *\t\t\t\t\tvalues (like a Deferred)\n *\n *\tunique:\t\t\twill ensure a callback can only be added once (no duplicate in the list)\n *\n *\tstopOnFalse:\tinterrupt callings when a callback returns false\n *\n */\njQuery.Callbacks = function( options ) {\n\n\t// Convert options from String-formatted to Object-formatted if needed\n\t// (we check in cache first)\n\toptions = typeof options === \"string\" ?\n\t\t( optionsCache[ options ] || createOptions( options ) ) :\n\t\tjQuery.extend( {}, options );\n\n\tvar // Last fire value (for non-forgettable lists)\n\t\tmemory,\n\t\t// Flag to know if list was already fired\n\t\tfired,\n\t\t// Flag to know if list is currently firing\n\t\tfiring,\n\t\t// First callback to fire (used internally by add and fireWith)\n\t\tfiringStart,\n\t\t// End of the loop when firing\n\t\tfiringLength,\n\t\t// Index of currently firing callback (modified by remove if needed)\n\t\tfiringIndex,\n\t\t// Actual callback list\n\t\tlist = [],\n\t\t// Stack of fire calls for repeatable lists\n\t\tstack = !options.once && [],\n\t\t// Fire callbacks\n\t\tfire = function( data ) {\n\t\t\tmemory = options.memory && data;\n\t\t\tfired = true;\n\t\t\tfiringIndex = firingStart || 0;\n\t\t\tfiringStart = 0;\n\t\t\tfiringLength = list.length;\n\t\t\tfiring = true;\n\t\t\tfor ( ; list && firingIndex < firingLength; firingIndex++ ) {\n\t\t\t\tif ( list[ firingIndex ].apply( data[ 0 ], data[ 1 ] ) === false && options.stopOnFalse ) {\n\t\t\t\t\tmemory = false; // To prevent further calls using add\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tfiring = false;\n\t\t\tif ( list ) {\n\t\t\t\tif ( stack ) {\n\t\t\t\t\tif ( stack.length ) {\n\t\t\t\t\t\tfire( stack.shift() );\n\t\t\t\t\t}\n\t\t\t\t} else if ( memory ) {\n\t\t\t\t\tlist = [];\n\t\t\t\t} else {\n\t\t\t\t\tself.disable();\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t// Actual Callbacks object\n\t\tself = {\n\t\t\t// Add a callback or a collection of callbacks to the list\n\t\t\tadd: function() {\n\t\t\t\tif ( list ) {\n\t\t\t\t\t// First, we save the current length\n\t\t\t\t\tvar start = list.length;\n\t\t\t\t\t(function add( args ) {\n\t\t\t\t\t\tjQuery.each( args, function( _, arg ) {\n\t\t\t\t\t\t\tvar type = jQuery.type( arg );\n\t\t\t\t\t\t\tif ( type === \"function\" ) {\n\t\t\t\t\t\t\t\tif ( !options.unique || !self.has( arg ) ) {\n\t\t\t\t\t\t\t\t\tlist.push( arg );\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} else if ( arg && arg.length && type !== \"string\" ) {\n\t\t\t\t\t\t\t\t// Inspect recursively\n\t\t\t\t\t\t\t\tadd( arg );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\t\t\t\t\t})( arguments );\n\t\t\t\t\t// Do we need to add the callbacks to the\n\t\t\t\t\t// current firing batch?\n\t\t\t\t\tif ( firing ) {\n\t\t\t\t\t\tfiringLength = list.length;\n\t\t\t\t\t// With memory, if we're not firing then\n\t\t\t\t\t// we should call right away\n\t\t\t\t\t} else if ( memory ) {\n\t\t\t\t\t\tfiringStart = start;\n\t\t\t\t\t\tfire( memory );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn this;\n\t\t\t},\n\t\t\t// Remove a callback from the list\n\t\t\tremove: function() {\n\t\t\t\tif ( list ) {\n\t\t\t\t\tjQuery.each( arguments, function( _, arg ) {\n\t\t\t\t\t\tvar index;\n\t\t\t\t\t\twhile( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) {\n\t\t\t\t\t\t\tlist.splice( index, 1 );\n\t\t\t\t\t\t\t// Handle firing indexes\n\t\t\t\t\t\t\tif ( firing ) {\n\t\t\t\t\t\t\t\tif ( index <= firingLength ) {\n\t\t\t\t\t\t\t\t\tfiringLength--;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif ( index <= firingIndex ) {\n\t\t\t\t\t\t\t\t\tfiringIndex--;\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});\n\t\t\t\t}\n\t\t\t\treturn this;\n\t\t\t},\n\t\t\t// Check if a given callback is in the list.\n\t\t\t// If no argument is given, return whether or not list has callbacks attached.\n\t\t\thas: function( fn ) {\n\t\t\t\treturn fn ? jQuery.inArray( fn, list ) > -1 : !!( list && list.length );\n\t\t\t},\n\t\t\t// Remove all callbacks from the list\n\t\t\tempty: function() {\n\t\t\t\tlist = [];\n\t\t\t\tfiringLength = 0;\n\t\t\t\treturn this;\n\t\t\t},\n\t\t\t// Have the list do nothing anymore\n\t\t\tdisable: function() {\n\t\t\t\tlist = stack = memory = undefined;\n\t\t\t\treturn this;\n\t\t\t},\n\t\t\t// Is it disabled?\n\t\t\tdisabled: function() {\n\t\t\t\treturn !list;\n\t\t\t},\n\t\t\t// Lock the list in its current state\n\t\t\tlock: function() {\n\t\t\t\tstack = undefined;\n\t\t\t\tif ( !memory ) {\n\t\t\t\t\tself.disable();\n\t\t\t\t}\n\t\t\t\treturn this;\n\t\t\t},\n\t\t\t// Is it locked?\n\t\t\tlocked: function() {\n\t\t\t\treturn !stack;\n\t\t\t},\n\t\t\t// Call all callbacks with the given context and arguments\n\t\t\tfireWith: function( context, args ) {\n\t\t\t\tif ( list && ( !fired || stack ) ) {\n\t\t\t\t\targs = args || [];\n\t\t\t\t\targs = [ context, args.slice ? args.slice() : args ];\n\t\t\t\t\tif ( firing ) {\n\t\t\t\t\t\tstack.push( args );\n\t\t\t\t\t} else {\n\t\t\t\t\t\tfire( args );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn this;\n\t\t\t},\n\t\t\t// Call all the callbacks with the given arguments\n\t\t\tfire: function() {\n\t\t\t\tself.fireWith( this, arguments );\n\t\t\t\treturn this;\n\t\t\t},\n\t\t\t// To know if the callbacks have already been called at least once\n\t\t\tfired: function() {\n\t\t\t\treturn !!fired;\n\t\t\t}\n\t\t};\n\n\treturn self;\n};\njQuery.extend({\n\n\tDeferred: function( func ) {\n\t\tvar tuples = [\n\t\t\t\t// action, add listener, listener list, final state\n\t\t\t\t[ \"resolve\", \"done\", jQuery.Callbacks(\"once memory\"), \"resolved\" ],\n\t\t\t\t[ \"reject\", \"fail\", jQuery.Callbacks(\"once memory\"), \"rejected\" ],\n\t\t\t\t[ \"notify\", \"progress\", jQuery.Callbacks(\"memory\") ]\n\t\t\t],\n\t\t\tstate = \"pending\",\n\t\t\tpromise = {\n\t\t\t\tstate: function() {\n\t\t\t\t\treturn state;\n\t\t\t\t},\n\t\t\t\talways: function() {\n\t\t\t\t\tdeferred.done( arguments ).fail( arguments );\n\t\t\t\t\treturn this;\n\t\t\t\t},\n\t\t\t\tthen: function( /* fnDone, fnFail, fnProgress */ ) {\n\t\t\t\t\tvar fns = arguments;\n\t\t\t\t\treturn jQuery.Deferred(function( newDefer ) {\n\t\t\t\t\t\tjQuery.each( tuples, function( i, tuple ) {\n\t\t\t\t\t\t\tvar action = tuple[ 0 ],\n\t\t\t\t\t\t\t\tfn = jQuery.isFunction( fns[ i ] ) && fns[ i ];\n\t\t\t\t\t\t\t// deferred[ done | fail | progress ] for forwarding actions to newDefer\n\t\t\t\t\t\t\tdeferred[ tuple[1] ](function() {\n\t\t\t\t\t\t\t\tvar returned = fn && fn.apply( this, arguments );\n\t\t\t\t\t\t\t\tif ( returned && jQuery.isFunction( returned.promise ) ) {\n\t\t\t\t\t\t\t\t\treturned.promise()\n\t\t\t\t\t\t\t\t\t\t.done( newDefer.resolve )\n\t\t\t\t\t\t\t\t\t\t.fail( newDefer.reject )\n\t\t\t\t\t\t\t\t\t\t.progress( newDefer.notify );\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tnewDefer[ action + \"With\" ]( this === promise ? newDefer.promise() : this, fn ? [ returned ] : arguments );\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\tfns = null;\n\t\t\t\t\t}).promise();\n\t\t\t\t},\n\t\t\t\t// Get a promise for this deferred\n\t\t\t\t// If obj is provided, the promise aspect is added to the object\n\t\t\t\tpromise: function( obj ) {\n\t\t\t\t\treturn obj != null ? jQuery.extend( obj, promise ) : promise;\n\t\t\t\t}\n\t\t\t},\n\t\t\tdeferred = {};\n\n\t\t// Keep pipe for back-compat\n\t\tpromise.pipe = promise.then;\n\n\t\t// Add list-specific methods\n\t\tjQuery.each( tuples, function( i, tuple ) {\n\t\t\tvar list = tuple[ 2 ],\n\t\t\t\tstateString = tuple[ 3 ];\n\n\t\t\t// promise[ done | fail | progress ] = list.add\n\t\t\tpromise[ tuple[1] ] = list.add;\n\n\t\t\t// Handle state\n\t\t\tif ( stateString ) {\n\t\t\t\tlist.add(function() {\n\t\t\t\t\t// state = [ resolved | rejected ]\n\t\t\t\t\tstate = stateString;\n\n\t\t\t\t// [ reject_list | resolve_list ].disable; progress_list.lock\n\t\t\t\t}, tuples[ i ^ 1 ][ 2 ].disable, tuples[ 2 ][ 2 ].lock );\n\t\t\t}\n\n\t\t\t// deferred[ resolve | reject | notify ]\n\t\t\tdeferred[ tuple[0] ] = function() {\n\t\t\t\tdeferred[ tuple[0] + \"With\" ]( this === deferred ? promise : this, arguments );\n\t\t\t\treturn this;\n\t\t\t};\n\t\t\tdeferred[ tuple[0] + \"With\" ] = list.fireWith;\n\t\t});\n\n\t\t// Make the deferred a promise\n\t\tpromise.promise( deferred );\n\n\t\t// Call given func if any\n\t\tif ( func ) {\n\t\t\tfunc.call( deferred, deferred );\n\t\t}\n\n\t\t// All done!\n\t\treturn deferred;\n\t},\n\n\t// Deferred helper\n\twhen: function( subordinate /* , ..., subordinateN */ ) {\n\t\tvar i = 0,\n\t\t\tresolveValues = core_slice.call( arguments ),\n\t\t\tlength = resolveValues.length,\n\n\t\t\t// the count of uncompleted subordinates\n\t\t\tremaining = length !== 1 || ( subordinate && jQuery.isFunction( subordinate.promise ) ) ? length : 0,\n\n\t\t\t// the master Deferred. If resolveValues consist of only a single Deferred, just use that.\n\t\t\tdeferred = remaining === 1 ? subordinate : jQuery.Deferred(),\n\n\t\t\t// Update function for both resolve and progress values\n\t\t\tupdateFunc = function( i, contexts, values ) {\n\t\t\t\treturn function( value ) {\n\t\t\t\t\tcontexts[ i ] = this;\n\t\t\t\t\tvalues[ i ] = arguments.length > 1 ? core_slice.call( arguments ) : value;\n\t\t\t\t\tif( values === progressValues ) {\n\t\t\t\t\t\tdeferred.notifyWith( contexts, values );\n\t\t\t\t\t} else if ( !( --remaining ) ) {\n\t\t\t\t\t\tdeferred.resolveWith( contexts, values );\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t},\n\n\t\t\tprogressValues, progressContexts, resolveContexts;\n\n\t\t// add listeners to Deferred subordinates; treat others as resolved\n\t\tif ( length > 1 ) {\n\t\t\tprogressValues = new Array( length );\n\t\t\tprogressContexts = new Array( length );\n\t\t\tresolveContexts = new Array( length );\n\t\t\tfor ( ; i < length; i++ ) {\n\t\t\t\tif ( resolveValues[ i ] && jQuery.isFunction( resolveValues[ i ].promise ) ) {\n\t\t\t\t\tresolveValues[ i ].promise()\n\t\t\t\t\t\t.done( updateFunc( i, resolveContexts, resolveValues ) )\n\t\t\t\t\t\t.fail( deferred.reject )\n\t\t\t\t\t\t.progress( updateFunc( i, progressContexts, progressValues ) );\n\t\t\t\t} else {\n\t\t\t\t\t--remaining;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// if we're not waiting on anything, resolve the master\n\t\tif ( !remaining ) {\n\t\t\tdeferred.resolveWith( resolveContexts, resolveValues );\n\t\t}\n\n\t\treturn deferred.promise();\n\t}\n});\njQuery.support = (function( support ) {\n\tvar input = document.createElement(\"input\"),\n\t\tfragment = document.createDocumentFragment(),\n\t\tdiv = document.createElement(\"div\"),\n\t\tselect = document.createElement(\"select\"),\n\t\topt = select.appendChild( document.createElement(\"option\") );\n\n\t// Finish early in limited environments\n\tif ( !input.type ) {\n\t\treturn support;\n\t}\n\n\tinput.type = \"checkbox\";\n\n\t// Support: Safari 5.1, iOS 5.1, Android 4.x, Android 2.3\n\t// Check the default checkbox/radio value (\"\" on old WebKit; \"on\" elsewhere)\n\tsupport.checkOn = input.value !== \"\";\n\n\t// Must access the parent to make an option select properly\n\t// Support: IE9, IE10\n\tsupport.optSelected = opt.selected;\n\n\t// Will be defined later\n\tsupport.reliableMarginRight = true;\n\tsupport.boxSizingReliable = true;\n\tsupport.pixelPosition = false;\n\n\t// Make sure checked status is properly cloned\n\t// Support: IE9, IE10\n\tinput.checked = true;\n\tsupport.noCloneChecked = input.cloneNode( true ).checked;\n\n\t// Make sure that the options inside disabled selects aren't marked as disabled\n\t// (WebKit marks them as disabled)\n\tselect.disabled = true;\n\tsupport.optDisabled = !opt.disabled;\n\n\t// Check if an input maintains its value after becoming a radio\n\t// Support: IE9, IE10\n\tinput = document.createElement(\"input\");\n\tinput.value = \"t\";\n\tinput.type = \"radio\";\n\tsupport.radioValue = input.value === \"t\";\n\n\t// #11217 - WebKit loses check when the name is after the checked attribute\n\tinput.setAttribute( \"checked\", \"t\" );\n\tinput.setAttribute( \"name\", \"t\" );\n\n\tfragment.appendChild( input );\n\n\t// Support: Safari 5.1, Android 4.x, Android 2.3\n\t// old WebKit doesn't clone checked state correctly in fragments\n\tsupport.checkClone = fragment.cloneNode( true ).cloneNode( true ).lastChild.checked;\n\n\t// Support: Firefox, Chrome, Safari\n\t// Beware of CSP restrictions (https://developer.mozilla.org/en/Security/CSP)\n\tsupport.focusinBubbles = \"onfocusin\" in window;\n\n\tdiv.style.backgroundClip = \"content-box\";\n\tdiv.cloneNode( true ).style.backgroundClip = \"\";\n\tsupport.clearCloneStyle = div.style.backgroundClip === \"content-box\";\n\n\t// Run tests that need a body at doc ready\n\tjQuery(function() {\n\t\tvar container, marginDiv,\n\t\t\t// Support: Firefox, Android 2.3 (Prefixed box-sizing versions).\n\t\t\tdivReset = \"padding:0;margin:0;border:0;display:block;-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box\",\n\t\t\tbody = document.getElementsByTagName(\"body\")[ 0 ];\n\n\t\tif ( !body ) {\n\t\t\t// Return for frameset docs that don't have a body\n\t\t\treturn;\n\t\t}\n\n\t\tcontainer = document.createElement(\"div\");\n\t\tcontainer.style.cssText = \"border:0;width:0;height:0;position:absolute;top:0;left:-9999px;margin-top:1px\";\n\n\t\t// Check box-sizing and margin behavior.\n\t\tbody.appendChild( container ).appendChild( div );\n\t\tdiv.innerHTML = \"\";\n\t\t// Support: Firefox, Android 2.3 (Prefixed box-sizing versions).\n\t\tdiv.style.cssText = \"-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%\";\n\n\t\t// Workaround failing boxSizing test due to offsetWidth returning wrong value\n\t\t// with some non-1 values of body zoom, ticket #13543\n\t\tjQuery.swap( body, body.style.zoom != null ? { zoom: 1 } : {}, function() {\n\t\t\tsupport.boxSizing = div.offsetWidth === 4;\n\t\t});\n\n\t\t// Use window.getComputedStyle because jsdom on node.js will break without it.\n\t\tif ( window.getComputedStyle ) {\n\t\t\tsupport.pixelPosition = ( window.getComputedStyle( div, null ) || {} ).top !== \"1%\";\n\t\t\tsupport.boxSizingReliable = ( window.getComputedStyle( div, null ) || { width: \"4px\" } ).width === \"4px\";\n\n\t\t\t// Support: Android 2.3\n\t\t\t// Check if div with explicit width and no margin-right incorrectly\n\t\t\t// gets computed margin-right based on width of container. (#3333)\n\t\t\t// WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right\n\t\t\tmarginDiv = div.appendChild( document.createElement(\"div\") );\n\t\t\tmarginDiv.style.cssText = div.style.cssText = divReset;\n\t\t\tmarginDiv.style.marginRight = marginDiv.style.width = \"0\";\n\t\t\tdiv.style.width = \"1px\";\n\n\t\t\tsupport.reliableMarginRight =\n\t\t\t\t!parseFloat( ( window.getComputedStyle( marginDiv, null ) || {} ).marginRight );\n\t\t}\n\n\t\tbody.removeChild( container );\n\t});\n\n\treturn support;\n})( {} );\n\n/*\n\tImplementation Summary\n\n\t1. Enforce API surface and semantic compatibility with 1.9.x branch\n\t2. Improve the module's maintainability by reducing the storage\n\t\tpaths to a single mechanism.\n\t3. Use the same single mechanism to support \"private\" and \"user\" data.\n\t4. _Never_ expose \"private\" data to user code (TODO: Drop _data, _removeData)\n\t5. Avoid exposing implementation details on user objects (eg. expando properties)\n\t6. Provide a clear path for implementation upgrade to WeakMap in 2014\n*/\nvar data_user, data_priv,\n\trbrace = /(?:\\{[\\s\\S]*\\}|\\[[\\s\\S]*\\])$/,\n\trmultiDash = /([A-Z])/g;\n\nfunction Data() {\n\t// Support: Android < 4,\n\t// Old WebKit does not have Object.preventExtensions/freeze method,\n\t// return new empty object instead with no [[set]] accessor\n\tObject.defineProperty( this.cache = {}, 0, {\n\t\tget: function() {\n\t\t\treturn {};\n\t\t}\n\t});\n\n\tthis.expando = jQuery.expando + Math.random();\n}\n\nData.uid = 1;\n\nData.accepts = function( owner ) {\n\t// Accepts only:\n\t// - Node\n\t// - Node.ELEMENT_NODE\n\t// - Node.DOCUMENT_NODE\n\t// - Object\n\t// - Any\n\treturn owner.nodeType ?\n\t\towner.nodeType === 1 || owner.nodeType === 9 : true;\n};\n\nData.prototype = {\n\tkey: function( owner ) {\n\t\t// We can accept data for non-element nodes in modern browsers,\n\t\t// but we should not, see #8335.\n\t\t// Always return the key for a frozen object.\n\t\tif ( !Data.accepts( owner ) ) {\n\t\t\treturn 0;\n\t\t}\n\n\t\tvar descriptor = {},\n\t\t\t// Check if the owner object already has a cache key\n\t\t\tunlock = owner[ this.expando ];\n\n\t\t// If not, create one\n\t\tif ( !unlock ) {\n\t\t\tunlock = Data.uid++;\n\n\t\t\t// Secure it in a non-enumerable, non-writable property\n\t\t\ttry {\n\t\t\t\tdescriptor[ this.expando ] = { value: unlock };\n\t\t\t\tObject.defineProperties( owner, descriptor );\n\n\t\t\t// Support: Android < 4\n\t\t\t// Fallback to a less secure definition\n\t\t\t} catch ( e ) {\n\t\t\t\tdescriptor[ this.expando ] = unlock;\n\t\t\t\tjQuery.extend( owner, descriptor );\n\t\t\t}\n\t\t}\n\n\t\t// Ensure the cache object\n\t\tif ( !this.cache[ unlock ] ) {\n\t\t\tthis.cache[ unlock ] = {};\n\t\t}\n\n\t\treturn unlock;\n\t},\n\tset: function( owner, data, value ) {\n\t\tvar prop,\n\t\t\t// There may be an unlock assigned to this node,\n\t\t\t// if there is no entry for this \"owner\", create one inline\n\t\t\t// and set the unlock as though an owner entry had always existed\n\t\t\tunlock = this.key( owner ),\n\t\t\tcache = this.cache[ unlock ];\n\n\t\t// Handle: [ owner, key, value ] args\n\t\tif ( typeof data === \"string\" ) {\n\t\t\tcache[ data ] = value;\n\n\t\t// Handle: [ owner, { properties } ] args\n\t\t} else {\n\t\t\t// Fresh assignments by object are shallow copied\n\t\t\tif ( jQuery.isEmptyObject( cache ) ) {\n\t\t\t\tjQuery.extend( this.cache[ unlock ], data );\n\t\t\t// Otherwise, copy the properties one-by-one to the cache object\n\t\t\t} else {\n\t\t\t\tfor ( prop in data ) {\n\t\t\t\t\tcache[ prop ] = data[ prop ];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn cache;\n\t},\n\tget: function( owner, key ) {\n\t\t// Either a valid cache is found, or will be created.\n\t\t// New caches will be created and the unlock returned,\n\t\t// allowing direct access to the newly created\n\t\t// empty data object. A valid owner object must be provided.\n\t\tvar cache = this.cache[ this.key( owner ) ];\n\n\t\treturn key === undefined ?\n\t\t\tcache : cache[ key ];\n\t},\n\taccess: function( owner, key, value ) {\n\t\tvar stored;\n\t\t// In cases where either:\n\t\t//\n\t\t// 1. No key was specified\n\t\t// 2. A string key was specified, but no value provided\n\t\t//\n\t\t// Take the \"read\" path and allow the get method to determine\n\t\t// which value to return, respectively either:\n\t\t//\n\t\t// 1. The entire cache object\n\t\t// 2. The data stored at the key\n\t\t//\n\t\tif ( key === undefined ||\n\t\t\t\t((key && typeof key === \"string\") && value === undefined) ) {\n\n\t\t\tstored = this.get( owner, key );\n\n\t\t\treturn stored !== undefined ?\n\t\t\t\tstored : this.get( owner, jQuery.camelCase(key) );\n\t\t}\n\n\t\t// [*]When the key is not a string, or both a key and value\n\t\t// are specified, set or extend (existing objects) with either:\n\t\t//\n\t\t// 1. An object of properties\n\t\t// 2. A key and value\n\t\t//\n\t\tthis.set( owner, key, value );\n\n\t\t// Since the \"set\" path can have two possible entry points\n\t\t// return the expected data based on which path was taken[*]\n\t\treturn value !== undefined ? value : key;\n\t},\n\tremove: function( owner, key ) {\n\t\tvar i, name, camel,\n\t\t\tunlock = this.key( owner ),\n\t\t\tcache = this.cache[ unlock ];\n\n\t\tif ( key === undefined ) {\n\t\t\tthis.cache[ unlock ] = {};\n\n\t\t} else {\n\t\t\t// Support array or space separated string of keys\n\t\t\tif ( jQuery.isArray( key ) ) {\n\t\t\t\t// If \"name\" is an array of keys...\n\t\t\t\t// When data is initially created, via (\"key\", \"val\") signature,\n\t\t\t\t// keys will be converted to camelCase.\n\t\t\t\t// Since there is no way to tell _how_ a key was added, remove\n\t\t\t\t// both plain key and camelCase key. #12786\n\t\t\t\t// This will only penalize the array argument path.\n\t\t\t\tname = key.concat( key.map( jQuery.camelCase ) );\n\t\t\t} else {\n\t\t\t\tcamel = jQuery.camelCase( key );\n\t\t\t\t// Try the string as a key before any manipulation\n\t\t\t\tif ( key in cache ) {\n\t\t\t\t\tname = [ key, camel ];\n\t\t\t\t} else {\n\t\t\t\t\t// If a key with the spaces exists, use it.\n\t\t\t\t\t// Otherwise, create an array by matching non-whitespace\n\t\t\t\t\tname = camel;\n\t\t\t\t\tname = name in cache ?\n\t\t\t\t\t\t[ name ] : ( name.match( core_rnotwhite ) || [] );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\ti = name.length;\n\t\t\twhile ( i-- ) {\n\t\t\t\tdelete cache[ name[ i ] ];\n\t\t\t}\n\t\t}\n\t},\n\thasData: function( owner ) {\n\t\treturn !jQuery.isEmptyObject(\n\t\t\tthis.cache[ owner[ this.expando ] ] || {}\n\t\t);\n\t},\n\tdiscard: function( owner ) {\n\t\tif ( owner[ this.expando ] ) {\n\t\t\tdelete this.cache[ owner[ this.expando ] ];\n\t\t}\n\t}\n};\n\n// These may be used throughout the jQuery core codebase\ndata_user = new Data();\ndata_priv = new Data();\n\n\njQuery.extend({\n\tacceptData: Data.accepts,\n\n\thasData: function( elem ) {\n\t\treturn data_user.hasData( elem ) || data_priv.hasData( elem );\n\t},\n\n\tdata: function( elem, name, data ) {\n\t\treturn data_user.access( elem, name, data );\n\t},\n\n\tremoveData: function( elem, name ) {\n\t\tdata_user.remove( elem, name );\n\t},\n\n\t// TODO: Now that all calls to _data and _removeData have been replaced\n\t// with direct calls to data_priv methods, these can be deprecated.\n\t_data: function( elem, name, data ) {\n\t\treturn data_priv.access( elem, name, data );\n\t},\n\n\t_removeData: function( elem, name ) {\n\t\tdata_priv.remove( elem, name );\n\t}\n});\n\njQuery.fn.extend({\n\tdata: function( key, value ) {\n\t\tvar attrs, name,\n\t\t\telem = this[ 0 ],\n\t\t\ti = 0,\n\t\t\tdata = null;\n\n\t\t// Gets all values\n\t\tif ( key === undefined ) {\n\t\t\tif ( this.length ) {\n\t\t\t\tdata = data_user.get( elem );\n\n\t\t\t\tif ( elem.nodeType === 1 && !data_priv.get( elem, \"hasDataAttrs\" ) ) {\n\t\t\t\t\tattrs = elem.attributes;\n\t\t\t\t\tfor ( ; i < attrs.length; i++ ) {\n\t\t\t\t\t\tname = attrs[ i ].name;\n\n\t\t\t\t\t\tif ( name.indexOf( \"data-\" ) === 0 ) {\n\t\t\t\t\t\t\tname = jQuery.camelCase( name.slice(5) );\n\t\t\t\t\t\t\tdataAttr( elem, name, data[ name ] );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tdata_priv.set( elem, \"hasDataAttrs\", true );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn data;\n\t\t}\n\n\t\t// Sets multiple values\n\t\tif ( typeof key === \"object\" ) {\n\t\t\treturn this.each(function() {\n\t\t\t\tdata_user.set( this, key );\n\t\t\t});\n\t\t}\n\n\t\treturn jQuery.access( this, function( value ) {\n\t\t\tvar data,\n\t\t\t\tcamelKey = jQuery.camelCase( key );\n\n\t\t\t// The calling jQuery object (element matches) is not empty\n\t\t\t// (and therefore has an element appears at this[ 0 ]) and the\n\t\t\t// `value` parameter was not undefined. An empty jQuery object\n\t\t\t// will result in `undefined` for elem = this[ 0 ] which will\n\t\t\t// throw an exception if an attempt to read a data cache is made.\n\t\t\tif ( elem && value === undefined ) {\n\t\t\t\t// Attempt to get data from the cache\n\t\t\t\t// with the key as-is\n\t\t\t\tdata = data_user.get( elem, key );\n\t\t\t\tif ( data !== undefined ) {\n\t\t\t\t\treturn data;\n\t\t\t\t}\n\n\t\t\t\t// Attempt to get data from the cache\n\t\t\t\t// with the key camelized\n\t\t\t\tdata = data_user.get( elem, camelKey );\n\t\t\t\tif ( data !== undefined ) {\n\t\t\t\t\treturn data;\n\t\t\t\t}\n\n\t\t\t\t// Attempt to \"discover\" the data in\n\t\t\t\t// HTML5 custom data-* attrs\n\t\t\t\tdata = dataAttr( elem, camelKey, undefined );\n\t\t\t\tif ( data !== undefined ) {\n\t\t\t\t\treturn data;\n\t\t\t\t}\n\n\t\t\t\t// We tried really hard, but the data doesn't exist.\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Set the data...\n\t\t\tthis.each(function() {\n\t\t\t\t// First, attempt to store a copy or reference of any\n\t\t\t\t// data that might've been store with a camelCased key.\n\t\t\t\tvar data = data_user.get( this, camelKey );\n\n\t\t\t\t// For HTML5 data-* attribute interop, we have to\n\t\t\t\t// store property names with dashes in a camelCase form.\n\t\t\t\t// This might not apply to all properties...*\n\t\t\t\tdata_user.set( this, camelKey, value );\n\n\t\t\t\t// *... In the case of properties that might _actually_\n\t\t\t\t// have dashes, we need to also store a copy of that\n\t\t\t\t// unchanged property.\n\t\t\t\tif ( key.indexOf(\"-\") !== -1 && data !== undefined ) {\n\t\t\t\t\tdata_user.set( this, key, value );\n\t\t\t\t}\n\t\t\t});\n\t\t}, null, value, arguments.length > 1, null, true );\n\t},\n\n\tremoveData: function( key ) {\n\t\treturn this.each(function() {\n\t\t\tdata_user.remove( this, key );\n\t\t});\n\t}\n});\n\nfunction dataAttr( elem, key, data ) {\n\tvar name;\n\n\t// If nothing was found internally, try to fetch any\n\t// data from the HTML5 data-* attribute\n\tif ( data === undefined && elem.nodeType === 1 ) {\n\t\tname = \"data-\" + key.replace( rmultiDash, \"-$1\" ).toLowerCase();\n\t\tdata = elem.getAttribute( name );\n\n\t\tif ( typeof data === \"string\" ) {\n\t\t\ttry {\n\t\t\t\tdata = data === \"true\" ? true :\n\t\t\t\t\tdata === \"false\" ? false :\n\t\t\t\t\tdata === \"null\" ? null :\n\t\t\t\t\t// Only convert to a number if it doesn't change the string\n\t\t\t\t\t+data + \"\" === data ? +data :\n\t\t\t\t\trbrace.test( data ) ? JSON.parse( data ) :\n\t\t\t\t\tdata;\n\t\t\t} catch( e ) {}\n\n\t\t\t// Make sure we set the data so it isn't changed later\n\t\t\tdata_user.set( elem, key, data );\n\t\t} else {\n\t\t\tdata = undefined;\n\t\t}\n\t}\n\treturn data;\n}\njQuery.extend({\n\tqueue: function( elem, type, data ) {\n\t\tvar queue;\n\n\t\tif ( elem ) {\n\t\t\ttype = ( type || \"fx\" ) + \"queue\";\n\t\t\tqueue = data_priv.get( elem, type );\n\n\t\t\t// Speed up dequeue by getting out quickly if this is just a lookup\n\t\t\tif ( data ) {\n\t\t\t\tif ( !queue || jQuery.isArray( data ) ) {\n\t\t\t\t\tqueue = data_priv.access( elem, type, jQuery.makeArray(data) );\n\t\t\t\t} else {\n\t\t\t\t\tqueue.push( data );\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn queue || [];\n\t\t}\n\t},\n\n\tdequeue: function( elem, type ) {\n\t\ttype = type || \"fx\";\n\n\t\tvar queue = jQuery.queue( elem, type ),\n\t\t\tstartLength = queue.length,\n\t\t\tfn = queue.shift(),\n\t\t\thooks = jQuery._queueHooks( elem, type ),\n\t\t\tnext = function() {\n\t\t\t\tjQuery.dequeue( elem, type );\n\t\t\t};\n\n\t\t// If the fx queue is dequeued, always remove the progress sentinel\n\t\tif ( fn === \"inprogress\" ) {\n\t\t\tfn = queue.shift();\n\t\t\tstartLength--;\n\t\t}\n\n\t\tif ( fn ) {\n\n\t\t\t// Add a progress sentinel to prevent the fx queue from being\n\t\t\t// automatically dequeued\n\t\t\tif ( type === \"fx\" ) {\n\t\t\t\tqueue.unshift( \"inprogress\" );\n\t\t\t}\n\n\t\t\t// clear up the last queue stop function\n\t\t\tdelete hooks.stop;\n\t\t\tfn.call( elem, next, hooks );\n\t\t}\n\n\t\tif ( !startLength && hooks ) {\n\t\t\thooks.empty.fire();\n\t\t}\n\t},\n\n\t// not intended for public consumption - generates a queueHooks object, or returns the current one\n\t_queueHooks: function( elem, type ) {\n\t\tvar key = type + \"queueHooks\";\n\t\treturn data_priv.get( elem, key ) || data_priv.access( elem, key, {\n\t\t\tempty: jQuery.Callbacks(\"once memory\").add(function() {\n\t\t\t\tdata_priv.remove( elem, [ type + \"queue\", key ] );\n\t\t\t})\n\t\t});\n\t}\n});\n\njQuery.fn.extend({\n\tqueue: function( type, data ) {\n\t\tvar setter = 2;\n\n\t\tif ( typeof type !== \"string\" ) {\n\t\t\tdata = type;\n\t\t\ttype = \"fx\";\n\t\t\tsetter--;\n\t\t}\n\n\t\tif ( arguments.length < setter ) {\n\t\t\treturn jQuery.queue( this[0], type );\n\t\t}\n\n\t\treturn data === undefined ?\n\t\t\tthis :\n\t\t\tthis.each(function() {\n\t\t\t\tvar queue = jQuery.queue( this, type, data );\n\n\t\t\t\t// ensure a hooks for this queue\n\t\t\t\tjQuery._queueHooks( this, type );\n\n\t\t\t\tif ( type === \"fx\" && queue[0] !== \"inprogress\" ) {\n\t\t\t\t\tjQuery.dequeue( this, type );\n\t\t\t\t}\n\t\t\t});\n\t},\n\tdequeue: function( type ) {\n\t\treturn this.each(function() {\n\t\t\tjQuery.dequeue( this, type );\n\t\t});\n\t},\n\t// Based off of the plugin by Clint Helfers, with permission.\n\t// http://blindsignals.com/index.php/2009/07/jquery-delay/\n\tdelay: function( time, type ) {\n\t\ttime = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time;\n\t\ttype = type || \"fx\";\n\n\t\treturn this.queue( type, function( next, hooks ) {\n\t\t\tvar timeout = setTimeout( next, time );\n\t\t\thooks.stop = function() {\n\t\t\t\tclearTimeout( timeout );\n\t\t\t};\n\t\t});\n\t},\n\tclearQueue: function( type ) {\n\t\treturn this.queue( type || \"fx\", [] );\n\t},\n\t// Get a promise resolved when queues of a certain type\n\t// are emptied (fx is the type by default)\n\tpromise: function( type, obj ) {\n\t\tvar tmp,\n\t\t\tcount = 1,\n\t\t\tdefer = jQuery.Deferred(),\n\t\t\telements = this,\n\t\t\ti = this.length,\n\t\t\tresolve = function() {\n\t\t\t\tif ( !( --count ) ) {\n\t\t\t\t\tdefer.resolveWith( elements, [ elements ] );\n\t\t\t\t}\n\t\t\t};\n\n\t\tif ( typeof type !== \"string\" ) {\n\t\t\tobj = type;\n\t\t\ttype = undefined;\n\t\t}\n\t\ttype = type || \"fx\";\n\n\t\twhile( i-- ) {\n\t\t\ttmp = data_priv.get( elements[ i ], type + \"queueHooks\" );\n\t\t\tif ( tmp && tmp.empty ) {\n\t\t\t\tcount++;\n\t\t\t\ttmp.empty.add( resolve );\n\t\t\t}\n\t\t}\n\t\tresolve();\n\t\treturn defer.promise( obj );\n\t}\n});\nvar nodeHook, boolHook,\n\trclass = /[\\t\\r\\n\\f]/g,\n\trreturn = /\\r/g,\n\trfocusable = /^(?:input|select|textarea|button)$/i;\n\njQuery.fn.extend({\n\tattr: function( name, value ) {\n\t\treturn jQuery.access( this, jQuery.attr, name, value, arguments.length > 1 );\n\t},\n\n\tremoveAttr: function( name ) {\n\t\treturn this.each(function() {\n\t\t\tjQuery.removeAttr( this, name );\n\t\t});\n\t},\n\n\tprop: function( name, value ) {\n\t\treturn jQuery.access( this, jQuery.prop, name, value, arguments.length > 1 );\n\t},\n\n\tremoveProp: function( name ) {\n\t\treturn this.each(function() {\n\t\t\tdelete this[ jQuery.propFix[ name ] || name ];\n\t\t});\n\t},\n\n\taddClass: function( value ) {\n\t\tvar classes, elem, cur, clazz, j,\n\t\t\ti = 0,\n\t\t\tlen = this.length,\n\t\t\tproceed = typeof value === \"string\" && value;\n\n\t\tif ( jQuery.isFunction( value ) ) {\n\t\t\treturn this.each(function( j ) {\n\t\t\t\tjQuery( this ).addClass( value.call( this, j, this.className ) );\n\t\t\t});\n\t\t}\n\n\t\tif ( proceed ) {\n\t\t\t// The disjunction here is for better compressibility (see removeClass)\n\t\t\tclasses = ( value || \"\" ).match( core_rnotwhite ) || [];\n\n\t\t\tfor ( ; i < len; i++ ) {\n\t\t\t\telem = this[ i ];\n\t\t\t\tcur = elem.nodeType === 1 && ( elem.className ?\n\t\t\t\t\t( \" \" + elem.className + \" \" ).replace( rclass, \" \" ) :\n\t\t\t\t\t\" \"\n\t\t\t\t);\n\n\t\t\t\tif ( cur ) {\n\t\t\t\t\tj = 0;\n\t\t\t\t\twhile ( (clazz = classes[j++]) ) {\n\t\t\t\t\t\tif ( cur.indexOf( \" \" + clazz + \" \" ) < 0 ) {\n\t\t\t\t\t\t\tcur += clazz + \" \";\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telem.className = jQuery.trim( cur );\n\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn this;\n\t},\n\n\tremoveClass: function( value ) {\n\t\tvar classes, elem, cur, clazz, j,\n\t\t\ti = 0,\n\t\t\tlen = this.length,\n\t\t\tproceed = arguments.length === 0 || typeof value === \"string\" && value;\n\n\t\tif ( jQuery.isFunction( value ) ) {\n\t\t\treturn this.each(function( j ) {\n\t\t\t\tjQuery( this ).removeClass( value.call( this, j, this.className ) );\n\t\t\t});\n\t\t}\n\t\tif ( proceed ) {\n\t\t\tclasses = ( value || \"\" ).match( core_rnotwhite ) || [];\n\n\t\t\tfor ( ; i < len; i++ ) {\n\t\t\t\telem = this[ i ];\n\t\t\t\t// This expression is here for better compressibility (see addClass)\n\t\t\t\tcur = elem.nodeType === 1 && ( elem.className ?\n\t\t\t\t\t( \" \" + elem.className + \" \" ).replace( rclass, \" \" ) :\n\t\t\t\t\t\"\"\n\t\t\t\t);\n\n\t\t\t\tif ( cur ) {\n\t\t\t\t\tj = 0;\n\t\t\t\t\twhile ( (clazz = classes[j++]) ) {\n\t\t\t\t\t\t// Remove *all* instances\n\t\t\t\t\t\twhile ( cur.indexOf( \" \" + clazz + \" \" ) >= 0 ) {\n\t\t\t\t\t\t\tcur = cur.replace( \" \" + clazz + \" \", \" \" );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telem.className = value ? jQuery.trim( cur ) : \"\";\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn this;\n\t},\n\n\ttoggleClass: function( value, stateVal ) {\n\t\tvar type = typeof value;\n\n\t\tif ( typeof stateVal === \"boolean\" && type === \"string\" ) {\n\t\t\treturn stateVal ? this.addClass( value ) : this.removeClass( value );\n\t\t}\n\n\t\tif ( jQuery.isFunction( value ) ) {\n\t\t\treturn this.each(function( i ) {\n\t\t\t\tjQuery( this ).toggleClass( value.call(this, i, this.className, stateVal), stateVal );\n\t\t\t});\n\t\t}\n\n\t\treturn this.each(function() {\n\t\t\tif ( type === \"string\" ) {\n\t\t\t\t// toggle individual class names\n\t\t\t\tvar className,\n\t\t\t\t\ti = 0,\n\t\t\t\t\tself = jQuery( this ),\n\t\t\t\t\tclassNames = value.match( core_rnotwhite ) || [];\n\n\t\t\t\twhile ( (className = classNames[ i++ ]) ) {\n\t\t\t\t\t// check each className given, space separated list\n\t\t\t\t\tif ( self.hasClass( className ) ) {\n\t\t\t\t\t\tself.removeClass( className );\n\t\t\t\t\t} else {\n\t\t\t\t\t\tself.addClass( className );\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t// Toggle whole class name\n\t\t\t} else if ( type === core_strundefined || type === \"boolean\" ) {\n\t\t\t\tif ( this.className ) {\n\t\t\t\t\t// store className if set\n\t\t\t\t\tdata_priv.set( this, \"__className__\", this.className );\n\t\t\t\t}\n\n\t\t\t\t// If the element has a class name or if we're passed \"false\",\n\t\t\t\t// then remove the whole classname (if there was one, the above saved it).\n\t\t\t\t// Otherwise bring back whatever was previously saved (if anything),\n\t\t\t\t// falling back to the empty string if nothing was stored.\n\t\t\t\tthis.className = this.className || value === false ? \"\" : data_priv.get( this, \"__className__\" ) || \"\";\n\t\t\t}\n\t\t});\n\t},\n\n\thasClass: function( selector ) {\n\t\tvar className = \" \" + selector + \" \",\n\t\t\ti = 0,\n\t\t\tl = this.length;\n\t\tfor ( ; i < l; i++ ) {\n\t\t\tif ( this[i].nodeType === 1 && (\" \" + this[i].className + \" \").replace(rclass, \" \").indexOf( className ) >= 0 ) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t},\n\n\tval: function( value ) {\n\t\tvar hooks, ret, isFunction,\n\t\t\telem = this[0];\n\n\t\tif ( !arguments.length ) {\n\t\t\tif ( elem ) {\n\t\t\t\thooks = jQuery.valHooks[ elem.type ] || jQuery.valHooks[ elem.nodeName.toLowerCase() ];\n\n\t\t\t\tif ( hooks && \"get\" in hooks && (ret = hooks.get( elem, \"value\" )) !== undefined ) {\n\t\t\t\t\treturn ret;\n\t\t\t\t}\n\n\t\t\t\tret = elem.value;\n\n\t\t\t\treturn typeof ret === \"string\" ?\n\t\t\t\t\t// handle most common string cases\n\t\t\t\t\tret.replace(rreturn, \"\") :\n\t\t\t\t\t// handle cases where value is null/undef or number\n\t\t\t\t\tret == null ? \"\" : ret;\n\t\t\t}\n\n\t\t\treturn;\n\t\t}\n\n\t\tisFunction = jQuery.isFunction( value );\n\n\t\treturn this.each(function( i ) {\n\t\t\tvar val;\n\n\t\t\tif ( this.nodeType !== 1 ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif ( isFunction ) {\n\t\t\t\tval = value.call( this, i, jQuery( this ).val() );\n\t\t\t} else {\n\t\t\t\tval = value;\n\t\t\t}\n\n\t\t\t// Treat null/undefined as \"\"; convert numbers to string\n\t\t\tif ( val == null ) {\n\t\t\t\tval = \"\";\n\t\t\t} else if ( typeof val === \"number\" ) {\n\t\t\t\tval += \"\";\n\t\t\t} else if ( jQuery.isArray( val ) ) {\n\t\t\t\tval = jQuery.map(val, function ( value ) {\n\t\t\t\t\treturn value == null ? \"\" : value + \"\";\n\t\t\t\t});\n\t\t\t}\n\n\t\t\thooks = jQuery.valHooks[ this.type ] || jQuery.valHooks[ this.nodeName.toLowerCase() ];\n\n\t\t\t// If set returns undefined, fall back to normal setting\n\t\t\tif ( !hooks || !(\"set\" in hooks) || hooks.set( this, val, \"value\" ) === undefined ) {\n\t\t\t\tthis.value = val;\n\t\t\t}\n\t\t});\n\t}\n});\n\njQuery.extend({\n\tvalHooks: {\n\t\toption: {\n\t\t\tget: function( elem ) {\n\t\t\t\t// attributes.value is undefined in Blackberry 4.7 but\n\t\t\t\t// uses .value. See #6932\n\t\t\t\tvar val = elem.attributes.value;\n\t\t\t\treturn !val || val.specified ? elem.value : elem.text;\n\t\t\t}\n\t\t},\n\t\tselect: {\n\t\t\tget: function( elem ) {\n\t\t\t\tvar value, option,\n\t\t\t\t\toptions = elem.options,\n\t\t\t\t\tindex = elem.selectedIndex,\n\t\t\t\t\tone = elem.type === \"select-one\" || index < 0,\n\t\t\t\t\tvalues = one ? null : [],\n\t\t\t\t\tmax = one ? index + 1 : options.length,\n\t\t\t\t\ti = index < 0 ?\n\t\t\t\t\t\tmax :\n\t\t\t\t\t\tone ? index : 0;\n\n\t\t\t\t// Loop through all the selected options\n\t\t\t\tfor ( ; i < max; i++ ) {\n\t\t\t\t\toption = options[ i ];\n\n\t\t\t\t\t// IE6-9 doesn't update selected after form reset (#2551)\n\t\t\t\t\tif ( ( option.selected || i === index ) &&\n\t\t\t\t\t\t\t// Don't return options that are disabled or in a disabled optgroup\n\t\t\t\t\t\t\t( jQuery.support.optDisabled ? !option.disabled : option.getAttribute(\"disabled\") === null ) &&\n\t\t\t\t\t\t\t( !option.parentNode.disabled || !jQuery.nodeName( option.parentNode, \"optgroup\" ) ) ) {\n\n\t\t\t\t\t\t// Get the specific value for the option\n\t\t\t\t\t\tvalue = jQuery( option ).val();\n\n\t\t\t\t\t\t// We don't need an array for one selects\n\t\t\t\t\t\tif ( one ) {\n\t\t\t\t\t\t\treturn value;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Multi-Selects return an array\n\t\t\t\t\t\tvalues.push( value );\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\treturn values;\n\t\t\t},\n\n\t\t\tset: function( elem, value ) {\n\t\t\t\tvar optionSet, option,\n\t\t\t\t\toptions = elem.options,\n\t\t\t\t\tvalues = jQuery.makeArray( value ),\n\t\t\t\t\ti = options.length;\n\n\t\t\t\twhile ( i-- ) {\n\t\t\t\t\toption = options[ i ];\n\t\t\t\t\tif ( (option.selected = jQuery.inArray( jQuery(option).val(), values ) >= 0) ) {\n\t\t\t\t\t\toptionSet = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// force browsers to behave consistently when non-matching value is set\n\t\t\t\tif ( !optionSet ) {\n\t\t\t\t\telem.selectedIndex = -1;\n\t\t\t\t}\n\t\t\t\treturn values;\n\t\t\t}\n\t\t}\n\t},\n\n\tattr: function( elem, name, value ) {\n\t\tvar hooks, ret,\n\t\t\tnType = elem.nodeType;\n\n\t\t// don't get/set attributes on text, comment and attribute nodes\n\t\tif ( !elem || nType === 3 || nType === 8 || nType === 2 ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Fallback to prop when attributes are not supported\n\t\tif ( typeof elem.getAttribute === core_strundefined ) {\n\t\t\treturn jQuery.prop( elem, name, value );\n\t\t}\n\n\t\t// All attributes are lowercase\n\t\t// Grab necessary hook if one is defined\n\t\tif ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) {\n\t\t\tname = name.toLowerCase();\n\t\t\thooks = jQuery.attrHooks[ name ] ||\n\t\t\t\t( jQuery.expr.match.bool.test( name ) ? boolHook : nodeHook );\n\t\t}\n\n\t\tif ( value !== undefined ) {\n\n\t\t\tif ( value === null ) {\n\t\t\t\tjQuery.removeAttr( elem, name );\n\n\t\t\t} else if ( hooks && \"set\" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ) {\n\t\t\t\treturn ret;\n\n\t\t\t} else {\n\t\t\t\telem.setAttribute( name, value + \"\" );\n\t\t\t\treturn value;\n\t\t\t}\n\n\t\t} else if ( hooks && \"get\" in hooks && (ret = hooks.get( elem, name )) !== null ) {\n\t\t\treturn ret;\n\n\t\t} else {\n\t\t\tret = jQuery.find.attr( elem, name );\n\n\t\t\t// Non-existent attributes return null, we normalize to undefined\n\t\t\treturn ret == null ?\n\t\t\t\tundefined :\n\t\t\t\tret;\n\t\t}\n\t},\n\n\tremoveAttr: function( elem, value ) {\n\t\tvar name, propName,\n\t\t\ti = 0,\n\t\t\tattrNames = value && value.match( core_rnotwhite );\n\n\t\tif ( attrNames && elem.nodeType === 1 ) {\n\t\t\twhile ( (name = attrNames[i++]) ) {\n\t\t\t\tpropName = jQuery.propFix[ name ] || name;\n\n\t\t\t\t// Boolean attributes get special treatment (#10870)\n\t\t\t\tif ( jQuery.expr.match.bool.test( name ) ) {\n\t\t\t\t\t// Set corresponding property to false\n\t\t\t\t\telem[ propName ] = false;\n\t\t\t\t}\n\n\t\t\t\telem.removeAttribute( name );\n\t\t\t}\n\t\t}\n\t},\n\n\tattrHooks: {\n\t\ttype: {\n\t\t\tset: function( elem, value ) {\n\t\t\t\tif ( !jQuery.support.radioValue && value === \"radio\" && jQuery.nodeName(elem, \"input\") ) {\n\t\t\t\t\t// Setting the type on a radio button after the value resets the value in IE6-9\n\t\t\t\t\t// Reset value to default in case type is set after value during creation\n\t\t\t\t\tvar val = elem.value;\n\t\t\t\t\telem.setAttribute( \"type\", value );\n\t\t\t\t\tif ( val ) {\n\t\t\t\t\t\telem.value = val;\n\t\t\t\t\t}\n\t\t\t\t\treturn value;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t},\n\n\tpropFix: {\n\t\t\"for\": \"htmlFor\",\n\t\t\"class\": \"className\"\n\t},\n\n\tprop: function( elem, name, value ) {\n\t\tvar ret, hooks, notxml,\n\t\t\tnType = elem.nodeType;\n\n\t\t// don't get/set properties on text, comment and attribute nodes\n\t\tif ( !elem || nType === 3 || nType === 8 || nType === 2 ) {\n\t\t\treturn;\n\t\t}\n\n\t\tnotxml = nType !== 1 || !jQuery.isXMLDoc( elem );\n\n\t\tif ( notxml ) {\n\t\t\t// Fix name and attach hooks\n\t\t\tname = jQuery.propFix[ name ] || name;\n\t\t\thooks = jQuery.propHooks[ name ];\n\t\t}\n\n\t\tif ( value !== undefined ) {\n\t\t\treturn hooks && \"set\" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ?\n\t\t\t\tret :\n\t\t\t\t( elem[ name ] = value );\n\n\t\t} else {\n\t\t\treturn hooks && \"get\" in hooks && (ret = hooks.get( elem, name )) !== null ?\n\t\t\t\tret :\n\t\t\t\telem[ name ];\n\t\t}\n\t},\n\n\tpropHooks: {\n\t\ttabIndex: {\n\t\t\tget: function( elem ) {\n\t\t\t\treturn elem.hasAttribute( \"tabindex\" ) || rfocusable.test( elem.nodeName ) || elem.href ?\n\t\t\t\t\telem.tabIndex :\n\t\t\t\t\t-1;\n\t\t\t}\n\t\t}\n\t}\n});\n\n// Hooks for boolean attributes\nboolHook = {\n\tset: function( elem, value, name ) {\n\t\tif ( value === false ) {\n\t\t\t// Remove boolean attributes when set to false\n\t\t\tjQuery.removeAttr( elem, name );\n\t\t} else {\n\t\t\telem.setAttribute( name, name );\n\t\t}\n\t\treturn name;\n\t}\n};\njQuery.each( jQuery.expr.match.bool.source.match( /\\w+/g ), function( i, name ) {\n\tvar getter = jQuery.expr.attrHandle[ name ] || jQuery.find.attr;\n\n\tjQuery.expr.attrHandle[ name ] = function( elem, name, isXML ) {\n\t\tvar fn = jQuery.expr.attrHandle[ name ],\n\t\t\tret = isXML ?\n\t\t\t\tundefined :\n\t\t\t\t/* jshint eqeqeq: false */\n\t\t\t\t// Temporarily disable this handler to check existence\n\t\t\t\t(jQuery.expr.attrHandle[ name ] = undefined) !=\n\t\t\t\t\tgetter( elem, name, isXML ) ?\n\n\t\t\t\t\tname.toLowerCase() :\n\t\t\t\t\tnull;\n\n\t\t// Restore handler\n\t\tjQuery.expr.attrHandle[ name ] = fn;\n\n\t\treturn ret;\n\t};\n});\n\n// Support: IE9+\n// Selectedness for an option in an optgroup can be inaccurate\nif ( !jQuery.support.optSelected ) {\n\tjQuery.propHooks.selected = {\n\t\tget: function( elem ) {\n\t\t\tvar parent = elem.parentNode;\n\t\t\tif ( parent && parent.parentNode ) {\n\t\t\t\tparent.parentNode.selectedIndex;\n\t\t\t}\n\t\t\treturn null;\n\t\t}\n\t};\n}\n\njQuery.each([\n\t\"tabIndex\",\n\t\"readOnly\",\n\t\"maxLength\",\n\t\"cellSpacing\",\n\t\"cellPadding\",\n\t\"rowSpan\",\n\t\"colSpan\",\n\t\"useMap\",\n\t\"frameBorder\",\n\t\"contentEditable\"\n], function() {\n\tjQuery.propFix[ this.toLowerCase() ] = this;\n});\n\n// Radios and checkboxes getter/setter\njQuery.each([ \"radio\", \"checkbox\" ], function() {\n\tjQuery.valHooks[ this ] = {\n\t\tset: function( elem, value ) {\n\t\t\tif ( jQuery.isArray( value ) ) {\n\t\t\t\treturn ( elem.checked = jQuery.inArray( jQuery(elem).val(), value ) >= 0 );\n\t\t\t}\n\t\t}\n\t};\n\tif ( !jQuery.support.checkOn ) {\n\t\tjQuery.valHooks[ this ].get = function( elem ) {\n\t\t\t// Support: Webkit\n\t\t\t// \"\" is returned instead of \"on\" if a value isn't specified\n\t\t\treturn elem.getAttribute(\"value\") === null ? \"on\" : elem.value;\n\t\t};\n\t}\n});\nvar rkeyEvent = /^key/,\n\trmouseEvent = /^(?:mouse|contextmenu)|click/,\n\trfocusMorph = /^(?:focusinfocus|focusoutblur)$/,\n\trtypenamespace = /^([^.]*)(?:\\.(.+)|)$/;\n\nfunction returnTrue() {\n\treturn true;\n}\n\nfunction returnFalse() {\n\treturn false;\n}\n\nfunction safeActiveElement() {\n\ttry {\n\t\treturn document.activeElement;\n\t} catch ( err ) { }\n}\n\n/*\n * Helper functions for managing events -- not part of the public interface.\n * Props to Dean Edwards' addEvent library for many of the ideas.\n */\njQuery.event = {\n\n\tglobal: {},\n\n\tadd: function( elem, types, handler, data, selector ) {\n\n\t\tvar handleObjIn, eventHandle, tmp,\n\t\t\tevents, t, handleObj,\n\t\t\tspecial, handlers, type, namespaces, origType,\n\t\t\telemData = data_priv.get( elem );\n\n\t\t// Don't attach events to noData or text/comment nodes (but allow plain objects)\n\t\tif ( !elemData ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Caller can pass in an object of custom data in lieu of the handler\n\t\tif ( handler.handler ) {\n\t\t\thandleObjIn = handler;\n\t\t\thandler = handleObjIn.handler;\n\t\t\tselector = handleObjIn.selector;\n\t\t}\n\n\t\t// Make sure that the handler has a unique ID, used to find/remove it later\n\t\tif ( !handler.guid ) {\n\t\t\thandler.guid = jQuery.guid++;\n\t\t}\n\n\t\t// Init the element's event structure and main handler, if this is the first\n\t\tif ( !(events = elemData.events) ) {\n\t\t\tevents = elemData.events = {};\n\t\t}\n\t\tif ( !(eventHandle = elemData.handle) ) {\n\t\t\teventHandle = elemData.handle = function( e ) {\n\t\t\t\t// Discard the second event of a jQuery.event.trigger() and\n\t\t\t\t// when an event is called after a page has unloaded\n\t\t\t\treturn typeof jQuery !== core_strundefined && (!e || jQuery.event.triggered !== e.type) ?\n\t\t\t\t\tjQuery.event.dispatch.apply( eventHandle.elem, arguments ) :\n\t\t\t\t\tundefined;\n\t\t\t};\n\t\t\t// Add elem as a property of the handle fn to prevent a memory leak with IE non-native events\n\t\t\teventHandle.elem = elem;\n\t\t}\n\n\t\t// Handle multiple events separated by a space\n\t\ttypes = ( types || \"\" ).match( core_rnotwhite ) || [\"\"];\n\t\tt = types.length;\n\t\twhile ( t-- ) {\n\t\t\ttmp = rtypenamespace.exec( types[t] ) || [];\n\t\t\ttype = origType = tmp[1];\n\t\t\tnamespaces = ( tmp[2] || \"\" ).split( \".\" ).sort();\n\n\t\t\t// There *must* be a type, no attaching namespace-only handlers\n\t\t\tif ( !type ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// If event changes its type, use the special event handlers for the changed type\n\t\t\tspecial = jQuery.event.special[ type ] || {};\n\n\t\t\t// If selector defined, determine special event api type, otherwise given type\n\t\t\ttype = ( selector ? special.delegateType : special.bindType ) || type;\n\n\t\t\t// Update special based on newly reset type\n\t\t\tspecial = jQuery.event.special[ type ] || {};\n\n\t\t\t// handleObj is passed to all event handlers\n\t\t\thandleObj = jQuery.extend({\n\t\t\t\ttype: type,\n\t\t\t\torigType: origType,\n\t\t\t\tdata: data,\n\t\t\t\thandler: handler,\n\t\t\t\tguid: handler.guid,\n\t\t\t\tselector: selector,\n\t\t\t\tneedsContext: selector && jQuery.expr.match.needsContext.test( selector ),\n\t\t\t\tnamespace: namespaces.join(\".\")\n\t\t\t}, handleObjIn );\n\n\t\t\t// Init the event handler queue if we're the first\n\t\t\tif ( !(handlers = events[ type ]) ) {\n\t\t\t\thandlers = events[ type ] = [];\n\t\t\t\thandlers.delegateCount = 0;\n\n\t\t\t\t// Only use addEventListener if the special events handler returns false\n\t\t\t\tif ( !special.setup || special.setup.call( elem, data, namespaces, eventHandle ) === false ) {\n\t\t\t\t\tif ( elem.addEventListener ) {\n\t\t\t\t\t\telem.addEventListener( type, eventHandle, false );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ( special.add ) {\n\t\t\t\tspecial.add.call( elem, handleObj );\n\n\t\t\t\tif ( !handleObj.handler.guid ) {\n\t\t\t\t\thandleObj.handler.guid = handler.guid;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Add to the element's handler list, delegates in front\n\t\t\tif ( selector ) {\n\t\t\t\thandlers.splice( handlers.delegateCount++, 0, handleObj );\n\t\t\t} else {\n\t\t\t\thandlers.push( handleObj );\n\t\t\t}\n\n\t\t\t// Keep track of which events have ever been used, for event optimization\n\t\t\tjQuery.event.global[ type ] = true;\n\t\t}\n\n\t\t// Nullify elem to prevent memory leaks in IE\n\t\telem = null;\n\t},\n\n\t// Detach an event or set of events from an element\n\tremove: function( elem, types, handler, selector, mappedTypes ) {\n\n\t\tvar j, origCount, tmp,\n\t\t\tevents, t, handleObj,\n\t\t\tspecial, handlers, type, namespaces, origType,\n\t\t\telemData = data_priv.hasData( elem ) && data_priv.get( elem );\n\n\t\tif ( !elemData || !(events = elemData.events) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Once for each type.namespace in types; type may be omitted\n\t\ttypes = ( types || \"\" ).match( core_rnotwhite ) || [\"\"];\n\t\tt = types.length;\n\t\twhile ( t-- ) {\n\t\t\ttmp = rtypenamespace.exec( types[t] ) || [];\n\t\t\ttype = origType = tmp[1];\n\t\t\tnamespaces = ( tmp[2] || \"\" ).split( \".\" ).sort();\n\n\t\t\t// Unbind all events (on this namespace, if provided) for the element\n\t\t\tif ( !type ) {\n\t\t\t\tfor ( type in events ) {\n\t\t\t\t\tjQuery.event.remove( elem, type + types[ t ], handler, selector, true );\n\t\t\t\t}\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tspecial = jQuery.event.special[ type ] || {};\n\t\t\ttype = ( selector ? special.delegateType : special.bindType ) || type;\n\t\t\thandlers = events[ type ] || [];\n\t\t\ttmp = tmp[2] && new RegExp( \"(^|\\\\.)\" + namespaces.join(\"\\\\.(?:.*\\\\.|)\") + \"(\\\\.|$)\" );\n\n\t\t\t// Remove matching events\n\t\t\torigCount = j = handlers.length;\n\t\t\twhile ( j-- ) {\n\t\t\t\thandleObj = handlers[ j ];\n\n\t\t\t\tif ( ( mappedTypes || origType === handleObj.origType ) &&\n\t\t\t\t\t( !handler || handler.guid === handleObj.guid ) &&\n\t\t\t\t\t( !tmp || tmp.test( handleObj.namespace ) ) &&\n\t\t\t\t\t( !selector || selector === handleObj.selector || selector === \"**\" && handleObj.selector ) ) {\n\t\t\t\t\thandlers.splice( j, 1 );\n\n\t\t\t\t\tif ( handleObj.selector ) {\n\t\t\t\t\t\thandlers.delegateCount--;\n\t\t\t\t\t}\n\t\t\t\t\tif ( special.remove ) {\n\t\t\t\t\t\tspecial.remove.call( elem, handleObj );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Remove generic event handler if we removed something and no more handlers exist\n\t\t\t// (avoids potential for endless recursion during removal of special event handlers)\n\t\t\tif ( origCount && !handlers.length ) {\n\t\t\t\tif ( !special.teardown || special.teardown.call( elem, namespaces, elemData.handle ) === false ) {\n\t\t\t\t\tjQuery.removeEvent( elem, type, elemData.handle );\n\t\t\t\t}\n\n\t\t\t\tdelete events[ type ];\n\t\t\t}\n\t\t}\n\n\t\t// Remove the expando if it's no longer used\n\t\tif ( jQuery.isEmptyObject( events ) ) {\n\t\t\tdelete elemData.handle;\n\t\t\tdata_priv.remove( elem, \"events\" );\n\t\t}\n\t},\n\n\ttrigger: function( event, data, elem, onlyHandlers ) {\n\n\t\tvar i, cur, tmp, bubbleType, ontype, handle, special,\n\t\t\teventPath = [ elem || document ],\n\t\t\ttype = core_hasOwn.call( event, \"type\" ) ? event.type : event,\n\t\t\tnamespaces = core_hasOwn.call( event, \"namespace\" ) ? event.namespace.split(\".\") : [];\n\n\t\tcur = tmp = elem = elem || document;\n\n\t\t// Don't do events on text and comment nodes\n\t\tif ( elem.nodeType === 3 || elem.nodeType === 8 ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// focus/blur morphs to focusin/out; ensure we're not firing them right now\n\t\tif ( rfocusMorph.test( type + jQuery.event.triggered ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( type.indexOf(\".\") >= 0 ) {\n\t\t\t// Namespaced trigger; create a regexp to match event type in handle()\n\t\t\tnamespaces = type.split(\".\");\n\t\t\ttype = namespaces.shift();\n\t\t\tnamespaces.sort();\n\t\t}\n\t\tontype = type.indexOf(\":\") < 0 && \"on\" + type;\n\n\t\t// Caller can pass in a jQuery.Event object, Object, or just an event type string\n\t\tevent = event[ jQuery.expando ] ?\n\t\t\tevent :\n\t\t\tnew jQuery.Event( type, typeof event === \"object\" && event );\n\n\t\t// Trigger bitmask: & 1 for native handlers; & 2 for jQuery (always true)\n\t\tevent.isTrigger = onlyHandlers ? 2 : 3;\n\t\tevent.namespace = namespaces.join(\".\");\n\t\tevent.namespace_re = event.namespace ?\n\t\t\tnew RegExp( \"(^|\\\\.)\" + namespaces.join(\"\\\\.(?:.*\\\\.|)\") + \"(\\\\.|$)\" ) :\n\t\t\tnull;\n\n\t\t// Clean up the event in case it is being reused\n\t\tevent.result = undefined;\n\t\tif ( !event.target ) {\n\t\t\tevent.target = elem;\n\t\t}\n\n\t\t// Clone any incoming data and prepend the event, creating the handler arg list\n\t\tdata = data == null ?\n\t\t\t[ event ] :\n\t\t\tjQuery.makeArray( data, [ event ] );\n\n\t\t// Allow special events to draw outside the lines\n\t\tspecial = jQuery.event.special[ type ] || {};\n\t\tif ( !onlyHandlers && special.trigger && special.trigger.apply( elem, data ) === false ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Determine event propagation path in advance, per W3C events spec (#9951)\n\t\t// Bubble up to document, then to window; watch for a global ownerDocument var (#9724)\n\t\tif ( !onlyHandlers && !special.noBubble && !jQuery.isWindow( elem ) ) {\n\n\t\t\tbubbleType = special.delegateType || type;\n\t\t\tif ( !rfocusMorph.test( bubbleType + type ) ) {\n\t\t\t\tcur = cur.parentNode;\n\t\t\t}\n\t\t\tfor ( ; cur; cur = cur.parentNode ) {\n\t\t\t\teventPath.push( cur );\n\t\t\t\ttmp = cur;\n\t\t\t}\n\n\t\t\t// Only add window if we got to document (e.g., not plain obj or detached DOM)\n\t\t\tif ( tmp === (elem.ownerDocument || document) ) {\n\t\t\t\teventPath.push( tmp.defaultView || tmp.parentWindow || window );\n\t\t\t}\n\t\t}\n\n\t\t// Fire handlers on the event path\n\t\ti = 0;\n\t\twhile ( (cur = eventPath[i++]) && !event.isPropagationStopped() ) {\n\n\t\t\tevent.type = i > 1 ?\n\t\t\t\tbubbleType :\n\t\t\t\tspecial.bindType || type;\n\n\t\t\t// jQuery handler\n\t\t\thandle = ( data_priv.get( cur, \"events\" ) || {} )[ event.type ] && data_priv.get( cur, \"handle\" );\n\t\t\tif ( handle ) {\n\t\t\t\thandle.apply( cur, data );\n\t\t\t}\n\n\t\t\t// Native handler\n\t\t\thandle = ontype && cur[ ontype ];\n\t\t\tif ( handle && jQuery.acceptData( cur ) && handle.apply && handle.apply( cur, data ) === false ) {\n\t\t\t\tevent.preventDefault();\n\t\t\t}\n\t\t}\n\t\tevent.type = type;\n\n\t\t// If nobody prevented the default action, do it now\n\t\tif ( !onlyHandlers && !event.isDefaultPrevented() ) {\n\n\t\t\tif ( (!special._default || special._default.apply( eventPath.pop(), data ) === false) &&\n\t\t\t\tjQuery.acceptData( elem ) ) {\n\n\t\t\t\t// Call a native DOM method on the target with the same name name as the event.\n\t\t\t\t// Don't do default actions on window, that's where global variables be (#6170)\n\t\t\t\tif ( ontype && jQuery.isFunction( elem[ type ] ) && !jQuery.isWindow( elem ) ) {\n\n\t\t\t\t\t// Don't re-trigger an onFOO event when we call its FOO() method\n\t\t\t\t\ttmp = elem[ ontype ];\n\n\t\t\t\t\tif ( tmp ) {\n\t\t\t\t\t\telem[ ontype ] = null;\n\t\t\t\t\t}\n\n\t\t\t\t\t// Prevent re-triggering of the same event, since we already bubbled it above\n\t\t\t\t\tjQuery.event.triggered = type;\n\t\t\t\t\telem[ type ]();\n\t\t\t\t\tjQuery.event.triggered = undefined;\n\n\t\t\t\t\tif ( tmp ) {\n\t\t\t\t\t\telem[ ontype ] = tmp;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn event.result;\n\t},\n\n\tdispatch: function( event ) {\n\n\t\t// Make a writable jQuery.Event from the native event object\n\t\tevent = jQuery.event.fix( event );\n\n\t\tvar i, j, ret, matched, handleObj,\n\t\t\thandlerQueue = [],\n\t\t\targs = core_slice.call( arguments ),\n\t\t\thandlers = ( data_priv.get( this, \"events\" ) || {} )[ event.type ] || [],\n\t\t\tspecial = jQuery.event.special[ event.type ] || {};\n\n\t\t// Use the fix-ed jQuery.Event rather than the (read-only) native event\n\t\targs[0] = event;\n\t\tevent.delegateTarget = this;\n\n\t\t// Call the preDispatch hook for the mapped type, and let it bail if desired\n\t\tif ( special.preDispatch && special.preDispatch.call( this, event ) === false ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Determine handlers\n\t\thandlerQueue = jQuery.event.handlers.call( this, event, handlers );\n\n\t\t// Run delegates first; they may want to stop propagation beneath us\n\t\ti = 0;\n\t\twhile ( (matched = handlerQueue[ i++ ]) && !event.isPropagationStopped() ) {\n\t\t\tevent.currentTarget = matched.elem;\n\n\t\t\tj = 0;\n\t\t\twhile ( (handleObj = matched.handlers[ j++ ]) && !event.isImmediatePropagationStopped() ) {\n\n\t\t\t\t// Triggered event must either 1) have no namespace, or\n\t\t\t\t// 2) have namespace(s) a subset or equal to those in the bound event (both can have no namespace).\n\t\t\t\tif ( !event.namespace_re || event.namespace_re.test( handleObj.namespace ) ) {\n\n\t\t\t\t\tevent.handleObj = handleObj;\n\t\t\t\t\tevent.data = handleObj.data;\n\n\t\t\t\t\tret = ( (jQuery.event.special[ handleObj.origType ] || {}).handle || handleObj.handler )\n\t\t\t\t\t\t\t.apply( matched.elem, args );\n\n\t\t\t\t\tif ( ret !== undefined ) {\n\t\t\t\t\t\tif ( (event.result = ret) === false ) {\n\t\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\t\tevent.stopPropagation();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Call the postDispatch hook for the mapped type\n\t\tif ( special.postDispatch ) {\n\t\t\tspecial.postDispatch.call( this, event );\n\t\t}\n\n\t\treturn event.result;\n\t},\n\n\thandlers: function( event, handlers ) {\n\t\tvar i, matches, sel, handleObj,\n\t\t\thandlerQueue = [],\n\t\t\tdelegateCount = handlers.delegateCount,\n\t\t\tcur = event.target;\n\n\t\t// Find delegate handlers\n\t\t// Black-hole SVG <use> instance trees (#13180)\n\t\t// Avoid non-left-click bubbling in Firefox (#3861)\n\t\tif ( delegateCount && cur.nodeType && (!event.button || event.type !== \"click\") ) {\n\n\t\t\tfor ( ; cur !== this; cur = cur.parentNode || this ) {\n\n\t\t\t\t// Don't process clicks on disabled elements (#6911, #8165, #11382, #11764)\n\t\t\t\tif ( cur.disabled !== true || event.type !== \"click\" ) {\n\t\t\t\t\tmatches = [];\n\t\t\t\t\tfor ( i = 0; i < delegateCount; i++ ) {\n\t\t\t\t\t\thandleObj = handlers[ i ];\n\n\t\t\t\t\t\t// Don't conflict with Object.prototype properties (#13203)\n\t\t\t\t\t\tsel = handleObj.selector + \" \";\n\n\t\t\t\t\t\tif ( matches[ sel ] === undefined ) {\n\t\t\t\t\t\t\tmatches[ sel ] = handleObj.needsContext ?\n\t\t\t\t\t\t\t\tjQuery( sel, this ).index( cur ) >= 0 :\n\t\t\t\t\t\t\t\tjQuery.find( sel, this, null, [ cur ] ).length;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif ( matches[ sel ] ) {\n\t\t\t\t\t\t\tmatches.push( handleObj );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif ( matches.length ) {\n\t\t\t\t\t\thandlerQueue.push({ elem: cur, handlers: matches });\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Add the remaining (directly-bound) handlers\n\t\tif ( delegateCount < handlers.length ) {\n\t\t\thandlerQueue.push({ elem: this, handlers: handlers.slice( delegateCount ) });\n\t\t}\n\n\t\treturn handlerQueue;\n\t},\n\n\t// Includes some event props shared by KeyEvent and MouseEvent\n\tprops: \"altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which\".split(\" \"),\n\n\tfixHooks: {},\n\n\tkeyHooks: {\n\t\tprops: \"char charCode key keyCode\".split(\" \"),\n\t\tfilter: function( event, original ) {\n\n\t\t\t// Add which for key events\n\t\t\tif ( event.which == null ) {\n\t\t\t\tevent.which = original.charCode != null ? original.charCode : original.keyCode;\n\t\t\t}\n\n\t\t\treturn event;\n\t\t}\n\t},\n\n\tmouseHooks: {\n\t\tprops: \"button buttons clientX clientY offsetX offsetY pageX pageY screenX screenY toElement\".split(\" \"),\n\t\tfilter: function( event, original ) {\n\t\t\tvar eventDoc, doc, body,\n\t\t\t\tbutton = original.button;\n\n\t\t\t// Calculate pageX/Y if missing and clientX/Y available\n\t\t\tif ( event.pageX == null && original.clientX != null ) {\n\t\t\t\teventDoc = event.target.ownerDocument || document;\n\t\t\t\tdoc = eventDoc.documentElement;\n\t\t\t\tbody = eventDoc.body;\n\n\t\t\t\tevent.pageX = original.clientX + ( doc && doc.scrollLeft || body && body.scrollLeft || 0 ) - ( doc && doc.clientLeft || body && body.clientLeft || 0 );\n\t\t\t\tevent.pageY = original.clientY + ( doc && doc.scrollTop || body && body.scrollTop || 0 ) - ( doc && doc.clientTop || body && body.clientTop || 0 );\n\t\t\t}\n\n\t\t\t// Add which for click: 1 === left; 2 === middle; 3 === right\n\t\t\t// Note: button is not normalized, so don't use it\n\t\t\tif ( !event.which && button !== undefined ) {\n\t\t\t\tevent.which = ( button & 1 ? 1 : ( button & 2 ? 3 : ( button & 4 ? 2 : 0 ) ) );\n\t\t\t}\n\n\t\t\treturn event;\n\t\t}\n\t},\n\n\tfix: function( event ) {\n\t\tif ( event[ jQuery.expando ] ) {\n\t\t\treturn event;\n\t\t}\n\n\t\t// Create a writable copy of the event object and normalize some properties\n\t\tvar i, prop, copy,\n\t\t\ttype = event.type,\n\t\t\toriginalEvent = event,\n\t\t\tfixHook = this.fixHooks[ type ];\n\n\t\tif ( !fixHook ) {\n\t\t\tthis.fixHooks[ type ] = fixHook =\n\t\t\t\trmouseEvent.test( type ) ? this.mouseHooks :\n\t\t\t\trkeyEvent.test( type ) ? this.keyHooks :\n\t\t\t\t{};\n\t\t}\n\t\tcopy = fixHook.props ? this.props.concat( fixHook.props ) : this.props;\n\n\t\tevent = new jQuery.Event( originalEvent );\n\n\t\ti = copy.length;\n\t\twhile ( i-- ) {\n\t\t\tprop = copy[ i ];\n\t\t\tevent[ prop ] = originalEvent[ prop ];\n\t\t}\n\n\t\t// Support: Cordova 2.5 (WebKit) (#13255)\n\t\t// All events should have a target; Cordova deviceready doesn't\n\t\tif ( !event.target ) {\n\t\t\tevent.target = document;\n\t\t}\n\n\t\t// Support: Safari 6.0+, Chrome < 28\n\t\t// Target should not be a text node (#504, #13143)\n\t\tif ( event.target.nodeType === 3 ) {\n\t\t\tevent.target = event.target.parentNode;\n\t\t}\n\n\t\treturn fixHook.filter? fixHook.filter( event, originalEvent ) : event;\n\t},\n\n\tspecial: {\n\t\tload: {\n\t\t\t// Prevent triggered image.load events from bubbling to window.load\n\t\t\tnoBubble: true\n\t\t},\n\t\tfocus: {\n\t\t\t// Fire native event if possible so blur/focus sequence is correct\n\t\t\ttrigger: function() {\n\t\t\t\tif ( this !== safeActiveElement() && this.focus ) {\n\t\t\t\t\tthis.focus();\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t},\n\t\t\tdelegateType: \"focusin\"\n\t\t},\n\t\tblur: {\n\t\t\ttrigger: function() {\n\t\t\t\tif ( this === safeActiveElement() && this.blur ) {\n\t\t\t\t\tthis.blur();\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t},\n\t\t\tdelegateType: \"focusout\"\n\t\t},\n\t\tclick: {\n\t\t\t// For checkbox, fire native event so checked state will be right\n\t\t\ttrigger: function() {\n\t\t\t\tif ( this.type === \"checkbox\" && this.click && jQuery.nodeName( this, \"input\" ) ) {\n\t\t\t\t\tthis.click();\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t},\n\n\t\t\t// For cross-browser consistency, don't fire native .click() on links\n\t\t\t_default: function( event ) {\n\t\t\t\treturn jQuery.nodeName( event.target, \"a\" );\n\t\t\t}\n\t\t},\n\n\t\tbeforeunload: {\n\t\t\tpostDispatch: function( event ) {\n\n\t\t\t\t// Support: Firefox 20+\n\t\t\t\t// Firefox doesn't alert if the returnValue field is not set.\n\t\t\t\tif ( event.result !== undefined ) {\n\t\t\t\t\tevent.originalEvent.returnValue = event.result;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t},\n\n\tsimulate: function( type, elem, event, bubble ) {\n\t\t// Piggyback on a donor event to simulate a different one.\n\t\t// Fake originalEvent to avoid donor's stopPropagation, but if the\n\t\t// simulated event prevents default then we do the same on the donor.\n\t\tvar e = jQuery.extend(\n\t\t\tnew jQuery.Event(),\n\t\t\tevent,\n\t\t\t{\n\t\t\t\ttype: type,\n\t\t\t\tisSimulated: true,\n\t\t\t\toriginalEvent: {}\n\t\t\t}\n\t\t);\n\t\tif ( bubble ) {\n\t\t\tjQuery.event.trigger( e, null, elem );\n\t\t} else {\n\t\t\tjQuery.event.dispatch.call( elem, e );\n\t\t}\n\t\tif ( e.isDefaultPrevented() ) {\n\t\t\tevent.preventDefault();\n\t\t}\n\t}\n};\n\njQuery.removeEvent = function( elem, type, handle ) {\n\tif ( elem.removeEventListener ) {\n\t\telem.removeEventListener( type, handle, false );\n\t}\n};\n\njQuery.Event = function( src, props ) {\n\t// Allow instantiation without the 'new' keyword\n\tif ( !(this instanceof jQuery.Event) ) {\n\t\treturn new jQuery.Event( src, props );\n\t}\n\n\t// Event object\n\tif ( src && src.type ) {\n\t\tthis.originalEvent = src;\n\t\tthis.type = src.type;\n\n\t\t// Events bubbling up the document may have been marked as prevented\n\t\t// by a handler lower down the tree; reflect the correct value.\n\t\tthis.isDefaultPrevented = ( src.defaultPrevented ||\n\t\t\tsrc.getPreventDefault && src.getPreventDefault() ) ? returnTrue : returnFalse;\n\n\t// Event type\n\t} else {\n\t\tthis.type = src;\n\t}\n\n\t// Put explicitly provided properties onto the event object\n\tif ( props ) {\n\t\tjQuery.extend( this, props );\n\t}\n\n\t// Create a timestamp if incoming event doesn't have one\n\tthis.timeStamp = src && src.timeStamp || jQuery.now();\n\n\t// Mark it as fixed\n\tthis[ jQuery.expando ] = true;\n};\n\n// jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding\n// http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html\njQuery.Event.prototype = {\n\tisDefaultPrevented: returnFalse,\n\tisPropagationStopped: returnFalse,\n\tisImmediatePropagationStopped: returnFalse,\n\n\tpreventDefault: function() {\n\t\tvar e = this.originalEvent;\n\n\t\tthis.isDefaultPrevented = returnTrue;\n\n\t\tif ( e && e.preventDefault ) {\n\t\t\te.preventDefault();\n\t\t}\n\t},\n\tstopPropagation: function() {\n\t\tvar e = this.originalEvent;\n\n\t\tthis.isPropagationStopped = returnTrue;\n\n\t\tif ( e && e.stopPropagation ) {\n\t\t\te.stopPropagation();\n\t\t}\n\t},\n\tstopImmediatePropagation: function() {\n\t\tthis.isImmediatePropagationStopped = returnTrue;\n\t\tthis.stopPropagation();\n\t}\n};\n\n// Create mouseenter/leave events using mouseover/out and event-time checks\n// Support: Chrome 15+\njQuery.each({\n\tmouseenter: \"mouseover\",\n\tmouseleave: \"mouseout\"\n}, function( orig, fix ) {\n\tjQuery.event.special[ orig ] = {\n\t\tdelegateType: fix,\n\t\tbindType: fix,\n\n\t\thandle: function( event ) {\n\t\t\tvar ret,\n\t\t\t\ttarget = this,\n\t\t\t\trelated = event.relatedTarget,\n\t\t\t\thandleObj = event.handleObj;\n\n\t\t\t// For mousenter/leave call the handler if related is outside the target.\n\t\t\t// NB: No relatedTarget if the mouse left/entered the browser window\n\t\t\tif ( !related || (related !== target && !jQuery.contains( target, related )) ) {\n\t\t\t\tevent.type = handleObj.origType;\n\t\t\t\tret = handleObj.handler.apply( this, arguments );\n\t\t\t\tevent.type = fix;\n\t\t\t}\n\t\t\treturn ret;\n\t\t}\n\t};\n});\n\n// Create \"bubbling\" focus and blur events\n// Support: Firefox, Chrome, Safari\nif ( !jQuery.support.focusinBubbles ) {\n\tjQuery.each({ focus: \"focusin\", blur: \"focusout\" }, function( orig, fix ) {\n\n\t\t// Attach a single capturing handler while someone wants focusin/focusout\n\t\tvar attaches = 0,\n\t\t\thandler = function( event ) {\n\t\t\t\tjQuery.event.simulate( fix, event.target, jQuery.event.fix( event ), true );\n\t\t\t};\n\n\t\tjQuery.event.special[ fix ] = {\n\t\t\tsetup: function() {\n\t\t\t\tif ( attaches++ === 0 ) {\n\t\t\t\t\tdocument.addEventListener( orig, handler, true );\n\t\t\t\t}\n\t\t\t},\n\t\t\tteardown: function() {\n\t\t\t\tif ( --attaches === 0 ) {\n\t\t\t\t\tdocument.removeEventListener( orig, handler, true );\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t});\n}\n\njQuery.fn.extend({\n\n\ton: function( types, selector, data, fn, /*INTERNAL*/ one ) {\n\t\tvar origFn, type;\n\n\t\t// Types can be a map of types/handlers\n\t\tif ( typeof types === \"object\" ) {\n\t\t\t// ( types-Object, selector, data )\n\t\t\tif ( typeof selector !== \"string\" ) {\n\t\t\t\t// ( types-Object, data )\n\t\t\t\tdata = data || selector;\n\t\t\t\tselector = undefined;\n\t\t\t}\n\t\t\tfor ( type in types ) {\n\t\t\t\tthis.on( type, selector, data, types[ type ], one );\n\t\t\t}\n\t\t\treturn this;\n\t\t}\n\n\t\tif ( data == null && fn == null ) {\n\t\t\t// ( types, fn )\n\t\t\tfn = selector;\n\t\t\tdata = selector = undefined;\n\t\t} else if ( fn == null ) {\n\t\t\tif ( typeof selector === \"string\" ) {\n\t\t\t\t// ( types, selector, fn )\n\t\t\t\tfn = data;\n\t\t\t\tdata = undefined;\n\t\t\t} else {\n\t\t\t\t// ( types, data, fn )\n\t\t\t\tfn = data;\n\t\t\t\tdata = selector;\n\t\t\t\tselector = undefined;\n\t\t\t}\n\t\t}\n\t\tif ( fn === false ) {\n\t\t\tfn = returnFalse;\n\t\t} else if ( !fn ) {\n\t\t\treturn this;\n\t\t}\n\n\t\tif ( one === 1 ) {\n\t\t\torigFn = fn;\n\t\t\tfn = function( event ) {\n\t\t\t\t// Can use an empty set, since event contains the info\n\t\t\t\tjQuery().off( event );\n\t\t\t\treturn origFn.apply( this, arguments );\n\t\t\t};\n\t\t\t// Use same guid so caller can remove using origFn\n\t\t\tfn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ );\n\t\t}\n\t\treturn this.each( function() {\n\t\t\tjQuery.event.add( this, types, fn, data, selector );\n\t\t});\n\t},\n\tone: function( types, selector, data, fn ) {\n\t\treturn this.on( types, selector, data, fn, 1 );\n\t},\n\toff: function( types, selector, fn ) {\n\t\tvar handleObj, type;\n\t\tif ( types && types.preventDefault && types.handleObj ) {\n\t\t\t// ( event ) dispatched jQuery.Event\n\t\t\thandleObj = types.handleObj;\n\t\t\tjQuery( types.delegateTarget ).off(\n\t\t\t\thandleObj.namespace ? handleObj.origType + \".\" + handleObj.namespace : handleObj.origType,\n\t\t\t\thandleObj.selector,\n\t\t\t\thandleObj.handler\n\t\t\t);\n\t\t\treturn this;\n\t\t}\n\t\tif ( typeof types === \"object\" ) {\n\t\t\t// ( types-object [, selector] )\n\t\t\tfor ( type in types ) {\n\t\t\t\tthis.off( type, selector, types[ type ] );\n\t\t\t}\n\t\t\treturn this;\n\t\t}\n\t\tif ( selector === false || typeof selector === \"function\" ) {\n\t\t\t// ( types [, fn] )\n\t\t\tfn = selector;\n\t\t\tselector = undefined;\n\t\t}\n\t\tif ( fn === false ) {\n\t\t\tfn = returnFalse;\n\t\t}\n\t\treturn this.each(function() {\n\t\t\tjQuery.event.remove( this, types, fn, selector );\n\t\t});\n\t},\n\n\ttrigger: function( type, data ) {\n\t\treturn this.each(function() {\n\t\t\tjQuery.event.trigger( type, data, this );\n\t\t});\n\t},\n\ttriggerHandler: function( type, data ) {\n\t\tvar elem = this[0];\n\t\tif ( elem ) {\n\t\t\treturn jQuery.event.trigger( type, data, elem, true );\n\t\t}\n\t}\n});\nvar isSimple = /^.[^:#\\[\\.,]*$/,\n\trparentsprev = /^(?:parents|prev(?:Until|All))/,\n\trneedsContext = jQuery.expr.match.needsContext,\n\t// methods guaranteed to produce a unique set when starting from a unique set\n\tguaranteedUnique = {\n\t\tchildren: true,\n\t\tcontents: true,\n\t\tnext: true,\n\t\tprev: true\n\t};\n\njQuery.fn.extend({\n\tfind: function( selector ) {\n\t\tvar i,\n\t\t\tret = [],\n\t\t\tself = this,\n\t\t\tlen = self.length;\n\n\t\tif ( typeof selector !== \"string\" ) {\n\t\t\treturn this.pushStack( jQuery( selector ).filter(function() {\n\t\t\t\tfor ( i = 0; i < len; i++ ) {\n\t\t\t\t\tif ( jQuery.contains( self[ i ], this ) ) {\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}) );\n\t\t}\n\n\t\tfor ( i = 0; i < len; i++ ) {\n\t\t\tjQuery.find( selector, self[ i ], ret );\n\t\t}\n\n\t\t// Needed because $( selector, context ) becomes $( context ).find( selector )\n\t\tret = this.pushStack( len > 1 ? jQuery.unique( ret ) : ret );\n\t\tret.selector = this.selector ? this.selector + \" \" + selector : selector;\n\t\treturn ret;\n\t},\n\n\thas: function( target ) {\n\t\tvar targets = jQuery( target, this ),\n\t\t\tl = targets.length;\n\n\t\treturn this.filter(function() {\n\t\t\tvar i = 0;\n\t\t\tfor ( ; i < l; i++ ) {\n\t\t\t\tif ( jQuery.contains( this, targets[i] ) ) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t},\n\n\tnot: function( selector ) {\n\t\treturn this.pushStack( winnow(this, selector || [], true) );\n\t},\n\n\tfilter: function( selector ) {\n\t\treturn this.pushStack( winnow(this, selector || [], false) );\n\t},\n\n\tis: function( selector ) {\n\t\treturn !!winnow(\n\t\t\tthis,\n\n\t\t\t// If this is a positional/relative selector, check membership in the returned set\n\t\t\t// so $(\"p:first\").is(\"p:last\") won't return true for a doc with two \"p\".\n\t\t\ttypeof selector === \"string\" && rneedsContext.test( selector ) ?\n\t\t\t\tjQuery( selector ) :\n\t\t\t\tselector || [],\n\t\t\tfalse\n\t\t).length;\n\t},\n\n\tclosest: function( selectors, context ) {\n\t\tvar cur,\n\t\t\ti = 0,\n\t\t\tl = this.length,\n\t\t\tmatched = [],\n\t\t\tpos = ( rneedsContext.test( selectors ) || typeof selectors !== \"string\" ) ?\n\t\t\t\tjQuery( selectors, context || this.context ) :\n\t\t\t\t0;\n\n\t\tfor ( ; i < l; i++ ) {\n\t\t\tfor ( cur = this[i]; cur && cur !== context; cur = cur.parentNode ) {\n\t\t\t\t// Always skip document fragments\n\t\t\t\tif ( cur.nodeType < 11 && (pos ?\n\t\t\t\t\tpos.index(cur) > -1 :\n\n\t\t\t\t\t// Don't pass non-elements to Sizzle\n\t\t\t\t\tcur.nodeType === 1 &&\n\t\t\t\t\t\tjQuery.find.matchesSelector(cur, selectors)) ) {\n\n\t\t\t\t\tcur = matched.push( cur );\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn this.pushStack( matched.length > 1 ? jQuery.unique( matched ) : matched );\n\t},\n\n\t// Determine the position of an element within\n\t// the matched set of elements\n\tindex: function( elem ) {\n\n\t\t// No argument, return index in parent\n\t\tif ( !elem ) {\n\t\t\treturn ( this[ 0 ] && this[ 0 ].parentNode ) ? this.first().prevAll().length : -1;\n\t\t}\n\n\t\t// index in selector\n\t\tif ( typeof elem === \"string\" ) {\n\t\t\treturn core_indexOf.call( jQuery( elem ), this[ 0 ] );\n\t\t}\n\n\t\t// Locate the position of the desired element\n\t\treturn core_indexOf.call( this,\n\n\t\t\t// If it receives a jQuery object, the first element is used\n\t\t\telem.jquery ? elem[ 0 ] : elem\n\t\t);\n\t},\n\n\tadd: function( selector, context ) {\n\t\tvar set = typeof selector === \"string\" ?\n\t\t\t\tjQuery( selector, context ) :\n\t\t\t\tjQuery.makeArray( selector && selector.nodeType ? [ selector ] : selector ),\n\t\t\tall = jQuery.merge( this.get(), set );\n\n\t\treturn this.pushStack( jQuery.unique(all) );\n\t},\n\n\taddBack: function( selector ) {\n\t\treturn this.add( selector == null ?\n\t\t\tthis.prevObject : this.prevObject.filter(selector)\n\t\t);\n\t}\n});\n\nfunction sibling( cur, dir ) {\n\twhile ( (cur = cur[dir]) && cur.nodeType !== 1 ) {}\n\n\treturn cur;\n}\n\njQuery.each({\n\tparent: function( elem ) {\n\t\tvar parent = elem.parentNode;\n\t\treturn parent && parent.nodeType !== 11 ? parent : null;\n\t},\n\tparents: function( elem ) {\n\t\treturn jQuery.dir( elem, \"parentNode\" );\n\t},\n\tparentsUntil: function( elem, i, until ) {\n\t\treturn jQuery.dir( elem, \"parentNode\", until );\n\t},\n\tnext: function( elem ) {\n\t\treturn sibling( elem, \"nextSibling\" );\n\t},\n\tprev: function( elem ) {\n\t\treturn sibling( elem, \"previousSibling\" );\n\t},\n\tnextAll: function( elem ) {\n\t\treturn jQuery.dir( elem, \"nextSibling\" );\n\t},\n\tprevAll: function( elem ) {\n\t\treturn jQuery.dir( elem, \"previousSibling\" );\n\t},\n\tnextUntil: function( elem, i, until ) {\n\t\treturn jQuery.dir( elem, \"nextSibling\", until );\n\t},\n\tprevUntil: function( elem, i, until ) {\n\t\treturn jQuery.dir( elem, \"previousSibling\", until );\n\t},\n\tsiblings: function( elem ) {\n\t\treturn jQuery.sibling( ( elem.parentNode || {} ).firstChild, elem );\n\t},\n\tchildren: function( elem ) {\n\t\treturn jQuery.sibling( elem.firstChild );\n\t},\n\tcontents: function( elem ) {\n\t\treturn elem.contentDocument || jQuery.merge( [], elem.childNodes );\n\t}\n}, function( name, fn ) {\n\tjQuery.fn[ name ] = function( until, selector ) {\n\t\tvar matched = jQuery.map( this, fn, until );\n\n\t\tif ( name.slice( -5 ) !== \"Until\" ) {\n\t\t\tselector = until;\n\t\t}\n\n\t\tif ( selector && typeof selector === \"string\" ) {\n\t\t\tmatched = jQuery.filter( selector, matched );\n\t\t}\n\n\t\tif ( this.length > 1 ) {\n\t\t\t// Remove duplicates\n\t\t\tif ( !guaranteedUnique[ name ] ) {\n\t\t\t\tjQuery.unique( matched );\n\t\t\t}\n\n\t\t\t// Reverse order for parents* and prev-derivatives\n\t\t\tif ( rparentsprev.test( name ) ) {\n\t\t\t\tmatched.reverse();\n\t\t\t}\n\t\t}\n\n\t\treturn this.pushStack( matched );\n\t};\n});\n\njQuery.extend({\n\tfilter: function( expr, elems, not ) {\n\t\tvar elem = elems[ 0 ];\n\n\t\tif ( not ) {\n\t\t\texpr = \":not(\" + expr + \")\";\n\t\t}\n\n\t\treturn elems.length === 1 && elem.nodeType === 1 ?\n\t\t\tjQuery.find.matchesSelector( elem, expr ) ? [ elem ] : [] :\n\t\t\tjQuery.find.matches( expr, jQuery.grep( elems, function( elem ) {\n\t\t\t\treturn elem.nodeType === 1;\n\t\t\t}));\n\t},\n\n\tdir: function( elem, dir, until ) {\n\t\tvar matched = [],\n\t\t\ttruncate = until !== undefined;\n\n\t\twhile ( (elem = elem[ dir ]) && elem.nodeType !== 9 ) {\n\t\t\tif ( elem.nodeType === 1 ) {\n\t\t\t\tif ( truncate && jQuery( elem ).is( until ) ) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tmatched.push( elem );\n\t\t\t}\n\t\t}\n\t\treturn matched;\n\t},\n\n\tsibling: function( n, elem ) {\n\t\tvar matched = [];\n\n\t\tfor ( ; n; n = n.nextSibling ) {\n\t\t\tif ( n.nodeType === 1 && n !== elem ) {\n\t\t\t\tmatched.push( n );\n\t\t\t}\n\t\t}\n\n\t\treturn matched;\n\t}\n});\n\n// Implement the identical functionality for filter and not\nfunction winnow( elements, qualifier, not ) {\n\tif ( jQuery.isFunction( qualifier ) ) {\n\t\treturn jQuery.grep( elements, function( elem, i ) {\n\t\t\t/* jshint -W018 */\n\t\t\treturn !!qualifier.call( elem, i, elem ) !== not;\n\t\t});\n\n\t}\n\n\tif ( qualifier.nodeType ) {\n\t\treturn jQuery.grep( elements, function( elem ) {\n\t\t\treturn ( elem === qualifier ) !== not;\n\t\t});\n\n\t}\n\n\tif ( typeof qualifier === \"string\" ) {\n\t\tif ( isSimple.test( qualifier ) ) {\n\t\t\treturn jQuery.filter( qualifier, elements, not );\n\t\t}\n\n\t\tqualifier = jQuery.filter( qualifier, elements );\n\t}\n\n\treturn jQuery.grep( elements, function( elem ) {\n\t\treturn ( core_indexOf.call( qualifier, elem ) >= 0 ) !== not;\n\t});\n}\nvar rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\\w:]+)[^>]*)\\/>/gi,\n\trtagName = /<([\\w:]+)/,\n\trhtml = /<|&#?\\w+;/,\n\trnoInnerhtml = /<(?:script|style|link)/i,\n\tmanipulation_rcheckableType = /^(?:checkbox|radio)$/i,\n\t// checked=\"checked\" or checked\n\trchecked = /checked\\s*(?:[^=]|=\\s*.checked.)/i,\n\trscriptType = /^$|\\/(?:java|ecma)script/i,\n\trscriptTypeMasked = /^true\\/(.*)/,\n\trcleanScript = /^\\s*<!(?:\\[CDATA\\[|--)|(?:\\]\\]|--)>\\s*$/g,\n\n\t// We have to close these tags to support XHTML (#13200)\n\twrapMap = {\n\n\t\t// Support: IE 9\n\t\toption: [ 1, \"<select multiple='multiple'>\", \"</select>\" ],\n\n\t\tthead: [ 1, \"<table>\", \"</table>\" ],\n\t\tcol: [ 2, \"<table><colgroup>\", \"</colgroup></table>\" ],\n\t\ttr: [ 2, \"<table><tbody>\", \"</tbody></table>\" ],\n\t\ttd: [ 3, \"<table><tbody><tr>\", \"</tr></tbody></table>\" ],\n\n\t\t_default: [ 0, \"\", \"\" ]\n\t};\n\n// Support: IE 9\nwrapMap.optgroup = wrapMap.option;\n\nwrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead;\nwrapMap.th = wrapMap.td;\n\njQuery.fn.extend({\n\ttext: function( value ) {\n\t\treturn jQuery.access( this, function( value ) {\n\t\t\treturn value === undefined ?\n\t\t\t\tjQuery.text( this ) :\n\t\t\t\tthis.empty().append( ( this[ 0 ] && this[ 0 ].ownerDocument || document ).createTextNode( value ) );\n\t\t}, null, value, arguments.length );\n\t},\n\n\tappend: function() {\n\t\treturn this.domManip( arguments, function( elem ) {\n\t\t\tif ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {\n\t\t\t\tvar target = manipulationTarget( this, elem );\n\t\t\t\ttarget.appendChild( elem );\n\t\t\t}\n\t\t});\n\t},\n\n\tprepend: function() {\n\t\treturn this.domManip( arguments, function( elem ) {\n\t\t\tif ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {\n\t\t\t\tvar target = manipulationTarget( this, elem );\n\t\t\t\ttarget.insertBefore( elem, target.firstChild );\n\t\t\t}\n\t\t});\n\t},\n\n\tbefore: function() {\n\t\treturn this.domManip( arguments, function( elem ) {\n\t\t\tif ( this.parentNode ) {\n\t\t\t\tthis.parentNode.insertBefore( elem, this );\n\t\t\t}\n\t\t});\n\t},\n\n\tafter: function() {\n\t\treturn this.domManip( arguments, function( elem ) {\n\t\t\tif ( this.parentNode ) {\n\t\t\t\tthis.parentNode.insertBefore( elem, this.nextSibling );\n\t\t\t}\n\t\t});\n\t},\n\n\t// keepData is for internal use only--do not document\n\tremove: function( selector, keepData ) {\n\t\tvar elem,\n\t\t\telems = selector ? jQuery.filter( selector, this ) : this,\n\t\t\ti = 0;\n\n\t\tfor ( ; (elem = elems[i]) != null; i++ ) {\n\t\t\tif ( !keepData && elem.nodeType === 1 ) {\n\t\t\t\tjQuery.cleanData( getAll( elem ) );\n\t\t\t}\n\n\t\t\tif ( elem.parentNode ) {\n\t\t\t\tif ( keepData && jQuery.contains( elem.ownerDocument, elem ) ) {\n\t\t\t\t\tsetGlobalEval( getAll( elem, \"script\" ) );\n\t\t\t\t}\n\t\t\t\telem.parentNode.removeChild( elem );\n\t\t\t}\n\t\t}\n\n\t\treturn this;\n\t},\n\n\tempty: function() {\n\t\tvar elem,\n\t\t\ti = 0;\n\n\t\tfor ( ; (elem = this[i]) != null; i++ ) {\n\t\t\tif ( elem.nodeType === 1 ) {\n\n\t\t\t\t// Prevent memory leaks\n\t\t\t\tjQuery.cleanData( getAll( elem, false ) );\n\n\t\t\t\t// Remove any remaining nodes\n\t\t\t\telem.textContent = \"\";\n\t\t\t}\n\t\t}\n\n\t\treturn this;\n\t},\n\n\tclone: function( dataAndEvents, deepDataAndEvents ) {\n\t\tdataAndEvents = dataAndEvents == null ? false : dataAndEvents;\n\t\tdeepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents;\n\n\t\treturn this.map( function () {\n\t\t\treturn jQuery.clone( this, dataAndEvents, deepDataAndEvents );\n\t\t});\n\t},\n\n\thtml: function( value ) {\n\t\treturn jQuery.access( this, function( value ) {\n\t\t\tvar elem = this[ 0 ] || {},\n\t\t\t\ti = 0,\n\t\t\t\tl = this.length;\n\n\t\t\tif ( value === undefined && elem.nodeType === 1 ) {\n\t\t\t\treturn elem.innerHTML;\n\t\t\t}\n\n\t\t\t// See if we can take a shortcut and just use innerHTML\n\t\t\tif ( typeof value === \"string\" && !rnoInnerhtml.test( value ) &&\n\t\t\t\t!wrapMap[ ( rtagName.exec( value ) || [ \"\", \"\" ] )[ 1 ].toLowerCase() ] ) {\n\n\t\t\t\tvalue = value.replace( rxhtmlTag, \"<$1></$2>\" );\n\n\t\t\t\ttry {\n\t\t\t\t\tfor ( ; i < l; i++ ) {\n\t\t\t\t\t\telem = this[ i ] || {};\n\n\t\t\t\t\t\t// Remove element nodes and prevent memory leaks\n\t\t\t\t\t\tif ( elem.nodeType === 1 ) {\n\t\t\t\t\t\t\tjQuery.cleanData( getAll( elem, false ) );\n\t\t\t\t\t\t\telem.innerHTML = value;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\telem = 0;\n\n\t\t\t\t// If using innerHTML throws an exception, use the fallback method\n\t\t\t\t} catch( e ) {}\n\t\t\t}\n\n\t\t\tif ( elem ) {\n\t\t\t\tthis.empty().append( value );\n\t\t\t}\n\t\t}, null, value, arguments.length );\n\t},\n\n\treplaceWith: function() {\n\t\tvar\n\t\t\t// Snapshot the DOM in case .domManip sweeps something relevant into its fragment\n\t\t\targs = jQuery.map( this, function( elem ) {\n\t\t\t\treturn [ elem.nextSibling, elem.parentNode ];\n\t\t\t}),\n\t\t\ti = 0;\n\n\t\t// Make the changes, replacing each context element with the new content\n\t\tthis.domManip( arguments, function( elem ) {\n\t\t\tvar next = args[ i++ ],\n\t\t\t\tparent = args[ i++ ];\n\n\t\t\tif ( parent ) {\n\t\t\t\t// Don't use the snapshot next if it has moved (#13810)\n\t\t\t\tif ( next && next.parentNode !== parent ) {\n\t\t\t\t\tnext = this.nextSibling;\n\t\t\t\t}\n\t\t\t\tjQuery( this ).remove();\n\t\t\t\tparent.insertBefore( elem, next );\n\t\t\t}\n\t\t// Allow new content to include elements from the context set\n\t\t}, true );\n\n\t\t// Force removal if there was no new content (e.g., from empty arguments)\n\t\treturn i ? this : this.remove();\n\t},\n\n\tdetach: function( selector ) {\n\t\treturn this.remove( selector, true );\n\t},\n\n\tdomManip: function( args, callback, allowIntersection ) {\n\n\t\t// Flatten any nested arrays\n\t\targs = core_concat.apply( [], args );\n\n\t\tvar fragment, first, scripts, hasScripts, node, doc,\n\t\t\ti = 0,\n\t\t\tl = this.length,\n\t\t\tset = this,\n\t\t\tiNoClone = l - 1,\n\t\t\tvalue = args[ 0 ],\n\t\t\tisFunction = jQuery.isFunction( value );\n\n\t\t// We can't cloneNode fragments that contain checked, in WebKit\n\t\tif ( isFunction || !( l <= 1 || typeof value !== \"string\" || jQuery.support.checkClone || !rchecked.test( value ) ) ) {\n\t\t\treturn this.each(function( index ) {\n\t\t\t\tvar self = set.eq( index );\n\t\t\t\tif ( isFunction ) {\n\t\t\t\t\targs[ 0 ] = value.call( this, index, self.html() );\n\t\t\t\t}\n\t\t\t\tself.domManip( args, callback, allowIntersection );\n\t\t\t});\n\t\t}\n\n\t\tif ( l ) {\n\t\t\tfragment = jQuery.buildFragment( args, this[ 0 ].ownerDocument, false, !allowIntersection && this );\n\t\t\tfirst = fragment.firstChild;\n\n\t\t\tif ( fragment.childNodes.length === 1 ) {\n\t\t\t\tfragment = first;\n\t\t\t}\n\n\t\t\tif ( first ) {\n\t\t\t\tscripts = jQuery.map( getAll( fragment, \"script\" ), disableScript );\n\t\t\t\thasScripts = scripts.length;\n\n\t\t\t\t// Use the original fragment for the last item instead of the first because it can end up\n\t\t\t\t// being emptied incorrectly in certain situations (#8070).\n\t\t\t\tfor ( ; i < l; i++ ) {\n\t\t\t\t\tnode = fragment;\n\n\t\t\t\t\tif ( i !== iNoClone ) {\n\t\t\t\t\t\tnode = jQuery.clone( node, true, true );\n\n\t\t\t\t\t\t// Keep references to cloned scripts for later restoration\n\t\t\t\t\t\tif ( hasScripts ) {\n\t\t\t\t\t\t\t// Support: QtWebKit\n\t\t\t\t\t\t\t// jQuery.merge because core_push.apply(_, arraylike) throws\n\t\t\t\t\t\t\tjQuery.merge( scripts, getAll( node, \"script\" ) );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tcallback.call( this[ i ], node, i );\n\t\t\t\t}\n\n\t\t\t\tif ( hasScripts ) {\n\t\t\t\t\tdoc = scripts[ scripts.length - 1 ].ownerDocument;\n\n\t\t\t\t\t// Reenable scripts\n\t\t\t\t\tjQuery.map( scripts, restoreScript );\n\n\t\t\t\t\t// Evaluate executable scripts on first document insertion\n\t\t\t\t\tfor ( i = 0; i < hasScripts; i++ ) {\n\t\t\t\t\t\tnode = scripts[ i ];\n\t\t\t\t\t\tif ( rscriptType.test( node.type || \"\" ) &&\n\t\t\t\t\t\t\t!data_priv.access( node, \"globalEval\" ) && jQuery.contains( doc, node ) ) {\n\n\t\t\t\t\t\t\tif ( node.src ) {\n\t\t\t\t\t\t\t\t// Hope ajax is available...\n\t\t\t\t\t\t\t\tjQuery._evalUrl( node.src );\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tjQuery.globalEval( node.textContent.replace( rcleanScript, \"\" ) );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn this;\n\t}\n});\n\njQuery.each({\n\tappendTo: \"append\",\n\tprependTo: \"prepend\",\n\tinsertBefore: \"before\",\n\tinsertAfter: \"after\",\n\treplaceAll: \"replaceWith\"\n}, function( name, original ) {\n\tjQuery.fn[ name ] = function( selector ) {\n\t\tvar elems,\n\t\t\tret = [],\n\t\t\tinsert = jQuery( selector ),\n\t\t\tlast = insert.length - 1,\n\t\t\ti = 0;\n\n\t\tfor ( ; i <= last; i++ ) {\n\t\t\telems = i === last ? this : this.clone( true );\n\t\t\tjQuery( insert[ i ] )[ original ]( elems );\n\n\t\t\t// Support: QtWebKit\n\t\t\t// .get() because core_push.apply(_, arraylike) throws\n\t\t\tcore_push.apply( ret, elems.get() );\n\t\t}\n\n\t\treturn this.pushStack( ret );\n\t};\n});\n\njQuery.extend({\n\tclone: function( elem, dataAndEvents, deepDataAndEvents ) {\n\t\tvar i, l, srcElements, destElements,\n\t\t\tclone = elem.cloneNode( true ),\n\t\t\tinPage = jQuery.contains( elem.ownerDocument, elem );\n\n\t\t// Support: IE >= 9\n\t\t// Fix Cloning issues\n\t\tif ( !jQuery.support.noCloneChecked && ( elem.nodeType === 1 || elem.nodeType === 11 ) && !jQuery.isXMLDoc( elem ) ) {\n\n\t\t\t// We eschew Sizzle here for performance reasons: http://jsperf.com/getall-vs-sizzle/2\n\t\t\tdestElements = getAll( clone );\n\t\t\tsrcElements = getAll( elem );\n\n\t\t\tfor ( i = 0, l = srcElements.length; i < l; i++ ) {\n\t\t\t\tfixInput( srcElements[ i ], destElements[ i ] );\n\t\t\t}\n\t\t}\n\n\t\t// Copy the events from the original to the clone\n\t\tif ( dataAndEvents ) {\n\t\t\tif ( deepDataAndEvents ) {\n\t\t\t\tsrcElements = srcElements || getAll( elem );\n\t\t\t\tdestElements = destElements || getAll( clone );\n\n\t\t\t\tfor ( i = 0, l = srcElements.length; i < l; i++ ) {\n\t\t\t\t\tcloneCopyEvent( srcElements[ i ], destElements[ i ] );\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tcloneCopyEvent( elem, clone );\n\t\t\t}\n\t\t}\n\n\t\t// Preserve script evaluation history\n\t\tdestElements = getAll( clone, \"script\" );\n\t\tif ( destElements.length > 0 ) {\n\t\t\tsetGlobalEval( destElements, !inPage && getAll( elem, \"script\" ) );\n\t\t}\n\n\t\t// Return the cloned set\n\t\treturn clone;\n\t},\n\n\tbuildFragment: function( elems, context, scripts, selection ) {\n\t\tvar elem, tmp, tag, wrap, contains, j,\n\t\t\ti = 0,\n\t\t\tl = elems.length,\n\t\t\tfragment = context.createDocumentFragment(),\n\t\t\tnodes = [];\n\n\t\tfor ( ; i < l; i++ ) {\n\t\t\telem = elems[ i ];\n\n\t\t\tif ( elem || elem === 0 ) {\n\n\t\t\t\t// Add nodes directly\n\t\t\t\tif ( jQuery.type( elem ) === \"object\" ) {\n\t\t\t\t\t// Support: QtWebKit\n\t\t\t\t\t// jQuery.merge because core_push.apply(_, arraylike) throws\n\t\t\t\t\tjQuery.merge( nodes, elem.nodeType ? [ elem ] : elem );\n\n\t\t\t\t// Convert non-html into a text node\n\t\t\t\t} else if ( !rhtml.test( elem ) ) {\n\t\t\t\t\tnodes.push( context.createTextNode( elem ) );\n\n\t\t\t\t// Convert html into DOM nodes\n\t\t\t\t} else {\n\t\t\t\t\ttmp = tmp || fragment.appendChild( context.createElement(\"div\") );\n\n\t\t\t\t\t// Deserialize a standard representation\n\t\t\t\t\ttag = ( rtagName.exec( elem ) || [\"\", \"\"] )[ 1 ].toLowerCase();\n\t\t\t\t\twrap = wrapMap[ tag ] || wrapMap._default;\n\t\t\t\t\ttmp.innerHTML = wrap[ 1 ] + elem.replace( rxhtmlTag, \"<$1></$2>\" ) + wrap[ 2 ];\n\n\t\t\t\t\t// Descend through wrappers to the right content\n\t\t\t\t\tj = wrap[ 0 ];\n\t\t\t\t\twhile ( j-- ) {\n\t\t\t\t\t\ttmp = tmp.lastChild;\n\t\t\t\t\t}\n\n\t\t\t\t\t// Support: QtWebKit\n\t\t\t\t\t// jQuery.merge because core_push.apply(_, arraylike) throws\n\t\t\t\t\tjQuery.merge( nodes, tmp.childNodes );\n\n\t\t\t\t\t// Remember the top-level container\n\t\t\t\t\ttmp = fragment.firstChild;\n\n\t\t\t\t\t// Fixes #12346\n\t\t\t\t\t// Support: Webkit, IE\n\t\t\t\t\ttmp.textContent = \"\";\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Remove wrapper from fragment\n\t\tfragment.textContent = \"\";\n\n\t\ti = 0;\n\t\twhile ( (elem = nodes[ i++ ]) ) {\n\n\t\t\t// #4087 - If origin and destination elements are the same, and this is\n\t\t\t// that element, do not do anything\n\t\t\tif ( selection && jQuery.inArray( elem, selection ) !== -1 ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tcontains = jQuery.contains( elem.ownerDocument, elem );\n\n\t\t\t// Append to fragment\n\t\t\ttmp = getAll( fragment.appendChild( elem ), \"script\" );\n\n\t\t\t// Preserve script evaluation history\n\t\t\tif ( contains ) {\n\t\t\t\tsetGlobalEval( tmp );\n\t\t\t}\n\n\t\t\t// Capture executables\n\t\t\tif ( scripts ) {\n\t\t\t\tj = 0;\n\t\t\t\twhile ( (elem = tmp[ j++ ]) ) {\n\t\t\t\t\tif ( rscriptType.test( elem.type || \"\" ) ) {\n\t\t\t\t\t\tscripts.push( elem );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn fragment;\n\t},\n\n\tcleanData: function( elems ) {\n\t\tvar data, elem, events, type, key, j,\n\t\t\tspecial = jQuery.event.special,\n\t\t\ti = 0;\n\n\t\tfor ( ; (elem = elems[ i ]) !== undefined; i++ ) {\n\t\t\tif ( Data.accepts( elem ) ) {\n\t\t\t\tkey = elem[ data_priv.expando ];\n\n\t\t\t\tif ( key && (data = data_priv.cache[ key ]) ) {\n\t\t\t\t\tevents = Object.keys( data.events || {} );\n\t\t\t\t\tif ( events.length ) {\n\t\t\t\t\t\tfor ( j = 0; (type = events[j]) !== undefined; j++ ) {\n\t\t\t\t\t\t\tif ( special[ type ] ) {\n\t\t\t\t\t\t\t\tjQuery.event.remove( elem, type );\n\n\t\t\t\t\t\t\t// This is a shortcut to avoid jQuery.event.remove's overhead\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tjQuery.removeEvent( elem, type, data.handle );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif ( data_priv.cache[ key ] ) {\n\t\t\t\t\t\t// Discard any remaining `private` data\n\t\t\t\t\t\tdelete data_priv.cache[ key ];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Discard any remaining `user` data\n\t\t\tdelete data_user.cache[ elem[ data_user.expando ] ];\n\t\t}\n\t},\n\n\t_evalUrl: function( url ) {\n\t\treturn jQuery.ajax({\n\t\t\turl: url,\n\t\t\ttype: \"GET\",\n\t\t\tdataType: \"script\",\n\t\t\tasync: false,\n\t\t\tglobal: false,\n\t\t\t\"throws\": true\n\t\t});\n\t}\n});\n\n// Support: 1.x compatibility\n// Manipulating tables requires a tbody\nfunction manipulationTarget( elem, content ) {\n\treturn jQuery.nodeName( elem, \"table\" ) &&\n\t\tjQuery.nodeName( content.nodeType === 1 ? content : content.firstChild, \"tr\" ) ?\n\n\t\telem.getElementsByTagName(\"tbody\")[0] ||\n\t\t\telem.appendChild( elem.ownerDocument.createElement(\"tbody\") ) :\n\t\telem;\n}\n\n// Replace/restore the type attribute of script elements for safe DOM manipulation\nfunction disableScript( elem ) {\n\telem.type = (elem.getAttribute(\"type\") !== null) + \"/\" + elem.type;\n\treturn elem;\n}\nfunction restoreScript( elem ) {\n\tvar match = rscriptTypeMasked.exec( elem.type );\n\n\tif ( match ) {\n\t\telem.type = match[ 1 ];\n\t} else {\n\t\telem.removeAttribute(\"type\");\n\t}\n\n\treturn elem;\n}\n\n// Mark scripts as having already been evaluated\nfunction setGlobalEval( elems, refElements ) {\n\tvar l = elems.length,\n\t\ti = 0;\n\n\tfor ( ; i < l; i++ ) {\n\t\tdata_priv.set(\n\t\t\telems[ i ], \"globalEval\", !refElements || data_priv.get( refElements[ i ], \"globalEval\" )\n\t\t);\n\t}\n}\n\nfunction cloneCopyEvent( src, dest ) {\n\tvar i, l, type, pdataOld, pdataCur, udataOld, udataCur, events;\n\n\tif ( dest.nodeType !== 1 ) {\n\t\treturn;\n\t}\n\n\t// 1. Copy private data: events, handlers, etc.\n\tif ( data_priv.hasData( src ) ) {\n\t\tpdataOld = data_priv.access( src );\n\t\tpdataCur = data_priv.set( dest, pdataOld );\n\t\tevents = pdataOld.events;\n\n\t\tif ( events ) {\n\t\t\tdelete pdataCur.handle;\n\t\t\tpdataCur.events = {};\n\n\t\t\tfor ( type in events ) {\n\t\t\t\tfor ( i = 0, l = events[ type ].length; i < l; i++ ) {\n\t\t\t\t\tjQuery.event.add( dest, type, events[ type ][ i ] );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t// 2. Copy user data\n\tif ( data_user.hasData( src ) ) {\n\t\tudataOld = data_user.access( src );\n\t\tudataCur = jQuery.extend( {}, udataOld );\n\n\t\tdata_user.set( dest, udataCur );\n\t}\n}\n\n\nfunction getAll( context, tag ) {\n\tvar ret = context.getElementsByTagName ? context.getElementsByTagName( tag || \"*\" ) :\n\t\t\tcontext.querySelectorAll ? context.querySelectorAll( tag || \"*\" ) :\n\t\t\t[];\n\n\treturn tag === undefined || tag && jQuery.nodeName( context, tag ) ?\n\t\tjQuery.merge( [ context ], ret ) :\n\t\tret;\n}\n\n// Support: IE >= 9\nfunction fixInput( src, dest ) {\n\tvar nodeName = dest.nodeName.toLowerCase();\n\n\t// Fails to persist the checked state of a cloned checkbox or radio button.\n\tif ( nodeName === \"input\" && manipulation_rcheckableType.test( src.type ) ) {\n\t\tdest.checked = src.checked;\n\n\t// Fails to return the selected option to the default selected state when cloning options\n\t} else if ( nodeName === \"input\" || nodeName === \"textarea\" ) {\n\t\tdest.defaultValue = src.defaultValue;\n\t}\n}\njQuery.fn.extend({\n\twrapAll: function( html ) {\n\t\tvar wrap;\n\n\t\tif ( jQuery.isFunction( html ) ) {\n\t\t\treturn this.each(function( i ) {\n\t\t\t\tjQuery( this ).wrapAll( html.call(this, i) );\n\t\t\t});\n\t\t}\n\n\t\tif ( this[ 0 ] ) {\n\n\t\t\t// The elements to wrap the target around\n\t\t\twrap = jQuery( html, this[ 0 ].ownerDocument ).eq( 0 ).clone( true );\n\n\t\t\tif ( this[ 0 ].parentNode ) {\n\t\t\t\twrap.insertBefore( this[ 0 ] );\n\t\t\t}\n\n\t\t\twrap.map(function() {\n\t\t\t\tvar elem = this;\n\n\t\t\t\twhile ( elem.firstElementChild ) {\n\t\t\t\t\telem = elem.firstElementChild;\n\t\t\t\t}\n\n\t\t\t\treturn elem;\n\t\t\t}).append( this );\n\t\t}\n\n\t\treturn this;\n\t},\n\n\twrapInner: function( html ) {\n\t\tif ( jQuery.isFunction( html ) ) {\n\t\t\treturn this.each(function( i ) {\n\t\t\t\tjQuery( this ).wrapInner( html.call(this, i) );\n\t\t\t});\n\t\t}\n\n\t\treturn this.each(function() {\n\t\t\tvar self = jQuery( this ),\n\t\t\t\tcontents = self.contents();\n\n\t\t\tif ( contents.length ) {\n\t\t\t\tcontents.wrapAll( html );\n\n\t\t\t} else {\n\t\t\t\tself.append( html );\n\t\t\t}\n\t\t});\n\t},\n\n\twrap: function( html ) {\n\t\tvar isFunction = jQuery.isFunction( html );\n\n\t\treturn this.each(function( i ) {\n\t\t\tjQuery( this ).wrapAll( isFunction ? html.call(this, i) : html );\n\t\t});\n\t},\n\n\tunwrap: function() {\n\t\treturn this.parent().each(function() {\n\t\t\tif ( !jQuery.nodeName( this, \"body\" ) ) {\n\t\t\t\tjQuery( this ).replaceWith( this.childNodes );\n\t\t\t}\n\t\t}).end();\n\t}\n});\nvar curCSS, iframe,\n\t// swappable if display is none or starts with table except \"table\", \"table-cell\", or \"table-caption\"\n\t// see here for display values: https://developer.mozilla.org/en-US/docs/CSS/display\n\trdisplayswap = /^(none|table(?!-c[ea]).+)/,\n\trmargin = /^margin/,\n\trnumsplit = new RegExp( \"^(\" + core_pnum + \")(.*)$\", \"i\" ),\n\trnumnonpx = new RegExp( \"^(\" + core_pnum + \")(?!px)[a-z%]+$\", \"i\" ),\n\trrelNum = new RegExp( \"^([+-])=(\" + core_pnum + \")\", \"i\" ),\n\telemdisplay = { BODY: \"block\" },\n\n\tcssShow = { position: \"absolute\", visibility: \"hidden\", display: \"block\" },\n\tcssNormalTransform = {\n\t\tletterSpacing: 0,\n\t\tfontWeight: 400\n\t},\n\n\tcssExpand = [ \"Top\", \"Right\", \"Bottom\", \"Left\" ],\n\tcssPrefixes = [ \"Webkit\", \"O\", \"Moz\", \"ms\" ];\n\n// return a css property mapped to a potentially vendor prefixed property\nfunction vendorPropName( style, name ) {\n\n\t// shortcut for names that are not vendor prefixed\n\tif ( name in style ) {\n\t\treturn name;\n\t}\n\n\t// check for vendor prefixed names\n\tvar capName = name.charAt(0).toUpperCase() + name.slice(1),\n\t\torigName = name,\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in style ) {\n\t\t\treturn name;\n\t\t}\n\t}\n\n\treturn origName;\n}\n\nfunction isHidden( elem, el ) {\n\t// isHidden might be called from jQuery#filter function;\n\t// in that case, element will be second argument\n\telem = el || elem;\n\treturn jQuery.css( elem, \"display\" ) === \"none\" || !jQuery.contains( elem.ownerDocument, elem );\n}\n\n// NOTE: we've included the \"window\" in window.getComputedStyle\n// because jsdom on node.js will break without it.\nfunction getStyles( elem ) {\n\treturn window.getComputedStyle( elem, null );\n}\n\nfunction showHide( elements, show ) {\n\tvar display, elem, hidden,\n\t\tvalues = [],\n\t\tindex = 0,\n\t\tlength = elements.length;\n\n\tfor ( ; index < length; index++ ) {\n\t\telem = elements[ index ];\n\t\tif ( !elem.style ) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tvalues[ index ] = data_priv.get( elem, \"olddisplay\" );\n\t\tdisplay = elem.style.display;\n\t\tif ( show ) {\n\t\t\t// Reset the inline display of this element to learn if it is\n\t\t\t// being hidden by cascaded rules or not\n\t\t\tif ( !values[ index ] && display === \"none\" ) {\n\t\t\t\telem.style.display = \"\";\n\t\t\t}\n\n\t\t\t// Set elements which have been overridden with display: none\n\t\t\t// in a stylesheet to whatever the default browser style is\n\t\t\t// for such an element\n\t\t\tif ( elem.style.display === \"\" && isHidden( elem ) ) {\n\t\t\t\tvalues[ index ] = data_priv.access( elem, \"olddisplay\", css_defaultDisplay(elem.nodeName) );\n\t\t\t}\n\t\t} else {\n\n\t\t\tif ( !values[ index ] ) {\n\t\t\t\thidden = isHidden( elem );\n\n\t\t\t\tif ( display && display !== \"none\" || !hidden ) {\n\t\t\t\t\tdata_priv.set( elem, \"olddisplay\", hidden ? display : jQuery.css(elem, \"display\") );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t// Set the display of most of the elements in a second loop\n\t// to avoid the constant reflow\n\tfor ( index = 0; index < length; index++ ) {\n\t\telem = elements[ index ];\n\t\tif ( !elem.style ) {\n\t\t\tcontinue;\n\t\t}\n\t\tif ( !show || elem.style.display === \"none\" || elem.style.display === \"\" ) {\n\t\t\telem.style.display = show ? values[ index ] || \"\" : \"none\";\n\t\t}\n\t}\n\n\treturn elements;\n}\n\njQuery.fn.extend({\n\tcss: function( name, value ) {\n\t\treturn jQuery.access( this, function( elem, name, value ) {\n\t\t\tvar styles, len,\n\t\t\t\tmap = {},\n\t\t\t\ti = 0;\n\n\t\t\tif ( jQuery.isArray( name ) ) {\n\t\t\t\tstyles = getStyles( elem );\n\t\t\t\tlen = name.length;\n\n\t\t\t\tfor ( ; i < len; i++ ) {\n\t\t\t\t\tmap[ name[ i ] ] = jQuery.css( elem, name[ i ], false, styles );\n\t\t\t\t}\n\n\t\t\t\treturn map;\n\t\t\t}\n\n\t\t\treturn value !== undefined ?\n\t\t\t\tjQuery.style( elem, name, value ) :\n\t\t\t\tjQuery.css( elem, name );\n\t\t}, name, value, arguments.length > 1 );\n\t},\n\tshow: function() {\n\t\treturn showHide( this, true );\n\t},\n\thide: function() {\n\t\treturn showHide( this );\n\t},\n\ttoggle: function( state ) {\n\t\tif ( typeof state === \"boolean\" ) {\n\t\t\treturn state ? this.show() : this.hide();\n\t\t}\n\n\t\treturn this.each(function() {\n\t\t\tif ( isHidden( this ) ) {\n\t\t\t\tjQuery( this ).show();\n\t\t\t} else {\n\t\t\t\tjQuery( this ).hide();\n\t\t\t}\n\t\t});\n\t}\n});\n\njQuery.extend({\n\t// Add in style property hooks for overriding the default\n\t// behavior of getting and setting a style property\n\tcssHooks: {\n\t\topacity: {\n\t\t\tget: function( elem, computed ) {\n\t\t\t\tif ( computed ) {\n\t\t\t\t\t// We should always get a number back from opacity\n\t\t\t\t\tvar ret = curCSS( elem, \"opacity\" );\n\t\t\t\t\treturn ret === \"\" ? \"1\" : ret;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t},\n\n\t// Don't automatically add \"px\" to these possibly-unitless properties\n\tcssNumber: {\n\t\t\"columnCount\": true,\n\t\t\"fillOpacity\": true,\n\t\t\"fontWeight\": true,\n\t\t\"lineHeight\": true,\n\t\t\"opacity\": true,\n\t\t\"order\": true,\n\t\t\"orphans\": true,\n\t\t\"widows\": true,\n\t\t\"zIndex\": true,\n\t\t\"zoom\": true\n\t},\n\n\t// Add in properties whose names you wish to fix before\n\t// setting or getting the value\n\tcssProps: {\n\t\t// normalize float css property\n\t\t\"float\": \"cssFloat\"\n\t},\n\n\t// Get and set the style property on a DOM Node\n\tstyle: function( elem, name, value, extra ) {\n\t\t// Don't set styles on text and comment nodes\n\t\tif ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Make sure that we're working with the right name\n\t\tvar ret, type, hooks,\n\t\t\torigName = jQuery.camelCase( name ),\n\t\t\tstyle = elem.style;\n\n\t\tname = jQuery.cssProps[ origName ] || ( jQuery.cssProps[ origName ] = vendorPropName( style, origName ) );\n\n\t\t// gets hook for the prefixed version\n\t\t// followed by the unprefixed version\n\t\thooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ];\n\n\t\t// Check if we're setting a value\n\t\tif ( value !== undefined ) {\n\t\t\ttype = typeof value;\n\n\t\t\t// convert relative number strings (+= or -=) to relative numbers. #7345\n\t\t\tif ( type === \"string\" && (ret = rrelNum.exec( value )) ) {\n\t\t\t\tvalue = ( ret[1] + 1 ) * ret[2] + parseFloat( jQuery.css( elem, name ) );\n\t\t\t\t// Fixes bug #9237\n\t\t\t\ttype = \"number\";\n\t\t\t}\n\n\t\t\t// Make sure that NaN and null values aren't set. See: #7116\n\t\t\tif ( value == null || type === \"number\" && isNaN( value ) ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// If a number was passed in, add 'px' to the (except for certain CSS properties)\n\t\t\tif ( type === \"number\" && !jQuery.cssNumber[ origName ] ) {\n\t\t\t\tvalue += \"px\";\n\t\t\t}\n\n\t\t\t// Fixes #8908, it can be done more correctly by specifying setters in cssHooks,\n\t\t\t// but it would mean to define eight (for every problematic property) identical functions\n\t\t\tif ( !jQuery.support.clearCloneStyle && value === \"\" && name.indexOf(\"background\") === 0 ) {\n\t\t\t\tstyle[ name ] = \"inherit\";\n\t\t\t}\n\n\t\t\t// If a hook was provided, use that value, otherwise just set the specified value\n\t\t\tif ( !hooks || !(\"set\" in hooks) || (value = hooks.set( elem, value, extra )) !== undefined ) {\n\t\t\t\tstyle[ name ] = value;\n\t\t\t}\n\n\t\t} else {\n\t\t\t// If a hook was provided get the non-computed value from there\n\t\t\tif ( hooks && \"get\" in hooks && (ret = hooks.get( elem, false, extra )) !== undefined ) {\n\t\t\t\treturn ret;\n\t\t\t}\n\n\t\t\t// Otherwise just get the value from the style object\n\t\t\treturn style[ name ];\n\t\t}\n\t},\n\n\tcss: function( elem, name, extra, styles ) {\n\t\tvar val, num, hooks,\n\t\t\torigName = jQuery.camelCase( name );\n\n\t\t// Make sure that we're working with the right name\n\t\tname = jQuery.cssProps[ origName ] || ( jQuery.cssProps[ origName ] = vendorPropName( elem.style, origName ) );\n\n\t\t// gets hook for the prefixed version\n\t\t// followed by the unprefixed version\n\t\thooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ];\n\n\t\t// If a hook was provided get the computed value from there\n\t\tif ( hooks && \"get\" in hooks ) {\n\t\t\tval = hooks.get( elem, true, extra );\n\t\t}\n\n\t\t// Otherwise, if a way to get the computed value exists, use that\n\t\tif ( val === undefined ) {\n\t\t\tval = curCSS( elem, name, styles );\n\t\t}\n\n\t\t//convert \"normal\" to computed value\n\t\tif ( val === \"normal\" && name in cssNormalTransform ) {\n\t\t\tval = cssNormalTransform[ name ];\n\t\t}\n\n\t\t// Return, converting to number if forced or a qualifier was provided and val looks numeric\n\t\tif ( extra === \"\" || extra ) {\n\t\t\tnum = parseFloat( val );\n\t\t\treturn extra === true || jQuery.isNumeric( num ) ? num || 0 : val;\n\t\t}\n\t\treturn val;\n\t}\n});\n\ncurCSS = function( elem, name, _computed ) {\n\tvar width, minWidth, maxWidth,\n\t\tcomputed = _computed || getStyles( elem ),\n\n\t\t// Support: IE9\n\t\t// getPropertyValue is only needed for .css('filter') in IE9, see #12537\n\t\tret = computed ? computed.getPropertyValue( name ) || computed[ name ] : undefined,\n\t\tstyle = elem.style;\n\n\tif ( computed ) {\n\n\t\tif ( ret === \"\" && !jQuery.contains( elem.ownerDocument, elem ) ) {\n\t\t\tret = jQuery.style( elem, name );\n\t\t}\n\n\t\t// Support: Safari 5.1\n\t\t// A tribute to the \"awesome hack by Dean Edwards\"\n\t\t// Safari 5.1.7 (at least) returns percentage for a larger set of values, but width seems to be reliably pixels\n\t\t// this is against the CSSOM draft spec: http://dev.w3.org/csswg/cssom/#resolved-values\n\t\tif ( rnumnonpx.test( ret ) && rmargin.test( name ) ) {\n\n\t\t\t// Remember the original values\n\t\t\twidth = style.width;\n\t\t\tminWidth = style.minWidth;\n\t\t\tmaxWidth = style.maxWidth;\n\n\t\t\t// Put in the new values to get a computed value out\n\t\t\tstyle.minWidth = style.maxWidth = style.width = ret;\n\t\t\tret = computed.width;\n\n\t\t\t// Revert the changed values\n\t\t\tstyle.width = width;\n\t\t\tstyle.minWidth = minWidth;\n\t\t\tstyle.maxWidth = maxWidth;\n\t\t}\n\t}\n\n\treturn ret;\n};\n\n\nfunction setPositiveNumber( elem, value, subtract ) {\n\tvar matches = rnumsplit.exec( value );\n\treturn matches ?\n\t\t// Guard against undefined \"subtract\", e.g., when used as in cssHooks\n\t\tMath.max( 0, matches[ 1 ] - ( subtract || 0 ) ) + ( matches[ 2 ] || \"px\" ) :\n\t\tvalue;\n}\n\nfunction augmentWidthOrHeight( elem, name, extra, isBorderBox, styles ) {\n\tvar i = extra === ( isBorderBox ? \"border\" : \"content\" ) ?\n\t\t// If we already have the right measurement, avoid augmentation\n\t\t4 :\n\t\t// Otherwise initialize for horizontal or vertical properties\n\t\tname === \"width\" ? 1 : 0,\n\n\t\tval = 0;\n\n\tfor ( ; i < 4; i += 2 ) {\n\t\t// both box models exclude margin, so add it if we want it\n\t\tif ( extra === \"margin\" ) {\n\t\t\tval += jQuery.css( elem, extra + cssExpand[ i ], true, styles );\n\t\t}\n\n\t\tif ( isBorderBox ) {\n\t\t\t// border-box includes padding, so remove it if we want content\n\t\t\tif ( extra === \"content\" ) {\n\t\t\t\tval -= jQuery.css( elem, \"padding\" + cssExpand[ i ], true, styles );\n\t\t\t}\n\n\t\t\t// at this point, extra isn't border nor margin, so remove border\n\t\t\tif ( extra !== \"margin\" ) {\n\t\t\t\tval -= jQuery.css( elem, \"border\" + cssExpand[ i ] + \"Width\", true, styles );\n\t\t\t}\n\t\t} else {\n\t\t\t// at this point, extra isn't content, so add padding\n\t\t\tval += jQuery.css( elem, \"padding\" + cssExpand[ i ], true, styles );\n\n\t\t\t// at this point, extra isn't content nor padding, so add border\n\t\t\tif ( extra !== \"padding\" ) {\n\t\t\t\tval += jQuery.css( elem, \"border\" + cssExpand[ i ] + \"Width\", true, styles );\n\t\t\t}\n\t\t}\n\t}\n\n\treturn val;\n}\n\nfunction getWidthOrHeight( elem, name, extra ) {\n\n\t// Start with offset property, which is equivalent to the border-box value\n\tvar valueIsBorderBox = true,\n\t\tval = name === \"width\" ? elem.offsetWidth : elem.offsetHeight,\n\t\tstyles = getStyles( elem ),\n\t\tisBorderBox = jQuery.support.boxSizing && jQuery.css( elem, \"boxSizing\", false, styles ) === \"border-box\";\n\n\t// some non-html elements return undefined for offsetWidth, so check for null/undefined\n\t// svg - https://bugzilla.mozilla.org/show_bug.cgi?id=649285\n\t// MathML - https://bugzilla.mozilla.org/show_bug.cgi?id=491668\n\tif ( val <= 0 || val == null ) {\n\t\t// Fall back to computed then uncomputed css if necessary\n\t\tval = curCSS( elem, name, styles );\n\t\tif ( val < 0 || val == null ) {\n\t\t\tval = elem.style[ name ];\n\t\t}\n\n\t\t// Computed unit is not pixels. Stop here and return.\n\t\tif ( rnumnonpx.test(val) ) {\n\t\t\treturn val;\n\t\t}\n\n\t\t// we need the check for style in case a browser which returns unreliable values\n\t\t// for getComputedStyle silently falls back to the reliable elem.style\n\t\tvalueIsBorderBox = isBorderBox && ( jQuery.support.boxSizingReliable || val === elem.style[ name ] );\n\n\t\t// Normalize \"\", auto, and prepare for extra\n\t\tval = parseFloat( val ) || 0;\n\t}\n\n\t// use the active box-sizing model to add/subtract irrelevant styles\n\treturn ( val +\n\t\taugmentWidthOrHeight(\n\t\t\telem,\n\t\t\tname,\n\t\t\textra || ( isBorderBox ? \"border\" : \"content\" ),\n\t\t\tvalueIsBorderBox,\n\t\t\tstyles\n\t\t)\n\t) + \"px\";\n}\n\n// Try to determine the default display value of an element\nfunction css_defaultDisplay( nodeName ) {\n\tvar doc = document,\n\t\tdisplay = elemdisplay[ nodeName ];\n\n\tif ( !display ) {\n\t\tdisplay = actualDisplay( nodeName, doc );\n\n\t\t// If the simple way fails, read from inside an iframe\n\t\tif ( display === \"none\" || !display ) {\n\t\t\t// Use the already-created iframe if possible\n\t\t\tiframe = ( iframe ||\n\t\t\t\tjQuery(\"<iframe frameborder='0' width='0' height='0'/>\")\n\t\t\t\t.css( \"cssText\", \"display:block !important\" )\n\t\t\t).appendTo( doc.documentElement );\n\n\t\t\t// Always write a new HTML skeleton so Webkit and Firefox don't choke on reuse\n\t\t\tdoc = ( iframe[0].contentWindow || iframe[0].contentDocument ).document;\n\t\t\tdoc.write(\"<!doctype html><html><body>\");\n\t\t\tdoc.close();\n\n\t\t\tdisplay = actualDisplay( nodeName, doc );\n\t\t\tiframe.detach();\n\t\t}\n\n\t\t// Store the correct default display\n\t\telemdisplay[ nodeName ] = display;\n\t}\n\n\treturn display;\n}\n\n// Called ONLY from within css_defaultDisplay\nfunction actualDisplay( name, doc ) {\n\tvar elem = jQuery( doc.createElement( name ) ).appendTo( doc.body ),\n\t\tdisplay = jQuery.css( elem[0], \"display\" );\n\telem.remove();\n\treturn display;\n}\n\njQuery.each([ \"height\", \"width\" ], function( i, name ) {\n\tjQuery.cssHooks[ name ] = {\n\t\tget: function( elem, computed, extra ) {\n\t\t\tif ( computed ) {\n\t\t\t\t// certain elements can have dimension info if we invisibly show them\n\t\t\t\t// however, it must have a current display style that would benefit from this\n\t\t\t\treturn elem.offsetWidth === 0 && rdisplayswap.test( jQuery.css( elem, \"display\" ) ) ?\n\t\t\t\t\tjQuery.swap( elem, cssShow, function() {\n\t\t\t\t\t\treturn getWidthOrHeight( elem, name, extra );\n\t\t\t\t\t}) :\n\t\t\t\t\tgetWidthOrHeight( elem, name, extra );\n\t\t\t}\n\t\t},\n\n\t\tset: function( elem, value, extra ) {\n\t\t\tvar styles = extra && getStyles( elem );\n\t\t\treturn setPositiveNumber( elem, value, extra ?\n\t\t\t\taugmentWidthOrHeight(\n\t\t\t\t\telem,\n\t\t\t\t\tname,\n\t\t\t\t\textra,\n\t\t\t\t\tjQuery.support.boxSizing && jQuery.css( elem, \"boxSizing\", false, styles ) === \"border-box\",\n\t\t\t\t\tstyles\n\t\t\t\t) : 0\n\t\t\t);\n\t\t}\n\t};\n});\n\n// These hooks cannot be added until DOM ready because the support test\n// for it is not run until after DOM ready\njQuery(function() {\n\t// Support: Android 2.3\n\tif ( !jQuery.support.reliableMarginRight ) {\n\t\tjQuery.cssHooks.marginRight = {\n\t\t\tget: function( elem, computed ) {\n\t\t\t\tif ( computed ) {\n\t\t\t\t\t// Support: Android 2.3\n\t\t\t\t\t// WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right\n\t\t\t\t\t// Work around by temporarily setting element display to inline-block\n\t\t\t\t\treturn jQuery.swap( elem, { \"display\": \"inline-block\" },\n\t\t\t\t\t\tcurCSS, [ elem, \"marginRight\" ] );\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t}\n\n\t// Webkit bug: https://bugs.webkit.org/show_bug.cgi?id=29084\n\t// getComputedStyle returns percent when specified for top/left/bottom/right\n\t// rather than make the css module depend on the offset module, we just check for it here\n\tif ( !jQuery.support.pixelPosition && jQuery.fn.position ) {\n\t\tjQuery.each( [ \"top\", \"left\" ], function( i, prop ) {\n\t\t\tjQuery.cssHooks[ prop ] = {\n\t\t\t\tget: function( elem, computed ) {\n\t\t\t\t\tif ( computed ) {\n\t\t\t\t\t\tcomputed = curCSS( elem, prop );\n\t\t\t\t\t\t// if curCSS returns percentage, fallback to offset\n\t\t\t\t\t\treturn rnumnonpx.test( computed ) ?\n\t\t\t\t\t\t\tjQuery( elem ).position()[ prop ] + \"px\" :\n\t\t\t\t\t\t\tcomputed;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t};\n\t\t});\n\t}\n\n});\n\nif ( jQuery.expr && jQuery.expr.filters ) {\n\tjQuery.expr.filters.hidden = function( elem ) {\n\t\t// Support: Opera <= 12.12\n\t\t// Opera reports offsetWidths and offsetHeights less than zero on some elements\n\t\treturn elem.offsetWidth <= 0 && elem.offsetHeight <= 0;\n\t};\n\n\tjQuery.expr.filters.visible = function( elem ) {\n\t\treturn !jQuery.expr.filters.hidden( elem );\n\t};\n}\n\n// These hooks are used by animate to expand properties\njQuery.each({\n\tmargin: \"\",\n\tpadding: \"\",\n\tborder: \"Width\"\n}, function( prefix, suffix ) {\n\tjQuery.cssHooks[ prefix + suffix ] = {\n\t\texpand: function( value ) {\n\t\t\tvar i = 0,\n\t\t\t\texpanded = {},\n\n\t\t\t\t// assumes a single number if not a string\n\t\t\t\tparts = typeof value === \"string\" ? value.split(\" \") : [ value ];\n\n\t\t\tfor ( ; i < 4; i++ ) {\n\t\t\t\texpanded[ prefix + cssExpand[ i ] + suffix ] =\n\t\t\t\t\tparts[ i ] || parts[ i - 2 ] || parts[ 0 ];\n\t\t\t}\n\n\t\t\treturn expanded;\n\t\t}\n\t};\n\n\tif ( !rmargin.test( prefix ) ) {\n\t\tjQuery.cssHooks[ prefix + suffix ].set = setPositiveNumber;\n\t}\n});\nvar r20 = /%20/g,\n\trbracket = /\\[\\]$/,\n\trCRLF = /\\r?\\n/g,\n\trsubmitterTypes = /^(?:submit|button|image|reset|file)$/i,\n\trsubmittable = /^(?:input|select|textarea|keygen)/i;\n\njQuery.fn.extend({\n\tserialize: function() {\n\t\treturn jQuery.param( this.serializeArray() );\n\t},\n\tserializeArray: function() {\n\t\treturn this.map(function(){\n\t\t\t// Can add propHook for \"elements\" to filter or add form elements\n\t\t\tvar elements = jQuery.prop( this, \"elements\" );\n\t\t\treturn elements ? jQuery.makeArray( elements ) : this;\n\t\t})\n\t\t.filter(function(){\n\t\t\tvar type = this.type;\n\t\t\t// Use .is(\":disabled\") so that fieldset[disabled] works\n\t\t\treturn this.name && !jQuery( this ).is( \":disabled\" ) &&\n\t\t\t\trsubmittable.test( this.nodeName ) && !rsubmitterTypes.test( type ) &&\n\t\t\t\t( this.checked || !manipulation_rcheckableType.test( type ) );\n\t\t})\n\t\t.map(function( i, elem ){\n\t\t\tvar val = jQuery( this ).val();\n\n\t\t\treturn val == null ?\n\t\t\t\tnull :\n\t\t\t\tjQuery.isArray( val ) ?\n\t\t\t\t\tjQuery.map( val, function( val ){\n\t\t\t\t\t\treturn { name: elem.name, value: val.replace( rCRLF, \"\\r\\n\" ) };\n\t\t\t\t\t}) :\n\t\t\t\t\t{ name: elem.name, value: val.replace( rCRLF, \"\\r\\n\" ) };\n\t\t}).get();\n\t}\n});\n\n//Serialize an array of form elements or a set of\n//key/values into a query string\njQuery.param = function( a, traditional ) {\n\tvar prefix,\n\t\ts = [],\n\t\tadd = function( key, value ) {\n\t\t\t// If value is a function, invoke it and return its value\n\t\t\tvalue = jQuery.isFunction( value ) ? value() : ( value == null ? \"\" : value );\n\t\t\ts[ s.length ] = encodeURIComponent( key ) + \"=\" + encodeURIComponent( value );\n\t\t};\n\n\t// Set traditional to true for jQuery <= 1.3.2 behavior.\n\tif ( traditional === undefined ) {\n\t\ttraditional = jQuery.ajaxSettings && jQuery.ajaxSettings.traditional;\n\t}\n\n\t// If an array was passed in, assume that it is an array of form elements.\n\tif ( jQuery.isArray( a ) || ( a.jquery && !jQuery.isPlainObject( a ) ) ) {\n\t\t// Serialize the form elements\n\t\tjQuery.each( a, function() {\n\t\t\tadd( this.name, this.value );\n\t\t});\n\n\t} else {\n\t\t// If traditional, encode the \"old\" way (the way 1.3.2 or older\n\t\t// did it), otherwise encode params recursively.\n\t\tfor ( prefix in a ) {\n\t\t\tbuildParams( prefix, a[ prefix ], traditional, add );\n\t\t}\n\t}\n\n\t// Return the resulting serialization\n\treturn s.join( \"&\" ).replace( r20, \"+\" );\n};\n\nfunction buildParams( prefix, obj, traditional, add ) {\n\tvar name;\n\n\tif ( jQuery.isArray( obj ) ) {\n\t\t// Serialize array item.\n\t\tjQuery.each( obj, function( i, v ) {\n\t\t\tif ( traditional || rbracket.test( prefix ) ) {\n\t\t\t\t// Treat each array item as a scalar.\n\t\t\t\tadd( prefix, v );\n\n\t\t\t} else {\n\t\t\t\t// Item is non-scalar (array or object), encode its numeric index.\n\t\t\t\tbuildParams( prefix + \"[\" + ( typeof v === \"object\" ? i : \"\" ) + \"]\", v, traditional, add );\n\t\t\t}\n\t\t});\n\n\t} else if ( !traditional && jQuery.type( obj ) === \"object\" ) {\n\t\t// Serialize object item.\n\t\tfor ( name in obj ) {\n\t\t\tbuildParams( prefix + \"[\" + name + \"]\", obj[ name ], traditional, add );\n\t\t}\n\n\t} else {\n\t\t// Serialize scalar item.\n\t\tadd( prefix, obj );\n\t}\n}\njQuery.each( (\"blur focus focusin focusout load resize scroll unload click dblclick \" +\n\t\"mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave \" +\n\t\"change select submit keydown keypress keyup error contextmenu\").split(\" \"), function( i, name ) {\n\n\t// Handle event binding\n\tjQuery.fn[ name ] = function( data, fn ) {\n\t\treturn arguments.length > 0 ?\n\t\t\tthis.on( name, null, data, fn ) :\n\t\t\tthis.trigger( name );\n\t};\n});\n\njQuery.fn.extend({\n\thover: function( fnOver, fnOut ) {\n\t\treturn this.mouseenter( fnOver ).mouseleave( fnOut || fnOver );\n\t},\n\n\tbind: function( types, data, fn ) {\n\t\treturn this.on( types, null, data, fn );\n\t},\n\tunbind: function( types, fn ) {\n\t\treturn this.off( types, null, fn );\n\t},\n\n\tdelegate: function( selector, types, data, fn ) {\n\t\treturn this.on( types, selector, data, fn );\n\t},\n\tundelegate: function( selector, types, fn ) {\n\t\t// ( namespace ) or ( selector, types [, fn] )\n\t\treturn arguments.length === 1 ? this.off( selector, \"**\" ) : this.off( types, selector || \"**\", fn );\n\t}\n});\nvar\n\t// Document location\n\tajaxLocParts,\n\tajaxLocation,\n\n\tajax_nonce = jQuery.now(),\n\n\tajax_rquery = /\\?/,\n\trhash = /#.*$/,\n\trts = /([?&])_=[^&]*/,\n\trheaders = /^(.*?):[ \\t]*([^\\r\\n]*)$/mg,\n\t// #7653, #8125, #8152: local protocol detection\n\trlocalProtocol = /^(?:about|app|app-storage|.+-extension|file|res|widget):$/,\n\trnoContent = /^(?:GET|HEAD)$/,\n\trprotocol = /^\\/\\//,\n\trurl = /^([\\w.+-]+:)(?:\\/\\/([^\\/?#:]*)(?::(\\d+)|)|)/,\n\n\t// Keep a copy of the old load method\n\t_load = jQuery.fn.load,\n\n\t/* Prefilters\n\t * 1) They are useful to introduce custom dataTypes (see ajax/jsonp.js for an example)\n\t * 2) These are called:\n\t * - BEFORE asking for a transport\n\t * - AFTER param serialization (s.data is a string if s.processData is true)\n\t * 3) key is the dataType\n\t * 4) the catchall symbol \"*\" can be used\n\t * 5) execution will start with transport dataType and THEN continue down to \"*\" if needed\n\t */\n\tprefilters = {},\n\n\t/* Transports bindings\n\t * 1) key is the dataType\n\t * 2) the catchall symbol \"*\" can be used\n\t * 3) selection will start with transport dataType and THEN go to \"*\" if needed\n\t */\n\ttransports = {},\n\n\t// Avoid comment-prolog char sequence (#10098); must appease lint and evade compression\n\tallTypes = \"*/\".concat(\"*\");\n\n// #8138, IE may throw an exception when accessing\n// a field from window.location if document.domain has been set\ntry {\n\tajaxLocation = location.href;\n} catch( e ) {\n\t// Use the href attribute of an A element\n\t// since IE will modify it given document.location\n\tajaxLocation = document.createElement( \"a\" );\n\tajaxLocation.href = \"\";\n\tajaxLocation = ajaxLocation.href;\n}\n\n// Segment location into parts\najaxLocParts = rurl.exec( ajaxLocation.toLowerCase() ) || [];\n\n// Base \"constructor\" for jQuery.ajaxPrefilter and jQuery.ajaxTransport\nfunction addToPrefiltersOrTransports( structure ) {\n\n\t// dataTypeExpression is optional and defaults to \"*\"\n\treturn function( dataTypeExpression, func ) {\n\n\t\tif ( typeof dataTypeExpression !== \"string\" ) {\n\t\t\tfunc = dataTypeExpression;\n\t\t\tdataTypeExpression = \"*\";\n\t\t}\n\n\t\tvar dataType,\n\t\t\ti = 0,\n\t\t\tdataTypes = dataTypeExpression.toLowerCase().match( core_rnotwhite ) || [];\n\n\t\tif ( jQuery.isFunction( func ) ) {\n\t\t\t// For each dataType in the dataTypeExpression\n\t\t\twhile ( (dataType = dataTypes[i++]) ) {\n\t\t\t\t// Prepend if requested\n\t\t\t\tif ( dataType[0] === \"+\" ) {\n\t\t\t\t\tdataType = dataType.slice( 1 ) || \"*\";\n\t\t\t\t\t(structure[ dataType ] = structure[ dataType ] || []).unshift( func );\n\n\t\t\t\t// Otherwise append\n\t\t\t\t} else {\n\t\t\t\t\t(structure[ dataType ] = structure[ dataType ] || []).push( func );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t};\n}\n\n// Base inspection function for prefilters and transports\nfunction inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {\n\n\tvar inspected = {},\n\t\tseekingTransport = ( structure === transports );\n\n\tfunction inspect( dataType ) {\n\t\tvar selected;\n\t\tinspected[ dataType ] = true;\n\t\tjQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {\n\t\t\tvar dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );\n\t\t\tif( typeof dataTypeOrTransport === \"string\" && !seekingTransport && !inspected[ dataTypeOrTransport ] ) {\n\t\t\t\toptions.dataTypes.unshift( dataTypeOrTransport );\n\t\t\t\tinspect( dataTypeOrTransport );\n\t\t\t\treturn false;\n\t\t\t} else if ( seekingTransport ) {\n\t\t\t\treturn !( selected = dataTypeOrTransport );\n\t\t\t}\n\t\t});\n\t\treturn selected;\n\t}\n\n\treturn inspect( options.dataTypes[ 0 ] ) || !inspected[ \"*\" ] && inspect( \"*\" );\n}\n\n// A special extend for ajax options\n// that takes \"flat\" options (not to be deep extended)\n// Fixes #9887\nfunction ajaxExtend( target, src ) {\n\tvar key, deep,\n\t\tflatOptions = jQuery.ajaxSettings.flatOptions || {};\n\n\tfor ( key in src ) {\n\t\tif ( src[ key ] !== undefined ) {\n\t\t\t( flatOptions[ key ] ? target : ( deep || (deep = {}) ) )[ key ] = src[ key ];\n\t\t}\n\t}\n\tif ( deep ) {\n\t\tjQuery.extend( true, target, deep );\n\t}\n\n\treturn target;\n}\n\njQuery.fn.load = function( url, params, callback ) {\n\tif ( typeof url !== \"string\" && _load ) {\n\t\treturn _load.apply( this, arguments );\n\t}\n\n\tvar selector, type, response,\n\t\tself = this,\n\t\toff = url.indexOf(\" \");\n\n\tif ( off >= 0 ) {\n\t\tselector = url.slice( off );\n\t\turl = url.slice( 0, off );\n\t}\n\n\t// If it's a function\n\tif ( jQuery.isFunction( params ) ) {\n\n\t\t// We assume that it's the callback\n\t\tcallback = params;\n\t\tparams = undefined;\n\n\t// Otherwise, build a param string\n\t} else if ( params && typeof params === \"object\" ) {\n\t\ttype = \"POST\";\n\t}\n\n\t// If we have elements to modify, make the request\n\tif ( self.length > 0 ) {\n\t\tjQuery.ajax({\n\t\t\turl: url,\n\n\t\t\t// if \"type\" variable is undefined, then \"GET\" method will be used\n\t\t\ttype: type,\n\t\t\tdataType: \"html\",\n\t\t\tdata: params\n\t\t}).done(function( responseText ) {\n\n\t\t\t// Save response for use in complete callback\n\t\t\tresponse = arguments;\n\n\t\t\tself.html( selector ?\n\n\t\t\t\t// If a selector was specified, locate the right elements in a dummy div\n\t\t\t\t// Exclude scripts to avoid IE 'Permission Denied' errors\n\t\t\t\tjQuery(\"<div>\").append( jQuery.parseHTML( responseText ) ).find( selector ) :\n\n\t\t\t\t// Otherwise use the full result\n\t\t\t\tresponseText );\n\n\t\t}).complete( callback && function( jqXHR, status ) {\n\t\t\tself.each( callback, response || [ jqXHR.responseText, status, jqXHR ] );\n\t\t});\n\t}\n\n\treturn this;\n};\n\n// Attach a bunch of functions for handling common AJAX events\njQuery.each( [ \"ajaxStart\", \"ajaxStop\", \"ajaxComplete\", \"ajaxError\", \"ajaxSuccess\", \"ajaxSend\" ], function( i, type ){\n\tjQuery.fn[ type ] = function( fn ){\n\t\treturn this.on( type, fn );\n\t};\n});\n\njQuery.extend({\n\n\t// Counter for holding the number of active queries\n\tactive: 0,\n\n\t// Last-Modified header cache for next request\n\tlastModified: {},\n\tetag: {},\n\n\tajaxSettings: {\n\t\turl: ajaxLocation,\n\t\ttype: \"GET\",\n\t\tisLocal: rlocalProtocol.test( ajaxLocParts[ 1 ] ),\n\t\tglobal: true,\n\t\tprocessData: true,\n\t\tasync: true,\n\t\tcontentType: \"application/x-www-form-urlencoded; charset=UTF-8\",\n\t\t/*\n\t\ttimeout: 0,\n\t\tdata: null,\n\t\tdataType: null,\n\t\tusername: null,\n\t\tpassword: null,\n\t\tcache: null,\n\t\tthrows: false,\n\t\ttraditional: false,\n\t\theaders: {},\n\t\t*/\n\n\t\taccepts: {\n\t\t\t\"*\": allTypes,\n\t\t\ttext: \"text/plain\",\n\t\t\thtml: \"text/html\",\n\t\t\txml: \"application/xml, text/xml\",\n\t\t\tjson: \"application/json, text/javascript\"\n\t\t},\n\n\t\tcontents: {\n\t\t\txml: /xml/,\n\t\t\thtml: /html/,\n\t\t\tjson: /json/\n\t\t},\n\n\t\tresponseFields: {\n\t\t\txml: \"responseXML\",\n\t\t\ttext: \"responseText\",\n\t\t\tjson: \"responseJSON\"\n\t\t},\n\n\t\t// Data converters\n\t\t// Keys separate source (or catchall \"*\") and destination types with a single space\n\t\tconverters: {\n\n\t\t\t// Convert anything to text\n\t\t\t\"* text\": String,\n\n\t\t\t// Text to html (true = no transformation)\n\t\t\t\"text html\": true,\n\n\t\t\t// Evaluate text as a json expression\n\t\t\t\"text json\": jQuery.parseJSON,\n\n\t\t\t// Parse text as xml\n\t\t\t\"text xml\": jQuery.parseXML\n\t\t},\n\n\t\t// For options that shouldn't be deep extended:\n\t\t// you can add your own custom options here if\n\t\t// and when you create one that shouldn't be\n\t\t// deep extended (see ajaxExtend)\n\t\tflatOptions: {\n\t\t\turl: true,\n\t\t\tcontext: true\n\t\t}\n\t},\n\n\t// Creates a full fledged settings object into target\n\t// with both ajaxSettings and settings fields.\n\t// If target is omitted, writes into ajaxSettings.\n\tajaxSetup: function( target, settings ) {\n\t\treturn settings ?\n\n\t\t\t// Building a settings object\n\t\t\tajaxExtend( ajaxExtend( target, jQuery.ajaxSettings ), settings ) :\n\n\t\t\t// Extending ajaxSettings\n\t\t\tajaxExtend( jQuery.ajaxSettings, target );\n\t},\n\n\tajaxPrefilter: addToPrefiltersOrTransports( prefilters ),\n\tajaxTransport: addToPrefiltersOrTransports( transports ),\n\n\t// Main method\n\tajax: function( url, options ) {\n\n\t\t// If url is an object, simulate pre-1.5 signature\n\t\tif ( typeof url === \"object\" ) {\n\t\t\toptions = url;\n\t\t\turl = undefined;\n\t\t}\n\n\t\t// Force options to be an object\n\t\toptions = options || {};\n\n\t\tvar transport,\n\t\t\t// URL without anti-cache param\n\t\t\tcacheURL,\n\t\t\t// Response headers\n\t\t\tresponseHeadersString,\n\t\t\tresponseHeaders,\n\t\t\t// timeout handle\n\t\t\ttimeoutTimer,\n\t\t\t// Cross-domain detection vars\n\t\t\tparts,\n\t\t\t// To know if global events are to be dispatched\n\t\t\tfireGlobals,\n\t\t\t// Loop variable\n\t\t\ti,\n\t\t\t// Create the final options object\n\t\t\ts = jQuery.ajaxSetup( {}, options ),\n\t\t\t// Callbacks context\n\t\t\tcallbackContext = s.context || s,\n\t\t\t// Context for global events is callbackContext if it is a DOM node or jQuery collection\n\t\t\tglobalEventContext = s.context && ( callbackContext.nodeType || callbackContext.jquery ) ?\n\t\t\t\tjQuery( callbackContext ) :\n\t\t\t\tjQuery.event,\n\t\t\t// Deferreds\n\t\t\tdeferred = jQuery.Deferred(),\n\t\t\tcompleteDeferred = jQuery.Callbacks(\"once memory\"),\n\t\t\t// Status-dependent callbacks\n\t\t\tstatusCode = s.statusCode || {},\n\t\t\t// Headers (they are sent all at once)\n\t\t\trequestHeaders = {},\n\t\t\trequestHeadersNames = {},\n\t\t\t// The jqXHR state\n\t\t\tstate = 0,\n\t\t\t// Default abort message\n\t\t\tstrAbort = \"canceled\",\n\t\t\t// Fake xhr\n\t\t\tjqXHR = {\n\t\t\t\treadyState: 0,\n\n\t\t\t\t// Builds headers hashtable if needed\n\t\t\t\tgetResponseHeader: function( key ) {\n\t\t\t\t\tvar match;\n\t\t\t\t\tif ( state === 2 ) {\n\t\t\t\t\t\tif ( !responseHeaders ) {\n\t\t\t\t\t\t\tresponseHeaders = {};\n\t\t\t\t\t\t\twhile ( (match = rheaders.exec( responseHeadersString )) ) {\n\t\t\t\t\t\t\t\tresponseHeaders[ match[1].toLowerCase() ] = match[ 2 ];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tmatch = responseHeaders[ key.toLowerCase() ];\n\t\t\t\t\t}\n\t\t\t\t\treturn match == null ? null : match;\n\t\t\t\t},\n\n\t\t\t\t// Raw string\n\t\t\t\tgetAllResponseHeaders: function() {\n\t\t\t\t\treturn state === 2 ? responseHeadersString : null;\n\t\t\t\t},\n\n\t\t\t\t// Caches the header\n\t\t\t\tsetRequestHeader: function( name, value ) {\n\t\t\t\t\tvar lname = name.toLowerCase();\n\t\t\t\t\tif ( !state ) {\n\t\t\t\t\t\tname = requestHeadersNames[ lname ] = requestHeadersNames[ lname ] || name;\n\t\t\t\t\t\trequestHeaders[ name ] = value;\n\t\t\t\t\t}\n\t\t\t\t\treturn this;\n\t\t\t\t},\n\n\t\t\t\t// Overrides response content-type header\n\t\t\t\toverrideMimeType: function( type ) {\n\t\t\t\t\tif ( !state ) {\n\t\t\t\t\t\ts.mimeType = type;\n\t\t\t\t\t}\n\t\t\t\t\treturn this;\n\t\t\t\t},\n\n\t\t\t\t// Status-dependent callbacks\n\t\t\t\tstatusCode: function( map ) {\n\t\t\t\t\tvar code;\n\t\t\t\t\tif ( map ) {\n\t\t\t\t\t\tif ( state < 2 ) {\n\t\t\t\t\t\t\tfor ( code in map ) {\n\t\t\t\t\t\t\t\t// Lazy-add the new callback in a way that preserves old ones\n\t\t\t\t\t\t\t\tstatusCode[ code ] = [ statusCode[ code ], map[ code ] ];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// Execute the appropriate callbacks\n\t\t\t\t\t\t\tjqXHR.always( map[ jqXHR.status ] );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\treturn this;\n\t\t\t\t},\n\n\t\t\t\t// Cancel the request\n\t\t\t\tabort: function( statusText ) {\n\t\t\t\t\tvar finalText = statusText || strAbort;\n\t\t\t\t\tif ( transport ) {\n\t\t\t\t\t\ttransport.abort( finalText );\n\t\t\t\t\t}\n\t\t\t\t\tdone( 0, finalText );\n\t\t\t\t\treturn this;\n\t\t\t\t}\n\t\t\t};\n\n\t\t// Attach deferreds\n\t\tdeferred.promise( jqXHR ).complete = completeDeferred.add;\n\t\tjqXHR.success = jqXHR.done;\n\t\tjqXHR.error = jqXHR.fail;\n\n\t\t// Remove hash character (#7531: and string promotion)\n\t\t// Add protocol if not provided (prefilters might expect it)\n\t\t// Handle falsy url in the settings object (#10093: consistency with old signature)\n\t\t// We also use the url parameter if available\n\t\ts.url = ( ( url || s.url || ajaxLocation ) + \"\" ).replace( rhash, \"\" )\n\t\t\t.replace( rprotocol, ajaxLocParts[ 1 ] + \"//\" );\n\n\t\t// Alias method option to type as per ticket #12004\n\t\ts.type = options.method || options.type || s.method || s.type;\n\n\t\t// Extract dataTypes list\n\t\ts.dataTypes = jQuery.trim( s.dataType || \"*\" ).toLowerCase().match( core_rnotwhite ) || [\"\"];\n\n\t\t// A cross-domain request is in order when we have a protocol:host:port mismatch\n\t\tif ( s.crossDomain == null ) {\n\t\t\tparts = rurl.exec( s.url.toLowerCase() );\n\t\t\ts.crossDomain = !!( parts &&\n\t\t\t\t( parts[ 1 ] !== ajaxLocParts[ 1 ] || parts[ 2 ] !== ajaxLocParts[ 2 ] ||\n\t\t\t\t\t( parts[ 3 ] || ( parts[ 1 ] === \"http:\" ? \"80\" : \"443\" ) ) !==\n\t\t\t\t\t\t( ajaxLocParts[ 3 ] || ( ajaxLocParts[ 1 ] === \"http:\" ? \"80\" : \"443\" ) ) )\n\t\t\t);\n\t\t}\n\n\t\t// Convert data if not already a string\n\t\tif ( s.data && s.processData && typeof s.data !== \"string\" ) {\n\t\t\ts.data = jQuery.param( s.data, s.traditional );\n\t\t}\n\n\t\t// Apply prefilters\n\t\tinspectPrefiltersOrTransports( prefilters, s, options, jqXHR );\n\n\t\t// If request was aborted inside a prefilter, stop there\n\t\tif ( state === 2 ) {\n\t\t\treturn jqXHR;\n\t\t}\n\n\t\t// We can fire global events as of now if asked to\n\t\tfireGlobals = s.global;\n\n\t\t// Watch for a new set of requests\n\t\tif ( fireGlobals && jQuery.active++ === 0 ) {\n\t\t\tjQuery.event.trigger(\"ajaxStart\");\n\t\t}\n\n\t\t// Uppercase the type\n\t\ts.type = s.type.toUpperCase();\n\n\t\t// Determine if request has content\n\t\ts.hasContent = !rnoContent.test( s.type );\n\n\t\t// Save the URL in case we're toying with the If-Modified-Since\n\t\t// and/or If-None-Match header later on\n\t\tcacheURL = s.url;\n\n\t\t// More options handling for requests with no content\n\t\tif ( !s.hasContent ) {\n\n\t\t\t// If data is available, append data to url\n\t\t\tif ( s.data ) {\n\t\t\t\tcacheURL = ( s.url += ( ajax_rquery.test( cacheURL ) ? \"&\" : \"?\" ) + s.data );\n\t\t\t\t// #9682: remove data so that it's not used in an eventual retry\n\t\t\t\tdelete s.data;\n\t\t\t}\n\n\t\t\t// Add anti-cache in url if needed\n\t\t\tif ( s.cache === false ) {\n\t\t\t\ts.url = rts.test( cacheURL ) ?\n\n\t\t\t\t\t// If there is already a '_' parameter, set its value\n\t\t\t\t\tcacheURL.replace( rts, \"$1_=\" + ajax_nonce++ ) :\n\n\t\t\t\t\t// Otherwise add one to the end\n\t\t\t\t\tcacheURL + ( ajax_rquery.test( cacheURL ) ? \"&\" : \"?\" ) + \"_=\" + ajax_nonce++;\n\t\t\t}\n\t\t}\n\n\t\t// Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.\n\t\tif ( s.ifModified ) {\n\t\t\tif ( jQuery.lastModified[ cacheURL ] ) {\n\t\t\t\tjqXHR.setRequestHeader( \"If-Modified-Since\", jQuery.lastModified[ cacheURL ] );\n\t\t\t}\n\t\t\tif ( jQuery.etag[ cacheURL ] ) {\n\t\t\t\tjqXHR.setRequestHeader( \"If-None-Match\", jQuery.etag[ cacheURL ] );\n\t\t\t}\n\t\t}\n\n\t\t// Set the correct header, if data is being sent\n\t\tif ( s.data && s.hasContent && s.contentType !== false || options.contentType ) {\n\t\t\tjqXHR.setRequestHeader( \"Content-Type\", s.contentType );\n\t\t}\n\n\t\t// Set the Accepts header for the server, depending on the dataType\n\t\tjqXHR.setRequestHeader(\n\t\t\t\"Accept\",\n\t\t\ts.dataTypes[ 0 ] && s.accepts[ s.dataTypes[0] ] ?\n\t\t\t\ts.accepts[ s.dataTypes[0] ] + ( s.dataTypes[ 0 ] !== \"*\" ? \", \" + allTypes + \"; q=0.01\" : \"\" ) :\n\t\t\t\ts.accepts[ \"*\" ]\n\t\t);\n\n\t\t// Check for headers option\n\t\tfor ( i in s.headers ) {\n\t\t\tjqXHR.setRequestHeader( i, s.headers[ i ] );\n\t\t}\n\n\t\t// Allow custom headers/mimetypes and early abort\n\t\tif ( s.beforeSend && ( s.beforeSend.call( callbackContext, jqXHR, s ) === false || state === 2 ) ) {\n\t\t\t// Abort if not done already and return\n\t\t\treturn jqXHR.abort();\n\t\t}\n\n\t\t// aborting is no longer a cancellation\n\t\tstrAbort = \"abort\";\n\n\t\t// Install callbacks on deferreds\n\t\tfor ( i in { success: 1, error: 1, complete: 1 } ) {\n\t\t\tjqXHR[ i ]( s[ i ] );\n\t\t}\n\n\t\t// Get transport\n\t\ttransport = inspectPrefiltersOrTransports( transports, s, options, jqXHR );\n\n\t\t// If no transport, we auto-abort\n\t\tif ( !transport ) {\n\t\t\tdone( -1, \"No Transport\" );\n\t\t} else {\n\t\t\tjqXHR.readyState = 1;\n\n\t\t\t// Send global event\n\t\t\tif ( fireGlobals ) {\n\t\t\t\tglobalEventContext.trigger( \"ajaxSend\", [ jqXHR, s ] );\n\t\t\t}\n\t\t\t// Timeout\n\t\t\tif ( s.async && s.timeout > 0 ) {\n\t\t\t\ttimeoutTimer = setTimeout(function() {\n\t\t\t\t\tjqXHR.abort(\"timeout\");\n\t\t\t\t}, s.timeout );\n\t\t\t}\n\n\t\t\ttry {\n\t\t\t\tstate = 1;\n\t\t\t\ttransport.send( requestHeaders, done );\n\t\t\t} catch ( e ) {\n\t\t\t\t// Propagate exception as error if not done\n\t\t\t\tif ( state < 2 ) {\n\t\t\t\t\tdone( -1, e );\n\t\t\t\t// Simply rethrow otherwise\n\t\t\t\t} else {\n\t\t\t\t\tthrow e;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Callback for when everything is done\n\t\tfunction done( status, nativeStatusText, responses, headers ) {\n\t\t\tvar isSuccess, success, error, response, modified,\n\t\t\t\tstatusText = nativeStatusText;\n\n\t\t\t// Called once\n\t\t\tif ( state === 2 ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// State is \"done\" now\n\t\t\tstate = 2;\n\n\t\t\t// Clear timeout if it exists\n\t\t\tif ( timeoutTimer ) {\n\t\t\t\tclearTimeout( timeoutTimer );\n\t\t\t}\n\n\t\t\t// Dereference transport for early garbage collection\n\t\t\t// (no matter how long the jqXHR object will be used)\n\t\t\ttransport = undefined;\n\n\t\t\t// Cache response headers\n\t\t\tresponseHeadersString = headers || \"\";\n\n\t\t\t// Set readyState\n\t\t\tjqXHR.readyState = status > 0 ? 4 : 0;\n\n\t\t\t// Determine if successful\n\t\t\tisSuccess = status >= 200 && status < 300 || status === 304;\n\n\t\t\t// Get response data\n\t\t\tif ( responses ) {\n\t\t\t\tresponse = ajaxHandleResponses( s, jqXHR, responses );\n\t\t\t}\n\n\t\t\t// Convert no matter what (that way responseXXX fields are always set)\n\t\t\tresponse = ajaxConvert( s, response, jqXHR, isSuccess );\n\n\t\t\t// If successful, handle type chaining\n\t\t\tif ( isSuccess ) {\n\n\t\t\t\t// Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.\n\t\t\t\tif ( s.ifModified ) {\n\t\t\t\t\tmodified = jqXHR.getResponseHeader(\"Last-Modified\");\n\t\t\t\t\tif ( modified ) {\n\t\t\t\t\t\tjQuery.lastModified[ cacheURL ] = modified;\n\t\t\t\t\t}\n\t\t\t\t\tmodified = jqXHR.getResponseHeader(\"etag\");\n\t\t\t\t\tif ( modified ) {\n\t\t\t\t\t\tjQuery.etag[ cacheURL ] = modified;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// if no content\n\t\t\t\tif ( status === 204 || s.type === \"HEAD\" ) {\n\t\t\t\t\tstatusText = \"nocontent\";\n\n\t\t\t\t// if not modified\n\t\t\t\t} else if ( status === 304 ) {\n\t\t\t\t\tstatusText = \"notmodified\";\n\n\t\t\t\t// If we have data, let's convert it\n\t\t\t\t} else {\n\t\t\t\t\tstatusText = response.state;\n\t\t\t\t\tsuccess = response.data;\n\t\t\t\t\terror = response.error;\n\t\t\t\t\tisSuccess = !error;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// We extract error from statusText\n\t\t\t\t// then normalize statusText and status for non-aborts\n\t\t\t\terror = statusText;\n\t\t\t\tif ( status || !statusText ) {\n\t\t\t\t\tstatusText = \"error\";\n\t\t\t\t\tif ( status < 0 ) {\n\t\t\t\t\t\tstatus = 0;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Set data for the fake xhr object\n\t\t\tjqXHR.status = status;\n\t\t\tjqXHR.statusText = ( nativeStatusText || statusText ) + \"\";\n\n\t\t\t// Success/Error\n\t\t\tif ( isSuccess ) {\n\t\t\t\tdeferred.resolveWith( callbackContext, [ success, statusText, jqXHR ] );\n\t\t\t} else {\n\t\t\t\tdeferred.rejectWith( callbackContext, [ jqXHR, statusText, error ] );\n\t\t\t}\n\n\t\t\t// Status-dependent callbacks\n\t\t\tjqXHR.statusCode( statusCode );\n\t\t\tstatusCode = undefined;\n\n\t\t\tif ( fireGlobals ) {\n\t\t\t\tglobalEventContext.trigger( isSuccess ? \"ajaxSuccess\" : \"ajaxError\",\n\t\t\t\t\t[ jqXHR, s, isSuccess ? success : error ] );\n\t\t\t}\n\n\t\t\t// Complete\n\t\t\tcompleteDeferred.fireWith( callbackContext, [ jqXHR, statusText ] );\n\n\t\t\tif ( fireGlobals ) {\n\t\t\t\tglobalEventContext.trigger( \"ajaxComplete\", [ jqXHR, s ] );\n\t\t\t\t// Handle the global AJAX counter\n\t\t\t\tif ( !( --jQuery.active ) ) {\n\t\t\t\t\tjQuery.event.trigger(\"ajaxStop\");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn jqXHR;\n\t},\n\n\tgetJSON: function( url, data, callback ) {\n\t\treturn jQuery.get( url, data, callback, \"json\" );\n\t},\n\n\tgetScript: function( url, callback ) {\n\t\treturn jQuery.get( url, undefined, callback, \"script\" );\n\t}\n});\n\njQuery.each( [ \"get\", \"post\" ], function( i, method ) {\n\tjQuery[ method ] = function( url, data, callback, type ) {\n\t\t// shift arguments if data argument was omitted\n\t\tif ( jQuery.isFunction( data ) ) {\n\t\t\ttype = type || callback;\n\t\t\tcallback = data;\n\t\t\tdata = undefined;\n\t\t}\n\n\t\treturn jQuery.ajax({\n\t\t\turl: url,\n\t\t\ttype: method,\n\t\t\tdataType: type,\n\t\t\tdata: data,\n\t\t\tsuccess: callback\n\t\t});\n\t};\n});\n\n/* Handles responses to an ajax request:\n * - finds the right dataType (mediates between content-type and expected dataType)\n * - returns the corresponding response\n */\nfunction ajaxHandleResponses( s, jqXHR, responses ) {\n\n\tvar ct, type, finalDataType, firstDataType,\n\t\tcontents = s.contents,\n\t\tdataTypes = s.dataTypes;\n\n\t// Remove auto dataType and get content-type in the process\n\twhile( dataTypes[ 0 ] === \"*\" ) {\n\t\tdataTypes.shift();\n\t\tif ( ct === undefined ) {\n\t\t\tct = s.mimeType || jqXHR.getResponseHeader(\"Content-Type\");\n\t\t}\n\t}\n\n\t// Check if we're dealing with a known content-type\n\tif ( ct ) {\n\t\tfor ( type in contents ) {\n\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\n\t\t\t\tdataTypes.unshift( type );\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\t// Check to see if we have a response for the expected dataType\n\tif ( dataTypes[ 0 ] in responses ) {\n\t\tfinalDataType = dataTypes[ 0 ];\n\t} else {\n\t\t// Try convertible dataTypes\n\t\tfor ( type in responses ) {\n\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[0] ] ) {\n\t\t\t\tfinalDataType = type;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif ( !firstDataType ) {\n\t\t\t\tfirstDataType = type;\n\t\t\t}\n\t\t}\n\t\t// Or just use first one\n\t\tfinalDataType = finalDataType || firstDataType;\n\t}\n\n\t// If we found a dataType\n\t// We add the dataType to the list if needed\n\t// and return the corresponding response\n\tif ( finalDataType ) {\n\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\n\t\t\tdataTypes.unshift( finalDataType );\n\t\t}\n\t\treturn responses[ finalDataType ];\n\t}\n}\n\n/* Chain conversions given the request and the original response\n * Also sets the responseXXX fields on the jqXHR instance\n */\nfunction ajaxConvert( s, response, jqXHR, isSuccess ) {\n\tvar conv2, current, conv, tmp, prev,\n\t\tconverters = {},\n\t\t// Work with a copy of dataTypes in case we need to modify it for conversion\n\t\tdataTypes = s.dataTypes.slice();\n\n\t// Create converters map with lowercased keys\n\tif ( dataTypes[ 1 ] ) {\n\t\tfor ( conv in s.converters ) {\n\t\t\tconverters[ conv.toLowerCase() ] = s.converters[ conv ];\n\t\t}\n\t}\n\n\tcurrent = dataTypes.shift();\n\n\t// Convert to each sequential dataType\n\twhile ( current ) {\n\n\t\tif ( s.responseFields[ current ] ) {\n\t\t\tjqXHR[ s.responseFields[ current ] ] = response;\n\t\t}\n\n\t\t// Apply the dataFilter if provided\n\t\tif ( !prev && isSuccess && s.dataFilter ) {\n\t\t\tresponse = s.dataFilter( response, s.dataType );\n\t\t}\n\n\t\tprev = current;\n\t\tcurrent = dataTypes.shift();\n\n\t\tif ( current ) {\n\n\t\t// There's only work to do if current dataType is non-auto\n\t\t\tif ( current === \"*\" ) {\n\n\t\t\t\tcurrent = prev;\n\n\t\t\t// Convert response if prev dataType is non-auto and differs from current\n\t\t\t} else if ( prev !== \"*\" && prev !== current ) {\n\n\t\t\t\t// Seek a direct converter\n\t\t\t\tconv = converters[ prev + \" \" + current ] || converters[ \"* \" + current ];\n\n\t\t\t\t// If none found, seek a pair\n\t\t\t\tif ( !conv ) {\n\t\t\t\t\tfor ( conv2 in converters ) {\n\n\t\t\t\t\t\t// If conv2 outputs current\n\t\t\t\t\t\ttmp = conv2.split( \" \" );\n\t\t\t\t\t\tif ( tmp[ 1 ] === current ) {\n\n\t\t\t\t\t\t\t// If prev can be converted to accepted input\n\t\t\t\t\t\t\tconv = converters[ prev + \" \" + tmp[ 0 ] ] ||\n\t\t\t\t\t\t\t\tconverters[ \"* \" + tmp[ 0 ] ];\n\t\t\t\t\t\t\tif ( conv ) {\n\t\t\t\t\t\t\t\t// Condense equivalence converters\n\t\t\t\t\t\t\t\tif ( conv === true ) {\n\t\t\t\t\t\t\t\t\tconv = converters[ conv2 ];\n\n\t\t\t\t\t\t\t\t// Otherwise, insert the intermediate dataType\n\t\t\t\t\t\t\t\t} else if ( converters[ conv2 ] !== true ) {\n\t\t\t\t\t\t\t\t\tcurrent = tmp[ 0 ];\n\t\t\t\t\t\t\t\t\tdataTypes.unshift( tmp[ 1 ] );\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Apply converter (if not an equivalence)\n\t\t\t\tif ( conv !== true ) {\n\n\t\t\t\t\t// Unless errors are allowed to bubble, catch and return them\n\t\t\t\t\tif ( conv && s[ \"throws\" ] ) {\n\t\t\t\t\t\tresponse = conv( response );\n\t\t\t\t\t} else {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tresponse = conv( response );\n\t\t\t\t\t\t} catch ( e ) {\n\t\t\t\t\t\t\treturn { state: \"parsererror\", error: conv ? e : \"No conversion from \" + prev + \" to \" + current };\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn { state: \"success\", data: response };\n}\n// Install script dataType\njQuery.ajaxSetup({\n\taccepts: {\n\t\tscript: \"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript\"\n\t},\n\tcontents: {\n\t\tscript: /(?:java|ecma)script/\n\t},\n\tconverters: {\n\t\t\"text script\": function( text ) {\n\t\t\tjQuery.globalEval( text );\n\t\t\treturn text;\n\t\t}\n\t}\n});\n\n// Handle cache's special case and crossDomain\njQuery.ajaxPrefilter( \"script\", function( s ) {\n\tif ( s.cache === undefined ) {\n\t\ts.cache = false;\n\t}\n\tif ( s.crossDomain ) {\n\t\ts.type = \"GET\";\n\t}\n});\n\n// Bind script tag hack transport\njQuery.ajaxTransport( \"script\", function( s ) {\n\t// This transport only deals with cross domain requests\n\tif ( s.crossDomain ) {\n\t\tvar script, callback;\n\t\treturn {\n\t\t\tsend: function( _, complete ) {\n\t\t\t\tscript = jQuery(\"<script>\").prop({\n\t\t\t\t\tasync: true,\n\t\t\t\t\tcharset: s.scriptCharset,\n\t\t\t\t\tsrc: s.url\n\t\t\t\t}).on(\n\t\t\t\t\t\"load error\",\n\t\t\t\t\tcallback = function( evt ) {\n\t\t\t\t\t\tscript.remove();\n\t\t\t\t\t\tcallback = null;\n\t\t\t\t\t\tif ( evt ) {\n\t\t\t\t\t\t\tcomplete( evt.type === \"error\" ? 404 : 200, evt.type );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t\tdocument.head.appendChild( script[ 0 ] );\n\t\t\t},\n\t\t\tabort: function() {\n\t\t\t\tif ( callback ) {\n\t\t\t\t\tcallback();\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t}\n});\nvar oldCallbacks = [],\n\trjsonp = /(=)\\?(?=&|$)|\\?\\?/;\n\n// Default jsonp settings\njQuery.ajaxSetup({\n\tjsonp: \"callback\",\n\tjsonpCallback: function() {\n\t\tvar callback = oldCallbacks.pop() || ( jQuery.expando + \"_\" + ( ajax_nonce++ ) );\n\t\tthis[ callback ] = true;\n\t\treturn callback;\n\t}\n});\n\n// Detect, normalize options and install callbacks for jsonp requests\njQuery.ajaxPrefilter( \"json jsonp\", function( s, originalSettings, jqXHR ) {\n\n\tvar callbackName, overwritten, responseContainer,\n\t\tjsonProp = s.jsonp !== false && ( rjsonp.test( s.url ) ?\n\t\t\t\"url\" :\n\t\t\ttypeof s.data === \"string\" && !( s.contentType || \"\" ).indexOf(\"application/x-www-form-urlencoded\") && rjsonp.test( s.data ) && \"data\"\n\t\t);\n\n\t// Handle iff the expected data type is \"jsonp\" or we have a parameter to set\n\tif ( jsonProp || s.dataTypes[ 0 ] === \"jsonp\" ) {\n\n\t\t// Get callback name, remembering preexisting value associated with it\n\t\tcallbackName = s.jsonpCallback = jQuery.isFunction( s.jsonpCallback ) ?\n\t\t\ts.jsonpCallback() :\n\t\t\ts.jsonpCallback;\n\n\t\t// Insert callback into url or form data\n\t\tif ( jsonProp ) {\n\t\t\ts[ jsonProp ] = s[ jsonProp ].replace( rjsonp, \"$1\" + callbackName );\n\t\t} else if ( s.jsonp !== false ) {\n\t\t\ts.url += ( ajax_rquery.test( s.url ) ? \"&\" : \"?\" ) + s.jsonp + \"=\" + callbackName;\n\t\t}\n\n\t\t// Use data converter to retrieve json after script execution\n\t\ts.converters[\"script json\"] = function() {\n\t\t\tif ( !responseContainer ) {\n\t\t\t\tjQuery.error( callbackName + \" was not called\" );\n\t\t\t}\n\t\t\treturn responseContainer[ 0 ];\n\t\t};\n\n\t\t// force json dataType\n\t\ts.dataTypes[ 0 ] = \"json\";\n\n\t\t// Install callback\n\t\toverwritten = window[ callbackName ];\n\t\twindow[ callbackName ] = function() {\n\t\t\tresponseContainer = arguments;\n\t\t};\n\n\t\t// Clean-up function (fires after converters)\n\t\tjqXHR.always(function() {\n\t\t\t// Restore preexisting value\n\t\t\twindow[ callbackName ] = overwritten;\n\n\t\t\t// Save back as free\n\t\t\tif ( s[ callbackName ] ) {\n\t\t\t\t// make sure that re-using the options doesn't screw things around\n\t\t\t\ts.jsonpCallback = originalSettings.jsonpCallback;\n\n\t\t\t\t// save the callback name for future use\n\t\t\t\toldCallbacks.push( callbackName );\n\t\t\t}\n\n\t\t\t// Call if it was a function and we have a response\n\t\t\tif ( responseContainer && jQuery.isFunction( overwritten ) ) {\n\t\t\t\toverwritten( responseContainer[ 0 ] );\n\t\t\t}\n\n\t\t\tresponseContainer = overwritten = undefined;\n\t\t});\n\n\t\t// Delegate to script\n\t\treturn \"script\";\n\t}\n});\njQuery.ajaxSettings.xhr = function() {\n\ttry {\n\t\treturn new XMLHttpRequest();\n\t} catch( e ) {}\n};\n\nvar xhrSupported = jQuery.ajaxSettings.xhr(),\n\txhrSuccessStatus = {\n\t\t// file protocol always yields status code 0, assume 200\n\t\t0: 200,\n\t\t// Support: IE9\n\t\t// #1450: sometimes IE returns 1223 when it should be 204\n\t\t1223: 204\n\t},\n\t// Support: IE9\n\t// We need to keep track of outbound xhr and abort them manually\n\t// because IE is not smart enough to do it all by itself\n\txhrId = 0,\n\txhrCallbacks = {};\n\nif ( window.ActiveXObject ) {\n\tjQuery( window ).on( \"unload\", function() {\n\t\tfor( var key in xhrCallbacks ) {\n\t\t\txhrCallbacks[ key ]();\n\t\t}\n\t\txhrCallbacks = undefined;\n\t});\n}\n\njQuery.support.cors = !!xhrSupported && ( \"withCredentials\" in xhrSupported );\njQuery.support.ajax = xhrSupported = !!xhrSupported;\n\njQuery.ajaxTransport(function( options ) {\n\tvar callback;\n\t// Cross domain only allowed if supported through XMLHttpRequest\n\tif ( jQuery.support.cors || xhrSupported && !options.crossDomain ) {\n\t\treturn {\n\t\t\tsend: function( headers, complete ) {\n\t\t\t\tvar i, id,\n\t\t\t\t\txhr = options.xhr();\n\t\t\t\txhr.open( options.type, options.url, options.async, options.username, options.password );\n\t\t\t\t// Apply custom fields if provided\n\t\t\t\tif ( options.xhrFields ) {\n\t\t\t\t\tfor ( i in options.xhrFields ) {\n\t\t\t\t\t\txhr[ i ] = options.xhrFields[ i ];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// Override mime type if needed\n\t\t\t\tif ( options.mimeType && xhr.overrideMimeType ) {\n\t\t\t\t\txhr.overrideMimeType( options.mimeType );\n\t\t\t\t}\n\t\t\t\t// X-Requested-With header\n\t\t\t\t// For cross-domain requests, seeing as conditions for a preflight are\n\t\t\t\t// akin to a jigsaw puzzle, we simply never set it to be sure.\n\t\t\t\t// (it can always be set on a per-request basis or even using ajaxSetup)\n\t\t\t\t// For same-domain requests, won't change header if already provided.\n\t\t\t\tif ( !options.crossDomain && !headers[\"X-Requested-With\"] ) {\n\t\t\t\t\theaders[\"X-Requested-With\"] = \"XMLHttpRequest\";\n\t\t\t\t}\n\t\t\t\t// Set headers\n\t\t\t\tfor ( i in headers ) {\n\t\t\t\t\txhr.setRequestHeader( i, headers[ i ] );\n\t\t\t\t}\n\t\t\t\t// Callback\n\t\t\t\tcallback = function( type ) {\n\t\t\t\t\treturn function() {\n\t\t\t\t\t\tif ( callback ) {\n\t\t\t\t\t\t\tdelete xhrCallbacks[ id ];\n\t\t\t\t\t\t\tcallback = xhr.onload = xhr.onerror = null;\n\t\t\t\t\t\t\tif ( type === \"abort\" ) {\n\t\t\t\t\t\t\t\txhr.abort();\n\t\t\t\t\t\t\t} else if ( type === \"error\" ) {\n\t\t\t\t\t\t\t\tcomplete(\n\t\t\t\t\t\t\t\t\t// file protocol always yields status 0, assume 404\n\t\t\t\t\t\t\t\t\txhr.status || 404,\n\t\t\t\t\t\t\t\t\txhr.statusText\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tcomplete(\n\t\t\t\t\t\t\t\t\txhrSuccessStatus[ xhr.status ] || xhr.status,\n\t\t\t\t\t\t\t\t\txhr.statusText,\n\t\t\t\t\t\t\t\t\t// Support: IE9\n\t\t\t\t\t\t\t\t\t// #11426: When requesting binary data, IE9 will throw an exception\n\t\t\t\t\t\t\t\t\t// on any attempt to access responseText\n\t\t\t\t\t\t\t\t\ttypeof xhr.responseText === \"string\" ? {\n\t\t\t\t\t\t\t\t\t\ttext: xhr.responseText\n\t\t\t\t\t\t\t\t\t} : undefined,\n\t\t\t\t\t\t\t\t\txhr.getAllResponseHeaders()\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};\n\t\t\t\t};\n\t\t\t\t// Listen to events\n\t\t\t\txhr.onload = callback();\n\t\t\t\txhr.onerror = callback(\"error\");\n\t\t\t\t// Create the abort callback\n\t\t\t\tcallback = xhrCallbacks[( id = xhrId++ )] = callback(\"abort\");\n\t\t\t\t// Do send the request\n\t\t\t\t// This may raise an exception which is actually\n\t\t\t\t// handled in jQuery.ajax (so no try/catch here)\n\t\t\t\txhr.send( options.hasContent && options.data || null );\n\t\t\t},\n\t\t\tabort: function() {\n\t\t\t\tif ( callback ) {\n\t\t\t\t\tcallback();\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t}\n});\nvar fxNow, timerId,\n\trfxtypes = /^(?:toggle|show|hide)$/,\n\trfxnum = new RegExp( \"^(?:([+-])=|)(\" + core_pnum + \")([a-z%]*)$\", \"i\" ),\n\trrun = /queueHooks$/,\n\tanimationPrefilters = [ defaultPrefilter ],\n\ttweeners = {\n\t\t\"*\": [function( prop, value ) {\n\t\t\tvar tween = this.createTween( prop, value ),\n\t\t\t\ttarget = tween.cur(),\n\t\t\t\tparts = rfxnum.exec( value ),\n\t\t\t\tunit = parts && parts[ 3 ] || ( jQuery.cssNumber[ prop ] ? \"\" : \"px\" ),\n\n\t\t\t\t// Starting value computation is required for potential unit mismatches\n\t\t\t\tstart = ( jQuery.cssNumber[ prop ] || unit !== \"px\" && +target ) &&\n\t\t\t\t\trfxnum.exec( jQuery.css( tween.elem, prop ) ),\n\t\t\t\tscale = 1,\n\t\t\t\tmaxIterations = 20;\n\n\t\t\tif ( start && start[ 3 ] !== unit ) {\n\t\t\t\t// Trust units reported by jQuery.css\n\t\t\t\tunit = unit || start[ 3 ];\n\n\t\t\t\t// Make sure we update the tween properties later on\n\t\t\t\tparts = parts || [];\n\n\t\t\t\t// Iteratively approximate from a nonzero starting point\n\t\t\t\tstart = +target || 1;\n\n\t\t\t\tdo {\n\t\t\t\t\t// If previous iteration zeroed out, double until we get *something*\n\t\t\t\t\t// Use a string for doubling factor so we don't accidentally see scale as unchanged below\n\t\t\t\t\tscale = scale || \".5\";\n\n\t\t\t\t\t// Adjust and apply\n\t\t\t\t\tstart = start / scale;\n\t\t\t\t\tjQuery.style( tween.elem, prop, start + unit );\n\n\t\t\t\t// Update scale, tolerating zero or NaN from tween.cur()\n\t\t\t\t// And breaking the loop if scale is unchanged or perfect, or if we've just had enough\n\t\t\t\t} while ( scale !== (scale = tween.cur() / target) && scale !== 1 && --maxIterations );\n\t\t\t}\n\n\t\t\t// Update tween properties\n\t\t\tif ( parts ) {\n\t\t\t\tstart = tween.start = +start || +target || 0;\n\t\t\t\ttween.unit = unit;\n\t\t\t\t// If a +=/-= token was provided, we're doing a relative animation\n\t\t\t\ttween.end = parts[ 1 ] ?\n\t\t\t\t\tstart + ( parts[ 1 ] + 1 ) * parts[ 2 ] :\n\t\t\t\t\t+parts[ 2 ];\n\t\t\t}\n\n\t\t\treturn tween;\n\t\t}]\n\t};\n\n// Animations created synchronously will run synchronously\nfunction createFxNow() {\n\tsetTimeout(function() {\n\t\tfxNow = undefined;\n\t});\n\treturn ( fxNow = jQuery.now() );\n}\n\nfunction createTween( value, prop, animation ) {\n\tvar tween,\n\t\tcollection = ( tweeners[ prop ] || [] ).concat( tweeners[ \"*\" ] ),\n\t\tindex = 0,\n\t\tlength = collection.length;\n\tfor ( ; index < length; index++ ) {\n\t\tif ( (tween = collection[ index ].call( animation, prop, value )) ) {\n\n\t\t\t// we're done with this property\n\t\t\treturn tween;\n\t\t}\n\t}\n}\n\nfunction Animation( elem, properties, options ) {\n\tvar result,\n\t\tstopped,\n\t\tindex = 0,\n\t\tlength = animationPrefilters.length,\n\t\tdeferred = jQuery.Deferred().always( function() {\n\t\t\t// don't match elem in the :animated selector\n\t\t\tdelete tick.elem;\n\t\t}),\n\t\ttick = function() {\n\t\t\tif ( stopped ) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tvar currentTime = fxNow || createFxNow(),\n\t\t\t\tremaining = Math.max( 0, animation.startTime + animation.duration - currentTime ),\n\t\t\t\t// archaic crash bug won't allow us to use 1 - ( 0.5 || 0 ) (#12497)\n\t\t\t\ttemp = remaining / animation.duration || 0,\n\t\t\t\tpercent = 1 - temp,\n\t\t\t\tindex = 0,\n\t\t\t\tlength = animation.tweens.length;\n\n\t\t\tfor ( ; index < length ; index++ ) {\n\t\t\t\tanimation.tweens[ index ].run( percent );\n\t\t\t}\n\n\t\t\tdeferred.notifyWith( elem, [ animation, percent, remaining ]);\n\n\t\t\tif ( percent < 1 && length ) {\n\t\t\t\treturn remaining;\n\t\t\t} else {\n\t\t\t\tdeferred.resolveWith( elem, [ animation ] );\n\t\t\t\treturn false;\n\t\t\t}\n\t\t},\n\t\tanimation = deferred.promise({\n\t\t\telem: elem,\n\t\t\tprops: jQuery.extend( {}, properties ),\n\t\t\topts: jQuery.extend( true, { specialEasing: {} }, options ),\n\t\t\toriginalProperties: properties,\n\t\t\toriginalOptions: options,\n\t\t\tstartTime: fxNow || createFxNow(),\n\t\t\tduration: options.duration,\n\t\t\ttweens: [],\n\t\t\tcreateTween: function( prop, end ) {\n\t\t\t\tvar tween = jQuery.Tween( elem, animation.opts, prop, end,\n\t\t\t\t\t\tanimation.opts.specialEasing[ prop ] || animation.opts.easing );\n\t\t\t\tanimation.tweens.push( tween );\n\t\t\t\treturn tween;\n\t\t\t},\n\t\t\tstop: function( gotoEnd ) {\n\t\t\t\tvar index = 0,\n\t\t\t\t\t// if we are going to the end, we want to run all the tweens\n\t\t\t\t\t// otherwise we skip this part\n\t\t\t\t\tlength = gotoEnd ? animation.tweens.length : 0;\n\t\t\t\tif ( stopped ) {\n\t\t\t\t\treturn this;\n\t\t\t\t}\n\t\t\t\tstopped = true;\n\t\t\t\tfor ( ; index < length ; index++ ) {\n\t\t\t\t\tanimation.tweens[ index ].run( 1 );\n\t\t\t\t}\n\n\t\t\t\t// resolve when we played the last frame\n\t\t\t\t// otherwise, reject\n\t\t\t\tif ( gotoEnd ) {\n\t\t\t\t\tdeferred.resolveWith( elem, [ animation, gotoEnd ] );\n\t\t\t\t} else {\n\t\t\t\t\tdeferred.rejectWith( elem, [ animation, gotoEnd ] );\n\t\t\t\t}\n\t\t\t\treturn this;\n\t\t\t}\n\t\t}),\n\t\tprops = animation.props;\n\n\tpropFilter( props, animation.opts.specialEasing );\n\n\tfor ( ; index < length ; index++ ) {\n\t\tresult = animationPrefilters[ index ].call( animation, elem, props, animation.opts );\n\t\tif ( result ) {\n\t\t\treturn result;\n\t\t}\n\t}\n\n\tjQuery.map( props, createTween, animation );\n\n\tif ( jQuery.isFunction( animation.opts.start ) ) {\n\t\tanimation.opts.start.call( elem, animation );\n\t}\n\n\tjQuery.fx.timer(\n\t\tjQuery.extend( tick, {\n\t\t\telem: elem,\n\t\t\tanim: animation,\n\t\t\tqueue: animation.opts.queue\n\t\t})\n\t);\n\n\t// attach callbacks from options\n\treturn animation.progress( animation.opts.progress )\n\t\t.done( animation.opts.done, animation.opts.complete )\n\t\t.fail( animation.opts.fail )\n\t\t.always( animation.opts.always );\n}\n\nfunction propFilter( props, specialEasing ) {\n\tvar index, name, easing, value, hooks;\n\n\t// camelCase, specialEasing and expand cssHook pass\n\tfor ( index in props ) {\n\t\tname = jQuery.camelCase( index );\n\t\teasing = specialEasing[ name ];\n\t\tvalue = props[ index ];\n\t\tif ( jQuery.isArray( value ) ) {\n\t\t\teasing = value[ 1 ];\n\t\t\tvalue = props[ index ] = value[ 0 ];\n\t\t}\n\n\t\tif ( index !== name ) {\n\t\t\tprops[ name ] = value;\n\t\t\tdelete props[ index ];\n\t\t}\n\n\t\thooks = jQuery.cssHooks[ name ];\n\t\tif ( hooks && \"expand\" in hooks ) {\n\t\t\tvalue = hooks.expand( value );\n\t\t\tdelete props[ name ];\n\n\t\t\t// not quite $.extend, this wont overwrite keys already present.\n\t\t\t// also - reusing 'index' from above because we have the correct \"name\"\n\t\t\tfor ( index in value ) {\n\t\t\t\tif ( !( index in props ) ) {\n\t\t\t\t\tprops[ index ] = value[ index ];\n\t\t\t\t\tspecialEasing[ index ] = easing;\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tspecialEasing[ name ] = easing;\n\t\t}\n\t}\n}\n\njQuery.Animation = jQuery.extend( Animation, {\n\n\ttweener: function( props, callback ) {\n\t\tif ( jQuery.isFunction( props ) ) {\n\t\t\tcallback = props;\n\t\t\tprops = [ \"*\" ];\n\t\t} else {\n\t\t\tprops = props.split(\" \");\n\t\t}\n\n\t\tvar prop,\n\t\t\tindex = 0,\n\t\t\tlength = props.length;\n\n\t\tfor ( ; index < length ; index++ ) {\n\t\t\tprop = props[ index ];\n\t\t\ttweeners[ prop ] = tweeners[ prop ] || [];\n\t\t\ttweeners[ prop ].unshift( callback );\n\t\t}\n\t},\n\n\tprefilter: function( callback, prepend ) {\n\t\tif ( prepend ) {\n\t\t\tanimationPrefilters.unshift( callback );\n\t\t} else {\n\t\t\tanimationPrefilters.push( callback );\n\t\t}\n\t}\n});\n\nfunction defaultPrefilter( elem, props, opts ) {\n\t/* jshint validthis: true */\n\tvar prop, value, toggle, tween, hooks, oldfire,\n\t\tanim = this,\n\t\torig = {},\n\t\tstyle = elem.style,\n\t\thidden = elem.nodeType && isHidden( elem ),\n\t\tdataShow = data_priv.get( elem, \"fxshow\" );\n\n\t// handle queue: false promises\n\tif ( !opts.queue ) {\n\t\thooks = jQuery._queueHooks( elem, \"fx\" );\n\t\tif ( hooks.unqueued == null ) {\n\t\t\thooks.unqueued = 0;\n\t\t\toldfire = hooks.empty.fire;\n\t\t\thooks.empty.fire = function() {\n\t\t\t\tif ( !hooks.unqueued ) {\n\t\t\t\t\toldfire();\n\t\t\t\t}\n\t\t\t};\n\t\t}\n\t\thooks.unqueued++;\n\n\t\tanim.always(function() {\n\t\t\t// doing this makes sure that the complete handler will be called\n\t\t\t// before this completes\n\t\t\tanim.always(function() {\n\t\t\t\thooks.unqueued--;\n\t\t\t\tif ( !jQuery.queue( elem, \"fx\" ).length ) {\n\t\t\t\t\thooks.empty.fire();\n\t\t\t\t}\n\t\t\t});\n\t\t});\n\t}\n\n\t// height/width overflow pass\n\tif ( elem.nodeType === 1 && ( \"height\" in props || \"width\" in props ) ) {\n\t\t// Make sure that nothing sneaks out\n\t\t// Record all 3 overflow attributes because IE9-10 do not\n\t\t// change the overflow attribute when overflowX and\n\t\t// overflowY are set to the same value\n\t\topts.overflow = [ style.overflow, style.overflowX, style.overflowY ];\n\n\t\t// Set display property to inline-block for height/width\n\t\t// animations on inline elements that are having width/height animated\n\t\tif ( jQuery.css( elem, \"display\" ) === \"inline\" &&\n\t\t\t\tjQuery.css( elem, \"float\" ) === \"none\" ) {\n\n\t\t\tstyle.display = \"inline-block\";\n\t\t}\n\t}\n\n\tif ( opts.overflow ) {\n\t\tstyle.overflow = \"hidden\";\n\t\tanim.always(function() {\n\t\t\tstyle.overflow = opts.overflow[ 0 ];\n\t\t\tstyle.overflowX = opts.overflow[ 1 ];\n\t\t\tstyle.overflowY = opts.overflow[ 2 ];\n\t\t});\n\t}\n\n\n\t// show/hide pass\n\tfor ( prop in props ) {\n\t\tvalue = props[ prop ];\n\t\tif ( rfxtypes.exec( value ) ) {\n\t\t\tdelete props[ prop ];\n\t\t\ttoggle = toggle || value === \"toggle\";\n\t\t\tif ( value === ( hidden ? \"hide\" : \"show\" ) ) {\n\n\t\t\t\t// If there is dataShow left over from a stopped hide or show and we are going to proceed with show, we should pretend to be hidden\n\t\t\t\tif ( value === \"show\" && dataShow && dataShow[ prop ] !== undefined ) {\n\t\t\t\t\thidden = true;\n\t\t\t\t} else {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t}\n\t\t\torig[ prop ] = dataShow && dataShow[ prop ] || jQuery.style( elem, prop );\n\t\t}\n\t}\n\n\tif ( !jQuery.isEmptyObject( orig ) ) {\n\t\tif ( dataShow ) {\n\t\t\tif ( \"hidden\" in dataShow ) {\n\t\t\t\thidden = dataShow.hidden;\n\t\t\t}\n\t\t} else {\n\t\t\tdataShow = data_priv.access( elem, \"fxshow\", {} );\n\t\t}\n\n\t\t// store state if its toggle - enables .stop().toggle() to \"reverse\"\n\t\tif ( toggle ) {\n\t\t\tdataShow.hidden = !hidden;\n\t\t}\n\t\tif ( hidden ) {\n\t\t\tjQuery( elem ).show();\n\t\t} else {\n\t\t\tanim.done(function() {\n\t\t\t\tjQuery( elem ).hide();\n\t\t\t});\n\t\t}\n\t\tanim.done(function() {\n\t\t\tvar prop;\n\n\t\t\tdata_priv.remove( elem, \"fxshow\" );\n\t\t\tfor ( prop in orig ) {\n\t\t\t\tjQuery.style( elem, prop, orig[ prop ] );\n\t\t\t}\n\t\t});\n\t\tfor ( prop in orig ) {\n\t\t\ttween = createTween( hidden ? dataShow[ prop ] : 0, prop, anim );\n\n\t\t\tif ( !( prop in dataShow ) ) {\n\t\t\t\tdataShow[ prop ] = tween.start;\n\t\t\t\tif ( hidden ) {\n\t\t\t\t\ttween.end = tween.start;\n\t\t\t\t\ttween.start = prop === \"width\" || prop === \"height\" ? 1 : 0;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunction Tween( elem, options, prop, end, easing ) {\n\treturn new Tween.prototype.init( elem, options, prop, end, easing );\n}\njQuery.Tween = Tween;\n\nTween.prototype = {\n\tconstructor: Tween,\n\tinit: function( elem, options, prop, end, easing, unit ) {\n\t\tthis.elem = elem;\n\t\tthis.prop = prop;\n\t\tthis.easing = easing || \"swing\";\n\t\tthis.options = options;\n\t\tthis.start = this.now = this.cur();\n\t\tthis.end = end;\n\t\tthis.unit = unit || ( jQuery.cssNumber[ prop ] ? \"\" : \"px\" );\n\t},\n\tcur: function() {\n\t\tvar hooks = Tween.propHooks[ this.prop ];\n\n\t\treturn hooks && hooks.get ?\n\t\t\thooks.get( this ) :\n\t\t\tTween.propHooks._default.get( this );\n\t},\n\trun: function( percent ) {\n\t\tvar eased,\n\t\t\thooks = Tween.propHooks[ this.prop ];\n\n\t\tif ( this.options.duration ) {\n\t\t\tthis.pos = eased = jQuery.easing[ this.easing ](\n\t\t\t\tpercent, this.options.duration * percent, 0, 1, this.options.duration\n\t\t\t);\n\t\t} else {\n\t\t\tthis.pos = eased = percent;\n\t\t}\n\t\tthis.now = ( this.end - this.start ) * eased + this.start;\n\n\t\tif ( this.options.step ) {\n\t\t\tthis.options.step.call( this.elem, this.now, this );\n\t\t}\n\n\t\tif ( hooks && hooks.set ) {\n\t\t\thooks.set( this );\n\t\t} else {\n\t\t\tTween.propHooks._default.set( this );\n\t\t}\n\t\treturn this;\n\t}\n};\n\nTween.prototype.init.prototype = Tween.prototype;\n\nTween.propHooks = {\n\t_default: {\n\t\tget: function( tween ) {\n\t\t\tvar result;\n\n\t\t\tif ( tween.elem[ tween.prop ] != null &&\n\t\t\t\t(!tween.elem.style || tween.elem.style[ tween.prop ] == null) ) {\n\t\t\t\treturn tween.elem[ tween.prop ];\n\t\t\t}\n\n\t\t\t// passing an empty string as a 3rd parameter to .css will automatically\n\t\t\t// attempt a parseFloat and fallback to a string if the parse fails\n\t\t\t// so, simple values such as \"10px\" are parsed to Float.\n\t\t\t// complex values such as \"rotate(1rad)\" are returned as is.\n\t\t\tresult = jQuery.css( tween.elem, tween.prop, \"\" );\n\t\t\t// Empty strings, null, undefined and \"auto\" are converted to 0.\n\t\t\treturn !result || result === \"auto\" ? 0 : result;\n\t\t},\n\t\tset: function( tween ) {\n\t\t\t// use step hook for back compat - use cssHook if its there - use .style if its\n\t\t\t// available and use plain properties where available\n\t\t\tif ( jQuery.fx.step[ tween.prop ] ) {\n\t\t\t\tjQuery.fx.step[ tween.prop ]( tween );\n\t\t\t} else if ( tween.elem.style && ( tween.elem.style[ jQuery.cssProps[ tween.prop ] ] != null || jQuery.cssHooks[ tween.prop ] ) ) {\n\t\t\t\tjQuery.style( tween.elem, tween.prop, tween.now + tween.unit );\n\t\t\t} else {\n\t\t\t\ttween.elem[ tween.prop ] = tween.now;\n\t\t\t}\n\t\t}\n\t}\n};\n\n// Support: IE9\n// Panic based approach to setting things on disconnected nodes\n\nTween.propHooks.scrollTop = Tween.propHooks.scrollLeft = {\n\tset: function( tween ) {\n\t\tif ( tween.elem.nodeType && tween.elem.parentNode ) {\n\t\t\ttween.elem[ tween.prop ] = tween.now;\n\t\t}\n\t}\n};\n\njQuery.each([ \"toggle\", \"show\", \"hide\" ], function( i, name ) {\n\tvar cssFn = jQuery.fn[ name ];\n\tjQuery.fn[ name ] = function( speed, easing, callback ) {\n\t\treturn speed == null || typeof speed === \"boolean\" ?\n\t\t\tcssFn.apply( this, arguments ) :\n\t\t\tthis.animate( genFx( name, true ), speed, easing, callback );\n\t};\n});\n\njQuery.fn.extend({\n\tfadeTo: function( speed, to, easing, callback ) {\n\n\t\t// show any hidden elements after setting opacity to 0\n\t\treturn this.filter( isHidden ).css( \"opacity\", 0 ).show()\n\n\t\t\t// animate to the value specified\n\t\t\t.end().animate({ opacity: to }, speed, easing, callback );\n\t},\n\tanimate: function( prop, speed, easing, callback ) {\n\t\tvar empty = jQuery.isEmptyObject( prop ),\n\t\t\toptall = jQuery.speed( speed, easing, callback ),\n\t\t\tdoAnimation = function() {\n\t\t\t\t// Operate on a copy of prop so per-property easing won't be lost\n\t\t\t\tvar anim = Animation( this, jQuery.extend( {}, prop ), optall );\n\n\t\t\t\t// Empty animations, or finishing resolves immediately\n\t\t\t\tif ( empty || data_priv.get( this, \"finish\" ) ) {\n\t\t\t\t\tanim.stop( true );\n\t\t\t\t}\n\t\t\t};\n\t\t\tdoAnimation.finish = doAnimation;\n\n\t\treturn empty || optall.queue === false ?\n\t\t\tthis.each( doAnimation ) :\n\t\t\tthis.queue( optall.queue, doAnimation );\n\t},\n\tstop: function( type, clearQueue, gotoEnd ) {\n\t\tvar stopQueue = function( hooks ) {\n\t\t\tvar stop = hooks.stop;\n\t\t\tdelete hooks.stop;\n\t\t\tstop( gotoEnd );\n\t\t};\n\n\t\tif ( typeof type !== \"string\" ) {\n\t\t\tgotoEnd = clearQueue;\n\t\t\tclearQueue = type;\n\t\t\ttype = undefined;\n\t\t}\n\t\tif ( clearQueue && type !== false ) {\n\t\t\tthis.queue( type || \"fx\", [] );\n\t\t}\n\n\t\treturn this.each(function() {\n\t\t\tvar dequeue = true,\n\t\t\t\tindex = type != null && type + \"queueHooks\",\n\t\t\t\ttimers = jQuery.timers,\n\t\t\t\tdata = data_priv.get( this );\n\n\t\t\tif ( index ) {\n\t\t\t\tif ( data[ index ] && data[ index ].stop ) {\n\t\t\t\t\tstopQueue( data[ index ] );\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tfor ( index in data ) {\n\t\t\t\t\tif ( data[ index ] && data[ index ].stop && rrun.test( index ) ) {\n\t\t\t\t\t\tstopQueue( data[ index ] );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfor ( index = timers.length; index--; ) {\n\t\t\t\tif ( timers[ index ].elem === this && (type == null || timers[ index ].queue === type) ) {\n\t\t\t\t\ttimers[ index ].anim.stop( gotoEnd );\n\t\t\t\t\tdequeue = false;\n\t\t\t\t\ttimers.splice( index, 1 );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// start the next in the queue if the last step wasn't forced\n\t\t\t// timers currently will call their complete callbacks, which will dequeue\n\t\t\t// but only if they were gotoEnd\n\t\t\tif ( dequeue || !gotoEnd ) {\n\t\t\t\tjQuery.dequeue( this, type );\n\t\t\t}\n\t\t});\n\t},\n\tfinish: function( type ) {\n\t\tif ( type !== false ) {\n\t\t\ttype = type || \"fx\";\n\t\t}\n\t\treturn this.each(function() {\n\t\t\tvar index,\n\t\t\t\tdata = data_priv.get( this ),\n\t\t\t\tqueue = data[ type + \"queue\" ],\n\t\t\t\thooks = data[ type + \"queueHooks\" ],\n\t\t\t\ttimers = jQuery.timers,\n\t\t\t\tlength = queue ? queue.length : 0;\n\n\t\t\t// enable finishing flag on private data\n\t\t\tdata.finish = true;\n\n\t\t\t// empty the queue first\n\t\t\tjQuery.queue( this, type, [] );\n\n\t\t\tif ( hooks && hooks.stop ) {\n\t\t\t\thooks.stop.call( this, true );\n\t\t\t}\n\n\t\t\t// look for any active animations, and finish them\n\t\t\tfor ( index = timers.length; index--; ) {\n\t\t\t\tif ( timers[ index ].elem === this && timers[ index ].queue === type ) {\n\t\t\t\t\ttimers[ index ].anim.stop( true );\n\t\t\t\t\ttimers.splice( index, 1 );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// look for any animations in the old queue and finish them\n\t\t\tfor ( index = 0; index < length; index++ ) {\n\t\t\t\tif ( queue[ index ] && queue[ index ].finish ) {\n\t\t\t\t\tqueue[ index ].finish.call( this );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// turn off finishing flag\n\t\t\tdelete data.finish;\n\t\t});\n\t}\n});\n\n// Generate parameters to create a standard animation\nfunction genFx( type, includeWidth ) {\n\tvar which,\n\t\tattrs = { height: type },\n\t\ti = 0;\n\n\t// if we include width, step value is 1 to do all cssExpand values,\n\t// if we don't include width, step value is 2 to skip over Left and Right\n\tincludeWidth = includeWidth? 1 : 0;\n\tfor( ; i < 4 ; i += 2 - includeWidth ) {\n\t\twhich = cssExpand[ i ];\n\t\tattrs[ \"margin\" + which ] = attrs[ \"padding\" + which ] = type;\n\t}\n\n\tif ( includeWidth ) {\n\t\tattrs.opacity = attrs.width = type;\n\t}\n\n\treturn attrs;\n}\n\n// Generate shortcuts for custom animations\njQuery.each({\n\tslideDown: genFx(\"show\"),\n\tslideUp: genFx(\"hide\"),\n\tslideToggle: genFx(\"toggle\"),\n\tfadeIn: { opacity: \"show\" },\n\tfadeOut: { opacity: \"hide\" },\n\tfadeToggle: { opacity: \"toggle\" }\n}, function( name, props ) {\n\tjQuery.fn[ name ] = function( speed, easing, callback ) {\n\t\treturn this.animate( props, speed, easing, callback );\n\t};\n});\n\njQuery.speed = function( speed, easing, fn ) {\n\tvar opt = speed && typeof speed === \"object\" ? jQuery.extend( {}, speed ) : {\n\t\tcomplete: fn || !fn && easing ||\n\t\t\tjQuery.isFunction( speed ) && speed,\n\t\tduration: speed,\n\t\teasing: fn && easing || easing && !jQuery.isFunction( easing ) && easing\n\t};\n\n\topt.duration = jQuery.fx.off ? 0 : typeof opt.duration === \"number\" ? opt.duration :\n\t\topt.duration in jQuery.fx.speeds ? jQuery.fx.speeds[ opt.duration ] : jQuery.fx.speeds._default;\n\n\t// normalize opt.queue - true/undefined/null -> \"fx\"\n\tif ( opt.queue == null || opt.queue === true ) {\n\t\topt.queue = \"fx\";\n\t}\n\n\t// Queueing\n\topt.old = opt.complete;\n\n\topt.complete = function() {\n\t\tif ( jQuery.isFunction( opt.old ) ) {\n\t\t\topt.old.call( this );\n\t\t}\n\n\t\tif ( opt.queue ) {\n\t\t\tjQuery.dequeue( this, opt.queue );\n\t\t}\n\t};\n\n\treturn opt;\n};\n\njQuery.easing = {\n\tlinear: function( p ) {\n\t\treturn p;\n\t},\n\tswing: function( p ) {\n\t\treturn 0.5 - Math.cos( p*Math.PI ) / 2;\n\t}\n};\n\njQuery.timers = [];\njQuery.fx = Tween.prototype.init;\njQuery.fx.tick = function() {\n\tvar timer,\n\t\ttimers = jQuery.timers,\n\t\ti = 0;\n\n\tfxNow = jQuery.now();\n\n\tfor ( ; i < timers.length; i++ ) {\n\t\ttimer = timers[ i ];\n\t\t// Checks the timer has not already been removed\n\t\tif ( !timer() && timers[ i ] === timer ) {\n\t\t\ttimers.splice( i--, 1 );\n\t\t}\n\t}\n\n\tif ( !timers.length ) {\n\t\tjQuery.fx.stop();\n\t}\n\tfxNow = undefined;\n};\n\njQuery.fx.timer = function( timer ) {\n\tif ( timer() && jQuery.timers.push( timer ) ) {\n\t\tjQuery.fx.start();\n\t}\n};\n\njQuery.fx.interval = 13;\n\njQuery.fx.start = function() {\n\tif ( !timerId ) {\n\t\ttimerId = setInterval( jQuery.fx.tick, jQuery.fx.interval );\n\t}\n};\n\njQuery.fx.stop = function() {\n\tclearInterval( timerId );\n\ttimerId = null;\n};\n\njQuery.fx.speeds = {\n\tslow: 600,\n\tfast: 200,\n\t// Default speed\n\t_default: 400\n};\n\n// Back Compat <1.8 extension point\njQuery.fx.step = {};\n\nif ( jQuery.expr && jQuery.expr.filters ) {\n\tjQuery.expr.filters.animated = function( elem ) {\n\t\treturn jQuery.grep(jQuery.timers, function( fn ) {\n\t\t\treturn elem === fn.elem;\n\t\t}).length;\n\t};\n}\njQuery.fn.offset = function( options ) {\n\tif ( arguments.length ) {\n\t\treturn options === undefined ?\n\t\t\tthis :\n\t\t\tthis.each(function( i ) {\n\t\t\t\tjQuery.offset.setOffset( this, options, i );\n\t\t\t});\n\t}\n\n\tvar docElem, win,\n\t\telem = this[ 0 ],\n\t\tbox = { top: 0, left: 0 },\n\t\tdoc = elem && elem.ownerDocument;\n\n\tif ( !doc ) {\n\t\treturn;\n\t}\n\n\tdocElem = doc.documentElement;\n\n\t// Make sure it's not a disconnected DOM node\n\tif ( !jQuery.contains( docElem, elem ) ) {\n\t\treturn box;\n\t}\n\n\t// If we don't have gBCR, just use 0,0 rather than error\n\t// BlackBerry 5, iOS 3 (original iPhone)\n\tif ( typeof elem.getBoundingClientRect !== core_strundefined ) {\n\t\tbox = elem.getBoundingClientRect();\n\t}\n\twin = getWindow( doc );\n\treturn {\n\t\ttop: box.top + win.pageYOffset - docElem.clientTop,\n\t\tleft: box.left + win.pageXOffset - docElem.clientLeft\n\t};\n};\n\njQuery.offset = {\n\n\tsetOffset: function( elem, options, i ) {\n\t\tvar curPosition, curLeft, curCSSTop, curTop, curOffset, curCSSLeft, calculatePosition,\n\t\t\tposition = jQuery.css( elem, \"position\" ),\n\t\t\tcurElem = jQuery( elem ),\n\t\t\tprops = {};\n\n\t\t// Set position first, in-case top/left are set even on static elem\n\t\tif ( position === \"static\" ) {\n\t\t\telem.style.position = \"relative\";\n\t\t}\n\n\t\tcurOffset = curElem.offset();\n\t\tcurCSSTop = jQuery.css( elem, \"top\" );\n\t\tcurCSSLeft = jQuery.css( elem, \"left\" );\n\t\tcalculatePosition = ( position === \"absolute\" || position === \"fixed\" ) && ( curCSSTop + curCSSLeft ).indexOf(\"auto\") > -1;\n\n\t\t// Need to be able to calculate position if either top or left is auto and position is either absolute or fixed\n\t\tif ( calculatePosition ) {\n\t\t\tcurPosition = curElem.position();\n\t\t\tcurTop = curPosition.top;\n\t\t\tcurLeft = curPosition.left;\n\n\t\t} else {\n\t\t\tcurTop = parseFloat( curCSSTop ) || 0;\n\t\t\tcurLeft = parseFloat( curCSSLeft ) || 0;\n\t\t}\n\n\t\tif ( jQuery.isFunction( options ) ) {\n\t\t\toptions = options.call( elem, i, curOffset );\n\t\t}\n\n\t\tif ( options.top != null ) {\n\t\t\tprops.top = ( options.top - curOffset.top ) + curTop;\n\t\t}\n\t\tif ( options.left != null ) {\n\t\t\tprops.left = ( options.left - curOffset.left ) + curLeft;\n\t\t}\n\n\t\tif ( \"using\" in options ) {\n\t\t\toptions.using.call( elem, props );\n\n\t\t} else {\n\t\t\tcurElem.css( props );\n\t\t}\n\t}\n};\n\n\njQuery.fn.extend({\n\n\tposition: function() {\n\t\tif ( !this[ 0 ] ) {\n\t\t\treturn;\n\t\t}\n\n\t\tvar offsetParent, offset,\n\t\t\telem = this[ 0 ],\n\t\t\tparentOffset = { top: 0, left: 0 };\n\n\t\t// Fixed elements are offset from window (parentOffset = {top:0, left: 0}, because it is it's only offset parent\n\t\tif ( jQuery.css( elem, \"position\" ) === \"fixed\" ) {\n\t\t\t// We assume that getBoundingClientRect is available when computed position is fixed\n\t\t\toffset = elem.getBoundingClientRect();\n\n\t\t} else {\n\t\t\t// Get *real* offsetParent\n\t\t\toffsetParent = this.offsetParent();\n\n\t\t\t// Get correct offsets\n\t\t\toffset = this.offset();\n\t\t\tif ( !jQuery.nodeName( offsetParent[ 0 ], \"html\" ) ) {\n\t\t\t\tparentOffset = offsetParent.offset();\n\t\t\t}\n\n\t\t\t// Add offsetParent borders\n\t\t\tparentOffset.top += jQuery.css( offsetParent[ 0 ], \"borderTopWidth\", true );\n\t\t\tparentOffset.left += jQuery.css( offsetParent[ 0 ], \"borderLeftWidth\", true );\n\t\t}\n\n\t\t// Subtract parent offsets and element margins\n\t\treturn {\n\t\t\ttop: offset.top - parentOffset.top - jQuery.css( elem, \"marginTop\", true ),\n\t\t\tleft: offset.left - parentOffset.left - jQuery.css( elem, \"marginLeft\", true )\n\t\t};\n\t},\n\n\toffsetParent: function() {\n\t\treturn this.map(function() {\n\t\t\tvar offsetParent = this.offsetParent || docElem;\n\n\t\t\twhile ( offsetParent && ( !jQuery.nodeName( offsetParent, \"html\" ) && jQuery.css( offsetParent, \"position\") === \"static\" ) ) {\n\t\t\t\toffsetParent = offsetParent.offsetParent;\n\t\t\t}\n\n\t\t\treturn offsetParent || docElem;\n\t\t});\n\t}\n});\n\n\n// Create scrollLeft and scrollTop methods\njQuery.each( {scrollLeft: \"pageXOffset\", scrollTop: \"pageYOffset\"}, function( method, prop ) {\n\tvar top = \"pageYOffset\" === prop;\n\n\tjQuery.fn[ method ] = function( val ) {\n\t\treturn jQuery.access( this, function( elem, method, val ) {\n\t\t\tvar win = getWindow( elem );\n\n\t\t\tif ( val === undefined ) {\n\t\t\t\treturn win ? win[ prop ] : elem[ method ];\n\t\t\t}\n\n\t\t\tif ( win ) {\n\t\t\t\twin.scrollTo(\n\t\t\t\t\t!top ? val : window.pageXOffset,\n\t\t\t\t\ttop ? val : window.pageYOffset\n\t\t\t\t);\n\n\t\t\t} else {\n\t\t\t\telem[ method ] = val;\n\t\t\t}\n\t\t}, method, val, arguments.length, null );\n\t};\n});\n\nfunction getWindow( elem ) {\n\treturn jQuery.isWindow( elem ) ? elem : elem.nodeType === 9 && elem.defaultView;\n}\n// Create innerHeight, innerWidth, height, width, outerHeight and outerWidth methods\njQuery.each( { Height: \"height\", Width: \"width\" }, function( name, type ) {\n\tjQuery.each( { padding: \"inner\" + name, content: type, \"\": \"outer\" + name }, function( defaultExtra, funcName ) {\n\t\t// margin is only for outerHeight, outerWidth\n\t\tjQuery.fn[ funcName ] = function( margin, value ) {\n\t\t\tvar chainable = arguments.length && ( defaultExtra || typeof margin !== \"boolean\" ),\n\t\t\t\textra = defaultExtra || ( margin === true || value === true ? \"margin\" : \"border\" );\n\n\t\t\treturn jQuery.access( this, function( elem, type, value ) {\n\t\t\t\tvar doc;\n\n\t\t\t\tif ( jQuery.isWindow( elem ) ) {\n\t\t\t\t\t// As of 5/8/2012 this will yield incorrect results for Mobile Safari, but there\n\t\t\t\t\t// isn't a whole lot we can do. See pull request at this URL for discussion:\n\t\t\t\t\t// https://github.com/jquery/jquery/pull/764\n\t\t\t\t\treturn elem.document.documentElement[ \"client\" + name ];\n\t\t\t\t}\n\n\t\t\t\t// Get document width or height\n\t\t\t\tif ( elem.nodeType === 9 ) {\n\t\t\t\t\tdoc = elem.documentElement;\n\n\t\t\t\t\t// Either scroll[Width/Height] or offset[Width/Height] or client[Width/Height],\n\t\t\t\t\t// whichever is greatest\n\t\t\t\t\treturn Math.max(\n\t\t\t\t\t\telem.body[ \"scroll\" + name ], doc[ \"scroll\" + name ],\n\t\t\t\t\t\telem.body[ \"offset\" + name ], doc[ \"offset\" + name ],\n\t\t\t\t\t\tdoc[ \"client\" + name ]\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\treturn value === undefined ?\n\t\t\t\t\t// Get width or height on the element, requesting but not forcing parseFloat\n\t\t\t\t\tjQuery.css( elem, type, extra ) :\n\n\t\t\t\t\t// Set width or height on the element\n\t\t\t\t\tjQuery.style( elem, type, value, extra );\n\t\t\t}, type, chainable ? margin : undefined, chainable, null );\n\t\t};\n\t});\n});\n// Limit scope pollution from any deprecated API\n// (function() {\n\n// The number of elements contained in the matched element set\njQuery.fn.size = function() {\n\treturn this.length;\n};\n\njQuery.fn.andSelf = jQuery.fn.addBack;\n\n// })();\nif ( typeof module === \"object\" && module && typeof module.exports === \"object\" ) {\n\t// Expose jQuery as module.exports in loaders that implement the Node\n\t// module pattern (including browserify). Do not create the global, since\n\t// the user will be storing it themselves locally, and globals are frowned\n\t// upon in the Node module world.\n\tmodule.exports = jQuery;\n} else {\n\t// Register as a named AMD module, since jQuery can be concatenated with other\n\t// files that may use define, but not via a proper concatenation script that\n\t// understands anonymous AMD modules. A named AMD is safest and most robust\n\t// way to register. Lowercase jquery is used because AMD module names are\n\t// derived from file names, and jQuery is normally delivered in a lowercase\n\t// file name. Do this after creating the global so that if an AMD module wants\n\t// to call noConflict to hide this version of jQuery, it will work.\n\tif ( typeof define === \"function\" && define.amd ) {\n\t\tdefine( \"jquery\", [], function () { return jQuery; } );\n\t}\n}\n\n// If there is a window object, that at least has a document property,\n// define jQuery and $ identifiers\nif ( typeof window === \"object\" && typeof window.document === \"object\" ) {\n\twindow.jQuery = window.$ = jQuery;\n}\n\n})( window );\n","/**!\n * AngularJS file upload directives and services. Supoorts: file upload/drop/paste, resume, cancel/abort,\n * progress, resize, thumbnail, preview, validation and CORS\n * @author Danial <danial.farid@gmail.com>\n * @version 12.0.4\n */\n\nif (window.XMLHttpRequest && !(window.FileAPI && FileAPI.shouldLoad)) {\n window.XMLHttpRequest.prototype.setRequestHeader = (function (orig) {\n return function (header, value) {\n if (header === '__setXHR_') {\n var val = value(this);\n // fix for angular < 1.2.0\n if (val instanceof Function) {\n val(this);\n }\n } else {\n orig.apply(this, arguments);\n }\n };\n })(window.XMLHttpRequest.prototype.setRequestHeader);\n}\n\nvar ngFileUpload = angular.module('ngFileUpload', []);\n\nngFileUpload.version = '12.0.4';\n\nngFileUpload.service('UploadBase', ['$http', '$q', '$timeout', function ($http, $q, $timeout) {\n var upload = this;\n upload.promisesCount = 0;\n\n this.isResumeSupported = function () {\n return window.Blob && window.Blob.prototype.slice;\n };\n\n var resumeSupported = this.isResumeSupported();\n\n function sendHttp(config) {\n config.method = config.method || 'POST';\n config.headers = config.headers || {};\n\n var deferred = config._deferred = config._deferred || $q.defer();\n var promise = deferred.promise;\n\n function notifyProgress(e) {\n if (deferred.notify) {\n deferred.notify(e);\n }\n if (promise.progressFunc) {\n $timeout(function () {\n promise.progressFunc(e);\n });\n }\n }\n\n function getNotifyEvent(n) {\n if (config._start != null && resumeSupported) {\n return {\n loaded: n.loaded + config._start,\n total: (config._file && config._file.size) || n.total,\n type: n.type, config: config,\n lengthComputable: true, target: n.target\n };\n } else {\n return n;\n }\n }\n\n if (!config.disableProgress) {\n config.headers.__setXHR_ = function () {\n return function (xhr) {\n if (!xhr || !xhr.upload || !xhr.upload.addEventListener) return;\n config.__XHR = xhr;\n if (config.xhrFn) config.xhrFn(xhr);\n xhr.upload.addEventListener('progress', function (e) {\n e.config = config;\n notifyProgress(getNotifyEvent(e));\n }, false);\n //fix for firefox not firing upload progress end, also IE8-9\n xhr.upload.addEventListener('load', function (e) {\n if (e.lengthComputable) {\n e.config = config;\n notifyProgress(getNotifyEvent(e));\n }\n }, false);\n };\n };\n }\n\n function uploadWithAngular() {\n $http(config).then(function (r) {\n if (resumeSupported && config._chunkSize && !config._finished && config._file) {\n notifyProgress({\n loaded: config._end,\n total: config._file && config._file.size,\n config: config, type: 'progress'\n }\n );\n upload.upload(config, true);\n } else {\n if (config._finished) delete config._finished;\n deferred.resolve(r);\n }\n }, function (e) {\n deferred.reject(e);\n }, function (n) {\n deferred.notify(n);\n }\n );\n }\n\n if (!resumeSupported) {\n uploadWithAngular();\n } else if (config._chunkSize && config._end && !config._finished) {\n config._start = config._end;\n config._end += config._chunkSize;\n uploadWithAngular();\n } else if (config.resumeSizeUrl) {\n $http.get(config.resumeSizeUrl).then(function (resp) {\n if (config.resumeSizeResponseReader) {\n config._start = config.resumeSizeResponseReader(resp.data);\n } else {\n config._start = parseInt((resp.data.size == null ? resp.data : resp.data.size).toString());\n }\n if (config._chunkSize) {\n config._end = config._start + config._chunkSize;\n }\n uploadWithAngular();\n }, function (e) {\n throw e;\n });\n } else if (config.resumeSize) {\n config.resumeSize().then(function (size) {\n config._start = size;\n uploadWithAngular();\n }, function (e) {\n throw e;\n });\n } else {\n if (config._chunkSize) {\n config._start = 0;\n config._end = config._start + config._chunkSize;\n }\n uploadWithAngular();\n }\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 promise.progress = function (fn) {\n promise.progressFunc = fn;\n promise.then(null, null, function (n) {\n fn(n);\n });\n return promise;\n };\n promise.abort = promise.pause = function () {\n if (config.__XHR) {\n $timeout(function () {\n config.__XHR.abort();\n });\n }\n return promise;\n };\n promise.xhr = function (fn) {\n config.xhrFn = (function (origXhrFn) {\n return function () {\n if (origXhrFn) origXhrFn.apply(promise, arguments);\n fn.apply(promise, arguments);\n };\n })(config.xhrFn);\n return promise;\n };\n\n upload.promisesCount++;\n promise['finally'](function () {\n upload.promisesCount--;\n });\n return promise;\n }\n\n this.isUploadInProgress = function () {\n return upload.promisesCount > 0;\n };\n\n this.rename = function (file, name) {\n file.ngfName = name;\n return file;\n };\n\n this.jsonBlob = function (val) {\n if (val != null && !angular.isString(val)) {\n val = JSON.stringify(val);\n }\n var blob = new window.Blob([val], {type: 'application/json'});\n blob._ngfBlob = true;\n return blob;\n };\n\n this.json = function (val) {\n return angular.toJson(val);\n };\n\n function copy(obj) {\n var clone = {};\n for (var key in obj) {\n if (obj.hasOwnProperty(key)) {\n clone[key] = obj[key];\n }\n }\n return clone;\n }\n\n this.isFile = function (file) {\n return file != null && (file instanceof window.Blob || (file.flashId && file.name && file.size));\n };\n\n this.upload = function (config, internal) {\n function toResumeFile(file, formData) {\n if (file._ngfBlob) return file;\n config._file = config._file || file;\n if (config._start != null && resumeSupported) {\n if (config._end && config._end >= file.size) {\n config._finished = true;\n config._end = file.size;\n }\n var slice = file.slice(config._start, config._end || file.size);\n slice.name = file.name;\n slice.ngfName = file.ngfName;\n if (config._chunkSize) {\n formData.append('_chunkSize', config._chunkSize);\n formData.append('_currentChunkSize', config._end - config._start);\n formData.append('_chunkNumber', Math.floor(config._start / config._chunkSize));\n formData.append('_totalSize', config._file.size);\n }\n return slice;\n }\n return file;\n }\n\n function addFieldToFormData(formData, val, key) {\n if (val !== undefined) {\n if (angular.isDate(val)) {\n val = val.toISOString();\n }\n if (angular.isString(val)) {\n formData.append(key, val);\n } else if (upload.isFile(val)) {\n var file = toResumeFile(val, formData);\n var split = key.split(',');\n if (split[1]) {\n file.ngfName = split[1].replace(/^\\s+|\\s+$/g, '');\n key = split[0];\n }\n config._fileKey = config._fileKey || key;\n formData.append(key, file, file.ngfName || file.name);\n } else {\n if (angular.isObject(val)) {\n if (val.$$ngfCircularDetection) throw 'ngFileUpload: Circular reference in config.data. Make sure specified data for Upload.upload() has no circular reference: ' + key;\n\n val.$$ngfCircularDetection = true;\n try {\n for (var k in val) {\n if (val.hasOwnProperty(k) && k !== '$$ngfCircularDetection') {\n var objectKey = config.objectKey == null ? '[i]' : config.objectKey;\n if (val.length && parseInt(k) > -1) {\n objectKey = config.arrayKey == null ? objectKey : config.arrayKey;\n }\n addFieldToFormData(formData, val[k], key + objectKey.replace(/[ik]/g, k));\n }\n }\n } finally {\n delete val.$$ngfCircularDetection;\n }\n } else {\n formData.append(key, val);\n }\n }\n }\n }\n\n function digestConfig() {\n config._chunkSize = upload.translateScalars(config.resumeChunkSize);\n config._chunkSize = config._chunkSize ? parseInt(config._chunkSize.toString()) : null;\n\n config.headers = config.headers || {};\n config.headers['Content-Type'] = undefined;\n config.transformRequest = config.transformRequest ?\n (angular.isArray(config.transformRequest) ?\n config.transformRequest : [config.transformRequest]) : [];\n config.transformRequest.push(function (data) {\n var formData = new window.FormData(), key;\n data = data || config.fields || {};\n if (config.file) {\n data.file = config.file;\n }\n for (key in data) {\n if (data.hasOwnProperty(key)) {\n var val = data[key];\n if (config.formDataAppender) {\n config.formDataAppender(formData, key, val);\n } else {\n addFieldToFormData(formData, val, key);\n }\n }\n }\n\n return formData;\n });\n }\n\n if (!internal) config = copy(config);\n if (!config._isDigested) {\n config._isDigested = true;\n digestConfig();\n }\n\n return sendHttp(config);\n };\n\n this.http = function (config) {\n config = copy(config);\n config.transformRequest = config.transformRequest || function (data) {\n if ((window.ArrayBuffer && data instanceof window.ArrayBuffer) || data instanceof window.Blob) {\n return data;\n }\n return $http.defaults.transformRequest[0].apply(this, arguments);\n };\n config._chunkSize = upload.translateScalars(config.resumeChunkSize);\n config._chunkSize = config._chunkSize ? parseInt(config._chunkSize.toString()) : null;\n\n return sendHttp(config);\n };\n\n this.translateScalars = function (str) {\n if (angular.isString(str)) {\n if (str.search(/kb/i) === str.length - 2) {\n return parseFloat(str.substring(0, str.length - 2) * 1024);\n } else if (str.search(/mb/i) === str.length - 2) {\n return parseFloat(str.substring(0, str.length - 2) * 1048576);\n } else if (str.search(/gb/i) === str.length - 2) {\n return parseFloat(str.substring(0, str.length - 2) * 1073741824);\n } else if (str.search(/b/i) === str.length - 1) {\n return parseFloat(str.substring(0, str.length - 1));\n } else if (str.search(/s/i) === str.length - 1) {\n return parseFloat(str.substring(0, str.length - 1));\n } else if (str.search(/m/i) === str.length - 1) {\n return parseFloat(str.substring(0, str.length - 1) * 60);\n } else if (str.search(/h/i) === str.length - 1) {\n return parseFloat(str.substring(0, str.length - 1) * 3600);\n }\n }\n return str;\n };\n\n this.urlToBlob = function(url) {\n var defer = $q.defer();\n $http({url: url, method: 'get', responseType: 'arraybuffer'}).then(function (resp) {\n var arrayBufferView = new Uint8Array(resp.data);\n var type = resp.headers('content-type') || 'image/WebP';\n var blob = new window.Blob([arrayBufferView], {type: type});\n defer.resolve(blob);\n //var split = type.split('[/;]');\n //blob.name = url.substring(0, 150).replace(/\\W+/g, '') + '.' + (split.length > 1 ? split[1] : 'jpg');\n }, function (e) {\n defer.reject(e);\n });\n return defer.promise;\n };\n\n this.setDefaults = function (defaults) {\n this.defaults = defaults || {};\n };\n\n this.defaults = {};\n this.version = ngFileUpload.version;\n}\n\n]);\n\nngFileUpload.service('Upload', ['$parse', '$timeout', '$compile', '$q', 'UploadExif', function ($parse, $timeout, $compile, $q, UploadExif) {\n var upload = UploadExif;\n upload.getAttrWithDefaults = function (attr, name) {\n if (attr[name] != null) return attr[name];\n var def = upload.defaults[name];\n return (def == null ? def : (angular.isString(def) ? def : JSON.stringify(def)));\n };\n\n upload.attrGetter = function (name, attr, scope, params) {\n var attrVal = this.getAttrWithDefaults(attr, name);\n if (scope) {\n try {\n if (params) {\n return $parse(attrVal)(scope, params);\n } else {\n return $parse(attrVal)(scope);\n }\n } catch (e) {\n // hangle string value without single qoute\n if (name.search(/min|max|pattern/i)) {\n return attrVal;\n } else {\n throw e;\n }\n }\n } else {\n return attrVal;\n }\n };\n\n upload.shouldUpdateOn = function (type, attr, scope) {\n var modelOptions = upload.attrGetter('ngModelOptions', attr, scope);\n if (modelOptions && modelOptions.updateOn) {\n return modelOptions.updateOn.split(' ').indexOf(type) > -1;\n }\n return true;\n };\n\n upload.emptyPromise = function () {\n var d = $q.defer();\n var args = arguments;\n $timeout(function () {\n d.resolve.apply(d, args);\n });\n return d.promise;\n };\n\n upload.rejectPromise = function () {\n var d = $q.defer();\n var args = arguments;\n $timeout(function () {\n d.reject.apply(d, args);\n });\n return d.promise;\n };\n\n upload.happyPromise = function (promise, data) {\n var d = $q.defer();\n promise.then(function (result) {\n d.resolve(result);\n }, function (error) {\n $timeout(function () {\n throw error;\n });\n d.resolve(data);\n });\n return d.promise;\n };\n\n function applyExifRotations(files, attr, scope) {\n var promises = [upload.emptyPromise()];\n angular.forEach(files, function (f, i) {\n if (f.type.indexOf('image/jpeg') === 0 && upload.attrGetter('ngfFixOrientation', attr, scope, {$file: f})) {\n promises.push(upload.happyPromise(upload.applyExifRotation(f), f).then(function (fixedFile) {\n files.splice(i, 1, fixedFile);\n }));\n }\n });\n return $q.all(promises);\n }\n\n function resize(files, attr, scope) {\n var resizeVal = upload.attrGetter('ngfResize', attr, scope);\n if (!resizeVal || !upload.isResizeSupported() || !files.length) return upload.emptyPromise();\n if (resizeVal instanceof Function) {\n var defer = $q.defer();\n resizeVal(files).then(function (p) {\n resizeWithParams(p, files, attr, scope).then(function (r) {\n defer.resolve(r);\n }, function (e) {\n defer.reject(e);\n });\n }, function (e) {\n defer.reject(e);\n });\n } else {\n return resizeWithParams(resizeVal, files, attr, scope);\n }\n }\n\n function resizeWithParams(param, files, attr, scope) {\n var promises = [upload.emptyPromise()];\n\n function handleFile(f, i) {\n if (f.type.indexOf('image') === 0) {\n if (param.pattern && !upload.validatePattern(f, param.pattern)) return;\n var promise = upload.resize(f, param.width, param.height, param.quality,\n param.type, param.ratio, param.centerCrop, function (width, height) {\n return upload.attrGetter('ngfResizeIf', attr, scope,\n {$width: width, $height: height, $file: f});\n }, param.restoreExif !== false);\n promises.push(promise);\n promise.then(function (resizedFile) {\n files.splice(i, 1, resizedFile);\n }, function (e) {\n f.$error = 'resize';\n f.$errorParam = (e ? (e.message ? e.message : e) + ': ' : '') + (f && f.name);\n });\n }\n }\n\n for (var i = 0; i < files.length; i++) {\n handleFile(files[i], i);\n }\n return $q.all(promises);\n }\n\n upload.updateModel = function (ngModel, attr, scope, fileChange, files, evt, noDelay) {\n function update(files, invalidFiles, newFiles, dupFiles, isSingleModel) {\n attr.$$ngfPrevValidFiles = files;\n attr.$$ngfPrevInvalidFiles = invalidFiles;\n var file = files && files.length ? files[0] : null;\n var invalidFile = invalidFiles && invalidFiles.length ? invalidFiles[0] : null;\n\n if (ngModel) {\n upload.applyModelValidation(ngModel, files);\n ngModel.$setViewValue(isSingleModel ? file : files);\n }\n\n if (fileChange) {\n $parse(fileChange)(scope, {\n $files: files,\n $file: file,\n $newFiles: newFiles,\n $duplicateFiles: dupFiles,\n $invalidFiles: invalidFiles,\n $invalidFile: invalidFile,\n $event: evt\n });\n }\n\n var invalidModel = upload.attrGetter('ngfModelInvalid', attr);\n if (invalidModel) {\n $timeout(function () {\n $parse(invalidModel).assign(scope, isSingleModel ? invalidFile : invalidFiles);\n });\n }\n $timeout(function () {\n // scope apply changes\n });\n }\n\n var allNewFiles, dupFiles = [], prevValidFiles, prevInvalidFiles,\n invalids = [], valids = [];\n\n function removeDuplicates() {\n function equals(f1, f2) {\n return f1.name === f2.name && (f1.$ngfOrigSize || f1.size) === (f2.$ngfOrigSize || f2.size) &&\n f1.type === f2.type;\n }\n\n function isInPrevFiles(f) {\n var j;\n for (j = 0; j < prevValidFiles.length; j++) {\n if (equals(f, prevValidFiles[j])) {\n return true;\n }\n }\n for (j = 0; j < prevInvalidFiles.length; j++) {\n if (equals(f, prevInvalidFiles[j])) {\n return true;\n }\n }\n return false;\n }\n\n if (files) {\n allNewFiles = [];\n dupFiles = [];\n for (var i = 0; i < files.length; i++) {\n if (isInPrevFiles(files[i])) {\n dupFiles.push(files[i]);\n } else {\n allNewFiles.push(files[i]);\n }\n }\n }\n }\n\n function toArray(v) {\n return angular.isArray(v) ? v : [v];\n }\n\n function separateInvalids() {\n valids = [];\n invalids = [];\n angular.forEach(allNewFiles, function (file) {\n if (file.$error) {\n invalids.push(file);\n } else {\n valids.push(file);\n }\n });\n }\n\n function resizeAndUpdate() {\n function updateModel() {\n $timeout(function () {\n update(keep ? prevValidFiles.concat(valids) : valids,\n keep ? prevInvalidFiles.concat(invalids) : invalids,\n files, dupFiles, isSingleModel);\n }, options && options.debounce ? options.debounce.change || options.debounce : 0);\n }\n\n resize(validateAfterResize ? allNewFiles : valids, attr, scope).then(function () {\n if (validateAfterResize) {\n upload.validate(allNewFiles, prevValidFiles.length, ngModel, attr, scope).then(function () {\n separateInvalids();\n updateModel();\n });\n } else {\n updateModel();\n }\n }, function (e) {\n throw 'Could not resize files ' + e;\n });\n }\n\n prevValidFiles = attr.$$ngfPrevValidFiles || [];\n prevInvalidFiles = attr.$$ngfPrevInvalidFiles || [];\n if (ngModel && ngModel.$modelValue) {\n prevValidFiles = toArray(ngModel.$modelValue);\n }\n\n var keep = upload.attrGetter('ngfKeep', attr, scope);\n allNewFiles = (files || []).slice(0);\n if (keep === 'distinct' || upload.attrGetter('ngfKeepDistinct', attr, scope) === true) {\n removeDuplicates(attr, scope);\n }\n\n var isSingleModel = !keep && !upload.attrGetter('ngfMultiple', attr, scope) && !upload.attrGetter('multiple', attr);\n\n if (keep && !allNewFiles.length) return;\n\n upload.attrGetter('ngfBeforeModelChange', attr, scope, {\n $files: files,\n $file: files && files.length ? files[0] : null,\n $newFiles: allNewFiles,\n $duplicateFiles: dupFiles,\n $event: evt\n });\n\n var validateAfterResize = upload.attrGetter('ngfValidateAfterResize', attr, scope);\n\n var options = upload.attrGetter('ngModelOptions', attr, scope);\n upload.validate(allNewFiles, prevValidFiles.length, ngModel, attr, scope).then(function () {\n if (noDelay) {\n update(allNewFiles, [], files, dupFiles, isSingleModel);\n } else {\n if ((!options || !options.allowInvalid) && !validateAfterResize) {\n separateInvalids();\n } else {\n valids = allNewFiles;\n }\n if (upload.attrGetter('ngfFixOrientation', attr, scope) && upload.isExifSupported()) {\n applyExifRotations(valids, attr, scope).then(function () {\n resizeAndUpdate();\n });\n } else {\n resizeAndUpdate();\n }\n }\n });\n };\n\n return upload;\n}]);\n\nngFileUpload.directive('ngfSelect', ['$parse', '$timeout', '$compile', 'Upload', function ($parse, $timeout, $compile, Upload) {\n var generatedElems = [];\n\n function isDelayedClickSupported(ua) {\n // fix for android native browser < 4.4 and safari windows\n var m = ua.match(/Android[^\\d]*(\\d+)\\.(\\d+)/);\n if (m && m.length > 2) {\n var v = Upload.defaults.androidFixMinorVersion || 4;\n return parseInt(m[1]) < 4 || (parseInt(m[1]) === v && parseInt(m[2]) < v);\n }\n\n // safari on windows\n return ua.indexOf('Chrome') === -1 && /.*Windows.*Safari.*/.test(ua);\n }\n\n function linkFileSelect(scope, elem, attr, ngModel, $parse, $timeout, $compile, upload) {\n /** @namespace attr.ngfSelect */\n /** @namespace attr.ngfChange */\n /** @namespace attr.ngModel */\n /** @namespace attr.ngModelOptions */\n /** @namespace attr.ngfMultiple */\n /** @namespace attr.ngfCapture */\n /** @namespace attr.ngfValidate */\n /** @namespace attr.ngfKeep */\n var attrGetter = function (name, scope) {\n return upload.attrGetter(name, attr, scope);\n };\n\n function isInputTypeFile() {\n return elem[0].tagName.toLowerCase() === 'input' && attr.type && attr.type.toLowerCase() === 'file';\n }\n\n function fileChangeAttr() {\n return attrGetter('ngfChange') || attrGetter('ngfSelect');\n }\n\n function changeFn(evt) {\n if (upload.shouldUpdateOn('change', attr, scope)) {\n var fileList = evt.__files_ || (evt.target && evt.target.files), files = [];\n for (var i = 0; i < fileList.length; i++) {\n files.push(fileList[i]);\n }\n upload.updateModel(ngModel, attr, scope, fileChangeAttr(),\n files.length ? files : null, evt);\n }\n }\n\n upload.registerModelChangeValidator(ngModel, attr, scope);\n\n var unwatches = [];\n unwatches.push(scope.$watch(attrGetter('ngfMultiple'), function () {\n fileElem.attr('multiple', attrGetter('ngfMultiple', scope));\n }));\n unwatches.push(scope.$watch(attrGetter('ngfCapture'), function () {\n fileElem.attr('capture', attrGetter('ngfCapture', scope));\n }));\n unwatches.push(scope.$watch(attrGetter('ngfAccept'), function () {\n fileElem.attr('accept', attrGetter('ngfAccept', scope));\n }));\n attr.$observe('accept', function () {\n fileElem.attr('accept', attrGetter('accept'));\n });\n unwatches.push(function () {\n if (attr.$$observers) delete attr.$$observers.accept;\n });\n function bindAttrToFileInput(fileElem) {\n if (elem !== fileElem) {\n for (var i = 0; i < elem[0].attributes.length; i++) {\n var attribute = elem[0].attributes[i];\n if (attribute.name !== 'type' && attribute.name !== 'class' && attribute.name !== 'style') {\n if (attribute.value == null || attribute.value === '') {\n if (attribute.name === 'required') attribute.value = 'required';\n if (attribute.name === 'multiple') attribute.value = 'multiple';\n }\n fileElem.attr(attribute.name, attribute.name === 'id' ? 'ngf-' + attribute.value : attribute.value);\n }\n }\n }\n }\n\n function createFileInput() {\n if (isInputTypeFile()) {\n return elem;\n }\n\n var fileElem = angular.element('<input type=\"file\">');\n\n bindAttrToFileInput(fileElem);\n\n var label = angular.element('<label>upload</label>');\n label.css('visibility', 'hidden').css('position', 'absolute').css('overflow', 'hidden')\n .css('width', '0px').css('height', '0px').css('border', 'none')\n .css('margin', '0px').css('padding', '0px').attr('tabindex', '-1');\n generatedElems.push({el: elem, ref: label});\n\n document.body.appendChild(label.append(fileElem)[0]);\n\n return fileElem;\n }\n\n var initialTouchStartY = 0;\n\n function clickHandler(evt) {\n if (elem.attr('disabled')) return false;\n if (attrGetter('ngfSelectDisabled', scope)) return;\n\n var r = handleTouch(evt);\n if (r != null) return r;\n\n resetModel(evt);\n\n // fix for md when the element is removed from the DOM and added back #460\n try {\n if (!isInputTypeFile() && !document.body.contains(fileElem[0])) {\n generatedElems.push({el: elem, ref: fileElem.parent()});\n document.body.appendChild(fileElem.parent()[0]);\n fileElem.bind('change', changeFn);\n }\n } catch(e){/*ignore*/}\n\n if (isDelayedClickSupported(navigator.userAgent)) {\n setTimeout(function () {\n fileElem[0].click();\n }, 0);\n } else {\n fileElem[0].click();\n }\n\n return false;\n }\n\n function handleTouch(evt) {\n var touches = evt.changedTouches || (evt.originalEvent && evt.originalEvent.changedTouches);\n if (evt.type === 'touchstart') {\n initialTouchStartY = touches ? touches[0].clientY : 0;\n return true; // don't block event default\n } else {\n evt.stopPropagation();\n evt.preventDefault();\n\n // prevent scroll from triggering event\n if (evt.type === 'touchend') {\n var currentLocation = touches ? touches[0].clientY : 0;\n if (Math.abs(currentLocation - initialTouchStartY) > 20) return false;\n }\n }\n }\n\n var fileElem = elem;\n\n function resetModel(evt) {\n if (upload.shouldUpdateOn('click', attr, scope) && fileElem.val()) {\n fileElem.val(null);\n upload.updateModel(ngModel, attr, scope, fileChangeAttr(), null, evt, true);\n }\n }\n\n if (!isInputTypeFile()) {\n fileElem = createFileInput();\n }\n fileElem.bind('change', changeFn);\n\n if (!isInputTypeFile()) {\n elem.bind('click touchstart touchend', clickHandler);\n } else {\n elem.bind('click', resetModel);\n }\n\n function ie10SameFileSelectFix(evt) {\n if (fileElem && !fileElem.attr('__ngf_ie10_Fix_')) {\n if (!fileElem[0].parentNode) {\n fileElem = null;\n return;\n }\n evt.preventDefault();\n evt.stopPropagation();\n fileElem.unbind('click');\n var clone = fileElem.clone();\n fileElem.replaceWith(clone);\n fileElem = clone;\n fileElem.attr('__ngf_ie10_Fix_', 'true');\n fileElem.bind('change', changeFn);\n fileElem.bind('click', ie10SameFileSelectFix);\n fileElem[0].click();\n return false;\n } else {\n fileElem.removeAttr('__ngf_ie10_Fix_');\n }\n }\n\n if (navigator.appVersion.indexOf('MSIE 10') !== -1) {\n fileElem.bind('click', ie10SameFileSelectFix);\n }\n\n if (ngModel) ngModel.$formatters.push(function (val) {\n if (val == null || val.length === 0) {\n if (fileElem.val()) {\n fileElem.val(null);\n }\n }\n return val;\n });\n\n scope.$on('$destroy', function () {\n if (!isInputTypeFile()) fileElem.parent().remove();\n angular.forEach(unwatches, function (unwatch) {\n unwatch();\n });\n });\n\n $timeout(function () {\n for (var i = 0; i < generatedElems.length; i++) {\n var g = generatedElems[i];\n if (!document.body.contains(g.el[0])) {\n generatedElems.splice(i, 1);\n g.ref.remove();\n }\n }\n });\n\n if (window.FileAPI && window.FileAPI.ngfFixIE) {\n window.FileAPI.ngfFixIE(elem, fileElem, changeFn);\n }\n }\n\n return {\n restrict: 'AEC',\n require: '?ngModel',\n link: function (scope, elem, attr, ngModel) {\n linkFileSelect(scope, elem, attr, ngModel, $parse, $timeout, $compile, Upload);\n }\n };\n}]);\n\n(function () {\n\n ngFileUpload.service('UploadDataUrl', ['UploadBase', '$timeout', '$q', function (UploadBase, $timeout, $q) {\n var upload = UploadBase;\n upload.base64DataUrl = function (file) {\n if (angular.isArray(file)) {\n var d = $q.defer(), count = 0;\n angular.forEach(file, function (f) {\n upload.dataUrl(f, true)['finally'](function () {\n count++;\n if (count === file.length) {\n var urls = [];\n angular.forEach(file, function (ff) {\n urls.push(ff.$ngfDataUrl);\n });\n d.resolve(urls, file);\n }\n });\n });\n return d.promise;\n } else {\n return upload.dataUrl(file, true);\n }\n };\n upload.dataUrl = function (file, disallowObjectUrl) {\n if (!file) return upload.emptyPromise(file, file);\n if ((disallowObjectUrl && file.$ngfDataUrl != null) || (!disallowObjectUrl && file.$ngfBlobUrl != null)) {\n return upload.emptyPromise(disallowObjectUrl ? file.$ngfDataUrl : file.$ngfBlobUrl, file);\n }\n var p = disallowObjectUrl ? file.$$ngfDataUrlPromise : file.$$ngfBlobUrlPromise;\n if (p) return p;\n\n var deferred = $q.defer();\n $timeout(function () {\n if (window.FileReader && file &&\n (!window.FileAPI || navigator.userAgent.indexOf('MSIE 8') === -1 || file.size < 20000) &&\n (!window.FileAPI || navigator.userAgent.indexOf('MSIE 9') === -1 || file.size < 4000000)) {\n //prefer URL.createObjectURL for handling refrences to files of all sizes\n //since it doesn´t build a large string in memory\n var URL = window.URL || window.webkitURL;\n if (URL && URL.createObjectURL && !disallowObjectUrl) {\n var url;\n try {\n url = URL.createObjectURL(file);\n } catch (e) {\n $timeout(function () {\n file.$ngfBlobUrl = '';\n deferred.reject();\n });\n return;\n }\n $timeout(function () {\n file.$ngfBlobUrl = url;\n if (url) {\n deferred.resolve(url, file);\n upload.blobUrls = upload.blobUrls || [];\n upload.blobUrlsTotalSize = upload.blobUrlsTotalSize || 0;\n upload.blobUrls.push({url: url, size: file.size});\n upload.blobUrlsTotalSize += file.size || 0;\n var maxMemory = upload.defaults.blobUrlsMaxMemory || 268435456;\n var maxLength = upload.defaults.blobUrlsMaxQueueSize || 200;\n while ((upload.blobUrlsTotalSize > maxMemory || upload.blobUrls.length > maxLength) && upload.blobUrls.length > 1) {\n var obj = upload.blobUrls.splice(0, 1)[0];\n URL.revokeObjectURL(obj.url);\n upload.blobUrlsTotalSize -= obj.size;\n }\n }\n });\n } else {\n var fileReader = new FileReader();\n fileReader.onload = function (e) {\n $timeout(function () {\n file.$ngfDataUrl = e.target.result;\n deferred.resolve(e.target.result, file);\n $timeout(function () {\n delete file.$ngfDataUrl;\n }, 1000);\n });\n };\n fileReader.onerror = function () {\n $timeout(function () {\n file.$ngfDataUrl = '';\n deferred.reject();\n });\n };\n fileReader.readAsDataURL(file);\n }\n } else {\n $timeout(function () {\n file[disallowObjectUrl ? '$ngfDataUrl' : '$ngfBlobUrl'] = '';\n deferred.reject();\n });\n }\n });\n\n if (disallowObjectUrl) {\n p = file.$$ngfDataUrlPromise = deferred.promise;\n } else {\n p = file.$$ngfBlobUrlPromise = deferred.promise;\n }\n p['finally'](function () {\n delete file[disallowObjectUrl ? '$$ngfDataUrlPromise' : '$$ngfBlobUrlPromise'];\n });\n return p;\n };\n return upload;\n }]);\n\n function getTagType(el) {\n if (el.tagName.toLowerCase() === 'img') return 'image';\n if (el.tagName.toLowerCase() === 'audio') return 'audio';\n if (el.tagName.toLowerCase() === 'video') return 'video';\n return /./;\n }\n\n function linkFileDirective(Upload, $timeout, scope, elem, attr, directiveName, resizeParams, isBackground) {\n function constructDataUrl(file) {\n var disallowObjectUrl = Upload.attrGetter('ngfNoObjectUrl', attr, scope);\n Upload.dataUrl(file, disallowObjectUrl)['finally'](function () {\n $timeout(function () {\n var src = (disallowObjectUrl ? file.$ngfDataUrl : file.$ngfBlobUrl) || file.$ngfDataUrl;\n if (isBackground) {\n elem.css('background-image', 'url(\\'' + (src || '') + '\\')');\n } else {\n elem.attr('src', src);\n }\n if (src) {\n elem.removeClass('ng-hide');\n } else {\n elem.addClass('ng-hide');\n }\n });\n });\n }\n\n $timeout(function () {\n var unwatch = scope.$watch(attr[directiveName], function (file) {\n var size = resizeParams;\n if (directiveName === 'ngfThumbnail') {\n if (!size) {\n size = {width: elem[0].clientWidth, height: elem[0].clientHeight};\n }\n if (size.width === 0 && window.getComputedStyle) {\n var style = getComputedStyle(elem[0]);\n size = {\n width: parseInt(style.width.slice(0, -2)),\n height: parseInt(style.height.slice(0, -2))\n };\n }\n }\n\n if (angular.isString(file)) {\n elem.removeClass('ng-hide');\n if (isBackground) {\n return elem.css('background-image', 'url(\\'' + file + '\\')');\n } else {\n return elem.attr('src', file);\n }\n }\n if (file && file.type && file.type.search(getTagType(elem[0])) === 0 &&\n (!isBackground || file.type.indexOf('image') === 0)) {\n if (size && Upload.isResizeSupported()) {\n Upload.resize(file, size.width, size.height, size.quality).then(\n function (f) {\n constructDataUrl(f);\n }, function (e) {\n throw e;\n }\n );\n } else {\n constructDataUrl(file);\n }\n } else {\n elem.addClass('ng-hide');\n }\n });\n\n scope.$on('$destroy', function () {\n unwatch();\n });\n });\n }\n\n\n /** @namespace attr.ngfSrc */\n /** @namespace attr.ngfNoObjectUrl */\n ngFileUpload.directive('ngfSrc', ['Upload', '$timeout', function (Upload, $timeout) {\n return {\n restrict: 'AE',\n link: function (scope, elem, attr) {\n linkFileDirective(Upload, $timeout, scope, elem, attr, 'ngfSrc',\n Upload.attrGetter('ngfResize', attr, scope), false);\n }\n };\n }]);\n\n /** @namespace attr.ngfBackground */\n /** @namespace attr.ngfNoObjectUrl */\n ngFileUpload.directive('ngfBackground', ['Upload', '$timeout', function (Upload, $timeout) {\n return {\n restrict: 'AE',\n link: function (scope, elem, attr) {\n linkFileDirective(Upload, $timeout, scope, elem, attr, 'ngfBackground',\n Upload.attrGetter('ngfResize', attr, scope), true);\n }\n };\n }]);\n\n /** @namespace attr.ngfThumbnail */\n /** @namespace attr.ngfAsBackground */\n /** @namespace attr.ngfSize */\n /** @namespace attr.ngfNoObjectUrl */\n ngFileUpload.directive('ngfThumbnail', ['Upload', '$timeout', function (Upload, $timeout) {\n return {\n restrict: 'AE',\n link: function (scope, elem, attr) {\n var size = Upload.attrGetter('ngfSize', attr, scope);\n linkFileDirective(Upload, $timeout, scope, elem, attr, 'ngfThumbnail', size,\n Upload.attrGetter('ngfAsBackground', attr, scope));\n }\n };\n }]);\n\n ngFileUpload.config(['$compileProvider', function ($compileProvider) {\n if ($compileProvider.imgSrcSanitizationWhitelist) $compileProvider.imgSrcSanitizationWhitelist(/^\\s*(https?|ftp|mailto|tel|local|file|data|blob):/);\n if ($compileProvider.aHrefSanitizationWhitelist) $compileProvider.aHrefSanitizationWhitelist(/^\\s*(https?|ftp|mailto|tel|local|file|data|blob):/);\n }]);\n\n ngFileUpload.filter('ngfDataUrl', ['UploadDataUrl', '$sce', function (UploadDataUrl, $sce) {\n return function (file, disallowObjectUrl, trustedUrl) {\n if (angular.isString(file)) {\n return $sce.trustAsResourceUrl(file);\n }\n var src = file && ((disallowObjectUrl ? file.$ngfDataUrl : file.$ngfBlobUrl) || file.$ngfDataUrl);\n if (file && !src) {\n if (!file.$ngfDataUrlFilterInProgress && angular.isObject(file)) {\n file.$ngfDataUrlFilterInProgress = true;\n UploadDataUrl.dataUrl(file, disallowObjectUrl);\n }\n return '';\n }\n if (file) delete file.$ngfDataUrlFilterInProgress;\n return (file && src ? (trustedUrl ? $sce.trustAsResourceUrl(src) : src) : file) || '';\n };\n }]);\n\n})();\n\nngFileUpload.service('UploadValidate', ['UploadDataUrl', '$q', '$timeout', function (UploadDataUrl, $q, $timeout) {\n var upload = UploadDataUrl;\n\n function globStringToRegex(str) {\n var regexp = '', excludes = [];\n if (str.length > 2 && str[0] === '/' && str[str.length - 1] === '/') {\n regexp = str.substring(1, str.length - 1);\n } else {\n var split = str.split(',');\n if (split.length > 1) {\n for (var i = 0; i < split.length; i++) {\n var r = globStringToRegex(split[i]);\n if (r.regexp) {\n regexp += '(' + r.regexp + ')';\n if (i < split.length - 1) {\n regexp += '|';\n }\n } else {\n excludes = excludes.concat(r.excludes);\n }\n }\n } else {\n if (str.indexOf('!') === 0) {\n excludes.push('^((?!' + globStringToRegex(str.substring(1)).regexp + ').)*$');\n } else {\n if (str.indexOf('.') === 0) {\n str = '*' + str;\n }\n regexp = '^' + str.replace(new RegExp('[.\\\\\\\\+*?\\\\[\\\\^\\\\]$(){}=!<>|:\\\\-]', 'g'), '\\\\$&') + '$';\n regexp = regexp.replace(/\\\\\\*/g, '.*').replace(/\\\\\\?/g, '.');\n }\n }\n }\n return {regexp: regexp, excludes: excludes};\n }\n\n upload.validatePattern = function (file, val) {\n if (!val) {\n return true;\n }\n var pattern = globStringToRegex(val), valid = true;\n if (pattern.regexp && pattern.regexp.length) {\n var regexp = new RegExp(pattern.regexp, 'i');\n valid = (file.type != null && regexp.test(file.type)) ||\n (file.name != null && regexp.test(file.name));\n }\n var len = pattern.excludes.length;\n while (len--) {\n var exclude = new RegExp(pattern.excludes[len], 'i');\n valid = valid && (file.type == null || exclude.test(file.type)) &&\n (file.name == null || exclude.test(file.name));\n }\n return valid;\n };\n\n upload.ratioToFloat = function (val) {\n var r = val.toString(), xIndex = r.search(/[x:]/i);\n if (xIndex > -1) {\n r = parseFloat(r.substring(0, xIndex)) / parseFloat(r.substring(xIndex + 1));\n } else {\n r = parseFloat(r);\n }\n return r;\n };\n\n upload.registerModelChangeValidator = function (ngModel, attr, scope) {\n if (ngModel) {\n ngModel.$formatters.push(function (files) {\n if (ngModel.$dirty) {\n if (files && !angular.isArray(files)) {\n files = [files];\n }\n upload.validate(files, 0, ngModel, attr, scope).then(function () {\n upload.applyModelValidation(ngModel, files);\n });\n }\n });\n }\n };\n\n function markModelAsDirty(ngModel, files) {\n if (files != null && !ngModel.$dirty) {\n if (ngModel.$setDirty) {\n ngModel.$setDirty();\n } else {\n ngModel.$dirty = true;\n }\n }\n }\n\n upload.applyModelValidation = function (ngModel, files) {\n markModelAsDirty(ngModel, files);\n angular.forEach(ngModel.$ngfValidations, function (validation) {\n ngModel.$setValidity(validation.name, validation.valid);\n });\n };\n\n upload.getValidationAttr = function (attr, scope, name, validationName, file) {\n var dName = 'ngf' + name[0].toUpperCase() + name.substr(1);\n var val = upload.attrGetter(dName, attr, scope, {$file: file});\n if (val == null) {\n val = upload.attrGetter('ngfValidate', attr, scope, {$file: file});\n if (val) {\n var split = (validationName || name).split('.');\n val = val[split[0]];\n if (split.length > 1) {\n val = val && val[split[1]];\n }\n }\n }\n return val;\n };\n\n upload.validate = function (files, prevLength, ngModel, attr, scope) {\n ngModel = ngModel || {};\n ngModel.$ngfValidations = ngModel.$ngfValidations || [];\n\n angular.forEach(ngModel.$ngfValidations, function (v) {\n v.valid = true;\n });\n\n var attrGetter = function (name, params) {\n return upload.attrGetter(name, attr, scope, params);\n };\n\n if (files == null || files.length === 0) {\n return upload.emptyPromise(ngModel);\n }\n\n files = files.length === undefined ? [files] : files.slice(0);\n\n function validateSync(name, validationName, fn) {\n if (files) {\n var i = files.length, valid = null;\n while (i--) {\n var file = files[i];\n if (file) {\n var val = upload.getValidationAttr(attr, scope, name, validationName, file);\n if (val != null) {\n if (!fn(file, val, i)) {\n file.$error = name;\n (file.$errorMessages = (file.$errorMessages || {}))[name] = true;\n file.$errorParam = val;\n files.splice(i, 1);\n valid = false;\n }\n }\n }\n }\n if (valid !== null) {\n ngModel.$ngfValidations.push({name: name, valid: valid});\n }\n }\n }\n\n validateSync('maxFiles', null, function (file, val, i) {\n return prevLength + i < val;\n });\n validateSync('pattern', null, upload.validatePattern);\n validateSync('minSize', 'size.min', function (file, val) {\n return file.size + 0.1 >= upload.translateScalars(val);\n });\n validateSync('maxSize', 'size.max', function (file, val) {\n return file.size - 0.1 <= upload.translateScalars(val);\n });\n var totalSize = 0;\n validateSync('maxTotalSize', null, function (file, val) {\n totalSize += file.size;\n if (totalSize > upload.translateScalars(val)) {\n files.splice(0, files.length);\n return false;\n }\n return true;\n });\n\n validateSync('validateFn', null, function (file, r) {\n return r === true || r === null || r === '';\n });\n\n if (!files.length) {\n return upload.emptyPromise(ngModel, ngModel.$ngfValidations);\n }\n\n function validateAsync(name, validationName, type, asyncFn, fn) {\n function resolveResult(defer, file, val) {\n if (val != null) {\n asyncFn(file, val).then(function (d) {\n if (!fn(d, val)) {\n file.$error = name;\n (file.$errorMessages = (file.$errorMessages || {}))[name] = true;\n file.$errorParam = val;\n defer.reject();\n } else {\n defer.resolve();\n }\n }, function () {\n if (attrGetter('ngfValidateForce', {$file: file})) {\n file.$error = name;\n (file.$errorMessages = (file.$errorMessages || {}))[name] = true;\n file.$errorParam = val;\n defer.reject();\n } else {\n defer.resolve();\n }\n });\n } else {\n defer.resolve();\n }\n }\n\n var promises = [upload.emptyPromise()];\n if (files) {\n files = files.length === undefined ? [files] : files;\n angular.forEach(files, function (file) {\n var defer = $q.defer();\n promises.push(defer.promise);\n if (type && (file.type == null || file.type.search(type) !== 0)) {\n defer.resolve();\n return;\n }\n if (name === 'dimensions' && upload.attrGetter('ngfDimensions', attr) != null) {\n upload.imageDimensions(file).then(function (d) {\n resolveResult(defer, file,\n attrGetter('ngfDimensions', {$file: file, $width: d.width, $height: d.height}));\n }, function () {\n defer.reject();\n });\n } else if (name === 'duration' && upload.attrGetter('ngfDuration', attr) != null) {\n upload.mediaDuration(file).then(function (d) {\n resolveResult(defer, file,\n attrGetter('ngfDuration', {$file: file, $duration: d}));\n }, function () {\n defer.reject();\n });\n } else {\n resolveResult(defer, file,\n upload.getValidationAttr(attr, scope, name, validationName, file));\n }\n });\n return $q.all(promises).then(function () {\n ngModel.$ngfValidations.push({name: name, valid: true});\n }, function () {\n ngModel.$ngfValidations.push({name: name, valid: false});\n });\n }\n }\n\n var deffer = $q.defer();\n var promises = [];\n\n promises.push(upload.happyPromise(validateAsync('maxHeight', 'height.max', /image/,\n this.imageDimensions, function (d, val) {\n return d.height <= val;\n })));\n promises.push(upload.happyPromise(validateAsync('minHeight', 'height.min', /image/,\n this.imageDimensions, function (d, val) {\n return d.height >= val;\n })));\n promises.push(upload.happyPromise(validateAsync('maxWidth', 'width.max', /image/,\n this.imageDimensions, function (d, val) {\n return d.width <= val;\n })));\n promises.push(upload.happyPromise(validateAsync('minWidth', 'width.min', /image/,\n this.imageDimensions, function (d, val) {\n return d.width >= val;\n })));\n promises.push(upload.happyPromise(validateAsync('dimensions', null, /image/,\n function (file, val) {\n return upload.emptyPromise(val);\n }, function (r) {\n return r;\n })));\n promises.push(upload.happyPromise(validateAsync('ratio', null, /image/,\n this.imageDimensions, function (d, val) {\n var split = val.toString().split(','), valid = false;\n for (var i = 0; i < split.length; i++) {\n if (Math.abs((d.width / d.height) - upload.ratioToFloat(split[i])) < 0.0001) {\n valid = true;\n }\n }\n return valid;\n })));\n promises.push(upload.happyPromise(validateAsync('maxRatio', 'ratio.max', /image/,\n this.imageDimensions, function (d, val) {\n return (d.width / d.height) - upload.ratioToFloat(val) < 0.0001;\n })));\n promises.push(upload.happyPromise(validateAsync('minRatio', 'ratio.min', /image/,\n this.imageDimensions, function (d, val) {\n return (d.width / d.height) - upload.ratioToFloat(val) > -0.0001;\n })));\n promises.push(upload.happyPromise(validateAsync('maxDuration', 'duration.max', /audio|video/,\n this.mediaDuration, function (d, val) {\n return d <= upload.translateScalars(val);\n })));\n promises.push(upload.happyPromise(validateAsync('minDuration', 'duration.min', /audio|video/,\n this.mediaDuration, function (d, val) {\n return d >= upload.translateScalars(val);\n })));\n promises.push(upload.happyPromise(validateAsync('duration', null, /audio|video/,\n function (file, val) {\n return upload.emptyPromise(val);\n }, function (r) {\n return r;\n })));\n\n promises.push(upload.happyPromise(validateAsync('validateAsyncFn', null, null,\n function (file, val) {\n return val;\n }, function (r) {\n return r === true || r === null || r === '';\n })));\n\n return $q.all(promises).then(function () {\n deffer.resolve(ngModel, ngModel.$ngfValidations);\n });\n };\n\n upload.imageDimensions = function (file) {\n if (file.$ngfWidth && file.$ngfHeight) {\n var d = $q.defer();\n $timeout(function () {\n d.resolve({width: file.$ngfWidth, height: file.$ngfHeight});\n });\n return d.promise;\n }\n if (file.$ngfDimensionPromise) return file.$ngfDimensionPromise;\n\n var deferred = $q.defer();\n $timeout(function () {\n if (file.type.indexOf('image') !== 0) {\n deferred.reject('not image');\n return;\n }\n upload.dataUrl(file).then(function (dataUrl) {\n var img = angular.element('<img>').attr('src', dataUrl)\n .css('visibility', 'hidden').css('position', 'fixed')\n .css('max-width', 'none !important').css('max-height', 'none !important');\n\n function success() {\n var width = img[0].clientWidth;\n var height = img[0].clientHeight;\n img.remove();\n file.$ngfWidth = width;\n file.$ngfHeight = height;\n deferred.resolve({width: width, height: height});\n }\n\n function error() {\n img.remove();\n deferred.reject('load error');\n }\n\n img.on('load', success);\n img.on('error', error);\n var count = 0;\n\n function checkLoadError() {\n $timeout(function () {\n if (img[0].parentNode) {\n if (img[0].clientWidth) {\n success();\n } else if (count > 10) {\n error();\n } else {\n checkLoadError();\n }\n }\n }, 1000);\n }\n\n checkLoadError();\n\n angular.element(document.getElementsByTagName('body')[0]).append(img);\n }, function () {\n deferred.reject('load error');\n });\n });\n\n file.$ngfDimensionPromise = deferred.promise;\n file.$ngfDimensionPromise['finally'](function () {\n delete file.$ngfDimensionPromise;\n });\n return file.$ngfDimensionPromise;\n };\n\n upload.mediaDuration = function (file) {\n if (file.$ngfDuration) {\n var d = $q.defer();\n $timeout(function () {\n d.resolve(file.$ngfDuration);\n });\n return d.promise;\n }\n if (file.$ngfDurationPromise) return file.$ngfDurationPromise;\n\n var deferred = $q.defer();\n $timeout(function () {\n if (file.type.indexOf('audio') !== 0 && file.type.indexOf('video') !== 0) {\n deferred.reject('not media');\n return;\n }\n upload.dataUrl(file).then(function (dataUrl) {\n var el = angular.element(file.type.indexOf('audio') === 0 ? '<audio>' : '<video>')\n .attr('src', dataUrl).css('visibility', 'none').css('position', 'fixed');\n\n function success() {\n var duration = el[0].duration;\n file.$ngfDuration = duration;\n el.remove();\n deferred.resolve(duration);\n }\n\n function error() {\n el.remove();\n deferred.reject('load error');\n }\n\n el.on('loadedmetadata', success);\n el.on('error', error);\n var count = 0;\n\n function checkLoadError() {\n $timeout(function () {\n if (el[0].parentNode) {\n if (el[0].duration) {\n success();\n } else if (count > 10) {\n error();\n } else {\n checkLoadError();\n }\n }\n }, 1000);\n }\n\n checkLoadError();\n\n angular.element(document.body).append(el);\n }, function () {\n deferred.reject('load error');\n });\n });\n\n file.$ngfDurationPromise = deferred.promise;\n file.$ngfDurationPromise['finally'](function () {\n delete file.$ngfDurationPromise;\n });\n return file.$ngfDurationPromise;\n };\n return upload;\n}\n]);\n\nngFileUpload.service('UploadResize', ['UploadValidate', '$q', function (UploadValidate, $q) {\n var upload = UploadValidate;\n\n /**\n * Conserve aspect ratio of the original region. Useful when shrinking/enlarging\n * images to fit into a certain area.\n * Source: http://stackoverflow.com/a/14731922\n *\n * @param {Number} srcWidth Source area width\n * @param {Number} srcHeight Source area height\n * @param {Number} maxWidth Nestable area maximum available width\n * @param {Number} maxHeight Nestable area maximum available height\n * @return {Object} { width, height }\n */\n var calculateAspectRatioFit = function (srcWidth, srcHeight, maxWidth, maxHeight, centerCrop) {\n var ratio = centerCrop ? Math.max(maxWidth / srcWidth, maxHeight / srcHeight) :\n Math.min(maxWidth / srcWidth, maxHeight / srcHeight);\n return {\n width: srcWidth * ratio, height: srcHeight * ratio,\n marginX: srcWidth * ratio - maxWidth, marginY: srcHeight * ratio - maxHeight\n };\n };\n\n // Extracted from https://github.com/romelgomez/angular-firebase-image-upload/blob/master/app/scripts/fileUpload.js#L89\n var resize = function (imagen, width, height, quality, type, ratio, centerCrop, resizeIf) {\n var deferred = $q.defer();\n var canvasElement = document.createElement('canvas');\n var imageElement = document.createElement('img');\n\n imageElement.onload = function () {\n if (resizeIf != null && resizeIf(imageElement.width, imageElement.height) === false) {\n deferred.reject('resizeIf');\n return;\n }\n try {\n if (ratio) {\n var ratioFloat = upload.ratioToFloat(ratio);\n var imgRatio = imageElement.width / imageElement.height;\n if (imgRatio < ratioFloat) {\n width = imageElement.width;\n height = width / ratioFloat;\n } else {\n height = imageElement.height;\n width = height * ratioFloat;\n }\n }\n if (!width) {\n width = imageElement.width;\n }\n if (!height) {\n height = imageElement.height;\n }\n var dimensions = calculateAspectRatioFit(imageElement.width, imageElement.height, width, height, centerCrop);\n canvasElement.width = Math.min(dimensions.width, width);\n canvasElement.height = Math.min(dimensions.height, height);\n var context = canvasElement.getContext('2d');\n context.drawImage(imageElement,\n Math.min(0, -dimensions.marginX / 2), Math.min(0, -dimensions.marginY / 2),\n dimensions.width, dimensions.height);\n deferred.resolve(canvasElement.toDataURL(type || 'image/WebP', quality || 0.934));\n } catch (e) {\n deferred.reject(e);\n }\n };\n imageElement.onerror = function () {\n deferred.reject();\n };\n imageElement.src = imagen;\n return deferred.promise;\n };\n\n upload.dataUrltoBlob = function (dataurl, name, origSize) {\n var arr = dataurl.split(','), mime = arr[0].match(/:(.*?);/)[1],\n bstr = atob(arr[1]), n = bstr.length, u8arr = new Uint8Array(n);\n while (n--) {\n u8arr[n] = bstr.charCodeAt(n);\n }\n var blob = new window.Blob([u8arr], {type: mime});\n blob.name = name;\n blob.$ngfOrigSize = origSize;\n return blob;\n };\n\n upload.isResizeSupported = function () {\n var elem = document.createElement('canvas');\n return window.atob && elem.getContext && elem.getContext('2d') && window.Blob;\n };\n\n if (upload.isResizeSupported()) {\n // add name getter to the blob constructor prototype\n Object.defineProperty(window.Blob.prototype, 'name', {\n get: function () {\n return this.$ngfName;\n },\n set: function (v) {\n this.$ngfName = v;\n },\n configurable: true\n });\n }\n\n upload.resize = function (file, width, height, quality, type, ratio, centerCrop, resizeIf, restoreExif) {\n if (file.type.indexOf('image') !== 0) return upload.emptyPromise(file);\n\n var deferred = $q.defer();\n upload.dataUrl(file, true).then(function (url) {\n resize(url, width, height, quality, type || file.type, ratio, centerCrop, resizeIf)\n .then(function (dataUrl) {\n if (file.type === 'image/jpeg' && restoreExif) {\n try {\n dataUrl = upload.restoreExif(url, dataUrl);\n } catch (e) {\n setTimeout(function () {throw e;}, 1);\n }\n }\n try {\n var blob = upload.dataUrltoBlob(dataUrl, file.name, file.size);\n deferred.resolve(blob);\n } catch (e) {\n deferred.reject(e);\n }\n }, function (r) {\n if (r === 'resizeIf') {\n deferred.resolve(file);\n }\n deferred.reject(r);\n });\n }, function (e) {\n deferred.reject(e);\n });\n return deferred.promise;\n };\n\n return upload;\n}]);\n\n(function () {\n ngFileUpload.directive('ngfDrop', ['$parse', '$timeout', '$location', 'Upload', '$http', '$q',\n function ($parse, $timeout, $location, Upload, $http, $q) {\n return {\n restrict: 'AEC',\n require: '?ngModel',\n link: function (scope, elem, attr, ngModel) {\n linkDrop(scope, elem, attr, ngModel, $parse, $timeout, $location, Upload, $http, $q);\n }\n };\n }]);\n\n ngFileUpload.directive('ngfNoFileDrop', function () {\n return function (scope, elem) {\n if (dropAvailable()) elem.css('display', 'none');\n };\n });\n\n ngFileUpload.directive('ngfDropAvailable', ['$parse', '$timeout', 'Upload', function ($parse, $timeout, Upload) {\n return function (scope, elem, attr) {\n if (dropAvailable()) {\n var model = $parse(Upload.attrGetter('ngfDropAvailable', attr));\n $timeout(function () {\n model(scope);\n if (model.assign) {\n model.assign(scope, true);\n }\n });\n }\n };\n }]);\n\n function linkDrop(scope, elem, attr, ngModel, $parse, $timeout, $location, upload, $http, $q) {\n var available = dropAvailable();\n\n var attrGetter = function (name, scope, params) {\n return upload.attrGetter(name, attr, scope, params);\n };\n\n if (attrGetter('dropAvailable')) {\n $timeout(function () {\n if (scope[attrGetter('dropAvailable')]) {\n scope[attrGetter('dropAvailable')].value = available;\n } else {\n scope[attrGetter('dropAvailable')] = available;\n }\n });\n }\n if (!available) {\n if (attrGetter('ngfHideOnDropNotAvailable', scope) === true) {\n elem.css('display', 'none');\n }\n return;\n }\n\n function isDisabled() {\n return elem.attr('disabled') || attrGetter('ngfDropDisabled', scope);\n }\n\n if (attrGetter('ngfSelect') == null) {\n upload.registerModelChangeValidator(ngModel, attr, scope);\n }\n\n var leaveTimeout = null;\n var stopPropagation = $parse(attrGetter('ngfStopPropagation'));\n var dragOverDelay = 1;\n var actualDragOverClass;\n\n elem[0].addEventListener('dragover', function (evt) {\n if (isDisabled() || !upload.shouldUpdateOn('drop', attr, scope)) return;\n evt.preventDefault();\n if (stopPropagation(scope)) evt.stopPropagation();\n // handling dragover events from the Chrome download bar\n if (navigator.userAgent.indexOf('Chrome') > -1) {\n var b = evt.dataTransfer.effectAllowed;\n evt.dataTransfer.dropEffect = ('move' === b || 'linkMove' === b) ? 'move' : 'copy';\n }\n $timeout.cancel(leaveTimeout);\n if (!actualDragOverClass) {\n actualDragOverClass = 'C';\n calculateDragOverClass(scope, attr, evt, function (clazz) {\n actualDragOverClass = clazz;\n elem.addClass(actualDragOverClass);\n attrGetter('ngfDrag', scope, {$isDragging: true, $class: actualDragOverClass, $event: evt});\n });\n }\n }, false);\n elem[0].addEventListener('dragenter', function (evt) {\n if (isDisabled() || !upload.shouldUpdateOn('drop', attr, scope)) return;\n evt.preventDefault();\n if (stopPropagation(scope)) evt.stopPropagation();\n }, false);\n elem[0].addEventListener('dragleave', function (evt) {\n if (isDisabled() || !upload.shouldUpdateOn('drop', attr, scope)) return;\n evt.preventDefault();\n if (stopPropagation(scope)) evt.stopPropagation();\n leaveTimeout = $timeout(function () {\n if (actualDragOverClass) elem.removeClass(actualDragOverClass);\n actualDragOverClass = null;\n attrGetter('ngfDrag', scope, {$isDragging: false, $event: evt});\n }, dragOverDelay || 100);\n }, false);\n elem[0].addEventListener('drop', function (evt) {\n if (isDisabled() || !upload.shouldUpdateOn('drop', attr, scope)) return;\n evt.preventDefault();\n if (stopPropagation(scope)) evt.stopPropagation();\n if (actualDragOverClass) elem.removeClass(actualDragOverClass);\n actualDragOverClass = null;\n var items = evt.dataTransfer.items;\n var html;\n try {\n html = evt.dataTransfer && evt.dataTransfer.getData && evt.dataTransfer.getData('text/html');\n } catch (e) {/* Fix IE11 that throw error calling getData */\n }\n\n extractFiles(items, evt.dataTransfer.files, attrGetter('ngfAllowDir', scope) !== false,\n attrGetter('multiple') || attrGetter('ngfMultiple', scope)).then(function (files) {\n if (files.length) {\n updateModel(files, evt);\n } else {\n extractFilesFromHtml('dropUrl', html).then(function (files) {\n updateModel(files, evt);\n });\n }\n });\n }, false);\n elem[0].addEventListener('paste', function (evt) {\n if (navigator.userAgent.toLowerCase().indexOf('firefox') > -1 &&\n attrGetter('ngfEnableFirefoxPaste', scope)) {\n evt.preventDefault();\n }\n if (isDisabled() || !upload.shouldUpdateOn('paste', attr, scope)) return;\n var files = [];\n var clipboard = evt.clipboardData || evt.originalEvent.clipboardData;\n if (clipboard && clipboard.items) {\n for (var k = 0; k < clipboard.items.length; k++) {\n if (clipboard.items[k].type.indexOf('image') !== -1) {\n files.push(clipboard.items[k].getAsFile());\n }\n }\n }\n if (files.length) {\n updateModel(files, evt);\n } else {\n extractFilesFromHtml('pasteUrl', clipboard).then(function (files) {\n updateModel(files, evt);\n });\n }\n }, false);\n\n if (navigator.userAgent.toLowerCase().indexOf('firefox') > -1 &&\n attrGetter('ngfEnableFirefoxPaste', scope)) {\n elem.attr('contenteditable', true);\n elem.on('keypress', function (e) {\n if (!e.metaKey && !e.ctrlKey) {\n e.preventDefault();\n }\n });\n }\n\n function updateModel(files, evt) {\n upload.updateModel(ngModel, attr, scope, attrGetter('ngfChange') || attrGetter('ngfDrop'), files, evt);\n }\n\n function extractFilesFromHtml(updateOn, html) {\n if (!upload.shouldUpdateOn(updateOn, attr, scope) || !html) return upload.rejectPromise([]);\n var urls = [];\n html.replace(/<(img src|img [^>]* src) *=\\\"([^\\\"]*)\\\"/gi, function (m, n, src) {\n urls.push(src);\n });\n var promises = [], files = [];\n if (urls.length) {\n angular.forEach(urls, function (url) {\n promises.push(upload.urlToBlob(url).then(function (blob) {\n files.push(blob);\n }));\n });\n var defer = $q.defer();\n $q.all(promises).then(function () {\n defer.resolve(files);\n }, function (e) {\n defer.reject(e);\n });\n return defer.promise;\n }\n return upload.emptyPromise();\n }\n\n function calculateDragOverClass(scope, attr, evt, callback) {\n var obj = attrGetter('ngfDragOverClass', scope, {$event: evt}), dClass = 'dragover';\n if (angular.isString(obj)) {\n dClass = obj;\n } else if (obj) {\n if (obj.delay) dragOverDelay = obj.delay;\n if (obj.accept || obj.reject) {\n var items = evt.dataTransfer.items;\n if (items == null || !items.length) {\n dClass = obj.accept;\n } else {\n var pattern = obj.pattern || attrGetter('ngfPattern', scope, {$event: evt});\n var len = items.length;\n while (len--) {\n if (!upload.validatePattern(items[len], pattern)) {\n dClass = obj.reject;\n break;\n } else {\n dClass = obj.accept;\n }\n }\n }\n }\n }\n callback(dClass);\n }\n\n function extractFiles(items, fileList, allowDir, multiple) {\n var maxFiles = upload.getValidationAttr(attr, scope, 'maxFiles') || Number.MAX_VALUE;\n var maxTotalSize = upload.getValidationAttr(attr, scope, 'maxTotalSize') || Number.MAX_VALUE;\n var includeDir = attrGetter('ngfIncludeDir', scope);\n var files = [], totalSize = 0;\n\n function traverseFileTree(entry, path) {\n var defer = $q.defer();\n if (entry != null) {\n if (entry.isDirectory) {\n var promises = [upload.emptyPromise()];\n if (includeDir) {\n var file = {type: 'directory'};\n file.name = file.path = (path || '') + entry.name + entry.name;\n files.push(file);\n }\n var dirReader = entry.createReader();\n var entries = [];\n var readEntries = function () {\n dirReader.readEntries(function (results) {\n try {\n if (!results.length) {\n angular.forEach(entries.slice(0), function (e) {\n if (files.length <= maxFiles && totalSize <= maxTotalSize) {\n promises.push(traverseFileTree(e, (path ? path : '') + entry.name + '/'));\n }\n });\n $q.all(promises).then(function () {\n defer.resolve();\n }, function (e) {\n defer.reject(e);\n });\n } else {\n entries = entries.concat(Array.prototype.slice.call(results || [], 0));\n readEntries();\n }\n } catch (e) {\n defer.reject(e);\n }\n }, function (e) {\n defer.reject(e);\n });\n };\n readEntries();\n } else {\n entry.file(function (file) {\n try {\n file.path = (path ? path : '') + file.name;\n if (includeDir) {\n file = upload.rename(file, file.path);\n }\n files.push(file);\n totalSize += file.size;\n defer.resolve();\n } catch (e) {\n defer.reject(e);\n }\n }, function (e) {\n defer.reject(e);\n });\n }\n }\n return defer.promise;\n }\n\n var promises = [upload.emptyPromise()];\n\n if (items && items.length > 0 && $location.protocol() !== 'file') {\n for (var i = 0; i < items.length; i++) {\n if (items[i].webkitGetAsEntry && items[i].webkitGetAsEntry() && items[i].webkitGetAsEntry().isDirectory) {\n var entry = items[i].webkitGetAsEntry();\n if (entry.isDirectory && !allowDir) {\n continue;\n }\n if (entry != null) {\n promises.push(traverseFileTree(entry));\n }\n } else {\n var f = items[i].getAsFile();\n if (f != null) {\n files.push(f);\n totalSize += f.size;\n }\n }\n if (files.length > maxFiles || totalSize > maxTotalSize ||\n (!multiple && files.length > 0)) break;\n }\n } else {\n if (fileList != null) {\n for (var j = 0; j < fileList.length; j++) {\n var file = fileList.item(j);\n if (file.type || file.size > 0) {\n files.push(file);\n totalSize += file.size;\n }\n if (files.length > maxFiles || totalSize > maxTotalSize ||\n (!multiple && files.length > 0)) break;\n }\n }\n }\n\n var defer = $q.defer();\n $q.all(promises).then(function () {\n if (!multiple && !includeDir && files.length) {\n var i = 0;\n while (files[i] && files[i].type === 'directory') i++;\n defer.resolve([files[i]]);\n } else {\n defer.resolve(files);\n }\n }, function (e) {\n defer.reject(e);\n });\n\n return defer.promise;\n }\n }\n\n function dropAvailable() {\n var div = document.createElement('div');\n return ('draggable' in div) && ('ondrop' in div) && !/Edge\\/12./i.test(navigator.userAgent);\n }\n\n})();\n\n// customized version of https://github.com/exif-js/exif-js\nngFileUpload.service('UploadExif', ['UploadResize', '$q', function (UploadResize, $q) {\n var upload = UploadResize;\n\n upload.isExifSupported = function () {\n return window.FileReader && new FileReader().readAsArrayBuffer && upload.isResizeSupported();\n };\n\n function applyTransform(ctx, orientation, width, height) {\n switch (orientation) {\n case 2:\n return ctx.transform(-1, 0, 0, 1, width, 0);\n case 3:\n return ctx.transform(-1, 0, 0, -1, width, height);\n case 4:\n return ctx.transform(1, 0, 0, -1, 0, height);\n case 5:\n return ctx.transform(0, 1, 1, 0, 0, 0);\n case 6:\n return ctx.transform(0, 1, -1, 0, height, 0);\n case 7:\n return ctx.transform(0, -1, -1, 0, height, width);\n case 8:\n return ctx.transform(0, -1, 1, 0, 0, width);\n }\n }\n\n upload.readOrientation = function (file) {\n var defer = $q.defer();\n var reader = new FileReader();\n var slicedFile = file.slice ? file.slice(0, 64 * 1024) : file;\n reader.readAsArrayBuffer(slicedFile);\n reader.onerror = function (e) {\n return defer.reject(e);\n };\n reader.onload = function (e) {\n var result = {orientation: 1};\n var view = new DataView(this.result);\n if (view.getUint16(0, false) !== 0xFFD8) return defer.resolve(result);\n\n var length = view.byteLength,\n offset = 2;\n while (offset < length) {\n var marker = view.getUint16(offset, false);\n offset += 2;\n if (marker === 0xFFE1) {\n if (view.getUint32(offset += 2, false) !== 0x45786966) return defer.resolve(result);\n\n var little = view.getUint16(offset += 6, false) === 0x4949;\n offset += view.getUint32(offset + 4, little);\n var tags = view.getUint16(offset, little);\n offset += 2;\n for (var i = 0; i < tags; i++)\n if (view.getUint16(offset + (i * 12), little) === 0x0112) {\n var orientation = view.getUint16(offset + (i * 12) + 8, little);\n if (orientation >= 2 && orientation <= 8) {\n view.setUint16(offset + (i * 12) + 8, 1, little);\n result.fixedArrayBuffer = e.target.result;\n }\n result.orientation = orientation;\n return defer.resolve(result);\n }\n } else if ((marker & 0xFF00) !== 0xFF00) break;\n else offset += view.getUint16(offset, false);\n }\n return defer.resolve(result);\n };\n return defer.promise;\n };\n\n function arrayBufferToBase64(buffer) {\n var binary = '';\n var bytes = new Uint8Array(buffer);\n var len = bytes.byteLength;\n for (var i = 0; i < len; i++) {\n binary += String.fromCharCode(bytes[i]);\n }\n return window.btoa(binary);\n }\n\n upload.applyExifRotation = function (file) {\n if (file.type.indexOf('image/jpeg') !== 0) {\n return upload.emptyPromise(file);\n }\n\n var deferred = $q.defer();\n upload.readOrientation(file).then(function (result) {\n if (result.orientation < 2 || result.orientation > 8) {\n return deferred.resolve(file);\n }\n upload.dataUrl(file, true).then(function (url) {\n var canvas = document.createElement('canvas');\n var img = document.createElement('img');\n\n img.onload = function () {\n try {\n canvas.width = result.orientation > 4 ? img.height : img.width;\n canvas.height = result.orientation > 4 ? img.width : img.height;\n var ctx = canvas.getContext('2d');\n applyTransform(ctx, result.orientation, img.width, img.height);\n ctx.drawImage(img, 0, 0);\n var dataUrl = canvas.toDataURL(file.type || 'image/WebP', 0.934);\n dataUrl = upload.restoreExif(arrayBufferToBase64(result.fixedArrayBuffer), dataUrl);\n var blob = upload.dataUrltoBlob(dataUrl, file.name);\n deferred.resolve(blob);\n } catch (e) {\n return deferred.reject(e);\n }\n };\n img.onerror = function () {\n deferred.reject();\n };\n img.src = url;\n }, function (e) {\n deferred.reject(e);\n });\n }, function (e) {\n deferred.reject(e);\n });\n return deferred.promise;\n };\n\n upload.restoreExif = function (orig, resized) {\n var ExifRestorer = {};\n\n ExifRestorer.KEY_STR = 'ABCDEFGHIJKLMNOP' +\n 'QRSTUVWXYZabcdef' +\n 'ghijklmnopqrstuv' +\n 'wxyz0123456789+/' +\n '=';\n\n ExifRestorer.encode64 = function (input) {\n var output = '',\n chr1, chr2, chr3 = '',\n enc1, enc2, enc3, enc4 = '',\n i = 0;\n\n do {\n chr1 = input[i++];\n chr2 = input[i++];\n chr3 = input[i++];\n\n enc1 = chr1 >> 2;\n enc2 = ((chr1 & 3) << 4) | (chr2 >> 4);\n enc3 = ((chr2 & 15) << 2) | (chr3 >> 6);\n enc4 = chr3 & 63;\n\n if (isNaN(chr2)) {\n enc3 = enc4 = 64;\n } else if (isNaN(chr3)) {\n enc4 = 64;\n }\n\n output = output +\n this.KEY_STR.charAt(enc1) +\n this.KEY_STR.charAt(enc2) +\n this.KEY_STR.charAt(enc3) +\n this.KEY_STR.charAt(enc4);\n chr1 = chr2 = chr3 = '';\n enc1 = enc2 = enc3 = enc4 = '';\n } while (i < input.length);\n\n return output;\n };\n\n ExifRestorer.restore = function (origFileBase64, resizedFileBase64) {\n if (origFileBase64.match('data:image/jpeg;base64,')) {\n origFileBase64 = origFileBase64.replace('data:image/jpeg;base64,', '');\n }\n\n var rawImage = this.decode64(origFileBase64);\n var segments = this.slice2Segments(rawImage);\n\n var image = this.exifManipulation(resizedFileBase64, segments);\n\n return 'data:image/jpeg;base64,' + this.encode64(image);\n };\n\n\n ExifRestorer.exifManipulation = function (resizedFileBase64, segments) {\n var exifArray = this.getExifArray(segments),\n newImageArray = this.insertExif(resizedFileBase64, exifArray);\n return new Uint8Array(newImageArray);\n };\n\n\n ExifRestorer.getExifArray = function (segments) {\n var seg;\n for (var x = 0; x < segments.length; x++) {\n seg = segments[x];\n if (seg[0] === 255 & seg[1] === 225) //(ff e1)\n {\n return seg;\n }\n }\n return [];\n };\n\n\n ExifRestorer.insertExif = function (resizedFileBase64, exifArray) {\n var imageData = resizedFileBase64.replace('data:image/jpeg;base64,', ''),\n buf = this.decode64(imageData),\n separatePoint = buf.indexOf(255, 3),\n mae = buf.slice(0, separatePoint),\n ato = buf.slice(separatePoint),\n array = mae;\n\n array = array.concat(exifArray);\n array = array.concat(ato);\n return array;\n };\n\n\n ExifRestorer.slice2Segments = function (rawImageArray) {\n var head = 0,\n segments = [];\n\n while (1) {\n if (rawImageArray[head] === 255 & rawImageArray[head + 1] === 218) {\n break;\n }\n if (rawImageArray[head] === 255 & rawImageArray[head + 1] === 216) {\n head += 2;\n }\n else {\n var length = rawImageArray[head + 2] * 256 + rawImageArray[head + 3],\n endPoint = head + length + 2,\n seg = rawImageArray.slice(head, endPoint);\n segments.push(seg);\n head = endPoint;\n }\n if (head > rawImageArray.length) {\n break;\n }\n }\n\n return segments;\n };\n\n\n ExifRestorer.decode64 = function (input) {\n var chr1, chr2, chr3 = '',\n enc1, enc2, enc3, enc4 = '',\n i = 0,\n buf = [];\n\n // remove all characters that are not A-Z, a-z, 0-9, +, /, or =\n var base64test = /[^A-Za-z0-9\\+\\/\\=]/g;\n if (base64test.exec(input)) {\n console.log('There were invalid base64 characters in the input text.\\n' +\n 'Valid base64 characters are A-Z, a-z, 0-9, ' + ', ' / ',and \"=\"\\n' +\n 'Expect errors in decoding.');\n }\n input = input.replace(/[^A-Za-z0-9\\+\\/\\=]/g, '');\n\n do {\n enc1 = this.KEY_STR.indexOf(input.charAt(i++));\n enc2 = this.KEY_STR.indexOf(input.charAt(i++));\n enc3 = this.KEY_STR.indexOf(input.charAt(i++));\n enc4 = this.KEY_STR.indexOf(input.charAt(i++));\n\n chr1 = (enc1 << 2) | (enc2 >> 4);\n chr2 = ((enc2 & 15) << 4) | (enc3 >> 2);\n chr3 = ((enc3 & 3) << 6) | enc4;\n\n buf.push(chr1);\n\n if (enc3 !== 64) {\n buf.push(chr2);\n }\n if (enc4 !== 64) {\n buf.push(chr3);\n }\n\n chr1 = chr2 = chr3 = '';\n enc1 = enc2 = enc3 = enc4 = '';\n\n } while (i < input.length);\n\n return buf;\n };\n\n return ExifRestorer.restore(orig, resized); //<= EXIF\n };\n\n return upload;\n}]);\n\n","(function(f){if(typeof exports===\"object\"&&typeof module!==\"undefined\"){module.exports=f()}else if(typeof define===\"function\"&&define.amd){define([],f)}else{var g;if(typeof window!==\"undefined\"){g=window}else if(typeof global!==\"undefined\"){g=global}else if(typeof self!==\"undefined\"){g=self}else{g=this}g.jade = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require==\"function\"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error(\"Cannot find module '\"+o+\"'\");throw f.code=\"MODULE_NOT_FOUND\",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require==\"function\"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){\n'use strict';\n\n/**\n * Merge two attribute objects giving precedence\n * to values in object `b`. Classes are special-cased\n * allowing for arrays and merging/joining appropriately\n * resulting in a string.\n *\n * @param {Object} a\n * @param {Object} b\n * @return {Object} a\n * @api private\n */\n\nexports.merge = function merge(a, b) {\n if (arguments.length === 1) {\n var attrs = a[0];\n for (var i = 1; i < a.length; i++) {\n attrs = merge(attrs, a[i]);\n }\n return attrs;\n }\n var ac = a['class'];\n var bc = b['class'];\n\n if (ac || bc) {\n ac = ac || [];\n bc = bc || [];\n if (!Array.isArray(ac)) ac = [ac];\n if (!Array.isArray(bc)) bc = [bc];\n a['class'] = ac.concat(bc).filter(nulls);\n }\n\n for (var key in b) {\n if (key != 'class') {\n a[key] = b[key];\n }\n }\n\n return a;\n};\n\n/**\n * Filter null `val`s.\n *\n * @param {*} val\n * @return {Boolean}\n * @api private\n */\n\nfunction nulls(val) {\n return val != null && val !== '';\n}\n\n/**\n * join array as classes.\n *\n * @param {*} val\n * @return {String}\n */\nexports.joinClasses = joinClasses;\nfunction joinClasses(val) {\n return (Array.isArray(val) ? val.map(joinClasses) :\n (val && typeof val === 'object') ? Object.keys(val).filter(function (key) { return val[key]; }) :\n [val]).filter(nulls).join(' ');\n}\n\n/**\n * Render the given classes.\n *\n * @param {Array} classes\n * @param {Array.<Boolean>} escaped\n * @return {String}\n */\nexports.cls = function cls(classes, escaped) {\n var buf = [];\n for (var i = 0; i < classes.length; i++) {\n if (escaped && escaped[i]) {\n buf.push(exports.escape(joinClasses([classes[i]])));\n } else {\n buf.push(joinClasses(classes[i]));\n }\n }\n var text = joinClasses(buf);\n if (text.length) {\n return ' class=\"' + text + '\"';\n } else {\n return '';\n }\n};\n\n\nexports.style = function (val) {\n if (val && typeof val === 'object') {\n return Object.keys(val).map(function (style) {\n return style + ':' + val[style];\n }).join(';');\n } else {\n return val;\n }\n};\n/**\n * Render the given attribute.\n *\n * @param {String} key\n * @param {String} val\n * @param {Boolean} escaped\n * @param {Boolean} terse\n * @return {String}\n */\nexports.attr = function attr(key, val, escaped, terse) {\n if (key === 'style') {\n val = exports.style(val);\n }\n if ('boolean' == typeof val || null == val) {\n if (val) {\n return ' ' + (terse ? key : key + '=\"' + key + '\"');\n } else {\n return '';\n }\n } else if (0 == key.indexOf('data') && 'string' != typeof val) {\n if (JSON.stringify(val).indexOf('&') !== -1) {\n console.warn('Since Jade 2.0.0, ampersands (`&`) in data attributes ' +\n 'will be escaped to `&`');\n };\n if (val && typeof val.toISOString === 'function') {\n console.warn('Jade will eliminate the double quotes around dates in ' +\n 'ISO form after 2.0.0');\n }\n return ' ' + key + \"='\" + JSON.stringify(val).replace(/'/g, ''') + \"'\";\n } else if (escaped) {\n if (val && typeof val.toISOString === 'function') {\n console.warn('Jade will stringify dates in ISO form after 2.0.0');\n }\n return ' ' + key + '=\"' + exports.escape(val) + '\"';\n } else {\n if (val && typeof val.toISOString === 'function') {\n console.warn('Jade will stringify dates in ISO form after 2.0.0');\n }\n return ' ' + key + '=\"' + val + '\"';\n }\n};\n\n/**\n * Render the given attributes object.\n *\n * @param {Object} obj\n * @param {Object} escaped\n * @return {String}\n */\nexports.attrs = function attrs(obj, terse){\n var buf = [];\n\n var keys = Object.keys(obj);\n\n if (keys.length) {\n for (var i = 0; i < keys.length; ++i) {\n var key = keys[i]\n , val = obj[key];\n\n if ('class' == key) {\n if (val = joinClasses(val)) {\n buf.push(' ' + key + '=\"' + val + '\"');\n }\n } else {\n buf.push(exports.attr(key, val, false, terse));\n }\n }\n }\n\n return buf.join('');\n};\n\n/**\n * Escape the given string of `html`.\n *\n * @param {String} html\n * @return {String}\n * @api private\n */\n\nvar jade_encode_html_rules = {\n '&': '&',\n '<': '<',\n '>': '>',\n '\"': '"'\n};\nvar jade_match_html = /[&<>\"]/g;\n\nfunction jade_encode_char(c) {\n return jade_encode_html_rules[c] || c;\n}\n\nexports.escape = jade_escape;\nfunction jade_escape(html){\n var result = String(html).replace(jade_match_html, jade_encode_char);\n if (result === '' + html) return html;\n else return result;\n};\n\n/**\n * Re-throw the given `err` in context to the\n * the jade in `filename` at the given `lineno`.\n *\n * @param {Error} err\n * @param {String} filename\n * @param {String} lineno\n * @api private\n */\n\nexports.rethrow = function rethrow(err, filename, lineno, str){\n if (!(err instanceof Error)) throw err;\n if ((typeof window != 'undefined' || !filename) && !str) {\n err.message += ' on line ' + lineno;\n throw err;\n }\n try {\n str = str || require('fs').readFileSync(filename, 'utf8')\n } catch (ex) {\n rethrow(err, null, lineno)\n }\n var context = 3\n , lines = str.split('\\n')\n , start = Math.max(lineno - context, 0)\n , end = Math.min(lines.length, lineno + context);\n\n // Error context\n var context = lines.slice(start, end).map(function(line, i){\n var curr = i + start + 1;\n return (curr == lineno ? ' > ' : ' ')\n + curr\n + '| '\n + line;\n }).join('\\n');\n\n // Alter exception message\n err.path = filename;\n err.message = (filename || 'Jade') + ':' + lineno\n + '\\n' + context + '\\n\\n' + err.message;\n throw err;\n};\n\nexports.DebugItem = function DebugItem(lineno, filename) {\n this.lineno = lineno;\n this.filename = filename;\n}\n\n},{\"fs\":2}],2:[function(require,module,exports){\n\n},{}]},{},[1])(1)\n});","(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require==\"function\"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error(\"Cannot find module '\"+o+\"'\");throw f.code=\"MODULE_NOT_FOUND\",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require==\"function\"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(_dereq_,module,exports){\n (function (global){\n \"use strict\";\n\n _dereq_(189);\n\n _dereq_(2);\n\n if (global._babelPolyfill) {\n throw new Error(\"only one instance of babel-polyfill is allowed\");\n }\n global._babelPolyfill = true;\n }).call(this,typeof global !== \"undefined\" ? global : typeof self !== \"undefined\" ? self : typeof window !== \"undefined\" ? window : {})\n},{\"189\":189,\"2\":2}],2:[function(_dereq_,module,exports){\n module.exports = _dereq_(190);\n},{\"190\":190}],3:[function(_dereq_,module,exports){\n module.exports = function(it){\n if(typeof it != 'function')throw TypeError(it + ' is not a function!');\n return it;\n };\n},{}],4:[function(_dereq_,module,exports){\n// 22.1.3.31 Array.prototype[@@unscopables]\n var UNSCOPABLES = _dereq_(84)('unscopables')\n , ArrayProto = Array.prototype;\n if(ArrayProto[UNSCOPABLES] == undefined)_dereq_(32)(ArrayProto, UNSCOPABLES, {});\n module.exports = function(key){\n ArrayProto[UNSCOPABLES][key] = true;\n };\n},{\"32\":32,\"84\":84}],5:[function(_dereq_,module,exports){\n var isObject = _dereq_(39);\n module.exports = function(it){\n if(!isObject(it))throw TypeError(it + ' is not an object!');\n return it;\n };\n},{\"39\":39}],6:[function(_dereq_,module,exports){\n// 22.1.3.3 Array.prototype.copyWithin(target, start, end = this.length)\n 'use strict';\n var toObject = _dereq_(81)\n , toIndex = _dereq_(77)\n , toLength = _dereq_(80);\n\n module.exports = [].copyWithin || function copyWithin(target/*= 0*/, start/*= 0, end = @length*/){\n var O = toObject(this)\n , len = toLength(O.length)\n , to = toIndex(target, len)\n , from = toIndex(start, len)\n , $$ = arguments\n , end = $$.length > 2 ? $$[2] : undefined\n , count = Math.min((end === undefined ? len : toIndex(end, len)) - from, len - to)\n , inc = 1;\n if(from < to && to < from + count){\n inc = -1;\n from += count - 1;\n to += count - 1;\n }\n while(count-- > 0){\n if(from in O)O[to] = O[from];\n else delete O[to];\n to += inc;\n from += inc;\n } return O;\n };\n},{\"77\":77,\"80\":80,\"81\":81}],7:[function(_dereq_,module,exports){\n// 22.1.3.6 Array.prototype.fill(value, start = 0, end = this.length)\n 'use strict';\n var toObject = _dereq_(81)\n , toIndex = _dereq_(77)\n , toLength = _dereq_(80);\n module.exports = [].fill || function fill(value /*, start = 0, end = @length */){\n var O = toObject(this, true)\n , length = toLength(O.length)\n , $$ = arguments\n , $$len = $$.length\n , index = toIndex($$len > 1 ? $$[1] : undefined, length)\n , end = $$len > 2 ? $$[2] : undefined\n , endPos = end === undefined ? length : toIndex(end, length);\n while(endPos > index)O[index++] = value;\n return O;\n };\n},{\"77\":77,\"80\":80,\"81\":81}],8:[function(_dereq_,module,exports){\n// false -> Array#indexOf\n// true -> Array#includes\n var toIObject = _dereq_(79)\n , toLength = _dereq_(80)\n , toIndex = _dereq_(77);\n module.exports = function(IS_INCLUDES){\n return function($this, el, fromIndex){\n var O = toIObject($this)\n , length = toLength(O.length)\n , index = toIndex(fromIndex, length)\n , value;\n // Array#includes uses SameValueZero equality algorithm\n if(IS_INCLUDES && el != el)while(length > index){\n value = O[index++];\n if(value != value)return true;\n // Array#toIndex ignores holes, Array#includes - not\n } else for(;length > index; index++)if(IS_INCLUDES || index in O){\n if(O[index] === el)return IS_INCLUDES || index;\n } return !IS_INCLUDES && -1;\n };\n };\n},{\"77\":77,\"79\":79,\"80\":80}],9:[function(_dereq_,module,exports){\n// 0 -> Array#forEach\n// 1 -> Array#map\n// 2 -> Array#filter\n// 3 -> Array#some\n// 4 -> Array#every\n// 5 -> Array#find\n// 6 -> Array#findIndex\n var ctx = _dereq_(18)\n , IObject = _dereq_(35)\n , toObject = _dereq_(81)\n , toLength = _dereq_(80)\n , asc = _dereq_(10);\n module.exports = function(TYPE){\n var IS_MAP = TYPE == 1\n , IS_FILTER = TYPE == 2\n , IS_SOME = TYPE == 3\n , IS_EVERY = TYPE == 4\n , IS_FIND_INDEX = TYPE == 6\n , NO_HOLES = TYPE == 5 || IS_FIND_INDEX;\n return function($this, callbackfn, that){\n var O = toObject($this)\n , self = IObject(O)\n , f = ctx(callbackfn, that, 3)\n , length = toLength(self.length)\n , index = 0\n , result = IS_MAP ? asc($this, length) : IS_FILTER ? asc($this, 0) : undefined\n , val, res;\n for(;length > index; index++)if(NO_HOLES || index in self){\n val = self[index];\n res = f(val, index, O);\n if(TYPE){\n if(IS_MAP)result[index] = res; // map\n else if(res)switch(TYPE){\n case 3: return true; // some\n case 5: return val; // find\n case 6: return index; // findIndex\n case 2: result.push(val); // filter\n } else if(IS_EVERY)return false; // every\n }\n }\n return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : result;\n };\n };\n},{\"10\":10,\"18\":18,\"35\":35,\"80\":80,\"81\":81}],10:[function(_dereq_,module,exports){\n// 9.4.2.3 ArraySpeciesCreate(originalArray, length)\n var isObject = _dereq_(39)\n , isArray = _dereq_(37)\n , SPECIES = _dereq_(84)('species');\n module.exports = function(original, length){\n var C;\n if(isArray(original)){\n C = original.constructor;\n // cross-realm fallback\n if(typeof C == 'function' && (C === Array || isArray(C.prototype)))C = undefined;\n if(isObject(C)){\n C = C[SPECIES];\n if(C === null)C = undefined;\n }\n } return new (C === undefined ? Array : C)(length);\n };\n},{\"37\":37,\"39\":39,\"84\":84}],11:[function(_dereq_,module,exports){\n// getting tag from 19.1.3.6 Object.prototype.toString()\n var cof = _dereq_(12)\n , TAG = _dereq_(84)('toStringTag')\n // ES3 wrong here\n , ARG = cof(function(){ return arguments; }()) == 'Arguments';\n\n module.exports = function(it){\n var O, T, B;\n return it === undefined ? 'Undefined' : it === null ? 'Null'\n // @@toStringTag case\n : typeof (T = (O = Object(it))[TAG]) == 'string' ? T\n // builtinTag case\n : ARG ? cof(O)\n // ES3 arguments fallback\n : (B = cof(O)) == 'Object' && typeof O.callee == 'function' ? 'Arguments' : B;\n };\n},{\"12\":12,\"84\":84}],12:[function(_dereq_,module,exports){\n var toString = {}.toString;\n\n module.exports = function(it){\n return toString.call(it).slice(8, -1);\n };\n},{}],13:[function(_dereq_,module,exports){\n 'use strict';\n var $ = _dereq_(47)\n , hide = _dereq_(32)\n , mix = _dereq_(54)\n , ctx = _dereq_(18)\n , strictNew = _dereq_(70)\n , defined = _dereq_(20)\n , forOf = _dereq_(28)\n , $iterDefine = _dereq_(43)\n , step = _dereq_(45)\n , ID = _dereq_(83)('id')\n , $has = _dereq_(31)\n , isObject = _dereq_(39)\n , setSpecies = _dereq_(66)\n , DESCRIPTORS = _dereq_(21)\n , isExtensible = Object.isExtensible || isObject\n , SIZE = DESCRIPTORS ? '_s' : 'size'\n , id = 0;\n\n var fastKey = function(it, create){\n // return primitive with prefix\n if(!isObject(it))return typeof it == 'symbol' ? it : (typeof it == 'string' ? 'S' : 'P') + it;\n if(!$has(it, ID)){\n // can't set id to frozen object\n if(!isExtensible(it))return 'F';\n // not necessary to add id\n if(!create)return 'E';\n // add missing object id\n hide(it, ID, ++id);\n // return object id with prefix\n } return 'O' + it[ID];\n };\n\n var getEntry = function(that, key){\n // fast case\n var index = fastKey(key), entry;\n if(index !== 'F')return that._i[index];\n // frozen object case\n for(entry = that._f; entry; entry = entry.n){\n if(entry.k == key)return entry;\n }\n };\n\n module.exports = {\n getConstructor: function(wrapper, NAME, IS_MAP, ADDER){\n var C = wrapper(function(that, iterable){\n strictNew(that, C, NAME);\n that._i = $.create(null); // index\n that._f = undefined; // first entry\n that._l = undefined; // last entry\n that[SIZE] = 0; // size\n if(iterable != undefined)forOf(iterable, IS_MAP, that[ADDER], that);\n });\n mix(C.prototype, {\n // 23.1.3.1 Map.prototype.clear()\n // 23.2.3.2 Set.prototype.clear()\n clear: function clear(){\n for(var that = this, data = that._i, entry = that._f; entry; entry = entry.n){\n entry.r = true;\n if(entry.p)entry.p = entry.p.n = undefined;\n delete data[entry.i];\n }\n that._f = that._l = undefined;\n that[SIZE] = 0;\n },\n // 23.1.3.3 Map.prototype.delete(key)\n // 23.2.3.4 Set.prototype.delete(value)\n 'delete': function(key){\n var that = this\n , entry = getEntry(that, key);\n if(entry){\n var next = entry.n\n , prev = entry.p;\n delete that._i[entry.i];\n entry.r = true;\n if(prev)prev.n = next;\n if(next)next.p = prev;\n if(that._f == entry)that._f = next;\n if(that._l == entry)that._l = prev;\n that[SIZE]--;\n } return !!entry;\n },\n // 23.2.3.6 Set.prototype.forEach(callbackfn, thisArg = undefined)\n // 23.1.3.5 Map.prototype.forEach(callbackfn, thisArg = undefined)\n forEach: function forEach(callbackfn /*, that = undefined */){\n var f = ctx(callbackfn, arguments.length > 1 ? arguments[1] : undefined, 3)\n , entry;\n while(entry = entry ? entry.n : this._f){\n f(entry.v, entry.k, this);\n // revert to the last existing entry\n while(entry && entry.r)entry = entry.p;\n }\n },\n // 23.1.3.7 Map.prototype.has(key)\n // 23.2.3.7 Set.prototype.has(value)\n has: function has(key){\n return !!getEntry(this, key);\n }\n });\n if(DESCRIPTORS)$.setDesc(C.prototype, 'size', {\n get: function(){\n return defined(this[SIZE]);\n }\n });\n return C;\n },\n def: function(that, key, value){\n var entry = getEntry(that, key)\n , prev, index;\n // change existing entry\n if(entry){\n entry.v = value;\n // create new entry\n } else {\n that._l = entry = {\n i: index = fastKey(key, true), // <- index\n k: key, // <- key\n v: value, // <- value\n p: prev = that._l, // <- previous entry\n n: undefined, // <- next entry\n r: false // <- removed\n };\n if(!that._f)that._f = entry;\n if(prev)prev.n = entry;\n that[SIZE]++;\n // add to index\n if(index !== 'F')that._i[index] = entry;\n } return that;\n },\n getEntry: getEntry,\n setStrong: function(C, NAME, IS_MAP){\n // add .keys, .values, .entries, [@@iterator]\n // 23.1.3.4, 23.1.3.8, 23.1.3.11, 23.1.3.12, 23.2.3.5, 23.2.3.8, 23.2.3.10, 23.2.3.11\n $iterDefine(C, NAME, function(iterated, kind){\n this._t = iterated; // target\n this._k = kind; // kind\n this._l = undefined; // previous\n }, function(){\n var that = this\n , kind = that._k\n , entry = that._l;\n // revert to the last existing entry\n while(entry && entry.r)entry = entry.p;\n // get next entry\n if(!that._t || !(that._l = entry = entry ? entry.n : that._t._f)){\n // or finish the iteration\n that._t = undefined;\n return step(1);\n }\n // return step by kind\n if(kind == 'keys' )return step(0, entry.k);\n if(kind == 'values')return step(0, entry.v);\n return step(0, [entry.k, entry.v]);\n }, IS_MAP ? 'entries' : 'values' , !IS_MAP, true);\n\n // add [@@species], 23.1.2.2, 23.2.2.2\n setSpecies(NAME);\n }\n };\n},{\"18\":18,\"20\":20,\"21\":21,\"28\":28,\"31\":31,\"32\":32,\"39\":39,\"43\":43,\"45\":45,\"47\":47,\"54\":54,\"66\":66,\"70\":70,\"83\":83}],14:[function(_dereq_,module,exports){\n// https://github.com/DavidBruant/Map-Set.prototype.toJSON\n var forOf = _dereq_(28)\n , classof = _dereq_(11);\n module.exports = function(NAME){\n return function toJSON(){\n if(classof(this) != NAME)throw TypeError(NAME + \"#toJSON isn't generic\");\n var arr = [];\n forOf(this, false, arr.push, arr);\n return arr;\n };\n };\n},{\"11\":11,\"28\":28}],15:[function(_dereq_,module,exports){\n 'use strict';\n var hide = _dereq_(32)\n , mix = _dereq_(54)\n , anObject = _dereq_(5)\n , strictNew = _dereq_(70)\n , forOf = _dereq_(28)\n , method = _dereq_(9)\n , WEAK = _dereq_(83)('weak')\n , isObject = _dereq_(39)\n , $has = _dereq_(31)\n , isExtensible = Object.isExtensible || isObject\n , find = method(5)\n , findIndex = method(6)\n , id = 0;\n\n// fallback for frozen keys\n var frozenStore = function(that){\n return that._l || (that._l = new FrozenStore);\n };\n var FrozenStore = function(){\n this.a = [];\n };\n var findFrozen = function(store, key){\n return find(store.a, function(it){\n return it[0] === key;\n });\n };\n FrozenStore.prototype = {\n get: function(key){\n var entry = findFrozen(this, key);\n if(entry)return entry[1];\n },\n has: function(key){\n return !!findFrozen(this, key);\n },\n set: function(key, value){\n var entry = findFrozen(this, key);\n if(entry)entry[1] = value;\n else this.a.push([key, value]);\n },\n 'delete': function(key){\n var index = findIndex(this.a, function(it){\n return it[0] === key;\n });\n if(~index)this.a.splice(index, 1);\n return !!~index;\n }\n };\n\n module.exports = {\n getConstructor: function(wrapper, NAME, IS_MAP, ADDER){\n var C = wrapper(function(that, iterable){\n strictNew(that, C, NAME);\n that._i = id++; // collection id\n that._l = undefined; // leak store for frozen objects\n if(iterable != undefined)forOf(iterable, IS_MAP, that[ADDER], that);\n });\n mix(C.prototype, {\n // 23.3.3.2 WeakMap.prototype.delete(key)\n // 23.4.3.3 WeakSet.prototype.delete(value)\n 'delete': function(key){\n if(!isObject(key))return false;\n if(!isExtensible(key))return frozenStore(this)['delete'](key);\n return $has(key, WEAK) && $has(key[WEAK], this._i) && delete key[WEAK][this._i];\n },\n // 23.3.3.4 WeakMap.prototype.has(key)\n // 23.4.3.4 WeakSet.prototype.has(value)\n has: function has(key){\n if(!isObject(key))return false;\n if(!isExtensible(key))return frozenStore(this).has(key);\n return $has(key, WEAK) && $has(key[WEAK], this._i);\n }\n });\n return C;\n },\n def: function(that, key, value){\n if(!isExtensible(anObject(key))){\n frozenStore(that).set(key, value);\n } else {\n $has(key, WEAK) || hide(key, WEAK, {});\n key[WEAK][that._i] = value;\n } return that;\n },\n frozenStore: frozenStore,\n WEAK: WEAK\n };\n},{\"28\":28,\"31\":31,\"32\":32,\"39\":39,\"5\":5,\"54\":54,\"70\":70,\"83\":83,\"9\":9}],16:[function(_dereq_,module,exports){\n 'use strict';\n var global = _dereq_(30)\n , $def = _dereq_(19)\n , $redef = _dereq_(62)\n , mix = _dereq_(54)\n , forOf = _dereq_(28)\n , strictNew = _dereq_(70)\n , isObject = _dereq_(39)\n , fails = _dereq_(25)\n , $iterDetect = _dereq_(44)\n , setToStringTag = _dereq_(67);\n\n module.exports = function(NAME, wrapper, methods, common, IS_MAP, IS_WEAK){\n var Base = global[NAME]\n , C = Base\n , ADDER = IS_MAP ? 'set' : 'add'\n , proto = C && C.prototype\n , O = {};\n var fixMethod = function(KEY){\n var fn = proto[KEY];\n $redef(proto, KEY,\n KEY == 'delete' ? function(a){\n return IS_WEAK && !isObject(a) ? false : fn.call(this, a === 0 ? 0 : a);\n } : KEY == 'has' ? function has(a){\n return IS_WEAK && !isObject(a) ? false : fn.call(this, a === 0 ? 0 : a);\n } : KEY == 'get' ? function get(a){\n return IS_WEAK && !isObject(a) ? undefined : fn.call(this, a === 0 ? 0 : a);\n } : KEY == 'add' ? function add(a){ fn.call(this, a === 0 ? 0 : a); return this; }\n : function set(a, b){ fn.call(this, a === 0 ? 0 : a, b); return this; }\n );\n };\n if(typeof C != 'function' || !(IS_WEAK || proto.forEach && !fails(function(){\n new C().entries().next();\n }))){\n // create collection constructor\n C = common.getConstructor(wrapper, NAME, IS_MAP, ADDER);\n mix(C.prototype, methods);\n } else {\n var instance = new C\n // early implementations not supports chaining\n , HASNT_CHAINING = instance[ADDER](IS_WEAK ? {} : -0, 1) != instance\n // V8 ~ Chromium 40- weak-collections throws on primitives, but should return false\n , THROWS_ON_PRIMITIVES = fails(function(){ instance.has(1); })\n // most early implementations doesn't supports iterables, most modern - not close it correctly\n , ACCEPT_ITERABLES = $iterDetect(function(iter){ new C(iter); }) // eslint-disable-line no-new\n // for early implementations -0 and +0 not the same\n , BUGGY_ZERO;\n if(!ACCEPT_ITERABLES){\n C = wrapper(function(target, iterable){\n strictNew(target, C, NAME);\n var that = new Base;\n if(iterable != undefined)forOf(iterable, IS_MAP, that[ADDER], that);\n return that;\n });\n C.prototype = proto;\n proto.constructor = C;\n }\n IS_WEAK || instance.forEach(function(val, key){\n BUGGY_ZERO = 1 / key === -Infinity;\n });\n if(THROWS_ON_PRIMITIVES || BUGGY_ZERO){\n fixMethod('delete');\n fixMethod('has');\n IS_MAP && fixMethod('get');\n }\n if(BUGGY_ZERO || HASNT_CHAINING)fixMethod(ADDER);\n // weak collections should not contains .clear method\n if(IS_WEAK && proto.clear)delete proto.clear;\n }\n\n setToStringTag(C, NAME);\n\n O[NAME] = C;\n $def($def.G + $def.W + $def.F * (C != Base), O);\n\n if(!IS_WEAK)common.setStrong(C, NAME, IS_MAP);\n\n return C;\n };\n},{\"19\":19,\"25\":25,\"28\":28,\"30\":30,\"39\":39,\"44\":44,\"54\":54,\"62\":62,\"67\":67,\"70\":70}],17:[function(_dereq_,module,exports){\n var core = module.exports = {version: '1.2.5'};\n if(typeof __e == 'number')__e = core; // eslint-disable-line no-undef\n},{}],18:[function(_dereq_,module,exports){\n// optional / simple context binding\n var aFunction = _dereq_(3);\n module.exports = function(fn, that, length){\n aFunction(fn);\n if(that === undefined)return fn;\n switch(length){\n case 1: return function(a){\n return fn.call(that, a);\n };\n case 2: return function(a, b){\n return fn.call(that, a, b);\n };\n case 3: return function(a, b, c){\n return fn.call(that, a, b, c);\n };\n }\n return function(/* ...args */){\n return fn.apply(that, arguments);\n };\n };\n},{\"3\":3}],19:[function(_dereq_,module,exports){\n var global = _dereq_(30)\n , core = _dereq_(17)\n , hide = _dereq_(32)\n , $redef = _dereq_(62)\n , PROTOTYPE = 'prototype';\n var ctx = function(fn, that){\n return function(){\n return fn.apply(that, arguments);\n };\n };\n var $def = function(type, name, source){\n var key, own, out, exp\n , isGlobal = type & $def.G\n , isProto = type & $def.P\n , target = isGlobal ? global : type & $def.S\n ? global[name] || (global[name] = {}) : (global[name] || {})[PROTOTYPE]\n , exports = isGlobal ? core : core[name] || (core[name] = {});\n if(isGlobal)source = name;\n for(key in source){\n // contains in native\n own = !(type & $def.F) && target && key in target;\n // export native or passed\n out = (own ? target : source)[key];\n // bind timers to global for call from export context\n if(type & $def.B && own)exp = ctx(out, global);\n else exp = isProto && typeof out == 'function' ? ctx(Function.call, out) : out;\n // extend global\n if(target && !own)$redef(target, key, out);\n // export\n if(exports[key] != out)hide(exports, key, exp);\n if(isProto)(exports[PROTOTYPE] || (exports[PROTOTYPE] = {}))[key] = out;\n }\n };\n global.core = core;\n// type bitmap\n $def.F = 1; // forced\n $def.G = 2; // global\n $def.S = 4; // static\n $def.P = 8; // proto\n $def.B = 16; // bind\n $def.W = 32; // wrap\n module.exports = $def;\n},{\"17\":17,\"30\":30,\"32\":32,\"62\":62}],20:[function(_dereq_,module,exports){\n// 7.2.1 RequireObjectCoercible(argument)\n module.exports = function(it){\n if(it == undefined)throw TypeError(\"Can't call method on \" + it);\n return it;\n };\n},{}],21:[function(_dereq_,module,exports){\n// Thank's IE8 for his funny defineProperty\n module.exports = !_dereq_(25)(function(){\n return Object.defineProperty({}, 'a', {get: function(){ return 7; }}).a != 7;\n });\n},{\"25\":25}],22:[function(_dereq_,module,exports){\n var isObject = _dereq_(39)\n , document = _dereq_(30).document\n // in old IE typeof document.createElement is 'object'\n , is = isObject(document) && isObject(document.createElement);\n module.exports = function(it){\n return is ? document.createElement(it) : {};\n };\n},{\"30\":30,\"39\":39}],23:[function(_dereq_,module,exports){\n// all enumerable object keys, includes symbols\n var $ = _dereq_(47);\n module.exports = function(it){\n var keys = $.getKeys(it)\n , getSymbols = $.getSymbols;\n if(getSymbols){\n var symbols = getSymbols(it)\n , isEnum = $.isEnum\n , i = 0\n , key;\n while(symbols.length > i)if(isEnum.call(it, key = symbols[i++]))keys.push(key);\n }\n return keys;\n };\n},{\"47\":47}],24:[function(_dereq_,module,exports){\n var MATCH = _dereq_(84)('match');\n module.exports = function(KEY){\n var re = /./;\n try {\n '/./'[KEY](re);\n } catch(e){\n try {\n re[MATCH] = false;\n return !'/./'[KEY](re);\n } catch(f){ /* empty */ }\n } return true;\n };\n},{\"84\":84}],25:[function(_dereq_,module,exports){\n module.exports = function(exec){\n try {\n return !!exec();\n } catch(e){\n return true;\n }\n };\n},{}],26:[function(_dereq_,module,exports){\n 'use strict';\n var hide = _dereq_(32)\n , redef = _dereq_(62)\n , fails = _dereq_(25)\n , defined = _dereq_(20)\n , wks = _dereq_(84);\n module.exports = function(KEY, length, exec){\n var SYMBOL = wks(KEY)\n , original = ''[KEY];\n if(fails(function(){\n var O = {};\n O[SYMBOL] = function(){ return 7; };\n return ''[KEY](O) != 7;\n })){\n redef(String.prototype, KEY, exec(defined, SYMBOL, original));\n hide(RegExp.prototype, SYMBOL, length == 2\n // 21.2.5.8 RegExp.prototype[@@replace](string, replaceValue)\n // 21.2.5.11 RegExp.prototype[@@split](string, limit)\n ? function(string, arg){ return original.call(string, this, arg); }\n // 21.2.5.6 RegExp.prototype[@@match](string)\n // 21.2.5.9 RegExp.prototype[@@search](string)\n : function(string){ return original.call(string, this); }\n );\n }\n };\n},{\"20\":20,\"25\":25,\"32\":32,\"62\":62,\"84\":84}],27:[function(_dereq_,module,exports){\n 'use strict';\n// 21.2.5.3 get RegExp.prototype.flags\n var anObject = _dereq_(5);\n module.exports = function(){\n var that = anObject(this)\n , result = '';\n if(that.global) result += 'g';\n if(that.ignoreCase) result += 'i';\n if(that.multiline) result += 'm';\n if(that.unicode) result += 'u';\n if(that.sticky) result += 'y';\n return result;\n };\n},{\"5\":5}],28:[function(_dereq_,module,exports){\n var ctx = _dereq_(18)\n , call = _dereq_(41)\n , isArrayIter = _dereq_(36)\n , anObject = _dereq_(5)\n , toLength = _dereq_(80)\n , getIterFn = _dereq_(85);\n module.exports = function(iterable, entries, fn, that){\n var iterFn = getIterFn(iterable)\n , f = ctx(fn, that, entries ? 2 : 1)\n , index = 0\n , length, step, iterator;\n if(typeof iterFn != 'function')throw TypeError(iterable + ' is not iterable!');\n // fast case for arrays with default iterator\n if(isArrayIter(iterFn))for(length = toLength(iterable.length); length > index; index++){\n entries ? f(anObject(step = iterable[index])[0], step[1]) : f(iterable[index]);\n } else for(iterator = iterFn.call(iterable); !(step = iterator.next()).done; ){\n call(iterator, f, step.value, entries);\n }\n };\n},{\"18\":18,\"36\":36,\"41\":41,\"5\":5,\"80\":80,\"85\":85}],29:[function(_dereq_,module,exports){\n// fallback for IE11 buggy Object.getOwnPropertyNames with iframe and window\n var toString = {}.toString\n , toIObject = _dereq_(79)\n , getNames = _dereq_(47).getNames;\n\n var windowNames = typeof window == 'object' && Object.getOwnPropertyNames\n ? Object.getOwnPropertyNames(window) : [];\n\n var getWindowNames = function(it){\n try {\n return getNames(it);\n } catch(e){\n return windowNames.slice();\n }\n };\n\n module.exports.get = function getOwnPropertyNames(it){\n if(windowNames && toString.call(it) == '[object Window]')return getWindowNames(it);\n return getNames(toIObject(it));\n };\n},{\"47\":47,\"79\":79}],30:[function(_dereq_,module,exports){\n// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028\n var global = module.exports = typeof window != 'undefined' && window.Math == Math\n ? window : typeof self != 'undefined' && self.Math == Math ? self : Function('return this')();\n if(typeof __g == 'number')__g = global; // eslint-disable-line no-undef\n},{}],31:[function(_dereq_,module,exports){\n var hasOwnProperty = {}.hasOwnProperty;\n module.exports = function(it, key){\n return hasOwnProperty.call(it, key);\n };\n},{}],32:[function(_dereq_,module,exports){\n var $ = _dereq_(47)\n , createDesc = _dereq_(61);\n module.exports = _dereq_(21) ? function(object, key, value){\n return $.setDesc(object, key, createDesc(1, value));\n } : function(object, key, value){\n object[key] = value;\n return object;\n };\n},{\"21\":21,\"47\":47,\"61\":61}],33:[function(_dereq_,module,exports){\n module.exports = _dereq_(30).document && document.documentElement;\n},{\"30\":30}],34:[function(_dereq_,module,exports){\n// fast apply, http://jsperf.lnkit.com/fast-apply/5\n module.exports = function(fn, args, that){\n var un = that === undefined;\n switch(args.length){\n case 0: return un ? fn()\n : fn.call(that);\n case 1: return un ? fn(args[0])\n : fn.call(that, args[0]);\n case 2: return un ? fn(args[0], args[1])\n : fn.call(that, args[0], args[1]);\n case 3: return un ? fn(args[0], args[1], args[2])\n : fn.call(that, args[0], args[1], args[2]);\n case 4: return un ? fn(args[0], args[1], args[2], args[3])\n : fn.call(that, args[0], args[1], args[2], args[3]);\n } return fn.apply(that, args);\n };\n},{}],35:[function(_dereq_,module,exports){\n// fallback for non-array-like ES3 and non-enumerable old V8 strings\n var cof = _dereq_(12);\n module.exports = Object('z').propertyIsEnumerable(0) ? Object : function(it){\n return cof(it) == 'String' ? it.split('') : Object(it);\n };\n},{\"12\":12}],36:[function(_dereq_,module,exports){\n// check on default Array iterator\n var Iterators = _dereq_(46)\n , ITERATOR = _dereq_(84)('iterator')\n , ArrayProto = Array.prototype;\n\n module.exports = function(it){\n return (Iterators.Array || ArrayProto[ITERATOR]) === it;\n };\n},{\"46\":46,\"84\":84}],37:[function(_dereq_,module,exports){\n// 7.2.2 IsArray(argument)\n var cof = _dereq_(12);\n module.exports = Array.isArray || function(arg){\n return cof(arg) == 'Array';\n };\n},{\"12\":12}],38:[function(_dereq_,module,exports){\n// 20.1.2.3 Number.isInteger(number)\n var isObject = _dereq_(39)\n , floor = Math.floor;\n module.exports = function isInteger(it){\n return !isObject(it) && isFinite(it) && floor(it) === it;\n };\n},{\"39\":39}],39:[function(_dereq_,module,exports){\n module.exports = function(it){\n return typeof it === 'object' ? it !== null : typeof it === 'function';\n };\n},{}],40:[function(_dereq_,module,exports){\n// 7.2.8 IsRegExp(argument)\n var isObject = _dereq_(39)\n , cof = _dereq_(12)\n , MATCH = _dereq_(84)('match');\n module.exports = function(it){\n var isRegExp;\n return isObject(it) && ((isRegExp = it[MATCH]) !== undefined ? !!isRegExp : cof(it) == 'RegExp');\n };\n},{\"12\":12,\"39\":39,\"84\":84}],41:[function(_dereq_,module,exports){\n// call something on iterator step with safe closing on error\n var anObject = _dereq_(5);\n module.exports = function(iterator, fn, value, entries){\n try {\n return entries ? fn(anObject(value)[0], value[1]) : fn(value);\n // 7.4.6 IteratorClose(iterator, completion)\n } catch(e){\n var ret = iterator['return'];\n if(ret !== undefined)anObject(ret.call(iterator));\n throw e;\n }\n };\n},{\"5\":5}],42:[function(_dereq_,module,exports){\n 'use strict';\n var $ = _dereq_(47)\n , descriptor = _dereq_(61)\n , setToStringTag = _dereq_(67)\n , IteratorPrototype = {};\n\n// 25.1.2.1.1 %IteratorPrototype%[@@iterator]()\n _dereq_(32)(IteratorPrototype, _dereq_(84)('iterator'), function(){ return this; });\n\n module.exports = function(Constructor, NAME, next){\n Constructor.prototype = $.create(IteratorPrototype, {next: descriptor(1, next)});\n setToStringTag(Constructor, NAME + ' Iterator');\n };\n},{\"32\":32,\"47\":47,\"61\":61,\"67\":67,\"84\":84}],43:[function(_dereq_,module,exports){\n 'use strict';\n var LIBRARY = _dereq_(49)\n , $def = _dereq_(19)\n , $redef = _dereq_(62)\n , hide = _dereq_(32)\n , has = _dereq_(31)\n , SYMBOL_ITERATOR = _dereq_(84)('iterator')\n , Iterators = _dereq_(46)\n , $iterCreate = _dereq_(42)\n , setToStringTag = _dereq_(67)\n , getProto = _dereq_(47).getProto\n , BUGGY = !([].keys && 'next' in [].keys()) // Safari has buggy iterators w/o `next`\n , FF_ITERATOR = '@@iterator'\n , KEYS = 'keys'\n , VALUES = 'values';\n var returnThis = function(){ return this; };\n module.exports = function(Base, NAME, Constructor, next, DEFAULT, IS_SET, FORCE){\n $iterCreate(Constructor, NAME, next);\n var getMethod = function(kind){\n if(!BUGGY && kind in proto)return proto[kind];\n switch(kind){\n case KEYS: return function keys(){ return new Constructor(this, kind); };\n case VALUES: return function values(){ return new Constructor(this, kind); };\n } return function entries(){ return new Constructor(this, kind); };\n };\n var TAG = NAME + ' Iterator'\n , proto = Base.prototype\n , _native = proto[SYMBOL_ITERATOR] || proto[FF_ITERATOR] || DEFAULT && proto[DEFAULT]\n , _default = _native || getMethod(DEFAULT)\n , methods, key;\n // Fix native\n if(_native){\n var IteratorPrototype = getProto(_default.call(new Base));\n // Set @@toStringTag to native iterators\n setToStringTag(IteratorPrototype, TAG, true);\n // FF fix\n if(!LIBRARY && has(proto, FF_ITERATOR))hide(IteratorPrototype, SYMBOL_ITERATOR, returnThis);\n }\n // Define iterator\n if((!LIBRARY || FORCE) && (BUGGY || !(SYMBOL_ITERATOR in proto))){\n hide(proto, SYMBOL_ITERATOR, _default);\n }\n // Plug for library\n Iterators[NAME] = _default;\n Iterators[TAG] = returnThis;\n if(DEFAULT){\n methods = {\n values: DEFAULT == VALUES ? _default : getMethod(VALUES),\n keys: IS_SET ? _default : getMethod(KEYS),\n entries: DEFAULT != VALUES ? _default : getMethod('entries')\n };\n if(FORCE)for(key in methods){\n if(!(key in proto))$redef(proto, key, methods[key]);\n } else $def($def.P + $def.F * BUGGY, NAME, methods);\n }\n return methods;\n };\n},{\"19\":19,\"31\":31,\"32\":32,\"42\":42,\"46\":46,\"47\":47,\"49\":49,\"62\":62,\"67\":67,\"84\":84}],44:[function(_dereq_,module,exports){\n var ITERATOR = _dereq_(84)('iterator')\n , SAFE_CLOSING = false;\n\n try {\n var riter = [7][ITERATOR]();\n riter['return'] = function(){ SAFE_CLOSING = true; };\n Array.from(riter, function(){ throw 2; });\n } catch(e){ /* empty */ }\n\n module.exports = function(exec, skipClosing){\n if(!skipClosing && !SAFE_CLOSING)return false;\n var safe = false;\n try {\n var arr = [7]\n , iter = arr[ITERATOR]();\n iter.next = function(){ safe = true; };\n arr[ITERATOR] = function(){ return iter; };\n exec(arr);\n } catch(e){ /* empty */ }\n return safe;\n };\n},{\"84\":84}],45:[function(_dereq_,module,exports){\n module.exports = function(done, value){\n return {value: value, done: !!done};\n };\n},{}],46:[function(_dereq_,module,exports){\n module.exports = {};\n},{}],47:[function(_dereq_,module,exports){\n var $Object = Object;\n module.exports = {\n create: $Object.create,\n getProto: $Object.getPrototypeOf,\n isEnum: {}.propertyIsEnumerable,\n getDesc: $Object.getOwnPropertyDescriptor,\n setDesc: $Object.defineProperty,\n setDescs: $Object.defineProperties,\n getKeys: $Object.keys,\n getNames: $Object.getOwnPropertyNames,\n getSymbols: $Object.getOwnPropertySymbols,\n each: [].forEach\n };\n},{}],48:[function(_dereq_,module,exports){\n var $ = _dereq_(47)\n , toIObject = _dereq_(79);\n module.exports = function(object, el){\n var O = toIObject(object)\n , keys = $.getKeys(O)\n , length = keys.length\n , index = 0\n , key;\n while(length > index)if(O[key = keys[index++]] === el)return key;\n };\n},{\"47\":47,\"79\":79}],49:[function(_dereq_,module,exports){\n module.exports = false;\n},{}],50:[function(_dereq_,module,exports){\n// 20.2.2.14 Math.expm1(x)\n module.exports = Math.expm1 || function expm1(x){\n return (x = +x) == 0 ? x : x > -1e-6 && x < 1e-6 ? x + x * x / 2 : Math.exp(x) - 1;\n };\n},{}],51:[function(_dereq_,module,exports){\n// 20.2.2.20 Math.log1p(x)\n module.exports = Math.log1p || function log1p(x){\n return (x = +x) > -1e-8 && x < 1e-8 ? x - x * x / 2 : Math.log(1 + x);\n };\n},{}],52:[function(_dereq_,module,exports){\n// 20.2.2.28 Math.sign(x)\n module.exports = Math.sign || function sign(x){\n return (x = +x) == 0 || x != x ? x : x < 0 ? -1 : 1;\n };\n},{}],53:[function(_dereq_,module,exports){\n var global = _dereq_(30)\n , macrotask = _dereq_(76).set\n , Observer = global.MutationObserver || global.WebKitMutationObserver\n , process = global.process\n , isNode = _dereq_(12)(process) == 'process'\n , head, last, notify;\n\n var flush = function(){\n var parent, domain;\n if(isNode && (parent = process.domain)){\n process.domain = null;\n parent.exit();\n }\n while(head){\n domain = head.domain;\n if(domain)domain.enter();\n head.fn.call(); // <- currently we use it only for Promise - try / catch not required\n if(domain)domain.exit();\n head = head.next;\n } last = undefined;\n if(parent)parent.enter();\n };\n\n// Node.js\n if(isNode){\n notify = function(){\n process.nextTick(flush);\n };\n// browsers with MutationObserver\n } else if(Observer){\n var toggle = 1\n , node = document.createTextNode('');\n new Observer(flush).observe(node, {characterData: true}); // eslint-disable-line no-new\n notify = function(){\n node.data = toggle = -toggle;\n };\n// for other environments - macrotask based on:\n// - setImmediate\n// - MessageChannel\n// - window.postMessag\n// - onreadystatechange\n// - setTimeout\n } else {\n notify = function(){\n // strange IE + webpack dev server bug - use .call(global)\n macrotask.call(global, flush);\n };\n }\n\n module.exports = function asap(fn){\n var task = {fn: fn, next: undefined, domain: isNode && process.domain};\n if(last)last.next = task;\n if(!head){\n head = task;\n notify();\n } last = task;\n };\n},{\"12\":12,\"30\":30,\"76\":76}],54:[function(_dereq_,module,exports){\n var $redef = _dereq_(62);\n module.exports = function(target, src){\n for(var key in src)$redef(target, key, src[key]);\n return target;\n };\n},{\"62\":62}],55:[function(_dereq_,module,exports){\n// 19.1.2.1 Object.assign(target, source, ...)\n var $ = _dereq_(47)\n , toObject = _dereq_(81)\n , IObject = _dereq_(35);\n\n// should work with symbols and should have deterministic property order (V8 bug)\n module.exports = _dereq_(25)(function(){\n var a = Object.assign\n , A = {}\n , B = {}\n , S = Symbol()\n , K = 'abcdefghijklmnopqrst';\n A[S] = 7;\n K.split('').forEach(function(k){ B[k] = k; });\n return a({}, A)[S] != 7 || Object.keys(a({}, B)).join('') != K;\n }) ? function assign(target, source){ // eslint-disable-line no-unused-vars\n var T = toObject(target)\n , $$ = arguments\n , $$len = $$.length\n , index = 1\n , getKeys = $.getKeys\n , getSymbols = $.getSymbols\n , isEnum = $.isEnum;\n while($$len > index){\n var S = IObject($$[index++])\n , keys = getSymbols ? getKeys(S).concat(getSymbols(S)) : getKeys(S)\n , length = keys.length\n , j = 0\n , key;\n while(length > j)if(isEnum.call(S, key = keys[j++]))T[key] = S[key];\n }\n return T;\n } : Object.assign;\n},{\"25\":25,\"35\":35,\"47\":47,\"81\":81}],56:[function(_dereq_,module,exports){\n// most Object methods by ES6 should accept primitives\n var $def = _dereq_(19)\n , core = _dereq_(17)\n , fails = _dereq_(25);\n module.exports = function(KEY, exec){\n var $def = _dereq_(19)\n , fn = (core.Object || {})[KEY] || Object[KEY]\n , exp = {};\n exp[KEY] = exec(fn);\n $def($def.S + $def.F * fails(function(){ fn(1); }), 'Object', exp);\n };\n},{\"17\":17,\"19\":19,\"25\":25}],57:[function(_dereq_,module,exports){\n var $ = _dereq_(47)\n , toIObject = _dereq_(79)\n , isEnum = $.isEnum;\n module.exports = function(isEntries){\n return function(it){\n var O = toIObject(it)\n , keys = $.getKeys(O)\n , length = keys.length\n , i = 0\n , result = []\n , key;\n while(length > i)if(isEnum.call(O, key = keys[i++])){\n result.push(isEntries ? [key, O[key]] : O[key]);\n } return result;\n };\n };\n},{\"47\":47,\"79\":79}],58:[function(_dereq_,module,exports){\n// all object keys, includes non-enumerable and symbols\n var $ = _dereq_(47)\n , anObject = _dereq_(5)\n , Reflect = _dereq_(30).Reflect;\n module.exports = Reflect && Reflect.ownKeys || function ownKeys(it){\n var keys = $.getNames(anObject(it))\n , getSymbols = $.getSymbols;\n return getSymbols ? keys.concat(getSymbols(it)) : keys;\n };\n},{\"30\":30,\"47\":47,\"5\":5}],59:[function(_dereq_,module,exports){\n 'use strict';\n var path = _dereq_(60)\n , invoke = _dereq_(34)\n , aFunction = _dereq_(3);\n module.exports = function(/* ...pargs */){\n var fn = aFunction(this)\n , length = arguments.length\n , pargs = Array(length)\n , i = 0\n , _ = path._\n , holder = false;\n while(length > i)if((pargs[i] = arguments[i++]) === _)holder = true;\n return function(/* ...args */){\n var that = this\n , $$ = arguments\n , $$len = $$.length\n , j = 0, k = 0, args;\n if(!holder && !$$len)return invoke(fn, pargs, that);\n args = pargs.slice();\n if(holder)for(;length > j; j++)if(args[j] === _)args[j] = $$[k++];\n while($$len > k)args.push($$[k++]);\n return invoke(fn, args, that);\n };\n };\n},{\"3\":3,\"34\":34,\"60\":60}],60:[function(_dereq_,module,exports){\n module.exports = _dereq_(30);\n},{\"30\":30}],61:[function(_dereq_,module,exports){\n module.exports = function(bitmap, value){\n return {\n enumerable : !(bitmap & 1),\n configurable: !(bitmap & 2),\n writable : !(bitmap & 4),\n value : value\n };\n };\n},{}],62:[function(_dereq_,module,exports){\n// add fake Function#toString\n// for correct work wrapped methods / constructors with methods like LoDash isNative\n var global = _dereq_(30)\n , hide = _dereq_(32)\n , SRC = _dereq_(83)('src')\n , TO_STRING = 'toString'\n , $toString = Function[TO_STRING]\n , TPL = ('' + $toString).split(TO_STRING);\n\n _dereq_(17).inspectSource = function(it){\n return $toString.call(it);\n };\n\n (module.exports = function(O, key, val, safe){\n if(typeof val == 'function'){\n val.hasOwnProperty(SRC) || hide(val, SRC, O[key] ? '' + O[key] : TPL.join(String(key)));\n val.hasOwnProperty('name') || hide(val, 'name', key);\n }\n if(O === global){\n O[key] = val;\n } else {\n if(!safe)delete O[key];\n hide(O, key, val);\n }\n })(Function.prototype, TO_STRING, function toString(){\n return typeof this == 'function' && this[SRC] || $toString.call(this);\n });\n},{\"17\":17,\"30\":30,\"32\":32,\"83\":83}],63:[function(_dereq_,module,exports){\n module.exports = function(regExp, replace){\n var replacer = replace === Object(replace) ? function(part){\n return replace[part];\n } : replace;\n return function(it){\n return String(it).replace(regExp, replacer);\n };\n };\n},{}],64:[function(_dereq_,module,exports){\n// 7.2.9 SameValue(x, y)\n module.exports = Object.is || function is(x, y){\n return x === y ? x !== 0 || 1 / x === 1 / y : x != x && y != y;\n };\n},{}],65:[function(_dereq_,module,exports){\n// Works with __proto__ only. Old v8 can't work with null proto objects.\n /* eslint-disable no-proto */\n var getDesc = _dereq_(47).getDesc\n , isObject = _dereq_(39)\n , anObject = _dereq_(5);\n var check = function(O, proto){\n anObject(O);\n if(!isObject(proto) && proto !== null)throw TypeError(proto + \": can't set as prototype!\");\n };\n module.exports = {\n set: Object.setPrototypeOf || ('__proto__' in {} ? // eslint-disable-line\n function(test, buggy, set){\n try {\n set = _dereq_(18)(Function.call, getDesc(Object.prototype, '__proto__').set, 2);\n set(test, []);\n buggy = !(test instanceof Array);\n } catch(e){ buggy = true; }\n return function setPrototypeOf(O, proto){\n check(O, proto);\n if(buggy)O.__proto__ = proto;\n else set(O, proto);\n return O;\n };\n }({}, false) : undefined),\n check: check\n };\n},{\"18\":18,\"39\":39,\"47\":47,\"5\":5}],66:[function(_dereq_,module,exports){\n 'use strict';\n var global = _dereq_(30)\n , $ = _dereq_(47)\n , DESCRIPTORS = _dereq_(21)\n , SPECIES = _dereq_(84)('species');\n\n module.exports = function(KEY){\n var C = global[KEY];\n if(DESCRIPTORS && C && !C[SPECIES])$.setDesc(C, SPECIES, {\n configurable: true,\n get: function(){ return this; }\n });\n };\n},{\"21\":21,\"30\":30,\"47\":47,\"84\":84}],67:[function(_dereq_,module,exports){\n var def = _dereq_(47).setDesc\n , has = _dereq_(31)\n , TAG = _dereq_(84)('toStringTag');\n\n module.exports = function(it, tag, stat){\n if(it && !has(it = stat ? it : it.prototype, TAG))def(it, TAG, {configurable: true, value: tag});\n };\n},{\"31\":31,\"47\":47,\"84\":84}],68:[function(_dereq_,module,exports){\n var global = _dereq_(30)\n , SHARED = '__core-js_shared__'\n , store = global[SHARED] || (global[SHARED] = {});\n module.exports = function(key){\n return store[key] || (store[key] = {});\n };\n},{\"30\":30}],69:[function(_dereq_,module,exports){\n// 7.3.20 SpeciesConstructor(O, defaultConstructor)\n var anObject = _dereq_(5)\n , aFunction = _dereq_(3)\n , SPECIES = _dereq_(84)('species');\n module.exports = function(O, D){\n var C = anObject(O).constructor, S;\n return C === undefined || (S = anObject(C)[SPECIES]) == undefined ? D : aFunction(S);\n };\n},{\"3\":3,\"5\":5,\"84\":84}],70:[function(_dereq_,module,exports){\n module.exports = function(it, Constructor, name){\n if(!(it instanceof Constructor))throw TypeError(name + \": use the 'new' operator!\");\n return it;\n };\n},{}],71:[function(_dereq_,module,exports){\n var toInteger = _dereq_(78)\n , defined = _dereq_(20);\n// true -> String#at\n// false -> String#codePointAt\n module.exports = function(TO_STRING){\n return function(that, pos){\n var s = String(defined(that))\n , i = toInteger(pos)\n , l = s.length\n , a, b;\n if(i < 0 || i >= l)return TO_STRING ? '' : undefined;\n a = s.charCodeAt(i);\n return a < 0xd800 || a > 0xdbff || i + 1 === l\n || (b = s.charCodeAt(i + 1)) < 0xdc00 || b > 0xdfff\n ? TO_STRING ? s.charAt(i) : a\n : TO_STRING ? s.slice(i, i + 2) : (a - 0xd800 << 10) + (b - 0xdc00) + 0x10000;\n };\n };\n},{\"20\":20,\"78\":78}],72:[function(_dereq_,module,exports){\n// helper for String#{startsWith, endsWith, includes}\n var isRegExp = _dereq_(40)\n , defined = _dereq_(20);\n\n module.exports = function(that, searchString, NAME){\n if(isRegExp(searchString))throw TypeError('String#' + NAME + \" doesn't accept regex!\");\n return String(defined(that));\n };\n},{\"20\":20,\"40\":40}],73:[function(_dereq_,module,exports){\n// https://github.com/ljharb/proposal-string-pad-left-right\n var toLength = _dereq_(80)\n , repeat = _dereq_(74)\n , defined = _dereq_(20);\n\n module.exports = function(that, maxLength, fillString, left){\n var S = String(defined(that))\n , stringLength = S.length\n , fillStr = fillString === undefined ? ' ' : String(fillString)\n , intMaxLength = toLength(maxLength);\n if(intMaxLength <= stringLength)return S;\n if(fillStr == '')fillStr = ' ';\n var fillLen = intMaxLength - stringLength\n , stringFiller = repeat.call(fillStr, Math.ceil(fillLen / fillStr.length));\n if(stringFiller.length > fillLen)stringFiller = stringFiller.slice(0, fillLen);\n return left ? stringFiller + S : S + stringFiller;\n };\n},{\"20\":20,\"74\":74,\"80\":80}],74:[function(_dereq_,module,exports){\n 'use strict';\n var toInteger = _dereq_(78)\n , defined = _dereq_(20);\n\n module.exports = function repeat(count){\n var str = String(defined(this))\n , res = ''\n , n = toInteger(count);\n if(n < 0 || n == Infinity)throw RangeError(\"Count can't be negative\");\n for(;n > 0; (n >>>= 1) && (str += str))if(n & 1)res += str;\n return res;\n };\n},{\"20\":20,\"78\":78}],75:[function(_dereq_,module,exports){\n var $def = _dereq_(19)\n , defined = _dereq_(20)\n , fails = _dereq_(25)\n , spaces = '\\x09\\x0A\\x0B\\x0C\\x0D\\x20\\xA0\\u1680\\u180E\\u2000\\u2001\\u2002\\u2003' +\n '\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200A\\u202F\\u205F\\u3000\\u2028\\u2029\\uFEFF'\n , space = '[' + spaces + ']'\n , non = '\\u200b\\u0085'\n , ltrim = RegExp('^' + space + space + '*')\n , rtrim = RegExp(space + space + '*$');\n\n var $export = function(KEY, exec){\n var exp = {};\n exp[KEY] = exec(trim);\n $def($def.P + $def.F * fails(function(){\n return !!spaces[KEY]() || non[KEY]() != non;\n }), 'String', exp);\n };\n\n// 1 -> String#trimLeft\n// 2 -> String#trimRight\n// 3 -> String#trim\n var trim = $export.trim = function(string, TYPE){\n string = String(defined(string));\n if(TYPE & 1)string = string.replace(ltrim, '');\n if(TYPE & 2)string = string.replace(rtrim, '');\n return string;\n };\n\n module.exports = $export;\n},{\"19\":19,\"20\":20,\"25\":25}],76:[function(_dereq_,module,exports){\n 'use strict';\n var ctx = _dereq_(18)\n , invoke = _dereq_(34)\n , html = _dereq_(33)\n , cel = _dereq_(22)\n , global = _dereq_(30)\n , process = global.process\n , setTask = global.setImmediate\n , clearTask = global.clearImmediate\n , MessageChannel = global.MessageChannel\n , counter = 0\n , queue = {}\n , ONREADYSTATECHANGE = 'onreadystatechange'\n , defer, channel, port;\n var run = function(){\n var id = +this;\n if(queue.hasOwnProperty(id)){\n var fn = queue[id];\n delete queue[id];\n fn();\n }\n };\n var listner = function(event){\n run.call(event.data);\n };\n// Node.js 0.9+ & IE10+ has setImmediate, otherwise:\n if(!setTask || !clearTask){\n setTask = function setImmediate(fn){\n var args = [], i = 1;\n while(arguments.length > i)args.push(arguments[i++]);\n queue[++counter] = function(){\n invoke(typeof fn == 'function' ? fn : Function(fn), args);\n };\n defer(counter);\n return counter;\n };\n clearTask = function clearImmediate(id){\n delete queue[id];\n };\n // Node.js 0.8-\n if(_dereq_(12)(process) == 'process'){\n defer = function(id){\n process.nextTick(ctx(run, id, 1));\n };\n // Browsers with MessageChannel, includes WebWorkers\n } else if(MessageChannel){\n channel = new MessageChannel;\n port = channel.port2;\n channel.port1.onmessage = listner;\n defer = ctx(port.postMessage, port, 1);\n // Browsers with postMessage, skip WebWorkers\n // IE8 has postMessage, but it's sync & typeof its postMessage is 'object'\n } else if(global.addEventListener && typeof postMessage == 'function' && !global.importScripts){\n defer = function(id){\n global.postMessage(id + '', '*');\n };\n global.addEventListener('message', listner, false);\n // IE8-\n } else if(ONREADYSTATECHANGE in cel('script')){\n defer = function(id){\n html.appendChild(cel('script'))[ONREADYSTATECHANGE] = function(){\n html.removeChild(this);\n run.call(id);\n };\n };\n // Rest old browsers\n } else {\n defer = function(id){\n setTimeout(ctx(run, id, 1), 0);\n };\n }\n }\n module.exports = {\n set: setTask,\n clear: clearTask\n };\n},{\"12\":12,\"18\":18,\"22\":22,\"30\":30,\"33\":33,\"34\":34}],77:[function(_dereq_,module,exports){\n var toInteger = _dereq_(78)\n , max = Math.max\n , min = Math.min;\n module.exports = function(index, length){\n index = toInteger(index);\n return index < 0 ? max(index + length, 0) : min(index, length);\n };\n},{\"78\":78}],78:[function(_dereq_,module,exports){\n// 7.1.4 ToInteger\n var ceil = Math.ceil\n , floor = Math.floor;\n module.exports = function(it){\n return isNaN(it = +it) ? 0 : (it > 0 ? floor : ceil)(it);\n };\n},{}],79:[function(_dereq_,module,exports){\n// to indexed object, toObject with fallback for non-array-like ES3 strings\n var IObject = _dereq_(35)\n , defined = _dereq_(20);\n module.exports = function(it){\n return IObject(defined(it));\n };\n},{\"20\":20,\"35\":35}],80:[function(_dereq_,module,exports){\n// 7.1.15 ToLength\n var toInteger = _dereq_(78)\n , min = Math.min;\n module.exports = function(it){\n return it > 0 ? min(toInteger(it), 0x1fffffffffffff) : 0; // pow(2, 53) - 1 == 9007199254740991\n };\n},{\"78\":78}],81:[function(_dereq_,module,exports){\n// 7.1.13 ToObject(argument)\n var defined = _dereq_(20);\n module.exports = function(it){\n return Object(defined(it));\n };\n},{\"20\":20}],82:[function(_dereq_,module,exports){\n// 7.1.1 ToPrimitive(input [, PreferredType])\n var isObject = _dereq_(39);\n// instead of the ES6 spec version, we didn't implement @@toPrimitive case\n// and the second argument - flag - preferred type is a string\n module.exports = function(it, S){\n if(!isObject(it))return it;\n var fn, val;\n if(S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it)))return val;\n if(typeof (fn = it.valueOf) == 'function' && !isObject(val = fn.call(it)))return val;\n if(!S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it)))return val;\n throw TypeError(\"Can't convert object to primitive value\");\n };\n},{\"39\":39}],83:[function(_dereq_,module,exports){\n var id = 0\n , px = Math.random();\n module.exports = function(key){\n return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id + px).toString(36));\n };\n},{}],84:[function(_dereq_,module,exports){\n var store = _dereq_(68)('wks')\n , uid = _dereq_(83)\n , Symbol = _dereq_(30).Symbol;\n module.exports = function(name){\n return store[name] || (store[name] =\n Symbol && Symbol[name] || (Symbol || uid)('Symbol.' + name));\n };\n},{\"30\":30,\"68\":68,\"83\":83}],85:[function(_dereq_,module,exports){\n var classof = _dereq_(11)\n , ITERATOR = _dereq_(84)('iterator')\n , Iterators = _dereq_(46);\n module.exports = _dereq_(17).getIteratorMethod = function(it){\n if(it != undefined)return it[ITERATOR]\n || it['@@iterator']\n || Iterators[classof(it)];\n };\n},{\"11\":11,\"17\":17,\"46\":46,\"84\":84}],86:[function(_dereq_,module,exports){\n 'use strict';\n var $ = _dereq_(47)\n , DESCRIPTORS = _dereq_(21)\n , createDesc = _dereq_(61)\n , html = _dereq_(33)\n , cel = _dereq_(22)\n , has = _dereq_(31)\n , cof = _dereq_(12)\n , $def = _dereq_(19)\n , invoke = _dereq_(34)\n , arrayMethod = _dereq_(9)\n , IE_PROTO = _dereq_(83)('__proto__')\n , isObject = _dereq_(39)\n , anObject = _dereq_(5)\n , aFunction = _dereq_(3)\n , toObject = _dereq_(81)\n , toIObject = _dereq_(79)\n , toInteger = _dereq_(78)\n , toIndex = _dereq_(77)\n , toLength = _dereq_(80)\n , IObject = _dereq_(35)\n , fails = _dereq_(25)\n , ObjectProto = Object.prototype\n , A = []\n , _slice = A.slice\n , _join = A.join\n , defineProperty = $.setDesc\n , getOwnDescriptor = $.getDesc\n , defineProperties = $.setDescs\n , $indexOf = _dereq_(8)(false)\n , factories = {}\n , IE8_DOM_DEFINE;\n\n if(!DESCRIPTORS){\n IE8_DOM_DEFINE = !fails(function(){\n return defineProperty(cel('div'), 'a', {get: function(){ return 7; }}).a != 7;\n });\n $.setDesc = function(O, P, Attributes){\n if(IE8_DOM_DEFINE)try {\n return defineProperty(O, P, Attributes);\n } catch(e){ /* empty */ }\n if('get' in Attributes || 'set' in Attributes)throw TypeError('Accessors not supported!');\n if('value' in Attributes)anObject(O)[P] = Attributes.value;\n return O;\n };\n $.getDesc = function(O, P){\n if(IE8_DOM_DEFINE)try {\n return getOwnDescriptor(O, P);\n } catch(e){ /* empty */ }\n if(has(O, P))return createDesc(!ObjectProto.propertyIsEnumerable.call(O, P), O[P]);\n };\n $.setDescs = defineProperties = function(O, Properties){\n anObject(O);\n var keys = $.getKeys(Properties)\n , length = keys.length\n , i = 0\n , P;\n while(length > i)$.setDesc(O, P = keys[i++], Properties[P]);\n return O;\n };\n }\n $def($def.S + $def.F * !DESCRIPTORS, 'Object', {\n // 19.1.2.6 / 15.2.3.3 Object.getOwnPropertyDescriptor(O, P)\n getOwnPropertyDescriptor: $.getDesc,\n // 19.1.2.4 / 15.2.3.6 Object.defineProperty(O, P, Attributes)\n defineProperty: $.setDesc,\n // 19.1.2.3 / 15.2.3.7 Object.defineProperties(O, Properties)\n defineProperties: defineProperties\n });\n\n // IE 8- don't enum bug keys\n var keys1 = ('constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,' +\n 'toLocaleString,toString,valueOf').split(',')\n // Additional keys for getOwnPropertyNames\n , keys2 = keys1.concat('length', 'prototype')\n , keysLen1 = keys1.length;\n\n// Create object with `null` prototype: use iframe Object with cleared prototype\n var createDict = function(){\n // Thrash, waste and sodomy: IE GC bug\n var iframe = cel('iframe')\n , i = keysLen1\n , gt = '>'\n , iframeDocument;\n iframe.style.display = 'none';\n html.appendChild(iframe);\n iframe.src = 'javascript:'; // eslint-disable-line no-script-url\n // createDict = iframe.contentWindow.Object;\n // html.removeChild(iframe);\n iframeDocument = iframe.contentWindow.document;\n iframeDocument.open();\n iframeDocument.write('<script>document.F=Object</script' + gt);\n iframeDocument.close();\n createDict = iframeDocument.F;\n while(i--)delete createDict.prototype[keys1[i]];\n return createDict();\n };\n var createGetKeys = function(names, length){\n return function(object){\n var O = toIObject(object)\n , i = 0\n , result = []\n , key;\n for(key in O)if(key != IE_PROTO)has(O, key) && result.push(key);\n // Don't enum bug & hidden keys\n while(length > i)if(has(O, key = names[i++])){\n ~$indexOf(result, key) || result.push(key);\n }\n return result;\n };\n };\n var Empty = function(){};\n $def($def.S, 'Object', {\n // 19.1.2.9 / 15.2.3.2 Object.getPrototypeOf(O)\n getPrototypeOf: $.getProto = $.getProto || function(O){\n O = toObject(O);\n if(has(O, IE_PROTO))return O[IE_PROTO];\n if(typeof O.constructor == 'function' && O instanceof O.constructor){\n return O.constructor.prototype;\n } return O instanceof Object ? ObjectProto : null;\n },\n // 19.1.2.7 / 15.2.3.4 Object.getOwnPropertyNames(O)\n getOwnPropertyNames: $.getNames = $.getNames || createGetKeys(keys2, keys2.length, true),\n // 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties])\n create: $.create = $.create || function(O, /*?*/Properties){\n var result;\n if(O !== null){\n Empty.prototype = anObject(O);\n result = new Empty();\n Empty.prototype = null;\n // add \"__proto__\" for Object.getPrototypeOf shim\n result[IE_PROTO] = O;\n } else result = createDict();\n return Properties === undefined ? result : defineProperties(result, Properties);\n },\n // 19.1.2.14 / 15.2.3.14 Object.keys(O)\n keys: $.getKeys = $.getKeys || createGetKeys(keys1, keysLen1, false)\n });\n\n var construct = function(F, len, args){\n if(!(len in factories)){\n for(var n = [], i = 0; i < len; i++)n[i] = 'a[' + i + ']';\n factories[len] = Function('F,a', 'return new F(' + n.join(',') + ')');\n }\n return factories[len](F, args);\n };\n\n// 19.2.3.2 / 15.3.4.5 Function.prototype.bind(thisArg, args...)\n $def($def.P, 'Function', {\n bind: function bind(that /*, args... */){\n var fn = aFunction(this)\n , partArgs = _slice.call(arguments, 1);\n var bound = function(/* args... */){\n var args = partArgs.concat(_slice.call(arguments));\n return this instanceof bound ? construct(fn, args.length, args) : invoke(fn, args, that);\n };\n if(isObject(fn.prototype))bound.prototype = fn.prototype;\n return bound;\n }\n });\n\n// fallback for not array-like ES3 strings and DOM objects\n var buggySlice = fails(function(){\n if(html)_slice.call(html);\n });\n\n $def($def.P + $def.F * buggySlice, 'Array', {\n slice: function(begin, end){\n var len = toLength(this.length)\n , klass = cof(this);\n end = end === undefined ? len : end;\n if(klass == 'Array')return _slice.call(this, begin, end);\n var start = toIndex(begin, len)\n , upTo = toIndex(end, len)\n , size = toLength(upTo - start)\n , cloned = Array(size)\n , i = 0;\n for(; i < size; i++)cloned[i] = klass == 'String'\n ? this.charAt(start + i)\n : this[start + i];\n return cloned;\n }\n });\n $def($def.P + $def.F * (IObject != Object), 'Array', {\n join: function(){\n return _join.apply(IObject(this), arguments);\n }\n });\n\n// 22.1.2.2 / 15.4.3.2 Array.isArray(arg)\n $def($def.S, 'Array', {isArray: _dereq_(37)});\n\n var createArrayReduce = function(isRight){\n return function(callbackfn, memo){\n aFunction(callbackfn);\n var O = IObject(this)\n , length = toLength(O.length)\n , index = isRight ? length - 1 : 0\n , i = isRight ? -1 : 1;\n if(arguments.length < 2)for(;;){\n if(index in O){\n memo = O[index];\n index += i;\n break;\n }\n index += i;\n if(isRight ? index < 0 : length <= index){\n throw TypeError('Reduce of empty array with no initial value');\n }\n }\n for(;isRight ? index >= 0 : length > index; index += i)if(index in O){\n memo = callbackfn(memo, O[index], index, this);\n }\n return memo;\n };\n };\n var methodize = function($fn){\n return function(arg1/*, arg2 = undefined */){\n return $fn(this, arg1, arguments[1]);\n };\n };\n $def($def.P, 'Array', {\n // 22.1.3.10 / 15.4.4.18 Array.prototype.forEach(callbackfn [, thisArg])\n forEach: $.each = $.each || methodize(arrayMethod(0)),\n // 22.1.3.15 / 15.4.4.19 Array.prototype.map(callbackfn [, thisArg])\n map: methodize(arrayMethod(1)),\n // 22.1.3.7 / 15.4.4.20 Array.prototype.filter(callbackfn [, thisArg])\n filter: methodize(arrayMethod(2)),\n // 22.1.3.23 / 15.4.4.17 Array.prototype.some(callbackfn [, thisArg])\n some: methodize(arrayMethod(3)),\n // 22.1.3.5 / 15.4.4.16 Array.prototype.every(callbackfn [, thisArg])\n every: methodize(arrayMethod(4)),\n // 22.1.3.18 / 15.4.4.21 Array.prototype.reduce(callbackfn [, initialValue])\n reduce: createArrayReduce(false),\n // 22.1.3.19 / 15.4.4.22 Array.prototype.reduceRight(callbackfn [, initialValue])\n reduceRight: createArrayReduce(true),\n // 22.1.3.11 / 15.4.4.14 Array.prototype.indexOf(searchElement [, fromIndex])\n indexOf: methodize($indexOf),\n // 22.1.3.14 / 15.4.4.15 Array.prototype.lastIndexOf(searchElement [, fromIndex])\n lastIndexOf: function(el, fromIndex /* = @[*-1] */){\n var O = toIObject(this)\n , length = toLength(O.length)\n , index = length - 1;\n if(arguments.length > 1)index = Math.min(index, toInteger(fromIndex));\n if(index < 0)index = toLength(length + index);\n for(;index >= 0; index--)if(index in O)if(O[index] === el)return index;\n return -1;\n }\n });\n\n// 20.3.3.1 / 15.9.4.4 Date.now()\n $def($def.S, 'Date', {now: function(){ return +new Date; }});\n\n var lz = function(num){\n return num > 9 ? num : '0' + num;\n };\n\n// 20.3.4.36 / 15.9.5.43 Date.prototype.toISOString()\n// PhantomJS and old webkit had a broken Date implementation.\n var date = new Date(-5e13 - 1)\n , brokenDate = !(date.toISOString && date.toISOString() == '0385-07-25T07:06:39.999Z'\n && fails(function(){ new Date(NaN).toISOString(); }));\n $def($def.P + $def.F * brokenDate, 'Date', {\n toISOString: function toISOString(){\n if(!isFinite(this))throw RangeError('Invalid time value');\n var d = this\n , y = d.getUTCFullYear()\n , m = d.getUTCMilliseconds()\n , s = y < 0 ? '-' : y > 9999 ? '+' : '';\n return s + ('00000' + Math.abs(y)).slice(s ? -6 : -4) +\n '-' + lz(d.getUTCMonth() + 1) + '-' + lz(d.getUTCDate()) +\n 'T' + lz(d.getUTCHours()) + ':' + lz(d.getUTCMinutes()) +\n ':' + lz(d.getUTCSeconds()) + '.' + (m > 99 ? m : '0' + lz(m)) + 'Z';\n }\n });\n},{\"12\":12,\"19\":19,\"21\":21,\"22\":22,\"25\":25,\"3\":3,\"31\":31,\"33\":33,\"34\":34,\"35\":35,\"37\":37,\"39\":39,\"47\":47,\"5\":5,\"61\":61,\"77\":77,\"78\":78,\"79\":79,\"8\":8,\"80\":80,\"81\":81,\"83\":83,\"9\":9}],87:[function(_dereq_,module,exports){\n// 22.1.3.3 Array.prototype.copyWithin(target, start, end = this.length)\n 'use strict';\n var $def = _dereq_(19);\n\n $def($def.P, 'Array', {copyWithin: _dereq_(6)});\n\n _dereq_(4)('copyWithin');\n},{\"19\":19,\"4\":4,\"6\":6}],88:[function(_dereq_,module,exports){\n// 22.1.3.6 Array.prototype.fill(value, start = 0, end = this.length)\n var $def = _dereq_(19);\n\n $def($def.P, 'Array', {fill: _dereq_(7)});\n\n _dereq_(4)('fill');\n},{\"19\":19,\"4\":4,\"7\":7}],89:[function(_dereq_,module,exports){\n 'use strict';\n// 22.1.3.9 Array.prototype.findIndex(predicate, thisArg = undefined)\n var KEY = 'findIndex'\n , $def = _dereq_(19)\n , forced = true\n , $find = _dereq_(9)(6);\n// Shouldn't skip holes\n if(KEY in [])Array(1)[KEY](function(){ forced = false; });\n $def($def.P + $def.F * forced, 'Array', {\n findIndex: function findIndex(callbackfn/*, that = undefined */){\n return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);\n }\n });\n _dereq_(4)(KEY);\n},{\"19\":19,\"4\":4,\"9\":9}],90:[function(_dereq_,module,exports){\n 'use strict';\n// 22.1.3.8 Array.prototype.find(predicate, thisArg = undefined)\n var KEY = 'find'\n , $def = _dereq_(19)\n , forced = true\n , $find = _dereq_(9)(5);\n// Shouldn't skip holes\n if(KEY in [])Array(1)[KEY](function(){ forced = false; });\n $def($def.P + $def.F * forced, 'Array', {\n find: function find(callbackfn/*, that = undefined */){\n return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);\n }\n });\n _dereq_(4)(KEY);\n},{\"19\":19,\"4\":4,\"9\":9}],91:[function(_dereq_,module,exports){\n 'use strict';\n var ctx = _dereq_(18)\n , $def = _dereq_(19)\n , toObject = _dereq_(81)\n , call = _dereq_(41)\n , isArrayIter = _dereq_(36)\n , toLength = _dereq_(80)\n , getIterFn = _dereq_(85);\n $def($def.S + $def.F * !_dereq_(44)(function(iter){ Array.from(iter); }), 'Array', {\n // 22.1.2.1 Array.from(arrayLike, mapfn = undefined, thisArg = undefined)\n from: function from(arrayLike/*, mapfn = undefined, thisArg = undefined*/){\n var O = toObject(arrayLike)\n , C = typeof this == 'function' ? this : Array\n , $$ = arguments\n , $$len = $$.length\n , mapfn = $$len > 1 ? $$[1] : undefined\n , mapping = mapfn !== undefined\n , index = 0\n , iterFn = getIterFn(O)\n , length, result, step, iterator;\n if(mapping)mapfn = ctx(mapfn, $$len > 2 ? $$[2] : undefined, 2);\n // if object isn't iterable or it's array with default iterator - use simple case\n if(iterFn != undefined && !(C == Array && isArrayIter(iterFn))){\n for(iterator = iterFn.call(O), result = new C; !(step = iterator.next()).done; index++){\n result[index] = mapping ? call(iterator, mapfn, [step.value, index], true) : step.value;\n }\n } else {\n length = toLength(O.length);\n for(result = new C(length); length > index; index++){\n result[index] = mapping ? mapfn(O[index], index) : O[index];\n }\n }\n result.length = index;\n return result;\n }\n });\n\n},{\"18\":18,\"19\":19,\"36\":36,\"41\":41,\"44\":44,\"80\":80,\"81\":81,\"85\":85}],92:[function(_dereq_,module,exports){\n 'use strict';\n var addToUnscopables = _dereq_(4)\n , step = _dereq_(45)\n , Iterators = _dereq_(46)\n , toIObject = _dereq_(79);\n\n// 22.1.3.4 Array.prototype.entries()\n// 22.1.3.13 Array.prototype.keys()\n// 22.1.3.29 Array.prototype.values()\n// 22.1.3.30 Array.prototype[@@iterator]()\n module.exports = _dereq_(43)(Array, 'Array', function(iterated, kind){\n this._t = toIObject(iterated); // target\n this._i = 0; // next index\n this._k = kind; // kind\n// 22.1.5.2.1 %ArrayIteratorPrototype%.next()\n }, function(){\n var O = this._t\n , kind = this._k\n , index = this._i++;\n if(!O || index >= O.length){\n this._t = undefined;\n return step(1);\n }\n if(kind == 'keys' )return step(0, index);\n if(kind == 'values')return step(0, O[index]);\n return step(0, [index, O[index]]);\n }, 'values');\n\n// argumentsList[@@iterator] is %ArrayProto_values% (9.4.4.6, 9.4.4.7)\n Iterators.Arguments = Iterators.Array;\n\n addToUnscopables('keys');\n addToUnscopables('values');\n addToUnscopables('entries');\n},{\"4\":4,\"43\":43,\"45\":45,\"46\":46,\"79\":79}],93:[function(_dereq_,module,exports){\n 'use strict';\n var $def = _dereq_(19);\n\n// WebKit Array.of isn't generic\n $def($def.S + $def.F * _dereq_(25)(function(){\n function F(){}\n return !(Array.of.call(F) instanceof F);\n }), 'Array', {\n // 22.1.2.3 Array.of( ...items)\n of: function of(/* ...args */){\n var index = 0\n , $$ = arguments\n , $$len = $$.length\n , result = new (typeof this == 'function' ? this : Array)($$len);\n while($$len > index)result[index] = $$[index++];\n result.length = $$len;\n return result;\n }\n });\n},{\"19\":19,\"25\":25}],94:[function(_dereq_,module,exports){\n _dereq_(66)('Array');\n},{\"66\":66}],95:[function(_dereq_,module,exports){\n 'use strict';\n var $ = _dereq_(47)\n , isObject = _dereq_(39)\n , HAS_INSTANCE = _dereq_(84)('hasInstance')\n , FunctionProto = Function.prototype;\n// 19.2.3.6 Function.prototype[@@hasInstance](V)\n if(!(HAS_INSTANCE in FunctionProto))$.setDesc(FunctionProto, HAS_INSTANCE, {value: function(O){\n if(typeof this != 'function' || !isObject(O))return false;\n if(!isObject(this.prototype))return O instanceof this;\n // for environment w/o native `@@hasInstance` logic enough `instanceof`, but add this:\n while(O = $.getProto(O))if(this.prototype === O)return true;\n return false;\n }});\n},{\"39\":39,\"47\":47,\"84\":84}],96:[function(_dereq_,module,exports){\n var setDesc = _dereq_(47).setDesc\n , createDesc = _dereq_(61)\n , has = _dereq_(31)\n , FProto = Function.prototype\n , nameRE = /^\\s*function ([^ (]*)/\n , NAME = 'name';\n// 19.2.4.2 name\n NAME in FProto || _dereq_(21) && setDesc(FProto, NAME, {\n configurable: true,\n get: function(){\n var match = ('' + this).match(nameRE)\n , name = match ? match[1] : '';\n has(this, NAME) || setDesc(this, NAME, createDesc(5, name));\n return name;\n }\n });\n},{\"21\":21,\"31\":31,\"47\":47,\"61\":61}],97:[function(_dereq_,module,exports){\n 'use strict';\n var strong = _dereq_(13);\n\n// 23.1 Map Objects\n _dereq_(16)('Map', function(get){\n return function Map(){ return get(this, arguments.length > 0 ? arguments[0] : undefined); };\n }, {\n // 23.1.3.6 Map.prototype.get(key)\n get: function get(key){\n var entry = strong.getEntry(this, key);\n return entry && entry.v;\n },\n // 23.1.3.9 Map.prototype.set(key, value)\n set: function set(key, value){\n return strong.def(this, key === 0 ? 0 : key, value);\n }\n }, strong, true);\n},{\"13\":13,\"16\":16}],98:[function(_dereq_,module,exports){\n// 20.2.2.3 Math.acosh(x)\n var $def = _dereq_(19)\n , log1p = _dereq_(51)\n , sqrt = Math.sqrt\n , $acosh = Math.acosh;\n\n// V8 bug https://code.google.com/p/v8/issues/detail?id=3509\n $def($def.S + $def.F * !($acosh && Math.floor($acosh(Number.MAX_VALUE)) == 710), 'Math', {\n acosh: function acosh(x){\n return (x = +x) < 1 ? NaN : x > 94906265.62425156\n ? Math.log(x) + Math.LN2\n : log1p(x - 1 + sqrt(x - 1) * sqrt(x + 1));\n }\n });\n},{\"19\":19,\"51\":51}],99:[function(_dereq_,module,exports){\n// 20.2.2.5 Math.asinh(x)\n var $def = _dereq_(19);\n\n function asinh(x){\n return !isFinite(x = +x) || x == 0 ? x : x < 0 ? -asinh(-x) : Math.log(x + Math.sqrt(x * x + 1));\n }\n\n $def($def.S, 'Math', {asinh: asinh});\n},{\"19\":19}],100:[function(_dereq_,module,exports){\n// 20.2.2.7 Math.atanh(x)\n var $def = _dereq_(19);\n\n $def($def.S, 'Math', {\n atanh: function atanh(x){\n return (x = +x) == 0 ? x : Math.log((1 + x) / (1 - x)) / 2;\n }\n });\n},{\"19\":19}],101:[function(_dereq_,module,exports){\n// 20.2.2.9 Math.cbrt(x)\n var $def = _dereq_(19)\n , sign = _dereq_(52);\n\n $def($def.S, 'Math', {\n cbrt: function cbrt(x){\n return sign(x = +x) * Math.pow(Math.abs(x), 1 / 3);\n }\n });\n},{\"19\":19,\"52\":52}],102:[function(_dereq_,module,exports){\n// 20.2.2.11 Math.clz32(x)\n var $def = _dereq_(19);\n\n $def($def.S, 'Math', {\n clz32: function clz32(x){\n return (x >>>= 0) ? 31 - Math.floor(Math.log(x + 0.5) * Math.LOG2E) : 32;\n }\n });\n},{\"19\":19}],103:[function(_dereq_,module,exports){\n// 20.2.2.12 Math.cosh(x)\n var $def = _dereq_(19)\n , exp = Math.exp;\n\n $def($def.S, 'Math', {\n cosh: function cosh(x){\n return (exp(x = +x) + exp(-x)) / 2;\n }\n });\n},{\"19\":19}],104:[function(_dereq_,module,exports){\n// 20.2.2.14 Math.expm1(x)\n var $def = _dereq_(19);\n\n $def($def.S, 'Math', {expm1: _dereq_(50)});\n},{\"19\":19,\"50\":50}],105:[function(_dereq_,module,exports){\n// 20.2.2.16 Math.fround(x)\n var $def = _dereq_(19)\n , sign = _dereq_(52)\n , pow = Math.pow\n , EPSILON = pow(2, -52)\n , EPSILON32 = pow(2, -23)\n , MAX32 = pow(2, 127) * (2 - EPSILON32)\n , MIN32 = pow(2, -126);\n\n var roundTiesToEven = function(n){\n return n + 1 / EPSILON - 1 / EPSILON;\n };\n\n\n $def($def.S, 'Math', {\n fround: function fround(x){\n var $abs = Math.abs(x)\n , $sign = sign(x)\n , a, result;\n if($abs < MIN32)return $sign * roundTiesToEven($abs / MIN32 / EPSILON32) * MIN32 * EPSILON32;\n a = (1 + EPSILON32 / EPSILON) * $abs;\n result = a - (a - $abs);\n if(result > MAX32 || result != result)return $sign * Infinity;\n return $sign * result;\n }\n });\n},{\"19\":19,\"52\":52}],106:[function(_dereq_,module,exports){\n// 20.2.2.17 Math.hypot([value1[, value2[, … ]]])\n var $def = _dereq_(19)\n , abs = Math.abs;\n\n $def($def.S, 'Math', {\n hypot: function hypot(value1, value2){ // eslint-disable-line no-unused-vars\n var sum = 0\n , i = 0\n , $$ = arguments\n , $$len = $$.length\n , larg = 0\n , arg, div;\n while(i < $$len){\n arg = abs($$[i++]);\n if(larg < arg){\n div = larg / arg;\n sum = sum * div * div + 1;\n larg = arg;\n } else if(arg > 0){\n div = arg / larg;\n sum += div * div;\n } else sum += arg;\n }\n return larg === Infinity ? Infinity : larg * Math.sqrt(sum);\n }\n });\n},{\"19\":19}],107:[function(_dereq_,module,exports){\n// 20.2.2.18 Math.imul(x, y)\n var $def = _dereq_(19)\n , $imul = Math.imul;\n\n// some WebKit versions fails with big numbers, some has wrong arity\n $def($def.S + $def.F * _dereq_(25)(function(){\n return $imul(0xffffffff, 5) != -5 || $imul.length != 2;\n }), 'Math', {\n imul: function imul(x, y){\n var UINT16 = 0xffff\n , xn = +x\n , yn = +y\n , xl = UINT16 & xn\n , yl = UINT16 & yn;\n return 0 | xl * yl + ((UINT16 & xn >>> 16) * yl + xl * (UINT16 & yn >>> 16) << 16 >>> 0);\n }\n });\n},{\"19\":19,\"25\":25}],108:[function(_dereq_,module,exports){\n// 20.2.2.21 Math.log10(x)\n var $def = _dereq_(19);\n\n $def($def.S, 'Math', {\n log10: function log10(x){\n return Math.log(x) / Math.LN10;\n }\n });\n},{\"19\":19}],109:[function(_dereq_,module,exports){\n// 20.2.2.20 Math.log1p(x)\n var $def = _dereq_(19);\n\n $def($def.S, 'Math', {log1p: _dereq_(51)});\n},{\"19\":19,\"51\":51}],110:[function(_dereq_,module,exports){\n// 20.2.2.22 Math.log2(x)\n var $def = _dereq_(19);\n\n $def($def.S, 'Math', {\n log2: function log2(x){\n return Math.log(x) / Math.LN2;\n }\n });\n},{\"19\":19}],111:[function(_dereq_,module,exports){\n// 20.2.2.28 Math.sign(x)\n var $def = _dereq_(19);\n\n $def($def.S, 'Math', {sign: _dereq_(52)});\n},{\"19\":19,\"52\":52}],112:[function(_dereq_,module,exports){\n// 20.2.2.30 Math.sinh(x)\n var $def = _dereq_(19)\n , expm1 = _dereq_(50)\n , exp = Math.exp;\n\n// V8 near Chromium 38 has a problem with very small numbers\n $def($def.S + $def.F * _dereq_(25)(function(){\n return !Math.sinh(-2e-17) != -2e-17;\n }), 'Math', {\n sinh: function sinh(x){\n return Math.abs(x = +x) < 1\n ? (expm1(x) - expm1(-x)) / 2\n : (exp(x - 1) - exp(-x - 1)) * (Math.E / 2);\n }\n });\n},{\"19\":19,\"25\":25,\"50\":50}],113:[function(_dereq_,module,exports){\n// 20.2.2.33 Math.tanh(x)\n var $def = _dereq_(19)\n , expm1 = _dereq_(50)\n , exp = Math.exp;\n\n $def($def.S, 'Math', {\n tanh: function tanh(x){\n var a = expm1(x = +x)\n , b = expm1(-x);\n return a == Infinity ? 1 : b == Infinity ? -1 : (a - b) / (exp(x) + exp(-x));\n }\n });\n},{\"19\":19,\"50\":50}],114:[function(_dereq_,module,exports){\n// 20.2.2.34 Math.trunc(x)\n var $def = _dereq_(19);\n\n $def($def.S, 'Math', {\n trunc: function trunc(it){\n return (it > 0 ? Math.floor : Math.ceil)(it);\n }\n });\n},{\"19\":19}],115:[function(_dereq_,module,exports){\n 'use strict';\n var $ = _dereq_(47)\n , global = _dereq_(30)\n , has = _dereq_(31)\n , cof = _dereq_(12)\n , toPrimitive = _dereq_(82)\n , fails = _dereq_(25)\n , $trim = _dereq_(75).trim\n , NUMBER = 'Number'\n , $Number = global[NUMBER]\n , Base = $Number\n , proto = $Number.prototype\n // Opera ~12 has broken Object#toString\n , BROKEN_COF = cof($.create(proto)) == NUMBER\n , TRIM = 'trim' in String.prototype;\n\n// 7.1.3 ToNumber(argument)\n var toNumber = function(argument){\n var it = toPrimitive(argument, false);\n if(typeof it == 'string' && it.length > 2){\n it = TRIM ? it.trim() : $trim(it, 3);\n var first = it.charCodeAt(0)\n , third, radix, maxCode;\n if(first === 43 || first === 45){\n third = it.charCodeAt(2);\n if(third === 88 || third === 120)return NaN; // Number('+0x1') should be NaN, old V8 fix\n } else if(first === 48){\n switch(it.charCodeAt(1)){\n case 66 : case 98 : radix = 2; maxCode = 49; break; // fast equal /^0b[01]+$/i\n case 79 : case 111 : radix = 8; maxCode = 55; break; // fast equal /^0o[0-7]+$/i\n default : return +it;\n }\n for(var digits = it.slice(2), i = 0, l = digits.length, code; i < l; i++){\n code = digits.charCodeAt(i);\n // parseInt parses a string to a first unavailable symbol\n // but ToNumber should return NaN if a string contains unavailable symbols\n if(code < 48 || code > maxCode)return NaN;\n } return parseInt(digits, radix);\n }\n } return +it;\n };\n\n if(!$Number(' 0o1') || !$Number('0b1') || $Number('+0x1')){\n $Number = function Number(value){\n var it = arguments.length < 1 ? 0 : value\n , that = this;\n return that instanceof $Number\n // check on 1..constructor(foo) case\n && (BROKEN_COF ? fails(function(){ proto.valueOf.call(that); }) : cof(that) != NUMBER)\n ? new Base(toNumber(it)) : toNumber(it);\n };\n $.each.call(_dereq_(21) ? $.getNames(Base) : (\n // ES3:\n 'MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,' +\n // ES6 (in case, if modules with ES6 Number statics required before):\n 'EPSILON,isFinite,isInteger,isNaN,isSafeInteger,MAX_SAFE_INTEGER,' +\n 'MIN_SAFE_INTEGER,parseFloat,parseInt,isInteger'\n ).split(','), function(key){\n if(has(Base, key) && !has($Number, key)){\n $.setDesc($Number, key, $.getDesc(Base, key));\n }\n });\n $Number.prototype = proto;\n proto.constructor = $Number;\n _dereq_(62)(global, NUMBER, $Number);\n }\n},{\"12\":12,\"21\":21,\"25\":25,\"30\":30,\"31\":31,\"47\":47,\"62\":62,\"75\":75,\"82\":82}],116:[function(_dereq_,module,exports){\n// 20.1.2.1 Number.EPSILON\n var $def = _dereq_(19);\n\n $def($def.S, 'Number', {EPSILON: Math.pow(2, -52)});\n},{\"19\":19}],117:[function(_dereq_,module,exports){\n// 20.1.2.2 Number.isFinite(number)\n var $def = _dereq_(19)\n , _isFinite = _dereq_(30).isFinite;\n\n $def($def.S, 'Number', {\n isFinite: function isFinite(it){\n return typeof it == 'number' && _isFinite(it);\n }\n });\n},{\"19\":19,\"30\":30}],118:[function(_dereq_,module,exports){\n// 20.1.2.3 Number.isInteger(number)\n var $def = _dereq_(19);\n\n $def($def.S, 'Number', {isInteger: _dereq_(38)});\n},{\"19\":19,\"38\":38}],119:[function(_dereq_,module,exports){\n// 20.1.2.4 Number.isNaN(number)\n var $def = _dereq_(19);\n\n $def($def.S, 'Number', {\n isNaN: function isNaN(number){\n return number != number;\n }\n });\n},{\"19\":19}],120:[function(_dereq_,module,exports){\n// 20.1.2.5 Number.isSafeInteger(number)\n var $def = _dereq_(19)\n , isInteger = _dereq_(38)\n , abs = Math.abs;\n\n $def($def.S, 'Number', {\n isSafeInteger: function isSafeInteger(number){\n return isInteger(number) && abs(number) <= 0x1fffffffffffff;\n }\n });\n},{\"19\":19,\"38\":38}],121:[function(_dereq_,module,exports){\n// 20.1.2.6 Number.MAX_SAFE_INTEGER\n var $def = _dereq_(19);\n\n $def($def.S, 'Number', {MAX_SAFE_INTEGER: 0x1fffffffffffff});\n},{\"19\":19}],122:[function(_dereq_,module,exports){\n// 20.1.2.10 Number.MIN_SAFE_INTEGER\n var $def = _dereq_(19);\n\n $def($def.S, 'Number', {MIN_SAFE_INTEGER: -0x1fffffffffffff});\n},{\"19\":19}],123:[function(_dereq_,module,exports){\n// 20.1.2.12 Number.parseFloat(string)\n var $def = _dereq_(19);\n\n $def($def.S, 'Number', {parseFloat: parseFloat});\n},{\"19\":19}],124:[function(_dereq_,module,exports){\n// 20.1.2.13 Number.parseInt(string, radix)\n var $def = _dereq_(19);\n\n $def($def.S, 'Number', {parseInt: parseInt});\n},{\"19\":19}],125:[function(_dereq_,module,exports){\n// 19.1.3.1 Object.assign(target, source)\n var $def = _dereq_(19);\n\n $def($def.S + $def.F, 'Object', {assign: _dereq_(55)});\n},{\"19\":19,\"55\":55}],126:[function(_dereq_,module,exports){\n// 19.1.2.5 Object.freeze(O)\n var isObject = _dereq_(39);\n\n _dereq_(56)('freeze', function($freeze){\n return function freeze(it){\n return $freeze && isObject(it) ? $freeze(it) : it;\n };\n });\n},{\"39\":39,\"56\":56}],127:[function(_dereq_,module,exports){\n// 19.1.2.6 Object.getOwnPropertyDescriptor(O, P)\n var toIObject = _dereq_(79);\n\n _dereq_(56)('getOwnPropertyDescriptor', function($getOwnPropertyDescriptor){\n return function getOwnPropertyDescriptor(it, key){\n return $getOwnPropertyDescriptor(toIObject(it), key);\n };\n });\n},{\"56\":56,\"79\":79}],128:[function(_dereq_,module,exports){\n// 19.1.2.7 Object.getOwnPropertyNames(O)\n _dereq_(56)('getOwnPropertyNames', function(){\n return _dereq_(29).get;\n });\n},{\"29\":29,\"56\":56}],129:[function(_dereq_,module,exports){\n// 19.1.2.9 Object.getPrototypeOf(O)\n var toObject = _dereq_(81);\n\n _dereq_(56)('getPrototypeOf', function($getPrototypeOf){\n return function getPrototypeOf(it){\n return $getPrototypeOf(toObject(it));\n };\n });\n},{\"56\":56,\"81\":81}],130:[function(_dereq_,module,exports){\n// 19.1.2.11 Object.isExtensible(O)\n var isObject = _dereq_(39);\n\n _dereq_(56)('isExtensible', function($isExtensible){\n return function isExtensible(it){\n return isObject(it) ? $isExtensible ? $isExtensible(it) : true : false;\n };\n });\n},{\"39\":39,\"56\":56}],131:[function(_dereq_,module,exports){\n// 19.1.2.12 Object.isFrozen(O)\n var isObject = _dereq_(39);\n\n _dereq_(56)('isFrozen', function($isFrozen){\n return function isFrozen(it){\n return isObject(it) ? $isFrozen ? $isFrozen(it) : false : true;\n };\n });\n},{\"39\":39,\"56\":56}],132:[function(_dereq_,module,exports){\n// 19.1.2.13 Object.isSealed(O)\n var isObject = _dereq_(39);\n\n _dereq_(56)('isSealed', function($isSealed){\n return function isSealed(it){\n return isObject(it) ? $isSealed ? $isSealed(it) : false : true;\n };\n });\n},{\"39\":39,\"56\":56}],133:[function(_dereq_,module,exports){\n// 19.1.3.10 Object.is(value1, value2)\n var $def = _dereq_(19);\n $def($def.S, 'Object', {is: _dereq_(64)});\n},{\"19\":19,\"64\":64}],134:[function(_dereq_,module,exports){\n// 19.1.2.14 Object.keys(O)\n var toObject = _dereq_(81);\n\n _dereq_(56)('keys', function($keys){\n return function keys(it){\n return $keys(toObject(it));\n };\n });\n},{\"56\":56,\"81\":81}],135:[function(_dereq_,module,exports){\n// 19.1.2.15 Object.preventExtensions(O)\n var isObject = _dereq_(39);\n\n _dereq_(56)('preventExtensions', function($preventExtensions){\n return function preventExtensions(it){\n return $preventExtensions && isObject(it) ? $preventExtensions(it) : it;\n };\n });\n},{\"39\":39,\"56\":56}],136:[function(_dereq_,module,exports){\n// 19.1.2.17 Object.seal(O)\n var isObject = _dereq_(39);\n\n _dereq_(56)('seal', function($seal){\n return function seal(it){\n return $seal && isObject(it) ? $seal(it) : it;\n };\n });\n},{\"39\":39,\"56\":56}],137:[function(_dereq_,module,exports){\n// 19.1.3.19 Object.setPrototypeOf(O, proto)\n var $def = _dereq_(19);\n $def($def.S, 'Object', {setPrototypeOf: _dereq_(65).set});\n},{\"19\":19,\"65\":65}],138:[function(_dereq_,module,exports){\n 'use strict';\n// 19.1.3.6 Object.prototype.toString()\n var classof = _dereq_(11)\n , test = {};\n test[_dereq_(84)('toStringTag')] = 'z';\n if(test + '' != '[object z]'){\n _dereq_(62)(Object.prototype, 'toString', function toString(){\n return '[object ' + classof(this) + ']';\n }, true);\n }\n},{\"11\":11,\"62\":62,\"84\":84}],139:[function(_dereq_,module,exports){\n 'use strict';\n var $ = _dereq_(47)\n , LIBRARY = _dereq_(49)\n , global = _dereq_(30)\n , ctx = _dereq_(18)\n , classof = _dereq_(11)\n , $def = _dereq_(19)\n , isObject = _dereq_(39)\n , anObject = _dereq_(5)\n , aFunction = _dereq_(3)\n , strictNew = _dereq_(70)\n , forOf = _dereq_(28)\n , setProto = _dereq_(65).set\n , same = _dereq_(64)\n , SPECIES = _dereq_(84)('species')\n , speciesConstructor = _dereq_(69)\n , RECORD = _dereq_(83)('record')\n , asap = _dereq_(53)\n , PROMISE = 'Promise'\n , process = global.process\n , isNode = classof(process) == 'process'\n , P = global[PROMISE]\n , Wrapper;\n\n var testResolve = function(sub){\n var test = new P(function(){});\n if(sub)test.constructor = Object;\n return P.resolve(test) === test;\n };\n\n var useNative = function(){\n var works = false;\n function P2(x){\n var self = new P(x);\n setProto(self, P2.prototype);\n return self;\n }\n try {\n works = P && P.resolve && testResolve();\n setProto(P2, P);\n P2.prototype = $.create(P.prototype, {constructor: {value: P2}});\n // actual Firefox has broken subclass support, test that\n if(!(P2.resolve(5).then(function(){}) instanceof P2)){\n works = false;\n }\n // actual V8 bug, https://code.google.com/p/v8/issues/detail?id=4162\n if(works && _dereq_(21)){\n var thenableThenGotten = false;\n P.resolve($.setDesc({}, 'then', {\n get: function(){ thenableThenGotten = true; }\n }));\n works = thenableThenGotten;\n }\n } catch(e){ works = false; }\n return works;\n }();\n\n// helpers\n var isPromise = function(it){\n return isObject(it) && (useNative ? classof(it) == 'Promise' : RECORD in it);\n };\n var sameConstructor = function(a, b){\n // library wrapper special case\n if(LIBRARY && a === P && b === Wrapper)return true;\n return same(a, b);\n };\n var getConstructor = function(C){\n var S = anObject(C)[SPECIES];\n return S != undefined ? S : C;\n };\n var isThenable = function(it){\n var then;\n return isObject(it) && typeof (then = it.then) == 'function' ? then : false;\n };\n var notify = function(record, isReject){\n if(record.n)return;\n record.n = true;\n var chain = record.c;\n asap(function(){\n var value = record.v\n , ok = record.s == 1\n , i = 0;\n var run = function(react){\n var cb = ok ? react.ok : react.fail\n , ret, then;\n try {\n if(cb){\n if(!ok)record.h = true;\n ret = cb === true ? value : cb(value);\n if(ret === react.P){\n react.rej(TypeError('Promise-chain cycle'));\n } else if(then = isThenable(ret)){\n then.call(ret, react.res, react.rej);\n } else react.res(ret);\n } else react.rej(value);\n } catch(err){\n react.rej(err);\n }\n };\n while(chain.length > i)run(chain[i++]); // variable length - can't use forEach\n chain.length = 0;\n record.n = false;\n if(isReject)setTimeout(function(){\n var promise = record.p\n , handler, console;\n if(isUnhandled(promise)){\n if(isNode){\n process.emit('unhandledRejection', value, promise);\n } else if(handler = global.onunhandledrejection){\n handler({promise: promise, reason: value});\n } else if((console = global.console) && console.error){\n console.error('Unhandled promise rejection', value);\n }\n } record.a = undefined;\n }, 1);\n });\n };\n var isUnhandled = function(promise){\n var record = promise[RECORD]\n , chain = record.a || record.c\n , i = 0\n , react;\n if(record.h)return false;\n while(chain.length > i){\n react = chain[i++];\n if(react.fail || !isUnhandled(react.P))return false;\n } return true;\n };\n var $reject = function(value){\n var record = this;\n if(record.d)return;\n record.d = true;\n record = record.r || record; // unwrap\n record.v = value;\n record.s = 2;\n record.a = record.c.slice();\n notify(record, true);\n };\n var $resolve = function(value){\n var record = this\n , then;\n if(record.d)return;\n record.d = true;\n record = record.r || record; // unwrap\n try {\n if(then = isThenable(value)){\n asap(function(){\n var wrapper = {r: record, d: false}; // wrap\n try {\n then.call(value, ctx($resolve, wrapper, 1), ctx($reject, wrapper, 1));\n } catch(e){\n $reject.call(wrapper, e);\n }\n });\n } else {\n record.v = value;\n record.s = 1;\n notify(record, false);\n }\n } catch(e){\n $reject.call({r: record, d: false}, e); // wrap\n }\n };\n\n// constructor polyfill\n if(!useNative){\n // 25.4.3.1 Promise(executor)\n P = function Promise(executor){\n aFunction(executor);\n var record = {\n p: strictNew(this, P, PROMISE), // <- promise\n c: [], // <- awaiting reactions\n a: undefined, // <- checked in isUnhandled reactions\n s: 0, // <- state\n d: false, // <- done\n v: undefined, // <- value\n h: false, // <- handled rejection\n n: false // <- notify\n };\n this[RECORD] = record;\n try {\n executor(ctx($resolve, record, 1), ctx($reject, record, 1));\n } catch(err){\n $reject.call(record, err);\n }\n };\n _dereq_(54)(P.prototype, {\n // 25.4.5.3 Promise.prototype.then(onFulfilled, onRejected)\n then: function then(onFulfilled, onRejected){\n var react = {\n ok: typeof onFulfilled == 'function' ? onFulfilled : true,\n fail: typeof onRejected == 'function' ? onRejected : false\n };\n var promise = react.P = new (speciesConstructor(this, P))(function(res, rej){\n react.res = res;\n react.rej = rej;\n });\n aFunction(react.res);\n aFunction(react.rej);\n var record = this[RECORD];\n record.c.push(react);\n if(record.a)record.a.push(react);\n if(record.s)notify(record, false);\n return promise;\n },\n // 25.4.5.1 Promise.prototype.catch(onRejected)\n 'catch': function(onRejected){\n return this.then(undefined, onRejected);\n }\n });\n }\n\n// export\n $def($def.G + $def.W + $def.F * !useNative, {Promise: P});\n _dereq_(67)(P, PROMISE);\n _dereq_(66)(PROMISE);\n Wrapper = _dereq_(17)[PROMISE];\n\n// statics\n $def($def.S + $def.F * !useNative, PROMISE, {\n // 25.4.4.5 Promise.reject(r)\n reject: function reject(r){\n return new this(function(res, rej){ rej(r); });\n }\n });\n $def($def.S + $def.F * (!useNative || testResolve(true)), PROMISE, {\n // 25.4.4.6 Promise.resolve(x)\n resolve: function resolve(x){\n return isPromise(x) && sameConstructor(x.constructor, this)\n ? x : new this(function(res){ res(x); });\n }\n });\n $def($def.S + $def.F * !(useNative && _dereq_(44)(function(iter){\n P.all(iter)['catch'](function(){});\n })), PROMISE, {\n // 25.4.4.1 Promise.all(iterable)\n all: function all(iterable){\n var C = getConstructor(this)\n , values = [];\n return new C(function(res, rej){\n forOf(iterable, false, values.push, values);\n var remaining = values.length\n , results = Array(remaining);\n if(remaining)$.each.call(values, function(promise, index){\n C.resolve(promise).then(function(value){\n results[index] = value;\n --remaining || res(results);\n }, rej);\n });\n else res(results);\n });\n },\n // 25.4.4.4 Promise.race(iterable)\n race: function race(iterable){\n var C = getConstructor(this);\n return new C(function(res, rej){\n forOf(iterable, false, function(promise){\n C.resolve(promise).then(res, rej);\n });\n });\n }\n });\n},{\"11\":11,\"17\":17,\"18\":18,\"19\":19,\"21\":21,\"28\":28,\"3\":3,\"30\":30,\"39\":39,\"44\":44,\"47\":47,\"49\":49,\"5\":5,\"53\":53,\"54\":54,\"64\":64,\"65\":65,\"66\":66,\"67\":67,\"69\":69,\"70\":70,\"83\":83,\"84\":84}],140:[function(_dereq_,module,exports){\n// 26.1.1 Reflect.apply(target, thisArgument, argumentsList)\n var $def = _dereq_(19)\n , _apply = Function.apply;\n\n $def($def.S, 'Reflect', {\n apply: function apply(target, thisArgument, argumentsList){\n return _apply.call(target, thisArgument, argumentsList);\n }\n });\n},{\"19\":19}],141:[function(_dereq_,module,exports){\n// 26.1.2 Reflect.construct(target, argumentsList [, newTarget])\n var $ = _dereq_(47)\n , $def = _dereq_(19)\n , aFunction = _dereq_(3)\n , anObject = _dereq_(5)\n , isObject = _dereq_(39)\n , bind = Function.bind || _dereq_(17).Function.prototype.bind;\n\n// MS Edge supports only 2 arguments\n// FF Nightly sets third argument as `new.target`, but does not create `this` from it\n $def($def.S + $def.F * _dereq_(25)(function(){\n function F(){}\n return !(Reflect.construct(function(){}, [], F) instanceof F);\n }), 'Reflect', {\n construct: function construct(Target, args /*, newTarget*/){\n aFunction(Target);\n var newTarget = arguments.length < 3 ? Target : aFunction(arguments[2]);\n if(Target == newTarget){\n // w/o altered newTarget, optimization for 0-4 arguments\n if(args != undefined)switch(anObject(args).length){\n case 0: return new Target;\n case 1: return new Target(args[0]);\n case 2: return new Target(args[0], args[1]);\n case 3: return new Target(args[0], args[1], args[2]);\n case 4: return new Target(args[0], args[1], args[2], args[3]);\n }\n // w/o altered newTarget, lot of arguments case\n var $args = [null];\n $args.push.apply($args, args);\n return new (bind.apply(Target, $args));\n }\n // with altered newTarget, not support built-in constructors\n var proto = newTarget.prototype\n , instance = $.create(isObject(proto) ? proto : Object.prototype)\n , result = Function.apply.call(Target, instance, args);\n return isObject(result) ? result : instance;\n }\n });\n},{\"17\":17,\"19\":19,\"25\":25,\"3\":3,\"39\":39,\"47\":47,\"5\":5}],142:[function(_dereq_,module,exports){\n// 26.1.3 Reflect.defineProperty(target, propertyKey, attributes)\n var $ = _dereq_(47)\n , $def = _dereq_(19)\n , anObject = _dereq_(5);\n\n// MS Edge has broken Reflect.defineProperty - throwing instead of returning false\n $def($def.S + $def.F * _dereq_(25)(function(){\n Reflect.defineProperty($.setDesc({}, 1, {value: 1}), 1, {value: 2});\n }), 'Reflect', {\n defineProperty: function defineProperty(target, propertyKey, attributes){\n anObject(target);\n try {\n $.setDesc(target, propertyKey, attributes);\n return true;\n } catch(e){\n return false;\n }\n }\n });\n},{\"19\":19,\"25\":25,\"47\":47,\"5\":5}],143:[function(_dereq_,module,exports){\n// 26.1.4 Reflect.deleteProperty(target, propertyKey)\n var $def = _dereq_(19)\n , getDesc = _dereq_(47).getDesc\n , anObject = _dereq_(5);\n\n $def($def.S, 'Reflect', {\n deleteProperty: function deleteProperty(target, propertyKey){\n var desc = getDesc(anObject(target), propertyKey);\n return desc && !desc.configurable ? false : delete target[propertyKey];\n }\n });\n},{\"19\":19,\"47\":47,\"5\":5}],144:[function(_dereq_,module,exports){\n 'use strict';\n// 26.1.5 Reflect.enumerate(target)\n var $def = _dereq_(19)\n , anObject = _dereq_(5);\n var Enumerate = function(iterated){\n this._t = anObject(iterated); // target\n this._i = 0; // next index\n var keys = this._k = [] // keys\n , key;\n for(key in iterated)keys.push(key);\n };\n _dereq_(42)(Enumerate, 'Object', function(){\n var that = this\n , keys = that._k\n , key;\n do {\n if(that._i >= keys.length)return {value: undefined, done: true};\n } while(!((key = keys[that._i++]) in that._t));\n return {value: key, done: false};\n });\n\n $def($def.S, 'Reflect', {\n enumerate: function enumerate(target){\n return new Enumerate(target);\n }\n });\n},{\"19\":19,\"42\":42,\"5\":5}],145:[function(_dereq_,module,exports){\n// 26.1.7 Reflect.getOwnPropertyDescriptor(target, propertyKey)\n var $ = _dereq_(47)\n , $def = _dereq_(19)\n , anObject = _dereq_(5);\n\n $def($def.S, 'Reflect', {\n getOwnPropertyDescriptor: function getOwnPropertyDescriptor(target, propertyKey){\n return $.getDesc(anObject(target), propertyKey);\n }\n });\n},{\"19\":19,\"47\":47,\"5\":5}],146:[function(_dereq_,module,exports){\n// 26.1.8 Reflect.getPrototypeOf(target)\n var $def = _dereq_(19)\n , getProto = _dereq_(47).getProto\n , anObject = _dereq_(5);\n\n $def($def.S, 'Reflect', {\n getPrototypeOf: function getPrototypeOf(target){\n return getProto(anObject(target));\n }\n });\n},{\"19\":19,\"47\":47,\"5\":5}],147:[function(_dereq_,module,exports){\n// 26.1.6 Reflect.get(target, propertyKey [, receiver])\n var $ = _dereq_(47)\n , has = _dereq_(31)\n , $def = _dereq_(19)\n , isObject = _dereq_(39)\n , anObject = _dereq_(5);\n\n function get(target, propertyKey/*, receiver*/){\n var receiver = arguments.length < 3 ? target : arguments[2]\n , desc, proto;\n if(anObject(target) === receiver)return target[propertyKey];\n if(desc = $.getDesc(target, propertyKey))return has(desc, 'value')\n ? desc.value\n : desc.get !== undefined\n ? desc.get.call(receiver)\n : undefined;\n if(isObject(proto = $.getProto(target)))return get(proto, propertyKey, receiver);\n }\n\n $def($def.S, 'Reflect', {get: get});\n},{\"19\":19,\"31\":31,\"39\":39,\"47\":47,\"5\":5}],148:[function(_dereq_,module,exports){\n// 26.1.9 Reflect.has(target, propertyKey)\n var $def = _dereq_(19);\n\n $def($def.S, 'Reflect', {\n has: function has(target, propertyKey){\n return propertyKey in target;\n }\n });\n},{\"19\":19}],149:[function(_dereq_,module,exports){\n// 26.1.10 Reflect.isExtensible(target)\n var $def = _dereq_(19)\n , anObject = _dereq_(5)\n , $isExtensible = Object.isExtensible;\n\n $def($def.S, 'Reflect', {\n isExtensible: function isExtensible(target){\n anObject(target);\n return $isExtensible ? $isExtensible(target) : true;\n }\n });\n},{\"19\":19,\"5\":5}],150:[function(_dereq_,module,exports){\n// 26.1.11 Reflect.ownKeys(target)\n var $def = _dereq_(19);\n\n $def($def.S, 'Reflect', {ownKeys: _dereq_(58)});\n},{\"19\":19,\"58\":58}],151:[function(_dereq_,module,exports){\n// 26.1.12 Reflect.preventExtensions(target)\n var $def = _dereq_(19)\n , anObject = _dereq_(5)\n , $preventExtensions = Object.preventExtensions;\n\n $def($def.S, 'Reflect', {\n preventExtensions: function preventExtensions(target){\n anObject(target);\n try {\n if($preventExtensions)$preventExtensions(target);\n return true;\n } catch(e){\n return false;\n }\n }\n });\n},{\"19\":19,\"5\":5}],152:[function(_dereq_,module,exports){\n// 26.1.14 Reflect.setPrototypeOf(target, proto)\n var $def = _dereq_(19)\n , setProto = _dereq_(65);\n\n if(setProto)$def($def.S, 'Reflect', {\n setPrototypeOf: function setPrototypeOf(target, proto){\n setProto.check(target, proto);\n try {\n setProto.set(target, proto);\n return true;\n } catch(e){\n return false;\n }\n }\n });\n},{\"19\":19,\"65\":65}],153:[function(_dereq_,module,exports){\n// 26.1.13 Reflect.set(target, propertyKey, V [, receiver])\n var $ = _dereq_(47)\n , has = _dereq_(31)\n , $def = _dereq_(19)\n , createDesc = _dereq_(61)\n , anObject = _dereq_(5)\n , isObject = _dereq_(39);\n\n function set(target, propertyKey, V/*, receiver*/){\n var receiver = arguments.length < 4 ? target : arguments[3]\n , ownDesc = $.getDesc(anObject(target), propertyKey)\n , existingDescriptor, proto;\n if(!ownDesc){\n if(isObject(proto = $.getProto(target))){\n return set(proto, propertyKey, V, receiver);\n }\n ownDesc = createDesc(0);\n }\n if(has(ownDesc, 'value')){\n if(ownDesc.writable === false || !isObject(receiver))return false;\n existingDescriptor = $.getDesc(receiver, propertyKey) || createDesc(0);\n existingDescriptor.value = V;\n $.setDesc(receiver, propertyKey, existingDescriptor);\n return true;\n }\n return ownDesc.set === undefined ? false : (ownDesc.set.call(receiver, V), true);\n }\n\n $def($def.S, 'Reflect', {set: set});\n},{\"19\":19,\"31\":31,\"39\":39,\"47\":47,\"5\":5,\"61\":61}],154:[function(_dereq_,module,exports){\n var $ = _dereq_(47)\n , global = _dereq_(30)\n , isRegExp = _dereq_(40)\n , $flags = _dereq_(27)\n , $RegExp = global.RegExp\n , Base = $RegExp\n , proto = $RegExp.prototype\n , re1 = /a/g\n , re2 = /a/g\n // \"new\" creates a new object, old webkit buggy here\n , CORRECT_NEW = new $RegExp(re1) !== re1;\n\n if(_dereq_(21) && (!CORRECT_NEW || _dereq_(25)(function(){\n re2[_dereq_(84)('match')] = false;\n // RegExp constructor can alter flags and IsRegExp works correct with @@match\n return $RegExp(re1) != re1 || $RegExp(re2) == re2 || $RegExp(re1, 'i') != '/a/i';\n }))){\n $RegExp = function RegExp(p, f){\n var piRE = isRegExp(p)\n , fiU = f === undefined;\n return !(this instanceof $RegExp) && piRE && p.constructor === $RegExp && fiU ? p\n : CORRECT_NEW\n ? new Base(piRE && !fiU ? p.source : p, f)\n : Base((piRE = p instanceof $RegExp) ? p.source : p, piRE && fiU ? $flags.call(p) : f);\n };\n $.each.call($.getNames(Base), function(key){\n key in $RegExp || $.setDesc($RegExp, key, {\n configurable: true,\n get: function(){ return Base[key]; },\n set: function(it){ Base[key] = it; }\n });\n });\n proto.constructor = $RegExp;\n $RegExp.prototype = proto;\n _dereq_(62)(global, 'RegExp', $RegExp);\n }\n\n _dereq_(66)('RegExp');\n},{\"21\":21,\"25\":25,\"27\":27,\"30\":30,\"40\":40,\"47\":47,\"62\":62,\"66\":66,\"84\":84}],155:[function(_dereq_,module,exports){\n// 21.2.5.3 get RegExp.prototype.flags()\n var $ = _dereq_(47);\n if(_dereq_(21) && /./g.flags != 'g')$.setDesc(RegExp.prototype, 'flags', {\n configurable: true,\n get: _dereq_(27)\n });\n},{\"21\":21,\"27\":27,\"47\":47}],156:[function(_dereq_,module,exports){\n// @@match logic\n _dereq_(26)('match', 1, function(defined, MATCH){\n // 21.1.3.11 String.prototype.match(regexp)\n return function match(regexp){\n 'use strict';\n var O = defined(this)\n , fn = regexp == undefined ? undefined : regexp[MATCH];\n return fn !== undefined ? fn.call(regexp, O) : new RegExp(regexp)[MATCH](String(O));\n };\n });\n},{\"26\":26}],157:[function(_dereq_,module,exports){\n// @@replace logic\n _dereq_(26)('replace', 2, function(defined, REPLACE, $replace){\n // 21.1.3.14 String.prototype.replace(searchValue, replaceValue)\n return function replace(searchValue, replaceValue){\n 'use strict';\n var O = defined(this)\n , fn = searchValue == undefined ? undefined : searchValue[REPLACE];\n return fn !== undefined\n ? fn.call(searchValue, O, replaceValue)\n : $replace.call(String(O), searchValue, replaceValue);\n };\n });\n},{\"26\":26}],158:[function(_dereq_,module,exports){\n// @@search logic\n _dereq_(26)('search', 1, function(defined, SEARCH){\n // 21.1.3.15 String.prototype.search(regexp)\n return function search(regexp){\n 'use strict';\n var O = defined(this)\n , fn = regexp == undefined ? undefined : regexp[SEARCH];\n return fn !== undefined ? fn.call(regexp, O) : new RegExp(regexp)[SEARCH](String(O));\n };\n });\n},{\"26\":26}],159:[function(_dereq_,module,exports){\n// @@split logic\n _dereq_(26)('split', 2, function(defined, SPLIT, $split){\n // 21.1.3.17 String.prototype.split(separator, limit)\n return function split(separator, limit){\n 'use strict';\n var O = defined(this)\n , fn = separator == undefined ? undefined : separator[SPLIT];\n return fn !== undefined\n ? fn.call(separator, O, limit)\n : $split.call(String(O), separator, limit);\n };\n });\n},{\"26\":26}],160:[function(_dereq_,module,exports){\n 'use strict';\n var strong = _dereq_(13);\n\n// 23.2 Set Objects\n _dereq_(16)('Set', function(get){\n return function Set(){ return get(this, arguments.length > 0 ? arguments[0] : undefined); };\n }, {\n // 23.2.3.1 Set.prototype.add(value)\n add: function add(value){\n return strong.def(this, value = value === 0 ? 0 : value, value);\n }\n }, strong);\n},{\"13\":13,\"16\":16}],161:[function(_dereq_,module,exports){\n 'use strict';\n var $def = _dereq_(19)\n , $at = _dereq_(71)(false);\n $def($def.P, 'String', {\n // 21.1.3.3 String.prototype.codePointAt(pos)\n codePointAt: function codePointAt(pos){\n return $at(this, pos);\n }\n });\n},{\"19\":19,\"71\":71}],162:[function(_dereq_,module,exports){\n// 21.1.3.6 String.prototype.endsWith(searchString [, endPosition])\n 'use strict';\n var $def = _dereq_(19)\n , toLength = _dereq_(80)\n , context = _dereq_(72)\n , ENDS_WITH = 'endsWith'\n , $endsWith = ''[ENDS_WITH];\n\n $def($def.P + $def.F * _dereq_(24)(ENDS_WITH), 'String', {\n endsWith: function endsWith(searchString /*, endPosition = @length */){\n var that = context(this, searchString, ENDS_WITH)\n , $$ = arguments\n , endPosition = $$.length > 1 ? $$[1] : undefined\n , len = toLength(that.length)\n , end = endPosition === undefined ? len : Math.min(toLength(endPosition), len)\n , search = String(searchString);\n return $endsWith\n ? $endsWith.call(that, search, end)\n : that.slice(end - search.length, end) === search;\n }\n });\n},{\"19\":19,\"24\":24,\"72\":72,\"80\":80}],163:[function(_dereq_,module,exports){\n var $def = _dereq_(19)\n , toIndex = _dereq_(77)\n , fromCharCode = String.fromCharCode\n , $fromCodePoint = String.fromCodePoint;\n\n// length should be 1, old FF problem\n $def($def.S + $def.F * (!!$fromCodePoint && $fromCodePoint.length != 1), 'String', {\n // 21.1.2.2 String.fromCodePoint(...codePoints)\n fromCodePoint: function fromCodePoint(x){ // eslint-disable-line no-unused-vars\n var res = []\n , $$ = arguments\n , $$len = $$.length\n , i = 0\n , code;\n while($$len > i){\n code = +$$[i++];\n if(toIndex(code, 0x10ffff) !== code)throw RangeError(code + ' is not a valid code point');\n res.push(code < 0x10000\n ? fromCharCode(code)\n : fromCharCode(((code -= 0x10000) >> 10) + 0xd800, code % 0x400 + 0xdc00)\n );\n } return res.join('');\n }\n });\n},{\"19\":19,\"77\":77}],164:[function(_dereq_,module,exports){\n// 21.1.3.7 String.prototype.includes(searchString, position = 0)\n 'use strict';\n var $def = _dereq_(19)\n , context = _dereq_(72)\n , INCLUDES = 'includes';\n\n $def($def.P + $def.F * _dereq_(24)(INCLUDES), 'String', {\n includes: function includes(searchString /*, position = 0 */){\n return !!~context(this, searchString, INCLUDES).indexOf(searchString, arguments.length > 1 ? arguments[1] : undefined);\n }\n });\n},{\"19\":19,\"24\":24,\"72\":72}],165:[function(_dereq_,module,exports){\n 'use strict';\n var $at = _dereq_(71)(true);\n\n// 21.1.3.27 String.prototype[@@iterator]()\n _dereq_(43)(String, 'String', function(iterated){\n this._t = String(iterated); // target\n this._i = 0; // next index\n// 21.1.5.2.1 %StringIteratorPrototype%.next()\n }, function(){\n var O = this._t\n , index = this._i\n , point;\n if(index >= O.length)return {value: undefined, done: true};\n point = $at(O, index);\n this._i += point.length;\n return {value: point, done: false};\n });\n},{\"43\":43,\"71\":71}],166:[function(_dereq_,module,exports){\n var $def = _dereq_(19)\n , toIObject = _dereq_(79)\n , toLength = _dereq_(80);\n\n $def($def.S, 'String', {\n // 21.1.2.4 String.raw(callSite, ...substitutions)\n raw: function raw(callSite){\n var tpl = toIObject(callSite.raw)\n , len = toLength(tpl.length)\n , $$ = arguments\n , $$len = $$.length\n , res = []\n , i = 0;\n while(len > i){\n res.push(String(tpl[i++]));\n if(i < $$len)res.push(String($$[i]));\n } return res.join('');\n }\n });\n},{\"19\":19,\"79\":79,\"80\":80}],167:[function(_dereq_,module,exports){\n var $def = _dereq_(19);\n\n $def($def.P, 'String', {\n // 21.1.3.13 String.prototype.repeat(count)\n repeat: _dereq_(74)\n });\n},{\"19\":19,\"74\":74}],168:[function(_dereq_,module,exports){\n// 21.1.3.18 String.prototype.startsWith(searchString [, position ])\n 'use strict';\n var $def = _dereq_(19)\n , toLength = _dereq_(80)\n , context = _dereq_(72)\n , STARTS_WITH = 'startsWith'\n , $startsWith = ''[STARTS_WITH];\n\n $def($def.P + $def.F * _dereq_(24)(STARTS_WITH), 'String', {\n startsWith: function startsWith(searchString /*, position = 0 */){\n var that = context(this, searchString, STARTS_WITH)\n , $$ = arguments\n , index = toLength(Math.min($$.length > 1 ? $$[1] : undefined, that.length))\n , search = String(searchString);\n return $startsWith\n ? $startsWith.call(that, search, index)\n : that.slice(index, index + search.length) === search;\n }\n });\n},{\"19\":19,\"24\":24,\"72\":72,\"80\":80}],169:[function(_dereq_,module,exports){\n 'use strict';\n// 21.1.3.25 String.prototype.trim()\n _dereq_(75)('trim', function($trim){\n return function trim(){\n return $trim(this, 3);\n };\n });\n},{\"75\":75}],170:[function(_dereq_,module,exports){\n 'use strict';\n// ECMAScript 6 symbols shim\n var $ = _dereq_(47)\n , global = _dereq_(30)\n , has = _dereq_(31)\n , DESCRIPTORS = _dereq_(21)\n , $def = _dereq_(19)\n , $redef = _dereq_(62)\n , $fails = _dereq_(25)\n , shared = _dereq_(68)\n , setToStringTag = _dereq_(67)\n , uid = _dereq_(83)\n , wks = _dereq_(84)\n , keyOf = _dereq_(48)\n , $names = _dereq_(29)\n , enumKeys = _dereq_(23)\n , isArray = _dereq_(37)\n , anObject = _dereq_(5)\n , toIObject = _dereq_(79)\n , createDesc = _dereq_(61)\n , getDesc = $.getDesc\n , setDesc = $.setDesc\n , _create = $.create\n , getNames = $names.get\n , $Symbol = global.Symbol\n , $JSON = global.JSON\n , _stringify = $JSON && $JSON.stringify\n , setter = false\n , HIDDEN = wks('_hidden')\n , isEnum = $.isEnum\n , SymbolRegistry = shared('symbol-registry')\n , AllSymbols = shared('symbols')\n , useNative = typeof $Symbol == 'function'\n , ObjectProto = Object.prototype;\n\n// fallback for old Android, https://code.google.com/p/v8/issues/detail?id=687\n var setSymbolDesc = DESCRIPTORS && $fails(function(){\n return _create(setDesc({}, 'a', {\n get: function(){ return setDesc(this, 'a', {value: 7}).a; }\n })).a != 7;\n }) ? function(it, key, D){\n var protoDesc = getDesc(ObjectProto, key);\n if(protoDesc)delete ObjectProto[key];\n setDesc(it, key, D);\n if(protoDesc && it !== ObjectProto)setDesc(ObjectProto, key, protoDesc);\n } : setDesc;\n\n var wrap = function(tag){\n var sym = AllSymbols[tag] = _create($Symbol.prototype);\n sym._k = tag;\n DESCRIPTORS && setter && setSymbolDesc(ObjectProto, tag, {\n configurable: true,\n set: function(value){\n if(has(this, HIDDEN) && has(this[HIDDEN], tag))this[HIDDEN][tag] = false;\n setSymbolDesc(this, tag, createDesc(1, value));\n }\n });\n return sym;\n };\n\n var isSymbol = function(it){\n return typeof it == 'symbol';\n };\n\n var $defineProperty = function defineProperty(it, key, D){\n if(D && has(AllSymbols, key)){\n if(!D.enumerable){\n if(!has(it, HIDDEN))setDesc(it, HIDDEN, createDesc(1, {}));\n it[HIDDEN][key] = true;\n } else {\n if(has(it, HIDDEN) && it[HIDDEN][key])it[HIDDEN][key] = false;\n D = _create(D, {enumerable: createDesc(0, false)});\n } return setSymbolDesc(it, key, D);\n } return setDesc(it, key, D);\n };\n var $defineProperties = function defineProperties(it, P){\n anObject(it);\n var keys = enumKeys(P = toIObject(P))\n , i = 0\n , l = keys.length\n , key;\n while(l > i)$defineProperty(it, key = keys[i++], P[key]);\n return it;\n };\n var $create = function create(it, P){\n return P === undefined ? _create(it) : $defineProperties(_create(it), P);\n };\n var $propertyIsEnumerable = function propertyIsEnumerable(key){\n var E = isEnum.call(this, key);\n return E || !has(this, key) || !has(AllSymbols, key) || has(this, HIDDEN) && this[HIDDEN][key]\n ? E : true;\n };\n var $getOwnPropertyDescriptor = function getOwnPropertyDescriptor(it, key){\n var D = getDesc(it = toIObject(it), key);\n if(D && has(AllSymbols, key) && !(has(it, HIDDEN) && it[HIDDEN][key]))D.enumerable = true;\n return D;\n };\n var $getOwnPropertyNames = function getOwnPropertyNames(it){\n var names = getNames(toIObject(it))\n , result = []\n , i = 0\n , key;\n while(names.length > i)if(!has(AllSymbols, key = names[i++]) && key != HIDDEN)result.push(key);\n return result;\n };\n var $getOwnPropertySymbols = function getOwnPropertySymbols(it){\n var names = getNames(toIObject(it))\n , result = []\n , i = 0\n , key;\n while(names.length > i)if(has(AllSymbols, key = names[i++]))result.push(AllSymbols[key]);\n return result;\n };\n var $stringify = function stringify(it){\n if(it === undefined || isSymbol(it))return; // IE8 returns string on undefined\n var args = [it]\n , i = 1\n , $$ = arguments\n , replacer, $replacer;\n while($$.length > i)args.push($$[i++]);\n replacer = args[1];\n if(typeof replacer == 'function')$replacer = replacer;\n if($replacer || !isArray(replacer))replacer = function(key, value){\n if($replacer)value = $replacer.call(this, key, value);\n if(!isSymbol(value))return value;\n };\n args[1] = replacer;\n return _stringify.apply($JSON, args);\n };\n var buggyJSON = $fails(function(){\n var S = $Symbol();\n // MS Edge converts symbol values to JSON as {}\n // WebKit converts symbol values to JSON as null\n // V8 throws on boxed symbols\n return _stringify([S]) != '[null]' || _stringify({a: S}) != '{}' || _stringify(Object(S)) != '{}';\n });\n\n// 19.4.1.1 Symbol([description])\n if(!useNative){\n $Symbol = function Symbol(){\n if(isSymbol(this))throw TypeError('Symbol is not a constructor');\n return wrap(uid(arguments.length > 0 ? arguments[0] : undefined));\n };\n $redef($Symbol.prototype, 'toString', function toString(){\n return this._k;\n });\n\n isSymbol = function(it){\n return it instanceof $Symbol;\n };\n\n $.create = $create;\n $.isEnum = $propertyIsEnumerable;\n $.getDesc = $getOwnPropertyDescriptor;\n $.setDesc = $defineProperty;\n $.setDescs = $defineProperties;\n $.getNames = $names.get = $getOwnPropertyNames;\n $.getSymbols = $getOwnPropertySymbols;\n\n if(DESCRIPTORS && !_dereq_(49)){\n $redef(ObjectProto, 'propertyIsEnumerable', $propertyIsEnumerable, true);\n }\n }\n\n var symbolStatics = {\n // 19.4.2.1 Symbol.for(key)\n 'for': function(key){\n return has(SymbolRegistry, key += '')\n ? SymbolRegistry[key]\n : SymbolRegistry[key] = $Symbol(key);\n },\n // 19.4.2.5 Symbol.keyFor(sym)\n keyFor: function keyFor(key){\n return keyOf(SymbolRegistry, key);\n },\n useSetter: function(){ setter = true; },\n useSimple: function(){ setter = false; }\n };\n// 19.4.2.2 Symbol.hasInstance\n// 19.4.2.3 Symbol.isConcatSpreadable\n// 19.4.2.4 Symbol.iterator\n// 19.4.2.6 Symbol.match\n// 19.4.2.8 Symbol.replace\n// 19.4.2.9 Symbol.search\n// 19.4.2.10 Symbol.species\n// 19.4.2.11 Symbol.split\n// 19.4.2.12 Symbol.toPrimitive\n// 19.4.2.13 Symbol.toStringTag\n// 19.4.2.14 Symbol.unscopables\n $.each.call((\n 'hasInstance,isConcatSpreadable,iterator,match,replace,search,' +\n 'species,split,toPrimitive,toStringTag,unscopables'\n ).split(','), function(it){\n var sym = wks(it);\n symbolStatics[it] = useNative ? sym : wrap(sym);\n });\n\n setter = true;\n\n $def($def.G + $def.W, {Symbol: $Symbol});\n\n $def($def.S, 'Symbol', symbolStatics);\n\n $def($def.S + $def.F * !useNative, 'Object', {\n // 19.1.2.2 Object.create(O [, Properties])\n create: $create,\n // 19.1.2.4 Object.defineProperty(O, P, Attributes)\n defineProperty: $defineProperty,\n // 19.1.2.3 Object.defineProperties(O, Properties)\n defineProperties: $defineProperties,\n // 19.1.2.6 Object.getOwnPropertyDescriptor(O, P)\n getOwnPropertyDescriptor: $getOwnPropertyDescriptor,\n // 19.1.2.7 Object.getOwnPropertyNames(O)\n getOwnPropertyNames: $getOwnPropertyNames,\n // 19.1.2.8 Object.getOwnPropertySymbols(O)\n getOwnPropertySymbols: $getOwnPropertySymbols\n });\n\n// 24.3.2 JSON.stringify(value [, replacer [, space]])\n $JSON && $def($def.S + $def.F * (!useNative || buggyJSON), 'JSON', {stringify: $stringify});\n\n// 19.4.3.5 Symbol.prototype[@@toStringTag]\n setToStringTag($Symbol, 'Symbol');\n// 20.2.1.9 Math[@@toStringTag]\n setToStringTag(Math, 'Math', true);\n// 24.3.3 JSON[@@toStringTag]\n setToStringTag(global.JSON, 'JSON', true);\n},{\"19\":19,\"21\":21,\"23\":23,\"25\":25,\"29\":29,\"30\":30,\"31\":31,\"37\":37,\"47\":47,\"48\":48,\"49\":49,\"5\":5,\"61\":61,\"62\":62,\"67\":67,\"68\":68,\"79\":79,\"83\":83,\"84\":84}],171:[function(_dereq_,module,exports){\n 'use strict';\n var $ = _dereq_(47)\n , redef = _dereq_(62)\n , weak = _dereq_(15)\n , isObject = _dereq_(39)\n , has = _dereq_(31)\n , frozenStore = weak.frozenStore\n , WEAK = weak.WEAK\n , isExtensible = Object.isExtensible || isObject\n , tmp = {};\n\n// 23.3 WeakMap Objects\n var $WeakMap = _dereq_(16)('WeakMap', function(get){\n return function WeakMap(){ return get(this, arguments.length > 0 ? arguments[0] : undefined); };\n }, {\n // 23.3.3.3 WeakMap.prototype.get(key)\n get: function get(key){\n if(isObject(key)){\n if(!isExtensible(key))return frozenStore(this).get(key);\n if(has(key, WEAK))return key[WEAK][this._i];\n }\n },\n // 23.3.3.5 WeakMap.prototype.set(key, value)\n set: function set(key, value){\n return weak.def(this, key, value);\n }\n }, weak, true, true);\n\n// IE11 WeakMap frozen keys fix\n if(new $WeakMap().set((Object.freeze || Object)(tmp), 7).get(tmp) != 7){\n $.each.call(['delete', 'has', 'get', 'set'], function(key){\n var proto = $WeakMap.prototype\n , method = proto[key];\n redef(proto, key, function(a, b){\n // store frozen objects on leaky map\n if(isObject(a) && !isExtensible(a)){\n var result = frozenStore(this)[key](a, b);\n return key == 'set' ? this : result;\n // store all the rest on native weakmap\n } return method.call(this, a, b);\n });\n });\n }\n},{\"15\":15,\"16\":16,\"31\":31,\"39\":39,\"47\":47,\"62\":62}],172:[function(_dereq_,module,exports){\n 'use strict';\n var weak = _dereq_(15);\n\n// 23.4 WeakSet Objects\n _dereq_(16)('WeakSet', function(get){\n return function WeakSet(){ return get(this, arguments.length > 0 ? arguments[0] : undefined); };\n }, {\n // 23.4.3.1 WeakSet.prototype.add(value)\n add: function add(value){\n return weak.def(this, value, true);\n }\n }, weak, false, true);\n},{\"15\":15,\"16\":16}],173:[function(_dereq_,module,exports){\n 'use strict';\n var $def = _dereq_(19)\n , $includes = _dereq_(8)(true);\n $def($def.P, 'Array', {\n // https://github.com/domenic/Array.prototype.includes\n includes: function includes(el /*, fromIndex = 0 */){\n return $includes(this, el, arguments.length > 1 ? arguments[1] : undefined);\n }\n });\n _dereq_(4)('includes');\n},{\"19\":19,\"4\":4,\"8\":8}],174:[function(_dereq_,module,exports){\n// https://github.com/DavidBruant/Map-Set.prototype.toJSON\n var $def = _dereq_(19);\n\n $def($def.P, 'Map', {toJSON: _dereq_(14)('Map')});\n},{\"14\":14,\"19\":19}],175:[function(_dereq_,module,exports){\n// http://goo.gl/XkBrjD\n var $def = _dereq_(19)\n , $entries = _dereq_(57)(true);\n\n $def($def.S, 'Object', {\n entries: function entries(it){\n return $entries(it);\n }\n });\n},{\"19\":19,\"57\":57}],176:[function(_dereq_,module,exports){\n// https://gist.github.com/WebReflection/9353781\n var $ = _dereq_(47)\n , $def = _dereq_(19)\n , ownKeys = _dereq_(58)\n , toIObject = _dereq_(79)\n , createDesc = _dereq_(61);\n\n $def($def.S, 'Object', {\n getOwnPropertyDescriptors: function getOwnPropertyDescriptors(object){\n var O = toIObject(object)\n , setDesc = $.setDesc\n , getDesc = $.getDesc\n , keys = ownKeys(O)\n , result = {}\n , i = 0\n , key, D;\n while(keys.length > i){\n D = getDesc(O, key = keys[i++]);\n if(key in result)setDesc(result, key, createDesc(0, D));\n else result[key] = D;\n } return result;\n }\n });\n},{\"19\":19,\"47\":47,\"58\":58,\"61\":61,\"79\":79}],177:[function(_dereq_,module,exports){\n// http://goo.gl/XkBrjD\n var $def = _dereq_(19)\n , $values = _dereq_(57)(false);\n\n $def($def.S, 'Object', {\n values: function values(it){\n return $values(it);\n }\n });\n},{\"19\":19,\"57\":57}],178:[function(_dereq_,module,exports){\n// https://github.com/benjamingr/RexExp.escape\n var $def = _dereq_(19)\n , $re = _dereq_(63)(/[\\\\^$*+?.()|[\\]{}]/g, '\\\\$&');\n $def($def.S, 'RegExp', {escape: function escape(it){ return $re(it); }});\n\n},{\"19\":19,\"63\":63}],179:[function(_dereq_,module,exports){\n// https://github.com/DavidBruant/Map-Set.prototype.toJSON\n var $def = _dereq_(19);\n\n $def($def.P, 'Set', {toJSON: _dereq_(14)('Set')});\n},{\"14\":14,\"19\":19}],180:[function(_dereq_,module,exports){\n// https://github.com/mathiasbynens/String.prototype.at\n 'use strict';\n var $def = _dereq_(19)\n , $at = _dereq_(71)(true);\n $def($def.P, 'String', {\n at: function at(pos){\n return $at(this, pos);\n }\n });\n},{\"19\":19,\"71\":71}],181:[function(_dereq_,module,exports){\n 'use strict';\n var $def = _dereq_(19)\n , $pad = _dereq_(73);\n $def($def.P, 'String', {\n padLeft: function padLeft(maxLength /*, fillString = ' ' */){\n return $pad(this, maxLength, arguments.length > 1 ? arguments[1] : undefined, true);\n }\n });\n},{\"19\":19,\"73\":73}],182:[function(_dereq_,module,exports){\n 'use strict';\n var $def = _dereq_(19)\n , $pad = _dereq_(73);\n $def($def.P, 'String', {\n padRight: function padRight(maxLength /*, fillString = ' ' */){\n return $pad(this, maxLength, arguments.length > 1 ? arguments[1] : undefined, false);\n }\n });\n},{\"19\":19,\"73\":73}],183:[function(_dereq_,module,exports){\n 'use strict';\n// https://github.com/sebmarkbage/ecmascript-string-left-right-trim\n _dereq_(75)('trimLeft', function($trim){\n return function trimLeft(){\n return $trim(this, 1);\n };\n });\n},{\"75\":75}],184:[function(_dereq_,module,exports){\n 'use strict';\n// https://github.com/sebmarkbage/ecmascript-string-left-right-trim\n _dereq_(75)('trimRight', function($trim){\n return function trimRight(){\n return $trim(this, 2);\n };\n });\n},{\"75\":75}],185:[function(_dereq_,module,exports){\n// JavaScript 1.6 / Strawman array statics shim\n var $ = _dereq_(47)\n , $def = _dereq_(19)\n , $ctx = _dereq_(18)\n , $Array = _dereq_(17).Array || Array\n , statics = {};\n var setStatics = function(keys, length){\n $.each.call(keys.split(','), function(key){\n if(length == undefined && key in $Array)statics[key] = $Array[key];\n else if(key in [])statics[key] = $ctx(Function.call, [][key], length);\n });\n };\n setStatics('pop,reverse,shift,keys,values,entries', 1);\n setStatics('indexOf,every,some,forEach,map,filter,find,findIndex,includes', 3);\n setStatics('join,slice,concat,push,splice,unshift,sort,lastIndexOf,' +\n 'reduce,reduceRight,copyWithin,fill');\n $def($def.S, 'Array', statics);\n},{\"17\":17,\"18\":18,\"19\":19,\"47\":47}],186:[function(_dereq_,module,exports){\n _dereq_(92);\n var global = _dereq_(30)\n , hide = _dereq_(32)\n , Iterators = _dereq_(46)\n , ITERATOR = _dereq_(84)('iterator')\n , NL = global.NodeList\n , HTC = global.HTMLCollection\n , NLProto = NL && NL.prototype\n , HTCProto = HTC && HTC.prototype\n , ArrayValues = Iterators.NodeList = Iterators.HTMLCollection = Iterators.Array;\n if(NL && !(ITERATOR in NLProto))hide(NLProto, ITERATOR, ArrayValues);\n if(HTC && !(ITERATOR in HTCProto))hide(HTCProto, ITERATOR, ArrayValues);\n},{\"30\":30,\"32\":32,\"46\":46,\"84\":84,\"92\":92}],187:[function(_dereq_,module,exports){\n var $def = _dereq_(19)\n , $task = _dereq_(76);\n $def($def.G + $def.B, {\n setImmediate: $task.set,\n clearImmediate: $task.clear\n });\n},{\"19\":19,\"76\":76}],188:[function(_dereq_,module,exports){\n// ie9- setTimeout & setInterval additional parameters fix\n var global = _dereq_(30)\n , $def = _dereq_(19)\n , invoke = _dereq_(34)\n , partial = _dereq_(59)\n , navigator = global.navigator\n , MSIE = !!navigator && /MSIE .\\./.test(navigator.userAgent); // <- dirty ie9- check\n var wrap = function(set){\n return MSIE ? function(fn, time /*, ...args */){\n return set(invoke(\n partial,\n [].slice.call(arguments, 2),\n typeof fn == 'function' ? fn : Function(fn)\n ), time);\n } : set;\n };\n $def($def.G + $def.B + $def.F * MSIE, {\n setTimeout: wrap(global.setTimeout),\n setInterval: wrap(global.setInterval)\n });\n},{\"19\":19,\"30\":30,\"34\":34,\"59\":59}],189:[function(_dereq_,module,exports){\n _dereq_(86);\n _dereq_(170);\n _dereq_(125);\n _dereq_(133);\n _dereq_(137);\n _dereq_(138);\n _dereq_(126);\n _dereq_(136);\n _dereq_(135);\n _dereq_(131);\n _dereq_(132);\n _dereq_(130);\n _dereq_(127);\n _dereq_(129);\n _dereq_(134);\n _dereq_(128);\n _dereq_(96);\n _dereq_(95);\n _dereq_(115);\n _dereq_(116);\n _dereq_(117);\n _dereq_(118);\n _dereq_(119);\n _dereq_(120);\n _dereq_(121);\n _dereq_(122);\n _dereq_(123);\n _dereq_(124);\n _dereq_(98);\n _dereq_(99);\n _dereq_(100);\n _dereq_(101);\n _dereq_(102);\n _dereq_(103);\n _dereq_(104);\n _dereq_(105);\n _dereq_(106);\n _dereq_(107);\n _dereq_(108);\n _dereq_(109);\n _dereq_(110);\n _dereq_(111);\n _dereq_(112);\n _dereq_(113);\n _dereq_(114);\n _dereq_(163);\n _dereq_(166);\n _dereq_(169);\n _dereq_(165);\n _dereq_(161);\n _dereq_(162);\n _dereq_(164);\n _dereq_(167);\n _dereq_(168);\n _dereq_(91);\n _dereq_(93);\n _dereq_(92);\n _dereq_(94);\n _dereq_(87);\n _dereq_(88);\n _dereq_(90);\n _dereq_(89);\n _dereq_(154);\n _dereq_(155);\n _dereq_(156);\n _dereq_(157);\n _dereq_(158);\n _dereq_(159);\n _dereq_(139);\n _dereq_(97);\n _dereq_(160);\n _dereq_(171);\n _dereq_(172);\n _dereq_(140);\n _dereq_(141);\n _dereq_(142);\n _dereq_(143);\n _dereq_(144);\n _dereq_(147);\n _dereq_(145);\n _dereq_(146);\n _dereq_(148);\n _dereq_(149);\n _dereq_(150);\n _dereq_(151);\n _dereq_(153);\n _dereq_(152);\n _dereq_(173);\n _dereq_(180);\n _dereq_(181);\n _dereq_(182);\n _dereq_(183);\n _dereq_(184);\n _dereq_(178);\n _dereq_(176);\n _dereq_(177);\n _dereq_(175);\n _dereq_(174);\n _dereq_(179);\n _dereq_(185);\n _dereq_(188);\n _dereq_(187);\n _dereq_(186);\n module.exports = _dereq_(17);\n},{\"100\":100,\"101\":101,\"102\":102,\"103\":103,\"104\":104,\"105\":105,\"106\":106,\"107\":107,\"108\":108,\"109\":109,\"110\":110,\"111\":111,\"112\":112,\"113\":113,\"114\":114,\"115\":115,\"116\":116,\"117\":117,\"118\":118,\"119\":119,\"120\":120,\"121\":121,\"122\":122,\"123\":123,\"124\":124,\"125\":125,\"126\":126,\"127\":127,\"128\":128,\"129\":129,\"130\":130,\"131\":131,\"132\":132,\"133\":133,\"134\":134,\"135\":135,\"136\":136,\"137\":137,\"138\":138,\"139\":139,\"140\":140,\"141\":141,\"142\":142,\"143\":143,\"144\":144,\"145\":145,\"146\":146,\"147\":147,\"148\":148,\"149\":149,\"150\":150,\"151\":151,\"152\":152,\"153\":153,\"154\":154,\"155\":155,\"156\":156,\"157\":157,\"158\":158,\"159\":159,\"160\":160,\"161\":161,\"162\":162,\"163\":163,\"164\":164,\"165\":165,\"166\":166,\"167\":167,\"168\":168,\"169\":169,\"17\":17,\"170\":170,\"171\":171,\"172\":172,\"173\":173,\"174\":174,\"175\":175,\"176\":176,\"177\":177,\"178\":178,\"179\":179,\"180\":180,\"181\":181,\"182\":182,\"183\":183,\"184\":184,\"185\":185,\"186\":186,\"187\":187,\"188\":188,\"86\":86,\"87\":87,\"88\":88,\"89\":89,\"90\":90,\"91\":91,\"92\":92,\"93\":93,\"94\":94,\"95\":95,\"96\":96,\"97\":97,\"98\":98,\"99\":99}],190:[function(_dereq_,module,exports){\n (function (global){\n /**\n * Copyright (c) 2014, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * https://raw.github.com/facebook/regenerator/master/LICENSE file. An\n * additional grant of patent rights can be found in the PATENTS file in\n * the same directory.\n */\n\n !(function(global) {\n \"use strict\";\n\n var hasOwn = Object.prototype.hasOwnProperty;\n var undefined; // More compressible than void 0.\n var iteratorSymbol =\n typeof Symbol === \"function\" && Symbol.iterator || \"@@iterator\";\n\n var inModule = typeof module === \"object\";\n var runtime = global.regeneratorRuntime;\n if (runtime) {\n if (inModule) {\n // If regeneratorRuntime is defined globally and we're in a module,\n // make the exports object identical to regeneratorRuntime.\n module.exports = runtime;\n }\n // Don't bother evaluating the rest of this file if the runtime was\n // already defined globally.\n return;\n }\n\n // Define the runtime globally (as expected by generated code) as either\n // module.exports (if we're in a module) or a new, empty object.\n runtime = global.regeneratorRuntime = inModule ? module.exports : {};\n\n function wrap(innerFn, outerFn, self, tryLocsList) {\n // If outerFn provided, then outerFn.prototype instanceof Generator.\n var generator = Object.create((outerFn || Generator).prototype);\n var context = new Context(tryLocsList || []);\n\n // The ._invoke method unifies the implementations of the .next,\n // .throw, and .return methods.\n generator._invoke = makeInvokeMethod(innerFn, self, context);\n\n return generator;\n }\n runtime.wrap = wrap;\n\n // Try/catch helper to minimize deoptimizations. Returns a completion\n // record like context.tryEntries[i].completion. This interface could\n // have been (and was previously) designed to take a closure to be\n // invoked without arguments, but in all the cases we care about we\n // already have an existing method we want to call, so there's no need\n // to create a new function object. We can even get away with assuming\n // the method takes exactly one argument, since that happens to be true\n // in every case, so we don't have to touch the arguments object. The\n // only additional allocation required is the completion record, which\n // has a stable shape and so hopefully should be cheap to allocate.\n function tryCatch(fn, obj, arg) {\n try {\n return { type: \"normal\", arg: fn.call(obj, arg) };\n } catch (err) {\n return { type: \"throw\", arg: err };\n }\n }\n\n var GenStateSuspendedStart = \"suspendedStart\";\n var GenStateSuspendedYield = \"suspendedYield\";\n var GenStateExecuting = \"executing\";\n var GenStateCompleted = \"completed\";\n\n // Returning this object from the innerFn has the same effect as\n // breaking out of the dispatch switch statement.\n var ContinueSentinel = {};\n\n // Dummy constructor functions that we use as the .constructor and\n // .constructor.prototype properties for functions that return Generator\n // objects. For full spec compliance, you may wish to configure your\n // minifier not to mangle the names of these two functions.\n function Generator() {}\n function GeneratorFunction() {}\n function GeneratorFunctionPrototype() {}\n\n var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype;\n GeneratorFunction.prototype = Gp.constructor = GeneratorFunctionPrototype;\n GeneratorFunctionPrototype.constructor = GeneratorFunction;\n GeneratorFunction.displayName = \"GeneratorFunction\";\n\n // Helper for defining the .next, .throw, and .return methods of the\n // Iterator interface in terms of a single ._invoke method.\n function defineIteratorMethods(prototype) {\n [\"next\", \"throw\", \"return\"].forEach(function(method) {\n prototype[method] = function(arg) {\n return this._invoke(method, arg);\n };\n });\n }\n\n runtime.isGeneratorFunction = function(genFun) {\n var ctor = typeof genFun === \"function\" && genFun.constructor;\n return ctor\n ? ctor === GeneratorFunction ||\n // For the native GeneratorFunction constructor, the best we can\n // do is to check its .name property.\n (ctor.displayName || ctor.name) === \"GeneratorFunction\"\n : false;\n };\n\n runtime.mark = function(genFun) {\n if (Object.setPrototypeOf) {\n Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);\n } else {\n genFun.__proto__ = GeneratorFunctionPrototype;\n }\n genFun.prototype = Object.create(Gp);\n return genFun;\n };\n\n // Within the body of any async function, `await x` is transformed to\n // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test\n // `value instanceof AwaitArgument` to determine if the yielded value is\n // meant to be awaited. Some may consider the name of this method too\n // cutesy, but they are curmudgeons.\n runtime.awrap = function(arg) {\n return new AwaitArgument(arg);\n };\n\n function AwaitArgument(arg) {\n this.arg = arg;\n }\n\n function AsyncIterator(generator) {\n // This invoke function is written in a style that assumes some\n // calling function (or Promise) will handle exceptions.\n function invoke(method, arg) {\n var result = generator[method](arg);\n var value = result.value;\n return value instanceof AwaitArgument\n ? Promise.resolve(value.arg).then(invokeNext, invokeThrow)\n : Promise.resolve(value).then(function(unwrapped) {\n // When a yielded Promise is resolved, its final value becomes\n // the .value of the Promise<{value,done}> result for the\n // current iteration. If the Promise is rejected, however, the\n // result for this iteration will be rejected with the same\n // reason. Note that rejections of yielded Promises are not\n // thrown back into the generator function, as is the case\n // when an awaited Promise is rejected. This difference in\n // behavior between yield and await is important, because it\n // allows the consumer to decide what to do with the yielded\n // rejection (swallow it and continue, manually .throw it back\n // into the generator, abandon iteration, whatever). With\n // await, by contrast, there is no opportunity to examine the\n // rejection reason outside the generator function, so the\n // only option is to throw it from the await expression, and\n // let the generator function handle the exception.\n result.value = unwrapped;\n return result;\n });\n }\n\n if (typeof process === \"object\" && process.domain) {\n invoke = process.domain.bind(invoke);\n }\n\n var invokeNext = invoke.bind(generator, \"next\");\n var invokeThrow = invoke.bind(generator, \"throw\");\n var invokeReturn = invoke.bind(generator, \"return\");\n var previousPromise;\n\n function enqueue(method, arg) {\n function callInvokeWithMethodAndArg() {\n return invoke(method, arg);\n }\n\n return previousPromise =\n // If enqueue has been called before, then we want to wait until\n // all previous Promises have been resolved before calling invoke,\n // so that results are always delivered in the correct order. If\n // enqueue has not been called before, then it is important to\n // call invoke immediately, without waiting on a callback to fire,\n // so that the async generator function has the opportunity to do\n // any necessary setup in a predictable way. This predictability\n // is why the Promise constructor synchronously invokes its\n // executor callback, and why async functions synchronously\n // execute code before the first await. Since we implement simple\n // async functions in terms of async generators, it is especially\n // important to get this right, even though it requires care.\n previousPromise ? previousPromise.then(\n callInvokeWithMethodAndArg,\n // Avoid propagating failures to Promises returned by later\n // invocations of the iterator.\n callInvokeWithMethodAndArg\n ) : new Promise(function (resolve) {\n resolve(callInvokeWithMethodAndArg());\n });\n }\n\n // Define the unified helper method that is used to implement .next,\n // .throw, and .return (see defineIteratorMethods).\n this._invoke = enqueue;\n }\n\n defineIteratorMethods(AsyncIterator.prototype);\n\n // Note that simple async functions are implemented on top of\n // AsyncIterator objects; they just return a Promise for the value of\n // the final result produced by the iterator.\n runtime.async = function(innerFn, outerFn, self, tryLocsList) {\n var iter = new AsyncIterator(\n wrap(innerFn, outerFn, self, tryLocsList)\n );\n\n return runtime.isGeneratorFunction(outerFn)\n ? iter // If outerFn is a generator, return the full iterator.\n : iter.next().then(function(result) {\n return result.done ? result.value : iter.next();\n });\n };\n\n function makeInvokeMethod(innerFn, self, context) {\n var state = GenStateSuspendedStart;\n\n return function invoke(method, arg) {\n if (state === GenStateExecuting) {\n throw new Error(\"Generator is already running\");\n }\n\n if (state === GenStateCompleted) {\n if (method === \"throw\") {\n throw arg;\n }\n\n // Be forgiving, per 25.3.3.3.3 of the spec:\n // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume\n return doneResult();\n }\n\n while (true) {\n var delegate = context.delegate;\n if (delegate) {\n if (method === \"return\" ||\n (method === \"throw\" && delegate.iterator[method] === undefined)) {\n // A return or throw (when the delegate iterator has no throw\n // method) always terminates the yield* loop.\n context.delegate = null;\n\n // If the delegate iterator has a return method, give it a\n // chance to clean up.\n var returnMethod = delegate.iterator[\"return\"];\n if (returnMethod) {\n var record = tryCatch(returnMethod, delegate.iterator, arg);\n if (record.type === \"throw\") {\n // If the return method threw an exception, let that\n // exception prevail over the original return or throw.\n method = \"throw\";\n arg = record.arg;\n continue;\n }\n }\n\n if (method === \"return\") {\n // Continue with the outer return, now that the delegate\n // iterator has been terminated.\n continue;\n }\n }\n\n var record = tryCatch(\n delegate.iterator[method],\n delegate.iterator,\n arg\n );\n\n if (record.type === \"throw\") {\n context.delegate = null;\n\n // Like returning generator.throw(uncaught), but without the\n // overhead of an extra function call.\n method = \"throw\";\n arg = record.arg;\n continue;\n }\n\n // Delegate generator ran and handled its own exceptions so\n // regardless of what the method was, we continue as if it is\n // \"next\" with an undefined arg.\n method = \"next\";\n arg = undefined;\n\n var info = record.arg;\n if (info.done) {\n context[delegate.resultName] = info.value;\n context.next = delegate.nextLoc;\n } else {\n state = GenStateSuspendedYield;\n return info;\n }\n\n context.delegate = null;\n }\n\n if (method === \"next\") {\n context._sent = arg;\n\n if (state === GenStateSuspendedYield) {\n context.sent = arg;\n } else {\n context.sent = undefined;\n }\n } else if (method === \"throw\") {\n if (state === GenStateSuspendedStart) {\n state = GenStateCompleted;\n throw arg;\n }\n\n if (context.dispatchException(arg)) {\n // If the dispatched exception was caught by a catch block,\n // then let that catch block handle the exception normally.\n method = \"next\";\n arg = undefined;\n }\n\n } else if (method === \"return\") {\n context.abrupt(\"return\", arg);\n }\n\n state = GenStateExecuting;\n\n var record = tryCatch(innerFn, self, context);\n if (record.type === \"normal\") {\n // If an exception is thrown from innerFn, we leave state ===\n // GenStateExecuting and loop back for another invocation.\n state = context.done\n ? GenStateCompleted\n : GenStateSuspendedYield;\n\n var info = {\n value: record.arg,\n done: context.done\n };\n\n if (record.arg === ContinueSentinel) {\n if (context.delegate && method === \"next\") {\n // Deliberately forget the last sent value so that we don't\n // accidentally pass it on to the delegate.\n arg = undefined;\n }\n } else {\n return info;\n }\n\n } else if (record.type === \"throw\") {\n state = GenStateCompleted;\n // Dispatch the exception by looping back around to the\n // context.dispatchException(arg) call above.\n method = \"throw\";\n arg = record.arg;\n }\n }\n };\n }\n\n // Define Generator.prototype.{next,throw,return} in terms of the\n // unified ._invoke helper method.\n defineIteratorMethods(Gp);\n\n Gp[iteratorSymbol] = function() {\n return this;\n };\n\n Gp.toString = function() {\n return \"[object Generator]\";\n };\n\n function pushTryEntry(locs) {\n var entry = { tryLoc: locs[0] };\n\n if (1 in locs) {\n entry.catchLoc = locs[1];\n }\n\n if (2 in locs) {\n entry.finallyLoc = locs[2];\n entry.afterLoc = locs[3];\n }\n\n this.tryEntries.push(entry);\n }\n\n function resetTryEntry(entry) {\n var record = entry.completion || {};\n record.type = \"normal\";\n delete record.arg;\n entry.completion = record;\n }\n\n function Context(tryLocsList) {\n // The root entry object (effectively a try statement without a catch\n // or a finally block) gives us a place to store values thrown from\n // locations where there is no enclosing try statement.\n this.tryEntries = [{ tryLoc: \"root\" }];\n tryLocsList.forEach(pushTryEntry, this);\n this.reset(true);\n }\n\n runtime.keys = function(object) {\n var keys = [];\n for (var key in object) {\n keys.push(key);\n }\n keys.reverse();\n\n // Rather than returning an object with a next method, we keep\n // things simple and return the next function itself.\n return function next() {\n while (keys.length) {\n var key = keys.pop();\n if (key in object) {\n next.value = key;\n next.done = false;\n return next;\n }\n }\n\n // To avoid creating an additional object, we just hang the .value\n // and .done properties off the next function object itself. This\n // also ensures that the minifier will not anonymize the function.\n next.done = true;\n return next;\n };\n };\n\n function values(iterable) {\n if (iterable) {\n var iteratorMethod = iterable[iteratorSymbol];\n if (iteratorMethod) {\n return iteratorMethod.call(iterable);\n }\n\n if (typeof iterable.next === \"function\") {\n return iterable;\n }\n\n if (!isNaN(iterable.length)) {\n var i = -1, next = function next() {\n while (++i < iterable.length) {\n if (hasOwn.call(iterable, i)) {\n next.value = iterable[i];\n next.done = false;\n return next;\n }\n }\n\n next.value = undefined;\n next.done = true;\n\n return next;\n };\n\n return next.next = next;\n }\n }\n\n // Return an iterator with no values.\n return { next: doneResult };\n }\n runtime.values = values;\n\n function doneResult() {\n return { value: undefined, done: true };\n }\n\n Context.prototype = {\n constructor: Context,\n\n reset: function(skipTempReset) {\n this.prev = 0;\n this.next = 0;\n this.sent = undefined;\n this.done = false;\n this.delegate = null;\n\n this.tryEntries.forEach(resetTryEntry);\n\n if (!skipTempReset) {\n for (var name in this) {\n // Not sure about the optimal order of these conditions:\n if (name.charAt(0) === \"t\" &&\n hasOwn.call(this, name) &&\n !isNaN(+name.slice(1))) {\n this[name] = undefined;\n }\n }\n }\n },\n\n stop: function() {\n this.done = true;\n\n var rootEntry = this.tryEntries[0];\n var rootRecord = rootEntry.completion;\n if (rootRecord.type === \"throw\") {\n throw rootRecord.arg;\n }\n\n return this.rval;\n },\n\n dispatchException: function(exception) {\n if (this.done) {\n throw exception;\n }\n\n var context = this;\n function handle(loc, caught) {\n record.type = \"throw\";\n record.arg = exception;\n context.next = loc;\n return !!caught;\n }\n\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n var record = entry.completion;\n\n if (entry.tryLoc === \"root\") {\n // Exception thrown outside of any try block that could handle\n // it, so set the completion value of the entire function to\n // throw the exception.\n return handle(\"end\");\n }\n\n if (entry.tryLoc <= this.prev) {\n var hasCatch = hasOwn.call(entry, \"catchLoc\");\n var hasFinally = hasOwn.call(entry, \"finallyLoc\");\n\n if (hasCatch && hasFinally) {\n if (this.prev < entry.catchLoc) {\n return handle(entry.catchLoc, true);\n } else if (this.prev < entry.finallyLoc) {\n return handle(entry.finallyLoc);\n }\n\n } else if (hasCatch) {\n if (this.prev < entry.catchLoc) {\n return handle(entry.catchLoc, true);\n }\n\n } else if (hasFinally) {\n if (this.prev < entry.finallyLoc) {\n return handle(entry.finallyLoc);\n }\n\n } else {\n throw new Error(\"try statement without catch or finally\");\n }\n }\n }\n },\n\n abrupt: function(type, arg) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.tryLoc <= this.prev &&\n hasOwn.call(entry, \"finallyLoc\") &&\n this.prev < entry.finallyLoc) {\n var finallyEntry = entry;\n break;\n }\n }\n\n if (finallyEntry &&\n (type === \"break\" ||\n type === \"continue\") &&\n finallyEntry.tryLoc <= arg &&\n arg <= finallyEntry.finallyLoc) {\n // Ignore the finally entry if control is not jumping to a\n // location outside the try/catch block.\n finallyEntry = null;\n }\n\n var record = finallyEntry ? finallyEntry.completion : {};\n record.type = type;\n record.arg = arg;\n\n if (finallyEntry) {\n this.next = finallyEntry.finallyLoc;\n } else {\n this.complete(record);\n }\n\n return ContinueSentinel;\n },\n\n complete: function(record, afterLoc) {\n if (record.type === \"throw\") {\n throw record.arg;\n }\n\n if (record.type === \"break\" ||\n record.type === \"continue\") {\n this.next = record.arg;\n } else if (record.type === \"return\") {\n this.rval = record.arg;\n this.next = \"end\";\n } else if (record.type === \"normal\" && afterLoc) {\n this.next = afterLoc;\n }\n },\n\n finish: function(finallyLoc) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.finallyLoc === finallyLoc) {\n this.complete(entry.completion, entry.afterLoc);\n resetTryEntry(entry);\n return ContinueSentinel;\n }\n }\n },\n\n \"catch\": function(tryLoc) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.tryLoc === tryLoc) {\n var record = entry.completion;\n if (record.type === \"throw\") {\n var thrown = record.arg;\n resetTryEntry(entry);\n }\n return thrown;\n }\n }\n\n // The context.catch method must only be called with a location\n // argument that corresponds to a known catch block.\n throw new Error(\"illegal catch attempt\");\n },\n\n delegateYield: function(iterable, resultName, nextLoc) {\n this.delegate = {\n iterator: values(iterable),\n resultName: resultName,\n nextLoc: nextLoc\n };\n\n return ContinueSentinel;\n }\n };\n })(\n // Among the various tricks for obtaining a reference to the global\n // object, this seems to be the most reliable technique that does not\n // use indirect eval (which violates Content Security Policy).\n typeof global === \"object\" ? global :\n typeof window === \"object\" ? window :\n typeof self === \"object\" ? self : this\n );\n\n }).call(this,typeof global !== \"undefined\" ? global : typeof self !== \"undefined\" ? self : typeof window !== \"undefined\" ? window : {})\n},{}]},{},[1]);\n","// ==ClosureCompiler==\n// @compilation_level SIMPLE_OPTIMIZATIONS\n\n/**\n * @license Highcharts JS v4.0.4 (2014-09-02)\n *\n * (c) 2009-2014 Torstein Honsi\n *\n * License: www.highcharts.com/license\n */\n\n// JSLint options:\n/*global Highcharts, HighchartsAdapter, document, window, navigator, setInterval, clearInterval, clearTimeout, setTimeout, location, jQuery, $, console, each, grep */\n/*jslint ass: true, sloppy: true, forin: true, plusplus: true, nomen: true, vars: true, regexp: true, newcap: true, browser: true, continue: true, white: true */\n(function () {\n// encapsulated variables\n var UNDEFINED,\n doc = document,\n win = window,\n math = Math,\n mathRound = math.round,\n mathFloor = math.floor,\n mathCeil = math.ceil,\n mathMax = math.max,\n mathMin = math.min,\n mathAbs = math.abs,\n mathCos = math.cos,\n mathSin = math.sin,\n mathPI = math.PI,\n deg2rad = mathPI * 2 / 360,\n\n\n // some variables\n userAgent = navigator.userAgent,\n isOpera = win.opera,\n isIE = /msie/i.test(userAgent) && !isOpera,\n docMode8 = doc.documentMode === 8,\n isWebKit = /AppleWebKit/.test(userAgent),\n isFirefox = /Firefox/.test(userAgent),\n isTouchDevice = /(Mobile|Android|Windows Phone)/.test(userAgent),\n SVG_NS = 'http://www.w3.org/2000/svg',\n hasSVG = !!doc.createElementNS && !!doc.createElementNS(SVG_NS, 'svg').createSVGRect,\n hasBidiBug = isFirefox && parseInt(userAgent.split('Firefox/')[1], 10) < 4, // issue #38\n useCanVG = !hasSVG && !isIE && !!doc.createElement('canvas').getContext,\n Renderer,\n hasTouch,\n symbolSizes = {},\n idCounter = 0,\n garbageBin,\n defaultOptions,\n dateFormat, // function\n globalAnimation,\n pathAnim,\n timeUnits,\n error,\n noop = function () { return UNDEFINED; },\n charts = [],\n chartCount = 0,\n PRODUCT = 'Highcharts',\n VERSION = '4.0.4',\n\n // some constants for frequently used strings\n DIV = 'div',\n ABSOLUTE = 'absolute',\n RELATIVE = 'relative',\n HIDDEN = 'hidden',\n PREFIX = 'highcharts-',\n VISIBLE = 'visible',\n PX = 'px',\n NONE = 'none',\n M = 'M',\n L = 'L',\n numRegex = /^[0-9]+$/,\n NORMAL_STATE = '',\n HOVER_STATE = 'hover',\n SELECT_STATE = 'select',\n\n // Object for extending Axis\n AxisPlotLineOrBandExtension,\n\n // constants for attributes\n STROKE_WIDTH = 'stroke-width',\n\n // time methods, changed based on whether or not UTC is used\n Date, // Allow using a different Date class\n makeTime,\n timezoneOffset,\n getMinutes,\n getHours,\n getDay,\n getDate,\n getMonth,\n getFullYear,\n setMinutes,\n setHours,\n setDate,\n setMonth,\n setFullYear,\n\n\n // lookup over the types and the associated classes\n seriesTypes = {},\n Highcharts;\n\n// The Highcharts namespace\n if (win.Highcharts) {\n error(16, true);\n } else {\n Highcharts = win.Highcharts = {};\n }\n /**\n * Extend an object with the members of another\n * @param {Object} a The object to be extended\n * @param {Object} b The object to add to the first one\n */\n function extend(a, b) {\n var n;\n if (!a) {\n a = {};\n }\n for (n in b) {\n a[n] = b[n];\n }\n return a;\n }\n\n /**\n * Deep merge two or more objects and return a third object. If the first argument is\n * true, the contents of the second object is copied into the first object.\n * Previously this function redirected to jQuery.extend(true), but this had two limitations.\n * First, it deep merged arrays, which lead to workarounds in Highcharts. Second,\n * it copied properties from extended prototypes.\n */\n function merge() {\n var i,\n args = arguments,\n len,\n ret = {},\n doCopy = function (copy, original) {\n var value, key;\n\n // An object is replacing a primitive\n if (typeof copy !== 'object') {\n copy = {};\n }\n\n for (key in original) {\n if (original.hasOwnProperty(key)) {\n value = original[key];\n\n // Copy the contents of objects, but not arrays or DOM nodes\n if (value && typeof value === 'object' && Object.prototype.toString.call(value) !== '[object Array]'\n && key !== 'renderTo' && typeof value.nodeType !== 'number') {\n copy[key] = doCopy(copy[key] || {}, value);\n\n // Primitives and arrays are copied over directly\n } else {\n copy[key] = original[key];\n }\n }\n }\n return copy;\n };\n\n // If first argument is true, copy into the existing object. Used in setOptions.\n if (args[0] === true) {\n ret = args[1];\n args = Array.prototype.slice.call(args, 2);\n }\n\n // For each argument, extend the return\n len = args.length;\n for (i = 0; i < len; i++) {\n ret = doCopy(ret, args[i]);\n }\n\n return ret;\n }\n\n /**\n * Shortcut for parseInt\n * @param {Object} s\n * @param {Number} mag Magnitude\n */\n function pInt(s, mag) {\n return parseInt(s, mag || 10);\n }\n\n /**\n * Check for string\n * @param {Object} s\n */\n function isString(s) {\n return typeof s === 'string';\n }\n\n /**\n * Check for object\n * @param {Object} obj\n */\n function isObject(obj) {\n return obj && typeof obj === 'object';\n }\n\n /**\n * Check for array\n * @param {Object} obj\n */\n function isArray(obj) {\n return Object.prototype.toString.call(obj) === '[object Array]';\n }\n\n /**\n * Check for number\n * @param {Object} n\n */\n function isNumber(n) {\n return typeof n === 'number';\n }\n\n function log2lin(num) {\n return math.log(num) / math.LN10;\n }\n function lin2log(num) {\n return math.pow(10, num);\n }\n\n /**\n * Remove last occurence of an item from an array\n * @param {Array} arr\n * @param {Mixed} item\n */\n function erase(arr, item) {\n var i = arr.length;\n while (i--) {\n if (arr[i] === item) {\n arr.splice(i, 1);\n break;\n }\n }\n //return arr;\n }\n\n /**\n * Returns true if the object is not null or undefined. Like MooTools' $.defined.\n * @param {Object} obj\n */\n function defined(obj) {\n return obj !== UNDEFINED && obj !== null;\n }\n\n /**\n * Set or get an attribute or an object of attributes. Can't use jQuery attr because\n * it attempts to set expando properties on the SVG element, which is not allowed.\n *\n * @param {Object} elem The DOM element to receive the attribute(s)\n * @param {String|Object} prop The property or an abject of key-value pairs\n * @param {String} value The value if a single property is set\n */\n function attr(elem, prop, value) {\n var key,\n ret;\n\n // if the prop is a string\n if (isString(prop)) {\n // set the value\n if (defined(value)) {\n elem.setAttribute(prop, value);\n\n // get the value\n } else if (elem && elem.getAttribute) { // elem not defined when printing pie demo...\n ret = elem.getAttribute(prop);\n }\n\n // else if prop is defined, it is a hash of key/value pairs\n } else if (defined(prop) && isObject(prop)) {\n for (key in prop) {\n elem.setAttribute(key, prop[key]);\n }\n }\n return ret;\n }\n /**\n * Check if an element is an array, and if not, make it into an array. Like\n * MooTools' $.splat.\n */\n function splat(obj) {\n return isArray(obj) ? obj : [obj];\n }\n\n\n /**\n * Return the first value that is defined. Like MooTools' $.pick.\n */\n function pick() {\n var args = arguments,\n i,\n arg,\n length = args.length;\n for (i = 0; i < length; i++) {\n arg = args[i];\n if (arg !== UNDEFINED && arg !== null) {\n return arg;\n }\n }\n }\n\n /**\n * Set CSS on a given element\n * @param {Object} el\n * @param {Object} styles Style object with camel case property names\n */\n function css(el, styles) {\n if (isIE && !hasSVG) { // #2686\n if (styles && styles.opacity !== UNDEFINED) {\n styles.filter = 'alpha(opacity=' + (styles.opacity * 100) + ')';\n }\n }\n extend(el.style, styles);\n }\n\n /**\n * Utility function to create element with attributes and styles\n * @param {Object} tag\n * @param {Object} attribs\n * @param {Object} styles\n * @param {Object} parent\n * @param {Object} nopad\n */\n function createElement(tag, attribs, styles, parent, nopad) {\n var el = doc.createElement(tag);\n if (attribs) {\n extend(el, attribs);\n }\n if (nopad) {\n css(el, {padding: 0, border: NONE, margin: 0});\n }\n if (styles) {\n css(el, styles);\n }\n if (parent) {\n parent.appendChild(el);\n }\n return el;\n }\n\n /**\n * Extend a prototyped class by new members\n * @param {Object} parent\n * @param {Object} members\n */\n function extendClass(parent, members) {\n var object = function () { return UNDEFINED; };\n object.prototype = new parent();\n extend(object.prototype, members);\n return object;\n }\n\n /**\n * Format a number and return a string based on input settings\n * @param {Number} number The input number to format\n * @param {Number} decimals The amount of decimals\n * @param {String} decPoint The decimal point, defaults to the one given in the lang options\n * @param {String} thousandsSep The thousands separator, defaults to the one given in the lang options\n */\n function numberFormat(number, decimals, decPoint, thousandsSep) {\n var externalFn = Highcharts.numberFormat,\n lang = defaultOptions.lang,\n // http://kevin.vanzonneveld.net/techblog/article/javascript_equivalent_for_phps_number_format/\n n = +number || 0,\n c = decimals === -1 ?\n (n.toString().split('.')[1] || '').length : // preserve decimals\n (isNaN(decimals = mathAbs(decimals)) ? 2 : decimals),\n d = decPoint === undefined ? lang.decimalPoint : decPoint,\n t = thousandsSep === undefined ? lang.thousandsSep : thousandsSep,\n s = n < 0 ? \"-\" : \"\",\n i = String(pInt(n = mathAbs(n).toFixed(c))),\n j = i.length > 3 ? i.length % 3 : 0;\n\n return externalFn !== numberFormat ?\n externalFn(number, decimals, decPoint, thousandsSep) :\n (s + (j ? i.substr(0, j) + t : \"\") + i.substr(j).replace(/(\\d{3})(?=\\d)/g, \"$1\" + t) +\n (c ? d + mathAbs(n - i).toFixed(c).slice(2) : \"\"));\n }\n\n /**\n * Pad a string to a given length by adding 0 to the beginning\n * @param {Number} number\n * @param {Number} length\n */\n function pad(number, length) {\n // Create an array of the remaining length +1 and join it with 0's\n return new Array((length || 2) + 1 - String(number).length).join(0) + number;\n }\n\n /**\n * Wrap a method with extended functionality, preserving the original function\n * @param {Object} obj The context object that the method belongs to\n * @param {String} method The name of the method to extend\n * @param {Function} func A wrapper function callback. This function is called with the same arguments\n * as the original function, except that the original function is unshifted and passed as the first\n * argument.\n */\n function wrap(obj, method, func) {\n var proceed = obj[method];\n obj[method] = function () {\n var args = Array.prototype.slice.call(arguments);\n args.unshift(proceed);\n return func.apply(this, args);\n };\n }\n\n /**\n * Based on http://www.php.net/manual/en/function.strftime.php\n * @param {String} format\n * @param {Number} timestamp\n * @param {Boolean} capitalize\n */\n dateFormat = function (format, timestamp, capitalize) {\n if (!defined(timestamp) || isNaN(timestamp)) {\n return 'Invalid date';\n }\n format = pick(format, '%Y-%m-%d %H:%M:%S');\n\n var date = new Date(timestamp - timezoneOffset),\n key, // used in for constuct below\n // get the basic time values\n hours = date[getHours](),\n day = date[getDay](),\n dayOfMonth = date[getDate](),\n month = date[getMonth](),\n fullYear = date[getFullYear](),\n lang = defaultOptions.lang,\n langWeekdays = lang.weekdays,\n\n // List all format keys. Custom formats can be added from the outside.\n replacements = extend({\n\n // Day\n 'a': langWeekdays[day].substr(0, 3), // Short weekday, like 'Mon'\n 'A': langWeekdays[day], // Long weekday, like 'Monday'\n 'd': pad(dayOfMonth), // Two digit day of the month, 01 to 31\n 'e': dayOfMonth, // Day of the month, 1 through 31\n\n // Week (none implemented)\n //'W': weekNumber(),\n\n // Month\n 'b': lang.shortMonths[month], // Short month, like 'Jan'\n 'B': lang.months[month], // Long month, like 'January'\n 'm': pad(month + 1), // Two digit month number, 01 through 12\n\n // Year\n 'y': fullYear.toString().substr(2, 2), // Two digits year, like 09 for 2009\n 'Y': fullYear, // Four digits year, like 2009\n\n // Time\n 'H': pad(hours), // Two digits hours in 24h format, 00 through 23\n 'I': pad((hours % 12) || 12), // Two digits hours in 12h format, 00 through 11\n 'l': (hours % 12) || 12, // Hours in 12h format, 1 through 12\n 'M': pad(date[getMinutes]()), // Two digits minutes, 00 through 59\n 'p': hours < 12 ? 'AM' : 'PM', // Upper case AM or PM\n 'P': hours < 12 ? 'am' : 'pm', // Lower case AM or PM\n 'S': pad(date.getSeconds()), // Two digits seconds, 00 through 59\n 'L': pad(mathRound(timestamp % 1000), 3) // Milliseconds (naming from Ruby)\n }, Highcharts.dateFormats);\n\n\n // do the replaces\n for (key in replacements) {\n while (format.indexOf('%' + key) !== -1) { // regex would do it in one line, but this is faster\n format = format.replace('%' + key, typeof replacements[key] === 'function' ? replacements[key](timestamp) : replacements[key]);\n }\n }\n\n // Optionally capitalize the string and return\n return capitalize ? format.substr(0, 1).toUpperCase() + format.substr(1) : format;\n };\n\n /**\n * Format a single variable. Similar to sprintf, without the % prefix.\n */\n function formatSingle(format, val) {\n var floatRegex = /f$/,\n decRegex = /\\.([0-9])/,\n lang = defaultOptions.lang,\n decimals;\n\n if (floatRegex.test(format)) { // float\n decimals = format.match(decRegex);\n decimals = decimals ? decimals[1] : -1;\n if (val !== null) {\n val = numberFormat(\n val,\n decimals,\n lang.decimalPoint,\n format.indexOf(',') > -1 ? lang.thousandsSep : ''\n );\n }\n } else {\n val = dateFormat(format, val);\n }\n return val;\n }\n\n /**\n * Format a string according to a subset of the rules of Python's String.format method.\n */\n function format(str, ctx) {\n var splitter = '{',\n isInside = false,\n segment,\n valueAndFormat,\n path,\n i,\n len,\n ret = [],\n val,\n index;\n\n while ((index = str.indexOf(splitter)) !== -1) {\n\n segment = str.slice(0, index);\n if (isInside) { // we're on the closing bracket looking back\n\n valueAndFormat = segment.split(':');\n path = valueAndFormat.shift().split('.'); // get first and leave format\n len = path.length;\n val = ctx;\n\n // Assign deeper paths\n for (i = 0; i < len; i++) {\n val = val[path[i]];\n }\n\n // Format the replacement\n if (valueAndFormat.length) {\n val = formatSingle(valueAndFormat.join(':'), val);\n }\n\n // Push the result and advance the cursor\n ret.push(val);\n\n } else {\n ret.push(segment);\n\n }\n str = str.slice(index + 1); // the rest\n isInside = !isInside; // toggle\n splitter = isInside ? '}' : '{'; // now look for next matching bracket\n }\n ret.push(str);\n return ret.join('');\n }\n\n /**\n * Get the magnitude of a number\n */\n function getMagnitude(num) {\n return math.pow(10, mathFloor(math.log(num) / math.LN10));\n }\n\n /**\n * Take an interval and normalize it to multiples of 1, 2, 2.5 and 5\n * @param {Number} interval\n * @param {Array} multiples\n * @param {Number} magnitude\n * @param {Object} options\n */\n function normalizeTickInterval(interval, multiples, magnitude, allowDecimals) {\n var normalized, i;\n\n // round to a tenfold of 1, 2, 2.5 or 5\n magnitude = pick(magnitude, 1);\n normalized = interval / magnitude;\n\n // multiples for a linear scale\n if (!multiples) {\n multiples = [1, 2, 2.5, 5, 10];\n\n // the allowDecimals option\n if (allowDecimals === false) {\n if (magnitude === 1) {\n multiples = [1, 2, 5, 10];\n } else if (magnitude <= 0.1) {\n multiples = [1 / magnitude];\n }\n }\n }\n\n // normalize the interval to the nearest multiple\n for (i = 0; i < multiples.length; i++) {\n interval = multiples[i];\n if (normalized <= (multiples[i] + (multiples[i + 1] || multiples[i])) / 2) {\n break;\n }\n }\n\n // multiply back to the correct magnitude\n interval *= magnitude;\n\n return interval;\n }\n\n\n /**\n * Utility method that sorts an object array and keeping the order of equal items.\n * ECMA script standard does not specify the behaviour when items are equal.\n */\n function stableSort(arr, sortFunction) {\n var length = arr.length,\n sortValue,\n i;\n\n // Add index to each item\n for (i = 0; i < length; i++) {\n arr[i].ss_i = i; // stable sort index\n }\n\n arr.sort(function (a, b) {\n sortValue = sortFunction(a, b);\n return sortValue === 0 ? a.ss_i - b.ss_i : sortValue;\n });\n\n // Remove index from items\n for (i = 0; i < length; i++) {\n delete arr[i].ss_i; // stable sort index\n }\n }\n\n /**\n * Non-recursive method to find the lowest member of an array. Math.min raises a maximum\n * call stack size exceeded error in Chrome when trying to apply more than 150.000 points. This\n * method is slightly slower, but safe.\n */\n function arrayMin(data) {\n var i = data.length,\n min = data[0];\n\n while (i--) {\n if (data[i] < min) {\n min = data[i];\n }\n }\n return min;\n }\n\n /**\n * Non-recursive method to find the lowest member of an array. Math.min raises a maximum\n * call stack size exceeded error in Chrome when trying to apply more than 150.000 points. This\n * method is slightly slower, but safe.\n */\n function arrayMax(data) {\n var i = data.length,\n max = data[0];\n\n while (i--) {\n if (data[i] > max) {\n max = data[i];\n }\n }\n return max;\n }\n\n /**\n * Utility method that destroys any SVGElement or VMLElement that are properties on the given object.\n * It loops all properties and invokes destroy if there is a destroy method. The property is\n * then delete'ed.\n * @param {Object} The object to destroy properties on\n * @param {Object} Exception, do not destroy this property, only delete it.\n */\n function destroyObjectProperties(obj, except) {\n var n;\n for (n in obj) {\n // If the object is non-null and destroy is defined\n if (obj[n] && obj[n] !== except && obj[n].destroy) {\n // Invoke the destroy\n obj[n].destroy();\n }\n\n // Delete the property from the object.\n delete obj[n];\n }\n }\n\n\n /**\n * Discard an element by moving it to the bin and delete\n * @param {Object} The HTML node to discard\n */\n function discardElement(element) {\n // create a garbage bin element, not part of the DOM\n if (!garbageBin) {\n garbageBin = createElement(DIV);\n }\n\n // move the node and empty bin\n if (element) {\n garbageBin.appendChild(element);\n }\n garbageBin.innerHTML = '';\n }\n\n /**\n * Provide error messages for debugging, with links to online explanation\n */\n error = function (code, stop) {\n var msg = 'Highcharts error #' + code + ': www.highcharts.com/errors/' + code;\n if (stop) {\n throw msg;\n }\n // else ...\n if (win.console) {\n console.log(msg);\n }\n };\n\n /**\n * Fix JS round off float errors\n * @param {Number} num\n */\n function correctFloat(num) {\n return parseFloat(\n num.toPrecision(14)\n );\n }\n\n /**\n * Set the global animation to either a given value, or fall back to the\n * given chart's animation option\n * @param {Object} animation\n * @param {Object} chart\n */\n function setAnimation(animation, chart) {\n globalAnimation = pick(animation, chart.animation);\n }\n\n /**\n * The time unit lookup\n */\n timeUnits = {\n millisecond: 1,\n second: 1000,\n minute: 60000,\n hour: 3600000,\n day: 24 * 3600000,\n week: 7 * 24 * 3600000,\n month: 31 * 24 * 3600000,\n year: 31556952000\n };\n /**\n * Path interpolation algorithm used across adapters\n */\n pathAnim = {\n /**\n * Prepare start and end values so that the path can be animated one to one\n */\n init: function (elem, fromD, toD) {\n fromD = fromD || '';\n var shift = elem.shift,\n bezier = fromD.indexOf('C') > -1,\n numParams = bezier ? 7 : 3,\n endLength,\n slice,\n i,\n start = fromD.split(' '),\n end = [].concat(toD), // copy\n startBaseLine,\n endBaseLine,\n sixify = function (arr) { // in splines make move points have six parameters like bezier curves\n i = arr.length;\n while (i--) {\n if (arr[i] === M) {\n arr.splice(i + 1, 0, arr[i + 1], arr[i + 2], arr[i + 1], arr[i + 2]);\n }\n }\n };\n\n if (bezier) {\n sixify(start);\n sixify(end);\n }\n\n // pull out the base lines before padding\n if (elem.isArea) {\n startBaseLine = start.splice(start.length - 6, 6);\n endBaseLine = end.splice(end.length - 6, 6);\n }\n\n // if shifting points, prepend a dummy point to the end path\n if (shift <= end.length / numParams && start.length === end.length) {\n while (shift--) {\n end = [].concat(end).splice(0, numParams).concat(end);\n }\n }\n elem.shift = 0; // reset for following animations\n\n // copy and append last point until the length matches the end length\n if (start.length) {\n endLength = end.length;\n while (start.length < endLength) {\n\n //bezier && sixify(start);\n slice = [].concat(start).splice(start.length - numParams, numParams);\n if (bezier) { // disable first control point\n slice[numParams - 6] = slice[numParams - 2];\n slice[numParams - 5] = slice[numParams - 1];\n }\n start = start.concat(slice);\n }\n }\n\n if (startBaseLine) { // append the base lines for areas\n start = start.concat(startBaseLine);\n end = end.concat(endBaseLine);\n }\n return [start, end];\n },\n\n /**\n * Interpolate each value of the path and return the array\n */\n step: function (start, end, pos, complete) {\n var ret = [],\n i = start.length,\n startVal;\n\n if (pos === 1) { // land on the final path without adjustment points appended in the ends\n ret = complete;\n\n } else if (i === end.length && pos < 1) {\n while (i--) {\n startVal = parseFloat(start[i]);\n ret[i] =\n isNaN(startVal) ? // a letter instruction like M or L\n start[i] :\n pos * (parseFloat(end[i] - startVal)) + startVal;\n\n }\n } else { // if animation is finished or length not matching, land on right value\n ret = end;\n }\n return ret;\n }\n };\n\n (function ($) {\n /**\n * The default HighchartsAdapter for jQuery\n */\n win.HighchartsAdapter = win.HighchartsAdapter || ($ && {\n\n /**\n * Initialize the adapter by applying some extensions to jQuery\n */\n init: function (pathAnim) {\n\n // extend the animate function to allow SVG animations\n var Fx = $.fx;\n\n /*jslint unparam: true*//* allow unused param x in this function */\n $.extend($.easing, {\n easeOutQuad: function (x, t, b, c, d) {\n return -c * (t /= d) * (t - 2) + b;\n }\n });\n /*jslint unparam: false*/\n\n // extend some methods to check for elem.attr, which means it is a Highcharts SVG object\n $.each(['cur', '_default', 'width', 'height', 'opacity'], function (i, fn) {\n var obj = Fx.step,\n base;\n\n // Handle different parent objects\n if (fn === 'cur') {\n obj = Fx.prototype; // 'cur', the getter, relates to Fx.prototype\n\n } else if (fn === '_default' && $.Tween) { // jQuery 1.8 model\n obj = $.Tween.propHooks[fn];\n fn = 'set';\n }\n\n // Overwrite the method\n base = obj[fn];\n if (base) { // step.width and step.height don't exist in jQuery < 1.7\n\n // create the extended function replacement\n obj[fn] = function (fx) {\n\n var elem;\n\n // Fx.prototype.cur does not use fx argument\n fx = i ? fx : this;\n\n // Don't run animations on textual properties like align (#1821)\n if (fx.prop === 'align') {\n return;\n }\n\n // shortcut\n elem = fx.elem;\n\n // Fx.prototype.cur returns the current value. The other ones are setters\n // and returning a value has no effect.\n return elem.attr ? // is SVG element wrapper\n elem.attr(fx.prop, fn === 'cur' ? UNDEFINED : fx.now) : // apply the SVG wrapper's method\n base.apply(this, arguments); // use jQuery's built-in method\n };\n }\n });\n\n // Extend the opacity getter, needed for fading opacity with IE9 and jQuery 1.10+\n wrap($.cssHooks.opacity, 'get', function (proceed, elem, computed) {\n return elem.attr ? (elem.opacity || 0) : proceed.call(this, elem, computed);\n });\n\n // Define the setter function for d (path definitions)\n this.addAnimSetter('d', function (fx) {\n var elem = fx.elem,\n ends;\n\n // Normally start and end should be set in state == 0, but sometimes,\n // for reasons unknown, this doesn't happen. Perhaps state == 0 is skipped\n // in these cases\n if (!fx.started) {\n ends = pathAnim.init(elem, elem.d, elem.toD);\n fx.start = ends[0];\n fx.end = ends[1];\n fx.started = true;\n }\n\n // Interpolate each value of the path\n elem.attr('d', pathAnim.step(fx.start, fx.end, fx.pos, elem.toD));\n });\n\n /**\n * Utility for iterating over an array. Parameters are reversed compared to jQuery.\n * @param {Array} arr\n * @param {Function} fn\n */\n this.each = Array.prototype.forEach ?\n function (arr, fn) { // modern browsers\n return Array.prototype.forEach.call(arr, fn);\n\n } :\n function (arr, fn) { // legacy\n var i,\n len = arr.length;\n for (i = 0; i < len; i++) {\n if (fn.call(arr[i], arr[i], i, arr) === false) {\n return i;\n }\n }\n };\n\n /**\n * Register Highcharts as a plugin in the respective framework\n */\n $.fn.highcharts = function () {\n var constr = 'Chart', // default constructor\n args = arguments,\n options,\n ret,\n chart;\n\n if (this[0]) {\n\n if (isString(args[0])) {\n constr = args[0];\n args = Array.prototype.slice.call(args, 1);\n }\n options = args[0];\n\n // Create the chart\n if (options !== UNDEFINED) {\n /*jslint unused:false*/\n options.chart = options.chart || {};\n options.chart.renderTo = this[0];\n chart = new Highcharts[constr](options, args[1]);\n ret = this;\n /*jslint unused:true*/\n }\n\n // When called without parameters or with the return argument, get a predefined chart\n if (options === UNDEFINED) {\n ret = charts[attr(this[0], 'data-highcharts-chart')];\n }\n }\n\n return ret;\n };\n\n },\n\n /**\n * Add an animation setter for a specific property\n */\n addAnimSetter: function (prop, setter) {\n // jQuery 1.8 style\n if ($.Tween) {\n $.Tween.propHooks[prop] = {\n set: setter\n };\n // pre 1.8\n } else {\n $.fx.step[prop] = setter;\n }\n },\n\n /**\n * Downloads a script and executes a callback when done.\n * @param {String} scriptLocation\n * @param {Function} callback\n */\n getScript: $.getScript,\n\n /**\n * Return the index of an item in an array, or -1 if not found\n */\n inArray: $.inArray,\n\n /**\n * A direct link to jQuery methods. MooTools and Prototype adapters must be implemented for each case of method.\n * @param {Object} elem The HTML element\n * @param {String} method Which method to run on the wrapped element\n */\n adapterRun: function (elem, method) {\n return $(elem)[method]();\n },\n\n /**\n * Filter an array\n */\n grep: $.grep,\n\n /**\n * Map an array\n * @param {Array} arr\n * @param {Function} fn\n */\n map: function (arr, fn) {\n //return jQuery.map(arr, fn);\n var results = [],\n i = 0,\n len = arr.length;\n for (; i < len; i++) {\n results[i] = fn.call(arr[i], arr[i], i, arr);\n }\n return results;\n\n },\n\n /**\n * Get the position of an element relative to the top left of the page\n */\n offset: function (el) {\n return $(el).offset();\n },\n\n /**\n * Add an event listener\n * @param {Object} el A HTML element or custom object\n * @param {String} event The event type\n * @param {Function} fn The event handler\n */\n addEvent: function (el, event, fn) {\n $(el).bind(event, fn);\n },\n\n /**\n * Remove event added with addEvent\n * @param {Object} el The object\n * @param {String} eventType The event type. Leave blank to remove all events.\n * @param {Function} handler The function to remove\n */\n removeEvent: function (el, eventType, handler) {\n // workaround for jQuery issue with unbinding custom events:\n // http://forum.jQuery.com/topic/javascript-error-when-unbinding-a-custom-event-using-jQuery-1-4-2\n var func = doc.removeEventListener ? 'removeEventListener' : 'detachEvent';\n if (doc[func] && el && !el[func]) {\n el[func] = function () {};\n }\n\n $(el).unbind(eventType, handler);\n },\n\n /**\n * Fire an event on a custom object\n * @param {Object} el\n * @param {String} type\n * @param {Object} eventArguments\n * @param {Function} defaultFunction\n */\n fireEvent: function (el, type, eventArguments, defaultFunction) {\n var event = $.Event(type),\n detachedType = 'detached' + type,\n defaultPrevented;\n\n // Remove warnings in Chrome when accessing returnValue (#2790), layerX and layerY. Although Highcharts\n // never uses these properties, Chrome includes them in the default click event and\n // raises the warning when they are copied over in the extend statement below.\n //\n // To avoid problems in IE (see #1010) where we cannot delete the properties and avoid\n // testing if they are there (warning in chrome) the only option is to test if running IE.\n if (!isIE && eventArguments) {\n delete eventArguments.layerX;\n delete eventArguments.layerY;\n delete eventArguments.returnValue;\n }\n\n extend(event, eventArguments);\n\n // Prevent jQuery from triggering the object method that is named the\n // same as the event. For example, if the event is 'select', jQuery\n // attempts calling el.select and it goes into a loop.\n if (el[type]) {\n el[detachedType] = el[type];\n el[type] = null;\n }\n\n // Wrap preventDefault and stopPropagation in try/catch blocks in\n // order to prevent JS errors when cancelling events on non-DOM\n // objects. #615.\n /*jslint unparam: true*/\n $.each(['preventDefault', 'stopPropagation'], function (i, fn) {\n var base = event[fn];\n event[fn] = function () {\n try {\n base.call(event);\n } catch (e) {\n if (fn === 'preventDefault') {\n defaultPrevented = true;\n }\n }\n };\n });\n /*jslint unparam: false*/\n\n // trigger it\n $(el).trigger(event);\n\n // attach the method\n if (el[detachedType]) {\n el[type] = el[detachedType];\n el[detachedType] = null;\n }\n\n if (defaultFunction && !event.isDefaultPrevented() && !defaultPrevented) {\n defaultFunction(event);\n }\n },\n\n /**\n * Extension method needed for MooTools\n */\n washMouseEvent: function (e) {\n var ret = e.originalEvent || e;\n\n // computed by jQuery, needed by IE8\n if (ret.pageX === UNDEFINED) { // #1236\n ret.pageX = e.pageX;\n ret.pageY = e.pageY;\n }\n\n return ret;\n },\n\n /**\n * Animate a HTML element or SVG element wrapper\n * @param {Object} el\n * @param {Object} params\n * @param {Object} options jQuery-like animation options: duration, easing, callback\n */\n animate: function (el, params, options) {\n var $el = $(el);\n if (!el.style) {\n el.style = {}; // #1881\n }\n if (params.d) {\n el.toD = params.d; // keep the array form for paths, used in $.fx.step.d\n params.d = 1; // because in jQuery, animating to an array has a different meaning\n }\n\n $el.stop();\n if (params.opacity !== UNDEFINED && el.attr) {\n params.opacity += 'px'; // force jQuery to use same logic as width and height (#2161)\n }\n el.hasAnim = 1; // #3342\n $el.animate(params, options);\n\n },\n /**\n * Stop running animation\n */\n stop: function (el) {\n if (el.hasAnim) { // #3342, memory leak on calling $(el) from destroy\n $(el).stop();\n }\n }\n });\n }(win.jQuery));\n\n\n// check for a custom HighchartsAdapter defined prior to this file\n var globalAdapter = win.HighchartsAdapter,\n adapter = globalAdapter || {};\n\n// Initialize the adapter\n if (globalAdapter) {\n globalAdapter.init.call(globalAdapter, pathAnim);\n }\n\n\n// Utility functions. If the HighchartsAdapter is not defined, adapter is an empty object\n// and all the utility functions will be null. In that case they are populated by the\n// default adapters below.\n var adapterRun = adapter.adapterRun,\n getScript = adapter.getScript,\n inArray = adapter.inArray,\n each = adapter.each,\n grep = adapter.grep,\n offset = adapter.offset,\n map = adapter.map,\n addEvent = adapter.addEvent,\n removeEvent = adapter.removeEvent,\n fireEvent = adapter.fireEvent,\n washMouseEvent = adapter.washMouseEvent,\n animate = adapter.animate,\n stop = adapter.stop;\n\n\n\n /* ****************************************************************************\n * Handle the options *\n *****************************************************************************/\n var\n\n defaultLabelOptions = {\n enabled: true,\n // rotation: 0,\n // align: 'center',\n x: 0,\n y: 15,\n /*formatter: function () {\n return this.value;\n },*/\n style: {\n color: '#606060',\n cursor: 'default',\n fontSize: '11px'\n }\n };\n\n defaultOptions = {\n colors: ['#7cb5ec', '#434348', '#90ed7d', '#f7a35c',\n '#8085e9', '#f15c80', '#e4d354', '#8085e8', '#8d4653', '#91e8e1'],\n symbols: ['circle', 'diamond', 'square', 'triangle', 'triangle-down'],\n lang: {\n loading: 'Loading...',\n months: ['January', 'February', 'March', 'April', 'May', 'June', 'July',\n 'August', 'September', 'October', 'November', 'December'],\n shortMonths: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],\n weekdays: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'],\n decimalPoint: '.',\n numericSymbols: ['k', 'M', 'G', 'T', 'P', 'E'], // SI prefixes used in axis labels\n resetZoom: 'Reset zoom',\n resetZoomTitle: 'Reset zoom level 1:1',\n thousandsSep: ','\n },\n global: {\n useUTC: true,\n //timezoneOffset: 0,\n canvasToolsURL: 'http://code.highcharts.com/4.0.4/modules/canvas-tools.js',\n VMLRadialGradientURL: 'http://code.highcharts.com/4.0.4/gfx/vml-radial-gradient.png'\n },\n chart: {\n //animation: true,\n //alignTicks: false,\n //reflow: true,\n //className: null,\n //events: { load, selection },\n //margin: [null],\n //marginTop: null,\n //marginRight: null,\n //marginBottom: null,\n //marginLeft: null,\n borderColor: '#4572A7',\n //borderWidth: 0,\n borderRadius: 0,\n defaultSeriesType: 'line',\n ignoreHiddenSeries: true,\n //inverted: false,\n //shadow: false,\n spacing: [10, 10, 15, 10],\n //spacingTop: 10,\n //spacingRight: 10,\n //spacingBottom: 15,\n //spacingLeft: 10,\n //style: {\n //\tfontFamily: '\"Lucida Grande\", \"Lucida Sans Unicode\", Verdana, Arial, Helvetica, sans-serif', // default font\n //\tfontSize: '12px'\n //},\n backgroundColor: '#FFFFFF',\n //plotBackgroundColor: null,\n plotBorderColor: '#C0C0C0',\n //plotBorderWidth: 0,\n //plotShadow: false,\n //zoomType: ''\n resetZoomButton: {\n theme: {\n zIndex: 20\n },\n position: {\n align: 'right',\n x: -10,\n //verticalAlign: 'top',\n y: 10\n }\n // relativeTo: 'plot'\n }\n },\n title: {\n text: 'Chart title',\n align: 'center',\n // floating: false,\n margin: 15,\n // x: 0,\n // verticalAlign: 'top',\n // y: null,\n style: {\n color: '#333333',\n fontSize: '18px'\n }\n\n },\n subtitle: {\n text: '',\n align: 'center',\n // floating: false\n // x: 0,\n // verticalAlign: 'top',\n // y: null,\n style: {\n color: '#555555'\n }\n },\n\n plotOptions: {\n line: { // base series options\n allowPointSelect: false,\n showCheckbox: false,\n animation: {\n duration: 1000\n },\n //connectNulls: false,\n //cursor: 'default',\n //clip: true,\n //dashStyle: null,\n //enableMouseTracking: true,\n events: {},\n //legendIndex: 0,\n //linecap: 'round',\n lineWidth: 2,\n //shadow: false,\n // stacking: null,\n marker: {\n //enabled: true,\n //symbol: null,\n lineWidth: 0,\n radius: 4,\n lineColor: '#FFFFFF',\n //fillColor: null,\n states: { // states for a single point\n hover: {\n enabled: true,\n lineWidthPlus: 1,\n radiusPlus: 2\n },\n select: {\n fillColor: '#FFFFFF',\n lineColor: '#000000',\n lineWidth: 2\n }\n }\n },\n point: {\n events: {}\n },\n dataLabels: merge(defaultLabelOptions, {\n align: 'center',\n //defer: true,\n enabled: false,\n formatter: function () {\n return this.y === null ? '' : numberFormat(this.y, -1);\n },\n verticalAlign: 'bottom', // above singular point\n y: 0\n // backgroundColor: undefined,\n // borderColor: undefined,\n // borderRadius: undefined,\n // borderWidth: undefined,\n // padding: 3,\n // shadow: false\n }),\n cropThreshold: 300, // draw points outside the plot area when the number of points is less than this\n pointRange: 0,\n //pointStart: 0,\n //pointInterval: 1,\n //showInLegend: null, // auto: true for standalone series, false for linked series\n states: { // states for the entire series\n hover: {\n //enabled: false,\n lineWidthPlus: 1,\n marker: {\n // lineWidth: base + 1,\n // radius: base + 1\n },\n halo: {\n size: 10,\n opacity: 0.25\n }\n },\n select: {\n marker: {}\n }\n },\n stickyTracking: true,\n //tooltip: {\n //pointFormat: '<span style=\"color:{series.color}\">\\u25CF</span> {series.name}: <b>{point.y}</b>'\n //valueDecimals: null,\n //xDateFormat: '%A, %b %e, %Y',\n //valuePrefix: '',\n //ySuffix: ''\n //}\n turboThreshold: 1000\n // zIndex: null\n }\n },\n labels: {\n //items: [],\n style: {\n //font: defaultFont,\n position: ABSOLUTE,\n color: '#3E576F'\n }\n },\n legend: {\n enabled: true,\n align: 'center',\n //floating: false,\n layout: 'horizontal',\n labelFormatter: function () {\n return this.name;\n },\n //borderWidth: 0,\n borderColor: '#909090',\n borderRadius: 0,\n navigation: {\n // animation: true,\n activeColor: '#274b6d',\n // arrowSize: 12\n inactiveColor: '#CCC'\n // style: {} // text styles\n },\n // margin: 20,\n // reversed: false,\n shadow: false,\n // backgroundColor: null,\n /*style: {\n padding: '5px'\n },*/\n itemStyle: {\n color: '#333333',\n fontSize: '12px',\n fontWeight: 'bold'\n },\n itemHoverStyle: {\n //cursor: 'pointer', removed as of #601\n color: '#000'\n },\n itemHiddenStyle: {\n color: '#CCC'\n },\n itemCheckboxStyle: {\n position: ABSOLUTE,\n width: '13px', // for IE precision\n height: '13px'\n },\n // itemWidth: undefined,\n // symbolRadius: 0,\n // symbolWidth: 16,\n symbolPadding: 5,\n verticalAlign: 'bottom',\n // width: undefined,\n x: 0,\n y: 0,\n title: {\n //text: null,\n style: {\n fontWeight: 'bold'\n }\n }\n },\n\n loading: {\n // hideDuration: 100,\n labelStyle: {\n fontWeight: 'bold',\n position: RELATIVE,\n top: '45%'\n },\n // showDuration: 0,\n style: {\n position: ABSOLUTE,\n backgroundColor: 'white',\n opacity: 0.5,\n textAlign: 'center'\n }\n },\n\n tooltip: {\n enabled: true,\n animation: hasSVG,\n //crosshairs: null,\n backgroundColor: 'rgba(249, 249, 249, .85)',\n borderWidth: 1,\n borderRadius: 3,\n dateTimeLabelFormats: {\n millisecond: '%A, %b %e, %H:%M:%S.%L',\n second: '%A, %b %e, %H:%M:%S',\n minute: '%A, %b %e, %H:%M',\n hour: '%A, %b %e, %H:%M',\n day: '%A, %b %e, %Y',\n week: 'Week from %A, %b %e, %Y',\n month: '%B %Y',\n year: '%Y'\n },\n //formatter: defaultFormatter,\n headerFormat: '<span style=\"font-size: 10px\">{point.key}</span><br/>',\n pointFormat: '<span style=\"color:{series.color}\">\\u25CF</span> {series.name}: <b>{point.y}</b><br/>',\n shadow: true,\n //shape: 'callout',\n //shared: false,\n snap: isTouchDevice ? 25 : 10,\n style: {\n color: '#333333',\n cursor: 'default',\n fontSize: '12px',\n padding: '8px',\n whiteSpace: 'nowrap'\n }\n //xDateFormat: '%A, %b %e, %Y',\n //valueDecimals: null,\n //valuePrefix: '',\n //valueSuffix: ''\n },\n\n credits: {\n enabled: true,\n text: 'Highcharts.com',\n href: 'http://www.highcharts.com',\n position: {\n align: 'right',\n x: -10,\n verticalAlign: 'bottom',\n y: -5\n },\n style: {\n cursor: 'pointer',\n color: '#909090',\n fontSize: '9px'\n }\n }\n };\n\n\n\n\n// Series defaults\n var defaultPlotOptions = defaultOptions.plotOptions,\n defaultSeriesOptions = defaultPlotOptions.line;\n\n// set the default time methods\n setTimeMethods();\n\n\n\n /**\n * Set the time methods globally based on the useUTC option. Time method can be either\n * local time or UTC (default).\n */\n function setTimeMethods() {\n var useUTC = defaultOptions.global.useUTC,\n GET = useUTC ? 'getUTC' : 'get',\n SET = useUTC ? 'setUTC' : 'set';\n\n\n Date = defaultOptions.global.Date || window.Date;\n timezoneOffset = ((useUTC && defaultOptions.global.timezoneOffset) || 0) * 60000;\n makeTime = useUTC ? Date.UTC : function (year, month, date, hours, minutes, seconds) {\n return new Date(\n year,\n month,\n pick(date, 1),\n pick(hours, 0),\n pick(minutes, 0),\n pick(seconds, 0)\n ).getTime();\n };\n getMinutes = GET + 'Minutes';\n getHours = GET + 'Hours';\n getDay = GET + 'Day';\n getDate = GET + 'Date';\n getMonth = GET + 'Month';\n getFullYear = GET + 'FullYear';\n setMinutes = SET + 'Minutes';\n setHours = SET + 'Hours';\n setDate = SET + 'Date';\n setMonth = SET + 'Month';\n setFullYear = SET + 'FullYear';\n\n }\n\n /**\n * Merge the default options with custom options and return the new options structure\n * @param {Object} options The new custom options\n */\n function setOptions(options) {\n\n // Copy in the default options\n defaultOptions = merge(true, defaultOptions, options);\n\n // Apply UTC\n setTimeMethods();\n\n return defaultOptions;\n }\n\n /**\n * Get the updated default options. Until 3.0.7, merely exposing defaultOptions for outside modules\n * wasn't enough because the setOptions method created a new object.\n */\n function getOptions() {\n return defaultOptions;\n }\n\n\n /**\n * Handle color operations. The object methods are chainable.\n * @param {String} input The input color in either rbga or hex format\n */\n var rgbaRegEx = /rgba\\(\\s*([0-9]{1,3})\\s*,\\s*([0-9]{1,3})\\s*,\\s*([0-9]{1,3})\\s*,\\s*([0-9]?(?:\\.[0-9]+)?)\\s*\\)/,\n hexRegEx = /#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/,\n rgbRegEx = /rgb\\(\\s*([0-9]{1,3})\\s*,\\s*([0-9]{1,3})\\s*,\\s*([0-9]{1,3})\\s*\\)/;\n\n var Color = function (input) {\n // declare variables\n var rgba = [], result, stops;\n\n /**\n * Parse the input color to rgba array\n * @param {String} input\n */\n function init(input) {\n\n // Gradients\n if (input && input.stops) {\n stops = map(input.stops, function (stop) {\n return Color(stop[1]);\n });\n\n // Solid colors\n } else {\n // rgba\n result = rgbaRegEx.exec(input);\n if (result) {\n rgba = [pInt(result[1]), pInt(result[2]), pInt(result[3]), parseFloat(result[4], 10)];\n } else {\n // hex\n result = hexRegEx.exec(input);\n if (result) {\n rgba = [pInt(result[1], 16), pInt(result[2], 16), pInt(result[3], 16), 1];\n } else {\n // rgb\n result = rgbRegEx.exec(input);\n if (result) {\n rgba = [pInt(result[1]), pInt(result[2]), pInt(result[3]), 1];\n }\n }\n }\n }\n\n }\n /**\n * Return the color a specified format\n * @param {String} format\n */\n function get(format) {\n var ret;\n\n if (stops) {\n ret = merge(input);\n ret.stops = [].concat(ret.stops);\n each(stops, function (stop, i) {\n ret.stops[i] = [ret.stops[i][0], stop.get(format)];\n });\n\n // it's NaN if gradient colors on a column chart\n } else if (rgba && !isNaN(rgba[0])) {\n if (format === 'rgb') {\n ret = 'rgb(' + rgba[0] + ',' + rgba[1] + ',' + rgba[2] + ')';\n } else if (format === 'a') {\n ret = rgba[3];\n } else {\n ret = 'rgba(' + rgba.join(',') + ')';\n }\n } else {\n ret = input;\n }\n return ret;\n }\n\n /**\n * Brighten the color\n * @param {Number} alpha\n */\n function brighten(alpha) {\n if (stops) {\n each(stops, function (stop) {\n stop.brighten(alpha);\n });\n\n } else if (isNumber(alpha) && alpha !== 0) {\n var i;\n for (i = 0; i < 3; i++) {\n rgba[i] += pInt(alpha * 255);\n\n if (rgba[i] < 0) {\n rgba[i] = 0;\n }\n if (rgba[i] > 255) {\n rgba[i] = 255;\n }\n }\n }\n return this;\n }\n /**\n * Set the color's opacity to a given alpha value\n * @param {Number} alpha\n */\n function setOpacity(alpha) {\n rgba[3] = alpha;\n return this;\n }\n\n // initialize: parse the input\n init(input);\n\n // public methods\n return {\n get: get,\n brighten: brighten,\n rgba: rgba,\n setOpacity: setOpacity\n };\n };\n\n\n /**\n * A wrapper object for SVG elements\n */\n function SVGElement() {}\n\n SVGElement.prototype = {\n\n // Default base for animation\n opacity: 1,\n // For labels, these CSS properties are applied to the <text> node directly\n textProps: ['fontSize', 'fontWeight', 'fontFamily', 'color',\n 'lineHeight', 'width', 'textDecoration', 'textShadow', 'HcTextStroke'],\n\n /**\n * Initialize the SVG renderer\n * @param {Object} renderer\n * @param {String} nodeName\n */\n init: function (renderer, nodeName) {\n var wrapper = this;\n wrapper.element = nodeName === 'span' ?\n createElement(nodeName) :\n doc.createElementNS(SVG_NS, nodeName);\n wrapper.renderer = renderer;\n },\n\n /**\n * Animate a given attribute\n * @param {Object} params\n * @param {Number} options The same options as in jQuery animation\n * @param {Function} complete Function to perform at the end of animation\n */\n animate: function (params, options, complete) {\n var animOptions = pick(options, globalAnimation, true);\n stop(this); // stop regardless of animation actually running, or reverting to .attr (#607)\n if (animOptions) {\n animOptions = merge(animOptions, {}); //#2625\n if (complete) { // allows using a callback with the global animation without overwriting it\n animOptions.complete = complete;\n }\n animate(this, params, animOptions);\n } else {\n this.attr(params);\n if (complete) {\n complete();\n }\n }\n return this;\n },\n\n /**\n * Build an SVG gradient out of a common JavaScript configuration object\n */\n colorGradient: function (color, prop, elem) {\n var renderer = this.renderer,\n colorObject,\n gradName,\n gradAttr,\n gradients,\n gradientObject,\n stops,\n stopColor,\n stopOpacity,\n radialReference,\n n,\n id,\n key = [];\n\n // Apply linear or radial gradients\n if (color.linearGradient) {\n gradName = 'linearGradient';\n } else if (color.radialGradient) {\n gradName = 'radialGradient';\n }\n\n if (gradName) {\n gradAttr = color[gradName];\n gradients = renderer.gradients;\n stops = color.stops;\n radialReference = elem.radialReference;\n\n // Keep < 2.2 kompatibility\n if (isArray(gradAttr)) {\n color[gradName] = gradAttr = {\n x1: gradAttr[0],\n y1: gradAttr[1],\n x2: gradAttr[2],\n y2: gradAttr[3],\n gradientUnits: 'userSpaceOnUse'\n };\n }\n\n // Correct the radial gradient for the radial reference system\n if (gradName === 'radialGradient' && radialReference && !defined(gradAttr.gradientUnits)) {\n gradAttr = merge(gradAttr, {\n cx: (radialReference[0] - radialReference[2] / 2) + gradAttr.cx * radialReference[2],\n cy: (radialReference[1] - radialReference[2] / 2) + gradAttr.cy * radialReference[2],\n r: gradAttr.r * radialReference[2],\n gradientUnits: 'userSpaceOnUse'\n });\n }\n\n // Build the unique key to detect whether we need to create a new element (#1282)\n for (n in gradAttr) {\n if (n !== 'id') {\n key.push(n, gradAttr[n]);\n }\n }\n for (n in stops) {\n key.push(stops[n]);\n }\n key = key.join(',');\n\n // Check if a gradient object with the same config object is created within this renderer\n if (gradients[key]) {\n id = gradients[key].attr('id');\n\n } else {\n\n // Set the id and create the element\n gradAttr.id = id = PREFIX + idCounter++;\n gradients[key] = gradientObject = renderer.createElement(gradName)\n .attr(gradAttr)\n .add(renderer.defs);\n\n\n // The gradient needs to keep a list of stops to be able to destroy them\n gradientObject.stops = [];\n each(stops, function (stop) {\n var stopObject;\n if (stop[1].indexOf('rgba') === 0) {\n colorObject = Color(stop[1]);\n stopColor = colorObject.get('rgb');\n stopOpacity = colorObject.get('a');\n } else {\n stopColor = stop[1];\n stopOpacity = 1;\n }\n stopObject = renderer.createElement('stop').attr({\n offset: stop[0],\n 'stop-color': stopColor,\n 'stop-opacity': stopOpacity\n }).add(gradientObject);\n\n // Add the stop element to the gradient\n gradientObject.stops.push(stopObject);\n });\n }\n\n // Set the reference to the gradient object\n elem.setAttribute(prop, 'url(' + renderer.url + '#' + id + ')');\n }\n },\n\n /**\n * Set or get a given attribute\n * @param {Object|String} hash\n * @param {Mixed|Undefined} val\n */\n attr: function (hash, val) {\n var key,\n value,\n element = this.element,\n hasSetSymbolSize,\n ret = this,\n skipAttr;\n\n // single key-value pair\n if (typeof hash === 'string' && val !== UNDEFINED) {\n key = hash;\n hash = {};\n hash[key] = val;\n }\n\n // used as a getter: first argument is a string, second is undefined\n if (typeof hash === 'string') {\n ret = (this[hash + 'Getter'] || this._defaultGetter).call(this, hash, element);\n\n // setter\n } else {\n\n for (key in hash) {\n value = hash[key];\n skipAttr = false;\n\n\n\n if (this.symbolName && /^(x|y|width|height|r|start|end|innerR|anchorX|anchorY)/.test(key)) {\n if (!hasSetSymbolSize) {\n this.symbolAttr(hash);\n hasSetSymbolSize = true;\n }\n skipAttr = true;\n }\n\n if (this.rotation && (key === 'x' || key === 'y')) {\n this.doTransform = true;\n }\n\n if (!skipAttr) {\n (this[key + 'Setter'] || this._defaultSetter).call(this, value, key, element);\n }\n\n // Let the shadow follow the main element\n if (this.shadows && /^(width|height|visibility|x|y|d|transform|cx|cy|r)$/.test(key)) {\n this.updateShadows(key, value);\n }\n }\n\n // Update transform. Do this outside the loop to prevent redundant updating for batch setting\n // of attributes.\n if (this.doTransform) {\n this.updateTransform();\n this.doTransform = false;\n }\n\n }\n\n return ret;\n },\n\n updateShadows: function (key, value) {\n var shadows = this.shadows,\n i = shadows.length;\n while (i--) {\n shadows[i].setAttribute(\n key,\n key === 'height' ?\n mathMax(value - (shadows[i].cutHeight || 0), 0) :\n key === 'd' ? this.d : value\n );\n }\n },\n\n /**\n * Add a class name to an element\n */\n addClass: function (className) {\n var element = this.element,\n currentClassName = attr(element, 'class') || '';\n\n if (currentClassName.indexOf(className) === -1) {\n attr(element, 'class', currentClassName + ' ' + className);\n }\n return this;\n },\n /* hasClass and removeClass are not (yet) needed\n hasClass: function (className) {\n return attr(this.element, 'class').indexOf(className) !== -1;\n },\n removeClass: function (className) {\n attr(this.element, 'class', attr(this.element, 'class').replace(className, ''));\n return this;\n },\n */\n\n /**\n * If one of the symbol size affecting parameters are changed,\n * check all the others only once for each call to an element's\n * .attr() method\n * @param {Object} hash\n */\n symbolAttr: function (hash) {\n var wrapper = this;\n\n each(['x', 'y', 'r', 'start', 'end', 'width', 'height', 'innerR', 'anchorX', 'anchorY'], function (key) {\n wrapper[key] = pick(hash[key], wrapper[key]);\n });\n\n wrapper.attr({\n d: wrapper.renderer.symbols[wrapper.symbolName](\n wrapper.x,\n wrapper.y,\n wrapper.width,\n wrapper.height,\n wrapper\n )\n });\n },\n\n /**\n * Apply a clipping path to this object\n * @param {String} id\n */\n clip: function (clipRect) {\n return this.attr('clip-path', clipRect ? 'url(' + this.renderer.url + '#' + clipRect.id + ')' : NONE);\n },\n\n /**\n * Calculate the coordinates needed for drawing a rectangle crisply and return the\n * calculated attributes\n * @param {Number} strokeWidth\n * @param {Number} x\n * @param {Number} y\n * @param {Number} width\n * @param {Number} height\n */\n crisp: function (rect) {\n\n var wrapper = this,\n key,\n attribs = {},\n normalizer,\n strokeWidth = rect.strokeWidth || wrapper.strokeWidth || 0;\n\n normalizer = mathRound(strokeWidth) % 2 / 2; // mathRound because strokeWidth can sometimes have roundoff errors\n\n // normalize for crisp edges\n rect.x = mathFloor(rect.x || wrapper.x || 0) + normalizer;\n rect.y = mathFloor(rect.y || wrapper.y || 0) + normalizer;\n rect.width = mathFloor((rect.width || wrapper.width || 0) - 2 * normalizer);\n rect.height = mathFloor((rect.height || wrapper.height || 0) - 2 * normalizer);\n rect.strokeWidth = strokeWidth;\n\n for (key in rect) {\n if (wrapper[key] !== rect[key]) { // only set attribute if changed\n wrapper[key] = attribs[key] = rect[key];\n }\n }\n\n return attribs;\n },\n\n /**\n * Set styles for the element\n * @param {Object} styles\n */\n css: function (styles) {\n var elemWrapper = this,\n oldStyles = elemWrapper.styles,\n newStyles = {},\n elem = elemWrapper.element,\n textWidth,\n n,\n serializedCss = '',\n hyphenate,\n hasNew = !oldStyles;\n\n // convert legacy\n if (styles && styles.color) {\n styles.fill = styles.color;\n }\n\n // Filter out existing styles to increase performance (#2640)\n if (oldStyles) {\n for (n in styles) {\n if (styles[n] !== oldStyles[n]) {\n newStyles[n] = styles[n];\n hasNew = true;\n }\n }\n }\n if (hasNew) {\n textWidth = elemWrapper.textWidth = styles && styles.width && elem.nodeName.toLowerCase() === 'text' && pInt(styles.width);\n\n // Merge the new styles with the old ones\n if (oldStyles) {\n styles = extend(\n oldStyles,\n newStyles\n );\n }\n\n // store object\n elemWrapper.styles = styles;\n\n if (textWidth && (useCanVG || (!hasSVG && elemWrapper.renderer.forExport))) {\n delete styles.width;\n }\n\n // serialize and set style attribute\n if (isIE && !hasSVG) {\n css(elemWrapper.element, styles);\n } else {\n /*jslint unparam: true*/\n hyphenate = function (a, b) { return '-' + b.toLowerCase(); };\n /*jslint unparam: false*/\n for (n in styles) {\n serializedCss += n.replace(/([A-Z])/g, hyphenate) + ':' + styles[n] + ';';\n }\n attr(elem, 'style', serializedCss); // #1881\n }\n\n\n // re-build text\n if (textWidth && elemWrapper.added) {\n elemWrapper.renderer.buildText(elemWrapper);\n }\n }\n\n return elemWrapper;\n },\n\n /**\n * Add an event listener\n * @param {String} eventType\n * @param {Function} handler\n */\n on: function (eventType, handler) {\n var svgElement = this,\n element = svgElement.element;\n\n // touch\n if (hasTouch && eventType === 'click') {\n element.ontouchstart = function (e) {\n svgElement.touchEventFired = Date.now();\n e.preventDefault();\n handler.call(element, e);\n };\n element.onclick = function (e) {\n if (userAgent.indexOf('Android') === -1 || Date.now() - (svgElement.touchEventFired || 0) > 1100) { // #2269\n handler.call(element, e);\n }\n };\n } else {\n // simplest possible event model for internal use\n element['on' + eventType] = handler;\n }\n return this;\n },\n\n /**\n * Set the coordinates needed to draw a consistent radial gradient across\n * pie slices regardless of positioning inside the chart. The format is\n * [centerX, centerY, diameter] in pixels.\n */\n setRadialReference: function (coordinates) {\n this.element.radialReference = coordinates;\n return this;\n },\n\n /**\n * Move an object and its children by x and y values\n * @param {Number} x\n * @param {Number} y\n */\n translate: function (x, y) {\n return this.attr({\n translateX: x,\n translateY: y\n });\n },\n\n /**\n * Invert a group, rotate and flip\n */\n invert: function () {\n var wrapper = this;\n wrapper.inverted = true;\n wrapper.updateTransform();\n return wrapper;\n },\n\n /**\n * Private method to update the transform attribute based on internal\n * properties\n */\n updateTransform: function () {\n var wrapper = this,\n translateX = wrapper.translateX || 0,\n translateY = wrapper.translateY || 0,\n scaleX = wrapper.scaleX,\n scaleY = wrapper.scaleY,\n inverted = wrapper.inverted,\n rotation = wrapper.rotation,\n element = wrapper.element,\n transform;\n\n // flipping affects translate as adjustment for flipping around the group's axis\n if (inverted) {\n translateX += wrapper.attr('width');\n translateY += wrapper.attr('height');\n }\n\n // Apply translate. Nearly all transformed elements have translation, so instead\n // of checking for translate = 0, do it always (#1767, #1846).\n transform = ['translate(' + translateX + ',' + translateY + ')'];\n\n // apply rotation\n if (inverted) {\n transform.push('rotate(90) scale(-1,1)');\n } else if (rotation) { // text rotation\n transform.push('rotate(' + rotation + ' ' + (element.getAttribute('x') || 0) + ' ' + (element.getAttribute('y') || 0) + ')');\n }\n\n // apply scale\n if (defined(scaleX) || defined(scaleY)) {\n transform.push('scale(' + pick(scaleX, 1) + ' ' + pick(scaleY, 1) + ')');\n }\n\n if (transform.length) {\n element.setAttribute('transform', transform.join(' '));\n }\n },\n /**\n * Bring the element to the front\n */\n toFront: function () {\n var element = this.element;\n element.parentNode.appendChild(element);\n return this;\n },\n\n\n /**\n * Break down alignment options like align, verticalAlign, x and y\n * to x and y relative to the chart.\n *\n * @param {Object} alignOptions\n * @param {Boolean} alignByTranslate\n * @param {String[Object} box The box to align to, needs a width and height. When the\n * box is a string, it refers to an object in the Renderer. For example, when\n * box is 'spacingBox', it refers to Renderer.spacingBox which holds width, height\n * x and y properties.\n *\n */\n align: function (alignOptions, alignByTranslate, box) {\n var align,\n vAlign,\n x,\n y,\n attribs = {},\n alignTo,\n renderer = this.renderer,\n alignedObjects = renderer.alignedObjects;\n\n // First call on instanciate\n if (alignOptions) {\n this.alignOptions = alignOptions;\n this.alignByTranslate = alignByTranslate;\n if (!box || isString(box)) { // boxes other than renderer handle this internally\n this.alignTo = alignTo = box || 'renderer';\n erase(alignedObjects, this); // prevent duplicates, like legendGroup after resize\n alignedObjects.push(this);\n box = null; // reassign it below\n }\n\n // When called on resize, no arguments are supplied\n } else {\n alignOptions = this.alignOptions;\n alignByTranslate = this.alignByTranslate;\n alignTo = this.alignTo;\n }\n\n box = pick(box, renderer[alignTo], renderer);\n\n // Assign variables\n align = alignOptions.align;\n vAlign = alignOptions.verticalAlign;\n x = (box.x || 0) + (alignOptions.x || 0); // default: left align\n y = (box.y || 0) + (alignOptions.y || 0); // default: top align\n\n // Align\n if (align === 'right' || align === 'center') {\n x += (box.width - (alignOptions.width || 0)) /\n { right: 1, center: 2 }[align];\n }\n attribs[alignByTranslate ? 'translateX' : 'x'] = mathRound(x);\n\n\n // Vertical align\n if (vAlign === 'bottom' || vAlign === 'middle') {\n y += (box.height - (alignOptions.height || 0)) /\n ({ bottom: 1, middle: 2 }[vAlign] || 1);\n\n }\n attribs[alignByTranslate ? 'translateY' : 'y'] = mathRound(y);\n\n // Animate only if already placed\n this[this.placed ? 'animate' : 'attr'](attribs);\n this.placed = true;\n this.alignAttr = attribs;\n\n return this;\n },\n\n /**\n * Get the bounding box (width, height, x and y) for the element\n */\n getBBox: function () {\n var wrapper = this,\n bBox = wrapper.bBox,\n renderer = wrapper.renderer,\n width,\n height,\n rotation = wrapper.rotation,\n element = wrapper.element,\n styles = wrapper.styles,\n rad = rotation * deg2rad,\n textStr = wrapper.textStr,\n cacheKey;\n\n // Since numbers are monospaced, and numerical labels appear a lot in a chart,\n // we assume that a label of n characters has the same bounding box as others\n // of the same length.\n if (textStr === '' || numRegex.test(textStr)) {\n cacheKey = 'num.' + textStr.toString().length + (styles ? ('|' + styles.fontSize + '|' + styles.fontFamily) : '');\n\n } //else { // This code block made demo/waterfall fail, related to buildText\n // Caching all strings reduces rendering time by 4-5%.\n // TODO: Check how this affects places where bBox is found on the element\n //cacheKey = textStr + (styles ? ('|' + styles.fontSize + '|' + styles.fontFamily) : '');\n //}\n if (cacheKey) {\n bBox = renderer.cache[cacheKey];\n }\n\n // No cache found\n if (!bBox) {\n\n // SVG elements\n if (element.namespaceURI === SVG_NS || renderer.forExport) {\n try { // Fails in Firefox if the container has display: none.\n\n bBox = element.getBBox ?\n // SVG: use extend because IE9 is not allowed to change width and height in case\n // of rotation (below)\n extend({}, element.getBBox()) :\n // Canvas renderer and legacy IE in export mode\n {\n width: element.offsetWidth,\n height: element.offsetHeight\n };\n } catch (e) {}\n\n // If the bBox is not set, the try-catch block above failed. The other condition\n // is for Opera that returns a width of -Infinity on hidden elements.\n if (!bBox || bBox.width < 0) {\n bBox = { width: 0, height: 0 };\n }\n\n\n // VML Renderer or useHTML within SVG\n } else {\n\n bBox = wrapper.htmlGetBBox();\n\n }\n\n // True SVG elements as well as HTML elements in modern browsers using the .useHTML option\n // need to compensated for rotation\n if (renderer.isSVG) {\n width = bBox.width;\n height = bBox.height;\n\n // Workaround for wrong bounding box in IE9 and IE10 (#1101, #1505, #1669, #2568)\n if (isIE && styles && styles.fontSize === '11px' && height.toPrecision(3) === '16.9') {\n bBox.height = height = 14;\n }\n\n // Adjust for rotated text\n if (rotation) {\n bBox.width = mathAbs(height * mathSin(rad)) + mathAbs(width * mathCos(rad));\n bBox.height = mathAbs(height * mathCos(rad)) + mathAbs(width * mathSin(rad));\n }\n }\n\n // Cache it\n wrapper.bBox = bBox;\n if (cacheKey) {\n renderer.cache[cacheKey] = bBox;\n }\n }\n return bBox;\n },\n\n /**\n * Show the element\n */\n show: function (inherit) {\n // IE9-11 doesn't handle visibilty:inherit well, so we remove the attribute instead (#2881)\n if (inherit && this.element.namespaceURI === SVG_NS) {\n this.element.removeAttribute('visibility');\n } else {\n this.attr({ visibility: inherit ? 'inherit' : VISIBLE });\n }\n return this;\n },\n\n /**\n * Hide the element\n */\n hide: function () {\n return this.attr({ visibility: HIDDEN });\n },\n\n fadeOut: function (duration) {\n var elemWrapper = this;\n elemWrapper.animate({\n opacity: 0\n }, {\n duration: duration || 150,\n complete: function () {\n elemWrapper.attr({ y: -9999 }); // #3088, assuming we're only using this for tooltips\n }\n });\n },\n\n /**\n * Add the element\n * @param {Object|Undefined} parent Can be an element, an element wrapper or undefined\n * to append the element to the renderer.box.\n */\n add: function (parent) {\n\n var renderer = this.renderer,\n parentWrapper = parent || renderer,\n parentNode = parentWrapper.element || renderer.box,\n childNodes,\n element = this.element,\n zIndex = this.zIndex,\n otherElement,\n otherZIndex,\n i,\n inserted;\n\n if (parent) {\n this.parentGroup = parent;\n }\n\n // mark as inverted\n this.parentInverted = parent && parent.inverted;\n\n // build formatted text\n if (this.textStr !== undefined) {\n renderer.buildText(this);\n }\n\n // mark the container as having z indexed children\n if (zIndex) {\n parentWrapper.handleZ = true;\n zIndex = pInt(zIndex);\n }\n\n // insert according to this and other elements' zIndex\n if (parentWrapper.handleZ) { // this element or any of its siblings has a z index\n childNodes = parentNode.childNodes;\n for (i = 0; i < childNodes.length; i++) {\n otherElement = childNodes[i];\n otherZIndex = attr(otherElement, 'zIndex');\n if (otherElement !== element && (\n // insert before the first element with a higher zIndex\n pInt(otherZIndex) > zIndex ||\n // if no zIndex given, insert before the first element with a zIndex\n (!defined(zIndex) && defined(otherZIndex))\n\n )) {\n parentNode.insertBefore(element, otherElement);\n inserted = true;\n break;\n }\n }\n }\n\n // default: append at the end\n if (!inserted) {\n parentNode.appendChild(element);\n }\n\n // mark as added\n this.added = true;\n\n // fire an event for internal hooks\n if (this.onAdd) {\n this.onAdd();\n }\n\n return this;\n },\n\n /**\n * Removes a child either by removeChild or move to garbageBin.\n * Issue 490; in VML removeChild results in Orphaned nodes according to sIEve, discardElement does not.\n */\n safeRemoveChild: function (element) {\n var parentNode = element.parentNode;\n if (parentNode) {\n parentNode.removeChild(element);\n }\n },\n\n /**\n * Destroy the element and element wrapper\n */\n destroy: function () {\n var wrapper = this,\n element = wrapper.element || {},\n shadows = wrapper.shadows,\n parentToClean = wrapper.renderer.isSVG && element.nodeName === 'SPAN' && wrapper.parentGroup,\n grandParent,\n key,\n i;\n\n // remove events\n element.onclick = element.onmouseout = element.onmouseover = element.onmousemove = element.point = null;\n stop(wrapper); // stop running animations\n\n if (wrapper.clipPath) {\n wrapper.clipPath = wrapper.clipPath.destroy();\n }\n\n // Destroy stops in case this is a gradient object\n if (wrapper.stops) {\n for (i = 0; i < wrapper.stops.length; i++) {\n wrapper.stops[i] = wrapper.stops[i].destroy();\n }\n wrapper.stops = null;\n }\n\n // remove element\n wrapper.safeRemoveChild(element);\n\n // destroy shadows\n if (shadows) {\n each(shadows, function (shadow) {\n wrapper.safeRemoveChild(shadow);\n });\n }\n\n // In case of useHTML, clean up empty containers emulating SVG groups (#1960, #2393, #2697).\n while (parentToClean && parentToClean.div && parentToClean.div.childNodes.length === 0) {\n grandParent = parentToClean.parentGroup;\n wrapper.safeRemoveChild(parentToClean.div);\n delete parentToClean.div;\n parentToClean = grandParent;\n }\n\n // remove from alignObjects\n if (wrapper.alignTo) {\n erase(wrapper.renderer.alignedObjects, wrapper);\n }\n\n for (key in wrapper) {\n delete wrapper[key];\n }\n\n return null;\n },\n\n /**\n * Add a shadow to the element. Must be done after the element is added to the DOM\n * @param {Boolean|Object} shadowOptions\n */\n shadow: function (shadowOptions, group, cutOff) {\n var shadows = [],\n i,\n shadow,\n element = this.element,\n strokeWidth,\n shadowWidth,\n shadowElementOpacity,\n\n // compensate for inverted plot area\n transform;\n\n\n if (shadowOptions) {\n shadowWidth = pick(shadowOptions.width, 3);\n shadowElementOpacity = (shadowOptions.opacity || 0.15) / shadowWidth;\n transform = this.parentInverted ?\n '(-1,-1)' :\n '(' + pick(shadowOptions.offsetX, 1) + ', ' + pick(shadowOptions.offsetY, 1) + ')';\n for (i = 1; i <= shadowWidth; i++) {\n shadow = element.cloneNode(0);\n strokeWidth = (shadowWidth * 2) + 1 - (2 * i);\n attr(shadow, {\n 'isShadow': 'true',\n 'stroke': shadowOptions.color || 'black',\n 'stroke-opacity': shadowElementOpacity * i,\n 'stroke-width': strokeWidth,\n 'transform': 'translate' + transform,\n 'fill': NONE\n });\n if (cutOff) {\n attr(shadow, 'height', mathMax(attr(shadow, 'height') - strokeWidth, 0));\n shadow.cutHeight = strokeWidth;\n }\n\n if (group) {\n group.element.appendChild(shadow);\n } else {\n element.parentNode.insertBefore(shadow, element);\n }\n\n shadows.push(shadow);\n }\n\n this.shadows = shadows;\n }\n return this;\n\n },\n\n xGetter: function (key) {\n if (this.element.nodeName === 'circle') {\n key = { x: 'cx', y: 'cy' }[key] || key;\n }\n return this._defaultGetter(key);\n },\n\n /**\n * Get the current value of an attribute or pseudo attribute, used mainly\n * for animation.\n */\n _defaultGetter: function (key) {\n var ret = pick(this[key], this.element ? this.element.getAttribute(key) : null, 0);\n\n if (/^[\\-0-9\\.]+$/.test(ret)) { // is numerical\n ret = parseFloat(ret);\n }\n return ret;\n },\n\n\n dSetter: function (value, key, element) {\n if (value && value.join) { // join path\n value = value.join(' ');\n }\n if (/(NaN| {2}|^$)/.test(value)) {\n value = 'M 0 0';\n }\n element.setAttribute(key, value);\n\n this[key] = value;\n },\n dashstyleSetter: function (value) {\n var i;\n value = value && value.toLowerCase();\n if (value) {\n value = value\n .replace('shortdashdotdot', '3,1,1,1,1,1,')\n .replace('shortdashdot', '3,1,1,1')\n .replace('shortdot', '1,1,')\n .replace('shortdash', '3,1,')\n .replace('longdash', '8,3,')\n .replace(/dot/g, '1,3,')\n .replace('dash', '4,3,')\n .replace(/,$/, '')\n .split(','); // ending comma\n\n i = value.length;\n while (i--) {\n value[i] = pInt(value[i]) * this['stroke-width'];\n }\n value = value.join(',')\n .replace('NaN', 'none'); // #3226\n this.element.setAttribute('stroke-dasharray', value);\n }\n },\n alignSetter: function (value) {\n this.element.setAttribute('text-anchor', { left: 'start', center: 'middle', right: 'end' }[value]);\n },\n opacitySetter: function (value, key, element) {\n this[key] = value;\n element.setAttribute(key, value);\n },\n titleSetter: function (value) {\n var titleNode = this.element.getElementsByTagName('title')[0];\n if (!titleNode) {\n titleNode = doc.createElementNS(SVG_NS, 'title');\n this.element.appendChild(titleNode);\n }\n titleNode.textContent = pick(value, '').replace(/<[^>]*>/g, ''); // #3276\n },\n textSetter: function (value) {\n if (value !== this.textStr) {\n // Delete bBox memo when the text changes\n delete this.bBox;\n\n this.textStr = value;\n if (this.added) {\n this.renderer.buildText(this);\n }\n }\n },\n fillSetter: function (value, key, element) {\n if (typeof value === 'string') {\n element.setAttribute(key, value);\n } else if (value) {\n this.colorGradient(value, key, element);\n }\n },\n zIndexSetter: function (value, key, element) {\n element.setAttribute(key, value);\n this[key] = value;\n },\n _defaultSetter: function (value, key, element) {\n element.setAttribute(key, value);\n }\n };\n\n// Some shared setters and getters\n SVGElement.prototype.yGetter = SVGElement.prototype.xGetter;\n SVGElement.prototype.translateXSetter = SVGElement.prototype.translateYSetter =\n SVGElement.prototype.rotationSetter = SVGElement.prototype.verticalAlignSetter =\n SVGElement.prototype.scaleXSetter = SVGElement.prototype.scaleYSetter = function (value, key) {\n this[key] = value;\n this.doTransform = true;\n };\n\n// WebKit and Batik have problems with a stroke-width of zero, so in this case we remove the\n// stroke attribute altogether. #1270, #1369, #3065, #3072.\n SVGElement.prototype['stroke-widthSetter'] = SVGElement.prototype.strokeSetter = function (value, key, element) {\n this[key] = value;\n // Only apply the stroke attribute if the stroke width is defined and larger than 0\n if (this.stroke && this['stroke-width']) {\n this.strokeWidth = this['stroke-width'];\n SVGElement.prototype.fillSetter.call(this, this.stroke, 'stroke', element); // use prototype as instance may be overridden\n element.setAttribute('stroke-width', this['stroke-width']);\n this.hasStroke = true;\n } else if (key === 'stroke-width' && value === 0 && this.hasStroke) {\n element.removeAttribute('stroke');\n this.hasStroke = false;\n }\n };\n\n\n /**\n * The default SVG renderer\n */\n var SVGRenderer = function () {\n this.init.apply(this, arguments);\n };\n SVGRenderer.prototype = {\n Element: SVGElement,\n\n /**\n * Initialize the SVGRenderer\n * @param {Object} container\n * @param {Number} width\n * @param {Number} height\n * @param {Boolean} forExport\n */\n init: function (container, width, height, style, forExport) {\n var renderer = this,\n loc = location,\n boxWrapper,\n element,\n desc;\n\n boxWrapper = renderer.createElement('svg')\n .attr({\n version: '1.1'\n })\n .css(this.getStyle(style));\n element = boxWrapper.element;\n container.appendChild(element);\n\n // For browsers other than IE, add the namespace attribute (#1978)\n if (container.innerHTML.indexOf('xmlns') === -1) {\n attr(element, 'xmlns', SVG_NS);\n }\n\n // object properties\n renderer.isSVG = true;\n renderer.box = element;\n renderer.boxWrapper = boxWrapper;\n renderer.alignedObjects = [];\n\n // Page url used for internal references. #24, #672, #1070\n renderer.url = (isFirefox || isWebKit) && doc.getElementsByTagName('base').length ?\n loc.href\n .replace(/#.*?$/, '') // remove the hash\n .replace(/([\\('\\)])/g, '\\\\$1') // escape parantheses and quotes\n .replace(/ /g, '%20') : // replace spaces (needed for Safari only)\n '';\n\n // Add description\n desc = this.createElement('desc').add();\n desc.element.appendChild(doc.createTextNode('Created with ' + PRODUCT + ' ' + VERSION));\n\n\n renderer.defs = this.createElement('defs').add();\n renderer.forExport = forExport;\n renderer.gradients = {}; // Object where gradient SvgElements are stored\n renderer.cache = {}; // Cache for numerical bounding boxes\n\n renderer.setSize(width, height, false);\n\n\n\n // Issue 110 workaround:\n // In Firefox, if a div is positioned by percentage, its pixel position may land\n // between pixels. The container itself doesn't display this, but an SVG element\n // inside this container will be drawn at subpixel precision. In order to draw\n // sharp lines, this must be compensated for. This doesn't seem to work inside\n // iframes though (like in jsFiddle).\n var subPixelFix, rect;\n if (isFirefox && container.getBoundingClientRect) {\n renderer.subPixelFix = subPixelFix = function () {\n css(container, { left: 0, top: 0 });\n rect = container.getBoundingClientRect();\n css(container, {\n left: (mathCeil(rect.left) - rect.left) + PX,\n top: (mathCeil(rect.top) - rect.top) + PX\n });\n };\n\n // run the fix now\n subPixelFix();\n\n // run it on resize\n addEvent(win, 'resize', subPixelFix);\n }\n },\n\n getStyle: function (style) {\n return (this.style = extend({\n fontFamily: '\"Lucida Grande\", \"Lucida Sans Unicode\", Arial, Helvetica, sans-serif', // default font\n fontSize: '12px'\n }, style));\n },\n\n /**\n * Detect whether the renderer is hidden. This happens when one of the parent elements\n * has display: none. #608.\n */\n isHidden: function () {\n return !this.boxWrapper.getBBox().width;\n },\n\n /**\n * Destroys the renderer and its allocated members.\n */\n destroy: function () {\n var renderer = this,\n rendererDefs = renderer.defs;\n renderer.box = null;\n renderer.boxWrapper = renderer.boxWrapper.destroy();\n\n // Call destroy on all gradient elements\n destroyObjectProperties(renderer.gradients || {});\n renderer.gradients = null;\n\n // Defs are null in VMLRenderer\n // Otherwise, destroy them here.\n if (rendererDefs) {\n renderer.defs = rendererDefs.destroy();\n }\n\n // Remove sub pixel fix handler\n // We need to check that there is a handler, otherwise all functions that are registered for event 'resize' are removed\n // See issue #982\n if (renderer.subPixelFix) {\n removeEvent(win, 'resize', renderer.subPixelFix);\n }\n\n renderer.alignedObjects = null;\n\n return null;\n },\n\n /**\n * Create a wrapper for an SVG element\n * @param {Object} nodeName\n */\n createElement: function (nodeName) {\n var wrapper = new this.Element();\n wrapper.init(this, nodeName);\n return wrapper;\n },\n\n /**\n * Dummy function for use in canvas renderer\n */\n draw: function () {},\n\n /**\n * Parse a simple HTML string into SVG tspans\n *\n * @param {Object} textNode The parent text SVG node\n */\n buildText: function (wrapper) {\n var textNode = wrapper.element,\n renderer = this,\n forExport = renderer.forExport,\n textStr = pick(wrapper.textStr, '').toString(),\n hasMarkup = textStr.indexOf('<') !== -1,\n lines,\n childNodes = textNode.childNodes,\n styleRegex,\n hrefRegex,\n parentX = attr(textNode, 'x'),\n textStyles = wrapper.styles,\n width = wrapper.textWidth,\n textLineHeight = textStyles && textStyles.lineHeight,\n textStroke = textStyles && textStyles.HcTextStroke,\n i = childNodes.length,\n getLineHeight = function (tspan) {\n return textLineHeight ?\n pInt(textLineHeight) :\n renderer.fontMetrics(\n /(px|em)$/.test(tspan && tspan.style.fontSize) ?\n tspan.style.fontSize :\n ((textStyles && textStyles.fontSize) || renderer.style.fontSize || 12),\n tspan\n ).h;\n };\n\n /// remove old text\n while (i--) {\n textNode.removeChild(childNodes[i]);\n }\n\n // Skip tspans, add text directly to text node. The forceTSpan is a hook\n // used in text outline hack.\n if (!hasMarkup && !textStroke && textStr.indexOf(' ') === -1) {\n textNode.appendChild(doc.createTextNode(textStr));\n return;\n\n // Complex strings, add more logic\n } else {\n\n styleRegex = /<.*style=\"([^\"]+)\".*>/;\n hrefRegex = /<.*href=\"(http[^\"]+)\".*>/;\n\n if (width && !wrapper.added) {\n this.box.appendChild(textNode); // attach it to the DOM to read offset width\n }\n\n if (hasMarkup) {\n lines = textStr\n .replace(/<(b|strong)>/g, '<span style=\"font-weight:bold\">')\n .replace(/<(i|em)>/g, '<span style=\"font-style:italic\">')\n .replace(/<a/g, '<span')\n .replace(/<\\/(b|strong|i|em|a)>/g, '</span>')\n .split(/<br.*?>/g);\n\n } else {\n lines = [textStr];\n }\n\n\n // remove empty line at end\n if (lines[lines.length - 1] === '') {\n lines.pop();\n }\n\n\n // build the lines\n each(lines, function (line, lineNo) {\n var spans, spanNo = 0;\n\n line = line.replace(/<span/g, '|||<span').replace(/<\\/span>/g, '</span>|||');\n spans = line.split('|||');\n\n each(spans, function (span) {\n if (span !== '' || spans.length === 1) {\n var attributes = {},\n tspan = doc.createElementNS(SVG_NS, 'tspan'),\n spanStyle; // #390\n if (styleRegex.test(span)) {\n spanStyle = span.match(styleRegex)[1].replace(/(;| |^)color([ :])/, '$1fill$2');\n attr(tspan, 'style', spanStyle);\n }\n if (hrefRegex.test(span) && !forExport) { // Not for export - #1529\n attr(tspan, 'onclick', 'location.href=\\\"' + span.match(hrefRegex)[1] + '\\\"');\n css(tspan, { cursor: 'pointer' });\n }\n\n span = (span.replace(/<(.|\\n)*?>/g, '') || ' ')\n .replace(/</g, '<')\n .replace(/>/g, '>');\n\n // Nested tags aren't supported, and cause crash in Safari (#1596)\n if (span !== ' ') {\n\n // add the text node\n tspan.appendChild(doc.createTextNode(span));\n\n if (!spanNo) { // first span in a line, align it to the left\n if (lineNo && parentX !== null) {\n attributes.x = parentX;\n }\n } else {\n attributes.dx = 0; // #16\n }\n\n // add attributes\n attr(tspan, attributes);\n\n // Append it\n textNode.appendChild(tspan);\n\n // first span on subsequent line, add the line height\n if (!spanNo && lineNo) {\n\n // allow getting the right offset height in exporting in IE\n if (!hasSVG && forExport) {\n css(tspan, { display: 'block' });\n }\n\n // Set the line height based on the font size of either\n // the text element or the tspan element\n attr(\n tspan,\n 'dy',\n getLineHeight(tspan)\n );\n }\n\n // check width and apply soft breaks\n if (width) {\n var words = span.replace(/([^\\^])-/g, '$1- ').split(' '), // #1273\n hasWhiteSpace = spans.length > 1 || (words.length > 1 && textStyles.whiteSpace !== 'nowrap'),\n tooLong,\n actualWidth,\n hcHeight = textStyles.HcHeight,\n rest = [],\n dy = getLineHeight(tspan),\n softLineNo = 1,\n bBox;\n\n while (hasWhiteSpace && (words.length || rest.length)) {\n delete wrapper.bBox; // delete cache\n bBox = wrapper.getBBox();\n actualWidth = bBox.width;\n\n // Old IE cannot measure the actualWidth for SVG elements (#2314)\n if (!hasSVG && renderer.forExport) {\n actualWidth = renderer.measureSpanWidth(tspan.firstChild.data, wrapper.styles);\n }\n\n tooLong = actualWidth > width;\n if (!tooLong || words.length === 1) { // new line needed\n words = rest;\n rest = [];\n if (words.length) {\n softLineNo++;\n if (hcHeight && softLineNo * dy > hcHeight) {\n words = ['...'];\n wrapper.attr('title', wrapper.textStr);\n } else {\n\n tspan = doc.createElementNS(SVG_NS, 'tspan');\n attr(tspan, {\n dy: dy,\n x: parentX\n });\n if (spanStyle) { // #390\n attr(tspan, 'style', spanStyle);\n }\n textNode.appendChild(tspan);\n }\n }\n if (actualWidth > width) { // a single word is pressing it out\n width = actualWidth;\n }\n } else { // append to existing line tspan\n tspan.removeChild(tspan.firstChild);\n rest.unshift(words.pop());\n }\n if (words.length) {\n tspan.appendChild(doc.createTextNode(words.join(' ').replace(/- /g, '-')));\n }\n }\n }\n\n spanNo++;\n }\n }\n });\n });\n }\n },\n\n /**\n * Create a button with preset states\n * @param {String} text\n * @param {Number} x\n * @param {Number} y\n * @param {Function} callback\n * @param {Object} normalState\n * @param {Object} hoverState\n * @param {Object} pressedState\n */\n button: function (text, x, y, callback, normalState, hoverState, pressedState, disabledState, shape) {\n var label = this.label(text, x, y, shape, null, null, null, null, 'button'),\n curState = 0,\n stateOptions,\n stateStyle,\n normalStyle,\n hoverStyle,\n pressedStyle,\n disabledStyle,\n verticalGradient = { x1: 0, y1: 0, x2: 0, y2: 1 };\n\n // Normal state - prepare the attributes\n normalState = merge({\n 'stroke-width': 1,\n stroke: '#CCCCCC',\n fill: {\n linearGradient: verticalGradient,\n stops: [\n [0, '#FEFEFE'],\n [1, '#F6F6F6']\n ]\n },\n r: 2,\n padding: 5,\n style: {\n color: 'black'\n }\n }, normalState);\n normalStyle = normalState.style;\n delete normalState.style;\n\n // Hover state\n hoverState = merge(normalState, {\n stroke: '#68A',\n fill: {\n linearGradient: verticalGradient,\n stops: [\n [0, '#FFF'],\n [1, '#ACF']\n ]\n }\n }, hoverState);\n hoverStyle = hoverState.style;\n delete hoverState.style;\n\n // Pressed state\n pressedState = merge(normalState, {\n stroke: '#68A',\n fill: {\n linearGradient: verticalGradient,\n stops: [\n [0, '#9BD'],\n [1, '#CDF']\n ]\n }\n }, pressedState);\n pressedStyle = pressedState.style;\n delete pressedState.style;\n\n // Disabled state\n disabledState = merge(normalState, {\n style: {\n color: '#CCC'\n }\n }, disabledState);\n disabledStyle = disabledState.style;\n delete disabledState.style;\n\n // Add the events. IE9 and IE10 need mouseover and mouseout to funciton (#667).\n addEvent(label.element, isIE ? 'mouseover' : 'mouseenter', function () {\n if (curState !== 3) {\n label.attr(hoverState)\n .css(hoverStyle);\n }\n });\n addEvent(label.element, isIE ? 'mouseout' : 'mouseleave', function () {\n if (curState !== 3) {\n stateOptions = [normalState, hoverState, pressedState][curState];\n stateStyle = [normalStyle, hoverStyle, pressedStyle][curState];\n label.attr(stateOptions)\n .css(stateStyle);\n }\n });\n\n label.setState = function (state) {\n label.state = curState = state;\n if (!state) {\n label.attr(normalState)\n .css(normalStyle);\n } else if (state === 2) {\n label.attr(pressedState)\n .css(pressedStyle);\n } else if (state === 3) {\n label.attr(disabledState)\n .css(disabledStyle);\n }\n };\n\n return label\n .on('click', function () {\n if (curState !== 3) {\n callback.call(label);\n }\n })\n .attr(normalState)\n .css(extend({ cursor: 'default' }, normalStyle));\n },\n\n /**\n * Make a straight line crisper by not spilling out to neighbour pixels\n * @param {Array} points\n * @param {Number} width\n */\n crispLine: function (points, width) {\n // points format: [M, 0, 0, L, 100, 0]\n // normalize to a crisp line\n if (points[1] === points[4]) {\n // Substract due to #1129. Now bottom and left axis gridlines behave the same.\n points[1] = points[4] = mathRound(points[1]) - (width % 2 / 2);\n }\n if (points[2] === points[5]) {\n points[2] = points[5] = mathRound(points[2]) + (width % 2 / 2);\n }\n return points;\n },\n\n\n /**\n * Draw a path\n * @param {Array} path An SVG path in array form\n */\n path: function (path) {\n var attr = {\n fill: NONE\n };\n if (isArray(path)) {\n attr.d = path;\n } else if (isObject(path)) { // attributes\n extend(attr, path);\n }\n return this.createElement('path').attr(attr);\n },\n\n /**\n * Draw and return an SVG circle\n * @param {Number} x The x position\n * @param {Number} y The y position\n * @param {Number} r The radius\n */\n circle: function (x, y, r) {\n var attr = isObject(x) ?\n x :\n {\n x: x,\n y: y,\n r: r\n },\n wrapper = this.createElement('circle');\n\n wrapper.xSetter = function (value) {\n this.element.setAttribute('cx', value);\n };\n wrapper.ySetter = function (value) {\n this.element.setAttribute('cy', value);\n };\n return wrapper.attr(attr);\n },\n\n /**\n * Draw and return an arc\n * @param {Number} x X position\n * @param {Number} y Y position\n * @param {Number} r Radius\n * @param {Number} innerR Inner radius like used in donut charts\n * @param {Number} start Starting angle\n * @param {Number} end Ending angle\n */\n arc: function (x, y, r, innerR, start, end) {\n var arc;\n\n if (isObject(x)) {\n y = x.y;\n r = x.r;\n innerR = x.innerR;\n start = x.start;\n end = x.end;\n x = x.x;\n }\n\n // Arcs are defined as symbols for the ability to set\n // attributes in attr and animate\n arc = this.symbol('arc', x || 0, y || 0, r || 0, r || 0, {\n innerR: innerR || 0,\n start: start || 0,\n end: end || 0\n });\n arc.r = r; // #959\n return arc;\n },\n\n /**\n * Draw and return a rectangle\n * @param {Number} x Left position\n * @param {Number} y Top position\n * @param {Number} width\n * @param {Number} height\n * @param {Number} r Border corner radius\n * @param {Number} strokeWidth A stroke width can be supplied to allow crisp drawing\n */\n rect: function (x, y, width, height, r, strokeWidth) {\n\n r = isObject(x) ? x.r : r;\n\n var wrapper = this.createElement('rect'),\n attribs = isObject(x) ? x : x === UNDEFINED ? {} : {\n x: x,\n y: y,\n width: mathMax(width, 0),\n height: mathMax(height, 0)\n };\n\n if (strokeWidth !== UNDEFINED) {\n attribs.strokeWidth = strokeWidth;\n attribs = wrapper.crisp(attribs);\n }\n\n if (r) {\n attribs.r = r;\n }\n\n wrapper.rSetter = function (value) {\n attr(this.element, {\n rx: value,\n ry: value\n });\n };\n\n return wrapper.attr(attribs);\n },\n\n /**\n * Resize the box and re-align all aligned elements\n * @param {Object} width\n * @param {Object} height\n * @param {Boolean} animate\n *\n */\n setSize: function (width, height, animate) {\n var renderer = this,\n alignedObjects = renderer.alignedObjects,\n i = alignedObjects.length;\n\n renderer.width = width;\n renderer.height = height;\n\n renderer.boxWrapper[pick(animate, true) ? 'animate' : 'attr']({\n width: width,\n height: height\n });\n\n while (i--) {\n alignedObjects[i].align();\n }\n },\n\n /**\n * Create a group\n * @param {String} name The group will be given a class name of 'highcharts-{name}'.\n * This can be used for styling and scripting.\n */\n g: function (name) {\n var elem = this.createElement('g');\n return defined(name) ? elem.attr({ 'class': PREFIX + name }) : elem;\n },\n\n /**\n * Display an image\n * @param {String} src\n * @param {Number} x\n * @param {Number} y\n * @param {Number} width\n * @param {Number} height\n */\n image: function (src, x, y, width, height) {\n var attribs = {\n preserveAspectRatio: NONE\n },\n elemWrapper;\n\n // optional properties\n if (arguments.length > 1) {\n extend(attribs, {\n x: x,\n y: y,\n width: width,\n height: height\n });\n }\n\n elemWrapper = this.createElement('image').attr(attribs);\n\n // set the href in the xlink namespace\n if (elemWrapper.element.setAttributeNS) {\n elemWrapper.element.setAttributeNS('http://www.w3.org/1999/xlink',\n 'href', src);\n } else {\n // could be exporting in IE\n // using href throws \"not supported\" in ie7 and under, requries regex shim to fix later\n elemWrapper.element.setAttribute('hc-svg-href', src);\n }\n return elemWrapper;\n },\n\n /**\n * Draw a symbol out of pre-defined shape paths from the namespace 'symbol' object.\n *\n * @param {Object} symbol\n * @param {Object} x\n * @param {Object} y\n * @param {Object} radius\n * @param {Object} options\n */\n symbol: function (symbol, x, y, width, height, options) {\n\n var obj,\n\n // get the symbol definition function\n symbolFn = this.symbols[symbol],\n\n // check if there's a path defined for this symbol\n path = symbolFn && symbolFn(\n mathRound(x),\n mathRound(y),\n width,\n height,\n options\n ),\n\n imageElement,\n imageRegex = /^url\\((.*?)\\)$/,\n imageSrc,\n imageSize,\n centerImage;\n\n if (path) {\n\n obj = this.path(path);\n // expando properties for use in animate and attr\n extend(obj, {\n symbolName: symbol,\n x: x,\n y: y,\n width: width,\n height: height\n });\n if (options) {\n extend(obj, options);\n }\n\n\n // image symbols\n } else if (imageRegex.test(symbol)) {\n\n // On image load, set the size and position\n centerImage = function (img, size) {\n if (img.element) { // it may be destroyed in the meantime (#1390)\n img.attr({\n width: size[0],\n height: size[1]\n });\n\n if (!img.alignByTranslate) { // #185\n img.translate(\n mathRound((width - size[0]) / 2), // #1378\n mathRound((height - size[1]) / 2)\n );\n }\n }\n };\n\n imageSrc = symbol.match(imageRegex)[1];\n imageSize = symbolSizes[imageSrc] || (options && options.width && options.height && [options.width, options.height]);\n\n // Ireate the image synchronously, add attribs async\n obj = this.image(imageSrc)\n .attr({\n x: x,\n y: y\n });\n obj.isImg = true;\n\n if (imageSize) {\n centerImage(obj, imageSize);\n } else {\n // Initialize image to be 0 size so export will still function if there's no cached sizes.\n obj.attr({ width: 0, height: 0 });\n\n // Create a dummy JavaScript image to get the width and height. Due to a bug in IE < 8,\n // the created element must be assigned to a variable in order to load (#292).\n imageElement = createElement('img', {\n onload: function () {\n centerImage(obj, symbolSizes[imageSrc] = [this.width, this.height]);\n },\n src: imageSrc\n });\n }\n }\n\n return obj;\n },\n\n /**\n * An extendable collection of functions for defining symbol paths.\n */\n symbols: {\n 'circle': function (x, y, w, h) {\n var cpw = 0.166 * w;\n return [\n M, x + w / 2, y,\n 'C', x + w + cpw, y, x + w + cpw, y + h, x + w / 2, y + h,\n 'C', x - cpw, y + h, x - cpw, y, x + w / 2, y,\n 'Z'\n ];\n },\n\n 'square': function (x, y, w, h) {\n return [\n M, x, y,\n L, x + w, y,\n x + w, y + h,\n x, y + h,\n 'Z'\n ];\n },\n\n 'triangle': function (x, y, w, h) {\n return [\n M, x + w / 2, y,\n L, x + w, y + h,\n x, y + h,\n 'Z'\n ];\n },\n\n 'triangle-down': function (x, y, w, h) {\n return [\n M, x, y,\n L, x + w, y,\n x + w / 2, y + h,\n 'Z'\n ];\n },\n 'diamond': function (x, y, w, h) {\n return [\n M, x + w / 2, y,\n L, x + w, y + h / 2,\n x + w / 2, y + h,\n x, y + h / 2,\n 'Z'\n ];\n },\n 'arc': function (x, y, w, h, options) {\n var start = options.start,\n radius = options.r || w || h,\n end = options.end - 0.001, // to prevent cos and sin of start and end from becoming equal on 360 arcs (related: #1561)\n innerRadius = options.innerR,\n open = options.open,\n cosStart = mathCos(start),\n sinStart = mathSin(start),\n cosEnd = mathCos(end),\n sinEnd = mathSin(end),\n longArc = options.end - start < mathPI ? 0 : 1;\n\n return [\n M,\n x + radius * cosStart,\n y + radius * sinStart,\n 'A', // arcTo\n radius, // x radius\n radius, // y radius\n 0, // slanting\n longArc, // long or short arc\n 1, // clockwise\n x + radius * cosEnd,\n y + radius * sinEnd,\n open ? M : L,\n x + innerRadius * cosEnd,\n y + innerRadius * sinEnd,\n 'A', // arcTo\n innerRadius, // x radius\n innerRadius, // y radius\n 0, // slanting\n longArc, // long or short arc\n 0, // clockwise\n x + innerRadius * cosStart,\n y + innerRadius * sinStart,\n\n open ? '' : 'Z' // close\n ];\n },\n\n /**\n * Callout shape used for default tooltips, also used for rounded rectangles in VML\n */\n callout: function (x, y, w, h, options) {\n var arrowLength = 6,\n halfDistance = 6,\n r = mathMin((options && options.r) || 0, w, h),\n safeDistance = r + halfDistance,\n anchorX = options && options.anchorX,\n anchorY = options && options.anchorY,\n path,\n normalizer = mathRound(options.strokeWidth || 0) % 2 / 2; // mathRound because strokeWidth can sometimes have roundoff errors;\n\n x += normalizer;\n y += normalizer;\n path = [\n 'M', x + r, y,\n 'L', x + w - r, y, // top side\n 'C', x + w, y, x + w, y, x + w, y + r, // top-right corner\n 'L', x + w, y + h - r, // right side\n 'C', x + w, y + h, x + w, y + h, x + w - r, y + h, // bottom-right corner\n 'L', x + r, y + h, // bottom side\n 'C', x, y + h, x, y + h, x, y + h - r, // bottom-left corner\n 'L', x, y + r, // left side\n 'C', x, y, x, y, x + r, y // top-right corner\n ];\n\n if (anchorX && anchorX > w && anchorY > y + safeDistance && anchorY < y + h - safeDistance) { // replace right side\n path.splice(13, 3,\n 'L', x + w, anchorY - halfDistance,\n x + w + arrowLength, anchorY,\n x + w, anchorY + halfDistance,\n x + w, y + h - r\n );\n } else if (anchorX && anchorX < 0 && anchorY > y + safeDistance && anchorY < y + h - safeDistance) { // replace left side\n path.splice(33, 3,\n 'L', x, anchorY + halfDistance,\n x - arrowLength, anchorY,\n x, anchorY - halfDistance,\n x, y + r\n );\n } else if (anchorY && anchorY > h && anchorX > x + safeDistance && anchorX < x + w - safeDistance) { // replace bottom\n path.splice(23, 3,\n 'L', anchorX + halfDistance, y + h,\n anchorX, y + h + arrowLength,\n anchorX - halfDistance, y + h,\n x + r, y + h\n );\n } else if (anchorY && anchorY < 0 && anchorX > x + safeDistance && anchorX < x + w - safeDistance) { // replace top\n path.splice(3, 3,\n 'L', anchorX - halfDistance, y,\n anchorX, y - arrowLength,\n anchorX + halfDistance, y,\n w - r, y\n );\n }\n return path;\n }\n },\n\n /**\n * Define a clipping rectangle\n * @param {String} id\n * @param {Number} x\n * @param {Number} y\n * @param {Number} width\n * @param {Number} height\n */\n clipRect: function (x, y, width, height) {\n var wrapper,\n id = PREFIX + idCounter++,\n\n clipPath = this.createElement('clipPath').attr({\n id: id\n }).add(this.defs);\n\n wrapper = this.rect(x, y, width, height, 0).add(clipPath);\n wrapper.id = id;\n wrapper.clipPath = clipPath;\n\n return wrapper;\n },\n\n\n\n\n\n /**\n * Add text to the SVG object\n * @param {String} str\n * @param {Number} x Left position\n * @param {Number} y Top position\n * @param {Boolean} useHTML Use HTML to render the text\n */\n text: function (str, x, y, useHTML) {\n\n // declare variables\n var renderer = this,\n fakeSVG = useCanVG || (!hasSVG && renderer.forExport),\n wrapper,\n attr = {};\n\n if (useHTML && !renderer.forExport) {\n return renderer.html(str, x, y);\n }\n\n attr.x = Math.round(x || 0); // X is always needed for line-wrap logic\n if (y) {\n attr.y = Math.round(y);\n }\n if (str || str === 0) {\n attr.text = str;\n }\n\n wrapper = renderer.createElement('text')\n .attr(attr);\n\n // Prevent wrapping from creating false offsetWidths in export in legacy IE (#1079, #1063)\n if (fakeSVG) {\n wrapper.css({\n position: ABSOLUTE\n });\n }\n\n if (!useHTML) {\n wrapper.xSetter = function (value, key, element) {\n var tspans = element.getElementsByTagName('tspan'),\n tspan,\n parentVal = element.getAttribute(key),\n i;\n for (i = 0; i < tspans.length; i++) {\n tspan = tspans[i];\n // If the x values are equal, the tspan represents a linebreak\n if (tspan.getAttribute(key) === parentVal) {\n tspan.setAttribute(key, value);\n }\n }\n element.setAttribute(key, value);\n };\n }\n\n return wrapper;\n },\n\n /**\n * Utility to return the baseline offset and total line height from the font size\n */\n fontMetrics: function (fontSize, elem) {\n fontSize = fontSize || this.style.fontSize;\n if (elem && win.getComputedStyle) {\n elem = elem.element || elem; // SVGElement\n fontSize = win.getComputedStyle(elem, \"\").fontSize;\n }\n fontSize = /px/.test(fontSize) ? pInt(fontSize) : /em/.test(fontSize) ? parseFloat(fontSize) * 12 : 12;\n\n // Empirical values found by comparing font size and bounding box height.\n // Applies to the default font family. http://jsfiddle.net/highcharts/7xvn7/\n var lineHeight = fontSize < 24 ? fontSize + 4 : mathRound(fontSize * 1.2),\n baseline = mathRound(lineHeight * 0.8);\n\n return {\n h: lineHeight,\n b: baseline,\n f: fontSize\n };\n },\n\n /**\n * Add a label, a text item that can hold a colored or gradient background\n * as well as a border and shadow.\n * @param {string} str\n * @param {Number} x\n * @param {Number} y\n * @param {String} shape\n * @param {Number} anchorX In case the shape has a pointer, like a flag, this is the\n * coordinates it should be pinned to\n * @param {Number} anchorY\n * @param {Boolean} baseline Whether to position the label relative to the text baseline,\n * like renderer.text, or to the upper border of the rectangle.\n * @param {String} className Class name for the group\n */\n label: function (str, x, y, shape, anchorX, anchorY, useHTML, baseline, className) {\n\n var renderer = this,\n wrapper = renderer.g(className),\n text = renderer.text('', 0, 0, useHTML)\n .attr({\n zIndex: 1\n }),\n //.add(wrapper),\n box,\n bBox,\n alignFactor = 0,\n padding = 3,\n paddingLeft = 0,\n width,\n height,\n wrapperX,\n wrapperY,\n crispAdjust = 0,\n deferredAttr = {},\n baselineOffset,\n needsBox;\n\n /**\n * This function runs after the label is added to the DOM (when the bounding box is\n * available), and after the text of the label is updated to detect the new bounding\n * box and reflect it in the border box.\n */\n function updateBoxSize() {\n var boxX,\n boxY,\n style = text.element.style;\n\n bBox = (width === undefined || height === undefined || wrapper.styles.textAlign) && text.textStr &&\n text.getBBox();\n wrapper.width = (width || bBox.width || 0) + 2 * padding + paddingLeft;\n wrapper.height = (height || bBox.height || 0) + 2 * padding;\n\n // update the label-scoped y offset\n baselineOffset = padding + renderer.fontMetrics(style && style.fontSize, text).b;\n\n\n if (needsBox) {\n\n // create the border box if it is not already present\n if (!box) {\n boxX = mathRound(-alignFactor * padding);\n boxY = baseline ? -baselineOffset : 0;\n\n wrapper.box = box = shape ?\n renderer.symbol(shape, boxX, boxY, wrapper.width, wrapper.height, deferredAttr) :\n renderer.rect(boxX, boxY, wrapper.width, wrapper.height, 0, deferredAttr[STROKE_WIDTH]);\n box.attr('fill', NONE).add(wrapper);\n }\n\n // apply the box attributes\n if (!box.isImg) { // #1630\n box.attr(extend({\n width: mathRound(wrapper.width),\n height: mathRound(wrapper.height)\n }, deferredAttr));\n }\n deferredAttr = null;\n }\n }\n\n /**\n * This function runs after setting text or padding, but only if padding is changed\n */\n function updateTextPadding() {\n var styles = wrapper.styles,\n textAlign = styles && styles.textAlign,\n x = paddingLeft + padding * (1 - alignFactor),\n y;\n\n // determin y based on the baseline\n y = baseline ? 0 : baselineOffset;\n\n // compensate for alignment\n if (defined(width) && bBox && (textAlign === 'center' || textAlign === 'right')) {\n x += { center: 0.5, right: 1 }[textAlign] * (width - bBox.width);\n }\n\n // update if anything changed\n if (x !== text.x || y !== text.y) {\n text.attr('x', x);\n if (y !== UNDEFINED) {\n text.attr('y', y);\n }\n }\n\n // record current values\n text.x = x;\n text.y = y;\n }\n\n /**\n * Set a box attribute, or defer it if the box is not yet created\n * @param {Object} key\n * @param {Object} value\n */\n function boxAttr(key, value) {\n if (box) {\n box.attr(key, value);\n } else {\n deferredAttr[key] = value;\n }\n }\n\n /**\n * After the text element is added, get the desired size of the border box\n * and add it before the text in the DOM.\n */\n wrapper.onAdd = function () {\n text.add(wrapper);\n wrapper.attr({\n text: (str || str === 0) ? str : '', // alignment is available now // #3295: 0 not rendered if given as a value\n x: x,\n y: y\n });\n\n if (box && defined(anchorX)) {\n wrapper.attr({\n anchorX: anchorX,\n anchorY: anchorY\n });\n }\n };\n\n /*\n * Add specific attribute setters.\n */\n\n // only change local variables\n wrapper.widthSetter = function (value) {\n width = value;\n };\n wrapper.heightSetter = function (value) {\n height = value;\n };\n wrapper.paddingSetter = function (value) {\n if (defined(value) && value !== padding) {\n padding = value;\n updateTextPadding();\n }\n };\n wrapper.paddingLeftSetter = function (value) {\n if (defined(value) && value !== paddingLeft) {\n paddingLeft = value;\n updateTextPadding();\n }\n };\n\n\n // change local variable and prevent setting attribute on the group\n wrapper.alignSetter = function (value) {\n alignFactor = { left: 0, center: 0.5, right: 1 }[value];\n };\n\n // apply these to the box and the text alike\n wrapper.textSetter = function (value) {\n if (value !== UNDEFINED) {\n text.textSetter(value);\n }\n updateBoxSize();\n updateTextPadding();\n };\n\n // apply these to the box but not to the text\n wrapper['stroke-widthSetter'] = function (value, key) {\n if (value) {\n needsBox = true;\n }\n crispAdjust = value % 2 / 2;\n boxAttr(key, value);\n };\n wrapper.strokeSetter = wrapper.fillSetter = wrapper.rSetter = function (value, key) {\n if (key === 'fill' && value) {\n needsBox = true;\n }\n boxAttr(key, value);\n };\n wrapper.anchorXSetter = function (value, key) {\n anchorX = value;\n boxAttr(key, value + crispAdjust - wrapperX);\n };\n wrapper.anchorYSetter = function (value, key) {\n anchorY = value;\n boxAttr(key, value - wrapperY);\n };\n\n // rename attributes\n wrapper.xSetter = function (value) {\n wrapper.x = value; // for animation getter\n if (alignFactor) {\n value -= alignFactor * ((width || bBox.width) + padding);\n }\n wrapperX = mathRound(value);\n wrapper.attr('translateX', wrapperX);\n };\n wrapper.ySetter = function (value) {\n wrapperY = wrapper.y = mathRound(value);\n wrapper.attr('translateY', wrapperY);\n };\n\n // Redirect certain methods to either the box or the text\n var baseCss = wrapper.css;\n return extend(wrapper, {\n /**\n * Pick up some properties and apply them to the text instead of the wrapper\n */\n css: function (styles) {\n if (styles) {\n var textStyles = {};\n styles = merge(styles); // create a copy to avoid altering the original object (#537)\n each(wrapper.textProps, function (prop) {\n if (styles[prop] !== UNDEFINED) {\n textStyles[prop] = styles[prop];\n delete styles[prop];\n }\n });\n text.css(textStyles);\n }\n return baseCss.call(wrapper, styles);\n },\n /**\n * Return the bounding box of the box, not the group\n */\n getBBox: function () {\n return {\n width: bBox.width + 2 * padding,\n height: bBox.height + 2 * padding,\n x: bBox.x - padding,\n y: bBox.y - padding\n };\n },\n /**\n * Apply the shadow to the box\n */\n shadow: function (b) {\n if (box) {\n box.shadow(b);\n }\n return wrapper;\n },\n /**\n * Destroy and release memory.\n */\n destroy: function () {\n\n // Added by button implementation\n removeEvent(wrapper.element, 'mouseenter');\n removeEvent(wrapper.element, 'mouseleave');\n\n if (text) {\n text = text.destroy();\n }\n if (box) {\n box = box.destroy();\n }\n // Call base implementation to destroy the rest\n SVGElement.prototype.destroy.call(wrapper);\n\n // Release local pointers (#1298)\n wrapper = renderer = updateBoxSize = updateTextPadding = boxAttr = null;\n }\n });\n }\n }; // end SVGRenderer\n\n\n// general renderer\n Renderer = SVGRenderer;\n// extend SvgElement for useHTML option\n extend(SVGElement.prototype, {\n /**\n * Apply CSS to HTML elements. This is used in text within SVG rendering and\n * by the VML renderer\n */\n htmlCss: function (styles) {\n var wrapper = this,\n element = wrapper.element,\n textWidth = styles && element.tagName === 'SPAN' && styles.width;\n\n if (textWidth) {\n delete styles.width;\n wrapper.textWidth = textWidth;\n wrapper.updateTransform();\n }\n\n wrapper.styles = extend(wrapper.styles, styles);\n css(wrapper.element, styles);\n\n return wrapper;\n },\n\n /**\n * VML and useHTML method for calculating the bounding box based on offsets\n * @param {Boolean} refresh Whether to force a fresh value from the DOM or to\n * use the cached value\n *\n * @return {Object} A hash containing values for x, y, width and height\n */\n\n htmlGetBBox: function () {\n var wrapper = this,\n element = wrapper.element,\n bBox = wrapper.bBox;\n\n // faking getBBox in exported SVG in legacy IE\n if (!bBox) {\n // faking getBBox in exported SVG in legacy IE (is this a duplicate of the fix for #1079?)\n if (element.nodeName === 'text') {\n element.style.position = ABSOLUTE;\n }\n\n bBox = wrapper.bBox = {\n x: element.offsetLeft,\n y: element.offsetTop,\n width: element.offsetWidth,\n height: element.offsetHeight\n };\n }\n\n return bBox;\n },\n\n /**\n * VML override private method to update elements based on internal\n * properties based on SVG transform\n */\n htmlUpdateTransform: function () {\n // aligning non added elements is expensive\n if (!this.added) {\n this.alignOnAdd = true;\n return;\n }\n\n var wrapper = this,\n renderer = wrapper.renderer,\n elem = wrapper.element,\n translateX = wrapper.translateX || 0,\n translateY = wrapper.translateY || 0,\n x = wrapper.x || 0,\n y = wrapper.y || 0,\n align = wrapper.textAlign || 'left',\n alignCorrection = { left: 0, center: 0.5, right: 1 }[align],\n shadows = wrapper.shadows;\n\n // apply translate\n css(elem, {\n marginLeft: translateX,\n marginTop: translateY\n });\n if (shadows) { // used in labels/tooltip\n each(shadows, function (shadow) {\n css(shadow, {\n marginLeft: translateX + 1,\n marginTop: translateY + 1\n });\n });\n }\n\n // apply inversion\n if (wrapper.inverted) { // wrapper is a group\n each(elem.childNodes, function (child) {\n renderer.invertChild(child, elem);\n });\n }\n\n if (elem.tagName === 'SPAN') {\n\n var width,\n rotation = wrapper.rotation,\n baseline,\n textWidth = pInt(wrapper.textWidth),\n currentTextTransform = [rotation, align, elem.innerHTML, wrapper.textWidth].join(',');\n\n if (currentTextTransform !== wrapper.cTT) { // do the calculations and DOM access only if properties changed\n\n\n baseline = renderer.fontMetrics(elem.style.fontSize).b;\n\n // Renderer specific handling of span rotation\n if (defined(rotation)) {\n wrapper.setSpanRotation(rotation, alignCorrection, baseline);\n }\n\n width = pick(wrapper.elemWidth, elem.offsetWidth);\n\n // Update textWidth\n if (width > textWidth && /[ \\-]/.test(elem.textContent || elem.innerText)) { // #983, #1254\n css(elem, {\n width: textWidth + PX,\n display: 'block',\n whiteSpace: 'normal'\n });\n width = textWidth;\n }\n\n wrapper.getSpanCorrection(width, baseline, alignCorrection, rotation, align);\n }\n\n // apply position with correction\n css(elem, {\n left: (x + (wrapper.xCorr || 0)) + PX,\n top: (y + (wrapper.yCorr || 0)) + PX\n });\n\n // force reflow in webkit to apply the left and top on useHTML element (#1249)\n if (isWebKit) {\n baseline = elem.offsetHeight; // assigned to baseline for JSLint purpose\n }\n\n // record current text transform\n wrapper.cTT = currentTextTransform;\n }\n },\n\n /**\n * Set the rotation of an individual HTML span\n */\n setSpanRotation: function (rotation, alignCorrection, baseline) {\n var rotationStyle = {},\n cssTransformKey = isIE ? '-ms-transform' : isWebKit ? '-webkit-transform' : isFirefox ? 'MozTransform' : isOpera ? '-o-transform' : '';\n\n rotationStyle[cssTransformKey] = rotationStyle.transform = 'rotate(' + rotation + 'deg)';\n rotationStyle[cssTransformKey + (isFirefox ? 'Origin' : '-origin')] = rotationStyle.transformOrigin = (alignCorrection * 100) + '% ' + baseline + 'px';\n css(this.element, rotationStyle);\n },\n\n /**\n * Get the correction in X and Y positioning as the element is rotated.\n */\n getSpanCorrection: function (width, baseline, alignCorrection) {\n this.xCorr = -width * alignCorrection;\n this.yCorr = -baseline;\n }\n });\n\n// Extend SvgRenderer for useHTML option.\n extend(SVGRenderer.prototype, {\n /**\n * Create HTML text node. This is used by the VML renderer as well as the SVG\n * renderer through the useHTML option.\n *\n * @param {String} str\n * @param {Number} x\n * @param {Number} y\n */\n html: function (str, x, y) {\n var wrapper = this.createElement('span'),\n element = wrapper.element,\n renderer = wrapper.renderer;\n\n // Text setter\n wrapper.textSetter = function (value) {\n if (value !== element.innerHTML) {\n delete this.bBox;\n }\n element.innerHTML = this.textStr = value;\n };\n\n // Various setters which rely on update transform\n wrapper.xSetter = wrapper.ySetter = wrapper.alignSetter = wrapper.rotationSetter = function (value, key) {\n if (key === 'align') {\n key = 'textAlign'; // Do not overwrite the SVGElement.align method. Same as VML.\n }\n wrapper[key] = value;\n wrapper.htmlUpdateTransform();\n };\n\n // Set the default attributes\n wrapper.attr({\n text: str,\n x: mathRound(x),\n y: mathRound(y)\n })\n .css({\n position: ABSOLUTE,\n whiteSpace: 'nowrap',\n fontFamily: this.style.fontFamily,\n fontSize: this.style.fontSize\n });\n\n // Use the HTML specific .css method\n wrapper.css = wrapper.htmlCss;\n\n // This is specific for HTML within SVG\n if (renderer.isSVG) {\n wrapper.add = function (svgGroupWrapper) {\n\n var htmlGroup,\n container = renderer.box.parentNode,\n parentGroup,\n parents = [];\n\n this.parentGroup = svgGroupWrapper;\n\n // Create a mock group to hold the HTML elements\n if (svgGroupWrapper) {\n htmlGroup = svgGroupWrapper.div;\n if (!htmlGroup) {\n\n // Read the parent chain into an array and read from top down\n parentGroup = svgGroupWrapper;\n while (parentGroup) {\n\n parents.push(parentGroup);\n\n // Move up to the next parent group\n parentGroup = parentGroup.parentGroup;\n }\n\n // Ensure dynamically updating position when any parent is translated\n each(parents.reverse(), function (parentGroup) {\n var htmlGroupStyle;\n\n // Create a HTML div and append it to the parent div to emulate\n // the SVG group structure\n htmlGroup = parentGroup.div = parentGroup.div || createElement(DIV, {\n className: attr(parentGroup.element, 'class')\n }, {\n position: ABSOLUTE,\n left: (parentGroup.translateX || 0) + PX,\n top: (parentGroup.translateY || 0) + PX\n }, htmlGroup || container); // the top group is appended to container\n\n // Shortcut\n htmlGroupStyle = htmlGroup.style;\n\n // Set listeners to update the HTML div's position whenever the SVG group\n // position is changed\n extend(parentGroup, {\n translateXSetter: function (value, key) {\n htmlGroupStyle.left = value + PX;\n parentGroup[key] = value;\n parentGroup.doTransform = true;\n },\n translateYSetter: function (value, key) {\n htmlGroupStyle.top = value + PX;\n parentGroup[key] = value;\n parentGroup.doTransform = true;\n },\n visibilitySetter: function (value, key) {\n htmlGroupStyle[key] = value;\n }\n });\n });\n\n }\n } else {\n htmlGroup = container;\n }\n\n htmlGroup.appendChild(element);\n\n // Shared with VML:\n wrapper.added = true;\n if (wrapper.alignOnAdd) {\n wrapper.htmlUpdateTransform();\n }\n\n return wrapper;\n };\n }\n return wrapper;\n }\n });\n\n /* ****************************************************************************\n * *\n * START OF INTERNET EXPLORER <= 8 SPECIFIC CODE *\n * *\n * For applications and websites that don't need IE support, like platform *\n * targeted mobile apps and web apps, this code can be removed. *\n * *\n *****************************************************************************/\n\n /**\n * @constructor\n */\n var VMLRenderer, VMLElement;\n if (!hasSVG && !useCanVG) {\n\n /**\n * The VML element wrapper.\n */\n VMLElement = {\n\n /**\n * Initialize a new VML element wrapper. It builds the markup as a string\n * to minimize DOM traffic.\n * @param {Object} renderer\n * @param {Object} nodeName\n */\n init: function (renderer, nodeName) {\n var wrapper = this,\n markup = ['<', nodeName, ' filled=\"f\" stroked=\"f\"'],\n style = ['position: ', ABSOLUTE, ';'],\n isDiv = nodeName === DIV;\n\n // divs and shapes need size\n if (nodeName === 'shape' || isDiv) {\n style.push('left:0;top:0;width:1px;height:1px;');\n }\n style.push('visibility: ', isDiv ? HIDDEN : VISIBLE);\n\n markup.push(' style=\"', style.join(''), '\"/>');\n\n // create element with default attributes and style\n if (nodeName) {\n markup = isDiv || nodeName === 'span' || nodeName === 'img' ?\n markup.join('')\n : renderer.prepVML(markup);\n wrapper.element = createElement(markup);\n }\n\n wrapper.renderer = renderer;\n },\n\n /**\n * Add the node to the given parent\n * @param {Object} parent\n */\n add: function (parent) {\n var wrapper = this,\n renderer = wrapper.renderer,\n element = wrapper.element,\n box = renderer.box,\n inverted = parent && parent.inverted,\n\n // get the parent node\n parentNode = parent ?\n parent.element || parent :\n box;\n\n\n // if the parent group is inverted, apply inversion on all children\n if (inverted) { // only on groups\n renderer.invertChild(element, parentNode);\n }\n\n // append it\n parentNode.appendChild(element);\n\n // align text after adding to be able to read offset\n wrapper.added = true;\n if (wrapper.alignOnAdd && !wrapper.deferUpdateTransform) {\n wrapper.updateTransform();\n }\n\n // fire an event for internal hooks\n if (wrapper.onAdd) {\n wrapper.onAdd();\n }\n\n return wrapper;\n },\n\n /**\n * VML always uses htmlUpdateTransform\n */\n updateTransform: SVGElement.prototype.htmlUpdateTransform,\n\n /**\n * Set the rotation of a span with oldIE's filter\n */\n setSpanRotation: function () {\n // Adjust for alignment and rotation. Rotation of useHTML content is not yet implemented\n // but it can probably be implemented for Firefox 3.5+ on user request. FF3.5+\n // has support for CSS3 transform. The getBBox method also needs to be updated\n // to compensate for the rotation, like it currently does for SVG.\n // Test case: http://jsfiddle.net/highcharts/Ybt44/\n\n var rotation = this.rotation,\n costheta = mathCos(rotation * deg2rad),\n sintheta = mathSin(rotation * deg2rad);\n\n css(this.element, {\n filter: rotation ? ['progid:DXImageTransform.Microsoft.Matrix(M11=', costheta,\n ', M12=', -sintheta, ', M21=', sintheta, ', M22=', costheta,\n ', sizingMethod=\\'auto expand\\')'].join('') : NONE\n });\n },\n\n /**\n * Get the positioning correction for the span after rotating.\n */\n getSpanCorrection: function (width, baseline, alignCorrection, rotation, align) {\n\n var costheta = rotation ? mathCos(rotation * deg2rad) : 1,\n sintheta = rotation ? mathSin(rotation * deg2rad) : 0,\n height = pick(this.elemHeight, this.element.offsetHeight),\n quad,\n nonLeft = align && align !== 'left';\n\n // correct x and y\n this.xCorr = costheta < 0 && -width;\n this.yCorr = sintheta < 0 && -height;\n\n // correct for baseline and corners spilling out after rotation\n quad = costheta * sintheta < 0;\n this.xCorr += sintheta * baseline * (quad ? 1 - alignCorrection : alignCorrection);\n this.yCorr -= costheta * baseline * (rotation ? (quad ? alignCorrection : 1 - alignCorrection) : 1);\n // correct for the length/height of the text\n if (nonLeft) {\n this.xCorr -= width * alignCorrection * (costheta < 0 ? -1 : 1);\n if (rotation) {\n this.yCorr -= height * alignCorrection * (sintheta < 0 ? -1 : 1);\n }\n css(this.element, {\n textAlign: align\n });\n }\n },\n\n /**\n * Converts a subset of an SVG path definition to its VML counterpart. Takes an array\n * as the parameter and returns a string.\n */\n pathToVML: function (value) {\n // convert paths\n var i = value.length,\n path = [];\n\n while (i--) {\n\n // Multiply by 10 to allow subpixel precision.\n // Substracting half a pixel seems to make the coordinates\n // align with SVG, but this hasn't been tested thoroughly\n if (isNumber(value[i])) {\n path[i] = mathRound(value[i] * 10) - 5;\n } else if (value[i] === 'Z') { // close the path\n path[i] = 'x';\n } else {\n path[i] = value[i];\n\n // When the start X and end X coordinates of an arc are too close,\n // they are rounded to the same value above. In this case, substract or\n // add 1 from the end X and Y positions. #186, #760, #1371, #1410.\n if (value.isArc && (value[i] === 'wa' || value[i] === 'at')) {\n // Start and end X\n if (path[i + 5] === path[i + 7]) {\n path[i + 7] += value[i + 7] > value[i + 5] ? 1 : -1;\n }\n // Start and end Y\n if (path[i + 6] === path[i + 8]) {\n path[i + 8] += value[i + 8] > value[i + 6] ? 1 : -1;\n }\n }\n }\n }\n\n\n // Loop up again to handle path shortcuts (#2132)\n /*while (i++ < path.length) {\n if (path[i] === 'H') { // horizontal line to\n path[i] = 'L';\n path.splice(i + 2, 0, path[i - 1]);\n } else if (path[i] === 'V') { // vertical line to\n path[i] = 'L';\n path.splice(i + 1, 0, path[i - 2]);\n }\n }*/\n return path.join(' ') || 'x';\n },\n\n /**\n * Set the element's clipping to a predefined rectangle\n *\n * @param {String} id The id of the clip rectangle\n */\n clip: function (clipRect) {\n var wrapper = this,\n clipMembers,\n cssRet;\n\n if (clipRect) {\n clipMembers = clipRect.members;\n erase(clipMembers, wrapper); // Ensure unique list of elements (#1258)\n clipMembers.push(wrapper);\n wrapper.destroyClip = function () {\n erase(clipMembers, wrapper);\n };\n cssRet = clipRect.getCSS(wrapper);\n\n } else {\n if (wrapper.destroyClip) {\n wrapper.destroyClip();\n }\n cssRet = { clip: docMode8 ? 'inherit' : 'rect(auto)' }; // #1214\n }\n\n return wrapper.css(cssRet);\n\n },\n\n /**\n * Set styles for the element\n * @param {Object} styles\n */\n css: SVGElement.prototype.htmlCss,\n\n /**\n * Removes a child either by removeChild or move to garbageBin.\n * Issue 490; in VML removeChild results in Orphaned nodes according to sIEve, discardElement does not.\n */\n safeRemoveChild: function (element) {\n // discardElement will detach the node from its parent before attaching it\n // to the garbage bin. Therefore it is important that the node is attached and have parent.\n if (element.parentNode) {\n discardElement(element);\n }\n },\n\n /**\n * Extend element.destroy by removing it from the clip members array\n */\n destroy: function () {\n if (this.destroyClip) {\n this.destroyClip();\n }\n\n return SVGElement.prototype.destroy.apply(this);\n },\n\n /**\n * Add an event listener. VML override for normalizing event parameters.\n * @param {String} eventType\n * @param {Function} handler\n */\n on: function (eventType, handler) {\n // simplest possible event model for internal use\n this.element['on' + eventType] = function () {\n var evt = win.event;\n evt.target = evt.srcElement;\n handler(evt);\n };\n return this;\n },\n\n /**\n * In stacked columns, cut off the shadows so that they don't overlap\n */\n cutOffPath: function (path, length) {\n\n var len;\n\n path = path.split(/[ ,]/);\n len = path.length;\n\n if (len === 9 || len === 11) {\n path[len - 4] = path[len - 2] = pInt(path[len - 2]) - 10 * length;\n }\n return path.join(' ');\n },\n\n /**\n * Apply a drop shadow by copying elements and giving them different strokes\n * @param {Boolean|Object} shadowOptions\n */\n shadow: function (shadowOptions, group, cutOff) {\n var shadows = [],\n i,\n element = this.element,\n renderer = this.renderer,\n shadow,\n elemStyle = element.style,\n markup,\n path = element.path,\n strokeWidth,\n modifiedPath,\n shadowWidth,\n shadowElementOpacity;\n\n // some times empty paths are not strings\n if (path && typeof path.value !== 'string') {\n path = 'x';\n }\n modifiedPath = path;\n\n if (shadowOptions) {\n shadowWidth = pick(shadowOptions.width, 3);\n shadowElementOpacity = (shadowOptions.opacity || 0.15) / shadowWidth;\n for (i = 1; i <= 3; i++) {\n\n strokeWidth = (shadowWidth * 2) + 1 - (2 * i);\n\n // Cut off shadows for stacked column items\n if (cutOff) {\n modifiedPath = this.cutOffPath(path.value, strokeWidth + 0.5);\n }\n\n markup = ['<shape isShadow=\"true\" strokeweight=\"', strokeWidth,\n '\" filled=\"false\" path=\"', modifiedPath,\n '\" coordsize=\"10 10\" style=\"', element.style.cssText, '\" />'];\n\n shadow = createElement(renderer.prepVML(markup),\n null, {\n left: pInt(elemStyle.left) + pick(shadowOptions.offsetX, 1),\n top: pInt(elemStyle.top) + pick(shadowOptions.offsetY, 1)\n }\n );\n if (cutOff) {\n shadow.cutOff = strokeWidth + 1;\n }\n\n // apply the opacity\n markup = ['<stroke color=\"', shadowOptions.color || 'black', '\" opacity=\"', shadowElementOpacity * i, '\"/>'];\n createElement(renderer.prepVML(markup), null, null, shadow);\n\n\n // insert it\n if (group) {\n group.element.appendChild(shadow);\n } else {\n element.parentNode.insertBefore(shadow, element);\n }\n\n // record it\n shadows.push(shadow);\n\n }\n\n this.shadows = shadows;\n }\n return this;\n },\n updateShadows: noop, // Used in SVG only\n\n setAttr: function (key, value) {\n if (docMode8) { // IE8 setAttribute bug\n this.element[key] = value;\n } else {\n this.element.setAttribute(key, value);\n }\n },\n classSetter: function (value) {\n // IE8 Standards mode has problems retrieving the className unless set like this\n this.element.className = value;\n },\n dashstyleSetter: function (value, key, element) {\n var strokeElem = element.getElementsByTagName('stroke')[0] ||\n createElement(this.renderer.prepVML(['<stroke/>']), null, null, element);\n strokeElem[key] = value || 'solid';\n this[key] = value; /* because changing stroke-width will change the dash length\n and cause an epileptic effect */\n },\n dSetter: function (value, key, element) {\n var i,\n shadows = this.shadows;\n value = value || [];\n this.d = value.join && value.join(' '); // used in getter for animation\n\n element.path = value = this.pathToVML(value);\n\n // update shadows\n if (shadows) {\n i = shadows.length;\n while (i--) {\n shadows[i].path = shadows[i].cutOff ? this.cutOffPath(value, shadows[i].cutOff) : value;\n }\n }\n this.setAttr(key, value);\n },\n fillSetter: function (value, key, element) {\n var nodeName = element.nodeName;\n if (nodeName === 'SPAN') { // text color\n element.style.color = value;\n } else if (nodeName !== 'IMG') { // #1336\n element.filled = value !== NONE;\n this.setAttr('fillcolor', this.renderer.color(value, element, key, this));\n }\n },\n opacitySetter: noop, // Don't bother - animation is too slow and filters introduce artifacts\n rotationSetter: function (value, key, element) {\n var style = element.style;\n this[key] = style[key] = value; // style is for #1873\n\n // Correction for the 1x1 size of the shape container. Used in gauge needles.\n style.left = -mathRound(mathSin(value * deg2rad) + 1) + PX;\n style.top = mathRound(mathCos(value * deg2rad)) + PX;\n },\n strokeSetter: function (value, key, element) {\n this.setAttr('strokecolor', this.renderer.color(value, element, key));\n },\n 'stroke-widthSetter': function (value, key, element) {\n element.stroked = !!value; // VML \"stroked\" attribute\n this[key] = value; // used in getter, issue #113\n if (isNumber(value)) {\n value += PX;\n }\n this.setAttr('strokeweight', value);\n },\n titleSetter: function (value, key) {\n this.setAttr(key, value);\n },\n visibilitySetter: function (value, key, element) {\n\n // Handle inherited visibility\n if (value === 'inherit') {\n value = VISIBLE;\n }\n\n // Let the shadow follow the main element\n if (this.shadows) {\n each(this.shadows, function (shadow) {\n shadow.style[key] = value;\n });\n }\n\n // Instead of toggling the visibility CSS property, move the div out of the viewport.\n // This works around #61 and #586\n if (element.nodeName === 'DIV') {\n value = value === HIDDEN ? '-999em' : 0;\n\n // In order to redraw, IE7 needs the div to be visible when tucked away\n // outside the viewport. So the visibility is actually opposite of\n // the expected value. This applies to the tooltip only.\n if (!docMode8) {\n element.style[key] = value ? VISIBLE : HIDDEN;\n }\n key = 'top';\n }\n element.style[key] = value;\n },\n xSetter: function (value, key, element) {\n this[key] = value; // used in getter\n\n if (key === 'x') {\n key = 'left';\n } else if (key === 'y') {\n key = 'top';\n }/* else {\n value = mathMax(0, value); // don't set width or height below zero (#311)\n }*/\n\n // clipping rectangle special\n if (this.updateClipping) {\n this[key] = value; // the key is now 'left' or 'top' for 'x' and 'y'\n this.updateClipping();\n } else {\n // normal\n element.style[key] = value;\n }\n },\n zIndexSetter: function (value, key, element) {\n element.style[key] = value;\n }\n };\n Highcharts.VMLElement = VMLElement = extendClass(SVGElement, VMLElement);\n\n// Some shared setters\n VMLElement.prototype.ySetter =\n VMLElement.prototype.widthSetter =\n VMLElement.prototype.heightSetter =\n VMLElement.prototype.xSetter;\n\n\n /**\n * The VML renderer\n */\n var VMLRendererExtension = { // inherit SVGRenderer\n\n Element: VMLElement,\n isIE8: userAgent.indexOf('MSIE 8.0') > -1,\n\n\n /**\n * Initialize the VMLRenderer\n * @param {Object} container\n * @param {Number} width\n * @param {Number} height\n */\n init: function (container, width, height, style) {\n var renderer = this,\n boxWrapper,\n box,\n css;\n\n renderer.alignedObjects = [];\n\n boxWrapper = renderer.createElement(DIV)\n .css(extend(this.getStyle(style), { position: RELATIVE}));\n box = boxWrapper.element;\n container.appendChild(boxWrapper.element);\n\n\n // generate the containing box\n renderer.isVML = true;\n renderer.box = box;\n renderer.boxWrapper = boxWrapper;\n renderer.cache = {};\n\n\n renderer.setSize(width, height, false);\n\n // The only way to make IE6 and IE7 print is to use a global namespace. However,\n // with IE8 the only way to make the dynamic shapes visible in screen and print mode\n // seems to be to add the xmlns attribute and the behaviour style inline.\n if (!doc.namespaces.hcv) {\n\n doc.namespaces.add('hcv', 'urn:schemas-microsoft-com:vml');\n\n // Setup default CSS (#2153, #2368, #2384)\n css = 'hcv\\\\:fill, hcv\\\\:path, hcv\\\\:shape, hcv\\\\:stroke' +\n '{ behavior:url(#default#VML); display: inline-block; } ';\n try {\n doc.createStyleSheet().cssText = css;\n } catch (e) {\n doc.styleSheets[0].cssText += css;\n }\n\n }\n },\n\n\n /**\n * Detect whether the renderer is hidden. This happens when one of the parent elements\n * has display: none\n */\n isHidden: function () {\n return !this.box.offsetWidth;\n },\n\n /**\n * Define a clipping rectangle. In VML it is accomplished by storing the values\n * for setting the CSS style to all associated members.\n *\n * @param {Number} x\n * @param {Number} y\n * @param {Number} width\n * @param {Number} height\n */\n clipRect: function (x, y, width, height) {\n\n // create a dummy element\n var clipRect = this.createElement(),\n isObj = isObject(x);\n\n // mimic a rectangle with its style object for automatic updating in attr\n return extend(clipRect, {\n members: [],\n left: (isObj ? x.x : x) + 1,\n top: (isObj ? x.y : y) + 1,\n width: (isObj ? x.width : width) - 1,\n height: (isObj ? x.height : height) - 1,\n getCSS: function (wrapper) {\n var element = wrapper.element,\n nodeName = element.nodeName,\n isShape = nodeName === 'shape',\n inverted = wrapper.inverted,\n rect = this,\n top = rect.top - (isShape ? element.offsetTop : 0),\n left = rect.left,\n right = left + rect.width,\n bottom = top + rect.height,\n ret = {\n clip: 'rect(' +\n mathRound(inverted ? left : top) + 'px,' +\n mathRound(inverted ? bottom : right) + 'px,' +\n mathRound(inverted ? right : bottom) + 'px,' +\n mathRound(inverted ? top : left) + 'px)'\n };\n\n // issue 74 workaround\n if (!inverted && docMode8 && nodeName === 'DIV') {\n extend(ret, {\n width: right + PX,\n height: bottom + PX\n });\n }\n return ret;\n },\n\n // used in attr and animation to update the clipping of all members\n updateClipping: function () {\n each(clipRect.members, function (member) {\n if (member.element) { // Deleted series, like in stock/members/series-remove demo. Should be removed from members, but this will do.\n member.css(clipRect.getCSS(member));\n }\n });\n }\n });\n\n },\n\n\n /**\n * Take a color and return it if it's a string, make it a gradient if it's a\n * gradient configuration object, and apply opacity.\n *\n * @param {Object} color The color or config object\n */\n color: function (color, elem, prop, wrapper) {\n var renderer = this,\n colorObject,\n regexRgba = /^rgba/,\n markup,\n fillType,\n ret = NONE;\n\n // Check for linear or radial gradient\n if (color && color.linearGradient) {\n fillType = 'gradient';\n } else if (color && color.radialGradient) {\n fillType = 'pattern';\n }\n\n\n if (fillType) {\n\n var stopColor,\n stopOpacity,\n gradient = color.linearGradient || color.radialGradient,\n x1,\n y1,\n x2,\n y2,\n opacity1,\n opacity2,\n color1,\n color2,\n fillAttr = '',\n stops = color.stops,\n firstStop,\n lastStop,\n colors = [],\n addFillNode = function () {\n // Add the fill subnode. When colors attribute is used, the meanings of opacity and o:opacity2\n // are reversed.\n markup = ['<fill colors=\"' + colors.join(',') + '\" opacity=\"', opacity2, '\" o:opacity2=\"', opacity1,\n '\" type=\"', fillType, '\" ', fillAttr, 'focus=\"100%\" method=\"any\" />'];\n createElement(renderer.prepVML(markup), null, null, elem);\n };\n\n // Extend from 0 to 1\n firstStop = stops[0];\n lastStop = stops[stops.length - 1];\n if (firstStop[0] > 0) {\n stops.unshift([\n 0,\n firstStop[1]\n ]);\n }\n if (lastStop[0] < 1) {\n stops.push([\n 1,\n lastStop[1]\n ]);\n }\n\n // Compute the stops\n each(stops, function (stop, i) {\n if (regexRgba.test(stop[1])) {\n colorObject = Color(stop[1]);\n stopColor = colorObject.get('rgb');\n stopOpacity = colorObject.get('a');\n } else {\n stopColor = stop[1];\n stopOpacity = 1;\n }\n\n // Build the color attribute\n colors.push((stop[0] * 100) + '% ' + stopColor);\n\n // Only start and end opacities are allowed, so we use the first and the last\n if (!i) {\n opacity1 = stopOpacity;\n color2 = stopColor;\n } else {\n opacity2 = stopOpacity;\n color1 = stopColor;\n }\n });\n\n // Apply the gradient to fills only.\n if (prop === 'fill') {\n\n // Handle linear gradient angle\n if (fillType === 'gradient') {\n x1 = gradient.x1 || gradient[0] || 0;\n y1 = gradient.y1 || gradient[1] || 0;\n x2 = gradient.x2 || gradient[2] || 0;\n y2 = gradient.y2 || gradient[3] || 0;\n fillAttr = 'angle=\"' + (90 - math.atan(\n (y2 - y1) / // y vector\n (x2 - x1) // x vector\n ) * 180 / mathPI) + '\"';\n\n addFillNode();\n\n // Radial (circular) gradient\n } else {\n\n var r = gradient.r,\n sizex = r * 2,\n sizey = r * 2,\n cx = gradient.cx,\n cy = gradient.cy,\n radialReference = elem.radialReference,\n bBox,\n applyRadialGradient = function () {\n if (radialReference) {\n bBox = wrapper.getBBox();\n cx += (radialReference[0] - bBox.x) / bBox.width - 0.5;\n cy += (radialReference[1] - bBox.y) / bBox.height - 0.5;\n sizex *= radialReference[2] / bBox.width;\n sizey *= radialReference[2] / bBox.height;\n }\n fillAttr = 'src=\"' + defaultOptions.global.VMLRadialGradientURL + '\" ' +\n 'size=\"' + sizex + ',' + sizey + '\" ' +\n 'origin=\"0.5,0.5\" ' +\n 'position=\"' + cx + ',' + cy + '\" ' +\n 'color2=\"' + color2 + '\" ';\n\n addFillNode();\n };\n\n // Apply radial gradient\n if (wrapper.added) {\n applyRadialGradient();\n } else {\n // We need to know the bounding box to get the size and position right\n wrapper.onAdd = applyRadialGradient;\n }\n\n // The fill element's color attribute is broken in IE8 standards mode, so we\n // need to set the parent shape's fillcolor attribute instead.\n ret = color1;\n }\n\n // Gradients are not supported for VML stroke, return the first color. #722.\n } else {\n ret = stopColor;\n }\n\n // if the color is an rgba color, split it and add a fill node\n // to hold the opacity component\n } else if (regexRgba.test(color) && elem.tagName !== 'IMG') {\n\n colorObject = Color(color);\n\n markup = ['<', prop, ' opacity=\"', colorObject.get('a'), '\"/>'];\n createElement(this.prepVML(markup), null, null, elem);\n\n ret = colorObject.get('rgb');\n\n\n } else {\n var propNodes = elem.getElementsByTagName(prop); // 'stroke' or 'fill' node\n if (propNodes.length) {\n propNodes[0].opacity = 1;\n propNodes[0].type = 'solid';\n }\n ret = color;\n }\n\n return ret;\n },\n\n /**\n * Take a VML string and prepare it for either IE8 or IE6/IE7.\n * @param {Array} markup A string array of the VML markup to prepare\n */\n prepVML: function (markup) {\n var vmlStyle = 'display:inline-block;behavior:url(#default#VML);',\n isIE8 = this.isIE8;\n\n markup = markup.join('');\n\n if (isIE8) { // add xmlns and style inline\n markup = markup.replace('/>', ' xmlns=\"urn:schemas-microsoft-com:vml\" />');\n if (markup.indexOf('style=\"') === -1) {\n markup = markup.replace('/>', ' style=\"' + vmlStyle + '\" />');\n } else {\n markup = markup.replace('style=\"', 'style=\"' + vmlStyle);\n }\n\n } else { // add namespace\n markup = markup.replace('<', '<hcv:');\n }\n\n return markup;\n },\n\n /**\n * Create rotated and aligned text\n * @param {String} str\n * @param {Number} x\n * @param {Number} y\n */\n text: SVGRenderer.prototype.html,\n\n /**\n * Create and return a path element\n * @param {Array} path\n */\n path: function (path) {\n var attr = {\n // subpixel precision down to 0.1 (width and height = 1px)\n coordsize: '10 10'\n };\n if (isArray(path)) {\n attr.d = path;\n } else if (isObject(path)) { // attributes\n extend(attr, path);\n }\n // create the shape\n return this.createElement('shape').attr(attr);\n },\n\n /**\n * Create and return a circle element. In VML circles are implemented as\n * shapes, which is faster than v:oval\n * @param {Number} x\n * @param {Number} y\n * @param {Number} r\n */\n circle: function (x, y, r) {\n var circle = this.symbol('circle');\n if (isObject(x)) {\n r = x.r;\n y = x.y;\n x = x.x;\n }\n circle.isCircle = true; // Causes x and y to mean center (#1682)\n circle.r = r;\n return circle.attr({ x: x, y: y });\n },\n\n /**\n * Create a group using an outer div and an inner v:group to allow rotating\n * and flipping. A simple v:group would have problems with positioning\n * child HTML elements and CSS clip.\n *\n * @param {String} name The name of the group\n */\n g: function (name) {\n var wrapper,\n attribs;\n\n // set the class name\n if (name) {\n attribs = { 'className': PREFIX + name, 'class': PREFIX + name };\n }\n\n // the div to hold HTML and clipping\n wrapper = this.createElement(DIV).attr(attribs);\n\n return wrapper;\n },\n\n /**\n * VML override to create a regular HTML image\n * @param {String} src\n * @param {Number} x\n * @param {Number} y\n * @param {Number} width\n * @param {Number} height\n */\n image: function (src, x, y, width, height) {\n var obj = this.createElement('img')\n .attr({ src: src });\n\n if (arguments.length > 1) {\n obj.attr({\n x: x,\n y: y,\n width: width,\n height: height\n });\n }\n return obj;\n },\n\n /**\n * For rectangles, VML uses a shape for rect to overcome bugs and rotation problems\n */\n createElement: function (nodeName) {\n return nodeName === 'rect' ? this.symbol(nodeName) : SVGRenderer.prototype.createElement.call(this, nodeName);\n },\n\n /**\n * In the VML renderer, each child of an inverted div (group) is inverted\n * @param {Object} element\n * @param {Object} parentNode\n */\n invertChild: function (element, parentNode) {\n var ren = this,\n parentStyle = parentNode.style,\n imgStyle = element.tagName === 'IMG' && element.style; // #1111\n\n css(element, {\n flip: 'x',\n left: pInt(parentStyle.width) - (imgStyle ? pInt(imgStyle.top) : 1),\n top: pInt(parentStyle.height) - (imgStyle ? pInt(imgStyle.left) : 1),\n rotation: -90\n });\n\n // Recursively invert child elements, needed for nested composite shapes like box plots and error bars. #1680, #1806.\n each(element.childNodes, function (child) {\n ren.invertChild(child, element);\n });\n },\n\n /**\n * Symbol definitions that override the parent SVG renderer's symbols\n *\n */\n symbols: {\n // VML specific arc function\n arc: function (x, y, w, h, options) {\n var start = options.start,\n end = options.end,\n radius = options.r || w || h,\n innerRadius = options.innerR,\n cosStart = mathCos(start),\n sinStart = mathSin(start),\n cosEnd = mathCos(end),\n sinEnd = mathSin(end),\n ret;\n\n if (end - start === 0) { // no angle, don't show it.\n return ['x'];\n }\n\n ret = [\n 'wa', // clockwise arc to\n x - radius, // left\n y - radius, // top\n x + radius, // right\n y + radius, // bottom\n x + radius * cosStart, // start x\n y + radius * sinStart, // start y\n x + radius * cosEnd, // end x\n y + radius * sinEnd // end y\n ];\n\n if (options.open && !innerRadius) {\n ret.push(\n 'e',\n M,\n x,// - innerRadius,\n y// - innerRadius\n );\n }\n\n ret.push(\n 'at', // anti clockwise arc to\n x - innerRadius, // left\n y - innerRadius, // top\n x + innerRadius, // right\n y + innerRadius, // bottom\n x + innerRadius * cosEnd, // start x\n y + innerRadius * sinEnd, // start y\n x + innerRadius * cosStart, // end x\n y + innerRadius * sinStart, // end y\n 'x', // finish path\n 'e' // close\n );\n\n ret.isArc = true;\n return ret;\n\n },\n // Add circle symbol path. This performs significantly faster than v:oval.\n circle: function (x, y, w, h, wrapper) {\n\n if (wrapper) {\n w = h = 2 * wrapper.r;\n }\n\n // Center correction, #1682\n if (wrapper && wrapper.isCircle) {\n x -= w / 2;\n y -= h / 2;\n }\n\n // Return the path\n return [\n 'wa', // clockwisearcto\n x, // left\n y, // top\n x + w, // right\n y + h, // bottom\n x + w, // start x\n y + h / 2, // start y\n x + w, // end x\n y + h / 2, // end y\n //'x', // finish path\n 'e' // close\n ];\n },\n /**\n * Add rectangle symbol path which eases rotation and omits arcsize problems\n * compared to the built-in VML roundrect shape. When borders are not rounded,\n * use the simpler square path, else use the callout path without the arrow.\n */\n rect: function (x, y, w, h, options) {\n return SVGRenderer.prototype.symbols[\n !defined(options) || !options.r ? 'square' : 'callout'\n ].call(0, x, y, w, h, options);\n }\n }\n };\n Highcharts.VMLRenderer = VMLRenderer = function () {\n this.init.apply(this, arguments);\n };\n VMLRenderer.prototype = merge(SVGRenderer.prototype, VMLRendererExtension);\n\n // general renderer\n Renderer = VMLRenderer;\n }\n\n// This method is used with exporting in old IE, when emulating SVG (see #2314)\n SVGRenderer.prototype.measureSpanWidth = function (text, styles) {\n var measuringSpan = doc.createElement('span'),\n offsetWidth,\n textNode = doc.createTextNode(text);\n\n measuringSpan.appendChild(textNode);\n css(measuringSpan, styles);\n this.box.appendChild(measuringSpan);\n offsetWidth = measuringSpan.offsetWidth;\n discardElement(measuringSpan); // #2463\n return offsetWidth;\n };\n\n\n /* ****************************************************************************\n * *\n * END OF INTERNET EXPLORER <= 8 SPECIFIC CODE *\n * *\n *****************************************************************************/\n /* ****************************************************************************\n * *\n * START OF ANDROID < 3 SPECIFIC CODE. THIS CAN BE REMOVED IF YOU'RE NOT *\n * TARGETING THAT SYSTEM. *\n * *\n *****************************************************************************/\n var CanVGRenderer,\n CanVGController;\n\n if (useCanVG) {\n /**\n * The CanVGRenderer is empty from start to keep the source footprint small.\n * When requested, the CanVGController downloads the rest of the source packaged\n * together with the canvg library.\n */\n Highcharts.CanVGRenderer = CanVGRenderer = function () {\n // Override the global SVG namespace to fake SVG/HTML that accepts CSS\n SVG_NS = 'http://www.w3.org/1999/xhtml';\n };\n\n /**\n * Start with an empty symbols object. This is needed when exporting is used (exporting.src.js will add a few symbols), but\n * the implementation from SvgRenderer will not be merged in until first render.\n */\n CanVGRenderer.prototype.symbols = {};\n\n /**\n * Handles on demand download of canvg rendering support.\n */\n CanVGController = (function () {\n // List of renderering calls\n var deferredRenderCalls = [];\n\n /**\n * When downloaded, we are ready to draw deferred charts.\n */\n function drawDeferred() {\n var callLength = deferredRenderCalls.length,\n callIndex;\n\n // Draw all pending render calls\n for (callIndex = 0; callIndex < callLength; callIndex++) {\n deferredRenderCalls[callIndex]();\n }\n // Clear the list\n deferredRenderCalls = [];\n }\n\n return {\n push: function (func, scriptLocation) {\n // Only get the script once\n if (deferredRenderCalls.length === 0) {\n getScript(scriptLocation, drawDeferred);\n }\n // Register render call\n deferredRenderCalls.push(func);\n }\n };\n }());\n\n Renderer = CanVGRenderer;\n } // end CanVGRenderer\n\n /* ****************************************************************************\n * *\n * END OF ANDROID < 3 SPECIFIC CODE *\n * *\n *****************************************************************************/\n\n /**\n * The Tick class\n */\n function Tick(axis, pos, type, noLabel) {\n this.axis = axis;\n this.pos = pos;\n this.type = type || '';\n this.isNew = true;\n\n if (!type && !noLabel) {\n this.addLabel();\n }\n }\n\n Tick.prototype = {\n /**\n * Write the tick label\n */\n addLabel: function () {\n var tick = this,\n axis = tick.axis,\n options = axis.options,\n chart = axis.chart,\n horiz = axis.horiz,\n categories = axis.categories,\n names = axis.names,\n pos = tick.pos,\n labelOptions = options.labels,\n rotation = labelOptions.rotation,\n str,\n tickPositions = axis.tickPositions,\n width = (horiz && categories &&\n !labelOptions.step && !labelOptions.staggerLines &&\n !labelOptions.rotation &&\n chart.plotWidth / tickPositions.length) ||\n (!horiz && (chart.margin[3] || chart.chartWidth * 0.33)), // #1580, #1931\n isFirst = pos === tickPositions[0],\n isLast = pos === tickPositions[tickPositions.length - 1],\n css,\n attr,\n value = categories ?\n pick(categories[pos], names[pos], pos) :\n pos,\n label = tick.label,\n tickPositionInfo = tickPositions.info,\n dateTimeLabelFormat;\n\n // Set the datetime label format. If a higher rank is set for this position, use that. If not,\n // use the general format.\n if (axis.isDatetimeAxis && tickPositionInfo) {\n dateTimeLabelFormat = options.dateTimeLabelFormats[tickPositionInfo.higherRanks[pos] || tickPositionInfo.unitName];\n }\n // set properties for access in render method\n tick.isFirst = isFirst;\n tick.isLast = isLast;\n\n // get the string\n str = axis.labelFormatter.call({\n axis: axis,\n chart: chart,\n isFirst: isFirst,\n isLast: isLast,\n dateTimeLabelFormat: dateTimeLabelFormat,\n value: axis.isLog ? correctFloat(lin2log(value)) : value\n });\n\n // prepare CSS\n css = width && { width: mathMax(1, mathRound(width - 2 * (labelOptions.padding || 10))) + PX };\n\n // first call\n if (!defined(label)) {\n attr = {\n align: axis.labelAlign\n };\n if (isNumber(rotation)) {\n attr.rotation = rotation;\n }\n if (width && labelOptions.ellipsis) {\n css.HcHeight = axis.len / tickPositions.length;\n }\n\n tick.label = label =\n defined(str) && labelOptions.enabled ?\n chart.renderer.text(\n str,\n 0,\n 0,\n labelOptions.useHTML\n )\n .attr(attr)\n // without position absolute, IE export sometimes is wrong\n .css(extend(css, labelOptions.style))\n .add(axis.labelGroup) :\n null;\n\n // Set the tick baseline and correct for rotation (#1764)\n axis.tickBaseline = chart.renderer.fontMetrics(labelOptions.style.fontSize, label).b;\n if (rotation && axis.side === 2) {\n axis.tickBaseline *= mathCos(rotation * deg2rad);\n }\n\n\n // update\n } else if (label) {\n label.attr({\n text: str\n })\n .css(css);\n }\n tick.yOffset = label ? pick(labelOptions.y, axis.tickBaseline + (axis.side === 2 ? 8 : -(label.getBBox().height / 2))) : 0;\n },\n\n /**\n * Get the offset height or width of the label\n */\n getLabelSize: function () {\n var label = this.label,\n axis = this.axis;\n return label ?\n label.getBBox()[axis.horiz ? 'height' : 'width'] :\n 0;\n },\n\n /**\n * Find how far the labels extend to the right and left of the tick's x position. Used for anti-collision\n * detection with overflow logic.\n */\n getLabelSides: function () {\n var bBox = this.label.getBBox(),\n axis = this.axis,\n horiz = axis.horiz,\n options = axis.options,\n labelOptions = options.labels,\n size = horiz ? bBox.width : bBox.height,\n leftSide = horiz ?\n labelOptions.x - size * { left: 0, center: 0.5, right: 1 }[axis.labelAlign] :\n 0,\n rightSide = horiz ?\n size + leftSide :\n size;\n\n return [leftSide, rightSide];\n },\n\n /**\n * Handle the label overflow by adjusting the labels to the left and right edge, or\n * hide them if they collide into the neighbour label.\n */\n handleOverflow: function (index, xy) {\n var show = true,\n axis = this.axis,\n isFirst = this.isFirst,\n isLast = this.isLast,\n horiz = axis.horiz,\n pxPos = horiz ? xy.x : xy.y,\n reversed = axis.reversed,\n tickPositions = axis.tickPositions,\n sides = this.getLabelSides(),\n leftSide = sides[0],\n rightSide = sides[1],\n axisLeft,\n axisRight,\n neighbour,\n neighbourEdge,\n line = this.label.line,\n lineIndex = line || 0,\n labelEdge = axis.labelEdge,\n justifyLabel = axis.justifyLabels && (isFirst || isLast),\n justifyToPlot;\n\n // Hide it if it now overlaps the neighbour label\n if (labelEdge[lineIndex] === UNDEFINED || pxPos + leftSide > labelEdge[lineIndex]) {\n labelEdge[lineIndex] = pxPos + rightSide;\n\n } else if (!justifyLabel) {\n show = false;\n }\n\n if (justifyLabel) {\n justifyToPlot = axis.justifyToPlot;\n axisLeft = justifyToPlot ? axis.pos : 0;\n axisRight = justifyToPlot ? axisLeft + axis.len : axis.chart.chartWidth;\n\n // Find the firsth neighbour on the same line\n do {\n index += (isFirst ? 1 : -1);\n neighbour = axis.ticks[tickPositions[index]];\n } while (tickPositions[index] && (!neighbour || !neighbour.label || neighbour.label.line !== line)); // #3044\n\n neighbourEdge = neighbour && neighbour.label.xy && neighbour.label.xy.x + neighbour.getLabelSides()[isFirst ? 0 : 1];\n\n if ((isFirst && !reversed) || (isLast && reversed)) {\n // Is the label spilling out to the left of the plot area?\n if (pxPos + leftSide < axisLeft) {\n\n // Align it to plot left\n pxPos = axisLeft - leftSide;\n\n // Hide it if it now overlaps the neighbour label\n if (neighbour && pxPos + rightSide > neighbourEdge) {\n show = false;\n }\n }\n\n } else {\n // Is the label spilling out to the right of the plot area?\n if (pxPos + rightSide > axisRight) {\n\n // Align it to plot right\n pxPos = axisRight - rightSide;\n\n // Hide it if it now overlaps the neighbour label\n if (neighbour && pxPos + leftSide < neighbourEdge) {\n show = false;\n }\n\n }\n }\n\n // Set the modified x position of the label\n xy.x = pxPos;\n }\n return show;\n },\n\n /**\n * Get the x and y position for ticks and labels\n */\n getPosition: function (horiz, pos, tickmarkOffset, old) {\n var axis = this.axis,\n chart = axis.chart,\n cHeight = (old && chart.oldChartHeight) || chart.chartHeight;\n\n return {\n x: horiz ?\n axis.translate(pos + tickmarkOffset, null, null, old) + axis.transB :\n axis.left + axis.offset + (axis.opposite ? ((old && chart.oldChartWidth) || chart.chartWidth) - axis.right - axis.left : 0),\n\n y: horiz ?\n cHeight - axis.bottom + axis.offset - (axis.opposite ? axis.height : 0) :\n cHeight - axis.translate(pos + tickmarkOffset, null, null, old) - axis.transB\n };\n\n },\n\n /**\n * Get the x, y position of the tick label\n */\n getLabelPosition: function (x, y, label, horiz, labelOptions, tickmarkOffset, index, step) {\n var axis = this.axis,\n transA = axis.transA,\n reversed = axis.reversed,\n staggerLines = axis.staggerLines;\n\n x = x + labelOptions.x - (tickmarkOffset && horiz ?\n tickmarkOffset * transA * (reversed ? -1 : 1) : 0);\n y = y + this.yOffset - (tickmarkOffset && !horiz ?\n tickmarkOffset * transA * (reversed ? 1 : -1) : 0);\n\n // Correct for staggered labels\n if (staggerLines) {\n label.line = (index / (step || 1) % staggerLines);\n y += label.line * (axis.labelOffset / staggerLines);\n }\n\n return {\n x: x,\n y: y\n };\n },\n\n /**\n * Extendible method to return the path of the marker\n */\n getMarkPath: function (x, y, tickLength, tickWidth, horiz, renderer) {\n return renderer.crispLine([\n M,\n x,\n y,\n L,\n x + (horiz ? 0 : -tickLength),\n y + (horiz ? tickLength : 0)\n ], tickWidth);\n },\n\n /**\n * Put everything in place\n *\n * @param index {Number}\n * @param old {Boolean} Use old coordinates to prepare an animation into new position\n */\n render: function (index, old, opacity) {\n var tick = this,\n axis = tick.axis,\n options = axis.options,\n chart = axis.chart,\n renderer = chart.renderer,\n horiz = axis.horiz,\n type = tick.type,\n label = tick.label,\n pos = tick.pos,\n labelOptions = options.labels,\n gridLine = tick.gridLine,\n gridPrefix = type ? type + 'Grid' : 'grid',\n tickPrefix = type ? type + 'Tick' : 'tick',\n gridLineWidth = options[gridPrefix + 'LineWidth'],\n gridLineColor = options[gridPrefix + 'LineColor'],\n dashStyle = options[gridPrefix + 'LineDashStyle'],\n tickLength = options[tickPrefix + 'Length'],\n tickWidth = options[tickPrefix + 'Width'] || 0,\n tickColor = options[tickPrefix + 'Color'],\n tickPosition = options[tickPrefix + 'Position'],\n gridLinePath,\n mark = tick.mark,\n markPath,\n step = labelOptions.step,\n attribs,\n show = true,\n tickmarkOffset = axis.tickmarkOffset,\n xy = tick.getPosition(horiz, pos, tickmarkOffset, old),\n x = xy.x,\n y = xy.y,\n reverseCrisp = ((horiz && x === axis.pos + axis.len) || (!horiz && y === axis.pos)) ? -1 : 1; // #1480, #1687\n\n opacity = pick(opacity, 1);\n this.isActive = true;\n\n // create the grid line\n if (gridLineWidth) {\n gridLinePath = axis.getPlotLinePath(pos + tickmarkOffset, gridLineWidth * reverseCrisp, old, true);\n\n if (gridLine === UNDEFINED) {\n attribs = {\n stroke: gridLineColor,\n 'stroke-width': gridLineWidth\n };\n if (dashStyle) {\n attribs.dashstyle = dashStyle;\n }\n if (!type) {\n attribs.zIndex = 1;\n }\n if (old) {\n attribs.opacity = 0;\n }\n tick.gridLine = gridLine =\n gridLineWidth ?\n renderer.path(gridLinePath)\n .attr(attribs).add(axis.gridGroup) :\n null;\n }\n\n // If the parameter 'old' is set, the current call will be followed\n // by another call, therefore do not do any animations this time\n if (!old && gridLine && gridLinePath) {\n gridLine[tick.isNew ? 'attr' : 'animate']({\n d: gridLinePath,\n opacity: opacity\n });\n }\n }\n\n // create the tick mark\n if (tickWidth && tickLength) {\n\n // negate the length\n if (tickPosition === 'inside') {\n tickLength = -tickLength;\n }\n if (axis.opposite) {\n tickLength = -tickLength;\n }\n\n markPath = tick.getMarkPath(x, y, tickLength, tickWidth * reverseCrisp, horiz, renderer);\n if (mark) { // updating\n mark.animate({\n d: markPath,\n opacity: opacity\n });\n } else { // first time\n tick.mark = renderer.path(\n markPath\n ).attr({\n stroke: tickColor,\n 'stroke-width': tickWidth,\n opacity: opacity\n }).add(axis.axisGroup);\n }\n }\n\n // the label is created on init - now move it into place\n if (label && !isNaN(x)) {\n label.xy = xy = tick.getLabelPosition(x, y, label, horiz, labelOptions, tickmarkOffset, index, step);\n\n // Apply show first and show last. If the tick is both first and last, it is\n // a single centered tick, in which case we show the label anyway (#2100).\n if ((tick.isFirst && !tick.isLast && !pick(options.showFirstLabel, 1)) ||\n (tick.isLast && !tick.isFirst && !pick(options.showLastLabel, 1))) {\n show = false;\n\n // Handle label overflow and show or hide accordingly\n } else if (!axis.isRadial && !labelOptions.step && !labelOptions.rotation && !old && opacity !== 0) {\n show = tick.handleOverflow(index, xy);\n }\n\n // apply step\n if (step && index % step) {\n // show those indices dividable by step\n show = false;\n }\n\n // Set the new position, and show or hide\n if (show && !isNaN(xy.y)) {\n xy.opacity = opacity;\n label[tick.isNew ? 'attr' : 'animate'](xy);\n tick.isNew = false;\n } else {\n label.attr('y', -9999); // #1338\n }\n }\n },\n\n /**\n * Destructor for the tick prototype\n */\n destroy: function () {\n destroyObjectProperties(this, this.axis);\n }\n };\n\n /**\n * The object wrapper for plot lines and plot bands\n * @param {Object} options\n */\n Highcharts.PlotLineOrBand = function (axis, options) {\n this.axis = axis;\n\n if (options) {\n this.options = options;\n this.id = options.id;\n }\n };\n\n Highcharts.PlotLineOrBand.prototype = {\n\n /**\n * Render the plot line or plot band. If it is already existing,\n * move it.\n */\n render: function () {\n var plotLine = this,\n axis = plotLine.axis,\n horiz = axis.horiz,\n halfPointRange = (axis.pointRange || 0) / 2,\n options = plotLine.options,\n optionsLabel = options.label,\n label = plotLine.label,\n width = options.width,\n to = options.to,\n from = options.from,\n isBand = defined(from) && defined(to),\n value = options.value,\n dashStyle = options.dashStyle,\n svgElem = plotLine.svgElem,\n path = [],\n addEvent,\n eventType,\n xs,\n ys,\n x,\n y,\n color = options.color,\n zIndex = options.zIndex,\n events = options.events,\n attribs = {},\n renderer = axis.chart.renderer;\n\n // logarithmic conversion\n if (axis.isLog) {\n from = log2lin(from);\n to = log2lin(to);\n value = log2lin(value);\n }\n\n // plot line\n if (width) {\n path = axis.getPlotLinePath(value, width);\n attribs = {\n stroke: color,\n 'stroke-width': width\n };\n if (dashStyle) {\n attribs.dashstyle = dashStyle;\n }\n } else if (isBand) { // plot band\n\n // keep within plot area\n from = mathMax(from, axis.min - halfPointRange);\n to = mathMin(to, axis.max + halfPointRange);\n\n path = axis.getPlotBandPath(from, to, options);\n if (color) {\n attribs.fill = color;\n }\n if (options.borderWidth) {\n attribs.stroke = options.borderColor;\n attribs['stroke-width'] = options.borderWidth;\n }\n } else {\n return;\n }\n // zIndex\n if (defined(zIndex)) {\n attribs.zIndex = zIndex;\n }\n\n // common for lines and bands\n if (svgElem) {\n if (path) {\n svgElem.animate({\n d: path\n }, null, svgElem.onGetPath);\n } else {\n svgElem.hide();\n svgElem.onGetPath = function () {\n svgElem.show();\n };\n if (label) {\n plotLine.label = label = label.destroy();\n }\n }\n } else if (path && path.length) {\n plotLine.svgElem = svgElem = renderer.path(path)\n .attr(attribs).add();\n\n // events\n if (events) {\n addEvent = function (eventType) {\n svgElem.on(eventType, function (e) {\n events[eventType].apply(plotLine, [e]);\n });\n };\n for (eventType in events) {\n addEvent(eventType);\n }\n }\n }\n\n // the plot band/line label\n if (optionsLabel && defined(optionsLabel.text) && path && path.length && axis.width > 0 && axis.height > 0) {\n // apply defaults\n optionsLabel = merge({\n align: horiz && isBand && 'center',\n x: horiz ? !isBand && 4 : 10,\n verticalAlign : !horiz && isBand && 'middle',\n y: horiz ? isBand ? 16 : 10 : isBand ? 6 : -4,\n rotation: horiz && !isBand && 90\n }, optionsLabel);\n\n // add the SVG element\n if (!label) {\n attribs = {\n align: optionsLabel.textAlign || optionsLabel.align,\n rotation: optionsLabel.rotation\n };\n if (defined(zIndex)) {\n attribs.zIndex = zIndex;\n }\n plotLine.label = label = renderer.text(\n optionsLabel.text,\n 0,\n 0,\n optionsLabel.useHTML\n )\n .attr(attribs)\n .css(optionsLabel.style)\n .add();\n }\n\n // get the bounding box and align the label\n // #3000 changed to better handle choice between plotband or plotline\n xs = [path[1], path[4], (isBand ? path[6] : path[1])];\n ys = [path[2], path[5], (isBand ? path[7] : path[2])];\n x = arrayMin(xs);\n y = arrayMin(ys);\n\n label.align(optionsLabel, false, {\n x: x,\n y: y,\n width: arrayMax(xs) - x,\n height: arrayMax(ys) - y\n });\n label.show();\n\n } else if (label) { // move out of sight\n label.hide();\n }\n\n // chainable\n return plotLine;\n },\n\n /**\n * Remove the plot line or band\n */\n destroy: function () {\n // remove it from the lookup\n erase(this.axis.plotLinesAndBands, this);\n\n delete this.axis;\n destroyObjectProperties(this);\n }\n };\n\n /**\n * Object with members for extending the Axis prototype\n */\n\n AxisPlotLineOrBandExtension = {\n\n /**\n * Create the path for a plot band\n */\n getPlotBandPath: function (from, to) {\n var toPath = this.getPlotLinePath(to),\n path = this.getPlotLinePath(from);\n\n if (path && toPath) {\n path.push(\n toPath[4],\n toPath[5],\n toPath[1],\n toPath[2]\n );\n } else { // outside the axis area\n path = null;\n }\n\n return path;\n },\n\n addPlotBand: function (options) {\n return this.addPlotBandOrLine(options, 'plotBands');\n },\n\n addPlotLine: function (options) {\n return this.addPlotBandOrLine(options, 'plotLines');\n },\n\n /**\n * Add a plot band or plot line after render time\n *\n * @param options {Object} The plotBand or plotLine configuration object\n */\n addPlotBandOrLine: function (options, coll) {\n var obj = new Highcharts.PlotLineOrBand(this, options).render(),\n userOptions = this.userOptions;\n\n if (obj) { // #2189\n // Add it to the user options for exporting and Axis.update\n if (coll) {\n userOptions[coll] = userOptions[coll] || [];\n userOptions[coll].push(options);\n }\n this.plotLinesAndBands.push(obj);\n }\n\n return obj;\n },\n\n /**\n * Remove a plot band or plot line from the chart by id\n * @param {Object} id\n */\n removePlotBandOrLine: function (id) {\n var plotLinesAndBands = this.plotLinesAndBands,\n options = this.options,\n userOptions = this.userOptions,\n i = plotLinesAndBands.length;\n while (i--) {\n if (plotLinesAndBands[i].id === id) {\n plotLinesAndBands[i].destroy();\n }\n }\n each([options.plotLines || [], userOptions.plotLines || [], options.plotBands || [], userOptions.plotBands || []], function (arr) {\n i = arr.length;\n while (i--) {\n if (arr[i].id === id) {\n erase(arr, arr[i]);\n }\n }\n });\n }\n };\n\n /**\n * Create a new axis object\n * @param {Object} chart\n * @param {Object} options\n */\n function Axis() {\n this.init.apply(this, arguments);\n }\n\n Axis.prototype = {\n\n /**\n * Default options for the X axis - the Y axis has extended defaults\n */\n defaultOptions: {\n // allowDecimals: null,\n // alternateGridColor: null,\n // categories: [],\n dateTimeLabelFormats: {\n millisecond: '%H:%M:%S.%L',\n second: '%H:%M:%S',\n minute: '%H:%M',\n hour: '%H:%M',\n day: '%e. %b',\n week: '%e. %b',\n month: '%b \\'%y',\n year: '%Y'\n },\n endOnTick: false,\n gridLineColor: '#C0C0C0',\n // gridLineDashStyle: 'solid',\n // gridLineWidth: 0,\n // reversed: false,\n\n labels: defaultLabelOptions,\n // { step: null },\n lineColor: '#C0D0E0',\n lineWidth: 1,\n //linkedTo: null,\n //max: undefined,\n //min: undefined,\n minPadding: 0.01,\n maxPadding: 0.01,\n //minRange: null,\n minorGridLineColor: '#E0E0E0',\n // minorGridLineDashStyle: null,\n minorGridLineWidth: 1,\n minorTickColor: '#A0A0A0',\n //minorTickInterval: null,\n minorTickLength: 2,\n minorTickPosition: 'outside', // inside or outside\n //minorTickWidth: 0,\n //opposite: false,\n //offset: 0,\n //plotBands: [{\n //\tevents: {},\n //\tzIndex: 1,\n //\tlabels: { align, x, verticalAlign, y, style, rotation, textAlign }\n //}],\n //plotLines: [{\n //\tevents: {}\n // dashStyle: {}\n //\tzIndex:\n //\tlabels: { align, x, verticalAlign, y, style, rotation, textAlign }\n //}],\n //reversed: false,\n // showFirstLabel: true,\n // showLastLabel: true,\n startOfWeek: 1,\n startOnTick: false,\n tickColor: '#C0D0E0',\n //tickInterval: null,\n tickLength: 10,\n tickmarkPlacement: 'between', // on or between\n tickPixelInterval: 100,\n tickPosition: 'outside',\n tickWidth: 1,\n title: {\n //text: null,\n align: 'middle', // low, middle or high\n //margin: 0 for horizontal, 10 for vertical axes,\n //rotation: 0,\n //side: 'outside',\n style: {\n color: '#707070'\n }\n //x: 0,\n //y: 0\n },\n type: 'linear' // linear, logarithmic or datetime\n },\n\n /**\n * This options set extends the defaultOptions for Y axes\n */\n defaultYAxisOptions: {\n endOnTick: true,\n gridLineWidth: 1,\n tickPixelInterval: 72,\n showLastLabel: true,\n labels: {\n x: -8,\n y: 3\n },\n lineWidth: 0,\n maxPadding: 0.05,\n minPadding: 0.05,\n startOnTick: true,\n tickWidth: 0,\n title: {\n rotation: 270,\n text: 'Values'\n },\n stackLabels: {\n enabled: false,\n //align: dynamic,\n //y: dynamic,\n //x: dynamic,\n //verticalAlign: dynamic,\n //textAlign: dynamic,\n //rotation: 0,\n formatter: function () {\n return numberFormat(this.total, -1);\n },\n style: defaultLabelOptions.style\n }\n },\n\n /**\n * These options extend the defaultOptions for left axes\n */\n defaultLeftAxisOptions: {\n labels: {\n x: -15,\n y: null\n },\n title: {\n rotation: 270\n }\n },\n\n /**\n * These options extend the defaultOptions for right axes\n */\n defaultRightAxisOptions: {\n labels: {\n x: 15,\n y: null\n },\n title: {\n rotation: 90\n }\n },\n\n /**\n * These options extend the defaultOptions for bottom axes\n */\n defaultBottomAxisOptions: {\n labels: {\n x: 0,\n y: null // based on font size\n // overflow: undefined,\n // staggerLines: null\n },\n title: {\n rotation: 0\n }\n },\n /**\n * These options extend the defaultOptions for left axes\n */\n defaultTopAxisOptions: {\n labels: {\n x: 0,\n y: -15\n // overflow: undefined\n // staggerLines: null\n },\n title: {\n rotation: 0\n }\n },\n\n /**\n * Initialize the axis\n */\n init: function (chart, userOptions) {\n\n\n var isXAxis = userOptions.isX,\n axis = this;\n\n // Flag, is the axis horizontal\n axis.horiz = chart.inverted ? !isXAxis : isXAxis;\n\n // Flag, isXAxis\n axis.isXAxis = isXAxis;\n axis.coll = isXAxis ? 'xAxis' : 'yAxis';\n\n axis.opposite = userOptions.opposite; // needed in setOptions\n axis.side = userOptions.side || (axis.horiz ?\n (axis.opposite ? 0 : 2) : // top : bottom\n (axis.opposite ? 1 : 3)); // right : left\n\n axis.setOptions(userOptions);\n\n\n var options = this.options,\n type = options.type,\n isDatetimeAxis = type === 'datetime';\n\n axis.labelFormatter = options.labels.formatter || axis.defaultLabelFormatter; // can be overwritten by dynamic format\n\n\n // Flag, stagger lines or not\n axis.userOptions = userOptions;\n\n //axis.axisTitleMargin = UNDEFINED,// = options.title.margin,\n axis.minPixelPadding = 0;\n //axis.ignoreMinPadding = UNDEFINED; // can be set to true by a column or bar series\n //axis.ignoreMaxPadding = UNDEFINED;\n\n axis.chart = chart;\n axis.reversed = options.reversed;\n axis.zoomEnabled = options.zoomEnabled !== false;\n\n // Initial categories\n axis.categories = options.categories || type === 'category';\n axis.names = [];\n\n // Elements\n //axis.axisGroup = UNDEFINED;\n //axis.gridGroup = UNDEFINED;\n //axis.axisTitle = UNDEFINED;\n //axis.axisLine = UNDEFINED;\n\n // Shorthand types\n axis.isLog = type === 'logarithmic';\n axis.isDatetimeAxis = isDatetimeAxis;\n\n // Flag, if axis is linked to another axis\n axis.isLinked = defined(options.linkedTo);\n // Linked axis.\n //axis.linkedParent = UNDEFINED;\n\n // Tick positions\n //axis.tickPositions = UNDEFINED; // array containing predefined positions\n // Tick intervals\n //axis.tickInterval = UNDEFINED;\n //axis.minorTickInterval = UNDEFINED;\n\n axis.tickmarkOffset = (axis.categories && options.tickmarkPlacement === 'between' &&\n pick(options.tickInterval, 1) === 1) ? 0.5 : 0; // #3202\n\n // Major ticks\n axis.ticks = {};\n axis.labelEdge = [];\n // Minor ticks\n axis.minorTicks = {};\n //axis.tickAmount = UNDEFINED;\n\n // List of plotLines/Bands\n axis.plotLinesAndBands = [];\n\n // Alternate bands\n axis.alternateBands = {};\n\n // Axis metrics\n //axis.left = UNDEFINED;\n //axis.top = UNDEFINED;\n //axis.width = UNDEFINED;\n //axis.height = UNDEFINED;\n //axis.bottom = UNDEFINED;\n //axis.right = UNDEFINED;\n //axis.transA = UNDEFINED;\n //axis.transB = UNDEFINED;\n //axis.oldTransA = UNDEFINED;\n axis.len = 0;\n //axis.oldMin = UNDEFINED;\n //axis.oldMax = UNDEFINED;\n //axis.oldUserMin = UNDEFINED;\n //axis.oldUserMax = UNDEFINED;\n //axis.oldAxisLength = UNDEFINED;\n axis.minRange = axis.userMinRange = options.minRange || options.maxZoom;\n axis.range = options.range;\n axis.offset = options.offset || 0;\n\n\n // Dictionary for stacks\n axis.stacks = {};\n axis.oldStacks = {};\n\n // Min and max in the data\n //axis.dataMin = UNDEFINED,\n //axis.dataMax = UNDEFINED,\n\n // The axis range\n axis.max = null;\n axis.min = null;\n\n // User set min and max\n //axis.userMin = UNDEFINED,\n //axis.userMax = UNDEFINED,\n\n // Crosshair options\n axis.crosshair = pick(options.crosshair, splat(chart.options.tooltip.crosshairs)[isXAxis ? 0 : 1], false);\n // Run Axis\n\n var eventType,\n events = axis.options.events;\n\n // Register\n if (inArray(axis, chart.axes) === -1) { // don't add it again on Axis.update()\n if (isXAxis && !this.isColorAxis) { // #2713\n chart.axes.splice(chart.xAxis.length, 0, axis);\n } else {\n chart.axes.push(axis);\n }\n\n chart[axis.coll].push(axis);\n }\n\n axis.series = axis.series || []; // populated by Series\n\n // inverted charts have reversed xAxes as default\n if (chart.inverted && isXAxis && axis.reversed === UNDEFINED) {\n axis.reversed = true;\n }\n\n axis.removePlotBand = axis.removePlotBandOrLine;\n axis.removePlotLine = axis.removePlotBandOrLine;\n\n\n // register event listeners\n for (eventType in events) {\n addEvent(axis, eventType, events[eventType]);\n }\n\n // extend logarithmic axis\n if (axis.isLog) {\n axis.val2lin = log2lin;\n axis.lin2val = lin2log;\n }\n },\n\n /**\n * Merge and set options\n */\n setOptions: function (userOptions) {\n this.options = merge(\n this.defaultOptions,\n this.isXAxis ? {} : this.defaultYAxisOptions,\n [this.defaultTopAxisOptions, this.defaultRightAxisOptions,\n this.defaultBottomAxisOptions, this.defaultLeftAxisOptions][this.side],\n merge(\n defaultOptions[this.coll], // if set in setOptions (#1053)\n userOptions\n )\n );\n },\n\n /**\n * The default label formatter. The context is a special config object for the label.\n */\n defaultLabelFormatter: function () {\n var axis = this.axis,\n value = this.value,\n categories = axis.categories,\n dateTimeLabelFormat = this.dateTimeLabelFormat,\n numericSymbols = defaultOptions.lang.numericSymbols,\n i = numericSymbols && numericSymbols.length,\n multi,\n ret,\n formatOption = axis.options.labels.format,\n\n // make sure the same symbol is added for all labels on a linear axis\n numericSymbolDetector = axis.isLog ? value : axis.tickInterval;\n\n if (formatOption) {\n ret = format(formatOption, this);\n\n } else if (categories) {\n ret = value;\n\n } else if (dateTimeLabelFormat) { // datetime axis\n ret = dateFormat(dateTimeLabelFormat, value);\n\n } else if (i && numericSymbolDetector >= 1000) {\n // Decide whether we should add a numeric symbol like k (thousands) or M (millions).\n // If we are to enable this in tooltip or other places as well, we can move this\n // logic to the numberFormatter and enable it by a parameter.\n while (i-- && ret === UNDEFINED) {\n multi = Math.pow(1000, i + 1);\n if (numericSymbolDetector >= multi && numericSymbols[i] !== null) {\n ret = numberFormat(value / multi, -1) + numericSymbols[i];\n }\n }\n }\n\n if (ret === UNDEFINED) {\n if (mathAbs(value) >= 10000) { // add thousands separators\n ret = numberFormat(value, 0);\n\n } else { // small numbers\n ret = numberFormat(value, -1, UNDEFINED, ''); // #2466\n }\n }\n\n return ret;\n },\n\n /**\n * Get the minimum and maximum for the series of each axis\n */\n getSeriesExtremes: function () {\n var axis = this,\n chart = axis.chart;\n\n axis.hasVisibleSeries = false;\n\n // Reset properties in case we're redrawing (#3353)\n axis.dataMin = axis.dataMax = axis.ignoreMinPadding = axis.ignoreMaxPadding = null;\n\n if (axis.buildStacks) {\n axis.buildStacks();\n }\n\n // loop through this axis' series\n each(axis.series, function (series) {\n\n if (series.visible || !chart.options.chart.ignoreHiddenSeries) {\n\n var seriesOptions = series.options,\n xData,\n threshold = seriesOptions.threshold,\n seriesDataMin,\n seriesDataMax;\n\n axis.hasVisibleSeries = true;\n\n // Validate threshold in logarithmic axes\n if (axis.isLog && threshold <= 0) {\n threshold = null;\n }\n\n // Get dataMin and dataMax for X axes\n if (axis.isXAxis) {\n xData = series.xData;\n if (xData.length) {\n axis.dataMin = mathMin(pick(axis.dataMin, xData[0]), arrayMin(xData));\n axis.dataMax = mathMax(pick(axis.dataMax, xData[0]), arrayMax(xData));\n }\n\n // Get dataMin and dataMax for Y axes, as well as handle stacking and processed data\n } else {\n\n // Get this particular series extremes\n series.getExtremes();\n seriesDataMax = series.dataMax;\n seriesDataMin = series.dataMin;\n\n // Get the dataMin and dataMax so far. If percentage is used, the min and max are\n // always 0 and 100. If seriesDataMin and seriesDataMax is null, then series\n // doesn't have active y data, we continue with nulls\n if (defined(seriesDataMin) && defined(seriesDataMax)) {\n axis.dataMin = mathMin(pick(axis.dataMin, seriesDataMin), seriesDataMin);\n axis.dataMax = mathMax(pick(axis.dataMax, seriesDataMax), seriesDataMax);\n }\n\n // Adjust to threshold\n if (defined(threshold)) {\n if (axis.dataMin >= threshold) {\n axis.dataMin = threshold;\n axis.ignoreMinPadding = true;\n } else if (axis.dataMax < threshold) {\n axis.dataMax = threshold;\n axis.ignoreMaxPadding = true;\n }\n }\n }\n }\n });\n },\n\n /**\n * Translate from axis value to pixel position on the chart, or back\n *\n */\n translate: function (val, backwards, cvsCoord, old, handleLog, pointPlacement) {\n var axis = this,\n sign = 1,\n cvsOffset = 0,\n localA = old ? axis.oldTransA : axis.transA,\n localMin = old ? axis.oldMin : axis.min,\n returnValue,\n minPixelPadding = axis.minPixelPadding,\n postTranslate = (axis.options.ordinal || (axis.isLog && handleLog)) && axis.lin2val;\n\n if (!localA) {\n localA = axis.transA;\n }\n\n // In vertical axes, the canvas coordinates start from 0 at the top like in\n // SVG.\n if (cvsCoord) {\n sign *= -1; // canvas coordinates inverts the value\n cvsOffset = axis.len;\n }\n\n // Handle reversed axis\n if (axis.reversed) {\n sign *= -1;\n cvsOffset -= sign * (axis.sector || axis.len);\n }\n\n // From pixels to value\n if (backwards) { // reverse translation\n\n val = val * sign + cvsOffset;\n val -= minPixelPadding;\n returnValue = val / localA + localMin; // from chart pixel to value\n if (postTranslate) { // log and ordinal axes\n returnValue = axis.lin2val(returnValue);\n }\n\n // From value to pixels\n } else {\n if (postTranslate) { // log and ordinal axes\n val = axis.val2lin(val);\n }\n if (pointPlacement === 'between') {\n pointPlacement = 0.5;\n }\n returnValue = sign * (val - localMin) * localA + cvsOffset + (sign * minPixelPadding) +\n (isNumber(pointPlacement) ? localA * pointPlacement * axis.pointRange : 0);\n }\n\n return returnValue;\n },\n\n /**\n * Utility method to translate an axis value to pixel position.\n * @param {Number} value A value in terms of axis units\n * @param {Boolean} paneCoordinates Whether to return the pixel coordinate relative to the chart\n * or just the axis/pane itself.\n */\n toPixels: function (value, paneCoordinates) {\n return this.translate(value, false, !this.horiz, null, true) + (paneCoordinates ? 0 : this.pos);\n },\n\n /*\n * Utility method to translate a pixel position in to an axis value\n * @param {Number} pixel The pixel value coordinate\n * @param {Boolean} paneCoordiantes Whether the input pixel is relative to the chart or just the\n * axis/pane itself.\n */\n toValue: function (pixel, paneCoordinates) {\n return this.translate(pixel - (paneCoordinates ? 0 : this.pos), true, !this.horiz, null, true);\n },\n\n /**\n * Create the path for a plot line that goes from the given value on\n * this axis, across the plot to the opposite side\n * @param {Number} value\n * @param {Number} lineWidth Used for calculation crisp line\n * @param {Number] old Use old coordinates (for resizing and rescaling)\n\t */\n getPlotLinePath: function (value, lineWidth, old, force, translatedValue) {\n var axis = this,\n chart = axis.chart,\n axisLeft = axis.left,\n axisTop = axis.top,\n x1,\n y1,\n x2,\n y2,\n cHeight = (old && chart.oldChartHeight) || chart.chartHeight,\n cWidth = (old && chart.oldChartWidth) || chart.chartWidth,\n skip,\n transB = axis.transB;\n\n translatedValue = pick(translatedValue, axis.translate(value, null, null, old));\n x1 = x2 = mathRound(translatedValue + transB);\n y1 = y2 = mathRound(cHeight - translatedValue - transB);\n\n if (isNaN(translatedValue)) { // no min or max\n skip = true;\n\n } else if (axis.horiz) {\n y1 = axisTop;\n y2 = cHeight - axis.bottom;\n if (x1 < axisLeft || x1 > axisLeft + axis.width) {\n skip = true;\n }\n } else {\n x1 = axisLeft;\n x2 = cWidth - axis.right;\n\n if (y1 < axisTop || y1 > axisTop + axis.height) {\n skip = true;\n }\n }\n return skip && !force ?\n null :\n chart.renderer.crispLine([M, x1, y1, L, x2, y2], lineWidth || 1);\n },\n\n /**\n * Set the tick positions of a linear axis to round values like whole tens or every five.\n */\n getLinearTickPositions: function (tickInterval, min, max) {\n var pos,\n lastPos,\n roundedMin = correctFloat(mathFloor(min / tickInterval) * tickInterval),\n roundedMax = correctFloat(mathCeil(max / tickInterval) * tickInterval),\n tickPositions = [];\n\n // For single points, add a tick regardless of the relative position (#2662)\n if (min === max && isNumber(min)) {\n return [min];\n }\n\n // Populate the intermediate values\n pos = roundedMin;\n while (pos <= roundedMax) {\n\n // Place the tick on the rounded value\n tickPositions.push(pos);\n\n // Always add the raw tickInterval, not the corrected one.\n pos = correctFloat(pos + tickInterval);\n\n // If the interval is not big enough in the current min - max range to actually increase\n // the loop variable, we need to break out to prevent endless loop. Issue #619\n if (pos === lastPos) {\n break;\n }\n\n // Record the last value\n lastPos = pos;\n }\n return tickPositions;\n },\n\n /**\n * Return the minor tick positions. For logarithmic axes, reuse the same logic\n * as for major ticks.\n */\n getMinorTickPositions: function () {\n var axis = this,\n options = axis.options,\n tickPositions = axis.tickPositions,\n minorTickInterval = axis.minorTickInterval,\n minorTickPositions = [],\n pos,\n i,\n len;\n\n if (axis.isLog) {\n len = tickPositions.length;\n for (i = 1; i < len; i++) {\n minorTickPositions = minorTickPositions.concat(\n axis.getLogTickPositions(minorTickInterval, tickPositions[i - 1], tickPositions[i], true)\n );\n }\n } else if (axis.isDatetimeAxis && options.minorTickInterval === 'auto') { // #1314\n minorTickPositions = minorTickPositions.concat(\n axis.getTimeTicks(\n axis.normalizeTimeTickInterval(minorTickInterval),\n axis.min,\n axis.max,\n options.startOfWeek\n )\n );\n if (minorTickPositions[0] < axis.min) {\n minorTickPositions.shift();\n }\n } else {\n for (pos = axis.min + (tickPositions[0] - axis.min) % minorTickInterval; pos <= axis.max; pos += minorTickInterval) {\n minorTickPositions.push(pos);\n }\n }\n return minorTickPositions;\n },\n\n /**\n * Adjust the min and max for the minimum range. Keep in mind that the series data is\n * not yet processed, so we don't have information on data cropping and grouping, or\n * updated axis.pointRange or series.pointRange. The data can't be processed until\n * we have finally established min and max.\n */\n adjustForMinRange: function () {\n var axis = this,\n options = axis.options,\n min = axis.min,\n max = axis.max,\n zoomOffset,\n spaceAvailable = axis.dataMax - axis.dataMin >= axis.minRange,\n closestDataRange,\n i,\n distance,\n xData,\n loopLength,\n minArgs,\n maxArgs;\n\n // Set the automatic minimum range based on the closest point distance\n if (axis.isXAxis && axis.minRange === UNDEFINED && !axis.isLog) {\n\n if (defined(options.min) || defined(options.max)) {\n axis.minRange = null; // don't do this again\n\n } else {\n\n // Find the closest distance between raw data points, as opposed to\n // closestPointRange that applies to processed points (cropped and grouped)\n each(axis.series, function (series) {\n xData = series.xData;\n loopLength = series.xIncrement ? 1 : xData.length - 1;\n for (i = loopLength; i > 0; i--) {\n distance = xData[i] - xData[i - 1];\n if (closestDataRange === UNDEFINED || distance < closestDataRange) {\n closestDataRange = distance;\n }\n }\n });\n axis.minRange = mathMin(closestDataRange * 5, axis.dataMax - axis.dataMin);\n }\n }\n\n // if minRange is exceeded, adjust\n if (max - min < axis.minRange) {\n var minRange = axis.minRange;\n zoomOffset = (minRange - max + min) / 2;\n\n // if min and max options have been set, don't go beyond it\n minArgs = [min - zoomOffset, pick(options.min, min - zoomOffset)];\n if (spaceAvailable) { // if space is available, stay within the data range\n minArgs[2] = axis.dataMin;\n }\n min = arrayMax(minArgs);\n\n maxArgs = [min + minRange, pick(options.max, min + minRange)];\n if (spaceAvailable) { // if space is availabe, stay within the data range\n maxArgs[2] = axis.dataMax;\n }\n\n max = arrayMin(maxArgs);\n\n // now if the max is adjusted, adjust the min back\n if (max - min < minRange) {\n minArgs[0] = max - minRange;\n minArgs[1] = pick(options.min, max - minRange);\n min = arrayMax(minArgs);\n }\n }\n\n // Record modified extremes\n axis.min = min;\n axis.max = max;\n },\n\n /**\n * Update translation information\n */\n setAxisTranslation: function (saveOld) {\n var axis = this,\n range = axis.max - axis.min,\n pointRange = axis.axisPointRange || 0,\n closestPointRange,\n minPointOffset = 0,\n pointRangePadding = 0,\n linkedParent = axis.linkedParent,\n ordinalCorrection,\n hasCategories = !!axis.categories,\n transA = axis.transA;\n\n // Adjust translation for padding. Y axis with categories need to go through the same (#1784).\n if (axis.isXAxis || hasCategories || pointRange) {\n if (linkedParent) {\n minPointOffset = linkedParent.minPointOffset;\n pointRangePadding = linkedParent.pointRangePadding;\n\n } else {\n each(axis.series, function (series) {\n var seriesPointRange = hasCategories ? 1 : (axis.isXAxis ? series.pointRange : (axis.axisPointRange || 0)), // #2806\n pointPlacement = series.options.pointPlacement,\n seriesClosestPointRange = series.closestPointRange;\n\n if (seriesPointRange > range) { // #1446\n seriesPointRange = 0;\n }\n pointRange = mathMax(pointRange, seriesPointRange);\n\n // minPointOffset is the value padding to the left of the axis in order to make\n // room for points with a pointRange, typically columns. When the pointPlacement option\n // is 'between' or 'on', this padding does not apply.\n minPointOffset = mathMax(\n minPointOffset,\n isString(pointPlacement) ? 0 : seriesPointRange / 2\n );\n\n // Determine the total padding needed to the length of the axis to make room for the\n // pointRange. If the series' pointPlacement is 'on', no padding is added.\n pointRangePadding = mathMax(\n pointRangePadding,\n pointPlacement === 'on' ? 0 : seriesPointRange\n );\n\n // Set the closestPointRange\n if (!series.noSharedTooltip && defined(seriesClosestPointRange)) {\n closestPointRange = defined(closestPointRange) ?\n mathMin(closestPointRange, seriesClosestPointRange) :\n seriesClosestPointRange;\n }\n });\n }\n\n // Record minPointOffset and pointRangePadding\n ordinalCorrection = axis.ordinalSlope && closestPointRange ? axis.ordinalSlope / closestPointRange : 1; // #988, #1853\n axis.minPointOffset = minPointOffset = minPointOffset * ordinalCorrection;\n axis.pointRangePadding = pointRangePadding = pointRangePadding * ordinalCorrection;\n\n // pointRange means the width reserved for each point, like in a column chart\n axis.pointRange = mathMin(pointRange, range);\n\n // closestPointRange means the closest distance between points. In columns\n // it is mostly equal to pointRange, but in lines pointRange is 0 while closestPointRange\n // is some other value\n axis.closestPointRange = closestPointRange;\n }\n\n // Secondary values\n if (saveOld) {\n axis.oldTransA = transA;\n }\n axis.translationSlope = axis.transA = transA = axis.len / ((range + pointRangePadding) || 1);\n axis.transB = axis.horiz ? axis.left : axis.bottom; // translation addend\n axis.minPixelPadding = transA * minPointOffset;\n },\n\n /**\n * Set the tick positions to round values and optionally extend the extremes\n * to the nearest tick\n */\n setTickPositions: function (secondPass) {\n var axis = this,\n chart = axis.chart,\n options = axis.options,\n startOnTick = options.startOnTick,\n endOnTick = options.endOnTick,\n isLog = axis.isLog,\n isDatetimeAxis = axis.isDatetimeAxis,\n isXAxis = axis.isXAxis,\n isLinked = axis.isLinked,\n tickPositioner = axis.options.tickPositioner,\n maxPadding = options.maxPadding,\n minPadding = options.minPadding,\n length,\n linkedParentExtremes,\n tickIntervalOption = options.tickInterval,\n minTickIntervalOption = options.minTickInterval,\n tickPixelIntervalOption = options.tickPixelInterval,\n tickPositions,\n keepTwoTicksOnly,\n categories = axis.categories;\n\n // linked axis gets the extremes from the parent axis\n if (isLinked) {\n axis.linkedParent = chart[axis.coll][options.linkedTo];\n linkedParentExtremes = axis.linkedParent.getExtremes();\n axis.min = pick(linkedParentExtremes.min, linkedParentExtremes.dataMin);\n axis.max = pick(linkedParentExtremes.max, linkedParentExtremes.dataMax);\n if (options.type !== axis.linkedParent.options.type) {\n error(11, 1); // Can't link axes of different type\n }\n } else { // initial min and max from the extreme data values\n axis.min = pick(axis.userMin, options.min, axis.dataMin);\n axis.max = pick(axis.userMax, options.max, axis.dataMax);\n }\n\n if (isLog) {\n if (!secondPass && mathMin(axis.min, pick(axis.dataMin, axis.min)) <= 0) { // #978\n error(10, 1); // Can't plot negative values on log axis\n }\n axis.min = correctFloat(log2lin(axis.min)); // correctFloat cures #934\n axis.max = correctFloat(log2lin(axis.max));\n }\n\n // handle zoomed range\n if (axis.range && defined(axis.max)) {\n axis.userMin = axis.min = mathMax(axis.min, axis.max - axis.range); // #618\n axis.userMax = axis.max;\n\n axis.range = null; // don't use it when running setExtremes\n }\n\n // Hook for adjusting this.min and this.max. Used by bubble series.\n if (axis.beforePadding) {\n axis.beforePadding();\n }\n\n // adjust min and max for the minimum range\n axis.adjustForMinRange();\n\n // Pad the values to get clear of the chart's edges. To avoid tickInterval taking the padding\n // into account, we do this after computing tick interval (#1337).\n if (!categories && !axis.axisPointRange && !axis.usePercentage && !isLinked && defined(axis.min) && defined(axis.max)) {\n length = axis.max - axis.min;\n if (length) {\n if (!defined(options.min) && !defined(axis.userMin) && minPadding && (axis.dataMin < 0 || !axis.ignoreMinPadding)) {\n axis.min -= length * minPadding;\n }\n if (!defined(options.max) && !defined(axis.userMax) && maxPadding && (axis.dataMax > 0 || !axis.ignoreMaxPadding)) {\n axis.max += length * maxPadding;\n }\n }\n }\n\n // Stay within floor and ceiling\n if (isNumber(options.floor)) {\n axis.min = mathMax(axis.min, options.floor);\n }\n if (isNumber(options.ceiling)) {\n axis.max = mathMin(axis.max, options.ceiling);\n }\n\n // get tickInterval\n if (axis.min === axis.max || axis.min === undefined || axis.max === undefined) {\n axis.tickInterval = 1;\n } else if (isLinked && !tickIntervalOption &&\n tickPixelIntervalOption === axis.linkedParent.options.tickPixelInterval) {\n axis.tickInterval = axis.linkedParent.tickInterval;\n } else {\n axis.tickInterval = pick(\n tickIntervalOption,\n categories ? // for categoried axis, 1 is default, for linear axis use tickPix\n 1 :\n // don't let it be more than the data range\n (axis.max - axis.min) * tickPixelIntervalOption / mathMax(axis.len, tickPixelIntervalOption)\n );\n // For squished axes, set only two ticks\n if (!defined(tickIntervalOption) && axis.len < tickPixelIntervalOption && !this.isRadial &&\n !this.isLog && !categories && startOnTick && endOnTick) {\n keepTwoTicksOnly = true;\n axis.tickInterval /= 4; // tick extremes closer to the real values\n }\n }\n\n // Now we're finished detecting min and max, crop and group series data. This\n // is in turn needed in order to find tick positions in ordinal axes.\n if (isXAxis && !secondPass) {\n each(axis.series, function (series) {\n series.processData(axis.min !== axis.oldMin || axis.max !== axis.oldMax);\n });\n }\n\n // set the translation factor used in translate function\n axis.setAxisTranslation(true);\n\n // hook for ordinal axes and radial axes\n if (axis.beforeSetTickPositions) {\n axis.beforeSetTickPositions();\n }\n\n // hook for extensions, used in Highstock ordinal axes\n if (axis.postProcessTickInterval) {\n axis.tickInterval = axis.postProcessTickInterval(axis.tickInterval);\n }\n\n // In column-like charts, don't cramp in more ticks than there are points (#1943)\n if (axis.pointRange) {\n axis.tickInterval = mathMax(axis.pointRange, axis.tickInterval);\n }\n\n // Before normalizing the tick interval, handle minimum tick interval. This applies only if tickInterval is not defined.\n if (!tickIntervalOption && axis.tickInterval < minTickIntervalOption) {\n axis.tickInterval = minTickIntervalOption;\n }\n\n // for linear axes, get magnitude and normalize the interval\n if (!isDatetimeAxis && !isLog) { // linear\n if (!tickIntervalOption) {\n axis.tickInterval = normalizeTickInterval(\n axis.tickInterval,\n null,\n getMagnitude(axis.tickInterval),\n // If the tick interval is between 1 and 5 and the axis max is in the order of\n // thousands, chances are we are dealing with years. Don't allow decimals. #3363.\n pick(options.allowDecimals, !(axis.tickInterval > 1 && axis.tickInterval < 5 && axis.max > 1000 && axis.max < 9999))\n );\n }\n }\n\n // get minorTickInterval\n axis.minorTickInterval = options.minorTickInterval === 'auto' && axis.tickInterval ?\n axis.tickInterval / 5 : options.minorTickInterval;\n\n // find the tick positions\n axis.tickPositions = tickPositions = options.tickPositions ?\n [].concat(options.tickPositions) : // Work on a copy (#1565)\n (tickPositioner && tickPositioner.apply(axis, [axis.min, axis.max]));\n if (!tickPositions) {\n\n // Too many ticks\n if (!axis.ordinalPositions && (axis.max - axis.min) / axis.tickInterval > mathMax(2 * axis.len, 200)) {\n error(19, true);\n }\n\n if (isDatetimeAxis) {\n tickPositions = axis.getTimeTicks(\n axis.normalizeTimeTickInterval(axis.tickInterval, options.units),\n axis.min,\n axis.max,\n options.startOfWeek,\n axis.ordinalPositions,\n axis.closestPointRange,\n true\n );\n } else if (isLog) {\n tickPositions = axis.getLogTickPositions(axis.tickInterval, axis.min, axis.max);\n } else {\n tickPositions = axis.getLinearTickPositions(axis.tickInterval, axis.min, axis.max);\n }\n\n if (keepTwoTicksOnly) {\n tickPositions.splice(1, tickPositions.length - 2);\n }\n\n axis.tickPositions = tickPositions;\n }\n\n if (!isLinked) {\n\n // reset min/max or remove extremes based on start/end on tick\n var roundedMin = tickPositions[0],\n roundedMax = tickPositions[tickPositions.length - 1],\n minPointOffset = axis.minPointOffset || 0,\n singlePad;\n\n if (startOnTick) {\n axis.min = roundedMin;\n } else if (axis.min - minPointOffset > roundedMin) {\n tickPositions.shift();\n }\n\n if (endOnTick) {\n axis.max = roundedMax;\n } else if (axis.max + minPointOffset < roundedMax) {\n tickPositions.pop();\n }\n\n // If no tick are left, set one tick in the middle (#3195)\n if (tickPositions.length === 0 && defined(roundedMin)) {\n tickPositions.push((roundedMax + roundedMin) / 2);\n }\n\n // When there is only one point, or all points have the same value on this axis, then min\n // and max are equal and tickPositions.length is 0 or 1. In this case, add some padding\n // in order to center the point, but leave it with one tick. #1337.\n if (tickPositions.length === 1) {\n singlePad = mathAbs(axis.max) > 10e12 ? 1 : 0.001; // The lowest possible number to avoid extra padding on columns (#2619, #2846)\n axis.min -= singlePad;\n axis.max += singlePad;\n }\n }\n },\n\n /**\n * Set the max ticks of either the x and y axis collection\n */\n setMaxTicks: function () {\n\n var chart = this.chart,\n maxTicks = chart.maxTicks || {},\n tickPositions = this.tickPositions,\n key = this._maxTicksKey = [this.coll, this.pos, this.len].join('-');\n\n if (!this.isLinked && !this.isDatetimeAxis && tickPositions && tickPositions.length > (maxTicks[key] || 0) && this.options.alignTicks !== false) {\n maxTicks[key] = tickPositions.length;\n }\n chart.maxTicks = maxTicks;\n },\n\n /**\n * When using multiple axes, adjust the number of ticks to match the highest\n * number of ticks in that group\n */\n adjustTickAmount: function () {\n var axis = this,\n chart = axis.chart,\n key = axis._maxTicksKey,\n tickPositions = axis.tickPositions,\n maxTicks = chart.maxTicks;\n\n if (maxTicks && maxTicks[key] && !axis.isDatetimeAxis && !axis.categories && !axis.isLinked &&\n axis.options.alignTicks !== false && this.min !== UNDEFINED) {\n var oldTickAmount = axis.tickAmount,\n calculatedTickAmount = tickPositions.length,\n tickAmount;\n\n // set the axis-level tickAmount to use below\n axis.tickAmount = tickAmount = maxTicks[key];\n\n if (calculatedTickAmount < tickAmount) {\n while (tickPositions.length < tickAmount) {\n tickPositions.push(correctFloat(\n tickPositions[tickPositions.length - 1] + axis.tickInterval\n ));\n }\n axis.transA *= (calculatedTickAmount - 1) / (tickAmount - 1);\n axis.max = tickPositions[tickPositions.length - 1];\n\n }\n if (defined(oldTickAmount) && tickAmount !== oldTickAmount) {\n axis.isDirty = true;\n }\n }\n },\n\n /**\n * Set the scale based on data min and max, user set min and max or options\n *\n */\n setScale: function () {\n var axis = this,\n stacks = axis.stacks,\n type,\n i,\n isDirtyData,\n isDirtyAxisLength;\n\n axis.oldMin = axis.min;\n axis.oldMax = axis.max;\n axis.oldAxisLength = axis.len;\n\n // set the new axisLength\n axis.setAxisSize();\n //axisLength = horiz ? axisWidth : axisHeight;\n isDirtyAxisLength = axis.len !== axis.oldAxisLength;\n\n // is there new data?\n each(axis.series, function (series) {\n if (series.isDirtyData || series.isDirty ||\n series.xAxis.isDirty) { // when x axis is dirty, we need new data extremes for y as well\n isDirtyData = true;\n }\n });\n\n // do we really need to go through all this?\n if (isDirtyAxisLength || isDirtyData || axis.isLinked || axis.forceRedraw ||\n axis.userMin !== axis.oldUserMin || axis.userMax !== axis.oldUserMax) {\n\n // reset stacks\n if (!axis.isXAxis) {\n for (type in stacks) {\n for (i in stacks[type]) {\n stacks[type][i].total = null;\n stacks[type][i].cum = 0;\n }\n }\n }\n\n axis.forceRedraw = false;\n\n // get data extremes if needed\n axis.getSeriesExtremes();\n\n // get fixed positions based on tickInterval\n axis.setTickPositions();\n\n // record old values to decide whether a rescale is necessary later on (#540)\n axis.oldUserMin = axis.userMin;\n axis.oldUserMax = axis.userMax;\n\n // Mark as dirty if it is not already set to dirty and extremes have changed. #595.\n if (!axis.isDirty) {\n axis.isDirty = isDirtyAxisLength || axis.min !== axis.oldMin || axis.max !== axis.oldMax;\n }\n } else if (!axis.isXAxis) {\n if (axis.oldStacks) {\n stacks = axis.stacks = axis.oldStacks;\n }\n\n // reset stacks\n for (type in stacks) {\n for (i in stacks[type]) {\n stacks[type][i].cum = stacks[type][i].total;\n }\n }\n }\n\n // Set the maximum tick amount\n axis.setMaxTicks();\n },\n\n /**\n * Set the extremes and optionally redraw\n * @param {Number} newMin\n * @param {Number} newMax\n * @param {Boolean} redraw\n * @param {Boolean|Object} animation Whether to apply animation, and optionally animation\n * configuration\n * @param {Object} eventArguments\n *\n */\n setExtremes: function (newMin, newMax, redraw, animation, eventArguments) {\n var axis = this,\n chart = axis.chart;\n\n redraw = pick(redraw, true); // defaults to true\n\n // Extend the arguments with min and max\n eventArguments = extend(eventArguments, {\n min: newMin,\n max: newMax\n });\n\n // Fire the event\n fireEvent(axis, 'setExtremes', eventArguments, function () { // the default event handler\n\n axis.userMin = newMin;\n axis.userMax = newMax;\n axis.eventArgs = eventArguments;\n\n // Mark for running afterSetExtremes\n axis.isDirtyExtremes = true;\n\n // redraw\n if (redraw) {\n chart.redraw(animation);\n }\n });\n },\n\n /**\n * Overridable method for zooming chart. Pulled out in a separate method to allow overriding\n * in stock charts.\n */\n zoom: function (newMin, newMax) {\n var dataMin = this.dataMin,\n dataMax = this.dataMax,\n options = this.options;\n\n // Prevent pinch zooming out of range. Check for defined is for #1946. #1734.\n if (!this.allowZoomOutside) {\n if (defined(dataMin) && newMin <= mathMin(dataMin, pick(options.min, dataMin))) {\n newMin = UNDEFINED;\n }\n if (defined(dataMax) && newMax >= mathMax(dataMax, pick(options.max, dataMax))) {\n newMax = UNDEFINED;\n }\n }\n\n // In full view, displaying the reset zoom button is not required\n this.displayBtn = newMin !== UNDEFINED || newMax !== UNDEFINED;\n\n // Do it\n this.setExtremes(\n newMin,\n newMax,\n false,\n UNDEFINED,\n { trigger: 'zoom' }\n );\n return true;\n },\n\n /**\n * Update the axis metrics\n */\n setAxisSize: function () {\n var chart = this.chart,\n options = this.options,\n offsetLeft = options.offsetLeft || 0,\n offsetRight = options.offsetRight || 0,\n horiz = this.horiz,\n width = pick(options.width, chart.plotWidth - offsetLeft + offsetRight),\n height = pick(options.height, chart.plotHeight),\n top = pick(options.top, chart.plotTop),\n left = pick(options.left, chart.plotLeft + offsetLeft),\n percentRegex = /%$/;\n\n // Check for percentage based input values\n if (percentRegex.test(height)) {\n height = parseInt(height, 10) / 100 * chart.plotHeight;\n }\n if (percentRegex.test(top)) {\n top = parseInt(top, 10) / 100 * chart.plotHeight + chart.plotTop;\n }\n\n // Expose basic values to use in Series object and navigator\n this.left = left;\n this.top = top;\n this.width = width;\n this.height = height;\n this.bottom = chart.chartHeight - height - top;\n this.right = chart.chartWidth - width - left;\n\n // Direction agnostic properties\n this.len = mathMax(horiz ? width : height, 0); // mathMax fixes #905\n this.pos = horiz ? left : top; // distance from SVG origin\n },\n\n /**\n * Get the actual axis extremes\n */\n getExtremes: function () {\n var axis = this,\n isLog = axis.isLog;\n\n return {\n min: isLog ? correctFloat(lin2log(axis.min)) : axis.min,\n max: isLog ? correctFloat(lin2log(axis.max)) : axis.max,\n dataMin: axis.dataMin,\n dataMax: axis.dataMax,\n userMin: axis.userMin,\n userMax: axis.userMax\n };\n },\n\n /**\n * Get the zero plane either based on zero or on the min or max value.\n * Used in bar and area plots\n */\n getThreshold: function (threshold) {\n var axis = this,\n isLog = axis.isLog;\n\n var realMin = isLog ? lin2log(axis.min) : axis.min,\n realMax = isLog ? lin2log(axis.max) : axis.max;\n\n if (realMin > threshold || threshold === null) {\n threshold = realMin;\n } else if (realMax < threshold) {\n threshold = realMax;\n }\n\n return axis.translate(threshold, 0, 1, 0, 1);\n },\n\n /**\n * Compute auto alignment for the axis label based on which side the axis is on\n * and the given rotation for the label\n */\n autoLabelAlign: function (rotation) {\n var ret,\n angle = (pick(rotation, 0) - (this.side * 90) + 720) % 360;\n\n if (angle > 15 && angle < 165) {\n ret = 'right';\n } else if (angle > 195 && angle < 345) {\n ret = 'left';\n } else {\n ret = 'center';\n }\n return ret;\n },\n\n /**\n * Render the tick labels to a preliminary position to get their sizes\n */\n getOffset: function () {\n var axis = this,\n chart = axis.chart,\n renderer = chart.renderer,\n options = axis.options,\n tickPositions = axis.tickPositions,\n ticks = axis.ticks,\n horiz = axis.horiz,\n side = axis.side,\n invertedSide = chart.inverted ? [1, 0, 3, 2][side] : side,\n hasData,\n showAxis,\n titleOffset = 0,\n titleOffsetOption,\n titleMargin = 0,\n axisTitleOptions = options.title,\n labelOptions = options.labels,\n labelOffset = 0, // reset\n labelOffsetPadded,\n axisOffset = chart.axisOffset,\n clipOffset = chart.clipOffset,\n directionFactor = [-1, 1, 1, -1][side],\n n,\n i,\n autoStaggerLines = 1,\n maxStaggerLines = pick(labelOptions.maxStaggerLines, 5),\n sortedPositions,\n lastRight,\n overlap,\n pos,\n bBox,\n x,\n w,\n lineNo,\n lineHeightCorrection;\n\n // For reuse in Axis.render\n axis.hasData = hasData = (axis.hasVisibleSeries || (defined(axis.min) && defined(axis.max) && !!tickPositions));\n axis.showAxis = showAxis = hasData || pick(options.showEmpty, true);\n\n // Set/reset staggerLines\n axis.staggerLines = axis.horiz && labelOptions.staggerLines;\n\n // Create the axisGroup and gridGroup elements on first iteration\n if (!axis.axisGroup) {\n axis.gridGroup = renderer.g('grid')\n .attr({ zIndex: options.gridZIndex || 1 })\n .add();\n axis.axisGroup = renderer.g('axis')\n .attr({ zIndex: options.zIndex || 2 })\n .add();\n axis.labelGroup = renderer.g('axis-labels')\n .attr({ zIndex: labelOptions.zIndex || 7 })\n .addClass(PREFIX + axis.coll.toLowerCase() + '-labels')\n .add();\n }\n\n if (hasData || axis.isLinked) {\n\n // Set the explicit or automatic label alignment\n axis.labelAlign = pick(labelOptions.align || axis.autoLabelAlign(labelOptions.rotation));\n\n // Generate ticks\n each(tickPositions, function (pos) {\n if (!ticks[pos]) {\n ticks[pos] = new Tick(axis, pos);\n } else {\n ticks[pos].addLabel(); // update labels depending on tick interval\n }\n });\n\n // Handle automatic stagger lines\n if (axis.horiz && !axis.staggerLines && maxStaggerLines && !labelOptions.rotation) {\n sortedPositions = axis.reversed ? [].concat(tickPositions).reverse() : tickPositions;\n while (autoStaggerLines < maxStaggerLines) {\n lastRight = [];\n overlap = false;\n\n for (i = 0; i < sortedPositions.length; i++) {\n pos = sortedPositions[i];\n bBox = ticks[pos].label && ticks[pos].label.getBBox();\n w = bBox ? bBox.width : 0;\n lineNo = i % autoStaggerLines;\n\n if (w) {\n x = axis.translate(pos); // don't handle log\n if (lastRight[lineNo] !== UNDEFINED && x < lastRight[lineNo]) {\n overlap = true;\n }\n lastRight[lineNo] = x + w;\n }\n }\n if (overlap) {\n autoStaggerLines++;\n } else {\n break;\n }\n }\n\n if (autoStaggerLines > 1) {\n axis.staggerLines = autoStaggerLines;\n }\n }\n\n\n each(tickPositions, function (pos) {\n // left side must be align: right and right side must have align: left for labels\n if (side === 0 || side === 2 || { 1: 'left', 3: 'right' }[side] === axis.labelAlign) {\n\n // get the highest offset\n labelOffset = mathMax(\n ticks[pos].getLabelSize(),\n labelOffset\n );\n }\n });\n\n if (axis.staggerLines) {\n labelOffset *= axis.staggerLines;\n axis.labelOffset = labelOffset;\n }\n\n\n } else { // doesn't have data\n for (n in ticks) {\n ticks[n].destroy();\n delete ticks[n];\n }\n }\n\n if (axisTitleOptions && axisTitleOptions.text && axisTitleOptions.enabled !== false) {\n if (!axis.axisTitle) {\n axis.axisTitle = renderer.text(\n axisTitleOptions.text,\n 0,\n 0,\n axisTitleOptions.useHTML\n )\n .attr({\n zIndex: 7,\n rotation: axisTitleOptions.rotation || 0,\n align:\n axisTitleOptions.textAlign ||\n { low: 'left', middle: 'center', high: 'right' }[axisTitleOptions.align]\n })\n .addClass(PREFIX + this.coll.toLowerCase() + '-title')\n .css(axisTitleOptions.style)\n .add(axis.axisGroup);\n axis.axisTitle.isNew = true;\n }\n\n if (showAxis) {\n titleOffset = axis.axisTitle.getBBox()[horiz ? 'height' : 'width'];\n titleOffsetOption = axisTitleOptions.offset;\n titleMargin = defined(titleOffsetOption) ? 0 : pick(axisTitleOptions.margin, horiz ? 5 : 10);\n }\n\n // hide or show the title depending on whether showEmpty is set\n axis.axisTitle[showAxis ? 'show' : 'hide']();\n }\n\n // handle automatic or user set offset\n axis.offset = directionFactor * pick(options.offset, axisOffset[side]);\n\n lineHeightCorrection = side === 2 ? axis.tickBaseline : 0;\n labelOffsetPadded = labelOffset + titleMargin +\n (labelOffset && (directionFactor * (horiz ? pick(labelOptions.y, axis.tickBaseline + 8) : labelOptions.x) - lineHeightCorrection));\n axis.axisTitleMargin = pick(titleOffsetOption, labelOffsetPadded);\n\n axisOffset[side] = mathMax(\n axisOffset[side],\n axis.axisTitleMargin + titleOffset + directionFactor * axis.offset,\n labelOffsetPadded // #3027\n );\n clipOffset[invertedSide] = mathMax(clipOffset[invertedSide], mathFloor(options.lineWidth / 2) * 2);\n },\n\n /**\n * Get the path for the axis line\n */\n getLinePath: function (lineWidth) {\n var chart = this.chart,\n opposite = this.opposite,\n offset = this.offset,\n horiz = this.horiz,\n lineLeft = this.left + (opposite ? this.width : 0) + offset,\n lineTop = chart.chartHeight - this.bottom - (opposite ? this.height : 0) + offset;\n\n if (opposite) {\n lineWidth *= -1; // crispify the other way - #1480, #1687\n }\n\n return chart.renderer.crispLine([\n M,\n horiz ?\n this.left :\n lineLeft,\n horiz ?\n lineTop :\n this.top,\n L,\n horiz ?\n chart.chartWidth - this.right :\n lineLeft,\n horiz ?\n lineTop :\n chart.chartHeight - this.bottom\n ], lineWidth);\n },\n\n /**\n * Position the title\n */\n getTitlePosition: function () {\n // compute anchor points for each of the title align options\n var horiz = this.horiz,\n axisLeft = this.left,\n axisTop = this.top,\n axisLength = this.len,\n axisTitleOptions = this.options.title,\n margin = horiz ? axisLeft : axisTop,\n opposite = this.opposite,\n offset = this.offset,\n fontSize = pInt(axisTitleOptions.style.fontSize || 12),\n\n // the position in the length direction of the axis\n alongAxis = {\n low: margin + (horiz ? 0 : axisLength),\n middle: margin + axisLength / 2,\n high: margin + (horiz ? axisLength : 0)\n }[axisTitleOptions.align],\n\n // the position in the perpendicular direction of the axis\n offAxis = (horiz ? axisTop + this.height : axisLeft) +\n (horiz ? 1 : -1) * // horizontal axis reverses the margin\n (opposite ? -1 : 1) * // so does opposite axes\n this.axisTitleMargin +\n (this.side === 2 ? fontSize : 0);\n\n return {\n x: horiz ?\n alongAxis :\n offAxis + (opposite ? this.width : 0) + offset +\n (axisTitleOptions.x || 0), // x\n y: horiz ?\n offAxis - (opposite ? this.height : 0) + offset :\n alongAxis + (axisTitleOptions.y || 0) // y\n };\n },\n\n /**\n * Render the axis\n */\n render: function () {\n var axis = this,\n horiz = axis.horiz,\n reversed = axis.reversed,\n chart = axis.chart,\n renderer = chart.renderer,\n options = axis.options,\n isLog = axis.isLog,\n isLinked = axis.isLinked,\n tickPositions = axis.tickPositions,\n sortedPositions,\n axisTitle = axis.axisTitle,\n ticks = axis.ticks,\n minorTicks = axis.minorTicks,\n alternateBands = axis.alternateBands,\n stackLabelOptions = options.stackLabels,\n alternateGridColor = options.alternateGridColor,\n tickmarkOffset = axis.tickmarkOffset,\n lineWidth = options.lineWidth,\n linePath,\n hasRendered = chart.hasRendered,\n slideInTicks = hasRendered && defined(axis.oldMin) && !isNaN(axis.oldMin),\n hasData = axis.hasData,\n showAxis = axis.showAxis,\n from,\n overflow = options.labels.overflow,\n justifyLabels = axis.justifyLabels = horiz && overflow !== false,\n to;\n\n // Reset\n axis.labelEdge.length = 0;\n axis.justifyToPlot = overflow === 'justify';\n\n // Mark all elements inActive before we go over and mark the active ones\n each([ticks, minorTicks, alternateBands], function (coll) {\n var pos;\n for (pos in coll) {\n coll[pos].isActive = false;\n }\n });\n\n // If the series has data draw the ticks. Else only the line and title\n if (hasData || isLinked) {\n\n // minor ticks\n if (axis.minorTickInterval && !axis.categories) {\n each(axis.getMinorTickPositions(), function (pos) {\n if (!minorTicks[pos]) {\n minorTicks[pos] = new Tick(axis, pos, 'minor');\n }\n\n // render new ticks in old position\n if (slideInTicks && minorTicks[pos].isNew) {\n minorTicks[pos].render(null, true);\n }\n\n minorTicks[pos].render(null, false, 1);\n });\n }\n\n // Major ticks. Pull out the first item and render it last so that\n // we can get the position of the neighbour label. #808.\n if (tickPositions.length) { // #1300\n sortedPositions = tickPositions.slice();\n if ((horiz && reversed) || (!horiz && !reversed)) {\n sortedPositions.reverse();\n }\n if (justifyLabels) {\n sortedPositions = sortedPositions.slice(1).concat([sortedPositions[0]]);\n }\n each(sortedPositions, function (pos, i) {\n\n // Reorganize the indices\n if (justifyLabels) {\n i = (i === sortedPositions.length - 1) ? 0 : i + 1;\n }\n\n // linked axes need an extra check to find out if\n if (!isLinked || (pos >= axis.min && pos <= axis.max)) {\n\n if (!ticks[pos]) {\n ticks[pos] = new Tick(axis, pos);\n }\n\n // render new ticks in old position\n if (slideInTicks && ticks[pos].isNew) {\n ticks[pos].render(i, true, 0.1);\n }\n\n ticks[pos].render(i);\n }\n\n });\n // In a categorized axis, the tick marks are displayed between labels. So\n // we need to add a tick mark and grid line at the left edge of the X axis.\n if (tickmarkOffset && axis.min === 0) {\n if (!ticks[-1]) {\n ticks[-1] = new Tick(axis, -1, null, true);\n }\n ticks[-1].render(-1);\n }\n\n }\n\n // alternate grid color\n if (alternateGridColor) {\n each(tickPositions, function (pos, i) {\n if (i % 2 === 0 && pos < axis.max) {\n if (!alternateBands[pos]) {\n alternateBands[pos] = new Highcharts.PlotLineOrBand(axis);\n }\n from = pos + tickmarkOffset; // #949\n to = tickPositions[i + 1] !== UNDEFINED ? tickPositions[i + 1] + tickmarkOffset : axis.max;\n alternateBands[pos].options = {\n from: isLog ? lin2log(from) : from,\n to: isLog ? lin2log(to) : to,\n color: alternateGridColor\n };\n alternateBands[pos].render();\n alternateBands[pos].isActive = true;\n }\n });\n }\n\n // custom plot lines and bands\n if (!axis._addedPlotLB) { // only first time\n each((options.plotLines || []).concat(options.plotBands || []), function (plotLineOptions) {\n axis.addPlotBandOrLine(plotLineOptions);\n });\n axis._addedPlotLB = true;\n }\n\n } // end if hasData\n\n // Remove inactive ticks\n each([ticks, minorTicks, alternateBands], function (coll) {\n var pos,\n i,\n forDestruction = [],\n delay = globalAnimation ? globalAnimation.duration || 500 : 0,\n destroyInactiveItems = function () {\n i = forDestruction.length;\n while (i--) {\n // When resizing rapidly, the same items may be destroyed in different timeouts,\n // or the may be reactivated\n if (coll[forDestruction[i]] && !coll[forDestruction[i]].isActive) {\n coll[forDestruction[i]].destroy();\n delete coll[forDestruction[i]];\n }\n }\n\n };\n\n for (pos in coll) {\n\n if (!coll[pos].isActive) {\n // Render to zero opacity\n coll[pos].render(pos, false, 0);\n coll[pos].isActive = false;\n forDestruction.push(pos);\n }\n }\n\n // When the objects are finished fading out, destroy them\n if (coll === alternateBands || !chart.hasRendered || !delay) {\n destroyInactiveItems();\n } else if (delay) {\n setTimeout(destroyInactiveItems, delay);\n }\n });\n\n // Static items. As the axis group is cleared on subsequent calls\n // to render, these items are added outside the group.\n // axis line\n if (lineWidth) {\n linePath = axis.getLinePath(lineWidth);\n if (!axis.axisLine) {\n axis.axisLine = renderer.path(linePath)\n .attr({\n stroke: options.lineColor,\n 'stroke-width': lineWidth,\n zIndex: 7\n })\n .add(axis.axisGroup);\n } else {\n axis.axisLine.animate({ d: linePath });\n }\n\n // show or hide the line depending on options.showEmpty\n axis.axisLine[showAxis ? 'show' : 'hide']();\n }\n\n if (axisTitle && showAxis) {\n\n axisTitle[axisTitle.isNew ? 'attr' : 'animate'](\n axis.getTitlePosition()\n );\n axisTitle.isNew = false;\n }\n\n // Stacked totals:\n if (stackLabelOptions && stackLabelOptions.enabled) {\n axis.renderStackTotals();\n }\n // End stacked totals\n\n axis.isDirty = false;\n },\n\n /**\n * Redraw the axis to reflect changes in the data or axis extremes\n */\n redraw: function () {\n\n // render the axis\n this.render();\n\n // move plot lines and bands\n each(this.plotLinesAndBands, function (plotLine) {\n plotLine.render();\n });\n\n // mark associated series as dirty and ready for redraw\n each(this.series, function (series) {\n series.isDirty = true;\n });\n\n },\n\n /**\n * Destroys an Axis instance.\n */\n destroy: function (keepEvents) {\n var axis = this,\n stacks = axis.stacks,\n stackKey,\n plotLinesAndBands = axis.plotLinesAndBands,\n i;\n\n // Remove the events\n if (!keepEvents) {\n removeEvent(axis);\n }\n\n // Destroy each stack total\n for (stackKey in stacks) {\n destroyObjectProperties(stacks[stackKey]);\n\n stacks[stackKey] = null;\n }\n\n // Destroy collections\n each([axis.ticks, axis.minorTicks, axis.alternateBands], function (coll) {\n destroyObjectProperties(coll);\n });\n i = plotLinesAndBands.length;\n while (i--) { // #1975\n plotLinesAndBands[i].destroy();\n }\n\n // Destroy local variables\n each(['stackTotalGroup', 'axisLine', 'axisTitle', 'axisGroup', 'cross', 'gridGroup', 'labelGroup'], function (prop) {\n if (axis[prop]) {\n axis[prop] = axis[prop].destroy();\n }\n });\n\n // Destroy crosshair\n if (this.cross) {\n this.cross.destroy();\n }\n },\n\n /**\n * Draw the crosshair\n */\n drawCrosshair: function (e, point) {\n if (!this.crosshair) { return; }// Do not draw crosshairs if you don't have too.\n\n if ((defined(point) || !pick(this.crosshair.snap, true)) === false) {\n this.hideCrosshair();\n return;\n }\n\n var path,\n options = this.crosshair,\n animation = options.animation,\n pos;\n\n // Get the path\n if (!pick(options.snap, true)) {\n pos = (this.horiz ? e.chartX - this.pos : this.len - e.chartY + this.pos);\n } else if (defined(point)) {\n /*jslint eqeq: true*/\n pos = (this.chart.inverted != this.horiz) ? point.plotX : this.len - point.plotY;\n /*jslint eqeq: false*/\n }\n\n if (this.isRadial) {\n path = this.getPlotLinePath(this.isXAxis ? point.x : pick(point.stackY, point.y));\n } else {\n path = this.getPlotLinePath(null, null, null, null, pos);\n }\n\n if (path === null) {\n this.hideCrosshair();\n return;\n }\n\n // Draw the cross\n if (this.cross) {\n this.cross\n .attr({ visibility: VISIBLE })[animation ? 'animate' : 'attr']({ d: path }, animation);\n } else {\n var attribs = {\n 'stroke-width': options.width || 1,\n stroke: options.color || '#C0C0C0',\n zIndex: options.zIndex || 2\n };\n if (options.dashStyle) {\n attribs.dashstyle = options.dashStyle;\n }\n this.cross = this.chart.renderer.path(path).attr(attribs).add();\n }\n },\n\n /**\n *\tHide the crosshair.\n */\n hideCrosshair: function () {\n if (this.cross) {\n this.cross.hide();\n }\n }\n }; // end Axis\n\n extend(Axis.prototype, AxisPlotLineOrBandExtension);\n\n /**\n * Set the tick positions to a time unit that makes sense, for example\n * on the first of each month or on every Monday. Return an array\n * with the time positions. Used in datetime axes as well as for grouping\n * data on a datetime axis.\n *\n * @param {Object} normalizedInterval The interval in axis values (ms) and the count\n * @param {Number} min The minimum in axis values\n * @param {Number} max The maximum in axis values\n * @param {Number} startOfWeek\n */\n Axis.prototype.getTimeTicks = function (normalizedInterval, min, max, startOfWeek) {\n var tickPositions = [],\n i,\n higherRanks = {},\n useUTC = defaultOptions.global.useUTC,\n minYear, // used in months and years as a basis for Date.UTC()\n minDate = new Date(min - timezoneOffset),\n interval = normalizedInterval.unitRange,\n count = normalizedInterval.count;\n\n if (defined(min)) { // #1300\n if (interval >= timeUnits.second) { // second\n minDate.setMilliseconds(0);\n minDate.setSeconds(interval >= timeUnits.minute ? 0 :\n count * mathFloor(minDate.getSeconds() / count));\n }\n\n if (interval >= timeUnits.minute) { // minute\n minDate[setMinutes](interval >= timeUnits.hour ? 0 :\n count * mathFloor(minDate[getMinutes]() / count));\n }\n\n if (interval >= timeUnits.hour) { // hour\n minDate[setHours](interval >= timeUnits.day ? 0 :\n count * mathFloor(minDate[getHours]() / count));\n }\n\n if (interval >= timeUnits.day) { // day\n minDate[setDate](interval >= timeUnits.month ? 1 :\n count * mathFloor(minDate[getDate]() / count));\n }\n\n if (interval >= timeUnits.month) { // month\n minDate[setMonth](interval >= timeUnits.year ? 0 :\n count * mathFloor(minDate[getMonth]() / count));\n minYear = minDate[getFullYear]();\n }\n\n if (interval >= timeUnits.year) { // year\n minYear -= minYear % count;\n minDate[setFullYear](minYear);\n }\n\n // week is a special case that runs outside the hierarchy\n if (interval === timeUnits.week) {\n // get start of current week, independent of count\n minDate[setDate](minDate[getDate]() - minDate[getDay]() +\n pick(startOfWeek, 1));\n }\n\n\n // get tick positions\n i = 1;\n if (timezoneOffset) {\n minDate = new Date(minDate.getTime() + timezoneOffset);\n }\n minYear = minDate[getFullYear]();\n var time = minDate.getTime(),\n minMonth = minDate[getMonth](),\n minDateDate = minDate[getDate](),\n localTimezoneOffset = (timeUnits.day +\n (useUTC ? timezoneOffset : minDate.getTimezoneOffset() * 60 * 1000)\n ) % timeUnits.day; // #950, #3359\n\n // iterate and add tick positions at appropriate values\n while (time < max) {\n tickPositions.push(time);\n\n // if the interval is years, use Date.UTC to increase years\n if (interval === timeUnits.year) {\n time = makeTime(minYear + i * count, 0);\n\n // if the interval is months, use Date.UTC to increase months\n } else if (interval === timeUnits.month) {\n time = makeTime(minYear, minMonth + i * count);\n\n // if we're using global time, the interval is not fixed as it jumps\n // one hour at the DST crossover\n } else if (!useUTC && (interval === timeUnits.day || interval === timeUnits.week)) {\n time = makeTime(minYear, minMonth, minDateDate +\n i * count * (interval === timeUnits.day ? 1 : 7));\n\n // else, the interval is fixed and we use simple addition\n } else {\n time += interval * count;\n }\n\n i++;\n }\n\n // push the last time\n tickPositions.push(time);\n\n\n // mark new days if the time is dividible by day (#1649, #1760)\n each(grep(tickPositions, function (time) {\n return interval <= timeUnits.hour && time % timeUnits.day === localTimezoneOffset;\n }), function (time) {\n higherRanks[time] = 'day';\n });\n }\n\n\n // record information on the chosen unit - for dynamic label formatter\n tickPositions.info = extend(normalizedInterval, {\n higherRanks: higherRanks,\n totalRange: interval * count\n });\n\n return tickPositions;\n };\n\n /**\n * Get a normalized tick interval for dates. Returns a configuration object with\n * unit range (interval), count and name. Used to prepare data for getTimeTicks.\n * Previously this logic was part of getTimeTicks, but as getTimeTicks now runs\n * of segments in stock charts, the normalizing logic was extracted in order to\n * prevent it for running over again for each segment having the same interval.\n * #662, #697.\n */\n Axis.prototype.normalizeTimeTickInterval = function (tickInterval, unitsOption) {\n var units = unitsOption || [[\n 'millisecond', // unit name\n [1, 2, 5, 10, 20, 25, 50, 100, 200, 500] // allowed multiples\n ], [\n 'second',\n [1, 2, 5, 10, 15, 30]\n ], [\n 'minute',\n [1, 2, 5, 10, 15, 30]\n ], [\n 'hour',\n [1, 2, 3, 4, 6, 8, 12]\n ], [\n 'day',\n [1, 2]\n ], [\n 'week',\n [1, 2]\n ], [\n 'month',\n [1, 2, 3, 4, 6]\n ], [\n 'year',\n null\n ]],\n unit = units[units.length - 1], // default unit is years\n interval = timeUnits[unit[0]],\n multiples = unit[1],\n count,\n i;\n\n // loop through the units to find the one that best fits the tickInterval\n for (i = 0; i < units.length; i++) {\n unit = units[i];\n interval = timeUnits[unit[0]];\n multiples = unit[1];\n\n\n if (units[i + 1]) {\n // lessThan is in the middle between the highest multiple and the next unit.\n var lessThan = (interval * multiples[multiples.length - 1] +\n timeUnits[units[i + 1][0]]) / 2;\n\n // break and keep the current unit\n if (tickInterval <= lessThan) {\n break;\n }\n }\n }\n\n // prevent 2.5 years intervals, though 25, 250 etc. are allowed\n if (interval === timeUnits.year && tickInterval < 5 * interval) {\n multiples = [1, 2, 5];\n }\n\n // get the count\n count = normalizeTickInterval(\n tickInterval / interval,\n multiples,\n unit[0] === 'year' ? mathMax(getMagnitude(tickInterval / interval), 1) : 1 // #1913, #2360\n );\n\n return {\n unitRange: interval,\n count: count,\n unitName: unit[0]\n };\n };/**\n * Methods defined on the Axis prototype\n */\n\n /**\n * Set the tick positions of a logarithmic axis\n */\n Axis.prototype.getLogTickPositions = function (interval, min, max, minor) {\n var axis = this,\n options = axis.options,\n axisLength = axis.len,\n // Since we use this method for both major and minor ticks,\n // use a local variable and return the result\n positions = [];\n\n // Reset\n if (!minor) {\n axis._minorAutoInterval = null;\n }\n\n // First case: All ticks fall on whole logarithms: 1, 10, 100 etc.\n if (interval >= 0.5) {\n interval = mathRound(interval);\n positions = axis.getLinearTickPositions(interval, min, max);\n\n // Second case: We need intermediary ticks. For example\n // 1, 2, 4, 6, 8, 10, 20, 40 etc.\n } else if (interval >= 0.08) {\n var roundedMin = mathFloor(min),\n intermediate,\n i,\n j,\n len,\n pos,\n lastPos,\n break2;\n\n if (interval > 0.3) {\n intermediate = [1, 2, 4];\n } else if (interval > 0.15) { // 0.2 equals five minor ticks per 1, 10, 100 etc\n intermediate = [1, 2, 4, 6, 8];\n } else { // 0.1 equals ten minor ticks per 1, 10, 100 etc\n intermediate = [1, 2, 3, 4, 5, 6, 7, 8, 9];\n }\n\n for (i = roundedMin; i < max + 1 && !break2; i++) {\n len = intermediate.length;\n for (j = 0; j < len && !break2; j++) {\n pos = log2lin(lin2log(i) * intermediate[j]);\n if (pos > min && (!minor || lastPos <= max) && lastPos !== UNDEFINED) { // #1670, lastPos is #3113\n positions.push(lastPos);\n }\n\n if (lastPos > max) {\n break2 = true;\n }\n lastPos = pos;\n }\n }\n\n // Third case: We are so deep in between whole logarithmic values that\n // we might as well handle the tick positions like a linear axis. For\n // example 1.01, 1.02, 1.03, 1.04.\n } else {\n var realMin = lin2log(min),\n realMax = lin2log(max),\n tickIntervalOption = options[minor ? 'minorTickInterval' : 'tickInterval'],\n filteredTickIntervalOption = tickIntervalOption === 'auto' ? null : tickIntervalOption,\n tickPixelIntervalOption = options.tickPixelInterval / (minor ? 5 : 1),\n totalPixelLength = minor ? axisLength / axis.tickPositions.length : axisLength;\n\n interval = pick(\n filteredTickIntervalOption,\n axis._minorAutoInterval,\n (realMax - realMin) * tickPixelIntervalOption / (totalPixelLength || 1)\n );\n\n interval = normalizeTickInterval(\n interval,\n null,\n getMagnitude(interval)\n );\n\n positions = map(axis.getLinearTickPositions(\n interval,\n realMin,\n realMax\n ), log2lin);\n\n if (!minor) {\n axis._minorAutoInterval = interval / 5;\n }\n }\n\n // Set the axis-level tickInterval variable\n if (!minor) {\n axis.tickInterval = interval;\n }\n return positions;\n };/**\n * The tooltip object\n * @param {Object} chart The chart instance\n * @param {Object} options Tooltip options\n */\n var Tooltip = Highcharts.Tooltip = function () {\n this.init.apply(this, arguments);\n };\n\n Tooltip.prototype = {\n\n init: function (chart, options) {\n\n var borderWidth = options.borderWidth,\n style = options.style,\n padding = pInt(style.padding);\n\n // Save the chart and options\n this.chart = chart;\n this.options = options;\n\n // Keep track of the current series\n //this.currentSeries = UNDEFINED;\n\n // List of crosshairs\n this.crosshairs = [];\n\n // Current values of x and y when animating\n this.now = { x: 0, y: 0 };\n\n // The tooltip is initially hidden\n this.isHidden = true;\n\n\n // create the label\n this.label = chart.renderer.label('', 0, 0, options.shape || 'callout', null, null, options.useHTML, null, 'tooltip')\n .attr({\n padding: padding,\n fill: options.backgroundColor,\n 'stroke-width': borderWidth,\n r: options.borderRadius,\n zIndex: 8\n })\n .css(style)\n .css({ padding: 0 }) // Remove it from VML, the padding is applied as an attribute instead (#1117)\n .add()\n .attr({ y: -9999 }); // #2301, #2657\n\n // When using canVG the shadow shows up as a gray circle\n // even if the tooltip is hidden.\n if (!useCanVG) {\n this.label.shadow(options.shadow);\n }\n\n // Public property for getting the shared state.\n this.shared = options.shared;\n },\n\n /**\n * Destroy the tooltip and its elements.\n */\n destroy: function () {\n // Destroy and clear local variables\n if (this.label) {\n this.label = this.label.destroy();\n }\n clearTimeout(this.hideTimer);\n clearTimeout(this.tooltipTimeout);\n },\n\n /**\n * Provide a soft movement for the tooltip\n *\n * @param {Number} x\n * @param {Number} y\n * @private\n */\n move: function (x, y, anchorX, anchorY) {\n var tooltip = this,\n now = tooltip.now,\n animate = tooltip.options.animation !== false && !tooltip.isHidden &&\n // When we get close to the target position, abort animation and land on the right place (#3056)\n (mathAbs(x - now.x) > 1 || mathAbs(y - now.y) > 1),\n skipAnchor = tooltip.followPointer || tooltip.len > 1;\n\n // Get intermediate values for animation\n extend(now, {\n x: animate ? (2 * now.x + x) / 3 : x,\n y: animate ? (now.y + y) / 2 : y,\n anchorX: skipAnchor ? UNDEFINED : animate ? (2 * now.anchorX + anchorX) / 3 : anchorX,\n anchorY: skipAnchor ? UNDEFINED : animate ? (now.anchorY + anchorY) / 2 : anchorY\n });\n\n // Move to the intermediate value\n tooltip.label.attr(now);\n\n\n // Run on next tick of the mouse tracker\n if (animate) {\n\n // Never allow two timeouts\n clearTimeout(this.tooltipTimeout);\n\n // Set the fixed interval ticking for the smooth tooltip\n this.tooltipTimeout = setTimeout(function () {\n // The interval function may still be running during destroy, so check that the chart is really there before calling.\n if (tooltip) {\n tooltip.move(x, y, anchorX, anchorY);\n }\n }, 32);\n\n }\n },\n\n /**\n * Hide the tooltip\n */\n hide: function (delay) {\n var tooltip = this,\n hoverPoints;\n\n clearTimeout(this.hideTimer); // disallow duplicate timers (#1728, #1766)\n if (!this.isHidden) {\n hoverPoints = this.chart.hoverPoints;\n\n this.hideTimer = setTimeout(function () {\n tooltip.label.fadeOut();\n tooltip.isHidden = true;\n }, pick(delay, this.options.hideDelay, 500));\n\n // hide previous hoverPoints and set new\n if (hoverPoints) {\n each(hoverPoints, function (point) {\n point.setState();\n });\n }\n\n this.chart.hoverPoints = null;\n }\n },\n\n /**\n * Extendable method to get the anchor position of the tooltip\n * from a point or set of points\n */\n getAnchor: function (points, mouseEvent) {\n var ret,\n chart = this.chart,\n inverted = chart.inverted,\n plotTop = chart.plotTop,\n plotX = 0,\n plotY = 0,\n yAxis;\n\n points = splat(points);\n\n // Pie uses a special tooltipPos\n ret = points[0].tooltipPos;\n\n // When tooltip follows mouse, relate the position to the mouse\n if (this.followPointer && mouseEvent) {\n if (mouseEvent.chartX === UNDEFINED) {\n mouseEvent = chart.pointer.normalize(mouseEvent);\n }\n ret = [\n mouseEvent.chartX - chart.plotLeft,\n mouseEvent.chartY - plotTop\n ];\n }\n // When shared, use the average position\n if (!ret) {\n each(points, function (point) {\n yAxis = point.series.yAxis;\n plotX += point.plotX;\n plotY += (point.plotLow ? (point.plotLow + point.plotHigh) / 2 : point.plotY) +\n (!inverted && yAxis ? yAxis.top - plotTop : 0); // #1151\n });\n\n plotX /= points.length;\n plotY /= points.length;\n\n ret = [\n inverted ? chart.plotWidth - plotY : plotX,\n this.shared && !inverted && points.length > 1 && mouseEvent ?\n mouseEvent.chartY - plotTop : // place shared tooltip next to the mouse (#424)\n inverted ? chart.plotHeight - plotX : plotY\n ];\n }\n\n return map(ret, mathRound);\n },\n\n /**\n * Place the tooltip in a chart without spilling over\n * and not covering the point it self.\n */\n getPosition: function (boxWidth, boxHeight, point) {\n\n var chart = this.chart,\n distance = this.distance,\n ret = {},\n swapped,\n first = ['y', chart.chartHeight, boxHeight, point.plotY + chart.plotTop],\n second = ['x', chart.chartWidth, boxWidth, point.plotX + chart.plotLeft],\n // The far side is right or bottom\n preferFarSide = point.ttBelow || (chart.inverted && !point.negative) || (!chart.inverted && point.negative),\n /**\n * Handle the preferred dimension. When the preferred dimension is tooltip\n * on top or bottom of the point, it will look for space there.\n */\n firstDimension = function (dim, outerSize, innerSize, point) {\n var roomLeft = innerSize < point - distance,\n roomRight = point + distance + innerSize < outerSize,\n alignedLeft = point - distance - innerSize,\n alignedRight = point + distance;\n\n if (preferFarSide && roomRight) {\n ret[dim] = alignedRight;\n } else if (!preferFarSide && roomLeft) {\n ret[dim] = alignedLeft;\n } else if (roomLeft) {\n ret[dim] = alignedLeft;\n } else if (roomRight) {\n ret[dim] = alignedRight;\n } else {\n return false;\n }\n },\n /**\n * Handle the secondary dimension. If the preferred dimension is tooltip\n * on top or bottom of the point, the second dimension is to align the tooltip\n * above the point, trying to align center but allowing left or right\n * align within the chart box.\n */\n secondDimension = function (dim, outerSize, innerSize, point) {\n // Too close to the edge, return false and swap dimensions\n if (point < distance || point > outerSize - distance) {\n return false;\n\n // Align left/top\n } else if (point < innerSize / 2) {\n ret[dim] = 1;\n // Align right/bottom\n } else if (point > outerSize - innerSize / 2) {\n ret[dim] = outerSize - innerSize - 2;\n // Align center\n } else {\n ret[dim] = point - innerSize / 2;\n }\n },\n /**\n * Swap the dimensions\n */\n swap = function (count) {\n var temp = first;\n first = second;\n second = temp;\n swapped = count;\n },\n run = function () {\n if (firstDimension.apply(0, first) !== false) {\n if (secondDimension.apply(0, second) === false && !swapped) {\n swap(true);\n run();\n }\n } else if (!swapped) {\n swap(true);\n run();\n } else {\n ret.x = ret.y = 0;\n }\n };\n\n // Under these conditions, prefer the tooltip on the side of the point\n if (chart.inverted || this.len > 1) {\n swap();\n }\n run();\n\n return ret;\n\n },\n\n /**\n * In case no user defined formatter is given, this will be used. Note that the context\n * here is an object holding point, series, x, y etc.\n */\n defaultFormatter: function (tooltip) {\n var items = this.points || splat(this),\n series = items[0].series,\n s;\n\n // build the header\n s = [tooltip.tooltipHeaderFormatter(items[0])];\n\n // build the values\n each(items, function (item) {\n series = item.series;\n s.push((series.tooltipFormatter && series.tooltipFormatter(item)) ||\n item.point.tooltipFormatter(series.tooltipOptions.pointFormat));\n });\n\n // footer\n s.push(tooltip.options.footerFormat || '');\n\n return s.join('');\n },\n\n /**\n * Refresh the tooltip's text and position.\n * @param {Object} point\n */\n refresh: function (point, mouseEvent) {\n var tooltip = this,\n chart = tooltip.chart,\n label = tooltip.label,\n options = tooltip.options,\n x,\n y,\n anchor,\n textConfig = {},\n text,\n pointConfig = [],\n formatter = options.formatter || tooltip.defaultFormatter,\n hoverPoints = chart.hoverPoints,\n borderColor,\n shared = tooltip.shared,\n currentSeries;\n\n clearTimeout(this.hideTimer);\n\n // get the reference point coordinates (pie charts use tooltipPos)\n tooltip.followPointer = splat(point)[0].series.tooltipOptions.followPointer;\n anchor = tooltip.getAnchor(point, mouseEvent);\n x = anchor[0];\n y = anchor[1];\n\n // shared tooltip, array is sent over\n if (shared && !(point.series && point.series.noSharedTooltip)) {\n\n // hide previous hoverPoints and set new\n\n chart.hoverPoints = point;\n if (hoverPoints) {\n each(hoverPoints, function (point) {\n point.setState();\n });\n }\n\n each(point, function (item) {\n item.setState(HOVER_STATE);\n\n pointConfig.push(item.getLabelConfig());\n });\n\n textConfig = {\n x: point[0].category,\n y: point[0].y\n };\n textConfig.points = pointConfig;\n this.len = pointConfig.length;\n point = point[0];\n\n // single point tooltip\n } else {\n textConfig = point.getLabelConfig();\n }\n text = formatter.call(textConfig, tooltip);\n\n // register the current series\n currentSeries = point.series;\n this.distance = pick(currentSeries.tooltipOptions.distance, 16);\n\n // update the inner HTML\n if (text === false) {\n this.hide();\n } else {\n\n // show it\n if (tooltip.isHidden) {\n stop(label);\n label.attr('opacity', 1).show();\n }\n\n // update text\n label.attr({\n text: text\n });\n\n // set the stroke color of the box\n borderColor = options.borderColor || point.color || currentSeries.color || '#606060';\n label.attr({\n stroke: borderColor\n });\n\n tooltip.updatePosition({ plotX: x, plotY: y, negative: point.negative, ttBelow: point.ttBelow });\n\n this.isHidden = false;\n }\n fireEvent(chart, 'tooltipRefresh', {\n text: text,\n x: x + chart.plotLeft,\n y: y + chart.plotTop,\n borderColor: borderColor\n });\n },\n\n /**\n * Find the new position and perform the move\n */\n updatePosition: function (point) {\n var chart = this.chart,\n label = this.label,\n pos = (this.options.positioner || this.getPosition).call(\n this,\n label.width,\n label.height,\n point\n );\n\n // do the move\n this.move(\n mathRound(pos.x),\n mathRound(pos.y),\n point.plotX + chart.plotLeft,\n point.plotY + chart.plotTop\n );\n },\n\n\n /**\n * Format the header of the tooltip\n */\n tooltipHeaderFormatter: function (point) {\n var series = point.series,\n tooltipOptions = series.tooltipOptions,\n dateTimeLabelFormats = tooltipOptions.dateTimeLabelFormats,\n xDateFormat = tooltipOptions.xDateFormat,\n xAxis = series.xAxis,\n isDateTime = xAxis && xAxis.options.type === 'datetime' && isNumber(point.key),\n headerFormat = tooltipOptions.headerFormat,\n closestPointRange = xAxis && xAxis.closestPointRange,\n n;\n\n // Guess the best date format based on the closest point distance (#568)\n if (isDateTime && !xDateFormat) {\n if (closestPointRange) {\n for (n in timeUnits) {\n if (timeUnits[n] >= closestPointRange ||\n // If the point is placed every day at 23:59, we need to show\n // the minutes as well. This logic only works for time units less than\n // a day, since all higher time units are dividable by those. #2637.\n (timeUnits[n] <= timeUnits.day && point.key % timeUnits[n] > 0)) {\n xDateFormat = dateTimeLabelFormats[n];\n break;\n }\n }\n } else {\n xDateFormat = dateTimeLabelFormats.day;\n }\n\n xDateFormat = xDateFormat || dateTimeLabelFormats.year; // #2546, 2581\n\n }\n\n // Insert the header date format if any\n if (isDateTime && xDateFormat) {\n headerFormat = headerFormat.replace('{point.key}', '{point.key:' + xDateFormat + '}');\n }\n\n return format(headerFormat, {\n point: point,\n series: series\n });\n }\n };\n\n var hoverChartIndex;\n\n// Global flag for touch support\n hasTouch = doc.documentElement.ontouchstart !== UNDEFINED;\n\n /**\n * The mouse tracker object. All methods starting with \"on\" are primary DOM event handlers.\n * Subsequent methods should be named differently from what they are doing.\n * @param {Object} chart The Chart instance\n * @param {Object} options The root options object\n */\n var Pointer = Highcharts.Pointer = function (chart, options) {\n this.init(chart, options);\n };\n\n Pointer.prototype = {\n /**\n * Initialize Pointer\n */\n init: function (chart, options) {\n\n var chartOptions = options.chart,\n chartEvents = chartOptions.events,\n zoomType = useCanVG ? '' : chartOptions.zoomType,\n inverted = chart.inverted,\n zoomX,\n zoomY;\n\n // Store references\n this.options = options;\n this.chart = chart;\n\n // Zoom status\n this.zoomX = zoomX = /x/.test(zoomType);\n this.zoomY = zoomY = /y/.test(zoomType);\n this.zoomHor = (zoomX && !inverted) || (zoomY && inverted);\n this.zoomVert = (zoomY && !inverted) || (zoomX && inverted);\n this.hasZoom = zoomX || zoomY;\n\n // Do we need to handle click on a touch device?\n this.runChartClick = chartEvents && !!chartEvents.click;\n\n this.pinchDown = [];\n this.lastValidTouch = {};\n\n if (Highcharts.Tooltip && options.tooltip.enabled) {\n chart.tooltip = new Tooltip(chart, options.tooltip);\n this.followTouchMove = options.tooltip.followTouchMove;\n }\n\n this.setDOMEvents();\n },\n\n /**\n * Add crossbrowser support for chartX and chartY\n * @param {Object} e The event object in standard browsers\n */\n normalize: function (e, chartPosition) {\n var chartX,\n chartY,\n ePos;\n\n // common IE normalizing\n e = e || window.event;\n\n // Framework specific normalizing (#1165)\n e = washMouseEvent(e);\n\n // More IE normalizing, needs to go after washMouseEvent\n if (!e.target) {\n e.target = e.srcElement;\n }\n\n // iOS (#2757)\n ePos = e.touches ? (e.touches.length ? e.touches.item(0) : e.changedTouches[0]) : e;\n\n // Get mouse position\n if (!chartPosition) {\n this.chartPosition = chartPosition = offset(this.chart.container);\n }\n\n // chartX and chartY\n if (ePos.pageX === UNDEFINED) { // IE < 9. #886.\n chartX = mathMax(e.x, e.clientX - chartPosition.left); // #2005, #2129: the second case is\n // for IE10 quirks mode within framesets\n chartY = e.y;\n } else {\n chartX = ePos.pageX - chartPosition.left;\n chartY = ePos.pageY - chartPosition.top;\n }\n\n return extend(e, {\n chartX: mathRound(chartX),\n chartY: mathRound(chartY)\n });\n },\n\n /**\n * Get the click position in terms of axis values.\n *\n * @param {Object} e A pointer event\n */\n getCoordinates: function (e) {\n var coordinates = {\n xAxis: [],\n yAxis: []\n };\n\n each(this.chart.axes, function (axis) {\n coordinates[axis.isXAxis ? 'xAxis' : 'yAxis'].push({\n axis: axis,\n value: axis.toValue(e[axis.horiz ? 'chartX' : 'chartY'])\n });\n });\n return coordinates;\n },\n\n /**\n * Return the index in the tooltipPoints array, corresponding to pixel position in\n * the plot area.\n */\n getIndex: function (e) {\n var chart = this.chart;\n return chart.inverted ?\n chart.plotHeight + chart.plotTop - e.chartY :\n e.chartX - chart.plotLeft;\n },\n\n /**\n * With line type charts with a single tracker, get the point closest to the mouse.\n * Run Point.onMouseOver and display tooltip for the point or points.\n */\n runPointActions: function (e) {\n var pointer = this,\n chart = pointer.chart,\n series = chart.series,\n tooltip = chart.tooltip,\n followPointer,\n point,\n points,\n hoverPoint = chart.hoverPoint,\n hoverSeries = chart.hoverSeries,\n i,\n j,\n distance = chart.chartWidth,\n index = pointer.getIndex(e),\n anchor;\n\n // shared tooltip\n if (tooltip && pointer.options.tooltip.shared && !(hoverSeries && hoverSeries.noSharedTooltip)) {\n points = [];\n\n // loop over all series and find the ones with points closest to the mouse\n i = series.length;\n for (j = 0; j < i; j++) {\n if (series[j].visible &&\n series[j].options.enableMouseTracking !== false &&\n !series[j].noSharedTooltip && series[j].singularTooltips !== true && series[j].tooltipPoints.length) {\n point = series[j].tooltipPoints[index];\n if (point && point.series) { // not a dummy point, #1544\n point._dist = mathAbs(index - point.clientX);\n distance = mathMin(distance, point._dist);\n points.push(point);\n }\n }\n }\n // remove furthest points\n i = points.length;\n while (i--) {\n if (points[i]._dist > distance) {\n points.splice(i, 1);\n }\n }\n // refresh the tooltip if necessary\n if (points.length && (points[0].clientX !== pointer.hoverX)) {\n tooltip.refresh(points, e);\n pointer.hoverX = points[0].clientX;\n }\n }\n\n // Separate tooltip and general mouse events\n followPointer = hoverSeries && hoverSeries.tooltipOptions.followPointer;\n if (hoverSeries && hoverSeries.tracker && !followPointer) { // #2584, #2830\n\n // get the point\n point = hoverSeries.tooltipPoints[index];\n\n // a new point is hovered, refresh the tooltip\n if (point && point !== hoverPoint) {\n\n // trigger the events\n point.onMouseOver(e);\n\n }\n\n } else if (tooltip && followPointer && !tooltip.isHidden) {\n anchor = tooltip.getAnchor([{}], e);\n tooltip.updatePosition({ plotX: anchor[0], plotY: anchor[1] });\n }\n\n // Start the event listener to pick up the tooltip\n if (tooltip && !pointer._onDocumentMouseMove) {\n pointer._onDocumentMouseMove = function (e) {\n if (charts[hoverChartIndex]) {\n charts[hoverChartIndex].pointer.onDocumentMouseMove(e);\n }\n };\n addEvent(doc, 'mousemove', pointer._onDocumentMouseMove);\n }\n\n // Draw independent crosshairs\n each(chart.axes, function (axis) {\n axis.drawCrosshair(e, pick(point, hoverPoint));\n });\n },\n\n\n\n /**\n * Reset the tracking by hiding the tooltip, the hover series state and the hover point\n *\n * @param allowMove {Boolean} Instead of destroying the tooltip altogether, allow moving it if possible\n */\n reset: function (allowMove, delay) {\n var pointer = this,\n chart = pointer.chart,\n hoverSeries = chart.hoverSeries,\n hoverPoint = chart.hoverPoint,\n tooltip = chart.tooltip,\n tooltipPoints = tooltip && tooltip.shared ? chart.hoverPoints : hoverPoint;\n\n // Narrow in allowMove\n allowMove = allowMove && tooltip && tooltipPoints;\n\n // Check if the points have moved outside the plot area, #1003\n if (allowMove && splat(tooltipPoints)[0].plotX === UNDEFINED) {\n allowMove = false;\n }\n\n // Just move the tooltip, #349\n if (allowMove) {\n tooltip.refresh(tooltipPoints);\n if (hoverPoint) { // #2500\n hoverPoint.setState(hoverPoint.state, true);\n }\n\n // Full reset\n } else {\n\n if (hoverPoint) {\n hoverPoint.onMouseOut();\n }\n\n if (hoverSeries) {\n hoverSeries.onMouseOut();\n }\n\n if (tooltip) {\n tooltip.hide(delay);\n }\n\n if (pointer._onDocumentMouseMove) {\n removeEvent(doc, 'mousemove', pointer._onDocumentMouseMove);\n pointer._onDocumentMouseMove = null;\n }\n\n // Remove crosshairs\n each(chart.axes, function (axis) {\n axis.hideCrosshair();\n });\n\n pointer.hoverX = null;\n\n }\n },\n\n /**\n * Scale series groups to a certain scale and translation\n */\n scaleGroups: function (attribs, clip) {\n\n var chart = this.chart,\n seriesAttribs;\n\n // Scale each series\n each(chart.series, function (series) {\n seriesAttribs = attribs || series.getPlotBox(); // #1701\n if (series.xAxis && series.xAxis.zoomEnabled) {\n series.group.attr(seriesAttribs);\n if (series.markerGroup) {\n series.markerGroup.attr(seriesAttribs);\n series.markerGroup.clip(clip ? chart.clipRect : null);\n }\n if (series.dataLabelsGroup) {\n series.dataLabelsGroup.attr(seriesAttribs);\n }\n }\n });\n\n // Clip\n chart.clipRect.attr(clip || chart.clipBox);\n },\n\n /**\n * Start a drag operation\n */\n dragStart: function (e) {\n var chart = this.chart;\n\n // Record the start position\n chart.mouseIsDown = e.type;\n chart.cancelClick = false;\n chart.mouseDownX = this.mouseDownX = e.chartX;\n chart.mouseDownY = this.mouseDownY = e.chartY;\n },\n\n /**\n * Perform a drag operation in response to a mousemove event while the mouse is down\n */\n drag: function (e) {\n\n var chart = this.chart,\n chartOptions = chart.options.chart,\n chartX = e.chartX,\n chartY = e.chartY,\n zoomHor = this.zoomHor,\n zoomVert = this.zoomVert,\n plotLeft = chart.plotLeft,\n plotTop = chart.plotTop,\n plotWidth = chart.plotWidth,\n plotHeight = chart.plotHeight,\n clickedInside,\n size,\n mouseDownX = this.mouseDownX,\n mouseDownY = this.mouseDownY,\n panKey = chartOptions.panKey && e[chartOptions.panKey + 'Key'];\n\n // If the mouse is outside the plot area, adjust to cooordinates\n // inside to prevent the selection marker from going outside\n if (chartX < plotLeft) {\n chartX = plotLeft;\n } else if (chartX > plotLeft + plotWidth) {\n chartX = plotLeft + plotWidth;\n }\n\n if (chartY < plotTop) {\n chartY = plotTop;\n } else if (chartY > plotTop + plotHeight) {\n chartY = plotTop + plotHeight;\n }\n\n // determine if the mouse has moved more than 10px\n this.hasDragged = Math.sqrt(\n Math.pow(mouseDownX - chartX, 2) +\n Math.pow(mouseDownY - chartY, 2)\n );\n\n if (this.hasDragged > 10) {\n clickedInside = chart.isInsidePlot(mouseDownX - plotLeft, mouseDownY - plotTop);\n\n // make a selection\n if (chart.hasCartesianSeries && (this.zoomX || this.zoomY) && clickedInside && !panKey) {\n if (!this.selectionMarker) {\n this.selectionMarker = chart.renderer.rect(\n plotLeft,\n plotTop,\n zoomHor ? 1 : plotWidth,\n zoomVert ? 1 : plotHeight,\n 0\n )\n .attr({\n fill: chartOptions.selectionMarkerFill || 'rgba(69,114,167,0.25)',\n zIndex: 7\n })\n .add();\n }\n }\n\n // adjust the width of the selection marker\n if (this.selectionMarker && zoomHor) {\n size = chartX - mouseDownX;\n this.selectionMarker.attr({\n width: mathAbs(size),\n x: (size > 0 ? 0 : size) + mouseDownX\n });\n }\n // adjust the height of the selection marker\n if (this.selectionMarker && zoomVert) {\n size = chartY - mouseDownY;\n this.selectionMarker.attr({\n height: mathAbs(size),\n y: (size > 0 ? 0 : size) + mouseDownY\n });\n }\n\n // panning\n if (clickedInside && !this.selectionMarker && chartOptions.panning) {\n chart.pan(e, chartOptions.panning);\n }\n }\n },\n\n /**\n * On mouse up or touch end across the entire document, drop the selection.\n */\n drop: function (e) {\n var chart = this.chart,\n hasPinched = this.hasPinched;\n\n if (this.selectionMarker) {\n var selectionData = {\n xAxis: [],\n yAxis: [],\n originalEvent: e.originalEvent || e\n },\n selectionBox = this.selectionMarker,\n selectionLeft = selectionBox.attr ? selectionBox.attr('x') : selectionBox.x,\n selectionTop = selectionBox.attr ? selectionBox.attr('y') : selectionBox.y,\n selectionWidth = selectionBox.attr ? selectionBox.attr('width') : selectionBox.width,\n selectionHeight = selectionBox.attr ? selectionBox.attr('height') : selectionBox.height,\n runZoom;\n\n // a selection has been made\n if (this.hasDragged || hasPinched) {\n\n // record each axis' min and max\n each(chart.axes, function (axis) {\n if (axis.zoomEnabled) {\n var horiz = axis.horiz,\n minPixelPadding = e.type === 'touchend' ? axis.minPixelPadding: 0, // #1207, #3075\n selectionMin = axis.toValue((horiz ? selectionLeft : selectionTop) + minPixelPadding),\n selectionMax = axis.toValue((horiz ? selectionLeft + selectionWidth : selectionTop + selectionHeight) - minPixelPadding);\n\n if (!isNaN(selectionMin) && !isNaN(selectionMax)) { // #859\n selectionData[axis.coll].push({\n axis: axis,\n min: mathMin(selectionMin, selectionMax), // for reversed axes,\n max: mathMax(selectionMin, selectionMax)\n });\n runZoom = true;\n }\n }\n });\n if (runZoom) {\n fireEvent(chart, 'selection', selectionData, function (args) {\n chart.zoom(extend(args, hasPinched ? { animation: false } : null));\n });\n }\n\n }\n this.selectionMarker = this.selectionMarker.destroy();\n\n // Reset scaling preview\n if (hasPinched) {\n this.scaleGroups();\n }\n }\n\n // Reset all\n if (chart) { // it may be destroyed on mouse up - #877\n css(chart.container, { cursor: chart._cursor });\n chart.cancelClick = this.hasDragged > 10; // #370\n chart.mouseIsDown = this.hasDragged = this.hasPinched = false;\n this.pinchDown = [];\n }\n },\n\n onContainerMouseDown: function (e) {\n\n e = this.normalize(e);\n\n // issue #295, dragging not always working in Firefox\n if (e.preventDefault) {\n e.preventDefault();\n }\n\n this.dragStart(e);\n },\n\n\n\n onDocumentMouseUp: function (e) {\n if (charts[hoverChartIndex]) {\n charts[hoverChartIndex].pointer.drop(e);\n }\n },\n\n /**\n * Special handler for mouse move that will hide the tooltip when the mouse leaves the plotarea.\n * Issue #149 workaround. The mouseleave event does not always fire.\n */\n onDocumentMouseMove: function (e) {\n var chart = this.chart,\n chartPosition = this.chartPosition,\n hoverSeries = chart.hoverSeries;\n\n e = this.normalize(e, chartPosition);\n\n // If we're outside, hide the tooltip\n if (chartPosition && hoverSeries && !this.inClass(e.target, 'highcharts-tracker') &&\n !chart.isInsidePlot(e.chartX - chart.plotLeft, e.chartY - chart.plotTop)) {\n this.reset();\n }\n },\n\n /**\n * When mouse leaves the container, hide the tooltip.\n */\n onContainerMouseLeave: function () {\n var chart = charts[hoverChartIndex];\n if (chart) {\n chart.pointer.reset();\n chart.pointer.chartPosition = null; // also reset the chart position, used in #149 fix\n }\n },\n\n // The mousemove, touchmove and touchstart event handler\n onContainerMouseMove: function (e) {\n\n var chart = this.chart;\n\n hoverChartIndex = chart.index;\n\n e = this.normalize(e);\n e.returnValue = false; // #2251, #3224\n\n if (chart.mouseIsDown === 'mousedown') {\n this.drag(e);\n }\n\n // Show the tooltip and run mouse over events (#977)\n if ((this.inClass(e.target, 'highcharts-tracker') ||\n chart.isInsidePlot(e.chartX - chart.plotLeft, e.chartY - chart.plotTop)) && !chart.openMenu) {\n this.runPointActions(e);\n }\n },\n\n /**\n * Utility to detect whether an element has, or has a parent with, a specific\n * class name. Used on detection of tracker objects and on deciding whether\n * hovering the tooltip should cause the active series to mouse out.\n */\n inClass: function (element, className) {\n var elemClassName;\n while (element) {\n elemClassName = attr(element, 'class');\n if (elemClassName) {\n if (elemClassName.indexOf(className) !== -1) {\n return true;\n } else if (elemClassName.indexOf(PREFIX + 'container') !== -1) {\n return false;\n }\n }\n element = element.parentNode;\n }\n },\n\n onTrackerMouseOut: function (e) {\n var series = this.chart.hoverSeries,\n relatedTarget = e.relatedTarget || e.toElement,\n relatedSeries = relatedTarget && relatedTarget.point && relatedTarget.point.series; // #2499\n\n if (series && !series.options.stickyTracking && !this.inClass(relatedTarget, PREFIX + 'tooltip') &&\n relatedSeries !== series) {\n series.onMouseOut();\n }\n },\n\n onContainerClick: function (e) {\n var chart = this.chart,\n hoverPoint = chart.hoverPoint,\n plotLeft = chart.plotLeft,\n plotTop = chart.plotTop;\n\n e = this.normalize(e);\n e.cancelBubble = true; // IE specific\n\n if (!chart.cancelClick) {\n\n // On tracker click, fire the series and point events. #783, #1583\n if (hoverPoint && this.inClass(e.target, PREFIX + 'tracker')) {\n\n // the series click event\n fireEvent(hoverPoint.series, 'click', extend(e, {\n point: hoverPoint\n }));\n\n // the point click event\n if (chart.hoverPoint) { // it may be destroyed (#1844)\n hoverPoint.firePointEvent('click', e);\n }\n\n // When clicking outside a tracker, fire a chart event\n } else {\n extend(e, this.getCoordinates(e));\n\n // fire a click event in the chart\n if (chart.isInsidePlot(e.chartX - plotLeft, e.chartY - plotTop)) {\n fireEvent(chart, 'click', e);\n }\n }\n\n\n }\n },\n\n /**\n * Set the JS DOM events on the container and document. This method should contain\n * a one-to-one assignment between methods and their handlers. Any advanced logic should\n * be moved to the handler reflecting the event's name.\n */\n setDOMEvents: function () {\n\n var pointer = this,\n container = pointer.chart.container;\n\n container.onmousedown = function (e) {\n pointer.onContainerMouseDown(e);\n };\n container.onmousemove = function (e) {\n pointer.onContainerMouseMove(e);\n };\n container.onclick = function (e) {\n pointer.onContainerClick(e);\n };\n addEvent(container, 'mouseleave', pointer.onContainerMouseLeave);\n if (chartCount === 1) {\n addEvent(doc, 'mouseup', pointer.onDocumentMouseUp);\n }\n if (hasTouch) {\n container.ontouchstart = function (e) {\n pointer.onContainerTouchStart(e);\n };\n container.ontouchmove = function (e) {\n pointer.onContainerTouchMove(e);\n };\n if (chartCount === 1) {\n addEvent(doc, 'touchend', pointer.onDocumentTouchEnd);\n }\n }\n\n },\n\n /**\n * Destroys the Pointer object and disconnects DOM events.\n */\n destroy: function () {\n var prop;\n\n removeEvent(this.chart.container, 'mouseleave', this.onContainerMouseLeave);\n if (!chartCount) {\n removeEvent(doc, 'mouseup', this.onDocumentMouseUp);\n removeEvent(doc, 'touchend', this.onDocumentTouchEnd);\n }\n\n // memory and CPU leak\n clearInterval(this.tooltipTimeout);\n\n for (prop in this) {\n this[prop] = null;\n }\n }\n };\n\n\n /* Support for touch devices */\n extend(Highcharts.Pointer.prototype, {\n\n /**\n * Run translation operations\n */\n pinchTranslate: function (pinchDown, touches, transform, selectionMarker, clip, lastValidTouch) {\n if (this.zoomHor || this.pinchHor) {\n this.pinchTranslateDirection(true, pinchDown, touches, transform, selectionMarker, clip, lastValidTouch);\n }\n if (this.zoomVert || this.pinchVert) {\n this.pinchTranslateDirection(false, pinchDown, touches, transform, selectionMarker, clip, lastValidTouch);\n }\n },\n\n /**\n * Run translation operations for each direction (horizontal and vertical) independently\n */\n pinchTranslateDirection: function (horiz, pinchDown, touches, transform, selectionMarker, clip, lastValidTouch, forcedScale) {\n var chart = this.chart,\n xy = horiz ? 'x' : 'y',\n XY = horiz ? 'X' : 'Y',\n sChartXY = 'chart' + XY,\n wh = horiz ? 'width' : 'height',\n plotLeftTop = chart['plot' + (horiz ? 'Left' : 'Top')],\n selectionWH,\n selectionXY,\n clipXY,\n scale = forcedScale || 1,\n inverted = chart.inverted,\n bounds = chart.bounds[horiz ? 'h' : 'v'],\n singleTouch = pinchDown.length === 1,\n touch0Start = pinchDown[0][sChartXY],\n touch0Now = touches[0][sChartXY],\n touch1Start = !singleTouch && pinchDown[1][sChartXY],\n touch1Now = !singleTouch && touches[1][sChartXY],\n outOfBounds,\n transformScale,\n scaleKey,\n setScale = function () {\n if (!singleTouch && mathAbs(touch0Start - touch1Start) > 20) { // Don't zoom if fingers are too close on this axis\n scale = forcedScale || mathAbs(touch0Now - touch1Now) / mathAbs(touch0Start - touch1Start);\n }\n\n clipXY = ((plotLeftTop - touch0Now) / scale) + touch0Start;\n selectionWH = chart['plot' + (horiz ? 'Width' : 'Height')] / scale;\n };\n\n // Set the scale, first pass\n setScale();\n\n selectionXY = clipXY; // the clip position (x or y) is altered if out of bounds, the selection position is not\n\n // Out of bounds\n if (selectionXY < bounds.min) {\n selectionXY = bounds.min;\n outOfBounds = true;\n } else if (selectionXY + selectionWH > bounds.max) {\n selectionXY = bounds.max - selectionWH;\n outOfBounds = true;\n }\n\n // Is the chart dragged off its bounds, determined by dataMin and dataMax?\n if (outOfBounds) {\n\n // Modify the touchNow position in order to create an elastic drag movement. This indicates\n // to the user that the chart is responsive but can't be dragged further.\n touch0Now -= 0.8 * (touch0Now - lastValidTouch[xy][0]);\n if (!singleTouch) {\n touch1Now -= 0.8 * (touch1Now - lastValidTouch[xy][1]);\n }\n\n // Set the scale, second pass to adapt to the modified touchNow positions\n setScale();\n\n } else {\n lastValidTouch[xy] = [touch0Now, touch1Now];\n }\n\n // Set geometry for clipping, selection and transformation\n if (!inverted) { // TODO: implement clipping for inverted charts\n clip[xy] = clipXY - plotLeftTop;\n clip[wh] = selectionWH;\n }\n scaleKey = inverted ? (horiz ? 'scaleY' : 'scaleX') : 'scale' + XY;\n transformScale = inverted ? 1 / scale : scale;\n\n selectionMarker[wh] = selectionWH;\n selectionMarker[xy] = selectionXY;\n transform[scaleKey] = scale;\n transform['translate' + XY] = (transformScale * plotLeftTop) + (touch0Now - (transformScale * touch0Start));\n },\n\n /**\n * Handle touch events with two touches\n */\n pinch: function (e) {\n\n var self = this,\n chart = self.chart,\n pinchDown = self.pinchDown,\n followTouchMove = self.followTouchMove,\n touches = e.touches,\n touchesLength = touches.length,\n lastValidTouch = self.lastValidTouch,\n hasZoom = self.hasZoom,\n selectionMarker = self.selectionMarker,\n transform = {},\n fireClickEvent = touchesLength === 1 && ((self.inClass(e.target, PREFIX + 'tracker') &&\n chart.runTrackerClick) || self.runChartClick),\n clip = {};\n\n // On touch devices, only proceed to trigger click if a handler is defined\n if ((hasZoom || followTouchMove) && !fireClickEvent) {\n e.preventDefault();\n }\n\n // Normalize each touch\n map(touches, function (e) {\n return self.normalize(e);\n });\n\n // Register the touch start position\n if (e.type === 'touchstart') {\n each(touches, function (e, i) {\n pinchDown[i] = { chartX: e.chartX, chartY: e.chartY };\n });\n lastValidTouch.x = [pinchDown[0].chartX, pinchDown[1] && pinchDown[1].chartX];\n lastValidTouch.y = [pinchDown[0].chartY, pinchDown[1] && pinchDown[1].chartY];\n\n // Identify the data bounds in pixels\n each(chart.axes, function (axis) {\n if (axis.zoomEnabled) {\n var bounds = chart.bounds[axis.horiz ? 'h' : 'v'],\n minPixelPadding = axis.minPixelPadding,\n min = axis.toPixels(pick(axis.options.min, axis.dataMin)),\n max = axis.toPixels(pick(axis.options.max, axis.dataMax)),\n absMin = mathMin(min, max),\n absMax = mathMax(min, max);\n\n // Store the bounds for use in the touchmove handler\n bounds.min = mathMin(axis.pos, absMin - minPixelPadding);\n bounds.max = mathMax(axis.pos + axis.len, absMax + minPixelPadding);\n }\n });\n self.res = true; // reset on next move\n\n // Event type is touchmove, handle panning and pinching\n } else if (pinchDown.length) { // can be 0 when releasing, if touchend fires first\n\n\n // Set the marker\n if (!selectionMarker) {\n self.selectionMarker = selectionMarker = extend({\n destroy: noop\n }, chart.plotBox);\n }\n\n self.pinchTranslate(pinchDown, touches, transform, selectionMarker, clip, lastValidTouch);\n\n self.hasPinched = hasZoom;\n\n // Scale and translate the groups to provide visual feedback during pinching\n self.scaleGroups(transform, clip);\n\n // Optionally move the tooltip on touchmove\n if (!hasZoom && followTouchMove && touchesLength === 1) {\n this.runPointActions(self.normalize(e));\n } else if (self.res) {\n self.res = false;\n this.reset(false, 0);\n }\n }\n },\n\n onContainerTouchStart: function (e) {\n var chart = this.chart;\n\n hoverChartIndex = chart.index;\n\n if (e.touches.length === 1) {\n\n e = this.normalize(e);\n\n if (chart.isInsidePlot(e.chartX - chart.plotLeft, e.chartY - chart.plotTop)) {\n\n // Run mouse events and display tooltip etc\n this.runPointActions(e);\n\n this.pinch(e);\n\n } else {\n // Hide the tooltip on touching outside the plot area (#1203)\n this.reset();\n }\n\n } else if (e.touches.length === 2) {\n this.pinch(e);\n }\n },\n\n onContainerTouchMove: function (e) {\n if (e.touches.length === 1 || e.touches.length === 2) {\n this.pinch(e);\n }\n },\n\n onDocumentTouchEnd: function (e) {\n if (charts[hoverChartIndex]) {\n charts[hoverChartIndex].pointer.drop(e);\n }\n }\n\n });\n if (win.PointerEvent || win.MSPointerEvent) {\n\n // The touches object keeps track of the points being touched at all times\n var touches = {},\n hasPointerEvent = !!win.PointerEvent,\n getWebkitTouches = function () {\n var key, fake = [];\n fake.item = function (i) { return this[i]; };\n for (key in touches) {\n if (touches.hasOwnProperty(key)) {\n fake.push({\n pageX: touches[key].pageX,\n pageY: touches[key].pageY,\n target: touches[key].target\n });\n }\n }\n return fake;\n },\n translateMSPointer = function (e, method, wktype, callback) {\n var p;\n e = e.originalEvent || e;\n if ((e.pointerType === 'touch' || e.pointerType === e.MSPOINTER_TYPE_TOUCH) && charts[hoverChartIndex]) {\n callback(e);\n p = charts[hoverChartIndex].pointer;\n p[method]({\n type: wktype,\n target: e.currentTarget,\n preventDefault: noop,\n touches: getWebkitTouches()\n });\n }\n };\n\n /**\n * Extend the Pointer prototype with methods for each event handler and more\n */\n extend(Pointer.prototype, {\n onContainerPointerDown: function (e) {\n translateMSPointer(e, 'onContainerTouchStart', 'touchstart', function (e) {\n touches[e.pointerId] = { pageX: e.pageX, pageY: e.pageY, target: e.currentTarget };\n });\n },\n onContainerPointerMove: function (e) {\n translateMSPointer(e, 'onContainerTouchMove', 'touchmove', function (e) {\n touches[e.pointerId] = { pageX: e.pageX, pageY: e.pageY };\n if (!touches[e.pointerId].target) {\n touches[e.pointerId].target = e.currentTarget;\n }\n });\n },\n onDocumentPointerUp: function (e) {\n translateMSPointer(e, 'onContainerTouchEnd', 'touchend', function (e) {\n delete touches[e.pointerId];\n });\n },\n\n /**\n * Add or remove the MS Pointer specific events\n */\n batchMSEvents: function (fn) {\n fn(this.chart.container, hasPointerEvent ? 'pointerdown' : 'MSPointerDown', this.onContainerPointerDown);\n fn(this.chart.container, hasPointerEvent ? 'pointermove' : 'MSPointerMove', this.onContainerPointerMove);\n fn(doc, hasPointerEvent ? 'pointerup' : 'MSPointerUp', this.onDocumentPointerUp);\n }\n });\n\n // Disable default IE actions for pinch and such on chart element\n wrap(Pointer.prototype, 'init', function (proceed, chart, options) {\n proceed.call(this, chart, options);\n if (this.hasZoom || this.followTouchMove) {\n css(chart.container, {\n '-ms-touch-action': NONE,\n 'touch-action': NONE\n });\n }\n });\n\n // Add IE specific touch events to chart\n wrap(Pointer.prototype, 'setDOMEvents', function (proceed) {\n proceed.apply(this);\n if (this.hasZoom || this.followTouchMove) {\n this.batchMSEvents(addEvent);\n }\n });\n // Destroy MS events also\n wrap(Pointer.prototype, 'destroy', function (proceed) {\n this.batchMSEvents(removeEvent);\n proceed.call(this);\n });\n }\n /**\n * The overview of the chart's series\n */\n var Legend = Highcharts.Legend = function (chart, options) {\n this.init(chart, options);\n };\n\n Legend.prototype = {\n\n /**\n * Initialize the legend\n */\n init: function (chart, options) {\n\n var legend = this,\n itemStyle = options.itemStyle,\n padding = pick(options.padding, 8),\n itemMarginTop = options.itemMarginTop || 0;\n\n this.options = options;\n\n if (!options.enabled) {\n return;\n }\n\n legend.itemStyle = itemStyle;\n legend.itemHiddenStyle = merge(itemStyle, options.itemHiddenStyle);\n legend.itemMarginTop = itemMarginTop;\n legend.padding = padding;\n legend.initialItemX = padding;\n legend.initialItemY = padding - 5; // 5 is the number of pixels above the text\n legend.maxItemWidth = 0;\n legend.chart = chart;\n legend.itemHeight = 0;\n legend.lastLineHeight = 0;\n legend.symbolWidth = pick(options.symbolWidth, 16);\n legend.pages = [];\n\n\n // Render it\n legend.render();\n\n // move checkboxes\n addEvent(legend.chart, 'endResize', function () {\n legend.positionCheckboxes();\n });\n\n },\n\n /**\n * Set the colors for the legend item\n * @param {Object} item A Series or Point instance\n * @param {Object} visible Dimmed or colored\n */\n colorizeItem: function (item, visible) {\n var legend = this,\n options = legend.options,\n legendItem = item.legendItem,\n legendLine = item.legendLine,\n legendSymbol = item.legendSymbol,\n hiddenColor = legend.itemHiddenStyle.color,\n textColor = visible ? options.itemStyle.color : hiddenColor,\n symbolColor = visible ? (item.legendColor || item.color || '#CCC') : hiddenColor,\n markerOptions = item.options && item.options.marker,\n symbolAttr = { fill: symbolColor },\n key,\n val;\n\n if (legendItem) {\n legendItem.css({ fill: textColor, color: textColor }); // color for #1553, oldIE\n }\n if (legendLine) {\n legendLine.attr({ stroke: symbolColor });\n }\n\n if (legendSymbol) {\n\n // Apply marker options\n if (markerOptions && legendSymbol.isMarker) { // #585\n symbolAttr.stroke = symbolColor;\n markerOptions = item.convertAttribs(markerOptions);\n for (key in markerOptions) {\n val = markerOptions[key];\n if (val !== UNDEFINED) {\n symbolAttr[key] = val;\n }\n }\n }\n\n legendSymbol.attr(symbolAttr);\n }\n },\n\n /**\n * Position the legend item\n * @param {Object} item A Series or Point instance\n */\n positionItem: function (item) {\n var legend = this,\n options = legend.options,\n symbolPadding = options.symbolPadding,\n ltr = !options.rtl,\n legendItemPos = item._legendItemPos,\n itemX = legendItemPos[0],\n itemY = legendItemPos[1],\n checkbox = item.checkbox;\n\n if (item.legendGroup) {\n item.legendGroup.translate(\n ltr ? itemX : legend.legendWidth - itemX - 2 * symbolPadding - 4,\n itemY\n );\n }\n\n if (checkbox) {\n checkbox.x = itemX;\n checkbox.y = itemY;\n }\n },\n\n /**\n * Destroy a single legend item\n * @param {Object} item The series or point\n */\n destroyItem: function (item) {\n var checkbox = item.checkbox;\n\n // destroy SVG elements\n each(['legendItem', 'legendLine', 'legendSymbol', 'legendGroup'], function (key) {\n if (item[key]) {\n item[key] = item[key].destroy();\n }\n });\n\n if (checkbox) {\n discardElement(item.checkbox);\n }\n },\n\n /**\n * Destroys the legend.\n */\n destroy: function () {\n var legend = this,\n legendGroup = legend.group,\n box = legend.box;\n\n if (box) {\n legend.box = box.destroy();\n }\n\n if (legendGroup) {\n legend.group = legendGroup.destroy();\n }\n },\n\n /**\n * Position the checkboxes after the width is determined\n */\n positionCheckboxes: function (scrollOffset) {\n var alignAttr = this.group.alignAttr,\n translateY,\n clipHeight = this.clipHeight || this.legendHeight;\n\n if (alignAttr) {\n translateY = alignAttr.translateY;\n each(this.allItems, function (item) {\n var checkbox = item.checkbox,\n top;\n\n if (checkbox) {\n top = (translateY + checkbox.y + (scrollOffset || 0) + 3);\n css(checkbox, {\n left: (alignAttr.translateX + item.checkboxOffset + checkbox.x - 20) + PX,\n top: top + PX,\n display: top > translateY - 6 && top < translateY + clipHeight - 6 ? '' : NONE\n });\n }\n });\n }\n },\n\n /**\n * Render the legend title on top of the legend\n */\n renderTitle: function () {\n var options = this.options,\n padding = this.padding,\n titleOptions = options.title,\n titleHeight = 0,\n bBox;\n\n if (titleOptions.text) {\n if (!this.title) {\n this.title = this.chart.renderer.label(titleOptions.text, padding - 3, padding - 4, null, null, null, null, null, 'legend-title')\n .attr({ zIndex: 1 })\n .css(titleOptions.style)\n .add(this.group);\n }\n bBox = this.title.getBBox();\n titleHeight = bBox.height;\n this.offsetWidth = bBox.width; // #1717\n this.contentGroup.attr({ translateY: titleHeight });\n }\n this.titleHeight = titleHeight;\n },\n\n /**\n * Render a single specific legend item\n * @param {Object} item A series or point\n */\n renderItem: function (item) {\n var legend = this,\n chart = legend.chart,\n renderer = chart.renderer,\n options = legend.options,\n horizontal = options.layout === 'horizontal',\n symbolWidth = legend.symbolWidth,\n symbolPadding = options.symbolPadding,\n itemStyle = legend.itemStyle,\n itemHiddenStyle = legend.itemHiddenStyle,\n padding = legend.padding,\n itemDistance = horizontal ? pick(options.itemDistance, 20) : 0,\n ltr = !options.rtl,\n itemHeight,\n widthOption = options.width,\n itemMarginBottom = options.itemMarginBottom || 0,\n itemMarginTop = legend.itemMarginTop,\n initialItemX = legend.initialItemX,\n bBox,\n itemWidth,\n li = item.legendItem,\n series = item.series && item.series.drawLegendSymbol ? item.series : item,\n seriesOptions = series.options,\n showCheckbox = legend.createCheckboxForItem && seriesOptions && seriesOptions.showCheckbox,\n useHTML = options.useHTML;\n\n if (!li) { // generate it once, later move it\n\n // Generate the group box\n // A group to hold the symbol and text. Text is to be appended in Legend class.\n item.legendGroup = renderer.g('legend-item')\n .attr({ zIndex: 1 })\n .add(legend.scrollGroup);\n\n // Generate the list item text and add it to the group\n item.legendItem = li = renderer.text(\n options.labelFormat ? format(options.labelFormat, item) : options.labelFormatter.call(item),\n ltr ? symbolWidth + symbolPadding : -symbolPadding,\n legend.baseline || 0,\n useHTML\n )\n .css(merge(item.visible ? itemStyle : itemHiddenStyle)) // merge to prevent modifying original (#1021)\n .attr({\n align: ltr ? 'left' : 'right',\n zIndex: 2\n })\n .add(item.legendGroup);\n\n // Get the baseline for the first item - the font size is equal for all\n if (!legend.baseline) {\n legend.baseline = renderer.fontMetrics(itemStyle.fontSize, li).f + 3 + itemMarginTop;\n li.attr('y', legend.baseline);\n }\n\n // Draw the legend symbol inside the group box\n series.drawLegendSymbol(legend, item);\n\n if (legend.setItemEvents) {\n legend.setItemEvents(item, li, useHTML, itemStyle, itemHiddenStyle);\n }\n\n // Colorize the items\n legend.colorizeItem(item, item.visible);\n\n // add the HTML checkbox on top\n if (showCheckbox) {\n legend.createCheckboxForItem(item);\n }\n }\n\n // calculate the positions for the next line\n bBox = li.getBBox();\n\n itemWidth = item.checkboxOffset =\n options.itemWidth ||\n item.legendItemWidth ||\n symbolWidth + symbolPadding + bBox.width + itemDistance + (showCheckbox ? 20 : 0);\n legend.itemHeight = itemHeight = mathRound(item.legendItemHeight || bBox.height);\n\n // if the item exceeds the width, start a new line\n if (horizontal && legend.itemX - initialItemX + itemWidth >\n (widthOption || (chart.chartWidth - 2 * padding - initialItemX - options.x))) {\n legend.itemX = initialItemX;\n legend.itemY += itemMarginTop + legend.lastLineHeight + itemMarginBottom;\n legend.lastLineHeight = 0; // reset for next line\n }\n\n // If the item exceeds the height, start a new column\n /*if (!horizontal && legend.itemY + options.y + itemHeight > chart.chartHeight - spacingTop - spacingBottom) {\n legend.itemY = legend.initialItemY;\n legend.itemX += legend.maxItemWidth;\n legend.maxItemWidth = 0;\n }*/\n\n // Set the edge positions\n legend.maxItemWidth = mathMax(legend.maxItemWidth, itemWidth);\n legend.lastItemY = itemMarginTop + legend.itemY + itemMarginBottom;\n legend.lastLineHeight = mathMax(itemHeight, legend.lastLineHeight); // #915\n\n // cache the position of the newly generated or reordered items\n item._legendItemPos = [legend.itemX, legend.itemY];\n\n // advance\n if (horizontal) {\n legend.itemX += itemWidth;\n\n } else {\n legend.itemY += itemMarginTop + itemHeight + itemMarginBottom;\n legend.lastLineHeight = itemHeight;\n }\n\n // the width of the widest item\n legend.offsetWidth = widthOption || mathMax(\n (horizontal ? legend.itemX - initialItemX - itemDistance : itemWidth) + padding,\n legend.offsetWidth\n );\n },\n\n /**\n * Get all items, which is one item per series for normal series and one item per point\n * for pie series.\n */\n getAllItems: function () {\n var allItems = [];\n each(this.chart.series, function (series) {\n var seriesOptions = series.options;\n\n // Handle showInLegend. If the series is linked to another series, defaults to false.\n if (!pick(seriesOptions.showInLegend, !defined(seriesOptions.linkedTo) ? UNDEFINED : false, true)) {\n return;\n }\n\n // use points or series for the legend item depending on legendType\n allItems = allItems.concat(\n series.legendItems ||\n (seriesOptions.legendType === 'point' ?\n series.data :\n series)\n );\n });\n return allItems;\n },\n\n /**\n * Render the legend. This method can be called both before and after\n * chart.render. If called after, it will only rearrange items instead\n * of creating new ones.\n */\n render: function () {\n var legend = this,\n chart = legend.chart,\n renderer = chart.renderer,\n legendGroup = legend.group,\n allItems,\n display,\n legendWidth,\n legendHeight,\n box = legend.box,\n options = legend.options,\n padding = legend.padding,\n legendBorderWidth = options.borderWidth,\n legendBackgroundColor = options.backgroundColor;\n\n legend.itemX = legend.initialItemX;\n legend.itemY = legend.initialItemY;\n legend.offsetWidth = 0;\n legend.lastItemY = 0;\n\n if (!legendGroup) {\n legend.group = legendGroup = renderer.g('legend')\n .attr({ zIndex: 7 })\n .add();\n legend.contentGroup = renderer.g()\n .attr({ zIndex: 1 }) // above background\n .add(legendGroup);\n legend.scrollGroup = renderer.g()\n .add(legend.contentGroup);\n }\n\n legend.renderTitle();\n\n // add each series or point\n allItems = legend.getAllItems();\n\n // sort by legendIndex\n stableSort(allItems, function (a, b) {\n return ((a.options && a.options.legendIndex) || 0) - ((b.options && b.options.legendIndex) || 0);\n });\n\n // reversed legend\n if (options.reversed) {\n allItems.reverse();\n }\n\n legend.allItems = allItems;\n legend.display = display = !!allItems.length;\n\n // render the items\n each(allItems, function (item) {\n legend.renderItem(item);\n });\n\n // Draw the border\n legendWidth = options.width || legend.offsetWidth;\n legendHeight = legend.lastItemY + legend.lastLineHeight + legend.titleHeight;\n\n\n legendHeight = legend.handleOverflow(legendHeight);\n\n if (legendBorderWidth || legendBackgroundColor) {\n legendWidth += padding;\n legendHeight += padding;\n\n if (!box) {\n legend.box = box = renderer.rect(\n 0,\n 0,\n legendWidth,\n legendHeight,\n options.borderRadius,\n legendBorderWidth || 0\n ).attr({\n stroke: options.borderColor,\n 'stroke-width': legendBorderWidth || 0,\n fill: legendBackgroundColor || NONE\n })\n .add(legendGroup)\n .shadow(options.shadow);\n box.isNew = true;\n\n } else if (legendWidth > 0 && legendHeight > 0) {\n box[box.isNew ? 'attr' : 'animate'](\n box.crisp({ width: legendWidth, height: legendHeight })\n );\n box.isNew = false;\n }\n\n // hide the border if no items\n box[display ? 'show' : 'hide']();\n }\n\n legend.legendWidth = legendWidth;\n legend.legendHeight = legendHeight;\n\n // Now that the legend width and height are established, put the items in the\n // final position\n each(allItems, function (item) {\n legend.positionItem(item);\n });\n\n // 1.x compatibility: positioning based on style\n /*var props = ['left', 'right', 'top', 'bottom'],\n prop,\n i = 4;\n while (i--) {\n prop = props[i];\n if (options.style[prop] && options.style[prop] !== 'auto') {\n options[i < 2 ? 'align' : 'verticalAlign'] = prop;\n options[i < 2 ? 'x' : 'y'] = pInt(options.style[prop]) * (i % 2 ? -1 : 1);\n }\n }*/\n\n if (display) {\n legendGroup.align(extend({\n width: legendWidth,\n height: legendHeight\n }, options), true, 'spacingBox');\n }\n\n if (!chart.isResizing) {\n this.positionCheckboxes();\n }\n },\n\n /**\n * Set up the overflow handling by adding navigation with up and down arrows below the\n * legend.\n */\n handleOverflow: function (legendHeight) {\n var legend = this,\n chart = this.chart,\n renderer = chart.renderer,\n options = this.options,\n optionsY = options.y,\n alignTop = options.verticalAlign === 'top',\n spaceHeight = chart.spacingBox.height + (alignTop ? -optionsY : optionsY) - this.padding,\n maxHeight = options.maxHeight,\n clipHeight,\n clipRect = this.clipRect,\n navOptions = options.navigation,\n animation = pick(navOptions.animation, true),\n arrowSize = navOptions.arrowSize || 12,\n nav = this.nav,\n pages = this.pages,\n lastY,\n allItems = this.allItems;\n\n // Adjust the height\n if (options.layout === 'horizontal') {\n spaceHeight /= 2;\n }\n if (maxHeight) {\n spaceHeight = mathMin(spaceHeight, maxHeight);\n }\n\n // Reset the legend height and adjust the clipping rectangle\n pages.length = 0;\n if (legendHeight > spaceHeight && !options.useHTML) {\n\n this.clipHeight = clipHeight = mathMax(spaceHeight - 20 - this.titleHeight - this.padding, 0);\n this.currentPage = pick(this.currentPage, 1);\n this.fullHeight = legendHeight;\n\n // Fill pages with Y positions so that the top of each a legend item defines\n // the scroll top for each page (#2098)\n each(allItems, function (item, i) {\n var y = item._legendItemPos[1],\n h = mathRound(item.legendItem.getBBox().height),\n len = pages.length;\n\n if (!len || (y - pages[len - 1] > clipHeight && (lastY || y) !== pages[len - 1])) {\n pages.push(lastY || y);\n len++;\n }\n\n if (i === allItems.length - 1 && y + h - pages[len - 1] > clipHeight) {\n pages.push(y);\n }\n if (y !== lastY) {\n lastY = y;\n }\n });\n\n // Only apply clipping if needed. Clipping causes blurred legend in PDF export (#1787)\n if (!clipRect) {\n clipRect = legend.clipRect = renderer.clipRect(0, this.padding, 9999, 0);\n legend.contentGroup.clip(clipRect);\n }\n clipRect.attr({\n height: clipHeight\n });\n\n // Add navigation elements\n if (!nav) {\n this.nav = nav = renderer.g().attr({ zIndex: 1 }).add(this.group);\n this.up = renderer.symbol('triangle', 0, 0, arrowSize, arrowSize)\n .on('click', function () {\n legend.scroll(-1, animation);\n })\n .add(nav);\n this.pager = renderer.text('', 15, 10)\n .css(navOptions.style)\n .add(nav);\n this.down = renderer.symbol('triangle-down', 0, 0, arrowSize, arrowSize)\n .on('click', function () {\n legend.scroll(1, animation);\n })\n .add(nav);\n }\n\n // Set initial position\n legend.scroll(0);\n\n legendHeight = spaceHeight;\n\n } else if (nav) {\n clipRect.attr({\n height: chart.chartHeight\n });\n nav.hide();\n this.scrollGroup.attr({\n translateY: 1\n });\n this.clipHeight = 0; // #1379\n }\n\n return legendHeight;\n },\n\n /**\n * Scroll the legend by a number of pages\n * @param {Object} scrollBy\n * @param {Object} animation\n */\n scroll: function (scrollBy, animation) {\n var pages = this.pages,\n pageCount = pages.length,\n currentPage = this.currentPage + scrollBy,\n clipHeight = this.clipHeight,\n navOptions = this.options.navigation,\n activeColor = navOptions.activeColor,\n inactiveColor = navOptions.inactiveColor,\n pager = this.pager,\n padding = this.padding,\n scrollOffset;\n\n // When resizing while looking at the last page\n if (currentPage > pageCount) {\n currentPage = pageCount;\n }\n\n if (currentPage > 0) {\n\n if (animation !== UNDEFINED) {\n setAnimation(animation, this.chart);\n }\n\n this.nav.attr({\n translateX: padding,\n translateY: clipHeight + this.padding + 7 + this.titleHeight,\n visibility: VISIBLE\n });\n this.up.attr({\n fill: currentPage === 1 ? inactiveColor : activeColor\n })\n .css({\n cursor: currentPage === 1 ? 'default' : 'pointer'\n });\n pager.attr({\n text: currentPage + '/' + pageCount\n });\n this.down.attr({\n x: 18 + this.pager.getBBox().width, // adjust to text width\n fill: currentPage === pageCount ? inactiveColor : activeColor\n })\n .css({\n cursor: currentPage === pageCount ? 'default' : 'pointer'\n });\n\n scrollOffset = -pages[currentPage - 1] + this.initialItemY;\n\n this.scrollGroup.animate({\n translateY: scrollOffset\n });\n\n this.currentPage = currentPage;\n this.positionCheckboxes(scrollOffset);\n }\n\n }\n\n };\n\n /*\n * LegendSymbolMixin\n */\n\n var LegendSymbolMixin = Highcharts.LegendSymbolMixin = {\n\n /**\n * Get the series' symbol in the legend\n *\n * @param {Object} legend The legend object\n * @param {Object} item The series (this) or point\n */\n drawRectangle: function (legend, item) {\n var symbolHeight = legend.options.symbolHeight || 12;\n\n item.legendSymbol = this.chart.renderer.rect(\n 0,\n legend.baseline - 5 - (symbolHeight / 2),\n legend.symbolWidth,\n symbolHeight,\n legend.options.symbolRadius || 0\n ).attr({\n zIndex: 3\n }).add(item.legendGroup);\n\n },\n\n /**\n * Get the series' symbol in the legend. This method should be overridable to create custom\n * symbols through Highcharts.seriesTypes[type].prototype.drawLegendSymbols.\n *\n * @param {Object} legend The legend object\n */\n drawLineMarker: function (legend) {\n\n var options = this.options,\n markerOptions = options.marker,\n radius,\n legendOptions = legend.options,\n legendSymbol,\n symbolWidth = legend.symbolWidth,\n renderer = this.chart.renderer,\n legendItemGroup = this.legendGroup,\n verticalCenter = legend.baseline - mathRound(renderer.fontMetrics(legendOptions.itemStyle.fontSize, this.legendItem).b * 0.3),\n attr;\n\n // Draw the line\n if (options.lineWidth) {\n attr = {\n 'stroke-width': options.lineWidth\n };\n if (options.dashStyle) {\n attr.dashstyle = options.dashStyle;\n }\n this.legendLine = renderer.path([\n M,\n 0,\n verticalCenter,\n L,\n symbolWidth,\n verticalCenter\n ])\n .attr(attr)\n .add(legendItemGroup);\n }\n\n // Draw the marker\n if (markerOptions && markerOptions.enabled !== false) {\n radius = markerOptions.radius;\n this.legendSymbol = legendSymbol = renderer.symbol(\n this.symbol,\n (symbolWidth / 2) - radius,\n verticalCenter - radius,\n 2 * radius,\n 2 * radius\n )\n .add(legendItemGroup);\n legendSymbol.isMarker = true;\n }\n }\n };\n\n// Workaround for #2030, horizontal legend items not displaying in IE11 Preview,\n// and for #2580, a similar drawing flaw in Firefox 26.\n// TODO: Explore if there's a general cause for this. The problem may be related\n// to nested group elements, as the legend item texts are within 4 group elements.\n if (/Trident\\/7\\.0/.test(userAgent) || isFirefox) {\n wrap(Legend.prototype, 'positionItem', function (proceed, item) {\n var legend = this,\n runPositionItem = function () { // If chart destroyed in sync, this is undefined (#2030)\n if (item._legendItemPos) {\n proceed.call(legend, item);\n }\n };\n\n // Do it now, for export and to get checkbox placement\n runPositionItem();\n\n // Do it after to work around the core issue\n setTimeout(runPositionItem);\n });\n }\n /**\n * The chart class\n * @param {Object} options\n * @param {Function} callback Function to run when the chart has loaded\n */\n function Chart() {\n this.init.apply(this, arguments);\n }\n\n Chart.prototype = {\n\n /**\n * Initialize the chart\n */\n init: function (userOptions, callback) {\n\n // Handle regular options\n var options,\n seriesOptions = userOptions.series; // skip merging data points to increase performance\n\n userOptions.series = null;\n options = merge(defaultOptions, userOptions); // do the merge\n options.series = userOptions.series = seriesOptions; // set back the series data\n this.userOptions = userOptions;\n\n var optionsChart = options.chart;\n\n // Create margin & spacing array\n this.margin = this.splashArray('margin', optionsChart);\n this.spacing = this.splashArray('spacing', optionsChart);\n\n var chartEvents = optionsChart.events;\n\n //this.runChartClick = chartEvents && !!chartEvents.click;\n this.bounds = { h: {}, v: {} }; // Pixel data bounds for touch zoom\n\n this.callback = callback;\n this.isResizing = 0;\n this.options = options;\n //chartTitleOptions = UNDEFINED;\n //chartSubtitleOptions = UNDEFINED;\n\n this.axes = [];\n this.series = [];\n this.hasCartesianSeries = optionsChart.showAxes;\n //this.axisOffset = UNDEFINED;\n //this.maxTicks = UNDEFINED; // handle the greatest amount of ticks on grouped axes\n //this.inverted = UNDEFINED;\n //this.loadingShown = UNDEFINED;\n //this.container = UNDEFINED;\n //this.chartWidth = UNDEFINED;\n //this.chartHeight = UNDEFINED;\n //this.marginRight = UNDEFINED;\n //this.marginBottom = UNDEFINED;\n //this.containerWidth = UNDEFINED;\n //this.containerHeight = UNDEFINED;\n //this.oldChartWidth = UNDEFINED;\n //this.oldChartHeight = UNDEFINED;\n\n //this.renderTo = UNDEFINED;\n //this.renderToClone = UNDEFINED;\n\n //this.spacingBox = UNDEFINED\n\n //this.legend = UNDEFINED;\n\n // Elements\n //this.chartBackground = UNDEFINED;\n //this.plotBackground = UNDEFINED;\n //this.plotBGImage = UNDEFINED;\n //this.plotBorder = UNDEFINED;\n //this.loadingDiv = UNDEFINED;\n //this.loadingSpan = UNDEFINED;\n\n var chart = this,\n eventType;\n\n // Add the chart to the global lookup\n chart.index = charts.length;\n charts.push(chart);\n chartCount++;\n\n // Set up auto resize\n if (optionsChart.reflow !== false) {\n addEvent(chart, 'load', function () {\n chart.initReflow();\n });\n }\n\n // Chart event handlers\n if (chartEvents) {\n for (eventType in chartEvents) {\n addEvent(chart, eventType, chartEvents[eventType]);\n }\n }\n\n chart.xAxis = [];\n chart.yAxis = [];\n\n // Expose methods and variables\n chart.animation = useCanVG ? false : pick(optionsChart.animation, true);\n chart.pointCount = chart.colorCounter = chart.symbolCounter = 0;\n\n chart.firstRender();\n },\n\n /**\n * Initialize an individual series, called internally before render time\n */\n initSeries: function (options) {\n var chart = this,\n optionsChart = chart.options.chart,\n type = options.type || optionsChart.type || optionsChart.defaultSeriesType,\n series,\n constr = seriesTypes[type];\n\n // No such series type\n if (!constr) {\n error(17, true);\n }\n\n series = new constr();\n series.init(this, options);\n return series;\n },\n\n /**\n * Check whether a given point is within the plot area\n *\n * @param {Number} plotX Pixel x relative to the plot area\n * @param {Number} plotY Pixel y relative to the plot area\n * @param {Boolean} inverted Whether the chart is inverted\n */\n isInsidePlot: function (plotX, plotY, inverted) {\n var x = inverted ? plotY : plotX,\n y = inverted ? plotX : plotY;\n\n return x >= 0 &&\n x <= this.plotWidth &&\n y >= 0 &&\n y <= this.plotHeight;\n },\n\n /**\n * Adjust all axes tick amounts\n */\n adjustTickAmounts: function () {\n if (this.options.chart.alignTicks !== false) {\n each(this.axes, function (axis) {\n axis.adjustTickAmount();\n });\n }\n this.maxTicks = null;\n },\n\n /**\n * Redraw legend, axes or series based on updated data\n *\n * @param {Boolean|Object} animation Whether to apply animation, and optionally animation\n * configuration\n */\n redraw: function (animation) {\n var chart = this,\n axes = chart.axes,\n series = chart.series,\n pointer = chart.pointer,\n legend = chart.legend,\n redrawLegend = chart.isDirtyLegend,\n hasStackedSeries,\n hasDirtyStacks,\n hasCartesianSeries = chart.hasCartesianSeries,\n isDirtyBox = chart.isDirtyBox, // todo: check if it has actually changed?\n seriesLength = series.length,\n i = seriesLength,\n serie,\n renderer = chart.renderer,\n isHiddenChart = renderer.isHidden(),\n afterRedraw = [];\n\n setAnimation(animation, chart);\n\n if (isHiddenChart) {\n chart.cloneRenderTo();\n }\n\n // Adjust title layout (reflow multiline text)\n chart.layOutTitles();\n\n // link stacked series\n while (i--) {\n serie = series[i];\n\n if (serie.options.stacking) {\n hasStackedSeries = true;\n\n if (serie.isDirty) {\n hasDirtyStacks = true;\n break;\n }\n }\n }\n if (hasDirtyStacks) { // mark others as dirty\n i = seriesLength;\n while (i--) {\n serie = series[i];\n if (serie.options.stacking) {\n serie.isDirty = true;\n }\n }\n }\n\n // handle updated data in the series\n each(series, function (serie) {\n if (serie.isDirty) { // prepare the data so axis can read it\n if (serie.options.legendType === 'point') {\n redrawLegend = true;\n }\n }\n });\n\n // handle added or removed series\n if (redrawLegend && legend.options.enabled) { // series or pie points are added or removed\n // draw legend graphics\n legend.render();\n\n chart.isDirtyLegend = false;\n }\n\n // reset stacks\n if (hasStackedSeries) {\n chart.getStacks();\n }\n\n\n if (hasCartesianSeries) {\n if (!chart.isResizing) {\n\n // reset maxTicks\n chart.maxTicks = null;\n\n // set axes scales\n each(axes, function (axis) {\n axis.setScale();\n });\n }\n\n chart.adjustTickAmounts();\n }\n\n chart.getMargins(); // #3098\n\n if (hasCartesianSeries) {\n // If one axis is dirty, all axes must be redrawn (#792, #2169)\n each(axes, function (axis) {\n if (axis.isDirty) {\n isDirtyBox = true;\n }\n });\n\n // redraw axes\n each(axes, function (axis) {\n\n // Fire 'afterSetExtremes' only if extremes are set\n if (axis.isDirtyExtremes) { // #821\n axis.isDirtyExtremes = false;\n afterRedraw.push(function () { // prevent a recursive call to chart.redraw() (#1119)\n fireEvent(axis, 'afterSetExtremes', extend(axis.eventArgs, axis.getExtremes())); // #747, #751\n delete axis.eventArgs;\n });\n }\n\n if (isDirtyBox || hasStackedSeries) {\n axis.redraw();\n }\n });\n }\n\n // the plot areas size has changed\n if (isDirtyBox) {\n chart.drawChartBox();\n }\n\n\n // redraw affected series\n each(series, function (serie) {\n if (serie.isDirty && serie.visible &&\n (!serie.isCartesian || serie.xAxis)) { // issue #153\n serie.redraw();\n }\n });\n\n // move tooltip or reset\n if (pointer) {\n pointer.reset(true);\n }\n\n // redraw if canvas\n renderer.draw();\n\n // fire the event\n fireEvent(chart, 'redraw'); // jQuery breaks this when calling it from addEvent. Overwrites chart.redraw\n\n if (isHiddenChart) {\n chart.cloneRenderTo(true);\n }\n\n // Fire callbacks that are put on hold until after the redraw\n each(afterRedraw, function (callback) {\n callback.call();\n });\n },\n\n /**\n * Get an axis, series or point object by id.\n * @param id {String} The id as given in the configuration options\n */\n get: function (id) {\n var chart = this,\n axes = chart.axes,\n series = chart.series;\n\n var i,\n j,\n points;\n\n // search axes\n for (i = 0; i < axes.length; i++) {\n if (axes[i].options.id === id) {\n return axes[i];\n }\n }\n\n // search series\n for (i = 0; i < series.length; i++) {\n if (series[i].options.id === id) {\n return series[i];\n }\n }\n\n // search points\n for (i = 0; i < series.length; i++) {\n points = series[i].points || [];\n for (j = 0; j < points.length; j++) {\n if (points[j].id === id) {\n return points[j];\n }\n }\n }\n return null;\n },\n\n /**\n * Create the Axis instances based on the config options\n */\n getAxes: function () {\n var chart = this,\n options = this.options,\n xAxisOptions = options.xAxis = splat(options.xAxis || {}),\n yAxisOptions = options.yAxis = splat(options.yAxis || {}),\n optionsArray,\n axis;\n\n // make sure the options are arrays and add some members\n each(xAxisOptions, function (axis, i) {\n axis.index = i;\n axis.isX = true;\n });\n\n each(yAxisOptions, function (axis, i) {\n axis.index = i;\n });\n\n // concatenate all axis options into one array\n optionsArray = xAxisOptions.concat(yAxisOptions);\n\n each(optionsArray, function (axisOptions) {\n axis = new Axis(chart, axisOptions);\n });\n\n chart.adjustTickAmounts();\n },\n\n\n /**\n * Get the currently selected points from all series\n */\n getSelectedPoints: function () {\n var points = [];\n each(this.series, function (serie) {\n points = points.concat(grep(serie.points || [], function (point) {\n return point.selected;\n }));\n });\n return points;\n },\n\n /**\n * Get the currently selected series\n */\n getSelectedSeries: function () {\n return grep(this.series, function (serie) {\n return serie.selected;\n });\n },\n\n /**\n * Generate stacks for each series and calculate stacks total values\n */\n getStacks: function () {\n var chart = this;\n\n // reset stacks for each yAxis\n each(chart.yAxis, function (axis) {\n if (axis.stacks && axis.hasVisibleSeries) {\n axis.oldStacks = axis.stacks;\n }\n });\n\n each(chart.series, function (series) {\n if (series.options.stacking && (series.visible === true || chart.options.chart.ignoreHiddenSeries === false)) {\n series.stackKey = series.type + pick(series.options.stack, '');\n }\n });\n },\n\n /**\n * Show the title and subtitle of the chart\n *\n * @param titleOptions {Object} New title options\n * @param subtitleOptions {Object} New subtitle options\n *\n */\n setTitle: function (titleOptions, subtitleOptions, redraw) {\n var chart = this,\n options = chart.options,\n chartTitleOptions,\n chartSubtitleOptions;\n\n chartTitleOptions = options.title = merge(options.title, titleOptions);\n chartSubtitleOptions = options.subtitle = merge(options.subtitle, subtitleOptions);\n\n // add title and subtitle\n each([\n ['title', titleOptions, chartTitleOptions],\n ['subtitle', subtitleOptions, chartSubtitleOptions]\n ], function (arr) {\n var name = arr[0],\n title = chart[name],\n titleOptions = arr[1],\n chartTitleOptions = arr[2];\n\n if (title && titleOptions) {\n chart[name] = title = title.destroy(); // remove old\n }\n\n if (chartTitleOptions && chartTitleOptions.text && !title) {\n chart[name] = chart.renderer.text(\n chartTitleOptions.text,\n 0,\n 0,\n chartTitleOptions.useHTML\n )\n .attr({\n align: chartTitleOptions.align,\n 'class': PREFIX + name,\n zIndex: chartTitleOptions.zIndex || 4\n })\n .css(chartTitleOptions.style)\n .add();\n }\n });\n chart.layOutTitles(redraw);\n },\n\n /**\n * Lay out the chart titles and cache the full offset height for use in getMargins\n */\n layOutTitles: function (redraw) {\n var titleOffset = 0,\n title = this.title,\n subtitle = this.subtitle,\n options = this.options,\n titleOptions = options.title,\n subtitleOptions = options.subtitle,\n requiresDirtyBox,\n renderer = this.renderer,\n autoWidth = this.spacingBox.width - 44; // 44 makes room for default context button\n\n if (title) {\n title\n .css({ width: (titleOptions.width || autoWidth) + PX })\n .align(extend({\n y: renderer.fontMetrics(titleOptions.style.fontSize, title).b - 3\n }, titleOptions), false, 'spacingBox');\n\n if (!titleOptions.floating && !titleOptions.verticalAlign) {\n titleOffset = title.getBBox().height;\n }\n }\n if (subtitle) {\n subtitle\n .css({ width: (subtitleOptions.width || autoWidth) + PX })\n .align(extend({\n y: titleOffset + (titleOptions.margin - 13) + renderer.fontMetrics(titleOptions.style.fontSize, subtitle).b\n }, subtitleOptions), false, 'spacingBox');\n\n if (!subtitleOptions.floating && !subtitleOptions.verticalAlign) {\n titleOffset = mathCeil(titleOffset + subtitle.getBBox().height);\n }\n }\n\n requiresDirtyBox = this.titleOffset !== titleOffset;\n this.titleOffset = titleOffset; // used in getMargins\n\n if (!this.isDirtyBox && requiresDirtyBox) {\n this.isDirtyBox = requiresDirtyBox;\n // Redraw if necessary (#2719, #2744)\n if (this.hasRendered && pick(redraw, true) && this.isDirtyBox) {\n this.redraw();\n }\n }\n },\n\n /**\n * Get chart width and height according to options and container size\n */\n getChartSize: function () {\n var chart = this,\n optionsChart = chart.options.chart,\n widthOption = optionsChart.width,\n heightOption = optionsChart.height,\n renderTo = chart.renderToClone || chart.renderTo;\n\n // get inner width and height from jQuery (#824)\n if (!defined(widthOption)) {\n chart.containerWidth = adapterRun(renderTo, 'width');\n }\n if (!defined(heightOption)) {\n chart.containerHeight = adapterRun(renderTo, 'height');\n }\n\n chart.chartWidth = mathMax(0, widthOption || chart.containerWidth || 600); // #1393, 1460\n chart.chartHeight = mathMax(0, pick(heightOption,\n // the offsetHeight of an empty container is 0 in standard browsers, but 19 in IE7:\n chart.containerHeight > 19 ? chart.containerHeight : 400));\n },\n\n /**\n * Create a clone of the chart's renderTo div and place it outside the viewport to allow\n * size computation on chart.render and chart.redraw\n */\n cloneRenderTo: function (revert) {\n var clone = this.renderToClone,\n container = this.container;\n\n // Destroy the clone and bring the container back to the real renderTo div\n if (revert) {\n if (clone) {\n this.renderTo.appendChild(container);\n discardElement(clone);\n delete this.renderToClone;\n }\n\n // Set up the clone\n } else {\n if (container && container.parentNode === this.renderTo) {\n this.renderTo.removeChild(container); // do not clone this\n }\n this.renderToClone = clone = this.renderTo.cloneNode(0);\n css(clone, {\n position: ABSOLUTE,\n top: '-9999px',\n display: 'block' // #833\n });\n if (clone.style.setProperty) { // #2631\n clone.style.setProperty('display', 'block', 'important');\n }\n doc.body.appendChild(clone);\n if (container) {\n clone.appendChild(container);\n }\n }\n },\n\n /**\n * Get the containing element, determine the size and create the inner container\n * div to hold the chart\n */\n getContainer: function () {\n var chart = this,\n container,\n optionsChart = chart.options.chart,\n chartWidth,\n chartHeight,\n renderTo,\n indexAttrName = 'data-highcharts-chart',\n oldChartIndex,\n containerId;\n\n chart.renderTo = renderTo = optionsChart.renderTo;\n containerId = PREFIX + idCounter++;\n\n if (isString(renderTo)) {\n chart.renderTo = renderTo = doc.getElementById(renderTo);\n }\n\n // Display an error if the renderTo is wrong\n if (!renderTo) {\n error(13, true);\n }\n\n // If the container already holds a chart, destroy it. The check for hasRendered is there\n // because web pages that are saved to disk from the browser, will preserve the data-highcharts-chart\n // attribute and the SVG contents, but not an interactive chart. So in this case,\n // charts[oldChartIndex] will point to the wrong chart if any (#2609).\n oldChartIndex = pInt(attr(renderTo, indexAttrName));\n if (!isNaN(oldChartIndex) && charts[oldChartIndex] && charts[oldChartIndex].hasRendered) {\n charts[oldChartIndex].destroy();\n }\n\n // Make a reference to the chart from the div\n attr(renderTo, indexAttrName, chart.index);\n\n // remove previous chart\n renderTo.innerHTML = '';\n\n // If the container doesn't have an offsetWidth, it has or is a child of a node\n // that has display:none. We need to temporarily move it out to a visible\n // state to determine the size, else the legend and tooltips won't render\n // properly. The allowClone option is used in sparklines as a micro optimization,\n // saving about 1-2 ms each chart.\n if (!optionsChart.skipClone && !renderTo.offsetWidth) {\n chart.cloneRenderTo();\n }\n\n // get the width and height\n chart.getChartSize();\n chartWidth = chart.chartWidth;\n chartHeight = chart.chartHeight;\n\n // create the inner container\n chart.container = container = createElement(DIV, {\n className: PREFIX + 'container' +\n (optionsChart.className ? ' ' + optionsChart.className : ''),\n id: containerId\n }, extend({\n position: RELATIVE,\n overflow: HIDDEN, // needed for context menu (avoid scrollbars) and\n // content overflow in IE\n width: chartWidth + PX,\n height: chartHeight + PX,\n textAlign: 'left',\n lineHeight: 'normal', // #427\n zIndex: 0, // #1072\n '-webkit-tap-highlight-color': 'rgba(0,0,0,0)'\n }, optionsChart.style),\n chart.renderToClone || renderTo\n );\n\n // cache the cursor (#1650)\n chart._cursor = container.style.cursor;\n\n // Initialize the renderer\n chart.renderer =\n optionsChart.forExport ? // force SVG, used for SVG export\n new SVGRenderer(container, chartWidth, chartHeight, optionsChart.style, true) :\n new Renderer(container, chartWidth, chartHeight, optionsChart.style);\n\n if (useCanVG) {\n // If we need canvg library, extend and configure the renderer\n // to get the tracker for translating mouse events\n chart.renderer.create(chart, container, chartWidth, chartHeight);\n }\n },\n\n /**\n * Calculate margins by rendering axis labels in a preliminary position. Title,\n * subtitle and legend have already been rendered at this stage, but will be\n * moved into their final positions\n */\n getMargins: function () {\n var chart = this,\n spacing = chart.spacing,\n axisOffset,\n legend = chart.legend,\n margin = chart.margin,\n legendOptions = chart.options.legend,\n legendMargin = pick(legendOptions.margin, 20),\n legendX = legendOptions.x,\n legendY = legendOptions.y,\n align = legendOptions.align,\n verticalAlign = legendOptions.verticalAlign,\n titleOffset = chart.titleOffset;\n\n chart.resetMargins();\n axisOffset = chart.axisOffset;\n\n // Adjust for title and subtitle\n if (titleOffset && !defined(margin[0])) {\n chart.plotTop = mathMax(chart.plotTop, titleOffset + chart.options.title.margin + spacing[0]);\n }\n\n // Adjust for legend\n if (legend.display && !legendOptions.floating) {\n if (align === 'right') { // horizontal alignment handled first\n if (!defined(margin[1])) {\n chart.marginRight = mathMax(\n chart.marginRight,\n legend.legendWidth - legendX + legendMargin + spacing[1]\n );\n }\n } else if (align === 'left') {\n if (!defined(margin[3])) {\n chart.plotLeft = mathMax(\n chart.plotLeft,\n legend.legendWidth + legendX + legendMargin + spacing[3]\n );\n }\n\n } else if (verticalAlign === 'top') {\n if (!defined(margin[0])) {\n chart.plotTop = mathMax(\n chart.plotTop,\n legend.legendHeight + legendY + legendMargin + spacing[0]\n );\n }\n\n } else if (verticalAlign === 'bottom') {\n if (!defined(margin[2])) {\n chart.marginBottom = mathMax(\n chart.marginBottom,\n legend.legendHeight - legendY + legendMargin + spacing[2]\n );\n }\n }\n }\n\n // adjust for scroller\n if (chart.extraBottomMargin) {\n chart.marginBottom += chart.extraBottomMargin;\n }\n if (chart.extraTopMargin) {\n chart.plotTop += chart.extraTopMargin;\n }\n\n // pre-render axes to get labels offset width\n if (chart.hasCartesianSeries) {\n each(chart.axes, function (axis) {\n axis.getOffset();\n });\n }\n\n if (!defined(margin[3])) {\n chart.plotLeft += axisOffset[3];\n }\n if (!defined(margin[0])) {\n chart.plotTop += axisOffset[0];\n }\n if (!defined(margin[2])) {\n chart.marginBottom += axisOffset[2];\n }\n if (!defined(margin[1])) {\n chart.marginRight += axisOffset[1];\n }\n\n chart.setChartSize();\n\n },\n\n /**\n * Resize the chart to its container if size is not explicitly set\n */\n reflow: function (e) {\n var chart = this,\n optionsChart = chart.options.chart,\n renderTo = chart.renderTo,\n width = optionsChart.width || adapterRun(renderTo, 'width'),\n height = optionsChart.height || adapterRun(renderTo, 'height'),\n target = e ? e.target : win, // #805 - MooTools doesn't supply e\n doReflow = function () {\n if (chart.container) { // It may have been destroyed in the meantime (#1257)\n chart.setSize(width, height, false);\n chart.hasUserSize = null;\n }\n };\n\n // Width and height checks for display:none. Target is doc in IE8 and Opera,\n // win in Firefox, Chrome and IE9.\n if (!chart.hasUserSize && width && height && (target === win || target === doc)) {\n if (width !== chart.containerWidth || height !== chart.containerHeight) {\n clearTimeout(chart.reflowTimeout);\n if (e) { // Called from window.resize\n chart.reflowTimeout = setTimeout(doReflow, 100);\n } else { // Called directly (#2224)\n doReflow();\n }\n }\n chart.containerWidth = width;\n chart.containerHeight = height;\n }\n },\n\n /**\n * Add the event handlers necessary for auto resizing\n */\n initReflow: function () {\n var chart = this,\n reflow = function (e) {\n chart.reflow(e);\n };\n\n\n addEvent(win, 'resize', reflow);\n addEvent(chart, 'destroy', function () {\n removeEvent(win, 'resize', reflow);\n });\n },\n\n /**\n * Resize the chart to a given width and height\n * @param {Number} width\n * @param {Number} height\n * @param {Object|Boolean} animation\n */\n setSize: function (width, height, animation) {\n var chart = this,\n chartWidth,\n chartHeight,\n fireEndResize;\n\n // Handle the isResizing counter\n chart.isResizing += 1;\n fireEndResize = function () {\n if (chart) {\n fireEvent(chart, 'endResize', null, function () {\n chart.isResizing -= 1;\n });\n }\n };\n\n // set the animation for the current process\n setAnimation(animation, chart);\n\n chart.oldChartHeight = chart.chartHeight;\n chart.oldChartWidth = chart.chartWidth;\n if (defined(width)) {\n chart.chartWidth = chartWidth = mathMax(0, mathRound(width));\n chart.hasUserSize = !!chartWidth;\n }\n if (defined(height)) {\n chart.chartHeight = chartHeight = mathMax(0, mathRound(height));\n }\n\n // Resize the container with the global animation applied if enabled (#2503)\n (globalAnimation ? animate : css)(chart.container, {\n width: chartWidth + PX,\n height: chartHeight + PX\n }, globalAnimation);\n\n chart.setChartSize(true);\n chart.renderer.setSize(chartWidth, chartHeight, animation);\n\n // handle axes\n chart.maxTicks = null;\n each(chart.axes, function (axis) {\n axis.isDirty = true;\n axis.setScale();\n });\n\n // make sure non-cartesian series are also handled\n each(chart.series, function (serie) {\n serie.isDirty = true;\n });\n\n chart.isDirtyLegend = true; // force legend redraw\n chart.isDirtyBox = true; // force redraw of plot and chart border\n\n chart.layOutTitles(); // #2857\n chart.getMargins();\n\n chart.redraw(animation);\n\n\n chart.oldChartHeight = null;\n fireEvent(chart, 'resize');\n\n // fire endResize and set isResizing back\n // If animation is disabled, fire without delay\n if (globalAnimation === false) {\n fireEndResize();\n } else { // else set a timeout with the animation duration\n setTimeout(fireEndResize, (globalAnimation && globalAnimation.duration) || 500);\n }\n },\n\n /**\n * Set the public chart properties. This is done before and after the pre-render\n * to determine margin sizes\n */\n setChartSize: function (skipAxes) {\n var chart = this,\n inverted = chart.inverted,\n renderer = chart.renderer,\n chartWidth = chart.chartWidth,\n chartHeight = chart.chartHeight,\n optionsChart = chart.options.chart,\n spacing = chart.spacing,\n clipOffset = chart.clipOffset,\n clipX,\n clipY,\n plotLeft,\n plotTop,\n plotWidth,\n plotHeight,\n plotBorderWidth;\n\n chart.plotLeft = plotLeft = mathRound(chart.plotLeft);\n chart.plotTop = plotTop = mathRound(chart.plotTop);\n chart.plotWidth = plotWidth = mathMax(0, mathRound(chartWidth - plotLeft - chart.marginRight));\n chart.plotHeight = plotHeight = mathMax(0, mathRound(chartHeight - plotTop - chart.marginBottom));\n\n chart.plotSizeX = inverted ? plotHeight : plotWidth;\n chart.plotSizeY = inverted ? plotWidth : plotHeight;\n\n chart.plotBorderWidth = optionsChart.plotBorderWidth || 0;\n\n // Set boxes used for alignment\n chart.spacingBox = renderer.spacingBox = {\n x: spacing[3],\n y: spacing[0],\n width: chartWidth - spacing[3] - spacing[1],\n height: chartHeight - spacing[0] - spacing[2]\n };\n chart.plotBox = renderer.plotBox = {\n x: plotLeft,\n y: plotTop,\n width: plotWidth,\n height: plotHeight\n };\n\n plotBorderWidth = 2 * mathFloor(chart.plotBorderWidth / 2);\n clipX = mathCeil(mathMax(plotBorderWidth, clipOffset[3]) / 2);\n clipY = mathCeil(mathMax(plotBorderWidth, clipOffset[0]) / 2);\n chart.clipBox = {\n x: clipX,\n y: clipY,\n width: mathFloor(chart.plotSizeX - mathMax(plotBorderWidth, clipOffset[1]) / 2 - clipX),\n height: mathMax(0, mathFloor(chart.plotSizeY - mathMax(plotBorderWidth, clipOffset[2]) / 2 - clipY))\n };\n\n if (!skipAxes) {\n each(chart.axes, function (axis) {\n axis.setAxisSize();\n axis.setAxisTranslation();\n });\n }\n },\n\n /**\n * Initial margins before auto size margins are applied\n */\n resetMargins: function () {\n var chart = this,\n spacing = chart.spacing,\n margin = chart.margin;\n\n chart.plotTop = pick(margin[0], spacing[0]);\n chart.marginRight = pick(margin[1], spacing[1]);\n chart.marginBottom = pick(margin[2], spacing[2]);\n chart.plotLeft = pick(margin[3], spacing[3]);\n chart.axisOffset = [0, 0, 0, 0]; // top, right, bottom, left\n chart.clipOffset = [0, 0, 0, 0];\n },\n\n /**\n * Draw the borders and backgrounds for chart and plot area\n */\n drawChartBox: function () {\n var chart = this,\n optionsChart = chart.options.chart,\n renderer = chart.renderer,\n chartWidth = chart.chartWidth,\n chartHeight = chart.chartHeight,\n chartBackground = chart.chartBackground,\n plotBackground = chart.plotBackground,\n plotBorder = chart.plotBorder,\n plotBGImage = chart.plotBGImage,\n chartBorderWidth = optionsChart.borderWidth || 0,\n chartBackgroundColor = optionsChart.backgroundColor,\n plotBackgroundColor = optionsChart.plotBackgroundColor,\n plotBackgroundImage = optionsChart.plotBackgroundImage,\n plotBorderWidth = optionsChart.plotBorderWidth || 0,\n mgn,\n bgAttr,\n plotLeft = chart.plotLeft,\n plotTop = chart.plotTop,\n plotWidth = chart.plotWidth,\n plotHeight = chart.plotHeight,\n plotBox = chart.plotBox,\n clipRect = chart.clipRect,\n clipBox = chart.clipBox;\n\n // Chart area\n mgn = chartBorderWidth + (optionsChart.shadow ? 8 : 0);\n\n if (chartBorderWidth || chartBackgroundColor) {\n if (!chartBackground) {\n\n bgAttr = {\n fill: chartBackgroundColor || NONE\n };\n if (chartBorderWidth) { // #980\n bgAttr.stroke = optionsChart.borderColor;\n bgAttr['stroke-width'] = chartBorderWidth;\n }\n chart.chartBackground = renderer.rect(mgn / 2, mgn / 2, chartWidth - mgn, chartHeight - mgn,\n optionsChart.borderRadius, chartBorderWidth)\n .attr(bgAttr)\n .addClass(PREFIX + 'background')\n .add()\n .shadow(optionsChart.shadow);\n\n } else { // resize\n chartBackground.animate(\n chartBackground.crisp({ width: chartWidth - mgn, height: chartHeight - mgn })\n );\n }\n }\n\n\n // Plot background\n if (plotBackgroundColor) {\n if (!plotBackground) {\n chart.plotBackground = renderer.rect(plotLeft, plotTop, plotWidth, plotHeight, 0)\n .attr({\n fill: plotBackgroundColor\n })\n .add()\n .shadow(optionsChart.plotShadow);\n } else {\n plotBackground.animate(plotBox);\n }\n }\n if (plotBackgroundImage) {\n if (!plotBGImage) {\n chart.plotBGImage = renderer.image(plotBackgroundImage, plotLeft, plotTop, plotWidth, plotHeight)\n .add();\n } else {\n plotBGImage.animate(plotBox);\n }\n }\n\n // Plot clip\n if (!clipRect) {\n chart.clipRect = renderer.clipRect(clipBox);\n } else {\n clipRect.animate({\n width: clipBox.width,\n height: clipBox.height\n });\n }\n\n // Plot area border\n if (plotBorderWidth) {\n if (!plotBorder) {\n chart.plotBorder = renderer.rect(plotLeft, plotTop, plotWidth, plotHeight, 0, -plotBorderWidth)\n .attr({\n stroke: optionsChart.plotBorderColor,\n 'stroke-width': plotBorderWidth,\n fill: NONE,\n zIndex: 1\n })\n .add();\n } else {\n plotBorder.animate(\n plotBorder.crisp({ x: plotLeft, y: plotTop, width: plotWidth, height: plotHeight, strokeWidth: -plotBorderWidth }) //#3282 plotBorder should be negative\n );\n }\n }\n\n // reset\n chart.isDirtyBox = false;\n },\n\n /**\n * Detect whether a certain chart property is needed based on inspecting its options\n * and series. This mainly applies to the chart.invert property, and in extensions to\n * the chart.angular and chart.polar properties.\n */\n propFromSeries: function () {\n var chart = this,\n optionsChart = chart.options.chart,\n klass,\n seriesOptions = chart.options.series,\n i,\n value;\n\n\n each(['inverted', 'angular', 'polar'], function (key) {\n\n // The default series type's class\n klass = seriesTypes[optionsChart.type || optionsChart.defaultSeriesType];\n\n // Get the value from available chart-wide properties\n value = (\n chart[key] || // 1. it is set before\n optionsChart[key] || // 2. it is set in the options\n (klass && klass.prototype[key]) // 3. it's default series class requires it\n );\n\n // 4. Check if any the chart's series require it\n i = seriesOptions && seriesOptions.length;\n while (!value && i--) {\n klass = seriesTypes[seriesOptions[i].type];\n if (klass && klass.prototype[key]) {\n value = true;\n }\n }\n\n // Set the chart property\n chart[key] = value;\n });\n\n },\n\n /**\n * Link two or more series together. This is done initially from Chart.render,\n * and after Chart.addSeries and Series.remove.\n */\n linkSeries: function () {\n var chart = this,\n chartSeries = chart.series;\n\n // Reset links\n each(chartSeries, function (series) {\n series.linkedSeries.length = 0;\n });\n\n // Apply new links\n each(chartSeries, function (series) {\n var linkedTo = series.options.linkedTo;\n if (isString(linkedTo)) {\n if (linkedTo === ':previous') {\n linkedTo = chart.series[series.index - 1];\n } else {\n linkedTo = chart.get(linkedTo);\n }\n if (linkedTo) {\n linkedTo.linkedSeries.push(series);\n series.linkedParent = linkedTo;\n }\n }\n });\n },\n\n /**\n * Render series for the chart\n */\n renderSeries: function () {\n each(this.series, function (serie) {\n serie.translate();\n if (serie.setTooltipPoints) {\n serie.setTooltipPoints();\n }\n serie.render();\n });\n },\n\n /**\n * Render labels for the chart\n */\n renderLabels: function () {\n var chart = this,\n labels = chart.options.labels;\n if (labels.items) {\n each(labels.items, function (label) {\n var style = extend(labels.style, label.style),\n x = pInt(style.left) + chart.plotLeft,\n y = pInt(style.top) + chart.plotTop + 12;\n\n // delete to prevent rewriting in IE\n delete style.left;\n delete style.top;\n\n chart.renderer.text(\n label.html,\n x,\n y\n )\n .attr({ zIndex: 2 })\n .css(style)\n .add();\n\n });\n }\n },\n\n /**\n * Render all graphics for the chart\n */\n render: function () {\n var chart = this,\n axes = chart.axes,\n renderer = chart.renderer,\n options = chart.options;\n\n // Title\n chart.setTitle();\n\n\n // Legend\n chart.legend = new Legend(chart, options.legend);\n\n chart.getStacks(); // render stacks\n\n // Get margins by pre-rendering axes\n // set axes scales\n each(axes, function (axis) {\n axis.setScale();\n });\n\n chart.getMargins();\n\n chart.maxTicks = null; // reset for second pass\n each(axes, function (axis) {\n axis.setTickPositions(true); // update to reflect the new margins\n axis.setMaxTicks();\n });\n chart.adjustTickAmounts();\n chart.getMargins(); // second pass to check for new labels\n\n\n // Draw the borders and backgrounds\n chart.drawChartBox();\n\n\n // Axes\n if (chart.hasCartesianSeries) {\n each(axes, function (axis) {\n axis.render();\n });\n }\n\n // The series\n if (!chart.seriesGroup) {\n chart.seriesGroup = renderer.g('series-group')\n .attr({ zIndex: 3 })\n .add();\n }\n chart.renderSeries();\n\n // Labels\n chart.renderLabels();\n\n // Credits\n chart.showCredits(options.credits);\n\n // Set flag\n chart.hasRendered = true;\n\n },\n\n /**\n * Show chart credits based on config options\n */\n showCredits: function (credits) {\n if (credits.enabled && !this.credits) {\n this.credits = this.renderer.text(\n credits.text,\n 0,\n 0\n )\n .on('click', function () {\n if (credits.href) {\n location.href = credits.href;\n }\n })\n .attr({\n align: credits.position.align,\n zIndex: 8\n })\n .css(credits.style)\n .add()\n .align(credits.position);\n }\n },\n\n /**\n * Clean up memory usage\n */\n destroy: function () {\n var chart = this,\n axes = chart.axes,\n series = chart.series,\n container = chart.container,\n i,\n parentNode = container && container.parentNode;\n\n // fire the chart.destoy event\n fireEvent(chart, 'destroy');\n\n // Delete the chart from charts lookup array\n charts[chart.index] = UNDEFINED;\n chartCount--;\n chart.renderTo.removeAttribute('data-highcharts-chart');\n\n // remove events\n removeEvent(chart);\n\n // ==== Destroy collections:\n // Destroy axes\n i = axes.length;\n while (i--) {\n axes[i] = axes[i].destroy();\n }\n\n // Destroy each series\n i = series.length;\n while (i--) {\n series[i] = series[i].destroy();\n }\n\n // ==== Destroy chart properties:\n each(['title', 'subtitle', 'chartBackground', 'plotBackground', 'plotBGImage',\n 'plotBorder', 'seriesGroup', 'clipRect', 'credits', 'pointer', 'scroller',\n 'rangeSelector', 'legend', 'resetZoomButton', 'tooltip', 'renderer'], function (name) {\n var prop = chart[name];\n\n if (prop && prop.destroy) {\n chart[name] = prop.destroy();\n }\n });\n\n // remove container and all SVG\n if (container) { // can break in IE when destroyed before finished loading\n container.innerHTML = '';\n removeEvent(container);\n if (parentNode) {\n discardElement(container);\n }\n\n }\n\n // clean it all up\n for (i in chart) {\n delete chart[i];\n }\n\n },\n\n\n /**\n * VML namespaces can't be added until after complete. Listening\n * for Perini's doScroll hack is not enough.\n */\n isReadyToRender: function () {\n var chart = this;\n\n // Note: in spite of JSLint's complaints, win == win.top is required\n /*jslint eqeq: true*/\n if ((!hasSVG && (win == win.top && doc.readyState !== 'complete')) || (useCanVG && !win.canvg)) {\n /*jslint eqeq: false*/\n if (useCanVG) {\n // Delay rendering until canvg library is downloaded and ready\n CanVGController.push(function () { chart.firstRender(); }, chart.options.global.canvasToolsURL);\n } else {\n doc.attachEvent('onreadystatechange', function () {\n doc.detachEvent('onreadystatechange', chart.firstRender);\n if (doc.readyState === 'complete') {\n chart.firstRender();\n }\n });\n }\n return false;\n }\n return true;\n },\n\n /**\n * Prepare for first rendering after all data are loaded\n */\n firstRender: function () {\n var chart = this,\n options = chart.options,\n callback = chart.callback;\n\n // Check whether the chart is ready to render\n if (!chart.isReadyToRender()) {\n return;\n }\n\n // Create the container\n chart.getContainer();\n\n // Run an early event after the container and renderer are established\n fireEvent(chart, 'init');\n\n\n chart.resetMargins();\n chart.setChartSize();\n\n // Set the common chart properties (mainly invert) from the given series\n chart.propFromSeries();\n\n // get axes\n chart.getAxes();\n\n // Initialize the series\n each(options.series || [], function (serieOptions) {\n chart.initSeries(serieOptions);\n });\n\n chart.linkSeries();\n\n // Run an event after axes and series are initialized, but before render. At this stage,\n // the series data is indexed and cached in the xData and yData arrays, so we can access\n // those before rendering. Used in Highstock.\n fireEvent(chart, 'beforeRender');\n\n // depends on inverted and on margins being set\n if (Highcharts.Pointer) {\n chart.pointer = new Pointer(chart, options);\n }\n\n chart.render();\n\n // add canvas\n chart.renderer.draw();\n // run callbacks\n if (callback) {\n callback.apply(chart, [chart]);\n }\n each(chart.callbacks, function (fn) {\n fn.apply(chart, [chart]);\n });\n\n\n // If the chart was rendered outside the top container, put it back in\n chart.cloneRenderTo(true);\n\n fireEvent(chart, 'load');\n\n },\n\n /**\n * Creates arrays for spacing and margin from given options.\n */\n splashArray: function (target, options) {\n var oVar = options[target],\n tArray = isObject(oVar) ? oVar : [oVar, oVar, oVar, oVar];\n\n return [pick(options[target + 'Top'], tArray[0]),\n pick(options[target + 'Right'], tArray[1]),\n pick(options[target + 'Bottom'], tArray[2]),\n pick(options[target + 'Left'], tArray[3])];\n }\n }; // end Chart\n\n// Hook for exporting module\n Chart.prototype.callbacks = [];\n\n var CenteredSeriesMixin = Highcharts.CenteredSeriesMixin = {\n /**\n * Get the center of the pie based on the size and center options relative to the\n * plot area. Borrowed by the polar and gauge series types.\n */\n getCenter: function () {\n\n var options = this.options,\n chart = this.chart,\n slicingRoom = 2 * (options.slicedOffset || 0),\n handleSlicingRoom,\n plotWidth = chart.plotWidth - 2 * slicingRoom,\n plotHeight = chart.plotHeight - 2 * slicingRoom,\n centerOption = options.center,\n positions = [pick(centerOption[0], '50%'), pick(centerOption[1], '50%'), options.size || '100%', options.innerSize || 0],\n smallestSize = mathMin(plotWidth, plotHeight),\n isPercent;\n\n return map(positions, function (length, i) {\n isPercent = /%$/.test(length);\n handleSlicingRoom = i < 2 || (i === 2 && isPercent);\n return (isPercent ?\n // i == 0: centerX, relative to width\n // i == 1: centerY, relative to height\n // i == 2: size, relative to smallestSize\n // i == 4: innerSize, relative to smallestSize\n [plotWidth, plotHeight, smallestSize, smallestSize][i] *\n pInt(length) / 100 :\n length) + (handleSlicingRoom ? slicingRoom : 0);\n });\n }\n };\n\n /**\n * The Point object and prototype. Inheritable and used as base for PiePoint\n */\n var Point = function () {};\n Point.prototype = {\n\n /**\n * Initialize the point\n * @param {Object} series The series object containing this point\n * @param {Object} options The data in either number, array or object format\n */\n init: function (series, options, x) {\n\n var point = this,\n colors;\n point.series = series;\n point.applyOptions(options, x);\n point.pointAttr = {};\n\n if (series.options.colorByPoint) {\n colors = series.options.colors || series.chart.options.colors;\n point.color = point.color || colors[series.colorCounter++];\n // loop back to zero\n if (series.colorCounter === colors.length) {\n series.colorCounter = 0;\n }\n }\n\n series.chart.pointCount++;\n return point;\n },\n /**\n * Apply the options containing the x and y data and possible some extra properties.\n * This is called on point init or from point.update.\n *\n * @param {Object} options\n */\n applyOptions: function (options, x) {\n var point = this,\n series = point.series,\n pointValKey = series.options.pointValKey || series.pointValKey;\n\n options = Point.prototype.optionsToObject.call(this, options);\n\n // copy options directly to point\n extend(point, options);\n point.options = point.options ? extend(point.options, options) : options;\n\n // For higher dimension series types. For instance, for ranges, point.y is mapped to point.low.\n if (pointValKey) {\n point.y = point[pointValKey];\n }\n\n // If no x is set by now, get auto incremented value. All points must have an\n // x value, however the y value can be null to create a gap in the series\n if (point.x === UNDEFINED && series) {\n point.x = x === UNDEFINED ? series.autoIncrement() : x;\n }\n\n return point;\n },\n\n /**\n * Transform number or array configs into objects\n */\n optionsToObject: function (options) {\n var ret = {},\n series = this.series,\n pointArrayMap = series.pointArrayMap || ['y'],\n valueCount = pointArrayMap.length,\n firstItemType,\n i = 0,\n j = 0;\n\n if (typeof options === 'number' || options === null) {\n ret[pointArrayMap[0]] = options;\n\n } else if (isArray(options)) {\n // with leading x value\n if (options.length > valueCount) {\n firstItemType = typeof options[0];\n if (firstItemType === 'string') {\n ret.name = options[0];\n } else if (firstItemType === 'number') {\n ret.x = options[0];\n }\n i++;\n }\n while (j < valueCount) {\n ret[pointArrayMap[j++]] = options[i++];\n }\n } else if (typeof options === 'object') {\n ret = options;\n\n // This is the fastest way to detect if there are individual point dataLabels that need\n // to be considered in drawDataLabels. These can only occur in object configs.\n if (options.dataLabels) {\n series._hasPointLabels = true;\n }\n\n // Same approach as above for markers\n if (options.marker) {\n series._hasPointMarkers = true;\n }\n }\n return ret;\n },\n\n /**\n * Destroy a point to clear memory. Its reference still stays in series.data.\n */\n destroy: function () {\n var point = this,\n series = point.series,\n chart = series.chart,\n hoverPoints = chart.hoverPoints,\n prop;\n\n chart.pointCount--;\n\n if (hoverPoints) {\n point.setState();\n erase(hoverPoints, point);\n if (!hoverPoints.length) {\n chart.hoverPoints = null;\n }\n\n }\n if (point === chart.hoverPoint) {\n point.onMouseOut();\n }\n\n // remove all events\n if (point.graphic || point.dataLabel) { // removeEvent and destroyElements are performance expensive\n removeEvent(point);\n point.destroyElements();\n }\n\n if (point.legendItem) { // pies have legend items\n chart.legend.destroyItem(point);\n }\n\n for (prop in point) {\n point[prop] = null;\n }\n\n\n },\n\n /**\n * Destroy SVG elements associated with the point\n */\n destroyElements: function () {\n var point = this,\n props = ['graphic', 'dataLabel', 'dataLabelUpper', 'group', 'connector', 'shadowGroup'],\n prop,\n i = 6;\n while (i--) {\n prop = props[i];\n if (point[prop]) {\n point[prop] = point[prop].destroy();\n }\n }\n },\n\n /**\n * Return the configuration hash needed for the data label and tooltip formatters\n */\n getLabelConfig: function () {\n var point = this;\n return {\n x: point.category,\n y: point.y,\n key: point.name || point.category,\n series: point.series,\n point: point,\n percentage: point.percentage,\n total: point.total || point.stackTotal\n };\n },\n\n /**\n * Extendable method for formatting each point's tooltip line\n *\n * @return {String} A string to be concatenated in to the common tooltip text\n */\n tooltipFormatter: function (pointFormat) {\n\n // Insert options for valueDecimals, valuePrefix, and valueSuffix\n var series = this.series,\n seriesTooltipOptions = series.tooltipOptions,\n valueDecimals = pick(seriesTooltipOptions.valueDecimals, ''),\n valuePrefix = seriesTooltipOptions.valuePrefix || '',\n valueSuffix = seriesTooltipOptions.valueSuffix || '';\n\n // Loop over the point array map and replace unformatted values with sprintf formatting markup\n each(series.pointArrayMap || ['y'], function (key) {\n key = '{point.' + key; // without the closing bracket\n if (valuePrefix || valueSuffix) {\n pointFormat = pointFormat.replace(key + '}', valuePrefix + key + '}' + valueSuffix);\n }\n pointFormat = pointFormat.replace(key + '}', key + ':,.' + valueDecimals + 'f}');\n });\n\n return format(pointFormat, {\n point: this,\n series: this.series\n });\n },\n\n /**\n * Fire an event on the Point object. Must not be renamed to fireEvent, as this\n * causes a name clash in MooTools\n * @param {String} eventType\n * @param {Object} eventArgs Additional event arguments\n * @param {Function} defaultFunction Default event handler\n */\n firePointEvent: function (eventType, eventArgs, defaultFunction) {\n var point = this,\n series = this.series,\n seriesOptions = series.options;\n\n // load event handlers on demand to save time on mouseover/out\n if (seriesOptions.point.events[eventType] || (point.options && point.options.events && point.options.events[eventType])) {\n this.importEvents();\n }\n\n // add default handler if in selection mode\n if (eventType === 'click' && seriesOptions.allowPointSelect) {\n defaultFunction = function (event) {\n // Control key is for Windows, meta (= Cmd key) for Mac, Shift for Opera\n point.select(null, event.ctrlKey || event.metaKey || event.shiftKey);\n };\n }\n\n fireEvent(this, eventType, eventArgs, defaultFunction);\n }\n };/**\n * @classDescription The base function which all other series types inherit from. The data in the series is stored\n * in various arrays.\n *\n * - First, series.options.data contains all the original config options for\n * each point whether added by options or methods like series.addPoint.\n * - Next, series.data contains those values converted to points, but in case the series data length\n * exceeds the cropThreshold, or if the data is grouped, series.data doesn't contain all the points. It\n * only contains the points that have been created on demand.\n * - Then there's series.points that contains all currently visible point objects. In case of cropping,\n * the cropped-away points are not part of this array. The series.points array starts at series.cropStart\n * compared to series.data and series.options.data. If however the series data is grouped, these can't\n * be correlated one to one.\n * - series.xData and series.processedXData contain clean x values, equivalent to series.data and series.points.\n * - series.yData and series.processedYData contain clean x values, equivalent to series.data and series.points.\n *\n * @param {Object} chart\n * @param {Object} options\n */\n var Series = function () {};\n\n Series.prototype = {\n\n isCartesian: true,\n type: 'line',\n pointClass: Point,\n sorted: true, // requires the data to be sorted\n requireSorting: true,\n pointAttrToOptions: { // mapping between SVG attributes and the corresponding options\n stroke: 'lineColor',\n 'stroke-width': 'lineWidth',\n fill: 'fillColor',\n r: 'radius'\n },\n axisTypes: ['xAxis', 'yAxis'],\n colorCounter: 0,\n parallelArrays: ['x', 'y'], // each point's x and y values are stored in this.xData and this.yData\n init: function (chart, options) {\n var series = this,\n eventType,\n events,\n chartSeries = chart.series,\n sortByIndex = function (a, b) {\n return pick(a.options.index, a._i) - pick(b.options.index, b._i);\n };\n\n series.chart = chart;\n series.options = options = series.setOptions(options); // merge with plotOptions\n series.linkedSeries = [];\n\n // bind the axes\n series.bindAxes();\n\n // set some variables\n extend(series, {\n name: options.name,\n state: NORMAL_STATE,\n pointAttr: {},\n visible: options.visible !== false, // true by default\n selected: options.selected === true // false by default\n });\n\n // special\n if (useCanVG) {\n options.animation = false;\n }\n\n // register event listeners\n events = options.events;\n for (eventType in events) {\n addEvent(series, eventType, events[eventType]);\n }\n if (\n (events && events.click) ||\n (options.point && options.point.events && options.point.events.click) ||\n options.allowPointSelect\n ) {\n chart.runTrackerClick = true;\n }\n\n series.getColor();\n series.getSymbol();\n\n // Set the data\n each(series.parallelArrays, function (key) {\n series[key + 'Data'] = [];\n });\n series.setData(options.data, false);\n\n // Mark cartesian\n if (series.isCartesian) {\n chart.hasCartesianSeries = true;\n }\n\n // Register it in the chart\n chartSeries.push(series);\n series._i = chartSeries.length - 1;\n\n // Sort series according to index option (#248, #1123, #2456)\n stableSort(chartSeries, sortByIndex);\n if (this.yAxis) {\n stableSort(this.yAxis.series, sortByIndex);\n }\n\n each(chartSeries, function (series, i) {\n series.index = i;\n series.name = series.name || 'Series ' + (i + 1);\n });\n\n },\n\n /**\n * Set the xAxis and yAxis properties of cartesian series, and register the series\n * in the axis.series array\n */\n bindAxes: function () {\n var series = this,\n seriesOptions = series.options,\n chart = series.chart,\n axisOptions;\n\n each(series.axisTypes || [], function (AXIS) { // repeat for xAxis and yAxis\n\n each(chart[AXIS], function (axis) { // loop through the chart's axis objects\n axisOptions = axis.options;\n\n // apply if the series xAxis or yAxis option mathches the number of the\n // axis, or if undefined, use the first axis\n if ((seriesOptions[AXIS] === axisOptions.index) ||\n (seriesOptions[AXIS] !== UNDEFINED && seriesOptions[AXIS] === axisOptions.id) ||\n (seriesOptions[AXIS] === UNDEFINED && axisOptions.index === 0)) {\n\n // register this series in the axis.series lookup\n axis.series.push(series);\n\n // set this series.xAxis or series.yAxis reference\n series[AXIS] = axis;\n\n // mark dirty for redraw\n axis.isDirty = true;\n }\n });\n\n // The series needs an X and an Y axis\n if (!series[AXIS] && series.optionalAxis !== AXIS) {\n error(18, true);\n }\n\n });\n },\n\n /**\n * For simple series types like line and column, the data values are held in arrays like\n * xData and yData for quick lookup to find extremes and more. For multidimensional series\n * like bubble and map, this can be extended with arrays like zData and valueData by\n * adding to the series.parallelArrays array.\n */\n updateParallelArrays: function (point, i) {\n var series = point.series,\n args = arguments,\n fn = typeof i === 'number' ?\n // Insert the value in the given position\n function (key) {\n var val = key === 'y' && series.toYData ? series.toYData(point) : point[key];\n series[key + 'Data'][i] = val;\n } :\n // Apply the method specified in i with the following arguments as arguments\n function (key) {\n Array.prototype[i].apply(series[key + 'Data'], Array.prototype.slice.call(args, 2));\n };\n\n each(series.parallelArrays, fn);\n },\n\n /**\n * Return an auto incremented x value based on the pointStart and pointInterval options.\n * This is only used if an x value is not given for the point that calls autoIncrement.\n */\n autoIncrement: function () {\n var series = this,\n options = series.options,\n xIncrement = series.xIncrement;\n\n xIncrement = pick(xIncrement, options.pointStart, 0);\n\n series.pointInterval = pick(series.pointInterval, options.pointInterval, 1);\n\n series.xIncrement = xIncrement + series.pointInterval;\n return xIncrement;\n },\n\n /**\n * Divide the series data into segments divided by null values.\n */\n getSegments: function () {\n var series = this,\n lastNull = -1,\n segments = [],\n i,\n points = series.points,\n pointsLength = points.length;\n\n if (pointsLength) { // no action required for []\n\n // if connect nulls, just remove null points\n if (series.options.connectNulls) {\n i = pointsLength;\n while (i--) {\n if (points[i].y === null) {\n points.splice(i, 1);\n }\n }\n if (points.length) {\n segments = [points];\n }\n\n // else, split on null points\n } else {\n each(points, function (point, i) {\n if (point.y === null) {\n if (i > lastNull + 1) {\n segments.push(points.slice(lastNull + 1, i));\n }\n lastNull = i;\n } else if (i === pointsLength - 1) { // last value\n segments.push(points.slice(lastNull + 1, i + 1));\n }\n });\n }\n }\n\n // register it\n series.segments = segments;\n },\n\n /**\n * Set the series options by merging from the options tree\n * @param {Object} itemOptions\n */\n setOptions: function (itemOptions) {\n var chart = this.chart,\n chartOptions = chart.options,\n plotOptions = chartOptions.plotOptions,\n userOptions = chart.userOptions || {},\n userPlotOptions = userOptions.plotOptions || {},\n typeOptions = plotOptions[this.type],\n options;\n\n this.userOptions = itemOptions;\n\n options = merge(\n typeOptions,\n plotOptions.series,\n itemOptions\n );\n\n // The tooltip options are merged between global and series specific options\n this.tooltipOptions = merge(\n defaultOptions.tooltip,\n defaultOptions.plotOptions[this.type].tooltip,\n userOptions.tooltip,\n userPlotOptions.series && userPlotOptions.series.tooltip,\n userPlotOptions[this.type] && userPlotOptions[this.type].tooltip,\n itemOptions.tooltip\n );\n\n // Delete marker object if not allowed (#1125)\n if (typeOptions.marker === null) {\n delete options.marker;\n }\n\n return options;\n\n },\n\n getCyclic: function (prop, value, defaults) {\n var i,\n userOptions = this.userOptions,\n indexName = '_' + prop + 'Index',\n counterName = prop + 'Counter';\n\n if (!value) {\n if (defined(userOptions[indexName])) { // after Series.update()\n i = userOptions[indexName];\n } else {\n userOptions[indexName] = i = this.chart[counterName] % defaults.length;\n this.chart[counterName] += 1;\n }\n value = defaults[i];\n }\n this[prop] = value;\n },\n\n /**\n * Get the series' color\n */\n getColor: function () {\n if (!this.options.colorByPoint) {\n this.getCyclic('color', this.options.color || defaultPlotOptions[this.type].color, this.chart.options.colors);\n }\n },\n /**\n * Get the series' symbol\n */\n getSymbol: function () {\n var seriesMarkerOption = this.options.marker;\n\n this.getCyclic('symbol', seriesMarkerOption.symbol, this.chart.options.symbols);\n\n // don't substract radius in image symbols (#604)\n if (/^url/.test(this.symbol)) {\n seriesMarkerOption.radius = 0;\n }\n },\n\n drawLegendSymbol: LegendSymbolMixin.drawLineMarker,\n\n /**\n * Replace the series data with a new set of data\n * @param {Object} data\n * @param {Object} redraw\n */\n setData: function (data, redraw, animation, updatePoints) {\n var series = this,\n oldData = series.points,\n oldDataLength = (oldData && oldData.length) || 0,\n dataLength,\n options = series.options,\n chart = series.chart,\n firstPoint = null,\n xAxis = series.xAxis,\n hasCategories = xAxis && !!xAxis.categories,\n tooltipPoints = series.tooltipPoints,\n i,\n turboThreshold = options.turboThreshold,\n pt,\n xData = this.xData,\n yData = this.yData,\n pointArrayMap = series.pointArrayMap,\n valueCount = pointArrayMap && pointArrayMap.length;\n\n data = data || [];\n dataLength = data.length;\n redraw = pick(redraw, true);\n\n // If the point count is the same as is was, just run Point.update which is\n // cheaper, allows animation, and keeps references to points.\n if (updatePoints !== false && dataLength && oldDataLength === dataLength && !series.cropped && !series.hasGroupedData) {\n each(data, function (point, i) {\n oldData[i].update(point, false, null, false);\n });\n\n } else {\n\n // Reset properties\n series.xIncrement = null;\n series.pointRange = hasCategories ? 1 : options.pointRange;\n\n series.colorCounter = 0; // for series with colorByPoint (#1547)\n\n // Update parallel arrays\n each(this.parallelArrays, function (key) {\n series[key + 'Data'].length = 0;\n });\n\n // In turbo mode, only one- or twodimensional arrays of numbers are allowed. The\n // first value is tested, and we assume that all the rest are defined the same\n // way. Although the 'for' loops are similar, they are repeated inside each\n // if-else conditional for max performance.\n if (turboThreshold && dataLength > turboThreshold) {\n\n // find the first non-null point\n i = 0;\n while (firstPoint === null && i < dataLength) {\n firstPoint = data[i];\n i++;\n }\n\n\n if (isNumber(firstPoint)) { // assume all points are numbers\n var x = pick(options.pointStart, 0),\n pointInterval = pick(options.pointInterval, 1);\n\n for (i = 0; i < dataLength; i++) {\n xData[i] = x;\n yData[i] = data[i];\n x += pointInterval;\n }\n series.xIncrement = x;\n } else if (isArray(firstPoint)) { // assume all points are arrays\n if (valueCount) { // [x, low, high] or [x, o, h, l, c]\n for (i = 0; i < dataLength; i++) {\n pt = data[i];\n xData[i] = pt[0];\n yData[i] = pt.slice(1, valueCount + 1);\n }\n } else { // [x, y]\n for (i = 0; i < dataLength; i++) {\n pt = data[i];\n xData[i] = pt[0];\n yData[i] = pt[1];\n }\n }\n } else {\n error(12); // Highcharts expects configs to be numbers or arrays in turbo mode\n }\n } else {\n for (i = 0; i < dataLength; i++) {\n if (data[i] !== UNDEFINED) { // stray commas in oldIE\n pt = { series: series };\n series.pointClass.prototype.applyOptions.apply(pt, [data[i]]);\n series.updateParallelArrays(pt, i);\n if (hasCategories && pt.name) {\n xAxis.names[pt.x] = pt.name; // #2046\n }\n }\n }\n }\n\n // Forgetting to cast strings to numbers is a common caveat when handling CSV or JSON\n if (isString(yData[0])) {\n error(14, true);\n }\n\n series.data = [];\n series.options.data = data;\n //series.zData = zData;\n\n // destroy old points\n i = oldDataLength;\n while (i--) {\n if (oldData[i] && oldData[i].destroy) {\n oldData[i].destroy();\n }\n }\n if (tooltipPoints) { // #2594\n tooltipPoints.length = 0;\n }\n\n // reset minRange (#878)\n if (xAxis) {\n xAxis.minRange = xAxis.userMinRange;\n }\n\n // redraw\n series.isDirty = series.isDirtyData = chart.isDirtyBox = true;\n animation = false;\n }\n\n if (redraw) {\n chart.redraw(animation);\n }\n },\n\n /**\n * Process the data by cropping away unused data points if the series is longer\n * than the crop threshold. This saves computing time for lage series.\n */\n processData: function (force) {\n var series = this,\n processedXData = series.xData, // copied during slice operation below\n processedYData = series.yData,\n dataLength = processedXData.length,\n croppedData,\n cropStart = 0,\n cropped,\n distance,\n closestPointRange,\n xAxis = series.xAxis,\n i, // loop variable\n options = series.options,\n cropThreshold = options.cropThreshold,\n activePointCount = 0,\n isCartesian = series.isCartesian,\n xExtremes,\n min,\n max;\n\n // If the series data or axes haven't changed, don't go through this. Return false to pass\n // the message on to override methods like in data grouping.\n if (isCartesian && !series.isDirty && !xAxis.isDirty && !series.yAxis.isDirty && !force) {\n return false;\n }\n\n if (xAxis) {\n xExtremes = xAxis.getExtremes(); // corrected for log axis (#3053)\n min = xExtremes.min;\n max = xExtremes.max;\n }\n\n // optionally filter out points outside the plot area\n if (isCartesian && series.sorted && (!cropThreshold || dataLength > cropThreshold || series.forceCrop)) {\n\n // it's outside current extremes\n if (processedXData[dataLength - 1] < min || processedXData[0] > max) {\n processedXData = [];\n processedYData = [];\n\n // only crop if it's actually spilling out\n } else if (processedXData[0] < min || processedXData[dataLength - 1] > max) {\n croppedData = this.cropData(series.xData, series.yData, min, max);\n processedXData = croppedData.xData;\n processedYData = croppedData.yData;\n cropStart = croppedData.start;\n cropped = true;\n activePointCount = processedXData.length;\n }\n }\n\n\n // Find the closest distance between processed points\n for (i = processedXData.length - 1; i >= 0; i--) {\n distance = processedXData[i] - processedXData[i - 1];\n\n if (!cropped && processedXData[i] > min && processedXData[i] < max) {\n activePointCount++;\n }\n\n if (distance > 0 && (closestPointRange === UNDEFINED || distance < closestPointRange)) {\n closestPointRange = distance;\n\n // Unsorted data is not supported by the line tooltip, as well as data grouping and\n // navigation in Stock charts (#725) and width calculation of columns (#1900)\n } else if (distance < 0 && series.requireSorting) {\n error(15);\n }\n }\n\n // Record the properties\n series.cropped = cropped; // undefined or true\n series.cropStart = cropStart;\n series.processedXData = processedXData;\n series.processedYData = processedYData;\n series.activePointCount = activePointCount;\n\n if (options.pointRange === null) { // null means auto, as for columns, candlesticks and OHLC\n series.pointRange = closestPointRange || 1;\n }\n series.closestPointRange = closestPointRange;\n\n },\n\n /**\n * Iterate over xData and crop values between min and max. Returns object containing crop start/end\n * cropped xData with corresponding part of yData, dataMin and dataMax within the cropped range\n */\n cropData: function (xData, yData, min, max) {\n var dataLength = xData.length,\n cropStart = 0,\n cropEnd = dataLength,\n cropShoulder = pick(this.cropShoulder, 1), // line-type series need one point outside\n i;\n\n // iterate up to find slice start\n for (i = 0; i < dataLength; i++) {\n if (xData[i] >= min) {\n cropStart = mathMax(0, i - cropShoulder);\n break;\n }\n }\n\n // proceed to find slice end\n for (; i < dataLength; i++) {\n if (xData[i] > max) {\n cropEnd = i + cropShoulder;\n break;\n }\n }\n\n return {\n xData: xData.slice(cropStart, cropEnd),\n yData: yData.slice(cropStart, cropEnd),\n start: cropStart,\n end: cropEnd\n };\n },\n\n\n /**\n * Generate the data point after the data has been processed by cropping away\n * unused points and optionally grouped in Highcharts Stock.\n */\n generatePoints: function () {\n var series = this,\n options = series.options,\n dataOptions = options.data,\n data = series.data,\n dataLength,\n processedXData = series.processedXData,\n processedYData = series.processedYData,\n pointClass = series.pointClass,\n processedDataLength = processedXData.length,\n cropStart = series.cropStart || 0,\n cursor,\n hasGroupedData = series.hasGroupedData,\n point,\n points = [],\n i;\n\n if (!data && !hasGroupedData) {\n var arr = [];\n arr.length = dataOptions.length;\n data = series.data = arr;\n }\n\n for (i = 0; i < processedDataLength; i++) {\n cursor = cropStart + i;\n if (!hasGroupedData) {\n if (data[cursor]) {\n point = data[cursor];\n } else if (dataOptions[cursor] !== UNDEFINED) { // #970\n data[cursor] = point = (new pointClass()).init(series, dataOptions[cursor], processedXData[i]);\n }\n points[i] = point;\n } else {\n // splat the y data in case of ohlc data array\n points[i] = (new pointClass()).init(series, [processedXData[i]].concat(splat(processedYData[i])));\n }\n points[i].index = cursor; // For faster access in Point.update\n }\n\n // Hide cropped-away points - this only runs when the number of points is above cropThreshold, or when\n // swithching view from non-grouped data to grouped data (#637)\n if (data && (processedDataLength !== (dataLength = data.length) || hasGroupedData)) {\n for (i = 0; i < dataLength; i++) {\n if (i === cropStart && !hasGroupedData) { // when has grouped data, clear all points\n i += processedDataLength;\n }\n if (data[i]) {\n data[i].destroyElements();\n data[i].plotX = UNDEFINED; // #1003\n }\n }\n }\n\n series.data = data;\n series.points = points;\n },\n\n /**\n * Calculate Y extremes for visible data\n */\n getExtremes: function (yData) {\n var xAxis = this.xAxis,\n yAxis = this.yAxis,\n xData = this.processedXData,\n yDataLength,\n activeYData = [],\n activeCounter = 0,\n xExtremes = xAxis.getExtremes(), // #2117, need to compensate for log X axis\n xMin = xExtremes.min,\n xMax = xExtremes.max,\n validValue,\n withinRange,\n dataMin,\n dataMax,\n x,\n y,\n i,\n j;\n\n yData = yData || this.stackedYData || this.processedYData;\n yDataLength = yData.length;\n\n for (i = 0; i < yDataLength; i++) {\n\n x = xData[i];\n y = yData[i];\n\n // For points within the visible range, including the first point outside the\n // visible range, consider y extremes\n validValue = y !== null && y !== UNDEFINED && (!yAxis.isLog || (y.length || y > 0));\n withinRange = this.getExtremesFromAll || this.cropped || ((xData[i + 1] || x) >= xMin &&\n (xData[i - 1] || x) <= xMax);\n\n if (validValue && withinRange) {\n\n j = y.length;\n if (j) { // array, like ohlc or range data\n while (j--) {\n if (y[j] !== null) {\n activeYData[activeCounter++] = y[j];\n }\n }\n } else {\n activeYData[activeCounter++] = y;\n }\n }\n }\n this.dataMin = pick(dataMin, arrayMin(activeYData));\n this.dataMax = pick(dataMax, arrayMax(activeYData));\n },\n\n /**\n * Translate data points from raw data values to chart specific positioning data\n * needed later in drawPoints, drawGraph and drawTracker.\n */\n translate: function () {\n if (!this.processedXData) { // hidden series\n this.processData();\n }\n this.generatePoints();\n var series = this,\n options = series.options,\n stacking = options.stacking,\n xAxis = series.xAxis,\n categories = xAxis.categories,\n yAxis = series.yAxis,\n points = series.points,\n dataLength = points.length,\n hasModifyValue = !!series.modifyValue,\n i,\n pointPlacement = options.pointPlacement,\n dynamicallyPlaced = pointPlacement === 'between' || isNumber(pointPlacement),\n threshold = options.threshold;\n\n // Translate each point\n for (i = 0; i < dataLength; i++) {\n var point = points[i],\n xValue = point.x,\n yValue = point.y,\n yBottom = point.low,\n stack = stacking && yAxis.stacks[(series.negStacks && yValue < threshold ? '-' : '') + series.stackKey],\n pointStack,\n stackValues;\n\n // Discard disallowed y values for log axes\n if (yAxis.isLog && yValue <= 0) {\n point.y = yValue = null;\n error(10);\n }\n\n // Get the plotX translation\n point.plotX = xAxis.translate(xValue, 0, 0, 0, 1, pointPlacement, this.type === 'flags'); // Math.round fixes #591\n\n\n // Calculate the bottom y value for stacked series\n if (stacking && series.visible && stack && stack[xValue]) {\n\n pointStack = stack[xValue];\n stackValues = pointStack.points[series.index + ',' + i];\n yBottom = stackValues[0];\n yValue = stackValues[1];\n\n if (yBottom === 0) {\n yBottom = pick(threshold, yAxis.min);\n }\n if (yAxis.isLog && yBottom <= 0) { // #1200, #1232\n yBottom = null;\n }\n\n point.total = point.stackTotal = pointStack.total;\n point.percentage = pointStack.total && (point.y / pointStack.total * 100);\n point.stackY = yValue;\n\n // Place the stack label\n pointStack.setOffset(series.pointXOffset || 0, series.barW || 0);\n\n }\n\n // Set translated yBottom or remove it\n point.yBottom = defined(yBottom) ?\n yAxis.translate(yBottom, 0, 1, 0, 1) :\n null;\n\n // general hook, used for Highstock compare mode\n if (hasModifyValue) {\n yValue = series.modifyValue(yValue, point);\n }\n\n // Set the the plotY value, reset it for redraws\n point.plotY = (typeof yValue === 'number' && yValue !== Infinity) ?\n //mathRound(yAxis.translate(yValue, 0, 1, 0, 1) * 10) / 10 : // Math.round fixes #591\n yAxis.translate(yValue, 0, 1, 0, 1) :\n UNDEFINED;\n\n // Set client related positions for mouse tracking\n point.clientX = dynamicallyPlaced ? xAxis.translate(xValue, 0, 0, 0, 1) : point.plotX; // #1514\n\n point.negative = point.y < (threshold || 0);\n\n // some API data\n point.category = categories && categories[point.x] !== UNDEFINED ?\n categories[point.x] : point.x;\n\n }\n\n // now that we have the cropped data, build the segments\n series.getSegments();\n },\n\n /**\n * Animate in the series\n */\n animate: function (init) {\n var series = this,\n chart = series.chart,\n renderer = chart.renderer,\n clipRect,\n markerClipRect,\n animation = series.options.animation,\n clipBox = series.clipBox || chart.clipBox,\n inverted = chart.inverted,\n sharedClipKey;\n\n // Animation option is set to true\n if (animation && !isObject(animation)) {\n animation = defaultPlotOptions[series.type].animation;\n }\n sharedClipKey = ['_sharedClip', animation.duration, animation.easing, clipBox.height].join(',');\n\n // Initialize the animation. Set up the clipping rectangle.\n if (init) {\n\n // If a clipping rectangle with the same properties is currently present in the chart, use that.\n clipRect = chart[sharedClipKey];\n markerClipRect = chart[sharedClipKey + 'm'];\n if (!clipRect) {\n chart[sharedClipKey] = clipRect = renderer.clipRect(\n extend(clipBox, { width: 0 })\n );\n\n chart[sharedClipKey + 'm'] = markerClipRect = renderer.clipRect(\n -99, // include the width of the first marker\n inverted ? -chart.plotLeft : -chart.plotTop,\n 99,\n inverted ? chart.chartWidth : chart.chartHeight\n );\n }\n series.group.clip(clipRect);\n series.markerGroup.clip(markerClipRect);\n series.sharedClipKey = sharedClipKey;\n\n // Run the animation\n } else {\n clipRect = chart[sharedClipKey];\n if (clipRect) {\n clipRect.animate({\n width: chart.plotSizeX\n }, animation);\n }\n if (chart[sharedClipKey + 'm']) {\n chart[sharedClipKey + 'm'].animate({\n width: chart.plotSizeX + 99\n }, animation);\n }\n\n // Delete this function to allow it only once\n series.animate = null;\n\n }\n },\n\n /**\n * This runs after animation to land on the final plot clipping\n */\n afterAnimate: function () {\n var chart = this.chart,\n sharedClipKey = this.sharedClipKey,\n group = this.group,\n clipBox = this.clipBox;\n\n if (group && this.options.clip !== false) {\n if (!sharedClipKey || !clipBox) {\n group.clip(clipBox ? chart.renderer.clipRect(clipBox) : chart.clipRect);\n }\n this.markerGroup.clip(); // no clip\n }\n\n fireEvent(this, 'afterAnimate');\n\n // Remove the shared clipping rectancgle when all series are shown\n setTimeout(function () {\n if (sharedClipKey && chart[sharedClipKey]) {\n if (!clipBox) {\n chart[sharedClipKey] = chart[sharedClipKey].destroy();\n }\n if (chart[sharedClipKey + 'm']) {\n chart[sharedClipKey + 'm'] = chart[sharedClipKey + 'm'].destroy();\n }\n }\n }, 100);\n },\n\n /**\n * Draw the markers\n */\n drawPoints: function () {\n var series = this,\n pointAttr,\n points = series.points,\n chart = series.chart,\n plotX,\n plotY,\n i,\n point,\n radius,\n symbol,\n isImage,\n graphic,\n options = series.options,\n seriesMarkerOptions = options.marker,\n seriesPointAttr = series.pointAttr[''],\n pointMarkerOptions,\n hasPointMarker,\n enabled,\n isInside,\n markerGroup = series.markerGroup,\n globallyEnabled = pick(\n seriesMarkerOptions.enabled,\n !series.requireSorting || series.activePointCount < (0.5 * series.xAxis.len / seriesMarkerOptions.radius)\n );\n\n if (seriesMarkerOptions.enabled !== false || series._hasPointMarkers) {\n\n i = points.length;\n while (i--) {\n point = points[i];\n plotX = mathFloor(point.plotX); // #1843\n plotY = point.plotY;\n graphic = point.graphic;\n pointMarkerOptions = point.marker || {};\n hasPointMarker = !!point.marker;\n enabled = (globallyEnabled && pointMarkerOptions.enabled === UNDEFINED) || pointMarkerOptions.enabled;\n isInside = chart.isInsidePlot(mathRound(plotX), plotY, chart.inverted); // #1858\n\n // only draw the point if y is defined\n if (enabled && plotY !== UNDEFINED && !isNaN(plotY) && point.y !== null) {\n\n // shortcuts\n pointAttr = point.pointAttr[point.selected ? SELECT_STATE : NORMAL_STATE] || seriesPointAttr;\n radius = pointAttr.r;\n symbol = pick(pointMarkerOptions.symbol, series.symbol);\n isImage = symbol.indexOf('url') === 0;\n\n if (graphic) { // update\n graphic[isInside ? 'show' : 'hide'](true) // Since the marker group isn't clipped, each individual marker must be toggled\n .animate(extend({\n x: plotX - radius,\n y: plotY - radius\n }, graphic.symbolName ? { // don't apply to image symbols #507\n width: 2 * radius,\n height: 2 * radius\n } : {}));\n } else if (isInside && (radius > 0 || isImage)) {\n point.graphic = graphic = chart.renderer.symbol(\n symbol,\n plotX - radius,\n plotY - radius,\n 2 * radius,\n 2 * radius,\n hasPointMarker ? pointMarkerOptions : seriesMarkerOptions\n )\n .attr(pointAttr)\n .add(markerGroup);\n }\n\n } else if (graphic) {\n point.graphic = graphic.destroy(); // #1269\n }\n }\n }\n\n },\n\n /**\n * Convert state properties from API naming conventions to SVG attributes\n *\n * @param {Object} options API options object\n * @param {Object} base1 SVG attribute object to inherit from\n * @param {Object} base2 Second level SVG attribute object to inherit from\n */\n convertAttribs: function (options, base1, base2, base3) {\n var conversion = this.pointAttrToOptions,\n attr,\n option,\n obj = {};\n\n options = options || {};\n base1 = base1 || {};\n base2 = base2 || {};\n base3 = base3 || {};\n\n for (attr in conversion) {\n option = conversion[attr];\n obj[attr] = pick(options[option], base1[attr], base2[attr], base3[attr]);\n }\n return obj;\n },\n\n /**\n * Get the state attributes. Each series type has its own set of attributes\n * that are allowed to change on a point's state change. Series wide attributes are stored for\n * all series, and additionally point specific attributes are stored for all\n * points with individual marker options. If such options are not defined for the point,\n * a reference to the series wide attributes is stored in point.pointAttr.\n */\n getAttribs: function () {\n var series = this,\n seriesOptions = series.options,\n normalOptions = defaultPlotOptions[series.type].marker ? seriesOptions.marker : seriesOptions,\n stateOptions = normalOptions.states,\n stateOptionsHover = stateOptions[HOVER_STATE],\n pointStateOptionsHover,\n seriesColor = series.color,\n normalDefaults = {\n stroke: seriesColor,\n fill: seriesColor\n },\n points = series.points || [], // #927\n i,\n point,\n seriesPointAttr = [],\n pointAttr,\n pointAttrToOptions = series.pointAttrToOptions,\n hasPointSpecificOptions = series.hasPointSpecificOptions,\n negativeColor = seriesOptions.negativeColor,\n defaultLineColor = normalOptions.lineColor,\n defaultFillColor = normalOptions.fillColor,\n turboThreshold = seriesOptions.turboThreshold,\n attr,\n key;\n\n // series type specific modifications\n if (seriesOptions.marker) { // line, spline, area, areaspline, scatter\n\n // if no hover radius is given, default to normal radius + 2\n stateOptionsHover.radius = stateOptionsHover.radius || normalOptions.radius + stateOptionsHover.radiusPlus;\n stateOptionsHover.lineWidth = stateOptionsHover.lineWidth || normalOptions.lineWidth + stateOptionsHover.lineWidthPlus;\n\n } else { // column, bar, pie\n\n // if no hover color is given, brighten the normal color\n stateOptionsHover.color = stateOptionsHover.color ||\n Color(stateOptionsHover.color || seriesColor)\n .brighten(stateOptionsHover.brightness).get();\n }\n\n // general point attributes for the series normal state\n seriesPointAttr[NORMAL_STATE] = series.convertAttribs(normalOptions, normalDefaults);\n\n // HOVER_STATE and SELECT_STATE states inherit from normal state except the default radius\n each([HOVER_STATE, SELECT_STATE], function (state) {\n seriesPointAttr[state] =\n series.convertAttribs(stateOptions[state], seriesPointAttr[NORMAL_STATE]);\n });\n\n // set it\n series.pointAttr = seriesPointAttr;\n\n\n // Generate the point-specific attribute collections if specific point\n // options are given. If not, create a referance to the series wide point\n // attributes\n i = points.length;\n if (!turboThreshold || i < turboThreshold || hasPointSpecificOptions) {\n while (i--) {\n point = points[i];\n normalOptions = (point.options && point.options.marker) || point.options;\n if (normalOptions && normalOptions.enabled === false) {\n normalOptions.radius = 0;\n }\n\n if (point.negative && negativeColor) {\n point.color = point.fillColor = negativeColor;\n }\n\n hasPointSpecificOptions = seriesOptions.colorByPoint || point.color; // #868\n\n // check if the point has specific visual options\n if (point.options) {\n for (key in pointAttrToOptions) {\n if (defined(normalOptions[pointAttrToOptions[key]])) {\n hasPointSpecificOptions = true;\n }\n }\n }\n\n // a specific marker config object is defined for the individual point:\n // create it's own attribute collection\n if (hasPointSpecificOptions) {\n normalOptions = normalOptions || {};\n pointAttr = [];\n stateOptions = normalOptions.states || {}; // reassign for individual point\n pointStateOptionsHover = stateOptions[HOVER_STATE] = stateOptions[HOVER_STATE] || {};\n\n // Handle colors for column and pies\n if (!seriesOptions.marker) { // column, bar, point\n // If no hover color is given, brighten the normal color. #1619, #2579\n pointStateOptionsHover.color = pointStateOptionsHover.color || (!point.options.color && stateOptionsHover.color) ||\n Color(point.color)\n .brighten(pointStateOptionsHover.brightness || stateOptionsHover.brightness)\n .get();\n }\n\n // normal point state inherits series wide normal state\n attr = { color: point.color }; // #868\n if (!defaultFillColor) { // Individual point color or negative color markers (#2219)\n attr.fillColor = point.color;\n }\n if (!defaultLineColor) {\n attr.lineColor = point.color; // Bubbles take point color, line markers use white\n }\n pointAttr[NORMAL_STATE] = series.convertAttribs(extend(attr, normalOptions), seriesPointAttr[NORMAL_STATE]);\n\n // inherit from point normal and series hover\n pointAttr[HOVER_STATE] = series.convertAttribs(\n stateOptions[HOVER_STATE],\n seriesPointAttr[HOVER_STATE],\n pointAttr[NORMAL_STATE]\n );\n\n // inherit from point normal and series hover\n pointAttr[SELECT_STATE] = series.convertAttribs(\n stateOptions[SELECT_STATE],\n seriesPointAttr[SELECT_STATE],\n pointAttr[NORMAL_STATE]\n );\n\n\n // no marker config object is created: copy a reference to the series-wide\n // attribute collection\n } else {\n pointAttr = seriesPointAttr;\n }\n\n point.pointAttr = pointAttr;\n }\n }\n },\n\n /**\n * Clear DOM objects and free up memory\n */\n destroy: function () {\n var series = this,\n chart = series.chart,\n issue134 = /AppleWebKit\\/533/.test(userAgent),\n destroy,\n i,\n data = series.data || [],\n point,\n prop,\n axis;\n\n // add event hook\n fireEvent(series, 'destroy');\n\n // remove all events\n removeEvent(series);\n\n // erase from axes\n each(series.axisTypes || [], function (AXIS) {\n axis = series[AXIS];\n if (axis) {\n erase(axis.series, series);\n axis.isDirty = axis.forceRedraw = true;\n }\n });\n\n // remove legend items\n if (series.legendItem) {\n series.chart.legend.destroyItem(series);\n }\n\n // destroy all points with their elements\n i = data.length;\n while (i--) {\n point = data[i];\n if (point && point.destroy) {\n point.destroy();\n }\n }\n series.points = null;\n\n // Clear the animation timeout if we are destroying the series during initial animation\n clearTimeout(series.animationTimeout);\n\n // destroy all SVGElements associated to the series\n each(['area', 'graph', 'dataLabelsGroup', 'group', 'markerGroup', 'tracker',\n 'graphNeg', 'areaNeg', 'posClip', 'negClip'], function (prop) {\n if (series[prop]) {\n\n // issue 134 workaround\n destroy = issue134 && prop === 'group' ?\n 'hide' :\n 'destroy';\n\n series[prop][destroy]();\n }\n });\n\n // remove from hoverSeries\n if (chart.hoverSeries === series) {\n chart.hoverSeries = null;\n }\n erase(chart.series, series);\n\n // clear all members\n for (prop in series) {\n delete series[prop];\n }\n },\n\n /**\n * Return the graph path of a segment\n */\n getSegmentPath: function (segment) {\n var series = this,\n segmentPath = [],\n step = series.options.step;\n\n // build the segment line\n each(segment, function (point, i) {\n\n var plotX = point.plotX,\n plotY = point.plotY,\n lastPoint;\n\n if (series.getPointSpline) { // generate the spline as defined in the SplineSeries object\n segmentPath.push.apply(segmentPath, series.getPointSpline(segment, point, i));\n\n } else {\n\n // moveTo or lineTo\n segmentPath.push(i ? L : M);\n\n // step line?\n if (step && i) {\n lastPoint = segment[i - 1];\n if (step === 'right') {\n segmentPath.push(\n lastPoint.plotX,\n plotY\n );\n\n } else if (step === 'center') {\n segmentPath.push(\n (lastPoint.plotX + plotX) / 2,\n lastPoint.plotY,\n (lastPoint.plotX + plotX) / 2,\n plotY\n );\n\n } else {\n segmentPath.push(\n plotX,\n lastPoint.plotY\n );\n }\n }\n\n // normal line to next point\n segmentPath.push(\n point.plotX,\n point.plotY\n );\n }\n });\n\n return segmentPath;\n },\n\n /**\n * Get the graph path\n */\n getGraphPath: function () {\n var series = this,\n graphPath = [],\n segmentPath,\n singlePoints = []; // used in drawTracker\n\n // Divide into segments and build graph and area paths\n each(series.segments, function (segment) {\n\n segmentPath = series.getSegmentPath(segment);\n\n // add the segment to the graph, or a single point for tracking\n if (segment.length > 1) {\n graphPath = graphPath.concat(segmentPath);\n } else {\n singlePoints.push(segment[0]);\n }\n });\n\n // Record it for use in drawGraph and drawTracker, and return graphPath\n series.singlePoints = singlePoints;\n series.graphPath = graphPath;\n\n return graphPath;\n\n },\n\n /**\n * Draw the actual graph\n */\n drawGraph: function () {\n var series = this,\n options = this.options,\n props = [['graph', options.lineColor || this.color]],\n lineWidth = options.lineWidth,\n dashStyle = options.dashStyle,\n roundCap = options.linecap !== 'square',\n graphPath = this.getGraphPath(),\n negativeColor = options.negativeColor;\n\n if (negativeColor) {\n props.push(['graphNeg', negativeColor]);\n }\n\n // draw the graph\n each(props, function (prop, i) {\n var graphKey = prop[0],\n graph = series[graphKey],\n attribs;\n\n if (graph) {\n stop(graph); // cancel running animations, #459\n graph.animate({ d: graphPath });\n\n } else if (lineWidth && graphPath.length) { // #1487\n attribs = {\n stroke: prop[1],\n 'stroke-width': lineWidth,\n fill: NONE,\n zIndex: 1 // #1069\n };\n if (dashStyle) {\n attribs.dashstyle = dashStyle;\n } else if (roundCap) {\n attribs['stroke-linecap'] = attribs['stroke-linejoin'] = 'round';\n }\n\n series[graphKey] = series.chart.renderer.path(graphPath)\n .attr(attribs)\n .add(series.group)\n .shadow(!i && options.shadow);\n }\n });\n },\n\n /**\n * Clip the graphs into the positive and negative coloured graphs\n */\n clipNeg: function () {\n var options = this.options,\n chart = this.chart,\n renderer = chart.renderer,\n negativeColor = options.negativeColor || options.negativeFillColor,\n translatedThreshold,\n posAttr,\n negAttr,\n graph = this.graph,\n area = this.area,\n posClip = this.posClip,\n negClip = this.negClip,\n chartWidth = chart.chartWidth,\n chartHeight = chart.chartHeight,\n chartSizeMax = mathMax(chartWidth, chartHeight),\n yAxis = this.yAxis,\n above,\n below;\n\n if (negativeColor && (graph || area)) {\n translatedThreshold = mathRound(yAxis.toPixels(options.threshold || 0, true));\n if (translatedThreshold < 0) {\n chartSizeMax -= translatedThreshold; // #2534\n }\n above = {\n x: 0,\n y: 0,\n width: chartSizeMax,\n height: translatedThreshold\n };\n below = {\n x: 0,\n y: translatedThreshold,\n width: chartSizeMax,\n height: chartSizeMax\n };\n\n if (chart.inverted) {\n\n above.height = below.y = chart.plotWidth - translatedThreshold;\n if (renderer.isVML) {\n above = {\n x: chart.plotWidth - translatedThreshold - chart.plotLeft,\n y: 0,\n width: chartWidth,\n height: chartHeight\n };\n below = {\n x: translatedThreshold + chart.plotLeft - chartWidth,\n y: 0,\n width: chart.plotLeft + translatedThreshold,\n height: chartWidth\n };\n }\n }\n\n if (yAxis.reversed) {\n posAttr = below;\n negAttr = above;\n } else {\n posAttr = above;\n negAttr = below;\n }\n\n if (posClip) { // update\n posClip.animate(posAttr);\n negClip.animate(negAttr);\n } else {\n\n this.posClip = posClip = renderer.clipRect(posAttr);\n this.negClip = negClip = renderer.clipRect(negAttr);\n\n if (graph && this.graphNeg) {\n graph.clip(posClip);\n this.graphNeg.clip(negClip);\n }\n\n if (area) {\n area.clip(posClip);\n this.areaNeg.clip(negClip);\n }\n }\n }\n },\n\n /**\n * Initialize and perform group inversion on series.group and series.markerGroup\n */\n invertGroups: function () {\n var series = this,\n chart = series.chart;\n\n // Pie, go away (#1736)\n if (!series.xAxis) {\n return;\n }\n\n // A fixed size is needed for inversion to work\n function setInvert() {\n var size = {\n width: series.yAxis.len,\n height: series.xAxis.len\n };\n\n each(['group', 'markerGroup'], function (groupName) {\n if (series[groupName]) {\n series[groupName].attr(size).invert();\n }\n });\n }\n\n addEvent(chart, 'resize', setInvert); // do it on resize\n addEvent(series, 'destroy', function () {\n removeEvent(chart, 'resize', setInvert);\n });\n\n // Do it now\n setInvert(); // do it now\n\n // On subsequent render and redraw, just do setInvert without setting up events again\n series.invertGroups = setInvert;\n },\n\n /**\n * General abstraction for creating plot groups like series.group, series.dataLabelsGroup and\n * series.markerGroup. On subsequent calls, the group will only be adjusted to the updated plot size.\n */\n plotGroup: function (prop, name, visibility, zIndex, parent) {\n var group = this[prop],\n isNew = !group;\n\n // Generate it on first call\n if (isNew) {\n this[prop] = group = this.chart.renderer.g(name)\n .attr({\n visibility: visibility,\n zIndex: zIndex || 0.1 // IE8 needs this\n })\n .add(parent);\n }\n // Place it on first and subsequent (redraw) calls\n group[isNew ? 'attr' : 'animate'](this.getPlotBox());\n return group;\n },\n\n /**\n * Get the translation and scale for the plot area of this series\n */\n getPlotBox: function () {\n var chart = this.chart,\n xAxis = this.xAxis,\n yAxis = this.yAxis;\n\n // Swap axes for inverted (#2339)\n if (chart.inverted) {\n xAxis = yAxis;\n yAxis = this.xAxis;\n }\n return {\n translateX: xAxis ? xAxis.left : chart.plotLeft,\n translateY: yAxis ? yAxis.top : chart.plotTop,\n scaleX: 1, // #1623\n scaleY: 1\n };\n },\n\n /**\n * Render the graph and markers\n */\n render: function () {\n var series = this,\n chart = series.chart,\n group,\n options = series.options,\n animation = options.animation,\n // Animation doesn't work in IE8 quirks when the group div is hidden,\n // and looks bad in other oldIE\n animDuration = (animation && !!series.animate && chart.renderer.isSVG && pick(animation.duration, 500)) || 0,\n visibility = series.visible ? VISIBLE : HIDDEN,\n zIndex = options.zIndex,\n hasRendered = series.hasRendered,\n chartSeriesGroup = chart.seriesGroup;\n\n // the group\n group = series.plotGroup(\n 'group',\n 'series',\n visibility,\n zIndex,\n chartSeriesGroup\n );\n\n series.markerGroup = series.plotGroup(\n 'markerGroup',\n 'markers',\n visibility,\n zIndex,\n chartSeriesGroup\n );\n\n // initiate the animation\n if (animDuration) {\n series.animate(true);\n }\n\n // cache attributes for shapes\n series.getAttribs();\n\n // SVGRenderer needs to know this before drawing elements (#1089, #1795)\n group.inverted = series.isCartesian ? chart.inverted : false;\n\n // draw the graph if any\n if (series.drawGraph) {\n series.drawGraph();\n series.clipNeg();\n }\n\n each(series.points, function (point) {\n if (point.redraw) {\n point.redraw();\n }\n });\n\n // draw the data labels (inn pies they go before the points)\n if (series.drawDataLabels) {\n series.drawDataLabels();\n }\n\n // draw the points\n if (series.visible) {\n series.drawPoints();\n }\n\n\n // draw the mouse tracking area\n if (series.drawTracker && series.options.enableMouseTracking !== false) {\n series.drawTracker();\n }\n\n // Handle inverted series and tracker groups\n if (chart.inverted) {\n series.invertGroups();\n }\n\n // Initial clipping, must be defined after inverting groups for VML\n if (options.clip !== false && !series.sharedClipKey && !hasRendered) {\n group.clip(chart.clipRect);\n }\n\n // Run the animation\n if (animDuration) {\n series.animate();\n }\n\n // Call the afterAnimate function on animation complete (but don't overwrite the animation.complete option\n // which should be available to the user).\n if (!hasRendered) {\n if (animDuration) {\n series.animationTimeout = setTimeout(function () {\n series.afterAnimate();\n }, animDuration);\n } else {\n series.afterAnimate();\n }\n }\n\n series.isDirty = series.isDirtyData = false; // means data is in accordance with what you see\n // (See #322) series.isDirty = series.isDirtyData = false; // means data is in accordance with what you see\n series.hasRendered = true;\n },\n\n /**\n * Redraw the series after an update in the axes.\n */\n redraw: function () {\n var series = this,\n chart = series.chart,\n wasDirtyData = series.isDirtyData, // cache it here as it is set to false in render, but used after\n group = series.group,\n xAxis = series.xAxis,\n yAxis = series.yAxis;\n\n // reposition on resize\n if (group) {\n if (chart.inverted) {\n group.attr({\n width: chart.plotWidth,\n height: chart.plotHeight\n });\n }\n\n group.animate({\n translateX: pick(xAxis && xAxis.left, chart.plotLeft),\n translateY: pick(yAxis && yAxis.top, chart.plotTop)\n });\n }\n\n series.translate();\n if (series.setTooltipPoints) {\n series.setTooltipPoints(true);\n }\n series.render();\n\n if (wasDirtyData) {\n fireEvent(series, 'updatedData');\n }\n }\n }; // end Series prototype\n\n /**\n * The class for stack items\n */\n function StackItem(axis, options, isNegative, x, stackOption) {\n\n var inverted = axis.chart.inverted;\n\n this.axis = axis;\n\n // Tells if the stack is negative\n this.isNegative = isNegative;\n\n // Save the options to be able to style the label\n this.options = options;\n\n // Save the x value to be able to position the label later\n this.x = x;\n\n // Initialize total value\n this.total = null;\n\n // This will keep each points' extremes stored by series.index and point index\n this.points = {};\n\n // Save the stack option on the series configuration object, and whether to treat it as percent\n this.stack = stackOption;\n\n // The align options and text align varies on whether the stack is negative and\n // if the chart is inverted or not.\n // First test the user supplied value, then use the dynamic.\n this.alignOptions = {\n align: options.align || (inverted ? (isNegative ? 'left' : 'right') : 'center'),\n verticalAlign: options.verticalAlign || (inverted ? 'middle' : (isNegative ? 'bottom' : 'top')),\n y: pick(options.y, inverted ? 4 : (isNegative ? 14 : -6)),\n x: pick(options.x, inverted ? (isNegative ? -6 : 6) : 0)\n };\n\n this.textAlign = options.textAlign || (inverted ? (isNegative ? 'right' : 'left') : 'center');\n }\n\n StackItem.prototype = {\n destroy: function () {\n destroyObjectProperties(this, this.axis);\n },\n\n /**\n * Renders the stack total label and adds it to the stack label group.\n */\n render: function (group) {\n var options = this.options,\n formatOption = options.format,\n str = formatOption ?\n format(formatOption, this) :\n options.formatter.call(this); // format the text in the label\n\n // Change the text to reflect the new total and set visibility to hidden in case the serie is hidden\n if (this.label) {\n this.label.attr({text: str, visibility: HIDDEN});\n // Create new label\n } else {\n this.label =\n this.axis.chart.renderer.text(str, null, null, options.useHTML)\t\t// dummy positions, actual position updated with setOffset method in columnseries\n .css(options.style)\t\t\t\t// apply style\n .attr({\n align: this.textAlign,\t\t\t\t// fix the text-anchor\n rotation: options.rotation,\t// rotation\n visibility: HIDDEN\t\t\t\t\t// hidden until setOffset is called\n })\n .add(group);\t\t\t\t\t\t\t// add to the labels-group\n }\n },\n\n /**\n * Sets the offset that the stack has from the x value and repositions the label.\n */\n setOffset: function (xOffset, xWidth) {\n var stackItem = this,\n axis = stackItem.axis,\n chart = axis.chart,\n inverted = chart.inverted,\n neg = this.isNegative,\t\t\t\t\t\t\t// special treatment is needed for negative stacks\n y = axis.translate(axis.usePercentage ? 100 : this.total, 0, 0, 0, 1), // stack value translated mapped to chart coordinates\n yZero = axis.translate(0),\t\t\t\t\t\t// stack origin\n h = mathAbs(y - yZero),\t\t\t\t\t\t\t// stack height\n x = chart.xAxis[0].translate(this.x) + xOffset,\t// stack x position\n plotHeight = chart.plotHeight,\n stackBox = {\t// this is the box for the complete stack\n x: inverted ? (neg ? y : y - h) : x,\n y: inverted ? plotHeight - x - xWidth : (neg ? (plotHeight - y - h) : plotHeight - y),\n width: inverted ? h : xWidth,\n height: inverted ? xWidth : h\n },\n label = this.label,\n alignAttr;\n\n if (label) {\n label.align(this.alignOptions, null, stackBox);\t// align the label to the box\n\n // Set visibility (#678)\n alignAttr = label.alignAttr;\n label[this.options.crop === false || chart.isInsidePlot(alignAttr.x, alignAttr.y) ? 'show' : 'hide'](true);\n }\n }\n };\n\n\n// Stacking methods defined on the Axis prototype\n\n /**\n * Build the stacks from top down\n */\n Axis.prototype.buildStacks = function () {\n var series = this.series,\n reversedStacks = pick(this.options.reversedStacks, true),\n i = series.length;\n if (!this.isXAxis) {\n this.usePercentage = false;\n while (i--) {\n series[reversedStacks ? i : series.length - i - 1].setStackedPoints();\n }\n // Loop up again to compute percent stack\n if (this.usePercentage) {\n for (i = 0; i < series.length; i++) {\n series[i].setPercentStacks();\n }\n }\n }\n };\n\n Axis.prototype.renderStackTotals = function () {\n var axis = this,\n chart = axis.chart,\n renderer = chart.renderer,\n stacks = axis.stacks,\n stackKey,\n oneStack,\n stackCategory,\n stackTotalGroup = axis.stackTotalGroup;\n\n // Create a separate group for the stack total labels\n if (!stackTotalGroup) {\n axis.stackTotalGroup = stackTotalGroup =\n renderer.g('stack-labels')\n .attr({\n visibility: VISIBLE,\n zIndex: 6\n })\n .add();\n }\n\n // plotLeft/Top will change when y axis gets wider so we need to translate the\n // stackTotalGroup at every render call. See bug #506 and #516\n stackTotalGroup.translate(chart.plotLeft, chart.plotTop);\n\n // Render each stack total\n for (stackKey in stacks) {\n oneStack = stacks[stackKey];\n for (stackCategory in oneStack) {\n oneStack[stackCategory].render(stackTotalGroup);\n }\n }\n };\n\n\n// Stacking methods defnied for Series prototype\n\n /**\n * Adds series' points value to corresponding stack\n */\n Series.prototype.setStackedPoints = function () {\n if (!this.options.stacking || (this.visible !== true && this.chart.options.chart.ignoreHiddenSeries !== false)) {\n return;\n }\n\n var series = this,\n xData = series.processedXData,\n yData = series.processedYData,\n stackedYData = [],\n yDataLength = yData.length,\n seriesOptions = series.options,\n threshold = seriesOptions.threshold,\n stackOption = seriesOptions.stack,\n stacking = seriesOptions.stacking,\n stackKey = series.stackKey,\n negKey = '-' + stackKey,\n negStacks = series.negStacks,\n yAxis = series.yAxis,\n stacks = yAxis.stacks,\n oldStacks = yAxis.oldStacks,\n isNegative,\n stack,\n other,\n key,\n pointKey,\n i,\n x,\n y;\n\n // loop over the non-null y values and read them into a local array\n for (i = 0; i < yDataLength; i++) {\n x = xData[i];\n y = yData[i];\n pointKey = series.index + ',' + i;\n\n // Read stacked values into a stack based on the x value,\n // the sign of y and the stack key. Stacking is also handled for null values (#739)\n isNegative = negStacks && y < threshold;\n key = isNegative ? negKey : stackKey;\n\n // Create empty object for this stack if it doesn't exist yet\n if (!stacks[key]) {\n stacks[key] = {};\n }\n\n // Initialize StackItem for this x\n if (!stacks[key][x]) {\n if (oldStacks[key] && oldStacks[key][x]) {\n stacks[key][x] = oldStacks[key][x];\n stacks[key][x].total = null;\n } else {\n stacks[key][x] = new StackItem(yAxis, yAxis.options.stackLabels, isNegative, x, stackOption);\n }\n }\n\n // If the StackItem doesn't exist, create it first\n stack = stacks[key][x];\n stack.points[pointKey] = [stack.cum || 0];\n\n // Add value to the stack total\n if (stacking === 'percent') {\n\n // Percent stacked column, totals are the same for the positive and negative stacks\n other = isNegative ? stackKey : negKey;\n if (negStacks && stacks[other] && stacks[other][x]) {\n other = stacks[other][x];\n stack.total = other.total = mathMax(other.total, stack.total) + mathAbs(y) || 0;\n\n // Percent stacked areas\n } else {\n stack.total = correctFloat(stack.total + (mathAbs(y) || 0));\n }\n } else {\n stack.total = correctFloat(stack.total + (y || 0));\n }\n\n stack.cum = (stack.cum || 0) + (y || 0);\n\n stack.points[pointKey].push(stack.cum);\n stackedYData[i] = stack.cum;\n\n }\n\n if (stacking === 'percent') {\n yAxis.usePercentage = true;\n }\n\n this.stackedYData = stackedYData; // To be used in getExtremes\n\n // Reset old stacks\n yAxis.oldStacks = {};\n };\n\n /**\n * Iterate over all stacks and compute the absolute values to percent\n */\n Series.prototype.setPercentStacks = function () {\n var series = this,\n stackKey = series.stackKey,\n stacks = series.yAxis.stacks,\n processedXData = series.processedXData;\n\n each([stackKey, '-' + stackKey], function (key) {\n var i = processedXData.length,\n x,\n stack,\n pointExtremes,\n totalFactor;\n\n while (i--) {\n x = processedXData[i];\n stack = stacks[key] && stacks[key][x];\n pointExtremes = stack && stack.points[series.index + ',' + i];\n if (pointExtremes) {\n totalFactor = stack.total ? 100 / stack.total : 0;\n pointExtremes[0] = correctFloat(pointExtremes[0] * totalFactor); // Y bottom value\n pointExtremes[1] = correctFloat(pointExtremes[1] * totalFactor); // Y value\n series.stackedYData[i] = pointExtremes[1];\n }\n }\n });\n };\n\n// Extend the Chart prototype for dynamic methods\n extend(Chart.prototype, {\n\n /**\n * Add a series dynamically after time\n *\n * @param {Object} options The config options\n * @param {Boolean} redraw Whether to redraw the chart after adding. Defaults to true.\n * @param {Boolean|Object} animation Whether to apply animation, and optionally animation\n * configuration\n *\n * @return {Object} series The newly created series object\n */\n addSeries: function (options, redraw, animation) {\n var series,\n chart = this;\n\n if (options) {\n redraw = pick(redraw, true); // defaults to true\n\n fireEvent(chart, 'addSeries', { options: options }, function () {\n series = chart.initSeries(options);\n\n chart.isDirtyLegend = true; // the series array is out of sync with the display\n chart.linkSeries();\n if (redraw) {\n chart.redraw(animation);\n }\n });\n }\n\n return series;\n },\n\n /**\n * Add an axis to the chart\n * @param {Object} options The axis option\n * @param {Boolean} isX Whether it is an X axis or a value axis\n */\n addAxis: function (options, isX, redraw, animation) {\n var key = isX ? 'xAxis' : 'yAxis',\n chartOptions = this.options,\n axis;\n\n /*jslint unused: false*/\n axis = new Axis(this, merge(options, {\n index: this[key].length,\n isX: isX\n }));\n /*jslint unused: true*/\n\n // Push the new axis options to the chart options\n chartOptions[key] = splat(chartOptions[key] || {});\n chartOptions[key].push(options);\n\n if (pick(redraw, true)) {\n this.redraw(animation);\n }\n },\n\n /**\n * Dim the chart and show a loading text or symbol\n * @param {String} str An optional text to show in the loading label instead of the default one\n */\n showLoading: function (str) {\n var chart = this,\n options = chart.options,\n loadingDiv = chart.loadingDiv,\n loadingOptions = options.loading,\n setLoadingSize = function () {\n if (loadingDiv) {\n css(loadingDiv, {\n left: chart.plotLeft + PX,\n top: chart.plotTop + PX,\n width: chart.plotWidth + PX,\n height: chart.plotHeight + PX\n });\n }\n };\n\n // create the layer at the first call\n if (!loadingDiv) {\n chart.loadingDiv = loadingDiv = createElement(DIV, {\n className: PREFIX + 'loading'\n }, extend(loadingOptions.style, {\n zIndex: 10,\n display: NONE\n }), chart.container);\n\n chart.loadingSpan = createElement(\n 'span',\n null,\n loadingOptions.labelStyle,\n loadingDiv\n );\n addEvent(chart, 'redraw', setLoadingSize); // #1080\n }\n\n // update text\n chart.loadingSpan.innerHTML = str || options.lang.loading;\n\n // show it\n if (!chart.loadingShown) {\n css(loadingDiv, {\n opacity: 0,\n display: ''\n });\n animate(loadingDiv, {\n opacity: loadingOptions.style.opacity\n }, {\n duration: loadingOptions.showDuration || 0\n });\n chart.loadingShown = true;\n }\n setLoadingSize();\n },\n\n /**\n * Hide the loading layer\n */\n hideLoading: function () {\n var options = this.options,\n loadingDiv = this.loadingDiv;\n\n if (loadingDiv) {\n animate(loadingDiv, {\n opacity: 0\n }, {\n duration: options.loading.hideDuration || 100,\n complete: function () {\n css(loadingDiv, { display: NONE });\n }\n });\n }\n this.loadingShown = false;\n }\n });\n\n// extend the Point prototype for dynamic methods\n extend(Point.prototype, {\n /**\n * Update the point with new options (typically x/y data) and optionally redraw the series.\n *\n * @param {Object} options Point options as defined in the series.data array\n * @param {Boolean} redraw Whether to redraw the chart or wait for an explicit call\n * @param {Boolean|Object} animation Whether to apply animation, and optionally animation\n * configuration\n *\n */\n update: function (options, redraw, animation, runEvent) {\n var point = this,\n series = point.series,\n graphic = point.graphic,\n i,\n chart = series.chart,\n seriesOptions = series.options;\n\n redraw = pick(redraw, true);\n\n function update() {\n\n point.applyOptions(options);\n\n // Update visuals\n if (isObject(options) && !isArray(options)) {\n // Defer the actual redraw until getAttribs has been called (#3260)\n point.redraw = function () {\n if (graphic) {\n if (options && options.marker && options.marker.symbol) {\n point.graphic = graphic.destroy();\n } else {\n graphic.attr(point.pointAttr[point.state || '']);\n }\n }\n if (options && options.dataLabels && point.dataLabel) { // #2468\n point.dataLabel = point.dataLabel.destroy();\n }\n point.redraw = null;\n };\n }\n\n // record changes in the parallel arrays\n i = point.index;\n series.updateParallelArrays(point, i);\n\n seriesOptions.data[i] = point.options;\n\n // redraw\n series.isDirty = series.isDirtyData = true;\n if (!series.fixedBox && series.hasCartesianSeries) { // #1906, #2320\n chart.isDirtyBox = true;\n }\n\n if (seriesOptions.legendType === 'point') { // #1831, #1885\n chart.legend.destroyItem(point);\n }\n if (redraw) {\n chart.redraw(animation);\n }\n }\n\n // Fire the event with a default handler of doing the update\n if (runEvent === false) { // When called from setData\n update();\n } else {\n point.firePointEvent('update', { options: options }, update);\n }\n },\n\n /**\n * Remove a point and optionally redraw the series and if necessary the axes\n * @param {Boolean} redraw Whether to redraw the chart or wait for an explicit call\n * @param {Boolean|Object} animation Whether to apply animation, and optionally animation\n * configuration\n */\n remove: function (redraw, animation) {\n var point = this,\n series = point.series,\n points = series.points,\n chart = series.chart,\n i,\n data = series.data;\n\n setAnimation(animation, chart);\n redraw = pick(redraw, true);\n\n // fire the event with a default handler of removing the point\n point.firePointEvent('remove', null, function () {\n\n // splice all the parallel arrays\n i = inArray(point, data);\n if (data.length === points.length) {\n points.splice(i, 1);\n }\n data.splice(i, 1);\n series.options.data.splice(i, 1);\n series.updateParallelArrays(point, 'splice', i, 1);\n\n point.destroy();\n\n // redraw\n series.isDirty = true;\n series.isDirtyData = true;\n if (redraw) {\n chart.redraw();\n }\n });\n }\n });\n\n// Extend the series prototype for dynamic methods\n extend(Series.prototype, {\n /**\n * Add a point dynamically after chart load time\n * @param {Object} options Point options as given in series.data\n * @param {Boolean} redraw Whether to redraw the chart or wait for an explicit call\n * @param {Boolean} shift If shift is true, a point is shifted off the start\n * of the series as one is appended to the end.\n * @param {Boolean|Object} animation Whether to apply animation, and optionally animation\n * configuration\n */\n addPoint: function (options, redraw, shift, animation) {\n var series = this,\n seriesOptions = series.options,\n data = series.data,\n graph = series.graph,\n area = series.area,\n chart = series.chart,\n names = series.xAxis && series.xAxis.names,\n currentShift = (graph && graph.shift) || 0,\n dataOptions = seriesOptions.data,\n point,\n isInTheMiddle,\n xData = series.xData,\n x,\n i;\n\n setAnimation(animation, chart);\n\n // Make graph animate sideways\n if (shift) {\n each([graph, area, series.graphNeg, series.areaNeg], function (shape) {\n if (shape) {\n shape.shift = currentShift + 1;\n }\n });\n }\n if (area) {\n area.isArea = true; // needed in animation, both with and without shift\n }\n\n // Optional redraw, defaults to true\n redraw = pick(redraw, true);\n\n // Get options and push the point to xData, yData and series.options. In series.generatePoints\n // the Point instance will be created on demand and pushed to the series.data array.\n point = { series: series };\n series.pointClass.prototype.applyOptions.apply(point, [options]);\n x = point.x;\n\n // Get the insertion point\n i = xData.length;\n if (series.requireSorting && x < xData[i - 1]) {\n isInTheMiddle = true;\n while (i && xData[i - 1] > x) {\n i--;\n }\n }\n\n series.updateParallelArrays(point, 'splice', i, 0, 0); // insert undefined item\n series.updateParallelArrays(point, i); // update it\n\n if (names && point.name) {\n names[x] = point.name;\n }\n dataOptions.splice(i, 0, options);\n\n if (isInTheMiddle) {\n series.data.splice(i, 0, null);\n series.processData();\n }\n\n // Generate points to be added to the legend (#1329)\n if (seriesOptions.legendType === 'point') {\n series.generatePoints();\n }\n\n // Shift the first point off the parallel arrays\n // todo: consider series.removePoint(i) method\n if (shift) {\n if (data[0] && data[0].remove) {\n data[0].remove(false);\n } else {\n data.shift();\n series.updateParallelArrays(point, 'shift');\n\n dataOptions.shift();\n }\n }\n\n // redraw\n series.isDirty = true;\n series.isDirtyData = true;\n if (redraw) {\n series.getAttribs(); // #1937\n chart.redraw();\n }\n },\n\n /**\n * Remove a series and optionally redraw the chart\n *\n * @param {Boolean} redraw Whether to redraw the chart or wait for an explicit call\n * @param {Boolean|Object} animation Whether to apply animation, and optionally animation\n * configuration\n */\n\n remove: function (redraw, animation) {\n var series = this,\n chart = series.chart;\n redraw = pick(redraw, true);\n\n if (!series.isRemoving) { /* prevent triggering native event in jQuery\n (calling the remove function from the remove event) */\n series.isRemoving = true;\n\n // fire the event with a default handler of removing the point\n fireEvent(series, 'remove', null, function () {\n\n\n // destroy elements\n series.destroy();\n\n\n // redraw\n chart.isDirtyLegend = chart.isDirtyBox = true;\n chart.linkSeries();\n\n if (redraw) {\n chart.redraw(animation);\n }\n });\n\n }\n series.isRemoving = false;\n },\n\n /**\n * Update the series with a new set of options\n */\n update: function (newOptions, redraw) {\n var series = this,\n chart = this.chart,\n // must use user options when changing type because this.options is merged\n // in with type specific plotOptions\n oldOptions = this.userOptions,\n oldType = this.type,\n proto = seriesTypes[oldType].prototype,\n preserve = ['group', 'markerGroup', 'dataLabelsGroup'],\n n;\n\n // Make sure groups are not destroyed (#3094)\n each(preserve, function (prop) {\n preserve[prop] = series[prop];\n delete series[prop];\n });\n\n // Do the merge, with some forced options\n newOptions = merge(oldOptions, {\n animation: false,\n index: this.index,\n pointStart: this.xData[0] // when updating after addPoint\n }, { data: this.options.data }, newOptions);\n\n // Destroy the series and reinsert methods from the type prototype\n this.remove(false);\n for (n in proto) { // Overwrite series-type specific methods (#2270)\n if (proto.hasOwnProperty(n)) {\n this[n] = UNDEFINED;\n }\n }\n extend(this, seriesTypes[newOptions.type || oldType].prototype);\n\n // Re-register groups (#3094)\n each(preserve, function (prop) {\n series[prop] = preserve[prop];\n });\n\n\n this.init(chart, newOptions);\n chart.linkSeries(); // Links are lost in this.remove (#3028)\n if (pick(redraw, true)) {\n chart.redraw(false);\n }\n }\n });\n\n// Extend the Axis.prototype for dynamic methods\n extend(Axis.prototype, {\n\n /**\n * Update the axis with a new options structure\n */\n update: function (newOptions, redraw) {\n var chart = this.chart;\n\n newOptions = chart.options[this.coll][this.options.index] = merge(this.userOptions, newOptions);\n\n this.destroy(true);\n this._addedPlotLB = UNDEFINED; // #1611, #2887\n\n this.init(chart, extend(newOptions, { events: UNDEFINED }));\n\n chart.isDirtyBox = true;\n if (pick(redraw, true)) {\n chart.redraw();\n }\n },\n\n /**\n * Remove the axis from the chart\n */\n remove: function (redraw) {\n var chart = this.chart,\n key = this.coll, // xAxis or yAxis\n axisSeries = this.series,\n i = axisSeries.length;\n\n // Remove associated series (#2687)\n while (i--) {\n if (axisSeries[i]) {\n axisSeries[i].remove(false);\n }\n }\n\n // Remove the axis\n erase(chart.axes, this);\n erase(chart[key], this);\n chart.options[key].splice(this.options.index, 1);\n each(chart[key], function (axis, i) { // Re-index, #1706\n axis.options.index = i;\n });\n this.destroy();\n chart.isDirtyBox = true;\n\n if (pick(redraw, true)) {\n chart.redraw();\n }\n },\n\n /**\n * Update the axis title by options\n */\n setTitle: function (newTitleOptions, redraw) {\n this.update({ title: newTitleOptions }, redraw);\n },\n\n /**\n * Set new axis categories and optionally redraw\n * @param {Array} categories\n * @param {Boolean} redraw\n */\n setCategories: function (categories, redraw) {\n this.update({ categories: categories }, redraw);\n }\n\n });\n\n\n /**\n * LineSeries object\n */\n var LineSeries = extendClass(Series);\n seriesTypes.line = LineSeries;\n\n /**\n * Set the default options for area\n */\n defaultPlotOptions.area = merge(defaultSeriesOptions, {\n threshold: 0\n // trackByArea: false,\n // lineColor: null, // overrides color, but lets fillColor be unaltered\n // fillOpacity: 0.75,\n // fillColor: null\n });\n\n /**\n * AreaSeries object\n */\n var AreaSeries = extendClass(Series, {\n type: 'area',\n /**\n * For stacks, don't split segments on null values. Instead, draw null values with\n * no marker. Also insert dummy points for any X position that exists in other series\n * in the stack.\n */\n getSegments: function () {\n var series = this,\n segments = [],\n segment = [],\n keys = [],\n xAxis = this.xAxis,\n yAxis = this.yAxis,\n stack = yAxis.stacks[this.stackKey],\n pointMap = {},\n plotX,\n plotY,\n points = this.points,\n connectNulls = this.options.connectNulls,\n i,\n x;\n\n if (this.options.stacking && !this.cropped) { // cropped causes artefacts in Stock, and perf issue\n // Create a map where we can quickly look up the points by their X value.\n for (i = 0; i < points.length; i++) {\n pointMap[points[i].x] = points[i];\n }\n\n // Sort the keys (#1651)\n for (x in stack) {\n if (stack[x].total !== null) { // nulled after switching between grouping and not (#1651, #2336)\n keys.push(+x);\n }\n }\n keys.sort(function (a, b) {\n return a - b;\n });\n\n each(keys, function (x) {\n var y = 0,\n stackPoint;\n\n if (connectNulls && (!pointMap[x] || pointMap[x].y === null)) { // #1836\n return;\n\n // The point exists, push it to the segment\n } else if (pointMap[x]) {\n segment.push(pointMap[x]);\n\n // There is no point for this X value in this series, so we\n // insert a dummy point in order for the areas to be drawn\n // correctly.\n } else {\n\n // Loop down the stack to find the series below this one that has\n // a value (#1991)\n for (i = series.index; i <= yAxis.series.length; i++) {\n stackPoint = stack[x].points[i + ',' + x];\n if (stackPoint) {\n y = stackPoint[1];\n break;\n }\n }\n\n plotX = xAxis.translate(x);\n plotY = yAxis.toPixels(y, true);\n segment.push({\n y: null,\n plotX: plotX,\n clientX: plotX,\n plotY: plotY,\n yBottom: plotY,\n onMouseOver: noop\n });\n }\n });\n\n if (segment.length) {\n segments.push(segment);\n }\n\n } else {\n Series.prototype.getSegments.call(this);\n segments = this.segments;\n }\n\n this.segments = segments;\n },\n\n /**\n * Extend the base Series getSegmentPath method by adding the path for the area.\n * This path is pushed to the series.areaPath property.\n */\n getSegmentPath: function (segment) {\n\n var segmentPath = Series.prototype.getSegmentPath.call(this, segment), // call base method\n areaSegmentPath = [].concat(segmentPath), // work on a copy for the area path\n i,\n options = this.options,\n segLength = segmentPath.length,\n translatedThreshold = this.yAxis.getThreshold(options.threshold), // #2181\n yBottom;\n\n if (segLength === 3) { // for animation from 1 to two points\n areaSegmentPath.push(L, segmentPath[1], segmentPath[2]);\n }\n if (options.stacking && !this.closedStacks) {\n\n // Follow stack back. Todo: implement areaspline. A general solution could be to\n // reverse the entire graphPath of the previous series, though may be hard with\n // splines and with series with different extremes\n for (i = segment.length - 1; i >= 0; i--) {\n\n yBottom = pick(segment[i].yBottom, translatedThreshold);\n\n // step line?\n if (i < segment.length - 1 && options.step) {\n areaSegmentPath.push(segment[i + 1].plotX, yBottom);\n }\n\n areaSegmentPath.push(segment[i].plotX, yBottom);\n }\n\n } else { // follow zero line back\n this.closeSegment(areaSegmentPath, segment, translatedThreshold);\n }\n this.areaPath = this.areaPath.concat(areaSegmentPath);\n return segmentPath;\n },\n\n /**\n * Extendable method to close the segment path of an area. This is overridden in polar\n * charts.\n */\n closeSegment: function (path, segment, translatedThreshold) {\n path.push(\n L,\n segment[segment.length - 1].plotX,\n translatedThreshold,\n L,\n segment[0].plotX,\n translatedThreshold\n );\n },\n\n /**\n * Draw the graph and the underlying area. This method calls the Series base\n * function and adds the area. The areaPath is calculated in the getSegmentPath\n * method called from Series.prototype.drawGraph.\n */\n drawGraph: function () {\n\n // Define or reset areaPath\n this.areaPath = [];\n\n // Call the base method\n Series.prototype.drawGraph.apply(this);\n\n // Define local variables\n var series = this,\n areaPath = this.areaPath,\n options = this.options,\n negativeColor = options.negativeColor,\n negativeFillColor = options.negativeFillColor,\n props = [['area', this.color, options.fillColor]]; // area name, main color, fill color\n\n if (negativeColor || negativeFillColor) {\n props.push(['areaNeg', negativeColor, negativeFillColor]);\n }\n\n each(props, function (prop) {\n var areaKey = prop[0],\n area = series[areaKey];\n\n // Create or update the area\n if (area) { // update\n area.animate({ d: areaPath });\n\n } else { // create\n series[areaKey] = series.chart.renderer.path(areaPath)\n .attr({\n fill: pick(\n prop[2],\n Color(prop[1]).setOpacity(pick(options.fillOpacity, 0.75)).get()\n ),\n zIndex: 0 // #1069\n }).add(series.group);\n }\n });\n },\n\n drawLegendSymbol: LegendSymbolMixin.drawRectangle\n });\n\n seriesTypes.area = AreaSeries;\n /**\n * Set the default options for spline\n */\n defaultPlotOptions.spline = merge(defaultSeriesOptions);\n\n /**\n * SplineSeries object\n */\n var SplineSeries = extendClass(Series, {\n type: 'spline',\n\n /**\n * Get the spline segment from a given point's previous neighbour to the given point\n */\n getPointSpline: function (segment, point, i) {\n var smoothing = 1.5, // 1 means control points midway between points, 2 means 1/3 from the point, 3 is 1/4 etc\n denom = smoothing + 1,\n plotX = point.plotX,\n plotY = point.plotY,\n lastPoint = segment[i - 1],\n nextPoint = segment[i + 1],\n leftContX,\n leftContY,\n rightContX,\n rightContY,\n ret;\n\n // find control points\n if (lastPoint && nextPoint) {\n\n var lastX = lastPoint.plotX,\n lastY = lastPoint.plotY,\n nextX = nextPoint.plotX,\n nextY = nextPoint.plotY,\n correction;\n\n leftContX = (smoothing * plotX + lastX) / denom;\n leftContY = (smoothing * plotY + lastY) / denom;\n rightContX = (smoothing * plotX + nextX) / denom;\n rightContY = (smoothing * plotY + nextY) / denom;\n\n // have the two control points make a straight line through main point\n correction = ((rightContY - leftContY) * (rightContX - plotX)) /\n (rightContX - leftContX) + plotY - rightContY;\n\n leftContY += correction;\n rightContY += correction;\n\n // to prevent false extremes, check that control points are between\n // neighbouring points' y values\n if (leftContY > lastY && leftContY > plotY) {\n leftContY = mathMax(lastY, plotY);\n rightContY = 2 * plotY - leftContY; // mirror of left control point\n } else if (leftContY < lastY && leftContY < plotY) {\n leftContY = mathMin(lastY, plotY);\n rightContY = 2 * plotY - leftContY;\n }\n if (rightContY > nextY && rightContY > plotY) {\n rightContY = mathMax(nextY, plotY);\n leftContY = 2 * plotY - rightContY;\n } else if (rightContY < nextY && rightContY < plotY) {\n rightContY = mathMin(nextY, plotY);\n leftContY = 2 * plotY - rightContY;\n }\n\n // record for drawing in next point\n point.rightContX = rightContX;\n point.rightContY = rightContY;\n\n }\n\n // Visualize control points for debugging\n /*\n if (leftContX) {\n this.chart.renderer.circle(leftContX + this.chart.plotLeft, leftContY + this.chart.plotTop, 2)\n .attr({\n stroke: 'red',\n 'stroke-width': 1,\n fill: 'none'\n })\n .add();\n this.chart.renderer.path(['M', leftContX + this.chart.plotLeft, leftContY + this.chart.plotTop,\n 'L', plotX + this.chart.plotLeft, plotY + this.chart.plotTop])\n .attr({\n stroke: 'red',\n 'stroke-width': 1\n })\n .add();\n this.chart.renderer.circle(rightContX + this.chart.plotLeft, rightContY + this.chart.plotTop, 2)\n .attr({\n stroke: 'green',\n 'stroke-width': 1,\n fill: 'none'\n })\n .add();\n this.chart.renderer.path(['M', rightContX + this.chart.plotLeft, rightContY + this.chart.plotTop,\n 'L', plotX + this.chart.plotLeft, plotY + this.chart.plotTop])\n .attr({\n stroke: 'green',\n 'stroke-width': 1\n })\n .add();\n }\n */\n\n // moveTo or lineTo\n if (!i) {\n ret = [M, plotX, plotY];\n } else { // curve from last point to this\n ret = [\n 'C',\n lastPoint.rightContX || lastPoint.plotX,\n lastPoint.rightContY || lastPoint.plotY,\n leftContX || plotX,\n leftContY || plotY,\n plotX,\n plotY\n ];\n lastPoint.rightContX = lastPoint.rightContY = null; // reset for updating series later\n }\n return ret;\n }\n });\n seriesTypes.spline = SplineSeries;\n\n /**\n * Set the default options for areaspline\n */\n defaultPlotOptions.areaspline = merge(defaultPlotOptions.area);\n\n /**\n * AreaSplineSeries object\n */\n var areaProto = AreaSeries.prototype,\n AreaSplineSeries = extendClass(SplineSeries, {\n type: 'areaspline',\n closedStacks: true, // instead of following the previous graph back, follow the threshold back\n\n // Mix in methods from the area series\n getSegmentPath: areaProto.getSegmentPath,\n closeSegment: areaProto.closeSegment,\n drawGraph: areaProto.drawGraph,\n drawLegendSymbol: LegendSymbolMixin.drawRectangle\n });\n\n seriesTypes.areaspline = AreaSplineSeries;\n\n /**\n * Set the default options for column\n */\n defaultPlotOptions.column = merge(defaultSeriesOptions, {\n borderColor: '#FFFFFF',\n //borderWidth: 1,\n borderRadius: 0,\n //colorByPoint: undefined,\n groupPadding: 0.2,\n //grouping: true,\n marker: null, // point options are specified in the base options\n pointPadding: 0.1,\n //pointWidth: null,\n minPointLength: 0,\n cropThreshold: 50, // when there are more points, they will not animate out of the chart on xAxis.setExtremes\n pointRange: null, // null means auto, meaning 1 in a categorized axis and least distance between points if not categories\n states: {\n hover: {\n brightness: 0.1,\n shadow: false,\n halo: false\n },\n select: {\n color: '#C0C0C0',\n borderColor: '#000000',\n shadow: false\n }\n },\n dataLabels: {\n align: null, // auto\n verticalAlign: null, // auto\n y: null\n },\n stickyTracking: false,\n tooltip: {\n distance: 6\n },\n threshold: 0\n });\n\n /**\n * ColumnSeries object\n */\n var ColumnSeries = extendClass(Series, {\n type: 'column',\n pointAttrToOptions: { // mapping between SVG attributes and the corresponding options\n stroke: 'borderColor',\n fill: 'color',\n r: 'borderRadius'\n },\n cropShoulder: 0,\n trackerGroups: ['group', 'dataLabelsGroup'],\n negStacks: true, // use separate negative stacks, unlike area stacks where a negative\n // point is substracted from previous (#1910)\n\n /**\n * Initialize the series\n */\n init: function () {\n Series.prototype.init.apply(this, arguments);\n\n var series = this,\n chart = series.chart;\n\n // if the series is added dynamically, force redraw of other\n // series affected by a new column\n if (chart.hasRendered) {\n each(chart.series, function (otherSeries) {\n if (otherSeries.type === series.type) {\n otherSeries.isDirty = true;\n }\n });\n }\n },\n\n /**\n * Return the width and x offset of the columns adjusted for grouping, groupPadding, pointPadding,\n * pointWidth etc.\n */\n getColumnMetrics: function () {\n\n var series = this,\n options = series.options,\n xAxis = series.xAxis,\n yAxis = series.yAxis,\n reversedXAxis = xAxis.reversed,\n stackKey,\n stackGroups = {},\n columnIndex,\n columnCount = 0;\n\n // Get the total number of column type series.\n // This is called on every series. Consider moving this logic to a\n // chart.orderStacks() function and call it on init, addSeries and removeSeries\n if (options.grouping === false) {\n columnCount = 1;\n } else {\n each(series.chart.series, function (otherSeries) {\n var otherOptions = otherSeries.options,\n otherYAxis = otherSeries.yAxis;\n if (otherSeries.type === series.type && otherSeries.visible &&\n yAxis.len === otherYAxis.len && yAxis.pos === otherYAxis.pos) { // #642, #2086\n if (otherOptions.stacking) {\n stackKey = otherSeries.stackKey;\n if (stackGroups[stackKey] === UNDEFINED) {\n stackGroups[stackKey] = columnCount++;\n }\n columnIndex = stackGroups[stackKey];\n } else if (otherOptions.grouping !== false) { // #1162\n columnIndex = columnCount++;\n }\n otherSeries.columnIndex = columnIndex;\n }\n });\n }\n\n var categoryWidth = mathMin(\n mathAbs(xAxis.transA) * (xAxis.ordinalSlope || options.pointRange || xAxis.closestPointRange || xAxis.tickInterval || 1), // #2610\n xAxis.len // #1535\n ),\n groupPadding = categoryWidth * options.groupPadding,\n groupWidth = categoryWidth - 2 * groupPadding,\n pointOffsetWidth = groupWidth / columnCount,\n optionPointWidth = options.pointWidth,\n pointPadding = defined(optionPointWidth) ? (pointOffsetWidth - optionPointWidth) / 2 :\n pointOffsetWidth * options.pointPadding,\n pointWidth = pick(optionPointWidth, pointOffsetWidth - 2 * pointPadding), // exact point width, used in polar charts\n colIndex = (reversedXAxis ?\n columnCount - (series.columnIndex || 0) : // #1251\n series.columnIndex) || 0,\n pointXOffset = pointPadding + (groupPadding + colIndex *\n pointOffsetWidth - (categoryWidth / 2)) *\n (reversedXAxis ? -1 : 1);\n\n // Save it for reading in linked series (Error bars particularly)\n return (series.columnMetrics = {\n width: pointWidth,\n offset: pointXOffset\n });\n\n },\n\n /**\n * Translate each point to the plot area coordinate system and find shape positions\n */\n translate: function () {\n var series = this,\n chart = series.chart,\n options = series.options,\n borderWidth = series.borderWidth = pick(\n options.borderWidth,\n series.activePointCount > 0.5 * series.xAxis.len ? 0 : 1\n ),\n yAxis = series.yAxis,\n threshold = options.threshold,\n translatedThreshold = series.translatedThreshold = yAxis.getThreshold(threshold),\n minPointLength = pick(options.minPointLength, 5),\n metrics = series.getColumnMetrics(),\n pointWidth = metrics.width,\n seriesBarW = series.barW = mathMax(pointWidth, 1 + 2 * borderWidth), // postprocessed for border width\n pointXOffset = series.pointXOffset = metrics.offset,\n xCrisp = -(borderWidth % 2 ? 0.5 : 0),\n yCrisp = borderWidth % 2 ? 0.5 : 1;\n\n if (chart.renderer.isVML && chart.inverted) {\n yCrisp += 1;\n }\n\n // When the pointPadding is 0, we want the columns to be packed tightly, so we allow individual\n // columns to have individual sizes. When pointPadding is greater, we strive for equal-width\n // columns (#2694).\n if (options.pointPadding) {\n seriesBarW = mathCeil(seriesBarW);\n }\n\n Series.prototype.translate.apply(series);\n\n // Record the new values\n each(series.points, function (point) {\n var yBottom = pick(point.yBottom, translatedThreshold),\n plotY = mathMin(mathMax(-999 - yBottom, point.plotY), yAxis.len + 999 + yBottom), // Don't draw too far outside plot area (#1303, #2241)\n barX = point.plotX + pointXOffset,\n barW = seriesBarW,\n barY = mathMin(plotY, yBottom),\n right,\n bottom,\n fromTop,\n barH = mathMax(plotY, yBottom) - barY;\n\n // Handle options.minPointLength\n if (mathAbs(barH) < minPointLength) {\n if (minPointLength) {\n barH = minPointLength;\n barY =\n mathRound(mathAbs(barY - translatedThreshold) > minPointLength ? // stacked\n yBottom - minPointLength : // keep position\n translatedThreshold - (yAxis.translate(point.y, 0, 1, 0, 1) <= translatedThreshold ? minPointLength : 0)); // use exact yAxis.translation (#1485)\n }\n }\n\n // Cache for access in polar\n point.barX = barX;\n point.pointWidth = pointWidth;\n\n // Fix the tooltip on center of grouped columns (#1216, #424)\n point.tooltipPos = chart.inverted ?\n [yAxis.len - plotY, series.xAxis.len - barX - barW / 2] :\n [barX + barW / 2, plotY + yAxis.pos - chart.plotTop];\n\n // Round off to obtain crisp edges and avoid overlapping with neighbours (#2694)\n right = mathRound(barX + barW) + xCrisp;\n barX = mathRound(barX) + xCrisp;\n barW = right - barX;\n\n fromTop = mathAbs(barY) < 0.5;\n bottom = mathRound(barY + barH) + yCrisp;\n barY = mathRound(barY) + yCrisp;\n barH = bottom - barY;\n\n // Top edges are exceptions\n if (fromTop) {\n barY -= 1;\n barH += 1;\n }\n\n // Register shape type and arguments to be used in drawPoints\n point.shapeType = 'rect';\n point.shapeArgs = {\n x: barX,\n y: barY,\n width: barW,\n height: barH\n };\n\n });\n\n },\n\n getSymbol: noop,\n\n /**\n * Use a solid rectangle like the area series types\n */\n drawLegendSymbol: LegendSymbolMixin.drawRectangle,\n\n\n /**\n * Columns have no graph\n */\n drawGraph: noop,\n\n /**\n * Draw the columns. For bars, the series.group is rotated, so the same coordinates\n * apply for columns and bars. This method is inherited by scatter series.\n *\n */\n drawPoints: function () {\n var series = this,\n chart = this.chart,\n options = series.options,\n renderer = chart.renderer,\n animationLimit = options.animationLimit || 250,\n shapeArgs,\n pointAttr;\n\n // draw the columns\n each(series.points, function (point) {\n var plotY = point.plotY,\n graphic = point.graphic,\n borderAttr;\n\n if (plotY !== UNDEFINED && !isNaN(plotY) && point.y !== null) {\n shapeArgs = point.shapeArgs;\n\n borderAttr = defined(series.borderWidth) ? {\n 'stroke-width': series.borderWidth\n } : {};\n\n pointAttr = point.pointAttr[point.selected ? SELECT_STATE : NORMAL_STATE] || series.pointAttr[NORMAL_STATE];\n\n if (graphic) { // update\n stop(graphic);\n graphic.attr(borderAttr)[chart.pointCount < animationLimit ? 'animate' : 'attr'](merge(shapeArgs));\n\n } else {\n point.graphic = graphic = renderer[point.shapeType](shapeArgs)\n .attr(pointAttr)\n .attr(borderAttr)\n .add(series.group)\n .shadow(options.shadow, null, options.stacking && !options.borderRadius);\n }\n\n } else if (graphic) {\n point.graphic = graphic.destroy(); // #1269\n }\n });\n },\n\n /**\n * Animate the column heights one by one from zero\n * @param {Boolean} init Whether to initialize the animation or run it\n */\n animate: function (init) {\n var series = this,\n yAxis = this.yAxis,\n options = series.options,\n inverted = this.chart.inverted,\n attr = {},\n translatedThreshold;\n\n if (hasSVG) { // VML is too slow anyway\n if (init) {\n attr.scaleY = 0.001;\n translatedThreshold = mathMin(yAxis.pos + yAxis.len, mathMax(yAxis.pos, yAxis.toPixels(options.threshold)));\n if (inverted) {\n attr.translateX = translatedThreshold - yAxis.len;\n } else {\n attr.translateY = translatedThreshold;\n }\n series.group.attr(attr);\n\n } else { // run the animation\n\n attr.scaleY = 1;\n attr[inverted ? 'translateX' : 'translateY'] = yAxis.pos;\n series.group.animate(attr, series.options.animation);\n\n // delete this function to allow it only once\n series.animate = null;\n }\n }\n },\n\n /**\n * Remove this series from the chart\n */\n remove: function () {\n var series = this,\n chart = series.chart;\n\n // column and bar series affects other series of the same type\n // as they are either stacked or grouped\n if (chart.hasRendered) {\n each(chart.series, function (otherSeries) {\n if (otherSeries.type === series.type) {\n otherSeries.isDirty = true;\n }\n });\n }\n\n Series.prototype.remove.apply(series, arguments);\n }\n });\n seriesTypes.column = ColumnSeries;\n /**\n * Set the default options for bar\n */\n defaultPlotOptions.bar = merge(defaultPlotOptions.column);\n /**\n * The Bar series class\n */\n var BarSeries = extendClass(ColumnSeries, {\n type: 'bar',\n inverted: true\n });\n seriesTypes.bar = BarSeries;\n\n /**\n * Set the default options for scatter\n */\n defaultPlotOptions.scatter = merge(defaultSeriesOptions, {\n lineWidth: 0,\n tooltip: {\n headerFormat: '<span style=\"color:{series.color}\">\\u25CF</span> <span style=\"font-size: 10px;\"> {series.name}</span><br/>',\n pointFormat: 'x: <b>{point.x}</b><br/>y: <b>{point.y}</b><br/>'\n },\n stickyTracking: false\n });\n\n /**\n * The scatter series class\n */\n var ScatterSeries = extendClass(Series, {\n type: 'scatter',\n sorted: false,\n requireSorting: false,\n noSharedTooltip: true,\n trackerGroups: ['markerGroup', 'dataLabelsGroup'],\n takeOrdinalPosition: false, // #2342\n singularTooltips: true,\n drawGraph: function () {\n if (this.options.lineWidth) {\n Series.prototype.drawGraph.call(this);\n }\n }\n });\n\n seriesTypes.scatter = ScatterSeries;\n\n /**\n * Set the default options for pie\n */\n defaultPlotOptions.pie = merge(defaultSeriesOptions, {\n borderColor: '#FFFFFF',\n borderWidth: 1,\n center: [null, null],\n clip: false,\n colorByPoint: true, // always true for pies\n dataLabels: {\n // align: null,\n // connectorWidth: 1,\n // connectorColor: point.color,\n // connectorPadding: 5,\n distance: 30,\n enabled: true,\n formatter: function () { // #2945\n return this.point.name;\n }\n // softConnector: true,\n //y: 0\n },\n ignoreHiddenPoint: true,\n //innerSize: 0,\n legendType: 'point',\n marker: null, // point options are specified in the base options\n size: null,\n showInLegend: false,\n slicedOffset: 10,\n states: {\n hover: {\n brightness: 0.1,\n shadow: false\n }\n },\n stickyTracking: false,\n tooltip: {\n followPointer: true\n }\n });\n\n /**\n * Extended point object for pies\n */\n var PiePoint = extendClass(Point, {\n /**\n * Initiate the pie slice\n */\n init: function () {\n\n Point.prototype.init.apply(this, arguments);\n\n var point = this,\n toggleSlice;\n\n // Disallow negative values (#1530)\n if (point.y < 0) {\n point.y = null;\n }\n\n //visible: options.visible !== false,\n extend(point, {\n visible: point.visible !== false,\n name: pick(point.name, 'Slice')\n });\n\n // add event listener for select\n toggleSlice = function (e) {\n point.slice(e.type === 'select');\n };\n addEvent(point, 'select', toggleSlice);\n addEvent(point, 'unselect', toggleSlice);\n\n return point;\n },\n\n /**\n * Toggle the visibility of the pie slice\n * @param {Boolean} vis Whether to show the slice or not. If undefined, the\n * visibility is toggled\n */\n setVisible: function (vis) {\n var point = this,\n series = point.series,\n chart = series.chart;\n\n // if called without an argument, toggle visibility\n point.visible = point.options.visible = vis = vis === UNDEFINED ? !point.visible : vis;\n series.options.data[inArray(point, series.data)] = point.options; // update userOptions.data\n\n // Show and hide associated elements\n each(['graphic', 'dataLabel', 'connector', 'shadowGroup'], function (key) {\n if (point[key]) {\n point[key][vis ? 'show' : 'hide'](true);\n }\n });\n\n if (point.legendItem) {\n chart.legend.colorizeItem(point, vis);\n }\n\n // Handle ignore hidden slices\n if (!series.isDirty && series.options.ignoreHiddenPoint) {\n series.isDirty = true;\n chart.redraw();\n }\n },\n\n /**\n * Set or toggle whether the slice is cut out from the pie\n * @param {Boolean} sliced When undefined, the slice state is toggled\n * @param {Boolean} redraw Whether to redraw the chart. True by default.\n */\n slice: function (sliced, redraw, animation) {\n var point = this,\n series = point.series,\n chart = series.chart,\n translation;\n\n setAnimation(animation, chart);\n\n // redraw is true by default\n redraw = pick(redraw, true);\n\n // if called without an argument, toggle\n point.sliced = point.options.sliced = sliced = defined(sliced) ? sliced : !point.sliced;\n series.options.data[inArray(point, series.data)] = point.options; // update userOptions.data\n\n translation = sliced ? point.slicedTranslation : {\n translateX: 0,\n translateY: 0\n };\n\n point.graphic.animate(translation);\n\n if (point.shadowGroup) {\n point.shadowGroup.animate(translation);\n }\n\n },\n\n haloPath: function (size) {\n var shapeArgs = this.shapeArgs,\n chart = this.series.chart;\n\n return this.sliced || !this.visible ? [] : this.series.chart.renderer.symbols.arc(chart.plotLeft + shapeArgs.x, chart.plotTop + shapeArgs.y, shapeArgs.r + size, shapeArgs.r + size, {\n innerR: this.shapeArgs.r,\n start: shapeArgs.start,\n end: shapeArgs.end\n });\n }\n });\n\n /**\n * The Pie series class\n */\n var PieSeries = {\n type: 'pie',\n isCartesian: false,\n pointClass: PiePoint,\n requireSorting: false,\n noSharedTooltip: true,\n trackerGroups: ['group', 'dataLabelsGroup'],\n axisTypes: [],\n pointAttrToOptions: { // mapping between SVG attributes and the corresponding options\n stroke: 'borderColor',\n 'stroke-width': 'borderWidth',\n fill: 'color'\n },\n singularTooltips: true,\n\n /**\n * Pies have one color each point\n */\n getColor: noop,\n\n /**\n * Animate the pies in\n */\n animate: function (init) {\n var series = this,\n points = series.points,\n startAngleRad = series.startAngleRad;\n\n if (!init) {\n each(points, function (point) {\n var graphic = point.graphic,\n args = point.shapeArgs;\n\n if (graphic) {\n // start values\n graphic.attr({\n r: series.center[3] / 2, // animate from inner radius (#779)\n start: startAngleRad,\n end: startAngleRad\n });\n\n // animate\n graphic.animate({\n r: args.r,\n start: args.start,\n end: args.end\n }, series.options.animation);\n }\n });\n\n // delete this function to allow it only once\n series.animate = null;\n }\n },\n\n /**\n * Extend the basic setData method by running processData and generatePoints immediately,\n * in order to access the points from the legend.\n */\n setData: function (data, redraw, animation, updatePoints) {\n Series.prototype.setData.call(this, data, false, animation, updatePoints);\n this.processData();\n this.generatePoints();\n if (pick(redraw, true)) {\n this.chart.redraw(animation);\n }\n },\n\n /**\n * Extend the generatePoints method by adding total and percentage properties to each point\n */\n generatePoints: function () {\n var i,\n total = 0,\n points,\n len,\n point,\n ignoreHiddenPoint = this.options.ignoreHiddenPoint;\n\n Series.prototype.generatePoints.call(this);\n\n // Populate local vars\n points = this.points;\n len = points.length;\n\n // Get the total sum\n for (i = 0; i < len; i++) {\n point = points[i];\n total += (ignoreHiddenPoint && !point.visible) ? 0 : point.y;\n }\n this.total = total;\n\n // Set each point's properties\n for (i = 0; i < len; i++) {\n point = points[i];\n point.percentage = total > 0 ? (point.y / total) * 100 : 0;\n point.total = total;\n }\n\n },\n\n /**\n * Do translation for pie slices\n */\n translate: function (positions) {\n this.generatePoints();\n\n var series = this,\n cumulative = 0,\n precision = 1000, // issue #172\n options = series.options,\n slicedOffset = options.slicedOffset,\n connectorOffset = slicedOffset + options.borderWidth,\n start,\n end,\n angle,\n startAngle = options.startAngle || 0,\n startAngleRad = series.startAngleRad = mathPI / 180 * (startAngle - 90),\n endAngleRad = series.endAngleRad = mathPI / 180 * ((pick(options.endAngle, startAngle + 360)) - 90),\n circ = endAngleRad - startAngleRad, //2 * mathPI,\n points = series.points,\n radiusX, // the x component of the radius vector for a given point\n radiusY,\n labelDistance = options.dataLabels.distance,\n ignoreHiddenPoint = options.ignoreHiddenPoint,\n i,\n len = points.length,\n point;\n\n // Get positions - either an integer or a percentage string must be given.\n // If positions are passed as a parameter, we're in a recursive loop for adjusting\n // space for data labels.\n if (!positions) {\n series.center = positions = series.getCenter();\n }\n\n // utility for getting the x value from a given y, used for anticollision logic in data labels\n series.getX = function (y, left) {\n\n angle = math.asin(mathMin((y - positions[1]) / (positions[2] / 2 + labelDistance), 1));\n\n return positions[0] +\n (left ? -1 : 1) *\n (mathCos(angle) * (positions[2] / 2 + labelDistance));\n };\n\n // Calculate the geometry for each point\n for (i = 0; i < len; i++) {\n\n point = points[i];\n\n // set start and end angle\n start = startAngleRad + (cumulative * circ);\n if (!ignoreHiddenPoint || point.visible) {\n cumulative += point.percentage / 100;\n }\n end = startAngleRad + (cumulative * circ);\n\n // set the shape\n point.shapeType = 'arc';\n point.shapeArgs = {\n x: positions[0],\n y: positions[1],\n r: positions[2] / 2,\n innerR: positions[3] / 2,\n start: mathRound(start * precision) / precision,\n end: mathRound(end * precision) / precision\n };\n\n // The angle must stay within -90 and 270 (#2645)\n angle = (end + start) / 2;\n if (angle > 1.5 * mathPI) {\n angle -= 2 * mathPI;\n } else if (angle < -mathPI / 2) {\n angle += 2 * mathPI;\n }\n\n // Center for the sliced out slice\n point.slicedTranslation = {\n translateX: mathRound(mathCos(angle) * slicedOffset),\n translateY: mathRound(mathSin(angle) * slicedOffset)\n };\n\n // set the anchor point for tooltips\n radiusX = mathCos(angle) * positions[2] / 2;\n radiusY = mathSin(angle) * positions[2] / 2;\n point.tooltipPos = [\n positions[0] + radiusX * 0.7,\n positions[1] + radiusY * 0.7\n ];\n\n point.half = angle < -mathPI / 2 || angle > mathPI / 2 ? 1 : 0;\n point.angle = angle;\n\n // set the anchor point for data labels\n connectorOffset = mathMin(connectorOffset, labelDistance / 2); // #1678\n point.labelPos = [\n positions[0] + radiusX + mathCos(angle) * labelDistance, // first break of connector\n positions[1] + radiusY + mathSin(angle) * labelDistance, // a/a\n positions[0] + radiusX + mathCos(angle) * connectorOffset, // second break, right outside pie\n positions[1] + radiusY + mathSin(angle) * connectorOffset, // a/a\n positions[0] + radiusX, // landing point for connector\n positions[1] + radiusY, // a/a\n labelDistance < 0 ? // alignment\n 'center' :\n point.half ? 'right' : 'left', // alignment\n angle // center angle\n ];\n\n }\n },\n\n drawGraph: null,\n\n /**\n * Draw the data points\n */\n drawPoints: function () {\n var series = this,\n chart = series.chart,\n renderer = chart.renderer,\n groupTranslation,\n //center,\n graphic,\n //group,\n shadow = series.options.shadow,\n shadowGroup,\n shapeArgs;\n\n if (shadow && !series.shadowGroup) {\n series.shadowGroup = renderer.g('shadow')\n .add(series.group);\n }\n\n // draw the slices\n each(series.points, function (point) {\n graphic = point.graphic;\n shapeArgs = point.shapeArgs;\n shadowGroup = point.shadowGroup;\n\n // put the shadow behind all points\n if (shadow && !shadowGroup) {\n shadowGroup = point.shadowGroup = renderer.g('shadow')\n .add(series.shadowGroup);\n }\n\n // if the point is sliced, use special translation, else use plot area traslation\n groupTranslation = point.sliced ? point.slicedTranslation : {\n translateX: 0,\n translateY: 0\n };\n\n //group.translate(groupTranslation[0], groupTranslation[1]);\n if (shadowGroup) {\n shadowGroup.attr(groupTranslation);\n }\n\n // draw the slice\n if (graphic) {\n graphic.animate(extend(shapeArgs, groupTranslation));\n } else {\n point.graphic = graphic = renderer[point.shapeType](shapeArgs)\n .setRadialReference(series.center)\n .attr(\n point.pointAttr[point.selected ? SELECT_STATE : NORMAL_STATE]\n )\n .attr({\n 'stroke-linejoin': 'round'\n //zIndex: 1 // #2722 (reversed)\n })\n .attr(groupTranslation)\n .add(series.group)\n .shadow(shadow, shadowGroup);\n }\n\n // detect point specific visibility (#2430)\n if (point.visible !== undefined) {\n point.setVisible(point.visible);\n }\n\n });\n\n },\n\n /**\n * Utility for sorting data labels\n */\n sortByAngle: function (points, sign) {\n points.sort(function (a, b) {\n return a.angle !== undefined && (b.angle - a.angle) * sign;\n });\n },\n\n /**\n * Use a simple symbol from LegendSymbolMixin\n */\n drawLegendSymbol: LegendSymbolMixin.drawRectangle,\n\n /**\n * Use the getCenter method from drawLegendSymbol\n */\n getCenter: CenteredSeriesMixin.getCenter,\n\n /**\n * Pies don't have point marker symbols\n */\n getSymbol: noop\n\n };\n PieSeries = extendClass(Series, PieSeries);\n seriesTypes.pie = PieSeries;\n\n /**\n * Draw the data labels\n */\n Series.prototype.drawDataLabels = function () {\n\n var series = this,\n seriesOptions = series.options,\n cursor = seriesOptions.cursor,\n options = seriesOptions.dataLabels,\n points = series.points,\n pointOptions,\n generalOptions,\n hasRendered = series.hasRendered || 0,\n str,\n dataLabelsGroup;\n\n if (options.enabled || series._hasPointLabels) {\n\n // Process default alignment of data labels for columns\n if (series.dlProcessOptions) {\n series.dlProcessOptions(options);\n }\n\n // Create a separate group for the data labels to avoid rotation\n dataLabelsGroup = series.plotGroup(\n 'dataLabelsGroup',\n 'data-labels',\n options.defer ? HIDDEN : VISIBLE,\n options.zIndex || 6\n );\n\n if (pick(options.defer, true)) {\n dataLabelsGroup.attr({ opacity: +hasRendered }); // #3300\n if (!hasRendered) {\n addEvent(series, 'afterAnimate', function () {\n if (series.visible) { // #3023, #3024\n dataLabelsGroup.show();\n }\n dataLabelsGroup[seriesOptions.animation ? 'animate' : 'attr']({ opacity: 1 }, { duration: 200 });\n });\n }\n }\n\n // Make the labels for each point\n generalOptions = options;\n each(points, function (point) {\n\n var enabled,\n dataLabel = point.dataLabel,\n labelConfig,\n attr,\n name,\n rotation,\n connector = point.connector,\n isNew = true;\n\n // Determine if each data label is enabled\n pointOptions = point.options && point.options.dataLabels;\n enabled = pick(pointOptions && pointOptions.enabled, generalOptions.enabled); // #2282\n\n\n // If the point is outside the plot area, destroy it. #678, #820\n if (dataLabel && !enabled) {\n point.dataLabel = dataLabel.destroy();\n\n // Individual labels are disabled if the are explicitly disabled\n // in the point options, or if they fall outside the plot area.\n } else if (enabled) {\n\n // Create individual options structure that can be extended without\n // affecting others\n options = merge(generalOptions, pointOptions);\n\n rotation = options.rotation;\n\n // Get the string\n labelConfig = point.getLabelConfig();\n str = options.format ?\n format(options.format, labelConfig) :\n options.formatter.call(labelConfig, options);\n\n // Determine the color\n options.style.color = pick(options.color, options.style.color, series.color, 'black');\n\n\n // update existing label\n if (dataLabel) {\n\n if (defined(str)) {\n dataLabel\n .attr({\n text: str\n });\n isNew = false;\n\n } else { // #1437 - the label is shown conditionally\n point.dataLabel = dataLabel = dataLabel.destroy();\n if (connector) {\n point.connector = connector.destroy();\n }\n }\n\n // create new label\n } else if (defined(str)) {\n attr = {\n //align: align,\n fill: options.backgroundColor,\n stroke: options.borderColor,\n 'stroke-width': options.borderWidth,\n r: options.borderRadius || 0,\n rotation: rotation,\n padding: options.padding,\n zIndex: 1\n };\n // Remove unused attributes (#947)\n for (name in attr) {\n if (attr[name] === UNDEFINED) {\n delete attr[name];\n }\n }\n\n dataLabel = point.dataLabel = series.chart.renderer[rotation ? 'text' : 'label']( // labels don't support rotation\n str,\n 0,\n -999,\n null,\n null,\n null,\n options.useHTML\n )\n .attr(attr)\n .css(extend(options.style, cursor && { cursor: cursor }))\n .add(dataLabelsGroup)\n .shadow(options.shadow);\n\n }\n\n if (dataLabel) {\n // Now the data label is created and placed at 0,0, so we need to align it\n series.alignDataLabel(point, dataLabel, options, null, isNew);\n }\n }\n });\n }\n };\n\n /**\n * Align each individual data label\n */\n Series.prototype.alignDataLabel = function (point, dataLabel, options, alignTo, isNew) {\n var chart = this.chart,\n inverted = chart.inverted,\n plotX = pick(point.plotX, -999),\n plotY = pick(point.plotY, -999),\n bBox = dataLabel.getBBox(),\n // Math.round for rounding errors (#2683), alignTo to allow column labels (#2700)\n visible = this.visible && (point.series.forceDL || chart.isInsidePlot(plotX, mathRound(plotY), inverted) ||\n (alignTo && chart.isInsidePlot(plotX, inverted ? alignTo.x + 1 : alignTo.y + alignTo.height - 1, inverted))),\n alignAttr; // the final position;\n\n if (visible) {\n\n // The alignment box is a singular point\n alignTo = extend({\n x: inverted ? chart.plotWidth - plotY : plotX,\n y: mathRound(inverted ? chart.plotHeight - plotX : plotY),\n width: 0,\n height: 0\n }, alignTo);\n\n // Add the text size for alignment calculation\n extend(options, {\n width: bBox.width,\n height: bBox.height\n });\n\n // Allow a hook for changing alignment in the last moment, then do the alignment\n if (options.rotation) { // Fancy box alignment isn't supported for rotated text\n dataLabel[isNew ? 'attr' : 'animate']({\n x: alignTo.x + options.x + alignTo.width / 2,\n y: alignTo.y + options.y + alignTo.height / 2\n })\n .attr({ // #3003\n align: options.align\n });\n } else {\n dataLabel.align(options, null, alignTo);\n alignAttr = dataLabel.alignAttr;\n\n // Handle justify or crop\n if (pick(options.overflow, 'justify') === 'justify') {\n this.justifyDataLabel(dataLabel, options, alignAttr, bBox, alignTo, isNew);\n\n } else if (pick(options.crop, true)) {\n // Now check that the data label is within the plot area\n visible = chart.isInsidePlot(alignAttr.x, alignAttr.y) && chart.isInsidePlot(alignAttr.x + bBox.width, alignAttr.y + bBox.height);\n\n }\n }\n }\n\n // Show or hide based on the final aligned position\n if (!visible) {\n dataLabel.attr({ y: -999 });\n dataLabel.placed = false; // don't animate back in\n }\n\n };\n\n /**\n * If data labels fall partly outside the plot area, align them back in, in a way that\n * doesn't hide the point.\n */\n Series.prototype.justifyDataLabel = function (dataLabel, options, alignAttr, bBox, alignTo, isNew) {\n var chart = this.chart,\n align = options.align,\n verticalAlign = options.verticalAlign,\n off,\n justified;\n\n // Off left\n off = alignAttr.x;\n if (off < 0) {\n if (align === 'right') {\n options.align = 'left';\n } else {\n options.x = -off;\n }\n justified = true;\n }\n\n // Off right\n off = alignAttr.x + bBox.width;\n if (off > chart.plotWidth) {\n if (align === 'left') {\n options.align = 'right';\n } else {\n options.x = chart.plotWidth - off;\n }\n justified = true;\n }\n\n // Off top\n off = alignAttr.y;\n if (off < 0) {\n if (verticalAlign === 'bottom') {\n options.verticalAlign = 'top';\n } else {\n options.y = -off;\n }\n justified = true;\n }\n\n // Off bottom\n off = alignAttr.y + bBox.height;\n if (off > chart.plotHeight) {\n if (verticalAlign === 'top') {\n options.verticalAlign = 'bottom';\n } else {\n options.y = chart.plotHeight - off;\n }\n justified = true;\n }\n\n if (justified) {\n dataLabel.placed = !isNew;\n dataLabel.align(options, null, alignTo);\n }\n };\n\n /**\n * Override the base drawDataLabels method by pie specific functionality\n */\n if (seriesTypes.pie) {\n seriesTypes.pie.prototype.drawDataLabels = function () {\n var series = this,\n data = series.data,\n point,\n chart = series.chart,\n options = series.options.dataLabels,\n connectorPadding = pick(options.connectorPadding, 10),\n connectorWidth = pick(options.connectorWidth, 1),\n plotWidth = chart.plotWidth,\n plotHeight = chart.plotHeight,\n connector,\n connectorPath,\n softConnector = pick(options.softConnector, true),\n distanceOption = options.distance,\n seriesCenter = series.center,\n radius = seriesCenter[2] / 2,\n centerY = seriesCenter[1],\n outside = distanceOption > 0,\n dataLabel,\n dataLabelWidth,\n labelPos,\n labelHeight,\n halves = [// divide the points into right and left halves for anti collision\n [], // right\n [] // left\n ],\n x,\n y,\n visibility,\n rankArr,\n i,\n j,\n overflow = [0, 0, 0, 0], // top, right, bottom, left\n sort = function (a, b) {\n return b.y - a.y;\n };\n\n // get out if not enabled\n if (!series.visible || (!options.enabled && !series._hasPointLabels)) {\n return;\n }\n\n // run parent method\n Series.prototype.drawDataLabels.apply(series);\n\n // arrange points for detection collision\n each(data, function (point) {\n if (point.dataLabel && point.visible) { // #407, #2510\n halves[point.half].push(point);\n }\n });\n\n /* Loop over the points in each half, starting from the top and bottom\n * of the pie to detect overlapping labels.\n */\n i = 2;\n while (i--) {\n\n var slots = [],\n slotsLength,\n usedSlots = [],\n points = halves[i],\n pos,\n bottom,\n length = points.length,\n slotIndex;\n\n if (!length) {\n continue;\n }\n\n // Sort by angle\n series.sortByAngle(points, i - 0.5);\n\n // Assume equal label heights on either hemisphere (#2630)\n j = labelHeight = 0;\n while (!labelHeight && points[j]) { // #1569\n labelHeight = points[j] && points[j].dataLabel && (points[j].dataLabel.getBBox().height || 21); // 21 is for #968\n j++;\n }\n\n // Only do anti-collision when we are outside the pie and have connectors (#856)\n if (distanceOption > 0) {\n\n // Build the slots\n bottom = mathMin(centerY + radius + distanceOption, chart.plotHeight);\n for (pos = mathMax(0, centerY - radius - distanceOption); pos <= bottom; pos += labelHeight) {\n slots.push(pos);\n }\n slotsLength = slots.length;\n\n\n /* Visualize the slots\n if (!series.slotElements) {\n series.slotElements = [];\n }\n if (i === 1) {\n series.slotElements.forEach(function (elem) {\n elem.destroy();\n });\n series.slotElements.length = 0;\n }\n\n slots.forEach(function (pos, no) {\n var slotX = series.getX(pos, i) + chart.plotLeft - (i ? 100 : 0),\n slotY = pos + chart.plotTop;\n\n if (!isNaN(slotX)) {\n series.slotElements.push(chart.renderer.rect(slotX, slotY - 7, 100, labelHeight, 1)\n .attr({\n 'stroke-width': 1,\n stroke: 'silver',\n fill: 'rgba(0,0,255,0.1)'\n })\n .add());\n series.slotElements.push(chart.renderer.text('Slot '+ no, slotX, slotY + 4)\n .attr({\n fill: 'silver'\n }).add());\n }\n });\n // */\n\n // if there are more values than available slots, remove lowest values\n if (length > slotsLength) {\n // create an array for sorting and ranking the points within each quarter\n rankArr = [].concat(points);\n rankArr.sort(sort);\n j = length;\n while (j--) {\n rankArr[j].rank = j;\n }\n j = length;\n while (j--) {\n if (points[j].rank >= slotsLength) {\n points.splice(j, 1);\n }\n }\n length = points.length;\n }\n\n // The label goes to the nearest open slot, but not closer to the edge than\n // the label's index.\n for (j = 0; j < length; j++) {\n\n point = points[j];\n labelPos = point.labelPos;\n\n var closest = 9999,\n distance,\n slotI;\n\n // find the closest slot index\n for (slotI = 0; slotI < slotsLength; slotI++) {\n distance = mathAbs(slots[slotI] - labelPos[1]);\n if (distance < closest) {\n closest = distance;\n slotIndex = slotI;\n }\n }\n\n // if that slot index is closer to the edges of the slots, move it\n // to the closest appropriate slot\n if (slotIndex < j && slots[j] !== null) { // cluster at the top\n slotIndex = j;\n } else if (slotsLength < length - j + slotIndex && slots[j] !== null) { // cluster at the bottom\n slotIndex = slotsLength - length + j;\n while (slots[slotIndex] === null) { // make sure it is not taken\n slotIndex++;\n }\n } else {\n // Slot is taken, find next free slot below. In the next run, the next slice will find the\n // slot above these, because it is the closest one\n while (slots[slotIndex] === null) { // make sure it is not taken\n slotIndex++;\n }\n }\n\n usedSlots.push({ i: slotIndex, y: slots[slotIndex] });\n slots[slotIndex] = null; // mark as taken\n }\n // sort them in order to fill in from the top\n usedSlots.sort(sort);\n }\n\n // now the used slots are sorted, fill them up sequentially\n for (j = 0; j < length; j++) {\n\n var slot, naturalY;\n\n point = points[j];\n labelPos = point.labelPos;\n dataLabel = point.dataLabel;\n visibility = point.visible === false ? HIDDEN : VISIBLE;\n naturalY = labelPos[1];\n\n if (distanceOption > 0) {\n slot = usedSlots.pop();\n slotIndex = slot.i;\n\n // if the slot next to currrent slot is free, the y value is allowed\n // to fall back to the natural position\n y = slot.y;\n if ((naturalY > y && slots[slotIndex + 1] !== null) ||\n (naturalY < y && slots[slotIndex - 1] !== null)) {\n y = mathMin(mathMax(0, naturalY), chart.plotHeight);\n }\n\n } else {\n y = naturalY;\n }\n\n // get the x - use the natural x position for first and last slot, to prevent the top\n // and botton slice connectors from touching each other on either side\n x = options.justify ?\n seriesCenter[0] + (i ? -1 : 1) * (radius + distanceOption) :\n series.getX(y === centerY - radius - distanceOption || y === centerY + radius + distanceOption ? naturalY : y, i);\n\n\n // Record the placement and visibility\n dataLabel._attr = {\n visibility: visibility,\n align: labelPos[6]\n };\n dataLabel._pos = {\n x: x + options.x +\n ({ left: connectorPadding, right: -connectorPadding }[labelPos[6]] || 0),\n y: y + options.y - 10 // 10 is for the baseline (label vs text)\n };\n dataLabel.connX = x;\n dataLabel.connY = y;\n\n\n // Detect overflowing data labels\n if (this.options.size === null) {\n dataLabelWidth = dataLabel.width;\n // Overflow left\n if (x - dataLabelWidth < connectorPadding) {\n overflow[3] = mathMax(mathRound(dataLabelWidth - x + connectorPadding), overflow[3]);\n\n // Overflow right\n } else if (x + dataLabelWidth > plotWidth - connectorPadding) {\n overflow[1] = mathMax(mathRound(x + dataLabelWidth - plotWidth + connectorPadding), overflow[1]);\n }\n\n // Overflow top\n if (y - labelHeight / 2 < 0) {\n overflow[0] = mathMax(mathRound(-y + labelHeight / 2), overflow[0]);\n\n // Overflow left\n } else if (y + labelHeight / 2 > plotHeight) {\n overflow[2] = mathMax(mathRound(y + labelHeight / 2 - plotHeight), overflow[2]);\n }\n }\n } // for each point\n } // for each half\n\n // Do not apply the final placement and draw the connectors until we have verified\n // that labels are not spilling over.\n if (arrayMax(overflow) === 0 || this.verifyDataLabelOverflow(overflow)) {\n\n // Place the labels in the final position\n this.placeDataLabels();\n\n // Draw the connectors\n if (outside && connectorWidth) {\n each(this.points, function (point) {\n connector = point.connector;\n labelPos = point.labelPos;\n dataLabel = point.dataLabel;\n\n if (dataLabel && dataLabel._pos) {\n visibility = dataLabel._attr.visibility;\n x = dataLabel.connX;\n y = dataLabel.connY;\n connectorPath = softConnector ? [\n M,\n x + (labelPos[6] === 'left' ? 5 : -5), y, // end of the string at the label\n 'C',\n x, y, // first break, next to the label\n 2 * labelPos[2] - labelPos[4], 2 * labelPos[3] - labelPos[5],\n labelPos[2], labelPos[3], // second break\n L,\n labelPos[4], labelPos[5] // base\n ] : [\n M,\n x + (labelPos[6] === 'left' ? 5 : -5), y, // end of the string at the label\n L,\n labelPos[2], labelPos[3], // second break\n L,\n labelPos[4], labelPos[5] // base\n ];\n\n if (connector) {\n connector.animate({ d: connectorPath });\n connector.attr('visibility', visibility);\n\n } else {\n point.connector = connector = series.chart.renderer.path(connectorPath).attr({\n 'stroke-width': connectorWidth,\n stroke: options.connectorColor || point.color || '#606060',\n visibility: visibility\n //zIndex: 0 // #2722 (reversed)\n })\n .add(series.dataLabelsGroup);\n }\n } else if (connector) {\n point.connector = connector.destroy();\n }\n });\n }\n }\n };\n /**\n * Perform the final placement of the data labels after we have verified that they\n * fall within the plot area.\n */\n seriesTypes.pie.prototype.placeDataLabels = function () {\n each(this.points, function (point) {\n var dataLabel = point.dataLabel,\n _pos;\n\n if (dataLabel) {\n _pos = dataLabel._pos;\n if (_pos) {\n dataLabel.attr(dataLabel._attr);\n dataLabel[dataLabel.moved ? 'animate' : 'attr'](_pos);\n dataLabel.moved = true;\n } else if (dataLabel) {\n dataLabel.attr({ y: -999 });\n }\n }\n });\n };\n\n seriesTypes.pie.prototype.alignDataLabel = noop;\n\n /**\n * Verify whether the data labels are allowed to draw, or we should run more translation and data\n * label positioning to keep them inside the plot area. Returns true when data labels are ready\n * to draw.\n */\n seriesTypes.pie.prototype.verifyDataLabelOverflow = function (overflow) {\n\n var center = this.center,\n options = this.options,\n centerOption = options.center,\n minSize = options.minSize || 80,\n newSize = minSize,\n ret;\n\n // Handle horizontal size and center\n if (centerOption[0] !== null) { // Fixed center\n newSize = mathMax(center[2] - mathMax(overflow[1], overflow[3]), minSize);\n\n } else { // Auto center\n newSize = mathMax(\n center[2] - overflow[1] - overflow[3], // horizontal overflow\n minSize\n );\n center[0] += (overflow[3] - overflow[1]) / 2; // horizontal center\n }\n\n // Handle vertical size and center\n if (centerOption[1] !== null) { // Fixed center\n newSize = mathMax(mathMin(newSize, center[2] - mathMax(overflow[0], overflow[2])), minSize);\n\n } else { // Auto center\n newSize = mathMax(\n mathMin(\n newSize,\n center[2] - overflow[0] - overflow[2] // vertical overflow\n ),\n minSize\n );\n center[1] += (overflow[0] - overflow[2]) / 2; // vertical center\n }\n\n // If the size must be decreased, we need to run translate and drawDataLabels again\n if (newSize < center[2]) {\n center[2] = newSize;\n this.translate(center);\n each(this.points, function (point) {\n if (point.dataLabel) {\n point.dataLabel._pos = null; // reset\n }\n });\n\n if (this.drawDataLabels) {\n this.drawDataLabels();\n }\n // Else, return true to indicate that the pie and its labels is within the plot area\n } else {\n ret = true;\n }\n return ret;\n };\n }\n\n if (seriesTypes.column) {\n\n /**\n * Override the basic data label alignment by adjusting for the position of the column\n */\n seriesTypes.column.prototype.alignDataLabel = function (point, dataLabel, options, alignTo, isNew) {\n var chart = this.chart,\n inverted = chart.inverted,\n dlBox = point.dlBox || point.shapeArgs, // data label box for alignment\n below = point.below || (point.plotY > pick(this.translatedThreshold, chart.plotSizeY)),\n inside = pick(options.inside, !!this.options.stacking); // draw it inside the box?\n\n // Align to the column itself, or the top of it\n if (dlBox) { // Area range uses this method but not alignTo\n alignTo = merge(dlBox);\n\n if (inverted) {\n alignTo = {\n x: chart.plotWidth - alignTo.y - alignTo.height,\n y: chart.plotHeight - alignTo.x - alignTo.width,\n width: alignTo.height,\n height: alignTo.width\n };\n }\n\n // Compute the alignment box\n if (!inside) {\n if (inverted) {\n alignTo.x += below ? 0 : alignTo.width;\n alignTo.width = 0;\n } else {\n alignTo.y += below ? alignTo.height : 0;\n alignTo.height = 0;\n }\n }\n }\n\n\n // When alignment is undefined (typically columns and bars), display the individual\n // point below or above the point depending on the threshold\n options.align = pick(\n options.align,\n !inverted || inside ? 'center' : below ? 'right' : 'left'\n );\n options.verticalAlign = pick(\n options.verticalAlign,\n inverted || inside ? 'middle' : below ? 'top' : 'bottom'\n );\n\n // Call the parent method\n Series.prototype.alignDataLabel.call(this, point, dataLabel, options, alignTo, isNew);\n };\n }\n\n\n\n /**\n * TrackerMixin for points and graphs\n */\n\n var TrackerMixin = Highcharts.TrackerMixin = {\n\n drawTrackerPoint: function () {\n var series = this,\n chart = series.chart,\n pointer = chart.pointer,\n cursor = series.options.cursor,\n css = cursor && { cursor: cursor },\n onMouseOver = function (e) {\n var target = e.target,\n point;\n\n if (chart.hoverSeries !== series) {\n series.onMouseOver();\n }\n\n while (target && !point) {\n point = target.point;\n target = target.parentNode;\n }\n\n if (point !== UNDEFINED && point !== chart.hoverPoint) { // undefined on graph in scatterchart\n point.onMouseOver(e);\n }\n };\n\n // Add reference to the point\n each(series.points, function (point) {\n if (point.graphic) {\n point.graphic.element.point = point;\n }\n if (point.dataLabel) {\n point.dataLabel.element.point = point;\n }\n });\n\n // Add the event listeners, we need to do this only once\n if (!series._hasTracking) {\n each(series.trackerGroups, function (key) {\n if (series[key]) { // we don't always have dataLabelsGroup\n series[key]\n .addClass(PREFIX + 'tracker')\n .on('mouseover', onMouseOver)\n .on('mouseout', function (e) { pointer.onTrackerMouseOut(e); })\n .css(css);\n if (hasTouch) {\n series[key].on('touchstart', onMouseOver);\n }\n }\n });\n series._hasTracking = true;\n }\n },\n\n /**\n * Draw the tracker object that sits above all data labels and markers to\n * track mouse events on the graph or points. For the line type charts\n * the tracker uses the same graphPath, but with a greater stroke width\n * for better control.\n */\n drawTrackerGraph: function () {\n var series = this,\n options = series.options,\n trackByArea = options.trackByArea,\n trackerPath = [].concat(trackByArea ? series.areaPath : series.graphPath),\n trackerPathLength = trackerPath.length,\n chart = series.chart,\n pointer = chart.pointer,\n renderer = chart.renderer,\n snap = chart.options.tooltip.snap,\n tracker = series.tracker,\n cursor = options.cursor,\n css = cursor && { cursor: cursor },\n singlePoints = series.singlePoints,\n singlePoint,\n i,\n onMouseOver = function () {\n if (chart.hoverSeries !== series) {\n series.onMouseOver();\n }\n },\n /*\n * Empirical lowest possible opacities for TRACKER_FILL for an element to stay invisible but clickable\n * IE6: 0.002\n * IE7: 0.002\n * IE8: 0.002\n * IE9: 0.00000000001 (unlimited)\n * IE10: 0.0001 (exporting only)\n * FF: 0.00000000001 (unlimited)\n * Chrome: 0.000001\n * Safari: 0.000001\n * Opera: 0.00000000001 (unlimited)\n */\n TRACKER_FILL = 'rgba(192,192,192,' + (hasSVG ? 0.0001 : 0.002) + ')';\n\n // Extend end points. A better way would be to use round linecaps,\n // but those are not clickable in VML.\n if (trackerPathLength && !trackByArea) {\n i = trackerPathLength + 1;\n while (i--) {\n if (trackerPath[i] === M) { // extend left side\n trackerPath.splice(i + 1, 0, trackerPath[i + 1] - snap, trackerPath[i + 2], L);\n }\n if ((i && trackerPath[i] === M) || i === trackerPathLength) { // extend right side\n trackerPath.splice(i, 0, L, trackerPath[i - 2] + snap, trackerPath[i - 1]);\n }\n }\n }\n\n // handle single points\n for (i = 0; i < singlePoints.length; i++) {\n singlePoint = singlePoints[i];\n trackerPath.push(M, singlePoint.plotX - snap, singlePoint.plotY,\n L, singlePoint.plotX + snap, singlePoint.plotY);\n }\n\n // draw the tracker\n if (tracker) {\n tracker.attr({ d: trackerPath });\n } else { // create\n\n series.tracker = renderer.path(trackerPath)\n .attr({\n 'stroke-linejoin': 'round', // #1225\n visibility: series.visible ? VISIBLE : HIDDEN,\n stroke: TRACKER_FILL,\n fill: trackByArea ? TRACKER_FILL : NONE,\n 'stroke-width' : options.lineWidth + (trackByArea ? 0 : 2 * snap),\n zIndex: 2\n })\n .add(series.group);\n\n // The tracker is added to the series group, which is clipped, but is covered\n // by the marker group. So the marker group also needs to capture events.\n each([series.tracker, series.markerGroup], function (tracker) {\n tracker.addClass(PREFIX + 'tracker')\n .on('mouseover', onMouseOver)\n .on('mouseout', function (e) { pointer.onTrackerMouseOut(e); })\n .css(css);\n\n if (hasTouch) {\n tracker.on('touchstart', onMouseOver);\n }\n });\n }\n }\n };\n /* End TrackerMixin */\n\n\n /**\n * Add tracking event listener to the series group, so the point graphics\n * themselves act as trackers\n */\n\n if (seriesTypes.column) {\n ColumnSeries.prototype.drawTracker = TrackerMixin.drawTrackerPoint;\n }\n\n if (seriesTypes.pie) {\n seriesTypes.pie.prototype.drawTracker = TrackerMixin.drawTrackerPoint;\n }\n\n if (seriesTypes.scatter) {\n ScatterSeries.prototype.drawTracker = TrackerMixin.drawTrackerPoint;\n }\n\n /*\n * Extend Legend for item events\n */\n extend(Legend.prototype, {\n\n setItemEvents: function (item, legendItem, useHTML, itemStyle, itemHiddenStyle) {\n var legend = this;\n // Set the events on the item group, or in case of useHTML, the item itself (#1249)\n (useHTML ? legendItem : item.legendGroup).on('mouseover', function () {\n item.setState(HOVER_STATE);\n legendItem.css(legend.options.itemHoverStyle);\n })\n .on('mouseout', function () {\n legendItem.css(item.visible ? itemStyle : itemHiddenStyle);\n item.setState();\n })\n .on('click', function (event) {\n var strLegendItemClick = 'legendItemClick',\n fnLegendItemClick = function () {\n item.setVisible();\n };\n\n // Pass over the click/touch event. #4.\n event = {\n browserEvent: event\n };\n\n // click the name or symbol\n if (item.firePointEvent) { // point\n item.firePointEvent(strLegendItemClick, event, fnLegendItemClick);\n } else {\n fireEvent(item, strLegendItemClick, event, fnLegendItemClick);\n }\n });\n },\n\n createCheckboxForItem: function (item) {\n var legend = this;\n\n item.checkbox = createElement('input', {\n type: 'checkbox',\n checked: item.selected,\n defaultChecked: item.selected // required by IE7\n }, legend.options.itemCheckboxStyle, legend.chart.container);\n\n addEvent(item.checkbox, 'click', function (event) {\n var target = event.target;\n fireEvent(item, 'checkboxClick', {\n checked: target.checked\n },\n function () {\n item.select();\n }\n );\n });\n }\n });\n\n /*\n * Add pointer cursor to legend itemstyle in defaultOptions\n */\n defaultOptions.legend.itemStyle.cursor = 'pointer';\n\n\n /*\n * Extend the Chart object with interaction\n */\n\n extend(Chart.prototype, {\n /**\n * Display the zoom button\n */\n showResetZoom: function () {\n var chart = this,\n lang = defaultOptions.lang,\n btnOptions = chart.options.chart.resetZoomButton,\n theme = btnOptions.theme,\n states = theme.states,\n alignTo = btnOptions.relativeTo === 'chart' ? null : 'plotBox';\n\n this.resetZoomButton = chart.renderer.button(lang.resetZoom, null, null, function () { chart.zoomOut(); }, theme, states && states.hover)\n .attr({\n align: btnOptions.position.align,\n title: lang.resetZoomTitle\n })\n .add()\n .align(btnOptions.position, false, alignTo);\n\n },\n\n /**\n * Zoom out to 1:1\n */\n zoomOut: function () {\n var chart = this;\n fireEvent(chart, 'selection', { resetSelection: true }, function () {\n chart.zoom();\n });\n },\n\n /**\n * Zoom into a given portion of the chart given by axis coordinates\n * @param {Object} event\n */\n zoom: function (event) {\n var chart = this,\n hasZoomed,\n pointer = chart.pointer,\n displayButton = false,\n resetZoomButton;\n\n // If zoom is called with no arguments, reset the axes\n if (!event || event.resetSelection) {\n each(chart.axes, function (axis) {\n hasZoomed = axis.zoom();\n });\n } else { // else, zoom in on all axes\n each(event.xAxis.concat(event.yAxis), function (axisData) {\n var axis = axisData.axis,\n isXAxis = axis.isXAxis;\n\n // don't zoom more than minRange\n if (pointer[isXAxis ? 'zoomX' : 'zoomY'] || pointer[isXAxis ? 'pinchX' : 'pinchY']) {\n hasZoomed = axis.zoom(axisData.min, axisData.max);\n if (axis.displayBtn) {\n displayButton = true;\n }\n }\n });\n }\n\n // Show or hide the Reset zoom button\n resetZoomButton = chart.resetZoomButton;\n if (displayButton && !resetZoomButton) {\n chart.showResetZoom();\n } else if (!displayButton && isObject(resetZoomButton)) {\n chart.resetZoomButton = resetZoomButton.destroy();\n }\n\n\n // Redraw\n if (hasZoomed) {\n chart.redraw(\n pick(chart.options.chart.animation, event && event.animation, chart.pointCount < 100) // animation\n );\n }\n },\n\n /**\n * Pan the chart by dragging the mouse across the pane. This function is called\n * on mouse move, and the distance to pan is computed from chartX compared to\n * the first chartX position in the dragging operation.\n */\n pan: function (e, panning) {\n\n var chart = this,\n hoverPoints = chart.hoverPoints,\n doRedraw;\n\n // remove active points for shared tooltip\n if (hoverPoints) {\n each(hoverPoints, function (point) {\n point.setState();\n });\n }\n\n each(panning === 'xy' ? [1, 0] : [1], function (isX) { // xy is used in maps\n var mousePos = e[isX ? 'chartX' : 'chartY'],\n axis = chart[isX ? 'xAxis' : 'yAxis'][0],\n startPos = chart[isX ? 'mouseDownX' : 'mouseDownY'],\n halfPointRange = (axis.pointRange || 0) / 2,\n extremes = axis.getExtremes(),\n newMin = axis.toValue(startPos - mousePos, true) + halfPointRange,\n newMax = axis.toValue(startPos + chart[isX ? 'plotWidth' : 'plotHeight'] - mousePos, true) - halfPointRange;\n\n if (axis.series.length && newMin > mathMin(extremes.dataMin, extremes.min) && newMax < mathMax(extremes.dataMax, extremes.max)) {\n axis.setExtremes(newMin, newMax, false, false, { trigger: 'pan' });\n doRedraw = true;\n }\n\n chart[isX ? 'mouseDownX' : 'mouseDownY'] = mousePos; // set new reference for next run\n });\n\n if (doRedraw) {\n chart.redraw(false);\n }\n css(chart.container, { cursor: 'move' });\n }\n });\n\n /*\n * Extend the Point object with interaction\n */\n extend(Point.prototype, {\n /**\n * Toggle the selection status of a point\n * @param {Boolean} selected Whether to select or unselect the point.\n * @param {Boolean} accumulate Whether to add to the previous selection. By default,\n *\t\t this happens if the control key (Cmd on Mac) was pressed during clicking.\n */\n select: function (selected, accumulate) {\n var point = this,\n series = point.series,\n chart = series.chart;\n\n selected = pick(selected, !point.selected);\n\n // fire the event with the defalut handler\n point.firePointEvent(selected ? 'select' : 'unselect', { accumulate: accumulate }, function () {\n point.selected = point.options.selected = selected;\n series.options.data[inArray(point, series.data)] = point.options;\n\n point.setState(selected && SELECT_STATE);\n\n // unselect all other points unless Ctrl or Cmd + click\n if (!accumulate) {\n each(chart.getSelectedPoints(), function (loopPoint) {\n if (loopPoint.selected && loopPoint !== point) {\n loopPoint.selected = loopPoint.options.selected = false;\n series.options.data[inArray(loopPoint, series.data)] = loopPoint.options;\n loopPoint.setState(NORMAL_STATE);\n loopPoint.firePointEvent('unselect');\n }\n });\n }\n });\n },\n\n /**\n * Runs on mouse over the point\n */\n onMouseOver: function (e) {\n var point = this,\n series = point.series,\n chart = series.chart,\n tooltip = chart.tooltip,\n hoverPoint = chart.hoverPoint;\n\n // set normal state to previous series\n if (hoverPoint && hoverPoint !== point) {\n hoverPoint.onMouseOut();\n }\n\n // trigger the event\n point.firePointEvent('mouseOver');\n\n // update the tooltip\n if (tooltip && (!tooltip.shared || series.noSharedTooltip)) {\n tooltip.refresh(point, e);\n }\n\n // hover this\n point.setState(HOVER_STATE);\n chart.hoverPoint = point;\n },\n\n /**\n * Runs on mouse out from the point\n */\n onMouseOut: function () {\n var chart = this.series.chart,\n hoverPoints = chart.hoverPoints;\n\n this.firePointEvent('mouseOut');\n\n if (!hoverPoints || inArray(this, hoverPoints) === -1) { // #887, #2240\n this.setState();\n chart.hoverPoint = null;\n }\n },\n\n /**\n * Import events from the series' and point's options. Only do it on\n * demand, to save processing time on hovering.\n */\n importEvents: function () {\n if (!this.hasImportedEvents) {\n var point = this,\n options = merge(point.series.options.point, point.options),\n events = options.events,\n eventType;\n\n point.events = events;\n\n for (eventType in events) {\n addEvent(point, eventType, events[eventType]);\n }\n this.hasImportedEvents = true;\n\n }\n },\n\n /**\n * Set the point's state\n * @param {String} state\n */\n setState: function (state, move) {\n var point = this,\n plotX = point.plotX,\n plotY = point.plotY,\n series = point.series,\n stateOptions = series.options.states,\n markerOptions = defaultPlotOptions[series.type].marker && series.options.marker,\n normalDisabled = markerOptions && !markerOptions.enabled,\n markerStateOptions = markerOptions && markerOptions.states[state],\n stateDisabled = markerStateOptions && markerStateOptions.enabled === false,\n stateMarkerGraphic = series.stateMarkerGraphic,\n pointMarker = point.marker || {},\n chart = series.chart,\n radius,\n halo = series.halo,\n haloOptions,\n newSymbol,\n pointAttr;\n\n state = state || NORMAL_STATE; // empty string\n pointAttr = point.pointAttr[state] || series.pointAttr[state];\n\n if (\n // already has this state\n (state === point.state && !move) ||\n // selected points don't respond to hover\n (point.selected && state !== SELECT_STATE) ||\n // series' state options is disabled\n (stateOptions[state] && stateOptions[state].enabled === false) ||\n // general point marker's state options is disabled\n (state && (stateDisabled || (normalDisabled && markerStateOptions.enabled === false))) ||\n // individual point marker's state options is disabled\n (state && pointMarker.states && pointMarker.states[state] && pointMarker.states[state].enabled === false) // #1610\n\n ) {\n return;\n }\n\n // apply hover styles to the existing point\n if (point.graphic) {\n radius = markerOptions && point.graphic.symbolName && pointAttr.r;\n point.graphic.attr(merge(\n pointAttr,\n radius ? { // new symbol attributes (#507, #612)\n x: plotX - radius,\n y: plotY - radius,\n width: 2 * radius,\n height: 2 * radius\n } : {}\n ));\n\n // Zooming in from a range with no markers to a range with markers\n if (stateMarkerGraphic) {\n stateMarkerGraphic.hide();\n }\n } else {\n // if a graphic is not applied to each point in the normal state, create a shared\n // graphic for the hover state\n if (state && markerStateOptions) {\n radius = markerStateOptions.radius;\n newSymbol = pointMarker.symbol || series.symbol;\n\n // If the point has another symbol than the previous one, throw away the\n // state marker graphic and force a new one (#1459)\n if (stateMarkerGraphic && stateMarkerGraphic.currentSymbol !== newSymbol) {\n stateMarkerGraphic = stateMarkerGraphic.destroy();\n }\n\n // Add a new state marker graphic\n if (!stateMarkerGraphic) {\n if (newSymbol) {\n series.stateMarkerGraphic = stateMarkerGraphic = chart.renderer.symbol(\n newSymbol,\n plotX - radius,\n plotY - radius,\n 2 * radius,\n 2 * radius\n )\n .attr(pointAttr)\n .add(series.markerGroup);\n stateMarkerGraphic.currentSymbol = newSymbol;\n }\n\n // Move the existing graphic\n } else {\n stateMarkerGraphic[move ? 'animate' : 'attr']({ // #1054\n x: plotX - radius,\n y: plotY - radius\n });\n }\n }\n\n if (stateMarkerGraphic) {\n stateMarkerGraphic[state && chart.isInsidePlot(plotX, plotY, chart.inverted) ? 'show' : 'hide'](); // #2450\n }\n }\n\n // Show me your halo\n haloOptions = stateOptions[state] && stateOptions[state].halo;\n if (haloOptions && haloOptions.size) {\n if (!halo) {\n series.halo = halo = chart.renderer.path()\n .add(series.seriesGroup);\n }\n halo.attr(extend({\n fill: Color(point.color || series.color).setOpacity(haloOptions.opacity).get()\n }, haloOptions.attributes))[move ? 'animate' : 'attr']({\n d: point.haloPath(haloOptions.size)\n });\n } else if (halo) {\n halo.attr({ d: [] });\n }\n\n point.state = state;\n },\n\n haloPath: function (size) {\n var series = this.series,\n chart = series.chart,\n plotBox = series.getPlotBox(),\n inverted = chart.inverted;\n\n return chart.renderer.symbols.circle(\n plotBox.translateX + (inverted ? series.yAxis.len - this.plotY : this.plotX) - size,\n plotBox.translateY + (inverted ? series.xAxis.len - this.plotX : this.plotY) - size,\n size * 2,\n size * 2\n );\n }\n });\n\n /*\n * Extend the Series object with interaction\n */\n\n extend(Series.prototype, {\n /**\n * Series mouse over handler\n */\n onMouseOver: function () {\n var series = this,\n chart = series.chart,\n hoverSeries = chart.hoverSeries;\n\n // set normal state to previous series\n if (hoverSeries && hoverSeries !== series) {\n hoverSeries.onMouseOut();\n }\n\n // trigger the event, but to save processing time,\n // only if defined\n if (series.options.events.mouseOver) {\n fireEvent(series, 'mouseOver');\n }\n\n // hover this\n series.setState(HOVER_STATE);\n chart.hoverSeries = series;\n },\n\n /**\n * Series mouse out handler\n */\n onMouseOut: function () {\n // trigger the event only if listeners exist\n var series = this,\n options = series.options,\n chart = series.chart,\n tooltip = chart.tooltip,\n hoverPoint = chart.hoverPoint;\n\n // trigger mouse out on the point, which must be in this series\n if (hoverPoint) {\n hoverPoint.onMouseOut();\n }\n\n // fire the mouse out event\n if (series && options.events.mouseOut) {\n fireEvent(series, 'mouseOut');\n }\n\n\n // hide the tooltip\n if (tooltip && !options.stickyTracking && (!tooltip.shared || series.noSharedTooltip)) {\n tooltip.hide();\n }\n\n // set normal state\n series.setState();\n chart.hoverSeries = null;\n },\n\n /**\n * Set the state of the graph\n */\n setState: function (state) {\n var series = this,\n options = series.options,\n graph = series.graph,\n graphNeg = series.graphNeg,\n stateOptions = options.states,\n lineWidth = options.lineWidth,\n attribs;\n\n state = state || NORMAL_STATE;\n\n if (series.state !== state) {\n series.state = state;\n\n if (stateOptions[state] && stateOptions[state].enabled === false) {\n return;\n }\n\n if (state) {\n lineWidth = stateOptions[state].lineWidth || lineWidth + (stateOptions[state].lineWidthPlus || 0);\n }\n\n if (graph && !graph.dashstyle) { // hover is turned off for dashed lines in VML\n attribs = {\n 'stroke-width': lineWidth\n };\n // use attr because animate will cause any other animation on the graph to stop\n graph.attr(attribs);\n if (graphNeg) {\n graphNeg.attr(attribs);\n }\n }\n }\n },\n\n /**\n * Set the visibility of the graph\n *\n * @param vis {Boolean} True to show the series, false to hide. If UNDEFINED,\n *\t\t\t\tthe visibility is toggled.\n */\n setVisible: function (vis, redraw) {\n var series = this,\n chart = series.chart,\n legendItem = series.legendItem,\n showOrHide,\n ignoreHiddenSeries = chart.options.chart.ignoreHiddenSeries,\n oldVisibility = series.visible;\n\n // if called without an argument, toggle visibility\n series.visible = vis = series.userOptions.visible = vis === UNDEFINED ? !oldVisibility : vis;\n showOrHide = vis ? 'show' : 'hide';\n\n // show or hide elements\n each(['group', 'dataLabelsGroup', 'markerGroup', 'tracker'], function (key) {\n if (series[key]) {\n series[key][showOrHide]();\n }\n });\n\n\n // hide tooltip (#1361)\n if (chart.hoverSeries === series) {\n series.onMouseOut();\n }\n\n\n if (legendItem) {\n chart.legend.colorizeItem(series, vis);\n }\n\n\n // rescale or adapt to resized chart\n series.isDirty = true;\n // in a stack, all other series are affected\n if (series.options.stacking) {\n each(chart.series, function (otherSeries) {\n if (otherSeries.options.stacking && otherSeries.visible) {\n otherSeries.isDirty = true;\n }\n });\n }\n\n // show or hide linked series\n each(series.linkedSeries, function (otherSeries) {\n otherSeries.setVisible(vis, false);\n });\n\n if (ignoreHiddenSeries) {\n chart.isDirtyBox = true;\n }\n if (redraw !== false) {\n chart.redraw();\n }\n\n fireEvent(series, showOrHide);\n },\n\n /**\n * Memorize tooltip texts and positions\n */\n setTooltipPoints: function (renew) {\n var series = this,\n points = [],\n pointsLength,\n low,\n high,\n xAxis = series.xAxis,\n xExtremes = xAxis && xAxis.getExtremes(),\n axisLength = xAxis ? (xAxis.tooltipLen || xAxis.len) : series.chart.plotSizeX, // tooltipLen and tooltipPosName used in polar\n point,\n pointX,\n nextPoint,\n i,\n tooltipPoints = []; // a lookup array for each pixel in the x dimension\n\n // don't waste resources if tracker is disabled\n if (series.options.enableMouseTracking === false || series.singularTooltips) {\n return;\n }\n\n // renew\n if (renew) {\n series.tooltipPoints = null;\n }\n\n // concat segments to overcome null values\n each(series.segments || series.points, function (segment) {\n points = points.concat(segment);\n });\n\n // Reverse the points in case the X axis is reversed\n if (xAxis && xAxis.reversed) {\n points = points.reverse();\n }\n\n // Polar needs additional shaping\n if (series.orderTooltipPoints) {\n series.orderTooltipPoints(points);\n }\n\n // Assign each pixel position to the nearest point\n pointsLength = points.length;\n for (i = 0; i < pointsLength; i++) {\n point = points[i];\n pointX = point.x;\n if (pointX >= xExtremes.min && pointX <= xExtremes.max) { // #1149\n nextPoint = points[i + 1];\n\n // Set this range's low to the last range's high plus one\n low = high === UNDEFINED ? 0 : high + 1;\n // Now find the new high\n high = points[i + 1] ?\n mathMin(mathMax(0, mathFloor( // #2070\n (point.clientX + (nextPoint ? (nextPoint.wrappedClientX || nextPoint.clientX) : axisLength)) / 2\n )), axisLength) :\n axisLength;\n\n while (low >= 0 && low <= high) {\n tooltipPoints[low++] = point;\n }\n }\n }\n series.tooltipPoints = tooltipPoints;\n },\n\n /**\n * Show the graph\n */\n show: function () {\n this.setVisible(true);\n },\n\n /**\n * Hide the graph\n */\n hide: function () {\n this.setVisible(false);\n },\n\n\n /**\n * Set the selected state of the graph\n *\n * @param selected {Boolean} True to select the series, false to unselect. If\n *\t\t\t\tUNDEFINED, the selection state is toggled.\n */\n select: function (selected) {\n var series = this;\n // if called without an argument, toggle\n series.selected = selected = (selected === UNDEFINED) ? !series.selected : selected;\n\n if (series.checkbox) {\n series.checkbox.checked = selected;\n }\n\n fireEvent(series, selected ? 'select' : 'unselect');\n },\n\n drawTracker: TrackerMixin.drawTrackerGraph\n });\n// global variables\n extend(Highcharts, {\n\n // Constructors\n Axis: Axis,\n Chart: Chart,\n Color: Color,\n Point: Point,\n Tick: Tick,\n Renderer: Renderer,\n Series: Series,\n SVGElement: SVGElement,\n SVGRenderer: SVGRenderer,\n\n // Various\n arrayMin: arrayMin,\n arrayMax: arrayMax,\n charts: charts,\n dateFormat: dateFormat,\n format: format,\n pathAnim: pathAnim,\n getOptions: getOptions,\n hasBidiBug: hasBidiBug,\n isTouchDevice: isTouchDevice,\n numberFormat: numberFormat,\n seriesTypes: seriesTypes,\n setOptions: setOptions,\n addEvent: addEvent,\n removeEvent: removeEvent,\n createElement: createElement,\n discardElement: discardElement,\n css: css,\n each: each,\n extend: extend,\n map: map,\n merge: merge,\n pick: pick,\n splat: splat,\n extendClass: extendClass,\n pInt: pInt,\n wrap: wrap,\n svg: hasSVG,\n canvas: useCanVG,\n vml: !hasSVG && !useCanVG,\n product: PRODUCT,\n version: VERSION\n });\n\n}());","/*!\n * Materialize v0.97.5 (http://materializecss.com)\n * Copyright 2014-2015 Materialize\n * MIT License (https://raw.githubusercontent.com/Dogfalo/materialize/master/LICENSE)\n */\n// Check for jQuery.\nif (typeof(jQuery) === 'undefined') {\n var jQuery;\n // Check if require is a defined function.\n if (typeof(require) === 'function') {\n jQuery = $ = require('jQuery');\n // Else use the dollar sign alias.\n } else {\n jQuery = $;\n }\n};/*\n * jQuery Easing v1.3 - http://gsgd.co.uk/sandbox/jquery/easing/\n *\n * Uses the built in easing capabilities added In jQuery 1.1\n * to offer multiple easing options\n *\n * TERMS OF USE - jQuery Easing\n *\n * Open source under the BSD License.\n *\n * Copyright © 2008 George McGinley Smith\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without modification,\n * are permitted provided that the following conditions are met:\n *\n * Redistributions of source code must retain the above copyright notice, this list of\n * conditions and the following disclaimer.\n * Redistributions in binary form must reproduce the above copyright notice, this list\n * of conditions and the following disclaimer in the documentation and/or other materials\n * provided with the distribution.\n *\n * Neither the name of the author nor the names of contributors may be used to endorse\n * or promote products derived from this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE\n * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,\n * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE\n * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED\n * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED\n * OF THE POSSIBILITY OF SUCH DAMAGE.\n *\n*/\n\n// t: current time, b: begInnIng value, c: change In value, d: duration\njQuery.easing['jswing'] = jQuery.easing['swing'];\n\njQuery.extend( jQuery.easing,\n{\n\tdef: 'easeOutQuad',\n\tswing: function (x, t, b, c, d) {\n\t\t//alert(jQuery.easing.default);\n\t\treturn jQuery.easing[jQuery.easing.def](x, t, b, c, d);\n\t},\n\teaseInQuad: function (x, t, b, c, d) {\n\t\treturn c*(t/=d)*t + b;\n\t},\n\teaseOutQuad: function (x, t, b, c, d) {\n\t\treturn -c *(t/=d)*(t-2) + b;\n\t},\n\teaseInOutQuad: function (x, t, b, c, d) {\n\t\tif ((t/=d/2) < 1) return c/2*t*t + b;\n\t\treturn -c/2 * ((--t)*(t-2) - 1) + b;\n\t},\n\teaseInCubic: function (x, t, b, c, d) {\n\t\treturn c*(t/=d)*t*t + b;\n\t},\n\teaseOutCubic: function (x, t, b, c, d) {\n\t\treturn c*((t=t/d-1)*t*t + 1) + b;\n\t},\n\teaseInOutCubic: function (x, t, b, c, d) {\n\t\tif ((t/=d/2) < 1) return c/2*t*t*t + b;\n\t\treturn c/2*((t-=2)*t*t + 2) + b;\n\t},\n\teaseInQuart: function (x, t, b, c, d) {\n\t\treturn c*(t/=d)*t*t*t + b;\n\t},\n\teaseOutQuart: function (x, t, b, c, d) {\n\t\treturn -c * ((t=t/d-1)*t*t*t - 1) + b;\n\t},\n\teaseInOutQuart: function (x, t, b, c, d) {\n\t\tif ((t/=d/2) < 1) return c/2*t*t*t*t + b;\n\t\treturn -c/2 * ((t-=2)*t*t*t - 2) + b;\n\t},\n\teaseInQuint: function (x, t, b, c, d) {\n\t\treturn c*(t/=d)*t*t*t*t + b;\n\t},\n\teaseOutQuint: function (x, t, b, c, d) {\n\t\treturn c*((t=t/d-1)*t*t*t*t + 1) + b;\n\t},\n\teaseInOutQuint: function (x, t, b, c, d) {\n\t\tif ((t/=d/2) < 1) return c/2*t*t*t*t*t + b;\n\t\treturn c/2*((t-=2)*t*t*t*t + 2) + b;\n\t},\n\teaseInSine: function (x, t, b, c, d) {\n\t\treturn -c * Math.cos(t/d * (Math.PI/2)) + c + b;\n\t},\n\teaseOutSine: function (x, t, b, c, d) {\n\t\treturn c * Math.sin(t/d * (Math.PI/2)) + b;\n\t},\n\teaseInOutSine: function (x, t, b, c, d) {\n\t\treturn -c/2 * (Math.cos(Math.PI*t/d) - 1) + b;\n\t},\n\teaseInExpo: function (x, t, b, c, d) {\n\t\treturn (t==0) ? b : c * Math.pow(2, 10 * (t/d - 1)) + b;\n\t},\n\teaseOutExpo: function (x, t, b, c, d) {\n\t\treturn (t==d) ? b+c : c * (-Math.pow(2, -10 * t/d) + 1) + b;\n\t},\n\teaseInOutExpo: function (x, t, b, c, d) {\n\t\tif (t==0) return b;\n\t\tif (t==d) return b+c;\n\t\tif ((t/=d/2) < 1) return c/2 * Math.pow(2, 10 * (t - 1)) + b;\n\t\treturn c/2 * (-Math.pow(2, -10 * --t) + 2) + b;\n\t},\n\teaseInCirc: function (x, t, b, c, d) {\n\t\treturn -c * (Math.sqrt(1 - (t/=d)*t) - 1) + b;\n\t},\n\teaseOutCirc: function (x, t, b, c, d) {\n\t\treturn c * Math.sqrt(1 - (t=t/d-1)*t) + b;\n\t},\n\teaseInOutCirc: function (x, t, b, c, d) {\n\t\tif ((t/=d/2) < 1) return -c/2 * (Math.sqrt(1 - t*t) - 1) + b;\n\t\treturn c/2 * (Math.sqrt(1 - (t-=2)*t) + 1) + b;\n\t},\n\teaseInElastic: function (x, t, b, c, d) {\n\t\tvar s=1.70158;var p=0;var a=c;\n\t\tif (t==0) return b; if ((t/=d)==1) return b+c; if (!p) p=d*.3;\n\t\tif (a < Math.abs(c)) { a=c; var s=p/4; }\n\t\telse var s = p/(2*Math.PI) * Math.asin (c/a);\n\t\treturn -(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;\n\t},\n\teaseOutElastic: function (x, t, b, c, d) {\n\t\tvar s=1.70158;var p=0;var a=c;\n\t\tif (t==0) return b; if ((t/=d)==1) return b+c; if (!p) p=d*.3;\n\t\tif (a < Math.abs(c)) { a=c; var s=p/4; }\n\t\telse var s = p/(2*Math.PI) * Math.asin (c/a);\n\t\treturn a*Math.pow(2,-10*t) * Math.sin( (t*d-s)*(2*Math.PI)/p ) + c + b;\n\t},\n\teaseInOutElastic: function (x, t, b, c, d) {\n\t\tvar s=1.70158;var p=0;var a=c;\n\t\tif (t==0) return b; if ((t/=d/2)==2) return b+c; if (!p) p=d*(.3*1.5);\n\t\tif (a < Math.abs(c)) { a=c; var s=p/4; }\n\t\telse var s = p/(2*Math.PI) * Math.asin (c/a);\n\t\tif (t < 1) return -.5*(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;\n\t\treturn a*Math.pow(2,-10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )*.5 + c + b;\n\t},\n\teaseInBack: function (x, t, b, c, d, s) {\n\t\tif (s == undefined) s = 1.70158;\n\t\treturn c*(t/=d)*t*((s+1)*t - s) + b;\n\t},\n\teaseOutBack: function (x, t, b, c, d, s) {\n\t\tif (s == undefined) s = 1.70158;\n\t\treturn c*((t=t/d-1)*t*((s+1)*t + s) + 1) + b;\n\t},\n\teaseInOutBack: function (x, t, b, c, d, s) {\n\t\tif (s == undefined) s = 1.70158;\n\t\tif ((t/=d/2) < 1) return c/2*(t*t*(((s*=(1.525))+1)*t - s)) + b;\n\t\treturn c/2*((t-=2)*t*(((s*=(1.525))+1)*t + s) + 2) + b;\n\t},\n\teaseInBounce: function (x, t, b, c, d) {\n\t\treturn c - jQuery.easing.easeOutBounce (x, d-t, 0, c, d) + b;\n\t},\n\teaseOutBounce: function (x, t, b, c, d) {\n\t\tif ((t/=d) < (1/2.75)) {\n\t\t\treturn c*(7.5625*t*t) + b;\n\t\t} else if (t < (2/2.75)) {\n\t\t\treturn c*(7.5625*(t-=(1.5/2.75))*t + .75) + b;\n\t\t} else if (t < (2.5/2.75)) {\n\t\t\treturn c*(7.5625*(t-=(2.25/2.75))*t + .9375) + b;\n\t\t} else {\n\t\t\treturn c*(7.5625*(t-=(2.625/2.75))*t + .984375) + b;\n\t\t}\n\t},\n\teaseInOutBounce: function (x, t, b, c, d) {\n\t\tif (t < d/2) return jQuery.easing.easeInBounce (x, t*2, 0, c, d) * .5 + b;\n\t\treturn jQuery.easing.easeOutBounce (x, t*2-d, 0, c, d) * .5 + c*.5 + b;\n\t}\n});\n\n/*\n *\n * TERMS OF USE - EASING EQUATIONS\n *\n * Open source under the BSD License.\n *\n * Copyright © 2001 Robert Penner\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without modification,\n * are permitted provided that the following conditions are met:\n *\n * Redistributions of source code must retain the above copyright notice, this list of\n * conditions and the following disclaimer.\n * Redistributions in binary form must reproduce the above copyright notice, this list\n * of conditions and the following disclaimer in the documentation and/or other materials\n * provided with the distribution.\n *\n * Neither the name of the author nor the names of contributors may be used to endorse\n * or promote products derived from this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE\n * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,\n * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE\n * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED\n * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED\n * OF THE POSSIBILITY OF SUCH DAMAGE.\n *\n */; // Custom Easing\n jQuery.extend( jQuery.easing,\n {\n easeInOutMaterial: function (x, t, b, c, d) {\n if ((t/=d/2) < 1) return c/2*t*t + b;\n return c/4*((t-=2)*t*t + 2) + b;\n }\n });\n\n;/*! VelocityJS.org (1.2.3). (C) 2014 Julian Shapiro. MIT @license: en.wikipedia.org/wiki/MIT_License */\n/*! VelocityJS.org jQuery Shim (1.0.1). (C) 2014 The jQuery Foundation. MIT @license: en.wikipedia.org/wiki/MIT_License. */\n/*! Note that this has been modified by Materialize to confirm that Velocity is not already being imported. */\njQuery.Velocity?console.log(\"Velocity is already loaded. You may be needlessly importing Velocity again; note that Materialize includes Velocity.\"):(!function(e){function t(e){var t=e.length,a=r.type(e);return\"function\"===a||r.isWindow(e)?!1:1===e.nodeType&&t?!0:\"array\"===a||0===t||\"number\"==typeof t&&t>0&&t-1 in e}if(!e.jQuery){var r=function(e,t){return new r.fn.init(e,t)};r.isWindow=function(e){return null!=e&&e==e.window},r.type=function(e){return null==e?e+\"\":\"object\"==typeof e||\"function\"==typeof e?n[i.call(e)]||\"object\":typeof e},r.isArray=Array.isArray||function(e){return\"array\"===r.type(e)},r.isPlainObject=function(e){var t;if(!e||\"object\"!==r.type(e)||e.nodeType||r.isWindow(e))return!1;try{if(e.constructor&&!o.call(e,\"constructor\")&&!o.call(e.constructor.prototype,\"isPrototypeOf\"))return!1}catch(a){return!1}for(t in e);return void 0===t||o.call(e,t)},r.each=function(e,r,a){var n,o=0,i=e.length,s=t(e);if(a){if(s)for(;i>o&&(n=r.apply(e[o],a),n!==!1);o++);else for(o in e)if(n=r.apply(e[o],a),n===!1)break}else if(s)for(;i>o&&(n=r.call(e[o],o,e[o]),n!==!1);o++);else for(o in e)if(n=r.call(e[o],o,e[o]),n===!1)break;return e},r.data=function(e,t,n){if(void 0===n){var o=e[r.expando],i=o&&a[o];if(void 0===t)return i;if(i&&t in i)return i[t]}else if(void 0!==t){var o=e[r.expando]||(e[r.expando]=++r.uuid);return a[o]=a[o]||{},a[o][t]=n,n}},r.removeData=function(e,t){var n=e[r.expando],o=n&&a[n];o&&r.each(t,function(e,t){delete o[t]})},r.extend=function(){var e,t,a,n,o,i,s=arguments[0]||{},l=1,u=arguments.length,c=!1;for(\"boolean\"==typeof s&&(c=s,s=arguments[l]||{},l++),\"object\"!=typeof s&&\"function\"!==r.type(s)&&(s={}),l===u&&(s=this,l--);u>l;l++)if(null!=(o=arguments[l]))for(n in o)e=s[n],a=o[n],s!==a&&(c&&a&&(r.isPlainObject(a)||(t=r.isArray(a)))?(t?(t=!1,i=e&&r.isArray(e)?e:[]):i=e&&r.isPlainObject(e)?e:{},s[n]=r.extend(c,i,a)):void 0!==a&&(s[n]=a));return s},r.queue=function(e,a,n){function o(e,r){var a=r||[];return null!=e&&(t(Object(e))?!function(e,t){for(var r=+t.length,a=0,n=e.length;r>a;)e[n++]=t[a++];if(r!==r)for(;void 0!==t[a];)e[n++]=t[a++];return e.length=n,e}(a,\"string\"==typeof e?[e]:e):[].push.call(a,e)),a}if(e){a=(a||\"fx\")+\"queue\";var i=r.data(e,a);return n?(!i||r.isArray(n)?i=r.data(e,a,o(n)):i.push(n),i):i||[]}},r.dequeue=function(e,t){r.each(e.nodeType?[e]:e,function(e,a){t=t||\"fx\";var n=r.queue(a,t),o=n.shift();\"inprogress\"===o&&(o=n.shift()),o&&(\"fx\"===t&&n.unshift(\"inprogress\"),o.call(a,function(){r.dequeue(a,t)}))})},r.fn=r.prototype={init:function(e){if(e.nodeType)return this[0]=e,this;throw new Error(\"Not a DOM node.\")},offset:function(){var t=this[0].getBoundingClientRect?this[0].getBoundingClientRect():{top:0,left:0};return{top:t.top+(e.pageYOffset||document.scrollTop||0)-(document.clientTop||0),left:t.left+(e.pageXOffset||document.scrollLeft||0)-(document.clientLeft||0)}},position:function(){function e(){for(var e=this.offsetParent||document;e&&\"html\"===!e.nodeType.toLowerCase&&\"static\"===e.style.position;)e=e.offsetParent;return e||document}var t=this[0],e=e.apply(t),a=this.offset(),n=/^(?:body|html)$/i.test(e.nodeName)?{top:0,left:0}:r(e).offset();return a.top-=parseFloat(t.style.marginTop)||0,a.left-=parseFloat(t.style.marginLeft)||0,e.style&&(n.top+=parseFloat(e.style.borderTopWidth)||0,n.left+=parseFloat(e.style.borderLeftWidth)||0),{top:a.top-n.top,left:a.left-n.left}}};var a={};r.expando=\"velocity\"+(new Date).getTime(),r.uuid=0;for(var n={},o=n.hasOwnProperty,i=n.toString,s=\"Boolean Number String Function Array Date RegExp Object Error\".split(\" \"),l=0;l<s.length;l++)n[\"[object \"+s[l]+\"]\"]=s[l].toLowerCase();r.fn.init.prototype=r.fn,e.Velocity={Utilities:r}}}(window),function(e){\"object\"==typeof module&&\"object\"==typeof module.exports?module.exports=e():\"function\"==typeof define&&define.amd?define(e):e()}(function(){return function(e,t,r,a){function n(e){for(var t=-1,r=e?e.length:0,a=[];++t<r;){var n=e[t];n&&a.push(n)}return a}function o(e){return m.isWrapped(e)?e=[].slice.call(e):m.isNode(e)&&(e=[e]),e}function i(e){var t=f.data(e,\"velocity\");return null===t?a:t}function s(e){return function(t){return Math.round(t*e)*(1/e)}}function l(e,r,a,n){function o(e,t){return 1-3*t+3*e}function i(e,t){return 3*t-6*e}function s(e){return 3*e}function l(e,t,r){return((o(t,r)*e+i(t,r))*e+s(t))*e}function u(e,t,r){return 3*o(t,r)*e*e+2*i(t,r)*e+s(t)}function c(t,r){for(var n=0;m>n;++n){var o=u(r,e,a);if(0===o)return r;var i=l(r,e,a)-t;r-=i/o}return r}function p(){for(var t=0;b>t;++t)w[t]=l(t*x,e,a)}function f(t,r,n){var o,i,s=0;do i=r+(n-r)/2,o=l(i,e,a)-t,o>0?n=i:r=i;while(Math.abs(o)>h&&++s<v);return i}function d(t){for(var r=0,n=1,o=b-1;n!=o&&w[n]<=t;++n)r+=x;--n;var i=(t-w[n])/(w[n+1]-w[n]),s=r+i*x,l=u(s,e,a);return l>=y?c(t,s):0==l?s:f(t,r,r+x)}function g(){V=!0,(e!=r||a!=n)&&p()}var m=4,y=.001,h=1e-7,v=10,b=11,x=1/(b-1),S=\"Float32Array\"in t;if(4!==arguments.length)return!1;for(var P=0;4>P;++P)if(\"number\"!=typeof arguments[P]||isNaN(arguments[P])||!isFinite(arguments[P]))return!1;e=Math.min(e,1),a=Math.min(a,1),e=Math.max(e,0),a=Math.max(a,0);var w=S?new Float32Array(b):new Array(b),V=!1,C=function(t){return V||g(),e===r&&a===n?t:0===t?0:1===t?1:l(d(t),r,n)};C.getControlPoints=function(){return[{x:e,y:r},{x:a,y:n}]};var T=\"generateBezier(\"+[e,r,a,n]+\")\";return C.toString=function(){return T},C}function u(e,t){var r=e;return m.isString(e)?b.Easings[e]||(r=!1):r=m.isArray(e)&&1===e.length?s.apply(null,e):m.isArray(e)&&2===e.length?x.apply(null,e.concat([t])):m.isArray(e)&&4===e.length?l.apply(null,e):!1,r===!1&&(r=b.Easings[b.defaults.easing]?b.defaults.easing:v),r}function c(e){if(e){var t=(new Date).getTime(),r=b.State.calls.length;r>1e4&&(b.State.calls=n(b.State.calls));for(var o=0;r>o;o++)if(b.State.calls[o]){var s=b.State.calls[o],l=s[0],u=s[2],d=s[3],g=!!d,y=null;d||(d=b.State.calls[o][3]=t-16);for(var h=Math.min((t-d)/u.duration,1),v=0,x=l.length;x>v;v++){var P=l[v],V=P.element;if(i(V)){var C=!1;if(u.display!==a&&null!==u.display&&\"none\"!==u.display){if(\"flex\"===u.display){var T=[\"-webkit-box\",\"-moz-box\",\"-ms-flexbox\",\"-webkit-flex\"];f.each(T,function(e,t){S.setPropertyValue(V,\"display\",t)})}S.setPropertyValue(V,\"display\",u.display)}u.visibility!==a&&\"hidden\"!==u.visibility&&S.setPropertyValue(V,\"visibility\",u.visibility);for(var k in P)if(\"element\"!==k){var A,F=P[k],j=m.isString(F.easing)?b.Easings[F.easing]:F.easing;if(1===h)A=F.endValue;else{var E=F.endValue-F.startValue;if(A=F.startValue+E*j(h,u,E),!g&&A===F.currentValue)continue}if(F.currentValue=A,\"tween\"===k)y=A;else{if(S.Hooks.registered[k]){var H=S.Hooks.getRoot(k),N=i(V).rootPropertyValueCache[H];N&&(F.rootPropertyValue=N)}var L=S.setPropertyValue(V,k,F.currentValue+(0===parseFloat(A)?\"\":F.unitType),F.rootPropertyValue,F.scrollData);S.Hooks.registered[k]&&(i(V).rootPropertyValueCache[H]=S.Normalizations.registered[H]?S.Normalizations.registered[H](\"extract\",null,L[1]):L[1]),\"transform\"===L[0]&&(C=!0)}}u.mobileHA&&i(V).transformCache.translate3d===a&&(i(V).transformCache.translate3d=\"(0px, 0px, 0px)\",C=!0),C&&S.flushTransformCache(V)}}u.display!==a&&\"none\"!==u.display&&(b.State.calls[o][2].display=!1),u.visibility!==a&&\"hidden\"!==u.visibility&&(b.State.calls[o][2].visibility=!1),u.progress&&u.progress.call(s[1],s[1],h,Math.max(0,d+u.duration-t),d,y),1===h&&p(o)}}b.State.isTicking&&w(c)}function p(e,t){if(!b.State.calls[e])return!1;for(var r=b.State.calls[e][0],n=b.State.calls[e][1],o=b.State.calls[e][2],s=b.State.calls[e][4],l=!1,u=0,c=r.length;c>u;u++){var p=r[u].element;if(t||o.loop||(\"none\"===o.display&&S.setPropertyValue(p,\"display\",o.display),\"hidden\"===o.visibility&&S.setPropertyValue(p,\"visibility\",o.visibility)),o.loop!==!0&&(f.queue(p)[1]===a||!/\\.velocityQueueEntryFlag/i.test(f.queue(p)[1]))&&i(p)){i(p).isAnimating=!1,i(p).rootPropertyValueCache={};var d=!1;f.each(S.Lists.transforms3D,function(e,t){var r=/^scale/.test(t)?1:0,n=i(p).transformCache[t];i(p).transformCache[t]!==a&&new RegExp(\"^\\\\(\"+r+\"[^.]\").test(n)&&(d=!0,delete i(p).transformCache[t])}),o.mobileHA&&(d=!0,delete i(p).transformCache.translate3d),d&&S.flushTransformCache(p),S.Values.removeClass(p,\"velocity-animating\")}if(!t&&o.complete&&!o.loop&&u===c-1)try{o.complete.call(n,n)}catch(g){setTimeout(function(){throw g},1)}s&&o.loop!==!0&&s(n),i(p)&&o.loop===!0&&!t&&(f.each(i(p).tweensContainer,function(e,t){/^rotate/.test(e)&&360===parseFloat(t.endValue)&&(t.endValue=0,t.startValue=360),/^backgroundPosition/.test(e)&&100===parseFloat(t.endValue)&&\"%\"===t.unitType&&(t.endValue=0,t.startValue=100)}),b(p,\"reverse\",{loop:!0,delay:o.delay})),o.queue!==!1&&f.dequeue(p,o.queue)}b.State.calls[e]=!1;for(var m=0,y=b.State.calls.length;y>m;m++)if(b.State.calls[m]!==!1){l=!0;break}l===!1&&(b.State.isTicking=!1,delete b.State.calls,b.State.calls=[])}var f,d=function(){if(r.documentMode)return r.documentMode;for(var e=7;e>4;e--){var t=r.createElement(\"div\");if(t.innerHTML=\"<!--[if IE \"+e+\"]><span></span><![endif]-->\",t.getElementsByTagName(\"span\").length)return t=null,e}return a}(),g=function(){var e=0;return t.webkitRequestAnimationFrame||t.mozRequestAnimationFrame||function(t){var r,a=(new Date).getTime();return r=Math.max(0,16-(a-e)),e=a+r,setTimeout(function(){t(a+r)},r)}}(),m={isString:function(e){return\"string\"==typeof e},isArray:Array.isArray||function(e){return\"[object Array]\"===Object.prototype.toString.call(e)},isFunction:function(e){return\"[object Function]\"===Object.prototype.toString.call(e)},isNode:function(e){return e&&e.nodeType},isNodeList:function(e){return\"object\"==typeof e&&/^\\[object (HTMLCollection|NodeList|Object)\\]$/.test(Object.prototype.toString.call(e))&&e.length!==a&&(0===e.length||\"object\"==typeof e[0]&&e[0].nodeType>0)},isWrapped:function(e){return e&&(e.jquery||t.Zepto&&t.Zepto.zepto.isZ(e))},isSVG:function(e){return t.SVGElement&&e instanceof t.SVGElement},isEmptyObject:function(e){for(var t in e)return!1;return!0}},y=!1;if(e.fn&&e.fn.jquery?(f=e,y=!0):f=t.Velocity.Utilities,8>=d&&!y)throw new Error(\"Velocity: IE8 and below require jQuery to be loaded before Velocity.\");if(7>=d)return void(jQuery.fn.velocity=jQuery.fn.animate);var h=400,v=\"swing\",b={State:{isMobile:/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent),isAndroid:/Android/i.test(navigator.userAgent),isGingerbread:/Android 2\\.3\\.[3-7]/i.test(navigator.userAgent),isChrome:t.chrome,isFirefox:/Firefox/i.test(navigator.userAgent),prefixElement:r.createElement(\"div\"),prefixMatches:{},scrollAnchor:null,scrollPropertyLeft:null,scrollPropertyTop:null,isTicking:!1,calls:[]},CSS:{},Utilities:f,Redirects:{},Easings:{},Promise:t.Promise,defaults:{queue:\"\",duration:h,easing:v,begin:a,complete:a,progress:a,display:a,visibility:a,loop:!1,delay:!1,mobileHA:!0,_cacheValues:!0},init:function(e){f.data(e,\"velocity\",{isSVG:m.isSVG(e),isAnimating:!1,computedStyle:null,tweensContainer:null,rootPropertyValueCache:{},transformCache:{}})},hook:null,mock:!1,version:{major:1,minor:2,patch:2},debug:!1};t.pageYOffset!==a?(b.State.scrollAnchor=t,b.State.scrollPropertyLeft=\"pageXOffset\",b.State.scrollPropertyTop=\"pageYOffset\"):(b.State.scrollAnchor=r.documentElement||r.body.parentNode||r.body,b.State.scrollPropertyLeft=\"scrollLeft\",b.State.scrollPropertyTop=\"scrollTop\");var x=function(){function e(e){return-e.tension*e.x-e.friction*e.v}function t(t,r,a){var n={x:t.x+a.dx*r,v:t.v+a.dv*r,tension:t.tension,friction:t.friction};return{dx:n.v,dv:e(n)}}function r(r,a){var n={dx:r.v,dv:e(r)},o=t(r,.5*a,n),i=t(r,.5*a,o),s=t(r,a,i),l=1/6*(n.dx+2*(o.dx+i.dx)+s.dx),u=1/6*(n.dv+2*(o.dv+i.dv)+s.dv);return r.x=r.x+l*a,r.v=r.v+u*a,r}return function a(e,t,n){var o,i,s,l={x:-1,v:0,tension:null,friction:null},u=[0],c=0,p=1e-4,f=.016;for(e=parseFloat(e)||500,t=parseFloat(t)||20,n=n||null,l.tension=e,l.friction=t,o=null!==n,o?(c=a(e,t),i=c/n*f):i=f;s=r(s||l,i),u.push(1+s.x),c+=16,Math.abs(s.x)>p&&Math.abs(s.v)>p;);return o?function(e){return u[e*(u.length-1)|0]}:c}}();b.Easings={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2},spring:function(e){return 1-Math.cos(4.5*e*Math.PI)*Math.exp(6*-e)}},f.each([[\"ease\",[.25,.1,.25,1]],[\"ease-in\",[.42,0,1,1]],[\"ease-out\",[0,0,.58,1]],[\"ease-in-out\",[.42,0,.58,1]],[\"easeInSine\",[.47,0,.745,.715]],[\"easeOutSine\",[.39,.575,.565,1]],[\"easeInOutSine\",[.445,.05,.55,.95]],[\"easeInQuad\",[.55,.085,.68,.53]],[\"easeOutQuad\",[.25,.46,.45,.94]],[\"easeInOutQuad\",[.455,.03,.515,.955]],[\"easeInCubic\",[.55,.055,.675,.19]],[\"easeOutCubic\",[.215,.61,.355,1]],[\"easeInOutCubic\",[.645,.045,.355,1]],[\"easeInQuart\",[.895,.03,.685,.22]],[\"easeOutQuart\",[.165,.84,.44,1]],[\"easeInOutQuart\",[.77,0,.175,1]],[\"easeInQuint\",[.755,.05,.855,.06]],[\"easeOutQuint\",[.23,1,.32,1]],[\"easeInOutQuint\",[.86,0,.07,1]],[\"easeInExpo\",[.95,.05,.795,.035]],[\"easeOutExpo\",[.19,1,.22,1]],[\"easeInOutExpo\",[1,0,0,1]],[\"easeInCirc\",[.6,.04,.98,.335]],[\"easeOutCirc\",[.075,.82,.165,1]],[\"easeInOutCirc\",[.785,.135,.15,.86]]],function(e,t){b.Easings[t[0]]=l.apply(null,t[1])});var S=b.CSS={RegEx:{isHex:/^#([A-f\\d]{3}){1,2}$/i,valueUnwrap:/^[A-z]+\\((.*)\\)$/i,wrappedValueAlreadyExtracted:/[0-9.]+ [0-9.]+ [0-9.]+( [0-9.]+)?/,valueSplit:/([A-z]+\\(.+\\))|(([A-z0-9#-.]+?)(?=\\s|$))/gi},Lists:{colors:[\"fill\",\"stroke\",\"stopColor\",\"color\",\"backgroundColor\",\"borderColor\",\"borderTopColor\",\"borderRightColor\",\"borderBottomColor\",\"borderLeftColor\",\"outlineColor\"],transformsBase:[\"translateX\",\"translateY\",\"scale\",\"scaleX\",\"scaleY\",\"skewX\",\"skewY\",\"rotateZ\"],transforms3D:[\"transformPerspective\",\"translateZ\",\"scaleZ\",\"rotateX\",\"rotateY\"]},Hooks:{templates:{textShadow:[\"Color X Y Blur\",\"black 0px 0px 0px\"],boxShadow:[\"Color X Y Blur Spread\",\"black 0px 0px 0px 0px\"],clip:[\"Top Right Bottom Left\",\"0px 0px 0px 0px\"],backgroundPosition:[\"X Y\",\"0% 0%\"],transformOrigin:[\"X Y Z\",\"50% 50% 0px\"],perspectiveOrigin:[\"X Y\",\"50% 50%\"]},registered:{},register:function(){for(var e=0;e<S.Lists.colors.length;e++){var t=\"color\"===S.Lists.colors[e]?\"0 0 0 1\":\"255 255 255 1\";S.Hooks.templates[S.Lists.colors[e]]=[\"Red Green Blue Alpha\",t]}var r,a,n;if(d)for(r in S.Hooks.templates){a=S.Hooks.templates[r],n=a[0].split(\" \");var o=a[1].match(S.RegEx.valueSplit);\"Color\"===n[0]&&(n.push(n.shift()),o.push(o.shift()),S.Hooks.templates[r]=[n.join(\" \"),o.join(\" \")])}for(r in S.Hooks.templates){a=S.Hooks.templates[r],n=a[0].split(\" \");for(var e in n){var i=r+n[e],s=e;S.Hooks.registered[i]=[r,s]}}},getRoot:function(e){var t=S.Hooks.registered[e];return t?t[0]:e},cleanRootPropertyValue:function(e,t){return S.RegEx.valueUnwrap.test(t)&&(t=t.match(S.RegEx.valueUnwrap)[1]),S.Values.isCSSNullValue(t)&&(t=S.Hooks.templates[e][1]),t},extractValue:function(e,t){var r=S.Hooks.registered[e];if(r){var a=r[0],n=r[1];return t=S.Hooks.cleanRootPropertyValue(a,t),t.toString().match(S.RegEx.valueSplit)[n]}return t},injectValue:function(e,t,r){var a=S.Hooks.registered[e];if(a){var n,o,i=a[0],s=a[1];return r=S.Hooks.cleanRootPropertyValue(i,r),n=r.toString().match(S.RegEx.valueSplit),n[s]=t,o=n.join(\" \")}return r}},Normalizations:{registered:{clip:function(e,t,r){switch(e){case\"name\":return\"clip\";case\"extract\":var a;return S.RegEx.wrappedValueAlreadyExtracted.test(r)?a=r:(a=r.toString().match(S.RegEx.valueUnwrap),a=a?a[1].replace(/,(\\s+)?/g,\" \"):r),a;case\"inject\":return\"rect(\"+r+\")\"}},blur:function(e,t,r){switch(e){case\"name\":return b.State.isFirefox?\"filter\":\"-webkit-filter\";case\"extract\":var a=parseFloat(r);if(!a&&0!==a){var n=r.toString().match(/blur\\(([0-9]+[A-z]+)\\)/i);a=n?n[1]:0}return a;case\"inject\":return parseFloat(r)?\"blur(\"+r+\")\":\"none\"}},opacity:function(e,t,r){if(8>=d)switch(e){case\"name\":return\"filter\";case\"extract\":var a=r.toString().match(/alpha\\(opacity=(.*)\\)/i);return r=a?a[1]/100:1;case\"inject\":return t.style.zoom=1,parseFloat(r)>=1?\"\":\"alpha(opacity=\"+parseInt(100*parseFloat(r),10)+\")\"}else switch(e){case\"name\":return\"opacity\";case\"extract\":return r;case\"inject\":return r}}},register:function(){9>=d||b.State.isGingerbread||(S.Lists.transformsBase=S.Lists.transformsBase.concat(S.Lists.transforms3D));for(var e=0;e<S.Lists.transformsBase.length;e++)!function(){var t=S.Lists.transformsBase[e];S.Normalizations.registered[t]=function(e,r,n){switch(e){case\"name\":return\"transform\";case\"extract\":return i(r)===a||i(r).transformCache[t]===a?/^scale/i.test(t)?1:0:i(r).transformCache[t].replace(/[()]/g,\"\");case\"inject\":var o=!1;switch(t.substr(0,t.length-1)){case\"translate\":o=!/(%|px|em|rem|vw|vh|\\d)$/i.test(n);break;case\"scal\":case\"scale\":b.State.isAndroid&&i(r).transformCache[t]===a&&1>n&&(n=1),o=!/(\\d)$/i.test(n);break;case\"skew\":o=!/(deg|\\d)$/i.test(n);break;case\"rotate\":o=!/(deg|\\d)$/i.test(n)}return o||(i(r).transformCache[t]=\"(\"+n+\")\"),i(r).transformCache[t]}}}();for(var e=0;e<S.Lists.colors.length;e++)!function(){var t=S.Lists.colors[e];S.Normalizations.registered[t]=function(e,r,n){switch(e){case\"name\":return t;case\"extract\":var o;if(S.RegEx.wrappedValueAlreadyExtracted.test(n))o=n;else{var i,s={black:\"rgb(0, 0, 0)\",blue:\"rgb(0, 0, 255)\",gray:\"rgb(128, 128, 128)\",green:\"rgb(0, 128, 0)\",red:\"rgb(255, 0, 0)\",white:\"rgb(255, 255, 255)\"};/^[A-z]+$/i.test(n)?i=s[n]!==a?s[n]:s.black:S.RegEx.isHex.test(n)?i=\"rgb(\"+S.Values.hexToRgb(n).join(\" \")+\")\":/^rgba?\\(/i.test(n)||(i=s.black),o=(i||n).toString().match(S.RegEx.valueUnwrap)[1].replace(/,(\\s+)?/g,\" \")}return 8>=d||3!==o.split(\" \").length||(o+=\" 1\"),o;case\"inject\":return 8>=d?4===n.split(\" \").length&&(n=n.split(/\\s+/).slice(0,3).join(\" \")):3===n.split(\" \").length&&(n+=\" 1\"),(8>=d?\"rgb\":\"rgba\")+\"(\"+n.replace(/\\s+/g,\",\").replace(/\\.(\\d)+(?=,)/g,\"\")+\")\"}}}()}},Names:{camelCase:function(e){return e.replace(/-(\\w)/g,function(e,t){return t.toUpperCase()})},SVGAttribute:function(e){var t=\"width|height|x|y|cx|cy|r|rx|ry|x1|x2|y1|y2\";return(d||b.State.isAndroid&&!b.State.isChrome)&&(t+=\"|transform\"),new RegExp(\"^(\"+t+\")$\",\"i\").test(e)},prefixCheck:function(e){if(b.State.prefixMatches[e])return[b.State.prefixMatches[e],!0];for(var t=[\"\",\"Webkit\",\"Moz\",\"ms\",\"O\"],r=0,a=t.length;a>r;r++){var n;if(n=0===r?e:t[r]+e.replace(/^\\w/,function(e){return e.toUpperCase()}),m.isString(b.State.prefixElement.style[n]))return b.State.prefixMatches[e]=n,[n,!0]}return[e,!1]}},Values:{hexToRgb:function(e){var t,r=/^#?([a-f\\d])([a-f\\d])([a-f\\d])$/i,a=/^#?([a-f\\d]{2})([a-f\\d]{2})([a-f\\d]{2})$/i;return e=e.replace(r,function(e,t,r,a){return t+t+r+r+a+a}),t=a.exec(e),t?[parseInt(t[1],16),parseInt(t[2],16),parseInt(t[3],16)]:[0,0,0]},isCSSNullValue:function(e){return 0==e||/^(none|auto|transparent|(rgba\\(0, ?0, ?0, ?0\\)))$/i.test(e)},getUnitType:function(e){return/^(rotate|skew)/i.test(e)?\"deg\":/(^(scale|scaleX|scaleY|scaleZ|alpha|flexGrow|flexHeight|zIndex|fontWeight)$)|((opacity|red|green|blue|alpha)$)/i.test(e)?\"\":\"px\"},getDisplayType:function(e){var t=e&&e.tagName.toString().toLowerCase();return/^(b|big|i|small|tt|abbr|acronym|cite|code|dfn|em|kbd|strong|samp|var|a|bdo|br|img|map|object|q|script|span|sub|sup|button|input|label|select|textarea)$/i.test(t)?\"inline\":/^(li)$/i.test(t)?\"list-item\":/^(tr)$/i.test(t)?\"table-row\":/^(table)$/i.test(t)?\"table\":/^(tbody)$/i.test(t)?\"table-row-group\":\"block\"},addClass:function(e,t){e.classList?e.classList.add(t):e.className+=(e.className.length?\" \":\"\")+t},removeClass:function(e,t){e.classList?e.classList.remove(t):e.className=e.className.toString().replace(new RegExp(\"(^|\\\\s)\"+t.split(\" \").join(\"|\")+\"(\\\\s|$)\",\"gi\"),\" \")}},getPropertyValue:function(e,r,n,o){function s(e,r){function n(){u&&S.setPropertyValue(e,\"display\",\"none\")}var l=0;if(8>=d)l=f.css(e,r);else{var u=!1;if(/^(width|height)$/.test(r)&&0===S.getPropertyValue(e,\"display\")&&(u=!0,S.setPropertyValue(e,\"display\",S.Values.getDisplayType(e))),!o){if(\"height\"===r&&\"border-box\"!==S.getPropertyValue(e,\"boxSizing\").toString().toLowerCase()){var c=e.offsetHeight-(parseFloat(S.getPropertyValue(e,\"borderTopWidth\"))||0)-(parseFloat(S.getPropertyValue(e,\"borderBottomWidth\"))||0)-(parseFloat(S.getPropertyValue(e,\"paddingTop\"))||0)-(parseFloat(S.getPropertyValue(e,\"paddingBottom\"))||0);return n(),c}if(\"width\"===r&&\"border-box\"!==S.getPropertyValue(e,\"boxSizing\").toString().toLowerCase()){var p=e.offsetWidth-(parseFloat(S.getPropertyValue(e,\"borderLeftWidth\"))||0)-(parseFloat(S.getPropertyValue(e,\"borderRightWidth\"))||0)-(parseFloat(S.getPropertyValue(e,\"paddingLeft\"))||0)-(parseFloat(S.getPropertyValue(e,\"paddingRight\"))||0);return n(),p}}var g;g=i(e)===a?t.getComputedStyle(e,null):i(e).computedStyle?i(e).computedStyle:i(e).computedStyle=t.getComputedStyle(e,null),\"borderColor\"===r&&(r=\"borderTopColor\"),l=9===d&&\"filter\"===r?g.getPropertyValue(r):g[r],(\"\"===l||null===l)&&(l=e.style[r]),n()}if(\"auto\"===l&&/^(top|right|bottom|left)$/i.test(r)){var m=s(e,\"position\");(\"fixed\"===m||\"absolute\"===m&&/top|left/i.test(r))&&(l=f(e).position()[r]+\"px\")}return l}var l;if(S.Hooks.registered[r]){var u=r,c=S.Hooks.getRoot(u);n===a&&(n=S.getPropertyValue(e,S.Names.prefixCheck(c)[0])),S.Normalizations.registered[c]&&(n=S.Normalizations.registered[c](\"extract\",e,n)),l=S.Hooks.extractValue(u,n)}else if(S.Normalizations.registered[r]){var p,g;p=S.Normalizations.registered[r](\"name\",e),\"transform\"!==p&&(g=s(e,S.Names.prefixCheck(p)[0]),S.Values.isCSSNullValue(g)&&S.Hooks.templates[r]&&(g=S.Hooks.templates[r][1])),l=S.Normalizations.registered[r](\"extract\",e,g)}if(!/^[\\d-]/.test(l))if(i(e)&&i(e).isSVG&&S.Names.SVGAttribute(r))if(/^(height|width)$/i.test(r))try{l=e.getBBox()[r]}catch(m){l=0}else l=e.getAttribute(r);else l=s(e,S.Names.prefixCheck(r)[0]);return S.Values.isCSSNullValue(l)&&(l=0),b.debug>=2&&console.log(\"Get \"+r+\": \"+l),l},setPropertyValue:function(e,r,a,n,o){var s=r;if(\"scroll\"===r)o.container?o.container[\"scroll\"+o.direction]=a:\"Left\"===o.direction?t.scrollTo(a,o.alternateValue):t.scrollTo(o.alternateValue,a);else if(S.Normalizations.registered[r]&&\"transform\"===S.Normalizations.registered[r](\"name\",e))S.Normalizations.registered[r](\"inject\",e,a),s=\"transform\",a=i(e).transformCache[r];else{if(S.Hooks.registered[r]){var l=r,u=S.Hooks.getRoot(r);n=n||S.getPropertyValue(e,u),a=S.Hooks.injectValue(l,a,n),r=u}if(S.Normalizations.registered[r]&&(a=S.Normalizations.registered[r](\"inject\",e,a),r=S.Normalizations.registered[r](\"name\",e)),s=S.Names.prefixCheck(r)[0],8>=d)try{e.style[s]=a}catch(c){b.debug&&console.log(\"Browser does not support [\"+a+\"] for [\"+s+\"]\")}else i(e)&&i(e).isSVG&&S.Names.SVGAttribute(r)?e.setAttribute(r,a):e.style[s]=a;b.debug>=2&&console.log(\"Set \"+r+\" (\"+s+\"): \"+a)}return[s,a]},flushTransformCache:function(e){function t(t){return parseFloat(S.getPropertyValue(e,t))}var r=\"\";if((d||b.State.isAndroid&&!b.State.isChrome)&&i(e).isSVG){var a={translate:[t(\"translateX\"),t(\"translateY\")],skewX:[t(\"skewX\")],skewY:[t(\"skewY\")],scale:1!==t(\"scale\")?[t(\"scale\"),t(\"scale\")]:[t(\"scaleX\"),t(\"scaleY\")],rotate:[t(\"rotateZ\"),0,0]};f.each(i(e).transformCache,function(e){/^translate/i.test(e)?e=\"translate\":/^scale/i.test(e)?e=\"scale\":/^rotate/i.test(e)&&(e=\"rotate\"),a[e]&&(r+=e+\"(\"+a[e].join(\" \")+\") \",delete a[e])})}else{var n,o;f.each(i(e).transformCache,function(t){return n=i(e).transformCache[t],\"transformPerspective\"===t?(o=n,!0):(9===d&&\"rotateZ\"===t&&(t=\"rotate\"),void(r+=t+n+\" \"))}),o&&(r=\"perspective\"+o+\" \"+r)}S.setPropertyValue(e,\"transform\",r)}};S.Hooks.register(),S.Normalizations.register(),b.hook=function(e,t,r){var n=a;return e=o(e),f.each(e,function(e,o){if(i(o)===a&&b.init(o),r===a)n===a&&(n=b.CSS.getPropertyValue(o,t));else{var s=b.CSS.setPropertyValue(o,t,r);\"transform\"===s[0]&&b.CSS.flushTransformCache(o),n=s}}),n};var P=function(){function e(){return s?k.promise||null:l}function n(){function e(e){function p(e,t){var r=a,n=a,i=a;return m.isArray(e)?(r=e[0],!m.isArray(e[1])&&/^[\\d-]/.test(e[1])||m.isFunction(e[1])||S.RegEx.isHex.test(e[1])?i=e[1]:(m.isString(e[1])&&!S.RegEx.isHex.test(e[1])||m.isArray(e[1]))&&(n=t?e[1]:u(e[1],s.duration),e[2]!==a&&(i=e[2]))):r=e,t||(n=n||s.easing),m.isFunction(r)&&(r=r.call(o,V,w)),m.isFunction(i)&&(i=i.call(o,V,w)),[r||0,n,i]}function d(e,t){var r,a;return a=(t||\"0\").toString().toLowerCase().replace(/[%A-z]+$/,function(e){return r=e,\"\"}),r||(r=S.Values.getUnitType(e)),[a,r]}function h(){var e={myParent:o.parentNode||r.body,position:S.getPropertyValue(o,\"position\"),fontSize:S.getPropertyValue(o,\"fontSize\")},a=e.position===L.lastPosition&&e.myParent===L.lastParent,n=e.fontSize===L.lastFontSize;L.lastParent=e.myParent,L.lastPosition=e.position,L.lastFontSize=e.fontSize;var s=100,l={};if(n&&a)l.emToPx=L.lastEmToPx,l.percentToPxWidth=L.lastPercentToPxWidth,l.percentToPxHeight=L.lastPercentToPxHeight;else{var u=i(o).isSVG?r.createElementNS(\"http://www.w3.org/2000/svg\",\"rect\"):r.createElement(\"div\");b.init(u),e.myParent.appendChild(u),f.each([\"overflow\",\"overflowX\",\"overflowY\"],function(e,t){b.CSS.setPropertyValue(u,t,\"hidden\")}),b.CSS.setPropertyValue(u,\"position\",e.position),b.CSS.setPropertyValue(u,\"fontSize\",e.fontSize),b.CSS.setPropertyValue(u,\"boxSizing\",\"content-box\"),f.each([\"minWidth\",\"maxWidth\",\"width\",\"minHeight\",\"maxHeight\",\"height\"],function(e,t){b.CSS.setPropertyValue(u,t,s+\"%\")}),b.CSS.setPropertyValue(u,\"paddingLeft\",s+\"em\"),l.percentToPxWidth=L.lastPercentToPxWidth=(parseFloat(S.getPropertyValue(u,\"width\",null,!0))||1)/s,l.percentToPxHeight=L.lastPercentToPxHeight=(parseFloat(S.getPropertyValue(u,\"height\",null,!0))||1)/s,l.emToPx=L.lastEmToPx=(parseFloat(S.getPropertyValue(u,\"paddingLeft\"))||1)/s,e.myParent.removeChild(u)}return null===L.remToPx&&(L.remToPx=parseFloat(S.getPropertyValue(r.body,\"fontSize\"))||16),null===L.vwToPx&&(L.vwToPx=parseFloat(t.innerWidth)/100,L.vhToPx=parseFloat(t.innerHeight)/100),l.remToPx=L.remToPx,l.vwToPx=L.vwToPx,l.vhToPx=L.vhToPx,b.debug>=1&&console.log(\"Unit ratios: \"+JSON.stringify(l),o),l}if(s.begin&&0===V)try{s.begin.call(g,g)}catch(x){setTimeout(function(){throw x},1)}if(\"scroll\"===A){var P,C,T,F=/^x$/i.test(s.axis)?\"Left\":\"Top\",j=parseFloat(s.offset)||0;s.container?m.isWrapped(s.container)||m.isNode(s.container)?(s.container=s.container[0]||s.container,P=s.container[\"scroll\"+F],T=P+f(o).position()[F.toLowerCase()]+j):s.container=null:(P=b.State.scrollAnchor[b.State[\"scrollProperty\"+F]],C=b.State.scrollAnchor[b.State[\"scrollProperty\"+(\"Left\"===F?\"Top\":\"Left\")]],T=f(o).offset()[F.toLowerCase()]+j),l={scroll:{rootPropertyValue:!1,startValue:P,currentValue:P,endValue:T,unitType:\"\",easing:s.easing,scrollData:{container:s.container,direction:F,alternateValue:C}},element:o},b.debug&&console.log(\"tweensContainer (scroll): \",l.scroll,o)}else if(\"reverse\"===A){if(!i(o).tweensContainer)return void f.dequeue(o,s.queue);\"none\"===i(o).opts.display&&(i(o).opts.display=\"auto\"),\"hidden\"===i(o).opts.visibility&&(i(o).opts.visibility=\"visible\"),i(o).opts.loop=!1,i(o).opts.begin=null,i(o).opts.complete=null,v.easing||delete s.easing,v.duration||delete s.duration,s=f.extend({},i(o).opts,s);var E=f.extend(!0,{},i(o).tweensContainer);for(var H in E)if(\"element\"!==H){var N=E[H].startValue;E[H].startValue=E[H].currentValue=E[H].endValue,E[H].endValue=N,m.isEmptyObject(v)||(E[H].easing=s.easing),b.debug&&console.log(\"reverse tweensContainer (\"+H+\"): \"+JSON.stringify(E[H]),o)}l=E}else if(\"start\"===A){var E;i(o).tweensContainer&&i(o).isAnimating===!0&&(E=i(o).tweensContainer),f.each(y,function(e,t){if(RegExp(\"^\"+S.Lists.colors.join(\"$|^\")+\"$\").test(e)){var r=p(t,!0),n=r[0],o=r[1],i=r[2];if(S.RegEx.isHex.test(n)){for(var s=[\"Red\",\"Green\",\"Blue\"],l=S.Values.hexToRgb(n),u=i?S.Values.hexToRgb(i):a,c=0;c<s.length;c++){var f=[l[c]];o&&f.push(o),u!==a&&f.push(u[c]),y[e+s[c]]=f}delete y[e]}}});for(var z in y){var O=p(y[z]),q=O[0],$=O[1],M=O[2];z=S.Names.camelCase(z);var I=S.Hooks.getRoot(z),B=!1;if(i(o).isSVG||\"tween\"===I||S.Names.prefixCheck(I)[1]!==!1||S.Normalizations.registered[I]!==a){(s.display!==a&&null!==s.display&&\"none\"!==s.display||s.visibility!==a&&\"hidden\"!==s.visibility)&&/opacity|filter/.test(z)&&!M&&0!==q&&(M=0),s._cacheValues&&E&&E[z]?(M===a&&(M=E[z].endValue+E[z].unitType),B=i(o).rootPropertyValueCache[I]):S.Hooks.registered[z]?M===a?(B=S.getPropertyValue(o,I),M=S.getPropertyValue(o,z,B)):B=S.Hooks.templates[I][1]:M===a&&(M=S.getPropertyValue(o,z));var W,G,Y,D=!1;if(W=d(z,M),M=W[0],Y=W[1],W=d(z,q),q=W[0].replace(/^([+-\\/*])=/,function(e,t){return D=t,\"\"}),G=W[1],M=parseFloat(M)||0,q=parseFloat(q)||0,\"%\"===G&&(/^(fontSize|lineHeight)$/.test(z)?(q/=100,G=\"em\"):/^scale/.test(z)?(q/=100,G=\"\"):/(Red|Green|Blue)$/i.test(z)&&(q=q/100*255,G=\"\")),/[\\/*]/.test(D))G=Y;else if(Y!==G&&0!==M)if(0===q)G=Y;else{n=n||h();var Q=/margin|padding|left|right|width|text|word|letter/i.test(z)||/X$/.test(z)||\"x\"===z?\"x\":\"y\";switch(Y){case\"%\":M*=\"x\"===Q?n.percentToPxWidth:n.percentToPxHeight;break;case\"px\":break;default:M*=n[Y+\"ToPx\"]}switch(G){case\"%\":M*=1/(\"x\"===Q?n.percentToPxWidth:n.percentToPxHeight);break;case\"px\":break;default:M*=1/n[G+\"ToPx\"]}}switch(D){case\"+\":q=M+q;break;case\"-\":q=M-q;break;case\"*\":q=M*q;break;case\"/\":q=M/q}l[z]={rootPropertyValue:B,startValue:M,currentValue:M,endValue:q,unitType:G,easing:$},b.debug&&console.log(\"tweensContainer (\"+z+\"): \"+JSON.stringify(l[z]),o)}else b.debug&&console.log(\"Skipping [\"+I+\"] due to a lack of browser support.\")}l.element=o}l.element&&(S.Values.addClass(o,\"velocity-animating\"),R.push(l),\"\"===s.queue&&(i(o).tweensContainer=l,i(o).opts=s),i(o).isAnimating=!0,V===w-1?(b.State.calls.push([R,g,s,null,k.resolver]),b.State.isTicking===!1&&(b.State.isTicking=!0,c())):V++)}var n,o=this,s=f.extend({},b.defaults,v),l={};switch(i(o)===a&&b.init(o),parseFloat(s.delay)&&s.queue!==!1&&f.queue(o,s.queue,function(e){b.velocityQueueEntryFlag=!0,i(o).delayTimer={setTimeout:setTimeout(e,parseFloat(s.delay)),next:e}}),s.duration.toString().toLowerCase()){case\"fast\":s.duration=200;break;case\"normal\":s.duration=h;break;case\"slow\":s.duration=600;break;default:s.duration=parseFloat(s.duration)||1}b.mock!==!1&&(b.mock===!0?s.duration=s.delay=1:(s.duration*=parseFloat(b.mock)||1,s.delay*=parseFloat(b.mock)||1)),s.easing=u(s.easing,s.duration),s.begin&&!m.isFunction(s.begin)&&(s.begin=null),s.progress&&!m.isFunction(s.progress)&&(s.progress=null),s.complete&&!m.isFunction(s.complete)&&(s.complete=null),s.display!==a&&null!==s.display&&(s.display=s.display.toString().toLowerCase(),\"auto\"===s.display&&(s.display=b.CSS.Values.getDisplayType(o))),s.visibility!==a&&null!==s.visibility&&(s.visibility=s.visibility.toString().toLowerCase()),s.mobileHA=s.mobileHA&&b.State.isMobile&&!b.State.isGingerbread,s.queue===!1?s.delay?setTimeout(e,s.delay):e():f.queue(o,s.queue,function(t,r){return r===!0?(k.promise&&k.resolver(g),!0):(b.velocityQueueEntryFlag=!0,void e(t))}),\"\"!==s.queue&&\"fx\"!==s.queue||\"inprogress\"===f.queue(o)[0]||f.dequeue(o)}var s,l,d,g,y,v,x=arguments[0]&&(arguments[0].p||f.isPlainObject(arguments[0].properties)&&!arguments[0].properties.names||m.isString(arguments[0].properties));if(m.isWrapped(this)?(s=!1,d=0,g=this,l=this):(s=!0,d=1,g=x?arguments[0].elements||arguments[0].e:arguments[0]),g=o(g)){x?(y=arguments[0].properties||arguments[0].p,v=arguments[0].options||arguments[0].o):(y=arguments[d],v=arguments[d+1]);var w=g.length,V=0;if(!/^(stop|finish)$/i.test(y)&&!f.isPlainObject(v)){var C=d+1;v={};for(var T=C;T<arguments.length;T++)m.isArray(arguments[T])||!/^(fast|normal|slow)$/i.test(arguments[T])&&!/^\\d/.test(arguments[T])?m.isString(arguments[T])||m.isArray(arguments[T])?v.easing=arguments[T]:m.isFunction(arguments[T])&&(v.complete=arguments[T]):v.duration=arguments[T]}var k={promise:null,resolver:null,rejecter:null};s&&b.Promise&&(k.promise=new b.Promise(function(e,t){k.resolver=e,k.rejecter=t}));var A;switch(y){case\"scroll\":A=\"scroll\";break;case\"reverse\":A=\"reverse\";break;case\"finish\":case\"stop\":f.each(g,function(e,t){i(t)&&i(t).delayTimer&&(clearTimeout(i(t).delayTimer.setTimeout),i(t).delayTimer.next&&i(t).delayTimer.next(),delete i(t).delayTimer)});var F=[];return f.each(b.State.calls,function(e,t){t&&f.each(t[1],function(r,n){var o=v===a?\"\":v;return o===!0||t[2].queue===o||v===a&&t[2].queue===!1?void f.each(g,function(r,a){a===n&&((v===!0||m.isString(v))&&(f.each(f.queue(a,m.isString(v)?v:\"\"),function(e,t){\nm.isFunction(t)&&t(null,!0)}),f.queue(a,m.isString(v)?v:\"\",[])),\"stop\"===y?(i(a)&&i(a).tweensContainer&&o!==!1&&f.each(i(a).tweensContainer,function(e,t){t.endValue=t.currentValue}),F.push(e)):\"finish\"===y&&(t[2].duration=1))}):!0})}),\"stop\"===y&&(f.each(F,function(e,t){p(t,!0)}),k.promise&&k.resolver(g)),e();default:if(!f.isPlainObject(y)||m.isEmptyObject(y)){if(m.isString(y)&&b.Redirects[y]){var j=f.extend({},v),E=j.duration,H=j.delay||0;return j.backwards===!0&&(g=f.extend(!0,[],g).reverse()),f.each(g,function(e,t){parseFloat(j.stagger)?j.delay=H+parseFloat(j.stagger)*e:m.isFunction(j.stagger)&&(j.delay=H+j.stagger.call(t,e,w)),j.drag&&(j.duration=parseFloat(E)||(/^(callout|transition)/.test(y)?1e3:h),j.duration=Math.max(j.duration*(j.backwards?1-e/w:(e+1)/w),.75*j.duration,200)),b.Redirects[y].call(t,t,j||{},e,w,g,k.promise?k:a)}),e()}var N=\"Velocity: First argument (\"+y+\") was not a property map, a known action, or a registered redirect. Aborting.\";return k.promise?k.rejecter(new Error(N)):console.log(N),e()}A=\"start\"}var L={lastParent:null,lastPosition:null,lastFontSize:null,lastPercentToPxWidth:null,lastPercentToPxHeight:null,lastEmToPx:null,remToPx:null,vwToPx:null,vhToPx:null},R=[];f.each(g,function(e,t){m.isNode(t)&&n.call(t)});var z,j=f.extend({},b.defaults,v);if(j.loop=parseInt(j.loop),z=2*j.loop-1,j.loop)for(var O=0;z>O;O++){var q={delay:j.delay,progress:j.progress};O===z-1&&(q.display=j.display,q.visibility=j.visibility,q.complete=j.complete),P(g,\"reverse\",q)}return e()}};b=f.extend(P,b),b.animate=P;var w=t.requestAnimationFrame||g;return b.State.isMobile||r.hidden===a||r.addEventListener(\"visibilitychange\",function(){r.hidden?(w=function(e){return setTimeout(function(){e(!0)},16)},c()):w=t.requestAnimationFrame||g}),e.Velocity=b,e!==t&&(e.fn.velocity=P,e.fn.velocity.defaults=b.defaults),f.each([\"Down\",\"Up\"],function(e,t){b.Redirects[\"slide\"+t]=function(e,r,n,o,i,s){var l=f.extend({},r),u=l.begin,c=l.complete,p={height:\"\",marginTop:\"\",marginBottom:\"\",paddingTop:\"\",paddingBottom:\"\"},d={};l.display===a&&(l.display=\"Down\"===t?\"inline\"===b.CSS.Values.getDisplayType(e)?\"inline-block\":\"block\":\"none\"),l.begin=function(){u&&u.call(i,i);for(var r in p){d[r]=e.style[r];var a=b.CSS.getPropertyValue(e,r);p[r]=\"Down\"===t?[a,0]:[0,a]}d.overflow=e.style.overflow,e.style.overflow=\"hidden\"},l.complete=function(){for(var t in d)e.style[t]=d[t];c&&c.call(i,i),s&&s.resolver(i)},b(e,p,l)}}),f.each([\"In\",\"Out\"],function(e,t){b.Redirects[\"fade\"+t]=function(e,r,n,o,i,s){var l=f.extend({},r),u={opacity:\"In\"===t?1:0},c=l.complete;l.complete=n!==o-1?l.begin=null:function(){c&&c.call(i,i),s&&s.resolver(i)},l.display===a&&(l.display=\"In\"===t?\"auto\":\"none\"),b(this,u,l)}}),b}(window.jQuery||window.Zepto||window,window,document)}));\n;!function(a,b,c,d){\"use strict\";function k(a,b,c){return setTimeout(q(a,c),b)}function l(a,b,c){return Array.isArray(a)?(m(a,c[b],c),!0):!1}function m(a,b,c){var e;if(a)if(a.forEach)a.forEach(b,c);else if(a.length!==d)for(e=0;e<a.length;)b.call(c,a[e],e,a),e++;else for(e in a)a.hasOwnProperty(e)&&b.call(c,a[e],e,a)}function n(a,b,c){for(var e=Object.keys(b),f=0;f<e.length;)(!c||c&&a[e[f]]===d)&&(a[e[f]]=b[e[f]]),f++;return a}function o(a,b){return n(a,b,!0)}function p(a,b,c){var e,d=b.prototype;e=a.prototype=Object.create(d),e.constructor=a,e._super=d,c&&n(e,c)}function q(a,b){return function(){return a.apply(b,arguments)}}function r(a,b){return typeof a==g?a.apply(b?b[0]||d:d,b):a}function s(a,b){return a===d?b:a}function t(a,b,c){m(x(b),function(b){a.addEventListener(b,c,!1)})}function u(a,b,c){m(x(b),function(b){a.removeEventListener(b,c,!1)})}function v(a,b){for(;a;){if(a==b)return!0;a=a.parentNode}return!1}function w(a,b){return a.indexOf(b)>-1}function x(a){return a.trim().split(/\\s+/g)}function y(a,b,c){if(a.indexOf&&!c)return a.indexOf(b);for(var d=0;d<a.length;){if(c&&a[d][c]==b||!c&&a[d]===b)return d;d++}return-1}function z(a){return Array.prototype.slice.call(a,0)}function A(a,b,c){for(var d=[],e=[],f=0;f<a.length;){var g=b?a[f][b]:a[f];y(e,g)<0&&d.push(a[f]),e[f]=g,f++}return c&&(d=b?d.sort(function(a,c){return a[b]>c[b]}):d.sort()),d}function B(a,b){for(var c,f,g=b[0].toUpperCase()+b.slice(1),h=0;h<e.length;){if(c=e[h],f=c?c+g:b,f in a)return f;h++}return d}function D(){return C++}function E(a){var b=a.ownerDocument;return b.defaultView||b.parentWindow}function ab(a,b){var c=this;this.manager=a,this.callback=b,this.element=a.element,this.target=a.options.inputTarget,this.domHandler=function(b){r(a.options.enable,[a])&&c.handler(b)},this.init()}function bb(a){var b,c=a.options.inputClass;return b=c?c:H?wb:I?Eb:G?Gb:rb,new b(a,cb)}function cb(a,b,c){var d=c.pointers.length,e=c.changedPointers.length,f=b&O&&0===d-e,g=b&(Q|R)&&0===d-e;c.isFirst=!!f,c.isFinal=!!g,f&&(a.session={}),c.eventType=b,db(a,c),a.emit(\"hammer.input\",c),a.recognize(c),a.session.prevInput=c}function db(a,b){var c=a.session,d=b.pointers,e=d.length;c.firstInput||(c.firstInput=gb(b)),e>1&&!c.firstMultiple?c.firstMultiple=gb(b):1===e&&(c.firstMultiple=!1);var f=c.firstInput,g=c.firstMultiple,h=g?g.center:f.center,i=b.center=hb(d);b.timeStamp=j(),b.deltaTime=b.timeStamp-f.timeStamp,b.angle=lb(h,i),b.distance=kb(h,i),eb(c,b),b.offsetDirection=jb(b.deltaX,b.deltaY),b.scale=g?nb(g.pointers,d):1,b.rotation=g?mb(g.pointers,d):0,fb(c,b);var k=a.element;v(b.srcEvent.target,k)&&(k=b.srcEvent.target),b.target=k}function eb(a,b){var c=b.center,d=a.offsetDelta||{},e=a.prevDelta||{},f=a.prevInput||{};(b.eventType===O||f.eventType===Q)&&(e=a.prevDelta={x:f.deltaX||0,y:f.deltaY||0},d=a.offsetDelta={x:c.x,y:c.y}),b.deltaX=e.x+(c.x-d.x),b.deltaY=e.y+(c.y-d.y)}function fb(a,b){var f,g,h,j,c=a.lastInterval||b,e=b.timeStamp-c.timeStamp;if(b.eventType!=R&&(e>N||c.velocity===d)){var k=c.deltaX-b.deltaX,l=c.deltaY-b.deltaY,m=ib(e,k,l);g=m.x,h=m.y,f=i(m.x)>i(m.y)?m.x:m.y,j=jb(k,l),a.lastInterval=b}else f=c.velocity,g=c.velocityX,h=c.velocityY,j=c.direction;b.velocity=f,b.velocityX=g,b.velocityY=h,b.direction=j}function gb(a){for(var b=[],c=0;c<a.pointers.length;)b[c]={clientX:h(a.pointers[c].clientX),clientY:h(a.pointers[c].clientY)},c++;return{timeStamp:j(),pointers:b,center:hb(b),deltaX:a.deltaX,deltaY:a.deltaY}}function hb(a){var b=a.length;if(1===b)return{x:h(a[0].clientX),y:h(a[0].clientY)};for(var c=0,d=0,e=0;b>e;)c+=a[e].clientX,d+=a[e].clientY,e++;return{x:h(c/b),y:h(d/b)}}function ib(a,b,c){return{x:b/a||0,y:c/a||0}}function jb(a,b){return a===b?S:i(a)>=i(b)?a>0?T:U:b>0?V:W}function kb(a,b,c){c||(c=$);var d=b[c[0]]-a[c[0]],e=b[c[1]]-a[c[1]];return Math.sqrt(d*d+e*e)}function lb(a,b,c){c||(c=$);var d=b[c[0]]-a[c[0]],e=b[c[1]]-a[c[1]];return 180*Math.atan2(e,d)/Math.PI}function mb(a,b){return lb(b[1],b[0],_)-lb(a[1],a[0],_)}function nb(a,b){return kb(b[0],b[1],_)/kb(a[0],a[1],_)}function rb(){this.evEl=pb,this.evWin=qb,this.allow=!0,this.pressed=!1,ab.apply(this,arguments)}function wb(){this.evEl=ub,this.evWin=vb,ab.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}function Ab(){this.evTarget=yb,this.evWin=zb,this.started=!1,ab.apply(this,arguments)}function Bb(a,b){var c=z(a.touches),d=z(a.changedTouches);return b&(Q|R)&&(c=A(c.concat(d),\"identifier\",!0)),[c,d]}function Eb(){this.evTarget=Db,this.targetIds={},ab.apply(this,arguments)}function Fb(a,b){var c=z(a.touches),d=this.targetIds;if(b&(O|P)&&1===c.length)return d[c[0].identifier]=!0,[c,c];var e,f,g=z(a.changedTouches),h=[],i=this.target;if(f=c.filter(function(a){return v(a.target,i)}),b===O)for(e=0;e<f.length;)d[f[e].identifier]=!0,e++;for(e=0;e<g.length;)d[g[e].identifier]&&h.push(g[e]),b&(Q|R)&&delete d[g[e].identifier],e++;return h.length?[A(f.concat(h),\"identifier\",!0),h]:void 0}function Gb(){ab.apply(this,arguments);var a=q(this.handler,this);this.touch=new Eb(this.manager,a),this.mouse=new rb(this.manager,a)}function Pb(a,b){this.manager=a,this.set(b)}function Qb(a){if(w(a,Mb))return Mb;var b=w(a,Nb),c=w(a,Ob);return b&&c?Nb+\" \"+Ob:b||c?b?Nb:Ob:w(a,Lb)?Lb:Kb}function Yb(a){this.id=D(),this.manager=null,this.options=o(a||{},this.defaults),this.options.enable=s(this.options.enable,!0),this.state=Rb,this.simultaneous={},this.requireFail=[]}function Zb(a){return a&Wb?\"cancel\":a&Ub?\"end\":a&Tb?\"move\":a&Sb?\"start\":\"\"}function $b(a){return a==W?\"down\":a==V?\"up\":a==T?\"left\":a==U?\"right\":\"\"}function _b(a,b){var c=b.manager;return c?c.get(a):a}function ac(){Yb.apply(this,arguments)}function bc(){ac.apply(this,arguments),this.pX=null,this.pY=null}function cc(){ac.apply(this,arguments)}function dc(){Yb.apply(this,arguments),this._timer=null,this._input=null}function ec(){ac.apply(this,arguments)}function fc(){ac.apply(this,arguments)}function gc(){Yb.apply(this,arguments),this.pTime=!1,this.pCenter=!1,this._timer=null,this._input=null,this.count=0}function hc(a,b){return b=b||{},b.recognizers=s(b.recognizers,hc.defaults.preset),new kc(a,b)}function kc(a,b){b=b||{},this.options=o(b,hc.defaults),this.options.inputTarget=this.options.inputTarget||a,this.handlers={},this.session={},this.recognizers=[],this.element=a,this.input=bb(this),this.touchAction=new Pb(this,this.options.touchAction),lc(this,!0),m(b.recognizers,function(a){var b=this.add(new a[0](a[1]));a[2]&&b.recognizeWith(a[2]),a[3]&&b.requireFailure(a[3])},this)}function lc(a,b){var c=a.element;m(a.options.cssProps,function(a,d){c.style[B(c.style,d)]=b?a:\"\"})}function mc(a,c){var d=b.createEvent(\"Event\");d.initEvent(a,!0,!0),d.gesture=c,c.target.dispatchEvent(d)}var e=[\"\",\"webkit\",\"moz\",\"MS\",\"ms\",\"o\"],f=b.createElement(\"div\"),g=\"function\",h=Math.round,i=Math.abs,j=Date.now,C=1,F=/mobile|tablet|ip(ad|hone|od)|android/i,G=\"ontouchstart\"in a,H=B(a,\"PointerEvent\")!==d,I=G&&F.test(navigator.userAgent),J=\"touch\",K=\"pen\",L=\"mouse\",M=\"kinect\",N=25,O=1,P=2,Q=4,R=8,S=1,T=2,U=4,V=8,W=16,X=T|U,Y=V|W,Z=X|Y,$=[\"x\",\"y\"],_=[\"clientX\",\"clientY\"];ab.prototype={handler:function(){},init:function(){this.evEl&&t(this.element,this.evEl,this.domHandler),this.evTarget&&t(this.target,this.evTarget,this.domHandler),this.evWin&&t(E(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&u(this.element,this.evEl,this.domHandler),this.evTarget&&u(this.target,this.evTarget,this.domHandler),this.evWin&&u(E(this.element),this.evWin,this.domHandler)}};var ob={mousedown:O,mousemove:P,mouseup:Q},pb=\"mousedown\",qb=\"mousemove mouseup\";p(rb,ab,{handler:function(a){var b=ob[a.type];b&O&&0===a.button&&(this.pressed=!0),b&P&&1!==a.which&&(b=Q),this.pressed&&this.allow&&(b&Q&&(this.pressed=!1),this.callback(this.manager,b,{pointers:[a],changedPointers:[a],pointerType:L,srcEvent:a}))}});var sb={pointerdown:O,pointermove:P,pointerup:Q,pointercancel:R,pointerout:R},tb={2:J,3:K,4:L,5:M},ub=\"pointerdown\",vb=\"pointermove pointerup pointercancel\";a.MSPointerEvent&&(ub=\"MSPointerDown\",vb=\"MSPointerMove MSPointerUp MSPointerCancel\"),p(wb,ab,{handler:function(a){var b=this.store,c=!1,d=a.type.toLowerCase().replace(\"ms\",\"\"),e=sb[d],f=tb[a.pointerType]||a.pointerType,g=f==J,h=y(b,a.pointerId,\"pointerId\");e&O&&(0===a.button||g)?0>h&&(b.push(a),h=b.length-1):e&(Q|R)&&(c=!0),0>h||(b[h]=a,this.callback(this.manager,e,{pointers:b,changedPointers:[a],pointerType:f,srcEvent:a}),c&&b.splice(h,1))}});var xb={touchstart:O,touchmove:P,touchend:Q,touchcancel:R},yb=\"touchstart\",zb=\"touchstart touchmove touchend touchcancel\";p(Ab,ab,{handler:function(a){var b=xb[a.type];if(b===O&&(this.started=!0),this.started){var c=Bb.call(this,a,b);b&(Q|R)&&0===c[0].length-c[1].length&&(this.started=!1),this.callback(this.manager,b,{pointers:c[0],changedPointers:c[1],pointerType:J,srcEvent:a})}}});var Cb={touchstart:O,touchmove:P,touchend:Q,touchcancel:R},Db=\"touchstart touchmove touchend touchcancel\";p(Eb,ab,{handler:function(a){var b=Cb[a.type],c=Fb.call(this,a,b);c&&this.callback(this.manager,b,{pointers:c[0],changedPointers:c[1],pointerType:J,srcEvent:a})}}),p(Gb,ab,{handler:function(a,b,c){var d=c.pointerType==J,e=c.pointerType==L;if(d)this.mouse.allow=!1;else if(e&&!this.mouse.allow)return;b&(Q|R)&&(this.mouse.allow=!0),this.callback(a,b,c)},destroy:function(){this.touch.destroy(),this.mouse.destroy()}});var Hb=B(f.style,\"touchAction\"),Ib=Hb!==d,Jb=\"compute\",Kb=\"auto\",Lb=\"manipulation\",Mb=\"none\",Nb=\"pan-x\",Ob=\"pan-y\";Pb.prototype={set:function(a){a==Jb&&(a=this.compute()),Ib&&(this.manager.element.style[Hb]=a),this.actions=a.toLowerCase().trim()},update:function(){this.set(this.manager.options.touchAction)},compute:function(){var a=[];return m(this.manager.recognizers,function(b){r(b.options.enable,[b])&&(a=a.concat(b.getTouchAction()))}),Qb(a.join(\" \"))},preventDefaults:function(a){if(!Ib){var b=a.srcEvent,c=a.offsetDirection;if(this.manager.session.prevented)return b.preventDefault(),void 0;var d=this.actions,e=w(d,Mb),f=w(d,Ob),g=w(d,Nb);return e||f&&c&X||g&&c&Y?this.preventSrc(b):void 0}},preventSrc:function(a){this.manager.session.prevented=!0,a.preventDefault()}};var Rb=1,Sb=2,Tb=4,Ub=8,Vb=Ub,Wb=16,Xb=32;Yb.prototype={defaults:{},set:function(a){return n(this.options,a),this.manager&&this.manager.touchAction.update(),this},recognizeWith:function(a){if(l(a,\"recognizeWith\",this))return this;var b=this.simultaneous;return a=_b(a,this),b[a.id]||(b[a.id]=a,a.recognizeWith(this)),this},dropRecognizeWith:function(a){return l(a,\"dropRecognizeWith\",this)?this:(a=_b(a,this),delete this.simultaneous[a.id],this)},requireFailure:function(a){if(l(a,\"requireFailure\",this))return this;var b=this.requireFail;return a=_b(a,this),-1===y(b,a)&&(b.push(a),a.requireFailure(this)),this},dropRequireFailure:function(a){if(l(a,\"dropRequireFailure\",this))return this;a=_b(a,this);var b=y(this.requireFail,a);return b>-1&&this.requireFail.splice(b,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(a){return!!this.simultaneous[a.id]},emit:function(a){function d(d){b.manager.emit(b.options.event+(d?Zb(c):\"\"),a)}var b=this,c=this.state;Ub>c&&d(!0),d(),c>=Ub&&d(!0)},tryEmit:function(a){return this.canEmit()?this.emit(a):(this.state=Xb,void 0)},canEmit:function(){for(var a=0;a<this.requireFail.length;){if(!(this.requireFail[a].state&(Xb|Rb)))return!1;a++}return!0},recognize:function(a){var b=n({},a);return r(this.options.enable,[this,b])?(this.state&(Vb|Wb|Xb)&&(this.state=Rb),this.state=this.process(b),this.state&(Sb|Tb|Ub|Wb)&&this.tryEmit(b),void 0):(this.reset(),this.state=Xb,void 0)},process:function(){},getTouchAction:function(){},reset:function(){}},p(ac,Yb,{defaults:{pointers:1},attrTest:function(a){var b=this.options.pointers;return 0===b||a.pointers.length===b},process:function(a){var b=this.state,c=a.eventType,d=b&(Sb|Tb),e=this.attrTest(a);return d&&(c&R||!e)?b|Wb:d||e?c&Q?b|Ub:b&Sb?b|Tb:Sb:Xb}}),p(bc,ac,{defaults:{event:\"pan\",threshold:10,pointers:1,direction:Z},getTouchAction:function(){var a=this.options.direction,b=[];return a&X&&b.push(Ob),a&Y&&b.push(Nb),b},directionTest:function(a){var b=this.options,c=!0,d=a.distance,e=a.direction,f=a.deltaX,g=a.deltaY;return e&b.direction||(b.direction&X?(e=0===f?S:0>f?T:U,c=f!=this.pX,d=Math.abs(a.deltaX)):(e=0===g?S:0>g?V:W,c=g!=this.pY,d=Math.abs(a.deltaY))),a.direction=e,c&&d>b.threshold&&e&b.direction},attrTest:function(a){return ac.prototype.attrTest.call(this,a)&&(this.state&Sb||!(this.state&Sb)&&this.directionTest(a))},emit:function(a){this.pX=a.deltaX,this.pY=a.deltaY;var b=$b(a.direction);b&&this.manager.emit(this.options.event+b,a),this._super.emit.call(this,a)}}),p(cc,ac,{defaults:{event:\"pinch\",threshold:0,pointers:2},getTouchAction:function(){return[Mb]},attrTest:function(a){return this._super.attrTest.call(this,a)&&(Math.abs(a.scale-1)>this.options.threshold||this.state&Sb)},emit:function(a){if(this._super.emit.call(this,a),1!==a.scale){var b=a.scale<1?\"in\":\"out\";this.manager.emit(this.options.event+b,a)}}}),p(dc,Yb,{defaults:{event:\"press\",pointers:1,time:500,threshold:5},getTouchAction:function(){return[Kb]},process:function(a){var b=this.options,c=a.pointers.length===b.pointers,d=a.distance<b.threshold,e=a.deltaTime>b.time;if(this._input=a,!d||!c||a.eventType&(Q|R)&&!e)this.reset();else if(a.eventType&O)this.reset(),this._timer=k(function(){this.state=Vb,this.tryEmit()},b.time,this);else if(a.eventType&Q)return Vb;return Xb},reset:function(){clearTimeout(this._timer)},emit:function(a){this.state===Vb&&(a&&a.eventType&Q?this.manager.emit(this.options.event+\"up\",a):(this._input.timeStamp=j(),this.manager.emit(this.options.event,this._input)))}}),p(ec,ac,{defaults:{event:\"rotate\",threshold:0,pointers:2},getTouchAction:function(){return[Mb]},attrTest:function(a){return this._super.attrTest.call(this,a)&&(Math.abs(a.rotation)>this.options.threshold||this.state&Sb)}}),p(fc,ac,{defaults:{event:\"swipe\",threshold:10,velocity:.65,direction:X|Y,pointers:1},getTouchAction:function(){return bc.prototype.getTouchAction.call(this)},attrTest:function(a){var c,b=this.options.direction;return b&(X|Y)?c=a.velocity:b&X?c=a.velocityX:b&Y&&(c=a.velocityY),this._super.attrTest.call(this,a)&&b&a.direction&&a.distance>this.options.threshold&&i(c)>this.options.velocity&&a.eventType&Q},emit:function(a){var b=$b(a.direction);b&&this.manager.emit(this.options.event+b,a),this.manager.emit(this.options.event,a)}}),p(gc,Yb,{defaults:{event:\"tap\",pointers:1,taps:1,interval:300,time:250,threshold:2,posThreshold:10},getTouchAction:function(){return[Lb]},process:function(a){var b=this.options,c=a.pointers.length===b.pointers,d=a.distance<b.threshold,e=a.deltaTime<b.time;if(this.reset(),a.eventType&O&&0===this.count)return this.failTimeout();if(d&&e&&c){if(a.eventType!=Q)return this.failTimeout();var f=this.pTime?a.timeStamp-this.pTime<b.interval:!0,g=!this.pCenter||kb(this.pCenter,a.center)<b.posThreshold;this.pTime=a.timeStamp,this.pCenter=a.center,g&&f?this.count+=1:this.count=1,this._input=a;var h=this.count%b.taps;if(0===h)return this.hasRequireFailures()?(this._timer=k(function(){this.state=Vb,this.tryEmit()},b.interval,this),Sb):Vb}return Xb},failTimeout:function(){return this._timer=k(function(){this.state=Xb},this.options.interval,this),Xb},reset:function(){clearTimeout(this._timer)},emit:function(){this.state==Vb&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))}}),hc.VERSION=\"2.0.4\",hc.defaults={domEvents:!1,touchAction:Jb,enable:!0,inputTarget:null,inputClass:null,preset:[[ec,{enable:!1}],[cc,{enable:!1},[\"rotate\"]],[fc,{direction:X}],[bc,{direction:X},[\"swipe\"]],[gc],[gc,{event:\"doubletap\",taps:2},[\"tap\"]],[dc]],cssProps:{userSelect:\"default\",touchSelect:\"none\",touchCallout:\"none\",contentZooming:\"none\",userDrag:\"none\",tapHighlightColor:\"rgba(0,0,0,0)\"}};var ic=1,jc=2;kc.prototype={set:function(a){return n(this.options,a),a.touchAction&&this.touchAction.update(),a.inputTarget&&(this.input.destroy(),this.input.target=a.inputTarget,this.input.init()),this},stop:function(a){this.session.stopped=a?jc:ic},recognize:function(a){var b=this.session;if(!b.stopped){this.touchAction.preventDefaults(a);var c,d=this.recognizers,e=b.curRecognizer;(!e||e&&e.state&Vb)&&(e=b.curRecognizer=null);for(var f=0;f<d.length;)c=d[f],b.stopped===jc||e&&c!=e&&!c.canRecognizeWith(e)?c.reset():c.recognize(a),!e&&c.state&(Sb|Tb|Ub)&&(e=b.curRecognizer=c),f++}},get:function(a){if(a instanceof Yb)return a;for(var b=this.recognizers,c=0;c<b.length;c++)if(b[c].options.event==a)return b[c];return null},add:function(a){if(l(a,\"add\",this))return this;var b=this.get(a.options.event);return b&&this.remove(b),this.recognizers.push(a),a.manager=this,this.touchAction.update(),a},remove:function(a){if(l(a,\"remove\",this))return this;var b=this.recognizers;return a=this.get(a),b.splice(y(b,a),1),this.touchAction.update(),this},on:function(a,b){var c=this.handlers;return m(x(a),function(a){c[a]=c[a]||[],c[a].push(b)}),this},off:function(a,b){var c=this.handlers;return m(x(a),function(a){b?c[a].splice(y(c[a],b),1):delete c[a]}),this},emit:function(a,b){this.options.domEvents&&mc(a,b);var c=this.handlers[a]&&this.handlers[a].slice();if(c&&c.length){b.type=a,b.preventDefault=function(){b.srcEvent.preventDefault()};for(var d=0;d<c.length;)c[d](b),d++}},destroy:function(){this.element&&lc(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null}},n(hc,{INPUT_START:O,INPUT_MOVE:P,INPUT_END:Q,INPUT_CANCEL:R,STATE_POSSIBLE:Rb,STATE_BEGAN:Sb,STATE_CHANGED:Tb,STATE_ENDED:Ub,STATE_RECOGNIZED:Vb,STATE_CANCELLED:Wb,STATE_FAILED:Xb,DIRECTION_NONE:S,DIRECTION_LEFT:T,DIRECTION_RIGHT:U,DIRECTION_UP:V,DIRECTION_DOWN:W,DIRECTION_HORIZONTAL:X,DIRECTION_VERTICAL:Y,DIRECTION_ALL:Z,Manager:kc,Input:ab,TouchAction:Pb,TouchInput:Eb,MouseInput:rb,PointerEventInput:wb,TouchMouseInput:Gb,SingleTouchInput:Ab,Recognizer:Yb,AttrRecognizer:ac,Tap:gc,Pan:bc,Swipe:fc,Pinch:cc,Rotate:ec,Press:dc,on:t,off:u,each:m,merge:o,extend:n,inherit:p,bindFn:q,prefixed:B}),typeof define==g&&define.amd?define(function(){return hc}):\"undefined\"!=typeof module&&module.exports?module.exports=hc:a[c]=hc}(window,document,\"Hammer\");;(function(factory) {\n if (typeof define === 'function' && define.amd) {\n define(['jquery', 'hammerjs'], factory);\n } else if (typeof exports === 'object') {\n factory(require('jquery'), require('hammerjs'));\n } else {\n factory(jQuery, Hammer);\n }\n}(function($, Hammer) {\n function hammerify(el, options) {\n var $el = $(el);\n if(!$el.data(\"hammer\")) {\n $el.data(\"hammer\", new Hammer($el[0], options));\n }\n }\n\n $.fn.hammer = function(options) {\n return this.each(function() {\n hammerify(this, options);\n });\n };\n\n // extend the emit method to also trigger jQuery events\n Hammer.Manager.prototype.emit = (function(originalEmit) {\n return function(type, data) {\n originalEmit.call(this, type, data);\n $(this.element).trigger({\n type: type,\n gesture: data\n });\n };\n })(Hammer.Manager.prototype.emit);\n}));\n;// Required for Meteor package, the use of window prevents export by Meteor\n(function(window){\n if(window.Package){\n Materialize = {};\n } else {\n window.Materialize = {};\n }\n})(window);\n\n\n// Unique ID\nMaterialize.guid = (function() {\n function s4() {\n return Math.floor((1 + Math.random()) * 0x10000)\n .toString(16)\n .substring(1);\n }\n return function() {\n return s4() + s4() + '-' + s4() + '-' + s4() + '-' +\n s4() + '-' + s4() + s4() + s4();\n };\n})();\n\nMaterialize.elementOrParentIsFixed = function(element) {\n var $element = $(element);\n var $checkElements = $element.add($element.parents());\n var isFixed = false;\n $checkElements.each(function(){\n if ($(this).css(\"position\") === \"fixed\") {\n isFixed = true;\n return false;\n }\n });\n return isFixed;\n};\n\n// Velocity has conflicts when loaded with jQuery, this will check for it\nvar Vel;\nif ($) {\n Vel = $.Velocity;\n} else if (jQuery) {\n Vel = jQuery.Velocity;\n} else {\n Vel = Velocity;\n}\n; (function ($) {\n $.fn.collapsible = function(options) {\n var defaults = {\n accordion: undefined\n };\n\n options = $.extend(defaults, options);\n\n\n return this.each(function() {\n\n var $this = $(this);\n\n var $panel_headers = $(this).find('> li > .collapsible-header');\n\n var collapsible_type = $this.data(\"collapsible\");\n\n // Turn off any existing event handlers\n $this.off('click.collapse', '> li > .collapsible-header');\n $panel_headers.off('click.collapse');\n\n\n /****************\n Helper Functions\n ****************/\n\n // Accordion Open\n function accordionOpen(object) {\n $panel_headers = $this.find('> li > .collapsible-header');\n if (object.hasClass('active')) {\n object.parent().addClass('active');\n }\n else {\n object.parent().removeClass('active');\n }\n if (object.parent().hasClass('active')){\n object.siblings('.collapsible-body').stop(true,false).slideDown({ duration: 350, easing: \"easeOutQuart\", queue: false, complete: function() {$(this).css('height', '');}});\n }\n else{\n object.siblings('.collapsible-body').stop(true,false).slideUp({ duration: 350, easing: \"easeOutQuart\", queue: false, complete: function() {$(this).css('height', '');}});\n }\n\n $panel_headers.not(object).removeClass('active').parent().removeClass('active');\n $panel_headers.not(object).parent().children('.collapsible-body').stop(true,false).slideUp(\n {\n duration: 350,\n easing: \"easeOutQuart\",\n queue: false,\n complete:\n function() {\n $(this).css('height', '');\n }\n });\n }\n\n // Expandable Open\n function expandableOpen(object) {\n if (object.hasClass('active')) {\n object.parent().addClass('active');\n }\n else {\n object.parent().removeClass('active');\n }\n if (object.parent().hasClass('active')){\n object.siblings('.collapsible-body').stop(true,false).slideDown({ duration: 350, easing: \"easeOutQuart\", queue: false, complete: function() {$(this).css('height', '');}});\n }\n else{\n object.siblings('.collapsible-body').stop(true,false).slideUp({ duration: 350, easing: \"easeOutQuart\", queue: false, complete: function() {$(this).css('height', '');}});\n }\n }\n\n /**\n * Check if object is children of panel header\n * @param {Object} object Jquery object\n * @return {Boolean} true if it is children\n */\n function isChildrenOfPanelHeader(object) {\n\n var panelHeader = getPanelHeader(object);\n\n return panelHeader.length > 0;\n }\n\n /**\n * Get panel header from a children element\n * @param {Object} object Jquery object\n * @return {Object} panel header object\n */\n function getPanelHeader(object) {\n\n return object.closest('li > .collapsible-header');\n }\n\n /***** End Helper Functions *****/\n\n\n\n // Add click handler to only direct collapsible header children\n $this.on('click.collapse', '> li > .collapsible-header', function(e) {\n var $header = $(this),\n element = $(e.target);\n\n if (isChildrenOfPanelHeader(element)) {\n element = getPanelHeader(element);\n }\n\n element.toggleClass('active');\n\n if (options.accordion || collapsible_type === \"accordion\" || collapsible_type === undefined) { // Handle Accordion\n accordionOpen(element);\n } else { // Handle Expandables\n expandableOpen(element);\n\n if ($header.hasClass('active')) {\n expandableOpen($header);\n }\n }\n });\n\n // Open first active\n var $panel_headers = $this.find('> li > .collapsible-header');\n if (options.accordion || collapsible_type === \"accordion\" || collapsible_type === undefined) { // Handle Accordion\n accordionOpen($panel_headers.filter('.active').first());\n }\n else { // Handle Expandables\n $panel_headers.filter('.active').each(function() {\n expandableOpen($(this));\n });\n }\n\n });\n };\n\n $(document).ready(function(){\n $('.collapsible').collapsible();\n });\n}( jQuery ));;(function ($) {\n\n // Add posibility to scroll to selected option\n // usefull for select for example\n $.fn.scrollTo = function(elem) {\n $(this).scrollTop($(this).scrollTop() - $(this).offset().top + $(elem).offset().top);\n return this;\n };\n\n $.fn.dropdown = function (option) {\n var defaults = {\n inDuration: 300,\n outDuration: 225,\n constrain_width: true, // Constrains width of dropdown to the activator\n hover: false,\n gutter: 0, // Spacing from edge\n belowOrigin: false,\n alignment: 'left'\n };\n\n this.each(function(){\n var origin = $(this);\n var options = $.extend({}, defaults, option);\n var isFocused = false;\n\n // Dropdown menu\n var activates = $(\"#\"+ origin.attr('data-activates'));\n\n function updateOptions() {\n if (origin.data('induration') !== undefined)\n options.inDuration = origin.data('inDuration');\n if (origin.data('outduration') !== undefined)\n options.outDuration = origin.data('outDuration');\n if (origin.data('constrainwidth') !== undefined)\n options.constrain_width = origin.data('constrainwidth');\n if (origin.data('hover') !== undefined)\n options.hover = origin.data('hover');\n if (origin.data('gutter') !== undefined)\n options.gutter = origin.data('gutter');\n if (origin.data('beloworigin') !== undefined)\n options.belowOrigin = origin.data('beloworigin');\n if (origin.data('alignment') !== undefined)\n options.alignment = origin.data('alignment');\n }\n\n updateOptions();\n\n // Attach dropdown to its activator\n origin.after(activates);\n\n /*\n Helper function to position and resize dropdown.\n Used in hover and click handler.\n */\n function placeDropdown(eventType) {\n // Check for simultaneous focus and click events.\n if (eventType === 'focus') {\n isFocused = true;\n }\n\n // Check html data attributes\n updateOptions();\n\n // Set Dropdown state\n activates.addClass('active');\n origin.addClass('active');\n\n // Constrain width\n if (options.constrain_width === true) {\n activates.css('width', origin.outerWidth());\n\n } else {\n activates.css('white-space', 'nowrap');\n }\n\n // Offscreen detection\n var windowHeight = window.innerHeight;\n var originHeight = origin.innerHeight();\n var offsetLeft = origin.offset().left;\n var offsetTop = origin.offset().top - $(window).scrollTop();\n var currAlignment = options.alignment;\n var activatesLeft, gutterSpacing;\n\n // Below Origin\n var verticalOffset = 0;\n if (options.belowOrigin === true) {\n verticalOffset = originHeight;\n }\n\n if (offsetLeft + activates.innerWidth() > $(window).width()) {\n // Dropdown goes past screen on right, force right alignment\n currAlignment = 'right';\n\n } else if (offsetLeft - activates.innerWidth() + origin.innerWidth() < 0) {\n // Dropdown goes past screen on left, force left alignment\n currAlignment = 'left';\n }\n // Vertical bottom offscreen detection\n if (offsetTop + activates.innerHeight() > windowHeight) {\n // If going upwards still goes offscreen, just crop height of dropdown.\n if (offsetTop + originHeight - activates.innerHeight() < 0) {\n var adjustedHeight = windowHeight - offsetTop - verticalOffset;\n activates.css('max-height', adjustedHeight);\n } else {\n // Flow upwards.\n if (!verticalOffset) {\n verticalOffset += originHeight;\n }\n verticalOffset -= activates.innerHeight();\n }\n }\n\n // Handle edge alignment\n if (currAlignment === 'left') {\n gutterSpacing = options.gutter;\n leftPosition = origin.position().left + gutterSpacing;\n }\n else if (currAlignment === 'right') {\n var offsetRight = origin.position().left + origin.outerWidth() - activates.outerWidth();\n gutterSpacing = -options.gutter;\n leftPosition = offsetRight + gutterSpacing;\n }\n\n // Position dropdown\n activates.css({\n position: 'absolute',\n top: origin.position().top + verticalOffset,\n left: leftPosition\n });\n\n\n // Show dropdown\n activates.stop(true, true).css('opacity', 0)\n .slideDown({\n queue: false,\n duration: options.inDuration,\n easing: 'easeOutCubic',\n complete: function() {\n $(this).css('height', '');\n }\n })\n .animate( {opacity: 1}, {queue: false, duration: options.inDuration, easing: 'easeOutSine'});\n }\n\n function hideDropdown() {\n // Check for simultaneous focus and click events.\n isFocused = false;\n activates.fadeOut(options.outDuration);\n activates.removeClass('active');\n origin.removeClass('active');\n setTimeout(function() { activates.css('max-height', ''); }, options.outDuration);\n }\n\n // Hover\n if (options.hover) {\n var open = false;\n origin.unbind('click.' + origin.attr('id'));\n // Hover handler to show dropdown\n origin.on('mouseenter', function(e){ // Mouse over\n if (open === false) {\n placeDropdown();\n open = true;\n }\n });\n origin.on('mouseleave', function(e){\n // If hover on origin then to something other than dropdown content, then close\n var toEl = e.toElement || e.relatedTarget; // added browser compatibility for target element\n if(!$(toEl).closest('.dropdown-content').is(activates)) {\n activates.stop(true, true);\n hideDropdown();\n open = false;\n }\n });\n\n activates.on('mouseleave', function(e){ // Mouse out\n var toEl = e.toElement || e.relatedTarget;\n if(!$(toEl).closest('.dropdown-button').is(origin)) {\n activates.stop(true, true);\n hideDropdown();\n open = false;\n }\n });\n\n // Click\n } else {\n // Click handler to show dropdown\n origin.unbind('click.' + origin.attr('id'));\n origin.bind('click.'+origin.attr('id'), function(e){\n if (!isFocused) {\n if ( origin[0] == e.currentTarget &&\n !origin.hasClass('active') &&\n ($(e.target).closest('.dropdown-content').length === 0)) {\n e.preventDefault(); // Prevents button click from moving window\n placeDropdown('click');\n }\n // If origin is clicked and menu is open, close menu\n else if (origin.hasClass('active')) {\n hideDropdown();\n $(document).unbind('click.'+ activates.attr('id') + ' touchstart.' + activates.attr('id'));\n }\n // If menu open, add click close handler to document\n if (activates.hasClass('active')) {\n $(document).bind('click.'+ activates.attr('id') + ' touchstart.' + activates.attr('id'), function (e) {\n if (!activates.is(e.target) && !origin.is(e.target) && (!origin.find(e.target).length) ) {\n hideDropdown();\n $(document).unbind('click.'+ activates.attr('id') + ' touchstart.' + activates.attr('id'));\n }\n });\n }\n }\n });\n\n } // End else\n\n // Listen to open and close event - useful for select component\n origin.on('open', function(e, eventType) {\n placeDropdown(eventType);\n });\n origin.on('close', hideDropdown);\n\n\n });\n }; // End dropdown plugin\n\n $(document).ready(function(){\n $('.dropdown-button').dropdown();\n });\n}( jQuery ));;(function($) {\n var _stack = 0,\n _lastID = 0,\n _generateID = function() {\n _lastID++;\n return 'materialize-lean-overlay-' + _lastID;\n };\n\n $.fn.extend({\n openModal: function(options) {\n\n $('body').css('overflow', 'hidden');\n\n var defaults = {\n opacity: 0.5,\n in_duration: 350,\n out_duration: 250,\n ready: undefined,\n complete: undefined,\n dismissible: true,\n starting_top: '4%'\n },\n overlayID = _generateID(),\n $modal = $(this),\n $overlay = $('<div class=\"lean-overlay\"></div>'),\n lStack = (++_stack);\n\n // Store a reference of the overlay\n $overlay.attr('id', overlayID).css('z-index', 1000 + lStack * 2);\n $modal.data('overlay-id', overlayID).css('z-index', 1000 + lStack * 2 + 1);\n\n $(\"body\").append($overlay);\n\n // Override defaults\n options = $.extend(defaults, options);\n\n if (options.dismissible) {\n $overlay.click(function() {\n $modal.closeModal(options);\n });\n // Return on ESC\n $(document).on('keyup.leanModal' + overlayID, function(e) {\n if (e.keyCode === 27) { // ESC key\n $modal.closeModal(options);\n }\n });\n }\n\n $modal.find(\".modal-close\").on('click.close', function(e) {\n $modal.closeModal(options);\n });\n\n $overlay.css({ display : \"block\", opacity : 0 });\n\n $modal.css({\n display : \"block\",\n opacity: 0\n });\n\n $overlay.velocity({opacity: options.opacity}, {duration: options.in_duration, queue: false, ease: \"easeOutCubic\"});\n $modal.data('associated-overlay', $overlay[0]);\n\n // Define Bottom Sheet animation\n if ($modal.hasClass('bottom-sheet')) {\n $modal.velocity({bottom: \"0\", opacity: 1}, {\n duration: options.in_duration,\n queue: false,\n ease: \"easeOutCubic\",\n // Handle modal ready callback\n complete: function() {\n if (typeof(options.ready) === \"function\") {\n options.ready();\n }\n }\n });\n }\n else {\n $.Velocity.hook($modal, \"scaleX\", 0.7);\n $modal.css({ top: options.starting_top });\n $modal.velocity({top: \"10%\", opacity: 1, scaleX: '1'}, {\n duration: options.in_duration,\n queue: false,\n ease: \"easeOutCubic\",\n // Handle modal ready callback\n complete: function() {\n if (typeof(options.ready) === \"function\") {\n options.ready();\n }\n }\n });\n }\n\n\n }\n });\n\n $.fn.extend({\n closeModal: function(options) {\n var defaults = {\n out_duration: 250,\n complete: undefined\n },\n $modal = $(this),\n overlayID = $modal.data('overlay-id'),\n $overlay = $('#' + overlayID);\n\n options = $.extend(defaults, options);\n\n // Disable scrolling\n $('body').css('overflow', '');\n\n $modal.find('.modal-close').off('click.close');\n $(document).off('keyup.leanModal' + overlayID);\n\n $overlay.velocity( { opacity: 0}, {duration: options.out_duration, queue: false, ease: \"easeOutQuart\"});\n\n\n // Define Bottom Sheet animation\n if ($modal.hasClass('bottom-sheet')) {\n $modal.velocity({bottom: \"-100%\", opacity: 0}, {\n duration: options.out_duration,\n queue: false,\n ease: \"easeOutCubic\",\n // Handle modal ready callback\n complete: function() {\n $overlay.css({display:\"none\"});\n\n // Call complete callback\n if (typeof(options.complete) === \"function\") {\n options.complete();\n }\n $overlay.remove();\n _stack--;\n }\n });\n }\n else {\n $modal.velocity(\n { top: options.starting_top, opacity: 0, scaleX: 0.7}, {\n duration: options.out_duration,\n complete:\n function() {\n\n $(this).css('display', 'none');\n // Call complete callback\n if (typeof(options.complete) === \"function\") {\n options.complete();\n }\n $overlay.remove();\n _stack--;\n }\n }\n );\n }\n }\n });\n\n $.fn.extend({\n leanModal: function(option) {\n return this.each(function() {\n\n var defaults = {\n starting_top: '4%'\n },\n // Override defaults\n options = $.extend(defaults, option);\n\n // Close Handlers\n $(this).click(function(e) {\n options.starting_top = ($(this).offset().top - $(window).scrollTop()) /1.15;\n var modal_id = $(this).attr(\"href\") || '#' + $(this).data('target');\n $(modal_id).openModal(options);\n e.preventDefault();\n }); // done set on click\n }); // done return\n }\n });\n})(jQuery);\n;(function ($) {\n\n $.fn.materialbox = function () {\n\n return this.each(function() {\n\n if ($(this).hasClass('initialized')) {\n return;\n }\n\n $(this).addClass('initialized');\n\n var overlayActive = false;\n var doneAnimating = true;\n var inDuration = 275;\n var outDuration = 200;\n var origin = $(this);\n var placeholder = $('<div></div>').addClass('material-placeholder');\n var originalWidth = 0;\n var originalHeight = 0;\n var ancestorsChanged;\n var ancestor;\n origin.wrap(placeholder);\n\n\n origin.on('click', function(){\n var placeholder = origin.parent('.material-placeholder');\n var windowWidth = window.innerWidth;\n var windowHeight = window.innerHeight;\n var originalWidth = origin.width();\n var originalHeight = origin.height();\n\n\n // If already modal, return to original\n if (doneAnimating === false) {\n returnToOriginal();\n return false;\n }\n else if (overlayActive && doneAnimating===true) {\n returnToOriginal();\n return false;\n }\n\n\n // Set states\n doneAnimating = false;\n origin.addClass('active');\n overlayActive = true;\n\n // Set positioning for placeholder\n placeholder.css({\n width: placeholder[0].getBoundingClientRect().width,\n height: placeholder[0].getBoundingClientRect().height,\n position: 'relative',\n top: 0,\n left: 0\n });\n\n // Find ancestor with overflow: hidden; and remove it\n ancestorsChanged = undefined;\n ancestor = placeholder[0].parentNode;\n var count = 0;\n while (ancestor !== null && !$(ancestor).is(document)) {\n var curr = $(ancestor);\n if (curr.css('overflow') === 'hidden') {\n curr.css('overflow', 'visible');\n if (ancestorsChanged === undefined) {\n ancestorsChanged = curr;\n }\n else {\n ancestorsChanged = ancestorsChanged.add(curr);\n }\n }\n ancestor = ancestor.parentNode;\n }\n\n // Set css on origin\n origin.css({position: 'absolute', 'z-index': 1000})\n .data('width', originalWidth)\n .data('height', originalHeight);\n\n // Add overlay\n var overlay = $('<div id=\"materialbox-overlay\"></div>')\n .css({\n opacity: 0\n })\n .click(function(){\n if (doneAnimating === true)\n returnToOriginal();\n });\n // Animate Overlay\n $('body').append(overlay);\n overlay.velocity({opacity: 1}, {duration: inDuration, queue: false, easing: 'easeOutQuad'}\n );\n\n\n // Add and animate caption if it exists\n if (origin.data('caption') !== \"\") {\n var $photo_caption = $('<div class=\"materialbox-caption\"></div>');\n $photo_caption.text(origin.data('caption'));\n $('body').append($photo_caption);\n $photo_caption.css({ \"display\": \"inline\" });\n $photo_caption.velocity({opacity: 1}, {duration: inDuration, queue: false, easing: 'easeOutQuad'});\n }\n\n\n\n // Resize Image\n var ratio = 0;\n var widthPercent = originalWidth / windowWidth;\n var heightPercent = originalHeight / windowHeight;\n var newWidth = 0;\n var newHeight = 0;\n\n if (widthPercent > heightPercent) {\n ratio = originalHeight / originalWidth;\n newWidth = windowWidth * 0.9;\n newHeight = windowWidth * 0.9 * ratio;\n }\n else {\n ratio = originalWidth / originalHeight;\n newWidth = (windowHeight * 0.9) * ratio;\n newHeight = windowHeight * 0.9;\n }\n\n // Animate image + set z-index\n if(origin.hasClass('responsive-img')) {\n origin.velocity({'max-width': newWidth, 'width': originalWidth}, {duration: 0, queue: false,\n complete: function(){\n origin.css({left: 0, top: 0})\n .velocity(\n {\n height: newHeight,\n width: newWidth,\n left: $(document).scrollLeft() + windowWidth/2 - origin.parent('.material-placeholder').offset().left - newWidth/2,\n top: $(document).scrollTop() + windowHeight/2 - origin.parent('.material-placeholder').offset().top - newHeight/ 2\n },\n {\n duration: inDuration,\n queue: false,\n easing: 'easeOutQuad',\n complete: function(){doneAnimating = true;}\n }\n );\n } // End Complete\n }); // End Velocity\n }\n else {\n origin.css('left', 0)\n .css('top', 0)\n .velocity(\n {\n height: newHeight,\n width: newWidth,\n left: $(document).scrollLeft() + windowWidth/2 - origin.parent('.material-placeholder').offset().left - newWidth/2,\n top: $(document).scrollTop() + windowHeight/2 - origin.parent('.material-placeholder').offset().top - newHeight/ 2\n },\n {\n duration: inDuration,\n queue: false,\n easing: 'easeOutQuad',\n complete: function(){doneAnimating = true;}\n }\n ); // End Velocity\n }\n\n }); // End origin on click\n\n\n // Return on scroll\n $(window).scroll(function() {\n if (overlayActive ) {\n returnToOriginal();\n }\n });\n\n // Return on ESC\n $(document).keyup(function(e) {\n\n if (e.keyCode === 27 && doneAnimating === true) { // ESC key\n if (overlayActive) {\n returnToOriginal();\n }\n }\n });\n\n\n // This function returns the modaled image to the original spot\n function returnToOriginal() {\n\n doneAnimating = false;\n\n var placeholder = origin.parent('.material-placeholder');\n var windowWidth = window.innerWidth;\n var windowHeight = window.innerHeight;\n var originalWidth = origin.data('width');\n var originalHeight = origin.data('height');\n\n origin.velocity(\"stop\", true);\n $('#materialbox-overlay').velocity(\"stop\", true);\n $('.materialbox-caption').velocity(\"stop\", true);\n\n\n $('#materialbox-overlay').velocity({opacity: 0}, {\n duration: outDuration, // Delay prevents animation overlapping\n queue: false, easing: 'easeOutQuad',\n complete: function(){\n // Remove Overlay\n overlayActive = false;\n $(this).remove();\n }\n });\n\n // Resize Image\n origin.velocity(\n {\n width: originalWidth,\n height: originalHeight,\n left: 0,\n top: 0\n },\n {\n duration: outDuration,\n queue: false, easing: 'easeOutQuad'\n }\n );\n\n // Remove Caption + reset css settings on image\n $('.materialbox-caption').velocity({opacity: 0}, {\n duration: outDuration, // Delay prevents animation overlapping\n queue: false, easing: 'easeOutQuad',\n complete: function(){\n placeholder.css({\n height: '',\n width: '',\n position: '',\n top: '',\n left: ''\n });\n\n origin.css({\n height: '',\n top: '',\n left: '',\n width: '',\n 'max-width': '',\n position: '',\n 'z-index': ''\n });\n\n // Remove class\n origin.removeClass('active');\n doneAnimating = true;\n $(this).remove();\n\n // Remove overflow overrides on ancestors\n ancestorsChanged.css('overflow', '');\n }\n });\n\n }\n });\n};\n\n$(document).ready(function(){\n $('.materialboxed').materialbox();\n});\n\n}( jQuery ));\n;(function ($) {\n\n $.fn.parallax = function () {\n var window_width = $(window).width();\n // Parallax Scripts\n return this.each(function(i) {\n var $this = $(this);\n $this.addClass('parallax');\n\n function updateParallax(initial) {\n var container_height;\n if (window_width < 601) {\n container_height = ($this.height() > 0) ? $this.height() : $this.children(\"img\").height();\n }\n else {\n container_height = ($this.height() > 0) ? $this.height() : 500;\n }\n var $img = $this.children(\"img\").first();\n var img_height = $img.height();\n var parallax_dist = img_height - container_height;\n var bottom = $this.offset().top + container_height;\n var top = $this.offset().top;\n var scrollTop = $(window).scrollTop();\n var windowHeight = window.innerHeight;\n var windowBottom = scrollTop + windowHeight;\n var percentScrolled = (windowBottom - top) / (container_height + windowHeight);\n var parallax = Math.round((parallax_dist * percentScrolled));\n\n if (initial) {\n $img.css('display', 'block');\n }\n if ((bottom > scrollTop) && (top < (scrollTop + windowHeight))) {\n $img.css('transform', \"translate3D(-50%,\" + parallax + \"px, 0)\");\n }\n\n }\n\n // Wait for image load\n $this.children(\"img\").one(\"load\", function() {\n updateParallax(true);\n }).each(function() {\n if(this.complete) $(this).load();\n });\n\n $(window).scroll(function() {\n window_width = $(window).width();\n updateParallax(false);\n });\n\n $(window).resize(function() {\n window_width = $(window).width();\n updateParallax(false);\n });\n\n });\n\n };\n}( jQuery ));;(function ($) {\n\n var methods = {\n init : function() {\n return this.each(function() {\n\n // For each set of tabs, we want to keep track of\n // which tab is active and its associated content\n var $this = $(this),\n window_width = $(window).width();\n\n $this.width('100%');\n var $active, $content, $links = $this.find('li.tab a'),\n $tabs_width = $this.width(),\n $tab_width = $this.find('li').first().outerWidth(),\n $index = 0;\n\n // If the location.hash matches one of the links, use that as the active tab.\n $active = $($links.filter('[href=\"'+location.hash+'\"]'));\n\n // If no match is found, use the first link or any with class 'active' as the initial active tab.\n if ($active.length === 0) {\n $active = $(this).find('li.tab a.active').first();\n }\n if ($active.length === 0) {\n $active = $(this).find('li.tab a').first();\n }\n\n $active.addClass('active');\n $index = $links.index($active);\n if ($index < 0) {\n $index = 0;\n }\n\n $content = $($active[0].hash);\n\n // append indicator then set indicator width to tab width\n $this.append('<div class=\"indicator\"></div>');\n var $indicator = $this.find('.indicator');\n if ($this.is(\":visible\")) {\n $indicator.css({\"right\": $tabs_width - (($index + 1) * $tab_width)});\n $indicator.css({\"left\": $index * $tab_width});\n }\n $(window).resize(function () {\n $tabs_width = $this.width();\n $tab_width = $this.find('li').first().outerWidth();\n if ($index < 0) {\n $index = 0;\n }\n if ($tab_width !== 0 && $tabs_width !== 0) {\n $indicator.css({\"right\": $tabs_width - (($index + 1) * $tab_width)});\n $indicator.css({\"left\": $index * $tab_width});\n }\n });\n\n // Hide the remaining content\n $links.not($active).each(function () {\n $(this.hash).hide();\n });\n\n\n // Bind the click event handler\n $this.on('click', 'a', function(e) {\n if ($(this).parent().hasClass('disabled')) {\n e.preventDefault();\n return;\n }\n\n $tabs_width = $this.width();\n $tab_width = $this.find('li').first().outerWidth();\n\n // Make the old tab inactive.\n $active.removeClass('active');\n $content.hide();\n\n // Update the variables with the new link and content\n $active = $(this);\n $content = $(this.hash);\n $links = $this.find('li.tab a');\n\n // Make the tab active.\n $active.addClass('active');\n var $prev_index = $index;\n $index = $links.index($(this));\n if ($index < 0) {\n $index = 0;\n }\n // Change url to current tab\n // window.location.hash = $active.attr('href');\n\n $content.show();\n\n // Update indicator\n if (($index - $prev_index) >= 0) {\n $indicator.velocity({\"right\": $tabs_width - (($index + 1) * $tab_width)}, { duration: 300, queue: false, easing: 'easeOutQuad'});\n $indicator.velocity({\"left\": $index * $tab_width}, {duration: 300, queue: false, easing: 'easeOutQuad', delay: 90});\n\n }\n else {\n $indicator.velocity({\"left\": $index * $tab_width}, { duration: 300, queue: false, easing: 'easeOutQuad'});\n $indicator.velocity({\"right\": $tabs_width - (($index + 1) * $tab_width)}, {duration: 300, queue: false, easing: 'easeOutQuad', delay: 90});\n }\n\n // Prevent the anchor's default click action\n e.preventDefault();\n });\n });\n\n },\n select_tab : function( id ) {\n this.find('a[href=\"#' + id + '\"]').trigger('click');\n }\n };\n\n $.fn.tabs = function(methodOrOptions) {\n if ( methods[methodOrOptions] ) {\n return methods[ methodOrOptions ].apply( this, Array.prototype.slice.call( arguments, 1 ));\n } else if ( typeof methodOrOptions === 'object' || ! methodOrOptions ) {\n // Default to \"init\"\n return methods.init.apply( this, arguments );\n } else {\n $.error( 'Method ' + methodOrOptions + ' does not exist on jQuery.tooltip' );\n }\n };\n\n $(document).ready(function(){\n $('ul.tabs').tabs();\n });\n}( jQuery ));\n;(function ($) {\n $.fn.tooltip = function (options) {\n var timeout = null,\n margin = 5;\n\n // Defaults\n var defaults = {\n delay: 350\n };\n\n // Remove tooltip from the activator\n if (options === \"remove\") {\n this.each(function(){\n $('#' + $(this).attr('data-tooltip-id')).remove();\n $(this).off('mouseenter.tooltip mouseleave.tooltip');\n });\n return false;\n }\n\n options = $.extend(defaults, options);\n\n\n return this.each(function(){\n var tooltipId = Materialize.guid();\n var origin = $(this);\n origin.attr('data-tooltip-id', tooltipId);\n\n // Create Text span\n var tooltip_text = $('<span></span>').text(origin.attr('data-tooltip'));\n\n // Create tooltip\n var newTooltip = $('<div></div>');\n newTooltip.addClass('material-tooltip').append(tooltip_text)\n .appendTo($('body'))\n .attr('id', tooltipId);\n\n var backdrop = $('<div></div>').addClass('backdrop');\n backdrop.appendTo(newTooltip);\n backdrop.css({ top: 0, left:0 });\n\n\n //Destroy previously binded events\n origin.off('mouseenter.tooltip mouseleave.tooltip');\n // Mouse In\n var started = false, timeoutRef;\n origin.on({\n 'mouseenter.tooltip': function(e) {\n var tooltip_delay = origin.attr('data-delay');\n tooltip_delay = (tooltip_delay === undefined || tooltip_delay === '') ?\n options.delay : tooltip_delay;\n timeoutRef = setTimeout(function(){\n started = true;\n newTooltip.velocity('stop');\n backdrop.velocity('stop');\n newTooltip.css({ display: 'block', left: '0px', top: '0px' });\n\n // Set Tooltip text\n newTooltip.children('span').text(origin.attr('data-tooltip'));\n\n // Tooltip positioning\n var originWidth = origin.outerWidth();\n var originHeight = origin.outerHeight();\n var tooltipPosition = origin.attr('data-position');\n var tooltipHeight = newTooltip.outerHeight();\n var tooltipWidth = newTooltip.outerWidth();\n var tooltipVerticalMovement = '0px';\n var tooltipHorizontalMovement = '0px';\n var scale_factor = 8;\n var targetTop, targetLeft, newCoordinates;\n\n if (tooltipPosition === \"top\") {\n // Top Position\n targetTop = origin.offset().top - tooltipHeight - margin;\n targetLeft = origin.offset().left + originWidth/2 - tooltipWidth/2;\n newCoordinates = repositionWithinScreen(targetLeft, targetTop, tooltipWidth, tooltipHeight);\n\n tooltipVerticalMovement = '-10px';\n backdrop.css({\n borderRadius: '14px 14px 0 0',\n transformOrigin: '50% 90%',\n marginTop: tooltipHeight,\n marginLeft: (tooltipWidth/2) - (backdrop.width()/2)\n });\n }\n // Left Position\n else if (tooltipPosition === \"left\") {\n targetTop = origin.offset().top + originHeight/2 - tooltipHeight/2;\n targetLeft = origin.offset().left - tooltipWidth - margin;\n newCoordinates = repositionWithinScreen(targetLeft, targetTop, tooltipWidth, tooltipHeight);\n\n tooltipHorizontalMovement = '-10px';\n backdrop.css({\n width: '14px',\n height: '14px',\n borderRadius: '14px 0 0 14px',\n transformOrigin: '95% 50%',\n marginTop: tooltipHeight/2,\n marginLeft: tooltipWidth\n });\n }\n // Right Position\n else if (tooltipPosition === \"right\") {\n targetTop = origin.offset().top + originHeight/2 - tooltipHeight/2;\n targetLeft = origin.offset().left + originWidth + margin;\n newCoordinates = repositionWithinScreen(targetLeft, targetTop, tooltipWidth, tooltipHeight);\n\n tooltipHorizontalMovement = '+10px';\n backdrop.css({\n width: '14px',\n height: '14px',\n borderRadius: '0 14px 14px 0',\n transformOrigin: '5% 50%',\n marginTop: tooltipHeight/2,\n marginLeft: '0px'\n });\n }\n else {\n // Bottom Position\n targetTop = origin.offset().top + origin.outerHeight() + margin;\n targetLeft = origin.offset().left + originWidth/2 - tooltipWidth/2;\n newCoordinates = repositionWithinScreen(targetLeft, targetTop, tooltipWidth, tooltipHeight);\n tooltipVerticalMovement = '+10px';\n backdrop.css({\n marginLeft: (tooltipWidth/2) - (backdrop.width()/2)\n });\n }\n\n // Set tooptip css placement\n newTooltip.css({\n top: newCoordinates.y,\n left: newCoordinates.x\n });\n\n // Calculate Scale to fill\n scale_factor = tooltipWidth / 8;\n if (scale_factor < 8) {\n scale_factor = 8;\n }\n if (tooltipPosition === \"right\" || tooltipPosition === \"left\") {\n scale_factor = tooltipWidth / 10;\n if (scale_factor < 6)\n scale_factor = 6;\n }\n\n newTooltip.velocity({ marginTop: tooltipVerticalMovement, marginLeft: tooltipHorizontalMovement}, { duration: 350, queue: false })\n .velocity({opacity: 1}, {duration: 300, delay: 50, queue: false});\n backdrop.css({ display: 'block' })\n .velocity({opacity:1},{duration: 55, delay: 0, queue: false})\n .velocity({scale: scale_factor}, {duration: 300, delay: 0, queue: false, easing: 'easeInOutQuad'});\n\n\n }, tooltip_delay); // End Interval\n\n // Mouse Out\n },\n 'mouseleave.tooltip': function(){\n // Reset State\n started = false;\n clearTimeout(timeoutRef);\n\n // Animate back\n setTimeout(function() {\n if (started != true) {\n newTooltip.velocity({\n opacity: 0, marginTop: 0, marginLeft: 0}, { duration: 225, queue: false});\n backdrop.velocity({opacity: 0, scale: 1}, {\n duration:225,\n queue: false,\n complete: function(){\n backdrop.css('display', 'none');\n newTooltip.css('display', 'none');\n started = false;}\n });\n }\n },225);\n }\n });\n });\n };\n\n var repositionWithinScreen = function(x, y, width, height) {\n var newX = x\n var newY = y;\n\n if (newX < 0) {\n newX = 4;\n } else if (newX + width > window.innerWidth) {\n newX -= newX + width - window.innerWidth;\n }\n\n if (newY < 0) {\n newY = 4;\n } else if (newY + height > window.innerHeight + $(window).scrollTop) {\n newY -= newY + height - window.innerHeight;\n }\n\n return {x: newX, y: newY};\n };\n\n $(document).ready(function(){\n $('.tooltipped').tooltip();\n });\n}( jQuery ));\n;/*!\n * Waves v0.6.4\n * http://fian.my.id/Waves\n *\n * Copyright 2014 Alfiana E. Sibuea and other contributors\n * Released under the MIT license\n * https://github.com/fians/Waves/blob/master/LICENSE\n */\n\n;(function(window) {\n 'use strict';\n\n var Waves = Waves || {};\n var $$ = document.querySelectorAll.bind(document);\n\n // Find exact position of element\n function isWindow(obj) {\n return obj !== null && obj === obj.window;\n }\n\n function getWindow(elem) {\n return isWindow(elem) ? elem : elem.nodeType === 9 && elem.defaultView;\n }\n\n function offset(elem) {\n var docElem, win,\n box = {top: 0, left: 0},\n doc = elem && elem.ownerDocument;\n\n docElem = doc.documentElement;\n\n if (typeof elem.getBoundingClientRect !== typeof undefined) {\n box = elem.getBoundingClientRect();\n }\n win = getWindow(doc);\n return {\n top: box.top + win.pageYOffset - docElem.clientTop,\n left: box.left + win.pageXOffset - docElem.clientLeft\n };\n }\n\n function convertStyle(obj) {\n var style = '';\n\n for (var a in obj) {\n if (obj.hasOwnProperty(a)) {\n style += (a + ':' + obj[a] + ';');\n }\n }\n\n return style;\n }\n\n var Effect = {\n\n // Effect delay\n duration: 750,\n\n show: function(e, element) {\n\n // Disable right click\n if (e.button === 2) {\n return false;\n }\n\n var el = element || this;\n\n // Create ripple\n var ripple = document.createElement('div');\n ripple.className = 'waves-ripple';\n el.appendChild(ripple);\n\n // Get click coordinate and element witdh\n var pos = offset(el);\n var relativeY = (e.pageY - pos.top);\n var relativeX = (e.pageX - pos.left);\n var scale = 'scale('+((el.clientWidth / 100) * 10)+')';\n\n // Support for touch devices\n if ('touches' in e) {\n relativeY = (e.touches[0].pageY - pos.top);\n relativeX = (e.touches[0].pageX - pos.left);\n }\n\n // Attach data to element\n ripple.setAttribute('data-hold', Date.now());\n ripple.setAttribute('data-scale', scale);\n ripple.setAttribute('data-x', relativeX);\n ripple.setAttribute('data-y', relativeY);\n\n // Set ripple position\n var rippleStyle = {\n 'top': relativeY+'px',\n 'left': relativeX+'px'\n };\n\n ripple.className = ripple.className + ' waves-notransition';\n ripple.setAttribute('style', convertStyle(rippleStyle));\n ripple.className = ripple.className.replace('waves-notransition', '');\n\n // Scale the ripple\n rippleStyle['-webkit-transform'] = scale;\n rippleStyle['-moz-transform'] = scale;\n rippleStyle['-ms-transform'] = scale;\n rippleStyle['-o-transform'] = scale;\n rippleStyle.transform = scale;\n rippleStyle.opacity = '1';\n\n rippleStyle['-webkit-transition-duration'] = Effect.duration + 'ms';\n rippleStyle['-moz-transition-duration'] = Effect.duration + 'ms';\n rippleStyle['-o-transition-duration'] = Effect.duration + 'ms';\n rippleStyle['transition-duration'] = Effect.duration + 'ms';\n\n rippleStyle['-webkit-transition-timing-function'] = 'cubic-bezier(0.250, 0.460, 0.450, 0.940)';\n rippleStyle['-moz-transition-timing-function'] = 'cubic-bezier(0.250, 0.460, 0.450, 0.940)';\n rippleStyle['-o-transition-timing-function'] = 'cubic-bezier(0.250, 0.460, 0.450, 0.940)';\n rippleStyle['transition-timing-function'] = 'cubic-bezier(0.250, 0.460, 0.450, 0.940)';\n\n ripple.setAttribute('style', convertStyle(rippleStyle));\n },\n\n hide: function(e) {\n TouchHandler.touchup(e);\n\n var el = this;\n var width = el.clientWidth * 1.4;\n\n // Get first ripple\n var ripple = null;\n var ripples = el.getElementsByClassName('waves-ripple');\n if (ripples.length > 0) {\n ripple = ripples[ripples.length - 1];\n } else {\n return false;\n }\n\n var relativeX = ripple.getAttribute('data-x');\n var relativeY = ripple.getAttribute('data-y');\n var scale = ripple.getAttribute('data-scale');\n\n // Get delay beetween mousedown and mouse leave\n var diff = Date.now() - Number(ripple.getAttribute('data-hold'));\n var delay = 350 - diff;\n\n if (delay < 0) {\n delay = 0;\n }\n\n // Fade out ripple after delay\n setTimeout(function() {\n var style = {\n 'top': relativeY+'px',\n 'left': relativeX+'px',\n 'opacity': '0',\n\n // Duration\n '-webkit-transition-duration': Effect.duration + 'ms',\n '-moz-transition-duration': Effect.duration + 'ms',\n '-o-transition-duration': Effect.duration + 'ms',\n 'transition-duration': Effect.duration + 'ms',\n '-webkit-transform': scale,\n '-moz-transform': scale,\n '-ms-transform': scale,\n '-o-transform': scale,\n 'transform': scale,\n };\n\n ripple.setAttribute('style', convertStyle(style));\n\n setTimeout(function() {\n try {\n el.removeChild(ripple);\n } catch(e) {\n return false;\n }\n }, Effect.duration);\n }, delay);\n },\n\n // Little hack to make <input> can perform waves effect\n wrapInput: function(elements) {\n for (var a = 0; a < elements.length; a++) {\n var el = elements[a];\n\n if (el.tagName.toLowerCase() === 'input') {\n var parent = el.parentNode;\n\n // If input already have parent just pass through\n if (parent.tagName.toLowerCase() === 'i' && parent.className.indexOf('waves-effect') !== -1) {\n continue;\n }\n\n // Put element class and style to the specified parent\n var wrapper = document.createElement('i');\n wrapper.className = el.className + ' waves-input-wrapper';\n\n var elementStyle = el.getAttribute('style');\n\n if (!elementStyle) {\n elementStyle = '';\n }\n\n wrapper.setAttribute('style', elementStyle);\n\n el.className = 'waves-button-input';\n el.removeAttribute('style');\n\n // Put element as child\n parent.replaceChild(wrapper, el);\n wrapper.appendChild(el);\n }\n }\n }\n };\n\n\n /**\n * Disable mousedown event for 500ms during and after touch\n */\n var TouchHandler = {\n /* uses an integer rather than bool so there's no issues with\n * needing to clear timeouts if another touch event occurred\n * within the 500ms. Cannot mouseup between touchstart and\n * touchend, nor in the 500ms after touchend. */\n touches: 0,\n allowEvent: function(e) {\n var allow = true;\n\n if (e.type === 'touchstart') {\n TouchHandler.touches += 1; //push\n } else if (e.type === 'touchend' || e.type === 'touchcancel') {\n setTimeout(function() {\n if (TouchHandler.touches > 0) {\n TouchHandler.touches -= 1; //pop after 500ms\n }\n }, 500);\n } else if (e.type === 'mousedown' && TouchHandler.touches > 0) {\n allow = false;\n }\n\n return allow;\n },\n touchup: function(e) {\n TouchHandler.allowEvent(e);\n }\n };\n\n\n /**\n * Delegated click handler for .waves-effect element.\n * returns null when .waves-effect element not in \"click tree\"\n */\n function getWavesEffectElement(e) {\n if (TouchHandler.allowEvent(e) === false) {\n return null;\n }\n\n var element = null;\n var target = e.target || e.srcElement;\n\n while (target.parentElement !== null) {\n if (!(target instanceof SVGElement) && target.className.indexOf('waves-effect') !== -1) {\n element = target;\n break;\n } else if (target.classList.contains('waves-effect')) {\n element = target;\n break;\n }\n target = target.parentElement;\n }\n\n return element;\n }\n\n /**\n * Bubble the click and show effect if .waves-effect elem was found\n */\n function showEffect(e) {\n var element = getWavesEffectElement(e);\n\n if (element !== null) {\n Effect.show(e, element);\n\n if ('ontouchstart' in window) {\n element.addEventListener('touchend', Effect.hide, false);\n element.addEventListener('touchcancel', Effect.hide, false);\n }\n\n element.addEventListener('mouseup', Effect.hide, false);\n element.addEventListener('mouseleave', Effect.hide, false);\n }\n }\n\n Waves.displayEffect = function(options) {\n options = options || {};\n\n if ('duration' in options) {\n Effect.duration = options.duration;\n }\n\n //Wrap input inside <i> tag\n Effect.wrapInput($$('.waves-effect'));\n\n if ('ontouchstart' in window) {\n document.body.addEventListener('touchstart', showEffect, false);\n }\n\n document.body.addEventListener('mousedown', showEffect, false);\n };\n\n /**\n * Attach Waves to an input element (or any element which doesn't\n * bubble mouseup/mousedown events).\n * Intended to be used with dynamically loaded forms/inputs, or\n * where the user doesn't want a delegated click handler.\n */\n Waves.attach = function(element) {\n //FUTURE: automatically add waves classes and allow users\n // to specify them with an options param? Eg. light/classic/button\n if (element.tagName.toLowerCase() === 'input') {\n Effect.wrapInput([element]);\n element = element.parentElement;\n }\n\n if ('ontouchstart' in window) {\n element.addEventListener('touchstart', showEffect, false);\n }\n\n element.addEventListener('mousedown', showEffect, false);\n };\n\n window.Waves = Waves;\n\n document.addEventListener('DOMContentLoaded', function() {\n Waves.displayEffect();\n }, false);\n\n})(window);\n;Materialize.toast = function (message, displayLength, className, completeCallback) {\n className = className || \"\";\n\n var container = document.getElementById('toast-container');\n\n // Create toast container if it does not exist\n if (container === null) {\n // create notification container\n container = document.createElement('div');\n container.id = 'toast-container';\n document.body.appendChild(container);\n }\n\n // Select and append toast\n var newToast = createToast(message);\n\n // only append toast if message is not undefined\n if(message){\n container.appendChild(newToast);\n }\n\n newToast.style.top = '35px';\n newToast.style.opacity = 0;\n\n // Animate toast in\n Vel(newToast, { \"top\" : \"0px\", opacity: 1 }, {duration: 300,\n easing: 'easeOutCubic',\n queue: false});\n\n // Allows timer to be pause while being panned\n var timeLeft = displayLength;\n var counterInterval = setInterval (function(){\n\n\n if (newToast.parentNode === null)\n window.clearInterval(counterInterval);\n\n // If toast is not being dragged, decrease its time remaining\n if (!newToast.classList.contains('panning')) {\n timeLeft -= 20;\n }\n\n if (timeLeft <= 0) {\n // Animate toast out\n Vel(newToast, {\"opacity\": 0, marginTop: '-40px'}, { duration: 375,\n easing: 'easeOutExpo',\n queue: false,\n complete: function(){\n // Call the optional callback\n if(typeof(completeCallback) === \"function\")\n completeCallback();\n // Remove toast after it times out\n this[0].parentNode.removeChild(this[0]);\n }\n });\n window.clearInterval(counterInterval);\n }\n }, 20);\n\n\n\n function createToast(html) {\n\n // Create toast\n var toast = document.createElement('div');\n toast.classList.add('toast');\n if (className) {\n var classes = className.split(' ');\n\n for (var i = 0, count = classes.length; i < count; i++) {\n toast.classList.add(classes[i]);\n }\n }\n // If type of parameter is HTML Element\n if ( typeof HTMLElement === \"object\" ? html instanceof HTMLElement : html && typeof html === \"object\" && html !== null && html.nodeType === 1 && typeof html.nodeName===\"string\"\n) {\n toast.appendChild(html);\n }\n else if (html instanceof jQuery) {\n // Check if it is jQuery object\n toast.appendChild(html[0]);\n }\n else {\n // Insert as text;\n toast.innerHTML = html; \n }\n // Bind hammer\n var hammerHandler = new Hammer(toast, {prevent_default: false});\n hammerHandler.on('pan', function(e) {\n var deltaX = e.deltaX;\n var activationDistance = 80;\n\n // Change toast state\n if (!toast.classList.contains('panning')){\n toast.classList.add('panning');\n }\n\n var opacityPercent = 1-Math.abs(deltaX / activationDistance);\n if (opacityPercent < 0)\n opacityPercent = 0;\n\n Vel(toast, {left: deltaX, opacity: opacityPercent }, {duration: 50, queue: false, easing: 'easeOutQuad'});\n\n });\n\n hammerHandler.on('panend', function(e) {\n var deltaX = e.deltaX;\n var activationDistance = 80;\n\n // If toast dragged past activation point\n if (Math.abs(deltaX) > activationDistance) {\n Vel(toast, {marginTop: '-40px'}, { duration: 375,\n easing: 'easeOutExpo',\n queue: false,\n complete: function(){\n if(typeof(completeCallback) === \"function\") {\n completeCallback();\n }\n toast.parentNode.removeChild(toast);\n }\n });\n\n } else {\n toast.classList.remove('panning');\n // Put toast back into original position\n Vel(toast, { left: 0, opacity: 1 }, { duration: 300,\n easing: 'easeOutExpo',\n queue: false\n });\n\n }\n });\n\n return toast;\n }\n};\n;(function ($) {\n\n var methods = {\n init : function(options) {\n var defaults = {\n menuWidth: 240,\n edge: 'left',\n closeOnClick: false\n };\n options = $.extend(defaults, options);\n\n $(this).each(function(){\n var $this = $(this);\n var menu_id = $(\"#\"+ $this.attr('data-activates'));\n\n // Set to width\n if (options.menuWidth != 240) {\n menu_id.css('width', options.menuWidth);\n }\n\n // Add Touch Area\n var dragTarget = $('<div class=\"drag-target\"></div>');\n $('body').append(dragTarget);\n\n if (options.edge == 'left') {\n menu_id.css('left', -1 * (options.menuWidth + 10));\n dragTarget.css({'left': 0}); // Add Touch Area\n }\n else {\n menu_id.addClass('right-aligned') // Change text-alignment to right\n .css('right', -1 * (options.menuWidth + 10))\n .css('left', '');\n dragTarget.css({'right': 0}); // Add Touch Area\n }\n\n // If fixed sidenav, bring menu out\n if (menu_id.hasClass('fixed')) {\n if (window.innerWidth > 992) {\n menu_id.css('left', 0);\n }\n }\n\n // Window resize to reset on large screens fixed\n if (menu_id.hasClass('fixed')) {\n $(window).resize( function() {\n if (window.innerWidth > 992) {\n // Close menu if window is resized bigger than 992 and user has fixed sidenav\n if ($('#sidenav-overlay').css('opacity') !== 0 && menuOut) {\n removeMenu(true);\n }\n else {\n menu_id.removeAttr('style');\n menu_id.css('width', options.menuWidth);\n }\n }\n else if (menuOut === false){\n if (options.edge === 'left')\n menu_id.css('left', -1 * (options.menuWidth + 10));\n else\n menu_id.css('right', -1 * (options.menuWidth + 10));\n }\n\n });\n }\n\n // if closeOnClick, then add close event for all a tags in side sideNav\n if (options.closeOnClick === true) {\n menu_id.on(\"click.itemclick\", \"a:not(.collapsible-header)\", function(){\n removeMenu();\n });\n }\n\n function removeMenu(restoreNav) {\n panning = false;\n menuOut = false;\n\n // Reenable scrolling\n $('body').css('overflow', '');\n\n $('#sidenav-overlay').velocity({opacity: 0}, {duration: 200, queue: false, easing: 'easeOutQuad',\n complete: function() {\n $(this).remove();\n } });\n if (options.edge === 'left') {\n // Reset phantom div\n dragTarget.css({width: '', right: '', left: '0'});\n menu_id.velocity(\n {left: -1 * (options.menuWidth + 10)},\n { duration: 200,\n queue: false,\n easing: 'easeOutCubic',\n complete: function() {\n if (restoreNav === true) {\n // Restore Fixed sidenav\n menu_id.removeAttr('style');\n menu_id.css('width', options.menuWidth);\n }\n }\n\n });\n }\n else {\n // Reset phantom div\n dragTarget.css({width: '', right: '0', left: ''});\n menu_id.velocity(\n {right: -1 * (options.menuWidth + 10)},\n { duration: 200,\n queue: false,\n easing: 'easeOutCubic',\n complete: function() {\n if (restoreNav === true) {\n // Restore Fixed sidenav\n menu_id.removeAttr('style');\n menu_id.css('width', options.menuWidth);\n }\n }\n });\n }\n }\n\n\n\n // Touch Event\n var panning = false;\n var menuOut = false;\n\n dragTarget.on('click', function(){\n removeMenu();\n });\n\n dragTarget.hammer({\n prevent_default: false\n }).bind('pan', function(e) {\n\n if (e.gesture.pointerType == \"touch\") {\n\n var direction = e.gesture.direction;\n var x = e.gesture.center.x;\n var y = e.gesture.center.y;\n var velocityX = e.gesture.velocityX;\n\n // Disable Scrolling\n $('body').css('overflow', 'hidden');\n\n // If overlay does not exist, create one and if it is clicked, close menu\n if ($('#sidenav-overlay').length === 0) {\n var overlay = $('<div id=\"sidenav-overlay\"></div>');\n overlay.css('opacity', 0).click( function(){\n removeMenu();\n });\n $('body').append(overlay);\n }\n\n // Keep within boundaries\n if (options.edge === 'left') {\n if (x > options.menuWidth) { x = options.menuWidth; }\n else if (x < 0) { x = 0; }\n }\n\n if (options.edge === 'left') {\n // Left Direction\n if (x < (options.menuWidth / 2)) { menuOut = false; }\n // Right Direction\n else if (x >= (options.menuWidth / 2)) { menuOut = true; }\n\n menu_id.css('left', (x - options.menuWidth));\n }\n else {\n // Left Direction\n if (x < (window.innerWidth - options.menuWidth / 2)) {\n menuOut = true;\n }\n // Right Direction\n else if (x >= (window.innerWidth - options.menuWidth / 2)) {\n menuOut = false;\n }\n var rightPos = -1 *(x - options.menuWidth / 2);\n if (rightPos > 0) {\n rightPos = 0;\n }\n\n menu_id.css('right', rightPos);\n }\n\n\n\n\n // Percentage overlay\n var overlayPerc;\n if (options.edge === 'left') {\n overlayPerc = x / options.menuWidth;\n $('#sidenav-overlay').velocity({opacity: overlayPerc }, {duration: 50, queue: false, easing: 'easeOutQuad'});\n }\n else {\n overlayPerc = Math.abs((x - window.innerWidth) / options.menuWidth);\n $('#sidenav-overlay').velocity({opacity: overlayPerc }, {duration: 50, queue: false, easing: 'easeOutQuad'});\n }\n }\n\n }).bind('panend', function(e) {\n\n if (e.gesture.pointerType == \"touch\") {\n var velocityX = e.gesture.velocityX;\n panning = false;\n if (options.edge === 'left') {\n // If velocityX <= 0.3 then the user is flinging the menu closed so ignore menuOut\n if ((menuOut && velocityX <= 0.3) || velocityX < -0.5) {\n menu_id.velocity({left: 0}, {duration: 300, queue: false, easing: 'easeOutQuad'});\n $('#sidenav-overlay').velocity({opacity: 1 }, {duration: 50, queue: false, easing: 'easeOutQuad'});\n dragTarget.css({width: '50%', right: 0, left: ''});\n }\n else if (!menuOut || velocityX > 0.3) {\n // Enable Scrolling\n $('body').css('overflow', '');\n // Slide menu closed\n menu_id.velocity({left: -1 * (options.menuWidth + 10)}, {duration: 200, queue: false, easing: 'easeOutQuad'});\n $('#sidenav-overlay').velocity({opacity: 0 }, {duration: 200, queue: false, easing: 'easeOutQuad',\n complete: function () {\n $(this).remove();\n }});\n dragTarget.css({width: '10px', right: '', left: 0});\n }\n }\n else {\n if ((menuOut && velocityX >= -0.3) || velocityX > 0.5) {\n menu_id.velocity({right: 0}, {duration: 300, queue: false, easing: 'easeOutQuad'});\n $('#sidenav-overlay').velocity({opacity: 1 }, {duration: 50, queue: false, easing: 'easeOutQuad'});\n dragTarget.css({width: '50%', right: '', left: 0});\n }\n else if (!menuOut || velocityX < -0.3) {\n // Enable Scrolling\n $('body').css('overflow', '');\n // Slide menu closed\n menu_id.velocity({right: -1 * (options.menuWidth + 10)}, {duration: 200, queue: false, easing: 'easeOutQuad'});\n $('#sidenav-overlay').velocity({opacity: 0 }, {duration: 200, queue: false, easing: 'easeOutQuad',\n complete: function () {\n $(this).remove();\n }});\n dragTarget.css({width: '10px', right: 0, left: ''});\n }\n }\n\n }\n });\n\n $this.click(function() {\n if (menuOut === true) {\n menuOut = false;\n panning = false;\n removeMenu();\n }\n else {\n\n // Disable Scrolling\n $('body').css('overflow', 'hidden');\n // Push current drag target on top of DOM tree\n $('body').append(dragTarget);\n \n if (options.edge === 'left') {\n dragTarget.css({width: '50%', right: 0, left: ''});\n menu_id.velocity({left: 0}, {duration: 300, queue: false, easing: 'easeOutQuad'});\n }\n else {\n dragTarget.css({width: '50%', right: '', left: 0});\n menu_id.velocity({right: 0}, {duration: 300, queue: false, easing: 'easeOutQuad'});\n menu_id.css('left','');\n }\n\n var overlay = $('<div id=\"sidenav-overlay\"></div>');\n overlay.css('opacity', 0)\n .click(function(){\n menuOut = false;\n panning = false;\n removeMenu();\n overlay.velocity({opacity: 0}, {duration: 300, queue: false, easing: 'easeOutQuad',\n complete: function() {\n $(this).remove();\n } });\n\n });\n $('body').append(overlay);\n overlay.velocity({opacity: 1}, {duration: 300, queue: false, easing: 'easeOutQuad',\n complete: function () {\n menuOut = true;\n panning = false;\n }\n });\n }\n\n return false;\n });\n });\n\n\n },\n show : function() {\n this.trigger('click');\n },\n hide : function() {\n $('#sidenav-overlay').trigger('click');\n }\n };\n\n\n $.fn.sideNav = function(methodOrOptions) {\n if ( methods[methodOrOptions] ) {\n return methods[ methodOrOptions ].apply( this, Array.prototype.slice.call( arguments, 1 ));\n } else if ( typeof methodOrOptions === 'object' || ! methodOrOptions ) {\n // Default to \"init\"\n return methods.init.apply( this, arguments );\n } else {\n $.error( 'Method ' + methodOrOptions + ' does not exist on jQuery.sideNav' );\n }\n }; // Plugin end\n}( jQuery ));\n;/**\n * Extend jquery with a scrollspy plugin.\n * This watches the window scroll and fires events when elements are scrolled into viewport.\n *\n * throttle() and getTime() taken from Underscore.js\n * https://github.com/jashkenas/underscore\n *\n * @author Copyright 2013 John Smart\n * @license https://raw.github.com/thesmart/jquery-scrollspy/master/LICENSE\n * @see https://github.com/thesmart\n * @version 0.1.2\n */\n(function($) {\n\n\tvar jWindow = $(window);\n\tvar elements = [];\n\tvar elementsInView = [];\n\tvar isSpying = false;\n\tvar ticks = 0;\n\tvar unique_id = 1;\n\tvar offset = {\n\t\ttop : 0,\n\t\tright : 0,\n\t\tbottom : 0,\n\t\tleft : 0,\n\t}\n\n\t/**\n\t * Find elements that are within the boundary\n\t * @param {number} top\n\t * @param {number} right\n\t * @param {number} bottom\n\t * @param {number} left\n\t * @return {jQuery}\t\tA collection of elements\n\t */\n\tfunction findElements(top, right, bottom, left) {\n\t\tvar hits = $();\n\t\t$.each(elements, function(i, element) {\n\t\t\tif (element.height() > 0) {\n\t\t\t\tvar elTop = element.offset().top,\n\t\t\t\t\telLeft = element.offset().left,\n\t\t\t\t\telRight = elLeft + element.width(),\n\t\t\t\t\telBottom = elTop + element.height();\n\n\t\t\t\tvar isIntersect = !(elLeft > right ||\n\t\t\t\t\telRight < left ||\n\t\t\t\t\telTop > bottom ||\n\t\t\t\t\telBottom < top);\n\n\t\t\t\tif (isIntersect) {\n\t\t\t\t\thits.push(element);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\n\t\treturn hits;\n\t}\n\n\n\t/**\n\t * Called when the user scrolls the window\n\t */\n\tfunction onScroll() {\n\t\t// unique tick id\n\t\t++ticks;\n\n\t\t// viewport rectangle\n\t\tvar top = jWindow.scrollTop(),\n\t\t\tleft = jWindow.scrollLeft(),\n\t\t\tright = left + jWindow.width(),\n\t\t\tbottom = top + jWindow.height();\n\n\t\t// determine which elements are in view\n// + 60 accounts for fixed nav\n\t\tvar intersections = findElements(top+offset.top + 200, right+offset.right, bottom+offset.bottom, left+offset.left);\n\t\t$.each(intersections, function(i, element) {\n\n\t\t\tvar lastTick = element.data('scrollSpy:ticks');\n\t\t\tif (typeof lastTick != 'number') {\n\t\t\t\t// entered into view\n\t\t\t\telement.triggerHandler('scrollSpy:enter');\n\t\t\t}\n\n\t\t\t// update tick id\n\t\t\telement.data('scrollSpy:ticks', ticks);\n\t\t});\n\n\t\t// determine which elements are no longer in view\n\t\t$.each(elementsInView, function(i, element) {\n\t\t\tvar lastTick = element.data('scrollSpy:ticks');\n\t\t\tif (typeof lastTick == 'number' && lastTick !== ticks) {\n\t\t\t\t// exited from view\n\t\t\t\telement.triggerHandler('scrollSpy:exit');\n\t\t\t\telement.data('scrollSpy:ticks', null);\n\t\t\t}\n\t\t});\n\n\t\t// remember elements in view for next tick\n\t\telementsInView = intersections;\n\t}\n\n\t/**\n\t * Called when window is resized\n\t*/\n\tfunction onWinSize() {\n\t\tjWindow.trigger('scrollSpy:winSize');\n\t}\n\n\t/**\n\t * Get time in ms\n * @license https://raw.github.com/jashkenas/underscore/master/LICENSE\n\t * @type {function}\n\t * @return {number}\n\t */\n\tvar getTime = (Date.now || function () {\n\t\treturn new Date().getTime();\n\t});\n\n\t/**\n\t * Returns a function, that, when invoked, will only be triggered at most once\n\t * during a given window of time. Normally, the throttled function will run\n\t * as much as it can, without ever going more than once per `wait` duration;\n\t * but if you'd like to disable the execution on the leading edge, pass\n\t * `{leading: false}`. To disable execution on the trailing edge, ditto.\n\t * @license https://raw.github.com/jashkenas/underscore/master/LICENSE\n\t * @param {function} func\n\t * @param {number} wait\n\t * @param {Object=} options\n\t * @returns {Function}\n\t */\n\tfunction throttle(func, wait, options) {\n\t\tvar context, args, result;\n\t\tvar timeout = null;\n\t\tvar previous = 0;\n\t\toptions || (options = {});\n\t\tvar later = function () {\n\t\t\tprevious = options.leading === false ? 0 : getTime();\n\t\t\ttimeout = null;\n\t\t\tresult = func.apply(context, args);\n\t\t\tcontext = args = null;\n\t\t};\n\t\treturn function () {\n\t\t\tvar now = getTime();\n\t\t\tif (!previous && options.leading === false) previous = now;\n\t\t\tvar remaining = wait - (now - previous);\n\t\t\tcontext = this;\n\t\t\targs = arguments;\n\t\t\tif (remaining <= 0) {\n\t\t\t\tclearTimeout(timeout);\n\t\t\t\ttimeout = null;\n\t\t\t\tprevious = now;\n\t\t\t\tresult = func.apply(context, args);\n\t\t\t\tcontext = args = null;\n\t\t\t} else if (!timeout && options.trailing !== false) {\n\t\t\t\ttimeout = setTimeout(later, remaining);\n\t\t\t}\n\t\t\treturn result;\n\t\t};\n\t};\n\n\t/**\n\t * Enables ScrollSpy using a selector\n\t * @param {jQuery|string} selector The elements collection, or a selector\n\t * @param {Object=} options\tOptional.\n throttle : number -> scrollspy throttling. Default: 100 ms\n offsetTop : number -> offset from top. Default: 0\n offsetRight : number -> offset from right. Default: 0\n offsetBottom : number -> offset from bottom. Default: 0\n offsetLeft : number -> offset from left. Default: 0\n\t * @returns {jQuery}\n\t */\n\t$.scrollSpy = function(selector, options) {\n\t\tvar visible = [];\n\t\tselector = $(selector);\n\t\tselector.each(function(i, element) {\n\t\t\telements.push($(element));\n\t\t\t$(element).data(\"scrollSpy:id\", i);\n\t\t\t// Smooth scroll to section\n\t\t $('a[href=#' + $(element).attr('id') + ']').click(function(e) {\n\t\t e.preventDefault();\n\t\t var offset = $(this.hash).offset().top + 1;\n\n// offset - 200 allows elements near bottom of page to scroll\n\t\t\t\n\t \t$('html, body').animate({ scrollTop: offset - 200 }, {duration: 400, queue: false, easing: 'easeOutCubic'});\n\t\t\t\n\t\t });\n\t\t});\n\t\toptions = options || {\n\t\t\tthrottle: 100\n\t\t};\n\n\t\toffset.top = options.offsetTop || 0;\n\t\toffset.right = options.offsetRight || 0;\n\t\toffset.bottom = options.offsetBottom || 0;\n\t\toffset.left = options.offsetLeft || 0;\n\n\t\tvar throttledScroll = throttle(onScroll, options.throttle || 100);\n\t\tvar readyScroll = function(){\n\t\t\t$(document).ready(throttledScroll);\n\t\t};\n\n\t\tif (!isSpying) {\n\t\t\tjWindow.on('scroll', readyScroll);\n\t\t\tjWindow.on('resize', readyScroll);\n\t\t\tisSpying = true;\n\t\t}\n\n\t\t// perform a scan once, after current execution context, and after dom is ready\n\t\tsetTimeout(readyScroll, 0);\n\n\n\t\tselector.on('scrollSpy:enter', function() {\n\t\t\tvisible = $.grep(visible, function(value) {\n\t return value.height() != 0;\n\t });\n\n\t\t\tvar $this = $(this);\n\n\t\t\tif (visible[0]) {\n\t\t\t\t$('a[href=#' + visible[0].attr('id') + ']').removeClass('active');\n\t\t\t\tif ($this.data('scrollSpy:id') < visible[0].data('scrollSpy:id')) {\n\t\t\t\t\tvisible.unshift($(this));\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tvisible.push($(this));\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\tvisible.push($(this));\n\t\t\t}\n\n\n\t\t\t$('a[href=#' + visible[0].attr('id') + ']').addClass('active');\n\t\t});\n\t\tselector.on('scrollSpy:exit', function() {\n\t\t\tvisible = $.grep(visible, function(value) {\n\t return value.height() != 0;\n\t });\n\n\t\t\tif (visible[0]) {\n\t\t\t\t$('a[href=#' + visible[0].attr('id') + ']').removeClass('active');\n\t\t\t\tvar $this = $(this);\n\t\t\t\tvisible = $.grep(visible, function(value) {\n\t return value.attr('id') != $this.attr('id');\n\t });\n\t if (visible[0]) { // Check if empty\n\t\t\t\t\t$('a[href=#' + visible[0].attr('id') + ']').addClass('active');\n\t }\n\t\t\t}\n\t\t});\n\n\t\treturn selector;\n\t};\n\n\t/**\n\t * Listen for window resize events\n\t * @param {Object=} options\t\t\t\t\t\tOptional. Set { throttle: number } to change throttling. Default: 100 ms\n\t * @returns {jQuery}\t\t$(window)\n\t */\n\t$.winSizeSpy = function(options) {\n\t\t$.winSizeSpy = function() { return jWindow; }; // lock from multiple calls\n\t\toptions = options || {\n\t\t\tthrottle: 100\n\t\t};\n\t\treturn jWindow.on('resize', throttle(onWinSize, options.throttle || 100));\n\t};\n\n\t/**\n\t * Enables ScrollSpy on a collection of elements\n\t * e.g. $('.scrollSpy').scrollSpy()\n\t * @param {Object=} options\tOptional.\n\t\t\t\t\t\t\t\t\t\t\tthrottle : number -> scrollspy throttling. Default: 100 ms\n\t\t\t\t\t\t\t\t\t\t\toffsetTop : number -> offset from top. Default: 0\n\t\t\t\t\t\t\t\t\t\t\toffsetRight : number -> offset from right. Default: 0\n\t\t\t\t\t\t\t\t\t\t\toffsetBottom : number -> offset from bottom. Default: 0\n\t\t\t\t\t\t\t\t\t\t\toffsetLeft : number -> offset from left. Default: 0\n\t * @returns {jQuery}\n\t */\n\t$.fn.scrollSpy = function(options) {\n\t\treturn $.scrollSpy($(this), options);\n\t};\n\n})(jQuery);;(function ($) {\n $(document).ready(function() {\n\n // Function to update labels of text fields\n Materialize.updateTextFields = function() {\n var input_selector = 'input[type=text], input[type=password], input[type=email], input[type=url], input[type=tel], input[type=number], input[type=search], textarea';\n $(input_selector).each(function(index, element) {\n if ($(element).val().length > 0 || element.autofocus ||$(this).attr('placeholder') !== undefined || $(element)[0].validity.badInput === true) {\n $(this).siblings('label, i').addClass('active');\n }\n else {\n $(this).siblings('label, i').removeClass('active');\n }\n });\n };\n\n // Text based inputs\n var input_selector = 'input[type=text], input[type=password], input[type=email], input[type=url], input[type=tel], input[type=number], input[type=search], textarea';\n\n // Add active if form auto complete\n $(document).on('change', input_selector, function () {\n if($(this).val().length !== 0 || $(this).attr('placeholder') !== undefined) {\n $(this).siblings('label').addClass('active');\n }\n validate_field($(this));\n });\n\n // Add active if input element has been pre-populated on document ready\n $(document).ready(function() {\n Materialize.updateTextFields();\n });\n\n // HTML DOM FORM RESET handling\n $(document).on('reset', function(e) {\n var formReset = $(e.target);\n if (formReset.is('form')) {\n formReset.find(input_selector).removeClass('valid').removeClass('invalid');\n formReset.find(input_selector).each(function () {\n if ($(this).attr('value') === '') {\n $(this).siblings('label, i').removeClass('active');\n }\n });\n\n // Reset select\n formReset.find('select.initialized').each(function () {\n var reset_text = formReset.find('option[selected]').text();\n formReset.siblings('input.select-dropdown').val(reset_text);\n });\n }\n });\n\n // Add active when element has focus\n $(document).on('focus', input_selector, function () {\n $(this).siblings('label, i').addClass('active');\n });\n\n $(document).on('blur', input_selector, function () {\n var $inputElement = $(this);\n if ($inputElement.val().length === 0 && $inputElement[0].validity.badInput !== true && $inputElement.attr('placeholder') === undefined) {\n $inputElement.siblings('label, i').removeClass('active');\n }\n\n if ($inputElement.val().length === 0 && $inputElement[0].validity.badInput !== true && $inputElement.attr('placeholder') !== undefined) {\n $inputElement.siblings('i').removeClass('active');\n }\n validate_field($inputElement);\n });\n\n window.validate_field = function(object) {\n var hasLength = object.attr('length') !== undefined;\n var lenAttr = parseInt(object.attr('length'));\n var len = object.val().length;\n\n if (object.val().length === 0 && object[0].validity.badInput === false) {\n if (object.hasClass('validate')) {\n object.removeClass('valid');\n object.removeClass('invalid');\n }\n }\n else {\n if (object.hasClass('validate')) {\n // Check for character counter attributes\n if ((object.is(':valid') && hasLength && (len <= lenAttr)) || (object.is(':valid') && !hasLength)) {\n object.removeClass('invalid');\n object.addClass('valid');\n }\n else {\n object.removeClass('valid');\n object.addClass('invalid');\n }\n }\n }\n };\n\n\n // Textarea Auto Resize\n var hiddenDiv = $('.hiddendiv').first();\n if (!hiddenDiv.length) {\n hiddenDiv = $('<div class=\"hiddendiv common\"></div>');\n $('body').append(hiddenDiv);\n }\n var text_area_selector = '.materialize-textarea';\n\n function textareaAutoResize($textarea) {\n // Set font properties of hiddenDiv\n\n var fontFamily = $textarea.css('font-family');\n var fontSize = $textarea.css('font-size');\n\n if (fontSize) { hiddenDiv.css('font-size', fontSize); }\n if (fontFamily) { hiddenDiv.css('font-family', fontFamily); }\n\n if ($textarea.attr('wrap') === \"off\") {\n hiddenDiv.css('overflow-wrap', \"normal\")\n .css('white-space', \"pre\");\n }\n\n hiddenDiv.text($textarea.val() + '\\n');\n var content = hiddenDiv.html().replace(/\\n/g, '<br>');\n hiddenDiv.html(content);\n\n\n // When textarea is hidden, width goes crazy.\n // Approximate with half of window size\n\n if ($textarea.is(':visible')) {\n hiddenDiv.css('width', $textarea.width());\n }\n else {\n hiddenDiv.css('width', $(window).width()/2);\n }\n\n $textarea.css('height', hiddenDiv.height());\n }\n\n $(text_area_selector).each(function () {\n var $textarea = $(this);\n if ($textarea.val().length) {\n textareaAutoResize($textarea);\n }\n });\n\n $('body').on('keyup keydown autoresize', text_area_selector, function () {\n textareaAutoResize($(this));\n });\n\n // File Input Path\n $(document).on('change', '.file-field input[type=\"file\"]', function () {\n var file_field = $(this).closest('.file-field');\n var path_input = file_field.find('input.file-path');\n var files = $(this)[0].files;\n var file_names = [];\n for (var i = 0; i < files.length; i++) {\n file_names.push(files[i].name);\n }\n path_input.val(file_names.join(\", \"));\n path_input.trigger('change');\n });\n\n /****************\n * Range Input *\n ****************/\n\n var range_type = 'input[type=range]';\n var range_mousedown = false;\n var left;\n\n $(range_type).each(function () {\n var thumb = $('<span class=\"thumb\"><span class=\"value\"></span></span>');\n $(this).after(thumb);\n });\n\n var range_wrapper = '.range-field';\n $(document).on('change', range_type, function(e) {\n var thumb = $(this).siblings('.thumb');\n thumb.find('.value').html($(this).val());\n });\n\n $(document).on('input mousedown touchstart', range_type, function(e) {\n var thumb = $(this).siblings('.thumb');\n var width = $(this).outerWidth();\n\n // If thumb indicator does not exist yet, create it\n if (thumb.length <= 0) {\n thumb = $('<span class=\"thumb\"><span class=\"value\"></span></span>');\n $(this).after(thumb);\n }\n\n // Set indicator value\n thumb.find('.value').html($(this).val());\n\n range_mousedown = true;\n $(this).addClass('active');\n\n if (!thumb.hasClass('active')) {\n thumb.velocity({ height: \"30px\", width: \"30px\", top: \"-20px\", marginLeft: \"-15px\"}, { duration: 300, easing: 'easeOutExpo' });\n }\n\n if (e.type !== 'input') {\n if(e.pageX === undefined || e.pageX === null){//mobile\n left = e.originalEvent.touches[0].pageX - $(this).offset().left;\n }\n else{ // desktop\n left = e.pageX - $(this).offset().left;\n }\n if (left < 0) {\n left = 0;\n }\n else if (left > width) {\n left = width;\n }\n thumb.addClass('active').css('left', left);\n }\n\n thumb.find('.value').html($(this).val());\n });\n\n $(document).on('mouseup touchend', range_wrapper, function() {\n range_mousedown = false;\n $(this).removeClass('active');\n });\n\n $(document).on('mousemove touchmove', range_wrapper, function(e) {\n var thumb = $(this).children('.thumb');\n var left;\n if (range_mousedown) {\n if (!thumb.hasClass('active')) {\n thumb.velocity({ height: '30px', width: '30px', top: '-20px', marginLeft: '-15px'}, { duration: 300, easing: 'easeOutExpo' });\n }\n if (e.pageX === undefined || e.pageX === null) { //mobile\n left = e.originalEvent.touches[0].pageX - $(this).offset().left;\n }\n else{ // desktop\n left = e.pageX - $(this).offset().left;\n }\n var width = $(this).outerWidth();\n\n if (left < 0) {\n left = 0;\n }\n else if (left > width) {\n left = width;\n }\n thumb.addClass('active').css('left', left);\n thumb.find('.value').html(thumb.siblings(range_type).val());\n }\n });\n\n $(document).on('mouseout touchleave', range_wrapper, function() {\n if (!range_mousedown) {\n\n var thumb = $(this).children('.thumb');\n\n if (thumb.hasClass('active')) {\n thumb.velocity({ height: '0', width: '0', top: '10px', marginLeft: '-6px'}, { duration: 100 });\n }\n thumb.removeClass('active');\n }\n });\n }); // End of $(document).ready\n\n /*******************\n * Select Plugin *\n ******************/\n $.fn.material_select = function (callback) {\n $(this).each(function(){\n var $select = $(this);\n\n if ($select.hasClass('browser-default')) {\n return; // Continue to next (return false breaks out of entire loop)\n }\n\n var multiple = $select.attr('multiple') ? true : false,\n lastID = $select.data('select-id'); // Tear down structure if Select needs to be rebuilt\n\n if (lastID) {\n $select.parent().find('span.caret').remove();\n $select.parent().find('input').remove();\n\n $select.unwrap();\n $('ul#select-options-'+lastID).remove();\n }\n\n // If destroying the select, remove the selelct-id and reset it to it's uninitialized state.\n if(callback === 'destroy') {\n $select.data('select-id', null).removeClass('initialized');\n return;\n }\n\n var uniqueID = Materialize.guid();\n $select.data('select-id', uniqueID);\n var wrapper = $('<div class=\"select-wrapper\"></div>');\n wrapper.addClass($select.attr('class'));\n var options = $('<ul id=\"select-options-' + uniqueID +'\" class=\"dropdown-content select-dropdown ' + (multiple ? 'multiple-select-dropdown' : '') + '\"></ul>'),\n selectChildren = $select.children('option, optgroup'),\n valuesSelected = [],\n optionsHover = false;\n\n var label = $select.find('option:selected').html() || $select.find('option:first').html() || \"\";\n\n // Function that renders and appends the option taking into\n // account type and possible image icon.\n var appendOptionWithIcon = function(select, option, type) {\n // Add disabled attr if disabled\n var disabledClass = (option.is(':disabled')) ? 'disabled ' : '';\n\n // add icons\n var icon_url = option.data('icon');\n var classes = option.attr('class');\n if (!!icon_url) {\n var classString = '';\n if (!!classes) classString = ' class=\"' + classes + '\"';\n\n // Check for multiple type.\n if (type === 'multiple') {\n options.append($('<li class=\"' + disabledClass + '\"><img src=\"' + icon_url + '\"' + classString + '><span><input type=\"checkbox\"' + disabledClass + '/><label></label>' + option.html() + '</span></li>'));\n } else {\n options.append($('<li class=\"' + disabledClass + '\"><img src=\"' + icon_url + '\"' + classString + '><span>' + option.html() + '</span></li>'));\n }\n return true;\n }\n\n // Check for multiple type.\n if (type === 'multiple') {\n options.append($('<li class=\"' + disabledClass + '\"><span><input type=\"checkbox\"' + disabledClass + '/><label></label>' + option.html() + '</span></li>'));\n } else {\n options.append($('<li class=\"' + disabledClass + '\"><span>' + option.html() + '</span></li>'));\n }\n };\n\n /* Create dropdown structure. */\n if (selectChildren.length) {\n selectChildren.each(function() {\n if ($(this).is('option')) {\n // Direct descendant option.\n if (multiple) {\n appendOptionWithIcon($select, $(this), 'multiple');\n\n } else {\n appendOptionWithIcon($select, $(this));\n }\n } else if ($(this).is('optgroup')) {\n // Optgroup.\n var selectOptions = $(this).children('option');\n options.append($('<li class=\"optgroup\"><span>' + $(this).attr('label') + '</span></li>'));\n\n selectOptions.each(function() {\n appendOptionWithIcon($select, $(this));\n });\n }\n });\n }\n\n options.find('li:not(.optgroup)').each(function (i) {\n $(this).click(function (e) {\n // Check if option element is disabled\n if (!$(this).hasClass('disabled') && !$(this).hasClass('optgroup')) {\n var selected = true;\n\n if (multiple) {\n $('input[type=\"checkbox\"]', this).prop('checked', function(i, v) { return !v; });\n selected = toggleEntryFromArray(valuesSelected, $(this).index(), $select);\n $newSelect.trigger('focus');\n } else {\n options.find('li').removeClass('active');\n $(this).toggleClass('active');\n $newSelect.val($(this).text());\n }\n\n activateOption(options, $(this));\n $select.find('option').eq(i).prop('selected', selected);\n // Trigger onchange() event\n $select.trigger('change');\n if (typeof callback !== 'undefined') callback();\n }\n\n e.stopPropagation();\n });\n });\n\n // Wrap Elements\n $select.wrap(wrapper);\n // Add Select Display Element\n var dropdownIcon = $('<span class=\"caret\">▼</span>');\n if ($select.is(':disabled'))\n dropdownIcon.addClass('disabled');\n\n // escape double quotes\n var sanitizedLabelHtml = label.replace(/\"/g, '"');\n\n var $newSelect = $('<input type=\"text\" class=\"select-dropdown\" readonly=\"true\" ' + (($select.is(':disabled')) ? 'disabled' : '') + ' data-activates=\"select-options-' + uniqueID +'\" value=\"'+ sanitizedLabelHtml +'\"/>');\n $select.before($newSelect);\n $newSelect.before(dropdownIcon);\n\n $newSelect.after(options);\n // Check if section element is disabled\n if (!$select.is(':disabled')) {\n $newSelect.dropdown({'hover': false, 'closeOnClick': false});\n }\n\n // Copy tabindex\n if ($select.attr('tabindex')) {\n $($newSelect[0]).attr('tabindex', $select.attr('tabindex'));\n }\n\n $select.addClass('initialized');\n\n $newSelect.on({\n 'focus': function (){\n if ($('ul.select-dropdown').not(options[0]).is(':visible')) {\n $('input.select-dropdown').trigger('close');\n }\n if (!options.is(':visible')) {\n $(this).trigger('open', ['focus']);\n var label = $(this).val();\n var selectedOption = options.find('li').filter(function() {\n return $(this).text().toLowerCase() === label.toLowerCase();\n })[0];\n activateOption(options, selectedOption);\n }\n },\n 'click': function (e){\n e.stopPropagation();\n }\n });\n\n $newSelect.on('blur', function() {\n if (!multiple) {\n $(this).trigger('close');\n }\n options.find('li.selected').removeClass('selected');\n });\n\n options.hover(function() {\n optionsHover = true;\n }, function () {\n optionsHover = false;\n });\n\n $(window).on({\n 'click': function () {\n multiple && (optionsHover || $newSelect.trigger('close'));\n }\n });\n\n // Add initial multiple selections.\n if (multiple) {\n $select.find(\"option:selected:not(:disabled)\").each(function () {\n var index = $(this).index();\n\n toggleEntryFromArray(valuesSelected, index, $select);\n options.find(\"li\").eq(index).find(\":checkbox\").prop(\"checked\", true);\n });\n }\n\n // Make option as selected and scroll to selected position\n activateOption = function(collection, newOption) {\n if (newOption) {\n collection.find('li.selected').removeClass('selected');\n var option = $(newOption);\n option.addClass('selected');\n options.scrollTo(option);\n }\n };\n\n // Allow user to search by typing\n // this array is cleared after 1 second\n var filterQuery = [],\n onKeyDown = function(e){\n // TAB - switch to another input\n if(e.which == 9){\n $newSelect.trigger('close');\n return;\n }\n\n // ARROW DOWN WHEN SELECT IS CLOSED - open select options\n if(e.which == 40 && !options.is(':visible')){\n $newSelect.trigger('open');\n return;\n }\n\n // ENTER WHEN SELECT IS CLOSED - submit form\n if(e.which == 13 && !options.is(':visible')){\n return;\n }\n\n e.preventDefault();\n\n // CASE WHEN USER TYPE LETTERS\n var letter = String.fromCharCode(e.which).toLowerCase(),\n nonLetters = [9,13,27,38,40];\n if (letter && (nonLetters.indexOf(e.which) === -1)) {\n filterQuery.push(letter);\n\n var string = filterQuery.join(''),\n newOption = options.find('li').filter(function() {\n return $(this).text().toLowerCase().indexOf(string) === 0;\n })[0];\n\n if (newOption) {\n activateOption(options, newOption);\n }\n }\n\n // ENTER - select option and close when select options are opened\n if (e.which == 13) {\n var activeOption = options.find('li.selected:not(.disabled)')[0];\n if(activeOption){\n $(activeOption).trigger('click');\n if (!multiple) {\n $newSelect.trigger('close');\n }\n }\n }\n\n // ARROW DOWN - move to next not disabled option\n if (e.which == 40) {\n if (options.find('li.selected').length) {\n newOption = options.find('li.selected').next('li:not(.disabled)')[0];\n } else {\n newOption = options.find('li:not(.disabled)')[0];\n }\n activateOption(options, newOption);\n }\n\n // ESC - close options\n if (e.which == 27) {\n $newSelect.trigger('close');\n }\n\n // ARROW UP - move to previous not disabled option\n if (e.which == 38) {\n newOption = options.find('li.selected').prev('li:not(.disabled)')[0];\n if(newOption)\n activateOption(options, newOption);\n }\n\n // Automaticaly clean filter query so user can search again by starting letters\n setTimeout(function(){ filterQuery = []; }, 1000);\n };\n\n $newSelect.on('keydown', onKeyDown);\n });\n\n function toggleEntryFromArray(entriesArray, entryIndex, select) {\n var index = entriesArray.indexOf(entryIndex),\n notAdded = index === -1;\n\n if (notAdded) {\n entriesArray.push(entryIndex);\n } else {\n entriesArray.splice(index, 1);\n }\n\n select.siblings('ul.dropdown-content').find('li').eq(entryIndex).toggleClass('active');\n\n // use notAdded instead of true (to detect if the option is selected or not)\n select.find('option').eq(entryIndex).prop('selected', notAdded);\n setValueToInput(entriesArray, select);\n\n return notAdded;\n }\n\n function setValueToInput(entriesArray, select) {\n var value = '';\n\n for (var i = 0, count = entriesArray.length; i < count; i++) {\n var text = select.find('option').eq(entriesArray[i]).text();\n\n i === 0 ? value += text : value += ', ' + text;\n }\n\n if (value === '') {\n value = select.find('option:disabled').eq(0).text();\n }\n\n select.siblings('input.select-dropdown').val(value);\n }\n };\n\n}( jQuery ));\n;(function ($) {\n\n var methods = {\n\n init : function(options) {\n var defaults = {\n indicators: true,\n height: 400,\n transition: 500,\n interval: 6000\n };\n options = $.extend(defaults, options);\n\n return this.each(function() {\n\n // For each slider, we want to keep track of\n // which slide is active and its associated content\n var $this = $(this);\n var $slider = $this.find('ul.slides').first();\n var $slides = $slider.find('li');\n var $active_index = $slider.find('.active').index();\n var $active, $indicators, $interval;\n if ($active_index != -1) { $active = $slides.eq($active_index); }\n\n // Transitions the caption depending on alignment\n function captionTransition(caption, duration) {\n if (caption.hasClass(\"center-align\")) {\n caption.velocity({opacity: 0, translateY: -100}, {duration: duration, queue: false});\n }\n else if (caption.hasClass(\"right-align\")) {\n caption.velocity({opacity: 0, translateX: 100}, {duration: duration, queue: false});\n }\n else if (caption.hasClass(\"left-align\")) {\n caption.velocity({opacity: 0, translateX: -100}, {duration: duration, queue: false});\n }\n }\n\n // This function will transition the slide to any index of the next slide\n function moveToSlide(index) {\n // Wrap around indices.\n if (index >= $slides.length) index = 0;\n else if (index < 0) index = $slides.length -1;\n\n $active_index = $slider.find('.active').index();\n\n // Only do if index changes\n if ($active_index != index) {\n $active = $slides.eq($active_index);\n $caption = $active.find('.caption');\n\n $active.removeClass('active');\n $active.velocity({opacity: 0}, {duration: options.transition, queue: false, easing: 'easeOutQuad',\n complete: function() {\n $slides.not('.active').velocity({opacity: 0, translateX: 0, translateY: 0}, {duration: 0, queue: false});\n } });\n captionTransition($caption, options.transition);\n\n\n // Update indicators\n if (options.indicators) {\n $indicators.eq($active_index).removeClass('active');\n }\n\n $slides.eq(index).velocity({opacity: 1}, {duration: options.transition, queue: false, easing: 'easeOutQuad'});\n $slides.eq(index).find('.caption').velocity({opacity: 1, translateX: 0, translateY: 0}, {duration: options.transition, delay: options.transition, queue: false, easing: 'easeOutQuad'});\n $slides.eq(index).addClass('active');\n\n\n // Update indicators\n if (options.indicators) {\n $indicators.eq(index).addClass('active');\n }\n }\n }\n\n // Set height of slider\n // If fullscreen, do nothing\n if (!$this.hasClass('fullscreen')) {\n if (options.indicators) {\n // Add height if indicators are present\n $this.height(options.height + 40);\n }\n else {\n $this.height(options.height);\n }\n $slider.height(options.height);\n }\n\n\n // Set initial positions of captions\n $slides.find('.caption').each(function () {\n captionTransition($(this), 0);\n });\n\n // Move img src into background-image\n $slides.find('img').each(function () {\n var placeholderBase64 = 'data:image/gif;base64,R0lGODlhAQABAIABAP///wAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==';\n if ($(this).attr('src') !== placeholderBase64) {\n $(this).css('background-image', 'url(' + $(this).attr('src') + ')' );\n $(this).attr('src', placeholderBase64);\n }\n });\n\n // dynamically add indicators\n if (options.indicators) {\n $indicators = $('<ul class=\"indicators\"></ul>');\n $slides.each(function( index ) {\n var $indicator = $('<li class=\"indicator-item\"></li>');\n\n // Handle clicks on indicators\n $indicator.click(function () {\n var $parent = $slider.parent();\n var curr_index = $parent.find($(this)).index();\n moveToSlide(curr_index);\n\n // reset interval\n clearInterval($interval);\n $interval = setInterval(\n function(){\n $active_index = $slider.find('.active').index();\n if ($slides.length == $active_index + 1) $active_index = 0; // loop to start\n else $active_index += 1;\n\n moveToSlide($active_index);\n\n }, options.transition + options.interval\n );\n });\n $indicators.append($indicator);\n });\n $this.append($indicators);\n $indicators = $this.find('ul.indicators').find('li.indicator-item');\n }\n\n if ($active) {\n $active.show();\n }\n else {\n $slides.first().addClass('active').velocity({opacity: 1}, {duration: options.transition, queue: false, easing: 'easeOutQuad'});\n\n $active_index = 0;\n $active = $slides.eq($active_index);\n\n // Update indicators\n if (options.indicators) {\n $indicators.eq($active_index).addClass('active');\n }\n }\n\n // Adjust height to current slide\n $active.find('img').each(function() {\n $active.find('.caption').velocity({opacity: 1, translateX: 0, translateY: 0}, {duration: options.transition, queue: false, easing: 'easeOutQuad'});\n });\n\n // auto scroll\n $interval = setInterval(\n function(){\n $active_index = $slider.find('.active').index();\n moveToSlide($active_index + 1);\n\n }, options.transition + options.interval\n );\n\n\n // HammerJS, Swipe navigation\n\n // Touch Event\n var panning = false;\n var swipeLeft = false;\n var swipeRight = false;\n\n $this.hammer({\n prevent_default: false\n }).bind('pan', function(e) {\n if (e.gesture.pointerType === \"touch\") {\n\n // reset interval\n clearInterval($interval);\n\n var direction = e.gesture.direction;\n var x = e.gesture.deltaX;\n var velocityX = e.gesture.velocityX;\n\n $curr_slide = $slider.find('.active');\n $curr_slide.velocity({ translateX: x\n }, {duration: 50, queue: false, easing: 'easeOutQuad'});\n\n // Swipe Left\n if (direction === 4 && (x > ($this.innerWidth() / 2) || velocityX < -0.65)) {\n swipeRight = true;\n }\n // Swipe Right\n else if (direction === 2 && (x < (-1 * $this.innerWidth() / 2) || velocityX > 0.65)) {\n swipeLeft = true;\n }\n\n // Make Slide Behind active slide visible\n var next_slide;\n if (swipeLeft) {\n next_slide = $curr_slide.next();\n if (next_slide.length === 0) {\n next_slide = $slides.first();\n }\n next_slide.velocity({ opacity: 1\n }, {duration: 300, queue: false, easing: 'easeOutQuad'});\n }\n if (swipeRight) {\n next_slide = $curr_slide.prev();\n if (next_slide.length === 0) {\n next_slide = $slides.last();\n }\n next_slide.velocity({ opacity: 1\n }, {duration: 300, queue: false, easing: 'easeOutQuad'});\n }\n\n\n }\n\n }).bind('panend', function(e) {\n if (e.gesture.pointerType === \"touch\") {\n\n $curr_slide = $slider.find('.active');\n panning = false;\n curr_index = $slider.find('.active').index();\n\n if (!swipeRight && !swipeLeft) {\n // Return to original spot\n $curr_slide.velocity({ translateX: 0\n }, {duration: 300, queue: false, easing: 'easeOutQuad'});\n }\n else if (swipeLeft) {\n moveToSlide(curr_index + 1);\n $curr_slide.velocity({translateX: -1 * $this.innerWidth() }, {duration: 300, queue: false, easing: 'easeOutQuad',\n complete: function() {\n $curr_slide.velocity({opacity: 0, translateX: 0}, {duration: 0, queue: false});\n } });\n }\n else if (swipeRight) {\n moveToSlide(curr_index - 1);\n $curr_slide.velocity({translateX: $this.innerWidth() }, {duration: 300, queue: false, easing: 'easeOutQuad',\n complete: function() {\n $curr_slide.velocity({opacity: 0, translateX: 0}, {duration: 0, queue: false});\n } });\n }\n swipeLeft = false;\n swipeRight = false;\n\n // Restart interval\n clearInterval($interval);\n $interval = setInterval(\n function(){\n $active_index = $slider.find('.active').index();\n if ($slides.length == $active_index + 1) $active_index = 0; // loop to start\n else $active_index += 1;\n\n moveToSlide($active_index);\n\n }, options.transition + options.interval\n );\n }\n });\n\n $this.on('sliderPause', function() {\n clearInterval($interval);\n });\n\n $this.on('sliderStart', function() {\n clearInterval($interval);\n $interval = setInterval(\n function(){\n $active_index = $slider.find('.active').index();\n if ($slides.length == $active_index + 1) $active_index = 0; // loop to start\n else $active_index += 1;\n\n moveToSlide($active_index);\n\n }, options.transition + options.interval\n );\n });\n\n $this.on('sliderNext', function() {\n $active_index = $slider.find('.active').index();\n moveToSlide($active_index + 1);\n });\n\n $this.on('sliderPrev', function() {\n $active_index = $slider.find('.active').index();\n moveToSlide($active_index - 1);\n });\n\n });\n\n\n\n },\n pause : function() {\n $(this).trigger('sliderPause');\n },\n start : function() {\n $(this).trigger('sliderStart');\n },\n next : function() {\n $(this).trigger('sliderNext');\n },\n prev : function() {\n $(this).trigger('sliderPrev');\n }\n };\n\n\n $.fn.slider = function(methodOrOptions) {\n if ( methods[methodOrOptions] ) {\n return methods[ methodOrOptions ].apply( this, Array.prototype.slice.call( arguments, 1 ));\n } else if ( typeof methodOrOptions === 'object' || ! methodOrOptions ) {\n // Default to \"init\"\n return methods.init.apply( this, arguments );\n } else {\n $.error( 'Method ' + methodOrOptions + ' does not exist on jQuery.tooltip' );\n }\n }; // Plugin end\n}( jQuery ));;(function ($) {\n $(document).ready(function() {\n\n $(document).on('click.card', '.card', function (e) {\n if ($(this).find('> .card-reveal').length) {\n if ($(e.target).is($('.card-reveal .card-title')) || $(e.target).is($('.card-reveal .card-title i'))) {\n // Make Reveal animate down and display none\n $(this).find('.card-reveal').velocity(\n {translateY: 0}, {\n duration: 225,\n queue: false,\n easing: 'easeInOutQuad',\n complete: function() { $(this).css({ display: 'none'}); }\n }\n );\n }\n else if ($(e.target).is($('.card .activator')) ||\n $(e.target).is($('.card .activator i')) ) {\n $(e.target).closest('.card').css('overflow', 'hidden');\n $(this).find('.card-reveal').css({ display: 'block'}).velocity(\"stop\", false).velocity({translateY: '-100%'}, {duration: 300, queue: false, easing: 'easeInOutQuad'});\n }\n }\n\n $('.card-reveal').closest('.card').css('overflow', 'hidden');\n\n });\n\n });\n}( jQuery ));;(function ($) {\n $(document).ready(function() {\n\n $(document).on('click.chip', '.chip .material-icons', function (e) {\n $(this).parent().remove();\n });\n\n });\n}( jQuery ));;(function ($) {\n $(document).ready(function() {\n\n $.fn.pushpin = function (options) {\n\n var defaults = {\n top: 0,\n bottom: Infinity,\n offset: 0\n }\n options = $.extend(defaults, options);\n\n $index = 0;\n return this.each(function() {\n var $uniqueId = Materialize.guid(),\n $this = $(this),\n $original_offset = $(this).offset().top;\n\n function removePinClasses(object) {\n object.removeClass('pin-top');\n object.removeClass('pinned');\n object.removeClass('pin-bottom');\n }\n\n function updateElements(objects, scrolled) {\n objects.each(function () {\n // Add position fixed (because its between top and bottom)\n if (options.top <= scrolled && options.bottom >= scrolled && !$(this).hasClass('pinned')) {\n removePinClasses($(this));\n $(this).css('top', options.offset);\n $(this).addClass('pinned');\n }\n\n // Add pin-top (when scrolled position is above top)\n if (scrolled < options.top && !$(this).hasClass('pin-top')) {\n removePinClasses($(this));\n $(this).css('top', 0);\n $(this).addClass('pin-top');\n }\n\n // Add pin-bottom (when scrolled position is below bottom)\n if (scrolled > options.bottom && !$(this).hasClass('pin-bottom')) {\n removePinClasses($(this));\n $(this).addClass('pin-bottom');\n $(this).css('top', options.bottom - $original_offset);\n }\n });\n }\n\n updateElements($this, $(window).scrollTop());\n $(window).on('scroll.' + $uniqueId, function () {\n var $scrolled = $(window).scrollTop() + options.offset;\n updateElements($this, $scrolled);\n });\n\n });\n\n };\n\n\n });\n}( jQuery ));;(function ($) {\n $(document).ready(function() {\n\n // jQuery reverse\n $.fn.reverse = [].reverse;\n\n // Hover behaviour: make sure this doesn't work on .click-to-toggle FABs!\n $(document).on('mouseenter.fixedActionBtn', '.fixed-action-btn:not(.click-to-toggle)', function(e) {\n var $this = $(this);\n openFABMenu($this);\n });\n $(document).on('mouseleave.fixedActionBtn', '.fixed-action-btn:not(.click-to-toggle)', function(e) {\n var $this = $(this);\n closeFABMenu($this);\n });\n\n // Toggle-on-click behaviour.\n $(document).on('click.fixedActionBtn', '.fixed-action-btn.click-to-toggle > a', function(e) {\n var $this = $(this);\n var $menu = $this.parent();\n if ($menu.hasClass('active')) {\n closeFABMenu($menu);\n } else {\n openFABMenu($menu);\n }\n });\n\n });\n\n $.fn.extend({\n openFAB: function() {\n openFABMenu($(this));\n },\n closeFAB: function() {\n closeFABMenu($(this));\n }\n });\n\n\n var openFABMenu = function (btn) {\n $this = btn;\n if ($this.hasClass('active') === false) {\n\n // Get direction option\n var horizontal = $this.hasClass('horizontal');\n var offsetY, offsetX;\n\n if (horizontal === true) {\n offsetX = 40;\n } else {\n offsetY = 40;\n }\n\n $this.addClass('active');\n $this.find('ul .btn-floating').velocity(\n { scaleY: \".4\", scaleX: \".4\", translateY: offsetY + 'px', translateX: offsetX + 'px'},\n { duration: 0 });\n\n var time = 0;\n $this.find('ul .btn-floating').reverse().each( function () {\n $(this).velocity(\n { opacity: \"1\", scaleX: \"1\", scaleY: \"1\", translateY: \"0\", translateX: '0'},\n { duration: 80, delay: time });\n time += 40;\n });\n }\n };\n\n var closeFABMenu = function (btn) {\n $this = btn;\n // Get direction option\n var horizontal = $this.hasClass('horizontal');\n var offsetY, offsetX;\n\n if (horizontal === true) {\n offsetX = 40;\n } else {\n offsetY = 40;\n }\n\n $this.removeClass('active');\n var time = 0;\n $this.find('ul .btn-floating').velocity(\"stop\", true);\n $this.find('ul .btn-floating').velocity(\n { opacity: \"0\", scaleX: \".4\", scaleY: \".4\", translateY: offsetY + 'px', translateX: offsetX + 'px'},\n { duration: 80 }\n );\n };\n\n\n}( jQuery ));\n;(function ($) {\n // Image transition function\n Materialize.fadeInImage = function(selector){\n var element = $(selector);\n element.css({opacity: 0});\n $(element).velocity({opacity: 1}, {\n duration: 650,\n queue: false,\n easing: 'easeOutSine'\n });\n $(element).velocity({opacity: 1}, {\n duration: 1300,\n queue: false,\n easing: 'swing',\n step: function(now, fx) {\n fx.start = 100;\n var grayscale_setting = now/100;\n var brightness_setting = 150 - (100 - now)/1.75;\n\n if (brightness_setting < 100) {\n brightness_setting = 100;\n }\n if (now >= 0) {\n $(this).css({\n \"-webkit-filter\": \"grayscale(\"+grayscale_setting+\")\" + \"brightness(\"+brightness_setting+\"%)\",\n \"filter\": \"grayscale(\"+grayscale_setting+\")\" + \"brightness(\"+brightness_setting+\"%)\"\n });\n }\n }\n });\n };\n\n // Horizontal staggered list\n Materialize.showStaggeredList = function(selector) {\n var time = 0;\n $(selector).find('li').velocity(\n { translateX: \"-100px\"},\n { duration: 0 });\n\n $(selector).find('li').each(function() {\n $(this).velocity(\n { opacity: \"1\", translateX: \"0\"},\n { duration: 800, delay: time, easing: [60, 10] });\n time += 120;\n });\n };\n\n\n $(document).ready(function() {\n // Hardcoded .staggered-list scrollFire\n // var staggeredListOptions = [];\n // $('ul.staggered-list').each(function (i) {\n\n // var label = 'scrollFire-' + i;\n // $(this).addClass(label);\n // staggeredListOptions.push(\n // {selector: 'ul.staggered-list.' + label,\n // offset: 200,\n // callback: 'showStaggeredList(\"ul.staggered-list.' + label + '\")'});\n // });\n // scrollFire(staggeredListOptions);\n\n // HammerJS, Swipe navigation\n\n // Touch Event\n var swipeLeft = false;\n var swipeRight = false;\n\n\n // Dismissible Collections\n $('.dismissable').each(function() {\n $(this).hammer({\n prevent_default: false\n }).bind('pan', function(e) {\n if (e.gesture.pointerType === \"touch\") {\n var $this = $(this);\n var direction = e.gesture.direction;\n var x = e.gesture.deltaX;\n var velocityX = e.gesture.velocityX;\n\n $this.velocity({ translateX: x\n }, {duration: 50, queue: false, easing: 'easeOutQuad'});\n\n // Swipe Left\n if (direction === 4 && (x > ($this.innerWidth() / 2) || velocityX < -0.75)) {\n swipeLeft = true;\n }\n\n // Swipe Right\n if (direction === 2 && (x < (-1 * $this.innerWidth() / 2) || velocityX > 0.75)) {\n swipeRight = true;\n }\n }\n }).bind('panend', function(e) {\n // Reset if collection is moved back into original position\n if (Math.abs(e.gesture.deltaX) < ($(this).innerWidth() / 2)) {\n swipeRight = false;\n swipeLeft = false;\n }\n\n if (e.gesture.pointerType === \"touch\") {\n var $this = $(this);\n if (swipeLeft || swipeRight) {\n var fullWidth;\n if (swipeLeft) { fullWidth = $this.innerWidth(); }\n else { fullWidth = -1 * $this.innerWidth(); }\n\n $this.velocity({ translateX: fullWidth,\n }, {duration: 100, queue: false, easing: 'easeOutQuad', complete:\n function() {\n $this.css('border', 'none');\n $this.velocity({ height: 0, padding: 0,\n }, {duration: 200, queue: false, easing: 'easeOutQuad', complete:\n function() { $this.remove(); }\n });\n }\n });\n }\n else {\n $this.velocity({ translateX: 0,\n }, {duration: 100, queue: false, easing: 'easeOutQuad'});\n }\n swipeLeft = false;\n swipeRight = false;\n }\n });\n\n });\n\n\n // time = 0\n // // Vertical Staggered list\n // $('ul.staggered-list.vertical li').velocity(\n // { translateY: \"100px\"},\n // { duration: 0 });\n\n // $('ul.staggered-list.vertical li').each(function() {\n // $(this).velocity(\n // { opacity: \"1\", translateY: \"0\"},\n // { duration: 800, delay: time, easing: [60, 25] });\n // time += 120;\n // });\n\n // // Fade in and Scale\n // $('.fade-in.scale').velocity(\n // { scaleX: .4, scaleY: .4, translateX: -600},\n // { duration: 0});\n // $('.fade-in').each(function() {\n // $(this).velocity(\n // { opacity: \"1\", scaleX: 1, scaleY: 1, translateX: 0},\n // { duration: 800, easing: [60, 10] });\n // });\n });\n}( jQuery ));\n;(function($) {\n\n // Input: Array of JSON objects {selector, offset, callback}\n\n Materialize.scrollFire = function(options) {\n\n var didScroll = false;\n\n window.addEventListener(\"scroll\", function() {\n didScroll = true;\n });\n\n // Rate limit to 100ms\n setInterval(function() {\n if(didScroll) {\n didScroll = false;\n\n var windowScroll = window.pageYOffset + window.innerHeight;\n\n for (var i = 0 ; i < options.length; i++) {\n // Get options from each line\n var value = options[i];\n var selector = value.selector,\n offset = value.offset,\n callback = value.callback;\n\n var currentElement = document.querySelector(selector);\n if ( currentElement !== null) {\n var elementOffset = currentElement.getBoundingClientRect().top + window.pageYOffset;\n\n if (windowScroll > (elementOffset + offset)) {\n if (value.done !== true) {\n var callbackFunc = new Function(callback);\n callbackFunc();\n value.done = true;\n }\n }\n }\n }\n }\n }, 100);\n };\n\n})(jQuery);;/*!\n * pickadate.js v3.5.0, 2014/04/13\n * By Amsul, http://amsul.ca\n * Hosted on http://amsul.github.io/pickadate.js\n * Licensed under MIT\n */\n\n(function ( factory ) {\n\n // AMD.\n if ( typeof define == 'function' && define.amd )\n define( 'picker', ['jquery'], factory )\n\n // Node.js/browserify.\n else if ( typeof exports == 'object' )\n module.exports = factory( require('jquery') )\n\n // Browser globals.\n else this.Picker = factory( jQuery )\n\n}(function( $ ) {\n\nvar $window = $( window )\nvar $document = $( document )\nvar $html = $( document.documentElement )\n\n\n/**\n * The picker constructor that creates a blank picker.\n */\nfunction PickerConstructor( ELEMENT, NAME, COMPONENT, OPTIONS ) {\n\n // If there’s no element, return the picker constructor.\n if ( !ELEMENT ) return PickerConstructor\n\n\n var\n IS_DEFAULT_THEME = false,\n\n\n // The state of the picker.\n STATE = {\n id: ELEMENT.id || 'P' + Math.abs( ~~(Math.random() * new Date()) )\n },\n\n\n // Merge the defaults and options passed.\n SETTINGS = COMPONENT ? $.extend( true, {}, COMPONENT.defaults, OPTIONS ) : OPTIONS || {},\n\n\n // Merge the default classes with the settings classes.\n CLASSES = $.extend( {}, PickerConstructor.klasses(), SETTINGS.klass ),\n\n\n // The element node wrapper into a jQuery object.\n $ELEMENT = $( ELEMENT ),\n\n\n // Pseudo picker constructor.\n PickerInstance = function() {\n return this.start()\n },\n\n\n // The picker prototype.\n P = PickerInstance.prototype = {\n\n constructor: PickerInstance,\n\n $node: $ELEMENT,\n\n\n /**\n * Initialize everything\n */\n start: function() {\n\n // If it’s already started, do nothing.\n if ( STATE && STATE.start ) return P\n\n\n // Update the picker states.\n STATE.methods = {}\n STATE.start = true\n STATE.open = false\n STATE.type = ELEMENT.type\n\n\n // Confirm focus state, convert into text input to remove UA stylings,\n // and set as readonly to prevent keyboard popup.\n ELEMENT.autofocus = ELEMENT == getActiveElement()\n ELEMENT.readOnly = !SETTINGS.editable\n ELEMENT.id = ELEMENT.id || STATE.id\n if ( ELEMENT.type != 'text' ) {\n ELEMENT.type = 'text'\n }\n\n\n // Create a new picker component with the settings.\n P.component = new COMPONENT(P, SETTINGS)\n\n\n // Create the picker root with a holder and then prepare it.\n P.$root = $( PickerConstructor._.node('div', createWrappedComponent(), CLASSES.picker, 'id=\"' + ELEMENT.id + '_root\" tabindex=\"0\"') )\n prepareElementRoot()\n\n\n // If there’s a format for the hidden input element, create the element.\n if ( SETTINGS.formatSubmit ) {\n prepareElementHidden()\n }\n\n\n // Prepare the input element.\n prepareElement()\n\n\n // Insert the root as specified in the settings.\n if ( SETTINGS.container ) $( SETTINGS.container ).append( P.$root )\n else $ELEMENT.after( P.$root )\n\n\n // Bind the default component and settings events.\n P.on({\n start: P.component.onStart,\n render: P.component.onRender,\n stop: P.component.onStop,\n open: P.component.onOpen,\n close: P.component.onClose,\n set: P.component.onSet\n }).on({\n start: SETTINGS.onStart,\n render: SETTINGS.onRender,\n stop: SETTINGS.onStop,\n open: SETTINGS.onOpen,\n close: SETTINGS.onClose,\n set: SETTINGS.onSet\n })\n\n\n // Once we’re all set, check the theme in use.\n IS_DEFAULT_THEME = isUsingDefaultTheme( P.$root.children()[ 0 ] )\n\n\n // If the element has autofocus, open the picker.\n if ( ELEMENT.autofocus ) {\n P.open()\n }\n\n\n // Trigger queued the “start” and “render” events.\n return P.trigger( 'start' ).trigger( 'render' )\n }, //start\n\n\n /**\n * Render a new picker\n */\n render: function( entireComponent ) {\n\n // Insert a new component holder in the root or box.\n if ( entireComponent ) P.$root.html( createWrappedComponent() )\n else P.$root.find( '.' + CLASSES.box ).html( P.component.nodes( STATE.open ) )\n\n // Trigger the queued “render” events.\n return P.trigger( 'render' )\n }, //render\n\n\n /**\n * Destroy everything\n */\n stop: function() {\n\n // If it’s already stopped, do nothing.\n if ( !STATE.start ) return P\n\n // Then close the picker.\n P.close()\n\n // Remove the hidden field.\n if ( P._hidden ) {\n P._hidden.parentNode.removeChild( P._hidden )\n }\n\n // Remove the root.\n P.$root.remove()\n\n // Remove the input class, remove the stored data, and unbind\n // the events (after a tick for IE - see `P.close`).\n $ELEMENT.removeClass( CLASSES.input ).removeData( NAME )\n setTimeout( function() {\n $ELEMENT.off( '.' + STATE.id )\n }, 0)\n\n // Restore the element state\n ELEMENT.type = STATE.type\n ELEMENT.readOnly = false\n\n // Trigger the queued “stop” events.\n P.trigger( 'stop' )\n\n // Reset the picker states.\n STATE.methods = {}\n STATE.start = false\n\n return P\n }, //stop\n\n\n /**\n * Open up the picker\n */\n open: function( dontGiveFocus ) {\n\n // If it’s already open, do nothing.\n if ( STATE.open ) return P\n\n // Add the “active” class.\n $ELEMENT.addClass( CLASSES.active )\n aria( ELEMENT, 'expanded', true )\n\n // * A Firefox bug, when `html` has `overflow:hidden`, results in\n // killing transitions :(. So add the “opened” state on the next tick.\n // Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=625289\n setTimeout( function() {\n\n // Add the “opened” class to the picker root.\n P.$root.addClass( CLASSES.opened )\n aria( P.$root[0], 'hidden', false )\n\n }, 0 )\n\n // If we have to give focus, bind the element and doc events.\n if ( dontGiveFocus !== false ) {\n\n // Set it as open.\n STATE.open = true\n\n // Prevent the page from scrolling.\n if ( IS_DEFAULT_THEME ) {\n $html.\n css( 'overflow', 'hidden' ).\n css( 'padding-right', '+=' + getScrollbarWidth() )\n }\n\n // Pass focus to the root element’s jQuery object.\n // * Workaround for iOS8 to bring the picker’s root into view.\n P.$root[0].focus()\n\n // Bind the document events.\n $document.on( 'click.' + STATE.id + ' focusin.' + STATE.id, function( event ) {\n\n var target = event.target\n\n // If the target of the event is not the element, close the picker picker.\n // * Don’t worry about clicks or focusins on the root because those don’t bubble up.\n // Also, for Firefox, a click on an `option` element bubbles up directly\n // to the doc. So make sure the target wasn't the doc.\n // * In Firefox stopPropagation() doesn’t prevent right-click events from bubbling,\n // which causes the picker to unexpectedly close when right-clicking it. So make\n // sure the event wasn’t a right-click.\n if ( target != ELEMENT && target != document && event.which != 3 ) {\n\n // If the target was the holder that covers the screen,\n // keep the element focused to maintain tabindex.\n P.close( target === P.$root.children()[0] )\n }\n\n }).on( 'keydown.' + STATE.id, function( event ) {\n\n var\n // Get the keycode.\n keycode = event.keyCode,\n\n // Translate that to a selection change.\n keycodeToMove = P.component.key[ keycode ],\n\n // Grab the target.\n target = event.target\n\n\n // On escape, close the picker and give focus.\n if ( keycode == 27 ) {\n P.close( true )\n }\n\n\n // Check if there is a key movement or “enter” keypress on the element.\n else if ( target == P.$root[0] && ( keycodeToMove || keycode == 13 ) ) {\n\n // Prevent the default action to stop page movement.\n event.preventDefault()\n\n // Trigger the key movement action.\n if ( keycodeToMove ) {\n PickerConstructor._.trigger( P.component.key.go, P, [ PickerConstructor._.trigger( keycodeToMove ) ] )\n }\n\n // On “enter”, if the highlighted item isn’t disabled, set the value and close.\n else if ( !P.$root.find( '.' + CLASSES.highlighted ).hasClass( CLASSES.disabled ) ) {\n P.set( 'select', P.component.item.highlight ).close()\n }\n }\n\n\n // If the target is within the root and “enter” is pressed,\n // prevent the default action and trigger a click on the target instead.\n else if ( $.contains( P.$root[0], target ) && keycode == 13 ) {\n event.preventDefault()\n target.click()\n }\n })\n }\n\n // Trigger the queued “open” events.\n return P.trigger( 'open' )\n }, //open\n\n\n /**\n * Close the picker\n */\n close: function( giveFocus ) {\n\n // If we need to give focus, do it before changing states.\n if ( giveFocus ) {\n // ....ah yes! It would’ve been incomplete without a crazy workaround for IE :|\n // The focus is triggered *after* the close has completed - causing it\n // to open again. So unbind and rebind the event at the next tick.\n P.$root.off( 'focus.toOpen' )[0].focus()\n setTimeout( function() {\n P.$root.on( 'focus.toOpen', handleFocusToOpenEvent )\n }, 0 )\n }\n\n // Remove the “active” class.\n $ELEMENT.removeClass( CLASSES.active )\n aria( ELEMENT, 'expanded', false )\n\n // * A Firefox bug, when `html` has `overflow:hidden`, results in\n // killing transitions :(. So remove the “opened” state on the next tick.\n // Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=625289\n setTimeout( function() {\n\n // Remove the “opened” and “focused” class from the picker root.\n P.$root.removeClass( CLASSES.opened + ' ' + CLASSES.focused )\n aria( P.$root[0], 'hidden', true )\n\n }, 0 )\n\n // If it’s already closed, do nothing more.\n if ( !STATE.open ) return P\n\n // Set it as closed.\n STATE.open = false\n\n // Allow the page to scroll.\n if ( IS_DEFAULT_THEME ) {\n $html.\n css( 'overflow', '' ).\n css( 'padding-right', '-=' + getScrollbarWidth() )\n }\n\n // Unbind the document events.\n $document.off( '.' + STATE.id )\n\n // Trigger the queued “close” events.\n return P.trigger( 'close' )\n }, //close\n\n\n /**\n * Clear the values\n */\n clear: function( options ) {\n return P.set( 'clear', null, options )\n }, //clear\n\n\n /**\n * Set something\n */\n set: function( thing, value, options ) {\n\n var thingItem, thingValue,\n thingIsObject = $.isPlainObject( thing ),\n thingObject = thingIsObject ? thing : {}\n\n // Make sure we have usable options.\n options = thingIsObject && $.isPlainObject( value ) ? value : options || {}\n\n if ( thing ) {\n\n // If the thing isn’t an object, make it one.\n if ( !thingIsObject ) {\n thingObject[ thing ] = value\n }\n\n // Go through the things of items to set.\n for ( thingItem in thingObject ) {\n\n // Grab the value of the thing.\n thingValue = thingObject[ thingItem ]\n\n // First, if the item exists and there’s a value, set it.\n if ( thingItem in P.component.item ) {\n if ( thingValue === undefined ) thingValue = null\n P.component.set( thingItem, thingValue, options )\n }\n\n // Then, check to update the element value and broadcast a change.\n if ( thingItem == 'select' || thingItem == 'clear' ) {\n $ELEMENT.\n val( thingItem == 'clear' ? '' : P.get( thingItem, SETTINGS.format ) ).\n trigger( 'change' )\n }\n }\n\n // Render a new picker.\n P.render()\n }\n\n // When the method isn’t muted, trigger queued “set” events and pass the `thingObject`.\n return options.muted ? P : P.trigger( 'set', thingObject )\n }, //set\n\n\n /**\n * Get something\n */\n get: function( thing, format ) {\n\n // Make sure there’s something to get.\n thing = thing || 'value'\n\n // If a picker state exists, return that.\n if ( STATE[ thing ] != null ) {\n return STATE[ thing ]\n }\n\n // Return the submission value, if that.\n if ( thing == 'valueSubmit' ) {\n if ( P._hidden ) {\n return P._hidden.value\n }\n thing = 'value'\n }\n\n // Return the value, if that.\n if ( thing == 'value' ) {\n return ELEMENT.value\n }\n\n // Check if a component item exists, return that.\n if ( thing in P.component.item ) {\n if ( typeof format == 'string' ) {\n var thingValue = P.component.get( thing )\n return thingValue ?\n PickerConstructor._.trigger(\n P.component.formats.toString,\n P.component,\n [ format, thingValue ]\n ) : ''\n }\n return P.component.get( thing )\n }\n }, //get\n\n\n\n /**\n * Bind events on the things.\n */\n on: function( thing, method, internal ) {\n\n var thingName, thingMethod,\n thingIsObject = $.isPlainObject( thing ),\n thingObject = thingIsObject ? thing : {}\n\n if ( thing ) {\n\n // If the thing isn’t an object, make it one.\n if ( !thingIsObject ) {\n thingObject[ thing ] = method\n }\n\n // Go through the things to bind to.\n for ( thingName in thingObject ) {\n\n // Grab the method of the thing.\n thingMethod = thingObject[ thingName ]\n\n // If it was an internal binding, prefix it.\n if ( internal ) {\n thingName = '_' + thingName\n }\n\n // Make sure the thing methods collection exists.\n STATE.methods[ thingName ] = STATE.methods[ thingName ] || []\n\n // Add the method to the relative method collection.\n STATE.methods[ thingName ].push( thingMethod )\n }\n }\n\n return P\n }, //on\n\n\n\n /**\n * Unbind events on the things.\n */\n off: function() {\n var i, thingName,\n names = arguments;\n for ( i = 0, namesCount = names.length; i < namesCount; i += 1 ) {\n thingName = names[i]\n if ( thingName in STATE.methods ) {\n delete STATE.methods[thingName]\n }\n }\n return P\n },\n\n\n /**\n * Fire off method events.\n */\n trigger: function( name, data ) {\n var _trigger = function( name ) {\n var methodList = STATE.methods[ name ]\n if ( methodList ) {\n methodList.map( function( method ) {\n PickerConstructor._.trigger( method, P, [ data ] )\n })\n }\n }\n _trigger( '_' + name )\n _trigger( name )\n return P\n } //trigger\n } //PickerInstance.prototype\n\n\n /**\n * Wrap the picker holder components together.\n */\n function createWrappedComponent() {\n\n // Create a picker wrapper holder\n return PickerConstructor._.node( 'div',\n\n // Create a picker wrapper node\n PickerConstructor._.node( 'div',\n\n // Create a picker frame\n PickerConstructor._.node( 'div',\n\n // Create a picker box node\n PickerConstructor._.node( 'div',\n\n // Create the components nodes.\n P.component.nodes( STATE.open ),\n\n // The picker box class\n CLASSES.box\n ),\n\n // Picker wrap class\n CLASSES.wrap\n ),\n\n // Picker frame class\n CLASSES.frame\n ),\n\n // Picker holder class\n CLASSES.holder\n ) //endreturn\n } //createWrappedComponent\n\n\n\n /**\n * Prepare the input element with all bindings.\n */\n function prepareElement() {\n\n $ELEMENT.\n\n // Store the picker data by component name.\n data(NAME, P).\n\n // Add the “input” class name.\n addClass(CLASSES.input).\n\n // Remove the tabindex.\n attr('tabindex', -1).\n\n // If there’s a `data-value`, update the value of the element.\n val( $ELEMENT.data('value') ?\n P.get('select', SETTINGS.format) :\n ELEMENT.value\n )\n\n\n // Only bind keydown events if the element isn’t editable.\n if ( !SETTINGS.editable ) {\n\n $ELEMENT.\n\n // On focus/click, focus onto the root to open it up.\n on( 'focus.' + STATE.id + ' click.' + STATE.id, function( event ) {\n event.preventDefault()\n P.$root[0].focus()\n }).\n\n // Handle keyboard event based on the picker being opened or not.\n on( 'keydown.' + STATE.id, handleKeydownEvent )\n }\n\n\n // Update the aria attributes.\n aria(ELEMENT, {\n haspopup: true,\n expanded: false,\n readonly: false,\n owns: ELEMENT.id + '_root'\n })\n }\n\n\n /**\n * Prepare the root picker element with all bindings.\n */\n function prepareElementRoot() {\n\n P.$root.\n\n on({\n\n // For iOS8.\n keydown: handleKeydownEvent,\n\n // When something within the root is focused, stop from bubbling\n // to the doc and remove the “focused” state from the root.\n focusin: function( event ) {\n P.$root.removeClass( CLASSES.focused )\n event.stopPropagation()\n },\n\n // When something within the root holder is clicked, stop it\n // from bubbling to the doc.\n 'mousedown click': function( event ) {\n\n var target = event.target\n\n // Make sure the target isn’t the root holder so it can bubble up.\n if ( target != P.$root.children()[ 0 ] ) {\n\n event.stopPropagation()\n\n // * For mousedown events, cancel the default action in order to\n // prevent cases where focus is shifted onto external elements\n // when using things like jQuery mobile or MagnificPopup (ref: #249 & #120).\n // Also, for Firefox, don’t prevent action on the `option` element.\n if ( event.type == 'mousedown' && !$( target ).is( 'input, select, textarea, button, option' )) {\n\n event.preventDefault()\n\n // Re-focus onto the root so that users can click away\n // from elements focused within the picker.\n P.$root[0].focus()\n }\n }\n }\n }).\n\n // Add/remove the “target” class on focus and blur.\n on({\n focus: function() {\n $ELEMENT.addClass( CLASSES.target )\n },\n blur: function() {\n $ELEMENT.removeClass( CLASSES.target )\n }\n }).\n\n // Open the picker and adjust the root “focused” state\n on( 'focus.toOpen', handleFocusToOpenEvent ).\n\n // If there’s a click on an actionable element, carry out the actions.\n on( 'click', '[data-pick], [data-nav], [data-clear], [data-close]', function() {\n\n var $target = $( this ),\n targetData = $target.data(),\n targetDisabled = $target.hasClass( CLASSES.navDisabled ) || $target.hasClass( CLASSES.disabled ),\n\n // * For IE, non-focusable elements can be active elements as well\n // (http://stackoverflow.com/a/2684561).\n activeElement = getActiveElement()\n activeElement = activeElement && ( activeElement.type || activeElement.href )\n\n // If it’s disabled or nothing inside is actively focused, re-focus the element.\n if ( targetDisabled || activeElement && !$.contains( P.$root[0], activeElement ) ) {\n P.$root[0].focus()\n }\n\n // If something is superficially changed, update the `highlight` based on the `nav`.\n if ( !targetDisabled && targetData.nav ) {\n P.set( 'highlight', P.component.item.highlight, { nav: targetData.nav } )\n }\n\n // If something is picked, set `select` then close with focus.\n else if ( !targetDisabled && 'pick' in targetData ) {\n P.set( 'select', targetData.pick )\n }\n\n // If a “clear” button is pressed, empty the values and close with focus.\n else if ( targetData.clear ) {\n P.clear().close( true )\n }\n\n else if ( targetData.close ) {\n P.close( true )\n }\n\n }) //P.$root\n\n aria( P.$root[0], 'hidden', true )\n }\n\n\n /**\n * Prepare the hidden input element along with all bindings.\n */\n function prepareElementHidden() {\n\n var name\n\n if ( SETTINGS.hiddenName === true ) {\n name = ELEMENT.name\n ELEMENT.name = ''\n }\n else {\n name = [\n typeof SETTINGS.hiddenPrefix == 'string' ? SETTINGS.hiddenPrefix : '',\n typeof SETTINGS.hiddenSuffix == 'string' ? SETTINGS.hiddenSuffix : '_submit'\n ]\n name = name[0] + ELEMENT.name + name[1]\n }\n\n P._hidden = $(\n '<input ' +\n 'type=hidden ' +\n\n // Create the name using the original input’s with a prefix and suffix.\n 'name=\"' + name + '\"' +\n\n // If the element has a value, set the hidden value as well.\n (\n $ELEMENT.data('value') || ELEMENT.value ?\n ' value=\"' + P.get('select', SETTINGS.formatSubmit) + '\"' :\n ''\n ) +\n '>'\n )[0]\n\n $ELEMENT.\n\n // If the value changes, update the hidden input with the correct format.\n on('change.' + STATE.id, function() {\n P._hidden.value = ELEMENT.value ?\n P.get('select', SETTINGS.formatSubmit) :\n ''\n })\n\n\n // Insert the hidden input as specified in the settings.\n if ( SETTINGS.container ) $( SETTINGS.container ).append( P._hidden )\n else $ELEMENT.after( P._hidden )\n }\n\n\n // For iOS8.\n function handleKeydownEvent( event ) {\n\n var keycode = event.keyCode,\n\n // Check if one of the delete keys was pressed.\n isKeycodeDelete = /^(8|46)$/.test(keycode)\n\n // For some reason IE clears the input value on “escape”.\n if ( keycode == 27 ) {\n P.close()\n return false\n }\n\n // Check if `space` or `delete` was pressed or the picker is closed with a key movement.\n if ( keycode == 32 || isKeycodeDelete || !STATE.open && P.component.key[keycode] ) {\n\n // Prevent it from moving the page and bubbling to doc.\n event.preventDefault()\n event.stopPropagation()\n\n // If `delete` was pressed, clear the values and close the picker.\n // Otherwise open the picker.\n if ( isKeycodeDelete ) { P.clear().close() }\n else { P.open() }\n }\n }\n\n\n // Separated for IE\n function handleFocusToOpenEvent( event ) {\n\n // Stop the event from propagating to the doc.\n event.stopPropagation()\n\n // If it’s a focus event, add the “focused” class to the root.\n if ( event.type == 'focus' ) {\n P.$root.addClass( CLASSES.focused )\n }\n\n // And then finally open the picker.\n P.open()\n }\n\n\n // Return a new picker instance.\n return new PickerInstance()\n} //PickerConstructor\n\n\n\n/**\n * The default classes and prefix to use for the HTML classes.\n */\nPickerConstructor.klasses = function( prefix ) {\n prefix = prefix || 'picker'\n return {\n\n picker: prefix,\n opened: prefix + '--opened',\n focused: prefix + '--focused',\n\n input: prefix + '__input',\n active: prefix + '__input--active',\n target: prefix + '__input--target',\n\n holder: prefix + '__holder',\n\n frame: prefix + '__frame',\n wrap: prefix + '__wrap',\n\n box: prefix + '__box'\n }\n} //PickerConstructor.klasses\n\n\n\n/**\n * Check if the default theme is being used.\n */\nfunction isUsingDefaultTheme( element ) {\n\n var theme,\n prop = 'position'\n\n // For IE.\n if ( element.currentStyle ) {\n theme = element.currentStyle[prop]\n }\n\n // For normal browsers.\n else if ( window.getComputedStyle ) {\n theme = getComputedStyle( element )[prop]\n }\n\n return theme == 'fixed'\n}\n\n\n\n/**\n * Get the width of the browser’s scrollbar.\n * Taken from: https://github.com/VodkaBears/Remodal/blob/master/src/jquery.remodal.js\n */\nfunction getScrollbarWidth() {\n\n if ( $html.height() <= $window.height() ) {\n return 0\n }\n\n var $outer = $( '<div style=\"visibility:hidden;width:100px\" />' ).\n appendTo( 'body' )\n\n // Get the width without scrollbars.\n var widthWithoutScroll = $outer[0].offsetWidth\n\n // Force adding scrollbars.\n $outer.css( 'overflow', 'scroll' )\n\n // Add the inner div.\n var $inner = $( '<div style=\"width:100%\" />' ).appendTo( $outer )\n\n // Get the width with scrollbars.\n var widthWithScroll = $inner[0].offsetWidth\n\n // Remove the divs.\n $outer.remove()\n\n // Return the difference between the widths.\n return widthWithoutScroll - widthWithScroll\n}\n\n\n\n/**\n * PickerConstructor helper methods.\n */\nPickerConstructor._ = {\n\n /**\n * Create a group of nodes. Expects:\n * `\n {\n min: {Integer},\n max: {Integer},\n i: {Integer},\n node: {String},\n item: {Function}\n }\n * `\n */\n group: function( groupObject ) {\n\n var\n // Scope for the looped object\n loopObjectScope,\n\n // Create the nodes list\n nodesList = '',\n\n // The counter starts from the `min`\n counter = PickerConstructor._.trigger( groupObject.min, groupObject )\n\n\n // Loop from the `min` to `max`, incrementing by `i`\n for ( ; counter <= PickerConstructor._.trigger( groupObject.max, groupObject, [ counter ] ); counter += groupObject.i ) {\n\n // Trigger the `item` function within scope of the object\n loopObjectScope = PickerConstructor._.trigger( groupObject.item, groupObject, [ counter ] )\n\n // Splice the subgroup and create nodes out of the sub nodes\n nodesList += PickerConstructor._.node(\n groupObject.node,\n loopObjectScope[ 0 ], // the node\n loopObjectScope[ 1 ], // the classes\n loopObjectScope[ 2 ] // the attributes\n )\n }\n\n // Return the list of nodes\n return nodesList\n }, //group\n\n\n /**\n * Create a dom node string\n */\n node: function( wrapper, item, klass, attribute ) {\n\n // If the item is false-y, just return an empty string\n if ( !item ) return ''\n\n // If the item is an array, do a join\n item = $.isArray( item ) ? item.join( '' ) : item\n\n // Check for the class\n klass = klass ? ' class=\"' + klass + '\"' : ''\n\n // Check for any attributes\n attribute = attribute ? ' ' + attribute : ''\n\n // Return the wrapped item\n return '<' + wrapper + klass + attribute + '>' + item + '</' + wrapper + '>'\n }, //node\n\n\n /**\n * Lead numbers below 10 with a zero.\n */\n lead: function( number ) {\n return ( number < 10 ? '0': '' ) + number\n },\n\n\n /**\n * Trigger a function otherwise return the value.\n */\n trigger: function( callback, scope, args ) {\n return typeof callback == 'function' ? callback.apply( scope, args || [] ) : callback\n },\n\n\n /**\n * If the second character is a digit, length is 2 otherwise 1.\n */\n digits: function( string ) {\n return ( /\\d/ ).test( string[ 1 ] ) ? 2 : 1\n },\n\n\n /**\n * Tell if something is a date object.\n */\n isDate: function( value ) {\n return {}.toString.call( value ).indexOf( 'Date' ) > -1 && this.isInteger( value.getDate() )\n },\n\n\n /**\n * Tell if something is an integer.\n */\n isInteger: function( value ) {\n return {}.toString.call( value ).indexOf( 'Number' ) > -1 && value % 1 === 0\n },\n\n\n /**\n * Create ARIA attribute strings.\n */\n ariaAttr: ariaAttr\n} //PickerConstructor._\n\n\n\n/**\n * Extend the picker with a component and defaults.\n */\nPickerConstructor.extend = function( name, Component ) {\n\n // Extend jQuery.\n $.fn[ name ] = function( options, action ) {\n\n // Grab the component data.\n var componentData = this.data( name )\n\n // If the picker is requested, return the data object.\n if ( options == 'picker' ) {\n return componentData\n }\n\n // If the component data exists and `options` is a string, carry out the action.\n if ( componentData && typeof options == 'string' ) {\n return PickerConstructor._.trigger( componentData[ options ], componentData, [ action ] )\n }\n\n // Otherwise go through each matched element and if the component\n // doesn’t exist, create a new picker using `this` element\n // and merging the defaults and options with a deep copy.\n return this.each( function() {\n var $this = $( this )\n if ( !$this.data( name ) ) {\n new PickerConstructor( this, name, Component, options )\n }\n })\n }\n\n // Set the defaults.\n $.fn[ name ].defaults = Component.defaults\n} //PickerConstructor.extend\n\n\n\nfunction aria(element, attribute, value) {\n if ( $.isPlainObject(attribute) ) {\n for ( var key in attribute ) {\n ariaSet(element, key, attribute[key])\n }\n }\n else {\n ariaSet(element, attribute, value)\n }\n}\nfunction ariaSet(element, attribute, value) {\n element.setAttribute(\n (attribute == 'role' ? '' : 'aria-') + attribute,\n value\n )\n}\nfunction ariaAttr(attribute, data) {\n if ( !$.isPlainObject(attribute) ) {\n attribute = { attribute: data }\n }\n data = ''\n for ( var key in attribute ) {\n var attr = (key == 'role' ? '' : 'aria-') + key,\n attrVal = attribute[key]\n data += attrVal == null ? '' : attr + '=\"' + attribute[key] + '\"'\n }\n return data\n}\n\n// IE8 bug throws an error for activeElements within iframes.\nfunction getActiveElement() {\n try {\n return document.activeElement\n } catch ( err ) { }\n}\n\n\n\n// Expose the picker constructor.\nreturn PickerConstructor\n\n\n}));\n\n\n;/*!\n * Date picker for pickadate.js v3.5.0\n * http://amsul.github.io/pickadate.js/date.htm\n */\n\n(function ( factory ) {\n\n // AMD.\n if ( typeof define == 'function' && define.amd )\n define( ['picker', 'jquery'], factory )\n\n // Node.js/browserify.\n else if ( typeof exports == 'object' )\n module.exports = factory( require('./picker.js'), require('jquery') )\n\n // Browser globals.\n else factory( Picker, jQuery )\n\n}(function( Picker, $ ) {\n\n\n/**\n * Globals and constants\n */\nvar DAYS_IN_WEEK = 7,\n WEEKS_IN_CALENDAR = 6,\n _ = Picker._\n\n\n\n/**\n * The date picker constructor\n */\nfunction DatePicker( picker, settings ) {\n\n var calendar = this,\n element = picker.$node[ 0 ],\n elementValue = element.value,\n elementDataValue = picker.$node.data( 'value' ),\n valueString = elementDataValue || elementValue,\n formatString = elementDataValue ? settings.formatSubmit : settings.format,\n isRTL = function() {\n\n return element.currentStyle ?\n\n // For IE.\n element.currentStyle.direction == 'rtl' :\n\n // For normal browsers.\n getComputedStyle( picker.$root[0] ).direction == 'rtl'\n }\n\n calendar.settings = settings\n calendar.$node = picker.$node\n\n // The queue of methods that will be used to build item objects.\n calendar.queue = {\n min: 'measure create',\n max: 'measure create',\n now: 'now create',\n select: 'parse create validate',\n highlight: 'parse navigate create validate',\n view: 'parse create validate viewset',\n disable: 'deactivate',\n enable: 'activate'\n }\n\n // The component's item object.\n calendar.item = {}\n\n calendar.item.clear = null\n calendar.item.disable = ( settings.disable || [] ).slice( 0 )\n calendar.item.enable = -(function( collectionDisabled ) {\n return collectionDisabled[ 0 ] === true ? collectionDisabled.shift() : -1\n })( calendar.item.disable )\n\n calendar.\n set( 'min', settings.min ).\n set( 'max', settings.max ).\n set( 'now' )\n\n // When there’s a value, set the `select`, which in turn\n // also sets the `highlight` and `view`.\n if ( valueString ) {\n calendar.set( 'select', valueString, { format: formatString })\n }\n\n // If there’s no value, default to highlighting “today”.\n else {\n calendar.\n set( 'select', null ).\n set( 'highlight', calendar.item.now )\n }\n\n\n // The keycode to movement mapping.\n calendar.key = {\n 40: 7, // Down\n 38: -7, // Up\n 39: function() { return isRTL() ? -1 : 1 }, // Right\n 37: function() { return isRTL() ? 1 : -1 }, // Left\n go: function( timeChange ) {\n var highlightedObject = calendar.item.highlight,\n targetDate = new Date( highlightedObject.year, highlightedObject.month, highlightedObject.date + timeChange )\n calendar.set(\n 'highlight',\n targetDate,\n { interval: timeChange }\n )\n this.render()\n }\n }\n\n\n // Bind some picker events.\n picker.\n on( 'render', function() {\n picker.$root.find( '.' + settings.klass.selectMonth ).on( 'change', function() {\n var value = this.value\n if ( value ) {\n picker.set( 'highlight', [ picker.get( 'view' ).year, value, picker.get( 'highlight' ).date ] )\n picker.$root.find( '.' + settings.klass.selectMonth ).trigger( 'focus' )\n }\n })\n picker.$root.find( '.' + settings.klass.selectYear ).on( 'change', function() {\n var value = this.value\n if ( value ) {\n picker.set( 'highlight', [ value, picker.get( 'view' ).month, picker.get( 'highlight' ).date ] )\n picker.$root.find( '.' + settings.klass.selectYear ).trigger( 'focus' )\n }\n })\n }, 1 ).\n on( 'open', function() {\n var includeToday = ''\n if ( calendar.disabled( calendar.get('now') ) ) {\n includeToday = ':not(.' + settings.klass.buttonToday + ')'\n }\n picker.$root.find( 'button' + includeToday + ', select' ).attr( 'disabled', false )\n }, 1 ).\n on( 'close', function() {\n picker.$root.find( 'button, select' ).attr( 'disabled', true )\n }, 1 )\n\n} //DatePicker\n\n\n/**\n * Set a datepicker item object.\n */\nDatePicker.prototype.set = function( type, value, options ) {\n\n var calendar = this,\n calendarItem = calendar.item\n\n // If the value is `null` just set it immediately.\n if ( value === null ) {\n if ( type == 'clear' ) type = 'select'\n calendarItem[ type ] = value\n return calendar\n }\n\n // Otherwise go through the queue of methods, and invoke the functions.\n // Update this as the time unit, and set the final value as this item.\n // * In the case of `enable`, keep the queue but set `disable` instead.\n // And in the case of `flip`, keep the queue but set `enable` instead.\n calendarItem[ ( type == 'enable' ? 'disable' : type == 'flip' ? 'enable' : type ) ] = calendar.queue[ type ].split( ' ' ).map( function( method ) {\n value = calendar[ method ]( type, value, options )\n return value\n }).pop()\n\n // Check if we need to cascade through more updates.\n if ( type == 'select' ) {\n calendar.set( 'highlight', calendarItem.select, options )\n }\n else if ( type == 'highlight' ) {\n calendar.set( 'view', calendarItem.highlight, options )\n }\n else if ( type.match( /^(flip|min|max|disable|enable)$/ ) ) {\n if ( calendarItem.select && calendar.disabled( calendarItem.select ) ) {\n calendar.set( 'select', calendarItem.select, options )\n }\n if ( calendarItem.highlight && calendar.disabled( calendarItem.highlight ) ) {\n calendar.set( 'highlight', calendarItem.highlight, options )\n }\n }\n\n return calendar\n} //DatePicker.prototype.set\n\n\n/**\n * Get a datepicker item object.\n */\nDatePicker.prototype.get = function( type ) {\n return this.item[ type ]\n} //DatePicker.prototype.get\n\n\n/**\n * Create a picker date object.\n */\nDatePicker.prototype.create = function( type, value, options ) {\n\n var isInfiniteValue,\n calendar = this\n\n // If there’s no value, use the type as the value.\n value = value === undefined ? type : value\n\n\n // If it’s infinity, update the value.\n if ( value == -Infinity || value == Infinity ) {\n isInfiniteValue = value\n }\n\n // If it’s an object, use the native date object.\n else if ( $.isPlainObject( value ) && _.isInteger( value.pick ) ) {\n value = value.obj\n }\n\n // If it’s an array, convert it into a date and make sure\n // that it’s a valid date – otherwise default to today.\n else if ( $.isArray( value ) ) {\n value = new Date( value[ 0 ], value[ 1 ], value[ 2 ] )\n value = _.isDate( value ) ? value : calendar.create().obj\n }\n\n // If it’s a number or date object, make a normalized date.\n else if ( _.isInteger( value ) || _.isDate( value ) ) {\n value = calendar.normalize( new Date( value ), options )\n }\n\n // If it’s a literal true or any other case, set it to now.\n else /*if ( value === true )*/ {\n value = calendar.now( type, value, options )\n }\n\n // Return the compiled object.\n return {\n year: isInfiniteValue || value.getFullYear(),\n month: isInfiniteValue || value.getMonth(),\n date: isInfiniteValue || value.getDate(),\n day: isInfiniteValue || value.getDay(),\n obj: isInfiniteValue || value,\n pick: isInfiniteValue || value.getTime()\n }\n} //DatePicker.prototype.create\n\n\n/**\n * Create a range limit object using an array, date object,\n * literal “true”, or integer relative to another time.\n */\nDatePicker.prototype.createRange = function( from, to ) {\n\n var calendar = this,\n createDate = function( date ) {\n if ( date === true || $.isArray( date ) || _.isDate( date ) ) {\n return calendar.create( date )\n }\n return date\n }\n\n // Create objects if possible.\n if ( !_.isInteger( from ) ) {\n from = createDate( from )\n }\n if ( !_.isInteger( to ) ) {\n to = createDate( to )\n }\n\n // Create relative dates.\n if ( _.isInteger( from ) && $.isPlainObject( to ) ) {\n from = [ to.year, to.month, to.date + from ];\n }\n else if ( _.isInteger( to ) && $.isPlainObject( from ) ) {\n to = [ from.year, from.month, from.date + to ];\n }\n\n return {\n from: createDate( from ),\n to: createDate( to )\n }\n} //DatePicker.prototype.createRange\n\n\n/**\n * Check if a date unit falls within a date range object.\n */\nDatePicker.prototype.withinRange = function( range, dateUnit ) {\n range = this.createRange(range.from, range.to)\n return dateUnit.pick >= range.from.pick && dateUnit.pick <= range.to.pick\n}\n\n\n/**\n * Check if two date range objects overlap.\n */\nDatePicker.prototype.overlapRanges = function( one, two ) {\n\n var calendar = this\n\n // Convert the ranges into comparable dates.\n one = calendar.createRange( one.from, one.to )\n two = calendar.createRange( two.from, two.to )\n\n return calendar.withinRange( one, two.from ) || calendar.withinRange( one, two.to ) ||\n calendar.withinRange( two, one.from ) || calendar.withinRange( two, one.to )\n}\n\n\n/**\n * Get the date today.\n */\nDatePicker.prototype.now = function( type, value, options ) {\n value = new Date()\n if ( options && options.rel ) {\n value.setDate( value.getDate() + options.rel )\n }\n return this.normalize( value, options )\n}\n\n\n/**\n * Navigate to next/prev month.\n */\nDatePicker.prototype.navigate = function( type, value, options ) {\n\n var targetDateObject,\n targetYear,\n targetMonth,\n targetDate,\n isTargetArray = $.isArray( value ),\n isTargetObject = $.isPlainObject( value ),\n viewsetObject = this.item.view/*,\n safety = 100*/\n\n\n if ( isTargetArray || isTargetObject ) {\n\n if ( isTargetObject ) {\n targetYear = value.year\n targetMonth = value.month\n targetDate = value.date\n }\n else {\n targetYear = +value[0]\n targetMonth = +value[1]\n targetDate = +value[2]\n }\n\n // If we’re navigating months but the view is in a different\n // month, navigate to the view’s year and month.\n if ( options && options.nav && viewsetObject && viewsetObject.month !== targetMonth ) {\n targetYear = viewsetObject.year\n targetMonth = viewsetObject.month\n }\n\n // Figure out the expected target year and month.\n targetDateObject = new Date( targetYear, targetMonth + ( options && options.nav ? options.nav : 0 ), 1 )\n targetYear = targetDateObject.getFullYear()\n targetMonth = targetDateObject.getMonth()\n\n // If the month we’re going to doesn’t have enough days,\n // keep decreasing the date until we reach the month’s last date.\n while ( /*safety &&*/ new Date( targetYear, targetMonth, targetDate ).getMonth() !== targetMonth ) {\n targetDate -= 1\n /*safety -= 1\n if ( !safety ) {\n throw 'Fell into an infinite loop while navigating to ' + new Date( targetYear, targetMonth, targetDate ) + '.'\n }*/\n }\n\n value = [ targetYear, targetMonth, targetDate ]\n }\n\n return value\n} //DatePicker.prototype.navigate\n\n\n/**\n * Normalize a date by setting the hours to midnight.\n */\nDatePicker.prototype.normalize = function( value/*, options*/ ) {\n value.setHours( 0, 0, 0, 0 )\n return value\n}\n\n\n/**\n * Measure the range of dates.\n */\nDatePicker.prototype.measure = function( type, value/*, options*/ ) {\n\n var calendar = this\n\n // If it’s anything false-y, remove the limits.\n if ( !value ) {\n value = type == 'min' ? -Infinity : Infinity\n }\n\n // If it’s a string, parse it.\n else if ( typeof value == 'string' ) {\n value = calendar.parse( type, value )\n }\n\n // If it's an integer, get a date relative to today.\n else if ( _.isInteger( value ) ) {\n value = calendar.now( type, value, { rel: value } )\n }\n\n return value\n} ///DatePicker.prototype.measure\n\n\n/**\n * Create a viewset object based on navigation.\n */\nDatePicker.prototype.viewset = function( type, dateObject/*, options*/ ) {\n return this.create([ dateObject.year, dateObject.month, 1 ])\n}\n\n\n/**\n * Validate a date as enabled and shift if needed.\n */\nDatePicker.prototype.validate = function( type, dateObject, options ) {\n\n var calendar = this,\n\n // Keep a reference to the original date.\n originalDateObject = dateObject,\n\n // Make sure we have an interval.\n interval = options && options.interval ? options.interval : 1,\n\n // Check if the calendar enabled dates are inverted.\n isFlippedBase = calendar.item.enable === -1,\n\n // Check if we have any enabled dates after/before now.\n hasEnabledBeforeTarget, hasEnabledAfterTarget,\n\n // The min & max limits.\n minLimitObject = calendar.item.min,\n maxLimitObject = calendar.item.max,\n\n // Check if we’ve reached the limit during shifting.\n reachedMin, reachedMax,\n\n // Check if the calendar is inverted and at least one weekday is enabled.\n hasEnabledWeekdays = isFlippedBase && calendar.item.disable.filter( function( value ) {\n\n // If there’s a date, check where it is relative to the target.\n if ( $.isArray( value ) ) {\n var dateTime = calendar.create( value ).pick\n if ( dateTime < dateObject.pick ) hasEnabledBeforeTarget = true\n else if ( dateTime > dateObject.pick ) hasEnabledAfterTarget = true\n }\n\n // Return only integers for enabled weekdays.\n return _.isInteger( value )\n }).length/*,\n\n safety = 100*/\n\n\n\n // Cases to validate for:\n // [1] Not inverted and date disabled.\n // [2] Inverted and some dates enabled.\n // [3] Not inverted and out of range.\n //\n // Cases to **not** validate for:\n // • Navigating months.\n // • Not inverted and date enabled.\n // • Inverted and all dates disabled.\n // • ..and anything else.\n if ( !options || !options.nav ) if (\n /* 1 */ ( !isFlippedBase && calendar.disabled( dateObject ) ) ||\n /* 2 */ ( isFlippedBase && calendar.disabled( dateObject ) && ( hasEnabledWeekdays || hasEnabledBeforeTarget || hasEnabledAfterTarget ) ) ||\n /* 3 */ ( !isFlippedBase && (dateObject.pick <= minLimitObject.pick || dateObject.pick >= maxLimitObject.pick) )\n ) {\n\n\n // When inverted, flip the direction if there aren’t any enabled weekdays\n // and there are no enabled dates in the direction of the interval.\n if ( isFlippedBase && !hasEnabledWeekdays && ( ( !hasEnabledAfterTarget && interval > 0 ) || ( !hasEnabledBeforeTarget && interval < 0 ) ) ) {\n interval *= -1\n }\n\n\n // Keep looping until we reach an enabled date.\n while ( /*safety &&*/ calendar.disabled( dateObject ) ) {\n\n /*safety -= 1\n if ( !safety ) {\n throw 'Fell into an infinite loop while validating ' + dateObject.obj + '.'\n }*/\n\n\n // If we’ve looped into the next/prev month with a large interval, return to the original date and flatten the interval.\n if ( Math.abs( interval ) > 1 && ( dateObject.month < originalDateObject.month || dateObject.month > originalDateObject.month ) ) {\n dateObject = originalDateObject\n interval = interval > 0 ? 1 : -1\n }\n\n\n // If we’ve reached the min/max limit, reverse the direction, flatten the interval and set it to the limit.\n if ( dateObject.pick <= minLimitObject.pick ) {\n reachedMin = true\n interval = 1\n dateObject = calendar.create([\n minLimitObject.year,\n minLimitObject.month,\n minLimitObject.date + (dateObject.pick === minLimitObject.pick ? 0 : -1)\n ])\n }\n else if ( dateObject.pick >= maxLimitObject.pick ) {\n reachedMax = true\n interval = -1\n dateObject = calendar.create([\n maxLimitObject.year,\n maxLimitObject.month,\n maxLimitObject.date + (dateObject.pick === maxLimitObject.pick ? 0 : 1)\n ])\n }\n\n\n // If we’ve reached both limits, just break out of the loop.\n if ( reachedMin && reachedMax ) {\n break\n }\n\n\n // Finally, create the shifted date using the interval and keep looping.\n dateObject = calendar.create([ dateObject.year, dateObject.month, dateObject.date + interval ])\n }\n\n } //endif\n\n\n // Return the date object settled on.\n return dateObject\n} //DatePicker.prototype.validate\n\n\n/**\n * Check if a date is disabled.\n */\nDatePicker.prototype.disabled = function( dateToVerify ) {\n\n var\n calendar = this,\n\n // Filter through the disabled dates to check if this is one.\n isDisabledMatch = calendar.item.disable.filter( function( dateToDisable ) {\n\n // If the date is a number, match the weekday with 0index and `firstDay` check.\n if ( _.isInteger( dateToDisable ) ) {\n return dateToVerify.day === ( calendar.settings.firstDay ? dateToDisable : dateToDisable - 1 ) % 7\n }\n\n // If it’s an array or a native JS date, create and match the exact date.\n if ( $.isArray( dateToDisable ) || _.isDate( dateToDisable ) ) {\n return dateToVerify.pick === calendar.create( dateToDisable ).pick\n }\n\n // If it’s an object, match a date within the “from” and “to” range.\n if ( $.isPlainObject( dateToDisable ) ) {\n return calendar.withinRange( dateToDisable, dateToVerify )\n }\n })\n\n // If this date matches a disabled date, confirm it’s not inverted.\n isDisabledMatch = isDisabledMatch.length && !isDisabledMatch.filter(function( dateToDisable ) {\n return $.isArray( dateToDisable ) && dateToDisable[3] == 'inverted' ||\n $.isPlainObject( dateToDisable ) && dateToDisable.inverted\n }).length\n\n // Check the calendar “enabled” flag and respectively flip the\n // disabled state. Then also check if it’s beyond the min/max limits.\n return calendar.item.enable === -1 ? !isDisabledMatch : isDisabledMatch ||\n dateToVerify.pick < calendar.item.min.pick ||\n dateToVerify.pick > calendar.item.max.pick\n\n} //DatePicker.prototype.disabled\n\n\n/**\n * Parse a string into a usable type.\n */\nDatePicker.prototype.parse = function( type, value, options ) {\n\n var calendar = this,\n parsingObject = {}\n\n // If it’s already parsed, we’re good.\n if ( !value || typeof value != 'string' ) {\n return value\n }\n\n // We need a `.format` to parse the value with.\n if ( !( options && options.format ) ) {\n options = options || {}\n options.format = calendar.settings.format\n }\n\n // Convert the format into an array and then map through it.\n calendar.formats.toArray( options.format ).map( function( label ) {\n\n var\n // Grab the formatting label.\n formattingLabel = calendar.formats[ label ],\n\n // The format length is from the formatting label function or the\n // label length without the escaping exclamation (!) mark.\n formatLength = formattingLabel ? _.trigger( formattingLabel, calendar, [ value, parsingObject ] ) : label.replace( /^!/, '' ).length\n\n // If there's a format label, split the value up to the format length.\n // Then add it to the parsing object with appropriate label.\n if ( formattingLabel ) {\n parsingObject[ label ] = value.substr( 0, formatLength )\n }\n\n // Update the value as the substring from format length to end.\n value = value.substr( formatLength )\n })\n\n // Compensate for month 0index.\n return [\n parsingObject.yyyy || parsingObject.yy,\n +( parsingObject.mm || parsingObject.m ) - 1,\n parsingObject.dd || parsingObject.d\n ]\n} //DatePicker.prototype.parse\n\n\n/**\n * Various formats to display the object in.\n */\nDatePicker.prototype.formats = (function() {\n\n // Return the length of the first word in a collection.\n function getWordLengthFromCollection( string, collection, dateObject ) {\n\n // Grab the first word from the string.\n var word = string.match( /\\w+/ )[ 0 ]\n\n // If there's no month index, add it to the date object\n if ( !dateObject.mm && !dateObject.m ) {\n dateObject.m = collection.indexOf( word ) + 1\n }\n\n // Return the length of the word.\n return word.length\n }\n\n // Get the length of the first word in a string.\n function getFirstWordLength( string ) {\n return string.match( /\\w+/ )[ 0 ].length\n }\n\n return {\n\n d: function( string, dateObject ) {\n\n // If there's string, then get the digits length.\n // Otherwise return the selected date.\n return string ? _.digits( string ) : dateObject.date\n },\n dd: function( string, dateObject ) {\n\n // If there's a string, then the length is always 2.\n // Otherwise return the selected date with a leading zero.\n return string ? 2 : _.lead( dateObject.date )\n },\n ddd: function( string, dateObject ) {\n\n // If there's a string, then get the length of the first word.\n // Otherwise return the short selected weekday.\n return string ? getFirstWordLength( string ) : this.settings.weekdaysShort[ dateObject.day ]\n },\n dddd: function( string, dateObject ) {\n\n // If there's a string, then get the length of the first word.\n // Otherwise return the full selected weekday.\n return string ? getFirstWordLength( string ) : this.settings.weekdaysFull[ dateObject.day ]\n },\n m: function( string, dateObject ) {\n\n // If there's a string, then get the length of the digits\n // Otherwise return the selected month with 0index compensation.\n return string ? _.digits( string ) : dateObject.month + 1\n },\n mm: function( string, dateObject ) {\n\n // If there's a string, then the length is always 2.\n // Otherwise return the selected month with 0index and leading zero.\n return string ? 2 : _.lead( dateObject.month + 1 )\n },\n mmm: function( string, dateObject ) {\n\n var collection = this.settings.monthsShort\n\n // If there's a string, get length of the relevant month from the short\n // months collection. Otherwise return the selected month from that collection.\n return string ? getWordLengthFromCollection( string, collection, dateObject ) : collection[ dateObject.month ]\n },\n mmmm: function( string, dateObject ) {\n\n var collection = this.settings.monthsFull\n\n // If there's a string, get length of the relevant month from the full\n // months collection. Otherwise return the selected month from that collection.\n return string ? getWordLengthFromCollection( string, collection, dateObject ) : collection[ dateObject.month ]\n },\n yy: function( string, dateObject ) {\n\n // If there's a string, then the length is always 2.\n // Otherwise return the selected year by slicing out the first 2 digits.\n return string ? 2 : ( '' + dateObject.year ).slice( 2 )\n },\n yyyy: function( string, dateObject ) {\n\n // If there's a string, then the length is always 4.\n // Otherwise return the selected year.\n return string ? 4 : dateObject.year\n },\n\n // Create an array by splitting the formatting string passed.\n toArray: function( formatString ) { return formatString.split( /(d{1,4}|m{1,4}|y{4}|yy|!.)/g ) },\n\n // Format an object into a string using the formatting options.\n toString: function ( formatString, itemObject ) {\n var calendar = this\n return calendar.formats.toArray( formatString ).map( function( label ) {\n return _.trigger( calendar.formats[ label ], calendar, [ 0, itemObject ] ) || label.replace( /^!/, '' )\n }).join( '' )\n }\n }\n})() //DatePicker.prototype.formats\n\n\n\n\n/**\n * Check if two date units are the exact.\n */\nDatePicker.prototype.isDateExact = function( one, two ) {\n\n var calendar = this\n\n // When we’re working with weekdays, do a direct comparison.\n if (\n ( _.isInteger( one ) && _.isInteger( two ) ) ||\n ( typeof one == 'boolean' && typeof two == 'boolean' )\n ) {\n return one === two\n }\n\n // When we’re working with date representations, compare the “pick” value.\n if (\n ( _.isDate( one ) || $.isArray( one ) ) &&\n ( _.isDate( two ) || $.isArray( two ) )\n ) {\n return calendar.create( one ).pick === calendar.create( two ).pick\n }\n\n // When we’re working with range objects, compare the “from” and “to”.\n if ( $.isPlainObject( one ) && $.isPlainObject( two ) ) {\n return calendar.isDateExact( one.from, two.from ) && calendar.isDateExact( one.to, two.to )\n }\n\n return false\n}\n\n\n/**\n * Check if two date units overlap.\n */\nDatePicker.prototype.isDateOverlap = function( one, two ) {\n\n var calendar = this,\n firstDay = calendar.settings.firstDay ? 1 : 0\n\n // When we’re working with a weekday index, compare the days.\n if ( _.isInteger( one ) && ( _.isDate( two ) || $.isArray( two ) ) ) {\n one = one % 7 + firstDay\n return one === calendar.create( two ).day + 1\n }\n if ( _.isInteger( two ) && ( _.isDate( one ) || $.isArray( one ) ) ) {\n two = two % 7 + firstDay\n return two === calendar.create( one ).day + 1\n }\n\n // When we’re working with range objects, check if the ranges overlap.\n if ( $.isPlainObject( one ) && $.isPlainObject( two ) ) {\n return calendar.overlapRanges( one, two )\n }\n\n return false\n}\n\n\n/**\n * Flip the “enabled” state.\n */\nDatePicker.prototype.flipEnable = function(val) {\n var itemObject = this.item\n itemObject.enable = val || (itemObject.enable == -1 ? 1 : -1)\n}\n\n\n/**\n * Mark a collection of dates as “disabled”.\n */\nDatePicker.prototype.deactivate = function( type, datesToDisable ) {\n\n var calendar = this,\n disabledItems = calendar.item.disable.slice(0)\n\n\n // If we’re flipping, that’s all we need to do.\n if ( datesToDisable == 'flip' ) {\n calendar.flipEnable()\n }\n\n else if ( datesToDisable === false ) {\n calendar.flipEnable(1)\n disabledItems = []\n }\n\n else if ( datesToDisable === true ) {\n calendar.flipEnable(-1)\n disabledItems = []\n }\n\n // Otherwise go through the dates to disable.\n else {\n\n datesToDisable.map(function( unitToDisable ) {\n\n var matchFound\n\n // When we have disabled items, check for matches.\n // If something is matched, immediately break out.\n for ( var index = 0; index < disabledItems.length; index += 1 ) {\n if ( calendar.isDateExact( unitToDisable, disabledItems[index] ) ) {\n matchFound = true\n break\n }\n }\n\n // If nothing was found, add the validated unit to the collection.\n if ( !matchFound ) {\n if (\n _.isInteger( unitToDisable ) ||\n _.isDate( unitToDisable ) ||\n $.isArray( unitToDisable ) ||\n ( $.isPlainObject( unitToDisable ) && unitToDisable.from && unitToDisable.to )\n ) {\n disabledItems.push( unitToDisable )\n }\n }\n })\n }\n\n // Return the updated collection.\n return disabledItems\n} //DatePicker.prototype.deactivate\n\n\n/**\n * Mark a collection of dates as “enabled”.\n */\nDatePicker.prototype.activate = function( type, datesToEnable ) {\n\n var calendar = this,\n disabledItems = calendar.item.disable,\n disabledItemsCount = disabledItems.length\n\n // If we’re flipping, that’s all we need to do.\n if ( datesToEnable == 'flip' ) {\n calendar.flipEnable()\n }\n\n else if ( datesToEnable === true ) {\n calendar.flipEnable(1)\n disabledItems = []\n }\n\n else if ( datesToEnable === false ) {\n calendar.flipEnable(-1)\n disabledItems = []\n }\n\n // Otherwise go through the disabled dates.\n else {\n\n datesToEnable.map(function( unitToEnable ) {\n\n var matchFound,\n disabledUnit,\n index,\n isExactRange\n\n // Go through the disabled items and try to find a match.\n for ( index = 0; index < disabledItemsCount; index += 1 ) {\n\n disabledUnit = disabledItems[index]\n\n // When an exact match is found, remove it from the collection.\n if ( calendar.isDateExact( disabledUnit, unitToEnable ) ) {\n matchFound = disabledItems[index] = null\n isExactRange = true\n break\n }\n\n // When an overlapped match is found, add the “inverted” state to it.\n else if ( calendar.isDateOverlap( disabledUnit, unitToEnable ) ) {\n if ( $.isPlainObject( unitToEnable ) ) {\n unitToEnable.inverted = true\n matchFound = unitToEnable\n }\n else if ( $.isArray( unitToEnable ) ) {\n matchFound = unitToEnable\n if ( !matchFound[3] ) matchFound.push( 'inverted' )\n }\n else if ( _.isDate( unitToEnable ) ) {\n matchFound = [ unitToEnable.getFullYear(), unitToEnable.getMonth(), unitToEnable.getDate(), 'inverted' ]\n }\n break\n }\n }\n\n // If a match was found, remove a previous duplicate entry.\n if ( matchFound ) for ( index = 0; index < disabledItemsCount; index += 1 ) {\n if ( calendar.isDateExact( disabledItems[index], unitToEnable ) ) {\n disabledItems[index] = null\n break\n }\n }\n\n // In the event that we’re dealing with an exact range of dates,\n // make sure there are no “inverted” dates because of it.\n if ( isExactRange ) for ( index = 0; index < disabledItemsCount; index += 1 ) {\n if ( calendar.isDateOverlap( disabledItems[index], unitToEnable ) ) {\n disabledItems[index] = null\n break\n }\n }\n\n // If something is still matched, add it into the collection.\n if ( matchFound ) {\n disabledItems.push( matchFound )\n }\n })\n }\n\n // Return the updated collection.\n return disabledItems.filter(function( val ) { return val != null })\n} //DatePicker.prototype.activate\n\n\n/**\n * Create a string for the nodes in the picker.\n */\nDatePicker.prototype.nodes = function( isOpen ) {\n\n var\n calendar = this,\n settings = calendar.settings,\n calendarItem = calendar.item,\n nowObject = calendarItem.now,\n selectedObject = calendarItem.select,\n highlightedObject = calendarItem.highlight,\n viewsetObject = calendarItem.view,\n disabledCollection = calendarItem.disable,\n minLimitObject = calendarItem.min,\n maxLimitObject = calendarItem.max,\n\n\n // Create the calendar table head using a copy of weekday labels collection.\n // * We do a copy so we don't mutate the original array.\n tableHead = (function( collection, fullCollection ) {\n\n // If the first day should be Monday, move Sunday to the end.\n if ( settings.firstDay ) {\n collection.push( collection.shift() )\n fullCollection.push( fullCollection.shift() )\n }\n\n // Create and return the table head group.\n return _.node(\n 'thead',\n _.node(\n 'tr',\n _.group({\n min: 0,\n max: DAYS_IN_WEEK - 1,\n i: 1,\n node: 'th',\n item: function( counter ) {\n return [\n collection[ counter ],\n settings.klass.weekdays,\n 'scope=col title=\"' + fullCollection[ counter ] + '\"'\n ]\n }\n })\n )\n ) //endreturn\n\n // Materialize modified\n })( ( settings.showWeekdaysFull ? settings.weekdaysFull : settings.weekdaysLetter ).slice( 0 ), settings.weekdaysFull.slice( 0 ) ), //tableHead\n\n\n // Create the nav for next/prev month.\n createMonthNav = function( next ) {\n\n // Otherwise, return the created month tag.\n return _.node(\n 'div',\n ' ',\n settings.klass[ 'nav' + ( next ? 'Next' : 'Prev' ) ] + (\n\n // If the focused month is outside the range, disabled the button.\n ( next && viewsetObject.year >= maxLimitObject.year && viewsetObject.month >= maxLimitObject.month ) ||\n ( !next && viewsetObject.year <= minLimitObject.year && viewsetObject.month <= minLimitObject.month ) ?\n ' ' + settings.klass.navDisabled : ''\n ),\n 'data-nav=' + ( next || -1 ) + ' ' +\n _.ariaAttr({\n role: 'button',\n controls: calendar.$node[0].id + '_table'\n }) + ' ' +\n 'title=\"' + (next ? settings.labelMonthNext : settings.labelMonthPrev ) + '\"'\n ) //endreturn\n }, //createMonthNav\n\n\n // Create the month label.\n //Materialize modified\n createMonthLabel = function(override) {\n\n var monthsCollection = settings.showMonthsShort ? settings.monthsShort : settings.monthsFull\n\n // Materialize modified\n if (override == \"short_months\") {\n monthsCollection = settings.monthsShort;\n }\n\n // If there are months to select, add a dropdown menu.\n if ( settings.selectMonths && override == undefined) {\n\n return _.node( 'select',\n _.group({\n min: 0,\n max: 11,\n i: 1,\n node: 'option',\n item: function( loopedMonth ) {\n\n return [\n\n // The looped month and no classes.\n monthsCollection[ loopedMonth ], 0,\n\n // Set the value and selected index.\n 'value=' + loopedMonth +\n ( viewsetObject.month == loopedMonth ? ' selected' : '' ) +\n (\n (\n ( viewsetObject.year == minLimitObject.year && loopedMonth < minLimitObject.month ) ||\n ( viewsetObject.year == maxLimitObject.year && loopedMonth > maxLimitObject.month )\n ) ?\n ' disabled' : ''\n )\n ]\n }\n }),\n settings.klass.selectMonth + ' browser-default',\n ( isOpen ? '' : 'disabled' ) + ' ' +\n _.ariaAttr({ controls: calendar.$node[0].id + '_table' }) + ' ' +\n 'title=\"' + settings.labelMonthSelect + '\"'\n )\n }\n\n // Materialize modified\n if (override == \"short_months\")\n if (selectedObject != null)\n return _.node( 'div', monthsCollection[ selectedObject.month ] );\n else return _.node( 'div', monthsCollection[ viewsetObject.month ] );\n\n // If there's a need for a month selector\n return _.node( 'div', monthsCollection[ viewsetObject.month ], settings.klass.month )\n }, //createMonthLabel\n\n\n // Create the year label.\n // Materialize modified\n createYearLabel = function(override) {\n\n var focusedYear = viewsetObject.year,\n\n // If years selector is set to a literal \"true\", set it to 5. Otherwise\n // divide in half to get half before and half after focused year.\n numberYears = settings.selectYears === true ? 5 : ~~( settings.selectYears / 2 )\n\n // If there are years to select, add a dropdown menu.\n if ( numberYears ) {\n\n var\n minYear = minLimitObject.year,\n maxYear = maxLimitObject.year,\n lowestYear = focusedYear - numberYears,\n highestYear = focusedYear + numberYears\n\n // If the min year is greater than the lowest year, increase the highest year\n // by the difference and set the lowest year to the min year.\n if ( minYear > lowestYear ) {\n highestYear += minYear - lowestYear\n lowestYear = minYear\n }\n\n // If the max year is less than the highest year, decrease the lowest year\n // by the lower of the two: available and needed years. Then set the\n // highest year to the max year.\n if ( maxYear < highestYear ) {\n\n var availableYears = lowestYear - minYear,\n neededYears = highestYear - maxYear\n\n lowestYear -= availableYears > neededYears ? neededYears : availableYears\n highestYear = maxYear\n }\n\n if ( settings.selectYears && override == undefined ) {\n return _.node( 'select',\n _.group({\n min: lowestYear,\n max: highestYear,\n i: 1,\n node: 'option',\n item: function( loopedYear ) {\n return [\n\n // The looped year and no classes.\n loopedYear, 0,\n\n // Set the value and selected index.\n 'value=' + loopedYear + ( focusedYear == loopedYear ? ' selected' : '' )\n ]\n }\n }),\n settings.klass.selectYear + ' browser-default',\n ( isOpen ? '' : 'disabled' ) + ' ' + _.ariaAttr({ controls: calendar.$node[0].id + '_table' }) + ' ' +\n 'title=\"' + settings.labelYearSelect + '\"'\n )\n }\n }\n\n // Materialize modified\n if (override == \"raw\")\n return _.node( 'div', focusedYear )\n\n // Otherwise just return the year focused\n return _.node( 'div', focusedYear, settings.klass.year )\n } //createYearLabel\n\n\n // Materialize modified\n createDayLabel = function() {\n if (selectedObject != null)\n return _.node( 'div', selectedObject.date)\n else return _.node( 'div', nowObject.date)\n }\n createWeekdayLabel = function() {\n var display_day;\n\n if (selectedObject != null)\n display_day = selectedObject.day;\n else\n display_day = nowObject.day;\n var weekday = settings.weekdaysFull[ display_day ]\n return weekday\n }\n\n\n // Create and return the entire calendar.\nreturn _.node(\n // Date presentation View\n 'div',\n _.node(\n 'div',\n createWeekdayLabel(),\n \"picker__weekday-display\"\n )+\n _.node(\n // Div for short Month\n 'div',\n createMonthLabel(\"short_months\"),\n settings.klass.month_display\n )+\n _.node(\n // Div for Day\n 'div',\n createDayLabel() ,\n settings.klass.day_display\n )+\n _.node(\n // Div for Year\n 'div',\n createYearLabel(\"raw\") ,\n settings.klass.year_display\n ),\n settings.klass.date_display\n )+\n // Calendar container\n _.node('div',\n _.node('div',\n ( settings.selectYears ? createMonthLabel() + createYearLabel() : createMonthLabel() + createYearLabel() ) +\n createMonthNav() + createMonthNav( 1 ),\n settings.klass.header\n ) + _.node(\n 'table',\n tableHead +\n _.node(\n 'tbody',\n _.group({\n min: 0,\n max: WEEKS_IN_CALENDAR - 1,\n i: 1,\n node: 'tr',\n item: function( rowCounter ) {\n\n // If Monday is the first day and the month starts on Sunday, shift the date back a week.\n var shiftDateBy = settings.firstDay && calendar.create([ viewsetObject.year, viewsetObject.month, 1 ]).day === 0 ? -7 : 0\n\n return [\n _.group({\n min: DAYS_IN_WEEK * rowCounter - viewsetObject.day + shiftDateBy + 1, // Add 1 for weekday 0index\n max: function() {\n return this.min + DAYS_IN_WEEK - 1\n },\n i: 1,\n node: 'td',\n item: function( targetDate ) {\n\n // Convert the time date from a relative date to a target date.\n targetDate = calendar.create([ viewsetObject.year, viewsetObject.month, targetDate + ( settings.firstDay ? 1 : 0 ) ])\n\n var isSelected = selectedObject && selectedObject.pick == targetDate.pick,\n isHighlighted = highlightedObject && highlightedObject.pick == targetDate.pick,\n isDisabled = disabledCollection && calendar.disabled( targetDate ) || targetDate.pick < minLimitObject.pick || targetDate.pick > maxLimitObject.pick,\n formattedDate = _.trigger( calendar.formats.toString, calendar, [ settings.format, targetDate ] )\n\n return [\n _.node(\n 'div',\n targetDate.date,\n (function( klasses ) {\n\n // Add the `infocus` or `outfocus` classes based on month in view.\n klasses.push( viewsetObject.month == targetDate.month ? settings.klass.infocus : settings.klass.outfocus )\n\n // Add the `today` class if needed.\n if ( nowObject.pick == targetDate.pick ) {\n klasses.push( settings.klass.now )\n }\n\n // Add the `selected` class if something's selected and the time matches.\n if ( isSelected ) {\n klasses.push( settings.klass.selected )\n }\n\n // Add the `highlighted` class if something's highlighted and the time matches.\n if ( isHighlighted ) {\n klasses.push( settings.klass.highlighted )\n }\n\n // Add the `disabled` class if something's disabled and the object matches.\n if ( isDisabled ) {\n klasses.push( settings.klass.disabled )\n }\n\n return klasses.join( ' ' )\n })([ settings.klass.day ]),\n 'data-pick=' + targetDate.pick + ' ' + _.ariaAttr({\n role: 'gridcell',\n label: formattedDate,\n selected: isSelected && calendar.$node.val() === formattedDate ? true : null,\n activedescendant: isHighlighted ? true : null,\n disabled: isDisabled ? true : null\n })\n ),\n '',\n _.ariaAttr({ role: 'presentation' })\n ] //endreturn\n }\n })\n ] //endreturn\n }\n })\n ),\n settings.klass.table,\n 'id=\"' + calendar.$node[0].id + '_table' + '\" ' + _.ariaAttr({\n role: 'grid',\n controls: calendar.$node[0].id,\n readonly: true\n })\n )\n , settings.klass.calendar_container) // end calendar\n\n +\n\n // * For Firefox forms to submit, make sure to set the buttons’ `type` attributes as “button”.\n _.node(\n 'div',\n _.node( 'button', settings.today, \"btn-flat picker__today\",\n 'type=button data-pick=' + nowObject.pick +\n ( isOpen && !calendar.disabled(nowObject) ? '' : ' disabled' ) + ' ' +\n _.ariaAttr({ controls: calendar.$node[0].id }) ) +\n _.node( 'button', settings.clear, \"btn-flat picker__clear\",\n 'type=button data-clear=1' +\n ( isOpen ? '' : ' disabled' ) + ' ' +\n _.ariaAttr({ controls: calendar.$node[0].id }) ) +\n _.node('button', settings.close, \"btn-flat picker__close\",\n 'type=button data-close=true ' +\n ( isOpen ? '' : ' disabled' ) + ' ' +\n _.ariaAttr({ controls: calendar.$node[0].id }) ),\n settings.klass.footer\n ) //endreturn\n} //DatePicker.prototype.nodes\n\n\n\n\n/**\n * The date picker defaults.\n */\nDatePicker.defaults = (function( prefix ) {\n\n return {\n\n // The title label to use for the month nav buttons\n labelMonthNext: 'Next month',\n labelMonthPrev: 'Previous month',\n\n // The title label to use for the dropdown selectors\n labelMonthSelect: 'Select a month',\n labelYearSelect: 'Select a year',\n\n // Months and weekdays\n monthsFull: [ 'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December' ],\n monthsShort: [ 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec' ],\n weekdaysFull: [ 'Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday' ],\n weekdaysShort: [ 'Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat' ],\n\n // Materialize modified\n weekdaysLetter: [ 'S', 'M', 'T', 'W', 'T', 'F', 'S' ],\n\n // Today and clear\n today: 'Today',\n clear: 'Clear',\n close: 'Close',\n\n // The format to show on the `input` element\n format: 'd mmmm, yyyy',\n\n // Classes\n klass: {\n\n table: prefix + 'table',\n\n header: prefix + 'header',\n\n\n // Materialize Added klasses\n date_display: prefix + 'date-display',\n day_display: prefix + 'day-display',\n month_display: prefix + 'month-display',\n year_display: prefix + 'year-display',\n calendar_container: prefix + 'calendar-container',\n // end\n\n\n\n navPrev: prefix + 'nav--prev',\n navNext: prefix + 'nav--next',\n navDisabled: prefix + 'nav--disabled',\n\n month: prefix + 'month',\n year: prefix + 'year',\n\n selectMonth: prefix + 'select--month',\n selectYear: prefix + 'select--year',\n\n weekdays: prefix + 'weekday',\n\n day: prefix + 'day',\n disabled: prefix + 'day--disabled',\n selected: prefix + 'day--selected',\n highlighted: prefix + 'day--highlighted',\n now: prefix + 'day--today',\n infocus: prefix + 'day--infocus',\n outfocus: prefix + 'day--outfocus',\n\n footer: prefix + 'footer',\n\n buttonClear: prefix + 'button--clear',\n buttonToday: prefix + 'button--today',\n buttonClose: prefix + 'button--close'\n }\n }\n})( Picker.klasses().picker + '__' )\n\n\n\n\n\n/**\n * Extend the picker to add the date picker.\n */\nPicker.extend( 'pickadate', DatePicker )\n\n\n}));\n\n\n;(function ($) {\n\n $.fn.characterCounter = function(){\n return this.each(function(){\n\n var itHasLengthAttribute = $(this).attr('length') !== undefined;\n\n if(itHasLengthAttribute){\n $(this).on('input', updateCounter);\n $(this).on('focus', updateCounter);\n $(this).on('blur', removeCounterElement);\n\n addCounterElement($(this));\n }\n\n });\n };\n\n function updateCounter(){\n var maxLength = +$(this).attr('length'),\n actualLength = +$(this).val().length,\n isValidLength = actualLength <= maxLength;\n\n $(this).parent().find('span[class=\"character-counter\"]')\n .html( actualLength + '/' + maxLength);\n\n addInputStyle(isValidLength, $(this));\n }\n\n function addCounterElement($input){\n var $counterElement = $('<span/>')\n .addClass('character-counter')\n .css('float','right')\n .css('font-size','12px')\n .css('height', 1);\n\n $input.parent().append($counterElement);\n }\n\n function removeCounterElement(){\n $(this).parent().find('span[class=\"character-counter\"]').html('');\n }\n\n function addInputStyle(isValidLength, $input){\n var inputHasInvalidClass = $input.hasClass('invalid');\n if (isValidLength && inputHasInvalidClass) {\n $input.removeClass('invalid');\n }\n else if(!isValidLength && !inputHasInvalidClass){\n $input.removeClass('valid');\n $input.addClass('invalid');\n }\n }\n\n $(document).ready(function(){\n $('input, textarea').characterCounter();\n });\n\n}( jQuery ));\n;(function ($) {\n\n var methods = {\n\n init : function(options) {\n var defaults = {\n time_constant: 200, // ms\n dist: -100, // zoom scale TODO: make this more intuitive as an option\n shift: 0, // spacing for center image\n padding: 0, // Padding between non center items\n full_width: false // Change to full width styles\n };\n options = $.extend(defaults, options);\n\n return this.each(function() {\n\n var images, offset, center, pressed, dim, count,\n reference, referenceY, amplitude, target, velocity,\n xform, frame, timestamp, ticker, dragged, vertical_dragged;\n\n // Initialize\n var view = $(this);\n // Don't double initialize.\n if (view.hasClass('initialized')) {\n return true;\n }\n\n // Options\n if (options.full_width) {\n options.dist = 0;\n imageHeight = view.find('.carousel-item img').first().load(function(){\n view.css('height', $(this).height());\n });\n }\n\n view.addClass('initialized');\n pressed = false;\n offset = target = 0;\n images = [];\n item_width = view.find('.carousel-item').first().innerWidth();\n dim = item_width * 2 + options.padding;\n\n view.find('.carousel-item').each(function () {\n images.push($(this)[0]);\n });\n\n count = images.length;\n\n\n function setupEvents() {\n if (typeof window.ontouchstart !== 'undefined') {\n view[0].addEventListener('touchstart', tap);\n view[0].addEventListener('touchmove', drag);\n view[0].addEventListener('touchend', release);\n }\n view[0].addEventListener('mousedown', tap);\n view[0].addEventListener('mousemove', drag);\n view[0].addEventListener('mouseup', release);\n view[0].addEventListener('click', click);\n }\n\n function xpos(e) {\n // touch event\n if (e.targetTouches && (e.targetTouches.length >= 1)) {\n return e.targetTouches[0].clientX;\n }\n\n // mouse event\n return e.clientX;\n }\n\n function ypos(e) {\n // touch event\n if (e.targetTouches && (e.targetTouches.length >= 1)) {\n return e.targetTouches[0].clientY;\n }\n\n // mouse event\n return e.clientY;\n }\n\n function wrap(x) {\n return (x >= count) ? (x % count) : (x < 0) ? wrap(count + (x % count)) : x;\n }\n\n function scroll(x) {\n var i, half, delta, dir, tween, el, alignment, xTranslation;\n\n offset = (typeof x === 'number') ? x : offset;\n center = Math.floor((offset + dim / 2) / dim);\n delta = offset - center * dim;\n dir = (delta < 0) ? 1 : -1;\n tween = -dir * delta * 2 / dim;\n\n if (!options.full_width) {\n alignment = 'translateX(' + (view[0].clientWidth - item_width) / 2 + 'px) ';\n alignment += 'translateY(' + (view[0].clientHeight - item_width) / 2 + 'px)';\n } else {\n alignment = 'translateX(0)';\n }\n\n // center\n el = images[wrap(center)];\n el.style[xform] = alignment +\n ' translateX(' + (-delta / 2) + 'px)' +\n ' translateX(' + (dir * options.shift * tween * i) + 'px)' +\n ' translateZ(' + (options.dist * tween) + 'px)';\n el.style.zIndex = 0;\n if (options.full_width) { tweenedOpacity = 1; }\n else { tweenedOpacity = 1 - 0.2 * tween; }\n el.style.opacity = tweenedOpacity;\n half = count >> 1;\n\n for (i = 1; i <= half; ++i) {\n // right side\n if (options.full_width) {\n zTranslation = options.dist;\n tweenedOpacity = (i === half && delta < 0) ? 1 - tween : 1;\n } else {\n zTranslation = options.dist * (i * 2 + tween * dir);\n tweenedOpacity = 1 - 0.2 * (i * 2 + tween * dir);\n }\n el = images[wrap(center + i)];\n el.style[xform] = alignment +\n ' translateX(' + (options.shift + (dim * i - delta) / 2) + 'px)' +\n ' translateZ(' + zTranslation + 'px)';\n el.style.zIndex = -i;\n el.style.opacity = tweenedOpacity;\n\n\n // left side\n if (options.full_width) {\n zTranslation = options.dist;\n tweenedOpacity = (i === half && delta > 0) ? 1 - tween : 1;\n } else {\n zTranslation = options.dist * (i * 2 - tween * dir);\n tweenedOpacity = 1 - 0.2 * (i * 2 - tween * dir);\n }\n el = images[wrap(center - i)];\n el.style[xform] = alignment +\n ' translateX(' + (-options.shift + (-dim * i - delta) / 2) + 'px)' +\n ' translateZ(' + zTranslation + 'px)';\n el.style.zIndex = -i;\n el.style.opacity = tweenedOpacity;\n }\n\n // center\n el = images[wrap(center)];\n el.style[xform] = alignment +\n ' translateX(' + (-delta / 2) + 'px)' +\n ' translateX(' + (dir * options.shift * tween) + 'px)' +\n ' translateZ(' + (options.dist * tween) + 'px)';\n el.style.zIndex = 0;\n if (options.full_width) { tweenedOpacity = 1; }\n else { tweenedOpacity = 1 - 0.2 * tween; }\n el.style.opacity = tweenedOpacity;\n }\n\n function track() {\n var now, elapsed, delta, v;\n\n now = Date.now();\n elapsed = now - timestamp;\n timestamp = now;\n delta = offset - frame;\n frame = offset;\n\n v = 1000 * delta / (1 + elapsed);\n velocity = 0.8 * v + 0.2 * velocity;\n }\n\n function autoScroll() {\n var elapsed, delta;\n\n if (amplitude) {\n elapsed = Date.now() - timestamp;\n delta = amplitude * Math.exp(-elapsed / options.time_constant);\n if (delta > 2 || delta < -2) {\n scroll(target - delta);\n requestAnimationFrame(autoScroll);\n } else {\n scroll(target);\n }\n }\n }\n\n function click(e) {\n // Disable clicks if carousel was dragged.\n if (dragged) {\n e.preventDefault();\n e.stopPropagation();\n return false;\n\n } else if (!options.full_width) {\n var clickedIndex = $(e.target).closest('.carousel-item').index();\n var diff = (center % count) - clickedIndex;\n\n // Account for wraparound.\n if (diff < 0) {\n if (Math.abs(diff + count) < Math.abs(diff)) { diff += count; }\n\n } else if (diff > 0) {\n if (Math.abs(diff - count) < diff) { diff -= count; }\n }\n\n // Call prev or next accordingly.\n if (diff < 0) {\n $(this).trigger('carouselNext', [Math.abs(diff)]);\n\n } else if (diff > 0) {\n $(this).trigger('carouselPrev', [diff]);\n }\n }\n }\n\n function tap(e) {\n pressed = true;\n dragged = false;\n vertical_dragged = false;\n reference = xpos(e);\n referenceY = ypos(e);\n\n velocity = amplitude = 0;\n frame = offset;\n timestamp = Date.now();\n clearInterval(ticker);\n ticker = setInterval(track, 100);\n\n }\n\n function drag(e) {\n var x, delta, deltaY;\n if (pressed) {\n x = xpos(e);\n y = ypos(e);\n delta = reference - x;\n deltaY = Math.abs(referenceY - y);\n if (deltaY < 30 && !vertical_dragged) {\n // If vertical scrolling don't allow dragging.\n if (delta > 2 || delta < -2) {\n dragged = true;\n reference = x;\n scroll(offset + delta);\n }\n\n } else if (dragged) {\n // If dragging don't allow vertical scroll.\n e.preventDefault();\n e.stopPropagation();\n return false;\n\n } else {\n // Vertical scrolling.\n vertical_dragged = true;\n }\n }\n\n if (dragged) {\n // If dragging don't allow vertical scroll.\n e.preventDefault();\n e.stopPropagation();\n return false;\n }\n }\n\n function release(e) {\n pressed = false;\n\n clearInterval(ticker);\n target = offset;\n if (velocity > 10 || velocity < -10) {\n amplitude = 0.9 * velocity;\n target = offset + amplitude;\n }\n target = Math.round(target / dim) * dim;\n amplitude = target - offset;\n timestamp = Date.now();\n requestAnimationFrame(autoScroll);\n\n e.preventDefault();\n e.stopPropagation();\n return false;\n }\n\n xform = 'transform';\n ['webkit', 'Moz', 'O', 'ms'].every(function (prefix) {\n var e = prefix + 'Transform';\n if (typeof document.body.style[e] !== 'undefined') {\n xform = e;\n return false;\n }\n return true;\n });\n\n\n\n window.onresize = scroll;\n\n setupEvents();\n scroll(offset);\n\n $(this).on('carouselNext', function(e, n) {\n if (n === undefined) {\n n = 1;\n }\n target = offset + dim * n;\n if (offset !== target) {\n amplitude = target - offset;\n timestamp = Date.now();\n requestAnimationFrame(autoScroll);\n }\n });\n\n $(this).on('carouselPrev', function(e, n) {\n if (n === undefined) {\n n = 1;\n }\n target = offset - dim * n;\n if (offset !== target) {\n amplitude = target - offset;\n timestamp = Date.now();\n requestAnimationFrame(autoScroll);\n }\n });\n\n });\n\n\n\n },\n next : function(n) {\n $(this).trigger('carouselNext', [n]);\n },\n prev : function(n) {\n $(this).trigger('carouselPrev', [n]);\n },\n };\n\n\n $.fn.carousel = function(methodOrOptions) {\n if ( methods[methodOrOptions] ) {\n return methods[ methodOrOptions ].apply( this, Array.prototype.slice.call( arguments, 1 ));\n } else if ( typeof methodOrOptions === 'object' || ! methodOrOptions ) {\n // Default to \"init\"\n return methods.init.apply( this, arguments );\n } else {\n $.error( 'Method ' + methodOrOptions + ' does not exist on jQuery.carousel' );\n }\n }; // Plugin end\n}( jQuery ));","// vim:ts=4:sts=4:sw=4:\n/*!\n *\n * Copyright 2009-2012 Kris Kowal under the terms of the MIT\n * license found at http://github.com/kriskowal/q/raw/master/LICENSE\n *\n * With parts by Tyler Close\n * Copyright 2007-2009 Tyler Close under the terms of the MIT X license found\n * at http://www.opensource.org/licenses/mit-license.html\n * Forked at ref_send.js version: 2009-05-11\n *\n * With parts by Mark Miller\n * Copyright (C) 2011 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * 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, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n */\n\n(function (definition) {\n \"use strict\";\n\n // This file will function properly as a <script> tag, or a module\n // using CommonJS and NodeJS or RequireJS module formats. In\n // Common/Node/RequireJS, the module exports the Q API and when\n // executed as a simple <script>, it creates a Q global instead.\n\n // Montage Require\n if (typeof bootstrap === \"function\") {\n bootstrap(\"promise\", definition);\n\n // CommonJS\n } else if (typeof exports === \"object\" && typeof module === \"object\") {\n module.exports = definition();\n\n // RequireJS\n } else if (typeof define === \"function\" && define.amd) {\n define(definition);\n\n // SES (Secure EcmaScript)\n } else if (typeof ses !== \"undefined\") {\n if (!ses.ok()) {\n return;\n } else {\n ses.makeQ = definition;\n }\n\n // <script>\n } else if (typeof window !== \"undefined\" || typeof self !== \"undefined\") {\n // Prefer window over self for add-on scripts. Use self for\n // non-windowed contexts.\n var global = typeof window !== \"undefined\" ? window : self;\n\n // Get the `window` object, save the previous Q global\n // and initialize Q as a global.\n var previousQ = global.Q;\n global.Q = definition();\n\n // Add a noConflict function so Q can be removed from the\n // global namespace.\n global.Q.noConflict = function () {\n global.Q = previousQ;\n return this;\n };\n\n } else {\n throw new Error(\"This environment was not anticipated by Q. Please file a bug.\");\n }\n\n})(function () {\n\"use strict\";\n\nvar hasStacks = false;\ntry {\n throw new Error();\n} catch (e) {\n hasStacks = !!e.stack;\n}\n\n// All code after this point will be filtered from stack traces reported\n// by Q.\nvar qStartingLine = captureLine();\nvar qFileName;\n\n// shims\n\n// used for fallback in \"allResolved\"\nvar noop = function () {};\n\n// Use the fastest possible means to execute a task in a future turn\n// of the event loop.\nvar nextTick =(function () {\n // linked list of tasks (single, with head node)\n var head = {task: void 0, next: null};\n var tail = head;\n var flushing = false;\n var requestTick = void 0;\n var isNodeJS = false;\n // queue for late tasks, used by unhandled rejection tracking\n var laterQueue = [];\n\n function flush() {\n /* jshint loopfunc: true */\n var task, domain;\n\n while (head.next) {\n head = head.next;\n task = head.task;\n head.task = void 0;\n domain = head.domain;\n\n if (domain) {\n head.domain = void 0;\n domain.enter();\n }\n runSingle(task, domain);\n\n }\n while (laterQueue.length) {\n task = laterQueue.pop();\n runSingle(task);\n }\n flushing = false;\n }\n // runs a single function in the async queue\n function runSingle(task, domain) {\n try {\n task();\n\n } catch (e) {\n if (isNodeJS) {\n // In node, uncaught exceptions are considered fatal errors.\n // Re-throw them synchronously to interrupt flushing!\n\n // Ensure continuation if the uncaught exception is suppressed\n // listening \"uncaughtException\" events (as domains does).\n // Continue in next event to avoid tick recursion.\n if (domain) {\n domain.exit();\n }\n setTimeout(flush, 0);\n if (domain) {\n domain.enter();\n }\n\n throw e;\n\n } else {\n // In browsers, uncaught exceptions are not fatal.\n // Re-throw them asynchronously to avoid slow-downs.\n setTimeout(function () {\n throw e;\n }, 0);\n }\n }\n\n if (domain) {\n domain.exit();\n }\n }\n\n nextTick = function (task) {\n tail = tail.next = {\n task: task,\n domain: isNodeJS && process.domain,\n next: null\n };\n\n if (!flushing) {\n flushing = true;\n requestTick();\n }\n };\n\n if (typeof process === \"object\" &&\n process.toString() === \"[object process]\" && process.nextTick) {\n // Ensure Q is in a real Node environment, with a `process.nextTick`.\n // To see through fake Node environments:\n // * Mocha test runner - exposes a `process` global without a `nextTick`\n // * Browserify - exposes a `process.nexTick` function that uses\n // `setTimeout`. In this case `setImmediate` is preferred because\n // it is faster. Browserify's `process.toString()` yields\n // \"[object Object]\", while in a real Node environment\n // `process.nextTick()` yields \"[object process]\".\n isNodeJS = true;\n\n requestTick = function () {\n process.nextTick(flush);\n };\n\n } else if (typeof setImmediate === \"function\") {\n // In IE10, Node.js 0.9+, or https://github.com/NobleJS/setImmediate\n if (typeof window !== \"undefined\") {\n requestTick = setImmediate.bind(window, flush);\n } else {\n requestTick = function () {\n setImmediate(flush);\n };\n }\n\n } else if (typeof MessageChannel !== \"undefined\") {\n // modern browsers\n // http://www.nonblocking.io/2011/06/windownexttick.html\n var channel = new MessageChannel();\n // At least Safari Version 6.0.5 (8536.30.1) intermittently cannot create\n // working message ports the first time a page loads.\n channel.port1.onmessage = function () {\n requestTick = requestPortTick;\n channel.port1.onmessage = flush;\n flush();\n };\n var requestPortTick = function () {\n // Opera requires us to provide a message payload, regardless of\n // whether we use it.\n channel.port2.postMessage(0);\n };\n requestTick = function () {\n setTimeout(flush, 0);\n requestPortTick();\n };\n\n } else {\n // old browsers\n requestTick = function () {\n setTimeout(flush, 0);\n };\n }\n // runs a task after all other tasks have been run\n // this is useful for unhandled rejection tracking that needs to happen\n // after all `then`d tasks have been run.\n nextTick.runAfter = function (task) {\n laterQueue.push(task);\n if (!flushing) {\n flushing = true;\n requestTick();\n }\n };\n return nextTick;\n})();\n\n// Attempt to make generics safe in the face of downstream\n// modifications.\n// There is no situation where this is necessary.\n// If you need a security guarantee, these primordials need to be\n// deeply frozen anyway, and if you don’t need a security guarantee,\n// this is just plain paranoid.\n// However, this **might** have the nice side-effect of reducing the size of\n// the minified code by reducing x.call() to merely x()\n// See Mark Miller’s explanation of what this does.\n// http://wiki.ecmascript.org/doku.php?id=conventions:safe_meta_programming\nvar call = Function.call;\nfunction uncurryThis(f) {\n return function () {\n return call.apply(f, arguments);\n };\n}\n// This is equivalent, but slower:\n// uncurryThis = Function_bind.bind(Function_bind.call);\n// http://jsperf.com/uncurrythis\n\nvar array_slice = uncurryThis(Array.prototype.slice);\n\nvar array_reduce = uncurryThis(\n Array.prototype.reduce || function (callback, basis) {\n var index = 0,\n length = this.length;\n // concerning the initial value, if one is not provided\n if (arguments.length === 1) {\n // seek to the first value in the array, accounting\n // for the possibility that is is a sparse array\n do {\n if (index in this) {\n basis = this[index++];\n break;\n }\n if (++index >= length) {\n throw new TypeError();\n }\n } while (1);\n }\n // reduce\n for (; index < length; index++) {\n // account for the possibility that the array is sparse\n if (index in this) {\n basis = callback(basis, this[index], index);\n }\n }\n return basis;\n }\n);\n\nvar array_indexOf = uncurryThis(\n Array.prototype.indexOf || function (value) {\n // not a very good shim, but good enough for our one use of it\n for (var i = 0; i < this.length; i++) {\n if (this[i] === value) {\n return i;\n }\n }\n return -1;\n }\n);\n\nvar array_map = uncurryThis(\n Array.prototype.map || function (callback, thisp) {\n var self = this;\n var collect = [];\n array_reduce(self, function (undefined, value, index) {\n collect.push(callback.call(thisp, value, index, self));\n }, void 0);\n return collect;\n }\n);\n\nvar object_create = Object.create || function (prototype) {\n function Type() { }\n Type.prototype = prototype;\n return new Type();\n};\n\nvar object_hasOwnProperty = uncurryThis(Object.prototype.hasOwnProperty);\n\nvar object_keys = Object.keys || function (object) {\n var keys = [];\n for (var key in object) {\n if (object_hasOwnProperty(object, key)) {\n keys.push(key);\n }\n }\n return keys;\n};\n\nvar object_toString = uncurryThis(Object.prototype.toString);\n\nfunction isObject(value) {\n return value === Object(value);\n}\n\n// generator related shims\n\n// FIXME: Remove this function once ES6 generators are in SpiderMonkey.\nfunction isStopIteration(exception) {\n return (\n object_toString(exception) === \"[object StopIteration]\" ||\n exception instanceof QReturnValue\n );\n}\n\n// FIXME: Remove this helper and Q.return once ES6 generators are in\n// SpiderMonkey.\nvar QReturnValue;\nif (typeof ReturnValue !== \"undefined\") {\n QReturnValue = ReturnValue;\n} else {\n QReturnValue = function (value) {\n this.value = value;\n };\n}\n\n// long stack traces\n\nvar STACK_JUMP_SEPARATOR = \"From previous event:\";\n\nfunction makeStackTraceLong(error, promise) {\n // If possible, transform the error stack trace by removing Node and Q\n // cruft, then concatenating with the stack trace of `promise`. See #57.\n if (hasStacks &&\n promise.stack &&\n typeof error === \"object\" &&\n error !== null &&\n error.stack &&\n error.stack.indexOf(STACK_JUMP_SEPARATOR) === -1\n ) {\n var stacks = [];\n for (var p = promise; !!p; p = p.source) {\n if (p.stack) {\n stacks.unshift(p.stack);\n }\n }\n stacks.unshift(error.stack);\n\n var concatedStacks = stacks.join(\"\\n\" + STACK_JUMP_SEPARATOR + \"\\n\");\n error.stack = filterStackString(concatedStacks);\n }\n}\n\nfunction filterStackString(stackString) {\n var lines = stackString.split(\"\\n\");\n var desiredLines = [];\n for (var i = 0; i < lines.length; ++i) {\n var line = lines[i];\n\n if (!isInternalFrame(line) && !isNodeFrame(line) && line) {\n desiredLines.push(line);\n }\n }\n return desiredLines.join(\"\\n\");\n}\n\nfunction isNodeFrame(stackLine) {\n return stackLine.indexOf(\"(module.js:\") !== -1 ||\n stackLine.indexOf(\"(node.js:\") !== -1;\n}\n\nfunction getFileNameAndLineNumber(stackLine) {\n // Named functions: \"at functionName (filename:lineNumber:columnNumber)\"\n // In IE10 function name can have spaces (\"Anonymous function\") O_o\n var attempt1 = /at .+ \\((.+):(\\d+):(?:\\d+)\\)$/.exec(stackLine);\n if (attempt1) {\n return [attempt1[1], Number(attempt1[2])];\n }\n\n // Anonymous functions: \"at filename:lineNumber:columnNumber\"\n var attempt2 = /at ([^ ]+):(\\d+):(?:\\d+)$/.exec(stackLine);\n if (attempt2) {\n return [attempt2[1], Number(attempt2[2])];\n }\n\n // Firefox style: \"function@filename:lineNumber or @filename:lineNumber\"\n var attempt3 = /.*@(.+):(\\d+)$/.exec(stackLine);\n if (attempt3) {\n return [attempt3[1], Number(attempt3[2])];\n }\n}\n\nfunction isInternalFrame(stackLine) {\n var fileNameAndLineNumber = getFileNameAndLineNumber(stackLine);\n\n if (!fileNameAndLineNumber) {\n return false;\n }\n\n var fileName = fileNameAndLineNumber[0];\n var lineNumber = fileNameAndLineNumber[1];\n\n return fileName === qFileName &&\n lineNumber >= qStartingLine &&\n lineNumber <= qEndingLine;\n}\n\n// discover own file name and line number range for filtering stack\n// traces\nfunction captureLine() {\n if (!hasStacks) {\n return;\n }\n\n try {\n throw new Error();\n } catch (e) {\n var lines = e.stack.split(\"\\n\");\n var firstLine = lines[0].indexOf(\"@\") > 0 ? lines[1] : lines[2];\n var fileNameAndLineNumber = getFileNameAndLineNumber(firstLine);\n if (!fileNameAndLineNumber) {\n return;\n }\n\n qFileName = fileNameAndLineNumber[0];\n return fileNameAndLineNumber[1];\n }\n}\n\nfunction deprecate(callback, name, alternative) {\n return function () {\n if (typeof console !== \"undefined\" &&\n typeof console.warn === \"function\") {\n console.warn(name + \" is deprecated, use \" + alternative +\n \" instead.\", new Error(\"\").stack);\n }\n return callback.apply(callback, arguments);\n };\n}\n\n// end of shims\n// beginning of real work\n\n/**\n * Constructs a promise for an immediate reference, passes promises through, or\n * coerces promises from different systems.\n * @param value immediate reference or promise\n */\nfunction Q(value) {\n // If the object is already a Promise, return it directly. This enables\n // the resolve function to both be used to created references from objects,\n // but to tolerably coerce non-promises to promises.\n if (value instanceof Promise) {\n return value;\n }\n\n // assimilate thenables\n if (isPromiseAlike(value)) {\n return coerce(value);\n } else {\n return fulfill(value);\n }\n}\nQ.resolve = Q;\n\n/**\n * Performs a task in a future turn of the event loop.\n * @param {Function} task\n */\nQ.nextTick = nextTick;\n\n/**\n * Controls whether or not long stack traces will be on\n */\nQ.longStackSupport = false;\n\n// enable long stacks if Q_DEBUG is set\nif (typeof process === \"object\" && process && process.env && process.env.Q_DEBUG) {\n Q.longStackSupport = true;\n}\n\n/**\n * Constructs a {promise, resolve, reject} object.\n *\n * `resolve` is a callback to invoke with a more resolved value for the\n * promise. To fulfill the promise, invoke `resolve` with any value that is\n * not a thenable. To reject the promise, invoke `resolve` with a rejected\n * thenable, or invoke `reject` with the reason directly. To resolve the\n * promise to another thenable, thus putting it in the same state, invoke\n * `resolve` with that other thenable.\n */\nQ.defer = defer;\nfunction defer() {\n // if \"messages\" is an \"Array\", that indicates that the promise has not yet\n // been resolved. If it is \"undefined\", it has been resolved. Each\n // element of the messages array is itself an array of complete arguments to\n // forward to the resolved promise. We coerce the resolution value to a\n // promise using the `resolve` function because it handles both fully\n // non-thenable values and other thenables gracefully.\n var messages = [], progressListeners = [], resolvedPromise;\n\n var deferred = object_create(defer.prototype);\n var promise = object_create(Promise.prototype);\n\n promise.promiseDispatch = function (resolve, op, operands) {\n var args = array_slice(arguments);\n if (messages) {\n messages.push(args);\n if (op === \"when\" && operands[1]) { // progress operand\n progressListeners.push(operands[1]);\n }\n } else {\n Q.nextTick(function () {\n resolvedPromise.promiseDispatch.apply(resolvedPromise, args);\n });\n }\n };\n\n // XXX deprecated\n promise.valueOf = function () {\n if (messages) {\n return promise;\n }\n var nearerValue = nearer(resolvedPromise);\n if (isPromise(nearerValue)) {\n resolvedPromise = nearerValue; // shorten chain\n }\n return nearerValue;\n };\n\n promise.inspect = function () {\n if (!resolvedPromise) {\n return { state: \"pending\" };\n }\n return resolvedPromise.inspect();\n };\n\n if (Q.longStackSupport && hasStacks) {\n try {\n throw new Error();\n } catch (e) {\n // NOTE: don't try to use `Error.captureStackTrace` or transfer the\n // accessor around; that causes memory leaks as per GH-111. Just\n // reify the stack trace as a string ASAP.\n //\n // At the same time, cut off the first line; it's always just\n // \"[object Promise]\\n\", as per the `toString`.\n promise.stack = e.stack.substring(e.stack.indexOf(\"\\n\") + 1);\n }\n }\n\n // NOTE: we do the checks for `resolvedPromise` in each method, instead of\n // consolidating them into `become`, since otherwise we'd create new\n // promises with the lines `become(whatever(value))`. See e.g. GH-252.\n\n function become(newPromise) {\n resolvedPromise = newPromise;\n promise.source = newPromise;\n\n array_reduce(messages, function (undefined, message) {\n Q.nextTick(function () {\n newPromise.promiseDispatch.apply(newPromise, message);\n });\n }, void 0);\n\n messages = void 0;\n progressListeners = void 0;\n }\n\n deferred.promise = promise;\n deferred.resolve = function (value) {\n if (resolvedPromise) {\n return;\n }\n\n become(Q(value));\n };\n\n deferred.fulfill = function (value) {\n if (resolvedPromise) {\n return;\n }\n\n become(fulfill(value));\n };\n deferred.reject = function (reason) {\n if (resolvedPromise) {\n return;\n }\n\n become(reject(reason));\n };\n deferred.notify = function (progress) {\n if (resolvedPromise) {\n return;\n }\n\n array_reduce(progressListeners, function (undefined, progressListener) {\n Q.nextTick(function () {\n progressListener(progress);\n });\n }, void 0);\n };\n\n return deferred;\n}\n\n/**\n * Creates a Node-style callback that will resolve or reject the deferred\n * promise.\n * @returns a nodeback\n */\ndefer.prototype.makeNodeResolver = function () {\n var self = this;\n return function (error, value) {\n if (error) {\n self.reject(error);\n } else if (arguments.length > 2) {\n self.resolve(array_slice(arguments, 1));\n } else {\n self.resolve(value);\n }\n };\n};\n\n/**\n * @param resolver {Function} a function that returns nothing and accepts\n * the resolve, reject, and notify functions for a deferred.\n * @returns a promise that may be resolved with the given resolve and reject\n * functions, or rejected by a thrown exception in resolver\n */\nQ.Promise = promise; // ES6\nQ.promise = promise;\nfunction promise(resolver) {\n if (typeof resolver !== \"function\") {\n throw new TypeError(\"resolver must be a function.\");\n }\n var deferred = defer();\n try {\n resolver(deferred.resolve, deferred.reject, deferred.notify);\n } catch (reason) {\n deferred.reject(reason);\n }\n return deferred.promise;\n}\n\npromise.race = race; // ES6\npromise.all = all; // ES6\npromise.reject = reject; // ES6\npromise.resolve = Q; // ES6\n\n// XXX experimental. This method is a way to denote that a local value is\n// serializable and should be immediately dispatched to a remote upon request,\n// instead of passing a reference.\nQ.passByCopy = function (object) {\n //freeze(object);\n //passByCopies.set(object, true);\n return object;\n};\n\nPromise.prototype.passByCopy = function () {\n //freeze(object);\n //passByCopies.set(object, true);\n return this;\n};\n\n/**\n * If two promises eventually fulfill to the same value, promises that value,\n * but otherwise rejects.\n * @param x {Any*}\n * @param y {Any*}\n * @returns {Any*} a promise for x and y if they are the same, but a rejection\n * otherwise.\n *\n */\nQ.join = function (x, y) {\n return Q(x).join(y);\n};\n\nPromise.prototype.join = function (that) {\n return Q([this, that]).spread(function (x, y) {\n if (x === y) {\n // TODO: \"===\" should be Object.is or equiv\n return x;\n } else {\n throw new Error(\"Can't join: not the same: \" + x + \" \" + y);\n }\n });\n};\n\n/**\n * Returns a promise for the first of an array of promises to become settled.\n * @param answers {Array[Any*]} promises to race\n * @returns {Any*} the first promise to be settled\n */\nQ.race = race;\nfunction race(answerPs) {\n return promise(function (resolve, reject) {\n // Switch to this once we can assume at least ES5\n // answerPs.forEach(function (answerP) {\n // Q(answerP).then(resolve, reject);\n // });\n // Use this in the meantime\n for (var i = 0, len = answerPs.length; i < len; i++) {\n Q(answerPs[i]).then(resolve, reject);\n }\n });\n}\n\nPromise.prototype.race = function () {\n return this.then(Q.race);\n};\n\n/**\n * Constructs a Promise with a promise descriptor object and optional fallback\n * function. The descriptor contains methods like when(rejected), get(name),\n * set(name, value), post(name, args), and delete(name), which all\n * return either a value, a promise for a value, or a rejection. The fallback\n * accepts the operation name, a resolver, and any further arguments that would\n * have been forwarded to the appropriate method above had a method been\n * provided with the proper name. The API makes no guarantees about the nature\n * of the returned object, apart from that it is usable whereever promises are\n * bought and sold.\n */\nQ.makePromise = Promise;\nfunction Promise(descriptor, fallback, inspect) {\n if (fallback === void 0) {\n fallback = function (op) {\n return reject(new Error(\n \"Promise does not support operation: \" + op\n ));\n };\n }\n if (inspect === void 0) {\n inspect = function () {\n return {state: \"unknown\"};\n };\n }\n\n var promise = object_create(Promise.prototype);\n\n promise.promiseDispatch = function (resolve, op, args) {\n var result;\n try {\n if (descriptor[op]) {\n result = descriptor[op].apply(promise, args);\n } else {\n result = fallback.call(promise, op, args);\n }\n } catch (exception) {\n result = reject(exception);\n }\n if (resolve) {\n resolve(result);\n }\n };\n\n promise.inspect = inspect;\n\n // XXX deprecated `valueOf` and `exception` support\n if (inspect) {\n var inspected = inspect();\n if (inspected.state === \"rejected\") {\n promise.exception = inspected.reason;\n }\n\n promise.valueOf = function () {\n var inspected = inspect();\n if (inspected.state === \"pending\" ||\n inspected.state === \"rejected\") {\n return promise;\n }\n return inspected.value;\n };\n }\n\n return promise;\n}\n\nPromise.prototype.toString = function () {\n return \"[object Promise]\";\n};\n\nPromise.prototype.then = function (fulfilled, rejected, progressed) {\n var self = this;\n var deferred = defer();\n var done = false; // ensure the untrusted promise makes at most a\n // single call to one of the callbacks\n\n function _fulfilled(value) {\n try {\n return typeof fulfilled === \"function\" ? fulfilled(value) : value;\n } catch (exception) {\n return reject(exception);\n }\n }\n\n function _rejected(exception) {\n if (typeof rejected === \"function\") {\n makeStackTraceLong(exception, self);\n try {\n return rejected(exception);\n } catch (newException) {\n return reject(newException);\n }\n }\n return reject(exception);\n }\n\n function _progressed(value) {\n return typeof progressed === \"function\" ? progressed(value) : value;\n }\n\n Q.nextTick(function () {\n self.promiseDispatch(function (value) {\n if (done) {\n return;\n }\n done = true;\n\n deferred.resolve(_fulfilled(value));\n }, \"when\", [function (exception) {\n if (done) {\n return;\n }\n done = true;\n\n deferred.resolve(_rejected(exception));\n }]);\n });\n\n // Progress propagator need to be attached in the current tick.\n self.promiseDispatch(void 0, \"when\", [void 0, function (value) {\n var newValue;\n var threw = false;\n try {\n newValue = _progressed(value);\n } catch (e) {\n threw = true;\n if (Q.onerror) {\n Q.onerror(e);\n } else {\n throw e;\n }\n }\n\n if (!threw) {\n deferred.notify(newValue);\n }\n }]);\n\n return deferred.promise;\n};\n\nQ.tap = function (promise, callback) {\n return Q(promise).tap(callback);\n};\n\n/**\n * Works almost like \"finally\", but not called for rejections.\n * Original resolution value is passed through callback unaffected.\n * Callback may return a promise that will be awaited for.\n * @param {Function} callback\n * @returns {Q.Promise}\n * @example\n * doSomething()\n * .then(...)\n * .tap(console.log)\n * .then(...);\n */\nPromise.prototype.tap = function (callback) {\n callback = Q(callback);\n\n return this.then(function (value) {\n return callback.fcall(value).thenResolve(value);\n });\n};\n\n/**\n * Registers an observer on a promise.\n *\n * Guarantees:\n *\n * 1. that fulfilled and rejected will be called only once.\n * 2. that either the fulfilled callback or the rejected callback will be\n * called, but not both.\n * 3. that fulfilled and rejected will not be called in this turn.\n *\n * @param value promise or immediate reference to observe\n * @param fulfilled function to be called with the fulfilled value\n * @param rejected function to be called with the rejection exception\n * @param progressed function to be called on any progress notifications\n * @return promise for the return value from the invoked callback\n */\nQ.when = when;\nfunction when(value, fulfilled, rejected, progressed) {\n return Q(value).then(fulfilled, rejected, progressed);\n}\n\nPromise.prototype.thenResolve = function (value) {\n return this.then(function () { return value; });\n};\n\nQ.thenResolve = function (promise, value) {\n return Q(promise).thenResolve(value);\n};\n\nPromise.prototype.thenReject = function (reason) {\n return this.then(function () { throw reason; });\n};\n\nQ.thenReject = function (promise, reason) {\n return Q(promise).thenReject(reason);\n};\n\n/**\n * If an object is not a promise, it is as \"near\" as possible.\n * If a promise is rejected, it is as \"near\" as possible too.\n * If it’s a fulfilled promise, the fulfillment value is nearer.\n * If it’s a deferred promise and the deferred has been resolved, the\n * resolution is \"nearer\".\n * @param object\n * @returns most resolved (nearest) form of the object\n */\n\n// XXX should we re-do this?\nQ.nearer = nearer;\nfunction nearer(value) {\n if (isPromise(value)) {\n var inspected = value.inspect();\n if (inspected.state === \"fulfilled\") {\n return inspected.value;\n }\n }\n return value;\n}\n\n/**\n * @returns whether the given object is a promise.\n * Otherwise it is a fulfilled value.\n */\nQ.isPromise = isPromise;\nfunction isPromise(object) {\n return object instanceof Promise;\n}\n\nQ.isPromiseAlike = isPromiseAlike;\nfunction isPromiseAlike(object) {\n return isObject(object) && typeof object.then === \"function\";\n}\n\n/**\n * @returns whether the given object is a pending promise, meaning not\n * fulfilled or rejected.\n */\nQ.isPending = isPending;\nfunction isPending(object) {\n return isPromise(object) && object.inspect().state === \"pending\";\n}\n\nPromise.prototype.isPending = function () {\n return this.inspect().state === \"pending\";\n};\n\n/**\n * @returns whether the given object is a value or fulfilled\n * promise.\n */\nQ.isFulfilled = isFulfilled;\nfunction isFulfilled(object) {\n return !isPromise(object) || object.inspect().state === \"fulfilled\";\n}\n\nPromise.prototype.isFulfilled = function () {\n return this.inspect().state === \"fulfilled\";\n};\n\n/**\n * @returns whether the given object is a rejected promise.\n */\nQ.isRejected = isRejected;\nfunction isRejected(object) {\n return isPromise(object) && object.inspect().state === \"rejected\";\n}\n\nPromise.prototype.isRejected = function () {\n return this.inspect().state === \"rejected\";\n};\n\n//// BEGIN UNHANDLED REJECTION TRACKING\n\n// This promise library consumes exceptions thrown in handlers so they can be\n// handled by a subsequent promise. The exceptions get added to this array when\n// they are created, and removed when they are handled. Note that in ES6 or\n// shimmed environments, this would naturally be a `Set`.\nvar unhandledReasons = [];\nvar unhandledRejections = [];\nvar reportedUnhandledRejections = [];\nvar trackUnhandledRejections = true;\n\nfunction resetUnhandledRejections() {\n unhandledReasons.length = 0;\n unhandledRejections.length = 0;\n\n if (!trackUnhandledRejections) {\n trackUnhandledRejections = true;\n }\n}\n\nfunction trackRejection(promise, reason) {\n if (!trackUnhandledRejections) {\n return;\n }\n if (typeof process === \"object\" && typeof process.emit === \"function\") {\n Q.nextTick.runAfter(function () {\n if (array_indexOf(unhandledRejections, promise) !== -1) {\n process.emit(\"unhandledRejection\", reason, promise);\n reportedUnhandledRejections.push(promise);\n }\n });\n }\n\n unhandledRejections.push(promise);\n if (reason && typeof reason.stack !== \"undefined\") {\n unhandledReasons.push(reason.stack);\n } else {\n unhandledReasons.push(\"(no stack) \" + reason);\n }\n}\n\nfunction untrackRejection(promise) {\n if (!trackUnhandledRejections) {\n return;\n }\n\n var at = array_indexOf(unhandledRejections, promise);\n if (at !== -1) {\n if (typeof process === \"object\" && typeof process.emit === \"function\") {\n Q.nextTick.runAfter(function () {\n var atReport = array_indexOf(reportedUnhandledRejections, promise);\n if (atReport !== -1) {\n process.emit(\"rejectionHandled\", unhandledReasons[at], promise);\n reportedUnhandledRejections.splice(atReport, 1);\n }\n });\n }\n unhandledRejections.splice(at, 1);\n unhandledReasons.splice(at, 1);\n }\n}\n\nQ.resetUnhandledRejections = resetUnhandledRejections;\n\nQ.getUnhandledReasons = function () {\n // Make a copy so that consumers can't interfere with our internal state.\n return unhandledReasons.slice();\n};\n\nQ.stopUnhandledRejectionTracking = function () {\n resetUnhandledRejections();\n trackUnhandledRejections = false;\n};\n\nresetUnhandledRejections();\n\n//// END UNHANDLED REJECTION TRACKING\n\n/**\n * Constructs a rejected promise.\n * @param reason value describing the failure\n */\nQ.reject = reject;\nfunction reject(reason) {\n var rejection = Promise({\n \"when\": function (rejected) {\n // note that the error has been handled\n if (rejected) {\n untrackRejection(this);\n }\n return rejected ? rejected(reason) : this;\n }\n }, function fallback() {\n return this;\n }, function inspect() {\n return { state: \"rejected\", reason: reason };\n });\n\n // Note that the reason has not been handled.\n trackRejection(rejection, reason);\n\n return rejection;\n}\n\n/**\n * Constructs a fulfilled promise for an immediate reference.\n * @param value immediate reference\n */\nQ.fulfill = fulfill;\nfunction fulfill(value) {\n return Promise({\n \"when\": function () {\n return value;\n },\n \"get\": function (name) {\n return value[name];\n },\n \"set\": function (name, rhs) {\n value[name] = rhs;\n },\n \"delete\": function (name) {\n delete value[name];\n },\n \"post\": function (name, args) {\n // Mark Miller proposes that post with no name should apply a\n // promised function.\n if (name === null || name === void 0) {\n return value.apply(void 0, args);\n } else {\n return value[name].apply(value, args);\n }\n },\n \"apply\": function (thisp, args) {\n return value.apply(thisp, args);\n },\n \"keys\": function () {\n return object_keys(value);\n }\n }, void 0, function inspect() {\n return { state: \"fulfilled\", value: value };\n });\n}\n\n/**\n * Converts thenables to Q promises.\n * @param promise thenable promise\n * @returns a Q promise\n */\nfunction coerce(promise) {\n var deferred = defer();\n Q.nextTick(function () {\n try {\n promise.then(deferred.resolve, deferred.reject, deferred.notify);\n } catch (exception) {\n deferred.reject(exception);\n }\n });\n return deferred.promise;\n}\n\n/**\n * Annotates an object such that it will never be\n * transferred away from this process over any promise\n * communication channel.\n * @param object\n * @returns promise a wrapping of that object that\n * additionally responds to the \"isDef\" message\n * without a rejection.\n */\nQ.master = master;\nfunction master(object) {\n return Promise({\n \"isDef\": function () {}\n }, function fallback(op, args) {\n return dispatch(object, op, args);\n }, function () {\n return Q(object).inspect();\n });\n}\n\n/**\n * Spreads the values of a promised array of arguments into the\n * fulfillment callback.\n * @param fulfilled callback that receives variadic arguments from the\n * promised array\n * @param rejected callback that receives the exception if the promise\n * is rejected.\n * @returns a promise for the return value or thrown exception of\n * either callback.\n */\nQ.spread = spread;\nfunction spread(value, fulfilled, rejected) {\n return Q(value).spread(fulfilled, rejected);\n}\n\nPromise.prototype.spread = function (fulfilled, rejected) {\n return this.all().then(function (array) {\n return fulfilled.apply(void 0, array);\n }, rejected);\n};\n\n/**\n * The async function is a decorator for generator functions, turning\n * them into asynchronous generators. Although generators are only part\n * of the newest ECMAScript 6 drafts, this code does not cause syntax\n * errors in older engines. This code should continue to work and will\n * in fact improve over time as the language improves.\n *\n * ES6 generators are currently part of V8 version 3.19 with the\n * --harmony-generators runtime flag enabled. SpiderMonkey has had them\n * for longer, but under an older Python-inspired form. This function\n * works on both kinds of generators.\n *\n * Decorates a generator function such that:\n * - it may yield promises\n * - execution will continue when that promise is fulfilled\n * - the value of the yield expression will be the fulfilled value\n * - it returns a promise for the return value (when the generator\n * stops iterating)\n * - the decorated function returns a promise for the return value\n * of the generator or the first rejected promise among those\n * yielded.\n * - if an error is thrown in the generator, it propagates through\n * every following yield until it is caught, or until it escapes\n * the generator function altogether, and is translated into a\n * rejection for the promise returned by the decorated generator.\n */\nQ.async = async;\nfunction async(makeGenerator) {\n return function () {\n // when verb is \"send\", arg is a value\n // when verb is \"throw\", arg is an exception\n function continuer(verb, arg) {\n var result;\n\n // Until V8 3.19 / Chromium 29 is released, SpiderMonkey is the only\n // engine that has a deployed base of browsers that support generators.\n // However, SM's generators use the Python-inspired semantics of\n // outdated ES6 drafts. We would like to support ES6, but we'd also\n // like to make it possible to use generators in deployed browsers, so\n // we also support Python-style generators. At some point we can remove\n // this block.\n\n if (typeof StopIteration === \"undefined\") {\n // ES6 Generators\n try {\n result = generator[verb](arg);\n } catch (exception) {\n return reject(exception);\n }\n if (result.done) {\n return Q(result.value);\n } else {\n return when(result.value, callback, errback);\n }\n } else {\n // SpiderMonkey Generators\n // FIXME: Remove this case when SM does ES6 generators.\n try {\n result = generator[verb](arg);\n } catch (exception) {\n if (isStopIteration(exception)) {\n return Q(exception.value);\n } else {\n return reject(exception);\n }\n }\n return when(result, callback, errback);\n }\n }\n var generator = makeGenerator.apply(this, arguments);\n var callback = continuer.bind(continuer, \"next\");\n var errback = continuer.bind(continuer, \"throw\");\n return callback();\n };\n}\n\n/**\n * The spawn function is a small wrapper around async that immediately\n * calls the generator and also ends the promise chain, so that any\n * unhandled errors are thrown instead of forwarded to the error\n * handler. This is useful because it's extremely common to run\n * generators at the top-level to work with libraries.\n */\nQ.spawn = spawn;\nfunction spawn(makeGenerator) {\n Q.done(Q.async(makeGenerator)());\n}\n\n// FIXME: Remove this interface once ES6 generators are in SpiderMonkey.\n/**\n * Throws a ReturnValue exception to stop an asynchronous generator.\n *\n * This interface is a stop-gap measure to support generator return\n * values in older Firefox/SpiderMonkey. In browsers that support ES6\n * generators like Chromium 29, just use \"return\" in your generator\n * functions.\n *\n * @param value the return value for the surrounding generator\n * @throws ReturnValue exception with the value.\n * @example\n * // ES6 style\n * Q.async(function* () {\n * var foo = yield getFooPromise();\n * var bar = yield getBarPromise();\n * return foo + bar;\n * })\n * // Older SpiderMonkey style\n * Q.async(function () {\n * var foo = yield getFooPromise();\n * var bar = yield getBarPromise();\n * Q.return(foo + bar);\n * })\n */\nQ[\"return\"] = _return;\nfunction _return(value) {\n throw new QReturnValue(value);\n}\n\n/**\n * The promised function decorator ensures that any promise arguments\n * are settled and passed as values (`this` is also settled and passed\n * as a value). It will also ensure that the result of a function is\n * always a promise.\n *\n * @example\n * var add = Q.promised(function (a, b) {\n * return a + b;\n * });\n * add(Q(a), Q(B));\n *\n * @param {function} callback The function to decorate\n * @returns {function} a function that has been decorated.\n */\nQ.promised = promised;\nfunction promised(callback) {\n return function () {\n return spread([this, all(arguments)], function (self, args) {\n return callback.apply(self, args);\n });\n };\n}\n\n/**\n * sends a message to a value in a future turn\n * @param object* the recipient\n * @param op the name of the message operation, e.g., \"when\",\n * @param args further arguments to be forwarded to the operation\n * @returns result {Promise} a promise for the result of the operation\n */\nQ.dispatch = dispatch;\nfunction dispatch(object, op, args) {\n return Q(object).dispatch(op, args);\n}\n\nPromise.prototype.dispatch = function (op, args) {\n var self = this;\n var deferred = defer();\n Q.nextTick(function () {\n self.promiseDispatch(deferred.resolve, op, args);\n });\n return deferred.promise;\n};\n\n/**\n * Gets the value of a property in a future turn.\n * @param object promise or immediate reference for target object\n * @param name name of property to get\n * @return promise for the property value\n */\nQ.get = function (object, key) {\n return Q(object).dispatch(\"get\", [key]);\n};\n\nPromise.prototype.get = function (key) {\n return this.dispatch(\"get\", [key]);\n};\n\n/**\n * Sets the value of a property in a future turn.\n * @param object promise or immediate reference for object object\n * @param name name of property to set\n * @param value new value of property\n * @return promise for the return value\n */\nQ.set = function (object, key, value) {\n return Q(object).dispatch(\"set\", [key, value]);\n};\n\nPromise.prototype.set = function (key, value) {\n return this.dispatch(\"set\", [key, value]);\n};\n\n/**\n * Deletes a property in a future turn.\n * @param object promise or immediate reference for target object\n * @param name name of property to delete\n * @return promise for the return value\n */\nQ.del = // XXX legacy\nQ[\"delete\"] = function (object, key) {\n return Q(object).dispatch(\"delete\", [key]);\n};\n\nPromise.prototype.del = // XXX legacy\nPromise.prototype[\"delete\"] = function (key) {\n return this.dispatch(\"delete\", [key]);\n};\n\n/**\n * Invokes a method in a future turn.\n * @param object promise or immediate reference for target object\n * @param name name of method to invoke\n * @param value a value to post, typically an array of\n * invocation arguments for promises that\n * are ultimately backed with `resolve` values,\n * as opposed to those backed with URLs\n * wherein the posted value can be any\n * JSON serializable object.\n * @return promise for the return value\n */\n// bound locally because it is used by other methods\nQ.mapply = // XXX As proposed by \"Redsandro\"\nQ.post = function (object, name, args) {\n return Q(object).dispatch(\"post\", [name, args]);\n};\n\nPromise.prototype.mapply = // XXX As proposed by \"Redsandro\"\nPromise.prototype.post = function (name, args) {\n return this.dispatch(\"post\", [name, args]);\n};\n\n/**\n * Invokes a method in a future turn.\n * @param object promise or immediate reference for target object\n * @param name name of method to invoke\n * @param ...args array of invocation arguments\n * @return promise for the return value\n */\nQ.send = // XXX Mark Miller's proposed parlance\nQ.mcall = // XXX As proposed by \"Redsandro\"\nQ.invoke = function (object, name /*...args*/) {\n return Q(object).dispatch(\"post\", [name, array_slice(arguments, 2)]);\n};\n\nPromise.prototype.send = // XXX Mark Miller's proposed parlance\nPromise.prototype.mcall = // XXX As proposed by \"Redsandro\"\nPromise.prototype.invoke = function (name /*...args*/) {\n return this.dispatch(\"post\", [name, array_slice(arguments, 1)]);\n};\n\n/**\n * Applies the promised function in a future turn.\n * @param object promise or immediate reference for target function\n * @param args array of application arguments\n */\nQ.fapply = function (object, args) {\n return Q(object).dispatch(\"apply\", [void 0, args]);\n};\n\nPromise.prototype.fapply = function (args) {\n return this.dispatch(\"apply\", [void 0, args]);\n};\n\n/**\n * Calls the promised function in a future turn.\n * @param object promise or immediate reference for target function\n * @param ...args array of application arguments\n */\nQ[\"try\"] =\nQ.fcall = function (object /* ...args*/) {\n return Q(object).dispatch(\"apply\", [void 0, array_slice(arguments, 1)]);\n};\n\nPromise.prototype.fcall = function (/*...args*/) {\n return this.dispatch(\"apply\", [void 0, array_slice(arguments)]);\n};\n\n/**\n * Binds the promised function, transforming return values into a fulfilled\n * promise and thrown errors into a rejected one.\n * @param object promise or immediate reference for target function\n * @param ...args array of application arguments\n */\nQ.fbind = function (object /*...args*/) {\n var promise = Q(object);\n var args = array_slice(arguments, 1);\n return function fbound() {\n return promise.dispatch(\"apply\", [\n this,\n args.concat(array_slice(arguments))\n ]);\n };\n};\nPromise.prototype.fbind = function (/*...args*/) {\n var promise = this;\n var args = array_slice(arguments);\n return function fbound() {\n return promise.dispatch(\"apply\", [\n this,\n args.concat(array_slice(arguments))\n ]);\n };\n};\n\n/**\n * Requests the names of the owned properties of a promised\n * object in a future turn.\n * @param object promise or immediate reference for target object\n * @return promise for the keys of the eventually settled object\n */\nQ.keys = function (object) {\n return Q(object).dispatch(\"keys\", []);\n};\n\nPromise.prototype.keys = function () {\n return this.dispatch(\"keys\", []);\n};\n\n/**\n * Turns an array of promises into a promise for an array. If any of\n * the promises gets rejected, the whole array is rejected immediately.\n * @param {Array*} an array (or promise for an array) of values (or\n * promises for values)\n * @returns a promise for an array of the corresponding values\n */\n// By Mark Miller\n// http://wiki.ecmascript.org/doku.php?id=strawman:concurrency&rev=1308776521#allfulfilled\nQ.all = all;\nfunction all(promises) {\n return when(promises, function (promises) {\n var pendingCount = 0;\n var deferred = defer();\n array_reduce(promises, function (undefined, promise, index) {\n var snapshot;\n if (\n isPromise(promise) &&\n (snapshot = promise.inspect()).state === \"fulfilled\"\n ) {\n promises[index] = snapshot.value;\n } else {\n ++pendingCount;\n when(\n promise,\n function (value) {\n promises[index] = value;\n if (--pendingCount === 0) {\n deferred.resolve(promises);\n }\n },\n deferred.reject,\n function (progress) {\n deferred.notify({ index: index, value: progress });\n }\n );\n }\n }, void 0);\n if (pendingCount === 0) {\n deferred.resolve(promises);\n }\n return deferred.promise;\n });\n}\n\nPromise.prototype.all = function () {\n return all(this);\n};\n\n/**\n * Returns the first resolved promise of an array. Prior rejected promises are\n * ignored. Rejects only if all promises are rejected.\n * @param {Array*} an array containing values or promises for values\n * @returns a promise fulfilled with the value of the first resolved promise,\n * or a rejected promise if all promises are rejected.\n */\nQ.any = any;\n\nfunction any(promises) {\n if (promises.length === 0) {\n return Q.resolve();\n }\n\n var deferred = Q.defer();\n var pendingCount = 0;\n array_reduce(promises, function (prev, current, index) {\n var promise = promises[index];\n\n pendingCount++;\n\n when(promise, onFulfilled, onRejected, onProgress);\n function onFulfilled(result) {\n deferred.resolve(result);\n }\n function onRejected() {\n pendingCount--;\n if (pendingCount === 0) {\n deferred.reject(new Error(\n \"Can't get fulfillment value from any promise, all \" +\n \"promises were rejected.\"\n ));\n }\n }\n function onProgress(progress) {\n deferred.notify({\n index: index,\n value: progress\n });\n }\n }, undefined);\n\n return deferred.promise;\n}\n\nPromise.prototype.any = function () {\n return any(this);\n};\n\n/**\n * Waits for all promises to be settled, either fulfilled or\n * rejected. This is distinct from `all` since that would stop\n * waiting at the first rejection. The promise returned by\n * `allResolved` will never be rejected.\n * @param promises a promise for an array (or an array) of promises\n * (or values)\n * @return a promise for an array of promises\n */\nQ.allResolved = deprecate(allResolved, \"allResolved\", \"allSettled\");\nfunction allResolved(promises) {\n return when(promises, function (promises) {\n promises = array_map(promises, Q);\n return when(all(array_map(promises, function (promise) {\n return when(promise, noop, noop);\n })), function () {\n return promises;\n });\n });\n}\n\nPromise.prototype.allResolved = function () {\n return allResolved(this);\n};\n\n/**\n * @see Promise#allSettled\n */\nQ.allSettled = allSettled;\nfunction allSettled(promises) {\n return Q(promises).allSettled();\n}\n\n/**\n * Turns an array of promises into a promise for an array of their states (as\n * returned by `inspect`) when they have all settled.\n * @param {Array[Any*]} values an array (or promise for an array) of values (or\n * promises for values)\n * @returns {Array[State]} an array of states for the respective values.\n */\nPromise.prototype.allSettled = function () {\n return this.then(function (promises) {\n return all(array_map(promises, function (promise) {\n promise = Q(promise);\n function regardless() {\n return promise.inspect();\n }\n return promise.then(regardless, regardless);\n }));\n });\n};\n\n/**\n * Captures the failure of a promise, giving an oportunity to recover\n * with a callback. If the given promise is fulfilled, the returned\n * promise is fulfilled.\n * @param {Any*} promise for something\n * @param {Function} callback to fulfill the returned promise if the\n * given promise is rejected\n * @returns a promise for the return value of the callback\n */\nQ.fail = // XXX legacy\nQ[\"catch\"] = function (object, rejected) {\n return Q(object).then(void 0, rejected);\n};\n\nPromise.prototype.fail = // XXX legacy\nPromise.prototype[\"catch\"] = function (rejected) {\n return this.then(void 0, rejected);\n};\n\n/**\n * Attaches a listener that can respond to progress notifications from a\n * promise's originating deferred. This listener receives the exact arguments\n * passed to ``deferred.notify``.\n * @param {Any*} promise for something\n * @param {Function} callback to receive any progress notifications\n * @returns the given promise, unchanged\n */\nQ.progress = progress;\nfunction progress(object, progressed) {\n return Q(object).then(void 0, void 0, progressed);\n}\n\nPromise.prototype.progress = function (progressed) {\n return this.then(void 0, void 0, progressed);\n};\n\n/**\n * Provides an opportunity to observe the settling of a promise,\n * regardless of whether the promise is fulfilled or rejected. Forwards\n * the resolution to the returned promise when the callback is done.\n * The callback can return a promise to defer completion.\n * @param {Any*} promise\n * @param {Function} callback to observe the resolution of the given\n * promise, takes no arguments.\n * @returns a promise for the resolution of the given promise when\n * ``fin`` is done.\n */\nQ.fin = // XXX legacy\nQ[\"finally\"] = function (object, callback) {\n return Q(object)[\"finally\"](callback);\n};\n\nPromise.prototype.fin = // XXX legacy\nPromise.prototype[\"finally\"] = function (callback) {\n callback = Q(callback);\n return this.then(function (value) {\n return callback.fcall().then(function () {\n return value;\n });\n }, function (reason) {\n // TODO attempt to recycle the rejection with \"this\".\n return callback.fcall().then(function () {\n throw reason;\n });\n });\n};\n\n/**\n * Terminates a chain of promises, forcing rejections to be\n * thrown as exceptions.\n * @param {Any*} promise at the end of a chain of promises\n * @returns nothing\n */\nQ.done = function (object, fulfilled, rejected, progress) {\n return Q(object).done(fulfilled, rejected, progress);\n};\n\nPromise.prototype.done = function (fulfilled, rejected, progress) {\n var onUnhandledError = function (error) {\n // forward to a future turn so that ``when``\n // does not catch it and turn it into a rejection.\n Q.nextTick(function () {\n makeStackTraceLong(error, promise);\n if (Q.onerror) {\n Q.onerror(error);\n } else {\n throw error;\n }\n });\n };\n\n // Avoid unnecessary `nextTick`ing via an unnecessary `when`.\n var promise = fulfilled || rejected || progress ?\n this.then(fulfilled, rejected, progress) :\n this;\n\n if (typeof process === \"object\" && process && process.domain) {\n onUnhandledError = process.domain.bind(onUnhandledError);\n }\n\n promise.then(void 0, onUnhandledError);\n};\n\n/**\n * Causes a promise to be rejected if it does not get fulfilled before\n * some milliseconds time out.\n * @param {Any*} promise\n * @param {Number} milliseconds timeout\n * @param {Any*} custom error message or Error object (optional)\n * @returns a promise for the resolution of the given promise if it is\n * fulfilled before the timeout, otherwise rejected.\n */\nQ.timeout = function (object, ms, error) {\n return Q(object).timeout(ms, error);\n};\n\nPromise.prototype.timeout = function (ms, error) {\n var deferred = defer();\n var timeoutId = setTimeout(function () {\n if (!error || \"string\" === typeof error) {\n error = new Error(error || \"Timed out after \" + ms + \" ms\");\n error.code = \"ETIMEDOUT\";\n }\n deferred.reject(error);\n }, ms);\n\n this.then(function (value) {\n clearTimeout(timeoutId);\n deferred.resolve(value);\n }, function (exception) {\n clearTimeout(timeoutId);\n deferred.reject(exception);\n }, deferred.notify);\n\n return deferred.promise;\n};\n\n/**\n * Returns a promise for the given value (or promised value), some\n * milliseconds after it resolved. Passes rejections immediately.\n * @param {Any*} promise\n * @param {Number} milliseconds\n * @returns a promise for the resolution of the given promise after milliseconds\n * time has elapsed since the resolution of the given promise.\n * If the given promise rejects, that is passed immediately.\n */\nQ.delay = function (object, timeout) {\n if (timeout === void 0) {\n timeout = object;\n object = void 0;\n }\n return Q(object).delay(timeout);\n};\n\nPromise.prototype.delay = function (timeout) {\n return this.then(function (value) {\n var deferred = defer();\n setTimeout(function () {\n deferred.resolve(value);\n }, timeout);\n return deferred.promise;\n });\n};\n\n/**\n * Passes a continuation to a Node function, which is called with the given\n * arguments provided as an array, and returns a promise.\n *\n * Q.nfapply(FS.readFile, [__filename])\n * .then(function (content) {\n * })\n *\n */\nQ.nfapply = function (callback, args) {\n return Q(callback).nfapply(args);\n};\n\nPromise.prototype.nfapply = function (args) {\n var deferred = defer();\n var nodeArgs = array_slice(args);\n nodeArgs.push(deferred.makeNodeResolver());\n this.fapply(nodeArgs).fail(deferred.reject);\n return deferred.promise;\n};\n\n/**\n * Passes a continuation to a Node function, which is called with the given\n * arguments provided individually, and returns a promise.\n * @example\n * Q.nfcall(FS.readFile, __filename)\n * .then(function (content) {\n * })\n *\n */\nQ.nfcall = function (callback /*...args*/) {\n var args = array_slice(arguments, 1);\n return Q(callback).nfapply(args);\n};\n\nPromise.prototype.nfcall = function (/*...args*/) {\n var nodeArgs = array_slice(arguments);\n var deferred = defer();\n nodeArgs.push(deferred.makeNodeResolver());\n this.fapply(nodeArgs).fail(deferred.reject);\n return deferred.promise;\n};\n\n/**\n * Wraps a NodeJS continuation passing function and returns an equivalent\n * version that returns a promise.\n * @example\n * Q.nfbind(FS.readFile, __filename)(\"utf-8\")\n * .then(console.log)\n * .done()\n */\nQ.nfbind =\nQ.denodeify = function (callback /*...args*/) {\n var baseArgs = array_slice(arguments, 1);\n return function () {\n var nodeArgs = baseArgs.concat(array_slice(arguments));\n var deferred = defer();\n nodeArgs.push(deferred.makeNodeResolver());\n Q(callback).fapply(nodeArgs).fail(deferred.reject);\n return deferred.promise;\n };\n};\n\nPromise.prototype.nfbind =\nPromise.prototype.denodeify = function (/*...args*/) {\n var args = array_slice(arguments);\n args.unshift(this);\n return Q.denodeify.apply(void 0, args);\n};\n\nQ.nbind = function (callback, thisp /*...args*/) {\n var baseArgs = array_slice(arguments, 2);\n return function () {\n var nodeArgs = baseArgs.concat(array_slice(arguments));\n var deferred = defer();\n nodeArgs.push(deferred.makeNodeResolver());\n function bound() {\n return callback.apply(thisp, arguments);\n }\n Q(bound).fapply(nodeArgs).fail(deferred.reject);\n return deferred.promise;\n };\n};\n\nPromise.prototype.nbind = function (/*thisp, ...args*/) {\n var args = array_slice(arguments, 0);\n args.unshift(this);\n return Q.nbind.apply(void 0, args);\n};\n\n/**\n * Calls a method of a Node-style object that accepts a Node-style\n * callback with a given array of arguments, plus a provided callback.\n * @param object an object that has the named method\n * @param {String} name name of the method of object\n * @param {Array} args arguments to pass to the method; the callback\n * will be provided by Q and appended to these arguments.\n * @returns a promise for the value or error\n */\nQ.nmapply = // XXX As proposed by \"Redsandro\"\nQ.npost = function (object, name, args) {\n return Q(object).npost(name, args);\n};\n\nPromise.prototype.nmapply = // XXX As proposed by \"Redsandro\"\nPromise.prototype.npost = function (name, args) {\n var nodeArgs = array_slice(args || []);\n var deferred = defer();\n nodeArgs.push(deferred.makeNodeResolver());\n this.dispatch(\"post\", [name, nodeArgs]).fail(deferred.reject);\n return deferred.promise;\n};\n\n/**\n * Calls a method of a Node-style object that accepts a Node-style\n * callback, forwarding the given variadic arguments, plus a provided\n * callback argument.\n * @param object an object that has the named method\n * @param {String} name name of the method of object\n * @param ...args arguments to pass to the method; the callback will\n * be provided by Q and appended to these arguments.\n * @returns a promise for the value or error\n */\nQ.nsend = // XXX Based on Mark Miller's proposed \"send\"\nQ.nmcall = // XXX Based on \"Redsandro's\" proposal\nQ.ninvoke = function (object, name /*...args*/) {\n var nodeArgs = array_slice(arguments, 2);\n var deferred = defer();\n nodeArgs.push(deferred.makeNodeResolver());\n Q(object).dispatch(\"post\", [name, nodeArgs]).fail(deferred.reject);\n return deferred.promise;\n};\n\nPromise.prototype.nsend = // XXX Based on Mark Miller's proposed \"send\"\nPromise.prototype.nmcall = // XXX Based on \"Redsandro's\" proposal\nPromise.prototype.ninvoke = function (name /*...args*/) {\n var nodeArgs = array_slice(arguments, 1);\n var deferred = defer();\n nodeArgs.push(deferred.makeNodeResolver());\n this.dispatch(\"post\", [name, nodeArgs]).fail(deferred.reject);\n return deferred.promise;\n};\n\n/**\n * If a function would like to support both Node continuation-passing-style and\n * promise-returning-style, it can end its internal promise chain with\n * `nodeify(nodeback)`, forwarding the optional nodeback argument. If the user\n * elects to use a nodeback, the result will be sent there. If they do not\n * pass a nodeback, they will receive the result promise.\n * @param object a result (or a promise for a result)\n * @param {Function} nodeback a Node.js-style callback\n * @returns either the promise or nothing\n */\nQ.nodeify = nodeify;\nfunction nodeify(object, nodeback) {\n return Q(object).nodeify(nodeback);\n}\n\nPromise.prototype.nodeify = function (nodeback) {\n if (nodeback) {\n this.then(function (value) {\n Q.nextTick(function () {\n nodeback(null, value);\n });\n }, function (error) {\n Q.nextTick(function () {\n nodeback(error);\n });\n });\n } else {\n return this;\n }\n};\n\nQ.noConflict = function() {\n throw new Error(\"Q.noConflict only works when Q is used as a global\");\n};\n\n// All code before this point will be filtered from stack traces.\nvar qEndingLine = captureLine();\n\nreturn Q;\n\n});\n","\"use strict\";function q(a){throw a;}var t=void 0,u=!1;var sjcl={cipher:{},hash:{},keyexchange:{},mode:{},misc:{},codec:{},exception:{corrupt:function(a){this.toString=function(){return\"CORRUPT: \"+this.message};this.message=a},invalid:function(a){this.toString=function(){return\"INVALID: \"+this.message};this.message=a},bug:function(a){this.toString=function(){return\"BUG: \"+this.message};this.message=a},notReady:function(a){this.toString=function(){return\"NOT READY: \"+this.message};this.message=a}}};\n\"undefined\"!=typeof module&&module.exports&&(module.exports=sjcl);\nsjcl.cipher.aes=function(a){this.j[0][0][0]||this.D();var b,c,d,e,f=this.j[0][4],g=this.j[1];b=a.length;var h=1;4!==b&&(6!==b&&8!==b)&&q(new sjcl.exception.invalid(\"invalid aes key size\"));this.a=[d=a.slice(0),e=[]];for(a=b;a<4*b+28;a++){c=d[a-1];if(0===a%b||8===b&&4===a%b)c=f[c>>>24]<<24^f[c>>16&255]<<16^f[c>>8&255]<<8^f[c&255],0===a%b&&(c=c<<8^c>>>24^h<<24,h=h<<1^283*(h>>7));d[a]=d[a-b]^c}for(b=0;a;b++,a--)c=d[b&3?a:a-4],e[b]=4>=a||4>b?c:g[0][f[c>>>24]]^g[1][f[c>>16&255]]^g[2][f[c>>8&255]]^g[3][f[c&\n255]]};\nsjcl.cipher.aes.prototype={encrypt:function(a){return y(this,a,0)},decrypt:function(a){return y(this,a,1)},j:[[[],[],[],[],[]],[[],[],[],[],[]]],D:function(){var a=this.j[0],b=this.j[1],c=a[4],d=b[4],e,f,g,h=[],l=[],k,n,m,p;for(e=0;0x100>e;e++)l[(h[e]=e<<1^283*(e>>7))^e]=e;for(f=g=0;!c[f];f^=k||1,g=l[g]||1){m=g^g<<1^g<<2^g<<3^g<<4;m=m>>8^m&255^99;c[f]=m;d[m]=f;n=h[e=h[k=h[f]]];p=0x1010101*n^0x10001*e^0x101*k^0x1010100*f;n=0x101*h[m]^0x1010100*m;for(e=0;4>e;e++)a[e][f]=n=n<<24^n>>>8,b[e][m]=p=p<<24^p>>>8}for(e=\n 0;5>e;e++)a[e]=a[e].slice(0),b[e]=b[e].slice(0)}};\nfunction y(a,b,c){4!==b.length&&q(new sjcl.exception.invalid(\"invalid aes block size\"));var d=a.a[c],e=b[0]^d[0],f=b[c?3:1]^d[1],g=b[2]^d[2];b=b[c?1:3]^d[3];var h,l,k,n=d.length/4-2,m,p=4,s=[0,0,0,0];h=a.j[c];a=h[0];var r=h[1],v=h[2],w=h[3],x=h[4];for(m=0;m<n;m++)h=a[e>>>24]^r[f>>16&255]^v[g>>8&255]^w[b&255]^d[p],l=a[f>>>24]^r[g>>16&255]^v[b>>8&255]^w[e&255]^d[p+1],k=a[g>>>24]^r[b>>16&255]^v[e>>8&255]^w[f&255]^d[p+2],b=a[b>>>24]^r[e>>16&255]^v[f>>8&255]^w[g&255]^d[p+3],p+=4,e=h,f=l,g=k;for(m=0;4>\nm;m++)s[c?3&-m:m]=x[e>>>24]<<24^x[f>>16&255]<<16^x[g>>8&255]<<8^x[b&255]^d[p++],h=e,e=f,f=g,g=b,b=h;return s}\nsjcl.bitArray={bitSlice:function(a,b,c){a=sjcl.bitArray.O(a.slice(b/32),32-(b&31)).slice(1);return c===t?a:sjcl.bitArray.clamp(a,c-b)},extract:function(a,b,c){var d=Math.floor(-b-c&31);return((b+c-1^b)&-32?a[b/32|0]<<32-d^a[b/32+1|0]>>>d:a[b/32|0]>>>d)&(1<<c)-1},concat:function(a,b){if(0===a.length||0===b.length)return a.concat(b);var c=a[a.length-1],d=sjcl.bitArray.getPartial(c);return 32===d?a.concat(b):sjcl.bitArray.O(b,d,c|0,a.slice(0,a.length-1))},bitLength:function(a){var b=a.length;return 0===\nb?0:32*(b-1)+sjcl.bitArray.getPartial(a[b-1])},clamp:function(a,b){if(32*a.length<b)return a;a=a.slice(0,Math.ceil(b/32));var c=a.length;b&=31;0<c&&b&&(a[c-1]=sjcl.bitArray.partial(b,a[c-1]&2147483648>>b-1,1));return a},partial:function(a,b,c){return 32===a?b:(c?b|0:b<<32-a)+0x10000000000*a},getPartial:function(a){return Math.round(a/0x10000000000)||32},equal:function(a,b){if(sjcl.bitArray.bitLength(a)!==sjcl.bitArray.bitLength(b))return u;var c=0,d;for(d=0;d<a.length;d++)c|=a[d]^b[d];return 0===\n c},O:function(a,b,c,d){var e;e=0;for(d===t&&(d=[]);32<=b;b-=32)d.push(c),c=0;if(0===b)return d.concat(a);for(e=0;e<a.length;e++)d.push(c|a[e]>>>b),c=a[e]<<32-b;e=a.length?a[a.length-1]:0;a=sjcl.bitArray.getPartial(e);d.push(sjcl.bitArray.partial(b+a&31,32<b+a?c:d.pop(),1));return d},k:function(a,b){return[a[0]^b[0],a[1]^b[1],a[2]^b[2],a[3]^b[3]]}};\nsjcl.codec.utf8String={fromBits:function(a){var b=\"\",c=sjcl.bitArray.bitLength(a),d,e;for(d=0;d<c/8;d++)0===(d&3)&&(e=a[d/4]),b+=String.fromCharCode(e>>>24),e<<=8;return decodeURIComponent(escape(b))},toBits:function(a){a=unescape(encodeURIComponent(a));var b=[],c,d=0;for(c=0;c<a.length;c++)d=d<<8|a.charCodeAt(c),3===(c&3)&&(b.push(d),d=0);c&3&&b.push(sjcl.bitArray.partial(8*(c&3),d));return b}};\nsjcl.codec.hex={fromBits:function(a){var b=\"\",c;for(c=0;c<a.length;c++)b+=((a[c]|0)+0xf00000000000).toString(16).substr(4);return b.substr(0,sjcl.bitArray.bitLength(a)/4)},toBits:function(a){var b,c=[],d;a=a.replace(/\\s|0x/g,\"\");d=a.length;a+=\"00000000\";for(b=0;b<a.length;b+=8)c.push(parseInt(a.substr(b,8),16)^0);return sjcl.bitArray.clamp(c,4*d)}};\nsjcl.codec.base64={I:\"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\",fromBits:function(a,b,c){var d=\"\",e=0,f=sjcl.codec.base64.I,g=0,h=sjcl.bitArray.bitLength(a);c&&(f=f.substr(0,62)+\"-_\");for(c=0;6*d.length<h;)d+=f.charAt((g^a[c]>>>e)>>>26),6>e?(g=a[c]<<6-e,e+=26,c++):(g<<=6,e-=6);for(;d.length&3&&!b;)d+=\"=\";return d},toBits:function(a,b){a=a.replace(/\\s|=/g,\"\");var c=[],d,e=0,f=sjcl.codec.base64.I,g=0,h;b&&(f=f.substr(0,62)+\"-_\");for(d=0;d<a.length;d++)h=f.indexOf(a.charAt(d)),\n0>h&&q(new sjcl.exception.invalid(\"this isn't base64!\")),26<e?(e-=26,c.push(g^h>>>e),g=h<<32-e):(e+=6,g^=h<<32-e);e&56&&c.push(sjcl.bitArray.partial(e&56,g,1));return c}};sjcl.codec.base64url={fromBits:function(a){return sjcl.codec.base64.fromBits(a,1,1)},toBits:function(a){return sjcl.codec.base64.toBits(a,1)}};sjcl.hash.sha256=function(a){this.a[0]||this.D();a?(this.q=a.q.slice(0),this.m=a.m.slice(0),this.g=a.g):this.reset()};sjcl.hash.sha256.hash=function(a){return(new sjcl.hash.sha256).update(a).finalize()};\nsjcl.hash.sha256.prototype={blockSize:512,reset:function(){this.q=this.M.slice(0);this.m=[];this.g=0;return this},update:function(a){\"string\"===typeof a&&(a=sjcl.codec.utf8String.toBits(a));var b,c=this.m=sjcl.bitArray.concat(this.m,a);b=this.g;a=this.g=b+sjcl.bitArray.bitLength(a);for(b=512+b&-512;b<=a;b+=512)z(this,c.splice(0,16));return this},finalize:function(){var a,b=this.m,c=this.q,b=sjcl.bitArray.concat(b,[sjcl.bitArray.partial(1,1)]);for(a=b.length+2;a&15;a++)b.push(0);b.push(Math.floor(this.g/\n 4294967296));for(b.push(this.g|0);b.length;)z(this,b.splice(0,16));this.reset();return c},M:[],a:[],D:function(){function a(a){return 0x100000000*(a-Math.floor(a))|0}var b=0,c=2,d;a:for(;64>b;c++){for(d=2;d*d<=c;d++)if(0===c%d)continue a;8>b&&(this.M[b]=a(Math.pow(c,0.5)));this.a[b]=a(Math.pow(c,1/3));b++}}};\nfunction z(a,b){var c,d,e,f=b.slice(0),g=a.q,h=a.a,l=g[0],k=g[1],n=g[2],m=g[3],p=g[4],s=g[5],r=g[6],v=g[7];for(c=0;64>c;c++)16>c?d=f[c]:(d=f[c+1&15],e=f[c+14&15],d=f[c&15]=(d>>>7^d>>>18^d>>>3^d<<25^d<<14)+(e>>>17^e>>>19^e>>>10^e<<15^e<<13)+f[c&15]+f[c+9&15]|0),d=d+v+(p>>>6^p>>>11^p>>>25^p<<26^p<<21^p<<7)+(r^p&(s^r))+h[c],v=r,r=s,s=p,p=m+d|0,m=n,n=k,k=l,l=d+(k&n^m&(k^n))+(k>>>2^k>>>13^k>>>22^k<<30^k<<19^k<<10)|0;g[0]=g[0]+l|0;g[1]=g[1]+k|0;g[2]=g[2]+n|0;g[3]=g[3]+m|0;g[4]=g[4]+p|0;g[5]=g[5]+s|0;g[6]=\n g[6]+r|0;g[7]=g[7]+v|0}\nsjcl.mode.ccm={name:\"ccm\",encrypt:function(a,b,c,d,e){var f,g=b.slice(0),h=sjcl.bitArray,l=h.bitLength(c)/8,k=h.bitLength(g)/8;e=e||64;d=d||[];7>l&&q(new sjcl.exception.invalid(\"ccm: iv must be at least 7 bytes\"));for(f=2;4>f&&k>>>8*f;f++);f<15-l&&(f=15-l);c=h.clamp(c,8*(15-f));b=sjcl.mode.ccm.K(a,b,c,d,e,f);g=sjcl.mode.ccm.n(a,g,c,b,e,f);return h.concat(g.data,g.tag)},decrypt:function(a,b,c,d,e){e=e||64;d=d||[];var f=sjcl.bitArray,g=f.bitLength(c)/8,h=f.bitLength(b),l=f.clamp(b,h-e),k=f.bitSlice(b,\n h-e),h=(h-e)/8;7>g&&q(new sjcl.exception.invalid(\"ccm: iv must be at least 7 bytes\"));for(b=2;4>b&&h>>>8*b;b++);b<15-g&&(b=15-g);c=f.clamp(c,8*(15-b));l=sjcl.mode.ccm.n(a,l,c,k,e,b);a=sjcl.mode.ccm.K(a,l.data,c,d,e,b);f.equal(l.tag,a)||q(new sjcl.exception.corrupt(\"ccm: tag doesn't match\"));return l.data},K:function(a,b,c,d,e,f){var g=[],h=sjcl.bitArray,l=h.k;e/=8;(e%2||4>e||16<e)&&q(new sjcl.exception.invalid(\"ccm: invalid tag length\"));(0xffffffff<d.length||0xffffffff<b.length)&&q(new sjcl.exception.bug(\"ccm: can't deal with 4GiB or more data\"));\n f=[h.partial(8,(d.length?64:0)|e-2<<2|f-1)];f=h.concat(f,c);f[3]|=h.bitLength(b)/8;f=a.encrypt(f);if(d.length){c=h.bitLength(d)/8;65279>=c?g=[h.partial(16,c)]:0xffffffff>=c&&(g=h.concat([h.partial(16,65534)],[c]));g=h.concat(g,d);for(d=0;d<g.length;d+=4)f=a.encrypt(l(f,g.slice(d,d+4).concat([0,0,0])))}for(d=0;d<b.length;d+=4)f=a.encrypt(l(f,b.slice(d,d+4).concat([0,0,0])));return h.clamp(f,8*e)},n:function(a,b,c,d,e,f){var g,h=sjcl.bitArray;g=h.k;var l=b.length,k=h.bitLength(b);c=h.concat([h.partial(8,\n f-1)],c).concat([0,0,0]).slice(0,4);d=h.bitSlice(g(d,a.encrypt(c)),0,e);if(!l)return{tag:d,data:[]};for(g=0;g<l;g+=4)c[3]++,e=a.encrypt(c),b[g]^=e[0],b[g+1]^=e[1],b[g+2]^=e[2],b[g+3]^=e[3];return{tag:d,data:h.clamp(b,k)}}};\nsjcl.mode.ocb2={name:\"ocb2\",encrypt:function(a,b,c,d,e,f){128!==sjcl.bitArray.bitLength(c)&&q(new sjcl.exception.invalid(\"ocb iv must be 128 bits\"));var g,h=sjcl.mode.ocb2.G,l=sjcl.bitArray,k=l.k,n=[0,0,0,0];c=h(a.encrypt(c));var m,p=[];d=d||[];e=e||64;for(g=0;g+4<b.length;g+=4)m=b.slice(g,g+4),n=k(n,m),p=p.concat(k(c,a.encrypt(k(c,m)))),c=h(c);m=b.slice(g);b=l.bitLength(m);g=a.encrypt(k(c,[0,0,0,b]));m=l.clamp(k(m.concat([0,0,0]),g),b);n=k(n,k(m.concat([0,0,0]),g));n=a.encrypt(k(n,k(c,h(c))));d.length&&\n(n=k(n,f?d:sjcl.mode.ocb2.pmac(a,d)));return p.concat(l.concat(m,l.clamp(n,e)))},decrypt:function(a,b,c,d,e,f){128!==sjcl.bitArray.bitLength(c)&&q(new sjcl.exception.invalid(\"ocb iv must be 128 bits\"));e=e||64;var g=sjcl.mode.ocb2.G,h=sjcl.bitArray,l=h.k,k=[0,0,0,0],n=g(a.encrypt(c)),m,p,s=sjcl.bitArray.bitLength(b)-e,r=[];d=d||[];for(c=0;c+4<s/32;c+=4)m=l(n,a.decrypt(l(n,b.slice(c,c+4)))),k=l(k,m),r=r.concat(m),n=g(n);p=s-32*c;m=a.encrypt(l(n,[0,0,0,p]));m=l(m,h.clamp(b.slice(c),p).concat([0,0,0]));\n k=l(k,m);k=a.encrypt(l(k,l(n,g(n))));d.length&&(k=l(k,f?d:sjcl.mode.ocb2.pmac(a,d)));h.equal(h.clamp(k,e),h.bitSlice(b,s))||q(new sjcl.exception.corrupt(\"ocb: tag doesn't match\"));return r.concat(h.clamp(m,p))},pmac:function(a,b){var c,d=sjcl.mode.ocb2.G,e=sjcl.bitArray,f=e.k,g=[0,0,0,0],h=a.encrypt([0,0,0,0]),h=f(h,d(d(h)));for(c=0;c+4<b.length;c+=4)h=d(h),g=f(g,a.encrypt(f(h,b.slice(c,c+4))));c=b.slice(c);128>e.bitLength(c)&&(h=f(h,d(h)),c=e.concat(c,[-2147483648,0,0,0]));g=f(g,c);return a.encrypt(f(d(f(h,\n d(h))),g))},G:function(a){return[a[0]<<1^a[1]>>>31,a[1]<<1^a[2]>>>31,a[2]<<1^a[3]>>>31,a[3]<<1^135*(a[0]>>>31)]}};\nsjcl.mode.gcm={name:\"gcm\",encrypt:function(a,b,c,d,e){var f=b.slice(0);b=sjcl.bitArray;d=d||[];a=sjcl.mode.gcm.n(!0,a,f,d,c,e||128);return b.concat(a.data,a.tag)},decrypt:function(a,b,c,d,e){var f=b.slice(0),g=sjcl.bitArray,h=g.bitLength(f);e=e||128;d=d||[];e<=h?(b=g.bitSlice(f,h-e),f=g.bitSlice(f,0,h-e)):(b=f,f=[]);a=sjcl.mode.gcm.n(u,a,f,d,c,e);g.equal(a.tag,b)||q(new sjcl.exception.corrupt(\"gcm: tag doesn't match\"));return a.data},U:function(a,b){var c,d,e,f,g,h=sjcl.bitArray.k;e=[0,0,0,0];f=b.slice(0);\n for(c=0;128>c;c++){(d=0!==(a[Math.floor(c/32)]&1<<31-c%32))&&(e=h(e,f));g=0!==(f[3]&1);for(d=3;0<d;d--)f[d]=f[d]>>>1|(f[d-1]&1)<<31;f[0]>>>=1;g&&(f[0]^=-0x1f000000)}return e},f:function(a,b,c){var d,e=c.length;b=b.slice(0);for(d=0;d<e;d+=4)b[0]^=0xffffffff&c[d],b[1]^=0xffffffff&c[d+1],b[2]^=0xffffffff&c[d+2],b[3]^=0xffffffff&c[d+3],b=sjcl.mode.gcm.U(b,a);return b},n:function(a,b,c,d,e,f){var g,h,l,k,n,m,p,s,r=sjcl.bitArray;m=c.length;p=r.bitLength(c);s=r.bitLength(d);h=r.bitLength(e);g=b.encrypt([0,\n 0,0,0]);96===h?(e=e.slice(0),e=r.concat(e,[1])):(e=sjcl.mode.gcm.f(g,[0,0,0,0],e),e=sjcl.mode.gcm.f(g,e,[0,0,Math.floor(h/0x100000000),h&0xffffffff]));h=sjcl.mode.gcm.f(g,[0,0,0,0],d);n=e.slice(0);d=h.slice(0);a||(d=sjcl.mode.gcm.f(g,h,c));for(k=0;k<m;k+=4)n[3]++,l=b.encrypt(n),c[k]^=l[0],c[k+1]^=l[1],c[k+2]^=l[2],c[k+3]^=l[3];c=r.clamp(c,p);a&&(d=sjcl.mode.gcm.f(g,h,c));a=[Math.floor(s/0x100000000),s&0xffffffff,Math.floor(p/0x100000000),p&0xffffffff];d=sjcl.mode.gcm.f(g,d,a);l=b.encrypt(e);d[0]^=l[0];\n d[1]^=l[1];d[2]^=l[2];d[3]^=l[3];return{tag:r.bitSlice(d,0,f),data:c}}};sjcl.misc.hmac=function(a,b){this.L=b=b||sjcl.hash.sha256;var c=[[],[]],d,e=b.prototype.blockSize/32;this.o=[new b,new b];a.length>e&&(a=b.hash(a));for(d=0;d<e;d++)c[0][d]=a[d]^909522486,c[1][d]=a[d]^1549556828;this.o[0].update(c[0]);this.o[1].update(c[1])};sjcl.misc.hmac.prototype.encrypt=sjcl.misc.hmac.prototype.mac=function(a){a=(new this.L(this.o[0])).update(a).finalize();return(new this.L(this.o[1])).update(a).finalize()};\nsjcl.misc.pbkdf2=function(a,b,c,d,e){c=c||1E3;(0>d||0>c)&&q(sjcl.exception.invalid(\"invalid params to pbkdf2\"));\"string\"===typeof a&&(a=sjcl.codec.utf8String.toBits(a));e=e||sjcl.misc.hmac;a=new e(a);var f,g,h,l,k=[],n=sjcl.bitArray;for(l=1;32*k.length<(d||1);l++){e=f=a.encrypt(n.concat(b,[l]));for(g=1;g<c;g++){f=a.encrypt(f);for(h=0;h<f.length;h++)e[h]^=f[h]}k=k.concat(e)}d&&(k=n.clamp(k,d));return k};\nsjcl.prng=function(a){this.b=[new sjcl.hash.sha256];this.h=[0];this.F=0;this.t={};this.C=0;this.J={};this.N=this.c=this.i=this.T=0;this.a=[0,0,0,0,0,0,0,0];this.e=[0,0,0,0];this.A=t;this.B=a;this.p=u;this.z={progress:{},seeded:{}};this.l=this.S=0;this.u=1;this.w=2;this.Q=0x10000;this.H=[0,48,64,96,128,192,0x100,384,512,768,1024];this.R=3E4;this.P=80};\nsjcl.prng.prototype={randomWords:function(a,b){var c=[],d;d=this.isReady(b);var e;d===this.l&&q(new sjcl.exception.notReady(\"generator isn't seeded\"));if(d&this.w){d=!(d&this.u);e=[];var f=0,g;this.N=e[0]=(new Date).valueOf()+this.R;for(g=0;16>g;g++)e.push(0x100000000*Math.random()|0);for(g=0;g<this.b.length&&!(e=e.concat(this.b[g].finalize()),f+=this.h[g],this.h[g]=0,!d&&this.F&1<<g);g++);this.F>=1<<this.b.length&&(this.b.push(new sjcl.hash.sha256),this.h.push(0));this.c-=f;f>this.i&&(this.i=f);this.F++;\n this.a=sjcl.hash.sha256.hash(this.a.concat(e));this.A=new sjcl.cipher.aes(this.a);for(d=0;4>d&&!(this.e[d]=this.e[d]+1|0,this.e[d]);d++);}for(d=0;d<a;d+=4)0===(d+1)%this.Q&&A(this),e=B(this),c.push(e[0],e[1],e[2],e[3]);A(this);return c.slice(0,a)},setDefaultParanoia:function(a){this.B=a},addEntropy:function(a,b,c){c=c||\"user\";var d,e,f=(new Date).valueOf(),g=this.t[c],h=this.isReady(),l=0;d=this.J[c];d===t&&(d=this.J[c]=this.T++);g===t&&(g=this.t[c]=0);this.t[c]=(this.t[c]+1)%this.b.length;switch(typeof a){case \"number\":b===\nt&&(b=1);this.b[g].update([d,this.C++,1,b,f,1,a|0]);break;case \"object\":c=Object.prototype.toString.call(a);if(\"[object Uint32Array]\"===c){e=[];for(c=0;c<a.length;c++)e.push(a[c]);a=e}else{\"[object Array]\"!==c&&(l=1);for(c=0;c<a.length&&!l;c++)\"number\"!=typeof a[c]&&(l=1)}if(!l){if(b===t)for(c=b=0;c<a.length;c++)for(e=a[c];0<e;)b++,e>>>=1;this.b[g].update([d,this.C++,2,b,f,a.length].concat(a))}break;case \"string\":b===t&&(b=a.length);this.b[g].update([d,this.C++,3,b,f,a.length]);this.b[g].update(a);\n break;default:l=1}l&&q(new sjcl.exception.bug(\"random: addEntropy only supports number, array of numbers or string\"));this.h[g]+=b;this.c+=b;h===this.l&&(this.isReady()!==this.l&&C(\"seeded\",Math.max(this.i,this.c)),C(\"progress\",this.getProgress()))},isReady:function(a){a=this.H[a!==t?a:this.B];return this.i&&this.i>=a?this.h[0]>this.P&&(new Date).valueOf()>this.N?this.w|this.u:this.u:this.c>=a?this.w|this.l:this.l},getProgress:function(a){a=this.H[a?a:this.B];return this.i>=a?1:this.c>a?1:this.c/\na},startCollectors:function(){this.p||(window.addEventListener?(window.addEventListener(\"load\",this.r,u),window.addEventListener(\"mousemove\",this.s,u)):document.attachEvent?(document.attachEvent(\"onload\",this.r),document.attachEvent(\"onmousemove\",this.s)):q(new sjcl.exception.bug(\"can't attach event\")),this.p=!0)},stopCollectors:function(){this.p&&(window.removeEventListener?(window.removeEventListener(\"load\",this.r,u),window.removeEventListener(\"mousemove\",this.s,u)):window.detachEvent&&(window.detachEvent(\"onload\",\n this.r),window.detachEvent(\"onmousemove\",this.s)),this.p=u)},addEventListener:function(a,b){this.z[a][this.S++]=b},removeEventListener:function(a,b){var c,d,e=this.z[a],f=[];for(d in e)e.hasOwnProperty(d)&&e[d]===b&&f.push(d);for(c=0;c<f.length;c++)d=f[c],delete e[d]},s:function(a){sjcl.random.addEntropy([a.x||a.clientX||a.offsetX||0,a.y||a.clientY||a.offsetY||0],2,\"mouse\")},r:function(){sjcl.random.addEntropy((new Date).valueOf(),2,\"loadtime\")}};\nfunction C(a,b){var c,d=sjcl.random.z[a],e=[];for(c in d)d.hasOwnProperty(c)&&e.push(d[c]);for(c=0;c<e.length;c++)e[c](b)}function A(a){a.a=B(a).concat(B(a));a.A=new sjcl.cipher.aes(a.a)}function B(a){for(var b=0;4>b&&!(a.e[b]=a.e[b]+1|0,a.e[b]);b++);return a.A.encrypt(a.e)}sjcl.random=new sjcl.prng(6);try{var D=new Uint32Array(32);crypto.getRandomValues(D);sjcl.random.addEntropy(D,1024,\"crypto['getRandomValues']\")}catch(E){}\nsjcl.json={defaults:{v:1,iter:1E3,ks:128,ts:64,mode:\"ccm\",adata:\"\",cipher:\"aes\"},encrypt:function(a,b,c,d){c=c||{};d=d||{};var e=sjcl.json,f=e.d({iv:sjcl.random.randomWords(4,0)},e.defaults),g;e.d(f,c);c=f.adata;\"string\"===typeof f.salt&&(f.salt=sjcl.codec.base64.toBits(f.salt));\"string\"===typeof f.iv&&(f.iv=sjcl.codec.base64.toBits(f.iv));(!sjcl.mode[f.mode]||!sjcl.cipher[f.cipher]||\"string\"===typeof a&&100>=f.iter||64!==f.ts&&96!==f.ts&&128!==f.ts||128!==f.ks&&192!==f.ks&&0x100!==f.ks||2>f.iv.length||\n4<f.iv.length)&&q(new sjcl.exception.invalid(\"json encrypt: invalid parameters\"));\"string\"===typeof a&&(g=sjcl.misc.cachedPbkdf2(a,f),a=g.key.slice(0,f.ks/32),f.salt=g.salt);\"string\"===typeof b&&(b=sjcl.codec.utf8String.toBits(b));\"string\"===typeof c&&(c=sjcl.codec.utf8String.toBits(c));g=new sjcl.cipher[f.cipher](a);e.d(d,f);d.key=a;f.ct=sjcl.mode[f.mode].encrypt(g,b,f.iv,c,f.ts);return e.encode(f)},decrypt:function(a,b,c,d){c=c||{};d=d||{};var e=sjcl.json;b=e.d(e.d(e.d({},e.defaults),e.decode(b)),\n c,!0);var f;c=b.adata;\"string\"===typeof b.salt&&(b.salt=sjcl.codec.base64.toBits(b.salt));\"string\"===typeof b.iv&&(b.iv=sjcl.codec.base64.toBits(b.iv));(!sjcl.mode[b.mode]||!sjcl.cipher[b.cipher]||\"string\"===typeof a&&100>=b.iter||64!==b.ts&&96!==b.ts&&128!==b.ts||128!==b.ks&&192!==b.ks&&0x100!==b.ks||!b.iv||2>b.iv.length||4<b.iv.length)&&q(new sjcl.exception.invalid(\"json decrypt: invalid parameters\"));\"string\"===typeof a&&(f=sjcl.misc.cachedPbkdf2(a,b),a=f.key.slice(0,b.ks/32),b.salt=f.salt);\"string\"===\ntypeof c&&(c=sjcl.codec.utf8String.toBits(c));f=new sjcl.cipher[b.cipher](a);c=sjcl.mode[b.mode].decrypt(f,b.ct,b.iv,c,b.ts);e.d(d,b);d.key=a;return sjcl.codec.utf8String.fromBits(c)},encode:function(a){var b,c=\"{\",d=\"\";for(b in a)if(a.hasOwnProperty(b))switch(b.match(/^[a-z0-9]+$/i)||q(new sjcl.exception.invalid(\"json encode: invalid property name\")),c+=d+'\"'+b+'\":',d=\",\",typeof a[b]){case \"number\":case \"boolean\":c+=a[b];break;case \"string\":c+='\"'+escape(a[b])+'\"';break;case \"object\":c+='\"'+sjcl.codec.base64.fromBits(a[b],\n 0)+'\"';break;default:q(new sjcl.exception.bug(\"json encode: unsupported type\"))}return c+\"}\"},decode:function(a){a=a.replace(/\\s/g,\"\");a.match(/^\\{.*\\}$/)||q(new sjcl.exception.invalid(\"json decode: this isn't json!\"));a=a.replace(/^\\{|\\}$/g,\"\").split(/,/);var b={},c,d;for(c=0;c<a.length;c++)(d=a[c].match(/^(?:([\"']?)([a-z][a-z0-9]*)\\1):(?:(\\d+)|\"([a-z0-9+\\/%*_.@=\\-]*)\")$/i))||q(new sjcl.exception.invalid(\"json decode: this isn't json!\")),b[d[2]]=d[3]?parseInt(d[3],10):d[2].match(/^(ct|salt|iv)$/)?\n sjcl.codec.base64.toBits(d[4]):unescape(d[4]);return b},d:function(a,b,c){a===t&&(a={});if(b===t)return a;for(var d in b)b.hasOwnProperty(d)&&(c&&(a[d]!==t&&a[d]!==b[d])&&q(new sjcl.exception.invalid(\"required parameter overridden\")),a[d]=b[d]);return a},X:function(a,b){var c={},d;for(d in a)a.hasOwnProperty(d)&&a[d]!==b[d]&&(c[d]=a[d]);return c},W:function(a,b){var c={},d;for(d=0;d<b.length;d++)a[b[d]]!==t&&(c[b[d]]=a[b[d]]);return c}};sjcl.encrypt=sjcl.json.encrypt;sjcl.decrypt=sjcl.json.decrypt;\nsjcl.misc.V={};sjcl.misc.cachedPbkdf2=function(a,b){var c=sjcl.misc.V,d;b=b||{};d=b.iter||1E3;c=c[a]=c[a]||{};d=c[d]=c[d]||{firstSalt:b.salt&&b.salt.length?b.salt.slice(0):sjcl.random.randomWords(2,0)};c=b.salt===t?d.firstSalt:b.salt;d[c]=d[c]||sjcl.misc.pbkdf2(a,c,b.iter);return{key:d[c].slice(0),salt:c.slice(0)}};"]} \ No newline at end of file diff --git a/public/templates.js.map b/public/templates.js.map deleted file mode 100644 index 1ecf1bdde824a43d944a97bfab45c2e718160b09..0000000000000000000000000000000000000000 --- a/public/templates.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["app/views/about.jade","app/views/error.jade","app/views/includes/blockchain.jade","app/views/includes/key.jade","app/views/includes/money.jade","app/views/includes/network_local.jade","app/views/includes/network_remote.jade","app/views/includes/wot.jade","app/views/index.jade","app/views/init/choose.jade","app/views/init/create/create_network.jade","app/views/init/create/create_parameters.jade","app/views/init/create/create_root.jade","app/views/init/create/create_uid.jade","app/views/init/layout.jade","app/views/init/sync/sync.jade","app/views/logs.jade","app/views/main/graphs/blockchain.jade","app/views/main/graphs/graphs.jade","app/views/main/home/home.jade","app/views/main/home/tabs/logs.jade","app/views/main/home/tabs/network.jade","app/views/main/home/tabs/overview.jade","app/views/main/main.jade","app/views/main/settings/settings.jade","app/views/main/settings/tabs/backup.jade","app/views/main/settings/tabs/cpu.jade","app/views/main/settings/tabs/crypto.jade","app/views/main/settings/tabs/currency.jade","app/views/main/settings/tabs/data.jade","app/views/main/settings/tabs/logs.jade","app/views/main/settings/tabs/network.jade","app/views/menu.jade"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAfA;AAAA;CCAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAfA;AAAA;CCAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAfA;AAAA;CCAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAfA;AAAA;CCAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAfA;AAAA;CCAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAfA;AAAA;CCAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAfA;AAAA;CCAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAfA;AAAA;CCAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAfA;AAAA;CCAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAfA;AAAA;CCAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAfA;AAAA;CCAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAfA;AAAA;CCAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAfA;AAAA;CCAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAfA;AAAA;CCAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAfA;AAAA;CCAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAfA;AAAA;CCAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAfA;AAAA;CCAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAfA;AAAA;CCAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAfA;AAAA;CCAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAfA;AAAA;CCAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAfA;AAAA;CCAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAfA;AAAA;CCAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAfA;AAAA;CCAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAfA;AAAA;CCAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAfA;AAAA;CCAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAfA;AAAA;CCAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAfA;AAAA;CCAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAfA;AAAA;CCAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAfA;AAAA;CCAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAfA;AAAA;CCAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAfA;AAAA;CCAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAfA;AAAA;CCAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAfA;AAAA","file":"public/templates.js","sourcesContent":["var __templateData = function template(locals) {\nvar buf = [];\nvar jade_mixins = {};\nvar jade_interp;\n\nbuf.push(\"<div id=\\\"about_card\\\" class=\\\"card\\\"><div class=\\\"card-image\\\"><img src=\\\"images/duniter_250x250.png\\\"/></div><div class=\\\"card-content\\\"><span class=\\\"card-title grey-text text-darken-4\\\">{{ 'help.about_duniter.subtitle' | translate }}</span><p>{{ 'help.about_duniter.version' | translate }}<i>{{ version }}</i></p></div><div class=\\\"card-action\\\"><a href=\\\"https://duniter.org\\\" onclick=\\\"openExternal(this.href); return false\\\"><i class=\\\"fa fa-2x fa-globe\\\"></i><span>duniter.org</span></a><a href=\\\"https://github.com/duniter\\\" onclick=\\\"openExternal(this.href); return false\\\"><i class=\\\"fa fa-2x fa-github\\\"></i><span>github/duniter</span></a><a href=\\\"https://forum.duniter.org\\\" onclick=\\\"openExternal(this.href); return false\\\"><i class=\\\"fa fa-2x fa-comment-o\\\"></i><span>{{ 'help.about_duniter.forum' | translate }}</span></a><a href=\\\"https://jappix.com?r=duniter@muc.duniter.org\\\" onclick=\\\"openExternal(this.href); return false\\\"><i class=\\\"fa fa-2x fa-comments-o\\\"></i><span>{{ 'help.about_duniter.chat' | translate }}</span></a></div></div>\");;return buf.join(\"\");\n};\nif (typeof define === 'function' && define.amd) {\n define([], function() {\n return __templateData;\n });\n} else if (typeof module === 'object' && module && module.exports) {\n module.exports = __templateData;\n} else {\n __templateData;\n}","var __templateData = function template(locals) {\nvar buf = [];\nvar jade_mixins = {};\nvar jade_interp;\n\nbuf.push(\"<main><div class=\\\"container\\\"><div class=\\\"row\\\"><div class=\\\"s12 center\\\"><div class=\\\"card orange darken-1\\\"><div class=\\\"card-content white-text\\\"><i class=\\\"material-icons medium\\\">error</i><p>{{ errorMsg | translate }}</p></div><div class=\\\"card-action\\\"><div class=\\\"row\\\"><a href=\\\"#/\\\" translate=\\\"err.back_index\\\" class=\\\"btn-large orange darken-3 waves-light waves-effect\\\"></a></div></div></div></div></div></div></main>\");;return buf.join(\"\");\n};\nif (typeof define === 'function' && define.amd) {\n define([], function() {\n return __templateData;\n });\n} else if (typeof module === 'object' && module && module.exports) {\n module.exports = __templateData;\n} else {\n __templateData;\n}","var __templateData = function template(locals) {\nvar buf = [];\nvar jade_mixins = {};\nvar jade_interp;\n\nbuf.push(\"<div class=\\\"row\\\"><div class=\\\"input-field col s6 m4\\\"><i class=\\\"prefix fa fa-chain\\\"></i><input id=\\\"medianTimeBlocks\\\" type=\\\"number\\\" ng-model=\\\"$parent.conf.medianTimeBlocks\\\"/><label for=\\\"medianTimeBlocks\\\">{{ 'configuration.create_parameters.medianTimeBlocks' | translate }}</label></div><div class=\\\"input-field col s6 m4\\\"><i class=\\\"prefix fa fa-hourglass-end\\\"></i><input id=\\\"avgGenTime\\\" type=\\\"number\\\" ng-model=\\\"$parent.conf.avgGenTime\\\"/><label for=\\\"avgGenTime\\\">{{ 'configuration.create_parameters.avgGenTime' | translate }}</label></div><div class=\\\"input-field col s6 m4\\\"><i class=\\\"prefix fa fa-cubes\\\"></i><input id=\\\"dtDiffEval\\\" type=\\\"number\\\" ng-model=\\\"$parent.conf.dtDiffEval\\\"/><label for=\\\"dtDiffEval\\\">{{ 'configuration.create_parameters.dtDiffEval' | translate }}</label></div><div class=\\\"input-field col s6 m4\\\"><i class=\\\"prefix fa fa-graduation-cap\\\"></i><input id=\\\"blocksRot\\\" type=\\\"number\\\" ng-model=\\\"$parent.conf.blocksRot\\\"/><label for=\\\"blocksRot\\\">{{ 'configuration.create_parameters.blocksRot' | translate }}</label></div><div class=\\\"input-field col s6 m4\\\"><i class=\\\"prefix fa fa-rotate-left\\\"></i><input id=\\\"percentRot\\\" type=\\\"number\\\" ng-model=\\\"$parent.conf.percentRot\\\"/><label for=\\\"percentRot\\\">{{ 'configuration.create_parameters.percentRot' | translate }}</label></div></div>\");;return buf.join(\"\");\n};\nif (typeof define === 'function' && define.amd) {\n define([], function() {\n return __templateData;\n });\n} else if (typeof module === 'object' && module && module.exports) {\n module.exports = __templateData;\n} else {\n __templateData;\n}","var __templateData = function template(locals) {\nvar buf = [];\nvar jade_mixins = {};\nvar jade_interp;\n\nbuf.push(\"<div class=\\\"row\\\"><div class=\\\"input-field col s12\\\"><i class=\\\"material-icons prefix\\\">vpn_key</i><input id=\\\"idty_entropy\\\" type=\\\"password\\\" ng-model=\\\"$parent.conf.idty_entropy\\\" data-position=\\\"top\\\" data-tooltip=\\\"{{ 'configuration.create_uid.entropy.tooltip' | translate }}\\\" class=\\\"tooltipped\\\"/><label for=\\\"idty_entropy\\\">{{ 'crypto.secret_key' | translate }}</label></div><div class=\\\"input-field col s12\\\"><i class=\\\"material-icons prefix\\\">vpn_key</i><input id=\\\"idty_password\\\" type=\\\"password\\\" ng-model=\\\"$parent.conf.idty_password\\\" data-position=\\\"top\\\" data-tooltip=\\\"{{ 'configuration.create_uid.password.tooltip' | translate }}\\\" class=\\\"tooltipped\\\"/><label for=\\\"idty_password\\\">Password</label></div><div class=\\\"input-field col s12\\\"><select disabled=\\\"disabled\\\"><option value=\\\"\\\" disabled=\\\"disabled\\\" translate=\\\"general.choose_option\\\"></option><option value=\\\"1\\\" selected=\\\"selected\\\" translate=\\\"configuration.create_uid.nrp_algo_choose_1\\\"></option><label>{{ 'configuration.create_uid.nrp_algo_choose' | translate }}</label></select></div><div class=\\\"input-field col s12\\\"><div ng-if=\\\"pubkey_preview\\\" class=\\\"container\\\"><h5 translate=\\\"configuration.create_uid.pubkey_preview\\\"></h5><pre class=\\\"pubkey\\\">{{ pubkey_preview }}</pre></div></div></div>\");;return buf.join(\"\");\n};\nif (typeof define === 'function' && define.amd) {\n define([], function() {\n return __templateData;\n });\n} else if (typeof module === 'object' && module && module.exports) {\n module.exports = __templateData;\n} else {\n __templateData;\n}","var __templateData = function template(locals) {\nvar buf = [];\nvar jade_mixins = {};\nvar jade_interp;\n\nbuf.push(\"<div class=\\\"row\\\"><div class=\\\"input-field col s12\\\"><i class=\\\"prefix fa fa-quote-left\\\"></i><input id=\\\"currency\\\" type=\\\"text\\\" ng-model=\\\"$parent.conf.currency\\\"/><label for=\\\"currency\\\">{{ 'configuration.create_parameters.currency' | translate }}</label></div><div class=\\\"input-field col s6 m4\\\"><i class=\\\"prefix fa fa-line-chart\\\"></i><input id=\\\"c\\\" type=\\\"number\\\" ng-model=\\\"$parent.conf.c\\\"/><label for=\\\"c\\\">{{ 'configuration.create_parameters.c' | translate }}</label></div><div class=\\\"input-field col s6 m4\\\"><i class=\\\"prefix fa fa-hourglass-end\\\"></i><input id=\\\"dt\\\" type=\\\"number\\\" ng-model=\\\"$parent.conf.dt\\\"/><label for=\\\"dt\\\">{{ 'configuration.create_parameters.dt' | translate }}</label></div><div class=\\\"input-field col s6 m4\\\"><i class=\\\"prefix fa fa-money\\\"></i><input id=\\\"ud0\\\" type=\\\"number\\\" ng-model=\\\"$parent.conf.ud0\\\"/><label for=\\\"ud0\\\">{{ 'configuration.create_parameters.ud0' | translate }}</label></div></div>\");;return buf.join(\"\");\n};\nif (typeof define === 'function' && define.amd) {\n define([], function() {\n return __templateData;\n });\n} else if (typeof module === 'object' && module && module.exports) {\n module.exports = __templateData;\n} else {\n __templateData;\n}","var __templateData = function template(locals) {\nvar buf = [];\nvar jade_mixins = {};\nvar jade_interp;\n\n;return buf.join(\"\");\n};\nif (typeof define === 'function' && define.amd) {\n define([], function() {\n return __templateData;\n });\n} else if (typeof module === 'object' && module && module.exports) {\n module.exports = __templateData;\n} else {\n __templateData;\n}","var __templateData = function template(locals) {\nvar buf = [];\nvar jade_mixins = {};\nvar jade_interp;\n\n;return buf.join(\"\");\n};\nif (typeof define === 'function' && define.amd) {\n define([], function() {\n return __templateData;\n });\n} else if (typeof module === 'object' && module && module.exports) {\n module.exports = __templateData;\n} else {\n __templateData;\n}","var __templateData = function template(locals) {\nvar buf = [];\nvar jade_mixins = {};\nvar jade_interp;\n\nbuf.push(\"<div class=\\\"row\\\"><div class=\\\"input-field col s6 m4\\\"><i class=\\\"prefix fa fa-database\\\"></i><input id=\\\"sigStock\\\" type=\\\"number\\\" ng-model=\\\"$parent.conf.sigStock\\\"/><label for=\\\"sigStock\\\">{{ 'configuration.create_parameters.sigStock' | translate }}</label></div><div class=\\\"input-field col s6 m4\\\"><i class=\\\"prefix fa fa-hourglass-end\\\"></i><input id=\\\"sigPeriod\\\" type=\\\"number\\\" ng-model=\\\"$parent.conf.sigPeriod\\\"/><label for=\\\"sigPeriod\\\">{{ 'configuration.create_parameters.sigPeriod' | translate }}</label></div><div class=\\\"input-field col s6 m4\\\"><i class=\\\"prefix fa fa-battery-3\\\"></i><input id=\\\"sigValidity\\\" type=\\\"number\\\" ng-model=\\\"$parent.conf.sigValidity\\\"/><label for=\\\"sigValidity\\\">{{ 'configuration.create_parameters.sigValidity' | translate }}</label></div><div class=\\\"input-field col s6 m4\\\"><i class=\\\"prefix fa fa-battery-3\\\"></i><input id=\\\"msValidity\\\" type=\\\"number\\\" ng-model=\\\"$parent.conf.msValidity\\\"/><label for=\\\"msValidity\\\">{{ 'configuration.create_parameters.msValidity' | translate }}</label></div><div class=\\\"input-field col s6 m4\\\"><i class=\\\"prefix fa fa-certificate\\\"></i><input id=\\\"sigQty\\\" type=\\\"number\\\" ng-model=\\\"$parent.conf.sigQty\\\"/><label for=\\\"sigQty\\\">{{ 'configuration.create_parameters.sigQty' | translate }}</label></div><div class=\\\"input-field col s6 m4\\\"><i class=\\\"prefix fa fa-object-ungroup\\\"></i><input id=\\\"sigWindow\\\" type=\\\"number\\\" ng-model=\\\"$parent.conf.sigWindow\\\"/><label for=\\\"sigWindow\\\">{{ 'configuration.create_parameters.sigWindow' | translate }}</label></div><div class=\\\"input-field col s6 m4\\\"><i class=\\\"prefix fa fa-map-marker\\\"></i><input id=\\\"stepMax\\\" type=\\\"number\\\" ng-model=\\\"$parent.conf.stepMax\\\"/><label for=\\\"stepMax\\\">{{ 'configuration.create_parameters.stepMax' | translate }}</label></div><div class=\\\"input-field col s6 m4\\\"><i class=\\\"prefix fa fa-users\\\"></i><input id=\\\"xpercent\\\" type=\\\"number\\\" ng-model=\\\"$parent.conf.xpercent\\\"/><label for=\\\"xpercent\\\">{{ 'configuration.create_parameters.xpercent' | translate }}</label></div></div>\");;return buf.join(\"\");\n};\nif (typeof define === 'function' && define.amd) {\n define([], function() {\n return __templateData;\n });\n} else if (typeof module === 'object' && module && module.exports) {\n module.exports = __templateData;\n} else {\n __templateData;\n}","var __templateData = function template(locals) {\nvar buf = [];\nvar jade_mixins = {};\nvar jade_interp;\n\nbuf.push(\"<main class=\\\"valign-wrapper\\\"><div class=\\\"container\\\"><div class=\\\"row\\\"><div class=\\\"s12 center\\\"><div class=\\\"preloader-wrapper active\\\"><div class=\\\"spinner-layer spinner-blue-only\\\"><div class=\\\"circle-clipper left\\\"><div class=\\\"circle\\\"></div></div></div></div><p>{{ message | translate:'{number: current_number}' }}</p></div></div></div></main>\");;return buf.join(\"\");\n};\nif (typeof define === 'function' && define.amd) {\n define([], function() {\n return __templateData;\n });\n} else if (typeof module === 'object' && module && module.exports) {\n module.exports = __templateData;\n} else {\n __templateData;\n}","var __templateData = function template(locals) {\nvar buf = [];\nvar jade_mixins = {};\nvar jade_interp;\n\nbuf.push(\"<main><div class=\\\"container\\\"><div class=\\\"row\\\"><div class=\\\"s12 center\\\"><div class=\\\"card teal\\\"><div class=\\\"card-content white-text\\\"><h1 translate=\\\"configuration.init.choose.title\\\" class=\\\"card-title\\\"></h1><p translate=\\\"configuration.init.choose.message\\\"></p></div><div class=\\\"card-action\\\"><div class=\\\"row\\\"><button ui-sref=\\\"configure.create.uid\\\" class=\\\"btn-large waves-effect waves-light\\\"><i class=\\\"left fa fa-plus\\\"></i><span translate=\\\"configuration.init.choose.create\\\"></span></button></div><div class=\\\"row\\\"><button ui-sref=\\\"sync\\\" class=\\\"btn-large waves-effect waves-light\\\"><i class=\\\"left fa fa-code-fork\\\"></i><span translate=\\\"configuration.init.choose.connect\\\" class=\\\"truncate\\\"></span></button></div><div class=\\\"row\\\"><button type=\\\"file\\\" ngf-select=\\\"uploadFiles($file, $invalidFiles)\\\" accept=\\\"zip/*\\\" ngf-max-size=\\\"100MB\\\" class=\\\"btn-large waves-effect waves-light\\\"><i class=\\\"left fa fa-download\\\"></i><span translate=\\\"configuration.init.choose.import\\\"></span></button></div></div></div></div></div></div></main>\");;return buf.join(\"\");\n};\nif (typeof define === 'function' && define.amd) {\n define([], function() {\n return __templateData;\n });\n} else if (typeof module === 'object' && module && module.exports) {\n module.exports = __templateData;\n} else {\n __templateData;\n}","var __templateData = function template(locals) {\nvar buf = [];\nvar jade_mixins = {};\nvar jade_interp;\n\nbuf.push(\"<div class=\\\"container\\\"><div class=\\\"row\\\"><form class=\\\"s12 center\\\"><div class=\\\"card\\\"><div class=\\\"card-action\\\"><i class=\\\"fa fa-globe fa-5x\\\"></i><h1 translate=\\\"configuration.create_network.title\\\" class=\\\"card-title\\\"></h1><div class=\\\"row\\\"><buttn ng-click=\\\"autoconfig()\\\" class=\\\"btn-large waves-effect waves-light\\\"><i class=\\\"left fa fa-magic\\\"></i><span translate=\\\"configuration.create_network.button.autoconf\\\"></span></buttn></div><div class=\\\"row\\\"><div class=\\\"col s12 m6 common-network\\\"><h1 translate=\\\"configuration.create_network.ipv6.title\\\" class=\\\"card-title\\\"></h1><p translate=\\\"configuration.create_network.ipv6.message\\\"></p><select ng-model=\\\"$parent.conf.local_ipv6\\\" class=\\\"browser-default\\\"><option value=\\\"\\\" selected=\\\"selected\\\" translate=\\\"configuration.create_network.none\\\"></option><option ng-repeat=\\\"inet in local_neti | filter : 'IPv6'\\\" value=\\\"{{ inet.addr }}\\\" ng-selected=\\\"{{inet.addr == $parent.conf.local_ipv6}}\\\">{{ inet.name }}</option></select><label>{{ 'configuration.create_network.local_ipv6' | translate }}</label></div><div class=\\\"col s12 m6 common-network\\\"><h1 translate=\\\"configuration.create_network.ipv4.title\\\" class=\\\"card-title\\\"></h1><p translate=\\\"configuration.create_network.ipv4.message\\\"></p><div class=\\\"col s12 m6\\\"><select ng-model=\\\"$parent.conf.local_ipv4\\\" class=\\\"browser-default\\\"><option value=\\\"\\\" translate=\\\"configuration.create_network.none\\\"></option><option ng-repeat=\\\"inet in local_neti | filter : 'IPv4'\\\" value=\\\"{{ inet.addr }}\\\" ng-selected=\\\"{{inet.addr == $parent.conf.local_ipv4}}\\\">{{ inet.name }}</option></select><label>{{ 'configuration.create_network.local_ipv4' | translate }}</label></div><div class=\\\"col s12 m6\\\"><select ng-model=\\\"$parent.conf.remote_ipv4\\\" class=\\\"browser-default\\\"><option value=\\\"\\\" selected=\\\"selected\\\" translate=\\\"configuration.create_network.none\\\"></option><option ng-repeat=\\\"inet in remote_neti | filter : 'IPv4'\\\" value=\\\"{{ inet.addr }}\\\" ng-selected=\\\"{{inet.addr == $parent.conf.remote_ipv4}}\\\">{{ inet.name }}</option></select><label>{{ 'configuration.create_network.remote_ipv4' | translate }}</label></div><div class=\\\"row\\\"></div><div class=\\\"col s12 m4 upnp\\\"><input id=\\\"upnp\\\" type=\\\"checkbox\\\" ng-model=\\\"$parent.conf.upnp\\\" class=\\\"filled-in\\\"/><label for=\\\"upnp\\\">{{ 'configuration.create_network.upnp' | translate }}</label></div></div><div class=\\\"row\\\"></div><div class=\\\"col s12 m6 common-network\\\"><h1 translate=\\\"configuration.create_network.port.title\\\" class=\\\"card-title\\\"></h1><p translate=\\\"configuration.create_network.port.message\\\"></p><div class=\\\"input-field col s6\\\"><i class=\\\"prefix fa fa-plug\\\"></i><input id=\\\"rport\\\" type=\\\"number\\\" ng-model=\\\"$parent.conf.rport\\\"/><label for=\\\"rport\\\">{{ 'configuration.create_network.port' | translate }}</label></div></div><div class=\\\"col s12 m6 common-network\\\"><h1 translate=\\\"configuration.create_network.dns.title\\\" class=\\\"card-title\\\"></h1><p translate=\\\"configuration.create_network.dns.message\\\"></p><div class=\\\"input-field\\\"><i class=\\\"prefix material-icons\\\">language</i><input id=\\\"dns\\\" type=\\\"text\\\" ng-model=\\\"$parent.conf.dns\\\"/><label for=\\\"dns\\\">{{ 'configuration.create_network.dns' | translate }}</label></div></div></div><div class=\\\"row\\\"><div class=\\\"col s12\\\"><button ui-sref=\\\"configure.create.parameters\\\" class=\\\"btn-large waves-effect waves-light button-next\\\"><i class=\\\"left fa fa-check\\\"></i><span translate=\\\"configuration.create_network.button.validate\\\"></span></button><button ui-sref=\\\"index\\\" class=\\\"orange btn-large waves-effect waves-light button-cancel\\\"><i class=\\\"left fa fa-sign-out\\\"></i><span translate=\\\"configuration.create_currency.cancel\\\"></span></button></div></div></div></div></form></div></div>\");;return buf.join(\"\");\n};\nif (typeof define === 'function' && define.amd) {\n define([], function() {\n return __templateData;\n });\n} else if (typeof module === 'object' && module && module.exports) {\n module.exports = __templateData;\n} else {\n __templateData;\n}","var __templateData = function template(locals) {\nvar buf = [];\nvar jade_mixins = {};\nvar jade_interp;\n\nbuf.push(\"<div class=\\\"container\\\"><div class=\\\"row\\\"><form class=\\\"s12 center\\\"><div class=\\\"card\\\"><div class=\\\"card-content\\\"><i class=\\\"fa fa-balance-scale fa-5x\\\"></i><h1 translate=\\\"configuration.create_parameters.title\\\" class=\\\"card-title\\\"></h1><p translate=\\\"configuration.create_parameters.message\\\"></p></div><div class=\\\"card-action\\\"><h1 translate=\\\"configuration.create_parameters.currency.title\\\" class=\\\"card-title\\\"></h1><p translate=\\\"configuration.create_parameters.currency.message\\\"></p><div class=\\\"row\\\"><div class=\\\"input-field col s12\\\"><i class=\\\"prefix fa fa-quote-left\\\"></i><input id=\\\"currency\\\" type=\\\"text\\\" ng-model=\\\"$parent.conf.currency\\\"/><label for=\\\"currency\\\">{{ 'configuration.create_parameters.currency' | translate }}</label></div><div class=\\\"input-field col s6 m4\\\"><i class=\\\"prefix fa fa-line-chart\\\"></i><input id=\\\"c\\\" type=\\\"number\\\" ng-model=\\\"$parent.conf.c\\\"/><label for=\\\"c\\\">{{ 'configuration.create_parameters.c' | translate }}</label></div><div class=\\\"input-field col s6 m4\\\"><i class=\\\"prefix fa fa-hourglass-end\\\"></i><input id=\\\"dt\\\" type=\\\"number\\\" ng-model=\\\"$parent.conf.dt\\\"/><label for=\\\"dt\\\">{{ 'configuration.create_parameters.dt' | translate }}</label></div><div class=\\\"input-field col s6 m4\\\"><i class=\\\"prefix fa fa-money\\\"></i><input id=\\\"ud0\\\" type=\\\"number\\\" ng-model=\\\"$parent.conf.ud0\\\"/><label for=\\\"ud0\\\">{{ 'configuration.create_parameters.ud0' | translate }}</label></div></div></div><div class=\\\"card-action\\\"><h1 translate=\\\"configuration.create_parameters.wot.title\\\" class=\\\"card-title\\\"></h1><p translate=\\\"configuration.create_parameters.wot.message\\\"></p><div class=\\\"row\\\"><div class=\\\"input-field col s6 m4\\\"><i class=\\\"prefix fa fa-database\\\"></i><input id=\\\"sigStock\\\" type=\\\"number\\\" ng-model=\\\"$parent.conf.sigStock\\\"/><label for=\\\"sigStock\\\">{{ 'configuration.create_parameters.sigStock' | translate }}</label></div><div class=\\\"input-field col s6 m4\\\"><i class=\\\"prefix fa fa-hourglass-end\\\"></i><input id=\\\"sigPeriod\\\" type=\\\"number\\\" ng-model=\\\"$parent.conf.sigPeriod\\\"/><label for=\\\"sigPeriod\\\">{{ 'configuration.create_parameters.sigPeriod' | translate }}</label></div><div class=\\\"input-field col s6 m4\\\"><i class=\\\"prefix fa fa-battery-3\\\"></i><input id=\\\"sigValidity\\\" type=\\\"number\\\" ng-model=\\\"$parent.conf.sigValidity\\\"/><label for=\\\"sigValidity\\\">{{ 'configuration.create_parameters.sigValidity' | translate }}</label></div><div class=\\\"input-field col s6 m4\\\"><i class=\\\"prefix fa fa-battery-3\\\"></i><input id=\\\"msValidity\\\" type=\\\"number\\\" ng-model=\\\"$parent.conf.msValidity\\\"/><label for=\\\"msValidity\\\">{{ 'configuration.create_parameters.msValidity' | translate }}</label></div><div class=\\\"input-field col s6 m4\\\"><i class=\\\"prefix fa fa-certificate\\\"></i><input id=\\\"sigQty\\\" type=\\\"number\\\" ng-model=\\\"$parent.conf.sigQty\\\"/><label for=\\\"sigQty\\\">{{ 'configuration.create_parameters.sigQty' | translate }}</label></div><div class=\\\"input-field col s6 m4\\\"><i class=\\\"prefix fa fa-object-ungroup\\\"></i><input id=\\\"sigWindow\\\" type=\\\"number\\\" ng-model=\\\"$parent.conf.sigWindow\\\"/><label for=\\\"sigWindow\\\">{{ 'configuration.create_parameters.sigWindow' | translate }}</label></div><div class=\\\"input-field col s6 m4\\\"><i class=\\\"prefix fa fa-map-marker\\\"></i><input id=\\\"stepMax\\\" type=\\\"number\\\" ng-model=\\\"$parent.conf.stepMax\\\"/><label for=\\\"stepMax\\\">{{ 'configuration.create_parameters.stepMax' | translate }}</label></div><div class=\\\"input-field col s6 m4\\\"><i class=\\\"prefix fa fa-users\\\"></i><input id=\\\"xpercent\\\" type=\\\"number\\\" ng-model=\\\"$parent.conf.xpercent\\\"/><label for=\\\"xpercent\\\">{{ 'configuration.create_parameters.xpercent' | translate }}</label></div></div></div><div class=\\\"card-action\\\"><h1 translate=\\\"configuration.create_parameters.blockchain.title\\\" class=\\\"card-title\\\"></h1><p translate=\\\"configuration.create_parameters.blockchain.message\\\"></p><div class=\\\"row\\\"><div class=\\\"input-field col s6 m4\\\"><i class=\\\"prefix fa fa-chain\\\"></i><input id=\\\"medianTimeBlocks\\\" type=\\\"number\\\" ng-model=\\\"$parent.conf.medianTimeBlocks\\\"/><label for=\\\"medianTimeBlocks\\\">{{ 'configuration.create_parameters.medianTimeBlocks' | translate }}</label></div><div class=\\\"input-field col s6 m4\\\"><i class=\\\"prefix fa fa-hourglass-end\\\"></i><input id=\\\"avgGenTime\\\" type=\\\"number\\\" ng-model=\\\"$parent.conf.avgGenTime\\\"/><label for=\\\"avgGenTime\\\">{{ 'configuration.create_parameters.avgGenTime' | translate }}</label></div><div class=\\\"input-field col s6 m4\\\"><i class=\\\"prefix fa fa-cubes\\\"></i><input id=\\\"dtDiffEval\\\" type=\\\"number\\\" ng-model=\\\"$parent.conf.dtDiffEval\\\"/><label for=\\\"dtDiffEval\\\">{{ 'configuration.create_parameters.dtDiffEval' | translate }}</label></div><div class=\\\"input-field col s6 m4\\\"><i class=\\\"prefix fa fa-graduation-cap\\\"></i><input id=\\\"blocksRot\\\" type=\\\"number\\\" ng-model=\\\"$parent.conf.blocksRot\\\"/><label for=\\\"blocksRot\\\">{{ 'configuration.create_parameters.blocksRot' | translate }}</label></div><div class=\\\"input-field col s6 m4\\\"><i class=\\\"prefix fa fa-rotate-left\\\"></i><input id=\\\"percentRot\\\" type=\\\"number\\\" ng-model=\\\"$parent.conf.percentRot\\\"/><label for=\\\"percentRot\\\">{{ 'configuration.create_parameters.percentRot' | translate }}</label></div></div></div><div class=\\\"card-action\\\"><div class=\\\"row\\\"><div class=\\\"col s12\\\"><button ui-sref=\\\"index\\\" class=\\\"orange btn-large waves-effect waves-light button-cancel\\\"><i class=\\\"left fa fa-sign-out\\\"></i><span translate=\\\"configuration.create_currency.cancel\\\"></span></button><button ui-sref=\\\"configure.create.root\\\" class=\\\"btn-large waves-effect waves-light button-next\\\"><i class=\\\"left fa fa-check\\\"></i><span translate=\\\"configuration.create_parameters.button.validate\\\"></span></button></div></div></div></div></form></div></div>\");;return buf.join(\"\");\n};\nif (typeof define === 'function' && define.amd) {\n define([], function() {\n return __templateData;\n });\n} else if (typeof module === 'object' && module && module.exports) {\n module.exports = __templateData;\n} else {\n __templateData;\n}","var __templateData = function template(locals) {\nvar buf = [];\nvar jade_mixins = {};\nvar jade_interp;\n\nbuf.push(\"<div class=\\\"container\\\"><div class=\\\"row\\\"><form class=\\\"s12 center\\\"><div class=\\\"card\\\"><div class=\\\"card-content\\\"><i class=\\\"fa fa-cube fa-5x\\\"></i><h1 translate=\\\"configuration.create_root.title\\\" class=\\\"card-title\\\"></h1><p translate=\\\"configuration.create_root.message\\\"></p></div><div class=\\\"card-action\\\"><div class=\\\"row\\\"><div class=\\\"col s12 m4\\\"><button ng-class=\\\"{ disabled: started }\\\" ng-disabled=\\\"started\\\" ng-click=\\\"start()\\\" class=\\\"btn-large waves-effect waves-light\\\"><i class=\\\"left fa fa-play\\\"></i><span translate=\\\"configuration.create_root.button.start\\\"></span></button></div><div class=\\\"col s12 m4\\\"><button ng-class=\\\"{ disabled: !started }\\\" ng-disabled=\\\"!started\\\" ng-click=\\\"stop()\\\" class=\\\"btn-large waves-effect waves-light\\\"><i class=\\\"left fa fa-stop\\\"></i><span translate=\\\"configuration.create_root.button.stop\\\"></span></button></div><div class=\\\"col s12 m4\\\"><button ng-class=\\\"{ disabled: !started }\\\" ng-disabled=\\\"!started\\\" ng-click=\\\"try()\\\" class=\\\"btn-large waves-effect waves-light\\\"><i class=\\\"left fa fa-cube\\\"></i><span translate=\\\"configuration.create_root.button.generate\\\"></span></button></div></div></div><div class=\\\"card-action\\\"><div ng-if=\\\"host_listening\\\" class=\\\"container\\\"><h5 translate=\\\"configuration.create_root.host_listening\\\"></h5><pre class=\\\"host_listening\\\">{{ host_listening }}</pre></div><pre ng-show=\\\"generated\\\" class=\\\"card-panel teal white-text code left-align small\\\">{{ generated }}</pre><blockquote ng-show=\\\"message\\\" class=\\\"card-panel left-align\\\">{{ message | translate }}</blockquote></div><div class=\\\"card-action\\\"><div class=\\\"row\\\"><div class=\\\"col s12\\\"><button ng-class=\\\"{ disabled: !(generated) }\\\" ng-disabled=\\\"!(generated)\\\" ng-click=\\\"accept()\\\" class=\\\"btn-large waves-effect waves-light\\\"><i class=\\\"left fa fa-rocket\\\"></i><span translate=\\\"configuration.create_root.button.accept_and_send\\\"></span></button></div></div><div class=\\\"row\\\"><div class=\\\"col s12\\\"><button ng-click=\\\"cancelAndReset()\\\" class=\\\"btn-large orange waves-effect waves-light\\\"><i class=\\\"left fa fa-sign-out\\\"></i><span translate=\\\"configuration.create_root.button.cancel\\\"></span></button></div></div></div></div></form></div></div>\");;return buf.join(\"\");\n};\nif (typeof define === 'function' && define.amd) {\n define([], function() {\n return __templateData;\n });\n} else if (typeof module === 'object' && module && module.exports) {\n module.exports = __templateData;\n} else {\n __templateData;\n}","var __templateData = function template(locals) {\nvar buf = [];\nvar jade_mixins = {};\nvar jade_interp;\n\nbuf.push(\"<div class=\\\"container\\\"><div class=\\\"row\\\"><form class=\\\"s12 center\\\"><div class=\\\"card idty_card\\\"><div class=\\\"card-content\\\"><i class=\\\"fa fa-user fa-5x\\\"></i><h1 translate=\\\"configuration.create_uid.title\\\" class=\\\"card-title\\\"></h1><p translate=\\\"configuration.create_uid.message\\\"></p></div><div class=\\\"card-action\\\"><div class=\\\"row\\\"><div class=\\\"input-field col s12\\\"><i class=\\\"prefix fa fa-user\\\"></i><input id=\\\"idty_uid\\\" type=\\\"text\\\" ng-model=\\\"$parent.conf.idty_uid\\\" data-position=\\\"top\\\" data-tooltip=\\\"{{ 'configuration.create_uid.uid.tooltip' | translate }}\\\" class=\\\"tooltipped\\\"/><label for=\\\"idty_uid\\\">User ID</label></div></div><div class=\\\"row\\\"><div class=\\\"input-field col s12\\\"><i class=\\\"material-icons prefix\\\">vpn_key</i><input id=\\\"idty_entropy\\\" type=\\\"password\\\" ng-model=\\\"$parent.conf.idty_entropy\\\" data-position=\\\"top\\\" data-tooltip=\\\"{{ 'configuration.create_uid.entropy.tooltip' | translate }}\\\" class=\\\"tooltipped\\\"/><label for=\\\"idty_entropy\\\">{{ 'crypto.secret_key' | translate }}</label></div><div class=\\\"input-field col s12\\\"><i class=\\\"material-icons prefix\\\">vpn_key</i><input id=\\\"idty_password\\\" type=\\\"password\\\" ng-model=\\\"$parent.conf.idty_password\\\" data-position=\\\"top\\\" data-tooltip=\\\"{{ 'configuration.create_uid.password.tooltip' | translate }}\\\" class=\\\"tooltipped\\\"/><label for=\\\"idty_password\\\">Password</label></div><div class=\\\"input-field col s12\\\"><select disabled=\\\"disabled\\\"><option value=\\\"\\\" disabled=\\\"disabled\\\" translate=\\\"general.choose_option\\\"></option><option value=\\\"1\\\" selected=\\\"selected\\\" translate=\\\"configuration.create_uid.nrp_algo_choose_1\\\"></option><label>{{ 'configuration.create_uid.nrp_algo_choose' | translate }}</label></select></div><div class=\\\"input-field col s12\\\"><div ng-if=\\\"pubkey_preview\\\" class=\\\"container\\\"><h5 translate=\\\"configuration.create_uid.pubkey_preview\\\"></h5><pre class=\\\"pubkey\\\">{{ pubkey_preview }}</pre></div></div></div><div class=\\\"row\\\"><div class=\\\"col s12\\\"><button ui-sref=\\\"index\\\" class=\\\"orange btn-large waves-effect waves-light button-cancel\\\"><i class=\\\"left fa fa-sign-out\\\"></i><span translate=\\\"configuration.create_currency.cancel\\\"></span></button><button ng-disabled=\\\"!$parent.conf.idty_uid || !$parent.conf.idty_entropy || !$parent.conf.idty_password\\\" ng-click=\\\"accept()\\\" class=\\\"button-next btn-large waves-effect waves-light\\\"><i class=\\\"left fa fa-check\\\"></i><span translate=\\\"configuration.create_uid.create_button\\\"></span></button></div></div></div></div></form></div></div>\");;return buf.join(\"\");\n};\nif (typeof define === 'function' && define.amd) {\n define([], function() {\n return __templateData;\n });\n} else if (typeof module === 'object' && module && module.exports) {\n module.exports = __templateData;\n} else {\n __templateData;\n}","var __templateData = function template(locals) {\nvar buf = [];\nvar jade_mixins = {};\nvar jade_interp;\n\nbuf.push(\"<main ui-view=\\\"\\\"></main><div id=\\\"modal1\\\" class=\\\"modal\\\"><div class=\\\"modal-content\\\"><h4>{{ 'configuration.create_uid.modal_title' | translate }}</h4><p>{{ 'configuration.create_uid.modal_message' | translate }}</p></div><div class=\\\"modal-footer\\\"><a class=\\\"btn modal-action modal-close waves-effect waves-light btn-flat\\\">{{ 'configuration.create_uid.modal_disagree' | translate }}</a><a ui-sref=\\\"configure.create.network\\\" class=\\\"btn modal-action modal-close waves-effect waves-orange\\\"><i class=\\\"material-icons left\\\">done</i>\" + (jade.escape(null == (jade_interp = \"{{ 'configuration.create_uid.modal_agree' | translate }}\") ? \"\" : jade_interp)) + \"</a></div></div>\");;return buf.join(\"\");\n};\nif (typeof define === 'function' && define.amd) {\n define([], function() {\n return __templateData;\n });\n} else if (typeof module === 'object' && module && module.exports) {\n module.exports = __templateData;\n} else {\n __templateData;\n}","var __templateData = function template(locals) {\nvar buf = [];\nvar jade_mixins = {};\nvar jade_interp;\n\nbuf.push(\"<main><div class=\\\"container\\\"><div class=\\\"row\\\"><div class=\\\"s12 center\\\"><div class=\\\"card\\\"><div class=\\\"card-content\\\"><i class=\\\"fa fa-cloud-download fa-5x\\\"></i><h1 translate=\\\"sync.title\\\" class=\\\"card-title\\\"></h1><p translate=\\\"sync.message\\\"></p></div><div class=\\\"card-action\\\"><form class=\\\"row\\\"><div class=\\\"input-field col s12 m3\\\"><p><input type=\\\"radio\\\" name=\\\"groupeMode\\\" value=\\\"simplified\\\" id=\\\"radio1\\\" ng-model=\\\"sync_mode\\\" ng-disabled=\\\"synchronizing\\\"/><label for=\\\"radio1\\\">{{ 'sync.mode.simplified' | translate }}</label></p><p><input type=\\\"radio\\\" name=\\\"groupeMode\\\" value=\\\"manual\\\" id=\\\"radio2\\\" ng-model=\\\"sync_mode\\\" ng-disabled=\\\"synchronizing\\\"/><label for=\\\"radio2\\\">{{ 'sync.mode.manual' | translate }}</label></p></div><div class=\\\"input-field col s12 m6\\\"><div ng-show=\\\"sync_mode == 'simplified'\\\" class=\\\"input-field col s12\\\"><select ng-model=\\\"simplified_host\\\" ng-change=\\\"checkNode()\\\" ng-disabled=\\\"synchronizing\\\" class=\\\"browser-default\\\"><option value=\\\"\\\" disabled=\\\"disabled\\\" selected=\\\"selected\\\">{{ 'sync.simplified.default_option' | translate }}</option><optgroup label=\\\"{{ 'sync.simplified.currency' | translate }} « TestNet »\\\"><option value=\\\"duniter.org:8999\\\">duniter.org {{ 'sync.simplified.main_mirror' | translate }}</option><option value=\\\"testnet.duniter.inso.ovh:80\\\">testnet.duniter.inso.ovh:80</option></optgroup></select><label>{{ 'sync.simplified.choose' | translate }}</label></div><div ng-show=\\\"sync_mode != 'simplified'\\\" class=\\\"input-field col s8\\\"><i class=\\\"prefix material-icons\\\">language</i><input id=\\\"host\\\" type=\\\"text\\\" ng-model=\\\"host\\\"/><label for=\\\"host\\\">{{ 'sync.host' | translate }}</label></div><div ng-show=\\\"sync_mode != 'simplified'\\\" class=\\\"input-field col s4\\\"><i class=\\\"prefix fa fa-plug\\\"></i><input id=\\\"port\\\" type=\\\"number\\\" ng-model=\\\"port\\\"/><label for=\\\"port\\\">{{ 'sync.port' | translate }}</label></div></div><div class=\\\"col s12 m3\\\"><div ng-if=\\\"checking\\\" class=\\\"preloader-wrapper active small\\\"><div class=\\\"spinner-layer spinner-blue-only\\\"><div class=\\\"circle-clipper left\\\"><div class=\\\"circle\\\"></div></div></div></div><div ng-show=\\\"sync_mode != 'simplified'\\\" class=\\\"input-field\\\"><button ng-show=\\\"!checking\\\" ng-disabled=\\\"synchronizing || (sync_mode != 'simplified' && !(host && port))\\\" ng-click=\\\"checkNode()\\\" class=\\\"btn-large waves-effect waves-light\\\"><i class=\\\"left fa fa-wifi\\\"></i><span translate=\\\"sync.check\\\"></span></button></div></div></form><div class=\\\"row\\\"><div class=\\\"col s12\\\"><blockquote ng-show=\\\"sync_error\\\" class=\\\"card-panel left-align\\\">{{ sync_error | translate }}</blockquote><blockquote ng-show=\\\"sync_message\\\" class=\\\"info card-panel left-align\\\">{{ sync_message }}</blockquote></div></div><div class=\\\"row\\\"><button ng-disabled=\\\"!checked_host || synchronizing\\\" ng-click=\\\"startSync()\\\" class=\\\"btn-large waves-effect waves-light\\\"><i class=\\\"left fa fa-cloud-download\\\"></i><span translate=\\\"sync.start\\\"></span></button></div><div ng-show=\\\"synchronizing\\\" class=\\\"row\\\"><div class=\\\"col s8 m9\\\"><div class=\\\"progress\\\"><div style=\\\"width: {{ down_percent }}%\\\" class=\\\"determinate\\\"></div></div></div><div class=\\\"col s4 m3 left-align\\\"><span>Downloading... ({{ down_percent }}%)</span></div><div class=\\\"col s8 m9\\\"><div class=\\\"progress\\\"><div style=\\\"width: {{ apply_percent }}%\\\" class=\\\"determinate\\\"></div></div></div><div class=\\\"col s4 m3 left-align\\\"><span>Applying... ({{ apply_percent }}%)</span></div></div><blockquote ng-show=\\\"sync_failed\\\" class=\\\"card-panel left-align\\\">{{ 'sync.failed' | translate }}</blockquote></div></div></div></div></div></main>\");;return buf.join(\"\");\n};\nif (typeof define === 'function' && define.amd) {\n define([], function() {\n return __templateData;\n });\n} else if (typeof module === 'object' && module && module.exports) {\n module.exports = __templateData;\n} else {\n __templateData;\n}","var __templateData = function template(locals) {\nvar buf = [];\nvar jade_mixins = {};\nvar jade_interp;\n\nbuf.push(\"<ul id=\\\"slide-out\\\" class=\\\"side-nav\\\"><li><div class=\\\"card hide-on-med-and-up\\\"><div class=\\\"card-image\\\"><img src=\\\"images/menu_bg.jpg\\\"/><p class=\\\"card-title\\\"><span class=\\\"menu-title\\\">meta_brouzouf</span><span class=\\\"menu-speach\\\">22 members</span><span class=\\\"menu-footer\\\">DuniterUI v0.21.0</span></p></div></div></li><li><a ui-sref=\\\"home\\\" class=\\\"waves-effect waves-teal\\\"><i class=\\\"fa fa-2x fa-photo\\\"></i>\" + (jade.escape(null == (jade_interp = 'Overview') ? \"\" : jade_interp)) + \"</a></li><li><a ui-sref=\\\"graphs.blockchain\\\" class=\\\"waves-effect waves-teal\\\"><i class=\\\"fa fa-2x fa-area-chart\\\"></i>\" + (jade.escape(null == (jade_interp = 'Charts') ? \"\" : jade_interp)) + \"</a></li><li><a href=\\\"#!\\\" class=\\\"waves-effect waves-teal\\\"><i class=\\\"fa fa-2x fa-heartbeat\\\"></i>\" + (jade.escape(null == (jade_interp = 'Status') ? \"\" : jade_interp)) + \"</a></li><li><a ui-sref=\\\"settings.data\\\" class=\\\"waves-effect waves-teal\\\"><i class=\\\"fa fa-2x fa-gear\\\"></i>\" + (jade.escape(null == (jade_interp = 'Settings') ? \"\" : jade_interp)) + \"</a></li></ul><div id=\\\"card-logs\\\" class=\\\"card\\\"><div class=\\\"card-action left-align\\\"><p><input id=\\\"follow-logs\\\" type=\\\"checkbox\\\" ng-model=\\\"follow\\\" class=\\\"filled-in\\\"/><label for=\\\"follow-logs\\\">{{ 'home.tabs.logs.follow.logs' | translate }}</label><input id=\\\"pause-logs\\\" type=\\\"checkbox\\\" ng-model=\\\"pause\\\" class=\\\"filled-in\\\"/><label for=\\\"pause-logs\\\">{{ 'home.tabs.logs.pause.logs' | translate }}</label><input id=\\\"level-error\\\" type=\\\"checkbox\\\" ng-model=\\\"levels.error\\\" class=\\\"filled-in\\\"/><label for=\\\"level-error\\\">{{ 'home.tabs.logs.level.error' | translate }}</label><input id=\\\"level-warn\\\" type=\\\"checkbox\\\" ng-model=\\\"levels.warn\\\" class=\\\"filled-in\\\"/><label for=\\\"level-warn\\\">{{ 'home.tabs.logs.level.warn' | translate }}</label><input id=\\\"level-info\\\" type=\\\"checkbox\\\" ng-model=\\\"levels.info\\\" class=\\\"filled-in\\\"/><label for=\\\"level-info\\\">{{ 'home.tabs.logs.level.info' | translate }}</label><input id=\\\"level-debug\\\" type=\\\"checkbox\\\" ng-model=\\\"levels.debug\\\" class=\\\"filled-in\\\"/><label for=\\\"level-debug\\\">{{ 'home.tabs.logs.level.debug' | translate }}</label><input id=\\\"level-trace\\\" type=\\\"checkbox\\\" ng-model=\\\"levels.trace\\\" class=\\\"filled-in\\\"/><label for=\\\"level-trace\\\">{{ 'home.tabs.logs.level.trace' | translate }}</label></p><p>{{ 'graphs.blockchain.range' | translate }}</p><div class=\\\"range-field\\\"><input type=\\\"range\\\" min=\\\"10\\\" max=\\\"10000\\\" ng-model=\\\"logsSize\\\" ng-mouseup=\\\"changeSize()\\\"/></div></div></div><pre id=\\\"logs\\\"><p ng-repeat=\\\"log in logs track by $index\\\"><span class=\\\"log-time\\\">{{ log.timestamp }} </span><span class=\\\"log-level {{ log.level }}\\\">{{ log.level }} </span><span class=\\\"log-msg {{ log.level }}\\\">{{ log.msg }}</span></p></pre>\");;return buf.join(\"\");\n};\nif (typeof define === 'function' && define.amd) {\n define([], function() {\n return __templateData;\n });\n} else if (typeof module === 'object' && module && module.exports) {\n module.exports = __templateData;\n} else {\n __templateData;\n}","var __templateData = function template(locals) {\nvar buf = [];\nvar jade_mixins = {};\nvar jade_interp;\n\nbuf.push(\"<div class=\\\"container\\\"><div class=\\\"row\\\"><div class=\\\"card\\\"><div class=\\\"card-action\\\"><div class=\\\"row\\\"><div class=\\\"col s12\\\"><div class=\\\"container\\\"><p>{{ 'graphs.blockchain.range' | translate }}</p><div class=\\\"range-field\\\"><input type=\\\"range\\\" min=\\\"30\\\" max=\\\"600\\\" ng-model=\\\"blocksCount\\\" ng-mouseup=\\\"updateGraphs()\\\"/></div><!--.input-field.col.s6.m4--><!-- input#time.filled-in(type=\\\"checkbox\\\" ng-model=\\\"withTime\\\")--><!-- label(for=\\\"time\\\") {{ 'graphs.blockchain.with.time' | translate }}--><!-- Too heavy for now--><!--.input-field.col.s6.m4--><!-- input#speed.filled-in(type=\\\"checkbox\\\" ng-model=\\\"withSpeed\\\")--><!-- label(for=\\\"speed\\\") {{ 'graphs.blockchain.with.speed' | translate }}--><!--.input-field.col.s6.m4--><!-- input#difficulty.filled-in(type=\\\"checkbox\\\" ng-model=\\\"withDifficulty\\\")--><!-- label(for=\\\"difficulty\\\") {{ 'graphs.blockchain.with.difficulty' | translate }}--></div><div ng-if=\\\"loading\\\" class=\\\"s12 center\\\"><div class=\\\"row\\\"></div><div class=\\\"row\\\"></div><div class=\\\"preloader-wrapper active\\\"><div class=\\\"spinner-layer spinner-blue-only\\\"><div class=\\\"circle-clipper left\\\"><div class=\\\"circle\\\"></div></div></div></div><p>{{ message | translate:'{number: current_number}' }}</p></div></div><div id=\\\"timeGraph\\\"></div><!--#speedGraph--><div id=\\\"difficultyGraph\\\"></div></div></div></div></div></div>\");;return buf.join(\"\");\n};\nif (typeof define === 'function' && define.amd) {\n define([], function() {\n return __templateData;\n });\n} else if (typeof module === 'object' && module && module.exports) {\n module.exports = __templateData;\n} else {\n __templateData;\n}","var __templateData = function template(locals) {\nvar buf = [];\nvar jade_mixins = {};\nvar jade_interp;\n\nbuf.push(\"<div id=\\\"modalReset\\\" class=\\\"modal\\\"><div class=\\\"modal-content\\\"><h4>{{ 'graphs.data.modal_title' | translate }}</h4><p>{{ 'graphs.data.modal_message' | translate }}</p></div><div class=\\\"modal-footer\\\"><a class=\\\"btn modal-action modal-close waves-effect waves-light btn-flat\\\">{{ 'graphs.data.modal_disagree' | translate }}</a><a ng-click=\\\"fullReset()\\\" class=\\\"btn modal-action modal-close waves-effect waves-light orange\\\"><i class=\\\"material-icons left\\\">done</i>\" + (jade.escape(null == (jade_interp = \"{{ 'graphs.data.modal_agree' | translate }}\") ? \"\" : jade_interp)) + \"</a></div></div><main class=\\\"home-main main-screen\\\"><div class=\\\"container\\\"><div class=\\\"row\\\"><div class=\\\"col s12\\\"><ul class=\\\"tabs\\\"><li class=\\\"tab col s6\\\"><a href=\\\"#main.graphs.blockchain\\\"><i class=\\\"fa fa-chain\\\"> </i>\" + (jade.escape(null == (jade_interp = \" {{ 'graphs.tabs.blockchain' | translate }}\") ? \"\" : jade_interp)) + \"</a></li><li class=\\\"tab col s6 disabled\\\"><a href=\\\"#main.graphs.currency\\\"><i class=\\\"fa fa-money\\\"> </i>\" + (jade.escape(null == (jade_interp = \" {{ 'graphs.tabs.currency' | translate }}\") ? \"\" : jade_interp)) + \"</a></li></ul></div></div></div><div ui-view=\\\"\\\" class=\\\"ui-scrollable\\\"></div></main>\");;return buf.join(\"\");\n};\nif (typeof define === 'function' && define.amd) {\n define([], function() {\n return __templateData;\n });\n} else if (typeof module === 'object' && module && module.exports) {\n module.exports = __templateData;\n} else {\n __templateData;\n}","var __templateData = function template(locals) {\nvar buf = [];\nvar jade_mixins = {};\nvar jade_interp;\n\nbuf.push(\"<main class=\\\"home-main main-screen\\\"><div class=\\\"container\\\"><div class=\\\"row\\\"><div class=\\\"col s12\\\"><ul class=\\\"tabs\\\"><li class=\\\"tab col s3\\\"><a href=\\\"#main.home.overview\\\"><i class=\\\"fa fa-photo\\\"> </i>\" + (jade.escape(null == (jade_interp = \" {{ 'home.tabs.overview' | translate }}\") ? \"\" : jade_interp)) + \"</a></li><li class=\\\"tab col s3\\\"><a href=\\\"#main.home.network\\\"><i class=\\\"fa fa-globe\\\"> </i>\" + (jade.escape(null == (jade_interp = \" {{ 'home.tabs.network' | translate }}\") ? \"\" : jade_interp)) + \"</a></li></ul></div></div></div><div ui-view=\\\"\\\" class=\\\"ui-scrollable\\\"></div></main>\");;return buf.join(\"\");\n};\nif (typeof define === 'function' && define.amd) {\n define([], function() {\n return __templateData;\n });\n} else if (typeof module === 'object' && module && module.exports) {\n module.exports = __templateData;\n} else {\n __templateData;\n}","var __templateData = function template(locals) {\nvar buf = [];\nvar jade_mixins = {};\nvar jade_interp;\n\nbuf.push(\"<div class=\\\"row\\\"><div class=\\\"s12 center\\\"><div class=\\\"card logs\\\"><div class=\\\"card-action left-align\\\"><p><input id=\\\"follow-logs\\\" type=\\\"checkbox\\\" ng-model=\\\"follow\\\" class=\\\"filled-in\\\"/><label for=\\\"follow-logs\\\">{{ 'home.tabs.logs.follow.logs' | translate }}</label><input id=\\\"pause-logs\\\" type=\\\"checkbox\\\" ng-model=\\\"pause\\\" class=\\\"filled-in\\\"/><label for=\\\"pause-logs\\\">{{ 'home.tabs.logs.pause.logs' | translate }}</label><input id=\\\"level-error\\\" type=\\\"checkbox\\\" ng-model=\\\"levels.error\\\" class=\\\"filled-in\\\"/><label for=\\\"level-error\\\">{{ 'home.tabs.logs.level.error' | translate }}</label><input id=\\\"level-warn\\\" type=\\\"checkbox\\\" ng-model=\\\"levels.warn\\\" class=\\\"filled-in\\\"/><label for=\\\"level-warn\\\">{{ 'home.tabs.logs.level.warn' | translate }}</label><input id=\\\"level-info\\\" type=\\\"checkbox\\\" ng-model=\\\"levels.info\\\" class=\\\"filled-in\\\"/><label for=\\\"level-info\\\">{{ 'home.tabs.logs.level.info' | translate }}</label><input id=\\\"level-debug\\\" type=\\\"checkbox\\\" ng-model=\\\"levels.debug\\\" class=\\\"filled-in\\\"/><label for=\\\"level-debug\\\">{{ 'home.tabs.logs.level.debug' | translate }}</label><input id=\\\"level-trace\\\" type=\\\"checkbox\\\" ng-model=\\\"levels.trace\\\" class=\\\"filled-in\\\"/><label for=\\\"level-trace\\\">{{ 'home.tabs.logs.level.trace' | translate }}</label></p><p>{{ 'graphs.blockchain.range' | translate }}</p><div class=\\\"range-field\\\"><input type=\\\"range\\\" min=\\\"10\\\" max=\\\"10000\\\" ng-model=\\\"logsSize\\\" ng-mouseup=\\\"changeSize()\\\"/></div></div><div class=\\\"card-action left-align ui-scrollable\\\"><pre id=\\\"logs\\\"><p ng-repeat=\\\"log in logs track by $index\\\"><span class=\\\"log-time\\\">{{ log.timestamp }} </span><span class=\\\"log-level {{ log.level }}\\\">{{ log.level }} </span><span class=\\\"log-msg {{ log.level }}\\\">{{ log.msg }}</span></p></pre></div></div></div></div>\");;return buf.join(\"\");\n};\nif (typeof define === 'function' && define.amd) {\n define([], function() {\n return __templateData;\n });\n} else if (typeof module === 'object' && module && module.exports) {\n module.exports = __templateData;\n} else {\n __templateData;\n}","var __templateData = function template(locals) {\nvar buf = [];\nvar jade_mixins = {};\nvar jade_interp;\n\nbuf.push(\"<div class=\\\"container\\\"><div class=\\\"row\\\"><div class=\\\"col s12\\\"><div class=\\\"card\\\"><div class=\\\"card-action center\\\"><button ng-click=\\\"update()\\\" class=\\\"teal btn-large waves-effect waves-light\\\"><i class=\\\"left fa fa-repeat\\\"></i><span translate=\\\"home.tabs.network.button.update\\\"></span></button></div><div class=\\\"card-action\\\"><div ng-if=\\\"searching\\\" class=\\\"center\\\"><div class=\\\"preloader-wrapper active\\\"><div class=\\\"spinner-layer spinner-blue-only\\\"><div class=\\\"circle-clipper left\\\"><div class=\\\"circle\\\"></div></div></div></div></div><table ng-if=\\\"!searching\\\" class=\\\"bordered\\\"><thead><tr><th>Pubkey</th><th>Status</th><th>Endpoint</th></tr></thead><tbody><tr ng-repeat=\\\"peer in peers track by $index\\\"><td>{{ peer.pubkey.substr(0,6) }}</td><td>{{ peer.status }}</td><td>{{ peer.endpoints[0] }}</td></tr></tbody></table></div></div></div></div></div>\");;return buf.join(\"\");\n};\nif (typeof define === 'function' && define.amd) {\n define([], function() {\n return __templateData;\n });\n} else if (typeof module === 'object' && module && module.exports) {\n module.exports = __templateData;\n} else {\n __templateData;\n}","var __templateData = function template(locals) {\nvar buf = [];\nvar jade_mixins = {};\nvar jade_interp;\n\nbuf.push(\"<div class=\\\"container\\\"><div ng-show=\\\"should_reconfigure\\\" class=\\\"row\\\"><div class=\\\"card network-alert\\\"><blockquote class=\\\"card-content left-align\\\"><div class=\\\"center\\\"><i class=\\\"fa fa-globe fa-5x\\\"></i><h6 translate=\\\"configuration.create_network.title\\\" class=\\\"card-title\\\"></h6></div><div class=\\\"left-align\\\"><p>{{ 'home.tabs.overview.should_reconfigure' | translate }}</p></div><div ng-if=\\\"!reconfiguring\\\" class=\\\"center\\\"><button ng-click=\\\"reconfigure_network()\\\" class=\\\"btn-large waves-effect waves-light\\\"><i class=\\\"left fa fa-magic\\\"></i><span translate=\\\"configuration.create_network.button.autoconf\\\"></span></button></div><div ng-if=\\\"reconfiguring\\\" class=\\\"center\\\"><div class=\\\"preloader-wrapper active\\\"><div class=\\\"spinner-layer spinner-blue-only\\\"><div class=\\\"circle-clipper left\\\"><div class=\\\"circle\\\"></div></div></div></div></div></blockquote></div></div><div class=\\\"row\\\"><div class=\\\"col s12\\\"><div class=\\\"card-panel currency\\\"><h1>{{ current.currency }}</h1></div></div></div><div class=\\\"row home\\\"><div class=\\\"col s6 m3\\\"><div class=\\\"card sync\\\"><div class=\\\"card-content\\\"><div ng-show=\\\"is_pulling\\\" class=\\\"card-title\\\"><p>{{ 'home.pulling.network' | translate }} {{ network_percent }}%</p><div class=\\\"progress\\\"><div style=\\\"width: {{ network_percent }}%\\\" class=\\\"determinate\\\"></div></div><p>{{ 'home.pulling.peer' | translate }} {{ peer_percent }}%</p><div class=\\\"progress\\\"><div style=\\\"width: {{ peer_percent }}%\\\" class=\\\"determinate\\\"></div></div></div><div ng-show=\\\"has_pulled && !is_pulling\\\" class=\\\"iconic card-title\\\"><i class=\\\"green-text material-icons\\\">done</i></div><div ng-show=\\\"!has_pulled && !is_pulling\\\" class=\\\"iconic card-title\\\"><i class=\\\"grey-text material-icons\\\">schedule</i></div></div><div class=\\\"card-action\\\"><p ng-show=\\\"!is_pulling\\\">{{ sync_state | translate }} {{ sync_time }}</p><p ng-show=\\\"is_pulling\\\">{{ sync_state | translate }}</p></div></div></div><div class=\\\"col s6 m3\\\"><div id=\\\"server_state\\\" class=\\\"card\\\"><div class=\\\"card-content\\\"><div class=\\\"card-title\\\"><i ng-if=\\\"server_stopped\\\" class=\\\"red-text material-icons\\\">stop</i><i ng-if=\\\"server_started\\\" class=\\\"green-text material-icons\\\">play_arrow</i><div ng-if=\\\"!server_started && !server_stopped\\\" class=\\\"preloader-wrapper active\\\"><div class=\\\"spinner-layer spinner-blue-only\\\"><div class=\\\"circle-clipper left\\\"><div class=\\\"circle\\\"></div></div></div></div></div></div><div class=\\\"card-action\\\"><p>{{ 'home.state' | translate }} <span ng-if=\\\"server_started\\\" class=\\\"green-text\\\">{{ 'home.state.started' | translate }}</span><span ng-if=\\\"server_stopped\\\" class=\\\"red-text\\\">{{ 'home.state.stopped' | translate }}</span><span ng-if=\\\"!server_started && !server_stopped\\\" class=\\\"blue-text\\\">...</span></p></div></div></div><div class=\\\"col s6 m3\\\"><div class=\\\"card\\\"><div class=\\\"card-content\\\"><i class=\\\"fa fa-chain fa-5x\\\"></i><div class=\\\"card-title\\\"><span>{{ current.number }}</span></div></div><div class=\\\"card-action\\\"><p>{{ 'home.current.number' | translate }}</p></div></div></div><div class=\\\"col s6 m3\\\"><div class=\\\"card\\\"><div class=\\\"card-content\\\"><i class=\\\"fa fa-users fa-5x\\\"></i><div class=\\\"card-title\\\"><span>{{ current.membersCount }}</span></div></div><div class=\\\"card-action\\\"><p>{{ 'home.current.membersCount' | translate }}</p></div></div></div><div class=\\\"col s6 m3\\\"><div class=\\\"card card-time\\\"><div class=\\\"card-content\\\"><i class=\\\"fa fa-hourglass-half fa-5x\\\"></i><div class=\\\"card-title\\\"><p>{{ current.medianTime | mt_date }}</p><p>{{ current.medianTime | mt_time }}</p></div></div><div class=\\\"card-action\\\"><p>{{ 'home.current.medianTime' | translate }}</p></div></div></div><div class=\\\"col s6 m3\\\"><div class=\\\"card\\\"><div class=\\\"card-content\\\"><i class=\\\"fa fa-graduation-cap fa-5x\\\"></i><div class=\\\"card-title\\\"><span>{{ current.powMin }}</span></div></div><div class=\\\"card-action\\\"><p>{{ 'home.current.powMin' | translate }}</p></div></div></div><div class=\\\"col s6 m3\\\"><div class=\\\"card\\\"><div class=\\\"card-content\\\"><i class=\\\"fa fa-money fa-5x\\\"></i><div class=\\\"card-title\\\"><span>{{ monetaryMass }} UD</span></div></div><div class=\\\"card-action\\\"><p>{{ 'home.current.mmass' | translate }}</p></div></div></div><div class=\\\"col s6 m3\\\"><div class=\\\"card proof-card\\\"><div class=\\\"card-content\\\"><i class=\\\"fa fa-dashboard fa-5x\\\"></i><div class=\\\"card-title\\\"><span class=\\\"proof-mesure\\\">{{ pow_total }}</span><span class=\\\"proof-unit\\\">{{ 'home.pow.unit' | translate }}</span></div></div><div class=\\\"card-action\\\"><div ng-show=\\\"!pow_waiting && lastNearPoW\\\"><p class=\\\"hash\\\"><span>{{ lastNearPoW.slice(0,8) }}</span><div class=\\\"progress\\\"><div class=\\\"indeterminate\\\"></div></div></p></div><div ng-show=\\\"pow_mirror\\\"><p><span>{{ 'home.pow.is_mirror' | translate }}</span></p></div><div ng-show=\\\"!pow_mirror && pow_waiting\\\"><p><span>{{ 'home.pow.is_waiting' | translate }}</span></p></div></div></div></div></div></div>\");;return buf.join(\"\");\n};\nif (typeof define === 'function' && define.amd) {\n define([], function() {\n return __templateData;\n });\n} else if (typeof module === 'object' && module && module.exports) {\n module.exports = __templateData;\n} else {\n __templateData;\n}","var __templateData = function template(locals) {\nvar buf = [];\nvar jade_mixins = {};\nvar jade_interp;\n\nbuf.push(\"<ul id=\\\"slide-out\\\" class=\\\"side-nav\\\"><li><div class=\\\"card hide-on-med-and-up\\\"><div class=\\\"card-image\\\"><img src=\\\"images/menu_bg.jpg\\\"/><p class=\\\"card-title\\\"><span class=\\\"menu-title\\\">meta_brouzouf</span><span class=\\\"menu-speach\\\">22 members</span><span class=\\\"menu-footer\\\">DuniterUI v0.21.0</span></p></div></div></li><li><a ui-sref=\\\"home\\\" class=\\\"waves-effect waves-teal\\\"><i class=\\\"fa fa-2x fa-photo\\\"></i>\" + (jade.escape(null == (jade_interp = 'Overview') ? \"\" : jade_interp)) + \"</a></li><li><a ui-sref=\\\"graphs.blockchain\\\" class=\\\"waves-effect waves-teal\\\"><i class=\\\"fa fa-2x fa-area-chart\\\"></i>\" + (jade.escape(null == (jade_interp = 'Charts') ? \"\" : jade_interp)) + \"</a></li><li><a href=\\\"#!\\\" class=\\\"waves-effect waves-teal\\\"><i class=\\\"fa fa-2x fa-heartbeat\\\"></i>\" + (jade.escape(null == (jade_interp = 'Status') ? \"\" : jade_interp)) + \"</a></li><li><a ui-sref=\\\"settings.data\\\" class=\\\"waves-effect waves-teal\\\"><i class=\\\"fa fa-2x fa-gear\\\"></i>\" + (jade.escape(null == (jade_interp = 'Settings') ? \"\" : jade_interp)) + \"</a></li></ul><ul id=\\\"about\\\" class=\\\"dropdown-content\\\"><li><button ng-click=\\\"showAbout()\\\" class=\\\"btn-flat left-align\\\"><i class=\\\"material-icons left\\\">info_outline</i><span>{{ 'help.about_duniter' | translate }}</span></button></li><li ng-repeat=\\\"entry in notifications.help\\\"><button ng-click=\\\"entry.onclick()\\\" class=\\\"btn-flat left-align\\\"><i class=\\\"material-icons left\\\">{{ entry.icon }}</i><span data-badge=\\\"1\\\">{{ entry.message | translate }}</span></button></li></ul><ul id=\\\"serveractions\\\" class=\\\"dropdown-content\\\"><li><button ng-click=\\\"restartServer()\\\" class=\\\"btn-flat left-align\\\"><i class=\\\"material-icons left\\\">replay</i><span>{{ 'home.menu.server.restart' | translate }}</span></button></li><li><button ng-click=\\\"startServer()\\\" ng-class=\\\"{ disabled : server_started || !server_stopped }\\\" ng-disabled=\\\"server_started\\\" class=\\\"btn-flat left-align\\\"><i class=\\\"material-icons left\\\">play_arrow</i><span>{{ 'home.menu.server.start' | translate }}</span></button></li><li><button ng-click=\\\"stopServer()\\\" ng-class=\\\"{ disabled : server_stopped || !server_started }\\\" ng-disabled=\\\"server_stopped\\\" class=\\\"btn-flat left-align\\\"><i class=\\\"material-icons left\\\">stop</i><span>{{ 'home.menu.server.stop' | translate }}</span></button></li></ul><nav><div class=\\\"nav-wrapper\\\"><span data-activates=\\\"slide-out\\\" class=\\\"waves-effect waves-light button-collapse stop-nav full hide-on-med-and-up\\\"><i class=\\\"mdi-navigation-menu\\\"></i></span><!--<a href=\\\"#\\\" class=\\\"brand-logo left\\\">Logo</a>--><ul class=\\\"left hide-on-small-and-down\\\"><li ng-class=\\\"{ active: menu == 'home' }\\\"><a ui-sref=\\\"main.home.overview\\\" class=\\\"waves-effect waves-light\\\"><i class=\\\"fa fa-2x fa-home left\\\"></i><span>{{ 'top.menu.overview' | translate }}</span></a></li><li ng-class=\\\"{ active: menu == 'graphs' }\\\"><a ui-sref=\\\"main.graphs.blockchain\\\" class=\\\"waves-effect waves-light\\\"><i class=\\\"fa fa-2x fa-database left\\\"></i><span>{{ 'top.menu.data' | translate }}</span></a></li><li ng-class=\\\"{ active: menu == 'settings' }\\\"><a ui-sref=\\\"main.settings.logs\\\" class=\\\"waves-effect waves-light\\\"><i class=\\\"fa fa-2x fa-gear left\\\"></i><span>{{ 'top.menu.settings' | translate }}</span></a></li></ul><ul class=\\\"right\\\"><li><a ng-click=\\\"openWallet()\\\" class=\\\"waves-effect waves-light\\\"><i class=\\\"fa fa-2x fa-suitcase left\\\"></i><span>{{ 'top.menu.wallet' | translate }}</span></a></li><li><a href=\\\"#!\\\" data-activates=\\\"about\\\" data-badge=\\\"{{ notifications.help.length }}\\\" class=\\\"waves-effect waves-light dropdown-button\\\"><i class=\\\"material-icons\\\">info_outline</i></a></li><li><a href=\\\"#!\\\" data-activates=\\\"serveractions\\\" class=\\\"waves-effect waves-light dropdown-button\\\"><i class=\\\"material-icons\\\">more_vert</i></a></li></ul></div></nav><div ui-view=\\\"\\\"></div>\");;return buf.join(\"\");\n};\nif (typeof define === 'function' && define.amd) {\n define([], function() {\n return __templateData;\n });\n} else if (typeof module === 'object' && module && module.exports) {\n module.exports = __templateData;\n} else {\n __templateData;\n}","var __templateData = function template(locals) {\nvar buf = [];\nvar jade_mixins = {};\nvar jade_interp;\n\nbuf.push(\"<div id=\\\"modalReset\\\" class=\\\"modal\\\"><div class=\\\"modal-content\\\"><h4>{{ 'settings.data.modal_title' | translate }}</h4><p>{{ 'settings.data.modal_message' | translate }}</p></div><div class=\\\"modal-footer\\\"><a class=\\\"btn modal-action modal-close waves-effect waves-light btn-flat\\\">{{ 'settings.data.modal_disagree' | translate }}</a><a ng-click=\\\"fullReset()\\\" class=\\\"btn modal-action modal-close waves-effect waves-light orange\\\"><i class=\\\"material-icons left\\\">done</i>\" + (jade.escape(null == (jade_interp = \"{{ 'settings.data.modal_agree' | translate }}\") ? \"\" : jade_interp)) + \"</a></div></div><main class=\\\"home-main main-screen\\\"><div class=\\\"container\\\"><div class=\\\"row\\\"><div class=\\\"col s12\\\"><ul class=\\\"tabs\\\"><li class=\\\"tab col s2\\\"><a href=\\\"#main.settings.logs\\\"><i class=\\\"fa fa-newspaper-o\\\"> </i>\" + (jade.escape(null == (jade_interp = \" {{ 'settings.tabs.logs' | translate }}\") ? \"\" : jade_interp)) + \"</a></li><li class=\\\"tab col s2\\\"><a href=\\\"#main.settings.backup\\\"><i class=\\\"fa fa-folder-open\\\"> </i>\" + (jade.escape(null == (jade_interp = \" {{ 'settings.tabs.backup' | translate }}\") ? \"\" : jade_interp)) + \"</a></li><li class=\\\"tab col s2\\\"><a href=\\\"#main.settings.data\\\"><i class=\\\"fa fa-database\\\"> </i>\" + (jade.escape(null == (jade_interp = \" {{ 'settings.tabs.data' | translate }}\") ? \"\" : jade_interp)) + \"</a></li><li class=\\\"tab col s2\\\"><a href=\\\"#main.settings.crypto\\\"><i class=\\\"fa fa-key\\\"> </i>\" + (jade.escape(null == (jade_interp = \" {{ 'settings.tabs.identity' | translate }}\") ? \"\" : jade_interp)) + \"</a></li><li class=\\\"tab col s2\\\"><a href=\\\"#main.settings.network\\\"><i class=\\\"fa fa-globe\\\"> </i>\" + (jade.escape(null == (jade_interp = \" {{ 'settings.tabs.network' | translate }}\") ? \"\" : jade_interp)) + \"</a></li><li class=\\\"tab col s2\\\"><a href=\\\"#main.settings.currency\\\"><i class=\\\"fa fa-balance-scale\\\"> </i>\" + (jade.escape(null == (jade_interp = \" {{ 'settings.tabs.currency' | translate }}\") ? \"\" : jade_interp)) + \"</a></li><li class=\\\"tab col s2\\\"><a href=\\\"#main.settings.cpu\\\"><i class=\\\"fa fa-dashboard\\\"> </i>\" + (jade.escape(null == (jade_interp = \" {{ 'settings.tabs.cpu' | translate }}\") ? \"\" : jade_interp)) + \"</a></li></ul></div></div></div><div ui-view=\\\"\\\" class=\\\"ui-scrollable\\\"></div></main>\");;return buf.join(\"\");\n};\nif (typeof define === 'function' && define.amd) {\n define([], function() {\n return __templateData;\n });\n} else if (typeof module === 'object' && module && module.exports) {\n module.exports = __templateData;\n} else {\n __templateData;\n}","var __templateData = function template(locals) {\nvar buf = [];\nvar jade_mixins = {};\nvar jade_interp;\n\nbuf.push(\"<div class=\\\"container\\\"><div class=\\\"row\\\"><form class=\\\"s12 center\\\"><div class=\\\"card\\\"><div class=\\\"card-action\\\"><i class=\\\"fa fa-folder-open fa-5x\\\"></i><h1 translate=\\\"settings.data.backup.title\\\" class=\\\"card-title\\\"></h1><p translate=\\\"settings.data.backup.message\\\"></p><blockquote translate=\\\"settings.data.backup.warning\\\" class=\\\"left-align blue lighten-5\\\"></blockquote><div class=\\\"row\\\"><div class=\\\"col s12 m6\\\"><a ng-href=\\\"{{ export_link }}\\\" class=\\\"blue btn-large waves-effect waves-light\\\"><i class=\\\"left fa fa-save\\\"></i><span translate=\\\"settings.data.backup.button.export\\\"></span></a></div><div class=\\\"col s12 m6\\\"><button type=\\\"file\\\" ngf-select=\\\"uploadFiles($file, $invalidFiles)\\\" accept=\\\"zip/*\\\" ngf-max-size=\\\"100MB\\\" class=\\\"btn-large waves-effect waves-light\\\"><i class=\\\"left fa fa-download\\\"></i><span translate=\\\"settings.data.backup.button.import\\\"></span></button></div></div></div></div></form></div></div>\");;return buf.join(\"\");\n};\nif (typeof define === 'function' && define.amd) {\n define([], function() {\n return __templateData;\n });\n} else if (typeof module === 'object' && module && module.exports) {\n module.exports = __templateData;\n} else {\n __templateData;\n}","var __templateData = function template(locals) {\nvar buf = [];\nvar jade_mixins = {};\nvar jade_interp;\n\nbuf.push(\"<div class=\\\"container\\\"><div class=\\\"row\\\"><form class=\\\"s12 center\\\"><div class=\\\"card\\\"><div class=\\\"card-action\\\"><i class=\\\"fa fa-dashboard fa-5x\\\"></i><h1 translate=\\\"settings.cpu.title\\\" class=\\\"card-title\\\"></h1><p translate=\\\"settings.cpu.message\\\"></p><blockquote translate=\\\"settings.cpu.warning\\\" class=\\\"left-align blue lighten-5\\\"></blockquote><div class=\\\"row\\\"><p>{{ 'settings.cpu.range' | translate }}</p><div class=\\\"range-field\\\"><input ng-disabled=\\\"savingCPU\\\" type=\\\"range\\\" min=\\\"0\\\" max=\\\"100\\\" ng-model=\\\"cpuPower\\\" ng-mouseup=\\\"updateCPUpower()\\\"/></div></div><h1 class=\\\"card-title\\\">{{ 'settings.cpu.power' | translate }} {{ cpuPower }}%</h1></div></div></form></div></div>\");;return buf.join(\"\");\n};\nif (typeof define === 'function' && define.amd) {\n define([], function() {\n return __templateData;\n });\n} else if (typeof module === 'object' && module && module.exports) {\n module.exports = __templateData;\n} else {\n __templateData;\n}","var __templateData = function template(locals) {\nvar buf = [];\nvar jade_mixins = {};\nvar jade_interp;\n\nbuf.push(\"<div class=\\\"container\\\"><div class=\\\"row\\\"><form class=\\\"s12 center\\\"><div class=\\\"card\\\"><div class=\\\"card-action\\\"><i class=\\\"fa fa-key fa-5x\\\"></i><h1 translate=\\\"settings.key.title\\\" class=\\\"card-title\\\"></h1><div class=\\\"container\\\"><pre class=\\\"pubkey\\\">{{ pubkey }}</pre></div><p>{{ 'settings.key.pubkey.description' | translate }}</p><div class=\\\"container\\\"><div class=\\\"row\\\"><button ng-click=\\\"changeKey = true\\\" class=\\\"btn-large waves-effect waves-light\\\"><i class=\\\"fa fa-refresh left\\\"></i><span translate=\\\"settings.key.button.change\\\"></span></button></div></div><div ng-show=\\\"changeKey\\\" class=\\\"container\\\"><div class=\\\"row\\\"><div class=\\\"input-field col s12\\\"><i class=\\\"material-icons prefix\\\">vpn_key</i><input id=\\\"idty_entropy\\\" type=\\\"password\\\" ng-model=\\\"$parent.conf.idty_entropy\\\" data-position=\\\"top\\\" data-tooltip=\\\"{{ 'configuration.create_uid.entropy.tooltip' | translate }}\\\" class=\\\"tooltipped\\\"/><label for=\\\"idty_entropy\\\">{{ 'crypto.secret_key' | translate }}</label></div><div class=\\\"input-field col s12\\\"><i class=\\\"material-icons prefix\\\">vpn_key</i><input id=\\\"idty_password\\\" type=\\\"password\\\" ng-model=\\\"$parent.conf.idty_password\\\" data-position=\\\"top\\\" data-tooltip=\\\"{{ 'configuration.create_uid.password.tooltip' | translate }}\\\" class=\\\"tooltipped\\\"/><label for=\\\"idty_password\\\">Password</label></div><div class=\\\"input-field col s12\\\"><select disabled=\\\"disabled\\\"><option value=\\\"\\\" disabled=\\\"disabled\\\" translate=\\\"general.choose_option\\\"></option><option value=\\\"1\\\" selected=\\\"selected\\\" translate=\\\"configuration.create_uid.nrp_algo_choose_1\\\"></option><label>{{ 'configuration.create_uid.nrp_algo_choose' | translate }}</label></select></div><div class=\\\"input-field col s12\\\"><div ng-if=\\\"pubkey_preview\\\" class=\\\"container\\\"><h5 translate=\\\"configuration.create_uid.pubkey_preview\\\"></h5><pre class=\\\"pubkey\\\">{{ pubkey_preview }}</pre></div></div></div><div class=\\\"row\\\"><button ng-disabled=\\\"!$parent.conf.idty_entropy || !$parent.conf.idty_password\\\" ng-click=\\\"accept()\\\" class=\\\"btn-large waves-effect waves-light\\\"><i class=\\\"fa fa-check left\\\"></i><span translate=\\\"settings.key.button.validate\\\"></span></button></div></div></div></div></form></div></div>\");;return buf.join(\"\");\n};\nif (typeof define === 'function' && define.amd) {\n define([], function() {\n return __templateData;\n });\n} else if (typeof module === 'object' && module && module.exports) {\n module.exports = __templateData;\n} else {\n __templateData;\n}","var __templateData = function template(locals) {\nvar buf = [];\nvar jade_mixins = {};\nvar jade_interp;\n\nbuf.push(\"<div class=\\\"container\\\"><div class=\\\"row\\\"><form class=\\\"s12 center\\\"><div class=\\\"card\\\"><div class=\\\"card-action\\\"><i class=\\\"fa fa-balance-scale fa-5x\\\"></i><h1 translate=\\\"configuration.create_parameters.currency.title\\\" class=\\\"card-title\\\"></h1><div class=\\\"row\\\"><div class=\\\"input-field col s12\\\"><i class=\\\"prefix fa fa-quote-left\\\"></i><input id=\\\"currency\\\" type=\\\"text\\\" ng-model=\\\"$parent.conf.currency\\\"/><label for=\\\"currency\\\">{{ 'configuration.create_parameters.currency' | translate }}</label></div><div class=\\\"input-field col s6 m4\\\"><i class=\\\"prefix fa fa-line-chart\\\"></i><input id=\\\"c\\\" type=\\\"number\\\" ng-model=\\\"$parent.conf.c\\\"/><label for=\\\"c\\\">{{ 'configuration.create_parameters.c' | translate }}</label></div><div class=\\\"input-field col s6 m4\\\"><i class=\\\"prefix fa fa-hourglass-end\\\"></i><input id=\\\"dt\\\" type=\\\"number\\\" ng-model=\\\"$parent.conf.dt\\\"/><label for=\\\"dt\\\">{{ 'configuration.create_parameters.dt' | translate }}</label></div><div class=\\\"input-field col s6 m4\\\"><i class=\\\"prefix fa fa-money\\\"></i><input id=\\\"ud0\\\" type=\\\"number\\\" ng-model=\\\"$parent.conf.ud0\\\"/><label for=\\\"ud0\\\">{{ 'configuration.create_parameters.ud0' | translate }}</label></div></div><h1 translate=\\\"configuration.create_parameters.wot.title\\\" class=\\\"card-title\\\"></h1><div class=\\\"row\\\"><div class=\\\"input-field col s6 m4\\\"><i class=\\\"prefix fa fa-database\\\"></i><input id=\\\"sigStock\\\" type=\\\"number\\\" ng-model=\\\"$parent.conf.sigStock\\\"/><label for=\\\"sigStock\\\">{{ 'configuration.create_parameters.sigStock' | translate }}</label></div><div class=\\\"input-field col s6 m4\\\"><i class=\\\"prefix fa fa-hourglass-end\\\"></i><input id=\\\"sigPeriod\\\" type=\\\"number\\\" ng-model=\\\"$parent.conf.sigPeriod\\\"/><label for=\\\"sigPeriod\\\">{{ 'configuration.create_parameters.sigPeriod' | translate }}</label></div><div class=\\\"input-field col s6 m4\\\"><i class=\\\"prefix fa fa-battery-3\\\"></i><input id=\\\"sigValidity\\\" type=\\\"number\\\" ng-model=\\\"$parent.conf.sigValidity\\\"/><label for=\\\"sigValidity\\\">{{ 'configuration.create_parameters.sigValidity' | translate }}</label></div><div class=\\\"input-field col s6 m4\\\"><i class=\\\"prefix fa fa-battery-3\\\"></i><input id=\\\"msValidity\\\" type=\\\"number\\\" ng-model=\\\"$parent.conf.msValidity\\\"/><label for=\\\"msValidity\\\">{{ 'configuration.create_parameters.msValidity' | translate }}</label></div><div class=\\\"input-field col s6 m4\\\"><i class=\\\"prefix fa fa-certificate\\\"></i><input id=\\\"sigQty\\\" type=\\\"number\\\" ng-model=\\\"$parent.conf.sigQty\\\"/><label for=\\\"sigQty\\\">{{ 'configuration.create_parameters.sigQty' | translate }}</label></div><div class=\\\"input-field col s6 m4\\\"><i class=\\\"prefix fa fa-object-ungroup\\\"></i><input id=\\\"sigWindow\\\" type=\\\"number\\\" ng-model=\\\"$parent.conf.sigWindow\\\"/><label for=\\\"sigWindow\\\">{{ 'configuration.create_parameters.sigWindow' | translate }}</label></div><div class=\\\"input-field col s6 m4\\\"><i class=\\\"prefix fa fa-map-marker\\\"></i><input id=\\\"stepMax\\\" type=\\\"number\\\" ng-model=\\\"$parent.conf.stepMax\\\"/><label for=\\\"stepMax\\\">{{ 'configuration.create_parameters.stepMax' | translate }}</label></div><div class=\\\"input-field col s6 m4\\\"><i class=\\\"prefix fa fa-users\\\"></i><input id=\\\"xpercent\\\" type=\\\"number\\\" ng-model=\\\"$parent.conf.xpercent\\\"/><label for=\\\"xpercent\\\">{{ 'configuration.create_parameters.xpercent' | translate }}</label></div></div><h1 translate=\\\"configuration.create_parameters.blockchain.title\\\" class=\\\"card-title\\\"></h1><div class=\\\"row\\\"><div class=\\\"input-field col s6 m4\\\"><i class=\\\"prefix fa fa-chain\\\"></i><input id=\\\"medianTimeBlocks\\\" type=\\\"number\\\" ng-model=\\\"$parent.conf.medianTimeBlocks\\\"/><label for=\\\"medianTimeBlocks\\\">{{ 'configuration.create_parameters.medianTimeBlocks' | translate }}</label></div><div class=\\\"input-field col s6 m4\\\"><i class=\\\"prefix fa fa-hourglass-end\\\"></i><input id=\\\"avgGenTime\\\" type=\\\"number\\\" ng-model=\\\"$parent.conf.avgGenTime\\\"/><label for=\\\"avgGenTime\\\">{{ 'configuration.create_parameters.avgGenTime' | translate }}</label></div><div class=\\\"input-field col s6 m4\\\"><i class=\\\"prefix fa fa-cubes\\\"></i><input id=\\\"dtDiffEval\\\" type=\\\"number\\\" ng-model=\\\"$parent.conf.dtDiffEval\\\"/><label for=\\\"dtDiffEval\\\">{{ 'configuration.create_parameters.dtDiffEval' | translate }}</label></div><div class=\\\"input-field col s6 m4\\\"><i class=\\\"prefix fa fa-graduation-cap\\\"></i><input id=\\\"blocksRot\\\" type=\\\"number\\\" ng-model=\\\"$parent.conf.blocksRot\\\"/><label for=\\\"blocksRot\\\">{{ 'configuration.create_parameters.blocksRot' | translate }}</label></div><div class=\\\"input-field col s6 m4\\\"><i class=\\\"prefix fa fa-rotate-left\\\"></i><input id=\\\"percentRot\\\" type=\\\"number\\\" ng-model=\\\"$parent.conf.percentRot\\\"/><label for=\\\"percentRot\\\">{{ 'configuration.create_parameters.percentRot' | translate }}</label></div></div></div></div></form></div></div>\");;return buf.join(\"\");\n};\nif (typeof define === 'function' && define.amd) {\n define([], function() {\n return __templateData;\n });\n} else if (typeof module === 'object' && module && module.exports) {\n module.exports = __templateData;\n} else {\n __templateData;\n}","var __templateData = function template(locals) {\nvar buf = [];\nvar jade_mixins = {};\nvar jade_interp;\n\nbuf.push(\"<div class=\\\"container\\\"><div class=\\\"row\\\"><form class=\\\"s12 center\\\"><div class=\\\"card\\\"><div class=\\\"card-action\\\"><i class=\\\"fa fa-database fa-5x\\\"></i><h1 translate=\\\"settings.data.reset.title\\\" class=\\\"card-title\\\"></h1><p translate=\\\"settings.data.reset.message\\\"></p><blockquote translate=\\\"settings.data.reset.experimental\\\" class=\\\"left-align red lighten-5\\\"></blockquote><div class=\\\"row\\\"><div class=\\\"col s12\\\"><select ng-model=\\\"remote_host\\\" class=\\\"browser-default\\\"><option value=\\\"\\\" selected=\\\"selected\\\" translate=\\\"settings.data.reset.peer.none_option\\\"></option><option ng-repeat=\\\"p in peers\\\" value=\\\"{{ p.host_port }}\\\">{{ p.name }}</option></select><label>{{ 'settings.data.reset.peer.label' | translate }}</label></div></div><div class=\\\"row\\\"><div class=\\\"col s12 m6\\\"><button ng-click=\\\"resetNode()\\\" class=\\\"orange btn-large waves-effect waves-light\\\"><i class=\\\"left fa fa-warning\\\"></i><span translate=\\\"settings.data.reset.button\\\"></span></button></div><div class=\\\"col s12 m6\\\"><button ng-disabled=\\\"!remote_host\\\" ng-click=\\\"resetNodeAndSync()\\\" class=\\\"btn-large waves-effect waves-light\\\"><i class=\\\"left fa fa-check\\\"></i><span translate=\\\"settings.data.reset_sync.button\\\"></span></button></div></div></div></div></form></div></div>\");;return buf.join(\"\");\n};\nif (typeof define === 'function' && define.amd) {\n define([], function() {\n return __templateData;\n });\n} else if (typeof module === 'object' && module && module.exports) {\n module.exports = __templateData;\n} else {\n __templateData;\n}","var __templateData = function template(locals) {\nvar buf = [];\nvar jade_mixins = {};\nvar jade_interp;\n\nbuf.push(\"<div class=\\\"container\\\"><div class=\\\"row\\\"><div class=\\\"s12 center\\\"><div class=\\\"card\\\"><div class=\\\"card-action\\\"><i class=\\\"fa fa-newspaper-o fa-5x\\\"></i><h1 translate=\\\"settings.logs.title\\\" class=\\\"card-title\\\"></h1><p translate=\\\"settings.logs.consult.message\\\"></p><div class=\\\"row\\\"><div class=\\\"col s12\\\"><a ui-sref=\\\"logs\\\" target=\\\"_blank\\\" class=\\\"btn-large waves-effect waves-light\\\"><i class=\\\"fa fa-2x fa-search left\\\"></i><span>{{ 'settings.logs.consult.button' | translate }}</span></a></div></div></div><div class=\\\"card-action\\\"><blockquote translate=\\\"settings.logs.share.message\\\" class=\\\"left-align blue lighten-5\\\"></blockquote><div class=\\\"row\\\"><div class=\\\"col s12\\\"><a ng-click=\\\"shareLogs()\\\" ng-class=\\\"{ disabled: generating }\\\" class=\\\"blue btn-large waves-effect waves-light\\\"><i class=\\\"left fa fa-globe\\\"></i><span translate=\\\"settings.logs.share.button\\\"></span></a><pre ng-show=\\\"link || generating\\\" class=\\\"pre\\\"><div ng-if=\\\"generating\\\" class=\\\"preloader-wrapper active small\\\"><div class=\\\"spinner-layer spinner-blue-only\\\"><div class=\\\"circle-clipper left\\\"><div class=\\\"circle\\\"></div></div></div></div><div ng-if=\\\"generating\\\">{{ 'settings.logs.share.generating' | translate }}</div><a ng-href=\\\"{{ link }}\\\" target=\\\"_blank\\\">{{ link }}</a></pre><blockquote ng-show=\\\"error\\\" class=\\\"left-align red lighten-5\\\">{{ 'settings.logs.share.error' | translate }} <b>{{ error }}</b></blockquote></div></div></div></div></div></div></div>\");;return buf.join(\"\");\n};\nif (typeof define === 'function' && define.amd) {\n define([], function() {\n return __templateData;\n });\n} else if (typeof module === 'object' && module && module.exports) {\n module.exports = __templateData;\n} else {\n __templateData;\n}","var __templateData = function template(locals) {\nvar buf = [];\nvar jade_mixins = {};\nvar jade_interp;\n\nbuf.push(\"<div class=\\\"container\\\"><div class=\\\"row\\\"><form class=\\\"s12 center\\\"><div class=\\\"card\\\"><div class=\\\"card-action\\\"><i class=\\\"fa fa-globe fa-5x\\\"></i><h1 translate=\\\"configuration.create_network.title\\\" class=\\\"card-title\\\"></h1><div class=\\\"row\\\"><buttn ng-click=\\\"autoconfig()\\\" class=\\\"btn-large waves-effect waves-light\\\"><i class=\\\"left fa fa-magic\\\"></i><span translate=\\\"configuration.create_network.button.autoconf\\\"></span></buttn></div><div class=\\\"row\\\"><div class=\\\"col s12 m6 common-network\\\"><h1 translate=\\\"configuration.create_network.ipv6.title\\\" class=\\\"card-title\\\"></h1><p translate=\\\"configuration.create_network.ipv6.message\\\"></p><select ng-model=\\\"$parent.conf.local_ipv6\\\" class=\\\"browser-default\\\"><option value=\\\"\\\" selected=\\\"selected\\\" translate=\\\"configuration.create_network.none\\\"></option><option ng-repeat=\\\"inet in local_neti | filter : 'IPv6'\\\" value=\\\"{{ inet.addr }}\\\" ng-selected=\\\"{{inet.addr == $parent.conf.local_ipv6}}\\\">{{ inet.name }}</option></select><label>{{ 'configuration.create_network.local_ipv6' | translate }}</label></div><div class=\\\"col s12 m6 common-network\\\"><h1 translate=\\\"configuration.create_network.ipv4.title\\\" class=\\\"card-title\\\"></h1><p translate=\\\"configuration.create_network.ipv4.message\\\"></p><div class=\\\"col s12 m6\\\"><select ng-model=\\\"$parent.conf.local_ipv4\\\" class=\\\"browser-default\\\"><option value=\\\"\\\" translate=\\\"configuration.create_network.none\\\"></option><option ng-repeat=\\\"inet in local_neti | filter : 'IPv4'\\\" value=\\\"{{ inet.addr }}\\\" ng-selected=\\\"{{inet.addr == $parent.conf.local_ipv4}}\\\">{{ inet.name }}</option></select><label>{{ 'configuration.create_network.local_ipv4' | translate }}</label></div><div class=\\\"col s12 m6\\\"><select ng-model=\\\"$parent.conf.remote_ipv4\\\" class=\\\"browser-default\\\"><option value=\\\"\\\" selected=\\\"selected\\\" translate=\\\"configuration.create_network.none\\\"></option><option ng-repeat=\\\"inet in remote_neti | filter : 'IPv4'\\\" value=\\\"{{ inet.addr }}\\\" ng-selected=\\\"{{inet.addr == $parent.conf.remote_ipv4}}\\\">{{ inet.name }}</option></select><label>{{ 'configuration.create_network.remote_ipv4' | translate }}</label></div><div class=\\\"row\\\"></div><div class=\\\"col s12 m4 upnp\\\"><input id=\\\"upnp\\\" type=\\\"checkbox\\\" ng-model=\\\"$parent.conf.upnp\\\" class=\\\"filled-in\\\"/><label for=\\\"upnp\\\">{{ 'configuration.create_network.upnp' | translate }}</label></div></div><div class=\\\"row\\\"></div><div class=\\\"col s12 m6 common-network\\\"><h1 translate=\\\"configuration.create_network.port.title\\\" class=\\\"card-title\\\"></h1><p translate=\\\"configuration.create_network.port.message\\\"></p><div class=\\\"input-field col s6\\\"><i class=\\\"prefix fa fa-plug\\\"></i><input id=\\\"rport\\\" type=\\\"number\\\" ng-model=\\\"$parent.conf.rport\\\"/><label for=\\\"rport\\\">{{ 'configuration.create_network.port' | translate }}</label></div></div><div class=\\\"col s12 m6 common-network\\\"><h1 translate=\\\"configuration.create_network.dns.title\\\" class=\\\"card-title\\\"></h1><p translate=\\\"configuration.create_network.dns.message\\\"></p><div class=\\\"input-field\\\"><i class=\\\"prefix material-icons\\\">language</i><input id=\\\"dns\\\" type=\\\"text\\\" ng-model=\\\"$parent.conf.dns\\\"/><label for=\\\"dns\\\">{{ 'configuration.create_network.dns' | translate }}</label></div></div></div><div class=\\\"row\\\"><button ng-click=\\\"saveConf()\\\" class=\\\"btn-large waves-effect waves-light\\\"><i class=\\\"left fa fa-check\\\"></i><span translate=\\\"settings.network.button.validate\\\"></span></button></div></div></div></form></div></div>\");;return buf.join(\"\");\n};\nif (typeof define === 'function' && define.amd) {\n define([], function() {\n return __templateData;\n });\n} else if (typeof module === 'object' && module && module.exports) {\n module.exports = __templateData;\n} else {\n __templateData;\n}","var __templateData = function template(locals) {\nvar buf = [];\nvar jade_mixins = {};\nvar jade_interp;\n\nbuf.push(\"<ul id=\\\"slide-out\\\" class=\\\"side-nav\\\"><li><div class=\\\"card hide-on-med-and-up\\\"><div class=\\\"card-image\\\"><img src=\\\"images/menu_bg.jpg\\\"/><p class=\\\"card-title\\\"><span class=\\\"menu-title\\\">meta_brouzouf</span><span class=\\\"menu-speach\\\">22 members</span><span class=\\\"menu-footer\\\">DuniterUI v0.21.0</span></p></div></div></li><li><a ui-sref=\\\"home\\\" class=\\\"waves-effect waves-teal\\\"><i class=\\\"fa fa-2x fa-photo\\\"></i>\" + (jade.escape(null == (jade_interp = 'Overview') ? \"\" : jade_interp)) + \"</a></li><li><a ui-sref=\\\"graphs.blockchain\\\" class=\\\"waves-effect waves-teal\\\"><i class=\\\"fa fa-2x fa-area-chart\\\"></i>\" + (jade.escape(null == (jade_interp = 'Charts') ? \"\" : jade_interp)) + \"</a></li><li><a href=\\\"#!\\\" class=\\\"waves-effect waves-teal\\\"><i class=\\\"fa fa-2x fa-heartbeat\\\"></i>\" + (jade.escape(null == (jade_interp = 'Status') ? \"\" : jade_interp)) + \"</a></li><li><a ui-sref=\\\"settings.data\\\" class=\\\"waves-effect waves-teal\\\"><i class=\\\"fa fa-2x fa-gear\\\"></i>\" + (jade.escape(null == (jade_interp = 'Settings') ? \"\" : jade_interp)) + \"</a></li></ul>\");;return buf.join(\"\");\n};\nif (typeof define === 'function' && define.amd) {\n define([], function() {\n return __templateData;\n });\n} else if (typeof module === 'object' && module && module.exports) {\n module.exports = __templateData;\n} else {\n __templateData;\n}"]} \ No newline at end of file