//>>built
define("dojox/mvc/_atBindingMixin","dojo/_base/array dojo/_base/lang dojo/_base/declare dojo/has dojo/Stateful ./resolve ./sync".split(" "),function(t,p,f,m,w,u,x){function y(a){var b;try{b=require("dijit/registry")}catch(c){return}for(a=a.domNode&&a.domNode.parentNode;a;){if(a=b.getEnclosingWidget(a)){var d=a._relTargetProp||"target";if((p.isFunction(a.get)?a.get(d):a[d])||d in a.constructor.prototype)return a}a=a&&a.domNode.parentNode}}function q(a,b,d,c,g){function v(){h.Two&&h.Two.unwatch();delete h.Two;
var k=e&&(p.isFunction(e.get)?e.get(f):e[f]),n=u(a,k),k=u(d,k);m("mvc-bindings-log-api")&&(!n||/^rel:/.test(a)&&!e)&&r(a,b);m("mvc-bindings-log-api")&&(!k||/^rel:/.test(d)&&!e)&&r(d,c);n&&k&&(!/^rel:/.test(a)&&!/^rel:/.test(d)||e)&&(n.set&&n.watch||"*"!=b?null==b?(p.isFunction(k.set)?k.set(c,n):k[c]=n,m("mvc-bindings-log-api")):h.Two=x(n,b,k,c,g):m("mvc-bindings-log-api")&&r(a,b))}var h={},e=y(d),f=e&&e._relTargetProp||"target";v();if(e&&/^rel:/.test(a)||/^rel:/.test(d)&&p.isFunction(e.set)&&p.isFunction(e.watch))h.rel=
e.watch(f,function(a,b,c){b!==c&&(m("mvc-bindings-log-api"),v())});var l={};l.unwatch=l.remove=function(){for(var a in h)h[a]&&h[a].unwatch(),delete h[a]};return l}m("mvc-bindings-log-api");var r=m("mvc-bindings-log-api")?function(a,b){console.warn(b+" could not be resolved"+("string"==typeof a?" with "+a:"")+".")}:"",l={dataBindAttr:"data-mvc-bindings",_dbpostscript:function(a,b){var d=this._refs=(a||{}).refs||{},c;for(c in a)if("dojox.mvc.at"==(a[c]||{}).atsignature){var g=a[c];delete a[c];d[c]=
g}var g=new w,f=this;g.toString=function(){return"[Mixin value of widget "+f.declaredClass+", "+(f.id||"NO ID")+"]"};g.canConvertToLoggable=!0;this._startAtWatchHandles(g);for(c in d)void 0!==g[c]&&((a=a||{})[c]=g[c]);this._stopAtWatchHandles()},_startAtWatchHandles:function(a){this.canConvertToLoggable=!0;var b=this._refs;if(b){var d=this._atWatchHandles=this._atWatchHandles||{};this._excludes=null;for(var c in b)b[c]&&"*"!=c&&(d[c]=q(b[c].target,b[c].targetProp,a||this,c,{bindDirection:b[c].bindDirection,
converter:b[c].converter,equals:b[c].equalsCallback}));"dojox.mvc.at"==(b["*"]||{}).atsignature&&(d["*"]=q(b["*"].target,b["*"].targetProp,a||this,"*",{bindDirection:b["*"].bindDirection,converter:b["*"].converter,equals:b["*"].equalsCallback}))}},_stopAtWatchHandles:function(){for(var a in this._atWatchHandles)this._atWatchHandles[a].unwatch(),delete this._atWatchHandles[a]},_setAtWatchHandle:function(a,b){if("ref"==a)throw Error(this+": 1.7 ref syntax used in conjunction with 1.8 dojox/mvc/at syntax, which is not supported.");
var d=this._atWatchHandles=this._atWatchHandles||{};d[a]&&(d[a].unwatch(),delete d[a]);this._excludes=this[a]=null;this._started?d[a]=q(b.target,b.targetProp,this,a,{bindDirection:b.bindDirection,converter:b.converter,equals:b.equalsCallback}):this._refs[a]=b},_setBind:function(a){a=eval("({"+a+"})");for(var b in a){var d=a[b];"dojox.mvc.at"!=(d||{}).atsignature?console.warn(b+" in "+dataBindAttr+" is not a data binding handle."):this._setAtWatchHandle(b,d)}},_getExcludesAttr:function(){if(this._excludes)return this._excludes;
var a=[],b;for(b in this._atWatchHandles)"*"!=b&&a.push(b);return a},_getPropertiesAttr:function(){if(this.constructor._attribs)return this.constructor._attribs;var a=["onClick"].concat(this.constructor._setterAttrs);t.forEach(["id","excludes","properties","ref","binding"],function(b){b=t.indexOf(a,b);0<=b&&a.splice(b,1)});return this.constructor._attribs=a}};l[l.dataBindAttr]="";f=f("dojox/mvc/_atBindingMixin",null,l);f.mixin=l;return f});
//# sourceMappingURL=_atBindingMixin.js.map