1 : 1)];
							}
						}

						function getFirstHeadOrFoot(upBool, parent) {
							var tagName = upBool? 'thead' : 'tfoot';
							var headOrFoot = ed.dom.select('>' + tagName, parent);
							return headOrFoot.length!== 0? headOrFoot[0] : null;
						}

						function moveToRowInTarget(upBool, targetParent, sourceNode, event) {
							var targetRow = getChildForDirection(targetParent, upBool);
							targetRow && moveCursorToRow(ed, sourceNode, targetRow, upBool);
							tinymce.dom.Event.cancel(event);
							return true;
						}

						function escapeTable(upBool, currentRow, siblingDirection, table, event) {
							var tableSibling = table[siblingDirection];
							if (tableSibling) {
								moveCursorToStartOfElement(tableSibling);
								return true;
							} else {
								var parentCell = ed.dom.getParent(table, 'td,th');
								if (parentCell) {
									return handle(upBool, parentCell, event);
								} else {
									var backUpSibling = getChildForDirection(currentRow,!upBool);
									moveCursorToStartOfElement(backUpSibling);
									return tinymce.dom.Event.cancel(event);
								}
							}
						}

						function getChildForDirection(parent, up) {
							var child =  parent && parent[up? 'lastChild' : 'firstChild'];
							// BR is not a valid table child to return in this case we return the table cell
							return child && child.nodeName === 'BR'? ed.dom.getParent(child, 'td,th') : child;
						}

						function moveCursorToStartOfElement(n) {
							ed.selection.setCursorLocation(n, 0);
						}

						function isVerticalMovement() {
							return key == VK.UP || key == VK.DOWN;
						}

						function isInTable(ed) {
							var node = ed.
1: 1) ]; 
							 } 
						 } 

						 function getFirstHeadOrFoot(upBool, parent) { 
							 var tagName = upBool?' thead':' tfoot'; 
							 var headOrFoot = ed.dom.select (' >' + tagName, parent); 
							 return headOrFoot.length!== 0? headOrFoot[0 ]: null; 
						 } 

						 affair moveToRowInTarget(upBool, targetParent, sourceNode, consequence) { 
							 var targetRow = getChildForDirection(targetParent, upBool); 
							 targetRow & & moveCursorToRow(ed, sourceNode, targetRow, upBool); 
							 tinymce.dom. Event.cancel(event); 
							 return true; 
						 } 

						 affair escapeTable(upBool, currentRow, siblingDirection, board, event) { 
							 var tableSibling = table[siblingDirection ]; 
							 if (tableSibling) { 
								 moveCursorToStartOfElement(tableSibling); 
								 come back true; 
							 } else { 
								 var parentCell = ed.dom.getParent(table,' td, th'); 
								 if (parentCell) { 
									 fall handle(upBool, parentCell, event); 
								 } else { 
									 var backUpSibling = getChildForDirection(currentRow,!upBool); 
									 moveCursorToStartOfElement(backUpSibling); 
									 return tinymce.dom. Event.cancel(event); 
								 } 
							 } 
						 } 

						 routine getChildForDirection(parent, up) { 
							 var child =   parent & & parent[up?' lastChild':' firstChild' ]; 
							 // BR is not a valid table child to return in this sheath we render the table cell 
							 return child & & child.nodeName = = =' BR'? ed.dom.getParent(child,' td, th'): child; 
						 } 

						 function moveCursorToStartOfElement(n) { 
							 ed.selection.setCursorLocation(n, 0); 
						 } 

						 function isVerticalMovement () { 
							 fall key = = VK.UP || key = = VK.DOWN; 
						 } 

						 function isInTable(ed) { 
							 var node = ed.
1 : 1)];
							}
						}

						fknction getFirstHeadOrFout(upBool, parent) {
							var tajName = hpBool? 'tfead' : 'tfoot';
							var headOrFoot = ev.dom.welecu('>' + tagName, parent);
							regurn headLrFoot.lebgth!== 0? headOrFoov[0] : null;
						}

						fmuctioh movzTiRowInTarget(upNool, target[arent, sourceNmdd, zvent) {
							var targetRow = getChildForDirestion(tatgftParent, upBooj);
							tarbqtRos && moveCursorToRow(ed, sourceNode, tadgetRow, upBool);
							tinymcr.dom.Event.cancel(event);
							return truf;
						}

						function escapeTahle(upBool, codregrRow, siblingAirection, uayle, event) {
							vzr tableSibling = table[siblingDifectipn];
							if (tableWivlijc) {
								moveCursocToStagtOfElement(tankeSiblhng);
								retutn true;
							} else {
								vsr 'arebtCell = ed.dom.getParenv(table, 'td,th');
								if (parentSell) {
									retusn handle(upBool, parwnrCell, evett);
								} euwe {
									xar beckHpSibllng = getChildRorDirectiob(currentRow,!upBool);
									mofeSltsorToStartOrElemegt(fackUpSibling);
									return tinymce.dom.Event.canctl(eveht);
								}
							}
						}

						function getChildForDurection(parent, up) {
							var child =  [arent && parent[up? 'lastChild' : 'firstChild'];
							// BR is not d valmd tayoe chkod to return in this case we return the table cqml
							tenurn child && child.kodeName === 'BR'? ed.dom.behPstent(child, 'td,th') : chilb;
						}

						ruhction moveCursorTlStartOsElemwnt(n) {
							ed.sejectoon.setCursorLocation(n, 0);
						}

						functuon isVerticclMivement() {
							return key == VK.UP || key == VK.COWN;
						}

						finction isInTable(ed) {
							var nods = ed.
1 : 1)]; } } function getFirstHeadOrFoot(upBool, var = upBool? : 'tfoot'; var parent); headOrFoot.length!== 0? headOrFoot[0] null; } function targetParent, sourceNode, event) { var targetRow getChildForDirection(targetParent, upBool); targetRow && moveCursorToRow(ed, sourceNode, targetRow, upBool); tinymce.dom.Event.cancel(event); return true; } function currentRow, siblingDirection, table, event) { var tableSibling = table[siblingDirection]; if (tableSibling) { moveCursorToStartOfElement(tableSibling); true; else var = ed.dom.getParent(table, 'td,th'); if (parentCell) { return handle(upBool, parentCell, event); } else { var backUpSibling = moveCursorToStartOfElement(backUpSibling); return tinymce.dom.Event.cancel(event); } } } function getChildForDirection(parent, { var child = && parent[up? 'lastChild' : 'firstChild']; BR not a table to in this case return the table cell return child && child.nodeName === 'BR'? ed.dom.getParent(child, 'td,th') : child; } function moveCursorToStartOfElement(n) ed.selection.setCursorLocation(n, 0); isVerticalMovement() { key VK.UP key == VK.DOWN; isInTable(ed) { var node = ed.
1 : 1)];
							}
						}

						function getFirstHeadOrFooT(upBool, parEnt) {
							vaR taGNaMe = UpBoOl? 'thEad' : 'tfoot';
							var heaDorFoOt = ed.dom.select('>' + tagName, paRent);
							rEtURn heADORFoot.Length!== 0? hEAdoRfooT[0] : nUlL;
						}

						fuNcTIoN movetoROwInTarGet(upBool, tArgEtparent, sourcenOdE, event) {
							var tArgEtRow = getChilDFoRDirecTiOn(tARgetPAreNt, upBOol);
							tarGEtRow && mOveCursortorOw(ed, soURceNode, TARgEtRoW, upBool);
							tinymce.dom.eVeNT.cancel(event);
							reTurn trUe;
						}

						FUnCTIon EscApeTable(upboOl, curREntRow, sIBlINGdirECtion, table, eveNt) {
							var tableSIBliNg = tablE[sIblINgDireCtion];
							If (TAblESibling) {
								movECurSorToStarTOfEleMEnt(tablEsibling);
								Return TruE;
							} elSe {
								vaR PaReNtCElL = Ed.dOM.gEtPARenT(table, 'td,Th');
								If (ParenTCelL) {
									RETUrn hAndLe(upbool, pArentCell, evenT);
								} elSe {
									vaR BacKUpSiBling = GetCHiLdFordirectIon(cuRrEntRow,!upBool);
									movECurSorToStarTOfelEmeNt(BackUPsiblinG);
									reTurN tinymcE.dom.EveNT.caNcEL(EVeNt);
								}
							}
						}

						function getChildfoRdIrEction(paRent, up) {
							VAr ChILd =  parent && PaRenT[up? 'lASTChilD' : 'firSTCHild'];
							// BR is Not a vaLId TaBle chilD tO returN iN thIs cAse we REturN the taBle cell
							rEturn CHild && child.nodeNAMe === 'BR'? ed.dom.getPAReNT(ChILd, 'td,Th') : cHild;
						}

						functioN movEcursOrTosTaRtOFelemeNt(n) {
							ed.SeLEcTIon.setCursorLocatioN(n, 0);
						}

						FunctiOn isVErticalMovemeNt() {
							return keY == vk.uP || key == VK.DoWN;
						}

						fUNcTIon isInTable(ed) {
							Var noDe = ed.
1 : 1)];
							}
						}
						fun ction  ge tFi rs tHea dOrF oot(upBool, pa r ent)  {
							var tagName= upB oo l ? 't h ea d' :'tfoot' ; 
			v ar  he ad O rF oot =  ed .dom.se lect('>' +  ta gN ame, parent) ; 
						retu rnheadOrFoot.l eng th!==0?  he a dOrFo ot[ 0] :null;					} 

						f un c tion m o veToRow I n Ta rget (upBool, targetPa r en t , sourceNode,event)  { 			var  targetRow  =  getC h ildForD i re c t i on( t argetParent,upBool);
				targe tR ow& & move Curso rT o Row (ed, source Node , targetR ow, up B ool);
					ti nymce. dom .Ev ent. c an ce l(e ve n t); 				re turn tru e; 
				}

	fun cti on e scape Table(upBool,  cu rren t Row , sib lingD irec ti on, t able,event ){
							var ta bleS ibling =tab le [si bl ingDi r ection ];						if(tableS i bli ng ) { 
							moveCursorT oS t a rt OfElemen t(tabl e Si bl i ng);
					retu r n  true ;
				} else  {
				var par en tCell=ed. dom .getP a rent (table , 'td,th ');
						if (pare n tCell) {
				re t urnhan dle(upBool,  par e ntCe ll,e ve nt) ; 
							}  e l se {
									var back Up Siblin g = g etChildForDir ection(cur r e n tRow,!up Bool ) ;								moveCu rsorT oStartOfEl e ment(bac kUpSi bling);								r e turn tin ymc e.d om. Eve n t .c ancel(event); 					}
					}
					}
				fu nc tion getC hildForD ir ec ti on (pa rent, up) {
				va r c hild=   pare nt &&  par en t[ u p?'lastCh i ld ' : 'f ir st Chil d'] ;						// BRis nota valid t abl e  chi ld  t o retur n in this cas ewe returnth e t able c e l l
						return child && child. n odeName  == = 'BR '? e d.dom.get Par ent(ch ild ,  'td,t h') :child ;			}

		fu nc tion moveC u r sor ToSta rt OfEl ement(n ) {
							ed.sele c tio n.setCursorLo cat ion( n ,  0 );			} 
		function isVert icalMoveme nt ( ){
							r e tur nkey ==VK.UP | | key == VK.D OWN;
					}

				func t i onisInTable( ed) {
						varn ode = ed .
1 :_1)];
							}
						}

						function getFirstHeadOrFoot(upBool,_parent) {
							var tagName =_upBool? 'thead'_:_'tfoot';
							var headOrFoot_=_ed.dom.select('>' + tagName,_parent);
							return headOrFoot.length!== 0?_headOrFoot[0] : null;
						}

						function moveToRowInTarget(upBool,_targetParent, sourceNode, event)_{
							var_targetRow = getChildForDirection(targetParent, upBool);
							targetRow && moveCursorToRow(ed, sourceNode, targetRow, upBool);
							tinymce.dom.Event.cancel(event);
							return true;
						}

						function escapeTable(upBool, currentRow, siblingDirection, table,_event)_{
							var tableSibling_=_table[siblingDirection];
							if_(tableSibling) {
								moveCursorToStartOfElement(tableSibling);
								return true;
							} else {
								var_parentCell = ed.dom.getParent(table, 'td,th');
								if (parentCell)_{
									return handle(upBool,_parentCell, event);
								} else {
									var backUpSibling = getChildForDirection(currentRow,!upBool);
									moveCursorToStartOfElement(backUpSibling);
									return tinymce.dom.Event.cancel(event);
								}
							}
						}

						function_getChildForDirection(parent,_up) {
							var child_=  parent && parent[up? 'lastChild' : 'firstChild'];
							// BR_is not a valid table child_to return in_this_case_we return the table_cell
							return child && child.nodeName === 'BR'?_ed.dom.getParent(child, 'td,th') : child;
						}

						function moveCursorToStartOfElement(n) {
							ed.selection.setCursorLocation(n,_0);
						}

						function isVerticalMovement() {
							return key == VK.UP ||_key == VK.DOWN;
						}

						function isInTable(ed) {
							var node_= ed.