{"version":3,"sources":["vendor/ember-cli/vendor-prefix.js","vendor/loader/loader.js","bower_components/jquery/dist/jquery.js","bower_components/ember/ember.debug.js","bower_components/ember-cli-shims/app-shims.js","vendor/modernizr-development.js","vendor/ember-load-initializers/legacy-shims.js","vendor/ember-resolver/legacy-shims.js","bower_components/semantic-ui/dist/semantic.js","bower_components/modernizr/src/Modernizr.js","ember-ajax/errors.js","ember-ajax/index.js","ember-ajax/make-promise.js","ember-ajax/raw.js","ember-ajax/request.js","ember-ajax/services/ajax.js","ember-ajax/utils/parse-args.js","ember-ajax/utils/parse-response-headers.js","ember-cli-app-version/components/app-version.js","ember-cli-app-version/initializer-factory.js","ember-cli-app-version/templates/app-version.js","ember-data/-private/adapters/build-url-mixin.js","ember-data/-private/adapters/errors.js","ember-data/-private/adapters.js","ember-data/-private/core.js","ember-data/-private/debug.js","ember-data/-private/ext/date.js","ember-data/-private/features.js","ember-data/-private/initializers/data-adapter.js","ember-data/-private/initializers/store-injections.js","ember-data/-private/initializers/store.js","ember-data/-private/initializers/transforms.js","ember-data/-private/instance-initializers/initialize-store-service.js","ember-data/-private/serializers.js","ember-data/-private/system/clone-null.js","ember-data/-private/system/coerce-id.js","ember-data/-private/system/container-proxy.js","ember-data/-private/system/debug/debug-adapter.js","ember-data/-private/system/debug/debug-info.js","ember-data/-private/system/debug.js","ember-data/-private/system/empty-object.js","ember-data/-private/system/is-array-like.js","ember-data/-private/system/many-array.js","ember-data/-private/system/model/attr.js","ember-data/-private/system/model/errors.js","ember-data/-private/system/model/internal-model.js","ember-data/-private/system/model/model.js","ember-data/-private/system/model/states.js","ember-data/-private/system/model.js","ember-data/-private/system/normalize-link.js","ember-data/-private/system/normalize-model-name.js","ember-data/-private/system/ordered-set.js","ember-data/-private/system/promise-proxies.js","ember-data/-private/system/record-array-manager.js","ember-data/-private/system/record-arrays/adapter-populated-record-array.js","ember-data/-private/system/record-arrays/filtered-record-array.js","ember-data/-private/system/record-arrays/record-array.js","ember-data/-private/system/record-arrays.js","ember-data/-private/system/references/belongs-to.js","ember-data/-private/system/references/has-many.js","ember-data/-private/system/references/record.js","ember-data/-private/system/references/reference.js","ember-data/-private/system/references.js","ember-data/-private/system/relationship-meta.js","ember-data/-private/system/relationships/belongs-to.js","ember-data/-private/system/relationships/ext.js","ember-data/-private/system/relationships/has-many.js","ember-data/-private/system/relationships/state/belongs-to.js","ember-data/-private/system/relationships/state/create.js","ember-data/-private/system/relationships/state/has-many.js","ember-data/-private/system/relationships/state/relationship.js","ember-data/-private/system/snapshot-record-array.js","ember-data/-private/system/snapshot.js","ember-data/-private/system/store/common.js","ember-data/-private/system/store/container-instance-cache.js","ember-data/-private/system/store/finders.js","ember-data/-private/system/store/serializer-response.js","ember-data/-private/system/store/serializers.js","ember-data/-private/system/store.js","ember-data/-private/transforms/boolean.js","ember-data/-private/transforms/date.js","ember-data/-private/transforms/number.js","ember-data/-private/transforms/string.js","ember-data/-private/transforms.js","ember-data/-private/utils/parse-response-headers.js","ember-data/-private/utils.js","ember-data/adapter.js","ember-data/adapters/json-api.js","ember-data/adapters/rest.js","ember-data/attr.js","ember-data/index.js","ember-data/model.js","ember-data/relationships.js","ember-data/serializer.js","ember-data/serializers/embedded-records-mixin.js","ember-data/serializers/json-api.js","ember-data/serializers/json.js","ember-data/serializers/rest.js","ember-data/setup-container.js","ember-data/store.js","ember-data/transform.js","ember-data/version.js","ember-inflector/index.js","ember-inflector/lib/ext/string.js","ember-inflector/lib/helpers/pluralize.js","ember-inflector/lib/helpers/singularize.js","ember-inflector/lib/system/inflections.js","ember-inflector/lib/system/inflector.js","ember-inflector/lib/system/string.js","ember-inflector/lib/system.js","ember-inflector/lib/utils/make-helper.js","ember-load-initializers/index.js","ember-resolver/container-debug-adapter.js","ember-resolver/index.js","ember-resolver/resolver.js","ember-resolver/utils/class-factory.js","ember-resolver/utils/create.js","ember-resolver/utils/make-dictionary.js","ember-resolver/utils/module-registry.js","semantic-ui-ember/components/ui-accordion.js","semantic-ui-ember/components/ui-checkbox.js","semantic-ui-ember/components/ui-dropdown-array.js","semantic-ui-ember/components/ui-dropdown.js","semantic-ui-ember/components/ui-embed.js","semantic-ui-ember/components/ui-modal.js","semantic-ui-ember/components/ui-nag.js","semantic-ui-ember/components/ui-popup.js","semantic-ui-ember/components/ui-progress.js","semantic-ui-ember/components/ui-radio.js","semantic-ui-ember/components/ui-rating.js","semantic-ui-ember/components/ui-search.js","semantic-ui-ember/components/ui-shape.js","semantic-ui-ember/components/ui-sidebar.js","semantic-ui-ember/components/ui-sticky.js","semantic-ui-ember/mixins/base.js","semantic-ui-ember/mixins/checkbox-mixin.js","semantic-ui-ember/mixins/data-attributes.js","semantic-ui-ember/semantic.js","vendor/ember-cli/vendor-suffix.js"],"sourcesContent":["/* jshint ignore:start */\n\nwindow.EmberENV = {\"FEATURES\":{}};\nvar runningTests = false;\n\n\n\n/* jshint ignore:end */\n","var loader, define, requireModule, require, requirejs;\n\n(function(global) {\n 'use strict';\n\n // Save off the original values of these globals, so we can restore them if someone asks us to\n var oldGlobals = {\n loader: loader,\n define: define,\n requireModule: requireModule,\n require: require,\n requirejs: requirejs\n };\n\n loader = {\n noConflict: function(aliases) {\n var oldName, newName;\n\n for (oldName in aliases) {\n if (aliases.hasOwnProperty(oldName)) {\n if (oldGlobals.hasOwnProperty(oldName)) {\n newName = aliases[oldName];\n\n global[newName] = global[oldName];\n global[oldName] = oldGlobals[oldName];\n }\n }\n }\n }\n };\n\n var _isArray;\n if (!Array.isArray) {\n _isArray = function (x) {\n return Object.prototype.toString.call(x) === '[object Array]';\n };\n } else {\n _isArray = Array.isArray;\n }\n\n var registry = {};\n var seen = {};\n var FAILED = false;\n var LOADED = true;\n\n var uuid = 0;\n\n function unsupportedModule(length) {\n throw new Error('an unsupported module was defined, expected `define(name, deps, module)` instead got: `' +\n length + '` arguments to define`');\n }\n\n var defaultDeps = ['require', 'exports', 'module'];\n\n function Module(name, deps, callback, alias) {\n this.id = uuid++;\n this.name = name;\n this.deps = !deps.length && callback.length ? defaultDeps : deps;\n this.module = { exports: {} };\n this.callback = callback;\n this.state = undefined;\n this.finalized = false;\n this.hasExportsAsDep = false;\n this.isAlias = alias;\n this.reified = new Array(deps.length);\n }\n\n Module.prototype.makeDefaultExport = function() {\n var exports = this.module.exports;\n if (exports !== null &&\n (typeof exports === 'object' || typeof exports === 'function') &&\n exports['default'] === undefined) {\n exports['default'] = exports;\n }\n };\n\n Module.prototype.exports = function() {\n if (this.finalized) {\n return this.module.exports;\n } else {\n if (loader.wrapModules) {\n this.callback = loader.wrapModules(this.name, this.callback);\n }\n var result = this.callback.apply(this, this.reified);\n if (!(this.hasExportsAsDep && result === undefined)) {\n this.module.exports = result;\n }\n this.makeDefaultExport();\n this.finalized = true;\n return this.module.exports;\n }\n };\n\n Module.prototype.unsee = function() {\n this.finalized = false;\n this.state = undefined;\n this.module = { exports: {}};\n };\n\n Module.prototype.reify = function() {\n var deps = this.deps;\n var dep;\n var reified = this.reified;\n\n for (var i = 0; i < deps.length; i++) {\n dep = deps[i];\n if (dep === 'exports') {\n this.hasExportsAsDep = true;\n reified[i] = this.module.exports;\n } else if (dep === 'require') {\n reified[i] = this.makeRequire();\n } else if (dep === 'module') {\n reified[i] = this.module;\n } else {\n reified[i] = findModule(resolve(dep, this.name), this.name).module.exports;\n }\n }\n };\n\n Module.prototype.makeRequire = function() {\n var name = this.name;\n var r = function(dep) {\n return require(resolve(dep, name));\n };\n r['default'] = r;\n r.has = function(dep) {\n return has(resolve(dep, name));\n }\n return r;\n };\n\n Module.prototype.build = function() {\n if (this.state === FAILED || this.state === LOADED) { return; }\n this.state = FAILED;\n this.reify()\n this.exports();\n this.state = LOADED;\n };\n\n define = function(name, deps, callback) {\n if (arguments.length < 2) {\n unsupportedModule(arguments.length);\n }\n\n if (!_isArray(deps)) {\n callback = deps;\n deps = [];\n }\n\n if (callback instanceof Alias) {\n registry[name] = new Module(callback.name, deps, callback, true);\n } else {\n registry[name] = new Module(name, deps, callback, false);\n }\n };\n\n // we don't support all of AMD\n // define.amd = {};\n // we will support petals...\n define.petal = { };\n\n function Alias(path) {\n this.name = path;\n }\n\n define.alias = function(path) {\n return new Alias(path);\n };\n\n function missingModule(name, referrer) {\n throw new Error('Could not find module `' + name + '` imported from `' + referrer + '`');\n }\n\n requirejs = require = requireModule = function(name) {\n return findModule(name, '(require)').module.exports;\n };\n\n function findModule(name, referrer) {\n var mod = registry[name] || registry[name + '/index'];\n\n while (mod && mod.isAlias) {\n mod = registry[mod.name];\n }\n\n if (!mod) { missingModule(name, referrer); }\n\n mod.build();\n return mod;\n }\n\n function resolve(child, name) {\n if (child.charAt(0) !== '.') { return child; }\n\n var parts = child.split('/');\n var nameParts = name.split('/');\n var parentBase = nameParts.slice(0, -1);\n\n for (var i = 0, l = parts.length; i < l; i++) {\n var part = parts[i];\n\n if (part === '..') {\n if (parentBase.length === 0) {\n throw new Error('Cannot access parent module of root');\n }\n parentBase.pop();\n } else if (part === '.') {\n continue;\n } else { parentBase.push(part); }\n }\n\n return parentBase.join('/');\n }\n\n function has(name) {\n return !!(registry[name] || registry[name + '/index']);\n }\n\n requirejs.entries = requirejs._eak_seen = registry;\n requirejs.has = has;\n requirejs.unsee = function(moduleName) {\n findModule(moduleName, '(unsee)').unsee();\n };\n\n requirejs.clear = function() {\n requirejs.entries = requirejs._eak_seen = registry = {};\n seen = {};\n };\n\n // prime\n define('foo', function() {});\n define('foo/bar', [], function() {});\n define('foo/asdf', ['module', 'exports', 'require'], function(module, exports, require) {\n if (require.has('foo/bar')) {\n require('foo/bar');\n }\n });\n define('foo/baz', [], define.alias('foo'));\n define('foo/quz', define.alias('foo'));\n define('foo/bar', ['foo', './quz', './baz', './asdf', './bar', '../foo'], function() {});\n define('foo/main', ['foo/bar'], function() {});\n\n require('foo/main');\n require.unsee('foo/bar');\n\n requirejs.clear();\n\n if (typeof exports === 'object' && typeof module === 'object' && module.exports) {\n module.exports = { require: require, define: define };\n }\n})(this);\n","/*!\n * jQuery JavaScript Library v2.2.3\n * http://jquery.com/\n *\n * Includes Sizzle.js\n * http://sizzlejs.com/\n *\n * Copyright jQuery Foundation and other contributors\n * Released under the MIT license\n * http://jquery.org/license\n *\n * Date: 2016-04-05T19:26Z\n */\n\n(function( global, factory ) {\n\n\tif ( typeof module === \"object\" && typeof module.exports === \"object\" ) {\n\t\t// For CommonJS and CommonJS-like environments where a proper `window`\n\t\t// is present, execute the factory and get jQuery.\n\t\t// For environments that do not have a `window` with a `document`\n\t\t// (such as Node.js), expose a factory as module.exports.\n\t\t// This accentuates the need for the creation of a real `window`.\n\t\t// e.g. var jQuery = require(\"jquery\")(window);\n\t\t// See ticket #14549 for more info.\n\t\tmodule.exports = global.document ?\n\t\t\tfactory( global, true ) :\n\t\t\tfunction( w ) {\n\t\t\t\tif ( !w.document ) {\n\t\t\t\t\tthrow new Error( \"jQuery requires a window with a document\" );\n\t\t\t\t}\n\t\t\t\treturn factory( w );\n\t\t\t};\n\t} else {\n\t\tfactory( global );\n\t}\n\n// Pass this if window is not defined yet\n}(typeof window !== \"undefined\" ? window : this, function( window, noGlobal ) {\n\n// Support: Firefox 18+\n// Can't be in strict mode, several libs 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//\"use strict\";\nvar arr = [];\n\nvar document = window.document;\n\nvar slice = arr.slice;\n\nvar concat = arr.concat;\n\nvar push = arr.push;\n\nvar indexOf = arr.indexOf;\n\nvar class2type = {};\n\nvar toString = class2type.toString;\n\nvar hasOwn = class2type.hasOwnProperty;\n\nvar support = {};\n\n\n\nvar\n\tversion = \"2.2.3\",\n\n\t// Define a local copy of jQuery\n\tjQuery = function( selector, context ) {\n\n\t\t// The jQuery object is actually just the init constructor 'enhanced'\n\t\t// Need init if jQuery is called (just allow error to be thrown if not included)\n\t\treturn new jQuery.fn.init( selector, context );\n\t},\n\n\t// Support: Android<4.1\n\t// Make sure we trim BOM and NBSP\n\trtrim = /^[\\s\\uFEFF\\xA0]+|[\\s\\uFEFF\\xA0]+$/g,\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\njQuery.fn = jQuery.prototype = {\n\n\t// The current version of jQuery being used\n\tjquery: version,\n\n\tconstructor: jQuery,\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 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 just the one element from the set\n\t\t\t( num < 0 ? this[ num + this.length ] : this[ num ] ) :\n\n\t\t\t// Return all the elements in a clean array\n\t\t\tslice.call( this );\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\teach: function( callback ) {\n\t\treturn jQuery.each( this, callback );\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\tslice: function() {\n\t\treturn this.pushStack( 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\tend: function() {\n\t\treturn this.prevObject || this.constructor();\n\t},\n\n\t// For internal use only.\n\t// Behaves like an Array's method, not like a jQuery method.\n\tpush: push,\n\tsort: arr.sort,\n\tsplice: arr.splice\n};\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\n\t\t// Skip the boolean and the target\n\t\ttarget = arguments[ i ] || {};\n\t\ti++;\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 ( i === length ) {\n\t\ttarget = this;\n\t\ti--;\n\t}\n\n\tfor ( ; i < length; i++ ) {\n\n\t\t// Only deal with non-null/undefined values\n\t\tif ( ( options = arguments[ i ] ) != null ) {\n\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 ) ||\n\t\t\t\t\t( copyIsArray = jQuery.isArray( copy ) ) ) ) {\n\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\n\t// Unique for each copy of jQuery on the page\n\texpando: \"jQuery\" + ( version + Math.random() ).replace( /\\D/g, \"\" ),\n\n\t// Assume jQuery is ready without the ready module\n\tisReady: true,\n\n\terror: function( msg ) {\n\t\tthrow new Error( msg );\n\t},\n\n\tnoop: function() {},\n\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\n\t\t// parseFloat NaNs numeric-cast false positives (null|true|false|\"\")\n\t\t// ...but misinterprets leading-number strings, particularly hex literals (\"0x...\")\n\t\t// subtraction forces infinities to NaN\n\t\t// adding 1 corrects loss of precision from parseFloat (#15100)\n\t\tvar realStringObj = obj && obj.toString();\n\t\treturn !jQuery.isArray( obj ) && ( realStringObj - parseFloat( realStringObj ) + 1 ) >= 0;\n\t},\n\n\tisPlainObject: function( obj ) {\n\t\tvar key;\n\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// Not own constructor property must be Object\n\t\tif ( obj.constructor &&\n\t\t\t\t!hasOwn.call( obj, \"constructor\" ) &&\n\t\t\t\t!hasOwn.call( obj.constructor.prototype || {}, \"isPrototypeOf\" ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Own properties are enumerated firstly, so to speed up,\n\t\t// if last one is own, then all properties are own\n\t\tfor ( key in obj ) {}\n\n\t\treturn key === undefined || hasOwn.call( obj, key );\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\ttype: function( obj ) {\n\t\tif ( obj == null ) {\n\t\t\treturn obj + \"\";\n\t\t}\n\n\t\t// Support: Android<4.0, iOS<6 (functionish RegExp)\n\t\treturn typeof obj === \"object\" || typeof obj === \"function\" ?\n\t\t\tclass2type[ toString.call( obj ) ] || \"object\" :\n\t\t\ttypeof obj;\n\t},\n\n\t// Evaluates a script in a global context\n\tglobalEval: function( code ) {\n\t\tvar script,\n\t\t\tindirect = eval;\n\n\t\tcode = jQuery.trim( code );\n\n\t\tif ( code ) {\n\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\n\t\t\t\t// Otherwise, avoid the DOM node creation, insertion\n\t\t\t\t// and removal by using an indirect global eval\n\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// Support: IE9-11+\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\teach: function( obj, callback ) {\n\t\tvar length, i = 0;\n\n\t\tif ( isArrayLike( obj ) ) {\n\t\t\tlength = obj.length;\n\t\t\tfor ( ; i < length; i++ ) {\n\t\t\t\tif ( callback.call( obj[ i ], i, obj[ i ] ) === false ) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tfor ( i in obj ) {\n\t\t\t\tif ( callback.call( obj[ i ], i, obj[ i ] ) === false ) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn obj;\n\t},\n\n\t// Support: Android<4.1\n\ttrim: function( text ) {\n\t\treturn text == null ?\n\t\t\t\"\" :\n\t\t\t( text + \"\" ).replace( rtrim, \"\" );\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\tpush.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 : indexOf.call( arr, elem, i );\n\t},\n\n\tmerge: function( first, second ) {\n\t\tvar len = +second.length,\n\t\t\tj = 0,\n\t\t\ti = first.length;\n\n\t\tfor ( ; j < len; j++ ) {\n\t\t\tfirst[ i++ ] = second[ j ];\n\t\t}\n\n\t\tfirst.length = i;\n\n\t\treturn first;\n\t},\n\n\tgrep: function( elems, callback, invert ) {\n\t\tvar callbackInverse,\n\t\t\tmatches = [],\n\t\t\ti = 0,\n\t\t\tlength = elems.length,\n\t\t\tcallbackExpect = !invert;\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\tcallbackInverse = !callback( elems[ i ], i );\n\t\t\tif ( callbackInverse !== callbackExpect ) {\n\t\t\t\tmatches.push( elems[ i ] );\n\t\t\t}\n\t\t}\n\n\t\treturn matches;\n\t},\n\n\t// arg is for internal usage only\n\tmap: function( elems, callback, arg ) {\n\t\tvar length, value,\n\t\t\ti = 0,\n\t\t\tret = [];\n\n\t\t// Go through the array, translating each of the items to their new values\n\t\tif ( isArrayLike( elems ) ) {\n\t\t\tlength = elems.length;\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.push( 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.push( value );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Flatten any nested arrays\n\t\treturn 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 = slice.call( arguments, 2 );\n\t\tproxy = function() {\n\t\t\treturn fn.apply( context || this, args.concat( 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\tnow: Date.now,\n\n\t// jQuery.support is not used in Core but other projects attach their\n\t// properties to it so it needs to exist.\n\tsupport: support\n} );\n\n// JSHint would error on this code due to the Symbol not being defined in ES5.\n// Defining this global in .jshintrc would create a danger of using the global\n// unguarded in another place, it seems safer to just disable JSHint for these\n// three lines.\n/* jshint ignore: start */\nif ( typeof Symbol === \"function\" ) {\n\tjQuery.fn[ Symbol.iterator ] = arr[ Symbol.iterator ];\n}\n/* jshint ignore: end */\n\n// Populate the class2type map\njQuery.each( \"Boolean Number String Function Array Date RegExp Object Error Symbol\".split( \" \" ),\nfunction( i, name ) {\n\tclass2type[ \"[object \" + name + \"]\" ] = name.toLowerCase();\n} );\n\nfunction isArrayLike( obj ) {\n\n\t// Support: iOS 8.2 (not reproducible in simulator)\n\t// `in` check used to prevent JIT error (gh-2145)\n\t// hasOwn isn't used here due to false negatives\n\t// regarding Nodelist length in IE\n\tvar length = !!obj && \"length\" in obj && obj.length,\n\t\ttype = jQuery.type( obj );\n\n\tif ( type === \"function\" || jQuery.isWindow( obj ) ) {\n\t\treturn false;\n\t}\n\n\treturn type === \"array\" || length === 0 ||\n\t\ttypeof length === \"number\" && length > 0 && ( length - 1 ) in obj;\n}\nvar Sizzle =\n/*!\n * Sizzle CSS Selector Engine v2.2.1\n * http://sizzlejs.com/\n *\n * Copyright jQuery Foundation and other contributors\n * Released under the MIT license\n * http://jquery.org/license\n *\n * Date: 2015-10-17\n */\n(function( window ) {\n\nvar i,\n\tsupport,\n\tExpr,\n\tgetText,\n\tisXML,\n\ttokenize,\n\tcompile,\n\tselect,\n\toutermostContext,\n\tsortInput,\n\thasDuplicate,\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\" + 1 * new Date(),\n\tpreferredDoc = window.document,\n\tdirruns = 0,\n\tdone = 0,\n\tclassCache = createCache(),\n\ttokenCache = createCache(),\n\tcompilerCache = createCache(),\n\tsortOrder = function( a, b ) {\n\t\tif ( a === b ) {\n\t\t\thasDuplicate = true;\n\t\t}\n\t\treturn 0;\n\t},\n\n\t// General-purpose constants\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 as it's faster than native\n\t// http://jsperf.com/thor-indexof-vs-for/5\n\tindexOf = function( list, elem ) {\n\t\tvar i = 0,\n\t\t\tlen = list.length;\n\t\tfor ( ; i < len; i++ ) {\n\t\t\tif ( list[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// http://www.w3.org/TR/css3-selectors/#whitespace\n\twhitespace = \"[\\\\x20\\\\t\\\\r\\\\n\\\\f]\",\n\n\t// http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier\n\tidentifier = \"(?:\\\\\\\\.|[\\\\w-]|[^\\\\x00-\\\\xa0])+\",\n\n\t// Attribute selectors: http://www.w3.org/TR/selectors/#attribute-selectors\n\tattributes = \"\\\\[\" + whitespace + \"*(\" + identifier + \")(?:\" + whitespace +\n\t\t// Operator (capture 2)\n\t\t\"*([*^$|!~]?=)\" + whitespace +\n\t\t// \"Attribute values must be CSS identifiers [capture 5] or strings [capture 3 or capture 4]\"\n\t\t\"*(?:'((?:\\\\\\\\.|[^\\\\\\\\'])*)'|\\\"((?:\\\\\\\\.|[^\\\\\\\\\\\"])*)\\\"|(\" + identifier + \"))|)\" + whitespace +\n\t\t\"*\\\\]\",\n\n\tpseudos = \":(\" + identifier + \")(?:\\\\((\" +\n\t\t// To reduce the number of selectors needing tokenize in the preFilter, prefer arguments:\n\t\t// 1. quoted (capture 3; capture 4 or capture 5)\n\t\t\"('((?:\\\\\\\\.|[^\\\\\\\\'])*)'|\\\"((?:\\\\\\\\.|[^\\\\\\\\\\\"])*)\\\")|\" +\n\t\t// 2. simple (capture 6)\n\t\t\"((?:\\\\\\\\.|[^\\\\\\\\()[\\\\]]|\" + attributes + \")*)|\" +\n\t\t// 3. anything else (capture 2)\n\t\t\".*\" +\n\t\t\")\\\\)|)\",\n\n\t// Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter\n\trwhitespace = new RegExp( whitespace + \"+\", \"g\" ),\n\trtrim = new RegExp( \"^\" + whitespace + \"+|((?:^|[^\\\\\\\\])(?:\\\\\\\\.)*)\" + whitespace + \"+$\", \"g\" ),\n\n\trcomma = new RegExp( \"^\" + whitespace + \"*,\" + whitespace + \"*\" ),\n\trcombinators = new RegExp( \"^\" + whitespace + \"*([>+~]|\" + whitespace + \")\" + whitespace + \"*\" ),\n\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( \"^#(\" + identifier + \")\" ),\n\t\t\"CLASS\": new RegExp( \"^\\\\.(\" + identifier + \")\" ),\n\t\t\"TAG\": new RegExp( \"^(\" + identifier + \"|[*])\" ),\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\trinputs = /^(?:input|select|textarea|button)$/i,\n\trheader = /^h\\d$/i,\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\trsibling = /[+~]/,\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<24\n\t\t// Workaround erroneous numeric interpretation of +\"0x\"\n\t\treturn high !== high || escapedWhitespace ?\n\t\t\tescaped :\n\t\t\thigh < 0 ?\n\t\t\t\t// BMP codepoint\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\t// Used for iframes\n\t// See setDocument()\n\t// Removing the function wrapper causes a \"Permission Denied\"\n\t// error in IE\n\tunloadHandler = function() {\n\t\tsetDocument();\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 m, i, elem, nid, nidselect, match, groups, newSelector,\n\t\tnewContext = context && context.ownerDocument,\n\n\t\t// nodeType defaults to 9, since context defaults to document\n\t\tnodeType = context ? context.nodeType : 9;\n\n\tresults = results || [];\n\n\t// Return early from calls with invalid selector or context\n\tif ( typeof selector !== \"string\" || !selector ||\n\t\tnodeType !== 1 && nodeType !== 9 && nodeType !== 11 ) {\n\n\t\treturn results;\n\t}\n\n\t// Try to shortcut find operations (as opposed to filters) in HTML documents\n\tif ( !seed ) {\n\n\t\tif ( ( context ? context.ownerDocument || context : preferredDoc ) !== document ) {\n\t\t\tsetDocument( context );\n\t\t}\n\t\tcontext = context || document;\n\n\t\tif ( documentIsHTML ) {\n\n\t\t\t// If the selector is sufficiently simple, try using a \"get*By*\" DOM method\n\t\t\t// (excepting DocumentFragment context, where the methods don't exist)\n\t\t\tif ( nodeType !== 11 && (match = rquickExpr.exec( selector )) ) {\n\n\t\t\t\t// ID selector\n\t\t\t\tif ( (m = match[1]) ) {\n\n\t\t\t\t\t// Document context\n\t\t\t\t\tif ( nodeType === 9 ) {\n\t\t\t\t\t\tif ( (elem = context.getElementById( m )) ) {\n\n\t\t\t\t\t\t\t// Support: IE, Opera, Webkit\n\t\t\t\t\t\t\t// TODO: identify versions\n\t\t\t\t\t\t\t// getElementById can match elements by name instead of ID\n\t\t\t\t\t\t\tif ( elem.id === m ) {\n\t\t\t\t\t\t\t\tresults.push( elem );\n\t\t\t\t\t\t\t\treturn results;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\treturn results;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t// Element context\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\t// Support: IE, Opera, Webkit\n\t\t\t\t\t\t// TODO: identify versions\n\t\t\t\t\t\t// getElementById can match elements by name instead of ID\n\t\t\t\t\t\tif ( newContext && (elem = newContext.getElementById( m )) &&\n\t\t\t\t\t\t\tcontains( context, elem ) &&\n\t\t\t\t\t\t\telem.id === m ) {\n\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}\n\n\t\t\t\t// Type selector\n\t\t\t\t} else if ( match[2] ) {\n\t\t\t\t\tpush.apply( results, context.getElementsByTagName( selector ) );\n\t\t\t\t\treturn results;\n\n\t\t\t\t// Class selector\n\t\t\t\t} else if ( (m = match[3]) && support.getElementsByClassName &&\n\t\t\t\t\tcontext.getElementsByClassName ) {\n\n\t\t\t\t\tpush.apply( results, context.getElementsByClassName( m ) );\n\t\t\t\t\treturn results;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Take advantage of querySelectorAll\n\t\t\tif ( support.qsa &&\n\t\t\t\t!compilerCache[ selector + \" \" ] &&\n\t\t\t\t(!rbuggyQSA || !rbuggyQSA.test( selector )) ) {\n\n\t\t\t\tif ( nodeType !== 1 ) {\n\t\t\t\t\tnewContext = context;\n\t\t\t\t\tnewSelector = selector;\n\n\t\t\t\t// qSA looks outside Element context, which is not what we want\n\t\t\t\t// Thanks to Andrew Dupont for this workaround technique\n\t\t\t\t// Support: IE <=8\n\t\t\t\t// Exclude object elements\n\t\t\t\t} else if ( context.nodeName.toLowerCase() !== \"object\" ) {\n\n\t\t\t\t\t// Capture the context ID, setting it first if necessary\n\t\t\t\t\tif ( (nid = context.getAttribute( \"id\" )) ) {\n\t\t\t\t\t\tnid = nid.replace( rescape, \"\\\\$&\" );\n\t\t\t\t\t} else {\n\t\t\t\t\t\tcontext.setAttribute( \"id\", (nid = expando) );\n\t\t\t\t\t}\n\n\t\t\t\t\t// Prefix every selector in the list\n\t\t\t\t\tgroups = tokenize( selector );\n\t\t\t\t\ti = groups.length;\n\t\t\t\t\tnidselect = ridentifier.test( nid ) ? \"#\" + nid : \"[id='\" + nid + \"']\";\n\t\t\t\t\twhile ( i-- ) {\n\t\t\t\t\t\tgroups[i] = nidselect + \" \" + toSelector( groups[i] );\n\t\t\t\t\t}\n\t\t\t\t\tnewSelector = groups.join( \",\" );\n\n\t\t\t\t\t// Expand context for sibling selectors\n\t\t\t\t\tnewContext = rsibling.test( selector ) && testContext( context.parentNode ) ||\n\t\t\t\t\t\tcontext;\n\t\t\t\t}\n\n\t\t\t\tif ( newSelector ) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tpush.apply( results,\n\t\t\t\t\t\t\tnewContext.querySelectorAll( newSelector )\n\t\t\t\t\t\t);\n\t\t\t\t\t\treturn results;\n\t\t\t\t\t} catch ( qsaError ) {\n\t\t\t\t\t} finally {\n\t\t\t\t\t\tif ( nid === expando ) {\n\t\t\t\t\t\t\tcontext.removeAttribute( \"id\" );\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\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 = arr.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 * Checks a node for validity as a Sizzle context\n * @param {Element|Object=} context\n * @returns {Element|Object|Boolean} The input node if acceptable, otherwise a falsy value\n */\nfunction testContext( context ) {\n\treturn context && typeof context.getElementsByTagName !== \"undefined\" && context;\n}\n\n// Expose support vars for convenience\nsupport = Sizzle.support = {};\n\n/**\n * Detects XML nodes\n * @param {Element|Object} elem An element or a document\n * @returns {Boolean} True iff elem is a non-HTML XML node\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/**\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 hasCompare, parent,\n\t\tdoc = node ? node.ownerDocument || node : preferredDoc;\n\n\t// Return early if doc is invalid or already selected\n\tif ( doc === document || doc.nodeType !== 9 || !doc.documentElement ) {\n\t\treturn document;\n\t}\n\n\t// Update global variables\n\tdocument = doc;\n\tdocElem = document.documentElement;\n\tdocumentIsHTML = !isXML( document );\n\n\t// Support: IE 9-11, Edge\n\t// Accessing iframe documents after unload throws \"permission denied\" errors (jQuery #13936)\n\tif ( (parent = document.defaultView) && parent.top !== parent ) {\n\t\t// Support: IE 11\n\t\tif ( parent.addEventListener ) {\n\t\t\tparent.addEventListener( \"unload\", unloadHandler, false );\n\n\t\t// Support: IE 9 - 10 only\n\t\t} else if ( parent.attachEvent ) {\n\t\t\tparent.attachEvent( \"onunload\", unloadHandler );\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\n\t// (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( document.createComment(\"\") );\n\t\treturn !div.getElementsByTagName(\"*\").length;\n\t});\n\n\t// Support: IE<9\n\tsupport.getElementsByClassName = rnative.test( document.getElementsByClassName );\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 !document.getElementsByName || !document.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 !== \"undefined\" && documentIsHTML ) {\n\t\t\t\tvar m = context.getElementById( id );\n\t\t\t\treturn m ? [ 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 !== \"undefined\" &&\n\t\t\t\t\telem.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 !== \"undefined\" ) {\n\t\t\t\treturn context.getElementsByTagName( tag );\n\n\t\t\t// DocumentFragment nodes don't have gEBTN\n\t\t\t} else if ( support.qsa ) {\n\t\t\t\treturn context.querySelectorAll( tag );\n\t\t\t}\n\t\t} :\n\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\t// By happy coincidence, a (broken) gEBTN appears on DocumentFragment nodes too\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 !== \"undefined\" && 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( document.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\tdocElem.appendChild( div ).innerHTML = \"\" +\n\t\t\t\t\"\" +\n\t\t\t\t\"\";\n\n\t\t\t// Support: IE8, Opera 11-12.16\n\t\t\t// Nothing should be selected when empty strings follow ^= or $= or *=\n\t\t\t// The test attribute must be unknown in Opera but \"safe\" for WinRT\n\t\t\t// http://msdn.microsoft.com/en-us/library/ie/hh465388.aspx#attribute_section\n\t\t\tif ( div.querySelectorAll(\"[msallowcapture^='']\").length ) {\n\t\t\t\trbuggyQSA.push( \"[*^$]=\" + whitespace + \"*(?:''|\\\"\\\")\" );\n\t\t\t}\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// Support: Chrome<29, Android<4.4, Safari<7.0+, iOS<7.0+, PhantomJS<1.9.8+\n\t\t\tif ( !div.querySelectorAll( \"[id~=\" + expando + \"-]\" ).length ) {\n\t\t\t\trbuggyQSA.push(\"~=\");\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\n\t\t\t// Support: Safari 8+, iOS 8+\n\t\t\t// https://bugs.webkit.org/show_bug.cgi?id=136851\n\t\t\t// In-page `selector#id sibing-combinator selector` fails\n\t\t\tif ( !div.querySelectorAll( \"a#\" + expando + \"+*\" ).length ) {\n\t\t\t\trbuggyQSA.push(\".#.+[+~]\");\n\t\t\t}\n\t\t});\n\n\t\tassert(function( div ) {\n\t\t\t// Support: Windows 8 Native Apps\n\t\t\t// The type and name attributes are restricted during .innerHTML assignment\n\t\t\tvar input = document.createElement(\"input\");\n\t\t\tinput.setAttribute( \"type\", \"hidden\" );\n\t\t\tdiv.appendChild( input ).setAttribute( \"name\", \"D\" );\n\n\t\t\t// Support: IE8\n\t\t\t// Enforce case-sensitivity of name attribute\n\t\t\tif ( div.querySelectorAll(\"[name=d]\").length ) {\n\t\t\t\trbuggyQSA.push( \"name\" + 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.matches ||\n\t\tdocElem.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\thasCompare = rnative.test( docElem.compareDocumentPosition );\n\n\t// Element contains another\n\t// Purposefully self-exclusive\n\t// As in, an element does not contain itself\n\tcontains = hasCompare || rnative.test( docElem.contains ) ?\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 = hasCompare ?\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\t// Sort on method existence if only one input has compareDocumentPosition\n\t\tvar compare = !a.compareDocumentPosition - !b.compareDocumentPosition;\n\t\tif ( compare ) {\n\t\t\treturn compare;\n\t\t}\n\n\t\t// Calculate position if both inputs belong to the same document\n\t\tcompare = ( a.ownerDocument || a ) === ( b.ownerDocument || b ) ?\n\t\t\ta.compareDocumentPosition( b ) :\n\n\t\t\t// Otherwise we know they are disconnected\n\t\t\t1;\n\n\t\t// Disconnected nodes\n\t\tif ( compare & 1 ||\n\t\t\t(!support.sortDetached && b.compareDocumentPosition( a ) === compare) ) {\n\n\t\t\t// Choose the first element that is related to our preferred document\n\t\t\tif ( a === document || a.ownerDocument === preferredDoc && contains(preferredDoc, a) ) {\n\t\t\t\treturn -1;\n\t\t\t}\n\t\t\tif ( b === document || b.ownerDocument === preferredDoc && contains(preferredDoc, b) ) {\n\t\t\t\treturn 1;\n\t\t\t}\n\n\t\t\t// Maintain original order\n\t\t\treturn sortInput ?\n\t\t\t\t( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) :\n\t\t\t\t0;\n\t\t}\n\n\t\treturn compare & 4 ? -1 : 1;\n\t} :\n\tfunction( a, b ) {\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\t\t}\n\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// Parentless nodes are either documents or disconnected\n\t\tif ( !aup || !bup ) {\n\t\t\treturn a === document ? -1 :\n\t\t\t\tb === document ? 1 :\n\t\t\t\taup ? -1 :\n\t\t\t\tbup ? 1 :\n\t\t\t\tsortInput ?\n\t\t\t\t( indexOf( sortInput, a ) - indexOf( 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 document;\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!compilerCache[ expr + \" \" ] &&\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\tval :\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};\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\t// Clear input after sorting to release objects\n\t// See https://github.com/jquery/sizzle/pull/225\n\tsortInput = null;\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\twhile ( (node = elem[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 (jQuery #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[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[6] && 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] ) {\n\t\t\t\tmatch[2] = match[4] || match[5] || \"\";\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 !== \"undefined\" && 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.replace( rwhitespace, \" \" ) + \" \" ).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, uniqueCache, outerCache, node, 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\t\t\t\t\t\tdiff = false;\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 ?\n\t\t\t\t\t\t\t\t\t\tnode.nodeName.toLowerCase() === name :\n\t\t\t\t\t\t\t\t\t\tnode.nodeType === 1 ) {\n\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\n\t\t\t\t\t\t\t// Seek `elem` from a previously-cached index\n\n\t\t\t\t\t\t\t// ...in a gzip-friendly way\n\t\t\t\t\t\t\tnode = parent;\n\t\t\t\t\t\t\touterCache = node[ expando ] || (node[ expando ] = {});\n\n\t\t\t\t\t\t\t// Support: IE <9 only\n\t\t\t\t\t\t\t// Defend against cloned attroperties (jQuery gh-1709)\n\t\t\t\t\t\t\tuniqueCache = outerCache[ node.uniqueID ] ||\n\t\t\t\t\t\t\t\t(outerCache[ node.uniqueID ] = {});\n\n\t\t\t\t\t\t\tcache = uniqueCache[ type ] || [];\n\t\t\t\t\t\t\tnodeIndex = cache[ 0 ] === dirruns && cache[ 1 ];\n\t\t\t\t\t\t\tdiff = nodeIndex && 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\tuniqueCache[ 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} else {\n\t\t\t\t\t\t\t// Use previously-cached element index if available\n\t\t\t\t\t\t\tif ( useCache ) {\n\t\t\t\t\t\t\t\t// ...in a gzip-friendly way\n\t\t\t\t\t\t\t\tnode = elem;\n\t\t\t\t\t\t\t\touterCache = node[ expando ] || (node[ expando ] = {});\n\n\t\t\t\t\t\t\t\t// Support: IE <9 only\n\t\t\t\t\t\t\t\t// Defend against cloned attroperties (jQuery gh-1709)\n\t\t\t\t\t\t\t\tuniqueCache = outerCache[ node.uniqueID ] ||\n\t\t\t\t\t\t\t\t\t(outerCache[ node.uniqueID ] = {});\n\n\t\t\t\t\t\t\t\tcache = uniqueCache[ type ] || [];\n\t\t\t\t\t\t\t\tnodeIndex = cache[ 0 ] === dirruns && cache[ 1 ];\n\t\t\t\t\t\t\t\tdiff = nodeIndex;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// xml :nth-child(...)\n\t\t\t\t\t\t\t// or :nth-last-child(...) or :nth(-last)?-of-type(...)\n\t\t\t\t\t\t\tif ( diff === false ) {\n\t\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\t\twhile ( (node = ++nodeIndex && node && node[ dir ] ||\n\t\t\t\t\t\t\t\t\t(diff = nodeIndex = 0) || start.pop()) ) {\n\n\t\t\t\t\t\t\t\t\tif ( ( ofType ?\n\t\t\t\t\t\t\t\t\t\tnode.nodeName.toLowerCase() === name :\n\t\t\t\t\t\t\t\t\t\tnode.nodeType === 1 ) &&\n\t\t\t\t\t\t\t\t\t\t++diff ) {\n\n\t\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\t\tif ( useCache ) {\n\t\t\t\t\t\t\t\t\t\t\touterCache = node[ expando ] || (node[ expando ] = {});\n\n\t\t\t\t\t\t\t\t\t\t\t// Support: IE <9 only\n\t\t\t\t\t\t\t\t\t\t\t// Defend against cloned attroperties (jQuery gh-1709)\n\t\t\t\t\t\t\t\t\t\t\tuniqueCache = outerCache[ node.uniqueID ] ||\n\t\t\t\t\t\t\t\t\t\t\t\t(outerCache[ node.uniqueID ] = {});\n\n\t\t\t\t\t\t\t\t\t\t\tuniqueCache[ type ] = [ dirruns, diff ];\n\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\tif ( node === elem ) {\n\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\t}\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( 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\t// Don't keep the element (issue #299)\n\t\t\t\t\tinput[0] = null;\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\ttext = text.replace( runescape, funescape );\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 negated by element (1) or content nodes (text: 3; cdata: 4; entity ref: 5),\n\t\t\t// but not by others (comment: 8; processing instruction: 7; etc.)\n\t\t\t// nodeType < 6 works because attributes (2) do not appear as children\n\t\t\tfor ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {\n\t\t\t\tif ( elem.nodeType < 6 ) {\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\treturn elem.nodeName.toLowerCase() === \"input\" &&\n\t\t\t\telem.type === \"text\" &&\n\n\t\t\t\t// Support: IE<8\n\t\t\t\t// New HTML5 attribute values (e.g., \"search\") appear with elem.type === \"text\"\n\t\t\t\t( (attr = elem.getAttribute(\"type\")) == null || attr.toLowerCase() === \"text\" );\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\ntokenize = Sizzle.tokenize = function( 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 oldCache, uniqueCache, outerCache,\n\t\t\t\tnewCache = [ dirruns, doneName ];\n\n\t\t\t// We can't set arbitrary data on XML nodes, so they don't benefit from combinator 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\n\t\t\t\t\t\t// Support: IE <9 only\n\t\t\t\t\t\t// Defend against cloned attroperties (jQuery gh-1709)\n\t\t\t\t\t\tuniqueCache = outerCache[ elem.uniqueID ] || (outerCache[ elem.uniqueID ] = {});\n\n\t\t\t\t\t\tif ( (oldCache = uniqueCache[ dir ]) &&\n\t\t\t\t\t\t\toldCache[ 0 ] === dirruns && oldCache[ 1 ] === doneName ) {\n\n\t\t\t\t\t\t\t// Assign to newCache so results back-propagate to previous elements\n\t\t\t\t\t\t\treturn (newCache[ 2 ] = oldCache[ 2 ]);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// Reuse newcache so results back-propagate to previous elements\n\t\t\t\t\t\t\tuniqueCache[ dir ] = newCache;\n\n\t\t\t\t\t\t\t// A match means we're done; a fail means we have to keep checking\n\t\t\t\t\t\t\tif ( (newCache[ 2 ] = matcher( elem, context, xml )) ) {\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 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 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( 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( checkContext, elem ) > -1;\n\t\t}, implicitRelative, true ),\n\t\tmatchers = [ function( elem, context, xml ) {\n\t\t\tvar ret = ( !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\t// Avoid hanging onto element (issue #299)\n\t\t\tcheckContext = null;\n\t\t\treturn ret;\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\tvar bySet = setMatchers.length > 0,\n\t\tbyElement = elementMatchers.length > 0,\n\t\tsuperMatcher = function( seed, context, xml, results, outermost ) {\n\t\t\tvar elem, j, matcher,\n\t\t\t\tmatchedCount = 0,\n\t\t\t\ti = \"0\",\n\t\t\t\tunmatched = seed && [],\n\t\t\t\tsetMatched = [],\n\t\t\t\tcontextBackup = outermostContext,\n\t\t\t\t// We must always have either seed elements or outermost context\n\t\t\t\telems = seed || byElement && Expr.find[\"TAG\"]( \"*\", outermost ),\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\t\t\t\tlen = elems.length;\n\n\t\t\tif ( outermost ) {\n\t\t\t\toutermostContext = context === document || context || outermost;\n\t\t\t}\n\n\t\t\t// Add elements passing elementMatchers directly to results\n\t\t\t// Support: IE<9, Safari\n\t\t\t// Tolerate NodeList properties (IE: \"length\"; Safari: ) matching elements by id\n\t\t\tfor ( ; i !== len && (elem = elems[i]) != null; i++ ) {\n\t\t\t\tif ( byElement && elem ) {\n\t\t\t\t\tj = 0;\n\t\t\t\t\tif ( !context && elem.ownerDocument !== document ) {\n\t\t\t\t\t\tsetDocument( elem );\n\t\t\t\t\t\txml = !documentIsHTML;\n\t\t\t\t\t}\n\t\t\t\t\twhile ( (matcher = elementMatchers[j++]) ) {\n\t\t\t\t\t\tif ( matcher( elem, context || document, 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}\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// `i` is now the count of elements visited above, and adding it to `matchedCount`\n\t\t\t// makes the latter nonnegative.\n\t\t\tmatchedCount += i;\n\n\t\t\t// Apply set filters to unmatched elements\n\t\t\t// NOTE: This can be skipped if there are no unmatched elements (i.e., `matchedCount`\n\t\t\t// equals `i`), unless we didn't visit _any_ elements in the above loop because we have\n\t\t\t// no element matchers and no seed.\n\t\t\t// Incrementing an initially-string \"0\" `i` allows `i` to remain a string only in that\n\t\t\t// case, which will result in a \"00\" `matchedCount` that differs from `i` but is also\n\t\t\t// numerically zero.\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, match /* 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 ( !match ) {\n\t\t\tmatch = tokenize( selector );\n\t\t}\n\t\ti = match.length;\n\t\twhile ( i-- ) {\n\t\t\tcached = matcherFromTokens( match[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\n\t\t// Save selector and tokenization\n\t\tcached.selector = selector;\n\t}\n\treturn cached;\n};\n\n/**\n * A low-level selection function that works with Sizzle's compiled\n * selector functions\n * @param {String|Function} selector A selector or a pre-compiled\n * selector function built with Sizzle.compile\n * @param {Element} context\n * @param {Array} [results]\n * @param {Array} [seed] A set of elements to match against\n */\nselect = Sizzle.select = function( selector, context, results, seed ) {\n\tvar i, tokens, token, type, find,\n\t\tcompiled = typeof selector === \"function\" && selector,\n\t\tmatch = !seed && tokenize( (selector = compiled.selector || selector) );\n\n\tresults = results || [];\n\n\t// Try to minimize operations if there is only one selector in the list and no seed\n\t// (the latter of which guarantees us context)\n\tif ( match.length === 1 ) {\n\n\t\t// Reduce context if the leading compound selector is an ID\n\t\ttokens = match[0] = match[0].slice( 0 );\n\t\tif ( tokens.length > 2 && (token = tokens[0]).type === \"ID\" &&\n\t\t\t\tsupport.getById && context.nodeType === 9 && documentIsHTML &&\n\t\t\t\tExpr.relative[ tokens[1].type ] ) {\n\n\t\t\tcontext = ( Expr.find[\"ID\"]( token.matches[0].replace(runescape, funescape), context ) || [] )[0];\n\t\t\tif ( !context ) {\n\t\t\t\treturn results;\n\n\t\t\t// Precompiled matchers will still verify ancestry, so step up a level\n\t\t\t} else if ( compiled ) {\n\t\t\t\tcontext = context.parentNode;\n\t\t\t}\n\n\t\t\tselector = selector.slice( tokens.shift().value.length );\n\t\t}\n\n\t\t// Fetch a seed set for right-to-left matching\n\t\ti = matchExpr[\"needsContext\"].test( selector ) ? 0 : tokens.length;\n\t\twhile ( i-- ) {\n\t\t\ttoken = tokens[i];\n\n\t\t\t// Abort if we hit a combinator\n\t\t\tif ( Expr.relative[ (type = token.type) ] ) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif ( (find = Expr.find[ type ]) ) {\n\t\t\t\t// Search, expanding context for leading sibling combinators\n\t\t\t\tif ( (seed = find(\n\t\t\t\t\ttoken.matches[0].replace( runescape, funescape ),\n\t\t\t\t\trsibling.test( tokens[0].type ) && testContext( context.parentNode ) || context\n\t\t\t\t)) ) {\n\n\t\t\t\t\t// If seed is empty or no tokens remain, we can return early\n\t\t\t\t\ttokens.splice( i, 1 );\n\t\t\t\t\tselector = seed.length && toSelector( tokens );\n\t\t\t\t\tif ( !selector ) {\n\t\t\t\t\t\tpush.apply( results, seed );\n\t\t\t\t\t\treturn results;\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t// Compile and execute a filtering function if one is not provided\n\t// Provide `match` to avoid retokenization if we modified the selector above\n\t( compiled || compile( selector, match ) )(\n\t\tseed,\n\t\tcontext,\n\t\t!documentIsHTML,\n\t\tresults,\n\t\t!context || rsibling.test( selector ) && testContext( context.parentNode ) || context\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-35+\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 = \"\";\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 = \"\";\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 elem[ name ] === true ? name.toLowerCase() :\n\t\t\t\t\t(val = elem.getAttributeNode( name )) && val.specified ?\n\t\t\t\t\tval.value :\n\t\t\t\tnull;\n\t\t}\n\t});\n}\n\nreturn Sizzle;\n\n})( window );\n\n\n\njQuery.find = Sizzle;\njQuery.expr = Sizzle.selectors;\njQuery.expr[ \":\" ] = jQuery.expr.pseudos;\njQuery.uniqueSort = jQuery.unique = Sizzle.uniqueSort;\njQuery.text = Sizzle.getText;\njQuery.isXMLDoc = Sizzle.isXML;\njQuery.contains = Sizzle.contains;\n\n\n\nvar dir = function( elem, dir, until ) {\n\tvar matched = [],\n\t\ttruncate = until !== undefined;\n\n\twhile ( ( elem = elem[ dir ] ) && elem.nodeType !== 9 ) {\n\t\tif ( elem.nodeType === 1 ) {\n\t\t\tif ( truncate && jQuery( elem ).is( until ) ) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tmatched.push( elem );\n\t\t}\n\t}\n\treturn matched;\n};\n\n\nvar siblings = function( n, elem ) {\n\tvar matched = [];\n\n\tfor ( ; n; n = n.nextSibling ) {\n\t\tif ( n.nodeType === 1 && n !== elem ) {\n\t\t\tmatched.push( n );\n\t\t}\n\t}\n\n\treturn matched;\n};\n\n\nvar rneedsContext = jQuery.expr.match.needsContext;\n\nvar rsingleTag = ( /^<([\\w-]+)\\s*\\/?>(?:<\\/\\1>|)$/ );\n\n\n\nvar risSimple = /^.[^:#\\[\\.,]*$/;\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 ( risSimple.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 ( indexOf.call( qualifier, elem ) > -1 ) !== not;\n\t} );\n}\n\njQuery.filter = function( expr, elems, not ) {\n\tvar elem = elems[ 0 ];\n\n\tif ( not ) {\n\t\texpr = \":not(\" + expr + \")\";\n\t}\n\n\treturn elems.length === 1 && elem.nodeType === 1 ?\n\t\tjQuery.find.matchesSelector( elem, expr ) ? [ elem ] : [] :\n\t\tjQuery.find.matches( expr, jQuery.grep( elems, function( elem ) {\n\t\t\treturn elem.nodeType === 1;\n\t\t} ) );\n};\n\njQuery.fn.extend( {\n\tfind: function( selector ) {\n\t\tvar i,\n\t\t\tlen = this.length,\n\t\t\tret = [],\n\t\t\tself = this;\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\tfilter: function( selector ) {\n\t\treturn this.pushStack( winnow( this, selector || [], false ) );\n\t},\n\tnot: function( selector ) {\n\t\treturn this.pushStack( winnow( this, selector || [], true ) );\n\t},\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\n\n// Initialize a jQuery object\n\n\n// A central reference to the root jQuery(document)\nvar rootjQuery,\n\n\t// A simple way to check for HTML strings\n\t// Prioritize #id over to avoid XSS via location.hash (#9521)\n\t// Strict HTML recognition (#11290: must start with <)\n\trquickExpr = /^(?:\\s*(<[\\w\\W]+>)[^>]*|#([\\w-]*))$/,\n\n\tinit = jQuery.fn.init = function( selector, context, root ) {\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// Method init() accepts an alternate rootjQuery\n\t\t// so migrate can support jQuery.sub (gh-2101)\n\t\troot = root || rootjQuery;\n\n\t\t// Handle HTML strings\n\t\tif ( typeof selector === \"string\" ) {\n\t\t\tif ( selector[ 0 ] === \"<\" &&\n\t\t\t\tselector[ selector.length - 1 ] === \">\" &&\n\t\t\t\tselector.length >= 3 ) {\n\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// Option to run scripts is true for back-compat\n\t\t\t\t\t// Intentionally let the error be thrown if parseHTML is not present\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\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// Support: Blackberry 4.6\n\t\t\t\t\t// gEBID returns nodes no longer in the document (#6963)\n\t\t\t\t\tif ( elem && elem.parentNode ) {\n\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 || root ).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 root.ready !== undefined ?\n\t\t\t\troot.ready( selector ) :\n\n\t\t\t\t// Execute immediately if ready is not present\n\t\t\t\tselector( jQuery );\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// Give the init function the jQuery prototype for later instantiation\ninit.prototype = jQuery.fn;\n\n// Initialize central reference\nrootjQuery = jQuery( document );\n\n\nvar rparentsprev = /^(?:parents|prev(?:Until|All))/,\n\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\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\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\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\tmatched.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.uniqueSort( matched ) : matched );\n\t},\n\n\t// Determine the position of an element within the set\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 indexOf.call( jQuery( elem ), this[ 0 ] );\n\t\t}\n\n\t\t// Locate the position of the desired element\n\t\treturn 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\treturn this.pushStack(\n\t\t\tjQuery.uniqueSort(\n\t\t\t\tjQuery.merge( this.get(), jQuery( selector, context ) )\n\t\t\t)\n\t\t);\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\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 dir( elem, \"parentNode\" );\n\t},\n\tparentsUntil: function( elem, i, until ) {\n\t\treturn 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 dir( elem, \"nextSibling\" );\n\t},\n\tprevAll: function( elem ) {\n\t\treturn dir( elem, \"previousSibling\" );\n\t},\n\tnextUntil: function( elem, i, until ) {\n\t\treturn dir( elem, \"nextSibling\", until );\n\t},\n\tprevUntil: function( elem, i, until ) {\n\t\treturn dir( elem, \"previousSibling\", until );\n\t},\n\tsiblings: function( elem ) {\n\t\treturn siblings( ( elem.parentNode || {} ).firstChild, elem );\n\t},\n\tchildren: function( elem ) {\n\t\treturn siblings( 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\n\t\t\t// Remove duplicates\n\t\t\tif ( !guaranteedUnique[ name ] ) {\n\t\t\t\tjQuery.uniqueSort( 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} );\nvar rnotwhite = ( /\\S+/g );\n\n\n\n// Convert String-formatted options into Object-formatted ones\nfunction createOptions( options ) {\n\tvar object = {};\n\tjQuery.each( options.match( 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\tcreateOptions( options ) :\n\t\tjQuery.extend( {}, options );\n\n\tvar // Flag to know if list is currently firing\n\t\tfiring,\n\n\t\t// Last fire value for non-forgettable lists\n\t\tmemory,\n\n\t\t// Flag to know if list was already fired\n\t\tfired,\n\n\t\t// Flag to prevent firing\n\t\tlocked,\n\n\t\t// Actual callback list\n\t\tlist = [],\n\n\t\t// Queue of execution data for repeatable lists\n\t\tqueue = [],\n\n\t\t// Index of currently firing callback (modified by add/remove as needed)\n\t\tfiringIndex = -1,\n\n\t\t// Fire callbacks\n\t\tfire = function() {\n\n\t\t\t// Enforce single-firing\n\t\t\tlocked = options.once;\n\n\t\t\t// Execute callbacks for all pending executions,\n\t\t\t// respecting firingIndex overrides and runtime changes\n\t\t\tfired = firing = true;\n\t\t\tfor ( ; queue.length; firingIndex = -1 ) {\n\t\t\t\tmemory = queue.shift();\n\t\t\t\twhile ( ++firingIndex < list.length ) {\n\n\t\t\t\t\t// Run callback and check for early termination\n\t\t\t\t\tif ( list[ firingIndex ].apply( memory[ 0 ], memory[ 1 ] ) === false &&\n\t\t\t\t\t\toptions.stopOnFalse ) {\n\n\t\t\t\t\t\t// Jump to end and forget the data so .add doesn't re-fire\n\t\t\t\t\t\tfiringIndex = list.length;\n\t\t\t\t\t\tmemory = false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Forget the data if we're done with it\n\t\t\tif ( !options.memory ) {\n\t\t\t\tmemory = false;\n\t\t\t}\n\n\t\t\tfiring = false;\n\n\t\t\t// Clean up if we're done firing for good\n\t\t\tif ( locked ) {\n\n\t\t\t\t// Keep an empty list if we have data for future add calls\n\t\t\t\tif ( memory ) {\n\t\t\t\t\tlist = [];\n\n\t\t\t\t// Otherwise, this object is spent\n\t\t\t\t} else {\n\t\t\t\t\tlist = \"\";\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\n\t\t// Actual Callbacks object\n\t\tself = {\n\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\n\t\t\t\t\t// If we have memory from a past run, we should fire after adding\n\t\t\t\t\tif ( memory && !firing ) {\n\t\t\t\t\t\tfiringIndex = list.length - 1;\n\t\t\t\t\t\tqueue.push( memory );\n\t\t\t\t\t}\n\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\tif ( jQuery.isFunction( arg ) ) {\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 && jQuery.type( arg ) !== \"string\" ) {\n\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\n\t\t\t\t\tif ( memory && !firing ) {\n\t\t\t\t\t\tfire();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn this;\n\t\t\t},\n\n\t\t\t// Remove a callback from the list\n\t\t\tremove: function() {\n\t\t\t\tjQuery.each( arguments, function( _, arg ) {\n\t\t\t\t\tvar index;\n\t\t\t\t\twhile ( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) {\n\t\t\t\t\t\tlist.splice( index, 1 );\n\n\t\t\t\t\t\t// Handle firing indexes\n\t\t\t\t\t\tif ( index <= firingIndex ) {\n\t\t\t\t\t\t\tfiringIndex--;\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\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 ?\n\t\t\t\t\tjQuery.inArray( fn, list ) > -1 :\n\t\t\t\t\tlist.length > 0;\n\t\t\t},\n\n\t\t\t// Remove all callbacks from the list\n\t\t\tempty: function() {\n\t\t\t\tif ( list ) {\n\t\t\t\t\tlist = [];\n\t\t\t\t}\n\t\t\t\treturn this;\n\t\t\t},\n\n\t\t\t// Disable .fire and .add\n\t\t\t// Abort any current/pending executions\n\t\t\t// Clear all callbacks and values\n\t\t\tdisable: function() {\n\t\t\t\tlocked = queue = [];\n\t\t\t\tlist = memory = \"\";\n\t\t\t\treturn this;\n\t\t\t},\n\t\t\tdisabled: function() {\n\t\t\t\treturn !list;\n\t\t\t},\n\n\t\t\t// Disable .fire\n\t\t\t// Also disable .add unless we have memory (since it would have no effect)\n\t\t\t// Abort any pending executions\n\t\t\tlock: function() {\n\t\t\t\tlocked = queue = [];\n\t\t\t\tif ( !memory ) {\n\t\t\t\t\tlist = memory = \"\";\n\t\t\t\t}\n\t\t\t\treturn this;\n\t\t\t},\n\t\t\tlocked: function() {\n\t\t\t\treturn !!locked;\n\t\t\t},\n\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 ( !locked ) {\n\t\t\t\t\targs = args || [];\n\t\t\t\t\targs = [ context, args.slice ? args.slice() : args ];\n\t\t\t\t\tqueue.push( args );\n\t\t\t\t\tif ( !firing ) {\n\t\t\t\t\t\tfire();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn this;\n\t\t\t},\n\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\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};\n\n\njQuery.extend( {\n\n\tDeferred: function( func ) {\n\t\tvar tuples = [\n\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 fn = jQuery.isFunction( fns[ i ] ) && fns[ i ];\n\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.progress( newDefer.notify )\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} else {\n\t\t\t\t\t\t\t\t\tnewDefer[ tuple[ 0 ] + \"With\" ](\n\t\t\t\t\t\t\t\t\t\tthis === promise ? newDefer.promise() : this,\n\t\t\t\t\t\t\t\t\t\tfn ? [ returned ] : arguments\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\t\t\t\t\t\tfns = null;\n\t\t\t\t\t} ).promise();\n\t\t\t\t},\n\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\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 = 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 ||\n\t\t\t\t( subordinate && jQuery.isFunction( subordinate.promise ) ) ? length : 0,\n\n\t\t\t// the master Deferred.\n\t\t\t// 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 ? 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.progress( updateFunc( i, progressContexts, progressValues ) )\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} 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} );\n\n\n// The deferred used on DOM ready\nvar readyList;\n\njQuery.fn.ready = function( fn ) {\n\n\t// Add the callback\n\tjQuery.ready.promise().done( fn );\n\n\treturn this;\n};\n\njQuery.extend( {\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.triggerHandler ) {\n\t\t\tjQuery( document ).triggerHandler( \"ready\" );\n\t\t\tjQuery( document ).off( \"ready\" );\n\t\t}\n\t}\n} );\n\n/**\n * The ready event handler and self cleanup method\n */\nfunction completed() {\n\tdocument.removeEventListener( \"DOMContentLoaded\", completed );\n\twindow.removeEventListener( \"load\", completed );\n\tjQuery.ready();\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\n\t\t// after the browser event has already occurred.\n\t\t// Support: IE9-10 only\n\t\t// Older IE sometimes signals \"interactive\" too soon\n\t\tif ( document.readyState === \"complete\" ||\n\t\t\t( document.readyState !== \"loading\" && !document.documentElement.doScroll ) ) {\n\n\t\t\t// Handle it asynchronously to allow scripts the opportunity to delay ready\n\t\t\twindow.setTimeout( jQuery.ready );\n\n\t\t} else {\n\n\t\t\t// Use the handy event callback\n\t\t\tdocument.addEventListener( \"DOMContentLoaded\", completed );\n\n\t\t\t// A fallback to window.onload, that will always work\n\t\t\twindow.addEventListener( \"load\", completed );\n\t\t}\n\t}\n\treturn readyList.promise( obj );\n};\n\n// Kick off the DOM ready check even if the user does not\njQuery.ready.promise();\n\n\n\n\n// Multifunctional method to get and set values of a collection\n// The value/s can optionally be executed if it's a function\nvar access = function( elems, fn, key, value, chainable, emptyGet, raw ) {\n\tvar i = 0,\n\t\tlen = elems.length,\n\t\tbulk = key == null;\n\n\t// Sets many values\n\tif ( jQuery.type( key ) === \"object\" ) {\n\t\tchainable = true;\n\t\tfor ( i in key ) {\n\t\t\taccess( elems, fn, i, key[ i ], true, emptyGet, raw );\n\t\t}\n\n\t// Sets one value\n\t} else if ( value !== undefined ) {\n\t\tchainable = true;\n\n\t\tif ( !jQuery.isFunction( value ) ) {\n\t\t\traw = true;\n\t\t}\n\n\t\tif ( bulk ) {\n\n\t\t\t// Bulk operations run against the entire set\n\t\t\tif ( raw ) {\n\t\t\t\tfn.call( elems, value );\n\t\t\t\tfn = null;\n\n\t\t\t// ...except when executing function values\n\t\t\t} else {\n\t\t\t\tbulk = fn;\n\t\t\t\tfn = function( elem, key, value ) {\n\t\t\t\t\treturn bulk.call( jQuery( elem ), value );\n\t\t\t\t};\n\t\t\t}\n\t\t}\n\n\t\tif ( fn ) {\n\t\t\tfor ( ; i < len; i++ ) {\n\t\t\t\tfn(\n\t\t\t\t\telems[ i ], key, raw ?\n\t\t\t\t\tvalue :\n\t\t\t\t\tvalue.call( elems[ i ], i, fn( elems[ i ], key ) )\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}\n\n\treturn chainable ?\n\t\telems :\n\n\t\t// Gets\n\t\tbulk ?\n\t\t\tfn.call( elems ) :\n\t\t\tlen ? fn( elems[ 0 ], key ) : emptyGet;\n};\nvar acceptData = function( owner ) {\n\n\t// Accepts only:\n\t// - Node\n\t// - Node.ELEMENT_NODE\n\t// - Node.DOCUMENT_NODE\n\t// - Object\n\t// - Any\n\t/* jshint -W018 */\n\treturn owner.nodeType === 1 || owner.nodeType === 9 || !( +owner.nodeType );\n};\n\n\n\n\nfunction Data() {\n\tthis.expando = jQuery.expando + Data.uid++;\n}\n\nData.uid = 1;\n\nData.prototype = {\n\n\tregister: function( owner, initial ) {\n\t\tvar value = initial || {};\n\n\t\t// If it is a node unlikely to be stringify-ed or looped over\n\t\t// use plain assignment\n\t\tif ( owner.nodeType ) {\n\t\t\towner[ this.expando ] = value;\n\n\t\t// Otherwise secure it in a non-enumerable, non-writable property\n\t\t// configurability must be true to allow the property to be\n\t\t// deleted with the delete operator\n\t\t} else {\n\t\t\tObject.defineProperty( owner, this.expando, {\n\t\t\t\tvalue: value,\n\t\t\t\twritable: true,\n\t\t\t\tconfigurable: true\n\t\t\t} );\n\t\t}\n\t\treturn owner[ this.expando ];\n\t},\n\tcache: function( owner ) {\n\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 an empty object.\n\t\tif ( !acceptData( owner ) ) {\n\t\t\treturn {};\n\t\t}\n\n\t\t// Check if the owner object already has a cache\n\t\tvar value = owner[ this.expando ];\n\n\t\t// If not, create one\n\t\tif ( !value ) {\n\t\t\tvalue = {};\n\n\t\t\t// We can accept data for non-element nodes in modern browsers,\n\t\t\t// but we should not, see #8335.\n\t\t\t// Always return an empty object.\n\t\t\tif ( acceptData( owner ) ) {\n\n\t\t\t\t// If it is a node unlikely to be stringify-ed or looped over\n\t\t\t\t// use plain assignment\n\t\t\t\tif ( owner.nodeType ) {\n\t\t\t\t\towner[ this.expando ] = value;\n\n\t\t\t\t// Otherwise secure it in a non-enumerable property\n\t\t\t\t// configurable must be true to allow the property to be\n\t\t\t\t// deleted when data is removed\n\t\t\t\t} else {\n\t\t\t\t\tObject.defineProperty( owner, this.expando, {\n\t\t\t\t\t\tvalue: value,\n\t\t\t\t\t\tconfigurable: true\n\t\t\t\t\t} );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn value;\n\t},\n\tset: function( owner, data, value ) {\n\t\tvar prop,\n\t\t\tcache = this.cache( owner );\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\n\t\t\t// Copy the properties one-by-one to the cache object\n\t\t\tfor ( prop in data ) {\n\t\t\t\tcache[ prop ] = data[ prop ];\n\t\t\t}\n\t\t}\n\t\treturn cache;\n\t},\n\tget: function( owner, key ) {\n\t\treturn key === undefined ?\n\t\t\tthis.cache( owner ) :\n\t\t\towner[ this.expando ] && owner[ this.expando ][ key ];\n\t},\n\taccess: function( owner, key, value ) {\n\t\tvar stored;\n\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\tcache = owner[ this.expando ];\n\n\t\tif ( cache === undefined ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( key === undefined ) {\n\t\t\tthis.register( owner );\n\n\t\t} else {\n\n\t\t\t// Support array or space separated string of keys\n\t\t\tif ( jQuery.isArray( key ) ) {\n\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\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\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( rnotwhite ) || [] );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\ti = name.length;\n\n\t\t\twhile ( i-- ) {\n\t\t\t\tdelete cache[ name[ i ] ];\n\t\t\t}\n\t\t}\n\n\t\t// Remove the expando if there's no more data\n\t\tif ( key === undefined || jQuery.isEmptyObject( cache ) ) {\n\n\t\t\t// Support: Chrome <= 35-45+\n\t\t\t// Webkit & Blink performance suffers when deleting properties\n\t\t\t// from DOM nodes, so set to undefined instead\n\t\t\t// https://code.google.com/p/chromium/issues/detail?id=378607\n\t\t\tif ( owner.nodeType ) {\n\t\t\t\towner[ this.expando ] = undefined;\n\t\t\t} else {\n\t\t\t\tdelete owner[ this.expando ];\n\t\t\t}\n\t\t}\n\t},\n\thasData: function( owner ) {\n\t\tvar cache = owner[ this.expando ];\n\t\treturn cache !== undefined && !jQuery.isEmptyObject( cache );\n\t}\n};\nvar dataPriv = new Data();\n\nvar dataUser = new Data();\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 rbrace = /^(?:\\{[\\w\\W]*\\}|\\[[\\w\\W]*\\])$/,\n\trmultiDash = /[A-Z]/g;\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, \"-$&\" ).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\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 ) ? jQuery.parseJSON( 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\tdataUser.set( elem, key, data );\n\t\t} else {\n\t\t\tdata = undefined;\n\t\t}\n\t}\n\treturn data;\n}\n\njQuery.extend( {\n\thasData: function( elem ) {\n\t\treturn dataUser.hasData( elem ) || dataPriv.hasData( elem );\n\t},\n\n\tdata: function( elem, name, data ) {\n\t\treturn dataUser.access( elem, name, data );\n\t},\n\n\tremoveData: function( elem, name ) {\n\t\tdataUser.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 dataPriv methods, these can be deprecated.\n\t_data: function( elem, name, data ) {\n\t\treturn dataPriv.access( elem, name, data );\n\t},\n\n\t_removeData: function( elem, name ) {\n\t\tdataPriv.remove( elem, name );\n\t}\n} );\n\njQuery.fn.extend( {\n\tdata: function( key, value ) {\n\t\tvar i, name, data,\n\t\t\telem = this[ 0 ],\n\t\t\tattrs = elem && elem.attributes;\n\n\t\t// Gets all values\n\t\tif ( key === undefined ) {\n\t\t\tif ( this.length ) {\n\t\t\t\tdata = dataUser.get( elem );\n\n\t\t\t\tif ( elem.nodeType === 1 && !dataPriv.get( elem, \"hasDataAttrs\" ) ) {\n\t\t\t\t\ti = attrs.length;\n\t\t\t\t\twhile ( i-- ) {\n\n\t\t\t\t\t\t// Support: IE11+\n\t\t\t\t\t\t// The attrs elements can be null (#14894)\n\t\t\t\t\t\tif ( attrs[ i ] ) {\n\t\t\t\t\t\t\tname = attrs[ i ].name;\n\t\t\t\t\t\t\tif ( name.indexOf( \"data-\" ) === 0 ) {\n\t\t\t\t\t\t\t\tname = jQuery.camelCase( name.slice( 5 ) );\n\t\t\t\t\t\t\t\tdataAttr( elem, name, data[ name ] );\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\tdataPriv.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\tdataUser.set( this, key );\n\t\t\t} );\n\t\t}\n\n\t\treturn access( this, function( value ) {\n\t\t\tvar data, camelKey;\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\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 = dataUser.get( elem, key ) ||\n\n\t\t\t\t\t// Try to find dashed key if it exists (gh-2779)\n\t\t\t\t\t// This is for 2.2.x only\n\t\t\t\t\tdataUser.get( elem, key.replace( rmultiDash, \"-$&\" ).toLowerCase() );\n\n\t\t\t\tif ( data !== undefined ) {\n\t\t\t\t\treturn data;\n\t\t\t\t}\n\n\t\t\t\tcamelKey = jQuery.camelCase( key );\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 = dataUser.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\tcamelKey = jQuery.camelCase( key );\n\t\t\tthis.each( function() {\n\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 = dataUser.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\tdataUser.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\tdataUser.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\tdataUser.remove( this, key );\n\t\t} );\n\t}\n} );\n\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 = dataPriv.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 = dataPriv.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 public - generate a queueHooks object, or return the current one\n\t_queueHooks: function( elem, type ) {\n\t\tvar key = type + \"queueHooks\";\n\t\treturn dataPriv.get( elem, key ) || dataPriv.access( elem, key, {\n\t\t\tempty: jQuery.Callbacks( \"once memory\" ).add( function() {\n\t\t\t\tdataPriv.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\tclearQueue: function( type ) {\n\t\treturn this.queue( type || \"fx\", [] );\n\t},\n\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 = dataPriv.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 pnum = ( /[+-]?(?:\\d*\\.|)\\d+(?:[eE][+-]?\\d+|)/ ).source;\n\nvar rcssNum = new RegExp( \"^(?:([+-])=|)(\" + pnum + \")([a-z%]*)$\", \"i\" );\n\n\nvar cssExpand = [ \"Top\", \"Right\", \"Bottom\", \"Left\" ];\n\nvar isHidden = function( elem, el ) {\n\n\t\t// isHidden might be called from jQuery#filter function;\n\t\t// in that case, element will be second argument\n\t\telem = el || elem;\n\t\treturn jQuery.css( elem, \"display\" ) === \"none\" ||\n\t\t\t!jQuery.contains( elem.ownerDocument, elem );\n\t};\n\n\n\nfunction adjustCSS( elem, prop, valueParts, tween ) {\n\tvar adjusted,\n\t\tscale = 1,\n\t\tmaxIterations = 20,\n\t\tcurrentValue = tween ?\n\t\t\tfunction() { return tween.cur(); } :\n\t\t\tfunction() { return jQuery.css( elem, prop, \"\" ); },\n\t\tinitial = currentValue(),\n\t\tunit = valueParts && valueParts[ 3 ] || ( jQuery.cssNumber[ prop ] ? \"\" : \"px\" ),\n\n\t\t// Starting value computation is required for potential unit mismatches\n\t\tinitialInUnit = ( jQuery.cssNumber[ prop ] || unit !== \"px\" && +initial ) &&\n\t\t\trcssNum.exec( jQuery.css( elem, prop ) );\n\n\tif ( initialInUnit && initialInUnit[ 3 ] !== unit ) {\n\n\t\t// Trust units reported by jQuery.css\n\t\tunit = unit || initialInUnit[ 3 ];\n\n\t\t// Make sure we update the tween properties later on\n\t\tvalueParts = valueParts || [];\n\n\t\t// Iteratively approximate from a nonzero starting point\n\t\tinitialInUnit = +initial || 1;\n\n\t\tdo {\n\n\t\t\t// If previous iteration zeroed out, double until we get *something*.\n\t\t\t// Use string for doubling so we don't accidentally see scale as unchanged below\n\t\t\tscale = scale || \".5\";\n\n\t\t\t// Adjust and apply\n\t\t\tinitialInUnit = initialInUnit / scale;\n\t\t\tjQuery.style( elem, prop, initialInUnit + unit );\n\n\t\t// Update scale, tolerating zero or NaN from tween.cur()\n\t\t// Break the loop if scale is unchanged or perfect, or if we've just had enough.\n\t\t} while (\n\t\t\tscale !== ( scale = currentValue() / initial ) && scale !== 1 && --maxIterations\n\t\t);\n\t}\n\n\tif ( valueParts ) {\n\t\tinitialInUnit = +initialInUnit || +initial || 0;\n\n\t\t// Apply relative offset (+=/-=) if specified\n\t\tadjusted = valueParts[ 1 ] ?\n\t\t\tinitialInUnit + ( valueParts[ 1 ] + 1 ) * valueParts[ 2 ] :\n\t\t\t+valueParts[ 2 ];\n\t\tif ( tween ) {\n\t\t\ttween.unit = unit;\n\t\t\ttween.start = initialInUnit;\n\t\t\ttween.end = adjusted;\n\t\t}\n\t}\n\treturn adjusted;\n}\nvar rcheckableType = ( /^(?:checkbox|radio)$/i );\n\nvar rtagName = ( /<([\\w:-]+)/ );\n\nvar rscriptType = ( /^$|\\/(?:java|ecma)script/i );\n\n\n\n// We have to close these tags to support XHTML (#13200)\nvar wrapMap = {\n\n\t// Support: IE9\n\toption: [ 1, \"\", \"\" ],\n\n\t// XHTML parsers do not magically insert elements in the\n\t// same way that tag soup parsers do. So we cannot shorten\n\t// this by omitting or other required elements.\n\tthead: [ 1, \"\", \"\" ],\n\tcol: [ 2, \"\", \"\" ],\n\ttr: [ 2, \"\", \"\" ],\n\ttd: [ 3, \"\", \"\" ],\n\n\t_default: [ 0, \"\", \"\" ]\n};\n\n// Support: IE9\nwrapMap.optgroup = wrapMap.option;\n\nwrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead;\nwrapMap.th = wrapMap.td;\n\n\nfunction getAll( context, tag ) {\n\n\t// Support: IE9-11+\n\t// Use typeof to avoid zero-argument method invocation on host objects (#15151)\n\tvar ret = typeof context.getElementsByTagName !== \"undefined\" ?\n\t\t\tcontext.getElementsByTagName( tag || \"*\" ) :\n\t\t\ttypeof context.querySelectorAll !== \"undefined\" ?\n\t\t\t\tcontext.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\n// Mark scripts as having already been evaluated\nfunction setGlobalEval( elems, refElements ) {\n\tvar i = 0,\n\t\tl = elems.length;\n\n\tfor ( ; i < l; i++ ) {\n\t\tdataPriv.set(\n\t\t\telems[ i ],\n\t\t\t\"globalEval\",\n\t\t\t!refElements || dataPriv.get( refElements[ i ], \"globalEval\" )\n\t\t);\n\t}\n}\n\n\nvar rhtml = /<|?\\w+;/;\n\nfunction buildFragment( elems, context, scripts, selection, ignored ) {\n\tvar elem, tmp, tag, wrap, contains, j,\n\t\tfragment = context.createDocumentFragment(),\n\t\tnodes = [],\n\t\ti = 0,\n\t\tl = elems.length;\n\n\tfor ( ; i < l; i++ ) {\n\t\telem = elems[ i ];\n\n\t\tif ( elem || elem === 0 ) {\n\n\t\t\t// Add nodes directly\n\t\t\tif ( jQuery.type( elem ) === \"object\" ) {\n\n\t\t\t\t// Support: Android<4.1, PhantomJS<2\n\t\t\t\t// push.apply(_, arraylike) throws on ancient WebKit\n\t\t\t\tjQuery.merge( nodes, elem.nodeType ? [ elem ] : elem );\n\n\t\t\t// Convert non-html into a text node\n\t\t\t} else if ( !rhtml.test( elem ) ) {\n\t\t\t\tnodes.push( context.createTextNode( elem ) );\n\n\t\t\t// Convert html into DOM nodes\n\t\t\t} else {\n\t\t\t\ttmp = tmp || fragment.appendChild( context.createElement( \"div\" ) );\n\n\t\t\t\t// Deserialize a standard representation\n\t\t\t\ttag = ( rtagName.exec( elem ) || [ \"\", \"\" ] )[ 1 ].toLowerCase();\n\t\t\t\twrap = wrapMap[ tag ] || wrapMap._default;\n\t\t\t\ttmp.innerHTML = wrap[ 1 ] + jQuery.htmlPrefilter( elem ) + wrap[ 2 ];\n\n\t\t\t\t// Descend through wrappers to the right content\n\t\t\t\tj = wrap[ 0 ];\n\t\t\t\twhile ( j-- ) {\n\t\t\t\t\ttmp = tmp.lastChild;\n\t\t\t\t}\n\n\t\t\t\t// Support: Android<4.1, PhantomJS<2\n\t\t\t\t// push.apply(_, arraylike) throws on ancient WebKit\n\t\t\t\tjQuery.merge( nodes, tmp.childNodes );\n\n\t\t\t\t// Remember the top-level container\n\t\t\t\ttmp = fragment.firstChild;\n\n\t\t\t\t// Ensure the created nodes are orphaned (#12392)\n\t\t\t\ttmp.textContent = \"\";\n\t\t\t}\n\t\t}\n\t}\n\n\t// Remove wrapper from fragment\n\tfragment.textContent = \"\";\n\n\ti = 0;\n\twhile ( ( elem = nodes[ i++ ] ) ) {\n\n\t\t// Skip elements already in the context collection (trac-4087)\n\t\tif ( selection && jQuery.inArray( elem, selection ) > -1 ) {\n\t\t\tif ( ignored ) {\n\t\t\t\tignored.push( elem );\n\t\t\t}\n\t\t\tcontinue;\n\t\t}\n\n\t\tcontains = jQuery.contains( elem.ownerDocument, elem );\n\n\t\t// Append to fragment\n\t\ttmp = getAll( fragment.appendChild( elem ), \"script\" );\n\n\t\t// Preserve script evaluation history\n\t\tif ( contains ) {\n\t\t\tsetGlobalEval( tmp );\n\t\t}\n\n\t\t// Capture executables\n\t\tif ( scripts ) {\n\t\t\tj = 0;\n\t\t\twhile ( ( elem = tmp[ j++ ] ) ) {\n\t\t\t\tif ( rscriptType.test( elem.type || \"\" ) ) {\n\t\t\t\t\tscripts.push( elem );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn fragment;\n}\n\n\n( function() {\n\tvar fragment = document.createDocumentFragment(),\n\t\tdiv = fragment.appendChild( document.createElement( \"div\" ) ),\n\t\tinput = document.createElement( \"input\" );\n\n\t// Support: Android 4.0-4.3, Safari<=5.1\n\t// Check state lost if the name is set (#11217)\n\t// Support: Windows Web Apps (WWA)\n\t// `name` and `type` must use .setAttribute for WWA (#14901)\n\tinput.setAttribute( \"type\", \"radio\" );\n\tinput.setAttribute( \"checked\", \"checked\" );\n\tinput.setAttribute( \"name\", \"t\" );\n\n\tdiv.appendChild( input );\n\n\t// Support: Safari<=5.1, Android<4.2\n\t// Older WebKit doesn't clone checked state correctly in fragments\n\tsupport.checkClone = div.cloneNode( true ).cloneNode( true ).lastChild.checked;\n\n\t// Support: IE<=11+\n\t// Make sure textarea (and checkbox) defaultValue is properly cloned\n\tdiv.innerHTML = \"x\";\n\tsupport.noCloneChecked = !!div.cloneNode( true ).lastChild.defaultValue;\n} )();\n\n\nvar\n\trkeyEvent = /^key/,\n\trmouseEvent = /^(?:mouse|pointer|contextmenu|drag|drop)|click/,\n\trtypenamespace = /^([^.]*)(?:\\.(.+)|)/;\n\nfunction returnTrue() {\n\treturn true;\n}\n\nfunction returnFalse() {\n\treturn false;\n}\n\n// Support: IE9\n// See #13393 for more info\nfunction safeActiveElement() {\n\ttry {\n\t\treturn document.activeElement;\n\t} catch ( err ) { }\n}\n\nfunction on( elem, types, selector, data, fn, one ) {\n\tvar origFn, type;\n\n\t// Types can be a map of types/handlers\n\tif ( typeof types === \"object\" ) {\n\n\t\t// ( types-Object, selector, data )\n\t\tif ( typeof selector !== \"string\" ) {\n\n\t\t\t// ( types-Object, data )\n\t\t\tdata = data || selector;\n\t\t\tselector = undefined;\n\t\t}\n\t\tfor ( type in types ) {\n\t\t\ton( elem, type, selector, data, types[ type ], one );\n\t\t}\n\t\treturn elem;\n\t}\n\n\tif ( data == null && fn == null ) {\n\n\t\t// ( types, fn )\n\t\tfn = selector;\n\t\tdata = selector = undefined;\n\t} else if ( fn == null ) {\n\t\tif ( typeof selector === \"string\" ) {\n\n\t\t\t// ( types, selector, fn )\n\t\t\tfn = data;\n\t\t\tdata = undefined;\n\t\t} else {\n\n\t\t\t// ( types, data, fn )\n\t\t\tfn = data;\n\t\t\tdata = selector;\n\t\t\tselector = undefined;\n\t\t}\n\t}\n\tif ( fn === false ) {\n\t\tfn = returnFalse;\n\t} else if ( !fn ) {\n\t\treturn elem;\n\t}\n\n\tif ( one === 1 ) {\n\t\torigFn = fn;\n\t\tfn = function( event ) {\n\n\t\t\t// Can use an empty set, since event contains the info\n\t\t\tjQuery().off( event );\n\t\t\treturn origFn.apply( this, arguments );\n\t\t};\n\n\t\t// Use same guid so caller can remove using origFn\n\t\tfn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ );\n\t}\n\treturn elem.each( function() {\n\t\tjQuery.event.add( this, types, fn, data, selector );\n\t} );\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 = dataPriv.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\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 !== \"undefined\" && jQuery.event.triggered !== e.type ?\n\t\t\t\t\tjQuery.event.dispatch.apply( elem, arguments ) : undefined;\n\t\t\t};\n\t\t}\n\n\t\t// Handle multiple events separated by a space\n\t\ttypes = ( types || \"\" ).match( 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 ||\n\t\t\t\t\tspecial.setup.call( elem, data, namespaces, eventHandle ) === false ) {\n\n\t\t\t\t\tif ( elem.addEventListener ) {\n\t\t\t\t\t\telem.addEventListener( type, eventHandle );\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},\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 = dataPriv.hasData( elem ) && dataPriv.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( 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 ] &&\n\t\t\t\tnew 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 ||\n\t\t\t\t\t\tselector === \"**\" && 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 ||\n\t\t\t\t\tspecial.teardown.call( elem, namespaces, elemData.handle ) === false ) {\n\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 data and the expando if it's no longer used\n\t\tif ( jQuery.isEmptyObject( events ) ) {\n\t\t\tdataPriv.remove( elem, \"handle events\" );\n\t\t}\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 = slice.call( arguments ),\n\t\t\thandlers = ( dataPriv.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++ ] ) &&\n\t\t\t\t!event.isImmediatePropagationStopped() ) {\n\n\t\t\t\t// Triggered event must either 1) have no namespace, or 2) have namespace(s)\n\t\t\t\t// a subset or equal to those in the bound event (both can have no namespace).\n\t\t\t\tif ( !event.rnamespace || event.rnamespace.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 ||\n\t\t\t\t\t\thandleObj.handler ).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// Support (at least): Chrome, IE9\n\t\t// Find delegate handlers\n\t\t// Black-hole SVG instance trees (#13180)\n\t\t//\n\t\t// Support: Firefox<=42+\n\t\t// Avoid non-left-click in FF but don't block IE radio events (#3861, gh-2343)\n\t\tif ( delegateCount && cur.nodeType &&\n\t\t\t( event.type !== \"click\" || isNaN( event.button ) || event.button < 1 ) ) {\n\n\t\t\tfor ( ; cur !== this; cur = cur.parentNode || this ) {\n\n\t\t\t\t// Don't check non-elements (#13208)\n\t\t\t\t// Don't process clicks on disabled elements (#6911, #8165, #11382, #11764)\n\t\t\t\tif ( cur.nodeType === 1 && ( 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 ) > -1 :\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 detail eventPhase \" +\n\t\t\"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 \" +\n\t\t\t\"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 +\n\t\t\t\t\t( doc && doc.scrollLeft || body && body.scrollLeft || 0 ) -\n\t\t\t\t\t( doc && doc.clientLeft || body && body.clientLeft || 0 );\n\t\t\t\tevent.pageY = original.clientY +\n\t\t\t\t\t( doc && doc.scrollTop || body && body.scrollTop || 0 ) -\n\t\t\t\t\t( 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\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\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\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 && event.originalEvent ) {\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\njQuery.removeEvent = function( elem, type, handle ) {\n\n\t// This \"if\" is needed for plain objects\n\tif ( elem.removeEventListener ) {\n\t\telem.removeEventListener( type, handle );\n\t}\n};\n\njQuery.Event = function( src, props ) {\n\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\t\tsrc.defaultPrevented === undefined &&\n\n\t\t\t\t// Support: Android<4.0\n\t\t\t\tsrc.returnValue === false ?\n\t\t\treturnTrue :\n\t\t\treturnFalse;\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\tconstructor: jQuery.Event,\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 ) {\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 ) {\n\t\t\te.stopPropagation();\n\t\t}\n\t},\n\tstopImmediatePropagation: function() {\n\t\tvar e = this.originalEvent;\n\n\t\tthis.isImmediatePropagationStopped = returnTrue;\n\n\t\tif ( e ) {\n\t\t\te.stopImmediatePropagation();\n\t\t}\n\n\t\tthis.stopPropagation();\n\t}\n};\n\n// Create mouseenter/leave events using mouseover/out and event-time checks\n// so that event delegation works in jQuery.\n// Do the same for pointerenter/pointerleave and pointerover/pointerout\n//\n// Support: Safari 7 only\n// Safari sends mouseenter too often; see:\n// https://code.google.com/p/chromium/issues/detail?id=470258\n// for the description of the bug (it existed in older Chrome versions as well).\njQuery.each( {\n\tmouseenter: \"mouseover\",\n\tmouseleave: \"mouseout\",\n\tpointerenter: \"pointerover\",\n\tpointerleave: \"pointerout\"\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 mouseenter/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\njQuery.fn.extend( {\n\ton: function( types, selector, data, fn ) {\n\t\treturn on( this, types, selector, data, fn );\n\t},\n\tone: function( types, selector, data, fn ) {\n\t\treturn on( this, 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\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 ?\n\t\t\t\t\thandleObj.origType + \".\" + handleObj.namespace :\n\t\t\t\t\thandleObj.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\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\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\n\nvar\n\trxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\\w:-]+)[^>]*)\\/>/gi,\n\n\t// Support: IE 10-11, Edge 10240+\n\t// In IE/Edge using regex groups here causes severe slowdowns.\n\t// See https://connect.microsoft.com/IE/feedback/details/1736512/\n\trnoInnerhtml = /\n ```\n \n And associate it by name using a view's `templateName` property:\n \n ```javascript\n AView = Ember.View.extend({\n templateName: 'some-template'\n });\n ```\n \n If you have nested routes, your Handlebars template will look like this:\n \n ```html\n \n ```\n \n And `templateName` property:\n \n ```javascript\n AView = Ember.View.extend({\n templateName: 'posts/new'\n });\n ```\n \n Using a value for `templateName` that does not have a template\n with a matching `data-template-name` attribute will throw an error.\n \n For views classes that may have a template later defined (e.g. as the block\n portion of a `{{view}}` helper call in another template or in\n a subclass), you can provide a `defaultTemplate` property set to compiled\n template function. If a template is not later provided for the view instance\n the `defaultTemplate` value will be used:\n \n ```javascript\n AView = Ember.View.extend({\n defaultTemplate: Ember.HTMLBars.compile('I was the default'),\n template: null,\n templateName: null\n });\n ```\n \n Will result in instances with an HTML representation of:\n \n ```html\n I was the default\n ```\n \n If a `template` or `templateName` is provided it will take precedence over\n `defaultTemplate`:\n \n ```javascript\n AView = Ember.View.extend({\n defaultTemplate: Ember.HTMLBars.compile('I was the default')\n });\n \n aView = AView.create({\n template: Ember.HTMLBars.compile('I was the template, not default')\n });\n ```\n \n Will result in the following HTML representation when rendered:\n \n ```html\n I was the template, not default\n ```\n \n ## View Context\n \n The default context of the compiled template is the view's controller:\n \n ```javascript\n AView = Ember.View.extend({\n template: Ember.HTMLBars.compile('Hello {{excitedGreeting}}')\n });\n \n aController = Ember.Object.create({\n firstName: 'Barry',\n excitedGreeting: Ember.computed('content.firstName', function() {\n return this.get('content.firstName') + '!!!';\n })\n });\n \n aView = AView.create({\n controller: aController\n });\n ```\n \n Will result in an HTML representation of:\n \n ```html\n Hello Barry!!!\n ```\n \n A context can also be explicitly supplied through the view's `context`\n property. If the view has neither `context` nor `controller` properties, the\n `parentView`'s context will be used.\n \n ## Layouts\n \n Views can have a secondary template that wraps their main template. Like\n primary templates, layouts can be any function that accepts an optional\n context parameter and returns a string of HTML that will be inserted inside\n view's tag. Views whose HTML element is self closing (e.g. ``)\n cannot have a layout and this property will be ignored.\n \n Most typically in Ember a layout will be a compiled template.\n \n A view's layout can be set directly with the `layout` property or reference\n an existing template by name with the `layoutName` property.\n \n A template used as a layout must contain a single use of the\n `{{yield}}` helper. The HTML contents of a view's rendered `template` will be\n inserted at this location:\n \n ```javascript\n AViewWithLayout = Ember.View.extend({\n layout: Ember.HTMLBars.compile(\"{{yield}}\"),\n template: Ember.HTMLBars.compile(\"I got wrapped\")\n });\n ```\n \n Will result in view instances with an HTML representation of:\n \n ```html\n \n \n I got wrapped\n \n \n ```\n \n See [Ember.Templates.helpers.yield](/api/classes/Ember.Templates.helpers.html#method_yield)\n for more information.\n \n ## Responding to Browser Events\n \n Views can respond to user-initiated events in one of three ways: method\n implementation, through an event manager, and through `{{action}}` helper use\n in their template or layout.\n \n ### Method Implementation\n \n Views can respond to user-initiated events by implementing a method that\n matches the event name. A `jQuery.Event` object will be passed as the\n argument to this method.\n \n ```javascript\n AView = Ember.View.extend({\n click: function(event) {\n // will be called when an instance's\n // rendered element is clicked\n }\n });\n ```\n \n ### Event Managers\n \n Views can define an object as their `eventManager` property. This object can\n then implement methods that match the desired event names. Matching events\n that occur on the view's rendered HTML or the rendered HTML of any of its DOM\n descendants will trigger this method. A `jQuery.Event` object will be passed\n as the first argument to the method and an `Ember.View` object as the\n second. The `Ember.View` will be the view whose rendered HTML was interacted\n with. This may be the view with the `eventManager` property or one of its\n descendant views.\n \n ```javascript\n AView = Ember.View.extend({\n eventManager: Ember.Object.create({\n doubleClick: function(event, view) {\n // will be called when an instance's\n // rendered element or any rendering\n // of this view's descendant\n // elements is clicked\n }\n })\n });\n ```\n \n An event defined for an event manager takes precedence over events of the\n same name handled through methods on the view.\n \n ```javascript\n AView = Ember.View.extend({\n mouseEnter: function(event) {\n // will never trigger.\n },\n eventManager: Ember.Object.create({\n mouseEnter: function(event, view) {\n // takes precedence over AView#mouseEnter\n }\n })\n });\n ```\n \n Similarly a view's event manager will take precedence for events of any views\n rendered as a descendant. A method name that matches an event name will not\n be called if the view instance was rendered inside the HTML representation of\n a view that has an `eventManager` property defined that handles events of the\n name. Events not handled by the event manager will still trigger method calls\n on the descendant.\n \n ```javascript\n var App = Ember.Application.create();\n App.OuterView = Ember.View.extend({\n template: Ember.HTMLBars.compile(\"outer {{#view 'inner'}}inner{{/view}} outer\"),\n eventManager: Ember.Object.create({\n mouseEnter: function(event, view) {\n // view might be instance of either\n // OuterView or InnerView depending on\n // where on the page the user interaction occurred\n }\n })\n });\n \n App.InnerView = Ember.View.extend({\n click: function(event) {\n // will be called if rendered inside\n // an OuterView because OuterView's\n // eventManager doesn't handle click events\n },\n mouseEnter: function(event) {\n // will never be called if rendered inside\n // an OuterView.\n }\n });\n ```\n \n ### `{{action}}` Helper\n \n See [Ember.Templates.helpers.action](/api/classes/Ember.Templates.helpers.html#method_action).\n \n ### Event Names\n \n All of the event handling approaches described above respond to the same set\n of events. The names of the built-in events are listed below. (The hash of\n built-in events exists in `Ember.EventDispatcher`.) Additional, custom events\n can be registered by using `Ember.Application.customEvents`.\n \n Touch events:\n \n * `touchStart`\n * `touchMove`\n * `touchEnd`\n * `touchCancel`\n \n Keyboard events\n \n * `keyDown`\n * `keyUp`\n * `keyPress`\n \n Mouse events\n \n * `mouseDown`\n * `mouseUp`\n * `contextMenu`\n * `click`\n * `doubleClick`\n * `mouseMove`\n * `focusIn`\n * `focusOut`\n * `mouseEnter`\n * `mouseLeave`\n \n Form events:\n \n * `submit`\n * `change`\n * `focusIn`\n * `focusOut`\n * `input`\n \n HTML5 drag and drop events:\n \n * `dragStart`\n * `drag`\n * `dragEnter`\n * `dragLeave`\n * `dragOver`\n * `dragEnd`\n * `drop`\n \n ## `{{view}}` Helper\n \n Other `Ember.View` instances can be included as part of a view's template by\n using the `{{view}}` helper. See [Ember.Templates.helpers.view](/api/classes/Ember.Templates.helpers.html#method_view)\n for additional information.\n \n @class View\n @namespace Ember\n @extends Ember.CoreView\n @deprecated See http://emberjs.com/deprecations/v1.x/#toc_ember-view\n @uses Ember.ViewSupport\n @uses Ember.ViewContextSupport\n @uses Ember.ViewChildViewsSupport\n @uses Ember.TemplateRenderingSupport\n @uses Ember.ClassNamesSupport\n @uses Ember.AttributeBindingsSupport\n @uses Ember.LegacyViewSupport\n @uses Ember.InstrumentationSupport\n @uses Ember.VisibilitySupport\n @uses Ember.AriaRoleSupport\n @public\n */\n // jscs:disable validateIndentation\n var View = _emberViewsViewsCore_view.default.extend(_emberViewsMixinsView_context_support.default, _emberViewsMixinsView_child_views_support.default, _emberViewsMixinsLegacy_child_views_support.default, _emberViewsMixinsView_state_support.default, _emberViewsMixinsTemplate_rendering_support.default, _emberViewsMixinsClass_names_support.default, _emberViewsMixinsLegacy_view_support.default, _emberViewsMixinsInstrumentation_support.default, _emberViewsMixinsVisibility_support.default, _emberViewsCompatAttrsProxy.default, _emberViewsMixinsAria_role_support.default, _emberViewsMixinsView_support.default, {\n init: function () {\n this._super.apply(this, arguments);\n\n if (!this._viewRegistry) {\n this._viewRegistry = View.views;\n }\n },\n\n /**\n Given a property name, returns a dasherized version of that\n property name if the property evaluates to a non-falsy value.\n For example, if the view has property `isUrgent` that evaluates to true,\n passing `isUrgent` to this method will return `\"is-urgent\"`.\n @method _classStringForProperty\n @param property\n @private\n */\n _classStringForProperty: function (parsedPath) {\n return View._classStringForValue(parsedPath.path, parsedPath.stream.value(), parsedPath.className, parsedPath.falsyClassName);\n }\n });\n\n _emberMetalDeprecate_property.deprecateProperty(View.prototype, 'currentState', '_currentState', {\n id: 'ember-view.current-state',\n until: '2.3.0',\n url: 'http://emberjs.com/deprecations/v2.x/#toc_ember-component-currentstate'\n });\n\n // jscs:enable validateIndentation\n\n /*\n Describe how the specified actions should behave in the various\n states that a view can exist in. Possible states:\n \n * preRender: when a view is first instantiated, and after its\n element was destroyed, it is in the preRender state\n * inBuffer: once a view has been rendered, but before it has\n been inserted into the DOM, it is in the inBuffer state\n * hasElement: the DOM representation of the view is created,\n and is ready to be inserted\n * inDOM: once a view has been inserted into the DOM it is in\n the inDOM state. A view spends the vast majority of its\n existence in this state.\n * destroyed: once a view has been destroyed (using the destroy\n method), it is in this state. No further actions can be invoked\n on a destroyed view.\n */\n\n // in the destroyed state, everything is illegal\n\n // before rendering has begun, all legal manipulations are noops.\n\n // inside the buffer, legal manipulations are done on the buffer\n\n // once the view has been inserted into the DOM, legal manipulations\n // are done on the DOM element.\n\n View.reopenClass({\n /**\n Global views hash\n @property views\n @static\n @type Object\n @private\n */\n views: {},\n\n // If someone overrides the child views computed property when\n // defining their class, we want to be able to process the user's\n // supplied childViews and then restore the original computed property\n // at view initialization time. This happens in Ember.ContainerView's init\n // method.\n childViewsProperty: _emberViewsMixinsView_child_views_support.childViewsProperty\n });\n\n function viewDeprecationMessage() {\n _emberMetalDebug.deprecate('Ember.View is deprecated. Consult the Deprecations Guide for a migration strategy.', !!_emberMetalCore.default.ENV._ENABLE_LEGACY_VIEW_SUPPORT, {\n url: 'http://emberjs.com/deprecations/v1.x/#toc_ember-view',\n id: 'ember-views.view-deprecated',\n until: '2.4.0'\n });\n }\n\n var DeprecatedView = View.extend({\n init: function () {\n viewDeprecationMessage();\n this._super.apply(this, arguments);\n }\n });\n\n DeprecatedView.reopen = function () {\n viewDeprecationMessage();\n View.reopen.apply(View, arguments);\n return this;\n };\n\n exports.default = View;\n exports.ViewContextSupport = _emberViewsMixinsView_context_support.default;\n exports.ViewChildViewsSupport = _emberViewsMixinsView_child_views_support.default;\n exports.ViewStateSupport = _emberViewsMixinsView_state_support.default;\n exports.TemplateRenderingSupport = _emberViewsMixinsTemplate_rendering_support.default;\n exports.ClassNamesSupport = _emberViewsMixinsClass_names_support.default;\n exports.DeprecatedView = DeprecatedView;\n});\n// for the side effect of extending Ember.run.queues\nenifed('htmlbars-runtime/expression-visitor', ['exports'], function (exports) {\n /**\n # Expression Nodes:\n \n These nodes are not directly responsible for any part of the DOM, but are\n eventually passed to a Statement Node.\n \n * get\n * subexpr\n * concat\n */\n\n 'use strict';\n\n exports.acceptParams = acceptParams;\n exports.acceptHash = acceptHash;\n\n function acceptParams(nodes, env, scope) {\n var array = [];\n\n for (var i = 0, l = nodes.length; i < l; i++) {\n array.push(acceptExpression(nodes[i], env, scope).value);\n }\n\n return array;\n }\n\n function acceptHash(pairs, env, scope) {\n var object = {};\n\n for (var i = 0, l = pairs.length; i < l; i += 2) {\n var key = pairs[i];\n var value = pairs[i + 1];\n object[key] = acceptExpression(value, env, scope).value;\n }\n\n return object;\n }\n\n function acceptExpression(node, env, scope) {\n var ret = { value: null };\n\n // Primitive literals are unambiguously non-array representations of\n // themselves.\n if (typeof node !== 'object' || node === null) {\n ret.value = node;\n } else {\n ret.value = evaluateNode(node, env, scope);\n }\n\n return ret;\n }\n\n function evaluateNode(node, env, scope) {\n switch (node[0]) {\n // can be used by manualElement\n case 'value':\n return node[1];\n case 'get':\n return evaluateGet(node, env, scope);\n case 'subexpr':\n return evaluateSubexpr(node, env, scope);\n case 'concat':\n return evaluateConcat(node, env, scope);\n }\n }\n\n function evaluateGet(node, env, scope) {\n var path = node[1];\n\n return env.hooks.get(env, scope, path);\n }\n\n function evaluateSubexpr(node, env, scope) {\n var path = node[1];\n var rawParams = node[2];\n var rawHash = node[3];\n\n var params = acceptParams(rawParams, env, scope);\n var hash = acceptHash(rawHash, env, scope);\n\n return env.hooks.subexpr(env, scope, path, params, hash);\n }\n\n function evaluateConcat(node, env, scope) {\n var rawParts = node[1];\n\n var parts = acceptParams(rawParts, env, scope);\n\n return env.hooks.concat(env, parts);\n }\n});\nenifed(\"htmlbars-runtime/hooks\", [\"exports\", \"htmlbars-runtime/render\", \"morph-range/morph-list\", \"htmlbars-util/object-utils\", \"htmlbars-util/morph-utils\", \"htmlbars-util/template-utils\"], function (exports, _htmlbarsRuntimeRender, _morphRangeMorphList, _htmlbarsUtilObjectUtils, _htmlbarsUtilMorphUtils, _htmlbarsUtilTemplateUtils) {\n \"use strict\";\n\n exports.wrap = wrap;\n exports.wrapForHelper = wrapForHelper;\n exports.createScope = createScope;\n exports.createFreshScope = createFreshScope;\n exports.bindShadowScope = bindShadowScope;\n exports.createChildScope = createChildScope;\n exports.bindSelf = bindSelf;\n exports.updateSelf = updateSelf;\n exports.bindLocal = bindLocal;\n exports.updateLocal = updateLocal;\n exports.bindBlock = bindBlock;\n exports.block = block;\n exports.continueBlock = continueBlock;\n exports.hostBlock = hostBlock;\n exports.handleRedirect = handleRedirect;\n exports.handleKeyword = handleKeyword;\n exports.linkRenderNode = linkRenderNode;\n exports.inline = inline;\n exports.keyword = keyword;\n exports.invokeHelper = invokeHelper;\n exports.classify = classify;\n exports.partial = partial;\n exports.range = range;\n exports.element = element;\n exports.attribute = attribute;\n exports.subexpr = subexpr;\n exports.get = get;\n exports.getRoot = getRoot;\n exports.getBlock = getBlock;\n exports.getChild = getChild;\n exports.getValue = getValue;\n exports.getCellOrValue = getCellOrValue;\n exports.component = component;\n exports.concat = concat;\n exports.hasHelper = hasHelper;\n exports.lookupHelper = lookupHelper;\n exports.bindScope = bindScope;\n exports.updateScope = updateScope;\n\n /**\n HTMLBars delegates the runtime behavior of a template to\n hooks provided by the host environment. These hooks explain\n the lexical environment of a Handlebars template, the internal\n representation of references, and the interaction between an\n HTMLBars template and the DOM it is managing.\n \n While HTMLBars host hooks have access to all of this internal\n machinery, templates and helpers have access to the abstraction\n provided by the host hooks.\n \n ## The Lexical Environment\n \n The default lexical environment of an HTMLBars template includes:\n \n * Any local variables, provided by *block arguments*\n * The current value of `self`\n \n ## Simple Nesting\n \n Let's look at a simple template with a nested block:\n \n ```hbs\n {{title}}\n \n {{#if author}}\n {{author}}\n {{/if}}\n ```\n \n In this case, the lexical environment at the top-level of the\n template does not change inside of the `if` block. This is\n achieved via an implementation of `if` that looks like this:\n \n ```js\n registerHelper('if', function(params) {\n if (!!params[0]) {\n return this.yield();\n }\n });\n ```\n \n A call to `this.yield` invokes the child template using the\n current lexical environment.\n \n ## Block Arguments\n \n It is possible for nested blocks to introduce new local\n variables:\n \n ```hbs\n {{#count-calls as |i|}}\n {{title}}\n Called {{i}} times\n {{/count}}\n ```\n \n In this example, the child block inherits its surrounding\n lexical environment, but augments it with a single new\n variable binding.\n \n The implementation of `count-calls` supplies the value of\n `i`, but does not otherwise alter the environment:\n \n ```js\n var count = 0;\n registerHelper('count-calls', function() {\n return this.yield([ ++count ]);\n });\n ```\n */\n\n function wrap(template) {\n if (template === null) {\n return null;\n }\n\n return {\n meta: template.meta,\n arity: template.arity,\n raw: template,\n render: function (self, env, options, blockArguments) {\n var scope = env.hooks.createFreshScope();\n\n var contextualElement = options && options.contextualElement;\n var renderOptions = new _htmlbarsRuntimeRender.RenderOptions(null, self, blockArguments, contextualElement);\n\n return _htmlbarsRuntimeRender.default(template, env, scope, renderOptions);\n }\n };\n }\n\n function wrapForHelper(template, env, scope, morph, renderState, visitor) {\n if (!template) {\n return {};\n }\n\n var yieldArgs = yieldTemplate(template, env, scope, morph, renderState, visitor);\n\n return {\n meta: template.meta,\n arity: template.arity,\n 'yield': yieldArgs, // quoted since it's a reserved word, see issue #420\n yieldItem: yieldItem(template, env, scope, morph, renderState, visitor),\n raw: template,\n\n render: function (self, blockArguments) {\n yieldArgs(blockArguments, self);\n }\n };\n }\n\n // Called by a user-land helper to render a template.\n function yieldTemplate(template, env, parentScope, morph, renderState, visitor) {\n return function (blockArguments, self) {\n // Render state is used to track the progress of the helper (since it\n // may call into us multiple times). As the user-land helper calls\n // into library code, we track what needs to be cleaned up after the\n // helper has returned.\n //\n // Here, we remember that a template has been yielded and so we do not\n // need to remove the previous template. (If no template is yielded\n // this render by the helper, we assume nothing should be shown and\n // remove any previous rendered templates.)\n renderState.morphToClear = null;\n\n // In this conditional is true, it means that on the previous rendering pass\n // the helper yielded multiple items via `yieldItem()`, but this time they\n // are yielding a single template. In that case, we mark the morph list for\n // cleanup so it is removed from the DOM.\n if (morph.morphList) {\n _htmlbarsUtilTemplateUtils.clearMorphList(morph.morphList, morph, env);\n renderState.morphListToClear = null;\n }\n\n var scope = parentScope;\n\n if (morph.lastYielded && isStableTemplate(template, morph.lastYielded)) {\n return morph.lastResult.revalidateWith(env, undefined, self, blockArguments, visitor);\n }\n\n // Check to make sure that we actually **need** a new scope, and can't\n // share the parent scope. Note that we need to move this check into\n // a host hook, because the host's notion of scope may require a new\n // scope in more cases than the ones we can determine statically.\n if (self !== undefined || parentScope === null || template.arity) {\n scope = env.hooks.createChildScope(parentScope);\n }\n\n morph.lastYielded = { self: self, template: template, shadowTemplate: null };\n\n // Render the template that was selected by the helper\n var renderOptions = new _htmlbarsRuntimeRender.RenderOptions(morph, self, blockArguments);\n _htmlbarsRuntimeRender.default(template, env, scope, renderOptions);\n };\n }\n\n function yieldItem(template, env, parentScope, morph, renderState, visitor) {\n // Initialize state that tracks multiple items being\n // yielded in.\n var currentMorph = null;\n\n // Candidate morphs for deletion.\n var candidates = {};\n\n // Reuse existing MorphList if this is not a first-time\n // render.\n var morphList = morph.morphList;\n if (morphList) {\n currentMorph = morphList.firstChildMorph;\n }\n\n // Advances the currentMorph pointer to the morph in the previously-rendered\n // list that matches the yielded key. While doing so, it marks any morphs\n // that it advances past as candidates for deletion. Assuming those morphs\n // are not yielded in later, they will be removed in the prune step during\n // cleanup.\n // Note that this helper function assumes that the morph being seeked to is\n // guaranteed to exist in the previous MorphList; if this is called and the\n // morph does not exist, it will result in an infinite loop\n function advanceToKey(key) {\n var seek = currentMorph;\n\n while (seek.key !== key) {\n candidates[seek.key] = seek;\n seek = seek.nextMorph;\n }\n\n currentMorph = seek.nextMorph;\n return seek;\n }\n\n return function (_key, blockArguments, self) {\n if (typeof _key !== 'string') {\n throw new Error(\"You must provide a string key when calling `yieldItem`; you provided \" + _key);\n }\n\n // At least one item has been yielded, so we do not wholesale\n // clear the last MorphList but instead apply a prune operation.\n renderState.morphListToClear = null;\n morph.lastYielded = null;\n\n var morphList, morphMap;\n\n if (!morph.morphList) {\n morph.morphList = new _morphRangeMorphList.default();\n morph.morphMap = {};\n morph.setMorphList(morph.morphList);\n }\n\n morphList = morph.morphList;\n morphMap = morph.morphMap;\n\n // A map of morphs that have been yielded in on this\n // rendering pass. Any morphs that do not make it into\n // this list will be pruned from the MorphList during the cleanup\n // process.\n var handledMorphs = renderState.handledMorphs;\n var key = undefined;\n\n if (_key in handledMorphs) {\n // In this branch we are dealing with a duplicate key. The strategy\n // is to take the original key and append a counter to it that is\n // incremented every time the key is reused. In order to greatly\n // reduce the chance of colliding with another valid key we also add\n // an extra string \"--z8mS2hvDW0A--\" to the new key.\n var collisions = renderState.collisions;\n if (collisions === undefined) {\n collisions = renderState.collisions = {};\n }\n var count = collisions[_key] | 0;\n collisions[_key] = ++count;\n\n key = _key + '--z8mS2hvDW0A--' + count;\n } else {\n key = _key;\n }\n\n if (currentMorph && currentMorph.key === key) {\n yieldTemplate(template, env, parentScope, currentMorph, renderState, visitor)(blockArguments, self);\n currentMorph = currentMorph.nextMorph;\n handledMorphs[key] = currentMorph;\n } else if (morphMap[key] !== undefined) {\n var foundMorph = morphMap[key];\n\n if (key in candidates) {\n // If we already saw this morph, move it forward to this position\n morphList.insertBeforeMorph(foundMorph, currentMorph);\n } else {\n // Otherwise, move the pointer forward to the existing morph for this key\n advanceToKey(key);\n }\n\n handledMorphs[foundMorph.key] = foundMorph;\n yieldTemplate(template, env, parentScope, foundMorph, renderState, visitor)(blockArguments, self);\n } else {\n var childMorph = _htmlbarsRuntimeRender.createChildMorph(env.dom, morph);\n childMorph.key = key;\n morphMap[key] = handledMorphs[key] = childMorph;\n morphList.insertBeforeMorph(childMorph, currentMorph);\n yieldTemplate(template, env, parentScope, childMorph, renderState, visitor)(blockArguments, self);\n }\n\n renderState.morphListToPrune = morphList;\n morph.childNodes = null;\n };\n }\n\n function isStableTemplate(template, lastYielded) {\n return !lastYielded.shadowTemplate && template === lastYielded.template;\n }\n function optionsFor(template, inverse, env, scope, morph, visitor) {\n // If there was a template yielded last time, set morphToClear so it will be cleared\n // if no template is yielded on this render.\n var morphToClear = morph.lastResult ? morph : null;\n var renderState = new _htmlbarsUtilTemplateUtils.RenderState(morphToClear, morph.morphList || null);\n\n return {\n templates: {\n template: wrapForHelper(template, env, scope, morph, renderState, visitor),\n inverse: wrapForHelper(inverse, env, scope, morph, renderState, visitor)\n },\n renderState: renderState\n };\n }\n\n function thisFor(options) {\n return {\n arity: options.template.arity,\n 'yield': options.template.yield, // quoted since it's a reserved word, see issue #420\n yieldItem: options.template.yieldItem,\n yieldIn: options.template.yieldIn\n };\n }\n\n /**\n Host Hook: createScope\n \n @param {Scope?} parentScope\n @return Scope\n \n Corresponds to entering a new HTMLBars block.\n \n This hook is invoked when a block is entered with\n a new `self` or additional local variables.\n \n When invoked for a top-level template, the\n `parentScope` is `null`, and this hook should return\n a fresh Scope.\n \n When invoked for a child template, the `parentScope`\n is the scope for the parent environment.\n \n Note that the `Scope` is an opaque value that is\n passed to other host hooks. For example, the `get`\n hook uses the scope to retrieve a value for a given\n scope and variable name.\n */\n\n function createScope(env, parentScope) {\n if (parentScope) {\n return env.hooks.createChildScope(parentScope);\n } else {\n return env.hooks.createFreshScope();\n }\n }\n\n function createFreshScope() {\n // because `in` checks have unpredictable performance, keep a\n // separate dictionary to track whether a local was bound.\n // See `bindLocal` for more information.\n return { self: null, blocks: {}, locals: {}, localPresent: {} };\n }\n\n /**\n Host Hook: bindShadowScope\n \n @param {Scope?} parentScope\n @return Scope\n \n Corresponds to rendering a new template into an existing\n render tree, but with a new top-level lexical scope. This\n template is called the \"shadow root\".\n \n If a shadow template invokes `{{yield}}`, it will render\n the block provided to the shadow root in the original\n lexical scope.\n \n ```hbs\n {{!-- post template --}}\n {{props.title}}\n {{yield}}\n \n {{!-- blog template --}}\n {{#post title=\"Hello world\"}}\n by {{byline}}\n This is my first post\n {{/post}}\n \n {{#post title=\"Goodbye world\"}}\n by {{byline}}\n This is my last post\n {{/post}}\n ```\n \n ```js\n helpers.post = function(params, hash, options) {\n options.template.yieldIn(postTemplate, { props: hash });\n };\n \n blog.render({ byline: \"Yehuda Katz\" });\n ```\n \n Produces:\n \n ```html\n Hello world\n by Yehuda Katz\n This is my first post\n \n Goodbye world\n by Yehuda Katz\n This is my last post\n ```\n \n In short, `yieldIn` creates a new top-level scope for the\n provided template and renders it, making the original block\n available to `{{yield}}` in that template.\n */\n\n function bindShadowScope(env /*, parentScope, shadowScope */) {\n return env.hooks.createFreshScope();\n }\n\n function createChildScope(parent) {\n var scope = Object.create(parent);\n scope.locals = Object.create(parent.locals);\n scope.localPresent = Object.create(parent.localPresent);\n scope.blocks = Object.create(parent.blocks);\n return scope;\n }\n\n /**\n Host Hook: bindSelf\n \n @param {Scope} scope\n @param {any} self\n \n Corresponds to entering a template.\n \n This hook is invoked when the `self` value for a scope is ready to be bound.\n \n The host must ensure that child scopes reflect the change to the `self` in\n future calls to the `get` hook.\n */\n\n function bindSelf(env, scope, self) {\n scope.self = self;\n }\n\n function updateSelf(env, scope, self) {\n env.hooks.bindSelf(env, scope, self);\n }\n\n /**\n Host Hook: bindLocal\n \n @param {Environment} env\n @param {Scope} scope\n @param {String} name\n @param {any} value\n \n Corresponds to entering a template with block arguments.\n \n This hook is invoked when a local variable for a scope has been provided.\n \n The host must ensure that child scopes reflect the change in future calls\n to the `get` hook.\n */\n\n function bindLocal(env, scope, name, value) {\n scope.localPresent[name] = true;\n scope.locals[name] = value;\n }\n\n function updateLocal(env, scope, name, value) {\n env.hooks.bindLocal(env, scope, name, value);\n }\n\n /**\n Host Hook: bindBlock\n \n @param {Environment} env\n @param {Scope} scope\n @param {Function} block\n \n Corresponds to entering a shadow template that was invoked by a block helper with\n `yieldIn`.\n \n This hook is invoked with an opaque block that will be passed along\n to the shadow template, and inserted into the shadow template when\n `{{yield}}` is used. Optionally provide a non-default block name\n that can be targeted by `{{yield to=blockName}}`.\n */\n\n function bindBlock(env, scope, block) {\n var name = arguments.length <= 3 || arguments[3] === undefined ? 'default' : arguments[3];\n\n scope.blocks[name] = block;\n }\n\n /**\n Host Hook: block\n \n @param {RenderNode} renderNode\n @param {Environment} env\n @param {Scope} scope\n @param {String} path\n @param {Array} params\n @param {Object} hash\n @param {Block} block\n @param {Block} elseBlock\n \n Corresponds to:\n \n ```hbs\n {{#helper param1 param2 key1=val1 key2=val2}}\n {{!-- child template --}}\n {{/helper}}\n ```\n \n This host hook is a workhorse of the system. It is invoked\n whenever a block is encountered, and is responsible for\n resolving the helper to call, and then invoke it.\n \n The helper should be invoked with:\n \n - `{Array} params`: the parameters passed to the helper\n in the template.\n - `{Object} hash`: an object containing the keys and values passed\n in the hash position in the template.\n \n The values in `params` and `hash` will already be resolved\n through a previous call to the `get` host hook.\n \n The helper should be invoked with a `this` value that is\n an object with one field:\n \n `{Function} yield`: when invoked, this function executes the\n block with the current scope. It takes an optional array of\n block parameters. If block parameters are supplied, HTMLBars\n will invoke the `bindLocal` host hook to bind the supplied\n values to the block arguments provided by the template.\n \n In general, the default implementation of `block` should work\n for most host environments. It delegates to other host hooks\n where appropriate, and properly invokes the helper with the\n appropriate arguments.\n */\n\n function block(morph, env, scope, path, params, hash, template, inverse, visitor) {\n if (handleRedirect(morph, env, scope, path, params, hash, template, inverse, visitor)) {\n return;\n }\n\n continueBlock(morph, env, scope, path, params, hash, template, inverse, visitor);\n }\n\n function continueBlock(morph, env, scope, path, params, hash, template, inverse, visitor) {\n hostBlock(morph, env, scope, template, inverse, null, visitor, function (options) {\n var helper = env.hooks.lookupHelper(env, scope, path);\n return env.hooks.invokeHelper(morph, env, scope, visitor, params, hash, helper, options.templates, thisFor(options.templates));\n });\n }\n\n function hostBlock(morph, env, scope, template, inverse, shadowOptions, visitor, callback) {\n var options = optionsFor(template, inverse, env, scope, morph, visitor);\n _htmlbarsUtilTemplateUtils.renderAndCleanup(morph, env, options, shadowOptions, callback);\n }\n\n function handleRedirect(morph, env, scope, path, params, hash, template, inverse, visitor) {\n if (!path) {\n return false;\n }\n\n var redirect = env.hooks.classify(env, scope, path);\n if (redirect) {\n switch (redirect) {\n case 'component':\n env.hooks.component(morph, env, scope, path, params, hash, { default: template, inverse: inverse }, visitor);break;\n case 'inline':\n env.hooks.inline(morph, env, scope, path, params, hash, visitor);break;\n case 'block':\n env.hooks.block(morph, env, scope, path, params, hash, template, inverse, visitor);break;\n default:\n throw new Error(\"Internal HTMLBars redirection to \" + redirect + \" not supported\");\n }\n return true;\n }\n\n if (handleKeyword(path, morph, env, scope, params, hash, template, inverse, visitor)) {\n return true;\n }\n\n return false;\n }\n\n function handleKeyword(path, morph, env, scope, params, hash, template, inverse, visitor) {\n var keyword = env.hooks.keywords[path];\n if (!keyword) {\n return false;\n }\n\n if (typeof keyword === 'function') {\n return keyword(morph, env, scope, params, hash, template, inverse, visitor);\n }\n\n if (keyword.willRender) {\n keyword.willRender(morph, env);\n }\n\n var lastState, newState;\n if (keyword.setupState) {\n lastState = _htmlbarsUtilObjectUtils.shallowCopy(morph.getState());\n newState = morph.setState(keyword.setupState(lastState, env, scope, params, hash));\n }\n\n if (keyword.childEnv) {\n // Build the child environment...\n env = keyword.childEnv(morph.getState(), env);\n\n // ..then save off the child env builder on the render node. If the render\n // node tree is re-rendered and this node is not dirty, the child env\n // builder will still be invoked so that child dirty render nodes still get\n // the correct child env.\n morph.buildChildEnv = keyword.childEnv;\n }\n\n var firstTime = !morph.rendered;\n\n if (keyword.isEmpty) {\n var isEmpty = keyword.isEmpty(morph.getState(), env, scope, params, hash);\n\n if (isEmpty) {\n if (!firstTime) {\n _htmlbarsUtilTemplateUtils.clearMorph(morph, env, false);\n }\n return true;\n }\n }\n\n if (firstTime) {\n if (keyword.render) {\n keyword.render(morph, env, scope, params, hash, template, inverse, visitor);\n }\n morph.rendered = true;\n return true;\n }\n\n var isStable;\n if (keyword.isStable) {\n isStable = keyword.isStable(lastState, newState);\n } else {\n isStable = stableState(lastState, newState);\n }\n\n if (isStable) {\n if (keyword.rerender) {\n var newEnv = keyword.rerender(morph, env, scope, params, hash, template, inverse, visitor);\n env = newEnv || env;\n }\n _htmlbarsUtilMorphUtils.validateChildMorphs(env, morph, visitor);\n return true;\n } else {\n _htmlbarsUtilTemplateUtils.clearMorph(morph, env, false);\n }\n\n // If the node is unstable, re-render from scratch\n if (keyword.render) {\n keyword.render(morph, env, scope, params, hash, template, inverse, visitor);\n morph.rendered = true;\n return true;\n }\n }\n\n function stableState(oldState, newState) {\n if (_htmlbarsUtilObjectUtils.keyLength(oldState) !== _htmlbarsUtilObjectUtils.keyLength(newState)) {\n return false;\n }\n\n for (var prop in oldState) {\n if (oldState[prop] !== newState[prop]) {\n return false;\n }\n }\n\n return true;\n }\n\n function linkRenderNode() /* morph, env, scope, params, hash */{\n return;\n }\n\n /**\n Host Hook: inline\n \n @param {RenderNode} renderNode\n @param {Environment} env\n @param {Scope} scope\n @param {String} path\n @param {Array} params\n @param {Hash} hash\n \n Corresponds to:\n \n ```hbs\n {{helper param1 param2 key1=val1 key2=val2}}\n ```\n \n This host hook is similar to the `block` host hook, but it\n invokes helpers that do not supply an attached block.\n \n Like the `block` hook, the helper should be invoked with:\n \n - `{Array} params`: the parameters passed to the helper\n in the template.\n - `{Object} hash`: an object containing the keys and values passed\n in the hash position in the template.\n \n The values in `params` and `hash` will already be resolved\n through a previous call to the `get` host hook.\n \n In general, the default implementation of `inline` should work\n for most host environments. It delegates to other host hooks\n where appropriate, and properly invokes the helper with the\n appropriate arguments.\n \n The default implementation of `inline` also makes `partial`\n a keyword. Instead of invoking a helper named `partial`,\n it invokes the `partial` host hook.\n */\n\n function inline(morph, env, scope, path, params, hash, visitor) {\n if (handleRedirect(morph, env, scope, path, params, hash, null, null, visitor)) {\n return;\n }\n\n var value = undefined,\n hasValue = undefined;\n if (morph.linkedResult) {\n value = env.hooks.getValue(morph.linkedResult);\n hasValue = true;\n } else {\n var options = optionsFor(null, null, env, scope, morph);\n\n var helper = env.hooks.lookupHelper(env, scope, path);\n var result = env.hooks.invokeHelper(morph, env, scope, visitor, params, hash, helper, options.templates, thisFor(options.templates));\n\n if (result && result.link) {\n morph.linkedResult = result.value;\n _htmlbarsUtilMorphUtils.linkParams(env, scope, morph, '@content-helper', [morph.linkedResult], null);\n }\n\n if (result && 'value' in result) {\n value = env.hooks.getValue(result.value);\n hasValue = true;\n }\n }\n\n if (hasValue) {\n if (morph.lastValue !== value) {\n morph.setContent(value);\n }\n morph.lastValue = value;\n }\n }\n\n function keyword(path, morph, env, scope, params, hash, template, inverse, visitor) {\n handleKeyword(path, morph, env, scope, params, hash, template, inverse, visitor);\n }\n\n function invokeHelper(morph, env, scope, visitor, _params, _hash, helper, templates, context) {\n var params = normalizeArray(env, _params);\n var hash = normalizeObject(env, _hash);\n return { value: helper.call(context, params, hash, templates) };\n }\n\n function normalizeArray(env, array) {\n var out = new Array(array.length);\n\n for (var i = 0, l = array.length; i < l; i++) {\n out[i] = env.hooks.getCellOrValue(array[i]);\n }\n\n return out;\n }\n\n function normalizeObject(env, object) {\n var out = {};\n\n for (var prop in object) {\n out[prop] = env.hooks.getCellOrValue(object[prop]);\n }\n\n return out;\n }\n\n function classify() /* env, scope, path */{\n return null;\n }\n\n var keywords = {\n partial: function (morph, env, scope, params) {\n var value = env.hooks.partial(morph, env, scope, params[0]);\n morph.setContent(value);\n return true;\n },\n\n // quoted since it's a reserved word, see issue #420\n 'yield': function (morph, env, scope, params, hash, template, inverse, visitor) {\n // the current scope is provided purely for the creation of shadow\n // scopes; it should not be provided to user code.\n\n var to = env.hooks.getValue(hash.to) || 'default';\n var block = env.hooks.getBlock(scope, to);\n\n if (block) {\n block.invoke(env, params, hash.self, morph, scope, visitor);\n }\n return true;\n },\n\n hasBlock: function (morph, env, scope, params) {\n var name = env.hooks.getValue(params[0]) || 'default';\n return !!env.hooks.getBlock(scope, name);\n },\n\n hasBlockParams: function (morph, env, scope, params) {\n var name = env.hooks.getValue(params[0]) || 'default';\n var block = env.hooks.getBlock(scope, name);\n return !!(block && block.arity);\n }\n\n };\n\n exports.keywords = keywords;\n /**\n Host Hook: partial\n \n @param {RenderNode} renderNode\n @param {Environment} env\n @param {Scope} scope\n @param {String} path\n \n Corresponds to:\n \n ```hbs\n {{partial \"location\"}}\n ```\n \n This host hook is invoked by the default implementation of\n the `inline` hook. This makes `partial` a keyword in an\n HTMLBars environment using the default `inline` host hook.\n \n It is implemented as a host hook so that it can retrieve\n the named partial out of the `Environment`. Helpers, in\n contrast, only have access to the values passed in to them,\n and not to the ambient lexical environment.\n \n The host hook should invoke the referenced partial with\n the ambient `self`.\n */\n\n function partial(renderNode, env, scope, path) {\n var template = env.partials[path];\n return template.render(scope.self, env, {}).fragment;\n }\n\n /**\n Host hook: range\n \n @param {RenderNode} renderNode\n @param {Environment} env\n @param {Scope} scope\n @param {any} value\n \n Corresponds to:\n \n ```hbs\n {{content}}\n {{{unescaped}}}\n ```\n \n This hook is responsible for updating a render node\n that represents a range of content with a value.\n */\n\n function range(morph, env, scope, path, value, visitor) {\n if (handleRedirect(morph, env, scope, path, [], {}, null, null, visitor)) {\n return;\n }\n\n value = env.hooks.getValue(value);\n\n if (morph.lastValue !== value) {\n morph.setContent(value);\n }\n\n morph.lastValue = value;\n }\n\n /**\n Host hook: element\n \n @param {RenderNode} renderNode\n @param {Environment} env\n @param {Scope} scope\n @param {String} path\n @param {Array} params\n @param {Hash} hash\n \n Corresponds to:\n \n ```hbs\n \n ```\n \n This hook is responsible for invoking a helper that\n modifies an element.\n \n Its purpose is largely legacy support for awkward\n idioms that became common when using the string-based\n Handlebars engine.\n \n Most of the uses of the `element` hook are expected\n to be superseded by component syntax and the\n `attribute` hook.\n */\n\n function element(morph, env, scope, path, params, hash, visitor) {\n if (handleRedirect(morph, env, scope, path, params, hash, null, null, visitor)) {\n return;\n }\n\n var helper = env.hooks.lookupHelper(env, scope, path);\n if (helper) {\n env.hooks.invokeHelper(null, env, scope, null, params, hash, helper, { element: morph.element });\n }\n }\n\n /**\n Host hook: attribute\n \n @param {RenderNode} renderNode\n @param {Environment} env\n @param {String} name\n @param {any} value\n \n Corresponds to:\n \n ```hbs\n \n ```\n \n This hook is responsible for updating a render node\n that represents an element's attribute with a value.\n \n It receives the name of the attribute as well as an\n already-resolved value, and should update the render\n node with the value if appropriate.\n */\n\n function attribute(morph, env, scope, name, value) {\n value = env.hooks.getValue(value);\n\n if (morph.lastValue !== value) {\n morph.setContent(value);\n }\n\n morph.lastValue = value;\n }\n\n function subexpr(env, scope, helperName, params, hash) {\n var helper = env.hooks.lookupHelper(env, scope, helperName);\n var result = env.hooks.invokeHelper(null, env, scope, null, params, hash, helper, {});\n if (result && 'value' in result) {\n return env.hooks.getValue(result.value);\n }\n }\n\n /**\n Host Hook: get\n \n @param {Environment} env\n @param {Scope} scope\n @param {String} path\n \n Corresponds to:\n \n ```hbs\n {{foo.bar}}\n ^\n \n {{helper foo.bar key=value}}\n ^ ^\n ```\n \n This hook is the \"leaf\" hook of the system. It is used to\n resolve a path relative to the current scope.\n */\n\n function get(env, scope, path) {\n if (path === '') {\n return scope.self;\n }\n\n var keys = path.split('.');\n var value = env.hooks.getRoot(scope, keys[0])[0];\n\n for (var i = 1; i < keys.length; i++) {\n if (value) {\n value = env.hooks.getChild(value, keys[i]);\n } else {\n break;\n }\n }\n\n return value;\n }\n\n function getRoot(scope, key) {\n if (scope.localPresent[key]) {\n return [scope.locals[key]];\n } else if (scope.self) {\n return [scope.self[key]];\n } else {\n return [undefined];\n }\n }\n\n function getBlock(scope, key) {\n return scope.blocks[key];\n }\n\n function getChild(value, key) {\n return value[key];\n }\n\n function getValue(reference) {\n return reference;\n }\n\n function getCellOrValue(reference) {\n return reference;\n }\n\n function component(morph, env, scope, tagName, params, attrs, templates, visitor) {\n if (env.hooks.hasHelper(env, scope, tagName)) {\n return env.hooks.block(morph, env, scope, tagName, params, attrs, templates.default, templates.inverse, visitor);\n }\n\n componentFallback(morph, env, scope, tagName, attrs, templates.default);\n }\n\n function concat(env, params) {\n var value = \"\";\n for (var i = 0, l = params.length; i < l; i++) {\n value += env.hooks.getValue(params[i]);\n }\n return value;\n }\n\n function componentFallback(morph, env, scope, tagName, attrs, template) {\n var element = env.dom.createElement(tagName);\n for (var name in attrs) {\n element.setAttribute(name, env.hooks.getValue(attrs[name]));\n }\n var fragment = _htmlbarsRuntimeRender.default(template, env, scope, {}).fragment;\n element.appendChild(fragment);\n morph.setNode(element);\n }\n\n function hasHelper(env, scope, helperName) {\n return env.helpers[helperName] !== undefined;\n }\n\n function lookupHelper(env, scope, helperName) {\n return env.helpers[helperName];\n }\n\n function bindScope() /* env, scope */{\n // this function is used to handle host-specified extensions to scope\n // other than `self`, `locals` and `block`.\n }\n\n function updateScope(env, scope) {\n env.hooks.bindScope(env, scope);\n }\n\n exports.default = {\n // fundamental hooks that you will likely want to override\n bindLocal: bindLocal,\n bindSelf: bindSelf,\n bindScope: bindScope,\n classify: classify,\n component: component,\n concat: concat,\n createFreshScope: createFreshScope,\n getChild: getChild,\n getRoot: getRoot,\n getBlock: getBlock,\n getValue: getValue,\n getCellOrValue: getCellOrValue,\n keywords: keywords,\n linkRenderNode: linkRenderNode,\n partial: partial,\n subexpr: subexpr,\n\n // fundamental hooks with good default behavior\n bindBlock: bindBlock,\n bindShadowScope: bindShadowScope,\n updateLocal: updateLocal,\n updateSelf: updateSelf,\n updateScope: updateScope,\n createChildScope: createChildScope,\n hasHelper: hasHelper,\n lookupHelper: lookupHelper,\n invokeHelper: invokeHelper,\n cleanupRenderNode: null,\n destroyRenderNode: null,\n willCleanupTree: null,\n didCleanupTree: null,\n willRenderNode: null,\n didRenderNode: null,\n\n // derived hooks\n attribute: attribute,\n block: block,\n createScope: createScope,\n element: element,\n get: get,\n inline: inline,\n range: range,\n keyword: keyword\n };\n});\nenifed(\"htmlbars-runtime/morph\", [\"exports\", \"morph-range\"], function (exports, _morphRange) {\n \"use strict\";\n\n var guid = 1;\n\n function HTMLBarsMorph(domHelper, contextualElement) {\n this.super$constructor(domHelper, contextualElement);\n\n this._state = undefined;\n this.ownerNode = null;\n this.isDirty = false;\n this.isSubtreeDirty = false;\n this.lastYielded = null;\n this.lastResult = null;\n this.lastValue = null;\n this.buildChildEnv = null;\n this.morphList = null;\n this.morphMap = null;\n this.key = null;\n this.linkedParams = null;\n this.linkedResult = null;\n this.childNodes = null;\n this.rendered = false;\n this.guid = \"range\" + guid++;\n this.seen = false;\n }\n\n HTMLBarsMorph.empty = function (domHelper, contextualElement) {\n var morph = new HTMLBarsMorph(domHelper, contextualElement);\n morph.clear();\n return morph;\n };\n\n HTMLBarsMorph.create = function (domHelper, contextualElement, node) {\n var morph = new HTMLBarsMorph(domHelper, contextualElement);\n morph.setNode(node);\n return morph;\n };\n\n HTMLBarsMorph.attach = function (domHelper, contextualElement, firstNode, lastNode) {\n var morph = new HTMLBarsMorph(domHelper, contextualElement);\n morph.setRange(firstNode, lastNode);\n return morph;\n };\n\n var prototype = HTMLBarsMorph.prototype = Object.create(_morphRange.default.prototype);\n prototype.constructor = HTMLBarsMorph;\n prototype.super$constructor = _morphRange.default;\n\n prototype.getState = function () {\n if (!this._state) {\n this._state = {};\n }\n\n return this._state;\n };\n\n prototype.setState = function (newState) {\n /*jshint -W093 */\n\n return this._state = newState;\n };\n\n exports.default = HTMLBarsMorph;\n});\nenifed(\"htmlbars-runtime/node-visitor\", [\"exports\", \"htmlbars-util/morph-utils\", \"htmlbars-runtime/expression-visitor\"], function (exports, _htmlbarsUtilMorphUtils, _htmlbarsRuntimeExpressionVisitor) {\n \"use strict\";\n\n /**\n Node classification:\n \n # Primary Statement Nodes:\n \n These nodes are responsible for a render node that represents a morph-range.\n \n * block\n * inline\n * content\n * element\n * component\n \n # Leaf Statement Nodes:\n \n This node is responsible for a render node that represents a morph-attr.\n \n * attribute\n */\n\n function linkParamsAndHash(env, scope, morph, path, params, hash) {\n if (morph.linkedParams) {\n params = morph.linkedParams.params;\n hash = morph.linkedParams.hash;\n } else {\n params = params && _htmlbarsRuntimeExpressionVisitor.acceptParams(params, env, scope);\n hash = hash && _htmlbarsRuntimeExpressionVisitor.acceptHash(hash, env, scope);\n }\n\n _htmlbarsUtilMorphUtils.linkParams(env, scope, morph, path, params, hash);\n return [params, hash];\n }\n\n var AlwaysDirtyVisitor = {\n\n block: function (node, morph, env, scope, template, visitor) {\n var path = node[1];\n var params = node[2];\n var hash = node[3];\n var templateId = node[4];\n var inverseId = node[5];\n\n var paramsAndHash = linkParamsAndHash(env, scope, morph, path, params, hash);\n\n morph.isDirty = morph.isSubtreeDirty = false;\n env.hooks.block(morph, env, scope, path, paramsAndHash[0], paramsAndHash[1], templateId === null ? null : template.templates[templateId], inverseId === null ? null : template.templates[inverseId], visitor);\n },\n\n inline: function (node, morph, env, scope, visitor) {\n var path = node[1];\n var params = node[2];\n var hash = node[3];\n\n var paramsAndHash = linkParamsAndHash(env, scope, morph, path, params, hash);\n\n morph.isDirty = morph.isSubtreeDirty = false;\n env.hooks.inline(morph, env, scope, path, paramsAndHash[0], paramsAndHash[1], visitor);\n },\n\n content: function (node, morph, env, scope, visitor) {\n var path = node[1];\n\n morph.isDirty = morph.isSubtreeDirty = false;\n\n if (isHelper(env, scope, path)) {\n env.hooks.inline(morph, env, scope, path, [], {}, visitor);\n if (morph.linkedResult) {\n _htmlbarsUtilMorphUtils.linkParams(env, scope, morph, '@content-helper', [morph.linkedResult], null);\n }\n return;\n }\n\n var params = undefined;\n if (morph.linkedParams) {\n params = morph.linkedParams.params;\n } else {\n params = [env.hooks.get(env, scope, path)];\n }\n\n _htmlbarsUtilMorphUtils.linkParams(env, scope, morph, '@range', params, null);\n env.hooks.range(morph, env, scope, path, params[0], visitor);\n },\n\n element: function (node, morph, env, scope, visitor) {\n var path = node[1];\n var params = node[2];\n var hash = node[3];\n\n var paramsAndHash = linkParamsAndHash(env, scope, morph, path, params, hash);\n\n morph.isDirty = morph.isSubtreeDirty = false;\n env.hooks.element(morph, env, scope, path, paramsAndHash[0], paramsAndHash[1], visitor);\n },\n\n attribute: function (node, morph, env, scope) {\n var name = node[1];\n var value = node[2];\n\n var paramsAndHash = linkParamsAndHash(env, scope, morph, '@attribute', [value], null);\n\n morph.isDirty = morph.isSubtreeDirty = false;\n env.hooks.attribute(morph, env, scope, name, paramsAndHash[0][0]);\n },\n\n component: function (node, morph, env, scope, template, visitor) {\n var path = node[1];\n var attrs = node[2];\n var templateId = node[3];\n var inverseId = node[4];\n\n var paramsAndHash = linkParamsAndHash(env, scope, morph, path, [], attrs);\n var templates = {\n default: template.templates[templateId],\n inverse: template.templates[inverseId]\n };\n\n morph.isDirty = morph.isSubtreeDirty = false;\n env.hooks.component(morph, env, scope, path, paramsAndHash[0], paramsAndHash[1], templates, visitor);\n },\n\n attributes: function (node, morph, env, scope, parentMorph, visitor) {\n var template = node[1];\n\n env.hooks.attributes(morph, env, scope, template, parentMorph, visitor);\n }\n\n };\n\n exports.AlwaysDirtyVisitor = AlwaysDirtyVisitor;\n exports.default = {\n block: function (node, morph, env, scope, template, visitor) {\n dirtyCheck(env, morph, visitor, function (visitor) {\n AlwaysDirtyVisitor.block(node, morph, env, scope, template, visitor);\n });\n },\n\n inline: function (node, morph, env, scope, visitor) {\n dirtyCheck(env, morph, visitor, function (visitor) {\n AlwaysDirtyVisitor.inline(node, morph, env, scope, visitor);\n });\n },\n\n content: function (node, morph, env, scope, visitor) {\n dirtyCheck(env, morph, visitor, function (visitor) {\n AlwaysDirtyVisitor.content(node, morph, env, scope, visitor);\n });\n },\n\n element: function (node, morph, env, scope, template, visitor) {\n dirtyCheck(env, morph, visitor, function (visitor) {\n AlwaysDirtyVisitor.element(node, morph, env, scope, template, visitor);\n });\n },\n\n attribute: function (node, morph, env, scope, template) {\n dirtyCheck(env, morph, null, function () {\n AlwaysDirtyVisitor.attribute(node, morph, env, scope, template);\n });\n },\n\n component: function (node, morph, env, scope, template, visitor) {\n dirtyCheck(env, morph, visitor, function (visitor) {\n AlwaysDirtyVisitor.component(node, morph, env, scope, template, visitor);\n });\n },\n\n attributes: function (node, morph, env, scope, parentMorph, visitor) {\n AlwaysDirtyVisitor.attributes(node, morph, env, scope, parentMorph, visitor);\n }\n };\n\n function dirtyCheck(_env, morph, visitor, callback) {\n var isDirty = morph.isDirty;\n var isSubtreeDirty = morph.isSubtreeDirty;\n var env = _env;\n\n if (isSubtreeDirty) {\n visitor = AlwaysDirtyVisitor;\n }\n\n if (isDirty || isSubtreeDirty) {\n callback(visitor);\n } else {\n if (morph.buildChildEnv) {\n env = morph.buildChildEnv(morph.getState(), env);\n }\n _htmlbarsUtilMorphUtils.validateChildMorphs(env, morph, visitor);\n }\n }\n\n function isHelper(env, scope, path) {\n return env.hooks.keywords[path] !== undefined || env.hooks.hasHelper(env, scope, path);\n }\n});\nenifed(\"htmlbars-runtime/render\", [\"exports\", \"htmlbars-util/morph-utils\", \"htmlbars-runtime/node-visitor\", \"htmlbars-runtime/morph\", \"htmlbars-util/template-utils\", \"htmlbars-util/void-tag-names\"], function (exports, _htmlbarsUtilMorphUtils, _htmlbarsRuntimeNodeVisitor, _htmlbarsRuntimeMorph, _htmlbarsUtilTemplateUtils, _htmlbarsUtilVoidTagNames) {\n \"use strict\";\n\n exports.default = render;\n exports.RenderOptions = RenderOptions;\n exports.manualElement = manualElement;\n exports.attachAttributes = attachAttributes;\n exports.createChildMorph = createChildMorph;\n exports.getCachedFragment = getCachedFragment;\n\n var svgNamespace = \"http://www.w3.org/2000/svg\";\n\n function render(template, env, scope, options) {\n var dom = env.dom;\n var contextualElement;\n\n if (options) {\n if (options.renderNode) {\n contextualElement = options.renderNode.contextualElement;\n } else if (options.contextualElement) {\n contextualElement = options.contextualElement;\n }\n }\n\n dom.detectNamespace(contextualElement);\n\n var renderResult = RenderResult.build(env, scope, template, options, contextualElement);\n renderResult.render();\n\n return renderResult;\n }\n\n function RenderOptions(renderNode, self, blockArguments, contextualElement) {\n this.renderNode = renderNode || null;\n this.self = self;\n this.blockArguments = blockArguments || null;\n this.contextualElement = contextualElement || null;\n }\n\n function RenderResult(env, scope, options, rootNode, ownerNode, nodes, fragment, template, shouldSetContent) {\n this.root = rootNode;\n this.fragment = fragment;\n\n this.nodes = nodes;\n this.template = template;\n this.statements = template.statements.slice();\n this.env = env;\n this.scope = scope;\n this.shouldSetContent = shouldSetContent;\n\n if (options.self !== undefined) {\n this.bindSelf(options.self);\n }\n if (options.blockArguments !== undefined) {\n this.bindLocals(options.blockArguments);\n }\n\n this.initializeNodes(ownerNode);\n }\n\n RenderResult.build = function (env, scope, template, options, contextualElement) {\n var dom = env.dom;\n var fragment = getCachedFragment(template, env);\n var nodes = template.buildRenderNodes(dom, fragment, contextualElement);\n\n var rootNode, ownerNode, shouldSetContent;\n\n if (options && options.renderNode) {\n rootNode = options.renderNode;\n ownerNode = rootNode.ownerNode;\n shouldSetContent = true;\n } else {\n rootNode = dom.createMorph(null, fragment.firstChild, fragment.lastChild, contextualElement);\n ownerNode = rootNode;\n rootNode.ownerNode = ownerNode;\n shouldSetContent = false;\n }\n\n if (rootNode.childNodes) {\n _htmlbarsUtilMorphUtils.visitChildren(rootNode.childNodes, function (node) {\n _htmlbarsUtilTemplateUtils.clearMorph(node, env, true);\n });\n }\n\n rootNode.childNodes = nodes;\n return new RenderResult(env, scope, options, rootNode, ownerNode, nodes, fragment, template, shouldSetContent);\n };\n\n function manualElement(tagName, attributes, _isEmpty) {\n var statements = [];\n\n for (var key in attributes) {\n if (typeof attributes[key] === 'string') {\n continue;\n }\n statements.push([\"attribute\", key, attributes[key]]);\n }\n\n var isEmpty = _isEmpty || _htmlbarsUtilVoidTagNames.default[tagName];\n\n if (!isEmpty) {\n statements.push(['content', 'yield']);\n }\n\n var template = {\n arity: 0,\n cachedFragment: null,\n hasRendered: false,\n buildFragment: function buildFragment(dom) {\n var el0 = dom.createDocumentFragment();\n if (tagName === 'svg') {\n dom.setNamespace(svgNamespace);\n }\n var el1 = dom.createElement(tagName);\n\n for (var key in attributes) {\n if (typeof attributes[key] !== 'string') {\n continue;\n }\n dom.setAttribute(el1, key, attributes[key]);\n }\n\n if (!isEmpty) {\n var el2 = dom.createComment(\"\");\n dom.appendChild(el1, el2);\n }\n\n dom.appendChild(el0, el1);\n\n return el0;\n },\n buildRenderNodes: function buildRenderNodes(dom, fragment) {\n var element = dom.childAt(fragment, [0]);\n var morphs = [];\n\n for (var key in attributes) {\n if (typeof attributes[key] === 'string') {\n continue;\n }\n morphs.push(dom.createAttrMorph(element, key));\n }\n\n if (!isEmpty) {\n morphs.push(dom.createMorphAt(element, 0, 0));\n }\n\n return morphs;\n },\n statements: statements,\n locals: [],\n templates: []\n };\n\n return template;\n }\n\n function attachAttributes(attributes) {\n var statements = [];\n\n for (var key in attributes) {\n if (typeof attributes[key] === 'string') {\n continue;\n }\n statements.push([\"attribute\", key, attributes[key]]);\n }\n\n var template = {\n arity: 0,\n cachedFragment: null,\n hasRendered: false,\n buildFragment: function buildFragment(dom) {\n var el0 = this.element;\n if (el0.namespaceURI === \"http://www.w3.org/2000/svg\") {\n dom.setNamespace(svgNamespace);\n }\n for (var key in attributes) {\n if (typeof attributes[key] !== 'string') {\n continue;\n }\n dom.setAttribute(el0, key, attributes[key]);\n }\n\n return el0;\n },\n buildRenderNodes: function buildRenderNodes(dom) {\n var element = this.element;\n var morphs = [];\n\n for (var key in attributes) {\n if (typeof attributes[key] === 'string') {\n continue;\n }\n morphs.push(dom.createAttrMorph(element, key));\n }\n\n return morphs;\n },\n statements: statements,\n locals: [],\n templates: [],\n element: null\n };\n\n return template;\n }\n\n RenderResult.prototype.initializeNodes = function (ownerNode) {\n var childNodes = this.root.childNodes;\n\n for (var i = 0, l = childNodes.length; i < l; i++) {\n childNodes[i].ownerNode = ownerNode;\n }\n };\n\n RenderResult.prototype.render = function () {\n this.root.lastResult = this;\n this.root.rendered = true;\n this.populateNodes(_htmlbarsRuntimeNodeVisitor.AlwaysDirtyVisitor);\n\n if (this.shouldSetContent && this.root.setContent) {\n this.root.setContent(this.fragment);\n }\n };\n\n RenderResult.prototype.dirty = function () {\n _htmlbarsUtilMorphUtils.visitChildren([this.root], function (node) {\n node.isDirty = true;\n });\n };\n\n RenderResult.prototype.revalidate = function (env, self, blockArguments, scope) {\n this.revalidateWith(env, scope, self, blockArguments, _htmlbarsRuntimeNodeVisitor.default);\n };\n\n RenderResult.prototype.rerender = function (env, self, blockArguments, scope) {\n this.revalidateWith(env, scope, self, blockArguments, _htmlbarsRuntimeNodeVisitor.AlwaysDirtyVisitor);\n };\n\n RenderResult.prototype.revalidateWith = function (env, scope, self, blockArguments, visitor) {\n if (env !== undefined) {\n this.env = env;\n }\n if (scope !== undefined) {\n this.scope = scope;\n }\n this.updateScope();\n\n if (self !== undefined) {\n this.updateSelf(self);\n }\n if (blockArguments !== undefined) {\n this.updateLocals(blockArguments);\n }\n\n this.populateNodes(visitor);\n };\n\n RenderResult.prototype.destroy = function () {\n var rootNode = this.root;\n _htmlbarsUtilTemplateUtils.clearMorph(rootNode, this.env, true);\n };\n\n RenderResult.prototype.populateNodes = function (visitor) {\n var env = this.env;\n var scope = this.scope;\n var template = this.template;\n var nodes = this.nodes;\n var statements = this.statements;\n var i, l;\n\n for (i = 0, l = statements.length; i < l; i++) {\n var statement = statements[i];\n var morph = nodes[i];\n\n if (env.hooks.willRenderNode) {\n env.hooks.willRenderNode(morph, env, scope);\n }\n\n switch (statement[0]) {\n case 'block':\n visitor.block(statement, morph, env, scope, template, visitor);break;\n case 'inline':\n visitor.inline(statement, morph, env, scope, visitor);break;\n case 'content':\n visitor.content(statement, morph, env, scope, visitor);break;\n case 'element':\n visitor.element(statement, morph, env, scope, template, visitor);break;\n case 'attribute':\n visitor.attribute(statement, morph, env, scope);break;\n case 'component':\n visitor.component(statement, morph, env, scope, template, visitor);break;\n }\n\n if (env.hooks.didRenderNode) {\n env.hooks.didRenderNode(morph, env, scope);\n }\n }\n };\n\n RenderResult.prototype.bindScope = function () {\n this.env.hooks.bindScope(this.env, this.scope);\n };\n\n RenderResult.prototype.updateScope = function () {\n this.env.hooks.updateScope(this.env, this.scope);\n };\n\n RenderResult.prototype.bindSelf = function (self) {\n this.env.hooks.bindSelf(this.env, this.scope, self);\n };\n\n RenderResult.prototype.updateSelf = function (self) {\n this.env.hooks.updateSelf(this.env, this.scope, self);\n };\n\n RenderResult.prototype.bindLocals = function (blockArguments) {\n var localNames = this.template.locals;\n\n for (var i = 0, l = localNames.length; i < l; i++) {\n this.env.hooks.bindLocal(this.env, this.scope, localNames[i], blockArguments[i]);\n }\n };\n\n RenderResult.prototype.updateLocals = function (blockArguments) {\n var localNames = this.template.locals;\n\n for (var i = 0, l = localNames.length; i < l; i++) {\n this.env.hooks.updateLocal(this.env, this.scope, localNames[i], blockArguments[i]);\n }\n };\n\n function initializeNode(node, owner) {\n node.ownerNode = owner;\n }\n\n function createChildMorph(dom, parentMorph, contextualElement) {\n var morph = _htmlbarsRuntimeMorph.default.empty(dom, contextualElement || parentMorph.contextualElement);\n initializeNode(morph, parentMorph.ownerNode);\n return morph;\n }\n\n function getCachedFragment(template, env) {\n var dom = env.dom,\n fragment;\n if (env.useFragmentCache && dom.canClone) {\n if (template.cachedFragment === null) {\n fragment = template.buildFragment(dom);\n if (template.hasRendered) {\n template.cachedFragment = fragment;\n } else {\n template.hasRendered = true;\n }\n }\n if (template.cachedFragment) {\n fragment = dom.cloneNode(template.cachedFragment, true);\n }\n } else if (!fragment) {\n fragment = template.buildFragment(dom);\n }\n\n return fragment;\n }\n});\nenifed('htmlbars-runtime', ['exports', 'htmlbars-runtime/hooks', 'htmlbars-runtime/render', 'htmlbars-util/morph-utils', 'htmlbars-util/template-utils'], function (exports, _htmlbarsRuntimeHooks, _htmlbarsRuntimeRender, _htmlbarsUtilMorphUtils, _htmlbarsUtilTemplateUtils) {\n 'use strict';\n\n var internal = {\n blockFor: _htmlbarsUtilTemplateUtils.blockFor,\n manualElement: _htmlbarsRuntimeRender.manualElement,\n hostBlock: _htmlbarsRuntimeHooks.hostBlock,\n continueBlock: _htmlbarsRuntimeHooks.continueBlock,\n hostYieldWithShadowTemplate: _htmlbarsRuntimeHooks.hostYieldWithShadowTemplate,\n visitChildren: _htmlbarsUtilMorphUtils.visitChildren,\n validateChildMorphs: _htmlbarsUtilMorphUtils.validateChildMorphs,\n clearMorph: _htmlbarsUtilTemplateUtils.clearMorph\n };\n\n exports.hooks = _htmlbarsRuntimeHooks.default;\n exports.render = _htmlbarsRuntimeRender.default;\n exports.internal = internal;\n});\nenifed('htmlbars-util/array-utils', ['exports'], function (exports) {\n 'use strict';\n\n exports.forEach = forEach;\n exports.map = map;\n\n function forEach(array, callback, binding) {\n var i, l;\n if (binding === undefined) {\n for (i = 0, l = array.length; i < l; i++) {\n callback(array[i], i, array);\n }\n } else {\n for (i = 0, l = array.length; i < l; i++) {\n callback.call(binding, array[i], i, array);\n }\n }\n }\n\n function map(array, callback) {\n var output = [];\n var i, l;\n\n for (i = 0, l = array.length; i < l; i++) {\n output.push(callback(array[i], i, array));\n }\n\n return output;\n }\n\n var getIdx;\n if (Array.prototype.indexOf) {\n getIdx = function (array, obj, from) {\n return array.indexOf(obj, from);\n };\n } else {\n getIdx = function (array, obj, from) {\n if (from === undefined || from === null) {\n from = 0;\n } else if (from < 0) {\n from = Math.max(0, array.length + from);\n }\n for (var i = from, l = array.length; i < l; i++) {\n if (array[i] === obj) {\n return i;\n }\n }\n return -1;\n };\n }\n\n var isArray = Array.isArray || function (array) {\n return Object.prototype.toString.call(array) === '[object Array]';\n };\n\n exports.isArray = isArray;\n var indexOfArray = getIdx;\n exports.indexOfArray = indexOfArray;\n});\nenifed('htmlbars-util/handlebars/safe-string', ['exports'], function (exports) {\n // Build out our basic SafeString type\n 'use strict';\n\n function SafeString(string) {\n this.string = string;\n }\n\n SafeString.prototype.toString = SafeString.prototype.toHTML = function () {\n return '' + this.string;\n };\n\n exports.default = SafeString;\n});\nenifed('htmlbars-util/handlebars/utils', ['exports'], function (exports) {\n 'use strict';\n\n exports.extend = extend;\n exports.indexOf = indexOf;\n exports.escapeExpression = escapeExpression;\n exports.isEmpty = isEmpty;\n exports.blockParams = blockParams;\n exports.appendContextPath = appendContextPath;\n var escape = {\n '&': '&',\n '<': '<',\n '>': '>',\n '\"': '"',\n \"'\": ''',\n '`': '`'\n };\n\n var badChars = /[&<>\"'`]/g,\n possible = /[&<>\"'`]/;\n\n function escapeChar(chr) {\n return escape[chr];\n }\n\n function extend(obj /* , ...source */) {\n for (var i = 1; i < arguments.length; i++) {\n for (var key in arguments[i]) {\n if (Object.prototype.hasOwnProperty.call(arguments[i], key)) {\n obj[key] = arguments[i][key];\n }\n }\n }\n\n return obj;\n }\n\n var toString = Object.prototype.toString;\n\n exports.toString = toString;\n // Sourced from lodash\n // https://github.com/bestiejs/lodash/blob/master/LICENSE.txt\n /*eslint-disable func-style, no-var */\n var isFunction = function (value) {\n return typeof value === 'function';\n };\n // fallback for older versions of Chrome and Safari\n /* istanbul ignore next */\n if (isFunction(/x/)) {\n exports.isFunction = isFunction = function (value) {\n return typeof value === 'function' && toString.call(value) === '[object Function]';\n };\n }\n var isFunction;\n exports.isFunction = isFunction;\n /*eslint-enable func-style, no-var */\n\n /* istanbul ignore next */\n var isArray = Array.isArray || function (value) {\n return value && typeof value === 'object' ? toString.call(value) === '[object Array]' : false;\n };\n\n exports.isArray = isArray;\n // Older IE versions do not directly support indexOf so we must implement our own, sadly.\n\n function indexOf(array, value) {\n for (var i = 0, len = array.length; i < len; i++) {\n if (array[i] === value) {\n return i;\n }\n }\n return -1;\n }\n\n function escapeExpression(string) {\n if (typeof string !== 'string') {\n // don't escape SafeStrings, since they're already safe\n if (string && string.toHTML) {\n return string.toHTML();\n } else if (string == null) {\n return '';\n } else if (!string) {\n return string + '';\n }\n\n // Force a string conversion as this will be done by the append regardless and\n // the regex test will do this transparently behind the scenes, causing issues if\n // an object's to string has escaped characters in it.\n string = '' + string;\n }\n\n if (!possible.test(string)) {\n return string;\n }\n return string.replace(badChars, escapeChar);\n }\n\n function isEmpty(value) {\n if (!value && value !== 0) {\n return true;\n } else if (isArray(value) && value.length === 0) {\n return true;\n } else {\n return false;\n }\n }\n\n function blockParams(params, ids) {\n params.path = ids;\n return params;\n }\n\n function appendContextPath(contextPath, id) {\n return (contextPath ? contextPath + '.' : '') + id;\n }\n});\nenifed(\"htmlbars-util/morph-utils\", [\"exports\"], function (exports) {\n /*globals console*/\n\n \"use strict\";\n\n exports.visitChildren = visitChildren;\n exports.validateChildMorphs = validateChildMorphs;\n exports.linkParams = linkParams;\n exports.dump = dump;\n\n function visitChildren(nodes, callback) {\n if (!nodes || nodes.length === 0) {\n return;\n }\n\n nodes = nodes.slice();\n\n while (nodes.length) {\n var node = nodes.pop();\n callback(node);\n\n if (node.childNodes) {\n nodes.push.apply(nodes, node.childNodes);\n } else if (node.firstChildMorph) {\n var current = node.firstChildMorph;\n\n while (current) {\n nodes.push(current);\n current = current.nextMorph;\n }\n } else if (node.morphList) {\n var current = node.morphList.firstChildMorph;\n\n while (current) {\n nodes.push(current);\n current = current.nextMorph;\n }\n }\n }\n }\n\n function validateChildMorphs(env, morph, visitor) {\n var morphList = morph.morphList;\n if (morph.morphList) {\n var current = morphList.firstChildMorph;\n\n while (current) {\n var next = current.nextMorph;\n validateChildMorphs(env, current, visitor);\n current = next;\n }\n } else if (morph.lastResult) {\n morph.lastResult.revalidateWith(env, undefined, undefined, undefined, visitor);\n } else if (morph.childNodes) {\n // This means that the childNodes were wired up manually\n for (var i = 0, l = morph.childNodes.length; i < l; i++) {\n validateChildMorphs(env, morph.childNodes[i], visitor);\n }\n }\n }\n\n function linkParams(env, scope, morph, path, params, hash) {\n if (morph.linkedParams) {\n return;\n }\n\n if (env.hooks.linkRenderNode(morph, env, scope, path, params, hash)) {\n morph.linkedParams = { params: params, hash: hash };\n }\n }\n\n function dump(node) {\n console.group(node, node.isDirty);\n\n if (node.childNodes) {\n map(node.childNodes, dump);\n } else if (node.firstChildMorph) {\n var current = node.firstChildMorph;\n\n while (current) {\n dump(current);\n current = current.nextMorph;\n }\n } else if (node.morphList) {\n dump(node.morphList);\n }\n\n console.groupEnd();\n }\n\n function map(nodes, cb) {\n for (var i = 0, l = nodes.length; i < l; i++) {\n cb(nodes[i]);\n }\n }\n});\nenifed('htmlbars-util/namespaces', ['exports'], function (exports) {\n // ref http://dev.w3.org/html5/spec-LC/namespaces.html\n 'use strict';\n\n exports.getAttrNamespace = getAttrNamespace;\n var defaultNamespaces = {\n html: 'http://www.w3.org/1999/xhtml',\n mathml: 'http://www.w3.org/1998/Math/MathML',\n svg: 'http://www.w3.org/2000/svg',\n xlink: 'http://www.w3.org/1999/xlink',\n xml: 'http://www.w3.org/XML/1998/namespace'\n };\n\n function getAttrNamespace(attrName, detectedNamespace) {\n if (detectedNamespace) {\n return detectedNamespace;\n }\n\n var namespace;\n\n var colonIndex = attrName.indexOf(':');\n if (colonIndex !== -1) {\n var prefix = attrName.slice(0, colonIndex);\n namespace = defaultNamespaces[prefix];\n }\n\n return namespace || null;\n }\n});\nenifed(\"htmlbars-util/object-utils\", [\"exports\"], function (exports) {\n \"use strict\";\n\n exports.merge = merge;\n exports.shallowCopy = shallowCopy;\n exports.keySet = keySet;\n exports.keyLength = keyLength;\n\n function merge(options, defaults) {\n for (var prop in defaults) {\n if (options.hasOwnProperty(prop)) {\n continue;\n }\n options[prop] = defaults[prop];\n }\n return options;\n }\n\n function shallowCopy(obj) {\n return merge({}, obj);\n }\n\n function keySet(obj) {\n var set = {};\n\n for (var prop in obj) {\n if (obj.hasOwnProperty(prop)) {\n set[prop] = true;\n }\n }\n\n return set;\n }\n\n function keyLength(obj) {\n var count = 0;\n\n for (var prop in obj) {\n if (obj.hasOwnProperty(prop)) {\n count++;\n }\n }\n\n return count;\n }\n});\nenifed(\"htmlbars-util/quoting\", [\"exports\"], function (exports) {\n \"use strict\";\n\n exports.hash = hash;\n exports.repeat = repeat;\n function escapeString(str) {\n str = str.replace(/\\\\/g, \"\\\\\\\\\");\n str = str.replace(/\"/g, '\\\\\"');\n str = str.replace(/\\n/g, \"\\\\n\");\n return str;\n }\n\n exports.escapeString = escapeString;\n\n function string(str) {\n return '\"' + escapeString(str) + '\"';\n }\n\n exports.string = string;\n\n function array(a) {\n return \"[\" + a + \"]\";\n }\n\n exports.array = array;\n\n function hash(pairs) {\n return \"{\" + pairs.join(\", \") + \"}\";\n }\n\n function repeat(chars, times) {\n var str = \"\";\n while (times--) {\n str += chars;\n }\n return str;\n }\n});\nenifed('htmlbars-util/safe-string', ['exports', 'htmlbars-util/handlebars/safe-string'], function (exports, _htmlbarsUtilHandlebarsSafeString) {\n 'use strict';\n\n exports.default = _htmlbarsUtilHandlebarsSafeString.default;\n});\nenifed(\"htmlbars-util/template-utils\", [\"exports\", \"htmlbars-util/morph-utils\", \"htmlbars-runtime/render\"], function (exports, _htmlbarsUtilMorphUtils, _htmlbarsRuntimeRender) {\n \"use strict\";\n\n exports.RenderState = RenderState;\n exports.blockFor = blockFor;\n exports.renderAndCleanup = renderAndCleanup;\n exports.clearMorph = clearMorph;\n exports.clearMorphList = clearMorphList;\n\n function RenderState(renderNode, morphList) {\n // The morph list that is no longer needed and can be\n // destroyed.\n this.morphListToClear = morphList;\n\n // The morph list that needs to be pruned of any items\n // that were not yielded on a subsequent render.\n this.morphListToPrune = null;\n\n // A map of morphs for each item yielded in during this\n // rendering pass. Any morphs in the DOM but not in this map\n // will be pruned during cleanup.\n this.handledMorphs = {};\n this.collisions = undefined;\n\n // The morph to clear once rendering is complete. By\n // default, we set this to the previous morph (to catch\n // the case where nothing is yielded; in that case, we\n // should just clear the morph). Otherwise this gets set\n // to null if anything is rendered.\n this.morphToClear = renderNode;\n\n this.shadowOptions = null;\n }\n\n function Block(render, template, blockOptions) {\n this.render = render;\n this.template = template;\n this.blockOptions = blockOptions;\n this.arity = template.arity;\n }\n\n Block.prototype.invoke = function (env, blockArguments, _self, renderNode, parentScope, visitor) {\n if (renderNode.lastResult) {\n renderNode.lastResult.revalidateWith(env, undefined, _self, blockArguments, visitor);\n } else {\n this._firstRender(env, blockArguments, _self, renderNode, parentScope);\n }\n };\n\n Block.prototype._firstRender = function (env, blockArguments, _self, renderNode, parentScope) {\n var options = { renderState: new RenderState(renderNode) };\n var render = this.render;\n var template = this.template;\n var scope = this.blockOptions.scope;\n\n var shadowScope = scope ? env.hooks.createChildScope(scope) : env.hooks.createFreshScope();\n\n env.hooks.bindShadowScope(env, parentScope, shadowScope, this.blockOptions.options);\n\n if (_self !== undefined) {\n env.hooks.bindSelf(env, shadowScope, _self);\n } else if (this.blockOptions.self !== undefined) {\n env.hooks.bindSelf(env, shadowScope, this.blockOptions.self);\n }\n\n bindBlocks(env, shadowScope, this.blockOptions.yieldTo);\n\n renderAndCleanup(renderNode, env, options, null, function () {\n options.renderState.morphToClear = null;\n var renderOptions = new _htmlbarsRuntimeRender.RenderOptions(renderNode, undefined, blockArguments);\n render(template, env, shadowScope, renderOptions);\n });\n };\n\n function blockFor(render, template, blockOptions) {\n return new Block(render, template, blockOptions);\n }\n\n function bindBlocks(env, shadowScope, blocks) {\n if (!blocks) {\n return;\n }\n if (blocks instanceof Block) {\n env.hooks.bindBlock(env, shadowScope, blocks);\n } else {\n for (var name in blocks) {\n if (blocks.hasOwnProperty(name)) {\n env.hooks.bindBlock(env, shadowScope, blocks[name], name);\n }\n }\n }\n }\n\n function renderAndCleanup(morph, env, options, shadowOptions, callback) {\n // The RenderState object is used to collect information about what the\n // helper or hook being invoked has yielded. Once it has finished either\n // yielding multiple items (via yieldItem) or a single template (via\n // yieldTemplate), we detect what was rendered and how it differs from\n // the previous render, cleaning up old state in DOM as appropriate.\n var renderState = options.renderState;\n renderState.collisions = undefined;\n renderState.shadowOptions = shadowOptions;\n\n // Invoke the callback, instructing it to save information about what it\n // renders into RenderState.\n var result = callback(options);\n\n // The hook can opt-out of cleanup if it handled cleanup itself.\n if (result && result.handled) {\n return;\n }\n\n var morphMap = morph.morphMap;\n\n // Walk the morph list, clearing any items that were yielded in a previous\n // render but were not yielded during this render.\n var morphList = renderState.morphListToPrune;\n if (morphList) {\n var handledMorphs = renderState.handledMorphs;\n var item = morphList.firstChildMorph;\n\n while (item) {\n var next = item.nextMorph;\n\n // If we don't see the key in handledMorphs, it wasn't\n // yielded in and we can safely remove it from DOM.\n if (!(item.key in handledMorphs)) {\n morphMap[item.key] = undefined;\n clearMorph(item, env, true);\n item.destroy();\n }\n\n item = next;\n }\n }\n\n morphList = renderState.morphListToClear;\n if (morphList) {\n clearMorphList(morphList, morph, env);\n }\n\n var toClear = renderState.morphToClear;\n if (toClear) {\n clearMorph(toClear, env);\n }\n }\n\n function clearMorph(morph, env, destroySelf) {\n var cleanup = env.hooks.cleanupRenderNode;\n var destroy = env.hooks.destroyRenderNode;\n var willCleanup = env.hooks.willCleanupTree;\n var didCleanup = env.hooks.didCleanupTree;\n\n function destroyNode(node) {\n if (cleanup) {\n cleanup(node);\n }\n if (destroy) {\n destroy(node);\n }\n }\n\n if (willCleanup) {\n willCleanup(env, morph, destroySelf);\n }\n if (cleanup) {\n cleanup(morph);\n }\n if (destroySelf && destroy) {\n destroy(morph);\n }\n\n _htmlbarsUtilMorphUtils.visitChildren(morph.childNodes, destroyNode);\n\n // TODO: Deal with logical children that are not in the DOM tree\n morph.clear();\n if (didCleanup) {\n didCleanup(env, morph, destroySelf);\n }\n\n morph.lastResult = null;\n morph.lastYielded = null;\n morph.childNodes = null;\n }\n\n function clearMorphList(morphList, morph, env) {\n var item = morphList.firstChildMorph;\n\n while (item) {\n var next = item.nextMorph;\n morph.morphMap[item.key] = undefined;\n clearMorph(item, env, true);\n item.destroy();\n\n item = next;\n }\n\n // Remove the MorphList from the morph.\n morphList.clear();\n morph.morphList = null;\n }\n});\nenifed(\"htmlbars-util/void-tag-names\", [\"exports\", \"htmlbars-util/array-utils\"], function (exports, _htmlbarsUtilArrayUtils) {\n \"use strict\";\n\n // The HTML elements in this list are speced by\n // http://www.w3.org/TR/html-markup/syntax.html#syntax-elements,\n // and will be forced to close regardless of if they have a\n // self-closing /> at the end.\n var voidTagNames = \"area base br col command embed hr img input keygen link meta param source track wbr\";\n var voidMap = {};\n\n _htmlbarsUtilArrayUtils.forEach(voidTagNames.split(\" \"), function (tagName) {\n voidMap[tagName] = true;\n });\n\n exports.default = voidMap;\n});\nenifed('htmlbars-util', ['exports', 'htmlbars-util/safe-string', 'htmlbars-util/handlebars/utils', 'htmlbars-util/namespaces', 'htmlbars-util/morph-utils'], function (exports, _htmlbarsUtilSafeString, _htmlbarsUtilHandlebarsUtils, _htmlbarsUtilNamespaces, _htmlbarsUtilMorphUtils) {\n 'use strict';\n\n exports.SafeString = _htmlbarsUtilSafeString.default;\n exports.escapeExpression = _htmlbarsUtilHandlebarsUtils.escapeExpression;\n exports.getAttrNamespace = _htmlbarsUtilNamespaces.getAttrNamespace;\n exports.validateChildMorphs = _htmlbarsUtilMorphUtils.validateChildMorphs;\n exports.linkParams = _htmlbarsUtilMorphUtils.linkParams;\n exports.dump = _htmlbarsUtilMorphUtils.dump;\n});\nenifed('morph-attr/sanitize-attribute-value', ['exports'], function (exports) {\n /* jshint scripturl:true */\n\n 'use strict';\n\n exports.sanitizeAttributeValue = sanitizeAttributeValue;\n var badProtocols = {\n 'javascript:': true,\n 'vbscript:': true\n };\n\n var badTags = {\n 'A': true,\n 'BODY': true,\n 'LINK': true,\n 'IMG': true,\n 'IFRAME': true,\n 'BASE': true,\n 'FORM': true\n };\n\n var badTagsForDataURI = {\n 'EMBED': true\n };\n\n var badAttributes = {\n 'href': true,\n 'src': true,\n 'background': true,\n 'action': true\n };\n\n exports.badAttributes = badAttributes;\n var badAttributesForDataURI = {\n 'src': true\n };\n\n function sanitizeAttributeValue(dom, element, attribute, value) {\n var tagName;\n\n if (!element) {\n tagName = null;\n } else {\n tagName = element.tagName.toUpperCase();\n }\n\n if (value && value.toHTML) {\n return value.toHTML();\n }\n\n if ((tagName === null || badTags[tagName]) && badAttributes[attribute]) {\n var protocol = dom.protocolForURL(value);\n if (badProtocols[protocol] === true) {\n return 'unsafe:' + value;\n }\n }\n\n if (badTagsForDataURI[tagName] && badAttributesForDataURI[attribute]) {\n return 'unsafe:' + value;\n }\n\n return value;\n }\n});\nenifed(\"morph-attr\", [\"exports\", \"morph-attr/sanitize-attribute-value\", \"dom-helper/prop\", \"dom-helper/build-html-dom\", \"htmlbars-util\"], function (exports, _morphAttrSanitizeAttributeValue, _domHelperProp, _domHelperBuildHtmlDom, _htmlbarsUtil) {\n \"use strict\";\n\n function getProperty() {\n return this.domHelper.getPropertyStrict(this.element, this.attrName);\n }\n\n function updateProperty(value) {\n if (this._renderedInitially === true || !_domHelperProp.isAttrRemovalValue(value)) {\n var element = this.element;\n var attrName = this.attrName;\n\n if (attrName === 'value' && element.tagName === 'INPUT' && element.value === value) {\n // Do nothing. Attempts to avoid accidently changing the input cursor location.\n // See https://github.com/tildeio/htmlbars/pull/447 for more details.\n } else {\n // do not render if initial value is undefined or null\n this.domHelper.setPropertyStrict(element, attrName, value);\n }\n }\n\n this._renderedInitially = true;\n }\n\n function getAttribute() {\n return this.domHelper.getAttribute(this.element, this.attrName);\n }\n\n function updateAttribute(value) {\n if (_domHelperProp.isAttrRemovalValue(value)) {\n this.domHelper.removeAttribute(this.element, this.attrName);\n } else {\n this.domHelper.setAttribute(this.element, this.attrName, value);\n }\n }\n\n function getAttributeNS() {\n return this.domHelper.getAttributeNS(this.element, this.namespace, this.attrName);\n }\n\n function updateAttributeNS(value) {\n if (_domHelperProp.isAttrRemovalValue(value)) {\n this.domHelper.removeAttribute(this.element, this.attrName);\n } else {\n this.domHelper.setAttributeNS(this.element, this.namespace, this.attrName, value);\n }\n }\n\n var UNSET = { unset: true };\n\n var guid = 1;\n\n AttrMorph.create = function (element, attrName, domHelper, namespace) {\n var ns = _htmlbarsUtil.getAttrNamespace(attrName, namespace);\n\n if (ns) {\n return new AttributeNSAttrMorph(element, attrName, domHelper, ns);\n } else {\n return createNonNamespacedAttrMorph(element, attrName, domHelper);\n }\n };\n\n function createNonNamespacedAttrMorph(element, attrName, domHelper) {\n var _normalizeProperty = _domHelperProp.normalizeProperty(element, attrName);\n\n var normalized = _normalizeProperty.normalized;\n var type = _normalizeProperty.type;\n\n if (element.namespaceURI === _domHelperBuildHtmlDom.svgNamespace || attrName === 'style' || type === 'attr') {\n return new AttributeAttrMorph(element, normalized, domHelper);\n } else {\n return new PropertyAttrMorph(element, normalized, domHelper);\n }\n }\n\n function AttrMorph(element, attrName, domHelper) {\n this.element = element;\n this.domHelper = domHelper;\n this.attrName = attrName;\n this._state = undefined;\n this.isDirty = false;\n this.isSubtreeDirty = false;\n this.escaped = true;\n this.lastValue = UNSET;\n this.lastResult = null;\n this.lastYielded = null;\n this.childNodes = null;\n this.linkedParams = null;\n this.linkedResult = null;\n this.guid = \"attr\" + guid++;\n this.seen = false;\n this.ownerNode = null;\n this.rendered = false;\n this._renderedInitially = false;\n this.namespace = undefined;\n this.didInit();\n }\n\n AttrMorph.prototype.getState = function () {\n if (!this._state) {\n this._state = {};\n }\n\n return this._state;\n };\n\n AttrMorph.prototype.setState = function (newState) {\n /*jshint -W093 */\n\n return this._state = newState;\n };\n\n AttrMorph.prototype.didInit = function () {};\n AttrMorph.prototype.willSetContent = function () {};\n\n AttrMorph.prototype.setContent = function (value) {\n this.willSetContent(value);\n\n if (this.lastValue === value) {\n return;\n }\n this.lastValue = value;\n\n if (this.escaped) {\n var sanitized = _morphAttrSanitizeAttributeValue.sanitizeAttributeValue(this.domHelper, this.element, this.attrName, value);\n this._update(sanitized, this.namespace);\n } else {\n this._update(value, this.namespace);\n }\n };\n\n AttrMorph.prototype.getContent = function () {\n var value = this.lastValue = this._get();\n return value;\n };\n\n // renderAndCleanup calls `clear` on all items in the morph map\n // just before calling `destroy` on the morph.\n //\n // As a future refactor this could be changed to set the property\n // back to its original/default value.\n AttrMorph.prototype.clear = function () {};\n\n AttrMorph.prototype.destroy = function () {\n this.element = null;\n this.domHelper = null;\n };\n\n AttrMorph.prototype._$superAttrMorph = AttrMorph;\n\n function PropertyAttrMorph(element, attrName, domHelper) {\n this._$superAttrMorph(element, attrName, domHelper);\n }\n\n PropertyAttrMorph.prototype = Object.create(AttrMorph.prototype);\n PropertyAttrMorph.prototype._update = updateProperty;\n PropertyAttrMorph.prototype._get = getProperty;\n\n function AttributeNSAttrMorph(element, attrName, domHelper, namespace) {\n this._$superAttrMorph(element, attrName, domHelper);\n this.namespace = namespace;\n }\n\n AttributeNSAttrMorph.prototype = Object.create(AttrMorph.prototype);\n AttributeNSAttrMorph.prototype._update = updateAttributeNS;\n AttributeNSAttrMorph.prototype._get = getAttributeNS;\n\n function AttributeAttrMorph(element, attrName, domHelper) {\n this._$superAttrMorph(element, attrName, domHelper);\n }\n\n AttributeAttrMorph.prototype = Object.create(AttrMorph.prototype);\n AttributeAttrMorph.prototype._update = updateAttribute;\n AttributeAttrMorph.prototype._get = getAttribute;\n\n exports.default = AttrMorph;\n exports.sanitizeAttributeValue = _morphAttrSanitizeAttributeValue.sanitizeAttributeValue;\n});\nenifed('morph-range/morph-list', ['exports', 'morph-range/utils'], function (exports, _morphRangeUtils) {\n 'use strict';\n\n function MorphList() {\n // morph graph\n this.firstChildMorph = null;\n this.lastChildMorph = null;\n\n this.mountedMorph = null;\n }\n\n var prototype = MorphList.prototype;\n\n prototype.clear = function MorphList$clear() {\n var current = this.firstChildMorph;\n\n while (current) {\n var next = current.nextMorph;\n current.previousMorph = null;\n current.nextMorph = null;\n current.parentMorphList = null;\n current = next;\n }\n\n this.firstChildMorph = this.lastChildMorph = null;\n };\n\n prototype.destroy = function MorphList$destroy() {};\n\n prototype.appendMorph = function MorphList$appendMorph(morph) {\n this.insertBeforeMorph(morph, null);\n };\n\n prototype.insertBeforeMorph = function MorphList$insertBeforeMorph(morph, referenceMorph) {\n if (morph.parentMorphList !== null) {\n morph.unlink();\n }\n if (referenceMorph && referenceMorph.parentMorphList !== this) {\n throw new Error('The morph before which the new morph is to be inserted is not a child of this morph.');\n }\n\n var mountedMorph = this.mountedMorph;\n\n if (mountedMorph) {\n\n var parentNode = mountedMorph.firstNode.parentNode;\n var referenceNode = referenceMorph ? referenceMorph.firstNode : mountedMorph.lastNode.nextSibling;\n\n _morphRangeUtils.insertBefore(parentNode, morph.firstNode, morph.lastNode, referenceNode);\n\n // was not in list mode replace current content\n if (!this.firstChildMorph) {\n _morphRangeUtils.clear(this.mountedMorph.firstNode.parentNode, this.mountedMorph.firstNode, this.mountedMorph.lastNode);\n }\n }\n\n morph.parentMorphList = this;\n\n var previousMorph = referenceMorph ? referenceMorph.previousMorph : this.lastChildMorph;\n if (previousMorph) {\n previousMorph.nextMorph = morph;\n morph.previousMorph = previousMorph;\n } else {\n this.firstChildMorph = morph;\n }\n\n if (referenceMorph) {\n referenceMorph.previousMorph = morph;\n morph.nextMorph = referenceMorph;\n } else {\n this.lastChildMorph = morph;\n }\n\n this.firstChildMorph._syncFirstNode();\n this.lastChildMorph._syncLastNode();\n };\n\n prototype.removeChildMorph = function MorphList$removeChildMorph(morph) {\n if (morph.parentMorphList !== this) {\n throw new Error(\"Cannot remove a morph from a parent it is not inside of\");\n }\n\n morph.destroy();\n };\n\n exports.default = MorphList;\n});\nenifed('morph-range/morph-list.umd', ['exports', 'morph-range/morph-list'], function (exports, _morphRangeMorphList) {\n 'use strict';\n\n (function (root, factory) {\n if (typeof define === 'function' && define.amd) {\n define([], factory);\n } else if (typeof exports === 'object') {\n module.exports = factory();\n } else {\n root.MorphList = factory();\n }\n })(undefined, function () {\n return _morphRangeMorphList.default;\n });\n});\nenifed(\"morph-range/utils\", [\"exports\"], function (exports) {\n // inclusive of both nodes\n \"use strict\";\n\n exports.clear = clear;\n exports.insertBefore = insertBefore;\n\n function clear(parentNode, firstNode, lastNode) {\n if (!parentNode) {\n return;\n }\n\n var node = firstNode;\n var nextNode;\n do {\n nextNode = node.nextSibling;\n parentNode.removeChild(node);\n if (node === lastNode) {\n break;\n }\n node = nextNode;\n } while (node);\n }\n\n function insertBefore(parentNode, firstNode, lastNode, refNode) {\n var node = firstNode;\n var nextNode;\n do {\n nextNode = node.nextSibling;\n parentNode.insertBefore(node, refNode);\n if (node === lastNode) {\n break;\n }\n node = nextNode;\n } while (node);\n }\n});\nenifed('morph-range', ['exports', 'morph-range/utils'], function (exports, _morphRangeUtils) {\n 'use strict';\n\n // constructor just initializes the fields\n // use one of the static initializers to create a valid morph.\n function Morph(domHelper, contextualElement) {\n this.domHelper = domHelper;\n // context if content if current content is detached\n this.contextualElement = contextualElement;\n // inclusive range of morph\n // these should be nodeType 1, 3, or 8\n this.firstNode = null;\n this.lastNode = null;\n\n // flag to force text to setContent to be treated as html\n this.parseTextAsHTML = false;\n\n // morph list graph\n this.parentMorphList = null;\n this.previousMorph = null;\n this.nextMorph = null;\n }\n\n Morph.empty = function (domHelper, contextualElement) {\n var morph = new Morph(domHelper, contextualElement);\n morph.clear();\n return morph;\n };\n\n Morph.create = function (domHelper, contextualElement, node) {\n var morph = new Morph(domHelper, contextualElement);\n morph.setNode(node);\n return morph;\n };\n\n Morph.attach = function (domHelper, contextualElement, firstNode, lastNode) {\n var morph = new Morph(domHelper, contextualElement);\n morph.setRange(firstNode, lastNode);\n return morph;\n };\n\n Morph.prototype.setContent = function Morph$setContent(content) {\n if (content === null || content === undefined) {\n return this.clear();\n }\n\n var type = typeof content;\n switch (type) {\n case 'string':\n if (this.parseTextAsHTML) {\n return this.domHelper.setMorphHTML(this, content);\n }\n return this.setText(content);\n case 'object':\n if (typeof content.nodeType === 'number') {\n return this.setNode(content);\n }\n /* Handlebars.SafeString */\n if (typeof content.toHTML === 'function') {\n return this.setHTML(content.toHTML());\n }\n if (this.parseTextAsHTML) {\n return this.setHTML(content.toString());\n }\n /* falls through */\n case 'boolean':\n case 'number':\n return this.setText(content.toString());\n case 'function':\n raiseCannotBindToFunction(content);\n default:\n throw new TypeError('unsupported content');\n }\n };\n\n function raiseCannotBindToFunction(content) {\n var functionName = content.name;\n var message;\n\n if (functionName) {\n message = 'Unsupported Content: Cannot bind to function `' + functionName + '`';\n } else {\n message = 'Unsupported Content: Cannot bind to function';\n }\n\n throw new TypeError(message);\n }\n\n Morph.prototype.clear = function Morph$clear() {\n var node = this.setNode(this.domHelper.createComment(''));\n return node;\n };\n\n Morph.prototype.setText = function Morph$setText(text) {\n var firstNode = this.firstNode;\n var lastNode = this.lastNode;\n\n if (firstNode && lastNode === firstNode && firstNode.nodeType === 3) {\n firstNode.nodeValue = text;\n return firstNode;\n }\n\n return this.setNode(text ? this.domHelper.createTextNode(text) : this.domHelper.createComment(''));\n };\n\n Morph.prototype.setNode = function Morph$setNode(newNode) {\n var firstNode, lastNode;\n switch (newNode.nodeType) {\n case 3:\n firstNode = newNode;\n lastNode = newNode;\n break;\n case 11:\n firstNode = newNode.firstChild;\n lastNode = newNode.lastChild;\n if (firstNode === null) {\n firstNode = this.domHelper.createComment('');\n newNode.appendChild(firstNode);\n lastNode = firstNode;\n }\n break;\n default:\n firstNode = newNode;\n lastNode = newNode;\n break;\n }\n\n this.setRange(firstNode, lastNode);\n\n return newNode;\n };\n\n Morph.prototype.setRange = function (firstNode, lastNode) {\n var previousFirstNode = this.firstNode;\n if (previousFirstNode !== null) {\n\n var parentNode = previousFirstNode.parentNode;\n if (parentNode !== null) {\n _morphRangeUtils.insertBefore(parentNode, firstNode, lastNode, previousFirstNode);\n _morphRangeUtils.clear(parentNode, previousFirstNode, this.lastNode);\n }\n }\n\n this.firstNode = firstNode;\n this.lastNode = lastNode;\n\n if (this.parentMorphList) {\n this._syncFirstNode();\n this._syncLastNode();\n }\n };\n\n Morph.prototype.destroy = function Morph$destroy() {\n this.unlink();\n\n var firstNode = this.firstNode;\n var lastNode = this.lastNode;\n var parentNode = firstNode && firstNode.parentNode;\n\n this.firstNode = null;\n this.lastNode = null;\n\n _morphRangeUtils.clear(parentNode, firstNode, lastNode);\n };\n\n Morph.prototype.unlink = function Morph$unlink() {\n var parentMorphList = this.parentMorphList;\n var previousMorph = this.previousMorph;\n var nextMorph = this.nextMorph;\n\n if (previousMorph) {\n if (nextMorph) {\n previousMorph.nextMorph = nextMorph;\n nextMorph.previousMorph = previousMorph;\n } else {\n previousMorph.nextMorph = null;\n parentMorphList.lastChildMorph = previousMorph;\n }\n } else {\n if (nextMorph) {\n nextMorph.previousMorph = null;\n parentMorphList.firstChildMorph = nextMorph;\n } else if (parentMorphList) {\n parentMorphList.lastChildMorph = parentMorphList.firstChildMorph = null;\n }\n }\n\n this.parentMorphList = null;\n this.nextMorph = null;\n this.previousMorph = null;\n\n if (parentMorphList && parentMorphList.mountedMorph) {\n if (!parentMorphList.firstChildMorph) {\n // list is empty\n parentMorphList.mountedMorph.clear();\n return;\n } else {\n parentMorphList.firstChildMorph._syncFirstNode();\n parentMorphList.lastChildMorph._syncLastNode();\n }\n }\n };\n\n Morph.prototype.setHTML = function (text) {\n var fragment = this.domHelper.parseHTML(text, this.contextualElement);\n return this.setNode(fragment);\n };\n\n Morph.prototype.setMorphList = function Morph$appendMorphList(morphList) {\n morphList.mountedMorph = this;\n this.clear();\n\n var originalFirstNode = this.firstNode;\n\n if (morphList.firstChildMorph) {\n this.firstNode = morphList.firstChildMorph.firstNode;\n this.lastNode = morphList.lastChildMorph.lastNode;\n\n var current = morphList.firstChildMorph;\n\n while (current) {\n var next = current.nextMorph;\n current.insertBeforeNode(originalFirstNode, null);\n current = next;\n }\n originalFirstNode.parentNode.removeChild(originalFirstNode);\n }\n };\n\n Morph.prototype._syncFirstNode = function Morph$syncFirstNode() {\n var morph = this;\n var parentMorphList;\n while (parentMorphList = morph.parentMorphList) {\n if (parentMorphList.mountedMorph === null) {\n break;\n }\n if (morph !== parentMorphList.firstChildMorph) {\n break;\n }\n if (morph.firstNode === parentMorphList.mountedMorph.firstNode) {\n break;\n }\n\n parentMorphList.mountedMorph.firstNode = morph.firstNode;\n\n morph = parentMorphList.mountedMorph;\n }\n };\n\n Morph.prototype._syncLastNode = function Morph$syncLastNode() {\n var morph = this;\n var parentMorphList;\n while (parentMorphList = morph.parentMorphList) {\n if (parentMorphList.mountedMorph === null) {\n break;\n }\n if (morph !== parentMorphList.lastChildMorph) {\n break;\n }\n if (morph.lastNode === parentMorphList.mountedMorph.lastNode) {\n break;\n }\n\n parentMorphList.mountedMorph.lastNode = morph.lastNode;\n\n morph = parentMorphList.mountedMorph;\n }\n };\n\n Morph.prototype.insertBeforeNode = function Morph$insertBeforeNode(parentNode, refNode) {\n _morphRangeUtils.insertBefore(parentNode, this.firstNode, this.lastNode, refNode);\n };\n\n Morph.prototype.appendToNode = function Morph$appendToNode(parentNode) {\n _morphRangeUtils.insertBefore(parentNode, this.firstNode, this.lastNode, null);\n };\n\n exports.default = Morph;\n});\nenifed(\"route-recognizer/dsl\", [\"exports\"], function (exports) {\n \"use strict\";\n\n function Target(path, matcher, delegate) {\n this.path = path;\n this.matcher = matcher;\n this.delegate = delegate;\n }\n\n Target.prototype = {\n to: function (target, callback) {\n var delegate = this.delegate;\n\n if (delegate && delegate.willAddRoute) {\n target = delegate.willAddRoute(this.matcher.target, target);\n }\n\n this.matcher.add(this.path, target);\n\n if (callback) {\n if (callback.length === 0) {\n throw new Error(\"You must have an argument in the function passed to `to`\");\n }\n this.matcher.addChild(this.path, target, callback, this.delegate);\n }\n return this;\n }\n };\n\n function Matcher(target) {\n this.routes = {};\n this.children = {};\n this.target = target;\n }\n\n Matcher.prototype = {\n add: function (path, handler) {\n this.routes[path] = handler;\n },\n\n addChild: function (path, target, callback, delegate) {\n var matcher = new Matcher(target);\n this.children[path] = matcher;\n\n var match = generateMatch(path, matcher, delegate);\n\n if (delegate && delegate.contextEntered) {\n delegate.contextEntered(target, match);\n }\n\n callback(match);\n }\n };\n\n function generateMatch(startingPath, matcher, delegate) {\n return function (path, nestedCallback) {\n var fullPath = startingPath + path;\n\n if (nestedCallback) {\n nestedCallback(generateMatch(fullPath, matcher, delegate));\n } else {\n return new Target(startingPath + path, matcher, delegate);\n }\n };\n }\n\n function addRoute(routeArray, path, handler) {\n var len = 0;\n for (var i = 0, l = routeArray.length; i < l; i++) {\n len += routeArray[i].path.length;\n }\n\n path = path.substr(len);\n var route = { path: path, handler: handler };\n routeArray.push(route);\n }\n\n function eachRoute(baseRoute, matcher, callback, binding) {\n var routes = matcher.routes;\n\n for (var path in routes) {\n if (routes.hasOwnProperty(path)) {\n var routeArray = baseRoute.slice();\n addRoute(routeArray, path, routes[path]);\n\n if (matcher.children[path]) {\n eachRoute(routeArray, matcher.children[path], callback, binding);\n } else {\n callback.call(binding, routeArray);\n }\n }\n }\n }\n\n exports.default = function (callback, addRouteCallback) {\n var matcher = new Matcher();\n\n callback(generateMatch(\"\", matcher, this.delegate));\n\n eachRoute([], matcher, function (route) {\n if (addRouteCallback) {\n addRouteCallback(this, route);\n } else {\n this.add(route);\n }\n }, this);\n };\n});\nenifed('route-recognizer', ['exports', 'route-recognizer/dsl'], function (exports, _routeRecognizerDsl) {\n 'use strict';\n\n var specials = ['/', '.', '*', '+', '?', '|', '(', ')', '[', ']', '{', '}', '\\\\'];\n\n var escapeRegex = new RegExp('(\\\\' + specials.join('|\\\\') + ')', 'g');\n\n function isArray(test) {\n return Object.prototype.toString.call(test) === \"[object Array]\";\n }\n\n // A Segment represents a segment in the original route description.\n // Each Segment type provides an `eachChar` and `regex` method.\n //\n // The `eachChar` method invokes the callback with one or more character\n // specifications. A character specification consumes one or more input\n // characters.\n //\n // The `regex` method returns a regex fragment for the segment. If the\n // segment is a dynamic of star segment, the regex fragment also includes\n // a capture.\n //\n // A character specification contains:\n //\n // * `validChars`: a String with a list of all valid characters, or\n // * `invalidChars`: a String with a list of all invalid characters\n // * `repeat`: true if the character specification can repeat\n\n function StaticSegment(string) {\n this.string = string;\n }\n StaticSegment.prototype = {\n eachChar: function (callback) {\n var string = this.string,\n ch;\n\n for (var i = 0, l = string.length; i < l; i++) {\n ch = string.charAt(i);\n callback({ validChars: ch });\n }\n },\n\n regex: function () {\n return this.string.replace(escapeRegex, '\\\\$1');\n },\n\n generate: function () {\n return this.string;\n }\n };\n\n function DynamicSegment(name) {\n this.name = name;\n }\n DynamicSegment.prototype = {\n eachChar: function (callback) {\n callback({ invalidChars: \"/\", repeat: true });\n },\n\n regex: function () {\n return \"([^/]+)\";\n },\n\n generate: function (params) {\n return params[this.name];\n }\n };\n\n function StarSegment(name) {\n this.name = name;\n }\n StarSegment.prototype = {\n eachChar: function (callback) {\n callback({ invalidChars: \"\", repeat: true });\n },\n\n regex: function () {\n return \"(.+)\";\n },\n\n generate: function (params) {\n return params[this.name];\n }\n };\n\n function EpsilonSegment() {}\n EpsilonSegment.prototype = {\n eachChar: function () {},\n regex: function () {\n return \"\";\n },\n generate: function () {\n return \"\";\n }\n };\n\n function parse(route, names, types) {\n // normalize route as not starting with a \"/\". Recognition will\n // also normalize.\n if (route.charAt(0) === \"/\") {\n route = route.substr(1);\n }\n\n var segments = route.split(\"/\"),\n results = [];\n\n for (var i = 0, l = segments.length; i < l; i++) {\n var segment = segments[i],\n match;\n\n if (match = segment.match(/^:([^\\/]+)$/)) {\n results.push(new DynamicSegment(match[1]));\n names.push(match[1]);\n types.dynamics++;\n } else if (match = segment.match(/^\\*([^\\/]+)$/)) {\n results.push(new StarSegment(match[1]));\n names.push(match[1]);\n types.stars++;\n } else if (segment === \"\") {\n results.push(new EpsilonSegment());\n } else {\n results.push(new StaticSegment(segment));\n types.statics++;\n }\n }\n\n return results;\n }\n\n // A State has a character specification and (`charSpec`) and a list of possible\n // subsequent states (`nextStates`).\n //\n // If a State is an accepting state, it will also have several additional\n // properties:\n //\n // * `regex`: A regular expression that is used to extract parameters from paths\n // that reached this accepting state.\n // * `handlers`: Information on how to convert the list of captures into calls\n // to registered handlers with the specified parameters\n // * `types`: How many static, dynamic or star segments in this route. Used to\n // decide which route to use if multiple registered routes match a path.\n //\n // Currently, State is implemented naively by looping over `nextStates` and\n // comparing a character specification against a character. A more efficient\n // implementation would use a hash of keys pointing at one or more next states.\n\n function State(charSpec) {\n this.charSpec = charSpec;\n this.nextStates = [];\n }\n\n State.prototype = {\n get: function (charSpec) {\n var nextStates = this.nextStates;\n\n for (var i = 0, l = nextStates.length; i < l; i++) {\n var child = nextStates[i];\n\n var isEqual = child.charSpec.validChars === charSpec.validChars;\n isEqual = isEqual && child.charSpec.invalidChars === charSpec.invalidChars;\n\n if (isEqual) {\n return child;\n }\n }\n },\n\n put: function (charSpec) {\n var state;\n\n // If the character specification already exists in a child of the current\n // state, just return that state.\n if (state = this.get(charSpec)) {\n return state;\n }\n\n // Make a new state for the character spec\n state = new State(charSpec);\n\n // Insert the new state as a child of the current state\n this.nextStates.push(state);\n\n // If this character specification repeats, insert the new state as a child\n // of itself. Note that this will not trigger an infinite loop because each\n // transition during recognition consumes a character.\n if (charSpec.repeat) {\n state.nextStates.push(state);\n }\n\n // Return the new state\n return state;\n },\n\n // Find a list of child states matching the next character\n match: function (ch) {\n // DEBUG \"Processing `\" + ch + \"`:\"\n var nextStates = this.nextStates,\n child,\n charSpec,\n chars;\n\n // DEBUG \" \" + debugState(this)\n var returned = [];\n\n for (var i = 0, l = nextStates.length; i < l; i++) {\n child = nextStates[i];\n\n charSpec = child.charSpec;\n\n if (typeof (chars = charSpec.validChars) !== 'undefined') {\n if (chars.indexOf(ch) !== -1) {\n returned.push(child);\n }\n } else if (typeof (chars = charSpec.invalidChars) !== 'undefined') {\n if (chars.indexOf(ch) === -1) {\n returned.push(child);\n }\n }\n }\n\n return returned;\n }\n\n /** IF DEBUG\n , debug: function() {\n var charSpec = this.charSpec,\n debug = \"[\",\n chars = charSpec.validChars || charSpec.invalidChars;\n if (charSpec.invalidChars) { debug += \"^\"; }\n debug += chars;\n debug += \"]\";\n if (charSpec.repeat) { debug += \"+\"; }\n return debug;\n }\n END IF **/\n };\n\n /** IF DEBUG\n function debug(log) {\n console.log(log);\n }\n \n function debugState(state) {\n return state.nextStates.map(function(n) {\n if (n.nextStates.length === 0) { return \"( \" + n.debug() + \" [accepting] )\"; }\n return \"( \" + n.debug() + \" \" + n.nextStates.map(function(s) { return s.debug() }).join(\" or \") + \" )\";\n }).join(\", \")\n }\n END IF **/\n\n // This is a somewhat naive strategy, but should work in a lot of cases\n // A better strategy would properly resolve /posts/:id/new and /posts/edit/:id.\n //\n // This strategy generally prefers more static and less dynamic matching.\n // Specifically, it\n //\n // * prefers fewer stars to more, then\n // * prefers using stars for less of the match to more, then\n // * prefers fewer dynamic segments to more, then\n // * prefers more static segments to more\n function sortSolutions(states) {\n return states.sort(function (a, b) {\n if (a.types.stars !== b.types.stars) {\n return a.types.stars - b.types.stars;\n }\n\n if (a.types.stars) {\n if (a.types.statics !== b.types.statics) {\n return b.types.statics - a.types.statics;\n }\n if (a.types.dynamics !== b.types.dynamics) {\n return b.types.dynamics - a.types.dynamics;\n }\n }\n\n if (a.types.dynamics !== b.types.dynamics) {\n return a.types.dynamics - b.types.dynamics;\n }\n if (a.types.statics !== b.types.statics) {\n return b.types.statics - a.types.statics;\n }\n\n return 0;\n });\n }\n\n function recognizeChar(states, ch) {\n var nextStates = [];\n\n for (var i = 0, l = states.length; i < l; i++) {\n var state = states[i];\n\n nextStates = nextStates.concat(state.match(ch));\n }\n\n return nextStates;\n }\n\n var oCreate = Object.create || function (proto) {\n function F() {}\n F.prototype = proto;\n return new F();\n };\n\n function RecognizeResults(queryParams) {\n this.queryParams = queryParams || {};\n }\n RecognizeResults.prototype = oCreate({\n splice: Array.prototype.splice,\n slice: Array.prototype.slice,\n push: Array.prototype.push,\n length: 0,\n queryParams: null\n });\n\n function findHandler(state, path, queryParams) {\n var handlers = state.handlers,\n regex = state.regex;\n var captures = path.match(regex),\n currentCapture = 1;\n var result = new RecognizeResults(queryParams);\n\n for (var i = 0, l = handlers.length; i < l; i++) {\n var handler = handlers[i],\n names = handler.names,\n params = {};\n\n for (var j = 0, m = names.length; j < m; j++) {\n params[names[j]] = captures[currentCapture++];\n }\n\n result.push({ handler: handler.handler, params: params, isDynamic: !!names.length });\n }\n\n return result;\n }\n\n function addSegment(currentState, segment) {\n segment.eachChar(function (ch) {\n var state;\n\n currentState = currentState.put(ch);\n });\n\n return currentState;\n }\n\n function decodeQueryParamPart(part) {\n // http://www.w3.org/TR/html401/interact/forms.html#h-17.13.4.1\n part = part.replace(/\\+/gm, '%20');\n return decodeURIComponent(part);\n }\n\n // The main interface\n\n var RouteRecognizer = function () {\n this.rootState = new State();\n this.names = {};\n };\n\n RouteRecognizer.prototype = {\n add: function (routes, options) {\n var currentState = this.rootState,\n regex = \"^\",\n types = { statics: 0, dynamics: 0, stars: 0 },\n handlers = [],\n allSegments = [],\n name;\n\n var isEmpty = true;\n\n for (var i = 0, l = routes.length; i < l; i++) {\n var route = routes[i],\n names = [];\n\n var segments = parse(route.path, names, types);\n\n allSegments = allSegments.concat(segments);\n\n for (var j = 0, m = segments.length; j < m; j++) {\n var segment = segments[j];\n\n if (segment instanceof EpsilonSegment) {\n continue;\n }\n\n isEmpty = false;\n\n // Add a \"/\" for the new segment\n currentState = currentState.put({ validChars: \"/\" });\n regex += \"/\";\n\n // Add a representation of the segment to the NFA and regex\n currentState = addSegment(currentState, segment);\n regex += segment.regex();\n }\n\n var handler = { handler: route.handler, names: names };\n handlers.push(handler);\n }\n\n if (isEmpty) {\n currentState = currentState.put({ validChars: \"/\" });\n regex += \"/\";\n }\n\n currentState.handlers = handlers;\n currentState.regex = new RegExp(regex + \"$\");\n currentState.types = types;\n\n if (name = options && options.as) {\n this.names[name] = {\n segments: allSegments,\n handlers: handlers\n };\n }\n },\n\n handlersFor: function (name) {\n var route = this.names[name],\n result = [];\n if (!route) {\n throw new Error(\"There is no route named \" + name);\n }\n\n for (var i = 0, l = route.handlers.length; i < l; i++) {\n result.push(route.handlers[i]);\n }\n\n return result;\n },\n\n hasRoute: function (name) {\n return !!this.names[name];\n },\n\n generate: function (name, params) {\n var route = this.names[name],\n output = \"\";\n if (!route) {\n throw new Error(\"There is no route named \" + name);\n }\n\n var segments = route.segments;\n\n for (var i = 0, l = segments.length; i < l; i++) {\n var segment = segments[i];\n\n if (segment instanceof EpsilonSegment) {\n continue;\n }\n\n output += \"/\";\n output += segment.generate(params);\n }\n\n if (output.charAt(0) !== '/') {\n output = '/' + output;\n }\n\n if (params && params.queryParams) {\n output += this.generateQueryString(params.queryParams, route.handlers);\n }\n\n return output;\n },\n\n generateQueryString: function (params, handlers) {\n var pairs = [];\n var keys = [];\n for (var key in params) {\n if (params.hasOwnProperty(key)) {\n keys.push(key);\n }\n }\n keys.sort();\n for (var i = 0, len = keys.length; i < len; i++) {\n key = keys[i];\n var value = params[key];\n if (value == null) {\n continue;\n }\n var pair = encodeURIComponent(key);\n if (isArray(value)) {\n for (var j = 0, l = value.length; j < l; j++) {\n var arrayPair = key + '[]' + '=' + encodeURIComponent(value[j]);\n pairs.push(arrayPair);\n }\n } else {\n pair += \"=\" + encodeURIComponent(value);\n pairs.push(pair);\n }\n }\n\n if (pairs.length === 0) {\n return '';\n }\n\n return \"?\" + pairs.join(\"&\");\n },\n\n parseQueryString: function (queryString) {\n var pairs = queryString.split(\"&\"),\n queryParams = {};\n for (var i = 0; i < pairs.length; i++) {\n var pair = pairs[i].split('='),\n key = decodeQueryParamPart(pair[0]),\n keyLength = key.length,\n isArray = false,\n value;\n if (pair.length === 1) {\n value = 'true';\n } else {\n //Handle arrays\n if (keyLength > 2 && key.slice(keyLength - 2) === '[]') {\n isArray = true;\n key = key.slice(0, keyLength - 2);\n if (!queryParams[key]) {\n queryParams[key] = [];\n }\n }\n value = pair[1] ? decodeQueryParamPart(pair[1]) : '';\n }\n if (isArray) {\n queryParams[key].push(value);\n } else {\n queryParams[key] = value;\n }\n }\n return queryParams;\n },\n\n recognize: function (path) {\n var states = [this.rootState],\n pathLen,\n i,\n l,\n queryStart,\n queryParams = {},\n isSlashDropped = false;\n\n queryStart = path.indexOf('?');\n if (queryStart !== -1) {\n var queryString = path.substr(queryStart + 1, path.length);\n path = path.substr(0, queryStart);\n queryParams = this.parseQueryString(queryString);\n }\n\n path = decodeURI(path);\n\n // DEBUG GROUP path\n\n if (path.charAt(0) !== \"/\") {\n path = \"/\" + path;\n }\n\n pathLen = path.length;\n if (pathLen > 1 && path.charAt(pathLen - 1) === \"/\") {\n path = path.substr(0, pathLen - 1);\n isSlashDropped = true;\n }\n\n for (i = 0, l = path.length; i < l; i++) {\n states = recognizeChar(states, path.charAt(i));\n if (!states.length) {\n break;\n }\n }\n\n // END DEBUG GROUP\n\n var solutions = [];\n for (i = 0, l = states.length; i < l; i++) {\n if (states[i].handlers) {\n solutions.push(states[i]);\n }\n }\n\n states = sortSolutions(solutions);\n\n var state = solutions[0];\n\n if (state && state.handlers) {\n // if a trailing slash was dropped and a star segment is the last segment\n // specified, put the trailing slash back\n if (isSlashDropped && state.regex.source.slice(-5) === \"(.+)$\") {\n path = path + \"/\";\n }\n return findHandler(state, path, queryParams);\n }\n }\n };\n\n RouteRecognizer.prototype.map = _routeRecognizerDsl.default;\n\n RouteRecognizer.VERSION = '0.1.5';\n\n exports.default = RouteRecognizer;\n});\nenifed('router/handler-info/factory', ['exports', 'router/handler-info/resolved-handler-info', 'router/handler-info/unresolved-handler-info-by-object', 'router/handler-info/unresolved-handler-info-by-param'], function (exports, _routerHandlerInfoResolvedHandlerInfo, _routerHandlerInfoUnresolvedHandlerInfoByObject, _routerHandlerInfoUnresolvedHandlerInfoByParam) {\n 'use strict';\n\n handlerInfoFactory.klasses = {\n resolved: _routerHandlerInfoResolvedHandlerInfo.default,\n param: _routerHandlerInfoUnresolvedHandlerInfoByParam.default,\n object: _routerHandlerInfoUnresolvedHandlerInfoByObject.default\n };\n\n function handlerInfoFactory(name, props) {\n var Ctor = handlerInfoFactory.klasses[name],\n handlerInfo = new Ctor(props || {});\n handlerInfo.factory = handlerInfoFactory;\n return handlerInfo;\n }\n\n exports.default = handlerInfoFactory;\n});\nenifed('router/handler-info/resolved-handler-info', ['exports', 'router/handler-info', 'router/utils', 'rsvp/promise'], function (exports, _routerHandlerInfo, _routerUtils, _rsvpPromise) {\n 'use strict';\n\n var ResolvedHandlerInfo = _routerUtils.subclass(_routerHandlerInfo.default, {\n resolve: function (shouldContinue, payload) {\n // A ResolvedHandlerInfo just resolved with itself.\n if (payload && payload.resolvedModels) {\n payload.resolvedModels[this.name] = this.context;\n }\n return _rsvpPromise.default.resolve(this, this.promiseLabel(\"Resolve\"));\n },\n\n getUnresolved: function () {\n return this.factory('param', {\n name: this.name,\n handler: this.handler,\n params: this.params\n });\n },\n\n isResolved: true\n });\n\n exports.default = ResolvedHandlerInfo;\n});\nenifed('router/handler-info/unresolved-handler-info-by-object', ['exports', 'router/handler-info', 'router/utils', 'rsvp/promise'], function (exports, _routerHandlerInfo, _routerUtils, _rsvpPromise) {\n 'use strict';\n\n var UnresolvedHandlerInfoByObject = _routerUtils.subclass(_routerHandlerInfo.default, {\n getModel: function (payload) {\n this.log(payload, this.name + \": resolving provided model\");\n return _rsvpPromise.default.resolve(this.context);\n },\n\n initialize: function (props) {\n this.names = props.names || [];\n this.context = props.context;\n },\n\n /**\n @private\n Serializes a handler using its custom `serialize` method or\n by a default that looks up the expected property name from\n the dynamic segment.\n @param {Object} model the model to be serialized for this handler\n */\n serialize: function (_model) {\n var model = _model || this.context,\n names = this.names,\n handler = this.handler;\n\n var object = {};\n if (_routerUtils.isParam(model)) {\n object[names[0]] = model;\n return object;\n }\n\n // Use custom serialize if it exists.\n if (handler.serialize) {\n return handler.serialize(model, names);\n }\n\n if (names.length !== 1) {\n return;\n }\n\n var name = names[0];\n\n if (/_id$/.test(name)) {\n object[name] = model.id;\n } else {\n object[name] = model;\n }\n return object;\n }\n });\n\n exports.default = UnresolvedHandlerInfoByObject;\n});\nenifed('router/handler-info/unresolved-handler-info-by-param', ['exports', 'router/handler-info', 'router/utils'], function (exports, _routerHandlerInfo, _routerUtils) {\n 'use strict';\n\n // Generated by URL transitions and non-dynamic route segments in named Transitions.\n var UnresolvedHandlerInfoByParam = _routerUtils.subclass(_routerHandlerInfo.default, {\n initialize: function (props) {\n this.params = props.params || {};\n },\n\n getModel: function (payload) {\n var fullParams = this.params;\n if (payload && payload.queryParams) {\n fullParams = {};\n _routerUtils.merge(fullParams, this.params);\n fullParams.queryParams = payload.queryParams;\n }\n\n var handler = this.handler;\n var hookName = _routerUtils.resolveHook(handler, 'deserialize') || _routerUtils.resolveHook(handler, 'model');\n\n return this.runSharedModelHook(payload, hookName, [fullParams]);\n }\n });\n\n exports.default = UnresolvedHandlerInfoByParam;\n});\nenifed('router/handler-info', ['exports', 'router/utils', 'rsvp/promise'], function (exports, _routerUtils, _rsvpPromise) {\n 'use strict';\n\n function HandlerInfo(_props) {\n var props = _props || {};\n _routerUtils.merge(this, props);\n this.initialize(props);\n }\n\n HandlerInfo.prototype = {\n name: null,\n handler: null,\n params: null,\n context: null,\n\n // Injected by the handler info factory.\n factory: null,\n\n initialize: function () {},\n\n log: function (payload, message) {\n if (payload.log) {\n payload.log(this.name + ': ' + message);\n }\n },\n\n promiseLabel: function (label) {\n return _routerUtils.promiseLabel(\"'\" + this.name + \"' \" + label);\n },\n\n getUnresolved: function () {\n return this;\n },\n\n serialize: function () {\n return this.params || {};\n },\n\n resolve: function (shouldContinue, payload) {\n var checkForAbort = _routerUtils.bind(this, this.checkForAbort, shouldContinue),\n beforeModel = _routerUtils.bind(this, this.runBeforeModelHook, payload),\n model = _routerUtils.bind(this, this.getModel, payload),\n afterModel = _routerUtils.bind(this, this.runAfterModelHook, payload),\n becomeResolved = _routerUtils.bind(this, this.becomeResolved, payload);\n\n return _rsvpPromise.default.resolve(undefined, this.promiseLabel(\"Start handler\")).then(checkForAbort, null, this.promiseLabel(\"Check for abort\")).then(beforeModel, null, this.promiseLabel(\"Before model\")).then(checkForAbort, null, this.promiseLabel(\"Check if aborted during 'beforeModel' hook\")).then(model, null, this.promiseLabel(\"Model\")).then(checkForAbort, null, this.promiseLabel(\"Check if aborted in 'model' hook\")).then(afterModel, null, this.promiseLabel(\"After model\")).then(checkForAbort, null, this.promiseLabel(\"Check if aborted in 'afterModel' hook\")).then(becomeResolved, null, this.promiseLabel(\"Become resolved\"));\n },\n\n runBeforeModelHook: function (payload) {\n if (payload.trigger) {\n payload.trigger(true, 'willResolveModel', payload, this.handler);\n }\n return this.runSharedModelHook(payload, 'beforeModel', []);\n },\n\n runAfterModelHook: function (payload, resolvedModel) {\n // Stash the resolved model on the payload.\n // This makes it possible for users to swap out\n // the resolved model in afterModel.\n var name = this.name;\n this.stashResolvedModel(payload, resolvedModel);\n\n return this.runSharedModelHook(payload, 'afterModel', [resolvedModel]).then(function () {\n // Ignore the fulfilled value returned from afterModel.\n // Return the value stashed in resolvedModels, which\n // might have been swapped out in afterModel.\n return payload.resolvedModels[name];\n }, null, this.promiseLabel(\"Ignore fulfillment value and return model value\"));\n },\n\n runSharedModelHook: function (payload, hookName, args) {\n this.log(payload, \"calling \" + hookName + \" hook\");\n\n if (this.queryParams) {\n args.push(this.queryParams);\n }\n args.push(payload);\n\n var result = _routerUtils.applyHook(this.handler, hookName, args);\n\n if (result && result.isTransition) {\n result = null;\n }\n\n return _rsvpPromise.default.resolve(result, this.promiseLabel(\"Resolve value returned from one of the model hooks\"));\n },\n\n // overridden by subclasses\n getModel: null,\n\n checkForAbort: function (shouldContinue, promiseValue) {\n return _rsvpPromise.default.resolve(shouldContinue(), this.promiseLabel(\"Check for abort\")).then(function () {\n // We don't care about shouldContinue's resolve value;\n // pass along the original value passed to this fn.\n return promiseValue;\n }, null, this.promiseLabel(\"Ignore fulfillment value and continue\"));\n },\n\n stashResolvedModel: function (payload, resolvedModel) {\n payload.resolvedModels = payload.resolvedModels || {};\n payload.resolvedModels[this.name] = resolvedModel;\n },\n\n becomeResolved: function (payload, resolvedContext) {\n var params = this.serialize(resolvedContext);\n\n if (payload) {\n this.stashResolvedModel(payload, resolvedContext);\n payload.params = payload.params || {};\n payload.params[this.name] = params;\n }\n\n return this.factory('resolved', {\n context: resolvedContext,\n name: this.name,\n handler: this.handler,\n params: params\n });\n },\n\n shouldSupercede: function (other) {\n // Prefer this newer handlerInfo over `other` if:\n // 1) The other one doesn't exist\n // 2) The names don't match\n // 3) This handler has a context that doesn't match\n // the other one (or the other one doesn't have one).\n // 4) This handler has parameters that don't match the other.\n if (!other) {\n return true;\n }\n\n var contextsMatch = other.context === this.context;\n return other.name !== this.name || this.hasOwnProperty('context') && !contextsMatch || this.hasOwnProperty('params') && !paramsMatch(this.params, other.params);\n }\n };\n\n function paramsMatch(a, b) {\n if (!a ^ !b) {\n // Only one is null.\n return false;\n }\n\n if (!a) {\n // Both must be null.\n return true;\n }\n\n // Note: this assumes that both params have the same\n // number of keys, but since we're comparing the\n // same handlers, they should.\n for (var k in a) {\n if (a.hasOwnProperty(k) && a[k] !== b[k]) {\n return false;\n }\n }\n return true;\n }\n\n exports.default = HandlerInfo;\n});\nenifed('router/router', ['exports', 'route-recognizer', 'rsvp/promise', 'router/utils', 'router/transition-state', 'router/transition', 'router/transition-intent/named-transition-intent', 'router/transition-intent/url-transition-intent', 'router/handler-info'], function (exports, _routeRecognizer, _rsvpPromise, _routerUtils, _routerTransitionState, _routerTransition, _routerTransitionIntentNamedTransitionIntent, _routerTransitionIntentUrlTransitionIntent, _routerHandlerInfo) {\n 'use strict';\n\n var pop = Array.prototype.pop;\n\n function Router(_options) {\n var options = _options || {};\n this.getHandler = options.getHandler || this.getHandler;\n this.updateURL = options.updateURL || this.updateURL;\n this.replaceURL = options.replaceURL || this.replaceURL;\n this.didTransition = options.didTransition || this.didTransition;\n this.willTransition = options.willTransition || this.willTransition;\n this.delegate = options.delegate || this.delegate;\n this.triggerEvent = options.triggerEvent || this.triggerEvent;\n this.log = options.log || this.log;\n\n this.recognizer = new _routeRecognizer.default();\n this.reset();\n }\n\n function getTransitionByIntent(intent, isIntermediate) {\n var wasTransitioning = !!this.activeTransition;\n var oldState = wasTransitioning ? this.activeTransition.state : this.state;\n var newTransition;\n\n var newState = intent.applyToState(oldState, this.recognizer, this.getHandler, isIntermediate);\n var queryParamChangelist = _routerUtils.getChangelist(oldState.queryParams, newState.queryParams);\n\n if (handlerInfosEqual(newState.handlerInfos, oldState.handlerInfos)) {\n\n // This is a no-op transition. See if query params changed.\n if (queryParamChangelist) {\n newTransition = this.queryParamsTransition(queryParamChangelist, wasTransitioning, oldState, newState);\n if (newTransition) {\n return newTransition;\n }\n }\n\n // No-op. No need to create a new transition.\n return this.activeTransition || new _routerTransition.Transition(this);\n }\n\n if (isIntermediate) {\n setupContexts(this, newState);\n return;\n }\n\n // Create a new transition to the destination route.\n newTransition = new _routerTransition.Transition(this, intent, newState);\n\n // Abort and usurp any previously active transition.\n if (this.activeTransition) {\n this.activeTransition.abort();\n }\n this.activeTransition = newTransition;\n\n // Transition promises by default resolve with resolved state.\n // For our purposes, swap out the promise to resolve\n // after the transition has been finalized.\n newTransition.promise = newTransition.promise.then(function (result) {\n return finalizeTransition(newTransition, result.state);\n }, null, _routerUtils.promiseLabel(\"Settle transition promise when transition is finalized\"));\n\n if (!wasTransitioning) {\n notifyExistingHandlers(this, newState, newTransition);\n }\n\n fireQueryParamDidChange(this, newState, queryParamChangelist);\n\n return newTransition;\n }\n\n Router.prototype = {\n\n /**\n The main entry point into the router. The API is essentially\n the same as the `map` method in `route-recognizer`.\n This method extracts the String handler at the last `.to()`\n call and uses it as the name of the whole route.\n @param {Function} callback\n */\n map: function (callback) {\n this.recognizer.delegate = this.delegate;\n\n this.recognizer.map(callback, function (recognizer, routes) {\n for (var i = routes.length - 1, proceed = true; i >= 0 && proceed; --i) {\n var route = routes[i];\n recognizer.add(routes, { as: route.handler });\n proceed = route.path === '/' || route.path === '' || route.handler.slice(-6) === '.index';\n }\n });\n },\n\n hasRoute: function (route) {\n return this.recognizer.hasRoute(route);\n },\n\n getHandler: function () {},\n\n queryParamsTransition: function (changelist, wasTransitioning, oldState, newState) {\n var router = this;\n\n fireQueryParamDidChange(this, newState, changelist);\n\n if (!wasTransitioning && this.activeTransition) {\n // One of the handlers in queryParamsDidChange\n // caused a transition. Just return that transition.\n return this.activeTransition;\n } else {\n // Running queryParamsDidChange didn't change anything.\n // Just update query params and be on our way.\n\n // We have to return a noop transition that will\n // perform a URL update at the end. This gives\n // the user the ability to set the url update\n // method (default is replaceState).\n var newTransition = new _routerTransition.Transition(this);\n newTransition.queryParamsOnly = true;\n\n oldState.queryParams = finalizeQueryParamChange(this, newState.handlerInfos, newState.queryParams, newTransition);\n\n newTransition.promise = newTransition.promise.then(function (result) {\n updateURL(newTransition, oldState, true);\n if (router.didTransition) {\n router.didTransition(router.currentHandlerInfos);\n }\n return result;\n }, null, _routerUtils.promiseLabel(\"Transition complete\"));\n return newTransition;\n }\n },\n\n // NOTE: this doesn't really belong here, but here\n // it shall remain until our ES6 transpiler can\n // handle cyclical deps.\n transitionByIntent: function (intent, isIntermediate) {\n try {\n return getTransitionByIntent.apply(this, arguments);\n } catch (e) {\n return new _routerTransition.Transition(this, intent, null, e);\n }\n },\n\n /**\n Clears the current and target route handlers and triggers exit\n on each of them starting at the leaf and traversing up through\n its ancestors.\n */\n reset: function () {\n if (this.state) {\n _routerUtils.forEach(this.state.handlerInfos.slice().reverse(), function (handlerInfo) {\n var handler = handlerInfo.handler;\n _routerUtils.callHook(handler, 'exit');\n });\n }\n\n this.state = new _routerTransitionState.default();\n this.currentHandlerInfos = null;\n },\n\n activeTransition: null,\n\n /**\n var handler = handlerInfo.handler;\n The entry point for handling a change to the URL (usually\n via the back and forward button).\n Returns an Array of handlers and the parameters associated\n with those parameters.\n @param {String} url a URL to process\n @return {Array} an Array of `[handler, parameter]` tuples\n */\n handleURL: function (url) {\n // Perform a URL-based transition, but don't change\n // the URL afterward, since it already happened.\n var args = _routerUtils.slice.call(arguments);\n if (url.charAt(0) !== '/') {\n args[0] = '/' + url;\n }\n\n return doTransition(this, args).method(null);\n },\n\n /**\n Hook point for updating the URL.\n @param {String} url a URL to update to\n */\n updateURL: function () {\n throw new Error(\"updateURL is not implemented\");\n },\n\n /**\n Hook point for replacing the current URL, i.e. with replaceState\n By default this behaves the same as `updateURL`\n @param {String} url a URL to update to\n */\n replaceURL: function (url) {\n this.updateURL(url);\n },\n\n /**\n Transition into the specified named route.\n If necessary, trigger the exit callback on any handlers\n that are no longer represented by the target route.\n @param {String} name the name of the route\n */\n transitionTo: function (name) {\n return doTransition(this, arguments);\n },\n\n intermediateTransitionTo: function (name) {\n return doTransition(this, arguments, true);\n },\n\n refresh: function (pivotHandler) {\n var state = this.activeTransition ? this.activeTransition.state : this.state;\n var handlerInfos = state.handlerInfos;\n var params = {};\n for (var i = 0, len = handlerInfos.length; i < len; ++i) {\n var handlerInfo = handlerInfos[i];\n params[handlerInfo.name] = handlerInfo.params || {};\n }\n\n _routerUtils.log(this, \"Starting a refresh transition\");\n var intent = new _routerTransitionIntentNamedTransitionIntent.default({\n name: handlerInfos[handlerInfos.length - 1].name,\n pivotHandler: pivotHandler || handlerInfos[0].handler,\n contexts: [], // TODO collect contexts...?\n queryParams: this._changedQueryParams || state.queryParams || {}\n });\n\n return this.transitionByIntent(intent, false);\n },\n\n /**\n Identical to `transitionTo` except that the current URL will be replaced\n if possible.\n This method is intended primarily for use with `replaceState`.\n @param {String} name the name of the route\n */\n replaceWith: function (name) {\n return doTransition(this, arguments).method('replace');\n },\n\n /**\n Take a named route and context objects and generate a\n URL.\n @param {String} name the name of the route to generate\n a URL for\n @param {...Object} objects a list of objects to serialize\n @return {String} a URL\n */\n generate: function (handlerName) {\n\n var partitionedArgs = _routerUtils.extractQueryParams(_routerUtils.slice.call(arguments, 1)),\n suppliedParams = partitionedArgs[0],\n queryParams = partitionedArgs[1];\n\n // Construct a TransitionIntent with the provided params\n // and apply it to the present state of the router.\n var intent = new _routerTransitionIntentNamedTransitionIntent.default({ name: handlerName, contexts: suppliedParams });\n var state = intent.applyToState(this.state, this.recognizer, this.getHandler);\n var params = {};\n\n for (var i = 0, len = state.handlerInfos.length; i < len; ++i) {\n var handlerInfo = state.handlerInfos[i];\n var handlerParams = handlerInfo.serialize();\n _routerUtils.merge(params, handlerParams);\n }\n params.queryParams = queryParams;\n\n return this.recognizer.generate(handlerName, params);\n },\n\n applyIntent: function (handlerName, contexts) {\n var intent = new _routerTransitionIntentNamedTransitionIntent.default({\n name: handlerName,\n contexts: contexts\n });\n\n var state = this.activeTransition && this.activeTransition.state || this.state;\n return intent.applyToState(state, this.recognizer, this.getHandler);\n },\n\n isActiveIntent: function (handlerName, contexts, queryParams, _state) {\n var state = _state || this.state,\n targetHandlerInfos = state.handlerInfos,\n found = false,\n names,\n object,\n handlerInfo,\n handlerObj,\n i,\n len;\n\n if (!targetHandlerInfos.length) {\n return false;\n }\n\n var targetHandler = targetHandlerInfos[targetHandlerInfos.length - 1].name;\n var recogHandlers = this.recognizer.handlersFor(targetHandler);\n\n var index = 0;\n for (len = recogHandlers.length; index < len; ++index) {\n handlerInfo = targetHandlerInfos[index];\n if (handlerInfo.name === handlerName) {\n break;\n }\n }\n\n if (index === recogHandlers.length) {\n // The provided route name isn't even in the route hierarchy.\n return false;\n }\n\n var testState = new _routerTransitionState.default();\n testState.handlerInfos = targetHandlerInfos.slice(0, index + 1);\n recogHandlers = recogHandlers.slice(0, index + 1);\n\n var intent = new _routerTransitionIntentNamedTransitionIntent.default({\n name: targetHandler,\n contexts: contexts\n });\n\n var newState = intent.applyToHandlers(testState, recogHandlers, this.getHandler, targetHandler, true, true);\n\n var handlersEqual = handlerInfosEqual(newState.handlerInfos, testState.handlerInfos);\n if (!queryParams || !handlersEqual) {\n return handlersEqual;\n }\n\n // Get a hash of QPs that will still be active on new route\n var activeQPsOnNewHandler = {};\n _routerUtils.merge(activeQPsOnNewHandler, queryParams);\n\n var activeQueryParams = state.queryParams;\n for (var key in activeQueryParams) {\n if (activeQueryParams.hasOwnProperty(key) && activeQPsOnNewHandler.hasOwnProperty(key)) {\n activeQPsOnNewHandler[key] = activeQueryParams[key];\n }\n }\n\n return handlersEqual && !_routerUtils.getChangelist(activeQPsOnNewHandler, queryParams);\n },\n\n isActive: function (handlerName) {\n var partitionedArgs = _routerUtils.extractQueryParams(_routerUtils.slice.call(arguments, 1));\n return this.isActiveIntent(handlerName, partitionedArgs[0], partitionedArgs[1]);\n },\n\n trigger: function (name) {\n var args = _routerUtils.slice.call(arguments);\n _routerUtils.trigger(this, this.currentHandlerInfos, false, args);\n },\n\n /**\n Hook point for logging transition status updates.\n @param {String} message The message to log.\n */\n log: null\n };\n\n /**\n @private\n \n Fires queryParamsDidChange event\n */\n function fireQueryParamDidChange(router, newState, queryParamChangelist) {\n // If queryParams changed trigger event\n if (queryParamChangelist) {\n\n // This is a little hacky but we need some way of storing\n // changed query params given that no activeTransition\n // is guaranteed to have occurred.\n router._changedQueryParams = queryParamChangelist.all;\n _routerUtils.trigger(router, newState.handlerInfos, true, ['queryParamsDidChange', queryParamChangelist.changed, queryParamChangelist.all, queryParamChangelist.removed]);\n router._changedQueryParams = null;\n }\n }\n\n /**\n @private\n \n Takes an Array of `HandlerInfo`s, figures out which ones are\n exiting, entering, or changing contexts, and calls the\n proper handler hooks.\n \n For example, consider the following tree of handlers. Each handler is\n followed by the URL segment it handles.\n \n ```\n |~index (\"/\")\n | |~posts (\"/posts\")\n | | |-showPost (\"/:id\")\n | | |-newPost (\"/new\")\n | | |-editPost (\"/edit\")\n | |~about (\"/about/:id\")\n ```\n \n Consider the following transitions:\n \n 1. A URL transition to `/posts/1`.\n 1. Triggers the `*model` callbacks on the\n `index`, `posts`, and `showPost` handlers\n 2. Triggers the `enter` callback on the same\n 3. Triggers the `setup` callback on the same\n 2. A direct transition to `newPost`\n 1. Triggers the `exit` callback on `showPost`\n 2. Triggers the `enter` callback on `newPost`\n 3. Triggers the `setup` callback on `newPost`\n 3. A direct transition to `about` with a specified\n context object\n 1. Triggers the `exit` callback on `newPost`\n and `posts`\n 2. Triggers the `serialize` callback on `about`\n 3. Triggers the `enter` callback on `about`\n 4. Triggers the `setup` callback on `about`\n \n @param {Router} transition\n @param {TransitionState} newState\n */\n function setupContexts(router, newState, transition) {\n var partition = partitionHandlers(router.state, newState);\n var i, l, handler;\n\n for (i = 0, l = partition.exited.length; i < l; i++) {\n handler = partition.exited[i].handler;\n delete handler.context;\n\n _routerUtils.callHook(handler, 'reset', true, transition);\n _routerUtils.callHook(handler, 'exit', transition);\n }\n\n var oldState = router.oldState = router.state;\n router.state = newState;\n var currentHandlerInfos = router.currentHandlerInfos = partition.unchanged.slice();\n\n try {\n for (i = 0, l = partition.reset.length; i < l; i++) {\n handler = partition.reset[i].handler;\n _routerUtils.callHook(handler, 'reset', false, transition);\n }\n\n for (i = 0, l = partition.updatedContext.length; i < l; i++) {\n handlerEnteredOrUpdated(currentHandlerInfos, partition.updatedContext[i], false, transition);\n }\n\n for (i = 0, l = partition.entered.length; i < l; i++) {\n handlerEnteredOrUpdated(currentHandlerInfos, partition.entered[i], true, transition);\n }\n } catch (e) {\n router.state = oldState;\n router.currentHandlerInfos = oldState.handlerInfos;\n throw e;\n }\n\n router.state.queryParams = finalizeQueryParamChange(router, currentHandlerInfos, newState.queryParams, transition);\n }\n\n /**\n @private\n \n Helper method used by setupContexts. Handles errors or redirects\n that may happen in enter/setup.\n */\n function handlerEnteredOrUpdated(currentHandlerInfos, handlerInfo, enter, transition) {\n\n var handler = handlerInfo.handler,\n context = handlerInfo.context;\n\n if (enter) {\n _routerUtils.callHook(handler, 'enter', transition);\n }\n if (transition && transition.isAborted) {\n throw new _routerTransition.TransitionAborted();\n }\n\n handler.context = context;\n _routerUtils.callHook(handler, 'contextDidChange');\n\n _routerUtils.callHook(handler, 'setup', context, transition);\n if (transition && transition.isAborted) {\n throw new _routerTransition.TransitionAborted();\n }\n\n currentHandlerInfos.push(handlerInfo);\n\n return true;\n }\n\n /**\n @private\n \n This function is called when transitioning from one URL to\n another to determine which handlers are no longer active,\n which handlers are newly active, and which handlers remain\n active but have their context changed.\n \n Take a list of old handlers and new handlers and partition\n them into four buckets:\n \n * unchanged: the handler was active in both the old and\n new URL, and its context remains the same\n * updated context: the handler was active in both the\n old and new URL, but its context changed. The handler's\n `setup` method, if any, will be called with the new\n context.\n * exited: the handler was active in the old URL, but is\n no longer active.\n * entered: the handler was not active in the old URL, but\n is now active.\n \n The PartitionedHandlers structure has four fields:\n \n * `updatedContext`: a list of `HandlerInfo` objects that\n represent handlers that remain active but have a changed\n context\n * `entered`: a list of `HandlerInfo` objects that represent\n handlers that are newly active\n * `exited`: a list of `HandlerInfo` objects that are no\n longer active.\n * `unchanged`: a list of `HanderInfo` objects that remain active.\n \n @param {Array[HandlerInfo]} oldHandlers a list of the handler\n information for the previous URL (or `[]` if this is the\n first handled transition)\n @param {Array[HandlerInfo]} newHandlers a list of the handler\n information for the new URL\n \n @return {Partition}\n */\n function partitionHandlers(oldState, newState) {\n var oldHandlers = oldState.handlerInfos;\n var newHandlers = newState.handlerInfos;\n\n var handlers = {\n updatedContext: [],\n exited: [],\n entered: [],\n unchanged: []\n };\n\n var handlerChanged,\n contextChanged = false,\n i,\n l;\n\n for (i = 0, l = newHandlers.length; i < l; i++) {\n var oldHandler = oldHandlers[i],\n newHandler = newHandlers[i];\n\n if (!oldHandler || oldHandler.handler !== newHandler.handler) {\n handlerChanged = true;\n }\n\n if (handlerChanged) {\n handlers.entered.push(newHandler);\n if (oldHandler) {\n handlers.exited.unshift(oldHandler);\n }\n } else if (contextChanged || oldHandler.context !== newHandler.context) {\n contextChanged = true;\n handlers.updatedContext.push(newHandler);\n } else {\n handlers.unchanged.push(oldHandler);\n }\n }\n\n for (i = newHandlers.length, l = oldHandlers.length; i < l; i++) {\n handlers.exited.unshift(oldHandlers[i]);\n }\n\n handlers.reset = handlers.updatedContext.slice();\n handlers.reset.reverse();\n\n return handlers;\n }\n\n function updateURL(transition, state, inputUrl) {\n var urlMethod = transition.urlMethod;\n\n if (!urlMethod) {\n return;\n }\n\n var router = transition.router,\n handlerInfos = state.handlerInfos,\n handlerName = handlerInfos[handlerInfos.length - 1].name,\n params = {};\n\n for (var i = handlerInfos.length - 1; i >= 0; --i) {\n var handlerInfo = handlerInfos[i];\n _routerUtils.merge(params, handlerInfo.params);\n if (handlerInfo.handler.inaccessibleByURL) {\n urlMethod = null;\n }\n }\n\n if (urlMethod) {\n params.queryParams = transition._visibleQueryParams || state.queryParams;\n var url = router.recognizer.generate(handlerName, params);\n\n if (urlMethod === 'replace') {\n router.replaceURL(url);\n } else {\n router.updateURL(url);\n }\n }\n }\n\n /**\n @private\n \n Updates the URL (if necessary) and calls `setupContexts`\n to update the router's array of `currentHandlerInfos`.\n */\n function finalizeTransition(transition, newState) {\n\n try {\n _routerUtils.log(transition.router, transition.sequence, \"Resolved all models on destination route; finalizing transition.\");\n\n var router = transition.router,\n handlerInfos = newState.handlerInfos,\n seq = transition.sequence;\n\n // Run all the necessary enter/setup/exit hooks\n setupContexts(router, newState, transition);\n\n // Check if a redirect occurred in enter/setup\n if (transition.isAborted) {\n // TODO: cleaner way? distinguish b/w targetHandlerInfos?\n router.state.handlerInfos = router.currentHandlerInfos;\n return _rsvpPromise.default.reject(_routerTransition.logAbort(transition));\n }\n\n updateURL(transition, newState, transition.intent.url);\n\n transition.isActive = false;\n router.activeTransition = null;\n\n _routerUtils.trigger(router, router.currentHandlerInfos, true, ['didTransition']);\n\n if (router.didTransition) {\n router.didTransition(router.currentHandlerInfos);\n }\n\n _routerUtils.log(router, transition.sequence, \"TRANSITION COMPLETE.\");\n\n // Resolve with the final handler.\n return handlerInfos[handlerInfos.length - 1].handler;\n } catch (e) {\n if (!(e instanceof _routerTransition.TransitionAborted)) {\n //var erroneousHandler = handlerInfos.pop();\n var infos = transition.state.handlerInfos;\n transition.trigger(true, 'error', e, transition, infos[infos.length - 1].handler);\n transition.abort();\n }\n\n throw e;\n }\n }\n\n /**\n @private\n \n Begins and returns a Transition based on the provided\n arguments. Accepts arguments in the form of both URL\n transitions and named transitions.\n \n @param {Router} router\n @param {Array[Object]} args arguments passed to transitionTo,\n replaceWith, or handleURL\n */\n function doTransition(router, args, isIntermediate) {\n // Normalize blank transitions to root URL transitions.\n var name = args[0] || '/';\n\n var lastArg = args[args.length - 1];\n var queryParams = {};\n if (lastArg && lastArg.hasOwnProperty('queryParams')) {\n queryParams = pop.call(args).queryParams;\n }\n\n var intent;\n if (args.length === 0) {\n\n _routerUtils.log(router, \"Updating query params\");\n\n // A query param update is really just a transition\n // into the route you're already on.\n var handlerInfos = router.state.handlerInfos;\n intent = new _routerTransitionIntentNamedTransitionIntent.default({\n name: handlerInfos[handlerInfos.length - 1].name,\n contexts: [],\n queryParams: queryParams\n });\n } else if (name.charAt(0) === '/') {\n\n _routerUtils.log(router, \"Attempting URL transition to \" + name);\n intent = new _routerTransitionIntentUrlTransitionIntent.default({ url: name });\n } else {\n\n _routerUtils.log(router, \"Attempting transition to \" + name);\n intent = new _routerTransitionIntentNamedTransitionIntent.default({\n name: args[0],\n contexts: _routerUtils.slice.call(args, 1),\n queryParams: queryParams\n });\n }\n\n return router.transitionByIntent(intent, isIntermediate);\n }\n\n function handlerInfosEqual(handlerInfos, otherHandlerInfos) {\n if (handlerInfos.length !== otherHandlerInfos.length) {\n return false;\n }\n\n for (var i = 0, len = handlerInfos.length; i < len; ++i) {\n if (handlerInfos[i] !== otherHandlerInfos[i]) {\n return false;\n }\n }\n return true;\n }\n\n function finalizeQueryParamChange(router, resolvedHandlers, newQueryParams, transition) {\n // We fire a finalizeQueryParamChange event which\n // gives the new route hierarchy a chance to tell\n // us which query params it's consuming and what\n // their final values are. If a query param is\n // no longer consumed in the final route hierarchy,\n // its serialized segment will be removed\n // from the URL.\n\n for (var k in newQueryParams) {\n if (newQueryParams.hasOwnProperty(k) && newQueryParams[k] === null) {\n delete newQueryParams[k];\n }\n }\n\n var finalQueryParamsArray = [];\n _routerUtils.trigger(router, resolvedHandlers, true, ['finalizeQueryParamChange', newQueryParams, finalQueryParamsArray, transition]);\n\n if (transition) {\n transition._visibleQueryParams = {};\n }\n\n var finalQueryParams = {};\n for (var i = 0, len = finalQueryParamsArray.length; i < len; ++i) {\n var qp = finalQueryParamsArray[i];\n finalQueryParams[qp.key] = qp.value;\n if (transition && qp.visible !== false) {\n transition._visibleQueryParams[qp.key] = qp.value;\n }\n }\n return finalQueryParams;\n }\n\n function notifyExistingHandlers(router, newState, newTransition) {\n var oldHandlers = router.state.handlerInfos,\n changing = [],\n leavingIndex = null,\n leaving,\n leavingChecker,\n i,\n oldHandlerLen,\n oldHandler,\n newHandler;\n\n oldHandlerLen = oldHandlers.length;\n for (i = 0; i < oldHandlerLen; i++) {\n oldHandler = oldHandlers[i];\n newHandler = newState.handlerInfos[i];\n\n if (!newHandler || oldHandler.name !== newHandler.name) {\n leavingIndex = i;\n break;\n }\n\n if (!newHandler.isResolved) {\n changing.push(oldHandler);\n }\n }\n\n if (leavingIndex !== null) {\n leaving = oldHandlers.slice(leavingIndex, oldHandlerLen);\n leavingChecker = function (name) {\n for (var h = 0, len = leaving.length; h < len; h++) {\n if (leaving[h].name === name) {\n return true;\n }\n }\n return false;\n };\n }\n\n _routerUtils.trigger(router, oldHandlers, true, ['willTransition', newTransition]);\n\n if (router.willTransition) {\n router.willTransition(oldHandlers, newState.handlerInfos, newTransition);\n }\n }\n\n exports.default = Router;\n});\nenifed('router/transition-intent/named-transition-intent', ['exports', 'router/transition-intent', 'router/transition-state', 'router/handler-info/factory', 'router/utils'], function (exports, _routerTransitionIntent, _routerTransitionState, _routerHandlerInfoFactory, _routerUtils) {\n 'use strict';\n\n exports.default = _routerUtils.subclass(_routerTransitionIntent.default, {\n name: null,\n pivotHandler: null,\n contexts: null,\n queryParams: null,\n\n initialize: function (props) {\n this.name = props.name;\n this.pivotHandler = props.pivotHandler;\n this.contexts = props.contexts || [];\n this.queryParams = props.queryParams;\n },\n\n applyToState: function (oldState, recognizer, getHandler, isIntermediate) {\n\n var partitionedArgs = _routerUtils.extractQueryParams([this.name].concat(this.contexts)),\n pureArgs = partitionedArgs[0],\n queryParams = partitionedArgs[1],\n handlers = recognizer.handlersFor(pureArgs[0]);\n\n var targetRouteName = handlers[handlers.length - 1].handler;\n\n return this.applyToHandlers(oldState, handlers, getHandler, targetRouteName, isIntermediate);\n },\n\n applyToHandlers: function (oldState, handlers, getHandler, targetRouteName, isIntermediate, checkingIfActive) {\n\n var i, len;\n var newState = new _routerTransitionState.default();\n var objects = this.contexts.slice(0);\n\n var invalidateIndex = handlers.length;\n\n // Pivot handlers are provided for refresh transitions\n if (this.pivotHandler) {\n for (i = 0, len = handlers.length; i < len; ++i) {\n if (getHandler(handlers[i].handler) === this.pivotHandler) {\n invalidateIndex = i;\n break;\n }\n }\n }\n\n var pivotHandlerFound = !this.pivotHandler;\n\n for (i = handlers.length - 1; i >= 0; --i) {\n var result = handlers[i];\n var name = result.handler;\n var handler = getHandler(name);\n\n var oldHandlerInfo = oldState.handlerInfos[i];\n var newHandlerInfo = null;\n\n if (result.names.length > 0) {\n if (i >= invalidateIndex) {\n newHandlerInfo = this.createParamHandlerInfo(name, handler, result.names, objects, oldHandlerInfo);\n } else {\n newHandlerInfo = this.getHandlerInfoForDynamicSegment(name, handler, result.names, objects, oldHandlerInfo, targetRouteName, i);\n }\n } else {\n // This route has no dynamic segment.\n // Therefore treat as a param-based handlerInfo\n // with empty params. This will cause the `model`\n // hook to be called with empty params, which is desirable.\n newHandlerInfo = this.createParamHandlerInfo(name, handler, result.names, objects, oldHandlerInfo);\n }\n\n if (checkingIfActive) {\n // If we're performing an isActive check, we want to\n // serialize URL params with the provided context, but\n // ignore mismatches between old and new context.\n newHandlerInfo = newHandlerInfo.becomeResolved(null, newHandlerInfo.context);\n var oldContext = oldHandlerInfo && oldHandlerInfo.context;\n if (result.names.length > 0 && newHandlerInfo.context === oldContext) {\n // If contexts match in isActive test, assume params also match.\n // This allows for flexibility in not requiring that every last\n // handler provide a `serialize` method\n newHandlerInfo.params = oldHandlerInfo && oldHandlerInfo.params;\n }\n newHandlerInfo.context = oldContext;\n }\n\n var handlerToUse = oldHandlerInfo;\n if (i >= invalidateIndex || newHandlerInfo.shouldSupercede(oldHandlerInfo)) {\n invalidateIndex = Math.min(i, invalidateIndex);\n handlerToUse = newHandlerInfo;\n }\n\n if (isIntermediate && !checkingIfActive) {\n handlerToUse = handlerToUse.becomeResolved(null, handlerToUse.context);\n }\n\n newState.handlerInfos.unshift(handlerToUse);\n }\n\n if (objects.length > 0) {\n throw new Error(\"More context objects were passed than there are dynamic segments for the route: \" + targetRouteName);\n }\n\n if (!isIntermediate) {\n this.invalidateChildren(newState.handlerInfos, invalidateIndex);\n }\n\n _routerUtils.merge(newState.queryParams, this.queryParams || {});\n\n return newState;\n },\n\n invalidateChildren: function (handlerInfos, invalidateIndex) {\n for (var i = invalidateIndex, l = handlerInfos.length; i < l; ++i) {\n var handlerInfo = handlerInfos[i];\n handlerInfos[i] = handlerInfos[i].getUnresolved();\n }\n },\n\n getHandlerInfoForDynamicSegment: function (name, handler, names, objects, oldHandlerInfo, targetRouteName, i) {\n\n var numNames = names.length;\n var objectToUse;\n if (objects.length > 0) {\n\n // Use the objects provided for this transition.\n objectToUse = objects[objects.length - 1];\n if (_routerUtils.isParam(objectToUse)) {\n return this.createParamHandlerInfo(name, handler, names, objects, oldHandlerInfo);\n } else {\n objects.pop();\n }\n } else if (oldHandlerInfo && oldHandlerInfo.name === name) {\n // Reuse the matching oldHandlerInfo\n return oldHandlerInfo;\n } else {\n if (this.preTransitionState) {\n var preTransitionHandlerInfo = this.preTransitionState.handlerInfos[i];\n objectToUse = preTransitionHandlerInfo && preTransitionHandlerInfo.context;\n } else {\n // Ideally we should throw this error to provide maximal\n // information to the user that not enough context objects\n // were provided, but this proves too cumbersome in Ember\n // in cases where inner template helpers are evaluated\n // before parent helpers un-render, in which cases this\n // error somewhat prematurely fires.\n //throw new Error(\"Not enough context objects were provided to complete a transition to \" + targetRouteName + \". Specifically, the \" + name + \" route needs an object that can be serialized into its dynamic URL segments [\" + names.join(', ') + \"]\");\n return oldHandlerInfo;\n }\n }\n\n return _routerHandlerInfoFactory.default('object', {\n name: name,\n handler: handler,\n context: objectToUse,\n names: names\n });\n },\n\n createParamHandlerInfo: function (name, handler, names, objects, oldHandlerInfo) {\n var params = {};\n\n // Soak up all the provided string/numbers\n var numNames = names.length;\n while (numNames--) {\n\n // Only use old params if the names match with the new handler\n var oldParams = oldHandlerInfo && name === oldHandlerInfo.name && oldHandlerInfo.params || {};\n\n var peek = objects[objects.length - 1];\n var paramName = names[numNames];\n if (_routerUtils.isParam(peek)) {\n params[paramName] = \"\" + objects.pop();\n } else {\n // If we're here, this means only some of the params\n // were string/number params, so try and use a param\n // value from a previous handler.\n if (oldParams.hasOwnProperty(paramName)) {\n params[paramName] = oldParams[paramName];\n } else {\n throw new Error(\"You didn't provide enough string/numeric parameters to satisfy all of the dynamic segments for route \" + name);\n }\n }\n }\n\n return _routerHandlerInfoFactory.default('param', {\n name: name,\n handler: handler,\n params: params\n });\n }\n });\n});\nenifed('router/transition-intent/url-transition-intent', ['exports', 'router/transition-intent', 'router/transition-state', 'router/handler-info/factory', 'router/utils', 'router/unrecognized-url-error'], function (exports, _routerTransitionIntent, _routerTransitionState, _routerHandlerInfoFactory, _routerUtils, _routerUnrecognizedUrlError) {\n 'use strict';\n\n exports.default = _routerUtils.subclass(_routerTransitionIntent.default, {\n url: null,\n\n initialize: function (props) {\n this.url = props.url;\n },\n\n applyToState: function (oldState, recognizer, getHandler) {\n var newState = new _routerTransitionState.default();\n\n var results = recognizer.recognize(this.url),\n queryParams = {},\n i,\n len;\n\n if (!results) {\n throw new _routerUnrecognizedUrlError.default(this.url);\n }\n\n var statesDiffer = false;\n\n for (i = 0, len = results.length; i < len; ++i) {\n var result = results[i];\n var name = result.handler;\n var handler = getHandler(name);\n\n if (handler.inaccessibleByURL) {\n throw new _routerUnrecognizedUrlError.default(this.url);\n }\n\n var newHandlerInfo = _routerHandlerInfoFactory.default('param', {\n name: name,\n handler: handler,\n params: result.params\n });\n\n var oldHandlerInfo = oldState.handlerInfos[i];\n if (statesDiffer || newHandlerInfo.shouldSupercede(oldHandlerInfo)) {\n statesDiffer = true;\n newState.handlerInfos[i] = newHandlerInfo;\n } else {\n newState.handlerInfos[i] = oldHandlerInfo;\n }\n }\n\n _routerUtils.merge(newState.queryParams, results.queryParams);\n\n return newState;\n }\n });\n});\nenifed('router/transition-intent', ['exports', 'router/utils'], function (exports, _routerUtils) {\n 'use strict';\n\n function TransitionIntent(props) {\n this.initialize(props);\n\n // TODO: wat\n this.data = this.data || {};\n }\n\n TransitionIntent.prototype = {\n initialize: null,\n applyToState: null\n };\n\n exports.default = TransitionIntent;\n});\nenifed('router/transition-state', ['exports', 'router/handler-info', 'router/utils', 'rsvp/promise'], function (exports, _routerHandlerInfo, _routerUtils, _rsvpPromise) {\n 'use strict';\n\n function TransitionState(other) {\n this.handlerInfos = [];\n this.queryParams = {};\n this.params = {};\n }\n\n TransitionState.prototype = {\n handlerInfos: null,\n queryParams: null,\n params: null,\n\n promiseLabel: function (label) {\n var targetName = '';\n _routerUtils.forEach(this.handlerInfos, function (handlerInfo) {\n if (targetName !== '') {\n targetName += '.';\n }\n targetName += handlerInfo.name;\n });\n return _routerUtils.promiseLabel(\"'\" + targetName + \"': \" + label);\n },\n\n resolve: function (shouldContinue, payload) {\n var self = this;\n // First, calculate params for this state. This is useful\n // information to provide to the various route hooks.\n var params = this.params;\n _routerUtils.forEach(this.handlerInfos, function (handlerInfo) {\n params[handlerInfo.name] = handlerInfo.params || {};\n });\n\n payload = payload || {};\n payload.resolveIndex = 0;\n\n var currentState = this;\n var wasAborted = false;\n\n // The prelude RSVP.resolve() asyncs us into the promise land.\n return _rsvpPromise.default.resolve(null, this.promiseLabel(\"Start transition\")).then(resolveOneHandlerInfo, null, this.promiseLabel('Resolve handler'))['catch'](handleError, this.promiseLabel('Handle error'));\n\n function innerShouldContinue() {\n return _rsvpPromise.default.resolve(shouldContinue(), currentState.promiseLabel(\"Check if should continue\"))['catch'](function (reason) {\n // We distinguish between errors that occurred\n // during resolution (e.g. beforeModel/model/afterModel),\n // and aborts due to a rejecting promise from shouldContinue().\n wasAborted = true;\n return _rsvpPromise.default.reject(reason);\n }, currentState.promiseLabel(\"Handle abort\"));\n }\n\n function handleError(error) {\n // This is the only possible\n // reject value of TransitionState#resolve\n var handlerInfos = currentState.handlerInfos;\n var errorHandlerIndex = payload.resolveIndex >= handlerInfos.length ? handlerInfos.length - 1 : payload.resolveIndex;\n return _rsvpPromise.default.reject({\n error: error,\n handlerWithError: currentState.handlerInfos[errorHandlerIndex].handler,\n wasAborted: wasAborted,\n state: currentState\n });\n }\n\n function proceed(resolvedHandlerInfo) {\n var wasAlreadyResolved = currentState.handlerInfos[payload.resolveIndex].isResolved;\n\n // Swap the previously unresolved handlerInfo with\n // the resolved handlerInfo\n currentState.handlerInfos[payload.resolveIndex++] = resolvedHandlerInfo;\n\n if (!wasAlreadyResolved) {\n // Call the redirect hook. The reason we call it here\n // vs. afterModel is so that redirects into child\n // routes don't re-run the model hooks for this\n // already-resolved route.\n var handler = resolvedHandlerInfo.handler;\n _routerUtils.callHook(handler, 'redirect', resolvedHandlerInfo.context, payload);\n }\n\n // Proceed after ensuring that the redirect hook\n // didn't abort this transition by transitioning elsewhere.\n return innerShouldContinue().then(resolveOneHandlerInfo, null, currentState.promiseLabel('Resolve handler'));\n }\n\n function resolveOneHandlerInfo() {\n if (payload.resolveIndex === currentState.handlerInfos.length) {\n // This is is the only possible\n // fulfill value of TransitionState#resolve\n return {\n error: null,\n state: currentState\n };\n }\n\n var handlerInfo = currentState.handlerInfos[payload.resolveIndex];\n\n return handlerInfo.resolve(innerShouldContinue, payload).then(proceed, null, currentState.promiseLabel('Proceed'));\n }\n }\n };\n\n exports.default = TransitionState;\n});\nenifed('router/transition', ['exports', 'rsvp/promise', 'router/handler-info', 'router/utils'], function (exports, _rsvpPromise, _routerHandlerInfo, _routerUtils) {\n 'use strict';\n\n /**\n @private\n \n A Transition is a thennable (a promise-like object) that represents\n an attempt to transition to another route. It can be aborted, either\n explicitly via `abort` or by attempting another transition while a\n previous one is still underway. An aborted transition can also\n be `retry()`d later.\n */\n function Transition(router, intent, state, error) {\n var transition = this;\n this.state = state || router.state;\n this.intent = intent;\n this.router = router;\n this.data = this.intent && this.intent.data || {};\n this.resolvedModels = {};\n this.queryParams = {};\n\n if (error) {\n this.promise = _rsvpPromise.default.reject(error);\n this.error = error;\n return;\n }\n\n if (state) {\n this.params = state.params;\n this.queryParams = state.queryParams;\n this.handlerInfos = state.handlerInfos;\n\n var len = state.handlerInfos.length;\n if (len) {\n this.targetName = state.handlerInfos[len - 1].name;\n }\n\n for (var i = 0; i < len; ++i) {\n var handlerInfo = state.handlerInfos[i];\n\n // TODO: this all seems hacky\n if (!handlerInfo.isResolved) {\n break;\n }\n this.pivotHandler = handlerInfo.handler;\n }\n\n this.sequence = Transition.currentSequence++;\n this.promise = state.resolve(checkForAbort, this)['catch'](function (result) {\n if (result.wasAborted || transition.isAborted) {\n return _rsvpPromise.default.reject(logAbort(transition));\n } else {\n transition.trigger('error', result.error, transition, result.handlerWithError);\n transition.abort();\n return _rsvpPromise.default.reject(result.error);\n }\n }, _routerUtils.promiseLabel('Handle Abort'));\n } else {\n this.promise = _rsvpPromise.default.resolve(this.state);\n this.params = {};\n }\n\n function checkForAbort() {\n if (transition.isAborted) {\n return _rsvpPromise.default.reject(undefined, _routerUtils.promiseLabel(\"Transition aborted - reject\"));\n }\n }\n }\n\n Transition.currentSequence = 0;\n\n Transition.prototype = {\n targetName: null,\n urlMethod: 'update',\n intent: null,\n params: null,\n pivotHandler: null,\n resolveIndex: 0,\n handlerInfos: null,\n resolvedModels: null,\n isActive: true,\n state: null,\n queryParamsOnly: false,\n\n isTransition: true,\n\n isExiting: function (handler) {\n var handlerInfos = this.handlerInfos;\n for (var i = 0, len = handlerInfos.length; i < len; ++i) {\n var handlerInfo = handlerInfos[i];\n if (handlerInfo.name === handler || handlerInfo.handler === handler) {\n return false;\n }\n }\n return true;\n },\n\n /**\n @public\n The Transition's internal promise. Calling `.then` on this property\n is that same as calling `.then` on the Transition object itself, but\n this property is exposed for when you want to pass around a\n Transition's promise, but not the Transition object itself, since\n Transition object can be externally `abort`ed, while the promise\n cannot.\n */\n promise: null,\n\n /**\n @public\n Custom state can be stored on a Transition's `data` object.\n This can be useful for decorating a Transition within an earlier\n hook and shared with a later hook. Properties set on `data` will\n be copied to new transitions generated by calling `retry` on this\n transition.\n */\n data: null,\n\n /**\n @public\n A standard promise hook that resolves if the transition\n succeeds and rejects if it fails/redirects/aborts.\n Forwards to the internal `promise` property which you can\n use in situations where you want to pass around a thennable,\n but not the Transition itself.\n @param {Function} onFulfilled\n @param {Function} onRejected\n @param {String} label optional string for labeling the promise.\n Useful for tooling.\n @return {Promise}\n */\n then: function (onFulfilled, onRejected, label) {\n return this.promise.then(onFulfilled, onRejected, label);\n },\n\n /**\n @public\n Forwards to the internal `promise` property which you can\n use in situations where you want to pass around a thennable,\n but not the Transition itself.\n @method catch\n @param {Function} onRejection\n @param {String} label optional string for labeling the promise.\n Useful for tooling.\n @return {Promise}\n */\n catch: function (onRejection, label) {\n return this.promise.catch(onRejection, label);\n },\n\n /**\n @public\n Forwards to the internal `promise` property which you can\n use in situations where you want to pass around a thennable,\n but not the Transition itself.\n @method finally\n @param {Function} callback\n @param {String} label optional string for labeling the promise.\n Useful for tooling.\n @return {Promise}\n */\n finally: function (callback, label) {\n return this.promise.finally(callback, label);\n },\n\n /**\n @public\n Aborts the Transition. Note you can also implicitly abort a transition\n by initiating another transition while a previous one is underway.\n */\n abort: function () {\n if (this.isAborted) {\n return this;\n }\n _routerUtils.log(this.router, this.sequence, this.targetName + \": transition was aborted\");\n this.intent.preTransitionState = this.router.state;\n this.isAborted = true;\n this.isActive = false;\n this.router.activeTransition = null;\n return this;\n },\n\n /**\n @public\n Retries a previously-aborted transition (making sure to abort the\n transition if it's still active). Returns a new transition that\n represents the new attempt to transition.\n */\n retry: function () {\n // TODO: add tests for merged state retry()s\n this.abort();\n return this.router.transitionByIntent(this.intent, false);\n },\n\n /**\n @public\n Sets the URL-changing method to be employed at the end of a\n successful transition. By default, a new Transition will just\n use `updateURL`, but passing 'replace' to this method will\n cause the URL to update using 'replaceWith' instead. Omitting\n a parameter will disable the URL change, allowing for transitions\n that don't update the URL at completion (this is also used for\n handleURL, since the URL has already changed before the\n transition took place).\n @param {String} method the type of URL-changing method to use\n at the end of a transition. Accepted values are 'replace',\n falsy values, or any other non-falsy value (which is\n interpreted as an updateURL transition).\n @return {Transition} this transition\n */\n method: function (method) {\n this.urlMethod = method;\n return this;\n },\n\n /**\n @public\n Fires an event on the current list of resolved/resolving\n handlers within this transition. Useful for firing events\n on route hierarchies that haven't fully been entered yet.\n Note: This method is also aliased as `send`\n @param {Boolean} [ignoreFailure=false] a boolean specifying whether unhandled events throw an error\n @param {String} name the name of the event to fire\n */\n trigger: function (ignoreFailure) {\n var args = _routerUtils.slice.call(arguments);\n if (typeof ignoreFailure === 'boolean') {\n args.shift();\n } else {\n // Throw errors on unhandled trigger events by default\n ignoreFailure = false;\n }\n _routerUtils.trigger(this.router, this.state.handlerInfos.slice(0, this.resolveIndex + 1), ignoreFailure, args);\n },\n\n /**\n @public\n Transitions are aborted and their promises rejected\n when redirects occur; this method returns a promise\n that will follow any redirects that occur and fulfill\n with the value fulfilled by any redirecting transitions\n that occur.\n @return {Promise} a promise that fulfills with the same\n value that the final redirecting transition fulfills with\n */\n followRedirects: function () {\n var router = this.router;\n return this.promise['catch'](function (reason) {\n if (router.activeTransition) {\n return router.activeTransition.followRedirects();\n }\n return _rsvpPromise.default.reject(reason);\n });\n },\n\n toString: function () {\n return \"Transition (sequence \" + this.sequence + \")\";\n },\n\n /**\n @private\n */\n log: function (message) {\n _routerUtils.log(this.router, this.sequence, message);\n }\n };\n\n // Alias 'trigger' as 'send'\n Transition.prototype.send = Transition.prototype.trigger;\n\n /**\n @private\n \n Logs and returns a TransitionAborted error.\n */\n function logAbort(transition) {\n _routerUtils.log(transition.router, transition.sequence, \"detected abort.\");\n return new TransitionAborted();\n }\n\n function TransitionAborted(message) {\n this.message = message || \"TransitionAborted\";\n this.name = \"TransitionAborted\";\n }\n\n exports.Transition = Transition;\n exports.logAbort = logAbort;\n exports.TransitionAborted = TransitionAborted;\n});\nenifed(\"router/unrecognized-url-error\", [\"exports\", \"router/utils\"], function (exports, _routerUtils) {\n \"use strict\";\n\n /**\n Promise reject reasons passed to promise rejection\n handlers for failed transitions.\n */\n function UnrecognizedURLError(message) {\n this.message = message || \"UnrecognizedURLError\";\n this.name = \"UnrecognizedURLError\";\n Error.call(this);\n }\n\n UnrecognizedURLError.prototype = _routerUtils.oCreate(Error.prototype);\n\n exports.default = UnrecognizedURLError;\n});\nenifed('router/utils', ['exports'], function (exports) {\n 'use strict';\n\n exports.extractQueryParams = extractQueryParams;\n exports.log = log;\n exports.bind = bind;\n exports.forEach = forEach;\n exports.trigger = trigger;\n exports.getChangelist = getChangelist;\n exports.promiseLabel = promiseLabel;\n exports.subclass = subclass;\n var slice = Array.prototype.slice;\n\n var _isArray;\n if (!Array.isArray) {\n _isArray = function (x) {\n return Object.prototype.toString.call(x) === \"[object Array]\";\n };\n } else {\n _isArray = Array.isArray;\n }\n\n var isArray = _isArray;\n\n exports.isArray = isArray;\n function merge(hash, other) {\n for (var prop in other) {\n if (other.hasOwnProperty(prop)) {\n hash[prop] = other[prop];\n }\n }\n }\n\n var oCreate = Object.create || function (proto) {\n function F() {}\n F.prototype = proto;\n return new F();\n };\n\n exports.oCreate = oCreate;\n /**\n @private\n \n Extracts query params from the end of an array\n **/\n\n function extractQueryParams(array) {\n var len = array && array.length,\n head,\n queryParams;\n\n if (len && len > 0 && array[len - 1] && array[len - 1].hasOwnProperty('queryParams')) {\n queryParams = array[len - 1].queryParams;\n head = slice.call(array, 0, len - 1);\n return [head, queryParams];\n } else {\n return [array, null];\n }\n }\n\n /**\n @private\n \n Coerces query param properties and array elements into strings.\n **/\n function coerceQueryParamsToString(queryParams) {\n for (var key in queryParams) {\n if (typeof queryParams[key] === 'number') {\n queryParams[key] = '' + queryParams[key];\n } else if (isArray(queryParams[key])) {\n for (var i = 0, l = queryParams[key].length; i < l; i++) {\n queryParams[key][i] = '' + queryParams[key][i];\n }\n }\n }\n }\n /**\n @private\n */\n\n function log(router, sequence, msg) {\n if (!router.log) {\n return;\n }\n\n if (arguments.length === 3) {\n router.log(\"Transition #\" + sequence + \": \" + msg);\n } else {\n msg = sequence;\n router.log(msg);\n }\n }\n\n function bind(context, fn) {\n var boundArgs = arguments;\n return function (value) {\n var args = slice.call(boundArgs, 2);\n args.push(value);\n return fn.apply(context, args);\n };\n }\n\n function isParam(object) {\n return typeof object === \"string\" || object instanceof String || typeof object === \"number\" || object instanceof Number;\n }\n\n function forEach(array, callback) {\n for (var i = 0, l = array.length; i < l && false !== callback(array[i]); i++) {}\n }\n\n function trigger(router, handlerInfos, ignoreFailure, args) {\n if (router.triggerEvent) {\n router.triggerEvent(handlerInfos, ignoreFailure, args);\n return;\n }\n\n var name = args.shift();\n\n if (!handlerInfos) {\n if (ignoreFailure) {\n return;\n }\n throw new Error(\"Could not trigger event '\" + name + \"'. There are no active handlers\");\n }\n\n var eventWasHandled = false;\n\n for (var i = handlerInfos.length - 1; i >= 0; i--) {\n var handlerInfo = handlerInfos[i],\n handler = handlerInfo.handler;\n\n if (handler.events && handler.events[name]) {\n if (handler.events[name].apply(handler, args) === true) {\n eventWasHandled = true;\n } else {\n return;\n }\n }\n }\n\n if (!eventWasHandled && !ignoreFailure) {\n throw new Error(\"Nothing handled the event '\" + name + \"'.\");\n }\n }\n\n function getChangelist(oldObject, newObject) {\n var key;\n var results = {\n all: {},\n changed: {},\n removed: {}\n };\n\n merge(results.all, newObject);\n\n var didChange = false;\n coerceQueryParamsToString(oldObject);\n coerceQueryParamsToString(newObject);\n\n // Calculate removals\n for (key in oldObject) {\n if (oldObject.hasOwnProperty(key)) {\n if (!newObject.hasOwnProperty(key)) {\n didChange = true;\n results.removed[key] = oldObject[key];\n }\n }\n }\n\n // Calculate changes\n for (key in newObject) {\n if (newObject.hasOwnProperty(key)) {\n if (isArray(oldObject[key]) && isArray(newObject[key])) {\n if (oldObject[key].length !== newObject[key].length) {\n results.changed[key] = newObject[key];\n didChange = true;\n } else {\n for (var i = 0, l = oldObject[key].length; i < l; i++) {\n if (oldObject[key][i] !== newObject[key][i]) {\n results.changed[key] = newObject[key];\n didChange = true;\n }\n }\n }\n } else {\n if (oldObject[key] !== newObject[key]) {\n results.changed[key] = newObject[key];\n didChange = true;\n }\n }\n }\n }\n\n return didChange && results;\n }\n\n function promiseLabel(label) {\n return 'Router: ' + label;\n }\n\n function subclass(parentConstructor, proto) {\n function C(props) {\n parentConstructor.call(this, props || {});\n }\n C.prototype = oCreate(parentConstructor.prototype);\n merge(C.prototype, proto);\n return C;\n }\n\n function resolveHook(obj, hookName) {\n if (!obj) {\n return;\n }\n var underscored = \"_\" + hookName;\n return obj[underscored] && underscored || obj[hookName] && hookName;\n }\n\n function callHook(obj, _hookName, arg1, arg2) {\n var hookName = resolveHook(obj, _hookName);\n return hookName && obj[hookName].call(obj, arg1, arg2);\n }\n\n function applyHook(obj, _hookName, args) {\n var hookName = resolveHook(obj, _hookName);\n if (hookName) {\n if (args.length === 0) {\n return obj[hookName].call(obj);\n } else if (args.length === 1) {\n return obj[hookName].call(obj, args[0]);\n } else if (args.length === 2) {\n return obj[hookName].call(obj, args[0], args[1]);\n } else {\n return obj[hookName].apply(obj, args);\n }\n }\n }\n\n exports.merge = merge;\n exports.slice = slice;\n exports.isParam = isParam;\n exports.coerceQueryParamsToString = coerceQueryParamsToString;\n exports.callHook = callHook;\n exports.resolveHook = resolveHook;\n exports.applyHook = applyHook;\n});\nenifed('router', ['exports', 'router/router'], function (exports, _routerRouter) {\n 'use strict';\n\n exports.default = _routerRouter.default;\n});\nenifed('rsvp/-internal', ['exports', 'rsvp/utils', 'rsvp/instrument', 'rsvp/config'], function (exports, _rsvpUtils, _rsvpInstrument, _rsvpConfig) {\n 'use strict';\n\n function withOwnPromise() {\n return new TypeError('A promises callback cannot return that same promise.');\n }\n\n function noop() {}\n\n var PENDING = void 0;\n var FULFILLED = 1;\n var REJECTED = 2;\n\n var GET_THEN_ERROR = new ErrorObject();\n\n function getThen(promise) {\n try {\n return promise.then;\n } catch (error) {\n GET_THEN_ERROR.error = error;\n return GET_THEN_ERROR;\n }\n }\n\n function tryThen(then, value, fulfillmentHandler, rejectionHandler) {\n try {\n then.call(value, fulfillmentHandler, rejectionHandler);\n } catch (e) {\n return e;\n }\n }\n\n function handleForeignThenable(promise, thenable, then) {\n _rsvpConfig.config.async(function (promise) {\n var sealed = false;\n var error = tryThen(then, thenable, function (value) {\n if (sealed) {\n return;\n }\n sealed = true;\n if (thenable !== value) {\n resolve(promise, value);\n } else {\n fulfill(promise, value);\n }\n }, function (reason) {\n if (sealed) {\n return;\n }\n sealed = true;\n\n reject(promise, reason);\n }, 'Settle: ' + (promise._label || ' unknown promise'));\n\n if (!sealed && error) {\n sealed = true;\n reject(promise, error);\n }\n }, promise);\n }\n\n function handleOwnThenable(promise, thenable) {\n if (thenable._state === FULFILLED) {\n fulfill(promise, thenable._result);\n } else if (thenable._state === REJECTED) {\n thenable._onError = null;\n reject(promise, thenable._result);\n } else {\n subscribe(thenable, undefined, function (value) {\n if (thenable !== value) {\n resolve(promise, value);\n } else {\n fulfill(promise, value);\n }\n }, function (reason) {\n reject(promise, reason);\n });\n }\n }\n\n function handleMaybeThenable(promise, maybeThenable) {\n if (maybeThenable.constructor === promise.constructor) {\n handleOwnThenable(promise, maybeThenable);\n } else {\n var then = getThen(maybeThenable);\n\n if (then === GET_THEN_ERROR) {\n reject(promise, GET_THEN_ERROR.error);\n } else if (then === undefined) {\n fulfill(promise, maybeThenable);\n } else if (_rsvpUtils.isFunction(then)) {\n handleForeignThenable(promise, maybeThenable, then);\n } else {\n fulfill(promise, maybeThenable);\n }\n }\n }\n\n function resolve(promise, value) {\n if (promise === value) {\n fulfill(promise, value);\n } else if (_rsvpUtils.objectOrFunction(value)) {\n handleMaybeThenable(promise, value);\n } else {\n fulfill(promise, value);\n }\n }\n\n function publishRejection(promise) {\n if (promise._onError) {\n promise._onError(promise._result);\n }\n\n publish(promise);\n }\n\n function fulfill(promise, value) {\n if (promise._state !== PENDING) {\n return;\n }\n\n promise._result = value;\n promise._state = FULFILLED;\n\n if (promise._subscribers.length === 0) {\n if (_rsvpConfig.config.instrument) {\n _rsvpInstrument.default('fulfilled', promise);\n }\n } else {\n _rsvpConfig.config.async(publish, promise);\n }\n }\n\n function reject(promise, reason) {\n if (promise._state !== PENDING) {\n return;\n }\n promise._state = REJECTED;\n promise._result = reason;\n _rsvpConfig.config.async(publishRejection, promise);\n }\n\n function subscribe(parent, child, onFulfillment, onRejection) {\n var subscribers = parent._subscribers;\n var length = subscribers.length;\n\n parent._onError = null;\n\n subscribers[length] = child;\n subscribers[length + FULFILLED] = onFulfillment;\n subscribers[length + REJECTED] = onRejection;\n\n if (length === 0 && parent._state) {\n _rsvpConfig.config.async(publish, parent);\n }\n }\n\n function publish(promise) {\n var subscribers = promise._subscribers;\n var settled = promise._state;\n\n if (_rsvpConfig.config.instrument) {\n _rsvpInstrument.default(settled === FULFILLED ? 'fulfilled' : 'rejected', promise);\n }\n\n if (subscribers.length === 0) {\n return;\n }\n\n var child,\n callback,\n detail = promise._result;\n\n for (var i = 0; i < subscribers.length; i += 3) {\n child = subscribers[i];\n callback = subscribers[i + settled];\n\n if (child) {\n invokeCallback(settled, child, callback, detail);\n } else {\n callback(detail);\n }\n }\n\n promise._subscribers.length = 0;\n }\n\n function ErrorObject() {\n this.error = null;\n }\n\n var TRY_CATCH_ERROR = new ErrorObject();\n\n function tryCatch(callback, detail) {\n try {\n return callback(detail);\n } catch (e) {\n TRY_CATCH_ERROR.error = e;\n return TRY_CATCH_ERROR;\n }\n }\n\n function invokeCallback(settled, promise, callback, detail) {\n var hasCallback = _rsvpUtils.isFunction(callback),\n value,\n error,\n succeeded,\n failed;\n\n if (hasCallback) {\n value = tryCatch(callback, detail);\n\n if (value === TRY_CATCH_ERROR) {\n failed = true;\n error = value.error;\n value = null;\n } else {\n succeeded = true;\n }\n\n if (promise === value) {\n reject(promise, withOwnPromise());\n return;\n }\n } else {\n value = detail;\n succeeded = true;\n }\n\n if (promise._state !== PENDING) {\n // noop\n } else if (hasCallback && succeeded) {\n resolve(promise, value);\n } else if (failed) {\n reject(promise, error);\n } else if (settled === FULFILLED) {\n fulfill(promise, value);\n } else if (settled === REJECTED) {\n reject(promise, value);\n }\n }\n\n function initializePromise(promise, resolver) {\n var resolved = false;\n try {\n resolver(function resolvePromise(value) {\n if (resolved) {\n return;\n }\n resolved = true;\n resolve(promise, value);\n }, function rejectPromise(reason) {\n if (resolved) {\n return;\n }\n resolved = true;\n reject(promise, reason);\n });\n } catch (e) {\n reject(promise, e);\n }\n }\n\n exports.noop = noop;\n exports.resolve = resolve;\n exports.reject = reject;\n exports.fulfill = fulfill;\n exports.subscribe = subscribe;\n exports.publish = publish;\n exports.publishRejection = publishRejection;\n exports.initializePromise = initializePromise;\n exports.invokeCallback = invokeCallback;\n exports.FULFILLED = FULFILLED;\n exports.REJECTED = REJECTED;\n exports.PENDING = PENDING;\n});\nenifed('rsvp/all-settled', ['exports', 'rsvp/enumerator', 'rsvp/promise', 'rsvp/utils'], function (exports, _rsvpEnumerator, _rsvpPromise, _rsvpUtils) {\n 'use strict';\n\n exports.default = allSettled;\n\n function AllSettled(Constructor, entries, label) {\n this._superConstructor(Constructor, entries, false, /* don't abort on reject */label);\n }\n\n AllSettled.prototype = _rsvpUtils.o_create(_rsvpEnumerator.default.prototype);\n AllSettled.prototype._superConstructor = _rsvpEnumerator.default;\n AllSettled.prototype._makeResult = _rsvpEnumerator.makeSettledResult;\n AllSettled.prototype._validationError = function () {\n return new Error('allSettled must be called with an array');\n };\n\n /**\n `RSVP.allSettled` is similar to `RSVP.all`, but instead of implementing\n a fail-fast method, it waits until all the promises have returned and\n shows you all the results. This is useful if you want to handle multiple\n promises' failure states together as a set.\n \n Returns a promise that is fulfilled when all the given promises have been\n settled. The return promise is fulfilled with an array of the states of\n the promises passed into the `promises` array argument.\n \n Each state object will either indicate fulfillment or rejection, and\n provide the corresponding value or reason. The states will take one of\n the following formats:\n \n ```javascript\n { state: 'fulfilled', value: value }\n or\n { state: 'rejected', reason: reason }\n ```\n \n Example:\n \n ```javascript\n var promise1 = RSVP.Promise.resolve(1);\n var promise2 = RSVP.Promise.reject(new Error('2'));\n var promise3 = RSVP.Promise.reject(new Error('3'));\n var promises = [ promise1, promise2, promise3 ];\n \n RSVP.allSettled(promises).then(function(array){\n // array == [\n // { state: 'fulfilled', value: 1 },\n // { state: 'rejected', reason: Error },\n // { state: 'rejected', reason: Error }\n // ]\n // Note that for the second item, reason.message will be '2', and for the\n // third item, reason.message will be '3'.\n }, function(error) {\n // Not run. (This block would only be called if allSettled had failed,\n // for instance if passed an incorrect argument type.)\n });\n ```\n \n @method allSettled\n @static\n @for RSVP\n @param {Array} entries\n @param {String} label - optional string that describes the promise.\n Useful for tooling.\n @return {Promise} promise that is fulfilled with an array of the settled\n states of the constituent promises.\n */\n\n function allSettled(entries, label) {\n return new AllSettled(_rsvpPromise.default, entries, label).promise;\n }\n});\nenifed(\"rsvp/all\", [\"exports\", \"rsvp/promise\"], function (exports, _rsvpPromise) {\n \"use strict\";\n\n exports.default = all;\n\n /**\n This is a convenient alias for `RSVP.Promise.all`.\n \n @method all\n @static\n @for RSVP\n @param {Array} array Array of promises.\n @param {String} label An optional label. This is useful\n for tooling.\n */\n\n function all(array, label) {\n return _rsvpPromise.default.all(array, label);\n }\n});\nenifed('rsvp/asap', ['exports'], function (exports) {\n 'use strict';\n\n exports.default = asap;\n var len = 0;\n var toString = ({}).toString;\n var vertxNext;\n\n function asap(callback, arg) {\n queue[len] = callback;\n queue[len + 1] = arg;\n len += 2;\n if (len === 2) {\n // If len is 1, that means that we need to schedule an async flush.\n // If additional callbacks are queued before the queue is flushed, they\n // will be processed by this flush that we are scheduling.\n scheduleFlush();\n }\n }\n\n var browserWindow = typeof window !== 'undefined' ? window : undefined;\n var browserGlobal = browserWindow || {};\n var BrowserMutationObserver = browserGlobal.MutationObserver || browserGlobal.WebKitMutationObserver;\n var isNode = typeof window === 'undefined' && typeof process !== 'undefined' && ({}).toString.call(process) === '[object process]';\n\n // test for web worker but not in IE10\n var isWorker = typeof Uint8ClampedArray !== 'undefined' && typeof importScripts !== 'undefined' && typeof MessageChannel !== 'undefined';\n\n // node\n function useNextTick() {\n var nextTick = process.nextTick;\n // node version 0.10.x displays a deprecation warning when nextTick is used recursively\n // setImmediate should be used instead instead\n var version = process.versions.node.match(/^(?:(\\d+)\\.)?(?:(\\d+)\\.)?(\\*|\\d+)$/);\n if (Array.isArray(version) && version[1] === '0' && version[2] === '10') {\n nextTick = setImmediate;\n }\n return function () {\n nextTick(flush);\n };\n }\n\n // vertx\n function useVertxTimer() {\n return function () {\n vertxNext(flush);\n };\n }\n\n function useMutationObserver() {\n var iterations = 0;\n var observer = new BrowserMutationObserver(flush);\n var node = document.createTextNode('');\n observer.observe(node, { characterData: true });\n\n return function () {\n node.data = iterations = ++iterations % 2;\n };\n }\n\n // web worker\n function useMessageChannel() {\n var channel = new MessageChannel();\n channel.port1.onmessage = flush;\n return function () {\n channel.port2.postMessage(0);\n };\n }\n\n function useSetTimeout() {\n return function () {\n setTimeout(flush, 1);\n };\n }\n\n var queue = new Array(1000);\n function flush() {\n for (var i = 0; i < len; i += 2) {\n var callback = queue[i];\n var arg = queue[i + 1];\n\n callback(arg);\n\n queue[i] = undefined;\n queue[i + 1] = undefined;\n }\n\n len = 0;\n }\n\n function attemptVertex() {\n try {\n var r = require;\n var vertx = r('vertx');\n vertxNext = vertx.runOnLoop || vertx.runOnContext;\n return useVertxTimer();\n } catch (e) {\n return useSetTimeout();\n }\n }\n\n var scheduleFlush;\n // Decide what async method to use to triggering processing of queued callbacks:\n if (isNode) {\n scheduleFlush = useNextTick();\n } else if (BrowserMutationObserver) {\n scheduleFlush = useMutationObserver();\n } else if (isWorker) {\n scheduleFlush = useMessageChannel();\n } else if (browserWindow === undefined && typeof require === 'function') {\n scheduleFlush = attemptVertex();\n } else {\n scheduleFlush = useSetTimeout();\n }\n});\nenifed('rsvp/config', ['exports', 'rsvp/events'], function (exports, _rsvpEvents) {\n 'use strict';\n\n var config = {\n instrument: false\n };\n\n _rsvpEvents.default['mixin'](config);\n\n function configure(name, value) {\n if (name === 'onerror') {\n // handle for legacy users that expect the actual\n // error to be passed to their function added via\n // `RSVP.configure('onerror', someFunctionHere);`\n config['on']('error', value);\n return;\n }\n\n if (arguments.length === 2) {\n config[name] = value;\n } else {\n return config[name];\n }\n }\n\n exports.config = config;\n exports.configure = configure;\n});\nenifed('rsvp/defer', ['exports', 'rsvp/promise'], function (exports, _rsvpPromise) {\n 'use strict';\n\n exports.default = defer;\n\n /**\n `RSVP.defer` returns an object similar to jQuery's `$.Deferred`.\n `RSVP.defer` should be used when porting over code reliant on `$.Deferred`'s\n interface. New code should use the `RSVP.Promise` constructor instead.\n \n The object returned from `RSVP.defer` is a plain object with three properties:\n \n * promise - an `RSVP.Promise`.\n * reject - a function that causes the `promise` property on this object to\n become rejected\n * resolve - a function that causes the `promise` property on this object to\n become fulfilled.\n \n Example:\n \n ```javascript\n var deferred = RSVP.defer();\n \n deferred.resolve(\"Success!\");\n \n deferred.promise.then(function(value){\n // value here is \"Success!\"\n });\n ```\n \n @method defer\n @static\n @for RSVP\n @param {String} label optional string for labeling the promise.\n Useful for tooling.\n @return {Object}\n */\n\n function defer(label) {\n var deferred = {};\n\n deferred['promise'] = new _rsvpPromise.default(function (resolve, reject) {\n deferred['resolve'] = resolve;\n deferred['reject'] = reject;\n }, label);\n\n return deferred;\n }\n});\nenifed('rsvp/enumerator', ['exports', 'rsvp/utils', 'rsvp/-internal'], function (exports, _rsvpUtils, _rsvpInternal) {\n 'use strict';\n\n exports.makeSettledResult = makeSettledResult;\n\n function makeSettledResult(state, position, value) {\n if (state === _rsvpInternal.FULFILLED) {\n return {\n state: 'fulfilled',\n value: value\n };\n } else {\n return {\n state: 'rejected',\n reason: value\n };\n }\n }\n\n function Enumerator(Constructor, input, abortOnReject, label) {\n var enumerator = this;\n\n enumerator._instanceConstructor = Constructor;\n enumerator.promise = new Constructor(_rsvpInternal.noop, label);\n enumerator._abortOnReject = abortOnReject;\n\n if (enumerator._validateInput(input)) {\n enumerator._input = input;\n enumerator.length = input.length;\n enumerator._remaining = input.length;\n\n enumerator._init();\n\n if (enumerator.length === 0) {\n _rsvpInternal.fulfill(enumerator.promise, enumerator._result);\n } else {\n enumerator.length = enumerator.length || 0;\n enumerator._enumerate();\n if (enumerator._remaining === 0) {\n _rsvpInternal.fulfill(enumerator.promise, enumerator._result);\n }\n }\n } else {\n _rsvpInternal.reject(enumerator.promise, enumerator._validationError());\n }\n }\n\n exports.default = Enumerator;\n\n Enumerator.prototype._validateInput = function (input) {\n return _rsvpUtils.isArray(input);\n };\n\n Enumerator.prototype._validationError = function () {\n return new Error('Array Methods must be provided an Array');\n };\n\n Enumerator.prototype._init = function () {\n this._result = new Array(this.length);\n };\n\n Enumerator.prototype._enumerate = function () {\n var enumerator = this;\n var length = enumerator.length;\n var promise = enumerator.promise;\n var input = enumerator._input;\n\n for (var i = 0; promise._state === _rsvpInternal.PENDING && i < length; i++) {\n enumerator._eachEntry(input[i], i);\n }\n };\n\n Enumerator.prototype._eachEntry = function (entry, i) {\n var enumerator = this;\n var c = enumerator._instanceConstructor;\n if (_rsvpUtils.isMaybeThenable(entry)) {\n if (entry.constructor === c && entry._state !== _rsvpInternal.PENDING) {\n entry._onError = null;\n enumerator._settledAt(entry._state, i, entry._result);\n } else {\n enumerator._willSettleAt(c.resolve(entry), i);\n }\n } else {\n enumerator._remaining--;\n enumerator._result[i] = enumerator._makeResult(_rsvpInternal.FULFILLED, i, entry);\n }\n };\n\n Enumerator.prototype._settledAt = function (state, i, value) {\n var enumerator = this;\n var promise = enumerator.promise;\n\n if (promise._state === _rsvpInternal.PENDING) {\n enumerator._remaining--;\n\n if (enumerator._abortOnReject && state === _rsvpInternal.REJECTED) {\n _rsvpInternal.reject(promise, value);\n } else {\n enumerator._result[i] = enumerator._makeResult(state, i, value);\n }\n }\n\n if (enumerator._remaining === 0) {\n _rsvpInternal.fulfill(promise, enumerator._result);\n }\n };\n\n Enumerator.prototype._makeResult = function (state, i, value) {\n return value;\n };\n\n Enumerator.prototype._willSettleAt = function (promise, i) {\n var enumerator = this;\n\n _rsvpInternal.subscribe(promise, undefined, function (value) {\n enumerator._settledAt(_rsvpInternal.FULFILLED, i, value);\n }, function (reason) {\n enumerator._settledAt(_rsvpInternal.REJECTED, i, reason);\n });\n };\n});\nenifed('rsvp/events', ['exports'], function (exports) {\n 'use strict';\n\n function indexOf(callbacks, callback) {\n for (var i = 0, l = callbacks.length; i < l; i++) {\n if (callbacks[i] === callback) {\n return i;\n }\n }\n\n return -1;\n }\n\n function callbacksFor(object) {\n var callbacks = object._promiseCallbacks;\n\n if (!callbacks) {\n callbacks = object._promiseCallbacks = {};\n }\n\n return callbacks;\n }\n\n /**\n @class RSVP.EventTarget\n */\n exports.default = {\n\n /**\n `RSVP.EventTarget.mixin` extends an object with EventTarget methods. For\n Example:\n ```javascript\n var object = {};\n RSVP.EventTarget.mixin(object);\n object.on('finished', function(event) {\n // handle event\n });\n object.trigger('finished', { detail: value });\n ```\n `EventTarget.mixin` also works with prototypes:\n ```javascript\n var Person = function() {};\n RSVP.EventTarget.mixin(Person.prototype);\n var yehuda = new Person();\n var tom = new Person();\n yehuda.on('poke', function(event) {\n console.log('Yehuda says OW');\n });\n tom.on('poke', function(event) {\n console.log('Tom says OW');\n });\n yehuda.trigger('poke');\n tom.trigger('poke');\n ```\n @method mixin\n @for RSVP.EventTarget\n @private\n @param {Object} object object to extend with EventTarget methods\n */\n 'mixin': function (object) {\n object['on'] = this['on'];\n object['off'] = this['off'];\n object['trigger'] = this['trigger'];\n object._promiseCallbacks = undefined;\n return object;\n },\n\n /**\n Registers a callback to be executed when `eventName` is triggered\n ```javascript\n object.on('event', function(eventInfo){\n // handle the event\n });\n object.trigger('event');\n ```\n @method on\n @for RSVP.EventTarget\n @private\n @param {String} eventName name of the event to listen for\n @param {Function} callback function to be called when the event is triggered.\n */\n 'on': function (eventName, callback) {\n if (typeof callback !== 'function') {\n throw new TypeError('Callback must be a function');\n }\n\n var allCallbacks = callbacksFor(this),\n callbacks;\n\n callbacks = allCallbacks[eventName];\n\n if (!callbacks) {\n callbacks = allCallbacks[eventName] = [];\n }\n\n if (indexOf(callbacks, callback) === -1) {\n callbacks.push(callback);\n }\n },\n\n /**\n You can use `off` to stop firing a particular callback for an event:\n ```javascript\n function doStuff() { // do stuff! }\n object.on('stuff', doStuff);\n object.trigger('stuff'); // doStuff will be called\n // Unregister ONLY the doStuff callback\n object.off('stuff', doStuff);\n object.trigger('stuff'); // doStuff will NOT be called\n ```\n If you don't pass a `callback` argument to `off`, ALL callbacks for the\n event will not be executed when the event fires. For example:\n ```javascript\n var callback1 = function(){};\n var callback2 = function(){};\n object.on('stuff', callback1);\n object.on('stuff', callback2);\n object.trigger('stuff'); // callback1 and callback2 will be executed.\n object.off('stuff');\n object.trigger('stuff'); // callback1 and callback2 will not be executed!\n ```\n @method off\n @for RSVP.EventTarget\n @private\n @param {String} eventName event to stop listening to\n @param {Function} callback optional argument. If given, only the function\n given will be removed from the event's callback queue. If no `callback`\n argument is given, all callbacks will be removed from the event's callback\n queue.\n */\n 'off': function (eventName, callback) {\n var allCallbacks = callbacksFor(this),\n callbacks,\n index;\n\n if (!callback) {\n allCallbacks[eventName] = [];\n return;\n }\n\n callbacks = allCallbacks[eventName];\n\n index = indexOf(callbacks, callback);\n\n if (index !== -1) {\n callbacks.splice(index, 1);\n }\n },\n\n /**\n Use `trigger` to fire custom events. For example:\n ```javascript\n object.on('foo', function(){\n console.log('foo event happened!');\n });\n object.trigger('foo');\n // 'foo event happened!' logged to the console\n ```\n You can also pass a value as a second argument to `trigger` that will be\n passed as an argument to all event listeners for the event:\n ```javascript\n object.on('foo', function(value){\n console.log(value.name);\n });\n object.trigger('foo', { name: 'bar' });\n // 'bar' logged to the console\n ```\n @method trigger\n @for RSVP.EventTarget\n @private\n @param {String} eventName name of the event to be triggered\n @param {*} options optional value to be passed to any event handlers for\n the given `eventName`\n */\n 'trigger': function (eventName, options) {\n var allCallbacks = callbacksFor(this),\n callbacks,\n callback;\n\n if (callbacks = allCallbacks[eventName]) {\n // Don't cache the callbacks.length since it may grow\n for (var i = 0; i < callbacks.length; i++) {\n callback = callbacks[i];\n\n callback(options);\n }\n }\n }\n };\n});\nenifed('rsvp/filter', ['exports', 'rsvp/promise', 'rsvp/utils'], function (exports, _rsvpPromise, _rsvpUtils) {\n 'use strict';\n\n exports.default = filter;\n\n /**\n `RSVP.filter` is similar to JavaScript's native `filter` method, except that it\n waits for all promises to become fulfilled before running the `filterFn` on\n each item in given to `promises`. `RSVP.filter` returns a promise that will\n become fulfilled with the result of running `filterFn` on the values the\n promises become fulfilled with.\n \n For example:\n \n ```javascript\n \n var promise1 = RSVP.resolve(1);\n var promise2 = RSVP.resolve(2);\n var promise3 = RSVP.resolve(3);\n \n var promises = [promise1, promise2, promise3];\n \n var filterFn = function(item){\n return item > 1;\n };\n \n RSVP.filter(promises, filterFn).then(function(result){\n // result is [ 2, 3 ]\n });\n ```\n \n If any of the `promises` given to `RSVP.filter` are rejected, the first promise\n that is rejected will be given as an argument to the returned promise's\n rejection handler. For example:\n \n ```javascript\n var promise1 = RSVP.resolve(1);\n var promise2 = RSVP.reject(new Error('2'));\n var promise3 = RSVP.reject(new Error('3'));\n var promises = [ promise1, promise2, promise3 ];\n \n var filterFn = function(item){\n return item > 1;\n };\n \n RSVP.filter(promises, filterFn).then(function(array){\n // Code here never runs because there are rejected promises!\n }, function(reason) {\n // reason.message === '2'\n });\n ```\n \n `RSVP.filter` will also wait for any promises returned from `filterFn`.\n For instance, you may want to fetch a list of users then return a subset\n of those users based on some asynchronous operation:\n \n ```javascript\n \n var alice = { name: 'alice' };\n var bob = { name: 'bob' };\n var users = [ alice, bob ];\n \n var promises = users.map(function(user){\n return RSVP.resolve(user);\n });\n \n var filterFn = function(user){\n // Here, Alice has permissions to create a blog post, but Bob does not.\n return getPrivilegesForUser(user).then(function(privs){\n return privs.can_create_blog_post === true;\n });\n };\n RSVP.filter(promises, filterFn).then(function(users){\n // true, because the server told us only Alice can create a blog post.\n users.length === 1;\n // false, because Alice is the only user present in `users`\n users[0] === bob;\n });\n ```\n \n @method filter\n @static\n @for RSVP\n @param {Array} promises\n @param {Function} filterFn - function to be called on each resolved value to\n filter the final results.\n @param {String} label optional string describing the promise. Useful for\n tooling.\n @return {Promise}\n */\n\n function filter(promises, filterFn, label) {\n return _rsvpPromise.default.all(promises, label).then(function (values) {\n if (!_rsvpUtils.isFunction(filterFn)) {\n throw new TypeError(\"You must pass a function as filter's second argument.\");\n }\n\n var length = values.length;\n var filtered = new Array(length);\n\n for (var i = 0; i < length; i++) {\n filtered[i] = filterFn(values[i]);\n }\n\n return _rsvpPromise.default.all(filtered, label).then(function (filtered) {\n var results = new Array(length);\n var newLength = 0;\n\n for (var i = 0; i < length; i++) {\n if (filtered[i]) {\n results[newLength] = values[i];\n newLength++;\n }\n }\n\n results.length = newLength;\n\n return results;\n });\n });\n }\n});\nenifed('rsvp/hash-settled', ['exports', 'rsvp/promise', 'rsvp/enumerator', 'rsvp/promise-hash', 'rsvp/utils'], function (exports, _rsvpPromise, _rsvpEnumerator, _rsvpPromiseHash, _rsvpUtils) {\n 'use strict';\n\n exports.default = hashSettled;\n\n function HashSettled(Constructor, object, label) {\n this._superConstructor(Constructor, object, false, label);\n }\n\n HashSettled.prototype = _rsvpUtils.o_create(_rsvpPromiseHash.default.prototype);\n HashSettled.prototype._superConstructor = _rsvpEnumerator.default;\n HashSettled.prototype._makeResult = _rsvpEnumerator.makeSettledResult;\n\n HashSettled.prototype._validationError = function () {\n return new Error('hashSettled must be called with an object');\n };\n\n /**\n `RSVP.hashSettled` is similar to `RSVP.allSettled`, but takes an object\n instead of an array for its `promises` argument.\n \n Unlike `RSVP.all` or `RSVP.hash`, which implement a fail-fast method,\n but like `RSVP.allSettled`, `hashSettled` waits until all the\n constituent promises have returned and then shows you all the results\n with their states and values/reasons. This is useful if you want to\n handle multiple promises' failure states together as a set.\n \n Returns a promise that is fulfilled when all the given promises have been\n settled, or rejected if the passed parameters are invalid.\n \n The returned promise is fulfilled with a hash that has the same key names as\n the `promises` object argument. If any of the values in the object are not\n promises, they will be copied over to the fulfilled object and marked with state\n 'fulfilled'.\n \n Example:\n \n ```javascript\n var promises = {\n myPromise: RSVP.Promise.resolve(1),\n yourPromise: RSVP.Promise.resolve(2),\n theirPromise: RSVP.Promise.resolve(3),\n notAPromise: 4\n };\n \n RSVP.hashSettled(promises).then(function(hash){\n // hash here is an object that looks like:\n // {\n // myPromise: { state: 'fulfilled', value: 1 },\n // yourPromise: { state: 'fulfilled', value: 2 },\n // theirPromise: { state: 'fulfilled', value: 3 },\n // notAPromise: { state: 'fulfilled', value: 4 }\n // }\n });\n ```\n \n If any of the `promises` given to `RSVP.hash` are rejected, the state will\n be set to 'rejected' and the reason for rejection provided.\n \n Example:\n \n ```javascript\n var promises = {\n myPromise: RSVP.Promise.resolve(1),\n rejectedPromise: RSVP.Promise.reject(new Error('rejection')),\n anotherRejectedPromise: RSVP.Promise.reject(new Error('more rejection')),\n };\n \n RSVP.hashSettled(promises).then(function(hash){\n // hash here is an object that looks like:\n // {\n // myPromise: { state: 'fulfilled', value: 1 },\n // rejectedPromise: { state: 'rejected', reason: Error },\n // anotherRejectedPromise: { state: 'rejected', reason: Error },\n // }\n // Note that for rejectedPromise, reason.message == 'rejection',\n // and for anotherRejectedPromise, reason.message == 'more rejection'.\n });\n ```\n \n An important note: `RSVP.hashSettled` is intended for plain JavaScript objects that\n are just a set of keys and values. `RSVP.hashSettled` will NOT preserve prototype\n chains.\n \n Example:\n \n ```javascript\n function MyConstructor(){\n this.example = RSVP.Promise.resolve('Example');\n }\n \n MyConstructor.prototype = {\n protoProperty: RSVP.Promise.resolve('Proto Property')\n };\n \n var myObject = new MyConstructor();\n \n RSVP.hashSettled(myObject).then(function(hash){\n // protoProperty will not be present, instead you will just have an\n // object that looks like:\n // {\n // example: { state: 'fulfilled', value: 'Example' }\n // }\n //\n // hash.hasOwnProperty('protoProperty'); // false\n // 'undefined' === typeof hash.protoProperty\n });\n ```\n \n @method hashSettled\n @for RSVP\n @param {Object} object\n @param {String} label optional string that describes the promise.\n Useful for tooling.\n @return {Promise} promise that is fulfilled when when all properties of `promises`\n have been settled.\n @static\n */\n\n function hashSettled(object, label) {\n return new HashSettled(_rsvpPromise.default, object, label).promise;\n }\n});\nenifed('rsvp/hash', ['exports', 'rsvp/promise', 'rsvp/promise-hash'], function (exports, _rsvpPromise, _rsvpPromiseHash) {\n 'use strict';\n\n exports.default = hash;\n\n /**\n `RSVP.hash` is similar to `RSVP.all`, but takes an object instead of an array\n for its `promises` argument.\n \n Returns a promise that is fulfilled when all the given promises have been\n fulfilled, or rejected if any of them become rejected. The returned promise\n is fulfilled with a hash that has the same key names as the `promises` object\n argument. If any of the values in the object are not promises, they will\n simply be copied over to the fulfilled object.\n \n Example:\n \n ```javascript\n var promises = {\n myPromise: RSVP.resolve(1),\n yourPromise: RSVP.resolve(2),\n theirPromise: RSVP.resolve(3),\n notAPromise: 4\n };\n \n RSVP.hash(promises).then(function(hash){\n // hash here is an object that looks like:\n // {\n // myPromise: 1,\n // yourPromise: 2,\n // theirPromise: 3,\n // notAPromise: 4\n // }\n });\n ````\n \n If any of the `promises` given to `RSVP.hash` are rejected, the first promise\n that is rejected will be given as the reason to the rejection handler.\n \n Example:\n \n ```javascript\n var promises = {\n myPromise: RSVP.resolve(1),\n rejectedPromise: RSVP.reject(new Error('rejectedPromise')),\n anotherRejectedPromise: RSVP.reject(new Error('anotherRejectedPromise')),\n };\n \n RSVP.hash(promises).then(function(hash){\n // Code here never runs because there are rejected promises!\n }, function(reason) {\n // reason.message === 'rejectedPromise'\n });\n ```\n \n An important note: `RSVP.hash` is intended for plain JavaScript objects that\n are just a set of keys and values. `RSVP.hash` will NOT preserve prototype\n chains.\n \n Example:\n \n ```javascript\n function MyConstructor(){\n this.example = RSVP.resolve('Example');\n }\n \n MyConstructor.prototype = {\n protoProperty: RSVP.resolve('Proto Property')\n };\n \n var myObject = new MyConstructor();\n \n RSVP.hash(myObject).then(function(hash){\n // protoProperty will not be present, instead you will just have an\n // object that looks like:\n // {\n // example: 'Example'\n // }\n //\n // hash.hasOwnProperty('protoProperty'); // false\n // 'undefined' === typeof hash.protoProperty\n });\n ```\n \n @method hash\n @static\n @for RSVP\n @param {Object} object\n @param {String} label optional string that describes the promise.\n Useful for tooling.\n @return {Promise} promise that is fulfilled when all properties of `promises`\n have been fulfilled, or rejected if any of them become rejected.\n */\n\n function hash(object, label) {\n return new _rsvpPromiseHash.default(_rsvpPromise.default, object, label).promise;\n }\n});\nenifed('rsvp/instrument', ['exports', 'rsvp/config', 'rsvp/utils'], function (exports, _rsvpConfig, _rsvpUtils) {\n 'use strict';\n\n exports.default = instrument;\n\n var queue = [];\n\n function scheduleFlush() {\n setTimeout(function () {\n var entry;\n for (var i = 0; i < queue.length; i++) {\n entry = queue[i];\n\n var payload = entry.payload;\n\n payload.guid = payload.key + payload.id;\n payload.childGuid = payload.key + payload.childId;\n if (payload.error) {\n payload.stack = payload.error.stack;\n }\n\n _rsvpConfig.config['trigger'](entry.name, entry.payload);\n }\n queue.length = 0;\n }, 50);\n }\n\n function instrument(eventName, promise, child) {\n if (1 === queue.push({\n name: eventName,\n payload: {\n key: promise._guidKey,\n id: promise._id,\n eventName: eventName,\n detail: promise._result,\n childId: child && child._id,\n label: promise._label,\n timeStamp: _rsvpUtils.now(),\n error: _rsvpConfig.config[\"instrument-with-stack\"] ? new Error(promise._label) : null\n } })) {\n scheduleFlush();\n }\n }\n});\nenifed('rsvp/map', ['exports', 'rsvp/promise', 'rsvp/utils'], function (exports, _rsvpPromise, _rsvpUtils) {\n 'use strict';\n\n exports.default = map;\n\n /**\n `RSVP.map` is similar to JavaScript's native `map` method, except that it\n waits for all promises to become fulfilled before running the `mapFn` on\n each item in given to `promises`. `RSVP.map` returns a promise that will\n become fulfilled with the result of running `mapFn` on the values the promises\n become fulfilled with.\n \n For example:\n \n ```javascript\n \n var promise1 = RSVP.resolve(1);\n var promise2 = RSVP.resolve(2);\n var promise3 = RSVP.resolve(3);\n var promises = [ promise1, promise2, promise3 ];\n \n var mapFn = function(item){\n return item + 1;\n };\n \n RSVP.map(promises, mapFn).then(function(result){\n // result is [ 2, 3, 4 ]\n });\n ```\n \n If any of the `promises` given to `RSVP.map` are rejected, the first promise\n that is rejected will be given as an argument to the returned promise's\n rejection handler. For example:\n \n ```javascript\n var promise1 = RSVP.resolve(1);\n var promise2 = RSVP.reject(new Error('2'));\n var promise3 = RSVP.reject(new Error('3'));\n var promises = [ promise1, promise2, promise3 ];\n \n var mapFn = function(item){\n return item + 1;\n };\n \n RSVP.map(promises, mapFn).then(function(array){\n // Code here never runs because there are rejected promises!\n }, function(reason) {\n // reason.message === '2'\n });\n ```\n \n `RSVP.map` will also wait if a promise is returned from `mapFn`. For example,\n say you want to get all comments from a set of blog posts, but you need\n the blog posts first because they contain a url to those comments.\n \n ```javscript\n \n var mapFn = function(blogPost){\n // getComments does some ajax and returns an RSVP.Promise that is fulfilled\n // with some comments data\n return getComments(blogPost.comments_url);\n };\n \n // getBlogPosts does some ajax and returns an RSVP.Promise that is fulfilled\n // with some blog post data\n RSVP.map(getBlogPosts(), mapFn).then(function(comments){\n // comments is the result of asking the server for the comments\n // of all blog posts returned from getBlogPosts()\n });\n ```\n \n @method map\n @static\n @for RSVP\n @param {Array} promises\n @param {Function} mapFn function to be called on each fulfilled promise.\n @param {String} label optional string for labeling the promise.\n Useful for tooling.\n @return {Promise} promise that is fulfilled with the result of calling\n `mapFn` on each fulfilled promise or value when they become fulfilled.\n The promise will be rejected if any of the given `promises` become rejected.\n @static\n */\n\n function map(promises, mapFn, label) {\n return _rsvpPromise.default.all(promises, label).then(function (values) {\n if (!_rsvpUtils.isFunction(mapFn)) {\n throw new TypeError(\"You must pass a function as map's second argument.\");\n }\n\n var length = values.length;\n var results = new Array(length);\n\n for (var i = 0; i < length; i++) {\n results[i] = mapFn(values[i]);\n }\n\n return _rsvpPromise.default.all(results, label);\n });\n }\n});\nenifed('rsvp/node', ['exports', 'rsvp/promise', 'rsvp/-internal', 'rsvp/utils'], function (exports, _rsvpPromise, _rsvpInternal, _rsvpUtils) {\n 'use strict';\n\n exports.default = denodeify;\n\n function Result() {\n this.value = undefined;\n }\n\n var ERROR = new Result();\n var GET_THEN_ERROR = new Result();\n\n function getThen(obj) {\n try {\n return obj.then;\n } catch (error) {\n ERROR.value = error;\n return ERROR;\n }\n }\n\n function tryApply(f, s, a) {\n try {\n f.apply(s, a);\n } catch (error) {\n ERROR.value = error;\n return ERROR;\n }\n }\n\n function makeObject(_, argumentNames) {\n var obj = {};\n var name;\n var i;\n var length = _.length;\n var args = new Array(length);\n\n for (var x = 0; x < length; x++) {\n args[x] = _[x];\n }\n\n for (i = 0; i < argumentNames.length; i++) {\n name = argumentNames[i];\n obj[name] = args[i + 1];\n }\n\n return obj;\n }\n\n function arrayResult(_) {\n var length = _.length;\n var args = new Array(length - 1);\n\n for (var i = 1; i < length; i++) {\n args[i - 1] = _[i];\n }\n\n return args;\n }\n\n function wrapThenable(then, promise) {\n return {\n then: function (onFulFillment, onRejection) {\n return then.call(promise, onFulFillment, onRejection);\n }\n };\n }\n\n /**\n `RSVP.denodeify` takes a 'node-style' function and returns a function that\n will return an `RSVP.Promise`. You can use `denodeify` in Node.js or the\n browser when you'd prefer to use promises over using callbacks. For example,\n `denodeify` transforms the following:\n \n ```javascript\n var fs = require('fs');\n \n fs.readFile('myfile.txt', function(err, data){\n if (err) return handleError(err);\n handleData(data);\n });\n ```\n \n into:\n \n ```javascript\n var fs = require('fs');\n var readFile = RSVP.denodeify(fs.readFile);\n \n readFile('myfile.txt').then(handleData, handleError);\n ```\n \n If the node function has multiple success parameters, then `denodeify`\n just returns the first one:\n \n ```javascript\n var request = RSVP.denodeify(require('request'));\n \n request('http://example.com').then(function(res) {\n // ...\n });\n ```\n \n However, if you need all success parameters, setting `denodeify`'s\n second parameter to `true` causes it to return all success parameters\n as an array:\n \n ```javascript\n var request = RSVP.denodeify(require('request'), true);\n \n request('http://example.com').then(function(result) {\n // result[0] -> res\n // result[1] -> body\n });\n ```\n \n Or if you pass it an array with names it returns the parameters as a hash:\n \n ```javascript\n var request = RSVP.denodeify(require('request'), ['res', 'body']);\n \n request('http://example.com').then(function(result) {\n // result.res\n // result.body\n });\n ```\n \n Sometimes you need to retain the `this`:\n \n ```javascript\n var app = require('express')();\n var render = RSVP.denodeify(app.render.bind(app));\n ```\n \n The denodified function inherits from the original function. It works in all\n environments, except IE 10 and below. Consequently all properties of the original\n function are available to you. However, any properties you change on the\n denodeified function won't be changed on the original function. Example:\n \n ```javascript\n var request = RSVP.denodeify(require('request')),\n cookieJar = request.jar(); // <- Inheritance is used here\n \n request('http://example.com', {jar: cookieJar}).then(function(res) {\n // cookieJar.cookies holds now the cookies returned by example.com\n });\n ```\n \n Using `denodeify` makes it easier to compose asynchronous operations instead\n of using callbacks. For example, instead of:\n \n ```javascript\n var fs = require('fs');\n \n fs.readFile('myfile.txt', function(err, data){\n if (err) { ... } // Handle error\n fs.writeFile('myfile2.txt', data, function(err){\n if (err) { ... } // Handle error\n console.log('done')\n });\n });\n ```\n \n you can chain the operations together using `then` from the returned promise:\n \n ```javascript\n var fs = require('fs');\n var readFile = RSVP.denodeify(fs.readFile);\n var writeFile = RSVP.denodeify(fs.writeFile);\n \n readFile('myfile.txt').then(function(data){\n return writeFile('myfile2.txt', data);\n }).then(function(){\n console.log('done')\n }).catch(function(error){\n // Handle error\n });\n ```\n \n @method denodeify\n @static\n @for RSVP\n @param {Function} nodeFunc a 'node-style' function that takes a callback as\n its last argument. The callback expects an error to be passed as its first\n argument (if an error occurred, otherwise null), and the value from the\n operation as its second argument ('function(err, value){ }').\n @param {Boolean|Array} [options] An optional paramter that if set\n to `true` causes the promise to fulfill with the callback's success arguments\n as an array. This is useful if the node function has multiple success\n paramters. If you set this paramter to an array with names, the promise will\n fulfill with a hash with these names as keys and the success parameters as\n values.\n @return {Function} a function that wraps `nodeFunc` to return an\n `RSVP.Promise`\n @static\n */\n\n function denodeify(nodeFunc, options) {\n var fn = function () {\n var self = this;\n var l = arguments.length;\n var args = new Array(l + 1);\n var arg;\n var promiseInput = false;\n\n for (var i = 0; i < l; ++i) {\n arg = arguments[i];\n\n if (!promiseInput) {\n // TODO: clean this up\n promiseInput = needsPromiseInput(arg);\n if (promiseInput === GET_THEN_ERROR) {\n var p = new _rsvpPromise.default(_rsvpInternal.noop);\n _rsvpInternal.reject(p, GET_THEN_ERROR.value);\n return p;\n } else if (promiseInput && promiseInput !== true) {\n arg = wrapThenable(promiseInput, arg);\n }\n }\n args[i] = arg;\n }\n\n var promise = new _rsvpPromise.default(_rsvpInternal.noop);\n\n args[l] = function (err, val) {\n if (err) _rsvpInternal.reject(promise, err);else if (options === undefined) _rsvpInternal.resolve(promise, val);else if (options === true) _rsvpInternal.resolve(promise, arrayResult(arguments));else if (_rsvpUtils.isArray(options)) _rsvpInternal.resolve(promise, makeObject(arguments, options));else _rsvpInternal.resolve(promise, val);\n };\n\n if (promiseInput) {\n return handlePromiseInput(promise, args, nodeFunc, self);\n } else {\n return handleValueInput(promise, args, nodeFunc, self);\n }\n };\n\n fn.__proto__ = nodeFunc;\n\n return fn;\n }\n\n function handleValueInput(promise, args, nodeFunc, self) {\n var result = tryApply(nodeFunc, self, args);\n if (result === ERROR) {\n _rsvpInternal.reject(promise, result.value);\n }\n return promise;\n }\n\n function handlePromiseInput(promise, args, nodeFunc, self) {\n return _rsvpPromise.default.all(args).then(function (args) {\n var result = tryApply(nodeFunc, self, args);\n if (result === ERROR) {\n _rsvpInternal.reject(promise, result.value);\n }\n return promise;\n });\n }\n\n function needsPromiseInput(arg) {\n if (arg && typeof arg === 'object') {\n if (arg.constructor === _rsvpPromise.default) {\n return true;\n } else {\n return getThen(arg);\n }\n } else {\n return false;\n }\n }\n});\nenifed('rsvp/platform', ['exports'], function (exports) {\n 'use strict';\n\n var platform;\n\n /* global self */\n if (typeof self === 'object') {\n platform = self;\n\n /* global global */\n } else if (typeof global === 'object') {\n platform = global;\n } else {\n throw new Error('no global: `self` or `global` found');\n }\n\n exports.default = platform;\n});\nenifed('rsvp/promise/all', ['exports', 'rsvp/enumerator'], function (exports, _rsvpEnumerator) {\n 'use strict';\n\n exports.default = all;\n\n /**\n `RSVP.Promise.all` accepts an array of promises, and returns a new promise which\n is fulfilled with an array of fulfillment values for the passed promises, or\n rejected with the reason of the first passed promise to be rejected. It casts all\n elements of the passed iterable to promises as it runs this algorithm.\n \n Example:\n \n ```javascript\n var promise1 = RSVP.resolve(1);\n var promise2 = RSVP.resolve(2);\n var promise3 = RSVP.resolve(3);\n var promises = [ promise1, promise2, promise3 ];\n \n RSVP.Promise.all(promises).then(function(array){\n // The array here would be [ 1, 2, 3 ];\n });\n ```\n \n If any of the `promises` given to `RSVP.all` are rejected, the first promise\n that is rejected will be given as an argument to the returned promises's\n rejection handler. For example:\n \n Example:\n \n ```javascript\n var promise1 = RSVP.resolve(1);\n var promise2 = RSVP.reject(new Error(\"2\"));\n var promise3 = RSVP.reject(new Error(\"3\"));\n var promises = [ promise1, promise2, promise3 ];\n \n RSVP.Promise.all(promises).then(function(array){\n // Code here never runs because there are rejected promises!\n }, function(error) {\n // error.message === \"2\"\n });\n ```\n \n @method all\n @static\n @param {Array} entries array of promises\n @param {String} label optional string for labeling the promise.\n Useful for tooling.\n @return {Promise} promise that is fulfilled when all `promises` have been\n fulfilled, or rejected if any of them become rejected.\n @static\n */\n\n function all(entries, label) {\n return new _rsvpEnumerator.default(this, entries, true, /* abort on reject */label).promise;\n }\n});\nenifed('rsvp/promise/race', ['exports', 'rsvp/utils', 'rsvp/-internal'], function (exports, _rsvpUtils, _rsvpInternal) {\n 'use strict';\n\n exports.default = race;\n\n /**\n `RSVP.Promise.race` returns a new promise which is settled in the same way as the\n first passed promise to settle.\n \n Example:\n \n ```javascript\n var promise1 = new RSVP.Promise(function(resolve, reject){\n setTimeout(function(){\n resolve('promise 1');\n }, 200);\n });\n \n var promise2 = new RSVP.Promise(function(resolve, reject){\n setTimeout(function(){\n resolve('promise 2');\n }, 100);\n });\n \n RSVP.Promise.race([promise1, promise2]).then(function(result){\n // result === 'promise 2' because it was resolved before promise1\n // was resolved.\n });\n ```\n \n `RSVP.Promise.race` is deterministic in that only the state of the first\n settled promise matters. For example, even if other promises given to the\n `promises` array argument are resolved, but the first settled promise has\n become rejected before the other promises became fulfilled, the returned\n promise will become rejected:\n \n ```javascript\n var promise1 = new RSVP.Promise(function(resolve, reject){\n setTimeout(function(){\n resolve('promise 1');\n }, 200);\n });\n \n var promise2 = new RSVP.Promise(function(resolve, reject){\n setTimeout(function(){\n reject(new Error('promise 2'));\n }, 100);\n });\n \n RSVP.Promise.race([promise1, promise2]).then(function(result){\n // Code here never runs\n }, function(reason){\n // reason.message === 'promise 2' because promise 2 became rejected before\n // promise 1 became fulfilled\n });\n ```\n \n An example real-world use case is implementing timeouts:\n \n ```javascript\n RSVP.Promise.race([ajax('foo.json'), timeout(5000)])\n ```\n \n @method race\n @static\n @param {Array} entries array of promises to observe\n @param {String} label optional string for describing the promise returned.\n Useful for tooling.\n @return {Promise} a promise which settles in the same way as the first passed\n promise to settle.\n */\n\n function race(entries, label) {\n /*jshint validthis:true */\n var Constructor = this;\n\n var promise = new Constructor(_rsvpInternal.noop, label);\n\n if (!_rsvpUtils.isArray(entries)) {\n _rsvpInternal.reject(promise, new TypeError('You must pass an array to race.'));\n return promise;\n }\n\n var length = entries.length;\n\n function onFulfillment(value) {\n _rsvpInternal.resolve(promise, value);\n }\n\n function onRejection(reason) {\n _rsvpInternal.reject(promise, reason);\n }\n\n for (var i = 0; promise._state === _rsvpInternal.PENDING && i < length; i++) {\n _rsvpInternal.subscribe(Constructor.resolve(entries[i]), undefined, onFulfillment, onRejection);\n }\n\n return promise;\n }\n});\nenifed('rsvp/promise/reject', ['exports', 'rsvp/-internal'], function (exports, _rsvpInternal) {\n 'use strict';\n\n exports.default = reject;\n\n /**\n `RSVP.Promise.reject` returns a promise rejected with the passed `reason`.\n It is shorthand for the following:\n \n ```javascript\n var promise = new RSVP.Promise(function(resolve, reject){\n reject(new Error('WHOOPS'));\n });\n \n promise.then(function(value){\n // Code here doesn't run because the promise is rejected!\n }, function(reason){\n // reason.message === 'WHOOPS'\n });\n ```\n \n Instead of writing the above, your code now simply becomes the following:\n \n ```javascript\n var promise = RSVP.Promise.reject(new Error('WHOOPS'));\n \n promise.then(function(value){\n // Code here doesn't run because the promise is rejected!\n }, function(reason){\n // reason.message === 'WHOOPS'\n });\n ```\n \n @method reject\n @static\n @param {*} reason value that the returned promise will be rejected with.\n @param {String} label optional string for identifying the returned promise.\n Useful for tooling.\n @return {Promise} a promise rejected with the given `reason`.\n */\n\n function reject(reason, label) {\n /*jshint validthis:true */\n var Constructor = this;\n var promise = new Constructor(_rsvpInternal.noop, label);\n _rsvpInternal.reject(promise, reason);\n return promise;\n }\n});\nenifed('rsvp/promise/resolve', ['exports', 'rsvp/-internal'], function (exports, _rsvpInternal) {\n 'use strict';\n\n exports.default = resolve;\n\n /**\n `RSVP.Promise.resolve` returns a promise that will become resolved with the\n passed `value`. It is shorthand for the following:\n \n ```javascript\n var promise = new RSVP.Promise(function(resolve, reject){\n resolve(1);\n });\n \n promise.then(function(value){\n // value === 1\n });\n ```\n \n Instead of writing the above, your code now simply becomes the following:\n \n ```javascript\n var promise = RSVP.Promise.resolve(1);\n \n promise.then(function(value){\n // value === 1\n });\n ```\n \n @method resolve\n @static\n @param {*} object value that the returned promise will be resolved with\n @param {String} label optional string for identifying the returned promise.\n Useful for tooling.\n @return {Promise} a promise that will become fulfilled with the given\n `value`\n */\n\n function resolve(object, label) {\n /*jshint validthis:true */\n var Constructor = this;\n\n if (object && typeof object === 'object' && object.constructor === Constructor) {\n return object;\n }\n\n var promise = new Constructor(_rsvpInternal.noop, label);\n _rsvpInternal.resolve(promise, object);\n return promise;\n }\n});\nenifed('rsvp/promise-hash', ['exports', 'rsvp/enumerator', 'rsvp/-internal', 'rsvp/utils'], function (exports, _rsvpEnumerator, _rsvpInternal, _rsvpUtils) {\n 'use strict';\n\n function PromiseHash(Constructor, object, label) {\n this._superConstructor(Constructor, object, true, label);\n }\n\n exports.default = PromiseHash;\n\n PromiseHash.prototype = _rsvpUtils.o_create(_rsvpEnumerator.default.prototype);\n PromiseHash.prototype._superConstructor = _rsvpEnumerator.default;\n PromiseHash.prototype._init = function () {\n this._result = {};\n };\n\n PromiseHash.prototype._validateInput = function (input) {\n return input && typeof input === 'object';\n };\n\n PromiseHash.prototype._validationError = function () {\n return new Error('Promise.hash must be called with an object');\n };\n\n PromiseHash.prototype._enumerate = function () {\n var enumerator = this;\n var promise = enumerator.promise;\n var input = enumerator._input;\n var results = [];\n\n for (var key in input) {\n if (promise._state === _rsvpInternal.PENDING && Object.prototype.hasOwnProperty.call(input, key)) {\n results.push({\n position: key,\n entry: input[key]\n });\n }\n }\n\n var length = results.length;\n enumerator._remaining = length;\n var result;\n\n for (var i = 0; promise._state === _rsvpInternal.PENDING && i < length; i++) {\n result = results[i];\n enumerator._eachEntry(result.entry, result.position);\n }\n };\n});\nenifed('rsvp/promise', ['exports', 'rsvp/config', 'rsvp/instrument', 'rsvp/utils', 'rsvp/-internal', 'rsvp/promise/all', 'rsvp/promise/race', 'rsvp/promise/resolve', 'rsvp/promise/reject'], function (exports, _rsvpConfig, _rsvpInstrument, _rsvpUtils, _rsvpInternal, _rsvpPromiseAll, _rsvpPromiseRace, _rsvpPromiseResolve, _rsvpPromiseReject) {\n 'use strict';\n\n exports.default = Promise;\n\n var guidKey = 'rsvp_' + _rsvpUtils.now() + '-';\n var counter = 0;\n\n function needsResolver() {\n throw new TypeError('You must pass a resolver function as the first argument to the promise constructor');\n }\n\n function needsNew() {\n throw new TypeError(\"Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.\");\n }\n\n /**\n Promise objects represent the eventual result of an asynchronous operation. The\n primary way of interacting with a promise is through its `then` method, which\n registers callbacks to receive either a promise’s eventual value or the reason\n why the promise cannot be fulfilled.\n \n Terminology\n -----------\n \n - `promise` is an object or function with a `then` method whose behavior conforms to this specification.\n - `thenable` is an object or function that defines a `then` method.\n - `value` is any legal JavaScript value (including undefined, a thenable, or a promise).\n - `exception` is a value that is thrown using the throw statement.\n - `reason` is a value that indicates why a promise was rejected.\n - `settled` the final resting state of a promise, fulfilled or rejected.\n \n A promise can be in one of three states: pending, fulfilled, or rejected.\n \n Promises that are fulfilled have a fulfillment value and are in the fulfilled\n state. Promises that are rejected have a rejection reason and are in the\n rejected state. A fulfillment value is never a thenable.\n \n Promises can also be said to *resolve* a value. If this value is also a\n promise, then the original promise's settled state will match the value's\n settled state. So a promise that *resolves* a promise that rejects will\n itself reject, and a promise that *resolves* a promise that fulfills will\n itself fulfill.\n \n \n Basic Usage:\n ------------\n \n ```js\n var promise = new Promise(function(resolve, reject) {\n // on success\n resolve(value);\n \n // on failure\n reject(reason);\n });\n \n promise.then(function(value) {\n // on fulfillment\n }, function(reason) {\n // on rejection\n });\n ```\n \n Advanced Usage:\n ---------------\n \n Promises shine when abstracting away asynchronous interactions such as\n `XMLHttpRequest`s.\n \n ```js\n function getJSON(url) {\n return new Promise(function(resolve, reject){\n var xhr = new XMLHttpRequest();\n \n xhr.open('GET', url);\n xhr.onreadystatechange = handler;\n xhr.responseType = 'json';\n xhr.setRequestHeader('Accept', 'application/json');\n xhr.send();\n \n function handler() {\n if (this.readyState === this.DONE) {\n if (this.status === 200) {\n resolve(this.response);\n } else {\n reject(new Error('getJSON: `' + url + '` failed with status: [' + this.status + ']'));\n }\n }\n };\n });\n }\n \n getJSON('/posts.json').then(function(json) {\n // on fulfillment\n }, function(reason) {\n // on rejection\n });\n ```\n \n Unlike callbacks, promises are great composable primitives.\n \n ```js\n Promise.all([\n getJSON('/posts'),\n getJSON('/comments')\n ]).then(function(values){\n values[0] // => postsJSON\n values[1] // => commentsJSON\n \n return values;\n });\n ```\n \n @class RSVP.Promise\n @param {function} resolver\n @param {String} label optional string for labeling the promise.\n Useful for tooling.\n @constructor\n */\n\n function Promise(resolver, label) {\n var promise = this;\n\n promise._id = counter++;\n promise._label = label;\n promise._state = undefined;\n promise._result = undefined;\n promise._subscribers = [];\n\n if (_rsvpConfig.config.instrument) {\n _rsvpInstrument.default('created', promise);\n }\n\n if (_rsvpInternal.noop !== resolver) {\n if (!_rsvpUtils.isFunction(resolver)) {\n needsResolver();\n }\n\n if (!(promise instanceof Promise)) {\n needsNew();\n }\n\n _rsvpInternal.initializePromise(promise, resolver);\n }\n }\n\n Promise.cast = _rsvpPromiseResolve.default; // deprecated\n Promise.all = _rsvpPromiseAll.default;\n Promise.race = _rsvpPromiseRace.default;\n Promise.resolve = _rsvpPromiseResolve.default;\n Promise.reject = _rsvpPromiseReject.default;\n\n Promise.prototype = {\n constructor: Promise,\n\n _guidKey: guidKey,\n\n _onError: function (reason) {\n var promise = this;\n _rsvpConfig.config.after(function () {\n if (promise._onError) {\n _rsvpConfig.config['trigger']('error', reason);\n }\n });\n },\n\n /**\n The primary way of interacting with a promise is through its `then` method,\n which registers callbacks to receive either a promise's eventual value or the\n reason why the promise cannot be fulfilled.\n \n ```js\n findUser().then(function(user){\n // user is available\n }, function(reason){\n // user is unavailable, and you are given the reason why\n });\n ```\n \n Chaining\n --------\n \n The return value of `then` is itself a promise. This second, 'downstream'\n promise is resolved with the return value of the first promise's fulfillment\n or rejection handler, or rejected if the handler throws an exception.\n \n ```js\n findUser().then(function (user) {\n return user.name;\n }, function (reason) {\n return 'default name';\n }).then(function (userName) {\n // If `findUser` fulfilled, `userName` will be the user's name, otherwise it\n // will be `'default name'`\n });\n \n findUser().then(function (user) {\n throw new Error('Found user, but still unhappy');\n }, function (reason) {\n throw new Error('`findUser` rejected and we're unhappy');\n }).then(function (value) {\n // never reached\n }, function (reason) {\n // if `findUser` fulfilled, `reason` will be 'Found user, but still unhappy'.\n // If `findUser` rejected, `reason` will be '`findUser` rejected and we're unhappy'.\n });\n ```\n If the downstream promise does not specify a rejection handler, rejection reasons will be propagated further downstream.\n \n ```js\n findUser().then(function (user) {\n throw new PedagogicalException('Upstream error');\n }).then(function (value) {\n // never reached\n }).then(function (value) {\n // never reached\n }, function (reason) {\n // The `PedgagocialException` is propagated all the way down to here\n });\n ```\n \n Assimilation\n ------------\n \n Sometimes the value you want to propagate to a downstream promise can only be\n retrieved asynchronously. This can be achieved by returning a promise in the\n fulfillment or rejection handler. The downstream promise will then be pending\n until the returned promise is settled. This is called *assimilation*.\n \n ```js\n findUser().then(function (user) {\n return findCommentsByAuthor(user);\n }).then(function (comments) {\n // The user's comments are now available\n });\n ```\n \n If the assimliated promise rejects, then the downstream promise will also reject.\n \n ```js\n findUser().then(function (user) {\n return findCommentsByAuthor(user);\n }).then(function (comments) {\n // If `findCommentsByAuthor` fulfills, we'll have the value here\n }, function (reason) {\n // If `findCommentsByAuthor` rejects, we'll have the reason here\n });\n ```\n \n Simple Example\n --------------\n \n Synchronous Example\n \n ```javascript\n var result;\n \n try {\n result = findResult();\n // success\n } catch(reason) {\n // failure\n }\n ```\n \n Errback Example\n \n ```js\n findResult(function(result, err){\n if (err) {\n // failure\n } else {\n // success\n }\n });\n ```\n \n Promise Example;\n \n ```javascript\n findResult().then(function(result){\n // success\n }, function(reason){\n // failure\n });\n ```\n \n Advanced Example\n --------------\n \n Synchronous Example\n \n ```javascript\n var author, books;\n \n try {\n author = findAuthor();\n books = findBooksByAuthor(author);\n // success\n } catch(reason) {\n // failure\n }\n ```\n \n Errback Example\n \n ```js\n \n function foundBooks(books) {\n \n }\n \n function failure(reason) {\n \n }\n \n findAuthor(function(author, err){\n if (err) {\n failure(err);\n // failure\n } else {\n try {\n findBoooksByAuthor(author, function(books, err) {\n if (err) {\n failure(err);\n } else {\n try {\n foundBooks(books);\n } catch(reason) {\n failure(reason);\n }\n }\n });\n } catch(error) {\n failure(err);\n }\n // success\n }\n });\n ```\n \n Promise Example;\n \n ```javascript\n findAuthor().\n then(findBooksByAuthor).\n then(function(books){\n // found books\n }).catch(function(reason){\n // something went wrong\n });\n ```\n \n @method then\n @param {Function} onFulfillment\n @param {Function} onRejection\n @param {String} label optional string for labeling the promise.\n Useful for tooling.\n @return {Promise}\n */\n then: function (onFulfillment, onRejection, label) {\n var parent = this;\n var state = parent._state;\n\n if (state === _rsvpInternal.FULFILLED && !onFulfillment || state === _rsvpInternal.REJECTED && !onRejection) {\n if (_rsvpConfig.config.instrument) {\n _rsvpInstrument.default('chained', parent, parent);\n }\n return parent;\n }\n\n parent._onError = null;\n\n var child = new parent.constructor(_rsvpInternal.noop, label);\n var result = parent._result;\n\n if (_rsvpConfig.config.instrument) {\n _rsvpInstrument.default('chained', parent, child);\n }\n\n if (state) {\n var callback = arguments[state - 1];\n _rsvpConfig.config.async(function () {\n _rsvpInternal.invokeCallback(state, child, callback, result);\n });\n } else {\n _rsvpInternal.subscribe(parent, child, onFulfillment, onRejection);\n }\n\n return child;\n },\n\n /**\n `catch` is simply sugar for `then(undefined, onRejection)` which makes it the same\n as the catch block of a try/catch statement.\n \n ```js\n function findAuthor(){\n throw new Error('couldn't find that author');\n }\n \n // synchronous\n try {\n findAuthor();\n } catch(reason) {\n // something went wrong\n }\n \n // async with promises\n findAuthor().catch(function(reason){\n // something went wrong\n });\n ```\n \n @method catch\n @param {Function} onRejection\n @param {String} label optional string for labeling the promise.\n Useful for tooling.\n @return {Promise}\n */\n 'catch': function (onRejection, label) {\n return this.then(undefined, onRejection, label);\n },\n\n /**\n `finally` will be invoked regardless of the promise's fate just as native\n try/catch/finally behaves\n \n Synchronous example:\n \n ```js\n findAuthor() {\n if (Math.random() > 0.5) {\n throw new Error();\n }\n return new Author();\n }\n \n try {\n return findAuthor(); // succeed or fail\n } catch(error) {\n return findOtherAuther();\n } finally {\n // always runs\n // doesn't affect the return value\n }\n ```\n \n Asynchronous example:\n \n ```js\n findAuthor().catch(function(reason){\n return findOtherAuther();\n }).finally(function(){\n // author was either found, or not\n });\n ```\n \n @method finally\n @param {Function} callback\n @param {String} label optional string for labeling the promise.\n Useful for tooling.\n @return {Promise}\n */\n 'finally': function (callback, label) {\n var promise = this;\n var constructor = promise.constructor;\n\n return promise.then(function (value) {\n return constructor.resolve(callback()).then(function () {\n return value;\n });\n }, function (reason) {\n return constructor.resolve(callback()).then(function () {\n throw reason;\n });\n }, label);\n }\n };\n});\nenifed('rsvp/race', ['exports', 'rsvp/promise'], function (exports, _rsvpPromise) {\n 'use strict';\n\n exports.default = race;\n\n /**\n This is a convenient alias for `RSVP.Promise.race`.\n \n @method race\n @static\n @for RSVP\n @param {Array} array Array of promises.\n @param {String} label An optional label. This is useful\n for tooling.\n */\n\n function race(array, label) {\n return _rsvpPromise.default.race(array, label);\n }\n});\nenifed('rsvp/reject', ['exports', 'rsvp/promise'], function (exports, _rsvpPromise) {\n 'use strict';\n\n exports.default = reject;\n\n /**\n This is a convenient alias for `RSVP.Promise.reject`.\n \n @method reject\n @static\n @for RSVP\n @param {*} reason value that the returned promise will be rejected with.\n @param {String} label optional string for identifying the returned promise.\n Useful for tooling.\n @return {Promise} a promise rejected with the given `reason`.\n */\n\n function reject(reason, label) {\n return _rsvpPromise.default.reject(reason, label);\n }\n});\nenifed('rsvp/resolve', ['exports', 'rsvp/promise'], function (exports, _rsvpPromise) {\n 'use strict';\n\n exports.default = resolve;\n\n /**\n This is a convenient alias for `RSVP.Promise.resolve`.\n \n @method resolve\n @static\n @for RSVP\n @param {*} value value that the returned promise will be resolved with\n @param {String} label optional string for identifying the returned promise.\n Useful for tooling.\n @return {Promise} a promise that will become fulfilled with the given\n `value`\n */\n\n function resolve(value, label) {\n return _rsvpPromise.default.resolve(value, label);\n }\n});\nenifed(\"rsvp/rethrow\", [\"exports\"], function (exports) {\n /**\n `RSVP.rethrow` will rethrow an error on the next turn of the JavaScript event\n loop in order to aid debugging.\n \n Promises A+ specifies that any exceptions that occur with a promise must be\n caught by the promises implementation and bubbled to the last handler. For\n this reason, it is recommended that you always specify a second rejection\n handler function to `then`. However, `RSVP.rethrow` will throw the exception\n outside of the promise, so it bubbles up to your console if in the browser,\n or domain/cause uncaught exception in Node. `rethrow` will also throw the\n error again so the error can be handled by the promise per the spec.\n \n ```javascript\n function throws(){\n throw new Error('Whoops!');\n }\n \n var promise = new RSVP.Promise(function(resolve, reject){\n throws();\n });\n \n promise.catch(RSVP.rethrow).then(function(){\n // Code here doesn't run because the promise became rejected due to an\n // error!\n }, function (err){\n // handle the error here\n });\n ```\n \n The 'Whoops' error will be thrown on the next turn of the event loop\n and you can watch for it in your console. You can also handle it using a\n rejection handler given to `.then` or `.catch` on the returned promise.\n \n @method rethrow\n @static\n @for RSVP\n @param {Error} reason reason the promise became rejected.\n @throws Error\n @static\n */\n \"use strict\";\n\n exports.default = rethrow;\n\n function rethrow(reason) {\n setTimeout(function () {\n throw reason;\n });\n throw reason;\n }\n});\nenifed('rsvp/utils', ['exports'], function (exports) {\n 'use strict';\n\n exports.objectOrFunction = objectOrFunction;\n exports.isFunction = isFunction;\n exports.isMaybeThenable = isMaybeThenable;\n\n function objectOrFunction(x) {\n return typeof x === 'function' || typeof x === 'object' && x !== null;\n }\n\n function isFunction(x) {\n return typeof x === 'function';\n }\n\n function isMaybeThenable(x) {\n return typeof x === 'object' && x !== null;\n }\n\n var _isArray;\n if (!Array.isArray) {\n _isArray = function (x) {\n return Object.prototype.toString.call(x) === '[object Array]';\n };\n } else {\n _isArray = Array.isArray;\n }\n\n var isArray = _isArray;\n\n exports.isArray = isArray;\n // Date.now is not available in browsers < IE9\n // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/now#Compatibility\n var now = Date.now || function () {\n return new Date().getTime();\n };\n\n exports.now = now;\n function F() {}\n\n var o_create = Object.create || function (o) {\n if (arguments.length > 1) {\n throw new Error('Second argument not supported');\n }\n if (typeof o !== 'object') {\n throw new TypeError('Argument must be an object');\n }\n F.prototype = o;\n return new F();\n };\n exports.o_create = o_create;\n});\nenifed('rsvp', ['exports', 'rsvp/promise', 'rsvp/events', 'rsvp/node', 'rsvp/all', 'rsvp/all-settled', 'rsvp/race', 'rsvp/hash', 'rsvp/hash-settled', 'rsvp/rethrow', 'rsvp/defer', 'rsvp/config', 'rsvp/map', 'rsvp/resolve', 'rsvp/reject', 'rsvp/filter', 'rsvp/asap'], function (exports, _rsvpPromise, _rsvpEvents, _rsvpNode, _rsvpAll, _rsvpAllSettled, _rsvpRace, _rsvpHash, _rsvpHashSettled, _rsvpRethrow, _rsvpDefer, _rsvpConfig, _rsvpMap, _rsvpResolve, _rsvpReject, _rsvpFilter, _rsvpAsap) {\n 'use strict';\n\n // defaults\n _rsvpConfig.config.async = _rsvpAsap.default;\n _rsvpConfig.config.after = function (cb) {\n setTimeout(cb, 0);\n };\n var cast = _rsvpResolve.default;\n function async(callback, arg) {\n _rsvpConfig.config.async(callback, arg);\n }\n\n function on() {\n _rsvpConfig.config['on'].apply(_rsvpConfig.config, arguments);\n }\n\n function off() {\n _rsvpConfig.config['off'].apply(_rsvpConfig.config, arguments);\n }\n\n // Set up instrumentation through `window.__PROMISE_INTRUMENTATION__`\n if (typeof window !== 'undefined' && typeof window['__PROMISE_INSTRUMENTATION__'] === 'object') {\n var callbacks = window['__PROMISE_INSTRUMENTATION__'];\n _rsvpConfig.configure('instrument', true);\n for (var eventName in callbacks) {\n if (callbacks.hasOwnProperty(eventName)) {\n on(eventName, callbacks[eventName]);\n }\n }\n }\n\n exports.cast = cast;\n exports.Promise = _rsvpPromise.default;\n exports.EventTarget = _rsvpEvents.default;\n exports.all = _rsvpAll.default;\n exports.allSettled = _rsvpAllSettled.default;\n exports.race = _rsvpRace.default;\n exports.hash = _rsvpHash.default;\n exports.hashSettled = _rsvpHashSettled.default;\n exports.rethrow = _rsvpRethrow.default;\n exports.defer = _rsvpDefer.default;\n exports.denodeify = _rsvpNode.default;\n exports.configure = _rsvpConfig.configure;\n exports.on = on;\n exports.off = off;\n exports.resolve = _rsvpResolve.default;\n exports.reject = _rsvpReject.default;\n exports.async = async;\n exports.map = _rsvpMap.default;\n exports.filter = _rsvpFilter.default;\n});\nenifed('rsvp.umd', ['exports', 'rsvp/platform', 'rsvp'], function (exports, _rsvpPlatform, _rsvp) {\n 'use strict';\n\n var RSVP = {\n 'race': _rsvp.race,\n 'Promise': _rsvp.Promise,\n 'allSettled': _rsvp.allSettled,\n 'hash': _rsvp.hash,\n 'hashSettled': _rsvp.hashSettled,\n 'denodeify': _rsvp.denodeify,\n 'on': _rsvp.on,\n 'off': _rsvp.off,\n 'map': _rsvp.map,\n 'filter': _rsvp.filter,\n 'resolve': _rsvp.resolve,\n 'reject': _rsvp.reject,\n 'all': _rsvp.all,\n 'rethrow': _rsvp.rethrow,\n 'defer': _rsvp.defer,\n 'EventTarget': _rsvp.EventTarget,\n 'configure': _rsvp.configure,\n 'async': _rsvp.async\n };\n\n /* global define:true module:true window: true */\n if (typeof define === 'function' && define['amd']) {\n define(function () {\n return RSVP;\n });\n } else if (typeof module !== 'undefined' && module['exports']) {\n module['exports'] = RSVP;\n } else if (typeof _rsvpPlatform.default !== 'undefined') {\n _rsvpPlatform.default['RSVP'] = RSVP;\n }\n});\nenifed(\"vertex\", [\"exports\"], function (exports) {\n /**\n * DAG Vertex\n *\n * @class Vertex\n * @constructor\n */\n\n \"use strict\";\n\n exports.default = Vertex;\n\n function Vertex(name) {\n this.name = name;\n this.incoming = {};\n this.incomingNames = [];\n this.hasOutgoing = false;\n this.value = null;\n }\n});\nenifed(\"visit\", [\"exports\"], function (exports) {\n \"use strict\";\n\n exports.default = visit;\n\n function visit(vertex, fn, visited, path) {\n var name = vertex.name;\n var vertices = vertex.incoming;\n var names = vertex.incomingNames;\n var len = names.length;\n var i;\n\n if (!visited) {\n visited = {};\n }\n if (!path) {\n path = [];\n }\n if (visited.hasOwnProperty(name)) {\n return;\n }\n path.push(name);\n visited[name] = true;\n for (i = 0; i < len; i++) {\n visit(vertices[names[i]], fn, visited, path);\n }\n fn(vertex, path);\n path.pop();\n }\n});\nrequireModule(\"ember\");\n\n}());\n","(function() {\n/* globals define, Ember, jQuery */\n\n function processEmberShims() {\n var shims = {\n 'ember': {\n 'default': Ember\n },\n 'ember-application': {\n 'default': Ember.Application\n },\n 'ember-array': {\n 'default': Ember.Array\n },\n 'ember-array/mutable': {\n 'default': Ember.MutableArray\n },\n 'ember-array/utils': {\n 'A': Ember.A,\n 'isEmberArray': Ember.isArray,\n 'wrap': Ember.makeArray\n },\n 'ember-component': {\n 'default': Ember.Component\n },\n 'ember-components/checkbox': {\n 'default': Ember.Checkbox\n },\n 'ember-components/text-area': {\n 'default': Ember.TextArea\n },\n 'ember-components/text-field': {\n 'default': Ember.TextField\n },\n 'ember-controller': {\n 'default': Ember.Controller\n },\n 'ember-controller/inject': {\n 'default': Ember.inject.controller\n },\n 'ember-controller/proxy': {\n 'default': Ember.ArrayProxy\n },\n 'ember-controllers/sortable': {\n 'default': Ember.SortableMixin\n },\n 'ember-debug': {\n 'log': Ember.debug,\n 'inspect': Ember.inspect,\n 'run': Ember.runInDebug,\n 'warn': Ember.warn\n },\n 'ember-debug/container-debug-adapter': {\n 'default': Ember.ContainerDebugAdapter\n },\n 'ember-debug/data-adapter': {\n 'default': Ember.DataAdapter\n },\n 'ember-deprecations': {\n 'deprecate': Ember.deprecate,\n 'deprecateFunc': Ember.deprecateFunc\n },\n 'ember-enumerable': {\n 'default': Ember.Enumerable\n },\n 'ember-evented': {\n 'default': Ember.Evented\n },\n 'ember-evented/on': {\n 'default': Ember.on\n },\n 'ember-globals-resolver': {\n 'default': Ember.DefaultResolver\n },\n 'ember-helper': {\n 'default': Ember.Helper,\n 'helper': Ember.Helper && Ember.Helper.helper\n },\n 'ember-instrumentation': {\n 'instrument': Ember.Instrumentation.instrument,\n 'reset': Ember.Instrumentation.reset,\n 'subscribe': Ember.Instrumentation.subscribe,\n 'unsubscribe': Ember.Instrumentation.unsubscribe\n },\n 'ember-locations/hash': {\n 'default': Ember.HashLocation\n },\n 'ember-locations/history': {\n 'default': Ember.HistoryLocation\n },\n 'ember-locations/none': {\n 'default': Ember.NoneLocation\n },\n 'ember-map': {\n 'default': Ember.Map,\n 'withDefault': Ember.MapWithDefault\n },\n 'ember-metal/destroy': {\n 'default': Ember.destroy\n },\n 'ember-metal/events': {\n 'addListener': Ember.addListener,\n 'removeListener': Ember.removeListener,\n 'send': Ember.sendEvent\n },\n 'ember-metal/get': {\n 'default': Ember.get,\n 'getProperties': Ember.getProperties\n },\n 'ember-metal/mixin': {\n 'default': Ember.Mixin\n },\n 'ember-metal/observer': {\n 'default': Ember.observer,\n 'addObserver': Ember.addObserver,\n 'removeObserver': Ember.removeObserver\n },\n 'ember-metal/on-load': {\n 'default': Ember.onLoad,\n 'run': Ember.runLoadHooks\n },\n 'ember-metal/set': {\n 'default': Ember.set,\n 'setProperties': Ember.setProperties,\n 'trySet': Ember.trySet\n },\n 'ember-metal/utils': {\n 'aliasMethod': Ember.aliasMethod,\n 'assert': Ember.assert,\n 'cacheFor': Ember.cacheFor,\n 'copy': Ember.copy,\n 'guidFor': Ember.guidFor\n },\n 'ember-object': {\n 'default': Ember.Object\n },\n 'ember-platform': {\n 'assign': Ember.merge,\n 'create': Ember.create,\n 'defineProperty': Ember.platform.defineProperty,\n 'hasAccessors': Ember.platform.hasPropertyAccessors,\n 'keys': Ember.keys\n },\n 'ember-route': {\n 'default': Ember.Route\n },\n 'ember-router': {\n 'default': Ember.Router\n },\n 'ember-runloop': {\n 'default': Ember.run,\n 'begin': Ember.run.begin,\n 'bind': Ember.run.bind,\n 'cancel': Ember.run.cancel,\n 'debounce': Ember.run.debounce,\n 'end': Ember.run.end,\n 'join': Ember.run.join,\n 'later': Ember.run.later,\n 'next': Ember.run.next,\n 'once': Ember.run.once,\n 'schedule': Ember.run.schedule,\n 'scheduleOnce': Ember.run.scheduleOnce,\n 'throttle': Ember.run.throttle\n },\n 'ember-service': {\n 'default': Ember.Service\n },\n 'ember-service/inject': {\n 'default': Ember.inject.service\n },\n 'ember-set/ordered': {\n 'default': Ember.OrderedSet\n },\n 'ember-string': {\n 'camelize': Ember.String.camelize,\n 'capitalize': Ember.String.capitalize,\n 'classify': Ember.String.classify,\n 'dasherize': Ember.String.dasherize,\n 'decamelize': Ember.String.decamelize,\n 'fmt': Ember.String.fmt,\n 'htmlSafe': Ember.String.htmlSafe,\n 'loc': Ember.String.loc,\n 'underscore': Ember.String.underscore,\n 'w': Ember.String.w\n },\n 'ember-utils': {\n 'isBlank': Ember.isBlank,\n 'isEmpty': Ember.isEmpty,\n 'isNone': Ember.isNone,\n 'isPresent': Ember.isPresent,\n 'tryInvoke': Ember.tryInvoke,\n 'typeOf': Ember.typeOf\n }\n };\n\n // populate `ember/computed` named exports\n shims['ember-computed'] = {\n 'default': Ember.computed\n };\n var computedMacros = [\n \"empty\",\"notEmpty\", \"none\", \"not\", \"bool\", \"match\",\n \"equal\", \"gt\", \"gte\", \"lt\", \"lte\", \"alias\", \"oneWay\",\n \"reads\", \"readOnly\", \"deprecatingAlias\",\n \"and\", \"or\", \"collect\", \"sum\", \"min\", \"max\",\n \"map\", \"sort\", \"setDiff\", \"mapBy\", \"mapProperty\",\n \"filter\", \"filterBy\", \"filterProperty\", \"uniq\",\n \"union\", \"intersect\"\n ];\n for (var i = 0, l = computedMacros.length; i < l; i++) {\n var key = computedMacros[i];\n shims['ember-computed'][key] = Ember.computed[key];\n }\n\n for (var moduleName in shims) {\n generateModule(moduleName, shims[moduleName]);\n }\n }\n\n function processTestShims() {\n if (Ember.Test) {\n var testShims = {\n 'ember-test': {\n 'default': Ember.Test\n },\n 'ember-test/adapter': {\n 'default': Ember.Test.Adapter\n },\n 'ember-test/qunit-adapter': {\n 'default': Ember.Test.QUnitAdapter\n }\n };\n\n for (var moduleName in testShims) {\n generateModule(moduleName, testShims[moduleName]);\n }\n }\n }\n\n function generateModule(name, values) {\n define(name, [], function() {\n 'use strict';\n\n return values;\n });\n }\n\n processEmberShims();\n processTestShims();\n generateModule('jquery', { 'default': self.jQuery });\n generateModule('rsvp', { 'default': Ember.RSVP });\n})();\n","/*!\n * modernizr v3.0.0-alpha.3\n * Build http://v3.modernizr.com/download/#-adownload-ambientlight-animation-apng-appearance-applicationcache-audio-audioloop-audiopreload-backgroundblendmode-backgroundcliptext-backgroundsize-batteryapi-beacon-bgpositionshorthand-bgpositionxy-bgrepeatspace_bgrepeatround-bgsizecover-blobconstructor-bloburls-blobworkers-borderimage-borderradius-boxshadow-boxsizing-canvas-canvasblending-canvastext-canvaswinding-capture-checked-classlist-contains-contenteditable-contextmenu-cookies-cors-createelementattrs_createelement_attrs-cssall-cssanimations-csscalc-csschunit-csscolumns-cssescape-cssexunit-cssfilters-cssgradients-csshyphens_softhyphens_softhyphensfind-cssinvalid-cssmask-csspointerevents-csspositionsticky-csspseudoanimations-csspseudotransitions-cssreflections-cssremunit-cssresize-cssscrollbar-csstransforms-csstransforms3d-csstransitions-cssvalid-cssvhunit-cssvmaxunit-cubicbezierrange-customevent-customprotocolhandler-dart-datachannel-datalistelem-dataset-datauri-dataview-dataworkers-details-devicemotion_deviceorientation-directory-display_runin-displaytable-documentfragment-draganddrop-ellipsis-emoji-es5-es5array-es5date-es5function-es5object-es5string-es5syntax-es5undefined-es6array-es6math-es6number-es6object-es6string-eventlistener-eventsource-exiforientation-fileinput-filereader-filesystem-flash-flexbox-flexboxlegacy-flexboxtweener-flexwrap-fontface-formattribute-formvalidation-framed-fullscreen-gamepads-generatedcontent-generators-geolocation-getrandomvalues-getusermedia-hashchange-hidden-hiddenscroll-history-hsla-htmlimports-ie8compat-indexeddb-indexeddbblob-inlinesvg-input-inputformaction-inputformenctype-inputformmethod-inputformtarget-inputtypes-intl-jpegxr-json-lastchild-localizednumber-localstorage-lowbandwidth-lowbattery-mathml-mediaqueries-microdata-multiplebgs-mutationobserver-notification-nthchild-objectfit-olreversed-oninput-opacity-outputelem-overflowscrolling-pagevisibility-peerconnection-performance-picture-placeholder-pointerevents-pointerlock-postmessage-preserve3d-progressbar_meter-promises-proximity-queryselector-quotamanagement-regions-requestanimationframe-requestautocomplete-rgba-ruby-sandbox-scriptasync-scriptdefer-seamless-search-serviceworker-sessionstorage-shapes-sharedworkers-siblinggeneral-sizes-smil-speechrecognition-speechsynthesis-srcdoc-srcset-strictmode-stylescoped-subpixelfont-supports-svg-svgasimg-svgclippaths-svgfilters-svgforeignobject-target-template-templatestrings-textalignlast-textareamaxlength-textshadow-texttrackapi_track-time-todataurljpeg_todataurlpng_todataurlwebp-touchevents-transferables-typedarrays-unicode-unicoderange-unknownelements-urlparser-userdata-userselect-vibrate-video-videoautoplay-videoloop-videopreload-vml-webaudio-webgl-webglextensions-webintents-webp-webpalpha-webpanimation-webplossless_webp_lossless-websockets-websocketsbinary-websqldatabase-webworkers-willchange-wrapflow-xhr2-xhrresponsetype-xhrresponsetypearraybuffer-xhrresponsetypeblob-xhrresponsetypedocument-xhrresponsetypejson-xhrresponsetypetext-addtest-domprefixes-hasevent-load-mq-prefixed-prefixedcss-prefixes-printshiv-testallprops-testprop-teststyles-dontmin\n *\n * Copyright (c)\n * Faruk Ates\n * Paul Irish\n * Alex Sexton\n * Ryan Seddon\n * Alexander Farkas\n * Patrick Kettner\n * Stu Cox\n * Richard Herrera\n\n * MIT License\n */\n\n/*\n * Modernizr tests which native CSS3 and HTML5 features are available in the\n * current UA and makes the results available to you in two ways: as properties on\n * a global `Modernizr` object, and as classes on the `` element. This\n * information allows you to progressively enhance your pages with a granular level\n * of control over the experience.\n*/\n\n;(function(window, document, undefined){\n var classes = [];\n\n\n // Take the html5 variable out of the\n // html5shiv scope so we can return it.\n var html5;\n\n /**\n * @preserve HTML5 Shiv 3.7.2 | @afarkas @jdalton @jon_neal @rem | MIT/GPL2 Licensed\n */\n ;(function(window, document) {\n /*jshint evil:true */\n /** version */\n var version = '3.7.2';\n\n /** Preset options */\n var options = window.html5 || {};\n\n /** Used to skip problem elements */\n var reSkip = /^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i;\n\n /** Not all elements can be cloned in IE **/\n var saveClones = /^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i;\n\n /** Detect whether the browser supports default html5 styles */\n var supportsHtml5Styles;\n\n /** Name of the expando, to work with multiple documents or to re-shiv one document */\n var expando = '_html5shiv';\n\n /** The id for the the documents expando */\n var expanID = 0;\n\n /** Cached data for each document */\n var expandoData = {};\n\n /** Detect whether the browser supports unknown elements */\n var supportsUnknownElements;\n\n (function() {\n try {\n var a = document.createElement('a');\n a.innerHTML = '';\n //if the hidden property is implemented we can assume, that the browser supports basic HTML5 Styles\n supportsHtml5Styles = ('hidden' in a);\n\n supportsUnknownElements = a.childNodes.length == 1 || (function() {\n // assign a false positive if unable to shiv\n (document.createElement)('a');\n var frag = document.createDocumentFragment();\n return (\n typeof frag.cloneNode == 'undefined' ||\n typeof frag.createDocumentFragment == 'undefined' ||\n typeof frag.createElement == 'undefined'\n );\n }());\n } catch(e) {\n // assign a false positive if detection fails => unable to shiv\n supportsHtml5Styles = true;\n supportsUnknownElements = true;\n }\n\n }());\n\n /*--------------------------------------------------------------------------*/\n\n /**\n * Creates a style sheet with the given CSS text and adds it to the document.\n * @private\n * @param {Document} ownerDocument The document.\n * @param {String} cssText The CSS text.\n * @returns {StyleSheet} The style element.\n */\n function addStyleSheet(ownerDocument, cssText) {\n var p = ownerDocument.createElement('p'),\n parent = ownerDocument.getElementsByTagName('head')[0] || ownerDocument.documentElement;\n\n p.innerHTML = 'x';\n return parent.insertBefore(p.lastChild, parent.firstChild);\n }\n\n /**\n * Returns the value of `html5.elements` as an array.\n * @private\n * @returns {Array} An array of shived element node names.\n */\n function getElements() {\n var elements = html5.elements;\n return typeof elements == 'string' ? elements.split(' ') : elements;\n }\n\n /**\n * Extends the built-in list of html5 elements\n * @memberOf html5\n * @param {String|Array} newElements whitespace separated list or array of new element names to shiv\n * @param {Document} ownerDocument The context document.\n */\n function addElements(newElements, ownerDocument) {\n var elements = html5.elements;\n if(typeof elements != 'string'){\n elements = elements.join(' ');\n }\n if(typeof newElements != 'string'){\n newElements = newElements.join(' ');\n }\n html5.elements = elements +' '+ newElements;\n shivDocument(ownerDocument);\n }\n\n /**\n * Returns the data associated to the given document\n * @private\n * @param {Document} ownerDocument The document.\n * @returns {Object} An object of data.\n */\n function getExpandoData(ownerDocument) {\n var data = expandoData[ownerDocument[expando]];\n if (!data) {\n data = {};\n expanID++;\n ownerDocument[expando] = expanID;\n expandoData[expanID] = data;\n }\n return data;\n }\n\n /**\n * returns a shived element for the given nodeName and document\n * @memberOf html5\n * @param {String} nodeName name of the element\n * @param {Document} ownerDocument The context document.\n * @returns {Object} The shived element.\n */\n function createElement(nodeName, ownerDocument, data){\n if (!ownerDocument) {\n ownerDocument = document;\n }\n if(supportsUnknownElements){\n return ownerDocument.createElement(nodeName);\n }\n if (!data) {\n data = getExpandoData(ownerDocument);\n }\n var node;\n\n if (data.cache[nodeName]) {\n node = data.cache[nodeName].cloneNode();\n } else if (saveClones.test(nodeName)) {\n node = (data.cache[nodeName] = data.createElem(nodeName)).cloneNode();\n } else {\n node = data.createElem(nodeName);\n }\n\n // Avoid adding some elements to fragments in IE < 9 because\n // * Attributes like `name` or `type` cannot be set/changed once an element\n // is inserted into a document/fragment\n // * Link elements with `src` attributes that are inaccessible, as with\n // a 403 response, will cause the tab/window to crash\n // * Script elements appended to fragments will execute when their `src`\n // or `text` property is set\n return node.canHaveChildren && !reSkip.test(nodeName) && !node.tagUrn ? data.frag.appendChild(node) : node;\n }\n\n /**\n * returns a shived DocumentFragment for the given document\n * @memberOf html5\n * @param {Document} ownerDocument The context document.\n * @returns {Object} The shived DocumentFragment.\n */\n function createDocumentFragment(ownerDocument, data){\n if (!ownerDocument) {\n ownerDocument = document;\n }\n if(supportsUnknownElements){\n return ownerDocument.createDocumentFragment();\n }\n data = data || getExpandoData(ownerDocument);\n var clone = data.frag.cloneNode(),\n i = 0,\n elems = getElements(),\n l = elems.length;\n for(;i+~])(' + getElements().join('|') + ')(?=[[\\\\s,>+~#.:]|$)', 'gi'),\n replacement = '$1' + shivNamespace + '\\\\:$2';\n\n while (index--) {\n pair = parts[index] = parts[index].split('}');\n pair[pair.length - 1] = pair[pair.length - 1].replace(reElements, replacement);\n parts[index] = pair.join('}');\n }\n return parts.join('{');\n }\n\n /**\n * Removes the given wrappers, leaving the original elements.\n * @private\n * @params {Array} wrappers An array of printable wrappers.\n */\n function removeWrappers(wrappers) {\n var index = wrappers.length;\n while (index--) {\n wrappers[index].removeNode();\n }\n }\n\n /*--------------------------------------------------------------------------*/\n\n /**\n * Shivs the given document for print.\n * @memberOf html5\n * @param {Document} ownerDocument The document to shiv.\n * @returns {Document} The shived document.\n */\n function shivPrint(ownerDocument) {\n var shivedSheet,\n wrappers,\n data = getExpandoData(ownerDocument),\n namespaces = ownerDocument.namespaces,\n ownerWindow = ownerDocument.parentWindow;\n\n if (!supportsShivableSheets || ownerDocument.printShived) {\n return ownerDocument;\n }\n if (typeof namespaces[shivNamespace] == 'undefined') {\n namespaces.add(shivNamespace);\n }\n\n function removeSheet() {\n clearTimeout(data._removeSheetTimer);\n if (shivedSheet) {\n shivedSheet.removeNode(true);\n }\n shivedSheet= null;\n }\n\n ownerWindow.attachEvent('onbeforeprint', function() {\n\n removeSheet();\n\n var imports,\n length,\n sheet,\n collection = ownerDocument.styleSheets,\n cssText = [],\n index = collection.length,\n sheets = Array(index);\n\n // convert styleSheets collection to an array\n while (index--) {\n sheets[index] = collection[index];\n }\n // concat all style sheet CSS text\n while ((sheet = sheets.pop())) {\n // IE does not enforce a same origin policy for external style sheets...\n // but has trouble with some dynamically created stylesheets\n if (!sheet.disabled && reMedia.test(sheet.media)) {\n\n try {\n imports = sheet.imports;\n length = imports.length;\n } catch(er){\n length = 0;\n }\n\n for (index = 0; index < length; index++) {\n sheets.push(imports[index]);\n }\n\n try {\n cssText.push(sheet.cssText);\n } catch(er){}\n }\n }\n\n // wrap all HTML5 elements with printable elements and add the shived style sheet\n cssText = shivCssText(cssText.reverse().join(''));\n wrappers = addWrappers(ownerDocument);\n shivedSheet = addStyleSheet(ownerDocument, cssText);\n\n });\n\n ownerWindow.attachEvent('onafterprint', function() {\n // remove wrappers, leaving the original elements, and remove the shived style sheet\n removeWrappers(wrappers);\n clearTimeout(data._removeSheetTimer);\n data._removeSheetTimer = setTimeout(removeSheet, 500);\n });\n\n ownerDocument.printShived = true;\n return ownerDocument;\n }\n\n /*--------------------------------------------------------------------------*/\n\n // expose API\n html5.type += ' print';\n html5.shivPrint = shivPrint;\n\n // shiv for print\n shivPrint(document);\n\n }(this, document));\n\n\n\n var tests = [];\n\n\n var ModernizrProto = {\n // The current version, dummy\n _version: '3.0.0-alpha.3',\n\n // Any settings that don't work as separate modules\n // can go in here as configuration.\n _config: {\n 'classPrefix' : '',\n 'enableClasses' : true,\n 'enableJSClass' : true,\n 'usePrefixes' : true\n },\n\n // Queue of tests\n _q: [],\n\n // Stub these for people who are listening\n on: function( test, cb ) {\n // I don't really think people should do this, but we can\n // safe guard it a bit.\n // -- NOTE:: this gets WAY overridden in src/addTest for\n // actual async tests. This is in case people listen to\n // synchronous tests. I would leave it out, but the code\n // to *disallow* sync tests in the real version of this\n // function is actually larger than this.\n var self = this;\n setTimeout(function() {\n cb(self[test]);\n }, 0);\n },\n\n addTest: function( name, fn, options ) {\n tests.push({name : name, fn : fn, options : options });\n },\n\n addAsyncTest: function (fn) {\n tests.push({name : null, fn : fn});\n }\n };\n\n\n\n // Fake some of Object.create\n // so we can force non test results\n // to be non \"own\" properties.\n var Modernizr = function(){};\n Modernizr.prototype = ModernizrProto;\n\n // Leak modernizr globally when you `require` it\n // rather than force it here.\n // Overwrite name so constructor name is nicer :D\n Modernizr = new Modernizr();\n\n\n/*!\n{\n \"name\": \"Application Cache\",\n \"property\": \"applicationcache\",\n \"caniuse\": \"offline-apps\",\n \"tags\": [\"storage\", \"offline\"],\n \"notes\": [{\n \"name\": \"MDN documentation\",\n \"href\": \"https://developer.mozilla.org/en/docs/HTML/Using_the_application_cache\"\n }],\n \"polyfills\": [\"html5gears\"]\n}\n!*/\n/* DOC\nDetects support for the Application Cache, for storing data to enable web-based applications run offline.\n\nThe API has been [heavily criticized](http://alistapart.com/article/application-cache-is-a-douchebag) and discussions are underway to address this.\n*/\n\n Modernizr.addTest('applicationcache', 'applicationCache' in window);\n\n/*!\n{\n \"name\": \"Beacon API\",\n \"notes\": [{\n \"name\": \"MDN documentation\",\n \"href\": \"https://developer.mozilla.org/en-US/docs/Web/API/navigator.sendBeacon\"\n },{\n \"name\": \"W3C specification\",\n \"href\": \"https://dvcs.w3.org/hg/webperf/raw-file/tip/specs/Beacon/Overview.html\"\n }],\n \"property\": \"beacon\",\n \"tags\": [\"beacon\", \"network\"],\n \"authors\": [\"Cătălin Mariș\"]\n}\n!*/\n/* DOC\nDetects support for an API that allows for asynchronous transfer of small HTTP data from the client to a server.\n*/\n\n Modernizr.addTest('beacon', 'sendBeacon' in navigator);\n\n/*!\n{\n \"name\": \"Binary WebSockets\",\n \"property\": \"websocketsbinary\",\n \"tags\": [\"websockets\"],\n \"builderAliases\": [\"websockets_binary\"]\n}\n!*/\n\n // binaryType is truthy if there is support.. returns \"blob\" in new-ish chrome.\n // plus.google.com/115535723976198353696/posts/ERN6zYozENV\n // github.com/Modernizr/Modernizr/issues/370\n\n Modernizr.addTest('websocketsbinary', function() {\n var protocol = 'https:'==location.protocol?'wss':'ws',\n protoBin;\n\n if('WebSocket' in window) {\n if( protoBin = 'binaryType' in WebSocket.prototype ) {\n return protoBin;\n }\n try {\n return !!(new WebSocket(protocol+'://.').binaryType);\n } catch (e){}\n }\n\n return false;\n });\n\n/*!\n{\n \"name\": \"Blob constructor\",\n \"property\": \"blobconstructor\",\n \"aliases\": [\"blob-constructor\"],\n \"builderAliases\": [\"blob_constructor\"],\n \"caniuse\": \"blobbuilder\",\n \"notes\": [{\n \"name\": \"W3C spec\",\n \"href\": \"http://dev.w3.org/2006/webapi/FileAPI/#constructorBlob\"\n }],\n \"polyfills\": [\"blobjs\"]\n}\n!*/\n/* DOC\nDetects support for the Blob constructor, for creating file-like objects of immutable, raw data.\n*/\n\n Modernizr.addTest('blobconstructor', function () {\n try {\n return !!new Blob();\n } catch (e) {\n return false;\n }\n }, {\n aliases: ['blob-constructor']\n });\n\n/*!\n{\n \"name\": \"Cross-Origin Resource Sharing\",\n \"property\": \"cors\",\n \"caniuse\": \"cors\",\n \"authors\": [\"Theodoor van Donge\"],\n \"notes\": [{\n \"name\": \"MDN documentation\",\n \"href\": \"https://developer.mozilla.org/en-US/docs/HTTP/Access_control_CORS\"\n }],\n \"polyfills\": [\"pmxdr\", \"ppx\", \"flxhr\"]\n}\n!*/\n/* DOC\nDetects support for Cross-Origin Resource Sharing: method of performing XMLHttpRequests across domains.\n*/\n\n Modernizr.addTest('cors', 'XMLHttpRequest' in window && 'withCredentials' in new XMLHttpRequest());\n\n/*!\n{\n \"name\": \"CSS :target pseudo-class\",\n \"caniuse\": \"css-sel3\",\n \"property\": \"target\",\n \"tags\": [\"css\"],\n \"notes\": [{\n \"name\": \"MDN documentation\",\n \"href\": \"https://developer.mozilla.org/en-US/docs/Web/CSS/:target\"\n }],\n \"authors\": [\"@zachleat\"],\n \"warnings\": [\"Opera Mini supports :target but doesn't update the hash for anchor links.\"]\n}\n!*/\n/* DOC\nDetects support for the ':target' CSS pseudo-class.\n*/\n\n // querySelector\n Modernizr.addTest('target', function() {\n var doc = window.document;\n if(!('querySelectorAll' in doc) ) {\n return false;\n }\n\n try {\n doc.querySelectorAll(':target');\n return true;\n } catch(e) {\n return false;\n }\n });\n\n/*!\n{\n \"name\": \"Cookies\",\n \"property\": \"cookies\",\n \"tags\": [\"storage\"],\n \"authors\": [\"tauren\"]\n}\n!*/\n/* DOC\nDetects whether cookie support is enabled.\n*/\n\n // https://github.com/Modernizr/Modernizr/issues/191\n\n Modernizr.addTest('cookies', function () {\n // navigator.cookieEnabled cannot detect custom or nuanced cookie blocking\n // configurations. For example, when blocking cookies via the Advanced\n // Privacy Settings in IE9, it always returns true. And there have been\n // issues in the past with site-specific exceptions.\n // Don't rely on it.\n\n // try..catch because some in situations `document.cookie` is exposed but throws a\n // SecurityError if you try to access it; e.g. documents created from data URIs\n // or in sandboxed iframes (depending on flags/context)\n try {\n // Create cookie\n document.cookie = 'cookietest=1';\n var ret = document.cookie.indexOf('cookietest=') != -1;\n // Delete cookie\n document.cookie = 'cookietest=1; expires=Thu, 01-Jan-1970 00:00:01 GMT';\n return ret;\n }\n catch (e) {\n return false;\n }\n });\n\n/*!\n{\n \"name\": \"CSS Supports\",\n \"property\": \"supports\",\n \"caniuse\": \"css-featurequeries\",\n \"tags\": [\"css\"],\n \"builderAliases\": [\"css_supports\"],\n \"notes\": [{\n \"name\": \"W3 Spec\",\n \"href\": \"http://dev.w3.org/csswg/css3-conditional/#at-supports\"\n },{\n \"name\": \"Related Github Issue\",\n \"href\": \"github.com/Modernizr/Modernizr/issues/648\"\n },{\n \"name\": \"W3 Info\",\n \"href\": \"http://dev.w3.org/csswg/css3-conditional/#the-csssupportsrule-interface\"\n }]\n}\n!*/\n\n var newSyntax = 'CSS' in window && 'supports' in window.CSS;\n var oldSyntax = 'supportsCSS' in window;\n Modernizr.addTest('supports', newSyntax || oldSyntax);\n\n/*!\n{\n \"name\": \"CSS.escape()\",\n \"property\": \"cssescape\",\n \"polyfills\": [\n \"css-escape\"\n ],\n \"tags\": [\n \"css\",\n \"cssom\"\n ]\n}\n!*/\n/* DOC\nTests for `CSS.escape()` support.\n*/\n\n var CSS = window.CSS;\n Modernizr.addTest('cssescape', CSS ? typeof CSS.escape == 'function' : false);\n\n/*!\n{\n \"name\": \"Custom protocol handler\",\n \"property\": \"customprotocolhandler\",\n \"authors\": [\"Ben Schwarz\"],\n \"builderAliases\": [\"custom_protocol_handler\"],\n \"notes\": [{\n \"name\": \"WHATWG overview\",\n \"href\": \"http://developers.whatwg.org/timers.html#custom-handlers\"\n },{\n \"name\": \"MDN documentation\",\n \"href\": \"https://developer.mozilla.org/en-US/docs/Web/API/navigator.registerProtocolHandler\"\n }],\n \"warnings\": [],\n \"polyfills\": []\n}\n!*/\n/* DOC\nDetects support for the `window.registerProtocolHandler()` API to allow websites to register themselves as possible handlers for particular protocols.\n*/\n\n Modernizr.addTest('customprotocolhandler', function() {\n // early bailout where it doesn't exist at all\n if ( !navigator.registerProtocolHandler ) return false;\n\n // registerProtocolHandler was stubbed in webkit for a while, and didn't\n // actually do anything. We intentionally set it improperly to test for\n // the proper sort of failure\n try {\n navigator.registerProtocolHandler('thisShouldFail');\n }\n catch (e) {\n return e instanceof TypeError;\n }\n\n return false;\n });\n\n/*!\n{\n \"name\": \"CustomEvent\",\n \"property\": \"customevent\",\n \"tags\": [\"customevent\"],\n \"authors\": [\"Alberto Elias\"],\n \"notes\": [{\n \"name\": \"W3C DOM reference\",\n \"href\": \"http://www.w3.org/TR/DOM-Level-3-Events/#interface-CustomEvent\"\n }, {\n \"name\": \"MDN documentation\",\n \"href\": \"https://developer.mozilla.org/en/docs/Web/API/CustomEvent\"\n }],\n \"polyfills\": [\"eventlistener\"]\n}\n!*/\n/* DOC\n\nDetects support for CustomEvent.\n\n*/\n\n Modernizr.addTest('customevent', 'CustomEvent' in window && typeof window.CustomEvent === 'function');\n\n/*!\n{\n \"name\": \"DataView\",\n \"property\": \"dataview\",\n \"authors\": [\"Addy Osmani\"],\n \"builderAliases\": [\"dataview_api\"],\n \"notes\": [{\n \"name\": \"MDN documentation\",\n \"href\": \"https://developer.mozilla.org/en/JavaScript_typed_arrays/DataView\"\n }],\n \"polyfills\": [\"jdataview\"]\n}\n!*/\n/* DOC\nDetects support for the DataView interface for reading data from an ArrayBuffer as part of the Typed Array spec.\n*/\n\n Modernizr.addTest('dataview', (typeof DataView !== 'undefined' && 'getFloat64' in DataView.prototype));\n\n/*!\n{\n \"name\": \"Orientation and Motion Events\",\n \"property\": [\"devicemotion\", \"deviceorientation\"],\n \"caniuse\": \"deviceorientation\",\n \"notes\": [{\n \"name\": \"W3C Editor's Draft\",\n \"href\": \"http://dev.w3.org/geo/api/spec-source-orientation.html\"\n },{\n \"name\": \"Implementation by iOS Safari (Orientation)\",\n \"href\": \"http://goo.gl/fhce3\"\n },{\n \"name\": \"Implementation by iOS Safari (Motion)\",\n \"href\": \"http://goo.gl/rLKz8\"\n }],\n \"authors\": [\"Shi Chuan\"],\n \"tags\": [\"event\"],\n \"builderAliases\": [\"event_deviceorientation_motion\"]\n}\n!*/\n/* DOC\nPart of Device Access aspect of HTML5, same category as geolocation.\n\n`devicemotion` tests for Device Motion Event support, returns boolean value true/false.\n\n`deviceorientation` tests for Device Orientation Event support, returns boolean value true/false\n*/\n\n Modernizr.addTest('devicemotion', 'DeviceMotionEvent' in window);\n Modernizr.addTest('deviceorientation', 'DeviceOrientationEvent' in window);\n\n/*!\n{\n \"name\": \"DOM4 MutationObserver\",\n \"property\": \"mutationobserver\",\n \"caniuse\": \"mutationobserver\",\n \"tags\": [\"dom\"],\n \"authors\": [\"Karel Sedláček (@ksdlck)\"],\n \"polyfills\": [\"mutationobservers\"],\n \"notes\": [{\n \"name\": \"MDN documentation\",\n \"href\": \"https://developer.mozilla.org/en-US/docs/Web/API/MutationObserver\"\n }]\n}\n!*/\n/* DOC\n\nDetermines if DOM4 MutationObserver support is available.\n\n*/\n\n Modernizr.addTest('mutationobserver',\n !!window.MutationObserver || !!window.WebKitMutationObserver);\n\n/*!\n{\n \"name\": \"ES5 Date\",\n \"property\": \"es5date\",\n \"notes\": [{\n \"name\": \"ECMAScript 5.1 Language Specification\",\n \"href\": \"http://www.ecma-international.org/ecma-262/5.1/\"\n }],\n \"polyfills\": [\"es5shim\"],\n \"authors\": [\"Ron Waldon (@jokeyrhyme)\"],\n \"tags\": [\"es5\"]\n}\n!*/\n/* DOC\nCheck if browser implements ECMAScript 5 Date per specification.\n*/\n\n Modernizr.addTest('es5date', function () {\n var isoDate = '2013-04-12T06:06:37.307Z',\n canParseISODate = false;\n try {\n canParseISODate = !!Date.parse(isoDate);\n } catch (e) {\n // no ISO date parsing yet\n }\n return !!(Date.now &&\n Date.prototype &&\n Date.prototype.toISOString &&\n Date.prototype.toJSON &&\n canParseISODate);\n });\n\n/*!\n{\n \"name\": \"ES5 Function\",\n \"property\": \"es5function\",\n \"notes\": [{\n \"name\": \"ECMAScript 5.1 Language Specification\",\n \"href\": \"http://www.ecma-international.org/ecma-262/5.1/\"\n }],\n \"polyfills\": [\"es5shim\"],\n \"authors\": [\"Ron Waldon (@jokeyrhyme)\"],\n \"tags\": [\"es5\"]\n}\n!*/\n/* DOC\nCheck if browser implements ECMAScript 5 Function per specification.\n*/\n\n Modernizr.addTest('es5function', function () {\n return !!(Function.prototype && Function.prototype.bind);\n });\n\n/*!\n{\n \"name\": \"ES5 Array\",\n \"property\": \"es5array\",\n \"notes\": [{\n \"name\": \"ECMAScript 5.1 Language Specification\",\n \"href\": \"http://www.ecma-international.org/ecma-262/5.1/\"\n }],\n \"polyfills\": [\"es5shim\"],\n \"authors\": [\"Ron Waldon (@jokeyrhyme)\"],\n \"tags\": [\"es5\"]\n}\n!*/\n/* DOC\nCheck if browser implements ECMAScript 5 Array per specification.\n*/\n\n Modernizr.addTest('es5array', function () {\n return !!(Array.prototype &&\n Array.prototype.every &&\n Array.prototype.filter &&\n Array.prototype.forEach &&\n Array.prototype.indexOf &&\n Array.prototype.lastIndexOf &&\n Array.prototype.map &&\n Array.prototype.some &&\n Array.prototype.reduce &&\n Array.prototype.reduceRight &&\n Array.isArray);\n });\n\n/*!\n{\n \"name\": \"ES5 Object\",\n \"property\": \"es5object\",\n \"notes\": [{\n \"name\": \"ECMAScript 5.1 Language Specification\",\n \"href\": \"http://www.ecma-international.org/ecma-262/5.1/\"\n }],\n \"polyfills\": [\"es5shim\", \"es5sham\"],\n \"authors\": [\"Ron Waldon (@jokeyrhyme)\"],\n \"tags\": [\"es5\"]\n}\n!*/\n/* DOC\nCheck if browser implements ECMAScript 5 Object per specification.\n*/\n\n Modernizr.addTest('es5object', function () {\n return !!(Object.keys &&\n Object.create &&\n Object.getPrototypeOf &&\n Object.getOwnPropertyNames &&\n Object.isSealed &&\n Object.isFrozen &&\n Object.isExtensible &&\n Object.getOwnPropertyDescriptor &&\n Object.defineProperty &&\n Object.defineProperties &&\n Object.seal &&\n Object.freeze &&\n Object.preventExtensions);\n });\n\n/*!\n{\n \"name\": \"ES5 Immutable Undefined\",\n \"property\": \"es5undefined\",\n \"notes\": [{\n \"name\": \"ECMAScript 5.1 Language Specification\",\n \"href\": \"http://www.ecma-international.org/ecma-262/5.1/\"\n }, {\n \"name\": \"original implementation of detect code\",\n \"href\": \"http://kangax.github.io/es5-compat-table/\"\n }],\n \"authors\": [\"Ron Waldon (@jokeyrhyme)\"],\n \"tags\": [\"es5\"]\n}\n!*/\n/* DOC\nCheck if browser prevents assignment to global `undefined` per ECMAScript 5.\n*/\n\n Modernizr.addTest('es5undefined', function () {\n var result, originalUndefined;\n try {\n originalUndefined = window.undefined;\n window.undefined = 12345;\n result = typeof window.undefined === 'undefined';\n window.undefined = originalUndefined;\n } catch (e) {\n return false;\n }\n return result;\n });\n\n/*!\n{\n \"name\": \"ES5 Strict Mode\",\n \"property\": \"strictmode\",\n \"caniuse\": \"sctrict-mode\",\n \"notes\": [{\n \"name\": \"ECMAScript 5.1 Language Specification\",\n \"href\": \"http://www.ecma-international.org/ecma-262/5.1/\"\n }],\n \"authors\": [\"@kangax\"],\n \"tags\": [\"es5\"],\n \"builderAliases\": [\"es5_strictmode\"]\n}\n!*/\n/* DOC\nCheck if browser implements ECMAScript 5 Object strict mode.\n*/\n\n Modernizr.addTest('strictmode', (function(){'use strict'; return !this; })());\n\n/*!\n{\n \"name\": \"ES5 Syntax\",\n \"property\": \"es5syntax\",\n \"notes\": [{\n \"name\": \"ECMAScript 5.1 Language Specification\",\n \"href\": \"http://www.ecma-international.org/ecma-262/5.1/\"\n }, {\n \"name\": \"original implementation of detect code\",\n \"href\": \"http://kangax.github.io/es5-compat-table/\"\n }],\n \"authors\": [\"Ron Waldon (@jokeyrhyme)\"],\n \"warnings\": [\"This detect uses `eval()`, so CSP may be a problem.\"],\n \"tags\": [\"es5\"]\n}\n!*/\n/* DOC\nCheck if browser accepts ECMAScript 5 syntax.\n*/\n\n Modernizr.addTest('es5syntax', function () {\n var value, obj, stringAccess, getter, setter, reservedWords, zeroWidthChars;\n try {\n // Property access on strings\n stringAccess = eval('\"foobar\"[3] === \"b\"');\n // Getter in property initializer\n getter = eval('({ get x(){ return 1 } }).x === 1');\n eval('({ set x(v){ value = v; } }).x = 1');\n // Setter in property initializer\n setter = value === 1;\n // Reserved words as property names\n eval('obj = ({ if: 1 })');\n reservedWords = obj['if'] === 1;\n // Zero-width characters in identifiers\n zeroWidthChars = eval('_\\u200c\\u200d = true');\n\n return stringAccess && getter && setter && reservedWords && zeroWidthChars;\n } catch (ignore) {\n return false;\n }\n });\n\n/*!\n{\n \"name\": \"ES5 String\",\n \"property\": \"es5string\",\n \"notes\": [{\n \"name\": \"ECMAScript 5.1 Language Specification\",\n \"href\": \"http://www.ecma-international.org/ecma-262/5.1/\"\n }],\n \"polyfills\": [\"es5shim\"],\n \"authors\": [\"Ron Waldon (@jokeyrhyme)\"],\n \"tags\": [\"es5\"]\n}\n!*/\n/* DOC\nCheck if browser implements ECMAScript 5 String per specification.\n*/\n\n Modernizr.addTest('es5string', function () {\n return !!(String.prototype && String.prototype.trim);\n });\n\n/*!\n{\n \"name\": \"ES6 Number\",\n \"property\": \"es6number\",\n \"notes\": [{\n \"name\": \"unofficial ECMAScript 6 draft specification\",\n \"href\": \"http://people.mozilla.org/~jorendorff/es6-draft.html\"\n }],\n \"polyfills\": [\"es6shim\"],\n \"authors\": [\"Ron Waldon (@jokeyrhyme)\"],\n \"warnings\": [\"ECMAScript 6 is still a only a draft, so this detect may not match the final specification or implementations.\"],\n \"tags\": [\"es6\"]\n}\n!*/\n/* DOC\nCheck if browser implements ECMAScript 6 Number per specification.\n*/\n\n Modernizr.addTest('es6number', !!(Number.isFinite &&\n Number.isInteger &&\n Number.isSafeInteger &&\n Number.isNaN &&\n Number.parseInt &&\n Number.parseFloat &&\n Number.isInteger(Number.MAX_SAFE_INTEGER) &&\n Number.isInteger(Number.MIN_SAFE_INTEGER) &&\n Number.isFinite(Number.EPSILON)));\n\n/*!\n{\n \"name\": \"ES6 Object\",\n \"property\": \"es6object\",\n \"notes\": [{\n \"name\": \"unofficial ECMAScript 6 draft specification\",\n \"href\": \"http://people.mozilla.org/~jorendorff/es6-draft.html\"\n }],\n \"polyfills\": [\"es6shim\"],\n \"authors\": [\"Ron Waldon (@jokeyrhyme)\"],\n \"warnings\": [\"ECMAScript 6 is still a only a draft, so this detect may not match the final specification or implementations.\"],\n \"tags\": [\"es6\"]\n}\n!*/\n/* DOC\nCheck if browser implements ECMAScript 6 Object per specification.\n*/\n\n Modernizr.addTest('es6object', !!(Object.assign &&\n Object.is &&\n Object.setPrototypeOf));\n\n/*!\n{\n \"name\": \"ES6 Promises\",\n \"property\": \"promises\",\n \"caniuse\": \"promises\",\n \"polyfills\": [\"es6promises\"],\n \"authors\": [\"Krister Kari\", \"Jake Archibald\"],\n \"tags\": [\"es6\"],\n \"notes\": [{\n \"name\": \"The ES6 promises spec\",\n \"href\": \"https://github.com/domenic/promises-unwrapping\"\n },{\n \"name\": \"Chromium dashboard - ES6 Promises\",\n \"href\": \"http://www.chromestatus.com/features/5681726336532480\"\n },{\n \"name\": \"JavaScript Promises: There and back again - HTML5 Rocks\",\n \"href\": \"http://www.html5rocks.com/en/tutorials/es6/promises/\"\n }]\n}\n!*/\n/* DOC\nCheck if browser implements ECMAScript 6 Promises per specification.\n*/\n\n Modernizr.addTest('promises', function() {\n return 'Promise' in window &&\n // Some of these methods are missing from\n // Firefox/Chrome experimental implementations\n 'resolve' in window.Promise &&\n 'reject' in window.Promise &&\n 'all' in window.Promise &&\n 'race' in window.Promise &&\n // Older version of the spec had a resolver object\n // as the arg rather than a function\n (function() {\n var resolve;\n new window.Promise(function(r) { resolve = r; });\n return typeof resolve === 'function';\n }());\n });\n\n/*!\n{\n \"name\": \"ES6 Generators\",\n \"property\": \"generators\",\n \"authors\": [\"Michael Kachanovskyi\"],\n \"tags\": [\"es6\"]\n}\n!*/\n/* DOC\nCheck if browser implements ECMAScript 6 Generators per specification.\n*/\n\n Modernizr.addTest('generators', function() {\n try {\n /* jshint evil: true */\n new Function('function* test() {}')();\n } catch(e) {\n return false;\n }\n return true;\n });\n\n/*!\n{\n \"name\": \"ES6 Math\",\n \"property\": \"es6math\",\n \"notes\": [{\n \"name\": \"unofficial ECMAScript 6 draft specification\",\n \"href\": \"http://people.mozilla.org/~jorendorff/es6-draft.html\"\n }],\n \"polyfills\": [\"es6shim\"],\n \"authors\": [\"Ron Waldon (@jokeyrhyme)\"],\n \"warnings\": [\"ECMAScript 6 is still a only a draft, so this detect may not match the final specification or implementations.\"],\n \"tags\": [\"es6\"]\n}\n!*/\n/* DOC\nCheck if browser implements ECMAScript 6 Math per specification.\n*/\n\n Modernizr.addTest('es6math', !!(Math &&\n Math.clz32 &&\n Math.cbrt &&\n Math.imul &&\n Math.sign &&\n Math.log10 &&\n Math.log2 &&\n Math.log1p &&\n Math.expm1 &&\n Math.cosh &&\n Math.sinh &&\n Math.tanh &&\n Math.acosh &&\n Math.asinh &&\n Math.atanh &&\n Math.hypot &&\n Math.trunc &&\n Math.fround));\n\n/*!\n{\n \"name\": \"ES6 Array\",\n \"property\": \"es6array\",\n \"notes\": [{\n \"name\": \"unofficial ECMAScript 6 draft specification\",\n \"href\": \"http://people.mozilla.org/~jorendorff/es6-draft.html\"\n }],\n \"polyfills\": [\"es6shim\"],\n \"authors\": [\"Ron Waldon (@jokeyrhyme)\"],\n \"warnings\": [\"ECMAScript 6 is still a only a draft, so this detect may not match the final specification or implementations.\"],\n \"tags\": [\"es6\"]\n}\n!*/\n/* DOC\nCheck if browser implements ECMAScript 6 Array per specification.\n*/\n\n Modernizr.addTest('es6array', !!(Array.prototype &&\n Array.prototype.copyWithin &&\n Array.prototype.fill &&\n Array.prototype.find &&\n Array.prototype.findIndex &&\n Array.prototype.keys &&\n Array.prototype.entries &&\n Array.prototype.values &&\n Array.from &&\n Array.of));\n\n/*!\n{\n \"name\": \"ES6 String\",\n \"property\": \"es6string\",\n \"notes\": [{\n \"name\": \"unofficial ECMAScript 6 draft specification\",\n \"href\": \"http://people.mozilla.org/~jorendorff/es6-draft.html\"\n }],\n \"polyfills\": [\"es6shim\"],\n \"authors\": [\"Ron Waldon (@jokeyrhyme)\"],\n \"warnings\": [\"ECMAScript 6 is still a only a draft, so this detect may not match the final specification or implementations.\"],\n \"tags\": [\"es6\"]\n}\n!*/\n/* DOC\nCheck if browser implements ECMAScript 6 String per specification.\n*/\n\n Modernizr.addTest('es6string', !!(String.fromCodePoint &&\n String.raw &&\n String.prototype.codePointAt &&\n String.prototype.repeat &&\n String.prototype.startsWith &&\n String.prototype.endsWith &&\n String.prototype.contains));\n\n/*!\n{\n \"name\": \"Event Listener\",\n \"property\": \"eventlistener\",\n \"authors\": [\"Andrew Betts (@triblondon)\"],\n \"notes\": [{\n \"name\": \"W3C Spec\",\n \"href\": \"http://www.w3.org/TR/DOM-Level-2-Events/events.html#Events-Registration-interfaces\"\n }],\n \"polyfills\": [\"eventlistener\"]\n}\n!*/\n/* DOC\nDetects native support for addEventListener\n*/\n\n Modernizr.addTest('eventlistener', 'addEventListener' in window);\n\n/*!\n{\n \"name\": \"File API\",\n \"property\": \"filereader\",\n \"caniuse\": \"fileapi\",\n \"notes\": [{\n \"name\": \"W3C Working Draft\",\n \"href\": \"http://www.w3.org/TR/FileAPI/\"\n }],\n \"tags\": [\"file\"],\n \"builderAliases\": [\"file_api\"],\n \"knownBugs\": [\"Will fail in Safari 5 due to its lack of support for the standards defined FileReader object\"]\n}\n!*/\n/* DOC\n`filereader` tests for the File API specification\n\nTests for objects specific to the File API W3C specification without\nbeing redundant (don't bother testing for Blob since it is assumed\nto be the File object's prototype.)\n*/\n\n Modernizr.addTest('filereader', !!(window.File && window.FileList && window.FileReader));\n\n/*!\n{\n \"name\": \"Framed window\",\n \"property\": \"framed\",\n \"tags\": [\"window\"],\n \"builderAliases\": [\"window_framed\"]\n}\n!*/\n/* DOC\nTests if page is iframed.\n*/\n\n // github.com/Modernizr/Modernizr/issues/242\n\n Modernizr.addTest('framed', window.location != top.location);\n\n/*!\n{\n \"name\": \"Geolocation API\",\n \"property\": \"geolocation\",\n \"caniuse\": \"geolocation\",\n \"tags\": [\"media\"],\n \"notes\": [{\n \"name\": \"MDN documentation\",\n \"href\": \"https://developer.mozilla.org/en-US/docs/WebAPI/Using_geolocation\"\n }],\n \"polyfills\": [\n \"joshuabell-polyfill\",\n \"webshims\",\n \"geo-location-javascript\",\n \"geolocation-api-polyfill\"\n ]\n}\n!*/\n/* DOC\nDetects support for the Geolocation API for users to provide their location to web applications.\n*/\n\n // geolocation is often considered a trivial feature detect...\n // Turns out, it's quite tricky to get right:\n //\n // Using !!navigator.geolocation does two things we don't want. It:\n // 1. Leaks memory in IE9: github.com/Modernizr/Modernizr/issues/513\n // 2. Disables page caching in WebKit: webk.it/43956\n //\n // Meanwhile, in Firefox < 8, an about:config setting could expose\n // a false positive that would throw an exception: bugzil.la/688158\n\n Modernizr.addTest('geolocation', 'geolocation' in navigator);\n\n/*!\n{\n \"name\": \"History API\",\n \"property\": \"history\",\n \"caniuse\": \"history\",\n \"tags\": [\"history\"],\n \"authors\": [\"Hay Kranen\", \"Alexander Farkas\"],\n \"notes\": [{\n \"name\": \"W3C Spec\",\n \"href\": \"http://www.w3.org/TR/html51/browsers.html#the-history-interface\"\n }, {\n \"name\": \"MDN documentation\",\n \"href\": \"https://developer.mozilla.org/en-US/docs/Web/API/window.history\"\n }],\n \"polyfills\": [\"historyjs\", \"html5historyapi\"]\n}\n!*/\n/* DOC\nDetects support for the History API for manipulating the browser session history.\n*/\n\n Modernizr.addTest('history', function() {\n // Issue #733\n // The stock browser on Android 2.2 & 2.3, and 4.0.x returns positive on history support\n // Unfortunately support is really buggy and there is no clean way to detect\n // these bugs, so we fall back to a user agent sniff :(\n var ua = navigator.userAgent;\n\n // We only want Android 2 and 4.0, stock browser, and not Chrome which identifies\n // itself as 'Mobile Safari' as well, nor Windows Phone (issue #1471).\n if ((ua.indexOf('Android 2.') !== -1 ||\n (ua.indexOf('Android 4.0') !== -1)) &&\n ua.indexOf('Mobile Safari') !== -1 &&\n ua.indexOf('Chrome') === -1 &&\n ua.indexOf('Windows Phone') === -1) {\n return false;\n }\n\n // Return the regular check\n return (window.history && 'pushState' in window.history);\n });\n\n/*!\n{\n \"name\": \"HTML Imports\",\n \"notes\": [\n {\n \"name\": \"W3C HTML Imports Specification\",\n \"href\": \"http://w3c.github.io/webcomponents/spec/imports/\"\n },\n {\n \"name\": \"HTML Imports - #include for the web\",\n \"href\": \"http://www.html5rocks.com/en/tutorials/webcomponents/imports/\"\n }\n ],\n \"polyfills\": [\"polymer-htmlimports\"],\n \"property\": \"htmlimports\",\n \"tags\": [\"html\", \"import\"]\n}\n!*/\n/* DOC\nDetects support for HTML import, a feature that is used for loading in Web Components.\n */\n\n\n Modernizr.addTest('htmlimports', 'import' in document.createElement('link'));\n\n/*!\n{\n \"name\": \"IE8 compat mode\",\n \"property\": \"ie8compat\",\n \"authors\": [\"Erich Ocean\"]\n}\n!*/\n/* DOC\nDetects whether or not the current browser is IE8 in compatibility mode (i.e. acting as IE7).\n*/\n\n // In this case, IE8 will be acting as IE7. You may choose to remove features in this case.\n\n // related:\n // james.padolsey.com/javascript/detect-ie-in-js-using-conditional-comments/\n\n Modernizr.addTest('ie8compat', (!window.addEventListener && !!document.documentMode && document.documentMode === 7));\n\n/*!\n{\n \"name\": \"JSON\",\n \"property\": \"json\",\n \"caniuse\": \"json\",\n \"notes\": [{\n \"name\": \"MDN documentation\",\n \"href\": \"http://developer.mozilla.org/en/JSON\"\n }],\n \"polyfills\": [\"json2\"]\n}\n!*/\n/* DOC\nDetects native support for JSON handling functions.\n*/\n\n // this will also succeed if you've loaded the JSON2.js polyfill ahead of time\n // ... but that should be obvious. :)\n\n Modernizr.addTest('json', 'JSON' in window && 'parse' in JSON && 'stringify' in JSON);\n\n/*!\n{\n \"name\": \"ES5\",\n \"property\": \"es5\",\n \"notes\": [{\n \"name\": \"ECMAScript 5.1 Language Specification\",\n \"href\": \"http://www.ecma-international.org/ecma-262/5.1/\"\n }],\n \"polyfills\": [\"es5shim\", \"es5sham\"],\n \"authors\": [\"Ron Waldon (@jokeyrhyme)\"],\n \"tags\": [\"es5\"]\n}\n!*/\n/* DOC\nCheck if browser implements everything as specified in ECMAScript 5.\n*/\n\n Modernizr.addTest('es5', function () {\n return !!(\n Modernizr.es5array &&\n Modernizr.es5date &&\n Modernizr.es5function &&\n Modernizr.es5object &&\n Modernizr.strictmode &&\n Modernizr.es5string &&\n Modernizr.json &&\n Modernizr.es5syntax &&\n Modernizr.es5undefined\n );\n });\n\n/*!\n{\n \"name\": \"Local Storage\",\n \"property\": \"localstorage\",\n \"caniuse\": \"namevalue-storage\",\n \"tags\": [\"storage\"],\n \"knownBugs\": [],\n \"notes\": [],\n \"warnings\": [],\n \"polyfills\": [\n \"joshuabell-polyfill\",\n \"cupcake\",\n \"storagepolyfill\",\n \"amplifyjs\",\n \"yui-cacheoffline\"\n ]\n}\n!*/\n\n // In FF4, if disabled, window.localStorage should === null.\n\n // Normally, we could not test that directly and need to do a\n // `('localStorage' in window) && ` test first because otherwise Firefox will\n // throw bugzil.la/365772 if cookies are disabled\n\n // Also in iOS5 Private Browsing mode, attempting to use localStorage.setItem\n // will throw the exception:\n // QUOTA_EXCEEDED_ERRROR DOM Exception 22.\n // Peculiarly, getItem and removeItem calls do not throw.\n\n // Because we are forced to try/catch this, we'll go aggressive.\n\n // Just FWIW: IE8 Compat mode supports these features completely:\n // www.quirksmode.org/dom/html5.html\n // But IE8 doesn't support either with local files\n\n Modernizr.addTest('localstorage', function() {\n var mod = 'modernizr';\n try {\n localStorage.setItem(mod, mod);\n localStorage.removeItem(mod);\n return true;\n } catch(e) {\n return false;\n }\n });\n\n/*!\n{\n \"name\": \"Low Bandwidth Connection\",\n \"property\": \"lowbandwidth\",\n \"tags\": [\"network\"],\n \"builderAliases\": [\"network_connection\"]\n}\n!*/\n/* DOC\nTests for determining low-bandwidth via `navigator.connection`\n\nThere are two iterations of the `navigator.connection` interface.\n\nThe first is present in Android 2.2+ and only in the Browser (not WebView)\n\n- http://docs.phonegap.com/en/1.2.0/phonegap_connection_connection.md.html#connection.type\n- http://davidbcalhoun.com/2010/using-navigator-connection-android\n\nThe second is specced at http://dev.w3.org/2009/dap/netinfo/ and perhaps landing in WebKit\n\n- http://bugs.webkit.org/show_bug.cgi?id=73528\n\nUnknown devices are assumed as fast\n\nFor more rigorous network testing, consider boomerang.js: http://github.com/bluesmoon/boomerang/\n*/\n\n Modernizr.addTest('lowbandwidth', function() {\n // polyfill\n var connection = navigator.connection || { type: 0 };\n\n return connection.type == 3 || // connection.CELL_2G\n connection.type == 4 || // connection.CELL_3G\n /^[23]g$/.test(connection.type); // string value in new spec\n });\n\n/*!\n{\n \"name\": \"microdata\",\n \"property\": \"microdata\",\n \"tags\": [\"dom\"],\n \"builderAliases\": [\"dom_microdata\"],\n \"notes\": [{\n \"name\": \"W3 Spec\",\n \"href\": \"http://www.w3.org/TR/html5/microdata.html\"\n }]\n}\n!*/\n\n Modernizr.addTest('microdata', 'getItems' in document);\n\n/*!\n{\n \"name\": \"Notification\",\n \"property\": \"notification\",\n \"caniuse\": \"notifications\",\n \"authors\": [\"Theodoor van Donge\", \"Hendrik Beskow\"],\n \"notes\": [{\n \"name\": \"HTML5 Rocks tutorial\",\n \"href\": \"http://www.html5rocks.com/en/tutorials/notifications/quick/\"\n },{\n \"name\": \"W3C spec\",\n \"href\": \"www.w3.org/TR/notifications/\"\n }],\n \"polyfills\": [\"desktop-notify\", \"html5-notifications\"]\n}\n!*/\n/* DOC\nDetects support for the Notifications API\n*/\n\n Modernizr.addTest('notification', 'Notification' in window && 'permission' in window.Notification && 'requestPermission' in window.Notification);\n\n/*!\n{\n \"name\": \"picture Element\",\n \"property\": \"picture\",\n \"tags\": [\"elem\"],\n \"authors\": [\"Scott Jehl\", \"Mat Marquis\"],\n \"notes\": [{\n \"name\": \"Specification\",\n \"href\": \"http://picture.responsiveimages.org\"\n },{\n \"name\": \"Relevant spec issue\",\n \"href\": \"https://github.com/ResponsiveImagesCG/picture-element/issues/87\"\n }]\n}\n!*/\n\n Modernizr.addTest('picture', 'HTMLPictureElement' in window );\n\n/*!\n{\n \"name\": \"postMessage\",\n \"property\": \"postmessage\",\n \"caniuse\": \"x-doc-messaging\",\n \"notes\": [{\n \"name\": \"W3C Spec\",\n \"href\": \"http://www.w3.org/TR/html5/comms.html#posting-messages\"\n }],\n \"polyfills\": [\"easyxdm\", \"postmessage-jquery\"]\n}\n!*/\n/* DOC\nDetects support for the `window.postMessage` protocol for cross-document messaging.\n*/\n\n Modernizr.addTest('postmessage', 'postMessage' in window);\n\n/*!\n{\n \"name\": \"QuerySelector\",\n \"property\": \"queryselector\",\n \"caniuse\": \"queryselector\",\n \"tags\": [\"queryselector\"],\n \"authors\": [\"Andrew Betts (@triblondon)\"],\n \"notes\": [{\n \"name\" : \"W3C Selectors reference\",\n \"href\": \"http://www.w3.org/TR/selectors-api/#queryselectorall\"\n }],\n \"polyfills\": [\"css-selector-engine\"]\n}\n!*/\n/* DOC\nDetects support for querySelector.\n*/\n\n Modernizr.addTest('queryselector', 'querySelector' in document && 'querySelectorAll' in document);\n\n/*!\n{\n \"name\": \"Server Sent Events\",\n \"property\": \"eventsource\",\n \"tags\": [\"network\"],\n \"builderAliases\": [\"network_eventsource\"],\n \"notes\": [{\n \"name\": \"W3 Spec\",\n \"href\": \"http://dev.w3.org/html5/eventsource/\"\n }]\n}\n!*/\n/* DOC\nTests for server sent events aka eventsource.\n*/\n\n Modernizr.addTest('eventsource', 'EventSource' in window);\n\n/*!\n{\n \"name\": \"ServiceWorker API\",\n \"property\": \"serviceworker\",\n \"notes\": [{\n \"name\": \"ServiceWorkers Explained\",\n \"href\": \"https://github.com/slightlyoff/ServiceWorker/blob/master/explainer.md\"\n }]\n}\n!*/\n/* DOC\nServiceWorkers (formerly Navigation Controllers) are a way to persistently cache resources to built apps that work better offline.\n*/\n\n Modernizr.addTest('serviceworker', 'serviceWorker' in navigator);\n\n/*!\n{\n \"name\": \"Session Storage\",\n \"property\": \"sessionstorage\",\n \"tags\": [\"storage\"],\n \"polyfills\": [\"joshuabell-polyfill\", \"cupcake\", \"sessionstorage\"]\n}\n!*/\n\n // Because we are forced to try/catch this, we'll go aggressive.\n\n // Just FWIW: IE8 Compat mode supports these features completely:\n // www.quirksmode.org/dom/html5.html\n // But IE8 doesn't support either with local files\n Modernizr.addTest('sessionstorage', function() {\n var mod = 'modernizr';\n try {\n sessionStorage.setItem(mod, mod);\n sessionStorage.removeItem(mod);\n return true;\n } catch(e) {\n return false;\n }\n });\n\n/*!\n{\n \"name\": \"Shared Workers\",\n \"property\": \"sharedworkers\",\n \"caniuse\" : \"sharedworkers\",\n \"tags\": [\"performance\", \"workers\"],\n \"builderAliases\": [\"workers_sharedworkers\"],\n \"notes\": [{\n \"name\": \"W3C Reference\",\n \"href\": \"http://www.w3.org/TR/workers/\"\n }]\n}\n!*/\n/* DOC\nDetects support for the `SharedWorker` API from the Web Workers spec.\n*/\n\n Modernizr.addTest('sharedworkers', 'SharedWorker' in window);\n\n/*!\n{\n \"authors\": [\"Cătălin Mariș\"],\n \"name\": \"Speech Synthesis API\",\n \"notes\": [\n {\n \"name\": \"W3C Web Speech API Specification - The SpeechSynthesis Interface\",\n \"href\": \"https://dvcs.w3.org/hg/speech-api/raw-file/tip/speechapi.html#tts-section\"\n }\n ],\n \"property\": \"speechsynthesis\",\n \"tags\": [\"input\", \"speech\"]\n}\n!*/\n\n\n Modernizr.addTest('speechsynthesis', 'SpeechSynthesisUtterance' in window);\n\n/*!\n{\n \"name\": \"SVG\",\n \"property\": \"svg\",\n \"caniuse\": \"svg\",\n \"tags\": [\"svg\"],\n \"authors\": [\"Erik Dahlstrom\"],\n \"polyfills\": [\n \"svgweb\",\n \"raphael\",\n \"amplesdk\",\n \"canvg\",\n \"svg-boilerplate\",\n \"sie\",\n \"dojogfx\",\n \"fabricjs\"\n ]\n}\n!*/\n/* DOC\nDetects support for SVG in `` or `` elements.\n*/\n\n Modernizr.addTest('svg', !!document.createElementNS && !!document.createElementNS('http://www.w3.org/2000/svg', 'svg').createSVGRect);\n\n/*!\n{\n \"name\": \"SVG filters\",\n \"property\": \"svgfilters\",\n \"caniuse\": \"svg-filters\",\n \"tags\": [\"svg\"],\n \"builderAliases\": [\"svg_filters\"],\n \"authors\": [\"Erik Dahlstrom\"],\n \"notes\": [{\n \"name\": \"W3C Spec\",\n \"href\": \"http://www.w3.org/TR/SVG11/filters.html\"\n }]\n}\n!*/\n\n // Should fail in Safari: http://stackoverflow.com/questions/9739955/feature-detecting-support-for-svg-filters.\n Modernizr.addTest('svgfilters', function() {\n var result = false;\n try {\n result = 'SVGFEColorMatrixElement' in window &&\n SVGFEColorMatrixElement.SVG_FECOLORMATRIX_TYPE_SATURATE == 2;\n }\n catch(e) {}\n return result;\n });\n\n/*!\n{\n \"name\": \"Template strings\",\n \"property\": \"templatestrings\",\n \"notes\": [{\n \"name\": \"MDN Reference\",\n \"href\": \"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/template_strings#Browser_compatibility\"\n }]\n}\n!*/\n/* DOC\nTemplate strings are string literals allowing embedded expressions.\n*/\n\n Modernizr.addTest('templatestrings', function() {\n var supports;\n try {\n // A number of tools, including uglifyjs and require, break on a raw \"`\", so\n // use an eval to get around that.\n eval('``');\n supports = true;\n } catch (e) {}\n return !!supports;\n });\n\n/*!\n{\n \"name\": \"Typed arrays\",\n \"property\": \"typedarrays\",\n \"caniuse\": \"typedarrays\",\n \"tags\": [\"js\"],\n \"authors\": [\"Stanley Stuart (@fivetanley)\"],\n \"notes\": [{\n \"name\": \"MDN documentation\",\n \"href\": \"https://developer.mozilla.org/en-US/docs/JavaScript_typed_arrays\"\n },{\n \"name\": \"Kronos spec\",\n \"href\": \"http://www.khronos.org/registry/typedarray/specs/latest/\"\n }],\n \"polyfills\": [\"joshuabell-polyfill\"]\n}\n!*/\n/* DOC\nDetects support for native binary data manipulation via Typed Arrays in JavaScript.\n\nDoes not check for DataView support; use `Modernizr.dataview` for that.\n*/\n\n // Should fail in:\n // Internet Explorer <= 9\n // Firefox <= 3.6\n // Chrome <= 6.0\n // iOS Safari < 4.2\n // Safari < 5.1\n // Opera < 11.6\n // Opera Mini, <= 7.0\n // Android Browser < 4.0\n // Blackberry Browser < 10.0\n\n Modernizr.addTest('typedarrays', 'ArrayBuffer' in window );\n\n/*!\n{\n \"name\": \"URL parser\",\n \"property\": \"urlparser\",\n \"notes\": [{\n \"name\": \"URL\",\n \"href\": \"https://dvcs.w3.org/hg/url/raw-file/tip/Overview.html\"\n }],\n \"polyfills\": [\"urlparser\"],\n \"authors\": [\"Ron Waldon (@jokeyrhyme)\"],\n \"tags\": [\"url\"]\n}\n!*/\n/* DOC\nCheck if browser implements the URL constructor for parsing URLs.\n*/\n\n Modernizr.addTest('urlparser', function () {\n var url;\n try {\n // have to actually try use it, because Safari defines a dud constructor\n url = new URL('http://modernizr.com/');\n return url.href === 'http://modernizr.com/';\n } catch (e) {\n return false;\n }\n });\n\n/*!\n{\n \"name\": \"Web Audio API\",\n \"property\": \"webaudio\",\n \"caniuse\": \"audio-api\",\n \"polyfills\": [\"xaudiojs\", \"dynamicaudiojs\", \"audiolibjs\"],\n \"tags\": [\"audio\", \"media\"],\n \"builderAliases\": [\"audio_webaudio_api\"],\n \"authors\": [\"Addy Osmani\"],\n \"notes\": [{\n \"name\": \"W3 Specification\",\n \"href\": \"https://dvcs.w3.org/hg/audio/raw-file/tip/webaudio/specification.html\"\n }]\n}\n!*/\n/* DOC\nDetects the older non standard webaudio API, (as opposed to the standards based AudioContext API)\n*/\n\n Modernizr.addTest('webaudio', function() {\n var prefixed = 'webkitAudioContext' in window;\n var unprefixed = 'AudioContext' in window;\n\n if (Modernizr._config.usePrefixes) return prefixed || unprefixed;\n return unprefixed;\n });\n\n/*!\n{\n \"name\": \"Web SQL Database\",\n \"property\": \"websqldatabase\",\n \"caniuse\": \"sql-storage\",\n \"tags\": [\"storage\"]\n}\n!*/\n\n // Chrome incognito mode used to throw an exception when using openDatabase\n // It doesn't anymore.\n Modernizr.addTest('websqldatabase', 'openDatabase' in window);\n\n/*!\n{\n \"name\": \"Web Workers\",\n \"property\": \"webworkers\",\n \"caniuse\" : \"webworkers\",\n \"tags\": [\"performance\", \"workers\"],\n \"notes\": [{\n \"name\": \"W3C Reference\",\n \"href\": \"http://www.w3.org/TR/workers/\"\n }, {\n \"name\": \"HTML5 Rocks article\",\n \"href\": \"http://www.html5rocks.com/en/tutorials/workers/basics/\"\n }, {\n \"name\": \"MDN documentation\",\n \"href\": \"https://developer.mozilla.org/en-US/docs/Web/Guide/Performance/Using_web_workers\"\n }],\n \"polyfills\": [\"fakeworker\", \"html5shims\"]\n}\n!*/\n/* DOC\nDetects support for the basic `Worker` API from the Web Workers spec. Web Workers provide a simple means for web content to run scripts in background threads.\n*/\n\n Modernizr.addTest('webworkers', 'Worker' in window);\n\n/*!\n{\n \"name\": \"WebSockets Support\",\n \"property\": \"websockets\",\n \"authors\": [\"Phread [fearphage]\", \"Mike Sherov [mikesherov]\", \"Burak Yigit Kaya [BYK]\"],\n \"caniuse\": \"websockets\",\n \"tags\": [\"html5\"],\n \"warnings\": [\n \"This test will reject any old version of WebSockets even if it is not prefixed such as in Safari 5.1\"\n ],\n \"notes\": [{\n \"name\": \"CLOSING State and Spec\",\n \"href\": \"http://www.w3.org/TR/websockets/#the-websocket-interface\"\n }],\n \"polyfills\": [\n \"sockjs\",\n \"socketio\",\n \"kaazing-websocket-gateway\",\n \"websocketjs\",\n \"atmosphere\",\n \"graceful-websocket\",\n \"portal\",\n \"datachannel\"\n ]\n}\n!*/\n\n Modernizr.addTest('websockets', 'WebSocket' in window && window.WebSocket.CLOSING === 2);\n\n/*!\n{\n \"name\": \"XML HTTP Request Level 2 XHR2\",\n \"property\": \"xhr2\",\n \"tags\": [\"network\"],\n \"builderAliases\": [\"network_xhr2\"],\n \"notes\": [{\n \"name\": \"W3 Spec\",\n \"href\": \"http://www.w3.org/TR/XMLHttpRequest2/\"\n },{\n \"name\": \"Details on Related Github Issue\",\n \"href\": \"http://github.com/Modernizr/Modernizr/issues/385\"\n }]\n}\n!*/\n/* DOC\nTests for XHR2.\n*/\n\n // all three of these details report consistently across all target browsers:\n // !!(window.ProgressEvent);\n // 'XMLHttpRequest' in window && 'withCredentials' in new XMLHttpRequest\n Modernizr.addTest('xhr2', 'XMLHttpRequest' in window && 'withCredentials' in new XMLHttpRequest());\n\n/*!\n{\n \"name\": \"XHR responseType\",\n \"property\": \"xhrresponsetype\",\n \"tags\": [\"network\"],\n \"notes\": [{\n \"name\": \"XMLHttpRequest Living Standard\",\n \"href\": \"http://xhr.spec.whatwg.org/#the-responsetype-attribute\"\n }]\n}\n!*/\n/* DOC\nTests for XMLHttpRequest xhr.responseType.\n*/\n\n Modernizr.addTest('xhrresponsetype', (function() {\n if (typeof XMLHttpRequest == 'undefined') {\n return false;\n }\n var xhr = new XMLHttpRequest();\n xhr.open('get', '/', true);\n return 'response' in xhr;\n }()));\n\n\n\n var err = function() {};\n var warn = function() {};\n\n if (window.console) {\n err = function() {\n var method = console.error ? 'error' : 'log';\n window.console[method].apply( window.console, Array.prototype.slice.call(arguments) );\n };\n\n warn = function() {\n var method = console.warn ? 'warn' : 'log';\n window.console[method].apply( window.console, Array.prototype.slice.call(arguments) );\n };\n }\n\n ModernizrProto.load = function() {\n if ('yepnope' in window) {\n warn('yepnope.js (aka Modernizr.load) is no longer included as part of Modernizr. yepnope appears to be available on the page, so we’ll use it to handle this call to Modernizr.load, but please update your code to use yepnope directly.\\n See http://github.com/Modernizr/Modernizr/issues/1182 for more information.');\n window.yepnope.apply(window, [].slice.call(arguments,0));\n } else {\n err('yepnope.js (aka Modernizr.load) is no longer included as part of Modernizr. Get it from http://yepnopejs.com. See http://github.com/Modernizr/Modernizr/issues/1182 for more information.');\n }\n };\n\n\n\n // List of property values to set for css tests. See ticket #21\n var prefixes = (ModernizrProto._config.usePrefixes ? ' -webkit- -moz- -o- -ms- '.split(' ') : []);\n\n // expose these for the plugin API. Look in the source for how to join() them against your input\n ModernizrProto._prefixes = prefixes;\n\n\n\n /**\n * is returns a boolean for if typeof obj is exactly type.\n */\n function is( obj, type ) {\n return typeof obj === type;\n }\n ;\n\n // Run through all tests and detect their support in the current UA.\n function testRunner() {\n var featureNames;\n var feature;\n var aliasIdx;\n var result;\n var nameIdx;\n var featureName;\n var featureNameSplit;\n\n for ( var featureIdx in tests ) {\n featureNames = [];\n feature = tests[featureIdx];\n // run the test, throw the return value into the Modernizr,\n // then based on that boolean, define an appropriate className\n // and push it into an array of classes we'll join later.\n //\n // If there is no name, it's an 'async' test that is run,\n // but not directly added to the object. That should\n // be done with a post-run addTest call.\n if ( feature.name ) {\n featureNames.push(feature.name.toLowerCase());\n\n if (feature.options && feature.options.aliases && feature.options.aliases.length) {\n // Add all the aliases into the names list\n for (aliasIdx = 0; aliasIdx < feature.options.aliases.length; aliasIdx++) {\n featureNames.push(feature.options.aliases[aliasIdx].toLowerCase());\n }\n }\n }\n\n // Run the test, or use the raw value if it's not a function\n result = is(feature.fn, 'function') ? feature.fn() : feature.fn;\n\n\n // Set each of the names on the Modernizr object\n for (nameIdx = 0; nameIdx < featureNames.length; nameIdx++) {\n featureName = featureNames[nameIdx];\n // Support dot properties as sub tests. We don't do checking to make sure\n // that the implied parent tests have been added. You must call them in\n // order (either in the test, or make the parent test a dependency).\n //\n // Cap it to TWO to make the logic simple and because who needs that kind of subtesting\n // hashtag famous last words\n featureNameSplit = featureName.split('.');\n\n if (featureNameSplit.length === 1) {\n Modernizr[featureNameSplit[0]] = result;\n } else {\n // cast to a Boolean, if not one already\n /* jshint -W053 */\n if (Modernizr[featureNameSplit[0]] && !(Modernizr[featureNameSplit[0]] instanceof Boolean)) {\n Modernizr[featureNameSplit[0]] = new Boolean(Modernizr[featureNameSplit[0]]);\n }\n\n Modernizr[featureNameSplit[0]][featureNameSplit[1]] = result;\n }\n\n classes.push((result ? '' : 'no-') + featureNameSplit.join('-'));\n }\n }\n }\n\n ;\n/*!\n{\n \"name\": \"ES5 String.prototype.contains\",\n \"property\": \"contains\",\n \"authors\": [\"Robert Kowalski\"],\n \"tags\": [\"es6\"]\n}\n!*/\n/* DOC\nCheck if browser implements ECMAScript 6 `String.prototype.contains` per specification.\n*/\n\n Modernizr.addTest('contains', is(String.prototype.contains, 'function'));\n\n\n var docElement = document.documentElement;\n\n\n // Pass in an and array of class names, e.g.:\n // ['no-webp', 'borderradius', ...]\n function setClasses( classes ) {\n var className = docElement.className;\n var classPrefix = Modernizr._config.classPrefix || '';\n\n // Change `no-js` to `js` (we do this independently of the `enableClasses`\n // option)\n // Handle classPrefix on this too\n if(Modernizr._config.enableJSClass) {\n var reJS = new RegExp('(^|\\\\s)'+classPrefix+'no-js(\\\\s|$)');\n className = className.replace(reJS, '$1'+classPrefix+'js$2');\n }\n\n if(Modernizr._config.enableClasses) {\n // Add the new classes\n className += ' ' + classPrefix + classes.join(' ' + classPrefix);\n docElement.className = className;\n }\n\n }\n\n ;\n/*!\n{\n \"name\": \"classList\",\n \"caniuse\": \"classlist\",\n \"property\": \"classlist\",\n \"tags\": [\"dom\"],\n \"builderAliases\": [\"dataview_api\"],\n \"notes\": [{\n \"name\": \"MDN Docs\",\n \"href\": \"https://developer.mozilla.org/en/DOM/element.classList\"\n }]\n}\n!*/\n\n Modernizr.addTest('classlist', 'classList' in docElement);\n\n/*!\n{\n \"name\": \"Context menus\",\n \"property\": \"contextmenu\",\n \"caniuse\": \"menu\",\n \"notes\": [{\n \"name\": \"W3C spec\",\n \"href\": \"http://www.w3.org/TR/html5/interactive-elements.html#context-menus\"\n },{\n \"name\": \"thewebrocks.com Demo\",\n \"href\": \"http://thewebrocks.com/demos/context-menu/\"\n }],\n \"polyfills\": [\"jquery-contextmenu\"]\n}\n!*/\n/* DOC\nDetects support for custom context menus.\n*/\n\n Modernizr.addTest(\n 'contextmenu',\n ('contextMenu' in docElement && 'HTMLMenuItemElement' in window)\n );\n\n/*!\n{\n \"name\": \"cssall\",\n \"property\": \"cssall\",\n \"notes\": [{\n \"name\": \"Spec\",\n \"href\": \"http://dev.w3.org/csswg/css-cascade/#all-shorthand\"\n }]\n}\n!*/\n/* DOC\nDetects support for the `all` css property, which is a shorthand to reset all css properties (except direction and unicode-bidi) to their original value\n*/\n\n\n Modernizr.addTest('cssall', 'all' in docElement.style);\n\n/*!\n{\n \"name\": \"Document Fragment\",\n \"property\": \"documentfragment\",\n \"notes\": [{\n \"name\": \"W3C DOM Level 1 Reference\",\n \"href\": \"http://www.w3.org/TR/REC-DOM-Level-1/level-one-core.html#ID-B63ED1A3\"\n }, {\n \"name\": \"SitePoint Reference\",\n \"href\": \"http://reference.sitepoint.com/javascript/DocumentFragment\"\n }, {\n \"name\": \"QuirksMode Compatibility Tables\",\n \"href\": \"http://www.quirksmode.org/m/w3c_core.html#t112\"\n }],\n \"authors\": [\"Ron Waldon (@jokeyrhyme)\"],\n \"knownBugs\": [\"false-positive on Blackberry 9500, see QuirksMode note\"],\n \"tags\": []\n}\n!*/\n/* DOC\nAppend multiple elements to the DOM within a single insertion.\n*/\n\n Modernizr.addTest('documentfragment', function() {\n return 'createDocumentFragment' in document &&\n 'appendChild' in docElement;\n });\n\n/*!\n{\n \"name\": \"will-change\",\n \"property\": \"willchange\",\n \"notes\": [{\n \"name\": \"Spec\",\n \"href\": \"http://tabatkins.github.io/specs/css-will-change/\"\n }]\n}\n!*/\n/* DOC\nDetects support for the `will-change` css property, which formally signals to the\nbrowser that an element will be animating.\n*/\n\n Modernizr.addTest('willchange', 'willChange' in docElement.style);\n\n\n // hasOwnProperty shim by kangax needed for Safari 2.0 support\n var hasOwnProp;\n\n (function() {\n var _hasOwnProperty = ({}).hasOwnProperty;\n /* istanbul ignore else */\n /* we have no way of testing IE 5.5 or safari 2,\n * so just assume the else gets hit */\n if ( !is(_hasOwnProperty, 'undefined') && !is(_hasOwnProperty.call, 'undefined') ) {\n hasOwnProp = function (object, property) {\n return _hasOwnProperty.call(object, property);\n };\n }\n else {\n hasOwnProp = function (object, property) { /* yes, this can give false positives/negatives, but most of the time we don't care about those */\n return ((property in object) && is(object.constructor.prototype[property], 'undefined'));\n };\n }\n })();\n\n\n\n // As far as I can think of, we shouldn't need or\n // allow 'on' for non-async tests, and you can't do\n // async tests without this 'addTest' module.\n\n // Listeners for async or post-run tests\n ModernizrProto._l = {};\n\n // 'addTest' implies a test after the core runloop,\n // So we'll add in the events\n ModernizrProto.on = function( test, cb ) {\n // Create the list of listeners if it doesn't exist\n if (!this._l[test]) {\n this._l[test] = [];\n }\n\n // Push this test on to the listener list\n this._l[test].push(cb);\n\n // If it's already been resolved, trigger it on next tick\n if (Modernizr.hasOwnProperty(test)) {\n // Next Tick\n setTimeout(function() {\n Modernizr._trigger(test, Modernizr[test]);\n }, 0);\n }\n };\n\n ModernizrProto._trigger = function( test, res ) {\n if (!this._l[test]) {\n return;\n }\n\n var cbs = this._l[test];\n\n // Force async\n setTimeout(function() {\n var i, cb;\n for (i = 0; i < cbs.length; i++) {\n cb = cbs[i];\n cb(res);\n }\n },0);\n\n // Don't trigger these again\n delete this._l[test];\n };\n\n /**\n * addTest allows the user to define their own feature tests\n * the result will be added onto the Modernizr object,\n * as well as an appropriate className set on the html element\n *\n * @param feature - String naming the feature\n * @param test - Function returning true if feature is supported, false if not\n */\n function addTest( feature, test ) {\n if ( typeof feature == 'object' ) {\n for ( var key in feature ) {\n if ( hasOwnProp( feature, key ) ) {\n addTest( key, feature[ key ] );\n }\n }\n } else {\n\n feature = feature.toLowerCase();\n var featureNameSplit = feature.split('.');\n var last = Modernizr[featureNameSplit[0]];\n\n // Again, we don't check for parent test existence. Get that right, though.\n if (featureNameSplit.length == 2) {\n last = last[featureNameSplit[1]];\n }\n\n if ( typeof last != 'undefined' ) {\n // we're going to quit if you're trying to overwrite an existing test\n // if we were to allow it, we'd do this:\n // var re = new RegExp(\"\\\\b(no-)?\" + feature + \"\\\\b\");\n // docElement.className = docElement.className.replace( re, '' );\n // but, no rly, stuff 'em.\n return Modernizr;\n }\n\n test = typeof test == 'function' ? test() : test;\n\n // Set the value (this is the magic, right here).\n if (featureNameSplit.length == 1) {\n Modernizr[featureNameSplit[0]] = test;\n } else {\n // cast to a Boolean, if not one already\n /* jshint -W053 */\n if (Modernizr[featureNameSplit[0]] && !(Modernizr[featureNameSplit[0]] instanceof Boolean)) {\n Modernizr[featureNameSplit[0]] = new Boolean(Modernizr[featureNameSplit[0]]);\n }\n\n Modernizr[featureNameSplit[0]][featureNameSplit[1]] = test;\n }\n\n // Set a single class (either `feature` or `no-feature`)\n /* jshint -W041 */\n setClasses([(!!test && test != false ? '' : 'no-') + featureNameSplit.join('-')]);\n /* jshint +W041 */\n\n // Trigger the event\n Modernizr._trigger(feature, test);\n }\n\n return Modernizr; // allow chaining.\n }\n\n // After all the tests are run, add self\n // to the Modernizr prototype\n Modernizr._q.push(function() {\n ModernizrProto.addTest = addTest;\n });\n\n\n/*!\n{\n \"name\": \"Data URI\",\n \"property\": \"datauri\",\n \"caniuse\": \"datauri\",\n \"tags\": [\"url\"],\n \"builderAliases\": [\"url_data_uri\"],\n \"async\": true,\n \"notes\": [{\n \"name\": \"Wikipedia article\",\n \"href\": \"http://en.wikipedia.org/wiki/Data_URI_scheme\"\n }],\n \"warnings\": [\"Support in Internet Explorer 8 is limited to images and linked resources like CSS files, not HTML files\"]\n}\n!*/\n/* DOC\nDetects support for data URIs. Provides a subproperty to report support for data URIs over 32kb in size:\n\n```javascript\nModernizr.datauri // true\nModernizr.datauri.over32kb // false in IE8\n```\n*/\n\n // https://github.com/Modernizr/Modernizr/issues/14\n Modernizr.addAsyncTest(function() {\n /* jshint -W053 */\n\n // IE7 throw a mixed content warning on HTTPS for this test, so we'll\n // just blacklist it (we know it doesn't support data URIs anyway)\n // https://github.com/Modernizr/Modernizr/issues/362\n if(navigator.userAgent.indexOf('MSIE 7.') !== -1) {\n // Keep the test async\n setTimeout(function () {\n addTest('datauri', false);\n }, 10);\n }\n\n var datauri = new Image();\n\n datauri.onerror = function() {\n addTest('datauri', false);\n };\n datauri.onload = function() {\n if(datauri.width == 1 && datauri.height == 1) {\n testOver32kb();\n }\n else {\n addTest('datauri', false);\n }\n };\n\n datauri.src = 'data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///ywAAAAAAQABAAACAUwAOw==';\n\n // Once we have datauri, let's check to see if we can use data URIs over\n // 32kb (IE8 can't). https://github.com/Modernizr/Modernizr/issues/321\n function testOver32kb(){\n\n var datauriBig = new Image();\n\n datauriBig.onerror = function() {\n addTest('datauri', true);\n Modernizr.datauri = new Boolean(true);\n Modernizr.datauri.over32kb = false;\n };\n datauriBig.onload = function() {\n addTest('datauri', true);\n Modernizr.datauri = new Boolean(true);\n Modernizr.datauri.over32kb = (datauriBig.width == 1 && datauriBig.height == 1);\n };\n\n var base64str = 'R0lGODlhAQABAIAAAAAAAP///ywAAAAAAQABAAACAUwAOw==';\n while (base64str.length < 33000) {\n base64str = '\\r\\n' + base64str;\n }\n datauriBig.src= 'data:image/gif;base64,' + base64str;\n }\n\n });\n\n/*!\n{\n \"name\": \"EXIF Orientation\",\n \"property\": \"exiforientation\",\n \"tags\": [\"image\"],\n \"builderAliases\": [\"exif_orientation\"],\n \"async\": true,\n \"authors\": [\"Paul Sayre\"],\n \"notes\": [{\n \"name\": \"Article by Dave Perrett\",\n \"href\": \"http://recursive-design.com/blog/2012/07/28/exif-orientation-handling-is-a-ghetto/\"\n },{\n \"name\": \"Article by Calvin Hass\",\n \"href\": \"http://www.impulseadventure.com/photo/exif-orientation.html\"\n }]\n}\n!*/\n/* DOC\nDetects support for EXIF Orientation in JPEG images.\n\niOS looks at the EXIF Orientation flag in JPEGs and rotates the image accordingly. Most desktop browsers just ignore this data.\n*/\n\n // Bug trackers:\n // bugzil.la/298619 (unimplemented)\n // crbug.com/56845 (looks incomplete)\n // webk.it/19688 (available upstream but its up all ports to turn on individually)\n Modernizr.addAsyncTest(function() {\n var img = new Image();\n\n img.onerror = function() {\n addTest('exiforientation', false, { aliases: ['exif-orientation'] });\n };\n\n img.onload = function() {\n addTest('exiforientation', img.width !== 2, { aliases: ['exif-orientation'] });\n };\n\n // There may be a way to shrink this more, it's a 1x2 white jpg with the orientation flag set to 6\n img.src = 'data:image/jpeg;base64,/9j/4AAQSkZJRgABAQEAYABgAAD/4QAiRXhpZgAASUkqAAgAAAABABIBAwABAAAABgASAAAAAAD/2wBDAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQH/2wBDAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQH/wAARCAABAAIDASIAAhEBAxEB/8QAHwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoL/8QAtRAAAgEDAwIEAwUFBAQAAAF9AQIDAAQRBRIhMUEGE1FhByJxFDKBkaEII0KxwRVS0fAkM2JyggkKFhcYGRolJicoKSo0NTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqDhIWGh4iJipKTlJWWl5iZmqKjpKWmp6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uHi4+Tl5ufo6erx8vP09fb3+Pn6/8QAHwEAAwEBAQEBAQEBAQAAAAAAAAECAwQFBgcICQoL/8QAtREAAgECBAQDBAcFBAQAAQJ3AAECAxEEBSExBhJBUQdhcRMiMoEIFEKRobHBCSMzUvAVYnLRChYkNOEl8RcYGRomJygpKjU2Nzg5OkNERUZHSElKU1RVVldYWVpjZGVmZ2hpanN0dXZ3eHl6goOEhYaHiImKkpOUlZaXmJmaoqOkpaanqKmqsrO0tba3uLm6wsPExcbHyMnK0tPU1dbX2Nna4uPk5ebn6Onq8vP09fb3+Pn6/9oADAMBAAIRAxEAPwD+/iiiigD/2Q==';\n });\n\n/*!\n{\n \"name\": \"JPEG XR (extended range)\",\n \"async\": true,\n \"aliases\": [\"jpeg-xr\"],\n \"property\": \"jpegxr\",\n \"tags\": [\"image\"],\n \"notes\": [{\n \"name\": \"Wikipedia Article\",\n \"href\": \"http://en.wikipedia.org/wiki/JPEG_XR\"\n }]\n}\n!*/\n/* DOC\nTest for JPEG XR support\n*/\n\n\n Modernizr.addAsyncTest(function() {\n var image = new Image();\n\n image.onload = image.onerror = function() {\n addTest('jpegxr', image.width == 1, { aliases: ['jpeg-xr'] });\n };\n\n image.src = 'data:image/vnd.ms-photo;base64,SUm8AQgAAAAFAAG8AQAQAAAASgAAAIC8BAABAAAAAQAAAIG8BAABAAAAAQAAAMC8BAABAAAAWgAAAMG8BAABAAAAHwAAAAAAAAAkw91vA07+S7GFPXd2jckNV01QSE9UTwAZAYBxAAAAABP/gAAEb/8AAQAAAQAAAA==';\n });\n\n/*!\n{\n \"authors\": [\"Cătălin Mariș\"],\n \"caniuse\": \"proximity\",\n \"name\": \"Proximity API\",\n \"notes\": [{\n \"name\": \"MDN documentation\",\n \"href\": \"https://developer.mozilla.org/en-US/docs/Web/API/Proximity_Events\"\n },{\n \"name\": \"W3C specification\",\n \"href\": \"http://www.w3.org/TR/proximity/\"\n }],\n \"property\": \"proximity\",\n \"tags\": [\"events\", \"proximity\"]\n}\n!*/\n/* DOC\nDetects support for an API that allows users to get proximity related information from the device's proximity sensor.\n*/\n\n\n Modernizr.addAsyncTest(function () {\n\n var timeout;\n var timeoutTime = 300;\n\n function advertiseSupport() {\n\n // Clean up after ourselves\n clearTimeout(timeout);\n window.removeEventListener('deviceproximity', advertiseSupport);\n\n // Advertise support as the browser supports\n // the API and the device has a proximity sensor\n addTest('proximity', true);\n\n }\n\n // Check if the browser has support for the API\n if ( 'ondeviceproximity' in window && 'onuserproximity' in window ) {\n\n // Check if the device has a proximity sensor\n // ( devices without such a sensor support the events but\n // will never fire them resulting in a false positive )\n window.addEventListener('deviceproximity', advertiseSupport);\n\n // If the event doesn't fire in a reasonable amount of time,\n // it means that the device doesn't have a proximity sensor,\n // thus, we can advertise the \"lack\" of support\n timeout = setTimeout(function() {\n window.removeEventListener('deviceproximity', advertiseSupport);\n addTest('proximity', false);\n }, timeoutTime);\n\n } else {\n addTest('proximity', false);\n }\n\n });\n\n\n/*!\n{\n \"name\": \"SVG as an tag source\",\n \"property\": \"svgasimg\",\n \"caniuse\" : \"svg-img\",\n \"tags\": [\"svg\"],\n \"authors\": [\"Chris Coyier\"],\n \"notes\": [{\n \"name\": \"HTML5 Spec\",\n \"href\": \"http://www.w3.org/TR/html5/embedded-content-0.html#the-img-element\"\n }]\n}\n!*/\n\n\n // Original Async test by Stu Cox\n // https://gist.github.com/chriscoyier/8774501\n\n // Now a Sync test based on good results here\n // http://codepen.io/chriscoyier/pen/bADFx\n\n // Note http://www.w3.org/TR/SVG11/feature#Image is *supposed* to represent\n // support for the `` tag in SVG, not an SVG file linked from an ``\n // tag in HTML – but it’s a heuristic which works\n Modernizr.addTest('svgasimg', document.implementation.hasFeature('http://www.w3.org/TR/SVG11/feature#Image', '1.1'));\n\n/*!\n{\n \"name\": \"Webp\",\n \"async\": true,\n \"property\": \"webp\",\n \"tags\": [\"image\"],\n \"builderAliases\": [\"img_webp\"],\n \"authors\": [\"Krister Kari\", \"@amandeep\", \"Rich Bradshaw\", \"Ryan Seddon\", \"Paul Irish\"],\n \"notes\": [{\n \"name\": \"Webp Info\",\n \"href\": \"http://code.google.com/speed/webp/\"\n }, {\n \"name\": \"Chormium blog - Chrome 32 Beta: Animated WebP images and faster Chrome for Android touch input\",\n \"href\": \"http://blog.chromium.org/2013/11/chrome-32-beta-animated-webp-images-and.html\"\n }, {\n \"name\": \"Webp Lossless Spec\",\n \"href\": \"https://developers.google.com/speed/webp/docs/webp_lossless_bitstream_specification\"\n }, {\n \"name\": \"Article about WebP support on Android browsers\",\n \"href\": \"http://www.wope-framework.com/en/2013/06/24/webp-support-on-android-browsers/\"\n }, {\n \"name\": \"Chormium WebP announcement\",\n \"href\": \"http://blog.chromium.org/2011/11/lossless-and-transparency-encoding-in.html?m=1\"\n }]\n}\n!*/\n/* DOC\nTests for lossy, non-alpha webp support.\n=======\n\nTests for all forms of webp support (lossless, lossy, alpha, and animated)..\n\n Modernizr.webp // Basic support (lossy)\n Modernizr.webp.lossless // Lossless\n Modernizr.webp.alpha // Alpha (both lossy and lossless)\n Modernizr.webp.animation // Animated WebP\n\n*/\n\n\n Modernizr.addAsyncTest(function() {\n\n var webpTests = [{\n 'uri': 'data:image/webp;base64,UklGRiQAAABXRUJQVlA4IBgAAAAwAQCdASoBAAEAAwA0JaQAA3AA/vuUAAA=',\n 'name': 'webp'\n },{\n 'uri': 'data:image/webp;base64,UklGRkoAAABXRUJQVlA4WAoAAAAQAAAAAAAAAAAAQUxQSAwAAAABBxAR/Q9ERP8DAABWUDggGAAAADABAJ0BKgEAAQADADQlpAADcAD++/1QAA==',\n 'name': 'webp.alpha'\n },{\n 'uri': 'data:image/webp;base64,UklGRlIAAABXRUJQVlA4WAoAAAASAAAAAAAAAAAAQU5JTQYAAAD/////AABBTk1GJgAAAAAAAAAAAAAAAAAAAGQAAABWUDhMDQAAAC8AAAAQBxAREYiI/gcA',\n 'name': 'webp.animation'\n }, {\n 'uri': 'data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAAAAAAfQ//73v/+BiOh/AAA=',\n 'name': 'webp.lossless'\n }];\n\n var webp = webpTests.shift();\n function test(name, uri, cb) {\n\n var image = new Image();\n\n function addResult(event) {\n // if the event is from 'onload', check the see if the image's width is\n // 1 pixel (which indiciates support). otherwise, it fails\n\n var result = event && event.type === 'load' ? image.width == 1 : false;\n var baseTest = name === 'webp';\n\n /* jshint -W053 */\n addTest(name, baseTest ? new Boolean(result) : result);\n\n if (cb) cb(event);\n }\n\n image.onerror = addResult;\n image.onload = addResult;\n\n image.src = uri;\n }\n\n // test for webp support in general\n test(webp.name, webp.uri, function(e) {\n // if the webp test loaded, test everything else.\n if (e && e.type === 'load') {\n for (var i = 0; i < webpTests.length; i++) {\n test(webpTests[i].name, webpTests[i].uri);\n }\n }\n });\n\n });\n\n\n/*!\n{\n \"name\": \"Webp Alpha\",\n \"async\": true,\n \"property\": \"webpalpha\",\n \"aliases\": [\"webp-alpha\"],\n \"tags\": [\"image\"],\n \"authors\": [\"Krister Kari\", \"Rich Bradshaw\", \"Ryan Seddon\", \"Paul Irish\"],\n \"notes\": [{\n \"name\": \"WebP Info\",\n \"href\": \"http://code.google.com/speed/webp/\"\n },{\n \"name\": \"Article about WebP support on Android browsers\",\n \"href\": \"http://www.wope-framework.com/en/2013/06/24/webp-support-on-android-browsers/\"\n },{\n \"name\": \"Chromium WebP announcement\",\n \"href\": \"http://blog.chromium.org/2011/11/lossless-and-transparency-encoding-in.html?m=1\"\n }]\n}\n!*/\n/* DOC\nTests for transparent webp support.\n*/\n\n Modernizr.addAsyncTest(function(){\n var image = new Image();\n\n image.onerror = function() {\n addTest('webpalpha', false, { aliases: ['webp-alpha'] });\n };\n\n image.onload = function() {\n addTest('webpalpha', image.width == 1, { aliases: ['webp-alpha'] });\n };\n\n image.src = 'data:image/webp;base64,UklGRkoAAABXRUJQVlA4WAoAAAAQAAAAAAAAAAAAQUxQSAwAAAABBxAR/Q9ERP8DAABWUDggGAAAADABAJ0BKgEAAQADADQlpAADcAD++/1QAA==';\n });\n\n/*!\n{\n \"name\": \"Webp Animation\",\n \"async\": true,\n \"property\": \"webpanimation\",\n \"aliases\": [\"webp-animation\"],\n \"tags\": [\"image\"],\n \"authors\": [\"Krister Kari\", \"Rich Bradshaw\", \"Ryan Seddon\", \"Paul Irish\"],\n \"notes\": [{\n \"name\": \"WebP Info\",\n \"href\": \"http://code.google.com/speed/webp/\"\n },{\n \"name\": \"Chromium blog - Chrome 32 Beta: Animated WebP images and faster Chrome for Android touch input\",\n \"href\": \"http://blog.chromium.org/2013/11/chrome-32-beta-animated-webp-images-and.html\"\n }]\n}\n!*/\n/* DOC\nTests for animated webp support.\n*/\n\n Modernizr.addAsyncTest(function(){\n var image = new Image();\n\n image.onerror = function() {\n addTest('webpanimation', false, { aliases: ['webp-animation'] });\n };\n\n image.onload = function() {\n addTest('webpanimation', image.width == 1, { aliases: ['webp-animation'] });\n };\n\n image.src = 'data:image/webp;base64,UklGRlIAAABXRUJQVlA4WAoAAAASAAAAAAAAAAAAQU5JTQYAAAD/////AABBTk1GJgAAAAAAAAAAAAAAAAAAAGQAAABWUDhMDQAAAC8AAAAQBxAREYiI/gcA';\n });\n\n/*!\n{\n \"name\": \"Webp Lossless\",\n \"async\": true,\n \"property\": [\"webplossless\", \"webp-lossless\"],\n \"tags\": [\"image\"],\n \"authors\": [\"@amandeep\", \"Rich Bradshaw\", \"Ryan Seddon\", \"Paul Irish\"],\n \"notes\": [{\n \"name\": \"Webp Info\",\n \"href\": \"http://code.google.com/speed/webp/\"\n },{\n \"name\": \"Webp Lossless Spec\",\n \"href\": \"https://developers.google.com/speed/webp/docs/webp_lossless_bitstream_specification\"\n }]\n}\n!*/\n/* DOC\nTests for non-alpha lossless webp support.\n*/\n\n Modernizr.addAsyncTest(function(){\n var image = new Image();\n\n image.onerror = function() {\n addTest('webplossless', false, { aliases: ['webp-lossless'] });\n };\n\n image.onload = function() {\n addTest('webplossless', image.width == 1, { aliases: ['webp-lossless'] });\n };\n\n image.src = 'data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAAAAAAfQ//73v/+BiOh/AAA=';\n });\n\n/*!\n{\n \"name\": \"Workers from Blob URIs\",\n \"property\": \"blobworkers\",\n \"tags\": [\"performance\", \"workers\"],\n \"builderAliases\": [\"workers_blobworkers\"],\n \"notes\": [{\n \"name\": \"W3C Reference\",\n \"href\": \"http://www.w3.org/TR/workers/\"\n }],\n \"knownBugs\": [\"This test may output garbage to console.\"],\n \"authors\": [\"Jussi Kalliokoski\"],\n \"async\": true\n}\n!*/\n/* DOC\nDetects support for creating Web Workers from Blob URIs.\n*/\n\n Modernizr.addAsyncTest(function() {\n try {\n // we're avoiding using Modernizr._domPrefixes as the prefix capitalization on\n // these guys are notoriously peculiar.\n var BlobBuilder = window.BlobBuilder;\n var URL = window.URL;\n if (Modernizr._config.usePrefix) {\n BlobBuilder = BlobBuilder || window.MozBlobBuilder || window.WebKitBlobBuilder || window.MSBlobBuilder || window.OBlobBuilder;\n URL = URL || window.MozURL || window.webkitURL || window.MSURL || window.OURL;\n }\n var data = 'Modernizr',\n blob,\n bb,\n worker,\n url,\n timeout,\n scriptText = 'this.onmessage=function(e){postMessage(e.data)}';\n\n try {\n blob = new Blob([scriptText], {type:'text/javascript'});\n } catch(e) {\n // we'll fall back to the deprecated BlobBuilder\n }\n if (!blob) {\n bb = new BlobBuilder();\n bb.append(scriptText);\n blob = bb.getBlob();\n }\n\n url = URL.createObjectURL(blob);\n worker = new Worker(url);\n\n worker.onmessage = function(e) {\n addTest('blobworkers', data === e.data);\n cleanup();\n };\n\n // Just in case...\n worker.onerror = fail;\n timeout = setTimeout(fail, 200);\n\n worker.postMessage(data);\n } catch (e) {\n fail();\n }\n\n function fail() {\n addTest('blobworkers', false);\n cleanup();\n }\n\n function cleanup() {\n if (url) {\n URL.revokeObjectURL(url);\n }\n if (worker) {\n worker.terminate();\n }\n if (timeout) {\n clearTimeout(timeout);\n }\n }\n });\n\n/*!\n{\n \"name\": \"Workers from Data URIs\",\n \"property\": \"dataworkers\",\n \"tags\": [\"performance\", \"workers\"],\n \"builderAliases\": [\"workers_dataworkers\"],\n \"notes\": [{\n \"name\": \"W3C Reference\",\n \"href\": \"http://www.w3.org/TR/workers/\"\n }],\n \"knownBugs\": [\"This test may output garbage to console.\"],\n \"authors\": [\"Jussi Kalliokoski\"],\n \"async\": true\n}\n!*/\n/* DOC\nDetects support for creating Web Workers from Data URIs.\n*/\n\n Modernizr.addAsyncTest(function() {\n try {\n var data = 'Modernizr',\n worker = new Worker('data:text/javascript;base64,dGhpcy5vbm1lc3NhZ2U9ZnVuY3Rpb24oZSl7cG9zdE1lc3NhZ2UoZS5kYXRhKX0=');\n\n worker.onmessage = function(e) {\n worker.terminate();\n addTest('dataworkers', data === e.data);\n worker = null;\n };\n\n // Just in case...\n worker.onerror = function() {\n addTest('dataworkers', false);\n worker = null;\n };\n\n setTimeout(function() {\n addTest('dataworkers', false);\n }, 200);\n\n worker.postMessage(data);\n } catch (e) {\n setTimeout(function () {\n addTest('dataworkers', false);\n }, 0);\n }\n });\n\n\n // Helper function for converting kebab-case to camelCase,\n // e.g. box-sizing -> boxSizing\n function cssToDOM( name ) {\n return name.replace(/([a-z])-([a-z])/g, function(str, m1, m2) {\n return m1 + m2.toUpperCase();\n }).replace(/^-/, '');\n }\n ;\n\n // Following spec is to expose vendor-specific style properties as:\n // elem.style.WebkitBorderRadius\n // and the following would be incorrect:\n // elem.style.webkitBorderRadius\n\n // Webkit ghosts their properties in lowercase but Opera & Moz do not.\n // Microsoft uses a lowercase `ms` instead of the correct `Ms` in IE8+\n // erik.eae.net/archives/2008/03/10/21.48.10/\n\n // More here: github.com/Modernizr/Modernizr/issues/issue/21\n var omPrefixes = 'Moz O ms Webkit';\n\n\n var domPrefixes = (ModernizrProto._config.usePrefixes ? omPrefixes.toLowerCase().split(' ') : []);\n ModernizrProto._domPrefixes = domPrefixes;\n\n\n // Helper function for converting camelCase to kebab-case,\n // e.g. boxSizing -> box-sizing\n function domToCSS( name ) {\n return name.replace(/([A-Z])/g, function(str, m1) {\n return '-' + m1.toLowerCase();\n }).replace(/^ms-/, '-ms-');\n }\n ;\n\n var createElement = function() {\n if (typeof document.createElement !== 'function') {\n // This is the case in IE7, where the type of createElement is \"object\".\n // For this reason, we cannot call apply() as Object is not a Function.\n return document.createElement(arguments[0]);\n } else {\n return document.createElement.apply(document, arguments);\n }\n };\n\n/*!\n{\n \"name\": \"[hidden] Attribute\",\n \"property\": \"hidden\",\n \"tags\": [\"dom\"],\n \"notes\": [{\n \"name\": \"WHATWG: The hidden attribute\",\n \"href\": \"http://developers.whatwg.org/editing.html#the-hidden-attribute\"\n }, {\n \"name\": \"original implementation of detect code\",\n \"href\": \"https://github.com/aFarkas/html5shiv/blob/bf4fcc4/src/html5shiv.js#L38\"\n }],\n \"polyfills\": [\"html5shiv\"],\n \"authors\": [\"Ron Waldon (@jokeyrhyme)\"]\n}\n!*/\n/* DOC\nDoes the browser support the HTML5 [hidden] attribute?\n*/\n\n Modernizr.addTest('hidden', 'hidden' in createElement('a'));\n\n/*!\n{\n \"name\": \"a[download] Attribute\",\n \"property\": \"adownload\",\n \"caniuse\" : \"download\",\n \"tags\": [\"media\", \"attribute\"],\n \"builderAliases\": [\"a_download\"],\n \"notes\": [{\n \"name\": \"WhatWG Reference\",\n \"href\": \"http://developers.whatwg.org/links.html#downloading-resources\"\n }]\n}\n!*/\n/* DOC\nWhen used on an ``, this attribute signifies that the resource it points to should be downloaded by the browser rather than navigating to it.\n*/\n\n Modernizr.addTest('adownload', !window.externalHost && 'download' in createElement('a'));\n\n/*!\n{\n \"name\": \"Audio Loop Attribute\",\n \"property\": \"audioloop\",\n \"tags\": [\"audio\", \"media\"]\n}\n!*/\n/* DOC\nDetects if an audio element can automatically restart, once it has finished\n*/\n\n Modernizr.addTest('audioloop', 'loop' in createElement('audio'));\n\n/*!\n{\n \"name\": \"Audio Preload Attribute\",\n \"property\": \"audiopreload\",\n \"tags\": [\"audio\", \"media\"]\n}\n!*/\n/* DOC\nDetects if audio can be downloaded in the background before it starts playing in the `` element\n*/\n\n Modernizr.addTest('audiopreload', 'preload' in createElement('audio'));\n\n/*!\n{\n \"name\": \"Background Position Shorthand\",\n \"property\": \"bgpositionshorthand\",\n \"tags\": [\"css\"],\n \"builderAliases\": [\"css_backgroundposition_shorthand\"],\n \"notes\": [{\n \"name\": \"MDN Docs\",\n \"href\": \"https://developer.mozilla.org/en/CSS/background-position\"\n }, {\n \"name\": \"W3 Spec\",\n \"href\": \"http://www.w3.org/TR/css3-background/#background-position\"\n }, {\n \"name\": \"Demo\",\n \"href\": \"http://jsfiddle.net/Blink/bBXvt/\"\n }]\n}\n!*/\n/* DOC\nDetects if you can use the shorthand method to define multiple parts of an\nelement's background-position simultaniously.\n\neg `background-position: right 10px bottom 10px`\n*/\n\n Modernizr.addTest('bgpositionshorthand', function() {\n var elem = createElement('a');\n var eStyle = elem.style;\n var val = 'right 10px bottom 10px';\n eStyle.cssText = 'background-position: ' + val + ';';\n return (eStyle.backgroundPosition === val);\n });\n\n/*!\n{\n \"name\": \"Canvas\",\n \"property\": \"canvas\",\n \"caniuse\": \"canvas\",\n \"tags\": [\"canvas\", \"graphics\"],\n \"polyfills\": [\"flashcanvas\", \"excanvas\", \"slcanvas\", \"fxcanvas\"]\n}\n!*/\n/* DOC\nDetects support for the `` element for 2D drawing.\n*/\n\n // On the S60 and BB Storm, getContext exists, but always returns undefined\n // so we actually have to call getContext() to verify\n // github.com/Modernizr/Modernizr/issues/issue/97/\n Modernizr.addTest('canvas', function() {\n var elem = createElement('canvas');\n return !!(elem.getContext && elem.getContext('2d'));\n });\n\n/*!\n{\n \"name\": \"Animated PNG\",\n \"async\": true,\n \"property\": \"apng\",\n \"tags\": [\"image\"],\n \"builderAliases\": [\"img_apng\"],\n \"notes\": [{\n \"name\": \"Wikipedia Article\",\n \"href\": \"http://en.wikipedia.org/wiki/APNG\"\n }]\n}\n!*/\n/* DOC\nTest for animated png support.\n*/\n\n Modernizr.addAsyncTest(function () {\n if (!Modernizr.canvas) {\n return false;\n }\n\n var image = new Image();\n var canvas = createElement('canvas');\n var ctx = canvas.getContext('2d');\n\n image.onload = function () {\n addTest('apng', function () {\n if (typeof canvas.getContext == 'undefined') {\n return false;\n }\n else {\n ctx.drawImage(image, 0, 0);\n return ctx.getImageData(0, 0, 1, 1).data[3] === 0;\n }\n });\n };\n\n image.src = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAACGFjVEwAAAABAAAAAcMq2TYAAAANSURBVAiZY2BgYPgPAAEEAQB9ssjfAAAAGmZjVEwAAAAAAAAAAQAAAAEAAAAAAAAAAAD6A+gBAbNU+2sAAAARZmRBVAAAAAEImWNgYGBgAAAABQAB6MzFdgAAAABJRU5ErkJggg==';\n });\n\n/*!\n{\n \"name\": \"Canvas text\",\n \"property\": \"canvastext\",\n \"caniuse\": \"canvas-text\",\n \"tags\": [\"canvas\", \"graphics\"],\n \"polyfills\": [\"canvastext\"]\n}\n!*/\n/* DOC\nDetects support for the text APIs for `` elements.\n*/\n\n Modernizr.addTest('canvastext', function() {\n if (Modernizr.canvas === false) return false;\n return typeof createElement('canvas').getContext('2d').fillText == 'function';\n });\n\n/*!\n{\n \"name\": \"canvas blending support\",\n \"property\": \"canvasblending\",\n \"tags\": [\"canvas\"],\n \"async\" : false,\n \"notes\": [{\n \"name\": \"HTML5 Spec\",\n \"href\": \"https://dvcs.w3.org/hg/FXTF/rawfile/tip/compositing/index.html#blending\"\n },\n {\n \"name\": \"Article\",\n \"href\": \"http://blogs.adobe.com/webplatform/2013/01/28/blending-features-in-canvas\"\n }]\n}\n!*/\n/* DOC\nDetects if Photoshop style blending modes are available in canvas.\n*/\n\n\n Modernizr.addTest('canvasblending', function() {\n if (Modernizr.canvas === false) return false;\n var ctx = createElement('canvas').getContext('2d');\n\n ctx.globalCompositeOperation = 'screen';\n return ctx.globalCompositeOperation === 'screen';\n });\n\n\n/*!\n{\n \"name\": \"canvas winding support\",\n \"property\": [\"canvaswinding\"],\n \"tags\": [\"canvas\"],\n \"async\" : false,\n \"notes\": [{\n \"name\": \"Article\",\n \"href\": \"http://blogs.adobe.com/webplatform/2013/01/30/winding-rules-in-canvas/\"\n }]\n}\n!*/\n/* DOC\nDetermines if winding rules, which controls if a path can go clockwise or counterclockwise\n*/\n\n\n Modernizr.addTest('canvaswinding', function() {\n if (Modernizr.canvas === false) return false;\n var ctx = createElement('canvas').getContext('2d');\n\n ctx.rect(0, 0, 10, 10);\n ctx.rect(2, 2, 6, 6);\n return ctx.isPointInPath(5, 5, 'evenodd') === false;\n });\n\n\n/*!\n{\n \"name\": \"canvas.toDataURL type support\",\n \"property\": [\"todataurljpeg\", \"todataurlpng\", \"todataurlwebp\"],\n \"tags\": [\"canvas\"],\n \"builderAliases\": [\"canvas_todataurl_type\"],\n \"async\" : false,\n \"notes\": [{\n \"name\": \"MDN article\",\n \"href\": \"https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement.toDataURL\"\n }]\n}\n!*/\n\n\n var canvas = createElement('canvas');\n\n Modernizr.addTest('todataurljpeg', function() {\n return !!Modernizr.canvas && canvas.toDataURL('image/jpeg').indexOf('data:image/jpeg') === 0;\n });\n Modernizr.addTest('todataurlpng', function() {\n return !!Modernizr.canvas && canvas.toDataURL('image/png').indexOf('data:image/png') === 0;\n });\n Modernizr.addTest('todataurlwebp', function() {\n return !!Modernizr.canvas && canvas.toDataURL('image/webp').indexOf('data:image/webp') === 0;\n });\n\n\n/*!\n{\n \"name\": \"Content Editable\",\n \"property\": \"contenteditable\",\n \"caniuse\": \"contenteditable\",\n \"notes\": [{\n \"name\": \"WHATWG spec\",\n \"href\": \"http://www.whatwg.org/specs/web-apps/current-work/multipage/editing.html#contenteditable\"\n }]\n}\n!*/\n/* DOC\nDetects support for the `contenteditable` attribute of elements, allowing their DOM text contents to be edited directly by the user.\n*/\n\n Modernizr.addTest('contenteditable', function() {\n // early bail out\n if (!('contentEditable' in docElement)) return;\n\n // some mobile browsers (android < 3.0, iOS < 5) claim to support\n // contentEditable, but but don't really. This test checks to see\n // confirms whether or not it actually supports it.\n\n var div = createElement('div');\n div.contentEditable = true;\n return div.contentEditable === 'true';\n });\n\n/*!\n{\n \"name\": \"createElement with Attributes\",\n \"property\": [\"createelementattrs\", \"createelement-attrs\"],\n \"tags\": [\"dom\"],\n \"builderAliases\": [\"dom_createElement_attrs\"],\n \"authors\": [\"James A. Rosen\"],\n \"notes\": [{\n \"name\": \"Related Github Issue\",\n \"href\": \"https://github.com/Modernizr/Modernizr/issues/258\"\n }]\n}\n!*/\n\n Modernizr.addTest('createelementattrs', function() {\n try {\n return createElement('').getAttribute('name') == 'test';\n } catch( e ) {\n return false;\n }\n }, {\n aliases: ['createelement-attrs']\n });\n\n/*!\n{\n \"name\": \"CSS Calc\",\n \"property\": \"csscalc\",\n \"caniuse\": \"calc\",\n \"tags\": [\"css\"],\n \"builderAliases\": [\"css_calc\"],\n \"authors\": [\"@calvein\"]\n}\n!*/\n/* DOC\nMethod of allowing calculated values for length units. For example:\n\n```css\n#elem {\n width: calc(100% - 3em);\n}\n```\n*/\n\n Modernizr.addTest('csscalc', function() {\n var prop = 'width:';\n var value = 'calc(10px);';\n var el = createElement('div');\n\n el.style.cssText = prop + prefixes.join(value + prop);\n\n return !!el.style.length;\n });\n\n/*!\n{\n \"name\": \"CSS Cubic Bezier Range\",\n \"property\": \"cubicbezierrange\",\n \"tags\": [\"css\"],\n \"builderAliases\": [\"css_cubicbezierrange\"],\n \"doc\" : null,\n \"authors\": [\"@calvein\"],\n \"warnings\": [\"cubic-bezier values can't be > 1 for Webkit until [bug #45761](https://bugs.webkit.org/show_bug.cgi?id=45761) is fixed\"],\n \"notes\": [{\n \"name\": \"Comprehensive Compat Chart\",\n \"href\": \"http://muddledramblings.com/table-of-css3-border-radius-compliance\"\n }]\n}\n!*/\n\n Modernizr.addTest('cubicbezierrange', function() {\n var el = createElement('div');\n el.style.cssText = prefixes.join('transition-timing-function:cubic-bezier(1,0,0,1.1); ');\n return !!el.style.length;\n });\n\n/*!\n{\n \"name\": \"CSS Filters\",\n \"property\": \"cssfilters\",\n \"caniuse\": \"css-filters\",\n \"polyfills\": [\"polyfilter\"],\n \"tags\": [\"css\"],\n \"builderAliases\": [\"css_filters\"],\n \"notes\": [{\n \"name\": \"MDN article on CSS filters\",\n \"href\": \"https://developer.mozilla.org/en-US/docs/Web/CSS/filter\"\n }]\n}\n!*/\n\n // https://github.com/Modernizr/Modernizr/issues/615\n // documentMode is needed for false positives in oldIE, please see issue above\n Modernizr.addTest('cssfilters', function() {\n var el = createElement('div');\n el.style.cssText = prefixes.join('filter:blur(2px); ');\n if (Modernizr.supports) {\n var supports = 'CSS' in window ?\n window.CSS.supports('filter', 'url()') :\n window.supportsCSS('filter', 'url()');\n\n // older firefox only supports `url` filters;\n return supports;\n } else {\n return !!el.style.length && ((document.documentMode === undefined || document.documentMode > 9));\n }\n });\n\n\n/*!\n{\n \"name\": \"CSS Font rem Units\",\n \"caniuse\": \"rem\",\n \"authors\": [\"nsfmc\"],\n \"property\": \"cssremunit\",\n \"tags\": [\"css\"],\n \"builderAliases\": [\"css_remunit\"],\n \"notes\": [{\n \"name\": \"W3C Spec\",\n \"href\": \"http://www.w3.org/TR/css3-values/#relative0\"\n },{\n \"name\": \"Font Size with rem by Jonathan Snook\",\n \"href\": \"http://snook.ca/archives/html_and_css/font-size-with-rem\"\n }]\n}\n!*/\n\n // \"The 'rem' unit ('root em') is relative to the computed\n // value of the 'font-size' value of the root element.\"\n // you can test by checking if the prop was ditched\n\n Modernizr.addTest('cssremunit', function() {\n var div = createElement('div');\n try {\n div.style.fontSize = '3rem';\n }\n catch( er ) {}\n return (/rem/).test(div.style.fontSize);\n });\n\n/*!\n{\n \"name\": \"CSS Gradients\",\n \"caniuse\": \"css-gradients\",\n \"property\": \"cssgradients\",\n \"tags\": [\"css\"],\n \"knownBugs\": [\"False-positives on webOS (https://github.com/Modernizr/Modernizr/issues/202)\"],\n \"notes\": [{\n \"name\": \"Webkit Gradient Syntax\",\n \"href\": \"http://webkit.org/blog/175/introducing-css-gradients/\"\n },{\n \"name\": \"Mozilla Linear Gradient Syntax\",\n \"href\": \"http://developer.mozilla.org/en/CSS/-moz-linear-gradient\"\n },{\n \"name\": \"Mozilla Radial Gradient Syntax\",\n \"href\": \"http://developer.mozilla.org/en/CSS/-moz-radial-gradient\"\n },{\n \"name\": \"W3C Gradient Spec\",\n \"href\": \"dev.w3.org/csswg/css3-images/#gradients-\"\n }]\n}\n!*/\n\n\n Modernizr.addTest('cssgradients', function() {\n\n var str1 = 'background-image:';\n var str2 = 'gradient(linear,left top,right bottom,from(#9f9),to(white));';\n var str3 = 'linear-gradient(left top,#9f9, white);';\n\n // standard syntax // trailing 'background-image:'\n var css = str1 + prefixes.join(str3 + str1).slice(0, -str1.length);\n if (Modernizr._config.usePrefixes) {\n // legacy webkit syntax (FIXME: remove when syntax not in use anymore)\n css += str1 + '-webkit-' + str2;\n }\n\n var elem = createElement('div');\n var style = elem.style;\n style.cssText = css;\n\n // IE6 returns undefined so cast to string\n return ('' + style.backgroundImage).indexOf('gradient') > -1;\n });\n\n/*!\n{\n \"name\": \"CSS Opacity\",\n \"caniuse\": \"css-opacity\",\n \"property\": \"opacity\",\n \"tags\": [\"css\"]\n}\n!*/\n\n // Browsers that actually have CSS Opacity implemented have done so\n // according to spec, which means their return values are within the\n // range of [0.0,1.0] - including the leading zero.\n\n Modernizr.addTest('opacity', function() {\n var elem = createElement('div');\n var style = elem.style;\n style.cssText = prefixes.join('opacity:.55;');\n\n // The non-literal . in this regex is intentional:\n // German Chrome returns this value as 0,55\n // github.com/Modernizr/Modernizr/issues/#issue/59/comment/516632\n return (/^0.55$/).test(style.opacity);\n });\n\n/*!\n{\n \"name\": \"CSS position: sticky\",\n \"property\": \"csspositionsticky\",\n \"tags\": [\"css\"],\n \"builderAliases\": [\"css_positionsticky\"],\n \"notes\": [{\n \"name\": \"Chrome bug report\",\n \"href\":\"https://code.google.com/p/chromium/issues/detail?id=322972\"\n }],\n \"warnings\": [ \"using position:sticky on anything but top aligned elements is buggy in Chrome < 37 and iOS <=7+\" ]\n}\n!*/\n\n // Sticky positioning - constrains an element to be positioned inside the\n // intersection of its container box, and the viewport.\n Modernizr.addTest('csspositionsticky', function() {\n var prop = 'position:';\n var value = 'sticky';\n var el = createElement('modernizr');\n var mStyle = el.style;\n\n mStyle.cssText = prop + prefixes.join(value + ';' + prop).slice(0, -prop.length);\n\n return mStyle.position.indexOf(value) !== -1;\n });\n\n/*!\n{\n \"name\": \"CSS Multiple Backgrounds\",\n \"caniuse\": \"multibackgrounds\",\n \"property\": \"multiplebgs\",\n \"tags\": [\"css\"]\n}\n!*/\n\n // Setting multiple images AND a color on the background shorthand property\n // and then querying the style.background property value for the number of\n // occurrences of \"url(\" is a reliable method for detecting ACTUAL support for this!\n\n Modernizr.addTest('multiplebgs', function() {\n var elem = createElement('div');\n var style = elem.style;\n style.cssText = 'background:url(https://),url(https://),red url(https://)';\n\n // If the UA supports multiple backgrounds, there should be three occurrences\n // of the string \"url(\" in the return value for elemStyle.background\n return (/(url\\s*\\(.*?){3}/).test(style.background);\n });\n\n/*!\n{\n \"name\": \"CSS Pointer Events\",\n \"caniuse\": \"pointer-events\",\n \"property\": \"csspointerevents\",\n \"authors\": [\"ausi\"],\n \"tags\": [\"css\"],\n \"builderAliases\": [\"css_pointerevents\"],\n \"notes\": [\n {\n \"name\": \"MDN Docs\",\n \"href\": \"http://developer.mozilla.org/en/CSS/pointer-events\"\n },{\n \"name\": \"Test Project Page\",\n \"href\": \"http://ausi.github.com/Feature-detection-technique-for-pointer-events/\"\n },{\n \"name\": \"Test Project Wiki\",\n \"href\": \"http://github.com/ausi/Feature-detection-technique-for-pointer-events/wiki\"\n },\n {\n \"name\": \"Related Github Issue\",\n \"href\": \"http://github.com/Modernizr/Modernizr/issues/80\"\n }\n ]\n}\n!*/\n\n Modernizr.addTest('csspointerevents', function() {\n var element = createElement('x');\n element.style.cssText = 'pointer-events:auto';\n return element.style.pointerEvents === 'auto';\n });\n\n/*!\n{\n \"name\": \"CSS Regions\",\n \"caniuse\": \"css-regions\",\n \"authors\": [\"Mihai Balan\"],\n \"property\": \"regions\",\n \"tags\": [\"css\"],\n \"builderAliases\": [\"css_regions\"],\n \"notes\": [{\n \"name\": \"W3C Specification\",\n \"href\": \"http://www.w3.org/TR/css3-regions/\"\n }]\n}\n!*/\n\n // We start with a CSS parser test then we check page geometry to see if it's affected by regions\n // Later we might be able to retire the second part, as WebKit builds with the false positives die out\n\n Modernizr.addTest('regions', function() {\n\n /* Get the 'flowFrom' property name available in the browser. Either default or vendor prefixed.\n If the property name can't be found we'll get Boolean 'false' and fail quickly */\n var flowFromProperty = Modernizr.prefixed('flowFrom');\n var flowIntoProperty = Modernizr.prefixed('flowInto');\n var result = false;\n\n if (!flowFromProperty || !flowIntoProperty){\n return result;\n }\n\n /* If CSS parsing is there, try to determine if regions actually work. */\n var iframeContainer = createElement('iframe');\n var container = createElement('div');\n var content = createElement('div');\n var region = createElement('div');\n\n /* we create a random, unlikely to be generated flow number to make sure we don't\n clash with anything more vanilla, like 'flow', or 'article', or 'f1' */\n var flowName = 'modernizr_flow_for_regions_check';\n\n /* First create a div with two adjacent divs inside it. The first will be the\n content, the second will be the region. To be able to distinguish between the two,\n we'll give the region a particular padding */\n content.innerText = 'M';\n container.style.cssText = 'top: 150px; left: 150px; padding: 0px;';\n region.style.cssText = 'width: 50px; height: 50px; padding: 42px;';\n\n region.style[flowFromProperty] = flowName;\n container.appendChild(content);\n container.appendChild(region);\n docElement.appendChild(container);\n\n /* Now compute the bounding client rect, before and after attempting to flow the\n content div in the region div. If regions are enabled, the after bounding rect\n should reflect the padding of the region div.*/\n var flowedRect, delta;\n var plainRect = content.getBoundingClientRect();\n\n\n content.style[flowIntoProperty] = flowName;\n flowedRect = content.getBoundingClientRect();\n\n delta = parseInt(flowedRect.left - plainRect.left, 10);\n docElement.removeChild(container);\n\n if (delta == 42) {\n result = true;\n } else {\n /* IE only allows for the content to come from iframes. This has the\n * side effect of automatic collapsing of iframes once they get the flow-into\n * property set. checking for a change on the height allows us to detect this\n * in a sync way, without having to wait for a frame to load */\n\n docElement.appendChild(iframeContainer);\n plainRect = iframeContainer.getBoundingClientRect();\n iframeContainer.style[flowIntoProperty] = flowName;\n flowedRect = iframeContainer.getBoundingClientRect();\n\n if (plainRect.height > 0 && plainRect.height !== flowedRect.height && flowedRect.height === 0) {\n result = true;\n }\n }\n\n content = region = container = iframeContainer = undefined;\n\n return result;\n });\n\n/*!\n{\n \"name\": \"CSS rgba\",\n \"caniuse\": \"css3-colors\",\n \"property\": \"rgba\",\n \"tags\": [\"css\"],\n \"notes\": [{\n \"name\": \"CSSTricks Tutorial\",\n \"href\": \"http://css-tricks.com/rgba-browser-support/\"\n }]\n}\n!*/\n\n Modernizr.addTest('rgba', function() {\n var elem = createElement('div');\n var style = elem.style;\n style.cssText = 'background-color:rgba(150,255,150,.5)';\n\n return ('' + style.backgroundColor).indexOf('rgba') > -1;\n });\n\n/*!\n{\n \"name\": \"dataset API\",\n \"caniuse\": \"dataset\",\n \"property\": \"dataset\",\n \"tags\": [\"dom\"],\n \"builderAliases\": [\"dom_dataset\"],\n \"authors\": [\"@phiggins42\"]\n}\n!*/\n\n // dataset API for data-* attributes\n Modernizr.addTest('dataset', function() {\n var n = createElement('div');\n n.setAttribute('data-a-b', 'c');\n return !!(n.dataset && n.dataset.aB === 'c');\n });\n\n/*!\n{\n \"name\": \"Drag & Drop\",\n \"property\": \"draganddrop\",\n \"caniuse\": \"dragndrop\",\n \"knownBugs\": [\"Mobile browsers like Android, iOS < 6, and Firefox OS technically support the APIs, but don't expose it to the end user, resulting in a false positive.\"],\n \"notes\": [{\n \"name\": \"W3C spec\",\n \"href\": \"http://www.w3.org/TR/2010/WD-html5-20101019/dnd.html\"\n }],\n \"polyfills\": [\"dropfile\", \"moxie\", \"fileapi\"]\n}\n!*/\n/* DOC\nDetects support for native drag & drop of elements.\n*/\n\n Modernizr.addTest('draganddrop', function() {\n var div = createElement('div');\n return ('draggable' in div) || ('ondragstart' in div && 'ondrop' in div);\n });\n\n/*!\n{\n \"name\": \"Emoji\",\n \"property\": \"emoji\"\n}\n!*/\n/* DOC\nDetects support for emoji character sets.\n*/\n\n Modernizr.addTest('emoji', function() {\n if (!Modernizr.canvastext) return false;\n var pixelRatio = window.devicePixelRatio || 1;\n var offset = 12 * pixelRatio;\n var node = createElement('canvas');\n var ctx = node.getContext('2d');\n ctx.fillStyle = '#f00';\n ctx.textBaseline = 'top';\n ctx.font = '32px Arial';\n ctx.fillText('\\ud83d\\udc28', 0, 0); // U+1F428 KOALA\n return ctx.getImageData(offset, offset, 1, 1).data[0] !== 0;\n });\n\n/*!\n{\n \"name\" : \"HTML5 Audio Element\",\n \"property\": \"audio\",\n \"tags\" : [\"html5\", \"audio\", \"media\"]\n}\n!*/\n/* DOC\nDetects the audio element\n*/\n\n // This tests evaluates support of the audio element, as well as\n // testing what types of content it supports.\n //\n // We're using the Boolean constructor here, so that we can extend the value\n // e.g. Modernizr.audio // true\n // Modernizr.audio.ogg // 'probably'\n //\n // Codec values from : github.com/NielsLeenheer/html5test/blob/9106a8/index.html#L845\n // thx to NielsLeenheer and zcorpan\n\n // Note: in some older browsers, \"no\" was a return value instead of empty string.\n // It was live in FF3.5.0 and 3.5.1, but fixed in 3.5.2\n // It was also live in Safari 4.0.0 - 4.0.4, but fixed in 4.0.5\n Modernizr.addTest('audio', function() {\n /* jshint -W053 */\n var elem = createElement('audio');\n var bool = false;\n\n try {\n if ( bool = !!elem.canPlayType ) {\n bool = new Boolean(bool);\n bool.ogg = elem.canPlayType('audio/ogg; codecs=\"vorbis\"').replace(/^no$/,'');\n bool.mp3 = elem.canPlayType('audio/mpeg;') .replace(/^no$/,'');\n bool.opus = elem.canPlayType('audio/ogg; codecs=\"opus\"') .replace(/^no$/,'');\n\n // Mimetypes accepted:\n // developer.mozilla.org/En/Media_formats_supported_by_the_audio_and_video_elements\n // bit.ly/iphoneoscodecs\n bool.wav = elem.canPlayType('audio/wav; codecs=\"1\"') .replace(/^no$/,'');\n bool.m4a = ( elem.canPlayType('audio/x-m4a;') ||\n elem.canPlayType('audio/aac;')) .replace(/^no$/,'');\n }\n } catch(e) { }\n\n return bool;\n });\n\n/*!\n{\n \"name\": \"HTML5 Video\",\n \"property\": \"video\",\n \"caniuse\": \"video\",\n \"tags\": [\"html5\"],\n \"knownBugs\": [\n \"Without QuickTime, `Modernizr.video.h264` will be `undefined`; http://github.com/Modernizr/Modernizr/issues/546\"\n ],\n \"polyfills\": [\n \"html5media\",\n \"mediaelementjs\",\n \"sublimevideo\",\n \"videojs\",\n \"leanbackplayer\",\n \"videoforeverybody\"\n ]\n}\n!*/\n/* DOC\nDetects support for the video element, as well as testing what types of content it supports.\n\nSubproperties are provided to describe support for `ogg`, `h264` and `webm` formats, e.g.:\n\n```javascript\nModernizr.video // true\nModernizr.video.ogg // 'probably'\n```\n*/\n\n // Codec values from : github.com/NielsLeenheer/html5test/blob/9106a8/index.html#L845\n // thx to NielsLeenheer and zcorpan\n\n // Note: in some older browsers, \"no\" was a return value instead of empty string.\n // It was live in FF3.5.0 and 3.5.1, but fixed in 3.5.2\n // It was also live in Safari 4.0.0 - 4.0.4, but fixed in 4.0.5\n\n Modernizr.addTest('video', function() {\n /* jshint -W053 */\n var elem = createElement('video');\n var bool = false;\n\n // IE9 Running on Windows Server SKU can cause an exception to be thrown, bug #224\n try {\n if ( bool = !!elem.canPlayType ) {\n bool = new Boolean(bool);\n bool.ogg = elem.canPlayType('video/ogg; codecs=\"theora\"').replace(/^no$/,'');\n\n // Without QuickTime, this value will be `undefined`. github.com/Modernizr/Modernizr/issues/546\n bool.h264 = elem.canPlayType('video/mp4; codecs=\"avc1.42E01E\"').replace(/^no$/,'');\n\n bool.webm = elem.canPlayType('video/webm; codecs=\"vp8, vorbis\"').replace(/^no$/,'');\n\n bool.vp9 = elem.canPlayType('video/webm; codecs=\"vp9\"').replace(/^no$/,'');\n\n bool.hls = elem.canPlayType('application/x-mpegURL; codecs=\"avc1.42E01E\"').replace(/^no$/,'');\n }\n } catch(e){}\n\n return bool;\n });\n\n/*!\n{\n \"name\": \"IE User Data API\",\n \"property\": \"userdata\",\n \"tags\": [\"storage\"],\n \"authors\": [\"@stereobooster\"],\n \"notes\": [{\n \"name\": \"MSDN Documentation\",\n \"href\": \"http://msdn.microsoft.com/en-us/library/ms531424(v=vs.85).aspx\"\n }]\n}\n!*/\n/* DOC\nDetects support for IE userData for persisting data, an API similar to localStorage but supported since IE5.\n*/\n\n Modernizr.addTest('userdata', !!createElement('div').addBehavior);\n\n/*!\n{\n \"name\": \"iframe[sandbox] Attribute\",\n \"property\": \"sandbox\",\n \"tags\": [\"iframe\"],\n \"builderAliases\": [\"iframe_sandbox\"],\n \"notes\": [\n {\n \"name\": \"WhatWG Spec\",\n \"href\": \"http://www.whatwg.org/specs/web-apps/current-work/multipage/the-iframe-element.html#attr-iframe-sandbox\"\n }],\n \"knownBugs\": [ \"False-positive on Firefox < 29\" ]\n}\n!*/\n/* DOC\nTest for `sandbox` attribute in iframes.\n*/\n\n Modernizr.addTest('sandbox', 'sandbox' in createElement('iframe'));\n\n/*!\n{\n \"name\": \"iframe[seamless] Attribute\",\n \"property\": \"seamless\",\n \"tags\": [\"iframe\"],\n \"builderAliases\": [\"iframe_seamless\"],\n \"notes\": [{\n \"name\": \"WhatWG Spec\",\n \"href\": \"http://www.whatwg.org/specs/web-apps/current-work/multipage/the-iframe-element.html#attr-iframe-seamless\"\n }]\n}\n!*/\n/* DOC\nTest for `seamless` attribute in iframes.\n*/\n\n Modernizr.addTest('seamless', 'seamless' in createElement('iframe'));\n\n/*!\n{\n \"name\": \"iframe[srcdoc] Attribute\",\n \"property\": \"srcdoc\",\n \"tags\": [\"iframe\"],\n \"builderAliases\": [\"iframe_srcdoc\"],\n \"notes\": [{\n \"name\": \"WhatWG Spec\",\n \"href\": \"http://www.whatwg.org/specs/web-apps/current-work/multipage/the-iframe-element.html#attr-iframe-srcdoc\"\n }]\n}\n!*/\n/* DOC\nTest for `srcdoc` attribute in iframes.\n*/\n\n Modernizr.addTest('srcdoc', 'srcdoc' in createElement('iframe'));\n\n/*!\n{\n \"name\": \"Inline SVG\",\n \"property\": \"inlinesvg\",\n \"caniuse\": \"svg-html5\",\n \"tags\": [\"svg\"],\n \"notes\": [{\n \"name\": \"Test page\",\n \"href\": \"http://paulirish.com/demo/inline-svg\"\n }],\n \"polyfills\": [\"inline-svg-polyfill\"]\n}\n!*/\n/* DOC\nDetects support for inline SVG in HTML (not within XHTML).\n*/\n\n Modernizr.addTest('inlinesvg', function() {\n var div = createElement('div');\n div.innerHTML = '';\n return (div.firstChild && div.firstChild.namespaceURI) == 'http://www.w3.org/2000/svg';\n });\n\n/*!\n{\n \"name\": \"input formenctype\",\n \"property\": \"inputformenctype\",\n \"aliases\": [\"input-formenctype\"],\n \"notes\": [{\n \"name\": \"WHATWG Spec\",\n \"href\": \"http://www.whatwg.org/specs/web-apps/current-work/multipage/association-of-controls-and-forms.html#attr-fs-formenctype\"\n }, {\n \"name\": \"Wufoo demo\",\n \"href\": \"http://www.wufoo.com/html5/attributes/16-formenctype.html\"\n }],\n \"polyfills\": [\n \"html5formshim\"\n ]\n}\n!*/\n/* DOC\nDetect support for the formenctype attribute on form inputs, which overrides the form enctype attribute\n*/\n\n Modernizr.addTest('inputformenctype', !!('formEnctype' in createElement('input')), { aliases: ['input-formenctype'] });\n\n/*!\n{\n \"name\": \"input formaction\",\n \"property\": \"inputformaction\",\n \"aliases\": [\"input-formaction\"],\n \"notes\": [{\n \"name\": \"WHATWG Spec\",\n \"href\": \"http://www.whatwg.org/specs/web-apps/current-work/multipage/association-of-controls-and-forms.html#attr-fs-formaction\"\n }, {\n \"name\": \"Wufoo demo\",\n \"href\": \"http://www.wufoo.com/html5/attributes/13-formaction.html\"\n }],\n \"polyfills\": [\n \"webshims\"\n ]\n}\n!*/\n/* DOC\nDetect support for the formaction attribute on form inputs\n*/\n\n Modernizr.addTest('inputformaction', !!('formAction' in createElement('input')), { aliases: ['input-formaction'] });\n\n/*!\n{\n \"name\": \"input formmethod\",\n \"property\": \"inputformmethod\",\n \"notes\": [{\n \"name\": \"WHATWG Spec\",\n \"href\": \"http://www.whatwg.org/specs/web-apps/current-work/multipage/association-of-controls-and-forms.html#attr-fs-formmethod\"\n }, {\n \"name\": \"Wufoo demo\",\n \"href\": \"http://www.wufoo.com/html5/attributes/14-formmethod.html\"\n }],\n \"polyfills\": [\n \"webshims\"\n ]\n}\n!*/\n/* DOC\nDetect support for the formmethod attribute on form inputs\n*/\n\n Modernizr.addTest('inputformmethod', !!('formMethod' in createElement('input')));\n\n/*!\n{\n \"name\": \"input formtarget\",\n \"property\": \"inputformtarget\",\n \"aliases\": [\"input-formtarget\"],\n \"notes\": [{\n \"name\": \"WHATWG Spec\",\n \"href\": \"http://www.whatwg.org/specs/web-apps/current-work/multipage/association-of-controls-and-forms.html#attr-fs-formtarget\"\n }, {\n \"name\": \"Wufoo demo\",\n \"href\": \"http://www.wufoo.com/html5/attributes/15-formtarget.html\"\n }],\n \"polyfills\": [\n \"html5formshim\"\n ]\n}\n!*/\n/* DOC\nDetect support for the formtarget attribute on form inputs, which overrides the form target attribute\n*/\n\n Modernizr.addTest('inputformtarget', !!('formtarget' in createElement('input')), { aliases: ['input-formtarget'] });\n\n/*!\n{\n \"name\": \"input[file] Attribute\",\n \"property\": \"fileinput\",\n \"caniuse\" : \"forms\",\n \"tags\": [\"file\", \"forms\", \"input\"],\n \"builderAliases\": [\"forms_fileinput\"]\n}\n!*/\n/* DOC\nDetects whether input type=\"file\" is available on the platform\n\nE.g. iOS < 6 and some android version don't support this\n*/\n\n Modernizr.addTest('fileinput', function() {\n if(navigator.userAgent.match(/(Android (1.0|1.1|1.5|1.6|2.0|2.1))|(Windows Phone (OS 7|8.0))|(XBLWP)|(ZuneWP)|(w(eb)?OSBrowser)|(webOS)|(Kindle\\/(1.0|2.0|2.5|3.0))/)) {\n return false;\n }\n var elem = createElement('input');\n elem.type = 'file';\n return !elem.disabled;\n });\n\n/*!\n{\n \"name\": \"input[directory] Attribute\",\n \"property\": \"directory\",\n \"authors\": [\"silverwind\"],\n \"tags\": [\"file\", \"input\", \"attribute\"]\n}\n!*/\n/* DOC\nWhen used on an ``, the `directory` attribute instructs\nthe user agent to present a directory selection dialog instead of the usual\nfile selection dialog.\n*/\n\n Modernizr.addTest('fileinputdirectory', function() {\n var elem = createElement('input'), dir = 'directory';\n elem.type = 'file';\n if (dir in elem) {\n return true;\n } else {\n for (var i = 0, len = domPrefixes.length; i < len; i++) {\n if (domPrefixes[i] + dir in elem) {\n return true;\n }\n }\n }\n return false;\n });\n\n/*!\n{\n \"name\": \"input[form] Attribute\",\n \"property\": \"formattribute\",\n \"tags\": [\"attribute\", \"forms\", \"input\"],\n \"builderAliases\": [\"forms_formattribute\"]\n}\n!*/\n/* DOC\nDetects whether input form=\"form_id\" is available on the platform\nE.g. IE 10 (and below), don't support this\n*/\n\n\n Modernizr.addTest('formattribute', function() {\n var form = createElement('form');\n var input = createElement('input');\n var div = createElement('div');\n var id = 'formtest' + (new Date()).getTime();\n var attr;\n var bool = false;\n\n form.id = id;\n\n //IE6/7 confuses the form idl attribute and the form content attribute, so we use document.createAttribute\n try {\n input.setAttribute('form', id);\n }\n catch( e ) {\n if( document.createAttribute ) {\n attr = document.createAttribute('form');\n attr.nodeValue = id;\n input.setAttributeNode(attr);\n }\n }\n\n div.appendChild(form);\n div.appendChild(input);\n\n docElement.appendChild(div);\n\n bool = form.elements.length === 1 && input.form == form;\n\n div.parentNode.removeChild(div);\n return bool;\n });\n\n/*!\n{\n \"name\": \"input[capture] Attribute\",\n \"property\": \"capture\",\n \"tags\": [\"video\", \"image\", \"audio\", \"media\", \"attribute\"],\n \"notes\": [{\n \"name\": \"W3C draft: HTML Media Capture\",\n \"href\": \"http://www.w3.org/TR/html-media-capture/\"\n }]\n}\n!*/\n/* DOC\nWhen used on an ``, this attribute signifies that the resource it takes should be generated via device's camera, camcorder, sound recorder.\n*/\n\n // testing for capture attribute in inputs\n Modernizr.addTest('capture', ('capture' in createElement('input')));\n\n/*!\n{\n \"name\": \"output Element\",\n \"property\": \"outputelem\",\n \"tags\": [\"elem\"],\n \"builderAliases\": [\"elem_output\"],\n \"notes\": [{\n \"name\": \"WhatWG Spec\",\n \"href\": \"http://www.whatwg.org/specs/web-apps/current-work/multipage/the-button-element.html#the-output-element\"\n }]\n}\n!*/\n\n Modernizr.addTest('outputelem', 'value' in createElement('output'));\n\n/*!\n{\n \"name\": \"placeholder attribute\",\n \"property\": \"placeholder\",\n \"tags\": [\"forms\", \"attribute\"],\n \"builderAliases\": [\"forms_placeholder\"]\n}\n!*/\n/* DOC\nTests for placeholder attribute in inputs and textareas\n*/\n\n Modernizr.addTest('placeholder', ('placeholder' in createElement('input') && 'placeholder' in createElement('textarea')));\n\n/*!\n{\n \"name\": \"progress Element\",\n \"caniuse\": \"progressmeter\",\n \"property\": [\"progressbar\", \"meter\"],\n \"tags\": [\"elem\"],\n \"builderAliases\": [\"elem_progress_meter\"],\n \"authors\": [\"Stefan Wallin\"]\n}\n!*/\n\n // Tests for progressbar-support. All browsers that don't support progressbar returns undefined =)\n Modernizr.addTest('progressbar', createElement('progress').max !== undefined);\n\n // Tests for meter-support. All browsers that don't support meters returns undefined =)\n Modernizr.addTest('meter', createElement('meter').max !== undefined);\n\n/*!\n{\n \"name\": \"Reverse Ordered Lists\",\n \"property\": \"olreversed\",\n \"notes\": [{\n \"name\": \"Impressive Webs article\",\n \"href\": \"http://impressivewebs.com/reverse-ordered-lists-html5\"\n }],\n \"builderAliases\": [\"lists_reversed\"]\n}\n!*/\n/* DOC\nDetects support for the `reversed` attribute on the `` element.\n*/\n\n Modernizr.addTest('olreversed', 'reversed' in createElement('ol'));\n\n/*!\n{\n \"name\": \"ruby, rp, rt Elements\",\n \"caniuse\": \"ruby\",\n \"property\": \"ruby\",\n \"tags\": [\"elem\"],\n \"builderAliases\": [\"elem_ruby\"],\n \"authors\": [\"Cătălin Mariș\"],\n \"notes\": [{\n \"name\": \"WHATWG Specification\",\n \"href\": \"http://www.whatwg.org/specs/web-apps/current-work/multipage/text-level-semantics.html#the-ruby-element\"\n }]\n}\n!*/\n\n Modernizr.addTest('ruby', function () {\n\n var ruby = createElement('ruby');\n var rt = createElement('rt');\n var rp = createElement('rp');\n var displayStyleProperty = 'display';\n // 'fontSize' - because it`s only used for IE6 and IE7\n var fontSizeStyleProperty = 'fontSize';\n\n ruby.appendChild(rp);\n ruby.appendChild(rt);\n docElement.appendChild(ruby);\n\n // browsers that support hide the via \"display:none\"\n if ( getStyle(rp, displayStyleProperty) == 'none' || // for non-IE browsers\n // but in IE browsers has \"display:inline\" so, the test needs other conditions:\n getStyle(ruby, displayStyleProperty) == 'ruby' && getStyle(rt, displayStyleProperty) == 'ruby-text' || // for IE8+\n getStyle(rp, fontSizeStyleProperty) == '6pt' && getStyle(rt, fontSizeStyleProperty) == '6pt' ) { // for IE6 & IE7\n\n cleanUp();\n return true;\n\n } else {\n cleanUp();\n return false;\n }\n\n function getStyle( element, styleProperty ) {\n var result;\n\n if ( window.getComputedStyle ) { // for non-IE browsers\n result = document.defaultView.getComputedStyle(element,null).getPropertyValue(styleProperty);\n } else if ( element.currentStyle ) { // for IE\n result = element.currentStyle[styleProperty];\n }\n\n return result;\n }\n\n function cleanUp() {\n docElement.removeChild(ruby);\n // the removed child node still exists in memory, so ...\n ruby = null;\n rt = null;\n rp = null;\n }\n\n });\n\n\n/*!\n{\n \"name\": \"script[async]\",\n \"property\": \"scriptasync\",\n \"caniuse\": \"script-async\",\n \"tags\": [\"script\"],\n \"builderAliases\": [\"script_async\"],\n \"authors\": [\"Theodoor van Donge\"]\n}\n!*/\n/* DOC\nDetects support for the `async` attribute on the `
{{author}}
Called {{i}} times
{{props.title}}
by {{byline}}
Hello world
by Yehuda Katz
Goodbye world