//>>built
define("dojox/mvc/EditModelRefController",["dojo/_base/declare","dojo/_base/lang","./getPlainValue","./getStateful","./ModelRefController"],function(e,c,f,g,h){return e("dojox.mvc.EditModelRefController",h,{getStatefulOptions:null,getPlainValueOptions:null,holdModelUntilCommit:!1,originalModel:null,sourceModel:null,_refOriginalModelProp:"originalModel",_refSourceModelProp:"sourceModel",_refEditModelProp:"model",postscript:function(a,c){for(var b in{getStatefulOptions:1,getPlainValueOptions:1,holdModelUntilCommit:1}){var d=
(a||{})[b];"undefined"!=typeof d&&(this[b]=d)}this.inherited(arguments)},set:function(a,c){if(a==this._refSourceModelProp){var b=c;this[this._refSourceModelProp]!==b&&(this.set(this._refOriginalModelProp,this.holdModelUntilCommit?b:this.cloneModel(b)),this.set(this._refEditModelProp,this.holdModelUntilCommit?this.cloneModel(b):b))}this.inherited(arguments)},cloneModel:function(a){a=c.isFunction((a||{}).set)&&c.isFunction((a||{}).watch)?f(a,this.getPlainValueOptions):a;return g(a,this.getStatefulOptions)},
commit:function(){this.set(this.holdModelUntilCommit?this._refSourceModelProp:this._refOriginalModelProp,this.cloneModel(this.get(this._refEditModelProp)))},reset:function(){this.set(this.holdModelUntilCommit?this._refEditModelProp:this._refSourceModelProp,this.cloneModel(this.get(this._refOriginalModelProp)))},hasControllerProperty:function(a){return this.inherited(arguments)||a==this._refOriginalModelProp||a==this._refSourceModelProp}})});