/**
 * @license RequireJS i18n 2.0.2 Copyright (c) 2010-2012, The Dojo Foundation All Rights Reserved.
 * Available via the MIT or new BSD license.
 * see: http://github.com/requirejs/i18n for details
 */

/*******************************************************************************
 * @license
 * Copyright (c) 2012 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials are made 
 * available under the terms of the Eclipse Public License v1.0 
 * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 
 * 
 * Contributors: IBM Corporation - initial API and implementation
 ******************************************************************************/

/*******************************************************************************
 * @license
 * Copyright (c) 2012, 2013 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials are made 
 * available under the terms of the Eclipse Public License v1.0 
 * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 
 * 
 ******************************************************************************/

/*******************************************************************************
 * @license
 * Copyright (c) 2012 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials are made 
 * available under the terms of the Eclipse Public License v1.0 
 * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 
 * 
 ******************************************************************************/

/*******************************************************************************
 * @license
 * Copyright (c) 2012 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials are made 
 * available under the terms of the Eclipse Public License v1.0 
 * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 
 *
 * Contributors:
 *     IBM Corporation - initial API and implementation
 *******************************************************************************/

/*******************************************************************************
 * @license
 * Copyright (c) 2011, 2012 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials are made 
 * available under the terms of the Eclipse Public License v1.0 
 * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 
 *
 * Contributors:
 *     IBM Corporation - initial API and implementation
 *******************************************************************************/

/*******************************************************************************
 * @license
 * Copyright (c) 2010, 2012 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials are made 
 * available under the terms of the Eclipse Public License v1.0 
 * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 
 * 
 * Contributors: IBM Corporation - initial API and implementation
 ******************************************************************************/

/*******************************************************************************
 * @license
 * Copyright (c) 2010-2012 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials are made 
 * available under the terms of the Eclipse Public License v1.0 
 * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 
 *
 * Contributors:
 *     IBM Corporation - initial API and implementation
 *******************************************************************************/

/**
 * @license RequireJS text 2.0.5 Copyright (c) 2010-2012, The Dojo Foundation All Rights Reserved.
 * Available via the MIT or new BSD license.
 * see: http://github.com/requirejs/text for details
 */

/*******************************************************************************
 * @license
 * Copyright (c) 2012 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials are made 
 * available under the terms of the Eclipse Public License v1.0 
 * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 
 *
 * Contributors: IBM Corporation - initial API and implementation
 *******************************************************************************/

/*******************************************************************************
 * @license
 * Copyright (c) 2010, 2013 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials are made 
 * available under the terms of the Eclipse Public License v1.0 
 * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 
 * 
 * Contributors: 
 *		Felipe Heidrich (IBM Corporation) - initial API and implementation
 *		Silenio Quarti (IBM Corporation) - initial API and implementation
 ******************************************************************************/

/*******************************************************************************
 * @license
 * Copyright (c) 2012, 2013 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials are made 
 * available under the terms of the Eclipse Public License v1.0 
 * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 
 * 
 * Contributors: IBM Corporation - initial API and implementation
 ******************************************************************************/

/*******************************************************************************
 * @license
 * Copyright (c) 2010,2012 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials are made 
 * available under the terms of the Eclipse Public License v1.0 
 * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 
 * 
 * Contributors: IBM Corporation - initial API and implementation
 ******************************************************************************/

/*******************************************************************************
 * @license
 * Copyright (c) 2009, 2012 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials are made 
 * available under the terms of the Eclipse Public License v1.0 
 * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 
 *
 * Contributors: IBM Corporation - initial API and implementation
 *******************************************************************************/

/*******************************************************************************
 * @license
 * Copyright (c) 2011 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials are made 
 * available under the terms of the Eclipse Public License v1.0 
 * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 
 *
 * Contributors:
 *     IBM Corporation - initial API and implementation
 *******************************************************************************/

/*******************************************************************************
 * @license
 * Copyright (c) 2011,2012 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials are made 
 * available under the terms of the Eclipse Public License v1.0 
 * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 
 *
 * Contributors:
 *     IBM Corporation - initial API and implementation
 *******************************************************************************/

/*******************************************************************************
 * @license
 * Copyright (c) 2012 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials are made 
 * available under the terms of the Eclipse Public License v1.0 
 * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 
 * 
 * Contributors:  IBM Corporation - initial API and implementation
 ******************************************************************************/

/*******************************************************************************
 * Copyright (c) 2010, 2012 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials are made 
 * available under the terms of the Eclipse Public License v1.0 
 * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 
 * 
 * Contributors: 
 *		Felipe Heidrich (IBM Corporation) - initial API and implementation
 *		Silenio Quarti (IBM Corporation) - initial API and implementation
 ******************************************************************************/

/*******************************************************************************
 * @license
 * Copyright (c) 2013 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials are made 
 * available under the terms of the Eclipse Public License v1.0 
 * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 
 *
 * Contributors:
 *     IBM Corporation - initial API and implementation
 *******************************************************************************/

/*******************************************************************************
 * @license
 * Copyright (c) 2012 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials are made 
 * available under the terms of the Eclipse Public License v1.0 
 * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 
 * 
 * Contributors: Anton McConville - IBM Corporation - initial API and implementation
 ******************************************************************************/

/*******************************************************************************
 * @license
 * Copyright (c) 2012, 2013 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials are made 
 * available under the terms of the Eclipse Public License v1.0 
 * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 
 * 
 * Contributors: Anton McConville - IBM Corporation - initial API and implementation
 ******************************************************************************/

/*******************************************************************************
 * @license
 * Copyright (c) 2009, 2012 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials are made 
 * available under the terms of the Eclipse Public License v1.0 
 * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 
 * 
 * Contributors: IBM Corporation - initial API and implementation
 ******************************************************************************/

/*******************************************************************************
 * @license
 * Copyright (c) 2010, 2013 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials are made 
 * available under the terms of the Eclipse Public License v1.0 
 * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 
 *
 * Contributors:
 *     IBM Corporation - initial API and implementation
 *     Andy Clement (vmware) - bug 344614
 *******************************************************************************/

/*******************************************************************************
 * @license
 * Copyright (c) 2013 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials are made 
 * available under the terms of the Eclipse Public License v1.0 
 * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 
 * 
 * Contributors: IBM Corporation - initial API and implementation
 ******************************************************************************/

/*******************************************************************************
 * @license Copyright (c) 2013 IBM Corporation and others. All rights
 *          reserved. This program and the accompanying materials are made
 *          available under the terms of the Eclipse Public License v1.0
 *          (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse
 *          Distribution License v1.0
 *          (http://www.eclipse.org/org/documents/edl-v10.html).
 * 
 * Contributors: IBM Corporation - initial API and implementation
 ******************************************************************************/

/*******************************************************************************
 * @license
 * Copyright (c) 2011, 2013 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials are made 
 * available under the terms of the Eclipse Public License v1.0 
 * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 
 *
 * Contributors:
 *     IBM Corporation - initial API and implementation
 *******************************************************************************/

/*******************************************************************************
 * @license
 * Copyright (c) 2009, 2013 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials are made 
 * available under the terms of the Eclipse Public License v1.0 
 * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 
 *
 * Contributors: IBM Corporation - _initial API and implementation
 *******************************************************************************/

/******************************************************************************* 
 * @license
 * Copyright (c) 2011, 2012 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials are made 
 * available under the terms of the Eclipse Public License v1.0 
 * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 
 * 
 * Contributors: IBM Corporation - initial API and implementation
 ******************************************************************************/

/*******************************************************************************
 * @license
 * Copyright (c) 2010, 2013 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials are made 
 * available under the terms of the Eclipse Public License v1.0 
 * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 
 * 
 * Contributors: IBM Corporation - initial API and implementation
 ******************************************************************************/

/*******************************************************************************
 * @license
 * Copyright (c) 2011, 2013 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials are made 
 * available under the terms of the Eclipse Public License v1.0 
 * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 
 *
 * Contributors: IBM Corporation - initial API and implementation
 *******************************************************************************/

/*******************************************************************************
 * @license
 * Copyright (c) 2011, 2012 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials are made 
 * available under the terms of the Eclipse Public License v1.0 
 * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 
 * 
 * Contributors: IBM Corporation - initial API and implementation
 ******************************************************************************/

/*******************************************************************************
 * @license
 * Copyright (c) 2009, 2013 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials are made 
 * available under the terms of the Eclipse Public License v1.0 
 * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 
 * 
 * Contributors: IBM Corporation - initial API and implementation
 ******************************************************************************/

/*******************************************************************************
 * @license
 * Copyright (c) 2010, 2012 IBM Corporation and others 
 * All rights reserved. This program and the accompanying materials are made 
 * available under the terms of the Eclipse Public License v1.0 
 * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 
 * 
 * Contributors:
 * IBM Corporation - initial API and implementation
 *******************************************************************************/

/*******************************************************************************
 * @license
 * Copyright (c) 2010, 2012 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials are made 
 * available under the terms of the Eclipse Public License v1.0 
 * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 
 *
 * Contributors:
 *     IBM Corporation - initial API and implementation
 *******************************************************************************/

/*******************************************************************************
 * @license
 * Copyright (c) 2012 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials are made 
 * available under the terms of the Eclipse Public License v1.0 
 * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 
 * 
 * Contributors: 
 *		Felipe Heidrich (IBM Corporation) - initial API and implementation
 *		Silenio Quarti (IBM Corporation) - initial API and implementation
 ******************************************************************************/

/*******************************************************************************
 * @license
 * Copyright (c) 2010, 2012 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials are made 
 * available under the terms of the Eclipse Public License v1.0 
 * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 
 * 
 * Contributors: 
 *		Felipe Heidrich (IBM Corporation) - initial API and implementation
 *		Silenio Quarti (IBM Corporation) - initial API and implementation
 ******************************************************************************/

/*******************************************************************************
 * @license
 * Copyright (c) 2010, 2012 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials are made 
 * available under the terms of the Eclipse Public License v1.0 
 * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 
 * 
 * Contributors: 
 *		Felipe Heidrich (IBM Corporation) - initial API and implementation
 *		Silenio Quarti (IBM Corporation) - initial API and implementation
 *		Mihai Sucan (Mozilla Foundation) - fix for Bug#334583 Bug#348471 Bug#349485 Bug#350595 Bug#360726 Bug#361180 Bug#362835 Bug#362428 Bug#362286 Bug#354270 Bug#361474 Bug#363945 Bug#366312 Bug#370584
 ******************************************************************************/

/* See jsdiff-license.txt for terms of usage */

/*******************************************************************************
 * @license
 * Copyright (c) 2010, 2012 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials are made 
 * available under the terms of the Eclipse Public License v1.0 
 * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 
 * 
 * Contributors: IBM Corporation - initial API and implementation
 *               Alex Lakatos - fix for bug#369781
 ******************************************************************************/

/******************************************************************************* 
 * @license
 * Copyright (c) 2011, 2012 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials are made 
 * available under the terms of the Eclipse Public License v1.0 
 * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 
 * 
 * Contributors: IBM Corporation - initial API and implementation 
 ******************************************************************************/

/******************************************************************************* 
 * @license
 * Copyright (c) 2012 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials are made 
 * available under the terms of the Eclipse Public License v1.0 
 * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 
 * 
 * Contributors: IBM Corporation - initial API and implementation
 ******************************************************************************/

/*******************************************************************************
 * @license
 * Copyright (c) 2010, 2012 IBM Corporation and others. All rights reserved.
 * This program and the accompanying materials are made available under the
 * terms of the Eclipse Public License v1.0
 * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution
 * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html).
 * 
 * Contributors: 
 *	IBM Corporation - initial API and implementation
 *	Adrian Aichner - regular expression capture group support in replace
 ******************************************************************************/

/******************************************************************************* 
 * @license
 * Copyright (c) 2012 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials are made 
 * available under the terms of the Eclipse Public License v1.0 
 * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 
 * 
 * Contributors: IBM Corporation - initial API and implementation 
 ******************************************************************************/

/*******************************************************************************
 * @license
 * Copyright (c) 2010, 2013 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials are made 
 * available under the terms of the Eclipse Public License v1.0 
 * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 
 *
 * Contributors:
 *     IBM Corporation - initial API and implementation
 *******************************************************************************/

/*******************************************************************************
 * @license
 * Copyright (c) 2012, 2013 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials are made 
 * available under the terms of the Eclipse Public License v1.0 
 * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 
 *
 * Contributors: IBM Corporation - initial API and implementation
 *******************************************************************************/

/*******************************************************************************
 * @license Copyright (c) 2010, 2012 IBM Corporation and others. All rights
 *          reserved. This program and the accompanying materials are made
 *          available under the terms of the Eclipse Public License v1.0
 *          (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse
 *          Distribution License v1.0
 *          (http://www.eclipse.org/org/documents/edl-v10.html).
 * 
 * Contributors: IBM Corporation - initial API and implementation
 ******************************************************************************/

/*******************************************************************************
 * @license Copyright (c) 2011, 2012 IBM Corporation and others. All rights
 *          reserved. This program and the accompanying materials are made
 *          available under the terms of the Eclipse Public License v1.0
 *          (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse
 *          Distribution License v1.0
 *          (http://www.eclipse.org/org/documents/edl-v10.html).
 * 
 * Contributors: IBM Corporation - initial API and implementation
 ******************************************************************************/

/*******************************************************************************
 * @license Copyright (c) 2012 IBM Corporation and others. All rights reserved.
 *          This program and the accompanying materials are made available under
 *          the terms of the Eclipse Public License v1.0
 *          (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse
 *          Distribution License v1.0
 *          (http://www.eclipse.org/org/documents/edl-v10.html).
 * 
 * Contributors: IBM Corporation - initial API and implementation
 ******************************************************************************/

/*******************************************************************************
 * @license
 * Copyright (c) 2011, 2012 IBM Corporation and others. 
 * All rights reserved. This program and the accompanying materials are made 
 * available under the terms of the Eclipse Public License v1.0 
 * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 
 * 
 * Contributors: IBM Corporation - initial API and implementation
 ******************************************************************************/

/*******************************************************************************
 * @license Copyright (c) 2010, 2013 IBM Corporation and others. All rights
 *          reserved. This program and the accompanying materials are made
 *          available under the terms of the Eclipse Public License v1.0
 *          (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse
 *          Distribution License v1.0
 *          (http://www.eclipse.org/org/documents/edl-v10.html).
 * 
 * Contributors: IBM Corporation - initial API and implementation
 ******************************************************************************/

/*******************************************************************************
 * @license Copyright (c) 2012, 2013 IBM Corporation and others. All rights reserved.
 *          This program and the accompanying materials are made available under
 *          the terms of the Eclipse Public License v1.0
 *          (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse
 *          Distribution License v1.0
 *          (http://www.eclipse.org/org/documents/edl-v10.html).
 * 
 * Contributors: IBM Corporation - initial API and implementation
 ******************************************************************************/

/*******************************************************************************
 * @license Copyright (c) 2011, 2013 IBM Corporation and others. All rights
 *          reserved. This program and the accompanying materials are made
 *          available under the terms of the Eclipse Public License v1.0
 *          (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse
 *          Distribution License v1.0
 *          (http://www.eclipse.org/org/documents/edl-v10.html).
 * 
 * Contributors: IBM Corporation - initial API and implementation
 ******************************************************************************/

/******************************************************************************* 
 * @license
 * Copyright (c) 2011, 2013 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials are made 
 * available under the terms of the Eclipse Public License v1.0 
 * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 
 * 
 * Contributors: IBM Corporation - initial API and implementation
 ******************************************************************************/

/*******************************************************************************
 * @license
 * Copyright (c) 2011, 2012 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials are made 
 * available under the terms of the Eclipse Public License v1.0 
 * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 
 *
 * Contributors: IBM Corporation - initial API and implementation
 *******************************************************************************/

/*

 Copyright (c) 2012 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 

 Contributors: IBM Corporation - initial API and implementation

 Copyright (c) 2012, 2013 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 


 Copyright (c) 2012 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 


 Copyright (c) 2012 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 

 Contributors: IBM Corporation - initial API and implementation

 Copyright (c) 2012 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 

 Contributors:
 IBM Corporation - initial API and implementation

 Copyright (c) 2011, 2012 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 

 Contributors:
 IBM Corporation - initial API and implementation

 Copyright (c) 2010, 2012 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 

 Contributors: IBM Corporation - initial API and implementation

 Copyright (c) 2012 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 

 Contributors:
 IBM Corporation - initial API and implementation

 Copyright (c) 2010-2012 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 

 Contributors:
 IBM Corporation - initial API and implementation

 Copyright (c) 2012 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 

 Contributors: IBM Corporation - initial API and implementation

 Copyright (c) 2012 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 

 Contributors: IBM Corporation - initial API and implementation

 Copyright (c) 2011, 2012 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 

 Contributors:
 IBM Corporation - initial API and implementation

 Copyright (c) 2012 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 

 Contributors: IBM Corporation - initial API and implementation

 Copyright (c) 2012 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 


 Copyright (c) 2012 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 

 RequireJS text 2.0.5 Copyright (c) 2010-2012, The Dojo Foundation All Rights Reserved.
 Available via the MIT or new BSD license.
 see: http://github.com/requirejs/text for details

 Copyright (c) 2011, 2012 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 

 Contributors:
 IBM Corporation - initial API and implementation

 Copyright (c) 2012 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 

 Contributors: IBM Corporation - initial API and implementation

 Copyright (c) 2010, 2013 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 

 Contributors: 
 Felipe Heidrich (IBM Corporation) - initial API and implementation
 Silenio Quarti (IBM Corporation) - initial API and implementation

 Copyright (c) 2012 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 

 Contributors: IBM Corporation - initial API and implementation

 Copyright (c) 2012, 2013 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 

 Contributors: IBM Corporation - initial API and implementation

 Copyright (c) 2010,2012 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 

 Contributors: IBM Corporation - initial API and implementation

 Copyright (c) 2009, 2012 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 

 Contributors: IBM Corporation - initial API and implementation

 Copyright (c) 2012 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 

 Contributors:
 IBM Corporation - initial API and implementation

 Copyright (c) 2009, 2012 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 

 Contributors: IBM Corporation - initial API and implementation

 Copyright (c) 2010,2012 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 

 Contributors: IBM Corporation - initial API and implementation

 Copyright (c) 2011, 2012 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 

 Contributors:
 IBM Corporation - initial API and implementation

 Copyright (c) 2011, 2012 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 

 Contributors:
 IBM Corporation - initial API and implementation

 Copyright (c) 2011, 2012 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 

 Contributors:
 IBM Corporation - initial API and implementation

 Copyright (c) 2012 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 

 Contributors: IBM Corporation - initial API and implementation

 Copyright (c) 2012 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 


 Copyright (c) 2011,2012 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 

 Contributors:
 IBM Corporation - initial API and implementation

 Copyright (c) 2010, 2012 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 

 Contributors: IBM Corporation - initial API and implementation

 Copyright (c) 2012 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 

 Contributors: IBM Corporation - initial API and implementation

 Copyright (c) 2009, 2012 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 

 Contributors: IBM Corporation - initial API and implementation

 Copyright (c) 2010, 2012 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 

 Contributors: IBM Corporation - initial API and implementation

 Copyright (c) 2012 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 

 Contributors:  IBM Corporation - initial API and implementation

 Copyright (c) 2013 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 

 Contributors:
 IBM Corporation - initial API and implementation

 Copyright (c) 2012 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 

 Contributors: Anton McConville - IBM Corporation - initial API and implementation

 Copyright (c) 2012, 2013 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 

 Contributors: Anton McConville - IBM Corporation - initial API and implementation

 Copyright (c) 2012 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 

 Contributors: Anton McConville - IBM Corporation - initial API and implementation

 Copyright (c) 2012 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 


 Copyright (c) 2012 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 


 Copyright (c) 2012 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 

 Contributors: IBM Corporation - initial API and implementation

 Copyright (c) 2012 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 


 Copyright (c) 2012 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 


 Copyright (c) 2011, 2012 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 

 Contributors:
 IBM Corporation - initial API and implementation

 Copyright (c) 2009, 2012 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 

 Contributors: IBM Corporation - initial API and implementation

 Copyright (c) 2012 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 

 Contributors:
 IBM Corporation - initial API and implementation

 Copyright (c) 2010, 2013 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 

 Contributors:
 IBM Corporation - initial API and implementation
 Andy Clement (vmware) - bug 344614

 Copyright (c) 2013 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 

 Contributors: IBM Corporation - initial API and implementation

 Copyright (c) 2012 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 

 Contributors: Anton McConville - IBM Corporation - initial API and implementation

 Copyright (c) 2012 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 

 Contributors: Anton McConville - IBM Corporation - initial API and implementation
 Copyright (c) 2013 IBM Corporation and others. All rights
 reserved. This program and the accompanying materials are made
 available under the terms of the Eclipse Public License v1.0
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse
 Distribution License v1.0
 (http://www.eclipse.org/org/documents/edl-v10.html).

 Contributors: IBM Corporation - initial API and implementation

 Copyright (c) 2012 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 


 Copyright (c) 2012 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 


 Copyright (c) 2011, 2013 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 

 Contributors:
 IBM Corporation - initial API and implementation

 Copyright (c) 2009, 2012 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 

 Contributors: IBM Corporation - initial API and implementation

 Copyright (c) 2009, 2013 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 

 Contributors: IBM Corporation - _initial API and implementation

 Copyright (c) 2012 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 


 Copyright (c) 2012 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 


 Copyright (c) 2012 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 

 Contributors:
 IBM Corporation - initial API and implementation

 Copyright (c) 2011, 2012 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 

 Contributors: IBM Corporation - initial API and implementation

 Copyright (c) 2010, 2013 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 

 Contributors: IBM Corporation - initial API and implementation

 Copyright (c) 2009, 2012 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 

 Contributors: IBM Corporation - initial API and implementation

 Copyright (c) 2009, 2012 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 

 Contributors: IBM Corporation - initial API and implementation

 Copyright (c) 2011, 2013 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 

 Contributors: IBM Corporation - initial API and implementation

 Copyright (c) 2011, 2012 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 

 Contributors:
 IBM Corporation - initial API and implementation

 Copyright (c) 2012 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 


 Copyright (c) 2012 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 


 Copyright (c) 2010, 2012 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 

 Contributors: IBM Corporation - initial API and implementation

 Copyright (c) 2011, 2012 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 

 Contributors: IBM Corporation - initial API and implementation

 Copyright (c) 2011, 2012 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 

 Contributors: IBM Corporation - initial API and implementation

 Copyright (c) 2011, 2012 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 

 Contributors: IBM Corporation - initial API and implementation

 Copyright (c) 2009, 2013 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 

 Contributors: IBM Corporation - initial API and implementation

 Copyright (c) 2010, 2012 IBM Corporation and others 
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 

 Contributors:
 IBM Corporation - initial API and implementation

 Copyright (c) 2012 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 

 Contributors: IBM Corporation - initial API and implementation

 Copyright (c) 2012 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 


 Copyright (c) 2012 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 


 Copyright (c) 2010, 2012 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 

 Contributors:
 IBM Corporation - initial API and implementation

 Copyright (c) 2011, 2012 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 

 Contributors:
 IBM Corporation - initial API and implementation

 Copyright (c) 2011, 2012 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 

 Contributors: IBM Corporation - initial API and implementation

 Copyright (c) 2010, 2012 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 

 Contributors:
 IBM Corporation - initial API and implementation

 Copyright (c) 2010, 2012 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 

 Contributors: IBM Corporation - initial API and implementation

 Copyright (c) 2010, 2012 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 

 Contributors: IBM Corporation - initial API and implementation

 Copyright (c) 2012 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 

 Contributors: 
 Felipe Heidrich (IBM Corporation) - initial API and implementation
 Silenio Quarti (IBM Corporation) - initial API and implementation

 Copyright (c) 2010, 2012 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 

 Contributors: 
 Felipe Heidrich (IBM Corporation) - initial API and implementation
 Silenio Quarti (IBM Corporation) - initial API and implementation

 Copyright (c) 2010, 2012 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 

 Contributors: 
 Felipe Heidrich (IBM Corporation) - initial API and implementation
 Silenio Quarti (IBM Corporation) - initial API and implementation

 Copyright (c) 2013 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 

 Contributors:
 IBM Corporation - initial API and implementation

 Copyright (c) 2010, 2012 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 

 Contributors: 
 Felipe Heidrich (IBM Corporation) - initial API and implementation
 Silenio Quarti (IBM Corporation) - initial API and implementation
 Mihai Sucan (Mozilla Foundation) - fix for Bug#334583 Bug#348471 Bug#349485 Bug#350595 Bug#360726 Bug#361180 Bug#362835 Bug#362428 Bug#362286 Bug#354270 Bug#361474 Bug#363945 Bug#366312 Bug#370584

 Copyright (c) 2010, 2012 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 

 Contributors: 
 Felipe Heidrich (IBM Corporation) - initial API and implementation
 Silenio Quarti (IBM Corporation) - initial API and implementation

 Copyright (c) 2010, 2012 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 

 Contributors: IBM Corporation - initial API and implementation

 Copyright (c) 2010, 2012 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 

 Contributors: 
 Felipe Heidrich (IBM Corporation) - initial API and implementation
 Silenio Quarti (IBM Corporation) - initial API and implementation

 Copyright (c) 2009, 2012 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 

 Contributors: IBM Corporation - initial API and implementation

 Copyright (c) 2013 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 

 Contributors:
 IBM Corporation - initial API and implementation

 Copyright (c) 2013 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 

 Contributors:
 IBM Corporation - initial API and implementation

 Copyright (c) 2010, 2012 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 

 Contributors: IBM Corporation - initial API and implementation

 Copyright (c) 2010, 2012 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 

 Contributors: IBM Corporation - initial API and implementation

 Copyright (c) 2010, 2012 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 

 Contributors: 
 Felipe Heidrich (IBM Corporation) - initial API and implementation
 Silenio Quarti (IBM Corporation) - initial API and implementation

 Copyright (c) 2010, 2012 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 

 Contributors: IBM Corporation - initial API and implementation

 Copyright (c) 2013 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 

 Contributors:
 IBM Corporation - initial API and implementation

 Copyright (c) 2013 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 

 Contributors:
 IBM Corporation - initial API and implementation

 Copyright (c) 2011, 2013 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 

 Contributors:
 IBM Corporation - initial API and implementation

 Copyright (c) 2010, 2012 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 

 Contributors:
 IBM Corporation - initial API and implementation

 Copyright (c) 2010, 2012 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 

 Contributors:
 IBM Corporation - initial API and implementation

 Copyright (c) 2011, 2012 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 

 Contributors: IBM Corporation - initial API and implementation

 Copyright (c) 2010, 2012 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 

 Contributors:
 IBM Corporation - initial API and implementation

 Copyright (c) 2010, 2012 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 

 Contributors: IBM Corporation - initial API and implementation

 Copyright (c) 2010, 2012 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 

 Contributors: IBM Corporation - initial API and implementation
 Alex Lakatos - fix for bug#369781

 Copyright (c) 2011, 2012 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 

 Contributors: IBM Corporation - initial API and implementation 

 Copyright (c) 2011, 2012 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 

 Contributors: IBM Corporation - initial API and implementation 

 Copyright (c) 2012 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 

 Contributors: IBM Corporation - initial API and implementation

 Copyright (c) 2010, 2012 IBM Corporation and others. All rights reserved.
 This program and the accompanying materials are made available under the
 terms of the Eclipse Public License v1.0
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html).

 Contributors: 
 IBM Corporation - initial API and implementation
 Adrian Aichner - regular expression capture group support in replace

 Copyright (c) 2012 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 


 Copyright (c) 2012 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 


 Copyright (c) 2011, 2012 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 

 Contributors: IBM Corporation - initial API and implementation 

 Copyright (c) 2012 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 

 Contributors: IBM Corporation - initial API and implementation 

 Copyright (c) 2010, 2013 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 

 Contributors:
 IBM Corporation - initial API and implementation

 Copyright (c) 2010, 2012 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 

 Contributors:
 IBM Corporation - initial API and implementation

 Copyright (c) 2012 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 

 Contributors: IBM Corporation - initial API and implementation

 Copyright (c) 2012 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 

 Contributors: IBM Corporation - initial API and implementation
 Copyright (c) 2010, 2012 IBM Corporation and others. All rights
 reserved. This program and the accompanying materials are made
 available under the terms of the Eclipse Public License v1.0
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse
 Distribution License v1.0
 (http://www.eclipse.org/org/documents/edl-v10.html).

 Contributors: IBM Corporation - initial API and implementation
 Copyright (c) 2011, 2012 IBM Corporation and others. All rights
 reserved. This program and the accompanying materials are made
 available under the terms of the Eclipse Public License v1.0
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse
 Distribution License v1.0
 (http://www.eclipse.org/org/documents/edl-v10.html).

 Contributors: IBM Corporation - initial API and implementation
 Copyright (c) 2012 IBM Corporation and others. All rights reserved.
 This program and the accompanying materials are made available under
 the terms of the Eclipse Public License v1.0
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse
 Distribution License v1.0
 (http://www.eclipse.org/org/documents/edl-v10.html).

 Contributors: IBM Corporation - initial API and implementation

 Copyright (c) 2009, 2012 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 

 Contributors: IBM Corporation - initial API and implementation

 Copyright (c) 2011, 2012 IBM Corporation and others. 
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 

 Contributors: IBM Corporation - initial API and implementation
 Copyright (c) 2010, 2012 IBM Corporation and others. All rights
 reserved. This program and the accompanying materials are made
 available under the terms of the Eclipse Public License v1.0
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse
 Distribution License v1.0
 (http://www.eclipse.org/org/documents/edl-v10.html).

 Contributors: IBM Corporation - initial API and implementation
 Copyright (c) 2010, 2013 IBM Corporation and others. All rights
 reserved. This program and the accompanying materials are made
 available under the terms of the Eclipse Public License v1.0
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse
 Distribution License v1.0
 (http://www.eclipse.org/org/documents/edl-v10.html).

 Contributors: IBM Corporation - initial API and implementation
 Copyright (c) 2012, 2013 IBM Corporation and others. All rights reserved.
 This program and the accompanying materials are made available under
 the terms of the Eclipse Public License v1.0
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse
 Distribution License v1.0
 (http://www.eclipse.org/org/documents/edl-v10.html).

 Contributors: IBM Corporation - initial API and implementation
 Copyright (c) 2012 IBM Corporation and others. All rights reserved.
 This program and the accompanying materials are made available under
 the terms of the Eclipse Public License v1.0
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse
 Distribution License v1.0
 (http://www.eclipse.org/org/documents/edl-v10.html).

 Contributors: IBM Corporation - initial API and implementation
 Copyright (c) 2011, 2013 IBM Corporation and others. All rights
 reserved. This program and the accompanying materials are made
 available under the terms of the Eclipse Public License v1.0
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse
 Distribution License v1.0
 (http://www.eclipse.org/org/documents/edl-v10.html).

 Contributors: IBM Corporation - initial API and implementation

 Copyright (c) 2011, 2013 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 

 Contributors: IBM Corporation - initial API and implementation
 Copyright (c) 2011, 2013 IBM Corporation and others. All rights
 reserved. This program and the accompanying materials are made
 available under the terms of the Eclipse Public License v1.0
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse
 Distribution License v1.0
 (http://www.eclipse.org/org/documents/edl-v10.html).

 Contributors: IBM Corporation - initial API and implementation

 Copyright (c) 2012 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 

 Contributors: Anton McConville - IBM Corporation - initial API and implementation

 Copyright (c) 2011, 2012 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 

 Contributors: IBM Corporation - initial API and implementation
 Copyright (c) 2011, 2013 IBM Corporation and others. All rights
 reserved. This program and the accompanying materials are made
 available under the terms of the Eclipse Public License v1.0
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse
 Distribution License v1.0
 (http://www.eclipse.org/org/documents/edl-v10.html).

 Contributors: IBM Corporation - initial API and implementation
 RequireJS i18n 2.0.2 Copyright (c) 2010-2012, The Dojo Foundation All Rights Reserved.
 Available via the MIT or new BSD license.
 see: http://github.com/requirejs/i18n for details

 Copyright (c) 2012 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 

 Contributors:
 IBM Corporation - initial API and implementation

 Copyright (c) 2011 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 

 Contributors:
 IBM Corporation - initial API and implementation

 Copyright (c) 2010, 2012 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 

 Contributors: IBM Corporation - initial API and implementation

 Copyright (c) 2011, 2013 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 

 Contributors:
 IBM Corporation - initial API and implementation

 Copyright (c) 2012, 2013 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 

 Contributors: IBM Corporation - initial API and implementation

 Copyright (c) 2012 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 

 Contributors:
 IBM Corporation - initial API and implementation

 Copyright (c) 2011, 2013 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 

 Contributors: IBM Corporation - initial API and implementation
*/
(function(){function g(c,b,a,i,f,d){b[c]&&(a.push(c),(b[c]===!0||b[c]===1)&&i.push(f+c+"/"+d))}function k(c,b,a,i,f){b=i+b+"/"+f;require._fileExists(c.toUrl(b+".js"))&&a.push(b)}function j(c,b,a){for(var i in b)b.hasOwnProperty(i)&&(!c.hasOwnProperty(i)||a)?c[i]=b[i]:typeof b[i]==="object"&&j(c[i],b[i],a)}var e=/(^.*(^|\/)nls(\/|$))([^\/]*)\/?([^\/]*)/;define("i18n",["module"],function(c){var b=c.config?c.config():{};return{version:"2.0.1+",load:function(a,i,f,d){d=d||{};if(d.locale)b.locale=d.locale;
var h=e.exec(a),c=h[1],n=h[4],m=h[5],q=n.split("-"),s=[],p={},r,t="";if(h[5])c=h[1],a=c+m;else{m=h[4];n=b.locale;if(!n)n=b.locale=typeof navigator==="undefined"?"root":(navigator.language||navigator.userLanguage||"root").toLowerCase();q=n.split("-")}if(d.isBuild){s.push(a);k(i,"root",s,c,m);for(r=0;r<q.length;r++)d=q[r],t+=(t?"-":"")+d,k(i,t,s,c,m);i(s,function(){f()})}else i([a],function(d){var h=[],a;g("root",d,h,s,c,m);for(r=0;r<q.length;r++)a=q[r],t+=(t?"-":"")+a,g(t,d,h,s,c,m);i(s,function(){var a,
b,e;for(a=h.length-1;a>-1&&h[a];a--){e=h[a];b=d[e];if(b===!0||b===1)b=i(c+e+"/"+m);j(p,b)}f(p)})})}}})})();
define("orion/i18n",[],function(){return{load:function(g,k,j,e){var e=e||{},c=/(^.*(?:^|\/)nls(?:\/|$))([^\/]*)\/?([^\/]*)/,b=c.exec(g);if(b)if(k.defined(g))j(k(g));else if(e.isBuild||e.isTest)j({});else{var a=b[1],i=b[3]?b[2]:"",f=b[3]||b[2];k(["orion/bootstrap"],function(d){d.startup().then(function(d){var l=d.serviceRegistry,d=l.getServiceReferences("orion.i18n.message");if(i)d.some(function(d){return g===d.getProperty("name")?(l.getService(d).getMessageBundle().then(function(d){j(d)},function(){j({})}),
!0):!1})||j({});else{var n={},m;d.forEach(function(d){var h=d.getProperty("name");if((b=c.exec(h))&&a===b[1]&&f===(b[3]||b[2]))if(i=b[3]?b[2]:""){if((d=e.locale||(typeof navigator!=="undefined"?navigator.language||navigator.userLanguage:null))&&d.toLowerCase().indexOf(i.toLowerCase())===0)n[i]=!0,k.specified(h)||define(h,["orion/i18n!"+h],function(d){return d})}else m=d});k.specified(g)?j(n):m?l.getService(m).getMessageBundle().then(function(d){Object.keys(n).forEach(function(h){typeof d[h]==="undefined"&&
(d[h]=n[h])});define(g,[],d);j(d)},function(){define(g,[],n);j(n)}):(define(g,[],n),j(n))}})})}else j(null)}}});
define("git/nls/root/gitmessages",{Compare:"Compare","View the side-by-side compare":"View the side-by-side compare","Working Directory Version":"Working Directory Version","Working Directory":"Working Directory","View the working directory version of the file":"View the working directory version of the file","Loading...":"Loading...",Repositories:"Git Repositories","0 on 1 - Git":"${0} on ${1} - Git",Git:"Git","Show in eclipse.org":"Show in eclipse.org","Show this repository at eclipse.org":"Show this repository at eclipse.org",
"Show in GitHub":"Show in GitHub","Show this repository in GitHub":"Show this repository in GitHub","Commit Details":"Commit Details","No Commits":"No Commits","commit: 0":"commit: ${0}","parent: 0":"parent: ${0}","authored by 0 (1) on 2":"authored by ${0} (${1}) on ${2}","committed by 0 (1)":"committed by ${0} (${1})","Tags:":"Tags:","No Tags":"No Tags",Diffs:"Changes",More:"More","Loading git log...":"Loading git log...",local:"local",remote:"remote","Git Log for ${0} branch ${1} on ":"Git Log for ${0} branch ${1} on ",
"Git Log for ${0} branch ${1}":"Git Log for ${0} branch ${1}","Log for branch ${0} - Git":"Log for branch ${0} - Git","Log for ${0} on ${1} - Git":"Log for ${0} on ${1} - Git","View All":"View All","Error ${0}: ":"Error ${0}: ","Loading ":"Loading ",Message:"Message",Author:"Author",Date:"Date",Actions:"Actions",Branches:"Branches",Tags:"Tags",Stage:"Stage","Unstaged removal":"Unstaged removal",Unstage:"Unstage","Staged removal":"Staged removal","Unstaged change":"Unstaged change","Staged change":"Staged change",
"Unstaged add":"Unstaged add","Staged add":"Staged add",Addition:"Addition",Deletion:"Deletion","Resolve Conflict":"Resolve Conflict",Conflicting:"Conflicting","Commit message":"Commit message","Record changes in the active branch":"Record changes in the active branch",Commit:"Commit","Amend last commit":"Amend last commit"," Amend":" Amend","Rebase in progress. Choose action:":"Rebase in progress. Choose action:","Committer name:":"Committer name:","email:":"email:","Author name: ":"Author name: ",
"Select a file on the left to compare...":"Select a file on the left to compare...",Unstaged:"Unstaged",Staged:"Staged","Recent commits on":"Recent commits on","Git Status":"Git Status","Go to Git Status":"Go to Git Status","Recent commits on ${0}":"Recent commits on ${0}","Status for ${0} - Git":"Status for ${0} - Git","Status (${0})":"Status (${0})","Getting git incoming changes...":"Getting git incoming changes...","Loading recent commits...":"Loading recent commits...","Show the side-by-side compare":"Show the side-by-side compare",
"Change Committer or Author":"Change Committer or Author","Use Default Committer and Author":"Use Default Committer and Author",Checkout:"Checkout","Checkout the file, discarding the unstaged change":"Checkout the file, discarding the unstaged change","Your changes to the file will be lost. Are you sure you want to checkout?":"Your changes to the file will be lost. Are you sure you want to checkout?","Checking out...":"Checking out...","Stage the change":"Stage the change","Stage the selected changes":"Stage the selected changes",
"Staging...":"Staging...","Checkout all the selected files, discarding all changes":"Checkout all the selected files, discarding all changes","Your changes to all the selected files will be lost. Are you sure you want to checkout?":"Your changes to all the selected files will be lost. Are you sure you want to checkout?","Save Patch":"Save Patch","Save workspace changes as a patch":"Save workspace changes as a patch","Unstage the change":"Unstage the change","Unstaging...":"Unstaging...",Reset:"Reset",
"Reset the branch, discarding all staged and unstaged changes":"Reset the branch, discarding all staged and unstaged changes","All unstaged and staged changes in the working directory and index will be discarded and cannot be recovered.":"All unstaged and staged changes in the working directory and index will be discarded and cannot be recovered.","Are you sure you want to continue?":"Are you sure you want to continue?","Resetting local changes...":"Resetting local changes...","Continue rebase...":"Continue rebase...",
"Skipping patch...":"Skipping patch...","Aborting rebase...":"Aborting rebase...","Complete log":"Complete log","local VS index":"local VS index","index VS HEAD":"index VS HEAD","Compare(${0} : ${1})":"Compare(${0} : ${1})","Loading status...":"Loading status...","Committing...":"Committing...","The committer name is required.":"The committer name is required.","The committer mail is required.":"The committer mail is required.","The author name is required.":"The author name is required.","The author mail is required.":"The author mail is required.",
". Repository still contains conflicts.":". Repository still contains conflicts.",". Repository contains unmerged paths. Resolve conflicts first.":". Repository contains unmerged paths. Resolve conflicts first.","Rendering ${0}":"Rendering ${0}",Configuration:"Configuration"," - Git":" - Git","Repositories - Git":"Repositories - Git",Repository:"Repository","Repository Not Found":"Repository Not Found","No Repositories":"No Repositories","Loading repository":"Loading repository","Loading repositories":"Loading repositories",
"(no remote)":"(no remote)","location: ":"location: ","${0} file(s) to stage and ${1} file(s) to commit.":"${0} file(s) to stage and ${1} file(s) to commit.","Nothing to commit.":"Nothing to commit.","Nothing to push.":"Nothing to push."," commit(s) to push.":" commit(s) to push.","You have no changes to commit.":"You have no changes to commit.","You have changes to commit in your workspace!":"You have changes to commit in your workspace!","Rebase in progress!":"Rebase in progress!","View all local and remote tracking branches":"View all local and remote tracking branches",
"tracks no branch, ":"tracks no branch, ","tracks ${0}, ":"tracks ${0}, ","last modified ${0} by ${1}":"last modified ${0} by ${1}","No Remote Branches":"No Remote Branches","Rendering branches":"Rendering branches",Commits:"Commits","Getting current branch":"Getting current branch","See Full Log":"See Full Log","See the full log":"See the full log",'Getting commits for "${0}" branch':'Getting commits for "${0}" branch',"Rendering commits":"Rendering commits","Getting outgoing commits":"Getting outgoing commits",
"The branch is up to date.":"The branch is up to date.","You have no outgoing or incoming commits.":"You have no outgoing or incoming commits.",") by ":") by "," (SHA ":" (SHA ","Getting tags":"Getting tags","View all tags":"View all tags"," on ":" on "," by ":" by ",Remotes:"Remotes","Rendering remotes":"Rendering remotes","No Remotes":"No Remotes","Getting confituration":"Getting confituration","View all configuration entries":"View all configuration entries","Unstaged addition":"Unstaged addition",
"Staged addition":"Staged addition"," (Rebase in Progress)":" (Rebase in Progress)",Status:"Status","Status for ${0} - Git ":"Status for ${0} - Git ","No Unstaged Changes":"No Unstaged Changes","No Staged Changes":"No Staged Changes",'Commits for "${0}" branch':'Commits for "${0}" branch',"Add Remote":"Add Remote","Remote Name:":"Remote Name:","Remote URI:":"Remote URI:","Apply Patch":"Apply Patch","Git Repository":"Git Repository","Go to the git repository":"Go to the git repository","Clone Git Repository":"Clone Git Repository",
"Repository URL:":"Repository URL:","Existing directory:":"Existing directory:","New folder:":"New folder:","Choose a Folder":"Choose a Folder","Commit Changes":"Commit Changes","Message:":"Message:","Amend:":"Amend:","Committer Name:":"Committer Name:","Committer Email:":"Committer Email:","Author Name:":"Author Name:","Author Email:":"Author Email:","The commit message is required.":"The commit message is required.","Git Credentials":"Git Credentials","Username:":"Username:","Ssh password:":"Password:",
"Private key:":"Private key:","Passphrase (optional):":"Passphrase (optional):","commit:":"commit: ","parent:":"parent: ","branches: ":"branches: ","tags: ":"tags: "," authored by ${0} {${1}) on ${2}":" authored by ${0} (${1}) on ${2}",Content:"Content","Go to ${0} section":"Go to ${0} section","Find Commit":"Find Commit","Type the commit name (sha1):":"Type the commit name (sha1):",Search:"Search","Searching...":"Searching...","Looking for the commit":"Looking for the commit"," authored by ${0} (${1})) on ${2}":" authored by ${0} (${1})) on ${2}",
"New Branch:":"New Branch:",OK:"OK"," [New branch]":" [New branch]","Would you like to add ${0} key for host ${1} to continue operation? Key fingerpt is ${2}.":"Would you like to add ${0} key for host ${1} to continue operation? Key fingerpt is ${2}.","Link Repository":"Link Repository","Folder name:":"Folder name:","Repository was linked to ":"Repository was linked to ","Checkout the current tag, creating a local branch based on its contents.":"Checkout the current tag, creating a local branch based on its contents.",
"Checking out tag ${0}":"Checking out tag ${0}","Checkout the branch or corresponding local branch and make it active. If the remote tracking branch does not have a corresponding local branch, the local branch will be created first.":"Checkout the branch or corresponding local branch and make it active. If the remote tracking branch does not have a corresponding local branch, the local branch will be created first.","Checking out branch...":"Checking out branch...","Checking out branch ${0}...":"Checking out branch ${0}...",
"Branch checked out.":"Branch checked out.","New Branch":"New Branch","Add a new local branch to the repository":"Add a new local branch to the repository","Branch name":"Branch name",Delete:"Delete","Delete the local branch from the repository":"Delete the local branch from the repository","Are you sure you want to delete branch ${0}?":"Are you sure you want to delete branch ${0}?","Delete the remote tracking branch from the repository":"Delete the remote tracking branch from the repository","Are you sure?":"Are you sure?",
"You're going to delete remote branch ${0} and push the change.":"You're going to delete remote branch ${0} and push the change.","Removing remote branch: ":"Removing remote branch: ","Delete Remote Branch":"Delete Remote Branch","New Remote":"New Remote","Git Remote":"Git Remote","Go to Git Remote":"Go to Git Remote","Add a new remote to the repository":"Add a new remote to the repository","Delete the remote from the repository":"Delete the remote from the repository","Are you sure you want to delete remote ${0}?":"Are you sure you want to delete remote ${0}?",
Pull:"Pull","Pull from the repository":"Pull from the repository","Pulling: ":"Pulling: ","Pull Git Repository":"Pull Git Repository","Git Log":"Git Log","Go to Git Log":"Go to Git Log","Open the log for the branch":"Open the log for the branch","Open the log for the repository":"Open the log for the repository","Open the status for the repository":"Open the status for the repository","Show in Navigator":"Show in Navigator","Show the repository folder in the file navigator":"Show the repository folder in the file navigator",
"Compare With Each Other":"Compare With Each Other","Compare With Working Tree":"Compare With Working Tree",Open:"Open",Fetch:"Fetch","Fetch from the remote":"Fetch from the remote","SSH Password:":"Password:","SSH User Name:":"SSH User Name:","Fetching remote: ":"Fetching remote: ","Force Fetch":"Force Fetch","Fetch from the remote branch into your remote tracking branch overriding its current content":"Fetch from the remote branch into your remote tracking branch overriding its current content",
"You're going to override content of the remote tracking branch. This can cause the branch to lose commits.":"You're going to override content of the remote tracking branch. This can cause the branch to lose commits.",Merge:"Merge","Merge the content from the branch to your active branch":"Merge the content from the branch to your active branch",". Go to ${0}.":". Go to ${0}.","Git Status page":"Git Status page",Rebase:"Rebase","Rebase your commits by removing them from the active branch, starting the active branch again based on the latest state of the selected branch ":"Rebase your commits by removing them from the active branch, starting the active branch again based on the latest state of the selected branch ",
"Rebase on top of ":"Rebase on top of ",". Some conflicts occurred. Please resolve them and continue, skip patch or abort rebasing":". Some conflicts occurred. Please resolve them and continue, skip patch or abort rebasing",". Repository state is invalid (i.e. already during rebasing)":". Repository state is invalid (i.e. already during rebasing)",". Repository contains unmerged paths":". Repository contains unmerged paths",". Repository contains pending changes. Please commit or stash them":". Repository contains pending changes. Please commit or stash them",
"Rebase your commits by removing them from the active branch, ":"Rebase your commits by removing them from the active branch, ","starting the active branch again based on the latest state of '":"starting the active branch again based on the latest state of '","and applying each commit again to the updated active branch.":"and applying each commit again to the updated active branch.","Push All":"Push All","Push commits and tags from your local branch into the remote branch":"Push commits and tags from your local branch into the remote branch",
"Pushing remote: ":"Pushing remote: ","Choose Branch":"Choose Branch","Force Push All":"Force Push All","Push commits and tags from your local branch into the remote branch overriding its current content":"Push commits and tags from your local branch into the remote branch overriding its current content","You're going to override content of the remote branch. This can cause the remote repository to lose commits.":"You're going to override content of the remote branch. This can cause the remote repository to lose commits.",
"< Previous Page":"< Previous Page","Show previous page of git log":"Show previous page of git log","Show previous page of git tags":"Show previous page of git tags","Next Page >":"Next Page >","Show next page of git log":"Show next page of git log","Show next page of git tags":"Show next page of git tags","Push from your local branch into the selected remote branch":"Push from your local branch into the selected remote branch","Reset your active branch to the state of the selected branch. Discard all staged and unstaged changes.":"Reset your active branch to the state of the selected branch. Discard all staged and unstaged changes.",
"The content of your active branch will be replaced with ":"The content of your active branch will be replaced with ","All unstaged and staged changes will be discarded and cannot be recovered. Are you sure?":"All unstaged and staged changes will be discarded and cannot be recovered. Are you sure?","Resetting index...":"Resetting index...","Name:":"Name:",Tag:"Tag","Create a tag for the commit":"Create a tag for the commit","Tag name":"Tag name","Delete the tag from the repository":"Delete the tag from the repository",
"Are you sure you want to delete tag ${0}?":"Are you sure you want to delete tag ${0}?","Cherry-Pick":"Cherry-Pick","Apply the change introduced by the commit to your active branch":"Apply the change introduced by the commit to your active branch","Nothing changed.":"Nothing changed.",". Some conflicts occurred":". Some conflicts occurred","Fetch from the remote branch into your remote tracking branch":"Fetch from the remote branch into your remote tracking branch","Fetch Git Repository":"Fetch Git Repository",
Push:"Push","Push from your local branch into the remote branch":"Push from your local branch into the remote branch","Push Git Repository":"Push Git Repository","Key:":"Key:","Value:":"Value:","New Configuration Entry":"New Configuration Entry",Edit:"Edit","Edit the configuration entry":"Edit the configuration entry","Delete the configuration entry":"Delete the configuration entry","Are you sure you want to delete ${0}?":"Are you sure you want to delete ${0}?","Clone Repository":"Clone Repository",
"Clone an existing Git repository to a folder":"Clone an existing Git repository to a folder","Cloning repository: ":"Cloning repository: ","Init Repository":"Init Repository","Create a new Git repository in a new folder":"Create a new Git repository in a new folder","Initializing repository: ":"Initializing repository: ","Init Git Repository":"Init Git Repository","Delete the repository":"Delete the repository","Are you sure you want do delete ${0} repositories?":"Are you sure you want do delete ${0} repositories?",
"Apply a patch on the selected repository":"Apply a patch on the selected repository","Show content":"Show content","Commit name:":"Commit name:","Open Commit":"Open Commit","Open the commit with the given name":"Open the commit with the given name","No commits found":"No commits found","Staging changes":"Staging changes","Commit message:":"Commit message:","Committing changes":"Committing changes","Resetting local changes":"Resetting local changes","Checkout files, discarding all changes":"Checkout files, discarding all changes",
"Show Patch":"Show Patch","Show workspace changes as a patch":"Show workspace changes as a patch",Continue:"Continue","Contibue Rebase":"Contibue Rebase","Skip Patch":"Skip Patch",Abort:"Abort","Abort Rebase":"Abort Rebase","Your changes to the selected files will be discarded and cannot be recovered.":"Your changes to the selected files will be discarded and cannot be recovered.","Active Branch Log":"Git Log (Active Branch)","Show the log for the active local branch":"Show the log for the active local branch",
"Remote Branch Log":"Git Log (Remote Branch)","Show the log for the corresponding remote tracking branch":"Show the log for the corresponding remote tracking branch","See Full Status":"See Full Status","See the status":"See the status","Choose target location":"Choose target location","Default target location":"Default target location","Change...":"Change...","Merge Squash":"Merge Squash","Squash the content of the branch to the index":"Squash the content of the branch to the index","Local Branch Name:":"Local Branch Name:",
"Filter items":"Filter items","Filter remote branches":"Filter remote branches","Paste link in email or IM":"Paste link in email or IM","Show Commit in GitHub":"Show Commit in GitHub","Show Repository in GitHub":"Show Repository in GitHub","Show this commit in GitHub":"Show this commit in GitHub","Show Commit in eclipse.org":"Show Commit in eclipse.org","Show this commit in eclipse.org":"Show this commit in eclipse.org","Show Repository in eclipse.org":"Show Repository in eclipse.org","Show this repository in eclipse.org":"Show this repository in eclipse.org",
"Ask for review":"Ask for review","Ask for review tooltip":"Send email with request for commit review","Reviewer name":"Reviewer name","Contribution Review Request":"Contribution Review Request","Send the link to the reviewer":"Send the link to the reviewer","Private key file (optional):":"Private key file (optional):","Don't prompt me again:":"Don't prompt me again:","Your private key will be saved in the browser for further use":"Your private key will be saved in the browser for further use","Loading Contribution Review Request...":"Loading Contribution Review Request...",
"The commit can be found in the following repositories":"The commit can be found in the following repositories","Try to update your repositories":"Try to update your repositories","Create new repository":"Create new repository","Attach the remote to one of your existing repositories":"Attach the remote to one of your existing repositories","You are reviewing contribution ${0} from ${1}":"You are reviewing contribution ${0} from ${1}","Unfortunately the commit can not be found in your workspace. To see it try one of the following: ":"Unfortunately the commit can not be found in your workspace. To see it try one of the following: ",
"To review the commit you can also:":"To review the commit you can also:","Contribution Review Request for ${0} on ${1}":"Contribution Review Request for ${0} on ${1}","Failing paths: ${0}":"Failing paths: ${0}","Problem while performing the action":"Problem while performing the action","Clone Git Repository":"Clone Git Repository","Go to the Orion repositories page to provide a git repository URL. Once the repository is created, it will appear in the Navigator.":"Go to the Orion repositories page to provide a git repository URL. Once the repository is created, it will appear in the Navigator."});
define("git/nls/gitmessages",["orion/i18n!git/nls/gitmessages","git/nls/root/gitmessages"],function(g,k){var j={root:k};Object.keys(g).forEach(function(e){typeof j[e]==="undefined"&&(j[e]=g[e])});return j});
(function(g,k){typeof define==="function"&&define.amd?define("orion/Deferred",k):typeof exports==="object"?module.exports=k():(g.orion=g.orion||{},g.orion.Deferred=k())})(this,function(){function g(){for(var d;d=a.shift()||i.shift();)d();f=!1}function k(d,h){(h?i:a).push(d);f||(f=!0,h?setTimeout(g,0):g())}function j(d){return function(){d.apply(null,arguments)}}function e(){}function c(){var d=Error("Cancel");d.name="Cancel";return d}function b(){function d(){for(var d;d=a.shift();){var b=d.deferred,
i=f==="resolved"?"resolve":"reject";if(typeof d[i]==="function")try{var c=d[i](h);c&&typeof c.then==="function"?(b.cancel=c.cancel||e,c.then(j(b.resolve),j(b.reject),b.progress)):b.resolve(c)}catch(m){b.reject(m)}else b[i](h)}}var h,f,a=[],i=this;this.reject=function(b){f||(f="rejected",h=b,a.length&&k(d));return i.promise};this.resolve=function(b){f||(f="resolved",h=b,a.length&&k(d));return i.promise};this.progress=function(d){f||a.forEach(function(f){f.progress&&f.progress(d)});return i.promise};
this.cancel=function(){f||i.reject(c())};this.then=function(h,c,e){var h={resolve:h,reject:c,progress:e,deferred:new b},g=h.deferred,j=!1,o=function(){j||(j=!0,k(function(){var d=g.cancel===o?i.cancel:g.cancel;typeof d==="function"&&d()},!0))};g.cancel=o;a.push(h);f&&k(d,!0);return g.promise};this.promise=Object.create(Object.prototype,{then:{value:i.then},cancel:{get:function(){return i.cancel},set:function(d){i.cancel=d}}})}var a=[],i=[],f=!1;b.all=function(d,h){function f(d,h){e||(c[d]=h,--i===
0&&g.resolve(c))}function a(d,b){if(!e){if(h)try{f(d,h(b));return}catch(o){b=o}g.reject(b)}}var i=d.length,c=[],e=!1,g=new b;g.then(null,function(){e=!0;d.forEach(function(d){d.cancel&&d.cancel()})});i===0?g.resolve(c):d.forEach(function(d,h){d.then(f.bind(null,h),a.bind(null,h))});return g.promise};b.when=function(d,h,f,a){var i;if(!(d&&typeof d.then==="function"))i=new b,i.resolve(d),d=i.promise;return d.then(h,f,a)};return b});
define("orion/EventTarget",[],function(){function g(){this._namedListeners={}}g.prototype={dispatchEvent:function(g){if(!g.type)throw Error("unspecified type");var j=this._namedListeners[g.type];j&&j.forEach(function(e){try{typeof e==="function"?e(g):e.handleEvent(g)}catch(c){typeof console!=="undefined"&&console.log(c)}});return!g.defaultPrevented},addEventListener:function(g,j){if(typeof j==="function"||j.handleEvent)this._namedListeners[g]=this._namedListeners[g]||[],this._namedListeners[g].push(j)},
removeEventListener:function(g,j){var e=this._namedListeners[g];if(e)for(var c=0;c<e.length;c++)if(e[c]===j){e.length===1?delete this._namedListeners[g]:e.splice(c,1);break}}};g.prototype.constructor=g;g.attach=function(k){var j=new g;k.dispatchEvent=j.dispatchEvent.bind(j);k.addEventListener=j.addEventListener.bind(j);k.removeEventListener=j.removeEventListener.bind(j)};return g});
define("orion/serviceregistry",["orion/Deferred","orion/EventTarget"],function(g,k){function j(a,f,d){this._properties=d||{};this._properties["service.id"]=a;this._properties.objectClass=f;this._properties["service.names"]=f}function e(a,f,d){this._serviceId=a;this._serviceReference=f;this._internalRegistry=d}function c(a,f){function d(d){return function(){var h;try{if(!f())throw Error("Service was unregistered");var b=a[d].apply(a,Array.prototype.slice.call(arguments));if(b&&typeof b.then==="function")return b;
else h=new g,h.resolve(b)}catch(c){h=new g,h.reject(c)}return h.promise}}for(var h in a)typeof a[h]==="function"&&(this[h]=d(h))}function b(a,f){this.type=a;this.serviceReference=f}function a(){this._entries=[];this._namedReferences={};this._serviceEventTarget=new k;var a=this;this._internalRegistry={isRegistered:function(f){return a._entries[f]?!0:!1},unregisterService:function(f){var d=a._entries[f];if(!d)throw Error("already unregistered");var h=d.reference;a._serviceEventTarget.dispatchEvent(new b("unregistering",
h));a._entries[f]=null;h.getProperty("objectClass").forEach(function(d){for(var f=a._namedReferences[d],b=0;b<f.length;b++)if(f[b]===h){f.length===1?delete a._namedReferences[d]:f.splice(b,1);break}})},modifyService:function(f){f=a._entries[f];if(!f)throw Error("already unregistered");a._serviceEventTarget.dispatchEvent(new b("modified",f.reference))}}}j.prototype={getPropertyKeys:function(){var a=[],f;for(f in this._properties)this._properties.hasOwnProperty(f)&&a.push(f);return a},getProperty:function(a){return this._properties[a]}};
j.prototype.constructor=j;e.prototype={unregister:function(){this._internalRegistry.unregisterService(this._serviceId)},getReference:function(){if(!this._internalRegistry.isRegistered(this._serviceId))throw Error("already unregistered");return this._serviceReference},setProperties:function(a){var f=this._serviceReference._properties;this._serviceReference._properties=a||{};a["service.id"]=this._serviceId;a.objectClass=f.objectClass;a["service.names"]=f["service.names"];this._internalRegistry.modifyService(this._serviceId)}};
e.prototype.constructor=e;a.prototype={getService:function(a){var f;if(typeof a==="string")(a=this._namedReferences[a])&&a.some(function(d){f=this._entries[d.getProperty("service.id")].service;return!!f},this);else if(a=this._entries[a.getProperty("service.id")])f=a.service;return f||null},getServiceReferences:function(a){if(a)return this._namedReferences[a]?this._namedReferences[a]:[];var f=[];this._entries.forEach(function(d){d&&f.push(d.reference)});return f},registerService:function(a,f,d){if(typeof f===
"undefined"||f===null)throw Error("invalid service");typeof a==="string"?a=[a]:Array.isArray(a)||(a=[]);var h=this._entries.length,l=new j(h,a,d),n=this._namedReferences;a.forEach(function(d){n[d]=n[d]||[];n[d].push(l)});a=new c(f,this._internalRegistry.isRegistered.bind(null,h));this._entries.push({reference:l,service:a});a=this._internalRegistry;this._serviceEventTarget.dispatchEvent(new b("registered",l));return new e(h,l,a)},addEventListener:function(a,f){this._serviceEventTarget.addEventListener(a,
f)},removeEventListener:function(a,f){this._serviceEventTarget.removeEventListener(a,f)}};a.prototype.constructor=a;return{ServiceRegistry:a}});
define("orion/xhr",["orion/Deferred"],function(g){function k(g,e,c,b){var a=typeof c.response!=="undefined"?c.response:c.responseText,i;try{i=c.status}catch(f){i=0}g={args:e,response:a,responseText:typeof a==="string"?a:null,status:i,url:g,xhr:c};if(typeof b!=="undefined")g.error=b;return g}return function(j,e,c){var c=c||{},b=arguments.length>3&&arguments[3]?arguments[3]:new XMLHttpRequest,a=new g,i=c.headers||{},f=c.log||!1,d;typeof i["X-Requested-With"]==="undefined"&&(i["X-Requested-With"]="XMLHttpRequest");
if(typeof c.data!=="undefined"&&(j==="POST"||j==="PUT"))d=c.data;b.onprogress=function(d){d.xhr=b;a.progress(d)};b.onreadystatechange=function(){if(b.readyState===4){var d=k(e,c,b),h=b.status;200<=h&&h<400?a.resolve(d):(f&&typeof console!=="undefined"&&console.log(Error(b.statusText)),a.reject(d))}};try{b.open(j,e,!0);if(typeof c.responseType==="string")b.responseType=c.responseType;if(typeof c.timeout==="number")if(typeof b.timeout==="number")b.timeout=c.timeout,b.addEventListener("timeout",function(){a.reject(k(e,
c,b,"Timeout exceeded"))});else{var h=setTimeout(function(){a.reject(k(e,c,b,"Timeout exceeded"))},c.timeout);a.then(clearTimeout.bind(null,h),clearTimeout.bind(null,h))}Object.keys(i).forEach(function(d){b.setRequestHeader(d,i[d])});b.send(d)}catch(l){a.reject(k(e,c,b,l))}return a.promise}});
define("orion/preferences",["require","orion/Deferred","orion/xhr"],function(g,k,j){function e(d,a){this._name=d;this._providers=a;this._flushPending=!1;this._cached=null;this._stores=[];this._dirty=[]}function c(d,a){return{get:function(f,b){if(a===0)return null;var c=localStorage.getItem(d+f);if(c===null)return null;c=JSON.parse(c);return b||a===-1||c._expires&&c._expires>(new Date).getTime()?(delete c._expires,c):null},set:function(f,b){if(a!==0){if(a!==-1)b._expires=(new Date).getTime()+1E3*a;
if(Object.keys(b).length===0)localStorage.removeItem(d+f);else{var c=JSON.stringify(b);localStorage.setItem(d+f,c);delete b._expires}}},remove:function(a){localStorage.removeItem(d+a)}}}function b(d){this._currentPromises={};this._cache=new c("/orion/preferences/user",3600);this._service=null;this.available=function(){if(!this._service){var a=d.getServiceReferences("orion.core.preference.provider");if(a.length>0)this._service=d.getService(a[0])}return!!this._service}}function a(d){this._location=
d;this._currentPromise=null;this._cache=new c("/orion/preferences/default",3600)}function i(){this._cache=new c("/orion/preferences/local",-1)}function f(d,f){this._userProvider=new b(d);this._localProvider=new i;f=f||"defaults.pref";f.indexOf("://")===-1&&(f=g.toUrl(f));this._defaultsProvider=new a(f);this._serviceRegistration=d.registerService("orion.core.preference",this)}e.prototype={_flush:function(){for(var d=[],a=0;a<this._stores.length;++a){var f=this._stores[a];this._dirty.indexOf(f)!==-1&&
d.push(this._providers[a].put(this._name,f))}this._dirty=[];return k.all(d)},_scheduleFlush:function(d){this._dirty.indexOf(d)===-1&&this._dirty.push(d);if(!this._flushPending)this._flushPending=!0,window.setTimeout(function(){if(this._flushPending)this._flushPending=!1,this._flush()}.bind(this),0)},_getCached:function(){if(!this._cached){this._cached={};for(var d=0;d<this._stores.length;++d){var a=this._stores[d],f;for(f in a)a.hasOwnProperty(f)&&typeof this._cached[f]==="undefined"&&(this._cached[f]=
a[f])}}return this._cached},keys:function(){return Object.keys(this._getCached())},get:function(d){return this._getCached()[d]},put:function(d,a){if(this._stores.length!==0){var f=this._stores[0];if(f[d]!==a)f[d]=a,this._cached=null,this._scheduleFlush(f)}},remove:function(d){for(var a=0;a<this._stores.length;++a){var f=this._stores[a];if(f.hasOwnProperty(d))return delete f[d],this._cached=null,this._scheduleFlush(f),!0}return!1},clear:function(){for(var d=0;d<this._stores.length;++d)this._stores[d]=
{},this._scheduleFlush(this._stores[d]);this._cached=null},sync:function(d){if(this._flushPending)return this._flushPending=!1,this._flush();for(var a=this,f=[],b=0;b<this._providers.length;++b)f.push(this._providers[b].get(this._name,d).then(function(d){return function(f){a._stores[d]=f}}(b)));return k.all(f).then(function(){a._cached=null;a._getCached()})},flush:function(){this._flush()}};b.prototype={get:function(d,a){if(this._currentPromises[d])return this._currentPromises[d];var f=new k,b=null;
a?this._cache.remove(d):b=this._cache.get(d);if(b!==null)f.resolve(b);else{this._currentPromises[d]=f;var c=this;this._service.get(d).then(function(a){c._cache.set(d,a);delete c._currentPromises[d];f.resolve(a)},function(a){a.status===404?(a={},c._cache.set(d,a),delete c._currentPromises[d],f.resolve(a)):(delete c._currentPromises[d],f.resolve(c._cache.get(d,!0)||{}))})}return f},put:function(d,a){this._cache.set(d,a);return this._service.put(d,a)}};a.prototype={get:function(d,a){if(this._currentPromise)return this._currentPromise;
var f=new k,b=null;a?this._cache.remove(d):b=this._cache.get(d);if(b!==null)f.resolve(b);else{this._currentPromise=f;var c=this;j("GET",this._location,{headers:{"Orion-Version":"1"},timeout:15E3}).then(function(a){a=JSON.parse(a.response);c._cache.set(d,a[d]||{});c._currentPromise=null;f.resolve(a[d]||{})},function(a){a.xhr.status===401||a.xhr.status===404?(c._cache.set(d,{}),c._currentPromise=null,f.resolve({})):(c._currentPromise=null,a=c._cache.get(d,!0),a!==null?f.resolve(a[d]||{}):f.resolve({}))})}return f},
put:function(){var a=new k;a.resolve();return a}};i.prototype={get:function(a){var f=new k,a=this._cache.get(a);a!==null?f.resolve(a):f.resolve({});return f},put:function(a,f){var b=new k;this._cache.set(a,f);b.resolve();return b}};f.DEFAULT_SCOPE=1;f.LOCAL_SCOPE=2;f.USER_SCOPE=4;f.prototype={listenForChangedSettings:function(a,h,b){if(!h||typeof h!=="number"||h>7||h<1)b=h,h=f.DEFAULT_SCOPE|f.LOCAL_SCOPE|f.USER_SCOPE;window.addEventListener("storage",b,!1);if((f.USER_SCOPE&h)!==0)return"/orion/preferences/user"+
a;else if((f.LOCAL_SCOPE&h)!==0)return"/orion/preferences/local"+a;return"/orion/preferences/default"+a},getPreferences:function(a,h){if(!h||typeof h!=="number"||h>7||h<1)h=f.DEFAULT_SCOPE|f.LOCAL_SCOPE|f.USER_SCOPE;var b=[];f.USER_SCOPE&h&&this._userProvider.available()&&b.push(this._userProvider);f.LOCAL_SCOPE&h&&b.push(this._localProvider);f.DEFAULT_SCOPE&h&&b.push(this._defaultsProvider);var c=new e(a,b);return c.sync().then(function(){return c})},getSetting:function(a,f,b){for(var c,i=0;i<a.length;i++)if(a[i].label===
f)for(var e=0;e<a[i].data.length;e++)if(a[i].data[e].label===b){c=a[i].data[e].value;break}return c}};return{PreferencesService:f}});
(function(){function g(a){if(typeof a!=="string")throw new TypeError;}function k(a){return a?a.split("&"):[]}function j(a){return a.length===0?"":a.join("&")}function e(a){var d=/([^=]*)(?:=?)(.*)/.exec(a),a=d[1]?decodeURIComponent(d[1]):"",d=d[2]?decodeURIComponent(d[2]):"";return[a,d]}function c(a){var d=encodeURIComponent(a[0]);a[1]&&(d+="="+encodeURIComponent(a[1]));return d}function b(a,d){var f="",h=[],o=0;return{next:function(){if(f!==a.query)f=a.query,h=k(f);if(o<h.length){var b=e(h[o++]);
switch(d){case "keys":return b[0];case "values":return b[1];case "keys+values":return[b[0],b[1]];default:throw new TypeError;}}throw u;}}}function a(a){Object.defineProperty(this,"_url",{get:function(){return a._url}})}function i(a){var d=[];a.split("/").forEach(function(a){a===".."?d.pop():a!=="."&&d.push(a)});return d.join("/")}function f(a){return a.replace(/\s/g,function(a){return"%"+a.charCodeAt(0).toString(16)})}function d(a,d){if(typeof a!=="string")throw new TypeError;var a=f(a),h=n.exec(a);
if(!h)return null;var o={};o.scheme=h[1]||"";if(o.scheme&&!q.test(o.scheme))return null;var b=h[2];if(b&&(b=m.exec(b),o.userinfo=b[1],o.host=b[2],o.port=b[3],o.port&&!s.test(o.port)))return null;o.path=h[3];o.query=h[4];o.fragment=h[5];if(!o.scheme&&d&&(o.scheme=d.scheme,!o.host&&d.host))o.userinfo=d.userinfo,o.host=d.host,o.port=d.port,o.pathRelative=!0;if(o.pathRelative)if(o.path){if(o.path[0]!=="/")h=/^(.*\/)[^\/]*$/.exec(d.path)[1]||"/",o.path=h+o.path}else o.path=d.path;if(o.scheme)o.scheme=
o.scheme.toLowerCase();if(o.port)o.port=/[1-9]\d*$/.exec(o.port)[0];if(o.host&&o.path)o.path=i(o.path);return o}function h(f,o){var h;if(o){o=o.href||o;h=d(o);if(!h||!h.scheme)throw new SyntaxError;Object.defineProperty(this,"_baseURL",{value:h})}h=d(f,h);if(!h)throw new SyntaxError;Object.defineProperty(this,"_input",{value:f,writable:!0});Object.defineProperty(this,"_url",{value:h,writable:!0});var b=new a(this);Object.defineProperty(this,"query",{get:function(){return this._url?b:null},enumerable:!0})}
try{if(typeof window.URL==="function"&&window.URL.length!==0&&(new window.URL("http://www.w3.org")).protocol==="http:")return}catch(l){}var n=/^(?:([^:\/?#]+):)?(?:\/\/([^\/?#]*))?([^?#]*)(?:\?([^#]*))?(?:#(.*))?$/,m=/^(?:(.*)@)?(\[[^\]]*\]|[^:]*)(?::(.*))?$/,q=/^([a-zA-Z](?:[a-zA-Z0-9+-.])*)$/,s=/^\d*$/,p=/^(\[[^\]\/?#\s]*\]|[^:\/?#\s]*)$/,r=/^(\[[^\]\/?#\s]*\]|[^:\/?#\s]*)(?::(\d*))?$/,t=/^([^?#\s]*)$/,o=/^([^\s]*)$/,v=/^\S*$/,x=/([^:]*):?(.*)/,u=typeof StopIteration!=="undefined"?StopIteration:
Error("Stop Iteration"),w={"ftp:":"21","gopher:":"70","http:":"80","https:":"443","ws:":"80","wss:":"443"};Object.defineProperties(a.prototype,{get:{value:function(a){g(a);var d;k(this._url.query).some(function(f){f=e(f);if(f[0]===a)return d=f[1],!0});return d},enumerable:!0},set:{value:function(a,d){g(a);g(d);var f=k(this._url.query);f.some(function(o,h){var b=e(o);if(b[0]===a)return b[1]=d,f[h]=c(b),!0})||f.push(c([a,d]));this._url.query=j(f)},enumerable:!0},has:{value:function(a){g(a);return k(this._url.query).some(function(d){if(e(d)[0]===
a)return!0})},enumerable:!0},"delete":{value:function(a){g(a);var d=k(this._url.query),f=d.filter(function(d){return e(d)[0]!==a});return f.length!==d.length?(this._url.query=j(f),!0):!1},enumerable:!0},clear:{value:function(){this._url.query=""},enumerable:!0},forEach:{value:function(a,d){if(typeof a!=="function")throw new TypeError;var f=b(this._url,"keys+values");try{for(;;){var o=f.next();a.call(d,o[1],o[0],this)}}catch(h){if(h!==u)throw h;}},enumerable:!0},keys:{value:function(){return b(this._url,
"keys")},enumerable:!0},values:{value:function(){return b(this._url,"values")},enumerable:!0},items:{value:function(){return b(this._url,"keys+values")}},size:{get:function(){return k(this._url.query).length},enumerable:!0},getAll:{value:function(a){g(a);var d=[];k(this._url.query).forEach(function(f){f=e(f);f[0]===a&&d.push(f[1])});return d},enumerable:!0},append:{value:function(a,d){g(a);g(d);var f=k(this._url.query);f.push(c([a,d]));this._url.query=j(f)},enumerable:!0}});Object.defineProperties(h.prototype,
{href:{get:function(){var a;if(this._url){a=this._url;var d=a.scheme?a.scheme+":":"";a.host&&(d+="//",a.userinfo&&(d+=a.userinfo+"@"),d+=a.host,a.port&&(d+=":"+a.port));d+=a.path;a.query&&(d+="?"+a.query);a.fragment&&(d+="#"+a.fragment);a=d}else a=this._input;return a},set:function(a){g(a);this._input=a;this._url=d(this._input,this._baseURL)},enumerable:!0},origin:{get:function(){return this._url&&this._url.host?this.protocol+"//"+this.host:""},enumerable:!0},protocol:{get:function(){return this._url?
this._url.scheme+":":":"},set:function(a){g(a);if(this._url&&(a=a.slice(-1)===":"?a.substring(0,a.length-1):a,q.test(a)))this._url.scheme=a.toLowerCase()},enumerable:!0},_userinfo:{get:function(){return this._url?this._url.userinfo:""},set:function(a){g(a);if(this._url)this._url.userinfo=a}},username:{get:function(){if(!this._url)return"";var a=x.exec(this._userinfo);return decodeURIComponent(a[1]||"")},set:function(a){g(a);if(this._url){var d=x.exec(this._userinfo),a=[encodeURIComponent(a||"")];
d[2]&&a.push(d[2]);this._userinfo=a.join(":")}},enumerable:!0},password:{get:function(){if(!this._url)return"";var a=x.exec(this._userinfo);return decodeURIComponent(a[2]||"")},set:function(a){g(a);if(this._url){var d=[x.exec(this._userinfo)[1]||""];a&&d.push(encodeURIComponent(a));this._userinfo=d.join(":")}},enumerable:!0},host:{get:function(){var a="";this._url&&this._url.host&&(a+=this._url.host,this._url.port&&(a+=":"+this._url.port));return a},set:function(a){g(a);if(this._url&&(a=r.exec(a)))this._url.host=
a[1],this._url.port=/[1-9]\d*$/.exec(a[2])[0]},enumerable:!0},hostname:{get:function(){return this._url?this._url.host:""},set:function(a){g(a);if(this._url&&p.exec(a))this._url.host=a},enumerable:!0},port:{get:function(){var a=this._url?this._url.port||"":"";a&&a===w[this.protocol]&&(a="");return a},set:function(a){g(a);if(this._url&&s.exec(a))this._url.port=/[1-9]\d*$/.exec(a)[0]},enumerable:!0},pathname:{get:function(){return this._url?this._url.path:""},set:function(a){g(a);if(this._url&&t.exec(a))this._url.host&&
a&&a[0]!=="/"&&(a="/"+a),this._url.path=a?i(a):""},enumerable:!0},search:{get:function(){return this._url&&this._url.query?"?"+this._url.query:""},set:function(a){g(a);if(this._url&&(a&&a[0]==="?"&&(a=a.substring(1)),o.exec(a)))this._url.query=a},enumerable:!0},hash:{get:function(){return this._url&&this._url.fragment?"#"+this._url.fragment:""},set:function(a){g(a);if(this._url&&(a&&a[0]==="#"&&(a=a.substring(1)),v.exec(a)))this._url.fragment=a},enumerable:!0}});window.URL&&window.URL.createObjectURL&&
(Object.defineProperty(h,"createObjectURL",{value:window.URL.createObjectURL.bind(window.URL),enumerable:!1}),Object.defineProperty(h,"revokeObjectURL",{value:window.URL.revokeObjectURL.bind(window.URL),enumerable:!1}));window.URL=h})();define("orion/URL-shim",function(){});
define("orion/pluginregistry",["orion/Deferred","orion/EventTarget","orion/URL-shim"],function(g,k){function j(a,d){var h=Object.keys(a),b=Object.keys(d);if(h.length!==b.length)return!1;h.sort();b.sort();for(var c=0,i=h.length;c<i;c++){var e=h[c];if(e!==b[c])return!1;var s=a[e],e=d[e];if(s!==e&&JSON.stringify(s)!==JSON.stringify(e))return!1}return!0}function e(a){if(a.indexOf("://")===-1)try{return(new URL(a,location.href)).href}catch(d){}return a}function c(a){var d=null;return{key:function(h){return(d=
d||Object.keys(a))[h]},getItem:function(d){return a[d]},setItem:function(h,b){a[h]=b;d=null},removeItem:function(h){delete a[h];d=null},clear:function(){(d=d||Object.keys(a)).forEach(function(d){delete a[d]}.bind(this));d=null}}}function b(a,d){return{type:a,plugin:d}}function a(a,d,h){function c(a,d,f){if(!B)return(new g).reject(Error("plugin not connected"));var o=G++,b=new g;b.then(null,function(a){w==="active"&&a instanceof Error&&a.name==="Cancel"&&h.postMessage({id:o,cancel:a.message||"Cancel"},
B)});D[String(o)]=b;h.postMessage({id:o,serviceId:a,method:d,params:f},B);return b.promise}function i(a){var d={};if(a.methods&&(a.methods.forEach(function(f){d[f]=function(){var d=Array.prototype.slice.call(arguments);return w==="active"?c(a.serviceId,f,d):r.start({"transient":!0}).then(function(){return c(a.serviceId,f,d)})}}),d.addEventListener&&d.removeEventListener)){var f=new k;d.dispatchEvent=f.dispatchEvent.bind(f);var o=d.addEventListener;d.addEventListener=function(a,d){f._namedListeners[a]||
o(a);f.addEventListener(a,d)};var h=d.removeEventListener;d.removeEventListener=function(a,d){f.removeEventListener(a,d);f._namedListeners[a]&&h(a)}}return d}function e(d){var o=JSON.parse(JSON.stringify(d.properties));o.__plugin__=a;d=d.names||d.type||[];Array.isArray(d)||(d=[d]);o.objectClass=d;return o}function q(a){var d=i(a),f=e(a),f=h.registerService(a.names||a.type,d,f);C[a.serviceId]={registration:f,proxy:d}}function s(){h.persist(a,{created:t,headers:o,services:v,autostart:x,lastModified:u})}
function p(a){var d;try{if(a.method)if("manifest"===a.method||"plugin"===a.method){var f=a.params[0];I({headers:f.headers,services:f.services}).then(function(){A.resolve(r)})}else if("dispatchEvent"===a.method){var o=C[a.serviceId].proxy;o.dispatchEvent.apply(o,a.params)}else if("progress"===a.method)d=D[String(a.requestId)],d.progress.apply(d,a.params);else if("timeout"===a.method)A&&A.reject(a.error);else throw Error("Bad response method: "+a.method);else if(d=D[String(a.id)],delete D[String(a.id)],
a.error){var b=h.handleServiceError(r,a.error);d.reject(b)}else d.resolve(a.result)}catch(c){console.log("Plugin._responseHandler "+c)}}var r=this,d=d||{},t=d.created||(new Date).getTime(),o=d.headers||{},v=d.services||[],x=d.autostart,u=d.lastModified||0,w="installed",z,A,B,C={},G=0,D={},I;this._persist=s;this._resolve=function(){w="resolved";h.dispatchEvent(new b("resolved",r))};this._getAutostart=function(){return x};this._getCreated=function(){return t};this.getLocation=function(){return a};this.getHeaders=
function(){return JSON.parse(JSON.stringify(o))};this.getName=function(){var a=this.getHeaders();return a?a.name||"":null};this.getVersion=function(){var a=this.getHeaders();return a?a.version||"0.0.0":null};this.getLastModified=function(){return u};this.getServiceReferences=function(){var a=[];Object.keys(C).forEach(function(d){a.push(C[d].registration.getReference())});return a};this.getState=function(){return w};this.start=function(d){if(w==="uninstalled")return(new g).reject(Error("Plugin is uninstalled"));
if(z)return z.promise.then(this.start.bind(this,d));if(w==="active")return(new g).resolve();if(!d||!d["transient"]){var o=d&&d.lazy?"lazy":"started";o!==x&&(x=o,s())}o=h.getState();if(o!=="starting"&&o!=="active")return d["transient"]?(new g).reject(Error("start transient error")):(new g).resolve();if(w==="installed")try{this._resolve()}catch(c){return(new g).reject(c)}w==="resolved"&&v.forEach(function(a){q(a)});if(d&&d.lazy)return w!=="starting"&&(w="starting",h.dispatchEvent(new b("lazy activation",
r))),(new g).resolve();var i=new g;z=i;w="starting";h.dispatchEvent(new b("starting",r));A=new g;B=h.connect(a,p);A.then(function(){A=null;w="active";h.dispatchEvent(new b("started",r));z=null;i.resolve()},function(){A=null;w="stopping";h.dispatchEvent(new b("stopping",r));Object.keys(C).forEach(function(a){C[a].registration.unregister();delete C[a]});h.disconnect(B);B=null;w="resolved";z=null;h.dispatchEvent(new b("stopped",r));i.reject(Error("plugin activation error"))});return i.promise};this.stop=
function(a){if(w==="uninstalled")return(new g).reject(Error("Plugin is uninstalled"));if(z)return z.promise.then(this.stop.bind(this,a));if((!a||!a["transient"])&&"stopped"!==x)x="stopped",s();if(w!=="active"&&w!=="starting")return(new g).resolve();z=a=new g;w="stopping";h.dispatchEvent(new b("stopping",r));Object.keys(C).forEach(function(a){C[a].registration.unregister();delete C[a]});B&&(h.disconnect(B),B=null);w="resolved";z=null;h.dispatchEvent(new b("stopped",r));a.resolve();return a.promise};
I=function(d){if(w==="uninstalled")return(new g).reject(Error("Plugin is uninstalled"));if(!d)return u===0&&(u=(new Date).getTime(),s()),h.loadManifest(a).then(I);var c=o,i=v,l=x;o=d.headers||{};v=d.services||{};x=d.autostart||x;d.lastModified?u=d.lastModified:(u=(new Date).getTime(),s());if(j(o,c)&&j(v,i)&&x===l)return(new g).resolve();if(w==="active"||w==="starting"){var n=[];Object.keys(v).forEach(function(a){var d=v[a];n.push(a);var f=C[a];if(f){if(j(d.methods,Object.keys(f.proxy))){var a=e(d),
o=f.registration.getReference(),h={};o.getPropertyKeys().forEach(function(a){h[a]=o.getProperty(a)});j(a,h)||f.registration.setProperties(a);return}f.registration.unregister();delete C[a]}q(d)});Object.keys(C).forEach(function(a){n.indexOf(a)===-1&&(C[a].registration.unregister(),delete C[a])})}w==="active"&&(h.disconnect(B),A=new g,B=h.connect(a,p),A.then(function(){A=null},function(){A=null;w="stopping";h.dispatchEvent(new b("stopping"),r);Object.keys(C).forEach(function(a){C[a].registration.unregister();
delete C[a]});h.disconnect(B);B=null;w="resolved";h.dispatchEvent(new b("stopped",r))}));return(new g).resolve()};this.update=function(a){return I(a).then(function(){h.dispatchEvent(new b("updated",r))})};this.uninstall=function(){if(w==="uninstalled")return(new g).reject(Error("Plugin is uninstalled"));if(w==="active"||w==="starting"||w==="stopping")return this.stop().then(this.uninstall.bind(this),this.uninstall.bind(this));h.removePlugin(this);w="uninstalled";h.dispatchEvent(new b("uninstalled",
r));return(new g).resolve()}}var i=/^http[s]?/i;return{Plugin:a,PluginRegistry:function(f,d){function h(a){var d=a.source;q.some(function(f){if(d===f.target){if(typeof f.useStructuredClone==="undefined")f.useStructuredClone=typeof a.data!=="string";f.handler(f.useStructuredClone?a.data:JSON.parse(a.data));return!0}})}var d=d||{},l=d.storage||localStorage;l.getItem||(l=c(l));var n="installed",m=[],q=[],s=new k,j={},r={registerService:f.registerService.bind(f),connect:function(a,f,h){function b(a){a=
Error(a);a.name="timeout";f({method:"timeout",error:a})}var c={handler:f,url:a},i=setTimeout(b.bind(null,"Load timeout for: "+a),h||15E3),e=document.createElement("iframe");e.name=a+"_"+(new Date).getTime();if(!d.visible)e.style.display="none",e.style.visibility="hidden";e.src=a;e.onload=function(){clearTimeout(i);setTimeout(b.bind(null,"Plugin handshake timeout for: "+a),5E3)};e.sandbox="allow-scripts allow-same-origin";document.body.appendChild(e);c.target=e.contentWindow;c.close=function(){e&&
(document.body.removeChild(e),e=null)};q.push(c);return c},disconnect:function(a){for(var d=0;d<q.length;d++)if(a===q[d]){q.splice(d,1);try{a.close()}catch(f){}break}},removePlugin:function(a){for(var d=0;d<m.length;d++)if(a===m[d]){m.splice(d,1);break}l.removeItem("plugin."+a.getLocation())},persist:function(a,d){l.setItem("plugin."+a,JSON.stringify(d))},postMessage:function(a,d){d.target.postMessage(d.useStructuredClone?a:JSON.stringify(a),d.url)},dispatchEvent:function(a){try{s.dispatchEvent(a)}catch(d){console&&
console.log("PluginRegistry.dispatchEvent "+d)}},loadManifest:function(a){var d=new g,f=r.connect(a,function(a){f&&a.method&&("manifest"===a.method||"plugin"===a.method?(a=a.params[0],r.disconnect(f),f=null,d.resolve(a)):"timeout"===a.method&&(r.disconnect(f),f=null,d.reject(a.error)))});return d.promise},getState:function(){return n},handleServiceError:function(a,d){if(d&&d.status===401){var f=a.getHeaders(),h=a.getName()||a.getLocation(),b=document.createElement("span");b.appendChild(document.createTextNode("Authentication required for: "+
h+"."));if(f.login)b.appendChild(document.createTextNode(" ")),h=document.createElement("a"),h.target="_blank",h.textContent="Login",h.href=f.login,i.test(h.href)?(b.appendChild(h),b.appendChild(document.createTextNode(" and re-try the request."))):console.log("Illegal Login URL: "+f.login);return{Severity:"Error",HTML:!0,Message:(new XMLSerializer).serializeToString(b)}}if(d.__isError){var c=d,d=Error(c.message);Object.keys(c).forEach(function(a){d[a]=c[a]});delete d.__isError}return d}};this.getLocation=
function(){return"System"};this.getHeaders=function(){return{}};this.getName=function(){return"System"};this.getVersion=function(){return"0.0.0"};this.getLastModified=function(){return 0};this.getState=r.getState;this.init=function(){if(!(n==="starting"||n==="active"||n==="stopping")){addEventListener("message",h,!1);for(var f=[],o=0,b=l.length;o<b;o++)f.push(l.key(o));f.forEach(function(d){if(d.indexOf("plugin.")===0){var f=d.substring(7),d=JSON.parse(l.getItem(d));d.created&&m.push(new a(f,d,r))}});
m.sort(function(a,d){return a._getCreated()<d._getCreated()?-1:1});d.plugins&&Object.keys(d.plugins).forEach(function(f){f=e(f);if(!this.getPlugin(f)){var h=d.plugins[f],h=typeof h==="object"||{};h.autostart=h.autostart||d.defaultAutostart||"lazy";m.push(new a(f,h,r))}}.bind(this));n="starting"}};this.start=function(){n!=="starting"&&this.init();if(n!=="starting")return(new g).reject("Cannot start framework. Framework is already "+n+".");var a=[],d=(new Date).getTime();m.forEach(function(f){var h=
f._getAutostart();f.getLastModified()===0?a.push(f.update().then(function(){if("started"===h)return f.start({"transient":!0});if("lazy"===h)return f.start({lazy:!0,"transient":!0});f._resolve()})):"started"===h?a.push(f.start({"transient":!0})):"lazy"===h?(a.push(f.start({lazy:!0,"transient":!0})),d>f.getLastModified()+864E5&&f.update()):f._resolve()});return g.all(a,function(a){console.log("PluginRegistry.stop "+a)}).then(function(){n="active"})};this.stop=function(){if(n!=="starting"&&n!=="active")return(new g).reject("Cannot stop registry. Registry is already "+
n+".");n="stopping";var a=[];m.forEach(function(d){a.push(d.stop({"transient":!0}))});return g.all(a,function(a){console.log("PluginRegistry.stop "+a)}).then(function(){removeEventListener("message",h);n="resolved"})};this.update=function(){this.stop().then(this.start.bind(this))};this.uninstall=function(){return(new g).reject("Cannot uninstall registry")};this.installPlugin=function(d,f){var d=e(d),h=this.getPlugin(d);if(h)return(new g).resolve(h);if(j[d])return j[d];if(f)return h=new a(d,f,r),m.push(h),
h._persist(),r.dispatchEvent(new b("installed",h)),(new g).resolve(h);var c=r.loadManifest(d).then(function(f){h=new a(d,f,r);m.push(h);h._persist();delete j[d];r.dispatchEvent(new b("installed",h));return h},function(a){delete j[d];throw a;});return j[d]=c};this.getPlugins=function(){return m.slice()};this.getPlugin=function(a){var d=null,a=e(a);m.some(function(f){if(a===f.getLocation())return d=f,!0});return d};this.addEventListener=s.addEventListener.bind(s);this.removeEventListener=s.removeEventListener.bind(s);
this.resolvePlugins=function(){var a=!0;m.forEach(function(d){a=a&&d._resolve()});return a}}}});
define("orion/serviceTracker",[],function(){function g(e,c){function b(a){var d=a.getProperty("service.id"),h=this.addingService(a);h&&(i[d]=a,f[d]=h)}function a(a){var d=a.getProperty("service.id"),h=f[d];delete i[d];delete f[d];this.removedService(a,h)}this.serviceRegistry=e;var i={},f={},d=k,h,l;this.close=function(){if(d!==j)throw"Already closed";d=k;e.removeEventListener("registered",h);e.removeEventListener("unregistering",l);l=h=null;var f=this;this.getServiceReferences().forEach(function(d){a.call(f,
d)});if(typeof this.onClose==="function")this.onClose()};this.getServiceReferences=function(){return i.length?Object.keys(i).map(function(a){return i[a]}):null};this.open=function(){if(d!==k)throw"Already open";d=j;var f=this;h=function(a){if(a.serviceReference.getProperty("objectClass").indexOf(c)!==-1&&(b.call(f,a.serviceReference),typeof f.onServiceAdded==="function"))return f.onServiceAdded(a.serviceReference,f.serviceRegistry.getService(a.serviceReference))};l=function(d){d.serviceReference.getProperty("objectClass").indexOf(c)!==
-1&&a.call(f,d.serviceReference)};e.addEventListener("registered",h);e.addEventListener("unregistering",l);e.getServiceReferences(c).forEach(function(a){b.call(f,a)});if(typeof this.onOpen==="function")this.onOpen()}}var k=0,j=1;g.prototype={addingService:function(e){return this.serviceRegistry.getService(e)},onOpen:null,onClose:null,onServiceAdded:null,removedService:function(){}};return g});
define("orion/config",["orion/Deferred","orion/serviceTracker"],function(g,k){var j,e,c,b,a,i="pid";j=function(a,f,b){function c(a,d,b){d.forEach(function(o,c){try{var i=a[c].getProperty("__plugin__"),e=i&&f.getPlugin(i);(!i||e&&e.getState()==="active")&&d[c].updated(b)}catch(l){typeof console!=="undefined"&&console.log(l)}})}k.call(this,a,"orion.cm.managedservice");var e={},q={},s=function(f){var h=[];f.plugin.getServiceReferences().forEach(function(f){if(f.getProperty("objectClass").indexOf("orion.cm.managedservice")!==
-1){var o=f.getProperty(i),f=a.getService(f);o&&f&&(o=(o=b._find(o))&&o.getProperties(),h.push(f.updated(o)))}});return g.all(h)};this.addingService=function(f){var h=f.getProperty(i),b=a.getService(f);if(!h||!b)return null;e[h]||(e[h]=[]);q[h]||(q[h]=[]);e[h].push(f);q[h].push(b);return b};this.onServiceAdded=function(a,d){var f=a.getProperty(i),f=b._find(f);c([a],[d],f&&f.getProperties())};this.onOpen=function(){f.addEventListener("started",s)};this.onClose=function(){f.removeEventListener("started",
s)};this.notifyUpdated=function(a){var d=a.getPid();c(e[d]||[],q[d]||[],a.getProperties())};this.notifyDeleted=function(a){a=a.getPid();c(e[a]||[],q[a]||[],null)};this.removedService=function(a,d){var f=a.getProperty(i),h=e[f],b=q[f];h.length>1?h.splice(h.indexOf(a),1):delete e[f];b.length>1?b.splice(b.indexOf(d),1):delete q[f]}};e=function(){function a(d,f,i){this.store=new c(this,i);this.configAdmin=new b(this,this.store);this.tracker=new j(d,f,this.store)}a.prototype={getConfigurationAdmin:function(){var a=
this;return this.configAdmin._init().then(function(d){a.tracker.open();return d})},notifyDeleted:function(a){this.tracker.notifyDeleted(a)},notifyUpdated:function(a){this.tracker.notifyUpdated(a)}};return a}();b=function(){function a(d,f){this.factory=d;this.store=f}a.prototype={_init:function(){var a=this;return this.store._init().then(function(){return a})},getConfiguration:function(a){return this.store.get(a)},listConfigurations:function(){return this.store.list()}};return a}();var f="/cm/configurations";
c=function(){function d(d,b){this.factory=d;this.prefsService=b;this.configs=Object.create(null);this.pref=null;var c=this;this.initPromise=this.prefsService.getPreferences(f).then(function(d){c.pref=d;d.keys().forEach(function(f){if(!c.configs[f]){var h=d.get(f);typeof h==="object"&&h!==null&&Object.keys(h).length>0&&(h[i]=f,c.configs[f]=new a(c.factory,c,h))}})})}d.prototype={_init:function(){return this.initPromise},_find:function(a){return this.configs[a]||null},get:function(d){var f=this._find(d);
f||(f=new a(this.factory,this,d),this.configs[d]=f);return f},list:function(){var a=this,d=[];this.pref.keys().forEach(function(f){(f=a._find(f))&&f.getProperties()!==null&&d.push(f)});return d},remove:function(a){this.pref.remove(a);delete this.configs[a]},save:function(a,d){this.pref.put(a,d.getProperties(!0)||{})}};return d}();a=function(){function a(d){for(var f={},h=Object.keys(d),b=0;b<h.length;b++){var c=h[b],i=d[c];f[c]=i instanceof Array?i.slice():i}return f}function f(h,b,c){this.factory=
h;this.store=b;if(c!==null&&typeof c==="object")this.pid=c[i],h=a(c),delete h[i],this.properties=h;else if(typeof c==="string")this.pid=c,this.properties=null;else throw Error("Invalid pid/properties "+c);}f.prototype={_checkRemoved:function(){if(this._removed)throw Error("Configuration was removed");},getPid:function(){this._checkRemoved();return this.pid},getProperties:function(f){this._checkRemoved();var h=null;if(this.properties&&(h=a(this.properties),!f))h[i]=this.pid;return h},remove:function(){this._checkRemoved();
this.factory.notifyDeleted(this);this.store.remove(this.pid);this._removed=!0},update:function(f){this._checkRemoved();f=a(f);delete f[i];this.properties=f;this.store.save(this.pid,this);this.factory.notifyUpdated(this)},toString:function(){return"[ConfigImpl pid: "+this.pid+", properties: "+JSON.stringify(this.properties)+"]"}};return f}();return{ConfigurationAdminFactory:e}});
define("orion/bootstrap","require,orion/Deferred,orion/serviceregistry,orion/preferences,orion/pluginregistry,orion/config".split(","),function(g,k,j,e,c,b){var a;return{startup:function(){if(a)return a;a=new k;var i=new j.ServiceRegistry,f=new e.PreferencesService(i);return f.getPreferences("/plugins").then(function(d){var h={plugins:{}};d.keys().forEach(function(a){var f=g.toUrl(a);h.plugins[f]=d[a]});var e=new c.PluginRegistry(i,h);return e.start().then(function(){if(i.getServiceReferences("orion.core.preference.provider").length>
0)return f.getPreferences("/plugins",f.USER_SCOPE).then(function(a){var d=[];a.keys().forEach(function(a){a=g.toUrl(a);e.getPlugin(a)||d.push(e.installPlugin(a,{autostart:"lazy"}).then(function(a){return a.update().then(function(){return a.start({lazy:!0})})}))});return k.all(d,function(a){console.log(a)})})}).then(function(){return(new b.ConfigurationAdminFactory(i,e,f)).getConfigurationAdmin().then(i.registerService.bind(i,"orion.cm.configadmin"))}).then(function(){var a=i.getService("orion.core.auth");
if(a){var d=a.getUser().then(function(d){if(d)localStorage.setItem("lastLogin",(new Date).getTime());else return a.getAuthForm(window.location.href).then(function(a){setTimeout(function(){window.location=a},0)})}),f=localStorage.getItem("lastLogin");if(!f||f<(new Date).getTime()-9E5)return d}}).then(function(){var d={serviceRegistry:i,preferences:f,pluginRegistry:e};a.resolve(d);return d})})}}});
define("orion/webui/littlelib",[],function(){function g(a,f){f||(f=document);return f.querySelectorAll(a)}function k(a,f){var d=a.compareDocumentPosition(f);return a===f||Boolean(d&16)}function j(a){if(a.tabIndex>=0)return a;if(a.hasChildNodes())for(var f=0;f<a.childNodes.length;f++){var d=j(a.childNodes[f]);if(d)return d}return null}function e(a){if(a.tabIndex>=0)return a;if(a.hasChildNodes())for(var f=a.childNodes.length-1;f>=0;f--){var d=e(a.childNodes[f]);if(d)return d}return null}function c(a,
f){if(a.nodeType===3){var d=b.exec(a.nodeValue);d&&d.length>1&&f(a,d)}if(a.hasChildNodes())for(d=0;d<a.childNodes.length;d++)c(a.childNodes[d],f)}var b=/\$\{([^\}]+)\}/,a=[];return{$:function(a,f){f||(f=document);return f.querySelector(a)},$$:g,$$array:function(a,f){return Array.prototype.slice.call(g(a,f))},node:function(a){var f=a;typeof a==="string"&&(f=document.getElementById(a));return f},contains:k,bounds:function(a){a=a.getBoundingClientRect();return{left:a.left+document.body.scrollLeft,top:a.top+
document.body.scrollTop,width:a.width,height:a.height}},empty:function(a){for(;a.hasChildNodes();)a.removeChild(a.firstChild)},firstTabbable:j,lastTabbable:e,stop:function(a){window.document.all?a.keyCode=0:(a.preventDefault(),a.stopPropagation())},processTextNodes:function(a,f){c(a,function(a,h){a.parentNode.replaceChild(document.createTextNode(f[h[1]]||h[1]),a)})},processDOMNodes:function(a,f){c(a,function(a,h){var b=f[h[1]];if(b){var c=document.createRange(),i=h.index;c.setStart(a,i);c.setEnd(a,
i+h[0].length);c.deleteContents();c.insertNode(b)}})},addAutoDismiss:function(b,f){a.length===0&&document.addEventListener("click",function(d){for(var f=[],b=0;b<a.length;b++){var c=a[b].dismiss,i=!1,e;if(a[b].excludeNodes.every(function(a){return a&&(i=document.compareDocumentPosition(document,a)!==1)&&k(a,d.target)?(e=a,!1):!0})){try{c()}catch(s){typeof console!=="undefined"&&console&&console.error(s&&s.message)}i=document.compareDocumentPosition(document,e)!==1}i&&f.push(a[b])}a=f},!0);a.push({excludeNodes:b,
dismiss:f})},KEY:{BKSPC:8,TAB:9,ENTER:13,ESCAPE:27,SPACE:32,PAGEUP:33,PAGEDOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,INSERT:45,DEL:46}}});
define("orion/nls/root/messages",{Navigator:"Navigator",Sites:"Sites",Shell:"Shell","Get Plugins":"Get Plugins",Global:"Global",Editor:"Editor","Filter bindings":"Filter bindings","Orion Editor":"Orion Editor","View on Site":"View on Site","View this file or folder on a web site hosted by Orion":"View this file or folder on a web site hosted by Orion","Show a list of all the keybindings on this page":"Show a list of all the keybindings on this page","Show Keys":"Show Keys","Hide or show the page banner and footer":"Hide or show the page banner and footer",
"Toggle banner and footer":"Toggle banner and footer","Choose a file by name and open an editor on it":"Choose a file by name and open an editor on it","Find File Named...":"Find File Named...","System Configuration Details":"System Configuration Details","System Config Tooltip":"Go to the System Configuration Details page","Background Operations":"Background Operations","Background Operations Tooltip":"Go to the Background Operations page","Operation status is unknown":"Operation status is unknown",
" is already a favorite.":" is already a favorite.","Add to the favorites list":"Add to the favorites list","Make Favorite":"Make Favorite","Unknown item":"Unknown item","Can't search: no search service is available":"Can't search: no search service is available","could not find banner parent, id was ":"could not find banner parent, id was "," has been added to the favorites list.":" has been added to the favorites list.",Related:"Related",Options:"Options",FAQ:"FAQ","Report a Bug":"Bugs","Privacy Policy":"Privacy",
"Terms of Use":"Terms","Copyright Agent":"Copyright","Orion Logo":"Orion Logo","Type a keyword or wild card to search in root":"Type a keyword or wild card to search in root","Orion is in Beta. Please try it out but BEWARE your data may be lost.":"I20130625-1555","Add this page to the favorites list":"Add this page to the favorites list","LOG: ":"LOG: ",View:"View","no parent":"no parent","no tree model":"no tree model","no renderer":"no renderer","could not find table row ":"could not find table row ",
"Resource is out of sync with the server. Do you want to save it anyway?":"Resource is out of sync with the server. Do you want to save it anyway?","Orion Home":"Orion Home","Operations - Press spacebar to show current operations":"Operations - Press spacebar to show current operations",Operations:"Operations","Operations running":"Operations running","Some operations finished with warning":"Some operations finished with warning","Some operations finished with error":"Some operations finished with error",
"no service registry":"no service registry","Are you sure you want to delete '${0}' from the favorites?":"Are you sure you want to delete '${0}' from the favorites?","Are you sure you want to delete these ${0} favorites?":"Are you sure you want to delete these ${0} favorites?","You can create favorites by selecting any file or folder in the navigator and choosing ${0} from the More menu.":"You can create favorites by selecting any file or folder in the navigator and choosing ${0} from the More menu.",
Tasks:"Tasks",Close:"Close","Expand all":"Expand all","Collapse all":"Collapse all",Search:"Search","Advanced search":"Advanced search",Submit:"Submit",More:"More","Saved searches":"Saved searches","Recent searches":"Recent searches","Open in new tab":"Open in new tab","Regular expression":"Regular expression","Search options":"Search options","Global search":"Global search","Orion Home":"Orion Home","Close notification":"Close notification","Operations - Press spacebar to show current operations":"Operations - Press spacebar to show current operations",
"Type a keyword or wild card to search in root":"Type a keyword or wild card to search in root","Toggle side panel":"Toggle side panel","Open or close the side panel":"Open or close the side panel",Projects:"Projects","Toggle Sidebar":"Toggle Sidebar","Sample HTML5 Site":"Sample HTML5 Site","Generate an HTML5 'Hello World' website, including JavaScript, HTML, and CSS files.":"Generate an HTML5 'Hello World' website, including JavaScript, HTML, and CSS files.","Sample Orion Plugin":"Sample Orion Plugin",
"Generate a sample plugin for integrating with Orion.":"Generate a sample plugin for integrating with Orion."});define("orion/nls/messages",["orion/i18n!orion/nls/messages","orion/nls/root/messages"],function(g,k){var j={root:k};Object.keys(g).forEach(function(e){typeof j[e]==="undefined"&&(j[e]=g[e])});return j});
define("text",["module"],function(g){var k,j,e=["Msxml2.XMLHTTP","Microsoft.XMLHTTP","Msxml2.XMLHTTP.4.0"],c=/^\s*<\?xml(\s)+version=[\'\"](\d)*.(\d)*[\'\"](\s)*\?>/im,b=/<body[^>]*>\s*([\s\S]+)\s*<\/body>/im,a=typeof location!=="undefined"&&location.href,i=a&&location.protocol&&location.protocol.replace(/\:/,""),f=a&&location.hostname,d=a&&(location.port||void 0),h=[],l=g.config&&g.config()||{};k={version:"2.0.5",strip:function(a){if(a){var a=a.replace(c,""),d=a.match(b);d&&(a=d[1])}else a="";return a},
jsEscape:function(a){return a.replace(/(['\\])/g,"\\$1").replace(/[\f]/g,"\\f").replace(/[\b]/g,"\\b").replace(/[\n]/g,"\\n").replace(/[\t]/g,"\\t").replace(/[\r]/g,"\\r").replace(/[\u2028]/g,"\\u2028").replace(/[\u2029]/g,"\\u2029")},createXhr:l.createXhr||function(){var a,d,f;if(typeof XMLHttpRequest!=="undefined")return new XMLHttpRequest;else if(typeof ActiveXObject!=="undefined")for(d=0;d<3;d+=1){f=e[d];try{a=new ActiveXObject(f)}catch(h){}if(a){e=[f];break}}return a},parseName:function(a){var d,
f,h=!1,b=a.indexOf(".");d=a.indexOf("./")===0||a.indexOf("../")===0;b!==-1&&(!d||b>1)?(d=a.substring(0,b),f=a.substring(b+1,a.length)):d=a;a=f||d;b=a.indexOf("!");b!==-1&&(h=a.substring(b+1)==="strip",a=a.substring(0,b),f?f=a:d=a);return{moduleName:d,ext:f,strip:h}},xdRegExp:/^((\w+)\:)?\/\/([^\/\\]+)/,useXhr:function(a,d,f,h){var b,c;b=k.xdRegExp.exec(a);if(!b)return!0;a=b[2];b=b[3];b=b.split(":");c=b[1];b=b[0];return(!a||a===d)&&(!b||b.toLowerCase()===f.toLowerCase())&&(!c&&!b||c===h)},finishLoad:function(a,
d,f,b){f=d?k.strip(f):f;l.isBuild&&(h[a]=f);b(f)},load:function(h,b,c,e){if(e.isBuild&&!e.inlineText)c();else{l.isBuild=e.isBuild;var g=k.parseName(h),e=g.moduleName+(g.ext?"."+g.ext:""),j=b.toUrl(e),t=l.useXhr||k.useXhr;!a||t(j,i,f,d)?k.get(j,function(a){k.finishLoad(h,g.strip,a,c)},function(a){c.error&&c.error(a)}):b([e],function(a){k.finishLoad(g.moduleName+"."+g.ext,g.strip,a,c)})}},write:function(a,d,f){if(h.hasOwnProperty(d)){var b=k.jsEscape(h[d]);f.asModule(a+"!"+d,"define(function () { return '"+
b+"';});\n")}},writeFile:function(a,d,f,h,b){var d=k.parseName(d),c=d.ext?"."+d.ext:"",i=d.moduleName+c,o=f.toUrl(d.moduleName+c)+".js";k.load(i,f,function(){var d=function(a){return h(o,a)};d.asModule=function(a,d){return h.asModule(a,o,d)};k.write(a,i,d,b)},b)}};if(l.env==="node"||!l.env&&typeof process!=="undefined"&&process.versions&&process.versions.node)j=require.nodeRequire("fs"),k.get=function(a,d){var f=j.readFileSync(a,"utf8");f.indexOf("\ufeff")===0&&(f=f.substring(1));d(f)};else if(l.env===
"xhr"||!l.env&&k.createXhr())k.get=function(a,d,f,h){var b=k.createXhr(),c;b.open("GET",a,!0);if(h)for(c in h)h.hasOwnProperty(c)&&b.setRequestHeader(c.toLowerCase(),h[c]);if(l.onXhr)l.onXhr(b,a);b.onreadystatechange=function(){var h;if(b.readyState===4)h=b.status,h>399&&h<600?(h=Error(a+" HTTP status: "+h),h.xhr=b,f(h)):d(b.responseText)};b.send(null)};else if(l.env==="rhino"||!l.env&&typeof Packages!=="undefined"&&typeof java!=="undefined")k.get=function(a,d){var f,h,b=new java.io.File(a),c=java.lang.System.getProperty("line.separator"),
b=new java.io.BufferedReader(new java.io.InputStreamReader(new java.io.FileInputStream(b),"utf-8")),i="";try{f=new java.lang.StringBuffer;(h=b.readLine())&&h.length()&&h.charAt(0)===65279&&(h=h.substring(1));for(f.append(h);(h=b.readLine())!==null;)f.append(c),f.append(h);i=String(f.toString())}finally{b.close()}d(i)};return k});define("text!orion/banner/slideout.html",[],function(){return'<div id="slideContainer" class="slideParameters slideContainer">\n\t<span id="pageCommandParameters" class="layoutLeft parameters"></span>\n\t<span id="pageCommandDismiss" class="layoutRight parametersDismiss"></span>\n</div>'});
define("orion/commonHTMLFragments",["require","orion/webui/littlelib","text!orion/banner/slideout.html"],function(g,k,j){return{slideoutHTMLFragment:function(e){var c=document.createElement("div");c.innerHTML=j;var b=k.$("#slideContainer",c);b.id=e+b.id;b=k.$("#pageCommandParameters",c);b.id=e+b.id;b=k.$("#pageCommandDismiss",c);b.id=e+b.id;return c.innerHTML}}});
define("orion/util",[],function(){var g=navigator.userAgent,k=parseFloat(g.split("MSIE")[1])||void 0,j=parseFloat(g.split("Firefox/")[1]||g.split("Minefield/")[1])||void 0,e=g.indexOf("Opera")!==-1,c=parseFloat(g.split("Chrome/")[1])||void 0,b=g.indexOf("Safari")!==-1&&!c,a=parseFloat(g.split("WebKit/")[1])||void 0,i=g.indexOf("Android")!==-1,f=g.indexOf("iPad")!==-1,g=g.indexOf("iPhone")!==-1,d=f||g,h=navigator.platform.indexOf("Mac")!==-1,l=navigator.platform.indexOf("Win")!==-1,n=navigator.platform.indexOf("Linux")!==
-1;return{formatMessage:function(a){var d=arguments;return a.replace(/\$\{([^\}]+)\}/g,function(a,f){return d[(f<<0)+1]})},createElement:function(a,d){return a.createElementNS?a.createElementNS("http://www.w3.org/1999/xhtml",d):a.createElement(d)},isIE:k,isFirefox:j,isOpera:e,isChrome:c,isSafari:b,isWebkit:a,isAndroid:i,isIPad:f,isIPhone:g,isIOS:d,isMac:h,isWindows:l,isLinux:n,platformDelimiter:l?"\r\n":"\n"}});
define("orion/keyBinding",["orion/util"],function(g){function k(e,c,b,a,i,f){this.type=f||"keydown";this.keyCode=typeof e==="string"&&this.type==="keydown"?e.toUpperCase().charCodeAt(0):e;this.mod1=c!==void 0&&c!==null?c:!1;this.mod2=b!==void 0&&b!==null?b:!1;this.mod3=a!==void 0&&a!==null?a:!1;this.mod4=i!==void 0&&i!==null?i:!1}function j(e){this.keys=e}k.prototype={getKeys:function(){return[this]},match:function(e,c){if(c!==void 0){if(c!==0)return!1}else if(e instanceof Array){if(e.length>1)return!1;
e=e[0]}return e.type!==this.type?!1:this.keyCode===e.keyCode||this.keyCode===String.fromCharCode(g.isOpera?e.which:e.charCode!==void 0?e.charCode:e.keyCode)?this.mod1!==(g.isMac?e.metaKey:e.ctrlKey)?!1:this.type==="keydown"&&this.mod2!==e.shiftKey?!1:this.mod3!==e.altKey?!1:g.isMac&&this.mod4!==e.ctrlKey?!1:!0:!1},equals:function(e){return!e?!1:this.keyCode!==e.keyCode?!1:this.mod1!==e.mod1?!1:this.mod2!==e.mod2?!1:this.mod3!==e.mod3?!1:this.mod4!==e.mod4?!1:this.type!==e.type?!1:!0}};j.prototype=
{getKeys:function(){return this.keys.slice(0)},match:function(e,c){var b=this.keys;if(c!==void 0)return c>b.length?!1:b[c].match(e)?c===b.length-1?!0:c+1:!1;else{e instanceof Array||(e=[e]);if(e.length>b.length)return!1;var a;for(a=0;a<e.length;a++)if(!b[a].match(e[a]))return!1;return a===b.length?!0:a}},equals:function(e){if(!e.keys)return!1;if(e.keys.length!==this.keys.length)return!1;for(var c=0;c<e.keys.length;c++)if(!e.keys[c].equals(this.keys[c]))return!1;return!0}};return{KeyBinding:k,KeyStroke:k,
KeySequence:j}});
define("orion/webui/dropdown",["require","orion/webui/littlelib"],function(g,k){function j(e){this._init(e)}j.prototype={_init:function(e){this._dropdownNode=k.node(e.dropdown);if(!this._dropdownNode)throw"no dom node for dropdown found";this._triggerNode=k.$(".dropdownTrigger",this._dropdownNode.parentNode);if(!this._triggerNode)throw"no dom node for dropdown trigger found";this._populate=e.populate;var c=this;this._triggerNode.addEventListener("click",function(b){c.toggle()&&k.stop(b)},!1);this._triggerNode.tagName.toLowerCase()===
"span"&&this._triggerNode.addEventListener("keydown",function(b){if(b.keyCode===k.KEY.ENTER||b.keyCode===k.KEY.SPACE)c.toggle(),k.stop(b)},!1);this._dropdownNode.addEventListener("keydown",this._dropdownKeyDown.bind(this),!1)},toggle:function(){return this._triggerNode.classList.contains("dropdownTriggerOpen")?this.close():this.open()},open:function(){this._populate&&(this.empty(),this._populate(this._dropdownNode));var e=this.getItems();if(e.length>0){if(!this._hookedAutoDismiss){var c=k.$$(".dropdownSubMenu",
this._dropdownNode);k.addAutoDismiss([this._triggerNode].concat(Array.prototype.slice.call(c)),this.close.bind(this));this._hookedAutoDismiss=!0}this._triggerNode.classList.add("dropdownTriggerOpen");this._dropdownNode.classList.add("dropdownMenuOpen");this._positionDropdown();e[0].focus();return!0}return!1},_positionDropdown:function(){this._dropdownNode.style.left="";var e=k.bounds(this._dropdownNode),c=k.bounds(this._boundingNode(this._triggerNode));if(e.left+e.width>c.left+c.width)this._dropdownNode.style.right=
0},_boundingNode:function(e){return e.style.right!==""||e.style.position==="absolute"||!e.parentNode||!e.parentNode.style?e:this._boundingNode(e.parentNode)},close:function(e){this._triggerNode.classList.remove("dropdownTriggerOpen");this._dropdownNode.classList.remove("dropdownMenuOpen");e&&this._triggerNode.focus();return!0},getItems:function(){var e=[],c=this;k.$$array("li:not(.dropdownSeparator) > .dropdownMenuItem",this._dropdownNode,!0).forEach(function(b){b.parentNode.parentNode===c._dropdownNode&&
e.push(b)});return e},empty:function(){var e=this;k.$$array("li",this._dropdownNode).forEach(function(c){c.parentNode===e._dropdownNode&&c.parentNode.removeChild(c)})},_dropdownKeyDown:function(e){if(e.keyCode===k.KEY.UP||e.keyCode===k.KEY.DOWN||e.keyCode===k.KEY.RIGHT||e.keyCode===k.KEY.ENTER||e.keyCode===k.KEY.LEFT){var c=this.getItems(),b=document.activeElement;if(c.length&&c.length>0&&b){var a=c.indexOf(b);a<0&&(a=c.indexOf(b.parentNode));a>=0&&(e.keyCode===k.KEY.UP&&a>0?(a--,c[a].focus()):e.keyCode===
k.KEY.DOWN&&a<c.length-1?(a++,c[a].focus()):e.keyCode===k.KEY.ENTER||e.keyCode===k.KEY.RIGHT?b.classList.contains("dropdownTrigger")&&b.dropdown&&b.dropdown.open():e.keyCode===k.KEY.LEFT&&b.parentNode.parentNode.classList.contains("dropdownMenuOpen")&&this.close(!0),k.stop(e))}}else e.keyCode===k.KEY.ESCAPE&&(this.close(!0),k.stop(e))}};j.prototype.constructor=j;return{Dropdown:j}});define("text!orion/webui/dropdowntriggerbutton.html",[],function(){return'<button class="dropdownTrigger">${ButtonText}<span class="dropdownArrowDown"></span></button><ul class="dropdownMenu"></ul>'});
define("text!orion/webui/submenutriggerbutton.html",[],function(){return'<li class="dropdownSubMenu"><span class="dropdownTrigger dropdownMenuItem" role="menuitem" tabindex="0">${ButtonText}<span class="dropdownArrowRight"></span></span><ul class="dropdownMenu"></ul></li>'});define("text!orion/webui/checkedmenuitem.html",[],function(){return'<li><label class="dropdownMenuItem"><input class="checkedMenuItem" role="menuitem" type="checkbox" />${ItemText}</label></li>'});
define("orion/webui/tooltip",["require","orion/webui/littlelib"],function(g,k){function j(e){this._init(e)}j.prototype={_init:function(e){this._node=k.node(e.node);if(!this._node)throw"no dom node for tooltip found";this._position=e.position||["right","above","below","left"];this._text=e.text;this._hideDelay=e.hideDelay===void 0?200:e.hideDelay;this._tailSize=e.tailSize||10;this._trigger=e.trigger||"mouseover";this._afterShowing=e.afterShowing;this._afterHiding=e.afterHiding;var c=this;if(this._trigger===
"click")this._showDelay=0,this._node.addEventListener("click",function(a){a.target===c._node&&(c.show(),k.stop(a))},!1);else if(this._trigger==="mouseover"){this._showDelay=e.showDelay===void 0?500:e.showDelay;e=["mouseout","click"];this._node.addEventListener("mouseover",function(a){k.contains(c._node,a.target)&&(c.show(),k.stop(a))},!1);for(var b=0;b<e.length;b++)this._node.addEventListener(e[b],function(a){k.contains(c._node,a.target)&&c.hide()},!1)}},_makeTipNode:function(){if(!this._tip){this._tip=
document.createElement("span");this._tip.classList.add("tooltipContainer");this._tipInner=document.createElement("span");this._tipInner.classList.add("tooltip");this._text&&this._tipInner.appendChild(document.createTextNode(this._text));this._tip.appendChild(this._tipInner);document.body.appendChild(this._tip);var e=this;k.addAutoDismiss([this._tip,this._node],function(){e.hide()});if(this._trigger==="mouseover")this._tipInner.role="tooltip",this._tipInner.id="tooltip"+(new Date).getTime().toString(),
this._node.setAttribute("aria-describedby",this._tipInner.id),this._tip.addEventListener("mouseover",function(){if(e._timeout)window.clearTimeout(e._timeout),e._timeout=null;e._tip.addEventListener("mouseout",function(c){k.contains(e._tip,c.target)&&(e.hide(),k.stop(c))},!1)},!1)}return this._tip},_positionTip:function(e,c){this._makeTipNode();e==="left"?this._tipInner.classList.add("left"):this._tipInner.classList.remove("left");var b=this._node,a;for(a=k.bounds(b);b&&!a.width&&!a.height;b=b.parentNode)a=
k.bounds(b);var b=k.bounds(this._tipInner),i;switch(e){case "above":i=a.top-b.height-this._tailSize-1;a=a.left-this._tailSize;break;case "below":i=a.top+a.height+this._tailSize+1;a=a.left-this._tailSize;break;case "left":i=a.top-this._tailSize/2;a=a.left-b.width-this._tailSize-1;break;default:i=a.top-this._tailSize/2,a=a.left+a.width+this._tailSize+1}var f=k.bounds(document.documentElement);if(i+b.height>f.height)if(c)i=f.height-b.height-1;else return!1;if(a+b.width>f.width)if(c)a=f.width-b.width-
1;else return!1;if(a<0)if(c)a=4;else return!1;if(i<0)if(c)i=4;else return!1;if(!this._tail&&(this._tail=document.createElement("span"),this._tail.classList.add("tooltipTailFrom"+e),e==="above"||e==="left"?this._tip.appendChild(this._tail):this._tip.insertBefore(this._tail,this._tipInner),e==="left"))this._tail.style.left=b.width+"px";this._tip.style.top=i+"px";this._tip.style.left=a+"px";this._tip.style.width=b.width+"px";this._tip.style.height=b.height+"px";return!0},contentContainer:function(){this._makeTipNode();
return this._tipInner},show:function(){if(!this._tip||!this._tip.classList.contains("tooltipShowing")){var e=this;if(this._timeout)window.clearTimeout(this._timeout),this._timeout=null;this._timeout=window.setTimeout(function(){for(var c=!1,b=0;!c&&b<e._position.length;)c=e._positionTip(e._position[b]),b++;c||e._positionTip(e._position[0],!0);e._tip.classList.add("tooltipShowing");e._afterShowing&&e._afterShowing()},this._showDelay)}},hide:function(e){if(this._timeout)window.clearTimeout(this._timeout),
this._timeout=null;if(this._tip&&this._tip.classList.contains("tooltipShowing")){if(e===void 0)e=this._hideDelay;var c=this;this._timeout=window.setTimeout(function(){c._tip.classList.remove("tooltipShowing");c._tip.removeAttribute("style");c._afterHiding&&c._afterHiding()},e)}},destroy:function(){if(this._timeout)window.clearTimeout(this._timeout),this._timeout=null;if(this._tip)document.body.removeChild(this._tip),this._tail=this._tipInner=this._tip=null}};j.prototype.constructor=j;return{Tooltip:j}});
define("orion/commands","require,orion/util,orion/webui/littlelib,orion/webui/dropdown,text!orion/webui/dropdowntriggerbutton.html,text!orion/webui/submenutriggerbutton.html,text!orion/webui/checkedmenuitem.html,orion/webui/tooltip".split(","),function(g,k,j,e,c,b,a,i){function f(a,d){for(var f in d)if(d[f]&&d[f].keyBinding&&d[f].command&&d[f].keyBinding.match(a)){var h=d[f],b=h.keyBinding;if(!b.domScope||j.contains(j.node(b.domScope),a.target)){var o=h.invocation;if(o){var c=h.command;if(c.hrefCallback){j.stop(a);
f=c.hrefCallback.call(o.handler||window,o);f.then?f.then(function(a){window.open(a)}):window.open(f);break}else if(c.onClick||c.callback){j.stop(a);window.setTimeout(function(){(c.onClick||c.callback).call(o.handler||window,o)},0);break}}}}}function d(a,d,f){d.classList.add("commandImage");var h;a.imageClass?a.addImageClassToElement?d.classList.add(a.imageClass):(h=document.createElement("span"),d.appendChild(h),h.classList.add(a.spriteClass),h.classList.add(a.imageClass)):(h=new Image,h.alt=a.name,
h.name=f,h.id=f,h.src=a.image,d.appendChild(h));return h}function h(a,d,f,h,b){this.commandRegistry=b;this.handler=a;this.items=d;this.userData=f;this.command=h;if(h.parameters)this.parameters=h.parameters.makeCopy();this.id=h.id}function l(a){this._init(a)}var n=null,m={};window.document.addEventListener("keydown",function(a){a=a||window.event;if(function(a){if(k.isMac){if(a.metaKey&&!a.altKey)return!a.shiftKey&&!a.ctrlKey&&(a.keyCode===65||a.keyCode===67||a.keyCode===86||a.keyCode===88||a.keyCode===
90)?!0:!1}else{if(a.ctrlKey&&!a.altKey)return!a.shiftKey&&(a.keyCode===65||a.keyCode===67||a.keyCode===86||a.keyCode===88||a.keyCode===90)?!0:!1;if(a.altKey&&!a.ctrlKey)return!1}if(a["char"])return a["char"].length>0;else if(a.charCode||a.keyCode)switch(a=a.charCode||a.keyCode,a){case 8:case 9:case 13:case 46:return!0;default:return a>=32&&a<112||a>123}return!1}(a)){if(a.target.contentEditable==="true")return;var d=a.target.nodeName.toLowerCase();if(d==="input")switch(a.target.type.toLowerCase()){case "text":case "password":case "search":case "color":case "date":case "datetime":case "datetime-local":case "email":case "month":case "number":case "range":case "tel":case "time":case "url":case "week":return}else if(d===
"textarea")return}d={};if(n){var h,b,c;b=Object.keys(m);for(h=0;h<b.length;h++)c=b[h],d[c]=m[c];var o=n();b=Object.keys(o);for(h=0;h<b.length;h++)c=b[h],d[c]=o[c]}else d=m;f(a,d)},!1);h.prototype={collectsParameters:function(){return this.commandRegistry&&this.commandRegistry.collectsParameters()},makeCopy:function(a){var d=new h(this.handler,this.items,this.userData,this.command,this.commandRegistry);d.domNode=this.domNode;d.domParent=this.domParent;if(a)d.parameters=a.makeCopy();else if(this.parameters)d.parameters=
this.parameters.makeCopy();return d}};h.prototype.constructor=h;l.prototype={_init:function(a){this.id=a.id;this.name=a.name;this.tooltip=a.tooltip||a.name;this.callback=a.callback;this.hrefCallback=a.hrefCallback;this.choiceCallback=a.choiceCallback;this.image=a.image||g.toUrl("images/none.png");this.imageClass=a.imageClass;this.addImageClassToElement=a.addImageClassToElement;this.spriteClass=a.spriteClass||"commandSprite";this.visibleWhen=a.visibleWhen;this.parameters=a.parameters},populateChoicesMenu:function(a,
d,f,h,b){this.getChoices(d,f,h).forEach(function(f){if(f.name){var h=document.createElement("li");a.appendChild(h);var c=document.createElement("span");c.tabIndex=0;c.role="menuitem";c.classList.add("dropdownMenuItem");var i=document.createTextNode(f.name);c.appendChild(i);h.appendChild(c);c.choice=f;c.addEventListener("click",function(a){a.target.choice&&a.target.choice.callback.call(a.target.choice,d)},!1);c.addEventListener("keydown",function(a){(a.keyCode===j.KEY.ENTER||a.keyCode===j.KEY.SPACE)&&
a.target.choice&&a.target.choice.callback.call(a.target.choice,d)},!1)}else b._generateMenuSeparator(a)})},getChoices:function(a,d,f){return this.choiceCallback?this.choiceCallback.call(d,a,f):null},makeChoiceCallback:function(a,d){return function(f){a.callback&&a.callback.call(a,d,f)}},hasImage:function(){return this.imageClass||this.image!==g.toUrl("images/none.png")}};l.prototype.constructor=l;return{Command:l,CommandInvocation:h,createDropdownMenu:function(a,f,h,b,i,o){a=j.node(a);if(!a)throw"no parent node was specified";
var l=document.createRange();l.selectNode(a);l=l.createContextualFragment(c);j.processTextNodes(l,{ButtonText:f});a.appendChild(l);a=a.lastChild;l=a.previousSibling;b?l.classList.add(b):(l.classList.add("orionButton"),l.classList.add("commandButton"));if(i){if(!o)l.textContent="",l.setAttribute("aria-label",f);d({spriteClass:"commandSprite",imageClass:i},l,f);l.classList.add("orionButton")}l.dropdown=new e.Dropdown({dropdown:a,populate:h});a.dropdown=l.dropdown;return{menuButton:l,menu:a,dropdown:l.dropdown}},
createCheckedMenuItem:function(d,f,h,b){d=j.node(d);if(!d)throw"no parent node was specified";var c=document.createRange();c.selectNode(d);c=c.createContextualFragment(a);j.processTextNodes(c,{ItemText:f});d.appendChild(c);d=j.$(".checkedMenuItem",d.lastChild);d.checked=h;d.addEventListener("change",b,!1)},createCommandItem:function(a,f,h,b,c,o,e){var l,o=o||!f.name&&f.hasImage();if(f.hrefCallback)l=document.createElement("a"),l.id=b,o&&f.hasImage()?d(f,l,b):(l.className="commandLink",l.appendChild(document.createTextNode(f.name))),
e=f.hrefCallback.call(h.handler,h),e.then?e.then(function(a){l.href=a}):l.href=e?e:"#";else{l=document.createElement("button");l.className="orionButton";o?f.hasImage()?(d(f,l,b),f.name&&l.setAttribute("aria-label",f.name)):(l.classList.add("commandButton"),l.classList.add("commandMissingImageButton"),l.appendChild(document.createTextNode(f.name))):(l.classList.add("commandButton"),b=document.createTextNode(f.name),l.appendChild(b));var u=e||f.callback;if(u)f.onClick=u,l.addEventListener("click",function(){u.call(h.handler,
h)},!1)}a.nodeName.toLowerCase()==="ul"?(e=document.createElement("li"),a.appendChild(e),a=e):l.classList.add("commandMargins");a.appendChild(l);if(f.tooltip)l.commandTooltip=new i.Tooltip({node:l,text:f.tooltip,position:["above","below","right","left"]});c&&(m[f.id]={keyBinding:c,command:f,invocation:h});return l},createCommandMenuItem:function(a,d,f,h,b){var o,c=a.dropdown;if(d.hrefCallback)o=document.createElement("a"),o.appendChild(document.createTextNode(d.name)),b=d.hrefCallback.call(f.handler,
f),b.then?b.then(function(a){o.href=a}):o.href=b?b:"#";else{o=document.createElement("span");o.tabIndex=0;o.appendChild(document.createTextNode(d.name));var e=b||d.callback;if(e)d.onClick=e,o.addEventListener("click",function(){c.close(!0);e.call(f.handler,f)},!1)}if(d.tooltip)o.commandTooltip=new i.Tooltip({node:o,text:d.tooltip,position:["right","left","above","below"]});o.className="dropdownMenuItem";o.role="menuitem";b=document.createElement("li");a.appendChild(b);b.appendChild(o);h&&(m[d.id]=
{keyBinding:h,command:d,invocation:f});return o},setKeyBindingProvider:function(a){n=a},localKeyBindings:m,_testMethodProcessKey:f}});
define("orion/uiUtils",["i18n!orion/nls/messages","orion/webui/littlelib"],function(g,k){function j(c){var b="",a=navigator.platform.indexOf("Mac")!==-1;c.mod1&&(b+=a?"Cmd+":"Ctrl+");c.mod2&&(b+="Shift+");c.mod3&&(b+="Alt+");c.mod4&&a&&(b+="Ctrl+");if(c.alphaKey)return b+c.alphaKey;if(c.type==="keypress")return b+c.keyCode;for(var i in k.KEY)if(typeof(k.KEY[i]==="number")&&k.KEY[i]===c.keyCode)return b+i;var f;switch(c.keyCode){case 59:f=c.mod2?":":";";break;case 61:f=c.mod2?"+":"=";break;case 188:f=
c.mod2?"<":",";break;case 190:f=c.mod2?">":".";break;case 191:f=c.mod2?"?":"/";break;case 192:f=c.mod2?"~":"`";break;case 219:f=c.mod2?"{":"[";break;case 220:f=c.mod2?"|":"\\";break;case 221:f=c.mod2?"}":"]";break;case 222:f=c.mod2?'"':"'"}return f?b+f:c.keyCode>=112&&c.keyCode<=123?b+"F"+(c.keyCode-111):b+String.fromCharCode(c.keyCode)}function e(c){var b=window.navigator.platform.indexOf("Mac")!==-1;return b&&c.metaKey||!b&&c.ctrlKey}return{getUserKeyString:function(c){for(var b="",c=c.getKeys(),
a=0;a<c.length;a++)a!==0&&(b+=" "),b+=j(c[a]);return b},getUserText:function(c,b,a,i,f,d,h,e,n){var m=!1,h=function(h){return function(e){if(!m){var l=k.node(c),g=l.value;if(l)if(h&&e.keyCode===k.KEY.ESCAPE){if(a)b.style.display="inline";m=!0;l.parentNode.removeChild(l);d&&d()}else if(!(h&&e.keyCode!==k.KEY.ENTER)){if(g.length===0||!n&&g===i){if(a)b.style.display="inline"}else f(g);m=!0;l.parentNode&&l.parentNode.removeChild(l);d&&d()}}}},g=document.createElement("input");g.id=c;g.value=i||"";b.parentNode.insertBefore(g,
b.nextSibling);g.classList.add("userEditBoxPrompt");if(a)b.style.display="none";g.addEventListener("keydown",h(!0),!1);g.addEventListener("blur",h(!1),!1);window.setTimeout(function(){g.focus();if(i){var a=k.node(c),d=e?i.indexOf(e):-1;if(d>0)if(a.createTextRange)a=a.createTextRange(),a.collapse(!0),a.moveStart("character",0),a.moveEnd("character",d),a.select();else if(a.setSelectionRange)a.setSelectionRange(0,d);else{if(a.selectionStart!==void 0)a.selectionStart=0,a.selectionEnd=d}else a.select()}},
0)},openInNewWindow:e,followLink:function(c,b){b&&e(b)?window.open(c):window.location=c},createButton:function(c,b){var a=document.createElement("button");a.className="orionButton commandButton commandMargins";a.addEventListener("click",function(a){b();k.stop(a)},!1);c&&a.appendChild(document.createTextNode(c));return a},createDropdownButton:function(){}}});
define("orion/PageUtil",[],function(){var g=/^(?:[a-zA-Z0-9-_.!~*'()#;,\/?:@&=+$\[\]]|%[0-9A-F][0-9A-F])*$/,k=/^http[s]?/i;return{matchResourceParameters:function(j){var j=j||window.location.toString(),e={resource:""},c=j.indexOf("#");if(c!==-1&&(j=j.substring(c+1),j.length!==0)){j=j.split(",");Object.defineProperty(e,"resourceRaw",{value:j[0]});e.resource=decodeURIComponent(j[0]);if(!e.resource.match(g))e.resource=encodeURI(e.resource).replace(/%5B/g,"[").replace(/%5D/g,"]");for(c=1;c<j.length;c++){var b=
/([^=]*)(=?)(.*)/.exec(j[c]),a=decodeURIComponent(b[1]||""),b=decodeURIComponent(b[3]||"");a!==""&&a!=="resource"&&(e[a]=b)}}return e},validateURLScheme:function(g,e){var c=g;if(g.indexOf("://")===-1){var b=document.createElement("a");b.href=g;c=b.href}b=!1;return(b=e?e.some(function(a){return RegExp("^"+a+":","i").test(c)}):k.test(c))?g:(console.log("Illegal URL Scheme: '"+g+"'"),"")}}});
define("orion/explorers/navigationUtils",[],function(){function g(g,e){if(!k&&g)g.push({domNode:e}),e.tabIndex=-1,e.style.outline="none"}var k=navigator.userAgent.indexOf("iPad")!==-1;return{addNavGrid:function(j,e,c){j&&(j=j.getGridNavHolder(e,!0))&&g(j,c)},generateNavGrid:g,removeNavGrid:function(g,e){if(g)for(var c=0;c<g.length;c++)if(g[c].domNode===e){g.splice(c,1);break}}}});
define("orion/commandRegistry","require,orion/commands,orion/uiUtils,orion/PageUtil,orion/webui/littlelib,orion/webui/dropdown,text!orion/webui/dropdowntriggerbutton.html,text!orion/webui/submenutriggerbutton.html,text!orion/webui/checkedmenuitem.html,orion/webui/tooltip,orion/explorers/navigationUtils".split(","),function(g,k,j,e,c,b,a,i,f,d,h){function l(a){this._commandList={};this._contributionsByScopeId={};this._activeBindings={};this._urlBindings={};this._pendingBindings={};this._init(a);this._parameterCollector=
null}function n(a,d){this.token=a;this.parameterName=d}function m(a,d,f,h,b){this.name=a;this.type=d;this.label=f;this.value=h;this.lines=b||1}function q(a,d,f){this._storeParameters(a);this._hasOptionalParameters=d&&d.hasOptionalParameters;this._options=d;this.optionsRequested=!1;this.getParameters=f;this.clientCollect=d&&d.clientCollect}l.prototype={_init:function(a){this._selectionService=a.selection;var d=this;k.setKeyBindingProvider(function(){return d._activeBindings})},processURL:function(a){for(var d in this._urlBindings)if(this._urlBindings[d]&&
this._urlBindings[d].urlBinding&&this._urlBindings[d].command){var f=this._urlBindings[d].urlBinding.match(a);if(f){var h=this._urlBindings[d],b=h.command,c=h.invocation;if(c&&c.parameters&&b.callback){c.parameters.setValue(f.parameterName,f.parameterValue);var i=this;window.setTimeout(function(){i._invoke(c)},0);break}}}},findCommand:function(a){return this._commandList[a]},runCommand:function(a,d,f,h){d?(a=this._commandList[a])&&(a.visibleWhen?a.visibleWhen(d):1)&&a.callback&&this._invoke(new k.CommandInvocation(f,
d,null,a,this),h):(d=this._urlBindings[a])&&d.command&&d.command.callback&&this._invoke(d.invocation,h)},getSelectionService:function(){return this._selectionService},setParameterCollector:function(a){this._parameterCollector=a},openParameterCollector:function(a,d,f){this._parameterCollector&&(this._parameterCollector.close(),this._parameterCollector.open(a,d,f))},confirm:function(a,d,f,h,b,c){var i=!1;if(this._parameterCollector&&!b){var e=this;this._parameterCollector.close();if(this._parameterCollector.open(a,
function(a,b){var o=document.createElement("span");o.classList.add("parameterPrompt");o.textContent=d;a.appendChild(o);o=document.createElement("button");o.addEventListener("click",function(){i=!0;e._parameterCollector.close()},!1);b.appendChild(o);o.appendChild(document.createTextNode(f));o.className="dismissButton";var c=document.createElement("button");c.addEventListener("click",function(){i=!1;e._parameterCollector.close()},!1);b.appendChild(c);c.appendChild(document.createTextNode(h));c.className=
"dismissButton";return o},function(){c(i)}))return}i=window.confirm(d);c(i)},closeParameterCollector:function(){this._parameterCollector&&this._parameterCollector.close()},collectsParameters:function(){return this._parameterCollector},_invoke:function(a,d){return this._collectAndInvoke(a.makeCopy(d),!1)},_collectAndInvoke:function(a,f){if(a)if(this._parameterCollector&&a.parameters&&a.parameters.hasParameters()&&(f||a.parameters.shouldCollectParameters())){var h=!1;a.parameters.updateParameters(a);
if(a.parameters.shouldCollectParameters()&&(h=this._parameterCollector.collectParameters(a),!h)){var b=new d.Tooltip({node:a.domNode,trigger:"click",position:["below","right","above","left"]}),h=b.contentContainer();h.classList.add("parameterPopup");var o=window.document.activeElement,c=this._parameterCollector.getFillFunction(a,function(){o&&o.focus();b.destroy()})(h);b.show();window.setTimeout(function(){c.focus();c.select()},0);h=!0}h||a.command.callback.call(a.handler||window,a)}else a.command.callback.call(a.handler||
window,a);else window.console.log("Client attempted to invoke command without an available (rendered) command invocation")},collectParameters:function(a){this._collectAndInvoke(a,!0)},showKeyBindings:function(a){function d(a){var f=a.invocation;if(f)if(a=a.command,a.hrefCallback)f=a.hrefCallback.call(f.handler||window,f),f.then?f.then(function(a){window.open(a)}):window.open(f);else if(a.onClick||a.callback)(a.onClick||a.callback).call(f.handler||window,f)}function f(a){return function(){d(a)}}var h=
{},b,c,i=[],e;for(e in this._activeBindings)(c=this._activeBindings[e])&&c.keyBinding&&c.command&&i.push(c);i.sort(function(a,d){return a.command.name.localeCompare(d.command.name)});for(e=0;e<i.length;e++)c=i[e],c.keyBinding.scopeName?(h[c.keyBinding.scopeName]||(h[c.keyBinding.scopeName]=[]),h[c.keyBinding.scopeName].push(c)):(b=j.getUserKeyString(c.keyBinding),a.createItem(b,c.command.name,f(c)));for(var l in h)h[l].length&&h[l].length>0&&(a.createHeader(l),h[l].forEach(function(d){b=j.getUserKeyString(d.keyBinding);
a.createItem(b,d.command.name,f(d))}))},addCommand:function(a){this._commandList[a.id]=a;var d=this._pendingBindings[a.id];if(d){var f=this;d.forEach(function(d){f._addBinding(a,d.type,d.binding,d.bindingOnly)});delete this._pendingBindings[a.id]}},addCommandGroup:function(a,d,f,h,b,c,i,e){this._contributionsByScopeId[a]||(this._contributionsByScopeId[a]={});a=this._contributionsByScopeId[a];b&&(a=this._createEntryForPath(a,b));if(a[d]){if(h)a[d].title=h;if(f)a[d].position=f;if(i)a[d].imageClass=
i;if(e)a[d].tooltip=e;a[d].emptyGroupMessage=c}else a[d]={title:h,position:f,emptyGroupMessage:c,imageClass:i,tooltip:e,children:{}},a.sortedContributions=null},_createEntryForPath:function(a,d){d&&d.split("/").forEach(function(d){if(d.length>1)a[d]||(a[d]={position:0,children:{}}),a=a[d].children});return a},registerSelectionService:function(a,d){this._contributionsByScopeId[a]||(this._contributionsByScopeId[a]={});this._contributionsByScopeId[a].localSelectionService=d},registerCommandContribution:function(a,
d,f,h,b,c,i){this._contributionsByScopeId[a]||(this._contributionsByScopeId[a]={});a=this._contributionsByScopeId[a];h&&(a=this._createEntryForPath(a,h));a[d]={position:f};c&&((f=this._commandList[d])?this._addBinding(f,"key",c,b):this._addPendingBinding(d,"key",c,b));i&&((f=this._commandList[d])?this._addBinding(f,"url",i,b):this._addPendingBinding(d,"url",i,b));a.sortedContributions=null},_addBinding:function(a,d,f,h){if(!a.id)throw Error("No command id: "+a);d==="key"?this._activeBindings[a.id]=
{command:a,keyBinding:f,bindingOnly:h}:d==="url"&&(this._urlBindings[a.id]={command:a,urlBinding:f,bindingOnly:h})},_addPendingBinding:function(a,d,f,h){this._pendingBindings[a]=this._pendingBindings[a]||[];this._pendingBindings[a].push({type:d,binding:f,bindingOnly:h})},_checkForTrailingSeparator:function(a,d,f){var h;if(d==="tool"||d==="button")if((h=a.childNodes.length>0?a.childNodes[a.childNodes.length-1]:null)&&h.classList.contains("commandSeparator"))return f?(a.removeChild(h),!1):!0;if(d===
"menu"&&(a=c.$$array("li > *",a),a.length>0&&a[a.length-1].classList.contains("dropdownSeparator")))if(h=a[a.length-1],f)h.parentNode.parentNode.removeChild(h.parentNode);else return!0;return!1},renderCommands:function(a,d,f,h,b,i,e){if(typeof a!=="string")throw"a scope id for rendering must be specified";d=c.node(d);if(!d)throw"no parent";var l=this._contributionsByScopeId[a];if(!f&&l){var f=l.localSelectionService||this._selectionService,n=this;f&&f.getSelections(function(f){n.renderCommands(a,
d,f,h,b,i)})}else l&&(this._render(this._contributionsByScopeId[a],d,f,h,b||"button",i,e),this._checkForTrailingSeparator(d,b,!0))},destroy:function(a){a=c.node(a);if(!a)throw"no parent";for(;a.hasChildNodes();){var d=a.firstChild;d.commandTooltip&&d.commandTooltip.destroy();d.emptyGroupTooltip&&d.emptyGroupTooltip.destroy();this.destroy(d);a.removeChild(d)}},_render:function(a,f,b,c,o,i,e){var l=a.sortedContributions;if(!l){var l=[],n=!1,m;for(m in a)if(!a.hasOwnProperty||a.hasOwnProperty(m)){var g=
a[m];if(g&&typeof g.position==="number")g.id=m,l.push(g),n=!0}if(n)l.sort(function(a,d){return a.position-d.position}),a.sortedContributions=l}var j=0,q=this;l.forEach(function(a){var l,u;if(!a.imageClass)a.imageClass=null;if(a.children&&Object.getOwnPropertyNames(a.children).length>0){l=a.children;var n;if(o==="tool"||o==="button")if(a.title)n=q._createDropdownMenu(f,a.title,null,null,a.imageClass,a.tooltip),e&&h.generateNavGrid(e,n.menuButton),window.setTimeout(function(){q._render(a.children,n.menu,
b,c,"menu",i,e);q._checkForTrailingSeparator(n.menu,"menu",!0);if(n.menu.childNodes.length===0)if(a.emptyGroupMessage){if(!n.menuButton.emptyGroupTooltip)n.menuButton.emptyGroupTooltip=new d.Tooltip({node:n.menuButton,text:a.emptyGroupMessage,trigger:"click",position:["below","right","above","left"]})}else e&&h.removeNavGrid(e,n.menuButton),n.menu.parentNode&&n.menu.parentNode.removeChild(n.menu),n.destroyButton&&n.destroyButton.parentNode&&n.destroyButton.parentNode.removeChild(n.destroyButton);
else n.menuButton.style.visibility="visible"},0);else{var m;f.childNodes.length>0&&!q._checkForTrailingSeparator(f,o)&&(m=q.generateSeparatorImage(f));q._render(l,f,b,c,o,i,e);f.childNodes.length>0&&f.childNodes[f.childNodes.length-1]!==m&&(m=q.generateSeparatorImage(f))}else if(a.title){if(m=q._createDropdownMenu(f,a.title,!0,null,null,a.imageClass))q._render(l,m.menu,b,c,"menu",i,e),m.menu.childNodes.length===0&&m.destroyButton&&f.removeChild(m.destroyButton)}else f.childNodes.length>0&&q._generateMenuSeparator(f),
q._render(l,f,b,c,o,i,e),q._generateMenuSeparator(f)}else{var g=q._commandList[a.id];l=g?!0:!1;var w=null,w=null;if(g){u=new k.CommandInvocation(c,b,i,g,q);u.domParent=f;m=l&&(g.visibleWhen?g.visibleWhen(b):!0);if(q._activeBindings[g.id]&&q._activeBindings[g.id].keyBinding)w=q._activeBindings[g.id],w.invocation=m?u:null,w.bindingOnly&&(l=!1);if(q._urlBindings[g.id]&&q._urlBindings[g.id].urlBinding)w=q._urlBindings[g.id],w.invocation=m?u:null,w.bindingOnly&&(l=!1);l=l&&m}if(l)g.choiceCallback?(o===
"tool"||o==="button"?(l=f,m=!1,f.nodeName.toLowerCase()==="ul"&&(l=document.createElement("li"),f.appendChild(l))):(l=f,m=!0),q._createDropdownMenu(l,g.name,m,function(a){g.populateChoicesMenu(a,b,c,i,q)}.bind(g),g.imageClass,g.tooltip||g.title)):(u.handler=u.handler||this,u.domParent=f,m=function(){q._invoke(u)},o==="menu"?l=k.createCommandMenuItem(f,g,u,null,m):(l=o+g.id+j,l=k.createCommandItem(f,g,u,l,null,o==="tool",m)),h.generateNavGrid(e,l),u.domNode=l,j++)}})},_createDropdownMenu:function(a,
f,h,e,o,l){a=c.node(a);if(!a||!c.contains(document.body,a))return null;var n,u=a;if(h)l=document.createRange(),l.selectNode(a),l=l.createContextualFragment(i),c.processTextNodes(l,{ButtonText:f}),a.appendChild(l),n=a.lastChild,a=n.lastChild,f=a.previousSibling,f.dropdown=new b.Dropdown({dropdown:a,populate:e}),a.dropdown=f.dropdown;else if(a.nodeName.toLowerCase()==="ul"&&(u=document.createElement("li"),a.appendChild(u),n=u),a=null,o&&(a="dropdownButtonWithIcon",l=l||f),l=o?l||f:l,e=k.createDropdownMenu(u,
f,e,a,o),f=e.menuButton,a=e.menu,l)f.commandTooltip=new d.Tooltip({node:f,text:l,position:["above","below","right","left"]});return{menuButton:f,menu:a,dropdown:f.dropdown,destroyButton:n}},_generateMenuSeparator:function(a){if(!this._checkForTrailingSeparator(a,"menu")){var d=document.createElement("li");d.classList.add("dropdownSeparator");var f=document.createElement("span");f.classList.add("dropdownSeparator");d.appendChild(f);a.appendChild(d)}},generateSeparatorImage:function(a){var d;d=a.nodeName.toLowerCase()===
"ul"?document.createElement("li"):document.createElement("span");a.appendChild(d);d.classList.add("core-sprite-sep");d.classList.add("imageSprite");d.classList.add("commandSeparator");return d}};l.prototype.constructor=l;n.prototype={match:function(a){a=e.matchResourceParameters(a);return typeof a[this.token]!=="undefined"?(this.parameterValue=a[this.token],this):null}};n.prototype.constructor=n;m.prototype={optionsRequested:function(){return this.optionsRequested}};m.prototype.constructor=m;q.prototype=
{_storeParameters:function(a){this.parameterTable=null;if(a){var d=this.parameterTable={};a.forEach(function(a){d[a.name]=a})}},updateParameters:function(a){typeof this.getParameters==="function"&&this._storeParameters(this.getParameters(a))},hasParameters:function(){return this.parameterTable!==null},shouldCollectParameters:function(){return!this.clientCollect&&this.hasParameters()},parameterNamed:function(a){return this.parameterTable[a]},valueFor:function(a){return(a=this.parameterTable[a])?a.value:
null},setValue:function(a,d){var f=this.parameterTable[a];if(f)f.value=d},forEach:function(a){for(var d in this.parameterTable)this.parameterTable[d].type&&this.parameterTable[d].name&&a(this.parameterTable[d])},makeCopy:function(){var a=[];this.forEach(function(d){d=new m(d.name,d.type,d.label,d.value,d.lines);a.push(d)});var d=new q(a,this._options,this.getParameters);d.clientCollect=this.clientCollect;return d},hasOptionalParameters:function(){return this._hasOptionalParameters}};q.prototype.constructor=
q;return{CommandRegistry:l,URLBinding:n,ParametersDescription:q,CommandParameter:m}});
define("orion/parameterCollectors",["i18n!orion/nls/messages","require","orion/webui/littlelib"],function(g,k,j){function e(c,b){this._activeContainer=null;this._getElementsFunction=c;this._toolbarLayoutFunction=b}e.prototype={close:function(){if(this._activeElements){this._activeElements.parameterArea&&j.empty(this._activeElements.parameterArea);this._activeElements.slideContainer&&this._activeElements.slideContainer.classList.remove("slideContainerActive");this._activeElements.dismissArea&&j.empty(this._activeElements.dismissArea);
this._activeElements.commandNode&&this._activeElements.commandNode.classList.remove("activeCommand");this._toolbarLayoutFunction(this._activeElements);if(this._activeElements.onClose)this._activeElements.onClose();if(this._oldFocusNode)this._oldFocusNode.focus(),this._oldFocusNode=null}this._activeElements=null},open:function(c,b,a){typeof c==="string"&&(c=j.node(c));if(this._activeElements&&this._activeElements.slideContainer&&this._activeElements.commandNode===c)return this._activeElements.focusNode&&
this._activeElements.focusNode.focus(),!0;this.close();this._activeElements=null;if((this._activeElements=this._getElementsFunction(c))&&this._activeElements.parameterArea&&this._activeElements.slideContainer){this._activeElements.onClose=a;var i=b(this._activeElements.parameterArea,this._activeElements.dismissArea);if(!i)return!1;this._activeElements.focusNode=i;c=j.$$array("#closebox",this._activeElements.dismissArea||this._activeElements.parameterArea);if(c.length===0){b=this._activeElements.dismissArea||
this._activeElements.parameterArea;c=document.createElement("button");c.id="closebox";c.className="imageSprite core-sprite-close dismissButton";c.title=g.Close;b.appendChild(c);var f=this;c.addEventListener("click",function(){f.close()},!1)}this._activeElements.slideContainer.classList.add("slideContainerActive");this._toolbarLayoutFunction(this._activeElements);if(i)this._oldFocusNode=window.document.activeElement,window.setTimeout(function(){i.focus();i.select&&i.select()},0);this._activeElements.commandNode&&
this._activeElements.commandNode.classList.add("activeCommand");return!0}return!1},_collectAndCall:function(c,b){j.$$array("input",b).forEach(function(a){a.type==="checkbox"?c.parameters.setValue(a.parameterName,a.checked):a.type!=="button"&&c.parameters.setValue(a.parameterName,a.value.trim())});j.$$array("textArea",b).forEach(function(a){c.parameters.setValue(a.parameterName,a.value.trim())});c.command.callback&&c.command.callback.call(c.handler,c)},collectParameters:function(c){return c.parameters?
(c.domNode&&c.domNode.classList.add("commandMarker"),this.open(c.domNode||c.domParent,this.getFillFunction(c))):!1},getFillFunction:function(c,b){var a=this;return function(i,f){var d=null,h=function(){b&&b();a.close()},e=function(d){d.keyCode===j.KEY.ENTER&&a._collectAndCall(c,i);if(d.keyCode===j.KEY.ESCAPE||d.keyCode===j.KEY.ENTER)h(),j.stop(d)};c.parameters.forEach(function(a){var f=null;if(a.label)f=document.createElement("label"),f.classList.add("parameterInput"),f.setAttribute("for",a.name+
"parameterCollector"),f.textContent=a.label,i.appendChild(f);var b=a.name+"parameterCollector",c=f||i;if(a.type==="text"&&typeof a.lines==="number"&&a.lines>1)f=document.createElement("textarea"),f.rows=a.lines,f.type="textarea",f.id=b,c.appendChild(f),e=function(a){a.keyCode===j.KEY.ESCAPE&&(h(),j.stop(a))};else if(a.type==="boolean"){if(f=document.createElement("input"),f.type="checkbox",f.id=b,c.appendChild(f),a.value)f.checked=!0}else if(f=document.createElement("input"),f.type=a.type,f.id=b,
c.appendChild(f),a.value)f.value=a.value;f.classList.add("parameterInput");f.setAttribute("speech","speech");f.setAttribute("x-webkit-speech","x-webkit-speech");f.parameterName=a.name;d||(d=f);f.addEventListener("keydown",e,!1)});var n=f;if(!n)n=document.createElement("span"),n.className="layoutRight parametersDismiss",i.appendChild(n);var m=function(a,d){var f=document.createElement("button");d.appendChild(f);a&&f.appendChild(document.createTextNode(a));f.classList.add("dismissButton");return f};
if(c.parameters.hasOptionalParameters())c.parameters.optionsRequested=!1,m(g.More,n).addEventListener("click",function(){c.parameters.optionsRequested=!0;a._collectAndCall(c,i);h()},!1);m(g.Submit,n).addEventListener("click",function(){a._collectAndCall(c,i);h()},!1);n=m(null,n);n.id="closebox";n.classList.add("imageSprite");n.classList.add("core-sprite-close");n.title=g.Close;n.addEventListener("click",function(){h()},!1);return d}}};e.prototype.constructor=e;return{CommandParameterCollector:e}});
define("orion/editor/regex",[],function(){return{escape:function(g){return g.replace(/([\\$\^*\/+?\.\(\)|{}\[\]])/g,"\\$&")},parse:function(g){return(g=/^\s*\/(.+)\/([gim]{0,3})\s*$/.exec(g))?{pattern:g[1],flags:g[2]}:null}}});
define("orion/contentTypes",[],function(){function g(b,a){function c(a,d,f,h){var f=d.filename.indexOf(f)>=0,b=d.extension.indexOf(h)>=0;if(f||b)if(!a||f&&a.extension.indexOf(h)>=0)return d;return a}for(var f=b&&b.split(".").pop(),d=null,h=0;h<a.length;h++){var e=a[h];c(d,e,b,f)===e&&(d=e)}return d}function k(b){this.serviceRegistry=b;this.map=function(a){function b(a){return a===null||typeof a==="undefined"?[]:a instanceof Array?a:[a]}for(var a=a.getServiceReferences(e).concat(a.getServiceReferences(c)),
f={},d=0;d<a.length;d++)for(var h=b(a[d].getProperty("contentTypes")),l=0;l<h.length;l++){var n=h[l];f[n.id]||(f[n.id]={id:n.id,name:n.name,image:n.image,"extends":n["extends"],extension:b(n.extension),filename:b(n.filename)})}return f}(b);b.registerService(j,this)}var j="orion.core.contenttypes",e="orion.core.contenttype",c="orion.file.contenttype";k.prototype={getContentTypes:function(){var b=this.getContentTypesMap(),a=[],c;for(c in b)b.hasOwnProperty(c)&&a.push(b[c]);return a},getContentTypesMap:function(){return this.map},
getFileContentType:function(b){return g(b.Name,this.getContentTypes())},getFilenameContentType:function(b){return g(b,this.getContentTypes())},getContentType:function(b){return this.map[b]||null},isExtensionOf:function(b,a){b=typeof b==="string"?this.getContentType(b):b;a=typeof a==="string"?this.getContentType(a):a;if(!b||!a)return!1;if(b.id===a.id)return!0;else for(var c=b,f={};c&&(c=this.getContentType(c["extends"]));){if(c.id===a.id)return!0;if(f[c.id])throw Error("Cycle: "+c.id);f[c.id]=!0}return!1},
isSomeExtensionOf:function(b,a){for(var c=0;c<a.length;c++)if(this.isExtensionOf(b,a[c]))return!0;return!1}};return{ContentTypeService:k,getFilenameContentType:g}});
define("orion/URITemplate",[],function(){function g(a){this._text=a}function k(a,d){if(d==="U")return encodeURIComponent(a).replace(/[!'()*]/g,function(a){return"%"+a.charCodeAt(0).toString(16).toUpperCase()});if(d==="U+R")return encodeURI(a).replace(/%5B/g,"[").replace(/%5D/g,"]");if(d==="U+R-,")return encodeURI(a).replace(/%5B/g,"[").replace(/%5D/g,"]").replace(/,/g,"%2C");throw Error("Unknown allowed character set: "+d);}function j(a,d,h){for(var b=[],c=0;c<a.length;c++)typeof a[c]!=="undefined"&&
b.push(k(a[c],d));return b.join(h)}function e(a,d,h,b){for(var c=Object.keys(a),i=[],e=0;e<c.length;e++)typeof a[c[e]]!=="undefined"&&i.push(k(c[e],d)+h+k(a[c[e]],d));return i.join(b)}function c(f){if(f.length===0)throw Error("Invalid Expression: 0 length expression");(this._operator=a[f[0]])?f=f.substring(1):this._operator=a.NUL;for(var d=[],h=f.split(","),b=0;b<h.length;b++){var c=h[b].match(i);if(c===null)throw Error("Bad VarSpec: "+f);d.push({name:c[1],explode:!!c[2],prefix:c[3]?parseInt(c[3],
10):-1})}this._varSpecList=d}function b(a){for(var d=[],h=0,b=a.indexOf("{",h);b!==-1;){d.push(new g(a.substring(h,b)));h=a.indexOf("}",b+1);if(h===-1)throw Error("Invalid template: "+a);d.push(new c(a.substring(b+1,h)));h+=1;b=a.indexOf("{",h)}d.push(new g(a.substring(h)));this._templateComponents=d}var a={NUL:{first:"",sep:",",named:!1,ifemp:"",allow:"U"},"+":{first:"",sep:",",named:!1,ifemp:"",allow:"U+R"},".":{first:".",sep:",",named:!1,ifemp:"",allow:"U"},"/":{first:"/",sep:"/",named:!1,ifemp:"",
allow:"U"},";":{first:";",sep:";",named:!0,ifemp:"",allow:"U"},"?":{first:"?",sep:"&",named:!0,ifemp:"=",allow:"U"},"&":{first:"&",sep:"&",named:!0,ifemp:"=",allow:"U"},"#":{first:"#",sep:",",named:!1,ifemp:"",allow:"U+R"},",":{first:"",sep:",",named:!1,ifemp:"",allow:"U+R-,"}},i=/^((?:(?:[a-zA-Z0-9_])|(?:%[0-9A-F][0-9A-F]))(?:(?:[a-zA-Z0-9_.])|(?:%[0-9A-F][0-9A-F]))*)(?:(\*)|:([0-9]+))?$/;g.prototype={expand:function(){return encodeURI(this._text)}};c.prototype={expand:function(a){for(var d=[],h=
0;h<this._varSpecList.length;h++){var b=this._varSpecList[h],c=b.name,i=a[c],g=typeof i;if(g!=="undefined"&&i!==null){var s=d.length===0?this._operator.first:this._operator.sep;if(g==="string")this._operator.named&&(s+=k(c,"U+R"),s+=i.length===0?this._operator.ifemp:"="),b.prefix!==-1&&b.prefix<i.length&&(i=i.substring(0,b.prefix)),s+=k(i,this._operator.allow);else if(Array.isArray(i))b.explode?s+=j(i,this._operator.allow,this._operator.sep):(this._operator.named&&(s+=k(c,"U+R"),s+=i.length===0?this._operator.ifemp:
"="),s+=j(i,this._operator.allow,","));else if(g==="object")b.explode?s+=e(i,this._operator.allow,"=",this._operator.sep):(this._operator.named&&(s+=k(c,"U+R"),s+=Object.keys(i).length===0?this._operator.ifemp:"="),s+=e(i,this._operator.allow,",",","));else throw Error("bad param type: "+c+" : "+g);d.push(s)}}return d.join("")}};b.prototype={expand:function(a){for(var d=[],h=0;h<this._templateComponents.length;h++)d.push(this._templateComponents[h].expand(a));return d.join("")}};return b});
define("orion/i18nUtil",["require","orion/Deferred"],function(g,k){function j(c){if(c=localStorage.getItem("orion/messageBundle/"+c))if(c=JSON.parse(c),c._expires&&c._expires>(new Date).getTime())return delete c._expires,c;return null}var e={};return{getMessageBundle:function(c){function b(){g(["i18n!"+c],function(d){if(d){var f=c;d._expires=(new Date).getTime()+9E5;localStorage.setItem("orion/messageBundle/"+f,JSON.stringify(d));delete d._expires}a.resolve(d)})}if(e[c])return e[c];var a=new k;e[c]=
a;var i=j(c);if(i)return a.resolve(i),a;try{g([c],b)}catch(f){g(["orion/i18n!"+c],b)}return a},formatMessage:function(c){var b=arguments;return c.replace(/\$\{([^\}]+)\}/g,function(a,c){return b[(c<<0)+1]})}}});
define("orion/PageLinks","require,orion/Deferred,orion/PageUtil,orion/URITemplate,orion/i18nUtil,orion/URL-shim".split(","),function(g,k,j,e,c){function b(){return(new URL(g.toUrl("orion/../"),window.location.href)).href.slice(0,-1)}function a(a,f){var d=a.getServiceReferences(f||"orion.page.link"),h=j.matchResourceParameters(window.location.href),l={OrionHome:b(),Location:h.resource},n=[];d.forEach(function(a){var d={};a.getPropertyKeys().forEach(function(f){d[f]=a.getProperty(f)});if(d.uriTemplate&&
d.nls&&(d.name||d.nameKey)){var f=new k;c.getMessageBundle(d.nls).then(function(a){var h=new e(d.uriTemplate),h=window.decodeURIComponent(h.expand(l)),h=j.validateURLScheme(h);d.href=h;d.textContent=d.nameKey?a[d.nameKey]:d.name;f.resolve(d)});n.push(f)}else if(d.uriTemplate&&d.name){var h=new e(d.uriTemplate),h=window.decodeURIComponent(h.expand(l)),h=j.validateURLScheme(h);d.href=h;d.textContent=d.name;n.push((new k).resolve(d))}});return k.all(n)}return{createPageLinks:function(b,f){return a(b,
f).then(function(a){a.sort(function(a,d){var f=a.textContent&&a.textContent.toLowerCase(),b=d.textContent&&d.textContent.toLowerCase();return f<b?-1:f>b?1:0});return a.map(function(a){var d=a.href,a=a.textContent,f=document.createElement("a");f.href=d;f.target="_self";f.classList.add("targetSelector");f.textContent=a;return f})})},getPageLinksInfo:a,getOrionHome:b}});
define("orion/extensionCommands","require,orion/Deferred,orion/commands,orion/editor/regex,orion/contentTypes,orion/URITemplate,orion/i18nUtil,orion/URL-shim,orion/PageLinks".split(","),function(g,k,j,e,c,b,a,i,f){var d={},h=f.getOrionHome();d._cloneItemWithoutChildren=function m(a){if(a===null||typeof a!=="object")return a;var d=a.constructor(),f;for(f in a)f!=="children"&&f!=="Children"&&(d[f]=m(a[f]));return d};d._getOpenWithNavCommandExtensions=function(a){function d(a,f){for(var h=a.getServiceReferences("orion.navigate.openWith"),
b=[],c=0;c<h.length;c++){var o=h[c];o.getProperty("editor")===f.id&&(o=o.getProperty("contentType"),o instanceof Array?b=b.concat(o):o!==null&&typeof o!=="undefined"&&b.push(o))}return b}for(var f=function(){for(var d=a.getServiceReferences("orion.edit.editor"),f=[],h=0;h<d.length;h++){var b=d[h],c=b.getProperty("id");f.push({id:c,name:b.getProperty("name"),nameKey:b.getProperty("nameKey"),nls:b.getProperty("nls"),uriTemplate:b.getProperty("orionTemplate")||b.getProperty("uriTemplate")})}return f}(),
h=function(a){for(a=a.getServiceReferences("orion.navigate.openWith.default");0<a.length;)return{editor:a[0].getProperty("editor")};return null}(a),b=[],c=0;c<f.length;c++){var o=f[c],i=h&&h.editor===o.id,e=d(a,o);e.length&&b.push({properties:{name:o.name||o.id,nameKey:o.nameKey,id:"eclipse.openWithCommand."+o.id,tooltip:o.name,tooltipKey:o.nameKey,contentType:e,uriTemplate:o.uriTemplate,nls:o.nls,forceSingleItem:!0,isEditor:i?"default":"editor"},service:{}})}return b};d._makeValidator=function(a,
d,f,i){function e(a,d,f,h){var b=f.match,c;if(d.indexOf("|")>=0)return c=d.substring(0,d.indexOf("|")),d=d.substring(d.indexOf("|")+1),e(a,c,f,h)?!0:e(a,d,f,h);else if(d.indexOf(":")>=0)return c=d.substring(0,d.indexOf(":")),d=d.substring(d.indexOf(":")+1),a[c]?e(a[c],d,f,h):!1;else{a:{c=!1;var i;if(typeof a[d]!=="undefined"){if(typeof b==="undefined")i=a[d],c=!0;else if(typeof b==="string"){if(!typeof(a[d]==="string")){f=!1;break a}if(f.variableName){if(b=RegExp(b).exec(a[d]))c=b[0],i=f.variableMatchPosition===
"before"?a[d].substring(0,b.index):f.variableMatchPosition==="after"?a[d].substring(b.index+c.length):f.variableMatchPosition==="only"?c:a[d],c=!0}else{f=RegExp(b).test(a[d]);break a}}else a[d]===b&&(i=a[d],c=!0);if(c&&f.variableName&&(h[f.variableName]=i,h.itemCached=a,f.replacements))for(a=0;a<f.replacements.length;a++)d=!1,f.replacements[a].pattern?h[f.variableName]=h[f.variableName].replace(RegExp(f.replacements[a].pattern),f.replacements[a].replacement||""):d=!0,d&&window.console.log("Invalid replacements specified in validation property.  "+
f.replacements[a]);f=c}else f=!1}return f}}return{info:a,validationFunction:function(d){typeof i==="function"&&(d=i.call(this,d));if(d){if(Array.isArray(d)){if((this.info.forceSingleItem||this.info.uriTemplate)&&d.length!==1)return!1;if(d.length<1)return!1}else d=[d];for(var h=0;h<d.length;h++){var b;a:{var l=d[h],u=f;if(this.info.validationProperties)for(b=0;b<this.info.validationProperties.length;b++){var g=this.info.validationProperties[b];if(typeof g.source!=="undefined"){if(!e(l,g.source,g,this)){b=
!1;break a}}else{window.console.log("Invalid validationProperties in "+a.id+".  No source property specified.");b=!1;break a}}if(this.info.contentType&&u){g=!1;if(l=c.getFilenameContentType(l.Name,u))for(b=0;b<this.info.contentType.length;b++)if(l.id===this.info.contentType[b]){g=!0;break}b=g}else b=!0}if(!b)return!1}return!0}return!1},generatesURI:function(){return!!this.info.uriTemplate},getURI:function(a){if(this.info.uriTemplate){var d={},f;for(f in a)a.hasOwnProperty(f)&&(d[f]=a[f]);if(this.info.validationProperties)for(f=
0;f<this.info.validationProperties.length;f++){var c=this.info.validationProperties[f];c.source&&c.variableName&&(this.itemCached===a&&this[c.variableName]||e(a,c.source,c,this),a[c.variableName]?window.console.log("Variable name "+c.variableName+" in the extension "+this.info.id+" conflicts with an existing property in the item metadata."):d[c.variableName]=this[c.variableName])}d.OrionHome=h;a=new b(this.info.uriTemplate);return window.decodeURIComponent(a.expand(d))}return null}}};d._createCommandOptions=
function(f,h,b,c,i,e){function o(a,o){var l=d._makeValidator(f,b,c,e);a.visibleWhen=l.validationFunction.bind(l);if(i)if(l.generatesURI.bind(l)())a.hrefCallback=function(a){a=Array.isArray(a.items)?a.items[0]:a.items;return l.getURI.bind(l)(a)};else{var v=f;a.callback=function(f){var c;if(v.forceSingleItem)f=Array.isArray(f.items)?f.items[0]:f.items,c=d._cloneItemWithoutChildren(f);else if(Array.isArray(f.items)){c=[];for(var o=0;o<f.items.length;o++)c.push(d._cloneItemWithoutChildren(f.items[o]))}else c=
d._cloneItemWithoutChildren(f.items);if(b)var i=b.getService("orion.page.progress");h.run?i?i.progress(h.run(c),"Running command: "+a.name):h.run(c):b&&(i?i.progress(b.getService(h).run(c),"Running command: "+a.name):b.getService(h).run(c))}}o.resolve(a)}var l=new k;f.nls?a.getMessageBundle(f.nls).then(function(a){o({name:f.nameKey?a[f.nameKey]:f.name,image:f.image,id:f.id||f.name,tooltip:f.tooltipKey?a[f.tooltipKey]:f.tooltip,isEditor:f.isEditor,showGlobally:f.showGlobally},l)}):o({name:f.name,image:f.image,
id:f.id||f.name,tooltip:f.tooltip,isEditor:f.isEditor,showGlobally:f.showGlobally},l);return l};d.getOpenWithCommands=function(a){var d=[],f;for(f in a._commandList){var h=a._commandList[f];h.isEditor&&d.push(h)}return d};var l;d.createAndPlaceFileCommandsExtension=function(a,f,h,b,c,i){var o=!!i;return d.createFileCommands(a,null,i?"all":void 0,o).then(function(a){f._addedOpenWithCommands=o;var d=!1,i=!1;a.forEach(function(a){f.addCommand(a);c&&!d&&(d=!0,f.addCommandGroup(h,"eclipse.fileCommandExtensions",
1E3,null,c));c&&!i&&(i=!0,f.addCommandGroup(h,"eclipse.openWith",1E3,"Open With",c+"/eclipse.fileCommandExtensions"));this.isEditor?f.registerCommandContribution(h,a.id,b+this.index,c?c+"/eclipse.fileCommandExtensions/eclipse.openWith":null):f.registerCommandContribution(h,a.id,b+this.index,c?c+"/eclipse.fileCommandExtensions":null)});return{}})};d.createFileCommands=function(a,f,h,b){var h=h===void 0?"global":h,b=b===void 0?!0:b,c=a.getServiceReferences("orion.navigate.command"),i=[];if(h==="all"||
h==="global")for(var o=0;o<c.length;o++)if(c[o].getProperty("id")!=="orion.navigateFromMetadata"){for(var e=a.getService(c[o]),g={},u=c[o].getPropertyKeys(),w=0;w<u.length;w++)g[u[w]]=c[o].getProperty(u[w]);(h==="all"||g.forceSingleItem&&g.showGlobally)&&i.push({properties:g,service:e})}return k.when(function(){var d=a.getService("orion.core.contenttypes")||f;return l||k.when(d.getContentTypes(),function(a){return l=a})}(),function(){i=b?i.concat(d._getOpenWithNavCommandExtensions(a,l)):i;var f=i.map(function(f){var h=
f.properties;return d._createCommandOptions(h,f.service,a,l,!0).then(function(a){a=new j.Command(a);if(h.isEditor)a.isEditor=h.isEditor;return a})});return k.all(f,function(a){return{_error:a}}).then(function(a){return a})})};d.createOpenWithCommands=function(a,f,h){return h&&h._addedOpenWithCommands?(new k).resolve(d.getOpenWithCommands(h)):d.createFileCommands(a,f,"none",!0)};return d});
define("orion/breadcrumbs",["require","orion/webui/littlelib"],function(g,k){function j(e){this._init(e)}j.prototype={_init:function(e){var c=k.node(e.container);if(!c)throw"no parent container";this._container=c;c.classList.remove("currentLocation");this._id=e.id||"eclipse.breadcrumbs";this._resource=e.resource||null;this._rootSegmentName=e.rootSegmentName;this._workspaceRootSegmentName=e.workspaceRootSegmentName;this._workspaceRootURL=e.workspaceRootURL;this._makeHref=e.makeHref;this.path="";this.measure();
this.render()},getNavigatorWorkspaceRootSegment:function(){if(this._workspaceRootSegmentName){var e;if(this._resource&&this._resource.Parents){e=document.createElement("a");var c=this._workspaceRootURL?this._workspaceRootURL:"";this._makeHref?this._makeHref(e,c):e.href=g.toUrl("navigate/table.html")+"#"+c}else e=document.createElement("span");k.empty(e);e.appendChild(document.createTextNode(this._workspaceRootSegmentName));return e}return null},MAX_LENGTH:500,INCLUDE_FIRST_SECTION:!0,segments:[],
buildSegment:function(e){var c=document.createElement("a");c.classList.add("breadcrumb");c.appendChild(document.createTextNode(e));return c},addSegmentHref:function(e,c){this._makeHref?this._makeHref(e,c.Location,c):e.href=g.toUrl("navigate/table.html")+"#"+c.ChildrenLocation},buildSegments:function(e,c){if(this._resource.Parents){var b=this._resource.Parents.slice(0),a,i;b&&(b=b.slice(0),c==="reverse"&&(b=b.reverse().slice(0)),b.forEach(function(f){e?(i=e,e=null):i=f.Name;a=this.buildSegment(i);
this.path+=f.Name;this.addSegmentHref(a,f);a.include=!1;this.segments.push(a)}.bind(this)))}},addDivider:function(){var e=document.createElement("span");e.appendChild(document.createTextNode(" / "));this.path+="/";e.classList.add("breadcrumbSeparator");this.append(e)},refresh:function(){(this.crumbs=k.node(this._id))?k.empty(this.crumbs):(this.crumbs=document.createElement("span"),this.crumbs.id=this._id,this._container.appendChild(this.crumbs),this.dirty=document.createElement("span"),this.dirty.id=
"dirty",this.dirty.className="modifiedFileMarker",this._container.appendChild(this.dirty));this.crumbs.style.width="auto";this.crumbs.style.visibility="visible";this.crumbs.parentNode.className="currentLocation";this.crumbs.parentNode.style.width="auto"},append:function(e){this.crumbs.appendChild(e)},addTitle:function(e,c){var b=c||document.title;this.crumbs.childNodes.length===0&&(e=document.createElement("span"),e.appendChild(document.createTextNode(b)),e.classList.add("breadcrumb"),e.classList.add("currentLocation"),
this.append(e))},finalSegment:function(e,c){e=document.createElement("span");c?e.appendChild(document.createTextNode(c)):e.appendChild(document.createTextNode(this._resource.Name));e.classList.add("currentLocation");this.path+=this._resource.Name;this.append(e)},firstSegment:function(e){if(e)this.append(e),this._resource&&this._resource.Parents?(e.classList.add("breadcrumb"),this.addDivider()):(e.href="",e.classList.add("currentLocation"))},drawSegments:function(){this._resource.Parents&&this.segments.slice(0).forEach(function(e){e.include===
!0&&(this.append(e),this.addDivider())}.bind(this))},measureSegments:function(){this.INCLUDE_FIRST_SECTION=!0;if(this._resource.Parents){var e=this.segments.slice(0).reverse();e.forEach(function(c){this.append(c);this.addDivider();this.crumbs.offsetWidth<this.MAX_LENGTH?c.include=!0:this.INCLUDE_FIRST_SECTION=!1}.bind(this));this.segments=e.reverse()}},measure:function(){this.refresh();this.segments=[];this.crumbs.style.visibility="hidden";var e=this.getNavigatorWorkspaceRootSegment(),c=this._rootSegmentName;
if(c)this.addTitle(e,c);else if(this.finalSegment(e,c),this._resource&&this._resource.Parents&&(this.buildSegments(c,"reverse"),this.measureSegments(),this.firstSegment(e)),this.crumbs.offsetWidth>=this.MAX_LENGTH)this.INCLUDE_FIRST_SECTION=!1},render:function(){this.refresh();var e=this.getNavigatorWorkspaceRootSegment(),c=this._rootSegmentName;c?this.addTitle(e,c):(this.INCLUDE_FIRST_SECTION===!0&&this.firstSegment(e),this._resource&&this._resource.Parents&&(this.drawSegments(),this.finalSegment(e,
c)));this.crumbs.parentNode.style.width=this.crumbs.offsetWidth+20+"px"}};j.prototype.constructor=j;return{BreadCrumbs:j}});
define("orion/webui/splitter",["require","orion/webui/littlelib"],function(g,k){function j(e){this._init(e)}j.prototype={_init:function(e){this._tracking=null;this._resizeListeners=[];this._animationDelay=501;this.$node=k.node(e.node);if(!this.$node)throw"no dom node for splitter found";this.$sideNode=k.node(e.sidePanel);if(!this.$sideNode)throw"no dom node for side panel found";this.$mainNode=k.node(e.mainPanel);if(!this.$mainNode)throw"no dom node for main panel found";this._vertical=e.vertical;
this._prefix="/orion/splitter/"+(this.$node.id||document.body.id||"");if(e.toggle)this._thumb=document.createElement("div"),this.$node.appendChild(this._thumb),this._thumb.classList.add("splitThumb"),this._thumb.classList.add("splitThumbLayout");this._closeByDefault=e.closeByDefault;this._initializeFromStoredSettings();this._closed?(this._closed=!1,this._thumbDown()):this._adjustToSplitPosition();this.$node.style.visibility="visible";this.$mainNode.style.display="block";this.$sideNode.style.display=
"block";this.$node.addEventListener("mousedown",this._mouseDown.bind(this),!1);window.addEventListener("mouseup",this._mouseUp.bind(this),!1);window.addEventListener("resize",this._resize.bind(this),!1)},toggleSidePanel:function(){this._thumbDown()},openSidePanel:function(){this._closed||this._thumbDown()},addResizeListener:function(e){this._resizeListeners.push(e)},_initializeFromStoredSettings:function(){var e=localStorage.getItem(this._prefix+"/toggleState");this._closed=e?e==="closed":this._closeByDefault?
!0:!1;if(this._vertical)if(e=localStorage.getItem(this._prefix+"/yPosition"))this._splitTop=parseInt(e,10);else{if(this._closeByDefault)this._splitTop=150}else if(e=localStorage.getItem(this._prefix+"/xPosition"))this._splitLeft=parseInt(e,10);else if(this._closeByDefault)this._splitLeft=150},_adjustToSplitPosition:function(e){var c=k.bounds(this.$node),b=k.bounds(this.$node.parentNode);if(this._vertical){this._splitHeight=c.height;if(e||!this._splitTop)this._splitTop=c.top,localStorage.setItem(this._prefix+
"/yPosition",this._splitTop);e=this._splitTop;this.$node.parentNode.style.position==="relative"&&(e=this._splitTop-b.top);this.$sideNode.style.height=e+"px";this.$sideNode.style.bottom=e-1+"px";this.$sideNode.style.display="block";this.$node.style.top=e+"px"}else{this._splitWidth=c.width;if(e||!this._splitLeft)this._splitLeft=c.left,localStorage.setItem(this._prefix+"/xPosition",this._splitLeft);e=this._splitLeft;this.$node.parentNode.style.position==="relative"&&(e=this._splitLeft-b.left);this.$sideNode.style.width=
e+"px";this.$sideNode.style.right=e-1+"px";this.$sideNode.style.display="block";this.$node.style.left=e+"px"}this._resize()},_resize:function(e){var e=e||0,c=k.bounds(this.$node.parentNode),b=k.bounds(this.$node);this._vertical?this.$mainNode.style.height=c.height-(b.top-c.top+b.height)+"px":this.$mainNode.style.width=c.width-(b.left-c.left+b.width)+"px";var a=this;window.setTimeout(function(){a._notifyResizeListeners(a.$mainNode)},e);window.setTimeout(function(){a._notifyResizeListeners(a.$sideNode)},
e)},_notifyResizeListeners:function(e){for(var c=0;c<this._resizeListeners.length;c++)this._resizeListeners[c](e)},_thumbDown:function(){this._closed?(this._closed=!1,this._addAnimation(),this._vertical?(this.$sideNode.style.height=this._splitTop+"px",this.$node.style.top=this._splitTop+"px"):(this.$sideNode.style.width=this._splitLeft+"px",this.$node.style.left=this._splitLeft+"px")):(this._closed=!0,this._addAnimation(),this._vertical?(this.$sideNode.style.top=0,this.$node.style.top="1px"):(this.$sideNode.style.width=
0,this.$node.style.left="1px"));this._resize(this._animationDelay);this._removeAnimation();localStorage.setItem(this._prefix+"/toggleState",this._closed?"closed":null)},_removeAnimation:function(){var e=this;window.setTimeout(function(){e.$sideNode.classList.remove("sidePanelLayoutAnimation");e.$mainNode.classList.remove("mainPanelLayoutAnimation");e.$node.classList.remove("splitLayoutAnimation");e._thumb.classList.remove("splitLayoutAnimation")},this._animationDelay)},_addAnimation:function(){this.$sideNode.classList.add("sidePanelLayoutAnimation");
this.$mainNode.classList.add("mainPanelLayoutAnimation");this.$node.classList.add("splitLayoutAnimation");this._thumb&&this._thumb.classList.add("splitLayoutAnimation")},_mouseDown:function(e){if(e.target===this._thumb)return k.stop(e),this._thumbDown(e);if(!this._tracking)this.$node.classList.add("splitTracking"),this.$mainNode.classList.add("panelTracking"),this.$sideNode.classList.add("panelTracking"),this._tracking=this._mouseMove.bind(this),window.addEventListener("mousemove",this._tracking),
k.stop(e)},_mouseMove:function(e){if(this._tracking){var c=k.bounds(this.$node.parentNode);if(this._vertical){this._splitTop=e.clientY;if(this._splitTop<c.top+5)this._splitTop=c.top+5;else if(this._splitTop>c.top+c.height-5)this._splitTop=c.top+c.height-5;var b=this._splitTop;this.$node.parentNode.style.position==="relative"&&(b=this._splitTop-c.top);this.$node.style.top=b+"px"}else{this._splitLeft=e.clientX;if(this._splitLeft<c.left+5)this._splitLeft=c.left+5;else if(this._splitLeft>c.left+c.width-
5)this._splitLeft=c.left+c.width-5;b=this._splitLeft;this.$node.parentNode.style.position==="relative"&&(b=this._splitLeft-c.left);this.$node.style.left=b+"px"}this._adjustToSplitPosition(!0);k.stop(e)}},_mouseUp:function(e){if(this._tracking)window.removeEventListener("mousemove",this._tracking),this._tracking=null,this.$node.classList.remove("splitTracking"),this.$mainNode.classList.remove("panelTracking"),this.$sideNode.classList.remove("panelTracking"),k.stop(e)}};j.prototype.constructor=j;return{Splitter:j}});
define("orion/fileUtils",["require","i18n!orion/nls/messages","orion/URL-shim"],function(g){return{makeRelative:function(g){if(!g)return g;var j=window.location.protocol+"//"+window.location.host;return g.indexOf(j)===0?g.substring(j.length):g},isAtRoot:function(k){if(!k)return!1;if(k==="/workspace")return!0;var j=new URL(g.toUrl("workspace"),window.location.href);return(new URL(k,window.location.href)).href.indexOf(j.href)===0}}});
define("orion/favorites",["require","orion/fileUtils","orion/EventTarget"],function(g,k,j){function e(c){this._favorites=[];j.attach(this);this._init(c);this._initializeFavorites()}e.prototype={_init:function(c){this._registry=c.serviceRegistry;this._serviceRegistration=this._registry.registerService("orion.core.favorite",this)},_notifyListeners:function(){this.dispatchEvent({type:"favoritesChanged",navigator:this._favorites,registry:this._registry})},makeFavorites:function(c){for(var c=Array.isArray(c)?
c:[c],b=0;b<c.length;b++){var a=c[b],i=a.ChildrenLocation?a.ChildrenLocation:a.Location,i=k.makeRelative(i);this.addFavorite(a.Name,i,a.Directory)}this._storeFavorites();this._notifyListeners()},addFavoriteUrl:function(c){this.addFavorite(c,c,!1,!0)},addFavorite:function(c,b,a){this._favorites.push({name:c,path:b,directory:a,isFavorite:!0});this._favorites.sort(this._sorter);this._storeFavorites();this._notifyListeners()},removeFavorite:function(c){for(var b in this._favorites)if(this._favorites[b].path===
c){this._favorites.splice(b,1);break}this._favorites.sort(this._sorter);this._storeFavorites();this._notifyListeners()},renameFavorite:function(c,b){var a=!1,i;for(i in this._favorites)if(this._favorites[i].path===c){var f=this._favorites[i];if(f.name!==b)f.name=b,a=!0}a&&(this._favorites.sort(this._sorter),this._storeFavorites(),this._notifyListeners())},hasFavorite:function(c){for(var b in this._favorites)if(this._favorites[b].path===c)return!0;return!1},_SPECIAL_CHARS:"^$\\+[]().",queryFavorites:function(c){var b;
if(!c)return this._favorites;var a="";for(b=0;b<c.length;b++){var i=c.charAt(b);a+=i==="*"?".*":i==="?"?".?":this._SPECIAL_CHARS.indexOf(i)>=0?"\\"+i:i}a+=".*";c=RegExp(a);a=[];for(b in this._favorites)this._favorites[b].name.search(c)===0&&a.push(this._favorites[b]);return a},_initializeFavorites:function(){var c=this;this._registry.getService("orion.core.preference").getPreferences("/window/favorites").then(function(b){var a,b=b.get("navigate");typeof b==="string"&&(b=JSON.parse(b));if(b)for(a in b)b[a].isFavorite=
!0,c._favorites.push(b[a]);c._favorites.sort(c._sorter);c._notifyListeners()})},_storeFavorites:function(){var c=this._favorites;this._registry.getService("orion.core.preference").getPreferences("/window/favorites").then(function(b){b.put("navigate",c)})},_sorter:function(c,b){var a=c.name.toLowerCase(),i=b.name.toLowerCase();return a>i?1:a<i?-1:0},getFavorites:function(){return{navigator:this._favorites}}};e.prototype.constructor=e;return{FavoritesService:e}});
define("orion/widgets/themes/ThemePreferences",[],function(){function g(g,j){this._preferences=g;this._themeData=j;var e=j.getThemeStorageInfo(),c=g.listenForChangedSettings(e.storage,2,function(b){b.key===c&&this.apply()}.bind(this))}g.prototype={_initialize:function(g,j,e){var c=e.get(g.styleset);c||(c=j.getStyles(),e.put(g.styleset,JSON.stringify(c)));(j=e.get("selected"))&&(j=JSON.parse(j));if(!j||j[g.selectedKey]===void 0)j=j||{},j[g.selectedKey]=g.defaultTheme,e.put("selected",JSON.stringify(j))},
apply:function(){this.setTheme()},getTheme:function(g){var j=this._themeData,e=j.getThemeStorageInfo();this._preferences.getPreferences(e.storage,2).then(function(c){this._initialize(e,j,c);var b=JSON.parse(c.get("selected")),c=JSON.parse(c.get(e.styleset)),a;if(c)for(var i=0;i<c.length;i++)if(c[i].name===b[e.selectedKey]){a=c[i];break}g({style:a,styles:c})}.bind(this))},setTheme:function(g,j){var e=this._themeData,c=e.getThemeStorageInfo();this._preferences.getPreferences(c.storage,2).then(function(b){this._initialize(c,
e,b);var a=JSON.parse(b.get("selected"));g||(g=a[c.selectedKey]);a[c.selectedKey]=g;b.put("selected",JSON.stringify(a));j?b.put(c.styleset,JSON.stringify(j)):j=JSON.parse(b.get(c.styleset));for(b=0;b<j.length;b++)if(j[b].name===a[c.selectedKey]){e.processSettings(j[b]);break}}.bind(this))},setFontSize:function(g){var j=this._themeData,e=j.getThemeStorageInfo();this._preferences.getPreferences(e.storage,2).then(function(c){this._initialize(e,j,c);var b=JSON.parse(c.get("selected")),a=JSON.parse(c.get(e.styleset)),
i;if(a)for(var f=0;f<a.length;f++)a[f].fontSize=g,a[f].name===b[e.selectedKey]&&(i=a[f]);c.put(e.styleset,JSON.stringify(a));j.processSettings(i)}.bind(this))}};return{ThemePreferences:g}});
define("orion/editor/eventTarget",[],function(){function g(){}g.addMixin=function(k){var j=g.prototype,e;for(e in j)j.hasOwnProperty(e)&&(k[e]=j[e])};g.prototype={addEventListener:function(g,j,e){if(!this._eventTypes)this._eventTypes={};var c=this._eventTypes[g];c||(c=this._eventTypes[g]={level:0,listeners:[]});c.listeners.push({listener:j,useCapture:e})},dispatchEvent:function(g){var j=g.type;this._dispatchEvent("pre"+j,g);this._dispatchEvent(j,g);this._dispatchEvent("post"+j,g)},_dispatchEvent:function(g,
j){var e=this._eventTypes?this._eventTypes[g]:null;if(e){var c=e.listeners;try{if(e.level++,c)for(var b=0,a=c.length;b<a;b++)if(c[b]){var i=c[b].listener;typeof i==="function"?i.call(this,j):i.handleEvent&&typeof i.handleEvent==="function"&&i.handleEvent(j)}}finally{if(e.level--,e.compact&&e.level===0){for(b=c.length-1;b>=0;b--)c[b]||c.splice(b,1);c.length===0&&delete this._eventTypes[g];e.compact=!1}}}},isListening:function(g){return!this._eventTypes?!1:this._eventTypes[g]!==void 0},removeEventListener:function(g,
j,e){if(this._eventTypes){var c=this._eventTypes[g];if(c){for(var b=c.listeners,a=0,i=b.length;a<i;a++){var f=b[a];if(f&&f.listener===j&&f.useCapture===e){c.level!==0?(b[a]=null,c.compact=!0):b.splice(a,1);break}}b.length===0&&delete this._eventTypes[g]}}}};return{EventTarget:g}});
define("orion/editor/textTheme",["require","orion/editor/eventTarget","orion/util"],function(g,k,j){function e(b){b=b||{};this._document=b.document||document}var c={};e.getTheme=function(b){var b=b||"default",a=c[b];a||(a=c[b]=new e);return a};e.prototype={getThemeClass:function(){return this._themeClass},setThemeClass:function(b,a){var c=this,f=c._themeClass;c._themeClass=b;this._load(b,a,function(){c.onThemeChanged({type:"ThemeChanged",oldValue:f,newValue:c.getThemeClass()})})},onThemeChanged:function(b){return this.dispatchEvent(b)},
buildStyleSheet:function(b,a){function c(a,h,i){h&&(f.push("."+b+" ."+a+" {"),f.push("\t"+(i?"background-color":"color")+": "+h+";"),f.push("}"))}var f=[];f.push("");f.push("."+b+" {");a.fontFamily&&f.push("\tfont-family: "+a.fontFamily+";");a.fontSize&&f.push("\tfont-size: "+a.fontSize+";");a.fontSize&&f.push("\tcolor: "+a.text+";");f.push("}");f.push("."+b+".textview {");a.background&&f.push("\tbackground-color: "+a.background+";");f.push("}");c("ruler.annotations",a.annotationRuler,!0);c("ruler.lines",
a.annotationRuler,!0);c("ruler.folding",a.annotationRuler,!0);c("ruler.overview",a.overviewRuler,!0);c("rulerLines",a.lineNumber,!1);c("rulerLines.even",a.lineNumberEven,!1);c("rulerLines.odd",a.lineNumberOdd,!1);c("annotationLine.currentLine",a.currentLine,!0);c("entity-name-tag",a.keyword,!1);c("entity-other-attribute-name",a.attribute,!1);c("string-quoted",a.string,!1);c("line_caret",a.currentLine,!0);c("token_keyword",a.keyword,!1);c("token_string",a.string,!1);c("token_singleline_comment",a.comment,
!1);c("token_multiline_comment",a.comment,!1);c("token_doc_comment",a.comment,!1);c("token_doc_html_markup",a.comment,!1);return f.join("\n")},_createStyle:function(b,a,c,f){var d=this._document,b="orion-theme-"+b,h=d.getElementById(b);if(h){if(f||h.firstChild.data===a)return;h.removeChild(h.firstChild);h.appendChild(d.createTextNode(a))}else f?(h=j.createElement(d,"link"),h.rel="stylesheet",h.type="text/css",h.href=a,h.addEventListener("load",function(){c()})):(h=j.createElement(d,"style"),h.appendChild(d.createTextNode(a))),
h.id=b,(d.getElementsByTagName("head")[0]||d.documentElement).appendChild(h);f||c()},_load:function(b,a,c){if(b)if(typeof a==="string")this._createStyle(b,a,c);else if(a=a.href,a.substring(a.length-4)!==".css"&&(a+=".css"),/^\//.test(a)||/[a-zA-Z0-9]+:\/\//i.test(a)||!g.toUrl)this._createStyle(b,a,c,!0);else{var f=this;g(["text!"+a],function(a){f._createStyle(b,a,c,!1)})}else c()}};k.EventTarget.addMixin(e.prototype);return{TextTheme:e}});
define("orion/widgets/themes/ThemeClass",[],function(){function g(g){this.attributes=[];this.element=document.createElement("div");this.style=this.element.style;this.className=g;this.classString="."+g+"{ "}g.prototype.className=null;g.prototype.classString=void 0;g.prototype.style=void 0;g.prototype.closeString=" }\n";g.prototype.toString=function(){return this.classString=this.classString+this.style.cssText+this.closeString};return{ThemeClass:g}});
define("orion/widgets/themes/container/ThemeSheetWriter",["orion/widgets/themes/ThemeClass"],function(g){function k(){}k.prototype.navbar="#333";k.prototype.button="#777777";k.prototype.location="#EFEFEF";k.prototype.selection="FEC";k.prototype.sidepanel="#FBFBFB";k.prototype.mainpanel="white";k.prototype.navtext="#bfbfbf";k.prototype.content="#3087B3";k.prototype.search="#444";k.prototype.toolpanel="white";k.prototype.writeNavigationStyle=function(){var j="",e=[],c=new g.ThemeClass("orionPage");
c.style.backgroundColor="#fdfdfd";c.style.width="100%";c.style.height="100%";e.push(c);c=new g.ThemeClass("topRowBanner");c.style.margin="0";c.style.border="0";c.style.backgroundColor=this.navbar;c.style.height="15px";c.style.padding="10px";c.style.paddingRight="3px";e.push(c);c=new g.ThemeClass("a");c.style.textDecoration="none";c.style.color=this.content;e.push(c);c=new g.ThemeClass("navlink");c.style.display="inline-block";c.style.padding="2px";c.style.color=this.content;e.push(c);c=new g.ThemeClass("primaryNav");
c.style.color=this.navtext;c.style.fontSize="8pt";c.style.fontWeight="normal";c.style.paddingTop="0";c.style.verticalAlign="baseline";e.push(c);c=new g.ThemeClass("primaryNav a");c.style.fontSize="8pt";c.style.color=this.navtext;c.style.marginRight="6px";c.style.marginLeft="6px";c.style.verticalAlign="baseline";c.style.textDecoration="none";e.push(c);c=new g.ThemeClass("primaryNav a:hover");c.style.color="#bfbfbf";c.style.cursor="hand";c.style.color="white";c.style.fontWeight="normal";e.push(c);for(var b in e)j+=
e[b].toString();return j};k.prototype.writeLocationStyle=function(){var j="",e=[],c=new g.ThemeClass("titleArea");c.style.margin="0";c.style.paddingTop="5px";c.style.border="0";c.style.background=this.location;c.style.background="-webkit-gradient(linear, left top, left bottom, color-stop(0%,"+this.location+"), color-stop(100%,"+this.location+"))";c.style.borderBottom="1px solid "+this.location;c.style.minHeight="20px";e.push(c);c=new g.ThemeClass("breadcrumb");c.style.fontSize="8pt";c.style.textDecoration=
"none";c.style.color="#f1f1f2;";c.style.paddingTop="2px";e.push(c);c=new g.ThemeClass("a.breadcrumb:hover");c.style.textDecoration="none";c.style.borderBottom="1px dotted";c.style.color="#F58B0F";c.style.cursor="pointer";e.push(c);c=new g.ThemeClass("breadcrumbSeparator");c.style.fontSize="8pt";c.style.textDecoration="none";c.style.color="#f1f1f2";c.style.fontWeight="bold";e.push(c);c=new g.ThemeClass("currentLocation");c.style.fontWeight="bold";c.style.fontSize="8pt";c.style.color="#f1f1f2";c.style.textDecoration=
"none";c.style.textWrap="normal";c.style.lineHeight="10pt";e.push(c);c=new g.ThemeClass("a.currentLocation:hover");c.style.fontWeight="bold";c.style.fontSize="10pt";c.style.color="#666666";c.style.textDecoration="none";c.style.borderBottom="0";e.push(c);c=new g.ThemeClass("navlinkonpage");c.style.color=this.content;e.push(c);c=new g.ThemeClass("progressPane_running");c.style.background="url(../images/progress_running_dark.gif) no-repeat center";c.style.width="16px";c.style.height="16px";e.push(c);
for(var b in e)j+=e[b].toString();return j};k.prototype.writeButtonStyle=function(){var j="",e=[],c=new g.ThemeClass("commandButton");c.style.color="#666";c.style.border="1px solid #dedede";c.style.backgroundColor="#ddd";c.style.textAlign="center";c.style.verticalAlign="baseline";c.style.cursor="pointer";c.style.display="inline-block";c.style.padding="5px 6px";c.style.borderRadius="3px";c.style.lineHeight="12px";c.style.fontSize="8pt";c.style.userSelect="none";e.push(c);c=new g.ThemeClass("commandButton:over");
c.style.backgroundColor="#e6e6e6";c.style.border="1px solid #808080";e.push(c);c=new g.ThemeClass("commandMenu");c.style.color="#222";c.style.display="inline-block";c.style.verticalAlign="baseline";c.style.margin="0";c.style.fontSize="8pt";c.style.fontWeight="normal";c.style.border="1px solid #dedede";c.style.backgroundColor="#efefef";c.style.cursor="pointer";c.style.borderRadius="1px";e.push(c);c=new g.ThemeClass("commandMenuItem");c.style.border="0";c.style.padding="0";c.style.margin="0";e.push(c);
for(var b in e)j+=e[b].toString();return j};k.prototype.writeMainStyle=function(){var j="",e=[],c=new g.ThemeClass("searchbox");c.style.backgroundImage="url(../images/core_sprites.png)";c.style.backgroundRepeat="no-repeat";c.style.backgroundPosition="4px -297px";c.style.width="12px";c.style.height="12px";c.style.backgroundColor=this.search;c.style.border="1px solid "+this.search;c.style.fontSize="11px";c.style.width="15em";c.style.height="16px";c.style.borderRadius="10px";c.style.color="#999";c.style.padding=
"0";c.style.paddingLeft="20px";c.style.marginLeft="5px";c.style.marginTop="6px !important";c.style.font="7pt Lucida Sans Unicode,Lucida Grande,Verdana,Arial,Helvetica,Myriad,Tahoma,clean,sans-serif !important";e.push(c);c=new g.ThemeClass("searchbox:focus");c.style.color="white";c.style.outline="none";e.push(c);c=new g.ThemeClass("checkedRow");c.style.cssText="background-color:"+this.selection+" !important;";e.push(c);c=new g.ThemeClass("navbar-item-selected");c.style.background=this.selection;c.style.color=
this.content;e.push(c);c=new g.ThemeClass("auxpane");c.style.border="0";c.style.background=this.sidepanel;c.style.background="-webkit-gradient(linear, left top, left bottom, color-stop(0%,"+this.sidepanel+"), color-stop(100%,"+this.sidepanel+"))";c.style.background="-moz-linear-gradient(top, "+this.sidepanel+" 0%, "+this.sidepanel+" 100%)";e.push(c);c=new g.ThemeClass("mainpane");c.style.background=this.mainpanel;c.style.border=0;e.push(c);c=new g.ThemeClass("mainToolbar");c.style.background=this.toolpanel;
c.style.height="34px";c.style.borderBottom="1px solid #ebebeb";c.style.paddingTop="2px";e.push(c);for(var b in e)j+=e[b].toString();return j};k.prototype.render=function(){console.log(this.writeNavigationStyle());console.log(this.writeLocationStyle());console.log(this.writeMainStyle());console.log(this.writeButtonStyle())};k.prototype.getSheet=function(g){g.navbar.value?(this.navbar=g.navbar.value,this.button=g.button.value,this.location=g.location.value,this.selection=g.selection.value,this.sidepanel=
g.sidepanel.value,this.mainpanel=g.mainpanel.value,this.navtext=g.navtext.value,this.search=g.search.value,this.content=g.content.value,this.toolpanel=g.toolpanel.value):(this.navbar=g.navbar,this.button=g.button,this.location=g.location,this.selection=g.selection,this.sidepanel=g.sidepanel,this.mainpanel=g.mainpanel,this.navtext=g.navtext,this.search=g.search,this.content=g.content,this.toolpanel=g.toolpanel);return this.writeNavigationStyle()+this.writeLocationStyle()+this.writeMainStyle()+this.writeButtonStyle()};
return{ThemeSheetWriter:k}});
define("orion/widgets/themes/container/ThemeData",["orion/editor/textTheme","orion/widgets/themes/container/ThemeSheetWriter"],function(g,k){function j(){}function e(){this.styles=[];var b=new j;b.name="Orion";b.navbar="#333";b.button="#EFEFEF";b.location="#efefef";b.selection="FEC";b.sidepanel="#FBFBFB";b.mainpanel="white";b.toolpanel="white";b.navtext="#bfbfbf";b.content="#3087B3";b.search="#444";b.breadcrumb="#3087B3";b.separator="#333";this.styles.push(b);b=new j;b.name="Green Zone";b.navbar=
"seagreen";b.button="lavender";b.location="darkseagreen";b.selection="moccasin";b.sidepanel="aliceblue";b.mainpanel="white";b.toolpanel="white";b.navtext="#FBFBFB";b.content="darkgreen";b.search="darkgreen";b.breadcrumb="#3087B3";b.separator="seagreen";this.styles.push(b);b=new j;b.name="Pretty In Pink";b.navbar="plum";b.button="lavender";b.location="pink";b.selection="lavender";b.sidepanel="seashell";b.mainpanel="white";b.toolpanel="white";b.navtext="#FBFBFB";b.content="mediumorchid";b.search="violet";
b.breadcrumb="#3087B3";b.separator="plum";this.styles.push(b);b=new j;b.name="Blue Monday";b.navbar="cornflowerblue";b.button="lavender";b.location="skyblue";b.selection="lavender";b.sidepanel="aliceblue";b.mainpanel="white";b.toolpanel="white";b.navtext="#FBFBFB";b.content="royalblue";b.search="royalblue";b.breadcrumb="#3087B3";b.separator="cornflowerblue";this.styles.push(b);b=new j;b.name="Vanilla Skies";b.navbar="sandybrown";b.button="lemmonchiffon";b.location="cornsilk";b.selection="lemonchiffon";
b.sidepanel="white";b.mainpanel="white";b.toolpanel="white";b.navtext="lemonchiffon";b.content="chocolate";b.search="moccasin";b.breadcrumb="#3087B3";b.separator="sandybrown";this.styles.push(b);b=new j;b.name="Beetlejuice";b.navbar="indigo";b.button="slateblue";b.location="darkslateblue";b.selection="silver";b.sidepanel="lavender";b.mainpanel="white";b.toolpanel="white";b.navtext="#FBFBFB";b.content="mediumslateblue";b.search="#444";b.breadcrumb="#3087B3";b.separator="indigo";this.styles.push(b);
b=new j;b.name="Red";b.navbar="#CD2127";b.button="#777777";b.location="#D85F56";b.selection="lightcoral";b.sidepanel="#EFDAB2";b.mainpanel="#FDFADD";b.toolpanel="#FDFADD";b.navtext="#FBFBFB";b.content="darkred";b.search="#D85F56";b.breadcrumb="darkred";b.separator="#CD2127";this.styles.push(b)}function c(){return this.styles}j.prototype.name="Orion";j.prototype.navbar="#333";j.prototype.button="#EFEFEF";j.prototype.location="#333";j.prototype.breadcrumb="#3087B3";j.prototype.separator="#333";j.prototype.selection=
"FEC";j.prototype.sidepanel="#FBFBFB";j.prototype.mainpanel="white";j.prototype.toolpanel="white";j.prototype.navtext="#bfbfbf";j.prototype.content="#3087B3";j.prototype.search="#444";e.prototype.styles=[];e.prototype.getStyles=c;e.prototype.getThemeStorageInfo=function(){return{storage:"/themes",styleset:"styles",defaultTheme:"Orion",selectedKey:"selected"}};e.prototype.getViewData=function(){for(var b={top:10,left:10,width:350,height:350,shapes:[{type:"RECTANGLE",name:"Navigation Bar",x:10,y:10,
width:350,height:32,family:"navbar",fill:"#333",order:1},{type:"TEXT",name:"Navigation Text",label:"UserName",x:290,y:30,family:"navtext",fill:"#bfbfbf",font:"8pt sans-serif"},{type:"ROUNDRECTANGLE",name:"Search Box",x:215,y:20,width:70,height:12,family:"search",fill:"#444",order:3},{type:"RECTANGLE",name:"Tool Panel",x:150,y:71,width:209,height:30,family:"toolpanel",fill:"white",order:4},{type:"RECTANGLE",name:"Selection Bar",x:155,y:133,width:200,height:20,family:"selection",fill:"#FEC",order:7},
{type:"RECTANGLE",name:"Location",x:10,y:42,width:350,height:29,family:"location",fill:"#efefef",order:8},{type:"TEXT",name:"Navigation Text",label:"Navigator",x:60,y:30,family:"navtext",fill:"#bfbfbf",font:"8pt sans-serif",order:2},{type:"TEXT",name:"Content",label:"Breadcrumb",x:15,y:60,family:"content",fill:"#3087B3",font:"8pt sans-serif"},{type:"TEXT",name:"Content",label:"/",x:78,y:60,family:"content",fill:"#3087B3",font:"8pt sans-serif",order:9},{type:"TEXT",name:"Content",label:"Location",
x:84,y:60,family:"content",fill:"#3087B3",font:"8pt sans-serif"},{type:"RECTANGLE",name:"Main Panel",x:150,y:101,width:209,height:258,family:"mainpanel",fill:"white",order:6},{type:"ROUNDRECTANGLE",name:"Button",x:155,y:76,width:37,height:20,family:"button",fill:"#EFEFEF",order:11},{type:"TEXT",name:"Button Text",label:"Button",x:158,y:90,family:"navbar",fill:"#333",font:"8pt sans-serif"},{type:"TRIANGLE",name:"userMenu",x1:353,y1:24,x2:347,y2:24,x3:350,y3:29,family:"userMenu",fill:"#BFBFBF"},{type:"TRIANGLE",
name:"userMenu",x1:20,y1:88,x2:26,y2:88,x3:23,y3:93,family:"userMenu",fill:"#BFBFBF"},{type:"TEXT",name:"Section Text",label:"Section",x:30,y:94,family:"navbar",fill:"#333",font:"8pt sans-serif"},{type:"LINE",name:"Line Color",x1:150,y1:101,x2:360,y2:101,linewidth:2,fill:"#DEDEDE"},{type:"LINE",name:"Line Color",x1:150,y1:71,x2:150,y2:360,linewidth:2,fill:"#DEDEDE"},{type:"LINE",name:"Line Color",x1:20,y1:100,x2:140,y2:100,linewidth:2,fill:"#DEDEDE"},{type:"RECTANGLE",name:"Side Panel",x:10,y:71,
width:140,height:289,family:"sidepanel",fill:"#FBFBFB",order:12},{type:"TRIANGLE",name:"userMenu",x1:353,y1:24,x2:347,y2:24,x3:350,y3:29,family:"userMenu",fill:"#BFBFBF"},{type:"TRIANGLE",name:"userMenu",x1:20,y1:88,x2:26,y2:88,x3:23,y3:93,family:"userMenu",fill:"#BFBFBF"},{type:"TEXT",name:"Navigation Text",label:"Navigator",x:60,y:30,family:"navtext",fill:"#bfbfbf",font:"8pt sans-serif",order:2},{type:"TRIANGLE",name:"userMenu",x1:353,y1:24,x2:347,y2:24,x3:350,y3:29,family:"userMenu",fill:"#BFBFBF"},
{type:"TRIANGLE",name:"userMenu",x1:20,y1:88,x2:26,y2:88,x3:23,y3:93,family:"userMenu",fill:"#BFBFBF"}]},a=0;a<3;a++)b.shapes.push({type:"TEXT",name:"content",label:"org.eclipse.orion.content",x:170,y:127+20*a,fill:"#3087B3",family:"content"});for(a=0;a<3;a++)b.shapes.push({type:"TEXT",name:"content",label:"Item",x:25,y:115+20*a,fill:"#3087B3",family:"content"});for(a=0;a<3;a++)b.shapes.push({type:"TRIANGLE",name:"twisty",x1:160,y1:121+a*20,x2:165,y2:124+a*20,x3:160,y3:127+a*20,family:"navbar",fill:"#333"});
b.shapes.push({type:"IMAGE",name:"logo",x:15,y:18,source:"../../images/orion-transparent.png",family:"logo"});return b};e.prototype.processSettings=function(b){var a=new k.ThemeSheetWriter;(new g.TextTheme.getTheme("orionTheme")).setThemeClass("orionTheme",a.getSheet(b))};return{ThemeData:e,getStyles:c}});
define("orion/widgets/nls/root/messages",{"no input":"no input","no output":"no output","Choose a Folder":"Choose a Folder",OK:"OK",Profile:"Profile","Sign out":"Sign out","N/A":"N/A","logged in since ":"logged in since ","Sign in":"Sign in","Authentication required!":"Authentication required!","Name:":"Name:","Plug-ins":"Plug-ins"," <No available services or timed out, check URL and try reloading>":" <No available services or timed out, check URL and try reloading>",Properties:"Properties"," (Service Id: ":" (Service Id: ",
Services:"Services","SFTP Transfer":"SFTP Transfer","Remote host:":"Remote host:","Port:":"SFTP Port:","Remote path:":"Remote path:","User name:":"User name:","Password:":"Password:","Start Transfer":"Start Transfer","Location:":"Location:","orion.sftpConnections":"orion.sftpConnections","Drag a file here":"Drag a file here","unzip zips":"Unzip *.zip files","or if you prefer":"(or upload a file using the buttons below)",Upload:"Upload","Browse...":"Browse...","Import a file or zip":"Import a file or zip",
"Missing required argument: searchRenderer":"Missing required argument: searchRenderer","Missing required argument: favService":"Missing required argument: favService","Find File Named":"Find File Named","Type the name of a file to open (? = any character, * = any string):":"Type the name of a file to open (? = any character, * = any string):",Search:"Search","Populating favorites...":"Populating favorites...",Favorite:"Favorite","Searching...":"Searching...","Searching for occurrences of":'Searching for occurrences of: "${0}"',
name:"name","orion.widgets.UserMenu":"orion.widgets.UserMenu",test:"test","Sign Out":"Sign Out","Sign Out ":"Sign Out ","</a>":"</a>",">":">","Sign In To ":"Sign In To ","Sign In":"Sign In",Help:"Help","Keyboard Shortcuts":"Keyboard Shortcuts",Settings:"Settings","View profile of ":"View profile of ",Profiles:"Profiles","Information Needed":"Information Needed",Cancel:"Cancel","If the same file exists in both the source and destination:":"If the same file exists in both the source and destination:",
"Cancel the transfer":"Cancel the transfer","Always overwrite destination":"Always overwrite destination","Overwrite if source is newer":"Overwrite if source is newer",New:"New","Building file skeleton...":"Building file skeleton...",Add:"Add","Upload...":"Upload...","For a list of available commands type '${0}'.":"For a list of available commands type '${0}'."});
define("orion/widgets/nls/messages",["orion/i18n!orion/widgets/nls/messages","orion/widgets/nls/root/messages"],function(g,k){var j={root:k};Object.keys(g).forEach(function(e){typeof j[e]==="undefined"&&(j[e]=g[e])});return j});
define("orion/widgets/UserMenu",["i18n!orion/widgets/nls/messages","require","orion/webui/littlelib","orion/PageLinks"],function(g,k,j,e){function c(b){this._displaySignOut=!0;this._init(b)}c.prototype={_init:function(b){this._dropdownNode=j.node(b.dropdownNode);if(!this._dropdownNode)throw"no dom node for dropdown found";this._dropdown=b.dropdown;this._serviceRegistry=b.serviceRegistry;this.authenticatedServices={};this.unauthenticatedServices={};this._noSeparator=b.noSeparator;this._dropDownItemClass=
b.dropDownItemClass;this._keyAssistClass=b.keyAssistClass;if(b.signOut!==void 0)this._displaySignOut=b.signOut},isSingleService:function(){return this.length(this.unauthenticatedServices)+this.length(this.authenticatedServices)===1},hasServices:function(){return this.length(this.unauthenticatedServices)+this.length(this.authenticatedServices)>0},length:function(b){var a=0,c;for(c in b)b.hasOwnProperty(c)&&a++;return a},_makeMenuItem:function(b,a){var c=document.createElement("span");c.role="menuitem";
c.tabIndex=0;var f=document.createTextNode(b);c.appendChild(f);typeof this._dropDownItemClass==="string"?this._dropDownItemClass!==""&&c.classList.add(this._dropDownItemClass):c.classList.add("dropdownMenuItem");c.addEventListener("click",a,!1);c.addEventListener("keydown",function(d){(d.keyCode===j.KEY.ENTER||d.keyCode===j.KEY.SPACE)&&a()},!1);return c},_renderAuthenticatedService:function(b){var a=this,c=this.authenticatedServices[b].authService;if(c&&c.logout&&this._displaySignOut){var f=document.createElement("li"),
d=this._makeMenuItem(g["Sign Out"],function(){c.logout().then(function(){a.addUserItem(b,c,a.authenticatedServices[b].label);localStorage.removeItem(b);localStorage.removeItem("lastLogin");for(var d=localStorage.length-1;d>=0;d--){var f=localStorage.key(d);f&&f.indexOf("/orion/preferences/user")===0&&localStorage.removeItem(f)}c.getAuthForm(window.location.href).then(function(a){window.location=a})})});f.appendChild(d);this._dropdownNode.appendChild(f)}},renderServices:function(){function b(f){c[f]||
(c[f]=a.createDocumentFragment());return c[f]}var a=document,c=[];e.getPageLinksInfo(this._serviceRegistry,"orion.page.link.user").then(function(f){this._dropdown?this._dropdown.empty():this._dropdownNode&&j.empty(this._dropdownNode);f.forEach(function(d){var f=b(typeof d.category==="number"?d.category:1),h=a.createElement("li"),c=a.createElement("a");c.role="menuitem";typeof this._dropDownItemClass==="string"?this._dropDownItemClass!==""&&c.classList.add(this._dropDownItemClass):c.classList.add("dropdownMenuItem");
c.href=d.href;c.textContent=d.textContent;h.appendChild(c);f.appendChild(h)}.bind(this));if(this.keyAssistFunction){var f=document.createElement("li"),d=this._makeMenuItem(g["Keyboard Shortcuts"],this.keyAssistFunction);typeof this._keyAssistClass==="string"?this._keyAssistClass!==""&&d.classList.add(this._keyAssistClass):d.classList.add("key-assist-menuitem");f.appendChild(d);b(0).appendChild(f)}var h=this;c.sort(function(a,d){return a-d}).forEach(function(a,d){if(d<c.length-1&&!this._noSeparator){var f=
document.createElement("li");f.classList.add("dropdownSeparator");var b=document.createElement("span");b.classList.add("dropdownSeparator");f.appendChild(b);a.appendChild(f)}h._dropdownNode.appendChild(a)}.bind(this));if(this.isSingleService())for(var e in this.authenticatedServices)this.authenticatedServices.hasOwnProperty(e)&&this._renderAuthenticatedService(e,0)}.bind(this))},setKeyAssist:function(b){this.keyAssistFunction=b;this.renderServices()},addUserItem:function(b,a,c,f){f?(this.unauthenticatedServices[b]&&
delete this.unauthenticatedServices[b],this.authenticatedServices[b]={authService:a,label:c,data:f}):(this.authenticatedServices[b]&&delete this.authenticatedServices[b],this.unauthenticatedServices[b]=this.unauthenticatedServices[b]?{authService:a,label:c,pending:this.unauthenticatedServices[b].pending}:{authService:a,label:c});this.renderServices()}};c.prototype.constructor=c;return{UserMenu:c}});
define("orion/crawler/nls/root/messages",{"Searching file:":"Searching file:","is not supported in this file system":"is not supported in this file system","${0} files found out of ${1}":"${0} files found out of ${1}","The search term on this location will not use indexed files.":"The search term on this location will not use indexed files.","It will take longer time. Do you want to proceed?":"It will take longer time. Do you want to proceed?"});
define("orion/crawler/nls/messages",["orion/i18n!orion/crawler/nls/messages","orion/crawler/nls/root/messages"],function(g,k){var j={root:k};Object.keys(g).forEach(function(e){typeof j[e]==="undefined"&&(j[e]=g[e])});return j});
define("orion/searchUtils","i18n!orion/nls/messages,require,orion/editor/regex,orion/commandRegistry,orion/PageUtil,orion/URITemplate".split(","),function(g,k,j,e,c,b){function a(a,d,h){var b="";h&&(b="^");if(b=j.parse("/"+b+a.searchStr+"/"))h=b.pattern,b=b.flags,b.indexOf("i")===-1&&!d.caseSensitive&&(b+="i"),a.regExp={pattern:h,flags:b},a.wildCard=!0}var i={ALL_FILE_TYPE:"*.*"};i.doSearch=function(a,d,h,b){if(a){var c=!0;h==="*"&&(h="");h===""&&(c=b&&b.type!==i.ALL_FILE_TYPE);if(c){h!==""&&i.addRecentSearch(d,
h,b?b.regEx:!1);var a=a.createSearchParams(h,!1,!1,b),e=i.generateSearchHref(a);i.getOpenSearchPref(d,function(a){a?window.open(e):window.location=e})}}else window.alert(g["Can't search: no search service is available"])};i.generateSearchHelper=function(f,d){var h=f.keyword,b=h,c={};f.fileType&&f.fileType!==i.ALL_FILE_TYPE&&h===""&&(b="*."+f.fileType);if(f.regEx)c.searchStr=h,a(c,f,d);else{var e=h.indexOf("*")>-1,g=h.indexOf("?")>-1;e&&(h=h.split("*").join(".*"));g&&(h=h.split("?").join("."));!e&&
!g&&!f.nameSearch?(c.searchStr=f.caseSensitive?h.split("\\").join(""):h.split("\\").join("").toLowerCase(),c.wildCard=!1):(c.searchStr=f.caseSensitive?h:h.toLowerCase(),a(c,f,d),c.wildCard=!0)}c.searchStrLength=c.searchStr.length;return{params:f,inFileQuery:c,displayedSearchTerm:b}};i.convertSearchParams=function(a){if(a.rows!==void 0)a.rows=parseInt(a.rows,10);if(a.start!==void 0)a.start=parseInt(a.start,10);if(typeof a.regEx==="string")a.regEx=a.regEx.toLowerCase()==="true";if(typeof a.caseSensitive===
"string")a.caseSensitive=a.caseSensitive.toLowerCase()==="true";if(typeof a.nameSearch==="string")a.nameSearch=a.nameSearch.toLowerCase()==="true"};i.copySearchParams=function(a,d){var h={},b;for(b in a)if(a[b]!==void 0&&a[b]!==null&&(d||b!=="replace"))h[b]=a[b];return h};i.generateSearchHref=function(a){var d=k.toUrl("search/search.html"),a=i.copySearchParams(a,!0),h=a.resource;a.resource=void 0;return(new b(d+"#{,resource,params*}")).expand({resource:h,params:a})};i.generateFindURLBinding=function(a,
d,h,c){a={find:d.searchStr,regEx:d.wildCard?!0:void 0,caseSensitive:a.caseSensitive?!0:void 0,replaceWith:typeof c==="string"?c:void 0,atLine:typeof h==="number"?h:void 0};return","+(new b("{,params*}")).expand({params:a})};i.convertFindURLBinding=function(a){if(typeof a.regEx==="string")a.regEx=a.regEx.toLowerCase()==="true";if(typeof a.caseSensitive==="string")a.caseSensitive=a.caseSensitive.toLowerCase()==="true";if(typeof a.atLine==="string")a.atLine=parseInt(a.atLine,10)};i.replaceRegEx=function(a,
d,h){return a.replace(RegExp(d.pattern,d.flags),h)};i.replaceStringLiteral=function(a,d,h){d=j.parse("/"+d+"/gim");return i.replaceRegEx(a,d,h)};i.searchOnelineLiteral=function(a,d,h){var b;b=0;for(var c=!1,i=[];;)if(b=d.indexOf(a.searchStr,b),b<0)break;else{i.push({startIndex:b,length:a.searchStrLength});c=!0;if(h)break;b+=a.searchStrLength}return c?i:null};i.findRegExp=function(a,d,b,c){if(!d)return null;b=b||"";b+=(b.indexOf("g")===-1?"g":"")+(b.indexOf("m")===-1?"m":"");var i=null;return(i=RegExp(d,
b).exec(a.substring(c)))&&{startIndex:i.index+c,length:i[0].length}};i.searchOnelineRegEx=function(a,d,b){for(var c=0,e=!1,g=[];;)if(c=i.findRegExp(d,a.regExp.pattern,a.regExp.flags,c)){g.push(c);e=!0;if(b)break;c=c.startIndex+c.length}else break;return e?g:null};i.generateNewContents=function(a,d,b,c,e,g){if(c&&d){if(!a)b.contents=[];for(var j=0;j<d.length;j++){for(var k=d[j],p=!1,r=!1,t=[],o,v=0,x=0;x<c.children.length;x++)if(c.children[x].lineNumber-1===j){v=x;for(p=0;p<c.children[x].matches.length;p++)c.children[x+
p].checked!==!1&&t.push(p);r=t.length>0;o=c.children[x].matches;p=!0;break}if(p){if(r){t=i.replaceCheckedMatches(k,e,o,t,g);k=t.replacedStr;for(p=0;p<c.children[v].matches.length;p++)c.children[v+p].newMatches=t.newMatches}else for(p=0;p<c.children[v].matches.length;p++)c.children[v+p].newMatches=c.children[v+p].matches;a?b.contents[j]=k:b.contents.push(k)}else a||b.contents.push(k)}}};i.generateMatchContext=function(a,d,b){var c=[],i=a*2+1,e;d.length<=i?(e=0,a=d.length-1):(e=b-a,e<0?(e=0,a=e+i-1):
(a=b+a,a>d.length-1&&(a=d.length-1,e=a-i+1)));for(i=e;i<=a;i++)c.push({context:d[i],current:i===b});return c};i.splitFile=function(a){for(var d=0,b=0,c=0,i=0,e=[];;){d!==-1&&d<=c&&(d=a.indexOf("\r",c));b!==-1&&b<=c&&(b=a.indexOf("\n",c));if(b===-1&&d===-1){e.push(a.substring(i));break}var g=1;d!==-1&&b!==-1?d+1===b?(g=2,c=b+1):c=(d<b?d:b)+1:c=d!==-1?d+1:b+1;e.push(a.substring(i,c-g));i=c}return e};i.searchWithinFile=function(a,d,b,c,e,g){b=i.splitFile(b);if(e)d.contents=b;if(d){d.children=[];for(var j=
c=0;j<b.length;j++){var k=b[j];if(k&&k.length>0){var p=g?k:k.toLowerCase();if(p=a.wildCard?i.searchOnelineRegEx(a,p):i.searchOnelineLiteral(a,p)){var r,t=j+1;if(e)for(var o=0;o<p.length;o++)r=o+1,r={parent:d,checked:d.checked,type:"detail",matches:p,lineNumber:t,matchNumber:r,name:k,location:d.location+"-"+t+"-"+r},d.children.push(r);else r={parent:d,context:i.generateMatchContext(2,b,j),checked:d.checked,type:"detail",matches:p,lineNumber:t,name:k,location:d.location+"-"+t},d.children.push(r);c+=
p.length}}}d.totalMatches=c}};i.replaceCheckedMatches=function(a,d,b,c,i){for(var e=0,g="",j=[],k=0;k<b.length;k++){e!==b[k].startIndex&&(g+=a.substring(e,b[k].startIndex));if(b[k].length)i=b[k].length;for(var e=!1,r=0;r<c.length;r++)if(c[r]===k){e=!0;break}e?(j.push({startIndex:g.length,length:d.length}),g+=d):(j.push({startIndex:g.length,length:i}),g+=a.substring(b[k].startIndex,b[k].startIndex+i));e=b[k].startIndex+i}e<a.length&&(g+=a.substring(e));return{replacedStr:g,newMatches:j}};i.fullPathNameByMeta=
function(a){var d=a.length,b="";if(d>0)for(d-=1;d>-1;d--)b=b+(b===""?"":"/")+a[d].Name;return b};i.path2FolderName=function(a,d,b){return a.substring(0,a.length-d.length-(b?0:1))};i._storeRecentSearch=function(a,d,b){a.getService("orion.core.preference").getPreferences("/window/favorites").then(function(a){a.put("recentSearch",d);b&&window.setTimeout(function(){b.dispatchEvent({type:"recentSearchesChanged"})}.bind(this),20)})};i.addRecentSearch=function(a,d,b){typeof d==="string"&&d&&a.getService("orion.core.preference").getPreferences("/window/favorites").then(function(c){var e,
c=c.get("recentSearch");typeof c==="string"&&(c=JSON.parse(c));if(c){for(e in c)if(c[e].name===d)return;c.length>=20&&c.splice(19,c.length-20+1)}else c=[];c.splice(0,0,{name:d,regEx:b});i._storeRecentSearch(a,c)})};i.removeRecentSearch=function(a,d,b){typeof d==="string"&&d&&a.getService("orion.core.preference").getPreferences("/window/favorites").then(function(c){var e,c=c.get("recentSearch");typeof c==="string"&&(c=JSON.parse(c));if(c)for(e in c)if(c[e].name===d){c.splice(e,1);i._storeRecentSearch(a,
c,b);break}})};i.getSearches=function(a,d,b){a.getService("orion.core.preference").getPreferences("/window/favorites").then(function(a){a=a.get(d);typeof a==="string"&&(a=JSON.parse(a));a&&b&&b(a)})};i.getMixedSearches=function(a,d,b,c){a.getService("orion.core.preference").getPreferences("/window/favorites").then(function(a){var f=a.get("recentSearch");typeof f==="string"&&(f=JSON.parse(f));d&&(a=a.get("search"),typeof a==="string"&&(a=JSON.parse(a)),a&&a.forEach(function(a){if(b){var d=i.parseQueryStr(a.query);
f.some(function(a){return d.searchStrTitle===a.name})||f.push({name:d.searchStrTitle,label:a.name})}else f.push({name:null,label:a.name,value:a.query})}));f&&c&&c(f)})};i.getOpenSearchPref=function(a,d){a.getService("orion.core.preference").getPreferences("/cm/configurations").then(function(a){a=a.get("nav.config");d(a&&a["links.newtab"]!=="undefined"?a["links.newtab"]?!0:!1:!1)})};i.setOpenSearchPref=function(a,d){a.getService("orion.core.preference").getPreferences("/window/favorites").then(function(a){a.put("openSearchPref",
{openInNewTab:d})})};return i});
define("orion/crawler/searchCrawler","i18n!orion/crawler/nls/messages,require,orion/i18nUtil,orion/searchUtils,orion/contentTypes,orion/Deferred".split(","),function(g,k,j,e,c,b){function a(a,f,d,b){this.registry=a;this.fileClient=f;this.fileLocations=[];this.fileSkeleton=[];this._totalCounter=this._hitCounter=0;this._searchOnName=b&&b.searchOnName;this._buildSkeletonOnly=b&&b.buildSkeletonOnly;this._fetchChildrenCallBack=b&&b.fetchChildrenCallBack;this._searchParams=d;this.searchHelper=this._searchOnName||
this._buildSkeletonOnly?null:e.generateSearchHelper(d);this._location=b&&b.location;this._childrenLocation=b&&b.childrenLocation?b.childrenLocation:this._location}a.prototype.search=function(a){var f=this.registry.getService("orion.core.contenttypes");this._onSearchComplete=a;f.getContentTypes().then(function(a){this.contentTypesCache=a;this._visitRecursively(this._childrenLocation).then(function(){this._sort(this.fileLocations);this._onSearchComplete({response:{numFound:this.fileLocations.length,
docs:this.fileLocations}})}.bind(this))}.bind(this))};a.prototype.searchName=function(a,f){if(a)this.searchHelper=e.generateSearchHelper(a,!0);if(f)this.onSearchNameComplete=f;var d=[];this._sort(this.fileSkeleton);if(this.fileSkeleton.length>0){for(var b=0;b<this.fileSkeleton.length;b++){var c=this.fileSkeleton[b].Name.toLowerCase();if(this.searchHelper.inFileQuery.wildCard?e.searchOnelineRegEx(this.searchHelper.inFileQuery,c,!0):e.searchOnelineLiteral(this.searchHelper.inFileQuery,c,!0))if(d.push(this.fileSkeleton[b]),
d.length>=this.searchHelper.params.rows)break}this.onSearchNameComplete({response:{numFound:d.length,docs:d}})}};a.prototype.buildSkeleton=function(a,f){this._buildingSkeleton=!0;var d=this.registry.getService("orion.core.contenttypes"),b=this;a();d.getContentTypes().then(function(a){b.contentTypesCache=a;b._visitRecursively(b._childrenLocation).then(function(){b._buildingSkeleton=!1;f();b.searchHelper&&!b._buildSkeletonOnly&&b.searchName()})})};a.prototype._searchCompleted=function(){console.log("Search Completed.")};
a.prototype._searchFiles=function(){var a=[],f;if(this.fileLocations.length>0){f=this;for(var d=0;d<f.fileLocations.length;d++)a.push(f._sniffSearch(f.fileLocations[d]))}return b.all(a)};a.prototype._sort=function(a){a.sort(function(a,d){var b=a.Name&&a.Name.toLowerCase(),c=d.Name&&d.Name.toLowerCase();return b<c?-1:b>c?1:0})};a.prototype._onFileType=function(a){return this.searchHelper.params.fileType?this.searchHelper.params.fileType===e.ALL_FILE_TYPE?!0:a.extension.indexOf(this.searchHelper.params.fileType)>=
0:!0};a.prototype._visitRecursively=function(a){var f=[],d=this;this._fetchChildrenCallBack&&this._fetchChildrenCallBack(a);var h=d.registry.getService("orion.page.progress");return(h?h.progress(d.fileClient.fetchChildren(a),"Crawling search for children of "+a):d.fileClient.fetchChildren(a)).then(function(a){for(var h=0;h<a.length;h++)if(a[h].Directory!==void 0&&a[h].Directory===!1)if(d._searchOnName)f.push(d._buildSingleSkeleton(a[h]));else if(d._buildSkeletonOnly)f.push(d._buildSingleSkeleton(a[h]));
else{var i=c.getFilenameContentType(a[h].Name,d.contentTypesCache);i&&(i["extends"]==="text/plain"||i.id==="text/plain")&&d._onFileType(i)&&f.push(d._sniffSearch(a[h]))}else a[h].Location&&f.push(d._visitRecursively(a[h].ChildrenLocation));return b.all(f)})};a.prototype._hitOnceWithinFile=function(a){a=this._searchParams.caseSensitive?a:a.toLowerCase();return this.searchHelper.inFileQuery.wildCard?e.searchOnelineRegEx(this.searchHelper.inFileQuery,a,!0):e.searchOnelineLiteral(this.searchHelper.inFileQuery,
a,!0)};a.prototype._reportSingleHit=function(a){a.LastModified=a.LocalTimeStamp;this.fileLocations.push(a);this._hitCounter++;this._sort(this.fileLocations);this._onSearchComplete({response:{numFound:this.fileLocations.length,docs:this.fileLocations}},!0)};a.prototype._sniffSearch=function(a){this._totalCounter++;var f=this;if(this.searchHelper.params.keyword==="")this._reportSingleHit(a),this.registry.getService("orion.page.message").setProgressResult({Message:j.formatMessage(g["${0} files found out of ${1}"],
this._hitCounter,this._totalCounter)});else return this.registry.getService("orion.page.progress").progress(f.fileClient.read(a.Location),"Reading file "+a.Location).then(function(d){f._hitOnceWithinFile(d)&&f._reportSingleHit(a);f.registry.getService("orion.page.message").setProgressResult({Message:j.formatMessage(g["${0} files found out of ${1}"],f._hitCounter,f._totalCounter)})},function(a){console.error("Error loading file content: "+a.message)})};a.prototype._buildSingleSkeleton=function(a){this._totalCounter++;
this.fileSkeleton.push(a);this.searchHelper&&!this._buildSkeletonOnly&&this._totalCounter%100===0&&this.searchName();a=new b;a.resolve(this._totalCounter);return a};a.prototype.constructor=a;return{SearchCrawler:a}});
define("orion/webui/dialog",["i18n!orion/widgets/nls/messages","require","orion/webui/littlelib","orion/uiUtils"],function(g,k,j,e){function c(){}c.prototype={DISABLED:"disabled",CONTAINERTEMPLATE:'<div class="dialog" role="dialog"><div class="dialogTitle"><span id="title" class="dialogTitleText layoutLeft"></span><button aria-label="Close" class="dismissButton layoutRight core-sprite-close imageSprite" id="closeDialog"></button></div><div id="dialogContent" class="dialogContent layoutBlock"></div><div id="buttons" class="dialogButtons"></div></div>',_initialize:function(){var b=
document.body;this.$frameParent=b;this.$$modalExclusions=this.$$modalExclusions||[];var a=document.createRange();a.selectNode(b);a=a.createContextualFragment(this.CONTAINERTEMPLATE);b.appendChild(a);this.$frame=b.lastChild;this.title&&j.$("#title",this.$frame).appendChild(document.createTextNode(this.title));this.$close=j.$("#closeDialog",this.$frame);var c=this;this.$close.addEventListener("click",function(){c.hide()},!1);this.$parent=j.$(".dialogContent",this.$frame);a=document.createRange();a.selectNode(this.$parent);
b=a.createContextualFragment(this.TEMPLATE);this.messages&&j.processTextNodes(b,this.messages);this.$parent.appendChild(b);this.$buttonContainer=j.$(".dialogButtons",this.$frame);this._makeButtons();this.$frame.addEventListener("keydown",function(a){a.keyCode===j.KEY.ESCAPE?c.hide():a.keyCode===j.KEY.ENTER&&typeof c._defaultCallback==="function"&&c._defaultCallback()},!1);this._bindElements(this.$parent);typeof this._bindToDom==="function"&&this._bindToDom(this.$parent);this.modal&&this._makeModal()},
_makeButtons:function(){if(this.$buttonContainer&&Array.isArray(this.buttons)){var b=this;this.buttons.forEach(function(a){var c=e.createButton(a.text,a.callback);if(a.id)c.id=a.id,b["$"+c.id]=c;if(a.isDefault)b._defaultCallback=a.callback,b._defaultButton=c;b.$buttonContainer.appendChild(c)})}},_makeModal:function(){var b=this;this.$frame.addEventListener("blur",function(a){b.$lastFocusedElement=a.target},!0);this._modalListener=function(a){var d=!j.contains(b.$frame,a.target);if(d)for(var f=0;f<
b.$$modalExclusions.length;f++)if(j.contains(b.$$modalExclusions[f],a.target)){d=!1;break}d&&(window.setTimeout(function(){(b.$lastFocusedElement||b.$parent).focus()},0),j.stop(a))};this.$frameParent.addEventListener("focus",this._modalListener,!0);this.$frameParent.addEventListener("click",this._modalListener,!0);var a=this.$frameParent.childNodes,c=!1;this._addedBackdrop=[];for(var f=0;f<a.length;f++){for(var d=0;d<this.$$modalExclusions.length;d++)if(j.contains(this.$$modalExclusions[d],a[f])){c=
!0;break}!c&&a[f]!==b.$frame&&a[f].classList&&!a[f].classList.contains("tooltipContainer")&&(d=a[f],d.classList.contains("modalBackdrop")||(d.classList.add("modalBackdrop"),this._addedBackdrop.push(d)))}(a=j.lastTabbable(this.$buttonContainer)||j.lastTabbable(this.$parent))&&a.addEventListener("keydown",function(a){if(a.keyCode===j.KEY.TAB){var d=b._getFirstFocusField();d&&d!==a.target&&d.focus();j.stop(a)}},!1)},_addChildDialog:function(b){this.$$modalExclusions.push(b.$frame||b.$parent)},_bindElements:function(b){for(var a=
0;a<b.childNodes.length;a++){var c=b.childNodes[a];c.id&&(this["$"+c.id]=c);this._bindElements(c)}},hide:function(){typeof this._beforeHiding==="function"&&this._beforeHiding();this._modalListener&&(this.$frameParent.removeEventListener("focus",this._modalListener,!0),this.$frameParent.removeEventListener("click",this._modalListener,!0));this.$frame.classList.remove("dialogShowing");typeof this._afterHiding==="function"&&this._afterHiding();var b=this;this.keepAlive||window.setTimeout(function(){b.destroy()},
0)},show:function(b){typeof this._beforeShowing==="function"&&this._beforeShowing();var a=j.bounds(this.$frame),c=j.bounds(document.documentElement),f;b?(f=j.bounds(b),b=f.top+f.height+4,f=f.left+4,b+a.height>c.height&&(b=Math.max(0,c.height-a.height-4)),f+a.width>c.width&&(f=Math.max(0,c.width-a.width-4))):(f=Math.max(0,(c.width-a.width)/2),b=Math.max(0,(c.height-a.height)/2));this.$lastFocusedElement=document.activeElement;this.$frame.style.top=b+"px";this.$frame.style.left=f+"px";this.$frame.classList.add("dialogShowing");
typeof this._afterShowing==="function"&&this._afterShowing();this.customFocus||this._getFirstFocusField().focus()},_getFirstFocusField:function(){return j.firstTabbable(this.$parent)||this._defaultButton||j.firstTabbable(this.$buttonContainer)||this.$close},destroy:function(){this._addedBackdrop&&this._addedBackdrop.length>0&&this._addedBackdrop.forEach(function(b){b.classList.remove("modalBackdrop")});this.$frameParent.removeEventListener("focus",this._modalListener,!0);this.$frameParent.removeEventListener("click",
this._modalListener,!0);this.$frameParent.removeChild(this.$frame);this.$parent=this.$frame=void 0}};c.prototype.constructor=c;return{Dialog:c}});
define("orion/webui/dialogs/OpenResourceDialog","i18n!orion/widgets/nls/messages,orion/crawler/searchCrawler,orion/contentTypes,require,orion/webui/littlelib,orion/util,orion/webui/dialog".split(","),function(g,k,j,e,c,b,a){function i(a){this._init(a)}i.prototype=new a.Dialog;i.prototype.TEMPLATE='<div role="search"><div><label id="fileNameMessage" for="fileName">${Type the name of a file to open (? = any character, * = any string):}</label></div><div><input id="fileName" type="text" class="setting-control" style="width:90%;"/></div><div id="progress" style="padding: 2px 0 0; width: 100%;"><img src="'+e.toUrl("../../../images/progress_running.gif")+
'" class="progressPane_running_dialog" id="crawlingProgress"></img></div><div id="favresults" style="max-height:400px; height:auto; overflow-y:auto;"></div><div id="results" style="max-height:400px; height:auto; overflow-y:auto;" aria-live="off"></div><div id="statusbar"></div></div>';i.prototype._init=function(a){this.title=a.title||g["Find File Named"];this.modal=!0;this.messages=g;this._searcher=a.searcher;this._progress=a.progress;this._onHide=a.onHide;this._contentTypeService=new j.ContentTypeService(this._searcher.registry);
if(!this._searcher)throw Error("Missing required argument: searcher");this._searchDelay=a.searchDelay||500;this._time=0;this._searcher.setCrawler(null);this._forceUseCrawler=!1;this._initialText=a.initialText;this._message=a.message;this._nameSearch=!0;if(a.nameSearch!==void 0)this._nameSearch=a.nameSearch;this._searchOnRoot=!0;this._fileService=this._searcher.getFileService();if(!this._fileService)throw Error(g["Missing required argument: fileService"]);this._searchRenderer=a.searchRenderer;if(!this._searchRenderer||
typeof this._searchRenderer.makeRenderFunction!=="function")throw Error(g["Missing required argument: searchRenderer"]);this._favService=a.favoriteService;if(!this._favService)throw Error(g["Missing required argument: favService"]);this._initialize()};i.prototype._bindToDom=function(a){var d=this;d.$crawlingProgress.style.display="none";this.$fileName.setAttribute("placeholder",g.Search);this.$fileName.addEventListener("input",function(){d._time=+new Date;d._timeoutId&&clearTimeout(d._timeoutId);
d._timeoutId=setTimeout(d.checkSearch.bind(d),0)},!1);this.$fileName.addEventListener("keydown",function(a){if(a.keyCode===c.KEY.ENTER){var f=c.$("a",d.$results);f&&(c.stop(a),window.open(f.href),d.hide())}},!1);a.addEventListener("keydown",function(a){var f,b,e,i,g;if(a.keyCode===c.KEY.DOWN||a.keyCode===c.KEY.UP)b=c.$$array("a",d.$results),f=c.$$array("a",d.$favresults),e=document.activeElement,g=b.indexOf(e),i=f.indexOf(e),a.keyCode===c.KEY.DOWN?i>=0?(i<f.length-1?f[i+1]:b.length>0?b[0]:f[0]).focus():
g>=0?(g<b.length-1?b[g+1]:f.length>0?f[0]:b[0]).focus():(b.length>0||f.length>0)&&(-1<f.length-1?f[0]:b[0]).focus():i>=0?(e=d.$fileName,(i>0?f[i-1]:e).focus()):g>=0?(e=d.$fileName,(g>0?b[g-1]:f.length>0?f[f.length-1]:e).focus()):b.length>0?b[b.length-1].focus():f.length>0&&f[f.length-1].focus(),c.stop(a)});a.addEventListener("mouseup",function(a){a.target.focus()},!1);this.populateFavorites();setTimeout(function(){if(d._forceUseCrawler||!d._fileService.getService(d._searcher.getSearchLocation()).search){var a=
d._searchOnRoot?d._searcher.getSearchRootLocation():d._searcher.getChildrenLocation(),a=new k.SearchCrawler(d._searcher.registry,d._fileService,"",{searchOnName:!0,location:a});d._searcher.setCrawler(a);a.buildSkeleton(function(){d.$crawlingProgress.style.display="inline";d.$progress.appendChild(document.createTextNode(g["Building file skeleton..."]))},function(){d.$crawlingProgress.style.display="none";d.$progress.removeChild(d.$progress.lastChild)})}},0);this._message&&(this.$fileNameMessage.removeChild(this.$fileNameMessage.firstChild),
this.$fileNameMessage.appendChild(document.createTextNode(this._message)));if(this._initialText)this.$fileName.value=this._initialText,this.doSearch()};i.prototype.populateFavorites=function(){var a=document.createElement("div");a.appendChild(document.createTextNode(g["Populating favorites&#x2026;"]));c.empty(this.$favresults);this.$favresults.appendChild(a);this._progress?this._progress.progress(this._favService.getFavorites(),"Getting favorites").then(this.showFavorites()):this._favService.getFavorites().then(this.showFavorites());
this._favService.addEventListener("favoritesChanged",this.showFavorites())};i.prototype.showFavorites=function(){var a=this;return function(d){if(d.navigator)d=d.navigator;a._searchRenderer.makeRenderFunction(a._contentTypeService,a.$favresults,!1,a.decorateResult.bind(a),a.showFavoritesImage)(d);if(d&&d.length>0)d=document.createElement("div"),d.style.borderBottom="1px dashed #BBBBBB",d.style.padding="5px",a.$favresults.appendChild(d)}};i.prototype.showFavoritesImage=function(a){var d=new Image;
d.classList.add("modelDecorationSprite");d.classList.add("core-sprite-favorite");d.src=e.toUrl("images/none.png");d.title=g.Favorite;a.appendChild(d);d.style.verticalAlign="middle"};i.prototype.checkSearch=function(){clearTimeout(this._timeoutId);var a=(new Date).getTime();a-this._time>this._searchDelay?(this._time=a,this.doSearch()):this._timeoutId=setTimeout(this.checkSearch.bind(this),50)};i.prototype.doSearch=function(){var a=this.$fileName.value;if(a){var d=this._searcher.createSearchParams(a,
this._nameSearch,this._searchOnRoot),h=this._searchRenderer.makeRenderFunction(this._contentTypeService,this.$results,!1,this.decorateResult.bind(this));this.currentSearch=h;var e=document.createElement("div");e.appendChild(document.createTextNode(this._nameSearch?g["Searching..."]:b.formatMessage(g["Searching for occurrences of"],a)));c.empty(this.$results);this.$results.appendChild(e);this._searcher.search(d,!1,function(){h===this.currentSearch&&h.apply(null,arguments)}.bind(this))}};i.prototype.decorateResult=
function(a){for(var d=this,a=c.$$array("a",a),b=0;b<a.length;b++){var e=a[b];e.addEventListener("mouseup",function(a){a.button===0&&!a.ctrlKey&&!a.metaKey&&d.hide()},!1);e.addEventListener("keyup",function(a){a.keyCode===c.KEY.ENTER&&d.hide()},!1)}};i.prototype._beforeHiding=function(){clearTimeout(this._timeoutId)};i.prototype._afterHiding=function(){this._onHide&&this._onHide()};i.prototype.constructor=i;return{OpenResourceDialog:i}});define("text!orion/banner/banner.html",[],function(){return'<header id="banner" role="banner">\n\t<\!-- Requires some js code to bind the home link, link to progress image, and binding NLS variables  --\>\n\t<\!-- Top row:  Logo + discovery links + search + user --\>\n\t<div id="staticBanner" class="layoutBlock topRowBanner"> <\!-- primaryNav --\>\n\t\t<a id="home" class="layoutLeft "></a>\n\t\t<nav id="primaryNav" class="bannerLeftArea" role="navigation">\n\t\t\t<div class="centralNavigation" id="centralNavigation" tabindex="0" role="button" style="margin-top:0;"></div>\n\t\t</nav>\n\t\t<div class="clear navigationBreadcrumb bannerMiddleArea" >\n\t\t\t<div id="location" class="currentLocation"></div>\n\t\t</div>\n\t\t<div class="bannerRightArea">\n\t\t\t<div id="globalActions" class="spacingLeft layoutLeft"></div>\n\t\t\t<input type="text" id="search" autocomplete="off" class="layoutLeft spacingLeft searchbox" role="search" style="display:none;">\n\t\t\t<div id="searchOptions" class="layoutLeft" style="padding-top:1px;display:none;"></div>\n\t\t\t<div id="userMenu" class="spacingRight layoutRight" style="color:#ccc;">\n\t\t\t\t<img class="progressPane" id="progressPane" tabindex="0" role="progressbar"></img>\n\t\t\t\t<span id="userTrigger" tabindex="0" role="button" class="dropdownTrigger">\n\t\t\t\t\t<span class="dropdownArrowEmpty"></span>\n\t\t\t\t</span>\n\t\t\t\t<ul id="userDropdown" class="dropdownMenu" role="menu"></ul>\n\t\t\t</div>\n\t\t</div>\n\t</div>\n\t<div id="notificationArea" class="notificationHide">\n\t\t<div class="layoutLeft" id="notifications" aria-live="assertive" aria-atomic="true"></div>\n\t\t<div class="layoutRight"><button aria-label="Close" class="dismissButton layoutRight core-sprite-close imageSprite" type="button" id="closeNotifications"></span></div>\n\t</div>\n</header>'});
define("text!orion/banner/footer.html",[],function(){return'<footer id="footerContent" class="layoutBlock footerLayout" role="contentinfo">\n\t<\!-- Requires some js code to bind the NLS variables  --\>\n\t<div class="logoFooter commandSprite core-sprite-orion-logo"></div>\n\t<div class="footerBlock">${Orion is in Beta. Please try it out but BEWARE your data may be lost.}</div>\n\t<div class="footerRightBlock">\n\t\t<ul>\n\t\t\t<\!-- <li><a href="http://wiki.eclipse.org/Orion/FAQ" target="_blank">${FAQ}</a></li --\>\n\t\t\t<li><a href="https://bugs.eclipse.org/bugs/enter_bug.cgi?product=Orion&version=3.0" target="_blank">${Report a Bug}</a>\n\t\t\t<li><a href="http://www.eclipse.org/legal/privacy.php" target="_blank">${Privacy Policy}</a></li>\n\t\t\t<li><a href="http://www.eclipse.org/legal/termsofuse.php" target="_blank">${Terms of Use}</a></li>\n\t\t\t<li><a href="http://www.eclipse.org/legal/copyright.php" target="_blank">${Copyright Agent}</a></li>\n\t\t</ul>\n\t</div>\n</footer>'});
define("text!orion/banner/toolbar.html",[],function(){return'<ul class="layoutLeft commandList pageActions" id="pageActions"></ul>\n<ul class="layoutLeft commandList pageActions" id="selectionTools"></ul>\n<ul class="layoutLeft commandList pageActions" id="navActions"></ul>\n<div class="layoutLeft" style="padding-left:7px;padding-right:7px;margin-top:2px;" id="filterBox" style="visibility:hidden;">\n</div>\n<div class="layoutRight" style="padding-left:7px;margin-left:4px;margin-top:6px;" id="settingsTab" style="visibility:hidden;">\n\t<button class="layoutRight core-sprite-wrench imageSprite" id="settingsAction" aria-live="off" style="visibility:hidden;"></button>\n</div>\n<div class="layoutRight status" id="statusPane" role="status" aria-live="off"></div>\n<ul class="layoutRight commandList pageActions" id="pageNavigationActions"></ul>'});
define("orion/objects",[],function(){return{mixin:function(g){Array.prototype.slice.call(arguments,1).forEach(function(k){for(var j=Object.keys(k),e=0;e<j.length;e++){var c=j[e];g[c]=k[c]}})}}});
define("orion/widgets/input/DropDownMenu",["orion/objects","orion/webui/littlelib"],function(g,k){function j(e,c,b){this.CLEAR_PANEL=b!==null?b:!0;this.OPEN="false";b="";e.nodeType?this.node=e:(b=e+"_",e=document.getElementById(e),this.node=e.nodeType?e:document.createElement("span"));this.node.innerHTML=this.templateString;this.navLabelId=b+"navigationlabel";document.getElementById("navigationlabel").id=this.navLabelId;this.arrowId=b+"dropDownArrow";document.getElementById("dropDownArrow").id=this.arrowId;
this.navDropDownId=b+"navdropdown";document.getElementById("navdropdown").id=this.navDropDownId;if(c.icon)this.node.className=this.node.className+" "+c.icon,this.node.onclick=this.click.bind(this);else{if(c.label)e=document.getElementById(this.navLabelId),e.textContent=c.label,e.onclick=this.click.bind(this);if(c.caret)document.getElementById(this.arrowId).className=c.caret}this._dropdownNode=k.node(this.navDropDownId);this._triggerNode=k.node(this.navLabelId)}g.mixin(j.prototype,{templateString:'<div id="navigationlabel" class="navigationLabel dropdownTrigger" ></div><span id="dropDownArrow" class="dropDownArrow"></span><div class="dropDownContainer" id="navdropdown" style="display:none;"></div>',
click:function(){var e=document.getElementById(this.navDropDownId);e.style.display==="none"?this.updateContent(this.getContentNode(),function(){e.style.display="";this._positionDropdown();this.handle=k.addAutoDismiss([this.node,e],this.clearPanel.bind(this))}.bind(this)):this.CLEAR_PANEL&&this.clearPanel()},clearPanel:function(){document.getElementById(this.navDropDownId).style.display="none"},addContent:function(e){document.getElementById(this.navDropDownId).innerHTML=e},getContentNode:function(){return document.getElementById(this.navDropDownId)},
updateContent:function(e,c){c()},toggleLabel:function(e){document.getElementById(this.navLabelId).style.display=e?"":"none";document.getElementById(this.arrowId).style.display=e?"":"none"},_positionDropdown:function(){this._dropdownNode.style.left="";var e=k.bounds(this._dropdownNode),c=k.bounds(this._boundingNode(this._triggerNode));if(e.left+e.width>c.left+c.width)this._dropdownNode.style.right=0},_boundingNode:function(e){return e.style.right!==""||e.style.position==="absolute"||!e.parentNode||
!e.parentNode.style?e:this._boundingNode(e.parentNode)},destroy:function(){if(this.node)k.empty(this.node),this.node=this.select=null}});return j});
define("orion/widgets/input/GroupedContent",["orion/objects","orion/webui/littlelib"],function(g){function k(){}g.mixin(k.prototype,{templateString:'<div style="float:left;"><section><span style="color:#333;padding:15px;">Main Pages</span><nav><ul id="navigationlinks"></ul></nav></section></div><div class="groupedContentDivider"></div><div style="float:left;"><section><span style="color:#333;padding:15px;">Related Links</span><nav><ul id="relatedLinks"></ul></nav></section></div>',getContentPane:function(){return this.templateString}});
return k});define("orion/customGlobalCommands",[],function(){return{}});
define("orion/navigate/nls/root/messages",{"Click one of the tasks below to create an Orion folder.  You can upload, import, or generate files.":"Click one of the tasks below to create an Orion folder.  You can upload, import, or generate files.","Toggle Left Pane":"Toggle Left Pane","Open or close the left pane":"Open or close the left pane",Navigator:"Navigator","Strings Xtrnalizr":"Strings Xtrnalizr","Externalize Strings from JavaScript files in this folder":"Externalize Strings from JavaScript files in this folder","Choose a Folder":"Choose a Folder",
"Copy of ${0}":"Copy of ${0}","Enter a new name for '${0}'":"Enter a new name for '${0}'","Choose folder...":"Choose folder...",Rename:"Rename","Rename the selected files or folders":"Rename the selected files or folders","Compare with each other":"Compare with each other","Compare the selected 2 files with each other":"Compare the selected 2 files with each other","Compare with...":"Compare with...","Compare the selected folder with a specified folder":"Compare the selected folder with a specified folder",
Delete:"Delete","Unknown item":"Unknown item","Make Favorite":"Make Favorite","Delete the selected files or folders":"Delete the selected files or folders","Are you sure you want to delete these ${0} items?":"Are you sure you want to delete these ${0} items?","Are you sure you want to delete '${0}'?":"Are you sure you want to delete '${0}'?","Are you sure you want to delete '${0}' from the favorites?":"Are you sure you want to delete '${0}' from the favorites?","Are you sure you want to delete these ${0} favorites?":"Are you sure you want to delete these ${0} favorites?",
"You can create favorites by selecting any file or folder in the navigator and choosing ${0} from the ${1} menu.":"You can create favorites by selecting any file or folder in the navigator and choosing ${0} from the ${1} menu.","Export as zip":"Export as zip","Create a zip file of the folder contents and download it":"Create a zip file of the folder contents and download it","New File":"New File","Create a new file":"Create a new file","Name:":"Name:","New Folder":"New Folder","Folder name:":"Folder name:",
"Create a new folder":"Create a new folder","Creating folder":"Creating folder",Folder:"Folder","Create an empty folder":"Create an empty folder","Create an empty folder on the Orion server.  You can import, upload, or create content in the editor.":"Create an empty folder on the Orion server.  You can import, upload, or create content in the editor.","Sample HTML5 Site":"Sample HTML5 Site","Generate a sample":"Generate a sample",'Generate an HTML5 "Hello World" website, including JavaScript, HTML, and CSS files.':'Generate an HTML5 "Hello World" website, including JavaScript, HTML, and CSS files.',
"Creating a folder for ${0}":"Creating a folder for ${0}","SFTP Import":"SFTP Import","Import content from SFTP":"Import content from SFTP","Import content from an SFTP location into an Orion folder.  You will be prompted for the SFTP location and credentials.":"Import content from an SFTP location into an Orion folder.  You will be prompted for the SFTP location and credentials.","Imported Content":"Imported Content","Upload a Zip":"Upload a Zip","Upload content from a local zip file":"Upload content from a local zip file",
"Upload content from a local zip file into an Orion folder.  You will be prompted for the local zip file.":"Upload content from a local zip file into an Orion folder.  You will be prompted for the local zip file.","Uploaded Content":"Uploaded Content","Creating an upload folder for ":"Creating an upload folder for ","Clone Git Repository":"Clone Git Repository","Clone a git repository":"Clone a git repository","Go to the Orion repositories page to provide a git repository URL.  Once the repository is created, it will appear in the Navigator.":"Go to the Orion repositories page to provide a git repository URL.  Once the repository is created, it will appear in the Navigator.",
"Link to Server":"Link to Server","Link to existing content on the server":"Link to existing content on the server","Create a folder that links to an existing folder on the server.":"Create a folder that links to an existing folder on the server.","Server path:":"Server path:","The name and server location were not specified.":"The name and server location were not specified.","Go Up":"Go Up","Move up to the parent folder":"Move up to the parent folder","Import local file...":"Import local file...",
"Copy files and folders from your local file system":"Copy files and folders from your local file system","SFTP from...":"SFTP from...","Copy files and folders from a specified SFTP connection":"Copy files and folders from a specified SFTP connection","Importing from ${0}":"Importing from ${0}","SFTP to...":"SFTP to...","Copy files and folders to a specified SFTP location":"Copy files and folders to a specified SFTP location",Exporting:"Exporting to ${0}","Pasting ${0}":"Pasting ${0}","Copy to":"Copy to",
"Move to":"Move to","Copying ${0}":"Copying ${0}","Moving ${0}":"Moving ${0}","Renaming ${0}":"Renaming ${0}","Deleting ${0}":"Deleting ${0}","Creating ${0}":"Creating ${0}","Linking to ${0}":"Linking to ${0}","Move files and folders to a new location":"Move files and folders to a new location","Copy Items":"Copy Items","Copy the selected items to the copy/paste buffer":"Copy the selected items to the copy/paste buffer","Paste Items":"Paste Items","Paste items from the copy/paste buffer":"Paste items from the copy/paste buffer",
"Cannot paste into the Workspace root":"Cannot paste into the Workspace root","Open With":"Open With","Loading ":"Loading ",New:"New",Actions:"Actions","Orion Content":"Orion Content"," is not supported in this file system":" is not supported in this file system","Create new content":"Create new content",Favorites:"Favorites","Import from HTTP...":"Import from HTTP...","File URL:":"File URL:","Copy a file from a URL and optionally unzip it":"Copy a file from a URL and optionally unzip it","Unzip *.zip files:":"Unzip *.zip files:",
"Extracted from:":"Extracted from:","Did not drop ${0}.  Folder drop is not supported in this browser.":"Did not drop ${0}.  Folder drop is not supported in this browser.","You cannot copy files directly into the workspace.  Create a folder first.":"You cannot copy files directly into the workspace.  Create a folder first.","Unzip ${0}?":"Unzip ${0}?",NoFile:"Use the ${0} to create new files and folders. Click a file to start coding."});
define("orion/navigate/nls/messages",["orion/i18n!orion/navigate/nls/messages","orion/navigate/nls/root/messages"],function(g,k){var j={root:k};Object.keys(g).forEach(function(e){typeof j[e]==="undefined"&&(j[e]=g[e])});return j});
define("orion/fileClient",["i18n!orion/navigate/nls/messages","orion/Deferred","orion/i18nUtil"],function(g,k,j){function e(a,b,f){if(!a[b])throw b+g[" is not supported in this file system"];return a[b].apply(a,f)}function c(a,b,f,d){if(!a.readBlob)throw g["source file service does not support binary read"];if(!f.writeBlob)throw g["target file service does not support binary write"];if(b[b.length-1]!=="/")return e(a,"readBlob",[b]).then(function(a){return e(f,"writeBlob",[d,a])});var h=d.substring(0,
d.length-1),l=decodeURIComponent(h.substring(h.lastIndexOf("/")+1)),h=h.substring(0,h.lastIndexOf("/")+1);return e(f,"createFolder",[h,l]).then(function(){},function(){}).then(function(){return e(a,"fetchChildren",[b]).then(function(b){for(var h=[],e=0;e<b.length;++e){var i=b[e].Location,l=i;b[e].Directory&&(l=i.substring(0,i.length-1));l=decodeURIComponent(l.substring(l.lastIndexOf("/")+1));l=d+encodeURIComponent(l);b[e].Directory&&(l+="/");h[e]=c(a,i,f,l)}return k.all(h)})})}function b(a,b){function f(a){var d=
new k;d.reject(g["No Matching FileService for location:"]+a);return d}var d=a.getServiceReferences("orion.core.file"),c=d;if(b)for(var c=[],e=0;e<d.length;++e)b(d[e])&&c.push(d[e]);for(var n=[],m=[],q=[],s=[],p={fetchChildren:function(){var a=new k;a.resolve(s);return a},createWorkspace:function(){var a=new k;a.reject(g["no file service"]);return a},loadWorkspaces:function(){var a=new k;a.reject(g["no file service"]);return a},loadWorkspace:function(){var a=new k;window.setTimeout(function(){a.resolve({Directory:!0,
Length:0,LocalTimeStamp:0,Name:g["File Servers"],Location:"/",Children:s,ChildrenLocation:"/"})},100);return a},search:f,createProject:f,createFolder:f,createFile:f,deleteFile:f,moveFile:f,copyFile:f,read:f,write:f},d=0;d<c.length;++d)s[d]={Directory:!0,Length:0,LocalTimeStamp:0,Location:c[d].getProperty("top"),ChildrenLocation:c[d].getProperty("top"),Name:c[d].getProperty("Name")},e=c[d].getProperty("pattern")||".*",e[0]!=="^"&&(e="^"+e),n[d]=RegExp(e),m[d]=a.getService(c[d]),q[d]=c[d].getProperty("Name"),
c[d].getProperty("NameKey")&&c[d].getProperty("nls")&&j.getMessageBundle(c[d].getProperty("nls")).then(function(a,d){s[a].Name=d[c[a].getProperty("NameKey")];q[a]=d[c[a].getProperty("NameKey")]}.bind(this,d));this._getServiceIndex=function(a){if(a==="/")return-1;else if(!a||a.length&&a.length===0)return m[0]?0:-1;for(var d=0;d<n.length;++d)if(n[d].test(a))return d;throw g["No Matching FileService for location:"]+a;};this._getService=function(a){a=this._getServiceIndex(a);return a===-1?p:m[a]};this._getServiceName=
function(a){a=this._getServiceIndex(a);return a===-1?p.Name:q[a]};this._getServiceRootURL=function(a){a=this._getServiceIndex(a);return a===-1?p.Location:s[a].Location}}b.prototype={getService:function(a){return this._getService(a)},fileServiceName:function(a){return this._getServiceName(a)},fileServiceRootURL:function(a){return this._getServiceRootURL(a)},fetchChildren:function(a){return e(this._getService(a),"fetchChildren",arguments)},createWorkspace:function(a){return e(this._getService(),"createWorkspace",
arguments)},loadWorkspaces:function(){return e(this._getService(),"loadWorkspaces",arguments)},loadWorkspace:function(a){return e(this._getService(a),"loadWorkspace",arguments)},createProject:function(a,b,f,d){return e(this._getService(a),"createProject",arguments)},createFolder:function(a,b){return e(this._getService(a),"createFolder",arguments)},createFile:function(a,b){return e(this._getService(a),"createFile",arguments)},deleteFile:function(a){return e(this._getService(a),"deleteFile",arguments)},
moveFile:function(a,b,f){var d=this._getService(a),h=this._getService(b);if(d===h)return e(d,"moveFile",arguments);var l=a[a.length-1]==="/",g=b;g[g.length-1]!=="/"&&(g+="/");if(f)g+=encodeURIComponent(f);else{var m=a;l&&(m=m.substring(0,m.length-1));g+=m.substring(m.lastIndexOf("/")+1)}l&&g[g.length-1]!=="/"&&(g+="/");return c(d,a,h,g).then(function(){return e(d,"deleteFile",[a])})},copyFile:function(a,b,f){var d=this._getService(a),h=this._getService(b);if(d===h)return e(d,"copyFile",arguments);
var l=a[a.length-1]==="/",g=b;g[g.length-1]!=="/"&&(g+="/");if(f)g+=encodeURIComponent(f);else{var m=a;l&&(m=m.substring(0,m.length-1));g+=m.substring(m.lastIndexOf("/")+1)}l&&g[g.length-1]!=="/"&&(g+="/");return c(d,a,h,g)},read:function(a,b){return e(this._getService(a),"read",arguments)},write:function(a,b,f){return e(this._getService(a),"write",arguments)},remoteImport:function(a,b){return e(this._getService(a),"remoteImport",arguments)},remoteExport:function(a,b){return e(this._getService(a),
"remoteExport",arguments)},search:function(a){return e(this._getService(a.resource),"search",arguments)}};b.prototype.constructor=b;return{FileClient:b}});
define("orion/globalCommands","i18n!orion/nls/messages,require,orion/commonHTMLFragments,orion/keyBinding,orion/commandRegistry,orion/commands,orion/parameterCollectors,orion/extensionCommands,orion/uiUtils,orion/keyBinding,orion/breadcrumbs,orion/webui/littlelib,orion/webui/splitter,orion/webui/dropdown,orion/webui/tooltip,orion/favorites,orion/contentTypes,orion/URITemplate,orion/PageUtil,orion/widgets/themes/ThemePreferences,orion/widgets/themes/container/ThemeData,orion/Deferred,orion/widgets/UserMenu,orion/PageLinks,orion/webui/dialogs/OpenResourceDialog,text!orion/banner/banner.html,text!orion/banner/footer.html,text!orion/banner/toolbar.html,orion/widgets/input/DropDownMenu,orion/widgets/input/GroupedContent,orion/util,orion/customGlobalCommands,orion/fileClient".split(","),function(g,
k,j,e,c,b,a,i,f,d,h,l,n,m,q,s,p,r,t,o,v,x,u,w,z,A,B,C,G,D,I,K,O){function P(a,d){if(a.getLabel)return a.getLabel();else{var f=new x;f.resolve(d.properties.name);return f}}function T(a){l.node("progressPane").setAttribute("aria-label",g["Operations - Press spacebar to show current operations"]);(a=a.getService("orion.page.progress"))&&a.init.bind(a)("progressPane")}function U(a,d){var f=a.getServiceReferences("orion.core.auth");Q=[];for(var b=J.createMenuGenerator.apply(this,arguments),c=0;c<f.length;c++){var h=
f[c],o=a.getService(h);P(o,h).then(function(a){o.getKey().then(function(d){Q.push(d);o.getUser().then(function(f){b.addUserItem(d,o,a,f)},function(f,c){b.addUserItem(d,o,a,c)});window.addEventListener("storage",function(){M[d]!==localStorage.getItem(d)&&(M[d]=localStorage.getItem(d),o.getUser().then(function(f){b.addUserItem(d,o,a,f)},function(){b.addUserItem(d,o,a)}))},!1)})})}}function y(a,d,f,c,h){var o=arguments,e,l=a&&a.getServiceReferences("orion.page.link.related");l&&l.length!==0&&x.when(function(){if(e)return e;
var d=a.getService("orion.core.contenttypes");d||(d=new p.ContentTypeService(a),d=a.getService("orion.core.contenttypes"));return d.getContentTypes().then(function(a){return e=a})}(),function(){var u;if(J.beforeGenerateRelatedLinks.apply(this,o)){for(var v=[],g=0;g<l.length;g++){var n={},m,j=l[g].getPropertyKeys();for(m=0;m<j.length;m++)n[j[m]]=l[g].getProperty(j[m]);if(n.id){var w=function(a){if(a)if(!a.visibleWhen||a.visibleWhen(d)){var f=new b.CommandInvocation(d,d,null,a,c);J.addRelatedLinkCommand(a,
f)}else typeof h==="function"&&(u||(u=h()),x.when(u,function(f){f&&d===N&&(!a.visibleWhen||a.visibleWhen(f))&&J.addRelatedLinkCommand(a,new b.CommandInvocation(f,f,null,a,c))}))},q=null;m=null;if(f.indexOf(n.id)<0)if((n.nls&&n.nameKey||n.name)&&n.uriTemplate)m=i._createCommandOptions(n,l[g],a,e,!0),v.push(m),m.then(function(a){a=new b.Command(a);w(a)});else{if(!q&&(q=c.findCommand(n.id))){w(q);continue}if(!q){var k=a.getServiceReferences("orion.navigate.command");for(m=0;m<k.length;m++)if(k[m].getProperty("id")===
n.id){for(var n={},j=k[m].getPropertyKeys(),A=0;A<j.length;A++)n[j[A]]=k[m].getProperty(j[A]);m=i._createCommandOptions(n,k[m],a,e,!0);v.push(m);m.then(function(a){q=new b.Command(a);w(q)});break}}}}}x.all(v,function(a){return a}).then(function(){J.afterGenerateRelatedLinks.apply(this,o)})}})}function E(a){var d=l.node("globalActions");d&&(a.destroy(d),a.renderCommands(d.id,d,{},{},"tool"))}function F(a){var d={},f=null;typeof a==="string"&&(a=l.node(a));a||(a=l.node("pageActions"));for(var b=a;b&&
b.classList;){if(b.classList.contains("toolComposite")){f=b;break}b=b.parentNode}if(a.classList.contains("commandMarker"))d.commandNode=a;if(f&&(d.slideContainer=l.$(".slideParameters",f),d.parameterArea=l.$(".parameters",f),d.dismissArea=l.$(".parametersDismiss",f),d.notifications=l.$("#notificationArea",f),f.parentNode&&(d.toolbarTarget=l.$(".toolbarTarget",f.parentNode),d.toolbarTarget)))a=l.bounds(f),d.toolbarTargetY=a.height+1;return d}function H(a){if(a.toolbarTarget&&a.toolbarTargetY){var d=
0,f;a.notifications&&a.notifications.classList.contains("slideContainerActive")&&(f=l.bounds(a.notifications),d+=f.height);a.slideContainer&&a.slideContainer.classList.contains("slideContainerActive")&&(f=l.bounds(a.slideContainer),d+=f.height);d>0&&(d+=8);a.toolbarTarget.style.top=a.toolbarTargetY+d+"px";a.toolbarTarget.style.bottom=0}}var c=function(a){var d=document.createElement("a");d.href=a;return d.href}(k.toUrl("auth/NotifyAuthentication.html")),M={},J={createMenuGenerator:K.createMenuGenerator||
function(a,d){if(l.node("userMenu")){var f=l.node("userDropdown"),b=new m.Dropdown({dropdown:f}),f=new u.UserMenu({dropdownNode:f,dropdown:b,serviceRegistry:a}),b=l.node("userTrigger");new q.Tooltip({node:b,text:g.Options,position:["below","left"]});var b=document.getElementById("userTrigger"),c=b.className;c+=" imageSprite core-sprite-silhouette";b.className=c;f.setKeyAssist(d);return f}},beforeGenerateRelatedLinks:K.beforeGenerateRelatedLinks||function(){var a=l.node("relatedLinks");l.empty(a);
return!0},addRelatedLinkCommand:K.addRelatedLinkCommand||function(a,d){var f=l.node("relatedLinks");b.createCommandMenuItem(f,a,d).classList.remove("dropdownMenuItem")},afterGenerateRelatedLinks:K.afterGenerateRelatedLinks||function(){},afterSetPageTarget:K.afterSetPageTarget||function(){},generateNavigationMenu:K.generateNavigationMenu||function(){var a=document.getElementById("centralNavigation");new q.Tooltip({node:a,text:"Navigation Menu",position:["right"]});var a=new G("centralNavigation",{label:"Develop",
icon:"commandSprite core-sprite-hamburger"}),d=new D;a.addContent(d.getContentPane())},afterGenerateBanner:K.afterGenerateBanner||function(){}},Q=[],N,S=[],L,R=null;return{addSettings:function(a){(new G("settingsTab",{label:"Develop",icon:"imageSprite core-sprite-wrench"},!1)).updateContent=a.updateContent.bind(a)},generateBanner:function(d,c,h,i,u,m,x){function q(){this.create();this._filterString=""}function G(a){a.registerService("orion.cm.managedservice",{updated:function(a){for(var a=a&&a["links.newtab"]!==
"undefined"?a["links.newtab"]?"_blank":"_self":"_self",d=l.$$array(".targetSelector"),f=0;f<d.length;f++)d[f].target=a}},{pid:"nav.config"})}(new o.ThemePreferences(i,new v.ThemeData)).apply();var p=l.node(d);if(!p)throw g["could not find banner parent, id was "]+d;var D=document.createRange();D.selectNode(p);D=D.createContextualFragment(A);l.processTextNodes(D,g);p.firstChild?p.insertBefore(D,p.firstChild):p.appendChild(D);p=l.node("home");p.href=k.toUrl("navigate/table.html");p.setAttribute("aria-label",
g["Orion Home"]);l.node("progressPane").src=k.toUrl("images/none.png");if(p=l.node("pageToolbar"))p.classList.add("toolbarLayout"),p.innerHTML=C+j.slideoutHTMLFragment("mainToolbar");(p=l.node("closeNotifications"))&&p.setAttribute("aria-label",g["Close notification"]);if(p=l.node("footer"))p.innerHTML=B,l.processTextNodes(p,g);h.setParameterCollector(new a.CommandParameterCollector(F,H));document.addEventListener("keydown",function(a){a.keyCode===l.KEY.ESCAPE&&(a=c.getService("orion.page.message"))&&
a.setProgressMessage("")},!1);J.generateNavigationMenu.apply(this,arguments);var r=l.node("navigationlinks");r&&w.createPageLinks(c,"orion.page.link").then(function(a){a.forEach(function(a){var d=document.createElement("li");d.appendChild(a);r.appendChild(d)})});if(p=l.$(".split")){var D=l.$(".sidePanelLayout"),K=l.$(".mainPanelLayout");if(D&&K)R={side:D,main:K},R.splitter=new n.Splitter({node:p,sidePanel:D,mainPanel:K,toggle:!0,closeByDefault:p.style&&p.style.left==="0%"}),p=new b.Command({name:g["Toggle side panel"],
tooltip:g["Open or close the side panel"],id:"orion.toggleSidePane",callback:function(){R.splitter.toggleSidePanel()}}),h.addCommand(p),h.registerCommandContribution("pageActions","orion.toggleSidePane",1,null,!0,new e.KeyBinding("o",!0)),x&&R.splitter.addResizeListener(function(a){x&&a===K&&(a=x.getTextView())&&a.resize()})}p=new b.Command({name:g["Make Favorite"],tooltip:g["Add to the favorites list"],imageClass:"core-sprite-favorite",id:"orion.makeFavorite",visibleWhen:function(a){a=Array.isArray(a)?
a:[a];if(a.length===0)return!1;for(var d=0;d<a.length;d++)if(!a[d].Location)return!1;return!0},callback:function(a){for(var a=Array.isArray(a.items)?a.items:[a.items],d=c.getService("orion.core.favorite"),f=c.getService("orion.page.progress"),b=function(a){return function(b){b?c.getService("orion.page.message").setMessage(a.Name+g[" is already a favorite."],2E3):f.progress(d.makeFavorites(a),"Making favorite "+a.Name)}},h=0;h<a.length;h++){var o=a[h];f.progress(d.hasFavorite(o.ChildrenLocation||o.Location),
"Checking favorite "+o.Name).then(b(o))}}});h.addCommand(p);var P=!1,t=function(a,d,f){if(!P){var b=d.getService("orion.core.favorite"),c=d.getService("orion.page.progress");b||(b=new s.FavoritesService({serviceRegistry:d}),b=d.getService("orion.core.favorite"));var h=new z.OpenResourceDialog({searcher:a,progress:c,searchRenderer:a.defaultRenderer,favoriteService:b,onHide:function(){P=!1;f&&f.getTextView()&&f.getTextView().focus()}});window.setTimeout(function(){P=!0;h.show()},0)}},p=new b.Command({name:g["Find File Named..."],
tooltip:g["Choose a file by name and open an editor on it"],id:"eclipse.openResource",callback:function(){t(u,c,x)}});h.addCommand(p);h.registerCommandContribution("globalActions","eclipse.openResource",100,null,!0,new e.KeyBinding("f",!0,!0));p=new b.Command({name:g["Toggle banner and footer"],tooltip:g["Hide or show the page banner and footer"],id:"orion.toggleTrim",callback:function(){var a=l.node("banner"),d=l.node("footer"),f=l.$(".content-fixedHeight");a.style.visibility==="hidden"?(a.style.visibility=
"visible",d.style.visibility="visible",f.classList.remove("content-fixedHeight-maximized")):(a.style.visibility="hidden",d.style.visibility="hidden",f.classList.add("content-fixedHeight-maximized"));x&&x.getTextView()&&x.getTextView().resize();return!0}});h.addCommand(p);h.registerCommandContribution("globalActions","orion.toggleTrim",100,null,!0,new e.KeyBinding("m",!0,!0));p=new b.Command({name:g["System Configuration Details"],tooltip:g["System Config Tooltip"],id:"orion.configDetailsPage",hrefCallback:function(){return k.toUrl("help/about.html")}});
h.addCommand(p);h.registerCommandContribution("globalActions","orion.configDetailsPage",100,null,!0,new e.KeyBinding(112,!0,!0));p=new b.Command({name:g["Background Operations"],tooltip:g["Background Operations Tooltip"],id:"orion.backgroundOperations",hrefCallback:function(){return k.toUrl("operations/list.html")}});h.addCommand(p);h.registerCommandContribution("globalActions","orion.backgroundOperations",100,null,!0,new e.KeyBinding("o",!0,!0));q.prototype={create:function(){var a=this._keyAssistDiv=
document.createElement("div");a.id="keyAssist";a.style.display="none";a.classList.add("keyAssistFloat");a.setAttribute("role","menu");var d=this._keyAssistInput=document.createElement("input");d.classList.add("keyAssistInput");d.type="text";d.placeholder=g["Filter bindings"];a.appendChild(d);var f=this._keyAssistContents=document.createElement("div");f.classList.add("keyAssistContents");if(I.isIOS||I.isAndroid)f.style.overflowY="auto";a.appendChild(f);var b=this._keyAssistTable=document.createElement("table");
b.tabIndex=0;b.classList.add("keyAssistList");f.appendChild(b);document.body.appendChild(a);d.addEventListener("keydown",function(a){this._keyDown(a)}.bind(this));b.addEventListener("keydown",function(a){this._keyDown(a)}.bind(this));d.addEventListener("input",function(){this.filterChanged()}.bind(this));f.addEventListener(I.isFirefox?"DOMMouseScroll":"mousewheel",function(a){this._scrollWheel(a)}.bind(this));document.addEventListener("keydown",function(a){a.keyCode===l.KEY.ESCAPE&&this.hide()}.bind(this));
l.addAutoDismiss([a],function(){this.hide()}.bind(this))},createContents:function(){l.empty(this._keyAssistTable);this._selectedIndex=-1;this._selectedRow=null;this._idCount=this._keyAssistContents.scrollTop=0;if(x&&x.getTextView()){var a=x.getTextView(),d=a.getActions(!0).filter(function(d){return(d=a.getActionDescription(d))&&d.name});d.sort(function(d,f){return a.getActionDescription(d).name.localeCompare(a.getActionDescription(f).name)});this.createHeader(g.Editor);for(var b=function(d){return function(){a.focus();
return a.invokeAction(d)}},c={},o,e=0;e<d.length;e++)for(var i=d[e],u=a.getActionDescription(i),v=a.getKeyBindings(i),n=0;n<v.length;n++){o=v[n];var m=f.getUserKeyString(o);o.scopeName?(c[o.scopeName]||(c[o.scopeName]=[]),c[o.scopeName].push({bindingString:m,name:u.name,execute:b(i)})):this.createItem(m,u.name,b(i))}for(var j in c)if(c[j].length){this.createHeader(j);for(d=0;d<c[j].length;d++)o=c[j][d],this.createItem(o.bindingString,o.name,o.execute)}}this.createHeader(g.Global);h.showKeyBindings(this)},
createItem:function(a,d,f){if(this._filterString){var b=this._filterString.toLowerCase(),c;b!==this._filterString?(b=this._filterString,c=function(a){return a}):c=function(a){return a.toLowerCase()};if(c(d).indexOf(b)===-1&&c(a).indexOf(b)===-1&&c(this._lastHeader).indexOf(b)===-1)return}var h=this._keyAssistTable.insertRow(-1);h.id="keyAssist-keyBinding-"+this._idCount++;h.setAttribute("role","menuitem");h._execute=f;h.classList.add("keyAssistItem");h.addEventListener("click",function(a){this._selectedRow=
h;this.execute();a.preventDefault()}.bind(this));f=h.insertCell(-1);f.classList.add("keyAssistName");f.appendChild(document.createTextNode(d));f=h.insertCell(-1);f.classList.add("keyAssistAccel");f.appendChild(document.createTextNode(a))},createHeader:function(a){this._lastHeader=a;var d=this._keyAssistTable.insertRow(-1);d.classList.add("keyAssistSection");var d=d.insertCell(-1),f=document.createElement("h2");f.appendChild(document.createTextNode(a));d.appendChild(f)},execute:function(){window.setTimeout(function(){this.hide();
var a=this._selectedRow;this._selectedRow=null;a&&a._execute&&a._execute()}.bind(this),0)},filterChanged:function(){this._timeout&&window.clearTimeout(this._timeout);this._timeout=window.setTimeout(function(){this._timeout=null;var a=this._keyAssistInput.value;if(this._filterString!==a)this._filterString=a,this.createContents()}.bind(this),100)},hide:function(){var a=document.activeElement,d=this._keyAssistDiv,a=d===a||(d.compareDocumentPosition(a)&16)!==0;d.style.display="none";a&&document.compareDocumentPosition(this._previousActiveElement)!==
1&&this._previousActiveElement.focus();this._previousActiveElement=null},isVisible:function(){return this._keyAssistDiv.style.display==="block"},select:function(a){var d=this._keyAssistTable.querySelectorAll(".keyAssistItem");if(d.length===0)this._selectedIndex=-1;else{var f=this._selectedIndex;f+=a?1:-1;f%=d.length;f<0&&(f=d.length-1);if(this._selectedIndex!==-1)a=d[this._selectedIndex],a.classList.remove("selected"),this._selectedRow=null;this._selectedIndex=f;if(this._selectedIndex!==-1){this._selectedRow=
a=d[this._selectedIndex];a.classList.add("selected");this._keyAssistTable.setAttribute("aria-activedescendant",a.id);this._keyAssistTable.focus();var d=a.getBoundingClientRect(),b=this._keyAssistContents,c=b.getBoundingClientRect();a.offsetTop<b.scrollTop?f===0?b.scrollTop=0:a.scrollIntoView(!0):d.bottom>c.bottom&&a.scrollIntoView(!1)}}},show:function(){this._previousActiveElement=document.activeElement;this.createContents();this._keyAssistContents.style.height=Math.floor(this._keyAssistDiv.parentNode.clientHeight*
0.75)+"px";this._keyAssistDiv.style.display="block";this._keyAssistInput.value=this._filterString;this._keyAssistInput.focus();this._keyAssistInput.select()},_keyDown:function(a){if(a.keyCode===40)this.select(!0);else if(a.keyCode===38)this.select(!1);else if(a.keyCode===13)this.execute();else return;a.preventDefault()},_scrollWheel:function(a){var d=0,d=I.isIE||I.isOpera?-a.wheelDelta:I.isFirefox?a.detail*40:-a.wheelDeltaY,f=this._keyAssistContents,b=f.scrollTop;f.scrollTop+=d;if(b!==f.scrollTop)return a.preventDefault&&
a.preventDefault(),!1}};var O=new q,y=new b.Command({name:g["Show Keys"],tooltip:g["Show a list of all the keybindings on this page"],id:"eclipse.keyAssist",callback:function(){O.isVisible()?O.hide():O.show();return!0}});h.addCommand(y);h.registerCommandContribution("globalActions","eclipse.keyAssist",100,null,!0,new e.KeyBinding(191,!1,!0));p=function(){x.getTextView().setKeyBinding(new e.KeyBinding(191,!1,!0,!I.isMac,I.isMac),y.id);x.getTextView().setAction(y.id,y.callback,y)};x&&(x.getTextView()?
p():x.addEventListener("TextViewInstalled",p));E(h);U(c,y.callback);T(c);window.addEventListener("hashchange",function(){h.processURL(window.location.href)},!1);window.setTimeout(function(){G(c)},0);J.afterGenerateBanner.apply(this,arguments)},getToolbarElements:F,getMainSplitter:function(){return R},layoutToolbarElements:H,setPageTarget:function(a){var d,f,b=a.breadcrumbRootName,c=a.serviceRegistry;a.target?(a.searchService&&a.searchService.setLocationByMetaData(a.target),a.fileService&&!a.breadcrumbTarget&&
(f=b?b+" ":"",f+=a.fileService.fileServiceName(a.target.Location),b=null),d=a.name||a.target.Name,N=a.target,y(c,a.target,S,a.commandService,a.makeAlternate)):(a.breadcrumbTarget||(b=b||a.task||a.name),d=a.name,y(c,{NoTarget:""},S,a.commandService,a.makeAlternate));(L=a.title)||(L=d?d+" - "+a.task:a.task);window.document.title=L;J.afterSetPageTarget.apply(this,arguments);if(d=l.node("location")){l.empty(d);var o=c&&new O.FileClient(c),c=a.breadcrumbTarget||a.target,o=o&&c&&c.Location?o.fileServiceRootURL(c.Location):
null;new h.BreadCrumbs({container:d,resource:c,rootSegmentName:b,workspaceRootSegmentName:f,workspaceRootURL:o,makeHref:a.makeBreadcrumbLink})}},setDirtyIndicator:function(a){if(L)L.charAt(0)==="*"&&!a&&(L=L.substring(1)),a&&L.charAt(0)!=="*"&&(L="*"+L),window.document.title=L;var d=l.node("dirty");if(d)d.textContent=a?"*":""},setPageCommandExclusions:function(a){S=a},notifyAuthenticationSite:c}});
define("orion/urlUtils",["orion/PageUtil","orion/URL-shim"],function(g){return{detectValidURL:function(k){for(var j=/\[([^\]]*)\]\(([^\)]+)\)/g,e=j.exec(k),c=[],b=0;e;){if(e.length===3&&e[2].length>0){var a=new URL(e[2]);a.protocol!==":"&&g.validateURLScheme(a.href)&&(e.index>b&&c.push({segmentStr:k.substring(b,e.index)}),c.push({segmentStr:e[1].length>0?e[1]:e[2],urlStr:e[2]}),b=e.index+e[0].length)}e=j.exec(k)}if(b===0)return null;b<k.length-1&&c.push({segmentStr:k.substring(b)});return c},processURLSegments:function(g,
j){j.forEach(function(e){if(e.urlStr){var c=document.createElement("a");c.href=e.urlStr;c.appendChild(document.createTextNode(e.segmentStr))}else c=document.createElement("span"),c.textContent=e.segmentStr;g.appendChild(c)})}}});
define("orion/status",["require","orion/webui/littlelib","orion/globalCommands","orion/PageUtil","orion/urlUtils"],function(g,k,j,e,c){function b(a,f,d,b,c){this._serviceRegistry=a;this._serviceRegistration=a.registerService("orion.page.message",this);this._operationsClient=f;this.notificationContainerDomId=c;this.domId=d;this.progressDomId=b||d;this._hookedClose=!1;this._timer=null}var a;b.prototype={_init:function(){var a=k.node("closeNotifications");if(a&&!this._hookedClose)this._hookedClose=!0,
a.addEventListener("click",function(){window.clearTimeout(this._timer);this.setProgressMessage("")}.bind(this))},_getNotifierElements:function(){if(!this._notifierElements)this._notifierElements=j.getToolbarElements(this.notificationContainerDomId);return this._notifierElements},setMessage:function(a,f,d){this._init();this.currentMessage=a;var b=k.node(this.domId);if(typeof d==="boolean"){var c=b.getAttribute("aria-live");b.setAttribute("aria-live",d?"polite":"off");window.setTimeout(function(){a===
this.currentMessage&&(k.empty(b),b.appendChild(document.createTextNode(a)),window.setTimeout(function(){b.setAttribute("aria-live",c)},100))}.bind(this),100)}else k.empty(b),b.appendChild(document.createTextNode(a));typeof f==="number"&&window.setTimeout(function(){a===this.currentMessage&&(k.empty(b),b.appendChild(document.createTextNode("")))}.bind(this),f)},setErrorMessage:function(a){this.currentMessage=a;this._init();var f=a.responseText||a.message||a;if(typeof f==="string")try{f=JSON.parse(f)}catch(d){}var a=
f.Message||f,b="red";if(f.Severity)switch(f.Severity){case "Warning":b="#FFCC00";break;case "Error":b="red";break;case "Info":case "Ok":b="green"}f=document.createElement("span");f.style.color=b;f.appendChild(document.createTextNode(a));a=k.node(this.domId);k.empty(a);a.appendChild(f)},setProgressMessage:function(a){this._init();this.currentMessage=a;var f=document.createElement("span");f.classList.add("imageSprite");f.classList.add("progressIcon");f.classList.add("core-sprite-progress");var d=k.node(this.progressDomId);
k.empty(d);d.appendChild(f);d.appendChild(document.createTextNode(a));f=k.node(this.notificationContainerDomId);f.classList.remove("notificationHide");if(a&&a.length>0)f.classList.add("progressNormal"),f.classList.add("notificationShow");else if(this._progressMonitors&&this._progressMonitors.length>0)return this._renderOngoingMonitors();else f.classList.remove("notificationShow"),f.classList.add("notificationHide")},setProgressResult:function(a){this.currentMessage=a;var f=a.responseText||a;if(typeof f===
"string")try{f=JSON.parse(f)}catch(d){}this._init();var b=f.Message||f,e="core-sprite-information",g="progressInfo",m=document.createElement("span");m.classList.add("imageSprite");m.classList.add("progressIcon");a=[];if(f.Severity)switch(f.Severity){case "Warning":e="core-sprite-warning";g="progressWarning";a.push("progressInfo");a.push("progressError");a.push("progressNormal");break;case "Error":e="core-sprite-error";g="progressError";a.push("progressWarning");a.push("progressInfo");a.push("progressNormal");
break;default:a.push("progressWarning"),a.push("progressError"),a.push("progressNormal")}a.push("notificationHide");m.classList.add(e);var j=k.node(this.progressDomId),e=k.node(this.notificationContainerDomId);k.empty(j);j.appendChild(m);if(f.HTML)f=document.createElement("span"),f.innerHTML=b,j.appendChild(f);else{if(m=c.detectValidURL(b))b=document.createDocumentFragment(),c.processURLSegments(b,m),Array.prototype.forEach.call(k.$$("a",b),function(a){a.target="_blank"});else{if(f.Severity!=="Warning"&&
f.Severity!=="Error")this._timer&&window.clearTimeout(this._timer),this._timer=window.setTimeout(function(){this.setProgressMessage("");this._timer=null}.bind(this),5E3);b=document.createTextNode(b)}j.appendChild(b)}if(g&&this.progressDomId!==this.domId){e.classList.add(g);for(g=0;g<a.length;g++)e.classList.remove(a[g])}e.classList.add("notificationShow")},showWhile:function(a,f){var d=this;if(f){d.setProgressMessage(f);var b=function(){f===d.currentMessage&&d.setProgressMessage("")};a.then(b,b)}return a},
_lastProgressId:0,_progressMonitors:{length:0},createProgressMonitor:function(b,f){return new a(this,++this._lastProgressId,b,f)},_renderOngoingMonitors:function(){if(this._progressMonitors.length>0){var a="",f=!0,d;for(d in this._progressMonitors)this._progressMonitors[d].status&&(f||(a+=", "),a+=this._progressMonitors[d].status,f=!1);this.setProgressMessage(a)}else this.setProgressMessage("")},_beginProgressMonitor:function(a){this._progressMonitors[a.progressId]=a;this._progressMonitors.length++;
this._renderOngoingMonitors()},_workedProgressMonitor:function(a){this._progressMonitors[a.progressId]=a;this._renderOngoingMonitors()},_doneProgressMonitor:function(a){delete this._progressMonitors[a.progressId];this._progressMonitors.length--;a.status?this.setProgressResult(a.status):this._renderOngoingMonitors()}};b.prototype.constructor=b;a=function(a,f,d,b){this.statusService=a;this.progressId=f;if(d){this.deferred=d;this.begin(b);var c=this;d.then(function(){c.done.bind(c)()},function(){c.done.bind(c)()})}};
a.prototype.begin=function(a){this.status=a;this.statusService._beginProgressMonitor(this)};a.prototype.done=function(a){this.status=a;this.statusService._doneProgressMonitor(this)};a.prototype.worked=function(a){this.status=a;this.statusService._workedProgressMonitor(this)};a.prototype.constructor=a;return{StatusReportingService:b,ProgressMonitor:a}});
define("orion/operations/nls/root/messages",{More:"More","No Matching OperationService for location:":"No Matching OperationService for location:","No operations services registered.":"No operations services registered.","could not find toolbar ":"could not find toolbar ","Remove Completed":"Remove Completed","Remove all completed operations":"Remove all completed operations",Remove:"Remove","Remove operations from the operations list.":"Remove operations from the operations list.",Cancel:"Cancel",
"Cancel operations from the operations list.":"Cancel operations from the operations list.","Operation resulted in a warning.":"Operation resulted in a warning.","Operation resulted in an error.":"Operation resulted in an error.","Operation is running.":"Operation is running.","Operation is canceled.":"Operation is canceled.","Operation failed.":"Operation failed.",Name:"Name",Actions:"Actions",Status:"Status",Scheduled:"Scheduled"});
define("orion/operations/nls/messages",["orion/i18n!orion/operations/nls/messages","orion/operations/nls/root/messages"],function(g,k){var j={root:k};Object.keys(g).forEach(function(e){typeof j[e]==="undefined"&&(j[e]=g[e])});return j});
define("orion/webui/popupdialog",["i18n!orion/widgets/nls/messages","require","orion/webui/littlelib","orion/webui/tooltip"],function(g,k,j,e){function c(){}c.prototype={_initialize:function(b,a,c,f,d){this._tooltip=new e.Tooltip({node:b,hideDelay:d||0,afterShowing:this._afterShowingFunction(a).bind(this),afterHiding:c,trigger:f?f:"click"});this.$parent=this._tooltip.contentContainer();this.$parent.role="dialog";b=document.createRange();b.selectNode(this.$parent);b=b.createContextualFragment(this.TEMPLATE);
this.messages&&j.processTextNodes(b,g);this.$parent.appendChild(b);var h=this._tooltip;this.$parent.addEventListener("keydown",function(a){a.keyCode===j.KEY.ESCAPE&&h.hide()},!1);this._bindElements(this.$parent);typeof this._bindToDom==="function"&&this._bindToDom(this.$parent)},_bindElements:function(b){for(var a=0;a<b.childNodes.length;a++){var c=b.childNodes[a];c.id&&(this["$"+c.id]=c);this._bindElements(c)}},_afterShowingFunction:function(b){return function(){b&&b.bind(this)();if(!this.customFocus){var a=
j.firstTabbable(this.$parent);a&&a.focus()}}},hide:function(){this._tooltip.hide()},show:function(){this._tooltip.show()}};c.prototype.constructor=c;return{PopupDialog:c}});
define("orion/operationsCommands",["i18n!orion/operations/nls/messages","require","orion/webui/littlelib","orion/commands"],function(g,k,j,e){var c={};(function(){var b=!1;c.updateNavTools=function(a,c,f,d,h,e){var n=j.node(d);if(n)c.destroy(n);else throw g["could not find toolbar "]+d;c.renderCommands(d,n,e,f,"button");if(h&&(d=j.node(h)))c.destroy(d),c.renderCommands(h,d,null,f,"button");b||(b=!0,a.getService("orion.page.selection").addEventListener("selectionChanged",function(a){var d=j.node(h);
d&&(c.destroy(d),c.renderCommands(h,d,a.selections,f,"button"))}))};c.createOperationsCommands=function(a,b,f){function d(a){return!a.operation||!a.operation.type?!1:a.operation.type==="loadstart"||a.operation.type==="progress"}var c=new e.Command({name:g["Remove Completed"],tooltip:g["Remove all completed operations"],id:"eclipse.removeCompletedOperations",callback:function(){f.removeCompletedOperations().then(function(){b.loadOperations.bind(b)()})},visibleWhen:function(){return!0}});a.addCommand(c);
c=new e.Command({name:g.Remove,tooltip:g["Remove operations from the operations list."],imageClass:"core-sprite-delete",id:"eclipse.removeOperation",callback:function(a){for(var a=Array.isArray(a.items)?a.items:[a.items],d=0;d<a.length;d++){var c=a[d];f.removeOperation.bind(f)(c.Location).then(function(){b.loadOperations.bind(b)()},function(){b.loadOperations.bind(b)()})}},visibleWhen:function(a){if(!Array.isArray(a)||a.length===0)return!d(a);for(var f in a)if(d(a[f]))return!1;return!0}});a.addCommand(c);
c=new e.Command({name:g.Cancel,tooltip:g["Cancel operations from the operations list."],imageClass:"core-sprite-stop",id:"eclipse.cancelOperation",callback:function(a){for(var a=Array.isArray(a.items)?a.items:[a.items],d=0;d<a.length;d++){var f=a[d];f.deferred&&f.deferred.cancel()}},visibleWhen:function(a){if(!Array.isArray(a)||a.length===0)return d(a)&&(a.operation&&a.operation.cancelable?!0:!1);for(var f in a)if(!d(a[f])||!a[f].operation||!a[f].operation.cancelable)return!1;return!0}});a.addCommand(c)}})();
return c});
define("orion/webui/dialogs/OperationsDialog",["i18n!orion/operations/nls/messages","require","orion/webui/littlelib","orion/webui/popupdialog","orion/operationsCommands"],function(g,k,j,e,c){function b(a){this._options=a}b.prototype=new e.PopupDialog;b.prototype.TEMPLATE='<table style="width: 360px;"><tr><td><h2>Recent operations</h2></td><td style="text-align: right;"><a id="allOperationsLink" class="navlinkonpage">All Operations</a></td></tr></table><div id="operationsExist"><div style="padding-left: 7px" id="myOperationsListEmpty">No operations running on this page.</div><table id="myOperationsList" style="display: none;"></table></div><div style="padding-left: 7px" id="operationsDontExist">No operations running.</div>';b.prototype._init=
function(a){this._myOperations=[];this._operationsDeferreds=[];this._commandService=a.commandRegistry;c.createOperationsCommands(this._commandService);this._commandService.registerCommandContribution("operationsDialogItems","eclipse.cancelOperation",1);this._initialize(a.triggerNode)};b.prototype._bindToDom=function(){this.$allOperationsLink.href=k.toUrl("operations/list.html");this._setOperationsVisibility()};b.prototype.setOperations=function(a,b){this._myOperations||this._init(this._options);this._myOperations=
[];this._operationsDeferreds=[];if(a)for(var f in a)this._myOperations.push(a[f]),this._operationsDeferreds.push(b[f]);this._renderOperations()};b.prototype.parseProgressResult=function(a){if(!a)return{};a=a.responseText||a;try{a=JSON.parse(a)}catch(b){}var f={Message:a.Message||a,Severity:a.Severity};if(a.DetailedMessage&&a.DetailedMessage!==f.Message)f.DetailedMessage=a.DetailedMessage;return f};b.prototype._renderOperations=function(){this._renderOperationsTable(this.$myOperationsList,this._myOperations,
this._operationsDeferreds)};b.prototype._renderOperationsTable=function(a,b,f){j.empty(a);for(var d=0;d<b.length;d++){var c=b[d],e=document.createElement("tr"),n=document.createElement("td");n.style.paddingLeft="5px";n.style.paddingRight="5px";n.textContent=c.Name;e.appendChild(n);var m=document.createElement("div");n.appendChild(m);n=document.createElement("span");n.style.paddingRight="5px";n.classList.add("imageSprite");switch(c.type){case "Warning":n.classList.add("core-sprite-warning");n.setAttribute("aria-label",
g["Operation resulted in a warning."]);break;case "error":n.classList.add("core-sprite-error");n.setAttribute("aria-label",g["Operation resulted in an error."]);break;case "loadstart":case "progress":n.classList.add("core-sprite-start");n.setAttribute("aria-label",g["Operation is running."]);break;case "abort":n.classList.add("core-sprite-stop");n.setAttribute("aria-label",g["Operation is canceled."]);break;case "load":case "loadend":n.classList.add("core-sprite-ok"),n.setAttribute("aria-label","Operation ok.")}m.appendChild(n);
n=document.createElement("span");n.classList.add("operationStatus");n.textContent=c.Name;m.appendChild(n);if(c.error){var q=c.error.Message||c.error;c.error.DetailedMessage&&c.error.DetailedMessage!==""&&(q+=": "+c.error.DetailedMessage);n.textContent=q;n.classList.remove("operationStatus");n.classList.add("operationError")}this._commandService.renderCommands("operationsDialogItems",m,{operation:c,deferred:f[d]},this,"tool");a.appendChild(e)}this._setOperationsVisibility()};b.prototype._setOperationsVisibility=
function(){this.$myOperationsList.style.display=this._myOperations.length>0?"":"none";this.$myOperationsListEmpty.style.display=this._myOperations.length>0?"none":"";this.$operationsDontExist.style.display=this._myOperations.length>0?"none":"";this.$operationsExist.style.display=this._myOperations.length>0?"":"none"};b.prototype.constructor=b;return{OperationsDialog:b}});
define("orion/progress",["i18n!orion/nls/messages","require","orion/Deferred","orion/webui/littlelib","orion/webui/dialogs/OperationsDialog"],function(g,k,j,e,c){function b(a,f){if(!this._progressPane){this._progressPane=e.node(a);this._operationsDialog=new c.OperationsDialog({triggerNode:this._progressPane,commandRegistry:f});var d=this;this._progressPane.addEventListener("keydown",function(a){(a.charOrCode===" "||a.keyCode===e.KEY.ENTER)&&d._operationsDialog.show()})}}function a(a,f,d,b){this._serviceRegistry=
a;this._serviceRegistration=a.registerService("orion.page.progress",this);this._commandRegistry=d;this._operationsClient=f;this._operations={};this._operationDeferrds={};this._operationsIndex=0;this._lastIconClass=this._lastOperation=null;this._progressMonitorClass=b}b.prototype={_switchIconTo:function(a){this._lastIconClass&&this._progressPane.classList.remove(this._lastIconClass);this._lastIconClass=a;this._progressPane.classList.add(this._lastIconClass)},generateOperationsInfo:function(a,f){var d=
{},b;for(b in a)a[b].progressMonitor||(d[b]=a[b]);if(this._isEmpty(d))this._switchIconTo("progressPane_empty"),this._progressPane.title=g.Operations,this._progressPane.alt=g.Operations,this._progressPane.hasAttribute("aria-valuetext")&&this._progressPane.removeAttribute("aria-valuetext");else{var c="";for(b in d){var e=d[b];if(e.type&&(e.type==="loadstart"||e.type==="progress")){c="running";break}}switch(c){case "running":this._progressPane.title=g["Operations running"];this._progressPane.alt=g["Operations running"];
this._progressPane.setAttribute("aria-valuetext",g["Operations running"]);this._switchIconTo("progressPane_running");break;case "warning":this._progressPane.title=g["Some operations finished with warning"];this._progressPane.alt=g["Some operations finished with warning"];this._progressPane.setAttribute("aria-valuetext",g["Some operations finished with warning"]);this._switchIconTo("progressPane_warning");break;case "error":this._progressPane.title=g["Some operations finished with error"];this._progressPane.alt=
g["Some operations finished with error"];this._progressPane.setAttribute("aria-valuetext",g["Some operations finished with error"]);this._switchIconTo("progressPane_error");break;default:this._progressPane.title=g.Operations,this._progressPane.alt=g.Operations,this._progressPane.hasAttribute("aria-valuetext")&&this._progressPane.removeAttribute("aria-valuetext"),this._switchIconTo("progressPane_operations")}}this._operationsDialog.setOperations(d,f)},_isEmpty:function(a){for(var f in a)return!1;return!0}};
b.prototype.constructon=b;a.prototype={init:function(a){if(!this._progressMonitorClass)this._progressMonitorTool=new b(a,this._commandRegistry)},progress:function(a,f,d){var b=this,c=this._operationsIndex++;!d&&this._progressMonitorClass&&(d=new this._progressMonitorClass,d.begin(f));a.then(function(){if(b._operations[c]){var e=b._operations[c];if(f)e.Name=f;b._lastOperation=e;e.type="loadend";if(d)e.progressMonitor=d;b.writeOperation.bind(b)(c,e,a);e.Location||b._removeOperationFromTheList.bind(b)(c)}},
function(e){if(b._operations[c]){var g=b._operations[c];if(f)g.Name=f;if(d)g.progressMonitor=d;b._lastOperation=g;g.type=e.canceled?"abort":"error";g.error=e;b.writeOperation.bind(b)(c,g,a);g.Location||b._removeOperationFromTheList.bind(b)(c)}},function(e){if(f)e.Name=f;if(d)e.progressMonitor=d;b.writeOperation.bind(b)(c,e,a)});return a},removeOperation:function(a){for(var f in this._operations)if(this._operations[f].Location&&this._operations[f].Location===a){this._removeOperationFromTheList(f);
break}this._operationsClient.removeOperation.bind(this._operationsClient)(a)},_removeOperationFromTheList:function(a){var f=this._operations[a].progressMonitor;delete this._operations[a];delete this._operationDeferrds[a];f?f.done():this._progressMonitorTool.generateOperationsInfo(this._operations,this._operationDeferrds)},removeCompletedOperations:function(){for(var a in this._operations){var f=this._operations[a];if(f.type&&f.type!=="loadstart"&&f.type!=="progress")(f=this._operations[a].progressMonitor)&&
f.done(),delete this._operations[a],delete this._operationDeferrds[a]}this._progressMonitorTool.generateOperationsInfo(this._operations,this._operationDeferrds)},setProgressResult:function(a){this._serviceRegistry.getService("orion.page.message").setProgressResult(a)},showWhile:function(a,f){f&&this._serviceRegistry.getService("orion.page.message").setProgressMessage(f);var d=this;a.then(function(){d._serviceRegistry.getService("orion.page.message").setProgressMessage("")},function(a){d.setProgressResult.bind(d)(a);
return a});return this.progress(a,f)},writeOperation:function(a,f,d){this._operations[a]=f;this._operationDeferrds[a]=d;f.Location&&this._serviceRegistry.getService("orion.core.preference").getPreferences("/operations").then(function(a){a.put(f.Location,{Name:f.Name,expires:f.expires})});f.progressMonitor?f.progressMonitor.progress(f.Name):this._progressMonitorTool.generateOperationsInfo(this._operations,this._operationDeferrds)}};a.prototype.constructor=a;return{ProgressService:a}});
define("orion/dialogs",[],function(){function g(g){this._serviceRegistry=g;this._serviceRegistration=g.registerService("orion.page.dialog",this)}g.prototype={confirm:function(g,j){j(window.confirm(g))},openFiles:function(){}};g.prototype.constructor=g;return{DialogService:g}});
define("orion/selection",["orion/EventTarget","orion/Deferred"],function(g){function k(j,e){e||(e="orion.page.selection");this._serviceRegistry=j;g.attach(this);this._serviceRegistration=j.registerService(e,this);this._selections=null}k.prototype={getSelection:function(g){var e=this._getSingleSelection();typeof g==="function"&&g(e);return e},getSelections:function(g){var e=Array.isArray(this._selections)?this._selections.slice():[];typeof g==="function"&&g(e);return e},_getSingleSelection:function(){return this._selections&&
this._selections.length>0?this._selections[0]:null},setSelections:function(g){var e=this._selections;this._selections=Array.isArray(g)?g.length>0?g.slice():null:g?[g]:null;e!==this._selections&&this.dispatchEvent({type:"selectionChanged",selection:this._getSingleSelection(),selections:this._selections})}};k.prototype.constructor=k;return{Selection:k}});
define("orion/operationsClient",["i18n!orion/operations/nls/messages","orion/Deferred"],function(g,k){function j(a,b,f){return a[b].apply(a,f)}function e(a){this._location=a}function c(){var a=new k;a.reject(g["No Matching OperationService for location:"]+this._location);return a}function b(a){this._services=[];this._patterns=[];this._operationListeners=[];this._currentLongpollingIds=[];this._preferenceService=a.getService("orion.core.preference");for(var b=a.getServiceReferences("orion.core.operation"),
f=0;f<b.length;f++){var d=a.getService(b[f]);this._services[f]=d;d=b[f].getProperty("pattern")||".*";d[0]!=="^"&&(d="^"+d);this._patterns[f]=RegExp(d)}this._getService=function(a){if(!a)return this._services[0];for(var d=0;d<this._patterns.length;++d)if(this._patterns[d].test(a))return this._services[d];return new e(a)}}e.prototype={getOperation:c,getOperations:c,removeCompletedOperations:c,removeOperation:c,cancelOperation:c};e.prototype.constructor=e;b.prototype={getOperations:function(){var a=
new k;if(this._operations)return a.resolve(this._operations),a;var b=this;this._preferenceService.getPreferences("/operations").then(function(f){b._operations=f;a.resolve(b._operations)});return a},getOperation:function(a){return j(this._getService(a),"getOperation",arguments)},removeCompletedOperations:function(){for(var a=[],b=this,f=0;f<this._services.length;f++){var d=this._patterns[f],c=new k;a[f]=c.promise;j(this._services[f],"removeCompletedOperations").then(function(a){return function(f){Array.isArray(f)&&
b.getOperations.bind(b)().then(function(b){for(var c=b.keys(),h=0;h<c.length;h++){var e=c[h];d.test(e)&&f.indexOf(e)<0&&b.remove(e)}a.resolve()})}}(c),function(a){return function(d){a.reject(d)}}(c))}return k.all(a)},removeOperation:function(a){var b=this;return j(this._getService(a),"removeOperation",arguments).then(function(){b.getOperations.bind(b)().then(function(f){f.remove(a)})},function(a){return a},function(a){return a})}};b.prototype.constructor=b;return{OperationsClient:b}});
define("orion/search/nls/root/messages",{"Find:":"Find:","Find With":"Find With","ReplaceWith:":"ReplaceWith:","Replace With":"Replace With","Show all":"Show all","Wrap search":"Wrap search","Incremental search":"Incremental search","Whole Word":"Whole Word","Regular expression":"Regular expression","Find after replace":"Find after replace",Options:"Options","Find next match":"Find next match","Find previous match":"Find previous match",Replace:"Replace","Replace All":"Replace All","Search ${0}":"Search ${0}",
"Type a keyword or wild card to search in ":"Type a keyword or wild card to search in ","Search failed.":"Search failed.","No matches found for ${0}":"No matches found for ${0}","Searching...":"Searching...","Resource has been changed by others.":"Resource has been changed by others.","Failed to write file.":"Failed to write file.",Results:"Results","Files ${0} of ${1} matching ${2}":"Files ${0} of ${1} matching ${2}","Replace ${0} with ${1} for files ${2} of ${3}":"Replace ${0} with ${1} for files ${2} of ${3}",
Location:"Location","Click to compare":"Click to compare",'Search again in this folder with "${0}"':'Search again in this folder with "${0}"',"Files replaced":"Files replaced",Status:"Status","${0} out of ${1}  matches replaced.":"${0} out of ${1}  matches replaced.","Replace all matches with...":"Replace all matches with...","Apply Changes":"Apply Changes","Replace all selected matches":"Replace all selected matches","Hide Compare":"Hide Compare","Hide compare view of changes":"Hide compare view of changes",
"Show Compare":"Show Compare","Show compare view of changes":"Show compare view of changes","Show All":"Show All","Show all the results in one page":"Show all the results in one page","< Previous Page":"< Previous Page","Show previous page of search result":"Show previous page of search result","Next Page >":"Next Page >","Show next page of search result":"Show next page of search result","Next result":"Next result","Previous result":"Previous result","Expand all results":"Expand all results","Collapse all results":"Collapse all results",
"Writing files...":"Writing files...","Preparing preview...":"Preparing preview...","Replaced File (${0})":"Replaced File (${0})","Original File (${0})":"Original File (${0})","Sort by Name":"Sort by Name","Compare changes":"Compare changes","Search Results":"Search Results","Replace All Matches":"Replace All Matches","No matches":"No matches",Rename:"Rename","My Saved Searches":"My Saved Searches","Save frequently used searches by choosing ${0} shown above.":"Save frequently used searches by choosing ${0} shown above.",
"Files that contain:":"Files that contain:",Search:"Search","All types":"All types","File type":"File type","All ${0} files":"All ${0} files","Type a search term":"Type a search term","Type a replace term":"Type a replace term","Case sensitive":"Case sensitive","Sort by":"Sort by","File name":"File name","Path name":"Path name",Save:"Save","Type a name for the search":"Type a name for the search","Save the current search":"Save the current search","Type filter text":"Type filter text","Scope Search":"Scope Search",
"Open in Search page for this directory":"Open in Search page for this directory","${0}. Try your search again.":"${0}. Try your search again.","Click or use delete key to delete the search term":"Click or use delete key to delete the search term"});define("orion/search/nls/messages",["orion/i18n!orion/search/nls/messages","orion/search/nls/root/messages"],function(g,k){var j={root:k};Object.keys(g).forEach(function(e){typeof j[e]==="undefined"&&(j[e]=g[e])});return j});
define("orion/webui/treetable",["i18n!orion/nls/messages","orion/webui/littlelib"],function(g,k){function j(e){this._init(e)}j.prototype={_init:function(e){var c=e.parent,b=this,c=k.node(c);if(!c)throw g["no parent"];if(!e.model)throw g["no tree model"];if(!e.renderer)throw g["no renderer"];this._parent=c;this._treeModel=e.model;this._renderer=e.renderer;this._showRoot=e.showRoot===void 0?!1:e.showRoot;this._indent=e.indent===void 0?16:e.indent;this._onCollapse=e.onCollapse;this._labelColumnIndex=
e.labelColumnIndex===void 0?0:e.labelColumnIndex;this._id=e.id===void 0?"treetable":e.id;this._tableStyle=e.tableStyle;this._tableElement=e.tableElement||"table";this._tableBodyElement=e.tableBodyElement||"tbody";this._tableRowElement=e.tableRowElement||"tr";this._root=this._treeModel.getRoot(function(a){b._showRoot?(a._depth=0,b._generate([a],0)):b._treeModel.getChildren(a,function(a){b._generate(a,0)})})},_generate:function(e,c){k.empty(this._parent);var b=document.createElement("div");this._renderer.wrapperCallback&&
this._renderer.wrapperCallback(b);var a=document.createElement(this._tableElement);this._renderer.tableCallback&&this._renderer.tableCallback(a);a.id=this._id;this._tableStyle&&a.classList.add(this._tableStyle);this._renderer.initTable(a,this);this._bodyElement=document.createElement(this._tableBodyElement);this._renderer.bodyCallback&&this._renderer.bodyCallback(this._bodyElement);this._bodyElement.id=this._id+"tbody";this._generateChildren(e,c);a.appendChild(this._bodyElement);b.appendChild(a);
this._parent.appendChild(b);this._rowsChanged()},_generateChildren:function(e,c,b){for(var a=0;a<e.length;a++){var i=document.createElement(this._tableRowElement);i.id=this._treeModel.getId(e[a]);this._renderer.rowCallback&&this._renderer.rowCallback(i);i._depth=c;i._item=e[a];this._renderer.render(e[a],i);i.childNodes[this._labelColumnIndex].style.paddingLeft=this._indent*c+"px";b?(this._bodyElement.insertBefore(i,b.nextSibling),b&&(b=i)):this._bodyElement.appendChild(i)}},_rowsChanged:function(){this._renderer.rowsChanged&&
this._renderer.rowsChanged()},getSelected:function(){return this._renderer.getSelected()},refresh:function(e,c,b){var a=this._treeModel.getId(e),i;if(a===this._id)this._removeChildRows(a),this._generateChildren(c,0),this._rowsChanged();else{var f=k.node(a);f?(f._item=e,f&&(b||f._expanded)?(f._expanded=!0,this._removeChildRows(a),this._renderer.updateExpandVisuals(f,!0),c?(this._generateChildren(c,f._depth+1,f),this._rowsChanged()):(i=this,c=this._treeModel.getChildren(f._item,function(a){i._generateChildren(a,
f._depth+1,f);i._rowsChanged()}))):this._renderer.updateExpandVisuals(f,!1)):console.log(g["could not find table row "]+a)}},getItem:function(e){var c=k.node(e);return c&&c._item?c._item:e},toggle:function(e){var c=k.node(e);c&&(c._expanded?(this.collapse(e),this._renderer.updateExpandVisuals(c,!1)):(this.expand(e),this._renderer.updateExpandVisuals(c,!0)))},isExpanded:function(e){return(e=k.node(e))?e._expanded:!1},expand:function(e,c,b){var e=typeof e==="string"?e:this._treeModel.getId(e),a=k.node(e);
if(a&&!a._expanded){a._expanded=!0;var i=this;this._renderer.updateExpandVisuals(a,!0);this._treeModel.getChildren(a._item,function(f){i._generateChildren(f,a._depth+1,a);i._rowsChanged();c&&c.apply(i,b)})}},_removeChildRows:function(e){for(var c=e===this._id,b=!1,a=-1,i=[],f=k.$$array(".treeTableRow",this._parent),d=0;d<f.length;d++){var h=f[d];if(b)break;if(c)h._depth>a?i.push(h):b=!0;else if(h.id===e)c=!0,a=h._depth}for(e=0;e<i.length;e++)c=i[e],c.parentNode.removeChild(c)},collapse:function(e){var e=
typeof e==="string"?e:this._treeModel.getId(e),c=k.node(e);if(c){if(!c._expanded)return;c._expanded=!1;this._renderer.updateExpandVisuals(c,!1);this._removeChildRows(e);this._rowsChanged()}this._onCollapse&&this._onCollapse(c._item)}};j.prototype.constructor=j;return{TableTree:j}});
define("orion/treeModelIterator",[],function(){var g={};g.TreeModelIterator=function(){function g(j,e){this.firstLevelChildren=j;this.reset();this._init(e)}g.prototype={_init:function(g){if(g)this.isExpanded=g.isExpanded,this.isExpandable=g.isExpandable,this.forceExpandFunc=g.forceExpandFunc,this.getChildrenFunc=g.getChildrenFunc},topLevel:function(g){return g.parent?g.parent===this.root:!0},_getChildren:function(g){return typeof this.getChildrenFunc==="function"?this.getChildrenFunc(g):g?g.children:
null},_expanded:function(g){if(!g)return!0;var e=this._getChildren(g),e=e&&e.length>0;this.isExpanded&&e&&(e=this.isExpanded(g));return e},_expandable:function(g){return!g?!0:this.isExpandable?this.isExpandable(g):!1},_diveIn:function(g){return this._expanded(g)?(this.setCursor(this._getChildren(g)[0]),this.cursor()):null},_drillToLast:function(g){return this._expanded(g)?(g=this._getChildren(g),this._drillToLast(g[g.length-1])):g},_forward:function(g){if(!this._cursor)return null;var e=this._diveIn(this._cursor);
if(!e){if(g&&this._expandable(this._cursor)&&this.forceExpandFunc){var c=this;return this.forceExpandFunc(this._cursor,"first",function(b){b&&c.setCursor(b)})}(e=this._findSibling(this._cursor,!0))&&this.setCursor(e)}return e},_backward:function(g){if(!this._cursor)return null;var e=this._findSibling(this._cursor,!1);e&&e!==this._cursor.parent&&(e=this._drillToLast(e));if(g&&e&&this._expandable(e)&&this.forceExpandFunc&&e!==this._cursor.parent){var c=this;return this.forceExpandFunc(e,"last",function(b){b&&
c.setCursor(b)})}e&&this.setCursor(e);return e},_findSibling:function(g,e){for(var c=this.topLevel(g),b=this._getChildren(g.parent),b=c?this.firstLevelChildren:b,a=0;a<b.length;a++)if(b[a]===g)return a===0&&!e?c?null:g.parent:a===b.length-1&&e?c?null:this._findSibling(g.parent,e):e?b[a+1]:b[a-1];return null},_inParentChain:function(g,e){for(var c=g.parent;c;){if(c===e)return!0;c=c.parent}return!1},_getTopLevelParent:function(g){if(this.topLevel(g))return g;for(g=g.parent;g;){if(this.topLevel(g))return g;
g=g.parent}return null},_onCollapse:function(g){return this._expanded(g.parent)?g:this._onCollapse(g.parent)},_scan:function(g,e,c){this.setCursor(e);var b=[];for(b.push(e);;){if(this.iterate(g))b.push(this.cursor());else break;if(c===this.cursor())return b}return null},setCursor:function(g){this._prevCursor=this._cursor;this._cursor=g},setTree:function(g){this.firstLevelChildren=g;if(this.firstLevelChildren.length>0)this.root=this.firstLevelChildren[0].parent},scan:function(g,e){var c=this.cursor(),
b=this._scan(!0,g,e);b||(b=this._scan(!1,g,e));this.setCursor(c);return b},iterate:function(g,e){return g?this._forward(e):this._backward(e)},iterateOnTop:function(g,e){var c=this._findSibling(this._getTopLevelParent(this.cursor()),g);c?this.setCursor(c):e&&this.firstLevelChildren.length>0&&this.setCursor(g?this.firstLevelChildren[0]:this.firstLevelChildren[this.firstLevelChildren.length-1])},collapse:function(g){if(!this._cursor)return null;return this._inParentChain(this._cursor,g)?(this.setCursor(g),
this._cursor):null},reset:function(){this.root=this._prevCursor=this._cursor=null;if(this.firstLevelChildren.length>0)this._cursor=this.firstLevelChildren[0],this.root=this.firstLevelChildren[0].parent},cursorMoved:function(){return this._cursor!==this._prevCursor},cursor:function(){return this._cursor},prevCursor:function(){return this._prevCursor}};return g}();return g});
define("orion/explorers/explorerNavHandler",["i18n!orion/nls/messages","orion/webui/littlelib","orion/treeModelIterator"],function(g,k,j){var g={},e=navigator.userAgent.indexOf("iPad")!==-1,c=window.navigator.platform.indexOf("Mac")!==-1;g.ExplorerNavHandler=function(){function b(a,b,f){this.explorer=a;this.model=this.explorer.model;this._navDict=b;this._listeners=[];this._selections=[];this._currentColumn=0;var d=this._getEventListeningDiv();d.tabIndex=0;d.classList.add("selectionModelContainer");
var c=this;this._modelIterator=new j.TreeModelIterator([],{isExpanded:this.isExpanded.bind(this),getChildrenFunc:f.getChildrenFunc,isExpandable:this.explorer.renderer.isExpandable?function(a){return c.explorer.renderer.isExpandable(a)}:function(a){return c.isExpandable(a)},forceExpandFunc:this.explorer.forceExpandFunc?function(a,d,f){return c.explorer.forceExpandFunc(a,d,f)}:void 0});this._init(f);(!f||f.setFocus!==!1)&&d.focus();a=function(a){if(a.target===d){if(c.explorer.preventDefaultFunc&&c.explorer.preventDefaultFunc(a,
c._modelIterator.cursor()))return!0;if(a.keyCode===k.KEY.DOWN)return c.onDownArrow(a);else if(a.keyCode===k.KEY.UP)return c.onUpArrow(a);else if(a.keyCode===k.KEY.RIGHT)return c.onRightArrow(a);else if(a.keyCode===k.KEY.LEFT)return c.onLeftArrow(a);else if(a.keyCode===k.KEY.SPACE)return c.onSpace(a);else if(a.keyCode===k.KEY.ENTER)return c.onEnter(a)}};d.addEventListener("keydown",a,!1);this._listeners.push({type:"keydown",listener:a});a=function(){if(c.explorer.onFocus)c.explorer.onFocus(!1);else c.toggleCursor(null,
!1)};d.addEventListener("blur",a,!1);this._listeners.push({type:"blur",listener:a});a=function(){if(c.explorer.onFocus)c.explorer.onFocus(!0);else c.toggleCursor(null,!0)};d.addEventListener("focus",a,!1);this._listeners.push({type:"focus",listener:a});this._parentDiv=d}b.prototype={_init:function(a){this._linearGridMove=!1;if(a)this._selectionPolicy=a.selectionPolicy,this.gridClickSelectionPolicy=a.gridClickSelectionPolicy||"none",this.preventDefaultFunc=a.preventDefaultFunc,this.postDefaultFunc=
a.postDefaultFunc},_ctrlKeyOn:function(a){return c?a.metaKey:a.ctrlKey},removeListeners:function(){if(this._listeners)for(var a=0;a<this._listeners.length;a++)this._parentDiv.removeEventListener(this._listeners[a].type,this._listeners[a].listener,!1)},focus:function(){var a=this._getEventListeningDiv();a&&a.focus()},_getEventListeningDiv:function(a){return this.explorer.keyEventListeningDiv&&typeof this.explorer.keyEventListeningDiv==="function"?this.explorer.keyEventListeningDiv(a):k.node(this.explorer._parentId)},
isExpandable:function(a){return!a?!1:k.node(this.explorer.renderer.expandCollapseImageId(this.model.getId(a)))?!0:!1},isExpanded:function(a){return!a?!1:this.explorer.myTree.isExpanded(this.model.getId(a))},refreshSelection:function(a){var b=this;this.explorer.selection&&this.explorer.selection.getSelections(function(f){b._clearSelection();for(var d=0;d<f.length;d++)b._selections.push(f[d]);b._selections.length>0&&b.cursorOn(b._selections[0],!0,!1,a)})},refreshModel:function(a,b,f,d){this._currentColumn=
0;this.topIterationNodes=[];this.model=b;this._navDict=a;if(this.model.getTopIterationNodes)this.topIterationNodes=this.model.getTopIterationNodes();else if(f)this.topIterationNodes=f;this._modelIterator.setTree(this.topIterationNodes);!d&&this.explorer.selection&&this._modelIterator.reset();this.refreshSelection(!0)},getTopLevelNodes:function(){return this._modelIterator.firstLevelChildren},_inSelection:function(a){for(var a=this.model.getId(a),b=0;b<this._selections.length;b++)if(a===this.model.getId(this._selections[b]))return b;
return-1},_clearSelection:function(a){if(a)for(a=0;a<this._selections.length;a++)this._checkRow(this._selections[a],!0);this._selections=[]},setSelection:function(a,b){if(this._selectionPolicy==="cursorOnly")b&&this.explorer.renderer._useCheckboxSelection&&this._checkRow(a,!0);else if(this._isRowSelectable(a)){if(!b||this._selectionPolicy==="singleSelection")this._clearSelection(!0),this._checkRow(a,!1),this._selections.push(a),this._lastSelection=a;else{var f=this._inSelection(a);f>=0?(this._checkRow(a,
!0),this._selections.splice(f,1)):(this._checkRow(a,!1),this._selections.push(a),this._lastSelection=a)}this.explorer.selection&&(this.explorer.renderer.storeSelections(),this.explorer.selection.setSelections(this._selections))}},moveColumn:function(a,b){a||(a=this.currentModel());var f=this._getGridChildren(a);if(f&&f.length>1||b===0&&f){b!==0&&this.toggleCursor(a,!1);var d=this._currentColumn,c=!0;d+=b;d<0?(this._linearGridMove&&b!==0&&(this._modelIterator.iterate(!1)?a=this.currentModel():c=!1),
d=c?f.length-1:this._currentColumn):d>=f.length&&(this._linearGridMove&&b!==0&&(this._modelIterator.iterate(!0)?a=this.currentModel():c=!1),d=c?0:this._currentColumn);this._currentColumn=d;b!==0&&this.toggleCursor(a,!0);return!0}return!1},_getGridChildren:function(a){return this._navDict?this._navDict.getGridNavHolder(a):null},getCurrentGrid:function(a){a||(a=this.currentModel());return(a=this._getGridChildren(a))&&a.length>0?a[this._currentColumn]:null},getAriaContainerElement:function(a){for(var b=
this._parentDiv,f;a&&a!==b&&(f=a.getAttribute("role"))!=="grid"&&f!=="tree"&&f!=="treegrid";)a=a.parentNode;return a===b?null:a},toggleCursor:function(a,b){var f=this.getRowDiv(a),d=this.getCurrentGrid(a);d?(f&&(b?f.classList.add("treeIterationCursorRow"):f.classList.remove("treeIterationCursorRow")),d.domNode&&(f=this.getAriaContainerElement(d.domNode),b?(d.domNode.classList.add("treeIterationCursor"),f&&f.setAttribute("aria-activedescendant",d.domNode.id)):d.domNode.classList.remove("treeIterationCursor"))):
f&&(b?f.classList.add("treeIterationCursorRow_Dotted"):f.classList.remove("treeIterationCursorRow_Dotted"))},currentModel:function(){return this._modelIterator.cursor()},cursorOn:function(a,b,f,d){var f=f===void 0?!1:f,c,e;if(a||b){if(e===this._modelIterator.cursor())return;c=this._modelIterator.cursor();e=a;this._modelIterator.setCursor(e)}else c=this._modelIterator.prevCursor(),e=this._modelIterator.cursor();if(c!==e||b)if(this.toggleCursor(c,!1),!b||e)if(this.moveColumn(null,0),this.toggleCursor(e,
!0),(a=this.getRowDiv())&&!d&&!this._visible(a)&&a.scrollIntoView(!f),this.explorer.onCursorChanged)this.explorer.onCursorChanged(c,e)},getSelection:function(){return this._selections},getSelectionIds:function(){for(var a=[],b=0;b<this._selections.length;b++)a.push(this.model.getId(this._selections[b]));return a},getRowDiv:function(a){a=a?a:this._modelIterator.cursor();if(!a)return null;var a=this.model.getId(a),b=this._navDict.getValue(a);return b&&b.rowDomNode?b.rowDomNode:k.node(a)},iterate:function(a,
b,f){this.topIterationNodes.length!==0&&this._modelIterator.iterate(a,b)&&(this.cursorOn(null,!1,a),f&&this.setSelection(this.currentModel(),!0))},_checkRow:function(a,b){if(this.explorer.renderer._useCheckboxSelection){var f=this.getRowDiv(a);if(f){var d=k.node(this.explorer.renderer.getCheckBoxId(f.id)),c=b?!d.checked:!0;if(c!==d.checked)this.explorer.renderer.onCheck(f,d,c,!0)}}else this._select(a,b)},_vpWidth:function(){return window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth},
_vpHeight:function(){return window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight},_getToolBarHeight:function(a){return(a=k.node(a))?k.bounds(a).height:0},_visible:function(a){if(a.offsetWidth===0||a.offsetHeight===0)return!1;var b=0;b+=this._getToolBarHeight("staticBanner");b+=this._getToolBarHeight("titleArea");b+=this._getToolBarHeight("pageToolbar");var f=this._getEventListeningDiv(!0).getClientRects()[0],d=this._vpHeight();this._vpWidth();for(var b=f.top>b?f.top:
b,f=f.bottom<d?f.bottom:d,a=a.getClientRects(),d=0,c=a.length;d<c;d++){var e=a[d];if(e.top>=b&&e.top<=f&&e.bottom>=b&&e.bottom<=f)return!0}return!1},_select:function(a){a||(a=this._modelIterator.cursor());var b=this.getRowDiv(a);b&&(this._inSelection(a)<0?b.classList.add("checkedRow"):b.classList.remove("checkedRow"))},_onModelGrid:function(a,b){var f=this._getGridChildren(a);if(f)for(var d=0;d<f.length;d++)if(b.target===f[d].domNode)return!0;return!1},onClick:function(a,b){var f=k.node(this.explorer.renderer.expandCollapseImageId(this.model.getId(a)));
if(b.target!==f&&!(this.gridClickSelectionPolicy==="none"&&this._onModelGrid(a,b)))if(this.cursorOn(a,!0,!1,!0),e)this.setSelection(a,!0);else if(this._ctrlKeyOn(b))this.setSelection(a,!0);else if(b.shiftKey&&this._lastSelection){if(f=this._modelIterator.scan(this._lastSelection,a)){this._clearSelection(!0);for(var d=0;d<f.length;d++)this.setSelection(f[d],!0)}}else this.setSelection(a,!1)},onCollapse:function(a){this._modelIterator.collapse(a)&&this.cursorOn()},onUpArrow:function(a){this.iterate(!1,
!1,a.shiftKey);!this._ctrlKeyOn(a)&&!a.shiftKey&&this.setSelection(this.currentModel(),!1);a.preventDefault();return!1},onDownArrow:function(a){this.iterate(!0,!1,a.shiftKey);!this._ctrlKeyOn(a)&&!a.shiftKey&&this.setSelection(this.currentModel(),!1);a.preventDefault();return!1},_shouldMoveColumn:function(a){var b=this.currentModel(),f=this._getGridChildren(b);return f&&f.length>1?this.isExpandable(b)?this._ctrlKeyOn(a):!0:!1},onLeftArrow:function(a){if(this._shouldMoveColumn(a))return this.moveColumn(null,
-1),a.preventDefault(),!0;var b=this._modelIterator.cursor();if(!b)return!1;if(this.isExpandable(b)&&this.isExpanded(b))return this.explorer.myTree.collapse(b),a.preventDefault(),!0;this._modelIterator.topLevel(b)?this.explorer.scopeUp&&typeof this.explorer.scopeUp==="function"&&this.explorer.scopeUp():(this.cursorOn(b.parent),this.setSelection(b.parent,!1))},onRightArrow:function(a){if(this._shouldMoveColumn(a))return this.moveColumn(null,1),a.preventDefault(),!0;var b=this._modelIterator.cursor();
if(!b)return!1;if(this.isExpandable(b)&&!this.isExpanded(b))return this.explorer.myTree.expand(b),a.preventDefault(),!1},_isRowSelectable:function(a){return this.explorer.isRowSelectable?this.explorer.isRowSelectable(a):!0},onSpace:function(a){this.setSelection(this.currentModel(),!0);a.preventDefault()},onEnter:function(a){var b=this.getCurrentGrid(this._modelIterator.cursor());if(b)if(b.widget)if(typeof b.onClick==="function")b.onClick();else typeof b.widget.focus==="function"&&b.widget.focus();
else{var f=document.createEvent("MouseEvents");f.initMouseEvent("click",!0,!0,window,0,0,0,0,0,this._ctrlKeyOn(a),!1,!1,!1,0,null);b.domNode.dispatchEvent(f)}else if(this.explorer.renderer.getRowActionElement&&(b=this._modelIterator.cursor()))if(b=this.explorer.renderer.getRowActionElement(this.model.getId(b)),b.href)this._ctrlKeyOn(a)?window.open(b.href):window.location.href=b.href}};return b}();g.ExplorerNavDict=function(){function b(a){this._dict={};this._model=a}b.prototype={addRow:function(a,
b){this._dict[this._model.getId(a)]={model:a,rowDomNode:b}},getValue:function(a){return this._dict[a]},getGridNavHolder:function(a,b){if(!a)return null;var f=this._model.getId(a);if(this._dict[f]){if(!this._dict[f].gridChildren&&b)this._dict[f].gridChildren=[];return this._dict[f].gridChildren}return null},initGridNavHolder:function(a){if(!a)return null;a=this._model.getId(a);if(this._dict[a])this._dict[a].gridChildren=null}};return b}();return g});
define("orion/explorers/explorer","i18n!orion/nls/messages,require,orion/webui/littlelib,orion/webui/treetable,orion/explorers/explorerNavHandler,orion/commands,orion/commandRegistry".split(","),function(g,k,j,e,c,b){var a={};a.Explorer=function(){function a(b,d,c,e){this.registry=b;this.renderer=c;this.selection=d;this.commandService=e;this.myTree=null}a.prototype={changedItem:function(a,d){this.myTree&&this.myTree.refresh.bind(this.myTree)(a,d,!0)},updateCommands:function(a){this.myTree&&this.myTree._renderer.updateCommands.bind(this.myTree._renderer)(a)},
makeNewItemPlaceHolder:function(a,d,b){a=this.getRow(a);if(b)return a=a.childNodes[b],a.appendChild(document.createElement("br")),b=document.createElement("span"),b.id=d+"placeHolderRow",a.appendChild(b),{tempNode:b,refNode:b};if(a){b=document.createElement("tr");b.id=d+"placeHolderRow";var c=document.createElement("td");c.id=d+"placeHolderCol";b.appendChild(c);a.appendChild(b);b=j.node(d+"placeHolderRow");a=j.node(d+"placeHolderCol");if(b&&a)return{tempNode:b,refNode:a}}return null},getRow:function(a){if(a=
this.model.getId(a))return j.node(a)},collapseAll:function(){for(var a=this._navHandler.getTopLevelNodes(),d=0;d<a.length;d++)this.myTree.collapse(a[d])},expandAll:function(a){if(a)this._expandRecursively(a);else if(this._navHandler)for(var a=this._navHandler.getTopLevelNodes(),d=0;d<a.length;d++)this._expandRecursively(a[d])},_expandRecursively:function(a){if(this._navHandler&&this._navHandler.isExpandable(a)){var d=this;this.myTree.expand(a,function(){d.model.getChildren(a,function(a){if(!(a===
void 0||a===null))for(var b=a.length,f=0;f<b;f++)d._expandRecursively(a[f])})})}},createTree:function(a,d,b){a=typeof a==="string"?a:a.id||a;this.selection&&this.selection.setSelections([]);this.getNavHandler()&&this.getNavHandler()._clearSelection();var i=a+"innerTree",g=j.node(i);g&&j.empty(g);if(d)d.rootId=i;this.model=d;this._parentId=a;this._treeOptions=b;if(!b||b&&!b.noSelection)this.selectionPolicy=b?b.selectionPolicy:"",this._navDict=new c.ExplorerNavDict(this.model);this.myTree=new e.TableTree({id:i,
model:d,parent:a,labelColumnIndex:this.renderer.getLabelColumnIndex(),renderer:this.renderer,showRoot:b?!!b.showRoot:!1,indent:b?b.indent:void 0,onCollapse:b?b.onCollapse:void 0,navHandlerFactory:b?b.navHandlerFactory:void 0,tableElement:b?b.tableElement:void 0,tableBodyElement:b?b.tableBodyElement:void 0,tableRowElement:b?b.tableRowElement:void 0});this.renderer._initializeUIState();this.selectionPolicy==="cursorOnly"&&this.initNavHandler()},getNavHandler:function(){return this._navHandler},getNavDict:function(){return this._navDict},
refreshSelection:function(){if(this.selection){var a=this.getNavHandler(),d=[];if(a&&this.getNavDict())for(var b=a.getSelection(),c=0;c<b.length;c++){var e=a.getRowDiv(b[c]);e&&e.parentNode&&(e=this.getNavDict().getValue(this.model.getId(b[c])),e.model&&d.push(e.model))}this.selection.setSelections(d)}},getRootPath:function(){return this.model&&this.model.root?this.model.root.Location:null},initNavHandler:function(){var a=this._treeOptions;if(!a||a&&!a.noSelection){if(!this.getNavHandler())this._navHandler=
a&&a.navHandlerFactory&&typeof a.navHandlerFactory.createNavHandler==="function"?a.navHandlerFactory.createNavHandler(this,this._navDict,a):new c.ExplorerNavHandler(this,this._navDict,{getChildrenFunc:a?a.getChildrenFunc:null,setFocus:a&&a.setFocus,selectionPolicy:a?a.selectionPolicy:null});var d=this;this.model.getRoot(function(b){b instanceof Array?d.getNavHandler().refreshModel(d.getNavDict(),d.model,b):b.children&&b.children instanceof Array&&d.getNavHandler().refreshModel(d.getNavDict(),d.model,
b.children);a&&a.setFocus&&d.getNavHandler().cursorOn(null,!1,!1,!0)})}},_lastHash:null,checkbox:!1};return a}();a.createExplorerCommands=function(a,f){function d(a){return typeof a.getItemCount==="function"?a.getItemCount()>0?f?f(a):!0:!1:!1}var c=new b.Command({tooltip:g["Expand all"],imageClass:"core-sprite-expandAll",id:"orion.explorer.expandAll",groupId:"orion.explorerGroup",visibleWhen:function(a){return d(a)},callback:function(a){a.items.expandAll()}}),e=new b.Command({tooltip:g["Collapse all"],
imageClass:"core-sprite-collapseAll",id:"orion.explorer.collapseAll",groupId:"orion.explorerGroup",visibleWhen:function(a){return d(a)},callback:function(a){a.items.collapseAll()}});a.addCommand(c);a.addCommand(e)};a.ExplorerModel=function(){function a(b,d,c){this.rootPath=b;this.fetchItems=d;this.idPrefix=c||""}a.prototype={destroy:function(){},getRoot:function(a){var d=this;this.fetchItems(this.rootPath).then(function(b){d.root=b;a(b)})},getChildren:function(a,d){a.Children?d(a.Children):a.ChildrenLocation?
this.fetchItems(a.ChildrenLocation).then(function(b){a.Children=b;d(b)}):d([])},getId:function(a){if(a.Location===this.root.Location)return this.rootId;for(var a=a.Location.replace(/[\\\/]/g,""),d=this.idPrefix,b=0;b<a.length;b++)d+=a[b].match(/[^\.\:\-\_0-9A-Za-z]/g)?a.charCodeAt(b):a[b];return d}};return a}();a.ExplorerFlatModel=function(){function b(a,d,c){this.rootPath=a;this.fetchItems=d;this.root=c}b.prototype=new a.ExplorerModel;b.prototype.getRoot=function(a){if(this.root)a(this.root);else{var d=
this;this.fetchItems(this.rootPath).then(function(b){d.root=b;a(b)})}};b.prototype.getChildren=function(a,d){a===this.root?d(this.root):d([])};return b}();a.ExplorerRenderer=function(){function a(b,d){this.explorer=d;this._init(b);this._expandImageClass="core-sprite-openarrow";this._collapseImageClass="core-sprite-closedarrow";this._twistieSpriteClass="modelDecorationSprite"}a.prototype={_init:function(a){if(a){this._useCheckboxSelection=a.checkbox===void 0?!1:a.checkbox;this.selectionPolicy=a.singleSelection?
"singleSelection":"";this._cachePrefix=a.cachePrefix;this.getCheckedFunc=a.getCheckedFunc;this.onCheckedFunc=a.onCheckedFunc;this._highlightSelection=!0;this._treeTableClass=a.treeTableClass||"treetable";if(a.highlightSelection===!1)this._highlightSelection=!1;if(!this.actionScopeId)this.actionScopeId=a.actionScopeId;if(!this.commandService)this.commandService=a.commandService}},getLabelColumnIndex:function(){return this.explorer.checkbox?1:0},initTable:function(a,d){this.tableTree=d;j.empty(a);this._treeTableClass&&
a.classList.add(this._treeTableClass);this.renderTableHeader(a)},getActionsColumn:function(a,d,b,c,e){var b=b||"tool",i=document.createElement("td");i.id=d.id+"actionswrapper";c&&i.classList.add(c);this.actionScopeId&&this.commandService?this.commandService.renderCommands(this.actionScopeId,i,a,this.explorer,b,null,e&&this.explorer.getNavDict()?this.explorer.getNavDict().getGridNavHolder(a,!0):null):window.console.log("Warning, no command service or action scope was specified.  No commands rendered.");
return i},initCheckboxColumn:function(){if(this._useCheckboxSelection)return document.createElement("th")},getCheckboxColumn:function(a,d){if(this._useCheckboxSelection){var b=document.createElement("td"),c=document.createElement("span");c.id=this.getCheckBoxId(d.id);c.classList.add("core-sprite-check");c.classList.add("selectionCheckmarkSprite");c.rowId=d.id;if(this.getCheckedFunc)c.checked=this.getCheckedFunc(a),c.checked?(this._highlightSelection&&d.classList.add("checkedRow"),c.classList.add("core-sprite-check_on")):
(this._highlightSelection&&d.classList.remove("checkedRow"),c.classList.remove("core-sprite-check_on"));b.appendChild(c);var e=this;c.addEventListener("click",function(a){e.onCheck(d,a.target,a.target.checked?!1:!0,!0)},!1);return b}},getCheckBoxId:function(a){return a+"selectedState"},onCheck:function(a,d,b,c,e){(d.checked=b)?d.classList.add("core-sprite-check_on"):d.classList.remove("core-sprite-check_on");if(this.onCheckedFunc)this.onCheckedFunc(d.rowId,b,c);this.explorer.getNavHandler()&&e&&this.explorer.getNavHandler().setSelection(this.explorer.getNavDict().getValue(a.id).model,
!0)},storeSelections:function(){if(this.explorer.getNavHandler()){var a=this.explorer.getNavHandler().getSelectionIds(),d=this._getUIStatePreferencePath();d&&window.sessionStorage&&(window.sessionStorage[d+"selection"]=JSON.stringify(a))}},_restoreSelections:function(a){a=window.sessionStorage[a+"selection"];typeof a==="string"&&(a=a.length>0?JSON.parse(a):null);var d;if(a&&this.explorer.getNavDict()){var b=[];for(d=0;d<a.length;d++){var c=this.explorer.getNavDict().getValue(a[d]);if(c&&c.rowDomNode&&
c.model&&(b.push(c.model),this._highlightSelection&&c.rowDomNode.classList.add("checkedRow"),c=j.node(this.getCheckBoxId(c.rowDomNode.id))))c.checked=!0,c.classList.add("core-sprite-check_on")}this.explorer.selection&&(this.explorer.selection.setSelections(b),this.explorer.getNavHandler()&&this.explorer.getNavHandler().refreshSelection())}},_storeExpansions:function(a){window.sessionStorage[a+"expanded"]=JSON.stringify(this._expanded)},_restoreExpansions:function(a){var d=!1,b=window.sessionStorage[a+
"expanded"];typeof b==="string"&&(b=b.length>0?JSON.parse(b):null);var c;if(b)for(c=0;c<b.length;c++)if(j.node(b[c])){this._expanded.push(b[c]);var e=this;this.tableTree.expand(b[c],function(){e._restoreSelections(a)});d=!0}return!d},_getUIStatePreferencePath:function(){if(this.explorer){var a=this.explorer.getRootPath();if(this._cachePrefix&&a)return"/"+this._cachePrefix+"/"+a.replace(/[^\.\:\-\_0-9A-Za-z]/g,"")+"/uiState"}return null},expandCollapseImageId:function(a){return a+"__expand"},updateExpandVisuals:function(a,
d){var b=j.node(this.expandCollapseImageId(a.id));b&&(b.classList.add(d?this._expandImageClass:this._collapseImageClass),b.classList.remove(d?this._collapseImageClass:this._expandImageClass))},getExpandImage:function(a,d,b,c){var e=document.createElement("span");e.id=this.expandCollapseImageId(a.id);d.appendChild(e);e.classList.add(this._twistieSpriteClass);e.classList.add(this._collapseImageClass);if(b){var i=document.createElement("span");d.appendChild(i);i.classList.add(c||"imageSprite");i.classList.add(b)}var g=
this;e.onclick=function(){g.tableTree.toggle(a.id);if(g.tableTree.isExpanded(a.id))g._expanded.push(a.id);else for(var d in g._expanded)if(g._expanded[d]===a.id){g._expanded.splice(d,1);break}(d=g._getUIStatePreferencePath())&&window.sessionStorage&&g._storeExpansions(d)};return e},render:function(a,d){d.classList.add("navRow");this.renderRow(a,d)},rowsChanged:function(){this.explorer.selectionPolicy!=="cursorOnly"&&(this.explorer.refreshSelection(),this.explorer.initNavHandler())},updateCommands:function(){if(this.commandService)for(var a=
j.$$array(".treeTableRow"),d=0;d<a.length;d++){var b=a[d],c=j.node(b.id+"actionswrapper");this.commandService.destroy(c);this.actionScopeId&&this.commandService.renderCommands(this.actionScopeId,c,b._item,this.explorer,"tool")}},_initializeUIState:function(){this._expanded=[];var a=this._getUIStatePreferencePath();a&&window.sessionStorage&&this._restoreExpansions(a)&&this._restoreSelections(a)}};return a}();a.SelectionRenderer=function(){function b(a,d){this._init(a);this.explorer=d}b.prototype=new a.ExplorerRenderer;
b.prototype.renderTableHeader=function(a){var d=document.createElement("thead"),b=document.createElement("tr");d.classList.add("navTableHeading");this._useCheckboxSelection&&b.appendChild(this.initCheckboxColumn(a));for(var c=0,e=this.getCellHeaderElement(c);e;)e.innerHTML.length>0&&e.classList.add("navColumn"),b.appendChild(e),e=this.getCellHeaderElement(++c);d.appendChild(b);c>0&&a.appendChild(d)};b.prototype.renderRow=function(a,d){d.verticalAlign="baseline";d.classList.add("treeTableRow");var b=
this.explorer.getNavDict();if(b){b.addRow(a,d);var c=this;d.addEventListener("click",function(d){if(c.explorer.getNavHandler())c.explorer.getNavHandler().onClick(a,d)},!1)}if(b=this.getCheckboxColumn(a,d))b.classList.add("checkColumn"),d.appendChild(b);for(var b=0,e=this.getCellElement(b,a,d);e;)d.appendChild(e),b===0?this.getPrimColumnStyle?e.classList.add(this.getPrimColumnStyle()):e.classList.add("navColumn"):this.getSecondaryColumnStyle?e.classList.add(this.getSecondaryColumnStyle()):e.classList.add("secondaryColumn"),
e=this.getCellElement(++b,a,d)};b.prototype.getCellHeaderElement=function(){};b.prototype.getCellElement=function(){};return b}();a.SimpleFlatModel=function(){function b(a,d,c){this.items=a;this.getKey=c;this.idPrefix=d;this.root={children:a}}b.prototype=new a.ExplorerModel;b.prototype.getRoot=function(a){a(this.root)};b.prototype.destroy=function(){};b.prototype.getId=function(a){for(var a=this.getKey(a).replace(/[\\\/]/g,""),d="",b=0;b<a.length;b++)d+=a[b].match(/[^\.\:\-\_0-9A-Za-z]/g)?a.charCodeAt(b):
a[b];return this.idPrefix+d};b.prototype.getChildren=function(a,d){a===this.root?d(this.items):d([])};return b}();return a});
define("orion/explorers/navigatorRenderer","i18n!orion/navigate/nls/messages,orion/Deferred,orion/webui/littlelib,orion/explorers/explorer,orion/explorers/navigationUtils,orion/extensionCommands,orion/contentTypes".split(","),function(g,k,j,e,c,b){function a(a,d,c,e,i,g,j){var s;if(d.Directory)s=document.createElement("a"),s.className="navlinkonpage",s.href=a+"#"+d.ChildrenLocation,s.appendChild(document.createTextNode(d.Name));else{i||(i=b.getOpenWithCommands(c));if(!g)for(a=0;a<i.length;a++)i[a].isEditor===
"default"&&(g=i[a]);s=document.createElement("a");s.className="navlink targetSelector";j&&typeof j==="object"&&Object.keys(j).forEach(function(a){s[a]=j[a]});s.appendChild(document.createTextNode(d.Name));for(var p=d.Location,r=!1,a=0;a<i.length;a++)if(c=i[a],c.visibleWhen(d)){p=c.hrefCallback({items:d});r=!0;break}k.when(e.getFileContentType(d),function(a){var b;if(b=!r)if(b=g){a:{switch(a&&a.id){case "image/jpeg":case "image/png":case "image/gif":case "image/ico":case "image/tiff":case "image/svg":b=
!0;break a}b=!1}b=!b}b&&(p=g.hrefCallback({items:d}));b=s;var c=d.Location,f;switch(a&&a.id){case "image/jpeg":case "image/png":case "image/gif":case "image/ico":case "image/tiff":case "image/svg":f=document.createElement("img");f.src=c;f.classList.add("thumbnail");break;default:a&&a.image?(f=document.createElement("img"),f.src=a.image,f.classList.add("thumbnail")):(f=document.createElement("span"),f.className="core-sprite-file_model modelDecorationSprite")}b.firstChild?b.insertBefore(f,b.firstChild):
b.appendChild(f);s.href=p})}return s}function i(a,d,b,c){this.explorer=d;this.commandService=b;this.contentTypeService=c;this.openWithCommands=null;this.actionScopeId=a.actionScopeId;this._init(a);this.target="_self"}i.prototype=new e.SelectionRenderer;i.prototype.wrapperCallback=function(a){a.setAttribute("role","tree")};i.prototype.tableCallback=function(a){a.setAttribute("aria-label",g.Navigator);a.setAttribute("role","presentation")};i.prototype.rowCallback=function(a){a.setAttribute("role","treeitem")};
i.prototype.getCellHeaderElement=function(a){if(this.oneColumn&&a!==0)return null;switch(a){case 0:case 1:case 2:document.createElement("th").style.height="8px"}};i.prototype.setTarget=function(a){this.target=a};i.prototype.createFolderNode=function(b){var d;this.showFolderLinks?d=a(this.folderLink||"",b,this.commandService,this.contentTypeService):(d=document.createElement("span"),d.textContent=b.Name);return d};i.prototype.showFolderLinks=!0;i.prototype.getCellElement=function(f,d,e){switch(f){case 0:var f=
document.createElement("td"),i=document.createElement("span");i.id=e.id+"MainCol";i.setAttribute("role","presentation");f.appendChild(i);f.setAttribute("role","presentation");i.className="mainNavColumn";var g;if(d.Directory)this.getExpandImage(e,i),g=this.createFolderNode(d),i.appendChild(g),this.explorer._makeDropTarget(d,g),this.explorer._makeDropTarget(d,e);else{if(!this.openWithCommands){this.openWithCommands=b.getOpenWithCommands(this.commandService);for(g=0;g<this.openWithCommands.length;g++)if(this.openWithCommands[g].isEditor===
"default")this.defaultEditor=this.openWithCommands[g]}g=a("",d,this.commandService,this.contentTypeService,this.openWithCommands,this.defaultEditor,{target:this.target});i.appendChild(g)}if(g)g.id=e.id+"NameLink",g.nodeType===1&&(c.addNavGrid(this.explorer.getNavDict(),d,g),g.setAttribute("role","link"),g.setAttribute("tabindex","-1"));this.actionScopeId&&this.commandService.renderCommands(this.actionScopeId,i,d,this.explorer,"tool",null,!0);return f;case 1:if(this.oneColumn)return null;e=document.createElement("td");
if(d.LocalTimeStamp)e.textContent=(new Date(d.LocalTimeStamp)).toLocaleString();return e;case 2:if(this.oneColumn)return null;e=document.createElement("td");if(!d.Directory&&typeof d.Length==="number")d=parseInt(d.Length,10)/1024,e.textContent=Math.ceil(d).toLocaleString()+" KB";e.style.textAlign="right";return e}};i.prototype.constructor=i;return{NavigatorRenderer:i,createLink:a}});
define("orion/searchClient","i18n!orion/search/nls/messages,require,orion/webui/littlelib,orion/i18nUtil,orion/searchUtils,orion/crawler/searchCrawler,orion/explorers/navigatorRenderer,orion/extensionCommands,orion/Deferred".split(","),function(g,k,j,e,c,b,a,i,f){function d(a,d){this.serviceRegistry=a;this.commandRegistry=d;this.openWithCommands=null}function h(a){this.registry=a.serviceRegistry;this._commandService=a.commandService;this._fileService=a.fileService;this.defaultRenderer=new d(this.registry,
this._commandService);this._fileService||console.error("No file service on search client")}d.prototype.makeRenderFunction=function(d,b,c,h,s){var p=this.serviceRegistry,r=this.commandRegistry;this.openWithCommands=this.openWithCommands||i.createOpenWithCommands(p,d,r);var t=this;return function(o,i,x){f.when(t.openWithCommands,function(f){if(x)j.empty(b),f=document.createElement("div"),f.appendChild(document.createTextNode(g["Search failed."])),b.appendChild(f),typeof h==="function"&&h(b);else{var w=
function(){function a(d,b){var c=b.folderName?b.folderName:b.path,f=document.createElement("span");f.id=c.replace(/[^a-zA-Z0-9_\.:\-]/g,"");f.appendChild(document.createTextNode(" - "+c+" "));d.appendChild(f)}var d={};return function(b,c){var f=c.name;if(d.hasOwnProperty(f)){a(b,c);var o=d[f];typeof o==="function"&&(d[f]=null,o())}else d[f]=function(){a(b,c)}}}(),z=!1;j.empty(b);if(o&&o.length>0){var A=document.createElement("table");A.setAttribute("role","presentation");for(var B=0;B<o.length;B++){var p=
o[B],G;if(!z&&(z=!0,c))G=A.insertRow(0).insertCell(0),G.textContent=c;G=A.insertRow(-1).insertCell(0);G.colspan=2;s&&s(G);var D={Name:p.name,Directory:p.directory,Location:p.path||p.location},D=a.createLink(k.toUrl("navigate/table.html"),D,r,d,f,null,{"aria-describedby":(p.folderName?p.folderName:p.path).replace(/[^a-zA-Z0-9_\.:\-]/g,""),style:{verticalAlign:"middle"}});p.LineNumber&&D.appendChild(document.createTextNode(" (Line "+p.LineNumber+")"));G.appendChild(D);w(G,p)}b.appendChild(A);typeof h===
"function"&&h(b)}!z&&i&&(f=e.formatMessage(g["No matches found for ${0}"],i),j.empty(b),b.appendChild(document.createTextNode(f)),typeof h==="function"&&h(b))}})}};h.prototype={search:function(a,d,f){var e=function(a){for(var d=[],b=0;b<a.response.docs.length;b++){var f=a.response.docs[b];d.push({name:f.Name,path:f.Location,folderName:c.path2FolderName(f.Path?f.Path:f.Location,f.Name),directory:f.Directory,lineNumber:f.LineNumber})}return d};if(this._crawler&&a.nameSearch)this._crawler.searchName(a,
function(a){f(e(a),null)});else try{this.registry.getService("orion.page.progress").progress(this._fileService.search(a),"Searching "+a.keyword).then(function(d){var b=a.keyword,b=b.substring(b.indexOf("}")+1),b=b.substring(b.indexOf(":")+1);f(e(d),b)},function(a){f(null,null,a)})}catch(h){typeof h==="string"&&h.indexOf("search")>-1&&this._crawler?this._crawler.searchName(a,function(a){f(e(a),null)}):typeof h==="string"&&h.indexOf("search")>-1&&!a.nameSearch?(new b.SearchCrawler(this.registry,this._fileService,
a,{childrenLocation:this.getChildrenLocation()})).search(function(a){f(e(a),null)}):this.registry.getService("orion.page.message").setErrorMessage(h)}},getFileService:function(){return this._fileService},setCrawler:function(a){this._crawler=a},handleError:function(a,d){console.error(a);j.empty(d);d.appendChild(document.createTextNode(a));return a},setLocationByMetaData:function(a,d){var b="",c=null;this._searchRootLocation=this._fileService.fileServiceRootURL(a.Location);d&&a&&a.Parents&&a.Parents.length>
0?c=d.index==="last"?a.Parents[a.Parents.length-1]:a.Parents[0]:a&&a.Directory&&a.Location&&a.Parents&&(c=a);if(c)this.setLocationbyURL(c.Location),b=c.Name,this._childrenLocation=c.ChildrenLocation;else if(a)this.setLocationbyURL(this._searchRootLocation),b=this._fileService.fileServiceName(a.Location),this._childrenLocation=a.ChildrenLocation;c=j.node("search");b||(b="");if(c&&c.placeholder){c.value="";var f=e.formatMessage(g["Search ${0}"],b);c.placeholder=f.length>30?f.substring(0,27)+"...":e.formatMessage(g["Search ${0}"],
b)}if(c&&c.title)c.title=g["Type a keyword or wild card to search in "]+b},setLocationbyURL:function(a){this._searchLocation=a},setRootLocationbyURL:function(a){this._searchRootLocation=a},setChildrenLocationbyURL:function(a){this._childrenLocation=a},getSearchLocation:function(){return this._searchLocation?this._searchLocation:this._fileService.fileServiceRootURL()},getSearchRootLocation:function(){return this._searchRootLocation?this._searchRootLocation:this._fileService.fileServiceRootURL()},getChildrenLocation:function(){return this._childrenLocation?
this._childrenLocation:this._fileService.fileServiceRootURL()},createSearchParams:function(a,d,b,c){b=b?this.getSearchRootLocation():this.getSearchLocation();return d?{resource:b,sort:"NameLower asc",rows:100,start:0,nameSearch:!0,keyword:a}:{resource:b,sort:c&&c.sort?c.sort:"Path asc",rows:c&&c.rows?c.rows:40,start:0,caseSensitive:c?c.caseSensitive:void 0,regEx:c?c.regEx:void 0,fileType:c?c.fileType:void 0,keyword:a,replace:c?c.replace:void 0}}};h.prototype.constructor=h;return{Searcher:h}});
define("orion/section",["orion/webui/littlelib","orion/selection","orion/commandRegistry","orion/commonHTMLFragments"],function(g,k,j,e){function c(a,b){var c=this;this._expandImageClass="core-sprite-openarrow";this._collapseImageClass="core-sprite-closedarrow";this._twistieSpriteClass="modelDecorationSprite";if(!b.id)throw Error("Missing required argument: id");this.id=b.id;if(!b.title)throw Error("Missing required argument: title");var d=b.useAuxStyle?["sectionWrapper","sectionWrapperAux","toolComposite"]:
["sectionWrapper","toolComposite"];this.domNode=document.createElement("div");a.appendChild(this.domNode);for(var h=0;h<d.length;h++)this.domNode.classList.add(d[h]);this.domNode.id=b.id;if(b.canHide)this.twistie=document.createElement("span"),this.twistie.classList.add("modelDecorationSprite"),this.twistie.classList.add("layoutLeft"),this.twistie.classList.add("sectionTitle"),this.domNode.style.cursor="pointer",this.domNode.appendChild(this.twistie),this.domNode.tabIndex=0,this.domNode.addEventListener("click",
function(a){(a.target===c.titleNode||a.target===c.twistie)&&c._changeExpandedState()},!1),this.domNode.addEventListener("keydown",function(a){a.keyCode===g.KEY.ENTER&&(a.target===c.domNode||a.target===c.titleNode||a.target===c.twistie)&&c._changeExpandedState()},!1);if(b.iconClass){var l=document.createElement("span");l.classList.add("sectionIcon");this.domNode.appendChild(l);(Array.isArray(b.iconClass)?b.iconClass:[b.iconClass]).forEach(function(a){l.classList.add(a)})}this.titleNode=document.createElement("div");
this.titleNode.id=b.id+"Title";this.titleNode.classList.add("sectionAnchor");this.titleNode.classList.add("sectionTitle");this.titleNode.classList.add("layoutLeft");this.domNode.appendChild(this.titleNode);this.titleNode.textContent=b.title;if(typeof b.getItemCount==="function")d=document.createElement("div"),d.classList.add("layoutLeft"),d.classList.add("sectionItemCount"),this.domNode.appendChild(d),d.textContent=b.getItemCount(this);this._progressNode=document.createElement("div");this._progressNode.id=
b.id+"Progress";this._progressNode.classList.add("sectionProgress");this._progressNode.classList.add("sectionTitle");this._progressNode.classList.add("layoutLeft");this._progressNode.style.visibility="hidden";this._progressNode.textContent="...";this.domNode.appendChild(this._progressNode);d=document.createElement("div");d.id=b.id+"FilterSearchBox";this.domNode.appendChild(d);this._toolActionsNode=document.createElement("div");this._toolActionsNode.id=b.id+"ToolActionsArea";this._toolActionsNode.classList.add("layoutRight");
this._toolActionsNode.classList.add("sectionActions");this.domNode.appendChild(this._toolActionsNode);this.actionsNode=document.createElement("div");this.actionsNode.id=b.id+"ActionArea";this.actionsNode.classList.add("layoutRight");this.actionsNode.classList.add("sectionActions");this.domNode.appendChild(this.actionsNode);this.selectionNode=document.createElement("div");this.selectionNode.id=b.id+"SelectionArea";this.selectionNode.classList.add("layoutRight");this.selectionNode.classList.add("sectionActions");
this.domNode.appendChild(this.selectionNode);b.slideout&&(d=e.slideoutHTMLFragment(b.id),h=document.createRange(),h.selectNode(this.domNode),d=h.createContextualFragment(d),this.domNode.appendChild(d));this._contentParent=document.createElement("div");this._contentParent.id=this.id+"Content";this._contentParent.role="region";this._contentParent.classList.add("sectionTable");this._contentParent.setAttribute("aria-labelledby",this.titleNode.id);a.appendChild(this._contentParent);b.content&&this.setContent(b.content);
this.hidden=b.hidden;if(typeof b.onExpandCollapse==="function")this._onExpandCollapse=b.onExpandCollapse;this._preferenceService=b.preferenceService;this._contentParent.style.display="none";if(this._preferenceService){var n=this;this._preferenceService.getPreferences("/window/views").then(function(a){a=a.get(n.id);if(a!==void 0)n.hidden=!a;if(!n.hidden)n._contentParent.style.display="block";n._updateExpandedState(!n.hidden,!1)})}else{if(!this.hidden)this._contentParent.style.display="block";this._updateExpandedState(!this.hidden,
!1)}this._commandService=b.commandService;this._lastMonitor=0;this._loading={}}function b(a){this._section=a;this._id=++a._lastMonitor}c.prototype={setTitle:function(a){this.titleNode.textContent=a},setContent:function(a){typeof a==="string"?this._contentParent.innerHTML=a:(this._contentParent.innerHTML="",this._contentParent.appendChild(a))},getContentElement:function(){return this._contentParent},createProgressMonitor:function(){return new b(this)},_setMonitorMessage:function(a,b){this._progressNode.style.visibility=
"visible";this._loading[a]=b;var c="",d;for(d in this._loading)c!==""&&(c+="\n"),c+=this._loading[d];this._progressNode.title=c},_monitorDone:function(a){delete this._loading[a];var a="",b;for(b in this._loading)a!==""&&(a+="\n"),a+=this._loading[b];this._progressNode.title=a;if(a==="")this._progressNode.style.visibility="hidden"},_changeExpandedState:function(){this.hidden?(this._contentParent.style.display="block",this.hidden=!1):(this._contentParent.style.display="none",this.hidden=!0);this._updateExpandedState(!this.hidden,
!0)},_updateExpandedState:function(a,b){var c=this.twistie,d=this.id;c&&(c.classList.add(a?this._expandImageClass:this._collapseImageClass),c.classList.remove(a?this._collapseImageClass:this._expandImageClass));this._preferenceService&&b&&this._preferenceService.getPreferences("/window/views").then(function(b){b.put(d,a)});this._onExpandCollapse&&this._onExpandCollapse(a,this)}};c.prototype.constructor=c;b.prototype={begin:function(a){this.status=a;this._section._setMonitorMessage(this.id,a)},worked:function(a){this.status=
a;this._section._setMonitorMessage(this.id,a)},done:function(a){this.status=a;this._section._monitorDone(this.id)}};b.prototype.constructor=b;return{Section:c}});
define("orion/compare/nls/root/messages",{"Copy current change from right to left":"Copy current change from right to left","Copy current change from left to right":"Copy current change from left to right","Switch to unified diff":"Switch to unified diff",Unified:"Unified","Switch to side by side diff":"Switch to side by side diff","Side by side":"Side by side","Generate link of the current diff":"Generate link of the current diff","Generate Link":"Generate Link","Next diff block":"Next diff block",
"Previous diff block":"Previous diff block","Next diff change":"Next diff change","Previous diff change":"Previous diff change","Copy the link URL:":"Copy the link URL:",Compare:"Compare","Open the compare page":"Open the compare page","fetching...":"fetching...","There are unsaved changes.":"There are unsaved changes.","ERROR: ":"ERROR: ","Compare...":"Compare...","files changed":" files changed",Location:"Location",Options:"Options","Sort by folders":"Sort by folders","Line 0 : Col 0":"Line 0 : Col 0",
"No Matching DiffService for location:":"No Matching DiffService for location:"});define("orion/compare/nls/messages",["orion/i18n!orion/compare/nls/messages","orion/compare/nls/root/messages"],function(g,k){var j={root:k};Object.keys(g).forEach(function(e){typeof j[e]==="undefined"&&(j[e]=g[e])});return j});
define("orion/compare/compareCommands",["i18n!orion/compare/nls/messages","orion/commands","orion/keyBinding","orion/webui/littlelib"],function(g,k,j,e){var c={};c.CompareCommandFactory=function(){function b(a){this.setOptions(a,!0)}b.prototype={setOptions:function(a,b){if(b)this.options={};if(!this.options)this.options={};a&&Object.keys(a).forEach(function(b){this.options[b]=a[b]}.bind(this))},getOptions:function(){return this.options},initCommands:function(a){var b=this.options.commandSpanId,c=
this.options.commandService;if(c&&b){var d=new k.Command({name:g["Copy current change from right to left"],tooltip:g["Copy current change from right to left"],imageClass:"core-sprite-leftarrow",id:"orion.compare.copyToLeft",groupId:"orion.compareGroup",visibleWhen:function(){return a.type==="twoWay"&&a.options.newFile&&!a.options.newFile.readonly}.bind(this),callback:function(a){a.items.copyToLeft()}}),e=new k.Command({name:g["Copy current change from left to right"],tooltip:g["Copy current change from left to right"],
imageClass:"core-sprite-rightarrow",id:"orion.compare.copyToRight",groupId:"orion.compareGroup",visibleWhen:function(){return a.type==="twoWay"&&a.options.oldFile&&!a.options.oldFile.readonly}.bind(this),callback:function(a){a.items.copyToRight()}}),l=new k.Command({tooltip:g["Switch to unified diff"],name:g.Unified,id:"orion.compare.toggle2Inline",groupId:"orion.compareGroup",visibleWhen:function(a){return a.options.toggler&&a.options.toggler.getWidget().type==="twoWay"},callback:function(a){a.items.options.toggler.toggle()}}),
n=new k.Command({tooltip:g["Switch to side by side diff"],name:g["Side by side"],id:"orion.compare.toggle2TwoWay",groupId:"orion.compareGroup",visibleWhen:function(a){return a.options.toggler&&a.options.toggler.getWidget().type==="inline"},callback:function(a){a.items.options.toggler.toggle()}}),m=new k.Command({name:g["Next diff block"],tooltip:g["Next diff block"],imageClass:"core-sprite-move_down",id:"orion.compare.nextDiff",groupId:"orion.compareGroup",callback:function(a){a.items.nextDiff()}}),
q=new k.Command({name:g["Previous diff block"],tooltip:g["Previous diff block"],imageClass:"core-sprite-move_up",id:"orion.compare.prevDiff",groupId:"orion.compareGroup",callback:function(a){a.items.prevDiff()}}),s=new k.Command({name:g["Next diff change"],tooltip:g["Next diff change"],imageClass:"core-sprite-move_down",id:"orion.compare.nextChange",groupId:"orion.compareGroup",callback:function(a){a.items.nextChange()}}),p=new k.Command({name:g["Previous diff change"],tooltip:g["Previous diff change"],
imageClass:"core-sprite-move_up",id:"orion.compare.prevChange",groupId:"orion.compareGroup",callback:function(a){a.items.prevChange(a)}});c.addCommand(d);c.addCommand(e);c.addCommand(n);c.addCommand(l);c.addCommand(m);c.addCommand(q);c.addCommand(s);c.addCommand(p);c.registerCommandContribution(b,"orion.compare.toggle2Inline",108);c.registerCommandContribution(b,"orion.compare.toggle2TwoWay",109);c.registerCommandContribution(b,"orion.compare.copyToLeft",110,null,!1,new j.KeyBinding(37,!0,!1,!0));
c.registerCommandContribution(b,"orion.compare.copyToRight",111,null,!1,new j.KeyBinding(39,!0,!1,!0));c.registerCommandContribution(b,"orion.compare.nextDiff",112,null,!1,new j.KeyBinding(40,!0));c.registerCommandContribution(b,"orion.compare.prevDiff",113,null,!1,new j.KeyBinding(38,!0));a.options.wordLevelNav?(c.registerCommandContribution(b,"orion.compare.nextChange",114,null,!1,new j.KeyBinding(40,!0,!0)),c.registerCommandContribution(b,"orion.compare.prevChange",115,null,!1,new j.KeyBinding(38,
!0,!0))):(c.registerCommandContribution(b,"orion.compare.nextChange",114,null,!0,new j.KeyBinding(40,!0,!0)),c.registerCommandContribution(b,"orion.compare.prevChange",115,null,!0,new j.KeyBinding(38,!0,!0)))}},renderCommands:function(a){var b=this.options.commandSpanId,c=this.options.commandService;c&&b&&(e.empty(e.node(b)),this.options.gridRenderer&&this.options.gridRenderer.navGridHolder?(this.options.gridRenderer.navGridHolder.splice(0,this.options.gridRenderer.navGridHolder.length),this.options.gridRenderer.additionalCmdRender?
this.options.gridRenderer.before?(this.options.gridRenderer.additionalCmdRender(this.options.gridRenderer.navGridHolder),c.renderCommands(b,b,a,a,"tool",null,this.options.gridRenderer.navGridHolder)):(c.renderCommands(b,b,a,a,"tool",null,this.options.gridRenderer.navGridHolder),this.options.gridRenderer.additionalCmdRender(this.options.gridRenderer.navGridHolder)):c.renderCommands(b,b,a,a,"tool",null,this.options.gridRenderer.navGridHolder)):c.renderCommands(b,b,a,a,"tool",null))}};return b}();return c});
define("orion/compare/compareUtils",["orion/URITemplate"],function(g){var k=k||{};k.compareUtils=k.compareUtils||{};k.compareUtils.lookUpMapper=function(g,e,c){for(var b=0,a=0;a<g.length;a++){var i=g[a][e];i===0&&(i=1);if(c>=b&&c<b+i)return{mapperIndex:a,startFrom:b};if(a===g.length-1)break;b+=g[a][e]}return{mapperIndex:g.length-1,startFrom:b}};k.compareUtils.lookUpLineIndex=function(g,e,c){if(c===0)return 0;for(var b=0,a=0;a<c;a++)b+=g[a][e];return b};k.compareUtils.updateMapper=function(g,e,c,b,
a){if(b!==a&&(b>0||a>0)){var i=k.compareUtils.lookUpMapper(g,e,c);if(!(i.mapperIndex<0)){if(b>0)for(var f=c-i.startFrom,c=i.mapperIndex;c<g.length;c++){f=g[c][e]-f;if(b<=f){g[c][e]-=b;break}g[c][e]-=f;b-=f;f=0}a>0&&(g[i.mapperIndex][e]+=a)}}};k.compareUtils.overlapMapper=function(g,e,c,b,a){g=c+g[e]-1;g<c&&(g=c);a<b&&(a=b);return g<b||a<c?!1:!0};k.compareUtils.findFirstDiff=function(g,e,c,b){for(var a=0,i=null,f=0;f<g.length;f++){if(a>b)break;if(k.compareUtils.overlapMapper(g[f],e,a,c,b)&&(i={mapperIndex:f,
startFrom:a},g[f][2]!==0))break;a+=g[f][e]}return i};k.compareUtils.matchMapper=function(g,e,c,b){if(g.length===0)return c;var a=c+Math.round((b-c)/3),i=k.compareUtils.findFirstDiff(g,e,c,b),f=g[i.mapperIndex][e]===0?i.startFrom:i.startFrom+g[i.mapperIndex][e]-1,d=k.compareUtils.lookUpLineIndex(g,1-e,i.mapperIndex),h=i.startFrom-c;return g[i.mapperIndex][2]===0?d-h:a>=i.startFrom&&a<=f?d-Math.round((b-c)/3):a<i.startFrom?d-h:(g[i.mapperIndex][1-e]===0?d:d+g[i.mapperIndex][1-e]-1)-(f-c)};k.compareUtils.getMapperLineCount=
function(g){for(var e=0,c=0;c<g.length;c++)e+=Math.max(g[c][0],g[c][1]);return e};k.compareUtils.getAnnotationIndex=function(g,e){for(var c=0;c<g.length;c++)if(g[c][0]===e)return c;return-1};k.compareUtils.getAnnotationMapperIndex=function(g,e){return g[e][1]};k.compareUtils.getAnnotationIndexByMapper=function(g,e){for(var c=0;c<g.length;c++)if(g[c][1]===e)return{current:c,prev:c-1,next:c+1};return{current:-1,prev:-1,next:-1}};k.compareUtils.isMapperConflict=function(g,e){return e<0?!1:!g[e][3]?!1:
g[e][3]===1};k.compareUtils.mergeDiffBlocks=function(g,e,c,b,a,i){for(var f=0;f<e.length;f++){var d=e[f][0],h=c[e[f][1]];if(h[0]>0){for(var l="",n=0;n<h[0];n++)l=l+b[h[2]-1+n].substring(a)+i;h=g.getLineCount();d>=h&&(d=h-1);d=g.getLineStart(d);g.setText(l,d,d)}}};k.compareUtils.generateCompareHref=function(j,e){var c=require.toUrl("compare/compare.html");if(!e.conflict)e.conflict=void 0;if(!e.readonly)e.readonly=void 0;return(new g(c+"#{,resource,params*}")).expand({resource:j,params:e})};k.compareUtils.generateCompareTreeHref=
function(j,e){var c=require.toUrl("compare-tree/compare-tree.html");return(new g(c+"#{,resource,params*}")).expand({resource:j,params:e})};return k.compareUtils});
define("orion/compare/diffProvider",["i18n!orion/compare/nls/messages","orion/Deferred"],function(g,k){function j(c,b,a){var e=new k;c[b].apply(c,a).then(function(a){e.resolve(a)},function(a){e.reject(a)});return e}function e(c,b){var a=c.getServiceReferences("orion.core.diff"),e,f=a;if(b){f=[];for(e=0;e<a.length;++e)b(a[e])&&f.push(a[e])}var d=[],h=[];for(e=0;e<f.length;++e)d[e]=RegExp(f[e].getProperty("pattern")||".*"),h[e]=c.getService(f[e]);this._getService=function(a){if(a.indexOf("://")===-1){var b=
document.createElement("a");b.href=a;a=b.href}for(b=0;b<d.length;++b)if(d[b].test(a))return h[b];throw g["No Matching DiffService for location:"]+a;}}e.prototype={getDiffContent:function(c){return j(this._getService(c),"getDiffContent",arguments)},getDiffFileURI:function(c){return j(this._getService(c),"getDiffFileURI",arguments)}};return{DiffProvider:e}});
define("orion/compare/diffParser",[],function(){var g=g||{};g.DiffParser=function(){function g(e,c){this._lineDelimiter=e?e:j?"\r\n":"\n";this._diffLineDelimiter=c?c:this._lineDelimiter;this._DEBUG=!1}var j=window.navigator.platform.indexOf("Win")!==-1;g.prototype={_init:function(){this._oFileContents=[];this._diffContents=[];this._oBlocks=[];this._nBlocks=[];this._hunkRanges=[];this._lastToken=" ";this._deltaMap=[];this._nFileContents=[];this._nNewLineAtEnd=this._oNewLineAtEnd=!0;this._diffContentIndex=
1},setLineDelim:function(e){this._diffLineDelimiter=this._lineDelimiter=e},getDiffArray:function(){return{array:this._diffContents,index:this._diffContentIndex}},parse:function(e,c,b,a){this._init();if(c==="")return{outPutFile:e,mapper:[]};this._oFileContents=e===""?[]:e.split(this._lineDelimiter);this._diffContents=c.split(this._diffLineDelimiter);c=this._diffContents.length;this._hunkRanges=[];for(var i=0;i<c;i++){var f=this._parseHunkRange(i);f&&this._hunkRanges.push(f)}if(0===this._hunkRanges.length)return{outPutFile:e,
mapper:[]};this._DEBUG&&(console.log("***Diff contents: \n"),this._diffContents.forEach(function(a){console.log(a)}),console.log("***Hunk ranges: \n"),console.log(JSON.stringify(this._hunkRanges)));for(e=0;e<this._hunkRanges.length;e++)this._parseHunkBlock(e);this._DEBUG&&(console.log("***Original Hunk range blocks: \n"),console.log(JSON.stringify(this._oBlocks)),console.log("***New Hunk range blocks: \n"),console.log(JSON.stringify(this._nBlocks)));this._buildMap(b);this._DEBUG&&(console.log("***New Line at end of file(original): \n"),
console.log(JSON.stringify(this._oNewLineAtEnd)),console.log("***New Line at end of file(new): \n"),console.log(JSON.stringify(this._nNewLineAtEnd)),console.log("***Mapper: \n"),this._logMap(),console.log("***Total line number in original file: "+this._oFileContents.length));a||this._buildNewFile();return{outPutFile:this._nFileContents.join(this._diffLineDelimiter),mapper:this._deltaMap}},_logMap:function(){for(var e=0;e<this._deltaMap.length;e++)if(console.log(JSON.stringify(this._deltaMap[e])),
this._deltaMap[e][2]>0){console.log("    **Diff content on change/add: \n");for(var c=0;c<this._deltaMap[e][0];c++)console.log("    "+this._diffContents[this._deltaMap[e][2]+c-1])}},_logNewFile:function(){for(var e=0;e<this._nFileContents.length;e++)console.log(this._nFileContents[e])},_createBlock:function(e,c,b,a){a===b&&e===" "||(b=[b,a-b,"s"],e==="-"?b[2]="r":e==="+"?b[2]="a":e==="c"&&(b[2]="c"),c.push(b))},_createMinusBlock:function(e,c,b){var a=this._oBlocks.length;a===0||e!==this._oBlocks[a-
1][0]?(this._oBlocks.push([e===0?1:e,b]),this._nBlocks.push([c,0,-2])):this._oBlocks[a-1][1]+=b},_createPlusBlock:function(e,c,b,a){var i=this._nBlocks.length;i===0||c!==this._nBlocks[i-1][0]?(this._oBlocks.push([e===0?1:e,0]),this._nBlocks.push([c,b,a])):(this._nBlocks[i-1][1]+=b,this._nBlocks[i-1][2]=a)},_parseHunkBlock:function(e){for(var c=" ",b=this._hunkRanges[e][0]+1,a=e===this._hunkRanges.length-1?this._diffContents.length:this._hunkRanges[e+1][0],i=0,f=0,d=this._hunkRanges[e][1],h=this._hunkRanges[e][3],
g=b,n=b;n<a;n++)if(0!==this._diffContents[n].length){var m=this._diffContents[n][0];if(m==="\\"&&("\\ No newline at end of file"===this._diffContents[n].substring(0,this._diffContents[n].length-1)||"\\ No newline at end of file"===this._diffContents[n]))c==="-"?this._oNewLineAtEnd=!1:c===" "?this._oNewLineAtEnd=this._nNewLineAtEnd=!1:this._nNewLineAtEnd=!1,n>b&&this._diffContents[n-1][this._diffContents[n-1].length-1]==="\r"&&(this._diffContents[n-1]=this._diffContents[n-1].substring(0,this._diffContents[n-
1].length-1));else{switch(m){case "-":case "+":case " ":break;default:continue}if(c!==m){m==="+"&&(g=n);switch(c){case " ":d=this._hunkRanges[e][1]+i;h=this._hunkRanges[e][3]+f;break;case "-":this._createMinusBlock(d,h,this._hunkRanges[e][1]+i-d);break;case "+":this._createPlusBlock(d,h,this._hunkRanges[e][3]+f-h,g)}c=m}switch(m){case "-":i++;break;case "+":f++;break;case " ":i++,f++}}}switch(c){case "-":this._createMinusBlock(d,h,this._hunkRanges[e][1]+i-d);break;case "+":this._createPlusBlock(d,
h,this._hunkRanges[e][3]+f-h,g)}},_detectConflictes:function(e,c){if(e<0)return!1;for(var b=e+c,a=e;a<b;a++){var i=this._diffContents[a];if(i.indexOf("<<<<<")>-1||i.indexOf(">>>>>")>-1)return!0}return!1},_buildMap:function(e){var c=this._oBlocks.length,b=this._oFileContents.length,a=0,i;i=1;for(var f=0;f<c;f++)i=this._oBlocks[f][0]-i,i>0&&(this._deltaMap.push([i,i,0]),a+=i),e&&this._detectConflictes(this._nBlocks[f][2],this._nBlocks[f][1])?this._deltaMap.push([this._nBlocks[f][1],this._oBlocks[f][1],
this._nBlocks[f][2]+1,1]):this._deltaMap.push([this._nBlocks[f][1],this._oBlocks[f][1],this._nBlocks[f][2]+1]),a+=this._oBlocks[f][1],i=this._oBlocks[f][0]+this._oBlocks[f][1];0<b-i&&(this._deltaMap.push([b-i+1,b-i+1,0]),a+=b-i+1);a<b&&(i=b-a,e=this._deltaMap[this._deltaMap.length-1],e[2]===0?(e[0]+=i,e[1]+=i):e[2]===-1?this._deltaMap.push([i,i,0]):this._nNewLineAtEnd===this._oNewLineAtEnd?this._deltaMap.push([i,i,0]):(this._nNewLineAtEnd&&(e[0]+=i),this._oNewLineAtEnd&&(e[1]+=i)))},_buildNewFile:function(){var e=
1,c=!1,b=this._deltaMap.length,a,i;for(a=0;a<b;a++){c=!1;if(this._deltaMap[a][2]===0){for(i=0;i<this._deltaMap[a][0];i++)this._nFileContents.push(this._oFileContents[e+i-1]);c=!0}else if(this._deltaMap[a][2]>0)for(i=0;i<this._deltaMap[a][0];i++)this._nFileContents.push(this._diffContents[this._deltaMap[a][2]+i-1].substring(1));e+=this._deltaMap[a][1]}this._nNewLineAtEnd&&!c&&this._nFileContents.push("")},_parseHRangeBody:function(e,c){if(0<e.indexOf(",")){var b=e.split(","),a=parseInt(b[0],10),b=
parseInt(b[1],10);c.push(a>=0?a:1);c.push(b>=0?b:1)}else a=parseInt(e,10),c.push(a>=0?a:1),c.push(1)},_parseHunkRange:function(e){var c=this._diffContents[e];if(8>c.length)return null;if("@@"!==c.substring(0,2))return null;var c=c.substring(2),b=c.indexOf("@@");if(b<0)return null;var c=c.substring(0,b),b=c.indexOf("-"),a=c.indexOf("+");if(b<0||a<0)return null;e=[e];b<a?(c=c.substring(b+1).split("+"),this._parseHRangeBody(c[0],e),this._parseHRangeBody(c[1],e)):(c=c.substring(a+1).split("-"),this._parseHRangeBody(c[1],
e),this._parseHRangeBody(c[0],e));return e}};return g}();return g});
define("orion/compare/compareRulers",["orion/compare/compareUtils"],function(g){var k=k||{};k.CompareRuler=function(){function g(e,c,b){this._location=e||"left";this._overview=c||"page";this._rulerStyle=b;this._editor=null;var a=this;this._listener={onModelChanged:function(b){a._onModelChanged(b)}}}g.prototype={setView:function(e){this._onModelChanged&&this._editor&&this._editor.removeEventListener("ModelChanged",this._listener.onModelChanged);this._editor=e;this._onModelChanged&&this._editor&&this._editor.addEventListener("ModelChanged",
this._listener.onModelChanged)},getLocation:function(){return this._location},getOverview:function(){return this._overview},getAnnotationModel:function(){return null},addAnnotationType:function(){},isAnnotationTypeVisible:function(){return!1},removeAnnotationType:function(){},setAnnotationModel:function(){},getAnnotations:function(e,c){for(var b=[],a=e;a<c;a++){var i=this.getStyle(a);i&&(b[a]={html:this.getHTML(a),style:i})}return b},getWidestAnnotation:function(){return{html:this.getHTML(-1),style:this.getStyle(-1)}},
getRulerStyle:function(){return this.getStyle(void 0)}};return g}();k.LineNumberCompareRuler=function(){function g(e,c,b,a,i,f){k.CompareRuler.call(this,b,"page",a);this._diffNavigator=e;this._oddStyle=i||{style:{backgroundColor:"white"}};this._evenStyle=f||{style:{backgroundColor:"white"}};this._numOfDigits=0;this._mapperColumnIndex=c}g.prototype=new k.CompareRuler;g.prototype.getStyle=function(e){return e===void 0?this._rulerStyle:this._evenStyle};g.prototype.getHTML=function(e){var c=this._editor.getModel(),
b=this._diffNavigator.getFeeder(this._mapperColumnIndex===0);return!b?"":e===-1?c.getLineCount():b.getLineNumber?(e=b.getLineNumber(e),e===-1?"":e+1):e+1};g.prototype._onModelChanged=function(e){var e=e.start,c=this._editor.getModel(),b=c.getLineCount(),a=(b+"").length;if(this._numOfDigits!==a)this._numOfDigits=a,this._editor.redrawLines(c.getLineAtOffset(e),b,this)};return g}();k.CompareOverviewRuler=function(){function j(e,c,b,a){this._diffNavigator=b;this._onClick=a;k.CompareRuler.call(this,e,
"document",c)}j.prototype=new k.CompareRuler;j.prototype.getStyle=function(e){var c,b;if(e===void 0)c=this._rulerStyle||{},b=c.style||(c.style={}),b.lineHeight="1px",b.fontSize="1px",b.width="14px";else if(c=e!==-1?{styleClass:"annotationOverview breakpoint"}:{},b=c.style||(c.style={}),b.cursor="pointer",b.width="8px",b.left="2px",e>=0){var a;if(this._diffNavigator&&this._diffNavigator.getFeeder())a=this._diffNavigator.getFeeder().getDiffBlocks();else return null;e=g.getAnnotationIndex(a,e);if(e===
-1)return null;a=g.getAnnotationMapperIndex(a,e);var i;i=this._diffNavigator.getMapper();if(a=g.isMapperConflict(i,a))b.border="1px #FF0000 solid";if(e===this._diffNavigator.getCurrentBlockIndex())b.backgroundColor=a?"red":"blue";e=this._diffNavigator.getFeeder().getDiffBlockH(e);a=this._diffNavigator.getFeeder().getOverviewLineCount();if(e<0)return null;i=this._editor.getClientArea();e=Math.floor(i.height*e/a);e<2&&(e=2);b.height=e+"px"}else return null;return c};j.prototype.setDiffNavigator=function(e){this._diffNavigator=
e};j.prototype.getHTML=function(){return"&nbsp;"};j.prototype.onClick=function(e){e!==void 0&&this._onClick(e,this)};j.prototype._onModelChanged=function(){this._editor.getModel().getLineCount()>0&&this._editor.redrawLines(0,1,this)};return j}();k.CompareCurveRuler=function(){function j(e){this._canvasDiv=e;this._mapper=void 0}j.prototype={init:function(e,c,b,a){this._rightIniting=this._rightIniting=this._leftIniting=!0;this._mapper=e;this._leftEditor=c;this._rightEditor=b;this._leftTextView=c.getTextView();
this._rightTextView=b.getTextView();this._diffNavigator=a;this.render()},matchPositionFrom:function(e){var c=e?this._leftTextView:this._rightTextView,b=e?this._rightTextView:this._leftTextView,a=c.getTopIndex(),c=c.getBottomIndex(),e=g.matchMapper(this._mapper,e?0:1,a,c);b.setTopIndex(e)},copyTo:function(e){if(this._diffNavigator.iterator){var c=this._diffNavigator.iterator.cursor();if(c){var b=e?this._rightTextView.getText(c.oldA.start,c.oldA.end):this._leftTextView.getText(c.newA.start,c.newA.end),
c=e?c.newA:c.oldA;(e?this._leftTextView:this._rightTextView).setText(b,c.start,c.end)}}},render:function(){if(this._mapper){var e=this._canvasDiv.getContext("2d");e.clearRect(0,0,this._canvasDiv.width,this._canvasDiv.height);e.strokeStyle="#AAAAAA";e.lineWidth=1;e.beginPath();var c=this._leftTextView.getTopIndex(),b=this._leftTextView.getBottomIndex(),a=this._rightTextView.getTopIndex(),i=this._rightTextView.getBottomIndex();this._leftLineH=this._leftTextView.getLineHeight();this._rightLineH=this._rightTextView.getLineHeight();
for(var f=0,d=0,h=!1,l=0;l<this._mapper.length;l++){if(this._mapper[l][2]!==0)if(g.overlapMapper(this._mapper[l],0,f,c,b)||g.overlapMapper(this._mapper[l],1,d,a,i))this._renderCurve(l,f,d,this._canvasDiv,e,c,b,a,i),h=!0;else if(h)break;f+=this._mapper[l][0];d+=this._mapper[l][1]}e.stroke()}},_renderCurve:function(e,c,b,a,g){var f=this._mapper[e],c=this._leftTextView.getLinePixel(c+f[0]/2)+f[0]%2*this._leftLineH/3-this._leftTextView.getTopPixel(),b=this._rightTextView.getLinePixel(b+f[1]/2)+f[1]%2*
this._rightLineH/3-this._rightTextView.getTopPixel(),a=a.parentNode.clientWidth;e===this._diffNavigator.getCurrentMapperIndex()?(g.stroke(),g.strokeStyle="#000",g.lineWidth=1,g.beginPath(),g.moveTo(0,c),g.bezierCurveTo(a/3,c,a*0.666,b,a,b),g.stroke(),g.strokeStyle="#AAAAAA",g.lineWidth=1,g.beginPath()):(g.moveTo(0,c),g.bezierCurveTo(a/3,c,a*0.666,b,a,b),g.stroke())},onChanged:function(e,c){var b=c?this._rightIniting:this._leftIniting;if(e.removedLineCount!==e.addedLineCount){var a=c?this._rightTextView:
this._leftTextView;b||g.updateMapper(this._mapper,c?1:0,a.getModel().getLineAtOffset(e.start),e.removedLineCount,e.addedLineCount);(e.removedLineCount>0||e.addedLineCount>0)&&this.render()}c?this._rightIniting=!1:this._leftIniting=!1;return b}};return j}();return k});define("orion/editor/i18n",{load:function(g,k,j){k.specified&&k.specified("orion/bootstrap")?k(["orion/i18n!"+g],function(e){j(e)}):j({})}});
define("orion/editor/nls/root/messages",{multipleAnnotations:"Multiple annotations:",line:"Line: ${0}",breakpoint:"Breakpoint",bookmark:"Bookmark",task:"Task",error:"Error",warning:"Warning",matchingSearch:"Matching Search",currentSearch:"Current Search",currentLine:"Current Line",matchingBracket:"Matching Bracket",currentBracket:"Current Bracket",lineUp:"Line Up",lineDown:"Line Down",lineStart:"Line Start",lineEnd:"Line End",charPrevious:"Previous Character",charNext:"Next Character",pageUp:"Page Up",
pageDown:"Page Down",scrollPageUp:"Scroll Page Up",scrollPageDown:"Scroll Page Down",scrollLineUp:"Scroll Line Up",scrollLineDown:"Scroll Line Down",wordPrevious:"Previous Word",wordNext:"Next Word",textStart:"Document Start",textEnd:"Document End",scrollTextStart:"Scroll Document Start",scrollTextEnd:"Scroll Document End",centerLine:"Center Line",selectLineUp:"Select Line Up",selectLineDown:"Select Line Down",selectWholeLineUp:" Select Whole Line Up",selectWholeLineDown:"Select Whole Line Down",
selectLineStart:"Select Line Start",selectLineEnd:"Select Line End",selectCharPrevious:"Select Previous Character",selectCharNext:"Select Next Character",selectPageUp:"Select Page Up",selectPageDown:"Select Page Down",selectWordPrevious:"Select Previous Word",selectWordNext:"Select Next Word",selectTextStart:"Select Document Start",selectTextEnd:"Select Document End",deletePrevious:"Delete Previous Character",deleteNext:"Delete Next Character",deleteWordPrevious:"Delete Previous Word",deleteWordNext:"Delete Next Word",
deleteLineStart:"Delete Line Start",deleteLineEnd:"Delete Line End",tab:"Insert Tab",enter:"Insert Line Delimiter",enterNoCursor:"Insert Line Delimiter",selectAll:"Select All",copy:"Copy",cut:"Cut",paste:"Paste",uppercase:"To Upper Case",lowercase:"To Lower Case",capitalize:"Capitalize",reversecase:"Reverse Case",toggleWrapMode:"Toggle Wrap Mode",toggleTabMode:"Toggle Tab Mode",toggleOverwriteMode:"Toggle Overwrite Mode",emacs:"Emacs",exchangeMarkPoint:"Exchange Mark and Point",setMarkCommand:"Set Mark",
clearMark:"Clear Mark",digitArgument:"Digit Argument ${0}",negativeArgument:"Negative Argument",Comment:"Comment","Flat outline":"Flat outline",incrementalFindStr:"Incremental find: ${0}",incrementalFindStrNotFound:"Incremental find: ${0} (not found)",incrementalFindReverseStr:"Reverse Incremental find: ${0}",incrementalFindReverseStrNotFound:"Reverse Incremental find: ${0} (not found)",find:"Find...",undo:"Undo",redo:"Redo",cancelMode:"Cancel Current Mode",findNext:"Find Next Occurrence",findPrevious:"Find Previous Occurrence",
incrementalFind:"Incremental Find",incrementalFindReverse:"Incremental Find Reverse",indentLines:"Indent Lines",unindentLines:"Unindent Lines",moveLinesUp:"Move Lines Up",moveLinesDown:"Move Lines Down",copyLinesUp:"Copy Lines Up",copyLinesDown:"Copy Lines Down",deleteLines:"Delete Lines",gotoLine:"Goto Line...",gotoLinePrompty:"Goto Line:",nextAnnotation:"Next Annotation",prevAnnotation:"Previous Annotation",expand:"Expand",collapse:"Collapse",expandAll:"Expand All",collapseAll:"Collapse All",lastEdit:"Last Edit Location",
toggleLineComment:"Toggle Line Comment",addBlockComment:"Add Block Comment",removeBlockComment:"Remove Block Comment",linkedModeEntered:"Linked Mode entered",linkedModeExited:"Linked Mode exited",syntaxError:"Syntax Error",contentAssist:"Content Assist",lineColumn:"Line ${0} : Col ${1}",vi:"vi",vimove:"(Move)",viyank:"(Yank)",videlete:"(Delete)",vichange:"(Change)",viLeft:"${0} Left",viRight:"${0} Right",viUp:"${0} Up",viDown:"${0} Down",viw:"${0} Next Word",vib:"${0} Beginning of Word",viW:"${0} Next Word (ws stop)",
viB:"${0} Beginning of Word (ws stop)",vie:"${0} End of Word",viE:"${0} End of Word (ws stop)",vi$:"${0} End of the line","vi^_":"${0} First non-blank Char Current Line","vi+":"${0} First Char Next Line","vi-":"${0} First Char Previous Line","vi|":"${0} nth Column in Line",viH:"${0} Top of Page",viM:"${0} Middle of Page",viL:"${0} Bottom of Page","vi/":"${0} Search Forward","vi?":"${0} Search Backward",vin:"${0} Next Search",viN:"${0} Previous Search",vif:"${0} Search Char Fwd",viF:"${0} Search Char Bckwd",
vit:"${0} Search Before Char Fwd",viT:"${0} Search Before Char Bckwd","vi,":"${0} Repeat Reverse Char Search","vi;":"${0} Repeat Char Search",viG:"${0} Go to Line",viycd:"${0} Current Line",via:"Append After Cursor",viA:"Append to End of Line",vii:"Insert Before Cursor",viI:"Insert at Beginning of Line",viO:"Insert Line Above",vio:"Insert Line Below",viR:"Begin Overwriting Text",vis:"Substitute a Character",viS:"Substitute Entire Line",viC:"Change Text Until Line End",vip:"Paste After Char or Line",
viP:"Paste Before Char or Line",replaceAll:"Replacing all...",replacedMatches:"Replaced ${0} matches",nothingReplaced:"Nothing replaced",notFound:"Not found"});define("orion/editor/nls/messages",["orion/editor/i18n!orion/editor/nls/messages","orion/editor/nls/root/messages"],function(g,k){var j={root:k},e;for(e in g)g.hasOwnProperty(e)&&typeof j[e]==="undefined"&&(j[e]=g[e]);return j});
define("orion/editor/textModel",["orion/editor/eventTarget","orion/util"],function(g,k){function j(e,c){this._lastLineIndex=-1;this._text=[""];this._lineOffsets=[0];this.setText(e);this.setLineDelimiter(c)}j.prototype={find:function(e){if(this._text.length>1)this._text=[this._text.join("")];var c=e.string,b=c,a=e.caseInsensitive;!e.regex&&c&&(b=c.replace(/([\\$\^*\/+?\.\(\)|{}\[\]])/g,"\\$&"),a&&(b=b.replace(/[iI\u0130\u0131]/g,"[Ii\u0130\u0131]")));var g=null,f;if(b){var c=e.reverse,d=e.wrap,h=e.wholeWord,
l=e.start||0,e=e.end,n=e!==null&&e!==void 0,m="";m.indexOf("g")===-1&&(m+="g");a&&m.indexOf("i")===-1&&(m+="i");h&&(b="\\b"+b+"\\b");var j=this._text[0],k,p,r=0;n&&(a=l<e?l:e,j=j.substring(a,l<e?e:l),r=a);var t=RegExp(b,m);if(c)f=function(){var a=null;for(t.lastIndex=0;;){p=t.lastIndex;k=t.exec(j);if(p===t.lastIndex)return null;if(k){if(!(k.index+r<l)){if(!d||a)break;l=j.length+r}a={start:k.index+r,end:t.lastIndex+r}}else break}if(a)l=a.start;return a};else{if(!n)t.lastIndex=l;f=function(){for(;;){p=
t.lastIndex;k=t.exec(j);if(p===t.lastIndex)break;if(k)return{start:k.index+r,end:t.lastIndex+r};if(!(p!==0&&d))break}return null}}g=f()}return{next:function(){var a=g;a&&(g=f());return a},hasNext:function(){return g!==null}}},getCharCount:function(){for(var e=0,c=0;c<this._text.length;c++)e+=this._text[c].length;return e},getLine:function(e,c){var b=this.getLineCount();if(!(0<=e&&e<b))return null;var a=this._lineOffsets[e];if(e+1<b){b=this.getText(a,this._lineOffsets[e+1]);if(c)return b;for(var a=
b.length,g;(g=b.charCodeAt(a-1))===10||g===13;)a--;return b.substring(0,a)}else return this.getText(a)},getLineAtOffset:function(e){var c=this.getCharCount();if(!(0<=e&&e<=c))return-1;var b=this.getLineCount();if(e===c)return b-1;var a,g,f=this._lastLineIndex;if(0<=f&&f<b&&(a=this._lineOffsets[f],g=f+1<b?this._lineOffsets[f+1]:c,a<=e&&e<g))return f;for(var d=b,h=-1;d-h>1;)if(f=Math.floor((d+h)/2),a=this._lineOffsets[f],g=f+1<b?this._lineOffsets[f+1]:c,e<=a)d=f;else if(e<g){d=f;break}else h=f;return this._lastLineIndex=
d},getLineCount:function(){return this._lineOffsets.length},getLineDelimiter:function(){return this._lineDelimiter},getLineEnd:function(e,c){var b=this.getLineCount();if(!(0<=e&&e<b))return-1;if(e+1<b){b=this._lineOffsets[e+1];if(c)return b;for(var a=this.getText(Math.max(this._lineOffsets[e],b-2),b),g=a.length,f;(f=a.charCodeAt(g-1))===10||f===13;)g--;return b-(a.length-g)}else return this.getCharCount()},getLineStart:function(e){return!(0<=e&&e<this.getLineCount())?-1:this._lineOffsets[e]},getText:function(e,
c){e===void 0&&(e=0);c===void 0&&(c=this.getCharCount());if(e===c)return"";for(var b=0,a=0,g;a<this._text.length;){g=this._text[a].length;if(e<=b+g)break;b+=g;a++}for(var f=b,d=a;a<this._text.length;){g=this._text[a].length;if(c<=b+g)break;b+=g;a++}if(d===a)return this._text[d].substring(e-f,c-b);f=this._text[d].substring(e-f);b=this._text[a].substring(0,c-b);return f+this._text.slice(d+1,a).join("")+b},onChanging:function(e){return this.dispatchEvent(e)},onChanged:function(e){return this.dispatchEvent(e)},
setLineDelimiter:function(e,c){e==="auto"&&(e=void 0,this.getLineCount()>1&&(e=this.getText(this.getLineEnd(0),this.getLineEnd(0,!0))));this._lineDelimiter=e?e:k.platformDelimiter;if(c){var b=this.getLineCount();if(b>1){for(var a=Array(b),g=0;g<b;g++)a[g]=this.getLine(g);this.setText(a.join(this._lineDelimiter))}}},setText:function(e,c,b){e===void 0&&(e="");c===void 0&&(c=0);b===void 0&&(b=this.getCharCount());if(!(c===b&&e==="")){for(var a=this.getLineAtOffset(c),g=this.getLineAtOffset(b),f=c,d=
b-c,h=g-a,l=e.length,n=0,m=this.getLineCount(),j=0,k=0,p=0,r=[];;){j!==-1&&j<=p&&(j=e.indexOf("\r",p));k!==-1&&k<=p&&(k=e.indexOf("\n",p));if(k===-1&&j===-1)break;p=j!==-1&&k!==-1?j+1===k?k+1:(j<k?j:k)+1:j!==-1?j+1:k+1;r.push(c+p);n++}this.onChanging({type:"Changing",text:e,start:f,removedCharCount:d,addedCharCount:l,removedLineCount:h,addedLineCount:n});r.length===0&&(p=this.getLineStart(a),g=g+1<m?this.getLineStart(g+1):this.getCharCount(),c!==p&&(e=this.getText(p,c)+e,c=p),b!==g&&(e+=this.getText(b,
g),b=g));p=l-d;for(g=a+h+1;g<m;g++)this._lineOffsets[g]+=p;if(r.length<5E4)a=[a+1,h].concat(r),Array.prototype.splice.apply(this._lineOffsets,a);else{p=a+1;this._lineOffsets.splice(p,h);for(m=0;m<r.length;m+=5E4)a=[p,0].concat(r.slice(m,Math.min(r.length,m+5E4))),Array.prototype.splice.apply(this._lineOffsets,a),p+=5E4}for(p=m=0;p<this._text.length;){g=this._text[p].length;if(c<=m+g)break;m+=g;p++}a=m;for(r=p;p<this._text.length;){g=this._text[p].length;if(b<=m+g)break;m+=g;p++}g=this._text[p];c=
this._text[r].substring(0,c-a);b=g.substring(b-m);r=[r,p-r+1];c&&r.push(c);e&&r.push(e);b&&r.push(b);Array.prototype.splice.apply(this._text,r);if(this._text.length===0)this._text=[""];this.onChanged({type:"Changed",start:f,removedCharCount:d,addedCharCount:l,removedLineCount:h,addedLineCount:n})}}};g.EventTarget.addMixin(j.prototype);return{TextModel:j}});
define("orion/editor/keyModes",["orion/keyBinding","orion/util"],function(g,k){function j(c){if(c)this._view=c,this._keyBindings=this.createKeyBindings(),this._keyBindingIndex=0}function e(c){j.call(this,c)}j.prototype={createKeyBindings:function(){return[]},getKeyBindings:function(c){for(var b=[],a=this._keyBindings,e=0;e<a.length;e++)a[e].actionID===c&&b.push(a[e].keyBinding);return b},getView:function(){return this._view},isActive:function(){return this._view.getKeyModes().indexOf(this)!==-1},
match:function(c){switch(c.keyCode){case 16:case 17:case 18:case 91:return}for(var b=this._keyBindingIndex,a=this._matchingKeyBindings||this._keyBindings,e=[],f=0;f<a.length;f++){var d=a[f],h=d.keyBinding.match(c,b);if(h===!0)return this._keyBindingIndex=0,this._matchingKeyBindings=null,d.actionID;else typeof h==="number"&&e.push(d)}if(e.length===0)this._keyBindingIndex=0,this._matchingKeyBindings=null;else return this._keyBindingIndex++,this._matchingKeyBindings=e,"noop"},setKeyBinding:function(c,
b){for(var a=this._keyBindings,e=0;e<a.length;e++){var f=a[e];if(f.keyBinding.equals(c)){b?f.actionID=b:f.predefined?f.actionID="noop":a.splice(e,1);return}}b&&a.push({keyBinding:c,actionID:b})},setView:function(c){this._view=c}};e.prototype=new j;e.prototype.createKeyBindings=function(){var c=g.KeyBinding,b=[];b.push({actionID:"lineUp",keyBinding:new c(38),predefined:!0});b.push({actionID:"lineDown",keyBinding:new c(40),predefined:!0});b.push({actionID:"charPrevious",keyBinding:new c(37),predefined:!0});
b.push({actionID:"charNext",keyBinding:new c(39),predefined:!0});k.isMac?(b.push({actionID:"scrollPageUp",keyBinding:new c(33),predefined:!0}),b.push({actionID:"scrollPageDown",keyBinding:new c(34),predefined:!0}),b.push({actionID:"pageUp",keyBinding:new c(33,null,null,!0),predefined:!0}),b.push({actionID:"pageDown",keyBinding:new c(34,null,null,!0),predefined:!0}),b.push({actionID:"lineStart",keyBinding:new c(37,!0),predefined:!0}),b.push({actionID:"lineEnd",keyBinding:new c(39,!0),predefined:!0}),
b.push({actionID:"wordPrevious",keyBinding:new c(37,null,null,!0),predefined:!0}),b.push({actionID:"wordNext",keyBinding:new c(39,null,null,!0),predefined:!0}),b.push({actionID:"scrollTextStart",keyBinding:new c(36),predefined:!0}),b.push({actionID:"scrollTextEnd",keyBinding:new c(35),predefined:!0}),b.push({actionID:"textStart",keyBinding:new c(38,!0),predefined:!0}),b.push({actionID:"textEnd",keyBinding:new c(40,!0),predefined:!0}),b.push({actionID:"scrollPageUp",keyBinding:new c(38,null,null,null,
!0),predefined:!0}),b.push({actionID:"scrollPageDown",keyBinding:new c(40,null,null,null,!0),predefined:!0}),b.push({actionID:"lineStart",keyBinding:new c(37,null,null,null,!0),predefined:!0}),b.push({actionID:"lineEnd",keyBinding:new c(39,null,null,null,!0),predefined:!0}),b.push({actionID:"lineStart",keyBinding:new c(38,null,null,!0),predefined:!0}),b.push({actionID:"lineEnd",keyBinding:new c(40,null,null,!0),predefined:!0})):(b.push({actionID:"pageUp",keyBinding:new c(33),predefined:!0}),b.push({actionID:"pageDown",
keyBinding:new c(34),predefined:!0}),b.push({actionID:"lineStart",keyBinding:new c(36),predefined:!0}),b.push({actionID:"lineEnd",keyBinding:new c(35),predefined:!0}),b.push({actionID:"wordPrevious",keyBinding:new c(37,!0),predefined:!0}),b.push({actionID:"wordNext",keyBinding:new c(39,!0),predefined:!0}),b.push({actionID:"textStart",keyBinding:new c(36,!0),predefined:!0}),b.push({actionID:"textEnd",keyBinding:new c(35,!0),predefined:!0}));k.isFirefox&&k.isLinux&&(b.push({actionID:"lineUp",keyBinding:new c(38,
!0),predefined:!0}),b.push({actionID:"lineDown",keyBinding:new c(40,!0),predefined:!0}));k.isWindows&&(b.push({actionID:"scrollLineUp",keyBinding:new c(38,!0),predefined:!0}),b.push({actionID:"scrollLineDown",keyBinding:new c(40,!0),predefined:!0}));b.push({actionID:"selectLineUp",keyBinding:new c(38,null,!0),predefined:!0});b.push({actionID:"selectLineDown",keyBinding:new c(40,null,!0),predefined:!0});b.push({actionID:"selectCharPrevious",keyBinding:new c(37,null,!0),predefined:!0});b.push({actionID:"selectCharNext",
keyBinding:new c(39,null,!0),predefined:!0});b.push({actionID:"selectPageUp",keyBinding:new c(33,null,!0),predefined:!0});b.push({actionID:"selectPageDown",keyBinding:new c(34,null,!0),predefined:!0});k.isMac?(b.push({actionID:"selectLineStart",keyBinding:new c(37,!0,!0),predefined:!0}),b.push({actionID:"selectLineEnd",keyBinding:new c(39,!0,!0),predefined:!0}),b.push({actionID:"selectWordPrevious",keyBinding:new c(37,null,!0,!0),predefined:!0}),b.push({actionID:"selectWordNext",keyBinding:new c(39,
null,!0,!0),predefined:!0}),b.push({actionID:"selectTextStart",keyBinding:new c(36,null,!0),predefined:!0}),b.push({actionID:"selectTextEnd",keyBinding:new c(35,null,!0),predefined:!0}),b.push({actionID:"selectTextStart",keyBinding:new c(38,!0,!0),predefined:!0}),b.push({actionID:"selectTextEnd",keyBinding:new c(40,!0,!0),predefined:!0}),b.push({actionID:"selectLineStart",keyBinding:new c(37,null,!0,null,!0),predefined:!0}),b.push({actionID:"selectLineEnd",keyBinding:new c(39,null,!0,null,!0),predefined:!0}),
b.push({actionID:"selectLineStart",keyBinding:new c(38,null,!0,!0),predefined:!0}),b.push({actionID:"selectLineEnd",keyBinding:new c(40,null,!0,!0),predefined:!0})):(k.isLinux&&(b.push({actionID:"selectWholeLineUp",keyBinding:new c(38,!0,!0),predefined:!0}),b.push({actionID:"selectWholeLineDown",keyBinding:new c(40,!0,!0),predefined:!0})),b.push({actionID:"selectLineStart",keyBinding:new c(36,null,!0),predefined:!0}),b.push({actionID:"selectLineEnd",keyBinding:new c(35,null,!0),predefined:!0}),b.push({actionID:"selectWordPrevious",
keyBinding:new c(37,!0,!0),predefined:!0}),b.push({actionID:"selectWordNext",keyBinding:new c(39,!0,!0),predefined:!0}),b.push({actionID:"selectTextStart",keyBinding:new c(36,!0,!0),predefined:!0}),b.push({actionID:"selectTextEnd",keyBinding:new c(35,!0,!0),predefined:!0}));b.push({actionID:"undo",keyBinding:new g.KeyBinding("z",!0),predefined:!0});k.isMac?b.push({actionID:"redo",keyBinding:new g.KeyBinding("z",!0,!0),predefined:!0}):b.push({actionID:"redo",keyBinding:new g.KeyBinding("y",!0),predefined:!0});
b.push({actionID:"deletePrevious",keyBinding:new c(8),predefined:!0});b.push({actionID:"deletePrevious",keyBinding:new c(8,null,!0),predefined:!0});b.push({actionID:"deleteNext",keyBinding:new c(46),predefined:!0});b.push({actionID:"deleteWordPrevious",keyBinding:new c(8,!0),predefined:!0});b.push({actionID:"deleteWordPrevious",keyBinding:new c(8,!0,!0),predefined:!0});b.push({actionID:"deleteWordNext",keyBinding:new c(46,!0),predefined:!0});b.push({actionID:"tab",keyBinding:new c(9),predefined:!0});
b.push({actionID:"shiftTab",keyBinding:new c(9,null,!0),predefined:!0});b.push({actionID:"enter",keyBinding:new c(13),predefined:!0});b.push({actionID:"enter",keyBinding:new c(13,null,!0),predefined:!0});b.push({actionID:"selectAll",keyBinding:new c("a",!0),predefined:!0});b.push({actionID:"toggleTabMode",keyBinding:new c("m",!0),predefined:!0});k.isMac&&(b.push({actionID:"deleteNext",keyBinding:new c(46,null,!0),predefined:!0}),b.push({actionID:"deleteWordPrevious",keyBinding:new c(8,null,null,!0),
predefined:!0}),b.push({actionID:"deleteWordNext",keyBinding:new c(46,null,null,!0),predefined:!0}));b.push({actionID:"toggleWrapMode",keyBinding:new g.KeyBinding("w",!0,!1,!0)});b.push({actionID:"toggleOverwriteMode",keyBinding:new g.KeyBinding(45)});if(!k.isFirefox){var a=k.isMac&&k.isChrome;b.push({actionID:"noop",keyBinding:new c("u",!a,!1,!1,a),predefined:!0});b.push({actionID:"noop",keyBinding:new c("i",!a,!1,!1,a),predefined:!0});b.push({actionID:"noop",keyBinding:new c("b",!a,!1,!1,a),predefined:!0})}k.isFirefox&&
(b.push({actionID:"copy",keyBinding:new c(45,!0),predefined:!0}),b.push({actionID:"paste",keyBinding:new c(45,null,!0),predefined:!0}),b.push({actionID:"cut",keyBinding:new c(46,null,!0),predefined:!0}));k.isMac&&(b.push({actionID:"lineStart",keyBinding:new c("a",!1,!1,!1,!0),predefined:!0}),b.push({actionID:"lineEnd",keyBinding:new c("e",!1,!1,!1,!0),predefined:!0}),b.push({actionID:"lineUp",keyBinding:new c("p",!1,!1,!1,!0),predefined:!0}),b.push({actionID:"lineDown",keyBinding:new c("n",!1,!1,
!1,!0),predefined:!0}),b.push({actionID:"charPrevious",keyBinding:new c("b",!1,!1,!1,!0),predefined:!0}),b.push({actionID:"charNext",keyBinding:new c("f",!1,!1,!1,!0),predefined:!0}),b.push({actionID:"deletePrevious",keyBinding:new c("h",!1,!1,!1,!0),predefined:!0}),b.push({actionID:"deleteNext",keyBinding:new c("d",!1,!1,!1,!0),predefined:!0}),b.push({actionID:"deleteLineEnd",keyBinding:new c("k",!1,!1,!1,!0),predefined:!0}),k.isFirefox?(b.push({actionID:"scrollPageDown",keyBinding:new c("v",!1,
!1,!1,!0),predefined:!0}),b.push({actionID:"deleteLineStart",keyBinding:new c("u",!1,!1,!1,!0),predefined:!0}),b.push({actionID:"deleteWordPrevious",keyBinding:new c("w",!1,!1,!1,!0),predefined:!0})):(b.push({actionID:"pageDown",keyBinding:new c("v",!1,!1,!1,!0),predefined:!0}),b.push({actionID:"centerLine",keyBinding:new c("l",!1,!1,!1,!0),predefined:!0}),b.push({actionID:"enterNoCursor",keyBinding:new c("o",!1,!1,!1,!0),predefined:!0})));return b};return{KeyMode:j,DefaultKeyMode:e}});
define("orion/editor/textView","i18n!orion/editor/nls/messages,orion/editor/textModel,orion/editor/keyModes,orion/editor/eventTarget,orion/editor/textTheme,orion/util".split(","),function(g,k,j,e,c,b){function a(a,b,d,c){typeof a.addEventListener==="function"?a.addEventListener(b,d,c===!0):a.attachEvent("on"+b,d)}function i(a,d,c){if(c){d.className="";for(var c=d.attributes,f=c.length;f-- >0;)(!b.isIE||b.isIE>=9||b.isIE<9&&c[f].specified)&&d.removeAttribute(c[f].name)}if(a){if(a.styleClass)d.className=
a.styleClass;if(c=a.style)for(var e in c)c.hasOwnProperty(e)&&(d.style[e]=c[e]);if(a=a.attributes)for(var h in a)a.hasOwnProperty(h)&&d.setAttribute(h,a[h])}}function f(a){return a instanceof Array?a.slice(0):a}function d(a,b){if(!a)return b;if(!b)return a;for(var d in b)b.hasOwnProperty(d)&&(a.hasOwnProperty(d)||(a[d]=b[d]));return a}function h(a,b){if(a===b)return!0;if(a&&!b||!a&&b)return!1;if(a&&a.constructor===String||b&&b.constructor===String)return!1;if(a instanceof Array||b instanceof Array){if(!(a instanceof
Array&&b instanceof Array))return!1;if(a.length!==b.length)return!1;for(var d=0;d<a.length;d++)if(!h(a[d],b[d]))return!1;return!0}if(!(a instanceof Object)||!(b instanceof Object))return!1;for(d in a)if(a.hasOwnProperty(d)){if(!b.hasOwnProperty(d))return!1;if(!h(a[d],b[d]))return!1}for(d in b)if(!a.hasOwnProperty(d))return!1;return!0}function l(a,b,d){for(var c=0,f=0,e=0,h=a.length;e<h;){c!==-1&&c<=e&&(c=a.indexOf("\r",e));f!==-1&&f<=e&&(f=a.indexOf("\n",e));var g=e,i;if(f===-1&&c===-1){b(a.substring(e));
break}c!==-1&&f!==-1?c+1===f?(i=c,e=f+1):(i=c<f?c:f,e=(c<f?c:f)+1):c!==-1?(i=c,e=c+1):(i=f,e=f+1);b(a.substring(g,i));d()}}function n(a){var b,d,c,f,e=a.ownerDocument.defaultView||a.ownerDocument.parentWindow;if(e.getComputedStyle)a=e.getComputedStyle(a,null),b=a.getPropertyValue("padding-left"),d=a.getPropertyValue("padding-top"),c=a.getPropertyValue("padding-right"),f=a.getPropertyValue("padding-bottom");else if(a.currentStyle)b=a.currentStyle.paddingLeft,d=a.currentStyle.paddingTop,c=a.currentStyle.paddingRight,
f=a.currentStyle.paddingBottom;return{left:parseInt(b,10)||0,top:parseInt(d,10)||0,right:parseInt(c,10)||0,bottom:parseInt(f,10)||0}}function m(a){var b,d,c,f,e=a._trim;if(!e){var e=n(a),h=a.ownerDocument.defaultView||a.ownerDocument.parentWindow;if(h.getComputedStyle)f=h.getComputedStyle(a,null),b=f.getPropertyValue("border-left-width"),d=f.getPropertyValue("border-top-width"),c=f.getPropertyValue("border-right-width"),f=f.getPropertyValue("border-bottom-width");else if(a.currentStyle)b=a.currentStyle.borderLeftWidth,
d=a.currentStyle.borderTopWidth,c=a.currentStyle.borderRightWidth,f=a.currentStyle.borderBottomWidth;b=parseInt(b,10)||0;d=parseInt(d,10)||0;c=parseInt(c,10)||0;f=parseInt(f,10)||0;e.left+=b;e.top+=d;e.right+=c;e.bottom+=f;a._trim=e}return e}function q(a,b,d){this.start=a;this.end=b;this.caret=d}function s(a){this.left=a.left;this.top=a.top;this.right=a.right;this.bottom=a.bottom}function p(a,b,d){this.view=a;this.lineIndex=b;this._lineDiv=d}function r(a){this._init(a||{})}var t=function(){function a(b){this.options=
b}a.prototype.play=function(){var a=typeof this.options.duration==="number"?this.options.duration:350,b=this.options.easing||this.defaultEasing,d=this.options.onAnimate||function(){},c=this.options.curve[0],f=this.options.curve[1],e=f-c,h=-1,o,g=this;this.interval=this.options.window.setInterval(function(){h=h===-1?(new Date).getTime():h;var i=((new Date).getTime()-h)/a;i<1?(i=b(i),o=c+i*e,d(o)):(d(f),g.stop())},typeof this.options.rate==="number"?this.options.rate:20)};a.prototype.stop=function(){this.options.window.clearInterval(this.interval);
(this.options.onEnd||function(){})()};a.prototype.defaultEasing=function(a){return Math.sin(a*(Math.PI/2))};return a}();q.prototype={clone:function(){return new q(this.start,this.end,this.caret)},collapse:function(){this.caret?this.end=this.start:this.start=this.end},extend:function(a){this.caret?this.start=a:this.end=a;if(this.start>this.end)a=this.start,this.start=this.end,this.end=a,this.caret=!this.caret},setCaret:function(a){this.end=this.start=a;this.caret=!1},getCaret:function(){return this.caret?
this.start:this.end},toString:function(){return"start="+this.start+" end="+this.end+(this.caret?" caret is at start":" caret is at end")},isEmpty:function(){return this.start===this.end},equals:function(a){return this.caret===a.caret&&this.start===a.start&&this.end===a.end}};s.prototype={toString:function(){return"{l="+this.left+", t="+this.top+", r="+this.right+", b="+this.bottom+"}"}};p.prototype={create:function(a,b){if(!this._lineDiv){var d=this._lineDiv=this._createLine(a,b,this.lineIndex);d._line=
this;return d}},_createLine:function(a,d,c){var f=this.view,e=f._model,g=e.getLine(c),l=e.getLineStart(c),m={type:"LineStyle",textView:f,lineIndex:c,lineText:g,lineStart:l};if(g.length<2E3)f.onLineStyle(m);e=d||b.createElement(a.ownerDocument,"div");if(!d||!h(d.viewStyle,m.style)){i(m.style,e,d);if(d)d._trim=null;e.viewStyle=m.style;e.setAttribute("role","presentation")}e.lineIndex=c;c=[];this._createRanges(m.ranges,g,0,g.length,l,{tabOffset:0,ranges:c});g=" ";!f._fullSelection&&b.isIE<9&&(g="\ufeff");
b.isWebkit&&(g="\u200c");m={text:g,style:f._metrics.largestFontStyle,ignoreChars:1};c.length===0||!c[c.length-1].style||c[c.length-1].style.tagName!=="div"?c.push(m):c.splice(c.length-1,0,m);var n,j,k,q,s,g=f=0,p,r;if(d){if(j=d.modelChangedEvent)j.removedLineCount===0&&j.addedLineCount===0?(r=j.start-l,p=j.addedCharCount-j.removedCharCount):r=-1,d.modelChangedEvent=void 0;j=d.firstChild}for(l=0;l<c.length;l++){m=c[l];q=m.text;f+=q.length;n=m.style;if(j)if(s=j.firstChild.data,k=j.viewStyle,s===q&&
h(n,k)){g+=s.length;j._rectsCache=void 0;n=j=j.nextSibling;continue}else for(;j;){if(r!==-1){k=f;k>=r&&(k-=p);s=(s=j.firstChild.data)?s.length:0;if(g+s>k)break;g+=s}k=j.nextSibling;e.removeChild(j);j=k}n=this._createSpan(e,q,n,m.ignoreChars);j?e.insertBefore(n,j):e.appendChild(n);if(d)d.lineWidth=void 0}if(d)for(a=n?n.nextSibling:null;a;)k=a.nextSibling,d.removeChild(a),a=k;else a.appendChild(e);return e},_createRanges:function(a,b,d,c,f,e){if(!(d>c)){if(a)for(var g=0;g<a.length;g++){var i=a[g];if(!(i.end<
f+d)){var l=Math.max(f+d,i.start)-f;if(l>c)break;var m=Math.min(f+c,i.end)-f;if(l<=m){l=Math.max(d,l);m=Math.min(c,m);for(d<l&&this._createRange(b,d,l,null,e);g+1<a.length&&a[g+1].start-f===m&&h(i.style,a[g+1].style);)i=a[g+1],m=Math.min(f+c,i.end)-f,g++;this._createRange(b,l,m,i.style,e);d=m}}}d<c&&this._createRange(b,d,c,null,e)}},_createRange:function(a,b,d,c,f){if(!(b>d)){var e=this.view._customTabSize;if(e&&e!==8)for(var h=a.indexOf("\t",b);h!==-1;){b<h&&(b={text:a.substring(b,h),style:c},f.ranges.push(b),
f.tabOffset+=b.text.length);b=e-f.tabOffset%e;if(b>0){for(var g="\u00a0",i=1;i<b;i++)g+=" ";b={text:g,style:c,ignoreChars:b-1};f.ranges.push(b);f.tabOffset+=b.text.length}b=h+1;if(b===d)return;h=a.indexOf("\t",b)}b<=d&&(b={text:a.substring(b,d),style:c},f.ranges.push(b),f.tabOffset+=b.text.length)}},_createSpan:function(d,c,f,e){var h=this.view,g="span";f&&f.tagName&&(g=f.tagName.toLowerCase());var l=g==="a";if(l)d.hasLink=!0;l&&!h._linksVisible&&(g="span");l=d.ownerDocument;d=b.createElement(d.ownerDocument,
g);f&&f.html?(d.innerHTML=f.html,d.ignore=!0):f&&f.node?(d.appendChild(f.node),d.ignore=!0):d.appendChild(l.createTextNode(f&&f.text?f.text:c));i(f,d);if(g==="a"){var m=h._getWindow();a(d,"click",function(a){return h._handleLinkClick(a?a:m.event)},!1)}d.viewStyle=f;if(e)d.ignoreChars=e;return d},_ensureCreated:function(){return this._lineDiv?this._lineDiv:this._createdDiv=this.create(this.view._clientDiv,null)},getBoundingClientRect:function(a,d){var c=this._ensureCreated(),f=this.view;if(a===void 0)return this._getLineBoundingClientRect(c,
!0);var e=f._model,h=c.ownerDocument,g=this.lineIndex,i=null;if(a<e.getLineEnd(g)){e=e.getLineStart(g);for(g=c.firstChild;g;){if(!g.ignore){var l=g.firstChild,m=l.length;g.ignoreChars&&(m-=g.ignoreChars);if(e+m>a){i=a-e;if(f._isRangeRects)h=h.createRange(),h.setStart(l,i),h.setEnd(l,i+1),i=new s(h.getBoundingClientRect());else if(b.isIE)h=h.body.createTextRange(),h.moveToElementText(g),h.collapse(),h.moveEnd("character",i+1),h.moveStart("character",i),i=new s(h.getBoundingClientRect());else{var n=
l.data;g.removeChild(l);g.appendChild(h.createTextNode(n.substring(0,i)));var j=b.createElement(h,"span");j.appendChild(h.createTextNode(n.substring(i,i+1)));g.appendChild(j);g.appendChild(h.createTextNode(n.substring(i+1)));i=new s(j.getBoundingClientRect());g.innerHTML="";g.appendChild(l);this._createdDiv||(h=f._getSelection(),(e<=h.start&&h.start<e+m||e<=h.end&&h.end<e+m)&&f._updateDOMSelection())}b.isIE&&(h=c.ownerDocument.defaultView||c.ownerDocument.parentWindow,c=h.screen.logicalXDPI/h.screen.deviceXDPI,
h=h.screen.logicalYDPI/h.screen.deviceYDPI,i.left*=c,i.right*=c,i.top*=h,i.bottom*=h);break}e+=m}g=g.nextSibling}}c=this.getBoundingClientRect();if(!i)f._wrapMode?(f=this.getClientRects(),i=f[f.length-1],i.left=i.right,i.left+=c.left,i.top+=c.top,i.right+=c.left,i.bottom+=c.top):(i=new s(c),i.left=i.right);if(d||d===void 0)i.left-=c.left,i.top-=c.top,i.right-=c.left,i.bottom-=c.top;return i},_getClientRects:function(a,b){var d,c,f,e;if(!a._rectsCache){d=a.getClientRects();c=Array(d.length);for(e=
0;e<d.length;e++)f=c[e]=new s(d[e]),f.left-=b.left,f.top-=b.top,f.right-=b.left,f.bottom-=b.top;a._rectsCache=c}d=a._rectsCache;c=[d.length];for(e=0;e<d.length;e++)c[e]=new s(d[e]);return c},getClientRects:function(a){if(!this.view._wrapMode)return[this.getBoundingClientRect()];for(var d=this._ensureCreated(),b=[],c=d.firstChild,f,e=d.getBoundingClientRect();c;){if(!c.ignore)for(var h=this._getClientRects(c,e),d=0;d<h.length;d++){var g=h[d],i;if(g.top!==g.bottom){var l=g.top+(g.bottom-g.top)/2;for(i=
0;i<b.length;i++)if(f=b[i],f.top<=l&&l<f.bottom)break;if(i===b.length)b.push(g);else{if(g.left<f.left)f.left=g.left;if(g.top<f.top)f.top=g.top;if(g.right>f.right)f.right=g.right;if(g.bottom>f.bottom)f.bottom=g.bottom}}}c=c.nextSibling}return a!==void 0?b[a]:b},_getLineBoundingClientRect:function(a,d){var b=new s(a.getBoundingClientRect());if(!this.view._wrapMode){b.right=b.left;for(var c=a.lastChild;c&&c.ignoreChars===c.firstChild.length;)c=c.previousSibling;if(c)c=c.getBoundingClientRect(),b.right=
c.right+m(a).right}d&&(c=m(a),b.left+=c.left,b.right-=c.right);return b},getLineCount:function(){return!this.view._wrapMode?1:this.getClientRects().length},getLineIndex:function(a){if(!this.view._wrapMode)return 0;for(var b=this.getClientRects(),a=this.getBoundingClientRect(a),a=a.top+(a.bottom-a.top)/2,d=0;d<b.length;d++)if(b[d].top<=a&&a<b[d].bottom)return d;return b.length-1},getLineStart:function(a){if(!this.view._wrapMode||a===0)return this.view._model.getLineStart(a);var b=this.getClientRects();
return this.getOffset(b[a].left+1,b[a].top+1)},getOffset:function(a,d){var c=this.view,f=c._model,e=this.lineIndex,h=f.getLineStart(e),g=f.getLineEnd(e);if(h===g)return h;var i=this._ensureCreated(),l=this.getBoundingClientRect(),m,n;if(c._wrapMode){m=this.getClientRects();if(d<m[0].top)d=m[0].top;for(var j=0;j<m.length;j++)if(n=m[j],n.top<=d&&d<n.bottom)break;if(a<n.left)a=n.left;a>n.right&&(a=n.right-1)}else a<0&&(a=0),a>l.right-l.left&&(a=l.right-l.left);var k=i.ownerDocument,j=k.defaultView||
k.parentWindow,q=b.isIE?j.screen.logicalXDPI/j.screen.deviceXDPI:1,s=b.isIE?j.screen.logicalYDPI/j.screen.deviceYDPI:1,j=h,p=i.firstChild;a:for(;p;){if(!p.ignore){var r=p.firstChild,i=r.length;p.ignoreChars&&(i-=p.ignoreChars);var t,E,F;m=this._getClientRects(p,l);for(var H=0;H<m.length;H++)if(n=m[H],n.left<=a&&a<n.right&&(!c._wrapMode||n.top<=d&&d<n.bottom)){if(b.isIE||c._isRangeRects){for(var k=c._isRangeRects?k.createRange():k.body.createTextRange(),H=i,M=-1;H-M>1;){var J=Math.floor((H+M)/2);m=
M+1;n=J===i-1&&p.ignoreChars?r.length:J+1;c._isRangeRects?(k.setStart(r,m),k.setEnd(r,n)):(k.moveToElementText(p),k.move("character",m),k.moveEnd("character",n-m));m=k.getClientRects();for(var Q=!1,N=0;N<m.length;N++)if(n=m[N],t=n.left*q-l.left,F=n.right*q-l.left,E=n.top*s-l.top,n=n.bottom*s-l.top,t<=a&&a<F&&(!c._wrapMode||E<=d&&d<n)){Q=!0;break}Q?H=J:M=J}j+=H;m=H;n=H===i-1&&p.ignoreChars?r.length:Math.min(H+1,r.length);c._isRangeRects?(k.setStart(r,m),k.setEnd(r,n)):(k.moveToElementText(p),k.move("character",
m),k.moveEnd("character",n-m));n=k.getClientRects()[0];t=n.left*q-l.left;F=n.right*q-l.left;c=a>t+(F-t)/2;l=j-h;f=f.getLine(e);e=f.charCodeAt(l);55296<=e&&e<=56319&&c?l<f.length&&(e=f.charCodeAt(l+1),56320<=e&&e<=57343&&(j+=1)):56320<=e&&e<=57343&&!c&&l>0&&(e=f.charCodeAt(l-1),55296<=e&&e<=56319&&(j-=1));c&&j++}else{f=[];for(e=0;e<i;e++)f.push("<span>"),e===i-1?f.push(r.data.substring(e)):f.push(r.data.substring(e,e+1)),f.push("</span>");p.innerHTML=f.join("");for(f=p.firstChild;f;){n=f.getBoundingClientRect();
t=n.left-l.left;F=n.right-l.left;if(t<=a&&a<F){a>t+(F-t)/2&&j++;break}j++;f=f.nextSibling}if(!this._createdDiv)p.innerHTML="",p.appendChild(r),l=c._getSelection(),(j<=l.start&&l.start<j+i||j<=l.end&&l.end<j+i)&&c._updateDOMSelection()}break a}j+=i}p=p.nextSibling}return Math.min(g,Math.max(h,j))},getNextOffset:function(a,d){if(d.unit==="line"){var c=this.view._model,f=c.getLineAtOffset(a);if(d.count>0)return d.count--,c.getLineEnd(f);d.count++;return c.getLineStart(f)}return d.unit==="wordend"||d.unit===
"wordWS"||d.unit==="wordendWS"?this._getNextOffset_W3C(a,d):b.isIE?this._getNextOffset_IE(a,d):this._getNextOffset_W3C(a,d)},_getNextOffset_W3C:function(a,d){function b(a){return 33<=a&&a<=47||58<=a&&a<=64||91<=a&&a<=94||a===96||123<=a&&a<=126}function c(a){return a===32||a===9}var f=this.view._model,e=f.getLineAtOffset(a),h=f.getLine(e),g=f.getLineStart(e),f=f.getLineEnd(e),e=h.length,i=a-g,l,m=d.count<0?-1:1;if(d.unit==="word"||d.unit==="wordend"||d.unit==="wordWS"||d.unit==="wordendWS")for(var n,
j,k;d.count!==0;){if(d.count>0){if(i===e)return f;l=h.charCodeAt(i);n=b(l);j=!n&&!c(l);for(i++;i<e;){l=h.charCodeAt(i);if(d.unit!=="wordWS"&&d.unit!=="wordendWS"){k=b(l);if(d.unit==="wordend"){if(!k&&n)break}else if(k&&!n)break;l=!k&&!c(l)}else l=!c(l);if(d.unit==="wordend"||d.unit==="wordendWS"){if(!l&&j)break}else if(l&&!j)break;j=l;n=k;i++}}else{if(i===0)return g;i--;l=h.charCodeAt(i);n=b(l);for(j=!n&&!c(l);0<i;){l=h.charCodeAt(i-1);if(d.unit!=="wordWS"&&d.unit!=="wordendWS"){k=b(l);if(d.unit===
"wordend"){if(k&&!n)break}else if(!k&&n)break;l=!k&&!c(l)}else l=!c(l);if(d.unit==="wordend"||d.unit==="wordendWS"){if(l&&!j)break}else if(!l&&j)break;j=l;n=k;i--}}d.count-=m}else for(;d.count!==0&&0<=i+m&&i+m<=e;)i+=m,l=h.charCodeAt(i),56320<=l&&l<=57343&&i>0&&(l=h.charCodeAt(i-1),55296<=l&&l<=56319&&(i+=m)),d.count-=m;return g+i},_getNextOffset_IE:function(a,d){var b=this._ensureCreated(),c=this.view._model,f=this.lineIndex,e=0,h;h=c.getLineStart(f);var g=b.ownerDocument,i=d.count<0?-1:1;if(a===
c.getLineEnd(f)){for(b=b.lastChild;b&&b.ignoreChars;)b=b.previousSibling;if(!b)return h;e=g.body.createTextRange();e.moveToElementText(b);h=e.text.length;e.moveEnd(d.unit,i);e=a+e.text.length-h}else if(a===h&&d.count<0)e=h;else for(b=b.firstChild;b;){c=b.firstChild.length;b.ignoreChars&&(c-=b.ignoreChars);if(h+c>a){e=g.body.createTextRange();a===h&&d.count<0?e.moveToElementText(b.previousSibling):(e.moveToElementText(b),e.collapse(),e.moveEnd("character",a-h));h=e.text.length;e.moveEnd(d.unit,i);
e=a+e.text.length-h;break}h=c+h;b=b.nextSibling}d.count-=i;return e},destroy:function(){var a=this._createdDiv;if(a)a.parentNode.removeChild(a),this._createdDiv=null}};r.prototype={addKeyMode:function(a,d){var b=this._keyModes;d!==void 0?b.splice(d,0,a):b.push(a);a._modeAdded&&a._modeAdded()},addRuler:function(a,d){a.setView(this);var b=this._rulers;if(d!==void 0){var c,f;for(c=0,f=0;c<b.length&&f<d;c++)a.getLocation()===b[c].getLocation()&&f++;b.splice(f,0,a);d=f}else b.push(a);this._createRuler(a,
d);this._update()},computeSize:function(){var a=0,d=0,c=this._model,f=this._clientDiv;if(!f)return{width:a,height:d};var e=f.style.width;if(b.isWebkit)f.style.width="0x7fffffffpx";for(var c=c.getLineCount(),h=0;h<c;h++){var g=this._getLine(h),i=g.getBoundingClientRect(),a=Math.max(a,i.right-i.left);d+=i.bottom-i.top;g.destroy()}if(b.isWebkit)f.style.width=e;f=this._getViewPadding();a+=f.right+f.left+this._metrics.scrollWidth;d+=f.bottom+f.top+this._metrics.scrollWidth;return{width:a,height:d}},convert:function(a,
d,b){if(this._clientDiv){var c=this._getScroll(),f=this._getViewPadding(),e=this._viewDiv.getBoundingClientRect();d==="document"&&(a.x!==void 0&&(a.x+=-c.x+e.left+f.left),a.y!==void 0&&(a.y+=-c.y+e.top+f.top));b==="document"&&(a.x!==void 0&&(a.x+=c.x-e.left-f.left),a.y!==void 0&&(a.y+=c.y-e.top-f.top));return a}},destroy:function(){for(var a=0;a<this._rulers.length;a++)this._rulers[a].setView(null);this.rulers=null;this._destroyView();this.onDestroy({type:"Destroy"});this._actions=this._keyModes=
this._doubleClickSelection=this._selection=this._theme=this._model=this._parent=null},focus:function(){this._clientDiv&&(this._updateDOMSelection(),b.isOpera&&this._clientDiv.blur(),this._clientDiv.focus(),this._updateDOMSelection())},hasFocus:function(){return this._hasFocus},getActionDescription:function(a){if(a=this._actions[a])return a.actionDescription},getActions:function(a){var d=[],b=this._actions,c;for(c in b)b.hasOwnProperty(c)&&(a||!b[c].defaultHandler)&&d.push(c);return d},getBottomIndex:function(a){return!this._clientDiv?
0:this._getBottomIndex(a)},getBottomPixel:function(){return!this._clientDiv?0:this._getScroll().y+this._getClientHeight()},getCaretOffset:function(){return this._getSelection().getCaret()},getClientArea:function(){if(!this._clientDiv)return{x:0,y:0,width:0,height:0};var a=this._getScroll();return{x:a.x,y:a.y,width:this._getClientWidth(),height:this._getClientHeight()}},getHorizontalPixel:function(){return!this._clientDiv?0:this._getScroll().x},getKeyBindings:function(a){for(var d=[],b=this._keyModes,
c=0;c<b.length;c++)d=d.concat(b[c].getKeyBindings(a));return d},getKeyModes:function(){return this._keyModes.slice(0)},getLineHeight:function(a){return!this._clientDiv?0:this._getLineHeight(a)},getLineIndex:function(a){return!this._clientDiv?0:this._getLineIndex(a)},getLinePixel:function(a){return!this._clientDiv?0:this._getLinePixel(a)},getLocationAtOffset:function(a){if(!this._clientDiv)return{x:0,y:0};var d=this._model,a=Math.min(Math.max(0,a),d.getCharCount()),d=d.getLineAtOffset(a),b=this._getLine(d),
a=b.getBoundingClientRect(a);b.destroy();b=a.left;d=this._getLinePixel(d)+a.top;return{x:b,y:d}},getOptions:function(){var a;if(arguments.length===0)a=this._defaultOptions();else if(arguments.length===1){if(a=arguments[0],typeof a==="string")return f(this["_"+a])}else{a={};for(var d in arguments)arguments.hasOwnProperty(d)&&(a[arguments[d]]=void 0)}for(var b in a)a.hasOwnProperty(b)&&(a[b]=f(this["_"+b]));return a},getModel:function(){return this._model},getOffsetAtLocation:function(a,d){if(!this._clientDiv)return 0;
var b=this._getLineIndex(d),c=this._getLine(b),b=c.getOffset(a,d-this._getLinePixel(b));c.destroy();return b},getRulers:function(){return this._rulers.slice(0)},getSelection:function(){var a=this._getSelection();return{start:a.start,end:a.end}},getText:function(a,d){return this._model.getText(a,d)},getTopIndex:function(a){return!this._clientDiv?0:this._getTopIndex(a)},getTopPixel:function(){return!this._clientDiv?0:this._getScroll().y},invokeAction:function(a,d,b){if(this._clientDiv){if(a=this._actions[a]){if(!d&&
a.handler&&a.handler(b))return!0;if(a.defaultHandler)return typeof a.defaultHandler(b)==="boolean"}return!1}},isDestroyed:function(){return!this._clientDiv},onContextMenu:function(a){return this.dispatchEvent(a)},onDragStart:function(a){return this.dispatchEvent(a)},onDrag:function(a){return this.dispatchEvent(a)},onDragEnd:function(a){return this.dispatchEvent(a)},onDragEnter:function(a){return this.dispatchEvent(a)},onDragOver:function(a){return this.dispatchEvent(a)},onDragLeave:function(a){return this.dispatchEvent(a)},
onDrop:function(a){return this.dispatchEvent(a)},onDestroy:function(a){return this.dispatchEvent(a)},onLineStyle:function(a){return this.dispatchEvent(a)},onKeyDown:function(a){return this.dispatchEvent(a)},onKeyPress:function(a){return this.dispatchEvent(a)},onKeyUp:function(a){return this.dispatchEvent(a)},onModelChanged:function(a){return this.dispatchEvent(a)},onModelChanging:function(a){return this.dispatchEvent(a)},onModify:function(a){return this.dispatchEvent(a)},onMouseDown:function(a){return this.dispatchEvent(a)},
onMouseUp:function(a){return this.dispatchEvent(a)},onMouseMove:function(a){return this.dispatchEvent(a)},onMouseOver:function(a){return this.dispatchEvent(a)},onMouseOut:function(a){return this.dispatchEvent(a)},onSelection:function(a){return this.dispatchEvent(a)},onScroll:function(a){return this.dispatchEvent(a)},onVerify:function(a){return this.dispatchEvent(a)},onFocus:function(a){return this.dispatchEvent(a)},onBlur:function(a){return this.dispatchEvent(a)},redraw:function(){if(!(this._redrawCount>
0)){var a=this._model.getLineCount();this.redrawRulers(0,a);this.redrawLines(0,a)}},redrawRulers:function(a,d){if(!(this._redrawCount>0))for(var b=this.getRulers(),c=0;c<b.length;c++)this.redrawLines(a,d,b[c])},redrawLines:function(a,d,b){if(!(this._redrawCount>0)&&(a===void 0&&(a=0),d===void 0&&(d=this._model.getLineCount()),a!==d)){var c=this._clientDiv;if(c){if(b)for(c=(b.getLocation()==="left"?this._leftDiv:this._rightDiv).firstChild;c;){if(c._ruler===b)break;c=c.nextSibling}b?c.rulerChanged=
!0:this._lineHeight&&this._resetLineHeight(a,d);if(!b||b.getOverview()==="page")for(c=c.firstChild;c;){var f=c.lineIndex;if(a<=f&&f<d)c.lineChanged=!0;c=c.nextSibling}if(!b&&!this._wrapMode&&a<=this._maxLineIndex&&this._maxLineIndex<d)this._checkMaxLineIndex=this._maxLineIndex,this._maxLineIndex=-1,this._maxLineWidth=0;this._queueUpdate()}}},redrawRange:function(a,d){if(!(this._redrawCount>0)){var b=this._model;a===void 0&&(a=0);d===void 0&&(d=b.getCharCount());var c=b.getLineAtOffset(a),b=b.getLineAtOffset(Math.max(a,
d-1))+1;this.redrawLines(c,b)}},removeKeyMode:function(a){for(var d=this._keyModes,b=0;b<d.length;b++)if(d[b]===a){d.splice(b,1);break}a._modeRemoved&&a._modeRemoved()},removeRuler:function(a){for(var d=this._rulers,b=0;b<d.length;b++)if(d[b]===a){d.splice(b,1);a.setView(null);this._destroyRuler(a);this._update();break}},resize:function(){this._clientDiv&&this._handleResize(null)},setAction:function(a,d,b){if(a){var c=this._actions,f=c[a];f||(f=c[a]={});f.handler=d;if(b!==void 0)f.actionDescription=
b}},setKeyBinding:function(a,d){this._keyModes[0].setKeyBinding(a,d)},setCaretOffset:function(a,d,b){var c=this._model.getCharCount(),a=Math.max(0,Math.min(a,c));this._setSelection(new q(a,a,!1),d===void 0||d,!0,b)},setHorizontalPixel:function(a){this._clientDiv&&(a=Math.max(0,a),this._scrollView(a-this._getScroll().x,0))},setRedraw:function(a){a?--this._redrawCount===0&&this.redraw():this._redrawCount++},setModel:function(a){if(a&&a!==this._model){this._model.removeEventListener("preChanging",this._modelListener.onChanging);
this._model.removeEventListener("postChanged",this._modelListener.onChanged);var d=this._model.getLineCount(),b=this._model.getCharCount(),c=a.getLineCount(),f=a.getCharCount(),e={type:"ModelChanging",text:a.getText(),start:0,removedCharCount:b,addedCharCount:f,removedLineCount:d,addedLineCount:c};this.onModelChanging(e);this._model=a;e={type:"ModelChanged",start:0,removedCharCount:b,addedCharCount:f,removedLineCount:d,addedLineCount:c};this.onModelChanged(e);this._model.addEventListener("preChanging",
this._modelListener.onChanging);this._model.addEventListener("postChanged",this._modelListener.onChanged);this._reset();this._update()}},setOptions:function(a){var d=this._defaultOptions(),b;for(b in a)if(a.hasOwnProperty(b)){var c=a[b];if(!h(this["_"+b],c)){var e=d[b]?d[b].update:null;e?e.call(this,c):this["_"+b]=f(c)}}},setSelection:function(a,d,b,c){var f=a>d;if(f)var e=a,a=d,d=e;e=this._model.getCharCount();a=Math.max(0,Math.min(a,e));d=Math.max(0,Math.min(d,e));this._setSelection(new q(a,d,f),
b===void 0||b,!0,c)},setText:function(a,d,c){var f=d===void 0&&c===void 0;d===void 0&&(d=0);c===void 0&&(c=this._model.getCharCount());if(f)this._variableLineHeight=!1;this._modifyContent({text:a,start:d,end:c,_code:!0},!f);if(f)this._columnX=-1,this._setSelection(new q(0,0,!1),!0),b.isFirefox&&this._fixCaret()},setTopIndex:function(a){this._clientDiv&&this._scrollView(0,this._getLinePixel(Math.max(0,a))-this._getScroll().y)},setTopPixel:function(a){this._clientDiv&&this._scrollView(0,Math.max(0,
a)-this._getScroll().y)},showSelection:function(){return this._showCaret(!0)},update:function(a,d){this._clientDiv&&(a&&this._updateStyle(),d===void 0||d?this._update():this._queueUpdate())},_handleRootMouseDown:function(a){if(!this._ignoreEvent(a)){if(b.isFirefox&&a.which===1)this._clientDiv.contentEditable=!1,this._ignoreBlur=(this._overlayDiv||this._clientDiv).draggable=!0;var d=this._overlayDiv||this._clientDiv;if(b.isIE<9)d=this._viewDiv;for(var c=a.target?a.target:a.srcElement;c;){if(d===c)return;
c=c.parentNode}a.preventDefault&&a.preventDefault();a.stopPropagation&&a.stopPropagation();if(!this._isW3CEvents){var f=this;this._getWindow().setTimeout(function(){f._clientDiv.focus()},0)}}},_handleRootMouseUp:function(a){if(!this._ignoreEvent(a)&&b.isFirefox&&a.which===1)this._clientDiv.contentEditable=!0,(this._overlayDiv||this._clientDiv).draggable=!1,this._fixCaret(),this._ignoreBlur=!1},_handleBlur:function(){if(!this._ignoreBlur){this._hasFocus=!1;if(b.isIE<9&&!this._getSelection().isEmpty()){var a=
this._rootDiv,d=b.createElement(a.ownerDocument,"div");a.appendChild(d);a.removeChild(d)}if(this._cursorDiv)this._cursorDiv.style.display="none";if(this._selDiv1)if(this._selDiv1.style.background="lightgray",this._selDiv2.style.background="lightgray",this._selDiv3.style.background="lightgray",a=this._getWindow(),d=this._selDiv1.ownerDocument,a.getSelection){d=a.getSelection();for(a=d.anchorNode;a;){if(a===this._clientDiv){d.rangeCount>0&&d.removeAllRanges();break}a=a.parentNode}}else if(d.selection){this._ignoreSelect=
!1;for(a=d.selection.createRange().parentElement();a;){if(a===this._clientDiv){d.selection.empty();break}a=a.parentNode}this._ignoreSelect=!0}if(!this._ignoreFocus)this.onBlur({type:"Blur"})}},_handleContextMenu:function(a){if(!this._ignoreEvent(a)){b.isIE&&this._lastMouseButton===3&&this._updateDOMSelection();var d=!1;this.isListening("ContextMenu")?(d=this._createMouseEvent("ContextMenu",a),d.screenX=a.screenX,d.screenY=a.screenY,this.onContextMenu(d),d=d.defaultPrevented):b.isMac&&b.isFirefox&&
a.button===0&&(d=!0);if(d)return a.preventDefault&&a.preventDefault(),!1}},_handleCopy:function(a){if(!this._ignoreEvent(a)&&!this._ignoreCopy&&this._doCopy(a))return a.preventDefault&&a.preventDefault(),!1},_handleCut:function(a){if(!this._ignoreEvent(a)&&this._doCut(a))return a.preventDefault&&a.preventDefault(),!1},_handleDataModified:function(a){this._ignoreEvent(a)||this._startIME()},_handleDblclick:function(a){if(!this._ignoreEvent(a)&&(this._lastMouseTime=a.timeStamp?a.timeStamp:(new Date).getTime(),
this._clickCount!==2))this._clickCount=2,this._handleMouse(a)},_handleDragStart:function(a){if(!this._ignoreEvent(a)){if(b.isFirefox){var d=this;this._getWindow().setTimeout(function(){d._clientDiv.contentEditable=!0;d._clientDiv.draggable=!1;d._ignoreBlur=!1},0)}if(this.isListening("DragStart")&&this._dragOffset!==-1)this._isMouseDown=!1,this.onDragStart(this._createMouseEvent("DragStart",a)),this._dragOffset=-1;else return a.preventDefault&&a.preventDefault(),!1}},_handleDrag:function(a){if(!this._ignoreEvent(a)&&
this.isListening("Drag"))this.onDrag(this._createMouseEvent("Drag",a))},_handleDragEnd:function(a){if(!this._ignoreEvent(a)){this._dropTarget=!1;this._dragOffset=-1;if(this.isListening("DragEnd"))this.onDragEnd(this._createMouseEvent("DragEnd",a));b.isFirefox&&(this._fixCaret(),a.dataTransfer.dropEffect==="none"&&!a.dataTransfer.mozUserCancelled&&this._fixCaret())}},_handleDragEnter:function(a){if(!this._ignoreEvent(a)){var d=!0;this._dropTarget=!0;this.isListening("DragEnter")&&(d=!1,this.onDragEnter(this._createMouseEvent("DragEnter",
a)));if(b.isWebkit||d)return a.preventDefault&&a.preventDefault(),!1}},_handleDragOver:function(a){if(!this._ignoreEvent(a)){var d=!0;this.isListening("DragOver")&&(d=!1,this.onDragOver(this._createMouseEvent("DragOver",a)));if(b.isWebkit||d){if(d)a.dataTransfer.dropEffect="none";a.preventDefault&&a.preventDefault();return!1}}},_handleDragLeave:function(a){if(!this._ignoreEvent(a)&&(this._dropTarget=!1,this.isListening("DragLeave")))this.onDragLeave(this._createMouseEvent("DragLeave",a))},_handleDrop:function(a){if(!this._ignoreEvent(a)){this._dropTarget=
!1;if(this.isListening("Drop"))this.onDrop(this._createMouseEvent("Drop",a));a.preventDefault&&a.preventDefault();return!1}},_handleFocus:function(){this._hasFocus=!0;b.isIOS&&this._lastTouchOffset!==void 0?(this.setCaretOffset(this._lastTouchOffset,!0),this._lastTouchOffset=void 0):this._updateDOMSelection();if(this._cursorDiv)this._cursorDiv.style.display="block";if(this._selDiv1){var a=this._highlightRGB;this._selDiv1.style.background=a;this._selDiv2.style.background=a;this._selDiv3.style.background=
a}if(!this._ignoreFocus)this.onFocus({type:"Focus"})},_handleKeyDown:function(a){if(!this._ignoreEvent(a)){if(this.isListening("KeyDown")){var d=this._createKeyEvent("KeyDown",a);this.onKeyDown(d);if(d.defaultPrevented){if(b.isFirefox)this._keyDownPrevented=!0;a.preventDefault();return}}d=!1;switch(a.keyCode){case 16:case 17:case 18:case 91:d=!0;break;default:this._setLinksVisible(!1)}if(a.keyCode===229){if(this._readonly)return a.preventDefault&&a.preventDefault(),!1;d=!0;if(b.isSafari&&b.isMac&&
a.ctrlKey)d=!1,a.keyCode=129;d&&this._startIME()}else d||this._commitIME();if((b.isMac||b.isLinux)&&b.isFirefox<4||b.isOpera)return this._keyDownEvent=a,!0;if(this._doAction(a))return a.preventDefault?(a.preventDefault(),a.stopPropagation()):(a.cancelBubble=!0,a.returnValue=!1,a.keyCode=0),!1}},_handleKeyPress:function(a){if(!this._ignoreEvent(a))if(this._keyDownPrevented)a.preventDefault&&(a.preventDefault(),a.stopPropagation()),this._keyDownPrevented=void 0;else{if(b.isMac&&b.isWebkit&&(63232<=
a.keyCode&&a.keyCode<=63487||a.keyCode===13||a.keyCode===8))return a.preventDefault&&a.preventDefault(),!1;if(((b.isMac||b.isLinux)&&b.isFirefox<4||b.isOpera)&&this._doAction(this._keyDownEvent))return a.preventDefault&&a.preventDefault(),!1;var d=b.isMac?a.metaKey:a.ctrlKey;if(a.charCode!==void 0&&d)switch(a.charCode){case 99:case 118:case 120:return!0}if(this.isListening("KeyPress")&&(d=this._createKeyEvent("KeyPress",a),this.onKeyPress(d),d.defaultPrevented)){a.preventDefault();return}if(this._doAction(a))return a.preventDefault?
(a.preventDefault(),a.stopPropagation()):(a.cancelBubble=!0,a.returnValue=!1,a.keyCode=0),!1;d=!1;if(b.isMac){if(a.ctrlKey||a.metaKey)d=!0}else if(b.isFirefox){if(a.ctrlKey||a.altKey)d=!0}else a.ctrlKey^a.altKey&&(d=!0);if(!d&&(d=b.isOpera?a.which:a.charCode!==void 0?a.charCode:a.keyCode,d>31))return this._doContent(String.fromCharCode(d)),a.preventDefault&&a.preventDefault(),!1}},_handleKeyUp:function(a){if(!this._ignoreEvent(a)){if(this.isListening("KeyUp")){var d=this._createKeyEvent("KeyUp",a);
this.onKeyUp(d);if(d.defaultPrevented){a.preventDefault();return}}(b.isMac?a.metaKey:a.ctrlKey)||this._setLinksVisible(!1);a.keyCode===13&&this._commitIME()}},_handleLinkClick:function(a){if(!(b.isMac?a.metaKey:a.ctrlKey))return a.preventDefault&&a.preventDefault(),!1},_handleMouse:function(a){var d=this._getWindow(),c=!0,f=d;if(b.isIE||b.isFirefox&&!this._overlayDiv)f=this._clientDiv;if(this._overlayDiv){if(this._hasFocus)this._ignoreFocus=!0;var e=this;d.setTimeout(function(){e.focus();e._ignoreFocus=
!1},0)}this._clickCount===1?(c=this._setSelectionTo(a.clientX,a.clientY,a.shiftKey,!b.isOpera&&this._hasFocus&&this.isListening("DragStart")))&&this._setGrab(f):(this._isW3CEvents&&this._setGrab(f),this._doubleClickSelection=null,this._setSelectionTo(a.clientX,a.clientY,a.shiftKey),this._doubleClickSelection=this._getSelection());return c},_handleMouseDown:function(a){if(!this._ignoreEvent(a)){if(this._linksVisible)if((a.target||a.srcElement).tagName!=="A")this._setLinksVisible(!1);else return;this._commitIME();
var d=a.which;d||(a.button===4&&(d=2),a.button===2&&(d=3),a.button===1&&(d=1));var c=d!==2&&a.timeStamp?a.timeStamp:(new Date).getTime(),f=c-this._lastMouseTime,e=Math.abs(this._lastMouseX-a.clientX),h=Math.abs(this._lastMouseY-a.clientY),g=this._lastMouseButton===d;this._lastMouseX=a.clientX;this._lastMouseY=a.clientY;this._lastMouseTime=c;this._lastMouseButton=d;if(d===1)this._isMouseDown=!0,g&&f<=this._clickTime&&e<=this._clickDist&&h<=this._clickDist?this._clickCount++:this._clickCount=1;if(this.isListening("MouseDown")&&
(c=this._createMouseEvent("MouseDown",a),this.onMouseDown(c),c.defaultPrevented)){a.preventDefault();return}if(d===1&&this._handleMouse(a)&&(b.isIE>=9||b.isOpera||b.isChrome||b.isSafari||b.isFirefox&&!this._overlayDiv))this._hasFocus||this.focus(),a.preventDefault();b.isFirefox&&this._lastMouseButton===3&&this._updateDOMSelection()}},_handleMouseOver:function(a){if(!this._ignoreEvent(a)&&!this._animation&&this.isListening("MouseOver"))this.onMouseOver(this._createMouseEvent("MouseOver",a))},_handleMouseOut:function(a){if(!this._ignoreEvent(a)&&
!this._animation&&this.isListening("MouseOut"))this.onMouseOut(this._createMouseEvent("MouseOut",a))},_handleMouseMove:function(a){if(!this._animation){var d=this._isClientDiv(a);if(this.isListening("MouseMove")&&d)this.onMouseMove(this._createMouseEvent("MouseMove",a));if(!this._dropTarget){var c=this._linksVisible||this._lastMouseMoveX!==a.clientX||this._lastMouseMoveY!==a.clientY;this._lastMouseMoveX=a.clientX;this._lastMouseMoveY=a.clientY;this._setLinksVisible(c&&!this._isMouseDown&&(b.isMac?
a.metaKey:a.ctrlKey));if(!this._isW3CEvents){if(a.button===0)return this._setGrab(null),!0;if(!this._isMouseDown&&a.button===1&&(this._clickCount&1)!==0&&d)return this._clickCount=2,this._handleMouse(a,this._clickCount)}if(this._isMouseDown&&this._dragOffset===-1){var d=a.clientX,a=a.clientY,f=this._getViewPadding(),e=this._viewDiv.getBoundingClientRect(),h=this._getClientWidth(),g=this._getClientHeight(),c=e.left+f.left,i=e.top+f.top,h=e.left+f.left+h,f=e.top+f.top+g;a<i?this._doAutoScroll("up",
d,a-i):a>f?this._doAutoScroll("down",d,a-f):d<c&&!this._wrapMode?this._doAutoScroll("left",d-c,a):d>h&&!this._wrapMode?this._doAutoScroll("right",d-h,a):(this._endAutoScroll(),this._setSelectionTo(d,a,!0))}}}},_isClientDiv:function(a){for(var d=this._overlayDiv||this._clientDiv,a=a.target?a.target:a.srcElement;a;){if(d===a)return!0;a=a.parentNode}return!1},_createKeyEvent:function(a,d){return{type:a,event:d,preventDefault:function(){this.defaultPrevented=!0}}},_createMouseEvent:function(a,d){var b=
this.convert({x:d.clientX,y:d.clientY},"page","document");return{type:a,event:d,clickCount:this._clickCount,x:b.x,y:b.y,preventDefault:function(){this.defaultPrevented=!0}}},_handleMouseUp:function(a){var d=a.which?a.button===0:a.button===1;if(this.isListening("MouseUp")&&(this._isClientDiv(a)||d&&this._isMouseDown))this.onMouseUp(this._createMouseEvent("MouseUp",a));if(!this._linksVisible&&d&&this._isMouseDown){if(this._dragOffset!==-1)d=this._getSelection(),d.extend(this._dragOffset),d.collapse(),
this._setSelection(d,!0,!0),this._dragOffset=-1;this._isMouseDown=!1;this._endAutoScroll();this._isW3CEvents&&this._setGrab(null);b.isFirefox&&a.preventDefault()}},_handleMouseWheel:function(a){var d=this._getLineHeight(),c=0,f=0;b.isIE||b.isOpera?f=-a.wheelDelta/40*d:b.isFirefox?(d=b.isMac?a.detail*3:Math.max(-256,Math.min(256,a.detail))*d,a.axis===a.HORIZONTAL_AXIS?c=d:f=d):b.isMac?(f=a.timeStamp-this._wheelTimeStamp,this._wheelTimeStamp=a.timeStamp,c=a.wheelDeltaX%120!==0?1:f<40?40/(40-f):40,f=
a.wheelDeltaY%120!==0?1:f<40?40/(40-f):40,c=Math.ceil(-a.wheelDeltaX/c),-1<c&&c<0&&(c=-1),0<c&&c<1&&(c=1),f=Math.ceil(-a.wheelDeltaY/f),-1<f&&f<0&&(f=-1),0<f&&f<1&&(f=1)):(c=-a.wheelDeltaX,f=-a.wheelDeltaY/120*8*d);if(b.isSafari){for(d=a.target;d&&d.lineIndex===void 0;)d=d.parentNode;this._mouseWheelLine=d}d=this._getScroll();this._scrollView(c,f);c=this._getScroll();if(d.x!==c.x||d.y!==c.y)return a.preventDefault&&a.preventDefault(),!1},_handlePaste:function(a){if(!this._ignoreEvent(a)&&!this._ignorePaste&&
this._doPaste(a)){if(b.isIE){var d=this;this._ignoreFocus=!0;this._getWindow().setTimeout(function(){d._updateDOMSelection();d._ignoreFocus=!1},0)}a.preventDefault&&a.preventDefault();return!1}},_handleResize:function(){var a=this._parent.clientWidth,d=this._parent.clientHeight;if(this._parentWidth!==a||this._parentHeight!==d)this._parentWidth!==a&&this._wrapMode&&this._resetLineHeight(),this._parentWidth=a,this._parentHeight=d,b.isIE<9?this._queueUpdate():this._update()},_handleRulerEvent:function(a){for(var d=
a.target?a.target:a.srcElement,b=d.lineIndex;d&&!d._ruler;){if(b===void 0&&d.lineIndex!==void 0)b=d.lineIndex;d=d.parentNode}d=d?d._ruler:null;if(b===void 0&&d&&d.getOverview()==="document"){var b=this._getClientHeight(),c=this._model.getLineCount(),f=this._getViewPadding(),e=this._viewDiv.getBoundingClientRect(),b=Math.floor((a.clientY-e.top-this._metrics.scrollWidth)*c/(b+f.top+f.bottom-2*this._metrics.scrollWidth));0<=b&&b<c||(b=void 0)}if(d)switch(a.type){case "click":if(d.onClick)d.onClick(b,
a);break;case "dblclick":if(d.onDblClick)d.onDblClick(b,a);break;case "mousemove":if(d.onMouseMove)d.onMouseMove(b,a);break;case "mouseover":if(d.onMouseOver)d.onMouseOver(b,a);break;case "mouseout":if(d.onMouseOut)d.onMouseOut(b,a)}},_handleScroll:function(){var a=this._getScroll(!1),d=this._hScroll,b=this._vScroll;if(d!==a.x||b!==a.y)this._hScroll=a.x,this._vScroll=a.y,this._commitIME(),this._update(b===a.y),this.onScroll({type:"Scroll",oldValue:{x:d,y:b},newValue:a})},_handleSelectStart:function(a){if(this._ignoreSelect)return a&&
a.preventDefault&&a.preventDefault(),!1},_getModelOffset:function(a,d){if(a){var b;b=a.tagName==="DIV"?a:a.parentNode.parentNode;var c=0,f=b.lineIndex;if(a.tagName!=="DIV")for(b=b.firstChild;b;){var e=b.firstChild;if(e===a){b.ignoreChars&&(c-=b.ignoreChars);c+=d;break}b.ignoreChars&&(c-=b.ignoreChars);c+=e.data.length;b=b.nextSibling}return Math.max(0,c)+this._model.getLineStart(f)}},_updateSelectionFromDOM:function(){var a=this._getWindow().getSelection(),d=this._getModelOffset(a.anchorNode,a.anchorOffset),
a=this._getModelOffset(a.focusNode,a.focusOffset);d===void 0||a===void 0||this._setSelection(new q(d,a),!1,!1)},_handleSelectionChange:function(){if(this._imeOffset===-1)if(b.isAndroid){var a=this._getWindow();this._selTimer&&a.clearTimeout(this._selTimer);var d=this;this._selTimer=a.setTimeout(function(){if(d._clientDiv)d._selTimer=null,d._updateSelectionFromDOM()},250)}else this._updateSelectionFromDOM()},_handleTextInput:function(a){if(!this._ignoreEvent(a)){this._imeOffset=-1;if(b.isAndroid){for(var d=
this._getWindow().getSelection(),c=d.anchorNode;c;){if(c.lineIndex!==void 0)break;c=c.parentNode}if(c){var f=this._model,e=c.lineIndex,h=f.getLine(e),g=h,i=0,f=f.getLineStart(e);if(d.rangeCount>0)d.getRangeAt(0).deleteContents(),e=c.ownerDocument.createTextNode(a.data),d.getRangeAt(0).insertNode(e),i=this._getDOMText(c,e),g=i.text,i=i.offset,e.parentNode.removeChild(e);c.lineRemoved=!0;for(c=0;h.charCodeAt(c)===g.charCodeAt(c)&&c<i;)c++;d=h.length-1;for(e=g.length-h.length;h.charCodeAt(d)===g.charCodeAt(d+
e)&&d+e>=i+a.data.length;)d--;d++;h=g.substring(c,d+e);c+=f;d+=f;this._modifyContent({text:h,start:c,end:d,_ignoreDOMSelection:!0},!0)}}else this._doContent(a.data);a.preventDefault()}},_handleTouchStart:function(a){this._commitIME();var d=this._getWindow();if(this._touchScrollTimer)this._vScrollDiv.style.display="none",this._hScrollDiv.style.display="none",d.clearInterval(this._touchScrollTimer),this._touchScrollTimer=null;var c=a.touches;if(c.length===1){var c=c[0],f=c.clientX,e=c.clientY;this._touchStartX=
f;this._touchStartY=e;if(b.isAndroid&&(e<c.pageY-d.pageYOffset||f<c.pageX-d.pageXOffset))f=c.pageX-d.pageXOffset,e=c.pageY-d.pageYOffset;d=this.convert({x:f,y:e},"page","document");this._lastTouchOffset=this.getOffsetAtLocation(d.x,d.y);this._touchStartTime=a.timeStamp;this._touching=!0}},_handleTouchMove:function(a){var d=a.touches;if(d.length===1){d=d[0];this._touchCurrentX=d.clientX;this._touchCurrentY=d.clientY;if(!this._touchScrollTimer&&a.timeStamp-this._touchStartTime<200){this._vScrollDiv.style.display=
"block";if(!this._wrapMode)this._hScrollDiv.style.display="block";var b=this,c=this._getWindow();this._touchScrollTimer=c.setInterval(function(){var a=0,d=0;if(b._touching)a=b._touchStartX-b._touchCurrentX,d=b._touchStartY-b._touchCurrentY,b._touchSpeedX=a/10,b._touchSpeedY=d/10,b._touchStartX=b._touchCurrentX,b._touchStartY=b._touchCurrentY;else if(Math.abs(b._touchSpeedX)<0.1&&Math.abs(b._touchSpeedY)<0.1){b._vScrollDiv.style.display="none";b._hScrollDiv.style.display="none";c.clearInterval(b._touchScrollTimer);
b._touchScrollTimer=null;return}else a=b._touchSpeedX*10,d=b._touchSpeedY*10,b._touchSpeedX*=0.95,b._touchSpeedY*=0.95;b._scrollView(a,d)},10)}this._touchScrollTimer&&a.preventDefault()}},_handleTouchEnd:function(a){if(a.touches.length===0)this._touching=!1},_doAction:function(a){var d,b,c=this._keyModes;for(b=c.length-1;b>=0;b--)if(d=c[b],typeof d.match==="function"&&(d=d.match(a),d!==void 0))return this.invokeAction(d);return!1},_doMove:function(a,d){var b=this._model,c=d.getCaret(),f=b.getLineAtOffset(c);
if(!a.count)a.count=1;for(;a.count!==0;){var e=b.getLineStart(f);if(a.count<0&&c===e)if(f>0)a.unit==="character"&&a.count++,f--,d.extend(b.getLineEnd(f));else break;else if(a.count>0&&c===b.getLineEnd(f))if(f+1<b.getLineCount())a.unit==="character"&&a.count--,f++,d.extend(b.getLineStart(f));else break;else{var h=!1;a.expandTab&&a.unit==="character"&&(c-e)%this._tabSize===0&&(h=!/[^ ]/.test(b.getText(e,c)));h?(d.extend(c-this._tabSize),a.count+=a.count<0?1:-1):(e=this._getLine(f),d.extend(e.getNextOffset(c,
a)),e.destroy())}c=d.getCaret()}return d},_doBackspace:function(a){var d=this._getSelection();if(d.isEmpty()){if(!a.count)a.count=1;a.count*=-1;a.expandTab=this._expandTab;this._doMove(a,d)}this._modifyContent({text:"",start:d.start,end:d.end},!0);return!0},_doCase:function(a){var d=this._getSelection();this._doMove(a,d);var b=this.getText(d.start,d.end);this._setSelection(d,!0);switch(a.type){case "lower":b=b.toLowerCase();break;case "capitalize":b=b.replace(/(?:^|\s)\S/g,function(a){return a.toUpperCase()});
break;case "reverse":a="";for(d=0;d<b.length;d++){var c=b[d],f=c.toLowerCase(),c=f!==c?f:c.toUpperCase();a+=c}b=a;break;default:b=b.toUpperCase()}this._doContent(b);return!0},_doContent:function(a){var d=this._getSelection();if(this._overwriteMode&&d.isEmpty()){var b=this._model,c=b.getLineAtOffset(d.end);d.end<b.getLineEnd(c)&&(b=this._getLine(c),d.extend(b.getNextOffset(d.getCaret(),{unit:"character",count:1})),b.destroy())}this._modifyContent({text:a,start:d.start,end:d.end,_ignoreDOMSelection:!0},
!0)},_doCopy:function(a){var d=this._getSelection();return!d.isEmpty()?this._setClipboardText(this._getBaseText(d.start,d.end),a):!0},_doCursorNext:function(a){var d=this._getSelection();!d.isEmpty()&&!a.select?d.start=d.end:this._doMove(a,d);a.select||d.collapse();this._setSelection(d,!0);return!0},_doCursorPrevious:function(a){var d=this._getSelection();if(!d.isEmpty()&&!a.select)d.end=d.start;else{if(!a.count)a.count=1;a.count*=-1;this._doMove(a,d)}a.select||d.collapse();this._setSelection(d,!0);
return!0},_doCut:function(a){var d=this._getSelection();return!d.isEmpty()?(d=this._getBaseText(d.start,d.end),this._doContent(""),this._setClipboardText(d,a)):!0},_doDelete:function(a){var d=this._getSelection();d.isEmpty()&&this._doMove(a,d);this._modifyContent({text:"",start:d.start,end:d.end},!0);return!0},_doEnd:function(a){var d=this._getSelection(),b=this._model,c;if(a.ctrl)d.extend(b.getCharCount()),c=function(){};else{var f=d.getCaret(),e=b.getLineAtOffset(f);if(this._wrapMode){var h=this._getLine(e),
f=h.getLineIndex(f),f=f===h.getLineCount()-1?b.getLineEnd(e):h.getLineStart(f+1)-1;h.destroy()}else a.count&&a.count>0&&(e=Math.min(e+a.count-1,b.getLineCount()-1)),f=b.getLineEnd(e);d.extend(f)}a.select||d.collapse();this._setSelection(d,!0,!0,c);return!0},_doEnter:function(a){var d=this._model,b=this._getSelection();this._doContent(d.getLineDelimiter());if(a&&a.noCursor)b.end=b.start,this._setSelection(b,!0);return!0},_doHome:function(a){var d=this._getSelection(),b=this._model,c;if(a.ctrl)d.extend(0),
c=function(){};else{var f=d.getCaret(),e=b.getLineAtOffset(f);this._wrapMode?(b=this._getLine(e),f=b.getLineIndex(f),f=b.getLineStart(f),b.destroy()):f=b.getLineStart(e);d.extend(f)}a.select||d.collapse();this._setSelection(d,!0,!0,c);return!0},_doLineDown:function(a){var d=this._model,c=this._getSelection(),f=c.getCaret(),e=d.getLineAtOffset(f),h=this._getLine(e),g=this._columnX,i=1,l=!1;if(g===-1||a.wholeLine||a.select&&b.isIE)g=a.wholeLine?d.getLineEnd(e+1):f,g=h.getBoundingClientRect(g).left;
(f=h.getLineIndex(f))<h.getLineCount()-1?i=h.getClientRects(f+1).top+1:(f=d.getLineCount()-1,l=e===f,a.count&&a.count>0?e=Math.min(e+a.count,f):e++);f=!1;if(l){if(a.select||b.isMac||b.isLinux)c.extend(d.getCharCount()),f=!0}else h.lineIndex!==e&&(h.destroy(),h=this._getLine(e)),c.extend(h.getOffset(g,i)),f=!0;f&&(a.select||c.collapse(),this._setSelection(c,!0,!0));this._columnX=g;h.destroy();return!0},_doLineUp:function(a){var d=this._model,c=this._getSelection(),f=c.getCaret(),e=d.getLineAtOffset(f),
h=this._getLine(e),g=this._columnX,i=!1,l;if(g===-1||a.wholeLine||a.select&&b.isIE)g=a.wholeLine?d.getLineStart(e-1):f,g=h.getBoundingClientRect(g).left;(f=h.getLineIndex(f))>0?l=h.getClientRects(f-1).top+1:(i=e===0,i||(a.count&&a.count>0?e=Math.max(e-a.count,0):e--,l=this._getLineHeight(e)-1));f=!1;if(i){if(a.select||b.isMac||b.isLinux)c.extend(0),f=!0}else h.lineIndex!==e&&(h.destroy(),h=this._getLine(e)),c.extend(h.getOffset(g,l)),f=!0;f&&(a.select||c.collapse(),this._setSelection(c,!0,!0));this._columnX=
g;h.destroy();return!0},_doNoop:function(){return!0},_doPageDown:function(a){var d=this,c=this._model,f=this._getSelection(),e=f.getCaret(),h=c.getLineAtOffset(e),g=c.getLineCount(),i=this._getScroll(),c=this._getClientHeight(),l,m;if(this._lineHeight){l=this._columnX;i=this._getBoundsAtOffset(e);if(l===-1||a.select&&b.isIE)l=i.left;e=this._getLineIndex(i.top+c);m=this._getLine(e);h=this._getLinePixel(e);e=m.getOffset(l,i.top+c-h);c=m.getBoundingClientRect(e);m.destroy();f.extend(e);a.select||f.collapse();
this._setSelection(f,!0,!0,function(){d._columnX=l},c.top+h-i.top);return!0}if(h<g-1){var n=this._getLineHeight(),j=Math.min(g-h-1,Math.floor(c/n)),j=Math.max(1,j);l=this._columnX;if(l===-1||a.select&&b.isIE)m=this._getLine(h),l=m.getBoundingClientRect(e).left,m.destroy();m=this._getLine(h+j);f.extend(m.getOffset(l,0));m.destroy();a.select||f.collapse();a=g*n;e=i.y+j*n;e+c>a&&(e=a-c);this._setSelection(f,!0,!0,function(){d._columnX=l},e-i.y)}return!0},_doPageUp:function(a){var d=this,c=this._model,
f=this._getSelection(),e=f.getCaret(),h=c.getLineAtOffset(e),g=this._getScroll(),i=this._getClientHeight(),l;if(this._lineHeight){l=this._columnX;g=this._getBoundsAtOffset(e);if(l===-1||a.select&&b.isIE)l=g.left;e=this._getLineIndex(g.bottom-i);c=this._getLine(e);h=this._getLinePixel(e);e=c.getOffset(l,g.bottom-i-h);i=c.getBoundingClientRect(e);c.destroy();f.extend(e);a.select||f.collapse();this._setSelection(f,!0,!0,function(){d._columnX=l},i.top+h-g.top);return!0}if(h>0){var m=this._getLineHeight(),
i=Math.max(1,Math.min(h,Math.floor(i/m)));l=this._columnX;if(l===-1||a.select&&b.isIE)c=this._getLine(h),l=c.getBoundingClientRect(e).left,c.destroy();c=this._getLine(h-i);f.extend(c.getOffset(l,this._getLineHeight(h-i)-1));c.destroy();a.select||f.collapse();a=Math.max(0,g.y-i*m);this._setSelection(f,!0,!0,function(){d._columnX=l},a-g.y)}return!0},_doPaste:function(a){var d=this;return this._getClipboardText(a,function(a){a&&(b.isLinux&&d._lastMouseButton===2&&(new Date).getTime()-d._lastMouseTime<=
d._clickTime&&d._setSelectionTo(d._lastMouseX,d._lastMouseY),d._doContent(a))})!==null},_doScroll:function(a){var d=a.type,b=this._model,c=b.getLineCount(),a=this._getClientHeight(),f=this._getLineHeight();c*=f;var e=this._getScroll().y,h;switch(d){case "textStart":h=0;break;case "textEnd":h=c-a;break;case "pageDown":h=e+a;break;case "pageUp":h=e-a;break;case "lineDown":h=e+f;break;case "lineUp":h=e-f;break;case "centerLine":d=this._getSelection(),h=b.getLineAtOffset(d.start),b=(b.getLineAtOffset(d.end)-
h+1)*f,h=h*f-a/2+b/2}h!==void 0&&(h=Math.min(Math.max(0,h),c-a),this._scrollViewAnimated(0,h-e,function(){}));return!0},_doSelectAll:function(){var a=this._model,d=this._getSelection();d.setCaret(0);d.extend(a.getCharCount());this._setSelection(d,!1);return!0},_doTab:function(){if(this._tabMode&&!this._readonly){var a="\t";if(this._expandTab)var d=this._model,a=this._getSelection().getCaret(),b=d.getLineAtOffset(a),d=d.getLineStart(b),a=Array(this._tabSize-(a-d)%this._tabSize+1).join(" ");this._doContent(a);
return!0}},_doShiftTab:function(){return!this._tabMode||this._readonly?void 0:!0},_doOverwriteMode:function(){if(!this._readonly)return this.setOptions({overwriteMode:!this.getOptions("overwriteMode")}),!0},_doTabMode:function(){this._tabMode=!this._tabMode;return!0},_doWrapMode:function(){this.setOptions({wrapMode:!this.getOptions("wrapMode")});return!0},_autoScroll:function(){var a=this._model,d=this._getSelection(),c=this.convert({x:this._autoScrollX,y:this._autoScrollY},"page","document"),f=d.getCaret(),
e=a.getLineCount(),h=a.getLineAtOffset(f),g;if(this._autoScrollDir==="up"||this._autoScrollDir==="down")f=this._autoScrollY/this._getLineHeight(),f=f<0?Math.floor(f):Math.ceil(f),g=Math.max(0,Math.min(e-1,h+f));else if(this._autoScrollDir==="left"||this._autoScrollDir==="right")g=this._getLineIndex(c.y),h=this._getLine(h),c.x+=h.getBoundingClientRect(f,!1).left,h.destroy();g===0&&(b.isMac||b.isLinux)?d.extend(0):g===e-1&&(b.isMac||b.isLinux)?d.extend(a.getCharCount()):(h=this._getLine(g),d.extend(h.getOffset(c.x,
c.y-this._getLinePixel(g))),h.destroy());this._setSelection(d,!0)},_autoScrollTimer:function(){this._autoScroll();var a=this;this._autoScrollTimerID=this._getWindow().setTimeout(function(){a._autoScrollTimer()},this._AUTO_SCROLL_RATE)},_calculateLineHeightTimer:function(a){if(this._lineHeight&&!this._calculateLHTimer){var d=this._model.getLineCount(),b=0;if(a){for(var a=0,c=(new Date).getTime(),f=0;b<d;)if(this._lineHeight[b]||(a++,f||(f=b),this._lineHeight[b]=this._calculateLineHeight(b)),b++,(new Date).getTime()-
c>100)break;this.redrawRulers(0,d);this._queueUpdate()}a=this._getWindow();if(b!==d){var e=this;this._calculateLHTimer=a.setTimeout(function(){e._calculateLHTimer=null;e._calculateLineHeightTimer(!0)},0)}else if(this._calculateLHTimer)a.clearTimeout(this._calculateLHTimer),this._calculateLHTimer=void 0}},_calculateLineHeight:function(a){var a=this._getLine(a),d=a.getBoundingClientRect();a.destroy();return Math.max(1,d.bottom-d.top)},_calculateMetrics:function(){var a=this._clientDiv,d=a.ownerDocument,
c=b.createElement(d,"div");c.style.lineHeight="normal";var f={type:"LineStyle",textView:this,0:0,lineText:this._model.getLine(0),lineStart:0};this.onLineStyle(f);i(f.style,c);c.style.position="fixed";c.style.left="-1000px";var e=b.createElement(d,"span");e.appendChild(d.createTextNode(" "));c.appendChild(e);var h=b.createElement(d,"span");h.style.fontStyle="italic";h.appendChild(d.createTextNode(" "));c.appendChild(h);var g=b.createElement(d,"span");g.style.fontWeight="bold";g.appendChild(d.createTextNode(" "));
c.appendChild(g);f=b.createElement(d,"span");f.style.fontWeight="bold";f.style.fontStyle="italic";f.appendChild(d.createTextNode(" "));c.appendChild(f);a.appendChild(c);var l=c.getBoundingClientRect(),e=e.getBoundingClientRect(),h=h.getBoundingClientRect(),g=g.getBoundingClientRect(),f=f.getBoundingClientRect(),e=e.bottom-e.top,h=h.bottom-h.top,g=g.bottom-g.top,j=f.bottom-f.top,k=0,f=l.bottom-l.top<=0,l=Math.max(1,l.bottom-l.top);h>e&&(k=1);g>h&&(k=2);j>g&&(k=3);var q;if(k!==0){q={style:{}};if((k&
1)!==0)q.style.fontStyle="italic";if((k&2)!==0)q.style.fontWeight="bold"}e=m(c);a.removeChild(c);h=n(this._viewDiv);c=b.createElement(d,"div");c.style.position="fixed";c.style.left="-1000px";c.style.paddingLeft=h.left+"px";c.style.paddingTop=h.top+"px";c.style.paddingRight=h.right+"px";c.style.paddingBottom=h.bottom+"px";c.style.width="100px";c.style.height="100px";g=b.createElement(d,"div");g.style.width="100%";g.style.height="100%";c.appendChild(g);a.appendChild(c);d=c.getBoundingClientRect();h=
g.getBoundingClientRect();c.style.overflow="hidden";g.style.height="200px";g=c.clientWidth;c.style.overflow="scroll";j=c.clientWidth;a.removeChild(c);h={left:h.left-d.left,top:h.top-d.top,right:d.right-h.right,bottom:d.bottom-h.bottom};return{lineHeight:l,largestFontStyle:q,lineTrim:e,viewPadding:h,scrollWidth:g-j,invalid:f}},_cancelAnimation:function(){if(this._animation)this._animation.stop(),this._animation=null},_clearSelection:function(a){var d=this._getSelection();if(d.isEmpty())return!1;a===
"next"?d.start=d.end:d.end=d.start;this._setSelection(d,!0);return!0},_commitIME:function(){if(this._imeOffset!==-1){this._scrollDiv.focus();this._clientDiv.focus();var a=this._model,d=a.getLineAtOffset(this._imeOffset),b=a.getLineStart(d),c=this._getDOMText(this._getLineNode(d)).text,a=a.getLine(d),b=this._imeOffset-b,a=b+c.length-a.length;b!==a&&this._doContent(c.substring(b,a));this._imeOffset=-1}},_createActions:function(){this.addKeyMode(new j.DefaultKeyMode(this));var a=this;this._actions={noop:{defaultHandler:function(){return a._doNoop()}},
lineUp:{defaultHandler:function(b){return a._doLineUp(d(b,{select:!1}))},actionDescription:{name:g.lineUp}},lineDown:{defaultHandler:function(b){return a._doLineDown(d(b,{select:!1}))},actionDescription:{name:g.lineDown}},lineStart:{defaultHandler:function(b){return a._doHome(d(b,{select:!1,ctrl:!1}))},actionDescription:{name:g.lineStart}},lineEnd:{defaultHandler:function(b){return a._doEnd(d(b,{select:!1,ctrl:!1}))},actionDescription:{name:g.lineEnd}},charPrevious:{defaultHandler:function(b){return a._doCursorPrevious(d(b,
{select:!1,unit:"character"}))},actionDescription:{name:g.charPrevious}},charNext:{defaultHandler:function(b){return a._doCursorNext(d(b,{select:!1,unit:"character"}))},actionDescription:{name:g.charNext}},pageUp:{defaultHandler:function(b){return a._doPageUp(d(b,{select:!1}))},actionDescription:{name:g.pageUp}},pageDown:{defaultHandler:function(b){return a._doPageDown(d(b,{select:!1}))},actionDescription:{name:g.pageDown}},scrollPageUp:{defaultHandler:function(b){return a._doScroll(d(b,{type:"pageUp"}))},
actionDescription:{name:g.scrollPageUp}},scrollPageDown:{defaultHandler:function(b){return a._doScroll(d(b,{type:"pageDown"}))},actionDescription:{name:g.scrollPageDown}},scrollLineUp:{defaultHandler:function(b){return a._doScroll(d(b,{type:"lineUp"}))},actionDescription:{name:g.scrollLineUp}},scrollLineDown:{defaultHandler:function(b){return a._doScroll(d(b,{type:"lineDown"}))},actionDescription:{name:g.scrollLineDown}},wordPrevious:{defaultHandler:function(b){return a._doCursorPrevious(d(b,{select:!1,
unit:"word"}))},actionDescription:{name:g.wordPrevious}},wordNext:{defaultHandler:function(b){return a._doCursorNext(d(b,{select:!1,unit:"word"}))},actionDescription:{name:g.wordNext}},textStart:{defaultHandler:function(b){return a._doHome(d(b,{select:!1,ctrl:!0}))},actionDescription:{name:g.textStart}},textEnd:{defaultHandler:function(b){return a._doEnd(d(b,{select:!1,ctrl:!0}))},actionDescription:{name:g.textEnd}},scrollTextStart:{defaultHandler:function(b){return a._doScroll(d(b,{type:"textStart"}))},
actionDescription:{name:g.scrollTextStart}},scrollTextEnd:{defaultHandler:function(b){return a._doScroll(d(b,{type:"textEnd"}))},actionDescription:{name:g.scrollTextEnd}},centerLine:{defaultHandler:function(b){return a._doScroll(d(b,{type:"centerLine"}))},actionDescription:{name:g.centerLine}},selectLineUp:{defaultHandler:function(b){return a._doLineUp(d(b,{select:!0}))},actionDescription:{name:g.selectLineUp}},selectLineDown:{defaultHandler:function(b){return a._doLineDown(d(b,{select:!0}))},actionDescription:{name:g.selectLineDown}},
selectWholeLineUp:{defaultHandler:function(b){return a._doLineUp(d(b,{select:!0,wholeLine:!0}))},actionDescription:{name:g.selectWholeLineUp}},selectWholeLineDown:{defaultHandler:function(b){return a._doLineDown(d(b,{select:!0,wholeLine:!0}))},actionDescription:{name:g.selectWholeLineDown}},selectLineStart:{defaultHandler:function(b){return a._doHome(d(b,{select:!0,ctrl:!1}))},actionDescription:{name:g.selectLineStart}},selectLineEnd:{defaultHandler:function(b){return a._doEnd(d(b,{select:!0,ctrl:!1}))},
actionDescription:{name:g.selectLineEnd}},selectCharPrevious:{defaultHandler:function(b){return a._doCursorPrevious(d(b,{select:!0,unit:"character"}))},actionDescription:{name:g.selectCharPrevious}},selectCharNext:{defaultHandler:function(b){return a._doCursorNext(d(b,{select:!0,unit:"character"}))},actionDescription:{name:g.selectCharNext}},selectPageUp:{defaultHandler:function(b){return a._doPageUp(d(b,{select:!0}))},actionDescription:{name:g.selectPageUp}},selectPageDown:{defaultHandler:function(b){return a._doPageDown(d(b,
{select:!0}))},actionDescription:{name:g.selectPageDown}},selectWordPrevious:{defaultHandler:function(b){return a._doCursorPrevious(d(b,{select:!0,unit:"word"}))},actionDescription:{name:g.selectWordPrevious}},selectWordNext:{defaultHandler:function(b){return a._doCursorNext(d(b,{select:!0,unit:"word"}))},actionDescription:{name:g.selectWordNext}},selectTextStart:{defaultHandler:function(b){return a._doHome(d(b,{select:!0,ctrl:!0}))},actionDescription:{name:g.selectTextStart}},selectTextEnd:{defaultHandler:function(b){return a._doEnd(d(b,
{select:!0,ctrl:!0}))},actionDescription:{name:g.selectTextEnd}},deletePrevious:{defaultHandler:function(b){return a._doBackspace(d(b,{unit:"character"}))},actionDescription:{name:g.deletePrevious}},deleteNext:{defaultHandler:function(b){return a._doDelete(d(b,{unit:"character"}))},actionDescription:{name:g.deleteNext}},deleteWordPrevious:{defaultHandler:function(b){return a._doBackspace(d(b,{unit:"word"}))},actionDescription:{name:g.deleteWordPrevious}},deleteWordNext:{defaultHandler:function(b){return a._doDelete(d(b,
{unit:"word"}))},actionDescription:{name:g.deleteWordNext}},deleteLineStart:{defaultHandler:function(b){return a._doBackspace(d(b,{unit:"line"}))},actionDescription:{name:g.deleteLineStart}},deleteLineEnd:{defaultHandler:function(b){return a._doDelete(d(b,{unit:"line"}))},actionDescription:{name:g.deleteLineEnd}},tab:{defaultHandler:function(){return a._doTab()},actionDescription:{name:g.tab}},shiftTab:{defaultHandler:function(){return a._doShiftTab()},actionDescription:{name:g.shiftTab}},enter:{defaultHandler:function(){return a._doEnter()},
actionDescription:{name:g.enter}},enterNoCursor:{defaultHandler:function(b){return a._doEnter(d(b,{noCursor:!0}))},actionDescription:{name:g.enterNoCursor}},selectAll:{defaultHandler:function(){return a._doSelectAll()},actionDescription:{name:g.selectAll}},copy:{defaultHandler:function(){return a._doCopy()},actionDescription:{name:g.copy}},cut:{defaultHandler:function(){return a._doCut()},actionDescription:{name:g.cut}},paste:{defaultHandler:function(){return a._doPaste()},actionDescription:{name:g.paste}},
uppercase:{defaultHandler:function(b){return a._doCase(d(b,{type:"upper"}))},actionDescription:{name:g.uppercase}},lowercase:{defaultHandler:function(b){return a._doCase(d(b,{type:"lower"}))},actionDescription:{name:g.lowercase}},capitalize:{defaultHandler:function(b){return a._doCase(d(b,{unit:"word",type:"capitalize"}))},actionDescription:{name:g.capitalize}},reversecase:{defaultHandler:function(b){return a._doCase(d(b,{type:"reverse"}))},actionDescription:{name:g.reversecase}},toggleOverwriteMode:{defaultHandler:function(){return a._doOverwriteMode()},
actionDescription:{name:g.toggleOverwriteMode}},toggleTabMode:{defaultHandler:function(){return a._doTabMode()},actionDescription:{name:g.toggleTabMode}},toggleWrapMode:{defaultHandler:function(){return a._doWrapMode()},actionDescription:{name:g.toggleWrapMode}}}},_createRuler:function(a,d){if(this._clientDiv){var c=a.getLocation()==="left"?this._leftDiv:this._rightDiv;c.style.display="block";var f=b.createElement(c.ownerDocument,"div");f._ruler=a;f.rulerChanged=!0;f.style.position="relative";f.style.cssFloat=
"left";f.style.styleFloat="left";f.style.borderWidth="0px";f.style.margin="0px";f.style.padding="0px";f.style.outline="none";if(d===void 0||d<0||d>=c.children.length)c.appendChild(f);else{for(var e=c.firstChild;e&&--d>0;)e=e.nextSibling;c.insertBefore(f,e)}}},_createView:function(){if(!this._clientDiv){for(var a=this._parent;a.hasChildNodes();)a.removeChild(a.lastChild);var d=a.ownerDocument,c=b.createElement(d,"div");this._rootDiv=c;c.tabIndex=-1;c.style.position="relative";c.style.overflow="hidden";
c.style.width="100%";c.style.height="100%";c.style.overflow="hidden";c.style.WebkitTextSizeAdjust="100%";c.setAttribute("role","application");a.appendChild(c);a=b.createElement(d,"div");a.className="textviewLeftRuler";this._leftDiv=a;a.tabIndex=-1;a.style.overflow="hidden";a.style.MozUserSelect="none";a.style.WebkitUserSelect="none";a.style.position="absolute";a.style.top="0px";a.style.bottom="0px";a.style.cursor="default";a.style.display="none";a.setAttribute("aria-hidden","true");c.appendChild(a);
a=b.createElement(d,"div");a.className="textviewScroll";this._viewDiv=a;a.tabIndex=-1;a.style.overflow="auto";a.style.position="absolute";a.style.top="0px";a.style.bottom="0px";a.style.borderWidth="0px";a.style.margin="0px";a.style.outline="none";a.style.background="transparent";if(b.isMac&&b.isWebkit)a.style.pointerEvents="none",a.style.zIndex="2";c.appendChild(a);var f=b.createElement(d,"div");f.className="textviewRightRuler";this._rightDiv=f;f.tabIndex=-1;f.style.display="none";f.style.overflow=
"hidden";f.style.MozUserSelect="none";f.style.WebkitUserSelect="none";f.style.position="absolute";f.style.top="0px";f.style.bottom="0px";f.style.cursor="default";f.style.right="0px";f.setAttribute("aria-hidden","true");c.appendChild(f);this._scrollDiv=f=b.createElement(d,"div");f.style.margin="0px";f.style.borderWidth="0px";f.style.padding="0px";a.appendChild(f);if(b.isFirefox)this._clipboardDiv=a=b.createElement(d,"div"),a.style.position="fixed",a.style.whiteSpace="pre",a.style.left="-1000px",c.appendChild(a);
if(!b.isIE&&!b.isIOS)this._clipDiv=a=b.createElement(d,"div"),a.style.position="absolute",a.style.overflow="hidden",a.style.margin="0px",a.style.borderWidth="0px",a.style.padding="0px",a.style.background="transparent",c.appendChild(a),this._clipScrollDiv=f=b.createElement(d,"div"),f.style.position="absolute",f.style.height="1px",f.style.top="-1000px",f.style.background="transparent",a.appendChild(f);this._setFullSelection(this._fullSelection,!0);a=b.createElement(d,"div");a.className="textviewContent";
this._clientDiv=a;a.style.position="absolute";a.style.borderWidth="0px";a.style.margin="0px";a.style.padding="0px";a.style.outline="none";a.style.zIndex="1";a.style.WebkitUserSelect="text";a.setAttribute("spellcheck","false");if(b.isIOS||b.isAndroid)a.style.WebkitTapHighlightColor="transparent";(this._clipDiv||c).appendChild(a);if(b.isIOS||b.isAndroid)this._vScrollDiv=f=b.createElement(d,"div"),f.style.position="absolute",f.style.borderWidth="1px",f.style.borderColor="white",f.style.borderStyle="solid",
f.style.borderRadius="4px",f.style.backgroundColor="black",f.style.opacity="0.5",f.style.margin="0px",f.style.padding="0px",f.style.outline="none",f.style.zIndex="3",f.style.width="8px",f.style.display="none",c.appendChild(f),this._hScrollDiv=f=b.createElement(d,"div"),f.style.position="absolute",f.style.borderWidth="1px",f.style.borderColor="white",f.style.borderStyle="solid",f.style.borderRadius="4px",f.style.backgroundColor="black",f.style.opacity="0.5",f.style.margin="0px",f.style.padding="0px",
f.style.outline="none",f.style.zIndex="3",f.style.height="8px",f.style.display="none",c.appendChild(f);if(b.isFirefox&&!a.setCapture)this._overlayDiv=d=b.createElement(d,"div"),d.style.position=a.style.position,d.style.borderWidth=a.style.borderWidth,d.style.margin=a.style.margin,d.style.padding=a.style.padding,d.style.cursor="text",d.style.zIndex="2",(this._clipDiv||c).appendChild(d);a.contentEditable="true";a.setAttribute("role","textbox");a.setAttribute("aria-multiline","true");this._setWrapMode(this._wrapMode,
!0);this._setReadOnly(this._readonly);this._setThemeClass(this._themeClass,!0);this._setTabSize(this._tabSize,!0);this._hookEvents();c=this._rulers;for(d=0;d<c.length;d++)this._createRuler(c[d]);this._update()}},_defaultOptions:function(){return{parent:{value:void 0,update:null},model:{value:void 0,update:this.setModel},scrollAnimation:{value:0,update:null},readonly:{value:!1,update:this._setReadOnly},fullSelection:{value:!0,update:this._setFullSelection},tabMode:{value:!0,update:null},tabSize:{value:8,
update:this._setTabSize},expandTab:{value:!1,update:null},overwriteMode:{value:!1,update:this._setOverwriteMode},blockCursorVisible:{value:!1,update:this._setBlockCursor},wrapMode:{value:!1,update:this._setWrapMode},wrappable:{value:!1,update:null},theme:{value:c.TextTheme.getTheme(),update:this._setTheme},themeClass:{value:void 0,update:this._setThemeClass}}},_destroyRuler:function(a){var d=a.getLocation()==="left"?this._leftDiv:this._rightDiv;if(d)for(var b=d.firstChild;b;){if(b._ruler===a){b._ruler=
void 0;d.removeChild(b);if(d.children.length===0)d.style.display="none";break}b=b.nextSibling}},_destroyView:function(){if(this._clientDiv){this._setGrab(null);this._unhookEvents();var a=this._getWindow();if(this._autoScrollTimerID)a.clearTimeout(this._autoScrollTimerID),this._autoScrollTimerID=null;if(this._updateTimer)a.clearTimeout(this._updateTimer),this._updateTimer=null;a=this._rootDiv;a.parentNode.removeChild(a);this._hScrollDiv=this._vScrollDiv=this._rightDiv=this._leftDiv=this._overlayDiv=
this._clientDiv=this._clipScrollDiv=this._clipDiv=this._viewDiv=this._scrollDiv=this._rootDiv=this._clipboardDiv=this._selDiv3=this._selDiv2=this._selDiv1=null}},_doAutoScroll:function(a,d,b){this._autoScrollDir=a;this._autoScrollX=d;this._autoScrollY=b;this._autoScrollTimerID||this._autoScrollTimer()},_endAutoScroll:function(){this._autoScrollTimerID&&this._getWindow().clearTimeout(this._autoScrollTimerID);this._autoScrollTimerID=this._autoScrollDir=void 0},_fixCaret:function(){var a=this._clientDiv;
if(a){var d=this._hasFocus;this._ignoreFocus=!0;d&&a.blur();a.contentEditable=!1;a.contentEditable=!0;d&&a.focus();this._ignoreFocus=!1}},_getBaseText:function(a,d){var b=this._model;b.getBaseModel&&(a=b.mapOffset(a),d=b.mapOffset(d),b=b.getBaseModel());return b.getText(a,d)},_getBottomIndex:function(a){var d=this._bottomChild;if(a&&this._getClientHeight()>this._getLineHeight()){var a=d.getBoundingClientRect(),b=this._clientDiv.getBoundingClientRect();a.bottom>b.bottom&&(d=this._getLinePrevious(d)||
d)}return d.lineIndex},_getBoundsAtOffset:function(a){var d=this._getLine(this._model.getLineAtOffset(a)),a=d.getBoundingClientRect(a),b=this._getLinePixel(d.lineIndex);a.top+=b;a.bottom+=b;d.destroy();return a},_getClientHeight:function(){var a=this._getViewPadding();return Math.max(0,this._viewDiv.clientHeight-a.top-a.bottom)},_getClientWidth:function(){var a=this._getViewPadding();return Math.max(0,this._viewDiv.clientWidth-a.left-a.right)},_getClipboardText:function(a,d){var c=this._model.getLineDelimiter(),
f,e,h=this._getWindow();if(h.clipboardData)return f=[],e=h.clipboardData.getData("Text"),l(e,function(a){f.push(a)},function(){f.push(c)}),e=f.join(""),d&&d(e),e;if(b.isFirefox){this._ignoreFocus=!0;var g=this._clipboardDiv;g.innerHTML="<pre contenteditable=''></pre>";g.firstChild.focus();var i=this,m=function(){var a=i._getTextFromElement(g);g.innerHTML="";f=[];l(a,function(a){f.push(a)},function(){f.push(c)});return f.join("")},n=!1;this._ignorePaste=!0;if(!b.isLinux||this._lastMouseButton!==2)try{n=
g.ownerDocument.execCommand("paste",!1,null)}catch(j){n=g.childNodes.length>1||g.firstChild&&g.firstChild.childNodes.length>0}this._ignorePaste=!1;if(!n)return a?(h.setTimeout(function(){i.focus();(e=m())&&d&&d(e);i._ignoreFocus=!1},0),null):(this.focus(),this._ignoreFocus=!1,"");this.focus();this._ignoreFocus=!1;(e=m())&&d&&d(e);return e}return a&&a.clipboardData?(f=[],e=a.clipboardData.getData("text/plain"),l(e,function(a){f.push(a)},function(){f.push(c)}),(e=f.join(""))&&d&&d(e),e):""},_getDOMText:function(a,
d){for(var b=a.firstChild,c="",f=0;b;){var e;if(!b.ignore)if(b.ignoreChars){e=b.lastChild;for(var h=0,g=[],i=-1;e;){for(var l=e.data,m=l.length-1;m>=0;m--){var n=l.substring(m,m+1);h<b.ignoreChars&&(n===" "||n==="\u200c"||n==="\ufeff")?h++:g.push(n==="\u00a0"?"\t":n)}if(d===e)i=g.length;e=e.previousSibling}g=g.reverse().join("");i!==-1&&(f=c.length+g.length-i);c+=g}else for(e=b.firstChild;e;){if(d===e)f=c.length;c+=e.data;e=e.nextSibling}b=b.nextSibling}return{text:c,offset:f}},_getTextFromElement:function(a){var d=
a.ownerDocument,b=d.defaultView;if(!b.getSelection)return a.innerText||a.textContent;d=d.createRange();d.selectNode(a);var a=b.getSelection(),b=[],c;for(c=0;c<a.rangeCount;c++)b.push(a.getRangeAt(c));this._ignoreSelect=!0;a.removeAllRanges();a.addRange(d);d=a.toString();a.removeAllRanges();for(c=0;c<b.length;c++)a.addRange(b[c]);this._ignoreSelect=!1;return d},_getViewPadding:function(){return this._metrics.viewPadding},_getLine:function(a){var d=this._getLineNode(a);return d&&!d.lineChanged&&!d.lineRemoved?
d._line:new p(this,a)},_getLineHeight:function(a,d){if(a!==void 0&&this._lineHeight){var b=this._lineHeight[a];if(b)return b;if(d||d===void 0)return this._lineHeight[a]=this._calculateLineHeight(a)}return this._metrics.lineHeight},_getLineNode:function(a){for(var d=this._clientDiv.firstChild;d;){if(a===d.lineIndex)return d;d=d.nextSibling}},_getLineNext:function(a){for(a=a?a.nextSibling:this._clientDiv.firstChild;a&&a.lineIndex===-1;)a=a.nextSibling;return a},_getLinePrevious:function(a){for(a=a?
a.previousSibling:this._clientDiv.lastChild;a&&a.lineIndex===-1;)a=a.previousSibling;return a},_getLinePixel:function(a){a=Math.min(Math.max(0,a),this._model.getLineCount());if(this._lineHeight){var d=this._getTopIndex(),b=-this._topIndexY+this._getScroll().y;if(a>d)for(;d<a;d++)b+=this._getLineHeight(d);else for(d-=1;d>=a;d--)b-=this._getLineHeight(d);return b}return this._getLineHeight()*a},_getLineIndex:function(a){var d,b=0,c=this._model.getLineCount();if(this._lineHeight){var b=this._getTopIndex(),
f=-this._topIndexY+this._getScroll().y;if(a!==f)if(a<f)for(;a<f&&b>0;)a+=this._getLineHeight(--b);else for(d=this._getLineHeight(b);a-d>=f&&b<c-1;)a-=d,d=this._getLineHeight(++b)}else d=this._getLineHeight(),b=Math.floor(a/d);return Math.max(0,Math.min(c-1,b))},_getScroll:function(a){(a===void 0||a)&&this._cancelAnimation();a=this._viewDiv;return{x:a.scrollLeft,y:a.scrollTop}},_getSelection:function(){return this._selection.clone()},_getTopIndex:function(a){var d=this._topChild;if(a&&this._getClientHeight()>
this._getLineHeight()){var a=d.getBoundingClientRect(),b=this._getViewPadding(),c=this._viewDiv.getBoundingClientRect();a.top<c.top+b.top&&(d=this._getLineNext(d)||d)}return d.lineIndex},_hookEvents:function(){var d=this;this._modelListener={onChanging:function(a){d._onModelChanging(a)},onChanged:function(a){d._onModelChanged(a)}};this._model.addEventListener("preChanging",this._modelListener.onChanging);this._model.addEventListener("postChanged",this._modelListener.onChanged);this._themeListener=
{onChanged:function(){d._setThemeClass(d._themeClass)}};this._theme.addEventListener("ThemeChanged",this._themeListener.onChanged);var c=this._handlers=[],f=this._clientDiv,e=this._viewDiv,h=this._rootDiv,g=this._overlayDiv||f,i=f.ownerDocument,l=this._getWindow(),m=b.isIE?i:l;c.push({target:l,type:"resize",handler:function(a){return d._handleResize(a?a:l.event)}});c.push({target:f,type:"blur",handler:function(a){return d._handleBlur(a?a:l.event)}});c.push({target:f,type:"focus",handler:function(a){return d._handleFocus(a?
a:l.event)}});c.push({target:e,type:"focus",handler:function(){f.focus()}});c.push({target:e,type:"scroll",handler:function(a){return d._handleScroll(a?a:l.event)}});c.push({target:f,type:"textInput",handler:function(a){return d._handleTextInput(a?a:l.event)}});c.push({target:f,type:"keydown",handler:function(a){return d._handleKeyDown(a?a:l.event)}});c.push({target:f,type:"keypress",handler:function(a){return d._handleKeyPress(a?a:l.event)}});c.push({target:f,type:"keyup",handler:function(a){return d._handleKeyUp(a?
a:l.event)}});c.push({target:f,type:"contextmenu",handler:function(a){return d._handleContextMenu(a?a:l.event)}});c.push({target:f,type:"copy",handler:function(a){return d._handleCopy(a?a:l.event)}});c.push({target:f,type:"cut",handler:function(a){return d._handleCut(a?a:l.event)}});c.push({target:f,type:"paste",handler:function(a){return d._handlePaste(a?a:l.event)}});if(b.isIOS||b.isAndroid)c.push({target:i,type:"selectionchange",handler:function(a){return d._handleSelectionChange(a?a:l.event)}}),
c.push({target:f,type:"touchstart",handler:function(a){return d._handleTouchStart(a?a:l.event)}}),c.push({target:f,type:"touchmove",handler:function(a){return d._handleTouchMove(a?a:l.event)}}),c.push({target:f,type:"touchend",handler:function(a){return d._handleTouchEnd(a?a:l.event)}});else{c.push({target:f,type:"selectstart",handler:function(a){return d._handleSelectStart(a?a:l.event)}});c.push({target:f,type:"mousedown",handler:function(a){return d._handleMouseDown(a?a:l.event)}});c.push({target:f,
type:"mouseover",handler:function(a){return d._handleMouseOver(a?a:l.event)}});c.push({target:f,type:"mouseout",handler:function(a){return d._handleMouseOut(a?a:l.event)}});c.push({target:m,type:"mouseup",handler:function(a){return d._handleMouseUp(a?a:l.event)}});c.push({target:m,type:"mousemove",handler:function(a){return d._handleMouseMove(a?a:l.event)}});c.push({target:h,type:"mousedown",handler:function(a){return d._handleRootMouseDown(a?a:l.event)}});c.push({target:h,type:"mouseup",handler:function(a){return d._handleRootMouseUp(a?
a:l.event)}});c.push({target:g,type:"dragstart",handler:function(a){return d._handleDragStart(a?a:l.event)}});c.push({target:g,type:"drag",handler:function(a){return d._handleDrag(a?a:l.event)}});c.push({target:g,type:"dragend",handler:function(a){return d._handleDragEnd(a?a:l.event)}});c.push({target:g,type:"dragenter",handler:function(a){return d._handleDragEnter(a?a:l.event)}});c.push({target:g,type:"dragover",handler:function(a){return d._handleDragOver(a?a:l.event)}});c.push({target:g,type:"dragleave",
handler:function(a){return d._handleDragLeave(a?a:l.event)}});c.push({target:g,type:"drop",handler:function(a){return d._handleDrop(a?a:l.event)}});c.push({target:this._clientDiv,type:b.isFirefox?"DOMMouseScroll":"mousewheel",handler:function(a){return d._handleMouseWheel(a?a:l.event)}});if(b.isFirefox&&(!b.isWindows||b.isFirefox>=15))(e=l.MutationObserver||l.MozMutationObserver)?(this._mutationObserver=new e(function(a){d._handleDataModified(a)}),this._mutationObserver.observe(f,{subtree:!0,characterData:!0})):
c.push({target:this._clientDiv,type:"DOMCharacterDataModified",handler:function(a){return d._handleDataModified(a?a:l.event)}});this._overlayDiv&&(c.push({target:this._overlayDiv,type:"mousedown",handler:function(a){return d._handleMouseDown(a?a:l.event)}}),c.push({target:this._overlayDiv,type:"mouseover",handler:function(a){return d._handleMouseOver(a?a:l.event)}}),c.push({target:this._overlayDiv,type:"mouseout",handler:function(a){return d._handleMouseOut(a?a:l.event)}}),c.push({target:this._overlayDiv,
type:"contextmenu",handler:function(a){return d._handleContextMenu(a?a:l.event)}}));this._isW3CEvents||c.push({target:this._clientDiv,type:"dblclick",handler:function(a){return d._handleDblclick(a?a:l.event)}})}e=this._leftDiv;h=this._rightDiv;b.isIE&&c.push({target:e,type:"selectstart",handler:function(){return!1}});c.push({target:e,type:b.isFirefox?"DOMMouseScroll":"mousewheel",handler:function(a){return d._handleMouseWheel(a?a:l.event)}});c.push({target:e,type:"click",handler:function(a){d._handleRulerEvent(a?
a:l.event)}});c.push({target:e,type:"dblclick",handler:function(a){d._handleRulerEvent(a?a:l.event)}});c.push({target:e,type:"mousemove",handler:function(a){d._handleRulerEvent(a?a:l.event)}});c.push({target:e,type:"mouseover",handler:function(a){d._handleRulerEvent(a?a:l.event)}});c.push({target:e,type:"mouseout",handler:function(a){d._handleRulerEvent(a?a:l.event)}});b.isIE&&c.push({target:h,type:"selectstart",handler:function(){return!1}});c.push({target:h,type:b.isFirefox?"DOMMouseScroll":"mousewheel",
handler:function(a){return d._handleMouseWheel(a?a:l.event)}});c.push({target:h,type:"click",handler:function(a){d._handleRulerEvent(a?a:l.event)}});c.push({target:h,type:"dblclick",handler:function(a){d._handleRulerEvent(a?a:l.event)}});c.push({target:h,type:"mousemove",handler:function(a){d._handleRulerEvent(a?a:l.event)}});c.push({target:h,type:"mouseover",handler:function(a){d._handleRulerEvent(a?a:l.event)}});c.push({target:h,type:"mouseout",handler:function(a){d._handleRulerEvent(a?a:l.event)}});
for(e=0;e<c.length;e++)h=c[e],a(h.target,h.type,h.handler,h.capture)},_getWindow:function(){return this._parent.ownerDocument.defaultView||this._parent.ownerDocument.parentWindow},_ignoreEvent:function(a){for(a=a.target;a&&a!==this._clientDiv;){if(a.ignore)return!0;a=a.parentNode}return!1},_init:function(a){var d=a.parent;typeof d==="string"&&(d=(a.document||document).getElementById(d));if(!d)throw"no parent";a.parent=d;a.model=a.model||new k.TextModel;var c=this._defaultOptions(),f;for(f in c)c.hasOwnProperty(f)&&
(this["_"+f]=a[f]!==void 0?a[f]:c[f].value);this._keyModes=[];this._rulers=[];this._selection=new q(0,0,!1);this._linksVisible=!1;this._maxLineWidth=this._redrawCount=0;this._maxLineIndex=-1;this._ignoreSelect=!0;this._hasFocus=this._ignoreFocus=!1;this._dragOffset=this._columnX=-1;this._isRangeRects=(!b.isIE||b.isIE>=9)&&typeof d.ownerDocument.createRange().getBoundingClientRect==="function";this._isW3CEvents=d.addEventListener;this._autoScrollTimerID=this._autoScrollY=this._autoScrollX=null;this._AUTO_SCROLL_RATE=
50;this._mouseUpClosure=this._moseMoveClosure=this._grabControl=null;this._clickCount=this._lastMouseTime=this._lastMouseY=this._lastMouseX=0;this._clickTime=250;this._clickDist=5;this._isMouseDown=!1;this._doubleClickSelection=null;this._vScroll=this._hScroll=0;this._imeOffset=-1;this._createActions();this._createView()},_modifyContent:function(a,d){if(!this._readonly||a._code)if(a.type="Verify",this.onVerify(a),!(a.text===null||a.text===void 0)){var b=this._model;try{if(a._ignoreDOMSelection)this._ignoreDOMSelection=
!0;b.setText(a.text,a.start,a.end)}finally{if(a._ignoreDOMSelection)this._ignoreDOMSelection=!1}d&&(b=this._getSelection(),b.setCaret(a.start+a.text.length),this._setSelection(b,!0));this.onModify({type:"Modify"})}},_onModelChanged:function(a){a.type="ModelChanged";this.onModelChanged(a);a.type="Changed";var d=a.start,b=a.addedCharCount,c=a.removedCharCount,f=a.addedLineCount,e=a.removedLineCount,h=this._getSelection();h.end>d&&(h.end>d&&h.start<d+c?h.setCaret(d+b):(h.start+=b-c,h.end+=b-c),this._setSelection(h,
!1,!1));d=this._model.getLineAtOffset(d);for(b=this._getLineNext();b;){c=b.lineIndex;if(d<=c&&c<=d+e)d===c&&!b.modelChangedEvent&&!b.lineRemoved?(b.modelChangedEvent=a,b.lineChanged=!0):(b.lineRemoved=!0,b.lineChanged=!1,b.modelChangedEvent=null);if(c>d+e)b.lineIndex=c+f-e,b._line.lineIndex=b.lineIndex;b=this._getLineNext(b)}this._lineHeight&&(a=[d,e].concat(Array(f)),Array.prototype.splice.apply(this._lineHeight,a));if(!this._wrapMode&&d<=this._maxLineIndex&&this._maxLineIndex<=d+e)this._checkMaxLineIndex=
this._maxLineIndex,this._maxLineIndex=-1,this._maxLineWidth=0;this._update()},_onModelChanging:function(a){a.type="ModelChanging";this.onModelChanging(a);a.type="Changing"},_queueUpdate:function(){if(!this._updateTimer&&!this._ignoreQueueUpdate){var a=this;this._updateTimer=this._getWindow().setTimeout(function(){a._updateTimer=null;a._update()},0)}},_resetLineHeight:function(a,d){if(this._wrapMode||this._variableLineHeight){if(a!==void 0&&d!==void 0)for(var b=a;b<d;b++)this._lineHeight[b]=void 0;
else this._lineHeight=Array(this._model.getLineCount());this._calculateLineHeightTimer()}else this._lineHeight=null},_resetLineWidth:function(){var a=this._clientDiv;if(a)for(a=a.firstChild;a;)a.lineWidth=void 0,a=a.nextSibling},_reset:function(){this._maxLineIndex=-1;this._maxLineWidth=0;this._columnX=-1;this._bottomChild=this._topChild=null;this._topIndexY=0;this._variableLineHeight=!1;this._resetLineHeight();this._setSelection(new q(0,0,!1),!1,!1);if(this._viewDiv)this._viewDiv.scrollLeft=0,this._viewDiv.scrollTop=
0;var a=this._clientDiv;if(a){for(var d=a.firstChild;d;)d.lineRemoved=!0,d=d.nextSibling;if(b.isFirefox)this._ignoreFocus=!1,(d=this._hasFocus)&&a.blur(),a.contentEditable=!1,a.contentEditable=!0,d&&a.focus(),this._ignoreFocus=!1}},_scrollViewAnimated:function(a,d,b){if(b&&this._scrollAnimation){var c=this;this._animation=new t({window:this._getWindow(),duration:this._scrollAnimation,curve:[d,0],onAnimate:function(a){a=d-Math.floor(a);c._scrollView(0,a);d-=a},onEnd:function(){c._animation=null;c._scrollView(a,
d);b&&b()}});this._animation.play()}else this._scrollView(a,d),b&&b()},_scrollView:function(a,d){this._ensureCaretVisible=!1;var b=this._viewDiv;a&&(b.scrollLeft+=a);d&&(b.scrollTop+=d)},_setClipboardText:function(a,d){var c,f=this._parent.ownerDocument,e=this._getWindow();if(e.clipboardData)return c=[],l(a,function(a){c.push(a)},function(){c.push(b.platformDelimiter)}),e.clipboardData.setData("Text",c.join(""));if(d&&d.clipboardData&&(c=[],l(a,function(a){c.push(a)},function(){c.push(b.platformDelimiter)}),
d.clipboardData.setData("text/plain",c.join(""))))return!0;var h=b.createElement(f,"pre");h.style.position="fixed";h.style.left="-1000px";l(a,function(a){h.appendChild(f.createTextNode(a))},function(){h.appendChild(b.createElement(f,"br"))});h.appendChild(f.createTextNode(" "));this._clientDiv.appendChild(h);var g=f.createRange();g.setStart(h.firstChild,0);g.setEndBefore(h.lastChild);var i=e.getSelection();i.rangeCount>0&&i.removeAllRanges();i.addRange(g);var m=this,g=function(){h&&h.parentNode===
m._clientDiv&&m._clientDiv.removeChild(h);m._updateDOMSelection()},i=!1;this._ignoreCopy=!0;try{i=f.execCommand("copy",!1,null)}catch(n){}this._ignoreCopy=!1;if(!i&&d)return e.setTimeout(g,0),!1;g();return!0},_setDOMSelection:function(a,d,c,f,e){for(var h,g,i,l,m=0,n=a.firstChild,j,k,q=this._model.getLine(a.lineIndex).length;n;){if(!n.ignore){j=n.firstChild;k=j.length;n.ignoreChars&&(k-=n.ignoreChars);if(m+k>d||m+k>=q){h=j;g=d-m;n.ignoreChars&&k>0&&g===k&&(g+=n.ignoreChars);break}m+=k}n=n.nextSibling}for(var m=
0,n=c.firstChild,s=this._model.getLine(c.lineIndex).length;n;){if(!n.ignore){j=n.firstChild;k=j.length;n.ignoreChars&&(k-=n.ignoreChars);if(k+m>f||m+k>=s){i=j;l=f-m;n.ignoreChars&&k>0&&l===k&&(l+=n.ignoreChars);break}m+=k}n=n.nextSibling}this._setDOMFullSelection(a,d,q,c,f,s);a=this._getWindow();d=this._parent.ownerDocument;if(a.getSelection){c=a.getSelection();a=d.createRange();a.setStart(h,g);a.setEnd(i,l);if(this._hasFocus&&(c.anchorNode!==h||c.anchorOffset!==g||c.focusNode!==i||c.focusOffset!==
l||c.anchorNode!==i||c.anchorOffset!==l||c.focusNode!==h||c.focusOffset!==g))this._ignoreSelect=!1,c.rangeCount>0&&c.removeAllRanges(),c.addRange(a),this._ignoreSelect=!0;if(this._cursorDiv&&(a=d.createRange(),e?(a.setStart(h,g),a.setEnd(h,g)):(a.setStart(i,l),a.setEnd(i,l)),i=a.getClientRects()[0],l=this._cursorDiv.parentNode,h=l.getBoundingClientRect(),i&&h))this._cursorDiv.style.top=i.top-h.top+l.scrollTop+"px",this._cursorDiv.style.left=i.left-h.left+l.scrollLeft+"px"}else if(d.selection&&this._hasFocus)e=
d.body,a=b.createElement(d,"div"),e.appendChild(a),e.removeChild(a),a=e.createTextRange(),a.moveToElementText(h.parentNode),a.moveStart("character",g),h=e.createTextRange(),h.moveToElementText(i.parentNode),h.moveStart("character",l),a.setEndPoint("EndToStart",h),this._ignoreSelect=!1,a.select(),this._ignoreSelect=!0},_setDOMFullSelection:function(a,d,b,c,f){if(this._selDiv1&&(b=this._selDiv1,b.style.width="0px",b.style.height="0px",b=this._selDiv2,b.style.width="0px",b.style.height="0px",b=this._selDiv3,
b.style.width="0px",b.style.height="0px",!(a===c&&d===f))){var e=this._model,h=this._getViewPadding(),g=this._clientDiv.getBoundingClientRect(),i=this._viewDiv.getBoundingClientRect(),b=i.left+h.left,l=g.right,h=i.top+h.top,m=g.bottom,i=g=0;this._clipDiv?(i=this._clipDiv.getBoundingClientRect(),g=i.left-this._clipDiv.scrollLeft):(i=this._rootDiv.getBoundingClientRect(),g=i.left);i=i.top;this._ignoreDOMSelection=!0;var a=(new p(this,a.lineIndex,a)).getBoundingClientRect(e.getLineStart(a.lineIndex)+
d,!1),n=a.left,f=(new p(this,c.lineIndex,c)).getBoundingClientRect(e.getLineStart(c.lineIndex)+f,!1),d=f.left;this._ignoreDOMSelection=!1;var e=this._selDiv1,n=Math.min(l,Math.max(b,n)),j=Math.min(m,Math.max(h,a.top)),k=l,c=Math.min(m,Math.max(h,a.bottom));e.style.left=n-g+"px";e.style.top=j-i+"px";e.style.width=Math.max(0,k-n)+"px";e.style.height=Math.max(0,c-j)+"px";if(a.top===f.top)k=Math.min(d,l),e.style.width=Math.max(0,k-n)+"px";else if(a=Math.min(m,Math.max(h,f.top)),d=Math.min(l,Math.max(b,
d)),h=Math.min(m,Math.max(h,f.bottom)),m=this._selDiv3,m.style.left=b-g+"px",m.style.top=a-i+"px",m.style.width=Math.max(0,d-b)+"px",m.style.height=Math.max(0,h-a)+"px",a-c>0)h=this._selDiv2,h.style.left=b-g+"px",h.style.top=c-i+"px",h.style.width=Math.max(0,l-b)+"px",h.style.height=Math.max(0,a-c)+"px"}},_setGrab:function(a){if(a!==this._grabControl)a?(a.setCapture&&a.setCapture(),this._grabControl=a):(this._grabControl.releaseCapture&&this._grabControl.releaseCapture(),this._grabControl=null)},
_setLinksVisible:function(a){if(this._linksVisible!==a){this._linksVisible=a;if(b.isIE&&a)this._hadFocus=this._hasFocus;var d=this._clientDiv;d.contentEditable=!a;this._hadFocus&&!a&&d.focus();if(this._overlayDiv)this._overlayDiv.style.zIndex=a?"-1":"1";for(a=this._getLineNext();a;){if(a.hasLink)for(d=a.firstChild;d;)if(d.ignore)d=d.nextSibling;else{var c=d.nextSibling,f=d.viewStyle;f&&f.tagName&&f.tagName.toLowerCase()==="a"&&a.replaceChild(a._line._createSpan(a,d.firstChild.data,f),d);d=c}a=this._getLineNext(a)}this._updateDOMSelection()}},
_setSelection:function(a,d,b,c,f){if(a){this._columnX=-1;b===void 0&&(b=!0);var e=this._selection;this._selection=a;d!==!1&&this._showCaret(!1,c,d,f);b&&this._updateDOMSelection();if(!e.equals(a))this.onSelection({type:"Selection",oldValue:{start:e.start,end:e.end},newValue:{start:a.start,end:a.end}})}},_setSelectionTo:function(a,d,b,c){var f=this._model,e=this._getSelection(),d=this.convert({x:a,y:d},"page","document"),a=this._getLineIndex(d.y);if(this._clickCount===1){f=this._getLine(a);a=f.getOffset(d.x,
d.y-this._getLinePixel(a));f.destroy();if(c&&!b&&e.start<=a&&a<e.end)return this._dragOffset=a,!1;e.extend(a);b||e.collapse()}else(this._clickCount&1)===0?(f=this._getLine(a),a=f.getOffset(d.x,d.y-this._getLinePixel(a)),this._doubleClickSelection?a>=this._doubleClickSelection.start?(b=this._doubleClickSelection.start,c=f.getNextOffset(a,{unit:"wordend",count:1})):(b=f.getNextOffset(a,{unit:"word",count:-1}),c=this._doubleClickSelection.end):(b=f.getNextOffset(a,{unit:"word",count:-1}),c=f.getNextOffset(b,
{unit:"wordend",count:1})),f.destroy()):this._doubleClickSelection?(c=f.getLineAtOffset(this._doubleClickSelection.start),a>=c?(b=f.getLineStart(c),c=f.getLineEnd(a)):(b=f.getLineStart(a),c=f.getLineEnd(c))):(b=f.getLineStart(a),c=f.getLineEnd(a)),e.setCaret(b),e.extend(c);this._setSelection(e,!0,!0);return!0},_setFullSelection:function(a,d){this._fullSelection=a;if(b.isWebkit)this._fullSelection=!0;var c=this._clipDiv||this._rootDiv;if(c)if(this._fullSelection){if(!this._selDiv1&&this._fullSelection&&
!b.isIOS){var f=c.ownerDocument;this._highlightRGB=b.isWebkit?"transparent":"Highlight";var e=b.createElement(f,"div");this._selDiv1=e;e.style.position="absolute";e.style.borderWidth="0px";e.style.margin="0px";e.style.padding="0px";e.style.outline="none";e.style.background=this._highlightRGB;e.style.width="0px";e.style.height="0px";e.style.zIndex="0";c.appendChild(e);var h=b.createElement(f,"div");this._selDiv2=h;h.style.position="absolute";h.style.borderWidth="0px";h.style.margin="0px";h.style.padding=
"0px";h.style.outline="none";h.style.background=this._highlightRGB;h.style.width="0px";h.style.height="0px";h.style.zIndex="0";c.appendChild(h);this._selDiv3=f=b.createElement(f,"div");f.style.position="absolute";f.style.borderWidth="0px";f.style.margin="0px";f.style.padding="0px";f.style.outline="none";f.style.background=this._highlightRGB;f.style.width="0px";f.style.height="0px";f.style.zIndex="0";c.appendChild(f);if(b.isFirefox&&b.isMac){c=this._getWindow().getComputedStyle(f,null).getPropertyValue("background-color");
switch(c){case "rgb(119, 141, 168)":c="rgb(199, 208, 218)";break;case "rgb(127, 127, 127)":c="rgb(198, 198, 198)";break;case "rgb(255, 193, 31)":c="rgb(250, 236, 115)";break;case "rgb(243, 70, 72)":c="rgb(255, 176, 139)";break;case "rgb(255, 138, 34)":c="rgb(255, 209, 129)";break;case "rgb(102, 197, 71)":c="rgb(194, 249, 144)";break;case "rgb(140, 78, 184)":c="rgb(232, 184, 255)";break;default:c="rgb(180, 213, 255)"}this._highlightRGB=c;e.style.background=c;h.style.background=c;f.style.background=
c}d||this._updateDOMSelection()}}else{if(this._selDiv1)c.removeChild(this._selDiv1),this._selDiv1=null;if(this._selDiv2)c.removeChild(this._selDiv2),this._selDiv2=null;if(this._selDiv3)c.removeChild(this._selDiv3),this._selDiv3=null}},_setBlockCursor:function(a){this._blockCursorVisible=a;this._updateBlockCursorVisible()},_setOverwriteMode:function(a){this._overwriteMode=a;this._updateBlockCursorVisible()},_updateBlockCursorVisible:function(){if(this._blockCursorVisible||this._overwriteMode){if(!this._cursorDiv){var a=
b.createElement(document,"div");a.className="textviewBlockCursor";this._cursorDiv=a;a.tabIndex=-1;a.style.zIndex="2";a.style.color="transparent";a.style.position="absolute";a.style.pointerEvents="none";a.innerHTML="&nbsp;";this._viewDiv.appendChild(a);this._updateDOMSelection()}}else if(this._cursorDiv)this._cursorDiv.parentNode.removeChild(this._cursorDiv),this._cursorDiv=null},_setReadOnly:function(a){this._readonly=a;this._clientDiv.setAttribute("aria-readonly",a?"true":"false")},_setTabSize:function(a,
d){this._tabSize=a;this._customTabSize=void 0;var c=this._clientDiv;if(b.isOpera){if(c)c.style.OTabSize=this._tabSize+""}else if(b.isWebkit>=537.1){if(c)c.style.tabSize=this._tabSize+""}else if(b.isFirefox>=4){if(c)c.style.MozTabSize=this._tabSize+""}else if(this._tabSize!==8)this._customTabSize=this._tabSize;d||(this.redrawLines(),this._resetLineWidth())},_setTheme:function(a){this._theme&&this._theme.removeEventListener("ThemeChanged",this._themeListener.onChanged);(this._theme=a)&&this._theme.addEventListener("ThemeChanged",
this._themeListener.onChanged);this._setThemeClass(this._themeClass)},_setThemeClass:function(a,d){this._themeClass=a;var b="textview",c=this._theme.getThemeClass();c&&(b+=" "+c);this._themeClass&&c!==this._themeClass&&(b+=" "+this._themeClass);this._rootDiv.className=b;this._updateStyle(d)},_setWrapMode:function(a,d){this._wrapMode=a&&this._wrappable;var b=this._clientDiv,c=this._viewDiv;a?(b.style.whiteSpace="pre-wrap",b.style.wordWrap="break-word",c.style.overflowX="hidden",c.style.overflowY="scroll"):
(b.style.whiteSpace="pre",b.style.wordWrap="normal",c.style.overflowX="auto",c.style.overflowY="auto");d||(this.redraw(),this._resetLineWidth());this._resetLineHeight()},_showCaret:function(a,d,b,c){if(this._clientDiv){var f=this._model,e=this._getSelection(),h=this._getScroll(),g=e.getCaret(),i=e.start,l=e.end,m=f.getLineAtOffset(l),n=Math.max(Math.max(i,f.getLineStart(m)),l-1),f=this._getClientWidth(),m=this._getClientHeight(),j=f/4,k=this._getBoundsAtOffset(g===i?i:n),q=k.left,s=k.right,p=k.top,
r=k.bottom;a&&!e.isEmpty()&&(k=this._getBoundsAtOffset(g===l?i:n),k.top===p?g===i?s=q+Math.min(k.right-q,f):q=s-Math.min(s-k.left,f):g===i?r=p+Math.min(k.bottom-p,m):p=r-Math.min(r-k.top,m));a=0;q<h.x&&(a=Math.min(q-h.x,-j));s>h.x+f&&(a=Math.max(s-h.x-f,j));e=0;p<h.y?e=p-h.y:r>h.y+m&&(e=r-h.y-m);c&&(c>0?e>0&&(e=Math.max(e,c)):e<0&&(e=Math.min(e,c)));if(a!==0||e!==0)return e!==0&&typeof b==="number"&&(b<0&&(b=0),b>1&&(b=1),e+=Math.floor(e>0?b*m:-b*m)),this._scrollViewAnimated(a,e,d),m!==this._getClientHeight()||
f!==this._getClientWidth()?this._showCaret():this._ensureCaretVisible=!0,!0;else d&&d();return!1}},_startIME:function(){if(this._imeOffset===-1){var a=this._getSelection();a.isEmpty()||this._modifyContent({text:"",start:a.start,end:a.end},!0);this._imeOffset=a.start}},_unhookEvents:function(){this._model.removeEventListener("preChanging",this._modelListener.onChanging);this._model.removeEventListener("postChanged",this._modelListener.onChanged);this._theme.removeEventListener("ThemeChanged",this._themeListener.onChanged);
this._modelListener=null;for(var a=0;a<this._handlers.length;a++){var d=this._handlers[a],b=d.target,c=d.type,d=d.handler;typeof b.removeEventListener==="function"?b.removeEventListener(c,d,!1):b.detachEvent("on"+c,d)}this._handlers=null;if(this._mutationObserver)this._mutationObserver.disconnect(),this._mutationObserver=null},_updateDOMSelection:function(){if(!this._ignoreDOMSelection&&this._clientDiv){var a=this._getSelection(),d=this._model,b=d.getLineAtOffset(a.start),c=d.getLineAtOffset(a.end),
f=this._getLineNext();if(f){var e=this._getLinePrevious(),h;b<f.lineIndex?(h=f,b=0):b>e.lineIndex?(h=e,b=0):(h=this._getLineNode(b),b=a.start-d.getLineStart(b));c<f.lineIndex?d=0:c>e.lineIndex?(f=e,d=0):(f=this._getLineNode(c),d=a.end-d.getLineStart(c));this._setDOMSelection(h,b,f,d,a.caret)}}},_update:function(a){if(!(this._redrawCount>0)){if(this._updateTimer)this._getWindow().clearTimeout(this._updateTimer),this._updateTimer=null,a=!1;var d=this._clientDiv;if(d){if(this._metrics.invalid)this._ignoreQueueUpdate=
!0,this._updateStyle(),this._ignoreQueueUpdate=!1;var c=this._model,f=this._getScroll(!1),e=this._getViewPadding(),h=c.getLineCount(),g=this._getLineHeight(),i=this._getClientWidth();if(this._wrapMode)d.style.width=i+"px";var l,m,n,j,k=0,q=0;if(this._lineHeight){for(;q<h;){m=this._getLineHeight(q);if(k+m>f.y)break;k+=m;q++}l=q;m=Math.max(0,l-1);n=c=f.y-k;l>0&&(c+=this._getLineHeight(l-1))}else j=Math.max(0,f.y)/g,l=Math.floor(j),m=Math.max(0,l-1),c=Math.round((j-m)*g),n=Math.round((j-l)*g);this._topIndexY=
n;j=this._parent;var s=j.clientWidth,r=j.clientHeight;j=this._getClientHeight();if(a){g=0;this._leftDiv&&(l=this._leftDiv.getBoundingClientRect(),g=l.right-l.left);l=i;for(this._wrapMode||(l=Math.max(this._maxLineWidth,l));q<h;)m=this._getLineHeight(q,!1),k+=m,q++;h=k}else{i=this._viewDiv;n=Math.min(l+Math.floor((j+n)/g),h-1);for(var f=Math.min(n+1,h-1),t,y=d.firstChild;y;){t=y.lineIndex;var E=y.nextSibling;if(!(m<=t&&t<=f)||y.lineRemoved||y.lineIndex===-1)this._mouseWheelLine===y?(y.style.display=
"none",y.lineIndex=-1):d.removeChild(y);y=E}var y=this._getLineNext(),E=i.ownerDocument,F=E.createDocumentFragment();for(t=m;t<=f;t++)if(!y||y.lineIndex>t)(new p(this,t)).create(F,null);else{F.firstChild&&(d.insertBefore(F,y),F=E.createDocumentFragment());if(y&&y.lineChanged)y=(new p(this,t)).create(F,y),y.lineChanged=!1;y=this._getLineNext(y)}F.firstChild&&d.insertBefore(F,y);if(b.isWebkit&&!this._wrapMode)d.style.width="0x7fffffffpx";y=this._getLineNext();t=j+c;for(F=!1;y;){m=y.lineWidth;if(m===
void 0)if(E=y._line.getBoundingClientRect(),m=y.lineWidth=Math.ceil(E.right-E.left),E=E.bottom-E.top,this._lineHeight)this._lineHeight[y.lineIndex]=E;else if(g!==0&&E!==0&&Math.ceil(g)!==Math.ceil(E))this._variableLineHeight=!0,this._lineHeight=[],this._lineHeight[y.lineIndex]=E;if(this._lineHeight&&!F&&(t-=this._lineHeight[y.lineIndex],t<0))n=y.lineIndex,F=!0;if(!this._wrapMode){if(m>=this._maxLineWidth)this._maxLineWidth=m,this._maxLineIndex=y.lineIndex;if(this._checkMaxLineIndex===y.lineIndex)this._checkMaxLineIndex=
-1}if(y.lineIndex===l)this._topChild=y;if(y.lineIndex===n)this._bottomChild=y;y=this._getLineNext(y)}if(this._checkMaxLineIndex!==-1&&(t=this._checkMaxLineIndex,this._checkMaxLineIndex=-1,0<=t&&t<h)){g=new p(this,t);E=g.getBoundingClientRect();m=E.right-E.left;if(m>=this._maxLineWidth)this._maxLineWidth=m,this._maxLineIndex=t;g.destroy()}for(;q<h;)m=this._getLineHeight(q,q<=n),k+=m,q++;h=k;this._updateRuler(this._leftDiv,l,f,r);this._updateRuler(this._rightDiv,l,f,r);g=0;this._leftDiv&&(l=this._leftDiv.getBoundingClientRect(),
g=l.right-l.left);f=0;this._rightDiv&&(f=this._rightDiv.getBoundingClientRect(),f=f.right-f.left);i.style.left=g+"px";i.style.right=f+"px";f=this._scrollDiv;f.style.height=h+"px";k=i=this._getClientWidth();this._wrapMode||(k=Math.max(this._maxLineWidth,k));l=k;if((!b.isIE||b.isIE>=9)&&this._maxLineWidth>i)k+=e.right+e.left;f.style.width=k+"px";if(this._clipScrollDiv)this._clipScrollDiv.style.width=k+"px";f=this._getScroll(!1)}if(this._vScrollDiv)k=j-8,q=Math.max(15,Math.ceil(Math.min(1,k/(h+e.top+
e.bottom))*k)),this._vScrollDiv.style.left=g+i-8+"px",this._vScrollDiv.style.top=Math.floor(Math.max(0,f.y*k/h))+"px",this._vScrollDiv.style.height=q+"px";if(!this._wrapMode&&this._hScrollDiv)k=i-8,q=Math.max(15,Math.ceil(Math.min(1,k/(this._maxLineWidth+e.left+e.right))*k)),this._hScrollDiv.style.left=g+Math.floor(Math.max(0,Math.floor(f.x*k/this._maxLineWidth)))+"px",this._hScrollDiv.style.top=j-9+"px",this._hScrollDiv.style.width=q+"px";y=f.x;m=this._clipDiv;k=this._overlayDiv;if(m){m.scrollLeft=
y;m.scrollTop=0;q=g+e.left;n=e.top;a=i;g=j;y=0;t=-c;if(f.x===0)q-=e.left,a+=e.left,y=e.left;f.x+i===l&&(a+=e.right);f.y===0&&(n-=e.top,g+=e.top,t+=e.top);f.y+j===h&&(g+=e.bottom);m.style.left=q+"px";m.style.top=n+"px";m.style.right=s-a-q+"px";m.style.bottom=r-g-n+"px";d.style.left=y+"px";d.style.top=t+"px";d.style.width=l+"px";d.style.height=j+c+"px";if(k)k.style.left=d.style.left,k.style.top=d.style.top,k.style.width=d.style.width,k.style.height=d.style.height}else{q=y;n=c;s=y+i;r=c+j;q===0&&(q-=
e.left);n===0&&(n-=e.top);s===l&&(s+=e.right);f.y+j===h&&(r+=e.bottom);d.style.clip="rect("+n+"px,"+s+"px,"+r+"px,"+q+"px)";d.style.left=-y+g+e.left+"px";d.style.width=(b.isWebkit?l:i+y)+"px";if(!a)d.style.top=-c+e.top+"px",d.style.height=j+c+"px";if(k&&(k.style.clip=d.style.clip,k.style.left=d.style.left,k.style.width=d.style.width,!a))k.style.top=d.style.top,k.style.height=d.style.height}this._updateDOMSelection();d=this._ensureCaretVisible;this._ensureCaretVisible=!1;j!==this._getClientHeight()&&
(this._update(),d&&this._showCaret())}}},_updateRuler:function(a,d,c,f){if(a)for(var e=this._parent.ownerDocument,h=this._getLineHeight(),g=this._getViewPadding(),a=a.firstChild;a;){var l=a._ruler,m=h,n=l.getOverview();n==="page"&&(m+=this._topIndexY);a.style.top=-m+"px";a.style.height=f+m+"px";a.rulerChanged&&i(l.getRulerStyle(),a);var j,k=a.firstChild;k?(j=k,k=k.nextSibling):(j=b.createElement(e,"div"),j.style.visibility="hidden",a.appendChild(j));var q;if(a.rulerChanged&&j){m=-1;if(q=l.getWidestAnnotation())if(i(q.style,
j),q.html)j.innerHTML=q.html;j.lineIndex=m;j.style.height=h+g.top+"px"}var s;if(n==="page"){for(l=l.getAnnotations(d,c+1);k;)m=k.lineIndex,q=k.nextSibling,(!(d<=m&&m<=c)||k.lineChanged)&&a.removeChild(k),k=q;k=a.firstChild.nextSibling;s=e.createDocumentFragment();for(m=d;m<=c;m++)if(!k||k.lineIndex>m){j=b.createElement(e,"div");if(q=l[m]){i(q.style,j);if(q.html)j.innerHTML=q.html;j.annotation=q}j.lineIndex=m;j.style.height=this._getLineHeight(m)+"px";s.appendChild(j)}else if(s.firstChild&&(a.insertBefore(s,
k),s=e.createDocumentFragment()),k)k=k.nextSibling;s.firstChild&&a.insertBefore(s,k)}else{q=this._getClientHeight();m=this._model.getLineCount();k=q+g.top+g.bottom-2*this._metrics.scrollWidth;n=h*m<k?h:k/m;if(a.rulerChanged){for(q=a.childNodes.length;q>1;)a.removeChild(a.lastChild),q--;l=l.getAnnotations(0,m);s=e.createDocumentFragment();for(var p in l)if(m=p>>>0,!(m<0)){j=b.createElement(e,"div");q=l[p];i(q.style,j);j.style.position="absolute";j.style.top=this._metrics.scrollWidth+h+Math.floor(m*
n)+"px";if(q.html)j.innerHTML=q.html;j.annotation=q;j.lineIndex=m;s.appendChild(j)}a.appendChild(s)}else if(a._oldTrackHeight!==k)for(j=a.firstChild?a.firstChild.nextSibling:null;j;)j.style.top=this._metrics.scrollWidth+h+Math.floor(j.lineIndex*n)+"px",j=j.nextSibling;a._oldTrackHeight=k}a.rulerChanged=!1;a=a.nextSibling}},_updateStyleSheet:function(){var a="";b.isWebkit&&this._metrics.scrollWidth>0&&(a+="\n.textview ::-webkit-scrollbar-corner {background: #eeeeee;}");b.isFirefox&&b.isMac&&this._highlightRGB&&
this._highlightRGB!=="Highlight"&&(a+="\n.textview ::-moz-selection {background: "+this._highlightRGB+";}");if(a){var d=document.getElementById("_textviewStyle");if(d)d.removeChild(d.firstChild),d.appendChild(document.createTextNode(a));else{d=b.createElement(document,"style");d.id="_textviewStyle";var c=document.getElementsByTagName("head")[0]||document.documentElement;d.appendChild(document.createTextNode(a));c.insertBefore(d,c.firstChild)}}},_updateStyle:function(a){if(!a&&b.isIE)this._rootDiv.style.lineHeight=
"normal";var d=this._metrics=this._calculateMetrics();this._rootDiv.style.lineHeight=b.isIE?d.lineHeight-(d.lineTrim.top+d.lineTrim.bottom)+"px":"normal";this._updateStyleSheet();a||(this.redraw(),this._resetLineWidth())}};e.EventTarget.addMixin(r.prototype);return{TextView:r}});
define("orion/editor/projectionTextModel",["orion/editor/textModel","orion/editor/eventTarget"],function(g,k){function j(e){this._model=e;this._projections=[]}j.prototype={addProjection:function(e){if(e){var c=this._model,b=this._projections;e._lineIndex=c.getLineAtOffset(e.start);e._lineCount=c.getLineAtOffset(e.end)-e._lineIndex;var a=e.text;a||(a="");e._model=typeof a==="string"?new g.TextModel(a,c.getLineDelimiter()):a;var c=this.mapOffset(e.start,!0),a=e.end-e.start,i=e._lineCount,f=e._model.getCharCount(),
d=e._model.getLineCount()-1;this.onChanging({type:"Changing",text:e._model.getText(),start:c,removedCharCount:a,addedCharCount:f,removedLineCount:i,addedLineCount:d});var h=this._binarySearch(b,e.start);b.splice(h,0,e);this.onChanged({type:"Changed",start:c,removedCharCount:a,addedCharCount:f,removedLineCount:i,addedLineCount:d})}},getProjections:function(){return this._projections.slice(0)},getBaseModel:function(){return this._model},mapOffset:function(e,c){var b=this._projections,a=0,g,f;if(c){for(g=
0;g<b.length;g++){f=b[g];if(f.start>e)break;if(f.end>e)return-1;a+=f._model.getCharCount()-(f.end-f.start)}return e+a}for(g=0;g<b.length;g++){f=b[g];if(f.start>e-a)break;var d=f._model.getCharCount();if(f.start+d>e-a)return-1;a+=d-(f.end-f.start)}return e-a},removeProjection:function(e){var c,b=0;for(c=0;c<this._projections.length;c++){var a=this._projections[c];if(a===e){e=a;break}b+=a._model.getCharCount()-(a.end-a.start)}if(c<this._projections.length){var a=this._model,b=e.start+b,g=e.end-e.start,
f=e._lineCount,d=e._model.getCharCount(),h=e._model.getLineCount()-1;this.onChanging({type:"Changing",text:a.getText(e.start,e.end),start:b,removedCharCount:d,addedCharCount:g,removedLineCount:h,addedLineCount:f});this._projections.splice(c,1);this.onChanged({type:"Changed",start:b,removedCharCount:d,addedCharCount:g,removedLineCount:h,addedLineCount:f})}},_binarySearch:function(e,c){for(var b=e.length,a=-1,g;b-a>1;)g=Math.floor((b+a)/2),c<=e[g].start?b=g:a=g;return b},getCharCount:function(){for(var e=
this._model.getCharCount(),c=this._projections,b=0;b<c.length;b++){var a=c[b];e+=a._model.getCharCount()-(a.end-a.start)}return e},getLine:function(e,c){if(e<0)return null;var b=this._model,a=this._projections,g=0,f=[],d=0,h,l,n;for(h=0;h<a.length;h++){n=a[h];if(n._lineIndex>=e-g)break;l=n._model.getLineCount()-1;if(n._lineIndex+l>=e-g)if(d=e-(n._lineIndex+g),d<l)return n._model.getLine(d,c);else f.push(n._model.getLine(l));d=n.end;g+=l-n._lineCount}for(d=Math.max(d,b.getLineStart(e-g));h<a.length;h++){n=
a[h];if(n._lineIndex>e-g)break;f.push(b.getText(d,n.start));l=n._model.getLineCount()-1;if(n._lineIndex+l>e-g)return f.push(n._model.getLine(0,c)),f.join("");f.push(n._model.getText());d=n.end;g+=l-n._lineCount}a=b.getLineEnd(e-g,c);d<a&&f.push(b.getText(d,a));return f.join("")},getLineAtOffset:function(e){for(var c=this._model,b=this._projections,a=0,g=0,f=0;f<b.length;f++){var d=b[f];if(d.start>e-a)break;var h=d._model.getCharCount();if(d.start+h>e-a){b=e-(d.start+a);g+=d._model.getLineAtOffset(b);
a+=b;break}g+=d._model.getLineCount()-1-d._lineCount;a+=h-(d.end-d.start)}return c.getLineAtOffset(e-a)+g},getLineCount:function(){for(var e=this._projections,c=this._model.getLineCount(),b=0;b<e.length;b++){var a=e[b];c+=a._model.getLineCount()-1-a._lineCount}return c},getLineDelimiter:function(){return this._model.getLineDelimiter()},getLineEnd:function(e,c){if(e<0)return-1;for(var b=this._model,a=this._projections,g=0,f=0,d=0;d<a.length;d++){var h=a[d];if(h._lineIndex>e-g)break;var l=h._model.getLineCount()-
1;if(h._lineIndex+l>e-g)return h._model.getLineEnd(e-(h._lineIndex+g),c)+h.start+f;f+=h._model.getCharCount()-(h.end-h.start);g+=l-h._lineCount}return b.getLineEnd(e-g,c)+f},getLineStart:function(e){if(e<0)return-1;for(var c=this._model,b=this._projections,a=0,g=0,f=0;f<b.length;f++){var d=b[f];if(d._lineIndex>=e-a)break;var h=d._model.getLineCount()-1;if(d._lineIndex+h>=e-a)return d._model.getLineStart(e-(d._lineIndex+a))+d.start+g;g+=d._model.getCharCount()-(d.end-d.start);a+=h-d._lineCount}return c.getLineStart(e-
a)+g},getText:function(e,c){e===void 0&&(e=0);var b=this._model,a=this._projections,g=0,f=[],d,h,l;for(d=0;d<a.length;d++){h=a[d];if(h.start>e-g)break;l=h._model.getCharCount();if(h.start+l>e-g)if(c!==void 0&&h.start+l>c-g)return h._model.getText(e-(h.start+g),c-(h.start+g));else f.push(h._model.getText(e-(h.start+g))),e=h.end+g+l-(h.end-h.start);g+=l-(h.end-h.start)}var n=e-g;if(c!==void 0){for(;d<a.length;d++){h=a[d];if(h.start>c-g)break;f.push(b.getText(n,h.start));l=h._model.getCharCount();if(h.start+
l>c-g)return f.push(h._model.getText(0,c-(h.start+g))),f.join("");f.push(h._model.getText());n=h.end;g+=l-(h.end-h.start)}f.push(b.getText(n,c-g))}else{for(;d<a.length;d++)h=a[d],f.push(b.getText(n,h.start)),f.push(h._model.getText()),n=h.end;f.push(b.getText(n))}return f.join("")},_onChanging:function(e,c,b,a,g,f){for(var d=this._model,h=this._projections,l,n=0,m,j=c+b;l<h.length;l++){b=h[l];if(b.start>c)break;n+=b._model.getCharCount()-(b.end-b.start)}c+=n;for(var k=l;l<h.length;l++){b=h[l];if(b.start>
j)break;n+=b._model.getCharCount()-(b.end-b.start);m+=b._model.getLineCount()-1-b._lineCount}b=j+n;n=l;this.onChanging(c,b-c,a,g+m,f);h.splice(h,n-k);for(e=e.length-(b-c);l<h.length;l++)b=h[l],b.start+=e,b.end+=e,b._lineIndex=d.getLineAtOffset(b.start)},onChanging:function(e){return this.dispatchEvent(e)},onChanged:function(e){return this.dispatchEvent(e)},setLineDelimiter:function(e){this._model.setLineDelimiter(e)},setText:function(e,c,b){e===void 0&&(e="");c===void 0&&(c=0);var a=c,g=b,f=this._model,
d=this._projections,h=0,l=0,n,m,j,k,p,r=0;for(n=0;n<d.length;n++){m=d[n];if(m.start>c-h)break;j=m._model.getCharCount();if(m.start+j>c-h)if(b!==void 0&&m.start+j>b-h){m._model.setText(e,c-(m.start+h),b-(m.start+h));return}else r=m._model.getLineCount()-1-m._model.getLineAtOffset(c-(m.start+h)),k={projection:m,start:c-(m.start+h)},c=m.end+h+j-(m.end-m.start);l+=m._model.getLineCount()-1-m._lineCount;h+=j-(m.end-m.start)}c-=h;var t=n,r=f.getLineAtOffset(c)+l-r;if(b!==void 0)for(;n<d.length;n++){m=d[n];
if(m.start>b-h)break;j=m._model.getCharCount();if(m.start+j>b-h){l+=m._model.getLineAtOffset(b-(m.start+h));j=b-(m.start+h);b=m.end+h;p={projection:m,end:j};break}l+=m._model.getLineCount()-1-m._lineCount;h+=j-(m.end-m.start)}else{for(;n<d.length;n++)m=d[n],l+=m._model.getLineCount()-1-m._lineCount,h+=m._model.getCharCount()-(m.end-m.start);b=g=f.getCharCount()+h}b-=h;m=f.getLineAtOffset(b)+l;g-=a;for(var l=m-r,r=e.length,o=j=m=h=0;;){m!==-1&&m<=o&&(m=e.indexOf("\r",o));j!==-1&&j<=o&&(j=e.indexOf("\n",
o));if(j===-1&&m===-1)break;o=m!==-1&&j!==-1?m+1===j?j+1:(m<j?m:j)+1:m!==-1?m+1:j+1;h++}this.onChanging({type:"Changing",text:e,start:a,removedCharCount:g,addedCharCount:r,removedLineCount:l,addedLineCount:h});f.setText(e,c,b);if(k)m=k.projection,m._model.setText("",k.start);if(p)m=p.projection,m._model.setText("",0,p.end),m.start=m.end,m._lineCount=0;d.splice(t,n-t);for(e=e.length-(b-c);n<d.length;n++)m=d[n],m.start+=e,m.end+=e,m._lineIndex=f.getLineAtOffset(m.start);this.onChanged({type:"Changed",
start:a,removedCharCount:g,addedCharCount:r,removedLineCount:l,addedLineCount:h})}};k.EventTarget.addMixin(j.prototype);return{ProjectionTextModel:j}});
define("orion/editor/tooltip",["i18n!orion/editor/nls/messages","orion/editor/textView","orion/editor/textModel","orion/editor/projectionTextModel","orion/util"],function(g,k,j,e,c){function b(a){this._view=a;this._create(a.getOptions("parent").ownerDocument);a.addEventListener("Destroy",this,this.destroy)}b.getTooltip=function(a){if(!a._tooltip)a._tooltip=new b(a);return a._tooltip};b.prototype={_create:function(a){if(!this._tooltipDiv){var b=this._tooltipDiv=c.createElement(a,"div");b.className=
"textviewTooltip";b.setAttribute("aria-live","assertive");b.setAttribute("aria-atomic","true");var f=this._tooltipContents=c.createElement(a,"div");b.appendChild(f);a.body.appendChild(b);this.hide()}},_getWindow:function(){var a=this._tooltipDiv.ownerDocument;return a.defaultView||a.parentWindow},destroy:function(){if(this._tooltipDiv){this.hide();var a=this._tooltipDiv.parentNode;a&&a.removeChild(this._tooltipDiv);this._tooltipDiv=null}},hide:function(){if(this._contentsView)this._contentsView.destroy(),
this._contentsView=null;if(this._tooltipContents)this._tooltipContents.innerHTML="";if(this._tooltipDiv)this._tooltipDiv.style.visibility="hidden";var a=this._getWindow();if(this._showTimeout)a.clearTimeout(this._showTimeout),this._showTimeout=null;if(this._hideTimeout)a.clearTimeout(this._hideTimeout),this._hideTimeout=null;if(this._fadeTimeout)a.clearInterval(this._fadeTimeout),this._fadeTimeout=null},isVisible:function(){return this._tooltipDiv&&this._tooltipDiv.style.visibility==="visible"},setTarget:function(a,
b){if(this.target!==a&&(this._target=a,this.hide(),a)){var c=this;if(b===0)c.show(!0);else{var d=this._getWindow();c._showTimeout=d.setTimeout(function(){c.show(!0)},b?b:500)}}},show:function(a){if(this._target){var b=this._target.getTooltipInfo();if(b){var c=this._tooltipDiv,d=this._tooltipContents;c.style.left=c.style.right=c.style.width=c.style.height=d.style.width=d.style.height="auto";var h=b.contents;h instanceof Array&&(h=this._getAnnotationContents(h));if(typeof h==="string")d.innerHTML=h;
else if(this._isNode(h))d.appendChild(h);else if(h instanceof e.ProjectionTextModel){var g=this._view,n=g.getOptions();n.wrapMode=!1;n.parent=d;var m=n.themeClass;m?((m=m.replace("tooltip",""))&&(m=" "+m),m="tooltip"+m):m="tooltip";n.themeClass=m;n=this._contentsView=new k.TextView(n);n._clientDiv.contentEditable=!1;n.addEventListener("LineStyle",function(a){g.onLineStyle(a)});n.setModel(h);h=n.computeSize();d.style.width=h.width+"px";d.style.height=h.height+"px";n.resize()}else return;d=c.ownerDocument.documentElement;
b.anchor==="right"?(h=d.clientWidth-b.x,c.style.right=h+"px"):(h=parseInt(this._getNodeStyle(c,"padding-left","0"),10),h+=parseInt(this._getNodeStyle(c,"border-left-width","0"),10),h=b.x-h,c.style.left=h+"px");c.style.maxWidth=d.clientWidth-h-10+"px";h=parseInt(this._getNodeStyle(c,"padding-top","0"),10);h+=parseInt(this._getNodeStyle(c,"border-top-width","0"),10);h=b.y-h;c.style.top=h+"px";c.style.maxHeight=d.clientHeight-h-10+"px";c.style.opacity="1";c.style.visibility="visible";if(a){var j=this,
s=this._getWindow();j._hideTimeout=s.setTimeout(function(){var a=parseFloat(j._getNodeStyle(c,"opacity","1"));j._fadeTimeout=s.setInterval(function(){c.style.visibility==="visible"&&a>0?(a-=0.1,c.style.opacity=a):j.hide()},50)},5E3)}}}},_getAnnotationContents:function(a){function b(a){var c=a.title;if(c==="")return null;var f="<div>";a.html&&(f+=a.html+"&nbsp;");if(!c)c=a.end,a=d.getLineStart(d.getLineAtOffset(a.start)),c=d.getLineEnd(d.getLineAtOffset(c),!0),c=d.getText(a,c);c=c.replace(/</g,"&lt;").replace(/>/g,
"&gt;");f+="<span style='vertical-align:middle;'>"+c+"</span><div>";return f}if(a.length===0)return null;var c=this._view.getModel(),d=c.getBaseModel?c.getBaseModel():c;if(a.length===1)if(c=a[0],c.title!==void 0)return b(c);else{var a=new e.ProjectionTextModel(d),h=d.getLineStart(d.getLineAtOffset(c.start)),l=d.getCharCount();c.end!==l&&a.addProjection({start:c.end,end:l});h>0&&a.addProjection({start:0,end:h});return a}else{h="<div><em>"+g.multipleAnnotations+"</em></div>";for(l=0;l<a.length;l++)c=
a[l],(c=b(c))&&(h+=c);return h}},_getNodeStyle:function(a,b,c){var d;if(a&&(d=a.style[b],!d))if(a.currentStyle){for(d=0;(d=b.indexOf("-",d))!==-1;)b=b.substring(0,d)+b.substring(d+1,d+2).toUpperCase()+b.substring(d+2);d=a.currentStyle[b]}else d=(a=a.ownerDocument.defaultView.getComputedStyle(a,null))?a.getPropertyValue(b):null;return d||c},_isNode:function(a){return typeof Node==="object"?a instanceof Node:a&&typeof a==="object"&&typeof a.nodeType==="number"&&typeof a.nodeName==="string"}};return{Tooltip:b}});
define("orion/editor/annotations",["i18n!orion/editor/nls/messages","orion/editor/eventTarget"],function(g,k){function j(a,b,c){this.start=a;this.end=b;this._projectionModel=c;this.html=this._expandedHTML;this.style=this._expandedStyle;this.expanded=!0}function e(){}function c(a,b){var c=a.lastIndexOf("."),c=a.substring(c+1),f={title:g[c],style:{styleClass:"annotation "+c},html:"<div class='annotationHTML "+c+"'></div>",overviewStyle:{styleClass:"annotationOverview "+c}};b?f.lineStyle={styleClass:"annotationLine "+
c}:f.rangeStyle={styleClass:"annotationRange "+c};e.registerType(a,f)}function b(){}function a(a){this._annotations=[];var b=this;this._listener={onChanged:function(a){b._onChanged(a)}};this.setTextModel(a)}function i(a,b){this._view=a;this._annotationModel=b;var c=this;this._listener={onDestroy:function(a){c._onDestroy(a)},onLineStyle:function(a){c._onLineStyle(a)},onChanged:function(a){c._onAnnotationModelChanged(a)}};a.addEventListener("Destroy",this._listener.onDestroy);a.addEventListener("postLineStyle",
this._listener.onLineStyle);b.addEventListener("Changed",this._listener.onChanged)}j.prototype={_expandedHTML:"<div class='annotationHTML expanded'></div>",_expandedStyle:{styleClass:"annotation expanded"},_collapsedHTML:"<div class='annotationHTML collapsed'></div>",_collapsedStyle:{styleClass:"annotation collapsed"},collapse:function(){if(this.expanded){this.expanded=!1;this.html=this._collapsedHTML;this.style=this._collapsedStyle;var a=this._projectionModel,b=a.getBaseModel();this._projection=
{start:b.getLineStart(b.getLineAtOffset(this.start)+1),end:b.getLineEnd(b.getLineAtOffset(this.end),!0)};a.addProjection(this._projection)}},expand:function(){if(!this.expanded)this.expanded=!0,this.html=this._expandedHTML,this.style=this._expandedStyle,this._projectionModel.removeProjection(this._projection)}};e.ANNOTATION_ERROR="orion.annotation.error";e.ANNOTATION_WARNING="orion.annotation.warning";e.ANNOTATION_TASK="orion.annotation.task";e.ANNOTATION_BREAKPOINT="orion.annotation.breakpoint";
e.ANNOTATION_BOOKMARK="orion.annotation.bookmark";e.ANNOTATION_FOLDING="orion.annotation.folding";e.ANNOTATION_CURRENT_BRACKET="orion.annotation.currentBracket";e.ANNOTATION_MATCHING_BRACKET="orion.annotation.matchingBracket";e.ANNOTATION_CURRENT_LINE="orion.annotation.currentLine";e.ANNOTATION_CURRENT_SEARCH="orion.annotation.currentSearch";e.ANNOTATION_MATCHING_SEARCH="orion.annotation.matchingSearch";e.ANNOTATION_READ_OCCURRENCE="orion.annotation.readOccurrence";e.ANNOTATION_WRITE_OCCURRENCE="orion.annotation.writeOccurrence";
e.ANNOTATION_SELECTED_LINKED_GROUP="orion.annotation.selectedLinkedGroup";e.ANNOTATION_CURRENT_LINKED_GROUP="orion.annotation.currentLinkedGroup";e.ANNOTATION_LINKED_GROUP="orion.annotation.linkedGroup";var f={};e.registerType=function(a,b){var c=b;if(typeof c!=="function")c=function(a,d,b){this.start=a;this.end=d;if(b!==void 0)this.title=b},c.prototype=b;c.prototype.type=a;f[a]=c;return a};e.createAnnotation=function(a,b,c,f){return new (this.getType(a))(b,c,f)};e.getType=function(a){return f[a]};
c(e.ANNOTATION_ERROR);c(e.ANNOTATION_WARNING);c(e.ANNOTATION_TASK);c(e.ANNOTATION_BREAKPOINT);c(e.ANNOTATION_BOOKMARK);c(e.ANNOTATION_CURRENT_BRACKET);c(e.ANNOTATION_MATCHING_BRACKET);c(e.ANNOTATION_CURRENT_SEARCH);c(e.ANNOTATION_MATCHING_SEARCH);c(e.ANNOTATION_READ_OCCURRENCE);c(e.ANNOTATION_WRITE_OCCURRENCE);c(e.ANNOTATION_SELECTED_LINKED_GROUP);c(e.ANNOTATION_CURRENT_LINKED_GROUP);c(e.ANNOTATION_LINKED_GROUP);c(e.ANNOTATION_CURRENT_LINE,!0);e.registerType(e.ANNOTATION_FOLDING,j);b.addMixin=function(a){var c=
b.prototype,f;for(f in c)c.hasOwnProperty(f)&&(a[f]=c[f])};b.prototype={addAnnotationType:function(a){if(!this._annotationTypes)this._annotationTypes=[];this._annotationTypes.push(a)},getAnnotationTypePriority:function(a){if(this._annotationTypes)for(var b=0;b<this._annotationTypes.length;b++)if(this._annotationTypes[b]===a)return b+1;return 0},getAnnotationsByType:function(a,b,c){a=a.getAnnotations(b,c);for(c=[];a.hasNext();)b=a.next(),this.getAnnotationTypePriority(b.type)!==0&&c.push(b);var f=
this;c.sort(function(a,d){return f.getAnnotationTypePriority(a.type)-f.getAnnotationTypePriority(d.type)});return c},isAnnotationTypeVisible:function(a){return this.getAnnotationTypePriority(a)!==0},removeAnnotationType:function(a){if(this._annotationTypes)for(var b=0;b<this._annotationTypes.length;b++)if(this._annotationTypes[b]===a){this._annotationTypes.splice(b,1);break}}};a.prototype={addAnnotation:function(a){if(a){var b=this._annotations,c=this._binarySearch(b,a.start);b.splice(c,0,a);this.onChanged({type:"Changed",
added:[a],removed:[],changed:[]})}},getTextModel:function(){return this._model},getAnnotations:function(a,b){var c=this._annotations,f,e=0,g=function(){for(;e<c.length;){var f=c[e++];if(a===f.start||(a>f.start?a<f.end:f.start<b))return f;if(f.start>=b)break}return null};f=g();return{next:function(){var a=f;a&&(f=g());return a},hasNext:function(){return f!==null}}},modifyAnnotation:function(a){if(a&&!(this._getAnnotationIndex(a)<0))this.onChanged({type:"Changed",added:[],removed:[],changed:[a]})},
onChanged:function(a){return this.dispatchEvent(a)},removeAnnotations:function(a){var b=this._annotations,c,f;if(a){c=[];for(f=b.length-1;f>=0;f--){var e=b[f];e.type===a&&b.splice(f,1);c.splice(0,0,e)}}else c=b;this.onChanged({type:"Changed",removed:c,added:[],changed:[]})},removeAnnotation:function(a){if(a&&(a=this._getAnnotationIndex(a),!(a<0)))this.onChanged({type:"Changed",removed:this._annotations.splice(a,1),added:[],changed:[]})},replaceAnnotations:function(a,b){var c=this._annotations,f,e,
g,i=[];if(a)for(f=a.length-1;f>=0;f--)g=a[f],e=this._getAnnotationIndex(g),e<0||(c.splice(e,1),i.splice(0,0,g));b||(b=[]);for(f=0;f<b.length;f++)g=b[f],e=this._binarySearch(c,g.start),c.splice(e,0,g);this.onChanged({type:"Changed",removed:i,added:b,changed:[]})},setTextModel:function(a){this._model&&this._model.removeEventListener("Changed",this._listener.onChanged);(this._model=a)&&this._model.addEventListener("Changed",this._listener.onChanged)},_binarySearch:function(a,b){for(var c=a.length,f=
-1,e;c-f>1;)e=Math.floor((c+f)/2),b<=a[e].start?c=e:f=e;return c},_getAnnotationIndex:function(a){for(var b=this._annotations,c=this._binarySearch(b,a.start);c<b.length&&b[c].start===a.start;){if(b[c]===a)return c;c++}return-1},_onChanged:function(a){var b=a.start,c=a.removedCharCount,f=this._annotations,e=b+c;if(0<f.length){for(var g={type:"Changed",added:[],removed:[],changed:[],textModelChangedEvent:a},a=a.addedCharCount-c,c=0;c<f.length;c++){var i=f[c];i.start>=e?(i.start+=a,i.end+=a,g.changed.push(i)):
i.end<=b||(i.start<b&&e<i.end?(i.end+=a,g.changed.push(i)):(f.splice(c,1),g.removed.push(i),c--))}if(g.added.length>0||g.removed.length>0||g.changed.length>0)this.onChanged(g)}}};k.EventTarget.addMixin(a.prototype);i.prototype={destroy:function(){var a=this._view;if(a)a.removeEventListener("Destroy",this._listener.onDestroy),a.removeEventListener("LineStyle",this._listener.onLineStyle),this.view=null;(a=this._annotationModel)&&a.removeEventListener("Changed",this._listener.onChanged)},_mergeStyle:function(a,
b){if(b){a||(a={});a.styleClass&&b.styleClass&&a.styleClass!==b.styleClass?a.styleClass+=" "+b.styleClass:a.styleClass=b.styleClass;var c;if(b.tagName&&!a.tagName)a.tagName=b.tagName;if(b.style){if(!a.style)a.style={};for(c in b.style)a.style[c]||(a.style[c]=b.style[c])}if(b.attributes){if(!a.attributes)a.attributes={};for(c in b.attributes)a.attributes[c]||(a.attributes[c]=b.attributes[c])}}return a},_mergeStyleRanges:function(a,b){a||(a=[]);var c,f;for(f=0;f<a.length&&b;f++){var e=a[f];if(b.end<=
e.start)break;if(!(b.start>=e.end)){c=this._mergeStyle({},e.style);c=this._mergeStyle(c,b.style);var g=[];g.push(f,1);b.start<e.start&&g.push({start:b.start,end:e.start,style:b.style});b.start>e.start&&g.push({start:e.start,end:b.start,style:e.style});g.push({start:Math.max(e.start,b.start),end:Math.min(e.end,b.end),style:c});b.end<e.end&&g.push({start:b.end,end:e.end,style:e.style});b=b.end>e.end?{start:e.end,end:b.end,style:b.style}:null;Array.prototype.splice.apply(a,g)}}b&&(c=this._mergeStyle({},
b.style),a.splice(f,0,{start:b.start,end:b.end,style:c}));return a},_onAnnotationModelChanged:function(a){function b(a){for(var d=0;d<a.length;d++)if(f.isAnnotationTypeVisible(a[d].type)){var h=a[d].start,g=a[d].end;e.getBaseModel&&(h=e.mapOffset(h,!0),g=e.mapOffset(g,!0));h!==-1&&g!==-1&&c.redrawRange(h,g)}}if(!a.textModelChangedEvent){var c=this._view;if(c){var f=this,e=c.getModel();b(a.added);b(a.removed);b(a.changed)}}},_onDestroy:function(){this.destroy()},_onLineStyle:function(a){var b=this._annotationModel,
c=a.textView.getModel(),f=b.getTextModel(),e=a.lineStart,g=a.lineStart+a.lineText.length;f!==c&&(e=c.mapOffset(e),g=c.mapOffset(g));for(b=b.getAnnotations(e,g);b.hasNext();)if(e=b.next(),this.isAnnotationTypeVisible(e.type)){if(e.rangeStyle){var g=e.start,i=e.end;f!==c&&(g=c.mapOffset(g,!0),i=c.mapOffset(i,!0));a.ranges=this._mergeStyleRanges(a.ranges,{start:g,end:i,style:e.rangeStyle})}if(e.lineStyle)a.style=this._mergeStyle({},a.style),a.style=this._mergeStyle(a.style,e.lineStyle)}}};b.addMixin(i.prototype);
return{FoldingAnnotation:j,AnnotationType:e,AnnotationTypeList:b,AnnotationModel:a,AnnotationStyler:i}});
define("orion/editor/editor","i18n!orion/editor/nls/messages,orion/keyBinding,orion/editor/eventTarget,orion/editor/tooltip,orion/editor/annotations,orion/util".split(","),function(g,k,j,e,c,b){function a(a){this._textViewFactory=a.textViewFactory;this._undoStackFactory=a.undoStackFactory;this._textDNDFactory=a.textDNDFactory;this._annotationFactory=a.annotationFactory;this._foldingRulerFactory=a.foldingRulerFactory;this._lineNumberRulerFactory=a.lineNumberRulerFactory;this._contentAssistFactory=
a.contentAssistFactory;this._keyBindingFactory=a.keyBindingFactory;this._statusReporter=a.statusReporter;this._domNode=a.domNode;this._foldingRuler=this._overviewRuler=this._lineNumberRuler=this._annotationRuler=this._annotationModel=this._annotationStyler=null;this._dirty=!1;this._title=this._contentAssist=null}function i(a){var d=this,b=Array.prototype.slice.call(arguments,1);return b.length?function(){return arguments.length?d.apply(a,b.concat(Array.prototype.slice.call(arguments))):d.apply(a,
b)}:function(){return arguments.length?d.apply(a,arguments):d.call(a)}}a.prototype={destroy:function(){this.uninstallTextView();this._textViewFactory=this._undoStackFactory=this._textDNDFactory=this._annotationFactory=this._foldingRulerFactory=this._lineNumberRulerFactory=this._contentAssistFactory=this._keyBindingFactory=this._statusReporter=this._domNode=null},getAnnotationModel:function(){return this._annotationModel},getAnnotationRuler:function(){return this._annotationRuler},getAnnotationStyler:function(){return this._annotationStyler},
getFoldingRuler:function(){return this._foldingRuler},getLineNumberRuler:function(){return this._lineNumberRuler},getModel:function(){var a=this._textView.getModel();a.getBaseModel&&(a=a.getBaseModel());return a},getOverviewRuler:function(){return this._overviewRuler},getTextView:function(){return this._textView},getTitle:function(){return this._title},getKeyModes:function(){return this._textView.getKeyModes()},isDirty:function(){return this._dirty},setAnnotationRulerVisible:function(a){if(this._annotationRulerVisible!==
a&&(this._annotationRulerVisible=a,this._annotationRuler)){var d=this._textView;a?d.addRuler(this._annotationRuler,0):d.removeRuler(this._annotationRuler)}},setFoldingRulerVisible:function(a){if(this._foldingRulerVisible!==a&&(this._foldingRulerVisible=a,this._foldingRuler)){var d=this._textView;d.getModel().getBaseModel&&(a?d.addRuler(this._foldingRuler,100):d.removeRuler(this._foldingRuler))}},setDirty:function(a){if(this._dirty!==a)this._dirty=a,this.onDirtyChanged({type:"DirtyChanged"})},setLineNumberRulerVisible:function(a){if(this._lineNumberRulerVisible!==
a&&(this._lineNumberRulerVisible=a,this._lineNumberRuler)){var d=this._textView;a?d.addRuler(this._lineNumberRuler,1):d.removeRuler(this._lineNumberRuler)}},setOverviewRulerVisible:function(a){if(this._overviewRulerVisible!==a&&(this._overviewRulerVisible=a,this._overviewRuler)){var d=this._textView;a?d.addRuler(this._overviewRuler):d.removeRuler(this._overviewRuler)}},mapOffset:function(a,d){var b=this._textView.getModel();b.getBaseModel&&(a=b.mapOffset(a,d));return a},getCaretOffset:function(){return this.mapOffset(this._textView.getCaretOffset())},
getSelection:function(){var a=this._textView,d=a.getSelection(),a=a.getModel();if(a.getBaseModel)d.start=a.mapOffset(d.start),d.end=a.mapOffset(d.end);return d},getText:function(a,d){var b=this._textView.getModel();b.getBaseModel&&(b=b.getBaseModel());return b.getText(a,d)},_expandOffset:function(a){var d=this._textView.getModel(),b=this._annotationModel;if(b&&d.getBaseModel)for(a=b.getAnnotations(a,a+1);a.hasNext();)d=a.next(),d.type===c.AnnotationType.ANNOTATION_FOLDING&&d.expand&&(d.expand(),b.modifyAnnotation(d))},
setCaretOffset:function(a,d,b){var c=this._textView,e=c.getModel();e.getBaseModel&&(this._expandOffset(a),a=e.mapOffset(a,!0));c.setCaretOffset(a,d,b)},setText:function(a,d,b){var c=this._textView,e=c.getModel();e.getBaseModel&&(d!==void 0&&(this._expandOffset(d),d=e.mapOffset(d,!0)),b!==void 0&&(this._expandOffset(b),b=e.mapOffset(b,!0)));c.setText(a,d,b)},setFoldingEnabled:function(a){this.setFoldingRulerVisible(a)},setSelection:function(a,d,b,c){var e=this._textView,g=e.getModel();g.getBaseModel&&
(this._expandOffset(a),this._expandOffset(d),a=g.mapOffset(a,!0),d=g.mapOffset(d,!0));e.setSelection(a,d,b,c)},moveSelection:function(a,d,b,c){var e=this._textView;this.setSelection(a,d||a,1/3,function(){(c===void 0||c)&&e.focus();b&&b()})},checkDirty:function(){this.setDirty(!this._undoStack.isClean())},reportStatus:function(a,d,b){this._statusReporter&&this._statusReporter(a,d,b)},_getTooltipInfo:function(a,d){var b=this._textView,c=this.getAnnotationModel();if(!c)return null;var e=this._annotationStyler;
if(!e)return null;var g=b.getOffsetAtLocation(a,d);if(g===-1)return null;g=this.mapOffset(g);e=e.getAnnotationsByType(c,g,g+1);c=[];for(g=0;g<e.length;g++)e[g].rangeStyle&&c.push(e[g]);if(c.length===0)return null;b=b.convert({x:a,y:d},"document","page");return{contents:c,anchor:"left",x:b.x+10,y:b.y+20}},_highlightCurrentLine:function(a,d){var b=this._annotationModel;if(b){var e=this._textView.getModel(),g=d?e.getLineAtOffset(d.start):-1,i=e.getLineAtOffset(a.start),j=a.start===a.end,k=!d||d.start===
d.end,p=e.getLineStart(i),r=e.getLineEnd(i);e.getBaseModel&&(p=e.mapOffset(p),r=e.mapOffset(r));e=this._currentLineAnnotation;if(!(g===i&&k&&j&&e&&e.start===p&&e.end===r)){var g=e?[e]:null,t;j&&(e=c.AnnotationType.createAnnotation(c.AnnotationType.ANNOTATION_CURRENT_LINE,p,r),t=[e]);this._currentLineAnnotation=e;b.replaceAnnotations(g,t)}}},installTextView:function(){this._textView=this._textViewFactory();if(this._undoStackFactory)this._undoStack=this._undoStackFactory.createUndoStack(this);if(this._textDNDFactory)this._textDND=
this._textDNDFactory.createTextDND(this,this._undoStack);if(this._contentAssistFactory)this._contentAssist=this._contentAssistFactory.createContentAssistMode(this).getContentAssist();var a=this,d=this._textView,b=this;this._listener={onModelChanged:function(){b.checkDirty()},onMouseOver:function(a){b._listener.onMouseMove(a)},onMouseMove:function(a){var c=e.Tooltip.getTooltip(d);if(c&&!(b._listener.lastMouseX===a.event.clientX&&b._listener.lastMouseY===a.event.clientY))b._listener.lastMouseX=a.event.clientX,
b._listener.lastMouseY=a.event.clientY,c.setTarget({x:a.x,y:a.y,getTooltipInfo:function(){return b._getTooltipInfo(this.x,this.y)}})},onMouseOut:function(a){var c=e.Tooltip.getTooltip(d);if(c&&!(b._listener.lastMouseX===a.event.clientX&&b._listener.lastMouseY===a.event.clientY))b._listener.lastMouseX=a.event.clientX,b._listener.lastMouseY=a.event.clientY,c.setTarget(null)},onScroll:function(){var a=e.Tooltip.getTooltip(d);a&&a.setTarget(null)},onSelection:function(a){b._updateCursorStatus();b._highlightCurrentLine(a.newValue,
a.oldValue)}};d.addEventListener("ModelChanged",this._listener.onModelChanged);d.addEventListener("Selection",this._listener.onSelection);d.addEventListener("MouseOver",this._listener.onMouseOver);d.addEventListener("MouseOut",this._listener.onMouseOut);d.addEventListener("MouseMove",this._listener.onMouseMove);d.addEventListener("Scroll",this._listener.onScroll);this._keyBindingFactory&&(typeof this._keyBindingFactory==="function"?this._keyBindingFactory(this,this.getKeyModes(),this._undoStack,this._contentAssist):
this._keyBindingFactory.createKeyBindings(a,this._undoStack,this._contentAssist));var g=function(d){if(d!==void 0&&d!==-1){for(var b=this.getView().getModel(),e=this.getAnnotationModel(),h=a.mapOffset(b.getLineStart(d)),d=a.mapOffset(b.getLineEnd(d)),b=e.getAnnotations(h,d),g=null;b.hasNext();){var i=b.next();if(i.type===c.AnnotationType.ANNOTATION_BOOKMARK){g=i;break}}g?e.removeAnnotation(g):(g=c.AnnotationType.createAnnotation(c.AnnotationType.ANNOTATION_BOOKMARK,h,d),g.title=void 0,e.addAnnotation(g))}};
if(this._annotationFactory){var i=d.getModel();i.getBaseModel&&(i=i.getBaseModel());if(this._annotationModel=this._annotationFactory.createAnnotationModel(i))if(i=this._annotationStyler=this._annotationFactory.createAnnotationStyler(d,this._annotationModel))i.addAnnotationType(c.AnnotationType.ANNOTATION_CURRENT_SEARCH),i.addAnnotationType(c.AnnotationType.ANNOTATION_MATCHING_SEARCH),i.addAnnotationType(c.AnnotationType.ANNOTATION_ERROR),i.addAnnotationType(c.AnnotationType.ANNOTATION_WARNING),i.addAnnotationType(c.AnnotationType.ANNOTATION_MATCHING_BRACKET),
i.addAnnotationType(c.AnnotationType.ANNOTATION_CURRENT_BRACKET),i.addAnnotationType(c.AnnotationType.ANNOTATION_CURRENT_LINE),i.addAnnotationType(c.AnnotationType.ANNOTATION_READ_OCCURRENCE),i.addAnnotationType(c.AnnotationType.ANNOTATION_WRITE_OCCURRENCE),i.addAnnotationType(c.AnnotationType.ANNOTATION_SELECTED_LINKED_GROUP),i.addAnnotationType(c.AnnotationType.ANNOTATION_CURRENT_LINKED_GROUP),i.addAnnotationType(c.AnnotationType.ANNOTATION_LINKED_GROUP),i.addAnnotationType("orion.annotation.highlightError");
d.annotationModel=this._annotationModel;var i=this._annotationFactory.createAnnotationRulers(this._annotationModel),m=this._annotationRuler=i.annotationRuler;if(m)m.onDblClick=g,m.setMultiAnnotationOverlay({html:"<div class='annotationHTML overlay'></div>"}),m.addAnnotationType(c.AnnotationType.ANNOTATION_ERROR),m.addAnnotationType(c.AnnotationType.ANNOTATION_WARNING),m.addAnnotationType(c.AnnotationType.ANNOTATION_TASK),m.addAnnotationType(c.AnnotationType.ANNOTATION_BOOKMARK);this.setAnnotationRulerVisible(!0);
if(m=this._overviewRuler=i.overviewRuler)m.addAnnotationType(c.AnnotationType.ANNOTATION_CURRENT_SEARCH),m.addAnnotationType(c.AnnotationType.ANNOTATION_MATCHING_SEARCH),m.addAnnotationType(c.AnnotationType.ANNOTATION_ERROR),m.addAnnotationType(c.AnnotationType.ANNOTATION_WARNING),m.addAnnotationType(c.AnnotationType.ANNOTATION_TASK),m.addAnnotationType(c.AnnotationType.ANNOTATION_BOOKMARK),m.addAnnotationType(c.AnnotationType.ANNOTATION_MATCHING_BRACKET),m.addAnnotationType(c.AnnotationType.ANNOTATION_CURRENT_BRACKET),
m.addAnnotationType(c.AnnotationType.ANNOTATION_CURRENT_LINE),m.addAnnotationType(c.AnnotationType.ANNOTATION_READ_OCCURRENCE),m.addAnnotationType(c.AnnotationType.ANNOTATION_WRITE_OCCURRENCE);this.setOverviewRulerVisible(!0)}if(this._lineNumberRulerFactory)this._lineNumberRuler=this._lineNumberRulerFactory.createLineNumberRuler(this._annotationModel),this._lineNumberRuler.onDblClick=g,this.setLineNumberRulerVisible(!0);if(this._foldingRulerFactory)this._foldingRuler=this._foldingRulerFactory.createFoldingRuler(this._annotationModel),
this._foldingRuler.addAnnotationType(c.AnnotationType.ANNOTATION_FOLDING),this.setFoldingRulerVisible(!1);this.dispatchEvent({type:"TextViewInstalled",textView:d})},uninstallTextView:function(){var a=this._textView;if(a)a.destroy(),this._textView=this._undoStack=this._textDND=this._contentAssist=this._listener=this._annotationModel=this._annotationStyler=this._annotationRuler=this._overviewRuler=this._lineNumberRuler=this._foldingRuler=this._currentLineAnnotation=this._title=null,this._dirty=!1,this.dispatchEvent({type:"TextViewUninstalled",
textView:a})},_updateCursorStatus:function(){var a=this.getModel(),d=this.getCaretOffset(),c=a.getLineAtOffset(d),a=a.getLineStart(c);d-=a;for(var a=this.getKeyModes(),e=0;e<a.length;e++){var i=a[e];if(i.isActive()&&i.isStatusActive&&i.isStatusActive())return}this.reportStatus(b.formatMessage(g.lineColumn,c+1,d+1))},showProblems:function(a){var d=this._annotationModel;if(d){for(var b=[],e=[],g=d.getTextModel(),i=d.getAnnotations(0,g.getCharCount()),j;i.hasNext();)j=i.next(),(j.type===c.AnnotationType.ANNOTATION_ERROR||
j.type===c.AnnotationType.ANNOTATION_WARNING)&&b.push(j);if(a)for(i=0;i<a.length;i++)if(j=a[i]){var k=j.description.replace(/'/g,"&#39;").replace(/"/g,"&#34;"),p=g.getLineStart(j.line-1);j=c.AnnotationType.createAnnotation(j.severity==="error"?c.AnnotationType.ANNOTATION_ERROR:c.AnnotationType.ANNOTATION_WARNING,p+j.start-1,p+j.end,k);e.push(j)}d.replaceAnnotations(b,e)}},showOccurrences:function(a){var d=this._annotationModel;if(d){for(var b=[],e=[],g=d.getTextModel(),i=d.getAnnotations(0,g.getCharCount()),
j;i.hasNext();)j=i.next(),(j.type===c.AnnotationType.ANNOTATION_READ_OCCURRENCE||j.type===c.AnnotationType.ANNOTATION_WRITE_OCCURRENCE)&&b.push(j);if(a)for(i=0;i<a.length;i++)if(j=a[i]){var k=g.getLineStart(j.line-1);j=c.AnnotationType.createAnnotation(j.readAccess===!0?c.AnnotationType.ANNOTATION_READ_OCCURRENCE:c.AnnotationType.ANNOTATION_WRITE_OCCURRENCE,k+j.start-1,k+j.end,j.description);e.push(j)}d.replaceAnnotations(b,e)}},showSelection:function(a,d,b,c,e){typeof a==="number"?(typeof d!=="number"&&
(d=a),this.moveSelection(a,d)):typeof b==="number"&&(a=this.getModel().getLineStart(b-1),typeof c==="number"&&(a+=c),typeof e!=="number"&&(e=0),this.moveSelection(a,a+e))},setInput:function(a,d,b,c){this._title=a;this._textView&&(c?(this._undoStack.markClean(),this.checkDirty()):(d?this._textView.setText(d):b!==null&&b!==void 0&&(this._textView.setText(b),this._textView.getModel().setLineDelimiter("auto"),this._highlightCurrentLine(this._textView.getSelection())),this._undoStack.reset(),this.checkDirty(),
this._textView.focus()));this.onInputChanged({type:"InputChanged",title:a,message:d,contents:b,contentsSaved:c})},onInputChanged:function(a){return this.dispatchEvent(a)},onGotoLine:function(a,d,b,c){if(this._textView){var e=this.getModel(),a=Math.max(0,Math.min(a,e.getLineCount()-1)),g=e.getLineStart(a),i=0;b===void 0&&(b=0);typeof d==="string"?(a=e.getLine(a).indexOf(d),a!==-1&&(i=a,b=i+d.length)):(i=d,d=e.getLineEnd(a)-g,i=Math.min(i,d),b=Math.min(b,d));this.moveSelection(g+i,g+b,c)}},onDirtyChanged:function(a){return this.dispatchEvent(a)}};
j.EventTarget.addMixin(a.prototype);if(!Function.prototype.bind)Function.prototype.bind=i;return{Editor:a}});
define("orion/editor/find","i18n!orion/editor/nls/messages,orion/keyBinding,orion/editor/keyModes,orion/editor/annotations,orion/editor/regex,orion/objects,orion/util".split(","),function(g,k,j,e,c,b,a){function i(a){var b=a.getTextView();j.KeyMode.call(this,b);this.editor=a;this._active=!1;this._success=!0;this._ignoreSelection=!1;this._prefix="";b.setAction("incrementalFindCancel",function(){this.setActive(!1);return!0}.bind(this));b.setAction("incrementalFindBackspace",function(){return this._backspace()}.bind(this));
var d=this;this._listener={onVerify:function(a){var b=d.editor,f=b.getModel(),e=b.mapOffset(a.start),b=b.mapOffset(a.end),f=f.getText(e,b);if((f=d._prefix.match(RegExp("^"+c.escape(f),"i")))&&f.length>0)d._prefix+=a.text,d._success=!0,d._status(),d.find(d._forward,!0),a.text=null},onSelection:function(){d._ignoreSelection||d.setActive(!1)}}}function f(a,b,d){if(a){this._editor=a;this._undoStack=b;this._showAll=!0;this._visible=!1;this._wrap=this._caseInsensitive=!0;this._wholeWord=!1;this._incremental=
!0;this._regex=!1;this._findAfterReplace=!0;this._reverse=this._hideAfterFind=!1;this._timer=this._end=this._start=void 0;this._lastString="";var c=this;this._listeners={onEditorFocus:function(a){c._removeCurrentAnnotation(a)}};this.setOptions(d)}}var d={};i.prototype=new j.KeyMode;b.mixin(i.prototype,{createKeyBindings:function(){var a=k.KeyBinding,b=[];b.push({actionID:"incrementalFindBackspace",keyBinding:new a(8)});b.push({actionID:"incrementalFindCancel",keyBinding:new a(13)});b.push({actionID:"incrementalFindCancel",
keyBinding:new a(27)});b.push({actionID:"incrementalFindReverse",keyBinding:new a(38)});b.push({actionID:"incrementalFind",keyBinding:new a(40)});b.push({actionID:"incrementalFindReverse",keyBinding:new a("k",!0,!0)});b.push({actionID:"incrementalFind",keyBinding:new a("k",!0)});return b},find:function(a,b){this._forward=a;if(!this.isActive())return this.setActive(!0),!1;var d=this._prefix;if(d.length===0)return!1;var c=this.editor,f=c.getModel(),f=a?this._success?b?this._start:c.getCaretOffset()+
1:0:this._success?b?this._start:c.getCaretOffset():f.getCharCount()-1;if(d=c.getModel().find({string:d,start:f,reverse:!a,caseInsensitive:d.toLowerCase()===d}).next()){if(!b)this._start=f;this._ignoreSelection=this._success=!0;c.moveSelection(a?d.start:d.end,a?d.end:d.start);this._ignoreSelection=!1}else this._success=!1;this._status();return!0},isActive:function(){return this._active},isStatusActive:function(){return this.isActive()},setActive:function(a){if(this._active!==a)this._active=a,this._prefix=
"",this._success=!0,a=this.editor.getTextView(),this._start=this.editor.getCaretOffset(),this.editor.setCaretOffset(this._start),this._active?(a.addEventListener("Verify",this._listener.onVerify),a.addEventListener("Selection",this._listener.onSelection),a.addKeyMode(this)):(a.removeEventListener("Verify",this._listener.onVerify),a.removeEventListener("Selection",this._listener.onSelection),a.removeKeyMode(this)),this._status()},_backspace:function(){var a=this._prefix,a=this._prefix=a.substring(0,
a.length-1);return a.length===0?(this._ignoreSelection=this._success=!0,this.editor.setCaretOffset(this.editor.getSelection().start),this._ignoreSelection=!1,this._status(),!0):this.find(this._forward,!0)},_status:function(){if(this.isActive()){var b;b=this._forward?this._success?g.incrementalFindStr:g.incrementalFindStrNotFound:this._success?g.incrementalFindReverseStr:g.incrementalFindReverseStrNotFound;b=a.formatMessage(b,this._prefix);this.editor.reportStatus(b,this._success?"":"error")}else this.editor.reportStatus("")}});
d.IncrementalFind=i;f.prototype={find:function(a,b,d){this.setOptions({reverse:!a});var c=this.getFindString(),f;if(b)c=b.findString||c,f=b.count;a=this.getOptions();this.setOptions(b);b=d?this._startOffset:this.getStartOffset();if((f=this._doFind(c,b,f))&&!d)this._startOffset=f.start;this.setOptions(a);this._hideAfterFind&&this.hide();return f},getStartOffset:function(){return this._start!==void 0?this._start:this._reverse?this._editor.getSelection().start-1:this._editor.getCaretOffset()},getFindString:function(){var a=
this._editor.getSelection();return this._editor.getText(a.start,a.end)||this._lastString},getOptions:function(){return{showAll:this._showAll,caseInsensitive:this._caseInsensitive,wrap:this._wrap,wholeWord:this._wholeWord,incremental:this._incremental,regex:this._regex,findAfterReplace:this._findAfterReplace,hideAfterFind:this._hideAfterFind,reverse:this._reverse,findCallback:this._findCallback,start:this._start,end:this._end}},getReplaceString:function(){return""},hide:function(){this._visible=!1;
if(this._savedOptions&&(this.setOptions(this._savedOptions.pop()),this._savedOptions.length===0))this._savedOptions=null;this._removeAllAnnotations();this._editor.getTextView().removeEventListener("Focus",this._listeners.onEditorFocus);this._editor.getTextView().focus()},isVisible:function(){return this._visible},replace:function(){var a=this.getFindString();if(a){var b=this._editor,d=this.getReplaceString(),c=b.getSelection().start;if(b=b.getModel().find({string:a,start:c,reverse:!1,wrap:this._wrap,
regex:this._regex,wholeWord:this._wholeWord,caseInsensitive:this._caseInsensitive}).next())this.startUndo(),this._doReplace(b.start,b.end,a,d),this.endUndo()}this._findAfterReplace&&a&&this._doFind(a,this.getStartOffset())},replaceAll:function(){var b=this.getFindString();if(b){this._replacingAll=!0;var d=this._editor,c=d.getTextView();d.reportStatus(g.replaceAll);var f=this.getReplaceString(),e=this;window.setTimeout(function(){for(var i=0,j=0;;){var k=e._doFind(b,i);if(!k)break;j++;j===1&&(c.setRedraw(!1),
e.startUndo());e._doReplace(k.start,k.end,b,f);i=e.getStartOffset()}j>0&&(e.endUndo(),c.setRedraw(!0));i>0?d.reportStatus(a.formatMessage(g.replacedMatches,j)):d.reportStatus(g.nothingReplaced,"error");e._replacingAll=!1},100)}},setOptions:function(a){if(a){if((a.showAll===!0||a.showAll===!1)&&this._showAll!==a.showAll)if(this._showAll=a.showAll,this.isVisible())if(this._showAll)this._markAllOccurrences();else{var b=this._editor.getAnnotationModel();b&&b.removeAnnotations(e.AnnotationType.ANNOTATION_MATCHING_SEARCH)}if(a.caseInsensitive===
!0||a.caseInsensitive===!1)this._caseInsensitive=a.caseInsensitive;if(a.wrap===!0||a.wrap===!1)this._wrap=a.wrap;if(a.wholeWord===!0||a.wholeWord===!1)this._wholeWord=a.wholeWord;if(a.incremental===!0||a.incremental===!1)this._incremental=a.incremental;if(a.regex===!0||a.regex===!1)this._regex=a.regex;if(a.findAfterReplace===!0||a.findAfterReplace===!1)this._findAfterReplace=a.findAfterReplace;if(a.hideAfterFind===!0||a.hideAfterFind===!1)this._hideAfterFind=a.hideAfterFind;if(a.reverse===!0||a.reverse===
!1)this._reverse=a.reverse;if(a.hasOwnProperty("findCallback"))this._findCallback=a.findCallback;if(a.hasOwnProperty("start"))this._start=a.start;if(a.hasOwnProperty("end"))this._end=a.end}},show:function(a){this._visible=!0;if(a){if(!this._savedOptions)this._savedOptions=[];this._savedOptions.push(this.getOptions());this.setOptions(a)}this._startOffset=this._editor.getSelection().start;this._editor.getTextView().addEventListener("Focus",this._listeners.onEditorFocus);var b=this;window.setTimeout(function(){b._incremental&&
b.find(!0,null,!0)},0)},startUndo:function(){this._undoStack&&this._undoStack.startCompoundChange()},endUndo:function(){this._undoStack&&this._undoStack.endCompoundChange()},_doFind:function(a,b,d){var d=d||1,c=this._editor;if(!a)return this._removeAllAnnotations(),null;this._lastString=a;for(var a=c.getModel().find({string:a,start:b,end:this._end,reverse:this._reverse,wrap:this._wrap,regex:this._regex,wholeWord:this._wholeWord,caseInsensitive:this._caseInsensitive}),f,b=0;b<d&&a.hasNext();b++)f=
a.next();if(!this._replacingAll){f?this._editor.reportStatus(""):this._editor.reportStatus(g.notFound,"error");if(this.isVisible()){d=e.AnnotationType.ANNOTATION_CURRENT_SEARCH;if(a=c.getAnnotationModel())a.removeAnnotations(d),f&&a.addAnnotation(e.AnnotationType.createAnnotation(d,f.start,f.end));if(this._showAll){this._timer&&window.clearTimeout(this._timer);var i=this;this._timer=window.setTimeout(function(){i._markAllOccurrences();i._timer=null},500)}}this._findCallback?this._findCallback(f):
f&&c.moveSelection(f.start,f.end,null,!1)}return f},_doReplace:function(a,b,d,c){var f=this._editor;if(this._regex&&(c=f.getText(a,b).replace(RegExp(d,this._caseInsensitive?"i":""),c),!c))return;f.setText(c,a,b);f.setSelection(a,a+c.length,!0)},_markAllOccurrences:function(){var a=this._editor.getAnnotationModel();if(a){for(var b=e.AnnotationType.ANNOTATION_MATCHING_SEARCH,d=a.getAnnotations(0,a.getTextModel().getCharCount()),c=[],f;d.hasNext();){var g=d.next();g.type===b&&c.push(g)}if(this.isVisible()){d=
this.getFindString();d=this._editor.getModel().find({string:d,regex:this._regex,wholeWord:this._wholeWord,caseInsensitive:this._caseInsensitive});for(f=[];d.hasNext();)g=d.next(),f.push(e.AnnotationType.createAnnotation(b,g.start,g.end))}a.replaceAnnotations(c,f)}},_removeAllAnnotations:function(){var a=this._editor.getAnnotationModel();a&&(a.removeAnnotations(e.AnnotationType.ANNOTATION_CURRENT_SEARCH),a.removeAnnotations(e.AnnotationType.ANNOTATION_MATCHING_SEARCH))},_removeCurrentAnnotation:function(){var a=
this._editor.getAnnotationModel();a&&a.removeAnnotations(e.AnnotationType.ANNOTATION_CURRENT_SEARCH)}};d.Find=f;return d});
define("orion/editor/actions","i18n!orion/editor/nls/messages,orion/keyBinding,orion/editor/annotations,orion/editor/tooltip,orion/editor/find,orion/util".split(","),function(g,k,j,e,c,b){function a(a,b,f){this.editor=a;this.undoStack=b;this._incrementalFind=new c.IncrementalFind(a);this._find=f?f:new c.Find(a,b);this._lastEditLocation=null;this.init()}function i(a,b,c,f){this.editor=a;this.undoStack=b;this.contentAssist=c;this.linkedMode=f;this.contentAssist&&this.contentAssist.addEventListener("ProposalApplied",
this.contentAssistProposalApplied.bind(this));this.init()}var f={};a.prototype={init:function(){var a=this.editor.getTextView();this._lastEditListener={onModelChanged:function(a){if(this.editor.isDirty())this._lastEditLocation=a.start+a.addedCharCount}.bind(this)};a.addEventListener("ModelChanged",this._lastEditListener.onModelChanged);a.setAction("undo",function(){return this.undoStack?(this.undoStack.undo(),!0):!1}.bind(this),{name:g.undo});a.setAction("redo",function(){return this.undoStack?(this.undoStack.redo(),
!0):!1}.bind(this),{name:g.redo});a.setKeyBinding(new k.KeyBinding("f",!0),"find");a.setAction("find",function(){if(this._find){var a=this.editor.getSelection();(a=prompt(g.find,this.editor.getText(a.start,a.end)))&&this._find.find(!0,{findString:a})}}.bind(this),{name:g.find});a.setKeyBinding(new k.KeyBinding("k",!0),"findNext");a.setAction("findNext",function(a){return this._find?(this._find.find(!0,a),!0):!1}.bind(this),{name:g.findNext});a.setKeyBinding(new k.KeyBinding("k",!0,!0),"findPrevious");
a.setAction("findPrevious",function(a){return this._find?(this._find.find(!1,a),!0):!1}.bind(this),{name:g.findPrevious});a.setKeyBinding(new k.KeyBinding("j",!0),"incrementalFind");a.setAction("incrementalFind",function(){this._incrementalFind&&this._incrementalFind.find(!0);return!0}.bind(this),{name:g.incrementalFind});a.setKeyBinding(new k.KeyBinding("j",!0,!0),"incrementalFindReverse");a.setAction("incrementalFindReverse",function(){this._incrementalFind&&this._incrementalFind.find(!1);return!0}.bind(this),
{name:g.incrementalFindReverse});a.setAction("tab",function(){return this.indentLines()}.bind(this));a.setAction("shiftTab",function(){return this.unindentLines()}.bind(this),{name:g.unindentLines});a.setKeyBinding(new k.KeyBinding(38,!1,!1,!0),"moveLinesUp");a.setAction("moveLinesUp",function(){return this.moveLinesUp()}.bind(this),{name:g.moveLinesUp});a.setKeyBinding(new k.KeyBinding(40,!1,!1,!0),"moveLinesDown");a.setAction("moveLinesDown",function(){return this.moveLinesDown()}.bind(this),{name:g.moveLinesDown});
a.setKeyBinding(new k.KeyBinding(38,!0,!1,!0),"copyLinesUp");a.setAction("copyLinesUp",function(){return this.copyLinesUp()}.bind(this),{name:g.copyLinesUp});a.setKeyBinding(new k.KeyBinding(40,!0,!1,!0),"copyLinesDown");a.setAction("copyLinesDown",function(){return this.copyLinesDown()}.bind(this),{name:g.copyLinesDown});a.setKeyBinding(new k.KeyBinding("d",!0,!1,!1),"deleteLines");a.setAction("deleteLines",function(a){return this.deleteLines(a)}.bind(this),{name:g.deleteLines});a.setKeyBinding(new k.KeyBinding("l",
!b.isMac,!1,!1,b.isMac),"gotoLine");a.setAction("gotoLine",function(){return this.gotoLine()}.bind(this),{name:g.gotoLine});a.setKeyBinding(new k.KeyBinding(190,!0),"nextAnnotation");a.setAction("nextAnnotation",function(){return this.nextAnnotation(!0)}.bind(this),{name:g.nextAnnotation});a.setKeyBinding(new k.KeyBinding(188,!0),"previousAnnotation");a.setAction("previousAnnotation",function(){return this.nextAnnotation(!1)}.bind(this),{name:g.prevAnnotation});a.setKeyBinding(new k.KeyBinding("e",
!0,!1,!0,!1),"expand");a.setAction("expand",function(){return this.expandAnnotation(!0)}.bind(this),{name:g.expand});a.setKeyBinding(new k.KeyBinding("c",!0,!1,!0,!1),"collapse");a.setAction("collapse",function(){return this.expandAnnotation(!1)}.bind(this),{name:g.collapse});a.setKeyBinding(new k.KeyBinding("e",!0,!0,!0,!1),"expandAll");a.setAction("expandAll",function(){return this.expandAnnotations(!0)}.bind(this),{name:g.expandAll});a.setKeyBinding(new k.KeyBinding("c",!0,!0,!0,!1),"collapseAll");
a.setAction("collapseAll",function(){return this.expandAnnotations(!1)}.bind(this),{name:g.collapseAll});a.setKeyBinding(new k.KeyBinding("q",!b.isMac,!1,!1,b.isMac),"lastEdit");a.setAction("lastEdit",function(){return this.gotoLastEdit()}.bind(this),{name:g.lastEdit})},copyLinesDown:function(){var a=this.editor;if(a.getTextView().getOptions("readonly"))return!1;var b=a.getModel(),c=a.getSelection(),f=b.getLineAtOffset(c.start),c=b.getLineAtOffset(c.end>c.start?c.end-1:c.end),e=b.getLineStart(f),
f=b.getLineEnd(c,!0),g=b.getLineCount(),i="",e=b.getText(e,f);c===g-1&&(e=(i=b.getLineDelimiter())+e);a.setText(e,f,f);a.setSelection(f+i.length,f+e.length);return!0},copyLinesUp:function(){var a=this.editor;if(a.getTextView().getOptions("readonly"))return!1;var b=a.getModel(),c=a.getSelection(),f=b.getLineAtOffset(c.start),c=b.getLineAtOffset(c.end>c.start?c.end-1:c.end),f=b.getLineStart(f),e=b.getLineEnd(c,!0),g=b.getLineCount(),i="",e=b.getText(f,e);c===g-1&&(e+=i=b.getLineDelimiter());a.setText(e,
f,f);a.setSelection(f,f+e.length-i.length);return!0},deleteLines:function(a){var b=this.editor;if(b.getTextView().getOptions("readonly"))return!1;var c=1;if(a&&a.count)c=a.count;var f=b.getSelection(),e=b.getModel(),g=e.getLineAtOffset(f.start),a=e.getLineStart(g),c=f.start!==f.end||c===1?e.getLineAtOffset(f.end>f.start?f.end-1:f.end):Math.min(g+c-1,e.getLineCount()-1),c=e.getLineEnd(c,!0);b.setText("",a,c);return!0},expandAnnotation:function(a){var b=this.editor,c=b.getAnnotationModel();if(!c)return!0;
var f=b.getModel(),e=b.getCaretOffset(),g=f.getLineAtOffset(e),e=f.getLineStart(g),g=f.getLineEnd(g,!0);f.getBaseModel&&(e=f.mapOffset(e),g=f.mapOffset(g),f.getBaseModel());for(var i,f=c.getAnnotations(e,g);!i&&f.hasNext();)e=f.next(),e.type===j.AnnotationType.ANNOTATION_FOLDING&&(i=e);i&&a!==i.expanded&&(a?i.expand():(b.setCaretOffset(i.start),i.collapse()),c.modifyAnnotation(i));return!0},expandAnnotations:function(a){var b=this.editor,c=b.getTextView(),f=b.getAnnotationModel();if(!f)return!0;var b=
b.getModel(),e=f.getAnnotations(0,b.getCharCount());for(c.setRedraw(!1);e.hasNext();)b=e.next(),b.type===j.AnnotationType.ANNOTATION_FOLDING&&a!==b.expanded&&(a?b.expand():b.collapse(),f.modifyAnnotation(b));c.setRedraw(!0);return!0},indentLines:function(){var a=this.editor,b=a.getTextView();if(b.getOptions("readonly"))return!1;if(b.getOptions("tabMode")){var c=a.getModel(),f=a.getSelection(),e=c.getLineAtOffset(f.start),g=c.getLineAtOffset(f.end>f.start?f.end-1:f.end);if(e!==g){var i=[];i.push("");
for(var j=e;j<=g;j++)i.push(c.getLine(j,!0));j=c.getLineStart(e);c=c.getLineEnd(g,!0);b=b.getOptions("tabSize","expandTab");b=b.expandTab?Array(b.tabSize+1).join(" "):"\t";a.setText(i.join(b),j,c);a.setSelection(j===f.start?f.start:f.start+b.length,f.end+(g-e+1)*b.length);return!0}return!1}},gotoLastEdit:function(){typeof this._lastEditLocation==="number"&&this.editor.showSelection(this._lastEditLocation);return!0},gotoLine:function(){var a=this.editor,b=a.getModel().getLineAtOffset(a.getCaretOffset());
if(b=prompt(g.gotoLinePrompty,b+1))b=parseInt(b,10),a.onGotoLine(b-1,0);return!0},moveLinesDown:function(){var a=this.editor;if(a.getTextView().getOptions("readonly"))return!1;var b=a.getModel(),c=a.getSelection(),f=b.getLineAtOffset(c.start),e=b.getLineAtOffset(c.end>c.start?c.end-1:c.end),g=b.getLineCount();if(e===g-1)return!0;var f=b.getLineStart(f),c=b.getLineEnd(e,!0),i=b.getLineEnd(e+1,!0)-(c-f),j=0;e!==g-2?b=b.getText(f,c):(e=b.getLineEnd(e),b=b.getText(e,c)+b.getText(f,e),j+=c-e);this.startUndo();
a.setText("",f,c);a.setText(b,i,i);a.setSelection(i+j,i+j+b.length);this.endUndo();return!0},moveLinesUp:function(){var a=this.editor;if(a.getTextView().getOptions("readonly"))return!1;var b=a.getModel(),c=a.getSelection(),f=b.getLineAtOffset(c.start);if(f===0)return!0;var e=b.getLineAtOffset(c.end>c.start?c.end-1:c.end),g=b.getLineCount(),c=b.getLineStart(f-1),i=b.getLineStart(f),j=b.getLineEnd(e,!0),k=b.getText(i,j),t=0;e===g-1&&(e=b.getLineEnd(f-1),f=b.getLineEnd(f-1,!0),k+=b.getText(e,f),i=e,
t=f-e);this.startUndo();a.setText("",i,j);a.setText(k,c,c);a.setSelection(c,c+k.length-t);this.endUndo();return!0},nextAnnotation:function(a){var b=this.editor,c=b.getAnnotationModel();if(!c)return!0;for(var f=b.getModel(),g=b.getCaretOffset(),c=c.getAnnotations(a?g:0,a?f.getCharCount():g),i=null;c.hasNext();){var k=c.next();if(a){if(k.start<=g)continue}else if(k.start>=g)continue;switch(k.type){case j.AnnotationType.ANNOTATION_ERROR:case j.AnnotationType.ANNOTATION_WARNING:case j.AnnotationType.ANNOTATION_TASK:case j.AnnotationType.ANNOTATION_BOOKMARK:break;
default:continue}i=k;if(a)break}if(i){var p=b.getTextView(),r=f.getLineAtOffset(i.start),t=e.Tooltip.getTooltip(p);if(!t)return b.moveSelection(i.start),!0;b.moveSelection(i.start,i.start,function(){t.setTarget({getTooltipInfo:function(){var a=p.convert({x:p.getLocationAtOffset(i.start).x,y:p.getLocationAtOffset(f.getLineStart(r)).y},"document","page");return{contents:[i],x:a.x,y:a.y+Math.floor(p.getLineHeight(r)*1.33)}}},0)})}return!0},unindentLines:function(){var a=this.editor,b=a.getTextView();
if(b.getOptions("readonly"))return!1;if(b.getOptions("tabMode")){for(var c=a.getModel(),f=a.getSelection(),e=c.getLineAtOffset(f.start),g=c.getLineAtOffset(f.end>f.start?f.end-1:f.end),i=b.getOptions("tabSize"),j=Array(i+1).join(" "),k=[],t=b=0,o=e;o<=g;o++){var v=c.getLine(o,!0);if(c.getLineStart(o)!==c.getLineEnd(o))if(v.indexOf("\t")===0)v=v.substring(1),b++;else if(v.indexOf(j)===0)v=v.substring(i),b+=i;else return!0;o===e&&(t=b);k.push(v)}e=c.getLineStart(e);i=c.getLineEnd(g,!0);c=c.getLineStart(g);
a.setText(k.join(""),e,i);g=e===f.start?f.start:f.start-t;f=Math.max(g,f.end-b+(f.end===c+1&&f.start!==f.end?1:0));a.setSelection(g,f);return!0}},startUndo:function(){this.undoStack&&this.undoStack.startCompoundChange()},endUndo:function(){this.undoStack&&this.undoStack.endCompoundChange()}};f.TextActions=a;i.prototype={init:function(){var a=this.editor.getTextView();a.setAction("lineStart",function(){return this.lineStart()}.bind(this));a.setAction("enter",function(){return this.autoIndent()}.bind(this));
a.setKeyBinding(new k.KeyBinding(191,!0),"toggleLineComment");a.setAction("toggleLineComment",function(){return this.toggleLineComment()}.bind(this),{name:g.toggleLineComment});a.setKeyBinding(new k.KeyBinding(191,!0,!b.isMac,!1,b.isMac),"addBlockComment");a.setAction("addBlockComment",function(){return this.addBlockComment()}.bind(this),{name:g.addBlockComment});a.setKeyBinding(new k.KeyBinding(220,!0,!b.isMac,!1,b.isMac),"removeBlockComment");a.setAction("removeBlockComment",function(){return this.removeBlockComment()}.bind(this),
{name:g.removeBlockComment})},autoIndent:function(){var a=this.editor;if(a.getTextView().getOptions("readonly"))return!1;var b=a.getSelection();if(b.start===b.end){for(var c=a.getModel(),f=c.getLineAtOffset(b.start),e=c.getLine(f,!0),g=c.getLineStart(f),f=0,g=b.start-g,i;f<g&&((i=e.charCodeAt(f))===32||i===9);)f++;if(f>0){for(var j=e.substring(0,f),f=g;f<e.length&&((i=e.charCodeAt(f++))===32||i===9);)b.end++;a.setText(c.getLineDelimiter()+j,b.start,b.end);return!0}}return!1},addBlockComment:function(){var a=
this.editor;if(a.getTextView().getOptions("readonly"))return!1;var b=a.getModel(),c=a.getSelection(),f=this._findEnclosingComment(b,c.start,c.end);if(f.commentStart!==void 0&&f.commentEnd!==void 0)return!0;b=b.getText(c.start,c.end);if(b.length===0)return!0;var f=b.length,b=b.replace(/\/\*|\*\//g,""),e=b.length;a.setText("/*"+b+"*/",c.start,c.end);a.setSelection(c.start+2,c.end+2+(e-f));return!0},contentAssistProposalApplied:function(a){a=a.data.proposal;if(a.positions&&a.positions.length>0&&this.linkedMode){for(var b=
[],c=0;c<a.positions.length;++c)b[c]={positions:[{offset:a.positions[c].offset,length:a.positions[c].length}]};this.linkedMode.enterLinkedMode({groups:b,escapePosition:a.escapePosition})}else a.groups&&a.groups.length>0&&this.linkedMode?this.linkedMode.enterLinkedMode({groups:a.groups,escapePosition:a.escapePosition}):a.escapePosition&&this.editor.getTextView().setCaretOffset(a.escapePosition);return!0},_findEnclosingComment:function(a,b,c){var f=a.getLineAtOffset(b),e=a.getLineAtOffset(c),g,i,j,
k,t,o;for(g=f;g>=0;g--)if(i=a.getLine(g),j=g===f?b-a.getLineStart(f):i.length,k=i.lastIndexOf("/*",j),i=i.lastIndexOf("*/",j),i>k)break;else if(k!==-1){t=a.getLineStart(g)+k;break}for(g=e;g<a.getLineCount();g++)if(i=a.getLine(g),j=g===e?c-a.getLineStart(e):0,k=i.indexOf("/*",j),i=i.indexOf("*/",j),k!==-1&&k<i)break;else if(i!==-1){o=a.getLineStart(g)+i;break}return{commentStart:t,commentEnd:o}},lineStart:function(){for(var a=this.editor,b=a.getModel(),c=a.getCaretOffset(),f=b.getLineAtOffset(c),e=
b.getLineStart(f),b=b.getLine(f),f=0;f<b.length;f++){var g=b.charCodeAt(f);if(!(g===32||g===9))break}f+=e;return c!==f?(a.setSelection(f,f),!0):!1},removeBlockComment:function(){var a=this.editor;if(a.getTextView().getOptions("readonly"))return!1;var b=a.getModel(),c=a.getSelection(),f=b.getText(c.start,c.end),e,g,i;for(i=0;i<f.length;i++)if(f.substring(i,i+2)==="/*"){e=c.start+i;break}for(;i<f.length;i++)if(f.substring(i,i+2)==="*/"){g=c.start+i;break}if(e!==void 0&&g!==void 0)a.setText(b.getText(e+
2,g),e,g+2),a.setSelection(e,g);else{f=this._findEnclosingComment(b,c.start,c.end);if(f.commentStart===void 0||f.commentEnd===void 0)return!0;b=b.getText(f.commentStart+2,f.commentEnd);a.setText(b,f.commentStart,f.commentEnd+2);a.setSelection(c.start-2,c.end-2)}return!0},toggleLineComment:function(){var a=this.editor;if(a.getTextView().getOptions("readonly"))return!1;for(var b=a.getModel(),c=a.getSelection(),f=b.getLineAtOffset(c.start),e=b.getLineAtOffset(c.end>c.start?c.end-1:c.end),g=!0,i=[],j,
k,t=f;t<=e;t++)if(j=b.getLine(t,!0),i.push(j),!g||(k=j.indexOf("//"))===-1)g=!1;else if(k!==0){var o;for(o=0;o<k;o++)if(g=j.charCodeAt(o),!(g===32||g===9))break;g=o===k}t=b.getLineStart(f);o=b.getLineEnd(e,!0);if(g){for(g=0;g<i.length;g++)j=i[g],k=j.indexOf("//"),i[g]=j.substring(0,k)+j.substring(k+2);i=i.join("");j=b.getLineStart(e);b=t===c.start?c.start:c.start-2;c=c.end-2*(e-f+1)+(c.end===j+1?2:0)}else i.splice(0,0,""),i=i.join("//"),b=t===c.start?c.start:c.start+2,c=c.end+2*(e-f+1);a.setText(i,
t,o);a.setSelection(b,c);return!0},startUndo:function(){this.undoStack&&this.undoStack.startCompoundChange()},endUndo:function(){this.undoStack&&this.undoStack.endCompoundChange()}};f.SourceCodeActions=i;return f});
define("orion/editor/undoStack",[],function(){function g(e,c,b){this.offset=e;this.text=c;this.previousText=b}function k(e){this.owner=e;this.changes=[]}function j(e,c){this.view=e;this.size=c!==void 0?c:100;this.reset();var b=e.getModel();b.getBaseModel&&(b=b.getBaseModel());this.model=b;var a=this;this._listener={onChanging:function(b){a._onChanging(b)},onDestroy:function(b){a._onDestroy(b)}};b.addEventListener("Changing",this._listener.onChanging);e.addEventListener("Destroy",this._listener.onDestroy)}
g.prototype={undo:function(e,c){this._doUndoRedo(this.offset,this.previousText,this.text,e,c);return!0},redo:function(e,c){this._doUndoRedo(this.offset,this.text,this.previousText,e,c);return!0},_doUndoRedo:function(e,c,b,a,g){var f=a.getModel();if(f.mapOffset&&a.annotationModel){var d=f.mapOffset(e,!0);if(d<0)for(var h=a.annotationModel.getAnnotations(e,e+1);h.hasNext();){var j=h.next();if(j.type==="orion.annotation.folding"){j.expand();d=f.mapOffset(e,!0);break}}if(d<0)return;e=d}f.setText(c,e,
e+b.length);g&&a.setSelection(e,e+c.length)}};k.prototype={add:function(e){this.changes.push(e)},end:function(e){this.endSelection=e.getSelection();this.endCaret=e.getCaretOffset();(e=this.owner)&&e.end&&e.end()},undo:function(e,c){this.changes.length>1&&e.setRedraw(!1);for(var b=this.changes.length-1;b>=0;b--)this.changes[b].undo(e,!1);this.changes.length>1&&e.setRedraw(!0);if(c){var b=this.startSelection.start,a=this.startSelection.end;e.setSelection(this.startCaret?b:a,this.startCaret?a:b)}(b=
this.owner)&&b.undo&&b.undo();return this.changes.length>0},redo:function(e,c){this.changes.length>1&&e.setRedraw(!1);for(var b=0;b<this.changes.length;b++)this.changes[b].redo(e,!1);this.changes.length>1&&e.setRedraw(!0);if(c){var b=this.endSelection.start,a=this.endSelection.end;e.setSelection(this.endCaret?b:a,this.endCaret?a:b)}(b=this.owner)&&b.redo&&b.redo();return this.changes.length>0},start:function(e){this.startSelection=e.getSelection();this.startCaret=e.getCaretOffset();(e=this.owner)&&
e.start&&e.start()}};j.prototype={add:function(e){this.compoundChange?this.compoundChange.add(e):(this.stack.splice(this.index,this.stack.length-this.index,e),this.index++,this.stack.length>this.size&&(this.stack.shift(),this.index--,this.cleanIndex--))},markClean:function(){this.endCompoundChange();this._commitUndo();this.cleanIndex=this.index},isClean:function(){return this.cleanIndex===this.getSize().undo},canUndo:function(){return this.getSize().undo>0},canRedo:function(){return this.getSize().redo>
0},endCompoundChange:function(){this.compoundChange&&this.compoundChange.end(this.view);this.compoundChange=void 0},getSize:function(){var e=this.index,c=this.stack.length;this._undoStart!==void 0&&e++;return{undo:e,redo:c-e}},undo:function(){this._commitUndo();var e;e=!1;this._ignoreUndo=!0;do{if(this.index<=0)break;e=this.stack[--this.index]}while(!(e=e.undo(this.view,!0)));this._ignoreUndo=!1;return e},redo:function(){this._commitUndo();var e;this._ignoreUndo=!0;do{if(this.index>=this.stack.length)break;
e=this.stack[this.index++]}while(!e.redo(this.view,!0));this._ignoreUndo=!1;return!0},reset:function(){this.index=this.cleanIndex=0;this.stack=[];this._undoStart=void 0;this._undoText="";this._undoType=0;this._ignoreUndo=!1;this._compoundChange=void 0},startCompoundChange:function(e){this._commitUndo();e=new k(e);this.add(e);this.compoundChange=e;this.compoundChange.start(this.view);return this.compoundChange},_commitUndo:function(){if(this._undoStart!==void 0)this._undoType===-1?this.add(new g(this._undoStart,
"",this._undoText)):this.add(new g(this._undoStart,this._undoText,"")),this._undoStart=void 0,this._undoText="",this._undoType=0;this.endCompoundChange()},_onDestroy:function(){this.model.removeEventListener("Changing",this._listener.onChanging);this.view.removeEventListener("Destroy",this._listener.onDestroy)},_onChanging:function(e){var c=e.text,b=e.start,a=e.removedCharCount,e=e.addedCharCount;if(!this._ignoreUndo){this._undoStart!==void 0&&!(e===1&&a===0&&this._undoType===1&&b===this._undoStart+
this._undoText.length||e===0&&a===1&&this._undoType===-1&&(b+1===this._undoStart||b===this._undoStart))&&this._commitUndo();if(!this.compoundChange)if(e===1&&a===0){if(this._undoStart===void 0)this._undoStart=b;this._undoText+=c;this._undoType=1;return}else if(e===0&&a===1){c=this._undoText.length>0&&this._undoStart===b;this._undoStart=b;this._undoType=-1;c?this._undoText+=this.model.getText(b,b+a):this._undoText=this.model.getText(b,b+a)+this._undoText;return}this.add(new g(b,c,this.model.getText(b,
b+a)))}}};return{UndoStack:j}});
define("orion/editor/rulers",["i18n!orion/editor/nls/messages","orion/editor/annotations","orion/editor/tooltip","orion/util"],function(g,k,j,e){function c(a,b,c,f){this._location=b||"left";this._overview=c||"page";this._rulerStyle=f;this._view=null;var e=this;this._listener={onTextModelChanged:function(a){e._onTextModelChanged(a)},onAnnotationModelChanged:function(a){e._onAnnotationModelChanged(a)}};this.setAnnotationModel(a)}function b(a,b,f,e,g){c.call(this,a,b,"page",f);this._oddStyle=e||{style:{backgroundColor:"white"}};
this._evenStyle=g||{style:{backgroundColor:"white"}};this._numOfDigits=0}function a(a,b,f){c.call(this,a,b,"page",f)}function i(a,b,f){c.call(this,a,b,"document",f)}function f(b,c,f){a.call(this,b,c,f)}c.prototype={getAnnotations:function(a,b){var c=this._annotationModel;if(!c)return[];var f=this._view.getModel(),e=f.getLineStart(a),g=f.getLineEnd(b-1),i=f;f.getBaseModel&&(i=f.getBaseModel(),e=f.mapOffset(e),g=f.mapOffset(g));for(var j=[],c=this.getAnnotationsByType(c,e,g),e=0;e<c.length;e++)for(var g=
c[e],k=i.getLineAtOffset(g.start),t=i.getLineAtOffset(Math.max(g.start,g.end-1)),o=k;o<=t;o++){var v=o;if(f!==i){v=i.getLineStart(o);v=f.mapOffset(v,!0);if(v===-1)continue;v=f.getLineAtOffset(v)}if(a<=v&&v<b){var x=this._mergeAnnotation(j[v],g,o-k,t-k+1);x&&(j[v]=x)}}if(!this._multiAnnotation&&this._multiAnnotationOverlay)for(var u in j)j[u]._multiple&&(j[u].html+=this._multiAnnotationOverlay.html);return j},getAnnotationModel:function(){return this._annotationModel},getLocation:function(){return this._location},
getOverview:function(){return this._overview},getRulerStyle:function(){return this._rulerStyle},getView:function(){return this._view},getWidestAnnotation:function(){return null},setAnnotationModel:function(a){this._annotationModel&&this._annotationModel.removEventListener("Changed",this._listener.onAnnotationModelChanged);(this._annotationModel=a)&&this._annotationModel.addEventListener("Changed",this._listener.onAnnotationModelChanged)},setMultiAnnotation:function(a){this._multiAnnotation=a},setMultiAnnotationOverlay:function(a){this._multiAnnotationOverlay=
a},setView:function(a){this._onTextModelChanged&&this._view&&this._view.removeEventListener("ModelChanged",this._listener.onTextModelChanged);this._view=a;this._onTextModelChanged&&this._view&&this._view.addEventListener("ModelChanged",this._listener.onTextModelChanged)},onClick:function(a){if(a!==void 0){var b=this._view,c=b.getModel(),f=c,e=c.getLineStart(a),g=e,i=this._annotationModel;if(i){g=b.getSelection();b=Math.max(g.start,g.end);g=c.getLineEnd(a,!0);e<=b&&b<c.getLineEnd(a)&&(e=b+1);c.getBaseModel&&
(e=c.mapOffset(e),g=c.mapOffset(g),f=c.getBaseModel());for(var k,a=i.getAnnotations(e,g);!k&&a.hasNext();)g=a.next(),this.isAnnotationTypeVisible(g.type)&&(k=g);k&&f.getLineAtOffset(k.start)===f.getLineAtOffset(e)?(e=k.start,g=k.end):g=e;c.getBaseModel&&(e=c.mapOffset(e,!0),g=c.mapOffset(g,!0))}(c=j.Tooltip.getTooltip(this._view))&&c.setTarget(null);this._view.setSelection(g,e,1/3,function(){})}},onDblClick:function(){},onMouseMove:function(a,b){var c=j.Tooltip.getTooltip(this._view);if(c&&!(c.isVisible()&&
this._tooltipLineIndex===a)){this._tooltipLineIndex=a;var f=this;c.setTarget({y:b.clientY,getTooltipInfo:function(){return f._getTooltipInfo(f._tooltipLineIndex,this.y)}})}},onMouseOver:function(a,b){this.onMouseMove(a,b)},onMouseOut:function(){var a=j.Tooltip.getTooltip(this._view);a&&a.setTarget(null)},_getTooltipInfo:function(a,b){if(a!==void 0){var c=this._view,f=c.getModel(),e=this._annotationModel,g=[];if(e){var g=f.getLineStart(a),i=f.getLineEnd(a);f.getBaseModel&&(g=f.mapOffset(g),i=f.mapOffset(i));
g=this.getAnnotationsByType(e,g,i)}e=this._getTooltipContents(a,g);if(!e)return null;e={contents:e,anchor:this.getLocation()};g=c.getClientArea();g.y=this.getOverview()==="document"?c.convert({y:b},"view","document").y:c.getLocationAtOffset(f.getLineStart(a)).y;c.convert(g,"document","page");e.x=g.x;e.y=g.y;e.anchor==="right"&&(e.x+=g.width);return e}},_getTooltipContents:function(a,b){return b},_onAnnotationModelChanged:function(a){function b(a){for(var d=0;d<a.length;d++)if(e.isAnnotationTypeVisible(a[d].type)){var g=
a[d].start,h=a[d].end;f.getBaseModel&&(g=f.mapOffset(g,!0),h=f.mapOffset(h,!0));g!==-1&&h!==-1&&c.redrawLines(f.getLineAtOffset(g),f.getLineAtOffset(Math.max(g,h-1))+1,e)}}var c=this._view;if(c){var f=c.getModel(),e=this,g=f.getLineCount();a.textModelChangedEvent?(a=a.textModelChangedEvent.start,f.getBaseModel&&(a=f.mapOffset(a,!0)),a=f.getLineAtOffset(a),c.redrawLines(a,g,e)):(b(a.added),b(a.removed),b(a.changed))}},_mergeAnnotation:function(a,b,c){a||(a={});if(c===0)if(a.html&&b.html){if(b.html!==
a.html&&!a._multiple&&this._multiAnnotation)a.html=this._multiAnnotation.html;a._multiple=!0}else a.html=b.html;a.style=this._mergeStyle(a.style,b.style);return a},_mergeStyle:function(a,b){if(b){a||(a={});a.styleClass&&b.styleClass&&a.styleClass!==b.styleClass?a.styleClass+=" "+b.styleClass:a.styleClass=b.styleClass;var c;if(b.style){if(!a.style)a.style={};for(c in b.style)a.style[c]||(a.style[c]=b.style[c])}if(b.attributes){if(!a.attributes)a.attributes={};for(c in b.attributes)a.attributes[c]||
(a.attributes[c]=b.attributes[c])}}return a}};k.AnnotationTypeList.addMixin(c.prototype);b.prototype=new c;b.prototype.getAnnotations=function(a,b){for(var f=c.prototype.getAnnotations.call(this,a,b),e=this._view.getModel(),g=a;g<b;g++){var i=g&1?this._oddStyle:this._evenStyle,j=g;e.getBaseModel&&(j=e.getLineStart(j),j=e.getBaseModel().getLineAtOffset(e.mapOffset(j)));f[g]||(f[g]={});f[g].html=j+1+"";if(!f[g].style)f[g].style=i}return f};b.prototype.getWidestAnnotation=function(){var a=this._view.getModel().getLineCount();
return this.getAnnotations(a-1,a)[a-1]};b.prototype._onTextModelChanged=function(a){var a=a.start,b=this._view.getModel(),c=((b.getBaseModel?b.getBaseModel().getLineCount():b.getLineCount())+"").length;if(this._numOfDigits!==c)this._numOfDigits=c,this._view.redrawLines(b.getLineAtOffset(a),b.getLineCount(),this)};a.prototype=new c;i.prototype=new c;i.prototype.getRulerStyle=function(){var a={style:{lineHeight:"1px",fontSize:"1px"}};return a=this._mergeStyle(a,this._rulerStyle)};i.prototype._getTooltipContents=
function(a,b){if(b.length===0){var f=this._view.getModel(),i=a;f.getBaseModel&&(i=f.getLineStart(i),i=f.getBaseModel().getLineAtOffset(f.mapOffset(i)));return e.formatMessage(g.line,i+1)}return c.prototype._getTooltipContents.call(this,a,b)};i.prototype._mergeAnnotation=function(a,b,c,f){if(c===0){if(!a)a={html:"&nbsp;",style:{style:{height:3*f+"px"}}},a.style=this._mergeStyle(a.style,b.overviewStyle);return a}};f.prototype=new a;f.prototype.onClick=function(a){if(a!==void 0){var b=this._annotationModel;
if(b){var c=this._view.getModel(),f=c.getLineStart(a),a=c.getLineEnd(a,!0);c.getBaseModel&&(f=c.mapOffset(f),a=c.mapOffset(a),c=c.getBaseModel());for(var e,b=b.getAnnotations(f,a);!e&&b.hasNext();)a=b.next(),this.isAnnotationTypeVisible(a.type)&&(e=a);e&&c.getLineAtOffset(e.start)===c.getLineAtOffset(f)&&((c=j.Tooltip.getTooltip(this._view))&&c.setTarget(null),e.expanded?e.collapse():e.expand(),this._annotationModel.modifyAnnotation(e))}}};f.prototype._getTooltipContents=function(b,c){return c.length===
1&&c[0].expanded?null:a.prototype._getTooltipContents.call(this,b,c)};f.prototype._onAnnotationModelChanged=function(b){function c(a){for(i=0;i<a.length;i++)if(g.isAnnotationTypeVisible(a[i].type)){var b=a[i].start;e.getBaseModel&&(b=e.mapOffset(b,!0));b!==-1&&(k=Math.min(k,e.getLineAtOffset(b)))}}if(b.textModelChangedEvent)a.prototype._onAnnotationModelChanged.call(this,b);else{var f=this._view;if(f){var e=f.getModel(),g=this,i,j=e.getLineCount(),k=j;c(b.added);c(b.removed);c(b.changed);b=f.getRulers();
for(i=0;i<b.length;i++)f.redrawLines(k,j,b[i])}}};return{Ruler:c,AnnotationRuler:a,LineNumberRuler:b,OverviewRuler:i,FoldingRuler:f}});
define("orion/editor/textDND",[],function(){function g(g,j){this._view=g;this._undoStack=j;this._dragSelection=null;this._dropOffset=-1;this._dropText=null;var e=this;this._listener={onDragStart:function(c){e._onDragStart(c)},onDragEnd:function(c){e._onDragEnd(c)},onDragEnter:function(c){e._onDragEnter(c)},onDragOver:function(c){e._onDragOver(c)},onDrop:function(c){e._onDrop(c)},onDestroy:function(c){e._onDestroy(c)}};g.addEventListener("DragStart",this._listener.onDragStart);g.addEventListener("DragEnd",
this._listener.onDragEnd);g.addEventListener("DragEnter",this._listener.onDragEnter);g.addEventListener("DragOver",this._listener.onDragOver);g.addEventListener("Drop",this._listener.onDrop);g.addEventListener("Destroy",this._listener.onDestroy)}g.prototype={destroy:function(){var g=this._view;if(g)g.removeEventListener("DragStart",this._listener.onDragStart),g.removeEventListener("DragEnd",this._listener.onDragEnd),g.removeEventListener("DragEnter",this._listener.onDragEnter),g.removeEventListener("DragOver",
this._listener.onDragOver),g.removeEventListener("Drop",this._listener.onDrop),g.removeEventListener("Destroy",this._listener.onDestroy),this._view=null},_onDestroy:function(){this.destroy()},_onDragStart:function(g){var j=this._view,e=j.getSelection(),j=j.getModel();if(j.getBaseModel)e.start=j.mapOffset(e.start),e.end=j.mapOffset(e.end),j=j.getBaseModel();if(j=j.getText(e.start,e.end))this._dragSelection=e,g.event.dataTransfer.effectAllowed="copyMove",g.event.dataTransfer.setData("Text",j)},_onDragEnd:function(g){var j=
this._view;if(this._dragSelection){this._undoStack&&this._undoStack.startCompoundChange();(g=g.event.dataTransfer.dropEffect==="move")&&j.setText("",this._dragSelection.start,this._dragSelection.end);if(this._dropText){var e=this._dropText,c=this._dropOffset;if(g)if(c>=this._dragSelection.end)c-=this._dragSelection.end-this._dragSelection.start;else if(c>=this._dragSelection.start)c=this._dragSelection.start;j.setText(e,c,c);j.setSelection(c,c+e.length);this._dropText=null;this._dropOffset=-1}this._undoStack&&
this._undoStack.endCompoundChange()}this._dragSelection=null},_onDragEnter:function(g){this._onDragOver(g)},_onDragOver:function(g){var j=g.event.dataTransfer.types;if(j){var e=!this._view.getOptions("readonly");e&&(e=j.contains?j.contains("text/plain"):j.indexOf("text/plain")!==-1);if(!e)g.event.dataTransfer.dropEffect="none"}},_onDrop:function(g){var j=this._view,e=g.event.dataTransfer.getData("Text");if(e)g=j.getOffsetAtLocation(g.x,g.y),this._dragSelection?(this._dropOffset=g,this._dropText=e):
(j.setText(e,g,g),j.setSelection(g,g+e.length))}};return{TextDND:g}});
define("orion/editor/templates",[],function(){function g(g,e,c){this.prefix=g;this.description=e;this.template=c;this._parse()}function k(g,e){this._keywords=g||[];this._templates=[];this.addTemplates(e||[])}g.prototype={getProposal:function(g,e,c){var g=e-g.length,e={},b,a=c.delimiter!==void 0?c.delimiter:"\n";c.indentation&&(a+=c.indentation);for(var i=c.tab!==void 0?c.tab:"\t",f=0,d=this.variables,h=this.segments,c=[],k=0;k<h.length;k++){var n=h[k],m=d[n];if(m!==void 0)switch(n){case "${tab}":n=
i;break;case "${delimiter}":n=a;break;case "${cursor}":n="";b=f;break;default:var q=e[n];q||(q=e[n]={data:m.data,positions:[]});n=m.substitution;q.data&&q.data.values&&(n=q.data.values[0]);q.positions.push({offset:g+f,length:n.length})}c.push(n);f+=n.length}var a=[],s;for(s in e)e.hasOwnProperty(s)&&a.push(e[s]);c=c.join("");if(b===void 0)b=c.length;return{proposal:c,description:this.description,groups:a,escapePosition:g+b}},match:function(g){return this.prefix.indexOf(g)===0},_parse:function(){var g=
this.template,e=[],c={},b,a=0,g=g.replace(/\n/g,"${delimiter}"),g=g.replace(/\t/g,"${tab}");g.replace(/\$\{((?:[^\\}]+|\\.))*\}/g,function(i,f,d){var h=i.substring(2,i.length-1),f=i,k=h,n=null,m=k.indexOf(":");m!==-1&&(k=k.substring(0,m),f="${"+k+"}",n=JSON.parse(h.substring(m+1).replace("\\}","}").trim()));(h=c[f])||(h=c[f]={});h.substitution=k;if(n)h.data=n;(b=g.substring(a,d))&&e.push(b);e.push(f);a=d+i.length;return k});(b=g.substring(a,g.length))&&e.push(b);this.segments=e;this.variables=c}};
k.prototype={addTemplates:function(j){for(var e=this.getTemplates(),c=0;c<j.length;c++)e.push(new g(j[c].prefix,j[c].description,j[c].template))},computeProposals:function(g,e,c){var b=this.getPrefix(g,e,c),a=[];if(!this.isValid(b,g,e,c))return a;a=a.concat(this.getTemplateProposals(b,e,c));return a=a.concat(this.getKeywordProposals(b))},getKeywords:function(){return this._keywords},getKeywordProposals:function(g){var e=[],c=this.getKeywords();if(c)for(var b=0;b<c.length;b++)c[b].indexOf(g)===0&&
e.push({proposal:c[b].substring(g.length),description:c[b]});return e},getPrefix:function(g,e,c){return c.prefix},getTemplates:function(){return this._templates},getTemplateProposals:function(g,e,c){for(var b=[],a=this.getTemplates(),i=0;i<a.length;i++){var f=a[i];f.match(g)&&(f=f.getProposal(g,e,c),this.removePrefix(g,f),b.push(f))}return b},removePrefix:function(g,e){if(!(e.overwrite=e.proposal.substring(0,g.length)!==g))e.proposal=e.proposal.substring(g.length)},isValid:function(){return!0}};return{Template:g,
TemplateContentAssist:k}});
define("orion/editor/linkedMode","i18n!orion/editor/nls/messages,orion/keyBinding,orion/editor/keyModes,orion/editor/annotations,orion/editor/templates,orion/objects,orion/util".split(","),function(g,k,j,e,c,b){function a(a,b,c){var e=a.getTextView();j.KeyMode.call(this,e);this.editor=a;this.undoStack=b;this.contentAssist=c;this.linkedModeModel=null;e.setAction("linkedModeEnter",function(){this.exitLinkedMode(!0);return!0}.bind(this));e.setAction("linkedModeCancel",function(){this.exitLinkedMode(!1);return!0}.bind(this));
e.setAction("linkedModeNextGroup",function(){var a=this.linkedModeModel;this.selectLinkedGroup((a.selectedGroupIndex+1)%a.groups.length);return!0}.bind(this));e.setAction("linkedModePreviousGroup",function(){var a=this.linkedModeModel;this.selectLinkedGroup(a.selectedGroupIndex>0?a.selectedGroupIndex-1:a.groups.length-1);return!0}.bind(this));this.linkedModeListener={onActivating:function(){this._groupContentAssistProvider&&(this.contentAssist.setProviders([this._groupContentAssistProvider]),this.contentAssist.setProgress(null))}.bind(this),
onModelChanged:function(a){if(!this.ignoreVerify){for(var b=this.linkedModeModel,c,d;b;)if(c=this._getPositionChanged(b,a.start,a.start+a.removedCharCount),d=c.position,d===void 0||d.model!==b)this.exitLinkedMode(!1),b=this.linkedModeModel;else break;if(b){b=0;d=a.addedCharCount-a.removedCharCount;c=c.positions;for(var f,e,g=0;g<c.length;++g){e=c[g];f=e.position;var h=f.offset<=a.start&&a.start<=f.offset+f.length;h&&!e.ansestor?(f.offset+=b,f.length+=d,b+=d):(f.offset+=b,e.ansestor&&h&&(f.length+=
d));if(e.escape)e.model.escapePosition=f.offset}this._updateAnnotations(c)}}}.bind(this),onVerify:function(a){if(!this.ignoreVerify){for(var b=this.linkedModeModel,c,d;b;)if(c=this._getPositionChanged(b,a.start,a.end),d=c.position,d===void 0||d.model!==b)this.exitLinkedMode(!1),b=this.linkedModeModel;else break;if(b){var f=this._compoundChange;f?f.owner.model===b&&f.owner.group===d.group||(this.endUndo(),this.startUndo()):this.startUndo();b.selectedGroupIndex=d.group;var f=0,e=a.text.length-(a.end-
a.start);c=c.positions;for(var g,h,i=a.start-d.position.offset,j=a.end-d.position.offset,k=0;k<c.length;++k)if(h=c[k],g=h.position,h.oldOffset=g.offset,h.model===b&&h.group===d.group?(g.offset+=f,g.length+=e,f+=e):(g.offset+=f,h.ansestor&&(g.length+=d.count*e)),h.escape)h.model.escapePosition=g.offset;this.ignoreVerify=!0;f=this.editor.getTextView();for(k=c.length-1;k>=0;k--)h=c[k],h.model===b&&h.group===d.group&&f.setText(a.text,h.oldOffset+i,h.oldOffset+j);this.ignoreVerify=!1;a.text=null;this._updateAnnotations(c)}}}.bind(this)}}
var i={};a.prototype=new j.KeyMode;b.mixin(a.prototype,{createKeyBindings:function(){var a=k.KeyBinding,b=[];b.push({actionID:"linkedModeEnter",keyBinding:new a(13)});b.push({actionID:"linkedModeCancel",keyBinding:new a(27)});b.push({actionID:"linkedModeNextGroup",keyBinding:new a(9)});b.push({actionID:"linkedModePreviousGroup",keyBinding:new a(9,!1,!0)});return b},enterLinkedMode:function(a){if(!this.linkedModeModel){var b=this.editor.getTextView();b.addKeyMode(this);b.addEventListener("Verify",
this.linkedModeListener.onVerify);b.addEventListener("ModelChanged",this.linkedModeListener.onModelChanged);this.contentAssist.addEventListener("Activating",this.linkedModeListener.onActivating);this.editor.reportStatus(g.linkedModeEntered,null,!0)}this._sortedPositions=null;if(this.linkedModeModel)a.previousModel=this.linkedModeModel,a.parentGroup=this.linkedModeModel.selectedGroupIndex,this.linkedModeModel.nextModel=a;this.linkedModeModel=a;this.selectLinkedGroup(0)},exitLinkedMode:function(a){if(this.isActive()){if(this._compoundChange)this.endUndo(),
this._compoundChange=null;this._sortedPositions=null;var b=this.linkedModeModel;this.linkedModeModel=b.previousModel;b.parentGroup=b.previousModel=void 0;if(this.linkedModeModel)this.linkedModeModel.nextModel=void 0;if(!this.linkedModeModel){var c=this.editor.getTextView();c.removeKeyMode(this);c.removeEventListener("Verify",this.linkedModeListener.onVerify);c.removeEventListener("ModelChanged",this.linkedModeListener.onModelChanged);var e=this.contentAssist;e.removeEventListener("Activating",this.linkedModeListener.onActivating);
e.offset=void 0;this.editor.reportStatus(g.linkedModeExited,null,!0);a&&c.setCaretOffset(b.escapePosition,!1)}this.selectLinkedGroup(0)}},startUndo:function(){if(this.undoStack){var a=this,b=this.linkedModeModel;this._compoundChange=this.undoStack.startCompoundChange({model:b,group:b.selectedGroupIndex,end:function(){a._compoundChange=null}})}},endUndo:function(){this.undoStack&&this.undoStack.endCompoundChange()},isActive:function(){return!!this.linkedModeModel},isStatusActive:function(){return!!this.linkedModeModel},
selectLinkedGroup:function(a){var b=this.linkedModeModel;if(b){b.selectedGroupIndex=a;var a=b.groups[a],e=a.positions[0],g=this.editor.getTextView();g.setSelection(e.offset,e.offset+e.length);if(b=this.contentAssist)if(b.offset=void 0,a.data&&a.data.type==="link"&&a.data.values)(this._groupContentAssistProvider=new c.TemplateContentAssist(a.data.values)).getPrefix=function(){var a=g.getSelection();return a.start===a.end&&(a=g.getCaretOffset(),e.offset<=a&&a<=e.offset+e.length)?g.getText(e.offset,
a):""},b.offset=e.offset,b.deactivate(),b.activate();else if(this._groupContentAssistProvider)this._groupContentAssistProvider=null,b.deactivate()}this._updateAnnotations()},_getModelPositions:function(a,b,c){for(var e=b.groups,g=0;g<e.length;g++)for(var i=e[g].positions,j=0;j<i.length;j++){var k=i[j];c&&(k={offset:k.offset+c,length:k.length});k={index:j,group:g,count:i.length,model:b,position:k};a.push(k);if(b.nextModel&&b.nextModel.parentGroup===g)k.ansestor=!0,this._getModelPositions(a,b.nextModel,
(c||0)+i[j].offset-i[0].offset)}},_getSortedPositions:function(a){var b=this._sortedPositions;if(!b){for(b=[];a.previousModel;)a=a.previousModel;for(this._getModelPositions(b,a);a;)a.escapePosition!==void 0&&b.push({escape:!0,model:a,position:{offset:a.escapePosition,length:0}}),a=a.nextModel;b.sort(function(a,b){return a.position.offset-b.position.offset});this._sortedPositions=b}return b},_getPositionChanged:function(a,b,c){for(var e,a=this._getSortedPositions(a),g=a.length-1;g>=0;g--){var i=a[g].position;
if(i.offset<=b&&c<=i.offset+i.length){e=a[g];break}}return{position:e,positions:a}},_updateAnnotations:function(a){var b=this.editor.getAnnotationModel();if(b){for(var c=[],g=[],i=b.getTextModel(),i=b.getAnnotations(0,i.getCharCount()),j;i.hasNext();)switch(j=i.next(),j.type){case e.AnnotationType.ANNOTATION_LINKED_GROUP:case e.AnnotationType.ANNOTATION_CURRENT_LINKED_GROUP:case e.AnnotationType.ANNOTATION_SELECTED_LINKED_GROUP:c.push(j)}if(i=this.linkedModeModel)for(var a=a||this._getSortedPositions(i),
k=0;k<a.length;k++)if(j=a[k],j.model===i){var s=e.AnnotationType.ANNOTATION_LINKED_GROUP;j.group===i.selectedGroupIndex&&(s=j.index===0?e.AnnotationType.ANNOTATION_SELECTED_LINKED_GROUP:e.AnnotationType.ANNOTATION_CURRENT_LINKED_GROUP);j=j.position;j=e.AnnotationType.createAnnotation(s,j.offset,j.offset+j.length,"");g.push(j)}b.replaceAnnotations(c,g)}}});i.LinkedMode=a;return i});
define("orion/editor/factories","orion/editor/actions,orion/editor/undoStack,orion/editor/rulers,orion/editor/annotations,orion/editor/textDND,orion/editor/linkedMode".split(","),function(g,k,j,e,c,b){function a(){}function i(){}function f(){}function d(){}function h(){}function l(){}var n={};a.prototype={createKeyBindings:function(a,c,d,f){var f=new g.TextActions(a,c,f),e=new b.LinkedMode(a,c,d),a=new g.SourceCodeActions(a,c,d,e);return{textActions:f,linkedMode:e,sourceCodeActions:a}}};n.KeyBindingsFactory=
a;i.prototype={createUndoStack:function(a){a=a.getTextView();return new k.UndoStack(a,200)}};n.UndoFactory=i;f.prototype={createLineNumberRuler:function(a){return new j.LineNumberRuler(a,"left",{styleClass:"ruler lines"},{styleClass:"rulerLines odd"},{styleClass:"rulerLines even"})}};n.LineNumberRulerFactory=f;d.prototype={createFoldingRuler:function(a){return new j.FoldingRuler(a,"left",{styleClass:"ruler folding"})}};n.FoldingRulerFactory=d;h.prototype={createAnnotationModel:function(a){return new e.AnnotationModel(a)},
createAnnotationStyler:function(a,b){return new e.AnnotationStyler(a,b)},createAnnotationRulers:function(a){var b=new j.AnnotationRuler(a,"left",{styleClass:"ruler annotations"}),a=new j.OverviewRuler(a,"right",{styleClass:"ruler overview"});return{annotationRuler:b,overviewRuler:a}}};n.AnnotationFactory=h;l.prototype={createTextDND:function(a,b){return new c.TextDND(a.getTextView(),b)}};n.TextDNDFactory=l;return n});
define("orion/editor/editorFeatures",["orion/editor/factories","orion/editor/actions","orion/editor/linkedMode"],function(g,k,j){var e={};e.KeyBindingsFactory=g.KeyBindingsFactory;e.UndoFactory=g.UndoFactory;e.LineNumberRulerFactory=g.LineNumberRulerFactory;e.FoldingRulerFactory=g.FoldingRulerFactory;e.AnnotationFactory=g.AnnotationFactory;e.TextDNDFactory=g.TextDNDFactory;e.TextActions=k.TextActions;e.SourceCodeActions=k.SourceCodeActions;e.LinkedMode=j.LinkedMode;return e});
define("text!orion/compare/sideBySideTemplate.html",[],function(){return'<div id="topWidget_id" style="height:100%;width:100%;position:relative">\n\t<div class="leftPanelLayout ">\n\t\t<div class="titleContainer" id="left_title_id"></div>\n\t\t<div class="compareEditorParent" id="left_editor_id"></div>\n\t\t<div class="statusContainer" id="left_status_id"></div>\n\t</div>\n\t<div class="split compareSplitLayout"></div>\n\t<div class="rightPanelLayout">\n\t\t<div class="titleContainer" id="right_title_id"></div>\n\t\t<div class="compareEditorParent"  id="right_editor_wrapper_id">\n\t\t\t<div class="canvasContainer">\n\t\t\t\t<canvas id="diff_canvas_id" class="compareCanvas" width="46" height="3000"></canvas>\n\t\t\t</div>\n\t\t\t<div class="compareEditorParentWithCanvas" id="right_editor_id"></div>\n\t\t</div>\n\t\t<div class="statusContainer" id="right_status_id"></div>\n\t</div>\n</div>'});
define("orion/compare/compareUIFactory",["orion/webui/littlelib","orion/webui/splitter","text!orion/compare/sideBySideTemplate.html"],function(g,k,j){var e=e||{};e.TwoWayCompareUIFactory=function(){function c(b){this._parentDivID=b.parentDivID;this._commandSpanId=b.commandSpanId;this._showTitle=b.showTitle;this._leftTitle=b.leftTitle;this._rightTitle=b.rightTitle;this._showLineStatus=b.showLineStatus}c.prototype={_init:function(){var b=this._parentDivID+"_";this._topWidgetDiv=g.node("topWidget_id");
this._topWidgetDiv.id=b+"topWidget_id";this._leftEditorParentDiv=g.node("left_editor_id");this._leftEditorParentDiv.id=b+"left_editor_id";this._rightEditorParentDiv=g.node("right_editor_id");this._rightEditorParentDiv.id=b+"right_editor_id";this._rightEditorWrapperDiv=g.node("right_editor_wrapper_id");this._rightEditorWrapperDiv.id=b+"right_editor_wrapper_id";this._leftTitleDiv=g.node("left_title_id");this._leftTitleDiv.id=b+"left_title_id";this._rightTitleDiv=g.node("right_title_id");this._rightTitleDiv.id=
b+"right_title_id";this._leftStatusDiv=g.node("left_status_id");this._leftStatusDiv.id=b+"left_status_id";this._rightStatusDiv=g.node("right_status_id");this._rightStatusDiv.id=b+"right_status_id";this._diffCanvasDiv=g.node("diff_canvas_id");this._diffCanvasDiv.id=b+"diff_canvas_id";this._splitterId=b+"orion_splitter";if(!this._showTitle)this._leftEditorParentDiv.style.top="0px",this._rightEditorWrapperDiv.style.top="0px",this._leftTitleDiv.style.height="0px",this._rightTitleDiv.style.height="0px";
if(!this._showLineStatus)this._leftEditorParentDiv.style.marginBottom="0px",this._rightEditorWrapperDiv.style.marginBottom="0px",this._leftStatusDiv.style.height="0px",this._rightStatusDiv.style.height="0px"},_createSplitter:function(){var b=g.$(".split",this._topWidgetDiv);b.id=this._splitterId;var a=g.$(".leftPanelLayout",this._topWidgetDiv),c=g.$(".rightPanelLayout",this._topWidgetDiv);if(b&&a&&c)this._splitter=new k.Splitter({node:b,sidePanel:a,mainPanel:c})},buildUI:function(){g.node(this._parentDivID).innerHTML=
j;this._init();this._createSplitter()},destroy:function(){},getSplitter:function(){return this._splitter},isLeftPane:function(b){return g.$(".leftPanelLayout",this._topWidgetDiv)===b},getEditorParentDiv:function(b){return b?this._leftEditorParentDiv:this._rightEditorParentDiv},getTitleDiv:function(b){return b?this._leftTitleDiv:this._rightTitleDiv},getStatusDiv:function(b){return b?this._leftStatusDiv:this._rightStatusDiv},getCommandSpanId:function(){return this._commandSpanId},getDiffCanvasDiv:function(){return this._diffCanvasDiv}};
return c}();return e});
var JsDiff=function(){function g(a){for(var b=[],c=0;c<a.length;c++)a[c]&&b.push(a[c]);return b}function k(a){a=a.replace(/&/g,"&amp;");a=a.replace(/</g,"&lt;");a=a.replace(/>/g,"&gt;");return a=a.replace(/"/g,"&quot;")}var j=function(a){this.ignoreWhitespace=a};j.prototype={diff:function(a,b){if(b==a)return[{value:b}];if(!b)return[{value:a,removed:!0}];if(!a)return[{value:b,added:!0}];var b=this.tokenize(b),a=this.tokenize(a),c=b.length,e=a.length,g=c+e,j=[{newPos:-1,components:[]}],k=this.extractCommon(j[0],
b,a,0);if(j[0].newPos+1>=c&&k+1>=e)return j[0].components;for(var q=1;q<=g;q++)for(var s=-1*q;s<=q;s+=2){var p;p=j[s-1];var r=j[s+1],k=(r?r.newPos:0)-s;p&&(j[s-1]=void 0);var t=p&&p.newPos+1<c,o=r&&0<=k&&k<e;if(!t&&!o)j[s]=void 0;else if(!t||o&&p.newPos<r.newPos?(p={newPos:r.newPos,components:r.components.slice(0)},this.pushComponent(p.components,a[k],void 0,!0)):(p={newPos:p.newPos,components:p.components.slice(0)},p.newPos++,this.pushComponent(p.components,b[p.newPos],!0,void 0)),k=this.extractCommon(p,
b,a,s),p.newPos+1>=c&&k+1>=e)return p.components;else j[s]=p}},pushComponent:function(a,b,c,e){var g=a[a.length-1];g&&g.added===c&&g.removed===e?a[a.length-1]={value:this.join(g.value,b),added:c,removed:e}:a.push({value:b,added:c,removed:e})},extractCommon:function(a,b,c,e){for(var g=b.length,j=c.length,k=a.newPos,e=k-e;k+1<g&&e+1<j&&this.equals(b[k+1],c[e+1]);)k++,e++,this.pushComponent(a.components,b[k],void 0,void 0);a.newPos=k;return e},equals:function(a,b){var c=/\S/;return this.ignoreWhitespace&&
!c.test(a)&&!c.test(b)?!0:a==b},join:function(a,b){return a+b},tokenize:function(a){return a}};var e=new j,c=new j(!1);c.tokenize=function(a){return g(a.split(/(\s+|\b)/))};var b=new j(!0);b.tokenize=function(a){return g(a.split(/([{}:;,]|\s+)/))};var a=new j;a.tokenize=function(a){return a.split(/^/m)};return{diffChars:function(a,b){return e.diff(a,b)},diffWords:function(a,b){return c.diff(a,b)},diffLines:function(b,c){return a.diff(b,c)},diffCss:function(a,c){return b.diff(a,c)},createPatch:function(b,
c,d,e,g){var j=[];j.push("Index: "+b);j.push("===================================================================");j.push("--- "+b+"\t"+e);j.push("+++ "+b+"\t"+g);b=a.diff(c,d);b.push({value:"",lines:[]});for(var d=c=0,e=[],k=g=1,q=0;q<b.length;q++){var s=b[q],p=s.lines||s.value.replace(/\n$/,"").split("\n");s.lines=p;if(s.added||s.removed){if(!c){var r=b[q-1],c=g,d=k;r&&(e.push.apply(e,r.lines.slice(-4).map(function(a){return" "+a})),c-=4,d-=4)}e.push.apply(e,p.map(function(a){return(s.added?"+":
"-")+a}));s.added?k+=p.length:g+=p.length}else c&&(p.length<=8&&q<b.length-1?e.push.apply(e,p.map(function(a){return" "+a})):(r=Math.min(p.length,4),j.push("@@ -"+c+","+(g-c+r)+" +"+d+","+(k-d+r)+" @@"),j.push.apply(j,e),j.push.apply(j,p.slice(0,r).map(function(a){return" "+a})),d=c=0,e=[])),g+=p.length,k+=p.length}b.length>1&&!/\n$/.test(b[b.length-2].value)&&j.push("\\ No newline at end of file\n");return j.join("\n")},convertChangesToXML:function(a){for(var b=[],c=0;c<a.length;c++){var e=a[c];
e.added?b.push("<ins>"):e.removed&&b.push("<del>");b.push(k(e.value));e.added?b.push("</ins>"):e.removed&&b.push("</del>")}return b.join("")}}}();if(typeof module!=="undefined")module.exports=JsDiff;typeof define==="function"&&define.amd&&define("jsdiff/diff",[],function(){return JsDiff});
define("orion/compare/jsdiffAdapter",["jsdiff/diff"],function(g){var k=k||{};k.JSDiffAdapter=function(){function j(){}j.prototype={_specialLine:function(e,c,b){return c.value===e&&b!==e},adapt:function(e,c,b){b||(b="\n");for(var a=e.split(b),i=c.split(b),f=a[a.length-1]==="",i=i[i.length-1]==="",d=g.diffLines(e,c),e=[],c=[],h=0,j=0,k=-1,m=0,q=!0,s=b,p=0;p<d.length;p++){var r=d[p],t=r.lines||r.value.split(b),o=t.length,v=0;t.length>1&&t[t.length-1]===""&&o--;o>1&&!q&&t[0]===""&&(o--,v++);r.lines=t;
if(!r.added&&!r.removed){if(!this._specialLine(b,r,s)){if(h||j)e.push([h,j,k]),j=h=0,k=-1,m+=j;e.push([o,o,0]);m+=o}}else if(r.added){k===-1&&(k=c.length+1);h+=o;for(q=v;q<o+v;q++)c.push(r.lines[q])}else j+=o;q=!1;t.length>1&&t[t.length-1]===""&&(q=!0);s=r.value?r.value[r.value.length-1]:b}if(h||j)e.push([h,j,k]),m+=j;m<a.length&&a.length>1&&(b=e[e.length-1],b[2]===0?(b[0]+=1,b[1]+=1):b[2]===-1?e.push([1,1,0]):f===i?e.push([1,1,0]):(i&&(b[0]+=1),f&&(b[1]+=1)));return{mapper:e,changContents:{array:c,
index:0}}},adaptCharDiff:function(e,c,b){for(var e=b?g.diffWords(e,c):g.diffChars(e,c),c=[],a=b=0,i=0,f=0,d=0;d<e.length;d++){var h=e[d];if(!h.added&&!h.removed){if(i>0||f>0)c.push([a,a+i,b,b+f]),a+=i,b+=f,f=i=0;a+=h.value.length;b+=h.value.length}else h.added?i+=h.value.length:f+=h.value.length}(i>0||f>0)&&c.push([a,a+i,b,b+f]);return c}};return j}();return k});
define("orion/compare/diffTreeNavigator",["orion/treeModelIterator","orion/compare/compareUtils","orion/editor/annotations","orion/compare/jsdiffAdapter"],function(g,k,j,e){var c={},b,a,i,f,d,h,l,n,m,q,s,p,r,t,o,v;c.DiffTreeNavigator=function(){function c(a,b,d,f,e,g){this._root={type:"root",children:[]};this._initialized=!1;this.initAll(a,b,d,f,e,g)}b="orion.annotation.diff.addedBlock";a="orion.annotation.diff.currentAddedBlock";i="orion.annotation.diff.deletedBlock";f="orion.annotation.diff.currentDeletedBlock";
d="orion.annotation.diff.blockTop";h="orion.annotation.diff.currentBlockTop";l="orion.annotation.diff.blockConflict";n="orion.annotation.diff.currentBlockConflict";m="orion.annotation.diff.addedWord";q="orion.annotation.diff.currentAddedWord";s="orion.annotation.diff.deletedWord";p="orion.annotation.diff.currentDeletedWord";r="orion.annotation.diff.emptyDeletedWordLeft";t="orion.annotation.diff.emptyDeletedWordRight";o="orion.annotation.diff.emptyAddedWordLeft";v="orion.annotation.diff.emptyAddedWordRight";
j.AnnotationType.registerType(b,{title:"",html:"",lineStyle:{styleClass:"annotationLine addedBlockDiff"}});j.AnnotationType.registerType(a,{title:"",html:"",lineStyle:{styleClass:"annotationLine currentAddedBlockDiff"}});j.AnnotationType.registerType(i,{title:"",html:"",lineStyle:{styleClass:"annotationLine deletedBlockDiff"}});j.AnnotationType.registerType(f,{title:"",html:"",lineStyle:{styleClass:"annotationLine currentDeletedBlockDiff"}});j.AnnotationType.registerType(d,{title:"",html:"",lineStyle:{styleClass:"annotationLine blockDiffTopOnly"}});
j.AnnotationType.registerType(h,{title:"",html:"",lineStyle:{styleClass:"annotationLine currentBlockDiffTopOnly"}});j.AnnotationType.registerType(l,{title:"",html:"",lineStyle:{styleClass:"annotationLine blockDiffConflict"}});j.AnnotationType.registerType(n,{title:"",html:"",lineStyle:{styleClass:"annotationLine currentBlockDiffConflict"}});j.AnnotationType.registerType(m,{title:"word added",html:"",rangeStyle:{styleClass:"annotationRange addedWordDiff"}});j.AnnotationType.registerType(q,{title:"",
html:"",rangeStyle:{styleClass:"annotationRange currentAddedWordDiff"}});j.AnnotationType.registerType(s,{title:"word deleted",html:"",rangeStyle:{styleClass:"annotationRange deletedWordDiff"}});j.AnnotationType.registerType(p,{title:"",html:"",rangeStyle:{styleClass:"annotationRange currentDeletedWordDiff"}});j.AnnotationType.registerType(r,{title:"",html:"",rangeStyle:{styleClass:"annotationRange emptyDeletedWordDiffLeft"}});j.AnnotationType.registerType(t,{title:"",html:"",rangeStyle:{styleClass:"annotationRange emptyDeletedWordDiffRight"}});
j.AnnotationType.registerType(o,{title:"",html:"",rangeStyle:{styleClass:"annotationRange emptyAddedWordDiffLeft"}});j.AnnotationType.registerType(v,{title:"",html:"",rangeStyle:{styleClass:"annotationRange emptyAddedWordDiffRight"}});c.prototype={initAll:function(a,b,c,d,f,e,g){this._charOrWordDiff=a?a:"word";if(b)this._initialized=!0;this.editorWrapper=[{editor:b,diffFeeder:d},{editor:c,diffFeeder:f}];this._curveRuler=g;(this._overviewRuler=e)&&this._overviewRuler.setDiffNavigator(this)},initMapper:function(a){if(a)for(var b=
0;b<this.editorWrapper.length;b++)this.editorWrapper[b].diffFeeder.init(this.editorWrapper[b].editor.getTextView().getModel(),a)},destroy:function(){this.initAll(this._charOrWordDiff)},renderAnnotations:function(){var a;for(a=0;a<this.editorWrapper.length;a++){this.editorWrapper[a].annoTypes=[];this.editorWrapper[a].diffFeeder.getBlockAnnoTypes(this.editorWrapper[a].annoTypes);this.editorWrapper[a].diffFeeder.getWordAnnoTypes(this.editorWrapper[a].annoTypes);for(var b=0;b<this.editorWrapper[a].annoTypes.length;b++)this.editorWrapper[a].annoTypes[b].current&&
this.editorWrapper[a].editor.getAnnotationStyler().addAnnotationType(this.editorWrapper[a].annoTypes[b].current),this.editorWrapper[a].annoTypes[b].normal&&this.editorWrapper[a].editor.getAnnotationStyler().addAnnotationType(this.editorWrapper[a].annoTypes[b].normal)}this._root.children=[];b=this.editorWrapper[0].diffFeeder.getDiffBlocks();if(!b||b.length===0)this.replaceAllAnnotations(!0,0,"block",!1,[]),this.replaceAllAnnotations(!0,1,"block",!1,[]),this.replaceAllAnnotations(!0,0,"word",!1,[]),
this.replaceAllAnnotations(!0,1,"word",!1,[]),this.replaceAllAnnotations(!0,0,"block",!0,[]),this.replaceAllAnnotations(!0,1,"block",!0,[]),this.replaceAllAnnotations(!0,0,"word",!0,[]),this.replaceAllAnnotations(!0,1,"word",!0,[]);else{var c=new e.JSDiffAdapter;for(a=0;a<b.length;a++){var d=this.generatePairBlockAnnotations(this._root,a);this._root.children.push(d);var f=this.generatePairWordAnnotations(d,a,c);if(f)d.children=f}this.replaceAllAnnotations(!1,0,"block",!0);this.replaceAllAnnotations(!1,
1,"block",!0);this.replaceAllAnnotations(!1,0,"word",!0);this.replaceAllAnnotations(!1,1,"word",!0);this.iterator=new g.TreeModelIterator(this._root.children)}},replaceAllAnnotations:function(a,b,c,d,f){if(this.editorWrapper[b].annoTypes)for(var e=0;e<this.editorWrapper[b].annoTypes.length;e++)this.editorWrapper[b].annoTypes[e].type===c&&this.replaceDiffAnnotations(this.editorWrapper[b].editor,f?f:this.editorWrapper[b].annoTypes[e].list,d?this.editorWrapper[b].annoTypes[e].normal:this.editorWrapper[b].annoTypes[e].current,
a)},getMapper:function(){return this.editorWrapper[0].diffFeeder.getMapper()},getFeeder:function(a){return a?this.editorWrapper[1].diffFeeder:this.editorWrapper[0].diffFeeder},iterateOnBlock:function(a,b){this.iterator&&(this.iterator.iterateOnTop(a,b),this.updateCurrentAnnotation(!0))},iterateOnChange:function(a){if(!this.iterator)return null;var b=this.iterator.iterate(a);if(b){var c=this.iterator.cursor();c.type==="block"&&c.children&&c.children.length>0&&this.iterator.iterate(a);this.updateCurrentAnnotation(!0)}return b},
gotoBlock:function(a,b){if(this.iterator){if(a<0||a>=this._root.children.length||this._root.children.length===0)a=0;b!==void 0&&b>=0&&this._root.children[a].children&&b<this._root.children[a].children.length?this.iterator.setCursor(this._root.children[a].children[b]):this.iterator.setCursor(this._root.children[a]);this.updateCurrentAnnotation(!1);this._positionDiffBlock()}},_hitDiffAnnotation:function(a,b,c){if(c===this.editorWrapper[a].editor.getTextView()){for(var d=0;d<this._root.children.length;d++){var c=
this._root.children[d],f=a===0?c.oldA:c.newA;if(b>=f.start&&b<=f.end){d=c;if(c.children&&c.children.length>0)for(f=0;f<c.children.length;f++){var e=c.children[f],g=a===0?e.oldA:e.newA;if(b>=g.start&&b<=g.end){d=e;break}}return d}}return null}},gotoChange:function(a,b){for(var c=0;c<this.editorWrapper.length;c++){var d=this._hitDiffAnnotation(c,a,b);if(d)return this.iterator.setCursor(d),this.updateCurrentAnnotation(!1,b),!0}return!1},getCurrentBlockIndex:function(){if(!this.iterator)return-1;var a=
this.iterator.cursor();return!a?-1:a.type==="block"?a.index:a.parent.index},getCurrentPosition:function(){if(!this.iterator)return{};var a=this.iterator.cursor();return a.type==="block"?{block:a.index+1}:{block:a.parent.index+1,change:a.index+1}},getCurrentMapperIndex:function(){var a=this.getCurrentBlockIndex();a<0&&(a=0);var b=this.getFeeder().getDiffBlocks();if(!b||b.length===0)return-1;a>b.length-1&&(a=0);return b[a][1]},replaceDiffAnnotations:function(a,b,c,d){if(b&&c&&(a=a.getAnnotationModel())){for(var f=
a.getAnnotations(0,a.getTextModel().getCharCount()),e=[];d&&f.hasNext();){var g=f.next();g.type===c&&e.push(g)}a.replaceAnnotations(e,b)}},updateCurrentAnnotation:function(a,b){this.replaceAllAnnotations(!0,0,"block",!1,[]);this.replaceAllAnnotations(!0,1,"block",!1,[]);this.replaceAllAnnotations(!0,0,"word",!1,[]);this.replaceAllAnnotations(!0,1,"word",!1,[]);if(this.iterator){var c=this.iterator.cursor();if(c){var d,f,e={start:c.oldA.start,end:c.oldA.end},g={start:c.newA.start,end:c.newA.end};c.type===
"word"?(d=this.editorWrapper[0].diffFeeder.getCurrentWordAnnoType(e,this.editorWrapper[0].editor.getTextView().getModel()),f=this.editorWrapper[1].diffFeeder.getCurrentWordAnnoType(g,this.editorWrapper[1].editor.getTextView().getModel())):(d=this.editorWrapper[0].diffFeeder.getCurrentBlockAnnoType(c.index),f=this.editorWrapper[1].diffFeeder.getCurrentBlockAnnoType(c.index));d&&this.replaceDiffAnnotations(this.editorWrapper[0].editor,[new (j.AnnotationType.getType(d.current))(e.start,e.end)],d,!0);
f&&this.replaceDiffAnnotations(this.editorWrapper[1].editor,[new (j.AnnotationType.getType(f.current))(g.start,g.end)],f,!0);if(a)this.autoSelecting=!0,this.editorWrapper[0].editor.setSelection(c.oldA.start,c.oldA.end,!0),this.editorWrapper[1].editor.setSelection(c.newA.start,c.newA.end,!0),this.autoSelecting=!1;else if(b)this.autoSelecting=!0,b!==this.editorWrapper[0].editor.getTextView()&&this.editorWrapper[0].editor.setSelection(c.oldA.start,c.oldA.end,!0),b!==this.editorWrapper[1].editor.getTextView()&&
this.editorWrapper[1].editor.setSelection(c.newA.start,c.newA.end,!0),this.autoSelecting=!1}}},generatePairBlockAnnotations:function(a,b){var c=this.generateBlockDiffAnnotations(0,b),d=this.generateBlockDiffAnnotations(1,b);return{parent:a,index:b,type:"block",oldA:c,newA:d}},generatePairWordAnnotations:function(a,b,c){var d=this.editorWrapper[0].diffFeeder.getTextOnBlock(b),f=this.editorWrapper[1].diffFeeder.getTextOnBlock(b),b=null,e=0,g=0;if(d&&f&&d.text&&f.text&&d.text.length<=5E3&&f.text.length<=
5E3)b=c.adaptCharDiff(d.text,f.text,this._charOrWordDiff==="word"),g=f.start,e=d.start;else return null;c=[];d=[];this.generateWordDiffAnnotations(0,c,e,b,2,3);this.generateWordDiffAnnotations(1,d,g,b,0,1);b=[];for(e=0;e<c.length;e++)b.push({parent:a,index:e,type:"word",oldA:c[e],newA:d[e]});return b},getAnnoModelList:function(a,b,c){for(var d=0;d<this.editorWrapper[a].annoTypes.length;d++)if(this.editorWrapper[a].annoTypes[d].type===b&&this.editorWrapper[a].annoTypes[d].normal===c)return this.editorWrapper[a].annoTypes[d].list;
return null},generateBlockDiffAnnotations:function(a,b){var c=this.editorWrapper[a].diffFeeder.getCurrentBlockAnnoType(b),d=this.getAnnoModelList(a,"block",c.normal),f=this.editorWrapper[a].diffFeeder.getCharRange(b),c=j.AnnotationType.createAnnotation(c.normal,f.start,f.end);d&&d.push(c);return c},generateWordDiffAnnotations:function(a,b,c,d,f,e){if(d)for(var g=this.editorWrapper[a].diffFeeder.getCurrentWordAnnoType({start:-1,end:-1}),a=this.getAnnoModelList(a,"word",g.normal),h=0;h<d.length;h++){var i=
j.AnnotationType.createAnnotation(g.normal,d[h][f]+c,d[h][e]+c);a.push(i);b.push(i)}},_updateOverviewRuler:function(){if(this._overviewRuler){var a=this.editorWrapper[0].editor.getTextView().getTopIndex();this.editorWrapper[0].editor.getTextView().redrawLines(a,a+1,this._overviewRuler)}},_updateCurveRuler:function(){this._curveRuler&&this._curveRuler.render()},_setTextViewPosition:function(a,b){var c=a.getLineHeight(),d=a.getClientArea(),c=Math.floor(d.height/c/3);a.setTopIndex(b-c>0?b-c:0)},_positionDiffBlock:function(){var a=
this.getCurrentBlockIndex();a<0&&(a=0);var b=this.getFeeder().getDiffBlocks();b.length!==0&&(this._setTextViewPosition(this.editorWrapper[0].editor.getTextView(),b[a][0]),this.editorWrapper[0].editor!==this.editorWrapper[1].editor&&(a=k.lookUpLineIndex(this.getMapper(),0,b[a][1]),this._setTextViewPosition(this.editorWrapper[1].editor.getTextView(),a)),this._updateOverviewRuler(),this._updateCurveRuler())},matchPositionFromOverview:function(a){this._initialized&&this.gotoBlock(a<0?0:k.getAnnotationIndex(this.getFeeder().getDiffBlocks(),
a))},gotoDiff:function(a,b){this.gotoChange(a,b)&&(this._updateOverviewRuler(),this._updateCurveRuler())},nextDiff:function(){this.iterateOnBlock(!0,!0);this._positionDiffBlock()},prevDiff:function(){this.iterateOnBlock(!1,!0);this._positionDiffBlock()},nextChange:function(){var a=this.iterateOnChange(!0);this._positionDiffBlock();return a},prevChange:function(){this.iterateOnChange(!1);this._positionDiffBlock()}};return c}();c.DiffBlockFeeder=function(){function a(){}a.prototype={getWordAnnoTypes:function(a){this._mapperColumnIndex===
0?a.push({type:"word",current:q,normal:m,list:[]}):a.push({type:"word",current:p,normal:s,list:[]});a.push({type:"word",current:r});a.push({type:"word",current:t});a.push({type:"word",current:o});a.push({type:"word",current:v})},getCurrentWordAnnoType:function(a,b){return a.start===a.end&&b?this._mapperColumnIndex===0?{current:this._repositionEmptyWord(a,b),normal:m}:{current:this._repositionEmptyWord(a,b),normal:s}:this._mapperColumnIndex===0?{current:q,normal:m}:{current:p,normal:s}},_repositionEmptyWord:function(a,
b){var c=b.getLineAtOffset(a.start),d=b.getLineStart(c),f=b.getLineEnd(c);if(d!==f){if(a.start===f)return a.start--,this._mapperColumnIndex===0?v:t;a.end++}else if(c>0&&(c--,d=b.getLineStart(c),f=b.getLineEnd(c),d!==f))return a.start=f-1,a.end=f,this._mapperColumnIndex===0?v:t;return this._mapperColumnIndex===0?o:r},getMapper:function(){return this._mapper},getDiffBlocks:function(){return this._diffBlocks},getDiffBlockH:function(a){if(!this._diffBlocks||this._diffBlocks.length===0)return-1;a=this._diffBlocks[a][1];
return a===-1?0:this._mapper[a][this._mapperColumnIndex]},getOverviewLineCount:function(){return this._textModel.getLineCount()},getLineNumber:function(a){return a},getCharRange:function(a){if(!this._diffBlocks||this._diffBlocks.length===0)return null;var b=this._diffBlocks[a][0],c=b+this._mapper[this._diffBlocks[a][1]][this._mapperColumnIndex]-1,a=this._textModel.getLineStart(b);if(c<b)return{start:a,end:a};b=this._textModel.getLineEnd(c,!0);return{start:a,end:b}},getTextOnBlock:function(a){if(!this._diffBlocks||
this._diffBlocks.length===0)return null;a=this.getCharRange(a);return{start:a.start,text:this._textModel.getText(a.start,a.end)}},isMapperEmpty:function(){return this._mapper.length===0}};return a}();c.TwoWayDiffBlockFeeder=function(){function e(a,b,c){this._mapperColumnIndex=c;this.init(a,b)}e.prototype=new c.DiffBlockFeeder;e.prototype.init=function(a,b){this._textModel=a;this._diffBlocks=void 0;if(b){this._mapper=b;this._diffBlocks=[];for(var c=0,d=0;d<this._mapper.length;d++)this._mapper[d][2]!==
0&&this._diffBlocks.push([c,d]),c+=this._mapper[d][this._mapperColumnIndex]}};e.prototype.getBlockAnnoTypes=function(c){this._mapperColumnIndex===0?c.push({type:"block",normal:b,current:a,list:[]}):c.push({type:"block",normal:i,current:f,list:[]});c.push({type:"block",normal:d,current:h,list:[]});c.push({type:"block",normal:l,current:n,list:[]})};e.prototype.getCurrentBlockAnnoType=function(c){if(!this._diffBlocks||this._diffBlocks.length===0||this._diffBlocks.length<=c)return null;c=this._diffBlocks[c][1];
if(this._mapper[c][this._mapperColumnIndex]===0)return{normal:d,current:h};else if(k.isMapperConflict(this.getMapper(),c))return{normal:l,current:n};else if(this._mapperColumnIndex===0)return{type:"block",normal:b,current:a,list:[]};return{type:"block",normal:i,current:f,list:[]}};return e}();c.inlineDiffBlockFeeder=function(){function d(a,b){this._mapperColumnIndex=b;this.init(a)}d.prototype=new c.DiffBlockFeeder;d.prototype.setModel=function(a){this._textModel=a};d.prototype.init=function(a){this._diffBlocks=
void 0;if(a){this._mapper=a;this._diffBlocks=[];this._gapBlocks=[];for(var b=a=0,c=0;c<this._mapper.length;c++){if(this._mapper[c][2]!==0){if(this._mapperColumnIndex===0){var d=a+this._mapper[c][1];this._diffBlocks.push([d,c]);this._gapBlocks.push([d,d+this._mapper[c][0],b])}else this._diffBlocks.push([a,c]),this._gapBlocks.push([a,a+this._mapper[c][1],b]);a+=this._mapper[c][0]+this._mapper[c][1]}else this._gapBlocks.push([a,a+this._mapper[c][this._mapperColumnIndex],b]),a+=this._mapper[c][this._mapperColumnIndex];
b+=this._mapper[c][this._mapperColumnIndex]}}};d.prototype.getBlockAnnoTypes=function(c){this._mapperColumnIndex===0?c.push({type:"block",normal:b,current:a,list:[]}):c.push({type:"block",normal:i,current:f,list:[]});c.push({type:"block",normal:l,current:n,list:[]})};d.prototype.getCurrentBlockAnnoType=function(c){if(!this._diffBlocks||this._diffBlocks.length===0)return null;c=this._diffBlocks[c][1];if(this._mapper[c][this._mapperColumnIndex]===0)return{current:q,normal:m};else if(k.isMapperConflict(this.getMapper(),
c))return{normal:l,current:n};else if(this._mapperColumnIndex===0)return{type:"block",normal:b,current:a,list:[]};return{type:"block",normal:i,current:f,list:[]}};d.prototype.getDiffBlockH=function(a){if(!this._diffBlocks||this._diffBlocks.length===0)return-1;a=this._diffBlocks[a][1];return this._mapper[a][0]+this._mapper[a][1]};d.prototype.getLineNumber=function(a){for(var b=0;b<this._gapBlocks.length;b++)if(this._gapBlocks[b][0]!==this._gapBlocks[b][1]&&a>=this._gapBlocks[b][0]&&a<this._gapBlocks[b][1])return a-
this._gapBlocks[b][0]+this._gapBlocks[b][2];return-1};return d}();return c});
define("orion/compare/compareView","i18n!orion/compare/nls/messages,orion/Deferred,orion/webui/littlelib,orion/compare/diffParser,orion/compare/compareRulers,orion/editor/editor,orion/editor/editorFeatures,orion/keyBinding,orion/editor/textView,orion/compare/compareUIFactory,orion/compare/compareUtils,orion/compare/jsdiffAdapter,orion/compare/diffTreeNavigator".split(","),function(g,k,j,e,c,b,a,i,f,d,h,l,n){var m={};m.CompareView=function(){function a(){this._diffParser=new e.DiffParser}a.prototype=
{_clearOptions:function(){this.options={};this.options.blockNumber=1;this.options.changeNumber=0},_getLineDelim:function(){return"\n"},_generateMapper:function(a,b,c,d,f){var e=this._getLineDelim(a,c);this._diffParser.setLineDelim(e);if(this.options.mapper&&this.options.toggler)return{delim:e,mapper:this.options.mapper,output:this.options.newFile.Content,diffArray:this.options.diffArray};if(typeof b==="string"&&typeof a==="string"){a=(new l.JSDiffAdapter).adapt(a,b,e);if(this.options.toggler)this.options.mapper=
a.mapper,this.options.newFile.Content=b,this.options.diffArray=a.changContents;return{delim:e,mapper:a.mapper,output:b,diffArray:a.changContents}}else{b=this._diffParser.parse(a,c,d,f);a=this._diffParser.getDiffArray();if(this.options.toggler)this.options.mapper=b.mapper,this.options.newFile.Content=b.outPutFile,this.options.diffArray=a;return{delim:e,mapper:b.mapper,output:b.outPutFile,diffArray:a}}},_initSyntaxHighlighter:function(a){this._syntaxHighlighters=null;if(this.options.highlighters&&this.options.highlighters.length>
0&&!(a.length<1||a.length>2))this._syntaxHighlighters=[{highlighter:this.options.highlighters[0],target:a[0]}],a.length===2&&this.options.highlighters.length===2&&this._syntaxHighlighters.push({highlighter:this.options.highlighters[1],target:a[1]})},_highlightSyntax:function(){if(this._syntaxHighlighters){var a=[];this._syntaxHighlighters.forEach(function(b){a.push(b.highlighter.highlight(b.target.fileName,b.target.contentType,b.target.editor))}.bind(this));k.all(a,function(a){return{_error:a}}).then(function(){this._diffNavigator.renderAnnotations();
this._diffNavigator.gotoBlock(this.options.blockNumber-1,this.options.changeNumber-1)}.bind(this))}else window.setTimeout(function(){this._diffNavigator.renderAnnotations();this._diffNavigator.gotoBlock(this.options.blockNumber-1,this.options.changeNumber-1)}.bind(this),50)},setOptions:function(a,b){b&&this._clearOptions();if(!this.options)this.options={};a&&Object.keys(a).forEach(function(b){this.options[b]=a[b]}.bind(this))},getOptions:function(){return this.options},getCurrentDiffPos:function(){return this._diffNavigator.getCurrentPosition()},
initDiffNav:function(){this._diffNavigator.gotoBlock(0,0)},nextDiff:function(){this._diffNavigator.nextDiff()},prevDiff:function(){this._diffNavigator.prevDiff()},nextChange:function(){return this._diffNavigator.nextChange()},prevChange:function(){this._diffNavigator.prevChange()},getWidget:function(){return this},startup:function(){this.initEditors();this.refresh(!0)},initEditors:function(){}};return a}();m.TwoWayCompareView=function(){function e(a){this.setOptions(a,!0);this._diffNavigator=new n.DiffTreeNavigator("word");
this.type="twoWay";this._uiFactory=this.options.uiFactory;if(!this._uiFactory)this._uiFactory=new d.TwoWayCompareUIFactory({parentDivID:this.options.parentDivId,showTitle:this.options.showTitle?this.options.showTitle:!1,showLineStatus:this.options.showLineStatus?this.options.showLineStatus:!1}),this._uiFactory.buildUI();this._viewLoadedCounter=0;this.options.commandProvider&&this.options.commandProvider.initCommands(this);this._curveRuler=new c.CompareCurveRuler(this._uiFactory.getDiffCanvasDiv())}
e.prototype=new m.CompareView;e.prototype.initEditors=function(a){this._editors=[];this._editors.push(this._createEditor(a,this._uiFactory.getEditorParentDiv(!1),this._uiFactory.getStatusDiv(!1),this.options.oldFile));this._editors.push(this._createEditor(a,this._uiFactory.getEditorParentDiv(!0),this._uiFactory.getStatusDiv(!0),this.options.newFile,!0));this._overviewRuler=new c.CompareOverviewRuler("right",{styleClass:"ruler overview"},null,function(a){this._diffNavigator.matchPositionFromOverview(a)}.bind(this));
window.onbeforeunload=function(){if(this._editors&&this._editors.some(function(a){return a.isDirty()}))return g["There are unsaved changes."]}.bind(this)};e.prototype.getEditors=function(){return this._editors};e.prototype.gotoDiff=function(a,b,c){c=c?this._editors[1].getTextView():this._editors[0].getTextView();this._diffNavigator.gotoDiff(c.getModel().getLineStart(a)+b,c)};e.prototype.copyToLeft=function(){this._curveRuler.copyTo(!0)};e.prototype.copyToRight=function(){this._curveRuler.copyTo(!1)};
e.prototype.resizeEditors=function(){this._editors.forEach(function(a){a.getTextView().resize()})};e.prototype.getSplitter=function(){return this._uiFactory.getSplitter()};e.prototype._createEditor=function(c,d,e,h,i){var j=typeof h.readonly==="undefined"?!0:h.readonly,k=function(){var a=new f.TextView({parent:d,readonly:j,tabSize:4});this._viewLoadedCounter++;this._viewLoadedCounter===2&&this._diffNavigator.matchPositionFromOverview(-1);if(this.onLoad)this.onLoad();var b=this.getSplitter();b&&b.addResizeListener(function(b){if(b){var c=
!1;(c=this._uiFactory.isLeftPane(b)?i:!i)&&a.resize()}}.bind(this));return a}.bind(this),l=h.keyBindingFactory;l||(l=new a.KeyBindingsFactory);var m=null;if(e)var n="",m=function(a,b){if(e)n=b?g["ERROR: "]+a:a,e.textContent=""+n};k=new b.Editor({textViewFactory:k,undoStackFactory:new a.UndoFactory,annotationFactory:new a.AnnotationFactory,keyBindingFactory:l,statusReporter:m,domNode:d});k.installTextView();k.setInput(null,null,h.Content?h.Content:c);k.setOverviewRulerVisible(!1);var q=k.getTextView();
q.addEventListener("Selection",function(a){a.newValue&&a.newValue.start!==a.newValue.end||!this._diffNavigator.autoSelecting&&this._diffNavigator.editorWrapper[0].diffFeeder&&this._diffNavigator.gotoDiff(q.getCaretOffset(),q)}.bind(this));q.getModel().addEventListener("Changed",function(a){if(!this._curveRuler.onChanged(a,!i))this.options.mapper=null}.bind(this));i?q.addEventListener("Scroll",function(){this._curveRuler&&(this._curveRuler.matchPositionFrom(!0),this._curveRuler.render());if(this.onScroll)this.onScroll()}.bind(this)):
q.addEventListener("Scroll",function(){this._curveRuler&&this._curveRuler.render()}.bind(this));return k};e.prototype.destroy=function(){this._editors&&(this._diffNavigator.destroy(),this._editors.forEach(function(a){a.destroy()}),this._uiFactory.destroy())};e.prototype.addRulers=function(){if(this._editors&&!this._hasRuler){var a=new c.LineNumberCompareRuler(this._diffNavigator,0,"left",{styleClass:"ruler lines"},{styleClass:"rulerLines odd"},{styleClass:"rulerLines even"}),b=new c.LineNumberCompareRuler(this._diffNavigator,
0,"left",{styleClass:"ruler lines"},{styleClass:"rulerLines odd"},{styleClass:"rulerLines even"});this._editors[1].getTextView().addRuler(a);this._editors[0].getTextView().addRuler(b);this._editors[0].getTextView().addRuler(this._overviewRuler);this._hasRuler=!0}};e.prototype.refresh=function(a){var b=this.options.oldFile.Content,c=this.options.newFile.Content,d=this.options.diffContent;typeof c==="string"?d=this._generateMapper(b,c,d,this.options.hasConflicts):(d=this._generateMapper(b,c,d,this.options.hasConflicts),
c=d.output);var f=new n.TwoWayDiffBlockFeeder(this._editors[0].getTextView().getModel(),d.mapper,1),e=new n.TwoWayDiffBlockFeeder(this._editors[1].getTextView().getModel(),d.mapper,0);this._diffNavigator.initAll(this.options.charDiff?"char":"word",this._editors[0],this._editors[1],f,e,this._overviewRuler,this._curveRuler);this._curveRuler.init(d.mapper,this._editors[1],this._editors[0],this._diffNavigator);a&&(this._editors[1].setInput(this.options.newFile.Name,null,c),this._editors[0].setInput(this.options.oldFile.Name,
null,b));this._initSyntaxHighlighter([{fileName:this.options.newFile.Name,contentType:this.options.newFile.Type,editor:this._editors[1]},{fileName:this.options.oldFile.Name,contentType:this.options.oldFile.Type,editor:this._editors[0]}]);this._highlightSyntax();this.options.commandProvider&&this.options.commandProvider.renderCommands(this);this.addRulers();this._viewLoadedCounter===2&&this._diffNavigator.gotoBlock(this.options.blockNumber-1,this.options.changeNumber-1);a=this._uiFactory.getTitleDiv(!0);
if((b=this._uiFactory.getTitleDiv(!1))&&a)j.empty(b),j.empty(a),b.appendChild(document.createTextNode(this.options.oldFile.Name)),a.appendChild(document.createTextNode(this.options.newFile.Name));a=this._editors[1].getTextView().getModel().getLineCount()*this._editors[1].getTextView().getLineHeight()+5;b=this._editors[0].getTextView().getModel().getLineCount()*this._editors[0].getTextView().getLineHeight()+5;return a>b?a:b};return e}();m.InlineCompareView=function(){function d(a){this.setOptions(a,
!0);this._diffNavigator=new n.DiffTreeNavigator("word");this.type="inline";this.options.commandProvider&&this.options.commandProvider.initCommands(this);this._editorDiv=this.options.parentDivId}d.prototype=new m.CompareView;d.prototype.addRulers=function(){if(this._textView&&!this._hasRuler)this._textView.addRuler(this._rulerOrigin),this._textView.addRuler(this._rulerNew),this._textView.addRuler(this._overviewRuler),this._hasRuler=!0};d.prototype.removeRulers=function(){if(this._textView&&this._hasRuler)this._textView.removeRuler(this._rulerOrigin),
this._textView.removeRuler(this._rulerNew),this._textView.removeRuler(this._overviewRuler),this._hasRuler=!1};d.prototype.destroyEditor=function(){this._textView&&(this._diffNavigator.destroy(),this._textView.setText(""),this.removeRulers())};d.prototype.destroy=function(){this._textView&&(this._diffNavigator.destroy(),this._textView.destroy())};d.prototype.initEditors=function(d){var e=j.node(this._editorDiv),g=function(){return new f.TextView({parent:e,readonly:!0,tabSize:4})}.bind(this);this._editor=
new b.Editor({textViewFactory:g,undoStackFactory:new a.UndoFactory,annotationFactory:new a.AnnotationFactory,domNode:e});this._editor.installTextView();this._editor.setInput(null,null,d);this._editor.setOverviewRulerVisible(!1);this._editor.setAnnotationRulerVisible(!1);this._textView=this._editor.getTextView();this._rulerOrigin=new c.LineNumberCompareRuler(this._diffNavigator,1,"left",{styleClass:"ruler lines"},{styleClass:"rulerLines odd"},{styleClass:"rulerLines even"});this._rulerNew=new c.LineNumberCompareRuler(this._diffNavigator,
0,"left",{styleClass:"ruler lines"},{styleClass:"rulerLines odd"},{styleClass:"rulerLines even"});this._overviewRuler=new c.CompareOverviewRuler("right",{styleClass:"ruler overview"},null,function(a){this._diffNavigator.matchPositionFromOverview(a)}.bind(this));this._textView.addEventListener("Selection",function(a){a.newValue&&a.newValue.start!==a.newValue.end||!this._diffNavigator.autoSelecting&&this._diffNavigator.editorWrapper[0].diffFeeder&&this._diffNavigator.gotoDiff(this._textView.getCaretOffset(),
this._textView)}.bind(this))};d.prototype._initDiffPosition=function(a){var b=a.getModel();if(b&&b.getAnnotations&&(b=b.getAnnotations(),b.length>0)){var b=b[0][0],c=a.getLineHeight(),d=a.getClientArea(),c=Math.floor(d.height/c/3);a.setTopIndex(b-c>0?b-c:0)}};d.prototype.refresh=function(){var a=this.options.oldFile.Content,b=this._generateMapper(a,this.options.newFile.Content,this.options.diffContent,this.options.hasConflicts,!this.options.toggler);this._textView.getModel().setText(a);var a=new n.inlineDiffBlockFeeder(b.mapper,
1),c=new n.inlineDiffBlockFeeder(b.mapper,0);h.mergeDiffBlocks(this._textView.getModel(),c.getDiffBlocks(),b.mapper,b.diffArray.array,b.diffArray.index,this._diffParser._lineDelimiter);a.setModel(this._textView.getModel());c.setModel(this._textView.getModel());this._diffNavigator.initAll(this.options.charDiff?"char":"word",this._editor,this._editor,a,c,this._overviewRuler);this._initSyntaxHighlighter([{fileName:this.options.oldFile.Name,contentType:this.options.oldFile.Type,editor:this._editor}]);
this._highlightSyntax();this.options.commandProvider&&this.options.commandProvider.renderCommands(this);this.addRulers();b=this._textView.getTopIndex();this._textView.redrawLines(b,b+1,this._overviewRuler);this._textView.redrawLines(b,b+1,this._rulerOrigin);this._textView.redrawLines(b,b+1,this._rulerNew);this._diffNavigator.gotoBlock(this.options.blockNumber-1,this.options.changeNumber-1);return this._textView.getLineHeight()*this._textView.getModel().getLineCount()+5};d.prototype.setConflicting=
function(a){this._conflcit=a};return d}();m.toggleableCompareView=function(){function a(b,c){if(c)c.toggler=this;this._widget=b==="inline"?new m.InlineCompareView(c):new m.TwoWayCompareView(c)}a.prototype={startup:function(){this._widget.startup()},toggle:function(){var a=this._widget.options,b=this._widget.getCurrentDiffPos();a.blockNumber=b.block;a.changeNumber=b.change;this._widget.destroy();j.empty(j.node(a.parentDivId));this._widget=this._widget.type==="inline"?new m.TwoWayCompareView(a):new m.InlineCompareView(a);
this._widget.initEditors();this._widget.refresh(!0)},getWidget:function(){return this._widget}};return a}();return m});
define("orion/editor/keywords",[],function(){return{JSKeywords:"break,case,class,catch,continue,const,debugger,default,delete,do,else,enum,export,extends,false,finally,for,function,if,implements,import,in,instanceof,interface,let,new,null,package,private,protected,public,return,static,super,switch,this,throw,true,try,typeof,undefined,var,void,while,with,yield".split(","),CSSKeywords:"alignment-adjust,alignment-baseline,animation,animation-delay,animation-direction,animation-duration,animation-iteration-count,animation-name,animation-play-state,animation-timing-function,appearance,azimuth,backface-visibility,background,background-attachment,background-clip,background-color,background-image,background-origin,background-position,background-repeat,background-size,baseline-shift,binding,bleed,bookmark-label,bookmark-level,bookmark-state,bookmark-target,border,border-bottom,border-bottom-color,border-bottom-left-radius,border-bottom-right-radius,border-bottom-style,border-bottom-width,border-collapse,border-color,border-image,border-image-outset,border-image-repeat,border-image-slice,border-image-source,border-image-width,border-left,border-left-color,border-left-style,border-left-width,border-radius,border-right,border-right-color,border-right-style,border-right-width,border-spacing,border-style,border-top,border-top-color,border-top-left-radius,border-top-right-radius,border-top-style,border-top-width,border-width,bottom,box-align,box-decoration-break,box-direction,box-flex,box-flex-group,box-lines,box-ordinal-group,box-orient,box-pack,box-shadow,box-sizing,break-after,break-before,break-inside,caption-side,clear,clip,color,color-profile,column-count,column-fill,column-gap,column-rule,column-rule-color,column-rule-style,column-rule-width,column-span,column-width,columns,content,counter-increment,counter-reset,crop,cue,cue-after,cue-before,cursor,direction,display,dominant-baseline,drop-initial-after-adjust,drop-initial-after-align,drop-initial-before-adjust,drop-initial-before-align,drop-initial-size,drop-initial-value,elevation,empty-cells,fit,fit-position,flex-align,flex-flow,flex-inline-pack,flex-order,flex-pack,float,float-offset,font,font-family,font-size,font-size-adjust,font-stretch,font-style,font-variant,font-weight,grid-columns,grid-rows,hanging-punctuation,height,hyphenate-after,hyphenate-before,hyphenate-character,hyphenate-lines,hyphenate-resource,hyphens,icon,image-orientation,image-rendering,image-resolution,inline-box-align,left,letter-spacing,line-height,line-stacking,line-stacking-ruby,line-stacking-shift,line-stacking-strategy,list-style,list-style-image,list-style-position,list-style-type,margin,margin-bottom,margin-left,margin-right,margin-top,mark,mark-after,mark-before,marker-offset,marks,marquee-direction,marquee-loop,marquee-play-count,marquee-speed,marquee-style,max-height,max-width,min-height,min-width,move-to,nav-down,nav-index,nav-left,nav-right,nav-up,opacity,orphans,outline,outline-color,outline-offset,outline-style,outline-width,overflow,overflow-style,overflow-x,overflow-y,padding,padding-bottom,padding-left,padding-right,padding-top,page,page-break-after,page-break-before,page-break-inside,page-policy,pause,pause-after,pause-before,perspective,perspective-origin,phonemes,pitch,pitch-range,play-during,position,presentation-level,punctuation-trim,quotes,rendering-intent,resize,rest,rest-after,rest-before,richness,right,rotation,rotation-point,ruby-align,ruby-overhang,ruby-position,ruby-span,size,speak,speak-header,speak-numeral,speak-punctuation,speech-rate,stress,string-set,table-layout,target,target-name,target-new,target-position,text-align,text-align-last,text-decoration,text-emphasis,text-height,text-indent,text-justify,text-outline,text-shadow,text-transform,text-wrap,top,transform,transform-origin,transform-style,transition,transition-delay,transition-duration,transition-property,transition-timing-function,unicode-bidi,vertical-align,visibility,voice-balance,voice-duration,voice-family,voice-pitch,voice-pitch-range,voice-rate,voice-stress,voice-volume,volume,white-space,white-space-collapse,widows,width,word-break,word-spacing,word-wrap,z-index".split(","),JAVAKeywords:"abstract,boolean,break,byte,case,catch,char,class,continue,default,do,double,else,extends,false,final,finally,float,for,if,implements,import,instanceof,int,interface,long,native,new,null,package,private,protected,public,return,short,static,super,switch,synchronized,this,throw,throws,transient,true,try,void,volatile,while".split(",")}});
define("examples/editor/textStyler",["orion/editor/annotations","orion/editor/keywords"],function(g,k){function j(a,b){this.keywords=a;this.whitespacesVisible=b;this.setText("")}function e(){j.call(this,null,!0)}function c(a){j.call(this,null,a)}function b(){j.call(this,null,!1)}function a(a,g,h){this.commentStart="/*";this.commentEnd="*/";var k=[];switch(g){case "java":k=f;break;case "js":k=i;break;case "css":k=d}this.whitespacesVisible=!1;this.detectHyperlinks=!0;this.highlightCaretLine=!1;this.detectTasks=
this.foldingEnabled=!0;this._scanner=new j(k,this.whitespacesVisible);this._firstScanner=new b;this._commentScanner=new c(this.whitespacesVisible);this._whitespaceScanner=new e;if(g==="css")this._scanner.isCSS=!0,this._firstScanner.isCSS=!0;this.view=a;this.annotationModel=h;this._bracketAnnotations=void 0;var l=this;this._listener={onChanged:function(a){l._onModelChanged(a)},onDestroy:function(a){l._onDestroy(a)},onLineStyle:function(a){l._onLineStyle(a)},onMouseDown:function(a){l._onMouseDown(a)},
onSelection:function(a){l._onSelection(a)}};g=a.getModel();g.getBaseModel&&(g=g.getBaseModel());g.addEventListener("Changed",this._listener.onChanged);a.addEventListener("MouseDown",this._listener.onMouseDown);a.addEventListener("Selection",this._listener.onSelection);a.addEventListener("Destroy",this._listener.onDestroy);a.addEventListener("LineStyle",this._listener.onLineStyle);this._computeComments();this._computeFolding();a.redrawLines()}var i=k.JSKeywords,f=k.JAVAKeywords,d=k.CSSKeywords,h={styleClass:"token_singleline_comment"},
l={styleClass:"token_multiline_comment"},n={styleClass:"token_doc_comment"},m={styleClass:"token_doc_html_markup"},q={styleClass:"token_task_tag"},s={styleClass:"token_doc_tag"},p={styleClass:"token_string"},r={styleClass:"token_number"},t={styleClass:"token_keyword"},o={styleClass:"token_space"},v={styleClass:"token_tab"},x={styleClass:"line_caret"};j.prototype={getOffset:function(){return this.offset},getStartOffset:function(){return this.startOffset},getData:function(){return this.text.substring(this.startOffset,
this.offset)},getDataLength:function(){return this.offset-this.startOffset},_default:function(a){switch(a){case 32:case 9:if(this.whitespacesVisible)return a===32?11:10;do a=this._read();while(a===32||a===9);this._unread(a);return 9;case 123:case 125:case 40:case 41:case 91:case 93:case 60:case 62:return a;default:var b=this.isCSS,c=this.offset-1;if(!b&&48<=a&&a<=57){var d=b=!1,f=!1,e=a;do if(a=this._read(),a===46&&!b)b=!0;else if(a===101&&!d)b=d=!0,a=this._read(),a!==45&&this._unread(a);else if(a===
120&&e===48&&this.offset-c===2)b=d=f=!0;else if(!(48<=a&&a<=57||f&&(65<=a&&a<=70||97<=a&&a<=102)))break;while(1);this._unread(a);return 3}if(97<=a&&a<=122||65<=a&&a<=90||a===95||45===a&&b){do a=this._read();while(97<=a&&a<=122||65<=a&&a<=90||a===95||48<=a&&a<=57||45===a&&b);this._unread(a);a=this.keywords;if(a.length>0){c=this.text.substring(c,this.offset);for(b=0;b<a.length;b++)if(this.keywords[b]===c)return 2}}return 1}},_read:function(){return this.offset<this.text.length?this.text.charCodeAt(this.offset++):
-1},_unread:function(a){a!==-1&&this.offset--},nextToken:function(){for(this.startOffset=this.offset;;){var a=this._read(),b;switch(a){case -1:return null;case 47:a=this._read();if(!this.isCSS&&a===47)for(;;)if(a=this._read(),a===-1||a===10||a===13)return this._unread(a),6;if(a===42){a=this._read();b=7;for(a===42&&(b=8);;){for(;a===42;)if(a=this._read(),a===47)return b;if(a===-1)return this._unread(a),b;a=this._read()}}this._unread(a);return 1;case 39:for(b=4;;)switch(a=this._read(),a){case 39:return b;
case 13:case 10:case -1:return this._unread(a),b;case 92:switch(a=this._read(),a){case 10:b=5;break;case 13:b=5,a=this._read(),a!==10&&this._unread(a)}}break;case 34:for(b=4;;)switch(a=this._read(),a){case 34:return b;case 13:case 10:case -1:return this._unread(a),b;case 92:switch(a=this._read(),a){case 10:b=5;break;case 13:b=5,a=this._read(),a!==10&&this._unread(a)}}break;default:return this._default(a)}}},setText:function(a){this.text=a;this.startOffset=this.offset=0}};e.prototype=new j(null);e.prototype.nextToken=
function(){for(this.startOffset=this.offset;;){var a=this._read();switch(a){case -1:return null;case 32:return 11;case 9:return 10;default:do a=this._read();while(!(a===32||a===9||a===-1));this._unread(a);return 1}}};c.prototype=new j(null);c.prototype.setType=function(a){this._type=a};c.prototype.nextToken=function(){for(this.startOffset=this.offset;;){var a=this._read();switch(a){case -1:return null;case 32:case 9:if(this.whitespacesVisible)return a===32?11:10;do a=this._read();while(a===32||a===
9);this._unread(a);return 9;case 60:if(this._type===8){do a=this._read();while(!(a===62||a===-1));if(a===62)return 12}return 1;case 64:if(this._type===8){do a=this._read();while(97<=a&&a<=122||65<=a&&a<=90||a===95||48<=a&&a<=57);this._unread(a);return 13}return 1;case 84:if((a=this._read())===79)if((a=this._read())===68)if((a=this._read())===79)if(a=this._read(),!(97<=a&&a<=122||65<=a&&a<=90||a===95||48<=a&&a<=57))return this._unread(a),14;this._unread(a);default:do a=this._read();while(!(a===32||
a===9||a===-1||a===60||a===64||a===84));this._unread(a);return 1}}};b.prototype=new j(null);b.prototype._default=function(a){for(;;)switch(a=this._read(),a){case 47:case 34:case 39:case -1:return this._unread(a),1}};a.prototype={destroy:function(){var a=this.view;if(a){var b=a.getModel();b.getBaseModel&&(b=b.getBaseModel());b.removeEventListener("Changed",this._listener.onChanged);a.removeEventListener("MouseDown",this._listener.onMouseDown);a.removeEventListener("Selection",this._listener.onSelection);
a.removeEventListener("Destroy",this._listener.onDestroy);a.removeEventListener("LineStyle",this._listener.onLineStyle);this.view=null}},setHighlightCaretLine:function(a){this.highlightCaretLine=a},setWhitespacesVisible:function(a){this.whitespacesVisible=a;this._scanner.whitespacesVisible=a;this._commentScanner.whitespacesVisible=a},setDetectHyperlinks:function(a){this.detectHyperlinks=a},setFoldingEnabled:function(a){this.foldingEnabled=a},setDetectTasks:function(a){this.detectTasks=a},_binarySearch:function(a,
b,c,d,f){var e;d===void 0&&(d=-1);if(f===void 0)f=a.length;for(;f-d>1;)if(e=Math.floor((f+d)/2),b<=a[e].start)f=e;else if(c&&b<a[e].end){f=e;break}else d=e;return f},_computeComments:function(){var a=this.view.getModel();a.getBaseModel&&(a=a.getBaseModel());this.comments=this._findComments(a.getText())},_computeFolding:function(){if(this.foldingEnabled){var a=this.view.getModel();if(a.getBaseModel){var b=this.annotationModel;if(b){b.removeAnnotations(g.AnnotationType.ANNOTATION_FOLDING);for(var c=
[],d=a.getBaseModel(),f=this.comments,e=0;e<f.length;e++){var h=f[e];(h=this._createFoldingAnnotation(a,d,h.start,h.end))&&c.push(h)}b.replaceAnnotations(null,c)}}}},_createFoldingAnnotation:function(a,b,c,d){var f=b.getLineAtOffset(c),b=b.getLineAtOffset(d);return f===b?null:new (g.AnnotationType.getType(g.AnnotationType.ANNOTATION_FOLDING))(c,d,a)},_computeTasks:function(a,b,c){if(this.detectTasks){var d=this.annotationModel;if(d){var f=this.view.getModel(),e=f;f.getBaseModel&&(e=f.getBaseModel());
for(var h=d.getAnnotations(b,c),f=[],i=g.AnnotationType.ANNOTATION_TASK;h.hasNext();){var j=h.next();j.type===i&&f.push(j)}h=[];j=this._commentScanner;j.setText(e.getText(b,c));for(var k;k=j.nextToken();){var l=j.getStartOffset()+b;k===14&&(k=e.getLineEnd(e.getLineAtOffset(l)),a!==6&&(k=Math.min(k,c-this.commentEnd.length)),h.push(g.AnnotationType.createAnnotation(i,l,k,e.getText(l,k))))}d.replaceAnnotations(f,h)}}},_getLineStyle:function(a){if(this.highlightCaretLine){var b=this.view,c=b.getModel(),
b=b.getSelection();if(b.start===b.end&&c.getLineAtOffset(b.start)===a)return x}return null},_getStyles:function(a,b,c){a.getBaseModel&&(c=a.mapOffset(c));for(var d=c+b.length,f=[],e=c,g=this.comments,h=this._binarySearch(g,c,!0);h<g.length;h++){if(g[h].start>=d)break;var i=g[h].start,j=g[h].end;e<i&&this._parse(b.substring(e-c,i-c),e,f);var k=g[h].type,m;switch(k){case 8:m=n;break;case 7:m=l;break;case 5:m=p}e=Math.max(e,i);i=Math.min(d,j);(k===8||k===7)&&(this.whitespacesVisible||this.detectHyperlinks)?
this._parseComment(b.substring(e-c,i-c),e,f,m,k):k===5&&this.whitespacesVisible?this._parseString(b.substring(e-c,i-c),e,f,p):f.push({start:e,end:i,style:m});e=j}e<d&&this._parse(b.substring(e-c,d-c),e,f);if(a.getBaseModel)for(b=0;b<f.length;b++)c=f[b].end-f[b].start,f[b].start=a.mapOffset(f[b].start,!0),f[b].end=f[b].start+c;return f},_parse:function(a,b,c){var d=this._scanner;for(d.setText(a);a=d.nextToken();){var f=d.getStartOffset()+b,e=null;switch(a){case 2:e=t;break;case 3:e=r;break;case 5:case 4:if(this.whitespacesVisible){this._parseString(d.getData(),
f,c,p);continue}else e=p;break;case 8:this._parseComment(d.getData(),f,c,n,a);continue;case 6:this._parseComment(d.getData(),f,c,h,a);continue;case 7:this._parseComment(d.getData(),f,c,l,a);continue;case 10:this.whitespacesVisible&&(e=v);break;case 11:this.whitespacesVisible&&(e=o)}c.push({start:f,end:d.getOffset()+b,style:e})}},_parseComment:function(a,b,c,d,f){var e=this._commentScanner;e.setText(a);for(e.setType(f);a=e.nextToken();){var f=e.getStartOffset()+b,g=d;switch(a){case 10:this.whitespacesVisible&&
(g=v);break;case 11:this.whitespacesVisible&&(g=o);break;case 12:g=m;break;case 13:g=s;break;case 14:g=q;break;default:this.detectHyperlinks&&(g=this._detectHyperlinks(e.getData(),f,c,g))}g&&c.push({start:f,end:e.getOffset()+b,style:g})}},_parseString:function(a,b,c,d){var f=this._whitespaceScanner;for(f.setText(a);a=f.nextToken();){var e=f.getStartOffset()+b,g=d;switch(a){case 10:this.whitespacesVisible&&(g=v);break;case 11:this.whitespacesVisible&&(g=o)}g&&c.push({start:e,end:f.getOffset()+b,style:g})}},
_detectHyperlinks:function(a,b,c,d){var f=null,e;if((e=a.indexOf("://"))>0){for(var f=a,g=e;g>0;){e=f.charCodeAt(g-1);if(!(97<=e&&e<=122||65<=e&&e<=90||45===e||48<=e&&e<=57))break;g--}if(g>0&&(e="\"\"''(){}[]<>".indexOf(f.substring(g-1,g)),e!==-1&&(e&1)===0&&(e=f.lastIndexOf("\"\"''(){}[]<>".substring(e+1,e+2)))!==-1)){var h=e;e=this._clone(d);e.tagName="a";e.attributes={href:f.substring(g,h)};c.push({start:b,end:b+g,style:d});c.push({start:b+g,end:b+h,style:e});c.push({start:b+h,end:b+a.length,style:d});
return null}}else a.toLowerCase().indexOf("bug#")===0&&(f="https://bugs.eclipse.org/bugs/show_bug.cgi?id="+parseInt(a.substring(4),10));return f?(e=this._clone(d),e.tagName="a",e.attributes={href:f},e):d},_clone:function(a){if(!a)return a;var b={},c;for(c in a)a.hasOwnProperty(c)&&(b[c]=a[c]);return b},_findComments:function(a,b){var b=b||0,c=this._firstScanner,d;c.setText(a);for(var f=[];d=c.nextToken();)(d===7||d===8||d===5)&&f.push({start:c.getStartOffset()+b,end:c.getOffset()+b,type:d}),(d===
6||d===7||d===8)&&this._computeTasks(d,c.getStartOffset()+b,c.getOffset()+b);return f},_findMatchingBracket:function(a,b){var c="{}()[]<>",d=a.getText(b,b+1),f=c.indexOf(d,0);if(f===-1)return-1;var e;e=f&1?c.substring(f-1,f):c.substring(f+1,f+2);for(var g=a.getLineAtOffset(b),c=a.getLine(g),h=a.getLineStart(g),i=a.getLineEnd(g),c=this._findBrackets(d,e,c,h,h,i),i=0;i<c.length;i++)if(h=c[i]>=0?1:-1,c[i]*h-1===b){var j=1;if(f&1){for(i--;i>=0;i--)if(h=c[i]>=0?1:-1,j+=h,j===0)return c[i]*h-1;for(g-=1;g>=
0;){c=a.getLine(g);h=a.getLineStart(g);i=a.getLineEnd(g);c=this._findBrackets(d,e,c,h,h,i);for(f=c.length-1;f>=0;f--)if(h=c[f]>=0?1:-1,j+=h,j===0)return c[f]*h-1;g--}}else{for(i++;i<c.length;i++)if(h=c[i]>=0?1:-1,j+=h,j===0)return c[i]*h-1;g+=1;for(f=a.getLineCount();g<f;){c=a.getLine(g);h=a.getLineStart(g);i=a.getLineEnd(g);c=this._findBrackets(d,e,c,h,h,i);for(i=0;i<c.length;i++)if(h=c[i]>=0?1:-1,j+=h,j===0)return c[i]*h-1;g++}}break}return-1},_findBrackets:function(a,b,c,d,f,e){for(var g=[],a=
a.charCodeAt(0),b=b.charCodeAt(0),h=f,i=this._scanner,j,k=this.comments,l=this._binarySearch(k,f,!0);l<k.length;l++){if(k[l].start>=e)break;j=k[l].start;var m=k[l].end;if(h<j)for(i.setText(c.substring(h-f,j-f));j=i.nextToken();)j===a?g.push(i.getStartOffset()+h-f+d+1):j===b&&g.push(-(i.getStartOffset()+h-f+d+1));h=m}if(h<e)for(i.setText(c.substring(h-f,e-f));j=i.nextToken();)j===a?g.push(i.getStartOffset()+h-f+d+1):j===b&&g.push(-(i.getStartOffset()+h-f+d+1));return g},_onDestroy:function(){this.destroy()},
_onLineStyle:function(a){if(a.textView===this.view)a.style=this._getLineStyle(a.lineIndex);a.ranges=this._getStyles(a.textView.getModel(),a.lineText,a.lineStart)},_onSelection:function(a){var b=a.oldValue,c=a.newValue,d=this.view,a=d.getModel(),f;if(this.highlightCaretLine){var e=a.getLineAtOffset(b.start);f=a.getLineAtOffset(c.start);var h=c.start===c.end,b=b.start===b.end;e===f&&b&&h||(b&&d.redrawLines(e,e+1),(e!==f||!b)&&h&&d.redrawLines(f,f+1))}if(this.annotationModel){var b=this._bracketAnnotations,
i,j;if(c.start===c.end&&(j=d.getCaretOffset())>0)j-=1,a.getBaseModel&&(j=a.mapOffset(j),a=a.getBaseModel()),a=this._findMatchingBracket(a,j),a!==-1&&(i=[g.AnnotationType.createAnnotation(g.AnnotationType.ANNOTATION_MATCHING_BRACKET,a,a+1),g.AnnotationType.createAnnotation(g.AnnotationType.ANNOTATION_CURRENT_BRACKET,j,j+1)]);this._bracketAnnotations=i;this.annotationModel.replaceAnnotations(b,i)}},_onMouseDown:function(a){if(a.clickCount===2){var b=this.view,c=b.getModel(),d=b.getOffsetAtLocation(a.x,
a.y);if(d>0){var f=d-1,e=c;c.getBaseModel&&(f=c.mapOffset(f),e=c.getBaseModel());f=this._findMatchingBracket(e,f);f!==-1&&(a.preventDefault(),a=f,c.getBaseModel&&(a=c.mapOffset(a,!0)),d>a&&(d--,a++),b.setSelection(a,d))}}},_onModelChanged:function(a){var b=a.start,c=a.removedCharCount,d=a.addedCharCount-c,f=this.view,a=f.getModel(),e=a.getBaseModel?a.getBaseModel():a,c=b+c,h=e.getCharCount(),i=this.comments.length,j=e.getLineStart(e.getLineAtOffset(b)),k=this._binarySearch(this.comments,j,!0),l=this._binarySearch(this.comments,
c,!1,k-1,i);k<i&&this.comments[k].start<=j&&j<this.comments[k].end?(j=this.comments[k].start,j>b&&(j+=d)):j=k===i&&i>0&&h-d===this.comments[i-1].end?this.comments[i-1].start:j;var m;l<i?(m=this.comments[l].end,m>b&&(m+=d),l+=1):(l=i,m=h);for(var n,h=this._findComments(e.getText(j,m),j),i=k;i<this.comments.length;i++)n=this.comments[i],n.start>b&&(n.start+=d),n.start>b&&(n.end+=d);var o=l-k!==h.length;if(!o)for(i=0;i<h.length;i++){n=this.comments[k+i];var q=h[i];if(n.start!==q.start||n.end!==q.end||
n.type!==q.type){o=!0;break}}i=[k,l-k].concat(h);Array.prototype.splice.apply(this.comments,i);o&&(i=j,n=m,a!==e&&(i=a.mapOffset(i,!0),n=a.mapOffset(n,!0)),f.redrawRange(i,n));if(this.foldingEnabled&&e!==a&&this.annotationModel){f=this.annotationModel;k=f.getAnnotations(j,m);j=[];for(m=[];k.hasNext();)if(n=k.next(),n.type===g.AnnotationType.ANNOTATION_FOLDING){m.push(n);for(i=0;i<h.length;i++)if(n.start===h[i].start&&n.end===h[i].end)break;i===h.length?(j.push(n),n.expand()):(i=n.start,l=n.end,i>
b&&(i-=d),l>b&&(l-=d),i<=b&&b<l&&i<=c&&c<l&&(i=e.getLineAtOffset(n.start),l=e.getLineAtOffset(n.end),i!==l?n.expanded||(n.expand(),f.modifyAnnotation(n)):f.removeAnnotation(n)))}b=[];for(i=0;i<h.length;i++){n=h[i];for(d=0;d<m.length;d++)if(m[d].start===n.start&&m[d].end===n.end)break;d===m.length&&(n=this._createFoldingAnnotation(a,e,n.start,n.end))&&b.push(n)}f.replaceAnnotations(j,b)}}};return{TextStyler:a}});
define("orion/editor/textMateStyler",["orion/editor/regex"],function(g){function k(c){var b;if(c instanceof Array){b=Array(c.length);for(var a=0;a<c.length;a++)b[a]=k(c[a])}else for(a in b={},c)if(Object.prototype.hasOwnProperty.call(c,a)){var e=c[a];b[a]=typeof e==="object"&&e!==null?k(e):e}return b}function j(c,b,a){this.initialize(c);this.grammar=k(b);this.externalGrammars=a?k(a):[];this._styles={};this._tree=null;this._allGrammars={};this.preprocess(this.grammar)}var e={unsupported:[{regex:/\(\?[ims\-]:/,
func:function(){return"option on/off for subexp"}},{regex:/\(\?<([=!])/,func:function(c){return c[1]==="="?"lookbehind":"negative lookbehind"}},{regex:/\(\?>/,func:function(){return"atomic group"}}],toRegExp:function(c){function b(a,b){throw Error('Unsupported regex feature "'+a+'": "'+b[0]+'" at index: '+b.index+" in "+b.input);}var a="",g,c=e.processGlobalFlag("x",c,function(a){for(var b="",c=!1,f=a.length,e=0;e<f;){var g=a.charAt(e);if(!c&&g==="#")for(;e<f&&g!=="\r"&&g!=="\n";)g=a.charAt(++e);
else if(!c&&/\s/.test(g))for(;e<f&&/\s/.test(g);)g=a.charAt(++e);else g==="\\"?(b+=g,/\s/.test(a.charAt(e+1))||(b+=a.charAt(e+1),e+=1)):(g==="["?c=!0:g==="]"&&(c=!1),b+=g),e+=1}return b}),c=e.processGlobalFlag("i",c,function(b){a+="i";return b});for(g=0;g<this.unsupported.length;g++){var f;(f=this.unsupported[g].regex.exec(c))&&b(this.unsupported[g].func(f),f)}return RegExp(c,a)},processGlobalFlag:function(c,b,a){function e(a,b){for(var c=0,f=a.length,g=-1,i=b;i<f&&g===-1;i++)switch(a.charAt(i)){case "\\":i++;
break;case "(":c++;break;case ")":c--,c===0&&(g=i)}return g}var f="(?"+c+")",c="(?"+c+":";if(b.substring(0,f.length)===f)return a(b.substring(f.length));else if(b.substring(0,c.length)===c){f=e(b,0);if(f<b.length-1)throw Error("Only a "+c+") group that encloses the entire regex is supported in: "+b);return a(b.substring(c.length,f))}return b},hasBackReference:function(c){return/\\\d+/.test(c.source)},getSubstitutedRegex:function(c,b,a){for(var a=typeof a==="undefined"?!0:!1,c=c.source.split(/(\\\d+)/g),
e=[],f=0;f<c.length;f++){var d=c[f],h=/\\(\d+)/.exec(d);h?(d=b[h[1]]||"",e.push(a?g.escape(d):d)):e.push(d)}return RegExp(e.join(""))},groupify:function(c,b){for(var a=c.source,e=a.length,f=[],d=0,g=[],j=1,k=1,m=[],q={},s={},p=0;p<e;p++){var r=f[f.length-1],t=a.charAt(p);switch(t){case "(":if(r===4)f.pop(),m.push(")"),g[g.length-1].end=p;var o=p+2<e?a.charAt(p+1)+""+a.charAt(p+2):null;if(o==="?:"||o==="?="||o==="?!"){var v;o==="?:"?v=1:(v=3,d++);f.push(v);g.push({start:p,end:-1,type:v});m.push(t);
m.push(o);p+=o.length}else f.push(2),g.push({start:p,end:-1,type:2,oldNum:j,num:k}),m.push(t),d===0&&(s[k]=null),q[j]=k,j++,k++;break;case ")":r=f.pop();r===3&&d--;g[g.length-1].end=p;m.push(t);break;case "*":case "+":case "?":case "}":var x=t,u=a.charAt(p-1),o=p-1;if(t==="}"){for(v=p-1;a.charAt(v)!=="{"&&v>=0;v--);u=a.charAt(v-1);o=v-1;x=a.substring(v,p+1)}v=g[g.length-1];if(u===")"&&(v.type===2||v.type===4)){m.splice(v.start,0,"(");m.push(x);m.push(")");t={start:v.start,end:m.length-1,type:4,num:v.num};
for(u=0;u<g.length;u++)if(r=g[u],(r.type===2||r.type===4)&&r.start>=v.start&&r.end<=o)if(r.start+=1,r.end+=1,r.num+=1,r.type===2)q[r.oldNum]=r.num;g.push(t);k++;break}default:t!=="|"&&r!==2&&r!==4&&d===0&&(f.push(4),g.push({start:p,end:-1,type:4,num:k}),m.push("("),s[k]=null,k++),m.push(t),t==="\\"&&(t=a.charAt(p+1),m.push(t),p+=1)}}for(;f.length;)f.pop(),m.push(")");var a=RegExp(m.join("")),e={},b=b||q,w;for(w in b)b.hasOwnProperty(w)&&(e[w]="\\"+b[w]);a=this.getSubstitutedRegex(a,e,!1);return[a,
q,s]},complexCaptures:function(c){if(!c)return!1;for(var b in c)if(c.hasOwnProperty(b)&&b!=="0")return!0;return!1}};j.prototype={initialize:function(c){this.textView=c;this.textView.stylerOptions=this;var b=this;this._listener={onModelChanged:function(a){b.onModelChanged(a)},onDestroy:function(a){b.onDestroy(a)},onLineStyle:function(a){b.onLineStyle(a)},onStorage:function(a){b.onStorage(a)}};c.addEventListener("ModelChanged",this._listener.onModelChanged);c.addEventListener("Destroy",this._listener.onDestroy);
c.addEventListener("LineStyle",this._listener.onLineStyle);c.redrawLines()},onDestroy:function(){this.destroy()},destroy:function(){if(this.textView)this.textView.removeEventListener("ModelChanged",this._listener.onModelChanged),this.textView.removeEventListener("Destroy",this._listener.onDestroy),this.textView.removeEventListener("LineStyle",this._listener.onLineStyle),this.textView=null;this._listener=this._tree=this._styles=this.grammar=null},preprocess:function(c){for(c=[c];c.length!==0;){var b=
c.pop();if(!b._resolvedRule||!b._typedRule)if(b._resolvedRule=this._resolve(b),b._typedRule=this._createTypedRule(b),this.addStyles(b.name),this.addStyles(b.contentName),this.addStylesForCaptures(b.captures),this.addStylesForCaptures(b.beginCaptures),this.addStylesForCaptures(b.endCaptures),b._resolvedRule!==b&&c.push(b._resolvedRule),b.patterns)for(var a=0;a<b.patterns.length;a++)c.push(b.patterns[a])}},addStyles:function(c){if(c&&!this._styles[c]){this._styles[c]=[];for(var b=c.split("."),a=0;a<
b.length;a++)this._styles[c].push(b.slice(0,a+1).join("-"))}},addStylesForCaptures:function(c){for(var b in c)c.hasOwnProperty(b)&&this.addStyles(c[b].name)},ContainerRule:function(){function c(b){this.rule=b;this.subrules=b.patterns}c.prototype.valueOf=function(){return"aa"};return c}(),BeginEndRule:function(){function c(b){this.rule=b;this.beginRegex=e.toRegExp(b.begin);this.endRegex=e.toRegExp(b.end);this.subrules=b.patterns||[];this.endRegexHasBackRef=e.hasBackReference(this.endRegex);var a=e.complexCaptures(b.captures),
b=e.complexCaptures(b.beginCaptures)||e.complexCaptures(b.endCaptures);if(this.isComplex=a||b)a=e.groupify(this.beginRegex),this.beginRegex=a[0],this.beginOld2New=a[1],this.beginConsuming=a[2],a=e.groupify(this.endRegex,this.beginOld2New),this.endRegex=a[0],this.endOld2New=a[1],this.endConsuming=a[2]}c.prototype.valueOf=function(){return this.beginRegex};return c}(),MatchRule:function(){function c(b){this.rule=b;this.matchRegex=e.toRegExp(b.match);if(this.isComplex=e.complexCaptures(b.captures))b=
e.groupify(this.matchRegex),this.matchRegex=b[0],this.matchOld2New=b[1],this.matchConsuming=b[2]}c.prototype.valueOf=function(){return this.matchRegex};return c}(),_createTypedRule:function(c){return c.match?new this.MatchRule(c):c.begin?new this.BeginEndRule(c):new this.ContainerRule(c)},_resolve:function(c){var b=c;if(c.include){if(c.begin||c.end||c.match)throw Error('Unexpected regex pattern in "include" rule '+c.include);c=c.include;if(c.charAt(0)==="#"){if(b=this.grammar.repository&&this.grammar.repository[c.substring(1)],
!b)throw Error("Couldn't find included rule "+c+" in grammar repository");}else if(c==="$self")b=this.grammar;else if(c==="$base")throw Error('Include "$base" is not supported');else if(b=this._allGrammars[c],!b)for(var a=0;a<this.externalGrammars.length;a++){var e=this.externalGrammars[a];if(e.scopeName===c){this.preprocess(e);b=this._allGrammars[c]=e;break}}}return b},ContainerNode:function(){function c(b,a){this.parent=b;this.rule=a;this.children=[];this.end=this.start=null}c.prototype.addChild=
function(b){this.children.push(b)};c.prototype.valueOf=function(){var b=this.rule;return"ContainerNode { "+(b.include||"")+" "+(b.name||"")+(b.comment||"")+"}"};return c}(),BeginEndNode:function(){function c(b,a,c){this.parent=b;this.rule=a;this.children=[];this.setStart(c);this.endMatch=this.end=null;this.endRegexSubstituted=a.endRegexHasBackRef?e.getSubstitutedRegex(a.endRegex,c):null}c.prototype.addChild=function(b){this.children.push(b)};c.prototype.getIndexInParent=function(){return this.parent?
this.parent.children.indexOf(this):-1};c.prototype.setStart=function(b){this.start=b.index;this.beginMatch=b};c.prototype.setEnd=function(b){b&&typeof b==="object"?(this.endMatch=b,this.end=b.index+b[0].length):(this.endMatch=null,this.end=b)};c.prototype.shiftStart=function(b){this.start+=b;this.beginMatch.index+=b};c.prototype.shiftEnd=function(b){this.end+=b;this.endMatch&&(this.endMatch.index+=b)};c.prototype.valueOf=function(){return"{"+this.rule.beginRegex+" range="+this.start+".."+this.end+
"}"};return c}(),push:function(c,b){if(b)for(var a=b.length;a>0;)c.push(b[--a])},exec:function(c,b,a){(b=c.exec(b))&&(b.index+=a);c.lastIndex=0;return b},afterMatch:function(c){return c.index+c[0].length},getEndMatch:function(c,b,a){if(c instanceof this.BeginEndNode){var e=c.rule,c=c.endRegexSubstituted||e.endRegex;return!c?null:this.exec(c,b,a)}return null},initialParse:function(){this.textView.getModel().getCharCount();this._tree=new this.ContainerNode(null,this.grammar._typedRule);this.parse(this._tree,
!1,0)},onModelChanged:function(c){var b=c.addedCharCount,a=c.removedCharCount,c=c.start;if(this._tree){var e=this.textView.getModel(),f=e.getCharCount(),e=e.getLineEnd(e.getLineAtOffset(c)-1),d=this.getFirstDamaged(e,e),e=e===-1?0:e,b=d?this.parse(d,!0,e,c,b,a):f;this.textView.redrawRange(e,b)}else this.initialParse()},getFirstDamaged:function(c,b){if(c<0)return this._tree;for(var a=[this._tree],e=null;a.length;){var f=a.pop();if(!f.parent||this.isDamaged(f,c,b)){f instanceof this.BeginEndNode&&(e=
f);for(var d=0;d<f.children.length;d++)a.push(f.children[d])}}return e||this._tree},isDamaged:function(c,b,a){return c.start<=a&&c.end>b},parse:function(c,b,a,e,f,d){var g=this.textView.getModel(),j=g.getLineStart(g.getLineCount()-1),k=g.getCharCount(),m=this.getInitialExpected(c,a),q=-1;if(b)c.repaired=!0,c.endNeedsUpdate=!0,q=(q=c.children[c.children.length-1])?g.getLineEnd(g.getLineAtOffset(q.end+(f-d))):-1,e=g.getLineEnd(g.getLineAtOffset(e+d)),q=Math.max(q,e);for(var q=q===-1?k:q,e=m,s=c,p=!1,
r=a,t=-1;s&&(!b||r<q);){var o=this.getNextMatch(g,s,r);o||(r=r>=j?k:g.getLineStart(g.getLineAtOffset(r)+1));var v=o&&o.match,x=o&&o.rule,u=o&&o.isEnd;if(o&&o.isSub){if(r=this.afterMatch(v),x instanceof this.BeginEndRule)p=!0,b&&x===e.rule&&s===e.parent?(s=e,s.setStart(v),s.repaired=!0,s.endNeedsUpdate=!0,e=this.getNextExpected(e,"begin")):(b&&(this.prune(s,e),b=!1),v=new this.BeginEndNode(s,x,v),s.addChild(v),s=v)}else if(u||r===k){if(s instanceof this.BeginEndNode)v?(p=!0,t=Math.max(t,s.end),s.setEnd(v),
r=this.afterMatch(v),b&&s===e&&s.parent===e.parent?(s.repaired=!0,delete s.endNeedsUpdate,e=this.getNextExpected(e,"end")):b&&(this.prune(s,e),b=!1)):(s.setEnd(k),delete s.endNeedsUpdate);s=s.parent}b&&r>=q&&!p&&(this.prune(c,m),b=!1)}this.removeUnrepairedChildren(c,b,a);this.cleanup(b,c,a,q,k,f,d);return b?Math.max(t,r):r},removeUnrepairedChildren:function(c,b,a){if(b){for(var b=c.children,e=-1,f=0;f<b.length;f++){var d=b[f];if(!d.repaired&&this.isDamaged(d,a,Number.MAX_VALUE)){e=f;break}}if(e!==
-1)c.children.length=e}},cleanup:function(c,b,a,e,f,d,g){if(c){c=d-g;f=this.getIntersecting(e-c+1,f);b=this.getIntersecting(a,e);for(a=0;a<f.length;a++)e=f[a],!e.repaired&&e instanceof this.BeginEndNode&&(e.shiftEnd(c),e.shiftStart(c));for(a=0;a<b.length;a++)e=b[a],e.repaired&&e.endNeedsUpdate&&e.shiftEnd(c),delete e.endNeedsUpdate,delete e.repaired}else{b=this.getIntersecting(a,e);for(a=0;a<b.length;a++)delete b[a].repaired}},getNextMatch:function(c,b,a,e){var f=c.getLineAtOffset(a),f=c.getLineEnd(f),
d=c.getText(a,f),g=[],j=[],c=[],f=[];for(this.push(g,b.rule.subrules);g.length;){var k=g.length?g.pop():null,k=k&&k._resolvedRule._typedRule;if(k instanceof this.ContainerRule&&j.indexOf(k)===-1)j.push(k),this.push(g,k.subrules);else if(!k||!e||k.matchRegex){var m=k&&this.exec(k.matchRegex||k.beginRegex,d,a);m&&(c.push(m),f.push(k))}}g=Number.MAX_VALUE;j=-1;for(k=0;k<c.length;k++)if(m=c[k],m.index<g)g=m.index,j=k;if(!e&&(a=this.getEndMatch(b,d,a)))if(e=b.rule.applyEndPatternLast,j===-1||a.index<g||
!e&&a.index===g)return{isEnd:!0,rule:b.rule,match:a};return j===-1?null:{isSub:!0,rule:f[j],match:c[j]}},getInitialExpected:function(c,b){var a,e;if(c===this._tree)for(a=0;a<c.children.length;a++){if(e=c.children[a],e.start>=b)return e}else if(c instanceof this.BeginEndNode&&c.endMatch){var f=c.endMatch.index;for(a=0;a<c.children.length;a++)if(e=c.children[a],e.start>=b)break;if(e&&e.start<f)return e}return c},getNextExpected:function(c,b){if(b==="begin"){var a=c.children[0];return a?a:c}else if(b===
"end"&&(a=c.parent)){var e=a.children[a.children.indexOf(c)+1];return e?e:a}return null},prune:function(c,b){if(b.parent===c)c.children.length=b.getIndexInParent();else if(c instanceof this.BeginEndNode)c.endMatch=null,c.end=null;if(c.parent)c.parent.children.length=c.getIndexInParent()+1},onLineStyle:function(c){this._tree||this.initialParse();var b=c.lineStart,a=this.textView.getModel(),e=a.getLineEnd(c.lineIndex),f=a.getLineEnd(a.getLineAtOffset(b)-1),f=this.getFirstDamaged(f,f),b=this.getLineScope(a,
f,b,e);c.ranges=this.toStyleRanges(b);c.ranges.sort(function(a,b){return a.start-b.start})},getLineScope:function(c,b,a,e){for(var f=a,d=this.getInitialExpected(b,a),g=[],j=[];b&&f<e;){var k=this.getNextMatch(c,b,f);if(!k)break;var m=k&&k.match,q=k&&k.rule,s=k&&k.isSub,k=k&&k.isEnd;m.index!==f&&j.push({start:f,end:m.index,node:b});if(s)f=this.afterMatch(m),q instanceof this.BeginEndRule?(this.addBeginScope(g,m,q),b=d,d=this.getNextExpected(d,"begin")):this.addMatchScope(g,m,q);else if(k)f=this.afterMatch(m),
this.addEndScope(g,m,q),d=this.getNextExpected(d,"end"),b=b.parent}f<e&&j.push({start:f,end:e,node:b});c=this.getInheritedLineScope(j,a,e);return g.concat(c)},getInheritedLineScope:function(c){for(var b=[],a=0;a<c.length;a++)for(var e=c[a],f=e.node;f;){var d=f.rule.rule,g=d.name;if(d=d.contentName||g){this.addScopeRange(b,e.start,e.end,d);break}f=f.parent}return b},addBeginScope:function(c,b,a){var e=a.rule;this.addCapturesScope(c,b,e.beginCaptures||e.captures,a.isComplex,a.beginOld2New,a.beginConsuming)},
addEndScope:function(c,b,a){var e=a.rule;this.addCapturesScope(c,b,e.endCaptures||e.captures,a.isComplex,a.endOld2New,a.endConsuming)},addMatchScope:function(c,b,a){var e=a.rule,f=e.name;(e=e.captures)?this.addCapturesScope(c,b,e,a.isComplex,a.matchOld2New,a.matchConsuming):this.addScope(c,b,f)},addScope:function(c,b,a){a&&c.push({start:b.index,end:this.afterMatch(b),scope:a})},addScopeRange:function(c,b,a,e){e&&c.push({start:b,end:a,scope:e})},addCapturesScope:function(c,b,a,e,f,d){if(a)if(e){for(var e=
{1:0},g=0,j=1;b[j]!==void 0;j++)d[j]!==void 0&&(g+=b[j].length),b[j+1]!==void 0&&(e[j+1]=g);d=b.index;for(g=1;a[g];g++){var j=a[g].name,k=f[g],m=d+e[k];typeof b[k]!=="undefined"&&this.addScopeRange(c,m,m+b[k].length,j)}}else this.addScope(c,b,a[0]&&a[0].name)},getIntersecting:function(c,b){for(var a=[],e=this._tree?[this._tree]:[];e.length;){var f=e.pop(),d=!1;f instanceof this.ContainerNode?d=!0:this.isDamaged(f,c,b)&&(d=!0,a.push(f));if(d)for(var d=f.children.length,g=0;g<d;g++)e.push(f.children[g])}return a.reverse()},
toStyleRanges:function(c){for(var b=[],a=0;a<c.length;a++){var e=c[a],f=this._styles[e.scope];if(!f)throw Error("styles not found for "+e.scope);f=f.join(" ");b.push({start:e.start,end:e.end,style:{styleClass:f}})}return b}};return{RegexUtil:e,TextMateStyler:j}});
define("orion/editor/AsyncStyler",["i18n!orion/editor/nls/messages","orion/editor/annotations"],function(g,k){function j(a){return a.getProperty("objectClass").indexOf(c)!==-1&&a.getProperty("type")==="highlighter"}function e(a,b,c){this.initialize(a,b,c);this.lineStyles=[]}var c="orion.edit.highlighter",b=c+" service must be an event emitter";k.AnnotationType.registerType("orion.annotation.highlightError",{title:g.syntaxError,html:"<div class='annotationHTML error'></div>",rangeStyle:{styleClass:"annotationRange error"}});
e.prototype={initialize:function(a,b,f){this.textView=a;this.serviceRegistry=b;this.annotationModel=f;this.services=[];var d=this;this.listener={onModelChanging:function(a){d.onModelChanging(a)},onModelChanged:function(a){d.onModelChanged(a)},onDestroy:function(a){d.onDestroy(a)},onLineStyle:function(a){d.onLineStyle(a)},onStyleReady:function(a){d.onStyleReady(a)},onServiceAdded:function(a){d.onServiceAdded(a.serviceReference,d.serviceRegistry.getService(a.serviceReference))},onServiceRemoved:function(a){d.onServiceRemoved(a.serviceReference,
d.serviceRegistry.getService(a.serviceReference))}};a.addEventListener("ModelChanging",this.listener.onModelChanging);a.addEventListener("ModelChanged",this.listener.onModelChanged);a.addEventListener("Destroy",this.listener.onDestroy);a.addEventListener("LineStyle",this.listener.onLineStyle);b.addEventListener("registered",this.listener.onServiceAdded);b.addEventListener("unregistering",this.listener.onServiceRemoved);a=b.getServiceReferences(c);for(f=0;f<a.length;f++){var e=a[f];j(e)&&this.addServiceListener(b.getService(e))}},
onDestroy:function(){this.destroy()},destroy:function(){if(this.textView)this.textView.removeEventListener("ModelChanging",this.listener.onModelChanging),this.textView.removeEventListener("ModelChanged",this.listener.onModelChanged),this.textView.removeEventListener("Destroy",this.listener.onDestroy),this.textView.removeEventListener("LineStyle",this.listener.onLineStyle),this.textView=null;if(this.services){for(var a=0;a<this.services.length;a++)this.removeServiceListener(this.services[a]);this.services=
null}if(this.serviceRegistry)this.serviceRegistry.removeEventListener("registered",this.listener.onServiceAdded),this.serviceRegistry.removeEventListener("unregistering",this.listener.onServiceRemoved),this.serviceRegistry=null;this.lineStyles=this.listener=null},onModelChanging:function(a){this.startLine=this.textView.getModel().getLineAtOffset(a.start)},onModelChanged:function(a){var b=this.startLine;(a.addedLineCount||a.removedLineCount)&&Array.prototype.splice.apply(this.lineStyles,[b,a.removedLineCount].concat(this._getEmptyStyle(a.addedLineCount)))},
onStyleReady:function(a){var b=a.lineStyles||a.style,a=Number.MAX_VALUE,c=-1,d=this.textView.getModel(),e;for(e in b)b.hasOwnProperty(e)&&(this.lineStyles[e]=b[e],a=Math.min(a,e),c=Math.max(c,e));a=Math.max(a,0);c=Math.min(c,d.getLineCount());if(b=this.annotationModel){for(var g=b.getAnnotations(d.getLineStart(a),d.getLineEnd(c)),j=[];g.hasNext();){var m=g.next();m.type==="orion.annotation.highlightError"&&j.push(m)}g=[];for(m=a;m<=c;m++){e=m;var q=this.lineStyles[e],q=q&&q.errors;e=d.getLineStart(e);
if(q)for(var s=0;s<q.length;s++){var p=q[s];g.push(k.AnnotationType.createAnnotation("orion.annotation.highlightError",p.start+e,p.end+e))}}b.replaceAnnotations(j,g)}this.textView.redrawLines(a,c+1)},onLineStyle:function(a){function b(a,c){for(var f=a.length,e=[],g=0;g<f;g++){var i=a[g];e.push({start:i.start+c,end:i.end+c,style:i.style})}return e}var c=this.lineStyles[a.lineIndex];if(c)if(c.ranges)a.ranges=b(c.ranges,a.lineStart);else if(c.style)a.style=c.style},_getEmptyStyle:function(a){for(var b=
[],c=0;c<a;c++)b.push(null);return b},setContentType:function(a){this.contentType=a;if(this.services)for(a=0;a<this.services.length;a++){var b=this.services[a];if(b.setContentType){var c=this.serviceRegistry.getService("orion.page.progress");c?c.progress(b.setContentType(this.contentType),"Styling content type: "+this.contentType.id?this.contentType.id:this.contentType):b.setContentType(this.contentType)}}},onServiceAdded:function(a,b){j(a)&&this.addServiceListener(b)},onServiceRemoved:function(a,
b){this.services.indexOf(b)!==-1&&this.removeServiceListener(b)},addServiceListener:function(a){if(typeof a.addEventListener==="function"){if(a.addEventListener("orion.edit.highlighter.styleReady",this.listener.onStyleReady),this.services.push(a),a.setContentType&&this.contentType){var c=this.serviceRegistry.getService("orion.page.progress");c?c.progress(a.setContentType(this.contentType),"Styling content type: "+this.contentType.id?this.contentType.id:this.contentType):a.setContentType(this.contentType)}}else typeof console!==
"undefined"&&console.log(Error(b))},removeServiceListener:function(a){typeof a.removeEventListener==="function"?(a.removeEventListener("orion.edit.highlighter.styleReady",this.listener.onStyleReady),a=this.services.indexOf(a),a!==-1&&this.services.splice(a,1)):typeof console!=="undefined"&&console.log(Error(b))}};return e});
define("orion/highlight",["examples/editor/textStyler","orion/editor/textMateStyler","orion/editor/AsyncStyler","orion/Deferred"],function(g,k,j,e){function c(a,b,c,d,h,l,n){function m(a,d){var g=a.getProperty("contentType"),h=a.getProperty("fileTypes");if(g)return b.isSomeExtensionOf(c,g).then(function(b){return b?a:null});else if(d&&h&&h.indexOf(d)!==-1)return g=new e,g.resolve(a),g;return null}var q=function(a){var b=null;switch(a&&a.id){case "application/javascript":case "application/json":b=
new g.TextStyler(d,"js",h);break;case "text/x-java-source":b=new g.TextStyler(d,"java",h);break;case "text/css":b=new g.TextStyler(d,"css",h)}return b}(c);if(q)return l=new e,l.resolve(q),l;for(var q=l&&l.split(".").pop().toLowerCase(),l=a.getServiceReferences("orion.edit.highlighter"),s=[],p=[],r=0;r<l.length;r++){var t=l[r];t.getProperty("type")==="grammar"&&s.push(t.getProperty("grammar"));(t=m(t,q))&&p.push(t)}return e.all(p,function(a){return{_error:a}}).then(function(b){for(var e,g=b.length-
1;g>=0;g--){var i=b[g];if(i&&!i._error&&(n||i.getProperty("type")!=="highlighter")){e=i;break}}var l;if(e)if(b=e.getProperty("type"),b==="highlighter")l=new j(d,a,h),l.setContentType(c);else if(b==="grammar"||typeof b==="undefined")e=e.getProperty("grammar"),l=new k.TextMateStyler(d,e,s);return l})}function b(a){this.serviceRegistry=a;this.styler=null}b.prototype={setup:function(a,b,f,d,e){e=typeof e==="undefined"?!0:e;if(this.styler)this.styler.destroy&&this.styler.destroy(),this.styler=null;var g=
this;return c(this.serviceRegistry,this.serviceRegistry.getService("orion.core.contenttypes"),a,b,f,d,e).then(function(a){return g.styler=a})},getStyler:function(){return this.styler}};return{createStyler:c,SyntaxHighlighter:b}});
define("orion/searchAndReplace/textSearcher",["i18n!orion/search/nls/messages","orion/editor/find","orion/commands","orion/objects","orion/webui/littlelib"],function(g,k,j,e,c){function b(a,b,c,d){k.Find.call(this,a,c,d);this._commandService=b}b.prototype=new k.Find;e.mixin(b.prototype,{getFindString:function(){var a=document.getElementById("localSearchFindWith");return!a?k.Find.prototype.getFindString.call(this):a.value},getReplaceString:function(){var a=document.getElementById("localSearchReplaceWith");
return!a?k.Find.prototype.getReplaceString(this):a.value},hide:function(){var a=this.isVisible();k.Find.prototype.hide.call(this);a&&this._commandService.closeParameterCollector()},show:function(a){k.Find.prototype.show.call(this,a);var b=a.findString,a=a.replaceString,c=document.getElementById("localSearchFindWith");c||(this._createActionTable(),c=document.getElementById("localSearchFindWith"));if(b)c.value=b;if(a)document.getElementById("localSearchReplaceWith").value=a;window.setTimeout(function(){c.select();
c.focus()},10)},_createActionTable:function(){var a=this;this._commandService.openParameterCollector("pageNavigationActions",function(b){var c=document.createElement("input");c.type="text";c.name=g["Find:"];c.className="parameterInput";c.id="localSearchFindWith";c.placeholder=g["Find With"];c.oninput=function(b){return a._handleInput(b)};c.onkeydown=function(b){return a._handleKeyDown(b)};b.appendChild(c);a._createButton("Next",b,function(){a.find(!0)});a._createButton("Previous",b,function(){a.find(!1)});
var d=a._editor.getTextView().getOptions("readonly");if(!d){var e=document.createElement("input");e.type="text";e.name=g["ReplaceWith:"];e.className="parameterInput";e.id="localSearchReplaceWith";e.placeholder=g["Replace With"];e.onkeydown=function(b){return a._handleKeyDown(b)};b.appendChild(e);a._createButton(g.Replace,b,function(){a.replace()});a._createButton(g["Replace All"],b,function(){a.replaceAll()})}e=document.createElement("div");b.appendChild(e);e.classList.add("findOptionsDiv");var k=
j.createDropdownMenu(e,g.Options,null,"dismissButton",null,!0);k.menuButton.classList.add("parameterInlineButton");j.createCheckedMenuItem(k.menu,g["Show all"],a._showAll,function(b){a.setOptions({showAll:b.target.checked});k.dropdown.close(!0)});j.createCheckedMenuItem(k.menu,g["Case sensitive"],!a._caseInsensitive,function(b){a.setOptions({caseInsensitive:!b.target.checked});k.dropdown.close(!0);a.find(!0)});j.createCheckedMenuItem(k.menu,g["Wrap search"],a._wrap,function(b){a.setOptions({wrap:b.target.checked});
k.dropdown.close(!0)});j.createCheckedMenuItem(k.menu,g["Incremental search"],a._incremental,function(b){a.setOptions({incremental:b.target.checked});k.dropdown.close(!0)});j.createCheckedMenuItem(k.menu,g["Whole Word"],a._wholeWord,function(b){a.setOptions({wholeWord:b.target.checked});k.dropdown.close(!0);a.find(!0)});j.createCheckedMenuItem(k.menu,g["Regular expression"],a._regex,function(b){a.setOptions({regex:b.target.checked});k.dropdown.close(!0);a.find(!0)});d||j.createCheckedMenuItem(k.menu,
g["Find after replace"],a._findAfterReplace,function(b){a.setOptions({findAfterReplace:b.target.checked});k.dropdown.close(!0)});return c},function(){a.hide()})},_createButton:function(a,b,f){var d=document.createElement("button");d.addEventListener("click",f.bind(this),!1);var e=this;d.addEventListener("keydown",function(a){a.keyCode===c.KEY.ESCAPE&&e.hide()});d.appendChild(document.createTextNode(a));d.className="dismissButton parameterInlineButton";b.appendChild(d)},_handleInput:function(){this._incremental&&
this.find(!0,null,!0);return!0},_handleKeyDown:function(a){var b=(this.isMac?a.metaKey:a.ctrlKey)&&!a.altKey&&!a.shiftKey;if(b&&a.keyCode===70)return a.stopPropagation&&a.stopPropagation(),a.cancelBubble=!0,!1;if((this.isMac?a.metaKey:a.ctrlKey)&&!a.altKey&&a.keyCode===75||a.keyCode===13)return a.stopPropagation&&a.stopPropagation(),a.cancelBubble=!0,a.keyCode===13?this.find(this._reverse?a.shiftKey:!a.shiftKey):this.find(!a.shiftKey),!1;if(b&&a.keyCode===82)return a.stopPropagation&&a.stopPropagation(),
a.cancelBubble=!0,this.replace(),!1;return a.keyCode===27?(this.hide(),!1):!0}});return{TextSearcher:b}});
define("orion/edit/nls/root/messages",{Fetching:"Fetching: ${0}","An error occurred: ":"An error occurred: ","No File Selected":"No File Selected","There are unsaved changes.  Do you still want to navigate away?":"There are unsaved changes.  Do you still want to navigate away?","Search Files":"Search Files","Enter search term:":"Enter search term:","Toggle Outliner":"Toggle Outliner","There are unsaved changes.":"There are unsaved changes.",Save:"Save","Resource is out of sync with the server. Do you want to save it anyway?":"Resource is out of sync with the server. Do you want to save it anyway?",
loadOutOfSync:"Resource is out of sync with the server. Do you want to load it anyway? This will overwrite your local changes.","Reading metedata of":"Reading metedata of ${0}",Reading:"Reading ${0}","Save this file":"Save this file","Go to Line":"Go to Line","Go to specified line number":"Go to specified line number","Go to line:":"Go to line:",Undo:"Undo",Redo:"Redo",Find:"Find","No response from server.  Check your internet connection and try again.":"No response from server.  Check your internet connection and try again.",
"Saving file {0}":"Saving file ${0}","Running {0}":"Running ${0}","Saving...":"Saving...",View:"View",ViewTooltip:"View",Actions:"Actions",Navigator:"Navigator",New:"New",NoFile:"Use the ${0} to create new files and folders. Click a file to start coding."});define("orion/edit/nls/messages",["orion/i18n!orion/edit/nls/messages","orion/edit/nls/root/messages"],function(g,k){var j={root:k};Object.keys(g).forEach(function(e){typeof j[e]==="undefined"&&(j[e]=g[e])});return j});
define("orion/editorCommands","i18n!orion/edit/nls/messages,orion/i18nUtil,orion/webui/littlelib,orion/webui/dialogs/OpenResourceDialog,orion/Deferred,orion/URITemplate,orion/commands,orion/keyBinding,orion/commandRegistry,orion/globalCommands,orion/extensionCommands,orion/contentTypes,orion/editor/undoStack,orion/searchUtils,orion/PageUtil,orion/PageLinks,orion/util".split(","),function(g,k,j,e,c,b,a,i,f,d,h,l,n,m,q,s,p){function r(a,b,c,d,f,e,g,h,i,j){this.serviceRegistry=a;this.commandService=
b;this.fileClient=c;this.inputManager=d;this.toolbarId=f;this.pageNavId=g;this.isReadOnly=e;this._localSearcher=h;this._searcher=i;this.editorSettings=j}var d={},t=null;r.prototype={generateEditorCommands:function(a){this._generateSearchFilesCommand(a);this.isReadOnly||(this._generateUndoStackCommands(a),this._generateSaveCommand(a));this._generateGotoLineCommnand(a);this._generateFindCommnand(a);this.isReadOnly||this._generateEditCommands(a)},_generateUndoStackCommands:function(b){this.commandService.addCommand(new a.Command({name:g.Undo,
id:"orion.undo",callback:function(){b.getTextView().invokeAction("undo")}}));this.commandService.registerCommandContribution(this.toolbarId,"orion.undo",400,null,!0,b.getTextView().getKeyBindings("undo")[0]);this.commandService.addCommand(new a.Command({name:g.Redo,id:"orion.redo",callback:function(){b.getTextView().invokeAction("redo")}}));this.commandService.registerCommandContribution(this.toolbarId,"orion.redo",401,null,!0,b.getTextView().getKeyBindings("redo")[0])},_generateSearchFilesCommand:function(b){var c=
this;if(c._searcher){var d=!1,f=new a.Command({name:g["Search Files"],tooltip:g["Search Files"],id:"orion.searchFiles",callback:function(){b.getTextView().invokeAction("searchFiles")}});this.commandService.addCommand(f);this.commandService.registerCommandContribution(this.pageNavId,"orion.searchFiles",1,null,!0,new i.KeyBinding("h",!0));b.getTextView().setKeyBinding(new i.KeyBinding("h",!0),"searchFiles");b.getTextView().setAction("searchFiles",function(){if(!d){var a=b.getSelection(),a=b.getText(a.start,
a.end),f=c.serviceRegistry,h=f.getService("orion.page.progress"),f=f.getService("orion.core.favorite"),i=new e.OpenResourceDialog({searcher:c._searcher,progress:h,favoriteService:f,searchRenderer:c._searcher.defaultRenderer,nameSearch:!1,title:g["Search Files"],message:g["Enter search term:"],initialText:a,onHide:function(){d=!1;b&&b.getTextView()&&b.getTextView().focus()}});window.setTimeout(function(){d=!0;i.show(j.node(c.toolbarId))},0);return!0}},f)}},_generateSaveCommand:function(b){var c=this;
b.getTextView().setKeyBinding(new i.KeyBinding("s",!0),"save");b.getTextView().setAction("save",function(){if(c.inputManager.save)c.inputManager.save();else if(c.inputManager.onSave){var a=b.getText();c.inputManager.onSave(c.inputManager.getInput(),a,function(){b.setInput(c.inputManager.getInput(),null,a,!0);c.inputManager.afterSave&&c.inputManager.afterSave()},function(a){a.log=!0})}return!0},{name:g.Save});this.commandService.addCommand(new a.Command({name:g.Save,tooltip:g["Save this file"],id:"orion.save",
visibleWhen:function(){return!c.editorSettings||!c.editorSettings().autoSaveEnabled},callback:function(){b.getTextView().invokeAction("save")}}));this.commandService.registerCommandContribution(this.toolbarId,"orion.save",1,null,!1,new i.KeyBinding("s",!0))},_generateGotoLineCommnand:function(b){var c=this,d=new f.ParametersDescription([new f.CommandParameter("line","number","Line:")],{hasOptionalParameters:!1},function(){var a=b.getModel().getLineAtOffset(b.getCaretOffset())+1;return[new f.CommandParameter("line",
"number","Line:",a.toString())]}),d=new a.Command({name:g["Go to Line"],tooltip:g["Go to specified line number"],id:"orion.gotoLine",parameters:d,callback:function(a){var c=b.getModel();a.parameters&&a.parameters.valueFor("line")?a=a.parameters.valueFor("line"):(a=c.getLineAtOffset(b.getCaretOffset()),(a=prompt(g["Go to line:"],a+1))&&(a=parseInt(a,10)));if(a)b.onGotoLine(a-1,0)}});this.commandService.addCommand(d);this.commandService.registerCommandContribution(this.pageNavId,"orion.gotoLine",1,
null,!0,new i.KeyBinding("l",!p.isMac,!1,!1,p.isMac),new f.URLBinding("gotoLine","line"));b.getTextView().setAction("gotoLine",function(a){if(a)return b.onGotoLine(a.line-1,0,void 0,a.callback),!0;c.commandService.runCommand("orion.gotoLine");return!0},d)},_generateFindCommnand:function(b){var c=this,d=new f.ParametersDescription([new f.CommandParameter("find","text","Find:")],{clientCollect:!0},function(){var a=b.getSelection(),c="";a.end>a.start&&(c=b.getModel().getText(a.start,a.end));return[new f.CommandParameter("find",
"text","Find:",c)]}),d=new a.Command({name:g.Find,tooltip:g.Find,id:"orion.editor.find",parameters:d,callback:function(a){if(c._localSearcher){var d="",f=null,e=b.getSelection();e.end>e.start?d=b.getModel().getText(e.start,e.end):a.parameters&&a.parameters.valueFor("find")&&(d=a.parameters.valueFor("find"),f=q.matchResourceParameters(),m.convertFindURLBinding(f));if(f){a={regex:f.regEx,caseInsensitive:!f.caseSensitive};if(f.atLine)a.start=b.getModel().getLineStart(f.atLine-1);c._localSearcher.show({findString:d,
replaceString:f.replaceWith});c._localSearcher.find(!0,a)}else c._localSearcher.show({findString:d});return!0}return!1}});this.commandService.addCommand(d);this.commandService.registerCommandContribution(this.pageNavId,"orion.editor.find",2,null,!0,new i.KeyBinding("f",!0),new f.URLBinding("find","find"));b.getTextView().setAction("find",function(a){if(a)return c._localSearcher.show(a),!0;c.commandService.runCommand("orion.editor.find");return!0},d)},_generateEditCommands:function(d){function f(a){var b=
new i.KeyBinding;i.KeyBinding.apply(b,a);return b}function e(a,b){!b&&a&&typeof a.HTML!=="undefined"&&delete a.HTML;var c=m.serviceRegistry.getService("orion.page.message");c?c.setProgressResult(a):window.console.log(a)}var m=this,n=this.serviceRegistry.getServiceReferences("orion.edit.command"),q=this.inputManager,p=this.serviceRegistry.getService("orion.page.progress"),r=function(c,f,h){h.callback=function(){d=this;var a=d.getSelection(),h=d.getModel(),i=h.getText(),j=function(b){b&&b.text?(d.setText(b.text),
b.selection&&(d.setSelection(b.selection.start,b.selection.end),d.getTextView().focus())):typeof b==="string"&&(d.setText(b,a.start,a.end),d.setSelection(a.start,a.start+b.length),d.getTextView().focus())};p.showWhile(f.run(h.getText(a.start,a.end),i,a,q.getInput()),k.formatMessage(g["Running {0}"],c.name)).then(function(a){if(a&&a.uriTemplate){var d=new b(a.uriTemplate),f=q.getFileMetadata();f.OrionHome=f.OrionHome||s.getOrionHome();var d=window.decodeURIComponent(d.expand(f)),g=document.createElement("iframe");
g.id=c.id;g.name=c.id;g.type="text/html";g.sandbox="allow-scripts allow-same-origin";g.frameborder=1;g.src=d;g.className="delegatedUI";if(a.width)g.style.width=a.width;if(a.height)g.style.height=a.height;g.style.visibility="hidden";window.document.body.appendChild(g);g.style.left=(window.innerWidth-parseInt(g.clientWidth,10))/2+"px";g.style.top=(window.innerHeight-parseInt(g.clientHeight,10))/2+"px";g.style.visibility="";window.addEventListener("message",function H(a){if(a.source===g.contentWindow&&
typeof a.data==="string"&&(a=JSON.parse(a.data),a.pageService==="orion.page.delegatedUI"&&a.source===c.id)){if(!a.cancelled)if(a.result)j(a.result);else if(a.Status||a.status)e(a.Status||a.status);window.removeEventListener("message",H,!1);window.document.body.removeChild(g)}},!1)}else a.Status||a.status?e(a.Status||a.status):j(a)});return!0};h.callback=h.callback.bind(d);return new a.Command(h)};c.when(function(a){if(t)return t;var b=a.getService("orion.core.contenttypes");b||(b=new l.ContentTypeService(a),
b=a.getService("orion.core.contenttypes"));return b.getContentTypes().then(function(a){return t=a})}(this.serviceRegistry),function(){var a=[],b=100;n.forEach(function(c){for(var e=m.serviceRegistry.getService(c),g={},i=c.getPropertyKeys(),j=0;j<i.length;j++)g[i[j]]=c.getProperty(i[j]);g.forceSingleItem=!0;c=h._createCommandOptions(g,c,m.serviceRegistry,t,!1,function(){return q.getFileMetadata()});a.push(c);c.then(function(a){a=r(g,e,a);m.commandService.addCommand(a);m.commandService.registerCommandContribution(m.toolbarId,
a.id,b);if(g.key){var c=d.getTextView();c.setKeyBinding(f(g.key),a.id);c.setAction(a.id,a.callback,a)}});b++});c.all(a,function(a){return{_error:a}}).then(function(){var a;if(a=q.getFileMetadata()){var b=j.node("pageActions");b&&(m.commandService.destroy(b),m.commandService.renderCommands(b.id,b,a,d,"button"));if(b=j.node("pageNavigationActions"))m.commandService.destroy(b),m.commandService.renderCommands(b.id,b,d,d,"button")}})})}};d.EditorCommandFactory=r;return d});
define("orion/edit/dispatcher",["orion/edit/dispatcher"],function(){function g(g,j,e){this.serviceRegistry=g;this.editor=j;this.contentType=e;this.contentTypeService=g.getService("orion.core.contenttypes");this.serviceReferences={};var c=this;this.listener={onServiceAdded:function(b){c._onServiceAdded(b.serviceReference)},onServiceRemoved:function(b){c._onServiceRemoved(b.serviceReference)}};this.serviceRegistry.addEventListener("registered",this.listener.onServiceAdded);this.serviceRegistry.addEventListener("unregistering",
this.listener.onServiceRemoved);this._init()}g.prototype={_init:function(){var g=this;this.editor.getTextView()?this._wire(this.serviceRegistry):this.editor.addEventListener("TextViewInstalled",function(){g._wire(g.serviceRegistry)})},_wire:function(g){for(var g=g.getServiceReferences("orion.edit.model"),j=0;j<g.length;j++)this._wireServiceReference(g[j])},_wireServiceReference:function(g){var j=g.getProperty("contentType");if(typeof j!==void 0&&j!==null){var e=this;this.contentTypeService.isSomeExtensionOf(this.contentType,
j).then(function(c){c&&e._wireService(g,e.serviceRegistry.getService(g))})}},_wireService:function(g,j){var e=g.getProperty("types"),c=this.editor.getTextView();if(e){for(var b=0;b<e.length;b++){var a=e[b],i=j["on"+a];i&&this._wireServiceMethod(g,j,i,c,a)}this._initService(j,c)}},_wireServiceMethod:function(g,j,e,c,b){j=function(a){e(a).then()};g=g.getProperty("service.id");this.serviceReferences[g]=this.serviceReferences[g]||[];this.serviceReferences[g].push([c,b,j]);c.addEventListener(b,j)},_onServiceRemoved:function(g){var g=
g.getProperty("service.id"),j=this.serviceReferences[g];if(j){for(var e=0;e<j.length;e++){var c=j[e];c[0].removeEventListener(c[1],c[2])}delete this.serviceReferences[g]}},_onServiceAdded:function(g){g.getProperty("objectClass").indexOf("orion.edit.model")!==-1&&this._wireServiceReference(g)},_initService:function(g,j){var e=g.onModelChanging;if(typeof e==="function"){var c=j.getModel(),b=c.getText(),c={type:"Changing",text:b,start:0,removedCharCount:0,addedCharCount:b.length,removedLineCount:0,addedLineCount:c.getLineCount()};
e.call(g,c)}}};return{Dispatcher:g}});
define("orion/edit/syntaxmodel",["orion/serviceTracker"],function(g){function k(b){return(b=b.getProperty("contentType"))?Array.isArray(b)?b:[b]:null}function j(b){var a=this.contentTypesMap={},i=new g(b,e),f=new g(b,c),d=this.notifySyntaxModelListeners.bind(this);i.addingService=function(c){var d=b.getService(c);(c=k(c))&&c.forEach(function(b){var c=a[b];c?c.push(d):a[b]=[d]})};i.removedService=function(b,c){var d=k(b);d&&d.forEach(function(b){var b=a.hasOwnProperty(b.id)?a[b.id]:null,d=b.indexOf(c);
d!==-1&&b.splice(d,1)})};f.addingService=function(a){var f=b.getService(a);k(a)&&(typeof f.addEventListener!=="function"?console.log(Error("A "+c+' service must provide an "addEventListener" method')):f.addEventListener("orion.edit.syntaxmodel.modelReady",d))};f.removedService=function(a,b){b&&typeof b.removeEventListener==="function"&&b.removeEventListener("orion.edit.syntaxmodel.modelReady",d)};i.open();f.open()}var e="orion.edit.syntaxmodel.listener",c="orion.edit.syntaxmodel.provider";j.prototype.notifySyntaxModelListeners=
function(b){var a=b.contentType,c=b.syntaxModel;typeof a!=="string"?console.log(Error('SyntaxModelReadyEvent must provide a "contentType" field')):(b=this.contentTypesMap.hasOwnProperty(a)?this.contentTypesMap[a]:null)&&b.forEach(function(a){a.setSyntaxModel(c)})};return j});
define("orion/inputManager","i18n!orion/edit/nls/messages,orion/i18nUtil,orion/Deferred,orion/EventTarget,orion/objects,orion/globalCommands,orion/edit/dispatcher,orion/highlight,orion/edit/syntaxmodel,orion/PageUtil".split(","),function(g,k,j,e,c,b,a,i,f,d){function h(a){this._document=a.document||document;this._timeout=a.timeout;for(var a="keypress,keydown,keyup,mousemove,mousedown,mousemove".split(","),b=function(){this._resetTimer()}.bind(this),c=0;c<a.length;c++)this._document.addEventListener(a[c],
b,!0);e.attach(this)}function l(a,b){if(a){if(b.status===0)b={Severity:"Error",Message:g["No response from server.  Check your internet connection and try again."]};else{var c=b.responseText;if(c)try{b=JSON.parse(c)}catch(d){b={Severity:"Error",Message:c}}}a.setProgressResult(b)}else window.console.log(b)}function n(a){this.editor=a.editor;this.serviceRegistry=a.serviceRegistry;this.fileClient=a.fileClient;this.progressService=a.progressService;this.contentTypeService=a.contentTypeService;this.selection=
a.selection;this.syntaxHighlighter=new i.SyntaxHighlighter(this.serviceRegistry);this.syntaxModelWirer=new f(this.serviceRegistry);this._input=this._title="";this.dispatcher=null;e.attach(this)}h.prototype={_resetTimer:function(){var a=this._document.defaultView||this._document.parentWindow;if(this._timer)a.clearTimeout(this._timer),this._timer=null;if(this._timeout!==-1)this._timer=a.setTimeout(function(){this.onIdle({type:"Idle"});this._timer=null;this._resetTimer()}.bind(this),this._timeout)},
onIdle:function(a){return this.dispatchEvent(a)},setTimeout:function(a){this._timeout=a;this._resetTimer()}};c.mixin(n.prototype,{load:function(){var a=this.getInput();if(a){var b=this.fileClient,c=this.progressService,d=this.getEditor();if(this._fileMetadata)c.progress(b.read(a,!0),k.formatMessage(g["Reading metedata of"],a)).then(function(f){if(this._fileMetadata.ETag!==f.ETag)this._fileMetadata=f,(!d.isDirty()||window.confirm(g.loadOutOfSync))&&c.progress(b.read(a),k.formatMessage(g.Reading,a)).then(function(b){d.setInput(a,
null,b)})}.bind(this));else{var f=window.setTimeout(function(){d.reportStatus(k.formatMessage(g.Fetching,a))},800);(new j.all([c.progress(b.read(a),k.formatMessage(g.Reading,a)),c.progress(b.read(a,!0),k.formatMessage(g["Reading metedata of"],a))],function(a){return{_error:a}})).then(function(b){f&&window.clearTimeout(f);var c=b[0],b=b[1];if(c._error||b._error){var e=this.serviceRegistry.getService("orion.page.message");l(e,c._error||b._error);this._setNoInput()}else this._setInputContents(this._parsedLocation,
a,c,b);d.reportStatus("")}.bind(this))}}},processParameters:function(a){for(var b=this.getEditor(),c=["start","end","line","offset","length"],d=0;d<c.length;d++){var f=c[d];a[f]&&(a[f]=parseInt(a[f],10))}b.showSelection(a.start,a.end,a.line,a.offset,a.length)},getEditor:function(){return this.editor},getInput:function(){return this._input},getTitle:function(){return this._title},getFileMetadata:function(){return this._fileMetadata},getContentType:function(){return this._contentType},save:function(){function a(b){j.getFileMetadata().ETag=
b.ETag;c.setInput(d,null,f,!0);c.reportStatus("");j.afterSave&&j.afterSave();j._saving=!1}function b(a){c.reportStatus("");l(i,a);j._saving=!1;j._errorSaving=!0}if(!this._saving){var c=this.getEditor();if(c.isDirty()){this._saving=!0;this._errorSaving=!1;var d=this.getInput();c.reportStatus(g["Saving..."]);var f=c.getText(),e={ETag:this.getFileMetadata().ETag},e=this.fileClient.write(d,f,e),h=this.progressService,i=this.serviceRegistry.getService("orion.page.message");h&&(e=h.progress(e,k.formatMessage(g["Saving file {0}"],
d)));var j=this;e.then(a,function(c){c.status===412?window.confirm(g["Resource is out of sync with the server. Do you want to save it anyway?"])?(c=j.fileClient.write(d,f),h&&(c=h.progress(c,k.formatMessage(g["Saving file {0}"],d))),c.then(a,b)):j._saving=!1:b(c)})}}},setAutoLoadEnabled:function(a){this._autoLoadEnabled=a},setAutoSaveTimeout:function(a){this._autoSaveEnabled=a!==-1;if(this._idle)this._idle.setTimeout(a);else{var b=this.getEditor(),c=b.getTextView(),d=function(){b.removeEventListener("TextViewInstalled",
d);var c={document:b.getTextView().getOptions("parent").ownerDocument,timeout:a};this._idle=new h(c);this._idle.addEventListener("Idle",function(){this._errorSaving||this.save()}.bind(this));this._idle.setTimeout(a)}.bind(this);c?d():b.addEventListener("TextViewInstalled",d)}},setDirty:function(a){b.setDirtyIndicator(a)},setInput:function(a){if(!this._ignoreInput){if(!a)a=window.location.hash;if(typeof a==="string"){var b=this.getEditor();a&&a[0]!=="#"&&(a="#"+a);var c=d.matchResourceParameters(a);
if(b.isDirty()&&(b=this._location,d.matchResourceParameters(b).resource!==c.resource))if(this._autoSaveEnabled)this.save();else if(!window.confirm(g["There are unsaved changes.  Do you still want to navigate away?"])){window.location.hash=b;return}this._location=a;this._parsedLocation=c;this._ignoreInput=!0;this.selection.setSelections(a);this._ignoreInput=!1;(a=c.resource)?a===this._input?this.processParameters(c):(this._input=a,this._fileMetadata=null,this.load()):this._setNoInput()}}},_setNoInput:function(){this._input=
this._title=this._contentType=null;this.editor.uninstallTextView();this.dispatchEvent({type:"InputChanged",input:null})},_setInputContents:function(b,c,d,f){var e;f?(this._fileMetadata=f,this.setTitle(f.Location||String(f)),this._contentType=this.contentTypeService.getFileContentType(f),e=f.Name):(this._fileMetadata=null,this.setTitle(c),this._contentType=this.contentTypeService.getFilenameContentType(this.getTitle()),e=this.getTitle());var g=this.getEditor();g.getTextView()||(g.installTextView(),
g.getTextView().addEventListener("Focus",function(){this._autoSaveEnabled&&this._errorSaving?this.save():this._autoLoadEnabled&&this.load()}.bind(this)));this.dispatchEvent({type:"InputChanged",input:b,name:e,metadata:f,contents:d});var h=this;this.syntaxHighlighter.setup(this._contentType,g.getTextView(),g.getAnnotationModel(),c,!0).then(function(){var f=h.syntaxHighlighter.getStyler();g.setFoldingEnabled(f&&f.foldingEnabled);h.dispatchEvent({type:"ContentTypeChanged",contentType:h._contentType,
location:window.location});if(!h.dispatcher)h.dispatcher=new a.Dispatcher(h.serviceRegistry,g,h._contentType);g.setInput(c,null,d);h.processParameters(b)});this.setDirty(!1)},setTitle:function(a){var b=a.lastIndexOf("/");b!==-1&&(a=a.substring(b+1));this._title=a}});return{InputManager:n}});
define("orion/compare/resourceComparer","i18n!orion/compare/nls/messages,require,orion/Deferred,orion/webui/littlelib,orion/compare/compareUtils,orion/compare/diffProvider,orion/compare/compareView,orion/highlight,orion/fileClient,orion/globalCommands,orion/commands,orion/keyBinding,orion/searchAndReplace/textSearcher,orion/editorCommands,orion/objects,orion/inputManager,orion/editor/editorFeatures,orion/URL-shim".split(","),function(g,k,j,e,c,b,a,i,f,d,h,l,n,m,q,s,p){function r(a){this._syntaxHighlither=
new i.SyntaxHighlighter(a)}k={};k.DefaultDiffProvider=function(){function a(c){this.serviceRegistry=c;this._diffProvider=new b.DiffProvider(c)}a.prototype={_resolveTwoFiles:function(a,b){var c=this;return j.all([c._getContentType(a),c._getContentType(b)],function(a){return{_error:a}}).then(function(d){if(Array.isArray(d)&&d.length===2&&d[0]&&d[1]){var f=d[0],d=d[1];return(new j).resolve({oldFile:{URL:a,Name:c._resolveFileName(a),Type:f},newFile:{URL:b,Name:c._resolveFileName(b),Type:d},diffContent:c._diffContent})}else return f=
a?c._resolveFileName(a):"",d=b?c._resolveFileName(b):"",(new j).resolve({oldFile:{URL:a,Name:f,Type:null},newFile:{URL:b,Name:d,Type:null},diffContent:c._diffContent})})},_resolveFileName:function(a){return a.split("?")[0]},_getContentType:function(a){a=this._resolveFileName(a);return this.serviceRegistry.getService("orion.core.contenttypes").getFilenameContentType(a)},_resolveComplexFileURL:function(a){var b=this;return this._diffProvider.getDiffFileURI(a).then(function(a){return b._resolveTwoFiles(a.Old,
a.New)},function(){})},resolveDiff:function(a,b,c){this._hasConflicts=c;if(b)return this._resolveTwoFiles(b,a);else if(this._diffProvider){var d=this;return d._diffProvider.getDiffContent(a).then(function(b){d._diffContent=d._hasConflicts?b.split("diff --git")[1]:b;return d._resolveComplexFileURL(a)},function(){})}else console.log("A diff provider is needed for compound diff URL")}};return a}();r.prototype={highlight:function(a,b,c){return this._syntaxHighlither.setup(b,c.getTextView(),null,a,!1)}};
k.ResourceComparer=function(){function b(c,h,i,j){this._registry=c;this._commandService=h;this._fileClient=new f.FileClient(c);this._fileClient=new f.FileClient(c);this._searchService=this._registry.getService("orion.core.search");this._progress=this._registry.getService("orion.page.progress");this.setOptions(i,!0);this._compareView=i.toggleable?new a.toggleableCompareView(i.type==="inline"?"inline":"twoWay",j):i.type==="inline"?new a.inlineCompareView(j):new a.TwoWayCompareView(j);this._compareView.getWidget().setOptions({extCmdHolder:this});
j.highlighters||this._compareView.getWidget().setOptions({highlighters:[new r(c),new r(c)]});j.oldFile||this._compareView.getWidget().setOptions({oldFile:{readonly:!0}});j.newFile||this._compareView.getWidget().setOptions({newFile:{readonly:i.readonly}});this.initExtCmds();var k=this;this._inputManager=new s.InputManager({serviceRegistry:c,fileClient:k._fileClient,progressService:k._progress});q.mixin(this._inputManager,{filePath:"",getInput:function(){return this.filePath},setDirty:function(a){d.setDirtyIndicator(a)},
getFileMetadata:function(){return this._fileMetadata},getEditor:function(){return k._compareView.getWidget().getEditors()[1]},setInput:function(a){k._progress.progress(k._fileClient.read(a,!0),"Getting file metadata "+a).then(function(a){this._fileMetadata=a;if(k.options.savable){var b=e.node("pageActions");b&&(k._commandService.destroy(b),k._commandService.renderCommands(b.id,b,k._compareView.getWidget().getEditors()[1],k._compareView.getWidget().getEditors()[1],"button"))}a&&this.setTitle(a.Location,
a)}.bind(this),function(b){console.error("Error loading file metadata: "+b.message);this.setTitle(a)}.bind(this));this.lastFilePath=a},setTitle:function(a,b){var f;if(b)f=b.Name;d.setPageTarget({task:g.Compare,name:f,target:b,serviceRegistry:c,commandService:k._commandService,searchService:k._searchService,fileService:k._fileClient});a.charAt(0)==="*"?(d.setDirtyIndicator(!0),a.substring(1)):d.setDirtyIndicator(!1)},afterSave:function(){var a=k._compareView.getWidget().getEditors()[1].getTextView().getText();
k._compareView.getWidget().options.newFile.Content=a;k._compareView.getWidget().refresh()}});if(!i.readonly&&!i.toggleable&&this._compareView.getWidget().type==="twoWay")this._compareView.getWidget().options.newFile.keyBindingFactory=function(a,b,c,d){b=new n.TextSearcher(a,k._commandService,c);(new m.EditorCommandFactory(k._registry,k._commandService,k._fileClient,k._inputManager,"pageActions",!1,"pageNavigationActions",b)).generateEditorCommands(a);(new p.KeyBindingsFactory).createKeyBindings(a,
c,d,b)};this._compareView.getWidget().initEditors(g["fetching..."]);if(!i.readonly&&!i.toggleable&&this._compareView.getWidget().type==="twoWay"){var l=this._compareView.getWidget().getEditors();l[1].addEventListener("DirtyChanged",function(){this._inputManager.setDirty(l[1].isDirty())}.bind(this))}}b.prototype={_clearOptions:function(){this.options={}},setOptions:function(a,b){b&&this._clearOptions();if(!this.options)this.options={};a&&Object.keys(a).forEach(function(b){this.options[b]=a[b]}.bind(this))},
generateLink:function(a){a=a.getCurrentDiffPos();a=c.generateCompareHref(this.options.resource,{compareTo:this.options.compareTo,readonly:this.options.readonly,conflict:this.options.hasConflicts,block:a.block?a.block:1,change:a.change?a.change:0});a=(new URL(a,window.location.href)).href;prompt(g["Copy the link URL:"],a)},openComparePage:function(a){a=a.getCurrentDiffPos();return c.generateCompareHref(this.options.resource,{compareTo:this.options.compareTo,readonly:!this.options.editableInComparePage,
conflict:this.options.hasConflicts,block:a.block?a.block:1,change:a.change?a.change:0})},initExtCmds:function(){var a=this._compareView.getWidget().options.commandProvider;if(a&&a.getOptions().commandSpanId){var a=a.getOptions().commandSpanId,b=new h.Command({tooltip:g["Generate link of the current diff"],name:g["Generate Link"],id:"orion.compare.generateLink",groupId:"orion.compareGroup",visibleWhen:function(a){return a.options.extCmdHolder.options.resource&&a.options.extCmdHolder.options.generateLink},
callback:function(a){a.items.options.extCmdHolder.generateLink(a.items)}}),c=new h.Command({tooltip:g["Open the compare page"],name:g.Compare,id:"orion.compare.openComparePage",groupId:"orion.compareGroup",visibleWhen:function(a){return a.options.extCmdHolder.options.resource&&!a.options.extCmdHolder.options.generateLink},hrefCallback:function(a){return a.items.options.extCmdHolder.openComparePage(a.items)}});this._commandService.addCommand(b);this._commandService.addCommand(c);this._commandService.registerCommandContribution(a,
"orion.compare.openComparePage",98);this._commandService.registerCommandContribution(a,"orion.compare.generateLink",99,null,!1,new l.KeyBinding("l",!0,!0))}},_getFilesContents:function(a){var b=[];a.forEach(function(a){b.push(this._loadSingleFile(a))}.bind(this));return j.all(b,function(a){return{_error:a}})},_loadSingleFile:function(a){return this._registry.getService("orion.page.progress").progress(this._fileClient.read(a.URL),"Getting contents of "+a.URL).then(function(b){a.Content=b;return a}.bind(this),
function(b){if(b.status===404)a.Content="";return a}.bind(this))},start:function(){if(this.options.resource)if(this.options.diffProvider){var a=this;return a.options.diffProvider.resolveDiff(a.options.resource,a.options.compareTo,a.options.hasConflicts).then(function(b){a._compareView.getWidget().setOptions(b);var c=a._compareView.getWidget().options;c.oldFile.readonly=!0;if(a.options.readonly)c.newFile.readonly=!0;return a._getFilesContents(c.diffContent?[c.oldFile]:[c.oldFile,c.newFile]).then(function(){var b=
a._compareView.getWidget().refresh(!0);if(!a.options.readonly&&!a.options.toggleable&&a._compareView.getWidget().type==="twoWay")this._inputManager.filePath=a._compareView.getWidget().options.newFile.URL,a._inputManager.setInput(c.newFile.URL,a._compareView.getWidget().getEditors()[1]);return(new j).resolve(b)}.bind(a))})}else console.log("A diff provider is needed for Complex diff URL")}};return b}();return k});
define("orion/git/util",["i18n!git/nls/gitmessages","orion/compare/compareCommands","orion/compare/resourceComparer","orion/webui/littlelib"],function(g,k,j,e){function c(a){for(var b=0;b<i.length;b++)if(a.type===i[b])return!0;return!1}function b(b){for(var c=0;c<a.length;c++)if(b.type===a[c])return!0;return!1}var a=["Missing","Modified","Untracked","Conflicting"],i=["Added","Changed","Removed"];return{statusUILocation:"git/git-status2.html",isStaged:c,isUnstaged:b,isChange:function(a){return c(a)||
b(a)},hasStagedChanges:function(a){for(var b=0;b<i.length;b++)if(a[i[b]].length>0)return!0;return!1},hasUnstagedChanges:function(b){for(var c=0;c<a.length;c++)if(b[a[c]].length>0)return!0;return!1},createCompareWidget:function(a,b,c,g,i,m,q,s,p){var r=new j.DefaultDiffProvider(a),m=new k.CompareCommandFactory({commandService:b,commandSpanId:m,gridRenderer:s});(new j.ResourceComparer(a,b,{toggleable:!0,type:"inline",readonly:!0,hasConflicts:g,diffProvider:r,resource:c,compareTo:p,editableInComparePage:q},
{parentDivId:i,commandProvider:m})).start().then(function(a){var b=420;a<b&&(b=a);e.node(i).style.height=b+"px"})}}});
define("orion/git/gitPreferenceStorage",["orion/Deferred"],function(g){function k(g){this._prefix="/git/credentials";this._preferenceService=g.getService("orion.core.preference")}k.prototype={put:function(j,e){var c={gitSshUsername:"",gitSshPassword:"",gitPrivateKey:"",gitPassphrase:""};if(e!==void 0){if(e.gitSshUsername!==void 0&&e.gitSshUsername!==null)c.gitSshUsername=e.gitSshUsername;if(e.gitSshPassword!==void 0&&e.gitSshPassword!==null)c.gitSshPassword=e.gitSshPassword;if(e.gitPrivateKey!==void 0&&
e.gitPrivateKey!==null)c.gitPrivateKey=e.gitPrivateKey;if(e.gitPassphrase!==void 0&&e.gitPassphrase!==null)c.gitPassphrase=e.gitPassphrase}var b=new g;this._preferenceService.getPreferences(this._prefix,2).then(function(a){var e=a.get("settings");e===void 0?b.reject():e.enabled?(a.put(j,c),b.resolve()):b.reject()});return b},get:function(j){var e={gitSshUsername:"",gitSshPassword:"",gitPrivateKey:"",gitPassphrase:""},c=new g;this._preferenceService.getPreferences(this._prefix,2).then(function(b){var a=
b.get("settings");a===void 0?c.reject():a.enabled?(b=b.get(j),b!==void 0?c.resolve(b):c.resolve(e)):c.reject()});return c},isEnabled:function(){var j=new g;this._preferenceService.getPreferences(this._prefix,2).then(function(e){e=e.get("settings");e===void 0?j.resolve(!1):j.resolve(e.enabled)});return j},enable:function(){var j=new g;this._preferenceService.getPreferences(this._prefix,2).then(function(e){e.put("settings",{enabled:!0});j.resolve()});return j},disable:function(){var j=new g;this._preferenceService.getPreferences(this._prefix,
2).then(function(e){e.put("settings",{enabled:!1});j.resolve()});return j},remove:function(j){var e=new g;this._preferenceService.getPreferences(this._prefix,2).then(function(c){c.remove(j);e.resolve()});return e},getRepositories:function(){var j=new g;this._preferenceService.getPreferences(this._prefix,2).then(function(e){for(var c=[],e=e.keys(),b=0;b<e.length;++b)e[b]!=="settings"&&c.push(e[b]);j.resolve(c)});return j}};return k.prototype.constructor=k});
define("orion/git/gitConfigPreference",["orion/Deferred"],function(g){function k(g){this._prefix="/git/config";this._preferenceService=g.getService("orion.core.preference")}k.prototype={getConfig:function(){var j=new g;this._preferenceService.getPreferences(this._prefix).then(function(e){e=e.get("userInfo");j.resolve(e)});return j},setConfig:function(j){var e=new g;this._preferenceService.getPreferences(this._prefix).then(function(c){c.put("userInfo",j);e.resolve()});return e}};return k.prototype.constructor=
k});
define("orion/git/widgets/ConfirmPushDialog",["i18n!git/nls/gitmessages","orion/webui/dialog"],function(g,k){function j(e){this._init(e)}j.prototype=new k.Dialog;j.prototype.TEMPLATE='<div id="header"></div>';j.prototype._init=function(e){var c=this;this.title="Git Push";this.modal=!0;this.messages=g;this.location=e.location;this.dialog2=e.dialog;this.func=e.func;this.buttons=[];this.buttons.push({callback:function(){c.destroy();c.dialog2.show()},text:"More"});this.buttons.push({callback:function(){c.destroy();c.func()},
text:"OK"});this._initialize()};j.prototype._bindToDom=function(){var e=this.$header;e.appendChild(document.createTextNode("You are going to push to the following remote: "+this.location));e.appendChild(document.createElement("br"));e.appendChild(document.createTextNode(" Click More to push to another remote or OK to push to default."))};j.prototype.constructor=j;return{ConfirmPushDialog:j}});
define("orion/git/widgets/RemotePrompterDialog",["i18n!git/nls/gitmessages","orion/webui/dialog","orion/explorers/explorer","orion/selection"],function(g,k,j,e){function c(a,b){this.explorer=b;this._init(a)}function b(a){this._init(a)}var a=function(){function a(b,c,e,g){this.gitClient=b;this.rootPath=c;this.fetchItems=e;this.root=g?g:null}a.prototype=new j.ExplorerModel;a.prototype.getRoot=function(a){var b=this;this.root?a(this.root):this.fetchItems(this.rootPath).then(function(c){b.root=c;a(c)})};
a.prototype.getIdentity=function(a){a.Location?(a=a.Location,a=a.replace(/[^\.\:\-\_0-9A-Za-z]/g,"")):a="ROOT";return a};a.prototype.getChildren=function(a,b){a.children=[];if(a.Children){for(var c=0;c<a.Children.length;c++)a.Children[c].parent=a,a.children[c]=a.Children[c];b(a.Children)}else a.BranchLocation&&a.RemoteLocation?(a.children=[{GroupNode:"true",Location:a.BranchLocation,Name:"Branches",parent:a},{GroupNode:"true",Location:a.RemoteLocation,BranchLocation:a.BranchLocation,Name:"Remotes",
parent:a},{GroupNode:"true",Location:a.TagLocation,Name:"Tags",parent:a}],b(a.children)):a.GroupNode?this.gitClient.getGitBranch(a.Location).then(function(c){a.children=c.Children;for(var e=0;e<c.Children.length;e++)c.Children[e].parent=a;b(c.Children)}):a.Type==="Remote"&&this.gitClient.getGitBranch(a.Location).then(function(c){a.children=c.Children;for(var e=0;e<c.Children.length;e++)c.Children[e].parent=a;b(c.Children)})};return a}();c.prototype=new j.SelectionRenderer;c.prototype.constructor=
c;c.prototype.getLabelColumnIndex=function(){return 0};c.prototype.getCellElement=function(a,b,c){var e=document.createElement("td");c.appendChild(e);a=document.createElement("span");a.id=c.id+"navSpan";e.appendChild(a);a.className="mainNavColumn singleNavColumn";(b.children||b.Children||b.GroupNode||b.Type==="Remote"||b.BranchLocation&&b.RemoteLocation)&&this.getExpandImage(c,a);c=b.Name;b.Type==="RemoteTrackingBranch"&&!b.Id&&(c=b.Name+g[" [New branch]"]);a.appendChild(document.createTextNode(c))};
b.prototype=new k.Dialog;b.prototype.TEMPLATE='<div><div id="treeContentPane" style="width:25em; min-height: 25em; max-height: 30em; height: auto; overflow-y: auto; padding: 8px"></div><div id="newBranchPane" style="padding: 8px"><label for="newBranch">${New Branch:}</label><input id="newBranch" value="" disabled=true/></div></div>';b.prototype._init=function(a){var b=this;this.title=a.title||g["Choose a Folder"];this.modal=!0;this.messages=g;this.func=a.func;this.treeRoot=a.treeRoot;this.gitClient=
a.gitClient;this.hideNewBranch=a.hideNewBranch;this.serviceRegistry=a.serviceRegistry;this.buttons=[];this.buttons.push({callback:function(){b.$remoteOk.classList.contains(this.DISABLED)||(b.destroy(),b._execute.bind(b)())},text:"OK",isDefault:!0,id:"remoteOk"})};b.prototype._bindToDom=function(){var a=this;this.$newBranch.addEventListener("input",function(){a._validate()});if(this.hideNewBranch)this.$newBranchPane.style.display="none"};b.prototype._beforeShowing=function(){this._initialize();this._loadRemoteChildren()};
b.prototype._afterShowing=function(){this.$treeContentPane.focus();this._validate()};b.prototype._loadRemoteChildren=function(){this._createTree(new a(this.gitClient,null,this.gitClient.getGitClone,this.treeRoot))};b.prototype._createTree=function(a){var b=this,d=this.serviceRegistry.getService("orion.remotePrompter.selection");d||(d=new e.Selection(this.serviceRegistry,"orion.remotePrompter.selection"));var g=new c({checkbox:!1,singleSelection:!0,treeTableClass:"directoryPrompter"});this.explorer=
new j.Explorer(this.serviceRegistry,d,g);g.explorer=this.explorer;this.explorer.createTree("treeContentPane",a);d.addEventListener("selectionChanged",function(a){b.$newBranch.disabled=a.selection&&a.selection.Type==="Remote"?!1:!0;b._validate(a.selection)})};b.prototype._validate=function(a){var b=function(a){a&&a.Type==="RemoteTrackingBranch"?this.$remoteOk.classList.remove(this.DISABLED):a&&a.Type==="Remote"&&this.$newBranch.value!==""?this.$remoteOk.classList.remove(this.DISABLED):this.$remoteOk.classList.add(this.DISABLED)};
a?b.bind(this)(a):this.serviceRegistry.getService("orion.remotePrompter.selection").getSelection(b.bind(this))};b.prototype._execute=function(){var a=this;this.serviceRegistry.getService("orion.remotePrompter.selection").getSelection(function(b){if(a.func)if(b.Type==="RemoteTrackingBranch")a.func(b,b.parent);else{var c=b.CloneLocation.substring(b.CloneLocation.indexOf(b.CloneLocation.split("/")[3])),e={};e.parent=b;e.FullName="refs/remotes/"+b.Name+"/"+a.$newBranch.value;e.Name=b.Name+"/"+a.$newBranch.value;
e.Type="RemoteTrackingBranch";e.Location="/gitapi/remote/"+b.Name+"/"+encodeURIComponent(a.$newBranch.value)+"/"+c;a.func(null,b,e)}})};b.prototype.constructor=b;return{RemotePrompterDialog:b}});
define("orion/git/widgets/ReviewRequestDialog",["i18n!git/nls/gitmessages","orion/webui/dialog"],function(g,k){function j(e){this._init(e)}j.prototype=new k.Dialog;j.prototype.TEMPLATE='<div><div id="treeContentPane" style="padding: 8px"><label for="reviewReqUrl">${Paste link in email or IM}</label><br><input id="reviewReqUrl" style="width: 50em" value=""/></div><div id="newBranchPane" style="padding: 8px"><label for="reviewerName">${Send the link to the reviewer}</label><br><input id="reviewerName" style="width: 30em"  value=""/></div></div>';j.prototype._init=
function(e){var c=this;this.title=e.title||g["Contribution Review Request"];this.modal=!0;this.messages=g;this.url=e.url;this.func=e.func;this.buttons=[];this.buttons.push({callback:function(){c.destroy();c.func(c.$reviewerName.value)},text:"Submit"});this._initialize()};j.prototype._bindToDom=function(){this.$reviewReqUrl.value=this.url};j.prototype.constructor=j;return{ReviewRequestDialog:j}});
define("orion/explorers/explorer-table","i18n!orion/navigate/nls/messages,require,orion/Deferred,orion/webui/littlelib,orion/i18nUtil,orion/fileUtils,orion/explorers/explorer,orion/EventTarget".split(","),function(g,k,j,e,c,b,a,i){function f(a,b,c,d,e,f){this.registry=a;this.root=b;this.fileClient=c;this.idPrefix=d||"";this.excludeFiles=!!e;this.excludeFolders=!!f}function d(a){i.attach(this);this.registry=a.serviceRegistry;this.treeRoot=a.treeRoot;this.selection=a.selection;this.fileClient=a.fileClient;
this.excludeFiles=a.excludeFiles;this.excludeFolders=a.excludeFolders;this.navHandlerFactory=a.navHandlerFactory;this.parentId=a.parentId;this.renderer=a.rendererFactory(this);this.dragAndDrop=a.dragAndDrop;this.setFocus=a.setFocus;this.myTree=this.model=null;this._hookedDrag=this.checkbox=!1;var b=this.modelEventDispatcher=new i,c=this;"copy,copyMultiple,create,delete,deleteMultiple,import,move,moveMultiple".split(",").forEach(function(a){b.addEventListener(a,c.modelHandler[a].bind(c))});var d=this.renderer;
this.registry&&this.registry.registerService("orion.cm.managedservice",{updated:function(a){d.setTarget(a&&a["links.newtab"]!=="undefined"?a["links.newtab"]?"_blank":"_self":"_self")}},{pid:"nav.config"})}f.prototype=new a.ExplorerModel;f.prototype.getRoot=function(a){a(this.root)};f.prototype.processParent=function(a,b){if(this.excludeFiles||this.excludeFolders){var c=[],d;for(d in b)if(!(b[d].Directory?this.excludeFolders:this.excludeFiles))c.push(b[d]),b[d].parent=a;b=c}else for(c in b)b[c].parent=
a;a.children=b;a.children.sort(function(a,b){var c=a.Directory;if(c!==b.Directory)return c?-1:1;var c=a.Name&&a.Name.toLowerCase(),d=b.Name&&b.Name.toLowerCase();return c<d?-1:c>d?1:0});return b};f.prototype.getChildren=function(a,b){var c=this;a.children?b(a.children):a.Directory!==void 0&&a.Directory===!1?b([]):a.Location?this.registry.getService("orion.page.progress").progress(this.fileClient.fetchChildren(a.ChildrenLocation),"Fetching children of "+a.Name).then(function(d){b(c.processParent(a,
d))}):b([])};f.prototype.hasChildren=function(){var a=!1;this.root.Children&&(a=this.root.Children.length>0);return a};f.prototype.constructor=f;d.prototype=Object.create(a.Explorer.prototype);d.prototype.modelHandler={copy:function(){},copyMultiple:function(a){var b=this,c={};a.items.forEach(function(a){a=a.newValue.Parents[0]||b.treeRoot;c[a.Location]=a});Object.keys(c).forEach(function(a){b.changedItem(c[a],!0)})},create:function(a){this.changedItem(a.parent,!0,a.newValue)},"delete":function(){},
deleteMultiple:function(a){var a=a.items,b=this,c;if(a.some(function(a){return a.oldValue.Location===b.treeRoot.Location?(c=a.parent,!0):!1}))this.loadResourceList(c);else{var d={};a.forEach(function(a){a=a.parent;d[a.Location]=a});Object.keys(d).forEach(function(a){b.changedItem(d[a],!0)})}},"import":function(a){this.changedItem(a.target,!0)},move:function(a){var b=a.oldValue,c=a.newValue,a=a.parent,d=this,e=null;if(a.Projects)if(d.treeRoot.Location===b.Location){var f=d.treeRoot,b=c.ChildrenLocation?
c:this.fileClient.read(c.ContentLocation,!0);j.when(b,function(a){d.dispatchEvent({type:"rootMoved",oldValue:f,newValue:a});d.loadResourceList(a)})}else e=d.isExpanded(b)&&b;else b.Directory&&(e=d.isExpanded(b)&&c);d.changedItem(a,!0);e&&d.changedItem(e,!0)},moveMultiple:function(){this.changedItem(this.treeRoot,!0)}};d.prototype._makeDropTarget=function(a,d,f){function i(a,d,e,f,h,j){d=d||"";if(a.isFile)b.isAtRoot(e.Location)?f.registry.getService("orion.page.message").setProgressResult({Severity:"Error",
Message:g["You cannot copy files directly into the workspace.  Create a folder first."]}):a.file(function(a){h(e,a,f,a.name.indexOf(".zip")===a.name.length-4&&window.confirm(c.formatMessage(g["Unzip ${0}?"],a.name)))});else if(a.isDirectory){var k=a.createReader(),l=function(b){k.readEntries(function(c){for(var e=0;e<c.length;e++)i(c[e],d+a.name+"/",b,f,h,j)})},n=f.registry.getService("orion.page.progress");b.isAtRoot(e.Location)?n.progress(j.createProject(e.ChildrenLocation,a.name),"Initializing project "+
a.name).then(function(a){f.loadResourceList(f.treeRoot.Path,!0);n.progress(j.read(a.ContentLocation,!0),"Loading project info "+a.name).then(function(a){l(a)})}):n.progress(j.createFolder(e.Location,a.name),"Creating folder "+a.name).then(function(a){f.changedItem(e,!0);l(a)})}}if(this.dragAndDrop){var j=this,k=this.dragAndDrop,p=function(a){d.classList.remove("dragOver");a.preventDefault();a.stopPropagation()};if(f)this._oldDragLeave&&d.removeEventListener("dragleave",this._oldDragLeave,!1),this._oldDragLeave=
p;d.addEventListener("dragleave",p,!1);p=function(a){if(a.dataTransfer.effectAllowed==="all"||a.dataTransfer.effectAllowed==="uninitialized"||a.dataTransfer.effectAllowed.indexOf("copy")>=0)a.dataTransfer.dropEffect="copy";d.classList.add("dragOver");e.stop(a)};if(f)this._oldDragEnter&&d.removeEventListener("dragenter",this._oldDragEnter,!1),this._oldDragEnter=p;d.addEventListener("dragenter",p,!1);p=function(a){if(a.dataTransfer.effectAllowed==="all"||a.dataTransfer.effectAllowed==="uninitialized"||
a.dataTransfer.effectAllowed.indexOf("copy")>=0)a.dataTransfer.dropEffect="copy";e.stop(a)};if(f&&!this._oldDragOver)d.addEventListener("dragover",p,!1),this._oldDragOver=p;p=function(f){d.classList.remove("dragOver");if(f.dataTransfer.items&&f.dataTransfer.items.length>0)for(var n=0;n<f.dataTransfer.items.length;n++){var p=null;typeof f.dataTransfer.items[n].getAsEntry==="function"?p=f.dataTransfer.items[n].getAsEntry():typeof f.dataTransfer.items[n].webkitGetAsEntry==="function"&&(p=f.dataTransfer.items[n].webkitGetAsEntry());
p&&i(p,null,a,j,k,j.fileClient)}else if(f.dataTransfer.files&&f.dataTransfer.files.length>0)for(n=0;n<f.dataTransfer.files.length;n++)p=f.dataTransfer.files[n],!p.length&&(!p.type||p.type==="")?j.registry.getService("orion.page.message").setProgressResult({Severity:"Error",Message:c.formatMessage(g["Did not drop ${0}.  Folder drop is not supported in this browser."],p.name)}):b.isAtRoot(a.Location)?j.registry.getService("orion.page.message").setProgressResult({Severity:"Error",Message:g["You cannot copy files directly into the workspace.  Create a folder first."]}):
k(a,p,j,p.name.indexOf(".zip")===p.name.length-4&&window.confirm(c.formatMessage(g["Unzip ${0}?"],p.name)));e.stop(f)};if(f)this._oldDrop&&d.removeEventListener("drop",this._oldDrop,!1),this._oldDrop=p;d.addEventListener("drop",p,!1)}};d.prototype.changedItem=function(a,b){if(this.treeRoot&&this.treeRoot.Location===a.Location)return this.loadResourceList(this.treeRoot,b);var c=this;return this.registry.getService("orion.page.progress").progress(this.fileClient.fetchChildren(a.ChildrenLocation),"Fetching children of "+
a.Name).then(function(d){d=c.model.processParent(a,d);c.getNavHandler();c.myTree.refresh.bind(c.myTree)(a,d,b);return(new j).resolve(d)})};d.prototype.isExpanded=function(a){return this.renderer.tableTree.isExpanded(this.model.getId(a))};d.prototype.getNameNode=function(a){if(a=this.model.getId(a))return e.node(a+"NameLink")};d.prototype.scopeUp=function(){};d.prototype.loadResourceList=function(a,c,d){a&&typeof a==="object"&&(a=a.ChildrenLocation||a.ContentLocation);a=b.makeRelative(a);if(!c&&a===
this._lastPath)return(new j).resolve(this.treeRoot);this._lastPath=a;var e=this;return c||a!==this.treeRoot.Path?this.load(this.fileClient.loadWorkspace(a),"Loading "+a).then(function(){e.treeRoot.Path=a;typeof d==="function"&&d();e.dispatchEvent({type:"rootChanged",root:e.treeRoot});return(new j).resolve(e.treeRoot)},function(a){e.treeRoot.Path=null;e.dispatchEvent({type:"rootChanged",root:e.treeRoot});return(new j).reject(a)}):(new j).resolve(e.treeRoot)};d.prototype.load=function(a,b,c){var d=
e.node(this.parentId),i=e.node("progress");if(!i)i=document.createElement("div"),i.id="progress",e.empty(d),d.appendChild(i);e.empty(i);var k=setTimeout(function(){e.empty(i);i.appendChild(document.createTextNode(b))},500),p=this;return j.when(a,function(a){p.treeRoot={};clearTimeout(k);for(var b in a)p.treeRoot[b]=a[b];p.model=new f(p.registry,p.treeRoot,p.fileClient,p.parentId,p.excludeFiles,p.excludeFolders);p.model.processParent(p.treeRoot,a.Children);if(p.dragAndDrop)p._hookedDrag?p._makeDropTarget(p.treeRoot,
d,!0):(a=(a=d&&("draggable"in d||"ondragstart"in d&&"ondrop"in d))&&!(!window.File||!window.FileList||!window.FileReader),p._hookedDrag=!0,a?p._makeDropTarget(p.treeRoot,d,!0):(p.dragAndDrop=null,window.console.log("Local file drag and drop is not supported in this browser.")));p.model.hasChildren()?p.createTree(p.parentId,p.model,{navHandlerFactory:p.navHandlerFactory,setFocus:typeof p.setFocus==="undefined"?!0:p.setFocus,selectionPolicy:p.renderer.selectionPolicy,onCollapse:function(a){if(p.getNavHandler())p.getNavHandler().onCollapse(a)}}):
(e.empty(d),a=document.createElement("div"),a.classList.add("noFile"),a.textContent=g.NoFile,b=document.createElement("span"),b.classList.add("core-sprite-addcontent"),b.classList.add("icon-inline"),b.classList.add("imageSprite"),e.processDOMNodes(a,[b]),d.appendChild(a));if(typeof c==="function")try{c()}catch(h){p.registry&&p.registry.getService("orion.page.message").setErrorMessage(h)}if(typeof p.onchange==="function")p.onchange(p.treeRoot);return(new j).resolve(p.treeRoot)},function(a){clearTimeout(k);
p.registry.getService("orion.page.message").setProgressResult(a);return(new j).reject(a)})};d.prototype.onchange=function(){};d.prototype.constructor=d;return{FileExplorer:d,FileModel:f}});
define("orion/webui/dialogs/DirectoryPrompterDialog","i18n!orion/widgets/nls/messages,orion/webui/littlelib,orion/webui/dialog,orion/fileUtils,orion/selection,orion/explorers/navigationUtils,orion/explorers/explorer,orion/explorers/explorer-table".split(","),function(g,k,j,e,c,b,a,i){function f(a,b){this.explorer=b;this._init(a)}function d(a){this._init(a)}f.prototype=new a.SelectionRenderer;f.prototype.constructor=f;f.prototype.getLabelColumnIndex=function(){return 0};f.prototype.getCellElement=
function(a,b,c){a=document.createElement("td");c.appendChild(a);var d=document.createElement("span");d.id=c.id+"navSpan";a.appendChild(d);d.className="mainNavColumn singleNavColumn";this.getExpandImage(c,d);d.appendChild(document.createTextNode(b.Name))};d.prototype=new j.Dialog;d.prototype.TEMPLATE='<div id="message" style="width: 25em; padding-bottom: 5px;"></div><div id="directoryTree" class="explorerTreeClass" style="width:25em; min-height: 25em; max-height:30em; height: auto; overflow-y: auto;"></div>';
d.prototype._init=function(a){this.title=a.title||g["Choose a Folder"];this.modal=!0;this.buttons=[{text:g.OK,isDefault:!0,callback:this.done.bind(this)}];this.customFocus=!0;this._fileClient=a.fileClient;this._serviceRegistry=a.serviceRegistry;this._message=a.message||"";this._func=a.func;this._initialize()};d.prototype._bindToDom=function(){this.loadFolderList("/");this._message?this.$message.appendChild(document.createTextNode(this._message)):this.$message.style.display="none";this.$directoryTree.focus()};
d.prototype.loadFolderList=function(a){a=e.makeRelative(a);this.selection=new c.Selection(this._serviceRegistry,"orion.directoryPrompter.selection");this.explorer=new i.FileExplorer({treeRoot:{children:[]},selection:this.selection,serviceRegistry:this._serviceRegistry,fileClient:this._fileClient,parentId:"directoryTree",excludeFiles:!0,rendererFactory:function(a){return new f({checkbox:!1,singleSelection:!0,treeTableClass:"directoryPrompter"},a)}});this.explorer.loadResourceList(a,!0,null)};d.prototype.done=
function(){this.selection.getSelection(function(a){this.hide();this._func(a)}.bind(this))};d.prototype.constructor=d;return{DirectoryPrompterDialog:d}});
define("orion/git/widgets/CloneGitRepositoryDialog",["i18n!git/nls/gitmessages","orion/webui/dialogs/DirectoryPrompterDialog","orion/webui/dialog","require"],function(g,k,j,e){function c(b){this._init(b)}c.prototype=new j.Dialog;c.prototype.TEMPLATE='<span id="basicPane"><div style="padding: 8px"><label for="gitUrl">${Repository URL:}</label><input id="gitUrl" style="width: 50em" value=""/></div><div style="padding: 8px; text-align: right;"><a id="advancedLink" href="javascript:">${Choose target location}</a><a id="advancedLinkHide" href="javascript:" style="display: none">${Default target location}</a></div></span><span id="advancedPane" style="display: none;"><div style="padding: 8px"><input id="isNewProject" type="radio" name="isNewProject" checked value="new"/><label for="gitName" style="padding: 0 8px">${New folder:}</label><input id="gitName" value=""></div><div style="padding: 8px"><input id="isExistingProject" type="radio" name="isNewProject" value="existing"/><label for="gitPath" style="padding: 0 8px">${Existing directory:}</label><input id="gitPath" type="hidden" value=""><span id="shownGitPath" style="padding-right: 24px"></span><a id="changeGitPath" href="javascript:">${Change...}</a></div></span>';c.prototype._init=
function(b){var a=this;this.title=b.title?b.title:g["Clone Git Repository"];this.modal=!0;this.messages=g;this.advancedShown=!1;this.alwaysShowAdvanced=b.alwaysShowAdvanced;this.advancedOnly=b.advancedOnly;this.url=b.url;this.serviceRegistry=b.serviceRegistry;this.fileClient=b.fileClient;this.func=b.func;this.buttons=[];this.buttons.push({callback:function(){a.destroy();a._execute()},text:"OK"});this._initialize()};c.prototype._bindToDom=function(){var b=this;if(this.url)this.$gitUrl.value=this.url;
if(this.advancedOnly)this.$basicPane.style.display="none",this.$advancedPane.style.display="",setTimeout(function(){b.$gitName.focus()},400);this.$changeGitPath.addEventListener("click",function(){b._openDirectoryPickerDialog()});this.$isExistingProject.addEventListener("click",function(){b._checkNewExisting()});this.$isNewProject.addEventListener("click",function(){b._checkNewExisting()});this.$gitName.addEventListener("focus",function(){b._showNewProject()});this.$advancedLink.addEventListener("click",
function(){b._showAdvanced()});this.$advancedLinkHide.addEventListener("click",function(){b._hideAdvanced()});this.alwaysShowAdvanced&&this._showAdvanced()};c.prototype._execute=function(){this.func&&this.func(this.advancedOnly?void 0:this.$gitUrl.value,this.advancedShown&&this.$isNewProject.checked?void 0:this.$gitPath.value,this.advancedShown&&!this.$isNewProject.checked?void 0:this.$gitName.value)};c.prototype._showAdvanced=function(){this.advancedShown=!0;this.$advancedPane.style.display="";this.$advancedLink.style.display=
"none";this.$advancedLinkHide.style.display=""};c.prototype._hideAdvanced=function(){this.advancedShown=!1;this.$advancedPane.style.display="none";this.$advancedLink.style.display="";this.$advancedLinkHide.style.display="none"};c.prototype._checkNewExisting=function(){this.$isExistingProject.checked?this._openDirectoryPickerDialog():this.$gitName.focus()};c.prototype._showNewProject=function(){this.$isNewProject.checked=!0};c.prototype._openDirectoryPickerDialog=function(){function b(a){var b=document.createElement("a");
b.href=e.toUrl("navigate/table.html")+"#"+a.ChildrenLocation;b.textContent=a.Name;return b}var a=this;this.$isExistingProject.checked=!0;var c=new k.DirectoryPrompterDialog({title:g["Choose a Folder"],serviceRegistry:this.serviceRegistry,fileClient:this.fileClient,func:function(c){if(c&&c.Location){for(a.$gitPath.value=c.Location;a.$shownGitPath.hasChildNodes();)a.$shownGitPath.removeChild(a.$shownGitPath.lastChild);for(a.$shownGitPath.appendChild(b(c));c.parent&&c.parent.Location!=="/";)a.$shownGitPath.insertBefore(document.createTextNode("/"),
a.$shownGitPath.firstChild),a.$shownGitPath.insertBefore(b(c.parent),a.$shownGitPath.firstChild),c=c.parent}}});this._addChildDialog(c);c.show()};c.prototype.constructor=c;return{CloneGitRepositoryDialog:c}});
define("orion/git/widgets/GitCredentialsDialog",["i18n!git/nls/gitmessages","orion/git/gitPreferenceStorage","orion/webui/dialog"],function(g,k,j){function e(c){this._init(c)}e.prototype=new j.Dialog;e.prototype.TEMPLATE='<div id="gitCredentialsLabel" style="padding: 8px">${Repository URL:}<strong id="url"></strong></div><div id="gitSshUsernameRow" style="padding: 8px"><label id="gitSshUsernameLabel" for="gitSshUsername">${Username:}</label><input id="gitSshUsername" value=""></div><div id="gitSshPasswordRow" style="padding: 8px"><input id="isSshPassword" type="radio" name="isSshPassword" checked value="password"/><label id="gitSshPasswordLabel" for="gitSshPassword" style="padding: 0 8px">${Ssh password:}</label><input type="password" id="gitSshPassword" value="" style="width: 30em"></div><div style="padding: 8px"><div id="gitPrivateKeyRow"><input id="isPrivateKey" type="radio" name="isSshPassword" value="privateKey" style="vertical-align: top"/><label id="gitPrivateKeyLabel" for="gitPrivateKey" style="padding: 0 8px; vertical-align: top">${Private key:}</label><textarea id="gitPrivateKey" value=""></textarea></div><div id="gitPrivateKeyFileRow" style="padding-left: 8em"><label id="gitPrivateKeyFileLabel" for="gitPrivateKeyFile">${Private key file (optional):}</label><br><input id="gitPrivateKeyFile" multiple="false" type="file" size="53" label="Browse..."></div><div id="gitPassphraseRow" style="padding-left: 8em"><label id="gitPassphraseLabel" for="gitPassphrase">${Passphrase (optional):}</label><br><input type="password" id="gitPassphrase" value="" style="width: 30em"></div></div><div id="gitSaveCredentialsRow" style="padding: 8px"><img id="gitSaveCredentialsInfo" src="/images/info.gif""><input id="gitSaveCredentials" type="checkbox" name="gitSaveCredentials"><label id="gitSaveCredentialsLabel" for="gitSaveCredentials">${Don\'t prompt me again:}</label></div>';e.prototype._init=
function(c){var b=this;this.title=c.title||g["Git Credentials"];this.modal=!0;this.messages=g;this.options=c;if(!this.options.username&&!this.options.password&&!this.options.privatekey&&!this.options.passphrase)this.options.username=!0,this.options.password=!0,this.options.privatekey=!0,this.options.passphrase=!0;if(c.serviceRegistry)this._sshService=c.serviceRegistry.getService("orion.net.ssh"),this._progressService=c.serviceRegistry.getService("orion.page.progress");this.buttons=[];this.buttons.push({callback:function(){b.destroy();
b._execute()},text:"OK",isDefault:!0});this._initialize()};e.prototype._bindToDom=function(){var c=this;if(!this.options.username)this.$gitSshUsernameRow.style.display="none";if(!this.options.password)this.$gitSshPasswordRow.style.display="none";if(!this.options.privatekey)this.$gitPrivateKeyRow.style.display="none",this.$gitPrivateKeyFileRow.style.display="none";if(!this.options.passphrase)this.$gitPassphraseRow.style.display="none";if(this.options.errordata&&this.options.errordata.Url)this.$gitCredentialsLabel.style.display=
"block",this.$url.textContent=this.options.errordata.Url;if(this.options.errordata&&this.options.errordata.User&&this.options.errordata.User!=="")this.$gitSshUsername.value=this.options.errordata.User,this.$gitSshUsernameRow.style.display="none",setTimeout(function(){c.$gitSshPassword.focus()},400);(new k(this.options.serviceRegistry)).isEnabled().then(function(b){if(!b)c.$gitSaveCredentials.style.display="none",c.$gitSaveCredentialsLabel.style.display="none",c.$gitSaveCredentialsInfo.style.display=
"none"});this.$gitSshPassword.addEventListener("focus",function(){c.$isSshPassword.checked=!0});this.$gitPrivateKey.addEventListener("focus",function(){c.$isPrivateKey.checked=!0});this.$gitPrivateKeyFile.addEventListener("focus",function(){c.$isPrivateKey.checked=!0});this.$gitPassphrase.addEventListener("focus",function(){c.$isPrivateKey.checked=!0});this.$gitPrivateKeyFile.addEventListener("change",function(b){c.privateKeyFile=b.target.files[0]})};e.prototype._execute=function(){var c=this,b=this.$gitPrivateKey.value,
a=this.$url.textContent,e=function(a){if(c._sshService)c._sshService.getKnownHosts().then(function(b){if(c.options.func){var e=typeof c.options.failedOperation==="undefined"?c.options.errordata.failedOperation:c.options.failedOperation;e!=="undefined"&&c._progressService.removeOperation(e);c.options.func({gitSshUsername:c.$gitSshUsername.value,gitSshPassword:c.$isSshPassword.checked?c.$gitSshPassword.value:"",gitPrivateKey:c.$isPrivateKey.checked?a:"",gitPassphrase:c.$isPrivateKey.checked?c.$gitPassphrase.value:
"",knownHosts:b})}});else if(c.options.func){var b=typeof c.options.failedOperation==="undefined"?c.options.errordata.failedOperation:c.options.failedOperation;b!=="undefined"&&c._progressService.removeOperation(b);c.options.func({gitSshUsername:c.$gitSshUsername.value,gitSshPassword:c.$gitSshPassword.value,gitPrivateKey:a,gitPassphrase:c.$gitPassphrase.value,knownHosts:c.$gitSshKnownHosts.value})}};if(this.privateKeyFile){var f=new FileReader;f.onload=function(){return function(d){b=d.target.result;
d=new k(c.options.serviceRegistry);c.$gitSaveCredentials.checked?d.put(a,{gitPrivateKey:b,gitPassphrase:c.$gitPassphrase.value}).then(function(){e(b)}):e(b)}}(this.privateKeyFile);f.readAsText(this.privateKeyFile)}else b.length>0?(f=new k(c.options.serviceRegistry),c.$gitSaveCredentials.checked?f.put(a,{gitPrivateKey:b,gitPassphrase:c.$gitPassphrase.value}).then(function(){e(b)}):e(b)):(f=new k(c.options.serviceRegistry),c.$gitSaveCredentials.checked?f.put(a,{gitSshUsername:c.$gitSshUsername.value,
gitSshPassword:c.$gitSshPassword.value}).then(function(){e(b)}):e(b))};e.prototype.constructor=e;return{GitCredentialsDialog:e}});
define("orion/git/widgets/OpenCommitDialog","require,i18n!git/nls/gitmessages,orion/i18nUtil,orion/Deferred,orion/webui/dialog,orion/webui/littlelib".split(","),function(g,k,j,e,c,b){function a(a){this._init(a)}a.prototype=new c.Dialog;a.prototype.TEMPLATE='<div><label for="resourceName">${Type the commit name (sha1):}</label></div><div><input type="text" id="resourceName"></div><div id="results" style="max-height:400px; height:auto; overflow-y:auto;"></div>';a.prototype._init=function(a){this.title=
a.title||k["Find Commit"];this.modal=!0;this.messages=k;this.SEARCH_DELAY=500;this.timeoutId=null;this.time=0;this.serviceRegistry=a.serviceRegistry;if(!this.serviceRegistry)throw Error("Missing required argument: serviceRegistry");this.repositories=a.repositories;if(!this.repositories)throw Error("Missing required argument: repositories");this.commitName=a.commitName;this._initialize()};a.prototype._bindToDom=function(){var a=this;this.$resourceName.addEventListener("input",function(){a.time=+new Date;
a.timeoutId&&clearTimeout(a.timeoutId);a.timeoutId=setTimeout(a._checkSearch.bind(a),0)},!1);this.$resourceName.addEventListener("keydown",function(c){if(c.keyCode===b.KEY.ENTER){var d=b.$("a",a.$results);d&&(b.stop(c),window.open(d.href),a.hide())}},!1);this.$resourceName.value=this.commitName};a.prototype._checkSearch=function(){clearTimeout(this.timeoutId);var a=(new Date).getTime();a-this.time>this.SEARCH_DELAY?(this.time=a,this._doSearch()):this.timeoutId=setTimeout(this._checkSearch.bind(this),
50)};a.prototype._findCommitLocation=function(a,b,c){var g=this;c||(c=new e);a.length>0?this.serviceRegistry.getService("orion.page.progress").progress(g.serviceRegistry.getService("orion.git.provider").doGitLog("/gitapi/commit/"+b+a[0].ContentLocation+"?page=1&pageSize=1"),"Getting commit details "+b).then(function(a){c.resolve(a.Children[0])},function(){g._findCommitLocation(a.slice(1),b,c)}):c.reject();return c};a.prototype._doSearch=function(){var a=this,c=this.$resourceName&&this.$resourceName.value;
if(c){var d=document.createElement("div");d.appendChild(document.createTextNode(k["Searching..."]));b.empty(this.$results);this.$results.appendChild(d);this.serviceRegistry.getService("orion.page.message").setProgressMessage(k["Looking for the commit"]);this._findCommitLocation(this.repositories,c).then(function(c){b.empty(a.$results);a._displayCommit(c,a.$results);a.serviceRegistry.getService("orion.page.message").setProgressMessage("")},function(){var c=document.createElement("div");c.appendChild(document.createTextNode("No commits found"));
b.empty(a.$results);a.$results.appendChild(c);a.serviceRegistry.getService("orion.page.message").setProgressMessage("")})}};a.prototype._displayCommit=function(a,c){var d=this,e=document.createElement("div");e.style.padding="10px";e.style.maxWidth="480px";b.empty(c);c.appendChild(e);var l=a.Message.split(/(\r?\n|$)/)[0],n=document.createElement("a");n.className="navlinkonpage";n.href=g.toUrl("git/git-commit.html#")+a.Location+"?page=1&pageSize=1";n.textContent=l;e.appendChild(n);n.addEventListener("mouseup",
function(a){a.button===0&&!a.ctrlKey&&!a.metaKey&&d.hide()},!1);n.addEventListener("keyup",function(a){a.keyCode===b.KEY.ENTER&&d.hide()},!1);l=document.createElement("div");l.style.paddingTop="15px";e.appendChild(l);if(a.AuthorImage)e=new Image,e.src=a.AuthorImage,e.name=a.AuthorName,e.className="git-author-icon",l.appendChild(e);e=document.createElement("div");e.textContent=j.formatMessage(k[" authored by ${0} {${1}) on ${2}"],a.AuthorName,a.AuthorEmail,(new Date(a.Time)).toLocaleString());l.appendChild(e);
e=document.createElement("div");e.textContent=j.formatMessage(k["committed by 0 (1)"],a.CommitterName,a.CommitterEmail);l.appendChild(e);e=document.createElement("div");e.style.paddingTop="15px";e.textContent=k["commit:"]+a.Name;l.appendChild(e);if(a.Parents&&a.Parents.length>0)c=document.createElement("div"),c.textContent=k["parent:"],e=document.createElement("a"),e.className="navlinkonpage",e.href=g.toUrl("git/git-commit.html#")+a.Parents[0].Location+"?page=1&pageSize=1",e.textContent=a.Parents[0].Name,
c.appendChild(e),e.addEventListener("mouseup",function(a){a.button===0&&!a.ctrlKey&&!a.metaKey&&d.hide()},!1),e.addEventListener("keyup",function(a){a.keyCode===b.KEY.ENTER&&d.hide()},!1),l.appendChild(c)};a.prototype._beforeHiding=function(){clearTimeout(this._timeoutId)};a.prototype.constructor=a;return{OpenCommitDialog:a}});
define("orion/git/widgets/CommitDialog",["i18n!git/nls/gitmessages","orion/webui/dialog"],function(g,k){function j(e){this._init(e)}j.prototype=new k.Dialog;j.prototype.TEMPLATE='<div style="display: none; padding-top: 10px; padding-bottom: 10px;" id="commitInfoBar"><strong id="commitInfo"></strong></div><div style="padding:4px"><label id="commitMessageLabel" for="commitMessage">${Message:}</label><input id="commitMessage" style="width: 30em" value=""></div><div style="padding:4px"><label id="amendLabel" for="amend">${Amend:}</label><input id="amend" type="checkbox"></div><div style="padding:4px"><label id="committerNameLabel" for="committerName">${Committer Name:}</label><input id="committerName" style="width: 30em" value=""></div><div style="padding:4px"><label id="committerEmailLabel" for="committerEmail">${Committer Email:}</label><input id="committerEmail" style="width: 30em" value=""></div><div style="padding:4px"><label id="authorNameLabel" for="authorName">${Author Name:}</label><input id="authorName" style="width: 30em" value=""></div><div style="padding:4px"><label id="authorEmailLabel" for="authorEmail">${Author Email:}</label><input id="authorEmail" style="width: 30em" value=""></div>';
j.prototype._init=function(e){var c=this;this.title=g["Commit Changes"];this.modal=!0;this.messages=g;this.options=e;this.buttons=[];this.buttons.push({callback:function(){c._execute()},text:"OK",id:"commitChangesButton"});this._initialize()};j.prototype._bindToDom=function(){var e=this;if(this.options.body.Message)this.$commitMessage.value=this.options.body.Message;this.$commitMessage.addEventListener("keyup",function(){e._validate()});if(this.options.body.Amend)this.$amend.checked=!0;if(this.options.body.CommitterName)this.$committerName.value=
this.options.body.CommitterName;this.$committerName.addEventListener("keyup",function(){e._validate()});if(this.options.body.CommitterEmail)this.$committerEmail.value=this.options.body.CommitterEmail;this.$committerEmail.addEventListener("keyup",function(){e._validate()});if(this.options.body.AuthorName)this.$authorName.value=this.options.body.AuthorName;this.$authorName.addEventListener("keyup",function(){e._validate()});if(this.options.body.AuthorEmail)this.$authorEmail.value=this.options.body.AuthorEmail;
this.$authorEmail.addEventListener("keyup",function(){e._validate()});this._validate()};j.prototype._validate=function(){this.$commitMessage.value?this.$committerName.value?this.$committerEmail.value?this.$authorName.value?this.$authorEmail.value?(this.$commitInfoBar.style.display="none",this.$commitChangesButton.classList.remove(this.DISABLED)):(this.$commitInfoBar.style.display="block",this.$commitChangesButton.classList.add(this.DISABLED),this.$commitInfo.textContent=g["The author mail is required."]):
(this.$commitInfoBar.style.display="block",this.$commitChangesButton.classList.add(this.DISABLED),this.$commitInfo.textContent=g["The author name is required."]):(this.$commitInfoBar.style.display="block",this.$commitChangesButton.classList.add(this.DISABLED),this.$commitInfo.textContent=g["The committer mail is required."]):(this.$commitInfoBar.style.display="block",this.$commitChangesButton.classList.add(this.DISABLED),this.$commitInfo.textContent=g["The committer name is required."]):(this.$commitInfoBar.style.display=
"block",this.$commitChangesButton.classList.add(this.DISABLED),this.$commitInfo.textContent=g["The commit message is required."])};j.prototype._execute=function(){if(!this.$commitChangesButton.classList.contains(this.DISABLED)){if(this.options.func){var e={};e.Message=this.$commitMessage.value;e.Amend=this.$amend.checked?!0:!1;e.CommitterName=this.$committerName.value;e.CommitterEmail=this.$committerEmail.value;e.AuthorName=this.$authorName.value;e.AuthorEmail=this.$authorEmail.value;this.options.func(e)}this.hide()}};
j.prototype.constructor=j;return{CommitDialog:j}});
define("orion/git/widgets/ApplyPatchDialog",["i18n!git/nls/gitmessages","orion/webui/dialog"],function(g,k){function j(e){this._init(e)}j.prototype=new k.Dialog;j.prototype.TEMPLATE='<div style="padding:4px"><input type="radio" name="radio" value="urlRadio" id="urlRadio" checked/>URL:<input type="text" name="url" id="url"/></div><div style="padding:4px"><input type="radio" name="radio" value="fileRadio" id="fileRadio"/>File:<input type="file" name="selectedFile" id="selectedFile" class="uploadChooser" /></div>';j.prototype._init=
function(e){var c=this;this.title=g["Apply Patch"];this.modal=!0;this.messages=g;this.options=e;this.buttons=[];this.buttons.push({callback:function(){c._applyPatch()},text:"OK"});this._initialize()};j.prototype._bindToDom=function(){this.$selectedFile.onchange=function(){this.$urlRadio.checked=!1;this.$fileRadio.checked="fileRadio"}.bind(this);this.$url.onchange=function(){this.$urlRadio.checked="urlRadio";this.$fileRadio.checked=!1}.bind(this)};j.prototype._applyPatch=function(){var e=new FormData;
e.append("uploadedfile",this.$selectedFile.files[0]);e.append("url",this.$url.value);e.append("radio",this.$fileRadio.checked?"fileRadio":"urlRadio");this.req=new XMLHttpRequest;this.req.open("post",this.options.diffLocation);this.req.setRequestHeader("Orion-Version","1");this.req.onreadystatechange=this.handleReadyState.bind(this);this.req.send(e)};j.prototype.handleReadyState=function(){this.req.readyState===4&&(this.req.status===200?this.options.deferred&&this.options.deferred.resolve(this.req.responseText):
this.options.deferred&&this.options.deferred.reject(this.req.responseText),this.hide())};j.prototype.constructor=j;return{ApplyPatchDialog:j}});
define("orion/git/gitCommands","i18n!git/nls/gitmessages,require,orion/Deferred,orion/i18nUtil,orion/webui/littlelib,orion/commands,orion/commandRegistry,orion/git/util,orion/compare/compareUtils,orion/git/gitPreferenceStorage,orion/git/gitConfigPreference,orion/git/widgets/ConfirmPushDialog,orion/git/widgets/RemotePrompterDialog,orion/git/widgets/ReviewRequestDialog,orion/git/widgets/CloneGitRepositoryDialog,orion/git/widgets/GitCredentialsDialog,orion/git/widgets/OpenCommitDialog,orion/git/widgets/CommitDialog,orion/git/widgets/ApplyPatchDialog,orion/URL-shim,orion/PageLinks,orion/URITemplate".split(","),function(g,
k,j,e,c,b,a,i,f,d,h,l,n,m,q,s,p,r,t,o,v,x){var u={};(function(){function o(a){var b;try{b=JSON.parse(a.responseText)}catch(c){b={Message:g["Problem while performing the action"]}}b.HttpCode=a.status;return b}var z=!1;u.updateNavTools=function(a,b,d,e,f,g,h){var i=c.node(e);if(i)b.destroy(i);else throw"could not find toolbar "+e;b.renderCommands(e,i,g,d,"button");if(h&&(e=c.node(h)))b.destroy(e),b.renderCommands(h,e,g,d,"button");if(f&&(g=c.node(f)))b.destroy(f),b.renderCommands(f,g,null,d,"button");
z||(z=!0,a.getService("orion.page.selection").addEventListener("selectionChanged",function(a){var e=c.node(f);e&&(b.destroy(e),b.renderCommands(f,e,a.selections,d,"button"))}))};u.handleKnownHostsError=function(a,b,c,d){if(confirm(e.formatMessage(g["Would you like to add ${0} key for host ${1} to continue operation? Key fingerpt is ${2}."],b.KeyType,b.Host,b.HostFingerprint))){var f=a.getService("orion.net.ssh");f.addKnownHosts(b.Host+" "+b.KeyType+" "+b.HostKey).then(function(){f.getKnownHosts().then(function(b){c.knownHosts=
b;typeof c.failedOperation!=="undefined"&&a.getService("orion.page.progress").removeOperation(c.failedOperation);d(c)})})}};u.handleSshAuthenticationError=function(a,b,c,e,f){var b=b?b.Url:void 0,g=function(){(new s.GitCredentialsDialog({title:f,serviceRegistry:a,func:e,errordata:c.errordata,failedOperation:c.failedOperation})).show()};c.gitSshUsername&&c.gitSshUsername!==""||c.gitSshPassword&&c.gitSshPassword!==""||c.gitPrivateKey&&c.gitPrivateKey!==""?g():(new d(a)).get(b).then(function(b){b.gitPrivateKey!==
""||b.gitSshUsername!==""||b.gitSshPassword!==""?(typeof c.failedOperation!=="undefined"&&a.getService("orion.page.progress").removeOperation(c.failedOperation),e({knownHosts:c.knownHosts,gitSshUsername:b.gitSshUsername,gitSshPassword:b.gitSshPassword,gitPrivateKey:b.gitPrivateKey,gitPassphrase:b.gitPassphrase})):g()},g)};u.getDefaultSshOptions=function(a,b){var c=new j,d=a.getService("orion.net.ssh"),e=b&&!b.optionsRequested?b.valueFor("sshuser"):"",f=b&&!b.optionsRequested?b.valueFor("sshpassword"):
"";d.getKnownHosts().then(function(a){c.resolve({knownHosts:a,gitSshUsername:e,gitSshPassword:f,gitPrivateKey:"",gitPassphrase:""})});return c};u.handleProgressServiceResponse=function(a,b,c,d,e,f){a&&a.status!==void 0&&(a=o(a));if(!a||a.HttpCode===void 0)d&&d(a);else switch(a.HttpCode){case 401:if(a.JsonData)b.errordata=a.JsonData;if(a.failedOperation)b.failedOperation=a.failedOperation;u.handleSshAuthenticationError(c,a.JsonData,b,e,f);break;case 400:if(a.JsonData&&a.JsonData.HostKey){if(a.failedOperation)b.failedOperation=
a.failedOperation;u.handleKnownHostsError(c,a.JsonData,b,e);break}default:b=[],b.Severity="Error",b.HTML=!1,b.Message=a.DetailedMessage?a.DetailedMessage:a.Message,c.getService("orion.page.message").setProgressResult(b),d&&d(a)}};u.gatherSshCredentials=function(a,b,c){var f=new j,h;if(b.items.RemoteLocation!==void 0)h=b.items.RemoteLocation[0].GitUrl;else if(b.items.GitUrl!==void 0)h=b.items.GitUrl;else if(b.items.errorData!==void 0)h=b.items.errorData.Url;else if(b.items.toRef!==void 0)h=b.items.toRef.RemoteLocation[0].GitUrl;
var i=function(c){a.getService("orion.net.ssh").getKnownHosts().then(function(a){b.sshObject=c;f.resolve({knownHosts:a,gitSshUsername:c.gitSshUsername,gitSshPassword:c.gitSshPassword,gitPrivateKey:c.gitPrivateKey,gitPassphrase:c.gitPassphrase})})},k=b.errorData;if(k&&k.HostKey)return confirm(e.formatMessage(g["Would you like to add ${0} key for host ${1} to continue operation? Key fingerpt is ${2}."],k.KeyType,k.Host,k.HostFingerprint))&&a.getService("orion.net.ssh").addKnownHosts(k.Host+" "+k.KeyType+
" "+k.HostKey).then(function(){b.sshObject&&(b.sshObject.gitSshUsername!==""||b.sshObject.gitSshPassword!==""||b.sshObject.gitPrivateKey!=="")?i({gitSshUsername:"",gitSshPassword:"",gitPrivateKey:"",gitPassphrase:""}):(new d(a)).get(h).then(function(a){i(a)},function(){i({gitSshUsername:"",gitSshPassword:"",gitPrivateKey:"",gitPassphrase:""})})}),f;var l=function(){if(!b.parameters&&!b.optionsRequested)i({gitSshUsername:"",gitSshPassword:"",gitPrivateKey:"",gitPassphrase:""});else if(b.parameters&&
!b.optionsRequested){var e=b.parameters?b.parameters.valueFor("sshuser"):"",f=b.parameters?b.parameters.valueFor("sshpassword"):"",g=b.parameters&&b.parameters.valueFor("saveCredentials")?b.parameters.valueFor("saveCredentials"):!1,j=new d(a);g?j.put(h,{gitSshUsername:e,gitSshPassword:f}).then(function(){i({gitSshUsername:e,gitSshPassword:f,gitPrivateKey:"",gitPassphrase:""})}):i({gitSshUsername:e,gitSshPassword:f,gitPrivateKey:"",gitPassphrase:""})}else(new s.GitCredentialsDialog({title:c,serviceRegistry:a,
func:i,errordata:k})).show()};b.sshObject&&(b.sshObject.gitSshUsername!==""||b.sshObject.gitSshPassword!==""||b.sshObject.gitPrivateKey!=="")?l():(new d(a)).get(h).then(function(a){a.gitPrivateKey!==""||a.gitSshUsername!==""||a.gitSshPassword!==""?i(a):l()},l);return f};u.handleGitServiceResponse=function(a,b,c,d){a&&a.status!==void 0&&(a=o(a));if(!a||!a.HttpCode)c&&c(a);else switch(a.HttpCode){case 401:d(a);break;case 400:if(a.JsonData&&a.JsonData.HostKey){d(a);break}default:d=[],d.Severity="Error",
d.HTML=!1,d.Message=a.DetailedMessage?a.DetailedMessage:a.Message,b.getService("orion.page.message").setProgressResult(d),c&&c(a)}};u.createFileCommands=function(c,h,p){function q(a){var b={Severity:"Error",HTML:!1};try{var d=JSON.parse(a.responseText);b.Message=d.DetailedMessage?d.DetailedMessage:d.Message?d.Message:g["Problem while performing the action"]}catch(e){b.Message=g["Problem while performing the action"]}c.getService("orion.page.message").setProgressResult(b)}var o=new a.ParametersDescription([new a.CommandParameter("name",
"text",g["Local Branch Name:"])]),o=new b.Command({name:g.Checkout,tooltip:g["Checkout the current tag, creating a local branch based on its contents."],imageClass:"git-sprite-checkout",spriteClass:"gitCommandSprite",id:"eclipse.checkoutTag",parameters:o,callback:function(a){var b=a.items,d=function(a,b,d){c.getService("orion.page.progress").showWhile(c.getService("orion.git.provider").checkoutTag(a,b,d),e.formatMessage(g["Checking out tag ${0}"],d)).then(function(){p.changedItem()},q)},f=b.Repository?
b.Repository.Location:b.CloneLocation;a.parameters.valueFor("name")&&!a.parameters.optionsRequested&&d(f,b.Name,a.parameters.valueFor("name"))},visibleWhen:function(a){return a.Type==="Tag"}});h.addCommand(o);o=new b.Command({name:g.Checkout,tooltip:g["Checkout the branch or corresponding local branch and make it active. If the remote tracking branch does not have a corresponding local branch, the local branch will be created first."],imageClass:"git-sprite-checkout",spriteClass:"gitCommandSprite",
id:"eclipse.checkoutBranch",callback:function(a){var b=a.items,d=c.getService("orion.git.provider"),f=c.getService("orion.page.message"),h=c.getService("orion.page.progress");f.setProgressMessage(b.Name?e.formatMessage(g["Checking out branch ${0}..."],b.Name):g["Checking out branch..."]);b.Type==="Branch"?h.progress(d.checkoutBranch(b.CloneLocation,b.Name),"Checking out branch "+b.Name).then(function(){f.setProgressResult(g["Branch checked out."]);p.changedItem(b.parent)},function(a){q(a)}):h.progress(d.addBranch(b.Repository?
b.Repository.BranchLocation:b.parent.parent.BranchLocation,null,b.Name),"Adding branch "+b.Name).then(function(a){h.progress(d.checkoutBranch(a.CloneLocation,a.Name),"Checking out branch "+b.Name).then(function(){f.setProgressResult(g["Branch checked out."]);p.changedItem(b.Repository?b.Repository.BranchLocation:b.parent.parent.parent)},function(a){q(a)})},function(a){q(a)})},visibleWhen:function(a){return a.Type==="Branch"||a.Type==="RemoteTrackingBranch"}});h.addCommand(o);o=new a.ParametersDescription([new a.CommandParameter("name",
"text","Name:")]);o=new b.Command({name:g["New Branch"],tooltip:g["Add a new local branch to the repository"],id:"eclipse.addBranch",parameters:o,callback:function(a){var b=a.items,d=c.getService("orion.page.progress"),e=function(a,e){d.progress(c.getService("orion.git.provider").addBranch(a,e),"Adding branch "+e).then(function(){p.changedItem(b)},q)},f;f=b.Type==="Clone"?b.BranchLocation:b.Location;a.parameters.valueFor("name")&&!a.parameters.optionsRequested&&e(f,a.parameters.valueFor("name"))},
visibleWhen:function(a){return a.GroupNode&&a.Name==="Branches"||a.Type==="Clone"&&p.parentId==="artifacts"}});h.addCommand(o);o=new b.Command({name:g.Delete,tooltip:g["Delete the local branch from the repository"],imageClass:"core-sprite-delete",id:"eclipse.removeBranch",callback:function(a){var b=a.items,a=c.getService("orion.page.progress");confirm(e.formatMessage(g["Are you sure you want to delete branch ${0}?"],b.Name))&&a.progress(c.getService("orion.git.provider").removeBranch(b.Location),
"Removing branch "+b.Name).then(function(){p.changedItem?p.changedItem(b.parent):p.displayBranches&&p.displayBranches(b.ParentLocation,null)},q)},visibleWhen:function(a){return a.Type==="Branch"&&!a.Current}});h.addCommand(o);o=new b.Command({name:g.Delete,tooltip:g["Delete the remote tracking branch from the repository"],imageClass:"core-sprite-delete",id:"eclipse.removeRemoteBranch",callback:function(a){var b=a.items,d=c.getService("orion.page.progress");confirm(e.formatMessage(g["You're going to delete remote branch ${0} and push the change."],
b.Name)+"\n\n"+g["Are you sure?"])&&u.getDefaultSshOptions(c).then(function(a){var e=arguments.callee,f=c.getService("orion.git.provider"),h=c.getService("orion.page.message"),f=d.progress(f.doPush(b.Location,"",!1,!1,a.gitSshUsername,a.gitSshPassword,a.knownHosts,a.gitPrivateKey,a.gitPassphrase),g["Removing remote branch: "]+b.Name);h.createProgressMonitor(f,g["Removing remote branch: "]+b.Name);f.then(function(d){u.handleProgressServiceResponse(d,a,c,function(a){a.Result.Severity=="Ok"&&p.changedItem(b.parent)},
e,g["Delete Remote Branch"])},function(d){u.handleProgressServiceResponse(d,a,c,function(){},e,g["Removing remote branch: "]+b.Name)})})},visibleWhen:function(a){return a.Type==="RemoteTrackingBranch"}});h.addCommand(o);o=new a.ParametersDescription([new a.CommandParameter("name","text","Name:"),new a.CommandParameter("url","url","Url:")]);o=new b.Command({name:g["New Remote"],tooltip:g["Add a new remote to the repository"],id:"eclipse.addRemote",parameters:o,callback:function(a){var b=a.items,d=
c.getService("orion.page.progress"),e=function(a,e,f){d.progress(c.getService("orion.git.provider").addRemote(a,e,f),"Adding remote "+a).then(function(){p.changedItem(b)},q)},f;f=b.Type==="Clone"?b.RemoteLocation:b.Location;a.parameters.valueFor("name")&&a.parameters.valueFor("url")&&e(f,a.parameters.valueFor("name"),a.parameters.valueFor("url"))},visibleWhen:function(a){return a.GroupNode&&a.Name==="Remotes"||a.Type==="Clone"&&p.parentId==="artifacts"}});h.addCommand(o);o=new b.Command({name:g.Delete,
tooltip:g["Delete the remote from the repository"],imageClass:"core-sprite-delete",id:"eclipse.removeRemote",callback:function(a){var b=a.items;confirm(e.formatMessage(g["Are you sure you want to delete remote ${0}?"],b.Name))&&c.getService("orion.page.progress").progress(c.getService("orion.git.provider").removeRemote(b.Location),"Removing remote "+b.Name).then(function(){p.changedItem(b.parent)},q)},visibleWhen:function(a){return a.Type==="Remote"}});h.addCommand(o);o=new b.Command({name:g.Pull,
tooltip:g["Pull from the repository"],imageClass:"git-sprite-pull",spriteClass:"gitCommandSprite",id:"eclipse.orion.git.pull",callback:function(a){var b=a.items,d=b.Location,e=b.Name;u.getDefaultSshOptions(c).then(function(a){var f=arguments.callee,h=c.getService("orion.git.provider"),i=c.getService("orion.page.message"),h=c.getService("orion.page.progress").progress(h.doPull(d,!1,a.gitSshUsername,a.gitSshPassword,a.knownHosts,a.gitPrivateKey,a.gitPassphrase),g["Pulling: "]+e);i.createProgressMonitor(h,
g["Pulling: "]+e);var j;h.then(function(d){u.handleProgressServiceResponse(d,a,c,function(){b.Type==="Clone"&&p.changedItem(b)},f,"Pull Git Repository")},function(d){if(j)d.failedOperation=j;u.handleProgressServiceResponse(d,a,c,function(){p.changedItem(b)},f,g["Pull Git Repository"])},function(a){j=a.Location})})},visibleWhen:function(a){return a.Type==="Clone"}});h.addCommand(o);o=new b.Command({name:g["Git Log"],tooltip:g["Open the log for the branch"],id:"eclipse.openGitLog",hrefCallback:function(a){a=
a.items;return k.toUrl("git/git-log.html")+"#"+a.CommitLocation+"?page=1"},visibleWhen:function(a){return a.Type==="Branch"||a.Type==="RemoteTrackingBranch"}});h.addCommand(o);o=new b.Command({name:g["Git Log"],tooltip:g["Open the log for the repository"],id:"eclipse.openGitLogAll",imageClass:"git-sprite-log",spriteClass:"gitCommandSprite",hrefCallback:function(a){return k.toUrl("git/git-log.html")+"#"+a.items.CommitLocation+"?page=1"},visibleWhen:function(a){return!a.CommitLocation||!a.StatusLocation?
!1:!0}});h.addCommand(o);o=new b.Command({name:g["Git Status"],tooltip:g["Open the status for the repository"],id:"eclipse.openGitStatus",hrefCallback:function(a){return k.toUrl(i.statusUILocation)+"#"+a.items.StatusLocation},visibleWhen:function(a){return!a.StatusLocation?!1:!0}});h.addCommand(o);o=new b.Command({name:g["Show in Navigator"],tooltip:g["Show the repository folder in the file navigator"],id:"eclipse.openCloneContent",hrefCallback:function(a){return k.toUrl("navigate/table.html")+"#"+
a.items.ContentLocation+"?depth=1"},visibleWhen:function(a){return!a.ContentLocation?!1:!0}});h.addCommand(o);o=new b.Command({name:g["Compare With Each Other"],id:"eclipse.compareGitCommits",hrefCallback:function(a){a=a.items;return c.getService("orion.page.progress").progress(c.getService("orion.git.provider").getDiff(a[1].DiffLocation,a[0].Name),"Generating Diff for "+a[0].Name+" and "+a[1].Name).then(function(a){return f.generateCompareHref(a,{readonly:!0})})},visibleWhen:function(a){return p.isDirectory?
!1:Array.isArray(a)&&a.length===2&&a[0].Type==="Commit"&&a[1].Type==="Commit"?!0:!1}});h.addCommand(o);o=new b.Command({name:g["Compare With Working Tree"],id:"eclipse.compareWithWorkingTree",hrefCallback:function(a){return f.generateCompareHref(a.items.DiffLocation,{})},visibleWhen:function(a){return a.Type==="Commit"&&a.ContentLocation!==null&&!p.isDirectory}});h.addCommand(o);o=new b.Command({name:g.Open,id:"eclipse.openGitCommit",hrefCallback:function(a){return k.toUrl("edit/edit.html")+"#"+a.items.ContentLocation},
visibleWhen:function(a){return a.Type==="Commit"&&a.ContentLocation!=null&&!p.isDirectory}});h.addCommand(o);o=new b.Command({name:g.Fetch,tooltip:g["Fetch from the remote"],imageClass:"git-sprite-fetch",spriteClass:"gitCommandSprite",id:"eclipse.orion.git.fetch",callback:function(b){var e=b.items,f=e.Location,i=e.Name,j=function(b,e){b.JsonData.HostKey?(e.parameters=null,e.errorData=b.JsonData,e.errorData.failedOperation=b.failedOperation,h.collectParameters(e)):e.optionsRequested?(e.errorData=b.JsonData,
e.errorData.failedOperation=b.failedOperation,h.collectParameters(e)):(new d(c)).isEnabled().then(function(c){e.parameters=c?b.JsonData.User?new a.ParametersDescription([new a.CommandParameter("sshpassword","password",g["SSH Password:"]),new a.CommandParameter("saveCredentials","boolean",g["Don't prompt me again:"])],{hasOptionalParameters:!0}):new a.ParametersDescription([new a.CommandParameter("sshuser","text",g["SSH User Name:"]),new a.CommandParameter("sshpassword","password",g["SSH Password:"]),
new a.CommandParameter("saveCredentials","boolean",g["Don't prompt me again:"])],{hasOptionalParameters:!0}):b.JsonData.User?new a.ParametersDescription([new a.CommandParameter("sshpassword","password",g["SSH Password:"])],{hasOptionalParameters:!0}):new a.ParametersDescription([new a.CommandParameter("sshuser","text",g["SSH User Name:"]),new a.CommandParameter("sshpassword","password",g["SSH Password:"])],{hasOptionalParameters:!0});e.errorData=b.JsonData;e.errorData.failedOperation=b.failedOperation;
h.collectParameters(e)})},k=function(){b.parameters&&b.parameters.optionsRequested?(b.parameters=null,b.optionsRequested=!0,h.collectParameters(b)):(b.errorData&&b.errorData.failedOperation&&c.getService("orion.page.progress").removeOperation(b.errorData.failedOperation),u.gatherSshCredentials(c,b).then(function(a){var d=c.getService("orion.git.provider"),h=c.getService("orion.page.message"),a=c.getService("orion.page.progress").progress(d.doFetch(f,!1,a.gitSshUsername,a.gitSshPassword,a.knownHosts,
a.gitPrivateKey,a.gitPassphrase),g["Fetching remote: "]+i);h.createProgressMonitor(a,g["Fetching remote: "]+i);a.then(function(a){u.handleGitServiceResponse(a,c,function(){p.changedItem(e)},function(a){j(a,b)})},function(a){u.handleGitServiceResponse(a,c,function(){p.changedItem(e)},function(a){j(a,b)})})}))};if(b.items.GitUrl)k();else{var l=c.getService("orion.git.provider"),m=c.getService("orion.page.progress");m.progress(l.getGitRemote(f),"Getting remote details "+i).then(function(a){m.progress(l.getGitClone(a.CloneLocation),
"Getting git repository information "+a.Name).then(function(a){b.items.GitUrl=a.Children[0].GitUrl;k()},q)},q)}},visibleWhen:function(a){return a.Type==="RemoteTrackingBranch"?!0:a.Type==="Remote"?!0:a.Type==="Commit"&&a.toRef&&a.toRef.Type==="RemoteTrackingBranch"?!0:!1}});h.addCommand(o);o=new b.Command({name:g["Force Fetch"],imageClass:"git-sprite-fetch",spriteClass:"gitCommandSprite",tooltip:g["Fetch from the remote branch into your remote tracking branch overriding its current content"],id:"eclipse.orion.git.fetchForce",
callback:function(b){if(confirm(g["You're going to override content of the remote tracking branch. This can cause the branch to lose commits."]+"\n\n"+g["Are you sure?"])){var e=b.items,f=e.Location,i=e.Name,j=function(b,e){b.JsonData.HostKey?(e.parameters=null,e.errorData=b.JsonData,e.errorData.failedOperation=b.failedOperation,h.collectParameters(e)):e.optionsRequested?(e.errorData=b.JsonData,h.collectParameters(e)):(new d(c)).isEnabled().then(function(c){e.parameters=c?b.JsonData.User?new a.ParametersDescription([new a.CommandParameter("sshpassword",
"password",g["SSH Password:"]),new a.CommandParameter("saveCredentials","boolean",g["Don't prompt me again:"])],{hasOptionalParameters:!0}):new a.ParametersDescription([new a.CommandParameter("sshuser","text",g["SSH User Name:"]),new a.CommandParameter("sshpassword","password",g["SSH Password:"]),new a.CommandParameter("saveCredentials","boolean",g["Don't prompt me again:"])],{hasOptionalParameters:!0}):b.JsonData.User?new a.ParametersDescription([new a.CommandParameter("sshpassword","password",g["SSH Password:"])],
{hasOptionalParameters:!0}):new a.ParametersDescription([new a.CommandParameter("sshuser","text",g["SSH User Name:"]),new a.CommandParameter("sshpassword","password",g["SSH Password:"])],{hasOptionalParameters:!0});e.errorData=b.JsonData;e.errorData.failedOperation=b.failedOperation;h.collectParameters(e)})},k=function(){b.parameters&&b.parameters.optionsRequested?(b.parameters=null,b.optionsRequested=!0,h.collectParameters(b)):(b.errorData&&b.errorData.failedOperation&&c.getService("orion.page.progress").removeOperation(b.errorData.failedOperation),
u.gatherSshCredentials(c,b).then(function(a){var d=c.getService("orion.git.provider"),h=c.getService("orion.page.progress"),k=c.getService("orion.page.message"),a=h.progress(d.doFetch(f,!0,a.gitSshUsername,a.gitSshPassword,a.knownHosts,a.gitPrivateKey,a.gitPassphrase),g["Fetching remote: "]+i);k.createProgressMonitor(a,g["Fetching remote: "]+i);a.then(function(a){u.handleGitServiceResponse(a,c,function(){p.changedItem(e)},function(a){j(a,b)})},function(a){u.handleGitServiceResponse(a,c,function(){p.changedItem(e)},
function(a){j(a,b)})})}))};if(b.items.GitUrl)k();else{var l=c.getService("orion.git.provider");l.getGitRemote(f).then(function(a){l.getGitClone(a.CloneLocation).then(function(a){b.items.GitUrl=a.Children[0].GitUrl;k()})})}}},visibleWhen:function(a){return a.Type==="RemoteTrackingBranch"?!0:a.Type==="Remote"?!0:a.Type==="Commit"&&a.toRef&&a.toRef.Type==="RemoteTrackingBranch"?!0:!1}});h.addCommand(o);o=new b.Command({name:g.Merge,tooltip:g["Merge the content from the branch to your active branch"],
imageClass:"git-sprite-merge",spriteClass:"gitCommandSprite",id:"eclipse.orion.git.merge",callback:function(a){var b=a.items,a=c.getService("orion.git.provider"),d=c.getService("orion.page.progress"),f=c.getService("orion.page.message");d.progress(a.doMerge(b.HeadLocation,b.Name,!1),"Merging "+b.Name).then(function(a){var c={};if(a.Result==="FAST_FORWARD"||a.Result==="ALREADY_UP_TO_DATE")c.Severity="Ok",c.HTML=!1,c.Message=a.Result;else if(a.Result){var d=b.HeadLocation.replace("commit/HEAD","status");
c.Severity="Warning";c.HTML=!0;c.Message="<span>"+a.Result;if(a.FailingPaths){var h="",j=!0,l;for(l in a.FailingPaths)j||(h+=", "),j=!1,h+=l;if(!j)c.Severity="Error",c.Message+=". "+e.formatMessage(g["Failing paths: ${0}"],h)}c.Message+=e.formatMessage(g[". Go to ${0}."],'<a href="'+k.toUrl(i.statusUILocation)+"#"+d+'">'+g["Git Status page"]+"</a>")+"</span>"}else if(a.error)d=b.HeadLocation.replace("commit/HEAD","status"),c.Severity="Error",a.error.responseText&&JSON.parse(a.error.responseText)?
(a=JSON.parse(a.error.responseText),c.Message=a.DetailedMessage?a.DetailedMessage:a.Message):c.Message=a.error.message,c.HTML=!0,c.Message="<span>"+c.Message+e.formatMessage(g[". Go to ${0}."],'<a href="'+k.toUrl(i.statusUILocation)+"#"+d+'">'+g["Git Status page"]+"</a>")+"</span>";f.setProgressResult(c);p.changedItem(b)},function(a,d){var f=[],h=b.HeadLocation.replace("commit/HEAD","status");f.Severity="Error";f.HTML=!0;f.Message="<span>"+JSON.stringify(d.xhr.responseText).DetailedMessage+e.formatMessage(g[". Go to ${0}."],
'<a href="'+k.toUrl(i.statusUILocation)+"#"+h+'">'+g["Git Status page"]+"</a>")+".</span>";c.getService("orion.page.message").setProgressResult(f);p.changedItem(b)})},visibleWhen:function(a){return a.Type==="RemoteTrackingBranch"?!0:a.Type==="Branch"&&!a.Current?!0:a.Type==="Commit"&&a.toRef&&a.toRef.Type==="RemoteTrackingBranch"?!0:!1}});h.addCommand(o);o=new b.Command({name:g["Merge Squash"],tooltip:g["Squash the content of the branch to the index"],imageClass:"git-sprite-merge_squash",spriteClass:"gitCommandSprite",
id:"eclipse.orion.git.mergeSquash",callback:function(a){var b=a.items,a=c.getService("orion.git.provider"),d=c.getService("orion.page.progress"),f=c.getService("orion.page.message");d.progress(a.doMerge(b.HeadLocation,b.Name,!0),"Merging "+b.Name).then(function(a){var c=[];if(a.Result==="FAST_FORWARD_SQUASHED"||a.Result==="ALREADY_UP_TO_DATE")c.Severity="Ok",c.HTML=!1,c.Message=a.Result;else if(a.Result){var d=b.HeadLocation.replace("commit/HEAD","status");c.Severity="Warning";c.HTML=!0;c.Message=
"<span>"+a.Result+e.formatMessage(g[". Go to ${0}."],'<a href="'+k.toUrl(i.statusUILocation)+"#"+d+'">'+g["Git Status page"]+"</a>")+"</span>"}else if(a.error)d=b.HeadLocation.replace("commit/HEAD","status"),c.Severity="Error",a.error.responseText&&JSON.parse(a.error.responseText)?(a=JSON.parse(a.error.responseText),c.Message=a.DetailedMessage?a.DetailedMessage:a.Message):c.Message=a.error.message,c.HTML=!0,c.Message="<span>"+c.Message+e.formatMessage(g[". Go to ${0}."],'<a href="'+k.toUrl(i.statusUILocation)+
"#"+d+'">'+g["Git Status page"]+"</a>")+"</span>";f.setProgressResult(c);p.changedItem(b)},function(a,d){var f=[],h=b.HeadLocation.replace("commit/HEAD","status");f.Severity="Error";f.HTML=!0;f.Message="<span>"+JSON.stringify(d.xhr.responseText).DetailedMessage+e.formatMessage(g[". Go to ${0}."],'<a href="'+k.toUrl(i.statusUILocation)+"#"+h+'">'+g["Git Status page"]+"</a>")+".</span>";c.getService("orion.page.message").setProgressResult(f);p.changedItem(b)})},visibleWhen:function(a){return a.Type===
"RemoteTrackingBranch"?!0:a.Type==="Branch"&&!a.Current?!0:a.Type==="Commit"&&a.toRef&&a.toRef.Type==="RemoteTrackingBranch"?!0:!1}});h.addCommand(o);o=new b.Command({name:g.Rebase,tooltip:g["Rebase your commits by removing them from the active branch, starting the active branch again based on the latest state of the selected branch "]+"and applying each commit again to the updated active branch.",id:"eclipse.orion.git.rebase",imageClass:"git-sprite-rebase",spriteClass:"gitCommandSprite",callback:function(a){var b=
a.items,a=c.getService("orion.page.message"),d=c.getService("orion.page.progress").progress(c.getService("orion.git.provider").doRebase(b.HeadLocation,b.Name,"BEGIN"),b.Name?g["Rebase on top of "]+b.Name:g.Rebase);a.createProgressMonitor(d,b.Name?g["Rebase on top of "]+b.Name:g.Rebase);d.then(function(a){var d=[],f=b.HeadLocation.replace("commit/HEAD","status");a.Result==="OK"||a.Result==="FAST_FORWARD"||a.Result==="UP_TO_DATE"?(d.Severity="Ok",d.HTML=!1,d.Message=a.Result):a.Result==="STOPPED"?(d.Severity=
"Warning",d.HTML=!0,d.Message="<span>"+a.Result+g[". Some conflicts occurred. Please resolve them and continue, skip patch or abort rebasing"]+e.formatMessage(g[". Go to ${0}."],'<a href="'+k.toUrl(i.statusUILocation)+"#"+f+'">'+g["Git Status page"]+"</a>")+".</span>"):a.Result==="FAILED_WRONG_REPOSITORY_STATE"?(d.Severity="Error",d.HTML=!0,d.Message="<span>"+a.Result+g[". Repository state is invalid (i.e. already during rebasing)"]+e.formatMessage(". Go to ${0}.",'<a href="'+k.toUrl(i.statusUILocation)+
"#"+f+'">'+g["Git Status page"]+"</a>")+".</span>"):a.Result==="FAILED_UNMERGED_PATHS"?(d.Severity="Error",d.HTML=!0,d.Message="<span>"+a.Result+g[". Repository contains unmerged paths"]+e.formatMessage(g[". Go to ${0}."],'<a href="'+k.toUrl(i.statusUILocation)+"#"+f+'">'+g["Git Status page"]+"</a>")+".</span>"):a.Result==="FAILED_PENDING_CHANGES"?(d.Severity="Error",d.HTML=!0,d.Message="<span>"+a.Result+g[". Repository contains pending changes. Please commit or stash them"]+e.formatMessage(g[". Go to ${0}."],
'<a href="'+k.toUrl(i.statusUILocation)+"#"+f+'">Git Status page</a>')+".</span>"):(d.Severity="Warning",d.HTML=!0,d.Message="<span>"+a.Result+e.formatMessage(g[". Go to ${0}."],'<a href="'+k.toUrl(i.statusUILocation)+"#"+f+'">'+g["Git Status page"]+"</a>")+".</span>");c.getService("orion.page.message").setProgressResult(d);p.changedItem(b)},q)},visibleWhen:function(a){this.tooltip=g["Rebase your commits by removing them from the active branch, "]+g["starting the active branch again based on the latest state of '"]+
a.Name+"' "+g["and applying each commit again to the updated active branch."];return a.Type==="RemoteTrackingBranch"||a.Type==="Branch"&&!a.Current}});h.addCommand(o);o=new b.Command({name:g["Push All"],tooltip:g["Push commits and tags from your local branch into the remote branch"],imageClass:"git-sprite-push",spriteClass:"gitCommandSprite",id:"eclipse.orion.git.push",callback:function(b){var e=b.targetBranch,f,i=b.items;if(i.toRef)i=i.toRef;i.CloneLocation.split("/");var k=function(b,e){b.JsonData.HostKey?
(e.parameters=null,e.errorData=b.JsonData,e.errorData.failedOperation=b.failedOperation,h.collectParameters(e)):e.optionsRequested?(e.errorData=b.JsonData,e.errorData.failedOperation=b.failedOperation,h.collectParameters(e)):(new d(c)).isEnabled().then(function(c){e.parameters=c?b.JsonData.User?new a.ParametersDescription([new a.CommandParameter("sshpassword","password",g["SSH Password:"]),new a.CommandParameter("saveCredentials","boolean",g["Don't prompt me again:"])],{hasOptionalParameters:!0}):
new a.ParametersDescription([new a.CommandParameter("sshuser","text",g["SSH User Name:"]),new a.CommandParameter("sshpassword","password",g["SSH Password:"]),new a.CommandParameter("saveCredentials","boolean",g["Don't prompt me again:"])],{hasOptionalParameters:!0}):b.JsonData.User?new a.ParametersDescription([new a.CommandParameter("sshpassword","password",g["SSH Password:"])],{hasOptionalParameters:!0}):new a.ParametersDescription([new a.CommandParameter("sshuser","text",g["SSH User Name:"]),new a.CommandParameter("sshpassword",
"password",g["SSH Password:"])],{hasOptionalParameters:!0});e.errorData=b.JsonData;e.errorData.failedOperation=b.failedOperation;h.collectParameters(e)})};if(b.parameters&&b.parameters.optionsRequested)b.parameters=null,b.optionsRequested=!0,h.collectParameters(b);else{var m=c.getService("orion.git.provider"),o=c.getService("orion.page.progress");b.errorData&&b.errorData.failedOperation&&o.removeOperation(b.errorData.failedOperation);var q=function(a,d,e,f,h){var i=c.getService("orion.page.message"),
a=o.progress(m.doPush(d,e,!0,h,a.gitSshUsername,a.gitSshPassword,a.knownHosts,a.gitPrivateKey,a.gitPassphrase),g["Pushing remote: "]+f);i.createProgressMonitor(a,g["Pushing remote: "]+f);a.then(function(a){u.handleGitServiceResponse(a,c,function(){p.changedItem()},function(a){k(a,b)})},function(a){u.handleGitServiceResponse(a,c,function(){p.changedItem()},function(a){k(a,b)})})};o.progress(m.getGitClone(i.CloneLocation),"Getting git repository details "+i.Name).then(function(a){var d=a.Children[0].RemoteLocation,
h=a.Children[0].ConfigLocation,k=function(a){u.handleProgressServiceResponse(a,{},c)};u.gatherSshCredentials(c,b).then(function(a){var p=new j;if(i.RemoteLocation.length===1&&i.RemoteLocation[0].Children.length===1)p=o.progress(m.getGitRemote(d),"Getting git remote details "+i.Name);else{var s={};s.Children=i.RemoteLocation;p.resolve(s)}p.then(function(d){e?q(a,e.Location,"HEAD",e.Name,!1):(d=new n.RemotePrompterDialog({title:g["Choose Branch"],serviceRegistry:c,gitClient:m,treeRoot:{Children:d.Children},
hideNewBranch:!1,func:function(c,d,e){f=c===null?e:c;var g="branch."+i.Name+".remote";o.progress(m.addCloneConfigurationProperty(h,g,f.parent.Name),"Adding git configuration property "+i.Name).then(function(){b.targetBranch=f;q(a,f.Location,"HEAD",f.Name,!1)},function(c){c.status===409?m.getGitCloneConfig(h).then(function(c){if(c.Children)for(var d=0;d<c.Children.length;d++)if(c.Children[d].Key===g){o.progress(m.editCloneConfigurationProperty(c.Children[d].Location,f.parent.Name),"Updating configuration property "+
f.parent.Name).then(function(){b.targetBranch=f;q(a,f.Location,"HEAD",f.Name,!1)},k);break}},k):k(c)})}}),i.RemoteLocation.length===1&&i.RemoteLocation[0].Children.length===1&&(d=new l.ConfirmPushDialog({title:g["Choose Branch"],serviceRegistry:c,gitClient:m,dialog:d,location:i.RemoteLocation[0].Children[0].Name,func:function(){b.targetBranch=i.RemoteLocation[0].Children[0];q(a,i.RemoteLocation[0].Children[0].Location,"HEAD",i.Name,!1)}})),d.show())})})})}},visibleWhen:function(a){return a.toRef?
a.RepositoryPath===""&&a.toRef.Type==="Branch"&&a.toRef.Current&&a.toRef.RemoteLocation:a.Type==="Branch"&&a.Current&&a.RemoteLocation}});h.addCommand(o);o=new b.Command({name:g["Force Push All"],tooltip:g["Push commits and tags from your local branch into the remote branch overriding its current content"],imageClass:"git-sprite-push",spriteClass:"gitCommandSprite",id:"eclipse.orion.git.pushForce",callback:function(b){var e=b.confirmedWarnings,f=b.targetBranch;if(!e)if(confirm(g["You're going to override content of the remote branch. This can cause the remote repository to lose commits."]+
"\n\n"+g["Are you sure?"]))e=b.confirmedWarnings=!0;else return;var i,k=b.items;if(k.toRef)k=k.toRef;var m=k.CloneLocation.split("/"),o=function(b,e){b.JsonData.HostKey?(e.parameters=null,e.errorData=b.JsonData,h.collectParameters(e)):e.optionsRequested?(e.errorData=b.JsonData,h.collectParameters(e)):(new d(c)).isEnabled().then(function(c){e.parameters=c?b.JsonData.User?new a.ParametersDescription([new a.CommandParameter("sshpassword","password",g["SSH Password:"]),new a.CommandParameter("saveCredentials",
"boolean",g["Don't prompt me again:"])],{hasOptionalParameters:!0}):new a.ParametersDescription([new a.CommandParameter("sshuser","text",g["SSH User Name:"]),new a.CommandParameter("sshpassword","password",g["SSH Password:"]),new a.CommandParameter("saveCredentials","boolean",g["Don't prompt me again:"])],{hasOptionalParameters:!0}):b.JsonData.User?new a.ParametersDescription([new a.CommandParameter("sshpassword","password",g["SSH Password:"])],{hasOptionalParameters:!0}):new a.ParametersDescription([new a.CommandParameter("sshuser",
"text",g["SSH User Name:"]),new a.CommandParameter("sshpassword","password",g["SSH Password:"])],{hasOptionalParameters:!0});e.errorData=b.JsonData;h.collectParameters(e)})};if(b.parameters&&b.parameters.optionsRequested)b.parameters=null,b.optionsRequested=!0,h.collectParameters(b);else{var q=c.getService("orion.git.provider"),s=c.getService("orion.page.progress"),r=function(a,d,e,f,h){var i=c.getService("orion.page.message"),a=s.progress(q.doPush(d,e,!0,h,a.gitSshUsername,a.gitSshPassword,a.knownHosts,
a.gitPrivateKey,a.gitPassphrase),g["Pushing remote: "]+f);i.createProgressMonitor(a,g["Pushing remote: "]+f);a.then(function(a){u.handleGitServiceResponse(a,c,function(){p.changedItem()},function(a){o(a,b)})},function(a){u.handleGitServiceResponse(a,c,function(){p.changedItem(k)},function(a){o(a,b)})})};s.progress(q.getGitClone(k.CloneLocation),"Getting git repository details "+k.Name).then(function(a){var d=a.Children[0].RemoteLocation,e=a.Children[0].ConfigLocation;u.gatherSshCredentials(c,b).then(function(a){var h=
new j;if(k.RemoteLocation.length===1&&k.RemoteLocation[0].Children.length===1)h=s.progress(q.getGitRemote(d),"Getting remote details "+k.Name);else{var p={};p.Children=k.RemoteLocation;h.resolve(p)}h.then(function(d){f?r(a,f.Location,"HEAD",f.Name,!0):(d=new n.RemotePrompterDialog({title:g["Choose Branch"],serviceRegistry:c,gitClient:q,treeRoot:{Children:d.Children},hideNewBranch:!1,func:function(c,d,f){i=c===null?f:c;var g="/gitapi/config/branch."+k.Name+".remote/clone/file/"+m[4];s.progress(q.addCloneConfigurationProperty(e,
"branch."+k.Name+".remote",i.parent.Name),"Setting git configuration property "+k.Name).then(function(){b.targetBranch=i;r(a,i.Location,"HEAD",i.Name,!0)},function(c){c.status===409&&s.progres(q.editCloneConfigurationProperty(g,i.parent.Name),"Setting git configuration property "+i.parent.Name).then(function(){b.targetBranch=i;r(a,i.Location,"HEAD",i.Name,!0)})})}}),k.RemoteLocation.length===1&&k.RemoteLocation[0].Children.length===1&&(d=new l.ConfirmPushDialog({title:g["Choose Branch"],serviceRegistry:c,
gitClient:q,dialog:d,location:k.RemoteLocation[0].Children[0].Name,func:function(){b.targetBranch=k.RemoteLocation[0].Children[0];r(a,k.RemoteLocation[0].Children[0].Location,"HEAD",k.Location,!0)}})),d.startup(),d.show())})})})}},visibleWhen:function(a){if(a.toRef)return a.RepositoryPath===""&&a.toRef.Type==="Branch"&&a.toRef.Current&&a.toRef.RemoteLocation}});h.addCommand(o);o=new b.Command({name:g["< Previous Page"],tooltip:g["Show previous page of git log"],id:"eclipse.orion.git.previousLogPage",
hrefCallback:function(a){return k.toUrl("git/git-log.html")+"#"+a.items.PreviousLocation},visibleWhen:function(a){return a.Type==="RemoteTrackingBranch"||a.toRef&&a.toRef.Type==="Branch"||a.RepositoryPath!==null?a.PreviousLocation!==void 0:!1}});h.addCommand(o);o=new b.Command({name:g["Next Page >"],tooltip:g["Show next page of git log"],id:"eclipse.orion.git.nextLogPage",hrefCallback:function(a){return k.toUrl("git/git-log.html")+"#"+a.items.NextLocation},visibleWhen:function(a){return a.Type===
"RemoteTrackingBranch"||a.toRef&&a.toRef.Type==="Branch"||a.RepositoryPath!==null?a.NextLocation!==void 0:!1}});h.addCommand(o);o=new b.Command({name:g["< Previous Page"],tooltip:g["Show previous page of git tags"],id:"eclipse.orion.git.previousTagPage",hrefCallback:function(a){return k.toUrl("git/git-repository.html")+"#"+a.items.PreviousLocation},visibleWhen:function(a){return a.Type==="Tag"?a.PreviousLocation!==void 0:!1}});h.addCommand(o);o=new b.Command({name:g["Next Page >"],tooltip:g["Show next page of git tags"],
id:"eclipse.orion.git.nextTagPage",hrefCallback:function(a){return k.toUrl("git/git-repository.html")+"#"+a.items.NextLocation},visibleWhen:function(a){return a.Type==="Tag"?a.NextLocation!==void 0:!1}});h.addCommand(o);o=new b.Command({name:g.Reset,tooltip:g["Reset your active branch to the state of the selected branch. Discard all staged and unstaged changes."],id:"eclipse.orion.git.resetIndex",imageClass:"git-sprite-reset",spriteClass:"gitCommandSprite",callback:function(a){var b=a.items;if(confirm(g["The content of your active branch will be replaced with "]+
b.Name+". "+g["All unstaged and staged changes will be discarded and cannot be recovered. Are you sure?"])){var a=c.getService("orion.git.provider"),d=c.getService("orion.page.message"),a=c.getService("orion.page.progress").progress(a.resetIndex(b.IndexLocation,b.Name),"Resetting git index for "+b.Name);d.createProgressMonitor(a,g["Resetting index..."]);a.then(function(){p.changedItem(b);d.setProgressResult({Severity:"Info",HTML:!1,Message:"Ok"})},function(a){var b={Severity:"Error",HTML:!1};b.Message=
a.message;d.setProgressResult(b)})}},visibleWhen:function(a){return a.Type==="RemoteTrackingBranch"}});h.addCommand(o);o=new a.ParametersDescription([new a.CommandParameter("name","text",g["Name:"])]);o=new b.Command({name:g.Tag,tooltip:g["Create a tag for the commit"],imageClass:"git-sprite-tag",spriteClass:"gitCommandSprite",id:"eclipse.orion.git.addTag",parameters:o,callback:function(a){var b=a.items,d=function(a,d){c.getService("orion.page.progress").progress(c.getService("orion.git.provider").doAddTag(a,
d),"Adding tag "+d).then(function(){p.changedItem(b)},q)},e=b.Location;a.parameters.valueFor("name")&&!a.parameters.optionsRequested&&d(e,a.parameters.valueFor("name"))},visibleWhen:function(a){return a.Type==="Commit"}});h.addCommand(o);o=new b.Command({name:g.Delete,tooltip:g["Delete the tag from the repository"],imageClass:"core-sprite-delete",id:"eclipse.removeTag",callback:function(a){var b=a.items;confirm(e.formatMessage(g["Are you sure you want to delete tag ${0}?"],b.Name))&&c.getService("orion.page.progress").progress(c.getService("orion.git.provider").doRemoveTag(b.Location),
"Removing tag "+b.Name).then(function(){p.changedItem(b.parent)},q)},visibleWhen:function(a){return a.Type==="Tag"}});h.addCommand(o);o=new a.ParametersDescription([new a.CommandParameter("reviewer","text",g["Reviewer name"])],{hasOptionalParameters:!0});o=new b.Command({name:g["Ask for review"],tooltip:g["Ask for review tooltip"],imageClass:"core-sprite-tag",id:"eclipse.orion.git.askForReviewCommand",parameters:o,callback:function(a){var b=c.getService("orion.page.progress"),d=function(a){var b=
document.createElement("a");b.href=a;b.protocol==="ssh:"&&(b=a.indexOf("@"),b!==-1&&(a="ssh://"+a.substr(b+1)));return a},e=function(e){var f=a.items,g=f.Location.replace(f.Name,"HEAD"),h=f.AuthorName,i=f.Name,j=f.Message;b.progress(c.getService("orion.git.provider").getGitClone(f.CloneLocation),"Getting repository details "+f.Name).then(function(a){window.location.href.split("#");var k=v.getOrionHome(),a=d(a.Children[0].GitUrl),k=k+"/git/reviewRequest.html#"+a+"_"+f.Name;b.progress(c.getService("orion.git.provider").sendCommitReviewRequest(i,
g,e,k,h,j),"Sending review request for "+i).then(function(a){var b={Severity:"Ok",HTML:!1};b.Message=a.Result;c.getService("orion.page.message").setProgressResult(b)},q)})};if(a.parameters.valueFor("reviewer")&&!a.parameters.optionsRequested)e(a.parameters.valueFor("reviewer"));else{var f=a.items;b.progress(c.getService("orion.git.provider").getGitClone(f.CloneLocation),"Getting git details "+f.Name).then(function(a){window.location.href.split("#");var b=v.getOrionHome(),a=d(a.Children[0].GitUrl);
(new m.ReviewRequestDialog({title:g["Contribution Review Request"],url:b+"/git/reviewRequest.html#"+a+"_"+f.Name,func:e})).show()},q)}},visibleWhen:function(a){return a.Type==="Commit"}});h.addCommand(o);o=new b.Command({name:g["Cherry-Pick"],tooltip:g["Apply the change introduced by the commit to your active branch"],id:"eclipse.orion.git.cherryPick",imageClass:"git-sprite-cherry_pick",spriteClass:"gitCommandSprite",callback:function(a){var b=a.items,a=c.getService("orion.page.progress"),d=c.getService("orion.git.provider"),
f=b.Location.replace(b.Name,"HEAD");a.progress(d.doCherryPick(f,b.Name),"Cherry picking "+b.Name).then(function(a){var d=[],f=b.Location.replace("commit/"+b.Name,"status");if(a.Result==="OK")d.Severity="Ok",a.HeadUpdated?(d.HTML=!1,d.Message=a.Result):(d.HTML=!0,d.Message="<span>"+g["Nothing changed."]+"</span>");else if(a.Result==="CONFLICTING")d.Severity="Warning",d.HTML=!0,d.Message="<span>"+a.Result+g[". Some conflicts occurred"]+ +e.formatMessage(g[". Go to ${0}."],'<a href="'+k.toUrl(i.statusUILocation)+
"#"+f+'">'+g["Git Status page"]+"</a>")+".</span>";else if(a.Result==="FAILED"){d.Severity="Error";d.HTML=!0;d.Message="<span>"+a.Result;if(a.FailingPaths){var h="",j=!0,l;for(l in a.FailingPaths)j||(h+=", "),j=!1,h+=l;j||(d.Message+=". "+e.formatMessage(g["Failing paths: ${0}"],h))}d.Message+=e.formatMessage(g[". Go to ${0}."],'<a href="'+k.toUrl(i.statusUILocation)+"#"+f+'">'+g["Git Status page"]+"</a>")+".</span>"}else d.Severity="Warning",d.HTML=!1,d.Message=a.Result;c.getService("orion.page.message").setProgressResult(d)},
q)},visibleWhen:function(a){return a.Type==="Commit"}});h.addCommand(o)};u.createGitClonesCommands=function(c,f,i,l,m,n){function o(a){var b={Severity:"Error",HTML:!1};try{var d=JSON.parse(a.responseText);b.Message=d.DetailedMessage?d.DetailedMessage:d.Message?d.Message:g["Problem while performing the action"]}catch(e){b.Message=g["Problem while performing the action"]}c.getService("orion.page.message").setProgressResult(b)}function s(a){Array.isArray(a)&&(a=a.length>1?{}:a[0]);return a}l=new a.ParametersDescription([new a.CommandParameter("key",
"text",g["Key:"]),new a.CommandParameter("value","text",g["Value:"])]);l=new b.Command({name:g["New Configuration Entry"],tooltip:"Add a new entry to the repository configuration",id:"eclipse.orion.git.addConfigEntryCommand",parameters:l,callback:function(a){var b=a.items,d=c.getService("orion.git.provider"),e=c.getService("orion.page.progress");a.parameters.valueFor("key")&&a.parameters.valueFor("value")&&e.progress(d.addCloneConfigurationProperty(b.ConfigLocation,a.parameters.valueFor("key"),a.parameters.valueFor("value")),
"Setting configuration propetry: "+a.parameters.valueFor("key")).then(function(){i.changedItem(b)},o)}});f.addCommand(l);l=new a.ParametersDescription([new a.CommandParameter("value","text",g["Value:"])]);l=new b.Command({name:g.Edit,tooltip:g["Edit the configuration entry"],imageClass:"core-sprite-edit",id:"eclipse.orion.git.editConfigEntryCommand",parameters:l,callback:function(a){var b=a.items,d=c.getService("orion.git.provider"),e=c.getService("orion.page.progress");a.parameters.valueFor("value")&&
e.progress(d.editCloneConfigurationProperty(b.Location,a.parameters.valueFor("value")),"Editing configuration property "+b.Key).then(function(){i.changedItem(b)},o)},visibleWhen:function(a){return a.Key&&a.Value&&a.Location}});f.addCommand(l);l=new b.Command({name:g.Delete,tooltip:g["Delete the configuration entry"],imageClass:"core-sprite-delete",id:"eclipse.orion.git.deleteConfigEntryCommand",callback:function(a){var b=a.items,a=c.getService("orion.git.provider"),d=c.getService("orion.page.progress");
confirm(e.formatMessage(g["Are you sure you want to delete ${0}?"],b.Key))&&d.progress(a.deleteCloneConfigurationProperty(b.Location),"Deleting configuration property "+b.Key).then(function(){i.changedItem(b)},o)},visibleWhen:function(a){return a.Key&&a.Value&&a.Location}});f.addCommand(l);l=new a.ParametersDescription([new a.CommandParameter("url","url",g["Repository URL:"])],{hasOptionalParameters:!0});m=new b.Command({name:g["Clone Repository"],tooltip:g["Clone an existing Git repository to a folder"],
id:"eclipse.createGitProject",callback:function(a){var b=a.items,d=c.getService("orion.git.provider"),e=c.getService("orion.page.progress"),f=function(a,f,j){u.getDefaultSshOptions(c).then(function(l){var m=arguments.callee,o=new h(c);c.getService("orion.page.message").setProgressMessage("Your project is being set up. This may take a minute...");o.getConfig().then(function(h){e.progress(d.cloneGitRepository(j,a,f,i.defaultPath,l.gitSshUsername,l.gitSshPassword,l.knownHosts,l.gitPrivateKey,l.gitPassphrase,
h),"Cloning repository "+j).then(function(a){u.handleProgressServiceResponse(a,l,c,function(a){d.getGitClone(a.Location).then(function(a){var c="",d;for(d in b.projectDescription)c+=d+"="+b.projectDescription[d]+"\n";n.write(a.Children[0].ContentLocation+".git/.projectInfo",c).then(function(){var b=k.toUrl("edit/edit.html")+"#{,resource,params*}";window.location=(new x(b)).expand({resource:"",params:{navigate:a.Children[0].ContentLocation+"?depth=1"}})})})},m,g["Clone Git Repository"])},function(a){u.handleProgressServiceResponse(a,
l,c,function(){},m,g["Clone Git Repository"])})})})};b.url&&b.projectDescription.name&&(c.getService("orion.page.message").setProgressMessage("Looking for project "+b.projectDescription.name),n.loadWorkspace().then(function(a){for(var c=0;c<a.Children.length;++c){var e=a.Children[c];if(e.Name===b.projectDescription.name){e.Git?d.getGitClone(e.Git.CloneLocation).then(function(a){if(a.Children[0].GitUrl===b.url){var c=k.toUrl("edit/edit.html")+"#{,resource,params*}";window.location=(new x(c)).expand({resource:"",
params:{navigate:a.Children[0].ContentLocation+"?depth=1"}})}else console.info("Folder project is used")}):console.info("Folder project is used");return}}f(b.url,null,b.projectDescription.name)}))},visibleWhen:function(){return!0}});f.addCommand(m);l=new b.Command({name:g["Clone Repository"],tooltip:g["Clone an existing Git repository to a folder"],id:"eclipse.cloneGitRepository",parameters:l,callback:function(a){var b=c.getService("orion.git.provider"),d=c.getService("orion.page.progress"),e=function(a,
e,f){u.getDefaultSshOptions(c).then(function(j){var k=arguments.callee;(new h(c)).getConfig().then(function(h){h=d.progress(b.cloneGitRepository(f,a,e,i.defaultPath,j.gitSshUsername,j.gitSshPassword,j.knownHosts,j.gitPrivateKey,j.gitPassphrase,h),"Cloning repository "+f);c.getService("orion.page.message").createProgressMonitor(h,g["Cloning repository: "]+a);h.then(function(a){u.handleProgressServiceResponse(a,j,c,function(){i.changedItem&&i.changedItem()},k,g["Clone Git Repository"])},function(a){u.handleProgressServiceResponse(a,
j,c,function(){},k,g["Clone Git Repository"])})})})};a.parameters.valueFor("url")&&!a.parameters.optionsRequested?e(a.parameters.valueFor("url")):(new q.CloneGitRepositoryDialog({serviceRegistry:c,fileClient:n,url:a.parameters.valueFor("url"),alwaysShowAdvanced:a.parameters.optionsRequested,func:e})).show()},visibleWhen:function(){return!0}});f.addCommand(l);l=new b.Command({name:g["Clone Repository"],tooltip:g["Clone an existing Git repository to a folder"],id:"eclipse.cloneGitRepositoryReviewReq",
callback:function(a){var b=c.getService("orion.git.provider"),d=c.getService("orion.page.progress");(new q.CloneGitRepositoryDialog({serviceRegistry:c,fileClient:n,url:a.userData,alwaysShowAdvanced:!1,func:function(a,e,f){u.getDefaultSshOptions(c).then(function(j){var k=arguments.callee;(new h(c)).getConfig().then(function(h){h=d.progress(b.cloneGitRepository(f,a,e,i.defaultPath,j.gitSshUsername,j.gitSshPassword,j.knownHosts,j.gitPrivateKey,j.gitPassphrase,h),"Cloning git repository "+f);c.getService("orion.page.message").createProgressMonitor(h,
g["Cloning repository: "]+a);h.then(function(a){u.handleProgressServiceResponse(a,j,c,function(){i.changedItem&&i.changedItem()},k,g["Clone Git Repository"])},function(a){u.handleProgressServiceResponse(a,j,c,function(){},k,g["Clone Git Repository"])})})})}})).show()},visibleWhen:function(){return!0}});f.addCommand(l);l=new b.Command({name:g["Add Remote"],tooltip:g["Add a new remote to the repository"],id:"eclipse.addRemoteReviewRequestCommand",imageClass:"git-sprite-fetch",spriteClass:"gitCommandSprite",
callback:function(b){if(b.parameters&&b.parameters.valueFor("remoteName"))b.remoteName=b.parameters.valueFor("remoteName");var e=function(b,e){b.JsonData.HostKey?(e.parameters=null,e.errorData=b.JsonData,f.collectParameters(e)):e.optionsRequested?(e.errorData=b.JsonData,f.collectParameters(e)):(new d(c)).isEnabled().then(function(c){e.parameters=c?b.JsonData.User?new a.ParametersDescription([new a.CommandParameter("sshpassword","password",g["SSH Password:"]),new a.CommandParameter("saveCredentials",
"boolean",g["Don't prompt me again:"])],{hasOptionalParameters:!0}):new a.ParametersDescription([new a.CommandParameter("sshuser","text",g["SSH User Name:"]),new a.CommandParameter("sshpassword","password",g["SSH Password:"]),new a.CommandParameter("saveCredentials","boolean",g["Don't prompt me again:"])],{hasOptionalParameters:!0}):b.JsonData.User?new a.ParametersDescription([new a.CommandParameter("sshpassword","password",g["SSH Password:"])],{hasOptionalParameters:!0}):new a.ParametersDescription([new a.CommandParameter("sshuser",
"text",g["SSH User Name:"]),new a.CommandParameter("sshpassword","password",g["SSH Password:"])],{hasOptionalParameters:!0});e.errorData=b.JsonData;f.collectParameters(e)})};if(b.parameters&&b.parameters.optionsRequested)b.parameters=null,b.optionsRequested=!0,f.collectParameters(b);else{var h=function(a,d,f){var h=c.getService("orion.page.progress");h.progress(c.getService("orion.git.provider").addRemote(a,d,b.userData),"Adding git remote "+d).then(function(){u.gatherSshCredentials(c,b).then(function(a){c.getService("orion.git.provider").getGitRemote(f.RemoteLocation).then(function(j){for(var k,
l=0;l<j.Children.length;l++)j.Children[l].Name===d&&(k=j.Children[l]);var m=c.getService("orion.git.provider"),j=c.getService("orion.page.message"),l=h.progress(m.doFetch(k.Location,!1,a.gitSshUsername,a.gitSshPassword,a.knownHosts,a.gitPrivateKey,a.gitPassphrase),"Fetching remote "+d);j.createProgressMonitor(l,g["Fetching remote: "]+k.Location);l.then(function(a){u.handleGitServiceResponse(a,c,function(){h.progress(m.getGitRemote(k.Location),"Getting remote details "+d).then(function(){i.changedItem(f)},
o)},function(a){e(a,b)})},function(a){u.handleGitServiceResponse(a,c,function(){i.changedItem(f)},function(a){e(a,b)})})})})},o)};b.remoteName?h(b.items.RemoteLocation,b.remoteName,b.items):(b.parameters=new a.ParametersDescription([new a.CommandParameter("remoteName","text",g["Remote Name:"])],{hasOptionalParameters:!1}),f.collectParameters(b))}},visibleWhen:function(){return!0}});f.addCommand(l);l=new a.ParametersDescription([new a.CommandParameter("folderName","text",g["New folder:"])],{hasOptionalParameters:!0});
l=new b.Command({name:g["Init Repository"],tooltip:g["Create a new Git repository in a new folder"],id:"eclipse.initGitRepository",parameters:l,callback:function(a){var b=c.getService("orion.git.provider"),d=c.getService("orion.page.progress"),e=function(a,e,f){u.getDefaultSshOptions(c).then(function(j){var k=arguments.callee;(new h(c)).getConfig().then(function(h){h=d.progress(b.cloneGitRepository(f,a,e,i.defaultPath,null,null,null,null,null,h),g["Initializing repository: "]+f);c.getService("orion.page.message").createProgressMonitor(h,
g["Initializing repository: "]+f);h.then(function(a){u.handleProgressServiceResponse(a,j,c,function(){i.changedItem&&i.changedItem()},k,g["Init Git Repository"])},function(a){u.handleProgressServiceResponse(a,j,c,function(){},k,g["Init Git Repository"])})})})};a.parameters.valueFor("folderName")&&!a.parameters.optionsRequested?e(null,null,a.parameters.valueFor("folderName")):(new q.CloneGitRepositoryDialog({serviceRegistry:c,title:g["Init Git Repository"],fileClient:n,advancedOnly:!0,func:e})).show()},
visibleWhen:function(){return!0}});f.addCommand(l);l=new b.Command({name:g.Delete,tooltip:g["Delete the repository"],imageClass:"core-sprite-delete",id:"eclipse.git.deleteClone",visibleWhen:function(a){return a.Type==="Clone"},callback:function(a){var b=a.items,a=c.getService("orion.git.provider"),d=c.getService("orion.page.progress");if(Array.isArray(b)){if(confirm(e.formatMessage(g["Are you sure you want do delete ${0} repositories?"],b.length)))for(var f=0,h=0;h<b.length;h++)d.progress(a.removeGitRepository(b[h].Location),
"Removing repository "+b.Name).then(function(){f++;f>=b.length&&i.changedItem&&i.changedItem()},o)}else confirm(e.formatMessage(g["Are you sure you want to delete ${0}?"],b.Name))&&d.progress(a.removeGitRepository(b.Location),"Removing repository "+b.Name).then(function(){i.changedItem&&i.changedItem()},o)}});f.addCommand(l);l=new b.Command({name:g["Apply Patch"],tooltip:g["Apply a patch on the selected repository"],id:"eclipse.orion.git.applyPatch",imageClass:"git-sprite-apply_patch",spriteClass:"gitCommandSprite",
callback:function(a){var a=s(a.items),b=new j;(new t.ApplyPatchDialog({title:g["Apply Patch"],diffLocation:a.DiffLocation,deferred:b})).show();var d=c.getService("orion.page.message");b.then(function(a){var b;try{var c=JSON.parse(a);if(c.JsonData&&c.JsonData.modifiedFieles){b="Patch applied, files modified: ";for(var a=!0,e=0;e<c.JsonData.modifiedFieles.length;e++)a||(b+=", "),b+=c.JsonData.modifiedFieles[e],a=!1;c=[];c.Severity="Info";c.HTML=!1;c.Message=b;d.setProgressResult(c);return}}catch(f){}d.setMessage("Patch applied")},
function(a){var b=JSON.parse(a),a="Apply patch failed.";b.DetailedMessage?(a+=" ",a+=b.DetailedMessage):b.Message&&(a+=" ",a+=b.Message);b=[];b.Severity="Error";b.HTML=!1;b.Message=a;d.setProgressResult(b)})},visibleWhen:function(a){return a.Type==="Clone"}});f.addCommand(l);l=new a.ParametersDescription([new a.CommandParameter("commitName","text",g["Commit name:"])],{hasOptionalParameters:!0});l=new b.Command({name:g["Open Commit"],tooltip:g["Open the commit with the given name"],id:"eclipse.orion.git.openCommitCommand",
imageClass:"git-sprite-apply_patch",spriteClass:"gitCommandSprite",parameters:l,callback:function(a){var b=c.getService("orion.page.progress"),d=function(e,f,h){h==null&&(h=new j);e.length>0?b.progress(c.getService("orion.git.provider").doGitLog("/gitapi/commit/"+a.parameters.valueFor("commitName")+e[0].ContentLocation+"?page=1&pageSize=1",null,null,g["Looking for the commit"]),"Looking for commit "+a.parameters.valueFor("commitName")).then(function(a){h.resolve(a.Children[0].Location)},function(){d(e.slice(1),
f,h)}):h.reject();return h},e=function(b){a.parameters.optionsRequested?(new p.OpenCommitDialog({repositories:b,serviceRegistry:c,commitName:a.parameters.valueFor("commitName")})).show():(c.getService("orion.page.message").setProgressMessage(g["Looking for the commit"]),d(b,a.parameters.valueFor("commitName")).then(function(a){a&&(a=k.toUrl("git/git-commit.html#")+a+"?page=1&pageSize=1",window.open(a));c.getService("orion.page.message").setProgressMessage("")},function(){var a=[];a.Severity="warning";
a.HTML=!1;a.Message=g["No commits found"];c.getService("orion.page.message").setProgressResult(a)}))};if(!a.parameters.optionsRequested&&!a.parameters.valueFor("commitName"))f.runCommand("eclipse.orion.git.openCommitCommand");else if(a.items.Type==="Clone"){var h=[a.items];e(h)}else a.items.CloneLocation?b.progress(c.getService("orion.git.provider").getGitClone(a.items.CloneLocation),"Getting git repository details").then(function(a){e(a.Children)}):(h=a.items,e(h))},visibleWhen:function(a){return a.Type===
"Clone"||a.CloneLocation||a.length>1&&a[0].Type==="Clone"}});f.addCommand(l)};u.createGitStatusCommands=function(c,d,e){function f(a){var b={Severity:"Error",HTML:!1};try{var d=JSON.parse(a.responseText);b.Message=d.DetailedMessage?d.DetailedMessage:d.Message?d.Message:g["Problem while performing the action"]}catch(e){b.Message=g["Problem while performing the action"]}c.getService("orion.page.message").setProgressResult(b)}function h(a){Array.isArray(a)||(a=[a]);return a}function j(a,b){var d=c.getService("orion.page.message"),
h=c.getService("orion.page.progress").progress(c.getService("orion.git.provider").doRebase(a,"",b),"Rebasing git repository");d.createProgressMonitor(h,b);h.then(function(a){if(a.Result==="OK"||a.Result==="ABORTED"||a.Result==="FAST_FORWARD"||a.Result==="UP_TO_DATE"){var b=[];b.Severity="Ok";b.HTML=!1;b.Message=a.Result;c.getService("orion.page.message").setProgressResult(b);e.changedItem({})}if(a.Result==="STOPPED")b=[],b.Severity="Warning",b.HTML=!1,b.Message=a.Result+g[". Repository still contains conflicts."],
c.getService("orion.page.message").setProgressResult(b),e.changedItem({});else if(a.Result==="FAILED_UNMERGED_PATHS")b=[],b.Severity="Error",b.HTML=!1,b.Message=a.Result+g[". Repository contains unmerged paths. Resolve conflicts first."],c.getService("orion.page.message").setProgressResult(b)},f)}var k=new b.Command({name:g.Stage,tooltip:g["Stage the change"],imageClass:"git-sprite-stage",spriteClass:"gitCommandSprite",id:"eclipse.orion.git.stageCommand",callback:function(a){var b=h(a.items),d=c.getService("orion.page.message"),
i=c.getService("orion.page.progress");if(b.length===1)a=i.progress(c.getService("orion.git.provider").stage(b[0].indexURI),g["Staging changes"]),d.createProgressMonitor(a,g["Staging changes"]);else{for(var j=[],k=0;k<b.length;k++)j[k]=b[k].name;a=i.progress(c.getService("orion.git.provider").stageMultipleFiles(a.userData.Clone.IndexLocation,j),g["Staging changes"]);d.createProgressMonitor(a,"Staging changes")}a.then(function(){e.changedItem(b)},f)},visibleWhen:function(a){a=h(a);if(a.length===0)return!1;
for(var b=0;b<a.length;b++)if(!i.isChange(a[b])||i.isStaged(a[b]))return!1;return!0}});d.addCommand(k);k=new b.Command({name:g.Unstage,tooltip:g["Unstage the change"],imageClass:"git-sprite-unstage",spriteClass:"gitCommandSprite",id:"eclipse.orion.git.unstageCommand",callback:function(a){var b=h(a.items),d=c.getService("orion.page.message"),i=c.getService("orion.page.progress");if(b.length===1)a=i.progress(c.getService("orion.git.provider").unstage(b[0].indexURI,b[0].name),"Unstaging changes");else{for(var j=
[],k=0;k<b.length;k++)j[k]=b[k].name;a=i.progress(c.getService("orion.git.provider").unstage(a.userData.Clone.IndexLocation,j),"Unstaging changes")}d.createProgressMonitor(a,g["Staging changes"]);a.then(function(){e.changedItem(b)},f)},visibleWhen:function(a){a=h(a);if(a.length===0)return!1;for(var b=0;b<a.length;b++)if(!i.isChange(a[b])||!i.isStaged(a[b]))return!1;return!0}});d.addCommand(k);k=new a.ParametersDescription([new a.CommandParameter("name","text",g["Commit message:"],"",4),new a.CommandParameter("amend",
"boolean",g["Amend:"],!1)],{hasOptionalParameters:!0});k=new b.Command({name:"Commit",tooltip:"Commit",id:"eclipse.orion.git.commitCommand",parameters:k,callback:function(a){var b=a.items.status,d=function(a){var d=c.getService("orion.page.message"),a=c.getService("orion.page.progress").progress(c.getService("orion.git.provider").commitAll(b.Clone.HeadLocation,null,JSON.stringify(a)),g["Committing changes"]);d.createProgressMonitor(a,g["Committing changes"]);a.then(function(){e.changedItem(b)},f)},
h={};h.Message=a.parameters.valueFor("name");h.Amend=a.parameters.valueFor("amend");for(var i=b.Clone.Config,j=0;j<i.length;j++)if(i[j].Key==="user.name")h.CommitterName=i[j].Value,h.AuthorName=i[j].Value;else if(i[j].Key==="user.email")h.CommitterEmail=i[j].Value,h.AuthorEmail=i[j].Value;h.Message&&h.CommitterName&&h.CommitterEmail&&!a.parameters.optionsRequested?d(h):(new r.CommitDialog({body:h,func:d})).show()},visibleWhen:function(){return!0}});d.addCommand(k);k=new b.Command({name:g.Reset,tooltip:g["Reset the branch, discarding all staged and unstaged changes"],
imageClass:"core-sprite-refresh",id:"eclipse.orion.git.resetCommand",callback:function(a){var b=a.items;c.getService("orion.page.dialog").confirm(g["All unstaged and staged changes in the working directory and index will be discarded and cannot be recovered."]+"\n"+g["Are you sure you want to continue?"],function(a){if(a){var a=c.getService("orion.page.message"),d=c.getService("orion.page.progress").progress(c.getService("orion.git.provider").unstageAll(b.IndexLocation,"HARD"),g["Resetting local changes"]);
a.createProgressMonitor(d,g["Resetting local changes"]);d.then(function(){e.changedItem(b)},f)}})},visibleWhen:function(a){return i.hasStagedChanges(a)||i.hasUnstagedChanges(a)}});d.addCommand(k);k=new b.Command({name:g.Checkout,tooltip:g["Checkout files, discarding all changes"],imageClass:"git-sprite-checkout",spriteClass:"gitCommandSprite",id:"eclipse.orion.git.checkoutCommand",callback:function(a){var b=h(a.items);c.getService("orion.page.dialog").confirm(g["Your changes to the selected files will be discarded and cannot be recovered."]+
"\n"+g["Are you sure you want to continue?"],function(d){if(d){for(var d=c.getService("orion.page.message"),h=c.getService("orion.page.progress"),i=[],j=0;j<b.length;j++)i[j]=b[j].name;h=h.progress(c.getService("orion.git.provider").checkoutPath(a.userData.Clone.Location,i),g["Resetting local changes"]);d.createProgressMonitor(h,g["Resetting local changes"]);h.then(function(){e.changedItem(b)},f)}})},visibleWhen:function(a){a=h(a);if(a.length===0)return!1;for(var b=0;b<a.length;b++)if(!i.isChange(a[b])||
i.isStaged(a[b]))return!1;return!0}});d.addCommand(k);k=new b.Command({name:g["Show Patch"],tooltip:g["Show workspace changes as a patch"],id:"eclipse.orion.git.showPatchCommand",hrefCallback:function(a){for(var b=h(a.items),a=a.userData.Clone.DiffLocation+"?parts=diff",c=0;c<b.length;c++)a+="&Path=",a+=b[c].name;return a},visibleWhen:function(a){a=h(a);if(a.length===0)return!1;for(var b=0;b<a.length;b++)if(i.isStaged(a[b]))return!1;return!0}});d.addCommand(k);k=new b.Command({name:g.Continue,tooltip:g["Contibue Rebase"],
id:"eclipse.orion.git.rebaseContinueCommand",callback:function(a){return j(a.items.Clone.HeadLocation,"CONTINUE")},visibleWhen:function(a){return a.RepositoryState.indexOf("REBASING")!==-1}});d.addCommand(k);k=new b.Command({name:g["Skip Patch"],tooltip:g["Skip Patch"],id:"eclipse.orion.git.rebaseSkipPatchCommand",callback:function(a){return j(a.items.Clone.HeadLocation,"SKIP")},visibleWhen:function(a){return a.RepositoryState.indexOf("REBASING")!==-1}});d.addCommand(k);k=new b.Command({name:g.Abort,
tooltip:g["Abort Rebase"],id:"eclipse.orion.git.rebaseAbortCommand",callback:function(a){return j(a.items.Clone.HeadLocation,"ABORT")},visibleWhen:function(a){return a.RepositoryState.indexOf("REBASING")!==-1}});d.addCommand(k)}})();return u});
define("orion/git/gitCommitExplorer","require,i18n!git/nls/gitmessages,orion/section,orion/explorers/explorer,orion/PageUtil,orion/i18nUtil,orion/webui/littlelib,orion/globalCommands,orion/git/gitCommands,orion/git/util,orion/Deferred,orion/webui/tooltip".split(","),function(g,k,j,e,c,b,a,i,f,d,h,l){h={};h.GitCommitExplorer=function(){function h(a,b,c,d,f,g,i,j){this.parentId=f;this.registry=a;this.commandService=b;this.linkService=c;this.selection=d;this.parentId=f;this.toolbarId=g;this.selectionToolsId=
i;this.checkbox=!1;this.actionScopeId=j;e.createExplorerCommands(b)}h.prototype.handleError=function(a){var b={Severity:"Error",HTML:!1};try{var c=JSON.parse(a.responseText);b.Message=c.DetailedMessage?c.DetailedMessage:c.Message}catch(d){b.Message=a.message}this.registry.getService("orion.page.message").setProgressResult(b);a.status===404&&(this.initTitleBar(),this.displayCommit())};h.prototype.changedItem=function(){this.redisplay()};h.prototype.redisplay=function(){this.display(c.matchResourceParameters().resource)};
h.prototype.display=function(a){var b=this,c=this.registry.getService("orion.page.progress");c.showWhile(this.registry.getService("orion.git.provider").getGitClone(a),"Getting repository details").then(function(a){if(a.Children.length===0)b.initTitleBar(),b.displayCommit();else if(a.Children.length===1&&a.Children[0].Type==="Commit"){var d=a.Children;c.progress(b.registry.getService("orion.git.provider").getGitClone(a.CloneLocation),"Getting repository details "+a.Name).then(function(a){a=a.Children;
b.initTitleBar(d[0],a[0]);b.displayCommit(d[0]);b.displayTags(d[0]);b.displayDiffs(d[0]);d[0].CloneLocation=a[0].Location;f.updateNavTools(b.registry,b.commandService,b,"pageActions","selectionTools",d[0])},function(a){b.handleError(a)})}},function(a){b.handleError(a)})};h.prototype.initTitleBar=function(a,b){var c={};a.GitUrl=b.GitUrl;a.ContentLocation=b.ContentLocation;if(a)c={},c.Name=a.Name,c.Parents=[],c.Parents[0]={},c.Parents[0].Name=b.Name,c.Parents[0].Location=b.Location,c.Parents[0].ChildrenLocation=
b.Location,c.Parents[1]={},c.Parents[1].Name=k.Repositories;i.setPageTarget({task:"Commit",target:a,breadcrumbTarget:c,makeBreadcrumbLink:function(a,b){a.href=g.toUrl("git/git-repository.html")+(b?"#"+b:"")},serviceRegistry:this.registry,commandService:this.commandService})};h.prototype.displayCommit=function(c){var d=a.node("table");a.empty(d);if(c){var e=document.createElement("div");e.className="sectionTable";d.appendChild(e);d=document.createElement("div");d.className="mainPadding";d.id="commitNode";
e.appendChild(d);e=document.createElement("div");e.className="sectionTableItem";d.appendChild(e);var d=this._splitCommitMessage(c.Message),f=document.createElement("div");f.style.paddingBottom="15px";this.registry.getService("orion.core.textlink").addLinks(d[0],f);e.appendChild(f);if(d[1]!==null)f=document.createElement("pre"),f.style.paddingBottom="15px",f.style.marginTop="0px",this.registry.getService("orion.core.textlink").addLinks(d[1],f),e.appendChild(f);d=document.createElement("div");d.appendChild(document.createTextNode(b.formatMessage(k["commit: 0"],
c.Name)));e.appendChild(d);if(c.Parents&&c.Parents.length>0)d=document.createElement("div"),d.style.paddingBottom="15px",f=document.createElement("a"),f.className="pnavlinkonpage",f.href=g.toUrl("git/git-commit.html#")+c.Parents[0].Location+"?page=1&pageSize=1",f.textContent=b.formatMessage(k["parent: 0"],c.Parents[0].Name),d.appendChild(f),e.appendChild(d);if(c.AuthorImage)d=document.createElement("div"),d.style["float"]="left",f=new Image,f.src=c.AuthorImage,f.name=c.AuthorName,f.className="git-author-icon-small",
d.appendChild(f),e.appendChild(d);d=document.createElement("div");f=document.createElement("div");f.appendChild(document.createTextNode(b.formatMessage(k["authored by 0 (1) on 2"],c.AuthorName,c.AuthorEmail,(new Date(c.Time)).toLocaleString())));d.appendChild(f);f=document.createElement("div");f.appendChild(document.createTextNode(b.formatMessage(k["committed by 0 (1)"],c.CommitterName,c.CommitterEmail)));d.appendChild(f);e.appendChild(d)}else new j.Section(d,{id:"commitSection",title:k["No Commits"],
iconClass:"core-sprite-file"})};h.prototype._splitCommitMessage=function(a){var b=!1,c=a.split(/(\r?\n|$)/)[0].trim();c.length>100&&(b=c.indexOf(" ",90),c=c.substring(0,b!==-1?b:100),b=!0);a=a.substring(c.length+1,a.length).trim();a=a.length>0?b?"..."+a:a:null;c+=b?"...":"";return[c,a]};h.prototype.displayTags=function(b){var c=b.Tags,d=a.node("table"),d=new j.Section(d,{id:"tagSection",title:c&&c.length>0?k["Tags:"]:k["No Tags"],iconClass:["gitImageSprite","git-sprite-tag"],slideout:!0,content:'<div id="tagNode"></div>',
canHide:!0,preferenceService:this.registry.getService("orion.core.preference")});this.commandService.registerCommandContribution(d.actionsNode.id,"eclipse.orion.git.addTag",100);this.commandService.renderCommands(d.actionsNode.id,d.actionsNode,b,this,"button");if(c||!(c.length>0))for(b=0;b<c.length&&b<10;b++)this.renderTag(c[b])};h.prototype.renderTag=function(b){var c=a.node("tagNode"),d=document.createElement("div");d.className="sectionTableItem";c.appendChild(d);c=document.createElement("div");
c.className="sectionTableItem";d.appendChild(c);d=document.createElement("div");d.className="stretch";c.appendChild(d);var e=document.createElement("span");e.textContent=b.Name;d.appendChild(e);d=document.createElement("div");d.className="sectionTableItemActions";c.appendChild(d);this.commandService.renderCommands(this.actionScopeId,d,b,this,"tool",!1)};h.prototype.displayDiffs=function(b){var c=this,f=b.Diffs,b=a.node("table"),b=new j.Section(b,{id:"diffSection",title:k.Diffs,content:'<div id="diffNode"></div>',
canHide:!0,preferenceService:this.registry.getService("orion.core.preference")});this.commandService.registerCommandContribution(b.actionsNode.id,"orion.explorer.expandAll",100);this.commandService.registerCommandContribution(b.actionsNode.id,"orion.explorer.collapseAll",200);var g="diffSectionItemActionArea",h=function(){function a(){}a.prototype={destroy:function(){},getRoot:function(a){a(f)},getChildren:function(a,b){if(a instanceof Array&&a.length>0)b(a);else if(a.Type==="Diff"){if(!a.children)a.children=
[],a.children.push({parent:a,DiffLocation:a.DiffLocation});b(a.children)}else b([])},getId:function(a){return a instanceof Array&&a.length>0?"diffRoot":a.Type==="Diff"?"diff"+a.DiffLocation:"diffWidget"+a.DiffLocation}};return a}(),i=function(){function a(b,c){this._init(b);this.options=b;this.explorer=c;this.registry=b.registry}a.prototype=new e.SelectionRenderer;a.prototype.getCellElement=function(a,b,e){switch(a){case 0:if(b.Type==="Diff"){var a=document.createElement("td"),f=document.createElement("div");
f.className="sectionTableItem";a.appendChild(f);var g=b.OldPath,h="git-sprite-file",i=k.Diffs;if(b.ChangeType==="ADD")g=b.NewPath,h="git-sprite-addition",i=k.Addition;else if(b.ChangeType==="DELETE")h="git-sprite-removal",i=k.Deletion;this.getExpandImage(e,f);e=document.createElement("span");e.className=h;e.classList.add("gitImageSprite");e.commandTooltip=new l.Tooltip({node:e,text:i,position:["above","below","right","left"]});f.appendChild(e);e=document.createElement("span");e.className="gitMainDescription";
e.textContent=g;f.appendChild(e)}else{a=document.createElement("td");a.colSpan=2;f=document.createElement("div");f.className="sectionTableItem";a.appendChild(f);e=document.createElement("div");e.className="sectionExplorerActions";f.appendChild(e);var j=document.createElement("span");j.id="diff"+b.parent.DiffLocation+"DiffActionWrapper";e.appendChild(j);g=document.createElement("span");g.id="diff"+b.parent.DiffLocation+"CompareWidgetActionWrapper";e.appendChild(g);e=document.createElement("div");e.id=
"diffArea_"+b.parent.DiffLocation;e.style.height="420px";e.style.border="1px solid lightgray";e.style.overflow="hidden";f.appendChild(e);f=this.explorer.getNavDict()?this.explorer.getNavDict().getGridNavHolder(b,!0):null;d.createCompareWidget(c.registry,c.commandService,b.parent.DiffLocation,!1,e,g.id,!1,{navGridHolder:f,additionalCmdRender:function(a){c.commandService.destroy(j.id);c.commandService.renderCommands("itemLevelCommands",j.id,b.parent,c,"tool",!1,a)},before:!0})}return a}};return a}(),
n=new (function(){function a(b,c,d,e){this.registry=b;this.checkbox=!1;this.parentId=d;this.selection=c;this.actionScopeId=e;this.renderer=new i({registry:this.registry,actionScopeId:g,cachePrefix:"DiffNavigator",checkbox:!1},this);this.createTree(this.parentId,new h,{})}a.prototype=new e.Explorer;a.prototype.isRowSelectable=function(){return!1};a.prototype.getItemCount=function(){return f.length};return a}())(this.registry,null,"diffNode",g);this.commandService.renderCommands(b.actionsNode.id,b.actionsNode.id,
n,n,"button")};return h}();return h});
define("orion/widgets/themes/editor/ThemeData",["orion/editor/textTheme"],function(g){function k(){}function j(){this.styles=[];var a=new k;a.name="Eclipse";a.annotationRuler="white";a.background="white";a.comment="green";a.keyword="#7f0055";a.text="darkSlateGray";a.string="blue";a.overviewRuler="white";a.lineNumberOdd="#444";a.lineNumberEven="#444";a.lineNumber="#444";a.currentLine="#EAF2FE";a.tag="darkorange";a.attribute="cadetBlue";a.fontFamily=c;a.fontSize=b;this.styles.push(a);a=new k;a.name=
"Prospecto";a.annotationRuler="white";a.background="white";a.comment="#3C802C";a.keyword="#CC4C07";a.text="#333";a.string="#446FBD";a.overviewRuler="white";a.lineNumberOdd="silver";a.lineNumberEven="silver";a.lineNumber="silver";a.currentLine="#EAF2FE";a.tag="#CC4C07";a.attribute="cadetBlue";a.fontFamily=c;a.fontSize=b;this.styles.push(a);a=new k;a.name="Blue";a.annotationRuler="lavender";a.background="aliceBlue";a.comment="indigo";a.keyword="cornFlowerBlue";a.text="navy";a.string="cornFlowerBlue";
a.overviewRuler="lavender";a.lineNumberOdd="darkSlateGray";a.lineNumberEven="darkSlateGray";a.lineNumber="darkSlateGray";a.currentLine="white";a.tag="cornFlowerBlue";a.attribute="cadetBlue";a.fontFamily=c;a.fontSize=b;this.styles.push(a);a=new k;a.name="Ambience";a.annotationRuler="#3D3D3D";a.background="#202020";a.comment="mediumslateblue";a.keyword="cornFlowerBlue";a.text="darkseagreen";a.string="lightcoral";a.overviewRuler="white";a.lineNumberOdd="black";a.lineNumberEven="black";a.lineNumber="black";
a.currentLine="lightcyan";a.tag="cornFlowerBlue";a.attribute="cadetBlue";a.fontFamily=c;a.fontSize=b;this.styles.push(a);a=new k;a.name="Tierra";a.annotationRuler="moccasin";a.background="lemonchiffon";a.comment="darkseagreen";a.keyword="darkred";a.text="#555555";a.string="orangered";a.overviewRuler="moccasin";a.lineNumberOdd="chocolate";a.lineNumberEven="chocolate";a.lineNumber="chocolate";a.currentLine="#baa289";a.tag="darkred";a.attribute="cadetBlue";a.fontFamily=c;a.fontSize=b;this.styles.push(a);
a=new k;a.name="Nimbus";a.annotationRuler="#444";a.background="dimgray";a.comment="darkseagreen";a.keyword="darkorange";a.text="white";a.string="cornflowerblue";a.overviewRuler="#444";a.lineNumberOdd="#aaa";a.lineNumberEven="#aaa";a.lineNumber="#aaa";a.currentLine="#aabfbb";a.tag="darkorange";a.attribute="cadetBlue";a.fontFamily=c;a.fontSize=b;this.styles.push(a);a=new k;a.name="Adelante";a.annotationRuler="#E2D2B2";a.background="#F1E7C8";a.comment="#5D774E";a.keyword="#AF473B";a.text="dimgray";a.string=
"#DE5D3B";a.overviewRuler="#E2D2B2";a.lineNumberOdd="#AF473B";a.lineNumberEven="#AF473B";a.lineNumber="#AF473B";a.currentLine="#9e937b";a.tag="#AF473B";a.attribute="cadetBlue";a.fontFamily=c;a.fontSize=b;this.styles.push(a);a=new k;a.name="Raspberry Pi";a.annotationRuler="seashell";a.background="seashell";a.comment="#66B32F";a.keyword="#E73E36";a.text="dimgray";a.string="darkorange";a.overviewRuler="seashell";a.lineNumberOdd="#E73E36";a.lineNumberEven="#E73E36";a.lineNumber="#E73E36";a.currentLine=
"#F5B1AE";a.tag="#E73E36";a.attribute="cadetBlue";a.fontFamily=c;a.fontSize=b;this.styles.push(a)}function e(){return this.styles}var c='"Consolas", "Monaco", "Vera Mono", "monospace"',b="10pt";j.prototype.styles=[];j.prototype.getStyles=e;j.prototype.fontSettable=!0;j.prototype.getThemeStorageInfo=function(){return{storage:"/themes",styleset:"editorstyles",defaultTheme:"Prospecto",selectedKey:"editorSelected"}};j.prototype.parseToXML=function(a){try{var b=null;if(window.DOMParser){var b=(new DOMParser).parseFromString(a,
"text/xml"),c=b.getElementsByTagName("parsererror");return!c||!c.length||!c[0].childNodes.length?b:null}else return b=new ActiveXObject("Microsoft.XMLDOM"),b.async=!1,b.loadXML(a),b}catch(d){}};j.prototype.selectFontSize=function(a){console.log("fontsize: "+a)};j.prototype.importTheme=function(a){console.log("import theme");console.log(a);var b=this.parseToXML(a.parameters.valueFor("name")),c=new k;c.name=b.getElementsByTagName("colorTheme")[0].attributes[1].value;c.annotationRuler=b.getElementsByTagName("background")[0].attributes[0].value;
c.background=b.getElementsByTagName("background")[0].attributes[0].value;c.comment=b.getElementsByTagName("singleLineComment")[0].attributes[0].value;c.keyword=b.getElementsByTagName("keyword")[0].attributes[0].value;c.text=b.getElementsByTagName("foreground")[0].attributes[0].value;c.string=b.getElementsByTagName("string")[0].attributes[0].value;c.overviewRuler=b.getElementsByTagName("background")[0].attributes[0].value;c.lineNumberOdd=b.getElementsByTagName("lineNumber")[0].attributes[0].value;
c.lineNumberEven=b.getElementsByTagName("lineNumber")[0].attributes[0].value;c.lineNumber=b.getElementsByTagName("lineNumber")[0].attributes[0].value;c.currentLine=b.getElementsByTagName("selectionBackground")[0].attributes[0].value;a.items.addTheme(c)};j.prototype.processSettings=function(a){var b=g.TextTheme.getTheme();b.setThemeClass("editorTheme",b.buildStyleSheet("editorTheme",a))};j.prototype.getViewData=function(){var a={top:10,left:10,width:400,height:350},b=a.left,c=a.top;a.shapes=[{type:"TEXT",
name:"Line Numbers",label:"1",x:b+20,y:c+20,fill:"darkSlateGray",family:"lineNumber",font:"9pt sans-serif"},{type:"RECTANGLE",name:"Background",x:b+46,y:c,width:290,height:a.height,family:"background",fill:"white"},{type:"TEXT",name:"Strings",label:"'text/javascript'",x:b+134,y:c+20,fill:"darkorange",family:"string",font:"9pt sans-serif"},{type:"TEXT",name:"Foreground",label:"=",x:b+124,y:c+20,fill:"darkSlateGray",family:"text",font:"9pt sans-serif"},{type:"RECTANGLE",name:"Current Line",x:b+46,y:c+
87,width:290,height:18,family:"currentLine",fill:"#eaf2fd"},{type:"TEXT",name:"HTML Attribute",label:"type",x:b+98,y:c+20,fill:"darkGray",family:"attribute",font:"9pt sans-serif"},{type:"RECTANGLE",name:"Overview Ruler",x:b+336,y:c,width:14,height:a.height,family:"overviewRuler",fill:"white"},{type:"TEXT",name:"Comments",label:"/* comment */",x:b+75,y:c+40,fill:"darkSeaGreen",family:"comment",font:"9pt sans-serif"},{type:"TEXT",name:"HTML Tag",label:"<script",x:b+55,y:c+20,fill:"darkorange",family:"keyword",
font:"9pt sans-serif"},{type:"TEXT",name:"HTML Tag",label:">",x:b+213,y:c+20,fill:"darkorange",family:"keyword",font:"9pt sans-serif"},{type:"RECTANGLE",name:"Current Line",x:b+46,y:c+87,width:290,height:18,family:"currentLine",fill:"#eaf2fd"},{type:"TEXT",name:"Strings",label:"'Result'",x:b+164,y:c+80,fill:"cornflowerBlue",family:"string",font:"9pt sans-serif"},{type:"TEXT",name:"Foreground",label:"multiply(a,b){",x:b+120,y:c+60,fill:"darkSlateGray",family:"text",font:"9pt sans-serif"},{type:"TEXT",
name:"keywords",label:"function",x:b+75,y:c+60,fill:"darkorange",family:"keyword",font:"9pt sans-serif"},{type:"TEXT",name:"Keywords",label:"var",x:b+95,y:c+80,fill:"darkorange",family:"keyword",font:"9pt sans-serif"},{type:"TEXT",name:"Foreground",label:"output = ",x:b+115,y:c+80,fill:"darkSlateGray",family:"text",font:"9pt sans-serif"},{type:"TEXT",name:"Foreground",label:";",x:b+205,y:c+80,fill:"darkSlateGray",family:"text",font:"9pt sans-serif"},{type:"TEXT",name:"keywords",label:"var",x:b+95,
y:c+100,fill:"darkorange",family:"keyword",font:"9pt sans-serif"},{type:"TEXT",name:"Foreground",label:"result = a*b;",x:b+115,y:c+100,fill:"darkSlateGray",family:"text",font:"9pt sans-serif"},{type:"TEXT",name:"keywords",label:"return",x:b+95,y:c+120,fill:"darkorange",family:"keyword",font:"9pt sans-serif"},{type:"TEXT",name:"Foreground",label:"output + result;",x:b+135,y:c+120,fill:"darkSlateGray",family:"text",font:"9pt sans-serif"},{type:"TEXT",name:"Foreground",label:"}",x:b+75,y:c+140,fill:"darkSlateGray",
family:"text",font:"9pt sans-serif"},{type:"TEXT",name:"HTML Tag",label:"<\/script>",x:b+55,y:c+160,fill:"darkorange",family:"keyword",font:"9pt sans-serif"},{type:"TEXT",name:"HTML Tag",label:"<style",x:b+55,y:c+200,fill:"darkorange",family:"keyword",font:"9pt sans-serif"},{type:"TEXT",name:"HTML Attribute",label:"type",x:b+95,y:c+200,fill:"darkGray",family:"attribute",font:"9pt sans-serif"},{type:"TEXT",name:"Foreground",label:"=",x:b+121,y:c+200,fill:"darkSlateGray",family:"text",font:"9pt sans-serif"},
{type:"TEXT",name:"Strings",label:"'text/css'",x:b+131,y:c+200,fill:"darkorange",family:"string",font:"9pt sans-serif"},{type:"TEXT",name:"HTML Tag",label:">",x:b+180,y:c+200,fill:"darkorange",family:"keyword",font:"9pt sans-serif"},{type:"TEXT",name:"CSS Class Name",label:".some-class",x:b+75,y:c+220,fill:"darkorange",family:"keyword",font:"9pt sans-serif"},{type:"TEXT",name:"CSS Class Name",label:"{",x:b+145,y:c+220,fill:"darkSlateGray",family:"text",font:"9pt sans-serif"},{type:"TEXT",name:"CSS Attribute",
label:"color:",x:b+95,y:c+240,fill:"darkSlateGray",family:"text",font:"9pt sans-serif"},{type:"TEXT",name:"CSS Value",label:"#123456",x:b+130,y:c+240,fill:"darkSlateGray",family:"string",font:"9pt sans-serif"},{type:"TEXT",name:"CSS Text",label:";",x:b+180,y:c+240,fill:"darkSlateGray",family:"text",font:"9pt sans-serif"},{type:"TEXT",name:"CSS Class Name",label:"}",x:b+75,y:c+260,fill:"darkSlateGray",family:"text",font:"9pt sans-serif"},{type:"TEXT",name:"HTML Tag",label:"</style>",x:b+55,y:c+280,
fill:"darkorange",family:"keyword",font:"9pt sans-serif"},{type:"RECTANGLE",name:"Annotation Ruler",x:b,y:c,width:46,height:a.height,family:"annotationRuler",fill:"white"}];for(var d=0;d<16;d++)a.shapes.push({type:"TEXT",name:"Line Numbers",label:d+1,x:b+20,y:c+20*d+20,fill:"darkSlateGray",family:"lineNumber",font:"9pt sans-serif"});return a};return{ThemeData:j,getStyles:e}});
define("orion/operation",["orion/xhr","orion/Deferred"],function(g,k){function j(c,b,a,e){g("GET",c,{headers:{"Orion-Version":"1"},timeout:15E3}).then(function(f){f=f.response?JSON.parse(f.response):null;b.progress(f);!f.type||f.type==="loadstart"||f.type==="progress"?setTimeout(function(){j(c,b,a,e)},2E3):(f.type==="error"||f.type==="abort"?b.reject(e?e(f):f.Result):b.resolve(a?a(f):f.Result.JsonData),f.Location||g("DELETE",c,{headers:{"Orion-Version":"1"},timeout:15E3}))},function(a){var c=a;if(a.responseText!==
void 0){c=a.responseText;try{c=JSON.parse(a.responseText)}catch(e){}}c.Message!==void 0?(c.HttpCode=c.HttpCode===void 0?a.status:c.HttpCode,c.Severity=c.Severity===void 0?"Error":c.Severity,b.reject(c)):b.reject({Severity:"Error",Message:c,HttpCode:a.status})})}function e(c,b){b.then(null,function(a){a instanceof Error&&a.name==="Cancel"&&g("PUT",c,{headers:{"Orion-Version":"1"},data:JSON.stringify({abort:!0}),timeout:15E3})})}return{handle:function(c,b,a){var g=new k;e(c,g);j(c,g,b,a);return g}}});
define("orion/git/gitClient",["require","orion/xhr","orion/Deferred","orion/operation"],function(g,k,j,e){var c=c||{};c.GitService=function(){function b(a){if(a)this._serviceRegistry=a,this._serviceRegistration=a.registerService("orion.git.provider",this),this._sshService=a.getService("orion.net.ssh")}b.prototype={checkGitService:function(){},cloneGitRepository:function(a,b,c,d,e,l,n,m,q,s){var p=this,r={};if(a)r.Name=a;if(c)r.Path=c;if(b)r.GitUrl=b;r.Location=d;if(e)r.GitSshUsername=e;if(l)r.GitSshPassword=
l;if(n)r.GitSshKnownHost=n;if(m)r.GitSshPrivateKey=m;if(q)r.GitSshPassphrase=q;if(s){if(s.GitMail)r.GitMail=s.GitMail;if(s.GitName)r.GitName=s.GitName}var a=g.toUrl("gitapi/clone/._"),a=a.substring(0,a.length-2),t=new j;k("POST",a,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify(r)}).then(function(a){p._getGitServiceResponse(t,a)},function(a){p._handleGitServiceResponseError(t,a)});return t},removeGitRepository:function(a){var b=this,c=
new j;k("DELETE",a,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json"}).then(function(a){b._getGitServiceResponse(c,a)},function(a){b._handleGitServiceResponseError(c,a)});return c},getGitStatus:function(a){var b=this,c=new j;k("GET",a,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json"}).then(function(a){b._getGitServiceResponse(c,a)},function(a){b._handleGitServiceResponseError(c,a)});return c},stage:function(a){var b=
this,c=new j;k("PUT",a,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json"}).then(function(a){b._getGitServiceResponse(c,a)},function(a){b._handleGitServiceResponseError(c,a)});return c},stageMultipleFiles:function(a,b){var c=this,d=new j;k("PUT",a,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify({Path:b})}).then(function(a){c._getGitServiceResponse(d,a)},function(a){c._handleGitServiceResponseError(d,
a)});return d},unstageAll:function(a,b){var c=this,d=new j;k("POST",a,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify({Reset:b})}).then(function(a){c._getGitServiceResponse(d,a)},function(a){c._handleGitServiceResponseError(d,a)});return d},unstage:function(a,b){var c=this,d=new j;k("POST",a,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify({Path:b})}).then(function(a){c._getGitServiceResponse(d,
a)},function(a){c._handleGitServiceResponseError(d,a)});return d},checkoutPath:function(a,b){var c=this,d=new j;k("PUT",a,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify({Path:b,RemoveUntracked:"true"})}).then(function(a){c._getGitServiceResponse(d,a)},function(a){c._handleGitServiceResponseError(d,a)});return d},commitAll:function(a,b,c){var d=this,e=new j;k("POST",a,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,
handleAs:"json",data:c}).then(function(a){d._getGitServiceResponse(e,a)},function(a){d._handleGitServiceResponseError(e,a)});return e},getGitClone:function(a){var b=this,c=new j;k("GET",a,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json"}).then(function(a){b._getGitServiceResponse(c,a)},function(a){b._handleGitServiceResponseError(c,a)});return c},getGitCloneConfig:function(a){var b=this,c=new j;k("GET",a,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},
timeout:15E3,handleAs:"json"}).then(function(a){b._getGitServiceResponse(c,a)},function(a){b._handleGitServiceResponseError(c,a)});return c},getGitBranch:function(a){var b=this,c=new j;k("GET",a,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json"}).then(function(a){b._getGitServiceResponse(c,a)},function(a){b._handleGitServiceResponseError(c,a)});return c},getGitRemote:function(a){var b=this,c=new j;k("GET",a,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},
timeout:15E3,handleAs:"json"}).then(function(a){b._getGitServiceResponse(c,a)},function(a){b._handleGitServiceResponseError(c,a)});return c},checkoutBranch:function(a,b){var c=this,d=new j;k("PUT",a,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify({Branch:b})}).then(function(a){c._getGitServiceResponse(d,a)},function(a){c._handleGitServiceResponseError(d,a)});return d},resetIndex:function(a,b){var c=this,d=new j;k("POST",a,{headers:{"Orion-Version":"1",
"Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify({Commit:b,Reset:"HARD"})}).then(function(a){c._getGitServiceResponse(d,a)},function(a){c._handleGitServiceResponseError(d,a)});return d},addBranch:function(a,b,c){var d=this,e={};if(b)e.Name=b;if(c)e.Branch=c;var g=new j;k("POST",a,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify(e)}).then(function(a){d._getGitServiceResponse(g,a)},function(a){d._handleGitServiceResponseError(g,
a)});return g},removeBranch:function(a){var b=this,c=new j;k("DELETE",a,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json"}).then(function(a){b._getGitServiceResponse(c,a)},function(a){b._handleGitServiceResponseError(c,a)});return c},addRemote:function(a,b,c){var d=this,e=new j;k("POST",a,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify({Remote:b,RemoteURI:c})}).then(function(a){d._getGitServiceResponse(e,
a)},function(a){d._handleGitServiceResponseError(e,a)});return e},removeRemote:function(a){var b=this,c=new j;k("DELETE",a,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json"}).then(function(a){b._getGitServiceResponse(c,a)},function(a){b._handleGitServiceResponseError(c,a)});return c},doGitLog:function(a){var b=this,c=new j;k("GET",a,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json"}).then(function(a){b._getGitServiceResponse(c,
a)},function(a){b._handleGitServiceResponseError(c,a)});return c},getDiff:function(a,b){var c=this,d=new j;k("POST",a,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify({New:b})}).then(function(a){c._getGitServiceResponse(d,a)},function(a){c._handleGitServiceResponseError(d,a)});return d},doFetch:function(a,b,c,d,e,g,n){var m=this,q=new j;k("POST",a,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json",
data:JSON.stringify({Fetch:"true",Force:b,GitSshUsername:c,GitSshPassword:d,GitSshKnownHost:e,GitSshPrivateKey:g,GitSshPassphrase:n})}).then(function(a){m._getGitServiceResponse(q,a)},function(a){m._handleGitServiceResponseError(q,a)});return q},doPull:function(a,b,c,d,e,g,n){var m=this,q=new j;k("POST",a,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify({Pull:"true",Force:b,GitSshUsername:c,GitSshPassword:d,GitSshKnownHost:e,GitSshPrivateKey:g,
GitSshPassphrase:n})}).then(function(a){m._getGitServiceResponse(q,a)},function(a){m._handleGitServiceResponseError(q,a)});return q},doMerge:function(a,b,c){var d=this,e=new j;k("POST",a,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify({Merge:b,Squash:c})}).then(function(a){d._getGitServiceResponse(e,a)},function(a){d._handleGitServiceResponseError(e,a)});return e},doCherryPick:function(a,b){var c=this,d=new j;k("POST",a,{headers:{"Orion-Version":"1",
"Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify({"Cherry-Pick":b})}).then(function(a){c._getGitServiceResponse(d,a)},function(a){c._handleGitServiceResponseError(d,a)});return d},doRebase:function(a,b,c){var d=this,e={};e.Rebase=b;if(c)e.Operation=c;var g=new j;k("POST",a,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify(e)}).then(function(a){d._getGitServiceResponse(g,a)},function(a){d._handleGitServiceResponseError(g,
a)});return g},doPush:function(a,b,c,d,e,g,n,m,q){var s=this,p=new j;k("POST",a,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify({PushSrcRef:b,PushTags:c,Force:d,GitSshUsername:e,GitSshPassword:g,GitSshKnownHost:n,GitSshPrivateKey:m,GitSshPassphrase:q})}).then(function(a){s._getGitServiceResponse(p,a)},function(a){s._handleGitServiceResponseError(p,a)});return p},getLog:function(a,b){var c=this,d=new j,e=new j;k("POST",a,{headers:{"Orion-Version":"1",
"Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify({New:b})}).then(function(a){e.resolve(a.xhr.getResponseHeader("Location"))},function(a){c._handleGitServiceResponseError(d,a)});e.then(function(a){k("GET",a,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json"}).then(function(a){c._getGitServiceResponse(d,a)},function(a){c._handleGitServiceResponseError(d,a)})});return d},getDefaultRemoteBranch:function(a){var b=this,c=new j,d=new j;
k("GET",a,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json"}).then(function(a){b._getGitServiceResponse(d,a)},function(a){b._handleGitServiceResponseError(c,a)});d.then(function(a){k("GET",a.Children[0].Location,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json"}).then(function(a){b._getGitServiceResponse(c,a)},function(a){b._handleGitServiceResponseError(c,a)})});return c},doAddTag:function(a,b){var c=this,d=new j;k("PUT",
a,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify({Name:b})}).then(function(a){c._getGitServiceResponse(d,a)},function(a){c._handleGitServiceResponseError(d,a)});return d},doRemoveTag:function(a){var b=this,c=new j;k("DELETE",a,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json"}).then(function(a){b._getGitServiceResponse(c,a)},function(a){b._handleGitServiceResponseError(c,a)});return c},checkoutTag:function(a,
b,c){var d=this,e=new j;k("PUT",a,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify({Tag:b,Branch:c})}).then(function(a){d._getGitServiceResponse(e,a)},function(a){d._handleGitServiceResponseError(e,a)});return e},addCloneConfigurationProperty:function(a,b,c){var d=this,e=new j;k("POST",a,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify({Key:b,Value:c})}).then(function(a){d._getGitServiceResponse(e,
a)},function(a){d._handleGitServiceResponseError(e,a)});return e},editCloneConfigurationProperty:function(a,b){var c=this,d=new j;k("PUT",a,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify({Value:b})}).then(function(a){c._getGitServiceResponse(d,a)},function(a){c._handleGitServiceResponseError(d,a)});return d},deleteCloneConfigurationProperty:function(a){var b=this,c=new j;k("DELETE",a,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},
timeout:15E3,handleAs:"json"}).then(function(a){b._getGitServiceResponse(c,a)},function(a){b._handleGitServiceResponseError(c,a)});return c},sendCommitReviewRequest:function(a,b,c,d,e,g){var n=this,m=new j;k("POST",b,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify({ReviewReqCommit:a,ReviewReqUrl:d,ReviewReqNotifyLogin:c,ReviewReqAuthorName:e,ReviewMessage:g})}).then(function(a){n._getGitServiceResponse(m,a)},function(a){n._handleGitServiceResponseError(m,
a)});return m},_getGitServiceResponse:function(a,b){var c=b.response?JSON.parse(b.response):null;if(b.xhr&&b.xhr.status===202){var d=e.handle(c.Location);d.then(a.resolve,function(b){b.failedOperation=c.Location;a.reject(b)},a.progress);a.then(null,function(a){d.reject(a)})}else a.resolve(c)},_handleGitServiceResponseError:function(a,b){a.reject(b)}};return b}();return c});
define("orion/links",[],function(){function g(g){this._init(g)}g.prototype={_init:function(g){this._registry=g.serviceRegistry;this._serviceRegistration=this._registry.registerService("orion.core.textlink",this)},_replaceLink:function(g,j,e,c,b){var a=g.search(e);a>0&&(j.appendChild(document.createTextNode(g.substring(0,a))),g=g.substring(a));var e=g.replace(e,""),a=g.substring(0,g.length-e.length),i=a.split(" ",c);if(i.length===c){for(var g=document.createElement("a"),f=0;f<c;f++)b=b.replace("%"+
(f+1),i[f]);g.setAttribute("href",b);g.textContent=a;j.appendChild(g);g=e}return g},addLinks:function(g,j){var e=j||document.createElement("div"),c=this._registry.getServiceReferences("orion.core.linkScanner");if(c.length>0)for(var b=c[0],c=RegExp(b.getProperty("pattern"),"i"),a=b.getProperty("words"),b=b.getProperty("anchor"),i=g.search(c);i>=0;)g=this._replaceLink(g,e,c,a,b),i=g.search(c);g.length>0&&e.appendChild(document.createTextNode(g));return e}};g.prototype.constructor=g;return{TextLinkService:g}});
var eclipse;
define('built-git-commit.js',"i18n!git/nls/gitmessages,require,orion/bootstrap,orion/status,orion/progress,orion/commandRegistry,orion/commands,orion/keyBinding,orion/dialogs,orion/selection,orion/fileClient,orion/operationsClient,orion/searchClient,orion/globalCommands,orion/git/gitCommitExplorer,orion/git/gitCommands,orion/widgets/themes/ThemePreferences,orion/widgets/themes/editor/ThemeData,orion/git/gitClient,orion/links,orion/contentTypes,orion/PageUtil".split(","),function(g,k,j,e,c,b,a,i,f,d,h,
l,n,m,q,s,p,r,t,o,v,x){j.startup().then(function(j){var w=j.serviceRegistry,j=j.preferences;new f.DialogService(w);var z=new d.Selection(w),z=new b.CommandRegistry({selection:z}),A=new l.OperationsClient(w);new e.StatusReportingService(w,A,"statusPane","notifications","notificationArea");new c.ProgressService(w,A,z);(new p.ThemePreferences(j,new r.ThemeData)).apply();A=new o.TextLinkService({serviceRegistry:w});new t.GitService(w);var B=new h.FileClient(w);new v.ContentTypeService(w);var C=new n.Searcher({serviceRegistry:w,
commandService:z,fileService:B}),G=new q.GitCommitExplorer(w,z,A,null,"artifacts","pageActions",null,"itemLevelCommands");m.generateBanner("orion-git-commit",w,z,j,C,G);s.createFileCommands(w,z,G,"pageActions","selectionTools");s.createGitClonesCommands(w,z,G,"pageActions","selectionTools",B);z.addCommandGroup("pageActions","eclipse.gitGroup",100);z.registerCommandContribution("pageActions","eclipse.orion.git.cherryPick",100,"eclipse.gitGroup");z.registerCommandContribution("pageActions","eclipse.orion.git.askForReviewCommand",
101,"eclipse.gitGroup");z.registerCommandContribution("pageActions","eclipse.orion.git.openCommitCommand",102,"eclipse.gitGroup",!0,new i.KeyBinding("h",!0,!0));z.registerCommandContribution("itemLevelCommands","eclipse.removeTag",1E3);w=new a.Command({name:g["Working Directory Version"],tooltip:g["View the working directory version of the file"],id:"eclipse.orion.git.diff.showCurrent",hrefCallback:function(a){return k.toUrl("edit/edit.html")+"#"+a.items.ContentLocation},visibleWhen:function(a){return a.Type===
"Diff"}});z.addCommand(w);z.registerCommandContribution("itemLevelCommands","eclipse.orion.git.diff.showCurrent",2E3);w=x.matchResourceParameters();G.display(w.resource);window.addEventListener("hashchange",function(){var a=x.matchResourceParameters();G.display(a.resource)},!1)})});