function gj(){this.Init()}m("AdfDhtmlPositionManager",gj);m("AdfDhtmlPositionManager",gj);r.v(gj);gj.ga=function(){this.Zz=0;m("AdfDhtmlPositionManager.TOP",gj.Zz);this.Qz=1;m("AdfDhtmlPositionManager.MIDDLE",gj.Qz);this.Ts=2;m("AdfDhtmlPositionManager.BOTTOM",gj.Ts);this.Pz=3;m("AdfDhtmlPositionManager.LEFT",gj.Pz);this.wz=4;m("AdfDhtmlPositionManager.CENTER",gj.wz);this.rt=5;m("AdfDhtmlPositionManager.RIGHT",gj.rt);this.SWa=32;m("AdfDhtmlPositionManager.MIN_WIDTH",gj.SWa)};
m("AdfDhtmlPositionManager.InitClass",gj.ga);gj.prototype.Init=function(){gj.h.Init.call(this);var a=v.l;a.getLevel(v.FINEST)&&(this.UM=a);this.hj=[];this.yb=A.c.Ka().La()};r.a("AdfDhtmlPositionManager.prototype.Init",{Init:gj.prototype.Init});gj.prototype.rj=function(){var a=0,b=this.hj,d;for(d in b)d&&a++;return a};r.a("AdfDhtmlPositionManager.prototype.getElementCount",{rj:gj.prototype.rj});gj.prototype.ac=function(){this.hj=null};r.a("AdfDhtmlPositionManager.prototype.dispose",{ac:gj.prototype.ac});
gj.prototype.$pa=function(a,b){a.jC()||u.u(a.Pp());return wj(this,a,b)};r.a("AdfDhtmlPositionManager.prototype.addFloatingElement",{$pa:gj.prototype.$pa});gj.prototype.c8=function(a,b){a.qv(b);return wj(this,a,AdfRichPopup.qf)};r.a("AdfDhtmlPositionManager.prototype.addFloatingElementByPosition",{c8:gj.prototype.c8});gj.prototype.k8=function(a,b,d,e,f){var g=xj(this,d);d=g.TH;g=g.FI;a={top:0,right:b,bottom:a,left:0,width:b,height:a};e=yj(e,f);f=zj(this,d,a,e);d=zj(this,g,a,e);return Aj(f,d,a,e)};
r.a("AdfDhtmlPositionManager.prototype.calculatePlacementPosition",{k8:gj.prototype.k8});function wj(a,b,d){u.u(b.Ha());if(1>a.rj()){var e=q.b,f=e.Y(),g=e.R(),h=a.WOa;h||(h=a.WOa=a.D(a.Hlb));var l=e.S()==q.ia;e.LP()&&(e.ba(g,"mousewheel",h),e.ba(f,"scroll",h),l||e.ba(g,"DOMMouseScroll",h));e.ba(f,"resize",h)}f=xj(a,d);d=f.FI;e=f.TH;f=f.eta;g=(g=b.Pp())?a.Jta(g):!1;a.hj.push({element:b,Dsb:d,Aqb:e,ivb:g,eta:f});return a.hj.length-1}
function xj(a,b){var d=gj.Ts,e=gj.Zz,f=gj.Qz,g=Bj(a,"start"),h=Bj(a,"end"),l=gj.wz,n=!1,t,y;switch(b){case AdfRichPopup.qf:y=[d,e];t=[g,g];break;case AdfRichPopup.HI:y=[d,e];t=[h,h];break;case AdfRichPopup.Yaa:y=[d,e,d,e];t=[g,g,l,l];break;case AdfRichPopup.dD:y=[e,d];t=[g,g];break;case AdfRichPopup.v_:y=[e,d];t=[h,h];break;case AdfRichPopup.Zaa:y=[e,d,e,d];t=[g,g,l,l];break;case AdfRichPopup.w_:y=[d,d];t=[h,g];break;case AdfRichPopup.tz:y=[e,e];t=[h,g];break;case AdfRichPopup.$aa:y=[e,e,f,f];t=[h,
g,h,g];break;case AdfRichPopup.z_:y=[d,d];t=[g,h];break;case AdfRichPopup.A_:y=[e,e];t=[g,h];break;case AdfRichPopup.aba:y=[e,e,f,f];t=[g,h,g,h];break;case AdfRichPopup.DQ:y=[e,e];t=[g,g];break;case AdfRichPopup.x_:n=!0;y=[e,e];t=[h,h];break;case AdfRichPopup.y_:n=!0;y=[e,e];t=[g,g];break;case AdfRichPopup.u_:y=[e,d,e,d];t=[h,h,h,g];break;default:u.assert(!1,"Invalid alignmentHint provided")}return{TH:Cj(a,t),FI:Cj(a,y),eta:n}}
function Dj(a){switch(a){case gj.Zz:return gj.Ts;case gj.Ts:return gj.Zz;case gj.Qz:return gj.Qz;case gj.Pz:return gj.rt;case gj.rt:return gj.Pz;case gj.wz:return gj.wz}}function Ej(a){switch(a){case gj.Zz:return"Top";case gj.Ts:return"Bottom";case gj.Qz:return"Middle";case gj.Pz:return"Left";case gj.rt:return"Right";case gj.wz:return"Center"}}
function Cj(a,b){for(var d=[],e=0;e<b.length;e+=2)d.splice(0,0,{hqa:b[e],ky:b[e+1],uRa:a["_prefer"+Ej(Dj(b[e]))+Ej(Dj(b[e+1]))+"Condition"]},{hqa:Dj(b[e]),ky:Dj(b[e+1]),uRa:a["_prefer"+Ej(b[e])+Ej(b[e+1])+"Condition"]});return d}
function yj(a,b,d){var e=q.b,f,g;a?(e=e.jc(a),a instanceof SVGElement?(d=e.y,b=e.x,a=a.getBoundingClientRect(),e=a.width,g=a.height):d?(d=e.y+a.clientTop,b=e.x+a.clientLeft,e=a.clientWidth,g=a.clientHeight):(d=e.y,b=e.x,e=a.offsetWidth,g=a.offsetHeight),a=d+g,f=b+e):(g=e=0,null==b?f=b=a=d=0:(a=d=b.y,f=b=b.x));return{top:d,bottom:a,left:b,right:f,width:e,height:g}}
gj.prototype.oOa=function(a,b,d){var e=q.b,f=e.getWindowHeight(),g=e.zf(),h=Mi.so(),e=b.top+a.height<=f+g,f=b.bottom+h<=f+g;b=b.bottom-(a.height-h)>=g&&f;a=d?e:b;(f=this.UM)&&f.hq(v.FINEST,(d?"_preferBottomBottomCondition":"_preferTopTopCondition")+" fitsBelow\x3d"+e+" fitsAbove\x3d"+b+" return\x3d"+a+" usedBy\x3d"+(d?"end_before, start_before, overlap":"end_after, start_after"));return a};gj.prototype._preferTopTopCondition=gj.prototype.oOa;
gj.prototype.Ukb=function(a,b){var d=q.b,e=d.getWindowHeight(),d=d.zf(),f=Mi.so(),g=a.height-f,e=b.top+b.height/2+g/2+f<=e+d,g=b.bottom-b.height/2-g/2>=d,d=e&&g;(f=this.UM)&&f.hq(v.FINEST,"_preferMiddleMiddleCondition fitsBelow\x3d"+e+" fitsAbove\x3d"+g+" return\x3d"+d+" usedBy\x3dend_center, start_center");return d};gj.prototype._preferMiddleMiddleCondition=gj.prototype.Ukb;
gj.prototype.Skb=function(a,b){var d=q.b,e=d.getWindowWidth(),d=d.Pe(),f=Mi.so(),g=a.width-f;this.yb?(e=b.left+b.width/2+g/2<=e+d,f=b.right-b.width/2-g/2-f>=d):(e=b.left+b.width/2+g/2+f<=e+d,f=b.right-b.width/2-g/2>=d);d=e&&f;(g=this.UM)&&g.hq(v.FINEST,"_preferCenterCenterCondition fitsToRight\x3d"+e+" fitsToLeft\x3d"+f+" return\x3d"+d+" usedBy\x3dafter_center, before_center");return d};gj.prototype._preferCenterCenterCondition=gj.prototype.Skb;gj.prototype.Rkb=function(a,b){return this.oOa(a,b,!0)};
gj.prototype._preferBottomBottomCondition=gj.prototype.Rkb;gj.prototype.lOa=function(a,b,d){var e=q.b,f=e.getWindowHeight(),g=e.zf(),e=Mi.so(),h=b.top+e<=f+g,e=b.top-(a.height-e)>=g&&h;b=b.bottom+a.height<=f+g;a=d?b:e;(f=this.UM)&&f.hq(v.FINEST,(d?"_preferTopBottomCondition":"_preferBottomTopCondition")+" fitsAbove\x3d"+e+" fitsBelow\x3d"+b+" return\x3d"+a+" usedBy\x3d"+(d?"after_start, after_end":"before_start, before_end, before_after"));return a};gj.prototype._preferBottomTopCondition=gj.prototype.lOa;
gj.prototype.Wkb=function(a,b){return this.lOa(a,b,!0)};gj.prototype._preferTopBottomCondition=gj.prototype.Wkb;
gj.prototype.mOa=function(a,b,d){var e=q.b,f=e.getWindowWidth(),e=e.Pe(),g=Mi.so(),h=a.width+a.wQ-g,l;this.yb?(l=b.right-(a.width+a.wQ)>=e,a=b.left-g>=e,a=b.left+h<=f+e&&a):(a=b.left+a.width+a.wQ<=f+e,f=b.right+g<=f+e,l=b.right-h>=e&&f);b=d?a:l;(f=this.UM)&&f.hq(v.FINEST,(d?"_preferRightRightCondition":"_preferLeftLeftCondition")+" fitsToRight\x3d"+a+" fitsToLeft\x3d"+l+" return\x3d"+b+" usedBy\x3d"+(d?"after_start, before_start, overlap":"after_end, before_end, before_after"));return b};
gj.prototype._preferLeftLeftCondition=gj.prototype.mOa;gj.prototype.Vkb=function(a,b){return this.mOa(a,b,!0)};gj.prototype._preferRightRightCondition=gj.prototype.Vkb;
gj.prototype.nOa=function(a,b,d){var e=q.b,f=e.getWindowWidth(),e=e.Pe(),g=Mi.so(),h=a.width+a.wQ-g;this.yb?(g=b.right-g>=e,f=b.right+h<f+e&&g,h=b.left-(a.width+a.wQ)>=e):(g=b.left+g<f+e,h=b.left-h>=e&&g,f=b.right+(a.width+a.wQ)<f+e);a=d?f:h;(b=this.UM)&&b.hq(v.FINEST,(d?"_preferLeftRightCondition":"_preferRightLeftCondition")+" fitsToLeft\x3d"+h+" fitsToRight\x3d"+f+" return\x3d"+a+" usedBy\x3d"+(d?"end_before, before_after":"start_after, start_before"));return a};
gj.prototype._preferRightLeftCondition=gj.prototype.nOa;gj.prototype.Tkb=function(a,b){return this.nOa(a,b,!0)};gj.prototype._preferLeftRightCondition=gj.prototype.Tkb;function Bj(a,b){return"start"==b&&a.yb||"end"==b&&!a.yb?gj.rt:gj.Pz}gj.prototype.Ti=function(a){delete this.hj[a];if(1>this.rj()){a=q.b;var b=a.Y(),d=a.R(),e=this.WOa;e&&(a.xa(d,"mousewheel",e),a.xa(b,"scroll",e),a.xa(d,"DOMMouseScroll",e),a.xa(b,"resize",e))}};r.a("AdfDhtmlPositionManager.prototype.removeElement",{Ti:gj.prototype.Ti});
gj.prototype.Jta=function(a){return A.c.Gg().sH(a)};r.a("AdfDhtmlPositionManager.prototype.managesElement",{Jta:gj.prototype.Jta});
gj.prototype.zQ=function(a){var b=A.c.Dg();if(!b||!b.rl())if(b=this.hj[a],null!=b){a=b.element;var d=a.Pp(),e=a.jC(),f=b.eta,g=q.b,h=a.Ha(),l=h.offsetWidth,n=h.offsetHeight,t=g.jc(h),g=t.y,t=t.x;0==l&&(h=h.firstChild)&&(l=h.offsetWidth,n=h.offsetHeight);var h=Mi.so(),n=n+h,l=l+h,y=h=0;a.hZ&&a.hZ()&&(y=a.hZ(),h=y.offsetWidth,y=y.offsetHeight);l={top:g,right:t+l,bottom:g+n,left:t,width:l,height:n,wQ:h,Vwb:y};l.inversePosition=a.oQ();d=yj(d,e,f);e=zj(this,b.Dsb,l,d);f=zj(this,b.Aqb,l,d);b.g4={};b.g4.FI=
e;b.g4.TH=f;b=b.g4;b=Aj(b.TH,b.FI,l,d);a.setPosition(b.y,b.x)}};r.a("AdfDhtmlPositionManager.prototype.validatePosition",{zQ:gj.prototype.zQ});function zj(a,b,d,e){if(!d.inversePosition)return b[0];for(var f,g=0;!f&&g<b.length;g++)b[g].uRa.call(a,d,e)&&(f=b[g]);f||(f=b[0]);return f}gj.prototype.IY=function(a){a=this.hj[a];if(null!=a)return a.g4};r.a("AdfDhtmlPositionManager.prototype.getComputedBehavior",{IY:gj.prototype.IY});
function Aj(a,b,d,e){var f,g,h=Mi.so(),l=d.height-h,h=d.width-h;switch(b.hqa){case gj.Zz:f=e.top;break;case gj.Ts:f=e.bottom;break;case gj.Qz:f=e.top+e.height/2;break;default:u.assert(!1,"Invalid alignElementAnchor for verticalBehavior provided")}switch(a.hqa){case gj.Pz:g=e.left;break;case gj.rt:g=e.right;break;case gj.wz:g=e.left+e.width/2;break;default:u.assert(!1,"Invalid alignElementAnchor for horizontalBehavior provided")}var n,t;switch(b.ky){case gj.Zz:n=f;break;case gj.Ts:n=f-l;break;case gj.Qz:n=
f-l/2;break;default:u.assert(!1,"Invalid floatingElementAnchor for verticalBehavior provided")}switch(a.ky){case gj.Pz:t=g;break;case gj.rt:t=g-h;break;case gj.wz:t=g-h/2;break;default:u.assert(!1,"Invalid floatingElementAnchor for horizontalBehavior provided")}A.c.Oy()&&(f=q.b,b=f.zf(),a=f.Pe(),e=f.getWindowWidth(),f=f.getWindowHeight(),n=Math.max(0,n),f=f+b-(n+d.height),0>f&&(n=Math.max(b,n+f)),t=Math.max(0,t),d=e+a-(t+d.width),0>d&&(t=Math.max(a,t+d)));return{x:t,y:n}}
gj.prototype.Hlb=function(){var a=q.b.Y();null==this.VOa&&(this.VOa=this.D(this.Ilb));this.aoa&&a.clearTimeout(this.aoa);this.aoa=a.setTimeout(this.VOa,200)};
gj.prototype.Ilb=function(){delete this.aoa;for(var a=this.hj,b=a.length-1;-1<b;b--)if(null!=a[b]){var d=a[b].element,e=d.Pp();if(!d.ss())if(e){for(var f=e,e=q.b,g=e.rd(f),h=e.getWindowWidth(),l=e.Pe(),n=e.getWindowHeight(),t=e.zf(),h=gj.zMa(g,{top:t,bottom:n+t,left:l,right:l+h}),f=f.parentNode;h&&f&&!gj.pib(f);)1==f.nodeType&&(h=e.rd(f),h=gj.zMa(g,h)),f=f.parentNode;!h&&d.Dk()?d.cancel():this.zQ(b)}else{if(e=d.jC())g=d,e=q.b,d=g.getWidth(),g=g.getHeight(),f=e.getWindowWidth(),e=e.getWindowHeight(),
e=!(d>f||g>e);e&&this.zQ(b)}}};gj.pib=function(a){var b=q.b.Na(a);if("FORM"==b||"BODY"==b)return!0;if(a=a.getAttribute("id"))if(a=a.split(":"),b=a.length,0<b)return ej.iJ==a[b-1];return!1};gj.zMa=function(a,b){return-2>a.top-b.top||-2>b.bottom-a.bottom||-2>a.left-b.left||2<a.right-b.right?!1:!0};gj.prototype.qua=function(a){var b=this.Yqa(a);if(b&&!(b instanceof Ke)){var d=b.Ha();if(C.Nb(d,a))return b.Ip(),!0}return!1};r.a("AdfDhtmlPositionManager.prototype.resizeFloatingElement",{qua:gj.prototype.qua});
gj.prototype.Yqa=function(a){for(var b=this.hj,d=0;d<b.length;d++)if(d in b){var e=b[d];if(e&&(e=e.element)){var f=e.Ha();if(C.Nb(f,a))return e}}return null};r.a("AdfDhtmlPositionManager.prototype.findFloatingElement",{Yqa:gj.prototype.Yqa});