//>>built
define("dijit/popup","dojo/_base/array dojo/aspect dojo/_base/declare dojo/dom dojo/dom-attr dojo/dom-construct dojo/dom-geometry dojo/dom-style dojo/has dojo/keys dojo/_base/lang dojo/on ./place ./BackgroundIframe ./Viewport ./main dojo/touch".split(" "),function(z,A,t,B,C,v,k,p,D,w,l,x,y,E,F,G){function H(){this._popupWrapper&&(v.destroy(this._popupWrapper),delete this._popupWrapper)}t=t(null,{_stack:[],_beginZIndex:1E3,_idGen:1,_repositionAll:function(){if(this._firstAroundNode){var a=this._firstAroundPosition,
b=k.position(this._firstAroundNode,!0),c=b.x-a.x;a=b.y-a.y;if(c||a)for(this._firstAroundPosition=b,b=0;b<this._stack.length;b++){var d=this._stack[b].wrapper.style;d.top=parseFloat(d.top)+a+"px";"auto"==d.right?d.left=parseFloat(d.left)+c+"px":d.right=parseFloat(d.right)-c+"px"}this._aroundMoveListener=setTimeout(l.hitch(this,"_repositionAll"),c||a?10:50)}},_createWrapper:function(a){var b=a._popupWrapper,c=a.domNode;b||(b=v.create("div",{"class":"dijitPopup",style:{display:"none"},role:"region",
"aria-label":a["aria-label"]||a.label||a.name||a.id},a.ownerDocumentBody),b.appendChild(c),c=c.style,c.display="",c.visibility="",c.position="",c.top="0px",a._popupWrapper=b,A.after(a,"destroy",H,!0),"ontouchend"in document&&x(b,"touchend",function(d){/^(input|button|textarea)$/i.test(d.target.tagName)||d.preventDefault()}),b.dojoClick=!0);return b},moveOffScreen:function(a){var b=this._createWrapper(a);a=k.isBodyLtr(a.ownerDocument);var c={visibility:"hidden",top:"-9999px",display:""};c[a?"left":
"right"]="-9999px";c[a?"right":"left"]="auto";p.set(b,c);return b},hide:function(a){var b=this._createWrapper(a);p.set(b,{display:"none",height:"auto",overflowY:"visible",border:""});a=a.domNode;"_originalStyle"in a&&(a.style.cssText=a._originalStyle)},getTopPopup:function(){for(var a=this._stack,b=a.length-1;0<b&&a[b].parent===a[b-1].widget;b--);return a[b]},open:function(a){for(var b=this._stack,c=a.popup,d=c.domNode,g=a.orient||["below","below-alt","above","above-alt"],q=a.parent?a.parent.isLeftToRight():
k.isBodyLtr(c.ownerDocument),f=a.around,r=a.around&&a.around.id?a.around.id+"_dropdown":"popup_"+this._idGen++;b.length&&(!a.parent||!B.isDescendant(a.parent.domNode,b[b.length-1].widget.domNode));)this.close(b[b.length-1].widget);var h=this.moveOffScreen(c);c.startup&&!c._started&&c.startup();var m=k.position(d);if("maxHeight"in a&&-1!=a.maxHeight)var n=a.maxHeight||Infinity;else{n=F.getEffectiveBox(this.ownerDocument);var u=f?k.position(f,!1):{y:a.y-(a.padding||0),h:2*(a.padding||0)};n=Math.floor(Math.max(u.y,
n.h-(u.y+u.h)))}m.h>n&&(m=p.getComputedStyle(d),p.set(h,{overflowY:"scroll",height:n+"px",border:m.borderLeftWidth+" "+m.borderLeftStyle+" "+m.borderLeftColor}),d._originalStyle=d.style.cssText,d.style.border="none");C.set(h,{id:r,style:{zIndex:this._beginZIndex+b.length},"class":"dijitPopup "+(c.baseClass||c["class"]||"").split(" ")[0]+"Popup",dijitPopupParent:a.parent?a.parent.id:""});0==b.length&&f&&(this._firstAroundNode=f,this._firstAroundPosition=k.position(f,!0),this._aroundMoveListener=setTimeout(l.hitch(this,
"_repositionAll"),50));D("config-bgIframe")&&!c.bgIframe&&(c.bgIframe=new E(h));r=c.orient?l.hitch(c,"orient"):null;g=f?y.around(h,f,g,q,r):y.at(h,a,"R"==g?["TR","BR","TL","BL"]:["TL","BL","TR","BR"],a.padding,r);h.style.visibility="visible";d.style.visibility="visible";d=[];d.push(x(h,"keydown",l.hitch(this,function(e){if(e.keyCode==w.ESCAPE&&a.onCancel)e.stopPropagation(),e.preventDefault(),a.onCancel();else if(e.keyCode==w.TAB&&(e.stopPropagation(),e.preventDefault(),(e=this.getTopPopup())&&e.onCancel))e.onCancel()})));
c.onCancel&&a.onCancel&&d.push(c.on("cancel",a.onCancel));d.push(c.on(c.onExecute?"execute":"change",l.hitch(this,function(){var e=this.getTopPopup();if(e&&e.onExecute)e.onExecute()})));b.push({widget:c,wrapper:h,parent:a.parent,onExecute:a.onExecute,onCancel:a.onCancel,onClose:a.onClose,handlers:d});if(c.onOpen)c.onOpen(g);return g},close:function(a){for(var b=this._stack;a&&z.some(b,function(f){return f.widget==a})||!a&&b.length;){var c=b.pop(),d=c.widget,g=c.onClose;d.bgIframe&&(d.bgIframe.destroy(),
delete d.bgIframe);if(d.onClose)d.onClose();for(var q;q=c.handlers.pop();)q.remove();d&&d.domNode&&this.hide(d);g&&g()}0==b.length&&this._aroundMoveListener&&(clearTimeout(this._aroundMoveListener),this._firstAroundNode=this._firstAroundPosition=this._aroundMoveListener=null)}});return G.popup=new t});