/* Copyright (c) 2004-2012, 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=_39[i];m=f._meta;f=m?m.ctor:f;if(f){f.apply(this,_3c?_3c[i]:a);}}f=this.postscript;if(f){f.apply(this,_3b);}};};function _3e(_3f,_40){return function(){var a=arguments,t=a,a0=a[0],f;if(!(this instanceof a.callee)){return _3d(a);}if(_40){if(a0){f=a0.preamble;if(f){t=f.apply(this,t)||t;}}f=this.preamble;if(f){f.apply(this,t);}}if(_3f){_3f.apply(this,a);}f=this.postscript;if(f){f.apply(this,a);}};};function _41(_42){return function(){var a=arguments,i=0,f,m;if(!(this instanceof a.callee)){return _3d(a);}for(;f=_42[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 _43(_44,_45,_46){return function(){var b,m,f,i=0,_47=1;if(_46){i=_45.length-1;_47=-1;}for(;b=_45[i];i+=_47){m=b._meta;f=(m?m.hidden:b.prototype)[_44];if(f){f.apply(this,arguments);}}};};function _48(_49){_6.prototype=_49.prototype;var t=new _6;_6.prototype=null;return t;};function _3d(_4a){var _4b=_4a.callee,t=_48(_4b);_4b.apply(t,_4a);return t;};function _35(_4c,_4d,_4e){if(typeof _4c!="string"){_4e=_4d;_4d=_4c;_4c="";}_4e=_4e||{};var _4f,i,t,_50,_51,_52,_53,_54=1,_55=_4d;if(_5.call(_4d)=="[object Array]"){_52=_c(_4d,_4c);t=_52[0];_54=_52.length-t;_4d=_52[_54];}else{_52=[0];if(_4d){if(_5.call(_4d)=="[object Function]"){t=_4d._meta;_52=_52.concat(t?t.bases:_4d);}else{_9("base class is not a callable constructor.",_4c);}}else{if(_4d!==null){_9("unknown base class. Did you use dojo.require to pull it in?",_4c);}}}if(_4d){for(i=_54-1;;--i){_4f=_48(_4d);if(!i){break;}t=_52[i];(t._meta?_29:_4)(_4f,t.prototype);_50=new Function;_50.superclass=_4d;_50.prototype=_4f;_4d=_4f.constructor=_50;}}else{_4f={};}_35.safeMixin(_4f,_4e);t=_4e.constructor;if(t!==op.constructor){t.nom=_8;_4f.constructor=t;}for(i=_54-1;i;--i){t=_52[i]._meta;if(t&&t.chains){_53=_4(_53||{},t.chains);}}if(_4f["-chains-"]){_53=_4(_53||{},_4f["-chains-"]);}t=!_53||!_53.hasOwnProperty(_8);_52[0]=_50=(_53&&_53.constructor==="manual")?_41(_52):(_52.length==1?_3e(_4e.constructor,t):_38(_52,t));_50._meta={bases:_52,hidden:_4e,chains:_53,parents:_55,ctor:_4e.constructor};_50.superclass=_4d&&_4d.prototype;_50.extend=_33;_50.createSubclass=_36;_50.prototype=_4f;_4f.constructor=_50;_4f.getInherited=_21;_4f.isInstanceOf=_27;_4f.inherited=_26;_4f.__inherited=_17;if(_4c){_4f.declaredClass=_4c;_3.setObject(_4c,_50);}if(_53){for(_51 in _53){if(_4f[_51]&&typeof _53[_51]=="string"&&_51!=_8){t=_4f[_51]=_43(_51,_52,_53[_51]==="after");t.nom=_51;}}}return _50;};_1.safeMixin=_35.safeMixin=_2e;_1.declare=_35;return _35;});