//>>built
define("dojox/mobile/View","dojo/_base/array dojo/_base/config dojo/_base/connect dojo/_base/declare dojo/_base/lang dojo/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 ./_css3".split(" "),function(m,u,q,D,v,r,e,A,B,h,E,C,l,w,F,G,H,J,x,I,y,n){v.getObject("dojox.mobile",!0);return D("dojox.mobile.View",[H,G,
F],{selected:!1,keepScrollPos:!0,tag:"div",baseClass:"mblView",constructor:function(a,b){b&&(B.byId(b).style.visibility="hidden")},destroy:function(){y.remove(this.id);this.inherited(arguments)},buildRendering:function(){this.templateString||(this.domNode=this.containerNode=this.srcNodeRef||E.create(this.tag));this._animEndHandle=this.connect(this.domNode,n.name("animationEnd"),"onAnimationEnd");this._animStartHandle=this.connect(this.domNode,n.name("animationStart"),"onAnimationStart");u.mblCSS3Transition||
(this._transEndHandle=this.connect(this.domNode,n.name("transitionEnd"),"onAnimationEnd"));r("mblAndroid3Workaround")&&l.set(this.domNode,n.name("transformStyle"),"preserve-3d");y.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,t,e;m.forEach(a,function(a,f){-1!==m.indexOf(b,a.id)&&(c=a);0==f&&(e=a);a.selected&&(t=a);a._visible=!1},this);(c||t||e)._visible=!0}this._visible&&
(this.show(!0,!0),this.defer(function(){this.onStartView();q.publish("/dojox/mobile/startView",[this])}));"hidden"===this.domNode.style.visibility&&(this.domNode.style.visibility="inherit");this.inherited(arguments);(a=this.getParent())&&a.resize||this.resize();this._visible||this.hide()}},resize:function(){m.forEach(this.getChildren(),function(a){a.resize&&a.resize()})},onStartView:function(){},onBeforeTransitionIn:function(a,b,c,e,h){},onAfterTransitionIn:function(a,b,c,e,h){},onBeforeTransitionOut:function(a,
b,c,e,h){},onAfterTransitionOut:function(a,b,c,e,h){},_clearClasses:function(a){if(a){var b=[];m.forEach(v.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 e=b[c];1===e.nodeType&&h.contains(e,"mblView")&&this._clearClasses(e)}this._clearClasses(a);if(a=w.byNode(a))a._inProgress=!1},convertToId:function(a){return"string"==
typeof a?a.replace(/^#?([^&?]+).*/,"$1"):a},_isBookmarkable:function(a){return a.moveTo&&(u.mblForceBookmarkable||"#"===a.moveTo.charAt(0))&&!a.hashchange},performTransition:function(a,b,c,t,m){if(!this._inProgress){this._inProgress=!0;var d,f;if(a&&"object"===typeof a)d=a,f=b;else{d={moveTo:a,transitionDir:b,transition:c,context:t,method:m};f=[];for(var g=5;g<arguments.length;g++)f.push(arguments[g])}this._detail=d;this._optArgs=f;this._arguments=[d.moveTo,d.transitionDir,d.transition,d.context,
d.method];if("#"!==d.moveTo){d.moveTo?f=this.convertToId(d.moveTo):(this._dummyNode||(this._dummyNode=e.doc.createElement("div"),e.body().appendChild(this._dummyNode)),f=this._dummyNode);this.addTransitionInfo&&"string"==typeof d.moveTo&&this._isBookmarkable(d)&&this.addTransitionInfo(this.id,d.moveTo,{transitionDir:d.transitionDir,transition:d.transition});var g=this.domNode,p=g.offsetTop;if(f=this.toNode=B.byId(f)){f.style.visibility="hidden";f.style.display="";this._fixViewState(f);var k=w.byNode(f);
if(k){if(u.mblAlwaysResizeOnTransition||!k._resized)x.resizeAll(null,k),k._resized=!0;d.transition&&"none"!=d.transition&&k._addTransitionPaddingTop(p);k.load&&k.load();k.movedFrom=g.id}r("mblAndroidWorkaround")&&!u.mblCSS3Transition&&d.transition&&"none"!=d.transition&&(l.set(f,n.name("transformStyle"),"preserve-3d"),l.set(g,n.name("transformStyle"),"preserve-3d"),h.add(f,"mblAndroidWorkaround"));this.onBeforeTransitionOut.apply(this,this._arguments);q.publish("/dojox/mobile/beforeTransitionOut",
[this].concat(v._toArray(this._arguments)));if(k){if(this.keepScrollPos&&!this.getParent()){p=e.body().scrollTop||e.doc.documentElement.scrollTop||e.global.pageYOffset||0;g._scrollTop=p;var z=1==d.transitionDir?0:f._scrollTop||0;f.style.top="0px";if(1<p||0!==z)g.style.top=z-p+"px",7<=r("ios")||!1===u.mblHideAddressBar||this.defer(function(){e.global.scrollTo(0,z||1)})}else f.style.top="0px";k.onBeforeTransitionIn.apply(k,this._arguments);q.publish("/dojox/mobile/beforeTransitionIn",[k].concat(v._toArray(this._arguments)))}f.style.display=
"none";f.style.visibility="inherit";x.fromView=this;x.toView=k;this._doTransition(g,f,d.transition,d.transitionDir)}else console.log("dojox/mobile/View.performTransition: destination view not found: "+d.moveTo)}}},_addTransitionPaddingTop:function(a){this.containerNode.style.paddingTop=a+"px"},_removeTransitionPaddingTop:function(){this.containerNode.style.paddingTop=""},_toCls:function(a){return"mbl"+a.charAt(0).toUpperCase()+a.substring(1)},_doTransition:function(a,b,c,t){var m=-1==t?" mblReverse":
"";b.style.display="";if(c&&"none"!=c)if(u.mblCSS3Transition)A.when(I,v.hitch(this,function(d){var e=l.get(b,"position");l.set(b,"position","absolute");A.when(d(a,b,{transition:c,reverse:-1===t?!0:!1}),v.hitch(this,function(){l.set(b,"position",e);b.style.paddingTop="";this.invokeCallback()}))}));else{-1!=c.indexOf("cube")&&(r("ipad")?l.set(b.parentNode,{webkitPerspective:1600}):r("ios")&&l.set(b.parentNode,{webkitPerspective:800}));var d=this._toCls(c);if(r("mblAndroidWorkaround")){var f=this;f.defer(function(){h.add(a,
d+" mblOut"+m);h.add(b,d+" mblIn"+m);h.remove(b,"mblAndroidWorkaround");f.defer(function(){h.add(a,"mblTransition");h.add(b,"mblTransition")},30)},70)}else h.add(a,d+" mblOut"+m),h.add(b,d+" mblIn"+m),this.defer(function(){h.add(a,"mblTransition");h.add(b,"mblTransition")},100);var g="50% 50%",p="50% 50%",k;-1!=c.indexOf("swirl")||-1!=c.indexOf("zoom")?(g=this.keepScrollPos&&!this.getParent()?e.body().scrollTop||e.doc.documentElement.scrollTop||e.global.pageYOffset||0:-C.position(a,!0).y,k=e.global.innerHeight/
2+g,g="50% "+k+"px",p="50% "+k+"px"):-1!=c.indexOf("scale")&&(g=C.position(a,!0),p=(void 0!==this.clickedPosX?this.clickedPosX:e.global.innerWidth/2)-g.x,g=this.keepScrollPos&&!this.getParent()?e.body().scrollTop||e.doc.documentElement.scrollTop||e.global.pageYOffset||0:-g.y,k=(void 0!==this.clickedPosY?this.clickedPosY:e.global.innerHeight/2)+g,g=p+"px "+k+"px",p=p+"px "+k+"px");l.set(a,n.add({},{transformOrigin:g}));l.set(b,n.add({},{transformOrigin:p}))}else this.domNode.style.display="none",this.invokeCallback()},
onAnimationStart:function(a){},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;h.contains(this.domNode,"mblOut")?(c=!0,this.domNode.style.display="none",h.remove(this.domNode,[this._toCls(this._detail.transition),"mblIn","mblOut","mblReverse"])):this._removeTransitionPaddingTop();l.set(this.domNode,n.add({},{transformOrigin:""}));-1!==b.indexOf("Shrink")&&(a=a.target,a.style.display="none",h.remove(a,
"mblCloseContent"),(a=y.getEnclosingScrollable(this.domNode))&&a.onTouchEnd());c&&this.invokeCallback();this._clearClasses(this.domNode);this.clickedPosX=this.clickedPosY=void 0;-1!==b.indexOf("Cube")&&-1!==b.indexOf("In")&&r("ios")&&(this.domNode.parentNode.style[n.name("perspective")]="")}},invokeCallback:function(){this.onAfterTransitionOut.apply(this,this._arguments);q.publish("/dojox/mobile/afterTransitionOut",[this].concat(this._arguments));var a=w.byNode(this.toNode);a&&(a.onAfterTransitionIn.apply(a,
this._arguments),q.publish("/dojox/mobile/afterTransitionIn",[a].concat(this._arguments)),a.movedFrom=void 0,this.setFragIds&&this._isBookmarkable(this._detail)&&this.setFragIds(a));r("mblAndroidWorkaround")&&this.defer(function(){a&&l.set(this.toNode,n.name("transformStyle"),"");l.set(this.domNode,n.name("transformStyle"),"")});var b=this._detail.context,c=this._detail.method;if(b||c)c||(c=b,b=null),b=b||e.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"===l.get(a,"display"))return!1;return!0}return"none"!==l.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&&h.contains(c,"mblView")&&"none"!==c.style.display)return w.byNode(c)}return null},getSiblingViews:function(){return this.domNode.parentNode?
m.map(m.filter(this.domNode.parentNode.childNodes,function(a){return 1===a.nodeType&&h.contains(a,"mblView")}),function(a){return w.byNode(a)}):[this]},show:function(a,b){var c=this.getShowingView();a||(c&&(c.onBeforeTransitionOut(c.id),q.publish("/dojox/mobile/beforeTransitionOut",[c,c.id])),this.onBeforeTransitionIn(this.id),q.publish("/dojox/mobile/beforeTransitionIn",[this,this.id]));b?this.domNode.style.display="":m.forEach(this.getSiblingViews(),function(a){a.domNode.style.display=a===this?
"":"none"},this);this.load&&this.load();a||(c&&(c.onAfterTransitionOut(c.id),q.publish("/dojox/mobile/afterTransitionOut",[c,c.id])),this.onAfterTransitionIn(this.id),q.publish("/dojox/mobile/afterTransitionIn",[this,this.id]))},hide:function(){this.domNode.style.display="none"}})});