//>>built
define("dojox/mobile/View","dojo/_base/array,dojo/_base/config,dojo/_base/connect,dojo/_base/declare,dojo/_base/lang,dojo/_base/sniff,dojo/_base/window,dojo/_base/Deferred,dojo/dom,dojo/dom-class,dojo/dom-construct,dojo/dom-geometry,dojo/dom-style,dijit/registry,dijit/_Contained,dijit/_Container,dijit/_WidgetBase,./ViewController,./common,./transition,./viewRegistry".split(","),function(l,p,j,x,n,o,f,u,v,g,y,w,i,q,z,A,B,E,r,C,s){n.getObject("dojox.mobile",!0);return x("dojox.mobile.View",[B,A,z],
{selected:!1,keepScrollPos:!0,tag:"div",baseClass:"mblView",constructor:function(a,b){if(b)v.byId(b).style.visibility="hidden"},destroy:function(){s.remove(this.id);this.inherited(arguments)},buildRendering:function(){this.domNode=this.containerNode=this.srcNodeRef||y.create(this.tag);this._animEndHandle=this.connect(this.domNode,"webkitAnimationEnd","onAnimationEnd");this._animStartHandle=this.connect(this.domNode,"webkitAnimationStart","onAnimationStart");if(!p.mblCSS3Transition)this._transEndHandle=
this.connect(this.domNode,"webkitTransitionEnd","onAnimationEnd");o("mblAndroid3Workaround")&&i.set(this.domNode,"webkitTransformStyle","preserve-3d");s.add(this);this.inherited(arguments)},startup:function(){if(!this._started){if(void 0===this._visible){var a=this.getSiblingViews(),b=location.hash&&location.hash.substring(1).split(/,/),c,f,g;l.forEach(a,function(a,d){-1!==l.indexOf(b,a.id)&&(c=a);0==d&&(g=a);a.selected&&(f=a);a._visible=!1},this);(c||f||g)._visible=!0}this._visible&&(this.show(!0,
!0),this.defer(function(){this.onStartView();j.publish("/dojox/mobile/startView",[this])}));if("visible"!=this.domNode.style.visibility)this.domNode.style.visibility="visible";this.inherited(arguments);a=this.getParent();(!a||!a.resize)&&this.resize();this._visible||this.hide()}},resize:function(){l.forEach(this.getChildren(),function(a){a.resize&&a.resize()})},onStartView:function(){},onBeforeTransitionIn:function(){},onAfterTransitionIn:function(){},onBeforeTransitionOut:function(){},onAfterTransitionOut:function(){},
_clearClasses:function(a){if(a){var b=[];l.forEach(n.trim(a.className||"").split(/\s+/),function(a){(a.match(/^mbl\w*View$/)||-1===a.indexOf("mbl"))&&b.push(a)},this);a.className=b.join(" ")}},_fixViewState:function(a){for(var b=this.domNode.parentNode.childNodes,c=0;c<b.length;c++){var f=b[c];1===f.nodeType&&g.contains(f,"mblView")&&this._clearClasses(f)}this._clearClasses(a);if(a=q.byNode(a))a._inProgress=!1},convertToId:function(a){return"string"==typeof a?a.replace(/^#?([^&?]+).*/,"$1"):a},_isBookmarkable:function(a){return a.moveTo&&
(p.mblForceBookmarkable||"#"===a.moveTo.charAt(0))&&!a.hashchange},performTransition:function(a,b,c,l,D){if(!this._inProgress){this._inProgress=!0;var e,d;if(a&&"object"===typeof a)e=a,d=b;else{e={moveTo:a,transitionDir:b,transition:c,context:l,method:D};d=[];for(var h=5;h<arguments.length;h++)d.push(arguments[h])}this._detail=e;this._optArgs=d;this._arguments=[e.moveTo,e.transitionDir,e.transition,e.context,e.method];if("#"!==e.moveTo){if(e.moveTo)d=this.convertToId(e.moveTo);else{if(!this._dummyNode)this._dummyNode=
f.doc.createElement("div"),f.body().appendChild(this._dummyNode);d=this._dummyNode}this.addTransitionInfo&&"string"==typeof e.moveTo&&this._isBookmarkable(e)&&this.addTransitionInfo(this.id,e.moveTo,{transitionDir:e.transitionDir,transition:e.transition});var h=this.domNode,m=h.offsetTop;if(d=this.toNode=v.byId(d)){d.style.visibility="hidden";d.style.display="";this._fixViewState(d);var k=q.byNode(d);if(k){if(p.mblAlwaysResizeOnTransition||!k._resized)r.resizeAll(null,k),k._resized=!0;if(e.transition&&
"none"!=e.transition)k.containerNode.style.paddingTop=m+"px";k.load&&k.load();k.movedFrom=h.id}o("mblAndroidWorkaround")&&!p.mblCSS3Transition&&e.transition&&"none"!=e.transition&&(i.set(d,"webkitTransformStyle","preserve-3d"),i.set(h,"webkitTransformStyle","preserve-3d"),g.add(d,"mblAndroidWorkaround"));this.onBeforeTransitionOut.apply(this,this._arguments);j.publish("/dojox/mobile/beforeTransitionOut",[this].concat(n._toArray(this._arguments)));if(k){if(this.keepScrollPos&&!this.getParent()){m=
f.body().scrollTop||f.doc.documentElement.scrollTop||f.global.pageYOffset||0;h._scrollTop=m;var t=1==e.transitionDir?0:d._scrollTop||0;d.style.top="0px";if(1<m||0!==t)h.style.top=t-m+"px",!1!==p.mblHideAddressBar&&setTimeout(function(){f.global.scrollTo(0,t||1)},0)}else d.style.top="0px";k.onBeforeTransitionIn.apply(k,this._arguments);j.publish("/dojox/mobile/beforeTransitionIn",[k].concat(n._toArray(this._arguments)))}d.style.display="none";d.style.visibility="visible";r.fromView=this;r.toView=k;
this._doTransition(h,d,e.transition,e.transitionDir)}}}},_toCls:function(a){return"mbl"+a.charAt(0).toUpperCase()+a.substring(1)},_doTransition:function(a,b,c,l){var j=-1==l?" mblReverse":"";b.style.display="";if(!c||"none"==c)this.domNode.style.display="none",this.invokeCallback();else if(p.mblCSS3Transition)u.when(C,n.hitch(this,function(d){var e=i.get(b,"position");i.set(b,"position","absolute");u.when(d(a,b,{transition:c,reverse:-1===l?!0:!1}),n.hitch(this,function(){i.set(b,"position",e);this.invokeCallback()}))}));
else{-1!=c.indexOf("cube")&&(o("ipad")?i.set(b.parentNode,{webkitPerspective:1600}):o("iphone")&&i.set(b.parentNode,{webkitPerspective:800}));var e=this._toCls(c);o("mblAndroidWorkaround")?setTimeout(function(){g.add(a,e+" mblOut"+j);g.add(b,e+" mblIn"+j);g.remove(b,"mblAndroidWorkaround");setTimeout(function(){g.add(a,"mblTransition");g.add(b,"mblTransition")},30)},70):(g.add(a,e+" mblOut"+j),g.add(b,e+" mblIn"+j),setTimeout(function(){g.add(a,"mblTransition");g.add(b,"mblTransition")},100));var d=
"50% 50%",h="50% 50%",m;-1!=c.indexOf("swirl")||-1!=c.indexOf("zoom")?(d=this.keepScrollPos&&!this.getParent()?f.body().scrollTop||f.doc.documentElement.scrollTop||f.global.pageYOffset||0:-w.position(a,!0).y,m=f.global.innerHeight/2+d,d="50% "+m+"px",h="50% "+m+"px"):-1!=c.indexOf("scale")&&(d=w.position(a,!0),h=(void 0!==this.clickedPosX?this.clickedPosX:f.global.innerWidth/2)-d.x,d=this.keepScrollPos&&!this.getParent()?f.body().scrollTop||f.doc.documentElement.scrollTop||f.global.pageYOffset||0:
-d.y,m=(void 0!==this.clickedPosY?this.clickedPosY:f.global.innerHeight/2)+d,d=h+"px "+m+"px",h=h+"px "+m+"px");i.set(a,{webkitTransformOrigin:d});i.set(b,{webkitTransformOrigin:h})}},onAnimationStart:function(){},onAnimationEnd:function(a){var b=a.animationName||a.target.className;if(!(-1===b.indexOf("Out")&&-1===b.indexOf("In")&&-1===b.indexOf("Shrink"))){var c=!1;g.contains(this.domNode,"mblOut")?(c=!0,this.domNode.style.display="none",g.remove(this.domNode,[this._toCls(this._detail.transition),
"mblIn","mblOut","mblReverse"])):this.containerNode.style.paddingTop="";i.set(this.domNode,{webkitTransformOrigin:""});if(-1!==b.indexOf("Shrink"))a=a.target,a.style.display="none",g.remove(a,"mblCloseContent"),(a=s.getEnclosingScrollable(this.domNode))&&a.onTouchEnd();c&&this.invokeCallback();this._clearClasses(this.domNode);this.clickedPosX=this.clickedPosY=void 0;if(-1!==b.indexOf("Cube")&&-1!==b.indexOf("In")&&o("iphone"))this.domNode.parentNode.style.webkitPerspective=""}},invokeCallback:function(){this.onAfterTransitionOut.apply(this,
this._arguments);j.publish("/dojox/mobile/afterTransitionOut",[this].concat(this._arguments));var a=q.byNode(this.toNode);if(a)a.onAfterTransitionIn.apply(a,this._arguments),j.publish("/dojox/mobile/afterTransitionIn",[a].concat(this._arguments)),a.movedFrom=void 0,this.setFragIds&&this._isBookmarkable(this._detail)&&this.setFragIds(a);o("mblAndroidWorkaround")&&setTimeout(n.hitch(this,function(){a&&i.set(this.toNode,"webkitTransformStyle","");i.set(this.domNode,"webkitTransformStyle","")}),0);var b=
this._detail.context,c=this._detail.method;if(b||c)c||(c=b,b=null),b=b||f.global,"string"==typeof c?b[c].apply(b,this._optArgs):"function"==typeof c&&c.apply(b,this._optArgs);this._detail=this._optArgs=this._arguments=void 0;this._inProgress=!1},isVisible:function(a){if(a){for(a=this.domNode;"BODY"!==a.tagName;a=a.parentNode)if("none"===i.get(a,"display"))return!1;return!0}return"none"!==i.get(this.domNode,"display")},getShowingView:function(){for(var a=this.domNode.parentNode.childNodes,b=0;b<a.length;b++){var c=
a[b];if(1===c.nodeType&&g.contains(c,"mblView")&&"none"!==c.style.display)return q.byNode(c)}return null},getSiblingViews:function(){return!this.domNode.parentNode?[this]:l.map(l.filter(this.domNode.parentNode.childNodes,function(a){return 1===a.nodeType&&g.contains(a,"mblView")}),function(a){return q.byNode(a)})},show:function(a,b){var c=this.getShowingView();a||(c&&(c.onBeforeTransitionOut(c.id),j.publish("/dojox/mobile/beforeTransitionOut",[c,c.id])),this.onBeforeTransitionIn(this.id),j.publish("/dojox/mobile/beforeTransitionIn",
[this,this.id]));b?this.domNode.style.display="":l.forEach(this.getSiblingViews(),function(a){a.domNode.style.display=a===this?"":"none"},this);this.load&&this.load();a||(c&&(c.onAfterTransitionOut(c.id),j.publish("/dojox/mobile/afterTransitionOut",[c,c.id])),this.onAfterTransitionIn(this.id),j.publish("/dojox/mobile/afterTransitionIn",[this,this.id]))},hide:function(){this.domNode.style.display="none"}})});