ember-source 1.0.0.rc3.5 → 1.0.0.rc4
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of ember-source might be problematic. Click here for more details.
- data/VERSION +1 -0
- data/dist/ember-data-deps.js +1947 -1299
- data/dist/ember-data-deps.min.js +6 -5
- data/dist/ember-data-deps.prod.js +1945 -1297
- data/dist/ember-debug.js +2 -2
- data/dist/ember-old-router.js +2066 -1375
- data/dist/ember-old-router.min.js +9 -8
- data/dist/ember-old-router.prod.js +2069 -1379
- data/dist/ember-runtime.js +1947 -1299
- data/dist/ember-runtime.min.js +5 -5
- data/dist/ember-runtime.prod.js +1945 -1297
- data/dist/ember-spade.js +13 -6
- data/dist/ember-template-compiler.js +20 -4
- data/dist/ember-template-compiler.min.js +3 -3
- data/dist/ember-template-compiler.prod.js +18 -2
- data/dist/ember-tests.js +1 -1
- data/dist/ember.js +2980 -1618
- data/dist/ember.min.js +9 -9
- data/dist/ember.prod.js +2968 -1608
- data/lib/ember/source.rb +2 -0
- data/lib/ember/version.rb +3 -0
- metadata +6 -13
- data/dist/ember-1.0.0-rc.3.1.js +0 -28566
- data/dist/ember-1.0.0-rc.3.1.min.js +0 -21
- data/dist/ember-1.0.0-rc.3.1.prod.js +0 -28360
data/dist/ember-data-deps.min.js
CHANGED
@@ -8,10 +8,11 @@
|
|
8
8
|
// ==========================================================================
|
9
9
|
|
10
10
|
|
11
|
-
// Version: v1.0.0-
|
12
|
-
// Last commit:
|
11
|
+
// Version: v1.0.0-rc4
|
12
|
+
// Last commit: ae2e55f (2013-05-27 19:34:11 -0400)
|
13
13
|
|
14
14
|
|
15
|
-
(function(){var e,t;(function(){var r={},n={};e=function(e,t,n){r[e]={deps:t,callback:n}},t=function(e){if(n[e])return n[e];n[e]={};for(var i,o=r[e],s=o.deps,a=o.callback,u=[],c=0,h=s.length;h>c;c++)"exports"===s[c]?u.push(i={}):u.push(t(s[c]));var l=a.apply(this,u);return n[e]=i||l}})(),function(){function e(e){return t.console&&t.console[e]?t.console[e].apply?function(){t.console[e].apply(t.console,arguments)}:function(){var r=Array.prototype.join.call(arguments,", ");t.console[e](r)}:void 0}"undefined"==typeof Ember&&(Ember={});var t=Ember.imports=Ember.imports||this,r=Ember.exports=Ember.exports||this;Ember.lookup=Ember.lookup||this,r.Em=r.Ember=Em=Ember,Ember.isNamespace=!0,Ember.toString=function(){return"Ember"},Ember.VERSION="1.0.0-rc.3",Ember.ENV=Ember.ENV||("undefined"==typeof ENV?{}:ENV),Ember.config=Ember.config||{},Ember.EXTEND_PROTOTYPES=Ember.ENV.EXTEND_PROTOTYPES,"undefined"==typeof Ember.EXTEND_PROTOTYPES&&(Ember.EXTEND_PROTOTYPES=!0),Ember.LOG_STACKTRACE_ON_DEPRECATION=Ember.ENV.LOG_STACKTRACE_ON_DEPRECATION!==!1,Ember.SHIM_ES5=Ember.ENV.SHIM_ES5===!1?!1:Ember.EXTEND_PROTOTYPES,Ember.LOG_VERSION=Ember.ENV.LOG_VERSION===!1?!1:!0,Ember.K=function(){return this},"undefined"==typeof Ember.assert&&(Ember.assert=Ember.K),"undefined"==typeof Ember.warn&&(Ember.warn=Ember.K),"undefined"==typeof Ember.debug&&(Ember.debug=Ember.K),"undefined"==typeof Ember.deprecate&&(Ember.deprecate=Ember.K),"undefined"==typeof Ember.deprecateFunc&&(Ember.deprecateFunc=function(e,t){return t}),Ember.uuid=0,Ember.Logger={log:e("log")||Ember.K,warn:e("warn")||Ember.K,error:e("error")||Ember.K,info:e("info")||Ember.K,debug:e("debug")||e("info")||Ember.K},Ember.onerror=null,Ember.handleErrors=function(e,t){if("function"!=typeof Ember.onerror)return e.call(t||this);try{return e.call(t||this)}catch(r){Ember.onerror(r)}},Ember.merge=function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);return e},Ember.isNone=function(e){return null===e||void 0===e},Ember.none=Ember.deprecateFunc("Ember.none is deprecated. Please use Ember.isNone instead.",Ember.isNone),Ember.isEmpty=function(e){return null===e||void 0===e||0===e.length&&"function"!=typeof e||"object"==typeof e&&0===Ember.get(e,"length")},Ember.empty=Ember.deprecateFunc("Ember.empty is deprecated. Please use Ember.isEmpty instead.",Ember.isEmpty)}(),function(){var e=Ember.platform={};if(Ember.create=Object.create,!Ember.create||Ember.ENV.STUB_OBJECT_CREATE){var t=function(){};Ember.create=function(e,r){if(t.prototype=e,e=new t,r){t.prototype=e;for(var n in r)t.prototype[n]=r[n].value;e=new t}return t.prototype=null,e},Ember.create.isSimulated=!0}var r,n,i=Object.defineProperty;if(i)try{i({},"a",{get:function(){}})}catch(o){i=null}i&&(r=function(){var e={};return i(e,"a",{configurable:!0,enumerable:!0,get:function(){},set:function(){}}),i(e,"a",{configurable:!0,enumerable:!0,writable:!0,value:!0}),e.a===!0}(),n=function(){try{return i(document.createElement("div"),"definePropertyOnDOM",{}),!0}catch(e){}return!1}(),r?n||(i=function(e,t,r){var n;return n="object"==typeof Node?e instanceof Node:"object"==typeof e&&"number"==typeof e.nodeType&&"string"==typeof e.nodeName,n?e[t]=r.value:Object.defineProperty(e,t,r)}):i=null),e.defineProperty=i,e.hasPropertyAccessors=!0,e.defineProperty||(e.hasPropertyAccessors=!1,e.defineProperty=function(e,t,r){r.get||(e[t]=r.value)},e.defineProperty.isSimulated=!0),Ember.ENV.MANDATORY_SETTER&&!e.hasPropertyAccessors&&(Ember.ENV.MANDATORY_SETTER=!1)}(),function(){var e=function(e){return e&&Function.prototype.toString.call(e).indexOf("[native code]")>-1},t=e(Array.prototype.map)?Array.prototype.map:function(e){if(void 0===this||null===this)throw new TypeError;var t=Object(this),r=t.length>>>0;if("function"!=typeof e)throw new TypeError;for(var n=new Array(r),i=arguments[1],o=0;r>o;o++)o in t&&(n[o]=e.call(i,t[o],o,t));return n},r=e(Array.prototype.forEach)?Array.prototype.forEach:function(e){if(void 0===this||null===this)throw new TypeError;var t=Object(this),r=t.length>>>0;if("function"!=typeof e)throw new TypeError;for(var n=arguments[1],i=0;r>i;i++)i in t&&e.call(n,t[i],i,t)},n=e(Array.prototype.indexOf)?Array.prototype.indexOf:function(e,t){null===t||void 0===t?t=0:0>t&&(t=Math.max(0,this.length+t));for(var r=t,n=this.length;n>r;r++)if(this[r]===e)return r;return-1};Ember.ArrayPolyfills={map:t,forEach:r,indexOf:n},Ember.SHIM_ES5&&(Array.prototype.map||(Array.prototype.map=t),Array.prototype.forEach||(Array.prototype.forEach=r),Array.prototype.indexOf||(Array.prototype.indexOf=n))}(),function(){function e(e){this.descs={},this.watching={},this.cache={},this.source=e}function t(e,t){return!(!e||"function"!=typeof e[t])}var r=Ember.platform.defineProperty,n=Ember.create,i="__ember"+ +new Date,o=0,s=[],a={},u=Ember.ENV.MANDATORY_SETTER;Ember.GUID_KEY=i;var c={writable:!1,configurable:!1,enumerable:!1,value:null};Ember.generateGuid=function(e,t){t||(t="ember");var n=t+o++;return e&&(c.value=n,r(e,i,c)),n},Ember.guidFor=function(e){if(void 0===e)return"(undefined)";if(null===e)return"(null)";var t,n=typeof e;switch(n){case"number":return t=s[e],t||(t=s[e]="nu"+e),t;case"string":return t=a[e],t||(t=a[e]="st"+o++),t;case"boolean":return e?"(true)":"(false)";default:return e[i]?e[i]:e===Object?"(Object)":e===Array?"(Array)":(t="ember"+o++,c.value=t,r(e,i,c),t)}};var h={writable:!0,configurable:!1,enumerable:!1,value:null},l=Ember.GUID_KEY+"_meta";Ember.META_KEY=l;var f={descs:{},watching:{}};u&&(f.values={}),Ember.EMPTY_META=f,Object.freeze&&Object.freeze(f);var m=Ember.platform.defineProperty.isSimulated;m&&(e.prototype.__preventPlainObject__=!0,e.prototype.toJSON=function(){}),Ember.meta=function(t,i){var o=t[l];return i===!1?o||f:(o?o.source!==t&&(m||r(t,l,h),o=n(o),o.descs=n(o.descs),o.watching=n(o.watching),o.cache={},o.source=t,u&&(o.values=n(o.values)),t[l]=o):(m||r(t,l,h),o=new e(t),u&&(o.values={}),t[l]=o,o.descs.constructor=null),o)},Ember.getMeta=function(e,t){var r=Ember.meta(e,!1);return r[t]},Ember.setMeta=function(e,t,r){var n=Ember.meta(e,!0);return n[t]=r,r},Ember.metaPath=function(e,t,r){for(var i,o,s=Ember.meta(e,r),a=0,u=t.length;u>a;a++){if(i=t[a],o=s[i]){if(o.__ember_source__!==e){if(!r)return void 0;o=s[i]=n(o),o.__ember_source__=e}}else{if(!r)return void 0;o=s[i]={__ember_source__:e}}s=o}return o},Ember.wrap=function(e,t){function r(){}function n(){var n,i=this._super;return this._super=t||r,n=e.apply(this,arguments),this._super=i,n}return n.wrappedFunction=e,n.__ember_observes__=e.__ember_observes__,n.__ember_observesBefore__=e.__ember_observesBefore__,n},Ember.isArray=function(e){return!e||e.setInterval?!1:Array.isArray&&Array.isArray(e)?!0:Ember.Array&&Ember.Array.detect(e)?!0:void 0!==e.length&&"object"==typeof e?!0:!1},Ember.makeArray=function(e){return null===e||void 0===e?[]:Ember.isArray(e)?e:[e]},Ember.canInvoke=t,Ember.tryInvoke=function(e,r,n){return t(e,r)?e[r].apply(e,n||[]):void 0};var b=function(){var e=0;try{try{}finally{throw e++,new Error("needsFinallyFixTest")}}catch(t){}return 1!==e}();Ember.tryFinally=b?function(e,t,r){var n,i,o;r=r||this;try{n=e.call(r)}finally{try{i=t.call(r)}catch(s){o=s}}if(o)throw o;return void 0===i?n:i}:function(e,t,r){var n,i;r=r||this;try{n=e.call(r)}finally{i=t.call(r)}return void 0===i?n:i},Ember.tryCatchFinally=b?function(e,t,r,n){var i,o,s;n=n||this;try{i=e.call(n)}catch(a){i=t.call(n,a)}finally{try{o=r.call(n)}catch(u){s=u}}if(s)throw s;return void 0===o?i:o}:function(e,t,r,n){var i,o;n=n||this;try{i=e.call(n)}catch(s){i=t.call(n,s)}finally{o=r.call(n)}return void 0===o?i:o};var p={},E="Boolean Number String Function Array Date RegExp Object".split(" ");Ember.ArrayPolyfills.forEach.call(E,function(e){p["[object "+e+"]"]=e.toLowerCase()});var d=Object.prototype.toString;Ember.typeOf=function(e){var t;return t=null===e||void 0===e?String(e):p[d.call(e)]||"object","function"===t?Ember.Object&&Ember.Object.detect(e)&&(t="class"):"object"===t&&(t=e instanceof Error?"error":Ember.Object&&e instanceof Ember.Object?"instance":"object"),t}}(),function(){Ember.Instrumentation={};var e=[],t={},r=function(r){for(var n,i=[],o=0,s=e.length;s>o;o++)n=e[o],n.regex.test(r)&&i.push(n.object);return t[r]=i,i},n=function(){var e="undefined"!=typeof window?window.performance||{}:{},t=e.now||e.mozNow||e.webkitNow||e.msNow||e.oNow;return t?t.bind(e):function(){return+new Date}}();Ember.Instrumentation.instrument=function(e,i,o,s){function a(){for(b=0,p=f.length;p>b;b++)m=f[b],E[b]=m.before(e,n(),i);return o.call(s)}function u(e){i=i||{},i.exception=e}function c(){for(b=0,p=f.length;p>b;b++)m=f[b],m.after(e,n(),i,E[b]);Ember.STRUCTURED_PROFILE&&console.timeEnd(h)}var h,l,f=t[e];if(Ember.STRUCTURED_PROFILE&&(h=e+": "+i.object,console.time(h)),f||(f=r(e)),0===f.length)return l=o.call(s),Ember.STRUCTURED_PROFILE&&console.timeEnd(h),l;var m,b,p,E=[];return Ember.tryCatchFinally(a,u,c)},Ember.Instrumentation.subscribe=function(r,n){for(var i,o=r.split("."),s=[],a=0,u=o.length;u>a;a++)i=o[a],"*"===i?s.push("[^\\.]*"):s.push(i);s=s.join("\\."),s+="(\\..*)?";var c={pattern:r,regex:new RegExp("^"+s+"$"),object:n};return e.push(c),t={},c},Ember.Instrumentation.unsubscribe=function(r){for(var n,i=0,o=e.length;o>i;i++)e[i]===r&&(n=i);e.splice(n,1),t={}},Ember.Instrumentation.reset=function(){e=[],t={}},Ember.instrument=Ember.Instrumentation.instrument,Ember.subscribe=Ember.Instrumentation.subscribe}(),function(){var e,t,r,n;n=Array.prototype.concat,e=Array.prototype.map||Ember.ArrayPolyfills.map,t=Array.prototype.forEach||Ember.ArrayPolyfills.forEach,r=Array.prototype.indexOf||Ember.ArrayPolyfills.indexOf;var i=Ember.EnumerableUtils={map:function(t,r,n){return t.map?t.map.call(t,r,n):e.call(t,r,n)},forEach:function(e,r,n){return e.forEach?e.forEach.call(e,r,n):t.call(e,r,n)},indexOf:function(e,t,n){return e.indexOf?e.indexOf.call(e,t,n):r.call(e,t,n)},indexesOf:function(e,t){return void 0===t?[]:i.map(t,function(t){return i.indexOf(e,t)})},addObject:function(e,t){var r=i.indexOf(e,t);-1===r&&e.push(t)},removeObject:function(e,t){var r=i.indexOf(e,t);-1!==r&&e.splice(r,1)},replace:function(e,t,r,i){if(e.replace)return e.replace(t,r,i);var o=n.apply([t,r],i);return e.splice.apply(e,o)},intersection:function(e,t){var r=[];return i.forEach(e,function(e){i.indexOf(t,e)>=0&&r.push(e)}),r}}}(),function(){var e=Ember.guidFor,t=Ember.ArrayPolyfills.indexOf,r=function(e){var t={};for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);return t},n=function(e,t){var n=e.keys.copy(),i=r(e.values);return t.keys=n,t.values=i,t},i=Ember.OrderedSet=function(){this.clear()};i.create=function(){return new i},i.prototype={clear:function(){this.presenceSet={},this.list=[]},add:function(t){var r=e(t),n=this.presenceSet,i=this.list;r in n||(n[r]=!0,i.push(t))},remove:function(r){var n=e(r),i=this.presenceSet,o=this.list;delete i[n];var s=t.call(o,r);s>-1&&o.splice(s,1)},isEmpty:function(){return 0===this.list.length},has:function(t){var r=e(t),n=this.presenceSet;return r in n},forEach:function(e,t){for(var r=this.toArray(),n=0,i=r.length;i>n;n++)e.call(t,r[n])},toArray:function(){return this.list.slice()},copy:function(){var e=new i;return e.presenceSet=r(this.presenceSet),e.list=this.toArray(),e}};var o=Ember.Map=function(){this.keys=Ember.OrderedSet.create(),this.values={}};o.create=function(){return new o},o.prototype={get:function(t){var r=this.values,n=e(t);return r[n]},set:function(t,r){var n=this.keys,i=this.values,o=e(t);n.add(t),i[o]=r},remove:function(t){var r=this.keys,n=this.values,i=e(t);return n.hasOwnProperty(i)?(r.remove(t),delete n[i],!0):!1},has:function(t){var r=this.values,n=e(t);return r.hasOwnProperty(n)},forEach:function(t,r){var n=this.keys,i=this.values;n.forEach(function(n){var o=e(n);t.call(r,n,i[o])})},copy:function(){return n(this,new o)}};var s=Ember.MapWithDefault=function(e){o.call(this),this.defaultValue=e.defaultValue};s.create=function(e){return e?new s(e):new o},s.prototype=Ember.create(o.prototype),s.prototype.get=function(e){var t=this.has(e);if(t)return o.prototype.get.call(this,e);var r=this.defaultValue(e);return this.set(e,r),r},s.prototype.copy=function(){return n(this,new s({defaultValue:this.defaultValue}))}}(),function(){function e(e){return e.match(a)[0]}function t(t,n){var i,a=s.test(n),u=!a&&o.test(n);if((!t||u)&&(t=Ember.lookup),a&&(n=n.slice(5)),t===Ember.lookup&&(i=e(n),t=r(t,i),n=n.slice(i.length+1)),!n||0===n.length)throw new Error("Invalid Path");return[t,n]}var r,n=Ember.META_KEY,i=Ember.ENV.MANDATORY_SETTER,o=/^([A-Z$]|([0-9][A-Z$])).*[\.\*]/,s=/^this[\.\*]/,a=/^([^\.\*]+)/;r=function r(e,t){if(""===t)return e;if(t||"string"!=typeof e||(t=e,e=null),!e||-1!==t.indexOf("."))return u(e,t);var r,o=e[n],s=o&&o.descs[t];return s?s.get(e,t):(r=i&&o&&o.watching[t]>0?o.values[t]:e[t],void 0!==r||"object"!=typeof e||t in e||"function"!=typeof e.unknownProperty?r:e.unknownProperty(t))},Ember.config.overrideAccessors&&(Ember.get=r,Ember.config.overrideAccessors(),r=Ember.get);var u=Ember._getPath=function(e,n){var i,o,a,u,c;if(null===e&&-1===n.indexOf("."))return r(Ember.lookup,n);for(i=s.test(n),(!e||i)&&(a=t(e,n),e=a[0],n=a[1],a.length=0),o=n.split("."),c=o.length,u=0;e&&c>u;u++)if(e=r(e,o[u],!0),e&&e.isDestroyed)return void 0;return e};Ember.normalizeTuple=function(e,r){return t(e,r)},Ember.getWithDefault=function(e,t,n){var i=r(e,t);return void 0===i?n:i},Ember.get=r,Ember.getPath=Ember.deprecateFunc("getPath is deprecated since get now supports paths",Ember.get)}(),function(){function e(e,t,r){for(var n=-1,i=0,o=e.length;o>i;i++)if(t===e[i][0]&&r===e[i][1]){n=i;break}return n}function t(e,t){var r,n=m(e,!0);return n.listeners||(n.listeners={}),n.hasOwnProperty("listeners")||(n.listeners=f(n.listeners)),r=n.listeners[t],r&&!n.listeners.hasOwnProperty(t)?r=n.listeners[t]=n.listeners[t].slice():r||(r=n.listeners[t]=[]),r}function r(t,r,n){var i=t[b],o=i&&i.listeners&&i.listeners[r];if(o)for(var s=o.length-1;s>=0;s--){var a=o[s][0],u=o[s][1],c=o[s][2],h=o[s][3],l=e(n,a,u);-1===l&&n.push([a,u,c,h])}}function n(t,r,n){var i=t[b],o=i&&i.listeners&&i.listeners[r],s=[];if(o){for(var a=o.length-1;a>=0;a--){var u=o[a][0],c=o[a][1],h=o[a][2],l=o[a][3],f=e(n,u,c);-1===f&&(n.push([u,c,h,l]),s.push([u,c,h,l]))}return s}}function i(r,n,i,o,s){o||"function"!=typeof i||(o=i,i=null);var a=t(r,n),u=e(a,i,o);-1===u&&(a.push([i,o,s,void 0]),"function"==typeof r.didAddListener&&r.didAddListener(n,i,o))}function o(r,n,i,o){function s(i,o){var s=t(r,n),a=e(s,i,o);-1!==a&&(s.splice(a,1),"function"==typeof r.didRemoveListener&&r.didRemoveListener(n,i,o))}if(o||"function"!=typeof i||(o=i,i=null),o)s(i,o);else{var a=r[b],u=a&&a.listeners&&a.listeners[n];if(!u)return;for(var c=u.length-1;c>=0;c--)s(u[c][0],u[c][1])}}function s(r,n,i,o,s){function a(){return s.call(i)}function u(){c&&(c[3]=void 0)}o||"function"!=typeof i||(o=i,i=null);var c,h=t(r,n),l=e(h,i,o);return-1!==l&&(c=h[l].slice(),c[3]=!0,h[l]=c),Ember.tryFinally(a,u)}function a(r,n,i,o,s){function a(){return s.call(i)}function u(){for(f=0,m=b.length;m>f;f++)b[f][3]=void 0}o||"function"!=typeof i||(o=i,i=null);var c,h,l,f,m,b=[];for(f=0,m=n.length;m>f;f++){c=n[f],h=t(r,c);var p=e(h,i,o);-1!==p&&(l=h[p].slice(),l[3]=!0,h[p]=l,b.push(l))}return Ember.tryFinally(a,u)}function u(e){var t=e[b].listeners,r=[];if(t)for(var n in t)t[n]&&r.push(n);return r}function c(e,t,r,n){if(e!==Ember&&"function"==typeof e.sendEvent&&e.sendEvent(t,r),!n){var i=e[b];n=i&&i.listeners&&i.listeners[t]}if(n){for(var s=n.length-1;s>=0;s--)if(n[s]&&n[s][3]!==!0){var a=n[s][0],u=n[s][1],c=n[s][2];c&&o(e,t,a,u),a||(a=e),"string"==typeof u&&(u=a[u]),r?u.apply(a,r):u.call(a)}return!0}}function h(e,t){var r=e[b],n=r&&r.listeners&&r.listeners[t];return!(!n||!n.length)}function l(e,t){var r=[],n=e[b],i=n&&n.listeners&&n.listeners[t];if(!i)return r;for(var o=0,s=i.length;s>o;o++){var a=i[o][0],u=i[o][1];r.push([a,u])}return r}var f=Ember.create,m=Ember.meta,b=Ember.META_KEY;Ember.addListener=i,Ember.removeListener=o,Ember._suspendListener=s,Ember._suspendListeners=a,Ember.sendEvent=c,Ember.hasListeners=h,Ember.watchedEvents=u,Ember.listenersFor=l,Ember.listenersDiff=n,Ember.listenersUnion=r}(),function(){var e=Ember.guidFor,t=Ember.sendEvent,r=Ember._ObserverSet=function(){this.clear()};r.prototype.add=function(t,r,n){var i,o=this.observerSet,s=this.observers,a=e(t),u=o[a];return u||(o[a]=u={}),i=u[r],void 0===i&&(i=s.push({sender:t,keyName:r,eventName:n,listeners:[]})-1,u[r]=i),s[i].listeners},r.prototype.flush=function(){var e,r,n,i,o=this.observers;for(this.clear(),e=0,r=o.length;r>e;++e)n=o[e],i=n.sender,i.isDestroying||i.isDestroyed||t(i,n.eventName,[i,n.keyName],n.listeners)},r.prototype.clear=function(){this.observerSet={},this.observers=[]}}(),function(){function e(e,t,i){if(!e.isDestroying){var o=n,s=!o;s&&(o=n={}),r(p,e,t,o,i),s&&(n=null)}}function t(e,t,n){if(!e.isDestroying){var o=i,s=!o;s&&(o=i={}),r(E,e,t,o,n),s&&(i=null)}}function r(e,t,r,n,i){var o=s(t);if(n[o]||(n[o]={}),!n[o][r]){n[o][r]=!0;var a=i.deps;if(a=a&&a[r])for(var u in a){var c=i.descs[u];c&&c._suspended===t||e(t,u)}}}var n,i,o=Ember.meta,s=Ember.guidFor,a=Ember.tryFinally,u=Ember.sendEvent,c=Ember.listenersUnion,h=Ember.listenersDiff,l=Ember._ObserverSet,f=new l,m=new l,b=0,p=Ember.propertyWillChange=function(t,r){var n=o(t,!1),i=n.watching[r]>0||"length"===r,s=n.proto,a=n.descs[r];i&&s!==t&&(a&&a.willChange&&a.willChange(t,r),e(t,r,n),d(t,r,n),_(t,r))},E=Ember.propertyDidChange=function(e,r){var n=o(e,!1),i=n.watching[r]>0||"length"===r,s=n.proto,a=n.descs[r];s!==e&&(a&&a.didChange&&a.didChange(e,r),(i||"length"===r)&&(t(e,r,n),g(e,r,n),C(e,r)))},d=function(e,t,r,n){if(r.hasOwnProperty("chainWatchers")){var i=r.chainWatchers;if(i=i[t])for(var o=0,s=i.length;s>o;o++)i[o].willChange(n)}},g=function(e,t,r,n){if(r.hasOwnProperty("chainWatchers")){var i=r.chainWatchers;if(i=i[t])for(var o=i.length-1;o>=0;o--)i[o].didChange(n)}};Ember.overrideChains=function(e,t,r){g(e,t,r,!0)};var v=Ember.beginPropertyChanges=function(){b++},y=Ember.endPropertyChanges=function(){b--,0>=b&&(f.clear(),m.flush())};Ember.changeProperties=function(e,t){v(),a(e,y,t)};var _=function(e,t){if(!e.isDestroying){var r,n,i=t+":before";b?(r=f.add(e,t,i),n=h(e,i,r),u(e,i,[e,t],n)):u(e,i,[e,t])}},C=function(e,t){if(!e.isDestroying){var r,n=t+":change";b?(r=m.add(e,t,n),c(e,n,r)):u(e,n,[e,t])}}}(),function(){function e(e,t,r,o){var s;if(s=t.slice(t.lastIndexOf(".")+1),t=t.slice(0,t.length-(s.length+1)),"this"!==t&&(e=n(e,t)),!s||0===s.length)throw new Error("You passed an empty path");if(!e){if(o)return;throw new Error("Object in path "+t+" could not be found or was destroyed.")}return i(e,s,r)}var t=Ember.META_KEY,r=Ember.ENV.MANDATORY_SETTER,n=Ember._getPath,i=function i(n,i,o,s){if("string"==typeof n&&(o=i,i=n,n=null),!n||-1!==i.indexOf("."))return e(n,i,o,s);var a,u,c=n[t],h=c&&c.descs[i];return h?h.set(n,i,o):(a="object"==typeof n&&!(i in n),a&&"function"==typeof n.setUnknownProperty?n.setUnknownProperty(i,o):c&&c.watching[i]>0?(u=r?c.values[i]:n[i],o!==u&&(Ember.propertyWillChange(n,i),r?void 0!==u||i in n?c.values[i]=o:Ember.defineProperty(n,i,null,o):n[i]=o,Ember.propertyDidChange(n,i))):n[i]=o),o};Ember.config.overrideAccessors&&(Ember.set=i,Ember.config.overrideAccessors(),i=Ember.set),Ember.set=i,Ember.setPath=Ember.deprecateFunc("setPath is deprecated since set now supports paths",Ember.set),Ember.trySet=function(e,t,r){return i(e,t,r,!0)},Ember.trySetPath=Ember.deprecateFunc("trySetPath has been renamed to trySet",Ember.trySet)}(),function(){var e=Ember.META_KEY,t=Ember.meta,r=Ember.platform.defineProperty,n=Ember.ENV.MANDATORY_SETTER;Ember.Descriptor=function(){};var i=Ember.MANDATORY_SETTER_FUNCTION=function(){},o=Ember.DEFAULT_GETTER_FUNCTION=function(t){return function(){var r=this[e];return r&&r.values[t]}};Ember.defineProperty=function(e,s,a,u,c){var h,l,f,m;return c||(c=t(e)),h=c.descs,l=c.descs[s],f=c.watching[s]>0,l instanceof Ember.Descriptor&&l.teardown(e,s),a instanceof Ember.Descriptor?(m=a,h[s]=a,n&&f?r(e,s,{configurable:!0,enumerable:!0,writable:!0,value:void 0}):e[s]=void 0,a.setup(e,s)):(h[s]=void 0,null==a?(m=u,n&&f?(c.values[s]=u,r(e,s,{configurable:!0,enumerable:!0,set:i,get:o(s)})):e[s]=u):(m=a,r(e,s,a))),f&&Ember.overrideChains(e,s,c),e.didDefineProperty&&e.didDefineProperty(e,s,m),this}}(),function(){var e=Ember.changeProperties,t=Ember.set;Ember.setProperties=function(r,n){return e(function(){for(var e in n)n.hasOwnProperty(e)&&t(r,e,n[e])}),r}}(),function(){var e=Ember.meta,t=Ember.typeOf,r=Ember.ENV.MANDATORY_SETTER,n=Ember.platform.defineProperty;Ember.watchKey=function(i,o){if("length"!==o||"array"!==t(i)){var s,a=e(i),u=a.watching;u[o]?u[o]=(u[o]||0)+1:(u[o]=1,s=a.descs[o],s&&s.willWatch&&s.willWatch(i,o),"function"==typeof i.willWatchProperty&&i.willWatchProperty(o),r&&o in i&&(a.values[o]=i[o],n(i,o,{configurable:!0,enumerable:!0,set:Ember.MANDATORY_SETTER_FUNCTION,get:Ember.DEFAULT_GETTER_FUNCTION(o)})))}},Ember.unwatchKey=function(t,i){var o,s=e(t),a=s.watching;1===a[i]?(a[i]=0,o=s.descs[i],o&&o.didUnwatch&&o.didUnwatch(t,i),"function"==typeof t.didUnwatchProperty&&t.didUnwatchProperty(i),r&&i in t&&(n(t,i,{configurable:!0,enumerable:!0,writable:!0,value:s.values[i]}),delete s.values[i])):a[i]>1&&a[i]--}}(),function(){function e(e){return e.match(f)[0]}function t(e,t,r){if(e&&"object"==typeof e){var i=n(e),o=i.chainWatchers;i.hasOwnProperty("chainWatchers")||(o=i.chainWatchers={}),o[t]||(o[t]=[]),o[t].push(r),u(e,t)}}function r(e){return n(e,!1).proto===e}var n=Ember.meta,i=Ember.get,o=Ember.normalizeTuple,s=Ember.ArrayPolyfills.forEach,a=Ember.warn,u=Ember.watchKey,c=Ember.unwatchKey,h=Ember.propertyWillChange,l=Ember.propertyDidChange,f=/^([^\.\*]+)/,m=[];Ember.flushPendingChains=function(){if(0!==m.length){var e=m;m=[],s.call(e,function(e){e[0].add(e[1])}),a("Watching an undefined global, Ember expects watched globals to be setup by the time the run loop is flushed, check for typos",0===m.length)}};var b=Ember.removeChainWatcher=function(e,t,r){if(e&&"object"==typeof e){var i=n(e,!1);if(i.hasOwnProperty("chainWatchers")){var o=i.chainWatchers;if(o[t]){o=o[t];for(var s=0,a=o.length;a>s;s++)o[s]===r&&o.splice(s,1)}c(e,t)}}},p=Ember._ChainNode=function(e,r,n){this._parent=e,this._key=r,this._watching=void 0===n,this._value=n,this._paths={},this._watching&&(this._object=e.value(),this._object&&t(this._object,this._key,this)),this._parent&&"@each"===this._parent._key&&this.value()},E=p.prototype;E.value=function(){if(void 0===this._value&&this._watching){var e=this._parent.value();this._value=e&&!r(e)?i(e,this._key):void 0}return this._value},E.destroy=function(){if(this._watching){var e=this._object;e&&b(e,this._key,this),this._watching=!1}},E.copy=function(e){var t,r=new p(null,null,e),n=this._paths;for(t in n)0>=n[t]||r.add(t);return r},E.add=function(t){var r,n,i,s,a;if(a=this._paths,a[t]=(a[t]||0)+1,r=this.value(),n=o(r,t),n[0]&&n[0]===r)t=n[1],i=e(t),t=t.slice(i.length+1);else{if(!n[0])return m.push([this,t]),n.length=0,void 0;s=n[0],i=t.slice(0,0-(n[1].length+1)),t=n[1]}n.length=0,this.chain(i,t,s)},E.remove=function(t){var r,n,i,s,a;a=this._paths,a[t]>0&&a[t]--,r=this.value(),n=o(r,t),n[0]===r?(t=n[1],i=e(t),t=t.slice(i.length+1)):(s=n[0],i=t.slice(0,0-(n[1].length+1)),t=n[1]),n.length=0,this.unchain(i,t)},E.count=0,E.chain=function(t,r,n){var i,o=this._chains;o||(o=this._chains={}),i=o[t],i||(i=o[t]=new p(this,t,n)),i.count++,r&&r.length>0&&(t=e(r),r=r.slice(t.length+1),i.chain(t,r))},E.unchain=function(t,r){var n=this._chains,i=n[t];r&&r.length>1&&(t=e(r),r=r.slice(t.length+1),i.unchain(t,r)),i.count--,0>=i.count&&(delete n[i._key],i.destroy())},E.willChange=function(){var e=this._chains;if(e)for(var t in e)e.hasOwnProperty(t)&&e[t].willChange();this._parent&&this._parent.chainWillChange(this,this._key,1)},E.chainWillChange=function(e,t,r){this._key&&(t=this._key+"."+t),this._parent?this._parent.chainWillChange(this,t,r+1):(r>1&&h(this.value(),t),t="this."+t,this._paths[t]>0&&h(this.value(),t))},E.chainDidChange=function(e,t,r){this._key&&(t=this._key+"."+t),this._parent?this._parent.chainDidChange(this,t,r+1):(r>1&&l(this.value(),t),t="this."+t,this._paths[t]>0&&l(this.value(),t))},E.didChange=function(e){if(this._watching){var r=this._parent.value();r!==this._object&&(b(this._object,this._key,this),this._object=r,t(r,this._key,this)),this._value=void 0,this._parent&&"@each"===this._parent._key&&this.value()}var n=this._chains;if(n)for(var i in n)n.hasOwnProperty(i)&&n[i].didChange(e);e||this._parent&&this._parent.chainDidChange(this,this._key,1)},Ember.finishChains=function(e){var t=n(e,!1),r=t.chains;r&&(r.value()!==e&&(t.chains=r=r.copy(e)),r.didChange(!0))}}(),function(){function e(e){var r=t(e),i=r.chains;return i?i.value()!==e&&(i=r.chains=i.copy(e)):i=r.chains=new n(null,null,e),i}var t=Ember.meta,r=Ember.typeOf,n=Ember._ChainNode;Ember.watchPath=function(n,i){if("length"!==i||"array"!==r(n)){var o=t(n),s=o.watching;s[i]?s[i]=(s[i]||0)+1:(s[i]=1,e(n).add(i))}},Ember.unwatchPath=function(r,n){var i=t(r),o=i.watching;1===o[n]?(o[n]=0,e(r).remove(n)):o[n]>1&&o[n]--}}(),function(){function e(e){return"*"===e||!l.test(e)}var t=Ember.meta,r=Ember.GUID_KEY,n=Ember.META_KEY,i=Ember.removeChainWatcher,o=Ember.watchKey,s=Ember.unwatchKey,a=Ember.watchPath,u=Ember.unwatchPath,c=Ember.typeOf,h=Ember.generateGuid,l=/[\.\*]/;Ember.watch=function(t,r){("length"!==r||"array"!==c(t))&&(e(r)?o(t,r):a(t,r))},Ember.isWatching=function(e,t){var r=e[n];return(r&&r.watching[t])>0},Ember.watch.flushPending=Ember.flushPendingChains,Ember.unwatch=function(t,r){("length"!==r||"array"!==c(t))&&(e(r)?s(t,r):u(t,r))},Ember.rewatch=function(e){var n=t(e,!1),i=n.chains;r in e&&!e.hasOwnProperty(r)&&h(e,"ember"),i&&i.value()!==e&&(n.chains=i.copy(e))};var f=[];Ember.destroy=function(e){var t,r,o,s,a=e[n];if(a&&(e[n]=null,t=a.chains))for(f.push(t);f.length>0;){if(t=f.pop(),r=t._chains)for(o in r)r.hasOwnProperty(o)&&f.push(r[o]);t._watching&&(s=t._object,s&&i(s,t._key,t))}}}(),function(){function e(e,t){var r=e[t];return r?e.hasOwnProperty(t)||(r=e[t]=f(r)):r=e[t]={},r}function t(t){return e(t,"deps")}function r(r,n,i,o){var s,a,u,c,h,l=r._dependentKeys;if(l)for(s=t(o),a=0,u=l.length;u>a;a++)c=l[a],h=e(s,c),h[i]=(h[i]||0)+1,b(n,c)}function n(r,n,i,o){var s,a,u,c,h,l=r._dependentKeys;if(l)for(s=t(o),a=0,u=l.length;u>a;a++)c=l[a],h=e(s,c),h[i]=(h[i]||0)-1,p(n,c)}function i(e,t){this.func=e,this._cacheable=t&&void 0!==t.cacheable?t.cacheable:!0,this._dependentKeys=t&&t.dependentKeys,this._readOnly=t&&(void 0!==t.readOnly||!!t.readOnly)}function o(e,t){for(var r={},n=0;t.length>n;n++)r[t[n]]=u(e,t[n]);return r}function s(e,t){Ember.computed[e]=function(e){var r=l.call(arguments);return Ember.computed(e,function(){return t.apply(this,r)})}}function a(e,t){Ember.computed[e]=function(){var e=l.call(arguments),r=Ember.computed(function(){return t.apply(this,[o(this,e)])});return r.property.apply(r,e)}}var u=Ember.get,c=Ember.set,h=Ember.meta,l=[].slice,f=Ember.create,m=Ember.META_KEY,b=Ember.watch,p=Ember.unwatch;Ember.ComputedProperty=i,i.prototype=new Ember.Descriptor;var E=i.prototype;E.cacheable=function(e){return this._cacheable=e!==!1,this},E.volatile=function(){return this.cacheable(!1)},E.readOnly=function(e){return this._readOnly=void 0===e||!!e,this},E.property=function(){for(var e=[],t=0,r=arguments.length;r>t;t++)e.push(arguments[t]);return this._dependentKeys=e,this},E.meta=function(e){return 0===arguments.length?this._meta||{}:(this._meta=e,this)},E.willWatch=function(e,t){var n=e[m];t in n.cache||r(this,e,t,n)},E.didUnwatch=function(e,t){var r=e[m];t in r.cache||n(this,e,t,r)},E.didChange=function(e,t){if(this._cacheable&&this._suspended!==e){var r=h(e);t in r.cache&&(delete r.cache[t],r.watching[t]||n(this,e,t,r))}},E.get=function(e,t){var n,i,o;if(this._cacheable){if(o=h(e),i=o.cache,t in i)return i[t];n=i[t]=this.func.call(e,t),o.watching[t]||r(this,e,t,o)}else n=this.func.call(e,t);return n},E.set=function(e,t,n){var i,o,s=this._cacheable,a=this.func,u=h(e,s),c=u.watching[t],l=this._suspended,f=!1,m=u.cache;if(this._readOnly)throw new Error("Cannot Set: "+t+" on: "+e.toString());this._suspended=e;try{if(s&&m.hasOwnProperty(t)&&(i=m[t],f=!0),a.wrappedFunction&&(a=a.wrappedFunction),3===a.length)o=a.call(e,t,n,i);else{if(2!==a.length)return Ember.defineProperty(e,t,null,i),Ember.set(e,t,n),void 0;o=a.call(e,t,n)}if(f&&i===o)return;c&&Ember.propertyWillChange(e,t),f&&delete m[t],s&&(c||f||r(this,e,t,u),m[t]=o),c&&Ember.propertyDidChange(e,t)}finally{this._suspended=l}return o},E.setup=function(e,t){var n=e[m];n&&n.watching[t]&&r(this,e,t,h(e))},E.teardown=function(e,t){var r=h(e);return(r.watching[t]||t in r.cache)&&n(this,e,t,r),this._cacheable&&delete r.cache[t],null},Ember.computed=function(e){var t;if(arguments.length>1&&(t=l.call(arguments,0,-1),e=l.call(arguments,-1)[0]),"function"!=typeof e)throw new Error("Computed Property declared without a property function");var r=new i(e);return t&&r.property.apply(r,t),r},Ember.cacheFor=function(e,t){var r=h(e,!1).cache;return r&&t in r?r[t]:void 0},s("empty",function(e){return Ember.isEmpty(u(this,e))}),s("notEmpty",function(e){return!Ember.isEmpty(u(this,e))}),s("none",function(e){return Ember.isNone(u(this,e))}),s("not",function(e){return!u(this,e)}),s("bool",function(e){return!!u(this,e)}),s("match",function(e,t){var r=u(this,e);return"string"==typeof r?!!r.match(t):!1}),s("equal",function(e,t){return u(this,e)===t}),s("gt",function(e,t){return u(this,e)>t}),s("gte",function(e,t){return u(this,e)>=t}),s("lt",function(e,t){return t>u(this,e)}),s("lte",function(e,t){return t>=u(this,e)}),a("and",function(e){for(var t in e)if(e.hasOwnProperty(t)&&!e[t])return!1;return!0}),a("or",function(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!0;return!1}),a("any",function(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return e[t];return null}),a("map",function(e){var t=[];for(var r in e)e.hasOwnProperty(r)&&(Ember.isNone(e[r])?t.push(null):t.push(e[r]));return t}),Ember.computed.alias=function(e){return Ember.computed(e,function(t,r){return arguments.length>1?(c(this,e,r),r):u(this,e)})},Ember.computed.defaultTo=function(e){return Ember.computed(function(t,r,n){return 1===arguments.length?null!=n?n:u(this,e):null!=r?r:u(this,e)})}}(),function(){function e(e){return e+r}function t(e){return e+n}var r=":change",n=":before";Ember.guidFor,Ember.addObserver=function(t,r,n,i){return Ember.addListener(t,e(r),n,i),Ember.watch(t,r),this},Ember.observersFor=function(t,r){return Ember.listenersFor(t,e(r))},Ember.removeObserver=function(t,r,n,i){return Ember.unwatch(t,r),Ember.removeListener(t,e(r),n,i),this},Ember.addBeforeObserver=function(e,r,n,i){return Ember.addListener(e,t(r),n,i),Ember.watch(e,r),this},Ember._suspendBeforeObserver=function(e,r,n,i,o){return Ember._suspendListener(e,t(r),n,i,o)},Ember._suspendObserver=function(t,r,n,i,o){return Ember._suspendListener(t,e(r),n,i,o)};var i=Ember.ArrayPolyfills.map;Ember._suspendBeforeObservers=function(e,r,n,o,s){var a=i.call(r,t);return Ember._suspendListeners(e,a,n,o,s)},Ember._suspendObservers=function(t,r,n,o,s){var a=i.call(r,e);return Ember._suspendListeners(t,a,n,o,s)},Ember.beforeObserversFor=function(e,r){return Ember.listenersFor(e,t(r))},Ember.removeBeforeObserver=function(e,r,n,i){return Ember.unwatch(e,r),Ember.removeListener(e,t(r),n,i),this}}(),function(){function e(e,t,r,n){return void 0===t&&(t=e,e=void 0),"string"==typeof t&&(t=e[t]),r&&n>0&&(r=r.length>n?o.call(r,n):null),Ember.handleErrors(function(){return t.apply(e||this,r||[])},this)}function t(){c=null,u.currentRunLoop&&u.end()}function r(){h=null,u(function(){var t=+new Date,n=-1;for(var i in f)if(f.hasOwnProperty(i)){var o=f[i];o&&o.expires&&(t>=o.expires?(delete f[i],e(o.target,o.method,o.args,2)):(0>n||n>o.expires)&&(n=o.expires))}n>0&&(h=setTimeout(r,n-t),l=n)})}function n(t,r){r[this.tguid]&&delete r[this.tguid][this.mguid],f[t]&&e(this.target,this.method,this.args),delete f[t]}function i(e,t,r,i){var o,s=Ember.guidFor(t),a=Ember.guidFor(r),c=u.autorun().onceTimers,h=c[s]&&c[s][a];return h&&f[h]?f[h].args=i:(o={target:t,method:r,args:i,tguid:s,mguid:a},h=Ember.guidFor(o),f[h]=o,c[s]||(c[s]={}),c[s][a]=h,u.schedule(e,o,n,h,c)),h}var o=[].slice,s=Ember.ArrayPolyfills.forEach,a=function(e){this._prev=e||null,this.onceTimers={}};a.prototype={end:function(){this.flush()},prev:function(){return this._prev},schedule:function(e,t,r){var n,i=this._queues;i||(i=this._queues={}),n=i[e],n||(n=i[e]=[]);var s=arguments.length>3?o.call(arguments,3):null;return n.push({target:t,method:r,args:s}),this},flush:function(t){function r(t){e(t.target,t.method,t.args)}function n(){s.call(u,r)}var i,o,a,u,c;if(!this._queues)return this;if(Ember.watch.flushPending(),t)for(;this._queues&&(u=this._queues[t]);)this._queues[t]=null,"sync"===t?(c=Ember.LOG_BINDINGS,c&&Ember.Logger.log("Begin: Flush Sync Queue"),Ember.beginPropertyChanges(),Ember.tryFinally(n,Ember.endPropertyChanges),c&&Ember.Logger.log("End: Flush Sync Queue")):s.call(u,r);
|
16
|
-
else{i=Ember.run.queues,a=i.length,o=0;e:for(;a>o;){t=i[o],u=this._queues&&this._queues[t],delete this._queues[t],u&&("sync"===t?(c=Ember.LOG_BINDINGS,c&&Ember.Logger.log("Begin: Flush Sync Queue"),Ember.beginPropertyChanges(),Ember.tryFinally(n,Ember.endPropertyChanges),c&&Ember.Logger.log("End: Flush Sync Queue")):s.call(u,r));for(var h=0;o>=h;h++)if(this._queues&&this._queues[i[h]]){o=h;continue e}o++}}return this}},Ember.RunLoop=a,Ember.run=function(t,r){function n(){return t||r?e(t,r,i,2):void 0}var i=arguments;return u.begin(),Ember.tryFinally(n,u.end)};var u=Ember.run;Ember.run.begin=function(){u.currentRunLoop=new a(u.currentRunLoop)},Ember.run.end=function(){function e(){u.currentRunLoop.end()}function t(){u.currentRunLoop=u.currentRunLoop.prev()}Ember.tryFinally(e,t)},Ember.run.queues=["sync","actions","destroy"],Ember.run.schedule=function(){var e=u.autorun();e.schedule.apply(e,arguments)};var c;Ember.run.hasScheduledTimers=function(){return!(!c&&!h)},Ember.run.cancelTimers=function(){c&&(clearTimeout(c),c=null),h&&(clearTimeout(h),h=null),f={}},Ember.run.autorun=function(){return u.currentRunLoop||(u.begin(),c||(c=setTimeout(t,1))),u.currentRunLoop},Ember.run.sync=function(){u.autorun(),u.currentRunLoop.flush("sync")};var h,l,f={};Ember.run.later=function(e,t){var n,i,s,a,u;return 2===arguments.length&&"function"==typeof e?(u=t,t=e,e=void 0,n=[e,t]):(n=o.call(arguments),u=n.pop()),i=+new Date+u,s={target:e,method:t,expires:i,args:n},a=Ember.guidFor(s),f[a]=s,h&&l>i&&(clearTimeout(h),h=null),h||(h=setTimeout(r,u),l=i),a},Ember.run.once=function(e,t){return i("actions",e,t,o.call(arguments,2))},Ember.run.scheduleOnce=function(e,t,r){return i(e,t,r,o.call(arguments,3))},Ember.run.next=function(){var e=o.call(arguments);return e.push(1),u.later.apply(this,e)},Ember.run.cancel=function(e){delete f[e]}}(),function(){function e(e,t){return r(o(t)?Ember.lookup:e,t)}function t(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])}Ember.LOG_BINDINGS=!1||!!Ember.ENV.LOG_BINDINGS;var r=Ember.get,n=(Ember.set,Ember.guidFor),i=/^([A-Z$]|([0-9][A-Z$]))/,o=Ember.isGlobalPath=function(e){return i.test(e)},s=function(e,t){this._direction="fwd",this._from=t,this._to=e,this._directionMap=Ember.Map.create()};s.prototype={copy:function(){var e=new s(this._to,this._from);return this._oneWay&&(e._oneWay=!0),e},from:function(e){return this._from=e,this},to:function(e){return this._to=e,this},oneWay:function(){return this._oneWay=!0,this},toString:function(){var e=this._oneWay?"[oneWay]":"";return"Ember.Binding<"+n(this)+">("+this._from+" -> "+this._to+")"+e},connect:function(t){var r=this._from,n=this._to;return Ember.trySet(t,n,e(t,r)),Ember.addObserver(t,r,this,this.fromDidChange),this._oneWay||Ember.addObserver(t,n,this,this.toDidChange),this._readyToSync=!0,this},disconnect:function(e){var t=!this._oneWay;return Ember.removeObserver(e,this._from,this,this.fromDidChange),t&&Ember.removeObserver(e,this._to,this,this.toDidChange),this._readyToSync=!1,this},fromDidChange:function(e){this._scheduleSync(e,"fwd")},toDidChange:function(e){this._scheduleSync(e,"back")},_scheduleSync:function(e,t){var r=this._directionMap,n=r.get(e);n||(Ember.run.schedule("sync",this,this._sync,e),r.set(e,t)),"back"===n&&"fwd"===t&&r.set(e,"fwd")},_sync:function(t){var n=Ember.LOG_BINDINGS;if(!t.isDestroyed&&this._readyToSync){var i=this._directionMap,o=i.get(t),s=this._from,a=this._to;if(i.remove(t),"fwd"===o){var u=e(t,this._from);n&&Ember.Logger.log(" ",this.toString(),"->",u,t),this._oneWay?Ember.trySet(t,a,u):Ember._suspendObserver(t,a,this,this.toDidChange,function(){Ember.trySet(t,a,u)})}else if("back"===o){var c=r(t,this._to);n&&Ember.Logger.log(" ",this.toString(),"<-",c,t),Ember._suspendObserver(t,s,this,this.fromDidChange,function(){Ember.trySet(Ember.isGlobalPath(s)?Ember.lookup:t,s,c)})}}}},t(s,{from:function(){var e=this,t=new e;return t.from.apply(t,arguments)},to:function(){var e=this,t=new e;return t.to.apply(t,arguments)},oneWay:function(e,t){var r=this,n=new r(null,e);return n.oneWay(t)}}),Ember.Binding=s,Ember.bind=function(e,t,r){return new Ember.Binding(t,r).connect(e)},Ember.oneWay=function(e,t,r){return new Ember.Binding(t,r).oneWay().connect(e)}}(),function(){function e(e){var t=Ember.meta(e,!0),r=t.mixins;return r?t.hasOwnProperty("mixins")||(r=t.mixins=P(r)):r=t.mixins={},r}function t(e,t){return t&&t.length>0&&(e.mixins=C.call(t,function(e){if(e instanceof v)return e;var t=new v;return t.properties=e,t})),e}function r(e){return"function"==typeof e&&e.isMethod!==!1&&e!==Boolean&&e!==Object&&e!==Number&&e!==Array&&e!==Date&&e!==String}function n(e,t){var r;return t instanceof v?(r=j(t),e[r]?x:(e[r]=t,t.properties)):t}function i(e,t,r){var n;return n=t.concatenatedProperties||r.concatenatedProperties,e.concatenatedProperties&&(n=n?n.concat(e.concatenatedProperties):e.concatenatedProperties),n}function o(e,t,r,n,i){var o;return void 0===n[t]&&(o=i[t]),o=o||e.descs[t],o&&o instanceof Ember.ComputedProperty?(r=P(r),r.func=Ember.wrap(r.func,o.func),r):r}function s(e,t,r,n,i){var o;return void 0===i[t]&&(o=n[t]),o=o||e[t],"function"!=typeof o?r:Ember.wrap(r,o)}function a(e,t,r,n){var i=n[t]||e[t];return i?"function"==typeof i.concat?i.concat(r):Ember.makeArray(i).concat(r):Ember.makeArray(r)}function u(e,t,n,i,u,c,h){if(n instanceof Ember.Descriptor){if(n===y&&u[t])return x;n.func&&(n=o(i,t,n,c,u)),u[t]=n,c[t]=void 0}else r(n)?n=s(e,t,n,c,u):(h&&O.call(h,t)>=0||"concatenatedProperties"===t)&&(n=a(e,t,n,c)),u[t]=void 0,c[t]=n}function c(e,t,r,o,s,a){function h(e){delete r[e],delete o[e]}for(var l,f,m,b,p,E=0,d=e.length;d>E;E++)if(l=e[E],f=n(t,l),f!==x)if(f){p=Ember.meta(s),b=i(f,o,s);for(m in f)f.hasOwnProperty(m)&&(a.push(m),u(s,m,f[m],p,r,o,b));f.hasOwnProperty("toString")&&(s.toString=f.toString)}else l.mixins&&(c(l.mixins,t,r,o,s,a),l._without&&w.call(l._without,h))}function h(e,t,r,n){if(D.test(t)){var i=n.bindings;i?n.hasOwnProperty("bindings")||(i=n.bindings=P(n.bindings)):i=n.bindings={},i[t]=r}}function l(e,t){var r,n,i,o=t.bindings;if(o){for(r in o)n=o[r],n&&(i=r.slice(0,-7),n instanceof Ember.Binding?(n=n.copy(),n.to(i)):n=new Ember.Binding(i,n),n.connect(e),e[r]=n);t.bindings={}}}function f(e,t){return l(e,t||Ember.meta(e)),e}function m(e,t,r,n,i){var o,s=t.methodName;return n[s]||i[s]?(o=i[s],t=n[s]):r.descs[s]?(t=r.descs[s],o=void 0):(t=void 0,o=e[s]),{desc:t,value:o}}function b(e,t,r,n,i){if("function"==typeof r){var o=r[n];if(o)for(var s=0,a=o.length;a>s;s++)Ember[i](e,o[s],null,t)}}function p(e,t,r){var n=e[t];b(e,t,n,"__ember_observesBefore__","removeBeforeObserver"),b(e,t,n,"__ember_observes__","removeObserver"),b(e,t,r,"__ember_observesBefore__","addBeforeObserver"),b(e,t,r,"__ember_observes__","addObserver")}function E(t,r,n){var i,o,s,a={},u={},l=Ember.meta(t),b=[];c(r,e(t),a,u,t,b);for(var E=0,d=b.length;d>E;E++)if(i=b[E],"constructor"!==i&&u.hasOwnProperty(i)&&(s=a[i],o=u[i],s!==y)){for(;s&&s instanceof _;){var g=m(t,s,l,a,u);s=g.desc,o=g.value}(void 0!==s||void 0!==o)&&(p(t,i,o),h(t,i,o,l),A(t,i,s,o,l))}return n||f(t,l),t}function d(e,t,r){var n=j(e);if(r[n])return!1;if(r[n]=!0,e===t)return!0;for(var i=e.mixins,o=i?i.length:0;--o>=0;)if(d(i[o],t,r))return!0;return!1}function g(e,t,r){if(!r[j(t)])if(r[j(t)]=!0,t.properties){var n=t.properties;for(var i in n)n.hasOwnProperty(i)&&(e[i]=!0)}else t.mixins&&w.call(t.mixins,function(t){g(e,t,r)})}var v,y,_,C=Ember.ArrayPolyfills.map,O=Ember.ArrayPolyfills.indexOf,w=Ember.ArrayPolyfills.forEach,S=[].slice,P=Ember.create,A=Ember.defineProperty,j=Ember.guidFor,x={},D=Ember.IS_BINDING=/^.+Binding$/;Ember.mixin=function(e){var t=S.call(arguments,1);return E(e,t,!1),e},Ember.Mixin=function(){return t(this,arguments)},v=Ember.Mixin,v.prototype={properties:null,mixins:null,ownerConstructor:null},v._apply=E,v.applyPartial=function(e){var t=S.call(arguments,1);return E(e,t,!0)},v.finishPartial=f,Ember.anyUnprocessedMixins=!1,v.create=function(){Ember.anyUnprocessedMixins=!0;var e=this;return t(new e,arguments)};var T=v.prototype;T.reopen=function(){var e,t;this.properties?(e=v.create(),e.properties=this.properties,delete this.properties,this.mixins=[e]):this.mixins||(this.mixins=[]);var r,n=arguments.length,i=this.mixins;for(r=0;n>r;r++)e=arguments[r],e instanceof v?i.push(e):(t=v.create(),t.properties=e,i.push(t));return this},T.apply=function(e){return E(e,[this],!1)},T.applyPartial=function(e){return E(e,[this],!0)},T.detect=function(e){if(!e)return!1;if(e instanceof v)return d(e,this,{});var t=Ember.meta(e,!1).mixins;return t?!!t[j(this)]:!1},T.without=function(){var e=new v(this);return e._without=S.call(arguments),e},T.keys=function(){var e={},t={},r=[];g(e,this,t);for(var n in e)e.hasOwnProperty(n)&&r.push(n);return r},v.mixins=function(e){var t=Ember.meta(e,!1).mixins,r=[];if(!t)return r;for(var n in t){var i=t[n];i.properties||r.push(i)}return r},y=new Ember.Descriptor,y.toString=function(){return"(Required Property)"},Ember.required=function(){return y},_=function(e){this.methodName=e},_.prototype=new Ember.Descriptor,Ember.alias=function(e){return new _(e)},Ember.alias=Ember.deprecateFunc("Ember.alias is deprecated. Please use Ember.aliasMethod or Ember.computed.alias instead.",Ember.alias),Ember.aliasMethod=function(e){return new _(e)},Ember.observer=function(e){var t=S.call(arguments,1);return e.__ember_observes__=t,e},Ember.immediateObserver=function(){for(var e=0,t=arguments.length;t>e;e++)arguments[e];return Ember.observer.apply(this,arguments)},Ember.beforeObserver=function(e){var t=S.call(arguments,1);return e.__ember_observesBefore__=t,e}}(),function(){e("rsvp",[],function(){"use strict";function e(e,t){n.async(function(){e.trigger("promise:resolved",{detail:t}),e.isResolved=!0,e.resolvedValue=t})}function t(e,t){n.async(function(){e.trigger("promise:failed",{detail:t}),e.isRejected=!0,e.rejectedValue=t})}function r(e){var t,r=[],n=new b,i=e.length;0===i&&n.resolve([]);var o=function(e){return function(t){s(e,t)}},s=function(e,t){r[e]=t,0===--i&&n.resolve(r)},a=function(e){n.reject(e)};for(t=0;i>t;t++)e[t].then(o(t),a);return n}var n,i,o="undefined"!=typeof window?window:{},s=o.MutationObserver||o.WebKitMutationObserver;if("undefined"!=typeof process&&"[object process]"==={}.toString.call(process))i=function(e,t){process.nextTick(function(){e.call(t)})};else if(s){var a=[],u=new s(function(){var e=a.slice();a=[],e.forEach(function(e){var t=e[0],r=e[1];t.call(r)})}),c=document.createElement("div");u.observe(c,{attributes:!0}),window.addEventListener("unload",function(){u.disconnect(),u=null}),i=function(e,t){a.push([e,t]),c.setAttribute("drainQueue","drainQueue")}}else i=function(e,t){setTimeout(function(){e.call(t)},1)};var h=function(e,t){this.type=e;for(var r in t)t.hasOwnProperty(r)&&(this[r]=t[r])},l=function(e,t){for(var r=0,n=e.length;n>r;r++)if(e[r][0]===t)return r;return-1},f=function(e){var t=e._promiseCallbacks;return t||(t=e._promiseCallbacks={}),t},m={mixin:function(e){return e.on=this.on,e.off=this.off,e.trigger=this.trigger,e},on:function(e,t,r){var n,i,o=f(this);for(e=e.split(/\s+/),r=r||this;i=e.shift();)n=o[i],n||(n=o[i]=[]),-1===l(n,t)&&n.push([t,r])},off:function(e,t){var r,n,i,o=f(this);for(e=e.split(/\s+/);n=e.shift();)t?(r=o[n],i=l(r,t),-1!==i&&r.splice(i,1)):o[n]=[]},trigger:function(e,t){var r,n,i,o,s,a=f(this);if(r=a[e])for(var u=0;r.length>u;u++)n=r[u],i=n[0],o=n[1],"object"!=typeof t&&(t={detail:t}),s=new h(e,t),i.call(o,s)}},b=function(){this.on("promise:resolved",function(e){this.trigger("success",{detail:e.detail})},this),this.on("promise:failed",function(e){this.trigger("error",{detail:e.detail})},this)},p=function(){},E=function(e,t,r,n){var i,o,s,a,u="function"==typeof r;if(u)try{i=r(n.detail),s=!0}catch(c){a=!0,o=c}else i=n.detail,s=!0;i&&"function"==typeof i.then?i.then(function(e){t.resolve(e)},function(e){t.reject(e)}):u&&s?t.resolve(i):a?t.reject(o):t[e](i)};return b.prototype={then:function(e,t){var r=new b;return this.isResolved&&n.async(function(){E("resolve",r,e,{detail:this.resolvedValue})},this),this.isRejected&&n.async(function(){E("reject",r,t,{detail:this.rejectedValue})},this),this.on("promise:resolved",function(t){E("resolve",r,e,t)}),this.on("promise:failed",function(e){E("reject",r,t,e)}),r},resolve:function(t){e(this,t),this.resolve=p,this.reject=p},reject:function(e){t(this,e),this.resolve=p,this.reject=p}},m.mixin(b.prototype),n={async:i,Promise:b,Event:h,EventTarget:m,all:r,raiseOnUncaughtExceptions:!0}})}(),function(){e("container",[],function(){function e(e){this.parent=e,this.dict={}}function t(t){this.parent=t,this.children=[],this.resolver=t&&t.resolver||function(){},this.registry=new e(t&&t.registry),this.cache=new e(t&&t.cache),this.typeInjections=new e(t&&t.typeInjections),this.injections={},this._options=new e(t&&t._options),this._typeOptions=new e(t&&t._typeOptions)}function r(e){throw new Error(e+" is not currently supported on child containers")}function n(e,t){var r=o(e,t,"singleton");return r!==!1}function i(e,t){var r={};if(!t)return r;for(var n,i,o=0,s=t.length;s>o;o++)n=t[o],i=e.lookup(n.fullName),r[n.property]=i;return r}function o(e,t,r){var n=e._options.get(t);if(n&&void 0!==n[r])return n[r];var i=t.split(":")[0];return n=e._typeOptions.get(i),n?n[r]:void 0}function s(e,t){var r=e.normalize(t);return e.resolve(r)}function a(e,t){var r,n=s(e,t),a=t.split(":"),u=a[0];if(o(e,t,"instantiate")===!1)return n;if(n){var c=[];c=c.concat(e.typeInjections.get(u)||[]),c=c.concat(e.injections[t]||[]);var h=i(e,c);return h.container=e,h._debugContainerKey=t,r=n.create(h)}}function u(e,t){e.cache.eachLocal(function(r,n){o(e,r,"instantiate")!==!1&&t(n)})}function c(e){e.cache.eachLocal(function(t,r){o(e,t,"instantiate")!==!1&&r.destroy()}),e.cache.dict={}}return e.prototype={get:function(e){var t=this.dict;return t.hasOwnProperty(e)?t[e]:this.parent?this.parent.get(e):void 0},set:function(e,t){this.dict[e]=t},has:function(e){var t=this.dict;return t.hasOwnProperty(e)?!0:this.parent?this.parent.has(e):!1},eachLocal:function(e,t){var r=this.dict;for(var n in r)r.hasOwnProperty(n)&&e.call(t,n,r[n])}},t.prototype={child:function(){var e=new t(this);return this.children.push(e),e},set:function(e,t,r){e[t]=r},register:function(e,t,r,n){var i;-1!==e.indexOf(":")?(n=r,r=t,i=e):i=e+":"+t;var o=this.normalize(i);this.registry.set(o,r),this._options.set(o,n||{})},resolve:function(e){return this.resolver(e)||this.registry.get(e)},normalize:function(e){return e},lookup:function(e,t){if(e=this.normalize(e),t=t||{},this.cache.has(e)&&t.singleton!==!1)return this.cache.get(e);var r=a(this,e);return r?(n(this,e)&&t.singleton!==!1&&this.cache.set(e,r),r):void 0},has:function(e){return this.cache.has(e)?!0:!!s(this,e)},optionsForType:function(e,t){this.parent&&r("optionsForType"),this._typeOptions.set(e,t)},options:function(e,t){this.optionsForType(e,t)},typeInjection:function(e,t,n){this.parent&&r("typeInjection");var i=this.typeInjections.get(e);i||(i=[],this.typeInjections.set(e,i)),i.push({property:t,fullName:n})},injection:function(e,t,n){if(this.parent&&r("injection"),-1===e.indexOf(":"))return this.typeInjection(e,t,n);var i=this.injections[e]=this.injections[e]||[];i.push({property:t,fullName:n})},destroy:function(){this.isDestroyed=!0;for(var e=0,t=this.children.length;t>e;e++)this.children[e].destroy();this.children=[],u(this,function(e){e.isDestroying=!0}),u(this,function(e){e.destroy()}),delete this.parent,this.isDestroyed=!0},reset:function(){for(var e=0,t=this.children.length;t>e;e++)c(this.children[e]);c(this)}},t})}(),function(){function e(r,n,i,o){var s,a,u;if("object"!=typeof r||null===r)return r;if(n&&(a=t(i,r))>=0)return o[a];if("array"===Ember.typeOf(r)){if(s=r.slice(),n)for(a=s.length;--a>=0;)s[a]=e(s[a],n,i,o)}else if(Ember.Copyable&&Ember.Copyable.detect(r))s=r.copy(n,i,o);else{s={};for(u in r)r.hasOwnProperty(u)&&"__"!==u.substring(0,2)&&(s[u]=n?e(r[u],n,i,o):r[u])}return n&&(i.push(r),o.push(s)),s}var t=Ember.EnumerableUtils.indexOf;Ember.compare=function r(e,t){if(e===t)return 0;var n=Ember.typeOf(e),i=Ember.typeOf(t),o=Ember.Comparable;if(o){if("instance"===n&&o.detect(e.constructor))return e.constructor.compare(e,t);if("instance"===i&&o.detect(t.constructor))return 1-t.constructor.compare(t,e)}var s=Ember.ORDER_DEFINITION_MAPPING;if(!s){var a=Ember.ORDER_DEFINITION;s=Ember.ORDER_DEFINITION_MAPPING={};var u,c;for(u=0,c=a.length;c>u;++u)s[a[u]]=u;delete Ember.ORDER_DEFINITION}var h=s[n],l=s[i];if(l>h)return-1;if(h>l)return 1;switch(n){case"boolean":case"number":return t>e?-1:e>t?1:0;case"string":var f=e.localeCompare(t);return 0>f?-1:f>0?1:0;case"array":for(var m=e.length,b=t.length,p=Math.min(m,b),E=0,d=0;0===E&&p>d;)E=r(e[d],t[d]),d++;return 0!==E?E:b>m?-1:m>b?1:0;case"instance":return Ember.Comparable&&Ember.Comparable.detect(e)?e.compare(e,t):0;case"date":var g=e.getTime(),v=t.getTime();return v>g?-1:g>v?1:0;default:return 0}},Ember.copy=function(t,r){return"object"!=typeof t||null===t?t:Ember.Copyable&&Ember.Copyable.detect(t)?t.copy(r):e(t,r,r?[]:null,r?[]:null)},Ember.inspect=function(e){if("object"!=typeof e||null===e)return e+"";var t,r=[];for(var n in e)if(e.hasOwnProperty(n)){if(t=e[n],"toString"===t)continue;"function"===Ember.typeOf(t)&&(t="function() { ... }"),r.push(n+": "+t)}return"{"+r.join(", ")+"}"},Ember.isEqual=function(e,t){return e&&"function"==typeof e.isEqual?e.isEqual(t):e===t},Ember.ORDER_DEFINITION=Ember.ENV.ORDER_DEFINITION||["undefined","null","boolean","number","string","array","object","instance","function","class","date"],Ember.keys=Object.keys,Ember.keys||(Ember.keys=function(e){var t=[];for(var r in e)e.hasOwnProperty(r)&&t.push(r);return t});var n=["description","fileName","lineNumber","message","name","number","stack"];Ember.Error=function(){for(var e=Error.prototype.constructor.apply(this,arguments),t=0;n.length>t;t++)this[n[t]]=e[n[t]]},Ember.Error.prototype=Ember.create(Error.prototype)}(),function(){Ember.RSVP=t("rsvp")}(),function(){var e=/[ _]/g,t={},r=/([a-z])([A-Z])/g,n=/(\-|_|\.|\s)+(.)?/g,i=/([a-z\d])([A-Z]+)/g,o=/\-|\s+/g;Ember.STRINGS={},Ember.String={fmt:function(e,t){var r=0;return e.replace(/%@([0-9]+)?/g,function(e,n){return n=n?parseInt(n,0)-1:r++,e=t[n],(null===e?"(null)":void 0===e?"":e).toString()})},loc:function(e,t){return e=Ember.STRINGS[e]||e,Ember.String.fmt(e,t)},w:function(e){return e.split(/\s+/)},decamelize:function(e){return e.replace(r,"$1_$2").toLowerCase()},dasherize:function(r){var n,i=t,o=i.hasOwnProperty(r);return o?i[r]:(n=Ember.String.decamelize(r).replace(e,"-"),i[r]=n,n)},camelize:function(e){return e.replace(n,function(e,t,r){return r?r.toUpperCase():""}).replace(/^([A-Z])/,function(e){return e.toLowerCase()})},classify:function(e){for(var t=e.split("."),r=[],n=0,i=t.length;i>n;n++){var o=Ember.String.camelize(t[n]);r.push(o.charAt(0).toUpperCase()+o.substr(1))}return r.join(".")},underscore:function(e){return e.replace(i,"$1_$2").replace(o,"_").toLowerCase()},capitalize:function(e){return e.charAt(0).toUpperCase()+e.substr(1)}}}(),function(){var e=Ember.String.fmt,t=Ember.String.w,r=Ember.String.loc,n=Ember.String.camelize,i=Ember.String.decamelize,o=Ember.String.dasherize,s=Ember.String.underscore,a=Ember.String.capitalize,u=Ember.String.classify;(Ember.EXTEND_PROTOTYPES===!0||Ember.EXTEND_PROTOTYPES.String)&&(String.prototype.fmt=function(){return e(this,arguments)},String.prototype.w=function(){return t(this)},String.prototype.loc=function(){return r(this,arguments)},String.prototype.camelize=function(){return n(this)},String.prototype.decamelize=function(){return i(this)},String.prototype.dasherize=function(){return o(this)},String.prototype.underscore=function(){return s(this)},String.prototype.classify=function(){return u(this)},String.prototype.capitalize=function(){return a(this)})}(),function(){var e=Array.prototype.slice;(Ember.EXTEND_PROTOTYPES===!0||Ember.EXTEND_PROTOTYPES.Function)&&(Function.prototype.property=function(){var e=Ember.computed(this);return e.property.apply(e,arguments)},Function.prototype.observes=function(){return this.__ember_observes__=e.call(arguments),this},Function.prototype.observesBefore=function(){return this.__ember_observesBefore__=e.call(arguments),this})}(),function(){function e(){return 0===a.length?{}:a.pop()}function t(e){return a.push(e),null}function r(e,t){function r(r){var o=n(r,e);return i?t===o:!!o}var i=2===arguments.length;return r}var n=Ember.get,i=Ember.set,o=Array.prototype.slice,s=Ember.EnumerableUtils.indexOf,a=[];Ember.Enumerable=Ember.Mixin.create({isEnumerable:!0,nextObject:Ember.required(Function),firstObject:Ember.computed(function(){if(0===n(this,"length"))return void 0;var r,i=e();return r=this.nextObject(0,null,i),t(i),r}).property("[]"),lastObject:Ember.computed(function(){var r=n(this,"length");if(0===r)return void 0;var i,o=e(),s=0,a=null;do a=i,i=this.nextObject(s++,a,o);while(void 0!==i);return t(o),a}).property("[]"),contains:function(e){return void 0!==this.find(function(t){return t===e})},forEach:function(r,i){if("function"!=typeof r)throw new TypeError;var o=n(this,"length"),s=null,a=e();void 0===i&&(i=null);for(var u=0;o>u;u++){var c=this.nextObject(u,s,a);r.call(i,c,u,this),s=c}return s=null,a=t(a),this},getEach:function(e){return this.mapProperty(e)},setEach:function(e,t){return this.forEach(function(r){i(r,e,t)})},map:function(e,t){var r=Ember.A([]);return this.forEach(function(n,i,o){r[i]=e.call(t,n,i,o)}),r},mapProperty:function(e){return this.map(function(t){return n(t,e)})},filter:function(e,t){var r=Ember.A([]);return this.forEach(function(n,i,o){e.call(t,n,i,o)&&r.push(n)}),r},reject:function(e,t){return this.filter(function(){return!e.apply(t,arguments)})},filterProperty:function(){return this.filter(r.apply(this,arguments))},rejectProperty:function(e,t){var r=function(r){return n(r,e)===t},i=function(t){return!!n(t,e)},o=2===arguments.length?r:i;return this.reject(o)},find:function(r,i){var o=n(this,"length");void 0===i&&(i=null);for(var s,a,u=null,c=!1,h=e(),l=0;o>l&&!c;l++)s=this.nextObject(l,u,h),(c=r.call(i,s,l,this))&&(a=s),u=s;return s=u=null,h=t(h),a},findProperty:function(){return this.find(r.apply(this,arguments))},every:function(e,t){return!this.find(function(r,n,i){return!e.call(t,r,n,i)})},everyProperty:function(){return this.every(r.apply(this,arguments))},some:function(e,t){return!!this.find(function(r,n,i){return!!e.call(t,r,n,i)})},someProperty:function(){return this.some(r.apply(this,arguments))},reduce:function(e,t,r){if("function"!=typeof e)throw new TypeError;var n=t;return this.forEach(function(t,i){n=e.call(null,n,t,i,this,r)},this),n},invoke:function(e){var t,r=Ember.A([]);return arguments.length>1&&(t=o.call(arguments,1)),this.forEach(function(n,i){var o=n&&n[e];"function"==typeof o&&(r[i]=t?o.apply(n,t):o.call(n))},this),r},toArray:function(){var e=Ember.A([]);return this.forEach(function(t,r){e[r]=t}),e},compact:function(){return this.filter(function(e){return null!=e})},without:function(e){if(!this.contains(e))return this;var t=Ember.A([]);return this.forEach(function(r){r!==e&&(t[t.length]=r)}),t},uniq:function(){var e=Ember.A([]);return this.forEach(function(t){0>s(e,t)&&e.push(t)}),e},"[]":Ember.computed(function(){return this}),addEnumerableObserver:function(e,t){var r=t&&t.willChange||"enumerableWillChange",i=t&&t.didChange||"enumerableDidChange",o=n(this,"hasEnumerableObservers");return o||Ember.propertyWillChange(this,"hasEnumerableObservers"),Ember.addListener(this,"@enumerable:before",e,r),Ember.addListener(this,"@enumerable:change",e,i),o||Ember.propertyDidChange(this,"hasEnumerableObservers"),this},removeEnumerableObserver:function(e,t){var r=t&&t.willChange||"enumerableWillChange",i=t&&t.didChange||"enumerableDidChange",o=n(this,"hasEnumerableObservers");return o&&Ember.propertyWillChange(this,"hasEnumerableObservers"),Ember.removeListener(this,"@enumerable:before",e,r),Ember.removeListener(this,"@enumerable:change",e,i),o&&Ember.propertyDidChange(this,"hasEnumerableObservers"),this},hasEnumerableObservers:Ember.computed(function(){return Ember.hasListeners(this,"@enumerable:change")||Ember.hasListeners(this,"@enumerable:before")}),enumerableContentWillChange:function(e,t){var r,i,o;return r="number"==typeof e?e:e?n(e,"length"):e=-1,i="number"==typeof t?t:t?n(t,"length"):t=-1,o=0>i||0>r||0!==i-r,-1===e&&(e=null),-1===t&&(t=null),Ember.propertyWillChange(this,"[]"),o&&Ember.propertyWillChange(this,"length"),Ember.sendEvent(this,"@enumerable:before",[this,e,t]),this},enumerableContentDidChange:function(e,t){var r,i,o;return r="number"==typeof e?e:e?n(e,"length"):e=-1,i="number"==typeof t?t:t?n(t,"length"):t=-1,o=0>i||0>r||0!==i-r,-1===e&&(e=null),-1===t&&(t=null),Ember.sendEvent(this,"@enumerable:change",[this,e,t]),o&&Ember.propertyDidChange(this,"length"),Ember.propertyDidChange(this,"[]"),this}})}(),function(){function e(e){return null===e||void 0===e}var t=Ember.get,r=(Ember.set,Ember.EnumerableUtils.map),n=Ember.cacheFor;Ember.Array=Ember.Mixin.create(Ember.Enumerable,{isSCArray:!0,length:Ember.required(),objectAt:function(e){return 0>e||e>=t(this,"length")?void 0:t(this,e)},objectsAt:function(e){var t=this;return r(e,function(e){return t.objectAt(e)})},nextObject:function(e){return this.objectAt(e)},"[]":Ember.computed(function(e,r){return void 0!==r&&this.replace(0,t(this,"length"),r),this}),firstObject:Ember.computed(function(){return this.objectAt(0)}),lastObject:Ember.computed(function(){return this.objectAt(t(this,"length")-1)}),contains:function(e){return this.indexOf(e)>=0},slice:function(r,n){var i=Ember.A([]),o=t(this,"length");for(e(r)&&(r=0),(e(n)||n>o)&&(n=o),0>r&&(r=o+r),0>n&&(n=o+n);n>r;)i[i.length]=this.objectAt(r++);return i},indexOf:function(e,r){var n,i=t(this,"length");for(void 0===r&&(r=0),0>r&&(r+=i),n=r;i>n;n++)if(this.objectAt(n,!0)===e)return n;return-1},lastIndexOf:function(e,r){var n,i=t(this,"length");for((void 0===r||r>=i)&&(r=i-1),0>r&&(r+=i),n=r;n>=0;n--)if(this.objectAt(n)===e)return n;return-1},addArrayObserver:function(e,r){var n=r&&r.willChange||"arrayWillChange",i=r&&r.didChange||"arrayDidChange",o=t(this,"hasArrayObservers");return o||Ember.propertyWillChange(this,"hasArrayObservers"),Ember.addListener(this,"@array:before",e,n),Ember.addListener(this,"@array:change",e,i),o||Ember.propertyDidChange(this,"hasArrayObservers"),this},removeArrayObserver:function(e,r){var n=r&&r.willChange||"arrayWillChange",i=r&&r.didChange||"arrayDidChange",o=t(this,"hasArrayObservers");return o&&Ember.propertyWillChange(this,"hasArrayObservers"),Ember.removeListener(this,"@array:before",e,n),Ember.removeListener(this,"@array:change",e,i),o&&Ember.propertyDidChange(this,"hasArrayObservers"),this},hasArrayObservers:Ember.computed(function(){return Ember.hasListeners(this,"@array:change")||Ember.hasListeners(this,"@array:before")}),arrayContentWillChange:function(e,r,n){void 0===e?(e=0,r=n=-1):(void 0===r&&(r=-1),void 0===n&&(n=-1)),Ember.isWatching(this,"@each")&&t(this,"@each"),Ember.sendEvent(this,"@array:before",[this,e,r,n]);var i,o;if(e>=0&&r>=0&&t(this,"hasEnumerableObservers")){i=[],o=e+r;for(var s=e;o>s;s++)i.push(this.objectAt(s))}else i=r;return this.enumerableContentWillChange(i,n),this},arrayContentDidChange:function(e,r,i){void 0===e?(e=0,r=i=-1):(void 0===r&&(r=-1),void 0===i&&(i=-1));var o,s;if(e>=0&&i>=0&&t(this,"hasEnumerableObservers")){o=[],s=e+i;for(var a=e;s>a;a++)o.push(this.objectAt(a))}else o=i;this.enumerableContentDidChange(r,o),Ember.sendEvent(this,"@array:change",[this,e,r,i]);var u=t(this,"length"),c=n(this,"firstObject"),h=n(this,"lastObject");return this.objectAt(0)!==c&&(Ember.propertyWillChange(this,"firstObject"),Ember.propertyDidChange(this,"firstObject")),this.objectAt(u-1)!==h&&(Ember.propertyWillChange(this,"lastObject"),Ember.propertyDidChange(this,"lastObject")),this},"@each":Ember.computed(function(){return this.__each||(this.__each=new Ember.EachProxy(this)),this.__each})})}(),function(){Ember.Comparable=Ember.Mixin.create({isComparable:!0,compare:Ember.required(Function)})}(),function(){var e=Ember.get;Ember.set,Ember.Copyable=Ember.Mixin.create({copy:Ember.required(Function),frozenCopy:function(){if(Ember.Freezable&&Ember.Freezable.detect(this))return e(this,"isFrozen")?this:this.copy().freeze();throw new Error(Ember.String.fmt("%@ does not support freezing",[this]))}})}(),function(){var e=Ember.get,t=Ember.set;Ember.Freezable=Ember.Mixin.create({isFrozen:!1,freeze:function(){return e(this,"isFrozen")?this:(t(this,"isFrozen",!0),this)}}),Ember.FROZEN_ERROR="Frozen object cannot be modified."}(),function(){var e=Ember.EnumerableUtils.forEach;Ember.MutableEnumerable=Ember.Mixin.create(Ember.Enumerable,{addObject:Ember.required(Function),addObjects:function(t){return Ember.beginPropertyChanges(this),e(t,function(e){this.addObject(e)},this),Ember.endPropertyChanges(this),this},removeObject:Ember.required(Function),removeObjects:function(t){return Ember.beginPropertyChanges(this),e(t,function(e){this.removeObject(e)},this),Ember.endPropertyChanges(this),this}})}(),function(){var e="Index out of range",t=[],r=Ember.get;Ember.set,Ember.MutableArray=Ember.Mixin.create(Ember.Array,Ember.MutableEnumerable,{replace:Ember.required(),clear:function(){var e=r(this,"length");return 0===e?this:(this.replace(0,e,t),this)},insertAt:function(t,n){if(t>r(this,"length"))throw new Error(e);return this.replace(t,0,[n]),this},removeAt:function(n,i){if("number"==typeof n){if(0>n||n>=r(this,"length"))throw new Error(e);void 0===i&&(i=1),this.replace(n,i,t)}return this},pushObject:function(e){return this.insertAt(r(this,"length"),e),e},pushObjects:function(e){return this.replace(r(this,"length"),0,e),this},popObject:function(){var e=r(this,"length");if(0===e)return null;var t=this.objectAt(e-1);return this.removeAt(e-1,1),t},shiftObject:function(){if(0===r(this,"length"))return null;var e=this.objectAt(0);return this.removeAt(0),e},unshiftObject:function(e){return this.insertAt(0,e),e},unshiftObjects:function(e){return this.replace(0,0,e),this},reverseObjects:function(){var e=r(this,"length");if(0===e)return this;var t=this.toArray().reverse();return this.replace(0,e,t),this},setObjects:function(e){if(0===e.length)return this.clear();var t=r(this,"length");return this.replace(0,t,e),this},removeObject:function(e){for(var t=r(this,"length")||0;--t>=0;){var n=this.objectAt(t);n===e&&this.removeAt(t)}return this},addObject:function(e){return this.contains(e)||this.pushObject(e),this}})}(),function(){var e=Ember.get,t=Ember.set;Ember.Observable=Ember.Mixin.create({get:function(t){return e(this,t)},getProperties:function(){var t={},r=arguments;1===arguments.length&&"array"===Ember.typeOf(arguments[0])&&(r=arguments[0]);for(var n=0;r.length>n;n++)t[r[n]]=e(this,r[n]);return t},set:function(e,r){return t(this,e,r),this},setProperties:function(e){return Ember.setProperties(this,e)},beginPropertyChanges:function(){return Ember.beginPropertyChanges(),this},endPropertyChanges:function(){return Ember.endPropertyChanges(),this},propertyWillChange:function(e){return Ember.propertyWillChange(this,e),this},propertyDidChange:function(e){return Ember.propertyDidChange(this,e),this},notifyPropertyChange:function(e){return this.propertyWillChange(e),this.propertyDidChange(e),this},addBeforeObserver:function(e,t,r){Ember.addBeforeObserver(this,e,t,r)},addObserver:function(e,t,r){Ember.addObserver(this,e,t,r)},removeObserver:function(e,t,r){Ember.removeObserver(this,e,t,r)},hasObserverFor:function(e){return Ember.hasListeners(this,e+":change")},getPath:function(e){return this.get(e)},setPath:function(e,t){return this.set(e,t)},getWithDefault:function(e,t){return Ember.getWithDefault(this,e,t)},incrementProperty:function(r,n){return n||(n=1),t(this,r,(e(this,r)||0)+n),e(this,r)},decrementProperty:function(r,n){return n||(n=1),t(this,r,(e(this,r)||0)-n),e(this,r)},toggleProperty:function(r){return t(this,r,!e(this,r)),e(this,r)},cacheFor:function(e){return Ember.cacheFor(this,e)},observersForKey:function(e){return Ember.observersFor(this,e)}})}(),function(){var e=Ember.get;Ember.set,Ember.TargetActionSupport=Ember.Mixin.create({target:null,action:null,actionContext:null,targetObject:Ember.computed(function(){var t=e(this,"target");if("string"===Ember.typeOf(t)){var r=e(this,t);return void 0===r&&(r=e(Ember.lookup,t)),r}return t}).property("target"),actionContextObject:Ember.computed(function(){var t=e(this,"actionContext");if("string"===Ember.typeOf(t)){var r=e(this,t);return void 0===r&&(r=e(Ember.lookup,t)),r}return t}).property("actionContext"),triggerAction:function(t){t=t||{};var r=t.action||e(this,"action"),n=t.target||e(this,"targetObject"),i=t.actionContext||e(this,"actionContextObject")||this;if(n&&r){var o;return o=n.send?n.send.apply(n,[r,i]):n[r].apply(n,[i]),o!==!1&&(o=!0),o}return!1
|
17
|
-
}})}(),function(){Ember.Evented=Ember.Mixin.create({on:function(e,t,r){return Ember.addListener(this,e,t,r),this},one:function(e,t,r){return r||(r=t,t=null),Ember.addListener(this,e,t,r,!0),this},trigger:function(e){var t,r,n=[];for(t=1,r=arguments.length;r>t;t++)n.push(arguments[t]);Ember.sendEvent(this,e,n)},fire:function(){this.trigger.apply(this,arguments)},off:function(e,t,r){return Ember.removeListener(this,e,t,r),this},has:function(e){return Ember.hasListeners(this,e)}})}(),function(){var e=t("rsvp");e.async=function(e,t){Ember.run.schedule("actions",t,e)};var r=Ember.get;Ember.DeferredMixin=Ember.Mixin.create({then:function(){var e=r(this,"promise");return e.then.apply(e,arguments)},resolve:function(e){r(this,"promise").resolve(e)},reject:function(e){r(this,"promise").reject(e)},promise:Ember.computed(function(){return new e.Promise})})}(),function(){Ember.Container=t("container"),Ember.Container.set=Ember.set}(),function(){function e(){var e,t,o=!1,s=function(){o||s.proto(),n(this,i,g),n(this,"_super",g);var u=a(this);if(u.proto=this,e){var h=e;e=null,this.reopen.apply(this,h)}if(t){var l=t;t=null;for(var f=this.concatenatedProperties,m=0,p=l.length;p>m;m++){var v=l[m];for(var y in v)if(v.hasOwnProperty(y)){var _=v[y],C=Ember.IS_BINDING;if(C.test(y)){var O=u.bindings;O?u.hasOwnProperty("bindings")||(O=u.bindings=r(u.bindings)):O=u.bindings={},O[y]=_}var w=u.descs[y];if(f&&d(f,y)>=0){var S=this[y];_=S?"function"==typeof S.concat?S.concat(_):Ember.makeArray(S).concat(_):Ember.makeArray(_)}w?w.set(this,y,_):"function"!=typeof this.setUnknownProperty||y in this?E?Ember.defineProperty(this,y,null,_):this[y]=_:this.setUnknownProperty(y,_)}}}b(this,u),delete u.proto,c(this),this.init.apply(this,arguments)};return s.toString=f.prototype.toString,s.willReopen=function(){o&&(s.PrototypeMixin=f.create(s.PrototypeMixin)),o=!1},s._initMixins=function(t){e=t},s._initProperties=function(e){t=e},s.proto=function(){var e=s.superclass;return e&&e.proto(),o||(o=!0,s.PrototypeMixin.applyPartial(s.prototype),u(s.prototype)),this.prototype},s}function t(e){return function(){return e}}var r=(Ember.set,Ember.get,Ember.create),n=Ember.platform.defineProperty,i=Ember.GUID_KEY,o=Ember.guidFor,s=Ember.generateGuid,a=Ember.meta,u=Ember.rewatch,c=Ember.finishChains,h=Ember.destroy,l=Ember.run.schedule,f=Ember.Mixin,m=f._apply,b=f.finishPartial,p=f.prototype.reopen,E=Ember.ENV.MANDATORY_SETTER,d=Ember.EnumerableUtils.indexOf,g={configurable:!0,writable:!0,enumerable:!1,value:void 0},v=e();v.toString=function(){return"Ember.CoreObject"},v.PrototypeMixin=f.create({reopen:function(){return m(this,arguments,!0),this},isInstance:!0,init:function(){},concatenatedProperties:null,isDestroyed:!1,isDestroying:!1,destroy:function(){return this._didCallDestroy?void 0:(this.isDestroying=!0,this._didCallDestroy=!0,l("destroy",this,this._scheduledDestroy),this)},willDestroy:Ember.K,_scheduledDestroy:function(){this.willDestroy&&this.willDestroy(),h(this),this.isDestroyed=!0,this.didDestroy&&this.didDestroy()},bind:function(e,t){return t instanceof Ember.Binding||(t=Ember.Binding.from(t)),t.to(e).connect(this),t},toString:function(){var e="function"==typeof this.toStringExtension,r=e?":"+this.toStringExtension():"",n="<"+this.constructor.toString()+":"+o(this)+r+">";return this.toString=t(n),n}}),v.PrototypeMixin.ownerConstructor=v,Ember.config.overridePrototypeMixin&&Ember.config.overridePrototypeMixin(v.PrototypeMixin),v.__super__=null;var y=f.create({ClassMixin:Ember.required(),PrototypeMixin:Ember.required(),isClass:!0,isMethod:!1,extend:function(){var t,n=e();return n.ClassMixin=f.create(this.ClassMixin),n.PrototypeMixin=f.create(this.PrototypeMixin),n.ClassMixin.ownerConstructor=n,n.PrototypeMixin.ownerConstructor=n,p.apply(n.PrototypeMixin,arguments),n.superclass=this,n.__super__=this.prototype,t=n.prototype=r(this.prototype),t.constructor=n,s(t,"ember"),a(t).proto=t,n.ClassMixin.apply(n),n},createWithMixins:function(){var e=this;return arguments.length>0&&this._initMixins(arguments),new e},create:function(){var e=this;return arguments.length>0&&this._initProperties(arguments),new e},reopen:function(){return this.willReopen(),p.apply(this.PrototypeMixin,arguments),this},reopenClass:function(){return p.apply(this.ClassMixin,arguments),m(this,arguments,!1),this},detect:function(e){if("function"!=typeof e)return!1;for(;e;){if(e===this)return!0;e=e.superclass}return!1},detectInstance:function(e){return e instanceof this},metaForProperty:function(e){var t=a(this.proto(),!1).descs[e];return t._meta||{}},eachComputedProperty:function(e,t){var r,n=this.proto(),i=a(n).descs,o={};for(var s in i)r=i[s],r instanceof Ember.ComputedProperty&&e.call(t||this,s,r._meta||o)}});y.ownerConstructor=v,Ember.config.overrideClassMixin&&Ember.config.overrideClassMixin(y),v.ClassMixin=y,y.apply(v),Ember.CoreObject=v}(),function(){Ember.Object=Ember.CoreObject.extend(Ember.Observable),Ember.Object.toString=function(){return"Ember.Object"}}(),function(){function e(t,r,i){var s=t.length;c[t.join(".")]=r;for(var a in r)if(h.call(r,a)){var u=r[a];if(t[s]=a,u&&u.toString===n)u.toString=o(t.join(".")),u[f]=t.join(".");else if(u&&u.isNamespace){if(i[l(u)])continue;i[l(u)]=!0,e(t,u,i)}}t.length=s}function t(){var e,t,r=Ember.Namespace,n=Ember.lookup;if(!r.PROCESSED)for(var i in n)if("parent"!==i&&"top"!==i&&"frameElement"!==i&&"webkitStorageInfo"!==i&&!("globalStorage"===i&&n.StorageList&&n.globalStorage instanceof n.StorageList||n.hasOwnProperty&&!n.hasOwnProperty(i))){try{e=Ember.lookup[i],t=e&&e.isNamespace}catch(o){continue}t&&(e[f]=i)}}function r(e){var t=e.superclass;return t?t[f]?t[f]:r(t):void 0}function n(){Ember.BOOTED||this[f]||i();var e;if(this[f])e=this[f];else{var t=r(this);e=t?"(subclass of "+t+")":"(unknown mixin)",this.toString=o(e)}return e}function i(){var r=!u.PROCESSED,n=Ember.anyUnprocessedMixins;if(r&&(t(),u.PROCESSED=!0),r||n){for(var i,o=u.NAMESPACES,s=0,a=o.length;a>s;s++)i=o[s],e([i.toString()],i,{});Ember.anyUnprocessedMixins=!1}}function o(e){return function(){return e}}var s=Ember.get,a=Ember.ArrayPolyfills.indexOf,u=Ember.Namespace=Ember.Object.extend({isNamespace:!0,init:function(){Ember.Namespace.NAMESPACES.push(this),Ember.Namespace.PROCESSED=!1},toString:function(){var e=s(this,"name");return e?e:(t(),this[Ember.GUID_KEY+"_name"])},nameClasses:function(){e([this.toString()],this,{})},destroy:function(){var e=Ember.Namespace.NAMESPACES;Ember.lookup[this.toString()]=void 0,e.splice(a.call(e,this),1),this._super()}});u.reopenClass({NAMESPACES:[Ember],NAMESPACES_BY_ID:{},PROCESSED:!1,processAll:i,byName:function(e){return Ember.BOOTED||i(),c[e]}});var c=u.NAMESPACES_BY_ID,h={}.hasOwnProperty,l=Ember.guidFor,f=Ember.NAME_KEY=Ember.GUID_KEY+"_name";Ember.Mixin.prototype.toString=n}(),function(){Ember.Application=Ember.Namespace.extend()}(),function(){var e="Index out of range",t=[],r=Ember.get;Ember.set,Ember.ArrayProxy=Ember.Object.extend(Ember.MutableArray,{content:null,arrangedContent:Ember.computed.alias("content"),objectAtContent:function(e){return r(this,"arrangedContent").objectAt(e)},replaceContent:function(e,t,n){r(this,"content").replace(e,t,n)},_contentWillChange:Ember.beforeObserver(function(){this._teardownContent()},"content"),_teardownContent:function(){var e=r(this,"content");e&&e.removeArrayObserver(this,{willChange:"contentArrayWillChange",didChange:"contentArrayDidChange"})},contentArrayWillChange:Ember.K,contentArrayDidChange:Ember.K,_contentDidChange:Ember.observer(function(){r(this,"content"),this._setupContent()},"content"),_setupContent:function(){var e=r(this,"content");e&&e.addArrayObserver(this,{willChange:"contentArrayWillChange",didChange:"contentArrayDidChange"})},_arrangedContentWillChange:Ember.beforeObserver(function(){var e=r(this,"arrangedContent"),t=e?r(e,"length"):0;this.arrangedContentArrayWillChange(this,0,t,void 0),this.arrangedContentWillChange(this),this._teardownArrangedContent(e)},"arrangedContent"),_arrangedContentDidChange:Ember.observer(function(){var e=r(this,"arrangedContent"),t=e?r(e,"length"):0;this._setupArrangedContent(),this.arrangedContentDidChange(this),this.arrangedContentArrayDidChange(this,0,void 0,t)},"arrangedContent"),_setupArrangedContent:function(){var e=r(this,"arrangedContent");e&&e.addArrayObserver(this,{willChange:"arrangedContentArrayWillChange",didChange:"arrangedContentArrayDidChange"})},_teardownArrangedContent:function(){var e=r(this,"arrangedContent");e&&e.removeArrayObserver(this,{willChange:"arrangedContentArrayWillChange",didChange:"arrangedContentArrayDidChange"})},arrangedContentWillChange:Ember.K,arrangedContentDidChange:Ember.K,objectAt:function(e){return r(this,"content")&&this.objectAtContent(e)},length:Ember.computed(function(){var e=r(this,"arrangedContent");return e?r(e,"length"):0}),_replace:function(e,t,n){var i=r(this,"content");return i&&this.replaceContent(e,t,n),this},replace:function(){if(r(this,"arrangedContent")!==r(this,"content"))throw new Ember.Error("Using replace on an arranged ArrayProxy is not allowed.");this._replace.apply(this,arguments)},_insertAt:function(t,n){if(t>r(this,"content.length"))throw new Error(e);return this._replace(t,0,[n]),this},insertAt:function(e,t){if(r(this,"arrangedContent")===r(this,"content"))return this._insertAt(e,t);throw new Ember.Error("Using insertAt on an arranged ArrayProxy is not allowed.")},removeAt:function(n,i){if("number"==typeof n){var o,s=r(this,"content"),a=r(this,"arrangedContent"),u=[];if(0>n||n>=r(this,"length"))throw new Error(e);for(void 0===i&&(i=1),o=n;n+i>o;o++)u.push(s.indexOf(a.objectAt(o)));for(u.sort(function(e,t){return t-e}),Ember.beginPropertyChanges(),o=0;u.length>o;o++)this._replace(u[o],1,t);Ember.endPropertyChanges()}return this},pushObject:function(e){return this._insertAt(r(this,"content.length"),e),e},pushObjects:function(e){return this._replace(r(this,"length"),0,e),this},setObjects:function(e){if(0===e.length)return this.clear();var t=r(this,"length");return this._replace(0,t,e),this},unshiftObject:function(e){return this._insertAt(0,e),e},unshiftObjects:function(e){return this._replace(0,0,e),this},slice:function(){var e=this.toArray();return e.slice.apply(e,arguments)},arrangedContentArrayWillChange:function(e,t,r,n){this.arrayContentWillChange(t,r,n)},arrangedContentArrayDidChange:function(e,t,r,n){this.arrayContentDidChange(t,r,n)},init:function(){this._super(),this._setupContent(),this._setupArrangedContent()},willDestroy:function(){this._teardownArrangedContent(),this._teardownContent()}})}(),function(){function e(e,t){var r=t.slice(8);r in this||u(this,r)}function t(e,t){var r=t.slice(8);r in this||c(this,r)}var r=Ember.get,n=Ember.set,i=(Ember.String.fmt,Ember.addBeforeObserver),o=Ember.addObserver,s=Ember.removeBeforeObserver,a=Ember.removeObserver,u=Ember.propertyWillChange,c=Ember.propertyDidChange;Ember.ObjectProxy=Ember.Object.extend({content:null,_contentDidChange:Ember.observer(function(){},"content"),isTruthy:Ember.computed.bool("content"),_debugContainerKey:null,willWatchProperty:function(r){var n="content."+r;i(this,n,null,e),o(this,n,null,t)},didUnwatchProperty:function(r){var n="content."+r;s(this,n,null,e),a(this,n,null,t)},unknownProperty:function(e){var t=r(this,"content");return t?r(t,e):void 0},setUnknownProperty:function(e,t){var i=r(this,"content");return n(i,e,t)}}),Ember.ObjectProxy.reopenClass({create:function(){var e,t,r,n,i,o;if(arguments.length){for(t=this.proto(),r=0,n=arguments.length;n>r;r++){i=arguments[r];for(o in i)!i.hasOwnProperty(o)||o in t||(e||(e={}),e[o]=null)}e&&this._initMixins([e])}return this._super.apply(this,arguments)}})}(),function(){function e(e,t,r,i,o){var s,a=r._objects;for(a||(a=r._objects={});--o>=i;){var u=e.objectAt(o);u&&(Ember.addBeforeObserver(u,t,r,"contentKeyWillChange"),Ember.addObserver(u,t,r,"contentKeyDidChange"),s=n(u),a[s]||(a[s]=[]),a[s].push(o))}}function t(e,t,r,i,o){var s=r._objects;s||(s=r._objects={});for(var a,u;--o>=i;){var c=e.objectAt(o);c&&(Ember.removeBeforeObserver(c,t,r,"contentKeyWillChange"),Ember.removeObserver(c,t,r,"contentKeyDidChange"),u=n(c),a=s[u],a[a.indexOf(o)]=null)}}var r=(Ember.set,Ember.get),n=Ember.guidFor,i=Ember.EnumerableUtils.forEach,o=Ember.Object.extend(Ember.Array,{init:function(e,t,r){this._super(),this._keyName=t,this._owner=r,this._content=e},objectAt:function(e){var t=this._content.objectAt(e);return t&&r(t,this._keyName)},length:Ember.computed(function(){var e=this._content;return e?r(e,"length"):0})}),s=/^.+:(before|change)$/;Ember.EachProxy=Ember.Object.extend({init:function(e){this._super(),this._content=e,e.addArrayObserver(this),i(Ember.watchedEvents(this),function(e){this.didAddListener(e)},this)},unknownProperty:function(e){var t;return t=new o(this._content,e,this),Ember.defineProperty(this,e,null,t),this.beginObservingContentKey(e),t},arrayWillChange:function(e,r,n){var i,o,s=this._keys;o=n>0?r+n:-1,Ember.beginPropertyChanges(this);for(i in s)s.hasOwnProperty(i)&&(o>0&&t(e,i,this,r,o),Ember.propertyWillChange(this,i));Ember.propertyWillChange(this._content,"@each"),Ember.endPropertyChanges(this)},arrayDidChange:function(t,r,n,i){var o,s,a=this._keys;s=i>0?r+i:-1,Ember.beginPropertyChanges(this);for(o in a)a.hasOwnProperty(o)&&(s>0&&e(t,o,this,r,s),Ember.propertyDidChange(this,o));Ember.propertyDidChange(this._content,"@each"),Ember.endPropertyChanges(this)},didAddListener:function(e){s.test(e)&&this.beginObservingContentKey(e.slice(0,-7))},didRemoveListener:function(e){s.test(e)&&this.stopObservingContentKey(e.slice(0,-7))},beginObservingContentKey:function(t){var n=this._keys;if(n||(n=this._keys={}),n[t])n[t]++;else{n[t]=1;var i=this._content,o=r(i,"length");e(i,t,this,0,o)}},stopObservingContentKey:function(e){var n=this._keys;if(n&&n[e]>0&&0>=--n[e]){var i=this._content,o=r(i,"length");t(i,e,this,0,o)}},contentKeyWillChange:function(e,t){Ember.propertyWillChange(this,t)},contentKeyDidChange:function(e,t){Ember.propertyDidChange(this,t)}})}(),function(){var e=Ember.get;Ember.set;var t=Ember.Mixin.create(Ember.MutableArray,Ember.Observable,Ember.Copyable,{get:function(e){return"length"===e?this.length:"number"==typeof e?this[e]:this._super(e)},objectAt:function(e){return this[e]},replace:function(t,r,n){if(this.isFrozen)throw Ember.FROZEN_ERROR;var i=n?e(n,"length"):0;if(this.arrayContentWillChange(t,r,i),n&&0!==n.length){var o=[t,r].concat(n);this.splice.apply(this,o)}else this.splice(t,r);return this.arrayContentDidChange(t,r,i),this},unknownProperty:function(e,t){var r;return void 0!==t&&void 0===r&&(r=this[e]=t),r},indexOf:function(e,t){var r,n=this.length;for(t=void 0===t?0:0>t?Math.ceil(t):Math.floor(t),0>t&&(t+=n),r=t;n>r;r++)if(this[r]===e)return r;return-1},lastIndexOf:function(e,t){var r,n=this.length;for(t=void 0===t?n-1:0>t?Math.ceil(t):Math.floor(t),0>t&&(t+=n),r=t;r>=0;r--)if(this[r]===e)return r;return-1},copy:function(e){return e?this.map(function(e){return Ember.copy(e,!0)}):this.slice()}}),r=["length"];Ember.EnumerableUtils.forEach(t.keys(),function(e){Array.prototype[e]&&r.push(e)}),r.length>0&&(t=t.without.apply(t,r)),Ember.NativeArray=t,Ember.A=function(e){return void 0===e&&(e=[]),Ember.Array.detect(e)?e:Ember.NativeArray.apply(e)},Ember.NativeArray.activate=function(){t.apply(Array.prototype),Ember.A=function(e){return e||[]}},(Ember.EXTEND_PROTOTYPES===!0||Ember.EXTEND_PROTOTYPES.Array)&&Ember.NativeArray.activate()}(),function(){var e=Ember.get,t=Ember.set,r=Ember.guidFor,n=Ember.isNone,i=Ember.String.fmt;Ember.Set=Ember.CoreObject.extend(Ember.MutableEnumerable,Ember.Copyable,Ember.Freezable,{length:0,clear:function(){if(this.isFrozen)throw new Error(Ember.FROZEN_ERROR);var n=e(this,"length");if(0===n)return this;var i;this.enumerableContentWillChange(n,0),Ember.propertyWillChange(this,"firstObject"),Ember.propertyWillChange(this,"lastObject");for(var o=0;n>o;o++)i=r(this[o]),delete this[i],delete this[o];return t(this,"length",0),Ember.propertyDidChange(this,"firstObject"),Ember.propertyDidChange(this,"lastObject"),this.enumerableContentDidChange(n,0),this},isEqual:function(t){if(!Ember.Enumerable.detect(t))return!1;var r=e(this,"length");if(e(t,"length")!==r)return!1;for(;--r>=0;)if(!t.contains(this[r]))return!1;return!0},add:Ember.aliasMethod("addObject"),remove:Ember.aliasMethod("removeObject"),pop:function(){if(e(this,"isFrozen"))throw new Error(Ember.FROZEN_ERROR);var t=this.length>0?this[this.length-1]:null;return this.remove(t),t},push:Ember.aliasMethod("addObject"),shift:Ember.aliasMethod("pop"),unshift:Ember.aliasMethod("push"),addEach:Ember.aliasMethod("addObjects"),removeEach:Ember.aliasMethod("removeObjects"),init:function(e){this._super(),e&&this.addObjects(e)},nextObject:function(e){return this[e]},firstObject:Ember.computed(function(){return this.length>0?this[0]:void 0}),lastObject:Ember.computed(function(){return this.length>0?this[this.length-1]:void 0}),addObject:function(i){if(e(this,"isFrozen"))throw new Error(Ember.FROZEN_ERROR);if(n(i))return this;var o,s=r(i),a=this[s],u=e(this,"length");return a>=0&&u>a&&this[a]===i?this:(o=[i],this.enumerableContentWillChange(null,o),Ember.propertyWillChange(this,"lastObject"),u=e(this,"length"),this[s]=u,this[u]=i,t(this,"length",u+1),Ember.propertyDidChange(this,"lastObject"),this.enumerableContentDidChange(null,o),this)},removeObject:function(i){if(e(this,"isFrozen"))throw new Error(Ember.FROZEN_ERROR);if(n(i))return this;var o,s,a=r(i),u=this[a],c=e(this,"length"),h=0===u,l=u===c-1;return u>=0&&c>u&&this[u]===i&&(s=[i],this.enumerableContentWillChange(s,null),h&&Ember.propertyWillChange(this,"firstObject"),l&&Ember.propertyWillChange(this,"lastObject"),c-1>u&&(o=this[c-1],this[u]=o,this[r(o)]=u),delete this[a],delete this[c-1],t(this,"length",c-1),h&&Ember.propertyDidChange(this,"firstObject"),l&&Ember.propertyDidChange(this,"lastObject"),this.enumerableContentDidChange(s,null)),this},contains:function(e){return this[r(e)]>=0},copy:function(){var n=this.constructor,i=new n,o=e(this,"length");for(t(i,"length",o);--o>=0;)i[o]=this[o],i[r(this[o])]=o;return i},toString:function(){var e,t=this.length,r=[];for(e=0;t>e;e++)r[e]=this[e];return i("Ember.Set<%@>",[r.join(",")])}})}(),function(){var e=Ember.DeferredMixin,t=Ember.get,r=Ember.Object.extend(e);r.reopenClass({promise:function(e,n){var i=r.create();return e.call(n,i),t(i,"promise")}}),Ember.Deferred=r}(),function(){var e=Ember.ENV.EMBER_LOAD_HOOKS||{},t={};Ember.onLoad=function(r,n){var i;e[r]=e[r]||Ember.A(),e[r].pushObject(n),(i=t[r])&&n(i)},Ember.runLoadHooks=function(r,n){var i;t[r]=n,(i=e[r])&&e[r].forEach(function(e){e(n)})}}(),function(){var e=Ember.get;Ember.ControllerMixin=Ember.Mixin.create({isController:!0,target:null,container:null,store:null,model:Ember.computed.alias("content"),send:function(t){var r,n=[].slice.call(arguments,1);this[t]?this[t].apply(this,n):(r=e(this,"target"))&&r.send.apply(r,arguments)}}),Ember.Controller=Ember.Object.extend(Ember.ControllerMixin)}(),function(){var e=Ember.get,t=(Ember.set,Ember.EnumerableUtils.forEach);Ember.SortableMixin=Ember.Mixin.create(Ember.MutableEnumerable,{sortProperties:null,sortAscending:!0,orderBy:function(r,n){var i=0,o=e(this,"sortProperties"),s=e(this,"sortAscending");return t(o,function(t){0===i&&(i=Ember.compare(e(r,t),e(n,t)),0===i||s||(i=-1*i))}),i},destroy:function(){var r=e(this,"content"),n=e(this,"sortProperties");return r&&n&&t(r,function(e){t(n,function(t){Ember.removeObserver(e,t,this,"contentItemSortPropertyDidChange")},this)},this),this._super()},isSorted:Ember.computed.bool("sortProperties"),arrangedContent:Ember.computed("content","sortProperties.@each",function(){var r=e(this,"content"),n=e(this,"isSorted"),i=e(this,"sortProperties"),o=this;return r&&n?(r=r.slice(),r.sort(function(e,t){return o.orderBy(e,t)}),t(r,function(e){t(i,function(t){Ember.addObserver(e,t,this,"contentItemSortPropertyDidChange")},this)},this),Ember.A(r)):r}),_contentWillChange:Ember.beforeObserver(function(){var r=e(this,"content"),n=e(this,"sortProperties");r&&n&&t(r,function(e){t(n,function(t){Ember.removeObserver(e,t,this,"contentItemSortPropertyDidChange")},this)},this),this._super()},"content"),sortAscendingWillChange:Ember.beforeObserver(function(){this._lastSortAscending=e(this,"sortAscending")},"sortAscending"),sortAscendingDidChange:Ember.observer(function(){if(e(this,"sortAscending")!==this._lastSortAscending){var t=e(this,"arrangedContent");t.reverseObjects()}},"sortAscending"),contentArrayWillChange:function(r,n,i,o){var s=e(this,"isSorted");if(s){var a=e(this,"arrangedContent"),u=r.slice(n,n+i),c=e(this,"sortProperties");t(u,function(e){a.removeObject(e),t(c,function(t){Ember.removeObserver(e,t,this,"contentItemSortPropertyDidChange")},this)},this)}return this._super(r,n,i,o)},contentArrayDidChange:function(r,n,i,o){var s=e(this,"isSorted"),a=e(this,"sortProperties");if(s){var u=r.slice(n,n+o);t(u,function(e){this.insertItemSorted(e),t(a,function(t){Ember.addObserver(e,t,this,"contentItemSortPropertyDidChange")},this)},this)}return this._super(r,n,i,o)},insertItemSorted:function(t){var r=e(this,"arrangedContent"),n=e(r,"length"),i=this._binarySearch(t,0,n);r.insertAt(i,t)},contentItemSortPropertyDidChange:function(t){var r=e(this,"arrangedContent"),n=r.indexOf(t),i=r.objectAt(n-1),o=r.objectAt(n+1),s=i&&this.orderBy(t,i),a=o&&this.orderBy(t,o);(0>s||a>0)&&(r.removeObject(t),this.insertItemSorted(t))},_binarySearch:function(t,r,n){var i,o,s,a;return r===n?r:(a=e(this,"arrangedContent"),i=r+Math.floor((n-r)/2),o=a.objectAt(i),s=this.orderBy(o,t),0>s?this._binarySearch(t,i+1,n):s>0?this._binarySearch(t,r,i):i)}})}(),function(){var e=Ember.get,t=(Ember.set,Ember.EnumerableUtils.forEach),r=Ember.EnumerableUtils.replace;Ember.ArrayController=Ember.ArrayProxy.extend(Ember.ControllerMixin,Ember.SortableMixin,{itemController:null,lookupItemController:function(){return e(this,"itemController")},objectAtContent:function(t){var r=e(this,"length"),n=e(this,"arrangedContent"),i=n&&n.objectAt(t);if(t>=0&&r>t){var o=this.lookupItemController(i);if(o)return this.controllerAt(t,i,o)}return i},arrangedContentDidChange:function(){this._super(),this._resetSubControllers()},arrayContentDidChange:function(n,i,o){var s=e(this,"_subControllers"),a=s.slice(n,n+i);t(a,function(e){e&&e.destroy()}),r(s,n,i,new Array(o)),this._super(n,i,o)},init:function(){this.get("content")||Ember.defineProperty(this,"content",void 0,Ember.A()),this._super(),this.set("_subControllers",Ember.A())},controllerAt:function(t,r,n){var i=e(this,"container"),o=e(this,"_subControllers"),s=o[t];if(s||(s=i.lookup("controller:"+n,{singleton:!1}),o[t]=s),!s)throw new Error('Could not resolve itemController: "'+n+'"');return s.set("target",this),s.set("content",r),s},_subControllers:null,_resetSubControllers:function(){var r=e(this,"_subControllers");r&&t(r,function(e){e&&e.destroy()}),this.set("_subControllers",Ember.A())}})}(),function(){Ember.ObjectController=Ember.ObjectProxy.extend(Ember.ControllerMixin)}(),function(){var e=Ember.get,t=Ember.set;Ember.State=Ember.Object.extend(Ember.Evented,{isState:!0,parentState:null,start:null,name:null,path:Ember.computed(function(){var t=e(this,"parentState.path"),r=e(this,"name");return t&&(r=t+"."+r),r}),trigger:function(e){this[e]&&this[e].apply(this,[].slice.call(arguments,1)),this._super.apply(this,arguments)},init:function(){var r=e(this,"states");t(this,"childStates",Ember.A()),t(this,"eventTransitions",e(this,"eventTransitions")||{});var n,i,o;if(r)for(n in r)this.setupChild(r,n,r[n]);else{r={};for(n in this)"constructor"!==n&&(i=this[n])&&((o=i.transitionTarget)&&(this.eventTransitions[n]=o),this.setupChild(r,n,i));t(this,"states",r)}t(this,"pathsCaches",{})},setPathsCache:function(t,r,n){var i=Ember.guidFor(t.constructor),o=e(this,"pathsCaches"),s=o[i]||{};s[r]=n,o[i]=s},getPathsCache:function(t,r){var n=Ember.guidFor(t.constructor),i=e(this,"pathsCaches"),o=i[n]||{};return o[r]},setupChild:function(r,n,i){return i?(i.isState?t(i,"name",n):Ember.State.detect(i)&&(i=i.create({name:n})),i.isState?(t(i,"parentState",this),e(this,"childStates").pushObject(i),r[n]=i,i):void 0):!1},lookupEventTransition:function(e){for(var t,r=this;r&&!t;)t=r.eventTransitions[e],r=r.get("parentState");return t},isLeaf:Ember.computed(function(){return!e(this,"childStates").length}),hasContext:!0,setup:Ember.K,enter:Ember.K,exit:Ember.K}),Ember.State.reopenClass({transitionTo:function(e){var t=function(t,r){var n=[],i=Ember.$&&Ember.$.Event;r&&i&&r instanceof i?r.hasOwnProperty("contexts")&&(n=r.contexts.slice()):n=[].slice.call(arguments,1),n.unshift(e),t.transitionTo.apply(t,n)};return t.transitionTarget=e,t}})}(),function(){var e=Ember.get,t=Ember.set,r=Ember.String.fmt,n=Ember.ArrayPolyfills.forEach,i=function(e){this.enterStates=e.enterStates.slice(),this.exitStates=e.exitStates.slice(),this.resolveState=e.resolveState,this.finalState=e.enterStates[e.enterStates.length-1]||e.resolveState};i.prototype={normalize:function(e,t){return this.matchContextsToStates(t),this.addInitialStates(),this.removeUnchangedContexts(e),this},matchContextsToStates:function(t){for(var r,n,i=this.enterStates.length-1,o=[];t.length>0;){if(i>=0)r=this.enterStates[i--];else{if(this.enterStates.length){if(r=e(this.enterStates[0],"parentState"),!r)throw"Cannot match all contexts to states"}else r=this.resolveState;this.enterStates.unshift(r),this.exitStates.unshift(r)}n=e(r,"hasContext")?t.pop():null,o.unshift(n)}this.contexts=o},addInitialStates:function(){for(var t,r=this.finalState;;){if(t=e(r,"initialState")||"start",r=e(r,"states."+t),!r)break;this.finalState=r,this.enterStates.push(r),this.contexts.push(void 0)}},removeUnchangedContexts:function(e){for(;this.enterStates.length>0&&this.enterStates[0]===this.exitStates[0];){if(this.enterStates.length===this.contexts.length){if(e.getStateMeta(this.enterStates[0],"context")!==this.contexts[0])break;this.contexts.shift()}this.resolveState=this.enterStates.shift(),this.exitStates.shift()}}};var o=function(t,n,i){var a,u,c,h=this.enableLogging,l=i?"unhandledEvent":t,f=n[l];if(a=[].slice.call(arguments,3),"function"==typeof f)return h&&(i?Ember.Logger.log(r("STATEMANAGER: Unhandled event '%@' being sent to state %@.",[t,e(n,"path")])):Ember.Logger.log(r("STATEMANAGER: Sending event '%@' to state %@.",[t,e(n,"path")]))),c=a,i&&c.unshift(t),c.unshift(this),f.apply(n,c);var m=e(n,"parentState");return m?(u=a,u.unshift(t,m,i),o.apply(this,u)):i?void 0:s.call(this,t,a,!0)},s=function(t,r,n){return r.unshift(t,e(this,"currentState"),n),o.apply(this,r)};Ember.StateManager=Ember.State.extend({init:function(){this._super(),t(this,"stateMeta",Ember.Map.create());var r=e(this,"initialState");!r&&e(this,"states.start")&&(r="start"),r&&this.transitionTo(r)},stateMetaFor:function(t){var r=e(this,"stateMeta"),n=r.get(t);return n||(n={},r.set(t,n)),n},setStateMeta:function(e,r,n){return t(this.stateMetaFor(e),r,n)},getStateMeta:function(t,r){return e(this.stateMetaFor(t),r)},currentState:null,currentPath:Ember.computed.alias("currentState.path"),transitionEvent:"setup",errorOnUnhandledEvent:!0,send:function(e){var t=[].slice.call(arguments,1);return s.call(this,e,t,!1)},unhandledEvent:function(t,r){if(e(this,"errorOnUnhandledEvent"))throw new Ember.Error(this.toString()+" could not respond to event "+r+" in state "+e(this,"currentState.path")+".")},getStateByPath:function(t,r){for(var n=r.split("."),i=t,o=0,s=n.length;s>o&&(i=e(e(i,"states"),n[o]),i);o++);return i},findStateByPath:function(t,r){for(var n;!n&&t;)n=this.getStateByPath(t,r),t=e(t,"parentState");return n},getStatesInPath:function(t,r){if(!r||""===r)return void 0;for(var n,i,o=r.split("."),s=[],a=0,u=o.length;u>a;a++){if(n=e(t,"states"),!n)return void 0;if(i=e(n,o[a]),!i)return void 0;t=i,s.push(i)}return s},goToState:function(){return this.transitionTo.apply(this,arguments)},transitionTo:function(t,r){if(!Ember.isEmpty(t)){var n=r?Array.prototype.slice.call(arguments,1):[],o=e(this,"currentState")||this,s=this.contextFreeTransition(o,t),a=new i(s).normalize(this,n);this.enterState(a),this.triggerSetupContext(a)}},contextFreeTransition:function(t,r){var n=t.getPathsCache(this,r);if(n)return n;for(var i=this.getStatesInPath(t,r),o=[],s=t;s&&!i;){if(o.unshift(s),s=e(s,"parentState"),!s&&(i=this.getStatesInPath(this,r),!i))return;i=this.getStatesInPath(s,r)}for(;i.length>0&&i[0]===o[0];)s=i.shift(),o.shift();var a={exitStates:o,enterStates:i,resolveState:s};return t.setPathsCache(this,r,a),a},triggerSetupContext:function(t){var r=t.contexts,i=t.enterStates.length-r.length,o=t.enterStates,s=e(this,"transitionEvent");n.call(o,function(e,t){e.trigger(s,this,r[t-i])},this)},getState:function(t){var r=e(this,t),n=e(this,"parentState");return r?r:n?n.getState(t):void 0},enterState:function(r){var i=this.enableLogging,o=r.exitStates.slice(0).reverse();n.call(o,function(e){e.trigger("exit",this)},this),n.call(r.enterStates,function(t){i&&Ember.Logger.log("STATEMANAGER: Entering "+e(t,"path")),t.trigger("enter",this)},this),t(this,"currentState",r.finalState)}})}()})(),"undefined"==typeof location||"localhost"!==location.hostname&&"127.0.0.1"!==location.hostname||console.warn("You are running a production build of Ember on localhost and won't receive detailed error messages. If you want full error messages please use the non-minified build provided on the Ember website.");
|
15
|
+
!function(){var e,t;!function(){var r={},n={};e=function(e,t,n){r[e]={deps:t,callback:n}},t=function(e){if(n[e])return n[e];n[e]={};var i,o,s,a,u;if(i=r[e],!i)throw new Error("Module '"+e+"' not found.");o=i.deps,s=i.callback,a=[];for(var c=0,h=o.length;h>c;c++)"exports"===o[c]?a.push(u={}):a.push(t(o[c]));var l=s.apply(this,a);return n[e]=u||l}}(),function(){function e(e){return t.console&&t.console[e]?t.console[e].apply?function(){t.console[e].apply(t.console,arguments)}:function(){var r=Array.prototype.join.call(arguments,", ");t.console[e](r)}:void 0}"undefined"==typeof Ember&&(Ember={});var t=Ember.imports=Ember.imports||this,r=Ember.exports=Ember.exports||this;Ember.lookup=Ember.lookup||this,r.Em=r.Ember=Em=Ember,Ember.isNamespace=!0,Ember.toString=function(){return"Ember"},Ember.VERSION="1.0.0-rc4",Ember.ENV=Ember.ENV||("undefined"==typeof ENV?{}:ENV),Ember.config=Ember.config||{},Ember.EXTEND_PROTOTYPES=Ember.ENV.EXTEND_PROTOTYPES,"undefined"==typeof Ember.EXTEND_PROTOTYPES&&(Ember.EXTEND_PROTOTYPES=!0),Ember.LOG_STACKTRACE_ON_DEPRECATION=Ember.ENV.LOG_STACKTRACE_ON_DEPRECATION!==!1,Ember.SHIM_ES5=Ember.ENV.SHIM_ES5===!1?!1:Ember.EXTEND_PROTOTYPES,Ember.LOG_VERSION=Ember.ENV.LOG_VERSION===!1?!1:!0,Ember.K=function(){return this},"undefined"==typeof Ember.assert&&(Ember.assert=Ember.K),"undefined"==typeof Ember.warn&&(Ember.warn=Ember.K),"undefined"==typeof Ember.debug&&(Ember.debug=Ember.K),"undefined"==typeof Ember.deprecate&&(Ember.deprecate=Ember.K),"undefined"==typeof Ember.deprecateFunc&&(Ember.deprecateFunc=function(e,t){return t}),Ember.uuid=0,Ember.Logger={log:e("log")||Ember.K,warn:e("warn")||Ember.K,error:e("error")||Ember.K,info:e("info")||Ember.K,debug:e("debug")||e("info")||Ember.K},Ember.onerror=null,Ember.handleErrors=function(e,t){if("function"!=typeof Ember.onerror)return e.call(t||this);try{return e.call(t||this)}catch(r){Ember.onerror(r)}},Ember.merge=function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);return e},Ember.isNone=function(e){return null===e||void 0===e},Ember.none=Ember.deprecateFunc("Ember.none is deprecated. Please use Ember.isNone instead.",Ember.isNone),Ember.isEmpty=function(e){return Ember.isNone(e)||0===e.length&&"function"!=typeof e||"object"==typeof e&&0===Ember.get(e,"length")},Ember.empty=Ember.deprecateFunc("Ember.empty is deprecated. Please use Ember.isEmpty instead.",Ember.isEmpty)}(),function(){var e=Ember.platform={};if(Ember.create=Object.create,Ember.create&&2!==Ember.create({a:1},{a:{value:2}}).a&&(Ember.create=null),!Ember.create||Ember.ENV.STUB_OBJECT_CREATE){var t=function(){};Ember.create=function(e,r){if(t.prototype=e,e=new t,r){t.prototype=e;for(var n in r)t.prototype[n]=r[n].value;e=new t}return t.prototype=null,e},Ember.create.isSimulated=!0}var r,n,i=Object.defineProperty;if(i)try{i({},"a",{get:function(){}})}catch(o){i=null}i&&(r=function(){var e={};return i(e,"a",{configurable:!0,enumerable:!0,get:function(){},set:function(){}}),i(e,"a",{configurable:!0,enumerable:!0,writable:!0,value:!0}),e.a===!0}(),n=function(){try{return i(document.createElement("div"),"definePropertyOnDOM",{}),!0}catch(e){}return!1}(),r?n||(i=function(e,t,r){var n;return n="object"==typeof Node?e instanceof Node:"object"==typeof e&&"number"==typeof e.nodeType&&"string"==typeof e.nodeName,n?e[t]=r.value:Object.defineProperty(e,t,r)}):i=null),e.defineProperty=i,e.hasPropertyAccessors=!0,e.defineProperty||(e.hasPropertyAccessors=!1,e.defineProperty=function(e,t,r){r.get||(e[t]=r.value)},e.defineProperty.isSimulated=!0),Ember.ENV.MANDATORY_SETTER&&!e.hasPropertyAccessors&&(Ember.ENV.MANDATORY_SETTER=!1)}(),function(){var e=function(e){return e&&Function.prototype.toString.call(e).indexOf("[native code]")>-1},t=e(Array.prototype.map)?Array.prototype.map:function(e){if(void 0===this||null===this)throw new TypeError;var t=Object(this),r=t.length>>>0;if("function"!=typeof e)throw new TypeError;for(var n=new Array(r),i=arguments[1],o=0;r>o;o++)o in t&&(n[o]=e.call(i,t[o],o,t));return n},r=e(Array.prototype.forEach)?Array.prototype.forEach:function(e){if(void 0===this||null===this)throw new TypeError;var t=Object(this),r=t.length>>>0;if("function"!=typeof e)throw new TypeError;for(var n=arguments[1],i=0;r>i;i++)i in t&&e.call(n,t[i],i,t)},n=e(Array.prototype.indexOf)?Array.prototype.indexOf:function(e,t){null===t||void 0===t?t=0:0>t&&(t=Math.max(0,this.length+t));for(var r=t,n=this.length;n>r;r++)if(this[r]===e)return r;return-1};Ember.ArrayPolyfills={map:t,forEach:r,indexOf:n},Ember.SHIM_ES5&&(Array.prototype.map||(Array.prototype.map=t),Array.prototype.forEach||(Array.prototype.forEach=r),Array.prototype.indexOf||(Array.prototype.indexOf=n))}(),function(){function e(e){this.descs={},this.watching={},this.cache={},this.source=e}function t(e,t){return!(!e||"function"!=typeof e[t])}var r=Ember.platform.defineProperty,n=Ember.create,i="__ember"+ +new Date,o=0,s=[],a={},u=Ember.ENV.MANDATORY_SETTER;Ember.GUID_KEY=i;var c={writable:!1,configurable:!1,enumerable:!1,value:null};Ember.generateGuid=function(e,t){t||(t="ember");var n=t+o++;return e&&(c.value=n,r(e,i,c)),n},Ember.guidFor=function(e){if(void 0===e)return"(undefined)";if(null===e)return"(null)";var t,n=typeof e;switch(n){case"number":return t=s[e],t||(t=s[e]="nu"+e),t;case"string":return t=a[e],t||(t=a[e]="st"+o++),t;case"boolean":return e?"(true)":"(false)";default:return e[i]?e[i]:e===Object?"(Object)":e===Array?"(Array)":(t="ember"+o++,c.value=t,r(e,i,c),t)}};var h={writable:!0,configurable:!1,enumerable:!1,value:null},l=Ember.GUID_KEY+"_meta";Ember.META_KEY=l;var f={descs:{},watching:{}};u&&(f.values={}),Ember.EMPTY_META=f,Object.freeze&&Object.freeze(f);var m=Ember.platform.defineProperty.isSimulated;m&&(e.prototype.__preventPlainObject__=!0,e.prototype.toJSON=function(){}),Ember.meta=function(t,i){var o=t[l];return i===!1?o||f:(o?o.source!==t&&(m||r(t,l,h),o=n(o),o.descs=n(o.descs),o.watching=n(o.watching),o.cache={},o.source=t,u&&(o.values=n(o.values)),t[l]=o):(m||r(t,l,h),o=new e(t),u&&(o.values={}),t[l]=o,o.descs.constructor=null),o)},Ember.getMeta=function(e,t){var r=Ember.meta(e,!1);return r[t]},Ember.setMeta=function(e,t,r){var n=Ember.meta(e,!0);return n[t]=r,r},Ember.metaPath=function(e,t,r){for(var i,o,s=Ember.meta(e,r),a=0,u=t.length;u>a;a++){if(i=t[a],o=s[i]){if(o.__ember_source__!==e){if(!r)return void 0;o=s[i]=n(o),o.__ember_source__=e}}else{if(!r)return void 0;o=s[i]={__ember_source__:e}}s=o}return o},Ember.wrap=function(e,t){function r(){}function n(){var n,i=this._super;return this._super=t||r,n=e.apply(this,arguments),this._super=i,n}return n.wrappedFunction=e,n.__ember_observes__=e.__ember_observes__,n.__ember_observesBefore__=e.__ember_observesBefore__,n},Ember.isArray=function(e){return!e||e.setInterval?!1:Array.isArray&&Array.isArray(e)?!0:Ember.Array&&Ember.Array.detect(e)?!0:void 0!==e.length&&"object"==typeof e?!0:!1},Ember.makeArray=function(e){return null===e||void 0===e?[]:Ember.isArray(e)?e:[e]},Ember.canInvoke=t,Ember.tryInvoke=function(e,r,n){return t(e,r)?e[r].apply(e,n||[]):void 0};var b=function(){var e=0;try{try{}finally{throw e++,new Error("needsFinallyFixTest")}}catch(t){}return 1!==e}();Ember.tryFinally=b?function(e,t,r){var n,i,o;r=r||this;try{n=e.call(r)}finally{try{i=t.call(r)}catch(s){o=s}}if(o)throw o;return void 0===i?n:i}:function(e,t,r){var n,i;r=r||this;try{n=e.call(r)}finally{i=t.call(r)}return void 0===i?n:i},Ember.tryCatchFinally=b?function(e,t,r,n){var i,o,s;n=n||this;try{i=e.call(n)}catch(a){i=t.call(n,a)}finally{try{o=r.call(n)}catch(u){s=u}}if(s)throw s;return void 0===o?i:o}:function(e,t,r,n){var i,o;n=n||this;try{i=e.call(n)}catch(s){i=t.call(n,s)}finally{o=r.call(n)}return void 0===o?i:o};var p={},E="Boolean Number String Function Array Date RegExp Object".split(" ");Ember.ArrayPolyfills.forEach.call(E,function(e){p["[object "+e+"]"]=e.toLowerCase()});var d=Object.prototype.toString;Ember.typeOf=function(e){var t;return t=null===e||void 0===e?String(e):p[d.call(e)]||"object","function"===t?Ember.Object&&Ember.Object.detect(e)&&(t="class"):"object"===t&&(t=e instanceof Error?"error":Ember.Object&&e instanceof Ember.Object?"instance":"object"),t}}(),function(){Ember.Instrumentation={};var e=[],t={},r=function(r){for(var n,i=[],o=0,s=e.length;s>o;o++)n=e[o],n.regex.test(r)&&i.push(n.object);return t[r]=i,i},n=function(){var e="undefined"!=typeof window?window.performance||{}:{},t=e.now||e.mozNow||e.webkitNow||e.msNow||e.oNow;return t?t.bind(e):function(){return+new Date}}();Ember.Instrumentation.instrument=function(e,i,o,s){function a(){for(b=0,p=f.length;p>b;b++)m=f[b],E[b]=m.before(e,n(),i);return o.call(s)}function u(e){i=i||{},i.exception=e}function c(){for(b=0,p=f.length;p>b;b++)m=f[b],m.after(e,n(),i,E[b]);Ember.STRUCTURED_PROFILE&&console.timeEnd(h)}var h,l,f=t[e];if(Ember.STRUCTURED_PROFILE&&(h=e+": "+i.object,console.time(h)),f||(f=r(e)),0===f.length)return l=o.call(s),Ember.STRUCTURED_PROFILE&&console.timeEnd(h),l;var m,b,p,E=[];return Ember.tryCatchFinally(a,u,c)},Ember.Instrumentation.subscribe=function(r,n){for(var i,o=r.split("."),s=[],a=0,u=o.length;u>a;a++)i=o[a],"*"===i?s.push("[^\\.]*"):s.push(i);s=s.join("\\."),s+="(\\..*)?";var c={pattern:r,regex:new RegExp("^"+s+"$"),object:n};return e.push(c),t={},c},Ember.Instrumentation.unsubscribe=function(r){for(var n,i=0,o=e.length;o>i;i++)e[i]===r&&(n=i);e.splice(n,1),t={}},Ember.Instrumentation.reset=function(){e=[],t={}},Ember.instrument=Ember.Instrumentation.instrument,Ember.subscribe=Ember.Instrumentation.subscribe}(),function(){var e,t,r,n;n=Array.prototype.concat,e=Array.prototype.map||Ember.ArrayPolyfills.map,t=Array.prototype.forEach||Ember.ArrayPolyfills.forEach,r=Array.prototype.indexOf||Ember.ArrayPolyfills.indexOf;var i=Ember.EnumerableUtils={map:function(t,r,n){return t.map?t.map.call(t,r,n):e.call(t,r,n)},forEach:function(e,r,n){return e.forEach?e.forEach.call(e,r,n):t.call(e,r,n)},indexOf:function(e,t,n){return e.indexOf?e.indexOf.call(e,t,n):r.call(e,t,n)},indexesOf:function(e,t){return void 0===t?[]:i.map(t,function(t){return i.indexOf(e,t)})},addObject:function(e,t){var r=i.indexOf(e,t);-1===r&&e.push(t)},removeObject:function(e,t){var r=i.indexOf(e,t);-1!==r&&e.splice(r,1)},replace:function(e,t,r,i){if(e.replace)return e.replace(t,r,i);var o=n.apply([t,r],i);return e.splice.apply(e,o)},intersection:function(e,t){var r=[];return i.forEach(e,function(e){i.indexOf(t,e)>=0&&r.push(e)}),r}}}(),function(){function e(e){return e.match(a)[0]}function t(t,n){var i,a=s.test(n),u=!a&&o.test(n);if((!t||u)&&(t=Ember.lookup),a&&(n=n.slice(5)),t===Ember.lookup&&(i=e(n),t=r(t,i),n=n.slice(i.length+1)),!n||0===n.length)throw new Error("Invalid Path");return[t,n]}var r,n=Ember.META_KEY,i=Ember.ENV.MANDATORY_SETTER,o=/^([A-Z$]|([0-9][A-Z$])).*[\.\*]/,s=/^this[\.\*]/,a=/^([^\.\*]+)/;r=function(e,t){if(""===t)return e;if(t||"string"!=typeof e||(t=e,e=null),null===e||-1!==t.indexOf("."))return u(e,t);var r,o=e[n],s=o&&o.descs[t];return s?s.get(e,t):(r=i&&o&&o.watching[t]>0?o.values[t]:e[t],void 0!==r||"object"!=typeof e||t in e||"function"!=typeof e.unknownProperty?r:e.unknownProperty(t))},Ember.config.overrideAccessors&&(Ember.get=r,Ember.config.overrideAccessors(),r=Ember.get);var u=Ember._getPath=function(e,n){var i,o,a,u,c;if(null===e&&-1===n.indexOf("."))return r(Ember.lookup,n);for(i=s.test(n),(!e||i)&&(a=t(e,n),e=a[0],n=a[1],a.length=0),o=n.split("."),c=o.length,u=0;null!=e&&c>u;u++)if(e=r(e,o[u],!0),e&&e.isDestroyed)return void 0;return e};Ember.normalizeTuple=function(e,r){return t(e,r)},Ember.getWithDefault=function(e,t,n){var i=r(e,t);return void 0===i?n:i},Ember.get=r,Ember.getPath=Ember.deprecateFunc("getPath is deprecated since get now supports paths",Ember.get)}(),function(){function e(e,t,r){for(var n=-1,i=0,o=e.length;o>i;i++)if(t===e[i][0]&&r===e[i][1]){n=i;break}return n}function t(e,t){var r,n=m(e,!0);return n.listeners||(n.listeners={}),n.hasOwnProperty("listeners")||(n.listeners=f(n.listeners)),r=n.listeners[t],r&&!n.listeners.hasOwnProperty(t)?r=n.listeners[t]=n.listeners[t].slice():r||(r=n.listeners[t]=[]),r}function r(t,r,n){var i=t[b],o=i&&i.listeners&&i.listeners[r];if(o)for(var s=o.length-1;s>=0;s--){var a=o[s][0],u=o[s][1],c=o[s][2],h=e(n,a,u);-1===h&&n.push([a,u,c])}}function n(t,r,n){var i=t[b],o=i&&i.listeners&&i.listeners[r],s=[];if(o){for(var a=o.length-1;a>=0;a--){var u=o[a][0],c=o[a][1],h=o[a][2],l=e(n,u,c);-1===l&&(n.push([u,c,h]),s.push([u,c,h]))}return s}}function i(r,n,i,o,s){o||"function"!=typeof i||(o=i,i=null);var a=t(r,n),u=e(a,i,o),c=0;s&&(c|=p),-1===u&&(a.push([i,o,c]),"function"==typeof r.didAddListener&&r.didAddListener(n,i,o))}function o(r,n,i,o){function s(i,o){var s=t(r,n),a=e(s,i,o);-1!==a&&(s.splice(a,1),"function"==typeof r.didRemoveListener&&r.didRemoveListener(n,i,o))}if(o||"function"!=typeof i||(o=i,i=null),o)s(i,o);else{var a=r[b],u=a&&a.listeners&&a.listeners[n];if(!u)return;for(var c=u.length-1;c>=0;c--)s(u[c][0],u[c][1])}}function s(r,n,i,o,s){function a(){return s.call(i)}function u(){c&&(c[2]&=~E)}o||"function"!=typeof i||(o=i,i=null);var c,h=t(r,n),l=e(h,i,o);return-1!==l&&(c=h[l].slice(),c[2]|=E,h[l]=c),Ember.tryFinally(a,u)}function a(r,n,i,o,s){function a(){return s.call(i)}function u(){for(f=0,m=b.length;m>f;f++)b[f][2]&=~E}o||"function"!=typeof i||(o=i,i=null);var c,h,l,f,m,b=[];for(f=0,m=n.length;m>f;f++){c=n[f],h=t(r,c);var p=e(h,i,o);-1!==p&&(l=h[p].slice(),l[2]|=E,h[p]=l,b.push(l))}return Ember.tryFinally(a,u)}function u(e){var t=e[b].listeners,r=[];if(t)for(var n in t)t[n]&&r.push(n);return r}function c(e,t,r,n){if(e!==Ember&&"function"==typeof e.sendEvent&&e.sendEvent(t,r),!n){var i=e[b];n=i&&i.listeners&&i.listeners[t]}if(n){for(var s=n.length-1;s>=0;s--){var a=n[s];if(a){var u=a[0],c=a[1],h=a[2];h&E||(h&p&&o(e,t,u,c),u||(u=e),"string"==typeof c&&(c=u[c]),r?c.apply(u,r):c.call(u))}}return!0}}function h(e,t){var r=e[b],n=r&&r.listeners&&r.listeners[t];return!(!n||!n.length)}function l(e,t){var r=[],n=e[b],i=n&&n.listeners&&n.listeners[t];if(!i)return r;for(var o=0,s=i.length;s>o;o++){var a=i[o][0],u=i[o][1];r.push([a,u])}return r}var f=Ember.create,m=Ember.meta,b=Ember.META_KEY,p=1,E=2;Ember.addListener=i,Ember.removeListener=o,Ember._suspendListener=s,Ember._suspendListeners=a,Ember.sendEvent=c,Ember.hasListeners=h,Ember.watchedEvents=u,Ember.listenersFor=l,Ember.listenersDiff=n,Ember.listenersUnion=r}(),function(){var e=Ember.guidFor,t=Ember.sendEvent,r=Ember._ObserverSet=function(){this.clear()};r.prototype.add=function(t,r,n){var i,o=this.observerSet,s=this.observers,a=e(t),u=o[a];return u||(o[a]=u={}),i=u[r],void 0===i&&(i=s.push({sender:t,keyName:r,eventName:n,listeners:[]})-1,u[r]=i),s[i].listeners},r.prototype.flush=function(){var e,r,n,i,o=this.observers;for(this.clear(),e=0,r=o.length;r>e;++e)n=o[e],i=n.sender,i.isDestroying||i.isDestroyed||t(i,n.eventName,[i,n.keyName],n.listeners)},r.prototype.clear=function(){this.observerSet={},this.observers=[]}}(),function(){function e(e,t,i){if(!e.isDestroying){var o=n,s=!o;s&&(o=n={}),r(p,e,t,o,i),s&&(n=null)}}function t(e,t,n){if(!e.isDestroying){var o=i,s=!o;s&&(o=i={}),r(E,e,t,o,n),s&&(i=null)}}function r(e,t,r,n,i){var o=s(t);if(n[o]||(n[o]={}),!n[o][r]){n[o][r]=!0;var a=i.deps;if(a=a&&a[r])for(var u in a){var c=i.descs[u];c&&c._suspended===t||e(t,u)}}}var n,i,o=Ember.meta,s=Ember.guidFor,a=Ember.tryFinally,u=Ember.sendEvent,c=Ember.listenersUnion,h=Ember.listenersDiff,l=Ember._ObserverSet,f=new l,m=new l,b=0,p=Ember.propertyWillChange=function(t,r){var n=o(t,!1),i=n.watching[r]>0||"length"===r,s=n.proto,a=n.descs[r];i&&s!==t&&(a&&a.willChange&&a.willChange(t,r),e(t,r,n),d(t,r,n),_(t,r))},E=Ember.propertyDidChange=function(e,r){var n=o(e,!1),i=n.watching[r]>0||"length"===r,s=n.proto,a=n.descs[r];s!==e&&(a&&a.didChange&&a.didChange(e,r),(i||"length"===r)&&(t(e,r,n),v(e,r,n),C(e,r)))},d=function(e,t,r,n){if(r.hasOwnProperty("chainWatchers")){var i=r.chainWatchers;if(i=i[t])for(var o=0,s=i.length;s>o;o++)i[o].willChange(n)}},v=function(e,t,r,n){if(r.hasOwnProperty("chainWatchers")){var i=r.chainWatchers;if(i=i[t])for(var o=i.length-1;o>=0;o--)i[o].didChange(n)}};Ember.overrideChains=function(e,t,r){v(e,t,r,!0)};var g=Ember.beginPropertyChanges=function(){b++},y=Ember.endPropertyChanges=function(){b--,0>=b&&(f.clear(),m.flush())};Ember.changeProperties=function(e,t){g(),a(e,y,t)};var _=function(e,t){if(!e.isDestroying){var r,n,i=t+":before";b?(r=f.add(e,t,i),n=h(e,i,r),u(e,i,[e,t],n)):u(e,i,[e,t])}},C=function(e,t){if(!e.isDestroying){var r,n=t+":change";b?(r=m.add(e,t,n),c(e,n,r)):u(e,n,[e,t])}}}(),function(){function e(e,t,r,o){var s;if(s=t.slice(t.lastIndexOf(".")+1),t=t.slice(0,t.length-(s.length+1)),"this"!==t&&(e=n(e,t)),!s||0===s.length)throw new Error("You passed an empty path");if(!e){if(o)return;throw new Error("Object in path "+t+" could not be found or was destroyed.")}return i(e,s,r)}var t=Ember.META_KEY,r=Ember.ENV.MANDATORY_SETTER,n=Ember._getPath,i=function(n,i,o,s){if("string"==typeof n&&(o=i,i=n,n=null),!n||-1!==i.indexOf("."))return e(n,i,o,s);var a,u,c=n[t],h=c&&c.descs[i];return h?h.set(n,i,o):(a="object"==typeof n&&!(i in n),a&&"function"==typeof n.setUnknownProperty?n.setUnknownProperty(i,o):c&&c.watching[i]>0?(u=r?c.values[i]:n[i],o!==u&&(Ember.propertyWillChange(n,i),r?void 0!==u||i in n?c.values[i]=o:Ember.defineProperty(n,i,null,o):n[i]=o,Ember.propertyDidChange(n,i))):n[i]=o),o};Ember.config.overrideAccessors&&(Ember.set=i,Ember.config.overrideAccessors(),i=Ember.set),Ember.set=i,Ember.setPath=Ember.deprecateFunc("setPath is deprecated since set now supports paths",Ember.set),Ember.trySet=function(e,t,r){return i(e,t,r,!0)},Ember.trySetPath=Ember.deprecateFunc("trySetPath has been renamed to trySet",Ember.trySet)}(),function(){var e=(Ember.get,Ember.set),t=Ember.guidFor,r=Ember.ArrayPolyfills.indexOf,n=function(e){var t={};for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);return t},i=function(e,t){var r=e.keys.copy(),i=n(e.values);return t.keys=r,t.values=i,t.length=e.length,t},o=Ember.OrderedSet=function(){this.clear()};o.create=function(){return new o},o.prototype={clear:function(){this.presenceSet={},this.list=[]},add:function(e){var r=t(e),n=this.presenceSet,i=this.list;r in n||(n[r]=!0,i.push(e))},remove:function(e){var n=t(e),i=this.presenceSet,o=this.list;delete i[n];var s=r.call(o,e);s>-1&&o.splice(s,1)},isEmpty:function(){return 0===this.list.length},has:function(e){var r=t(e),n=this.presenceSet;return r in n},forEach:function(e,t){for(var r=this.toArray(),n=0,i=r.length;i>n;n++)e.call(t,r[n])},toArray:function(){return this.list.slice()},copy:function(){var e=new o;return e.presenceSet=n(this.presenceSet),e.list=this.toArray(),e}};var s=Ember.Map=function(){this.keys=Ember.OrderedSet.create(),this.values={}};s.create=function(){return new s},s.prototype={length:0,get:function(e){var r=this.values,n=t(e);return r[n]},set:function(r,n){var i=this.keys,o=this.values,s=t(r);i.add(r),o[s]=n,e(this,"length",i.list.length)},remove:function(r){var n=this.keys,i=this.values,o=t(r);return i.hasOwnProperty(o)?(n.remove(r),delete i[o],e(this,"length",n.list.length),!0):!1},has:function(e){var r=this.values,n=t(e);return r.hasOwnProperty(n)},forEach:function(e,r){var n=this.keys,i=this.values;n.forEach(function(n){var o=t(n);e.call(r,n,i[o])})},copy:function(){return i(this,new s)}};var a=Ember.MapWithDefault=function(e){s.call(this),this.defaultValue=e.defaultValue};a.create=function(e){return e?new a(e):new s},a.prototype=Ember.create(s.prototype),a.prototype.get=function(e){var t=this.has(e);if(t)return s.prototype.get.call(this,e);var r=this.defaultValue(e);return this.set(e,r),r},a.prototype.copy=function(){return i(this,new a({defaultValue:this.defaultValue}))}}(),function(){var e=Ember.META_KEY,t=Ember.meta,r=Ember.platform.defineProperty,n=Ember.ENV.MANDATORY_SETTER;Ember.Descriptor=function(){};var i=Ember.MANDATORY_SETTER_FUNCTION=function(){},o=Ember.DEFAULT_GETTER_FUNCTION=function(t){return function(){var r=this[e];return r&&r.values[t]}};Ember.defineProperty=function(e,s,a,u,c){var h,l,f,m;return c||(c=t(e)),h=c.descs,l=c.descs[s],f=c.watching[s]>0,l instanceof Ember.Descriptor&&l.teardown(e,s),a instanceof Ember.Descriptor?(m=a,h[s]=a,n&&f?r(e,s,{configurable:!0,enumerable:!0,writable:!0,value:void 0}):e[s]=void 0,a.setup(e,s)):(h[s]=void 0,null==a?(m=u,n&&f?(c.values[s]=u,r(e,s,{configurable:!0,enumerable:!0,set:i,get:o(s)})):e[s]=u):(m=a,r(e,s,a))),f&&Ember.overrideChains(e,s,c),e.didDefineProperty&&e.didDefineProperty(e,s,m),this}}(),function(){var e=Ember.changeProperties,t=Ember.set;Ember.setProperties=function(r,n){return e(function(){for(var e in n)n.hasOwnProperty(e)&&t(r,e,n[e])}),r}}(),function(){var e=Ember.meta,t=Ember.typeOf,r=Ember.ENV.MANDATORY_SETTER,n=Ember.platform.defineProperty;Ember.watchKey=function(i,o){if("length"!==o||"array"!==t(i)){var s,a=e(i),u=a.watching;u[o]?u[o]=(u[o]||0)+1:(u[o]=1,s=a.descs[o],s&&s.willWatch&&s.willWatch(i,o),"function"==typeof i.willWatchProperty&&i.willWatchProperty(o),r&&o in i&&(a.values[o]=i[o],n(i,o,{configurable:!0,enumerable:!0,set:Ember.MANDATORY_SETTER_FUNCTION,get:Ember.DEFAULT_GETTER_FUNCTION(o)})))}},Ember.unwatchKey=function(t,i){var o,s=e(t),a=s.watching;1===a[i]?(a[i]=0,o=s.descs[i],o&&o.didUnwatch&&o.didUnwatch(t,i),"function"==typeof t.didUnwatchProperty&&t.didUnwatchProperty(i),r&&i in t&&(n(t,i,{configurable:!0,enumerable:!0,writable:!0,value:s.values[i]}),delete s.values[i])):a[i]>1&&a[i]--}}(),function(){function e(e){return e.match(f)[0]}function t(e,t,r){if(e&&"object"==typeof e){var i=n(e),o=i.chainWatchers;i.hasOwnProperty("chainWatchers")||(o=i.chainWatchers={}),o[t]||(o[t]=[]),o[t].push(r),u(e,t)}}function r(e){return n(e,!1).proto===e}var n=Ember.meta,i=Ember.get,o=Ember.normalizeTuple,s=Ember.ArrayPolyfills.forEach,a=Ember.warn,u=Ember.watchKey,c=Ember.unwatchKey,h=Ember.propertyWillChange,l=Ember.propertyDidChange,f=/^([^\.\*]+)/,m=[];Ember.flushPendingChains=function(){if(0!==m.length){var e=m;m=[],s.call(e,function(e){e[0].add(e[1])}),a("Watching an undefined global, Ember expects watched globals to be setup by the time the run loop is flushed, check for typos",0===m.length)}};var b=Ember.removeChainWatcher=function(e,t,r){if(e&&"object"==typeof e){var i=n(e,!1);if(i.hasOwnProperty("chainWatchers")){var o=i.chainWatchers;if(o[t]){o=o[t];for(var s=0,a=o.length;a>s;s++)o[s]===r&&o.splice(s,1)}c(e,t)}}},p=Ember._ChainNode=function(e,r,n){this._parent=e,this._key=r,this._watching=void 0===n,this._value=n,this._paths={},this._watching&&(this._object=e.value(),this._object&&t(this._object,this._key,this)),this._parent&&"@each"===this._parent._key&&this.value()},E=p.prototype;E.value=function(){if(void 0===this._value&&this._watching){var e=this._parent.value();this._value=e&&!r(e)?i(e,this._key):void 0}return this._value},E.destroy=function(){if(this._watching){var e=this._object;e&&b(e,this._key,this),this._watching=!1}},E.copy=function(e){var t,r=new p(null,null,e),n=this._paths;for(t in n)n[t]<=0||r.add(t);return r},E.add=function(t){var r,n,i,s,a;if(a=this._paths,a[t]=(a[t]||0)+1,r=this.value(),n=o(r,t),n[0]&&n[0]===r)t=n[1],i=e(t),t=t.slice(i.length+1);else{if(!n[0])return m.push([this,t]),n.length=0,void 0;s=n[0],i=t.slice(0,0-(n[1].length+1)),t=n[1]}n.length=0,this.chain(i,t,s)},E.remove=function(t){var r,n,i,s,a;a=this._paths,a[t]>0&&a[t]--,r=this.value(),n=o(r,t),n[0]===r?(t=n[1],i=e(t),t=t.slice(i.length+1)):(s=n[0],i=t.slice(0,0-(n[1].length+1)),t=n[1]),n.length=0,this.unchain(i,t)},E.count=0,E.chain=function(t,r,n){var i,o=this._chains;o||(o=this._chains={}),i=o[t],i||(i=o[t]=new p(this,t,n)),i.count++,r&&r.length>0&&(t=e(r),r=r.slice(t.length+1),i.chain(t,r))},E.unchain=function(t,r){var n=this._chains,i=n[t];r&&r.length>1&&(t=e(r),r=r.slice(t.length+1),i.unchain(t,r)),i.count--,i.count<=0&&(delete n[i._key],i.destroy())},E.willChange=function(){var e=this._chains;if(e)for(var t in e)e.hasOwnProperty(t)&&e[t].willChange();this._parent&&this._parent.chainWillChange(this,this._key,1)},E.chainWillChange=function(e,t,r){this._key&&(t=this._key+"."+t),this._parent?this._parent.chainWillChange(this,t,r+1):(r>1&&h(this.value(),t),t="this."+t,this._paths[t]>0&&h(this.value(),t))},E.chainDidChange=function(e,t,r){this._key&&(t=this._key+"."+t),this._parent?this._parent.chainDidChange(this,t,r+1):(r>1&&l(this.value(),t),t="this."+t,this._paths[t]>0&&l(this.value(),t))},E.didChange=function(e){if(this._watching){var r=this._parent.value();r!==this._object&&(b(this._object,this._key,this),this._object=r,t(r,this._key,this)),this._value=void 0,this._parent&&"@each"===this._parent._key&&this.value()}var n=this._chains;if(n)for(var i in n)n.hasOwnProperty(i)&&n[i].didChange(e);e||this._parent&&this._parent.chainDidChange(this,this._key,1)},Ember.finishChains=function(e){var t=n(e,!1),r=t.chains;r&&(r.value()!==e&&(t.chains=r=r.copy(e)),r.didChange(!0))}}(),function(){function e(e){var r=t(e),i=r.chains;return i?i.value()!==e&&(i=r.chains=i.copy(e)):i=r.chains=new n(null,null,e),i}var t=Ember.meta,r=Ember.typeOf,n=Ember._ChainNode;Ember.watchPath=function(n,i){if("length"!==i||"array"!==r(n)){var o=t(n),s=o.watching;s[i]?s[i]=(s[i]||0)+1:(s[i]=1,e(n).add(i))}},Ember.unwatchPath=function(r,n){var i=t(r),o=i.watching;1===o[n]?(o[n]=0,e(r).remove(n)):o[n]>1&&o[n]--}}(),function(){function e(e){return"*"===e||!l.test(e)}var t=Ember.meta,r=Ember.GUID_KEY,n=Ember.META_KEY,i=Ember.removeChainWatcher,o=Ember.watchKey,s=Ember.unwatchKey,a=Ember.watchPath,u=Ember.unwatchPath,c=Ember.typeOf,h=Ember.generateGuid,l=/[\.\*]/;Ember.watch=function(t,r){("length"!==r||"array"!==c(t))&&(e(r)?o(t,r):a(t,r))},Ember.isWatching=function(e,t){var r=e[n];return(r&&r.watching[t])>0},Ember.watch.flushPending=Ember.flushPendingChains,Ember.unwatch=function(t,r){("length"!==r||"array"!==c(t))&&(e(r)?s(t,r):u(t,r))},Ember.rewatch=function(e){var n=t(e,!1),i=n.chains;r in e&&!e.hasOwnProperty(r)&&h(e,"ember"),i&&i.value()!==e&&(n.chains=i.copy(e))};var f=[];Ember.destroy=function(e){var t,r,o,s,a=e[n];if(a&&(e[n]=null,t=a.chains))for(f.push(t);f.length>0;){if(t=f.pop(),r=t._chains)for(o in r)r.hasOwnProperty(o)&&f.push(r[o]);t._watching&&(s=t._object,s&&i(s,t._key,t))}}}(),function(){function e(e,t){var r=e[t];return r?e.hasOwnProperty(t)||(r=e[t]=f(r)):r=e[t]={},r}function t(t){return e(t,"deps")}function r(r,n,i,o){var s,a,u,c,h,l=r._dependentKeys;if(l)for(s=t(o),a=0,u=l.length;u>a;a++)c=l[a],h=e(s,c),h[i]=(h[i]||0)+1,b(n,c)}function n(r,n,i,o){var s,a,u,c,h,l=r._dependentKeys;if(l)for(s=t(o),a=0,u=l.length;u>a;a++)c=l[a],h=e(s,c),h[i]=(h[i]||0)-1,p(n,c)}function i(e,t){this.func=e,this._cacheable=t&&void 0!==t.cacheable?t.cacheable:!0,this._dependentKeys=t&&t.dependentKeys,this._readOnly=t&&(void 0!==t.readOnly||!!t.readOnly)}function o(e,t){for(var r={},n=0;n<t.length;n++)r[t[n]]=u(e,t[n]);return r}function s(e,t){Ember.computed[e]=function(e){var r=l.call(arguments);return Ember.computed(e,function(){return t.apply(this,r)})}}function a(e,t){Ember.computed[e]=function(){var e=l.call(arguments),r=Ember.computed(function(){return t.apply(this,[o(this,e)])});return r.property.apply(r,e)}}var u=Ember.get,c=Ember.set,h=Ember.meta,l=[].slice,f=Ember.create,m=Ember.META_KEY,b=Ember.watch,p=Ember.unwatch;Ember.ComputedProperty=i,i.prototype=new Ember.Descriptor;var E=i.prototype;E.cacheable=function(e){return this._cacheable=e!==!1,this},E.volatile=function(){return this.cacheable(!1)},E.readOnly=function(e){return this._readOnly=void 0===e||!!e,this},E.property=function(){for(var e=[],t=0,r=arguments.length;r>t;t++)e.push(arguments[t]);return this._dependentKeys=e,this},E.meta=function(e){return 0===arguments.length?this._meta||{}:(this._meta=e,this)},E.willWatch=function(e,t){var n=e[m];t in n.cache||r(this,e,t,n)},E.didUnwatch=function(e,t){var r=e[m];t in r.cache||n(this,e,t,r)},E.didChange=function(e,t){if(this._cacheable&&this._suspended!==e){var r=h(e);t in r.cache&&(delete r.cache[t],r.watching[t]||n(this,e,t,r))}},E.get=function(e,t){var n,i,o;if(this._cacheable){if(o=h(e),i=o.cache,t in i)return i[t];n=i[t]=this.func.call(e,t),o.watching[t]||r(this,e,t,o)}else n=this.func.call(e,t);return n},E.set=function(e,t,n){var i,o,s=this._cacheable,a=this.func,u=h(e,s),c=u.watching[t],l=this._suspended,f=!1,m=u.cache;if(this._readOnly)throw new Error("Cannot Set: "+t+" on: "+e.toString());this._suspended=e;try{if(s&&m.hasOwnProperty(t)&&(i=m[t],f=!0),a.wrappedFunction&&(a=a.wrappedFunction),3===a.length)o=a.call(e,t,n,i);else{if(2!==a.length)return Ember.defineProperty(e,t,null,i),Ember.set(e,t,n),void 0;o=a.call(e,t,n)}if(f&&i===o)return;c&&Ember.propertyWillChange(e,t),f&&delete m[t],s&&(c||f||r(this,e,t,u),m[t]=o),c&&Ember.propertyDidChange(e,t)}finally{this._suspended=l}return o},E.setup=function(e,t){var n=e[m];n&&n.watching[t]&&r(this,e,t,h(e))},E.teardown=function(e,t){var r=h(e);return(r.watching[t]||t in r.cache)&&n(this,e,t,r),this._cacheable&&delete r.cache[t],null},Ember.computed=function(e){var t;if(arguments.length>1&&(t=l.call(arguments,0,-1),e=l.call(arguments,-1)[0]),"function"!=typeof e)throw new Error("Computed Property declared without a property function");var r=new i(e);return t&&r.property.apply(r,t),r},Ember.cacheFor=function(e,t){var r=h(e,!1).cache;return r&&t in r?r[t]:void 0},s("empty",function(e){return Ember.isEmpty(u(this,e))}),s("notEmpty",function(e){return!Ember.isEmpty(u(this,e))}),s("none",function(e){return Ember.isNone(u(this,e))}),s("not",function(e){return!u(this,e)}),s("bool",function(e){return!!u(this,e)}),s("match",function(e,t){var r=u(this,e);return"string"==typeof r?!!r.match(t):!1}),s("equal",function(e,t){return u(this,e)===t}),s("gt",function(e,t){return u(this,e)>t}),s("gte",function(e,t){return u(this,e)>=t}),s("lt",function(e,t){return u(this,e)<t}),s("lte",function(e,t){return u(this,e)<=t}),a("and",function(e){for(var t in e)if(e.hasOwnProperty(t)&&!e[t])return!1;return!0}),a("or",function(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!0;return!1}),a("any",function(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return e[t];return null}),a("map",function(e){var t=[];for(var r in e)e.hasOwnProperty(r)&&(Ember.isNone(e[r])?t.push(null):t.push(e[r]));return t}),Ember.computed.alias=function(e){return Ember.computed(e,function(t,r){return arguments.length>1?(c(this,e,r),r):u(this,e)})},Ember.computed.oneWay=function(e){return Ember.computed(e,function(){return u(this,e)})},Ember.computed.defaultTo=function(e){return Ember.computed(function(t,r,n){return 1===arguments.length?null!=n?n:u(this,e):null!=r?r:u(this,e)})}}(),function(){function e(e){return e+r}function t(e){return e+n}var r=":change",n=":before";Ember.addObserver=function(t,r,n,i){return Ember.addListener(t,e(r),n,i),Ember.watch(t,r),this},Ember.observersFor=function(t,r){return Ember.listenersFor(t,e(r))},Ember.removeObserver=function(t,r,n,i){return Ember.unwatch(t,r),Ember.removeListener(t,e(r),n,i),this},Ember.addBeforeObserver=function(e,r,n,i){return Ember.addListener(e,t(r),n,i),Ember.watch(e,r),this},Ember._suspendBeforeObserver=function(e,r,n,i,o){return Ember._suspendListener(e,t(r),n,i,o)},Ember._suspendObserver=function(t,r,n,i,o){return Ember._suspendListener(t,e(r),n,i,o)};var i=Ember.ArrayPolyfills.map;Ember._suspendBeforeObservers=function(e,r,n,o,s){var a=i.call(r,t);return Ember._suspendListeners(e,a,n,o,s)},Ember._suspendObservers=function(t,r,n,o,s){var a=i.call(r,e);return Ember._suspendListeners(t,a,n,o,s)},Ember.beforeObserversFor=function(e,r){return Ember.listenersFor(e,t(r))},Ember.removeBeforeObserver=function(e,r,n,i){return Ember.unwatch(e,r),Ember.removeListener(e,t(r),n,i),this}}(),function(){e("backburner",["backburner/deferred_action_queues","exports"],function(e,t){"use strict";function r(e,t){this.queueNames=e,this.options=t||{},this.options.defaultQueue||(this.options.defaultQueue=e[0]),this.instanceStack=[]}function n(e){e.begin(),o=setTimeout(function(){e.end(),o=null})}function i(e){var t,r,n,o,u=+new Date;e.run(function(){for(n=0,o=f.length;o>n&&(t=f[n],!(t>u));n+=2);for(r=f.splice(0,n),n=1,o=r.length;o>n;n+=2)e.schedule(e.options.defaultQueue,null,r[n])}),f.length&&(s=setTimeout(function(){i(e),s=null,a=null},f[0]-u),a=f[0])}var o,s,a,u=e.DeferredActionQueues,c=[].slice,h=[].pop,l=[],f=[];r.prototype={queueNames:null,options:null,currentInstance:null,instanceStack:null,begin:function(){var e=this.options&&this.options.onBegin,t=this.currentInstance;t&&this.instanceStack.push(t),this.currentInstance=new u(this.queueNames,this.options),e&&e(this.currentInstance,t)},end:function(){var e=this.options&&this.options.onEnd,t=this.currentInstance,r=null;try{t.flush()}finally{this.currentInstance=null,this.instanceStack.length&&(r=this.instanceStack.pop(),this.currentInstance=r),e&&e(t,r)
|
16
|
+
}},run:function(e,t){var r;this.begin(),t||(t=e,e=null),"string"==typeof t&&(t=e[t]);var n=!1;try{r=arguments.length>2?t.apply(e,c.call(arguments,2)):t.call(e)}finally{n||(n=!0,this.end())}return r},defer:function(e,t,r){r||(r=t,t=null),"string"==typeof r&&(r=t[r]);var i=(new Error).stack,o=arguments.length>3?c.call(arguments,3):void 0;return this.currentInstance||n(this),this.currentInstance.schedule(e,t,r,o,!1,i)},deferOnce:function(e,t,r){r||(r=t,t=null),"string"==typeof r&&(r=t[r]);var i=(new Error).stack,o=arguments.length>3?c.call(arguments,3):void 0;return this.currentInstance||n(this),this.currentInstance.schedule(e,t,r,o,!0,i)},setTimeout:function(){var e=this,t=h.call(arguments),r=arguments[0],n=arguments[1],o=+new Date+t;n||(n=r,r=null),"string"==typeof n&&(n=r[n]);var u,l;arguments.length>2?(l=c.call(arguments,2),u=function(){n.apply(r,l)}):u=function(){n.call(r)};var m,b;for(m=0,b=f.length;b>m&&!(o<f[m]);m+=2);return f.splice(m,0,o,u),s&&o>a?u:(s&&(clearTimeout(s),s=null),s=setTimeout(function(){i(e),s=null,a=null},t),a=o,u)},debounce:function(e,t){for(var r,n=this,i=arguments,o=h.call(i),s=0,a=l.length;a>s;s++)if(r=l[s],r[0]===e&&r[1]===t)return;var u=setTimeout(function(){n.run.apply(n,i);for(var o=-1,s=0,a=l.length;a>s;s++)if(r=l[s],r[0]===e&&r[1]===t){o=s;break}o>-1&&l.splice(o,1)},o);l.push([e,t,u])},cancelTimers:function(){for(var e=0,t=l.length;t>e;e++)clearTimeout(l[e][2]);l=[],s&&(clearTimeout(s),s=null),f=[],o&&(clearTimeout(o),o=null)},hasTimers:function(){return!!f.length||o},cancel:function(e){if("object"==typeof e&&e.queue&&e.method)return e.queue.cancel(e);if("function"==typeof e)for(var t=0,r=f.length;r>t;t+=2)if(f[t+1]===e)return f.splice(t,2),!0}},r.prototype.schedule=r.prototype.defer,r.prototype.scheduleOnce=r.prototype.deferOnce,r.prototype.later=r.prototype.setTimeout,t.Backburner=r}),e("backburner/deferred_action_queues",["backburner/queue","exports"],function(e,t){"use strict";function r(e,t){var r=this.queues={};this.queueNames=e=e||[];for(var n,o=0,s=e.length;s>o;o++)n=e[o],r[n]=new i(this,n,t[n])}function n(e,t){for(var r,n,i=0,o=t;o>=i;i++)if(r=e.queueNames[i],n=e.queues[r],n._queue.length)return i;return-1}var i=e.Queue;r.prototype={queueNames:null,queues:null,schedule:function(e,t,r,n,i,o){var s=this.queues,a=s[e];if(!a)throw new Error("You attempted to schedule an action in a queue ("+e+") that doesn't exist");return i?a.pushUnique(t,r,n,o):a.push(t,r,n,o)},flush:function(){for(var e,t,r,i,o=this.queues,s=this.queueNames,a=0,u=s.length;u>a;){e=s[a],t=o[e],r=t._queue.slice(),t._queue=[];var c,h,l,f,m=t.options,b=m&&m.before,p=m&&m.after,E=0,d=r.length;for(d&&b&&b();d>E;)c=r[E],h=r[E+1],l=r[E+2],f=r[E+3],"string"==typeof h&&(h=c[h]),l&&l.length>0?h.apply(c,l):h.call(c),E+=4;d&&p&&p(),-1===(i=n(this,a))?a++:a=i}}},t.DeferredActionQueues=r}),e("backburner/queue",["exports"],function(e){"use strict";function t(e,t,r){this.daq=e,this.name=t,this.options=r,this._queue=[]}t.prototype={daq:null,name:null,options:null,_queue:null,push:function(e,t,r,n){var i=this._queue;return i.push(e,t,r,n),{queue:this,target:e,method:t}},pushUnique:function(e,t,r,n){var i,o,s,a,u=this._queue;for(s=0,a=u.length;a>s;s+=4)if(i=u[s],o=u[s+1],i===e&&o===t)return u[s+2]=r,u[s+3]=n,{queue:this,target:e,method:t};return this._queue.push(e,t,r,n),{queue:this,target:e,method:t}},flush:function(){var e,t,r,n,i,o=this._queue,s=this.options,a=s&&s.before,u=s&&s.after,c=o.length;for(c&&a&&a(),i=0;c>i;i+=4)e=o[i],t=o[i+1],r=o[i+2],n=o[i+3],r&&r.length>0?t.apply(e,r):t.call(e);c&&u&&u(),o.length>c?(this._queue=o.slice(c),this.flush()):this._queue.length=0},cancel:function(e){var t,r,n,i,o=this._queue;for(n=0,i=o.length;i>n;n+=4)if(t=o[n],r=o[n+1],t===e.target&&r===e.method)return o.splice(n,4),!0}},e.Queue=t})}(),function(){function e(){!Ember.run.currentRunLoop}var r=function(e){Ember.run.currentRunLoop=e},n=function(e,t){Ember.run.currentRunLoop=t},i=t("backburner").Backburner,o=new i(["sync","actions","destroy"],{sync:{before:Ember.beginPropertyChanges,after:Ember.endPropertyChanges},defaultQueue:"actions",onBegin:r,onEnd:n}),s=[].slice;Ember.run=function(){var e;if(Ember.onerror)try{e=o.run.apply(o,arguments)}catch(t){Ember.onerror(t)}else e=o.run.apply(o,arguments);return e},Ember.run.join=function(){if(!Ember.run.currentRunLoop)return Ember.run.apply(Ember.run,arguments);var e=s.call(arguments);e.unshift("actions"),Ember.run.schedule.apply(Ember.run,e)},Ember.run.backburner=o,Ember.run,Ember.run.currentRunLoop=null,Ember.run.queues=o.queueNames,Ember.run.begin=function(){o.begin()},Ember.run.end=function(){o.end()},Ember.run.schedule=function(){e(),o.schedule.apply(o,arguments)},Ember.run.hasScheduledTimers=function(){return o.hasTimers()},Ember.run.cancelTimers=function(){o.cancelTimers()},Ember.run.sync=function(){o.currentInstance.queues.sync.flush()},Ember.run.later=function(){return o.later.apply(o,arguments)},Ember.run.once=function(){e();var t=s.call(arguments);return t.unshift("actions"),o.scheduleOnce.apply(o,t)},Ember.run.scheduleOnce=function(){return e(),o.scheduleOnce.apply(o,arguments)},Ember.run.next=function(){var e=s.call(arguments);return e.push(1),o.later.apply(o,e)},Ember.run.cancel=function(e){return o.cancel(e)}}(),function(){function e(e,t){return r(o(t)?Ember.lookup:e,t)}function t(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])}Ember.LOG_BINDINGS=!1||!!Ember.ENV.LOG_BINDINGS;var r=Ember.get,n=(Ember.set,Ember.guidFor),i=/^([A-Z$]|([0-9][A-Z$]))/,o=Ember.isGlobalPath=function(e){return i.test(e)},s=function(e,t){this._direction="fwd",this._from=t,this._to=e,this._directionMap=Ember.Map.create()};s.prototype={copy:function(){var e=new s(this._to,this._from);return this._oneWay&&(e._oneWay=!0),e},from:function(e){return this._from=e,this},to:function(e){return this._to=e,this},oneWay:function(){return this._oneWay=!0,this},toString:function(){var e=this._oneWay?"[oneWay]":"";return"Ember.Binding<"+n(this)+">("+this._from+" -> "+this._to+")"+e},connect:function(t){var r=this._from,n=this._to;return Ember.trySet(t,n,e(t,r)),Ember.addObserver(t,r,this,this.fromDidChange),this._oneWay||Ember.addObserver(t,n,this,this.toDidChange),this._readyToSync=!0,this},disconnect:function(e){var t=!this._oneWay;return Ember.removeObserver(e,this._from,this,this.fromDidChange),t&&Ember.removeObserver(e,this._to,this,this.toDidChange),this._readyToSync=!1,this},fromDidChange:function(e){this._scheduleSync(e,"fwd")},toDidChange:function(e){this._scheduleSync(e,"back")},_scheduleSync:function(e,t){var r=this._directionMap,n=r.get(e);n||(Ember.run.schedule("sync",this,this._sync,e),r.set(e,t)),"back"===n&&"fwd"===t&&r.set(e,"fwd")},_sync:function(t){var n=Ember.LOG_BINDINGS;if(!t.isDestroyed&&this._readyToSync){var i=this._directionMap,o=i.get(t),s=this._from,a=this._to;if(i.remove(t),"fwd"===o){var u=e(t,this._from);n&&Ember.Logger.log(" ",this.toString(),"->",u,t),this._oneWay?Ember.trySet(t,a,u):Ember._suspendObserver(t,a,this,this.toDidChange,function(){Ember.trySet(t,a,u)})}else if("back"===o){var c=r(t,this._to);n&&Ember.Logger.log(" ",this.toString(),"<-",c,t),Ember._suspendObserver(t,s,this,this.fromDidChange,function(){Ember.trySet(Ember.isGlobalPath(s)?Ember.lookup:t,s,c)})}}}},t(s,{from:function(){var e=this,t=new e;return t.from.apply(t,arguments)},to:function(){var e=this,t=new e;return t.to.apply(t,arguments)},oneWay:function(e,t){var r=this,n=new r(null,e);return n.oneWay(t)}}),Ember.Binding=s,Ember.bind=function(e,t,r){return new Ember.Binding(t,r).connect(e)},Ember.oneWay=function(e,t,r){return new Ember.Binding(t,r).oneWay().connect(e)}}(),function(){function e(e){var t=Ember.meta(e,!0),r=t.mixins;return r?t.hasOwnProperty("mixins")||(r=t.mixins=P(r)):r=t.mixins={},r}function t(e,t){return t&&t.length>0&&(e.mixins=C.call(t,function(e){if(e instanceof g)return e;var t=new g;return t.properties=e,t})),e}function r(e){return"function"==typeof e&&e.isMethod!==!1&&e!==Boolean&&e!==Object&&e!==Number&&e!==Array&&e!==Date&&e!==String}function n(e,t){var r;return t instanceof g?(r=j(t),e[r]?x:(e[r]=t,t.properties)):t}function i(e,t,r){var n;return n=t.concatenatedProperties||r.concatenatedProperties,e.concatenatedProperties&&(n=n?n.concat(e.concatenatedProperties):e.concatenatedProperties),n}function o(e,t,r,n,i){var o;return void 0===n[t]&&(o=i[t]),o=o||e.descs[t],o&&o instanceof Ember.ComputedProperty?(r=P(r),r.func=Ember.wrap(r.func,o.func),r):r}function s(e,t,r,n,i){var o;return void 0===i[t]&&(o=n[t]),o=o||e[t],"function"!=typeof o?r:Ember.wrap(r,o)}function a(e,t,r,n){var i=n[t]||e[t];return i?"function"==typeof i.concat?i.concat(r):Ember.makeArray(i).concat(r):Ember.makeArray(r)}function u(e,t,n,i,u,c,h){if(n instanceof Ember.Descriptor){if(n===y&&u[t])return x;n.func&&(n=o(i,t,n,c,u)),u[t]=n,c[t]=void 0}else r(n)?n=s(e,t,n,c,u):(h&&O.call(h,t)>=0||"concatenatedProperties"===t)&&(n=a(e,t,n,c)),u[t]=void 0,c[t]=n}function c(e,t,r,o,s,a){function h(e){delete r[e],delete o[e]}for(var l,f,m,b,p,E=0,d=e.length;d>E;E++)if(l=e[E],f=n(t,l),f!==x)if(f){p=Ember.meta(s),b=i(f,o,s);for(m in f)f.hasOwnProperty(m)&&(a.push(m),u(s,m,f[m],p,r,o,b));f.hasOwnProperty("toString")&&(s.toString=f.toString)}else l.mixins&&(c(l.mixins,t,r,o,s,a),l._without&&w.call(l._without,h))}function h(e,t,r,n){if(D.test(t)){var i=n.bindings;i?n.hasOwnProperty("bindings")||(i=n.bindings=P(n.bindings)):i=n.bindings={},i[t]=r}}function l(e,t){var r,n,i,o=t.bindings;if(o){for(r in o)n=o[r],n&&(i=r.slice(0,-7),n instanceof Ember.Binding?(n=n.copy(),n.to(i)):n=new Ember.Binding(i,n),n.connect(e),e[r]=n);t.bindings={}}}function f(e,t){return l(e,t||Ember.meta(e)),e}function m(e,t,r,n,i){var o,s=t.methodName;return n[s]||i[s]?(o=i[s],t=n[s]):r.descs[s]?(t=r.descs[s],o=void 0):(t=void 0,o=e[s]),{desc:t,value:o}}function b(e,t,r,n,i){if("function"==typeof r){var o=r[n];if(o)for(var s=0,a=o.length;a>s;s++)Ember[i](e,o[s],null,t)}}function p(e,t,r){var n=e[t];b(e,t,n,"__ember_observesBefore__","removeBeforeObserver"),b(e,t,n,"__ember_observes__","removeObserver"),b(e,t,r,"__ember_observesBefore__","addBeforeObserver"),b(e,t,r,"__ember_observes__","addObserver")}function E(t,r,n){var i,o,s,a={},u={},l=Ember.meta(t),b=[];c(r,e(t),a,u,t,b);for(var E=0,d=b.length;d>E;E++)if(i=b[E],"constructor"!==i&&u.hasOwnProperty(i)&&(s=a[i],o=u[i],s!==y)){for(;s&&s instanceof _;){var v=m(t,s,l,a,u);s=v.desc,o=v.value}(void 0!==s||void 0!==o)&&(p(t,i,o),h(t,i,o,l),A(t,i,s,o,l))}return n||f(t,l),t}function d(e,t,r){var n=j(e);if(r[n])return!1;if(r[n]=!0,e===t)return!0;for(var i=e.mixins,o=i?i.length:0;--o>=0;)if(d(i[o],t,r))return!0;return!1}function v(e,t,r){if(!r[j(t)])if(r[j(t)]=!0,t.properties){var n=t.properties;for(var i in n)n.hasOwnProperty(i)&&(e[i]=!0)}else t.mixins&&w.call(t.mixins,function(t){v(e,t,r)})}var g,y,_,C=Ember.ArrayPolyfills.map,O=Ember.ArrayPolyfills.indexOf,w=Ember.ArrayPolyfills.forEach,S=[].slice,P=Ember.create,A=Ember.defineProperty,j=Ember.guidFor,x={},D=Ember.IS_BINDING=/^.+Binding$/;Ember.mixin=function(e){var t=S.call(arguments,1);return E(e,t,!1),e},Ember.Mixin=function(){return t(this,arguments)},g=Ember.Mixin,g.prototype={properties:null,mixins:null,ownerConstructor:null},g._apply=E,g.applyPartial=function(e){var t=S.call(arguments,1);return E(e,t,!0)},g.finishPartial=f,Ember.anyUnprocessedMixins=!1,g.create=function(){Ember.anyUnprocessedMixins=!0;var e=this;return t(new e,arguments)};var T=g.prototype;T.reopen=function(){var e,t;this.properties?(e=g.create(),e.properties=this.properties,delete this.properties,this.mixins=[e]):this.mixins||(this.mixins=[]);var r,n=arguments.length,i=this.mixins;for(r=0;n>r;r++)e=arguments[r],e instanceof g?i.push(e):(t=g.create(),t.properties=e,i.push(t));return this},T.apply=function(e){return E(e,[this],!1)},T.applyPartial=function(e){return E(e,[this],!0)},T.detect=function(e){if(!e)return!1;if(e instanceof g)return d(e,this,{});var t=Ember.meta(e,!1).mixins;return t?!!t[j(this)]:!1},T.without=function(){var e=new g(this);return e._without=S.call(arguments),e},T.keys=function(){var e={},t={},r=[];v(e,this,t);for(var n in e)e.hasOwnProperty(n)&&r.push(n);return r},g.mixins=function(e){var t=Ember.meta(e,!1).mixins,r=[];if(!t)return r;for(var n in t){var i=t[n];i.properties||r.push(i)}return r},y=new Ember.Descriptor,y.toString=function(){return"(Required Property)"},Ember.required=function(){return y},_=function(e){this.methodName=e},_.prototype=new Ember.Descriptor,Ember.alias=function(e){return new _(e)},Ember.alias=Ember.deprecateFunc("Ember.alias is deprecated. Please use Ember.aliasMethod or Ember.computed.alias instead.",Ember.alias),Ember.aliasMethod=function(e){return new _(e)},Ember.observer=function(e){var t=S.call(arguments,1);return e.__ember_observes__=t,e},Ember.immediateObserver=function(){for(var e=0,t=arguments.length;t>e;e++)arguments[e];return Ember.observer.apply(this,arguments)},Ember.beforeObserver=function(e){var t=S.call(arguments,1);return e.__ember_observesBefore__=t,e}}(),function(){e("rsvp/all",["rsvp/defer","exports"],function(e,t){"use strict";function r(e){var t=[],r=n(),i=e.length;0===i&&r.resolve([]);for(var o=function(e){return function(t){s(e,t)}},s=function(e,n){t[e]=n,0===--i&&r.resolve(t)},a=function(e){r.reject(e)},u=0;u<e.length;u++)e[u]&&"function"==typeof e[u].then?e[u].then(o(u),a):s(u,e[u]);return r.promise}var n=e.defer;t.all=r}),e("rsvp/async",["exports"],function(e){"use strict";var t,r="undefined"!=typeof window?window:{},n=r.MutationObserver||r.WebKitMutationObserver;if("undefined"!=typeof process&&"[object process]"==={}.toString.call(process))t=function(e,t){process.nextTick(function(){e.call(t)})};else if(n){var i=[],o=new n(function(){var e=i.slice();i=[],e.forEach(function(e){var t=e[0],r=e[1];t.call(r)})}),s=document.createElement("div");o.observe(s,{attributes:!0}),window.addEventListener("unload",function(){o.disconnect(),o=null}),t=function(e,t){i.push([e,t]),s.setAttribute("drainQueue","drainQueue")}}else t=function(e,t){setTimeout(function(){e.call(t)},1)};e.async=t}),e("rsvp/config",["rsvp/async","exports"],function(e,t){"use strict";var r=e.async,n={};n.async=r,t.config=n}),e("rsvp/defer",["rsvp/promise","exports"],function(e,t){"use strict";function r(){var e={},t=new n(function(t,r){e.resolve=t,e.reject=r});return e.promise=t,e}var n=e.Promise;t.defer=r}),e("rsvp/events",["exports"],function(e){"use strict";var t=function(e,t){this.type=e;for(var r in t)t.hasOwnProperty(r)&&(this[r]=t[r])},r=function(e,t){for(var r=0,n=e.length;n>r;r++)if(e[r][0]===t)return r;return-1},n=function(e){var t=e._promiseCallbacks;return t||(t=e._promiseCallbacks={}),t},i={mixin:function(e){return e.on=this.on,e.off=this.off,e.trigger=this.trigger,e},on:function(e,t,i){var o,s,a=n(this);for(e=e.split(/\s+/),i=i||this;s=e.shift();)o=a[s],o||(o=a[s]=[]),-1===r(o,t)&&o.push([t,i])},off:function(e,t){var i,o,s,a=n(this);for(e=e.split(/\s+/);o=e.shift();)t?(i=a[o],s=r(i,t),-1!==s&&i.splice(s,1)):a[o]=[]},trigger:function(e,r){var i,o,s,a,u,c=n(this);if(i=c[e])for(var h=0;h<i.length;h++)o=i[h],s=o[0],a=o[1],"object"!=typeof r&&(r={detail:r}),u=new t(e,r),s.call(a,u)}};e.EventTarget=i}),e("rsvp/hash",["rsvp/defer","exports"],function(e,t){"use strict";function r(e){var t=0;for(var r in e)t++;return t}function n(e){var t={},n=i(),o=r(e);0===o&&n.resolve({});var s=function(e){return function(t){a(e,t)}},a=function(e,r){t[e]=r,0===--o&&n.resolve(t)},u=function(e){n.reject(e)};for(var c in e)e[c]&&"function"==typeof e[c].then?e[c].then(s(c),u):a(c,e[c]);return n.promise}var i=e.defer;t.hash=n}),e("rsvp/node",["rsvp/promise","rsvp/all","exports"],function(e,t,r){"use strict";function n(e,t){return function(r,n){r?t(r):arguments.length>2?e(Array.prototype.slice.call(arguments,1)):e(n)}}function i(e){return function(){var t,r,i=Array.prototype.slice.call(arguments),a=new o(function(e,n){t=e,r=n});return s(i).then(function(i){i.push(n(t,r));try{e.apply(this,i)}catch(o){r(o)}}),a}}var o=e.Promise,s=t.all;r.denodeify=i}),e("rsvp/promise",["rsvp/config","rsvp/events","exports"],function(e,t,r){"use strict";function n(e){return i(e)||"object"==typeof e&&null!==e}function i(e){return"function"==typeof e}function o(e,t){e===t?a(e,t):s(e,t)||a(e,t)}function s(e,t){var r=null;if(n(t)){try{r=t.then}catch(s){return u(e,s),!0}if(i(r)){try{r.call(t,function(r){t!==r?o(e,r):a(e,r)},function(t){u(e,t)})}catch(s){u(e,s)}return!0}}return!1}function a(e,t){c.async(function(){e.trigger("promise:resolved",{detail:t}),e.isFulfilled=!0,e.fulfillmentValue=t})}function u(e,t){c.async(function(){e.trigger("promise:failed",{detail:t}),e.isRejected=!0,e.rejectedReason=t})}var c=e.config,h=t.EventTarget,l=function(e){var t=this,r=!1;if("function"!=typeof e)throw new TypeError("You must pass a resolver function as the sole argument to the promise constructor");if(!(t instanceof l))return new l(e);var n=function(e){r||(r=!0,o(t,e))},i=function(e){r||(r=!0,u(t,e))};this.on("promise:resolved",function(e){this.trigger("success",{detail:e.detail})},this),this.on("promise:failed",function(e){this.trigger("error",{detail:e.detail})},this);try{e(n,i)}catch(s){i(s)}},f=function(e,t,r,n){var a,c,h,l,f=i(r);if(f)try{a=r(n.detail),h=!0}catch(m){l=!0,c=m}else a=n.detail,h=!0;s(t,a)||(f&&h?o(t,a):l?u(t,c):"resolve"===e?o(t,a):"reject"===e&&u(t,a))};l.prototype={constructor:l,then:function(e,t){var r=new l(function(){});return this.isFulfilled&&c.async(function(){f("resolve",r,e,{detail:this.fulfillmentValue})},this),this.isRejected&&c.async(function(){f("reject",r,t,{detail:this.rejectedReason})},this),this.on("promise:resolved",function(t){f("resolve",r,e,t)}),this.on("promise:failed",function(e){f("reject",r,t,e)}),r}},h.mixin(l.prototype),r.Promise=l}),e("rsvp/reject",["rsvp/promise","exports"],function(e,t){"use strict";function r(e){return new n(function(t,r){r(e)})}var n=e.Promise;t.reject=r}),e("rsvp/resolve",["rsvp/promise","exports"],function(e,t){"use strict";function r(e){return"function"==typeof e||"object"==typeof e&&null!==e}function n(e){var t=new i(function(t,n){var i;try{r(e)?(i=e.then,"function"==typeof i?i.call(e,t,n):t(e)):t(e)}catch(o){n(o)}});return t}var i=e.Promise;t.resolve=n}),e("rsvp",["rsvp/events","rsvp/promise","rsvp/node","rsvp/all","rsvp/hash","rsvp/defer","rsvp/config","rsvp/resolve","rsvp/reject","exports"],function(e,t,r,n,i,o,s,a,u,c){"use strict";function h(e,t){d[e]=t}var l=e.EventTarget,f=t.Promise,m=r.denodeify,b=n.all,p=i.hash,E=o.defer,d=s.config,v=a.resolve,g=u.reject;c.Promise=f,c.EventTarget=l,c.all=b,c.hash=p,c.defer=E,c.denodeify=m,c.configure=h,c.resolve=v,c.reject=g})}(),function(){e("container",[],function(){function e(e){this.parent=e,this.dict={}}function t(t){this.parent=t,this.children=[],this.resolver=t&&t.resolver||function(){},this.registry=new e(t&&t.registry),this.cache=new e(t&&t.cache),this.typeInjections=new e(t&&t.typeInjections),this.injections={},this._options=new e(t&&t._options),this._typeOptions=new e(t&&t._typeOptions)}function r(e){throw new Error(e+" is not currently supported on child containers")}function n(e,t){var r=o(e,t,"singleton");return r!==!1}function i(e,t){var r={};if(!t)return r;for(var n,i,o=0,s=t.length;s>o;o++)n=t[o],i=e.lookup(n.fullName),r[n.property]=i;return r}function o(e,t,r){var n=e._options.get(t);if(n&&void 0!==n[r])return n[r];var i=t.split(":")[0];return n=e._typeOptions.get(i),n?n[r]:void 0}function s(e,t){var r=e.normalize(t);return e.resolve(r)}function a(e,t){var r,n=s(e,t),a=t.split(":"),u=a[0];if(o(e,t,"instantiate")===!1)return n;if(n){var c=[];c=c.concat(e.typeInjections.get(u)||[]),c=c.concat(e.injections[t]||[]);var h=i(e,c);return h.container=e,h._debugContainerKey=t,r=n.create(h)}}function u(e,t){e.cache.eachLocal(function(r,n){o(e,r,"instantiate")!==!1&&t(n)})}function c(e){e.cache.eachLocal(function(t,r){o(e,t,"instantiate")!==!1&&r.destroy()}),e.cache.dict={}}return e.prototype={get:function(e){var t=this.dict;return t.hasOwnProperty(e)?t[e]:this.parent?this.parent.get(e):void 0},set:function(e,t){this.dict[e]=t},has:function(e){var t=this.dict;return t.hasOwnProperty(e)?!0:this.parent?this.parent.has(e):!1},eachLocal:function(e,t){var r=this.dict;for(var n in r)r.hasOwnProperty(n)&&e.call(t,n,r[n])}},t.prototype={child:function(){var e=new t(this);return this.children.push(e),e},set:function(e,t,r){e[t]=r},register:function(e,t,r,n){var i;-1!==e.indexOf(":")?(n=r,r=t,i=e):i=e+":"+t;var o=this.normalize(i);this.registry.set(o,r),this._options.set(o,n||{})},resolve:function(e){return this.resolver(e)||this.registry.get(e)},normalize:function(e){return e},lookup:function(e,t){if(e=this.normalize(e),t=t||{},this.cache.has(e)&&t.singleton!==!1)return this.cache.get(e);var r=a(this,e);return r?(n(this,e)&&t.singleton!==!1&&this.cache.set(e,r),r):void 0},has:function(e){return this.cache.has(e)?!0:!!s(this,e)},optionsForType:function(e,t){this.parent&&r("optionsForType"),this._typeOptions.set(e,t)},options:function(e,t){this.optionsForType(e,t)},typeInjection:function(e,t,n){this.parent&&r("typeInjection");var i=this.typeInjections.get(e);i||(i=[],this.typeInjections.set(e,i)),i.push({property:t,fullName:n})},injection:function(e,t,n){if(this.parent&&r("injection"),-1===e.indexOf(":"))return this.typeInjection(e,t,n);var i=this.injections[e]=this.injections[e]||[];i.push({property:t,fullName:n})},destroy:function(){this.isDestroyed=!0;for(var e=0,t=this.children.length;t>e;e++)this.children[e].destroy();this.children=[],u(this,function(e){e.destroy()}),delete this.parent,this.isDestroyed=!0},reset:function(){for(var e=0,t=this.children.length;t>e;e++)c(this.children[e]);c(this)}},t})}(),function(){function e(r,n,i,o){var s,a,u;if("object"!=typeof r||null===r)return r;if(n&&(a=t(i,r))>=0)return o[a];if("array"===Ember.typeOf(r)){if(s=r.slice(),n)for(a=s.length;--a>=0;)s[a]=e(s[a],n,i,o)}else if(Ember.Copyable&&Ember.Copyable.detect(r))s=r.copy(n,i,o);else{s={};for(u in r)r.hasOwnProperty(u)&&"__"!==u.substring(0,2)&&(s[u]=n?e(r[u],n,i,o):r[u])}return n&&(i.push(r),o.push(s)),s}var t=Ember.EnumerableUtils.indexOf;Ember.compare=function n(e,t){if(e===t)return 0;var r=Ember.typeOf(e),i=Ember.typeOf(t),o=Ember.Comparable;if(o){if("instance"===r&&o.detect(e.constructor))return e.constructor.compare(e,t);if("instance"===i&&o.detect(t.constructor))return 1-t.constructor.compare(t,e)}var s=Ember.ORDER_DEFINITION_MAPPING;if(!s){var a=Ember.ORDER_DEFINITION;s=Ember.ORDER_DEFINITION_MAPPING={};var u,c;for(u=0,c=a.length;c>u;++u)s[a[u]]=u;delete Ember.ORDER_DEFINITION}var h=s[r],l=s[i];if(l>h)return-1;if(h>l)return 1;switch(r){case"boolean":case"number":return t>e?-1:e>t?1:0;case"string":var f=e.localeCompare(t);return 0>f?-1:f>0?1:0;case"array":for(var m=e.length,b=t.length,p=Math.min(m,b),E=0,d=0;0===E&&p>d;)E=n(e[d],t[d]),d++;return 0!==E?E:b>m?-1:m>b?1:0;case"instance":return Ember.Comparable&&Ember.Comparable.detect(e)?e.compare(e,t):0;case"date":var v=e.getTime(),g=t.getTime();return g>v?-1:v>g?1:0;default:return 0}},Ember.copy=function(t,r){return"object"!=typeof t||null===t?t:Ember.Copyable&&Ember.Copyable.detect(t)?t.copy(r):e(t,r,r?[]:null,r?[]:null)},Ember.inspect=function(e){if("object"!=typeof e||null===e)return e+"";var t,r=[];for(var n in e)if(e.hasOwnProperty(n)){if(t=e[n],"toString"===t)continue;"function"===Ember.typeOf(t)&&(t="function() { ... }"),r.push(n+": "+t)}return"{"+r.join(", ")+"}"},Ember.isEqual=function(e,t){return e&&"function"==typeof e.isEqual?e.isEqual(t):e===t},Ember.ORDER_DEFINITION=Ember.ENV.ORDER_DEFINITION||["undefined","null","boolean","number","string","array","object","instance","function","class","date"],Ember.keys=Object.keys,(!Ember.keys||Ember.create.isSimulated)&&(Ember.keys=function(e){var t=[];for(var r in e)"__"!==r.substring(0,2)&&"_super"!==r&&e.hasOwnProperty(r)&&t.push(r);return t});var r=["description","fileName","lineNumber","message","name","number","stack"];Ember.Error=function(){for(var e=Error.apply(this,arguments),t=0;t<r.length;t++)this[r[t]]=e[r[t]]},Ember.Error.prototype=Ember.create(Error.prototype)}(),function(){Ember.RSVP=t("rsvp")}(),function(){var e=/[ _]/g,t={},r=/([a-z])([A-Z])/g,n=/(\-|_|\.|\s)+(.)?/g,i=/([a-z\d])([A-Z]+)/g,o=/\-|\s+/g;Ember.STRINGS={},Ember.String={fmt:function(e,t){var r=0;return e.replace(/%@([0-9]+)?/g,function(e,n){return n=n?parseInt(n,0)-1:r++,e=t[n],(null===e?"(null)":void 0===e?"":e).toString()})},loc:function(e,t){return e=Ember.STRINGS[e]||e,Ember.String.fmt(e,t)},w:function(e){return e.split(/\s+/)},decamelize:function(e){return e.replace(r,"$1_$2").toLowerCase()},dasherize:function(r){var n,i=t,o=i.hasOwnProperty(r);return o?i[r]:(n=Ember.String.decamelize(r).replace(e,"-"),i[r]=n,n)},camelize:function(e){return e.replace(n,function(e,t,r){return r?r.toUpperCase():""}).replace(/^([A-Z])/,function(e){return e.toLowerCase()})},classify:function(e){for(var t=e.split("."),r=[],n=0,i=t.length;i>n;n++){var o=Ember.String.camelize(t[n]);r.push(o.charAt(0).toUpperCase()+o.substr(1))}return r.join(".")},underscore:function(e){return e.replace(i,"$1_$2").replace(o,"_").toLowerCase()},capitalize:function(e){return e.charAt(0).toUpperCase()+e.substr(1)}}}(),function(){var e=Ember.String.fmt,t=Ember.String.w,r=Ember.String.loc,n=Ember.String.camelize,i=Ember.String.decamelize,o=Ember.String.dasherize,s=Ember.String.underscore,a=Ember.String.capitalize,u=Ember.String.classify;(Ember.EXTEND_PROTOTYPES===!0||Ember.EXTEND_PROTOTYPES.String)&&(String.prototype.fmt=function(){return e(this,arguments)},String.prototype.w=function(){return t(this)},String.prototype.loc=function(){return r(this,arguments)},String.prototype.camelize=function(){return n(this)},String.prototype.decamelize=function(){return i(this)},String.prototype.dasherize=function(){return o(this)},String.prototype.underscore=function(){return s(this)},String.prototype.classify=function(){return u(this)},String.prototype.capitalize=function(){return a(this)})}(),function(){var e=Array.prototype.slice;(Ember.EXTEND_PROTOTYPES===!0||Ember.EXTEND_PROTOTYPES.Function)&&(Function.prototype.property=function(){var e=Ember.computed(this);return e.property.apply(e,arguments)},Function.prototype.observes=function(){return this.__ember_observes__=e.call(arguments),this},Function.prototype.observesBefore=function(){return this.__ember_observesBefore__=e.call(arguments),this})}(),function(){function e(){return 0===a.length?{}:a.pop()}function t(e){return a.push(e),null}function r(e,t){function r(r){var o=n(r,e);return i?t===o:!!o}var i=2===arguments.length;return r}var n=Ember.get,i=Ember.set,o=Array.prototype.slice,s=Ember.EnumerableUtils.indexOf,a=[];Ember.Enumerable=Ember.Mixin.create({isEnumerable:!0,nextObject:Ember.required(Function),firstObject:Ember.computed(function(){if(0===n(this,"length"))return void 0;var r,i=e();return r=this.nextObject(0,null,i),t(i),r}).property("[]"),lastObject:Ember.computed(function(){var r=n(this,"length");if(0===r)return void 0;var i,o=e(),s=0,a=null;do a=i,i=this.nextObject(s++,a,o);while(void 0!==i);return t(o),a}).property("[]"),contains:function(e){return void 0!==this.find(function(t){return t===e})},forEach:function(r,i){if("function"!=typeof r)throw new TypeError;var o=n(this,"length"),s=null,a=e();void 0===i&&(i=null);for(var u=0;o>u;u++){var c=this.nextObject(u,s,a);r.call(i,c,u,this),s=c}return s=null,a=t(a),this},getEach:function(e){return this.mapProperty(e)},setEach:function(e,t){return this.forEach(function(r){i(r,e,t)})},map:function(e,t){var r=Ember.A([]);return this.forEach(function(n,i,o){r[i]=e.call(t,n,i,o)}),r},mapProperty:function(e){return this.map(function(t){return n(t,e)})},filter:function(e,t){var r=Ember.A([]);return this.forEach(function(n,i,o){e.call(t,n,i,o)&&r.push(n)}),r},reject:function(e,t){return this.filter(function(){return!e.apply(t,arguments)})},filterProperty:function(){return this.filter(r.apply(this,arguments))},rejectProperty:function(e,t){var r=function(r){return n(r,e)===t},i=function(t){return!!n(t,e)},o=2===arguments.length?r:i;return this.reject(o)},find:function(r,i){var o=n(this,"length");void 0===i&&(i=null);for(var s,a,u=null,c=!1,h=e(),l=0;o>l&&!c;l++)s=this.nextObject(l,u,h),(c=r.call(i,s,l,this))&&(a=s),u=s;return s=u=null,h=t(h),a},findProperty:function(){return this.find(r.apply(this,arguments))},every:function(e,t){return!this.find(function(r,n,i){return!e.call(t,r,n,i)})},everyProperty:function(){return this.every(r.apply(this,arguments))},some:function(e,t){return!!this.find(function(r,n,i){return!!e.call(t,r,n,i)})},someProperty:function(){return this.some(r.apply(this,arguments))},reduce:function(e,t,r){if("function"!=typeof e)throw new TypeError;var n=t;return this.forEach(function(t,i){n=e.call(null,n,t,i,this,r)},this),n},invoke:function(e){var t,r=Ember.A([]);return arguments.length>1&&(t=o.call(arguments,1)),this.forEach(function(n,i){var o=n&&n[e];"function"==typeof o&&(r[i]=t?o.apply(n,t):o.call(n))},this),r},toArray:function(){var e=Ember.A([]);return this.forEach(function(t,r){e[r]=t}),e},compact:function(){return this.filter(function(e){return null!=e})},without:function(e){if(!this.contains(e))return this;var t=Ember.A([]);return this.forEach(function(r){r!==e&&(t[t.length]=r)}),t},uniq:function(){var e=Ember.A([]);return this.forEach(function(t){s(e,t)<0&&e.push(t)}),e},"[]":Ember.computed(function(){return this}),addEnumerableObserver:function(e,t){var r=t&&t.willChange||"enumerableWillChange",i=t&&t.didChange||"enumerableDidChange",o=n(this,"hasEnumerableObservers");return o||Ember.propertyWillChange(this,"hasEnumerableObservers"),Ember.addListener(this,"@enumerable:before",e,r),Ember.addListener(this,"@enumerable:change",e,i),o||Ember.propertyDidChange(this,"hasEnumerableObservers"),this},removeEnumerableObserver:function(e,t){var r=t&&t.willChange||"enumerableWillChange",i=t&&t.didChange||"enumerableDidChange",o=n(this,"hasEnumerableObservers");return o&&Ember.propertyWillChange(this,"hasEnumerableObservers"),Ember.removeListener(this,"@enumerable:before",e,r),Ember.removeListener(this,"@enumerable:change",e,i),o&&Ember.propertyDidChange(this,"hasEnumerableObservers"),this},hasEnumerableObservers:Ember.computed(function(){return Ember.hasListeners(this,"@enumerable:change")||Ember.hasListeners(this,"@enumerable:before")}),enumerableContentWillChange:function(e,t){var r,i,o;return r="number"==typeof e?e:e?n(e,"length"):e=-1,i="number"==typeof t?t:t?n(t,"length"):t=-1,o=0>i||0>r||0!==i-r,-1===e&&(e=null),-1===t&&(t=null),Ember.propertyWillChange(this,"[]"),o&&Ember.propertyWillChange(this,"length"),Ember.sendEvent(this,"@enumerable:before",[this,e,t]),this},enumerableContentDidChange:function(e,t){var r,i,o;return r="number"==typeof e?e:e?n(e,"length"):e=-1,i="number"==typeof t?t:t?n(t,"length"):t=-1,o=0>i||0>r||0!==i-r,-1===e&&(e=null),-1===t&&(t=null),Ember.sendEvent(this,"@enumerable:change",[this,e,t]),o&&Ember.propertyDidChange(this,"length"),Ember.propertyDidChange(this,"[]"),this}})}(),function(){var e=Ember.get,t=(Ember.set,Ember.isNone),r=Ember.EnumerableUtils.map,n=Ember.cacheFor;Ember.Array=Ember.Mixin.create(Ember.Enumerable,{length:Ember.required(),objectAt:function(t){return 0>t||t>=e(this,"length")?void 0:e(this,t)},objectsAt:function(e){var t=this;return r(e,function(e){return t.objectAt(e)})},nextObject:function(e){return this.objectAt(e)},"[]":Ember.computed(function(t,r){return void 0!==r&&this.replace(0,e(this,"length"),r),this}),firstObject:Ember.computed(function(){return this.objectAt(0)}),lastObject:Ember.computed(function(){return this.objectAt(e(this,"length")-1)}),contains:function(e){return this.indexOf(e)>=0},slice:function(r,n){var i=Ember.A([]),o=e(this,"length");for(t(r)&&(r=0),(t(n)||n>o)&&(n=o),0>r&&(r=o+r),0>n&&(n=o+n);n>r;)i[i.length]=this.objectAt(r++);return i},indexOf:function(t,r){var n,i=e(this,"length");for(void 0===r&&(r=0),0>r&&(r+=i),n=r;i>n;n++)if(this.objectAt(n,!0)===t)return n;return-1},lastIndexOf:function(t,r){var n,i=e(this,"length");for((void 0===r||r>=i)&&(r=i-1),0>r&&(r+=i),n=r;n>=0;n--)if(this.objectAt(n)===t)return n;return-1},addArrayObserver:function(t,r){var n=r&&r.willChange||"arrayWillChange",i=r&&r.didChange||"arrayDidChange",o=e(this,"hasArrayObservers");return o||Ember.propertyWillChange(this,"hasArrayObservers"),Ember.addListener(this,"@array:before",t,n),Ember.addListener(this,"@array:change",t,i),o||Ember.propertyDidChange(this,"hasArrayObservers"),this},removeArrayObserver:function(t,r){var n=r&&r.willChange||"arrayWillChange",i=r&&r.didChange||"arrayDidChange",o=e(this,"hasArrayObservers");return o&&Ember.propertyWillChange(this,"hasArrayObservers"),Ember.removeListener(this,"@array:before",t,n),Ember.removeListener(this,"@array:change",t,i),o&&Ember.propertyDidChange(this,"hasArrayObservers"),this},hasArrayObservers:Ember.computed(function(){return Ember.hasListeners(this,"@array:change")||Ember.hasListeners(this,"@array:before")
|
17
|
+
}),arrayContentWillChange:function(t,r,n){void 0===t?(t=0,r=n=-1):(void 0===r&&(r=-1),void 0===n&&(n=-1)),Ember.isWatching(this,"@each")&&e(this,"@each"),Ember.sendEvent(this,"@array:before",[this,t,r,n]);var i,o;if(t>=0&&r>=0&&e(this,"hasEnumerableObservers")){i=[],o=t+r;for(var s=t;o>s;s++)i.push(this.objectAt(s))}else i=r;return this.enumerableContentWillChange(i,n),this},arrayContentDidChange:function(t,r,i){void 0===t?(t=0,r=i=-1):(void 0===r&&(r=-1),void 0===i&&(i=-1));var o,s;if(t>=0&&i>=0&&e(this,"hasEnumerableObservers")){o=[],s=t+i;for(var a=t;s>a;a++)o.push(this.objectAt(a))}else o=i;this.enumerableContentDidChange(r,o),Ember.sendEvent(this,"@array:change",[this,t,r,i]);var u=e(this,"length"),c=n(this,"firstObject"),h=n(this,"lastObject");return this.objectAt(0)!==c&&(Ember.propertyWillChange(this,"firstObject"),Ember.propertyDidChange(this,"firstObject")),this.objectAt(u-1)!==h&&(Ember.propertyWillChange(this,"lastObject"),Ember.propertyDidChange(this,"lastObject")),this},"@each":Ember.computed(function(){return this.__each||(this.__each=new Ember.EachProxy(this)),this.__each})})}(),function(){Ember.Comparable=Ember.Mixin.create({isComparable:!0,compare:Ember.required(Function)})}(),function(){var e=Ember.get;Ember.set,Ember.Copyable=Ember.Mixin.create({copy:Ember.required(Function),frozenCopy:function(){if(Ember.Freezable&&Ember.Freezable.detect(this))return e(this,"isFrozen")?this:this.copy().freeze();throw new Error(Ember.String.fmt("%@ does not support freezing",[this]))}})}(),function(){var e=Ember.get,t=Ember.set;Ember.Freezable=Ember.Mixin.create({isFrozen:!1,freeze:function(){return e(this,"isFrozen")?this:(t(this,"isFrozen",!0),this)}}),Ember.FROZEN_ERROR="Frozen object cannot be modified."}(),function(){var e=Ember.EnumerableUtils.forEach;Ember.MutableEnumerable=Ember.Mixin.create(Ember.Enumerable,{addObject:Ember.required(Function),addObjects:function(t){return Ember.beginPropertyChanges(this),e(t,function(e){this.addObject(e)},this),Ember.endPropertyChanges(this),this},removeObject:Ember.required(Function),removeObjects:function(t){return Ember.beginPropertyChanges(this),e(t,function(e){this.removeObject(e)},this),Ember.endPropertyChanges(this),this}})}(),function(){var e="Index out of range",t=[],r=Ember.get;Ember.set,Ember.MutableArray=Ember.Mixin.create(Ember.Array,Ember.MutableEnumerable,{replace:Ember.required(),clear:function(){var e=r(this,"length");return 0===e?this:(this.replace(0,e,t),this)},insertAt:function(t,n){if(t>r(this,"length"))throw new Error(e);return this.replace(t,0,[n]),this},removeAt:function(n,i){if("number"==typeof n){if(0>n||n>=r(this,"length"))throw new Error(e);void 0===i&&(i=1),this.replace(n,i,t)}return this},pushObject:function(e){return this.insertAt(r(this,"length"),e),e},pushObjects:function(e){return this.replace(r(this,"length"),0,e),this},popObject:function(){var e=r(this,"length");if(0===e)return null;var t=this.objectAt(e-1);return this.removeAt(e-1,1),t},shiftObject:function(){if(0===r(this,"length"))return null;var e=this.objectAt(0);return this.removeAt(0),e},unshiftObject:function(e){return this.insertAt(0,e),e},unshiftObjects:function(e){return this.replace(0,0,e),this},reverseObjects:function(){var e=r(this,"length");if(0===e)return this;var t=this.toArray().reverse();return this.replace(0,e,t),this},setObjects:function(e){if(0===e.length)return this.clear();var t=r(this,"length");return this.replace(0,t,e),this},removeObject:function(e){for(var t=r(this,"length")||0;--t>=0;){var n=this.objectAt(t);n===e&&this.removeAt(t)}return this},addObject:function(e){return this.contains(e)||this.pushObject(e),this}})}(),function(){var e=Ember.get,t=Ember.set;Ember.Observable=Ember.Mixin.create({get:function(t){return e(this,t)},getProperties:function(){var t={},r=arguments;1===arguments.length&&"array"===Ember.typeOf(arguments[0])&&(r=arguments[0]);for(var n=0;n<r.length;n++)t[r[n]]=e(this,r[n]);return t},set:function(e,r){return t(this,e,r),this},setProperties:function(e){return Ember.setProperties(this,e)},beginPropertyChanges:function(){return Ember.beginPropertyChanges(),this},endPropertyChanges:function(){return Ember.endPropertyChanges(),this},propertyWillChange:function(e){return Ember.propertyWillChange(this,e),this},propertyDidChange:function(e){return Ember.propertyDidChange(this,e),this},notifyPropertyChange:function(e){return this.propertyWillChange(e),this.propertyDidChange(e),this},addBeforeObserver:function(e,t,r){Ember.addBeforeObserver(this,e,t,r)},addObserver:function(e,t,r){Ember.addObserver(this,e,t,r)},removeObserver:function(e,t,r){Ember.removeObserver(this,e,t,r)},hasObserverFor:function(e){return Ember.hasListeners(this,e+":change")},getPath:function(e){return this.get(e)},setPath:function(e,t){return this.set(e,t)},getWithDefault:function(e,t){return Ember.getWithDefault(this,e,t)},incrementProperty:function(r,n){return Ember.isNone(n)&&(n=1),t(this,r,(e(this,r)||0)+n),e(this,r)},decrementProperty:function(r,n){return Ember.isNone(n)&&(n=1),t(this,r,(e(this,r)||0)-n),e(this,r)},toggleProperty:function(r){return t(this,r,!e(this,r)),e(this,r)},cacheFor:function(e){return Ember.cacheFor(this,e)},observersForKey:function(e){return Ember.observersFor(this,e)}})}(),function(){var e=Ember.get;Ember.set,Ember.TargetActionSupport=Ember.Mixin.create({target:null,action:null,actionContext:null,targetObject:Ember.computed(function(){var t=e(this,"target");if("string"===Ember.typeOf(t)){var r=e(this,t);return void 0===r&&(r=e(Ember.lookup,t)),r}return t}).property("target"),actionContextObject:Ember.computed(function(){var t=e(this,"actionContext");if("string"===Ember.typeOf(t)){var r=e(this,t);return void 0===r&&(r=e(Ember.lookup,t)),r}return t}).property("actionContext"),triggerAction:function(t){t=t||{};var r=t.action||e(this,"action"),n=t.target||e(this,"targetObject"),i=t.actionContext||e(this,"actionContextObject")||this;if(n&&r){var o;return o=n.send?n.send.apply(n,[r,i]):n[r].apply(n,[i]),o!==!1&&(o=!0),o}return!1}})}(),function(){Ember.Evented=Ember.Mixin.create({on:function(e,t,r){return Ember.addListener(this,e,t,r),this},one:function(e,t,r){return r||(r=t,t=null),Ember.addListener(this,e,t,r,!0),this},trigger:function(e){var t,r,n=[];for(t=1,r=arguments.length;r>t;t++)n.push(arguments[t]);Ember.sendEvent(this,e,n)},fire:function(){this.trigger.apply(this,arguments)},off:function(e,t,r){return Ember.removeListener(this,e,t,r),this},has:function(e){return Ember.hasListeners(this,e)}})}(),function(){var e=t("rsvp");e.configure("async",function(e,t){Ember.run.schedule("actions",t,e)});var r=Ember.get;Ember.DeferredMixin=Ember.Mixin.create({then:function(e,t){function n(t){return t===o?e(s):e(t)}var i,o,s;return s=this,i=r(this,"_deferred"),o=i.promise,o.then(e&&n,t)},resolve:function(e){var t,n;t=r(this,"_deferred"),n=t.promise,e===this?t.resolve(n):t.resolve(e)},reject:function(e){r(this,"_deferred").reject(e)},_deferred:Ember.computed(function(){return e.defer()})})}(),function(){Ember.Container=t("container"),Ember.Container.set=Ember.set}(),function(){function e(){var e,t,o=!1,s=function(){o||s.proto(),n(this,i,v),n(this,"_super",v);var u=a(this);if(u.proto=this,e){var h=e;e=null,this.reopen.apply(this,h)}if(t){var l=t;t=null;for(var f=this.concatenatedProperties,m=0,p=l.length;p>m;m++){var g=l[m];for(var y in g)if(g.hasOwnProperty(y)){var _=g[y],C=Ember.IS_BINDING;if(C.test(y)){var O=u.bindings;O?u.hasOwnProperty("bindings")||(O=u.bindings=r(u.bindings)):O=u.bindings={},O[y]=_}var w=u.descs[y];if(f&&d(f,y)>=0){var S=this[y];_=S?"function"==typeof S.concat?S.concat(_):Ember.makeArray(S).concat(_):Ember.makeArray(_)}w?w.set(this,y,_):"function"!=typeof this.setUnknownProperty||y in this?E?Ember.defineProperty(this,y,null,_):this[y]=_:this.setUnknownProperty(y,_)}}}b(this,u),delete u.proto,c(this),this.init.apply(this,arguments)};return s.toString=f.prototype.toString,s.willReopen=function(){o&&(s.PrototypeMixin=f.create(s.PrototypeMixin)),o=!1},s._initMixins=function(t){e=t},s._initProperties=function(e){t=e},s.proto=function(){var e=s.superclass;return e&&e.proto(),o||(o=!0,s.PrototypeMixin.applyPartial(s.prototype),u(s.prototype)),this.prototype},s}function t(e){return function(){return e}}var r=(Ember.set,Ember.get,Ember.create),n=Ember.platform.defineProperty,i=Ember.GUID_KEY,o=Ember.guidFor,s=Ember.generateGuid,a=Ember.meta,u=Ember.rewatch,c=Ember.finishChains,h=Ember.destroy,l=Ember.run.schedule,f=Ember.Mixin,m=f._apply,b=f.finishPartial,p=f.prototype.reopen,E=Ember.ENV.MANDATORY_SETTER,d=Ember.EnumerableUtils.indexOf,v={configurable:!0,writable:!0,enumerable:!1,value:void 0},g=e();g.toString=function(){return"Ember.CoreObject"},g.PrototypeMixin=f.create({reopen:function(){return m(this,arguments,!0),this},isInstance:!0,init:function(){},concatenatedProperties:null,isDestroyed:!1,isDestroying:!1,destroy:function(){return this.isDestroying?void 0:(this.isDestroying=!0,l("actions",this,this.willDestroy),l("destroy",this,this._scheduledDestroy),this)},willDestroy:Ember.K,_scheduledDestroy:function(){this.isDestroyed||(h(this),this.isDestroyed=!0)},bind:function(e,t){return t instanceof Ember.Binding||(t=Ember.Binding.from(t)),t.to(e).connect(this),t},toString:function(){var e="function"==typeof this.toStringExtension,r=e?":"+this.toStringExtension():"",n="<"+this.constructor.toString()+":"+o(this)+r+">";return this.toString=t(n),n}}),g.PrototypeMixin.ownerConstructor=g,Ember.config.overridePrototypeMixin&&Ember.config.overridePrototypeMixin(g.PrototypeMixin),g.__super__=null;var y=f.create({ClassMixin:Ember.required(),PrototypeMixin:Ember.required(),isClass:!0,isMethod:!1,extend:function(){var t,n=e();return n.ClassMixin=f.create(this.ClassMixin),n.PrototypeMixin=f.create(this.PrototypeMixin),n.ClassMixin.ownerConstructor=n,n.PrototypeMixin.ownerConstructor=n,p.apply(n.PrototypeMixin,arguments),n.superclass=this,n.__super__=this.prototype,t=n.prototype=r(this.prototype),t.constructor=n,s(t,"ember"),a(t).proto=t,n.ClassMixin.apply(n),n},createWithMixins:function(){var e=this;return arguments.length>0&&this._initMixins(arguments),new e},create:function(){var e=this;return arguments.length>0&&this._initProperties(arguments),new e},reopen:function(){return this.willReopen(),p.apply(this.PrototypeMixin,arguments),this},reopenClass:function(){return p.apply(this.ClassMixin,arguments),m(this,arguments,!1),this},detect:function(e){if("function"!=typeof e)return!1;for(;e;){if(e===this)return!0;e=e.superclass}return!1},detectInstance:function(e){return e instanceof this},metaForProperty:function(e){var t=a(this.proto(),!1).descs[e];return t._meta||{}},eachComputedProperty:function(e,t){var r,n=this.proto(),i=a(n).descs,o={};for(var s in i)r=i[s],r instanceof Ember.ComputedProperty&&e.call(t||this,s,r._meta||o)}});y.ownerConstructor=g,Ember.config.overrideClassMixin&&Ember.config.overrideClassMixin(y),g.ClassMixin=y,y.apply(g),Ember.CoreObject=g}(),function(){Ember.Object=Ember.CoreObject.extend(Ember.Observable),Ember.Object.toString=function(){return"Ember.Object"}}(),function(){function e(t,r,i){var s=t.length;c[t.join(".")]=r;for(var a in r)if(h.call(r,a)){var u=r[a];if(t[s]=a,u&&u.toString===n)u.toString=o(t.join(".")),u[f]=t.join(".");else if(u&&u.isNamespace){if(i[l(u)])continue;i[l(u)]=!0,e(t,u,i)}}t.length=s}function t(){var e,t,r=Ember.Namespace,n=Ember.lookup;if(!r.PROCESSED)for(var i in n)if("parent"!==i&&"top"!==i&&"frameElement"!==i&&"webkitStorageInfo"!==i&&!("globalStorage"===i&&n.StorageList&&n.globalStorage instanceof n.StorageList||n.hasOwnProperty&&!n.hasOwnProperty(i))){try{e=Ember.lookup[i],t=e&&e.isNamespace}catch(o){continue}t&&(e[f]=i)}}function r(e){var t=e.superclass;return t?t[f]?t[f]:r(t):void 0}function n(){Ember.BOOTED||this[f]||i();var e;if(this[f])e=this[f];else{var t=r(this);e=t?"(subclass of "+t+")":"(unknown mixin)",this.toString=o(e)}return e}function i(){var r=!u.PROCESSED,n=Ember.anyUnprocessedMixins;if(r&&(t(),u.PROCESSED=!0),r||n){for(var i,o=u.NAMESPACES,s=0,a=o.length;a>s;s++)i=o[s],e([i.toString()],i,{});Ember.anyUnprocessedMixins=!1}}function o(e){return function(){return e}}var s=Ember.get,a=Ember.ArrayPolyfills.indexOf,u=Ember.Namespace=Ember.Object.extend({isNamespace:!0,init:function(){Ember.Namespace.NAMESPACES.push(this),Ember.Namespace.PROCESSED=!1},toString:function(){var e=s(this,"name");return e?e:(t(),this[Ember.GUID_KEY+"_name"])},nameClasses:function(){e([this.toString()],this,{})},destroy:function(){var e=Ember.Namespace.NAMESPACES;Ember.lookup[this.toString()]=void 0,e.splice(a.call(e,this),1),this._super()}});u.reopenClass({NAMESPACES:[Ember],NAMESPACES_BY_ID:{},PROCESSED:!1,processAll:i,byName:function(e){return Ember.BOOTED||i(),c[e]}});var c=u.NAMESPACES_BY_ID,h={}.hasOwnProperty,l=Ember.guidFor,f=Ember.NAME_KEY=Ember.GUID_KEY+"_name";Ember.Mixin.prototype.toString=n}(),function(){Ember.Application=Ember.Namespace.extend()}(),function(){var e="Index out of range",t=[],r=Ember.get;Ember.set,Ember.ArrayProxy=Ember.Object.extend(Ember.MutableArray,{content:null,arrangedContent:Ember.computed.alias("content"),objectAtContent:function(e){return r(this,"arrangedContent").objectAt(e)},replaceContent:function(e,t,n){r(this,"content").replace(e,t,n)},_contentWillChange:Ember.beforeObserver(function(){this._teardownContent()},"content"),_teardownContent:function(){var e=r(this,"content");e&&e.removeArrayObserver(this,{willChange:"contentArrayWillChange",didChange:"contentArrayDidChange"})},contentArrayWillChange:Ember.K,contentArrayDidChange:Ember.K,_contentDidChange:Ember.observer(function(){r(this,"content"),this._setupContent()},"content"),_setupContent:function(){var e=r(this,"content");e&&e.addArrayObserver(this,{willChange:"contentArrayWillChange",didChange:"contentArrayDidChange"})},_arrangedContentWillChange:Ember.beforeObserver(function(){var e=r(this,"arrangedContent"),t=e?r(e,"length"):0;this.arrangedContentArrayWillChange(this,0,t,void 0),this.arrangedContentWillChange(this),this._teardownArrangedContent(e)},"arrangedContent"),_arrangedContentDidChange:Ember.observer(function(){var e=r(this,"arrangedContent"),t=e?r(e,"length"):0;this._setupArrangedContent(),this.arrangedContentDidChange(this),this.arrangedContentArrayDidChange(this,0,void 0,t)},"arrangedContent"),_setupArrangedContent:function(){var e=r(this,"arrangedContent");e&&e.addArrayObserver(this,{willChange:"arrangedContentArrayWillChange",didChange:"arrangedContentArrayDidChange"})},_teardownArrangedContent:function(){var e=r(this,"arrangedContent");e&&e.removeArrayObserver(this,{willChange:"arrangedContentArrayWillChange",didChange:"arrangedContentArrayDidChange"})},arrangedContentWillChange:Ember.K,arrangedContentDidChange:Ember.K,objectAt:function(e){return r(this,"content")&&this.objectAtContent(e)},length:Ember.computed(function(){var e=r(this,"arrangedContent");return e?r(e,"length"):0}),_replace:function(e,t,n){var i=r(this,"content");return i&&this.replaceContent(e,t,n),this},replace:function(){if(r(this,"arrangedContent")!==r(this,"content"))throw new Ember.Error("Using replace on an arranged ArrayProxy is not allowed.");this._replace.apply(this,arguments)},_insertAt:function(t,n){if(t>r(this,"content.length"))throw new Error(e);return this._replace(t,0,[n]),this},insertAt:function(e,t){if(r(this,"arrangedContent")===r(this,"content"))return this._insertAt(e,t);throw new Ember.Error("Using insertAt on an arranged ArrayProxy is not allowed.")},removeAt:function(n,i){if("number"==typeof n){var o,s=r(this,"content"),a=r(this,"arrangedContent"),u=[];if(0>n||n>=r(this,"length"))throw new Error(e);for(void 0===i&&(i=1),o=n;n+i>o;o++)u.push(s.indexOf(a.objectAt(o)));for(u.sort(function(e,t){return t-e}),Ember.beginPropertyChanges(),o=0;o<u.length;o++)this._replace(u[o],1,t);Ember.endPropertyChanges()}return this},pushObject:function(e){return this._insertAt(r(this,"content.length"),e),e},pushObjects:function(e){return this._replace(r(this,"length"),0,e),this},setObjects:function(e){if(0===e.length)return this.clear();var t=r(this,"length");return this._replace(0,t,e),this},unshiftObject:function(e){return this._insertAt(0,e),e},unshiftObjects:function(e){return this._replace(0,0,e),this},slice:function(){var e=this.toArray();return e.slice.apply(e,arguments)},arrangedContentArrayWillChange:function(e,t,r,n){this.arrayContentWillChange(t,r,n)},arrangedContentArrayDidChange:function(e,t,r,n){this.arrayContentDidChange(t,r,n)},init:function(){this._super(),this._setupContent(),this._setupArrangedContent()},willDestroy:function(){this._teardownArrangedContent(),this._teardownContent()}})}(),function(){function e(e,t){var r=t.slice(8);r in this||u(this,r)}function t(e,t){var r=t.slice(8);r in this||c(this,r)}var r=Ember.get,n=Ember.set,i=(Ember.String.fmt,Ember.addBeforeObserver),o=Ember.addObserver,s=Ember.removeBeforeObserver,a=Ember.removeObserver,u=Ember.propertyWillChange,c=Ember.propertyDidChange;Ember.ObjectProxy=Ember.Object.extend({content:null,_contentDidChange:Ember.observer(function(){},"content"),isTruthy:Ember.computed.bool("content"),_debugContainerKey:null,willWatchProperty:function(r){var n="content."+r;i(this,n,null,e),o(this,n,null,t)},didUnwatchProperty:function(r){var n="content."+r;s(this,n,null,e),a(this,n,null,t)},unknownProperty:function(e){var t=r(this,"content");return t?r(t,e):void 0},setUnknownProperty:function(e,t){var i=r(this,"content");return n(i,e,t)}}),Ember.ObjectProxy.reopenClass({create:function(){var e,t,r,n,i,o;if(arguments.length){for(t=this.proto(),r=0,n=arguments.length;n>r;r++){i=arguments[r];for(o in i)!i.hasOwnProperty(o)||o in t||(e||(e={}),e[o]=null)}e&&this._initMixins([e])}return this._super.apply(this,arguments)}})}(),function(){function e(e,t,r,i,o){var s,a=r._objects;for(a||(a=r._objects={});--o>=i;){var u=e.objectAt(o);u&&(Ember.addBeforeObserver(u,t,r,"contentKeyWillChange"),Ember.addObserver(u,t,r,"contentKeyDidChange"),s=n(u),a[s]||(a[s]=[]),a[s].push(o))}}function t(e,t,r,i,o){var s=r._objects;s||(s=r._objects={});for(var a,u;--o>=i;){var c=e.objectAt(o);c&&(Ember.removeBeforeObserver(c,t,r,"contentKeyWillChange"),Ember.removeObserver(c,t,r,"contentKeyDidChange"),u=n(c),a=s[u],a[a.indexOf(o)]=null)}}var r=(Ember.set,Ember.get),n=Ember.guidFor,i=Ember.EnumerableUtils.forEach,o=Ember.Object.extend(Ember.Array,{init:function(e,t,r){this._super(),this._keyName=t,this._owner=r,this._content=e},objectAt:function(e){var t=this._content.objectAt(e);return t&&r(t,this._keyName)},length:Ember.computed(function(){var e=this._content;return e?r(e,"length"):0})}),s=/^.+:(before|change)$/;Ember.EachProxy=Ember.Object.extend({init:function(e){this._super(),this._content=e,e.addArrayObserver(this),i(Ember.watchedEvents(this),function(e){this.didAddListener(e)},this)},unknownProperty:function(e){var t;return t=new o(this._content,e,this),Ember.defineProperty(this,e,null,t),this.beginObservingContentKey(e),t},arrayWillChange:function(e,r,n){var i,o,s=this._keys;o=n>0?r+n:-1,Ember.beginPropertyChanges(this);for(i in s)s.hasOwnProperty(i)&&(o>0&&t(e,i,this,r,o),Ember.propertyWillChange(this,i));Ember.propertyWillChange(this._content,"@each"),Ember.endPropertyChanges(this)},arrayDidChange:function(t,r,n,i){var o,s,a=this._keys;s=i>0?r+i:-1,Ember.beginPropertyChanges(this);for(o in a)a.hasOwnProperty(o)&&(s>0&&e(t,o,this,r,s),Ember.propertyDidChange(this,o));Ember.propertyDidChange(this._content,"@each"),Ember.endPropertyChanges(this)},didAddListener:function(e){s.test(e)&&this.beginObservingContentKey(e.slice(0,-7))},didRemoveListener:function(e){s.test(e)&&this.stopObservingContentKey(e.slice(0,-7))},beginObservingContentKey:function(t){var n=this._keys;if(n||(n=this._keys={}),n[t])n[t]++;else{n[t]=1;var i=this._content,o=r(i,"length");e(i,t,this,0,o)}},stopObservingContentKey:function(e){var n=this._keys;if(n&&n[e]>0&&--n[e]<=0){var i=this._content,o=r(i,"length");t(i,e,this,0,o)}},contentKeyWillChange:function(e,t){Ember.propertyWillChange(this,t)},contentKeyDidChange:function(e,t){Ember.propertyDidChange(this,t)}})}(),function(){var e=Ember.get;Ember.set;var t=Ember.Mixin.create(Ember.MutableArray,Ember.Observable,Ember.Copyable,{get:function(e){return"length"===e?this.length:"number"==typeof e?this[e]:this._super(e)},objectAt:function(e){return this[e]},replace:function(t,r,n){if(this.isFrozen)throw Ember.FROZEN_ERROR;var i=n?e(n,"length"):0;if(this.arrayContentWillChange(t,r,i),n&&0!==n.length){var o=[t,r].concat(n);this.splice.apply(this,o)}else this.splice(t,r);return this.arrayContentDidChange(t,r,i),this},unknownProperty:function(e,t){var r;return void 0!==t&&void 0===r&&(r=this[e]=t),r},indexOf:function(e,t){var r,n=this.length;for(t=void 0===t?0:0>t?Math.ceil(t):Math.floor(t),0>t&&(t+=n),r=t;n>r;r++)if(this[r]===e)return r;return-1},lastIndexOf:function(e,t){var r,n=this.length;for(t=void 0===t?n-1:0>t?Math.ceil(t):Math.floor(t),0>t&&(t+=n),r=t;r>=0;r--)if(this[r]===e)return r;return-1},copy:function(e){return e?this.map(function(e){return Ember.copy(e,!0)}):this.slice()}}),r=["length"];Ember.EnumerableUtils.forEach(t.keys(),function(e){Array.prototype[e]&&r.push(e)}),r.length>0&&(t=t.without.apply(t,r)),Ember.NativeArray=t,Ember.A=function(e){return void 0===e&&(e=[]),Ember.Array.detect(e)?e:Ember.NativeArray.apply(e)},Ember.NativeArray.activate=function(){t.apply(Array.prototype),Ember.A=function(e){return e||[]}},(Ember.EXTEND_PROTOTYPES===!0||Ember.EXTEND_PROTOTYPES.Array)&&Ember.NativeArray.activate()}(),function(){var e=Ember.get,t=Ember.set,r=Ember.guidFor,n=Ember.isNone,i=Ember.String.fmt;Ember.Set=Ember.CoreObject.extend(Ember.MutableEnumerable,Ember.Copyable,Ember.Freezable,{length:0,clear:function(){if(this.isFrozen)throw new Error(Ember.FROZEN_ERROR);var n=e(this,"length");if(0===n)return this;var i;this.enumerableContentWillChange(n,0),Ember.propertyWillChange(this,"firstObject"),Ember.propertyWillChange(this,"lastObject");for(var o=0;n>o;o++)i=r(this[o]),delete this[i],delete this[o];return t(this,"length",0),Ember.propertyDidChange(this,"firstObject"),Ember.propertyDidChange(this,"lastObject"),this.enumerableContentDidChange(n,0),this},isEqual:function(t){if(!Ember.Enumerable.detect(t))return!1;var r=e(this,"length");if(e(t,"length")!==r)return!1;for(;--r>=0;)if(!t.contains(this[r]))return!1;return!0},add:Ember.aliasMethod("addObject"),remove:Ember.aliasMethod("removeObject"),pop:function(){if(e(this,"isFrozen"))throw new Error(Ember.FROZEN_ERROR);var t=this.length>0?this[this.length-1]:null;return this.remove(t),t},push:Ember.aliasMethod("addObject"),shift:Ember.aliasMethod("pop"),unshift:Ember.aliasMethod("push"),addEach:Ember.aliasMethod("addObjects"),removeEach:Ember.aliasMethod("removeObjects"),init:function(e){this._super(),e&&this.addObjects(e)},nextObject:function(e){return this[e]},firstObject:Ember.computed(function(){return this.length>0?this[0]:void 0}),lastObject:Ember.computed(function(){return this.length>0?this[this.length-1]:void 0}),addObject:function(i){if(e(this,"isFrozen"))throw new Error(Ember.FROZEN_ERROR);if(n(i))return this;var o,s=r(i),a=this[s],u=e(this,"length");return a>=0&&u>a&&this[a]===i?this:(o=[i],this.enumerableContentWillChange(null,o),Ember.propertyWillChange(this,"lastObject"),u=e(this,"length"),this[s]=u,this[u]=i,t(this,"length",u+1),Ember.propertyDidChange(this,"lastObject"),this.enumerableContentDidChange(null,o),this)},removeObject:function(i){if(e(this,"isFrozen"))throw new Error(Ember.FROZEN_ERROR);if(n(i))return this;var o,s,a=r(i),u=this[a],c=e(this,"length"),h=0===u,l=u===c-1;return u>=0&&c>u&&this[u]===i&&(s=[i],this.enumerableContentWillChange(s,null),h&&Ember.propertyWillChange(this,"firstObject"),l&&Ember.propertyWillChange(this,"lastObject"),c-1>u&&(o=this[c-1],this[u]=o,this[r(o)]=u),delete this[a],delete this[c-1],t(this,"length",c-1),h&&Ember.propertyDidChange(this,"firstObject"),l&&Ember.propertyDidChange(this,"lastObject"),this.enumerableContentDidChange(s,null)),this},contains:function(e){return this[r(e)]>=0},copy:function(){var n=this.constructor,i=new n,o=e(this,"length");for(t(i,"length",o);--o>=0;)i[o]=this[o],i[r(this[o])]=o;return i},toString:function(){var e,t=this.length,r=[];for(e=0;t>e;e++)r[e]=this[e];return i("Ember.Set<%@>",[r.join(",")])}})}(),function(){var e=Ember.DeferredMixin;Ember.get;var t=Ember.Object.extend(e);t.reopenClass({promise:function(e,r){var n=t.create();return e.call(r,n),n}}),Ember.Deferred=t}(),function(){var e=Ember.ArrayPolyfills.forEach,t=Ember.ENV.EMBER_LOAD_HOOKS||{},r={};Ember.onLoad=function(e,n){var i;t[e]=t[e]||Ember.A(),t[e].pushObject(n),(i=r[e])&&n(i)},Ember.runLoadHooks=function(n,i){r[n]=i,t[n]&&e.call(t[n],function(e){e(i)})}}(),function(){var e=Ember.get;Ember.ControllerMixin=Ember.Mixin.create({isController:!0,target:null,container:null,parentController:null,store:null,model:Ember.computed.alias("content"),send:function(t){var r,n=[].slice.call(arguments,1);this[t]?this[t].apply(this,n):(r=e(this,"target"))&&r.send.apply(r,arguments)}}),Ember.Controller=Ember.Object.extend(Ember.ControllerMixin)}(),function(){var e=Ember.get,t=(Ember.set,Ember.EnumerableUtils.forEach);Ember.SortableMixin=Ember.Mixin.create(Ember.MutableEnumerable,{sortProperties:null,sortAscending:!0,orderBy:function(r,n){var i=0,o=e(this,"sortProperties"),s=e(this,"sortAscending");return t(o,function(t){0===i&&(i=Ember.compare(e(r,t),e(n,t)),0===i||s||(i=-1*i))}),i},destroy:function(){var r=e(this,"content"),n=e(this,"sortProperties");return r&&n&&t(r,function(e){t(n,function(t){Ember.removeObserver(e,t,this,"contentItemSortPropertyDidChange")},this)},this),this._super()},isSorted:Ember.computed.bool("sortProperties"),arrangedContent:Ember.computed("content","sortProperties.@each",function(){var r=e(this,"content"),n=e(this,"isSorted"),i=e(this,"sortProperties"),o=this;return r&&n?(r=r.slice(),r.sort(function(e,t){return o.orderBy(e,t)}),t(r,function(e){t(i,function(t){Ember.addObserver(e,t,this,"contentItemSortPropertyDidChange")},this)},this),Ember.A(r)):r}),_contentWillChange:Ember.beforeObserver(function(){var r=e(this,"content"),n=e(this,"sortProperties");r&&n&&t(r,function(e){t(n,function(t){Ember.removeObserver(e,t,this,"contentItemSortPropertyDidChange")},this)},this),this._super()},"content"),sortAscendingWillChange:Ember.beforeObserver(function(){this._lastSortAscending=e(this,"sortAscending")},"sortAscending"),sortAscendingDidChange:Ember.observer(function(){if(e(this,"sortAscending")!==this._lastSortAscending){var t=e(this,"arrangedContent");t.reverseObjects()}},"sortAscending"),contentArrayWillChange:function(r,n,i,o){var s=e(this,"isSorted");if(s){var a=e(this,"arrangedContent"),u=r.slice(n,n+i),c=e(this,"sortProperties");t(u,function(e){a.removeObject(e),t(c,function(t){Ember.removeObserver(e,t,this,"contentItemSortPropertyDidChange")},this)},this)}return this._super(r,n,i,o)},contentArrayDidChange:function(r,n,i,o){var s=e(this,"isSorted"),a=e(this,"sortProperties");if(s){var u=r.slice(n,n+o);t(u,function(e){this.insertItemSorted(e),t(a,function(t){Ember.addObserver(e,t,this,"contentItemSortPropertyDidChange")},this)},this)}return this._super(r,n,i,o)},insertItemSorted:function(t){var r=e(this,"arrangedContent"),n=e(r,"length"),i=this._binarySearch(t,0,n);r.insertAt(i,t)},contentItemSortPropertyDidChange:function(t){var r=e(this,"arrangedContent"),n=r.indexOf(t),i=r.objectAt(n-1),o=r.objectAt(n+1),s=i&&this.orderBy(t,i),a=o&&this.orderBy(t,o);(0>s||a>0)&&(r.removeObject(t),this.insertItemSorted(t))},_binarySearch:function(t,r,n){var i,o,s,a;return r===n?r:(a=e(this,"arrangedContent"),i=r+Math.floor((n-r)/2),o=a.objectAt(i),s=this.orderBy(o,t),0>s?this._binarySearch(t,i+1,n):s>0?this._binarySearch(t,r,i):i)}})}(),function(){var e=Ember.get,t=(Ember.set,Ember.EnumerableUtils.forEach),r=Ember.EnumerableUtils.replace;Ember.ArrayController=Ember.ArrayProxy.extend(Ember.ControllerMixin,Ember.SortableMixin,{itemController:null,lookupItemController:function(){return e(this,"itemController")},objectAtContent:function(t){var r=e(this,"length"),n=e(this,"arrangedContent"),i=n&&n.objectAt(t);if(t>=0&&r>t){var o=this.lookupItemController(i);if(o)return this.controllerAt(t,i,o)}return i},arrangedContentDidChange:function(){this._super(),this._resetSubControllers()},arrayContentDidChange:function(n,i,o){var s=e(this,"_subControllers"),a=s.slice(n,n+i);t(a,function(e){e&&e.destroy()}),r(s,n,i,new Array(o)),this._super(n,i,o)},init:function(){this.get("content")||Ember.defineProperty(this,"content",void 0,Ember.A()),this._super(),this.set("_subControllers",Ember.A())},controllerAt:function(t,r,n){var i=e(this,"container"),o=e(this,"_subControllers"),s=o[t];if(s||(s=i.lookup("controller:"+n,{singleton:!1}),o[t]=s),!s)throw new Error('Could not resolve itemController: "'+n+'"');return s.set("target",this),s.set("parentController",e(this,"parentController")||this),s.set("content",r),s},_subControllers:null,_resetSubControllers:function(){var r=e(this,"_subControllers");r&&t(r,function(e){e&&e.destroy()}),this.set("_subControllers",Ember.A())}})}(),function(){Ember.ObjectController=Ember.ObjectProxy.extend(Ember.ControllerMixin)}(),function(){var e=Ember.get,t=Ember.set;Ember.State=Ember.Object.extend(Ember.Evented,{isState:!0,parentState:null,start:null,name:null,path:Ember.computed(function(){var t=e(this,"parentState.path"),r=e(this,"name");return t&&(r=t+"."+r),r}),trigger:function(e){this[e]&&this[e].apply(this,[].slice.call(arguments,1)),this._super.apply(this,arguments)},init:function(){var r=e(this,"states");t(this,"childStates",Ember.A()),t(this,"eventTransitions",e(this,"eventTransitions")||{});var n,i,o;if(r)for(n in r)this.setupChild(r,n,r[n]);else{r={};for(n in this)"constructor"!==n&&(i=this[n])&&((o=i.transitionTarget)&&(this.eventTransitions[n]=o),this.setupChild(r,n,i));t(this,"states",r)}t(this,"pathsCaches",{})},setPathsCache:function(t,r,n){var i=Ember.guidFor(t.constructor),o=e(this,"pathsCaches"),s=o[i]||{};s[r]=n,o[i]=s},getPathsCache:function(t,r){var n=Ember.guidFor(t.constructor),i=e(this,"pathsCaches"),o=i[n]||{};return o[r]},setupChild:function(r,n,i){return i?(i.isState?t(i,"name",n):Ember.State.detect(i)&&(i=i.create({name:n})),i.isState?(t(i,"parentState",this),e(this,"childStates").pushObject(i),r[n]=i,i):void 0):!1},lookupEventTransition:function(e){for(var t,r=this;r&&!t;)t=r.eventTransitions[e],r=r.get("parentState");return t},isLeaf:Ember.computed(function(){return!e(this,"childStates").length}),hasContext:!0,setup:Ember.K,enter:Ember.K,exit:Ember.K}),Ember.State.reopenClass({transitionTo:function(e){var t=function(t,r){var n=[],i=Ember.$&&Ember.$.Event;r&&i&&r instanceof i?r.hasOwnProperty("contexts")&&(n=r.contexts.slice()):n=[].slice.call(arguments,1),n.unshift(e),t.transitionTo.apply(t,n)};return t.transitionTarget=e,t}})}(),function(){var e=Ember.get,t=Ember.set,r=Ember.String.fmt,n=Ember.ArrayPolyfills.forEach,i=function(e){this.enterStates=e.enterStates.slice(),this.exitStates=e.exitStates.slice(),this.resolveState=e.resolveState,this.finalState=e.enterStates[e.enterStates.length-1]||e.resolveState};i.prototype={normalize:function(e,t){return this.matchContextsToStates(t),this.addInitialStates(),this.removeUnchangedContexts(e),this},matchContextsToStates:function(t){for(var r,n,i=this.enterStates.length-1,o=[];t.length>0;){if(i>=0)r=this.enterStates[i--];else{if(this.enterStates.length){if(r=e(this.enterStates[0],"parentState"),!r)throw"Cannot match all contexts to states"}else r=this.resolveState;this.enterStates.unshift(r),this.exitStates.unshift(r)}n=e(r,"hasContext")?t.pop():null,o.unshift(n)}this.contexts=o},addInitialStates:function(){for(var t,r=this.finalState;;){if(t=e(r,"initialState")||"start",r=e(r,"states."+t),!r)break;this.finalState=r,this.enterStates.push(r),this.contexts.push(void 0)}},removeUnchangedContexts:function(e){for(;this.enterStates.length>0&&this.enterStates[0]===this.exitStates[0];){if(this.enterStates.length===this.contexts.length){if(e.getStateMeta(this.enterStates[0],"context")!==this.contexts[0])break;this.contexts.shift()}this.resolveState=this.enterStates.shift(),this.exitStates.shift()}}};var o=function(t,n,i){var a,u,c,h=this.enableLogging,l=i?"unhandledEvent":t,f=n[l];if(a=[].slice.call(arguments,3),"function"==typeof f)return h&&(i?Ember.Logger.log(r("STATEMANAGER: Unhandled event '%@' being sent to state %@.",[t,e(n,"path")])):Ember.Logger.log(r("STATEMANAGER: Sending event '%@' to state %@.",[t,e(n,"path")]))),c=a,i&&c.unshift(t),c.unshift(this),f.apply(n,c);var m=e(n,"parentState");return m?(u=a,u.unshift(t,m,i),o.apply(this,u)):i?void 0:s.call(this,t,a,!0)},s=function(t,r,n){return r.unshift(t,e(this,"currentState"),n),o.apply(this,r)};Ember.StateManager=Ember.State.extend({init:function(){this._super(),t(this,"stateMeta",Ember.Map.create());
|
18
|
+
var r=e(this,"initialState");!r&&e(this,"states.start")&&(r="start"),r&&this.transitionTo(r)},stateMetaFor:function(t){var r=e(this,"stateMeta"),n=r.get(t);return n||(n={},r.set(t,n)),n},setStateMeta:function(e,r,n){return t(this.stateMetaFor(e),r,n)},getStateMeta:function(t,r){return e(this.stateMetaFor(t),r)},currentState:null,currentPath:Ember.computed.alias("currentState.path"),transitionEvent:"setup",errorOnUnhandledEvent:!0,send:function(e){var t=[].slice.call(arguments,1);return s.call(this,e,t,!1)},unhandledEvent:function(t,r){if(e(this,"errorOnUnhandledEvent"))throw new Ember.Error(this.toString()+" could not respond to event "+r+" in state "+e(this,"currentState.path")+".")},getStateByPath:function(t,r){for(var n=r.split("."),i=t,o=0,s=n.length;s>o&&(i=e(e(i,"states"),n[o]),i);o++);return i},findStateByPath:function(t,r){for(var n;!n&&t;)n=this.getStateByPath(t,r),t=e(t,"parentState");return n},getStatesInPath:function(t,r){if(!r||""===r)return void 0;for(var n,i,o=r.split("."),s=[],a=0,u=o.length;u>a;a++){if(n=e(t,"states"),!n)return void 0;if(i=e(n,o[a]),!i)return void 0;t=i,s.push(i)}return s},goToState:function(){return this.transitionTo.apply(this,arguments)},transitionTo:function(t,r){if(!Ember.isEmpty(t)){var n=r?Array.prototype.slice.call(arguments,1):[],o=e(this,"currentState")||this,s=this.contextFreeTransition(o,t),a=new i(s).normalize(this,n);this.enterState(a),this.triggerSetupContext(a)}},contextFreeTransition:function(t,r){var n=t.getPathsCache(this,r);if(n)return n;for(var i=this.getStatesInPath(t,r),o=[],s=t;s&&!i;){if(o.unshift(s),s=e(s,"parentState"),!s&&(i=this.getStatesInPath(this,r),!i))return;i=this.getStatesInPath(s,r)}for(;i.length>0&&i[0]===o[0];)s=i.shift(),o.shift();var a={exitStates:o,enterStates:i,resolveState:s};return t.setPathsCache(this,r,a),a},triggerSetupContext:function(t){var r=t.contexts,i=t.enterStates.length-r.length,o=t.enterStates,s=e(this,"transitionEvent");n.call(o,function(e,t){e.trigger(s,this,r[t-i])},this)},getState:function(t){var r=e(this,t),n=e(this,"parentState");return r?r:n?n.getState(t):void 0},enterState:function(r){var i=this.enableLogging,o=r.exitStates.slice(0).reverse();n.call(o,function(e){e.trigger("exit",this)},this),n.call(r.enterStates,function(t){i&&Ember.Logger.log("STATEMANAGER: Entering "+e(t,"path")),t.trigger("enter",this)},this),t(this,"currentState",r.finalState)}})}()}(),"undefined"==typeof location||"localhost"!==location.hostname&&"127.0.0.1"!==location.hostname||Ember.Logger.warn("You are running a production build of Ember on localhost and won't receive detailed error messages. If you want full error messages please use the non-minified build provided on the Ember website.");
|
@@ -12,11 +12,18 @@ var define, requireModule;
|
|
12
12
|
if (seen[name]) { return seen[name]; }
|
13
13
|
seen[name] = {};
|
14
14
|
|
15
|
-
var mod
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
15
|
+
var mod, deps, callback, reified, exports;
|
16
|
+
|
17
|
+
mod = registry[name];
|
18
|
+
|
19
|
+
if (!mod) {
|
20
|
+
throw new Error("Module '" + name + "' not found.");
|
21
|
+
}
|
22
|
+
|
23
|
+
deps = mod.deps;
|
24
|
+
callback = mod.callback;
|
25
|
+
reified = [];
|
26
|
+
exports;
|
20
27
|
|
21
28
|
for (var i=0, l=deps.length; i<l; i++) {
|
22
29
|
if (deps[i] === 'exports') {
|
@@ -55,7 +62,7 @@ var define, requireModule;
|
|
55
62
|
|
56
63
|
@class Ember
|
57
64
|
@static
|
58
|
-
@version 1.0.0-
|
65
|
+
@version 1.0.0-rc4
|
59
66
|
*/
|
60
67
|
|
61
68
|
if ('undefined' === typeof Ember) {
|
@@ -82,10 +89,10 @@ Ember.toString = function() { return "Ember"; };
|
|
82
89
|
/**
|
83
90
|
@property VERSION
|
84
91
|
@type String
|
85
|
-
@default '1.0.0-
|
92
|
+
@default '1.0.0-rc4'
|
86
93
|
@final
|
87
94
|
*/
|
88
|
-
Ember.VERSION = '1.0.0-
|
95
|
+
Ember.VERSION = '1.0.0-rc4';
|
89
96
|
|
90
97
|
/**
|
91
98
|
Standard environmental variables. You can define these in a global `ENV`
|
@@ -234,7 +241,7 @@ Ember.onerror = null;
|
|
234
241
|
/**
|
235
242
|
@private
|
236
243
|
|
237
|
-
Wrap code block in a try/catch if
|
244
|
+
Wrap code block in a try/catch if `Ember.onerror` is set.
|
238
245
|
|
239
246
|
@method handleErrors
|
240
247
|
@for Ember
|
@@ -310,7 +317,7 @@ Ember.none = Ember.deprecateFunc("Ember.none is deprecated. Please use Ember.isN
|
|
310
317
|
@return {Boolean}
|
311
318
|
*/
|
312
319
|
Ember.isEmpty = function(obj) {
|
313
|
-
return obj
|
320
|
+
return Ember.isNone(obj) || (obj.length === 0 && typeof obj !== 'function') || (typeof obj === 'object' && Ember.get(obj, 'length') === 0);
|
314
321
|
};
|
315
322
|
Ember.empty = Ember.deprecateFunc("Ember.empty is deprecated. Please use Ember.isEmpty instead.", Ember.isEmpty) ;
|
316
323
|
|
@@ -343,6 +350,13 @@ var platform = Ember.platform = {};
|
|
343
350
|
*/
|
344
351
|
Ember.create = Object.create;
|
345
352
|
|
353
|
+
// IE8 has Object.create but it couldn't treat property descripters.
|
354
|
+
if (Ember.create) {
|
355
|
+
if (Ember.create({a: 1}, {a: {value: 2}}).a !== 2) {
|
356
|
+
Ember.create = null;
|
357
|
+
}
|
358
|
+
}
|
359
|
+
|
346
360
|
// STUB_OBJECT_CREATE allows us to override other libraries that stub
|
347
361
|
// Object.create different than we would prefer
|
348
362
|
if (!Ember.create || Ember.ENV.STUB_OBJECT_CREATE) {
|
@@ -663,7 +677,7 @@ Ember.guidFor = function guidFor(obj) {
|
|
663
677
|
if (obj === undefined) return "(undefined)";
|
664
678
|
if (obj === null) return "(null)";
|
665
679
|
|
666
|
-
var
|
680
|
+
var ret;
|
667
681
|
var type = typeof obj;
|
668
682
|
|
669
683
|
// Don't allow prototype changes to String etc. to change the guidFor
|
@@ -812,6 +826,7 @@ Ember.setMeta = function setMeta(obj, property, value) {
|
|
812
826
|
};
|
813
827
|
|
814
828
|
/**
|
829
|
+
@deprecated
|
815
830
|
@private
|
816
831
|
|
817
832
|
In order to store defaults for a class, a prototype may need to create
|
@@ -844,6 +859,7 @@ Ember.setMeta = function setMeta(obj, property, value) {
|
|
844
859
|
shared with its constructor
|
845
860
|
*/
|
846
861
|
Ember.metaPath = function metaPath(obj, path, writable) {
|
862
|
+
|
847
863
|
var meta = Ember.meta(obj, writable), keyName, value;
|
848
864
|
|
849
865
|
for (var i=0, l=path.length; i<l; i++) {
|
@@ -1064,7 +1080,7 @@ if (needsFinallyFix) {
|
|
1064
1080
|
*/
|
1065
1081
|
if (needsFinallyFix) {
|
1066
1082
|
Ember.tryCatchFinally = function(tryable, catchable, finalizer, binding) {
|
1067
|
-
var result, finalResult, finalError
|
1083
|
+
var result, finalResult, finalError;
|
1068
1084
|
|
1069
1085
|
binding = binding || this;
|
1070
1086
|
|
@@ -1174,6 +1190,7 @@ Ember.typeOf = function(item) {
|
|
1174
1190
|
|
1175
1191
|
return ret;
|
1176
1192
|
};
|
1193
|
+
|
1177
1194
|
})();
|
1178
1195
|
|
1179
1196
|
|
@@ -1420,820 +1437,458 @@ var utils = Ember.EnumerableUtils = {
|
|
1420
1437
|
@module ember-metal
|
1421
1438
|
*/
|
1422
1439
|
|
1423
|
-
|
1424
|
-
JavaScript (before ES6) does not have a Map implementation. Objects,
|
1425
|
-
which are often used as dictionaries, may only have Strings as keys.
|
1426
|
-
|
1427
|
-
Because Ember has a way to get a unique identifier for every object
|
1428
|
-
via `Ember.guidFor`, we can implement a performant Map with arbitrary
|
1429
|
-
keys. Because it is commonly used in low-level bookkeeping, Map is
|
1430
|
-
implemented as a pure JavaScript object for performance.
|
1431
|
-
|
1432
|
-
This implementation follows the current iteration of the ES6 proposal for
|
1433
|
-
maps (http://wiki.ecmascript.org/doku.php?id=harmony:simple_maps_and_sets),
|
1434
|
-
with two exceptions. First, because we need our implementation to be pleasant
|
1435
|
-
on older browsers, we do not use the `delete` name (using `remove` instead).
|
1436
|
-
Second, as we do not have the luxury of in-VM iteration, we implement a
|
1437
|
-
forEach method for iteration.
|
1438
|
-
|
1439
|
-
Map is mocked out to look like an Ember object, so you can do
|
1440
|
-
`Ember.Map.create()` for symmetry with other Ember classes.
|
1441
|
-
*/
|
1442
|
-
var guidFor = Ember.guidFor,
|
1443
|
-
indexOf = Ember.ArrayPolyfills.indexOf;
|
1440
|
+
var META_KEY = Ember.META_KEY, get;
|
1444
1441
|
|
1445
|
-
var
|
1446
|
-
var output = {};
|
1442
|
+
var MANDATORY_SETTER = Ember.ENV.MANDATORY_SETTER;
|
1447
1443
|
|
1448
|
-
|
1449
|
-
|
1450
|
-
|
1444
|
+
var IS_GLOBAL_PATH = /^([A-Z$]|([0-9][A-Z$])).*[\.\*]/;
|
1445
|
+
var HAS_THIS = /^this[\.\*]/;
|
1446
|
+
var FIRST_KEY = /^([^\.\*]+)/;
|
1451
1447
|
|
1452
|
-
|
1453
|
-
|
1448
|
+
// ..........................................................
|
1449
|
+
// GET AND SET
|
1450
|
+
//
|
1451
|
+
// If we are on a platform that supports accessors we can use those.
|
1452
|
+
// Otherwise simulate accessors by looking up the property directly on the
|
1453
|
+
// object.
|
1454
1454
|
|
1455
|
-
|
1456
|
-
|
1457
|
-
|
1455
|
+
/**
|
1456
|
+
Gets the value of a property on an object. If the property is computed,
|
1457
|
+
the function will be invoked. If the property is not defined but the
|
1458
|
+
object implements the `unknownProperty` method then that will be invoked.
|
1458
1459
|
|
1459
|
-
|
1460
|
-
|
1460
|
+
If you plan to run on IE8 and older browsers then you should use this
|
1461
|
+
method anytime you want to retrieve a property on an object that you don't
|
1462
|
+
know for sure is private. (Properties beginning with an underscore '_'
|
1463
|
+
are considered private.)
|
1461
1464
|
|
1462
|
-
|
1463
|
-
|
1465
|
+
On all newer browsers, you only need to use this method to retrieve
|
1466
|
+
properties if the property might not be defined on the object and you want
|
1467
|
+
to respect the `unknownProperty` handler. Otherwise you can ignore this
|
1468
|
+
method.
|
1464
1469
|
|
1465
|
-
|
1466
|
-
|
1467
|
-
Please do not use it at this time. We plan to clean it up
|
1468
|
-
and add many tests soon.
|
1470
|
+
Note that if the object itself is `undefined`, this method will throw
|
1471
|
+
an error.
|
1469
1472
|
|
1470
|
-
@
|
1471
|
-
@
|
1472
|
-
@
|
1473
|
-
@
|
1473
|
+
@method get
|
1474
|
+
@for Ember
|
1475
|
+
@param {Object} obj The object to retrieve from.
|
1476
|
+
@param {String} keyName The property key to retrieve
|
1477
|
+
@return {Object} the property value or `null`.
|
1474
1478
|
*/
|
1475
|
-
|
1476
|
-
this
|
1477
|
-
|
1479
|
+
get = function get(obj, keyName) {
|
1480
|
+
// Helpers that operate with 'this' within an #each
|
1481
|
+
if (keyName === '') {
|
1482
|
+
return obj;
|
1483
|
+
}
|
1478
1484
|
|
1479
|
-
|
1480
|
-
|
1481
|
-
|
1482
|
-
|
1483
|
-
*/
|
1484
|
-
OrderedSet.create = function() {
|
1485
|
-
return new OrderedSet();
|
1486
|
-
};
|
1485
|
+
if (!keyName && 'string'===typeof obj) {
|
1486
|
+
keyName = obj;
|
1487
|
+
obj = null;
|
1488
|
+
}
|
1487
1489
|
|
1488
1490
|
|
1489
|
-
|
1490
|
-
|
1491
|
-
|
1492
|
-
*/
|
1493
|
-
clear: function() {
|
1494
|
-
this.presenceSet = {};
|
1495
|
-
this.list = [];
|
1496
|
-
},
|
1491
|
+
if (obj === null || keyName.indexOf('.') !== -1) {
|
1492
|
+
return getPath(obj, keyName);
|
1493
|
+
}
|
1497
1494
|
|
1498
|
-
|
1499
|
-
|
1500
|
-
|
1501
|
-
|
1502
|
-
|
1503
|
-
|
1504
|
-
|
1505
|
-
|
1495
|
+
var meta = obj[META_KEY], desc = meta && meta.descs[keyName], ret;
|
1496
|
+
if (desc) {
|
1497
|
+
return desc.get(obj, keyName);
|
1498
|
+
} else {
|
1499
|
+
if (MANDATORY_SETTER && meta && meta.watching[keyName] > 0) {
|
1500
|
+
ret = meta.values[keyName];
|
1501
|
+
} else {
|
1502
|
+
ret = obj[keyName];
|
1503
|
+
}
|
1506
1504
|
|
1507
|
-
if (
|
1505
|
+
if (ret === undefined &&
|
1506
|
+
'object' === typeof obj && !(keyName in obj) && 'function' === typeof obj.unknownProperty) {
|
1507
|
+
return obj.unknownProperty(keyName);
|
1508
|
+
}
|
1508
1509
|
|
1509
|
-
|
1510
|
-
|
1511
|
-
|
1510
|
+
return ret;
|
1511
|
+
}
|
1512
|
+
};
|
1512
1513
|
|
1513
|
-
|
1514
|
-
|
1515
|
-
|
1516
|
-
|
1517
|
-
|
1518
|
-
|
1519
|
-
presenceSet = this.presenceSet,
|
1520
|
-
list = this.list;
|
1514
|
+
// Currently used only by Ember Data tests
|
1515
|
+
if (Ember.config.overrideAccessors) {
|
1516
|
+
Ember.get = get;
|
1517
|
+
Ember.config.overrideAccessors();
|
1518
|
+
get = Ember.get;
|
1519
|
+
}
|
1521
1520
|
|
1522
|
-
|
1521
|
+
function firstKey(path) {
|
1522
|
+
return path.match(FIRST_KEY)[0];
|
1523
|
+
}
|
1523
1524
|
|
1524
|
-
|
1525
|
-
|
1526
|
-
|
1527
|
-
|
1528
|
-
|
1525
|
+
// assumes path is already normalized
|
1526
|
+
function normalizeTuple(target, path) {
|
1527
|
+
var hasThis = HAS_THIS.test(path),
|
1528
|
+
isGlobal = !hasThis && IS_GLOBAL_PATH.test(path),
|
1529
|
+
key;
|
1529
1530
|
|
1530
|
-
|
1531
|
-
|
1532
|
-
@return {Boolean}
|
1533
|
-
*/
|
1534
|
-
isEmpty: function() {
|
1535
|
-
return this.list.length === 0;
|
1536
|
-
},
|
1531
|
+
if (!target || isGlobal) target = Ember.lookup;
|
1532
|
+
if (hasThis) path = path.slice(5);
|
1537
1533
|
|
1538
|
-
|
1539
|
-
|
1540
|
-
|
1541
|
-
|
1542
|
-
|
1543
|
-
has: function(obj) {
|
1544
|
-
var guid = guidFor(obj),
|
1545
|
-
presenceSet = this.presenceSet;
|
1534
|
+
if (target === Ember.lookup) {
|
1535
|
+
key = firstKey(path);
|
1536
|
+
target = get(target, key);
|
1537
|
+
path = path.slice(key.length+1);
|
1538
|
+
}
|
1546
1539
|
|
1547
|
-
|
1548
|
-
|
1540
|
+
// must return some kind of path to be valid else other things will break.
|
1541
|
+
if (!path || path.length===0) throw new Error('Invalid Path');
|
1549
1542
|
|
1550
|
-
|
1551
|
-
|
1552
|
-
@param {Function} fn
|
1553
|
-
@param self
|
1554
|
-
*/
|
1555
|
-
forEach: function(fn, self) {
|
1556
|
-
// allow mutation during iteration
|
1557
|
-
var list = this.toArray();
|
1543
|
+
return [ target, path ];
|
1544
|
+
}
|
1558
1545
|
|
1559
|
-
|
1560
|
-
|
1561
|
-
}
|
1562
|
-
},
|
1546
|
+
var getPath = Ember._getPath = function(root, path) {
|
1547
|
+
var hasThis, parts, tuple, idx, len;
|
1563
1548
|
|
1564
|
-
|
1565
|
-
|
1566
|
-
|
1567
|
-
|
1568
|
-
toArray: function() {
|
1569
|
-
return this.list.slice();
|
1570
|
-
},
|
1549
|
+
// If there is no root and path is a key name, return that
|
1550
|
+
// property from the global object.
|
1551
|
+
// E.g. get('Ember') -> Ember
|
1552
|
+
if (root === null && path.indexOf('.') === -1) { return get(Ember.lookup, path); }
|
1571
1553
|
|
1572
|
-
|
1573
|
-
|
1574
|
-
@return {Ember.OrderedSet}
|
1575
|
-
*/
|
1576
|
-
copy: function() {
|
1577
|
-
var set = new OrderedSet();
|
1554
|
+
// detect complicated paths and normalize them
|
1555
|
+
hasThis = HAS_THIS.test(path);
|
1578
1556
|
|
1579
|
-
|
1580
|
-
|
1557
|
+
if (!root || hasThis) {
|
1558
|
+
tuple = normalizeTuple(root, path);
|
1559
|
+
root = tuple[0];
|
1560
|
+
path = tuple[1];
|
1561
|
+
tuple.length = 0;
|
1562
|
+
}
|
1581
1563
|
|
1582
|
-
|
1564
|
+
parts = path.split(".");
|
1565
|
+
len = parts.length;
|
1566
|
+
for (idx = 0; root != null && idx < len; idx++) {
|
1567
|
+
root = get(root, parts[idx], true);
|
1568
|
+
if (root && root.isDestroyed) { return undefined; }
|
1583
1569
|
}
|
1570
|
+
return root;
|
1584
1571
|
};
|
1585
1572
|
|
1586
1573
|
/**
|
1587
|
-
|
1588
|
-
default Objects, the keys of a Map can be any JavaScript
|
1589
|
-
object.
|
1574
|
+
@private
|
1590
1575
|
|
1591
|
-
|
1576
|
+
Normalizes a target/path pair to reflect that actual target/path that should
|
1577
|
+
be observed, etc. This takes into account passing in global property
|
1578
|
+
paths (i.e. a path beginning with a captial letter not defined on the
|
1579
|
+
target) and * separators.
|
1592
1580
|
|
1593
|
-
|
1594
|
-
|
1595
|
-
|
1596
|
-
|
1597
|
-
|
1598
|
-
replace an entry in `values`. When an entry is deleted,
|
1599
|
-
we delete its entry in `keys` and `values`.
|
1600
|
-
|
1601
|
-
@class Map
|
1602
|
-
@namespace Ember
|
1603
|
-
@private
|
1604
|
-
@constructor
|
1605
|
-
*/
|
1606
|
-
var Map = Ember.Map = function() {
|
1607
|
-
this.keys = Ember.OrderedSet.create();
|
1608
|
-
this.values = {};
|
1609
|
-
};
|
1610
|
-
|
1611
|
-
/**
|
1612
|
-
@method create
|
1613
|
-
@static
|
1581
|
+
@method normalizeTuple
|
1582
|
+
@for Ember
|
1583
|
+
@param {Object} target The current target. May be `null`.
|
1584
|
+
@param {String} path A path on the target or a global property path.
|
1585
|
+
@return {Array} a temporary array with the normalized target/path pair.
|
1614
1586
|
*/
|
1615
|
-
|
1616
|
-
return
|
1587
|
+
Ember.normalizeTuple = function(target, path) {
|
1588
|
+
return normalizeTuple(target, path);
|
1617
1589
|
};
|
1618
1590
|
|
1619
|
-
|
1620
|
-
|
1621
|
-
Retrieve the value associated with a given key.
|
1591
|
+
Ember.getWithDefault = function(root, key, defaultValue) {
|
1592
|
+
var value = get(root, key);
|
1622
1593
|
|
1623
|
-
|
1624
|
-
|
1625
|
-
|
1626
|
-
*/
|
1627
|
-
get: function(key) {
|
1628
|
-
var values = this.values,
|
1629
|
-
guid = guidFor(key);
|
1594
|
+
if (value === undefined) { return defaultValue; }
|
1595
|
+
return value;
|
1596
|
+
};
|
1630
1597
|
|
1631
|
-
return values[guid];
|
1632
|
-
},
|
1633
1598
|
|
1634
|
-
|
1635
|
-
|
1636
|
-
provided, the new value will replace the old value.
|
1599
|
+
Ember.get = get;
|
1600
|
+
Ember.getPath = Ember.deprecateFunc('getPath is deprecated since get now supports paths', Ember.get);
|
1637
1601
|
|
1638
|
-
|
1639
|
-
@param {*} key
|
1640
|
-
@param {*} value
|
1641
|
-
*/
|
1642
|
-
set: function(key, value) {
|
1643
|
-
var keys = this.keys,
|
1644
|
-
values = this.values,
|
1645
|
-
guid = guidFor(key);
|
1602
|
+
})();
|
1646
1603
|
|
1647
|
-
keys.add(key);
|
1648
|
-
values[guid] = value;
|
1649
|
-
},
|
1650
1604
|
|
1651
|
-
/**
|
1652
|
-
Removes a value from the map for an associated key.
|
1653
1605
|
|
1654
|
-
|
1655
|
-
|
1656
|
-
|
1657
|
-
|
1658
|
-
remove: function(key) {
|
1659
|
-
// don't use ES6 "delete" because it will be annoying
|
1660
|
-
// to use in browsers that are not ES6 friendly;
|
1661
|
-
var keys = this.keys,
|
1662
|
-
values = this.values,
|
1663
|
-
guid = guidFor(key);
|
1606
|
+
(function() {
|
1607
|
+
/**
|
1608
|
+
@module ember-metal
|
1609
|
+
*/
|
1664
1610
|
|
1665
|
-
|
1666
|
-
|
1667
|
-
|
1668
|
-
|
1669
|
-
|
1670
|
-
return false;
|
1671
|
-
}
|
1672
|
-
},
|
1611
|
+
var o_create = Ember.create,
|
1612
|
+
metaFor = Ember.meta,
|
1613
|
+
META_KEY = Ember.META_KEY,
|
1614
|
+
/* listener flags */
|
1615
|
+
ONCE = 1, SUSPENDED = 2;
|
1673
1616
|
|
1674
|
-
|
1675
|
-
|
1617
|
+
/*
|
1618
|
+
The event system uses a series of nested hashes to store listeners on an
|
1619
|
+
object. When a listener is registered, or when an event arrives, these
|
1620
|
+
hashes are consulted to determine which target and action pair to invoke.
|
1676
1621
|
|
1677
|
-
|
1678
|
-
@param {*} key
|
1679
|
-
@return {Boolean} true if the item was present, false otherwise
|
1680
|
-
*/
|
1681
|
-
has: function(key) {
|
1682
|
-
var values = this.values,
|
1683
|
-
guid = guidFor(key);
|
1622
|
+
The hashes are stored in the object's meta hash, and look like this:
|
1684
1623
|
|
1685
|
-
|
1686
|
-
|
1624
|
+
// Object's meta hash
|
1625
|
+
{
|
1626
|
+
listeners: { // variable name: `listenerSet`
|
1627
|
+
"foo:changed": [ // variable name: `actions`
|
1628
|
+
[target, method, flags]
|
1629
|
+
]
|
1630
|
+
}
|
1631
|
+
}
|
1687
1632
|
|
1688
|
-
|
1689
|
-
Iterate over all the keys and values. Calls the function once
|
1690
|
-
for each key, passing in the key and value, in that order.
|
1633
|
+
*/
|
1691
1634
|
|
1692
|
-
|
1635
|
+
function indexOf(array, target, method) {
|
1636
|
+
var index = -1;
|
1637
|
+
for (var i = 0, l = array.length; i < l; i++) {
|
1638
|
+
if (target === array[i][0] && method === array[i][1]) { index = i; break; }
|
1639
|
+
}
|
1640
|
+
return index;
|
1641
|
+
}
|
1693
1642
|
|
1694
|
-
|
1695
|
-
|
1696
|
-
|
1697
|
-
callback. By default, `this` is the map.
|
1698
|
-
*/
|
1699
|
-
forEach: function(callback, self) {
|
1700
|
-
var keys = this.keys,
|
1701
|
-
values = this.values;
|
1643
|
+
function actionsFor(obj, eventName) {
|
1644
|
+
var meta = metaFor(obj, true),
|
1645
|
+
actions;
|
1702
1646
|
|
1703
|
-
|
1704
|
-
var guid = guidFor(key);
|
1705
|
-
callback.call(self, key, values[guid]);
|
1706
|
-
});
|
1707
|
-
},
|
1647
|
+
if (!meta.listeners) { meta.listeners = {}; }
|
1708
1648
|
|
1709
|
-
|
1710
|
-
|
1711
|
-
|
1712
|
-
*/
|
1713
|
-
copy: function() {
|
1714
|
-
return copyMap(this, new Map());
|
1649
|
+
if (!meta.hasOwnProperty('listeners')) {
|
1650
|
+
// setup inherited copy of the listeners object
|
1651
|
+
meta.listeners = o_create(meta.listeners);
|
1715
1652
|
}
|
1716
|
-
};
|
1717
1653
|
|
1718
|
-
|
1719
|
-
@class MapWithDefault
|
1720
|
-
@namespace Ember
|
1721
|
-
@extends Ember.Map
|
1722
|
-
@private
|
1723
|
-
@constructor
|
1724
|
-
@param [options]
|
1725
|
-
@param {*} [options.defaultValue]
|
1726
|
-
*/
|
1727
|
-
var MapWithDefault = Ember.MapWithDefault = function(options) {
|
1728
|
-
Map.call(this);
|
1729
|
-
this.defaultValue = options.defaultValue;
|
1730
|
-
};
|
1654
|
+
actions = meta.listeners[eventName];
|
1731
1655
|
|
1732
|
-
|
1733
|
-
|
1734
|
-
|
1735
|
-
|
1736
|
-
|
1737
|
-
@return {Ember.MapWithDefault|Ember.Map} If options are passed, returns
|
1738
|
-
`Ember.MapWithDefault` otherwise returns `Ember.Map`
|
1739
|
-
*/
|
1740
|
-
MapWithDefault.create = function(options) {
|
1741
|
-
if (options) {
|
1742
|
-
return new MapWithDefault(options);
|
1743
|
-
} else {
|
1744
|
-
return new Map();
|
1656
|
+
// if there are actions, but the eventName doesn't exist in our listeners, then copy them from the prototype
|
1657
|
+
if (actions && !meta.listeners.hasOwnProperty(eventName)) {
|
1658
|
+
actions = meta.listeners[eventName] = meta.listeners[eventName].slice();
|
1659
|
+
} else if (!actions) {
|
1660
|
+
actions = meta.listeners[eventName] = [];
|
1745
1661
|
}
|
1746
|
-
};
|
1747
1662
|
|
1748
|
-
|
1663
|
+
return actions;
|
1664
|
+
}
|
1749
1665
|
|
1750
|
-
|
1751
|
-
|
1666
|
+
function actionsUnion(obj, eventName, otherActions) {
|
1667
|
+
var meta = obj[META_KEY],
|
1668
|
+
actions = meta && meta.listeners && meta.listeners[eventName];
|
1752
1669
|
|
1753
|
-
|
1754
|
-
|
1755
|
-
|
1756
|
-
|
1757
|
-
|
1758
|
-
|
1670
|
+
if (!actions) { return; }
|
1671
|
+
for (var i = actions.length - 1; i >= 0; i--) {
|
1672
|
+
var target = actions[i][0],
|
1673
|
+
method = actions[i][1],
|
1674
|
+
flags = actions[i][2],
|
1675
|
+
actionIndex = indexOf(otherActions, target, method);
|
1759
1676
|
|
1760
|
-
|
1761
|
-
|
1762
|
-
|
1763
|
-
var defaultValue = this.defaultValue(key);
|
1764
|
-
this.set(key, defaultValue);
|
1765
|
-
return defaultValue;
|
1677
|
+
if (actionIndex === -1) {
|
1678
|
+
otherActions.push([target, method, flags]);
|
1679
|
+
}
|
1766
1680
|
}
|
1767
|
-
}
|
1681
|
+
}
|
1768
1682
|
|
1769
|
-
|
1770
|
-
|
1771
|
-
|
1772
|
-
|
1773
|
-
MapWithDefault.prototype.copy = function() {
|
1774
|
-
return copyMap(this, new MapWithDefault({
|
1775
|
-
defaultValue: this.defaultValue
|
1776
|
-
}));
|
1777
|
-
};
|
1683
|
+
function actionsDiff(obj, eventName, otherActions) {
|
1684
|
+
var meta = obj[META_KEY],
|
1685
|
+
actions = meta && meta.listeners && meta.listeners[eventName],
|
1686
|
+
diffActions = [];
|
1778
1687
|
|
1779
|
-
|
1688
|
+
if (!actions) { return; }
|
1689
|
+
for (var i = actions.length - 1; i >= 0; i--) {
|
1690
|
+
var target = actions[i][0],
|
1691
|
+
method = actions[i][1],
|
1692
|
+
flags = actions[i][2],
|
1693
|
+
actionIndex = indexOf(otherActions, target, method);
|
1780
1694
|
|
1695
|
+
if (actionIndex !== -1) { continue; }
|
1781
1696
|
|
1697
|
+
otherActions.push([target, method, flags]);
|
1698
|
+
diffActions.push([target, method, flags]);
|
1699
|
+
}
|
1700
|
+
|
1701
|
+
return diffActions;
|
1702
|
+
}
|
1782
1703
|
|
1783
|
-
(function() {
|
1784
1704
|
/**
|
1785
|
-
|
1705
|
+
Add an event listener
|
1706
|
+
|
1707
|
+
@method addListener
|
1708
|
+
@for Ember
|
1709
|
+
@param obj
|
1710
|
+
@param {String} eventName
|
1711
|
+
@param {Object|Function} targetOrMethod A target object or a function
|
1712
|
+
@param {Function|String} method A function or the name of a function to be called on `target`
|
1713
|
+
@param {Boolean} once A flag whether a function should only be called once
|
1786
1714
|
*/
|
1715
|
+
function addListener(obj, eventName, target, method, once) {
|
1787
1716
|
|
1788
|
-
var META_KEY = Ember.META_KEY, get;
|
1789
1717
|
|
1790
|
-
|
1718
|
+
if (!method && 'function' === typeof target) {
|
1719
|
+
method = target;
|
1720
|
+
target = null;
|
1721
|
+
}
|
1791
1722
|
|
1792
|
-
var
|
1793
|
-
|
1794
|
-
|
1723
|
+
var actions = actionsFor(obj, eventName),
|
1724
|
+
actionIndex = indexOf(actions, target, method),
|
1725
|
+
flags = 0;
|
1795
1726
|
|
1796
|
-
|
1797
|
-
// GET AND SET
|
1798
|
-
//
|
1799
|
-
// If we are on a platform that supports accessors we can use those.
|
1800
|
-
// Otherwise simulate accessors by looking up the property directly on the
|
1801
|
-
// object.
|
1727
|
+
if (once) flags |= ONCE;
|
1802
1728
|
|
1803
|
-
|
1804
|
-
Gets the value of a property on an object. If the property is computed,
|
1805
|
-
the function will be invoked. If the property is not defined but the
|
1806
|
-
object implements the `unknownProperty` method then that will be invoked.
|
1729
|
+
if (actionIndex !== -1) { return; }
|
1807
1730
|
|
1808
|
-
|
1809
|
-
method anytime you want to retrieve a property on an object that you don't
|
1810
|
-
know for sure is private. (Properties beginning with an underscore '_'
|
1811
|
-
are considered private.)
|
1731
|
+
actions.push([target, method, flags]);
|
1812
1732
|
|
1813
|
-
|
1814
|
-
|
1815
|
-
|
1816
|
-
|
1733
|
+
if ('function' === typeof obj.didAddListener) {
|
1734
|
+
obj.didAddListener(eventName, target, method);
|
1735
|
+
}
|
1736
|
+
}
|
1817
1737
|
|
1818
|
-
|
1819
|
-
an
|
1738
|
+
/**
|
1739
|
+
Remove an event listener
|
1820
1740
|
|
1821
|
-
|
1741
|
+
Arguments should match those passed to `Ember.addListener`.
|
1742
|
+
|
1743
|
+
@method removeListener
|
1822
1744
|
@for Ember
|
1823
|
-
@param
|
1824
|
-
@param {String}
|
1825
|
-
@
|
1745
|
+
@param obj
|
1746
|
+
@param {String} eventName
|
1747
|
+
@param {Object|Function} targetOrMethod A target object or a function
|
1748
|
+
@param {Function|String} method A function or the name of a function to be called on `target`
|
1826
1749
|
*/
|
1827
|
-
|
1828
|
-
// Helpers that operate with 'this' within an #each
|
1829
|
-
if (keyName === '') {
|
1830
|
-
return obj;
|
1831
|
-
}
|
1750
|
+
function removeListener(obj, eventName, target, method) {
|
1832
1751
|
|
1833
|
-
|
1834
|
-
|
1835
|
-
|
1752
|
+
|
1753
|
+
if (!method && 'function' === typeof target) {
|
1754
|
+
method = target;
|
1755
|
+
target = null;
|
1836
1756
|
}
|
1837
1757
|
|
1838
|
-
|
1758
|
+
function _removeListener(target, method) {
|
1759
|
+
var actions = actionsFor(obj, eventName),
|
1760
|
+
actionIndex = indexOf(actions, target, method);
|
1839
1761
|
|
1840
|
-
|
1841
|
-
|
1762
|
+
// action doesn't exist, give up silently
|
1763
|
+
if (actionIndex === -1) { return; }
|
1842
1764
|
|
1765
|
+
actions.splice(actionIndex, 1);
|
1843
1766
|
|
1844
|
-
|
1845
|
-
|
1846
|
-
return desc.get(obj, keyName);
|
1847
|
-
} else {
|
1848
|
-
if (MANDATORY_SETTER && meta && meta.watching[keyName] > 0) {
|
1849
|
-
ret = meta.values[keyName];
|
1850
|
-
} else {
|
1851
|
-
ret = obj[keyName];
|
1767
|
+
if ('function' === typeof obj.didRemoveListener) {
|
1768
|
+
obj.didRemoveListener(eventName, target, method);
|
1852
1769
|
}
|
1770
|
+
}
|
1853
1771
|
|
1854
|
-
|
1855
|
-
|
1856
|
-
|
1857
|
-
|
1772
|
+
if (method) {
|
1773
|
+
_removeListener(target, method);
|
1774
|
+
} else {
|
1775
|
+
var meta = obj[META_KEY],
|
1776
|
+
actions = meta && meta.listeners && meta.listeners[eventName];
|
1858
1777
|
|
1859
|
-
return
|
1778
|
+
if (!actions) { return; }
|
1779
|
+
for (var i = actions.length - 1; i >= 0; i--) {
|
1780
|
+
_removeListener(actions[i][0], actions[i][1]);
|
1781
|
+
}
|
1860
1782
|
}
|
1861
|
-
};
|
1862
|
-
|
1863
|
-
// Currently used only by Ember Data tests
|
1864
|
-
if (Ember.config.overrideAccessors) {
|
1865
|
-
Ember.get = get;
|
1866
|
-
Ember.config.overrideAccessors();
|
1867
|
-
get = Ember.get;
|
1868
1783
|
}
|
1869
1784
|
|
1870
|
-
|
1871
|
-
|
1872
|
-
}
|
1785
|
+
/**
|
1786
|
+
@private
|
1873
1787
|
|
1874
|
-
|
1875
|
-
function normalizeTuple(target, path) {
|
1876
|
-
var hasThis = HAS_THIS.test(path),
|
1877
|
-
isGlobal = !hasThis && IS_GLOBAL_PATH.test(path),
|
1878
|
-
key;
|
1788
|
+
Suspend listener during callback.
|
1879
1789
|
|
1880
|
-
|
1881
|
-
|
1790
|
+
This should only be used by the target of the event listener
|
1791
|
+
when it is taking an action that would cause the event, e.g.
|
1792
|
+
an object might suspend its property change listener while it is
|
1793
|
+
setting that property.
|
1882
1794
|
|
1883
|
-
|
1884
|
-
|
1885
|
-
|
1886
|
-
|
1795
|
+
@method suspendListener
|
1796
|
+
@for Ember
|
1797
|
+
@param obj
|
1798
|
+
@param {String} eventName
|
1799
|
+
@param {Object|Function} targetOrMethod A target object or a function
|
1800
|
+
@param {Function|String} method A function or the name of a function to be called on `target`
|
1801
|
+
@param {Function} callback
|
1802
|
+
*/
|
1803
|
+
function suspendListener(obj, eventName, target, method, callback) {
|
1804
|
+
if (!method && 'function' === typeof target) {
|
1805
|
+
method = target;
|
1806
|
+
target = null;
|
1887
1807
|
}
|
1888
1808
|
|
1889
|
-
|
1890
|
-
|
1891
|
-
|
1892
|
-
return [ target, path ];
|
1893
|
-
}
|
1894
|
-
|
1895
|
-
var getPath = Ember._getPath = function(root, path) {
|
1896
|
-
var hasThis, parts, tuple, idx, len;
|
1897
|
-
|
1898
|
-
// If there is no root and path is a key name, return that
|
1899
|
-
// property from the global object.
|
1900
|
-
// E.g. get('Ember') -> Ember
|
1901
|
-
if (root === null && path.indexOf('.') === -1) { return get(Ember.lookup, path); }
|
1902
|
-
|
1903
|
-
// detect complicated paths and normalize them
|
1904
|
-
hasThis = HAS_THIS.test(path);
|
1809
|
+
var actions = actionsFor(obj, eventName),
|
1810
|
+
actionIndex = indexOf(actions, target, method),
|
1811
|
+
action;
|
1905
1812
|
|
1906
|
-
if (
|
1907
|
-
|
1908
|
-
|
1909
|
-
|
1910
|
-
tuple.length = 0;
|
1813
|
+
if (actionIndex !== -1) {
|
1814
|
+
action = actions[actionIndex].slice(); // copy it, otherwise we're modifying a shared object
|
1815
|
+
action[2] |= SUSPENDED; // mark the action as suspended
|
1816
|
+
actions[actionIndex] = action; // replace the shared object with our copy
|
1911
1817
|
}
|
1912
1818
|
|
1913
|
-
|
1914
|
-
|
1915
|
-
|
1916
|
-
|
1917
|
-
|
1918
|
-
}
|
1919
|
-
return root;
|
1920
|
-
};
|
1819
|
+
function tryable() { return callback.call(target); }
|
1820
|
+
function finalizer() { if (action) { action[2] &= ~SUSPENDED; } }
|
1821
|
+
|
1822
|
+
return Ember.tryFinally(tryable, finalizer);
|
1823
|
+
}
|
1921
1824
|
|
1922
1825
|
/**
|
1923
1826
|
@private
|
1924
1827
|
|
1925
|
-
|
1926
|
-
be observed, etc. This takes into account passing in global property
|
1927
|
-
paths (i.e. a path beginning with a captial letter not defined on the
|
1928
|
-
target) and * separators.
|
1828
|
+
Suspend listener during callback.
|
1929
1829
|
|
1930
|
-
|
1830
|
+
This should only be used by the target of the event listener
|
1831
|
+
when it is taking an action that would cause the event, e.g.
|
1832
|
+
an object might suspend its property change listener while it is
|
1833
|
+
setting that property.
|
1834
|
+
|
1835
|
+
@method suspendListener
|
1931
1836
|
@for Ember
|
1932
|
-
@param
|
1933
|
-
@param {
|
1934
|
-
@
|
1837
|
+
@param obj
|
1838
|
+
@param {Array} eventName Array of event names
|
1839
|
+
@param {Object|Function} targetOrMethod A target object or a function
|
1840
|
+
@param {Function|String} method A function or the name of a function to be called on `target`
|
1841
|
+
@param {Function} callback
|
1935
1842
|
*/
|
1936
|
-
|
1937
|
-
|
1938
|
-
|
1843
|
+
function suspendListeners(obj, eventNames, target, method, callback) {
|
1844
|
+
if (!method && 'function' === typeof target) {
|
1845
|
+
method = target;
|
1846
|
+
target = null;
|
1847
|
+
}
|
1939
1848
|
|
1940
|
-
|
1941
|
-
|
1849
|
+
var suspendedActions = [],
|
1850
|
+
eventName, actions, action, i, l;
|
1942
1851
|
|
1943
|
-
|
1944
|
-
|
1945
|
-
|
1852
|
+
for (i=0, l=eventNames.length; i<l; i++) {
|
1853
|
+
eventName = eventNames[i];
|
1854
|
+
actions = actionsFor(obj, eventName);
|
1855
|
+
var actionIndex = indexOf(actions, target, method);
|
1946
1856
|
|
1857
|
+
if (actionIndex !== -1) {
|
1858
|
+
action = actions[actionIndex].slice();
|
1859
|
+
action[2] |= SUSPENDED;
|
1860
|
+
actions[actionIndex] = action;
|
1861
|
+
suspendedActions.push(action);
|
1862
|
+
}
|
1863
|
+
}
|
1947
1864
|
|
1948
|
-
|
1949
|
-
Ember.getPath = Ember.deprecateFunc('getPath is deprecated since get now supports paths', Ember.get);
|
1950
|
-
})();
|
1865
|
+
function tryable() { return callback.call(target); }
|
1951
1866
|
|
1867
|
+
function finalizer() {
|
1868
|
+
for (i = 0, l = suspendedActions.length; i < l; i++) {
|
1869
|
+
suspendedActions[i][2] &= ~SUSPENDED;
|
1870
|
+
}
|
1871
|
+
}
|
1952
1872
|
|
1873
|
+
return Ember.tryFinally(tryable, finalizer);
|
1874
|
+
}
|
1953
1875
|
|
1954
|
-
(function() {
|
1955
1876
|
/**
|
1956
|
-
@
|
1957
|
-
*/
|
1958
|
-
|
1959
|
-
var o_create = Ember.create,
|
1960
|
-
metaFor = Ember.meta,
|
1961
|
-
META_KEY = Ember.META_KEY;
|
1962
|
-
|
1963
|
-
/*
|
1964
|
-
The event system uses a series of nested hashes to store listeners on an
|
1965
|
-
object. When a listener is registered, or when an event arrives, these
|
1966
|
-
hashes are consulted to determine which target and action pair to invoke.
|
1967
|
-
|
1968
|
-
The hashes are stored in the object's meta hash, and look like this:
|
1877
|
+
@private
|
1969
1878
|
|
1970
|
-
|
1971
|
-
{
|
1972
|
-
listeners: { // variable name: `listenerSet`
|
1973
|
-
"foo:changed": [ // variable name: `actions`
|
1974
|
-
[target, method, onceFlag, suspendedFlag]
|
1975
|
-
]
|
1976
|
-
}
|
1977
|
-
}
|
1879
|
+
Return a list of currently watched events
|
1978
1880
|
|
1881
|
+
@method watchedEvents
|
1882
|
+
@for Ember
|
1883
|
+
@param obj
|
1979
1884
|
*/
|
1885
|
+
function watchedEvents(obj) {
|
1886
|
+
var listeners = obj[META_KEY].listeners, ret = [];
|
1980
1887
|
|
1981
|
-
|
1982
|
-
|
1983
|
-
|
1984
|
-
|
1985
|
-
}
|
1986
|
-
return index;
|
1987
|
-
}
|
1988
|
-
|
1989
|
-
function actionsFor(obj, eventName) {
|
1990
|
-
var meta = metaFor(obj, true),
|
1991
|
-
actions;
|
1992
|
-
|
1993
|
-
if (!meta.listeners) { meta.listeners = {}; }
|
1994
|
-
|
1995
|
-
if (!meta.hasOwnProperty('listeners')) {
|
1996
|
-
// setup inherited copy of the listeners object
|
1997
|
-
meta.listeners = o_create(meta.listeners);
|
1998
|
-
}
|
1999
|
-
|
2000
|
-
actions = meta.listeners[eventName];
|
2001
|
-
|
2002
|
-
// if there are actions, but the eventName doesn't exist in our listeners, then copy them from the prototype
|
2003
|
-
if (actions && !meta.listeners.hasOwnProperty(eventName)) {
|
2004
|
-
actions = meta.listeners[eventName] = meta.listeners[eventName].slice();
|
2005
|
-
} else if (!actions) {
|
2006
|
-
actions = meta.listeners[eventName] = [];
|
2007
|
-
}
|
2008
|
-
|
2009
|
-
return actions;
|
2010
|
-
}
|
2011
|
-
|
2012
|
-
function actionsUnion(obj, eventName, otherActions) {
|
2013
|
-
var meta = obj[META_KEY],
|
2014
|
-
actions = meta && meta.listeners && meta.listeners[eventName];
|
2015
|
-
|
2016
|
-
if (!actions) { return; }
|
2017
|
-
for (var i = actions.length - 1; i >= 0; i--) {
|
2018
|
-
var target = actions[i][0],
|
2019
|
-
method = actions[i][1],
|
2020
|
-
once = actions[i][2],
|
2021
|
-
suspended = actions[i][3],
|
2022
|
-
actionIndex = indexOf(otherActions, target, method);
|
2023
|
-
|
2024
|
-
if (actionIndex === -1) {
|
2025
|
-
otherActions.push([target, method, once, suspended]);
|
2026
|
-
}
|
2027
|
-
}
|
2028
|
-
}
|
2029
|
-
|
2030
|
-
function actionsDiff(obj, eventName, otherActions) {
|
2031
|
-
var meta = obj[META_KEY],
|
2032
|
-
actions = meta && meta.listeners && meta.listeners[eventName],
|
2033
|
-
diffActions = [];
|
2034
|
-
|
2035
|
-
if (!actions) { return; }
|
2036
|
-
for (var i = actions.length - 1; i >= 0; i--) {
|
2037
|
-
var target = actions[i][0],
|
2038
|
-
method = actions[i][1],
|
2039
|
-
once = actions[i][2],
|
2040
|
-
suspended = actions[i][3],
|
2041
|
-
actionIndex = indexOf(otherActions, target, method);
|
2042
|
-
|
2043
|
-
if (actionIndex !== -1) { continue; }
|
2044
|
-
|
2045
|
-
otherActions.push([target, method, once, suspended]);
|
2046
|
-
diffActions.push([target, method, once, suspended]);
|
2047
|
-
}
|
2048
|
-
|
2049
|
-
return diffActions;
|
2050
|
-
}
|
2051
|
-
|
2052
|
-
/**
|
2053
|
-
Add an event listener
|
2054
|
-
|
2055
|
-
@method addListener
|
2056
|
-
@for Ember
|
2057
|
-
@param obj
|
2058
|
-
@param {String} eventName
|
2059
|
-
@param {Object|Function} targetOrMethod A target object or a function
|
2060
|
-
@param {Function|String} method A function or the name of a function to be called on `target`
|
2061
|
-
@param {Boolean} once A flag whether a function should only be called once
|
2062
|
-
*/
|
2063
|
-
function addListener(obj, eventName, target, method, once) {
|
2064
|
-
|
2065
|
-
|
2066
|
-
if (!method && 'function' === typeof target) {
|
2067
|
-
method = target;
|
2068
|
-
target = null;
|
2069
|
-
}
|
2070
|
-
|
2071
|
-
var actions = actionsFor(obj, eventName),
|
2072
|
-
actionIndex = indexOf(actions, target, method);
|
2073
|
-
|
2074
|
-
if (actionIndex !== -1) { return; }
|
2075
|
-
|
2076
|
-
actions.push([target, method, once, undefined]);
|
2077
|
-
|
2078
|
-
if ('function' === typeof obj.didAddListener) {
|
2079
|
-
obj.didAddListener(eventName, target, method);
|
2080
|
-
}
|
2081
|
-
}
|
2082
|
-
|
2083
|
-
/**
|
2084
|
-
Remove an event listener
|
2085
|
-
|
2086
|
-
Arguments should match those passed to {{#crossLink "Ember/addListener"}}{{/crossLink}}
|
2087
|
-
|
2088
|
-
@method removeListener
|
2089
|
-
@for Ember
|
2090
|
-
@param obj
|
2091
|
-
@param {String} eventName
|
2092
|
-
@param {Object|Function} targetOrMethod A target object or a function
|
2093
|
-
@param {Function|String} method A function or the name of a function to be called on `target`
|
2094
|
-
*/
|
2095
|
-
function removeListener(obj, eventName, target, method) {
|
2096
|
-
|
2097
|
-
|
2098
|
-
if (!method && 'function' === typeof target) {
|
2099
|
-
method = target;
|
2100
|
-
target = null;
|
2101
|
-
}
|
2102
|
-
|
2103
|
-
function _removeListener(target, method, once) {
|
2104
|
-
var actions = actionsFor(obj, eventName),
|
2105
|
-
actionIndex = indexOf(actions, target, method);
|
2106
|
-
|
2107
|
-
// action doesn't exist, give up silently
|
2108
|
-
if (actionIndex === -1) { return; }
|
2109
|
-
|
2110
|
-
actions.splice(actionIndex, 1);
|
2111
|
-
|
2112
|
-
if ('function' === typeof obj.didRemoveListener) {
|
2113
|
-
obj.didRemoveListener(eventName, target, method);
|
2114
|
-
}
|
2115
|
-
}
|
2116
|
-
|
2117
|
-
if (method) {
|
2118
|
-
_removeListener(target, method);
|
2119
|
-
} else {
|
2120
|
-
var meta = obj[META_KEY],
|
2121
|
-
actions = meta && meta.listeners && meta.listeners[eventName];
|
2122
|
-
|
2123
|
-
if (!actions) { return; }
|
2124
|
-
for (var i = actions.length - 1; i >= 0; i--) {
|
2125
|
-
_removeListener(actions[i][0], actions[i][1]);
|
2126
|
-
}
|
2127
|
-
}
|
2128
|
-
}
|
2129
|
-
|
2130
|
-
/**
|
2131
|
-
@private
|
2132
|
-
|
2133
|
-
Suspend listener during callback.
|
2134
|
-
|
2135
|
-
This should only be used by the target of the event listener
|
2136
|
-
when it is taking an action that would cause the event, e.g.
|
2137
|
-
an object might suspend its property change listener while it is
|
2138
|
-
setting that property.
|
2139
|
-
|
2140
|
-
@method suspendListener
|
2141
|
-
@for Ember
|
2142
|
-
@param obj
|
2143
|
-
@param {String} eventName
|
2144
|
-
@param {Object|Function} targetOrMethod A target object or a function
|
2145
|
-
@param {Function|String} method A function or the name of a function to be called on `target`
|
2146
|
-
@param {Function} callback
|
2147
|
-
*/
|
2148
|
-
function suspendListener(obj, eventName, target, method, callback) {
|
2149
|
-
if (!method && 'function' === typeof target) {
|
2150
|
-
method = target;
|
2151
|
-
target = null;
|
2152
|
-
}
|
2153
|
-
|
2154
|
-
var actions = actionsFor(obj, eventName),
|
2155
|
-
actionIndex = indexOf(actions, target, method),
|
2156
|
-
action;
|
2157
|
-
|
2158
|
-
if (actionIndex !== -1) {
|
2159
|
-
action = actions[actionIndex].slice(); // copy it, otherwise we're modifying a shared object
|
2160
|
-
action[3] = true; // mark the action as suspended
|
2161
|
-
actions[actionIndex] = action; // replace the shared object with our copy
|
2162
|
-
}
|
2163
|
-
|
2164
|
-
function tryable() { return callback.call(target); }
|
2165
|
-
function finalizer() { if (action) { action[3] = undefined; } }
|
2166
|
-
|
2167
|
-
return Ember.tryFinally(tryable, finalizer);
|
2168
|
-
}
|
2169
|
-
|
2170
|
-
/**
|
2171
|
-
@private
|
2172
|
-
|
2173
|
-
Suspend listener during callback.
|
2174
|
-
|
2175
|
-
This should only be used by the target of the event listener
|
2176
|
-
when it is taking an action that would cause the event, e.g.
|
2177
|
-
an object might suspend its property change listener while it is
|
2178
|
-
setting that property.
|
2179
|
-
|
2180
|
-
@method suspendListener
|
2181
|
-
@for Ember
|
2182
|
-
@param obj
|
2183
|
-
@param {Array} eventName Array of event names
|
2184
|
-
@param {Object|Function} targetOrMethod A target object or a function
|
2185
|
-
@param {Function|String} method A function or the name of a function to be called on `target`
|
2186
|
-
@param {Function} callback
|
2187
|
-
*/
|
2188
|
-
function suspendListeners(obj, eventNames, target, method, callback) {
|
2189
|
-
if (!method && 'function' === typeof target) {
|
2190
|
-
method = target;
|
2191
|
-
target = null;
|
2192
|
-
}
|
2193
|
-
|
2194
|
-
var suspendedActions = [],
|
2195
|
-
eventName, actions, action, i, l;
|
2196
|
-
|
2197
|
-
for (i=0, l=eventNames.length; i<l; i++) {
|
2198
|
-
eventName = eventNames[i];
|
2199
|
-
actions = actionsFor(obj, eventName);
|
2200
|
-
var actionIndex = indexOf(actions, target, method);
|
2201
|
-
|
2202
|
-
if (actionIndex !== -1) {
|
2203
|
-
action = actions[actionIndex].slice();
|
2204
|
-
action[3] = true;
|
2205
|
-
actions[actionIndex] = action;
|
2206
|
-
suspendedActions.push(action);
|
2207
|
-
}
|
2208
|
-
}
|
2209
|
-
|
2210
|
-
function tryable() { return callback.call(target); }
|
2211
|
-
|
2212
|
-
function finalizer() {
|
2213
|
-
for (i = 0, l = suspendedActions.length; i < l; i++) {
|
2214
|
-
suspendedActions[i][3] = undefined;
|
2215
|
-
}
|
2216
|
-
}
|
2217
|
-
|
2218
|
-
return Ember.tryFinally(tryable, finalizer);
|
2219
|
-
}
|
2220
|
-
|
2221
|
-
/**
|
2222
|
-
@private
|
2223
|
-
|
2224
|
-
Return a list of currently watched events
|
2225
|
-
|
2226
|
-
@method watchedEvents
|
2227
|
-
@for Ember
|
2228
|
-
@param obj
|
2229
|
-
*/
|
2230
|
-
function watchedEvents(obj) {
|
2231
|
-
var listeners = obj[META_KEY].listeners, ret = [];
|
2232
|
-
|
2233
|
-
if (listeners) {
|
2234
|
-
for(var eventName in listeners) {
|
2235
|
-
if (listeners[eventName]) { ret.push(eventName); }
|
2236
|
-
}
|
1888
|
+
if (listeners) {
|
1889
|
+
for(var eventName in listeners) {
|
1890
|
+
if (listeners[eventName]) { ret.push(eventName); }
|
1891
|
+
}
|
2237
1892
|
}
|
2238
1893
|
return ret;
|
2239
1894
|
}
|
@@ -2261,13 +1916,11 @@ function sendEvent(obj, eventName, params, actions) {
|
|
2261
1916
|
if (!actions) { return; }
|
2262
1917
|
|
2263
1918
|
for (var i = actions.length - 1; i >= 0; i--) { // looping in reverse for once listeners
|
2264
|
-
|
2265
|
-
|
2266
|
-
var target =
|
2267
|
-
|
2268
|
-
|
2269
|
-
|
2270
|
-
if (once) { removeListener(obj, eventName, target, method); }
|
1919
|
+
var action = actions[i];
|
1920
|
+
if (!action) { continue; }
|
1921
|
+
var target = action[0], method = action[1], flags = action[2];
|
1922
|
+
if (flags & SUSPENDED) { continue; }
|
1923
|
+
if (flags & ONCE) { removeListener(obj, eventName, target, method); }
|
2271
1924
|
if (!target) { target = obj; }
|
2272
1925
|
if ('string' === typeof method) { method = target[method]; }
|
2273
1926
|
if (params) {
|
@@ -2347,7 +2000,7 @@ var guidFor = Ember.guidFor,
|
|
2347
2000
|
keyName: keyName,
|
2348
2001
|
eventName: eventName,
|
2349
2002
|
listeners: [
|
2350
|
-
[target, method,
|
2003
|
+
[target, method, flags]
|
2351
2004
|
]
|
2352
2005
|
},
|
2353
2006
|
...
|
@@ -2576,11 +2229,11 @@ var endPropertyChanges = Ember.endPropertyChanges = function() {
|
|
2576
2229
|
});
|
2577
2230
|
```
|
2578
2231
|
|
2579
|
-
@method
|
2232
|
+
@method changeProperties
|
2580
2233
|
@param {Function} callback
|
2581
2234
|
@param [binding]
|
2582
2235
|
*/
|
2583
|
-
|
2236
|
+
Ember.changeProperties = function(cb, binding){
|
2584
2237
|
beginPropertyChanges();
|
2585
2238
|
tryFinally(cb, endPropertyChanges, binding);
|
2586
2239
|
};
|
@@ -2693,66 +2346,446 @@ var set = function set(obj, keyName, value, tolerant) {
|
|
2693
2346
|
Ember.propertyDidChange(obj, keyName);
|
2694
2347
|
}
|
2695
2348
|
} else {
|
2696
|
-
obj[keyName] = value;
|
2349
|
+
obj[keyName] = value;
|
2350
|
+
}
|
2351
|
+
}
|
2352
|
+
return value;
|
2353
|
+
};
|
2354
|
+
|
2355
|
+
// Currently used only by Ember Data tests
|
2356
|
+
if (Ember.config.overrideAccessors) {
|
2357
|
+
Ember.set = set;
|
2358
|
+
Ember.config.overrideAccessors();
|
2359
|
+
set = Ember.set;
|
2360
|
+
}
|
2361
|
+
|
2362
|
+
function setPath(root, path, value, tolerant) {
|
2363
|
+
var keyName;
|
2364
|
+
|
2365
|
+
// get the last part of the path
|
2366
|
+
keyName = path.slice(path.lastIndexOf('.') + 1);
|
2367
|
+
|
2368
|
+
// get the first part of the part
|
2369
|
+
path = path.slice(0, path.length-(keyName.length+1));
|
2370
|
+
|
2371
|
+
// unless the path is this, look up the first part to
|
2372
|
+
// get the root
|
2373
|
+
if (path !== 'this') {
|
2374
|
+
root = getPath(root, path);
|
2375
|
+
}
|
2376
|
+
|
2377
|
+
if (!keyName || keyName.length === 0) {
|
2378
|
+
throw new Error('You passed an empty path');
|
2379
|
+
}
|
2380
|
+
|
2381
|
+
if (!root) {
|
2382
|
+
if (tolerant) { return; }
|
2383
|
+
else { throw new Error('Object in path '+path+' could not be found or was destroyed.'); }
|
2384
|
+
}
|
2385
|
+
|
2386
|
+
return set(root, keyName, value);
|
2387
|
+
}
|
2388
|
+
|
2389
|
+
Ember.set = set;
|
2390
|
+
Ember.setPath = Ember.deprecateFunc('setPath is deprecated since set now supports paths', Ember.set);
|
2391
|
+
|
2392
|
+
/**
|
2393
|
+
Error-tolerant form of `Ember.set`. Will not blow up if any part of the
|
2394
|
+
chain is `undefined`, `null`, or destroyed.
|
2395
|
+
|
2396
|
+
This is primarily used when syncing bindings, which may try to update after
|
2397
|
+
an object has been destroyed.
|
2398
|
+
|
2399
|
+
@method trySet
|
2400
|
+
@for Ember
|
2401
|
+
@param {Object} obj The object to modify.
|
2402
|
+
@param {String} path The property path to set
|
2403
|
+
@param {Object} value The value to set
|
2404
|
+
*/
|
2405
|
+
Ember.trySet = function(root, path, value) {
|
2406
|
+
return set(root, path, value, true);
|
2407
|
+
};
|
2408
|
+
Ember.trySetPath = Ember.deprecateFunc('trySetPath has been renamed to trySet', Ember.trySet);
|
2409
|
+
|
2410
|
+
})();
|
2411
|
+
|
2412
|
+
|
2413
|
+
|
2414
|
+
(function() {
|
2415
|
+
/**
|
2416
|
+
@module ember-metal
|
2417
|
+
*/
|
2418
|
+
|
2419
|
+
/*
|
2420
|
+
JavaScript (before ES6) does not have a Map implementation. Objects,
|
2421
|
+
which are often used as dictionaries, may only have Strings as keys.
|
2422
|
+
|
2423
|
+
Because Ember has a way to get a unique identifier for every object
|
2424
|
+
via `Ember.guidFor`, we can implement a performant Map with arbitrary
|
2425
|
+
keys. Because it is commonly used in low-level bookkeeping, Map is
|
2426
|
+
implemented as a pure JavaScript object for performance.
|
2427
|
+
|
2428
|
+
This implementation follows the current iteration of the ES6 proposal for
|
2429
|
+
maps (http://wiki.ecmascript.org/doku.php?id=harmony:simple_maps_and_sets),
|
2430
|
+
with two exceptions. First, because we need our implementation to be pleasant
|
2431
|
+
on older browsers, we do not use the `delete` name (using `remove` instead).
|
2432
|
+
Second, as we do not have the luxury of in-VM iteration, we implement a
|
2433
|
+
forEach method for iteration.
|
2434
|
+
|
2435
|
+
Map is mocked out to look like an Ember object, so you can do
|
2436
|
+
`Ember.Map.create()` for symmetry with other Ember classes.
|
2437
|
+
*/
|
2438
|
+
var get = Ember.get,
|
2439
|
+
set = Ember.set,
|
2440
|
+
guidFor = Ember.guidFor,
|
2441
|
+
indexOf = Ember.ArrayPolyfills.indexOf;
|
2442
|
+
|
2443
|
+
var copy = function(obj) {
|
2444
|
+
var output = {};
|
2445
|
+
|
2446
|
+
for (var prop in obj) {
|
2447
|
+
if (obj.hasOwnProperty(prop)) { output[prop] = obj[prop]; }
|
2448
|
+
}
|
2449
|
+
|
2450
|
+
return output;
|
2451
|
+
};
|
2452
|
+
|
2453
|
+
var copyMap = function(original, newObject) {
|
2454
|
+
var keys = original.keys.copy(),
|
2455
|
+
values = copy(original.values);
|
2456
|
+
|
2457
|
+
newObject.keys = keys;
|
2458
|
+
newObject.values = values;
|
2459
|
+
newObject.length = original.length;
|
2460
|
+
|
2461
|
+
return newObject;
|
2462
|
+
};
|
2463
|
+
|
2464
|
+
/**
|
2465
|
+
This class is used internally by Ember and Ember Data.
|
2466
|
+
Please do not use it at this time. We plan to clean it up
|
2467
|
+
and add many tests soon.
|
2468
|
+
|
2469
|
+
@class OrderedSet
|
2470
|
+
@namespace Ember
|
2471
|
+
@constructor
|
2472
|
+
@private
|
2473
|
+
*/
|
2474
|
+
var OrderedSet = Ember.OrderedSet = function() {
|
2475
|
+
this.clear();
|
2476
|
+
};
|
2477
|
+
|
2478
|
+
/**
|
2479
|
+
@method create
|
2480
|
+
@static
|
2481
|
+
@return {Ember.OrderedSet}
|
2482
|
+
*/
|
2483
|
+
OrderedSet.create = function() {
|
2484
|
+
return new OrderedSet();
|
2485
|
+
};
|
2486
|
+
|
2487
|
+
|
2488
|
+
OrderedSet.prototype = {
|
2489
|
+
/**
|
2490
|
+
@method clear
|
2491
|
+
*/
|
2492
|
+
clear: function() {
|
2493
|
+
this.presenceSet = {};
|
2494
|
+
this.list = [];
|
2495
|
+
},
|
2496
|
+
|
2497
|
+
/**
|
2498
|
+
@method add
|
2499
|
+
@param obj
|
2500
|
+
*/
|
2501
|
+
add: function(obj) {
|
2502
|
+
var guid = guidFor(obj),
|
2503
|
+
presenceSet = this.presenceSet,
|
2504
|
+
list = this.list;
|
2505
|
+
|
2506
|
+
if (guid in presenceSet) { return; }
|
2507
|
+
|
2508
|
+
presenceSet[guid] = true;
|
2509
|
+
list.push(obj);
|
2510
|
+
},
|
2511
|
+
|
2512
|
+
/**
|
2513
|
+
@method remove
|
2514
|
+
@param obj
|
2515
|
+
*/
|
2516
|
+
remove: function(obj) {
|
2517
|
+
var guid = guidFor(obj),
|
2518
|
+
presenceSet = this.presenceSet,
|
2519
|
+
list = this.list;
|
2520
|
+
|
2521
|
+
delete presenceSet[guid];
|
2522
|
+
|
2523
|
+
var index = indexOf.call(list, obj);
|
2524
|
+
if (index > -1) {
|
2525
|
+
list.splice(index, 1);
|
2526
|
+
}
|
2527
|
+
},
|
2528
|
+
|
2529
|
+
/**
|
2530
|
+
@method isEmpty
|
2531
|
+
@return {Boolean}
|
2532
|
+
*/
|
2533
|
+
isEmpty: function() {
|
2534
|
+
return this.list.length === 0;
|
2535
|
+
},
|
2536
|
+
|
2537
|
+
/**
|
2538
|
+
@method has
|
2539
|
+
@param obj
|
2540
|
+
@return {Boolean}
|
2541
|
+
*/
|
2542
|
+
has: function(obj) {
|
2543
|
+
var guid = guidFor(obj),
|
2544
|
+
presenceSet = this.presenceSet;
|
2545
|
+
|
2546
|
+
return guid in presenceSet;
|
2547
|
+
},
|
2548
|
+
|
2549
|
+
/**
|
2550
|
+
@method forEach
|
2551
|
+
@param {Function} fn
|
2552
|
+
@param self
|
2553
|
+
*/
|
2554
|
+
forEach: function(fn, self) {
|
2555
|
+
// allow mutation during iteration
|
2556
|
+
var list = this.toArray();
|
2557
|
+
|
2558
|
+
for (var i = 0, j = list.length; i < j; i++) {
|
2559
|
+
fn.call(self, list[i]);
|
2560
|
+
}
|
2561
|
+
},
|
2562
|
+
|
2563
|
+
/**
|
2564
|
+
@method toArray
|
2565
|
+
@return {Array}
|
2566
|
+
*/
|
2567
|
+
toArray: function() {
|
2568
|
+
return this.list.slice();
|
2569
|
+
},
|
2570
|
+
|
2571
|
+
/**
|
2572
|
+
@method copy
|
2573
|
+
@return {Ember.OrderedSet}
|
2574
|
+
*/
|
2575
|
+
copy: function() {
|
2576
|
+
var set = new OrderedSet();
|
2577
|
+
|
2578
|
+
set.presenceSet = copy(this.presenceSet);
|
2579
|
+
set.list = this.toArray();
|
2580
|
+
|
2581
|
+
return set;
|
2582
|
+
}
|
2583
|
+
};
|
2584
|
+
|
2585
|
+
/**
|
2586
|
+
A Map stores values indexed by keys. Unlike JavaScript's
|
2587
|
+
default Objects, the keys of a Map can be any JavaScript
|
2588
|
+
object.
|
2589
|
+
|
2590
|
+
Internally, a Map has two data structures:
|
2591
|
+
|
2592
|
+
1. `keys`: an OrderedSet of all of the existing keys
|
2593
|
+
2. `values`: a JavaScript Object indexed by the `Ember.guidFor(key)`
|
2594
|
+
|
2595
|
+
When a key/value pair is added for the first time, we
|
2596
|
+
add the key to the `keys` OrderedSet, and create or
|
2597
|
+
replace an entry in `values`. When an entry is deleted,
|
2598
|
+
we delete its entry in `keys` and `values`.
|
2599
|
+
|
2600
|
+
@class Map
|
2601
|
+
@namespace Ember
|
2602
|
+
@private
|
2603
|
+
@constructor
|
2604
|
+
*/
|
2605
|
+
var Map = Ember.Map = function() {
|
2606
|
+
this.keys = Ember.OrderedSet.create();
|
2607
|
+
this.values = {};
|
2608
|
+
};
|
2609
|
+
|
2610
|
+
/**
|
2611
|
+
@method create
|
2612
|
+
@static
|
2613
|
+
*/
|
2614
|
+
Map.create = function() {
|
2615
|
+
return new Map();
|
2616
|
+
};
|
2617
|
+
|
2618
|
+
Map.prototype = {
|
2619
|
+
/**
|
2620
|
+
This property will change as the number of objects in the map changes.
|
2621
|
+
|
2622
|
+
@property length
|
2623
|
+
@type number
|
2624
|
+
@default 0
|
2625
|
+
*/
|
2626
|
+
length: 0,
|
2627
|
+
|
2628
|
+
|
2629
|
+
/**
|
2630
|
+
Retrieve the value associated with a given key.
|
2631
|
+
|
2632
|
+
@method get
|
2633
|
+
@param {*} key
|
2634
|
+
@return {*} the value associated with the key, or `undefined`
|
2635
|
+
*/
|
2636
|
+
get: function(key) {
|
2637
|
+
var values = this.values,
|
2638
|
+
guid = guidFor(key);
|
2639
|
+
|
2640
|
+
return values[guid];
|
2641
|
+
},
|
2642
|
+
|
2643
|
+
/**
|
2644
|
+
Adds a value to the map. If a value for the given key has already been
|
2645
|
+
provided, the new value will replace the old value.
|
2646
|
+
|
2647
|
+
@method set
|
2648
|
+
@param {*} key
|
2649
|
+
@param {*} value
|
2650
|
+
*/
|
2651
|
+
set: function(key, value) {
|
2652
|
+
var keys = this.keys,
|
2653
|
+
values = this.values,
|
2654
|
+
guid = guidFor(key);
|
2655
|
+
|
2656
|
+
keys.add(key);
|
2657
|
+
values[guid] = value;
|
2658
|
+
set(this, 'length', keys.list.length);
|
2659
|
+
},
|
2660
|
+
|
2661
|
+
/**
|
2662
|
+
Removes a value from the map for an associated key.
|
2663
|
+
|
2664
|
+
@method remove
|
2665
|
+
@param {*} key
|
2666
|
+
@return {Boolean} true if an item was removed, false otherwise
|
2667
|
+
*/
|
2668
|
+
remove: function(key) {
|
2669
|
+
// don't use ES6 "delete" because it will be annoying
|
2670
|
+
// to use in browsers that are not ES6 friendly;
|
2671
|
+
var keys = this.keys,
|
2672
|
+
values = this.values,
|
2673
|
+
guid = guidFor(key);
|
2674
|
+
|
2675
|
+
if (values.hasOwnProperty(guid)) {
|
2676
|
+
keys.remove(key);
|
2677
|
+
delete values[guid];
|
2678
|
+
set(this, 'length', keys.list.length);
|
2679
|
+
return true;
|
2680
|
+
} else {
|
2681
|
+
return false;
|
2697
2682
|
}
|
2698
|
-
}
|
2699
|
-
return value;
|
2700
|
-
};
|
2683
|
+
},
|
2701
2684
|
|
2702
|
-
|
2703
|
-
|
2704
|
-
Ember.set = set;
|
2705
|
-
Ember.config.overrideAccessors();
|
2706
|
-
set = Ember.set;
|
2707
|
-
}
|
2685
|
+
/**
|
2686
|
+
Check whether a key is present.
|
2708
2687
|
|
2709
|
-
|
2710
|
-
|
2688
|
+
@method has
|
2689
|
+
@param {*} key
|
2690
|
+
@return {Boolean} true if the item was present, false otherwise
|
2691
|
+
*/
|
2692
|
+
has: function(key) {
|
2693
|
+
var values = this.values,
|
2694
|
+
guid = guidFor(key);
|
2711
2695
|
|
2712
|
-
|
2713
|
-
|
2696
|
+
return values.hasOwnProperty(guid);
|
2697
|
+
},
|
2714
2698
|
|
2715
|
-
|
2716
|
-
|
2699
|
+
/**
|
2700
|
+
Iterate over all the keys and values. Calls the function once
|
2701
|
+
for each key, passing in the key and value, in that order.
|
2717
2702
|
|
2718
|
-
|
2719
|
-
// get the root
|
2720
|
-
if (path !== 'this') {
|
2721
|
-
root = getPath(root, path);
|
2722
|
-
}
|
2703
|
+
The keys are guaranteed to be iterated over in insertion order.
|
2723
2704
|
|
2724
|
-
|
2725
|
-
|
2726
|
-
|
2705
|
+
@method forEach
|
2706
|
+
@param {Function} callback
|
2707
|
+
@param {*} self if passed, the `this` value inside the
|
2708
|
+
callback. By default, `this` is the map.
|
2709
|
+
*/
|
2710
|
+
forEach: function(callback, self) {
|
2711
|
+
var keys = this.keys,
|
2712
|
+
values = this.values;
|
2727
2713
|
|
2728
|
-
|
2729
|
-
|
2730
|
-
|
2714
|
+
keys.forEach(function(key) {
|
2715
|
+
var guid = guidFor(key);
|
2716
|
+
callback.call(self, key, values[guid]);
|
2717
|
+
});
|
2718
|
+
},
|
2719
|
+
|
2720
|
+
/**
|
2721
|
+
@method copy
|
2722
|
+
@return {Ember.Map}
|
2723
|
+
*/
|
2724
|
+
copy: function() {
|
2725
|
+
return copyMap(this, new Map());
|
2731
2726
|
}
|
2727
|
+
};
|
2732
2728
|
|
2733
|
-
|
2734
|
-
|
2729
|
+
/**
|
2730
|
+
@class MapWithDefault
|
2731
|
+
@namespace Ember
|
2732
|
+
@extends Ember.Map
|
2733
|
+
@private
|
2734
|
+
@constructor
|
2735
|
+
@param [options]
|
2736
|
+
@param {*} [options.defaultValue]
|
2737
|
+
*/
|
2738
|
+
var MapWithDefault = Ember.MapWithDefault = function(options) {
|
2739
|
+
Map.call(this);
|
2740
|
+
this.defaultValue = options.defaultValue;
|
2741
|
+
};
|
2735
2742
|
|
2736
|
-
|
2737
|
-
|
2743
|
+
/**
|
2744
|
+
@method create
|
2745
|
+
@static
|
2746
|
+
@param [options]
|
2747
|
+
@param {*} [options.defaultValue]
|
2748
|
+
@return {Ember.MapWithDefault|Ember.Map} If options are passed, returns
|
2749
|
+
`Ember.MapWithDefault` otherwise returns `Ember.Map`
|
2750
|
+
*/
|
2751
|
+
MapWithDefault.create = function(options) {
|
2752
|
+
if (options) {
|
2753
|
+
return new MapWithDefault(options);
|
2754
|
+
} else {
|
2755
|
+
return new Map();
|
2756
|
+
}
|
2757
|
+
};
|
2758
|
+
|
2759
|
+
MapWithDefault.prototype = Ember.create(Map.prototype);
|
2738
2760
|
|
2739
2761
|
/**
|
2740
|
-
|
2741
|
-
chain is `undefined`, `null`, or destroyed.
|
2762
|
+
Retrieve the value associated with a given key.
|
2742
2763
|
|
2743
|
-
|
2744
|
-
|
2764
|
+
@method get
|
2765
|
+
@param {*} key
|
2766
|
+
@return {*} the value associated with the key, or the default value
|
2767
|
+
*/
|
2768
|
+
MapWithDefault.prototype.get = function(key) {
|
2769
|
+
var hasValue = this.has(key);
|
2745
2770
|
|
2746
|
-
|
2747
|
-
|
2748
|
-
|
2749
|
-
|
2750
|
-
|
2771
|
+
if (hasValue) {
|
2772
|
+
return Map.prototype.get.call(this, key);
|
2773
|
+
} else {
|
2774
|
+
var defaultValue = this.defaultValue(key);
|
2775
|
+
this.set(key, defaultValue);
|
2776
|
+
return defaultValue;
|
2777
|
+
}
|
2778
|
+
};
|
2779
|
+
|
2780
|
+
/**
|
2781
|
+
@method copy
|
2782
|
+
@return {Ember.MapWithDefault}
|
2751
2783
|
*/
|
2752
|
-
|
2753
|
-
return
|
2784
|
+
MapWithDefault.prototype.copy = function() {
|
2785
|
+
return copyMap(this, new MapWithDefault({
|
2786
|
+
defaultValue: this.defaultValue
|
2787
|
+
}));
|
2754
2788
|
};
|
2755
|
-
Ember.trySetPath = Ember.deprecateFunc('trySetPath has been renamed to trySet', Ember.trySet);
|
2756
2789
|
|
2757
2790
|
})();
|
2758
2791
|
|
@@ -2784,7 +2817,7 @@ var MANDATORY_SETTER = Ember.ENV.MANDATORY_SETTER;
|
|
2784
2817
|
@private
|
2785
2818
|
@constructor
|
2786
2819
|
*/
|
2787
|
-
|
2820
|
+
Ember.Descriptor = function() {};
|
2788
2821
|
|
2789
2822
|
// ..........................................................
|
2790
2823
|
// DEFINING PROPERTIES API
|
@@ -3345,7 +3378,7 @@ Ember.watchPath = function(obj, keyPath) {
|
|
3345
3378
|
};
|
3346
3379
|
|
3347
3380
|
Ember.unwatchPath = function(obj, keyPath) {
|
3348
|
-
var m = metaFor(obj), watching = m.watching
|
3381
|
+
var m = metaFor(obj), watching = m.watching;
|
3349
3382
|
|
3350
3383
|
if (watching[keyPath] === 1) {
|
3351
3384
|
watching[keyPath] = 0;
|
@@ -3606,27 +3639,14 @@ ComputedProperty.prototype = new Ember.Descriptor();
|
|
3606
3639
|
var ComputedPropertyPrototype = ComputedProperty.prototype;
|
3607
3640
|
|
3608
3641
|
/*
|
3609
|
-
|
3642
|
+
Properties are cacheable by default. Computed property will automatically
|
3643
|
+
cache the return value of your function until one of the dependent keys changes.
|
3610
3644
|
|
3611
|
-
|
3645
|
+
Call `volatile()` to set it into non-cached mode. When in this mode
|
3646
|
+
the computed property will not automatically cache the return value.
|
3612
3647
|
|
3613
|
-
|
3614
|
-
|
3615
|
-
fullName: function() {
|
3616
|
-
return this.get('firstName') + ' ' + this.get('lastName');
|
3617
|
-
|
3618
|
-
// By default, Ember will return the value of this property
|
3619
|
-
// without re-executing this function.
|
3620
|
-
}.property('firstName', 'lastName')
|
3621
|
-
|
3622
|
-
initials: function() {
|
3623
|
-
return this.get('firstName')[0] + this.get('lastName')[0];
|
3624
|
-
|
3625
|
-
// This function will be executed every time this property
|
3626
|
-
// is requested.
|
3627
|
-
}.property('firstName', 'lastName').cacheable(false)
|
3628
|
-
});
|
3629
|
-
```
|
3648
|
+
However, if a property is properly observable, there is no reason to disable
|
3649
|
+
caching.
|
3630
3650
|
|
3631
3651
|
@method cacheable
|
3632
3652
|
@param {Boolean} aFlag optional set to `false` to disable caching
|
@@ -3890,7 +3910,6 @@ ComputedPropertyPrototype.teardown = function(obj, keyName) {
|
|
3890
3910
|
The function should accept two parameters, key and value. If value is not
|
3891
3911
|
undefined you should set the value first. In either case return the
|
3892
3912
|
current value of the property.
|
3893
|
-
|
3894
3913
|
@method computed
|
3895
3914
|
@for Ember
|
3896
3915
|
@param {Function} func The computed property function.
|
@@ -4132,7 +4151,7 @@ registerComputedWithProperties('or', function(properties) {
|
|
4132
4151
|
@for Ember
|
4133
4152
|
@param {String} dependentKey, [dependentKey...]
|
4134
4153
|
@return {Ember.ComputedProperty} computed property which returns
|
4135
|
-
the first
|
4154
|
+
the first truthy value of given list of properties.
|
4136
4155
|
*/
|
4137
4156
|
registerComputedWithProperties('any', function(properties) {
|
4138
4157
|
for (var key in properties) {
|
@@ -4182,6 +4201,48 @@ Ember.computed.alias = function(dependentKey) {
|
|
4182
4201
|
});
|
4183
4202
|
};
|
4184
4203
|
|
4204
|
+
/**
|
4205
|
+
@method computed.oneWay
|
4206
|
+
@for Ember
|
4207
|
+
@param {String} dependentKey
|
4208
|
+
@return {Ember.ComputedProperty} computed property which creates an
|
4209
|
+
one way computed property to the original value for property.
|
4210
|
+
|
4211
|
+
Where `computed.alias` aliases `get` and `set`, and allows for bidirectional
|
4212
|
+
data flow, `computed.oneWay` only provides an aliased `get`. The `set` will
|
4213
|
+
not mutate the upstream property, rather causes the current property to
|
4214
|
+
become the value set. This causes the downstream property to permentantly
|
4215
|
+
diverge from the upstream property.
|
4216
|
+
|
4217
|
+
```javascript
|
4218
|
+
User = Ember.Object.extend({
|
4219
|
+
firstName: null,
|
4220
|
+
lastName: null,
|
4221
|
+
nickName: Ember.computed.oneWay('firstName')
|
4222
|
+
});
|
4223
|
+
|
4224
|
+
user = User.create({
|
4225
|
+
firstName: 'Teddy',
|
4226
|
+
lastName: 'Zeenny'
|
4227
|
+
});
|
4228
|
+
|
4229
|
+
user.get('nickName');
|
4230
|
+
# 'Teddy'
|
4231
|
+
|
4232
|
+
user.set('nickName', 'TeddyBear');
|
4233
|
+
# 'TeddyBear'
|
4234
|
+
|
4235
|
+
user.get('firstName');
|
4236
|
+
# 'Teddy'
|
4237
|
+
```
|
4238
|
+
*/
|
4239
|
+
Ember.computed.oneWay = function(dependentKey) {
|
4240
|
+
return Ember.computed(dependentKey, function() {
|
4241
|
+
return get(this, dependentKey);
|
4242
|
+
});
|
4243
|
+
};
|
4244
|
+
|
4245
|
+
|
4185
4246
|
/**
|
4186
4247
|
@method computed.defaultTo
|
4187
4248
|
@for Ember
|
@@ -4211,8 +4272,6 @@ Ember.computed.defaultTo = function(defaultPath) {
|
|
4211
4272
|
var AFTER_OBSERVERS = ':change';
|
4212
4273
|
var BEFORE_OBSERVERS = ':before';
|
4213
4274
|
|
4214
|
-
var guidFor = Ember.guidFor;
|
4215
|
-
|
4216
4275
|
function changeEvent(keyName) {
|
4217
4276
|
return keyName+AFTER_OBSERVERS;
|
4218
4277
|
}
|
@@ -4272,220 +4331,544 @@ Ember._suspendBeforeObserver = function(obj, path, target, method, callback) {
|
|
4272
4331
|
return Ember._suspendListener(obj, beforeEvent(path), target, method, callback);
|
4273
4332
|
};
|
4274
4333
|
|
4275
|
-
Ember._suspendObserver = function(obj, path, target, method, callback) {
|
4276
|
-
return Ember._suspendListener(obj, changeEvent(path), target, method, callback);
|
4277
|
-
};
|
4334
|
+
Ember._suspendObserver = function(obj, path, target, method, callback) {
|
4335
|
+
return Ember._suspendListener(obj, changeEvent(path), target, method, callback);
|
4336
|
+
};
|
4337
|
+
|
4338
|
+
var map = Ember.ArrayPolyfills.map;
|
4339
|
+
|
4340
|
+
Ember._suspendBeforeObservers = function(obj, paths, target, method, callback) {
|
4341
|
+
var events = map.call(paths, beforeEvent);
|
4342
|
+
return Ember._suspendListeners(obj, events, target, method, callback);
|
4343
|
+
};
|
4344
|
+
|
4345
|
+
Ember._suspendObservers = function(obj, paths, target, method, callback) {
|
4346
|
+
var events = map.call(paths, changeEvent);
|
4347
|
+
return Ember._suspendListeners(obj, events, target, method, callback);
|
4348
|
+
};
|
4349
|
+
|
4350
|
+
Ember.beforeObserversFor = function(obj, path) {
|
4351
|
+
return Ember.listenersFor(obj, beforeEvent(path));
|
4352
|
+
};
|
4353
|
+
|
4354
|
+
/**
|
4355
|
+
@method removeBeforeObserver
|
4356
|
+
@param obj
|
4357
|
+
@param {String} path
|
4358
|
+
@param {Object|Function} targetOrMethod
|
4359
|
+
@param {Function|String} [method]
|
4360
|
+
*/
|
4361
|
+
Ember.removeBeforeObserver = function(obj, path, target, method) {
|
4362
|
+
Ember.unwatch(obj, path);
|
4363
|
+
Ember.removeListener(obj, beforeEvent(path), target, method);
|
4364
|
+
return this;
|
4365
|
+
};
|
4366
|
+
})();
|
4367
|
+
|
4368
|
+
|
4369
|
+
|
4370
|
+
(function() {
|
4371
|
+
define("backburner",
|
4372
|
+
["backburner/deferred_action_queues","exports"],
|
4373
|
+
function(__dependency1__, __exports__) {
|
4374
|
+
"use strict";
|
4375
|
+
var DeferredActionQueues = __dependency1__.DeferredActionQueues;
|
4376
|
+
|
4377
|
+
var slice = [].slice,
|
4378
|
+
pop = [].pop,
|
4379
|
+
debouncees = [],
|
4380
|
+
timers = [],
|
4381
|
+
autorun, laterTimer, laterTimerExpiresAt;
|
4382
|
+
|
4383
|
+
function Backburner(queueNames, options) {
|
4384
|
+
this.queueNames = queueNames;
|
4385
|
+
this.options = options || {};
|
4386
|
+
if (!this.options.defaultQueue) {
|
4387
|
+
this.options.defaultQueue = queueNames[0];
|
4388
|
+
}
|
4389
|
+
this.instanceStack = [];
|
4390
|
+
}
|
4391
|
+
|
4392
|
+
Backburner.prototype = {
|
4393
|
+
queueNames: null,
|
4394
|
+
options: null,
|
4395
|
+
currentInstance: null,
|
4396
|
+
instanceStack: null,
|
4397
|
+
|
4398
|
+
begin: function() {
|
4399
|
+
var onBegin = this.options && this.options.onBegin,
|
4400
|
+
previousInstance = this.currentInstance;
|
4401
|
+
|
4402
|
+
if (previousInstance) {
|
4403
|
+
this.instanceStack.push(previousInstance);
|
4404
|
+
}
|
4405
|
+
|
4406
|
+
this.currentInstance = new DeferredActionQueues(this.queueNames, this.options);
|
4407
|
+
if (onBegin) {
|
4408
|
+
onBegin(this.currentInstance, previousInstance);
|
4409
|
+
}
|
4410
|
+
},
|
4411
|
+
|
4412
|
+
end: function() {
|
4413
|
+
var onEnd = this.options && this.options.onEnd,
|
4414
|
+
currentInstance = this.currentInstance,
|
4415
|
+
nextInstance = null;
|
4416
|
+
|
4417
|
+
try {
|
4418
|
+
currentInstance.flush();
|
4419
|
+
} finally {
|
4420
|
+
this.currentInstance = null;
|
4421
|
+
|
4422
|
+
if (this.instanceStack.length) {
|
4423
|
+
nextInstance = this.instanceStack.pop();
|
4424
|
+
this.currentInstance = nextInstance;
|
4425
|
+
}
|
4426
|
+
|
4427
|
+
if (onEnd) {
|
4428
|
+
onEnd(currentInstance, nextInstance);
|
4429
|
+
}
|
4430
|
+
}
|
4431
|
+
},
|
4432
|
+
|
4433
|
+
run: function(target, method /*, args */) {
|
4434
|
+
var ret;
|
4435
|
+
this.begin();
|
4436
|
+
|
4437
|
+
if (!method) {
|
4438
|
+
method = target;
|
4439
|
+
target = null;
|
4440
|
+
}
|
4441
|
+
|
4442
|
+
if (typeof method === 'string') {
|
4443
|
+
method = target[method];
|
4444
|
+
}
|
4445
|
+
|
4446
|
+
// Prevent Safari double-finally.
|
4447
|
+
var finallyAlreadyCalled = false;
|
4448
|
+
try {
|
4449
|
+
if (arguments.length > 2) {
|
4450
|
+
ret = method.apply(target, slice.call(arguments, 2));
|
4451
|
+
} else {
|
4452
|
+
ret = method.call(target);
|
4453
|
+
}
|
4454
|
+
} finally {
|
4455
|
+
if (!finallyAlreadyCalled) {
|
4456
|
+
finallyAlreadyCalled = true;
|
4457
|
+
this.end();
|
4458
|
+
}
|
4459
|
+
}
|
4460
|
+
return ret;
|
4461
|
+
},
|
4462
|
+
|
4463
|
+
defer: function(queueName, target, method /* , args */) {
|
4464
|
+
if (!method) {
|
4465
|
+
method = target;
|
4466
|
+
target = null;
|
4467
|
+
}
|
4278
4468
|
|
4279
|
-
|
4469
|
+
if (typeof method === 'string') {
|
4470
|
+
method = target[method];
|
4471
|
+
}
|
4280
4472
|
|
4281
|
-
|
4282
|
-
|
4283
|
-
|
4284
|
-
|
4473
|
+
var stack = new Error().stack,
|
4474
|
+
args = arguments.length > 3 ? slice.call(arguments, 3) : undefined;
|
4475
|
+
if (!this.currentInstance) { createAutorun(this); }
|
4476
|
+
return this.currentInstance.schedule(queueName, target, method, args, false, stack);
|
4477
|
+
},
|
4285
4478
|
|
4286
|
-
|
4287
|
-
|
4288
|
-
|
4289
|
-
|
4479
|
+
deferOnce: function(queueName, target, method /* , args */) {
|
4480
|
+
if (!method) {
|
4481
|
+
method = target;
|
4482
|
+
target = null;
|
4483
|
+
}
|
4290
4484
|
|
4291
|
-
|
4292
|
-
|
4293
|
-
}
|
4485
|
+
if (typeof method === 'string') {
|
4486
|
+
method = target[method];
|
4487
|
+
}
|
4294
4488
|
|
4295
|
-
|
4296
|
-
|
4297
|
-
|
4298
|
-
|
4299
|
-
|
4300
|
-
@param {Function|String} [method]
|
4301
|
-
*/
|
4302
|
-
Ember.removeBeforeObserver = function(obj, path, target, method) {
|
4303
|
-
Ember.unwatch(obj, path);
|
4304
|
-
Ember.removeListener(obj, beforeEvent(path), target, method);
|
4305
|
-
return this;
|
4306
|
-
};
|
4307
|
-
})();
|
4489
|
+
var stack = new Error().stack,
|
4490
|
+
args = arguments.length > 3 ? slice.call(arguments, 3) : undefined;
|
4491
|
+
if (!this.currentInstance) { createAutorun(this); }
|
4492
|
+
return this.currentInstance.schedule(queueName, target, method, args, true, stack);
|
4493
|
+
},
|
4308
4494
|
|
4495
|
+
setTimeout: function() {
|
4496
|
+
var self = this,
|
4497
|
+
wait = pop.call(arguments),
|
4498
|
+
target = arguments[0],
|
4499
|
+
method = arguments[1],
|
4500
|
+
executeAt = (+new Date()) + wait;
|
4309
4501
|
|
4502
|
+
if (!method) {
|
4503
|
+
method = target;
|
4504
|
+
target = null;
|
4505
|
+
}
|
4310
4506
|
|
4311
|
-
(
|
4312
|
-
|
4313
|
-
|
4314
|
-
// Ember.beginPropertyChanges, Ember.endPropertyChanges
|
4315
|
-
// Ember.guidFor, Ember.tryFinally
|
4507
|
+
if (typeof method === 'string') {
|
4508
|
+
method = target[method];
|
4509
|
+
}
|
4316
4510
|
|
4317
|
-
|
4318
|
-
|
4319
|
-
|
4511
|
+
var fn, args;
|
4512
|
+
if (arguments.length > 2) {
|
4513
|
+
args = slice.call(arguments, 2);
|
4320
4514
|
|
4321
|
-
|
4322
|
-
|
4323
|
-
|
4515
|
+
fn = function() {
|
4516
|
+
method.apply(target, args);
|
4517
|
+
};
|
4518
|
+
} else {
|
4519
|
+
fn = function() {
|
4520
|
+
method.call(target);
|
4521
|
+
};
|
4522
|
+
}
|
4324
4523
|
|
4325
|
-
|
4326
|
-
|
4524
|
+
// find position to insert - TODO: binary search
|
4525
|
+
var i, l;
|
4526
|
+
for (i = 0, l = timers.length; i < l; i += 2) {
|
4527
|
+
if (executeAt < timers[i]) { break; }
|
4528
|
+
}
|
4327
4529
|
|
4328
|
-
|
4329
|
-
// target/string or just func
|
4330
|
-
function invoke(target, method, args, ignore) {
|
4530
|
+
timers.splice(i, 0, executeAt, fn);
|
4331
4531
|
|
4332
|
-
|
4333
|
-
method = target;
|
4334
|
-
target = undefined;
|
4335
|
-
}
|
4532
|
+
if (laterTimer && laterTimerExpiresAt < executeAt) { return fn; }
|
4336
4533
|
|
4337
|
-
|
4338
|
-
|
4339
|
-
|
4340
|
-
|
4534
|
+
if (laterTimer) {
|
4535
|
+
clearTimeout(laterTimer);
|
4536
|
+
laterTimer = null;
|
4537
|
+
}
|
4538
|
+
laterTimer = setTimeout(function() {
|
4539
|
+
executeTimers(self);
|
4540
|
+
laterTimer = null;
|
4541
|
+
laterTimerExpiresAt = null;
|
4542
|
+
}, wait);
|
4543
|
+
laterTimerExpiresAt = executeAt;
|
4544
|
+
|
4545
|
+
return fn;
|
4546
|
+
},
|
4341
4547
|
|
4342
|
-
|
4343
|
-
|
4344
|
-
|
4345
|
-
|
4346
|
-
|
4548
|
+
debounce: function(target, method /* , args, wait */) {
|
4549
|
+
var self = this,
|
4550
|
+
args = arguments,
|
4551
|
+
wait = pop.call(args),
|
4552
|
+
debouncee;
|
4347
4553
|
|
4554
|
+
for (var i = 0, l = debouncees.length; i < l; i++) {
|
4555
|
+
debouncee = debouncees[i];
|
4556
|
+
if (debouncee[0] === target && debouncee[1] === method) { return; } // do nothing
|
4557
|
+
}
|
4348
4558
|
|
4349
|
-
|
4350
|
-
|
4351
|
-
//
|
4559
|
+
var timer = setTimeout(function() {
|
4560
|
+
self.run.apply(self, args);
|
4352
4561
|
|
4353
|
-
|
4354
|
-
|
4562
|
+
// remove debouncee
|
4563
|
+
var index = -1;
|
4564
|
+
for (var i = 0, l = debouncees.length; i < l; i++) {
|
4565
|
+
debouncee = debouncees[i];
|
4566
|
+
if (debouncee[0] === target && debouncee[1] === method) {
|
4567
|
+
index = i;
|
4568
|
+
break;
|
4569
|
+
}
|
4570
|
+
}
|
4355
4571
|
|
4356
|
-
|
4357
|
-
|
4358
|
-
@private
|
4359
|
-
@constructor
|
4360
|
-
*/
|
4361
|
-
var RunLoop = function(prev) {
|
4362
|
-
this._prev = prev || null;
|
4363
|
-
this.onceTimers = {};
|
4364
|
-
};
|
4572
|
+
if (index > -1) { debouncees.splice(index, 1); }
|
4573
|
+
}, wait);
|
4365
4574
|
|
4366
|
-
|
4367
|
-
|
4368
|
-
@method end
|
4369
|
-
*/
|
4370
|
-
end: function() {
|
4371
|
-
this.flush();
|
4372
|
-
},
|
4575
|
+
debouncees.push([target, method, timer]);
|
4576
|
+
},
|
4373
4577
|
|
4374
|
-
|
4375
|
-
|
4376
|
-
|
4377
|
-
|
4378
|
-
|
4379
|
-
},
|
4578
|
+
cancelTimers: function() {
|
4579
|
+
for (var i = 0, l = debouncees.length; i < l; i++) {
|
4580
|
+
clearTimeout(debouncees[i][2]);
|
4581
|
+
}
|
4582
|
+
debouncees = [];
|
4380
4583
|
|
4381
|
-
|
4382
|
-
|
4383
|
-
|
4584
|
+
if (laterTimer) {
|
4585
|
+
clearTimeout(laterTimer);
|
4586
|
+
laterTimer = null;
|
4587
|
+
}
|
4588
|
+
timers = [];
|
4384
4589
|
|
4385
|
-
|
4386
|
-
|
4387
|
-
|
4388
|
-
|
4389
|
-
|
4390
|
-
*/
|
4391
|
-
schedule: function(queueName, target, method) {
|
4392
|
-
var queues = this._queues, queue;
|
4393
|
-
if (!queues) { queues = this._queues = {}; }
|
4394
|
-
queue = queues[queueName];
|
4395
|
-
if (!queue) { queue = queues[queueName] = []; }
|
4590
|
+
if (autorun) {
|
4591
|
+
clearTimeout(autorun);
|
4592
|
+
autorun = null;
|
4593
|
+
}
|
4594
|
+
},
|
4396
4595
|
|
4397
|
-
|
4398
|
-
|
4399
|
-
|
4400
|
-
},
|
4596
|
+
hasTimers: function() {
|
4597
|
+
return !!timers.length || autorun;
|
4598
|
+
},
|
4401
4599
|
|
4402
|
-
|
4403
|
-
|
4404
|
-
|
4405
|
-
|
4406
|
-
|
4407
|
-
|
4600
|
+
cancel: function(timer) {
|
4601
|
+
if (typeof timer === 'object' && timer.queue && timer.method) { // we're cancelling a deferOnce
|
4602
|
+
return timer.queue.cancel(timer);
|
4603
|
+
} else if (typeof timer === 'function') { // we're cancelling a setTimeout
|
4604
|
+
for (var i = 0, l = timers.length; i < l; i += 2) {
|
4605
|
+
if (timers[i + 1] === timer) {
|
4606
|
+
timers.splice(i, 2); // remove the two elements
|
4607
|
+
return true;
|
4608
|
+
}
|
4609
|
+
}
|
4610
|
+
}
|
4611
|
+
}
|
4612
|
+
};
|
4408
4613
|
|
4409
|
-
|
4614
|
+
Backburner.prototype.schedule = Backburner.prototype.defer;
|
4615
|
+
Backburner.prototype.scheduleOnce = Backburner.prototype.deferOnce;
|
4616
|
+
Backburner.prototype.later = Backburner.prototype.setTimeout;
|
4410
4617
|
|
4411
|
-
function
|
4412
|
-
|
4618
|
+
function createAutorun(backburner) {
|
4619
|
+
backburner.begin();
|
4620
|
+
autorun = setTimeout(function() {
|
4621
|
+
backburner.end();
|
4622
|
+
autorun = null;
|
4623
|
+
});
|
4413
4624
|
}
|
4414
4625
|
|
4415
|
-
function
|
4416
|
-
|
4626
|
+
function executeTimers(self) {
|
4627
|
+
var now = +new Date(),
|
4628
|
+
time, fns, i, l;
|
4629
|
+
|
4630
|
+
self.run(function() {
|
4631
|
+
// TODO: binary search
|
4632
|
+
for (i = 0, l = timers.length; i < l; i += 2) {
|
4633
|
+
time = timers[i];
|
4634
|
+
if (time > now) { break; }
|
4635
|
+
}
|
4636
|
+
|
4637
|
+
fns = timers.splice(0, i);
|
4638
|
+
|
4639
|
+
for (i = 1, l = fns.length; i < l; i += 2) {
|
4640
|
+
self.schedule(self.options.defaultQueue, null, fns[i]);
|
4641
|
+
}
|
4642
|
+
});
|
4643
|
+
|
4644
|
+
if (timers.length) {
|
4645
|
+
laterTimer = setTimeout(function() {
|
4646
|
+
executeTimers(self);
|
4647
|
+
laterTimer = null;
|
4648
|
+
laterTimerExpiresAt = null;
|
4649
|
+
}, timers[0] - now);
|
4650
|
+
laterTimerExpiresAt = timers[0];
|
4651
|
+
}
|
4417
4652
|
}
|
4418
4653
|
|
4419
|
-
Ember.watch.flushPending(); // make sure all chained watchers are setup
|
4420
4654
|
|
4421
|
-
|
4422
|
-
|
4423
|
-
|
4655
|
+
__exports__.Backburner = Backburner;
|
4656
|
+
});
|
4657
|
+
|
4658
|
+
define("backburner/deferred_action_queues",
|
4659
|
+
["backburner/queue","exports"],
|
4660
|
+
function(__dependency1__, __exports__) {
|
4661
|
+
"use strict";
|
4662
|
+
var Queue = __dependency1__.Queue;
|
4663
|
+
|
4664
|
+
function DeferredActionQueues(queueNames, options) {
|
4665
|
+
var queues = this.queues = {};
|
4666
|
+
this.queueNames = queueNames = queueNames || [];
|
4424
4667
|
|
4425
|
-
|
4426
|
-
|
4427
|
-
|
4428
|
-
|
4429
|
-
|
4668
|
+
var queueName;
|
4669
|
+
for (var i = 0, l = queueNames.length; i < l; i++) {
|
4670
|
+
queueName = queueNames[i];
|
4671
|
+
queues[queueName] = new Queue(this, queueName, options[queueName]);
|
4672
|
+
}
|
4673
|
+
}
|
4430
4674
|
|
4431
|
-
|
4675
|
+
DeferredActionQueues.prototype = {
|
4676
|
+
queueNames: null,
|
4677
|
+
queues: null,
|
4432
4678
|
|
4433
|
-
|
4679
|
+
schedule: function(queueName, target, method, args, onceFlag, stack) {
|
4680
|
+
var queues = this.queues,
|
4681
|
+
queue = queues[queueName];
|
4434
4682
|
|
4435
|
-
|
4683
|
+
if (!queue) { throw new Error("You attempted to schedule an action in a queue (" + queueName + ") that doesn't exist"); }
|
4436
4684
|
|
4685
|
+
if (onceFlag) {
|
4686
|
+
return queue.pushUnique(target, method, args, stack);
|
4437
4687
|
} else {
|
4438
|
-
|
4688
|
+
return queue.push(target, method, args, stack);
|
4689
|
+
}
|
4690
|
+
},
|
4691
|
+
|
4692
|
+
flush: function() {
|
4693
|
+
var queues = this.queues,
|
4694
|
+
queueNames = this.queueNames,
|
4695
|
+
queueName, queue, queueItems, priorQueueNameIndex,
|
4696
|
+
queueNameIndex = 0, numberOfQueues = queueNames.length;
|
4697
|
+
|
4698
|
+
outerloop:
|
4699
|
+
while (queueNameIndex < numberOfQueues) {
|
4700
|
+
queueName = queueNames[queueNameIndex];
|
4701
|
+
queue = queues[queueName];
|
4702
|
+
queueItems = queue._queue.slice();
|
4703
|
+
queue._queue = [];
|
4704
|
+
|
4705
|
+
var options = queue.options,
|
4706
|
+
before = options && options.before,
|
4707
|
+
after = options && options.after,
|
4708
|
+
target, method, args, stack,
|
4709
|
+
queueIndex = 0, numberOfQueueItems = queueItems.length;
|
4710
|
+
|
4711
|
+
if (numberOfQueueItems && before) { before(); }
|
4712
|
+
while (queueIndex < numberOfQueueItems) {
|
4713
|
+
target = queueItems[queueIndex];
|
4714
|
+
method = queueItems[queueIndex+1];
|
4715
|
+
args = queueItems[queueIndex+2];
|
4716
|
+
stack = queueItems[queueIndex+3]; // Debugging assistance
|
4717
|
+
|
4718
|
+
if (typeof method === 'string') { method = target[method]; }
|
4719
|
+
|
4720
|
+
// TODO: error handling
|
4721
|
+
if (args && args.length > 0) {
|
4722
|
+
method.apply(target, args);
|
4723
|
+
} else {
|
4724
|
+
method.call(target);
|
4725
|
+
}
|
4726
|
+
|
4727
|
+
queueIndex += 4;
|
4728
|
+
}
|
4729
|
+
if (numberOfQueueItems && after) { after(); }
|
4730
|
+
|
4731
|
+
if ((priorQueueNameIndex = indexOfPriorQueueWithActions(this, queueNameIndex)) !== -1) {
|
4732
|
+
queueNameIndex = priorQueueNameIndex;
|
4733
|
+
continue outerloop;
|
4734
|
+
}
|
4735
|
+
|
4736
|
+
queueNameIndex++;
|
4439
4737
|
}
|
4440
4738
|
}
|
4739
|
+
};
|
4441
4740
|
|
4442
|
-
|
4443
|
-
|
4444
|
-
len = queueNames.length;
|
4445
|
-
idx = 0;
|
4741
|
+
function indexOfPriorQueueWithActions(daq, currentQueueIndex) {
|
4742
|
+
var queueName, queue;
|
4446
4743
|
|
4447
|
-
|
4448
|
-
|
4449
|
-
|
4450
|
-
queue
|
4451
|
-
|
4744
|
+
for (var i = 0, l = currentQueueIndex; i <= l; i++) {
|
4745
|
+
queueName = daq.queueNames[i];
|
4746
|
+
queue = daq.queues[queueName];
|
4747
|
+
if (queue._queue.length) { return i; }
|
4748
|
+
}
|
4452
4749
|
|
4453
|
-
|
4454
|
-
|
4455
|
-
// invoke observers until that is finished.
|
4456
|
-
if (queueName === 'sync') {
|
4457
|
-
log = Ember.LOG_BINDINGS;
|
4458
|
-
if (log) { Ember.Logger.log('Begin: Flush Sync Queue'); }
|
4750
|
+
return -1;
|
4751
|
+
}
|
4459
4752
|
|
4460
|
-
|
4753
|
+
__exports__.DeferredActionQueues = DeferredActionQueues;
|
4754
|
+
});
|
4461
4755
|
|
4462
|
-
|
4756
|
+
define("backburner/queue",
|
4757
|
+
["exports"],
|
4758
|
+
function(__exports__) {
|
4759
|
+
"use strict";
|
4760
|
+
function Queue(daq, name, options) {
|
4761
|
+
this.daq = daq;
|
4762
|
+
this.name = name;
|
4763
|
+
this.options = options;
|
4764
|
+
this._queue = [];
|
4765
|
+
}
|
4766
|
+
|
4767
|
+
Queue.prototype = {
|
4768
|
+
daq: null,
|
4769
|
+
name: null,
|
4770
|
+
options: null,
|
4771
|
+
_queue: null,
|
4772
|
+
|
4773
|
+
push: function(target, method, args, stack) {
|
4774
|
+
var queue = this._queue;
|
4775
|
+
queue.push(target, method, args, stack);
|
4776
|
+
return {queue: this, target: target, method: method};
|
4777
|
+
},
|
4463
4778
|
|
4464
|
-
|
4465
|
-
|
4466
|
-
|
4779
|
+
pushUnique: function(target, method, args, stack) {
|
4780
|
+
var queue = this._queue, currentTarget, currentMethod, i, l;
|
4781
|
+
|
4782
|
+
for (i = 0, l = queue.length; i < l; i += 4) {
|
4783
|
+
currentTarget = queue[i];
|
4784
|
+
currentMethod = queue[i+1];
|
4785
|
+
|
4786
|
+
if (currentTarget === target && currentMethod === method) {
|
4787
|
+
queue[i+2] = args; // replace args
|
4788
|
+
queue[i+3] = stack; // replace stack
|
4789
|
+
return {queue: this, target: target, method: method}; // TODO: test this code path
|
4467
4790
|
}
|
4468
4791
|
}
|
4469
4792
|
|
4470
|
-
|
4471
|
-
|
4472
|
-
|
4473
|
-
|
4474
|
-
|
4475
|
-
|
4793
|
+
this._queue.push(target, method, args, stack);
|
4794
|
+
return {queue: this, target: target, method: method};
|
4795
|
+
},
|
4796
|
+
|
4797
|
+
// TODO: remove me, only being used for Ember.run.sync
|
4798
|
+
flush: function() {
|
4799
|
+
var queue = this._queue,
|
4800
|
+
options = this.options,
|
4801
|
+
before = options && options.before,
|
4802
|
+
after = options && options.after,
|
4803
|
+
target, method, args, stack, i, l = queue.length;
|
4804
|
+
|
4805
|
+
if (l && before) { before(); }
|
4806
|
+
for (i = 0; i < l; i += 4) {
|
4807
|
+
target = queue[i];
|
4808
|
+
method = queue[i+1];
|
4809
|
+
args = queue[i+2];
|
4810
|
+
stack = queue[i+3]; // Debugging assistance
|
4811
|
+
|
4812
|
+
// TODO: error handling
|
4813
|
+
if (args && args.length > 0) {
|
4814
|
+
method.apply(target, args);
|
4815
|
+
} else {
|
4816
|
+
method.call(target);
|
4476
4817
|
}
|
4477
4818
|
}
|
4819
|
+
if (l && after) { after(); }
|
4820
|
+
|
4821
|
+
// check if new items have been added
|
4822
|
+
if (queue.length > l) {
|
4823
|
+
this._queue = queue.slice(l);
|
4824
|
+
this.flush();
|
4825
|
+
} else {
|
4826
|
+
this._queue.length = 0;
|
4827
|
+
}
|
4828
|
+
},
|
4829
|
+
|
4830
|
+
cancel: function(actionToCancel) {
|
4831
|
+
var queue = this._queue, currentTarget, currentMethod, i, l;
|
4832
|
+
|
4833
|
+
for (i = 0, l = queue.length; i < l; i += 4) {
|
4834
|
+
currentTarget = queue[i];
|
4835
|
+
currentMethod = queue[i+1];
|
4478
4836
|
|
4479
|
-
|
4837
|
+
if (currentTarget === actionToCancel.target && currentMethod === actionToCancel.method) {
|
4838
|
+
queue.splice(i, 4);
|
4839
|
+
return true;
|
4840
|
+
}
|
4841
|
+
}
|
4480
4842
|
}
|
4481
|
-
}
|
4843
|
+
};
|
4482
4844
|
|
4483
|
-
|
4484
|
-
}
|
4845
|
+
__exports__.Queue = Queue;
|
4846
|
+
});
|
4847
|
+
|
4848
|
+
})();
|
4849
|
+
|
4850
|
+
|
4851
|
+
|
4852
|
+
(function() {
|
4853
|
+
var onBegin = function(current) {
|
4854
|
+
Ember.run.currentRunLoop = current;
|
4855
|
+
};
|
4485
4856
|
|
4857
|
+
var onEnd = function(current, next) {
|
4858
|
+
Ember.run.currentRunLoop = next;
|
4486
4859
|
};
|
4487
4860
|
|
4488
|
-
|
4861
|
+
var Backburner = requireModule('backburner').Backburner,
|
4862
|
+
backburner = new Backburner(['sync', 'actions', 'destroy'], {
|
4863
|
+
sync: {
|
4864
|
+
before: Ember.beginPropertyChanges,
|
4865
|
+
after: Ember.endPropertyChanges
|
4866
|
+
},
|
4867
|
+
defaultQueue: 'actions',
|
4868
|
+
onBegin: onBegin,
|
4869
|
+
onEnd: onEnd
|
4870
|
+
}),
|
4871
|
+
slice = [].slice;
|
4489
4872
|
|
4490
4873
|
// ..........................................................
|
4491
4874
|
// Ember.run - this is ideally the only public API the dev sees
|
@@ -4519,20 +4902,76 @@ Ember.RunLoop = RunLoop;
|
|
4519
4902
|
@return {Object} return value from invoking the passed function.
|
4520
4903
|
*/
|
4521
4904
|
Ember.run = function(target, method) {
|
4522
|
-
var
|
4523
|
-
run.begin();
|
4905
|
+
var ret;
|
4524
4906
|
|
4525
|
-
|
4526
|
-
|
4527
|
-
|
4907
|
+
if (Ember.onerror) {
|
4908
|
+
try {
|
4909
|
+
ret = backburner.run.apply(backburner, arguments);
|
4910
|
+
} catch (e) {
|
4911
|
+
Ember.onerror(e);
|
4528
4912
|
}
|
4913
|
+
} else {
|
4914
|
+
ret = backburner.run.apply(backburner, arguments);
|
4529
4915
|
}
|
4530
4916
|
|
4531
|
-
return
|
4917
|
+
return ret;
|
4918
|
+
};
|
4919
|
+
|
4920
|
+
/**
|
4921
|
+
|
4922
|
+
If no run-loop is present, it creates a new one. If a run loop is
|
4923
|
+
present it will queue itself to run on the existing run-loops action
|
4924
|
+
queue.
|
4925
|
+
|
4926
|
+
Please note: This is not for normal usage, and should be used sparingly.
|
4927
|
+
|
4928
|
+
If invoked when not within a run loop:
|
4929
|
+
|
4930
|
+
```javascript
|
4931
|
+
Ember.run.join(function(){
|
4932
|
+
// creates a new run-loop
|
4933
|
+
});
|
4934
|
+
```
|
4935
|
+
|
4936
|
+
Alternatively, if called within an existing run loop:
|
4937
|
+
|
4938
|
+
```javascript
|
4939
|
+
Ember.run(function(){
|
4940
|
+
// creates a new run-loop
|
4941
|
+
Ember.run.join(function(){
|
4942
|
+
// joins with the existing run-loop, and queues for invocation on
|
4943
|
+
// the existing run-loops action queue.
|
4944
|
+
});
|
4945
|
+
});
|
4946
|
+
```
|
4947
|
+
|
4948
|
+
@method join
|
4949
|
+
@namespace Ember
|
4950
|
+
@param {Object} [target] target of method to call
|
4951
|
+
@param {Function|String} method Method to invoke.
|
4952
|
+
May be a function or a string. If you pass a string
|
4953
|
+
then it will be looked up on the passed target.
|
4954
|
+
@param {Object} [args*] Any additional arguments you wish to pass to the method.
|
4955
|
+
@return {Object} return value from invoking the passed function. Please note,
|
4956
|
+
when called within an existing loop, no return value is possible.
|
4957
|
+
*/
|
4958
|
+
Ember.run.join = function(target, method) {
|
4959
|
+
if (!Ember.run.currentRunLoop) {
|
4960
|
+
return Ember.run.apply(Ember.run, arguments);
|
4961
|
+
}
|
4962
|
+
|
4963
|
+
var args = slice.call(arguments);
|
4964
|
+
args.unshift('actions');
|
4965
|
+
Ember.run.schedule.apply(Ember.run, args);
|
4532
4966
|
};
|
4533
4967
|
|
4968
|
+
Ember.run.backburner = backburner;
|
4969
|
+
|
4534
4970
|
var run = Ember.run;
|
4535
4971
|
|
4972
|
+
Ember.run.currentRunLoop = null;
|
4973
|
+
|
4974
|
+
Ember.run.queues = backburner.queueNames;
|
4536
4975
|
|
4537
4976
|
/**
|
4538
4977
|
Begins a new RunLoop. Any deferred actions invoked after the begin will
|
@@ -4549,7 +4988,7 @@ var run = Ember.run;
|
|
4549
4988
|
@return {void}
|
4550
4989
|
*/
|
4551
4990
|
Ember.run.begin = function() {
|
4552
|
-
|
4991
|
+
backburner.begin();
|
4553
4992
|
};
|
4554
4993
|
|
4555
4994
|
/**
|
@@ -4567,12 +5006,7 @@ Ember.run.begin = function() {
|
|
4567
5006
|
@return {void}
|
4568
5007
|
*/
|
4569
5008
|
Ember.run.end = function() {
|
4570
|
-
|
4571
|
-
|
4572
|
-
function tryable() { run.currentRunLoop.end(); }
|
4573
|
-
function finalizer() { run.currentRunLoop = run.currentRunLoop.prev(); }
|
4574
|
-
|
4575
|
-
Ember.tryFinally(tryable, finalizer);
|
5009
|
+
backburner.end();
|
4576
5010
|
};
|
4577
5011
|
|
4578
5012
|
/**
|
@@ -4585,7 +5019,6 @@ Ember.run.end = function() {
|
|
4585
5019
|
@type Array
|
4586
5020
|
@default ['sync', 'actions', 'destroy']
|
4587
5021
|
*/
|
4588
|
-
Ember.run.queues = ['sync', 'actions', 'destroy'];
|
4589
5022
|
|
4590
5023
|
/**
|
4591
5024
|
Adds the passed target/method and any optional arguments to the named
|
@@ -4624,57 +5057,18 @@ Ember.run.queues = ['sync', 'actions', 'destroy'];
|
|
4624
5057
|
@return {void}
|
4625
5058
|
*/
|
4626
5059
|
Ember.run.schedule = function(queue, target, method) {
|
4627
|
-
|
4628
|
-
|
5060
|
+
checkAutoRun();
|
5061
|
+
backburner.schedule.apply(backburner, arguments);
|
4629
5062
|
};
|
4630
5063
|
|
4631
|
-
var scheduledAutorun;
|
4632
|
-
function autorun() {
|
4633
|
-
scheduledAutorun = null;
|
4634
|
-
if (run.currentRunLoop) { run.end(); }
|
4635
|
-
}
|
4636
|
-
|
4637
5064
|
// Used by global test teardown
|
4638
5065
|
Ember.run.hasScheduledTimers = function() {
|
4639
|
-
return
|
5066
|
+
return backburner.hasTimers();
|
4640
5067
|
};
|
4641
5068
|
|
4642
5069
|
// Used by global test teardown
|
4643
5070
|
Ember.run.cancelTimers = function () {
|
4644
|
-
|
4645
|
-
clearTimeout(scheduledAutorun);
|
4646
|
-
scheduledAutorun = null;
|
4647
|
-
}
|
4648
|
-
if (scheduledLater) {
|
4649
|
-
clearTimeout(scheduledLater);
|
4650
|
-
scheduledLater = null;
|
4651
|
-
}
|
4652
|
-
timers = {};
|
4653
|
-
};
|
4654
|
-
|
4655
|
-
/**
|
4656
|
-
Begins a new RunLoop if necessary and schedules a timer to flush the
|
4657
|
-
RunLoop at a later time. This method is used by parts of Ember to
|
4658
|
-
ensure the RunLoop always finishes. You normally do not need to call this
|
4659
|
-
method directly. Instead use `Ember.run()`
|
4660
|
-
|
4661
|
-
@method autorun
|
4662
|
-
@example
|
4663
|
-
Ember.run.autorun();
|
4664
|
-
@return {Ember.RunLoop} the new current RunLoop
|
4665
|
-
*/
|
4666
|
-
Ember.run.autorun = function() {
|
4667
|
-
if (!run.currentRunLoop) {
|
4668
|
-
|
4669
|
-
|
4670
|
-
run.begin();
|
4671
|
-
|
4672
|
-
if (!scheduledAutorun) {
|
4673
|
-
scheduledAutorun = setTimeout(autorun, 1);
|
4674
|
-
}
|
4675
|
-
}
|
4676
|
-
|
4677
|
-
return run.currentRunLoop;
|
5071
|
+
backburner.cancelTimers();
|
4678
5072
|
};
|
4679
5073
|
|
4680
5074
|
/**
|
@@ -4694,42 +5088,9 @@ Ember.run.autorun = function() {
|
|
4694
5088
|
@return {void}
|
4695
5089
|
*/
|
4696
5090
|
Ember.run.sync = function() {
|
4697
|
-
|
4698
|
-
run.currentRunLoop.flush('sync');
|
5091
|
+
backburner.currentInstance.queues.sync.flush();
|
4699
5092
|
};
|
4700
5093
|
|
4701
|
-
// ..........................................................
|
4702
|
-
// TIMERS
|
4703
|
-
//
|
4704
|
-
|
4705
|
-
var timers = {}; // active timers...
|
4706
|
-
|
4707
|
-
var scheduledLater, scheduledLaterExpires;
|
4708
|
-
function invokeLaterTimers() {
|
4709
|
-
scheduledLater = null;
|
4710
|
-
run(function() {
|
4711
|
-
var now = (+ new Date()), earliest = -1;
|
4712
|
-
for (var key in timers) {
|
4713
|
-
if (!timers.hasOwnProperty(key)) { continue; }
|
4714
|
-
var timer = timers[key];
|
4715
|
-
if (timer && timer.expires) {
|
4716
|
-
if (now >= timer.expires) {
|
4717
|
-
delete timers[key];
|
4718
|
-
invoke(timer.target, timer.method, timer.args, 2);
|
4719
|
-
} else {
|
4720
|
-
if (earliest < 0 || (timer.expires < earliest)) { earliest = timer.expires; }
|
4721
|
-
}
|
4722
|
-
}
|
4723
|
-
}
|
4724
|
-
|
4725
|
-
// schedule next timeout to fire when the earliest timer expires
|
4726
|
-
if (earliest > 0) {
|
4727
|
-
scheduledLater = setTimeout(invokeLaterTimers, earliest - now);
|
4728
|
-
scheduledLaterExpires = earliest;
|
4729
|
-
}
|
4730
|
-
});
|
4731
|
-
}
|
4732
|
-
|
4733
5094
|
/**
|
4734
5095
|
Invokes the passed target/method and optional arguments after a specified
|
4735
5096
|
period if time. The last parameter of this method must always be a number
|
@@ -4741,89 +5102,24 @@ function invokeLaterTimers() {
|
|
4741
5102
|
together, which is often more efficient than using a real setTimeout.
|
4742
5103
|
|
4743
5104
|
```javascript
|
4744
|
-
Ember.run.later(myContext, function(){
|
4745
|
-
// code here will execute within a RunLoop in about 500ms with this == myContext
|
4746
|
-
}, 500);
|
4747
|
-
```
|
4748
|
-
|
4749
|
-
@method later
|
4750
|
-
@param {Object} [target] target of method to invoke
|
4751
|
-
@param {Function|String} method The method to invoke.
|
4752
|
-
If you pass a string it will be resolved on the
|
4753
|
-
target at the time the method is invoked.
|
4754
|
-
@param {Object} [args*] Optional arguments to pass to the timeout.
|
4755
|
-
@param {Number} wait Number of milliseconds to wait.
|
4756
|
-
@return {String} a string you can use to cancel the timer in
|
4757
|
-
{{#crossLink "Ember/run.cancel"}}{{/crossLink}} later.
|
4758
|
-
*/
|
4759
|
-
Ember.run.later = function(target, method) {
|
4760
|
-
var args, expires, timer, guid, wait;
|
4761
|
-
|
4762
|
-
// setTimeout compatibility...
|
4763
|
-
if (arguments.length===2 && 'function' === typeof target) {
|
4764
|
-
wait = method;
|
4765
|
-
method = target;
|
4766
|
-
target = undefined;
|
4767
|
-
args = [target, method];
|
4768
|
-
} else {
|
4769
|
-
args = slice.call(arguments);
|
4770
|
-
wait = args.pop();
|
4771
|
-
}
|
4772
|
-
|
4773
|
-
expires = (+ new Date()) + wait;
|
4774
|
-
timer = { target: target, method: method, expires: expires, args: args };
|
4775
|
-
guid = Ember.guidFor(timer);
|
4776
|
-
timers[guid] = timer;
|
4777
|
-
|
4778
|
-
if(scheduledLater && expires < scheduledLaterExpires) {
|
4779
|
-
// Cancel later timer (then reschedule earlier timer below)
|
4780
|
-
clearTimeout(scheduledLater);
|
4781
|
-
scheduledLater = null;
|
4782
|
-
}
|
4783
|
-
|
4784
|
-
if (!scheduledLater) {
|
4785
|
-
// Schedule later timers to be run.
|
4786
|
-
scheduledLater = setTimeout(invokeLaterTimers, wait);
|
4787
|
-
scheduledLaterExpires = expires;
|
4788
|
-
}
|
4789
|
-
|
4790
|
-
return guid;
|
4791
|
-
};
|
4792
|
-
|
4793
|
-
function invokeOnceTimer(guid, onceTimers) {
|
4794
|
-
if (onceTimers[this.tguid]) { delete onceTimers[this.tguid][this.mguid]; }
|
4795
|
-
if (timers[guid]) { invoke(this.target, this.method, this.args); }
|
4796
|
-
delete timers[guid];
|
4797
|
-
}
|
4798
|
-
|
4799
|
-
function scheduleOnce(queue, target, method, args) {
|
4800
|
-
var tguid = Ember.guidFor(target),
|
4801
|
-
mguid = Ember.guidFor(method),
|
4802
|
-
onceTimers = run.autorun().onceTimers,
|
4803
|
-
guid = onceTimers[tguid] && onceTimers[tguid][mguid],
|
4804
|
-
timer;
|
4805
|
-
|
4806
|
-
if (guid && timers[guid]) {
|
4807
|
-
timers[guid].args = args; // replace args
|
4808
|
-
} else {
|
4809
|
-
timer = {
|
4810
|
-
target: target,
|
4811
|
-
method: method,
|
4812
|
-
args: args,
|
4813
|
-
tguid: tguid,
|
4814
|
-
mguid: mguid
|
4815
|
-
};
|
4816
|
-
|
4817
|
-
guid = Ember.guidFor(timer);
|
4818
|
-
timers[guid] = timer;
|
4819
|
-
if (!onceTimers[tguid]) { onceTimers[tguid] = {}; }
|
4820
|
-
onceTimers[tguid][mguid] = guid; // so it isn't scheduled more than once
|
4821
|
-
|
4822
|
-
run.schedule(queue, timer, invokeOnceTimer, guid, onceTimers);
|
4823
|
-
}
|
5105
|
+
Ember.run.later(myContext, function(){
|
5106
|
+
// code here will execute within a RunLoop in about 500ms with this == myContext
|
5107
|
+
}, 500);
|
5108
|
+
```
|
4824
5109
|
|
4825
|
-
|
4826
|
-
}
|
5110
|
+
@method later
|
5111
|
+
@param {Object} [target] target of method to invoke
|
5112
|
+
@param {Function|String} method The method to invoke.
|
5113
|
+
If you pass a string it will be resolved on the
|
5114
|
+
target at the time the method is invoked.
|
5115
|
+
@param {Object} [args*] Optional arguments to pass to the timeout.
|
5116
|
+
@param {Number} wait Number of milliseconds to wait.
|
5117
|
+
@return {String} a string you can use to cancel the timer in
|
5118
|
+
`Ember.run.cancel` later.
|
5119
|
+
*/
|
5120
|
+
Ember.run.later = function(target, method) {
|
5121
|
+
return backburner.later.apply(backburner, arguments);
|
5122
|
+
};
|
4827
5123
|
|
4828
5124
|
/**
|
4829
5125
|
Schedule a function to run one time during the current RunLoop. This is equivalent
|
@@ -4838,7 +5134,10 @@ function scheduleOnce(queue, target, method, args) {
|
|
4838
5134
|
@return {Object} timer
|
4839
5135
|
*/
|
4840
5136
|
Ember.run.once = function(target, method) {
|
4841
|
-
|
5137
|
+
checkAutoRun();
|
5138
|
+
var args = slice.call(arguments);
|
5139
|
+
args.unshift('actions');
|
5140
|
+
return backburner.scheduleOnce.apply(backburner, args);
|
4842
5141
|
};
|
4843
5142
|
|
4844
5143
|
/**
|
@@ -4886,12 +5185,13 @@ Ember.run.once = function(target, method) {
|
|
4886
5185
|
@return {Object} timer
|
4887
5186
|
*/
|
4888
5187
|
Ember.run.scheduleOnce = function(queue, target, method) {
|
4889
|
-
|
5188
|
+
checkAutoRun();
|
5189
|
+
return backburner.scheduleOnce.apply(backburner, arguments);
|
4890
5190
|
};
|
4891
5191
|
|
4892
5192
|
/**
|
4893
|
-
Schedules an item to run from within a separate run loop, after
|
4894
|
-
control has been returned to the system. This is equivalent to calling
|
5193
|
+
Schedules an item to run from within a separate run loop, after
|
5194
|
+
control has been returned to the system. This is equivalent to calling
|
4895
5195
|
`Ember.run.later` with a wait time of 1ms.
|
4896
5196
|
|
4897
5197
|
```javascript
|
@@ -4903,7 +5203,7 @@ Ember.run.scheduleOnce = function(queue, target, method) {
|
|
4903
5203
|
Multiple operations scheduled with `Ember.run.next` will coalesce
|
4904
5204
|
into the same later run loop, along with any other operations
|
4905
5205
|
scheduled by `Ember.run.later` that expire right around the same
|
4906
|
-
time that `Ember.run.next` operations will fire.
|
5206
|
+
time that `Ember.run.next` operations will fire.
|
4907
5207
|
|
4908
5208
|
Note that there are often alternatives to using `Ember.run.next`.
|
4909
5209
|
For instance, if you'd like to schedule an operation to happen
|
@@ -4929,13 +5229,13 @@ Ember.run.scheduleOnce = function(queue, target, method) {
|
|
4929
5229
|
|
4930
5230
|
One benefit of the above approach compared to using `Ember.run.next` is
|
4931
5231
|
that you will be able to perform DOM/CSS operations before unprocessed
|
4932
|
-
elements are rendered to the screen, which may prevent flickering or
|
5232
|
+
elements are rendered to the screen, which may prevent flickering or
|
4933
5233
|
other artifacts caused by delaying processing until after rendering.
|
4934
5234
|
|
4935
|
-
The other major benefit to the above approach is that `Ember.run.next`
|
4936
|
-
introduces an element of non-determinism, which can make things much
|
4937
|
-
harder to test, due to its reliance on `setTimeout`; it's much harder
|
4938
|
-
to guarantee the order of scheduled operations when they are scheduled
|
5235
|
+
The other major benefit to the above approach is that `Ember.run.next`
|
5236
|
+
introduces an element of non-determinism, which can make things much
|
5237
|
+
harder to test, due to its reliance on `setTimeout`; it's much harder
|
5238
|
+
to guarantee the order of scheduled operations when they are scheduled
|
4939
5239
|
outside of the current run loop, i.e. with `Ember.run.next`.
|
4940
5240
|
|
4941
5241
|
@method next
|
@@ -4948,8 +5248,8 @@ Ember.run.scheduleOnce = function(queue, target, method) {
|
|
4948
5248
|
*/
|
4949
5249
|
Ember.run.next = function() {
|
4950
5250
|
var args = slice.call(arguments);
|
4951
|
-
args.push(1);
|
4952
|
-
return
|
5251
|
+
args.push(1);
|
5252
|
+
return backburner.later.apply(backburner, args);
|
4953
5253
|
};
|
4954
5254
|
|
4955
5255
|
/**
|
@@ -4978,9 +5278,16 @@ Ember.run.next = function() {
|
|
4978
5278
|
@return {void}
|
4979
5279
|
*/
|
4980
5280
|
Ember.run.cancel = function(timer) {
|
4981
|
-
|
5281
|
+
return backburner.cancel(timer);
|
4982
5282
|
};
|
4983
5283
|
|
5284
|
+
// Make sure it's not an autorun during testing
|
5285
|
+
function checkAutoRun() {
|
5286
|
+
if (!Ember.run.currentRunLoop) {
|
5287
|
+
|
5288
|
+
}
|
5289
|
+
}
|
5290
|
+
|
4984
5291
|
})();
|
4985
5292
|
|
4986
5293
|
|
@@ -5265,7 +5572,7 @@ function mixinProperties(to, from) {
|
|
5265
5572
|
mixinProperties(Binding, {
|
5266
5573
|
|
5267
5574
|
/**
|
5268
|
-
See
|
5575
|
+
See `Ember.Binding.from`.
|
5269
5576
|
|
5270
5577
|
@method from
|
5271
5578
|
@static
|
@@ -5276,7 +5583,7 @@ mixinProperties(Binding, {
|
|
5276
5583
|
},
|
5277
5584
|
|
5278
5585
|
/**
|
5279
|
-
See
|
5586
|
+
See `Ember.Binding.to`.
|
5280
5587
|
|
5281
5588
|
@method to
|
5282
5589
|
@static
|
@@ -5293,7 +5600,7 @@ mixinProperties(Binding, {
|
|
5293
5600
|
This means that if you change the "to" side directly, the "from" side may have
|
5294
5601
|
a different value.
|
5295
5602
|
|
5296
|
-
See
|
5603
|
+
See `Binding.oneWay`.
|
5297
5604
|
|
5298
5605
|
@method oneWay
|
5299
5606
|
@param {String} from from path.
|
@@ -5354,7 +5661,7 @@ mixinProperties(Binding, {
|
|
5354
5661
|
|
5355
5662
|
You should consider using one way bindings anytime you have an object that
|
5356
5663
|
may be created frequently and you do not intend to change a property; only
|
5357
|
-
to monitor it for changes
|
5664
|
+
to monitor it for changes (such as in the example above).
|
5358
5665
|
|
5359
5666
|
## Adding Bindings Manually
|
5360
5667
|
|
@@ -5655,14 +5962,6 @@ function mergeMixins(mixins, m, descs, values, base, keys) {
|
|
5655
5962
|
}
|
5656
5963
|
}
|
5657
5964
|
|
5658
|
-
function writableReq(obj) {
|
5659
|
-
var m = Ember.meta(obj), req = m.required;
|
5660
|
-
if (!req || !m.hasOwnProperty('required')) {
|
5661
|
-
req = m.required = req ? o_create(req) : {};
|
5662
|
-
}
|
5663
|
-
return req;
|
5664
|
-
}
|
5665
|
-
|
5666
5965
|
var IS_BINDING = Ember.IS_BINDING = /^.+Binding$/;
|
5667
5966
|
|
5668
5967
|
function detectBinding(obj, key, value, m) {
|
@@ -6148,14 +6447,57 @@ Ember Metal
|
|
6148
6447
|
})();
|
6149
6448
|
|
6150
6449
|
(function() {
|
6151
|
-
define("rsvp",
|
6152
|
-
[],
|
6153
|
-
function() {
|
6450
|
+
define("rsvp/all",
|
6451
|
+
["rsvp/defer","exports"],
|
6452
|
+
function(__dependency1__, __exports__) {
|
6453
|
+
"use strict";
|
6454
|
+
var defer = __dependency1__.defer;
|
6455
|
+
|
6456
|
+
function all(promises) {
|
6457
|
+
var results = [], deferred = defer(), remaining = promises.length;
|
6458
|
+
|
6459
|
+
if (remaining === 0) {
|
6460
|
+
deferred.resolve([]);
|
6461
|
+
}
|
6462
|
+
|
6463
|
+
var resolver = function(index) {
|
6464
|
+
return function(value) {
|
6465
|
+
resolveAll(index, value);
|
6466
|
+
};
|
6467
|
+
};
|
6468
|
+
|
6469
|
+
var resolveAll = function(index, value) {
|
6470
|
+
results[index] = value;
|
6471
|
+
if (--remaining === 0) {
|
6472
|
+
deferred.resolve(results);
|
6473
|
+
}
|
6474
|
+
};
|
6475
|
+
|
6476
|
+
var rejectAll = function(error) {
|
6477
|
+
deferred.reject(error);
|
6478
|
+
};
|
6479
|
+
|
6480
|
+
for (var i = 0; i < promises.length; i++) {
|
6481
|
+
if (promises[i] && typeof promises[i].then === 'function') {
|
6482
|
+
promises[i].then(resolver(i), rejectAll);
|
6483
|
+
} else {
|
6484
|
+
resolveAll(i, promises[i]);
|
6485
|
+
}
|
6486
|
+
}
|
6487
|
+
return deferred.promise;
|
6488
|
+
}
|
6489
|
+
|
6490
|
+
__exports__.all = all;
|
6491
|
+
});
|
6492
|
+
|
6493
|
+
define("rsvp/async",
|
6494
|
+
["exports"],
|
6495
|
+
function(__exports__) {
|
6154
6496
|
"use strict";
|
6155
6497
|
var browserGlobal = (typeof window !== 'undefined') ? window : {};
|
6156
6498
|
|
6157
|
-
var
|
6158
|
-
var
|
6499
|
+
var BrowserMutationObserver = browserGlobal.MutationObserver || browserGlobal.WebKitMutationObserver;
|
6500
|
+
var async;
|
6159
6501
|
|
6160
6502
|
if (typeof process !== 'undefined' &&
|
6161
6503
|
{}.toString.call(process) === '[object process]') {
|
@@ -6164,10 +6506,10 @@ define("rsvp",
|
|
6164
6506
|
callback.call(binding);
|
6165
6507
|
});
|
6166
6508
|
};
|
6167
|
-
} else if (
|
6509
|
+
} else if (BrowserMutationObserver) {
|
6168
6510
|
var queue = [];
|
6169
6511
|
|
6170
|
-
var observer = new
|
6512
|
+
var observer = new BrowserMutationObserver(function() {
|
6171
6513
|
var toProcess = queue.slice();
|
6172
6514
|
queue = [];
|
6173
6515
|
|
@@ -6198,6 +6540,47 @@ define("rsvp",
|
|
6198
6540
|
};
|
6199
6541
|
}
|
6200
6542
|
|
6543
|
+
|
6544
|
+
__exports__.async = async;
|
6545
|
+
});
|
6546
|
+
|
6547
|
+
define("rsvp/config",
|
6548
|
+
["rsvp/async","exports"],
|
6549
|
+
function(__dependency1__, __exports__) {
|
6550
|
+
"use strict";
|
6551
|
+
var async = __dependency1__.async;
|
6552
|
+
|
6553
|
+
var config = {};
|
6554
|
+
config.async = async;
|
6555
|
+
|
6556
|
+
__exports__.config = config;
|
6557
|
+
});
|
6558
|
+
|
6559
|
+
define("rsvp/defer",
|
6560
|
+
["rsvp/promise","exports"],
|
6561
|
+
function(__dependency1__, __exports__) {
|
6562
|
+
"use strict";
|
6563
|
+
var Promise = __dependency1__.Promise;
|
6564
|
+
|
6565
|
+
function defer() {
|
6566
|
+
var deferred = {};
|
6567
|
+
|
6568
|
+
var promise = new Promise(function(resolve, reject) {
|
6569
|
+
deferred.resolve = resolve;
|
6570
|
+
deferred.reject = reject;
|
6571
|
+
});
|
6572
|
+
|
6573
|
+
deferred.promise = promise;
|
6574
|
+
return deferred;
|
6575
|
+
}
|
6576
|
+
|
6577
|
+
__exports__.defer = defer;
|
6578
|
+
});
|
6579
|
+
|
6580
|
+
define("rsvp/events",
|
6581
|
+
["exports"],
|
6582
|
+
function(__exports__) {
|
6583
|
+
"use strict";
|
6201
6584
|
var Event = function(type, options) {
|
6202
6585
|
this.type = type;
|
6203
6586
|
|
@@ -6292,7 +6675,148 @@ define("rsvp",
|
|
6292
6675
|
}
|
6293
6676
|
};
|
6294
6677
|
|
6295
|
-
|
6678
|
+
|
6679
|
+
__exports__.EventTarget = EventTarget;
|
6680
|
+
});
|
6681
|
+
|
6682
|
+
define("rsvp/hash",
|
6683
|
+
["rsvp/defer","exports"],
|
6684
|
+
function(__dependency1__, __exports__) {
|
6685
|
+
"use strict";
|
6686
|
+
var defer = __dependency1__.defer;
|
6687
|
+
|
6688
|
+
function size(object) {
|
6689
|
+
var size = 0;
|
6690
|
+
|
6691
|
+
for (var prop in object) {
|
6692
|
+
size++;
|
6693
|
+
}
|
6694
|
+
|
6695
|
+
return size;
|
6696
|
+
}
|
6697
|
+
|
6698
|
+
function hash(promises) {
|
6699
|
+
var results = {}, deferred = defer(), remaining = size(promises);
|
6700
|
+
|
6701
|
+
if (remaining === 0) {
|
6702
|
+
deferred.resolve({});
|
6703
|
+
}
|
6704
|
+
|
6705
|
+
var resolver = function(prop) {
|
6706
|
+
return function(value) {
|
6707
|
+
resolveAll(prop, value);
|
6708
|
+
};
|
6709
|
+
};
|
6710
|
+
|
6711
|
+
var resolveAll = function(prop, value) {
|
6712
|
+
results[prop] = value;
|
6713
|
+
if (--remaining === 0) {
|
6714
|
+
deferred.resolve(results);
|
6715
|
+
}
|
6716
|
+
};
|
6717
|
+
|
6718
|
+
var rejectAll = function(error) {
|
6719
|
+
deferred.reject(error);
|
6720
|
+
};
|
6721
|
+
|
6722
|
+
for (var prop in promises) {
|
6723
|
+
if (promises[prop] && typeof promises[prop].then === 'function') {
|
6724
|
+
promises[prop].then(resolver(prop), rejectAll);
|
6725
|
+
} else {
|
6726
|
+
resolveAll(prop, promises[prop]);
|
6727
|
+
}
|
6728
|
+
}
|
6729
|
+
|
6730
|
+
return deferred.promise;
|
6731
|
+
}
|
6732
|
+
|
6733
|
+
__exports__.hash = hash;
|
6734
|
+
});
|
6735
|
+
|
6736
|
+
define("rsvp/node",
|
6737
|
+
["rsvp/promise","rsvp/all","exports"],
|
6738
|
+
function(__dependency1__, __dependency2__, __exports__) {
|
6739
|
+
"use strict";
|
6740
|
+
var Promise = __dependency1__.Promise;
|
6741
|
+
var all = __dependency2__.all;
|
6742
|
+
|
6743
|
+
function makeNodeCallbackFor(resolve, reject) {
|
6744
|
+
return function (error, value) {
|
6745
|
+
if (error) {
|
6746
|
+
reject(error);
|
6747
|
+
} else if (arguments.length > 2) {
|
6748
|
+
resolve(Array.prototype.slice.call(arguments, 1));
|
6749
|
+
} else {
|
6750
|
+
resolve(value);
|
6751
|
+
}
|
6752
|
+
};
|
6753
|
+
}
|
6754
|
+
|
6755
|
+
function denodeify(nodeFunc) {
|
6756
|
+
return function() {
|
6757
|
+
var nodeArgs = Array.prototype.slice.call(arguments), resolve, reject;
|
6758
|
+
|
6759
|
+
var promise = new Promise(function(nodeResolve, nodeReject) {
|
6760
|
+
resolve = nodeResolve;
|
6761
|
+
reject = nodeReject;
|
6762
|
+
});
|
6763
|
+
|
6764
|
+
all(nodeArgs).then(function(nodeArgs) {
|
6765
|
+
nodeArgs.push(makeNodeCallbackFor(resolve, reject));
|
6766
|
+
|
6767
|
+
try {
|
6768
|
+
nodeFunc.apply(this, nodeArgs);
|
6769
|
+
} catch(e) {
|
6770
|
+
reject(e);
|
6771
|
+
}
|
6772
|
+
});
|
6773
|
+
|
6774
|
+
return promise;
|
6775
|
+
};
|
6776
|
+
}
|
6777
|
+
|
6778
|
+
__exports__.denodeify = denodeify;
|
6779
|
+
});
|
6780
|
+
|
6781
|
+
define("rsvp/promise",
|
6782
|
+
["rsvp/config","rsvp/events","exports"],
|
6783
|
+
function(__dependency1__, __dependency2__, __exports__) {
|
6784
|
+
"use strict";
|
6785
|
+
var config = __dependency1__.config;
|
6786
|
+
var EventTarget = __dependency2__.EventTarget;
|
6787
|
+
|
6788
|
+
function objectOrFunction(x) {
|
6789
|
+
return isFunction(x) || (typeof x === "object" && x !== null);
|
6790
|
+
}
|
6791
|
+
|
6792
|
+
function isFunction(x){
|
6793
|
+
return typeof x === "function";
|
6794
|
+
}
|
6795
|
+
|
6796
|
+
var Promise = function(resolver) {
|
6797
|
+
var promise = this,
|
6798
|
+
resolved = false;
|
6799
|
+
|
6800
|
+
if (typeof resolver !== 'function') {
|
6801
|
+
throw new TypeError('You must pass a resolver function as the sole argument to the promise constructor');
|
6802
|
+
}
|
6803
|
+
|
6804
|
+
if (!(promise instanceof Promise)) {
|
6805
|
+
return new Promise(resolver);
|
6806
|
+
}
|
6807
|
+
|
6808
|
+
var resolvePromise = function(value) {
|
6809
|
+
if (resolved) { return; }
|
6810
|
+
resolved = true;
|
6811
|
+
resolve(promise, value);
|
6812
|
+
};
|
6813
|
+
|
6814
|
+
var rejectPromise = function(value) {
|
6815
|
+
if (resolved) { return; }
|
6816
|
+
resolved = true;
|
6817
|
+
reject(promise, value);
|
6818
|
+
};
|
6819
|
+
|
6296
6820
|
this.on('promise:resolved', function(event) {
|
6297
6821
|
this.trigger('success', { detail: event.detail });
|
6298
6822
|
}, this);
|
@@ -6300,12 +6824,16 @@ define("rsvp",
|
|
6300
6824
|
this.on('promise:failed', function(event) {
|
6301
6825
|
this.trigger('error', { detail: event.detail });
|
6302
6826
|
}, this);
|
6303
|
-
};
|
6304
6827
|
|
6305
|
-
|
6828
|
+
try {
|
6829
|
+
resolver(resolvePromise, rejectPromise);
|
6830
|
+
} catch(e) {
|
6831
|
+
rejectPromise(e);
|
6832
|
+
}
|
6833
|
+
};
|
6306
6834
|
|
6307
6835
|
var invokeCallback = function(type, promise, callback, event) {
|
6308
|
-
var hasCallback =
|
6836
|
+
var hasCallback = isFunction(callback),
|
6309
6837
|
value, error, succeeded, failed;
|
6310
6838
|
|
6311
6839
|
if (hasCallback) {
|
@@ -6321,34 +6849,34 @@ define("rsvp",
|
|
6321
6849
|
succeeded = true;
|
6322
6850
|
}
|
6323
6851
|
|
6324
|
-
if (
|
6325
|
-
|
6326
|
-
promise.resolve(value);
|
6327
|
-
}, function(error) {
|
6328
|
-
promise.reject(error);
|
6329
|
-
});
|
6852
|
+
if (handleThenable(promise, value)) {
|
6853
|
+
return;
|
6330
6854
|
} else if (hasCallback && succeeded) {
|
6331
|
-
|
6855
|
+
resolve(promise, value);
|
6332
6856
|
} else if (failed) {
|
6333
|
-
|
6334
|
-
} else {
|
6335
|
-
promise
|
6857
|
+
reject(promise, error);
|
6858
|
+
} else if (type === 'resolve') {
|
6859
|
+
resolve(promise, value);
|
6860
|
+
} else if (type === 'reject') {
|
6861
|
+
reject(promise, value);
|
6336
6862
|
}
|
6337
6863
|
};
|
6338
6864
|
|
6339
6865
|
Promise.prototype = {
|
6866
|
+
constructor: Promise,
|
6867
|
+
|
6340
6868
|
then: function(done, fail) {
|
6341
|
-
var thenPromise = new Promise();
|
6869
|
+
var thenPromise = new Promise(function() {});
|
6342
6870
|
|
6343
|
-
if (this.
|
6344
|
-
|
6345
|
-
invokeCallback('resolve', thenPromise, done, { detail: this.
|
6871
|
+
if (this.isFulfilled) {
|
6872
|
+
config.async(function() {
|
6873
|
+
invokeCallback('resolve', thenPromise, done, { detail: this.fulfillmentValue });
|
6346
6874
|
}, this);
|
6347
6875
|
}
|
6348
6876
|
|
6349
6877
|
if (this.isRejected) {
|
6350
|
-
|
6351
|
-
invokeCallback('reject', thenPromise, fail, { detail: this.
|
6878
|
+
config.async(function() {
|
6879
|
+
invokeCallback('reject', thenPromise, fail, { detail: this.rejectedReason });
|
6352
6880
|
}, this);
|
6353
6881
|
}
|
6354
6882
|
|
@@ -6361,75 +6889,162 @@ define("rsvp",
|
|
6361
6889
|
});
|
6362
6890
|
|
6363
6891
|
return thenPromise;
|
6364
|
-
}
|
6892
|
+
}
|
6893
|
+
};
|
6365
6894
|
|
6366
|
-
|
6367
|
-
resolve(this, value);
|
6895
|
+
EventTarget.mixin(Promise.prototype);
|
6368
6896
|
|
6369
|
-
|
6370
|
-
|
6371
|
-
|
6897
|
+
function resolve(promise, value) {
|
6898
|
+
if (promise === value) {
|
6899
|
+
fulfill(promise, value);
|
6900
|
+
} else if (!handleThenable(promise, value)) {
|
6901
|
+
fulfill(promise, value);
|
6902
|
+
}
|
6903
|
+
}
|
6904
|
+
|
6905
|
+
function handleThenable(promise, value) {
|
6906
|
+
var then = null;
|
6372
6907
|
|
6373
|
-
|
6374
|
-
|
6908
|
+
if (objectOrFunction(value)) {
|
6909
|
+
try {
|
6910
|
+
then = value.then;
|
6911
|
+
} catch(e) {
|
6912
|
+
reject(promise, e);
|
6913
|
+
return true;
|
6914
|
+
}
|
6375
6915
|
|
6376
|
-
|
6377
|
-
|
6916
|
+
if (isFunction(then)) {
|
6917
|
+
try {
|
6918
|
+
then.call(value, function(val) {
|
6919
|
+
if (value !== val) {
|
6920
|
+
resolve(promise, val);
|
6921
|
+
} else {
|
6922
|
+
fulfill(promise, val);
|
6923
|
+
}
|
6924
|
+
}, function(val) {
|
6925
|
+
reject(promise, val);
|
6926
|
+
});
|
6927
|
+
} catch (e) {
|
6928
|
+
reject(promise, e);
|
6929
|
+
}
|
6930
|
+
return true;
|
6931
|
+
}
|
6378
6932
|
}
|
6379
|
-
};
|
6380
6933
|
|
6381
|
-
|
6382
|
-
|
6934
|
+
return false;
|
6935
|
+
}
|
6936
|
+
|
6937
|
+
function fulfill(promise, value) {
|
6938
|
+
config.async(function() {
|
6383
6939
|
promise.trigger('promise:resolved', { detail: value });
|
6384
|
-
promise.
|
6385
|
-
promise.
|
6940
|
+
promise.isFulfilled = true;
|
6941
|
+
promise.fulfillmentValue = value;
|
6386
6942
|
});
|
6387
6943
|
}
|
6388
6944
|
|
6389
6945
|
function reject(promise, value) {
|
6390
|
-
|
6946
|
+
config.async(function() {
|
6391
6947
|
promise.trigger('promise:failed', { detail: value });
|
6392
6948
|
promise.isRejected = true;
|
6393
|
-
promise.
|
6949
|
+
promise.rejectedReason = value;
|
6394
6950
|
});
|
6395
6951
|
}
|
6396
6952
|
|
6397
|
-
function all(promises) {
|
6398
|
-
var i, results = [];
|
6399
|
-
var allPromise = new Promise();
|
6400
|
-
var remaining = promises.length;
|
6401
6953
|
|
6402
|
-
|
6403
|
-
|
6404
|
-
}
|
6954
|
+
__exports__.Promise = Promise;
|
6955
|
+
});
|
6405
6956
|
|
6406
|
-
|
6407
|
-
|
6408
|
-
|
6409
|
-
|
6410
|
-
|
6957
|
+
define("rsvp/reject",
|
6958
|
+
["rsvp/promise","exports"],
|
6959
|
+
function(__dependency1__, __exports__) {
|
6960
|
+
"use strict";
|
6961
|
+
var Promise = __dependency1__.Promise;
|
6411
6962
|
|
6412
|
-
var resolve = function(index, value) {
|
6413
|
-
results[index] = value;
|
6414
|
-
if (--remaining === 0) {
|
6415
|
-
allPromise.resolve(results);
|
6416
|
-
}
|
6417
|
-
};
|
6418
6963
|
|
6419
|
-
|
6420
|
-
|
6421
|
-
|
6964
|
+
function objectOrFunction(x) {
|
6965
|
+
return typeof x === "function" || (typeof x === "object" && x !== null);
|
6966
|
+
}
|
6422
6967
|
|
6423
|
-
|
6424
|
-
|
6425
|
-
|
6426
|
-
|
6968
|
+
|
6969
|
+
function reject(reason) {
|
6970
|
+
return new Promise(function (resolve, reject) {
|
6971
|
+
reject(reason);
|
6972
|
+
});
|
6427
6973
|
}
|
6428
6974
|
|
6429
|
-
EventTarget.mixin(Promise.prototype);
|
6430
6975
|
|
6431
|
-
|
6432
|
-
|
6976
|
+
__exports__.reject = reject;
|
6977
|
+
});
|
6978
|
+
|
6979
|
+
define("rsvp/resolve",
|
6980
|
+
["rsvp/promise","exports"],
|
6981
|
+
function(__dependency1__, __exports__) {
|
6982
|
+
"use strict";
|
6983
|
+
var Promise = __dependency1__.Promise;
|
6984
|
+
|
6985
|
+
|
6986
|
+
function objectOrFunction(x) {
|
6987
|
+
return typeof x === "function" || (typeof x === "object" && x !== null);
|
6988
|
+
}
|
6989
|
+
|
6990
|
+
function resolve(thenable){
|
6991
|
+
var promise = new Promise(function(resolve, reject){
|
6992
|
+
var then;
|
6993
|
+
|
6994
|
+
try {
|
6995
|
+
if ( objectOrFunction(thenable) ) {
|
6996
|
+
then = thenable.then;
|
6997
|
+
|
6998
|
+
if (typeof then === "function") {
|
6999
|
+
then.call(thenable, resolve, reject);
|
7000
|
+
} else {
|
7001
|
+
resolve(thenable);
|
7002
|
+
}
|
7003
|
+
|
7004
|
+
} else {
|
7005
|
+
resolve(thenable);
|
7006
|
+
}
|
7007
|
+
|
7008
|
+
} catch(error) {
|
7009
|
+
reject(error);
|
7010
|
+
}
|
7011
|
+
});
|
7012
|
+
|
7013
|
+
return promise;
|
7014
|
+
}
|
7015
|
+
|
7016
|
+
|
7017
|
+
__exports__.resolve = resolve;
|
7018
|
+
});
|
7019
|
+
|
7020
|
+
define("rsvp",
|
7021
|
+
["rsvp/events","rsvp/promise","rsvp/node","rsvp/all","rsvp/hash","rsvp/defer","rsvp/config","rsvp/resolve","rsvp/reject","exports"],
|
7022
|
+
function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __dependency5__, __dependency6__, __dependency7__, __dependency8__, __dependency9__, __exports__) {
|
7023
|
+
"use strict";
|
7024
|
+
var EventTarget = __dependency1__.EventTarget;
|
7025
|
+
var Promise = __dependency2__.Promise;
|
7026
|
+
var denodeify = __dependency3__.denodeify;
|
7027
|
+
var all = __dependency4__.all;
|
7028
|
+
var hash = __dependency5__.hash;
|
7029
|
+
var defer = __dependency6__.defer;
|
7030
|
+
var config = __dependency7__.config;
|
7031
|
+
var resolve = __dependency8__.resolve;
|
7032
|
+
var reject = __dependency9__.reject;
|
7033
|
+
|
7034
|
+
function configure(name, value) {
|
7035
|
+
config[name] = value;
|
7036
|
+
}
|
7037
|
+
|
7038
|
+
|
7039
|
+
__exports__.Promise = Promise;
|
7040
|
+
__exports__.EventTarget = EventTarget;
|
7041
|
+
__exports__.all = all;
|
7042
|
+
__exports__.hash = hash;
|
7043
|
+
__exports__.defer = defer;
|
7044
|
+
__exports__.denodeify = denodeify;
|
7045
|
+
__exports__.configure = configure;
|
7046
|
+
__exports__.resolve = resolve;
|
7047
|
+
__exports__.reject = reject;
|
6433
7048
|
});
|
6434
7049
|
|
6435
7050
|
})();
|
@@ -6605,10 +7220,6 @@ define("container",
|
|
6605
7220
|
|
6606
7221
|
this.children = [];
|
6607
7222
|
|
6608
|
-
eachDestroyable(this, function(item) {
|
6609
|
-
item.isDestroying = true;
|
6610
|
-
});
|
6611
|
-
|
6612
7223
|
eachDestroyable(this, function(item) {
|
6613
7224
|
item.destroy();
|
6614
7225
|
});
|
@@ -6979,10 +7590,15 @@ Ember.ORDER_DEFINITION = Ember.ENV.ORDER_DEFINITION || [
|
|
6979
7590
|
*/
|
6980
7591
|
Ember.keys = Object.keys;
|
6981
7592
|
|
6982
|
-
if (!Ember.keys) {
|
7593
|
+
if (!Ember.keys || Ember.create.isSimulated) {
|
6983
7594
|
Ember.keys = function(obj) {
|
6984
7595
|
var ret = [];
|
6985
7596
|
for(var key in obj) {
|
7597
|
+
// Prevents browsers that don't respect non-enumerability from
|
7598
|
+
// copying internal Ember properties
|
7599
|
+
if (key.substring(0,2) === '__') continue;
|
7600
|
+
if (key === '_super') continue;
|
7601
|
+
|
6986
7602
|
if (obj.hasOwnProperty(key)) { ret.push(key); }
|
6987
7603
|
}
|
6988
7604
|
return ret;
|
@@ -7004,7 +7620,7 @@ var errorProps = ['description', 'fileName', 'lineNumber', 'message', 'name', 'n
|
|
7004
7620
|
@constructor
|
7005
7621
|
*/
|
7006
7622
|
Ember.Error = function() {
|
7007
|
-
var tmp = Error.
|
7623
|
+
var tmp = Error.apply(this, arguments);
|
7008
7624
|
|
7009
7625
|
// Unfortunately errors are not enumerable in Chrome (at least), so `for prop in tmp` doesn't work.
|
7010
7626
|
for (var idx = 0; idx < errorProps.length; idx++) {
|
@@ -7266,10 +7882,12 @@ Ember.String = {
|
|
7266
7882
|
/**
|
7267
7883
|
Returns the Capitalized form of a string
|
7268
7884
|
|
7269
|
-
|
7270
|
-
|
7271
|
-
|
7272
|
-
|
7885
|
+
```javascript
|
7886
|
+
'innerHTML'.capitalize() // 'InnerHTML'
|
7887
|
+
'action_name'.capitalize() // 'Action_name'
|
7888
|
+
'css-class-name'.capitalize() // 'Css-class-name'
|
7889
|
+
'my favorite items'.capitalize() // 'My favorite items'
|
7890
|
+
```
|
7273
7891
|
|
7274
7892
|
@method capitalize
|
7275
7893
|
@param {String} str
|
@@ -7306,7 +7924,7 @@ var fmt = Ember.String.fmt,
|
|
7306
7924
|
if (Ember.EXTEND_PROTOTYPES === true || Ember.EXTEND_PROTOTYPES.String) {
|
7307
7925
|
|
7308
7926
|
/**
|
7309
|
-
See
|
7927
|
+
See `Ember.String.fmt`.
|
7310
7928
|
|
7311
7929
|
@method fmt
|
7312
7930
|
@for String
|
@@ -7316,7 +7934,7 @@ if (Ember.EXTEND_PROTOTYPES === true || Ember.EXTEND_PROTOTYPES.String) {
|
|
7316
7934
|
};
|
7317
7935
|
|
7318
7936
|
/**
|
7319
|
-
See
|
7937
|
+
See `Ember.String.w`.
|
7320
7938
|
|
7321
7939
|
@method w
|
7322
7940
|
@for String
|
@@ -7326,7 +7944,7 @@ if (Ember.EXTEND_PROTOTYPES === true || Ember.EXTEND_PROTOTYPES.String) {
|
|
7326
7944
|
};
|
7327
7945
|
|
7328
7946
|
/**
|
7329
|
-
See
|
7947
|
+
See `Ember.String.loc`.
|
7330
7948
|
|
7331
7949
|
@method loc
|
7332
7950
|
@for String
|
@@ -7336,7 +7954,7 @@ if (Ember.EXTEND_PROTOTYPES === true || Ember.EXTEND_PROTOTYPES.String) {
|
|
7336
7954
|
};
|
7337
7955
|
|
7338
7956
|
/**
|
7339
|
-
See
|
7957
|
+
See `Ember.String.camelize`.
|
7340
7958
|
|
7341
7959
|
@method camelize
|
7342
7960
|
@for String
|
@@ -7346,7 +7964,7 @@ if (Ember.EXTEND_PROTOTYPES === true || Ember.EXTEND_PROTOTYPES.String) {
|
|
7346
7964
|
};
|
7347
7965
|
|
7348
7966
|
/**
|
7349
|
-
See
|
7967
|
+
See `Ember.String.decamelize`.
|
7350
7968
|
|
7351
7969
|
@method decamelize
|
7352
7970
|
@for String
|
@@ -7356,7 +7974,7 @@ if (Ember.EXTEND_PROTOTYPES === true || Ember.EXTEND_PROTOTYPES.String) {
|
|
7356
7974
|
};
|
7357
7975
|
|
7358
7976
|
/**
|
7359
|
-
See
|
7977
|
+
See `Ember.String.dasherize`.
|
7360
7978
|
|
7361
7979
|
@method dasherize
|
7362
7980
|
@for String
|
@@ -7366,7 +7984,7 @@ if (Ember.EXTEND_PROTOTYPES === true || Ember.EXTEND_PROTOTYPES.String) {
|
|
7366
7984
|
};
|
7367
7985
|
|
7368
7986
|
/**
|
7369
|
-
See
|
7987
|
+
See `Ember.String.underscore`.
|
7370
7988
|
|
7371
7989
|
@method underscore
|
7372
7990
|
@for String
|
@@ -7376,7 +7994,7 @@ if (Ember.EXTEND_PROTOTYPES === true || Ember.EXTEND_PROTOTYPES.String) {
|
|
7376
7994
|
};
|
7377
7995
|
|
7378
7996
|
/**
|
7379
|
-
See
|
7997
|
+
See `Ember.String.classify`.
|
7380
7998
|
|
7381
7999
|
@method classify
|
7382
8000
|
@for String
|
@@ -7386,7 +8004,7 @@ if (Ember.EXTEND_PROTOTYPES === true || Ember.EXTEND_PROTOTYPES.String) {
|
|
7386
8004
|
};
|
7387
8005
|
|
7388
8006
|
/**
|
7389
|
-
See
|
8007
|
+
See `Ember.String.capitalize`.
|
7390
8008
|
|
7391
8009
|
@method capitalize
|
7392
8010
|
@for String
|
@@ -7462,8 +8080,7 @@ if (Ember.EXTEND_PROTOTYPES === true || Ember.EXTEND_PROTOTYPES.Function) {
|
|
7462
8080
|
will instead clear the cache so that it is updated when the next `get`
|
7463
8081
|
is called on the property.
|
7464
8082
|
|
7465
|
-
See
|
7466
|
-
{{#crossLink "Ember/computed"}}{{/crossLink}}
|
8083
|
+
See `Ember.ComputedProperty`, `Ember.computed`.
|
7467
8084
|
|
7468
8085
|
@method property
|
7469
8086
|
@for Function
|
@@ -7490,7 +8107,7 @@ if (Ember.EXTEND_PROTOTYPES === true || Ember.EXTEND_PROTOTYPES.Function) {
|
|
7490
8107
|
});
|
7491
8108
|
```
|
7492
8109
|
|
7493
|
-
See
|
8110
|
+
See `Ember.Observable.observes`.
|
7494
8111
|
|
7495
8112
|
@method observes
|
7496
8113
|
@for Function
|
@@ -7517,7 +8134,7 @@ if (Ember.EXTEND_PROTOTYPES === true || Ember.EXTEND_PROTOTYPES.Function) {
|
|
7517
8134
|
});
|
7518
8135
|
```
|
7519
8136
|
|
7520
|
-
See
|
8137
|
+
See `Ember.Observable.observesBefore`.
|
7521
8138
|
|
7522
8139
|
@method observesBefore
|
7523
8140
|
@for Function
|
@@ -8414,9 +9031,7 @@ Ember.Enumerable = Ember.Mixin.create({
|
|
8414
9031
|
// HELPERS
|
8415
9032
|
//
|
8416
9033
|
|
8417
|
-
var get = Ember.get, set = Ember.set, map = Ember.EnumerableUtils.map, cacheFor = Ember.cacheFor;
|
8418
|
-
|
8419
|
-
function none(obj) { return obj===null || obj===undefined; }
|
9034
|
+
var get = Ember.get, set = Ember.set, isNone = Ember.isNone, map = Ember.EnumerableUtils.map, cacheFor = Ember.cacheFor;
|
8420
9035
|
|
8421
9036
|
// ..........................................................
|
8422
9037
|
// ARRAY
|
@@ -8439,7 +9054,7 @@ function none(obj) { return obj===null || obj===undefined; }
|
|
8439
9054
|
|
8440
9055
|
You can use the methods defined in this module to access and modify array
|
8441
9056
|
contents in a KVO-friendly way. You can also be notified whenever the
|
8442
|
-
membership
|
9057
|
+
membership of an array changes by changing the syntax of the property to
|
8443
9058
|
`.observes('*myProperty.[]')`.
|
8444
9059
|
|
8445
9060
|
To support `Ember.Array` in your own class, you must override two
|
@@ -8456,9 +9071,6 @@ function none(obj) { return obj===null || obj===undefined; }
|
|
8456
9071
|
*/
|
8457
9072
|
Ember.Array = Ember.Mixin.create(Ember.Enumerable, /** @scope Ember.Array.prototype */ {
|
8458
9073
|
|
8459
|
-
// compatibility
|
8460
|
-
isSCArray: true,
|
8461
|
-
|
8462
9074
|
/**
|
8463
9075
|
Your array must support the `length` property. Your replace methods should
|
8464
9076
|
set this property whenever it changes.
|
@@ -8566,8 +9178,8 @@ Ember.Array = Ember.Mixin.create(Ember.Enumerable, /** @scope Ember.Array.protot
|
|
8566
9178
|
slice: function(beginIndex, endIndex) {
|
8567
9179
|
var ret = Ember.A([]);
|
8568
9180
|
var length = get(this, 'length') ;
|
8569
|
-
if (
|
8570
|
-
if (
|
9181
|
+
if (isNone(beginIndex)) beginIndex = 0 ;
|
9182
|
+
if (isNone(endIndex) || (endIndex > length)) endIndex = length ;
|
8571
9183
|
|
8572
9184
|
if (beginIndex < 0) beginIndex = length + beginIndex;
|
8573
9185
|
if (endIndex < 0) endIndex = length + endIndex;
|
@@ -8727,7 +9339,7 @@ Ember.Array = Ember.Mixin.create(Ember.Enumerable, /** @scope Ember.Array.protot
|
|
8727
9339
|
@param {Number} startIdx The starting index in the array that will change.
|
8728
9340
|
@param {Number} removeAmt The number of items that will be removed. If you
|
8729
9341
|
pass `null` assumes 0
|
8730
|
-
@param {Number} addAmt The number of items that will be added
|
9342
|
+
@param {Number} addAmt The number of items that will be added. If you
|
8731
9343
|
pass `null` assumes 0.
|
8732
9344
|
@return {Ember.Array} receiver
|
8733
9345
|
*/
|
@@ -8761,6 +9373,20 @@ Ember.Array = Ember.Mixin.create(Ember.Enumerable, /** @scope Ember.Array.protot
|
|
8761
9373
|
return this;
|
8762
9374
|
},
|
8763
9375
|
|
9376
|
+
/**
|
9377
|
+
If you are implementing an object that supports `Ember.Array`, call this
|
9378
|
+
method just after the array content changes to notify any observers and
|
9379
|
+
invalidate any related properties. Pass the starting index of the change
|
9380
|
+
as well as a delta of the amounts to change.
|
9381
|
+
|
9382
|
+
@method arrayContentDidChange
|
9383
|
+
@param {Number} startIdx The starting index in the array that did change.
|
9384
|
+
@param {Number} removeAmt The number of items that were removed. If you
|
9385
|
+
pass `null` assumes 0
|
9386
|
+
@param {Number} addAmt The number of items that were added. If you
|
9387
|
+
pass `null` assumes 0.
|
9388
|
+
@return {Ember.Array} receiver
|
9389
|
+
*/
|
8764
9390
|
arrayContentDidChange: function(startIdx, removeAmt, addAmt) {
|
8765
9391
|
|
8766
9392
|
// if no args are passed assume everything changes
|
@@ -8901,8 +9527,7 @@ var get = Ember.get, set = Ember.set;
|
|
8901
9527
|
@extends Ember.Mixin
|
8902
9528
|
@since Ember 0.9
|
8903
9529
|
*/
|
8904
|
-
Ember.Copyable = Ember.Mixin.create(
|
8905
|
-
/** @scope Ember.Copyable.prototype */ {
|
9530
|
+
Ember.Copyable = Ember.Mixin.create(/** @scope Ember.Copyable.prototype */ {
|
8906
9531
|
|
8907
9532
|
/**
|
8908
9533
|
Override to return a copy of the receiver. Default implementation raises
|
@@ -9007,8 +9632,7 @@ var get = Ember.get, set = Ember.set;
|
|
9007
9632
|
@extends Ember.Mixin
|
9008
9633
|
@since Ember 0.9
|
9009
9634
|
*/
|
9010
|
-
Ember.Freezable = Ember.Mixin.create(
|
9011
|
-
/** @scope Ember.Freezable.prototype */ {
|
9635
|
+
Ember.Freezable = Ember.Mixin.create(/** @scope Ember.Freezable.prototype */ {
|
9012
9636
|
|
9013
9637
|
/**
|
9014
9638
|
Set to `true` when the object is frozen. Use this property to detect
|
@@ -9189,8 +9813,7 @@ var get = Ember.get, set = Ember.set;
|
|
9189
9813
|
@uses Ember.Array
|
9190
9814
|
@uses Ember.MutableEnumerable
|
9191
9815
|
*/
|
9192
|
-
Ember.MutableArray = Ember.Mixin.create(Ember.Array, Ember.MutableEnumerable
|
9193
|
-
/** @scope Ember.MutableArray.prototype */ {
|
9816
|
+
Ember.MutableArray = Ember.Mixin.create(Ember.Array, Ember.MutableEnumerable,/** @scope Ember.MutableArray.prototype */ {
|
9194
9817
|
|
9195
9818
|
/**
|
9196
9819
|
__Required.__ You must implement this method to apply this mixin.
|
@@ -9461,7 +10084,6 @@ Ember.MutableArray = Ember.Mixin.create(Ember.Array, Ember.MutableEnumerable,
|
|
9461
10084
|
|
9462
10085
|
});
|
9463
10086
|
|
9464
|
-
|
9465
10087
|
})();
|
9466
10088
|
|
9467
10089
|
|
@@ -9509,7 +10131,7 @@ var get = Ember.get, set = Ember.set;
|
|
9509
10131
|
For example:
|
9510
10132
|
|
9511
10133
|
```javascript
|
9512
|
-
Ember.Object.
|
10134
|
+
Ember.Object.extend({
|
9513
10135
|
valueObserver: function() {
|
9514
10136
|
// Executes whenever the "value" property changes
|
9515
10137
|
}.observes('value')
|
@@ -9528,8 +10150,8 @@ var get = Ember.get, set = Ember.set;
|
|
9528
10150
|
object.addObserver('propertyKey', targetObject, targetAction)
|
9529
10151
|
```
|
9530
10152
|
|
9531
|
-
This will call the `targetAction` method on the `targetObject`
|
9532
|
-
|
10153
|
+
This will call the `targetAction` method on the `targetObject` whenever
|
10154
|
+
the value of the `propertyKey` changes.
|
9533
10155
|
|
9534
10156
|
Note that if `propertyKey` is a computed property, the observer will be
|
9535
10157
|
called when any of the property dependencies are changed, even if the
|
@@ -9789,8 +10411,8 @@ Ember.Observable = Ember.Mixin.create(/** @scope Ember.Observable.prototype */ {
|
|
9789
10411
|
|
9790
10412
|
This is the core method used to register an observer for a property.
|
9791
10413
|
|
9792
|
-
Once you call this method,
|
9793
|
-
will be notified. Note that the observers are triggered
|
10414
|
+
Once you call this method, any time the key's value is set, your observer
|
10415
|
+
will be notified. Note that the observers are triggered any time the
|
9794
10416
|
value is set, regardless of whether it has actually changed. Your
|
9795
10417
|
observer should be prepared to handle that.
|
9796
10418
|
|
@@ -9915,11 +10537,11 @@ Ember.Observable = Ember.Mixin.create(/** @scope Ember.Observable.prototype */ {
|
|
9915
10537
|
|
9916
10538
|
@method incrementProperty
|
9917
10539
|
@param {String} keyName The name of the property to increment
|
9918
|
-
@param {
|
9919
|
-
@return {
|
10540
|
+
@param {Number} increment The amount to increment by. Defaults to 1
|
10541
|
+
@return {Number} The new property value
|
9920
10542
|
*/
|
9921
10543
|
incrementProperty: function(keyName, increment) {
|
9922
|
-
if (
|
10544
|
+
if (Ember.isNone(increment)) { increment = 1; }
|
9923
10545
|
set(this, keyName, (get(this, keyName) || 0)+increment);
|
9924
10546
|
return get(this, keyName);
|
9925
10547
|
},
|
@@ -9934,12 +10556,12 @@ Ember.Observable = Ember.Mixin.create(/** @scope Ember.Observable.prototype */ {
|
|
9934
10556
|
|
9935
10557
|
@method decrementProperty
|
9936
10558
|
@param {String} keyName The name of the property to decrement
|
9937
|
-
@param {
|
9938
|
-
@return {
|
10559
|
+
@param {Number} decrement The amount to decrement by. Defaults to 1
|
10560
|
+
@return {Number} The new property value
|
9939
10561
|
*/
|
9940
|
-
decrementProperty: function(keyName,
|
9941
|
-
if (
|
9942
|
-
set(this, keyName, (get(this, keyName) || 0)-
|
10562
|
+
decrementProperty: function(keyName, decrement) {
|
10563
|
+
if (Ember.isNone(decrement)) { decrement = 1; }
|
10564
|
+
set(this, keyName, (get(this, keyName) || 0)-decrement);
|
9943
10565
|
return get(this, keyName);
|
9944
10566
|
},
|
9945
10567
|
|
@@ -9948,7 +10570,7 @@ Ember.Observable = Ember.Mixin.create(/** @scope Ember.Observable.prototype */ {
|
|
9948
10570
|
current value.
|
9949
10571
|
|
9950
10572
|
```javascript
|
9951
|
-
starship.toggleProperty('
|
10573
|
+
starship.toggleProperty('warpDriveEngaged');
|
9952
10574
|
```
|
9953
10575
|
|
9954
10576
|
@method toggleProperty
|
@@ -9980,7 +10602,6 @@ Ember.Observable = Ember.Mixin.create(/** @scope Ember.Observable.prototype */ {
|
|
9980
10602
|
}
|
9981
10603
|
});
|
9982
10604
|
|
9983
|
-
|
9984
10605
|
})();
|
9985
10606
|
|
9986
10607
|
|
@@ -10275,9 +10896,9 @@ Ember.Evented = Ember.Mixin.create({
|
|
10275
10896
|
(function() {
|
10276
10897
|
var RSVP = requireModule("rsvp");
|
10277
10898
|
|
10278
|
-
RSVP.async
|
10899
|
+
RSVP.configure('async', function(callback, binding) {
|
10279
10900
|
Ember.run.schedule('actions', binding, callback);
|
10280
|
-
};
|
10901
|
+
});
|
10281
10902
|
|
10282
10903
|
/**
|
10283
10904
|
@module ember
|
@@ -10299,9 +10920,22 @@ Ember.DeferredMixin = Ember.Mixin.create({
|
|
10299
10920
|
@param {Function} doneCallback a callback function to be called when done
|
10300
10921
|
@param {Function} failCallback a callback function to be called when failed
|
10301
10922
|
*/
|
10302
|
-
then: function(
|
10303
|
-
var promise
|
10304
|
-
|
10923
|
+
then: function(resolve, reject) {
|
10924
|
+
var deferred, promise, entity;
|
10925
|
+
|
10926
|
+
entity = this;
|
10927
|
+
deferred = get(this, '_deferred');
|
10928
|
+
promise = deferred.promise;
|
10929
|
+
|
10930
|
+
function fulfillmentHandler(fulfillment) {
|
10931
|
+
if (fulfillment === promise) {
|
10932
|
+
return resolve(entity);
|
10933
|
+
} else {
|
10934
|
+
return resolve(fulfillment);
|
10935
|
+
}
|
10936
|
+
}
|
10937
|
+
|
10938
|
+
return promise.then(resolve && fulfillmentHandler, reject);
|
10305
10939
|
},
|
10306
10940
|
|
10307
10941
|
/**
|
@@ -10310,7 +10944,16 @@ Ember.DeferredMixin = Ember.Mixin.create({
|
|
10310
10944
|
@method resolve
|
10311
10945
|
*/
|
10312
10946
|
resolve: function(value) {
|
10313
|
-
|
10947
|
+
var deferred, promise;
|
10948
|
+
|
10949
|
+
deferred = get(this, '_deferred');
|
10950
|
+
promise = deferred.promise;
|
10951
|
+
|
10952
|
+
if (value === this){
|
10953
|
+
deferred.resolve(promise);
|
10954
|
+
} else {
|
10955
|
+
deferred.resolve(value);
|
10956
|
+
}
|
10314
10957
|
},
|
10315
10958
|
|
10316
10959
|
/**
|
@@ -10319,11 +10962,11 @@ Ember.DeferredMixin = Ember.Mixin.create({
|
|
10319
10962
|
@method reject
|
10320
10963
|
*/
|
10321
10964
|
reject: function(value) {
|
10322
|
-
get(this, '
|
10965
|
+
get(this, '_deferred').reject(value);
|
10323
10966
|
},
|
10324
10967
|
|
10325
|
-
|
10326
|
-
return
|
10968
|
+
_deferred: Ember.computed(function() {
|
10969
|
+
return RSVP.defer();
|
10327
10970
|
})
|
10328
10971
|
});
|
10329
10972
|
|
@@ -10634,21 +11277,23 @@ CoreObject.PrototypeMixin = Mixin.create({
|
|
10634
11277
|
raised.
|
10635
11278
|
|
10636
11279
|
Note that destruction is scheduled for the end of the run loop and does not
|
10637
|
-
happen immediately.
|
11280
|
+
happen immediately. It will set an isDestroying flag immediately.
|
10638
11281
|
|
10639
11282
|
@method destroy
|
10640
11283
|
@return {Ember.Object} receiver
|
10641
11284
|
*/
|
10642
11285
|
destroy: function() {
|
10643
|
-
if (this.
|
10644
|
-
|
11286
|
+
if (this.isDestroying) { return; }
|
10645
11287
|
this.isDestroying = true;
|
10646
|
-
this._didCallDestroy = true;
|
10647
11288
|
|
11289
|
+
schedule('actions', this, this.willDestroy);
|
10648
11290
|
schedule('destroy', this, this._scheduledDestroy);
|
10649
11291
|
return this;
|
10650
11292
|
},
|
10651
11293
|
|
11294
|
+
/**
|
11295
|
+
Override to implement teardown.
|
11296
|
+
*/
|
10652
11297
|
willDestroy: Ember.K,
|
10653
11298
|
|
10654
11299
|
/**
|
@@ -10660,10 +11305,9 @@ CoreObject.PrototypeMixin = Mixin.create({
|
|
10660
11305
|
@method _scheduledDestroy
|
10661
11306
|
*/
|
10662
11307
|
_scheduledDestroy: function() {
|
10663
|
-
if (this.
|
11308
|
+
if (this.isDestroyed) { return; }
|
10664
11309
|
destroy(this);
|
10665
11310
|
this.isDestroyed = true;
|
10666
|
-
if (this.didDestroy) { this.didDestroy(); }
|
10667
11311
|
},
|
10668
11312
|
|
10669
11313
|
bind: function(to, from) {
|
@@ -11153,8 +11797,7 @@ var get = Ember.get, set = Ember.set;
|
|
11153
11797
|
@extends Ember.Object
|
11154
11798
|
@uses Ember.MutableArray
|
11155
11799
|
*/
|
11156
|
-
Ember.ArrayProxy = Ember.Object.extend(Ember.MutableArray
|
11157
|
-
/** @scope Ember.ArrayProxy.prototype */ {
|
11800
|
+
Ember.ArrayProxy = Ember.Object.extend(Ember.MutableArray,/** @scope Ember.ArrayProxy.prototype */ {
|
11158
11801
|
|
11159
11802
|
/**
|
11160
11803
|
The content array. Must be an object that implements `Ember.Array` and/or
|
@@ -11428,7 +12071,6 @@ Ember.ArrayProxy = Ember.Object.extend(Ember.MutableArray,
|
|
11428
12071
|
}
|
11429
12072
|
});
|
11430
12073
|
|
11431
|
-
|
11432
12074
|
})();
|
11433
12075
|
|
11434
12076
|
|
@@ -11528,8 +12170,7 @@ function contentPropertyDidChange(content, contentKey) {
|
|
11528
12170
|
@namespace Ember
|
11529
12171
|
@extends Ember.Object
|
11530
12172
|
*/
|
11531
|
-
Ember.ObjectProxy = Ember.Object.extend(
|
11532
|
-
/** @scope Ember.ObjectProxy.prototype */ {
|
12173
|
+
Ember.ObjectProxy = Ember.Object.extend(/** @scope Ember.ObjectProxy.prototype */ {
|
11533
12174
|
/**
|
11534
12175
|
The object whose properties will be forwarded.
|
11535
12176
|
|
@@ -11967,7 +12608,7 @@ if (Ember.EXTEND_PROTOTYPES === true || Ember.EXTEND_PROTOTYPES.Array) {
|
|
11967
12608
|
@submodule ember-runtime
|
11968
12609
|
*/
|
11969
12610
|
|
11970
|
-
var get = Ember.get, set = Ember.set, guidFor = Ember.guidFor,
|
12611
|
+
var get = Ember.get, set = Ember.set, guidFor = Ember.guidFor, isNone = Ember.isNone, fmt = Ember.String.fmt;
|
11971
12612
|
|
11972
12613
|
/**
|
11973
12614
|
An unordered collection of objects.
|
@@ -12325,7 +12966,7 @@ Ember.Set = Ember.CoreObject.extend(Ember.MutableEnumerable, Ember.Copyable, Emb
|
|
12325
12966
|
// implements Ember.MutableEnumerable
|
12326
12967
|
addObject: function(obj) {
|
12327
12968
|
if (get(this, 'isFrozen')) throw new Error(Ember.FROZEN_ERROR);
|
12328
|
-
if (
|
12969
|
+
if (isNone(obj)) return this; // nothing to do
|
12329
12970
|
|
12330
12971
|
var guid = guidFor(obj),
|
12331
12972
|
idx = this[guid],
|
@@ -12353,7 +12994,7 @@ Ember.Set = Ember.CoreObject.extend(Ember.MutableEnumerable, Ember.Copyable, Emb
|
|
12353
12994
|
// implements Ember.MutableEnumerable
|
12354
12995
|
removeObject: function(obj) {
|
12355
12996
|
if (get(this, 'isFrozen')) throw new Error(Ember.FROZEN_ERROR);
|
12356
|
-
if (
|
12997
|
+
if (isNone(obj)) return this; // nothing to do
|
12357
12998
|
|
12358
12999
|
var guid = guidFor(obj),
|
12359
13000
|
idx = this[guid],
|
@@ -12428,7 +13069,7 @@ Deferred.reopenClass({
|
|
12428
13069
|
promise: function(callback, binding) {
|
12429
13070
|
var deferred = Deferred.create();
|
12430
13071
|
callback.call(binding, deferred);
|
12431
|
-
return
|
13072
|
+
return deferred;
|
12432
13073
|
}
|
12433
13074
|
});
|
12434
13075
|
|
@@ -12439,6 +13080,8 @@ Ember.Deferred = Deferred;
|
|
12439
13080
|
|
12440
13081
|
|
12441
13082
|
(function() {
|
13083
|
+
var forEach = Ember.ArrayPolyfills.forEach;
|
13084
|
+
|
12442
13085
|
/**
|
12443
13086
|
@module ember
|
12444
13087
|
@submodule ember-runtime
|
@@ -12471,12 +13114,10 @@ Ember.onLoad = function(name, callback) {
|
|
12471
13114
|
@param object {Object} object to pass to callbacks
|
12472
13115
|
*/
|
12473
13116
|
Ember.runLoadHooks = function(name, object) {
|
12474
|
-
var hooks;
|
12475
|
-
|
12476
13117
|
loaded[name] = object;
|
12477
13118
|
|
12478
|
-
if (
|
12479
|
-
loadHooks[name]
|
13119
|
+
if (loadHooks[name]) {
|
13120
|
+
forEach.call(loadHooks[name], function(callback) {
|
12480
13121
|
callback(object);
|
12481
13122
|
});
|
12482
13123
|
}
|
@@ -12550,6 +13191,8 @@ Ember.ControllerMixin = Ember.Mixin.create({
|
|
12550
13191
|
|
12551
13192
|
container: null,
|
12552
13193
|
|
13194
|
+
parentController: null,
|
13195
|
+
|
12553
13196
|
store: null,
|
12554
13197
|
|
12555
13198
|
model: Ember.computed.alias('content'),
|
@@ -12891,6 +13534,10 @@ var get = Ember.get, set = Ember.set, forEach = Ember.EnumerableUtils.forEach,
|
|
12891
13534
|
});
|
12892
13535
|
```
|
12893
13536
|
|
13537
|
+
The itemController instances will have a `parentController` property set to
|
13538
|
+
either the the `parentController` property of the `ArrayController`
|
13539
|
+
or to the `ArrayController` instance itself.
|
13540
|
+
|
12894
13541
|
@class ArrayController
|
12895
13542
|
@namespace Ember
|
12896
13543
|
@extends Ember.ArrayProxy
|
@@ -13001,6 +13648,7 @@ Ember.ArrayController = Ember.ArrayProxy.extend(Ember.ControllerMixin,
|
|
13001
13648
|
}
|
13002
13649
|
|
13003
13650
|
subController.set('target', this);
|
13651
|
+
subController.set('parentController', get(this, 'parentController') || this);
|
13004
13652
|
subController.set('content', object);
|
13005
13653
|
|
13006
13654
|
return subController;
|
@@ -14334,6 +14982,6 @@ Ember States
|
|
14334
14982
|
|
14335
14983
|
|
14336
14984
|
if (typeof location !== 'undefined' && (location.hostname === 'localhost' || location.hostname === '127.0.0.1')) {
|
14337
|
-
|
14985
|
+
Ember.Logger.warn("You are running a production build of Ember on localhost and won't receive detailed error messages. "+
|
14338
14986
|
"If you want full error messages please use the non-minified build provided on the Ember website.");
|
14339
14987
|
}
|