/* Copyright (c) 2004-2011, The Dojo Foundation All Rights Reserved. Available via Academic Free License >= 2.1 OR the modified BSD license. see: http://dojotoolkit.org/license for details */ //>>built define("dojo/_base/declare",["./kernel","../has","./lang"],function(_1,_2,_3){var _4=_3.mixin,op=Object.prototype,_5=op.toString,_6=new Function,_7=0,_8="constructor";function _9(_a,_b){throw new Error("declare"+(_b?" "+_b:"")+": "+_a);};function _c(_d,_e){var _f=[],_10=[{cls:0,refs:[]}],_11={},_12=1,l=_d.length,i=0,j,lin,_13,top,_14,rec,_15,_16;for(;i=0;--j){_14=lin[j].prototype;if(!_14.hasOwnProperty("declaredClass")){_14.declaredClass="uniqName_"+(_7++);}_15=_14.declaredClass;if(!_11.hasOwnProperty(_15)){_11[_15]={count:0,refs:[],cls:lin[j]};++_12;}rec=_11[_15];if(top&&top!==rec){rec.refs.push(top);++top.count;}top=rec;}++top.count;_10[0].refs.push(top);}while(_10.length){top=_10.pop();_f.push(top.cls);--_12;while(_16=top.refs,_16.length==1){top=_16[0];if(!top||--top.count){top=0;break;}_f.push(top.cls);--_12;}if(top){for(i=0,l=_16.length;i=0;--i){f=_37[i];m=f._meta;f=m?m.ctor:f;if(f){f.apply(this,_3a?_3a[i]:a);}}f=this.postscript;if(f){f.apply(this,_39);}};};function _3c(_3d,_3e){return function(){var a=arguments,t=a,a0=a[0],f;if(!(this instanceof a.callee)){return _3b(a);}if(_3e){if(a0){f=a0.preamble;if(f){t=f.apply(this,t)||t;}}f=this.preamble;if(f){f.apply(this,t);}}if(_3d){_3d.apply(this,a);}f=this.postscript;if(f){f.apply(this,a);}};};function _3f(_40){return function(){var a=arguments,i=0,f,m;if(!(this instanceof a.callee)){return _3b(a);}for(;f=_40[i];++i){m=f._meta;f=m?m.ctor:f;if(f){f.apply(this,a);break;}}f=this.postscript;if(f){f.apply(this,a);}};};function _41(_42,_43,_44){return function(){var b,m,f,i=0,_45=1;if(_44){i=_43.length-1;_45=-1;}for(;b=_43[i];i+=_45){m=b._meta;f=(m?m.hidden:b.prototype)[_42];if(f){f.apply(this,arguments);}}};};function _46(_47){_6.prototype=_47.prototype;var t=new _6;_6.prototype=null;return t;};function _3b(_48){var _49=_48.callee,t=_46(_49);_49.apply(t,_48);return t;};function _35(_4a,_4b,_4c){if(typeof _4a!="string"){_4c=_4b;_4b=_4a;_4a="";}_4c=_4c||{};var _4d,i,t,_4e,_4f,_50,_51,_52=1,_53=_4b;if(_5.call(_4b)=="[object Array]"){_50=_c(_4b,_4a);t=_50[0];_52=_50.length-t;_4b=_50[_52];}else{_50=[0];if(_4b){if(_5.call(_4b)=="[object Function]"){t=_4b._meta;_50=_50.concat(t?t.bases:_4b);}else{_9("base class is not a callable constructor.",_4a);}}else{if(_4b!==null){_9("unknown base class. Did you use dojo.require to pull it in?",_4a);}}}if(_4b){for(i=_52-1;;--i){_4d=_46(_4b);if(!i){break;}t=_50[i];(t._meta?_29:_4)(_4d,t.prototype);_4e=new Function;_4e.superclass=_4b;_4e.prototype=_4d;_4b=_4d.constructor=_4e;}}else{_4d={};}_35.safeMixin(_4d,_4c);t=_4c.constructor;if(t!==op.constructor){t.nom=_8;_4d.constructor=t;}for(i=_52-1;i;--i){t=_50[i]._meta;if(t&&t.chains){_51=_4(_51||{},t.chains);}}if(_4d["-chains-"]){_51=_4(_51||{},_4d["-chains-"]);}t=!_51||!_51.hasOwnProperty(_8);_50[0]=_4e=(_51&&_51.constructor==="manual")?_3f(_50):(_50.length==1?_3c(_4c.constructor,t):_36(_50,t));_4e._meta={bases:_50,hidden:_4c,chains:_51,parents:_53,ctor:_4c.constructor};_4e.superclass=_4b&&_4b.prototype;_4e.extend=_33;_4e.prototype=_4d;_4d.constructor=_4e;_4d.getInherited=_21;_4d.isInstanceOf=_27;_4d.inherited=_26;_4d.__inherited=_17;if(_4a){_4d.declaredClass=_4a;_3.setObject(_4a,_4e);}if(_51){for(_4f in _51){if(_4d[_4f]&&typeof _51[_4f]=="string"&&_4f!=_8){t=_4d[_4f]=_41(_4f,_50,_51[_4f]==="after");t.nom=_4f;}}}return _4e;};_1.safeMixin=_35.safeMixin=_2e;_1.declare=_35;return _35;});