define("Lib/Control/FloatArea/FloatArea",["Core/core-extend","Core/helpers/isNewEnvironment","Core/helpers/Function/once","Core/helpers/Object/find","Core/helpers/Function/forAliveOnly","Core/helpers/Function/memoize","require","Core/helpers/Object/isEmpty","Core/WindowManager","Env/Event","Core/CommandDispatcher","Env/Env","Lib/Control/TemplatedArea/TemplatedArea","Lib/FloatAreaManager/FloatAreaManager","Lib/Control/ModalOverlay/ModalOverlay","Lib/Mixins/LikeWindowMixin","Browser/TransportOld","Core/markup/ParserUtilities","Core/core-instance","Core/core-clone","Core/helpers/Function/shallowClone","Core/ControlBatchUpdater","Lib/Mixins/PendingOperationParentMixin","Core/Deferred","Core/helpers/Hcontrol/screen","Core/helpers/Hcontrol/trackElement","Core/helpers/Hcontrol/doAutofocus","Core/helpers/Hcontrol/getScrollWidth","is!browser?Lib/LayoutManager/LayoutManager","Vdom/Vdom","Core/helpers/Array/findIndex","Core/Context","css!Lib/Control/FloatArea/FloatArea","is!browser?/cdn/jquery-ui/1.12.1.2/jquery-ui-position-min.js","i18n!Lib/Control/FloatArea/FloatArea"],function(t,s,o,n,g,a,m,e,r,h,l,C,i,_,d,f,w,v,c,p,b,u,S,y,T,x,A,W,k,M){"use strict";var z=_._useAnimation(),H=function(){},B=_._useCss3(),I=C.constants.browser,F=!I.isIE||I.IEVersion>8,P=I.isIE,O,R=["Lib/Control/FloatArea/FloatArea","Lib/Control/Window/Window"],V=150,L=20,D=8,E=200,U=1e3,N=300,Z=C.IoC.resolve("ILogger"),j=Z.error.bind(Z,"Lib/Control/FloatArea/FloatArea"),l=l,K={},q=u.createBatchUpdateWrapper.bind(u);function Q(){if(!O)O=C.constants.isBrowserPlatform&&$("body");return O.length&&O}function G(A,x,k){function _(t,i){if(k.arrow){var e=i.element.left,s=i.element.top,o=e+i.element.width,n=s+i.element.height,a=i.target.left,r=i.target.top,h=a+i.target.width,l=r+i.target.height,d=20,_=10,f,c,p;if(r-n>=_||s-l>=_){var u=Math.max(e,a),g=Math.min(o,h);if(p=a>e?a-e:0,g-u>=d)f=n<r?"bottom":"top",c=(g-u)/2+p}else if(a-o>=_||e-h>=_){var m=Math.max(s,r),w=Math.min(n,l);if(p=r>s?r-s:0,w-m>=d)f=o<a?"right":"left",c=(w-m)/2+p}if(f){var v="ws-float-area-arrow-"+f,b="left"==f||"right"==f?"top":"left";if(!A._arrowBefore)A._arrowBefore=$('<div class="arrowBefore '+v+'"></div>'),A._arrowBefore.appendTo(A);if(!A._arrowAfter)A._arrowAfter=$('<div class="arrowAfter '+v+'"></div>'),A._arrowAfter.appendTo(A);A._arrowBefore.css(b,c),A._arrowAfter.css(b,c)}}if(t.left=parseInt(t.left,10),t.top=parseInt(t.top,10),K.elementLeft=t.left,!k.isStack&&k.restrictionContainer){var C=$(k.restrictionContainer),S=C.width(),y=C[0].getBoundingClientRect().left,x,T=A.width()+t.left-(S+y);if(C.length&&T>0)t.left-=T+1}if(t.left<0)t.left=0;if(t.top<0)t.top=0;A.css(t)}function f(t){var i=A.closest(".ws-body-scrolling-content"),e=$(window).width(),s=$(window).height(),o=T.toScreen(t),n;if(i.length>0)e-=W();if((n={left:-(o=T.toScreen(t)).left,right:o.left+t.width-e,top:-o.top,bottom:o.top+t.height-s,vertical:"",horizontal:""}).right>0)n.horizontal="right";else if(n.left>0)n.horizontal="left";if(n.bottom>0)n.vertical="bottom";else if(n.top>0)n.vertical="top";return n}function e(p){function u(t,i){var e;return t+(i?(i>0?"+":"")+i:"")}var g={},m={top:"bottom",bottom:"top",left:"right",right:"left",center:"center",middle:"middle"},t=p.verticalAlign,i=p.side,e=p.offset,w=Math.floor(Number(e.x)||0),v=Math.floor(Number(e.y)||0),b,C,S,y,s=p.direction;if("middle"===t)t="center";switch(s){case"top":case"bottom":b=i,C=m[s];break;case"left":case"right":b=m[s],C="top"}var o=u(b,w),n=u(C,v);return S=i,y=t,g.my=o+" "+n,g.at=S+" "+y,g.myH=o,g.myV=n,g.atH=S,g.atV=y,g.of=x,g.collision="none",g.fitByOffset=function(t,i){var e="horizontal"===p.fitWindow||"both"===p.fitWindow||true===p.fitWindow,s="vertical"===p.fitWindow||"both"===p.fitWindow||true===p.fitWindow,o=0,n=0;if(e)if(t.left>0)o=t.left;else if(t.right>0)o=-Math.min(t.right,i.left);if(s)if(t.top>0)n=t.top;else if(t.bottom>0)n=-Math.min(t.bottom,i.top);var a=u(this.myHFlipped,w+o),r=u(this.myVFlipped,v+n);return{my:a+" "+r,at:this.at,of:x,myH:a,myV:r,atH:this.atH,atV:this.atV,collision:"none"}},g.getFlipped=function(t){var i="horizontal"===p.flipWindow||"both"===p.flipWindow||true===p.flipWindow,e="vertical"===p.flipWindow||"both"===p.flipWindow||true===p.flipWindow,s,o,n,a,r,h,l,d,_;if("right"===t.horizontal&&i)s="right";else if("left"===t.horizontal&&i)s="left";else s=b;if("top"===t.vertical&&e)o="top";else if("bottom"===t.vertical&&e)o="bottom";else o=C;a=o===C?1:-1;var f=u(s,w*(n=s===b?1:-1)),c=u(o,v*a);return _={my:r=f+" "+c,at:h=(l=b!==s?m[S]:S)+" "+(d=C!==o?m[y]:y),of:x,fitByOffset:g.fitByOffset,myHFlipped:s,myVFlipped:o,myH:f,myV:c,atH:l,atV:d,collision:"none"}},g}function s(n,a,t,i){var r={};if(K.targetLeft=i&&i.element&&i.element.left,"my"in n)r.my=n.my;if("at"in n)r.at=n.at;if("of"in n)r.of=n.of;if("collision"in n)r.collision=n.collision;var e=f(i.element),h="horizontal"===k.fitWindow||"both"===k.fitWindow||true===k.fitWindow,l="vertical"===k.fitWindow||"both"===k.fitWindow||true===k.fitWindow,d=n.getFlipped(e);function s(t,i){var e=f(i.element),s=T.toScreen(i.element),o;if(e.horizontal||e.vertical)if(o=d.fitByOffset(e,s),h&&l)a.result=o;else if(h)o.my=o.myH+" "+(e.vertical?n.myV:d.myV),o.at=o.atH+" "+(e.vertical?n.atV:d.atV),a.result=o;else if(l)o.my=(e.horizontal?n.myH:d.myH)+" "+o.myV,o.at=(e.horizontal?n.atH:d.atH)+" "+o.atV,a.result=o;else a.result=r;else a.result=d;a.result.using=_}d.using=s,A.position(d)}return function(){var t={},i=e(k);return i.using=s.bind(void 0,i,t),A.position(i),t.result}}function X(t){return function(){if(this._options.isStack)return t.apply(this,arguments)}}function Y(t){return function(){if(!this._options.isStack)return t.apply(this,arguments)}}var g=g;function J(e,s){return function(){var t=s||this,i=arguments;return this.getReadyDeferred().addCallback(function(){if(!t.isDestroyed())return e.apply(t,i)})}}var tt=t.mixin(i,[f,S]).extend({$protected:{_options:{target:"",side:"left",width:0,height:0,animation:"slide",autoHide:true,autoCloseOnHide:false,verticalAlign:"top",direction:"",animationLength:V,startWidth:-5,startHeight:-5,offset:{x:0,y:0},fixed:false,trackTarget:true,autoShow:true,catchFocus:true,hoverTarget:void 0,showDelay:void 0,fitWindow:false,flipWindow:true,fullShadow:false,controlsSide:"right",isStack:false,restrictionContainer:false,hideSideBar:true,overlay:false,modal:false,border:true,canMaximize:false,maxWidthWithoutSideBar:false,maximized:false,caption:void 0,stickyHeader:false,arrow:false,showOnControlsReady:true,_maximizeButton:void 0,disableCSS3AnimationEvent:false,task1173269044:false,closeChildWindows:true},_horizontalAlignment:"Left",_loaded:false,_loadStarted:false,_closeButton:void 0,_overflow:void 0,_containerShadow:void 0,_visibleRoot:void 0,_visibleRootWrapper:void 0,_generatedTitleContainer:void 0,_target:void 0,_hoverTarget:void 0,_state:"",_stateStage:"",_visible:false,_collapsedSides:{},_hoverTimer:void 0,_locksShowed:0,_childWindows:[],_showTimer:void 0,_keysWeHandle:[C.constants.key.tab,C.constants.key.enter,C.constants.key.esc],_zIndex:0,_caption:void 0,_maxWidthSet:void 0,_firstSizeCalcOnShow:false,_autoShow:false,_touchX:0,_touchDistance:0,_addedToStack:false,_result:void 0,_saving:void 0,_beforeAnimationTimer:void 0,_transitionEndHandler:void 0,_showDeferred:void 0,_hideFinishFn:void 0,_windowResizeHandler:void 0,_userTitle:void 0,_useCss3:false,_useAnimation:false,_noStackShadowClassPostfix:"standart",_inApplyBatchUpdateIntermediate:0,_memoizedFuncs:{},_childPanelSizes:{},_animationQueue:void 0,_scrollUnsub:void 0,_prevPositionOptions:void 0,_showOnControlsReady:true,_isShowCanceled:false,_focusState:void 0,_prevHeight:0},$constructor:function(t){this._isModal=this._isModal||this._options.overlay,this._publish("onClose","onShow","onBeforeClose","onAfterClose","onScroll","onTargetVisibilityChange"),this.subscribeTo(h.Bus.channel("navigation"),"onBeforeNavigate",g(this._onBeforeNavigate,this));var i=function(t,i){var e=function(){return i.apply(this,arguments),true};l.declareCommand(this,t,e)}.bind(this);if(i("show",this.show),i("hide",this.hide),i("close",this.close),_._addArea(this),h.Bus.globalChannel().notify("onFloatAreaCreating",this),this._captionClickHandler=this._captionClickHandler.bind(this),(this._overflow[0].wsControl=this)._zIndex=this._prepareZIndex(),this._visibleRootWrapper.css("z-index",this._zIndex),this._isModal)this.subscribeTo(d,"onClick",function(t){if(this.isVisible()&&d.isShownForWindow(this))t.setResult(true),this.sendCommand("hide")}.bind(this));if(this._animationQueue=y.success(void 0),_._hideUnnecessaryAreas(this),this._checkOpener(),this._options.isCompoundTemplate){var e=getComputedStyle(this._visibleRoot[0]),s=parseInt(e.marginTop,10),o=parseInt(e.marginLeft,10),n={};this._options.offset=this._options.offset||{},n.x=this._options.offset.x||o||0,n.y=this._options.offset.y||s||0,this._visibleRoot[0].classList.add("ws-float-area__reset-margin"),this.setOffset(n)}},_prepareZIndex:function(){if(s()){var t=this.getOpener(),i=t&&t._container&&t._container.closest('.controls-Popup, .controls-FloatArea, .ws-window:not(".controls-CompoundArea")'),e=i&&i.css("z-index");if(e)return parseInt(e,10)+5}return r.acquireZIndex(this._isModal,false,!!this._options.hoverTarget)},_checkOpener:function(){if(s()&&!this._options._openFromAction)C.IoC.resolve("ILogger").error("FloatArea","Компонент открыт напрямую без использования хэлперов открытия. \n"+"Для правильной работы компонента окно должно быть открыто через action. \n"+"Подробности: https://wi.sbis.ru/doc/platform/developmentapl/interface-development/ws4/components/templates/open-compound-template/")},_modifyOptions:function(t){if(t.canMaximize)t.componentOptions.isPanelMaximized=t.maximized;if(!t.enabled)Z.log("Lib/Control/FloatArea/FloatArea","Задана опция enabled = false. Дизаблить можно только дочерний компонент панели, для этого enabled нужно передать в componentOptions."),t.componentOptions.enabled=false,t.enabled=true;return t},_activateParent:function(){return false},_onBeforeNavigate:function(t,i,e){if(!e)this.sendCommand("hide",true)},_getManagerOptions:function(){return{hideSideBar:this._options.hideSideBar}},_initStack:X(function(){if(!this._addedToStack)this._addedToStack=true,_._setAreaInfo(this,this._getManagerOptions())}),_prepareSideOptions:function(){if("left"!==this._options.side&&"right"!==this._options.side&&"center"!==this._options.side)this._options.side="left",j("Incorrect _options.side");if("top"!==this._options.verticalAlign&&"bottom"!==this._options.verticalAlign&&"middle"!==this._options.verticalAlign)this._options.verticalAlign="top",j("Incorrect _options.verticalAlign");if("slide"!==this._options.animation&&"fade"!==this._options.animation&&"off"!==this._options.animation)this._options.animation="slide",j("Incorrect _options.animation");if(this._options.isStack)this._options.side="right",this._options.target=Q(),this._options.fixed=false;else if(this._options.fixed)this._options.target=$(window);else if(!this._options.target)this._options.target=Q()},_checkDirectionLegalValues:function(){if(""!==this._options.direction&&"left"!==this._options.direction&&"right"!==this._options.direction&&"top"!==this._options.direction&&"bottom"!==this._options.direction)this._options.direction="",j("Incorrect direction")},_checkAutoDirection:function(){if(""===this._options.direction)if("left"===this._options.side)this._options.direction="right";else if("right"===this._options.side)this._options.direction="left";else if("top"===this._options.verticalAlign)this._options.direction="bottom";else if("bottom"===this._options.verticalAlign)this._options.direction="top";else if(this._options.direction="left","slide"===this._options.animation)j("Unspecified direction")},_prepareCollapsedSides:function(){var t=this._options.side,i=this._options.direction,e=this._options.verticalAlign,s=this._options.isStack;if(!F)this._collapsedSides={left:true,right:true,top:true,bottom:true};else if(this._options.fullShadow)this._collapsedSides={left:false,right:false,top:false,bottom:false};else if(s)this._collapsedSides={left:false,right:true,top:true,bottom:true};else this._collapsedSides={left:"left"===t&&"left"!==i||"right"===t&&"right"===i,right:"right"===t&&"right"!==i||"left"===t&&"left"===i,top:"top"===e&&"top"!==i||"bottom"===e&&"bottom"===i,bottom:"bottom"===e&&"bottom"!==i||"top"===e&&"top"===i}},_prepareGeneralOptions:function(){if(this._options.width=parseInt(this._options.width,10),isNaN(this._options.width))this._options.width=E;if(this._width=this._options.width,this._options.height=parseInt(this._options.height,10),isNaN(this._options.height))this._options.height=E;if(this._height=this._options.height,this._autoShow=this._options.autoShow,void 0===this._options.showDelay)if(this._hoverTarget)this._options.showDelay=N;else this._options.showDelay=0},_prepareElements:function(){if(tt.superclass._prepareElements.apply(this,arguments),this._prepareSideOptions(),this._checkDirectionLegalValues(),this._checkAutoDirection(),this._prepareCollapsedSides(),this._prepareGeneralOptions(),this._prepareArea(),this._prepareHover(),this._prepareKeydown(),this._options.fixed)this._target=$(this._options.target);else this.setTarget(this._options.target)},_getAreaType:function(){var t;if(this._options.isStack)t="STACK";else t="NO_STACK";return t},_handleStackScroll:function(t){var i;if(this.hasEventHandlers("onScroll"))i=$(t.target),this._notify("onScroll",{element:i,clientHeight:i.height(),scrollTop:i.prop("scrollTop"),scrollHeight:i.prop("scrollHeight")})},_onChildPanelResize:function(t,i){if(this._childPanelSizes[i.id]=i.top+i.height+this._visibleRoot.scrollTop()-k.getMainScrollingContainer().offset().top,0===i.height)delete this._childPanelSizes[i.id];this._notifyOnSizeChanged(true)},_prepareArea:function(){this._options.animationLength=parseInt(this._options.animationLength,10)||0,this._useCss3=B&&(void 0===this._options.useCss3||this._options.useCss3),this._useAnimation=z&&"off"!==this._options.animation&&this._options.animationLength>L,this._options.startWidth=parseInt(this._options.startWidth,10)||0,this._options.startHeight=parseInt(this._options.startHeight,10)||0;var t=_._getFloatAreaContentRoot(),i=$(this._options.target),e=!this._options.isStack&&i.closest(t).length>0&&!this._isModal?t:_._getFloatAreaBodyContainerRoot(),s;if(this._options.task1173269044)e=_._getFloatAreaBodyContainerRoot();var o=this._getAreaType(),n={STACK:{_visibleRoot:function(i){var t=_._useTouch()?"ws-float-area-stack-scroll-wrapper-touch":"ws-float-area-stack-scroll-wrapper-notouch";if(i.css("right",-_._bodyScrollWidth()),i.addClass(t),i.bind("scroll",this._handleStackScroll.bind(this)),!this._needPanelHeightRecalc())i.addClass("ws-float-area-no-height-calc");i.bind("mousedown mouseup click",function(t){if(i.is(t.target))t.stopPropagation()}),i.bind("touchmove",function(t){t.originalEvent.isFloatArea=true})},_visibleRootWrapper:function(t){t.prependTo(e)},_containerShadow:function(t){t.removeClass("ws-area"),t.bind("wsFloatAreaResize",this._onChildPanelResize.bind(this))}}}[o];if(this._options.border&&this._options.stickyHeader&&this._options.caption)s=["ws-window-titlebar-wrapper","ws-float-area__close-button-wrapper","ws-sticky-header__block",["ws-window-titlebar ws-hidden","_generatedTitleContainer"]];else s=["ws-window-titlebar ws-hidden","_generatedTitleContainer"];var a={NO_STACK:[e,[this._options.className||"","ws-float-area ws-float-area-panel-overflow","ws-float-area-nostack-panel-overflow","ws-hidden",this._options.fixed?" ws-float-area-nostack-panel-overflow-fixed":"","_overflow","_visibleRoot","_visibleRootWrapper",["ws-float-area-nostack-panel-shadow","ws-float-area-nostack-panel-shadow-"+this._noStackShadowClassPostfix,"_containerShadow",s,[this._container]]]],STACK:[e,[this._options.className||"","ws-float-area-stack-cut-wrapper","_visibleRootWrapper","ws-sticky-header__wrapper","ws-hidden",["ws-sticky-header__header-container","ws-sticky-header__float-area_header-container"],["ws-float-area-stack-scroll-wrapper","_visibleRoot","ws-scrolling-content","ws-sticky-header__scrollable-container",["ws-float-area-panel-external-jeans"],["ws-float-area ws-float-area-panel-overflow","ws-float-area-stack-panel-overflow","_overflow",["ws-float-area-stack-panel-shadow","_containerShadow",s,[this._container]]]]]]};function r(t){var i,e,s,o=t.length;if("string"===typeof t[0])i=$("<div></div>"),e=0;else i=t[0],e=1;while(e<o){if("string"===typeof(s=t[e])){if(s)if("_"===s.charAt(0))this[s]=i;else i.addClass(s)}else i.append(r.call(this,s));e++}return i}for(var h in r.call(this,a[o]),n)if(n.hasOwnProperty(h)){var l;n[h].call(this,this[h])}var d=Object.keys(this._collapsedSides).reduce(function(t,i){if(!this._collapsedSides[i])t.push("ws-float-area-shadow-offset-"+i);return t}.bind(this),[]).join(" ");if(this._options.isStack)this._overflow.addClass(d);else this._containerShadow.addClass(d);if(this._useCss3&&this._useAnimation)this._containerShadow.addClass("ws-float-area-animation-"+this._options.animation),this._setAnimationDurationProperty(this._getAnimationLength()),this._containerShadow.bind("transitionend",g(this._transitionEnd,this))},_getAnimationLength:function(){return this._options.animationLength/1e3+"s"},_setAnimationDurationProperty:function(t){this._containerShadow.css({"-webkit-transition-duration":t,"-moz-transition-duration":t,"transition-duration":t})},_transitionEnd:function(){if(this._transitionEndHandler&&!this._options.disableCSS3AnimationEvent){var t=this._transitionEndHandler;this._transitionEndHandler=null,t.call(this)}},_setMinMaxSizes:function(){this._container.css({"min-width":this._options.minWidth}),this._maxWidthSet=-1,this._updateMinMaxWidthHeight()},_getCssIntProp:function(t,i,e){var s=this._memoizedFuncs,o=i+"-"+t;if(!s[o])s[o]=a(function(){return parseInt(e.css(t),10)||0},o);return s[o]()},_getShadowCssIntProp:function(t){return this._getCssIntProp(t,"shadow",this._containerShadow)},_getOverflowCssIntProp:function(t){return this._getCssIntProp(t,"overflow",this._overflow)},_prepareCloseButton:function(){var t="center"!==this._options.controlsSide?this._options.controlsSide:"right",i="click touchend";if(C.detection.isMobileSafari)this._closeButton=$('<a sbisname="floatAreaCloseButton" href="javascript:void(0)" class="ws-float-close sbisname-window-title-close ws-float-close-'+t+'"></a>'),i="click";else this._closeButton=$('<div sbisname="floatAreaCloseButton" class="ws-float-close sbisname-window-title-close ws-float-close-'+t+'"></div>');this._closeButton.bind(i,function(t){if(t.stopPropagation(),"touchend"===t.type)t.preventDefault();if(C.detection.firefox){var i=this.getActiveChildControl(void 0,true);if(i)i.setActive(false)}_._hideUnnecessaryAreas(this),this.sendCommand("hide")}.bind(this)),this._closeButton.css("margin-"+t,this._getShadowCssIntProp("margin-"+t)),this._addCommandButton(this._closeButton)},_hasMaximizeButton:function(){var t=isFinite(this._options.maxWidth)&&this._options.minWidth>0;return this._options.canMaximize&&t&&this._options.maxWidth!==this._options.minWidth},_addMaximizeButton:function(){var t="center"!==this._options.controlsSide?this._options.controlsSide:"right";this._maximizeButton=$('<div class="ws-float-area-maximize-btn ws-float-extend-'+t+'" title="'+rk("Свернуть")+"/"+rk("Развернуть")+'"></div>'),this._maximizeButton.mousedown(function(t){t.preventDefault()}),this._maximizeButton.click(function(){this._setMaximizeMode(!this._options.maximized)}.bind(this)),this._changeMaximizePanelMode(true),this._addCommandButton(this._maximizeButton)},_addCommandButton:function(t){var i,e=$(".ws-window-titlebar:first",this.getContainer().parent());if(this._options.isStack&&_._useTouch())t.css({overflow:"auto"});if(e.on("click",this._captionClickHandler),1!==(i=this._overflow.closest(".ws-float-area-stack-cut-wrapper").find(".ws-float-area__close-button-wrapper:first")).length)if(e.length)i=e.next();else if(this._getTemplateComponent())i=this._getTemplateComponent().getContainer();else t.toggleClass("ws-hidden",!this.isVisible()),i=this._overflow;i.append(t)},_captionClickHandler:function(){this.setActive(true)},_destroyCommandButtons:function(){if(this._closeButton)this._closeButton=void 0;if(this._maximizeButton)this._maximizeButton=void 0},_setVisibilityCommandButtons:function(t){if(this._closeButton)this._closeButton.toggleClass("ws-hidden",!t);this._setVisibleMaximizeButton(t)},_setVisibleMaximizeButton:function(t,i){if(t=false===this._showMaximizeButon?this._showMaximizeButon:t,this._maximizeButton)if(this._maximizeButton.toggleClass("ws-hidden",!t),i)this._changeMaximizePanelMode(t)},_changeMaximizePanelMode:function(t){this._visibleRoot.toggleClass("ws-float-area-has-maximized-button",t),this._visibleRootWrapper.toggleClass("ws-float-area-has-maximized-button",t)},_setMaximizeMode:function(t,i){if(!this._maximizeButton)return;var e=t?this._options.maxWidth:this._options.minWidth,s=_._getMaxWidthForAreaNew(this,this._options.minWidth,this._options.maxWidthWithoutSideBar),o=this._getTemplateComponent();if(s==this._options.minWidth)this._showMaximizeButon=false,this._setVisibleMaximizeButton(false,true),e=s;else{if(e>s)e=s;if(this._showMaximizeButon=true,this.isShow())this._setVisibleMaximizeButton(true,true)}if(this._options.maximized=t,this._visibleRoot.toggleClass("ws-float-area-maximized-mode",t),this._visibleRootWrapper.toggleClass("ws-float-area-maximized-mode",t),this._updateAreaWidth(e),this._updateStickyHeaderWidth(),_._changeMaximizeMode(),o)if(o._notifyOnSizeChanged(),o._options.isPanelMaximized=t,!i)o._notify("onChangeMaximizeState",t);if(this._notify("onChangeMaximizeState",t),C.detection.isIE10){var n=$(".controls-TabButton",this.getContainer());n.css("width","auto"),setTimeout(function(){n.css("width","")},150)}},_updateAreaWidth:function(t){this._visibleRoot.find(".ws-float-area").css("width",t+this._getBorderLeftWidth()),this.getContainer().css("width",t)},_getBorderLeftWidth:function(){return parseInt($(".ws-float-area-stack-panel-shadow",this._visibleRoot).css("border-left-width"),10)},_getTemplateComponent:function(){return this.getChildControls(void 0,false)[0]},_startHoverTimer:function(t){if(this._stopTimer("_hoverTimer"),this._stopTimer("_showTimer"),this.isOpened())if("delay"===this._stateStage)this._cancelShow();else this._hoverTimer=setTimeout(g(function(){if(!this.isLockShowed()&&!this._isPanelHovered&&!this._isLinkedPanel(t))this.sendCommand("hide")},this),U)},_isLinkedPanel:function(t){if(!t)return false;var i=$(t.relatedTarget),e;if(i.closest(".ws-info-box").length)return true;var s=i.closest(".controls-Popup")[0];if(s){var o=s.controlNodes[0]&&s.controlNodes[0].control,n=o&&o._options.opener;if(n){var a=$(n._container.closest(".ws-float-area-show-complete"))[0],r;return(a&&a.wsControl)===this}}return false},_elementMouseOver:function(){this._stopTimer("_hoverTimer"),this.show()},_hasStoredChildArea:function(t){return this._childWindows.indexOf(t)>-1},_childWindowClose:function(t,i){if(this._hasStoredChildArea(i))this._childWindows.splice(this._childWindows.indexOf(i),1)},_childWindowCreate:function(t,i){if(this.isOpened()){var e;if(!!n(R,c.instanceOfModule.bind(void 0,i))||c.instanceOfMixin(i,"SBIS3.CONTROLS/Mixins/PopupMixin")){var s=this._childWindowClose.bind(this,null,i);if(!this._hasStoredChildArea(i))this._childWindows.push(i);if(i.subscribe("onDestroy",g(s,this)),this._hoverTarget&&i.hasEvent("onAfterClose"))i.subscribe("onAfterClose",g(this._startHoverTimer,this))}}},_bindHoverEvents:function(){this._hoverTarget.bind("mouseenter.wsFloatAreaHover",g(this._elementMouseOver,this)).bind("mouseleave.wsFloatAreaHover",g(this._startHoverTimer,this))},_subscribeToMouseEvents:function(){var t=this;this.getContainer().on("mousemove.wsFloatAreaHover",function(){t._isPanelHovered=true}),this.getContainer().on("mouseout.wsFloatAreaHover",function(){t._isPanelHovered=false})},_prepareHover:function(){if(this.setHoverTarget(this._options.hoverTarget,false),this._overflow.bind("wsWindowOpen",this._childWindowCreate.bind(this)),this._overflow.bind("wsWindowClose",this._childWindowClose.bind(this)),this._hoverTarget)this._overflow.hover(this._stopTimer.bind(this,"_hoverTimer"),g(this._startHoverTimer,this)).bind("wsSubWindowOpen",g(this.lockShowed,this)).bind("wsSubWindowClose",g(this.unlockShowed,this))},_prepareArrow:Y(function(){var t=this._options.arrow;if("left"==t||"right"==t||"top"==t||"bottom"==t){var i="ws-float-area-arrow-"+t;this._visibleRoot.addClass(i)}}),_prepareKeydown:X(function(){var t=this._overflow.closest(".ws-float-area-stack-cut-wrapper").find(".ws-sticky-header__float-area_header-container");this._initKeyboardMonitor(t)}),_loadDescendents:function(){return this._loadTemplate()},_preparePanel:function(){this._loaded=true,this._initStack(),this._maxWidthSet=void 0,this._destroyCommandButtons();var t=this.getContainer().find(".ws-Window__title-border").first();if(0!==t.length)this._userTitle=t.find("[sbisname=windowTitle] span pre").first(),this._userTitle.empty();else this._userTitle=this.getContainer().find(".ws-window-titlebar-custom").first(),this._userTitle.addClass("ws-window-titlebar");if(this._options.border&&0===t.length)if(this._prepareCloseButton(),this._hasMaximizeButton())this._addMaximizeButton();else this._changeMaximizePanelMode(false);this._caption=void 0!==this._options.caption?this._options.caption:this._options.title,this._setTitleContainer(),this.setTitle(this._caption);var i={};if(!this._options.keepSize){if(!this._options.autoWidth)i["width"]=this._options.width+"px",i["overflow-x"]="auto";else i["overflow-x"]="hidden";if(!this._options.autoHeight&&!this._options.isStack)i["height"]=this._options.height+"px",i["overflow-y"]="auto";else i["overflow-y"]="hidden"}if(this._options.isStack)i["height"]="";if(!e(i))this._container.css(i)},_templateInnerCallbackBeforeReady:function(){if(this._showOnControlsReady)this._preparePanel()},_showControls:function(){if(tt.superclass._showControls.apply(this,arguments),this._autoShow&&this._showOnControlsReady)this._showInternal(false)},_loadControls:q("FloatArea.loadControls",function(t,i,e,s,o){var n=tt.superclass._loadControls,a=i instanceof w.CompoundControlTemplate,r,h,l,d,_,f,c,p,u;if(this._showOnControlsReady=this._options.showOnControlsReady||!a||!this._autoShow,this._showOnControlsReady){if("afterShow"!==this._focusState)this._focusState="afterLoadControls";u=n.apply(this,arguments)}else{if(r=b(this._collectControlsToBuild(i,e)[0]),h=m(r.type),l=null,this._options.buildMarkupWithContext)f=this._createContext(r,this.getLinkedContext()),_=f.context;else _=null;if(d=v.buildMarkupForClass(h,r,_,l,this._options))this._container.html(d);if(f&&f.craftedContext)this.once("onDestroy",function(){_.destroy()});if(this._preparePanel(),this._showInternal(false),c=[].slice.call(arguments),p=this._useAnimation?1.3*this._options.animationLength:0,"show"===this._state)setTimeout(g(function(){n.apply(this,c),this._runBatchDelayedFunc("_loadControls - "+this._id,function(){if("afterShow"===this._focusState)this._setFocus(),this._focusState=null;else this._focusState="afterLoadControls"})},this),p);else this._focusState="afterLoadControls",n.apply(this,c);u=t}return u}),_setFocus:function(){if(this._options.catchFocus)A(this._container);else this.setActivationIndex(r.getMaxActivisionIndex()+1)},_isTargetVisible:function(){function i(t){return 0===t.parent().length||"none"===t.css("display")||"hidden"===t.css("visibility")?t:i(t.parent())}var t=this._target.get(0)===window;if(!t)t=i(this._target).is(document);return t},_recalcPosition:Y(function(t,i,e){function s(t){var e=false;if("fixed"===t.css("position"))return true;return t.parents().each(function(t,i){if("fixed"===$(i).css("position"))return e=true,false}),e}var o=this._options;if(this._options.nativeEvent){var n={top:this._options.nativeEvent.clientY,left:this._options.nativeEvent.clientX,margin:0};return void this._overflow.css(n)}if((this.isVisible()||i)&&(o.fixed||t||this._isTargetVisible()))if(o.fixed){var a=o.offset||{},r=parseInt(a.x,10)||0,h=parseInt(a.y,10)||0,l={left:"",right:"",top:"",bottom:""},d=this._overflow,_=C.constants.$win,f={left:-1,right:1,top:-1,bottom:1},c=-1*f[o.side],p=-1*f[o.verticalAlign],u=k.getScrollingContainerFixedOffsets(),g,m;if("center"!==o.side)g=this._getShadowCssIntProp("margin-"+o.side),l[o.side]=r*c+g*f[o.side]+(u[o.side]||0);else l["left"]=(_.width()-d.outerWidth())/2+r*("left"===o.side?1:-1);if("center"!==o.verticalAlign)m=this._getShadowCssIntProp("margin-"+o.verticalAlign),l[o.verticalAlign]=h*p+m*f[o.verticalAlign]+(u[o.verticalAlign]||0);else l["top"]=(_.height()-d.outerHeight())/2+h*("top"===o.side?1:-1);this._overflow.css(l)}else{var w=this.getContainer().height();if(this._prevHeight<=w){var v=s(this._target),b;if(this._overflow.toggleClass("ws-float-area-nostack-panel-overflow-fixed",v),!e||!this._prevPositionOptions)b=G(this._overflow,this._target,o,v),this._prevPositionOptions=b();if(this._overflow.position(this._prevPositionOptions),this._options.isCompoundTemplate)this._overflow.toggleClass("controls-Popup-align-horizontal-left",K&&K.elementLeft!==parseInt(K.targetLeft,10))}this._prevHeight=w}}),_onResizeHandler:function(){tt.superclass._onResizeHandler.apply(this,arguments),this._resizeInner()},_resizeInner:function(){if(this._recalcPosition(),this._updateStickyHeaderWidth(),this._sizeUpdated(),this._firstSizeCalcOnShow)this._getScrollContainer().scrollTop(0),this._firstSizeCalcOnShow=false},_updateStickyHeaderWidth:function(){var t=this.getContainer().closest(".ws-float-area-stack-cut-wrapper"),i=t.children(".ws-sticky-header__header-container");if(i&&i.length){var e=t.children(".ws-sticky-header__scrollable-container")[0].getBoundingClientRect().width;i.css("width",e+"px")}},_onSizeChangedBatch:function(){if(tt.superclass._onSizeChangedBatch.apply(this,arguments),this._recalcPosition(),this._sizeUpdated(),this._firstSizeCalcOnShow)this._getScrollContainer().scrollTop(0),this._firstSizeCalcOnShow=false},show:function(){return this._prevPositionOptions=null,this._showInternal(true)},reload:function(s,o){this._loaded=false;var t=this._container.prop("style"),n=!!t.width;if(!n)t.width=getComputedStyle(this._container[0]).width;return this.setTemplate(this.getCurrentTemplateName()).addCallback(function(t){var i=this.getContainer().closest(".ws-float-area"),e=this.getContainer().prop("style");if(!n)e.width="";if(this._maxWidthSet===this._getMaxPanelWidth()&&!o){if(e.width!==this._width)if(this._width=Math.min(parseInt(this._width,10),this._getMaxPanelWidth())+"px",this._width)if(this._hasMaximizeButton())this._setMaximizeMode(this._options.maximized,true);else e.width=this._width,i.width(parseInt(e.width))}else this._updateMinMaxWidthHeight(),i.width(parseInt(e.width));if(setTimeout(function(){if(!this.isDestroyed())this._setFocus()}.bind(this),10),s)_._hideDependentAreas(this);return t}.bind(this))},_getScrollContainer:function(){return this._visibleRoot},_needRecalkInvisible:function(){return this._inApplyBatchUpdateIntermediate>0},_applyBatchUpdateIntermediate:function(){this._inApplyBatchUpdateIntermediate++;try{u.applyBatchUpdateIntermediate("FloatArea."+"applyBatchUpdateImmediate")}finally{this._inApplyBatchUpdateIntermediate--}},_showInternal:g(function(t){var i=this;if(this._cancelHide(),!this._loaded)this._autoShow=true;else if(!this.isDestroyed())if(!this.isOpened()&&"show"!==this._state){if(this._state="show",this._stateStage="delay",C.constants.browser.isMobileIOS&&_._stack.length>=D)return m(["SBIS3.CONTROLS/Utils/InformationPopupManager"],function(t){t.showMessageDialog({status:"error",message:rk("На вашем устройстве закончились ресурсы для открытия еще одного окна СБИС. Пожалуйста, закройте лишние окна и повторите попытку заново.")})}),void this._cancelShow();var e=this._createBatchUpdateWrapper("FloatArea._showInternal.doShow "+this.getId(),function(){if(this._stopAnimation(),this._target&&!this._isTargetVisible())this.hide();else{if(this._stateStage="beforeShow",_._beforeShowStarted(this),this._updateVisibleRootRightPadding(),this._updateMinMaxWidthHeight(true,true),this._visibleRootWrapper.css("visibility","hidden"),this._visibleRootWrapper.removeClass("ws-hidden"),!this._options.isStack)this._recalcPosition(void 0,true);if(this._notify("onBeforeShow"),"show"===this._state){if(this._stateStage="show",this._showDeferred=new y,this.moveToTop(),this._notifyFloatAreaZIndexChanged(),this._checkDelayedRecalk(),this._notifyOnSizeChanged(true),this._firstSizeCalcOnShow=true,this._useAnimation)this._toggleAnimationClasses(true),this._applyBatchUpdateIntermediate(),this._recalcPosition(void 0,true),this._getScrollContainer().scrollTop(0),this._doAnimation(this._getAnimationStartValue(),this._getAnimationEndValue(),this._finishShow.bind(this),0),_._addToAnimationQueue(this._showDeferred,this._animationQueue);else setTimeout(function(){i._applyBatchUpdateIntermediate(),i._finishShow()},0);_._showStarted(this),this._notify("onShow")}else _._beforeClose(this),_._afterClose(this),this._showDeferred=void 0;if(this._caption)this.getContainer().parent().find(".ws-window-titlebar").attr("title",this._caption).css("z-index",2);return this._showDeferred}});if(t)this._showTimer=setTimeout(e,this._options.showDelay);else e()}return true}),_setTitleContainer:g(function(){this._createTitle()}),_createTitle:function(){var t=function(t){this._generatedTitleContainer.toggleClass("ws-hidden",!t),this._container.css("padding-top",t?this._generatedTitleContainer.outerHeight()+"px":"")}.bind(this);if(this._userTitle.length){if(t(false),0===this._title.closest(this._userTitle).length)this._userTitle.prepend(this._title);this._title.addClass("ws-float-area-title").toggleClass("ws-hidden",!this._caption)}else if(this._options.border&&this._caption){if(0===this._title.closest(this._generatedTitleContainer).length)this._generatedTitleContainer.empty().append(this._title);this._title.addClass("ws-float-area-title ws-float-area-title-generated"),t(true)}else t(false)},_setTitle:J(function(t){this._caption=t,this._title.text(t),this._createTitle(),this._notifyOnSizeChanged(true)}),moveToTop:function(){if(this.isOpened()&&_._getMaxZIndex()!==this.getZIndex())r.releaseZIndex(this._zIndex),this._zIndex=this._prepareZIndex(),r.setVisible(this._zIndex),this._visibleRootWrapper.css("z-index",this._zIndex),this._childWindows.forEach(function(t){t.moveToTop()}),d.adjust()},getZIndex:function(){return this._zIndex},hide:g(function(t){return t=(this._result=void 0)===t?true:t,this._options.autoCloseOnHide?this.close(this._result,t):this._hide(t,H)}),_shouldHideByFocusMoveTo:function(t){var i=this,e=M.DOMEnvironment._goUpByControlTree(t._container),s=!t.isDestroyed();function o(t){for(var i=0;i<e.length;i++)if(t(e[i]))return true;return false}return s=(s=(s=s&&!o(function(t){return t===i||!!(c.instanceOfMixin(t,"Lib/Mixins/LikeWindowMixin")&&t.getZIndex&&t.getZIndex()>i.getZIndex())}))&&!o(function(t){return t instanceof tt&&!!t._options.hoverTarget}))&&(!o(function(t){return c.instanceOfModule(t,"Notes/View/Dynamic")})||!i._options.isStack)},_notifyFloatAreaZIndexChanged:function(){if(this._options.isStack){var t=_._getMaxZIndex();h.Bus.globalChannel().notify("FloatAreaZIndexChanged",t)}},_hideInner:function(e){function t(t){var i=function(){this._state="",this._visible=false,this._stateStage="",this._notify("onAfterVisibilityChange",false),r.releaseZIndex(this._zIndex),this._zIndex=null,d.adjust(),this._notifyFloatAreaZIndexChanged()}.bind(this);try{this._visibleRootWrapper.addClass("ws-hidden"),_._afterClose(this),r.deactivateWindow(this,i)}finally{if(this._notify("onClose"),this._notify("onAfterClose",this._result),t.callback(),!this.isDestroyed())this._container.addClass("ws-float-area-hide-complete"),e.call(this)}}var s,i=!this.isOpened();if(!i){if(s=this._cancelShow(),this._state="hide",C.detection.isMobileIOS)$(document.activeElement).trigger("blur");this._runInBatchUpdate("FloatArea.hide.animation - "+this._id+" "+this._options.template,function(){var i=new y;i.addErrback(function(t){return t});try{if(this._hideFinishFn=o.call(t.bind(this,i)),_._beforeClose(this),this._setVisibilityCommandButtons(false),this._toggleTrackTarget(false),this._useAnimation&&"show"===s)this._doAnimation(null,this._getAnimationStartValue(),this._hideFinishFn,_._getPanelHideAnimationDelay()),_._addToAnimationQueue(i,this._animationQueue);else this._hideFinishFn()}catch(t){i.errback(t)}return i})}return i},_addHidePending:function(t){if(!this._hasHidePendig){var i=new y;return this._hasHidePendig=true,i.addCallback(function(){this._hasHidePendig=false;var t=this._saving;return this._saving=void 0,this.finishChildPendingOperations(t)}.bind(this)),this.waitAllPendingOperations(i.addCallback(this._hideInner.bind(this,t)))}return true},_hide:function(t,a){function r(){if(!d.length){if(h=this._addHidePending(a),l instanceof y)l.callback();return true}var t=this,i=d[d.length-1],e=g(function(){n.call(this),d.pop(),r.apply(t)}),s=g(function(t,i){if(false===t.getResult())if(n.call(this),l instanceof y)l.errback()}),o=g(function(t,i){if(false===i)n.call(this)});function n(){this.unsubscribe("onDestroy",e),this.unsubscribe("onAfterClose",e),this.unsubscribe("onBeforeClose",s),this.unsubscribe("onConfirmDialogSelect",o)}return i.once("onDestroy",e),i.once("onAfterClose",e),i.once("onBeforeClose",s),i.once("onConfirmDialogSelect",o),i.close(),false}if("hide"===this._state)return false;var i,h;if(t=void 0===t?true:t,this._state="hide",i=this._notify("onBeforeClose",this._result),(h=false!==i)&&"hide"===this._state){this._closeVDOMInfobox(),this._state="",h=this._loaded;var l=true,d=[];if(h){if(!this.isLockShowed(t,d)&&"hide"!==this._state)if(h=!(this._state||this._visible))a.call(this);else if(!r.apply(this))l=new y,this._deferClose=true,l.addCallbacks(function(){this._deferClose=false}.bind(this),function(t){return t})}else this._autoShow=false;return true===l?h:l}else if("hide"===this._state)return this._state="",false},_closeVDOMInfobox:function(){if(!s()){var t="Controls/Popup/Compatible/ManagerWrapper/Controller";if(requirejs.defined(t)){var i=requirejs(t);if(i.getGlobalPopup())i.getGlobalPopup()._popupBeforeDestroyedHandler(null,null,null,this.getContainer()[0])}}},close:g(function(t,i){i=void 0===i?true:i;var e=this._result,s;if(this._result=t,this._saving=t,true===(s=this._hide(i,this.destroy)))return true;else if(i)this._result=t;else this._result=e;return false}),ok:function(){return this.close(true)},cancel:function(){return this.close(false)},isVisible:function(){return!this._state&&this._visible},isShow:function(){return this.isVisible()},isOpened:function(){return this._visible&&""===this._state||"show"===this._state},_stopAnimation:function(){if(this._state&&this._useAnimation)this._containerShadow.stop(true),this._toggleAnimationClasses(false)},_stopTimer:function(t){if(this[t])clearTimeout(this[t]),this[t]=void 0},_getAnimationStartValue:function(){var t=this._options.direction,i,e,s,o,n,a;if("slide"===this._options.animation){if("left"===t||"right"===t)i="X",e="left"===t?1:-1,s="outerWidth",o="startWidth";else i="Y",e="top"===t?1:-1,s="outerHeight",o="startHeight";a=["transform","translate"+i+"("+(n=this._containerShadow[s](true)-this._options[o])*e+"px)"]}else if("fade"===this._options.animation)a=["opacity","0"];else if("off"!==this._options.animation)throw new Error(rk("Ошибочная опция animation"));return a},_getAnimationEndValue:function(){var t=this._options.direction,i;if("slide"===this._options.animation)i=["transform","translateX("+0+"px)"];else if("fade"===this._options.animation)i=["opacity","1"];else if("off"!==this._options.animation)throw new Error(rk("Ошибочная опция animation"));return i},_toggleAnimationClasses:function(t){"fade"!==this._options.animation&&this._overflow.toggleClass("ws-float-area-animate",t)},_doAnimation:function(t,i,e,s){this._stopAnimation(),this._toggleAnimationClasses(true);var o=function(t){if(this._useCss3)this._containerShadow.css({"transition-property":t?"":"none"})}.bind(this),n=function(){this._setAnimationDurationProperty(""),this._containerShadow.css(i[0],""),setTimeout(function(){this._setAnimationDurationProperty(this._getAnimationLength()),this._toggleAnimationClasses(false)}.bind(this),0),this._containerShadow.css({"will-change":"auto"}),e()}.bind(this);if(t)o(false),this._containerShadow.css(t[0],t[1]),this._visibleRootWrapper.css("visibility","visible");var a=function(){var t;if("fade"===this._options.animation&&"opacity"==i[0]&&1==i[1])this._setVisibilityCommandButtons(true);if(this._useCss3)this._containerShadow.css({"will-change":"transform"}),requestAnimationFrame(function(){o(true),this._transitionEndHandler=n,this._containerShadow.css(i[0],i[1]);var t=this._options.animationLength;if(this._options.disableCSS3AnimationEvent)setTimeout(n,t);_._fixCss3TransitionEndEvent(this._containerShadow.get(0),i[0],i[1],t)}.bind(this));else(t={})[i[0]]=i[1],this._containerShadow.animate(t,this._options.animationLength,n)}.bind(this);this._stopTimer("_beforeAnimationTimer"),this._beforeAnimationTimer=setTimeout(a,Math.max(s,10))},_finishShow:g(function(){if(this._state="",this._visible=true,this._notify("onAfterVisibilityChange",true),this._isModal)r.setVisible(this.getZIndex()),d.adjust();try{if(this._toggleTrackTarget(true),this._setVisibilityCommandButtons(true),this._visibleRootWrapper.css("visibility","visible"),this.moveToTop(),_._finishShow(this),this._options.catchFocus)this._moveFocusToSelf();this._runBatchDelayedFunc("onAfterShow",function(){if("afterLoadControls"===this._focusState)this._setFocus(),this._focusState=null;else this._focusState="afterShow";setTimeout(function(){if(!this.isDestroyed()&&!this._isShowCanceled)this._notify("onAfterShow");this._isShowCanceled=false}.bind(this),400)}),this._updateStickyHeaderWidth()}finally{var t=this._showDeferred;if(this._showDeferred=void 0,t.callback(),this._container.addClass("ws-float-area-show-complete"),this._toggleAnimationClasses(false),C.detection.isMobileSafari)setTimeout(g(function(){this.getContainer().closest(".ws-float-area-stack-panel-overflow").addClass("ws-ipad-scrolling-content-fix")}.bind(this),this),2e3)}}),_stopTimers:function(){this._stopTimer("_showTimer"),this._stopTimer("_beforeAnimationTimer"),this._stopTimer("_hoverTimer")},_cancelShow:function(){if(u.haveBatchUpdate())u.endBatchUpdate("FloatArea._showInternal.doShow "+this.getId());this._container.removeClass("ws-float-area-show-complete"),this._stopTimers();var t=this._stateStage;if("show"===this._state){this._isShowCanceled=true;try{if(this._stopAnimation(),"beforeShow"===t)this._visibleRootWrapper.addClass("ws-hidden");if(this._showDeferred){var i=this._showDeferred;this._showDeferred=void 0,i.callback()}}finally{this._state="",this._stateStage=""}}return t},_cancelHide:function(){if(this._container.removeClass("ws-float-area-hide-complete"),"show"!==this._state)this._stopTimers();if("hide"===this._state)try{if(this._stopAnimation(),this._hideFinishFn){var t=this._hideFinishFn;this._hideFinishFn=function(){},t()}}finally{this._state=""}},canAcceptFocus:function(){return this._visible},_isAcceptKeyEvents:function(){return true},_keyboardHover:function(t){var i,e;if(!t.shiftKey&&t.which===C.constants.key.esc){if(t.stopPropagation(),t.stopImmediatePropagation(),(e=(i=_._getTopFloatArea())&&i.control)!==this&&!!e._state)e.sendCommand("hide");else this.sendCommand("hide");return false}return tt.superclass._keyboardHover.apply(this,arguments)},_childrenLoadCallback:function(){},_toggleTrackTarget:Y(function(t){var i=this._target&&this._target.length,e=C.constants.$win,s=function(){if(e.unbind("resize",this._windowResizeHandler),i)x(this._target,false)}.bind(this);if(!this._options.trackTarget)return;if(!this._windowResizeHandler)this._windowResizeHandler=function(){this._recalcPosition(void 0,void 0,true)}.bind(this);if(s(),t)if(e.bind("resize",this._windowResizeHandler),!this._options.fixed&&i)x(this._target).subscribe("onMove",g(function(t,i,e){if(this._options.closeOnTargetScroll&&!e)this.close();else this._recalcPosition(i,void 0,!e)},this)).subscribe("onVisible",g(function(t,i){var e=this._notify("onTargetVisibilityChange",i)},this))}),destroy:function(){if(this._cancelShow(),this._cancelHide(),this._toggleTrackTarget(false),r.releaseZIndex(this._zIndex),d.adjust(),_._removeArea(this),$(".ws-window-titlebar:first",this.getContainer().parent()).off("click",this._captionClickHandler),tt.superclass.destroy.apply(this,arguments),this._visibleRootWrapper.remove(),this._hoverTarget)this._hoverTarget.unbind(".wsFloatAreaHover");var t=this._childWindows.map(function(t){return t});if(this._options.closeChildWindows)t.forEach(function(t){if(!t.isDestroyed())t.destroy()});if(!this._options.fixed)this.setTarget(null);for(var i in this._memoizedFuncs)if(this._memoizedFuncs.hasOwnProperty(i)){var e=this._memoizedFuncs[i];if(e&&e.reset)e.reset();delete this._memoizedFuncs[i]}a.clear(this);var s=$();this._target=s,this._options.target=s,this._visibleRoot=s,this._visibleRootWrapper=s,this._overflow=s,this._containerShadow=s,this._generatedTitleContainer=s,this._hoverTarget=s,this._prevPositionOptions=null},isAutoHide:function(){return this._options.autoHide},_updateMinMaxWidthHeight:X(function(t,i){var e,s=this._options.minWidth,o=this._getMaxPanelWidth(),n=this._options.maxWidth!==1/0,a;if(this._options._isCompatibleArea&&this._options.minimizedWidth&&false===this._options.maximized)s=o=this._options.minimizedWidth;if(this._maxWidthSet!==o)if(e=this._container.prop("style"),this._maxWidthSet=o,e.maxWidth=o+"px",this._getFixedWidth.reset(),this._hasMaximizeButton())this._setMaximizeMode(this._options.maximized,true);else if(n)e.width=Math.max(s,Math.min(this._options.maxWidth,o))+"px";else if(C.constants.browser.isIE&&s>0&&""===e.width&&Q().hasClass("engine-OnlineBaseInnerMinCoreView"))e.width=s+"px";if(this._needStackPanelHeightRecalc()&&(t||i)){if(e=e||this._container.prop("style"),a=this._getContainerMinHeight()+"px",t)e.minHeight=a;if(i)e.height=a}}),_getMaxPanelWidth:function(){if(this._hasMaximizeButton())return _._getMaxWidthForAreaNew(this,this._options.minWidth,this._options.maxWidthWithoutSideBar);return Math.max(this._options.minWidth,_._getMaxWidthForArea(this,this._options.minWidth))},_needStackPanelHeightRecalc:function(){return this._needPanelHeightRecalc()&&this._options.isStack},_needPanelHeightRecalc:function(){return P&&this.getContainer().closest(".ws-float-area__height-auto").length},_postUpdateResizer:function(){},isBlockLayout:function(){return-1===this._options.className.indexOf("ws-float-area__height-auto")},_updateVisibleRootRightPadding:X(function(){var t=_._getPanelRootPaddingRight(this,!this.isBlockLayout());if(t>0)this._visibleRoot.css("padding-right",t),this._visibleRootWrapper.css("right",0);else this._visibleRoot.css("padding-right",0),this._visibleRootWrapper.css("right",t)}),_getContainerMinHeight:function(){var t=this._generatedTitleContainer,i=t.hasClass("ws-hidden")?0:t.outerHeight();return _._getWindowHeight()-i},_sizeUpdated:function(t){var i=this._container.prop("style"),e=Object.keys(this._childPanelSizes).reduce(function(t,i){return Math.max(t,this._childPanelSizes[i])}.bind(this),0),s;if(this._needStackPanelHeightRecalc()){if(s=Math.max(e,this._getContainerMinHeight()),"auto"!==i.height)i.height="auto";if(i.minHeight)i.minHeight="";if(this._container.height()<=s)i.height=s+"px",this._getFixedHeight.reset()}else this._overflow.css("min-height",e+"px");if(this._updateMinMaxWidthHeight(true,false),t)this._updateVisibleRootRightPadding(),this._onResizeHandler();if(this.isVisible())_._updateSideBarVisibility();if(!this._options.isStack)if(I.isMobilePlatform&&_._useTouch()&&window.requestAnimationFrame)window.requestAnimationFrame(function(t){var i={"-webkit-overflow-scrolling":"auto"},e={"-webkit-overflow-scrolling":""};t.css(i),window.requestAnimationFrame(g(t.css.bind(t,e),this))}.bind(this,this._visibleRoot))},_subscribeToWindowResize:function(){},_restoreSize:function(){},_calculatePositionHorisontal:function(){},_calculatePositionVertical:function(){},toggle:function(){if("show"==this._state||this._visible)this.hide();else this.show()},setTarget:Y(function(t){if(this._options.fixed)throw new Error(rk("Опция fixed не совместима с заданием target-а - при fixed=true таргетом всегда будет window"));if(this._toggleTrackTarget(false),this._scrollUnsub)this._scrollUnsub();if(t){if(this._target=$(t),!this._options._dontCheckScrollParent)this._scrollUnsub=_.scrollParentFloatArea(this._visibleRoot,this._target)}else this._target=$(),this._scrollUnsub=null;if(this.isVisible())this._toggleTrackTarget(true);var i=_._getFloatAreaContentRoot(),e=this._visibleRootWrapper;if(!this._isModal&&this._target.closest(i).length){if(!e.closest(i).length){if(this._options.task1173269044)i=_._getFloatAreaBodyContainerRoot();e.appendTo(i)}}else if(e.closest(i).length)e.appendTo(Q())}),setOffset:function(t){this._options.offset=t,this._recalcPosition(null,true)},getTarget:function(){return this._target},getOffset:function(){return p(this._options.offset)},storeActiveChild:function(t){this.setChildActive(t)},getTemplateName:function(){return this._options.template},lockShowed:function(){++this._locksShowed},unlockShowed:function(){if(0===--this._locksShowed&&this._hoverTimer)this._startHoverTimer()},isLockShowed:function(t,i){i=i||[],t=t||false;var e=[],s,o,n;if(this._locksShowed>0)return true;else{for(s=0,o=this._childWindows.length;s<o;s++){if(n=this._childWindows[s],c.instanceOfModule(n,"Deprecated/Controls/FilterFloatArea/FilterFloatArea")){e.push(s);continue}if(n.isVisible()||n instanceof tt&&n.isOpened()){if(!t)return true;i.push(this._childWindows[s])}}if(e.length)for(s=0,o=e.length;s<o;s++)this._childWindows[e[s]].hide();return false}},setHoverTarget:function(t,i){if(this._hoverTarget)this._hoverTarget.unbind(".wsFloatAreaHover");if(this._options.hoverTarget=t,this._hoverTarget=$(this._options.hoverTarget).length?$(this._options.hoverTarget):void 0,this._hoverTarget)this._bindHoverEvents(),this._subscribeToMouseEvents(),this.once("onAfterShow",g(function(){if(!this._hoverTarget.is(":hover")&&!this.getContainer().is(":hover")&&!this._hoverTarget.attr("data-mouse-hover"))this._startHoverTimer()},this));if(i)this._stopTimer("_hoverTimer")},getHoverTarget:function(){return this._hoverTarget},focusCatch:function(t){if(r.disableLastActiveControl(),t.shiftKey)r.focusToFirstElement();else r.focusToLastElement();return true},setHideSideBar:function(t){this._options.hideSideBar=t},_templateOptionsFilter:function(){var t;return tt.superclass._templateOptionsFilter.apply(this,arguments).concat("border","caption")},setHasPopupInside:function(t){if(this._options.isStack&&C.detection.isMobileIOS)_._toggleHasPopupInside(this.getId(),t)}});return tt});