ember-source 1.0.0.rc1.2 → 1.0.0.rc1.3
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/dist/ember-data-deps.js +1533 -1294
- data/dist/ember-data-deps.min.js +5 -5
- data/dist/ember-data-deps.prod.js +1520 -1281
- data/dist/ember-debug.js +2 -2
- data/dist/ember-old-router.js +1822 -3695
- data/dist/ember-old-router.min.js +8 -9
- data/dist/ember-old-router.prod.js +1817 -3690
- data/dist/ember-runtime.js +1532 -1293
- data/dist/ember-runtime.min.js +5 -5
- data/dist/ember-runtime.prod.js +1517 -1278
- data/dist/ember-spade.js +1 -1
- data/dist/ember-template-compiler.js +3 -3
- data/dist/ember-template-compiler.min.js +2 -2
- data/dist/ember-template-compiler.prod.js +1 -1
- data/dist/ember-tests.js +1 -1
- data/dist/ember.js +2855 -4662
- data/dist/ember.min.js +8 -9
- data/dist/ember.prod.js +2843 -4649
- metadata +2 -2
data/dist/ember-data-deps.min.js
CHANGED
@@ -8,10 +8,10 @@
|
|
8
8
|
// ==========================================================================
|
9
9
|
|
10
10
|
|
11
|
-
// Version: v1.0.0-
|
12
|
-
// Last commit:
|
11
|
+
// Version: v1.0.0-rc.1-188-gb6bb967
|
12
|
+
// Last commit: b6bb967 (2013-03-16 18:09:42 -0700)
|
13
13
|
|
14
14
|
|
15
|
-
(function(){var e,t;(function(){var n={},r={};e=function(e,t,r){n[e]={deps:t,callback:r}},t=function(e){if(r[e])return r[e];r[e]={};var i=n[e],s=i.deps,o=i.callback,u=[],a;for(var f=0,l=s.length;f<l;f++)s[f]==="exports"?u.push(a={}):u.push(t(s[f]));var c=o.apply(this,u);return r[e]=a||c}})(),function(){function r(t){if(e.console&&e.console[t])return e.console[t].apply?function(){e.console[t].apply(e.console,arguments)}:function(){var n=Array.prototype.join.call(arguments,", ");e.console[t](n)}}"undefined"==typeof Ember&&(Ember={});var e=Ember.imports=Ember.imports||this,t=Ember.exports=Ember.exports||this,n=Ember.lookup=Ember.lookup||this;t.Em=t.Ember=Em=Ember,Ember.isNamespace=!0,Ember.toString=function(){return"Ember"},Ember.VERSION="1.0.0-rc.1",Ember.ENV=Ember.ENV||("undefined"==typeof ENV?{}:ENV),Ember.config=Ember.config||{},Ember.EXTEND_PROTOTYPES=Ember.ENV.EXTEND_PROTOTYPES,typeof Ember.EXTEND_PROTOTYPES=="undefined"&&(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.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:r("log")||Ember.K,warn:r("warn")||Ember.K,error:r("error")||Ember.K,info:r("info")||Ember.K,debug:r("debug")||r("info")||Ember.K},Ember.onerror=null,Ember.handleErrors=function(e,t){if("function"!=typeof Ember.onerror)return e.apply(t||this);try{return e.apply(t||this)}catch(n){Ember.onerror(n)}},Ember.merge=function(e,t){for(var n in t){if(!t.hasOwnProperty(n))continue;e[n]=t[n]}}}(),function(){var e=Ember.platform={};Ember.create=Object.create;if(!Ember.create||Ember.ENV.STUB_OBJECT_CREATE){var t=function(){};Ember.create=function(e,n){t.prototype=e,e=new t;if(n){t.prototype=e;for(var r in n)t.prototype[r]=n[r].value;e=new t}return t.prototype=null,e},Ember.create.isSimulated=!0}var n=Object.defineProperty,r,i;if(n)try{n({},"a",{get:function(){}})}catch(s){n=null}n&&(r=function(){var e={};return n(e,"a",{configurable:!0,enumerable:!0,get:function(){},set:function(){}}),n(e,"a",{configurable:!0,enumerable:!0,writable:!0,value:!0}),e.a===!0}(),i=function(){try{return n(document.createElement("div"),"definePropertyOnDOM",{}),!0}catch(e){}return!1}(),r?i||(n=function(e,t,n){var r;return typeof Node=="object"?r=e instanceof Node:r=typeof e=="object"&&typeof e.nodeType=="number"&&typeof e.nodeName=="string",r?e[t]=n.value:Object.defineProperty(e,t,n)}):n=null),e.defineProperty=n,e.hasPropertyAccessors=!0,e.defineProperty||(e.hasPropertyAccessors=!1,e.defineProperty=function(e,t,n){n.get||(e[t]=n.value)},e.defineProperty.isSimulated=!0),Ember.ENV.MANDATORY_SETTER&&!e.hasPropertyAccessors&&(Ember.ENV.MANDATORY_SETTER=!1)}(),function(){function h(e){this.descs={},this.watching={},this.cache={},this.source=e}function p(e,t){return!!e&&typeof e[t]=="function"}var e=Ember.platform.defineProperty,t=Ember.create,n="__ember"+ +(new Date),r=0,i=[],s={},o=Ember.ENV.MANDATORY_SETTER;Ember.GUID_KEY=n;var u={writable:!1,configurable:!1,enumerable:!1,value:null};Ember.generateGuid=function(i,s){s||(s="ember");var o=s+r++;return i&&(u.value=o,e(i,n,u)),o},Ember.guidFor=function(o){if(o===undefined)return"(undefined)";if(o===null)return"(null)";var a,f,l=typeof o;switch(l){case"number":return f=i[o],f||(f=i[o]="nu"+o),f;case"string":return f=s[o],f||(f=s[o]="st"+r++),f;case"boolean":return o?"(true)":"(false)";default:if(o[n])return o[n];if(o===Object)return"(Object)";if(o===Array)return"(Array)";return f="ember"+r++,u.value=f,e(o,n,u),f}};var a={writable:!0,configurable:!1,enumerable:!1,value:null},f=Ember.GUID_KEY+"_meta";Ember.META_KEY=f;var l={descs:{},watching:{}};o&&(l.values={}),Ember.EMPTY_META=l,Object.freeze&&Object.freeze(l);var c=Ember.platform.defineProperty.isSimulated;c&&(h.prototype.__preventPlainObject__=!0,h.prototype.toJSON=function(){}),Ember.meta=function(r,i){var s=r[f];return i===!1?s||l:(s?s.source!==r&&(c||e(r,f,a),s=t(s),s.descs=t(s.descs),s.watching=t(s.watching),s.cache={},s.source=r,o&&(s.values=t(s.values)),r[f]=s):(c||e(r,f,a),s=new h(r),o&&(s.values={}),r[f]=s,s.descs.constructor=null),s)},Ember.getMeta=function(t,n){var r=Ember.meta(t,!1);return r[n]},Ember.setMeta=function(t,n,r){var i=Ember.meta(t,!0);return i[n]=r,r},Ember.metaPath=function(n,r,i){var s=Ember.meta(n,i),o,u;for(var a=0,f=r.length;a<f;a++){o=r[a],u=s[o];if(!u){if(!i)return undefined;u=s[o]={__ember_source__:n}}else if(u.__ember_source__!==n){if(!i)return undefined;u=s[o]=t(u),u.__ember_source__=n}s=u}return u},Ember.wrap=function(e,t){function n(){}function r(){var r,i=this._super;return this._super=t||n,r=e.apply(this,arguments),this._super=i,r}return r.wrappedFunction=e,r.__ember_observes__=e.__ember_observes__,r.__ember_observesBefore__=e.__ember_observesBefore__,r},Ember.isArray=function(e){return!e||e.setInterval?!1:Array.isArray&&Array.isArray(e)?!0:Ember.Array&&Ember.Array.detect(e)?!0:e.length!==undefined&&"object"==typeof e?!0:!1},Ember.makeArray=function(e){return e===null||e===undefined?[]:Ember.isArray(e)?e:[e]},Ember.canInvoke=p,Ember.tryInvoke=function(e,t,n){if(p(e,t))return e[t].apply(e,n||[])};var d=function(){var e=0;try{try{}finally{throw e++,new Error("needsFinallyFixTest")}}catch(t){}return e!==1}();d?Ember.tryFinally=function(e,t,n){var r,i,s;n=n||this;try{r=e.call(n)}finally{try{i=t.call(n)}catch(o){s=o}}if(s)throw s;return i===undefined?r:i}:Ember.tryFinally=function(e,t,n){var r,i;n=n||this;try{r=e.call(n)}finally{i=t.call(n)}return i===undefined?r:i},d?Ember.tryCatchFinally=function(e,t,n,r){var i,s,o,u;r=r||this;try{i=e.call(r)}catch(a){i=t.call(r,a)}finally{try{s=n.call(r)}catch(f){o=f}}if(o)throw o;return s===undefined?i:s}:Ember.tryCatchFinally=function(e,t,n,r){var i,s;r=r||this;try{i=e.call(r)}catch(o){i=t.call(r,o)}finally{s=n.call(r)}return s===undefined?i:s}}(),function(){Ember.Instrumentation={};var e=[],t={},n=function(n){var r=[],i;for(var s=0,o=e.length;s<o;s++)i=e[s],i.regex.test(n)&&r.push(i.object);return t[n]=r,r},r=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,s,o){function d(){for(h=0,p=u.length;h<p;h++)c=u[h],l[h]=c.before(e,r(),i);return s.call(o)}function v(e){i=i||{},i.exception=e}function m(){for(h=0,p=u.length;h<p;h++)c=u[h],c.after(e,r(),i,l[h]);Ember.STRUCTURED_PROFILE&&console.timeEnd(a)}var u=t[e],a,f;Ember.STRUCTURED_PROFILE&&(a=e+": "+i.object,console.time(a)),u||(u=n(e));if(u.length===0)return f=s.call(o),Ember.STRUCTURED_PROFILE&&console.timeEnd(a),f;var l=[],c,h,p;return Ember.tryCatchFinally(d,v,m)},Ember.Instrumentation.subscribe=function(n,r){var i=n.split("."),s,o=[];for(var u=0,a=i.length;u<a;u++)s=i[u],s==="*"?o.push("[^\\.]*"):o.push(s);o=o.join("\\."),o+="(\\..*)?";var f={pattern:n,regex:new RegExp("^"+o+"$"),object:r};return e.push(f),t={},f},Ember.Instrumentation.unsubscribe=function(n){var r;for(var i=0,s=e.length;i<s;i++)e[i]===n&&(r=i);e.splice(r,1),t={}},Ember.Instrumentation.reset=function(){e=[],t={}},Ember.instrument=Ember.Instrumentation.instrument,Ember.subscribe=Ember.Instrumentation.subscribe}(),function(){var e=Ember.EnumerableUtils={map:function(e,t,n){return e.map?e.map.call(e,t,n):Array.prototype.map.call(e,t,n)},forEach:function(e,t,n){return e.forEach?e.forEach.call(e,t,n):Array.prototype.forEach.call(e,t,n)},indexOf:function(e,t,n){return e.indexOf?e.indexOf.call(e,t,n):Array.prototype.indexOf.call(e,t,n)},indexesOf:function(t,n){return n===undefined?[]:e.map(n,function(n){return e.indexOf(t,n)})},addObject:function(t,n){var r=e.indexOf(t,n);r===-1&&t.push(n)},removeObject:function(t,n){var r=e.indexOf(t,n);r!==-1&&t.splice(r,1)},replace:function(e,t,n,r){if(e.replace)return e.replace(t,n,r);var i=Array.prototype.concat.apply([t,n],r);return e.splice.apply(e,i)},intersection:function(e,t){var n=[];return e.forEach(function(e){t.indexOf(e)>=0&&n.push(e)}),n}}}(),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(this===void 0||this===null)throw new TypeError;var t=Object(this),n=t.length>>>0;if(typeof e!="function")throw new TypeError;var r=new Array(n),i=arguments[1];for(var s=0;s<n;s++)s in t&&(r[s]=e.call(i,t[s],s,t));return r},n=e(Array.prototype.forEach)?Array.prototype.forEach:function(e){if(this===void 0||this===null)throw new TypeError;var t=Object(this),n=t.length>>>0;if(typeof e!="function")throw new TypeError;var r=arguments[1];for(var i=0;i<n;i++)i in t&&e.call(r,t[i],i,t)},r=e(Array.prototype.indexOf)?Array.prototype.indexOf:function(e,t){t===null||t===undefined?t=0:t<0&&(t=Math.max(0,this.length+t));for(var n=t,r=this.length;n<r;n++)if(this[n]===e)return n;return-1};Ember.ArrayPolyfills={map:t,forEach:n,indexOf:r},Ember.SHIM_ES5&&(Array.prototype.map||(Array.prototype.map=t),Array.prototype.forEach||(Array.prototype.forEach=n),Array.prototype.indexOf||(Array.prototype.indexOf=r))}(),function(){var e=Ember.guidFor,t=Ember.ArrayPolyfills.indexOf,n=function(e){var t={};for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);return t},r=function(e,t){var r=e.keys.copy(),i=n(e.values);return t.keys=r,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 n=e(t),r=this.presenceSet,i=this.list;if(n in r)return;r[n]=!0,i.push(t)},remove:function(n){var r=e(n),i=this.presenceSet,s=this.list;delete i[r];var o=t.call(s,n);o>-1&&s.splice(o,1)},isEmpty:function(){return this.list.length===0},has:function(t){var n=e(t),r=this.presenceSet;return n in r},forEach:function(e,t){var n=this.list.slice();for(var r=0,i=n.length;r<i;r++)e.call(t,n[r])},toArray:function(){return this.list.slice()},copy:function(){var e=new i;return e.presenceSet=n(this.presenceSet),e.list=this.list.slice(),e}};var s=Ember.Map=function(){this.keys=Ember.OrderedSet.create(),this.values={}};s.create=function(){return new s},s.prototype={get:function(t){var n=this.values,r=e(t);return n[r]},set:function(t,n){var r=this.keys,i=this.values,s=e(t);r.add(t),i[s]=n},remove:function(t){var n=this.keys,r=this.values,i=e(t),s;return r.hasOwnProperty(i)?(n.remove(t),s=r[i],delete r[i],!0):!1},has:function(t){var n=this.values,r=e(t);return n.hasOwnProperty(r)},forEach:function(t,n){var r=this.keys,i=this.values;r.forEach(function(r){var s=e(r);t.call(n,r,i[s])})},copy:function(){return r(this,new s)}};var o=Ember.MapWithDefault=function(e){s.call(this),this.defaultValue=e.defaultValue};o.create=function(e){return e?new o(e):new s},o.prototype=Ember.create(s.prototype),o.prototype.get=function(e){var t=this.has(e);if(t)return s.prototype.get.call(this,e);var n=this.defaultValue(e);return this.set(e,n),n},o.prototype.copy=function(){return r(this,new o({defaultValue:this.defaultValue}))}}(),function(){function a(e){return e.match(u)[0]}function f(e,n){var r=o.test(n),i=!r&&s.test(n),u;if(!e||i)e=Ember.lookup;r&&(n=n.slice(5)),e===Ember.lookup&&(u=a(n),e=t(e,u),n=n.slice(u.length+1));if(!n||n.length===0)throw new Error("Invalid Path");return[e,n]}function l(e,n){var r,i,s,u,a;if(e===null&&n.indexOf(".")===-1)return t(Ember.lookup,n);r=o.test(n);if(!e||r)s=f(e,n),e=s[0],n=s[1],s.length=0;i=n.split("."),a=i.length;for(u=0;e&&u<a;u++){e=t(e,i[u],!0);if(e&&e.isDestroyed)return undefined}return e}function c(e,t,r,i){var s;s=t.slice(t.lastIndexOf(".")+1),t=t.slice(0,t.length-(s.length+1)),t!=="this"&&(e=l(e,t));if(!s||s.length===0)throw new Error("You passed an empty path");if(!e){if(i)return;throw new Error("Object in path "+t+" could not be found or was destroyed.")}return n(e,s,r)}var e=Ember.META_KEY,t,n,r=Ember.ENV.MANDATORY_SETTER,i=/^([A-Z$]|([0-9][A-Z$]))/,s=/^([A-Z$]|([0-9][A-Z$])).*[\.\*]/,o=/^this[\.\*]/,u=/^([^\.\*]+)/;t=function(n,i){if(i==="")return n;!i&&"string"==typeof n&&(i=n,n=null);if(!n||i.indexOf(".")!==-1)return l(n,i);var s=n[e],o=s&&s.descs[i],u;return o?o.get(n,i):(r&&s&&s.watching[i]>0?u=s.values[i]:u=n[i],u!==undefined||"object"!=typeof n||i in n||"function"!=typeof n.unknownProperty?u:n.unknownProperty(i))},n=function(n,i,s,o){typeof n=="string"&&(s=i,i=n,n=null);if(!n||i.indexOf(".")!==-1)return c(n,i,s,o);var u=n[e],a=u&&u.descs[i],f,l;return a?a.set(n,i,s):(f="object"==typeof n&&!(i in n),f&&"function"==typeof n.setUnknownProperty?n.setUnknownProperty(i,s):u&&u.watching[i]>0?(r?l=u.values[i]:l=n[i],s!==l&&(Ember.propertyWillChange(n,i),r?l!==undefined||i in n?u.values[i]=s:Ember.defineProperty(n,i,null,s):n[i]=s,Ember.propertyDidChange(n,i))):n[i]=s),s},Ember.config.overrideAccessors&&(Ember.get=t,Ember.set=n,Ember.config.overrideAccessors(),t=Ember.get,n=Ember.set),Ember.normalizeTuple=function(e,t){return f(e,t)},Ember.getWithDefault=function(e,n,r){var i=t(e,n);return i===undefined?r:i},Ember.get=t,Ember.getPath=Ember.deprecateFunc("getPath is deprecated since get now supports paths",Ember.get),Ember.set=n,Ember.setPath=Ember.deprecateFunc("setPath is deprecated since set now supports paths",Ember.set),Ember.trySet=function(e,t,r){return n(e,t,r,!0)},Ember.trySetPath=Ember.deprecateFunc("trySetPath has been renamed to trySet",Ember.trySet),Ember.isGlobalPath=function(e){return i.test(e)}}(),function(){var e=Ember.GUID_KEY,t=Ember.META_KEY,n=Ember.EMPTY_META,r=Ember.meta,i=Ember.create,s=Ember.platform.defineProperty,o=Ember.ENV.MANDATORY_SETTER,u=Ember.Descriptor=function(){},a=Ember.MANDATORY_SETTER_FUNCTION=function(e){},f=Ember.DEFAULT_GETTER_FUNCTION=function(e){return function(){var n=this[t];return n&&n.values[e]}};Ember.defineProperty=function(e,t,n,i,u){var l,c,h,p;return u||(u=r(e)),l=u.descs,c=u.descs[t],h=u.watching[t]>0,c instanceof Ember.Descriptor&&c.teardown(e,t),n instanceof Ember.Descriptor?(p=n,l[t]=n,o&&h?s(e,t,{configurable:!0,enumerable:!0,writable:!0,value:undefined}):e[t]=undefined,n.setup(e,t)):(l[t]=undefined,n==null?(p=i,o&&h?(u.values[t]=i,s(e,t,{configurable:!0,enumerable:!0,set:a,get:f(t)})):e[t]=i):(p=n,s(e,t,n))),h&&Ember.overrideChains(e,t,u),e.didDefineProperty&&e.didDefineProperty(e,t,p),this}}(),function(){function i(){this.clear()}function u(t){return t+e}function a(e){return e+t}var e=":change",t=":before",n=Ember.guidFor,r=0;i.prototype.add=function(e,t,n){var r=this.observerSet,i=this.observers,s=Ember.guidFor(e),o=r[s],u;return o||(r[s]=o={}),u=o[t],u===undefined&&(u=i.push({sender:e,keyName:t,eventName:n,listeners:[]})-1,o[t]=u),i[u].listeners},i.prototype.flush=function(){var e=this.observers,t,n,r,i;this.clear();for(t=0,n=e.length;t<n;++t){r=e[t],i=r.sender;if(i.isDestroying||i.isDestroyed)continue;Ember.sendEvent(i,r.eventName,[i,r.keyName],r.listeners)}},i.prototype.clear=function(){this.observerSet={},this.observers=[]};var s=new i,o=new i;Ember.beginPropertyChanges=function(){r++},Ember.endPropertyChanges=function(){r--,r<=0&&(s.clear(),o.flush())},Ember.changeProperties=function(e,t){Ember.beginPropertyChanges(),Ember.tryFinally(e,Ember.endPropertyChanges,t)},Ember.setProperties=function(e,t){return Ember.changeProperties(function(){for(var n in t)t.hasOwnProperty(n)&&Ember.set(e,n,t[n])}),e},Ember.addObserver=function(e,t,n,r){return Ember.addListener(e,u(t),n,r),Ember.watch(e,t),this},Ember.observersFor=function(e,t){return Ember.listenersFor(e,u(t))},Ember.removeObserver=function(e,t,n,r){return Ember.unwatch(e,t),Ember.removeListener(e,u(t),n,r),this},Ember.addBeforeObserver=function(e,t,n,r){return Ember.addListener(e,a(t),n,r),Ember.watch(e,t),this},Ember._suspendBeforeObserver=function(e,t,n,r,i){return Ember._suspendListener(e,a(t),n,r,i)},Ember._suspendObserver=function(e,t,n,r,i){return Ember._suspendListener(e,u(t),n,r,i)};var f=Ember.ArrayPolyfills.map;Ember._suspendBeforeObservers=function(e,t,n,r,i){var s=f.call(t,a);return Ember._suspendListeners(e,s,n,r,i)},Ember._suspendObservers=function(e,t,n,r,i){var s=f.call(t,u);return Ember._suspendListeners(e,s,n,r,i)},Ember.beforeObserversFor=function(e,t){return Ember.listenersFor(e,a(t))},Ember.removeBeforeObserver=function(e,t,n,r){return Ember.unwatch(e,t),Ember.removeListener(e,a(t),n,r),this},Ember.notifyBeforeObservers=function(e,t){if(e.isDestroying)return;var n=a(t),i,o;r?(i=s.add(e,t,n),o=Ember.listenersDiff(e,n,i),Ember.sendEvent(e,n,[e,t],o)):Ember.sendEvent(e,n,[e,t])},Ember.notifyObservers=function(e,t){if(e.isDestroying)return;var n=u(t),i;r?(i=o.add(e,t,n),Ember.listenersUnion(e,n,i)):Ember.sendEvent(e,n,[e,t])}}(),function(){function p(e){return e.match(f)[0]}function d(e){return e==="*"||!l.test(e)}function v(t,n,r,i,s){var o=e(n);i[o]||(i[o]={});if(i[o][r])return;i[o][r]=!0;var u=s.deps;u=u&&u[r];if(u)for(var a in u){var f=s.descs[a];if(f&&f._suspended===n)continue;t(n,a)}}function y(e,t,n){if(e.isDestroying)return;var r=m,i=!r;i&&(r=m={}),v(O,e,t,r,n),i&&(m=null)}function b(e,t,n){if(e.isDestroying)return;var r=g,i=!r;i&&(r=g={}),v(M,e,t,r,n),i&&(g=null)}function w(e,n,r){if(!e||"object"!=typeof e)return;var i=t(e),s=i.chainWatchers;i.hasOwnProperty("chainWatchers")||(s=i.chainWatchers={}),s[n]||(s[n]=[]),s[n].push(r),Ember.watch(e,n)}function E(e,n,r){if(!e||"object"!=typeof e)return;var i=t(e,!1);if(!i.hasOwnProperty("chainWatchers"))return;var s=i.chainWatchers;if(s[n]){s=s[n];for(var o=0,u=s.length;o<u;o++)s[o]===r&&s.splice(o,1)}Ember.unwatch(e,n)}function x(){if(S.length===0)return;var e=S;S=[],a.call(e,function(e){e[0].add(e[1])})}function T(e){return t(e,!1).proto===e}function k(e){var n=t(e),r=n.chains;return r?r.value()!==e&&(r=n.chains=r.copy(e)):r=n.chains=new N(null,null,e),r}function L(e,t,n,r){if(!n.hasOwnProperty("chainWatchers"))return;var i=n.chainWatchers;i=i[t];if(!i)return;for(var s=0,o=i.length;s<o;s++)i[s].willChange(r)}function A(e,t,n,r){if(!n.hasOwnProperty("chainWatchers"))return;var i=n.chainWatchers;i=i[t];if(!i)return;for(var s=i.length-1;s>=0;s--)i[s].didChange(r)}function O(e,n,r){var i=t(e,!1),s=i.watching[n]>0||n==="length",o=i.proto,u=i.descs[n];if(!s)return;if(o===e)return;u&&u.willChange&&u.willChange(e,n),y(e,n,i),L(e,n,i),Ember.notifyBeforeObservers(e,n)}function M(e,n){var r=t(e,!1),i=r.watching[n]>0||n==="length",s=r.proto,o=r.descs[n];if(s===e)return;o&&o.didChange&&o.didChange(e,n);if(!i&&n!=="length")return;b(e,n,r),A(e,n,r),Ember.notifyObservers(e,n)}var e=Ember.guidFor,t=Ember.meta,n=Ember.get,r=Ember.set,i=Ember.normalizeTuple,s=Ember.GUID_KEY,o=Ember.META_KEY,u=Ember.notifyObservers,a=Ember.ArrayPolyfills.forEach,f=/^([^\.\*]+)/,l=/[\.\*]/,c=Ember.ENV.MANDATORY_SETTER,h=Ember.platform.defineProperty,m,g,S=[],N=function(e,t,n){var r;this._parent=e,this._key=t,this._watching=n===undefined,this._value=n,this._paths={},this._watching&&(this._object=e.value(),this._object&&w(this._object,this._key,this)),this._parent&&this._parent._key==="@each"&&this.value()},C=N.prototype;C.value=function(){if(this._value===undefined&&this._watching){var e=this._parent.value();this._value=e&&!T(e)?n(e,this._key):undefined}return this._value},C.destroy=function(){if(this._watching){var e=this._object;e&&E(e,this._key,this),this._watching=!1}},C.copy=function(e){var t=new N(null,null,e),n=this._paths,r;for(r in n){if(n[r]<=0)continue;t.add(r)}return t},C.add=function(e){var t,n,r,s,o;o=this._paths,o[e]=(o[e]||0)+1,t=this.value(),n=i(t,e);if(n[0]&&n[0]===t)e=n[1],r=p(e),e=e.slice(r.length+1);else{if(!n[0]){S.push([this,e]),n.length=0;return}s=n[0],r=e.slice(0,0-(n[1].length+1)),e=n[1]}n.length=0,this.chain(r,e,s)},C.remove=function(e){var t,n,r,s,o;o=this._paths,o[e]>0&&o[e]--,t=this.value(),n=i(t,e),n[0]===t?(e=n[1],r=p(e),e=e.slice(r.length+1)):(s=n[0],r=e.slice(0,0-(n[1].length+1)),e=n[1]),n.length=0,this.unchain(r,e)},C.count=0,C.chain=function(e,t,n){var r=this._chains,i;r||(r=this._chains={}),i=r[e],i||(i=r[e]=new N(this,e,n)),i.count++,t&&t.length>0&&(e=p(t),t=t.slice(e.length+1),i.chain(e,t))},C.unchain=function(e,t){var n=this._chains,r=n[e];t&&t.length>1&&(e=p(t),t=t.slice(e.length+1),r.unchain(e,t)),r.count--,r.count<=0&&(delete n[r._key],r.destroy())},C.willChange=function(){var e=this._chains;if(e)for(var t in e){if(!e.hasOwnProperty(t))continue;e[t].willChange()}this._parent&&this._parent.chainWillChange(this,this._key,1)},C.chainWillChange=function(e,t,n){this._key&&(t=this._key+"."+t),this._parent?this._parent.chainWillChange(this,t,n+1):(n>1&&Ember.propertyWillChange(this.value(),t),t="this."+t,this._paths[t]>0&&Ember.propertyWillChange(this.value(),t))},C.chainDidChange=function(e,t,n){this._key&&(t=this._key+"."+t),this._parent?this._parent.chainDidChange(this,t,n+1):(n>1&&Ember.propertyDidChange(this.value(),t),t="this."+t,this._paths[t]>0&&Ember.propertyDidChange(this.value(),t))},C.didChange=function(e){if(this._watching){var t=this._parent.value();t!==this._object&&(E(this._object,this._key,this),this._object=t,w(t,this._key,this)),this._value=undefined,this._parent&&this._parent._key==="@each"&&this.value()}var n=this._chains;if(n)for(var r in n){if(!n.hasOwnProperty(r))continue;n[r].didChange(e)}if(e)return;this._parent&&this._parent.chainDidChange(this,this._key,1)},Ember.overrideChains=function(e,t,n){A(e,t,n,!0)},Ember.watch=function(e,n){if(n==="length"&&Ember.typeOf(e)==="array")return this;var r=t(e),i=r.watching,s;return i[n]?i[n]=(i[n]||0)+1:(i[n]=1,d(n)?(s=r.descs[n],s&&s.willWatch&&s.willWatch(e,n),"function"==typeof e.willWatchProperty&&e.willWatchProperty(n),c&&n in e&&(r.values[n]=e[n],h(e,n,{configurable:!0,enumerable:!0,set:Ember.MANDATORY_SETTER_FUNCTION,get:Ember.DEFAULT_GETTER_FUNCTION(n)}))):k(e).add(n)),this},Ember.isWatching=function(t,n){var r=t[o];return(r&&r.watching[n])>0},Ember.watch.flushPending=x,Ember.unwatch=function(e,n){if(n==="length"&&Ember.typeOf(e)==="array")return this;var r=t(e),i=r.watching,s;return i[n]===1?(i[n]=0,d(n)?(s=r.descs[n],s&&s.didUnwatch&&s.didUnwatch(e,n),"function"==typeof e.didUnwatchProperty&&e.didUnwatchProperty(n),c&&n in e&&(h(e,n,{configurable:!0,enumerable:!0,writable:!0,value:r.values[n]}),delete r.values[n])):k(e).remove(n)):i[n]>1&&i[n]--,this},Ember.rewatch=function(e){var n=t(e,!1),r=n.chains;return s in e&&!e.hasOwnProperty(s)&&Ember.generateGuid(e,"ember"),r&&r.value()!==e&&(n.chains=r.copy(e)),this},Ember.finishChains=function(e){var n=t(e,!1),r=n.chains;r&&(r.value()!==e&&(n.chains=r=r.copy(e)),r.didChange(!0))},Ember.propertyWillChange=O,Ember.propertyDidChange=M;var _=[];Ember.destroy=function(e){var t=e[o],n,r,i,s;if(t){e[o]=null,n=t.chains;if(n){_.push(n);while(_.length>0){n=_.pop(),r=n._chains;if(r)for(i in r)r.hasOwnProperty(i)&&_.push(r[i]);n._watching&&(s=n._object,s&&E(s,n._key,n))}}}}}(),function(){function f(e,t,n){var r=t[n];return r?t.hasOwnProperty(n)||(r=t[n]=s(r)):r=t[n]={},r}function l(e,t){var n=t.deps;return n?t.hasOwnProperty("deps")||(n=t.deps=s(n)):n=t.deps={},n}function c(e,t,n,r){var i=e._dependentKeys,s,o,a,c,h;if(!i)return;s=l(t,r);for(o=0,a=i.length;o<a;o++)c=i[o],h=f(t,s,c),h[n]=(h[n]||0)+1,u(t,c)}function h(e,t,n,r){var i=e._dependentKeys,s,o,u,c,h;if(!i)return;s=l(t,r);for(o=0,u=i.length;o<u;o++)c=i[o],h=f(t,s,c),h[n]=(h[n]||0)-1,a(t,c)}function p(e,t){this.func=e,this._cacheable=t&&t.cacheable!==undefined?t.cacheable:!0,this._dependentKeys=t&&t.dependentKeys}var e=Ember.get,t=Ember.set,n=Ember.meta,r=Ember.guidFor,i=[].slice,s=Ember.create,o=Ember.META_KEY,u=Ember.watch,a=Ember.unwatch;Ember.ComputedProperty=p,p.prototype=new Ember.Descriptor;var d=p.prototype;d.cacheable=function(e){return this._cacheable=e!==!1,this},d.volatile=function(){return this.cacheable(!1)},d.property=function(){var e=[];for(var t=0,n=arguments.length;t<n;t++)e.push(arguments[t]);return this._dependentKeys=e,this},d.meta=function(e){return arguments.length===0?this._meta||{}:(this._meta=e,this)},d.willWatch=function(e,t){var n=e[o];t in n.cache||c(this,e,t,n)},d.didUnwatch=function(e,t){var n=e[o];t in n.cache||h(this,e,t,n)},d.didChange=function(e,t){if(this._cacheable&&this._suspended!==e){var r=n(e);t in r.cache&&(delete r.cache[t],r.watching[t]||h(this,e,t,r))}},d.get=function(e,t){var r,i,s;if(this._cacheable){s=n(e),i=s.cache;if(t in i)return i[t];r=i[t]=this.func.call(e,t),s.watching[t]||c(this,e,t,s)}else r=this.func.call(e,t);return r},d.set=function(e,t,r){var i=this._cacheable,s=this.func,o=n(e,i),u=o.watching[t],a=this._suspended,f=!1,l=o.cache,h,p;this._suspended=e;try{i&&l.hasOwnProperty(t)&&(h=l[t],f=!0),s.wrappedFunction&&(s=s.wrappedFunction);if(s.length===3)p=s.call(e,t,r,h);else{if(s.length!==2){Ember.defineProperty(e,t,null,h),Ember.set(e,t,r);return}p=s.call(e,t,r)}if(f&&h===p)return;u&&Ember.propertyWillChange(e,t),f&&delete l[t],i&&(!u&&!f&&c(this,e,t,o),l[t]=p),u&&Ember.propertyDidChange(e,t)}finally{this._suspended=a}return p},d.setup=function(e,t){var r=e[o];r&&r.watching[t]&&c(this,e,t,n(e))},d.teardown=function(e,t){var r=n(e);return(r.watching[t]||t in r.cache)&&h(this,e,t,r),this._cacheable&&delete r.cache[t],null},Ember.computed=function(e){var t;arguments.length>1&&(t=i.call(arguments,0,-1),e=i.call(arguments,-1)[0]);var n=new p(e);return t&&n.property.apply(n,t),n},Ember.cacheFor=function(t,r){var i=n(t,!1).cache;if(i&&r in i)return i[r]},Ember.computed.not=function(t){return Ember.computed(t,function(n){return!e(this,t)})},Ember.computed.empty=function(t){return Ember.computed(t,function(n){var r=e(this,t);return r===undefined||r===null||r===""||Ember.isArray(r)&&e(r,"length")===0})},Ember.computed.bool=function(t){return Ember.computed(t,function(n){return!!e(this,t)})},Ember.computed.alias=function(n){return Ember.computed(n,function(r,i){return arguments.length===1?e(this,n):(t(this,n,i),i)})}}(),function(){function i(e,t,n){var r=-1;for(var i=0,s=e.length;i<s;i++)if(t===e[i][0]&&n===e[i][1]){r=i;break}return r}function s(n,r){var i=t(n,!0),s;return i.listeners||(i.listeners={}),i.hasOwnProperty("listeners")||(i.listeners=e(i.listeners)),s=i.listeners[r],s&&!i.listeners.hasOwnProperty(r)?s=i.listeners[r]=i.listeners[r].slice():s||(s=i.listeners[r]=[]),s}function o(e,t,n){var s=e[r],o=s&&s.listeners&&s.listeners[t];if(!o)return;for(var u=o.length-1;u>=0;u--){var a=o[u][0],f=o[u][1],l=o[u][2],c=o[u][3],h=i(n,a,f);h===-1&&n.push([a,f,l,c])}}function u(e,t,n){var s=e[r],o=s&&s.listeners&&s.listeners[t],u=[];if(!o)return;for(var a=o.length-1;a>=0;a--){var f=o[a][0],l=o[a][1],c=o[a][2],h=o[a][3],p=i(n,f,l);if(p!==-1)continue;n.push([f,l,c,h]),u.push([f,l,c,h])}return u}function a(e,t,n,r,o){!r&&"function"==typeof n&&(r=n,n=null);var u=s(e,t),a=i(u,n,r);if(a!==-1)return;u.push([n,r,o,undefined]),"function"==typeof e.didAddListener&&e.didAddListener(t,n,r)}function f(e,t,n,o){function u(n,r,o){var u=s(e,t),a=i(u,n,r);if(a===-1)return;u.splice(a,1),"function"==typeof e.didRemoveListener&&e.didRemoveListener(t,n,r)}!o&&"function"==typeof n&&(o=n,n=null);if(o)u(n,o);else{var a=e[r],f=a&&a.listeners&&a.listeners[t];if(!f)return;for(var l=f.length-1;l>=0;l--)u(f[l][0],f[l][1])}}function l(e,t,n,r,o){function l(){return o.call(n)}function c(){f&&(f[3]=undefined)}!r&&"function"==typeof n&&(r=n,n=null);var u=s(e,t),a=i(u,n,r),f;return a!==-1&&(f=u[a].slice(),f[3]=!0,u[a]=f),Ember.tryFinally(l,c)}function c(e,t,n,r,o){function d(){return o.call(n)}function v(){for(c=0,h=u.length;c<h;c++)u[c][3]=undefined}!r&&"function"==typeof n&&(r=n,n=null);var u=[],a,f,l,c,h;for(c=0,h=t.length;c<h;c++){a=t[c],f=s(e,a);var p=i(f,n,r);p!==-1&&(l=f[p].slice(),l[3]=!0,f[p]=l,u.push(l))}return Ember.tryFinally(d,v)}function h(e){var t=e[r].listeners,n=[];if(t)for(var i in t)t[i]&&n.push(i);return n}function p(e,t,n,i){e!==Ember&&"function"==typeof e.sendEvent&&e.sendEvent(t,n);if(!i){var s=e[r];i=s&&s.listeners&&s.listeners[t]}if(!i)return;for(var o=i.length-1;o>=0;o--){if(!i[o]||i[o][3]===!0)continue;var u=i[o][0],a=i[o][1],l=i[o][2];l&&f(e,t,u,a),u||(u=e),"string"==typeof a&&(a=u[a]),n?a.apply(u,n):a.apply(u)}return!0}function d(e,t){var n=e[r],i=n&&n.listeners&&n.listeners[t];return!!i&&!!i.length}function v(e,t){var n=[],i=e[r],s=i&&i.listeners&&i.listeners[t];if(!s)return n;for(var o=0,u=s.length;o<u;o++){var a=s[o][0],f=s[o][1];n.push([a,f])}return n}var e=Ember.create,t=Ember.meta,n=Ember.metaPath,r=Ember.META_KEY;Ember.addListener=a,Ember.removeListener=f,Ember._suspendListener=l,Ember._suspendListeners=c,Ember.sendEvent=p,Ember.hasListeners=d,Ember.watchedEvents=h,Ember.listenersFor=v,Ember.listenersDiff=u,Ember.listenersUnion=o}(),function(){function n(t,n,r,i){return n===undefined&&(n=t,t=undefined),"string"==typeof n&&(n=t[n]),r&&i>0&&(r=r.length>i?e.call(r,i):null),Ember.handleErrors(function(){return n.apply(t||this,r||[])},this)}function u(){o=null,s.currentRunLoop&&s.end()}function l(){f=null;var e=+(new Date),t=-1;for(var r in a){if(!a.hasOwnProperty(r))continue;var i=a[r];if(i&&i.expires)if(e>=i.expires)delete a[r],n(i.target,i.method,i.args,2);else if(t<0||i.expires<t)t=i.expires}t>0&&(f=setTimeout(l,t- +(new Date)))}function c(e,t){t[this.tguid]&&delete t[this.tguid][this.mguid],a[e]&&n(this.target,this.method,this.args),delete a[e]}function h(e,t,n,r){var i=Ember.guidFor(t),o=Ember.guidFor(n),u=s.autorun().onceTimers,f=u[i]&&u[i][o],l;return f&&a[f]?a[f].args=r:(l={target:t,method:n,args:r,tguid:i,mguid:o},f=Ember.guidFor(l),a[f]=l,u[i]||(u[i]={}),u[i][o]=f,s.schedule(e,l,c,f,u)),f}function d(){p=null;for(var e in a){if(!a.hasOwnProperty(e))continue;var t=a[e];t.next&&(delete a[e],n(t.target,t.method,t.args,2))}}var e=[].slice,t=Ember.ArrayPolyfills.forEach,r,i=function(e){this._prev=e||null,this.onceTimers={}};i.prototype={end:function(){this.flush()},prev:function(){return this._prev},schedule:function(t,n,r){var i=this._queues,s;i||(i=this._queues={}),s=i[t],s||(s=i[t]=[]);var o=arguments.length>3?e.call(arguments,3):null;return s.push({target:n,method:r,args:o}),this},flush:function(e){function f(e){n(e.target,e.method,e.args)}function l(){t.call(u,f)}var i,s,o,u,a;if(!this._queues)return this;Ember.watch.flushPending();if(e)while(this._queues&&(u=this._queues[e]))this._queues[e]=null,e==="sync"?(a=Ember.LOG_BINDINGS,a&&Ember.Logger.log("Begin: Flush Sync Queue"),Ember.beginPropertyChanges(),Ember.tryFinally(l,Ember.endPropertyChanges),a&&Ember.Logger.log("End: Flush Sync Queue")):t.call(u,f);else{i=Ember.run.queues,o=i.length,s=0;e:while(s<o){e=i[s],u=this._queues&&this._queues[e],delete this._queues[e],u&&(e==="sync"?(a=Ember.LOG_BINDINGS,a&&Ember.Logger.log("Begin: Flush Sync Queue"),Ember.beginPropertyChanges(),Ember.tryFinally(l,Ember.endPropertyChanges),a&&Ember.Logger.log("End: Flush Sync Queue")):t.call(u,f));for(var c=0;c<=s;c++)if(this._queues&&this._queues[i[c]]){s=c;continue e}s++}}return r=null,this}},Ember.RunLoop=i,Ember.run=function(e,t){function o(){if(e||t)return n(e,t,i,2)}var r,i=arguments;return s.begin(),Ember.tryFinally(o,s.end)};var s=Ember.run;Ember.run.begin=function(){s.currentRunLoop=new i(s.currentRunLoop)},Ember.run.end=function(){function e(){s.currentRunLoop.end()}function t(){s.currentRunLoop=s.currentRunLoop.prev()}Ember.tryFinally(e,t)},Ember.run.queues=["sync","actions","destroy","timers"],Ember.run.schedule=function(e,t,n){var r=s.autorun();r.schedule.apply(r,arguments)};var o;Ember.run.hasScheduledTimers=function(){return!!(o||f||p)},Ember.run.cancelTimers=function(){o&&(clearTimeout(o),o=null),f&&(clearTimeout(f),f=null),p&&(clearTimeout(p),p=null),a={}},Ember.run.autorun=function(){return s.currentRunLoop||(s.begin(),o||(o=setTimeout(u,1))),s.currentRunLoop},Ember.run.sync=function(){s.autorun(),s.currentRunLoop.flush("sync")};var a={},f;Ember.run.later=function(t,n){var r,i,o,u,f;return arguments.length===2&&"function"==typeof t?(f=n,n=t,t=undefined,r=[t,n]):(r=e.call(arguments),f=r.pop()),i=+(new Date)+f,o={target:t,method:n,expires:i,args:r},u=Ember.guidFor(o),a[u]=o,s.once(a,l),u},Ember.run.once=function(t,n){return h("actions",t,n,e.call(arguments,2))},Ember.run.scheduleOnce=function(t,n,r,i){return h(t,n,r,e.call(arguments,3))};var p;Ember.run.next=function(t,n){var r,i={target:t,method:n,args:e.call(arguments),next:!0};return r=Ember.guidFor(i),a[r]=i,p||(p=setTimeout(d,1)),r},Ember.run.cancel=function(e){delete a[e]}}(),function(){function i(t,n){return e(r(n)?Ember.lookup:t,n)}function o(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])}Ember.LOG_BINDINGS=!!Ember.ENV.LOG_BINDINGS;var e=Ember.get,t=Ember.set,n=Ember.guidFor,r=Ember.isGlobalPath,s=function(e,t){this._direction="fwd",this._from=t,this._to=
|
16
|
-
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(e){var t=this._from,n=this._to;return Ember.trySet(e,n,i(e,t)),Ember.addObserver(e,t,this,this.fromDidChange),this._oneWay||Ember.addObserver(e,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 n=this._directionMap,r=n.get(e);r||(Ember.run.schedule("sync",this,this._sync,e),n.set(e,t)),r==="back"&&t==="fwd"&&n.set(e,"fwd")},_sync:function(t){var n=Ember.LOG_BINDINGS;if(t.isDestroyed||!this._readyToSync)return;var r=this._directionMap,s=r.get(t),o=this._from,u=this._to;r.remove(t);if(s==="fwd"){var a=i(t,this._from);n&&Ember.Logger.log(" ",this.toString(),"->",a,t),this._oneWay?Ember.trySet(t,u,a):Ember._suspendObserver(t,u,this,this.toDidChange,function(){Ember.trySet(t,u,a)})}else if(s==="back"){var f=e(t,this._to);n&&Ember.Logger.log(" ",this.toString(),"<-",f,t),Ember._suspendObserver(t,o,this,this.fromDidChange,function(){Ember.trySet(Ember.isGlobalPath(o)?Ember.lookup:t,o,f)})}}},o(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 n=this,r=new n(null,e);return r.oneWay(t)}}),Ember.Binding=s,Ember.bind=function(e,t,n){return(new Ember.Binding(t,n)).connect(e)},Ember.oneWay=function(e,t,n){return(new Ember.Binding(t,n)).oneWay().connect(e)}}(),function(){function c(e){var t=Ember.meta(e,!0),n=t.mixins;return n?t.hasOwnProperty("mixins")||(n=t.mixins=a(n)):n=t.mixins={},n}function h(t,n){return n&&n.length>0&&(t.mixins=r.call(n,function(t){if(t instanceof e)return t;var n=new e;return n.properties=t,n})),t}function p(e){return"function"==typeof e&&e.isMethod!==!1&&e!==Boolean&&e!==Object&&e!==Number&&e!==Array&&e!==Date&&e!==String}function v(t,n){var r;return n instanceof e?(r=l(n),t[r]?d:(t[r]=n,n.properties)):n}function m(e,t,n){var r;return r=t.concatenatedProperties||n.concatenatedProperties,e.concatenatedProperties&&(r=r?r.concat(e.concatenatedProperties):e.concatenatedProperties),r}function g(e,t,n,r,i){var s;return r[t]===undefined&&(s=i[t]),s=s||e.descs[t],!!s&&s instanceof Ember.ComputedProperty?(n=a(n),n.func=Ember.wrap(n.func,s.func),n):n}function y(e,t,n,r,i){var s;return i[t]===undefined&&(s=r[t]),s=s||e[t],"function"!=typeof s?n:Ember.wrap(n,s)}function b(e,t,n,r){var i=r[t]||e[t];return i?"function"==typeof i.concat?i.concat(n):Ember.makeArray(i).concat(n):Ember.makeArray(n)}function w(e,n,r,s,o,u,a){if(r instanceof Ember.Descriptor){if(r===t&&o[n])return d;r.func&&(r=g(s,n,r,u,o)),o[n]=r,u[n]=undefined}else{if(p(r))r=y(e,n,r,u,o);else if(a&&i.call(a,n)>=0||n==="concatenatedProperties")r=b(e,n,r,u);o[n]=undefined,u[n]=r}}function E(e,t,n,r,i){function c(e){delete n[e],delete r[e]}var o,u,a,f,l;for(var h=0,p=e.length;h<p;h++){o=e[h],u=v(t,o);if(u===d)continue;if(u){l=Ember.meta(i),f=m(u,r,i);for(a in u){if(!u.hasOwnProperty(a))continue;w(i,a,u[a],l,n,r,f)}u.hasOwnProperty("toString")&&(i.toString=u.toString)}else o.mixins&&(E(o.mixins,t,n,r,i),o._without&&s.call(o._without,c))}}function S(e){var t=Ember.meta(e),n=t.required;if(!n||!t.hasOwnProperty("required"))n=t.required=n?a(n):{};return n}function T(e,t,n,r){if(x.test(t)){var i=r.bindings;i?r.hasOwnProperty("bindings")||(i=r.bindings=a(r.bindings)):i=r.bindings={},i[t]=n}}function N(e,t){var n=t.bindings,r,i,s;if(n){for(r in n)i=n[r],i&&(s=r.slice(0,-7),i instanceof Ember.Binding?(i=i.copy(),i.to(s)):i=new Ember.Binding(s,i),i.connect(e),e[r]=i);t.bindings={}}}function C(e,t){return N(e,t||Ember.meta(e)),e}function k(e,t,n,r,i){var s=t.methodName,o;return r[s]||i[s]?(o=i[s],t=r[s]):n.descs[s]?(t=n.descs[s],o=undefined):(t=undefined,o=e[s]),{desc:t,value:o}}function L(e,t,n,r,i){if("function"!=typeof n)return;var s=n[r];if(s)for(var o=0,u=s.length;o<u;o++)Ember[i](e,s[o],null,t)}function A(e,t,n){var r=e[t];L(e,t,r,"__ember_observesBefore__","removeBeforeObserver"),L(e,t,r,"__ember_observes__","removeObserver"),L(e,t,n,"__ember_observesBefore__","addBeforeObserver"),L(e,t,n,"__ember_observes__","addObserver")}function O(e,r,i){var s={},o={},u=Ember.meta(e),a,l,h;E(r,c(e),s,o,e);for(a in o){if(a==="contructor"||!o.hasOwnProperty(a))continue;h=s[a],l=o[a];if(h===t)continue;while(h&&h instanceof n){var p=k(e,h,u,s,o);h=p.desc,l=p.value}if(h===undefined&&l===undefined)continue;A(e,a,l),T(e,a,l,u),f(e,a,h,l,u)}return i||C(e,u),e}function _(e,t,n){var r=l(e);if(n[r])return!1;n[r]=!0;if(e===t)return!0;var i=e.mixins,s=i?i.length:0;while(--s>=0)if(_(i[s],t,n))return!0;return!1}function D(e,t,n){if(n[l(t)])return;n[l(t)]=!0;if(t.properties){var r=t.properties;for(var i in r)r.hasOwnProperty(i)&&(e[i]=!0)}else t.mixins&&s.call(t.mixins,function(t){D(e,t,n)})}var e,t,n,r=Ember.ArrayPolyfills.map,i=Ember.ArrayPolyfills.indexOf,s=Ember.ArrayPolyfills.forEach,o=[].slice,u={},a=Ember.create,f=Ember.defineProperty,l=Ember.guidFor,d={},x=Ember.IS_BINDING=/^.+Binding$/;Ember.mixin=function(e){var t=o.call(arguments,1);return O(e,t,!1),e},Ember.Mixin=function(){return h(this,arguments)},e=Ember.Mixin,e._apply=O,e.applyPartial=function(e){var t=o.call(arguments,1);return O(e,t,!0)},e.finishPartial=C,Ember.anyUnprocessedMixins=!1,e.create=function(){Ember.anyUnprocessedMixins=!0;var e=this;return h(new e,arguments)};var M=e.prototype;M.reopen=function(){var t,n;this.properties?(t=e.create(),t.properties=this.properties,delete this.properties,this.mixins=[t]):this.mixins||(this.mixins=[]);var r=arguments.length,i=this.mixins,s;for(s=0;s<r;s++)t=arguments[s],t instanceof e?i.push(t):(n=e.create(),n.properties=t,i.push(n));return this},M.apply=function(e){return O(e,[this],!1)},M.applyPartial=function(e){return O(e,[this],!0)},M.detect=function(t){if(!t)return!1;if(t instanceof e)return _(t,this,{});var n=Ember.meta(t,!1).mixins;return n?!!n[l(this)]:!1},M.without=function(){var t=new e(this);return t._without=o.call(arguments),t},M.keys=function(){var e={},t={},n=[];D(e,this,t);for(var r in e)e.hasOwnProperty(r)&&n.push(r);return n},e.mixins=function(e){var t=Ember.meta(e,!1).mixins,n=[];if(!t)return n;for(var r in t){var i=t[r];i.properties||n.push(i)}return n},t=new Ember.Descriptor,t.toString=function(){return"(Required Property)"},Ember.required=function(){return t},n=function(e){this.methodName=e},n.prototype=new Ember.Descriptor,Ember.alias=function(e){return new n(e)},Ember.deprecateFunc("Ember.alias is deprecated. Please use Ember.aliasMethod or Ember.computed.alias instead.",Ember.alias),Ember.aliasMethod=function(e){return new n(e)},Ember.observer=function(e){var t=o.call(arguments,1);return e.__ember_observes__=t,e},Ember.immediateObserver=function(){for(var e=0,t=arguments.length;e<t;e++)var n=arguments[e];return Ember.observer.apply(this,arguments)},Ember.beforeObserver=function(e){var t=o.call(arguments,1);return e.__ember_observesBefore__=t,e}}(),function(){}(),function(){e("rsvp",[],function(){"use strict";function d(e,t){n.async(function(){e.trigger("promise:resolved",{detail:t}),e.isResolved=!0,e.resolvedValue=t})}function v(e,t){n.async(function(){e.trigger("promise:failed",{detail:t}),e.isRejected=!0,e.rejectedValue=t})}function m(e){var t,n=[],r=new c,i=e.length;i===0&&r.resolve([]);var s=function(e){return function(t){o(e,t)}},o=function(e,t){n[e]=t,--i===0&&r.resolve(n)},u=function(e){r.reject(e)};for(t=0;t<i;t++)e[t].then(s(t),u);return r}var e=typeof window!="undefined"?window:{},t=e.MutationObserver||e.WebKitMutationObserver,n,r;if(typeof process!="undefined"&&{}.toString.call(process)==="[object process]")r=function(e,t){process.nextTick(function(){e.call(t)})};else if(t){var i=[],s=new t(function(){var e=i.slice();i=[],e.forEach(function(e){var t=e[0],n=e[1];t.call(n)})}),o=document.createElement("div");s.observe(o,{attributes:!0}),window.addEventListener("unload",function(){s.disconnect(),s=null}),r=function(e,t){i.push([e,t]),o.setAttribute("drainQueue","drainQueue")}}else r=function(e,t){setTimeout(function(){e.call(t)},1)};var u=function(e,t){this.type=e;for(var n in t){if(!t.hasOwnProperty(n))continue;this[n]=t[n]}},a=function(e,t){for(var n=0,r=e.length;n<r;n++)if(e[n][0]===t)return n;return-1},f=function(e){var t=e._promiseCallbacks;return t||(t=e._promiseCallbacks={}),t},l={mixin:function(e){return e.on=this.on,e.off=this.off,e.trigger=this.trigger,e},on:function(e,t,n){var r=f(this),i,s;e=e.split(/\s+/),n=n||this;while(s=e.shift())i=r[s],i||(i=r[s]=[]),a(i,t)===-1&&i.push([t,n])},off:function(e,t){var n=f(this),r,i,s;e=e.split(/\s+/);while(i=e.shift()){if(!t){n[i]=[];continue}r=n[i],s=a(r,t),s!==-1&&r.splice(s,1)}},trigger:function(e,t){var n=f(this),r,i,s,o,a;if(r=n[e])for(var l=0;l<r.length;l++)i=r[l],s=i[0],o=i[1],typeof t!="object"&&(t={detail:t}),a=new u(e,t),s.call(o,a)}},c=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)},h=function(){},p=function(e,t,n,r){var i=typeof n=="function",s,o,u,a;if(i)try{s=n(r.detail),u=!0}catch(f){a=!0,o=f}else s=r.detail,u=!0;s&&typeof s.then=="function"?s.then(function(e){t.resolve(e)},function(e){t.reject(e)}):i&&u?t.resolve(s):a?t.reject(o):t[e](s)};return c.prototype={then:function(e,t){var r=new c;return this.isResolved&&n.async(function(){p("resolve",r,e,{detail:this.resolvedValue})},this),this.isRejected&&n.async(function(){p("reject",r,t,{detail:this.rejectedValue})},this),this.on("promise:resolved",function(t){p("resolve",r,e,t)}),this.on("promise:failed",function(e){p("reject",r,t,e)}),r},resolve:function(e){d(this,e),this.resolve=h,this.reject=h},reject:function(e){v(this,e),this.resolve=h,this.reject=h}},l.mixin(c.prototype),n={async:r,Promise:c,Event:u,EventTarget:l,all:m,raiseOnUncaughtExceptions:!0},n})}(),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 n(e){throw new Error(e+" is not currently supported on child containers")}function r(e,t){var n=s(e,t,"singleton");return n!==!1}function i(e,t){var n={};if(!t)return n;var r,i;for(var s=0,o=t.length;s<o;s++)r=t[s],i=e.lookup(r.fullName),n[r.property]=i;return n}function s(e,t,n){var r=e._options.get(t);if(r&&r[n]!==undefined)return r[n];var i=t.split(":")[0];r=e._typeOptions.get(i);if(r)return r[n]}function o(e,t){var n=e.normalize(t);return e.resolve(n)}function u(e,t){var n=o(e,t),r=t.split(":"),u=r[0],a=r[1],f;if(s(e,t,"instantiate")===!1)return n;if(n){var l=[];l=l.concat(e.typeInjections.get(u)||[]),l=l.concat(e.injections[t]||[]);var c=i(e,l);return c.container=e,c._debugContainerKey=t,f=n.create(c),f}}function a(e,t){e.cache.eachLocal(function(n,r){if(s(e,n,"instantiate")===!1)return;t(r)})}function f(e){e.cache.eachLocal(function(t,n){if(s(e,t,"instantiate")===!1)return;n.destroy()}),e.cache.dict={}}return e.prototype={get:function(e){var t=this.dict;if(t.hasOwnProperty(e))return t[e];if(this.parent)return this.parent.get(e)},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 n=this.dict;for(var r in n)n.hasOwnProperty(r)&&e.call(t,r,n[r])}},t.prototype={child:function(){var e=new t(this);return this.children.push(e),e},set:function(e,t,n){e[t]=n},register:function(e,t,n,r){var i;e.indexOf(":")!==-1?(r=n,n=t,i=e):i=e+":"+t;var s=this.normalize(i);this.registry.set(s,n),this._options.set(s,r||{})},resolve:function(e){return this.resolver(e)||this.registry.get(e)},normalize:function(e){return e},lookup:function(e,t){e=this.normalize(e),t=t||{};if(this.cache.has(e)&&t.singleton!==!1)return this.cache.get(e);var n=u(this,e);if(!n)return;return r(this,e)&&t.singleton!==!1&&this.cache.set(e,n),n},has:function(e){return this.cache.has(e)?!0:!!o(this,e)},optionsForType:function(e,t){this.parent&&n("optionsForType"),this._typeOptions.set(e,t)},options:function(e,t){this.optionsForType(e,t)},typeInjection:function(e,t,r){this.parent&&n("typeInjection");var i=this.typeInjections.get(e);i||(i=[],this.typeInjections.set(e,i)),i.push({property:t,fullName:r})},injection:function(e,t,r){this.parent&&n("injection");if(e.indexOf(":")===-1)return this.typeInjection(e,t,r);var i=this.injections[e]=this.injections[e]||[];i.push({property:t,fullName:r})},destroy:function(){this.isDestroyed=!0;for(var e=0,t=this.children.length;e<t;e++)this.children[e].destroy();this.children=[],a(this,function(e){e.isDestroying=!0}),a(this,function(e){e.destroy()}),delete this.parent,this.isDestroyed=!0},reset:function(){for(var e=0,t=this.children.length;e<t;e++)f(this.children[e]);f(this)}},t})}(),function(){function i(t,n,r,s){var o,u,a;if("object"!=typeof t||t===null)return t;if(n&&(u=e(r,t))>=0)return s[u];if(Ember.typeOf(t)==="array"){o=t.slice();if(n){u=o.length;while(--u>=0)o[u]=i(o[u],n,r,s)}}else if(Ember.Copyable&&Ember.Copyable.detect(t))o=t.copy(n,r,s);else{o={};for(a in t){if(!t.hasOwnProperty(a))continue;if(a.substring(0,2)==="__")continue;o[a]=n?i(t[a],n,r,s):t[a]}}return n&&(r.push(t),s.push(o)),o}var e=Ember.EnumerableUtils.indexOf,t={},n="Boolean Number String Function Array Date RegExp Object".split(" ");Ember.ArrayPolyfills.forEach.call(n,function(e){t["[object "+e+"]"]=e.toLowerCase()});var r=Object.prototype.toString;Ember.typeOf=function(e){var n;return n=e===null||e===undefined?String(e):t[r.call(e)]||"object",n==="function"?Ember.Object&&Ember.Object.detect(e)&&(n="class"):n==="object"&&(e instanceof Error?n="error":Ember.Object&&e instanceof Ember.Object?n="instance":n="object"),n},Ember.isNone=function(e){return e===null||e===undefined},Ember.none=Ember.deprecateFunc("Ember.none is deprecated. Please use Ember.isNone instead.",Ember.isNone),Ember.isEmpty=function(e){return e===null||e===undefined||e.length===0&&typeof e!="function"||typeof e=="object"&&Ember.get(e,"length")===0},Ember.empty=Ember.deprecateFunc("Ember.empty is deprecated. Please use Ember.isEmpty instead.",Ember.isEmpty),Ember.compare=function o(e,t){if(e===t)return 0;var n=Ember.typeOf(e),r=Ember.typeOf(t),i=Ember.Comparable;if(i){if(n==="instance"&&i.detect(e.constructor))return e.constructor.compare(e,t);if(r==="instance"&&i.detect(t.constructor))return 1-t.constructor.compare(t,e)}var s=Ember.ORDER_DEFINITION_MAPPING;if(!s){var u=Ember.ORDER_DEFINITION;s=Ember.ORDER_DEFINITION_MAPPING={};var a,f;for(a=0,f=u.length;a<f;++a)s[u[a]]=a;delete Ember.ORDER_DEFINITION}var l=s[n],c=s[r];if(l<c)return-1;if(l>c)return 1;switch(n){case"boolean":case"number":if(e<t)return-1;if(e>t)return 1;return 0;case"string":var h=e.localeCompare(t);if(h<0)return-1;if(h>0)return 1;return 0;case"array":var p=e.length,d=t.length,v=Math.min(p,d),m=0,g=0;while(m===0&&g<v)m=o(e[g],t[g]),g++;if(m!==0)return m;if(p<d)return-1;if(p>d)return 1;return 0;case"instance":if(Ember.Comparable&&Ember.Comparable.detect(e))return e.compare(e,t);return 0;case"date":var y=e.getTime(),b=t.getTime();if(y<b)return-1;if(y>b)return 1;return 0;default:return 0}},Ember.copy=function(e,t){return"object"!=typeof e||e===null?e:Ember.Copyable&&Ember.Copyable.detect(e)?e.copy(t):i(e,t,t?[]:null,t?[]:null)},Ember.inspect=function(e){if(typeof e!="object"||e===null)return e+"";var t,n=[];for(var r in e)if(e.hasOwnProperty(r)){t=e[r];if(t==="toString")continue;Ember.typeOf(t)==="function"&&(t="function() { ... }"),n.push(r+": "+t)}return"{"+n.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 n in e)e.hasOwnProperty(n)&&t.push(n);return t});var s=["description","fileName","lineNumber","message","name","number","stack"];Ember.Error=function(){var e=Error.prototype.constructor.apply(this,arguments);for(var t=0;t<s.length;t++)this[s[t]]=e[s[t]]},Ember.Error.prototype=Ember.create(Error.prototype)}(),function(){var e=/[ _]/g,t={},n=/([a-z])([A-Z])/g,r=/(\-|_|\.|\s)+(.)?/g,i=/([a-z\d])([A-Z]+)/g,s=/\-|\s+/g;Ember.STRINGS={},Ember.String={fmt:function(e,t){var n=0;return e.replace(/%@([0-9]+)?/g,function(e,r){return r=r?parseInt(r,0)-1:n++,e=t[r],(e===null?"(null)":e===undefined?"":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(n,"$1_$2").toLowerCase()},dasherize:function(n){var r=t,i=r[n];return i?i:(i=Ember.String.decamelize(n).replace(e,"-"),r[n]=i,i)},camelize:function(e){return e.replace(r,function(e,t,n){return n?n.toUpperCase():""}).replace(/^([A-Z])/,function(e,t,n){return e.toLowerCase()})},classify:function(e){var t=e.split("."),n=[];for(var r=0,i=t.length;r<i;r++){var s=Ember.String.camelize(t[r]);n.push(s.charAt(0).toUpperCase()+s.substr(1))}return n.join(".")},underscore:function(e){return e.replace(i,"$1_$2").replace(s,"_").toLowerCase()},capitalize:function(e){return e.charAt(0).toUpperCase()+e.substr(1)}}}(),function(){var e=Ember.String.fmt,t=Ember.String.w,n=Ember.String.loc,r=Ember.String.camelize,i=Ember.String.decamelize,s=Ember.String.dasherize,o=Ember.String.underscore,u=Ember.String.capitalize,a=Ember.String.classify;if(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 n(this,arguments)},String.prototype.camelize=function(){return r(this)},String.prototype.decamelize=function(){return i(this)},String.prototype.dasherize=function(){return s(this)},String.prototype.underscore=function(){return o(this)},String.prototype.classify=function(){return a(this)},String.prototype.capitalize=function(){return u(this)}}(),function(){var e=Array.prototype.slice;if(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(){function s(){return i.length===0?{}:i.pop()}function o(e){return i.push(e),null}function u(t,n){function i(i){var s=e(i,t);return r?n===s:!!s}var r=arguments.length===2;return i}var e=Ember.get,t=Ember.set,n=Array.prototype.slice,r=Ember.EnumerableUtils.indexOf,i=[];Ember.Enumerable=Ember.Mixin.create({isEnumerable:!0,nextObject:Ember.required(Function),firstObject:Ember.computed(function(){if(e(this,"length")===0)return undefined;var t=s(),n;return n=this.nextObject(0,null,t),o(t),n}).property("[]"),lastObject:Ember.computed(function(){var t=e(this,"length");if(t===0)return undefined;var n=s(),r=0,i,u=null;do u=i,i=this.nextObject(r++,u,n);while(i!==undefined);return o(n),u}).property("[]"),contains:function(e){return this.find(function(t){return t===e})!==undefined},forEach:function(t,n){if(typeof t!="function")throw new TypeError;var r=e(this,"length"),i=null,u=s();n===undefined&&(n=null);for(var a=0;a<r;a++){var f=this.nextObject(a,i,u);t.call(n,f,a,this),i=f}return i=null,u=o(u),this},getEach:function(e){return this.mapProperty(e)},setEach:function(e,n){return this.forEach(function(r){t(r,e,n)})},map:function(e,t){var n=[];return this.forEach(function(r,i,s){n[i]=e.call(t,r,i,s)}),n},mapProperty:function(t){return this.map(function(n){return e(n,t)})},filter:function(e,t){var n=[];return this.forEach(function(r,i,s){e.call(t,r,i,s)&&n.push(r)}),n},reject:function(e,t){return this.filter(function(){return!e.apply(t,arguments)})},filterProperty:function(e,t){return this.filter(u.apply(this,arguments))},rejectProperty:function(t,n){var r=function(r){return e(r,t)===n},i=function(n){return!!e(n,t)},s=arguments.length===2?r:i;return this.reject(s)},find:function(t,n){var r=e(this,"length");n===undefined&&(n=null);var i=null,u,a=!1,f,l=s();for(var c=0;c<r&&!a;c++){u=this.nextObject(c,i,l);if(a=t.call(n,u,c,this))f=u;i=u}return u=i=null,l=o(l),f},findProperty:function(e,t){return this.find(u.apply(this,arguments))},every:function(e,t){return!this.find(function(n,r,i){return!e.call(t,n,r,i)})},everyProperty:function(e,t){return this.every(u.apply(this,arguments))},some:function(e,t){return!!this.find(function(n,r,i){return!!e.call(t,n,r,i)})},someProperty:function(e,t){return this.some(u.apply(this,arguments))},reduce:function(e,t,n){if(typeof e!="function")throw new TypeError;var r=t;return this.forEach(function(t,i){r=e.call(null,r,t,i,this,n)},this),r},invoke:function(e){var t,r=[];return arguments.length>1&&(t=n.call(arguments,1)),this.forEach(function(n,i){var s=n&&n[e];"function"==typeof s&&(r[i]=t?s.apply(n,t):s.call(n))},this),r},toArray:function(){var e=[];return this.forEach(function(t,n){e[n]=t}),e},compact:function(){return this.without(null)},without:function(e){if(!this.contains(e))return this;var t=[];return this.forEach(function(n){n!==e&&(t[t.length]=n)}),t},uniq:function(){var e=[];return this.forEach(function(t){r(e,t)<0&&e.push(t)}),e},"[]":Ember.computed(function(e,t){return this}),addEnumerableObserver:function(t,n){var r=n&&n.willChange||"enumerableWillChange",i=n&&n.didChange||"enumerableDidChange",s=e(this,"hasEnumerableObservers");return s||Ember.propertyWillChange(this,"hasEnumerableObservers"),Ember.addListener(this,"@enumerable:before",t,r),Ember.addListener(this,"@enumerable:change",t,i),s||Ember.propertyDidChange(this,"hasEnumerableObservers"),this},removeEnumerableObserver:function(t,n){var r=n&&n.willChange||"enumerableWillChange",i=n&&n.didChange||"enumerableDidChange",s=e(this,"hasEnumerableObservers");return s&&Ember.propertyWillChange(this,"hasEnumerableObservers"),Ember.removeListener(this,"@enumerable:before",t,r),Ember.removeListener(this,"@enumerable:change",t,i),s&&Ember.propertyDidChange(this,"hasEnumerableObservers"),this},hasEnumerableObservers:Ember.computed(function(){return Ember.hasListeners(this,"@enumerable:change")||Ember.hasListeners(this,"@enumerable:before")}),enumerableContentWillChange:function(t,n){var r,i,s;return"number"==typeof t?r=t:t?r=e(t,"length"):r=t=-1,"number"==typeof n?i=n:n?i=e(n,"length"):i=n=-1,s=i<0||r<0||i-r!==0,t===-1&&(t=null),n===-1&&(n=null),Ember.propertyWillChange(this,"[]"),s&&Ember.propertyWillChange(this,"length"),Ember.sendEvent(this,"@enumerable:before",[this,t,n]),this},enumerableContentDidChange:function(t,n){var r=this.propertyDidChange,i,s,o;return"number"==typeof t?i=t:t?i=e(t,"length"):i=t=-1,"number"==typeof n?s=n:n?s=e(n,"length"):s=n=-1,o=s<0||i<0||s-i!==0,t===-1&&(t=null),n===-1&&(n=null),Ember.sendEvent(this,"@enumerable:change",[this,t,n]),o&&Ember.propertyDidChange(this,"length"),Ember.propertyDidChange(this,"[]"),this}})}(),function(){function s(e){return e===null||e===undefined}var e=Ember.get,t=Ember.set,n=Ember.meta,r=Ember.EnumerableUtils.map,i=Ember.cacheFor;Ember.Array=Ember.Mixin.create(Ember.Enumerable,{isSCArray:!0,length:Ember.required(),objectAt:function(t){return t<0||t>=e(this,"length")?undefined: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,n){return n!==undefined&&this.replace(0,e(this,"length"),n),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(t,n){var r=[],i=e(this,"length");s(t)&&(t=0);if(s(n)||n>i)n=i;while(t<n)r[r.length]=this.objectAt(t++);return r},indexOf:function(t,n){var r,i=e(this,"length");n===undefined&&(n=0),n<0&&(n+=i);for(r=n;r<i;r++)if(this.objectAt(r,!0)===t)return r;return-1},lastIndexOf:function(t,n){var r,i=e(this,"length");if(n===undefined||n>=i)n=i-1;n<0&&(n+=i);for(r=n;r>=0;r--)if(this.objectAt(r)===t)return r;return-1},addArrayObserver:function(t,n){var r=n&&n.willChange||"arrayWillChange",i=n&&n.didChange||"arrayDidChange",s=e(this,"hasArrayObservers");return s||Ember.propertyWillChange(this,"hasArrayObservers"),Ember.addListener(this,"@array:before",t,r),Ember.addListener(this,"@array:change",t,i),s||Ember.propertyDidChange(this,"hasArrayObservers"),this},removeArrayObserver:function(t,n){var r=n&&n.willChange||"arrayWillChange",i=n&&n.didChange||"arrayDidChange",s=e(this,"hasArrayObservers");return s&&Ember.propertyWillChange(this,"hasArrayObservers"),Ember.removeListener(this,"@array:before",t,r),Ember.removeListener(this,"@array:change",t,i),s&&Ember.propertyDidChange(this,"hasArrayObservers"),this},hasArrayObservers:Ember.computed(function(){return Ember.hasListeners(this,"@array:change")||Ember.hasListeners(this,"@array:before")}),arrayContentWillChange:function(t,n,r){t===undefined?(t=0,n=r=-1):(n===undefined&&(n=-1),r===undefined&&(r=-1)),Ember.isWatching(this,"@each")&&e(this,"@each"),Ember.sendEvent(this,"@array:before",[this,t,n,r]);var i,s;if(t>=0&&n>=0&&e(this,"hasEnumerableObservers")){i=[],s=t+n;for(var o=t;o<s;o++)i.push(this.objectAt(o))}else i=n;return this.enumerableContentWillChange(i,r),this},arrayContentDidChange:function(t,n,r){t===undefined?(t=0,n=r=-1):(n===undefined&&(n=-1),r===undefined&&(r=-1));var s,o;if(t>=0&&r>=0&&e(this,"hasEnumerableObservers")){s=[],o=t+r;for(var u=t;u<o;u++)s.push(this.objectAt(u))}else s=r;this.enumerableContentDidChange(n,s),Ember.sendEvent(this,"@array:change",[this,t,n,r]);var a=e(this,"length"),f=i(this,"firstObject"),l=i(this,"lastObject");return this.objectAt(0)!==f&&(Ember.propertyWillChange(this,"firstObject"),Ember.propertyDidChange(this,"firstObject")),this.objectAt(a-1)!==l&&(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,t=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=[],n=Ember.get,r=Ember.set,i=Ember.EnumerableUtils.forEach;Ember.MutableArray=Ember.Mixin.create(Ember.Array,Ember.MutableEnumerable,{replace:Ember.required(),clear:function(){var e=n(this,"length");return e===0?this:(this.replace(0,e,t),this)},insertAt:function(t,r){if(t>n(this,"length"))throw new Error(e);return this.replace(t,0,[r]),this},removeAt:function(r,i){if("number"==typeof r){if(r<0||r>=n(this,"length"))throw new Error(e);i===undefined&&(i=1),this.replace(r,i,t)}return this},pushObject:function(e){return this.insertAt(n(this,"length"),e),e},pushObjects:function(e){return this.replace(n(this,"length"),0,e),this},popObject:function(){var e=n(this,"length");if(e===0)return null;var t=this.objectAt(e-1);return this.removeAt(e-1,1),t},shiftObject:function(){if(n(this,"length")===0)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=n(this,"length");if(e===0)return this;var t=this.toArray().reverse();return this.replace(0,e,t),this},setObjects:function(e){if(e.length===0)return this.clear();var t=n(this,"length");return this.replace(0,t,e),this},removeObject:function(e){var t=n(this,"length")||0;while(--t>=0){var r=this.objectAt(t);r===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,n=Ember.defineProperty;Ember.Observable=Ember.Mixin.create({get:function(t){return e(this,t)},getProperties:function(){var t={},n=arguments;arguments.length===1&&Ember.typeOf(arguments[0])==="array"&&(n=arguments[0]);for(var r=0;r<n.length;r++)t[n[r]]=e(this,n[r]);return t},set:function(e,n){return t(this,e,n),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,n){Ember.addBeforeObserver(this,e,t,n)},addObserver:function(e,t,n){Ember.addObserver(this,e,t,n)},removeObserver:function(e,t,n){Ember.removeObserver(this,e,t,n)},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(n,r){return r||(r=1),t(this,n,(e(this,n)||0)+r),e(this,n)},decrementProperty:function(n,r){return r||(r=1),t(this,n,(e(this,n)||0)-r),e(this,n)},toggleProperty:function(n){return t(this,n,!e(this,n)),e(this,n)},cacheFor:function(e){return Ember.cacheFor(this,e)},observersForKey:function(e){return Ember.observersFor(this,e)}})}(),function(){var e=Ember.get,t=Ember.set;Ember.TargetActionSupport=Ember.Mixin.create({target:null,action:null,targetObject:Ember.computed(function(){var t=e(this,"target");if(Ember.typeOf(t)==="string"){var n=e(this,t);return n===undefined&&(n=e(Ember.lookup,t)),n}return t}).property("target"),triggerAction:function(){var t=e(this,"action"),n=e(this,"targetObject");if(n&&t){var r;return typeof n.send=="function"?r=n.send(t,this):(typeof t=="string"&&(t=n[t]),r=t.call(n,this)),r!==!1&&(r=!0),r}return!1}})}(),function(){Ember.Evented=Ember.Mixin.create({on:function(e,t,n){Ember.addListener(this,e,t,n)},one:function(e,t,n){n||(n=t,t=null),Ember.addListener(this,e,t,n,!0)},trigger:function(e){var t=[],n,r;for(n=1,r=arguments.length;n<r;n++)t.push(arguments[n]);Ember.sendEvent(this,e,t)},fire:function(e){this.trigger.apply(this,arguments)},off:function(e,t,n){Ember.removeListener(this,e,t,n)},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 n=Ember.get,r=Array.prototype.slice;Ember.DeferredMixin=Ember.Mixin.create({then:function(e,t){var r=n(this,"promise");return r.then.apply(r,arguments)},resolve:function(e){n(this,"promise").resolve(e)},reject:function(e){n(this,"promise").reject(e)},promise:Ember.computed(function(){return new e.Promise})})}(),function(){}(),function(){Ember.Container=t("container"),Ember.Container.set=Ember.set}(),function(){function w(){var e=!1,t,i,o=function(){e||o.proto(),r(this,s,b),r(this,"_super",b);var u=a(this);u.proto=this;if(t){var f=t;t=null,this.reopen.apply(this,f)}if(i){var c=i;i=null;var h=this.concatenatedProperties;for(var p=0,d=c.length;p<d;p++){var m=c[p];for(var w in
|
17
|
-
m){if(!m.hasOwnProperty(w))continue;var E=m[w],S=Ember.IS_BINDING;if(S.test(w)){var x=u.bindings;x?u.hasOwnProperty("bindings")||(x=u.bindings=n(u.bindings)):x=u.bindings={},x[w]=E}var T=u.descs[w];if(h&&y(h,w)>=0){var N=this[w];N?"function"==typeof N.concat?E=N.concat(E):E=Ember.makeArray(N).concat(E):E=Ember.makeArray(E)}T?T.set(this,w,E):typeof this.setUnknownProperty!="function"||w in this?g?Ember.defineProperty(this,w,null,E):this[w]=E:this.setUnknownProperty(w,E)}}}v(this,u),delete u.proto,l(this),this.init.apply(this,arguments)};return o.toString=p.prototype.toString,o.willReopen=function(){e&&(o.PrototypeMixin=p.create(o.PrototypeMixin)),e=!1},o._initMixins=function(e){t=e},o._initProperties=function(e){i=e},o.proto=function(){var t=o.superclass;return t&&t.proto(),e||(e=!0,o.PrototypeMixin.applyPartial(o.prototype),f(o.prototype)),this.prototype},o}function S(e){return function(){return e}}var e=Ember.set,t=Ember.get,n=Ember.create,r=Ember.platform.defineProperty,i=Array.prototype.slice,s=Ember.GUID_KEY,o=Ember.guidFor,u=Ember.generateGuid,a=Ember.meta,f=Ember.rewatch,l=Ember.finishChains,c=Ember.destroy,h=Ember.run.schedule,p=Ember.Mixin,d=p._apply,v=p.finishPartial,m=p.prototype.reopen,g=Ember.ENV.MANDATORY_SETTER,y=Ember.EnumerableUtils.indexOf,b={configurable:!0,writable:!0,enumerable:!1,value:undefined},E=w();E.toString=function(){return"Ember.CoreObject"},E.PrototypeMixin=p.create({reopen:function(){return d(this,arguments,!0),this},isInstance:!0,init:function(){},concatenatedProperties:null,isDestroyed:!1,isDestroying:!1,destroy:function(){if(this._didCallDestroy)return;return this.isDestroying=!0,this._didCallDestroy=!0,this.willDestroy&&this.willDestroy(),h("destroy",this,this._scheduledDestroy),this},_scheduledDestroy:function(){c(this),e(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 T(){var e=typeof this.toStringExtension=="function",t=e?":"+this.toStringExtension():"",n="<"+this.constructor.toString()+":"+o(this)+t+">";return this.toString=S(n),n}}),E.PrototypeMixin.ownerConstructor=E,Ember.config.overridePrototypeMixin&&Ember.config.overridePrototypeMixin(E.PrototypeMixin),E.__super__=null;var x=p.create({ClassMixin:Ember.required(),PrototypeMixin:Ember.required(),isClass:!0,isMethod:!1,extend:function(){var e=w(),t;return e.ClassMixin=p.create(this.ClassMixin),e.PrototypeMixin=p.create(this.PrototypeMixin),e.ClassMixin.ownerConstructor=e,e.PrototypeMixin.ownerConstructor=e,m.apply(e.PrototypeMixin,arguments),e.superclass=this,e.__super__=this.prototype,t=e.prototype=n(this.prototype),t.constructor=e,u(t,"ember"),a(t).proto=t,e.ClassMixin.apply(e),e},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(),m.apply(this.PrototypeMixin,arguments),this},reopenClass:function(){return m.apply(this.ClassMixin,arguments),d(this,arguments,!1),this},detect:function(e){if("function"!=typeof e)return!1;while(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 n=this.proto(),r=a(n).descs,i={},s;for(var o in r)s=r[o],s instanceof Ember.ComputedProperty&&e.call(t||this,o,s._meta||i)}});x.ownerConstructor=E,Ember.config.overrideClassMixin&&Ember.config.overrideClassMixin(x),E.ClassMixin=x,x.apply(E),Ember.CoreObject=E}(),function(){var e=Ember.get,t=Ember.set,n=Ember.guidFor,r=Ember.isNone;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 r=e(this,"length");if(r===0)return this;var i;this.enumerableContentWillChange(r,0),Ember.propertyWillChange(this,"firstObject"),Ember.propertyWillChange(this,"lastObject");for(var s=0;s<r;s++)i=n(this[s]),delete this[i],delete this[s];return t(this,"length",0),Ember.propertyDidChange(this,"firstObject"),Ember.propertyDidChange(this,"lastObject"),this.enumerableContentDidChange(r,0),this},isEqual:function(t){if(!Ember.Enumerable.detect(t))return!1;var n=e(this,"length");if(e(t,"length")!==n)return!1;while(--n>=0)if(!t.contains(this[n]))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]:undefined}),lastObject:Ember.computed(function(){return this.length>0?this[this.length-1]:undefined}),addObject:function(i){if(e(this,"isFrozen"))throw new Error(Ember.FROZEN_ERROR);if(r(i))return this;var s=n(i),o=this[s],u=e(this,"length"),a;return o>=0&&o<u&&this[o]===i?this:(a=[i],this.enumerableContentWillChange(null,a),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,a),this)},removeObject:function(i){if(e(this,"isFrozen"))throw new Error(Ember.FROZEN_ERROR);if(r(i))return this;var s=n(i),o=this[s],u=e(this,"length"),a=o===0,f=o===u-1,l,c;return o>=0&&o<u&&this[o]===i&&(c=[i],this.enumerableContentWillChange(c,null),a&&Ember.propertyWillChange(this,"firstObject"),f&&Ember.propertyWillChange(this,"lastObject"),o<u-1&&(l=this[u-1],this[o]=l,this[n(l)]=o),delete this[s],delete this[u-1],t(this,"length",u-1),a&&Ember.propertyDidChange(this,"firstObject"),f&&Ember.propertyDidChange(this,"lastObject"),this.enumerableContentDidChange(c,null)),this},contains:function(e){return this[n(e)]>=0},copy:function(){var r=this.constructor,i=new r,s=e(this,"length");t(i,"length",s);while(--s>=0)i[s]=this[s],i[n(this[s])]=s;return i},toString:function(){var e=this.length,t,n=[];for(t=0;t<e;t++)n[t]=this[t];return"Ember.Set<%@>".fmt(n.join(","))}})}(),function(){Ember.Object=Ember.CoreObject.extend(Ember.Observable),Ember.Object.toString=function(){return"Ember.Object"}}(),function(){function o(e,t,n){var u=e.length;r[e.join(".")]=t;for(var f in t){if(!i.call(t,f))continue;var c=t[f];e[u]=f;if(c&&c.toString===l)c.toString=h(e.join(".")),c[a]=e.join(".");else if(c&&c.isNamespace){if(n[s(c)])continue;n[s(c)]=!0,o(e,c,n)}}e.length=u}function u(){var e=Ember.Namespace,t=Ember.lookup,n,r;if(e.PROCESSED)return;for(var i in t){if(i==="parent"||i==="top"||i==="frameElement")continue;if(i==="globalStorage"&&t.StorageList&&t.globalStorage instanceof t.StorageList)continue;if(t.hasOwnProperty&&!t.hasOwnProperty(i))continue;try{n=Ember.lookup[i],r=n&&n.isNamespace}catch(s){continue}r&&(n[a]=i)}}function f(e){var t=e.superclass;if(t)return t[a]?t[a]:f(t);return}function l(){!Ember.BOOTED&&!this[a]&&c();var e;if(this[a])e=this[a];else{var t=f(this);t?e="(subclass of "+t+")":e="(unknown mixin)",this.toString=h(e)}return e}function c(){var e=!n.PROCESSED,t=Ember.anyUnprocessedMixins;e&&(u(),n.PROCESSED=!0);if(e||t){var r=n.NAMESPACES,i;for(var s=0,a=r.length;s<a;s++)i=r[s],o([i.toString()],i,{});Ember.anyUnprocessedMixins=!1}}function h(e){return function(){return e}}var e=Ember.get,t=Ember.ArrayPolyfills.indexOf,n=Ember.Namespace=Ember.Object.extend({isNamespace:!0,init:function(){Ember.Namespace.NAMESPACES.push(this),Ember.Namespace.PROCESSED=!1},toString:function(){var t=e(this,"name");return t?t:(u(),this[Ember.GUID_KEY+"_name"])},nameClasses:function(){o([this.toString()],this,{})},destroy:function(){var e=Ember.Namespace.NAMESPACES;Ember.lookup[this.toString()]=undefined,e.splice(t.call(e,this),1),this._super()}});n.reopenClass({NAMESPACES:[Ember],NAMESPACES_BY_ID:{},PROCESSED:!1,processAll:c,byName:function(e){return Ember.BOOTED||c(),r[e]}});var r=n.NAMESPACES_BY_ID,i={}.hasOwnProperty,s=Ember.guidFor,a=Ember.NAME_KEY=Ember.GUID_KEY+"_name";Ember.Mixin.prototype.toString=l}(),function(){Ember.Application=Ember.Namespace.extend()}(),function(){var e=Ember.get,t=Ember.set;Ember.ArrayProxy=Ember.Object.extend(Ember.MutableArray,{content:null,arrangedContent:Ember.computed.alias("content"),objectAtContent:function(t){return e(this,"arrangedContent").objectAt(t)},replaceContent:function(t,n,r){e(this,"content").replace(t,n,r)},_contentWillChange:Ember.beforeObserver(function(){this._teardownContent()},"content"),_teardownContent:function(){var t=e(this,"content");t&&t.removeArrayObserver(this,{willChange:"contentArrayWillChange",didChange:"contentArrayDidChange"})},contentArrayWillChange:Ember.K,contentArrayDidChange:Ember.K,_contentDidChange:Ember.observer(function(){var t=e(this,"content");this._setupContent()},"content"),_setupContent:function(){var t=e(this,"content");t&&t.addArrayObserver(this,{willChange:"contentArrayWillChange",didChange:"contentArrayDidChange"})},_arrangedContentWillChange:Ember.beforeObserver(function(){var t=e(this,"arrangedContent"),n=t?e(t,"length"):0;this.arrangedContentArrayWillChange(this,0,n,undefined),this.arrangedContentWillChange(this),this._teardownArrangedContent(t)},"arrangedContent"),_arrangedContentDidChange:Ember.observer(function(){var t=e(this,"arrangedContent"),n=t?e(t,"length"):0;this._setupArrangedContent(),this.arrangedContentDidChange(this),this.arrangedContentArrayDidChange(this,0,undefined,n)},"arrangedContent"),_setupArrangedContent:function(){var t=e(this,"arrangedContent");t&&t.addArrayObserver(this,{willChange:"arrangedContentArrayWillChange",didChange:"arrangedContentArrayDidChange"})},_teardownArrangedContent:function(){var t=e(this,"arrangedContent");t&&t.removeArrayObserver(this,{willChange:"arrangedContentArrayWillChange",didChange:"arrangedContentArrayDidChange"})},arrangedContentWillChange:Ember.K,arrangedContentDidChange:Ember.K,objectAt:function(t){return e(this,"content")&&this.objectAtContent(t)},length:Ember.computed(function(){var t=e(this,"arrangedContent");return t?e(t,"length"):0}),replace:function(t,n,r){return e(this,"content")&&this.replaceContent(t,n,r),this},arrangedContentArrayWillChange:function(e,t,n,r){this.arrayContentWillChange(t,n,r)},arrangedContentArrayDidChange:function(e,t,n,r){this.arrayContentDidChange(t,n,r)},init:function(){this._super(),this._setupContent(),this._setupArrangedContent()},willDestroy:function(){this._teardownArrangedContent(),this._teardownContent()}})}(),function(){function f(e,t){var n=t.slice(8);if(n in this)return;u(this,n)}function l(e,t){var n=t.slice(8);if(n in this)return;a(this,n)}var e=Ember.get,t=Ember.set,n=Ember.String.fmt,r=Ember.addBeforeObserver,i=Ember.addObserver,s=Ember.removeBeforeObserver,o=Ember.removeObserver,u=Ember.propertyWillChange,a=Ember.propertyDidChange;Ember.ObjectProxy=Ember.Object.extend({content:null,_contentDidChange:Ember.observer(function(){},"content"),isTruthy:Ember.computed.bool("content"),_debugContainerKey:null,willWatchProperty:function(e){var t="content."+e;r(this,t,null,f),i(this,t,null,l)},didUnwatchProperty:function(e){var t="content."+e;s(this,t,null,f),o(this,t,null,l)},unknownProperty:function(t){var n=e(this,"content");if(n)return e(n,t)},setUnknownProperty:function(n,r){var i=e(this,"content");return t(i,n,r)}})}(),function(){function o(e,t,r,i,s){var o=r._objects,u;o||(o=r._objects={});while(--s>=i){var a=e.objectAt(s);a&&(Ember.addBeforeObserver(a,t,r,"contentKeyWillChange"),Ember.addObserver(a,t,r,"contentKeyDidChange"),u=n(a),o[u]||(o[u]=[]),o[u].push(s))}}function u(e,t,r,i,s){var o=r._objects;o||(o=r._objects={});var u,a;while(--s>=i){var f=e.objectAt(s);f&&(Ember.removeBeforeObserver(f,t,r,"contentKeyWillChange"),Ember.removeObserver(f,t,r,"contentKeyDidChange"),a=n(f),u=o[a],u[u.indexOf(s)]=null)}}var e=Ember.set,t=Ember.get,n=Ember.guidFor,r=Ember.EnumerableUtils.forEach,i=Ember.Object.extend(Ember.Array,{init:function(e,t,n){this._super(),this._keyName=t,this._owner=n,this._content=e},objectAt:function(e){var n=this._content.objectAt(e);return n&&t(n,this._keyName)},length:Ember.computed(function(){var e=this._content;return e?t(e,"length"):0})}),s=/^.+:(before|change)$/;Ember.EachProxy=Ember.Object.extend({init:function(e){this._super(),this._content=e,e.addArrayObserver(this),r(Ember.watchedEvents(this),function(e){this.didAddListener(e)},this)},unknownProperty:function(e,t){var n;return n=new i(this._content,e,this),Ember.defineProperty(this,e,null,n),this.beginObservingContentKey(e),n},arrayWillChange:function(e,t,n,r){var i=this._keys,s,o,a;a=n>0?t+n:-1,Ember.beginPropertyChanges(this);for(s in i){if(!i.hasOwnProperty(s))continue;a>0&&u(e,s,this,t,a),Ember.propertyWillChange(this,s)}Ember.propertyWillChange(this._content,"@each"),Ember.endPropertyChanges(this)},arrayDidChange:function(e,t,n,r){var i=this._keys,s,u,a;a=r>0?t+r:-1,Ember.beginPropertyChanges(this);for(s in i){if(!i.hasOwnProperty(s))continue;a>0&&o(e,s,this,t,a),Ember.propertyDidChange(this,s)}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(e){var n=this._keys;n||(n=this._keys={});if(!n[e]){n[e]=1;var r=this._content,i=t(r,"length");o(r,e,this,0,i)}else n[e]++},stopObservingContentKey:function(e){var n=this._keys;if(n&&n[e]>0&&--n[e]<=0){var r=this._content,i=t(r,"length");u(r,e,this,0,i)}},contentKeyWillChange:function(e,t){Ember.propertyWillChange(this,t)},contentKeyDidChange:function(e,t){Ember.propertyDidChange(this,t)}})}(),function(){var e=Ember.get,t=Ember.set,n=Ember.Mixin.create(Ember.MutableArray,Ember.Observable,Ember.Copyable,{get:function(e){return e==="length"?this.length:"number"==typeof e?this[e]:this._super(e)},objectAt:function(e){return this[e]},replace:function(t,n,r){if(this.isFrozen)throw Ember.FROZEN_ERROR;var i=r?e(r,"length"):0;this.arrayContentWillChange(t,n,i);if(!r||r.length===0)this.splice(t,n);else{var s=[t,n].concat(r);this.splice.apply(this,s)}return this.arrayContentDidChange(t,n,i),this},unknownProperty:function(e,t){var n;return t!==undefined&&n===undefined&&(n=this[e]=t),n},indexOf:function(e,t){var n,r=this.length;t===undefined?t=0:t=t<0?Math.ceil(t):Math.floor(t),t<0&&(t+=r);for(n=t;n<r;n++)if(this[n]===e)return n;return-1},lastIndexOf:function(e,t){var n,r=this.length;t===undefined?t=r-1:t=t<0?Math.ceil(t):Math.floor(t),t<0&&(t+=r);for(n=t;n>=0;n--)if(this[n]===e)return n;return-1},copy:function(e){return e?this.map(function(e){return Ember.copy(e,!0)}):this.slice()}}),r=["length"];Ember.EnumerableUtils.forEach(n.keys(),function(e){Array.prototype[e]&&r.push(e)}),r.length>0&&(n=n.without.apply(n,r)),Ember.NativeArray=n,Ember.A=function(e){return e===undefined&&(e=[]),Ember.Array.detect(e)?e:Ember.NativeArray.apply(e)},Ember.NativeArray.activate=function(){n.apply(Array.prototype),Ember.A=function(e){return e||[]}},(Ember.EXTEND_PROTOTYPES===!0||Ember.EXTEND_PROTOTYPES.Array)&&Ember.NativeArray.activate()}(),function(){var e=Ember.DeferredMixin,t=Ember.Object,n=Ember.get,r=Ember.Object.extend(e);r.reopenClass({promise:function(e,t){var i=r.create();return e.call(t,i),n(i,"promise")}}),Ember.Deferred=r}(),function(){var e=Ember.ENV.EMBER_LOAD_HOOKS||{},t={};Ember.onLoad=function(n,r){var i;e[n]=e[n]||Ember.A(),e[n].pushObject(r),(i=t[n])&&r(i)},Ember.runLoadHooks=function(n,r){var i;t[n]=r,(i=e[n])&&e[n].forEach(function(e){e(r)})}}(),function(){}(),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 n=[].slice.call(arguments,1),r;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,n=Ember.EnumerableUtils.forEach;Ember.SortableMixin=Ember.Mixin.create(Ember.MutableEnumerable,{sortProperties:null,sortAscending:!0,orderBy:function(t,r){var i=0,s=e(this,"sortProperties"),o=e(this,"sortAscending");return n(s,function(n){i===0&&(i=Ember.compare(e(t,n),e(r,n)),i!==0&&!o&&(i=-1*i))}),i},destroy:function(){var t=e(this,"content"),r=e(this,"sortProperties");return t&&r&&n(t,function(e){n(r,function(t){Ember.removeObserver(e,t,this,"contentItemSortPropertyDidChange")},this)},this),this._super()},isSorted:Ember.computed.bool("sortProperties"),arrangedContent:Ember.computed("content","sortProperties.@each",function(t,r){var i=e(this,"content"),s=e(this,"isSorted"),o=e(this,"sortProperties"),u=this;return i&&s?(i=i.slice(),i.sort(function(e,t){return u.orderBy(e,t)}),n(i,function(e){n(o,function(t){Ember.addObserver(e,t,this,"contentItemSortPropertyDidChange")},this)},this),Ember.A(i)):i}),_contentWillChange:Ember.beforeObserver(function(){var t=e(this,"content"),r=e(this,"sortProperties");t&&r&&n(t,function(e){n(r,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(t,r,i,s){var o=e(this,"isSorted");if(o){var u=e(this,"arrangedContent"),a=t.slice(r,r+i),f=e(this,"sortProperties");n(a,function(e){u.removeObject(e),n(f,function(t){Ember.removeObserver(e,t,this,"contentItemSortPropertyDidChange")},this)},this)}return this._super(t,r,i,s)},contentArrayDidChange:function(t,r,i,s){var o=e(this,"isSorted"),u=e(this,"sortProperties");if(o){var a=t.slice(r,r+s),f=e(this,"arrangedContent");n(a,function(e){this.insertItemSorted(e),n(u,function(t){Ember.addObserver(e,t,this,"contentItemSortPropertyDidChange")},this)},this)}return this._super(t,r,i,s)},insertItemSorted:function(t){var n=e(this,"arrangedContent"),r=e(n,"length"),i=this._binarySearch(t,0,r);n.insertAt(i,t)},contentItemSortPropertyDidChange:function(t){var n=e(this,"arrangedContent"),r=n.indexOf(t),i=n.objectAt(r-1),s=n.objectAt(r+1),o=i&&this.orderBy(t,i),u=s&&this.orderBy(t,s);if(o<0||u>0)n.removeObject(t),this.insertItemSorted(t)},_binarySearch:function(t,n,r){var i,s,o,u;return n===r?n:(u=e(this,"arrangedContent"),i=n+Math.floor((r-n)/2),s=u.objectAt(i),o=this.orderBy(s,t),o<0?this._binarySearch(t,i+1,r):o>0?this._binarySearch(t,n,i):i)}})}(),function(){var e=Ember.get,t=Ember.set,n=Ember.isGlobalPath,r=Ember.EnumerableUtils.forEach,i=Ember.EnumerableUtils.replace;Ember.ArrayController=Ember.ArrayProxy.extend(Ember.ControllerMixin,Ember.SortableMixin,{itemController:null,lookupItemController:function(t){return e(this,"itemController")},objectAtContent:function(t){var n=e(this,"length"),r=e(this,"arrangedContent"),i=r&&r.objectAt(t);if(t>=0&&t<n){var s=this.lookupItemController(i);if(s)return this.controllerAt(t,i,s)}return i},arrangedContentDidChange:function(){this._super(),this._resetSubControllers()},arrayContentDidChange:function(t,n,s){var o=e(this,"_subControllers"),u=o.slice(t,t+n);r(u,function(e){e&&e.destroy()}),i(o,t,n,new Array(s)),this._super(t,n,s)},init:function(){this._super(),this.get("content")||Ember.defineProperty(this,"content",undefined,Ember.A()),this.set("_subControllers",Ember.A())},controllerAt:function(t,n,r){var i=e(this,"container"),s=e(this,"_subControllers"),o=s[t];o||(o=i.lookup("controller:"+r,{singleton:!1}),s[t]=o);if(!o)throw new Error('Could not resolve itemController: "'+r+'"');return o.set("target",this),o.set("content",n),o},_subControllers:null,_resetSubControllers:function(){var t=e(this,"_subControllers");r(t,function(e){e&&e.destroy()}),this.set("_subControllers",Ember.A())}})}(),function(){Ember.ObjectController=Ember.ObjectProxy.extend(Ember.ControllerMixin)}(),function(){}(),function(){}(),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"),n=e(this,"name");return t&&(n=t+"."+n),n}),trigger:function(e){this[e]&&this[e].apply(this,[].slice.call(arguments,1)),this._super.apply(this,arguments)},init:function(){var n=e(this,"states"),r;t(this,"childStates",Ember.A()),t(this,"eventTransitions",e(this,"eventTransitions")||{});var i,s,o;if(!n){n={};for(i in this){if(i==="constructor")continue;if(s=this[i]){if(o=s.transitionTarget)this.eventTransitions[i]=o;this.setupChild(n,i,s)}}t(this,"states",n)}else for(i in n)this.setupChild(n,i,n[i]);t(this,"pathsCache",{}),t(this,"pathsCacheNoContext",{})},setupChild:function(n,r,i){if(!i)return!1;i.isState?t(i,"name",r):Ember.State.detect(i)&&(i=i.create({name:r}));if(i.isState)return t(i,"parentState",this),e(this,"childStates").pushObject(i),n[r]=i,i},lookupEventTransition:function(e){var t,n=this;while(n&&!t)t=n.eventTransitions[e],n=n.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,n){var r=[],i,s=Ember.$&&Ember.$.Event;n&&s&&n instanceof s?n.hasOwnProperty("contexts")&&(r=n.contexts.slice()):r=[].slice.call(arguments,1),r.unshift(e),t.transitionTo.apply(t,r)};return t.transitionTarget=e,t}})}(),function(){var e=Ember.get,t=Ember.set,n=Ember.String.fmt,r=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){var n=this.enterStates.length-1,r=[],i,s;while(t.length>0){if(n>=0)i=this.enterStates[n--];else{if(this.enterStates.length){i=e(this.enterStates[0],"parentState");if(!i)throw"Cannot match all contexts to states"}else i=this.resolveState;this.enterStates.unshift(i),this.exitStates.unshift(i)}e(i,"hasContext")?s=t.pop():s=null,r.unshift(s)}this.contexts=r},addInitialStates:function(){var t=this.finalState,n;for(;;){n=e(t,"initialState")||"start",t=e(t,"states."+n);if(!t)break;this.finalState=t,this.enterStates.push(t),this.contexts.push(undefined)}},removeUnchangedContexts:function(e){while(this.enterStates.length>0){if(this.enterStates[0]!==this.exitStates[0])break;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 s=function(t,r,i){var u=this.enableLogging,a=i?"unhandledEvent":t,f=r[a],l,c,h;l=[].slice.call(arguments,3);if(typeof f=="function")return u&&(i?Ember.Logger.log(n("STATEMANAGER: Unhandled event '%@' being sent to state %@.",[t,e(r,"path")])):Ember.Logger.log(n("STATEMANAGER: Sending event '%@' to state %@.",[t,e(r,"path")]))),h=l,i&&h.unshift(t),h.unshift(this),f.apply(r,h);var p=e(r,"parentState");if(p)return c=l,c.unshift(t,p,i),s.apply(this,c);if(!i)return o.call(this,t,l,!0)},o=function(t,n,r){return n.unshift(t,e(this,"currentState"),r),s.apply(this,n)};Ember.StateManager=Ember.State.extend({init:function(){this._super(),t(this,"stateMeta",Ember.Map.create());var n=e(this,"initialState");!n&&e(this,"states.start")&&(n="start"),n&&this.transitionTo(n)},stateMetaFor:function(t){var n=e(this,"stateMeta"),r=n.get(t);return r||(r={},n.set(t,r)),r},setStateMeta:function(e,n,r){return t(this.stateMetaFor(e),n,r)},getStateMeta:function(t,n){return e(this.stateMetaFor(t),n)},currentState:null,currentPath:Ember.computed.alias("currentState.path"),transitionEvent:"setup",errorOnUnhandledEvent:!0,send:function(e){var t=[].slice.call(arguments,1);return o.call(this,e,t,!1)},unhandledEvent:function(t,n){if(e(this,"errorOnUnhandledEvent"))throw new Ember.Error(this.toString()+" could not respond to event "+n+" in state "+e(this,"currentState.path")+".")},getStateByPath:function(t,n){var r=n.split("."),i=t;for(var s=0,o=r.length;s<o;s++){i=e(e(i,"states"),r[s]);if(!i)break}return i},findStateByPath:function(t,n){var r;while(!r&&t)r=this.getStateByPath(t,n),t=e(t,"parentState");return r},getStatesInPath:function(t,n){if(!n||n==="")return undefined;var r=n.split("."),i=[],s,o;for(var u=0,a=r.length;u<a;u++){s=e(t,"states");if(!s)return undefined;o=e(s,r[u]);if(!o)return undefined;t=o,i.push(o)}return i},goToState:function(){return this.transitionTo.apply(this,arguments)},transitionTo:function(t,n){if(Ember.isEmpty(t))return;var r=n?Array.prototype.slice.call(arguments,1):[],s=e(this,"currentState")||this,o=this.contextFreeTransition(s,t),u=(new i(o)).normalize(this,r);this.enterState(u),this.triggerSetupContext(u)},contextFreeTransition:function(t,n){var r=t.pathsCache[n];if(r)return r;var i=this.getStatesInPath(t,n),s=[],o=t;while(o&&!i){s.unshift(o),o=e(o,"parentState");if(!o){i=this.getStatesInPath(this,n);if(!i)return}i=this.getStatesInPath(o,n)}while(i.length>0&&i[0]===s[0])o=i.shift(),s.shift();var u=t.pathsCache[n]={exitStates:s,enterStates:i,resolveState:o};return u},triggerSetupContext:function(t){var n=t.contexts,i=t.enterStates.length-n.length,s=t.enterStates,o=e(this,"transitionEvent");r.call(s,function(e,t){e.trigger(o,this,n[t-i])},this)},getState:function(t){var n=e(this,t),r=e(this,"parentState");if(n)return n;if(r)return r.getState(t)},enterState:function(n){var i=this.enableLogging,s=n.exitStates.slice(0).reverse();r.call(s,function(e){e.trigger("exit",this)},this),r.call(n.enterStates,function(t){i&&Ember.Logger.log("STATEMANAGER: Entering "+e(t,"path")),t.trigger("enter",this)},this),t(this,"currentState",n.finalState)}})}(),function(){}()})(),typeof location!="undefined"&&(location.hostname==="localhost"||location.hostname==="127.0.0.1")&&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 n={},r={};e=function(e,t,r){n[e]={deps:t,callback:r}},t=function(e){if(r[e])return r[e];r[e]={};var i=n[e],s=i.deps,o=i.callback,u=[],a;for(var f=0,l=s.length;f<l;f++)s[f]==="exports"?u.push(a={}):u.push(t(s[f]));var c=o.apply(this,u);return r[e]=a||c}})(),function(){function r(t){if(e.console&&e.console[t])return e.console[t].apply?function(){e.console[t].apply(e.console,arguments)}:function(){var n=Array.prototype.join.call(arguments,", ");e.console[t](n)}}"undefined"==typeof Ember&&(Ember={});var e=Ember.imports=Ember.imports||this,t=Ember.exports=Ember.exports||this,n=Ember.lookup=Ember.lookup||this;t.Em=t.Ember=Em=Ember,Ember.isNamespace=!0,Ember.toString=function(){return"Ember"},Ember.VERSION="1.0.0-rc.1",Ember.ENV=Ember.ENV||("undefined"==typeof ENV?{}:ENV),Ember.config=Ember.config||{},Ember.EXTEND_PROTOTYPES=Ember.ENV.EXTEND_PROTOTYPES,typeof Ember.EXTEND_PROTOTYPES=="undefined"&&(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:r("log")||Ember.K,warn:r("warn")||Ember.K,error:r("error")||Ember.K,info:r("info")||Ember.K,debug:r("debug")||r("info")||Ember.K},Ember.onerror=null,Ember.handleErrors=function(e,t){if("function"!=typeof Ember.onerror)return e.apply(t||this);try{return e.apply(t||this)}catch(n){Ember.onerror(n)}},Ember.merge=function(e,t){for(var n in t){if(!t.hasOwnProperty(n))continue;e[n]=t[n]}},Ember.isNone=function(e){return e===null||e===undefined},Ember.none=Ember.deprecateFunc("Ember.none is deprecated. Please use Ember.isNone instead.",Ember.isNone),Ember.isEmpty=function(e){return e===null||e===undefined||e.length===0&&typeof e!="function"||typeof e=="object"&&Ember.get(e,"length")===0},Ember.empty=Ember.deprecateFunc("Ember.empty is deprecated. Please use Ember.isEmpty instead.",Ember.isEmpty)}(),function(){var e=Ember.platform={};Ember.create=Object.create;if(!Ember.create||Ember.ENV.STUB_OBJECT_CREATE){var t=function(){};Ember.create=function(e,n){t.prototype=e,e=new t;if(n){t.prototype=e;for(var r in n)t.prototype[r]=n[r].value;e=new t}return t.prototype=null,e},Ember.create.isSimulated=!0}var n=Object.defineProperty,r,i;if(n)try{n({},"a",{get:function(){}})}catch(s){n=null}n&&(r=function(){var e={};return n(e,"a",{configurable:!0,enumerable:!0,get:function(){},set:function(){}}),n(e,"a",{configurable:!0,enumerable:!0,writable:!0,value:!0}),e.a===!0}(),i=function(){try{return n(document.createElement("div"),"definePropertyOnDOM",{}),!0}catch(e){}return!1}(),r?i||(n=function(e,t,n){var r;return typeof Node=="object"?r=e instanceof Node:r=typeof e=="object"&&typeof e.nodeType=="number"&&typeof e.nodeName=="string",r?e[t]=n.value:Object.defineProperty(e,t,n)}):n=null),e.defineProperty=n,e.hasPropertyAccessors=!0,e.defineProperty||(e.hasPropertyAccessors=!1,e.defineProperty=function(e,t,n){n.get||(e[t]=n.value)},e.defineProperty.isSimulated=!0),Ember.ENV.MANDATORY_SETTER&&!e.hasPropertyAccessors&&(Ember.ENV.MANDATORY_SETTER=!1)}(),function(){function h(e){this.descs={},this.watching={},this.cache={},this.source=e}function p(e,t){return!!e&&typeof e[t]=="function"}var e=Ember.platform.defineProperty,t=Ember.create,n="__ember"+ +(new Date),r=0,i=[],s={},o=Ember.ENV.MANDATORY_SETTER;Ember.GUID_KEY=n;var u={writable:!1,configurable:!1,enumerable:!1,value:null};Ember.generateGuid=function(i,s){s||(s="ember");var o=s+r++;return i&&(u.value=o,e(i,n,u)),o},Ember.guidFor=function(o){if(o===undefined)return"(undefined)";if(o===null)return"(null)";var a,f,l=typeof o;switch(l){case"number":return f=i[o],f||(f=i[o]="nu"+o),f;case"string":return f=s[o],f||(f=s[o]="st"+r++),f;case"boolean":return o?"(true)":"(false)";default:if(o[n])return o[n];if(o===Object)return"(Object)";if(o===Array)return"(Array)";return f="ember"+r++,u.value=f,e(o,n,u),f}};var a={writable:!0,configurable:!1,enumerable:!1,value:null},f=Ember.GUID_KEY+"_meta";Ember.META_KEY=f;var l={descs:{},watching:{}};o&&(l.values={}),Ember.EMPTY_META=l,Object.freeze&&Object.freeze(l);var c=Ember.platform.defineProperty.isSimulated;c&&(h.prototype.__preventPlainObject__=!0,h.prototype.toJSON=function(){}),Ember.meta=function(r,i){var s=r[f];return i===!1?s||l:(s?s.source!==r&&(c||e(r,f,a),s=t(s),s.descs=t(s.descs),s.watching=t(s.watching),s.cache={},s.source=r,o&&(s.values=t(s.values)),r[f]=s):(c||e(r,f,a),s=new h(r),o&&(s.values={}),r[f]=s,s.descs.constructor=null),s)},Ember.getMeta=function(t,n){var r=Ember.meta(t,!1);return r[n]},Ember.setMeta=function(t,n,r){var i=Ember.meta(t,!0);return i[n]=r,r},Ember.metaPath=function(n,r,i){var s=Ember.meta(n,i),o,u;for(var a=0,f=r.length;a<f;a++){o=r[a],u=s[o];if(!u){if(!i)return undefined;u=s[o]={__ember_source__:n}}else if(u.__ember_source__!==n){if(!i)return undefined;u=s[o]=t(u),u.__ember_source__=n}s=u}return u},Ember.wrap=function(e,t){function n(){}function r(){var r,i=this._super;return this._super=t||n,r=e.apply(this,arguments),this._super=i,r}return r.wrappedFunction=e,r.__ember_observes__=e.__ember_observes__,r.__ember_observesBefore__=e.__ember_observesBefore__,r},Ember.isArray=function(e){return!e||e.setInterval?!1:Array.isArray&&Array.isArray(e)?!0:Ember.Array&&Ember.Array.detect(e)?!0:e.length!==undefined&&"object"==typeof e?!0:!1},Ember.makeArray=function(e){return e===null||e===undefined?[]:Ember.isArray(e)?e:[e]},Ember.canInvoke=p,Ember.tryInvoke=function(e,t,n){if(p(e,t))return e[t].apply(e,n||[])};var d=function(){var e=0;try{try{}finally{throw e++,new Error("needsFinallyFixTest")}}catch(t){}return e!==1}();d?Ember.tryFinally=function(e,t,n){var r,i,s;n=n||this;try{r=e.call(n)}finally{try{i=t.call(n)}catch(o){s=o}}if(s)throw s;return i===undefined?r:i}:Ember.tryFinally=function(e,t,n){var r,i;n=n||this;try{r=e.call(n)}finally{i=t.call(n)}return i===undefined?r:i},d?Ember.tryCatchFinally=function(e,t,n,r){var i,s,o,u;r=r||this;try{i=e.call(r)}catch(a){i=t.call(r,a)}finally{try{s=n.call(r)}catch(f){o=f}}if(o)throw o;return s===undefined?i:s}:Ember.tryCatchFinally=function(e,t,n,r){var i,s;r=r||this;try{i=e.call(r)}catch(o){i=t.call(r,o)}finally{s=n.call(r)}return s===undefined?i:s}}(),function(){Ember.Instrumentation={};var e=[],t={},n=function(n){var r=[],i;for(var s=0,o=e.length;s<o;s++)i=e[s],i.regex.test(n)&&r.push(i.object);return t[n]=r,r},r=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,s,o){function d(){for(h=0,p=u.length;h<p;h++)c=u[h],l[h]=c.before(e,r(),i);return s.call(o)}function v(e){i=i||{},i.exception=e}function m(){for(h=0,p=u.length;h<p;h++)c=u[h],c.after(e,r(),i,l[h]);Ember.STRUCTURED_PROFILE&&console.timeEnd(a)}var u=t[e],a,f;Ember.STRUCTURED_PROFILE&&(a=e+": "+i.object,console.time(a)),u||(u=n(e));if(u.length===0)return f=s.call(o),Ember.STRUCTURED_PROFILE&&console.timeEnd(a),f;var l=[],c,h,p;return Ember.tryCatchFinally(d,v,m)},Ember.Instrumentation.subscribe=function(n,r){var i=n.split("."),s,o=[];for(var u=0,a=i.length;u<a;u++)s=i[u],s==="*"?o.push("[^\\.]*"):o.push(s);o=o.join("\\."),o+="(\\..*)?";var f={pattern:n,regex:new RegExp("^"+o+"$"),object:r};return e.push(f),t={},f},Ember.Instrumentation.unsubscribe=function(n){var r;for(var i=0,s=e.length;i<s;i++)e[i]===n&&(r=i);e.splice(r,1),t={}},Ember.Instrumentation.reset=function(){e=[],t={}},Ember.instrument=Ember.Instrumentation.instrument,Ember.subscribe=Ember.Instrumentation.subscribe}(),function(){var e=Ember.EnumerableUtils={map:function(e,t,n){return e.map?e.map.call(e,t,n):Array.prototype.map.call(e,t,n)},forEach:function(e,t,n){return e.forEach?e.forEach.call(e,t,n):Array.prototype.forEach.call(e,t,n)},indexOf:function(e,t,n){return e.indexOf?e.indexOf.call(e,t,n):Array.prototype.indexOf.call(e,t,n)},indexesOf:function(t,n){return n===undefined?[]:e.map(n,function(n){return e.indexOf(t,n)})},addObject:function(t,n){var r=e.indexOf(t,n);r===-1&&t.push(n)},removeObject:function(t,n){var r=e.indexOf(t,n);r!==-1&&t.splice(r,1)},replace:function(e,t,n,r){if(e.replace)return e.replace(t,n,r);var i=Array.prototype.concat.apply([t,n],r);return e.splice.apply(e,i)},intersection:function(e,t){var n=[];return e.forEach(function(e){t.indexOf(e)>=0&&n.push(e)}),n}}}(),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(this===void 0||this===null)throw new TypeError;var t=Object(this),n=t.length>>>0;if(typeof e!="function")throw new TypeError;var r=new Array(n),i=arguments[1];for(var s=0;s<n;s++)s in t&&(r[s]=e.call(i,t[s],s,t));return r},n=e(Array.prototype.forEach)?Array.prototype.forEach:function(e){if(this===void 0||this===null)throw new TypeError;var t=Object(this),n=t.length>>>0;if(typeof e!="function")throw new TypeError;var r=arguments[1];for(var i=0;i<n;i++)i in t&&e.call(r,t[i],i,t)},r=e(Array.prototype.indexOf)?Array.prototype.indexOf:function(e,t){t===null||t===undefined?t=0:t<0&&(t=Math.max(0,this.length+t));for(var n=t,r=this.length;n<r;n++)if(this[n]===e)return n;return-1};Ember.ArrayPolyfills={map:t,forEach:n,indexOf:r},Ember.SHIM_ES5&&(Array.prototype.map||(Array.prototype.map=t),Array.prototype.forEach||(Array.prototype.forEach=n),Array.prototype.indexOf||(Array.prototype.indexOf=r))}(),function(){var e=Ember.guidFor,t=Ember.ArrayPolyfills.indexOf,n=function(e){var t={};for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);return t},r=function(e,t){var r=e.keys.copy(),i=n(e.values);return t.keys=r,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 n=e(t),r=this.presenceSet,i=this.list;if(n in r)return;r[n]=!0,i.push(t)},remove:function(n){var r=e(n),i=this.presenceSet,s=this.list;delete i[r];var o=t.call(s,n);o>-1&&s.splice(o,1)},isEmpty:function(){return this.list.length===0},has:function(t){var n=e(t),r=this.presenceSet;return n in r},forEach:function(e,t){var n=this.list.slice();for(var r=0,i=n.length;r<i;r++)e.call(t,n[r])},toArray:function(){return this.list.slice()},copy:function(){var e=new i;return e.presenceSet=n(this.presenceSet),e.list=this.list.slice(),e}};var s=Ember.Map=function(){this.keys=Ember.OrderedSet.create(),this.values={}};s.create=function(){return new s},s.prototype={get:function(t){var n=this.values,r=e(t);return n[r]},set:function(t,n){var r=this.keys,i=this.values,s=e(t);r.add(t),i[s]=n},remove:function(t){var n=this.keys,r=this.values,i=e(t),s;return r.hasOwnProperty(i)?(n.remove(t),s=r[i],delete r[i],!0):!1},has:function(t){var n=this.values,r=e(t);return n.hasOwnProperty(r)},forEach:function(t,n){var r=this.keys,i=this.values;r.forEach(function(r){var s=e(r);t.call(n,r,i[s])})},copy:function(){return r(this,new s)}};var o=Ember.MapWithDefault=function(e){s.call(this),this.defaultValue=e.defaultValue};o.create=function(e){return e?new o(e):new s},o.prototype=Ember.create(s.prototype),o.prototype.get=function(e){var t=this.has(e);if(t)return s.prototype.get.call(this,e);var n=this.defaultValue(e);return this.set(e,n),n},o.prototype.copy=function(){return r(this,new o({defaultValue:this.defaultValue}))}}(),function(){function a(e){return e.match(u)[0]}function f(e,n){var r=o.test(n),i=!r&&s.test(n),u;if(!e||i)e=Ember.lookup;r&&(n=n.slice(5)),e===Ember.lookup&&(u=a(n),e=t(e,u),n=n.slice(u.length+1));if(!n||n.length===0)throw new Error("Invalid Path");return[e,n]}function l(e,n){var r,i,s,u,a;if(e===null&&n.indexOf(".")===-1)return t(Ember.lookup,n);r=o.test(n);if(!e||r)s=f(e,n),e=s[0],n=s[1],s.length=0;i=n.split("."),a=i.length;for(u=0;e&&u<a;u++){e=t(e,i[u],!0);if(e&&e.isDestroyed)return undefined}return e}function c(e,t,r,i){var s;s=t.slice(t.lastIndexOf(".")+1),t=t.slice(0,t.length-(s.length+1)),t!=="this"&&(e=l(e,t));if(!s||s.length===0)throw new Error("You passed an empty path");if(!e){if(i)return;throw new Error("Object in path "+t+" could not be found or was destroyed.")}return n(e,s,r)}var e=Ember.META_KEY,t,n,r=Ember.ENV.MANDATORY_SETTER,i=/^([A-Z$]|([0-9][A-Z$]))/,s=/^([A-Z$]|([0-9][A-Z$])).*[\.\*]/,o=/^this[\.\*]/,u=/^([^\.\*]+)/;t=function(n,i){if(i==="")return n;!i&&"string"==typeof n&&(i=n,n=null);if(!n||i.indexOf(".")!==-1)return l(n,i);var s=n[e],o=s&&s.descs[i],u;return o?o.get(n,i):(r&&s&&s.watching[i]>0?u=s.values[i]:u=n[i],u!==undefined||"object"!=typeof n||i in n||"function"!=typeof n.unknownProperty?u:n.unknownProperty(i))},n=function(n,i,s,o){typeof n=="string"&&(s=i,i=n,n=null);if(!n||i.indexOf(".")!==-1)return c(n,i,s,o);var u=n[e],a=u&&u.descs[i],f,l;return a?a.set(n,i,s):(f="object"==typeof n&&!(i in n),f&&"function"==typeof n.setUnknownProperty?n.setUnknownProperty(i,s):u&&u.watching[i]>0?(r?l=u.values[i]:l=n[i],s!==l&&(Ember.propertyWillChange(n,i),r?l!==undefined||i in n?u.values[i]=s:Ember.defineProperty(n,i,null,s):n[i]=s,Ember.propertyDidChange(n,i))):n[i]=s),s},Ember.config.overrideAccessors&&(Ember.get=t,Ember.set=n,Ember.config.overrideAccessors(),t=Ember.get,n=Ember.set),Ember.normalizeTuple=function(e,t){return f(e,t)},Ember.getWithDefault=function(e,n,r){var i=t(e,n);return i===undefined?r:i},Ember.get=t,Ember.getPath=Ember.deprecateFunc("getPath is deprecated since get now supports paths",Ember.get),Ember.set=n,Ember.setPath=Ember.deprecateFunc("setPath is deprecated since set now supports paths",Ember.set),Ember.trySet=function(e,t,r){return n(e,t,r,!0)},Ember.trySetPath=Ember.deprecateFunc("trySetPath has been renamed to trySet",Ember.trySet),Ember.isGlobalPath=function(e){return i.test(e)}}(),function(){var e=Ember.META_KEY,t=Ember.meta,n=Ember.platform.defineProperty,r=Ember.ENV.MANDATORY_SETTER,i=Ember.Descriptor=function(){},s=Ember.MANDATORY_SETTER_FUNCTION=function(e){},o=Ember.DEFAULT_GETTER_FUNCTION=function(t){return function(){var n=this[e];return n&&n.values[t]}};Ember.defineProperty=function(e,i,u,a,f){var l,c,h,p;return f||(f=t(e)),l=f.descs,c=f.descs[i],h=f.watching[i]>0,c instanceof Ember.Descriptor&&c.teardown(e,i),u instanceof Ember.Descriptor?(p=u,l[i]=u,r&&h?n(e,i,{configurable:!0,enumerable:!0,writable:!0,value:undefined}):e[i]=undefined,u.setup(e,i)):(l[i]=undefined,u==null?(p=a,r&&h?(f.values[i]=a,n(e,i,{configurable:!0,enumerable:!0,set:s,get:o(i)})):e[i]=a):(p=u,n(e,i,u))),h&&Ember.overrideChains(e,i,f),e.didDefineProperty&&e.didDefineProperty(e,i,p),this}}(),function(){function i(){this.clear()}function u(t){return t+e}function a(e){return e+t}var e=":change",t=":before",n=Ember.guidFor,r=0;i.prototype.add=function(e,t,n){var r=this.observerSet,i=this.observers,s=Ember.guidFor(e),o=r[s],u;return o||(r[s]=o={}),u=o[t],u===undefined&&(u=i.push({sender:e,keyName:t,eventName:n,listeners:[]})-1,o[t]=u),i[u].listeners},i.prototype.flush=function(){var e=this.observers,t,n,r,i;this.clear();for(t=0,n=e.length;t<n;++t){r=e[t],i=r.sender;if(i.isDestroying||i.isDestroyed)continue;Ember.sendEvent(i,r.eventName,[i,r.keyName],r.listeners)}},i.prototype.clear=function(){this.observerSet={},this.observers=[]};var s=new i,o=new i;Ember.beginPropertyChanges=function(){r++},Ember.endPropertyChanges=function(){r--,r<=0&&(s.clear(),o.flush())},Ember.changeProperties=function(e,t){Ember.beginPropertyChanges(),Ember.tryFinally(e,Ember.endPropertyChanges,t)},Ember.setProperties=function(e,t){return Ember.changeProperties(function(){for(var n in t)t.hasOwnProperty(n)&&Ember.set(e,n,t[n])}),e},Ember.addObserver=function(e,t,n,r){return Ember.addListener(e,u(t),n,r),Ember.watch(e,t),this},Ember.observersFor=function(e,t){return Ember.listenersFor(e,u(t))},Ember.removeObserver=function(e,t,n,r){return Ember.unwatch(e,t),Ember.removeListener(e,u(t),n,r),this},Ember.addBeforeObserver=function(e,t,n,r){return Ember.addListener(e,a(t),n,r),Ember.watch(e,t),this},Ember._suspendBeforeObserver=function(e,t,n,r,i){return Ember._suspendListener(e,a(t),n,r,i)},Ember._suspendObserver=function(e,t,n,r,i){return Ember._suspendListener(e,u(t),n,r,i)};var f=Ember.ArrayPolyfills.map;Ember._suspendBeforeObservers=function(e,t,n,r,i){var s=f.call(t,a);return Ember._suspendListeners(e,s,n,r,i)},Ember._suspendObservers=function(e,t,n,r,i){var s=f.call(t,u);return Ember._suspendListeners(e,s,n,r,i)},Ember.beforeObserversFor=function(e,t){return Ember.listenersFor(e,a(t))},Ember.removeBeforeObserver=function(e,t,n,r){return Ember.unwatch(e,t),Ember.removeListener(e,a(t),n,r),this},Ember.notifyBeforeObservers=function(e,t){if(e.isDestroying)return;var n=a(t),i,o;r?(i=s.add(e,t,n),o=Ember.listenersDiff(e,n,i),Ember.sendEvent(e,n,[e,t],o)):Ember.sendEvent(e,n,[e,t])},Ember.notifyObservers=function(e,t){if(e.isDestroying)return;var n=u(t),i;r?(i=o.add(e,t,n),Ember.listenersUnion(e,n,i)):Ember.sendEvent(e,n,[e,t])}}(),function(){function h(e){return e.match(a)[0]}function p(e){return e==="*"||!f.test(e)}function d(t,n,r,i,s){var o=e(n);i[o]||(i[o]={});if(i[o][r])return;i[o][r]=!0;var u=s.deps;u=u&&u[r];if(u)for(var a in u){var f=s.descs[a];if(f&&f._suspended===n)continue;t(n,a)}}function g(e,t,n){if(e.isDestroying)return;var r=v,i=!r;i&&(r=v={}),d(A,e,t,r,n),i&&(v=null)}function y(e,t,n){if(e.isDestroying)return;var r=m,i=!r;i&&(r=m={}),d(O,e,t,r,n),i&&(m=null)}function b(e,n,r){if(!e||"object"!=typeof e)return;var i=t(e),s=i.chainWatchers;i.hasOwnProperty("chainWatchers")||(s=i.chainWatchers={}),s[n]||(s[n]=[]),s[n].push(r),Ember.watch(e,n)}function w(e,n,r){if(!e||"object"!=typeof e)return;var i=t(e,!1);if(!i.hasOwnProperty("chainWatchers"))return;var s=i.chainWatchers;if(s[n]){s=s[n];for(var o=0,u=s.length;o<u;o++)s[o]===r&&s.splice(o,1)}Ember.unwatch(e,n)}function S(){if(E.length===0)return;var e=E;E=[],u.call(e,function(e){e[0].add(e[1])})}function x(e){return t(e,!1).proto===e}function C(e){var n=t(e),r=n.chains;return r?r.value()!==e&&(r=n.chains=r.copy(e)):r=n.chains=new T(null,null,e),r}function k(e,t,n,r){if(!n.hasOwnProperty("chainWatchers"))return;var i=n.chainWatchers;i=i[t];if(!i)return;for(var s=0,o=i.length;s<o;s++)i[s].willChange(r)}function L(e,t,n,r){if(!n.hasOwnProperty("chainWatchers"))return;var i=n.chainWatchers;i=i[t];if(!i)return;for(var s=i.length-1;s>=0;s--)i[s].didChange(r)}function A(e,n){var r=t(e,!1),i=r.watching[n]>0||n==="length",s=r.proto,o=r.descs[n];if(!i)return;if(s===e)return;o&&o.willChange&&o.willChange(e,n),g(e,n,r),k(e,n,r),Ember.notifyBeforeObservers(e,n)}function O(e,n){var r=t(e,!1),i=r.watching[n]>0||n==="length",s=r.proto,o=r.descs[n];if(s===e)return;o&&o.didChange&&o.didChange(e,n);if(!i&&n!=="length")return;y(e,n,r),L(e,n,r),Ember.notifyObservers(e,n)}var e=Ember.guidFor,t=Ember.meta,n=Ember.get,r=Ember.set,i=Ember.normalizeTuple,s=Ember.GUID_KEY,o=Ember.META_KEY,u=Ember.ArrayPolyfills.forEach,a=/^([^\.\*]+)/,f=/[\.\*]/,l=Ember.ENV.MANDATORY_SETTER,c=Ember.platform.defineProperty,v,m,E=[],T=function(e,t,n){var r;this._parent=e,this._key=t,this._watching=n===undefined,this._value=n,this._paths={},this._watching&&(this._object=e.value(),this._object&&b(this._object,this._key,this)),this._parent&&this._parent._key==="@each"&&this.value()},N=T.prototype;N.value=function(){if(this._value===undefined&&this._watching){var e=this._parent.value();this._value=e&&!x(e)?n(e,this._key):undefined}return this._value},N.destroy=function(){if(this._watching){var e=this._object;e&&w(e,this._key,this),this._watching=!1}},N.copy=function(e){var t=new T(null,null,e),n=this._paths,r;for(r in n){if(n[r]<=0)continue;t.add(r)}return t},N.add=function(e){var t,n,r,s,o;o=this._paths,o[e]=(o[e]||0)+1,t=this.value(),n=i(t,e);if(n[0]&&n[0]===t)e=n[1],r=h(e),e=e.slice(r.length+1);else{if(!n[0]){E.push([this,e]),n.length=0;return}s=n[0],r=e.slice(0,0-(n[1].length+1)),e=n[1]}n.length=0,this.chain(r,e,s)},N.remove=function(e){var t,n,r,s,o;o=this._paths,o[e]>0&&o[e]--,t=this.value(),n=i(t,e),n[0]===t?(e=n[1],r=h(e),e=e.slice(r.length+1)):(s=n[0],r=e.slice(0,0-(n[1].length+1)),e=n[1]),n.length=0,this.unchain(r,e)},N.count=0,N.chain=function(e,t,n){var r=this._chains,i;r||(r=this._chains={}),i=r[e],i||(i=r[e]=new T(this,e,n)),i.count++,t&&t.length>0&&(e=h(t),t=t.slice(e.length+1),i.chain(e,t))},N.unchain=function(e,t){var n=this._chains,r=n[e];t&&t.length>1&&(e=h(t),t=t.slice(e.length+1),r.unchain(e,t)),r.count--,r.count<=0&&(delete n[r._key],r.destroy())},N.willChange=function(){var e=this._chains;if(e)for(var t in e){if(!e.hasOwnProperty(t))continue;e[t].willChange()}this._parent&&this._parent.chainWillChange(this,this._key,1)},N.chainWillChange=function(e,t,n){this._key&&(t=this._key+"."+t),this._parent?this._parent.chainWillChange(this,t,n+1):(n>1&&Ember.propertyWillChange(this.value(),t),t="this."+t,this._paths[t]>0&&Ember.propertyWillChange(this.value(),t))},N.chainDidChange=function(e,t,n){this._key&&(t=this._key+"."+t),this._parent?this._parent.chainDidChange(this,t,n+1):(n>1&&Ember.propertyDidChange(this.value(),t),t="this."+t,this._paths[t]>0&&Ember.propertyDidChange(this.value(),t))},N.didChange=function(e){if(this._watching){var t=this._parent.value();t!==this._object&&(w(this._object,this._key,this),this._object=t,b(t,this._key,this)),this._value=undefined,this._parent&&this._parent._key==="@each"&&this.value()}var n=this._chains;if(n)for(var r in n){if(!n.hasOwnProperty(r))continue;n[r].didChange(e)}if(e)return;this._parent&&this._parent.chainDidChange(this,this._key,1)},Ember.overrideChains=function(e,t,n){L(e,t,n,!0)},Ember.watch=function(e,n){if(n==="length"&&Ember.typeOf(e)==="array")return this;var r=t(e),i=r.watching,s;return i[n]?i[n]=(i[n]||0)+1:(i[n]=1,p(n)?(s=r.descs[n],s&&s.willWatch&&s.willWatch(e,n),"function"==typeof e.willWatchProperty&&e.willWatchProperty(n),l&&n in e&&(r.values[n]=e[n],c(e,n,{configurable:!0,enumerable:!0,set:Ember.MANDATORY_SETTER_FUNCTION,get:Ember.DEFAULT_GETTER_FUNCTION(n)}))):C(e).add(n)),this},Ember.isWatching=function(t,n){var r=t[o];return(r&&r.watching[n])>0},Ember.watch.flushPending=S,Ember.unwatch=function(e,n){if(n==="length"&&Ember.typeOf(e)==="array")return this;var r=t(e),i=r.watching,s;return i[n]===1?(i[n]=0,p(n)?(s=r.descs[n],s&&s.didUnwatch&&s.didUnwatch(e,n),"function"==typeof e.didUnwatchProperty&&e.didUnwatchProperty(n),l&&n in e&&(c(e,n,{configurable:!0,enumerable:!0,writable:!0,value:r.values[n]}),delete r.values[n])):C(e).remove(n)):i[n]>1&&i[n]--,this},Ember.rewatch=function(e){var n=t(e,!1),r=n.chains;return s in e&&!e.hasOwnProperty(s)&&Ember.generateGuid(e,"ember"),r&&r.value()!==e&&(n.chains=r.copy(e)),this},Ember.finishChains=function(e){var n=t(e,!1),r=n.chains;r&&(r.value()!==e&&(n.chains=r=r.copy(e)),r.didChange(!0))},Ember.propertyWillChange=A,Ember.propertyDidChange=O;var M=[];Ember.destroy=function(e){var t=e[o],n,r,i,s;if(t){e[o]=null,n=t.chains;if(n){M.push(n);while(M.length>0){n=M.pop(),r=n._chains;if(r)for(i in r)r.hasOwnProperty(i)&&M.push(r[i]);n._watching&&(s=n._object,s&&w(s,n._key,n))}}}}}(),function(){function a(e,t,n){var r=t[n];return r?t.hasOwnProperty(n)||(r=t[n]=i(r)):r=t[n]={},r}function f(e,t){return a(e,t,"deps")}function l(e,t,n,r){var i=e._dependentKeys,s,u,l,c,h;if(!i)return;s=f(t,r);for(u=0,l=i.length;u<l;u++)c=i[u],h=a(t,s,c),h[n]=(h[n]||0)+1,o(t,c)}function c(e,t,n,r){var i=e._dependentKeys,s,o,l,c,h;if(!i)return;s=f(t,r);for(o=0,l=i.length;o<l;o++)c=i[o],h=a(t,s,c),h[n]=(h[n]||0)-1,u(t,c)}function h(e,t){this.func=e,this._cacheable=t&&t.cacheable!==undefined?t.cacheable:!0,this._dependentKeys=t&&t.dependentKeys,this._readOnly=t&&(t.readOnly!==undefined||!!t.readOnly)}var e=Ember.get,t=Ember.set,n=Ember.meta,r=[].slice,i=Ember.create,s=Ember.META_KEY,o=Ember.watch,u=Ember.unwatch;Ember.ComputedProperty=h,h.prototype=new Ember.Descriptor;var p=h.prototype;p.cacheable=function(e){return this._cacheable=e!==!1,this},p.volatile=function(){return this.cacheable(!1)},p.readOnly=function(e){return this._readOnly=e===undefined||!!e,this},p.property=function(){var e=[];for(var t=0,n=arguments.length;t<n;t++)e.push(arguments[t]);return this._dependentKeys=e,this},p.meta=function(e){return arguments.length===0?this._meta||{}:(this._meta=e,this)},p.willWatch=function(e,t){var n=e[s];t in n.cache||l(this,e,t,n)},p.didUnwatch=function(e,t){var n=e[s];t in n.cache||c(this,e,t,n)},p.didChange=function(e,t){if(this._cacheable&&this._suspended!==e){var r=n(e);t in r.cache&&(delete r.cache[t],r.watching[t]||c(this,e,t,r))}},p.get=function(e,t){var r,i,s;if(this._cacheable){s=n(e),i=s.cache;if(t in i)return i[t];r=i[t]=this.func.call(e,t),s.watching[t]||l(this,e,t,s)}else r=this.func.call(e,t);return r},p.set=function(e,t,r){var i=this._cacheable,s=this.func,o=n(e,i),u=o.watching[t],a=this._suspended,f=!1,c=o.cache,h,p;if(this._readOnly)throw new Error("Cannot Set: "+t+" on: "+e.toString());this._suspended=e;try{i&&c.hasOwnProperty(t)&&(h=c[t],f=!0),s.wrappedFunction&&(s=s.wrappedFunction);if(s.length===3)p=s.call(e,t,r,h);else{if(s.length!==2){Ember.defineProperty(e,t,null,h),Ember.set(e,t,r);return}p=s.call(e,t,r)}if(f&&h===p)return;u&&Ember.propertyWillChange(e,t),f&&delete c[t],i&&(!u&&!f&&l(this,e,t,o),c[t]=p),u&&Ember.propertyDidChange(e,t)}finally{this._suspended=a}return p},p.setup=function(e,t){var r=e[s];r&&r.watching[t]&&l(this,e,t,n(e))},p.teardown=function(e,t){var r=n(e);return(r.watching[t]||t in r.cache)&&c(this,e,t,r),this._cacheable&&delete r.cache[t],null},Ember.computed=function(e){var t;arguments.length>1&&(t=r.call(arguments,0,-1),e=r.call(arguments,-1)[0]);if(typeof e!="function")throw new Error("Computed Property declared without a property function");var n=new h(e);return t&&n.property.apply(n,t),n},Ember.cacheFor=function(t,r){var i=n(t,!1).cache;if(i&&r in i)return i[r]},Ember.computed.not=function(t){return Ember.computed(t,function(n){return!e(this,t)})},Ember.computed.none=function(t){return Ember.computed(t,function(n){var r=e(this,t);return Ember.isNone(r)})},Ember.computed.empty=function(t){return Ember.computed(t,function(n){var r=e(this,t);return Ember.isEmpty(r)})},Ember.computed.bool=function(t){return Ember.computed(t,function(n){return!!e(this,t)})},Ember.computed.alias=function(n){return Ember.computed(n,function(r,i){return arguments.length>1?(t(this,n,i),i):e(this,n)})}}(),function(){function r(e,t,n){var r=-1;for(var i=0,s=e.length;i<s;i++)if(t===e[i][0]&&n===e[i][1]){r=i;break}return r}function i(n,r){var i=t(n,!0),s;return i.listeners||(i.listeners={}),i.hasOwnProperty("listeners")||(i.listeners=e(i.listeners)),s=i.listeners[r],s&&!i.listeners.hasOwnProperty(r)?s=i.listeners[r]=i.listeners[r].slice():s||(s=i.listeners[r]=[]),s}function s(e,t,i){var s=e[n],o=s&&s.listeners&&s.listeners[t];if(!o)return;for(var u=o.length-1;u>=0;u--){var a=o[u][0],f=o[u][1],l=o[u][2],c=o[u][3],h=r(i,a,f);h===-1&&i.push([a,f,l,c])}}function o(e,t,i){var s=e[n],o=s&&s.listeners&&s.listeners[t],u=[];if(!o)return;for(var a=o.length-1;a>=0;a--){var f=o[a][0],l=o[a][1],c=o[a][2],h=o[a][3],p=r(i,f,l);if(p!==-1)continue;i.push([f,l,c,h]),u.push([f,l,c,h])}return u}function u(e,t,n,s,o){!s&&"function"==typeof n&&(s=n,n=null);var u=i(e,t),a=r(u,n,s);if(a!==-1)return;u.push([n,s,o,undefined]),"function"==typeof e.didAddListener&&e.didAddListener(t,n,s)}function a(e,t,s,o){function u(n,s,o){var u=i(e,t),a=r(u,n,s);if(a===-1)return;u.splice(a,1),"function"==typeof e.didRemoveListener&&e.didRemoveListener(t,n,s)}!o&&"function"==typeof s&&(o=s,s=null);if(o)u(s,o);else{var a=e[n],f=a&&a.listeners&&a.listeners[t];if(!f)return;for(var l=f.length-1;l>=0;l--)u(f[l][0],f[l][1])}}function f(e,t,n,s,o){function l(){return o.call(n)}function c(){f&&(f[3]=undefined)}!s&&"function"==typeof n&&(s=n,n=null);var u=i(e,t),a=r(u,n,s),f;return a!==-1&&(f=u[a].slice(),f[3]=!0,u[a]=f),Ember.tryFinally(l,c)}function l(e,t,n,s,o){function d(){return o.call(n)}function v(){for(c=0,h=u.length;c<h;c++)u[c][3]=undefined}!s&&"function"==typeof n&&(s=n,n=null);var u=[],a,f,l,c,h;for(c=0,h=t.length;c<h;c++){a=t[c],f=i(e,a);var p=r(f,n,s);p!==-1&&(l=f[p].slice(),l[3]=!0,f[p]=l,u.push(l))}return Ember.tryFinally(d,v)}function c(e){var t=e[n].listeners,r=[];if(t)for(var i in t)t[i]&&r.push(i);return r}function h(e,t,r,i){e!==Ember&&"function"==typeof e.sendEvent&&e.sendEvent(t,r);if(!i){var s=e[n];i=s&&s.listeners&&s.listeners[t]}if(!i)return;for(var o=i.length-1;o>=0;o--){if(!i[o]||i[o][3]===!0)continue;var u=i[o][0],f=i[o][1],l=i[o][2];l&&a(e,t,u,f),u||(u=e),"string"==typeof f&&(f=u[f]),r?f.apply(u,r):f.apply(u)}return!0}function p(e,t){var r=e[n],i=r&&r.listeners&&r.listeners[t];return!!i&&!!i.length}function d(e,t){var r=[],i=e[n],s=i&&i.listeners&&i.listeners[t];if(!s)return r;for(var o=0,u=s.length;o<u;o++){var a=s[o][0],f=s[o][1];r.push([a,f])}return r}var e=Ember.create,t=Ember.meta,n=Ember.META_KEY;Ember.addListener=u,Ember.removeListener=a,Ember._suspendListener=f,Ember._suspendListeners=l,Ember.sendEvent=h,Ember.hasListeners=p,Ember.watchedEvents=c,Ember.listenersFor=d,Ember.listenersDiff=o,Ember.listenersUnion=s}(),function(){function n(t,n,r,i){return n===undefined&&(n=t,t=undefined),"string"==typeof n&&(n=t[n]),r&&i>0&&(r=r.length>i?e.call(r,i):null),Ember.handleErrors(function(){return n.apply(t||this,r||[])},this)}function u(){o=null,s.currentRunLoop&&s.end()}function c(){f=null,s(function(){var e=+(new Date),t=-1;for(var r in a){if(!a.hasOwnProperty(r))continue;var i=a[r];if(i&&i.expires)if(e>=i.expires)delete a[r],n(i.target,i.method,i.args,2);else if(t<0||i.expires<t)t=i.expires}t>0&&(f=setTimeout(c,t-e),l=t)})}function h(e,t){t[this.tguid]&&delete t[this.tguid][this.mguid],a[e]&&n(this.target,this.method,this.args),delete a[e]}function p(e,t,n,r){var i=Ember.guidFor(t),o=Ember.guidFor(n),u=s.autorun().onceTimers,f=u[i]&&u[i][o],l;return f&&a[f]?a[f].args=r:(l={target:t,method:n,args:r,tguid:i,mguid:o},f=Ember.guidFor(l),a[f]=l,u[i]||(u[i]={}),u[i][o]=f,s.schedule(e,l,h,f,u)),f}var e=[].slice,t=Ember.ArrayPolyfills.forEach,r,i=function(e){this._prev=e||null,this.onceTimers={}};i.prototype={end:function(){this.flush()},prev:function(){return this._prev},schedule:function(t,n,r){var i=this._queues,s;i||(i=this._queues={}),s=i[t],s||(s=i[t]=[]);var o=arguments.length>3?e.call(arguments,3):null;return s.push({target:n,method:r,args:o}),this},flush:function(e){function f(e){n(e.target,e.method,e.args)}function l(){t.call(u,f)}var i,s,o,u,a;if(!this._queues)return this;Ember.watch.flushPending();if(e)while(this._queues&&(u=this._queues[e]))this._queues[e]=null,e==="sync"?(a=Ember.LOG_BINDINGS,a&&Ember.Logger.log("Begin: Flush Sync Queue"),Ember.beginPropertyChanges(),Ember.tryFinally(l,Ember.endPropertyChanges),a&&Ember.Logger.log("End: Flush Sync Queue")):t.call(u,f);else{i=Ember.run.queues,o=i.length,s=0;e:while(s<o){e=i[s],u=this._queues&&this._queues[e],delete this._queues[e],u&&(e==="sync"?(a=Ember.LOG_BINDINGS,a&&Ember.Logger.log("Begin: Flush Sync Queue"),Ember.beginPropertyChanges(),Ember.tryFinally(l,Ember.endPropertyChanges),a&&Ember.Logger.log("End: Flush Sync Queue")):t.call(u,f));for(var c=0;c<=s;c++)if(this._queues&&this._queues[i[c]]){s=c;continue e}s++}}return r=null,this}},Ember.RunLoop=i,Ember.run=function(e,t){function i(){if(e||t)return n(e,t,r,2)}var r=arguments;return s.begin(),Ember.tryFinally(i,s.end)};var s=Ember.run;Ember.run.begin=function(){s.currentRunLoop=new i(s.currentRunLoop)},Ember.run.end=function(){function e(){s.currentRunLoop.end()}function t(){s.currentRunLoop=s.currentRunLoop.prev()}Ember.tryFinally(e,t)},Ember.run.queues=["sync","actions","destroy"],Ember.run.schedule=function(e,t,n){var r=s.autorun();r.schedule.apply(r,arguments)};var o;Ember.run.hasScheduledTimers=function(){return!!o||!!f},Ember.run.cancelTimers=function(){o&&(clearTimeout(o),o=null),f&&(clearTimeout(f),f=null),a={}},Ember.run.autorun=function(){return s.currentRunLoop||(s.begin(),o||(o=setTimeout(u,1))),s.currentRunLoop},Ember.run.sync=function(){s.autorun(),s.currentRunLoop.flush("sync")};var a={},f,l;Ember.run.later=function(t,n){var r,i,s,o,u;return arguments.length===2&&"function"==typeof t?(u=n,n=t,t=undefined,r=[t,n]):(r=e.call(arguments),u=r.pop()),i=+(new Date)+u,s={target:t,method:n,expires:i,args:r},o=Ember.guidFor(s),a[o]=s,f&&i<l&&(clearTimeout(f),f=null),f||(f=setTimeout(c,u),l=i),o},Ember.run.once=function(t,n){return p("actions",t,n,e.call(arguments,2))},Ember.run.scheduleOnce=function(t
|
16
|
+
,n,r,i){return p(t,n,r,e.call(arguments,3))},Ember.run.next=function(){var t=e.call(arguments);return t.push(1),s.later.apply(this,t)},Ember.run.cancel=function(e){delete a[e]}}(),function(){function i(t,n){return e(r(n)?Ember.lookup:t,n)}function o(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])}Ember.LOG_BINDINGS=!!Ember.ENV.LOG_BINDINGS;var e=Ember.get,t=Ember.set,n=Ember.guidFor,r=Ember.isGlobalPath,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(e){var t=this._from,n=this._to;return Ember.trySet(e,n,i(e,t)),Ember.addObserver(e,t,this,this.fromDidChange),this._oneWay||Ember.addObserver(e,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 n=this._directionMap,r=n.get(e);r||(Ember.run.schedule("sync",this,this._sync,e),n.set(e,t)),r==="back"&&t==="fwd"&&n.set(e,"fwd")},_sync:function(t){var n=Ember.LOG_BINDINGS;if(t.isDestroyed||!this._readyToSync)return;var r=this._directionMap,s=r.get(t),o=this._from,u=this._to;r.remove(t);if(s==="fwd"){var a=i(t,this._from);n&&Ember.Logger.log(" ",this.toString(),"->",a,t),this._oneWay?Ember.trySet(t,u,a):Ember._suspendObserver(t,u,this,this.toDidChange,function(){Ember.trySet(t,u,a)})}else if(s==="back"){var f=e(t,this._to);n&&Ember.Logger.log(" ",this.toString(),"<-",f,t),Ember._suspendObserver(t,o,this,this.fromDidChange,function(){Ember.trySet(Ember.isGlobalPath(o)?Ember.lookup:t,o,f)})}}},o(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 n=this,r=new n(null,e);return r.oneWay(t)}}),Ember.Binding=s,Ember.bind=function(e,t,n){return(new Ember.Binding(t,n)).connect(e)},Ember.oneWay=function(e,t,n){return(new Ember.Binding(t,n)).oneWay().connect(e)}}(),function(){function l(e){var t=Ember.meta(e,!0),n=t.mixins;return n?t.hasOwnProperty("mixins")||(n=t.mixins=u(n)):n=t.mixins={},n}function c(t,n){return n&&n.length>0&&(t.mixins=r.call(n,function(t){if(t instanceof e)return t;var n=new e;return n.properties=t,n})),t}function h(e){return"function"==typeof e&&e.isMethod!==!1&&e!==Boolean&&e!==Object&&e!==Number&&e!==Array&&e!==Date&&e!==String}function d(t,n){var r;return n instanceof e?(r=f(n),t[r]?p:(t[r]=n,n.properties)):n}function v(e,t,n){var r;return r=t.concatenatedProperties||n.concatenatedProperties,e.concatenatedProperties&&(r=r?r.concat(e.concatenatedProperties):e.concatenatedProperties),r}function m(e,t,n,r,i){var s;return r[t]===undefined&&(s=i[t]),s=s||e.descs[t],!!s&&s instanceof Ember.ComputedProperty?(n=u(n),n.func=Ember.wrap(n.func,s.func),n):n}function g(e,t,n,r,i){var s;return i[t]===undefined&&(s=r[t]),s=s||e[t],"function"!=typeof s?n:Ember.wrap(n,s)}function y(e,t,n,r){var i=r[t]||e[t];return i?"function"==typeof i.concat?i.concat(n):Ember.makeArray(i).concat(n):Ember.makeArray(n)}function b(e,n,r,s,o,u,a){if(r instanceof Ember.Descriptor){if(r===t&&o[n])return p;r.func&&(r=m(s,n,r,u,o)),o[n]=r,u[n]=undefined}else{if(h(r))r=g(e,n,r,u,o);else if(a&&i.call(a,n)>=0||n==="concatenatedProperties")r=y(e,n,r,u);o[n]=undefined,u[n]=r}}function w(e,t,n,r,i){function c(e){delete n[e],delete r[e]}var o,u,a,f,l;for(var h=0,m=e.length;h<m;h++){o=e[h],u=d(t,o);if(u===p)continue;if(u){l=Ember.meta(i),f=v(u,r,i);for(a in u){if(!u.hasOwnProperty(a))continue;b(i,a,u[a],l,n,r,f)}u.hasOwnProperty("toString")&&(i.toString=u.toString)}else o.mixins&&(w(o.mixins,t,n,r,i),o._without&&s.call(o._without,c))}}function E(e){var t=Ember.meta(e),n=t.required;if(!n||!t.hasOwnProperty("required"))n=t.required=n?u(n):{};return n}function x(e,t,n,r){if(S.test(t)){var i=r.bindings;i?r.hasOwnProperty("bindings")||(i=r.bindings=u(r.bindings)):i=r.bindings={},i[t]=n}}function T(e,t){var n=t.bindings,r,i,s;if(n){for(r in n)i=n[r],i&&(s=r.slice(0,-7),i instanceof Ember.Binding?(i=i.copy(),i.to(s)):i=new Ember.Binding(s,i),i.connect(e),e[r]=i);t.bindings={}}}function N(e,t){return T(e,t||Ember.meta(e)),e}function C(e,t,n,r,i){var s=t.methodName,o;return r[s]||i[s]?(o=i[s],t=r[s]):n.descs[s]?(t=n.descs[s],o=undefined):(t=undefined,o=e[s]),{desc:t,value:o}}function k(e,t,n,r,i){if("function"!=typeof n)return;var s=n[r];if(s)for(var o=0,u=s.length;o<u;o++)Ember[i](e,s[o],null,t)}function L(e,t,n){var r=e[t];k(e,t,r,"__ember_observesBefore__","removeBeforeObserver"),k(e,t,r,"__ember_observes__","removeObserver"),k(e,t,n,"__ember_observesBefore__","addBeforeObserver"),k(e,t,n,"__ember_observes__","addObserver")}function A(e,r,i){var s={},o={},u=Ember.meta(e),f,c,h;w(r,l(e),s,o,e);for(f in o){if(f==="contructor"||!o.hasOwnProperty(f))continue;h=s[f],c=o[f];if(h===t)continue;while(h&&h instanceof n){var p=C(e,h,u,s,o);h=p.desc,c=p.value}if(h===undefined&&c===undefined)continue;L(e,f,c),x(e,f,c,u),a(e,f,h,c,u)}return i||N(e,u),e}function M(e,t,n){var r=f(e);if(n[r])return!1;n[r]=!0;if(e===t)return!0;var i=e.mixins,s=i?i.length:0;while(--s>=0)if(M(i[s],t,n))return!0;return!1}function _(e,t,n){if(n[f(t)])return;n[f(t)]=!0;if(t.properties){var r=t.properties;for(var i in r)r.hasOwnProperty(i)&&(e[i]=!0)}else t.mixins&&s.call(t.mixins,function(t){_(e,t,n)})}var e,t,n,r=Ember.ArrayPolyfills.map,i=Ember.ArrayPolyfills.indexOf,s=Ember.ArrayPolyfills.forEach,o=[].slice,u=Ember.create,a=Ember.defineProperty,f=Ember.guidFor,p={},S=Ember.IS_BINDING=/^.+Binding$/;Ember.mixin=function(e){var t=o.call(arguments,1);return A(e,t,!1),e},Ember.Mixin=function(){return c(this,arguments)},e=Ember.Mixin,e._apply=A,e.applyPartial=function(e){var t=o.call(arguments,1);return A(e,t,!0)},e.finishPartial=N,Ember.anyUnprocessedMixins=!1,e.create=function(){Ember.anyUnprocessedMixins=!0;var e=this;return c(new e,arguments)};var O=e.prototype;O.reopen=function(){var t,n;this.properties?(t=e.create(),t.properties=this.properties,delete this.properties,this.mixins=[t]):this.mixins||(this.mixins=[]);var r=arguments.length,i=this.mixins,s;for(s=0;s<r;s++)t=arguments[s],t instanceof e?i.push(t):(n=e.create(),n.properties=t,i.push(n));return this},O.apply=function(e){return A(e,[this],!1)},O.applyPartial=function(e){return A(e,[this],!0)},O.detect=function(t){if(!t)return!1;if(t instanceof e)return M(t,this,{});var n=Ember.meta(t,!1).mixins;return n?!!n[f(this)]:!1},O.without=function(){var t=new e(this);return t._without=o.call(arguments),t},O.keys=function(){var e={},t={},n=[];_(e,this,t);for(var r in e)e.hasOwnProperty(r)&&n.push(r);return n},e.mixins=function(e){var t=Ember.meta(e,!1).mixins,n=[];if(!t)return n;for(var r in t){var i=t[r];i.properties||n.push(i)}return n},t=new Ember.Descriptor,t.toString=function(){return"(Required Property)"},Ember.required=function(){return t},n=function(e){this.methodName=e},n.prototype=new Ember.Descriptor,Ember.alias=function(e){return new n(e)},Ember.deprecateFunc("Ember.alias is deprecated. Please use Ember.aliasMethod or Ember.computed.alias instead.",Ember.alias),Ember.aliasMethod=function(e){return new n(e)},Ember.observer=function(e){var t=o.call(arguments,1);return e.__ember_observes__=t,e},Ember.immediateObserver=function(){for(var e=0,t=arguments.length;e<t;e++)var n=arguments[e];return Ember.observer.apply(this,arguments)},Ember.beforeObserver=function(e){var t=o.call(arguments,1);return e.__ember_observesBefore__=t,e}}(),function(){}(),function(){e("rsvp",[],function(){"use strict";function d(e,t){n.async(function(){e.trigger("promise:resolved",{detail:t}),e.isResolved=!0,e.resolvedValue=t})}function v(e,t){n.async(function(){e.trigger("promise:failed",{detail:t}),e.isRejected=!0,e.rejectedValue=t})}function m(e){var t,n=[],r=new c,i=e.length;i===0&&r.resolve([]);var s=function(e){return function(t){o(e,t)}},o=function(e,t){n[e]=t,--i===0&&r.resolve(n)},u=function(e){r.reject(e)};for(t=0;t<i;t++)e[t].then(s(t),u);return r}var e=typeof window!="undefined"?window:{},t=e.MutationObserver||e.WebKitMutationObserver,n,r;if(typeof process!="undefined"&&{}.toString.call(process)==="[object process]")r=function(e,t){process.nextTick(function(){e.call(t)})};else if(t){var i=[],s=new t(function(){var e=i.slice();i=[],e.forEach(function(e){var t=e[0],n=e[1];t.call(n)})}),o=document.createElement("div");s.observe(o,{attributes:!0}),window.addEventListener("unload",function(){s.disconnect(),s=null}),r=function(e,t){i.push([e,t]),o.setAttribute("drainQueue","drainQueue")}}else r=function(e,t){setTimeout(function(){e.call(t)},1)};var u=function(e,t){this.type=e;for(var n in t){if(!t.hasOwnProperty(n))continue;this[n]=t[n]}},a=function(e,t){for(var n=0,r=e.length;n<r;n++)if(e[n][0]===t)return n;return-1},f=function(e){var t=e._promiseCallbacks;return t||(t=e._promiseCallbacks={}),t},l={mixin:function(e){return e.on=this.on,e.off=this.off,e.trigger=this.trigger,e},on:function(e,t,n){var r=f(this),i,s;e=e.split(/\s+/),n=n||this;while(s=e.shift())i=r[s],i||(i=r[s]=[]),a(i,t)===-1&&i.push([t,n])},off:function(e,t){var n=f(this),r,i,s;e=e.split(/\s+/);while(i=e.shift()){if(!t){n[i]=[];continue}r=n[i],s=a(r,t),s!==-1&&r.splice(s,1)}},trigger:function(e,t){var n=f(this),r,i,s,o,a;if(r=n[e])for(var l=0;l<r.length;l++)i=r[l],s=i[0],o=i[1],typeof t!="object"&&(t={detail:t}),a=new u(e,t),s.call(o,a)}},c=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)},h=function(){},p=function(e,t,n,r){var i=typeof n=="function",s,o,u,a;if(i)try{s=n(r.detail),u=!0}catch(f){a=!0,o=f}else s=r.detail,u=!0;s&&typeof s.then=="function"?s.then(function(e){t.resolve(e)},function(e){t.reject(e)}):i&&u?t.resolve(s):a?t.reject(o):t[e](s)};return c.prototype={then:function(e,t){var r=new c;return this.isResolved&&n.async(function(){p("resolve",r,e,{detail:this.resolvedValue})},this),this.isRejected&&n.async(function(){p("reject",r,t,{detail:this.rejectedValue})},this),this.on("promise:resolved",function(t){p("resolve",r,e,t)}),this.on("promise:failed",function(e){p("reject",r,t,e)}),r},resolve:function(e){d(this,e),this.resolve=h,this.reject=h},reject:function(e){v(this,e),this.resolve=h,this.reject=h}},l.mixin(c.prototype),n={async:r,Promise:c,Event:u,EventTarget:l,all:m,raiseOnUncaughtExceptions:!0},n})}(),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 n(e){throw new Error(e+" is not currently supported on child containers")}function r(e,t){var n=s(e,t,"singleton");return n!==!1}function i(e,t){var n={};if(!t)return n;var r,i;for(var s=0,o=t.length;s<o;s++)r=t[s],i=e.lookup(r.fullName),n[r.property]=i;return n}function s(e,t,n){var r=e._options.get(t);if(r&&r[n]!==undefined)return r[n];var i=t.split(":")[0];r=e._typeOptions.get(i);if(r)return r[n]}function o(e,t){var n=e.normalize(t);return e.resolve(n)}function u(e,t){var n=o(e,t),r=t.split(":"),u=r[0],a=r[1],f;if(s(e,t,"instantiate")===!1)return n;if(n){var l=[];l=l.concat(e.typeInjections.get(u)||[]),l=l.concat(e.injections[t]||[]);var c=i(e,l);return c.container=e,c._debugContainerKey=t,f=n.create(c),f}}function a(e,t){e.cache.eachLocal(function(n,r){if(s(e,n,"instantiate")===!1)return;t(r)})}function f(e){e.cache.eachLocal(function(t,n){if(s(e,t,"instantiate")===!1)return;n.destroy()}),e.cache.dict={}}return e.prototype={get:function(e){var t=this.dict;if(t.hasOwnProperty(e))return t[e];if(this.parent)return this.parent.get(e)},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 n=this.dict;for(var r in n)n.hasOwnProperty(r)&&e.call(t,r,n[r])}},t.prototype={child:function(){var e=new t(this);return this.children.push(e),e},set:function(e,t,n){e[t]=n},register:function(e,t,n,r){var i;e.indexOf(":")!==-1?(r=n,n=t,i=e):i=e+":"+t;var s=this.normalize(i);this.registry.set(s,n),this._options.set(s,r||{})},resolve:function(e){return this.resolver(e)||this.registry.get(e)},normalize:function(e){return e},lookup:function(e,t){e=this.normalize(e),t=t||{};if(this.cache.has(e)&&t.singleton!==!1)return this.cache.get(e);var n=u(this,e);if(!n)return;return r(this,e)&&t.singleton!==!1&&this.cache.set(e,n),n},has:function(e){return this.cache.has(e)?!0:!!o(this,e)},optionsForType:function(e,t){this.parent&&n("optionsForType"),this._typeOptions.set(e,t)},options:function(e,t){this.optionsForType(e,t)},typeInjection:function(e,t,r){this.parent&&n("typeInjection");var i=this.typeInjections.get(e);i||(i=[],this.typeInjections.set(e,i)),i.push({property:t,fullName:r})},injection:function(e,t,r){this.parent&&n("injection");if(e.indexOf(":")===-1)return this.typeInjection(e,t,r);var i=this.injections[e]=this.injections[e]||[];i.push({property:t,fullName:r})},destroy:function(){this.isDestroyed=!0;for(var e=0,t=this.children.length;e<t;e++)this.children[e].destroy();this.children=[],a(this,function(e){e.isDestroying=!0}),a(this,function(e){e.destroy()}),delete this.parent,this.isDestroyed=!0},reset:function(){for(var e=0,t=this.children.length;e<t;e++)f(this.children[e]);f(this)}},t})}(),function(){function i(t,n,r,s){var o,u,a;if("object"!=typeof t||t===null)return t;if(n&&(u=e(r,t))>=0)return s[u];if(Ember.typeOf(t)==="array"){o=t.slice();if(n){u=o.length;while(--u>=0)o[u]=i(o[u],n,r,s)}}else if(Ember.Copyable&&Ember.Copyable.detect(t))o=t.copy(n,r,s);else{o={};for(a in t){if(!t.hasOwnProperty(a))continue;if(a.substring(0,2)==="__")continue;o[a]=n?i(t[a],n,r,s):t[a]}}return n&&(r.push(t),s.push(o)),o}var e=Ember.EnumerableUtils.indexOf,t={},n="Boolean Number String Function Array Date RegExp Object".split(" ");Ember.ArrayPolyfills.forEach.call(n,function(e){t["[object "+e+"]"]=e.toLowerCase()});var r=Object.prototype.toString;Ember.typeOf=function(e){var n;return n=e===null||e===undefined?String(e):t[r.call(e)]||"object",n==="function"?Ember.Object&&Ember.Object.detect(e)&&(n="class"):n==="object"&&(e instanceof Error?n="error":Ember.Object&&e instanceof Ember.Object?n="instance":n="object"),n},Ember.compare=function o(e,t){if(e===t)return 0;var n=Ember.typeOf(e),r=Ember.typeOf(t),i=Ember.Comparable;if(i){if(n==="instance"&&i.detect(e.constructor))return e.constructor.compare(e,t);if(r==="instance"&&i.detect(t.constructor))return 1-t.constructor.compare(t,e)}var s=Ember.ORDER_DEFINITION_MAPPING;if(!s){var u=Ember.ORDER_DEFINITION;s=Ember.ORDER_DEFINITION_MAPPING={};var a,f;for(a=0,f=u.length;a<f;++a)s[u[a]]=a;delete Ember.ORDER_DEFINITION}var l=s[n],c=s[r];if(l<c)return-1;if(l>c)return 1;switch(n){case"boolean":case"number":if(e<t)return-1;if(e>t)return 1;return 0;case"string":var h=e.localeCompare(t);if(h<0)return-1;if(h>0)return 1;return 0;case"array":var p=e.length,d=t.length,v=Math.min(p,d),m=0,g=0;while(m===0&&g<v)m=o(e[g],t[g]),g++;if(m!==0)return m;if(p<d)return-1;if(p>d)return 1;return 0;case"instance":if(Ember.Comparable&&Ember.Comparable.detect(e))return e.compare(e,t);return 0;case"date":var y=e.getTime(),b=t.getTime();if(y<b)return-1;if(y>b)return 1;return 0;default:return 0}},Ember.copy=function(e,t){return"object"!=typeof e||e===null?e:Ember.Copyable&&Ember.Copyable.detect(e)?e.copy(t):i(e,t,t?[]:null,t?[]:null)},Ember.inspect=function(e){if(typeof e!="object"||e===null)return e+"";var t,n=[];for(var r in e)if(e.hasOwnProperty(r)){t=e[r];if(t==="toString")continue;Ember.typeOf(t)==="function"&&(t="function() { ... }"),n.push(r+": "+t)}return"{"+n.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 n in e)e.hasOwnProperty(n)&&t.push(n);return t});var s=["description","fileName","lineNumber","message","name","number","stack"];Ember.Error=function(){var e=Error.prototype.constructor.apply(this,arguments);for(var t=0;t<s.length;t++)this[s[t]]=e[s[t]]},Ember.Error.prototype=Ember.create(Error.prototype)}(),function(){Ember.RSVP=t("rsvp")}(),function(){var e=/[ _]/g,t={},n=/([a-z])([A-Z])/g,r=/(\-|_|\.|\s)+(.)?/g,i=/([a-z\d])([A-Z]+)/g,s=/\-|\s+/g;Ember.STRINGS={},Ember.String={fmt:function(e,t){var n=0;return e.replace(/%@([0-9]+)?/g,function(e,r){return r=r?parseInt(r,0)-1:n++,e=t[r],(e===null?"(null)":e===undefined?"":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(n,"$1_$2").toLowerCase()},dasherize:function(n){var r=t,i=r.hasOwnProperty(n),s;return i?r[n]:(s=Ember.String.decamelize(n).replace(e,"-"),r[n]=s,s)},camelize:function(e){return e.replace(r,function(e,t,n){return n?n.toUpperCase():""}).replace(/^([A-Z])/,function(e,t,n){return e.toLowerCase()})},classify:function(e){var t=e.split("."),n=[];for(var r=0,i=t.length;r<i;r++){var s=Ember.String.camelize(t[r]);n.push(s.charAt(0).toUpperCase()+s.substr(1))}return n.join(".")},underscore:function(e){return e.replace(i,"$1_$2").replace(s,"_").toLowerCase()},capitalize:function(e){return e.charAt(0).toUpperCase()+e.substr(1)}}}(),function(){var e=Ember.String.fmt,t=Ember.String.w,n=Ember.String.loc,r=Ember.String.camelize,i=Ember.String.decamelize,s=Ember.String.dasherize,o=Ember.String.underscore,u=Ember.String.capitalize,a=Ember.String.classify;if(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 n(this,arguments)},String.prototype.camelize=function(){return r(this)},String.prototype.decamelize=function(){return i(this)},String.prototype.dasherize=function(){return s(this)},String.prototype.underscore=function(){return o(this)},String.prototype.classify=function(){return a(this)},String.prototype.capitalize=function(){return u(this)}}(),function(){var e=Array.prototype.slice;if(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(){function s(){return i.length===0?{}:i.pop()}function o(e){return i.push(e),null}function u(t,n){function i(i){var s=e(i,t);return r?n===s:!!s}var r=arguments.length===2;return i}var e=Ember.get,t=Ember.set,n=Array.prototype.slice,r=Ember.EnumerableUtils.indexOf,i=[];Ember.Enumerable=Ember.Mixin.create({isEnumerable:!0,nextObject:Ember.required(Function),firstObject:Ember.computed(function(){if(e(this,"length")===0)return undefined;var t=s(),n;return n=this.nextObject(0,null,t),o(t),n}).property("[]"),lastObject:Ember.computed(function(){var t=e(this,"length");if(t===0)return undefined;var n=s(),r=0,i,u=null;do u=i,i=this.nextObject(r++,u,n);while(i!==undefined);return o(n),u}).property("[]"),contains:function(e){return this.find(function(t){return t===e})!==undefined},forEach:function(t,n){if(typeof t!="function")throw new TypeError;var r=e(this,"length"),i=null,u=s();n===undefined&&(n=null);for(var a=0;a<r;a++){var f=this.nextObject(a,i,u);t.call(n,f,a,this),i=f}return i=null,u=o(u),this},getEach:function(e){return this.mapProperty(e)},setEach:function(e,n){return this.forEach(function(r){t(r,e,n)})},map:function(e,t){var n=Ember.A([]);return this.forEach(function(r,i,s){n[i]=e.call(t,r,i,s)}),n},mapProperty:function(t){return this.map(function(n){return e(n,t)})},filter:function(e,t){var n=Ember.A([]);return this.forEach(function(r,i,s){e.call(t,r,i,s)&&n.push(r)}),n},reject:function(e,t){return this.filter(function(){return!e.apply(t,arguments)})},filterProperty:function(e,t){return this.filter(u.apply(this,arguments))},rejectProperty:function(t,n){var r=function(r){return e(r,t)===n},i=function(n){return!!e(n,t)},s=arguments.length===2?r:i;return this.reject(s)},find:function(t,n){var r=e(this,"length");n===undefined&&(n=null);var i=null,u,a=!1,f,l=s();for(var c=0;c<r&&!a;c++){u=this.nextObject(c,i,l);if(a=t.call(n,u,c,this))f=u;i=u}return u=i=null,l=o(l),f},findProperty:function(e,t){return this.find(u.apply(this,arguments))},every:function(e,t){return!this.find(function(n,r,i){return!e.call(t,n,r,i)})},everyProperty:function(e,t){return this.every(u.apply(this,arguments))},some:function(e,t){return!!this.find(function(n,r,i){return!!e.call(t,n,r,i)})},someProperty:function(e,t){return this.some(u.apply(this,arguments))},reduce:function(e,t,n){if(typeof e!="function")throw new TypeError;var r=t;return this.forEach(function(t,i){r=e.call(null,r,t,i,this,n)},this),r},invoke:function(e){var t,r=Ember.A([]);return arguments.length>1&&(t=n.call(arguments,1)),this.forEach(function(n,i){var s=n&&n[e];"function"==typeof s&&(r[i]=t?s.apply(n,t):s.call(n))},this),r},toArray:function(){var e=Ember.A([]);return this.forEach(function(t,n){e[n]=t}),e},compact:function(){return this.without(null)},without:function(e){if(!this.contains(e))return this;var t=Ember.A([]);return this.forEach(function(n){n!==e&&(t[t.length]=n)}),t},uniq:function(){var e=Ember.A([]);return this.forEach(function(t){r(e,t)<0&&e.push(t)}),e},"[]":Ember.computed(function(e,t){return this}),addEnumerableObserver:function(t,n){var r=n&&n.willChange||"enumerableWillChange",i=n&&n.didChange||"enumerableDidChange",s=e(this,"hasEnumerableObservers");return s||Ember.propertyWillChange(this,"hasEnumerableObservers"),Ember.addListener(this,"@enumerable:before",t,r),Ember.addListener(this,"@enumerable:change",t,i),s||Ember.propertyDidChange(this,"hasEnumerableObservers"),this},removeEnumerableObserver:function(t,n){var r=n&&n.willChange||"enumerableWillChange",i=n&&n.didChange||"enumerableDidChange",s=e(this,"hasEnumerableObservers");return s&&Ember.propertyWillChange(this,"hasEnumerableObservers"),Ember.removeListener(this,"@enumerable:before",t,r),Ember.removeListener(this,"@enumerable:change",t,i),s&&Ember.propertyDidChange(this,"hasEnumerableObservers"),this},hasEnumerableObservers:Ember.computed(function(){return Ember.hasListeners(this,"@enumerable:change")||Ember.hasListeners(this,"@enumerable:before")}),enumerableContentWillChange:function(t,n){var r,i,s;return"number"==typeof t?r=t:t?r=e(t,"length"):r=t=-1,"number"==typeof n?i=n:n?i=e(n,"length"):i=n=-1,s=i<0||r<0||i-r!==0,t===-1&&(t=null),n===-1&&(n=null),Ember.propertyWillChange(this,"[]"),s&&Ember.propertyWillChange(this,"length"),Ember.sendEvent(this,"@enumerable:before",[this,t,n]),this},enumerableContentDidChange:function(t,n){var r,i,s;return"number"==typeof t?r=t:t?r=e(t,"length"):r=t=-1,"number"==typeof n?i=n:n?i=e(n,"length"):i=n=-1,s=i<0||r<0||i-r!==0,t===-1&&(t=null),n===-1&&(n=null),Ember.sendEvent(this,"@enumerable:change",[this,t,n]),s&&Ember.propertyDidChange(this,"length"),Ember.propertyDidChange(this,"[]"),this}})}(),function(){function i(e){return e===null||e===undefined}var e=Ember.get,t=Ember.set,n=Ember.EnumerableUtils.map,r=Ember.cacheFor;Ember.Array=Ember.Mixin.create(Ember.Enumerable,{isSCArray:!0,length:Ember.required(),objectAt:function(t){return t<0||t>=e(this,"length")?undefined:e(this,t)},objectsAt:function(e){var t=this;return n(e,function(e){return t.objectAt(e)})},nextObject:function(e){return this.objectAt(e)},"[]":Ember.computed(function(t,n){return n!==undefined&&this.replace(0,e(this,"length"),n),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(t,n){var r=Ember.A([]),s=e(this,"length");i(t)&&(t=0);if(i(n)||n>s)n=s;t<0&&(t=s+t),n<0&&(n=s+n);while(t<n)r[r.length]=this.objectAt(t++);return r},indexOf:function(t,n){var r,i=e(this,"length");n===undefined&&(n=0),n<0&&(n+=i);for(r=n;r<i;r++)if(this.objectAt(r,!0)===t)return r;return-1},lastIndexOf:function(t,n){var r,i=e(this,"length");if(n===undefined||n>=i)n=i-1;n<0&&(n+=i);for(r=n;r>=0;r--)if(this.objectAt(r)===t)return r;return-1},addArrayObserver:function(t,n){var r=n&&n.willChange||"arrayWillChange",i=n&&n.didChange||"arrayDidChange",s=e(this,"hasArrayObservers");return s||Ember.propertyWillChange(this,"hasArrayObservers"),Ember.addListener(this,"@array:before",t,r),Ember.addListener(this,"@array:change",t,i),s||Ember.propertyDidChange(this,"hasArrayObservers"),this},removeArrayObserver:function(t,n){var r=n&&n.willChange||"arrayWillChange",i=n&&n.didChange||"arrayDidChange",s=e(this,"hasArrayObservers");return s&&Ember.propertyWillChange(this,"hasArrayObservers"),Ember.removeListener(this,"@array:before",t,r),Ember.removeListener(this,"@array:change",t,i),s&&Ember.propertyDidChange(this,"hasArrayObservers"),this},hasArrayObservers:Ember.computed(function(){return Ember.hasListeners(this,"@array:change")||Ember.hasListeners(this,"@array:before")}),arrayContentWillChange:function(t,n,r){t===undefined?(t=0,n=r=-1):(n===undefined&&(n=-1),r===undefined&&(r=-1)),Ember.isWatching(this,"@each")&&e(this,"@each"),Ember.sendEvent(this,"@array:before",[this,t,n,r]);var i,s;if(t>=0&&n>=0&&e(this,"hasEnumerableObservers")){i=[],s=t+n;for(var o=t;o<s;o++)i.push(this.objectAt(o))}else i=n;return this.enumerableContentWillChange(i,r),this},arrayContentDidChange:function(t,n,i){t===undefined?(t=0,n=i=-1):(n===undefined&&(n=-1),i===undefined&&(i=-1));var s,o;if(t>=0&&i>=0&&e(this,"hasEnumerableObservers")){s=[],o=t+i;for(var u=t;u<o;u++)s.push(this.objectAt(u))}else s=i;this.enumerableContentDidChange(n,s),Ember.sendEvent(this,"@array:change",[this,t,n,i]);var a=e(this,"length"),f=r(this,"firstObject"),l=r(this,"lastObject");return this.objectAt(0)!==f&&(Ember.propertyWillChange(this,"firstObject"),Ember.propertyDidChange(this,"firstObject")),this.objectAt(a-1)!==l&&(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,t=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=[],n=Ember.get,r=Ember.set;Ember.MutableArray=Ember.Mixin.create(Ember.Array,Ember.MutableEnumerable,{replace:Ember.required(),clear:function(){var e=n(this,"length");return e===0?this:(this.replace(0,e,t),this)},insertAt:function(t,r){if(t>n(this,"length"))throw new Error(e);return this.replace(t,0,[r]),this},removeAt:function(r,i){if("number"==typeof r){if(r<0||r>=n(this,"length"))throw new Error(e);i===undefined&&(i=1),this.replace(r,i,t)}return this},pushObject:function(e){return this.insertAt(n(this,"length"),e),e},pushObjects:function(e){return this.replace(n(this,"length"),0,e),this},popObject:function(){var e=n(this,"length");if(e===0)return null;var t=this.objectAt(e-1);return this.removeAt(e-1,1),t},shiftObject:function(){if(n(this,"length")===0)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=n(this,"length");if(e===0)return this;var t=this.toArray().reverse();return this.replace(0,e,t),this},setObjects:function(e){if(e.length===0)return this.clear();var t=n(this,"length");return this.replace(0,t,e),this},removeObject:function(e){var t=n(this,"length")||0;while(--t>=0){var r=this.objectAt(t);r===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={},n=arguments;arguments.length===1&&Ember.typeOf(arguments[0])==="array"&&(n=arguments[0]);for(var r=0;r<n.length;r++)t[n[r]]=e(this,n[r]);return t},set:function(e,n){return t(this,e,n),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,n){Ember.addBeforeObserver(this,e,t,n)},addObserver:function(e,t,n){Ember.addObserver(this,e,t,n)},removeObserver:function(e,t,n){Ember.removeObserver(this,e,t,n)},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(n,r){return r||(r=1),t(this,n,(e(this,n)||0)+r),e(this,n)},decrementProperty:function(n,r){return r||(r=1),t(this,n,(e(this,n)||0)-r),e(this,n)},toggleProperty:function(n){return t(this,n,!e(this,n)),e(this,n)},cacheFor:function(e){return Ember.cacheFor(this,e)},observersForKey:function(e){return Ember.observersFor(this,e)}})}(),function(){var e=Ember.get,t=Ember.set;Ember.TargetActionSupport=Ember.Mixin.create({target:null,action:null,targetObject:Ember.computed(function(){var t=e(this,"target");if(Ember.typeOf(t)==="string"){var n=e(this,t);return n===undefined&&(n=e(Ember.lookup,t)),n}return t}).property("target"),triggerAction:function(){var t=e(this,"action"),n=e(this,"targetObject");if(n&&t){var r;return typeof n.send=="function"?r=n.send(t,this):(typeof t=="string"&&(t=n[t]),r=t.call(n,this)),r!==!1&&(r=!0),r}return!1}})}(),function(){Ember.Evented=Ember.Mixin.create({on:function(e,t,n){return Ember.addListener(this,e,t,n),this},one:function(e,t,n){return n||(n=t,t=null),Ember.addListener(this,e,t,n,!0),this},trigger:function(e){var t=[],n,r;for(n=1,r=arguments.length;n<r;n++)t.push(arguments[n]);Ember.sendEvent(this,e,t)},fire:function(e){this.trigger.apply(this,arguments)},off:function(e,t,n){return Ember.removeListener(this,e,t,n),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 n=Ember.get;Ember.DeferredMixin=Ember.Mixin.create({then:function(e,t){var r=n(this,"promise");return r.then.apply(r,arguments)},resolve:function(e){n(this,"promise").resolve(e)},reject:function(e){n(this,"promise").reject(e)},promise:Ember.computed(function(){return new e.Promise})})}(),function(){}(),function(){Ember.Container=t("container"),Ember.Container.set=Ember.set}(),function(){function b(){var e=!1,t,s,o=function(){e||o.proto(),r(this,i,y),r(this,"_super",y);var a=u(this);a.proto=this;if(t){var l=t;t=null,this.reopen.apply(this
|
17
|
+
,l)}if(s){var c=s;s=null;var h=this.concatenatedProperties;for(var p=0,v=c.length;p<v;p++){var b=c[p];for(var w in b){if(!b.hasOwnProperty(w))continue;var E=b[w],S=Ember.IS_BINDING;if(S.test(w)){var x=a.bindings;x?a.hasOwnProperty("bindings")||(x=a.bindings=n(a.bindings)):x=a.bindings={},x[w]=E}var T=a.descs[w];if(h&&g(h,w)>=0){var N=this[w];N?"function"==typeof N.concat?E=N.concat(E):E=Ember.makeArray(N).concat(E):E=Ember.makeArray(E)}T?T.set(this,w,E):typeof this.setUnknownProperty!="function"||w in this?m?Ember.defineProperty(this,w,null,E):this[w]=E:this.setUnknownProperty(w,E)}}}d(this,a),delete a.proto,f(this),this.init.apply(this,arguments)};return o.toString=h.prototype.toString,o.willReopen=function(){e&&(o.PrototypeMixin=h.create(o.PrototypeMixin)),e=!1},o._initMixins=function(e){t=e},o._initProperties=function(e){s=e},o.proto=function(){var t=o.superclass;return t&&t.proto(),e||(e=!0,o.PrototypeMixin.applyPartial(o.prototype),a(o.prototype)),this.prototype},o}function E(e){return function(){return e}}var e=Ember.set,t=Ember.get,n=Ember.create,r=Ember.platform.defineProperty,i=Ember.GUID_KEY,s=Ember.guidFor,o=Ember.generateGuid,u=Ember.meta,a=Ember.rewatch,f=Ember.finishChains,l=Ember.destroy,c=Ember.run.schedule,h=Ember.Mixin,p=h._apply,d=h.finishPartial,v=h.prototype.reopen,m=Ember.ENV.MANDATORY_SETTER,g=Ember.EnumerableUtils.indexOf,y={configurable:!0,writable:!0,enumerable:!1,value:undefined},w=b();w.toString=function(){return"Ember.CoreObject"},w.PrototypeMixin=h.create({reopen:function(){return p(this,arguments,!0),this},isInstance:!0,init:function(){},concatenatedProperties:null,isDestroyed:!1,isDestroying:!1,destroy:function(){if(this._didCallDestroy)return;return this.isDestroying=!0,this._didCallDestroy=!0,this.willDestroy&&this.willDestroy(),c("destroy",this,this._scheduledDestroy),this},_scheduledDestroy:function(){l(this),e(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 x(){var e=typeof this.toStringExtension=="function",t=e?":"+this.toStringExtension():"",n="<"+this.constructor.toString()+":"+s(this)+t+">";return this.toString=E(n),n}}),w.PrototypeMixin.ownerConstructor=w,Ember.config.overridePrototypeMixin&&Ember.config.overridePrototypeMixin(w.PrototypeMixin),w.__super__=null;var S=h.create({ClassMixin:Ember.required(),PrototypeMixin:Ember.required(),isClass:!0,isMethod:!1,extend:function(){var e=b(),t;return e.ClassMixin=h.create(this.ClassMixin),e.PrototypeMixin=h.create(this.PrototypeMixin),e.ClassMixin.ownerConstructor=e,e.PrototypeMixin.ownerConstructor=e,v.apply(e.PrototypeMixin,arguments),e.superclass=this,e.__super__=this.prototype,t=e.prototype=n(this.prototype),t.constructor=e,o(t,"ember"),u(t).proto=t,e.ClassMixin.apply(e),e},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(),v.apply(this.PrototypeMixin,arguments),this},reopenClass:function(){return v.apply(this.ClassMixin,arguments),p(this,arguments,!1),this},detect:function(e){if("function"!=typeof e)return!1;while(e){if(e===this)return!0;e=e.superclass}return!1},detectInstance:function(e){return e instanceof this},metaForProperty:function(e){var t=u(this.proto(),!1).descs[e];return t._meta||{}},eachComputedProperty:function(e,t){var n=this.proto(),r=u(n).descs,i={},s;for(var o in r)s=r[o],s instanceof Ember.ComputedProperty&&e.call(t||this,o,s._meta||i)}});S.ownerConstructor=w,Ember.config.overrideClassMixin&&Ember.config.overrideClassMixin(S),w.ClassMixin=S,S.apply(w),Ember.CoreObject=w}(),function(){Ember.Object=Ember.CoreObject.extend(Ember.Observable),Ember.Object.toString=function(){return"Ember.Object"}}(),function(){function o(e,t,n){var u=e.length;r[e.join(".")]=t;for(var f in t){if(!i.call(t,f))continue;var c=t[f];e[u]=f;if(c&&c.toString===l)c.toString=h(e.join(".")),c[a]=e.join(".");else if(c&&c.isNamespace){if(n[s(c)])continue;n[s(c)]=!0,o(e,c,n)}}e.length=u}function u(){var e=Ember.Namespace,t=Ember.lookup,n,r;if(e.PROCESSED)return;for(var i in t){if(i==="parent"||i==="top"||i==="frameElement")continue;if(i==="globalStorage"&&t.StorageList&&t.globalStorage instanceof t.StorageList)continue;if(t.hasOwnProperty&&!t.hasOwnProperty(i))continue;try{n=Ember.lookup[i],r=n&&n.isNamespace}catch(s){continue}r&&(n[a]=i)}}function f(e){var t=e.superclass;if(t)return t[a]?t[a]:f(t);return}function l(){!Ember.BOOTED&&!this[a]&&c();var e;if(this[a])e=this[a];else{var t=f(this);t?e="(subclass of "+t+")":e="(unknown mixin)",this.toString=h(e)}return e}function c(){var e=!n.PROCESSED,t=Ember.anyUnprocessedMixins;e&&(u(),n.PROCESSED=!0);if(e||t){var r=n.NAMESPACES,i;for(var s=0,a=r.length;s<a;s++)i=r[s],o([i.toString()],i,{});Ember.anyUnprocessedMixins=!1}}function h(e){return function(){return e}}var e=Ember.get,t=Ember.ArrayPolyfills.indexOf,n=Ember.Namespace=Ember.Object.extend({isNamespace:!0,init:function(){Ember.Namespace.NAMESPACES.push(this),Ember.Namespace.PROCESSED=!1},toString:function(){var t=e(this,"name");return t?t:(u(),this[Ember.GUID_KEY+"_name"])},nameClasses:function(){o([this.toString()],this,{})},destroy:function(){var e=Ember.Namespace.NAMESPACES;Ember.lookup[this.toString()]=undefined,e.splice(t.call(e,this),1),this._super()}});n.reopenClass({NAMESPACES:[Ember],NAMESPACES_BY_ID:{},PROCESSED:!1,processAll:c,byName:function(e){return Ember.BOOTED||c(),r[e]}});var r=n.NAMESPACES_BY_ID,i={}.hasOwnProperty,s=Ember.guidFor,a=Ember.NAME_KEY=Ember.GUID_KEY+"_name";Ember.Mixin.prototype.toString=l}(),function(){Ember.Application=Ember.Namespace.extend()}(),function(){var e="Index out of range",t=[],n=Ember.get,r=Ember.set;Ember.ArrayProxy=Ember.Object.extend(Ember.MutableArray,{content:null,arrangedContent:Ember.computed.alias("content"),objectAtContent:function(e){return n(this,"arrangedContent").objectAt(e)},replaceContent:function(e,t,r){n(this,"content").replace(e,t,r)},_contentWillChange:Ember.beforeObserver(function(){this._teardownContent()},"content"),_teardownContent:function(){var e=n(this,"content");e&&e.removeArrayObserver(this,{willChange:"contentArrayWillChange",didChange:"contentArrayDidChange"})},contentArrayWillChange:Ember.K,contentArrayDidChange:Ember.K,_contentDidChange:Ember.observer(function(){var e=n(this,"content");this._setupContent()},"content"),_setupContent:function(){var e=n(this,"content");e&&e.addArrayObserver(this,{willChange:"contentArrayWillChange",didChange:"contentArrayDidChange"})},_arrangedContentWillChange:Ember.beforeObserver(function(){var e=n(this,"arrangedContent"),t=e?n(e,"length"):0;this.arrangedContentArrayWillChange(this,0,t,undefined),this.arrangedContentWillChange(this),this._teardownArrangedContent(e)},"arrangedContent"),_arrangedContentDidChange:Ember.observer(function(){var e=n(this,"arrangedContent"),t=e?n(e,"length"):0;this._setupArrangedContent(),this.arrangedContentDidChange(this),this.arrangedContentArrayDidChange(this,0,undefined,t)},"arrangedContent"),_setupArrangedContent:function(){var e=n(this,"arrangedContent");e&&e.addArrayObserver(this,{willChange:"arrangedContentArrayWillChange",didChange:"arrangedContentArrayDidChange"})},_teardownArrangedContent:function(){var e=n(this,"arrangedContent");e&&e.removeArrayObserver(this,{willChange:"arrangedContentArrayWillChange",didChange:"arrangedContentArrayDidChange"})},arrangedContentWillChange:Ember.K,arrangedContentDidChange:Ember.K,objectAt:function(e){return n(this,"content")&&this.objectAtContent(e)},length:Ember.computed(function(){var e=n(this,"arrangedContent");return e?n(e,"length"):0}),_replace:function(e,t,r){var i=n(this,"content");return i&&this.replaceContent(e,t,r),this},replace:function(){if(n(this,"arrangedContent")!==n(this,"content"))throw new Ember.Error("Using replace on an arranged ArrayProxy is not allowed.");this._replace.apply(this,arguments)},_insertAt:function(t,r){if(t>n(this,"content.length"))throw new Error(e);return this._replace(t,0,[r]),this},insertAt:function(e,t){if(n(this,"arrangedContent")===n(this,"content"))return this._insertAt(e,t);throw new Ember.Error("Using insertAt on an arranged ArrayProxy is not allowed.")},removeAt:function(r,i){if("number"==typeof r){var s=n(this,"content"),o=n(this,"arrangedContent"),u=[],a;if(r<0||r>=n(this,"length"))throw new Error(e);i===undefined&&(i=1);for(a=r;a<r+i;a++)u.push(s.indexOf(o.objectAt(a)));u.sort(function(e,t){return t-e}),Ember.beginPropertyChanges();for(a=0;a<u.length;a++)this._replace(u[a],1,t);Ember.endPropertyChanges()}return this},pushObject:function(e){return this._insertAt(n(this,"content.length"),e),e},pushObjects:function(e){return this._replace(n(this,"length"),0,e),this},setObjects:function(e){if(e.length===0)return this.clear();var t=n(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,n,r){this.arrayContentWillChange(t,n,r)},arrangedContentArrayDidChange:function(e,t,n,r){this.arrayContentDidChange(t,n,r)},init:function(){this._super(),this._setupContent(),this._setupArrangedContent()},willDestroy:function(){this._teardownArrangedContent(),this._teardownContent()}})}(),function(){function f(e,t){var n=t.slice(8);if(n in this)return;u(this,n)}function l(e,t){var n=t.slice(8);if(n in this)return;a(this,n)}var e=Ember.get,t=Ember.set,n=Ember.String.fmt,r=Ember.addBeforeObserver,i=Ember.addObserver,s=Ember.removeBeforeObserver,o=Ember.removeObserver,u=Ember.propertyWillChange,a=Ember.propertyDidChange;Ember.ObjectProxy=Ember.Object.extend({content:null,_contentDidChange:Ember.observer(function(){},"content"),isTruthy:Ember.computed.bool("content"),_debugContainerKey:null,willWatchProperty:function(e){var t="content."+e;r(this,t,null,f),i(this,t,null,l)},didUnwatchProperty:function(e){var t="content."+e;s(this,t,null,f),o(this,t,null,l)},unknownProperty:function(t){var n=e(this,"content");if(n)return e(n,t)},setUnknownProperty:function(n,r){var i=e(this,"content");return t(i,n,r)}}),Ember.ObjectProxy.reopenClass({create:function(){var e,t,n,r,i,s;if(arguments.length){t=this.proto();for(n=0,r=arguments.length;n<r;n++){i=arguments[n];for(s in i){if(!i.hasOwnProperty(s)||s in t)continue;e||(e={}),e[s]=null}}e&&this._initMixins([e])}return this._super.apply(this,arguments)}})}(),function(){function o(e,t,r,i,s){var o=r._objects,u;o||(o=r._objects={});while(--s>=i){var a=e.objectAt(s);a&&(Ember.addBeforeObserver(a,t,r,"contentKeyWillChange"),Ember.addObserver(a,t,r,"contentKeyDidChange"),u=n(a),o[u]||(o[u]=[]),o[u].push(s))}}function u(e,t,r,i,s){var o=r._objects;o||(o=r._objects={});var u,a;while(--s>=i){var f=e.objectAt(s);f&&(Ember.removeBeforeObserver(f,t,r,"contentKeyWillChange"),Ember.removeObserver(f,t,r,"contentKeyDidChange"),a=n(f),u=o[a],u[u.indexOf(s)]=null)}}var e=Ember.set,t=Ember.get,n=Ember.guidFor,r=Ember.EnumerableUtils.forEach,i=Ember.Object.extend(Ember.Array,{init:function(e,t,n){this._super(),this._keyName=t,this._owner=n,this._content=e},objectAt:function(e){var n=this._content.objectAt(e);return n&&t(n,this._keyName)},length:Ember.computed(function(){var e=this._content;return e?t(e,"length"):0})}),s=/^.+:(before|change)$/;Ember.EachProxy=Ember.Object.extend({init:function(e){this._super(),this._content=e,e.addArrayObserver(this),r(Ember.watchedEvents(this),function(e){this.didAddListener(e)},this)},unknownProperty:function(e,t){var n;return n=new i(this._content,e,this),Ember.defineProperty(this,e,null,n),this.beginObservingContentKey(e),n},arrayWillChange:function(e,t,n,r){var i=this._keys,s,o;o=n>0?t+n:-1,Ember.beginPropertyChanges(this);for(s in i){if(!i.hasOwnProperty(s))continue;o>0&&u(e,s,this,t,o),Ember.propertyWillChange(this,s)}Ember.propertyWillChange(this._content,"@each"),Ember.endPropertyChanges(this)},arrayDidChange:function(e,t,n,r){var i=this._keys,s,u;u=r>0?t+r:-1,Ember.beginPropertyChanges(this);for(s in i){if(!i.hasOwnProperty(s))continue;u>0&&o(e,s,this,t,u),Ember.propertyDidChange(this,s)}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(e){var n=this._keys;n||(n=this._keys={});if(!n[e]){n[e]=1;var r=this._content,i=t(r,"length");o(r,e,this,0,i)}else n[e]++},stopObservingContentKey:function(e){var n=this._keys;if(n&&n[e]>0&&--n[e]<=0){var r=this._content,i=t(r,"length");u(r,e,this,0,i)}},contentKeyWillChange:function(e,t){Ember.propertyWillChange(this,t)},contentKeyDidChange:function(e,t){Ember.propertyDidChange(this,t)}})}(),function(){var e=Ember.get,t=Ember.set,n=Ember.Mixin.create(Ember.MutableArray,Ember.Observable,Ember.Copyable,{get:function(e){return e==="length"?this.length:"number"==typeof e?this[e]:this._super(e)},objectAt:function(e){return this[e]},replace:function(t,n,r){if(this.isFrozen)throw Ember.FROZEN_ERROR;var i=r?e(r,"length"):0;this.arrayContentWillChange(t,n,i);if(!r||r.length===0)this.splice(t,n);else{var s=[t,n].concat(r);this.splice.apply(this,s)}return this.arrayContentDidChange(t,n,i),this},unknownProperty:function(e,t){var n;return t!==undefined&&n===undefined&&(n=this[e]=t),n},indexOf:function(e,t){var n,r=this.length;t===undefined?t=0:t=t<0?Math.ceil(t):Math.floor(t),t<0&&(t+=r);for(n=t;n<r;n++)if(this[n]===e)return n;return-1},lastIndexOf:function(e,t){var n,r=this.length;t===undefined?t=r-1:t=t<0?Math.ceil(t):Math.floor(t),t<0&&(t+=r);for(n=t;n>=0;n--)if(this[n]===e)return n;return-1},copy:function(e){return e?this.map(function(e){return Ember.copy(e,!0)}):this.slice()}}),r=["length"];Ember.EnumerableUtils.forEach(n.keys(),function(e){Array.prototype[e]&&r.push(e)}),r.length>0&&(n=n.without.apply(n,r)),Ember.NativeArray=n,Ember.A=function(e){return e===undefined&&(e=[]),Ember.Array.detect(e)?e:Ember.NativeArray.apply(e)},Ember.NativeArray.activate=function(){n.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,n=Ember.guidFor,r=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 r=e(this,"length");if(r===0)return this;var i;this.enumerableContentWillChange(r,0),Ember.propertyWillChange(this,"firstObject"),Ember.propertyWillChange(this,"lastObject");for(var s=0;s<r;s++)i=n(this[s]),delete this[i],delete this[s];return t(this,"length",0),Ember.propertyDidChange(this,"firstObject"),Ember.propertyDidChange(this,"lastObject"),this.enumerableContentDidChange(r,0),this},isEqual:function(t){if(!Ember.Enumerable.detect(t))return!1;var n=e(this,"length");if(e(t,"length")!==n)return!1;while(--n>=0)if(!t.contains(this[n]))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]:undefined}),lastObject:Ember.computed(function(){return this.length>0?this[this.length-1]:undefined}),addObject:function(i){if(e(this,"isFrozen"))throw new Error(Ember.FROZEN_ERROR);if(r(i))return this;var s=n(i),o=this[s],u=e(this,"length"),a;return o>=0&&o<u&&this[o]===i?this:(a=[i],this.enumerableContentWillChange(null,a),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,a),this)},removeObject:function(i){if(e(this,"isFrozen"))throw new Error(Ember.FROZEN_ERROR);if(r(i))return this;var s=n(i),o=this[s],u=e(this,"length"),a=o===0,f=o===u-1,l,c;return o>=0&&o<u&&this[o]===i&&(c=[i],this.enumerableContentWillChange(c,null),a&&Ember.propertyWillChange(this,"firstObject"),f&&Ember.propertyWillChange(this,"lastObject"),o<u-1&&(l=this[u-1],this[o]=l,this[n(l)]=o),delete this[s],delete this[u-1],t(this,"length",u-1),a&&Ember.propertyDidChange(this,"firstObject"),f&&Ember.propertyDidChange(this,"lastObject"),this.enumerableContentDidChange(c,null)),this},contains:function(e){return this[n(e)]>=0},copy:function(){var r=this.constructor,i=new r,s=e(this,"length");t(i,"length",s);while(--s>=0)i[s]=this[s],i[n(this[s])]=s;return i},toString:function(){var e=this.length,t,n=[];for(t=0;t<e;t++)n[t]=this[t];return i("Ember.Set<%@>",[n.join(",")])}})}(),function(){var e=Ember.DeferredMixin,t=Ember.get,n=Ember.Object.extend(e);n.reopenClass({promise:function(e,r){var i=n.create();return e.call(r,i),t(i,"promise")}}),Ember.Deferred=n}(),function(){var e=Ember.ENV.EMBER_LOAD_HOOKS||{},t={};Ember.onLoad=function(n,r){var i;e[n]=e[n]||Ember.A(),e[n].pushObject(r),(i=t[n])&&r(i)},Ember.runLoadHooks=function(n,r){var i;t[n]=r,(i=e[n])&&e[n].forEach(function(e){e(r)})}}(),function(){}(),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 n=[].slice.call(arguments,1),r;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,n=Ember.EnumerableUtils.forEach;Ember.SortableMixin=Ember.Mixin.create(Ember.MutableEnumerable,{sortProperties:null,sortAscending:!0,orderBy:function(t,r){var i=0,s=e(this,"sortProperties"),o=e(this,"sortAscending");return n(s,function(n){i===0&&(i=Ember.compare(e(t,n),e(r,n)),i!==0&&!o&&(i=-1*i))}),i},destroy:function(){var t=e(this,"content"),r=e(this,"sortProperties");return t&&r&&n(t,function(e){n(r,function(t){Ember.removeObserver(e,t,this,"contentItemSortPropertyDidChange")},this)},this),this._super()},isSorted:Ember.computed.bool("sortProperties"),arrangedContent:Ember.computed("content","sortProperties.@each",function(t,r){var i=e(this,"content"),s=e(this,"isSorted"),o=e(this,"sortProperties"),u=this;return i&&s?(i=i.slice(),i.sort(function(e,t){return u.orderBy(e,t)}),n(i,function(e){n(o,function(t){Ember.addObserver(e,t,this,"contentItemSortPropertyDidChange")},this)},this),Ember.A(i)):i}),_contentWillChange:Ember.beforeObserver(function(){var t=e(this,"content"),r=e(this,"sortProperties");t&&r&&n(t,function(e){n(r,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(t,r,i,s){var o=e(this,"isSorted");if(o){var u=e(this,"arrangedContent"),a=t.slice(r,r+i),f=e(this,"sortProperties");n(a,function(e){u.removeObject(e),n(f,function(t){Ember.removeObserver(e,t,this,"contentItemSortPropertyDidChange")},this)},this)}return this._super(t,r,i,s)},contentArrayDidChange:function(t,r,i,s){var o=e(this,"isSorted"),u=e(this,"sortProperties");if(o){var a=t.slice(r,r+s);n(a,function(e){this.insertItemSorted(e),n(u,function(t){Ember.addObserver(e,t,this,"contentItemSortPropertyDidChange")},this)},this)}return this._super(t,r,i,s)},insertItemSorted:function(t){var n=e(this,"arrangedContent"),r=e(n,"length"),i=this._binarySearch(t,0,r);n.insertAt(i,t)},contentItemSortPropertyDidChange:function(t){var n=e(this,"arrangedContent"),r=n.indexOf(t),i=n.objectAt(r-1),s=n.objectAt(r+1),o=i&&this.orderBy(t,i),u=s&&this.orderBy(t,s);if(o<0||u>0)n.removeObject(t),this.insertItemSorted(t)},_binarySearch:function(t,n,r){var i,s,o,u;return n===r?n:(u=e(this,"arrangedContent"),i=n+Math.floor((r-n)/2),s=u.objectAt(i),o=this.orderBy(s,t),o<0?this._binarySearch(t,i+1,r):o>0?this._binarySearch(t,n,i):i)}})}(),function(){var e=Ember.get,t=Ember.set,n=Ember.EnumerableUtils.forEach,r=Ember.EnumerableUtils.replace;Ember.ArrayController=Ember.ArrayProxy.extend(Ember.ControllerMixin,Ember.SortableMixin,{itemController:null,lookupItemController:function(t){return e(this,"itemController")},objectAtContent:function(t){var n=e(this,"length"),r=e(this,"arrangedContent"),i=r&&r.objectAt(t);if(t>=0&&t<n){var s=this.lookupItemController(i);if(s)return this.controllerAt(t,i,s)}return i},arrangedContentDidChange:function(){this._super(),this._resetSubControllers()},arrayContentDidChange:function(t,i,s){var o=e(this,"_subControllers"),u=o.slice(t,t+i);n(u,function(e){e&&e.destroy()}),r(o,t,i,new Array(s)),this._super(t,i,s)},init:function(){this._super(),this.get("content")||Ember.defineProperty(this,"content",undefined,Ember.A()),this.set("_subControllers",Ember.A())},controllerAt:function(t,n,r){var i=e(this,"container"),s=e(this,"_subControllers"),o=s[t];o||(o=i.lookup("controller:"+r,{singleton:!1}),s[t]=o);if(!o)throw new Error('Could not resolve itemController: "'+r+'"');return o.set("target",this),o.set("content",n),o},_subControllers:null,_resetSubControllers:function(){var t=e(this,"_subControllers");n(t,function(e){e&&e.destroy()}),this.set("_subControllers",Ember.A())}})}(),function(){Ember.ObjectController=Ember.ObjectProxy.extend(Ember.ControllerMixin)}(),function(){}(),function(){}(),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"),n=e(this,"name");return t&&(n=t+"."+n),n}),trigger:function(e){this[e]&&this[e].apply(this,[].slice.call(arguments,1)),this._super.apply(this,arguments)},init:function(){var n=e(this,"states");t(this,"childStates",Ember.A()),t(this,"eventTransitions",e(this,"eventTransitions")||{});var r,i,s;if(!n){n={};for(r in this){if(r==="constructor")continue;if(i=this[r]){if(s=i.transitionTarget)this.eventTransitions[r]=s;this.setupChild(n,r,i)}}t(this,"states",n)}else for(r in n)this.setupChild(n,r,n[r]);t(this,"pathsCache",{}),t(this,"pathsCacheNoContext",{})},setupChild:function(n,r,i){if(!i)return!1;i.isState?t(i,"name",r):Ember.State.detect(i)&&(i=i.create({name:r}));if(i.isState)return t(i,"parentState",this),e(this,"childStates").pushObject(i),n[r]=i,i},lookupEventTransition:function(e){var t,n=this;while(n&&!t)t=n.eventTransitions[e],n=n.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,n){var r=[],i=Ember.$&&Ember.$.Event;n&&i&&n instanceof i?n.hasOwnProperty("contexts")&&(r=n.contexts.slice()):r=[].slice.call(arguments,1),r.unshift(e),t.transitionTo.apply(t,r)};return t.transitionTarget=e,t}})}(),function(){var e=Ember.get,t=Ember.set,n=Ember.String.fmt,r=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){var n=this.enterStates.length-1,r=[],i,s;while(t.length>0){if(n>=0)i=this.enterStates[n--];else{if(this.enterStates.length){i=e(this.enterStates[0],"parentState");if(!i)throw"Cannot match all contexts to states"}else i=this.resolveState;this.enterStates.unshift(i),this.exitStates.unshift(i)}e(i,"hasContext")?s=t.pop():s=null,r.unshift(s)}this.contexts=r},addInitialStates:function(){var t=this.finalState,n;for(;;){n=e(t,"initialState")||"start",t=e(t,"states."+n);if(!t)break;this.finalState=t,this.enterStates.push(t),this.contexts.push(undefined)}},removeUnchangedContexts:function(e){while(this.enterStates.length>0){if(this.enterStates[0]!==this.exitStates[0])break;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 s=function(t,r,i){var u=this.enableLogging,a=i?"unhandledEvent":t,f=r[a],l,c,h;l=[].slice.call(arguments,3);if(typeof f=="function")return u&&(i?Ember.Logger.log(n("STATEMANAGER: Unhandled event '%@' being sent to state %@.",[t,e(r,"path")])):Ember.Logger.log(n("STATEMANAGER: Sending event '%@' to state %@.",[t,e(r,"path")]))),h=l,i&&h.unshift(t),h.unshift(this),f.apply(r,h);var p=e(r,"parentState");if(p)return c=l,c.unshift(t,p,i),s.apply(this,c);if(!i)return o.call(this,t,l,!0)},o=function(t,n,r){return n.unshift(t,e(this,"currentState"),r),s.apply(this,n)};Ember.StateManager=Ember.State.extend({init:function(){this._super(),t(this,"stateMeta",Ember.Map.create());var n=e(this,"initialState");!n&&e(this,"states.start")&&(n="start"),n&&this.transitionTo(n)},stateMetaFor:function(t){var n=e(this,"stateMeta"),r=n.get(t);return r||(r={},n.set(t,r)),r},setStateMeta:function(e,n,r){return t(this.stateMetaFor(e),n,r)},getStateMeta:function(t,n){return e(this.stateMetaFor(t),n)},currentState:null,currentPath:Ember.computed.alias("currentState.path"),transitionEvent:"setup",errorOnUnhandledEvent:!0,send:function(e){var t=[].slice.call(arguments,1);return o.call(this,e,t,!1)},unhandledEvent:function(t,n){if(e(this,"errorOnUnhandledEvent"))throw new Ember.Error(this.toString()+" could not respond to event "+n+" in state "+e(this,"currentState.path")+".")},getStateByPath:function(t,n){var r=n.split("."),i=t;for(var s=0,o=r.length;s<o;s++){i=e(e(i,"states"),r[s]);if(!i)break}return i},findStateByPath:function(t,n){var r;while(!r&&t)r=this.getStateByPath(t,n),t=e(t,"parentState");return r},getStatesInPath:function(t,n){if(!n||n==="")return undefined;var r=n.split("."),i=[],s,o;for(var u=0,a=r.length;u<a;u++){s=e(t,"states");if(!s)return undefined;o=e(s,r[u]);if(!o)return undefined;t=o,i.push(o)}return i},goToState:function(){return this.transitionTo.apply(this,arguments)},transitionTo:function(t,n){if(Ember.isEmpty(t))return;var r=n?Array.prototype.slice.call(arguments,1):[],s=e(this,"currentState")||this,o=this.contextFreeTransition(s,t),u=(new i(o)).normalize(this,r);this.enterState(u),this.triggerSetupContext(u)},contextFreeTransition:function(t,n){var r=t.pathsCache[n];if(r)return r;var i=this.getStatesInPath(t,n),s=[],o=t;while(o&&!i){s.unshift(o),o=e(o,"parentState");if(!o){i=this.getStatesInPath(this,n);if(!i)return}i=this.getStatesInPath(o,n)}while(i.length>0&&i[0]===s[0])o=i.shift(),s.shift();var u=t.pathsCache[n]={exitStates:s,enterStates:i,resolveState:o};return u},triggerSetupContext:function(t){var n=t.contexts,i=t.enterStates.length-n.length,s=t.enterStates,o=e(this,"transitionEvent");r.call(s,function(e,t){e.trigger(o,this,n[t-i])},this)},getState:function(t){var n=e(this,t),r=e(this,"parentState");if(n)return n;if(r)return r.getState(t)},enterState:function(n){var i=this.enableLogging,s=n.exitStates.slice(0).reverse();r.call(s,function(e){e.trigger("exit",this)},this),r.call(n.enterStates,function(t){i&&Ember.Logger.log("STATEMANAGER: Entering "+e(t,"path")),t.trigger("enter",this)},this),t(this,"currentState",n.finalState)}})}(),function(){}()})(),typeof location!="undefined"&&(location.hostname==="localhost"||location.hostname==="127.0.0.1")&&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.");
|
@@ -141,6 +141,15 @@ Ember.LOG_STACKTRACE_ON_DEPRECATION = (Ember.ENV.LOG_STACKTRACE_ON_DEPRECATION !
|
|
141
141
|
*/
|
142
142
|
Ember.SHIM_ES5 = (Ember.ENV.SHIM_ES5 === false) ? false : Ember.EXTEND_PROTOTYPES;
|
143
143
|
|
144
|
+
/**
|
145
|
+
Determines whether Ember logs info about version of used libraries
|
146
|
+
|
147
|
+
@property LOG_VERSION
|
148
|
+
@type Boolean
|
149
|
+
@default true
|
150
|
+
*/
|
151
|
+
Ember.LOG_VERSION = (Ember.ENV.LOG_VERSION === false) ? false : true;
|
152
|
+
|
144
153
|
/**
|
145
154
|
Empty function. Useful for some operations.
|
146
155
|
|
@@ -253,6 +262,58 @@ Ember.merge = function(original, updates) {
|
|
253
262
|
}
|
254
263
|
};
|
255
264
|
|
265
|
+
/**
|
266
|
+
Returns true if the passed value is null or undefined. This avoids errors
|
267
|
+
from JSLint complaining about use of ==, which can be technically
|
268
|
+
confusing.
|
269
|
+
|
270
|
+
```javascript
|
271
|
+
Ember.isNone(); // true
|
272
|
+
Ember.isNone(null); // true
|
273
|
+
Ember.isNone(undefined); // true
|
274
|
+
Ember.isNone(''); // false
|
275
|
+
Ember.isNone([]); // false
|
276
|
+
Ember.isNone(function(){}); // false
|
277
|
+
```
|
278
|
+
|
279
|
+
@method isNone
|
280
|
+
@for Ember
|
281
|
+
@param {Object} obj Value to test
|
282
|
+
@return {Boolean}
|
283
|
+
*/
|
284
|
+
Ember.isNone = function(obj) {
|
285
|
+
return obj === null || obj === undefined;
|
286
|
+
};
|
287
|
+
Ember.none = Ember.deprecateFunc("Ember.none is deprecated. Please use Ember.isNone instead.", Ember.isNone);
|
288
|
+
|
289
|
+
/**
|
290
|
+
Verifies that a value is `null` or an empty string, empty array,
|
291
|
+
or empty function.
|
292
|
+
|
293
|
+
Constrains the rules on `Ember.isNone` by returning false for empty
|
294
|
+
string and empty arrays.
|
295
|
+
|
296
|
+
```javascript
|
297
|
+
Ember.isEmpty(); // true
|
298
|
+
Ember.isEmpty(null); // true
|
299
|
+
Ember.isEmpty(undefined); // true
|
300
|
+
Ember.isEmpty(''); // true
|
301
|
+
Ember.isEmpty([]); // true
|
302
|
+
Ember.isEmpty('Adam Hawkins'); // false
|
303
|
+
Ember.isEmpty([0,1,2]); // false
|
304
|
+
```
|
305
|
+
|
306
|
+
@method isEmpty
|
307
|
+
@for Ember
|
308
|
+
@param {Object} obj Value to test
|
309
|
+
@return {Boolean}
|
310
|
+
*/
|
311
|
+
Ember.isEmpty = function(obj) {
|
312
|
+
return obj === null || obj === undefined || (obj.length === 0 && typeof obj !== 'function') || (typeof obj === 'object' && Ember.get(obj, 'length') === 0);
|
313
|
+
};
|
314
|
+
Ember.empty = Ember.deprecateFunc("Ember.empty is deprecated. Please use Ember.isEmpty instead.", Ember.isEmpty) ;
|
315
|
+
|
316
|
+
|
256
317
|
})();
|
257
318
|
|
258
319
|
|
@@ -1596,7 +1657,7 @@ var MapWithDefault = Ember.MapWithDefault = function(options) {
|
|
1596
1657
|
@static
|
1597
1658
|
@param [options]
|
1598
1659
|
@param {anything} [options.defaultValue]
|
1599
|
-
@return {Ember.MapWithDefault|Ember.Map} If options are passed, returns
|
1660
|
+
@return {Ember.MapWithDefault|Ember.Map} If options are passed, returns
|
1600
1661
|
`Ember.MapWithDefault` otherwise returns `Ember.Map`
|
1601
1662
|
*/
|
1602
1663
|
MapWithDefault.create = function(options) {
|
@@ -1659,7 +1720,7 @@ var FIRST_KEY = /^([^\.\*]+)/;
|
|
1659
1720
|
// ..........................................................
|
1660
1721
|
// GET AND SET
|
1661
1722
|
//
|
1662
|
-
// If we are on a platform that supports accessors we can
|
1723
|
+
// If we are on a platform that supports accessors we can use those.
|
1663
1724
|
// Otherwise simulate accessors by looking up the property directly on the
|
1664
1725
|
// object.
|
1665
1726
|
|
@@ -1670,7 +1731,7 @@ var FIRST_KEY = /^([^\.\*]+)/;
|
|
1670
1731
|
|
1671
1732
|
If you plan to run on IE8 and older browsers then you should use this
|
1672
1733
|
method anytime you want to retrieve a property on an object that you don't
|
1673
|
-
know for sure is private. (Properties beginning with an underscore '_'
|
1734
|
+
know for sure is private. (Properties beginning with an underscore '_'
|
1674
1735
|
are considered private.)
|
1675
1736
|
|
1676
1737
|
On all newer browsers, you only need to use this method to retrieve
|
@@ -1731,7 +1792,7 @@ get = function get(obj, keyName) {
|
|
1731
1792
|
|
1732
1793
|
If you plan to run on IE8 and older browsers then you should use this
|
1733
1794
|
method anytime you want to set a property on an object that you don't
|
1734
|
-
know for sure is private. (Properties beginning with an underscore '_'
|
1795
|
+
know for sure is private. (Properties beginning with an underscore '_'
|
1735
1796
|
are considered private.)
|
1736
1797
|
|
1737
1798
|
On all newer browsers, you only need to use this method to set
|
@@ -1961,11 +2022,8 @@ Ember.isGlobalPath = function(path) {
|
|
1961
2022
|
@module ember-metal
|
1962
2023
|
*/
|
1963
2024
|
|
1964
|
-
var
|
1965
|
-
META_KEY = Ember.META_KEY,
|
1966
|
-
EMPTY_META = Ember.EMPTY_META,
|
2025
|
+
var META_KEY = Ember.META_KEY,
|
1967
2026
|
metaFor = Ember.meta,
|
1968
|
-
o_create = Ember.create,
|
1969
2027
|
objectDefineProperty = Ember.platform.defineProperty;
|
1970
2028
|
|
1971
2029
|
var MANDATORY_SETTER = Ember.ENV.MANDATORY_SETTER;
|
@@ -2385,7 +2443,6 @@ var guidFor = Ember.guidFor, // utils.js
|
|
2385
2443
|
META_KEY = Ember.META_KEY, // utils.js
|
2386
2444
|
// circular reference observer depends on Ember.watch
|
2387
2445
|
// we should move change events to this file or its own property_events.js
|
2388
|
-
notifyObservers = Ember.notifyObservers, // observer.js
|
2389
2446
|
forEach = Ember.ArrayPolyfills.forEach, // array.js
|
2390
2447
|
FIRST_KEY = /^([^\.\*]+)/,
|
2391
2448
|
IS_PATH = /[\.\*]/;
|
@@ -2924,7 +2981,7 @@ Ember.finishChains = function(obj) {
|
|
2924
2981
|
@param {String} keyName The property key (or path) that will change.
|
2925
2982
|
@return {void}
|
2926
2983
|
*/
|
2927
|
-
function propertyWillChange(obj, keyName
|
2984
|
+
function propertyWillChange(obj, keyName) {
|
2928
2985
|
var m = metaFor(obj, false),
|
2929
2986
|
watching = m.watching[keyName] > 0 || keyName === 'length',
|
2930
2987
|
proto = m.proto,
|
@@ -3031,7 +3088,6 @@ Ember.destroy = function (obj) {
|
|
3031
3088
|
var get = Ember.get,
|
3032
3089
|
set = Ember.set,
|
3033
3090
|
metaFor = Ember.meta,
|
3034
|
-
guidFor = Ember.guidFor,
|
3035
3091
|
a_slice = [].slice,
|
3036
3092
|
o_create = Ember.create,
|
3037
3093
|
META_KEY = Ember.META_KEY,
|
@@ -3067,20 +3123,8 @@ function keysForDep(obj, depsMeta, depKey) {
|
|
3067
3123
|
return keys;
|
3068
3124
|
}
|
3069
3125
|
|
3070
|
-
/* return obj[META_KEY].deps */
|
3071
3126
|
function metaForDeps(obj, meta) {
|
3072
|
-
|
3073
|
-
// If the current object has no dependencies...
|
3074
|
-
if (!deps) {
|
3075
|
-
// initialize the dependencies with a pointer back to
|
3076
|
-
// the current object
|
3077
|
-
deps = meta.deps = {};
|
3078
|
-
} else if (!meta.hasOwnProperty('deps')) {
|
3079
|
-
// otherwise if the dependencies are inherited from the
|
3080
|
-
// object's superclass, clone the deps
|
3081
|
-
deps = meta.deps = o_create(deps);
|
3082
|
-
}
|
3083
|
-
return deps;
|
3127
|
+
return keysForDep(obj, meta, 'deps');
|
3084
3128
|
}
|
3085
3129
|
|
3086
3130
|
function addDependentKeys(desc, obj, keyName, meta) {
|
@@ -3133,8 +3177,10 @@ function removeDependentKeys(desc, obj, keyName, meta) {
|
|
3133
3177
|
*/
|
3134
3178
|
function ComputedProperty(func, opts) {
|
3135
3179
|
this.func = func;
|
3180
|
+
|
3136
3181
|
this._cacheable = (opts && opts.cacheable !== undefined) ? opts.cacheable : true;
|
3137
3182
|
this._dependentKeys = opts && opts.dependentKeys;
|
3183
|
+
this._readOnly = opts && (opts.readOnly !== undefined || !!opts.readOnly);
|
3138
3184
|
}
|
3139
3185
|
|
3140
3186
|
Ember.ComputedProperty = ComputedProperty;
|
@@ -3189,6 +3235,28 @@ ComputedPropertyPrototype.volatile = function() {
|
|
3189
3235
|
return this.cacheable(false);
|
3190
3236
|
};
|
3191
3237
|
|
3238
|
+
/**
|
3239
|
+
Call on a computed property to set it into read-only mode. When in this
|
3240
|
+
mode the computed property will throw an error when set.
|
3241
|
+
|
3242
|
+
```javascript
|
3243
|
+
MyApp.person = Ember.Object.create({
|
3244
|
+
guid: function() {
|
3245
|
+
return 'guid-guid-guid';
|
3246
|
+
}.property().readOnly()
|
3247
|
+
});
|
3248
|
+
|
3249
|
+
MyApp.person.set('guid', 'new-guid'); // will throw an exception
|
3250
|
+
```
|
3251
|
+
|
3252
|
+
@method readOnly
|
3253
|
+
@chainable
|
3254
|
+
*/
|
3255
|
+
ComputedPropertyPrototype.readOnly = function(readOnly) {
|
3256
|
+
this._readOnly = readOnly === undefined || !!readOnly;
|
3257
|
+
return this;
|
3258
|
+
};
|
3259
|
+
|
3192
3260
|
/**
|
3193
3261
|
Sets the dependent keys on this computed property. Pass any number of
|
3194
3262
|
arguments containing key paths that this computed property depends on.
|
@@ -3313,9 +3381,14 @@ ComputedPropertyPrototype.set = function(obj, keyName, value) {
|
|
3313
3381
|
cache = meta.cache,
|
3314
3382
|
cachedValue, ret;
|
3315
3383
|
|
3384
|
+
if (this._readOnly) {
|
3385
|
+
throw new Error('Cannot Set: ' + keyName + ' on: ' + obj.toString() );
|
3386
|
+
}
|
3387
|
+
|
3316
3388
|
this._suspended = obj;
|
3317
3389
|
|
3318
3390
|
try {
|
3391
|
+
|
3319
3392
|
if (cacheable && cache.hasOwnProperty(keyName)) {
|
3320
3393
|
cachedValue = cache[keyName];
|
3321
3394
|
hadCachedValue = true;
|
@@ -3406,6 +3479,10 @@ Ember.computed = function(func) {
|
|
3406
3479
|
func = a_slice.call(arguments, -1)[0];
|
3407
3480
|
}
|
3408
3481
|
|
3482
|
+
if ( typeof func !== "function" ) {
|
3483
|
+
throw new Error("Computed Property declared without a property function");
|
3484
|
+
}
|
3485
|
+
|
3409
3486
|
var cp = new ComputedProperty(func);
|
3410
3487
|
|
3411
3488
|
if (args) {
|
@@ -3446,6 +3523,18 @@ Ember.computed.not = function(dependentKey) {
|
|
3446
3523
|
});
|
3447
3524
|
};
|
3448
3525
|
|
3526
|
+
/**
|
3527
|
+
@method computed.none
|
3528
|
+
@for Ember
|
3529
|
+
@param {String} dependentKey
|
3530
|
+
*/
|
3531
|
+
Ember.computed.none = function(dependentKey) {
|
3532
|
+
return Ember.computed(dependentKey, function(key) {
|
3533
|
+
var val = get(this, dependentKey);
|
3534
|
+
return Ember.isNone(val);
|
3535
|
+
});
|
3536
|
+
};
|
3537
|
+
|
3449
3538
|
/**
|
3450
3539
|
@method computed.empty
|
3451
3540
|
@for Ember
|
@@ -3454,7 +3543,7 @@ Ember.computed.not = function(dependentKey) {
|
|
3454
3543
|
Ember.computed.empty = function(dependentKey) {
|
3455
3544
|
return Ember.computed(dependentKey, function(key) {
|
3456
3545
|
var val = get(this, dependentKey);
|
3457
|
-
return
|
3546
|
+
return Ember.isEmpty(val);
|
3458
3547
|
});
|
3459
3548
|
};
|
3460
3549
|
|
@@ -3472,15 +3561,16 @@ Ember.computed.bool = function(dependentKey) {
|
|
3472
3561
|
/**
|
3473
3562
|
@method computed.alias
|
3474
3563
|
@for Ember
|
3564
|
+
|
3475
3565
|
@param {String} dependentKey
|
3476
3566
|
*/
|
3477
3567
|
Ember.computed.alias = function(dependentKey) {
|
3478
3568
|
return Ember.computed(dependentKey, function(key, value){
|
3479
|
-
if (arguments.length
|
3480
|
-
return get(this, dependentKey);
|
3481
|
-
} else {
|
3569
|
+
if (arguments.length > 1) {
|
3482
3570
|
set(this, dependentKey, value);
|
3483
3571
|
return value;
|
3572
|
+
} else {
|
3573
|
+
return get(this, dependentKey);
|
3484
3574
|
}
|
3485
3575
|
});
|
3486
3576
|
};
|
@@ -3496,7 +3586,6 @@ Ember.computed.alias = function(dependentKey) {
|
|
3496
3586
|
|
3497
3587
|
var o_create = Ember.create,
|
3498
3588
|
metaFor = Ember.meta,
|
3499
|
-
metaPath = Ember.metaPath,
|
3500
3589
|
META_KEY = Ember.META_KEY;
|
3501
3590
|
|
3502
3591
|
/*
|
@@ -4069,7 +4158,7 @@ Ember.RunLoop = RunLoop;
|
|
4069
4158
|
|
4070
4159
|
```javascript
|
4071
4160
|
Ember.run(function(){
|
4072
|
-
// code to be execute within a RunLoop
|
4161
|
+
// code to be execute within a RunLoop
|
4073
4162
|
});
|
4074
4163
|
```
|
4075
4164
|
|
@@ -4085,8 +4174,7 @@ Ember.RunLoop = RunLoop;
|
|
4085
4174
|
@return {Object} return value from invoking the passed function.
|
4086
4175
|
*/
|
4087
4176
|
Ember.run = function(target, method) {
|
4088
|
-
var
|
4089
|
-
args = arguments;
|
4177
|
+
var args = arguments;
|
4090
4178
|
run.begin();
|
4091
4179
|
|
4092
4180
|
function tryable() {
|
@@ -4104,11 +4192,11 @@ var run = Ember.run;
|
|
4104
4192
|
/**
|
4105
4193
|
Begins a new RunLoop. Any deferred actions invoked after the begin will
|
4106
4194
|
be buffered until you invoke a matching call to `Ember.run.end()`. This is
|
4107
|
-
|
4195
|
+
a lower-level way to use a RunLoop instead of using `Ember.run()`.
|
4108
4196
|
|
4109
4197
|
```javascript
|
4110
4198
|
Ember.run.begin();
|
4111
|
-
// code to be execute within a RunLoop
|
4199
|
+
// code to be execute within a RunLoop
|
4112
4200
|
Ember.run.end();
|
4113
4201
|
```
|
4114
4202
|
|
@@ -4126,7 +4214,7 @@ Ember.run.begin = function() {
|
|
4126
4214
|
|
4127
4215
|
```javascript
|
4128
4216
|
Ember.run.begin();
|
4129
|
-
// code to be execute within a RunLoop
|
4217
|
+
// code to be execute within a RunLoop
|
4130
4218
|
Ember.run.end();
|
4131
4219
|
```
|
4132
4220
|
|
@@ -4150,9 +4238,9 @@ Ember.run.end = function() {
|
|
4150
4238
|
|
4151
4239
|
@property queues
|
4152
4240
|
@type Array
|
4153
|
-
@default ['sync', 'actions', 'destroy'
|
4241
|
+
@default ['sync', 'actions', 'destroy']
|
4154
4242
|
*/
|
4155
|
-
Ember.run.queues = ['sync', 'actions', 'destroy'
|
4243
|
+
Ember.run.queues = ['sync', 'actions', 'destroy'];
|
4156
4244
|
|
4157
4245
|
/**
|
4158
4246
|
Adds the passed target/method and any optional arguments to the named
|
@@ -4165,19 +4253,19 @@ Ember.run.queues = ['sync', 'actions', 'destroy', 'timers'];
|
|
4165
4253
|
the `run.queues` property.
|
4166
4254
|
|
4167
4255
|
```javascript
|
4168
|
-
Ember.run.schedule('timers', this, function(){
|
4169
|
-
// this will be executed at the end of the RunLoop, when timers are run
|
4170
|
-
console.log("scheduled on timers queue");
|
4171
|
-
});
|
4172
|
-
|
4173
4256
|
Ember.run.schedule('sync', this, function(){
|
4174
|
-
// this will be executed
|
4257
|
+
// this will be executed in the first RunLoop queue, when bindings are synced
|
4175
4258
|
console.log("scheduled on sync queue");
|
4176
4259
|
});
|
4177
4260
|
|
4261
|
+
Ember.run.schedule('actions', this, function(){
|
4262
|
+
// this will be executed in the 'actions' queue, after bindings have synced.
|
4263
|
+
console.log("scheduled on actions queue");
|
4264
|
+
});
|
4265
|
+
|
4178
4266
|
// Note the functions will be run in order based on the run queues order. Output would be:
|
4179
4267
|
// scheduled on sync queue
|
4180
|
-
// scheduled on
|
4268
|
+
// scheduled on actions queue
|
4181
4269
|
```
|
4182
4270
|
|
4183
4271
|
@method schedule
|
@@ -4203,7 +4291,7 @@ function autorun() {
|
|
4203
4291
|
|
4204
4292
|
// Used by global test teardown
|
4205
4293
|
Ember.run.hasScheduledTimers = function() {
|
4206
|
-
return !!(scheduledAutorun || scheduledLater
|
4294
|
+
return !!(scheduledAutorun || scheduledLater);
|
4207
4295
|
};
|
4208
4296
|
|
4209
4297
|
// Used by global test teardown
|
@@ -4216,10 +4304,6 @@ Ember.run.cancelTimers = function () {
|
|
4216
4304
|
clearTimeout(scheduledLater);
|
4217
4305
|
scheduledLater = null;
|
4218
4306
|
}
|
4219
|
-
if (scheduledNext) {
|
4220
|
-
clearTimeout(scheduledNext);
|
4221
|
-
scheduledNext = null;
|
4222
|
-
}
|
4223
4307
|
timers = {};
|
4224
4308
|
};
|
4225
4309
|
|
@@ -4254,7 +4338,8 @@ Ember.run.autorun = function() {
|
|
4254
4338
|
bindings in the application to sync.
|
4255
4339
|
|
4256
4340
|
You should call this method anytime you need any changed state to propagate
|
4257
|
-
throughout the app immediately without repainting the UI
|
4341
|
+
throughout the app immediately without repainting the UI (which happens
|
4342
|
+
in the later 'render' queue added by the `ember-views` package).
|
4258
4343
|
|
4259
4344
|
```javascript
|
4260
4345
|
Ember.run.sync();
|
@@ -4274,25 +4359,30 @@ Ember.run.sync = function() {
|
|
4274
4359
|
|
4275
4360
|
var timers = {}; // active timers...
|
4276
4361
|
|
4277
|
-
var scheduledLater;
|
4362
|
+
var scheduledLater, scheduledLaterExpires;
|
4278
4363
|
function invokeLaterTimers() {
|
4279
4364
|
scheduledLater = null;
|
4280
|
-
|
4281
|
-
|
4282
|
-
|
4283
|
-
|
4284
|
-
|
4285
|
-
if (
|
4286
|
-
|
4287
|
-
|
4288
|
-
|
4289
|
-
|
4365
|
+
run(function() {
|
4366
|
+
var now = (+ new Date()), earliest = -1;
|
4367
|
+
for (var key in timers) {
|
4368
|
+
if (!timers.hasOwnProperty(key)) { continue; }
|
4369
|
+
var timer = timers[key];
|
4370
|
+
if (timer && timer.expires) {
|
4371
|
+
if (now >= timer.expires) {
|
4372
|
+
delete timers[key];
|
4373
|
+
invoke(timer.target, timer.method, timer.args, 2);
|
4374
|
+
} else {
|
4375
|
+
if (earliest < 0 || (timer.expires < earliest)) { earliest = timer.expires; }
|
4376
|
+
}
|
4290
4377
|
}
|
4291
4378
|
}
|
4292
|
-
}
|
4293
4379
|
|
4294
|
-
|
4295
|
-
|
4380
|
+
// schedule next timeout to fire when the earliest timer expires
|
4381
|
+
if (earliest > 0) {
|
4382
|
+
scheduledLater = setTimeout(invokeLaterTimers, earliest - now);
|
4383
|
+
scheduledLaterExpires = earliest;
|
4384
|
+
}
|
4385
|
+
});
|
4296
4386
|
}
|
4297
4387
|
|
4298
4388
|
/**
|
@@ -4340,7 +4430,19 @@ Ember.run.later = function(target, method) {
|
|
4340
4430
|
timer = { target: target, method: method, expires: expires, args: args };
|
4341
4431
|
guid = Ember.guidFor(timer);
|
4342
4432
|
timers[guid] = timer;
|
4343
|
-
|
4433
|
+
|
4434
|
+
if(scheduledLater && expires < scheduledLaterExpires) {
|
4435
|
+
// Cancel later timer (then reschedule earlier timer below)
|
4436
|
+
clearTimeout(scheduledLater);
|
4437
|
+
scheduledLater = null;
|
4438
|
+
}
|
4439
|
+
|
4440
|
+
if (!scheduledLater) {
|
4441
|
+
// Schedule later timers to be run.
|
4442
|
+
scheduledLater = setTimeout(invokeLaterTimers, wait);
|
4443
|
+
scheduledLaterExpires = expires;
|
4444
|
+
}
|
4445
|
+
|
4344
4446
|
return guid;
|
4345
4447
|
};
|
4346
4448
|
|
@@ -4396,6 +4498,21 @@ function scheduleOnce(queue, target, method, args) {
|
|
4396
4498
|
});
|
4397
4499
|
```
|
4398
4500
|
|
4501
|
+
Also note that passing an anonymous function to `Ember.run.once` will
|
4502
|
+
not prevent additional calls with an identical anonymous function from
|
4503
|
+
scheduling the items multiple times, e.g.:
|
4504
|
+
|
4505
|
+
```javascript
|
4506
|
+
function scheduleIt() {
|
4507
|
+
Ember.run.once(myContext, function() { console.log("Closure"); });
|
4508
|
+
}
|
4509
|
+
scheduleIt();
|
4510
|
+
scheduleIt();
|
4511
|
+
// "Closure" will print twice, even though we're using `Ember.run.once`,
|
4512
|
+
// because the function we pass to it is anonymous and won't match the
|
4513
|
+
// previously scheduled operation.
|
4514
|
+
```
|
4515
|
+
|
4399
4516
|
@method once
|
4400
4517
|
@param {Object} [target] target of method to invoke
|
4401
4518
|
@param {Function|String} method The method to invoke.
|
@@ -4412,22 +4529,9 @@ Ember.run.scheduleOnce = function(queue, target, method, args) {
|
|
4412
4529
|
return scheduleOnce(queue, target, method, slice.call(arguments, 3));
|
4413
4530
|
};
|
4414
4531
|
|
4415
|
-
var scheduledNext;
|
4416
|
-
function invokeNextTimers() {
|
4417
|
-
scheduledNext = null;
|
4418
|
-
for(var key in timers) {
|
4419
|
-
if (!timers.hasOwnProperty(key)) { continue; }
|
4420
|
-
var timer = timers[key];
|
4421
|
-
if (timer.next) {
|
4422
|
-
delete timers[key];
|
4423
|
-
invoke(timer.target, timer.method, timer.args, 2);
|
4424
|
-
}
|
4425
|
-
}
|
4426
|
-
}
|
4427
|
-
|
4428
4532
|
/**
|
4429
4533
|
Schedules an item to run after control has been returned to the system.
|
4430
|
-
This is
|
4534
|
+
This is equivalent to calling `Ember.run.later` with a wait time of 1ms.
|
4431
4535
|
|
4432
4536
|
```javascript
|
4433
4537
|
Ember.run.next(myContext, function(){
|
@@ -4443,20 +4547,10 @@ function invokeNextTimers() {
|
|
4443
4547
|
@param {Object} [args*] Optional arguments to pass to the timeout.
|
4444
4548
|
@return {Object} timer
|
4445
4549
|
*/
|
4446
|
-
Ember.run.next = function(
|
4447
|
-
var
|
4448
|
-
|
4449
|
-
|
4450
|
-
method: method,
|
4451
|
-
args: slice.call(arguments),
|
4452
|
-
next: true
|
4453
|
-
};
|
4454
|
-
|
4455
|
-
guid = Ember.guidFor(timer);
|
4456
|
-
timers[guid] = timer;
|
4457
|
-
|
4458
|
-
if (!scheduledNext) { scheduledNext = setTimeout(invokeNextTimers, 1); }
|
4459
|
-
return guid;
|
4550
|
+
Ember.run.next = function() {
|
4551
|
+
var args = slice.call(arguments);
|
4552
|
+
args.push(1); // 1 millisecond wait
|
4553
|
+
return run.later.apply(this, args);
|
4460
4554
|
};
|
4461
4555
|
|
4462
4556
|
/**
|
@@ -4961,7 +5055,6 @@ var Mixin, REQUIRED, Alias,
|
|
4961
5055
|
a_indexOf = Ember.ArrayPolyfills.indexOf,
|
4962
5056
|
a_forEach = Ember.ArrayPolyfills.forEach,
|
4963
5057
|
a_slice = [].slice,
|
4964
|
-
EMPTY_META = {}, // dummy for non-writable meta
|
4965
5058
|
o_create = Ember.create,
|
4966
5059
|
defineProperty = Ember.defineProperty,
|
4967
5060
|
guidFor = Ember.guidFor;
|
@@ -5330,6 +5423,38 @@ Mixin.finishPartial = finishPartial;
|
|
5330
5423
|
Ember.anyUnprocessedMixins = false;
|
5331
5424
|
|
5332
5425
|
/**
|
5426
|
+
Creates an instance of a class. Accepts either no arguments, or an object
|
5427
|
+
containing values to initialize the newly instantiated object with.
|
5428
|
+
|
5429
|
+
```javascript
|
5430
|
+
App.Person = Ember.Object.extend({
|
5431
|
+
helloWorld: function() {
|
5432
|
+
alert("Hi, my name is " + this.get('name'));
|
5433
|
+
}
|
5434
|
+
});
|
5435
|
+
|
5436
|
+
var tom = App.Person.create({
|
5437
|
+
name: 'Tom Dale'
|
5438
|
+
});
|
5439
|
+
|
5440
|
+
tom.helloWorld(); // alerts "Hi, my name is Tom Dale".
|
5441
|
+
```
|
5442
|
+
|
5443
|
+
`create` will call the `init` function if defined during
|
5444
|
+
`Ember.AnyObject.extend`
|
5445
|
+
|
5446
|
+
If no arguments are passed to `create`, it will not set values to the new
|
5447
|
+
instance during initialization:
|
5448
|
+
|
5449
|
+
```javascript
|
5450
|
+
var noName = App.Person.create();
|
5451
|
+
noName.helloWorld(); // alerts undefined
|
5452
|
+
```
|
5453
|
+
|
5454
|
+
NOTE: For performance reasons, you cannot declare methods or computed
|
5455
|
+
properties during `create`. You should instead declare methods and computed
|
5456
|
+
properties when using `extend`.
|
5457
|
+
|
5333
5458
|
@method create
|
5334
5459
|
@static
|
5335
5460
|
@param arguments*
|
@@ -5845,35 +5970,35 @@ define("rsvp",
|
|
5845
5970
|
}
|
5846
5971
|
|
5847
5972
|
function all(promises) {
|
5848
|
-
|
5849
|
-
|
5850
|
-
|
5973
|
+
var i, results = [];
|
5974
|
+
var allPromise = new Promise();
|
5975
|
+
var remaining = promises.length;
|
5851
5976
|
|
5852
5977
|
if (remaining === 0) {
|
5853
5978
|
allPromise.resolve([]);
|
5854
5979
|
}
|
5855
5980
|
|
5856
|
-
|
5857
|
-
|
5858
|
-
|
5859
|
-
|
5860
|
-
|
5981
|
+
var resolver = function(index) {
|
5982
|
+
return function(value) {
|
5983
|
+
resolve(index, value);
|
5984
|
+
};
|
5985
|
+
};
|
5861
5986
|
|
5862
|
-
|
5863
|
-
|
5864
|
-
|
5865
|
-
|
5866
|
-
|
5867
|
-
|
5987
|
+
var resolve = function(index, value) {
|
5988
|
+
results[index] = value;
|
5989
|
+
if (--remaining === 0) {
|
5990
|
+
allPromise.resolve(results);
|
5991
|
+
}
|
5992
|
+
};
|
5868
5993
|
|
5869
|
-
|
5870
|
-
|
5871
|
-
|
5994
|
+
var reject = function(error) {
|
5995
|
+
allPromise.reject(error);
|
5996
|
+
};
|
5872
5997
|
|
5873
|
-
|
5874
|
-
|
5875
|
-
|
5876
|
-
|
5998
|
+
for (i = 0; i < remaining; i++) {
|
5999
|
+
promises[i].then(resolver(i), reject);
|
6000
|
+
}
|
6001
|
+
return allPromise;
|
5877
6002
|
}
|
5878
6003
|
|
5879
6004
|
EventTarget.mixin(Promise.prototype);
|
@@ -6249,57 +6374,6 @@ Ember.typeOf = function(item) {
|
|
6249
6374
|
return ret;
|
6250
6375
|
};
|
6251
6376
|
|
6252
|
-
/**
|
6253
|
-
Returns true if the passed value is null or undefined. This avoids errors
|
6254
|
-
from JSLint complaining about use of ==, which can be technically
|
6255
|
-
confusing.
|
6256
|
-
|
6257
|
-
```javascript
|
6258
|
-
Ember.isNone(); // true
|
6259
|
-
Ember.isNone(null); // true
|
6260
|
-
Ember.isNone(undefined); // true
|
6261
|
-
Ember.isNone(''); // false
|
6262
|
-
Ember.isNone([]); // false
|
6263
|
-
Ember.isNone(function(){}); // false
|
6264
|
-
```
|
6265
|
-
|
6266
|
-
@method isNone
|
6267
|
-
@for Ember
|
6268
|
-
@param {Object} obj Value to test
|
6269
|
-
@return {Boolean}
|
6270
|
-
*/
|
6271
|
-
Ember.isNone = function(obj) {
|
6272
|
-
return obj === null || obj === undefined;
|
6273
|
-
};
|
6274
|
-
Ember.none = Ember.deprecateFunc("Ember.none is deprecated. Please use Ember.isNone instead.", Ember.isNone);
|
6275
|
-
|
6276
|
-
/**
|
6277
|
-
Verifies that a value is `null` or an empty string, empty array,
|
6278
|
-
or empty function.
|
6279
|
-
|
6280
|
-
Constrains the rules on `Ember.isNone` by returning false for empty
|
6281
|
-
string and empty arrays.
|
6282
|
-
|
6283
|
-
```javascript
|
6284
|
-
Ember.isEmpty(); // true
|
6285
|
-
Ember.isEmpty(null); // true
|
6286
|
-
Ember.isEmpty(undefined); // true
|
6287
|
-
Ember.isEmpty(''); // true
|
6288
|
-
Ember.isEmpty([]); // true
|
6289
|
-
Ember.isEmpty('Adam Hawkins'); // false
|
6290
|
-
Ember.isEmpty([0,1,2]); // false
|
6291
|
-
```
|
6292
|
-
|
6293
|
-
@method isEmpty
|
6294
|
-
@for Ember
|
6295
|
-
@param {Object} obj Value to test
|
6296
|
-
@return {Boolean}
|
6297
|
-
*/
|
6298
|
-
Ember.isEmpty = function(obj) {
|
6299
|
-
return obj === null || obj === undefined || (obj.length === 0 && typeof obj !== 'function') || (typeof obj === 'object' && Ember.get(obj, 'length') === 0);
|
6300
|
-
};
|
6301
|
-
Ember.empty = Ember.deprecateFunc("Ember.empty is deprecated. Please use Ember.isEmpty instead.", Ember.isEmpty) ;
|
6302
|
-
|
6303
6377
|
/**
|
6304
6378
|
This will compare two javascript values of possibly different types.
|
6305
6379
|
It will tell you which one is greater than the other by returning:
|
@@ -6592,6 +6666,20 @@ Ember.Error.prototype = Ember.create(Error.prototype);
|
|
6592
6666
|
|
6593
6667
|
|
6594
6668
|
|
6669
|
+
(function() {
|
6670
|
+
/**
|
6671
|
+
Expose RSVP implementation
|
6672
|
+
|
6673
|
+
@class RSVP
|
6674
|
+
@namespace Ember
|
6675
|
+
@constructor
|
6676
|
+
*/
|
6677
|
+
Ember.RSVP = requireModule('rsvp');
|
6678
|
+
|
6679
|
+
})();
|
6680
|
+
|
6681
|
+
|
6682
|
+
|
6595
6683
|
(function() {
|
6596
6684
|
/**
|
6597
6685
|
@module ember
|
@@ -6740,10 +6828,11 @@ Ember.String = {
|
|
6740
6828
|
*/
|
6741
6829
|
dasherize: function(str) {
|
6742
6830
|
var cache = STRING_DASHERIZE_CACHE,
|
6743
|
-
|
6831
|
+
hit = cache.hasOwnProperty(str),
|
6832
|
+
ret;
|
6744
6833
|
|
6745
|
-
if (
|
6746
|
-
return
|
6834
|
+
if (hit) {
|
6835
|
+
return cache[str];
|
6747
6836
|
} else {
|
6748
6837
|
ret = Ember.String.decamelize(str).replace(STRING_DASHERIZE_REGEXP,'-');
|
6749
6838
|
cache[str] = ret;
|
@@ -6753,7 +6842,7 @@ Ember.String = {
|
|
6753
6842
|
},
|
6754
6843
|
|
6755
6844
|
/**
|
6756
|
-
Returns the
|
6845
|
+
Returns the lowerCamelCase form of a string.
|
6757
6846
|
|
6758
6847
|
```javascript
|
6759
6848
|
'innerHTML'.camelize(); // 'innerHTML'
|
@@ -6824,10 +6913,10 @@ Ember.String = {
|
|
6824
6913
|
/**
|
6825
6914
|
Returns the Capitalized form of a string
|
6826
6915
|
|
6827
|
-
'innerHTML'.capitalize()
|
6828
|
-
'action_name'.capitalize()
|
6829
|
-
'css-class-name'.capitalize()
|
6830
|
-
'my favorite items'.capitalize()
|
6916
|
+
'innerHTML'.capitalize() // 'InnerHTML'
|
6917
|
+
'action_name'.capitalize() // 'Action_name'
|
6918
|
+
'css-class-name'.capitalize() // 'Css-class-name'
|
6919
|
+
'my favorite items'.capitalize() // 'My favorite items'
|
6831
6920
|
|
6832
6921
|
@method capitalize
|
6833
6922
|
@param {String} str
|
@@ -7171,8 +7260,7 @@ function iter(key, value) {
|
|
7171
7260
|
@extends Ember.Mixin
|
7172
7261
|
@since Ember 0.9
|
7173
7262
|
*/
|
7174
|
-
Ember.Enumerable = Ember.Mixin.create(
|
7175
|
-
/** @scope Ember.Enumerable.prototype */ {
|
7263
|
+
Ember.Enumerable = Ember.Mixin.create({
|
7176
7264
|
|
7177
7265
|
// compatibility
|
7178
7266
|
isEnumerable: true,
|
@@ -7205,7 +7293,7 @@ Ember.Enumerable = Ember.Mixin.create(
|
|
7205
7293
|
|
7206
7294
|
@method nextObject
|
7207
7295
|
@param {Number} index the current index of the iteration
|
7208
|
-
@param {Object} previousObject the value returned by the last call to
|
7296
|
+
@param {Object} previousObject the value returned by the last call to
|
7209
7297
|
`nextObject`.
|
7210
7298
|
@param {Object} context a context object you can use to maintain state.
|
7211
7299
|
@return {Object} the next object in the iteration or undefined
|
@@ -7224,10 +7312,10 @@ Ember.Enumerable = Ember.Mixin.create(
|
|
7224
7312
|
|
7225
7313
|
```javascript
|
7226
7314
|
var arr = ["a", "b", "c"];
|
7227
|
-
arr.firstObject
|
7315
|
+
arr.get('firstObject'); // "a"
|
7228
7316
|
|
7229
7317
|
var arr = [];
|
7230
|
-
arr.firstObject
|
7318
|
+
arr.get('firstObject'); // undefined
|
7231
7319
|
```
|
7232
7320
|
|
7233
7321
|
@property firstObject
|
@@ -7250,10 +7338,10 @@ Ember.Enumerable = Ember.Mixin.create(
|
|
7250
7338
|
|
7251
7339
|
```javascript
|
7252
7340
|
var arr = ["a", "b", "c"];
|
7253
|
-
arr.lastObject
|
7341
|
+
arr.get('lastObject'); // "c"
|
7254
7342
|
|
7255
7343
|
var arr = [];
|
7256
|
-
arr.lastObject
|
7344
|
+
arr.get('lastObject'); // undefined
|
7257
7345
|
```
|
7258
7346
|
|
7259
7347
|
@property lastObject
|
@@ -7386,7 +7474,7 @@ Ember.Enumerable = Ember.Mixin.create(
|
|
7386
7474
|
@return {Array} The mapped array.
|
7387
7475
|
*/
|
7388
7476
|
map: function(callback, target) {
|
7389
|
-
var ret = [];
|
7477
|
+
var ret = Ember.A([]);
|
7390
7478
|
this.forEach(function(x, idx, i) {
|
7391
7479
|
ret[idx] = callback.call(target, x, idx,i);
|
7392
7480
|
});
|
@@ -7436,7 +7524,7 @@ Ember.Enumerable = Ember.Mixin.create(
|
|
7436
7524
|
@return {Array} A filtered array.
|
7437
7525
|
*/
|
7438
7526
|
filter: function(callback, target) {
|
7439
|
-
var ret = [];
|
7527
|
+
var ret = Ember.A([]);
|
7440
7528
|
this.forEach(function(x, idx, i) {
|
7441
7529
|
if (callback.call(target, x, idx, i)) ret.push(x);
|
7442
7530
|
});
|
@@ -7725,7 +7813,7 @@ Ember.Enumerable = Ember.Mixin.create(
|
|
7725
7813
|
@return {Array} return values from calling invoke.
|
7726
7814
|
*/
|
7727
7815
|
invoke: function(methodName) {
|
7728
|
-
var args, ret = [];
|
7816
|
+
var args, ret = Ember.A([]);
|
7729
7817
|
if (arguments.length>1) args = a_slice.call(arguments, 1);
|
7730
7818
|
|
7731
7819
|
this.forEach(function(x, idx) {
|
@@ -7746,7 +7834,7 @@ Ember.Enumerable = Ember.Mixin.create(
|
|
7746
7834
|
@return {Array} the enumerable as an array.
|
7747
7835
|
*/
|
7748
7836
|
toArray: function() {
|
7749
|
-
var ret = [];
|
7837
|
+
var ret = Ember.A([]);
|
7750
7838
|
this.forEach(function(o, idx) { ret[idx] = o; });
|
7751
7839
|
return ret ;
|
7752
7840
|
},
|
@@ -7780,7 +7868,7 @@ Ember.Enumerable = Ember.Mixin.create(
|
|
7780
7868
|
*/
|
7781
7869
|
without: function(value) {
|
7782
7870
|
if (!this.contains(value)) return this; // nothing to do
|
7783
|
-
var ret = []
|
7871
|
+
var ret = Ember.A([]);
|
7784
7872
|
this.forEach(function(k) {
|
7785
7873
|
if (k !== value) ret[ret.length] = k;
|
7786
7874
|
}) ;
|
@@ -7800,7 +7888,7 @@ Ember.Enumerable = Ember.Mixin.create(
|
|
7800
7888
|
@return {Ember.Enumerable}
|
7801
7889
|
*/
|
7802
7890
|
uniq: function() {
|
7803
|
-
var ret = [];
|
7891
|
+
var ret = Ember.A([]);
|
7804
7892
|
this.forEach(function(k){
|
7805
7893
|
if (a_indexOf(ret, k)<0) ret.push(k);
|
7806
7894
|
});
|
@@ -7832,7 +7920,7 @@ Ember.Enumerable = Ember.Mixin.create(
|
|
7832
7920
|
|
7833
7921
|
@method addEnumerableObserver
|
7834
7922
|
@param {Object} target
|
7835
|
-
@param {Hash} opts
|
7923
|
+
@param {Hash} [opts]
|
7836
7924
|
*/
|
7837
7925
|
addEnumerableObserver: function(target, opts) {
|
7838
7926
|
var willChange = (opts && opts.willChange) || 'enumerableWillChange',
|
@@ -7930,7 +8018,7 @@ Ember.Enumerable = Ember.Mixin.create(
|
|
7930
8018
|
@chainable
|
7931
8019
|
*/
|
7932
8020
|
enumerableContentDidChange: function(removing, adding) {
|
7933
|
-
var
|
8021
|
+
var removeCnt, addCnt, hasDelta;
|
7934
8022
|
|
7935
8023
|
if ('number' === typeof removing) removeCnt = removing;
|
7936
8024
|
else if (removing) removeCnt = get(removing, 'length');
|
@@ -7968,7 +8056,7 @@ Ember.Enumerable = Ember.Mixin.create(
|
|
7968
8056
|
// HELPERS
|
7969
8057
|
//
|
7970
8058
|
|
7971
|
-
var get = Ember.get, set = Ember.set,
|
8059
|
+
var get = Ember.get, set = Ember.set, map = Ember.EnumerableUtils.map, cacheFor = Ember.cacheFor;
|
7972
8060
|
|
7973
8061
|
function none(obj) { return obj===null || obj===undefined; }
|
7974
8062
|
|
@@ -8110,15 +8198,19 @@ Ember.Array = Ember.Mixin.create(Ember.Enumerable, /** @scope Ember.Array.protot
|
|
8110
8198
|
```
|
8111
8199
|
|
8112
8200
|
@method slice
|
8113
|
-
@param
|
8114
|
-
@param
|
8201
|
+
@param {Integer} beginIndex (Optional) index to begin slicing from.
|
8202
|
+
@param {Integer} endIndex (Optional) index to end the slice at.
|
8115
8203
|
@return {Array} New array with specified slice
|
8116
8204
|
*/
|
8117
8205
|
slice: function(beginIndex, endIndex) {
|
8118
|
-
var ret = [];
|
8206
|
+
var ret = Ember.A([]);
|
8119
8207
|
var length = get(this, 'length') ;
|
8120
8208
|
if (none(beginIndex)) beginIndex = 0 ;
|
8121
8209
|
if (none(endIndex) || (endIndex > length)) endIndex = length ;
|
8210
|
+
|
8211
|
+
if (beginIndex < 0) beginIndex = length + beginIndex;
|
8212
|
+
if (endIndex < 0) endIndex = length + endIndex;
|
8213
|
+
|
8122
8214
|
while(beginIndex < endIndex) {
|
8123
8215
|
ret[ret.length] = this.objectAt(beginIndex++) ;
|
8124
8216
|
}
|
@@ -8272,9 +8364,9 @@ Ember.Array = Ember.Mixin.create(Ember.Enumerable, /** @scope Ember.Array.protot
|
|
8272
8364
|
|
8273
8365
|
@method arrayContentWillChange
|
8274
8366
|
@param {Number} startIdx The starting index in the array that will change.
|
8275
|
-
@param {Number} removeAmt The number of items that will be removed. If you
|
8367
|
+
@param {Number} removeAmt The number of items that will be removed. If you
|
8276
8368
|
pass `null` assumes 0
|
8277
|
-
@param {Number} addAmt The number of items that will be added If you
|
8369
|
+
@param {Number} addAmt The number of items that will be added If you
|
8278
8370
|
pass `null` assumes 0.
|
8279
8371
|
@return {Ember.Array} receiver
|
8280
8372
|
*/
|
@@ -8635,8 +8727,7 @@ var forEach = Ember.EnumerableUtils.forEach;
|
|
8635
8727
|
@extends Ember.Mixin
|
8636
8728
|
@uses Ember.Enumerable
|
8637
8729
|
*/
|
8638
|
-
Ember.MutableEnumerable = Ember.Mixin.create(Ember.Enumerable,
|
8639
|
-
/** @scope Ember.MutableEnumerable.prototype */ {
|
8730
|
+
Ember.MutableEnumerable = Ember.Mixin.create(Ember.Enumerable, {
|
8640
8731
|
|
8641
8732
|
/**
|
8642
8733
|
__Required.__ You must implement this method to apply this mixin.
|
@@ -8721,7 +8812,7 @@ var EMPTY = [];
|
|
8721
8812
|
// HELPERS
|
8722
8813
|
//
|
8723
8814
|
|
8724
|
-
var get = Ember.get, set = Ember.set
|
8815
|
+
var get = Ember.get, set = Ember.set;
|
8725
8816
|
|
8726
8817
|
/**
|
8727
8818
|
This mixin defines the API for modifying array-like objects. These methods
|
@@ -8748,11 +8839,11 @@ Ember.MutableArray = Ember.Mixin.create(Ember.Array, Ember.MutableEnumerable,
|
|
8748
8839
|
passed array. You should also call `this.enumerableContentDidChange()`
|
8749
8840
|
|
8750
8841
|
@method replace
|
8751
|
-
@param {Number} idx Starting index in the array to replace. If
|
8842
|
+
@param {Number} idx Starting index in the array to replace. If
|
8752
8843
|
idx >= length, then append to the end of the array.
|
8753
|
-
@param {Number} amt Number of elements that should be removed from
|
8844
|
+
@param {Number} amt Number of elements that should be removed from
|
8754
8845
|
the array, starting at *idx*.
|
8755
|
-
@param {Array} objects An array of zero or more objects that should be
|
8846
|
+
@param {Array} objects An array of zero or more objects that should be
|
8756
8847
|
inserted into the array at *idx*
|
8757
8848
|
*/
|
8758
8849
|
replace: Ember.required(),
|
@@ -9017,7 +9108,7 @@ Ember.MutableArray = Ember.Mixin.create(Ember.Array, Ember.MutableEnumerable,
|
|
9017
9108
|
@submodule ember-runtime
|
9018
9109
|
*/
|
9019
9110
|
|
9020
|
-
var get = Ember.get, set = Ember.set
|
9111
|
+
var get = Ember.get, set = Ember.set;
|
9021
9112
|
|
9022
9113
|
/**
|
9023
9114
|
## Overview
|
@@ -9615,6 +9706,16 @@ Ember.TargetActionSupport = Ember.Mixin.create({
|
|
9615
9706
|
// outputs: 'Our person has greeted'
|
9616
9707
|
```
|
9617
9708
|
|
9709
|
+
You can also chain multiple event subscriptions:
|
9710
|
+
|
9711
|
+
```javascript
|
9712
|
+
person.on('greet', function() {
|
9713
|
+
console.log('Our person has greeted');
|
9714
|
+
}).one('greet', function() {
|
9715
|
+
console.log('Offer one-time special');
|
9716
|
+
}).off('event', this, forgetThis);
|
9717
|
+
```
|
9718
|
+
|
9618
9719
|
@class Evented
|
9619
9720
|
@namespace Ember
|
9620
9721
|
@extends Ember.Mixin
|
@@ -9642,6 +9743,7 @@ Ember.Evented = Ember.Mixin.create({
|
|
9642
9743
|
*/
|
9643
9744
|
on: function(name, target, method) {
|
9644
9745
|
Ember.addListener(this, name, target, method);
|
9746
|
+
return this;
|
9645
9747
|
},
|
9646
9748
|
|
9647
9749
|
/**
|
@@ -9665,6 +9767,7 @@ Ember.Evented = Ember.Mixin.create({
|
|
9665
9767
|
}
|
9666
9768
|
|
9667
9769
|
Ember.addListener(this, name, target, method, true);
|
9770
|
+
return this;
|
9668
9771
|
},
|
9669
9772
|
|
9670
9773
|
/**
|
@@ -9708,6 +9811,7 @@ Ember.Evented = Ember.Mixin.create({
|
|
9708
9811
|
*/
|
9709
9812
|
off: function(name, target, method) {
|
9710
9813
|
Ember.removeListener(this, name, target, method);
|
9814
|
+
return this;
|
9711
9815
|
},
|
9712
9816
|
|
9713
9817
|
/**
|
@@ -9738,8 +9842,7 @@ RSVP.async = function(callback, binding) {
|
|
9738
9842
|
@submodule ember-runtime
|
9739
9843
|
*/
|
9740
9844
|
|
9741
|
-
var get = Ember.get
|
9742
|
-
slice = Array.prototype.slice;
|
9845
|
+
var get = Ember.get;
|
9743
9846
|
|
9744
9847
|
/**
|
9745
9848
|
@class Deferred
|
@@ -9815,7 +9918,6 @@ Ember.Container.set = Ember.set;
|
|
9815
9918
|
var set = Ember.set, get = Ember.get,
|
9816
9919
|
o_create = Ember.create,
|
9817
9920
|
o_defineProperty = Ember.platform.defineProperty,
|
9818
|
-
a_slice = Array.prototype.slice,
|
9819
9921
|
GUID_KEY = Ember.GUID_KEY,
|
9820
9922
|
guidFor = Ember.guidFor,
|
9821
9923
|
generateGuid = Ember.generateGuid,
|
@@ -9962,6 +10064,37 @@ CoreObject.PrototypeMixin = Mixin.create({
|
|
9962
10064
|
|
9963
10065
|
isInstance: true,
|
9964
10066
|
|
10067
|
+
/**
|
10068
|
+
An overridable method called when objects are instantiated. By default,
|
10069
|
+
does nothing unless it is overridden during class definition.
|
10070
|
+
|
10071
|
+
Example:
|
10072
|
+
|
10073
|
+
```javascript
|
10074
|
+
App.Person = Ember.Object.extend({
|
10075
|
+
init: function() {
|
10076
|
+
this._super();
|
10077
|
+
alert('Name is ' + this.get('name'));
|
10078
|
+
}
|
10079
|
+
});
|
10080
|
+
|
10081
|
+
var steve = App.Person.create({
|
10082
|
+
name: "Steve"
|
10083
|
+
});
|
10084
|
+
|
10085
|
+
// alerts 'Name is Steve'.
|
10086
|
+
```
|
10087
|
+
|
10088
|
+
NOTE: If you do override `init` for a framework class like `Ember.View` or
|
10089
|
+
`Ember.ArrayController`, be sure to call `this._super()` in your
|
10090
|
+
`init` declaration! If you don't, Ember may not have an opportunity to
|
10091
|
+
do important setup work, and you'll see strange behavior in your
|
10092
|
+
application.
|
10093
|
+
|
10094
|
+
```
|
10095
|
+
|
10096
|
+
@method init
|
10097
|
+
*/
|
9965
10098
|
init: function() {},
|
9966
10099
|
|
9967
10100
|
/**
|
@@ -10006,14 +10139,14 @@ CoreObject.PrototypeMixin = Mixin.create({
|
|
10006
10139
|
view.get('classNames'); // ['ember-view', 'bar', 'foo', 'baz']
|
10007
10140
|
```
|
10008
10141
|
Adding a single property that is not an array will just add it in the array:
|
10009
|
-
|
10142
|
+
|
10010
10143
|
```javascript
|
10011
10144
|
var view = App.FooBarView.create({
|
10012
10145
|
classNames: 'baz'
|
10013
10146
|
})
|
10014
10147
|
view.get('classNames'); // ['ember-view', 'bar', 'foo', 'baz']
|
10015
10148
|
```
|
10016
|
-
|
10149
|
+
|
10017
10150
|
Using the `concatenatedProperties` property, we can tell to Ember that mix
|
10018
10151
|
the content of the properties.
|
10019
10152
|
|
@@ -10112,7 +10245,7 @@ CoreObject.PrototypeMixin = Mixin.create({
|
|
10112
10245
|
}
|
10113
10246
|
});
|
10114
10247
|
teacher = App.Teacher.create()
|
10115
|
-
teacher.toString();
|
10248
|
+
teacher.toString(); //=> "<App.Teacher:ember1026:Tom Dale>"
|
10116
10249
|
|
10117
10250
|
@method toString
|
10118
10251
|
@return {String} string representation
|
@@ -10290,687 +10423,721 @@ Ember.CoreObject = CoreObject;
|
|
10290
10423
|
@submodule ember-runtime
|
10291
10424
|
*/
|
10292
10425
|
|
10293
|
-
var get = Ember.get, set = Ember.set, guidFor = Ember.guidFor, none = Ember.isNone;
|
10294
|
-
|
10295
10426
|
/**
|
10296
|
-
|
10427
|
+
`Ember.Object` is the main base class for all Ember objects. It is a subclass
|
10428
|
+
of `Ember.CoreObject` with the `Ember.Observable` mixin applied. For details,
|
10429
|
+
see the documentation for each of these.
|
10297
10430
|
|
10298
|
-
|
10299
|
-
|
10300
|
-
|
10301
|
-
|
10431
|
+
@class Object
|
10432
|
+
@namespace Ember
|
10433
|
+
@extends Ember.CoreObject
|
10434
|
+
@uses Ember.Observable
|
10435
|
+
*/
|
10436
|
+
Ember.Object = Ember.CoreObject.extend(Ember.Observable);
|
10437
|
+
Ember.Object.toString = function() { return "Ember.Object"; };
|
10302
10438
|
|
10303
|
-
|
10304
|
-
on any enumerable object including both Sets and Arrays.
|
10439
|
+
})();
|
10305
10440
|
|
10306
|
-
## Creating a Set
|
10307
10441
|
|
10308
|
-
You can create a set like you would most objects using
|
10309
|
-
`new Ember.Set()`. Most new sets you create will be empty, but you can
|
10310
|
-
also initialize the set with some content by passing an array or other
|
10311
|
-
enumerable of objects to the constructor.
|
10312
10442
|
|
10313
|
-
|
10314
|
-
|
10443
|
+
(function() {
|
10444
|
+
/**
|
10445
|
+
@module ember
|
10446
|
+
@submodule ember-runtime
|
10447
|
+
*/
|
10315
10448
|
|
10316
|
-
|
10317
|
-
// creates a new empty set
|
10318
|
-
var foundNames = new Ember.Set();
|
10449
|
+
var get = Ember.get, indexOf = Ember.ArrayPolyfills.indexOf;
|
10319
10450
|
|
10320
|
-
|
10321
|
-
|
10451
|
+
/**
|
10452
|
+
A Namespace is an object usually used to contain other objects or methods
|
10453
|
+
such as an application or framework. Create a namespace anytime you want
|
10454
|
+
to define one of these new containers.
|
10322
10455
|
|
10323
|
-
|
10324
|
-
var namesCopy = new Ember.Set(names);
|
10456
|
+
# Example Usage
|
10325
10457
|
|
10326
|
-
|
10327
|
-
|
10458
|
+
```javascript
|
10459
|
+
MyFramework = Ember.Namespace.create({
|
10460
|
+
VERSION: '1.0.0'
|
10461
|
+
});
|
10328
10462
|
```
|
10329
10463
|
|
10330
|
-
|
10331
|
-
|
10332
|
-
|
10333
|
-
|
10334
|
-
|
10464
|
+
@class Namespace
|
10465
|
+
@namespace Ember
|
10466
|
+
@extends Ember.Object
|
10467
|
+
*/
|
10468
|
+
var Namespace = Ember.Namespace = Ember.Object.extend({
|
10469
|
+
isNamespace: true,
|
10335
10470
|
|
10336
|
-
|
10337
|
-
|
10338
|
-
|
10339
|
-
|
10340
|
-
you add the object to the set again.
|
10471
|
+
init: function() {
|
10472
|
+
Ember.Namespace.NAMESPACES.push(this);
|
10473
|
+
Ember.Namespace.PROCESSED = false;
|
10474
|
+
},
|
10341
10475
|
|
10342
|
-
|
10343
|
-
|
10476
|
+
toString: function() {
|
10477
|
+
var name = get(this, 'name');
|
10478
|
+
if (name) { return name; }
|
10344
10479
|
|
10345
|
-
|
10346
|
-
|
10347
|
-
|
10348
|
-
queue when you don't care which order the jobs are executed in.
|
10480
|
+
findNamespaces();
|
10481
|
+
return this[Ember.GUID_KEY+'_name'];
|
10482
|
+
},
|
10349
10483
|
|
10350
|
-
|
10484
|
+
nameClasses: function() {
|
10485
|
+
processNamespace([this.toString()], this, {});
|
10486
|
+
},
|
10351
10487
|
|
10352
|
-
|
10353
|
-
|
10488
|
+
destroy: function() {
|
10489
|
+
var namespaces = Ember.Namespace.NAMESPACES;
|
10490
|
+
Ember.lookup[this.toString()] = undefined;
|
10491
|
+
namespaces.splice(indexOf.call(namespaces, this), 1);
|
10492
|
+
this._super();
|
10493
|
+
}
|
10494
|
+
});
|
10354
10495
|
|
10355
|
-
|
10496
|
+
Namespace.reopenClass({
|
10497
|
+
NAMESPACES: [Ember],
|
10498
|
+
NAMESPACES_BY_ID: {},
|
10499
|
+
PROCESSED: false,
|
10500
|
+
processAll: processAllNamespaces,
|
10501
|
+
byName: function(name) {
|
10502
|
+
if (!Ember.BOOTED) {
|
10503
|
+
processAllNamespaces();
|
10504
|
+
}
|
10356
10505
|
|
10357
|
-
|
10358
|
-
|
10359
|
-
|
10360
|
-
removed from the set. See `Ember.Enumerable` for more information on
|
10361
|
-
enumerables.
|
10506
|
+
return NAMESPACES_BY_ID[name];
|
10507
|
+
}
|
10508
|
+
});
|
10362
10509
|
|
10363
|
-
|
10364
|
-
it is very inefficient to re-filter all of the items each time the set
|
10365
|
-
changes. It would be better if you could just adjust the filtered set based
|
10366
|
-
on what was changed on the original set. The same issue applies to merging
|
10367
|
-
sets, as well.
|
10510
|
+
var NAMESPACES_BY_ID = Namespace.NAMESPACES_BY_ID;
|
10368
10511
|
|
10369
|
-
|
10512
|
+
var hasOwnProp = ({}).hasOwnProperty,
|
10513
|
+
guidFor = Ember.guidFor;
|
10370
10514
|
|
10371
|
-
|
10372
|
-
|
10373
|
-
The most useful ones will be `Ember.Enumerable` and
|
10374
|
-
`Ember.MutableEnumerable` which implement most of the common iterator
|
10375
|
-
methods you are used to on Array.
|
10515
|
+
function processNamespace(paths, root, seen) {
|
10516
|
+
var idx = paths.length;
|
10376
10517
|
|
10377
|
-
|
10378
|
-
APIs on `Ember.Set` as well. Once a set is frozen it can no longer be
|
10379
|
-
modified. The benefit of this is that when you call `frozenCopy()` on it,
|
10380
|
-
Ember will avoid making copies of the set. This allows you to write
|
10381
|
-
code that can know with certainty when the underlying set data will or
|
10382
|
-
will not be modified.
|
10518
|
+
NAMESPACES_BY_ID[paths.join('.')] = root;
|
10383
10519
|
|
10384
|
-
|
10385
|
-
|
10386
|
-
|
10387
|
-
|
10388
|
-
@uses Ember.Copyable
|
10389
|
-
@uses Ember.Freezable
|
10390
|
-
@since Ember 0.9
|
10391
|
-
*/
|
10392
|
-
Ember.Set = Ember.CoreObject.extend(Ember.MutableEnumerable, Ember.Copyable, Ember.Freezable,
|
10393
|
-
/** @scope Ember.Set.prototype */ {
|
10520
|
+
// Loop over all of the keys in the namespace, looking for classes
|
10521
|
+
for(var key in root) {
|
10522
|
+
if (!hasOwnProp.call(root, key)) { continue; }
|
10523
|
+
var obj = root[key];
|
10394
10524
|
|
10395
|
-
|
10396
|
-
|
10397
|
-
|
10525
|
+
// If we are processing the `Ember` namespace, for example, the
|
10526
|
+
// `paths` will start with `["Ember"]`. Every iteration through
|
10527
|
+
// the loop will update the **second** element of this list with
|
10528
|
+
// the key, so processing `Ember.View` will make the Array
|
10529
|
+
// `['Ember', 'View']`.
|
10530
|
+
paths[idx] = key;
|
10398
10531
|
|
10399
|
-
|
10400
|
-
|
10532
|
+
// If we have found an unprocessed class
|
10533
|
+
if (obj && obj.toString === classToString) {
|
10534
|
+
// Replace the class' `toString` with the dot-separated path
|
10535
|
+
// and set its `NAME_KEY`
|
10536
|
+
obj.toString = makeToString(paths.join('.'));
|
10537
|
+
obj[NAME_KEY] = paths.join('.');
|
10401
10538
|
|
10402
|
-
|
10403
|
-
|
10404
|
-
|
10405
|
-
|
10406
|
-
|
10539
|
+
// Support nested namespaces
|
10540
|
+
} else if (obj && obj.isNamespace) {
|
10541
|
+
// Skip aliased namespaces
|
10542
|
+
if (seen[guidFor(obj)]) { continue; }
|
10543
|
+
seen[guidFor(obj)] = true;
|
10407
10544
|
|
10408
|
-
|
10409
|
-
|
10410
|
-
|
10545
|
+
// Process the child namespace
|
10546
|
+
processNamespace(paths, obj, seen);
|
10547
|
+
}
|
10548
|
+
}
|
10411
10549
|
|
10412
|
-
|
10413
|
-
|
10414
|
-
colors.length; // 3
|
10415
|
-
colors.clear();
|
10416
|
-
colors.length; // 0
|
10417
|
-
```
|
10550
|
+
paths.length = idx; // cut out last item
|
10551
|
+
}
|
10418
10552
|
|
10419
|
-
|
10420
|
-
|
10421
|
-
*/
|
10422
|
-
clear: function() {
|
10423
|
-
if (this.isFrozen) { throw new Error(Ember.FROZEN_ERROR); }
|
10553
|
+
function findNamespaces() {
|
10554
|
+
var Namespace = Ember.Namespace, lookup = Ember.lookup, obj, isNamespace;
|
10424
10555
|
|
10425
|
-
|
10426
|
-
if (len === 0) { return this; }
|
10556
|
+
if (Namespace.PROCESSED) { return; }
|
10427
10557
|
|
10428
|
-
|
10558
|
+
for (var prop in lookup) {
|
10559
|
+
// These don't raise exceptions but can cause warnings
|
10560
|
+
if (prop === "parent" || prop === "top" || prop === "frameElement") { continue; }
|
10429
10561
|
|
10430
|
-
|
10431
|
-
|
10432
|
-
|
10562
|
+
// get(window.globalStorage, 'isNamespace') would try to read the storage for domain isNamespace and cause exception in Firefox.
|
10563
|
+
// globalStorage is a storage obsoleted by the WhatWG storage specification. See https://developer.mozilla.org/en/DOM/Storage#globalStorage
|
10564
|
+
if (prop === "globalStorage" && lookup.StorageList && lookup.globalStorage instanceof lookup.StorageList) { continue; }
|
10565
|
+
// Unfortunately, some versions of IE don't support window.hasOwnProperty
|
10566
|
+
if (lookup.hasOwnProperty && !lookup.hasOwnProperty(prop)) { continue; }
|
10433
10567
|
|
10434
|
-
|
10435
|
-
|
10436
|
-
|
10437
|
-
|
10568
|
+
// At times we are not allowed to access certain properties for security reasons.
|
10569
|
+
// There are also times where even if we can access them, we are not allowed to access their properties.
|
10570
|
+
try {
|
10571
|
+
obj = Ember.lookup[prop];
|
10572
|
+
isNamespace = obj && obj.isNamespace;
|
10573
|
+
} catch (e) {
|
10574
|
+
continue;
|
10438
10575
|
}
|
10439
10576
|
|
10440
|
-
|
10577
|
+
if (isNamespace) {
|
10441
10578
|
|
10442
|
-
|
10443
|
-
|
10444
|
-
|
10579
|
+
obj[NAME_KEY] = prop;
|
10580
|
+
}
|
10581
|
+
}
|
10582
|
+
}
|
10445
10583
|
|
10446
|
-
|
10447
|
-
},
|
10584
|
+
var NAME_KEY = Ember.NAME_KEY = Ember.GUID_KEY + '_name';
|
10448
10585
|
|
10449
|
-
|
10450
|
-
|
10451
|
-
|
10586
|
+
function superClassString(mixin) {
|
10587
|
+
var superclass = mixin.superclass;
|
10588
|
+
if (superclass) {
|
10589
|
+
if (superclass[NAME_KEY]) { return superclass[NAME_KEY]; }
|
10590
|
+
else { return superClassString(superclass); }
|
10591
|
+
} else {
|
10592
|
+
return;
|
10593
|
+
}
|
10594
|
+
}
|
10452
10595
|
|
10453
|
-
|
10454
|
-
|
10455
|
-
|
10596
|
+
function classToString() {
|
10597
|
+
if (!Ember.BOOTED && !this[NAME_KEY]) {
|
10598
|
+
processAllNamespaces();
|
10599
|
+
}
|
10456
10600
|
|
10457
|
-
|
10458
|
-
same_colors.isEqual(["purple", "brown"]); // false
|
10459
|
-
```
|
10601
|
+
var ret;
|
10460
10602
|
|
10461
|
-
|
10462
|
-
|
10463
|
-
|
10464
|
-
|
10465
|
-
|
10466
|
-
|
10467
|
-
|
10603
|
+
if (this[NAME_KEY]) {
|
10604
|
+
ret = this[NAME_KEY];
|
10605
|
+
} else {
|
10606
|
+
var str = superClassString(this);
|
10607
|
+
if (str) {
|
10608
|
+
ret = "(subclass of " + str + ")";
|
10609
|
+
} else {
|
10610
|
+
ret = "(unknown mixin)";
|
10611
|
+
}
|
10612
|
+
this.toString = makeToString(ret);
|
10613
|
+
}
|
10468
10614
|
|
10469
|
-
|
10470
|
-
|
10615
|
+
return ret;
|
10616
|
+
}
|
10471
10617
|
|
10472
|
-
|
10473
|
-
|
10474
|
-
|
10618
|
+
function processAllNamespaces() {
|
10619
|
+
var unprocessedNamespaces = !Namespace.PROCESSED,
|
10620
|
+
unprocessedMixins = Ember.anyUnprocessedMixins;
|
10475
10621
|
|
10476
|
-
|
10477
|
-
|
10622
|
+
if (unprocessedNamespaces) {
|
10623
|
+
findNamespaces();
|
10624
|
+
Namespace.PROCESSED = true;
|
10625
|
+
}
|
10478
10626
|
|
10479
|
-
|
10480
|
-
|
10481
|
-
|
10482
|
-
|
10627
|
+
if (unprocessedNamespaces || unprocessedMixins) {
|
10628
|
+
var namespaces = Namespace.NAMESPACES, namespace;
|
10629
|
+
for (var i=0, l=namespaces.length; i<l; i++) {
|
10630
|
+
namespace = namespaces[i];
|
10631
|
+
processNamespace([namespace.toString()], namespace, {});
|
10632
|
+
}
|
10483
10633
|
|
10484
|
-
|
10634
|
+
Ember.anyUnprocessedMixins = false;
|
10635
|
+
}
|
10636
|
+
}
|
10485
10637
|
|
10486
|
-
|
10487
|
-
|
10488
|
-
|
10489
|
-
colors.add("blue"); // ["blue"]
|
10490
|
-
colors.add("red"); // ["blue", "red"]
|
10491
|
-
colors.add(null); // ["blue", "red"]
|
10492
|
-
colors.add(undefined); // ["blue", "red"]
|
10493
|
-
```
|
10638
|
+
function makeToString(ret) {
|
10639
|
+
return function() { return ret; };
|
10640
|
+
}
|
10494
10641
|
|
10495
|
-
|
10496
|
-
@param {Object} obj The object to add.
|
10497
|
-
@return {Ember.Set} The set itself.
|
10498
|
-
*/
|
10499
|
-
add: Ember.aliasMethod('addObject'),
|
10642
|
+
Ember.Mixin.prototype.toString = classToString;
|
10500
10643
|
|
10501
|
-
|
10502
|
-
Removes the object from the set if it is found. If you pass a `null` value
|
10503
|
-
or an object that is already not in the set, this method will have no
|
10504
|
-
effect. This is an alias for `Ember.MutableEnumerable.removeObject()`.
|
10644
|
+
})();
|
10505
10645
|
|
10506
|
-
```javascript
|
10507
|
-
var colors = new Ember.Set(["red", "green", "blue"]);
|
10508
|
-
colors.remove("red"); // ["blue", "green"]
|
10509
|
-
colors.remove("purple"); // ["blue", "green"]
|
10510
|
-
colors.remove(null); // ["blue", "green"]
|
10511
|
-
```
|
10512
10646
|
|
10513
|
-
@method remove
|
10514
|
-
@param {Object} obj The object to remove
|
10515
|
-
@return {Ember.Set} The set itself.
|
10516
|
-
*/
|
10517
|
-
remove: Ember.aliasMethod('removeObject'),
|
10518
10647
|
|
10519
|
-
|
10520
|
-
|
10648
|
+
(function() {
|
10649
|
+
Ember.Application = Ember.Namespace.extend();
|
10521
10650
|
|
10522
|
-
|
10523
|
-
var colors = new Ember.Set(["green", "blue"]);
|
10524
|
-
colors.pop(); // "blue"
|
10525
|
-
colors.pop(); // "green"
|
10526
|
-
colors.pop(); // null
|
10527
|
-
```
|
10651
|
+
})();
|
10528
10652
|
|
10529
|
-
@method pop
|
10530
|
-
@return {Object} The removed object from the set or null.
|
10531
|
-
*/
|
10532
|
-
pop: function() {
|
10533
|
-
if (get(this, 'isFrozen')) throw new Error(Ember.FROZEN_ERROR);
|
10534
|
-
var obj = this.length > 0 ? this[this.length-1] : null;
|
10535
|
-
this.remove(obj);
|
10536
|
-
return obj;
|
10537
|
-
},
|
10538
10653
|
|
10539
|
-
/**
|
10540
|
-
Inserts the given object on to the end of the set. It returns
|
10541
|
-
the set itself.
|
10542
10654
|
|
10543
|
-
|
10655
|
+
(function() {
|
10656
|
+
/**
|
10657
|
+
@module ember
|
10658
|
+
@submodule ember-runtime
|
10659
|
+
*/
|
10544
10660
|
|
10545
|
-
|
10546
|
-
|
10547
|
-
colors.push("red"); // ["red"]
|
10548
|
-
colors.push("green"); // ["red", "green"]
|
10549
|
-
colors.push("blue"); // ["red", "green", "blue"]
|
10550
|
-
```
|
10661
|
+
var OUT_OF_RANGE_EXCEPTION = "Index out of range";
|
10662
|
+
var EMPTY = [];
|
10551
10663
|
|
10552
|
-
|
10553
|
-
@return {Ember.Set} The set itself.
|
10554
|
-
*/
|
10555
|
-
push: Ember.aliasMethod('addObject'),
|
10664
|
+
var get = Ember.get, set = Ember.set;
|
10556
10665
|
|
10557
|
-
|
10558
|
-
|
10666
|
+
/**
|
10667
|
+
An ArrayProxy wraps any other object that implements `Ember.Array` and/or
|
10668
|
+
`Ember.MutableArray,` forwarding all requests. This makes it very useful for
|
10669
|
+
a number of binding use cases or other cases where being able to swap
|
10670
|
+
out the underlying array is useful.
|
10559
10671
|
|
10560
|
-
|
10672
|
+
A simple example of usage:
|
10561
10673
|
|
10562
|
-
|
10563
|
-
|
10564
|
-
|
10565
|
-
colors.shift(); // "green"
|
10566
|
-
colors.shift(); // null
|
10567
|
-
```
|
10674
|
+
```javascript
|
10675
|
+
var pets = ['dog', 'cat', 'fish'];
|
10676
|
+
var ap = Ember.ArrayProxy.create({ content: Ember.A(pets) });
|
10568
10677
|
|
10569
|
-
|
10570
|
-
|
10571
|
-
|
10572
|
-
|
10678
|
+
ap.get('firstObject'); // 'dog'
|
10679
|
+
ap.set('content', ['amoeba', 'paramecium']);
|
10680
|
+
ap.get('firstObject'); // 'amoeba'
|
10681
|
+
```
|
10573
10682
|
|
10574
|
-
|
10575
|
-
|
10576
|
-
|
10683
|
+
This class can also be useful as a layer to transform the contents of
|
10684
|
+
an array, as they are accessed. This can be done by overriding
|
10685
|
+
`objectAtContent`:
|
10577
10686
|
|
10578
|
-
|
10687
|
+
```javascript
|
10688
|
+
var pets = ['dog', 'cat', 'fish'];
|
10689
|
+
var ap = Ember.ArrayProxy.create({
|
10690
|
+
content: Ember.A(pets),
|
10691
|
+
objectAtContent: function(idx) {
|
10692
|
+
return this.get('content').objectAt(idx).toUpperCase();
|
10693
|
+
}
|
10694
|
+
});
|
10579
10695
|
|
10580
|
-
|
10581
|
-
|
10582
|
-
colors.unshift("red"); // ["red"]
|
10583
|
-
colors.unshift("green"); // ["red", "green"]
|
10584
|
-
colors.unshift("blue"); // ["red", "green", "blue"]
|
10585
|
-
```
|
10696
|
+
ap.get('firstObject'); // . 'DOG'
|
10697
|
+
```
|
10586
10698
|
|
10587
|
-
|
10588
|
-
|
10589
|
-
|
10590
|
-
|
10699
|
+
@class ArrayProxy
|
10700
|
+
@namespace Ember
|
10701
|
+
@extends Ember.Object
|
10702
|
+
@uses Ember.MutableArray
|
10703
|
+
*/
|
10704
|
+
Ember.ArrayProxy = Ember.Object.extend(Ember.MutableArray,
|
10705
|
+
/** @scope Ember.ArrayProxy.prototype */ {
|
10591
10706
|
|
10592
10707
|
/**
|
10593
|
-
|
10708
|
+
The content array. Must be an object that implements `Ember.Array` and/or
|
10709
|
+
`Ember.MutableArray.`
|
10594
10710
|
|
10595
|
-
|
10711
|
+
@property content
|
10712
|
+
@type Ember.Array
|
10713
|
+
*/
|
10714
|
+
content: null,
|
10596
10715
|
|
10597
|
-
|
10598
|
-
|
10599
|
-
|
10600
|
-
|
10716
|
+
/**
|
10717
|
+
The array that the proxy pretends to be. In the default `ArrayProxy`
|
10718
|
+
implementation, this and `content` are the same. Subclasses of `ArrayProxy`
|
10719
|
+
can override this property to provide things like sorting and filtering.
|
10601
10720
|
|
10602
|
-
|
10603
|
-
@param {Ember.Enumerable} objects the objects to add.
|
10604
|
-
@return {Ember.Set} The set itself.
|
10721
|
+
@property arrangedContent
|
10605
10722
|
*/
|
10606
|
-
|
10723
|
+
arrangedContent: Ember.computed.alias('content'),
|
10607
10724
|
|
10608
10725
|
/**
|
10609
|
-
|
10610
|
-
|
10611
|
-
|
10726
|
+
Should actually retrieve the object at the specified index from the
|
10727
|
+
content. You can override this method in subclasses to transform the
|
10728
|
+
content item to something new.
|
10612
10729
|
|
10613
|
-
|
10614
|
-
var colors = new Ember.Set(["red", "green", "blue"]);
|
10615
|
-
colors.removeEach(["red", "blue"]); // ["green"]
|
10616
|
-
```
|
10730
|
+
This method will only be called if content is non-`null`.
|
10617
10731
|
|
10618
|
-
@method
|
10619
|
-
@param {
|
10620
|
-
@return {
|
10732
|
+
@method objectAtContent
|
10733
|
+
@param {Number} idx The index to retrieve.
|
10734
|
+
@return {Object} the value or undefined if none found
|
10621
10735
|
*/
|
10622
|
-
|
10736
|
+
objectAtContent: function(idx) {
|
10737
|
+
return get(this, 'arrangedContent').objectAt(idx);
|
10738
|
+
},
|
10623
10739
|
|
10624
|
-
|
10625
|
-
|
10626
|
-
|
10740
|
+
/**
|
10741
|
+
Should actually replace the specified objects on the content array.
|
10742
|
+
You can override this method in subclasses to transform the content item
|
10743
|
+
into something new.
|
10627
10744
|
|
10628
|
-
|
10629
|
-
this._super();
|
10630
|
-
if (items) this.addObjects(items);
|
10631
|
-
},
|
10745
|
+
This method will only be called if content is non-`null`.
|
10632
10746
|
|
10633
|
-
|
10634
|
-
|
10635
|
-
|
10747
|
+
@method replaceContent
|
10748
|
+
@param {Number} idx The starting index
|
10749
|
+
@param {Number} amt The number of items to remove from the content.
|
10750
|
+
@param {Array} objects Optional array of objects to insert or null if no
|
10751
|
+
objects.
|
10752
|
+
@return {void}
|
10753
|
+
*/
|
10754
|
+
replaceContent: function(idx, amt, objects) {
|
10755
|
+
get(this, 'content').replace(idx, amt, objects);
|
10636
10756
|
},
|
10637
10757
|
|
10638
|
-
|
10639
|
-
|
10640
|
-
return this.length > 0 ? this[0] : undefined;
|
10641
|
-
}),
|
10758
|
+
/**
|
10759
|
+
@private
|
10642
10760
|
|
10643
|
-
|
10644
|
-
|
10645
|
-
return this.length > 0 ? this[this.length-1] : undefined;
|
10646
|
-
}),
|
10761
|
+
Invoked when the content property is about to change. Notifies observers that the
|
10762
|
+
entire array content will change.
|
10647
10763
|
|
10648
|
-
|
10649
|
-
|
10650
|
-
|
10651
|
-
|
10764
|
+
@method _contentWillChange
|
10765
|
+
*/
|
10766
|
+
_contentWillChange: Ember.beforeObserver(function() {
|
10767
|
+
this._teardownContent();
|
10768
|
+
}, 'content'),
|
10652
10769
|
|
10653
|
-
|
10654
|
-
|
10655
|
-
len = get(this, 'length'),
|
10656
|
-
added ;
|
10770
|
+
_teardownContent: function() {
|
10771
|
+
var content = get(this, 'content');
|
10657
10772
|
|
10658
|
-
if (
|
10773
|
+
if (content) {
|
10774
|
+
content.removeArrayObserver(this, {
|
10775
|
+
willChange: 'contentArrayWillChange',
|
10776
|
+
didChange: 'contentArrayDidChange'
|
10777
|
+
});
|
10778
|
+
}
|
10779
|
+
},
|
10659
10780
|
|
10660
|
-
|
10781
|
+
contentArrayWillChange: Ember.K,
|
10782
|
+
contentArrayDidChange: Ember.K,
|
10661
10783
|
|
10662
|
-
|
10663
|
-
|
10784
|
+
/**
|
10785
|
+
@private
|
10664
10786
|
|
10665
|
-
|
10666
|
-
|
10667
|
-
this[len] = obj;
|
10668
|
-
set(this, 'length', len+1);
|
10787
|
+
Invoked when the content property changes. Notifies observers that the
|
10788
|
+
entire array content has changed.
|
10669
10789
|
|
10670
|
-
|
10671
|
-
|
10790
|
+
@method _contentDidChange
|
10791
|
+
*/
|
10792
|
+
_contentDidChange: Ember.observer(function() {
|
10793
|
+
var content = get(this, 'content');
|
10672
10794
|
|
10673
|
-
|
10795
|
+
|
10796
|
+
this._setupContent();
|
10797
|
+
}, 'content'),
|
10798
|
+
|
10799
|
+
_setupContent: function() {
|
10800
|
+
var content = get(this, 'content');
|
10801
|
+
|
10802
|
+
if (content) {
|
10803
|
+
content.addArrayObserver(this, {
|
10804
|
+
willChange: 'contentArrayWillChange',
|
10805
|
+
didChange: 'contentArrayDidChange'
|
10806
|
+
});
|
10807
|
+
}
|
10674
10808
|
},
|
10675
10809
|
|
10676
|
-
|
10677
|
-
|
10678
|
-
|
10679
|
-
if (none(obj)) return this; // nothing to do
|
10810
|
+
_arrangedContentWillChange: Ember.beforeObserver(function() {
|
10811
|
+
var arrangedContent = get(this, 'arrangedContent'),
|
10812
|
+
len = arrangedContent ? get(arrangedContent, 'length') : 0;
|
10680
10813
|
|
10681
|
-
|
10682
|
-
|
10683
|
-
len = get(this, 'length'),
|
10684
|
-
isFirst = idx === 0,
|
10685
|
-
isLast = idx === len-1,
|
10686
|
-
last, removed;
|
10814
|
+
this.arrangedContentArrayWillChange(this, 0, len, undefined);
|
10815
|
+
this.arrangedContentWillChange(this);
|
10687
10816
|
|
10817
|
+
this._teardownArrangedContent(arrangedContent);
|
10818
|
+
}, 'arrangedContent'),
|
10688
10819
|
|
10689
|
-
|
10690
|
-
|
10820
|
+
_arrangedContentDidChange: Ember.observer(function() {
|
10821
|
+
var arrangedContent = get(this, 'arrangedContent'),
|
10822
|
+
len = arrangedContent ? get(arrangedContent, 'length') : 0;
|
10691
10823
|
|
10692
|
-
this.enumerableContentWillChange(removed, null);
|
10693
|
-
if (isFirst) { Ember.propertyWillChange(this, 'firstObject'); }
|
10694
|
-
if (isLast) { Ember.propertyWillChange(this, 'lastObject'); }
|
10695
10824
|
|
10696
|
-
|
10697
|
-
if (idx < len-1) {
|
10698
|
-
last = this[len-1];
|
10699
|
-
this[idx] = last;
|
10700
|
-
this[guidFor(last)] = idx;
|
10701
|
-
}
|
10825
|
+
this._setupArrangedContent();
|
10702
10826
|
|
10703
|
-
|
10704
|
-
|
10705
|
-
|
10827
|
+
this.arrangedContentDidChange(this);
|
10828
|
+
this.arrangedContentArrayDidChange(this, 0, undefined, len);
|
10829
|
+
}, 'arrangedContent'),
|
10706
10830
|
|
10707
|
-
|
10708
|
-
|
10709
|
-
this.enumerableContentDidChange(removed, null);
|
10710
|
-
}
|
10831
|
+
_setupArrangedContent: function() {
|
10832
|
+
var arrangedContent = get(this, 'arrangedContent');
|
10711
10833
|
|
10712
|
-
|
10834
|
+
if (arrangedContent) {
|
10835
|
+
arrangedContent.addArrayObserver(this, {
|
10836
|
+
willChange: 'arrangedContentArrayWillChange',
|
10837
|
+
didChange: 'arrangedContentArrayDidChange'
|
10838
|
+
});
|
10839
|
+
}
|
10713
10840
|
},
|
10714
10841
|
|
10715
|
-
|
10716
|
-
|
10717
|
-
return this[guidFor(obj)]>=0;
|
10718
|
-
},
|
10842
|
+
_teardownArrangedContent: function() {
|
10843
|
+
var arrangedContent = get(this, 'arrangedContent');
|
10719
10844
|
|
10720
|
-
|
10721
|
-
|
10722
|
-
|
10723
|
-
|
10724
|
-
|
10725
|
-
ret[guidFor(this[loc])] = loc;
|
10845
|
+
if (arrangedContent) {
|
10846
|
+
arrangedContent.removeArrayObserver(this, {
|
10847
|
+
willChange: 'arrangedContentArrayWillChange',
|
10848
|
+
didChange: 'arrangedContentArrayDidChange'
|
10849
|
+
});
|
10726
10850
|
}
|
10727
|
-
return ret;
|
10728
10851
|
},
|
10729
10852
|
|
10730
|
-
|
10731
|
-
|
10732
|
-
for(idx = 0; idx < len; idx++) {
|
10733
|
-
array[idx] = this[idx];
|
10734
|
-
}
|
10735
|
-
return "Ember.Set<%@>".fmt(array.join(','));
|
10736
|
-
}
|
10853
|
+
arrangedContentWillChange: Ember.K,
|
10854
|
+
arrangedContentDidChange: Ember.K,
|
10737
10855
|
|
10738
|
-
|
10856
|
+
objectAt: function(idx) {
|
10857
|
+
return get(this, 'content') && this.objectAtContent(idx);
|
10858
|
+
},
|
10739
10859
|
|
10740
|
-
|
10860
|
+
length: Ember.computed(function() {
|
10861
|
+
var arrangedContent = get(this, 'arrangedContent');
|
10862
|
+
return arrangedContent ? get(arrangedContent, 'length') : 0;
|
10863
|
+
// No dependencies since Enumerable notifies length of change
|
10864
|
+
}),
|
10741
10865
|
|
10866
|
+
_replace: function(idx, amt, objects) {
|
10867
|
+
var content = get(this, 'content');
|
10742
10868
|
|
10869
|
+
if (content) this.replaceContent(idx, amt, objects);
|
10870
|
+
return this;
|
10871
|
+
},
|
10743
10872
|
|
10744
|
-
|
10745
|
-
|
10746
|
-
|
10747
|
-
|
10748
|
-
|
10873
|
+
replace: function() {
|
10874
|
+
if (get(this, 'arrangedContent') === get(this, 'content')) {
|
10875
|
+
this._replace.apply(this, arguments);
|
10876
|
+
} else {
|
10877
|
+
throw new Ember.Error("Using replace on an arranged ArrayProxy is not allowed.");
|
10878
|
+
}
|
10879
|
+
},
|
10749
10880
|
|
10750
|
-
|
10751
|
-
|
10752
|
-
|
10753
|
-
|
10881
|
+
_insertAt: function(idx, object) {
|
10882
|
+
if (idx > get(this, 'content.length')) throw new Error(OUT_OF_RANGE_EXCEPTION);
|
10883
|
+
this._replace(idx, 0, [object]);
|
10884
|
+
return this;
|
10885
|
+
},
|
10754
10886
|
|
10755
|
-
|
10756
|
-
|
10757
|
-
|
10758
|
-
|
10759
|
-
|
10760
|
-
|
10761
|
-
|
10887
|
+
insertAt: function(idx, object) {
|
10888
|
+
if (get(this, 'arrangedContent') === get(this, 'content')) {
|
10889
|
+
return this._insertAt(idx, object);
|
10890
|
+
} else {
|
10891
|
+
throw new Ember.Error("Using insertAt on an arranged ArrayProxy is not allowed.");
|
10892
|
+
}
|
10893
|
+
},
|
10762
10894
|
|
10763
|
-
|
10895
|
+
removeAt: function(start, len) {
|
10896
|
+
if ('number' === typeof start) {
|
10897
|
+
var content = get(this, 'content'),
|
10898
|
+
arrangedContent = get(this, 'arrangedContent'),
|
10899
|
+
indices = [], i;
|
10764
10900
|
|
10901
|
+
if ((start < 0) || (start >= get(this, 'length'))) {
|
10902
|
+
throw new Error(OUT_OF_RANGE_EXCEPTION);
|
10903
|
+
}
|
10765
10904
|
|
10905
|
+
if (len === undefined) len = 1;
|
10766
10906
|
|
10767
|
-
|
10768
|
-
|
10769
|
-
|
10770
|
-
|
10771
|
-
|
10907
|
+
// Get a list of indices in original content to remove
|
10908
|
+
for (i=start; i<start+len; i++) {
|
10909
|
+
// Use arrangedContent here so we avoid confusion with objects transformed by objectAtContent
|
10910
|
+
indices.push(content.indexOf(arrangedContent.objectAt(i)));
|
10911
|
+
}
|
10772
10912
|
|
10773
|
-
|
10913
|
+
// Replace in reverse order since indices will change
|
10914
|
+
indices.sort(function(a,b) { return b - a; });
|
10774
10915
|
|
10775
|
-
|
10776
|
-
|
10777
|
-
|
10778
|
-
|
10916
|
+
Ember.beginPropertyChanges();
|
10917
|
+
for (i=0; i<indices.length; i++) {
|
10918
|
+
this._replace(indices[i], 1, EMPTY);
|
10919
|
+
}
|
10920
|
+
Ember.endPropertyChanges();
|
10921
|
+
}
|
10779
10922
|
|
10780
|
-
|
10923
|
+
return this ;
|
10924
|
+
},
|
10781
10925
|
|
10782
|
-
|
10783
|
-
|
10784
|
-
|
10785
|
-
}
|
10786
|
-
```
|
10926
|
+
pushObject: function(obj) {
|
10927
|
+
this._insertAt(get(this, 'content.length'), obj) ;
|
10928
|
+
return obj ;
|
10929
|
+
},
|
10787
10930
|
|
10788
|
-
|
10789
|
-
|
10790
|
-
|
10791
|
-
|
10792
|
-
var Namespace = Ember.Namespace = Ember.Object.extend({
|
10793
|
-
isNamespace: true,
|
10931
|
+
pushObjects: function(objects) {
|
10932
|
+
this._replace(get(this, 'length'), 0, objects);
|
10933
|
+
return this;
|
10934
|
+
},
|
10794
10935
|
|
10795
|
-
|
10796
|
-
|
10797
|
-
|
10936
|
+
setObjects: function(objects) {
|
10937
|
+
if (objects.length === 0) return this.clear();
|
10938
|
+
|
10939
|
+
var len = get(this, 'length');
|
10940
|
+
this._replace(0, len, objects);
|
10941
|
+
return this;
|
10798
10942
|
},
|
10799
10943
|
|
10800
|
-
|
10801
|
-
|
10802
|
-
|
10944
|
+
unshiftObject: function(obj) {
|
10945
|
+
this._insertAt(0, obj) ;
|
10946
|
+
return obj ;
|
10947
|
+
},
|
10803
10948
|
|
10804
|
-
|
10805
|
-
|
10949
|
+
unshiftObjects: function(objects) {
|
10950
|
+
this._replace(0, 0, objects);
|
10951
|
+
return this;
|
10806
10952
|
},
|
10807
10953
|
|
10808
|
-
|
10809
|
-
|
10954
|
+
slice: function() {
|
10955
|
+
var arr = this.toArray();
|
10956
|
+
return arr.slice.apply(arr, arguments);
|
10810
10957
|
},
|
10811
10958
|
|
10812
|
-
|
10813
|
-
|
10814
|
-
|
10815
|
-
|
10959
|
+
arrangedContentArrayWillChange: function(item, idx, removedCnt, addedCnt) {
|
10960
|
+
this.arrayContentWillChange(idx, removedCnt, addedCnt);
|
10961
|
+
},
|
10962
|
+
|
10963
|
+
arrangedContentArrayDidChange: function(item, idx, removedCnt, addedCnt) {
|
10964
|
+
this.arrayContentDidChange(idx, removedCnt, addedCnt);
|
10965
|
+
},
|
10966
|
+
|
10967
|
+
init: function() {
|
10816
10968
|
this._super();
|
10969
|
+
this._setupContent();
|
10970
|
+
this._setupArrangedContent();
|
10971
|
+
},
|
10972
|
+
|
10973
|
+
willDestroy: function() {
|
10974
|
+
this._teardownArrangedContent();
|
10975
|
+
this._teardownContent();
|
10817
10976
|
}
|
10818
10977
|
});
|
10819
10978
|
|
10820
|
-
Namespace.reopenClass({
|
10821
|
-
NAMESPACES: [Ember],
|
10822
|
-
NAMESPACES_BY_ID: {},
|
10823
|
-
PROCESSED: false,
|
10824
|
-
processAll: processAllNamespaces,
|
10825
|
-
byName: function(name) {
|
10826
|
-
if (!Ember.BOOTED) {
|
10827
|
-
processAllNamespaces();
|
10828
|
-
}
|
10829
|
-
|
10830
|
-
return NAMESPACES_BY_ID[name];
|
10831
|
-
}
|
10832
|
-
});
|
10833
|
-
|
10834
|
-
var NAMESPACES_BY_ID = Namespace.NAMESPACES_BY_ID;
|
10835
|
-
|
10836
|
-
var hasOwnProp = ({}).hasOwnProperty,
|
10837
|
-
guidFor = Ember.guidFor;
|
10838
|
-
|
10839
|
-
function processNamespace(paths, root, seen) {
|
10840
|
-
var idx = paths.length;
|
10841
10979
|
|
10842
|
-
|
10980
|
+
})();
|
10843
10981
|
|
10844
|
-
// Loop over all of the keys in the namespace, looking for classes
|
10845
|
-
for(var key in root) {
|
10846
|
-
if (!hasOwnProp.call(root, key)) { continue; }
|
10847
|
-
var obj = root[key];
|
10848
10982
|
|
10849
|
-
// If we are processing the `Ember` namespace, for example, the
|
10850
|
-
// `paths` will start with `["Ember"]`. Every iteration through
|
10851
|
-
// the loop will update the **second** element of this list with
|
10852
|
-
// the key, so processing `Ember.View` will make the Array
|
10853
|
-
// `['Ember', 'View']`.
|
10854
|
-
paths[idx] = key;
|
10855
10983
|
|
10856
|
-
|
10857
|
-
|
10858
|
-
|
10859
|
-
|
10860
|
-
|
10861
|
-
obj[NAME_KEY] = paths.join('.');
|
10984
|
+
(function() {
|
10985
|
+
/**
|
10986
|
+
@module ember
|
10987
|
+
@submodule ember-runtime
|
10988
|
+
*/
|
10862
10989
|
|
10863
|
-
|
10864
|
-
|
10865
|
-
|
10866
|
-
|
10867
|
-
|
10990
|
+
var get = Ember.get,
|
10991
|
+
set = Ember.set,
|
10992
|
+
fmt = Ember.String.fmt,
|
10993
|
+
addBeforeObserver = Ember.addBeforeObserver,
|
10994
|
+
addObserver = Ember.addObserver,
|
10995
|
+
removeBeforeObserver = Ember.removeBeforeObserver,
|
10996
|
+
removeObserver = Ember.removeObserver,
|
10997
|
+
propertyWillChange = Ember.propertyWillChange,
|
10998
|
+
propertyDidChange = Ember.propertyDidChange;
|
10868
10999
|
|
10869
|
-
|
10870
|
-
|
10871
|
-
|
10872
|
-
|
11000
|
+
function contentPropertyWillChange(content, contentKey) {
|
11001
|
+
var key = contentKey.slice(8); // remove "content."
|
11002
|
+
if (key in this) { return; } // if shadowed in proxy
|
11003
|
+
propertyWillChange(this, key);
|
11004
|
+
}
|
10873
11005
|
|
10874
|
-
|
11006
|
+
function contentPropertyDidChange(content, contentKey) {
|
11007
|
+
var key = contentKey.slice(8); // remove "content."
|
11008
|
+
if (key in this) { return; } // if shadowed in proxy
|
11009
|
+
propertyDidChange(this, key);
|
10875
11010
|
}
|
10876
11011
|
|
10877
|
-
|
10878
|
-
|
11012
|
+
/**
|
11013
|
+
`Ember.ObjectProxy` forwards all properties not defined by the proxy itself
|
11014
|
+
to a proxied `content` object.
|
10879
11015
|
|
10880
|
-
|
11016
|
+
```javascript
|
11017
|
+
object = Ember.Object.create({
|
11018
|
+
name: 'Foo'
|
11019
|
+
});
|
10881
11020
|
|
10882
|
-
|
10883
|
-
|
10884
|
-
|
11021
|
+
proxy = Ember.ObjectProxy.create({
|
11022
|
+
content: object
|
11023
|
+
});
|
10885
11024
|
|
10886
|
-
|
10887
|
-
|
10888
|
-
|
10889
|
-
|
10890
|
-
if (lookup.hasOwnProperty && !lookup.hasOwnProperty(prop)) { continue; }
|
11025
|
+
// Access and change existing properties
|
11026
|
+
proxy.get('name') // 'Foo'
|
11027
|
+
proxy.set('name', 'Bar');
|
11028
|
+
object.get('name') // 'Bar'
|
10891
11029
|
|
10892
|
-
|
10893
|
-
|
10894
|
-
|
10895
|
-
|
10896
|
-
isNamespace = obj && obj.isNamespace;
|
10897
|
-
} catch (e) {
|
10898
|
-
continue;
|
10899
|
-
}
|
11030
|
+
// Create new 'description' property on `object`
|
11031
|
+
proxy.set('description', 'Foo is a whizboo baz');
|
11032
|
+
object.get('description') // 'Foo is a whizboo baz'
|
11033
|
+
```
|
10900
11034
|
|
10901
|
-
|
11035
|
+
While `content` is unset, setting a property to be delegated will throw an
|
11036
|
+
Error.
|
10902
11037
|
|
10903
|
-
|
10904
|
-
|
10905
|
-
|
10906
|
-
|
11038
|
+
```javascript
|
11039
|
+
proxy = Ember.ObjectProxy.create({
|
11040
|
+
content: null,
|
11041
|
+
flag: null
|
11042
|
+
});
|
11043
|
+
proxy.set('flag', true);
|
11044
|
+
proxy.get('flag'); // true
|
11045
|
+
proxy.get('foo'); // undefined
|
11046
|
+
proxy.set('foo', 'data'); // throws Error
|
11047
|
+
```
|
10907
11048
|
|
10908
|
-
|
11049
|
+
Delegated properties can be bound to and will change when content is updated.
|
10909
11050
|
|
10910
|
-
|
10911
|
-
var superclass = mixin.superclass;
|
10912
|
-
if (superclass) {
|
10913
|
-
if (superclass[NAME_KEY]) { return superclass[NAME_KEY]; }
|
10914
|
-
else { return superClassString(superclass); }
|
10915
|
-
} else {
|
10916
|
-
return;
|
10917
|
-
}
|
10918
|
-
}
|
11051
|
+
Computed properties on the proxy itself can depend on delegated properties.
|
10919
11052
|
|
10920
|
-
|
10921
|
-
|
10922
|
-
|
10923
|
-
|
11053
|
+
```javascript
|
11054
|
+
ProxyWithComputedProperty = Ember.ObjectProxy.extend({
|
11055
|
+
fullName: function () {
|
11056
|
+
var firstName = this.get('firstName'),
|
11057
|
+
lastName = this.get('lastName');
|
11058
|
+
if (firstName && lastName) {
|
11059
|
+
return firstName + ' ' + lastName;
|
11060
|
+
}
|
11061
|
+
return firstName || lastName;
|
11062
|
+
}.property('firstName', 'lastName')
|
11063
|
+
});
|
10924
11064
|
|
10925
|
-
|
11065
|
+
proxy = ProxyWithComputedProperty.create();
|
10926
11066
|
|
10927
|
-
|
10928
|
-
|
10929
|
-
|
10930
|
-
|
10931
|
-
if (str) {
|
10932
|
-
ret = "(subclass of " + str + ")";
|
10933
|
-
} else {
|
10934
|
-
ret = "(unknown mixin)";
|
10935
|
-
}
|
10936
|
-
this.toString = makeToString(ret);
|
10937
|
-
}
|
11067
|
+
proxy.get('fullName'); // undefined
|
11068
|
+
proxy.set('content', {
|
11069
|
+
firstName: 'Tom', lastName: 'Dale'
|
11070
|
+
}); // triggers property change for fullName on proxy
|
10938
11071
|
|
10939
|
-
|
10940
|
-
|
11072
|
+
proxy.get('fullName'); // 'Tom Dale'
|
11073
|
+
```
|
10941
11074
|
|
10942
|
-
|
10943
|
-
|
10944
|
-
|
11075
|
+
@class ObjectProxy
|
11076
|
+
@namespace Ember
|
11077
|
+
@extends Ember.Object
|
11078
|
+
*/
|
11079
|
+
Ember.ObjectProxy = Ember.Object.extend(
|
11080
|
+
/** @scope Ember.ObjectProxy.prototype */ {
|
11081
|
+
/**
|
11082
|
+
The object whose properties will be forwarded.
|
10945
11083
|
|
10946
|
-
|
10947
|
-
|
10948
|
-
|
10949
|
-
|
11084
|
+
@property content
|
11085
|
+
@type Ember.Object
|
11086
|
+
@default null
|
11087
|
+
*/
|
11088
|
+
content: null,
|
11089
|
+
_contentDidChange: Ember.observer(function() {
|
10950
11090
|
|
10951
|
-
|
10952
|
-
var namespaces = Namespace.NAMESPACES, namespace;
|
10953
|
-
for (var i=0, l=namespaces.length; i<l; i++) {
|
10954
|
-
namespace = namespaces[i];
|
10955
|
-
processNamespace([namespace.toString()], namespace, {});
|
10956
|
-
}
|
11091
|
+
}, 'content'),
|
10957
11092
|
|
10958
|
-
|
10959
|
-
}
|
10960
|
-
}
|
11093
|
+
isTruthy: Ember.computed.bool('content'),
|
10961
11094
|
|
10962
|
-
|
10963
|
-
return function() { return ret; };
|
10964
|
-
}
|
11095
|
+
_debugContainerKey: null,
|
10965
11096
|
|
10966
|
-
|
11097
|
+
willWatchProperty: function (key) {
|
11098
|
+
var contentKey = 'content.' + key;
|
11099
|
+
addBeforeObserver(this, contentKey, null, contentPropertyWillChange);
|
11100
|
+
addObserver(this, contentKey, null, contentPropertyDidChange);
|
11101
|
+
},
|
10967
11102
|
|
10968
|
-
|
11103
|
+
didUnwatchProperty: function (key) {
|
11104
|
+
var contentKey = 'content.' + key;
|
11105
|
+
removeBeforeObserver(this, contentKey, null, contentPropertyWillChange);
|
11106
|
+
removeObserver(this, contentKey, null, contentPropertyDidChange);
|
11107
|
+
},
|
11108
|
+
|
11109
|
+
unknownProperty: function (key) {
|
11110
|
+
var content = get(this, 'content');
|
11111
|
+
if (content) {
|
11112
|
+
return get(content, key);
|
11113
|
+
}
|
11114
|
+
},
|
10969
11115
|
|
11116
|
+
setUnknownProperty: function (key, value) {
|
11117
|
+
var content = get(this, 'content');
|
10970
11118
|
|
11119
|
+
return set(content, key, value);
|
11120
|
+
}
|
11121
|
+
});
|
10971
11122
|
|
10972
|
-
(
|
10973
|
-
|
11123
|
+
Ember.ObjectProxy.reopenClass({
|
11124
|
+
create: function () {
|
11125
|
+
var mixin, prototype, i, l, properties, keyName;
|
11126
|
+
if (arguments.length) {
|
11127
|
+
prototype = this.proto();
|
11128
|
+
for (i = 0, l = arguments.length; i < l; i++) {
|
11129
|
+
properties = arguments[i];
|
11130
|
+
for (keyName in properties) {
|
11131
|
+
if (!properties.hasOwnProperty(keyName) || keyName in prototype) { continue; }
|
11132
|
+
if (!mixin) mixin = {};
|
11133
|
+
mixin[keyName] = null;
|
11134
|
+
}
|
11135
|
+
}
|
11136
|
+
if (mixin) this._initMixins([mixin]);
|
11137
|
+
}
|
11138
|
+
return this._super.apply(this, arguments);
|
11139
|
+
}
|
11140
|
+
});
|
10974
11141
|
|
10975
11142
|
})();
|
10976
11143
|
|
@@ -10983,234 +11150,361 @@ Ember.Application = Ember.Namespace.extend();
|
|
10983
11150
|
*/
|
10984
11151
|
|
10985
11152
|
|
10986
|
-
var get = Ember.get,
|
11153
|
+
var set = Ember.set, get = Ember.get, guidFor = Ember.guidFor;
|
11154
|
+
var forEach = Ember.EnumerableUtils.forEach;
|
10987
11155
|
|
10988
|
-
|
10989
|
-
An ArrayProxy wraps any other object that implements `Ember.Array` and/or
|
10990
|
-
`Ember.MutableArray,` forwarding all requests. This makes it very useful for
|
10991
|
-
a number of binding use cases or other cases where being able to swap
|
10992
|
-
out the underlying array is useful.
|
11156
|
+
var EachArray = Ember.Object.extend(Ember.Array, {
|
10993
11157
|
|
10994
|
-
|
11158
|
+
init: function(content, keyName, owner) {
|
11159
|
+
this._super();
|
11160
|
+
this._keyName = keyName;
|
11161
|
+
this._owner = owner;
|
11162
|
+
this._content = content;
|
11163
|
+
},
|
10995
11164
|
|
10996
|
-
|
10997
|
-
|
10998
|
-
|
11165
|
+
objectAt: function(idx) {
|
11166
|
+
var item = this._content.objectAt(idx);
|
11167
|
+
return item && get(item, this._keyName);
|
11168
|
+
},
|
10999
11169
|
|
11000
|
-
|
11001
|
-
|
11002
|
-
|
11003
|
-
|
11170
|
+
length: Ember.computed(function() {
|
11171
|
+
var content = this._content;
|
11172
|
+
return content ? get(content, 'length') : 0;
|
11173
|
+
})
|
11004
11174
|
|
11005
|
-
|
11006
|
-
an array, as they are accessed. This can be done by overriding
|
11007
|
-
`objectAtContent`:
|
11175
|
+
});
|
11008
11176
|
|
11009
|
-
|
11010
|
-
var pets = ['dog', 'cat', 'fish'];
|
11011
|
-
var ap = Ember.ArrayProxy.create({
|
11012
|
-
content: Ember.A(pets),
|
11013
|
-
objectAtContent: function(idx) {
|
11014
|
-
return this.get('content').objectAt(idx).toUpperCase();
|
11015
|
-
}
|
11016
|
-
});
|
11177
|
+
var IS_OBSERVER = /^.+:(before|change)$/;
|
11017
11178
|
|
11018
|
-
|
11019
|
-
|
11179
|
+
function addObserverForContentKey(content, keyName, proxy, idx, loc) {
|
11180
|
+
var objects = proxy._objects, guid;
|
11181
|
+
if (!objects) objects = proxy._objects = {};
|
11020
11182
|
|
11021
|
-
|
11183
|
+
while(--loc>=idx) {
|
11184
|
+
var item = content.objectAt(loc);
|
11185
|
+
if (item) {
|
11186
|
+
Ember.addBeforeObserver(item, keyName, proxy, 'contentKeyWillChange');
|
11187
|
+
Ember.addObserver(item, keyName, proxy, 'contentKeyDidChange');
|
11188
|
+
|
11189
|
+
// keep track of the index each item was found at so we can map
|
11190
|
+
// it back when the obj changes.
|
11191
|
+
guid = guidFor(item);
|
11192
|
+
if (!objects[guid]) objects[guid] = [];
|
11193
|
+
objects[guid].push(loc);
|
11194
|
+
}
|
11195
|
+
}
|
11196
|
+
}
|
11197
|
+
|
11198
|
+
function removeObserverForContentKey(content, keyName, proxy, idx, loc) {
|
11199
|
+
var objects = proxy._objects;
|
11200
|
+
if (!objects) objects = proxy._objects = {};
|
11201
|
+
var indicies, guid;
|
11202
|
+
|
11203
|
+
while(--loc>=idx) {
|
11204
|
+
var item = content.objectAt(loc);
|
11205
|
+
if (item) {
|
11206
|
+
Ember.removeBeforeObserver(item, keyName, proxy, 'contentKeyWillChange');
|
11207
|
+
Ember.removeObserver(item, keyName, proxy, 'contentKeyDidChange');
|
11208
|
+
|
11209
|
+
guid = guidFor(item);
|
11210
|
+
indicies = objects[guid];
|
11211
|
+
indicies[indicies.indexOf(loc)] = null;
|
11212
|
+
}
|
11213
|
+
}
|
11214
|
+
}
|
11215
|
+
|
11216
|
+
/**
|
11217
|
+
This is the object instance returned when you get the `@each` property on an
|
11218
|
+
array. It uses the unknownProperty handler to automatically create
|
11219
|
+
EachArray instances for property names.
|
11220
|
+
|
11221
|
+
@private
|
11222
|
+
@class EachProxy
|
11022
11223
|
@namespace Ember
|
11023
11224
|
@extends Ember.Object
|
11024
|
-
@uses Ember.MutableArray
|
11025
11225
|
*/
|
11026
|
-
Ember.
|
11027
|
-
/** @scope Ember.ArrayProxy.prototype */ {
|
11226
|
+
Ember.EachProxy = Ember.Object.extend({
|
11028
11227
|
|
11029
|
-
|
11030
|
-
|
11031
|
-
|
11228
|
+
init: function(content) {
|
11229
|
+
this._super();
|
11230
|
+
this._content = content;
|
11231
|
+
content.addArrayObserver(this);
|
11032
11232
|
|
11033
|
-
|
11034
|
-
|
11035
|
-
|
11036
|
-
|
11233
|
+
// in case someone is already observing some keys make sure they are
|
11234
|
+
// added
|
11235
|
+
forEach(Ember.watchedEvents(this), function(eventName) {
|
11236
|
+
this.didAddListener(eventName);
|
11237
|
+
}, this);
|
11238
|
+
},
|
11037
11239
|
|
11038
11240
|
/**
|
11039
|
-
|
11040
|
-
|
11041
|
-
can override this property to provide things like sorting and filtering.
|
11241
|
+
You can directly access mapped properties by simply requesting them.
|
11242
|
+
The `unknownProperty` handler will generate an EachArray of each item.
|
11042
11243
|
|
11043
|
-
|
11244
|
+
@method unknownProperty
|
11245
|
+
@param keyName {String}
|
11246
|
+
@param value {anything}
|
11044
11247
|
*/
|
11045
|
-
|
11248
|
+
unknownProperty: function(keyName, value) {
|
11249
|
+
var ret;
|
11250
|
+
ret = new EachArray(this._content, keyName, this);
|
11251
|
+
Ember.defineProperty(this, keyName, null, ret);
|
11252
|
+
this.beginObservingContentKey(keyName);
|
11253
|
+
return ret;
|
11254
|
+
},
|
11046
11255
|
|
11047
|
-
|
11048
|
-
|
11049
|
-
|
11050
|
-
content item to something new.
|
11256
|
+
// ..........................................................
|
11257
|
+
// ARRAY CHANGES
|
11258
|
+
// Invokes whenever the content array itself changes.
|
11051
11259
|
|
11052
|
-
|
11260
|
+
arrayWillChange: function(content, idx, removedCnt, addedCnt) {
|
11261
|
+
var keys = this._keys, key, lim;
|
11053
11262
|
|
11054
|
-
|
11055
|
-
|
11056
|
-
@return {Object} the value or undefined if none found
|
11057
|
-
*/
|
11058
|
-
objectAtContent: function(idx) {
|
11059
|
-
return get(this, 'arrangedContent').objectAt(idx);
|
11060
|
-
},
|
11263
|
+
lim = removedCnt>0 ? idx+removedCnt : -1;
|
11264
|
+
Ember.beginPropertyChanges(this);
|
11061
11265
|
|
11062
|
-
|
11063
|
-
|
11064
|
-
You can override this method in subclasses to transform the content item
|
11065
|
-
into something new.
|
11266
|
+
for(key in keys) {
|
11267
|
+
if (!keys.hasOwnProperty(key)) { continue; }
|
11066
11268
|
|
11067
|
-
|
11269
|
+
if (lim>0) removeObserverForContentKey(content, key, this, idx, lim);
|
11068
11270
|
|
11069
|
-
|
11070
|
-
|
11071
|
-
|
11072
|
-
@
|
11073
|
-
|
11074
|
-
@return {void}
|
11075
|
-
*/
|
11076
|
-
replaceContent: function(idx, amt, objects) {
|
11077
|
-
get(this, 'content').replace(idx, amt, objects);
|
11271
|
+
Ember.propertyWillChange(this, key);
|
11272
|
+
}
|
11273
|
+
|
11274
|
+
Ember.propertyWillChange(this._content, '@each');
|
11275
|
+
Ember.endPropertyChanges(this);
|
11078
11276
|
},
|
11079
11277
|
|
11080
|
-
|
11081
|
-
|
11278
|
+
arrayDidChange: function(content, idx, removedCnt, addedCnt) {
|
11279
|
+
var keys = this._keys, key, lim;
|
11082
11280
|
|
11083
|
-
|
11084
|
-
|
11281
|
+
lim = addedCnt>0 ? idx+addedCnt : -1;
|
11282
|
+
Ember.beginPropertyChanges(this);
|
11085
11283
|
|
11086
|
-
|
11087
|
-
|
11088
|
-
_contentWillChange: Ember.beforeObserver(function() {
|
11089
|
-
this._teardownContent();
|
11090
|
-
}, 'content'),
|
11284
|
+
for(key in keys) {
|
11285
|
+
if (!keys.hasOwnProperty(key)) { continue; }
|
11091
11286
|
|
11092
|
-
|
11093
|
-
var content = get(this, 'content');
|
11287
|
+
if (lim>0) addObserverForContentKey(content, key, this, idx, lim);
|
11094
11288
|
|
11095
|
-
|
11096
|
-
content.removeArrayObserver(this, {
|
11097
|
-
willChange: 'contentArrayWillChange',
|
11098
|
-
didChange: 'contentArrayDidChange'
|
11099
|
-
});
|
11289
|
+
Ember.propertyDidChange(this, key);
|
11100
11290
|
}
|
11101
|
-
},
|
11102
|
-
|
11103
|
-
contentArrayWillChange: Ember.K,
|
11104
|
-
contentArrayDidChange: Ember.K,
|
11105
11291
|
|
11106
|
-
|
11107
|
-
|
11292
|
+
Ember.propertyDidChange(this._content, '@each');
|
11293
|
+
Ember.endPropertyChanges(this);
|
11294
|
+
},
|
11108
11295
|
|
11109
|
-
|
11110
|
-
|
11296
|
+
// ..........................................................
|
11297
|
+
// LISTEN FOR NEW OBSERVERS AND OTHER EVENT LISTENERS
|
11298
|
+
// Start monitoring keys based on who is listening...
|
11111
11299
|
|
11112
|
-
|
11113
|
-
|
11114
|
-
|
11115
|
-
|
11300
|
+
didAddListener: function(eventName) {
|
11301
|
+
if (IS_OBSERVER.test(eventName)) {
|
11302
|
+
this.beginObservingContentKey(eventName.slice(0, -7));
|
11303
|
+
}
|
11304
|
+
},
|
11116
11305
|
|
11306
|
+
didRemoveListener: function(eventName) {
|
11307
|
+
if (IS_OBSERVER.test(eventName)) {
|
11308
|
+
this.stopObservingContentKey(eventName.slice(0, -7));
|
11309
|
+
}
|
11310
|
+
},
|
11117
11311
|
|
11118
|
-
|
11119
|
-
|
11312
|
+
// ..........................................................
|
11313
|
+
// CONTENT KEY OBSERVING
|
11314
|
+
// Actual watch keys on the source content.
|
11120
11315
|
|
11121
|
-
|
11122
|
-
var
|
11316
|
+
beginObservingContentKey: function(keyName) {
|
11317
|
+
var keys = this._keys;
|
11318
|
+
if (!keys) keys = this._keys = {};
|
11319
|
+
if (!keys[keyName]) {
|
11320
|
+
keys[keyName] = 1;
|
11321
|
+
var content = this._content,
|
11322
|
+
len = get(content, 'length');
|
11323
|
+
addObserverForContentKey(content, keyName, this, 0, len);
|
11324
|
+
} else {
|
11325
|
+
keys[keyName]++;
|
11326
|
+
}
|
11327
|
+
},
|
11123
11328
|
|
11124
|
-
|
11125
|
-
|
11126
|
-
|
11127
|
-
|
11128
|
-
|
11329
|
+
stopObservingContentKey: function(keyName) {
|
11330
|
+
var keys = this._keys;
|
11331
|
+
if (keys && (keys[keyName]>0) && (--keys[keyName]<=0)) {
|
11332
|
+
var content = this._content,
|
11333
|
+
len = get(content, 'length');
|
11334
|
+
removeObserverForContentKey(content, keyName, this, 0, len);
|
11129
11335
|
}
|
11130
11336
|
},
|
11131
11337
|
|
11132
|
-
|
11133
|
-
|
11134
|
-
|
11338
|
+
contentKeyWillChange: function(obj, keyName) {
|
11339
|
+
Ember.propertyWillChange(this, keyName);
|
11340
|
+
},
|
11135
11341
|
|
11136
|
-
|
11137
|
-
|
11342
|
+
contentKeyDidChange: function(obj, keyName) {
|
11343
|
+
Ember.propertyDidChange(this, keyName);
|
11344
|
+
}
|
11138
11345
|
|
11139
|
-
|
11140
|
-
}, 'arrangedContent'),
|
11346
|
+
});
|
11141
11347
|
|
11142
|
-
_arrangedContentDidChange: Ember.observer(function() {
|
11143
|
-
var arrangedContent = get(this, 'arrangedContent'),
|
11144
|
-
len = arrangedContent ? get(arrangedContent, 'length') : 0;
|
11145
11348
|
|
11146
11349
|
|
11147
|
-
|
11350
|
+
})();
|
11148
11351
|
|
11149
|
-
this.arrangedContentDidChange(this);
|
11150
|
-
this.arrangedContentArrayDidChange(this, 0, undefined, len);
|
11151
|
-
}, 'arrangedContent'),
|
11152
11352
|
|
11153
|
-
_setupArrangedContent: function() {
|
11154
|
-
var arrangedContent = get(this, 'arrangedContent');
|
11155
11353
|
|
11156
|
-
|
11157
|
-
|
11158
|
-
|
11159
|
-
|
11160
|
-
|
11161
|
-
}
|
11162
|
-
},
|
11354
|
+
(function() {
|
11355
|
+
/**
|
11356
|
+
@module ember
|
11357
|
+
@submodule ember-runtime
|
11358
|
+
*/
|
11163
11359
|
|
11164
|
-
_teardownArrangedContent: function() {
|
11165
|
-
var arrangedContent = get(this, 'arrangedContent');
|
11166
11360
|
|
11167
|
-
|
11168
|
-
arrangedContent.removeArrayObserver(this, {
|
11169
|
-
willChange: 'arrangedContentArrayWillChange',
|
11170
|
-
didChange: 'arrangedContentArrayDidChange'
|
11171
|
-
});
|
11172
|
-
}
|
11173
|
-
},
|
11361
|
+
var get = Ember.get, set = Ember.set;
|
11174
11362
|
|
11175
|
-
|
11176
|
-
|
11363
|
+
// Add Ember.Array to Array.prototype. Remove methods with native
|
11364
|
+
// implementations and supply some more optimized versions of generic methods
|
11365
|
+
// because they are so common.
|
11366
|
+
var NativeArray = Ember.Mixin.create(Ember.MutableArray, Ember.Observable, Ember.Copyable, {
|
11177
11367
|
|
11178
|
-
|
11179
|
-
|
11368
|
+
// because length is a built-in property we need to know to just get the
|
11369
|
+
// original property.
|
11370
|
+
get: function(key) {
|
11371
|
+
if (key==='length') return this.length;
|
11372
|
+
else if ('number' === typeof key) return this[key];
|
11373
|
+
else return this._super(key);
|
11180
11374
|
},
|
11181
11375
|
|
11182
|
-
|
11183
|
-
|
11184
|
-
|
11185
|
-
// No dependencies since Enumerable notifies length of change
|
11186
|
-
}),
|
11376
|
+
objectAt: function(idx) {
|
11377
|
+
return this[idx];
|
11378
|
+
},
|
11187
11379
|
|
11380
|
+
// primitive for array support.
|
11188
11381
|
replace: function(idx, amt, objects) {
|
11189
11382
|
|
11190
|
-
if (
|
11191
|
-
|
11383
|
+
if (this.isFrozen) throw Ember.FROZEN_ERROR ;
|
11384
|
+
|
11385
|
+
// if we replaced exactly the same number of items, then pass only the
|
11386
|
+
// replaced range. Otherwise, pass the full remaining array length
|
11387
|
+
// since everything has shifted
|
11388
|
+
var len = objects ? get(objects, 'length') : 0;
|
11389
|
+
this.arrayContentWillChange(idx, amt, len);
|
11390
|
+
|
11391
|
+
if (!objects || objects.length === 0) {
|
11392
|
+
this.splice(idx, amt) ;
|
11393
|
+
} else {
|
11394
|
+
var args = [idx, amt].concat(objects) ;
|
11395
|
+
this.splice.apply(this,args) ;
|
11396
|
+
}
|
11397
|
+
|
11398
|
+
this.arrayContentDidChange(idx, amt, len);
|
11399
|
+
return this ;
|
11192
11400
|
},
|
11193
11401
|
|
11194
|
-
|
11195
|
-
|
11402
|
+
// If you ask for an unknown property, then try to collect the value
|
11403
|
+
// from member items.
|
11404
|
+
unknownProperty: function(key, value) {
|
11405
|
+
var ret;// = this.reducedProperty(key, value) ;
|
11406
|
+
if ((value !== undefined) && ret === undefined) {
|
11407
|
+
ret = this[key] = value;
|
11408
|
+
}
|
11409
|
+
return ret ;
|
11196
11410
|
},
|
11197
11411
|
|
11198
|
-
|
11199
|
-
|
11412
|
+
// If browser did not implement indexOf natively, then override with
|
11413
|
+
// specialized version
|
11414
|
+
indexOf: function(object, startAt) {
|
11415
|
+
var idx, len = this.length;
|
11416
|
+
|
11417
|
+
if (startAt === undefined) startAt = 0;
|
11418
|
+
else startAt = (startAt < 0) ? Math.ceil(startAt) : Math.floor(startAt);
|
11419
|
+
if (startAt < 0) startAt += len;
|
11420
|
+
|
11421
|
+
for(idx=startAt;idx<len;idx++) {
|
11422
|
+
if (this[idx] === object) return idx ;
|
11423
|
+
}
|
11424
|
+
return -1;
|
11200
11425
|
},
|
11201
11426
|
|
11202
|
-
|
11203
|
-
this.
|
11204
|
-
|
11205
|
-
|
11427
|
+
lastIndexOf: function(object, startAt) {
|
11428
|
+
var idx, len = this.length;
|
11429
|
+
|
11430
|
+
if (startAt === undefined) startAt = len-1;
|
11431
|
+
else startAt = (startAt < 0) ? Math.ceil(startAt) : Math.floor(startAt);
|
11432
|
+
if (startAt < 0) startAt += len;
|
11433
|
+
|
11434
|
+
for(idx=startAt;idx>=0;idx--) {
|
11435
|
+
if (this[idx] === object) return idx ;
|
11436
|
+
}
|
11437
|
+
return -1;
|
11206
11438
|
},
|
11207
11439
|
|
11208
|
-
|
11209
|
-
|
11210
|
-
|
11440
|
+
copy: function(deep) {
|
11441
|
+
if (deep) {
|
11442
|
+
return this.map(function(item){ return Ember.copy(item, true); });
|
11443
|
+
}
|
11444
|
+
|
11445
|
+
return this.slice();
|
11211
11446
|
}
|
11212
11447
|
});
|
11213
11448
|
|
11449
|
+
// Remove any methods implemented natively so we don't override them
|
11450
|
+
var ignore = ['length'];
|
11451
|
+
Ember.EnumerableUtils.forEach(NativeArray.keys(), function(methodName) {
|
11452
|
+
if (Array.prototype[methodName]) ignore.push(methodName);
|
11453
|
+
});
|
11454
|
+
|
11455
|
+
if (ignore.length>0) {
|
11456
|
+
NativeArray = NativeArray.without.apply(NativeArray, ignore);
|
11457
|
+
}
|
11458
|
+
|
11459
|
+
/**
|
11460
|
+
The NativeArray mixin contains the properties needed to to make the native
|
11461
|
+
Array support Ember.MutableArray and all of its dependent APIs. Unless you
|
11462
|
+
have `Ember.EXTEND_PROTOTYPES` or `Ember.EXTEND_PROTOTYPES.Array` set to
|
11463
|
+
false, this will be applied automatically. Otherwise you can apply the mixin
|
11464
|
+
at anytime by calling `Ember.NativeArray.activate`.
|
11465
|
+
|
11466
|
+
@class NativeArray
|
11467
|
+
@namespace Ember
|
11468
|
+
@extends Ember.Mixin
|
11469
|
+
@uses Ember.MutableArray
|
11470
|
+
@uses Ember.MutableEnumerable
|
11471
|
+
@uses Ember.Copyable
|
11472
|
+
@uses Ember.Freezable
|
11473
|
+
*/
|
11474
|
+
Ember.NativeArray = NativeArray;
|
11475
|
+
|
11476
|
+
/**
|
11477
|
+
Creates an `Ember.NativeArray` from an Array like object.
|
11478
|
+
Does not modify the original object.
|
11479
|
+
|
11480
|
+
@method A
|
11481
|
+
@for Ember
|
11482
|
+
@return {Ember.NativeArray}
|
11483
|
+
*/
|
11484
|
+
Ember.A = function(arr){
|
11485
|
+
if (arr === undefined) { arr = []; }
|
11486
|
+
return Ember.Array.detect(arr) ? arr : Ember.NativeArray.apply(arr);
|
11487
|
+
};
|
11488
|
+
|
11489
|
+
/**
|
11490
|
+
Activates the mixin on the Array.prototype if not already applied. Calling
|
11491
|
+
this method more than once is safe.
|
11492
|
+
|
11493
|
+
@method activate
|
11494
|
+
@for Ember.NativeArray
|
11495
|
+
@static
|
11496
|
+
@return {void}
|
11497
|
+
*/
|
11498
|
+
Ember.NativeArray.activate = function() {
|
11499
|
+
NativeArray.apply(Array.prototype);
|
11500
|
+
|
11501
|
+
Ember.A = function(arr) { return arr || []; };
|
11502
|
+
};
|
11503
|
+
|
11504
|
+
if (Ember.EXTEND_PROTOTYPES === true || Ember.EXTEND_PROTOTYPES.Array) {
|
11505
|
+
Ember.NativeArray.activate();
|
11506
|
+
}
|
11507
|
+
|
11214
11508
|
|
11215
11509
|
})();
|
11216
11510
|
|
@@ -11222,505 +11516,452 @@ Ember.ArrayProxy = Ember.Object.extend(Ember.MutableArray,
|
|
11222
11516
|
@submodule ember-runtime
|
11223
11517
|
*/
|
11224
11518
|
|
11225
|
-
var get = Ember.get,
|
11226
|
-
set = Ember.set,
|
11227
|
-
fmt = Ember.String.fmt,
|
11228
|
-
addBeforeObserver = Ember.addBeforeObserver,
|
11229
|
-
addObserver = Ember.addObserver,
|
11230
|
-
removeBeforeObserver = Ember.removeBeforeObserver,
|
11231
|
-
removeObserver = Ember.removeObserver,
|
11232
|
-
propertyWillChange = Ember.propertyWillChange,
|
11233
|
-
propertyDidChange = Ember.propertyDidChange;
|
11519
|
+
var get = Ember.get, set = Ember.set, guidFor = Ember.guidFor, none = Ember.isNone, fmt = Ember.String.fmt;
|
11234
11520
|
|
11235
|
-
|
11236
|
-
|
11237
|
-
if (key in this) { return; } // if shadowed in proxy
|
11238
|
-
propertyWillChange(this, key);
|
11239
|
-
}
|
11521
|
+
/**
|
11522
|
+
An unordered collection of objects.
|
11240
11523
|
|
11241
|
-
|
11242
|
-
|
11243
|
-
|
11244
|
-
|
11245
|
-
}
|
11524
|
+
A Set works a bit like an array except that its items are not ordered. You
|
11525
|
+
can create a set to efficiently test for membership for an object. You can
|
11526
|
+
also iterate through a set just like an array, even accessing objects by
|
11527
|
+
index, however there is no guarantee as to their order.
|
11246
11528
|
|
11247
|
-
|
11248
|
-
|
11249
|
-
|
11529
|
+
All Sets are observable via the Enumerable Observer API - which works
|
11530
|
+
on any enumerable object including both Sets and Arrays.
|
11531
|
+
|
11532
|
+
## Creating a Set
|
11533
|
+
|
11534
|
+
You can create a set like you would most objects using
|
11535
|
+
`new Ember.Set()`. Most new sets you create will be empty, but you can
|
11536
|
+
also initialize the set with some content by passing an array or other
|
11537
|
+
enumerable of objects to the constructor.
|
11538
|
+
|
11539
|
+
Finally, you can pass in an existing set and the set will be copied. You
|
11540
|
+
can also create a copy of a set by calling `Ember.Set#copy()`.
|
11250
11541
|
|
11251
11542
|
```javascript
|
11252
|
-
|
11253
|
-
|
11254
|
-
});
|
11543
|
+
// creates a new empty set
|
11544
|
+
var foundNames = new Ember.Set();
|
11255
11545
|
|
11256
|
-
|
11257
|
-
|
11258
|
-
});
|
11546
|
+
// creates a set with four names in it.
|
11547
|
+
var names = new Ember.Set(["Charles", "Tom", "Juan", "Alex"]); // :P
|
11259
11548
|
|
11260
|
-
//
|
11261
|
-
|
11262
|
-
proxy.set('name', 'Bar');
|
11263
|
-
object.get('name') // 'Bar'
|
11549
|
+
// creates a copy of the names set.
|
11550
|
+
var namesCopy = new Ember.Set(names);
|
11264
11551
|
|
11265
|
-
//
|
11266
|
-
|
11267
|
-
object.get('description') // 'Foo is a whizboo baz'
|
11552
|
+
// same as above.
|
11553
|
+
var anotherNamesCopy = names.copy();
|
11268
11554
|
```
|
11269
11555
|
|
11270
|
-
|
11271
|
-
Error.
|
11556
|
+
## Adding/Removing Objects
|
11272
11557
|
|
11273
|
-
|
11274
|
-
|
11275
|
-
|
11276
|
-
flag: null
|
11277
|
-
});
|
11278
|
-
proxy.set('flag', true);
|
11279
|
-
proxy.get('flag'); // true
|
11280
|
-
proxy.get('foo'); // undefined
|
11281
|
-
proxy.set('foo', 'data'); // throws Error
|
11282
|
-
```
|
11558
|
+
You generally add or remove objects from a set using `add()` or
|
11559
|
+
`remove()`. You can add any type of object including primitives such as
|
11560
|
+
numbers, strings, and booleans.
|
11283
11561
|
|
11284
|
-
|
11562
|
+
Unlike arrays, objects can only exist one time in a set. If you call `add()`
|
11563
|
+
on a set with the same object multiple times, the object will only be added
|
11564
|
+
once. Likewise, calling `remove()` with the same object multiple times will
|
11565
|
+
remove the object the first time and have no effect on future calls until
|
11566
|
+
you add the object to the set again.
|
11285
11567
|
|
11286
|
-
|
11568
|
+
NOTE: You cannot add/remove `null` or `undefined` to a set. Any attempt to do
|
11569
|
+
so will be ignored.
|
11287
11570
|
|
11288
|
-
|
11289
|
-
|
11290
|
-
|
11291
|
-
|
11292
|
-
lastName = this.get('lastName');
|
11293
|
-
if (firstName && lastName) {
|
11294
|
-
return firstName + ' ' + lastName;
|
11295
|
-
}
|
11296
|
-
return firstName || lastName;
|
11297
|
-
}.property('firstName', 'lastName')
|
11298
|
-
});
|
11571
|
+
In addition to add/remove you can also call `push()`/`pop()`. Push behaves
|
11572
|
+
just like `add()` but `pop()`, unlike `remove()` will pick an arbitrary
|
11573
|
+
object, remove it and return it. This is a good way to use a set as a job
|
11574
|
+
queue when you don't care which order the jobs are executed in.
|
11299
11575
|
|
11300
|
-
|
11576
|
+
## Testing for an Object
|
11301
11577
|
|
11302
|
-
|
11303
|
-
|
11304
|
-
firstName: 'Tom', lastName: 'Dale'
|
11305
|
-
}); // triggers property change for fullName on proxy
|
11578
|
+
To test for an object's presence in a set you simply call
|
11579
|
+
`Ember.Set#contains()`.
|
11306
11580
|
|
11307
|
-
|
11308
|
-
```
|
11581
|
+
## Observing changes
|
11309
11582
|
|
11310
|
-
|
11311
|
-
|
11312
|
-
|
11313
|
-
|
11314
|
-
|
11315
|
-
/** @scope Ember.ObjectProxy.prototype */ {
|
11316
|
-
/**
|
11317
|
-
The object whose properties will be forwarded.
|
11583
|
+
When using `Ember.Set`, you can observe the `"[]"` property to be
|
11584
|
+
alerted whenever the content changes. You can also add an enumerable
|
11585
|
+
observer to the set to be notified of specific objects that are added and
|
11586
|
+
removed from the set. See `Ember.Enumerable` for more information on
|
11587
|
+
enumerables.
|
11318
11588
|
|
11319
|
-
|
11320
|
-
|
11321
|
-
|
11322
|
-
|
11323
|
-
|
11324
|
-
_contentDidChange: Ember.observer(function() {
|
11589
|
+
This is often unhelpful. If you are filtering sets of objects, for instance,
|
11590
|
+
it is very inefficient to re-filter all of the items each time the set
|
11591
|
+
changes. It would be better if you could just adjust the filtered set based
|
11592
|
+
on what was changed on the original set. The same issue applies to merging
|
11593
|
+
sets, as well.
|
11325
11594
|
|
11326
|
-
|
11595
|
+
## Other Methods
|
11327
11596
|
|
11328
|
-
|
11597
|
+
`Ember.Set` primary implements other mixin APIs. For a complete reference
|
11598
|
+
on the methods you will use with `Ember.Set`, please consult these mixins.
|
11599
|
+
The most useful ones will be `Ember.Enumerable` and
|
11600
|
+
`Ember.MutableEnumerable` which implement most of the common iterator
|
11601
|
+
methods you are used to on Array.
|
11329
11602
|
|
11330
|
-
|
11603
|
+
Note that you can also use the `Ember.Copyable` and `Ember.Freezable`
|
11604
|
+
APIs on `Ember.Set` as well. Once a set is frozen it can no longer be
|
11605
|
+
modified. The benefit of this is that when you call `frozenCopy()` on it,
|
11606
|
+
Ember will avoid making copies of the set. This allows you to write
|
11607
|
+
code that can know with certainty when the underlying set data will or
|
11608
|
+
will not be modified.
|
11331
11609
|
|
11332
|
-
|
11333
|
-
|
11334
|
-
|
11335
|
-
|
11336
|
-
|
11610
|
+
@class Set
|
11611
|
+
@namespace Ember
|
11612
|
+
@extends Ember.CoreObject
|
11613
|
+
@uses Ember.MutableEnumerable
|
11614
|
+
@uses Ember.Copyable
|
11615
|
+
@uses Ember.Freezable
|
11616
|
+
@since Ember 0.9
|
11617
|
+
*/
|
11618
|
+
Ember.Set = Ember.CoreObject.extend(Ember.MutableEnumerable, Ember.Copyable, Ember.Freezable,
|
11619
|
+
/** @scope Ember.Set.prototype */ {
|
11337
11620
|
|
11338
|
-
|
11339
|
-
|
11340
|
-
|
11341
|
-
removeObserver(this, contentKey, null, contentPropertyDidChange);
|
11342
|
-
},
|
11621
|
+
// ..........................................................
|
11622
|
+
// IMPLEMENT ENUMERABLE APIS
|
11623
|
+
//
|
11343
11624
|
|
11344
|
-
|
11345
|
-
|
11346
|
-
if (content) {
|
11347
|
-
return get(content, key);
|
11348
|
-
}
|
11349
|
-
},
|
11625
|
+
/**
|
11626
|
+
This property will change as the number of objects in the set changes.
|
11350
11627
|
|
11351
|
-
|
11352
|
-
|
11628
|
+
@property length
|
11629
|
+
@type number
|
11630
|
+
@default 0
|
11631
|
+
*/
|
11632
|
+
length: 0,
|
11353
11633
|
|
11354
|
-
|
11355
|
-
|
11356
|
-
|
11634
|
+
/**
|
11635
|
+
Clears the set. This is useful if you want to reuse an existing set
|
11636
|
+
without having to recreate it.
|
11357
11637
|
|
11358
|
-
|
11638
|
+
```javascript
|
11639
|
+
var colors = new Ember.Set(["red", "green", "blue"]);
|
11640
|
+
colors.length; // 3
|
11641
|
+
colors.clear();
|
11642
|
+
colors.length; // 0
|
11643
|
+
```
|
11359
11644
|
|
11645
|
+
@method clear
|
11646
|
+
@return {Ember.Set} An empty Set
|
11647
|
+
*/
|
11648
|
+
clear: function() {
|
11649
|
+
if (this.isFrozen) { throw new Error(Ember.FROZEN_ERROR); }
|
11360
11650
|
|
11651
|
+
var len = get(this, 'length');
|
11652
|
+
if (len === 0) { return this; }
|
11361
11653
|
|
11362
|
-
|
11363
|
-
/**
|
11364
|
-
@module ember
|
11365
|
-
@submodule ember-runtime
|
11366
|
-
*/
|
11654
|
+
var guid;
|
11367
11655
|
|
11656
|
+
this.enumerableContentWillChange(len, 0);
|
11657
|
+
Ember.propertyWillChange(this, 'firstObject');
|
11658
|
+
Ember.propertyWillChange(this, 'lastObject');
|
11368
11659
|
|
11369
|
-
var
|
11370
|
-
|
11660
|
+
for (var i=0; i < len; i++){
|
11661
|
+
guid = guidFor(this[i]);
|
11662
|
+
delete this[guid];
|
11663
|
+
delete this[i];
|
11664
|
+
}
|
11371
11665
|
|
11372
|
-
|
11666
|
+
set(this, 'length', 0);
|
11373
11667
|
|
11374
|
-
|
11375
|
-
|
11376
|
-
this.
|
11377
|
-
this._owner = owner;
|
11378
|
-
this._content = content;
|
11379
|
-
},
|
11668
|
+
Ember.propertyDidChange(this, 'firstObject');
|
11669
|
+
Ember.propertyDidChange(this, 'lastObject');
|
11670
|
+
this.enumerableContentDidChange(len, 0);
|
11380
11671
|
|
11381
|
-
|
11382
|
-
var item = this._content.objectAt(idx);
|
11383
|
-
return item && get(item, this._keyName);
|
11672
|
+
return this;
|
11384
11673
|
},
|
11385
11674
|
|
11386
|
-
|
11387
|
-
|
11388
|
-
|
11389
|
-
})
|
11390
|
-
|
11391
|
-
});
|
11392
|
-
|
11393
|
-
var IS_OBSERVER = /^.+:(before|change)$/;
|
11394
|
-
|
11395
|
-
function addObserverForContentKey(content, keyName, proxy, idx, loc) {
|
11396
|
-
var objects = proxy._objects, guid;
|
11397
|
-
if (!objects) objects = proxy._objects = {};
|
11675
|
+
/**
|
11676
|
+
Returns true if the passed object is also an enumerable that contains the
|
11677
|
+
same objects as the receiver.
|
11398
11678
|
|
11399
|
-
|
11400
|
-
var
|
11401
|
-
|
11402
|
-
Ember.addBeforeObserver(item, keyName, proxy, 'contentKeyWillChange');
|
11403
|
-
Ember.addObserver(item, keyName, proxy, 'contentKeyDidChange');
|
11679
|
+
```javascript
|
11680
|
+
var colors = ["red", "green", "blue"],
|
11681
|
+
same_colors = new Ember.Set(colors);
|
11404
11682
|
|
11405
|
-
|
11406
|
-
|
11407
|
-
|
11408
|
-
if (!objects[guid]) objects[guid] = [];
|
11409
|
-
objects[guid].push(loc);
|
11410
|
-
}
|
11411
|
-
}
|
11412
|
-
}
|
11683
|
+
same_colors.isEqual(colors); // true
|
11684
|
+
same_colors.isEqual(["purple", "brown"]); // false
|
11685
|
+
```
|
11413
11686
|
|
11414
|
-
|
11415
|
-
|
11416
|
-
|
11417
|
-
|
11687
|
+
@method isEqual
|
11688
|
+
@param {Ember.Set} obj the other object.
|
11689
|
+
@return {Boolean}
|
11690
|
+
*/
|
11691
|
+
isEqual: function(obj) {
|
11692
|
+
// fail fast
|
11693
|
+
if (!Ember.Enumerable.detect(obj)) return false;
|
11418
11694
|
|
11419
|
-
|
11420
|
-
|
11421
|
-
if (item) {
|
11422
|
-
Ember.removeBeforeObserver(item, keyName, proxy, 'contentKeyWillChange');
|
11423
|
-
Ember.removeObserver(item, keyName, proxy, 'contentKeyDidChange');
|
11695
|
+
var loc = get(this, 'length');
|
11696
|
+
if (get(obj, 'length') !== loc) return false;
|
11424
11697
|
|
11425
|
-
|
11426
|
-
|
11427
|
-
indicies[indicies.indexOf(loc)] = null;
|
11698
|
+
while(--loc >= 0) {
|
11699
|
+
if (!obj.contains(this[loc])) return false;
|
11428
11700
|
}
|
11429
|
-
}
|
11430
|
-
}
|
11431
11701
|
|
11432
|
-
|
11433
|
-
This is the object instance returned when you get the `@each` property on an
|
11434
|
-
array. It uses the unknownProperty handler to automatically create
|
11435
|
-
EachArray instances for property names.
|
11436
|
-
|
11437
|
-
@private
|
11438
|
-
@class EachProxy
|
11439
|
-
@namespace Ember
|
11440
|
-
@extends Ember.Object
|
11441
|
-
*/
|
11442
|
-
Ember.EachProxy = Ember.Object.extend({
|
11443
|
-
|
11444
|
-
init: function(content) {
|
11445
|
-
this._super();
|
11446
|
-
this._content = content;
|
11447
|
-
content.addArrayObserver(this);
|
11448
|
-
|
11449
|
-
// in case someone is already observing some keys make sure they are
|
11450
|
-
// added
|
11451
|
-
forEach(Ember.watchedEvents(this), function(eventName) {
|
11452
|
-
this.didAddListener(eventName);
|
11453
|
-
}, this);
|
11702
|
+
return true;
|
11454
11703
|
},
|
11455
11704
|
|
11456
11705
|
/**
|
11457
|
-
|
11458
|
-
|
11459
|
-
|
11460
|
-
@method unknownProperty
|
11461
|
-
@param keyName {String}
|
11462
|
-
@param value {anything}
|
11463
|
-
*/
|
11464
|
-
unknownProperty: function(keyName, value) {
|
11465
|
-
var ret;
|
11466
|
-
ret = new EachArray(this._content, keyName, this);
|
11467
|
-
Ember.defineProperty(this, keyName, null, ret);
|
11468
|
-
this.beginObservingContentKey(keyName);
|
11469
|
-
return ret;
|
11470
|
-
},
|
11471
|
-
|
11472
|
-
// ..........................................................
|
11473
|
-
// ARRAY CHANGES
|
11474
|
-
// Invokes whenever the content array itself changes.
|
11475
|
-
|
11476
|
-
arrayWillChange: function(content, idx, removedCnt, addedCnt) {
|
11477
|
-
var keys = this._keys, key, array, lim;
|
11706
|
+
Adds an object to the set. Only non-`null` objects can be added to a set
|
11707
|
+
and those can only be added once. If the object is already in the set or
|
11708
|
+
the passed value is null this method will have no effect.
|
11478
11709
|
|
11479
|
-
|
11480
|
-
Ember.beginPropertyChanges(this);
|
11710
|
+
This is an alias for `Ember.MutableEnumerable.addObject()`.
|
11481
11711
|
|
11482
|
-
|
11483
|
-
|
11712
|
+
```javascript
|
11713
|
+
var colors = new Ember.Set();
|
11714
|
+
colors.add("blue"); // ["blue"]
|
11715
|
+
colors.add("blue"); // ["blue"]
|
11716
|
+
colors.add("red"); // ["blue", "red"]
|
11717
|
+
colors.add(null); // ["blue", "red"]
|
11718
|
+
colors.add(undefined); // ["blue", "red"]
|
11719
|
+
```
|
11484
11720
|
|
11485
|
-
|
11721
|
+
@method add
|
11722
|
+
@param {Object} obj The object to add.
|
11723
|
+
@return {Ember.Set} The set itself.
|
11724
|
+
*/
|
11725
|
+
add: Ember.aliasMethod('addObject'),
|
11486
11726
|
|
11487
|
-
|
11488
|
-
|
11727
|
+
/**
|
11728
|
+
Removes the object from the set if it is found. If you pass a `null` value
|
11729
|
+
or an object that is already not in the set, this method will have no
|
11730
|
+
effect. This is an alias for `Ember.MutableEnumerable.removeObject()`.
|
11489
11731
|
|
11490
|
-
|
11491
|
-
Ember.
|
11492
|
-
|
11732
|
+
```javascript
|
11733
|
+
var colors = new Ember.Set(["red", "green", "blue"]);
|
11734
|
+
colors.remove("red"); // ["blue", "green"]
|
11735
|
+
colors.remove("purple"); // ["blue", "green"]
|
11736
|
+
colors.remove(null); // ["blue", "green"]
|
11737
|
+
```
|
11493
11738
|
|
11494
|
-
|
11495
|
-
|
11739
|
+
@method remove
|
11740
|
+
@param {Object} obj The object to remove
|
11741
|
+
@return {Ember.Set} The set itself.
|
11742
|
+
*/
|
11743
|
+
remove: Ember.aliasMethod('removeObject'),
|
11496
11744
|
|
11497
|
-
|
11498
|
-
|
11745
|
+
/**
|
11746
|
+
Removes the last element from the set and returns it, or `null` if it's empty.
|
11499
11747
|
|
11500
|
-
|
11501
|
-
|
11748
|
+
```javascript
|
11749
|
+
var colors = new Ember.Set(["green", "blue"]);
|
11750
|
+
colors.pop(); // "blue"
|
11751
|
+
colors.pop(); // "green"
|
11752
|
+
colors.pop(); // null
|
11753
|
+
```
|
11502
11754
|
|
11503
|
-
|
11755
|
+
@method pop
|
11756
|
+
@return {Object} The removed object from the set or null.
|
11757
|
+
*/
|
11758
|
+
pop: function() {
|
11759
|
+
if (get(this, 'isFrozen')) throw new Error(Ember.FROZEN_ERROR);
|
11760
|
+
var obj = this.length > 0 ? this[this.length-1] : null;
|
11761
|
+
this.remove(obj);
|
11762
|
+
return obj;
|
11763
|
+
},
|
11504
11764
|
|
11505
|
-
|
11506
|
-
|
11765
|
+
/**
|
11766
|
+
Inserts the given object on to the end of the set. It returns
|
11767
|
+
the set itself.
|
11507
11768
|
|
11508
|
-
Ember.
|
11509
|
-
Ember.endPropertyChanges(this);
|
11510
|
-
},
|
11769
|
+
This is an alias for `Ember.MutableEnumerable.addObject()`.
|
11511
11770
|
|
11512
|
-
|
11513
|
-
|
11514
|
-
|
11771
|
+
```javascript
|
11772
|
+
var colors = new Ember.Set();
|
11773
|
+
colors.push("red"); // ["red"]
|
11774
|
+
colors.push("green"); // ["red", "green"]
|
11775
|
+
colors.push("blue"); // ["red", "green", "blue"]
|
11776
|
+
```
|
11515
11777
|
|
11516
|
-
|
11517
|
-
|
11518
|
-
|
11519
|
-
|
11520
|
-
},
|
11778
|
+
@method push
|
11779
|
+
@return {Ember.Set} The set itself.
|
11780
|
+
*/
|
11781
|
+
push: Ember.aliasMethod('addObject'),
|
11521
11782
|
|
11522
|
-
|
11523
|
-
if
|
11524
|
-
this.stopObservingContentKey(eventName.slice(0, -7));
|
11525
|
-
}
|
11526
|
-
},
|
11783
|
+
/**
|
11784
|
+
Removes the last element from the set and returns it, or `null` if it's empty.
|
11527
11785
|
|
11528
|
-
|
11529
|
-
// CONTENT KEY OBSERVING
|
11530
|
-
// Actual watch keys on the source content.
|
11786
|
+
This is an alias for `Ember.Set.pop()`.
|
11531
11787
|
|
11532
|
-
|
11533
|
-
var
|
11534
|
-
|
11535
|
-
|
11536
|
-
|
11537
|
-
|
11538
|
-
len = get(content, 'length');
|
11539
|
-
addObserverForContentKey(content, keyName, this, 0, len);
|
11540
|
-
} else {
|
11541
|
-
keys[keyName]++;
|
11542
|
-
}
|
11543
|
-
},
|
11788
|
+
```javascript
|
11789
|
+
var colors = new Ember.Set(["green", "blue"]);
|
11790
|
+
colors.shift(); // "blue"
|
11791
|
+
colors.shift(); // "green"
|
11792
|
+
colors.shift(); // null
|
11793
|
+
```
|
11544
11794
|
|
11545
|
-
|
11546
|
-
|
11547
|
-
|
11548
|
-
|
11549
|
-
len = get(content, 'length');
|
11550
|
-
removeObserverForContentKey(content, keyName, this, 0, len);
|
11551
|
-
}
|
11552
|
-
},
|
11795
|
+
@method shift
|
11796
|
+
@return {Object} The removed object from the set or null.
|
11797
|
+
*/
|
11798
|
+
shift: Ember.aliasMethod('pop'),
|
11553
11799
|
|
11554
|
-
|
11555
|
-
|
11556
|
-
|
11800
|
+
/**
|
11801
|
+
Inserts the given object on to the end of the set. It returns
|
11802
|
+
the set itself.
|
11557
11803
|
|
11558
|
-
|
11559
|
-
Ember.propertyDidChange(this, keyName);
|
11560
|
-
}
|
11804
|
+
This is an alias of `Ember.Set.push()`
|
11561
11805
|
|
11562
|
-
|
11806
|
+
```javascript
|
11807
|
+
var colors = new Ember.Set();
|
11808
|
+
colors.unshift("red"); // ["red"]
|
11809
|
+
colors.unshift("green"); // ["red", "green"]
|
11810
|
+
colors.unshift("blue"); // ["red", "green", "blue"]
|
11811
|
+
```
|
11563
11812
|
|
11813
|
+
@method unshift
|
11814
|
+
@return {Ember.Set} The set itself.
|
11815
|
+
*/
|
11816
|
+
unshift: Ember.aliasMethod('push'),
|
11564
11817
|
|
11818
|
+
/**
|
11819
|
+
Adds each object in the passed enumerable to the set.
|
11565
11820
|
|
11566
|
-
|
11821
|
+
This is an alias of `Ember.MutableEnumerable.addObjects()`
|
11567
11822
|
|
11823
|
+
```javascript
|
11824
|
+
var colors = new Ember.Set();
|
11825
|
+
colors.addEach(["red", "green", "blue"]); // ["red", "green", "blue"]
|
11826
|
+
```
|
11568
11827
|
|
11828
|
+
@method addEach
|
11829
|
+
@param {Ember.Enumerable} objects the objects to add.
|
11830
|
+
@return {Ember.Set} The set itself.
|
11831
|
+
*/
|
11832
|
+
addEach: Ember.aliasMethod('addObjects'),
|
11569
11833
|
|
11570
|
-
|
11571
|
-
|
11572
|
-
@module ember
|
11573
|
-
@submodule ember-runtime
|
11574
|
-
*/
|
11834
|
+
/**
|
11835
|
+
Removes each object in the passed enumerable to the set.
|
11575
11836
|
|
11837
|
+
This is an alias of `Ember.MutableEnumerable.removeObjects()`
|
11576
11838
|
|
11577
|
-
|
11839
|
+
```javascript
|
11840
|
+
var colors = new Ember.Set(["red", "green", "blue"]);
|
11841
|
+
colors.removeEach(["red", "blue"]); // ["green"]
|
11842
|
+
```
|
11578
11843
|
|
11579
|
-
|
11580
|
-
|
11581
|
-
|
11582
|
-
|
11844
|
+
@method removeEach
|
11845
|
+
@param {Ember.Enumerable} objects the objects to remove.
|
11846
|
+
@return {Ember.Set} The set itself.
|
11847
|
+
*/
|
11848
|
+
removeEach: Ember.aliasMethod('removeObjects'),
|
11583
11849
|
|
11584
|
-
//
|
11585
|
-
//
|
11586
|
-
|
11587
|
-
|
11588
|
-
|
11589
|
-
|
11850
|
+
// ..........................................................
|
11851
|
+
// PRIVATE ENUMERABLE SUPPORT
|
11852
|
+
//
|
11853
|
+
|
11854
|
+
init: function(items) {
|
11855
|
+
this._super();
|
11856
|
+
if (items) this.addObjects(items);
|
11590
11857
|
},
|
11591
11858
|
|
11592
|
-
|
11859
|
+
// implement Ember.Enumerable
|
11860
|
+
nextObject: function(idx) {
|
11593
11861
|
return this[idx];
|
11594
11862
|
},
|
11595
11863
|
|
11596
|
-
//
|
11597
|
-
|
11598
|
-
|
11599
|
-
|
11600
|
-
|
11601
|
-
// if we replaced exactly the same number of items, then pass only the
|
11602
|
-
// replaced range. Otherwise, pass the full remaining array length
|
11603
|
-
// since everything has shifted
|
11604
|
-
var len = objects ? get(objects, 'length') : 0;
|
11605
|
-
this.arrayContentWillChange(idx, amt, len);
|
11864
|
+
// more optimized version
|
11865
|
+
firstObject: Ember.computed(function() {
|
11866
|
+
return this.length > 0 ? this[0] : undefined;
|
11867
|
+
}),
|
11606
11868
|
|
11607
|
-
|
11608
|
-
|
11609
|
-
|
11610
|
-
|
11611
|
-
this.splice.apply(this,args) ;
|
11612
|
-
}
|
11869
|
+
// more optimized version
|
11870
|
+
lastObject: Ember.computed(function() {
|
11871
|
+
return this.length > 0 ? this[this.length-1] : undefined;
|
11872
|
+
}),
|
11613
11873
|
|
11614
|
-
|
11615
|
-
|
11616
|
-
|
11874
|
+
// implements Ember.MutableEnumerable
|
11875
|
+
addObject: function(obj) {
|
11876
|
+
if (get(this, 'isFrozen')) throw new Error(Ember.FROZEN_ERROR);
|
11877
|
+
if (none(obj)) return this; // nothing to do
|
11617
11878
|
|
11618
|
-
|
11619
|
-
|
11620
|
-
|
11621
|
-
|
11622
|
-
if ((value !== undefined) && ret === undefined) {
|
11623
|
-
ret = this[key] = value;
|
11624
|
-
}
|
11625
|
-
return ret ;
|
11626
|
-
},
|
11879
|
+
var guid = guidFor(obj),
|
11880
|
+
idx = this[guid],
|
11881
|
+
len = get(this, 'length'),
|
11882
|
+
added ;
|
11627
11883
|
|
11628
|
-
|
11629
|
-
// specialized version
|
11630
|
-
indexOf: function(object, startAt) {
|
11631
|
-
var idx, len = this.length;
|
11884
|
+
if (idx>=0 && idx<len && (this[idx] === obj)) return this; // added
|
11632
11885
|
|
11633
|
-
|
11634
|
-
else startAt = (startAt < 0) ? Math.ceil(startAt) : Math.floor(startAt);
|
11635
|
-
if (startAt < 0) startAt += len;
|
11886
|
+
added = [obj];
|
11636
11887
|
|
11637
|
-
|
11638
|
-
|
11639
|
-
}
|
11640
|
-
return -1;
|
11641
|
-
},
|
11888
|
+
this.enumerableContentWillChange(null, added);
|
11889
|
+
Ember.propertyWillChange(this, 'lastObject');
|
11642
11890
|
|
11643
|
-
|
11644
|
-
|
11891
|
+
len = get(this, 'length');
|
11892
|
+
this[guid] = len;
|
11893
|
+
this[len] = obj;
|
11894
|
+
set(this, 'length', len+1);
|
11645
11895
|
|
11646
|
-
|
11647
|
-
|
11648
|
-
if (startAt < 0) startAt += len;
|
11896
|
+
Ember.propertyDidChange(this, 'lastObject');
|
11897
|
+
this.enumerableContentDidChange(null, added);
|
11649
11898
|
|
11650
|
-
|
11651
|
-
if (this[idx] === object) return idx ;
|
11652
|
-
}
|
11653
|
-
return -1;
|
11899
|
+
return this;
|
11654
11900
|
},
|
11655
11901
|
|
11656
|
-
|
11657
|
-
|
11658
|
-
|
11659
|
-
|
11902
|
+
// implements Ember.MutableEnumerable
|
11903
|
+
removeObject: function(obj) {
|
11904
|
+
if (get(this, 'isFrozen')) throw new Error(Ember.FROZEN_ERROR);
|
11905
|
+
if (none(obj)) return this; // nothing to do
|
11660
11906
|
|
11661
|
-
|
11662
|
-
|
11663
|
-
|
11907
|
+
var guid = guidFor(obj),
|
11908
|
+
idx = this[guid],
|
11909
|
+
len = get(this, 'length'),
|
11910
|
+
isFirst = idx === 0,
|
11911
|
+
isLast = idx === len-1,
|
11912
|
+
last, removed;
|
11664
11913
|
|
11665
|
-
// Remove any methods implemented natively so we don't override them
|
11666
|
-
var ignore = ['length'];
|
11667
|
-
Ember.EnumerableUtils.forEach(NativeArray.keys(), function(methodName) {
|
11668
|
-
if (Array.prototype[methodName]) ignore.push(methodName);
|
11669
|
-
});
|
11670
11914
|
|
11671
|
-
if (
|
11672
|
-
|
11673
|
-
}
|
11915
|
+
if (idx>=0 && idx<len && (this[idx] === obj)) {
|
11916
|
+
removed = [obj];
|
11674
11917
|
|
11675
|
-
|
11676
|
-
|
11677
|
-
|
11678
|
-
have `Ember.EXTEND_PROTOTYPES or `Ember.EXTEND_PROTOTYPES.Array` set to
|
11679
|
-
false, this will be applied automatically. Otherwise you can apply the mixin
|
11680
|
-
at anytime by calling `Ember.NativeArray.activate`.
|
11918
|
+
this.enumerableContentWillChange(removed, null);
|
11919
|
+
if (isFirst) { Ember.propertyWillChange(this, 'firstObject'); }
|
11920
|
+
if (isLast) { Ember.propertyWillChange(this, 'lastObject'); }
|
11681
11921
|
|
11682
|
-
|
11683
|
-
|
11684
|
-
|
11685
|
-
|
11686
|
-
|
11687
|
-
|
11688
|
-
@uses Ember.Freezable
|
11689
|
-
*/
|
11690
|
-
Ember.NativeArray = NativeArray;
|
11922
|
+
// swap items - basically move the item to the end so it can be removed
|
11923
|
+
if (idx < len-1) {
|
11924
|
+
last = this[len-1];
|
11925
|
+
this[idx] = last;
|
11926
|
+
this[guidFor(last)] = idx;
|
11927
|
+
}
|
11691
11928
|
|
11692
|
-
|
11693
|
-
|
11694
|
-
|
11929
|
+
delete this[guid];
|
11930
|
+
delete this[len-1];
|
11931
|
+
set(this, 'length', len-1);
|
11695
11932
|
|
11696
|
-
|
11697
|
-
|
11698
|
-
|
11699
|
-
|
11700
|
-
Ember.A = function(arr){
|
11701
|
-
if (arr === undefined) { arr = []; }
|
11702
|
-
return Ember.Array.detect(arr) ? arr : Ember.NativeArray.apply(arr);
|
11703
|
-
};
|
11933
|
+
if (isFirst) { Ember.propertyDidChange(this, 'firstObject'); }
|
11934
|
+
if (isLast) { Ember.propertyDidChange(this, 'lastObject'); }
|
11935
|
+
this.enumerableContentDidChange(removed, null);
|
11936
|
+
}
|
11704
11937
|
|
11705
|
-
|
11706
|
-
|
11707
|
-
this method more than once is safe.
|
11938
|
+
return this;
|
11939
|
+
},
|
11708
11940
|
|
11709
|
-
|
11710
|
-
|
11711
|
-
|
11712
|
-
|
11713
|
-
*/
|
11714
|
-
Ember.NativeArray.activate = function() {
|
11715
|
-
NativeArray.apply(Array.prototype);
|
11941
|
+
// optimized version
|
11942
|
+
contains: function(obj) {
|
11943
|
+
return this[guidFor(obj)]>=0;
|
11944
|
+
},
|
11716
11945
|
|
11717
|
-
|
11718
|
-
|
11946
|
+
copy: function() {
|
11947
|
+
var C = this.constructor, ret = new C(), loc = get(this, 'length');
|
11948
|
+
set(ret, 'length', loc);
|
11949
|
+
while(--loc>=0) {
|
11950
|
+
ret[loc] = this[loc];
|
11951
|
+
ret[guidFor(this[loc])] = loc;
|
11952
|
+
}
|
11953
|
+
return ret;
|
11954
|
+
},
|
11719
11955
|
|
11720
|
-
|
11721
|
-
|
11722
|
-
|
11956
|
+
toString: function() {
|
11957
|
+
var len = this.length, idx, array = [];
|
11958
|
+
for(idx = 0; idx < len; idx++) {
|
11959
|
+
array[idx] = this[idx];
|
11960
|
+
}
|
11961
|
+
return fmt("Ember.Set<%@>", [array.join(',')]);
|
11962
|
+
}
|
11723
11963
|
|
11964
|
+
});
|
11724
11965
|
|
11725
11966
|
})();
|
11726
11967
|
|
@@ -11728,7 +11969,6 @@ if (Ember.EXTEND_PROTOTYPES === true || Ember.EXTEND_PROTOTYPES.Array) {
|
|
11728
11969
|
|
11729
11970
|
(function() {
|
11730
11971
|
var DeferredMixin = Ember.DeferredMixin, // mixins/deferred
|
11731
|
-
EmberObject = Ember.Object, // system/object
|
11732
11972
|
get = Ember.get;
|
11733
11973
|
|
11734
11974
|
var Deferred = Ember.Object.extend(DeferredMixin);
|
@@ -12051,7 +12291,6 @@ Ember.SortableMixin = Ember.Mixin.create(Ember.MutableEnumerable, {
|
|
12051
12291
|
|
12052
12292
|
if (isSorted) {
|
12053
12293
|
var addedObjects = array.slice(idx, idx+addedCount);
|
12054
|
-
var arrangedContent = get(this, 'arrangedContent');
|
12055
12294
|
|
12056
12295
|
forEach(addedObjects, function(item) {
|
12057
12296
|
this.insertItemSorted(item);
|
@@ -12121,8 +12360,8 @@ Ember.SortableMixin = Ember.Mixin.create(Ember.MutableEnumerable, {
|
|
12121
12360
|
@submodule ember-runtime
|
12122
12361
|
*/
|
12123
12362
|
|
12124
|
-
var get = Ember.get, set = Ember.set,
|
12125
|
-
|
12363
|
+
var get = Ember.get, set = Ember.set, forEach = Ember.EnumerableUtils.forEach,
|
12364
|
+
replace = Ember.EnumerableUtils.replace;
|
12126
12365
|
|
12127
12366
|
/**
|
12128
12367
|
`Ember.ArrayController` provides a way for you to publish a collection of
|
@@ -12445,7 +12684,7 @@ Ember.State = Ember.Object.extend(Ember.Evented,
|
|
12445
12684
|
},
|
12446
12685
|
|
12447
12686
|
init: function() {
|
12448
|
-
var states = get(this, 'states')
|
12687
|
+
var states = get(this, 'states');
|
12449
12688
|
set(this, 'childStates', Ember.A());
|
12450
12689
|
set(this, 'eventTransitions', get(this, 'eventTransitions') || {});
|
12451
12690
|
|
@@ -12595,7 +12834,7 @@ Ember.State.reopenClass({
|
|
12595
12834
|
transitionTo: function(target) {
|
12596
12835
|
|
12597
12836
|
var transitionFunction = function(stateManager, contextOrEvent) {
|
12598
|
-
var contexts = [],
|
12837
|
+
var contexts = [],
|
12599
12838
|
Event = Ember.$ && Ember.$.Event;
|
12600
12839
|
|
12601
12840
|
if (contextOrEvent && (Event && contextOrEvent instanceof Event)) {
|