/*
	Copyright (c) 2004-2016, The JS 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/fx","./_base/lang ./Evented ./_base/kernel ./_base/array ./aspect ./_base/fx ./dom ./dom-style ./dom-geometry ./ready require".split(" "),function(e,v,k,l,f,m,r,u,w,n,x){k.isAsync||n(0,function(){x(["./fx/Toggler"])});k=k.fx={};n={_fire:function(a,b){this[a]&&this[a].apply(this,b||[]);return this}};var p=function(a){this._index=-1;this._animations=a||[];this._current=this._onAnimateCtx=this._onEndCtx=null;this.duration=0;l.forEach(this._animations,function(b){b&&("undefined"!=typeof b.duration&&
(this.duration+=b.duration),b.delay&&(this.duration+=b.delay))},this)};p.prototype=new v;e.extend(p,{_onAnimate:function(){this._fire("onAnimate",arguments)},_onEnd:function(){this._onAnimateCtx.remove();this._onEndCtx.remove();this._onAnimateCtx=this._onEndCtx=null;this._index+1==this._animations.length?this._fire("onEnd"):(this._current=this._animations[++this._index],this._onAnimateCtx=f.after(this._current,"onAnimate",e.hitch(this,"_onAnimate"),!0),this._onEndCtx=f.after(this._current,"onEnd",
e.hitch(this,"_onEnd"),!0),this._current.play(0,!0))},play:function(a,b){this._current||(this._current=this._animations[this._index=0]);if(!b&&"playing"==this._current.status())return this;var c=f.after(this._current,"beforeBegin",e.hitch(this,function(){this._fire("beforeBegin")}),!0),d=f.after(this._current,"onBegin",e.hitch(this,function(h){this._fire("onBegin",arguments)}),!0),g=f.after(this._current,"onPlay",e.hitch(this,function(h){this._fire("onPlay",arguments);c.remove();d.remove();g.remove()}));
this._onAnimateCtx&&this._onAnimateCtx.remove();this._onAnimateCtx=f.after(this._current,"onAnimate",e.hitch(this,"_onAnimate"),!0);this._onEndCtx&&this._onEndCtx.remove();this._onEndCtx=f.after(this._current,"onEnd",e.hitch(this,"_onEnd"),!0);this._current.play.apply(this._current,arguments);return this},pause:function(){if(this._current){var a=f.after(this._current,"onPause",e.hitch(this,function(b){this._fire("onPause",arguments);a.remove()}),!0);this._current.pause()}return this},gotoPercent:function(a,
b){this.pause();var c=this.duration*a;this._current=null;l.some(this._animations,function(d,g){if(c<=d.duration)return this._current=d,this._index=g,!0;c-=d.duration;return!1},this);this._current&&this._current.gotoPercent(c/this._current.duration);b&&this.play();return this},stop:function(a){if(this._current){if(a){for(;this._index+1<this._animations.length;++this._index)this._animations[this._index].stop(!0);this._current=this._animations[this._index]}var b=f.after(this._current,"onStop",e.hitch(this,
function(c){this._fire("onStop",arguments);b.remove()}),!0);this._current.stop()}return this},status:function(){return this._current?this._current.status():"stopped"},destroy:function(){this.stop();this._onAnimateCtx&&this._onAnimateCtx.remove();this._onEndCtx&&this._onEndCtx.remove()}});e.extend(p,n);k.chain=function(a){return new p(e.isArray(a)?a:Array.prototype.slice.call(a,0))};var t=function(a){this._animations=a||[];this._connects=[];this.duration=this._finished=0;l.forEach(a,function(c){var d=
c.duration;c.delay&&(d+=c.delay);this.duration<d&&(this.duration=d);this._connects.push(f.after(c,"onEnd",e.hitch(this,"_onEnd"),!0))},this);this._pseudoAnimation=new m.Animation({curve:[0,1],duration:this.duration});var b=this;l.forEach("beforeBegin onBegin onPlay onAnimate onPause onStop onEnd".split(" "),function(c){b._connects.push(f.after(b._pseudoAnimation,c,function(){b._fire(c,arguments)},!0))})};e.extend(t,{_doAction:function(a,b){l.forEach(this._animations,function(c){c[a].apply(c,b)});
return this},_onEnd:function(){++this._finished>this._animations.length&&this._fire("onEnd")},_call:function(a,b){var c=this._pseudoAnimation;c[a].apply(c,b)},play:function(a,b){this._finished=0;this._doAction("play",arguments);this._call("play",arguments);return this},pause:function(){this._doAction("pause",arguments);this._call("pause",arguments);return this},gotoPercent:function(a,b){var c=this.duration*a;l.forEach(this._animations,function(d){d.gotoPercent(d.duration<c?1:c/d.duration,b)});this._call("gotoPercent",
arguments);return this},stop:function(a){this._doAction("stop",arguments);this._call("stop",arguments);return this},status:function(){return this._pseudoAnimation.status()},destroy:function(){this.stop();l.forEach(this._connects,function(a){a.remove()})}});e.extend(t,n);k.combine=function(a){return new t(e.isArray(a)?a:Array.prototype.slice.call(a,0))};k.wipeIn=function(a){var b=a.node=r.byId(a.node),c=b.style,d;a=m.animateProperty(e.mixin({properties:{height:{start:function(){d=c.overflow;c.overflow=
"hidden";if("hidden"==c.visibility||"none"==c.display)return c.height="1px",c.display="",c.visibility="",1;var h=u.get(b,"height");return Math.max(h,1)},end:function(){return b.scrollHeight}}}},a));var g=function(){c.height="auto";c.overflow=d};f.after(a,"onStop",g,!0);f.after(a,"onEnd",g,!0);return a};k.wipeOut=function(a){var b=(a.node=r.byId(a.node)).style,c;a=m.animateProperty(e.mixin({properties:{height:{end:1}}},a));f.after(a,"beforeBegin",function(){c=b.overflow;b.overflow="hidden";b.display=
""},!0);var d=function(){b.overflow=c;b.height="auto";b.display="none"};f.after(a,"onStop",d,!0);f.after(a,"onEnd",d,!0);return a};k.slideTo=function(a){var b=null,c=null,d=function(g){return function(){var h=u.getComputedStyle(g),q=h.position;b="absolute"==q?g.offsetTop:parseInt(h.top)||0;c="absolute"==q?g.offsetLeft:parseInt(h.left)||0;"absolute"!=q&&"relative"!=q&&(h=w.position(g,!0),b=h.y,c=h.x,g.style.position="absolute",g.style.top=b+"px",g.style.left=c+"px")}}(a.node=r.byId(a.node));d();a=
m.animateProperty(e.mixin({properties:{top:a.top||0,left:a.left||0}},a));f.after(a,"beforeBegin",d,!0);return a};return k});