//>>built
define("dojox/mvc/computed",["dojo/_base/array","dojo/_base/lang","dojo/has"],function(h,n,v){function w(b,a,e){var d;b&&n.isFunction(b.watch)&&(d=b.watch(a,function(f,p,c){y(p,c)||e(c,p)}));return{remove:function(){d&&d.remove()}}}function k(b){return h.map(b,function(a){return a.each?h.map(a.target,function(e){return e.get?e.get(a.targetProp):e[a.targetProp]}):a.target.get?a.target.get(a.targetProp):a.target[a.targetProp]})}function u(b){for(var a=null;a=b.shift();)a.remove()}v.add("object-is-api",
n.isFunction(Object.is));var q=Array.prototype,y=v("object-is-api")?Object.is:function(b,a){return b===a&&(0!==b||1/b===1/a)||b!==b&&a!==a};return function(b,a,e){function d(c){try{var l=e.apply(b,c);var r=!0}catch(t){}r&&(n.isFunction(b.set)?b.set(a,l):b[a]=l)}if(null==b)throw Error("Computed property cannot be applied to null.");if("*"===a)throw Error("Wildcard property cannot be used for computed properties.");var f=q.slice.call(arguments,3),p=h.map(f,function(c,l){function r(m){return w(m,c.targetProp,
function(){d(k(f))})}if("*"===c.targetProp)throw Error("Wildcard property cannot be used for computed properties.");if(c.each){var t,x=h.map(c.target,r);c.target&&n.isFunction(c.target.watchElements)&&(t=c.target.watchElements(function(m,g,z){u(q.splice.apply(x,[m,g.length].concat(h.map(z,r))));d(k(f))}));return{remove:function(){t&&t.remove();u(x)}}}return w(c.target,c.targetProp,function(m){var g=[];q.push.apply(g,k(f.slice(0,l)));g.push(m);q.push.apply(g,k(f.slice(l+1)));d(g)})});d(k(f));return{remove:function(){u(p)}}}});