text: (function(){var e=window.BX;e.namespace("BX.UI");if(!!e.UI.Selector.Navigation){return}e.UI.Selector.Navigation=function(e){this.selectorInstance=e.selectorInstance;this.selectorManager=this.selectorInstance.manager};e.UI.Selector.Navigation.create=function(t){return new e.UI.Selector.Navigation(t)};e.UI.Selector.Navigation.prototype.checkKeyboardNavigation=function(e){var t=e.keyCode?e.keyCode:false,s=e.tab?e.tab:false;if(t==37){this.moveCurrentItem({tab:s,direction:"left"});return"move"}else if(t==38){this.moveCurrentItem({tab:s,direction:"up"});return"move"}else if(t==39){this.moveCurrentItem({tab:s,direction:"right"});return"move"}else if(t==40){this.moveCurrentItem({tab:s,direction:"down"});return"move"}else if(t==13){this.selectCurrentItem({tab:s,keyCode:t});return"enter"}else if(t==32&&s!="search"){this.selectCurrentItem({tab:s,keyCode:t});return"space"}return false};e.UI.Selector.Navigation.prototype.selectCurrentItem=function(t){var s=t.tab,o=typeof t.keyCode!="undefined"&&t.keyCode==13;if(!this.selectorInstance.popups.search&&!this.selectorInstance.popups.main&&!this.selectorInstance.popups.container){return}if(s=="search"){clearTimeout(this.selectorInstance.timeouts.search);this.selectorInstance.getSearchInstance().abortSearchRequest()}var n=this.selectorInstance.cursors[s].currentItem;if(e.type.isNotEmptyObject(n)){var r=this.selectorInstance.getItemNodeId({entityType:n.entityType,itemId:n.itemCode});if(e(r)){this.selectorInstance.selectItem({entityType:e(r).getAttribute("data-entity-type"),itemNode:e(r),itemId:n.itemCode,tab:s})}if(o){this.selectorInstance.cursors[s].currentItem=null;if(this.selectorInstance.isDialogOpen()){this.selectorInstance.closeDialog()}this.selectorInstance.closeSearch()}}};e.UI.Selector.Navigation.prototype.selectFirstItem=function(t){var s=t.tab;if(!this.selectorInstance.popups.search&&!this.selectorInstance.popups.main&&!this.selectorInstance.popups.container){return}if(s=="search"){clearTimeout(this.selectorInstance.timeouts.search);this.selectorInstance.getSearchInstance().abortSearchRequest()}var o=this.selectorInstance.cursors[s].firstItem;if(e.type.isNotEmptyObject(o)){var n=this.selectorInstance.getItemNodeId({entityType:o.entityType,itemId:o.itemCode});if(e(n)){this.selectorInstance.selectItem({entityType:e(n).getAttribute("data-entity-type"),itemNode:e(n),itemId:o.itemCode})}}};e.UI.Selector.Navigation.prototype.moveCurrentItem=function(t){var s=t.direction,o=t.tab;if(!s){return}if(this.selectorInstance.popups.search==null&&this.selectorInstance.popups.main==null&&this.selectorInstance.popups.container==null){return}this.selectorInstance.resultChanged[o]=true;if(o=="search"&&this.selectorInstance.searchXhr){this.selectorInstance.getSearchInstance().abortSearchRequest();this.selectorInstance.getSearchInstance().hideSearchWaiter()}if(!e.type.isNotEmptyObject(this.selectorInstance.cursors[o])){return}var n=false;switch(s){case"left":if(this.selectorInstance.cursors[o].position.column==1){if(typeof this.selectorInstance.result[o][this.selectorInstance.cursors[o].position.group][this.selectorInstance.cursors[o].position.row][this.selectorInstance.cursors[o].position.column-1]!="undefined"){this.selectorInstance.cursors[o].position.column--;n=true}}break;case"right":if(this.selectorInstance.cursors[o].position.column==0&&typeof this.selectorInstance.result[o][this.selectorInstance.cursors[o].position.group]!="undefined"&&typeof this.selectorInstance.result[o][this.selectorInstance.cursors[o].position.group][this.selectorInstance.cursors[o].position.row][this.selectorInstance.cursors[o].position.column+1]!="undefined"){this.selectorInstance.cursors[o].position.column++;n=true}break;case"up":if(this.selectorInstance.cursors[o].position.row>0&&typeof this.selectorInstance.result[o]!="undefined"&&typeof this.selectorInstance.result[o][this.selectorInstance.cursors[o].position.group][this.selectorInstance.cursors[o].position.row-1]!="undefined"&&typeof this.selectorInstance.result[o][this.selectorInstance.cursors[o].position.group][this.selectorInstance.cursors[o].position.row-1][this.selectorInstance.cursors[o].position.column]!="undefined"){this.selectorInstance.cursors[o].position.row--;n=true}else if(this.selectorInstance.cursors[o].position.row==0&&typeof this.selectorInstance.result[o]!="undefined"&&typeof this.selectorInstance.result[o][this.selectorInstance.cursors[o].position.group-1]!="undefined"&&typeof this.selectorInstance.result[o][this.selectorInstance.cursors[o].position.group-1][this.selectorInstance.result[o][this.selectorInstance.cursors[o].position.group-1].length-1]!="undefined"&&typeof this.selectorInstance.result[o][this.selectorInstance.cursors[o].position.group-1][this.selectorInstance.result[o][this.selectorInstance.cursors[o].position.group-1].length-1][0]!="undefined"){this.selectorInstance.cursors[o].position.row=this.selectorInstance.result[o][this.selectorInstance.cursors[o].position.group-1].length-1;this.selectorInstance.cursors[o].position.column=0;this.selectorInstance.cursors[o].position.group--;n=true}break;case"down":if(typeof this.selectorInstance.result[o]!="undefined"&&typeof this.selectorInstance.result[o][this.selectorInstance.cursors[o].position.group][this.selectorInstance.cursors[o].position.row+1]!="undefined"&&typeof this.selectorInstance.result[o][this.selectorInstance.cursors[o].position.group][this.selectorInstance.cursors[o].position.row+1][this.selectorInstance.cursors[o].position.column]!="undefined"){this.selectorInstance.cursors[o].position.row++;n=true}else if(typeof this.selectorInstance.result[o]!="undefined"&&typeof this.selectorInstance.result[o][this.selectorInstance.cursors[o].position.group][this.selectorInstance.cursors[o].position.row+1]!="undefined"&&typeof this.selectorInstance.result[o][this.selectorInstance.cursors[o].position.group][this.selectorInstance.cursors[o].position.row+1][0]!="undefined"){this.selectorInstance.cursors[o].position.column=0;this.selectorInstance.cursors[o].position.row++;n=true}else if(typeof this.selectorInstance.result[o]!="undefined"&&this.selectorInstance.cursors[o].position.row==this.selectorInstance.result[o][this.selectorInstance.cursors[o].position.group].length-1&&typeof this.selectorInstance.result[o][this.selectorInstance.cursors[o].position.group+1]!="undefined"&&typeof this.selectorInstance.result[o][this.selectorInstance.cursors[o].position.group+1][0]!="undefined"&&typeof this.selectorInstance.result[o][this.selectorInstance.cursors[o].position.group+1][0][0]!="undefined"){this.selectorInstance.cursors[o].position.group++;this.selectorInstance.cursors[o].position.row=0;this.selectorInstance.cursors[o].position.column=0;n=true}break;default:}if(n){var r=this.selectorInstance.cursors[o].currentItem;var c=this.selectorInstance.getItemNodeId({entityType:r.entityType,itemId:r.itemCode});if(e(c)){this.selectorInstance.getRenderInstance().unhoverItem({node:e(c)})}r=this.selectorInstance.result[o][this.selectorInstance.cursors[o].position.group][this.selectorInstance.cursors[o].position.row][this.selectorInstance.cursors[o].position.column];this.selectorInstance.cursors[o].currentItem=r;c=this.selectorInstance.getItemNodeId({entityType:r.entityType,itemId:r.itemCode});if(e(c)){var i=0,a=e(c);var u=e.findParent(this.selectorInstance.dialogNodes.contentsContainer,{className:this.selectorInstance.getRenderInstance().class.boxContainer});if(u){var l=e.pos(u),I=e.pos(a);if(I.bottom>l.bottom||I.top<l.top){u.scrollTop+=I.bottom>l.bottom?I.bottom-l.bottom:I.top-l.top}this.selectorInstance.getRenderInstance().hoverItem({node:a})}}}};e.UI.Selector.Navigation.prototype.hoverFirstItem=function(t){var s=t.tab;if(typeof this.selectorInstance.cursors[s]=="undefined"){return}var o=this.selectorInstance.cursors[s].firstItem;if(!o){return}var n=this.selectorInstance.getItemNodeId({entityType:o.entityType,itemId:o.itemCode});if(!e(n)){return}this.selectorInstance.getRenderInstance().hoverItem({node:e(n)})}})();
  //# sourceMappingURL=navigation.map.js