/**
 * @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) 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). 
 *
 *******************************************************************************/

/*******************************************************************************
 * @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, 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) 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, 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).
 *
 ******************************************************************************/

/*******************************************************************************
 * @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 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) 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) 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, 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) 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) 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) 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, 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
 *		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
 ******************************************************************************/

/*******************************************************************************
 * @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
 ******************************************************************************/

/* 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) 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, 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) 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, 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) 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) 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). 


 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, 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) 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, 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) 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
 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) 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, 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) 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) 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: 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:
 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) 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) 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) 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: 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: 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) 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, 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
 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, 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) 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, 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) 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) 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, 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).

 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, 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, 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, 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
*/
(function(){function g(c,e,b,f,h,d){e[c]&&(b.push(c),(e[c]===!0||e[c]===1)&&f.push(h+c+"/"+d))}function k(c,e,b,f,h){e=f+e+"/"+h;require._fileExists(c.toUrl(e+".js"))&&b.push(e)}function j(c,e,b){for(var f in e)e.hasOwnProperty(f)&&(!c.hasOwnProperty(f)||b)?c[f]=e[f]:typeof e[f]==="object"&&j(c[f],e[f],b)}var e=/(^.*(^|\/)nls(\/|$))([^\/]*)\/?([^\/]*)/;define("i18n",["module"],function(c){var i=c.config?c.config():{};return{version:"2.0.1+",load:function(b,f,h,d){d=d||{};if(d.locale)i.locale=d.locale;
var a=e.exec(b),l=a[1],c=a[4],m=a[5],o=c.split("-"),t=[],s={},r,u="";if(a[5])l=a[1],b=l+m;else{m=a[4];c=i.locale;if(!c)c=i.locale=typeof navigator==="undefined"?"root":(navigator.language||navigator.userLanguage||"root").toLowerCase();o=c.split("-")}if(d.isBuild){t.push(b);k(f,"root",t,l,m);for(r=0;r<o.length;r++)d=o[r],u+=(u?"-":"")+d,k(f,u,t,l,m);f(t,function(){h()})}else f([b],function(a){var d=[],b;g("root",a,d,t,l,m);for(r=0;r<o.length;r++)b=o[r],u+=(u?"-":"")+b,g(u,a,d,t,l,m);f(t,function(){var b,
q,c;for(b=d.length-1;b>-1&&d[b];b--){c=d[b];q=a[c];if(q===!0||q===1)q=f(l+c+"/"+m);j(s,q)}h(s)})})}}})})();
define("orion/i18n",[],function(){return{load:function(g,k,j,e){var e=e||{},c=/(^.*(?:^|\/)nls(?:\/|$))([^\/]*)\/?([^\/]*)/,i=c.exec(g);if(i){if(!k.defined||k.defined(g))try{j(k(g));return}catch(b){}if(e.isBuild||e.isTest)j({});else{var f=i[1],h=i[3]?i[2]:"",d=i[3]||i[2];k(["orion/bootstrap"],function(a){a.startup().then(function(a){var b=a.serviceRegistry,a=b.getServiceReferences("orion.i18n.message");if(h)a.some(function(a){return g===a.getProperty("name")?(b.getService(a).getMessageBundle().then(function(a){j(a)},
function(){j({})}),!0):!1})||j({});else{var m={},o;a.forEach(function(a){var b=a.getProperty("name");if((i=c.exec(b))&&f===i[1]&&d===(i[3]||i[2]))if(h=i[3]?i[2]:""){if((a=e.locale||(typeof navigator!=="undefined"?navigator.language||navigator.userLanguage:null))&&a.toLowerCase().indexOf(h.toLowerCase())===0)m[h]=!0,(!k.specified||!k.specified(b))&&define(b,["orion/i18n!"+b],function(a){return a})}else o=a});!k.specified||!k.specified(g)?o?b.getService(o).getMessageBundle().then(function(a){Object.keys(m).forEach(function(d){typeof a[d]===
"undefined"&&(a[d]=m[d])});define(g,[],a);j(a)},function(){define(g,[],m);j(m)}):(define(g,[],m),j(m)):j(m)}})})}}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",Repo:"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","Log (0)":"Log (${0})","Log (0) - 1":"Log (${0}) - ${1}","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",
"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",ShowInEditor:"Show in Editor",ShowInEditorTooltip:"Show the repository folder in the editor","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.",
GitResetIndexConfirm:"The content of your active branch will be replaced with ${0}. 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","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.",
"URL:":"URL:","File:":"File:",Submit:"Submit","git url:":"git url: ",Revert:"Revert","Revert changes introduced by the commit into your active branch":"Revert changes introduced by the commit into your active branch",". Could not revert into active branch":". Could not revert into active branch"});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(){function g(){for(var c=navigator.userAgent,e={browser:!1,version:!1},b=[{name:"Chrome/Chromium",regExp:/(?:chrome|crios|chromium)\/(\d+)/i,minVersion:24},{name:"Firefox",regExp:/firefox\/(\d+)/i,minVersion:17},{name:"Microsoft Internet Explorer",regExp:/msie\s(\d+)/i,minVersion:10},{name:"Safari",regExp:/version\/(\d+).*?safari/i,minVersion:5}],f=0;f<b.length;f++){var h=b[f],d=c.match(h.regExp);if(d){e.browser=!0;e.version=d[1]>=h.minVersion;e.name=h.name;break}}return e}function k(){try{return"localStorage"in
window&&window.localStorage!==null}catch(c){return!1}}function j(c){alert(c);throw Error("unsupported browser");}var e=g();if(e.browser)e.version||j("Sorry, your browser version is not supported.\n\nTo use Orion, please upgrade to the latest version of "+e.name+".\n");else if(k()&&!localStorage.skipBrowserCheck)if(confirm("Sorry, your browser is not supported. The latest version of Chrome, Firefox or Safari web browser is recommended.\nContinue anyway?"))localStorage.skipBrowserCheck=1;else throw"unsupported browser";
else k()||j("Sorry, your browser is not supported.\n\nTo use Orion, the latest version of the Chrome, Firefox, or Safari web browser is recommended.\n");return{isSupportedBrowser:g,supportsLocalStorage:k,throwBrowserAlert:j}})();define("orion/browserCompatibility",function(){});
(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 b;b=c.shift();)b();i=!1}function k(b){c.push(b);i||(i=!0,setTimeout(g,0))}function j(b){return function(){b.apply(void 0,arguments)}}function e(){function b(){for(var d;d=n.shift();){var f=d.deferred,b=l==="fulfilled"?"resolve":"reject";if(typeof d[b]==="function")try{var h=(0,d[b])(a),e=h&&(typeof h===
"object"||typeof h==="function")&&h.then;if(typeof e==="function")if(h===f.promise)f.reject(new TypeError);else{var i=h.cancel;typeof i==="function"?f._protected(c).parentCancel=i.bind(h):delete f._protected(c).parentCancel;e.call(h,j(f.resolve),j(f.reject),j(f.progress))}else f.resolve(h)}catch(q){f.reject(q)}else f[b](a)}}function f(d){delete o.parentCancel;l="rejected";a=d;n.length&&k(b)}function h(d){function c(a){return function(d){g||(g=!0,a(d))}}var g=!1;delete o.parentCancel;try{var j=d&&
(typeof d==="object"||typeof d==="function")&&d.then;if(typeof j==="function")if(d===i)f(new TypeError);else{l="assumed";var w=d&&d.cancel;if(typeof w!=="function"){var v=new e,d=v.promise;try{j(v.resolve,v.reject,v.progress)}catch(q){v.reject(q)}w=d.cancel;j=d.then}a=d;j.call(d,c(h),c(f));o.parentCancel=w.bind(d)}else l="fulfilled",a=d,n.length&&k(b)}catch(p){c(f)(p)}}function d(){var a=o.parentCancel;if(a)delete o.parentCancel,a();else if(!l)a=Error("Cancel"),a.name="Cancel",f(a)}var a,l,n=[],i=
this,o={};Object.defineProperty(this,"_protected",{value:function(a){if(a!==c)throw Error("protected");return o}});this.resolve=function(a){l||h(a);return i};this.reject=function(a){l||f(a);return i};this.progress=function(a){l||n.forEach(function(d){if(d.progress)try{d.progress(a)}catch(f){}});return i.promise};this.cancel=function(){o.parentCancel?setTimeout(d,0):d();return i};this.then=function(a,d,f){a={resolve:a,reject:d,progress:f,deferred:new e};n.push(a);a.deferred._protected(c).parentCancel=
i.promise.cancel.bind(i);(l==="fulfilled"||l==="rejected")&&k(b);return a.deferred.promise};this.promise={then:i.then,cancel:i.cancel}}var c=[],i=!1;e.all=function(b,f){function h(d,f){c||(l[d]=f,--a===0&&i.resolve(l))}function d(a,d){if(!c){if(f)try{h(a,f(d));return}catch(b){d=b}i.reject(d)}}var a=b.length,l=[],c=!1,i=new e;i.then(void 0,function(){c=!0;b.forEach(function(a){a.cancel&&a.cancel()})});a===0?i.resolve(l):b.forEach(function(a,f){a.then(h.bind(void 0,f),d.bind(void 0,f))});return i.promise};
e.when=function(b,f,h,d){var a;if(!(b&&typeof b.then==="function"))a=new e,a.resolve(b),b=a.promise;return b.then(f,h,d)};return e});
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(f,b,d){this._properties=d||{};this._properties["service.id"]=f;this._properties.objectClass=b;this._properties["service.names"]=b}function e(f,b,d){this._serviceId=f;this._serviceReference=b;this._internalRegistry=d}function c(f,b){function d(a){return function(){var d;try{if(!b())throw Error("Service was unregistered");var c=f[a].apply(f,Array.prototype.slice.call(arguments));if(c&&typeof c.then==="function")return c;
else d=new g,d.resolve(c)}catch(e){d=new g,d.reject(e)}return d.promise}}for(var a in f)typeof f[a]==="function"&&(this[a]=d(a))}function i(f,b){this.type=f;this.serviceReference=b}function b(){this._entries=[];this._namedReferences={};this._serviceEventTarget=new k;var f=this;this._internalRegistry={isRegistered:function(b){return f._entries[b]?!0:!1},unregisterService:function(b){var d=f._entries[b];if(!d)throw Error("Service has already been unregistered: "+b);var a=d.reference;f._serviceEventTarget.dispatchEvent(new i("unregistering",
a));f._entries[b]=null;a.getProperty("objectClass").forEach(function(d){for(var b=f._namedReferences[d],h=0;h<b.length;h++)if(b[h]===a){b.length===1?delete f._namedReferences[d]:b.splice(h,1);break}})},modifyService:function(b){var d=f._entries[b];if(!d)throw Error("Service not found while trying to send modified event: "+b);f._serviceEventTarget.dispatchEvent(new i("modified",d.reference))}}}j.prototype={getPropertyKeys:function(){var f=[],b;for(b in this._properties)this._properties.hasOwnProperty(b)&&
f.push(b);return f},getProperty:function(f){return this._properties[f]}};j.prototype.constructor=j;e.prototype={unregister:function(){this._internalRegistry.unregisterService(this._serviceId)},getReference:function(){if(!this._internalRegistry.isRegistered(this._serviceId))throw Error("Service has already been unregistered: "+this._serviceId);return this._serviceReference},setProperties:function(f){var b=this._serviceReference._properties;this._serviceReference._properties=f||{};f["service.id"]=this._serviceId;
f.objectClass=b.objectClass;f["service.names"]=b["service.names"];this._internalRegistry.modifyService(this._serviceId)}};e.prototype.constructor=e;b.prototype={getService:function(f){var b;if(typeof f==="string")(f=this._namedReferences[f])&&f.some(function(d){b=this._entries[d.getProperty("service.id")].service;return!!b},this);else if(f=this._entries[f.getProperty("service.id")])b=f.service;return b||null},getServiceReferences:function(f){if(f)return this._namedReferences[f]?this._namedReferences[f]:
[];var b=[];this._entries.forEach(function(d){d&&b.push(d.reference)});return b},registerService:function(f,b,d){if(typeof b==="undefined"||b===null)throw Error("invalid service");typeof f==="string"?f=[f]:Array.isArray(f)||(f=[]);var a=this._entries.length,l=new j(a,f,d),n=this._namedReferences;f.forEach(function(a){n[a]=n[a]||[];n[a].push(l)});f=new c(b,this._internalRegistry.isRegistered.bind(null,a));this._entries.push({reference:l,service:f});f=this._internalRegistry;this._serviceEventTarget.dispatchEvent(new i("registered",
l));return new e(a,l,f)},addEventListener:function(f,b){this._serviceEventTarget.addEventListener(f,b)},removeEventListener:function(b,h){this._serviceEventTarget.removeEventListener(b,h)}};b.prototype.constructor=b;return{ServiceRegistry:b}});
define("orion/xhr",["orion/Deferred"],function(g){function k(g,e,c,i){var b=typeof c.response!=="undefined"?c.response:c.responseText,f;try{f=c.status}catch(h){f=0}g={args:e,response:b,responseText:typeof b==="string"?b:null,status:f,url:g,xhr:c};if(typeof i!=="undefined")g.error=i;return g}return function(j,e,c){var c=c||{},i=arguments.length>3&&arguments[3]?arguments[3]:new XMLHttpRequest,b=new g,f=c.headers||{},h=c.log||!1,d;typeof f["X-Requested-With"]==="undefined"&&(f["X-Requested-With"]="XMLHttpRequest");
if(typeof c.data!=="undefined"&&(j==="POST"||j==="PUT"))d=c.data;var a=!1,l=!1;b.promise.then(void 0,function(d){a=!0;!l&&d instanceof Error&&d.name==="Cancel"&&i.abort()});i.onabort=function(){l=!0;if(!a){var d=Error("Cancel");d.name="Cancel";b.reject(d)}};i.onload=function(){var a=k(e,c,i);200<=i.status&&i.status<400?b.resolve(a):(b.reject(a),h&&typeof console!=="undefined"&&console.log(Error(i.statusText)))};i.onerror=function(){var a=k(e,c,i);b.reject(a);h&&typeof console!=="undefined"&&console.log(Error(i.statusText))};
i.onprogress=function(a){a.xhr=i;b.progress(a)};try{i.open(j,e,!0);if(typeof c.responseType==="string")i.responseType=c.responseType;if(typeof c.timeout==="number")if(typeof i.timeout==="number")i.timeout=c.timeout,i.addEventListener("timeout",function(){b.reject(k(e,c,i,"Timeout exceeded"))});else{var n=setTimeout(function(){b.reject(k(e,c,i,"Timeout exceeded"))},c.timeout);b.promise.then(clearTimeout.bind(null,n),clearTimeout.bind(null,n))}Object.keys(f).forEach(function(a){i.setRequestHeader(a,
f[a])});i.send(d||null)}catch(m){b.reject(k(e,c,i,m))}return b.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._pendingDeletes=[];this._dirty=[]}function c(d,a){return{get:function(b,f){if(a===0)return null;var h=localStorage.getItem(d+b);if(h===null)return null;h=JSON.parse(h);return f||a===-1||h._expires&&h._expires>(new Date).getTime()?(delete h._expires,h):null},set:function(b,f){if(a!==0){if(a!==-1)f._expires=(new Date).getTime()+
1E3*a;if(Object.keys(f).length===0)localStorage.removeItem(d+b);else{var h=JSON.stringify(f);localStorage.setItem(d+b,h);delete f._expires}}},remove:function(a){localStorage.removeItem(d+a)}}}function i(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 b(d){this._location=
d;this._currentPromise=null;this._cache=new c("/orion/preferences/default",3600)}function f(){this._cache=new c("/orion/preferences/local",-1)}function h(d,a){this._userProvider=new i(d);this._localProvider=new f;a=a||"defaults.pref";a.indexOf("://")===-1&&(a=g.toUrl(a));this._defaultsProvider=new b(a);this._serviceRegistration=d.registerService("orion.core.preference",this)}e.prototype={_flush:function(){for(var d=[],a=0;a<this._stores.length;++a){var b=this._stores[a];this._dirty.indexOf(b)!==-1&&
d.push(this._providers[a].put(this._name,b));if(this._pendingDeletes[a]&&this._pendingDeletes[a].length>0){for(b=0;b<this._pendingDeletes[a].length;b++)d.push(this._providers[a].remove(this._name,this._pendingDeletes[a][b]));delete this._pendingDeletes[a]}}this._dirty=[];return k.all(d)},_scheduleFlush:function(d){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],b;for(b in a)a.hasOwnProperty(b)&&typeof this._cached[b]==="undefined"&&(this._cached[b]=a[b])}}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 b=this._stores[0];if(b[d]!==a)b[d]=a,this._cached=null,this._scheduleFlush(b)}},remove:function(d){for(var a=0;a<
this._stores.length;++a){var b=this._stores[a];if(b.hasOwnProperty(d))return delete b[d],this._pendingDeletes[a]||(this._pendingDeletes[a]=[]),this._pendingDeletes[a].push(d),this._cached=null,this._scheduleFlush(),!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,b=[],f=0;f<this._providers.length;++f)b.push(this._providers[f].get(this._name,
d).then(function(d){return function(b){a._stores[d]=b}}(f)));return k.all(b).then(function(){a._cached=null;a._getCached()})},flush:function(){this._flush()}};i.prototype={get:function(d,a){if(this._currentPromises[d])return this._currentPromises[d];var b=new k,f=null;a?this._cache.remove(d):f=this._cache.get(d);if(f!==null)b.resolve(f);else{this._currentPromises[d]=b;var h=this;this._service.get(d).then(function(a){h._cache.set(d,a);delete h._currentPromises[d];b.resolve(a)},function(a){a.status===
404?(a={},h._cache.set(d,a),delete h._currentPromises[d],b.resolve(a)):(delete h._currentPromises[d],b.resolve(h._cache.get(d,!0)||{}))})}return b},put:function(d,a){this._cache.set(d,a);return this._service.put(d,a)},remove:function(d,a){var b=this._cache.get(d);delete b[a];this._cache.set(d,b);return this._service.remove(d,a)}};b.prototype={get:function(d,a){if(this._currentPromise)return this._currentPromise;var b=new k,f=null;a?this._cache.remove(d):f=this._cache.get(d);if(f!==null)b.resolve(f);
else{this._currentPromise=b;var h=this;j("GET",this._location,{headers:{"Orion-Version":"1"},timeout:15E3}).then(function(a){a=JSON.parse(a.response);h._cache.set(d,a[d]||{});h._currentPromise=null;b.resolve(a[d]||{})},function(a){a.xhr.status===401||a.xhr.status===404?(h._cache.set(d,{}),h._currentPromise=null,b.resolve({})):(h._currentPromise=null,a=h._cache.get(d,!0),a!==null?b.resolve(a[d]||{}):b.resolve({}))})}return b},put:function(){var d=new k;d.resolve();return d},remove:function(d,a){var b=
this._cache.get(d);delete b[a];this.put(d,b)}};f.prototype={get:function(d){var a=new k,d=this._cache.get(d);d!==null?a.resolve(d):a.resolve({});return a},put:function(d,a){var b=new k;this._cache.set(d,a);b.resolve();return b},remove:function(d,a){var b=this._cache.get(d);delete b[a];this.put(d,b)}};h.DEFAULT_SCOPE=1;h.LOCAL_SCOPE=2;h.USER_SCOPE=4;h.prototype={listenForChangedSettings:function(d,a,b){if(!a||typeof a!=="number"||a>7||a<1)b=a,a=h.DEFAULT_SCOPE|h.LOCAL_SCOPE|h.USER_SCOPE;window.addEventListener("storage",
b,!1);if((h.USER_SCOPE&a)!==0)return"/orion/preferences/user"+d;else if((h.LOCAL_SCOPE&a)!==0)return"/orion/preferences/local"+d;return"/orion/preferences/default"+d},getPreferences:function(d,a){if(!a||typeof a!=="number"||a>7||a<1)a=h.DEFAULT_SCOPE|h.LOCAL_SCOPE|h.USER_SCOPE;var b=[];h.USER_SCOPE&a&&this._userProvider.available()&&b.push(this._userProvider);h.LOCAL_SCOPE&a&&b.push(this._localProvider);h.DEFAULT_SCOPE&a&&b.push(this._defaultsProvider);var f=new e(d,b);return f.sync().then(function(){return f})},
getSetting:function(d,a,b){for(var f,h=0;h<d.length;h++)if(d[h].label===a)for(var c=0;c<d[h].data.length;c++)if(d[h].data[c].label===b){f=d[h].data[c].value;break}return f}};return{PreferencesService:h}});
(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 i(a,d){var b="",f=[],h=0;return{next:function(){if(b!==a.query)b=a.query,f=k(b);if(h<f.length){var p=e(f[h++]);
switch(d){case "keys":return p[0];case "values":return p[1];case "keys+values":return[p[0],p[1]];default:throw new TypeError;}}throw x;}}}function b(a){Object.defineProperty(this,"_url",{get:function(){return a._url}})}function f(a){var d=[];a.split("/").forEach(function(a){a===".."?d.pop():a!=="."&&d.push(a)});return d.join("/")}function h(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=h(a),b=m.exec(a);
if(!b)return null;var p={};p.scheme=b[1]||"";if(p.scheme&&!t.test(p.scheme))return null;var q=b[2];if(q&&(q=o.exec(q),p.userinfo=q[1],p.host=q[2],p.port=q[3],p.port&&!s.test(p.port)))return null;p.path=b[3];p.query=b[4];p.fragment=b[5];if(!p.scheme&&d&&(p.scheme=d.scheme,!p.host&&d.host))p.userinfo=d.userinfo,p.host=d.host,p.port=d.port,p.pathRelative=!0;if(p.pathRelative)if(p.path){if(p.path[0]!=="/")b=/^(.*\/)[^\/]*$/.exec(d.path)[1]||"/",p.path=b+p.path}else p.path=d.path;if(p.scheme)p.scheme=
p.scheme.toLowerCase();if(p.port)p.port=/[1-9]\d*$/.exec(p.port)[0];if(p.host&&p.path)p.path=f(p.path);return p}function a(a,f){var p;if(f){f=f.href||f;p=d(f);if(!p||!p.scheme)throw new SyntaxError;Object.defineProperty(this,"_baseURL",{value:p})}p=d(a,p);if(!p)throw new SyntaxError;Object.defineProperty(this,"_input",{value:a,writable:!0});Object.defineProperty(this,"_url",{value:p,writable:!0});var h=new b(this);Object.defineProperty(this,"query",{get:function(){return this._url?h:null},enumerable:!0})}
try{var l;if(typeof window.URL==="function"&&window.URL.length!==0&&(l=new window.URL("http://www.w3.org?q")).protocol==="http:"&&l.query)return}catch(n){}var m=/^(?:([^:\/?#]+):)?(?:\/\/([^\/?#]*))?([^?#]*)(?:\?([^#]*))?(?:#(.*))?$/,o=/^(?:(.*)@)?(\[[^\]]*\]|[^:]*)(?::(.*))?$/,t=/^([a-zA-Z](?:[a-zA-Z0-9+-.])*)$/,s=/^\d*$/,r=/^(\[[^\]\/?#\s]*\]|[^:\/?#\s]*)$/,u=/^(\[[^\]\/?#\s]*\]|[^:\/?#\s]*)(?::(\d*))?$/,w=/^([^?#\s]*)$/,v=/^([^\s]*)$/,q=/^\S*$/,p=/([^:]*):?(.*)/,x=typeof StopIteration!=="undefined"?
StopIteration:Error("Stop Iteration"),D={"ftp:":"21","gopher:":"70","http:":"80","https:":"443","ws:":"80","wss:":"443"};Object.defineProperties(b.prototype,{get:{value:function(a){g(a);var d;k(this._url.query).some(function(b){b=e(b);if(b[0]===a)return d=b[1],!0});return d},enumerable:!0},set:{value:function(a,d){g(a);g(d);var b=k(this._url.query);b.some(function(f,p){var h=e(f);if(h[0]===a)return h[1]=d,b[p]=c(h),!0})||b.push(c([a,d]));this._url.query=j(b)},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),b=d.filter(function(d){return e(d)[0]!==a});return b.length!==d.length?(this._url.query=j(b),!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 b=i(this._url,"keys+values");try{for(;;){var f=b.next();a.call(d,f[1],f[0],this)}}catch(p){if(p!==x)throw p;
}},enumerable:!0},keys:{value:function(){return i(this._url,"keys")},enumerable:!0},values:{value:function(){return i(this._url,"values")},enumerable:!0},items:{value:function(){return i(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(b){b=e(b);b[0]===a&&d.push(b[1])});return d},enumerable:!0},append:{value:function(a,d){g(a);g(d);var b=k(this._url.query);b.push(c([a,d]));this._url.query=
j(b)},enumerable:!0}});Object.defineProperties(a.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,t.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=p.exec(this._userinfo);return decodeURIComponent(a[1]||"")},set:function(a){g(a);if(this._url){var d=
p.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=p.exec(this._userinfo);return decodeURIComponent(a[2]||"")},set:function(a){g(a);if(this._url){var d=[p.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=u.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&&r.exec(a))this._url.host=a},enumerable:!0},port:{get:function(){var a=this._url?this._url.port||"":"";a&&a===D[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&&w.exec(a))this._url.host&&a&&a[0]!=="/"&&(a="/"+a),this._url.path=a?f(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)),v.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)),q.exec(a)))this._url.fragment=
a},enumerable:!0}});window.URL&&window.URL.createObjectURL&&(Object.defineProperty(a,"createObjectURL",{value:window.URL.createObjectURL.bind(window.URL),enumerable:!1}),Object.defineProperty(a,"revokeObjectURL",{value:window.URL.revokeObjectURL.bind(window.URL),enumerable:!1}));window.URL=a})();define("orion/URL-shim",function(){});
define("orion/pluginregistry",["orion/Deferred","orion/EventTarget","orion/URL-shim"],function(g,k){function j(a,d){var b=Object.keys(a),f=Object.keys(d);if(b.length!==f.length)return!1;b.sort();f.sort();for(var h=0,c=b.length;h<c;h++){var e=b[h];if(e!==f[h])return!1;var i=a[e],e=d[e];if(i!==e&&JSON.stringify(i)!==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,b={key:function(b){return(d=
d||Object.keys(a))[b]},getItem:function(d){return a[d]},setItem:function(b,f){a[b]=f;d=null},removeItem:function(b){delete a[b];d=null},clear:function(){(d=d||Object.keys(a)).forEach(function(d){delete a[d]}.bind(this));d=null}};Object.defineProperty(b,"length",{get:function(){return(d=d||Object.keys(a)).length}});return b}function i(a,d){if(d&&d instanceof XMLHttpRequest){var b,f;try{b=d.status,f=d.statusText}catch(h){b=0,f=""}return{status:b||0,statusText:f}}return d}function b(a){var d=a?JSON.parse(JSON.stringify(a,
i)):a;if(a instanceof Error)d.__isError=!0,d.message=d.message||a.message,d.name=d.name||a.name;return d}function f(a,d){this.type=a;this.plugin=d}function h(a,d){this.__objectId=a;this.__methods=d}function d(a,d,c){function e(a){I&&c.postMessage(a,I)}function i(a){if(!I)return(new g).reject(Error("plugin not connected"));a.id=String(V++);var d=new g;S[a.id]=d;d.then(null,function(d){z==="active"&&d instanceof Error&&d.name==="Cancel"&&e({requestId:a.id,method:"cancel",params:d.message?[d.message]:
[]})});var b=Object.prototype.toString;a.params.forEach(function(f,p){if(b.call(f)==="[object Object]"&&!(f instanceof h)){var q,c;for(q in f)b.call(f[q])==="[object Function]"&&(c=c||[],c.push(q));if(c){var l=T++;O[l]=f;q=function(){delete O[l]};d.then(q,q);a.params[p]=new h(l,c)}}});c.postMessage(a,I);return d.promise}function s(a,d){a||a===0?e({id:a,result:null,error:d}):console.log(d)}function r(a,d,f,p){p.forEach(function(a,d){if(a&&typeof a.__objectId!=="undefined"){var b={};a.__methods.forEach(function(d){b[d]=
function(){return i({objectId:a.__objectId,method:d,params:Array.prototype.slice.call(arguments)})}});p[d]=b}});var h=typeof a===void 0?null:{id:a,result:null,error:null};try{var q=f.apply(d,p);if(h)q&&typeof q.then==="function"?(R[a]=q,q.then(function(d){delete R[a];h.result=d;e(h)},function(d){if(R[a])delete R[a],h.error=b(d),e(h)},function(){e({responseId:a,method:"progress",params:Array.prototype.slice.call(arguments)})})):(h.result=q,e(h))}catch(c){if(h)h.error=b(c),e(h)}}function u(a){try{if(a.method){var d=
a.method,b=a.params||[];if("serviceId"in a){var f=U[a.serviceId];f||s(a.id,"service not found");d in f?r(a.id,f,f[d],b):s(a.id,"method not found")}else if("objectId"in a){var p=O[a.objectId];p||s(a.id,"object not found");d in p?r(a.id,p,p[d],b):s(a.id,"method not found")}else if("requestId"in a){var h=R[a.requestId];h&&d==="cancel"&&h.cancel&&h.cancel.apply(h,b)}else if("responseId"in a){var q=S[a.responseId];q&&d==="progress"&&q.progress&&q.progress.apply(q,b)}else if("plugin"===a.method){var l=
a.params[0];N({headers:l.headers,services:l.services}).then(function(){J.resolve(x)})}else if("timeout"===a.method)J&&J.reject(a.error);else throw Error("Bad method: "+a.method);}else{var e=S[String(a.id)];delete S[String(a.id)];if(a.error){var i=c.handleServiceError(x,a.error);e.reject(i)}else e.resolve(a.result)}}catch(n){console.log("Plugin._messageHandler "+n)}}function w(a){var d={};if(a.methods&&(a.methods.forEach(function(b){d[b]=function(){var d={serviceId:a.serviceId,method:b,params:Array.prototype.slice.call(arguments)};
return z==="active"?i(d):x.start({"transient":!0}).then(function(){return i(d)})}}),d.addEventListener&&d.removeEventListener)){var b=new k,f=T++;O[f]={handleEvent:b.dispatchEvent.bind(b)};var p=new h(f,["handleEvent"]),q=d.addEventListener;d.addEventListener=function(a,d){b._namedListeners[a]||q(a,p);b.addEventListener(a,d)};var c=d.removeEventListener;d.removeEventListener=function(a,d){b.removeEventListener(a,d);b._namedListeners[a]||c(a,p)}}return d}function v(d){var b=JSON.parse(JSON.stringify(d.properties));
b.__plugin__=a;d=d.names||d.type||[];Array.isArray(d)||(d=[d]);b.objectClass=d;return b}function q(a){var d=w(a),b=v(a),b=c.registerService(a.names||a.type,d,b);K[a.serviceId]={registration:b,proxy:d}}function p(){c.persist(a,{created:D,headers:A,services:F,autostart:G,lastModified:y})}var x=this,d=d||{},D=d.created||(new Date).getTime(),A=d.headers||{},F=d.services||[],G=d.autostart,y=d.lastModified||0,z="installed",B,J,I,K={},V=0,T=0,R={},S={},O={},U={},N;this._persist=p;this._resolve=function(){z=
"resolved";c.dispatchEvent(new f("resolved",x))};this._getAutostart=function(){return G};this._getCreated=function(){return D};this.getLocation=function(){return a};this.getHeaders=function(){return JSON.parse(JSON.stringify(A))};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 y};this.getServiceReferences=function(){var a=[];Object.keys(K).forEach(function(d){a.push(K[d].registration.getReference())});
return a};this.getState=function(){return z};this.start=function(d){if(z==="uninstalled")return(new g).reject(Error("Plugin is uninstalled"));if(B)return B.promise.then(this.start.bind(this,d));if(z==="active")return(new g).resolve();if(!d||!d.transient){var b=d&&d.lazy?"lazy":"started";b!==G&&(G=b,p())}b=c.getState();if(b!=="starting"&&b!=="active")return d.transient?(new g).reject(Error("start transient error")):(new g).resolve();if(z==="installed")try{this._resolve()}catch(h){return(new g).reject(h)}z===
"resolved"&&F.forEach(function(a){q(a)});if(d&&d.lazy)return z!=="starting"&&(z="starting",c.dispatchEvent(new f("lazy activation",x))),(new g).resolve();var e=new g;B=e;z="starting";c.dispatchEvent(new f("starting",x));J=new g;I=c.connect(a,u);J.then(function(){J=null;z="active";c.dispatchEvent(new f("started",x));B=null;e.resolve()},function(){J=null;z="stopping";c.dispatchEvent(new f("stopping",x));Object.keys(K).forEach(function(a){K[a].registration.unregister();delete K[a]});c.disconnect(I);
I=null;z="resolved";B=null;c.dispatchEvent(new f("stopped",x));e.reject(Error("plugin activation error"))});return e.promise};this.stop=function(a){if(z==="uninstalled")return(new g).reject(Error("Plugin is uninstalled"));if(B)return B.promise.then(this.stop.bind(this,a));if((!a||!a.transient)&&"stopped"!==G)G="stopped",p();if(z!=="active"&&z!=="starting")return(new g).resolve();B=a=new g;z="stopping";c.dispatchEvent(new f("stopping",x));Object.keys(K).forEach(function(a){K[a].registration.unregister();
delete K[a]});I&&(c.disconnect(I),I=null);z="resolved";B=null;c.dispatchEvent(new f("stopped",x));a.resolve();return a.promise};N=function(d){if(z==="uninstalled")return(new g).reject(Error("Plugin is uninstalled"));if(!d)return y===0&&(y=(new Date).getTime(),p()),c.loadManifest(a).then(N);var b=A,h=F,e=G;A=d.headers||{};F=d.services||{};G=d.autostart||G;d.lastModified?y=d.lastModified:(y=(new Date).getTime(),p());if(j(A,b)&&j(F,h)&&G===e)return(new g).resolve();if(z==="active"||z==="starting"){var i=
[];Object.keys(F).forEach(function(a){var d=F[a];i.push(a);var b=K[a];if(b){if(j(d.methods,Object.keys(b.proxy))){var a=v(d),f=b.registration.getReference(),p={};f.getPropertyKeys().forEach(function(a){p[a]=f.getProperty(a)});j(a,p)||b.registration.setProperties(a);return}b.registration.unregister();delete K[a]}q(d)});Object.keys(K).forEach(function(a){i.indexOf(a)===-1&&(K[a].registration.unregister(),delete K[a])})}z==="active"&&(c.disconnect(I),J=new g,I=c.connect(a,u),J.then(function(){J=null},
function(){J=null;z="stopping";c.dispatchEvent(new f("stopping"),x);Object.keys(K).forEach(function(a){K[a].registration.unregister();delete K[a]});c.disconnect(I);I=null;z="resolved";c.dispatchEvent(new f("stopped",x))}));return(new g).resolve()};this.update=function(a){return N(a).then(function(){c.dispatchEvent(new f("updated",x))})};this.uninstall=function(){if(z==="uninstalled")return(new g).reject(Error("Plugin is uninstalled"));if(z==="active"||z==="starting"||z==="stopping")return this.stop().then(this.uninstall.bind(this),
this.uninstall.bind(this));c.removePlugin(this);z="uninstalled";c.dispatchEvent(new f("uninstalled",x));return(new g).resolve()}}var a=/^http[s]?/i;return{Plugin:d,PluginRegistry:function(b,h){function i(a){var d=a.source;r.some(function(b){if(d===b.target){try{var f;if(typeof b.useStructuredClone==="undefined"){var h=typeof a.data!=="string";f=h?a.data:JSON.parse(a.data);b.useStructuredClone=h}else f=b.useStructuredClone?a.data:JSON.parse(a.data);b.handler(f)}catch(c){}return!0}})}var h=h||{},j=
h.storage||localStorage;j.getItem||(j=c(j));var t="installed",s=[],r=[],u=new k,w={},v={registerService:b.registerService.bind(b),connect:function(a,d,b){function f(a){a=Error(a);a.name="timeout";d({method:"timeout",error:a})}var c={handler:d,url:a},l=setTimeout(f.bind(null,"Load timeout for: "+a),b||15E3),e=document.createElement("iframe");e.name=a+"_"+(new Date).getTime();if(!h.visible)e.style.display="none",e.style.visibility="hidden";e.src=a;e.onload=function(){clearTimeout(l);setTimeout(f.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)};r.push(c);return c},disconnect:function(a){for(var d=0;d<r.length;d++)if(a===r[d]){r.splice(d,1);try{a.close()}catch(b){}break}},removePlugin:function(a){for(var d=0;d<s.length;d++)if(a===s[d]){s.splice(d,1);break}j.removeItem("plugin."+a.getLocation())},persist:function(a,d){j.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{u.dispatchEvent(a)}catch(d){console&&console.log("PluginRegistry.dispatchEvent "+d)}},loadManifest:function(a){var d=new g,b=v.connect(a,function(a){b&&a.method&&("manifest"===a.method||"plugin"===a.method?(a=a.params[0],v.disconnect(b),b=null,d.resolve(a)):"timeout"===a.method&&(v.disconnect(b),b=null,d.reject(a.error)))});return d.promise},getState:function(){return t},handleServiceError:function(d,
b){if(b&&b.status===401){var f=d.getHeaders(),h=d.getName()||d.getLocation(),c=document.createElement("span");c.appendChild(document.createTextNode("Authentication required for: "+h+"."));if(f.login)c.appendChild(document.createTextNode(" ")),h=document.createElement("a"),h.target="_blank",h.textContent="Login",h.href=f.login,a.test(h.href)?(c.appendChild(h),c.appendChild(document.createTextNode(" and re-try the request."))):console.log("Illegal Login URL: "+f.login);return{Severity:"Error",HTML:!0,
Message:(new XMLSerializer).serializeToString(c)}}if(b.__isError){var l=b,b=Error(l.message);Object.keys(l).forEach(function(a){b[a]=l[a]});delete b.__isError}return b}};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=v.getState;this.init=function(){if(!(t==="starting"||t==="active"||t==="stopping")){addEventListener("message",i,
!1);for(var a=[],b=0,f=j.length;b<f;b++)a.push(j.key(b));a.forEach(function(a){if(a.indexOf("plugin.")===0){var b=a.substring(7),a=JSON.parse(j.getItem(a));a.created&&s.push(new d(b,a,v))}});s.sort(function(a,d){return a._getCreated()<d._getCreated()?-1:1});h.plugins&&Object.keys(h.plugins).forEach(function(a){a=e(a);if(!this.getPlugin(a)){var b=h.plugins[a],b=typeof b==="object"||{};b.autostart=b.autostart||h.defaultAutostart||"lazy";s.push(new d(a,b,v))}}.bind(this));t="starting"}};this.start=function(){t!==
"starting"&&this.init();if(t!=="starting")return(new g).reject("Cannot start framework. Framework is already "+t+".");var a=[],d=(new Date).getTime();s.forEach(function(b){var f=b._getAutostart();b.getLastModified()===0?a.push(b.update().then(function(){if("started"===f)return b.start({"transient":!0});if("lazy"===f)return b.start({lazy:!0,"transient":!0});b._resolve()})):"started"===f?a.push(b.start({"transient":!0})):"lazy"===f?(a.push(b.start({lazy:!0,"transient":!0})),d>b.getLastModified()+864E5&&
b.update()):b._resolve()});return g.all(a,function(a){console.log("PluginRegistry.stop "+a)}).then(function(){t="active"})};this.stop=function(){if(t!=="starting"&&t!=="active")return(new g).reject("Cannot stop registry. Registry is already "+t+".");t="stopping";var a=[];s.forEach(function(d){a.push(d.stop({"transient":!0}))});return g.all(a,function(a){console.log("PluginRegistry.stop "+a)}).then(function(){removeEventListener("message",i);t="resolved"})};this.update=function(){this.stop().then(this.start.bind(this))};
this.uninstall=function(){return(new g).reject("Cannot uninstall registry")};this.installPlugin=function(a,b){var a=e(a),h=this.getPlugin(a);if(h)return(new g).resolve(h);if(w[a])return w[a];if(b)return h=new d(a,b,v),s.push(h),h._persist(),v.dispatchEvent(new f("installed",h)),(new g).resolve(h);var c=v.loadManifest(a).then(function(b){h=new d(a,b,v);s.push(h);h._persist();delete w[a];v.dispatchEvent(new f("installed",h));return h},function(d){delete w[a];throw d;});return w[a]=c};this.getPlugins=
function(){return s.slice()};this.getPlugin=function(a){var d=null,a=e(a);s.some(function(b){if(a===b.getLocation())return d=b,!0});return d};this.addEventListener=u.addEventListener.bind(u);this.removeEventListener=u.removeEventListener.bind(u);this.resolvePlugins=function(){var a=!0;s.forEach(function(d){a=a&&d._resolve()});return a}}}});
define("orion/serviceTracker",[],function(){function g(e,c){function i(a){var d=a.getProperty("service.id"),b=this.addingService(a);b&&(f[d]=a,h[d]=b)}function b(a){var d=a.getProperty("service.id"),b=h[d];delete f[d];delete h[d];this.removedService(a,b)}this.serviceRegistry=e;var f={},h={},d=k,a,l;this.close=function(){if(d!==j)throw"Already closed";d=k;e.removeEventListener("registered",a);e.removeEventListener("unregistering",l);l=a=null;var f=this;this.getServiceReferences().forEach(function(a){b.call(f,
a)});if(typeof this.onClose==="function")this.onClose()};this.getServiceReferences=function(){var a=Object.keys(f);return!a.length?null:a.map(function(a){return f[a]})};this.open=function(){if(d!==k)throw"Already open";d=j;var f=this;a=function(a){if(a.serviceReference.getProperty("objectClass").indexOf(c)!==-1&&(i.call(f,a.serviceReference),typeof f.onServiceAdded==="function"))return f.onServiceAdded(a.serviceReference,f.serviceRegistry.getService(a.serviceReference))};l=function(a){a.serviceReference.getProperty("objectClass").indexOf(c)!==
-1&&b.call(f,a.serviceReference)};e.addEventListener("registered",a);e.addEventListener("unregistering",l);e.getServiceReferences(c).forEach(function(a){i.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/objects",[],function(){function g(g){for(var j=1;j<arguments.length;j++){var e=arguments[j],c;for(c in e)Object.prototype.hasOwnProperty.call(e,c)&&(g[c]=e[c])}return g}return{clone:function(k){if(Array.isArray(k))return Array.prototype.slice.call(k);var j=Object.create(Object.getPrototypeOf(k));g(j,k);return j},mixin:g,toArray:function(g){return Array.isArray(g)?g:[g]}}});
define("orion/config",["orion/Deferred","orion/serviceTracker","orion/objects"],function(g,k,j){var e,c,i,b,f,h="pid";e=function(a,d,b){function f(a,b,h){b.forEach(function(f,q){try{var p=a[q].getProperty("__plugin__"),c=p&&d.getPlugin(p);(!p||c&&c.getState()==="active")&&b[q].updated(h)}catch(e){typeof console!=="undefined"&&console.log(e)}})}k.call(this,a,"orion.cm.managedservice");var c={},e={},i=function(d){var f=[];d.plugin.getServiceReferences().forEach(function(d){if(d.getProperty("objectClass").indexOf("orion.cm.managedservice")!==
-1){var c=d.getProperty(h),d=a.getService(d);c&&d&&(c=(c=b._find(c))&&c.getProperties(),f.push(d.updated(c)))}});return g.all(f)};this.addingService=function(d){var b=d.getProperty(h),f=a.getService(d);if(!b||!f)return null;c[b]||(c[b]=[]);e[b]||(e[b]=[]);c[b].push(d);e[b].push(f);return f};this.onServiceAdded=function(a,d){var c=a.getProperty(h),c=b._find(c);f([a],[d],c&&c.getProperties())};this.onOpen=function(){d.addEventListener("started",i)};this.onClose=function(){d.removeEventListener("started",
i)};this.notifyUpdated=function(a){var d=a.getPid();f(c[d]||[],e[d]||[],a.getProperties())};this.notifyDeleted=function(a){a=a.getPid();f(c[a]||[],e[a]||[],null)};this.removedService=function(a,d){var b=a.getProperty(h),f=c[b],q=e[b];f.length>1?f.splice(f.indexOf(a),1):delete c[b];q.length>1?q.splice(q.indexOf(d),1):delete e[b]}};c=function(){function a(a,d,f){this.store=new i(this,f);this.configAdmin=new b(this,this.store);this.tracker=new e(a,d,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(a,d){this.factory=a;this.store=d}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 d="/cm/configurations";
i=function(){function a(a,b){this.factory=a;this.prefsService=b;this.configs=Object.create(null);this.pref=null;var c=this;this.initPromise=this.prefsService.getPreferences(d).then(function(a){c.pref=a;a.keys().forEach(function(d){if(!c.configs[d]){var b=a.get(d);typeof b==="object"&&b!==null&&Object.keys(b).length>0&&(b[h]=d,c.configs[d]=new f(c.factory,c,b))}})})}a.prototype={_init:function(){return this.initPromise},_find:function(a){return this.configs[a]||null},get:function(a){var d=this._find(a);
d||(d=new f(this.factory,this,a),this.configs[a]=d);return d},list:function(){var a=this,d=[];this.pref.keys().forEach(function(b){(b=a._find(b))&&b.getProperties()!==null&&d.push(b)});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 a}();f=function(){function a(a,d){d=j.clone(d);delete d[h];a.properties=d}function d(b,f,c){this.factory=b;this.store=f;if(c!==null&&typeof c==="object")this.pid=c[h],a(this,
c);else if(typeof c==="string")this.pid=c,this.properties=null;else throw Error("Invalid pid/properties "+c);}d.prototype={_checkRemoved:function(){if(this._removed)throw Error("Configuration was removed");},getPid:function(){this._checkRemoved();return this.pid},getProperties:function(a){this._checkRemoved();var d=null;if(this.properties&&(d=j.clone(this.properties),!a))d[h]=this.pid;return d},remove:function(){this._checkRemoved();this.factory.notifyDeleted(this);this.store.remove(this.pid);this._removed=
!0},update:function(d){this._checkRemoved();a(this,d);this.store.save(this.pid,this);this.factory.notifyUpdated(this)},toString:function(){return"[ConfigImpl pid: "+this.pid+", properties: "+JSON.stringify(this.properties)+"]"}};return d}();return{ConfigurationAdminFactory:c}});
define("orion/bootstrap","require,orion/Deferred,orion/serviceregistry,orion/preferences,orion/pluginregistry,orion/config".split(","),function(g,k,j,e,c,i){var b;return{startup:function(){if(b)return b;b=new k;var f=new j.ServiceRegistry,h=new e.PreferencesService(f);return h.getPreferences("/plugins").then(function(d){var a={plugins:{}};d.keys().forEach(function(b){var f=g.toUrl(b);a.plugins[f]=d[b]});var e=new c.PluginRegistry(f,a);return e.start().then(function(){if(f.getServiceReferences("orion.core.preference.provider").length>
0)return h.getPreferences("/plugins",h.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 i.ConfigurationAdminFactory(f,e,h)).getConfigurationAdmin().then(f.registerService.bind(f,"orion.cm.configadmin"))}).then(function(){var a=f.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)})}),b=localStorage.getItem("lastLogin");if(!b||b<(new Date).getTime()-9E5)return d}}).then(function(){var a={serviceRegistry:f,preferences:h,pluginRegistry:e};b.resolve(a);return a})})}}});
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",
"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 ",Related:"Related",Options:"Options",FAQ:"FAQ","Report a Bug":"Bugs","Privacy Policy":"Privacy","Terms of Use":"Terms","Copyright Agent":"Copyright","Orion Logo":"Orion Logo","Orion is in Beta. Please try it out but BEWARE your data may be lost.":"I20131030-1703","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?",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",
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","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.",Raw:"Raw","Open the raw file or folder in the browser":"Open the raw file or folder in the browser",OutlineProgress:"Getting outline for ${0} from ${1}",UnknownError:"An unknown error occurred.",UnknownWarning:"An unknown warning occurred."});
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("orion/util",[],function(){var g=navigator.userAgent,k=g.indexOf("MSIE")!==-1||g.indexOf("Trident")!==-1?document.documentMode: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,i=g.indexOf("Safari")!==-1&&!c,b=parseFloat(g.split("WebKit/")[1])||void 0,f=g.indexOf("Android")!==-1,h=g.indexOf("iPad")!==-1,g=g.indexOf("iPhone")!==-1,d=h||g,a=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,b){return d[(b<<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:i,isWebkit:b,isAndroid:f,isIPad:h,isIPhone:g,isIOS:d,isMac:a,isWindows:l,isLinux:n,platformDelimiter:l?"\r\n":"\n"}});
define("orion/webui/littlelib",["orion/util"],function(g){function k(b,h){h||(h=document);return h.querySelectorAll(b)}function j(b){if(b.tabIndex>=0)return b;if(b.hasChildNodes())for(var h=0;h<b.childNodes.length;h++){var d=j(b.childNodes[h]);if(d)return d}return null}function e(b){if(b.tabIndex>=0)return b;if(b.hasChildNodes())for(var h=b.childNodes.length-1;h>=0;h--){var d=e(b.childNodes[h]);if(d)return d}return null}function c(b,h){if(b.nodeType===3){var d=i.exec(b.nodeValue);d&&d.length>1&&h(b,
d)}if(b.hasChildNodes())for(d=0;d<b.childNodes.length;d++)c(b.childNodes[d],h)}var i=/\$\{([^\}]+)\}/,b=null;return{$:function(b,h){h||(h=document);return h.querySelector(b)},$$:k,$$array:function(b,h){return Array.prototype.slice.call(k(b,h))},node:function(b){var h=b;typeof b==="string"&&(h=document.getElementById(b));return h},contains:function(b,h){if(!b||!h)return!1;if(b===h)return!0;var d=b.compareDocumentPosition(h);return Boolean(d&16)},bounds:function(b){b=b.getBoundingClientRect();return{left:b.left+
document.body.scrollLeft,top:b.top+document.body.scrollTop,width:b.width,height:b.height}},empty:function(b){for(;b.hasChildNodes();)b.removeChild(b.firstChild)},firstTabbable:j,lastTabbable:e,stop:function(b){if(window.document.all)b.keyCode=0;b.preventDefault&&(b.preventDefault(),b.stopPropagation())},processTextNodes:function(b,h){c(b,function(d,a){d.parentNode.replaceChild(document.createTextNode(h[a[1]]||a[1]),d)})},processDOMNodes:function(b,h){c(b,function(d,a){var b=h[a[1]];if(b){var f=document.createRange(),
c=a.index;f.setStart(d,c);f.setEnd(d,c+a[0].length);f.deleteContents();f.insertNode(b)}})},addAutoDismiss:function(f,h){function d(a){b.forEach(function(d){var b=!1,f=d.excludeNodes.some(function(d){return document.body.contains(d)?(b=!0,d.contains(a.target)):!1});if(b&&!f)try{d.dismiss()}catch(h){typeof console!=="undefined"&&console&&console.error(h&&h.message)}});b=b.filter(function(a){return a.excludeNodes.some(function(a){return document.body.contains(a)})})}b===null&&(b=[],document.addEventListener("click",
d,!0),g.isIOS&&document.addEventListener("touchend",function(a){function d(){a.target.removeEventListener("click",d)}a.touches.length===0&&a.target.addEventListener("click",d)},!1));b.push({excludeNodes:f,dismiss:h})},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("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,i=/<body[^>]*>\s*([\s\S]+)\s*<\/body>/im,b=typeof location!=="undefined"&&location.href,f=b&&location.protocol&&location.protocol.replace(/\:/,""),h=b&&location.hostname,d=b&&(location.port||void 0),a=[],l=g.config&&g.config()||{};k={version:"2.0.5",strip:function(a){if(a){var a=a.replace(c,""),d=a.match(i);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,b;if(typeof XMLHttpRequest!=="undefined")return new XMLHttpRequest;else if(typeof ActiveXObject!=="undefined")for(d=0;d<3;d+=1){b=e[d];try{a=new ActiveXObject(b)}catch(f){}if(a){e=[b];break}}return a},parseName:function(a){var d,
b,f=!1,h=a.indexOf(".");d=a.indexOf("./")===0||a.indexOf("../")===0;h!==-1&&(!d||h>1)?(d=a.substring(0,h),b=a.substring(h+1,a.length)):d=a;a=b||d;h=a.indexOf("!");h!==-1&&(f=a.substring(h+1)==="strip",a=a.substring(0,h),b?b=a:d=a);return{moduleName:d,ext:b,strip:f}},xdRegExp:/^((\w+)\:)?\/\/([^\/\\]+)/,useXhr:function(a,d,b,f){var h,c;h=k.xdRegExp.exec(a);if(!h)return!0;a=h[2];h=h[3];h=h.split(":");c=h[1];h=h[0];return(!a||a===d)&&(!h||h.toLowerCase()===b.toLowerCase())&&(!c&&!h||c===f)},finishLoad:function(d,
b,f,h){f=b?k.strip(f):f;l.isBuild&&(a[d]=f);h(f)},load:function(a,c,e,i){if(i.isBuild&&!i.inlineText)e();else{l.isBuild=i.isBuild;var g=k.parseName(a),i=g.moduleName+(g.ext?"."+g.ext:""),j=c.toUrl(i),u=l.useXhr||k.useXhr;!b||u(j,f,h,d)?k.get(j,function(d){k.finishLoad(a,g.strip,d,e)},function(a){e.error&&e.error(a)}):c([i],function(a){k.finishLoad(g.moduleName+"."+g.ext,g.strip,a,e)})}},write:function(d,b,f){if(a.hasOwnProperty(b)){var h=k.jsEscape(a[b]);f.asModule(d+"!"+b,"define(function () { return '"+
h+"';});\n")}},writeFile:function(a,d,b,f,h){var d=k.parseName(d),c=d.ext?"."+d.ext:"",e=d.moduleName+c,l=b.toUrl(d.moduleName+c)+".js";k.load(e,b,function(){var d=function(a){return f(l,a)};d.asModule=function(a,d){return f.asModule(a,l,d)};k.write(a,e,d,h)},h)}};if(l.env==="node"||!l.env&&typeof process!=="undefined"&&process.versions&&process.versions.node)j=require.nodeRequire("fs"),k.get=function(a,d){var b=j.readFileSync(a,"utf8");b.indexOf("\ufeff")===0&&(b=b.substring(1));d(b)};else if(l.env===
"xhr"||!l.env&&k.createXhr())k.get=function(a,d,b,f){var h=k.createXhr(),c;h.open("GET",a,!0);if(f)for(c in f)f.hasOwnProperty(c)&&h.setRequestHeader(c.toLowerCase(),f[c]);if(l.onXhr)l.onXhr(h,a);h.onreadystatechange=function(){var f;if(h.readyState===4)f=h.status,f>399&&f<600?(f=Error(a+" HTTP status: "+f),f.xhr=h,b(f)):d(h.responseText)};h.send(null)};else if(l.env==="rhino"||!l.env&&typeof Packages!=="undefined"&&typeof java!=="undefined")k.get=function(a,d){var b,f,h=new java.io.File(a),c=java.lang.System.getProperty("line.separator"),
h=new java.io.BufferedReader(new java.io.InputStreamReader(new java.io.FileInputStream(h),"utf-8")),e="";try{b=new java.lang.StringBuffer;(f=h.readLine())&&f.length()&&f.charAt(0)===65279&&(f=f.substring(1));for(b.append(f);(f=h.readLine())!==null;)b.append(c),b.append(f);e=String(b.toString())}finally{h.close()}d(e)};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 i=k.$("#slideContainer",c);i.id=e+i.id;i=k.$("#pageCommandParameters",c);i.id=e+i.id;i=k.$("#pageCommandDismiss",c);i.id=e+i.id;return c.innerHTML}}});
define("orion/keyBinding",["orion/util"],function(g){function k(e,c,i,b,f,h){this.type=h||"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=i!==void 0&&i!==null?i:!1;this.mod3=b!==void 0&&b!==null?b:!1;this.mod4=f!==void 0&&f!==null?f:!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 i=this.keys;if(c!==void 0)return c>i.length?!1:i[c].match(e)?c===i.length-1?!0:c+1:!1;else{e instanceof Array||(e=[e]);if(e.length>i.length)return!1;var b;for(b=0;b<e.length;b++)if(!i[b].match(e[b]))return!1;return b===i.length?!0:b}},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;this._selectionClass=e.selectionClass;var c=this;this._triggerNode.addEventListener("click",function(e){c.toggle()&&
k.stop(e)},!1);this._triggerNode.tagName.toLowerCase()==="span"&&this._triggerNode.addEventListener("keydown",function(e){if(e.keyCode===k.KEY.ENTER||e.keyCode===k.KEY.SPACE)c.toggle(),k.stop(e)},!1);this._dropdownNode.addEventListener("keydown",this._dropdownKeyDown.bind(this),!1)},toggle:function(){return this.isVisible()?this.close():this.open()},isVisible:function(){return this._triggerNode.classList.contains("dropdownTriggerOpen")},open:function(){if(!this.isVisible()){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)),function(){if(this.isVisible()){this.close();for(var c=this._dropdownNode.parentNode;c;)c.dropdown&&typeof c.dropdown.close==="function"&&c.dropdown.close(),c=c.parentNode}}.bind(this));this._hookedAutoDismiss=!0}this._triggerNode.classList.add("dropdownTriggerOpen");this._selectionClass&&
this._triggerNode.classList.add(this._selectionClass);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(document.body);if(e.left+e.width>c.left+c.width)if(this._triggerNode.classList.contains("dropdownMenuItem"))this._dropdownNode.style.left=-e.width+"px";else{var c=k.bounds(this._boundingNode(this._triggerNode)),i=k.bounds(this._triggerNode);
this._dropdownNode.style.left=i.left-c.left-e.width+i.width+"px"}},_boundingNode:function(e){var c=window.getComputedStyle(e,null);return c===null?e:c.getPropertyValue("position")==="absolute"||!e.parentNode||e===document.body?e:this._boundingNode(e.parentNode)},close:function(e){if(this.isVisible())return this._triggerNode.classList.remove("dropdownTriggerOpen"),this._selectionClass&&this._triggerNode.classList.remove(this._selectionClass),this._dropdownNode.classList.remove("dropdownMenuOpen"),
e&&this._triggerNode.focus(),!0},getItems:function(){var e=[],c=this;k.$$array("li:not(.dropdownSeparator) > .dropdownMenuItem",this._dropdownNode,!0).forEach(function(i){i.parentNode.parentNode===c._dropdownNode&&e.push(i)});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(),i=document.activeElement;if(c.length&&c.length>0&&i){var b=c.indexOf(i);b<0&&(b=c.indexOf(i.parentNode));b>=0&&(e.keyCode===k.KEY.UP&&b>0?(b--,c[b].focus()):e.keyCode===k.KEY.DOWN&&b<c.length-1?(b++,c[b].focus()):e.keyCode===k.KEY.ENTER||e.keyCode===k.KEY.RIGHT?i.classList.contains("dropdownTrigger")&&i.dropdown&&i.dropdown.open():e.keyCode===k.KEY.LEFT&&i.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 core-sprite-downarrow"></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 core-sprite-closedarrow"></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",this._clickHandler=function(b){b.target===c._node&&(c.show(),k.stop(b))},!1);else if(this._trigger==="mouseover"){this._showDelay=e.showDelay===void 0?500:e.showDelay;e=["mouseout","click"];this._node.addEventListener("mouseover",this._mouseoverHandler=function(b){k.contains(c._node,b.target)&&(c.show(),k.stop(b))},!1);this._leaveHandler=function(b){k.contains(c._node,b.target)&&c.hide()};for(var i=0;i<e.length;i++)this._node.addEventListener(e[i],
this._leaveHandler,!1)}},_makeTipNode:function(){if(!this._tip){this._tip=document.createElement("span");this._tip.classList.add("tooltipContainer");this._tipInner=document.createElement("div");this._tipInner.classList.add("tooltip");if(this._text)this._tipTextContent=document.createElement("div"),this._tipTextContent.classList.add("textContent"),this._tipInner.appendChild(this._tipTextContent),this._tipTextContent.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 i=this._node,b;for(b=k.bounds(i);i&&!b.width&&!b.height;i=i.parentNode)b=k.bounds(i);var i=k.bounds(this._tipInner),f;switch(e){case "above":f=b.top-i.height-this._tailSize-1;b=b.left-this._tailSize;break;case "below":f=b.top+b.height+this._tailSize+1;b=b.left-this._tailSize;break;case "left":f=b.top-this._tailSize/2;b=b.left-i.width-
this._tailSize-1;break;default:f=b.top-this._tailSize/2,b=b.left+b.width+this._tailSize+1}var h=k.bounds(document.documentElement);if(f+i.height>h.height)if(c)f=h.height-i.height-1;else return!1;if(b+i.width>h.width)if(c)b=h.width-i.width-1;else return!1;if(b<0)if(c)b=4;else return!1;if(f<0)if(c)f=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=i.width+"px";this._tip.style.top=f+"px";this._tip.style.left=b+"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,i=0;!c&&i<e._position.length;)c=e._positionTip(e._position[i]),i++;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._tipTextContent=this._tipInner=this._tip=null;if(this._node){this._node.removeEventListener("click",this._clickHandler,!1);this._node.removeEventListener("mouseover",this._mouseoverHandler,!1);for(var e=["mouseout","click"],c=0;c<e.length;c++)this._node.removeEventListener(e[c],this._leaveHandler,!1)}}};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,i,b,f){function h(a){var d=a.invocation;if(d){var b=a.command;if(b.hrefCallback)return a=b.hrefCallback.call(d.handler||window,d),a.then?a.then(function(a){window.open(a)}):window.open(a),!0;else if(d.commandRegistry)return d.commandRegistry._invoke(d),
!0;else if(b.onClick||b.callback)return window.setTimeout(function(){(b.onClick||b.callback).call(d.handler||window,d)},0),!0}return!1}function d(a,d){for(var b in d)if(d[b]&&d[b].keyBinding&&d[b].command&&d[b].keyBinding.match(a)){var f=d[b],c=f.keyBinding;if((!c.domScope||j.contains(j.node(c.domScope),a.target))&&h(f)){j.stop(a);break}}}function a(a,d,b){d.classList.add("commandImage");var f;a.imageClass?a.addImageClassToElement?d.classList.add(a.imageClass):(f=document.createElement("span"),d.appendChild(f),
f.classList.add(a.spriteClass),f.classList.add(a.imageClass)):(f=new Image,f.alt=a.name,f.name=b,f.id=b,f.src=a.image,d.appendChild(f));return f}function l(a,d,b,f,h){this.commandRegistry=h;this.handler=a;this.items=d;this.userData=b;this.command=f;if(f.parameters)this.parameters=f.parameters.makeCopy();this.id=f.id}function n(a){this._init(a)}var m=null,o={};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 b=a.target.nodeName.toLowerCase();if(b==="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(b==="textarea")return}b={};if(m){var f,h,c;h=Object.keys(o);for(f=0;f<h.length;f++)c=h[f],b[c]=o[c];var e=m();h=Object.keys(e);for(f=0;f<h.length;f++)c=h[f],b[c]=e[c]}else b=o;d(a,b)},!1);l.prototype=
{collectsParameters:function(){return this.commandRegistry&&this.commandRegistry.collectsParameters()},makeCopy:function(a){var d=new l(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}};l.prototype.constructor=l;n.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.selectionClass=a.selectionClass;this.spriteClass=a.spriteClass||"commandSprite";this.visibleWhen=a.visibleWhen;this.parameters=a.parameters},populateChoicesMenu:function(a,d,b,f,h){this.getChoices(d,b,f).forEach(function(b){if(b.name){var f=document.createElement("li");a.appendChild(f);var p=document.createElement("span");
p.tabIndex=0;p.role="menuitem";p.classList.add("dropdownMenuItem");var c=document.createTextNode(b.name);p.appendChild(c);f.appendChild(p);p.choice=b;p.addEventListener("click",function(a){a.target.choice&&a.target.choice.callback.call(a.target.choice,d)},!1);p.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 h._generateMenuSeparator(a)})},getChoices:function(a,d,b){return this.choiceCallback?
this.choiceCallback.call(d,a,b):null},makeChoiceCallback:function(a,d){return function(b){a.callback&&a.callback.call(a,d,b)}},hasImage:function(){return this.imageClass||this.image!==g.toUrl("images/none.png")}};n.prototype.constructor=n;return{Command:n,CommandInvocation:l,createDropdownMenu:function(d,b,f,h,l,i,q){d=j.node(d);if(!d)throw"no parent node was specified";var p=document.createRange();p.selectNode(d);p=p.createContextualFragment(c);j.processTextNodes(p,{ButtonText:b});d.appendChild(p);
d=d.lastChild;p=d.previousSibling;h?p.classList.add(h):(p.classList.add("orionButton"),p.classList.add("commandButton"));if(l){if(!i)p.textContent="",p.setAttribute("aria-label",b);a({spriteClass:"commandSprite",imageClass:l},p,b);p.classList.add("orionButton")}p.dropdown=new e.Dropdown({dropdown:d,populate:f,selectionClass:q});d.dropdown=p.dropdown;return{menuButton:p,menu:d,dropdown:p.dropdown}},createCheckedMenuItem:function(a,d,f,h){a=j.node(a);if(!a)throw"no parent node was specified";var c=
document.createRange();c.selectNode(a);c=c.createContextualFragment(b);j.processTextNodes(c,{ItemText:d});a.appendChild(c);a=j.$(".checkedMenuItem",a.lastChild);a.checked=f;a.addEventListener("change",h,!1);return a},createCommandItem:function(d,b,h,c,e,l,q){var p,l=l||!b.name&&b.hasImage();if(b.hrefCallback)p=document.createElement("a"),p.id=c,l&&b.hasImage()?a(b,p,c):(p.className="commandLink",p.appendChild(document.createTextNode(b.name))),q=b.hrefCallback.call(h.handler,h),q.then?q.then(function(a){p.href=
a}):p.href=q?q:"#";else{p=document.createElement("button");p.className="orionButton";l?b.hasImage()?(a(b,p,c),b.name&&p.setAttribute("aria-label",b.name)):(p.classList.add("commandButton"),p.classList.add("commandMissingImageButton"),p.appendChild(document.createTextNode(b.name))):(p.classList.add("commandButton"),c=document.createTextNode(b.name),p.appendChild(c));var i=q||b.callback;if(i)b.onClick=i,p.addEventListener("click",function(){i.call(h.handler,h)},!1)}d.nodeName.toLowerCase()==="ul"?(q=
document.createElement("li"),d.appendChild(q),d=q):p.classList.add("commandMargins");d.appendChild(p);if(b.tooltip)p.commandTooltip=new f.Tooltip({node:p,text:b.tooltip,position:["above","below","right","left"]});e&&(o[b.id]={keyBinding:e,command:b,invocation:h});return p},createCommandMenuItem:function(a,d,b,h,c){var e,q=a.dropdown;if(d.hrefCallback)e=document.createElement("a"),e.appendChild(document.createTextNode(d.name)),c=d.hrefCallback.call(b.handler,b),c.then?c.then(function(a){e.href=a}):
e.href=c?c:"#",e.addEventListener("keydown",function(a){(a.keyCode===j.KEY.ENTER||a.keyCode===j.KEY.SPACE)&&e.click()},!1);else{e=document.createElement("span");e.tabIndex=0;e.appendChild(document.createTextNode(d.name));var p=c||d.callback;if(p)d.onClick=p,e.addEventListener("click",function(){q.close(!0);p.call(b.handler,b)},!1),e.addEventListener("keydown",function(a){if(a.keyCode===j.KEY.ENTER||a.keyCode===j.KEY.SPACE)a.preventDefault(),e.click()},!1)}if(d.tooltip)e.commandTooltip=new f.Tooltip({node:e,
text:d.tooltip,position:["right","left","above","below"]});e.className="dropdownMenuItem";e.role="menuitem";c=document.createElement("li");a.appendChild(c);c.appendChild(e);h&&(o[d.id]={keyBinding:h,command:d,invocation:b});return e},executeBinding:h,setKeyBindingProvider:function(a){m=a},localKeyBindings:o,_testMethodProcessKey:d}});
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/PageUtil",[],function(){var g=/^http[s]?/i;return{hash:function(){var g=window.location.href.split("#")[1];return g?"#"+g:""},matchResourceParameters:function(g){var g=g||window.location.toString(),j={resource:""},e=g.indexOf("#");if(e!==-1&&(g=g.substring(e+1),g.length!==0)){g=g.split(",");j.resource=decodeURIComponent(g[0]);for(e=1;e<g.length;e++){var c=/([^=]*)(=?)(.*)/.exec(g[e]),i=decodeURIComponent(c[1]||""),c=decodeURIComponent(c[3]||"");i!==""&&i!=="resource"&&(j[i]=c)}}return j},
validateURLScheme:function(k,j){var e=k;if(k.indexOf("://")===-1){var c=document.createElement("a");c.href=k;e=c.href}c=!1;return(c=j?j.some(function(c){return RegExp("^"+c+":","i").test(e)}):g.test(e))?k:(console.log("Illegal URL Scheme: '"+k+"'"),"")}}});
define("orion/uiUtils",["i18n!orion/nls/messages","orion/webui/littlelib"],function(g,k){function j(c){var e="",b=navigator.platform.indexOf("Mac")!==-1;c.mod1&&(e+=b?"Cmd+":"Ctrl+");c.mod2&&(e+="Shift+");c.mod3&&(e+="Alt+");c.mod4&&b&&(e+="Ctrl+");if(c.alphaKey)return e+c.alphaKey;if(c.type==="keypress")return e+c.keyCode;for(var f in k.KEY)if(typeof(k.KEY[f]==="number")&&k.KEY[f]===c.keyCode)return e+f;var h;switch(c.keyCode){case 59:h=c.mod2?":":";";break;case 61:h=c.mod2?"+":"=";break;case 188:h=
c.mod2?"<":",";break;case 190:h=c.mod2?">":".";break;case 191:h=c.mod2?"?":"/";break;case 192:h=c.mod2?"~":"`";break;case 219:h=c.mod2?"{":"[";break;case 220:h=c.mod2?"|":"\\";break;case 221:h=c.mod2?"}":"]";break;case 222:h=c.mod2?'"':"'"}return h?e+h:c.keyCode>=112&&c.keyCode<=123?e+"F"+(c.keyCode-111):e+String.fromCharCode(c.keyCode)}function e(c){var e=window.navigator.platform.indexOf("Mac")!==-1;return e&&c.metaKey||!e&&c.ctrlKey}return{getUserKeyString:function(c){for(var e="",c=c.getKeys(),
b=0;b<c.length;b++)b!==0&&(e+=" "),e+=j(c[b]);return e},getUserText:function(c,e,b,f,h,d,a,l,n){var m=!1,a=function(a){return function(l){if(!m){var g=k.node(c),j=g.value;if(g)if(a&&l.keyCode===k.KEY.ESCAPE){if(b)e.style.display="inline";m=!0;g.parentNode.removeChild(g);d&&d()}else if(!(a&&l.keyCode!==k.KEY.ENTER)){if(j.length===0||!n&&j===f){if(b)e.style.display="inline"}else if(h(j),b&&e.parentNode)e.style.display="inline";m=!0;g.parentNode&&g.parentNode.removeChild(g);d&&d()}}}},g=document.createElement("input");
g.id=c;g.value=f||"";e.parentNode.insertBefore(g,e.nextSibling);g.classList.add("userEditBoxPrompt");if(b)e.style.display="none";g.addEventListener("keydown",a(!0),!1);g.addEventListener("blur",a(!1),!1);window.setTimeout(function(){g.focus();if(f){var a=k.node(c),d=l?f.indexOf(l):-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,i){i&&e(i)?window.open(c):window.location=c},createButton:function(c,e){var b=document.createElement("button");b.className="orionButton commandButton commandMargins";b.addEventListener("click",function(b){e();k.stop(b)},!1);c&&b.appendChild(document.createTextNode(c));return b},createDropdownButton:function(){},isFormElement:function(c){switch(c.tagName.toLowerCase()){case "button":case "fieldset":case "form":case "input":case "keygen":case "label":case "legend":case "meter":case "optgroup":case "output":case "progress":case "select":case "textarea":return!0}return!1}}});
define("orion/commandRegistry","require,orion/commands,orion/explorers/navigationUtils,orion/PageUtil,orion/uiUtils,orion/webui/littlelib,orion/webui/dropdown,orion/webui/tooltip,text!orion/webui/checkedmenuitem.html,text!orion/webui/dropdowntriggerbutton.html,text!orion/webui/submenutriggerbutton.html".split(","),function(g,k,j,e,c,i,b,f,h,d,a){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,b,f,h){this.name=a;this.type=d;this.label=b;this.value=f;this.lines=h||1}function o(a,d,b){this._storeParameters(a);this._hasOptionalParameters=d&&d.hasOptionalParameters;this._options=d;this.optionsRequested=!1;this.getParameters=b;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 b=this._urlBindings[d].urlBinding.match(a);if(b){var f=this._urlBindings[d],h=f.command,c=f.invocation;if(c&&c.parameters&&h.callback){c.parameters.setValue(b.parameterName,b.parameterValue);var q=this;window.setTimeout(function(){q._invoke(c)},0);break}}}},findCommand:function(a){return this._commandList[a]},runCommand:function(a,d,b,f){d?(a=this._commandList[a])&&(a.visibleWhen?a.visibleWhen(d):1)&&a.callback&&this._invoke(new k.CommandInvocation(b,
d,null,a,this),f):(d=this._urlBindings[a])&&d.command&&d.command.callback&&this._invoke(d.invocation,f)},getSelectionService:function(){return this._selectionService},setParameterCollector:function(a){this._parameterCollector=a},openParameterCollector:function(a,d,b){this._parameterCollector&&(this._parameterCollector.close(),this._parameterCollector.open(a,d,b))},confirm:function(a,d,b,f,h,c){var q=!1;if(this._parameterCollector&&!h){var p=this;this._parameterCollector.close();if(this._parameterCollector.open(a,
function(a,h){var c=document.createElement("span");c.classList.add("parameterPrompt");c.textContent=d;a.appendChild(c);c=document.createElement("button");c.addEventListener("click",function(){q=!0;p._parameterCollector.close()},!1);h.appendChild(c);c.appendChild(document.createTextNode(b));c.className="dismissButton";var e=document.createElement("button");e.addEventListener("click",function(){q=!1;p._parameterCollector.close()},!1);h.appendChild(e);e.appendChild(document.createTextNode(f));e.className=
"dismissButton";return c},function(){c(q)}))return}q=window.confirm(d);c(q)},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,d){if(a)if(this._parameterCollector&&a.parameters&&a.parameters.hasParameters()&&(d||a.parameters.shouldCollectParameters())){var b=!1;a.parameters.updateParameters(a);
if(a.parameters.shouldCollectParameters()&&(b=this._parameterCollector.collectParameters(a),!b)){var h=new f.Tooltip({node:a.domNode,afterHiding:function(){this.destroy()},trigger:"click",position:["below","right","above","left"]}),b=h.contentContainer();b.classList.add("parameterPopup");var c=window.document.activeElement,e=this._parameterCollector.getFillFunction(a,function(){c&&c.focus();h.destroy()})(b);h.show();window.setTimeout(function(){e.focus();e.select()},0);b=!0}b||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){return function(){k.executeBinding(a)}}var b={},f,h,e=[],q;for(q in this._activeBindings)(h=this._activeBindings[q])&&h.keyBinding&&h.command&&(h.command.name||h.command.tooltip)&&e.push(h);e.sort(function(a,d){return(a.command.name||
a.command.tooltip).localeCompare(d.command.name||d.command.tooltip)});for(q=0;q<e.length;q++)h=e[q],h.keyBinding.scopeName?(b[h.keyBinding.scopeName]||(b[h.keyBinding.scopeName]=[]),b[h.keyBinding.scopeName].push(h)):(f=c.getUserKeyString(h.keyBinding),a.createItem(f,h.command.name||h.command.tooltip,d(h)));for(var p in b)b[p].length&&b[p].length>0&&(a.createHeader(p),b[p].forEach(function(b){f=c.getUserKeyString(b.keyBinding);a.createItem(f,b.command.name||b.command.tooltip,d(b))}))},addCommand:function(a){this._commandList[a.id]=
a;var d=this._pendingBindings[a.id];if(d){var b=this;d.forEach(function(d){b._addBinding(a,d.type,d.binding,d.bindingOnly)});delete this._pendingBindings[a.id]}},addCommandGroup:function(a,d,b,f,h,c,q,p,e){this._contributionsByScopeId[a]||(this._contributionsByScopeId[a]={});a=this._contributionsByScopeId[a];h&&(a=this._createEntryForPath(a,h));if(a[d]){if(f)a[d].title=f;if(b)a[d].position=b;if(q)a[d].imageClass=q;if(p)a[d].tooltip=p;if(e)a[d].selectionClass=e;a[d].emptyGroupMessage=c}else a[d]={title:f,
position:b,emptyGroupMessage:c,imageClass:q,tooltip:p,selectionClass: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,b,f,h,c,q){this._contributionsByScopeId[a]||
(this._contributionsByScopeId[a]={});a=this._contributionsByScopeId[a];f&&(a=this._createEntryForPath(a,f));a[d]={position:b};c&&((b=this._commandList[d])?this._addBinding(b,"key",c,h):this._addPendingBinding(d,"key",c,h));q&&((b=this._commandList[d])?this._addBinding(b,"url",q,h):this._addPendingBinding(d,"url",q,h));a.sortedContributions=null},_addBinding:function(a,d,b,f){if(!a.id)throw Error("No command id: "+a);d==="key"?this._activeBindings[a.id]={command:a,keyBinding:b,bindingOnly:f}:d==="url"&&
(this._urlBindings[a.id]={command:a,urlBinding:b,bindingOnly:f})},_addPendingBinding:function(a,d,b,f){this._pendingBindings[a]=this._pendingBindings[a]||[];this._pendingBindings[a].push({type:d,binding:b,bindingOnly:f})},_checkForTrailingSeparator:function(a,d,b){var f;if(d==="tool"||d==="button")if((f=a.childNodes.length>0?a.childNodes[a.childNodes.length-1]:null)&&f.classList.contains("commandSeparator"))return b?(a.removeChild(f),!1):!0;if(d==="menu"&&(a=i.$$array("li > *",a),a.length>0&&a[a.length-
1].classList.contains("dropdownSeparator")))if(f=a[a.length-1],b)f.parentNode.parentNode.removeChild(f.parentNode);else return!0;return!1},renderCommands:function(a,d,b,f,h,c,q){if(typeof a!=="string")throw"a scope id for rendering must be specified";d=i.node(d);if(!d)throw"no parent";var p=this._contributionsByScopeId[a];if(!b&&p){var b=p.localSelectionService||this._selectionService,e=this;b&&b.getSelections(function(b){e.renderCommands(a,d,b,f,h,c)})}else p&&(this._render(this._contributionsByScopeId[a],
d,b,f,h||"button",c,q),this._checkForTrailingSeparator(d,h,!0))},destroy:function(a){a=i.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,d,b,h,c,e,q){var p=a.sortedContributions;if(!p){var p=[],l=!1,i;for(i in a)if(Object.prototype.hasOwnProperty.call(a,i)){var n=a[i];if(n&&typeof n.position==="number")n.id=i,p.push(n),l=!0}if(l)p.sort(function(a,
d){return a.position-d.position}),a.sortedContributions=p}var g=0,m=this;p.forEach(function(a){var p,l;if(!a.imageClass)a.imageClass=null;if(a.children&&Object.getOwnPropertyNames(a.children).length>0){p=a.children;var i;if(c==="tool"||c==="button")if(a.title)i=m._createDropdownMenu(d,a.title,null,null,a.imageClass,a.tooltip,a.selectionClass),q&&j.generateNavGrid(q,i.menuButton),window.setTimeout(function(){m._render(a.children,i.menu,b,h,"menu",e,q);m._checkForTrailingSeparator(i.menu,"menu",!0);
if(i.menu.childNodes.length===0)if(a.emptyGroupMessage){if(!i.menuButton.emptyGroupTooltip)i.menuButton.emptyGroupTooltip=new f.Tooltip({node:i.menuButton,text:a.emptyGroupMessage,trigger:"click",position:["below","right","above","left"]})}else q&&j.removeNavGrid(q,i.menuButton),i.menu.parentNode&&i.menu.parentNode.removeChild(i.menu),i.destroyButton&&i.destroyButton.parentNode&&i.destroyButton.parentNode.removeChild(i.destroyButton);else i.menuButton.style.visibility="visible"},0);else{var x;d.childNodes.length>
0&&!m._checkForTrailingSeparator(d,c)&&(x=m.generateSeparatorImage(d));m._render(p,d,b,h,c,e,q);d.childNodes.length>0&&d.childNodes[d.childNodes.length-1]!==x&&(x=m.generateSeparatorImage(d))}else if(a.title){if(x=m._createDropdownMenu(d,a.title,!0,null,null,a.imageClass))m._render(p,x.menu,b,h,"menu",e,q),x.menu.childNodes.length===0&&x.destroyButton&&d.removeChild(x.destroyButton)}else d.childNodes.length>0&&m._generateMenuSeparator(d),m._render(p,d,b,h,c,e,q),m._generateMenuSeparator(d)}else{var n=
m._commandList[a.id];p=n?!0:!1;var D=null,D=null;if(n){l=new k.CommandInvocation(h,b,e,n,m);l.domParent=d;x=p&&(n.visibleWhen?n.visibleWhen(b):!0);if(m._activeBindings[n.id]&&m._activeBindings[n.id].keyBinding)D=m._activeBindings[n.id],D.invocation=x?l:null,D.bindingOnly&&(p=!1);if(m._urlBindings[n.id]&&m._urlBindings[n.id].urlBinding)D=m._urlBindings[n.id],D.invocation=x?l:null,D.bindingOnly&&(p=!1);p=p&&x}if(p)n.choiceCallback?(c==="tool"||c==="button"?(p=d,x=!1,d.nodeName.toLowerCase()==="ul"&&
(p=document.createElement("li"),d.appendChild(p))):(p=d,x=!0),m._createDropdownMenu(p,n.name,x,function(a){n.populateChoicesMenu(a,b,h,e,m)}.bind(n),n.imageClass,n.tooltip||n.title,n.selectionClass)):(l.handler=l.handler||this,l.domParent=d,x=function(){m._invoke(l)},c==="menu"?p=k.createCommandMenuItem(d,n,l,null,x):(p=c+n.id+g,p=k.createCommandItem(d,n,l,p,null,c==="tool",x)),j.generateNavGrid(q,p),l.domNode=p,g++)}})},_createDropdownMenu:function(d,h,c,e,l,n,q){d=i.node(d);if(!d||!i.contains(document.body,
d))return null;var p,x=d;if(c)n=document.createRange(),n.selectNode(d),n=n.createContextualFragment(a),i.processTextNodes(n,{ButtonText:h}),d.appendChild(n),p=d.lastChild,d=p.lastChild,h=d.previousSibling,h.dropdown=new b.Dropdown({dropdown:d,populate:e}),d.dropdown=h.dropdown;else if(d.nodeName.toLowerCase()==="ul"&&(x=document.createElement("li"),d.appendChild(x),p=x),d=null,l&&(d="dropdownButtonWithIcon",n=n||h),n=l?n||h:n,e=k.createDropdownMenu(x,h,e,d,l,!1,q),h=e.menuButton,d=e.menu,n)h.commandTooltip=
new f.Tooltip({node:h,text:n,position:["above","below","right","left"]});return{menuButton:h,menu:d,dropdown:h.dropdown,destroyButton:p}},_generateMenuSeparator:function(a){if(!this._checkForTrailingSeparator(a,"menu")){var d=document.createElement("li");d.classList.add("dropdownSeparator");var b=document.createElement("span");b.classList.add("dropdownSeparator");d.appendChild(b);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;o.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 b=this.parameterTable[a];
if(b)b.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 o(a,this._options,this.getParameters);d.clientCollect=this.clientCollect;return d},hasOptionalParameters:function(){return this._hasOptionalParameters}};o.prototype.constructor=o;return{CommandRegistry:l,URLBinding:n,ParametersDescription:o,
CommandParameter:m}});
define("orion/parameterCollectors",["i18n!orion/nls/messages","require","orion/webui/littlelib"],function(g,k,j){function e(c,e){this._activeContainer=null;this._getElementsFunction=c;this._toolbarLayoutFunction=e}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,e,b){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=b;var f=e(this._activeElements.parameterArea,this._activeElements.dismissArea);if(!f)return!1;this._activeElements.focusNode=f;c=j.$$array("#closebox",this._activeElements.dismissArea||this._activeElements.parameterArea);if(c.length===0){e=this._activeElements.dismissArea||
this._activeElements.parameterArea;c=document.createElement("button");c.id="closebox";c.className="imageSprite core-sprite-close dismissButton";c.title=g.Close;e.appendChild(c);var h=this;c.addEventListener("click",function(){h.close()},!1)}this._activeElements.slideContainer.classList.add("slideContainerActive");this._toolbarLayoutFunction(this._activeElements);if(f)this._oldFocusNode=window.document.activeElement,window.setTimeout(function(){f.focus();f.select&&f.select()},0);this._activeElements.commandNode&&
this._activeElements.commandNode.classList.add("activeCommand");return!0}return!1},_collectAndCall:function(c,e){j.$$array("input",e).forEach(function(b){b.type==="checkbox"?c.parameters.setValue(b.parameterName,b.checked):b.type!=="button"&&c.parameters.setValue(b.parameterName,b.value.trim())});j.$$array("textArea",e).forEach(function(b){c.parameters.setValue(b.parameterName,b.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,e){var b=this;return function(f,h){var d=null,a=function(){e&&e();b.close()},l=function(d){d.keyCode===j.KEY.ENTER&&b._collectAndCall(c,f);if(d.keyCode===j.KEY.ESCAPE||d.keyCode===j.KEY.ENTER)a(),j.stop(d)};c.parameters.forEach(function(b){var h=null;if(b.label)h=document.createElement("label"),h.classList.add("parameterInput"),h.setAttribute("for",b.name+
"parameterCollector"),h.textContent=b.label,f.appendChild(h);var c=b.name+"parameterCollector",e=h||f;if(b.type==="text"&&typeof b.lines==="number"&&b.lines>1)h=document.createElement("textarea"),h.rows=b.lines,h.type="textarea",h.id=c,e.appendChild(h),l=function(d){d.keyCode===j.KEY.ESCAPE&&(a(),j.stop(d))};else if(b.type==="boolean"){if(h=document.createElement("input"),h.type="checkbox",h.id=c,e.appendChild(h),b.value)h.checked=!0}else if(h=document.createElement("input"),h.type=b.type,h.id=c,
e.appendChild(h),b.value)h.value=b.value;h.classList.add("parameterInput");h.setAttribute("speech","speech");h.setAttribute("x-webkit-speech","x-webkit-speech");h.parameterName=b.name;d||(d=h);h.addEventListener("keydown",l,!1)});var n=h;n||(n=document.createElement("span"),n.classList.add("layoutRight"),n.classList.add("parametersDismiss"),f.appendChild(n));var m=function(a,d){var b=document.createElement("button");d.appendChild(b);a&&b.appendChild(document.createTextNode(a));b.classList.add("dismissButton");
return b};if(c.parameters.hasOptionalParameters())c.parameters.optionsRequested=!1,m(g.More,n).addEventListener("click",function(){c.parameters.optionsRequested=!0;b._collectAndCall(c,f);a()},!1);m(g.Submit,n).addEventListener("click",function(){b._collectAndCall(c,f);a()},!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(){a()},!1);return d}}};e.prototype.constructor=e;return{CommandParameterCollector:e}});
define("orion/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(c,b){function f(a,d,b,f){var b=d.filename.indexOf(b)>=0,h;h=f.toLowerCase();h=d.extension.indexOf(h)!==-1;if(b||h){if(!(h=!a))b&&(f=f.toLowerCase(),b=a.extension.indexOf(f)!==-1),h=b;if(h)return d}return a}if(typeof c!=="string")return null;for(var h=c&&c.split(".").pop(),d=null,a=0;a<b.length;a++){var e=b[a];f(d,e,c,h)===e&&(d=e)}return d}function k(i){this.serviceRegistry=i;this.map=function(b){function f(a){return a===null||typeof a==="undefined"?
[]:Array.isArray(a)?a:[a]}function h(a){return f(a).map(function(a){return String.prototype.toLowerCase.call(a)})}for(var b=b.getServiceReferences(e).concat(b.getServiceReferences(c)),d={},a=0;a<b.length;a++)for(var l=f(b[a].getProperty("contentTypes")),i=0;i<l.length;i++){var m=l[i];d[m.id]||(d[m.id]={id:m.id,name:m.name,image:m.image,"extends":m["extends"],extension:h(m.extension),filename:f(m.filename)})}return d}(i);i.registerService(j,this)}var j="orion.core.contentTypeRegistry",e="orion.core.contenttype",
c="orion.file.contenttype";k.prototype={getContentTypes:function(){var c=this.getContentTypesMap(),b=[],f;for(f in c)Object.prototype.hasOwnProperty.call(c,f)&&b.push(c[f]);return b},getContentTypesMap:function(){return this.map},getFileContentType:function(c){return g(c.Name,this.getContentTypes())},getFilenameContentType:function(c){return g(c,this.getContentTypes())},getContentType:function(c){return this.map[c]||null},isExtensionOf:function(c,b){c=typeof c==="string"?this.getContentType(c):c;
b=typeof b==="string"?this.getContentType(b):b;if(!c||!b)return!1;if(c.id===b.id)return!0;else for(var f=c,h={};f&&(f=this.getContentType(f["extends"]));){if(f.id===b.id)return!0;if(h[f.id])throw Error("Cycle: "+f.id);h[f.id]=!0}return!1},isSomeExtensionOf:function(c,b){for(var f=0;f<b.length;f++)if(this.isExtensionOf(c,b[f]))return!0;return!1}};return{ContentTypeRegistry:k,getFilenameContentType:g}});
define("orion/URITemplate",[],function(){function g(a){this._text=a}function k(a){return a.replace("%25","%")}function j(a,b){if(b==="U")return encodeURIComponent(a).replace(/[!'()*]/g,function(a){return"%"+a.charCodeAt(0).toString(16).toUpperCase()});if(b==="U+R")return encodeURI(a).replace(/%5B/g,"[").replace(/%5D/g,"]").replace(d,k);if(b==="U+R-,")return encodeURI(a).replace(/%5B/g,"[").replace(/%5D/g,"]").replace(/,/g,"%2C");throw Error("Unknown allowed character set: "+b);}function e(a,d,b){for(var f=
[],h=0;h<a.length;h++)typeof a[h]!=="undefined"&&f.push(j(a[h],d));return f.join(b)}function c(a,d,b,f){for(var h=Object.keys(a),c=[],e=0;e<h.length;e++)typeof a[h[e]]!=="undefined"&&c.push(j(h[e],d)+b+j(a[h[e]],d));return c.join(f)}function i(a){if(a.length===0)throw Error("Invalid Expression: 0 length expression");(this._operator=f[a[0]])?a=a.substring(1):this._operator=f.NUL;for(var d=[],b=a.split(","),c=0;c<b.length;c++){var e=b[c].match(h);if(e===null)throw Error("Bad VarSpec: "+a);d.push({name:e[1],
explode:!!e[2],prefix:e[3]?parseInt(e[3],10):-1})}this._varSpecList=d}function b(a){for(var d=[],b=0,f=a.indexOf("{",b);f!==-1;){d.push(new g(a.substring(b,f)));b=a.indexOf("}",f+1);if(b===-1)throw Error("Invalid template: "+a);d.push(new i(a.substring(f+1,b)));b+=1;f=a.indexOf("{",b)}d.push(new g(a.substring(b)));this._templateComponents=d}var f={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-,"}},h=/^((?:(?:[a-zA-Z0-9_])|(?:%[0-9A-F][0-9A-F]))(?:(?:[a-zA-Z0-9_.])|(?:%[0-9A-F][0-9A-F]))*)(?:(\*)|:([0-9]+))?$/,d=/%25[0-9A-F][0-9A-F]/g;g.prototype={expand:function(){return encodeURI(this._text)}};
i.prototype={expand:function(a){for(var d=[],b=0;b<this._varSpecList.length;b++){var f=this._varSpecList[b],h=f.name,i=a[h],g=typeof i;if(g!=="undefined"&&i!==null){var k=d.length===0?this._operator.first:this._operator.sep;if(g==="string")this._operator.named&&(k+=j(h,"U+R"),k+=i.length===0?this._operator.ifemp:"="),f.prefix!==-1&&f.prefix<i.length&&(i=i.substring(0,f.prefix)),k+=j(i,this._operator.allow);else if(Array.isArray(i))f.explode?k+=e(i,this._operator.allow,this._operator.sep):(this._operator.named&&
(k+=j(h,"U+R"),k+=i.length===0?this._operator.ifemp:"="),k+=e(i,this._operator.allow,","));else if(g==="object")f.explode?k+=c(i,this._operator.allow,"=",this._operator.sep):(this._operator.named&&(k+=j(h,"U+R"),k+=Object.keys(i).length===0?this._operator.ifemp:"="),k+=c(i,this._operator.allow,",",","));else throw Error("bad param type: "+h+" : "+g);d.push(k)}}return d.join("")}};b.prototype={expand:function(a){for(var d=[],b=0;b<this._templateComponents.length;b++)d.push(this._templateComponents[b].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 i(){g(["i18n!"+c],function(d){if(d){var a=c;d._expires=(new Date).getTime()+9E5;localStorage.setItem("orion/messageBundle/"+a,JSON.stringify(d));delete d._expires}b.resolve(d)})}if(e[c])return e[c];var b=new k;e[c]=
b;var f=j(c);if(f)return b.resolve(f),b;try{g([c],i)}catch(h){g(["orion/i18n!"+c],i)}return b},formatMessage:function(c){var e=arguments;return c.replace(/\$\{([^\}]+)\}/g,function(b,f){return e[(f<<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 i(){return(new URL(g.toUrl("orion/../"),window.location.href)).href.slice(0,-1)}function b(b,h){var d=b.getServiceReferences(h||"orion.page.link"),a=j.matchResourceParameters(window.location.href),l={OrionHome:i(),Location:a.resource},n=[];d.forEach(function(a){var d={};a.getPropertyKeys().forEach(function(b){d[b]=a.getProperty(b)});if(d.uriTemplate&&
d.nls&&(d.name||d.nameKey)){var b=new k;c.getMessageBundle(d.nls).then(function(a){var f=(new e(d.uriTemplate)).expand(l),f=j.validateURLScheme(f);d.href=f;d.textContent=d.nameKey?a[d.nameKey]:d.name;b.resolve(d)});n.push(b)}else if(d.uriTemplate&&d.name){var f=(new e(d.uriTemplate)).expand(l),f=j.validateURLScheme(f);d.href=f;d.textContent=d.name;n.push((new k).resolve(d))}});return k.all(n)}return{createPageLinks:function(f,h){return b(f,h).then(function(d){d.sort(function(a,d){var b=a.textContent&&
a.textContent.toLowerCase(),f=d.textContent&&d.textContent.toLowerCase();return b<f?-1:b>f?1:0});return d.map(function(a){var d=a.href,a=a.textContent,b=document.createElement("a");b.href=d;b.target="_self";b.classList.add("targetSelector");b.textContent=a;return b})})},getPageLinksInfo:b,getOrionHome:i}});
define("orion/extensionCommands","require,orion/Deferred,orion/commands,orion/regex,orion/contentTypes,orion/URITemplate,orion/i18nUtil,orion/URL-shim,orion/PageLinks".split(","),function(g,k,j,e,c,i,b,f,h){var d={},a=h.getOrionHome();d._cloneItemWithoutChildren=function m(a){if(a===null||typeof a!=="object")return a;var d=a.constructor(),b;for(b in a)b!=="children"&&b!=="Children"&&(d[b]=m(a[b]));return d};d._getOpenWithNavCommandExtensions=function(a){function d(a,b){for(var f=a.getServiceReferences("orion.navigate.openWith"),
h=[],c=0;c<f.length;c++){var q=f[c];q.getProperty("editor")===b.id&&(q=q.getProperty("contentType"),q instanceof Array?h=h.concat(q):q!==null&&typeof q!=="undefined"&&h.push(q))}return h}for(var b=function(){for(var d=a.getServiceReferences("orion.edit.editor"),b=[],f=0;f<d.length;f++){var h=d[f],c=h.getProperty("id");b.push({id:c,name:h.getProperty("name"),nameKey:h.getProperty("nameKey"),nls:h.getProperty("nls"),uriTemplate:h.getProperty("orionTemplate")||h.getProperty("uriTemplate"),validationProperties:h.getProperty("validationProperties")||
[]})}return b}(),f=function(a){for(a=a.getServiceReferences("orion.navigate.openWith.default");0<a.length;)return{editor:a[0].getProperty("editor")};return null}(a),h=[],c=0;c<b.length;c++){var e=b[c],l=f&&f.editor===e.id,q=d(a,e);q.length&&h.push({properties:{name:e.name||e.id,nameKey:e.nameKey,id:"eclipse.openWithCommand."+e.id,tooltip:e.name,tooltipKey:e.nameKey,contentType:q,uriTemplate:e.uriTemplate,nls:e.nls,forceSingleItem:!0,isEditor:l?"default":"editor",validationProperties:e.validationProperties},
service:{}})}return h};d._makeValidator=function(d,b,f,h){function e(a,d,b,f){var h=b.match,c;if(d.indexOf("[")===0){if(d.indexOf("]")<0)return!1;if(!Array.isArray(a))return!1;c=d.replace("[","").replace("]","");for(d=0;d<a.length;d++)if(e(a[d],c,b,f))return!0}else if(d.indexOf("|")>=0)return c=d.substring(0,d.indexOf("|")),d=d.substring(d.indexOf("|")+1),e(a,c,b,f)?!0:e(a,d,b,f);else if(d.indexOf(":")>=0)return c=d.substring(0,d.indexOf(":")),d=d.substring(d.indexOf(":")+1),a[c]?e(a[c],d,b,f):!1;
else{a:{c=!1;var l;if(d.charAt(0)==="!")b=typeof a[d.substring(1)]==="undefined";else if(typeof a[d]!=="undefined"){if(typeof h==="undefined")l=a[d],c=!0;else if(typeof h==="string"){if(!typeof(a[d]==="string")){b=!1;break a}if(b.variableName){if(h=RegExp(h).exec(a[d]))c=h[0],l=b.variableMatchPosition==="before"?a[d].substring(0,h.index):b.variableMatchPosition==="after"?a[d].substring(h.index+c.length):b.variableMatchPosition==="only"?c:a[d],c=!0}else{b=RegExp(h).test(a[d]);break a}}else a[d]===
h&&(l=a[d],c=!0);if(c&&b.variableName&&(f[b.variableName]=l,f.itemCached=a,b.replacements))for(a=0;a<b.replacements.length;a++)d=!1,b.replacements[a].pattern?f[b.variableName]=f[b.variableName].replace(RegExp(b.replacements[a].pattern),b.replacements[a].replacement||""):d=!0,d&&window.console.log("Invalid replacements specified in validation property.  "+b.replacements[a]);b=c}else b=!1}return b}}return{info:d,validationFunction:function(a){typeof h==="function"&&(a=h.call(this,a));if(a){if(Array.isArray(a)){if((this.info.forceSingleItem||
this.info.uriTemplate)&&a.length!==1)return!1;if(a.length<1)return!1}else a=[a];for(var b=0;b<a.length;b++){var l;a:{var q=a[b],p=f;if(this.info.validationProperties)for(l=0;l<this.info.validationProperties.length;l++){var i=this.info.validationProperties[l];if(typeof i.source!=="undefined"){if(!e(q,i.source,i,this)){l=!1;break a}}else{window.console.log("Invalid validationProperties in "+d.id+".  No source property specified.");l=!1;break a}}if(this.info.contentType&&p){i=!1;if(q=c.getFilenameContentType(q.Name,
p))for(l=0;l<this.info.contentType.length;l++)if(q.id===this.info.contentType[l]){i=!0;break}l=i}else l=!0}if(!l)return!1}return!0}return!1},generatesURI:function(){return!!this.info.uriTemplate},getURI:function(d){if(this.info.uriTemplate){var b={},f;for(f in d)Object.prototype.hasOwnProperty.call(d,f)&&(b[f]=d[f]);if(this.info.validationProperties)for(f=0;f<this.info.validationProperties.length;f++){var h=this.info.validationProperties[f];h.source&&h.variableName&&(this.itemCached===d&&this[h.variableName]||
e(d,h.source,h,this),d[h.variableName]?window.console.log("Variable name "+h.variableName+" in the extension "+this.info.id+" conflicts with an existing property in the item metadata."):b[h.variableName]=this[h.variableName])}b.OrionHome=a;return(new i(this.info.uriTemplate)).expand(b)}return null}}};d._createCommandOptions=function(a,f,h,c,e,l){function i(b,p){var x=d._makeValidator(a,h,c,l);b.visibleWhen=x.validationFunction.bind(x);if(e)if(x.generatesURI.bind(x)())b.hrefCallback=function(a){a=
Array.isArray(a.items)?a.items[0]:a.items;return x.getURI.bind(x)(a)};else{var g=a;b.callback=function(a){var c;if(g.forceSingleItem)a=Array.isArray(a.items)?a.items[0]:a.items,c=d._cloneItemWithoutChildren(a);else if(Array.isArray(a.items)){c=[];for(var p=0;p<a.items.length;p++)c.push(d._cloneItemWithoutChildren(a.items[p]))}else c=d._cloneItemWithoutChildren(a.items);if(h)var e=h.getService("orion.page.progress");f.run?e?e.progress(f.run(c),"Running command: "+b.name):f.run(c):h&&(e?e.progress(h.getService(f).run(c),
"Running command: "+b.name):h.getService(f).run(c))}}p.resolve(b)}var g=new k;a.nls?b.getMessageBundle(a.nls).then(function(d){i({name:a.nameKey?d[a.nameKey]:a.name,image:a.image,id:a.id||a.name,tooltip:a.tooltipKey?d[a.tooltipKey]:a.tooltip,isEditor:a.isEditor,showGlobally:a.showGlobally},g)}):i({name:a.name,image:a.image,id:a.id||a.name,tooltip:a.tooltip,isEditor:a.isEditor,showGlobally:a.showGlobally},g);return g};d.getOpenWithCommands=function(a){var d=[],b;for(b in a._commandList){var f=a._commandList[b];
f.isEditor&&d.push(f)}return d};var l;d.createAndPlaceFileCommandsExtension=function(a,b,f,h,c,e){var l=!!e;return d.createFileCommands(a,null,e?"all":void 0,l).then(function(a){b._addedOpenWithCommands=l;var d=!1,p=!1;a.forEach(function(a){b.addCommand(a);c&&!d&&(d=!0,b.addCommandGroup(f,"eclipse.fileCommandExtensions",1E3,null,c));c&&!p&&(p=!0,b.addCommandGroup(f,"eclipse.openWith",1E3,"Open With",c+"/eclipse.fileCommandExtensions"));this.isEditor?b.registerCommandContribution(f,a.id,h+this.index,
c?c+"/eclipse.fileCommandExtensions/eclipse.openWith":null):b.registerCommandContribution(f,a.id,h+this.index,c?c+"/eclipse.fileCommandExtensions":null)});return{}})};d.createFileCommands=function(a,b,f,h){var f=f===void 0?"global":f,h=h===void 0?!0:h,c=a.getServiceReferences("orion.navigate.command"),e=[];if(f==="all"||f==="global")for(var i=0;i<c.length;i++)if(c[i].getProperty("id")!=="orion.navigateFromMetadata"){for(var g=a.getService(c[i]),q={},p=c[i].getPropertyKeys(),x=0;x<p.length;x++)q[p[x]]=
c[i].getProperty(p[x]);(f==="all"||q.forceSingleItem&&q.showGlobally)&&e.push({properties:q,service:g})}return k.when(function(){var d=a.getService("orion.core.contentTypeRegistry")||b;return l||k.when(d.getContentTypes(),function(a){return l=a})}(),function(){e=h?e.concat(d._getOpenWithNavCommandExtensions(a,l)):e;var b=e.map(function(b){var f=b.properties;return d._createCommandOptions(f,b.service,a,l,!0).then(function(a){a=new j.Command(a);if(f.isEditor)a.isEditor=f.isEditor;return a})});return k.all(b,
function(a){return{_error:a}}).then(function(a){return a})})};d.createOpenWithCommands=function(a,b,f){return f&&f._addedOpenWithCommands?(new k).resolve(d.getOpenWithCommands(f)):d.createFileCommands(a,b,"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("edit/edit.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("edit/edit.html")+"#"+c.ChildrenLocation},buildSegments:function(e,c){if(this._resource.Parents){var i=this._resource.Parents.slice(0),b,f;i&&(i=i.slice(0),c==="reverse"&&(i=i.reverse().slice(0)),i.forEach(function(h){e?(f=e,e=null):f=h.Name;b=this.buildSegment(f);this.path+=h.Name;this.addSegmentHref(b,
h);b.include=!1;this.segments.push(b)}.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 i=c||document.title;this.crumbs.childNodes.length===0&&(e=document.createElement("span"),e.appendChild(document.createTextNode(i)),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(){var e=document.getElementById("location");e.style.width="auto";this.MAX_LENGTH=e.offsetWidth;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/EventTarget","orion/webui/littlelib"],function(g,k,j){function e(c){k.attach(this);this._init(c)}e.prototype={_init:function(c){this._tracking=null;this._animationDelay=501;this.$node=j.node(c.node);if(!this.$node)throw"no dom node for splitter found";this.$sideNode=j.node(c.sidePanel);if(!this.$sideNode)throw"no dom node for side panel found";this.$mainNode=j.node(c.mainPanel);if(!this.$mainNode)throw"no dom node for main panel found";this._vertical=
c.vertical;this._prefix="/orion/splitter/"+(this.$node.id||document.body.id||"");if(c.toggle)this._thumb=document.createElement("div"),this.$node.appendChild(this._thumb),this._thumb.classList.add("splitThumb"),this._thumb.classList.add(this._vertical?"splitVerticalThumbLayout":"splitThumbLayout");this._closeByDefault=this.$node.getAttribute("data-initial-state")==="closed";if(typeof c.closeByDefault!=="undefined")this._closeByDefault=c.closeByDefault;this._initializeFromStoredSettings();this._closed?
(this._closed=!1,this._thumbDown(!0,!0)):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)},isClosed:function(){return this._closed},toggleSidePanel:function(){this._thumbDown()},openSidePanel:function(){this._closed||
this._thumbDown()},addResizeListener:function(c){this.addEventListener("resize",function(e){c(e.node)})},_initializeFromStoredSettings:function(){var c=localStorage.getItem(this._prefix+"/toggleState");this._closed=typeof c==="string"?c==="closed":this._closeByDefault;if(this._vertical)if(c=localStorage.getItem(this._prefix+"/yPosition"))this._splitTop=parseInt(c,10);else{if(this._closeByDefault)this._initialSplit=this._getSplitPosition(),this._splitTop=0}else if(c=localStorage.getItem(this._prefix+
"/xPosition"))this._splitLeft=parseInt(c,10);else if(this._closeByDefault)this._initialSplit=this._getSplitPosition(),this._splitLeft=0},_getSplitPosition:function(){var c=j.bounds(this.$node),e=j.bounds(this.$node.parentNode);return this.vertical?c.top-e.top:c.left-e.left},_adjustToSplitPosition:function(c){var e=j.bounds(this.$node),b=j.bounds(this.$node.parentNode);if(this._vertical){this._splitHeight=e.height;if(c||!this._splitTop)this._splitTop=e.top,localStorage.setItem(this._prefix+"/yPosition",
this._splitTop);c=this._splitTop;this.$node.parentNode.style.position==="relative"&&(c=this._splitTop-b.top);this.$sideNode.style.height=c+"px";this.$sideNode.style.display="block";this.$node.style.top=c+"px"}else{this._splitWidth=e.width;if(c||!this._splitLeft)this._splitLeft=e.left,localStorage.setItem(this._prefix+"/xPosition",this._splitLeft);c=this._splitLeft;this.$node.parentNode.style.position==="relative"&&(c=this._splitLeft-b.left);this.$sideNode.style.width=c+"px";this.$sideNode.style.display=
"block";this.$node.style.left=c+"px"}this._resize()},_resize:function(c,e,b){var c=c||0,f=j.bounds(this.$node.parentNode),h=j.bounds(this.$node);if(this._vertical){if(b===void 0)b=h.top,this.$node.parentNode.style.position==="relative"&&(b-=f.top);b+=h.height;this.$mainNode.style.top=b+"px"}else{if(e===void 0)e=h.left,this.$node.parentNode.style.position==="relative"&&(e-=f.left);e+=h.width;this.$mainNode.style.left=e+"px"}var d=this;window.setTimeout(function(){d._notifyResizeListeners(d.$mainNode);
d._notifyResizeListeners(d.$sideNode)},c)},_notifyResizeListeners:function(c){this.dispatchEvent({type:"resize",node:c})},_notifyToggleListeners:function(){this.dispatchEvent({type:"toggle",closed:this._closed})},_thumbDown:function(c,e){c||this._addAnimation();var b=this._splitTop,f=this._splitLeft;if(this._closed){if(this._closed=!1,!this._splitLeft&&!this._splitTop&&typeof this._initialSplit==="number")b=f=this._initialSplit}else this._closed=!0,b=f=0;this._vertical?(this.$sideNode.style.height=
b+"px",this.$node.style.top=b+"px"):(this.$sideNode.style.width=f+"px",this.$node.style.left=f+"px");this._resize(this._animationDelay,f,b);c||this._removeAnimation();e||localStorage.setItem(this._prefix+"/toggleState",this._closed?"closed":null);var h=this;window.setTimeout(function(){h._notifyToggleListeners()},this._animationDelay)},_removeAnimation:function(){var c=this;window.setTimeout(function(){c.$sideNode.classList.remove(c._vertical?"sidePanelVerticalLayoutAnimation":"sidePanelLayoutAnimation");
c.$mainNode.classList.remove(c._vertical?"mainPanelVerticalLayoutAnimation":"mainPanelLayoutAnimation");c.$node.classList.remove(c._vertical?"splitVerticalLayoutAnimation":"splitLayoutAnimation")},this._animationDelay)},_addAnimation:function(){this.$sideNode.classList.add(this._vertical?"sidePanelVerticalLayoutAnimation":"sidePanelLayoutAnimation");this.$mainNode.classList.add(this._vertical?"mainPanelVerticalLayoutAnimation":"mainPanelLayoutAnimation");this.$node.classList.add(this._vertical?"splitVerticalLayoutAnimation":
"splitLayoutAnimation")},_mouseDown:function(c){if(c.target===this._thumb)return j.stop(c),this._thumbDown();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),j.stop(c)},_mouseMove:function(c){if(this._tracking){var e=j.bounds(this.$node.parentNode);if(this._vertical){this._splitTop=c.clientY;if(this._splitTop<
e.top+5)this._splitTop=e.top+5;else if(this._splitTop>e.top+e.height-5)this._splitTop=e.top+e.height-5;var b=this._splitTop;this.$node.parentNode.style.position==="relative"&&(b=this._splitTop-e.top);this.$node.style.top=b+"px"}else{this._splitLeft=c.clientX;if(this._splitLeft<e.left+5)this._splitLeft=e.left+5;else if(this._splitLeft>e.left+e.width-5)this._splitLeft=e.left+e.width-5;b=this._splitLeft;this.$node.parentNode.style.position==="relative"&&(b=this._splitLeft-e.left);this.$node.style.left=
b+"px"}this._adjustToSplitPosition(!0);j.stop(c)}},_mouseUp:function(c){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"),j.stop(c)}};e.prototype.constructor=e;return{Splitter: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(e){e.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 i=JSON.parse(c.get("selected")),c=JSON.parse(c.get(e.styleset)),b;if(c)for(var f=0;f<c.length;f++)if(c[f].name===i[e.selectedKey]){b=c[f];break}g({style:b,styles:c})}.bind(this))},setTheme:function(g,j){var e=this._themeData,c=e.getThemeStorageInfo();this._preferences.getPreferences(c.storage,2).then(function(i){this._initialize(c,
e,i);var b=JSON.parse(i.get("selected"));g||(g=b[c.selectedKey]);b[c.selectedKey]=g;i.put("selected",JSON.stringify(b));j?i.put(c.styleset,JSON.stringify(j)):j=JSON.parse(i.get(c.styleset));for(i=0;i<j.length;i++)if(j[i].name===b[c.selectedKey]){e.processSettings(j[i]);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 i=JSON.parse(c.get("selected")),b=JSON.parse(c.get(e.styleset)),
f;if(b)for(var h=0;h<b.length;h++)b[h].fontSize=g,b[h].name===i[e.selectedKey]&&(f=b[h]);c.put(e.styleset,JSON.stringify(b));j.processSettings(f)}.bind(this))}};return{ThemePreferences:g}});
define("orion/settings/nls/root/messages",{"Plugin Description":"Plugin Description",Create:"Create","Loading...":"Loading...","Label:":"Label:",Title:"Title",Plugins:"Plugins","User Profile":"User Profile","Git Settings":"Git Settings",General:"General",Navigation:"Navigation",Links:"Links","Open in same tab":"Open in same tab","Open in new tab":"Open in new tab",Font:"Font",Family:"Family","Sans Serif":"Sans Serif",Serif:"Serif",Size:"Size","8pt":"8pt","9pt":"9pt","10pt":"10pt","12pt":"12pt",Color:"Color",
Background:"Background",Strings:"Strings","String Types":"String Types",blue:"blue",Weight:"Weight",Normal:"Normal",Bold:"Bold",Comments:"Comments","Comment Types":"Comment Types",green:"green",Keywords:"Keywords","Keyword Types":"Keyword Types",darkred:"darkred",Categories:"Categories",Username:"Username","Full Name":"Full Name","Email Address":"Email Address","Email Confirmed":"Email Confirmed",Account:"Account","Current Password":"Current Password","New Password":"New Password","Verify Password":"Verify Password",
Password:"Password",OpenId:"OpenId",AOL:"AOL",Yahoo:"Yahoo",Google:"Google",Unlink:"Unlink",Link:"Link",Unlinked:"Unlinked",Linked:"Linked","Linked Accounts":"Linked Accounts","Git Email Address":"Git Email Address","Git Username":"Git Username","Git Credentials Storage":"Git Credentials Storage",Update:"Update","Update Profile Settings":"Update Profile Settings","Update Git User Settings":"Update Git User Settings","Update Git Credentials":"Update Git Credentials","User profile data successfully updated.":"User profile data successfully updated.",
"Git user data successfully updated.":"Git user data successfully updated.","Git Credentials successfully updated.":"Git Credentials successfully updated.","Edit Plugin JavaScript":"Edit Plugin JavaScript","Install Plugin":"Install Plugin","Plugin Name:":"Plugin Name:","Author Name:":"Author Name:","Licence:":"Licence:","Description:":"Description:","A plugin for Eclipse Orion":"A plugin for Eclipse Orion","Plugin Link":"Plugin Link",Install:"Install","Install a plugin by specifying its URL":"Install a plugin by specifying its URL",
"Plugin URL:":"Plugin URL:",Disable:"Disable",DisableTooltip:"Disable the plugin",Enable:"Enable",EnableTooltip:"Enable the plugin","Reload all":"Reload all","Reload all installed plugins":"Reload all installed plugins","Create a new Orion Plugin":"Create a new Orion Plugin","Find More Orion Plugins":"Find More Orion Plugins","Get Plugins":"Get Plugins",Reload:"Reload","Reload the plugin":"Reload the plugin",Delete:"Delete","Delete this plugin from the configuration":"Delete this plugin from the configuration",
"Type a plugin url here ...":"Type a plugin url here ...","Installed ":"Installed ","Installing ":"Installing ","Already installed":"Already installed"," plugin":" plugin","Reloaded ":"Reloaded ","Uninstalled ":"Uninstalled ","Are you sure you want to uninstall '":"Are you sure you want to uninstall '",Services:"Services",Value:"Value","JavaScript Object":"JavaScript Object","click here, then check javascript console to drill down":"click here, then check javascript console to drill down",Item:"Item",
"Git Config":"Git Config","Clear Git Credentials":"Clear Git Credentials","Enable Storage":"Enable Storage","Please be aware that your credentials will be stored persistently in the browser.":"Please be aware that your credentials will be stored persistently in the browser.","Do you wish to enable the Key Storage?":"Do you wish to enable the Key Storage?",general:"General",validation:"Validation","Deleted git credentials for ${0}":"Deleted git credentials for ${0}",Editor:"Editor",editorSettings:"Settings",
EditorThemes:"Themes",Import:"Import","Import a theme":"Import a theme",fileManagement:"File Management",typing:"Typing",autoSave:"Auto Save",autoSaveTimeout:"Save interval (ms)",autoLoad:"Auto Load",saveDiffs:"Save file as diffs",trimTrailingWhiteSpace:"Trim Trailing Whitespace on Save",Restore:"Restore Defaults",Default:"Default",keys:"Keys",tabs:"Tabs",tabSize:"Tab Size",expandTab:"Insert spaces for tabs",smoothScrolling:"Smooth Scrolling",scrollAnimation:"Scrolling Animation",scrollAnimationTimeout:"Scrolling Duration (ms)",
keyBindings:"Key Bindings",rulers:"Rulers",annotationRuler:"Show Annotation Ruler",lineNumberRuler:"Show Line Number Ruler",foldingRuler:"Show Folding Ruler",overviewRuler:"Show Overview Ruler",whitespaces:"White Spaces",wrapping:"Wrapping",wordWrap:"Word Wrap",showMargin:"Show Margin",marginOffset:"Margin Column",showTabs:"Show Tabs",showSpaces:"Show Spaces",autoSaveTimeoutInvalid:"Invalid save interval.",scrollAnimationTimeoutInvalid:"Invalid scrolling duration.",tabSizeInvalid:"Invalid tab size.",
localSettingsTooltip:"Toggle whether this setting is shown in local editor settings drop down.",autoPairParentheses:"Autopair (Parentheses)",autoPairBraces:"Autopair {Braces}",autoPairSquareBrackets:"Autopair [Square] Brackets",autoPairAngleBrackets:"Autopair <Angle> Brackets",autoPairQuotations:'Autopair "Strings"',autoCompleteComments:"Autocomplete /** Block Comments */",smartIndentation:"Smart Indentation",sourceControl:"Source Control",showBlame:"Show Blame","Editor preferences updated":"Editor preferences updated",
"Editor defaults restored":"Editor defaults restored",Theme:"Theme","Font Size":"Font Size","New Theme Name:":"New Theme Name:","Font Size:":"Font Size:","UI Theme":"UI Theme","Navigation Bar":"Navigation Bar","Navigation Text":"Navigation Text","Search Box":"Search Box","Tool Panel":"Tool Panel","Selection Bar":"Selection Bar",Location:"Location",Content:"Content","Main Panel":"Main Panel",Button:"Button","Button Text":"Button Text","Section Text":"Section Text","Side Panel":"Side Panel","Line Color":"Line Color",
"Line Numbers":"Line Numbers",Foreground:"Foreground","Current Line":"Current Line","HTML Attribute":"HTML Attribute","Overview Ruler":"Overview Ruler","HTML Tag":"HTML Tag","Annotation Ruler":"Annotation Ruler","Show Guide":"Show Guide","Check Guide":"Check Guide",Cancel:"Cancel","Revert Theme":"Revert Theme","Update Theme":"Update Theme","Theme:":"Theme:",clickDiagram:"Click diagram to style.",clickUpdate:"Click Update button to save preview.","CSS Class Name":"CSS Class Name","CSS Attribute":"CSS Attribute",
"CSS Value":"CSS Value","CSS Text":"CSS Text","COLOR:":"Color:","NEW COLOR:":"New Color:",Ok:"Ok","OR HEX:":"Or Hex: "});define("orion/settings/nls/messages",["orion/i18n!orion/settings/nls/messages","orion/settings/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/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 i=0,b=c.length;i<b;i++)if(c[i]){var f=c[i].listener;typeof f==="function"?f.call(this,j):f.handleEvent&&typeof f.handleEvent==="function"&&f.handleEvent(j)}}finally{if(e.level--,e.compact&&e.level===0){for(i=c.length-1;i>=0;i--)c[i]||c.splice(i,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 i=c.listeners,b=0,f=i.length;b<f;b++){var h=i[b];if(h&&h.listener===j&&h.useCapture===e){c.level!==0?(i[b]=null,c.compact=!0):i.splice(b,1);break}}i.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(c){c=c||{};this._document=c.document||document}var c={};e.getTheme=function(i){var i=i||"default",b=c[i];b||(b=c[i]=new e);return b};e.prototype={getThemeClass:function(){return this._themeClass},setThemeClass:function(c,b){var f=this,h=f._themeClass;f._themeClass=c;this._load(c,b,function(){f.onThemeChanged({type:"ThemeChanged",oldValue:h,newValue:f.getThemeClass()})})},onThemeChanged:function(c){return this.dispatchEvent(c)},
buildStyleSheet:function(c,b){function f(d,a,b){a&&(h.push("."+c+" ."+d+" {"),h.push("\t"+(b?"background-color":"color")+": "+a+";"),h.push("}"))}var h=[];h.push("");h.push("."+c+" {");b.fontFamily&&h.push("\tfont-family: "+b.fontFamily+";");b.fontSize&&h.push("\tfont-size: "+b.fontSize+";");b.fontSize&&h.push("\tcolor: "+b.text+";");h.push("}");h.push("."+c+".textview {");b.background&&h.push("\tbackground-color: "+b.background+";");h.push("}");f("ruler.annotations",b.annotationRuler,!0);f("ruler.lines",
b.annotationRuler,!0);f("ruler.folding",b.annotationRuler,!0);f("ruler.overview",b.overviewRuler,!0);f("rulerLines",b.lineNumber,!1);f("rulerLines.even",b.lineNumberEven,!1);f("rulerLines.odd",b.lineNumberOdd,!1);f("annotationLine.currentLine",b.currentLine,!0);f("entity-name-tag",b.keyword,!1);f("entity-other-attribute-name",b.attribute,!1);f("string-quoted",b.string,!1);f("line_caret",b.currentLine,!0);f("token_keyword",b.keyword,!1);f("token_string",b.string,!1);f("token_singleline_comment",b.comment,
!1);f("token_multiline_comment",b.comment,!1);f("token_doc_comment",b.comment,!1);f("token_doc_html_markup",b.comment,!1);return h.join("\n")},_createStyle:function(c,b,f,h){var d=this._document,c="orion-theme-"+c,a=d.getElementById(c);if(a){if(h||a.firstChild.data===b)return;a.removeChild(a.firstChild);a.appendChild(d.createTextNode(b))}else h?(a=j.createElement(d,"link"),a.rel="stylesheet",a.type="text/css",a.href=b,a.addEventListener("load",function(){f()})):(a=j.createElement(d,"style"),a.appendChild(d.createTextNode(b))),
a.id=c,(d.getElementsByTagName("head")[0]||d.documentElement).appendChild(a);h||f()},_load:function(c,b,f){if(c)if(typeof b==="string")this._createStyle(c,b,f);else if(b=b.href,b.substring(b.length-4)!==".css"&&(b+=".css"),/^\//.test(b)||/[a-zA-Z0-9]+:\/\//i.test(b)||!g.toUrl)this._createStyle(c,b,f,!0);else{var h=this;g(["text!"+b],function(d){h._createStyle(c,d,f,!1)})}else f()}};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="16px";c.style.padding="10px";c.style.paddingLeft="6px";c.style.paddingRight="2px";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 i in e)j+=e[i].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 i in e)j+=e[i].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="4px 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 i in e)j+=e[i].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="32px";c.style.borderBottom="1px solid #ebebeb";c.style.paddingTop="3px";e.push(c);for(var i in e)j+=e[i].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",["i18n!orion/settings/nls/messages","orion/editor/textTheme","orion/widgets/themes/container/ThemeSheetWriter"],function(g,k,j){function e(){}function c(){this.styles=[];var b=new e;b.name="Orion";b.navbar="#404648";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 e;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 e;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 e;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 e;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 e;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 e;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 i(){return this.styles}e.prototype.name="Orion";e.prototype.navbar="#404648";e.prototype.button="#EFEFEF";e.prototype.location="#333";e.prototype.breadcrumb=
"#3087B3";e.prototype.separator="#333";e.prototype.selection="FEC";e.prototype.sidepanel="#FBFBFB";e.prototype.mainpanel="white";e.prototype.toolpanel="white";e.prototype.navtext="#bfbfbf";e.prototype.content="#3087B3";e.prototype.search="#444";c.prototype.styles=[];c.prototype.getStyles=i;c.prototype.getThemeStorageInfo=function(){return{storage:"/themes",styleset:"styles",defaultTheme:"Orion",selectedKey:"selected"}};c.prototype.getViewData=function(){var b={top:10,left:10,width:350,height:350};
b.shapes=[{type:"RECTANGLE",name:g["Navigation Bar"],x:10,y:10,width:350,height:32,family:"navbar",fill:"#333",order:1},{type:"TEXT",name:g["Navigation Text"],label:"UserName",x:290,y:30,family:"navtext",fill:"#bfbfbf",font:"8pt sans-serif"},{type:"ROUNDRECTANGLE",name:g["Search Box"],x:215,y:20,width:70,height:12,family:"search",fill:"#444",order:3},{type:"RECTANGLE",name:g["Tool Panel"],x:150,y:71,width:209,height:30,family:"toolpanel",fill:"white",order:4},{type:"RECTANGLE",name:g["Selection Bar"],
x:155,y:133,width:200,height:20,family:"selection",fill:"#FEC",order:7},{type:"RECTANGLE",name:g.Location,x:10,y:42,width:350,height:29,family:"location",fill:"#efefef",order:8},{type:"TEXT",name:g["Navigation Text"],label:"Navigator",x:60,y:30,family:"navtext",fill:"#bfbfbf",font:"8pt sans-serif",order:2},{type:"TEXT",name:g.Content,label:"Breadcrumb",x:15,y:60,family:"content",fill:"#3087B3",font:"8pt sans-serif"},{type:"TEXT",name:g.Content,label:"/",x:78,y:60,family:"content",fill:"#3087B3",font:"8pt sans-serif",
order:9},{type:"TEXT",name:g.Content,label:"Location",x:84,y:60,family:"content",fill:"#3087B3",font:"8pt sans-serif"},{type:"RECTANGLE",name:g["Main Panel"],x:150,y:101,width:209,height:258,family:"mainpanel",fill:"white",order:6},{type:"ROUNDRECTANGLE",name:g.Button,x:155,y:76,width:37,height:20,family:"button",fill:"#EFEFEF",order:11},{type:"TEXT",name:g["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:g["Section Text"],label:"Section",x:30,y:94,family:"navbar",fill:"#333",font:"8pt sans-serif"},{type:"LINE",name:g["Line Color"],x1:150,y1:101,x2:360,y2:101,linewidth:2,fill:"#DEDEDE"},{type:"LINE",name:g["Line Color"],x1:150,y1:71,x2:150,y2:360,linewidth:2,fill:"#DEDEDE"},{type:"LINE",name:g["Line Color"],x1:20,y1:100,x2:140,
y2:100,linewidth:2,fill:"#DEDEDE"},{type:"RECTANGLE",name:g["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:g["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"}];for(var f=0;f<3;f++)b.shapes.push({type:"TEXT",name:g.Content,label:"org.eclipse.orion.content",x:170,y:127+20*f,fill:"#3087B3",family:"content"});for(f=0;f<3;f++)b.shapes.push({type:"TEXT",name:g.Content,label:"Item",x:25,y:115+20*f,fill:"#3087B3",family:"content"});for(f=0;f<3;f++)b.shapes.push({type:"TRIANGLE",
name:"twisty",x1:160,y1:121+f*20,x2:165,y2:124+f*20,x3:160,y3:127+f*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};c.prototype.processSettings=function(b){var f=new j.ThemeSheetWriter;(new k.TextTheme.getTheme("orionTheme")).setThemeClass("orionTheme",f.getSheet(b))};return{ThemeData:c,getStyles:i}});
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","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}'.","Main Pages":"Main Pages","Related Links":"Related Links"});
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/userAssistance/UATaskPanel",["orion/webui/littlelib"],function(g){function k(j,e,c){this.elements=c;this.taskPanel=document.createElement("div");this.taskPanel.className="UAContainer";this.taskPanel.innerHTML='<header class="UAHeader">Develop software from within the cloud</header>';this.elementNode=document.createElement("div");this.switchesContainer=document.createElement("div");this.switches=document.createElement("span");this.radioButtons=[];this.elementNode.className="UAContainer-body";
this.taskPanel.appendChild(this.elementNode);this.switchesContainer.className="UAContainer-switch-body";this.switches.className="UAContainer-switches";this.switchesContainer.innerHTML="";this.switchesContainer.appendChild(this.switches);this.taskPanel.appendChild(this.switchesContainer);e===!0?(this.container=document.createElement("div"),this.container.className="UAModal",this.container.appendChild(this.taskPanel),this.backdrop=document.createElement("div"),this.backdrop.className="UAModalBackground",
document.body.appendChild(this.backdrop),document.body.appendChild(this.container),g.addAutoDismiss([this.container],this.destroy.bind(this))):j.appendChild(this.taskPanel);this.chosenSwitch=this.createSwitch(null,!0);this.chosenSwitch.firstChild.className="chosenCircle";this.initialize();this.elements.forEach(this.createSwitch.bind(this))}k.prototype.elementNode=null;k.prototype.switchesContainer=null;k.prototype.switches=null;k.prototype.radioButtons=null;k.prototype.chosenSwitch=null;k.prototype.addElement=
function(g){var e=document.createElement("span");e.className="UAContainer-icon";e.innerHTML='<span class="workingSpan"><img src="'+g.image+'" id="'+g.label+'ImageNode" alt="'+g.alt+'" height="64" width="64"></span><span class="UAIcon-label"><span class="UALabel" id="'+g.label+'LabelNode" >'+g.label+"</span></span>";e.onmouseover=function(){document.getElementById(g.label+"ImageNode").src=g.secondaryImage;document.getElementById(g.label+"LabelNode").className="UALabel-live";e.className="UAContainer-icon-live"};
e.onmouseout=function(){document.getElementById(g.label+"ImageNode").src=g.image;document.getElementById(g.label+"LabelNode").className="UALabel";e.className="UAContainer-icon"};var c=this;e.onclick=function(){c.showMedia(g)};this.elementNode.appendChild(e)};k.prototype.clearElements=function(){this.elementNode.innerHTML=""};k.prototype.showMedia=function(g){this.clearElements();this.addElement(g);var e=document.createElement("span");e.className="UAContainer-media";e.innerHTML='<div></div><div></div><span class="mediaSpan"><img src="'+
g.media+'" alt="'+g.alt+'" height="300" width="400"></span>';this.elementNode.appendChild(e);setTimeout(function(){e.style.opacity=1},100);g=document.getElementById(g.label+"switch");this.chosenSwitch.firstChild.className="circle";this.chosenSwitch=g.parentNode;g.className="chosenCircle"};k.prototype.createSwitch=function(g){var e;e=g?g.label+"switch":"indexSwitch";var c=document.createElement("span");c.className="workingSpan";c.innerHTML='<div class="circle" id ="'+e+'"></div>';var i=this;c.onclick=
g?function(){i.showMedia(g)}:function(){i.initialize();i.chosenSwitch.firstChild.className="circle";i.chosenSwitch=c;i.chosenSwitch.firstChild.className="chosenCircle"};this.switches.appendChild(c);return this.radioButtons[this.radioButtons.length]=c};k.prototype.initialize=function(){this.clearElements();this.elements.forEach(this.addElement.bind(this))};k.prototype.destroy=function(){document.body.removeChild(this.backdrop);document.body.removeChild(this.container)};return k});
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 c=document.body;this.$frameParent=c;this.$$modalExclusions=this.$$modalExclusions||[];var b=document.createRange();b.selectNode(c);b=b.createContextualFragment(this.CONTAINERTEMPLATE);c.appendChild(b);this.$frame=c.lastChild;this.title&&j.$("#title",this.$frame).appendChild(document.createTextNode(this.title));this.$close=j.$("#closeDialog",this.$frame);var f=this;this.$close.addEventListener("click",function(){f.hide()},!1);this.$parent=j.$(".dialogContent",this.$frame);
b=document.createRange();b.selectNode(this.$parent);c=b.createContextualFragment(this.TEMPLATE);this.messages&&j.processTextNodes(c,this.messages);this.$parent.appendChild(c);this.$buttonContainer=j.$(".dialogButtons",this.$frame);this._makeButtons();this.$frame.addEventListener("keydown",function(b){b.keyCode===j.KEY.ESCAPE?f.hide():b.keyCode===j.KEY.ENTER&&typeof f._defaultCallback==="function"&&f._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 c=this;this.buttons.forEach(function(b){var f=e.createButton(b.text,b.callback);if(b.id)f.id=b.id,c["$"+f.id]=f;if(b.isDefault)c._defaultCallback=b.callback,c._defaultButton=f;c.$buttonContainer.appendChild(f)})}},_makeModal:function(){var c=this;this.$frame.addEventListener("blur",function(a){c.$lastFocusedElement=a.target},!0);this._modalListener=function(a){var d=!j.contains(c.$frame,
a.target);if(d)for(var b=0;b<c.$$modalExclusions.length;b++)if(j.contains(c.$$modalExclusions[b],a.target)){d=!1;break}d&&(window.setTimeout(function(){(c.$lastFocusedElement||c.$parent).focus()},0),j.stop(a))};this.$frameParent.addEventListener("focus",this._modalListener,!0);this.$frameParent.addEventListener("click",this._modalListener,!0);var b=this.$frameParent.childNodes,f=!1;this._addedBackdrop=[];for(var h=0;h<b.length;h++){for(var d=0;d<this.$$modalExclusions.length;d++)if(j.contains(this.$$modalExclusions[d],
b[h])){f=!0;break}!f&&b[h]!==c.$frame&&b[h].classList&&!b[h].classList.contains("tooltipContainer")&&(d=b[h],d.classList.contains("modalBackdrop")||(d.classList.add("modalBackdrop"),this._addedBackdrop.push(d)))}(b=j.lastTabbable(this.$buttonContainer)||j.lastTabbable(this.$parent))&&b.addEventListener("keydown",function(a){if(a.keyCode===j.KEY.TAB){var d=c._getFirstFocusField();d&&d!==a.target&&d.focus();j.stop(a)}},!1)},_addChildDialog:function(c){this.$$modalExclusions.push(c.$frame||c.$parent)},
_bindElements:function(c){for(var b=0;b<c.childNodes.length;b++){var f=c.childNodes[b];f.id&&(this["$"+f.id]=f);this._bindElements(f)}},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 c=this;this.keepAlive||
window.setTimeout(function(){c.destroy()},0)},show:function(c){typeof this._beforeShowing==="function"&&this._beforeShowing();var b=j.bounds(this.$frame),f=j.bounds(document.documentElement),h;c?(h=j.bounds(c),c=h.top+h.height+4,h=h.left+4,c+b.height>f.height&&(c=Math.max(0,f.height-b.height-4)),h+b.width>f.width&&(h=Math.max(0,f.width-b.width-4))):(h=Math.max(0,(f.width-b.width)/2),c=Math.max(0,(f.height-b.height)/2));this.$lastFocusedElement=document.activeElement;this.$frame.style.top=c+"px";this.$frame.style.left=
h+"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(c){c.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/widgets/UserMenu","i18n!orion/widgets/nls/messages,require,orion/webui/littlelib,orion/PageLinks,orion/widgets/userAssistance/UATaskPanel,orion/webui/dialog".split(","),function(g,k,j,e,c){function i(b){this._displaySignOut=!0;this._init(b)}i.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 f=0,h;for(h in b)b.hasOwnProperty(h)&&f++;return f},_makeMenuItem:function(b,
f){var h=document.createElement("span");h.role="menuitem";h.tabIndex=0;var d=document.createTextNode(b);h.appendChild(d);typeof this._dropDownItemClass==="string"?this._dropDownItemClass!==""&&h.classList.add(this._dropDownItemClass):h.classList.add("dropdownMenuItem");h.addEventListener("click",f,!1);h.addEventListener("keydown",function(a){(a.keyCode===j.KEY.ENTER||a.keyCode===j.KEY.SPACE)&&f()},!1);return h},_renderAuthenticatedService:function(b){var f=this,h=this.authenticatedServices[b].authService;
if(h&&h.logout&&this._displaySignOut){var d=document.createElement("li"),a=this._makeMenuItem(g["Sign Out"],function(){h.logout().then(function(){f.addUserItem(b,h,f.authenticatedServices[b].label);localStorage.removeItem(b);localStorage.removeItem("lastLogin");for(var a=localStorage.length-1;a>=0;a--){var d=localStorage.key(a);d&&d.indexOf("/orion/preferences/user")===0&&localStorage.removeItem(d)}h.getAuthForm(window.location.href).then(function(a){window.location=a})})});d.appendChild(a);this._dropdownNode.appendChild(d)}},
renderServices:function(){function b(a){h[a]||(h[a]=f.createDocumentFragment());return h[a]}var f=document,h=[],d=this._serviceRegistry;e.getPageLinksInfo(d,"orion.page.link.user").then(function(a){this._dropdown?this._dropdown.empty():this._dropdownNode&&j.empty(this._dropdownNode);a.forEach(function(a){var d=b(typeof a.category==="number"?a.category:1),h=f.createElement("li"),c=f.createElement("a");c.role="menuitem";typeof this._dropDownItemClass==="string"?this._dropDownItemClass!==""&&c.classList.add(this._dropDownItemClass):
c.classList.add("dropdownMenuItem");c.href=a.href;c.textContent=a.textContent;h.appendChild(c);d.appendChild(h);c.addEventListener("keydown",function(a){(a.keyCode===j.KEY.ENTER||a.keyCode===j.KEY.SPACE)&&c.click()},!1)}.bind(this));if(this.keyAssistFunction){var a=document.createElement("li"),c=this._makeMenuItem(g["Keyboard Shortcuts"],this.keyAssistFunction);typeof this._keyAssistClass==="string"?this._keyAssistClass!==""&&c.classList.add(this._keyAssistClass):c.classList.add("key-assist-menuitem");
a.appendChild(c);b(0).appendChild(a)}if(a=d.getServiceReferences("orion.page.getstarted")[0])c=a.getProperty("data"),a=document.createElement("li"),c=this._makeMenuItem("Getting Started",this.getStartedDialog.bind(this,c)),a.appendChild(c),b(0).appendChild(a);var e=this;h.sort(function(a,d){return a-d}).forEach(function(a,d){if(d<h.length-1&&!this._noSeparator){var b=document.createElement("li");b.classList.add("dropdownSeparator");var f=document.createElement("span");f.classList.add("dropdownSeparator");
b.appendChild(f);a.appendChild(b)}e._dropdownNode.appendChild(a)}.bind(this));if(this.isSingleService())for(var i in this.authenticatedServices)this.authenticatedServices.hasOwnProperty(i)&&this._renderAuthenticatedService(i,0)}.bind(this))},getStartedDialog:function(b){new c(null,!0,b)},setKeyAssist:function(b){this.keyAssistFunction=b;this.renderServices()},addUserItem:function(b,f,h,d){d?(this.unauthenticatedServices[b]&&delete this.unauthenticatedServices[b],this.authenticatedServices[b]={authService:f,
label:h,data:d}):(this.authenticatedServices[b]&&delete this.authenticatedServices[b],this.unauthenticatedServices[b]=this.unauthenticatedServices[b]?{authService:f,label:h,pending:this.unauthenticatedServices[b].pending}:{authService:f,label:h});this.renderServices()}};i.prototype.constructor=i;return{UserMenu:i}});
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?","Search cancelled by user":"Search cancelled by user",
Cancel:"Cancel"});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/regex,orion/commandRegistry,orion/PageUtil,orion/URITemplate".split(","),function(g,k,j,e,c,i){function b(b,d,a){var f="";a&&(f="^");if(f=j.parse("/"+f+b.searchStr+"/"))a=f.pattern,f=f.flags,f.indexOf("i")===-1&&!d.caseSensitive&&(f+="i"),b.regExp={pattern:a,flags:f},b.wildCard=!0}var f={ALL_FILE_TYPE:"*.*"};f.doSearch=function(b,d,a,c){if(b){var e=!0;a==="*"&&(a="");a===""&&(e=c&&c.type!==f.ALL_FILE_TYPE);if(e){a!==""&&f.addRecentSearch(d,
a,c?c.regEx:!1);var b=b.createSearchParams(a,!1,!1,c),i=f.generateSearchHref(b);f.getOpenSearchPref(d,function(a){a?window.open(i):window.location=i})}}else window.alert(g["Can't search: no search service is available"])};f.generateSearchHelper=function(h,d){var a=h.keyword,c=a,e={};h.fileType&&h.fileType!==f.ALL_FILE_TYPE&&a===""&&(c="*."+h.fileType);if(h.regEx)e.searchStr=a,b(e,h,d);else{var i=a.indexOf("*")>-1,g=a.indexOf("?")>-1;i&&(a=a.split("*").join(".*"));g&&(a=a.split("?").join("."));!i&&
!g&&!h.nameSearch?(e.searchStr=h.caseSensitive?a.split("\\").join(""):a.split("\\").join("").toLowerCase(),e.wildCard=!1):(e.searchStr=h.caseSensitive?a:a.toLowerCase(),b(e,h,d),e.wildCard=!0)}e.searchStrLength=e.searchStr.length;return{params:h,inFileQuery:e,displayedSearchTerm:c}};f.convertSearchParams=function(b){if(b.rows!==void 0)b.rows=parseInt(b.rows,10);if(b.start!==void 0)b.start=parseInt(b.start,10);if(typeof b.regEx==="string")b.regEx=b.regEx.toLowerCase()==="true";if(typeof b.caseSensitive===
"string")b.caseSensitive=b.caseSensitive.toLowerCase()==="true";if(typeof b.nameSearch==="string")b.nameSearch=b.nameSearch.toLowerCase()==="true"};f.copySearchParams=function(b,d){var a={},f;for(f in b)if(b[f]!==void 0&&b[f]!==null&&(d||f!=="replace"))a[f]=b[f];return a};f.generateSearchHref=function(b){var d=k.toUrl("search/search.html"),b=f.copySearchParams(b,!0),a=b.resource;b.resource=void 0;return typeof b.keyword!=="undefined"?(new i(d+"#{,resource,params*}")).expand({resource:a,params:b}):
(new i(d+"#{,resource}")).expand({resource:a})};f.generateFindURLBinding=function(b,d,a,f,c){b={find:d.searchStr,regEx:d.wildCard?!0:void 0,caseSensitive:b.caseSensitive?!0:void 0,replaceWith:typeof f==="string"?f:void 0,atLine:typeof a==="number"?a:void 0};return c?b:","+(new i("{,params*}")).expand({params:b})};f.convertFindURLBinding=function(b){if(typeof b.regEx==="string")b.regEx=b.regEx.toLowerCase()==="true";if(typeof b.caseSensitive==="string")b.caseSensitive=b.caseSensitive.toLowerCase()===
"true";if(typeof b.atLine==="string")b.atLine=parseInt(b.atLine,10)};f.replaceRegEx=function(b,d,a){return b.replace(RegExp(d.pattern,d.flags),a)};f.replaceStringLiteral=function(b,d,a){d=j.parse("/"+d+"/gim");return f.replaceRegEx(b,d,a)};f.searchOnelineLiteral=function(b,d,a){var f;f=0;for(var c=!1,e=[];;)if(f=d.indexOf(b.searchStr,f),f<0)break;else{e.push({startIndex:f,length:b.searchStrLength});c=!0;if(a)break;f+=b.searchStrLength}return c?e:null};f.findRegExp=function(b,d,a,f){if(!d)return null;
a=a||"";a+=(a.indexOf("g")===-1?"g":"")+(a.indexOf("m")===-1?"m":"");var c=null;return(c=RegExp(d,a).exec(b.substring(f)))&&{startIndex:c.index+f,length:c[0].length}};f.searchOnelineRegEx=function(b,d,a){for(var c=0,e=!1,i=[];;)if(c=f.findRegExp(d,b.regExp.pattern,b.regExp.flags,c)){i.push(c);e=!0;if(a)break;c=c.startIndex+c.length}else break;return e?i:null};f.generateNewContents=function(b,d,a,c,e,i){if(c&&d){if(!b)a.contents=[];for(var g=0;g<d.length;g++){for(var j=d[g],k=!1,r=!1,u=[],w,v=0,q=
0;q<c.children.length;q++)if(c.children[q].lineNumber-1===g){v=q;for(k=0;k<c.children[q].matches.length;k++)c.children[q+k].checked!==!1&&u.push(k);r=u.length>0;w=c.children[q].matches;k=!0;break}if(k){if(r){u=f.replaceCheckedMatches(j,e,w,u,i);j=u.replacedStr;for(k=0;k<c.children[v].matches.length;k++)c.children[v+k].newMatches=u.newMatches}else for(k=0;k<c.children[v].matches.length;k++)c.children[v+k].newMatches=c.children[v+k].matches;b?a.contents[g]=j:a.contents.push(j)}else b||a.contents.push(j)}}};
f.generateMatchContext=function(b,d,a){var f=[],c=b*2+1,e;d.length<=c?(e=0,b=d.length-1):(e=a-b,e<0?(e=0,b=e+c-1):(b=a+b,b>d.length-1&&(b=d.length-1,e=b-c+1)));for(c=e;c<=b;c++)f.push({context:d[c],current:c===a});return f};f.splitFile=function(b){for(var d=0,a=0,f=0,c=0,e=[];;){d!==-1&&d<=f&&(d=b.indexOf("\r",f));a!==-1&&a<=f&&(a=b.indexOf("\n",f));if(a===-1&&d===-1){e.push(b.substring(c));break}var i=1;d!==-1&&a!==-1?d+1===a?(i=2,f=a+1):f=(d<a?d:a)+1:f=d!==-1?d+1:a+1;e.push(b.substring(c,f-i));
c=f}return e};f.searchWithinFile=function(b,d,a,c,e,i){a=f.splitFile(a);if(e)d.contents=a;if(d){d.children=[];for(var g=c=0;g<a.length;g++){var j=a[g];if(j&&j.length>0){var k=i?j:j.toLowerCase();if(k=b.wildCard?f.searchOnelineRegEx(b,k):f.searchOnelineLiteral(b,k)){var r,u=g+1;if(e)for(var w=0;w<k.length;w++)r=w+1,r={parent:d,checked:d.checked,type:"detail",matches:k,lineNumber:u,matchNumber:r,name:j,location:d.location+"-"+u+"-"+r},d.children.push(r);else r={parent:d,context:f.generateMatchContext(2,
a,g),checked:d.checked,type:"detail",matches:k,lineNumber:u,name:j,location:d.location+"-"+u},d.children.push(r);c+=k.length}}}d.totalMatches=c}};f.replaceCheckedMatches=function(b,d,a,f,c){for(var e=0,i="",g=[],j=0;j<a.length;j++){e!==a[j].startIndex&&(i+=b.substring(e,a[j].startIndex));if(a[j].length)c=a[j].length;for(var e=!1,k=0;k<f.length;k++)if(f[k]===j){e=!0;break}e?(g.push({startIndex:i.length,length:d.length}),i+=d):(g.push({startIndex:i.length,length:c}),i+=b.substring(a[j].startIndex,a[j].startIndex+
c));e=a[j].startIndex+c}e<b.length&&(i+=b.substring(e));return{replacedStr:i,newMatches:g}};f.fullPathNameByMeta=function(b){var d=b.length,a="";if(d>0)for(d-=1;d>-1;d--)a=a+(a===""?"":"/")+b[d].Name;return a};f.path2FolderName=function(b,d,a){return b.substring(0,b.length-d.length-(a?0:1))};f._storeRecentSearch=function(b,d,a){b.getService("orion.core.preference").getPreferences("/window/favorites").then(function(b){b.put("recentSearch",d);a&&window.setTimeout(function(){a.dispatchEvent({type:"recentSearchesChanged"})}.bind(this),
20)})};f.addRecentSearch=function(b,d,a){typeof d==="string"&&d&&b.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:a});f._storeRecentSearch(b,c)})};f.removeRecentSearch=function(b,d,a){typeof d==="string"&&d&&b.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);f._storeRecentSearch(b,c,a);break}})};f.getSearches=function(b,d,a){b.getService("orion.core.preference").getPreferences("/window/favorites").then(function(b){b=b.get(d);typeof b==="string"&&(b=JSON.parse(b));b&&a&&a(b)})};f.getMixedSearches=function(b,d,a,c){b.getService("orion.core.preference").getPreferences("/window/favorites").then(function(b){var h=b.get("recentSearch");typeof h===
"string"&&(h=JSON.parse(h));d&&(b=b.get("search"),typeof b==="string"&&(b=JSON.parse(b)),b&&b.forEach(function(d){if(a){var b=f.parseQueryStr(d.query);h.some(function(a){return b.searchStrTitle===a.name})||h.push({name:b.searchStrTitle,label:d.name})}else h.push({name:null,label:d.name,value:d.query})}));h&&c&&c(h)})};f.getOpenSearchPref=function(b,d){b.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)})};f.setOpenSearchPref=function(b,d){b.getService("orion.core.preference").getPreferences("/window/favorites").then(function(a){a.put("openSearchPref",{openInNewTab:d})})};return f});
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,i){function b(b,c,d,a){this.registry=b;this.fileClient=c;this.fileLocations=[];this.fileSkeleton=[];this._totalCounter=this._hitCounter=0;this._searchOnName=a&&a.searchOnName;this._buildSkeletonOnly=a&&a.buildSkeletonOnly;this._fetchChildrenCallBack=a&&a.fetchChildrenCallBack;this._searchParams=d;this.searchHelper=this._searchOnName||
this._buildSkeletonOnly?null:e.generateSearchHelper(d);this._location=a&&a.location;this._childrenLocation=a&&a.childrenLocation?a.childrenLocation:this._location;this._cancelled=!1;this.registry.getService("orion.page.message").setCancelFunction(function(){this._cancelFileContentsSearch()}.bind(this))}b.prototype.search=function(b){var c=this.registry.getService("orion.core.contentTypeRegistry");this._onSearchComplete=b;this._cancelled=!1;this._deferredArray=[];c.getContentTypes().then(function(d){this.contentTypesCache=
d;this._visitRecursively(this._childrenLocation).then(function(){this._sort(this.fileLocations);this._onSearchComplete({response:{numFound:this.fileLocations.length,docs:this.fileLocations}})}.bind(this))}.bind(this))};b.prototype.searchName=function(b,c){if(b)this.searchHelper=e.generateSearchHelper(b,!0);if(c)this.onSearchNameComplete=c;var d=[];this._cancelled=!1;this._deferredArray=[];this._sort(this.fileSkeleton);if(this.fileSkeleton.length>0){for(var a=0;a<this.fileSkeleton.length;a++){var l=
this.fileSkeleton[a].Name.toLowerCase();if(this.searchHelper.inFileQuery.wildCard?e.searchOnelineRegEx(this.searchHelper.inFileQuery,l,!0):e.searchOnelineLiteral(this.searchHelper.inFileQuery,l,!0))if(d.push(this.fileSkeleton[a]),d.length>=this.searchHelper.params.rows)break}this.onSearchNameComplete({response:{numFound:d.length,docs:d}})}};b.prototype.buildSkeleton=function(b,c){this._buildingSkeleton=!0;var d=this.registry.getService("orion.core.contentTypeRegistry");this._cancelled=!1;this._deferredArray=
[];var a=this;b();d.getContentTypes().then(function(d){a.contentTypesCache=d;a._visitRecursively(a._childrenLocation).then(function(){a._buildingSkeleton=!1;c();a.searchHelper&&!a._buildSkeletonOnly&&a.searchName()})})};b.prototype._searchCompleted=function(){console.log("Search Completed.")};b.prototype._searchFiles=function(){var b=[];if(this.fileLocations.length>0)for(var c=0;c<this.fileLocations.length;c++)b.push(this._sniffSearch(this.fileLocations[c]));return i.all(b)};b.prototype._sort=function(b){b.sort(function(b,
d){var a=b.Name&&b.Name.toLowerCase(),f=d.Name&&d.Name.toLowerCase();return a<f?-1:a>f?1:0})};b.prototype._onFileType=function(b){return this.searchHelper.params.fileType?this.searchHelper.params.fileType===e.ALL_FILE_TYPE?!0:b.extension.indexOf(this.searchHelper.params.fileType)>=0:!0};b.prototype._visitRecursively=function(b){var h=[],d=this;this._fetchChildrenCallBack&&this._fetchChildrenCallBack(b);var a=d.registry.getService("orion.page.progress");return(a?a.progress(d.fileClient.fetchChildren(b),
"Crawling search for children of "+b):d.fileClient.fetchChildren(b)).then(function(a){for(var b=0;b<a.length;b++)if(a[b].Directory!==void 0&&a[b].Directory===!1)if(d._searchOnName)h.push(d._buildSingleSkeleton(a[b]));else if(d._buildSkeletonOnly)h.push(d._buildSingleSkeleton(a[b]));else{if(!d._cancelled){var f=c.getFilenameContentType(a[b].Name,d.contentTypesCache);if(f&&(f["extends"]==="text/plain"||f.id==="text/plain")&&d._onFileType(f))f=d._sniffSearch(a[b]),h.push(f),d._deferredArray.push(f)}}else if(a[b].Location)if(d._cancelled)break;
else f=d._visitRecursively(a[b].ChildrenLocation),h.push(f),d._deferredArray.push(f);return i.all(h)})};b.prototype._hitOnceWithinFile=function(b){b=this._searchParams.caseSensitive?b:b.toLowerCase();return this.searchHelper.inFileQuery.wildCard?e.searchOnelineRegEx(this.searchHelper.inFileQuery,b,!0):e.searchOnelineLiteral(this.searchHelper.inFileQuery,b,!0)};b.prototype._reportSingleHit=function(b){b.LastModified=b.LocalTimeStamp;this.fileLocations.push(b);this._hitCounter++;this._sort(this.fileLocations);
this._onSearchComplete({response:{numFound:this.fileLocations.length,docs:this.fileLocations}},!0)};b.prototype._cancelFileContentsSearch=function(){(this._cancelled=!0)&&this._deferredArray.forEach(function(b){b.cancel()});this._sort(this.fileLocations);this._onSearchComplete({response:{numFound:this.fileLocations.length,docs:this.fileLocations}});console.log("Crawling search cancelled. Deferred array length : "+this._deferredArray.length);this.registry.getService("orion.page.message").setProgressResult({Message:g["Search cancelled by user"],
Severity:"Warning"})};b.prototype._sniffSearch=function(b){this._totalCounter++;var c=this;if(!this._cancelled)if(this.searchHelper.params.keyword==="")this._reportSingleHit(b),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(c.fileClient.read(b.Location),"Reading file "+b.Location).then(function(d){c._hitOnceWithinFile(d)&&
c._reportSingleHit(b);c.registry.getService("orion.page.message").setProgressResult({Message:j.formatMessage(g["${0} files found out of ${1}"],c._hitCounter,c._totalCounter)},g.Cancel)},function(b){b&&b.message&&b.message.toLowerCase()!=="cancel"&&console.error("Error loading file content: "+b.message)})};b.prototype._buildSingleSkeleton=function(b){this._totalCounter++;this.fileSkeleton.push(b);this.searchHelper&&!this._buildSkeletonOnly&&this._totalCounter%100===0&&this.searchName();b=new i;b.resolve(this._totalCounter);
return b};b.prototype.constructor=b;return{SearchCrawler:b}});
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,i,b){function f(b){this._init(b)}f.prototype=new b.Dialog;f.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="results" style="max-height:400px; height:auto; overflow-y:auto;" aria-live="off"></div><div id="statusbar"></div></div>';f.prototype._init=function(b){this.title=b.title||g["Find File Named"];this.modal=!0;this.messages=g;this._searcher=b.searcher;this._progress=b.progress;this._onHide=b.onHide;this._contentTypeService=new j.ContentTypeRegistry(this._searcher.registry);if(!this._searcher)throw Error("Missing required argument: searcher");
this._searchDelay=b.searchDelay||500;this._time=0;this._searcher.setCrawler(null);this._forceUseCrawler=!1;this._initialText=b.initialText;this._message=b.message;this._nameSearch=!0;if(b.nameSearch!==void 0)this._nameSearch=b.nameSearch;this._searchOnRoot=!0;this._fileService=this._searcher.getFileService();if(!this._fileService)throw Error(g["Missing required argument: fileService"]);this._searchRenderer=b.searchRenderer;if(!this._searchRenderer||typeof this._searchRenderer.makeRenderFunction!==
"function")throw Error(g["Missing required argument: searchRenderer"]);this._initialize()};f.prototype._bindToDom=function(b){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 b=c.$("a",d.$results);
b&&(c.stop(a),window.open(b.href),d.hide())}},!1);b.addEventListener("keydown",function(a){var b,f,h;if(a.keyCode===c.KEY.DOWN||a.keyCode===c.KEY.UP)b=c.$$array("a",d.$results),f=document.activeElement,h=b.indexOf(f),a.keyCode===c.KEY.DOWN?h>=0?(f.classList.remove("treeIterationCursor"),b=h<b.length-1?b[h+1]:b[0],b.focus(),b.classList.add("treeIterationCursor")):b.length>0&&(b=-1<b.length-1?b[0]:b[0],b.focus(),b.classList.add("treeIterationCursor")):h>=0?(f.classList.remove("treeIterationCursor"),
f=d.$fileName,b=h>0?b[h-1]:f,b.focus(),h>0&&b.classList.add("treeIterationCursor")):b.length>0&&(b[b.length-1].focus(),b[b.length-1].classList.add("treeIterationCursor")),c.stop(a)});b.addEventListener("mouseup",function(a){a.target.focus()},!1);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()};f.prototype.checkSearch=function(){clearTimeout(this._timeoutId);var b=(new Date).getTime();b-this._time>this._searchDelay?(this._time=b,this.doSearch()):this._timeoutId=setTimeout(this.checkSearch.bind(this),50)};f.prototype.doSearch=function(){var b=this.$fileName.value;if(b){var d=this._searcher.createSearchParams(b,this._nameSearch,this._searchOnRoot),a=this._searchRenderer.makeRenderFunction(this._contentTypeService,this.$results,!1,this.decorateResult.bind(this));
this.currentSearch=a;var f=document.createElement("div");f.appendChild(document.createTextNode(this._nameSearch?g["Searching..."]:i.formatMessage(g["Searching for occurrences of"],b)));c.empty(this.$results);this.$results.appendChild(f);this._searcher.search(d,!1,function(){a===this.currentSearch&&a.apply(null,arguments)}.bind(this))}};f.prototype.decorateResult=function(b){for(var d=this,b=c.$$array("a",b),a=0;a<b.length;a++){var f=b[a];f.addEventListener("mouseup",function(a){a.button===0&&!a.ctrlKey&&
!a.metaKey&&d.hide()},!1);f.addEventListener("keyup",function(a){a.keyCode===c.KEY.ENTER&&d.hide()},!1)}};f.prototype._beforeHiding=function(){clearTimeout(this._timeoutId)};f.prototype._afterHiding=function(){this._onHide&&this._onHide()};f.prototype.constructor=f;return{OpenResourceDialog:f}});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<button class="centralNavigation commandSprite core-sprite-hamburger" type="button"id="centralNavigation"></button>\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=4.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;"></div>\n<div class="layoutRight commandList pageActions" id="settingsActions"></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/widgets/input/DropDownMenu",["orion/objects","orion/webui/littlelib"],function(g,k){function j(e,c,i){if(e=k.node(e))this._parent=e;else throw Error("Parent node of dropdown menu not found");this.options=i=i||{};this.navDropDownId=this._parent.id+"_navdropdown";this.selectionClass=i.selectionClass;e=document.createElement("div");e.classList.add("dropDownContainer");e.id=this.navDropDownId;e.style.display="none";this._parent.appendChild(e);this._dropdownMenu=e;if(c=k.node(c))this._triggerNode=
c;else throw"Trigger node of dropdown menu not found";if(this._triggerNode.style.visibility==="hidden")this._triggerNode.style.visibility="visible";if(!i.noClick)this._triggerNode.onclick=this.click.bind(this);this._dropdownMenu.addEventListener("keydown",function(b){b.keyCode===k.KEY.ESCAPE&&this.clearPanel()}.bind(this))}g.mixin(j.prototype,{click:function(){this._dropdownMenu.style.display==="none"?this.updateContent(this.getContentNode(),function(){this._dropdownMenu.style.display="";this._positionDropdown();
this.selectionClass&&this._triggerNode.classList.add(this.selectionClass);this.handle=k.addAutoDismiss([this._triggerNode,this._dropdownMenu],this.clearPanel.bind(this));if(this.options.onShow)this.options.onShow()}.bind(this)):this.clearPanel()},clearPanel:function(){if(this.isVisible()&&(this._dropdownMenu.style.display="none",this.selectionClass&&this._triggerNode.classList.remove(this.selectionClass),this.options.onHide))this.options.onHide()},addContent:function(e){this._dropdownMenu.innerHTML=
e},getContentNode:function(){return this._dropdownMenu},updateContent:function(e,c){c()},_positionDropdown:function(){this._dropdownMenu.style.left="";var e=k.bounds(this._dropdownMenu),c=k.bounds(this._boundingNode(this._parent));if(e.left+e.width>c.left+c.width)this._dropdownMenu.style.right=0},_boundingNode:function(e){return e.style.right!==""||e.style.position==="absolute"||!e.parentNode||!e.parentNode.style?e:this._boundingNode(e.parentNode)},isDestroyed:function(){return!this._dropdownMenu.parentNode},
isVisible:function(){return this._dropdownMenu.style.display!=="none"&&!this.isDestroyed()},focus:function(){this._dropdownMenu.focus()},destroy:function(){if(this._parent)k.empty(this._parent),this._parent=this.select=null}});return j});
define("orion/widgets/input/GroupedContent",["i18n!orion/widgets/nls/messages","orion/objects","orion/webui/littlelib"],function(g,k){function j(){}k.mixin(j.prototype,{templateString:'<div style="float:left;"><section><span style="color:#333;padding:15px;">'+g["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;">'+g["Related Links"]+'</span><nav><ul id="relatedLinks"></ul></nav></section></div>',
getContentPane:function(){return this.templateString}});return j});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","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}'?","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","Go Into":"Go Into","Move into the selected folder":"Move into the selected 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","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(b,f,c){if(!b[f])throw f+g[" is not supported in this file system"];return b[f].apply(b,c)}function c(b,f,h,d){if(!b.readBlob)throw g["source file service does not support binary read"];if(!h.writeBlob)throw g["target file service does not support binary write"];if(f[f.length-1]!=="/")return e(b,"readBlob",[f]).then(function(a){return e(h,"writeBlob",[d,a])});var a=d.substring(0,
d.length-1),l=decodeURIComponent(a.substring(a.lastIndexOf("/")+1)),a=a.substring(0,a.lastIndexOf("/")+1);return e(h,"createFolder",[a,l]).then(function(){},function(){}).then(function(){return e(b,"fetchChildren",[f]).then(function(a){for(var f=[],e=0;e<a.length;++e){var l=a[e].Location,i=l;a[e].Directory&&(i=l.substring(0,l.length-1));i=decodeURIComponent(i.substring(i.lastIndexOf("/")+1));i=d+encodeURIComponent(i);a[e].Directory&&(i+="/");f[e]=c(b,l,h,i)}return k.all(f)})})}function i(b,f){function c(a){var b=
new k;b.reject(g["No Matching FileService for location:"]+a);return b}var d=b.getServiceReferences("orion.core.file"),a=d;if(f)for(var a=[],e=0;e<d.length;++e)f(d[e])&&a.push(d[e]);for(var i=[],m=[],o=[],t=[],s={fetchChildren:function(){var a=new k;a.resolve(t);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:t,ChildrenLocation:"/"})},100);return a},search:c,createProject:c,createFolder:c,createFile:c,deleteFile:c,moveFile:c,copyFile:c,read:c,write:c},d=0;d<a.length;++d)t[d]={Directory:!0,Length:0,LocalTimeStamp:0,Location:a[d].getProperty("top"),ChildrenLocation:a[d].getProperty("top"),Name:a[d].getProperty("Name")},e=a[d].getProperty("pattern")||".*",e[0]!=="^"&&(e="^"+e),i[d]=RegExp(e),m[d]=b.getService(a[d]),o[d]=a[d].getProperty("Name"),
a[d].getProperty("NameKey")&&a[d].getProperty("nls")&&j.getMessageBundle(a[d].getProperty("nls")).then(function(b,d){t[b].Name=d[a[b].getProperty("NameKey")];o[b]=d[a[b].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 b=0;b<i.length;++b)if(i[b].test(a))return b;throw g["No Matching FileService for location:"]+a;};this._getService=function(a){a=this._getServiceIndex(a);return a===-1?s:m[a]};this._getServiceName=
function(a){a=this._getServiceIndex(a);return a===-1?s.Name:o[a]};this._getServiceRootURL=function(a){a=this._getServiceIndex(a);return a===-1?s.Location:t[a].Location}}i.prototype={getService:function(b){return this._getService(b)},fileServiceName:function(b){return this._getServiceName(b)},fileServiceRootURL:function(b){return this._getServiceRootURL(b)},fetchChildren:function(b){return e(this._getService(b),"fetchChildren",arguments)},createWorkspace:function(b){return e(this._getService(),"createWorkspace",
arguments)},loadWorkspaces:function(){return e(this._getService(),"loadWorkspaces",arguments)},loadWorkspace:function(b){return e(this._getService(b),"loadWorkspace",arguments)},createProject:function(b,f,c,d){return e(this._getService(b),"createProject",arguments)},createFolder:function(b,f){return e(this._getService(b),"createFolder",arguments)},createFile:function(b,f){return e(this._getService(b),"createFile",arguments)},deleteFile:function(b){return e(this._getService(b),"deleteFile",arguments)},
moveFile:function(b,f,h){var d=this._getService(b),a=this._getService(f);if(d===a)return e(d,"moveFile",arguments);var i=b[b.length-1]==="/",n=f;n[n.length-1]!=="/"&&(n+="/");if(h)n+=encodeURIComponent(h);else{var g=b;i&&(g=g.substring(0,g.length-1));n+=g.substring(g.lastIndexOf("/")+1)}i&&n[n.length-1]!=="/"&&(n+="/");return c(d,b,a,n).then(function(){return e(d,"deleteFile",[b])})},copyFile:function(b,f,h){var d=this._getService(b),a=this._getService(f);if(d===a)return e(d,"copyFile",arguments);
var i=b[b.length-1]==="/",n=f;n[n.length-1]!=="/"&&(n+="/");if(h)n+=encodeURIComponent(h);else{var g=b;i&&(g=g.substring(0,g.length-1));n+=g.substring(g.lastIndexOf("/")+1)}i&&n[n.length-1]!=="/"&&(n+="/");return c(d,b,a,n)},read:function(b,f){return e(this._getService(b),"read",arguments)},write:function(b,f,c){return e(this._getService(b),"write",arguments)},remoteImport:function(b,f){return e(this._getService(b),"remoteImport",arguments)},remoteExport:function(b,f){return e(this._getService(b),
"remoteExport",arguments)},search:function(b){return e(this._getService(b.resource),"search",arguments)}};i.prototype.constructor=i;return{FileClient:i}});
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/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,i,b,f,h,d,a,l,n,m,o,t,s,r,u,w,v,q,p,x,D,A,F,G,y,z,B,J){function I(a,b){if(a.getLabel)return a.getLabel();else{var d=new v;d.resolve(b.properties.name);return d}}function K(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 V(a,b){var d=a.getServiceReferences("orion.core.auth");E=[];for(var f=C.createMenuGenerator.apply(this,arguments),c=0;c<d.length;c++){var h=
d[c],e=a.getService(h);I(e,h).then(function(a){e.getKey().then(function(b){E.push(b);e.getUser().then(function(d){f.addUserItem(b,e,a,d)},function(d,c){f.addUserItem(b,e,a,c)});window.addEventListener("storage",function(){H[b]!==localStorage.getItem(b)&&(H[b]=localStorage.getItem(b),e.getUser().then(function(d){f.addUserItem(b,e,a,d)},function(){f.addUserItem(b,e,a)}))},!1)})})}}function T(a){return a}function R(a,b,d,c,h){function e(a){if(a)if(!a.visibleWhen||a.visibleWhen(b)){var d=new i.CommandInvocation(b,
b,null,a,c);return(new v).resolve([a,d])}else if(typeof h==="function")return l||(l=h()),v.when(l,function(d){if(d&&b===L&&(!a.visibleWhen||a.visibleWhen(d)))return d=new i.CommandInvocation(d,d,null,a,c),[a,d]});return(new v).resolve()}var p=arguments,q,l,x=a&&a.getServiceReferences("orion.page.link.related");x&&x.length!==0&&v.when(function(){if(q)return q;var b=a.getService("orion.core.contentTypeRegistry");b||(b=new t.ContentTypeRegistry(a),b=a.getService("orion.core.contentTypeRegistry"));return b.getContentTypes().then(function(a){return q=
a})}(),function(){if(C.beforeGenerateRelatedLinks.apply(this,p)){for(var b=[],h=0;h<x.length;h++){var l={},n,g=x[h].getPropertyKeys();for(n=0;n<g.length;n++)l[g[n]]=x[h].getProperty(g[n]);if(l.id&&(n=n=null,d.indexOf(l.id)<0))if((l.nls&&l.nameKey||l.name)&&l.uriTemplate)n=f._createCommandOptions(l,x[h],a,q,!0),b.push(n);else if(n=c.findCommand(l.id))b.push((new v).resolve(n));else{var j=a.getServiceReferences("orion.navigate.command");for(n=0;n<j.length;n++)if(j[n].getProperty("id")===l.id){for(var l=
{},g=j[n].getPropertyKeys(),m=0;m<g.length;m++)l[g[m]]=j[n].getProperty(g[m]);n=f._createCommandOptions(l,j[n],a,q,!0);b.push(n);break}}}v.all(b,T).then(function(a){a=a.map(function(a){return a instanceof i.Command?a:new i.Command(a)}).sort(function(a,b){return a.name.localeCompare(b.name)});return v.all(a.map(e),T).then(function(a){a.forEach(function(a){a&&C.addRelatedLinkCommand(a[0],a[1])});C.afterGenerateRelatedLinks.apply(this,p)})})}})}function S(a){var b=l.node("globalActions");b&&(a.destroy(b),
a.renderCommands(b.id,b,{},{},"tool"))}function O(a){var b=window.getComputedStyle(a,null);return b===null?a:b.getPropertyValue("position")==="absolute"||!a.parentNode||a===document.body?a:O(a.parentNode)}function U(a){var b={},d=null;typeof a==="string"&&(a=l.node(a));a||(a=l.node("pageActions"));for(var f=a;f&&f.classList;){if(f.classList.contains("toolComposite")){d=f;break}f=f.parentNode}if(a.classList.contains("commandMarker"))b.commandNode=a;if(d&&(b.slideContainer=l.$(".slideParameters",d),
b.parameterArea=l.$(".parameters",d),b.dismissArea=l.$(".parametersDismiss",d),b.notifications=l.$("#notificationArea",d),d.parentNode&&(b.toolbarTarget=l.$(".toolbarTarget",d.parentNode),b.toolbarTarget)))a=l.bounds(b.toolbarTarget),f=l.bounds(O(b.toolbarTarget.parentNode)),b.toolbarTargetY=a.top-f.top,b.toolbar=d;return b}function N(a){if(a.toolbarTarget&&a.toolbarTargetY){var b=0,d;a.notifications&&a.notifications.classList.contains("slideContainerActive")&&(d=l.bounds(a.notifications),b+=d.height);
a.slideContainer&&a.slideContainer.classList.contains("slideContainerActive")&&(d=l.bounds(a.slideContainer),b+=d.height);b>0&&(b+=8);b?(a.toolbarTarget.style.top=a.toolbarTargetY+b+"px",a.toolbar.style.paddingBottom=b+"px"):a.toolbarTarget.style.top=a.toolbar.style.paddingBottom=""}}var c=function(a){var b=document.createElement("a");b.href=a;return b.href}(k.toUrl("auth/NotifyAuthentication.html")),H={},C={createMenuGenerator:B.createMenuGenerator||function(a,b){if(l.node("userMenu")){var d=l.node("userDropdown"),
f=new m.Dropdown({dropdown:d}),d=new q.UserMenu({dropdownNode:d,dropdown:f,serviceRegistry:a}),f=l.node("userTrigger");new o.Tooltip({node:f,text:g.Options,position:["below","left"]});var f=document.getElementById("userTrigger"),c=f.className;c+=" imageSprite core-sprite-silhouette";f.className=c;d.setKeyAssist(b);return d}},beforeGenerateRelatedLinks:B.beforeGenerateRelatedLinks||function(){var a=l.node("relatedLinks");l.empty(a);return!0},addRelatedLinkCommand:B.addRelatedLinkCommand||function(a,
b){var d=l.node("relatedLinks");i.createCommandMenuItem(d,a,b).classList.remove("dropdownMenuItem")},afterGenerateRelatedLinks:B.afterGenerateRelatedLinks||function(){},afterSetPageTarget:B.afterSetPageTarget||function(){},generateNavigationMenu:B.generateNavigationMenu||function(){var a=document.getElementById("centralNavigation");new o.Tooltip({node:a,text:"Navigation Menu",position:["right"]});var a=new G("primaryNav","centralNavigation"),b=new y;a.addContent(b.getContentPane())},afterGenerateBanner:B.afterGenerateBanner||
function(){}},E=[],L,Q=[],M,P=null;return{generateBanner:function(a,d,f,c,q,m,o,t){function s(){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",b=l.$$array(".targetSelector"),d=0;d<b.length;d++)b[d].target=a}},{pid:"nav.config"})}(new u.ThemePreferences(c,new w.ThemeData)).apply();var y=l.node(a);if(!y)throw g["could not find banner parent, id was "]+
a;var B=document.createRange();B.selectNode(y);B=B.createContextualFragment(D);l.processTextNodes(B,g);y.firstChild?y.insertBefore(B,y.firstChild):y.appendChild(B);y=l.node("home");y.href=k.toUrl("edit/edit.html");y.setAttribute("aria-label",g["Orion Home"]);l.node("progressPane").src=k.toUrl("images/none.png");if(y=l.node("pageToolbar"))y.classList.add("toolbarLayout"),y.innerHTML=F+j.slideoutHTMLFragment("mainToolbar");(y=l.node("closeNotifications"))&&y.setAttribute("aria-label",g["Close notification"]);
if(z.isFirefox<=17&&(y=l.node("staticBanner")))y.style.width="100%",y.style.MozBoxSizing="border-box";if(y=l.node("footer"))y.innerHTML=A,l.processTextNodes(y,g);f.setParameterCollector(new b.CommandParameterCollector(U,N));document.addEventListener("keydown",function(a){a.keyCode===l.KEY.ESCAPE&&(a=d.getService("orion.page.message"))&&a.setProgressMessage("")},!1);C.generateNavigationMenu.apply(this,arguments);var I=l.node("navigationlinks");I&&p.createPageLinks(d,"orion.page.link").then(function(a){a.forEach(function(a){var b=
document.createElement("li");b.appendChild(a);I.appendChild(b)})});if(y=l.$(".split")){var B=l.$(".sidePanelLayout"),r=l.$(".mainPanelLayout");if(B&&r)P={side:B,main:r},P.splitter=new n.Splitter({node:y,sidePanel:B,mainPanel:r,toggle:!0,closeByDefault:t}),y=new i.Command({name:g["Toggle side panel"],tooltip:g["Open or close the side panel"],id:"orion.toggleSidePane",callback:function(){P.splitter.toggleSidePanel()}}),f.addCommand(y),f.registerCommandContribution("pageActions","orion.toggleSidePane",
1,null,!0,new e.KeyBinding("o",!0)),o&&P.splitter.addResizeListener(function(a){o&&a===r&&o.resize()})}var v=!1,J=function(a,b,d){if(!v){var b=b.getService("orion.page.progress"),f=new x.OpenResourceDialog({searcher:a,progress:b,searchRenderer:a.defaultRenderer,onHide:function(){v=!1;d&&d.focus()}});window.setTimeout(function(){v=!0;f.show()},0)}},y=new i.Command({name:g["Find File Named..."],tooltip:g["Choose a file by name and open an editor on it"],id:"eclipse.openResource",callback:function(){J(q,
d,o)}});f.addCommand(y);f.registerCommandContribution("globalActions","eclipse.openResource",100,null,!0,new e.KeyBinding("f",!0,!0));y=new i.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"),b=l.node("footer"),d=l.$(".content-fixedHeight");a.style.visibility==="hidden"?(a.style.visibility="visible",b.style.visibility="visible",d.classList.remove("content-fixedHeight-maximized")):(a.style.visibility=
"hidden",b.style.visibility="hidden",d.classList.add("content-fixedHeight-maximized"));o&&o.resize();return!0}});f.addCommand(y);f.registerCommandContribution("globalActions","orion.toggleTrim",100,null,!0,new e.KeyBinding("m",!0,!0));y=new i.Command({name:g["System Configuration Details"],tooltip:g["System Config Tooltip"],id:"orion.configDetailsPage",hrefCallback:function(){return k.toUrl("help/about.html")}});f.addCommand(y);f.registerCommandContribution("globalActions","orion.configDetailsPage",
100,null,!0,new e.KeyBinding(112,!0,!0));y=new i.Command({name:g["Background Operations"],tooltip:g["Background Operations Tooltip"],id:"orion.backgroundOperations",hrefCallback:function(){return k.toUrl("operations/list.html")}});f.addCommand(y);f.registerCommandContribution("globalActions","orion.backgroundOperations",100,null,!0,new e.KeyBinding("o",!0,!0));s.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 b=this._keyAssistInput=document.createElement("input");b.classList.add("keyAssistInput");b.type="text";b.placeholder=g["Filter bindings"];a.appendChild(b);var d=this._keyAssistContents=document.createElement("div");d.classList.add("keyAssistContents");if(z.isIOS||z.isAndroid)d.style.overflowY="auto";a.appendChild(d);var f=this._keyAssistTable=document.createElement("table");f.tabIndex=0;f.classList.add("keyAssistList");d.appendChild(f);document.body.appendChild(a);
b.addEventListener("keydown",function(a){this._keyDown(a)}.bind(this));f.addEventListener("keydown",function(a){this._keyDown(a)}.bind(this));b.addEventListener("input",function(){this.filterChanged()}.bind(this));d.addEventListener(z.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(o&&o.getTextView&&o.getTextView()){var a=o.getTextView(),b=a.getActions(!0).filter(function(b){return(b=a.getActionDescription(b))&&b.name});b.sort(function(b,d){return a.getActionDescription(b).name.localeCompare(a.getActionDescription(d).name)});this.createHeader(g.Editor);for(var d=function(b){return function(){a.focus();return a.invokeAction(b)}},c={},e,p=0;p<b.length;p++)for(var q=b[p],i=a.getActionDescription(q),
x=a.getKeyBindings(q),n=0;n<x.length;n++){e=x[n];var j=h.getUserKeyString(e);e.scopeName?(c[e.scopeName]||(c[e.scopeName]=[]),c[e.scopeName].push({bindingString:j,name:i.name,execute:d(q)})):this.createItem(j,i.name,d(q))}for(var m in c)if(c[m].length){this.createHeader(m);for(b=0;b<c[m].length;b++)e=c[m][b],this.createItem(e.bindingString,e.name,e.execute)}}this.createHeader(g.Global);f.showKeyBindings(this)},createItem:function(a,b,d){if(this._filterString){var f=this._filterString.toLowerCase(),
c;f!==this._filterString?(f=this._filterString,c=function(a){return a}):c=function(a){return a.toLowerCase()};if(c(b).indexOf(f)===-1&&c(a).indexOf(f)===-1&&c(this._lastHeader).indexOf(f)===-1)return}var h=this._keyAssistTable.insertRow(-1);h.id="keyAssist-keyBinding-"+this._idCount++;h.setAttribute("role","menuitem");h._execute=d;h.classList.add("keyAssistItem");h.addEventListener("click",function(a){this._selectedRow=h;this.execute();a.preventDefault()}.bind(this));d=h.insertCell(-1);d.classList.add("keyAssistName");
d.appendChild(document.createTextNode(b));d=h.insertCell(-1);d.classList.add("keyAssistAccel");d.appendChild(document.createTextNode(a))},createHeader:function(a){this._lastHeader=a;var b=this._keyAssistTable.insertRow(-1);b.classList.add("keyAssistSection");var b=b.insertCell(-1),d=document.createElement("h2");d.appendChild(document.createTextNode(a));b.appendChild(d)},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(){if(this.isVisible()){var a=document.activeElement,b=this._keyAssistDiv,a=b===a||(b.compareDocumentPosition(a)&16)!==0;b.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 b=this._keyAssistTable.querySelectorAll(".keyAssistItem");if(b.length===0)this._selectedIndex=-1;else{var d=this._selectedIndex;d+=a?1:-1;d%=b.length;d<0&&(d=b.length-1);if(this._selectedIndex!==-1)a=b[this._selectedIndex],a.classList.remove("selected"),this._selectedRow=null;this._selectedIndex=d;if(this._selectedIndex!==-1){this._selectedRow=a=b[this._selectedIndex];
a.classList.add("selected");this._keyAssistTable.setAttribute("aria-activedescendant",a.id);this._keyAssistTable.focus();var b=a.getBoundingClientRect(),f=this._keyAssistContents,c=f.getBoundingClientRect();a.offsetTop<f.scrollTop?d===0?f.scrollTop=0:a.scrollIntoView(!0):b.bottom>c.bottom&&a.scrollIntoView(!1)}}},show:function(){if(!this.isVisible())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 b=0,b=z.isIE||z.isOpera?-a.wheelDelta:z.isFirefox?a.detail*40:-a.wheelDeltaY,d=this._keyAssistContents,f=d.scrollTop;d.scrollTop+=b;if(f!==d.scrollTop)return a.preventDefault&&
a.preventDefault(),!1}};var O=new s,H=new i.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}});f.addCommand(H);f.registerCommandContribution("globalActions","eclipse.keyAssist",100,null,!0,new e.KeyBinding(191,!1,!0));y=function(){o.getTextView().setKeyBinding(new e.KeyBinding(191,!1,!0,!z.isMac,z.isMac),H.id);o.getTextView().setAction(H.id,H.callback,H)};o&&o.getTextView&&
(o.getTextView()?y():o.addEventListener("TextViewInstalled",y));S(f);V(d,H.callback);K(d);window.addEventListener("hashchange",function(){f.processURL(window.location.href)},!1);window.setTimeout(function(){G(d)},0);C.afterGenerateBanner.apply(this,arguments)},getToolbarElements:U,getMainSplitter:function(){return P},layoutToolbarElements:N,setPageTarget:function(b){var d,f,c=b.breadcrumbRootName,h=b.serviceRegistry;b.target?(b.searchService&&b.searchService.setLocationByMetaData(b.target),b.fileService&&
!b.breadcrumbTarget&&(f=c?c+" ":"",f+=b.fileService.fileServiceName(b.target.Location),c=null),d=b.name||b.target.Name,L=b.target,R(h,b.target,Q,b.commandService,b.makeAlternate)):(b.breadcrumbTarget||(c=c||b.task||b.name),d=b.name,R(h,{NoTarget:""},Q,b.commandService,b.makeAlternate));(M=b.title)||(M=d?d+" - "+b.task:b.task);window.document.title=M;C.afterSetPageTarget.apply(this,arguments);if(d=l.node("location")){l.empty(d);var e=h&&new J.FileClient(h),h=b.breadcrumbTarget||b.target,e=e&&h&&h.Location?
e.fileServiceRootURL(h.Location):null;new a.BreadCrumbs({container:d,resource:h,rootSegmentName:c,workspaceRootSegmentName:f,workspaceRootURL:e,makeHref:b.makeBreadcrumbLink})}},setDirtyIndicator:function(a){if(M)M.charAt(0)==="*"&&!a&&(M=M.substring(1)),a&&M.charAt(0)!=="*"&&(M="*"+M),window.document.title=M;var b=l.node("dirty");if(b)b.textContent=a?"*":""},setPageCommandExclusions:function(a){Q=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=[],i=0;e;){if(e.length===3&&e[2].length>0){var b=new URL(e[2]);b.protocol!==":"&&g.validateURLScheme(b.href)&&(e.index>i&&c.push({segmentStr:k.substring(i,e.index)}),c.push({segmentStr:e[1].length>0?e[1]:e[2],urlStr:e[2]}),i=e.index+e[0].length)}e=j.exec(k)}if(i===0)return null;i<k.length-1&&c.push({segmentStr:k.substring(i)});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",["i18n!orion/nls/messages","orion/webui/littlelib","orion/globalCommands","orion/urlUtils"],function(g,k,j,e){function c(b,f,c,d,a){this._serviceRegistry=b;this._serviceRegistration=b.registerService("orion.page.message",this);this._operationsClient=f;this.notificationContainerDomId=a;this.domId=c;this.progressDomId=d||c;this._hookedClose=!1;this._timer=null;this._clickToDisMiss=!0;this._cancelMsg=null}var i;c.prototype={_init:function(){var b=k.node("closeNotifications");if(b&&
!this._hookedClose){b.style.cursor="pointer";this._hookedClose=!0;var f=k.node(this.notificationContainerDomId);k.addAutoDismiss([f],function(){this._clickToDisMiss&&this.close()}.bind(this));b.addEventListener("click",function(){this.close()}.bind(this));f.addEventListener("click",function(b){b&&b.target&&b.target.nodeName.toLowerCase()==="a"&&(b=k.$$("a",f))&&b.length&&b.length===1&&this.close()}.bind(this))}},close:function(){window.clearTimeout(this._timer);this.setProgressMessage("");var b=k.node("closeNotifications");
if(this._cancelMsg&&this._cancelFunc&&b)b.innerHTML="",b.classList.remove("cancelButton"),b.classList.add("dismissButton"),b.classList.add("core-sprite-close"),b.classList.add("imageSprite"),this._cancelFunc(),this._cancelMsg=null},_getNotifierElements:function(){if(!this._notifierElements)this._notifierElements=j.getToolbarElements(this.notificationContainerDomId);return this._notifierElements},setMessage:function(b,f,c){this._init();this.currentMessage=b;var d=k.node(this.domId);if(typeof c==="boolean"){var a=
d.getAttribute("aria-live");d.setAttribute("aria-live",c?"polite":"off");window.setTimeout(function(){b===this.currentMessage&&(k.empty(d),d.appendChild(document.createTextNode(b)),window.setTimeout(function(){d.setAttribute("aria-live",a)},100))}.bind(this),100)}else k.empty(d),d.appendChild(document.createTextNode(b));typeof f==="number"&&window.setTimeout(function(){b===this.currentMessage&&(k.empty(d),d.appendChild(document.createTextNode("")))}.bind(this),f)},setErrorMessage:function(b){this._clickToDisMiss=
!0;this.currentMessage=b;this._init();var f=b.responseText||b.message||b;if(typeof f==="string")try{f=JSON.parse(f)}catch(c){}var b=f.Message||f,d="red";if(f.Severity)switch(f.Severity){case "Warning":d="#FFCC00";break;case "Error":d="red";break;case "Info":case "Ok":d="green"}f=document.createElement("span");f.style.color=d;f.appendChild(document.createTextNode(b));b=k.node(this.domId);k.empty(b);b.appendChild(f)},setProgressMessage:function(b){this._clickToDisMiss=!1;this._init();this.currentMessage=
b;var f=document.createElement("span");f.classList.add("imageSprite");f.classList.add("progressIcon");f.classList.add("core-sprite-progress");var c=k.node(this.progressDomId);k.empty(c);c.appendChild(f);c.appendChild(document.createTextNode(b));f=k.node(this.notificationContainerDomId);f.classList.remove("notificationHide");if(b&&b.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")},setCancelFunction:function(b){this._cancelFunc=b},setProgressResult:function(b,f){this._clickToDisMiss=!1;this._cancelMsg=f;this.currentMessage=b;var c=b.responseText||b;if(typeof c==="string")try{c=JSON.parse(c)}catch(d){}this._init();var a=c.Message||c.toString(),i=g.UnknownError,n="core-sprite-information",j="progressNormal",o=document.createElement("span");o.classList.add("imageSprite");o.classList.add("progressIcon");
var t=[];if(c.Severity)switch(c.Severity){case "Warning":i=g.UnknownWarning;n="core-sprite-warning";j="progressWarning";t.push("progressInfo");t.push("progressError");t.push("progressNormal");this._clickToDisMiss=!0;break;case "Error":n="core-sprite-error";j="progressError";t.push("progressWarning");t.push("progressInfo");t.push("progressNormal");this._clickToDisMiss=!0;break;default:j="progressNormal",t.push("progressWarning"),t.push("progressError"),t.push("progressNormal")}t.push("notificationHide");
o.classList.add(n);var s=k.node(this.progressDomId),n=k.node(this.notificationContainerDomId);k.empty(s);s.appendChild(o);a===Object.prototype.toString()&&(a=i);if(c.HTML)c=document.createElement("span"),c.innerHTML=a,s.appendChild(c);else{if(i=e.detectValidURL(a))a=document.createDocumentFragment(),e.processURLSegments(a,i),Array.prototype.forEach.call(k.$$("a",a),function(a){a.target="_blank"});else{if(c.Severity!=="Warning"&&c.Severity!=="Error"&&!f)this._timer&&window.clearTimeout(this._timer),
this._timer=window.setTimeout(function(){this.setProgressMessage("");this._timer=null}.bind(this),5E3);a=document.createTextNode(a)}s.appendChild(a)}if(j&&this.progressDomId!==this.domId){n.classList.add(j);for(j=0;j<t.length;j++)n.classList.remove(t[j])}n.classList.add("notificationShow");if((t=k.node("closeNotifications"))&&this._cancelMsg)t.classList.add("cancelButton"),t.classList.remove("dismissButton"),t.classList.remove("core-sprite-close"),t.classList.remove("imageSprite"),t.innerHTML=this._cancelMsg},
showWhile:function(b,f){var c=this;if(f){c.setProgressMessage(f);var d=function(){f===c.currentMessage&&c.setProgressMessage("")};b.then(d,d)}return b},_lastProgressId:0,_progressMonitors:{length:0},createProgressMonitor:function(b,f){return new i(this,++this._lastProgressId,b,f)},_renderOngoingMonitors:function(){if(this._progressMonitors.length>0){var b="",f=!0,c;for(c in this._progressMonitors)this._progressMonitors[c].status&&(f||(b+=", "),b+=this._progressMonitors[c].status,f=!1);this.setProgressMessage(b)}else this.setProgressMessage("")},
_beginProgressMonitor:function(b){this._progressMonitors[b.progressId]=b;this._progressMonitors.length++;this._renderOngoingMonitors()},_workedProgressMonitor:function(b){this._progressMonitors[b.progressId]=b;this._renderOngoingMonitors()},_doneProgressMonitor:function(b){delete this._progressMonitors[b.progressId];this._progressMonitors.length--;b.status?this.setProgressResult(b.status):this._renderOngoingMonitors()}};c.prototype.constructor=c;i=function(b,f,c,d){this.statusService=b;this.progressId=
f;if(c){this.deferred=c;this.begin(d);var a=this;c.then(function(){a.done.bind(a)()},function(){a.done.bind(a)()})}};i.prototype.begin=function(b){this.status=b;this.statusService._beginProgressMonitor(this)};i.prototype.done=function(b){this.status=b;this.statusService._doneProgressMonitor(this)};i.prototype.worked=function(b){this.status=b;this.statusService._workedProgressMonitor(this)};i.prototype.constructor=i;return{StatusReportingService:c,ProgressMonitor:i}});
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(c,b,f,h,d){this._tooltip=new e.Tooltip({node:c,hideDelay:d||0,afterShowing:this._afterShowingFunction(b).bind(this),afterHiding:f,trigger:h?h:"click"});this.$parent=this._tooltip.contentContainer();this.$parent.role="dialog";c=document.createRange();c.selectNode(this.$parent);c=c.createContextualFragment(this.TEMPLATE);
this.messages&&j.processTextNodes(c,g);this.$parent.appendChild(c);var a=this._tooltip;this.$parent.addEventListener("keydown",function(b){b.keyCode===j.KEY.ESCAPE&&a.hide()},!1);this._bindElements(this.$parent);typeof this._bindToDom==="function"&&this._bindToDom(this.$parent)},_bindElements:function(c){for(var b=0;b<c.childNodes.length;b++){var f=c.childNodes[b];f.id&&(this["$"+f.id]=f);this._bindElements(f)}},_afterShowingFunction:function(c){return function(){c&&c.bind(this)();if(!this.customFocus){var b=
j.firstTabbable(this.$parent);b&&b.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 i=!1;c.updateNavTools=function(b,f,c,d,a,e){var n=j.node(d);if(n)f.destroy(n);else throw g["could not find toolbar "]+d;f.renderCommands(d,n,e,c,"button");if(a&&(d=j.node(a)))f.destroy(d),f.renderCommands(a,d,null,c,"button");i||(i=!0,b.getService("orion.page.selection").addEventListener("selectionChanged",function(b){var d=j.node(a);
d&&(f.destroy(d),f.renderCommands(a,d,b.selections,c,"button"))}))};c.createOperationsCommands=function(b,f,c){function d(a){return!a.operation||!a.operation.type?!1:a.operation.type==="loadstart"||a.operation.type==="progress"}var a=new e.Command({name:g["Remove Completed"],tooltip:g["Remove all completed operations"],id:"eclipse.removeCompletedOperations",callback:function(){c.removeCompletedOperations().then(function(){f.loadOperations.bind(f)()})},visibleWhen:function(){return!0}});b.addCommand(a);
a=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],b=0;b<a.length;b++){var d=a[b];c.removeOperation.bind(c)(d.Location).then(function(){f.loadOperations.bind(f)()},function(){f.loadOperations.bind(f)()})}},visibleWhen:function(a){if(!Array.isArray(a)||a.length===0)return!d(a);for(var b in a)if(d(a[b]))return!1;return!0}});b.addCommand(a);
a=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],b=0;b<a.length;b++){var d=a[b];d.deferred&&d.deferred.cancel()}},visibleWhen:function(a){if(!Array.isArray(a)||a.length===0)return d(a)&&(a.operation&&a.operation.cancelable?!0:!1);for(var b in a)if(!d(a[b])||!a[b].operation||!a[b].operation.cancelable)return!1;return!0}});b.addCommand(a)}})();
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 i(b){this._options=b}i.prototype=new e.PopupDialog;i.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>';i.prototype._init=
function(b){this._myOperations=[];this._operationsDeferreds=[];this._commandService=b.commandRegistry;c.createOperationsCommands(this._commandService);this._commandService.registerCommandContribution("operationsDialogItems","eclipse.cancelOperation",1);this._initialize(b.triggerNode)};i.prototype._bindToDom=function(){this.$allOperationsLink.href=k.toUrl("operations/list.html");this._setOperationsVisibility()};i.prototype.setOperations=function(b,f){this._myOperations||this._init(this._options);this._myOperations=
[];this._operationsDeferreds=[];if(b)for(var c in b)this._myOperations.push(b[c]),this._operationsDeferreds.push(f[c]);this._renderOperations()};i.prototype.parseProgressResult=function(b){if(!b)return{};b=b.responseText||b;try{b=JSON.parse(b)}catch(f){}var c={Message:b.Message||b,Severity:b.Severity};if(b.DetailedMessage&&b.DetailedMessage!==c.Message)c.DetailedMessage=b.DetailedMessage;return c};i.prototype._renderOperations=function(){this._renderOperationsTable(this.$myOperationsList,this._myOperations,
this._operationsDeferreds)};i.prototype._renderOperationsTable=function(b,f,c){j.empty(b);for(var d=0;d<f.length;d++){var a=f[d],e=document.createElement("tr"),i=document.createElement("td");i.style.paddingLeft="5px";i.style.paddingRight="5px";i.textContent=a.Name;e.appendChild(i);var m=document.createElement("div");i.appendChild(m);i=document.createElement("span");i.style.paddingRight="5px";i.classList.add("imageSprite");switch(a.type){case "Warning":i.classList.add("core-sprite-warning");i.setAttribute("aria-label",
g["Operation resulted in a warning."]);break;case "error":i.classList.add("core-sprite-error");i.setAttribute("aria-label",g["Operation resulted in an error."]);break;case "loadstart":case "progress":i.classList.add("core-sprite-start");i.setAttribute("aria-label",g["Operation is running."]);break;case "abort":i.classList.add("core-sprite-stop");i.setAttribute("aria-label",g["Operation is canceled."]);break;case "load":case "loadend":i.classList.add("core-sprite-ok"),i.setAttribute("aria-label","Operation ok.")}m.appendChild(i);
i=document.createElement("span");i.classList.add("operationStatus");i.textContent=a.Name;m.appendChild(i);if(a.error){var k=a.error.Message||a.error;a.error.DetailedMessage&&a.error.DetailedMessage!==""&&(k+=": "+a.error.DetailedMessage);i.textContent=k;i.classList.remove("operationStatus");i.classList.add("operationError")}this._commandService.renderCommands("operationsDialogItems",m,{operation:a,deferred:c[d]},this,"tool");b.appendChild(e)}this._setOperationsVisibility()};i.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"};i.prototype.constructor=i;return{OperationsDialog:i}});
define("orion/progress",["i18n!orion/nls/messages","require","orion/Deferred","orion/webui/littlelib","orion/webui/dialogs/OperationsDialog"],function(g,k,j,e,c){function i(b,h){if(!this._progressPane){this._progressPane=e.node(b);this._operationsDialog=new c.OperationsDialog({triggerNode:this._progressPane,commandRegistry:h});var d=this;this._progressPane.addEventListener("keydown",function(a){(a.charOrCode===" "||a.keyCode===e.KEY.ENTER)&&d._operationsDialog.show()})}}function b(b,c,d,a){this._serviceRegistry=
b;this._serviceRegistration=b.registerService("orion.page.progress",this);this._commandRegistry=d;this._operationsClient=c;this._operations={};this._operationDeferrds={};this._operationsIndex=0;this._lastIconClass=this._lastOperation=null;this._progressMonitorClass=a}i.prototype={_switchIconTo:function(b){this._lastIconClass&&this._progressPane.classList.remove(this._lastIconClass);this._lastIconClass=b;this._progressPane.classList.add(this._lastIconClass)},generateOperationsInfo:function(b,c){var d=
{},a;for(a in b)b[a].progressMonitor||(d[a]=b[a]);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 e="";for(a in d){var i=d[a];if(i.type&&(i.type==="loadstart"||i.type==="progress")){e="running";break}}switch(e){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,c)},_isEmpty:function(b){for(var c in b)return!1;return!0}};
i.prototype.constructon=i;b.prototype={init:function(b){if(!this._progressMonitorClass)this._progressMonitorTool=new i(b,this._commandRegistry)},progress:function(b,c,d){var a=this,e=this._operationsIndex++;!d&&this._progressMonitorClass&&(d=new this._progressMonitorClass,d.begin(c));b.then(function(){if(a._operations[e]){var i=a._operations[e];if(c)i.Name=c;a._lastOperation=i;i.type="loadend";if(d)i.progressMonitor=d;a.writeOperation.bind(a)(e,i,b);i.Location||a._removeOperationFromTheList.bind(a)(e)}},
function(i){if(a._operations[e]){var g=a._operations[e];if(c)g.Name=c;if(d)g.progressMonitor=d;a._lastOperation=g;g.type=i.canceled?"abort":"error";g.error=i;a.writeOperation.bind(a)(e,g,b);g.Location||a._removeOperationFromTheList.bind(a)(e)}},function(i){if(c)i.Name=c;if(d)i.progressMonitor=d;a.writeOperation.bind(a)(e,i,b)});return b},removeOperation:function(b){for(var c in this._operations)if(this._operations[c].Location&&this._operations[c].Location===b){this._removeOperationFromTheList(c);
break}this._operationsClient.removeOperation.bind(this._operationsClient)(b)},_removeOperationFromTheList:function(b){var c=this._operations[b].progressMonitor;delete this._operations[b];delete this._operationDeferrds[b];c?c.done():this._progressMonitorTool.generateOperationsInfo(this._operations,this._operationDeferrds)},removeCompletedOperations:function(){for(var b in this._operations){var c=this._operations[b];if(c.type&&c.type!=="loadstart"&&c.type!=="progress")(c=this._operations[b].progressMonitor)&&
c.done(),delete this._operations[b],delete this._operationDeferrds[b]}this._progressMonitorTool.generateOperationsInfo(this._operations,this._operationDeferrds)},setProgressResult:function(b){this._serviceRegistry.getService("orion.page.message").setProgressResult(b)},showWhile:function(b,c){c&&this._serviceRegistry.getService("orion.page.message").setProgressMessage(c);var d=this;b.then(function(){d._serviceRegistry.getService("orion.page.message").setProgressMessage("")},function(a){d.setProgressResult.bind(d)(a);
return a});return this.progress(b,c)},writeOperation:function(b,c,d){this._operations[b]=c;this._operationDeferrds[b]=d;c.Location&&this._serviceRegistry.getService("orion.core.preference").getPreferences("/operations").then(function(a){a.put(c.Location,{Name:c.Name,expires:c.expires})});c.progressMonitor?c.progressMonitor.progress(c.Name):this._progressMonitorTool.generateOperationsInfo(this._operations,this._operationDeferrds)}};b.prototype.constructor=b;return{ProgressService:b}});
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(b,c,h){return b[c].apply(b,h)}function e(b){this._location=b}function c(){var b=new k;b.reject(g["No Matching OperationService for location:"]+this._location);return b}function i(b){this._services=[];this._patterns=[];this._operationListeners=[];this._currentLongpollingIds=[];this._preferenceService=b.getService("orion.core.preference");for(var c=b.getServiceReferences("orion.core.operation"),
h=0;h<c.length;h++){var d=b.getService(c[h]);this._services[h]=d;d=c[h].getProperty("pattern")||".*";d[0]!=="^"&&(d="^"+d);this._patterns[h]=RegExp(d)}this._getService=function(a){if(!a)return this._services[0];for(var b=0;b<this._patterns.length;++b)if(this._patterns[b].test(a))return this._services[b];this._operations.remove(a);return new e(a)}}e.prototype={getOperation:c,getOperations:c,removeCompletedOperations:c,removeOperation:c,cancelOperation:c};e.prototype.constructor=e;i.prototype={getOperations:function(){var b=
new k;if(this._operations)return b.resolve(this._operations),b;var c=this;this._preferenceService.getPreferences("/operations").then(function(h){c._operations=h;b.resolve(c._operations)});return b},getOperation:function(b){return j(this._getService(b),"getOperation",arguments)},removeCompletedOperations:function(){for(var b=[],c=this,h=0;h<this._services.length;h++){var d=this._patterns[h],a=new k;b[h]=a.promise;j(this._services[h],"removeCompletedOperations").then(function(a){return function(b){Array.isArray(b)&&
c.getOperations.bind(c)().then(function(c){for(var f=c.keys(),h=0;h<f.length;h++){var e=f[h];d.test(e)&&b.indexOf(e)<0&&c.remove(e)}a.resolve()})}}(a),function(a){return function(b){a.reject(b)}}(a))}return k.all(b)},removeOperation:function(b){var c=this;return j(this._getService(b),"removeOperation",arguments).then(function(){c.getOperations.bind(c)().then(function(c){c.remove(b)})},function(b){return b},function(b){return b})}};i.prototype.constructor=i;return{OperationsClient:i}});
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.",
"Save frequently used searches by clicking on the ${0} button above.":"Save frequently used searches by clicking on the ${0} button 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","${0} matches":"${0} matches","Regular expression is off. You can click here or use options to turn it on for replacement - e.g. when the option is on you can replace <td([\\s\\S]*?)</td> with <span$1</span>.":"Regular expression is off. You can click here or use options to turn it on for replacement - e.g. when the option is on you can replace <td([\\s\\S]*?)</td> with <span$1</span>.",
"Regular expression is on. You can click here or use options to turn it off - e.g. when the option is on you can replace <td([\\s\\S]*?)</td> with <span$1</span>.":"Regular expression is on. You can click here or use options to turn it off - e.g. when the option is on you can replace <td([\\s\\S]*?)</td> with <span$1</span>."});
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,i=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(b){i._showRoot?(b._depth=0,i._generate([b],0)):i._treeModel.getChildren(b,function(b){i.destroyed||i._generate(b,0)})})},destroy:function(){this.destroyed=!0},_generate:function(e,c){k.empty(this._parent);
var i=document.createElement("div");this._renderer.wrapperCallback&&this._renderer.wrapperCallback(i);var b=document.createElement(this._tableElement);this._renderer.tableCallback&&this._renderer.tableCallback(b);b.id=this._id;this._tableStyle&&b.classList.add(this._tableStyle);this._renderer.initTable(b,this);this._bodyElement=document.createElement(this._tableBodyElement);this._renderer.bodyCallback&&this._renderer.bodyCallback(this._bodyElement);this._bodyElement.id=this._id+"tbody";e.length===
0?this._renderer.emptyCallback&&this._renderer.emptyCallback(this._bodyElement):this._generateChildren(e,c);b.appendChild(this._bodyElement);i.appendChild(b);this._parent.appendChild(i);this._rowsChanged()},_generateChildren:function(e,c,i){for(var b=0;b<e.length;b++){var f=document.createElement(this._tableRowElement);f.id=this._treeModel.getId(e[b]);this._renderer.rowCallback&&this._renderer.rowCallback(f);f._depth=c;f._item=e[b];this._renderer.render(e[b],f);f.childNodes[this._labelColumnIndex].style.paddingLeft=
this._indent*c+"px";i?(this._bodyElement.insertBefore(f,i.nextSibling),i&&(i=f)):this._bodyElement.appendChild(f)}},_rowsChanged:function(){this._renderer.rowsChanged&&this._renderer.rowsChanged()},getSelected:function(){return this._renderer.getSelected()},refresh:function(e,c,i){var b=this._treeModel.getId(e),f;if(b===this._id)this._removeChildRows(b),this._generateChildren(c,0),this._rowsChanged();else{var h=k.node(b);h?(h._item=e,h&&(i||h._expanded)?(this._removeChildRows(b),this._renderer.updateExpandVisuals(h,
!0),c?(h._expanded=!0,this._generateChildren(c,h._depth+1,h),this._rowsChanged()):(f=this,c=this._treeModel.getChildren(h._item,function(b){if(!f.destroyed&&!h._expanded)h._expanded=!0,f._generateChildren(b,h._depth+1,h),f._rowsChanged()}))):this._renderer.updateExpandVisuals(h,!1)):console.log(g["could not find table row "]+b)}},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){e=typeof e==="string"?e:this._treeModel.getId(e);return(e=k.node(e))?e._expanded:!1},expand:function(e,c,i){var e=typeof e==="string"?e:this._treeModel.getId(e),b=k.node(e);if(b&&!b._expanded){var f=this;this._renderer.updateExpandVisuals(b,!0);this._treeModel.getChildren(b._item,function(h){if(!f.destroyed){if(!b._expanded)b._expanded=!0,f._generateChildren(h,b._depth+1,b),f._rowsChanged();c&&c.apply(f,i)}})}},
_removeChildRows:function(e){for(var c=e===this._id,i=!1,b=-1,f=[],h=k.$$array(".treeTableRow",this._parent),d=0;d<h.length;d++){var a=h[d];if(i)break;if(c)a._depth>b?f.push(a):i=!0;else if(a.id===e)c=!0,b=a._depth}for(e=0;e<f.length;e++)c=f[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(e){e&&c.setCursor(e)})}(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(e){e&&
c.setCursor(e)})}e&&this.setCursor(e);return e},_findSibling:function(g,e){for(var c=this.topLevel(g),i=this._getChildren(g.parent),i=c?this.firstLevelChildren:i,b=0;b<i.length;b++)if(i[b]===g)return b===0&&!e?c?null:g.parent:b===i.length-1&&e?c?null:this._findSibling(g.parent,e):e?i[b+1]:i[b-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 i=[];for(i.push(e);;){if(this.iterate(g))i.push(this.cursor());else break;if(c===this.cursor())return i}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(),
i=this._scan(!0,g,e);i||(i=this._scan(!1,g,e));this.setCursor(c);return i},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","orion/uiUtils"],function(g,k,j,e){var g={},c=navigator.userAgent.indexOf("iPad")!==-1,i=window.navigator.platform.indexOf("Mac")!==-1;g.ExplorerNavHandler=function(){function b(b,c,d){this.explorer=b;this.model=this.explorer.model;this._navDict=c;this._listeners=[];this._selections=[];this._currentColumn=0;b=this._getEventListeningDiv();b.tabIndex=0;b.classList.add("selectionModelContainer");
var a=this;this._modelIterator=new j.TreeModelIterator([],{isExpanded:this.isExpanded.bind(this),getChildrenFunc:d.getChildrenFunc,isExpandable:this.explorer.renderer.isExpandable?function(b){return a.explorer.renderer.isExpandable(b)}:function(b){return a.isExpandable(b)},forceExpandFunc:this.explorer.forceExpandFunc?function(b,d,c){return a.explorer.forceExpandFunc(b,d,c)}:void 0});this._init(d);(!d||d.setFocus!==!1)&&b.focus();d=function(b){if(e.isFormElement(b.target))return!0;if(a.explorer.preventDefaultFunc&&
a.explorer.preventDefaultFunc(b,a._modelIterator.cursor()))return!0;if(b.keyCode===k.KEY.DOWN)return a.onDownArrow(b);else if(b.keyCode===k.KEY.UP)return a.onUpArrow(b);else if(b.keyCode===k.KEY.RIGHT)return a.onRightArrow(b);else if(b.keyCode===k.KEY.LEFT)return a.onLeftArrow(b);else if(b.keyCode===k.KEY.SPACE)return a.onSpace(b);else if(b.keyCode===k.KEY.ENTER)return a.onEnter(b)};b.addEventListener("keydown",d,!1);this._listeners.push({type:"keydown",listener:d});d=function(){if(a.explorer.onFocus)a.explorer.onFocus(!1);
else a.toggleCursor(null,!1)};b.addEventListener("blur",d,!1);this._listeners.push({type:"blur",listener:d});d=function(){if(a.explorer.onFocus)a.explorer.onFocus(!0);else a.toggleCursor(null,!0)};b.addEventListener("focus",d,!1);this._listeners.push({type:"focus",listener:d});this._parentDiv=b}b.prototype={destroy:function(){this._parentDiv.classList.remove("selectionModelContainer");this.removeListeners()},_init:function(b){this._linearGridMove=!1;if(b)this._selectionPolicy=b.selectionPolicy,this.gridClickSelectionPolicy=
b.gridClickSelectionPolicy||"none",this.preventDefaultFunc=b.preventDefaultFunc,this.postDefaultFunc=b.postDefaultFunc},_ctrlKeyOn:function(b){return i?b.metaKey:b.ctrlKey},removeListeners:function(){if(this._listeners)for(var b=0;b<this._listeners.length;b++)this._parentDiv.removeEventListener(this._listeners[b].type,this._listeners[b].listener,!1)},focus:function(){var b=this._getEventListeningDiv();b&&b.focus()},_getEventListeningDiv:function(b){return this.explorer.keyEventListeningDiv&&typeof this.explorer.keyEventListeningDiv===
"function"?this.explorer.keyEventListeningDiv(b):k.node(this.explorer._parentId)},isExpandable:function(b){return!b?!1:k.node(this.explorer.renderer.expandCollapseImageId(this.model.getId(b)))?!0:!1},isExpanded:function(b){return!b?!1:this.explorer.myTree.isExpanded(this.model.getId(b))},refreshSelection:function(b){var c=this;this.explorer.selection&&this.explorer.selection.getSelections(function(d){c._clearSelection();for(var a=0;a<d.length;a++)c._selections.push(d[a]);c._selections.length>0?c.cursorOn(c._selections[0],
!0,!1,b):c.cursorOn();if(!(c._shiftSelectionAnchor&&c._inSelection(c._shiftSelectionAnchor)>=0))c._shiftSelectionAnchor=null})},refreshModel:function(b,c,d,a){this._currentColumn=0;this.topIterationNodes=[];this.model=c;this._navDict=b;if(this.model.getTopIterationNodes)this.topIterationNodes=this.model.getTopIterationNodes();else if(d)this.topIterationNodes=d;this._modelIterator.setTree(this.topIterationNodes);!a&&this.explorer.selection&&(this.toggleCursor(this._modelIterator.cursor(),!1),this._modelIterator.reset());
this.refreshSelection(!0)},getTopLevelNodes:function(){return this._modelIterator.firstLevelChildren},_inSelection:function(b){for(var b=this.model.getId(b),c=0;c<this._selections.length;c++)if(b===this.model.getId(this._selections[c]))return c;return-1},_clearSelection:function(b){if(b)for(b=0;b<this._selections.length;b++)this._checkRow(this._selections[b],!0);this._selections=[]},getSelectionPolicy:function(){return this._selectionPolicy},setSelectionPolicy:function(b){if(this._selectionPolicy!==
b)this._selectionPolicy=b,this._selectionPolicy==="cursorOnly"&&this._clearSelection(!0)},setSelection:function(b,c,d){if(this._selectionPolicy==="cursorOnly")c&&this.explorer.renderer._useCheckboxSelection&&this._checkRow(b,!0);else if(this._isRowSelectable(b)){!c||this._selectionPolicy==="singleSelection"?(this._clearSelection(!0),this._checkRow(b,!1),this._selections.push(b),this._lastSelection=b):(c=this._inSelection(b),c>=0?(this._checkRow(b,!0),this._selections.splice(c,1)):(this._checkRow(b,
!1),this._selections.push(b),this._lastSelection=b));if(d)this._shiftSelectionAnchor=this._lastSelection;this.explorer.selection&&(this.explorer.renderer.storeSelections(),this.explorer.selection.setSelections(this._selections))}},moveColumn:function(b,c){b||(b=this.currentModel());var d=this._getGridChildren(b);if(d&&d.length>1||c===0&&d){c!==0&&this.toggleCursor(b,!1);var a=this._currentColumn,e=!0;a+=c;a<0?(this._linearGridMove&&c!==0&&(this._modelIterator.iterate(!1)?b=this.currentModel():e=!1),
a=e?d.length-1:this._currentColumn):a>=d.length&&(this._linearGridMove&&c!==0&&(this._modelIterator.iterate(!0)?b=this.currentModel():e=!1),a=e?0:this._currentColumn);this._currentColumn=a;c!==0&&this.toggleCursor(b,!0);return!0}return!1},_getGridChildren:function(b){return this._navDict?this._navDict.getGridNavHolder(b):null},getCurrentGrid:function(b){b||(b=this.currentModel());return(b=this._getGridChildren(b))&&b.length>0?b[this._currentColumn]:null},getAriaContainerElement:function(b){for(var c=
this._parentDiv,d;b&&b!==c&&(d=b.getAttribute("role"))!=="grid"&&d!=="tree"&&d!=="treegrid";)b=b.parentNode;return b===c?null:b},toggleCursor:function(b,c){var d=this.getRowDiv(b),a=this.getCurrentGrid(b);a?(d&&(c?d.classList.add("treeIterationCursorRow"):d.classList.remove("treeIterationCursorRow")),a.domNode&&(d=this.getAriaContainerElement(a.domNode),c?(a.domNode.classList.add("treeIterationCursor"),d&&d.setAttribute("aria-activedescendant",a.domNode.id)):a.domNode.classList.remove("treeIterationCursor"))):
d&&(c?d.classList.add("treeIterationCursorRow_Dotted"):d.classList.remove("treeIterationCursorRow_Dotted"))},currentModel:function(){return this._modelIterator.cursor()},cursorOn:function(b,c,d,a){var e,i;if(b||c){if(i===this._modelIterator.cursor())return;e=this._modelIterator.cursor();i=b;this._modelIterator.setCursor(i)}else e=this._modelIterator.prevCursor(),i=this._modelIterator.cursor();if(e!==i||c)if(this.toggleCursor(e,!1),!c||i){this.moveColumn(null,0);this.toggleCursor(i,!0);if((b=this.getRowDiv())&&
!a){for(a=b.parentNode;a;){c=window.getComputedStyle(a,null);if(!c)break;c=c.getPropertyValue("overflow-y");if(c==="hidden"||c==="auto"||c==="scroll")break;a=a.parentNode}if(!a)a=document.body;c=!0;b.offsetTop<=a.scrollTop?(c=!1,d===void 0&&(d=!1)):b.offsetTop+b.offsetHeight>=a.scrollTop+a.clientHeight&&(c=!1,d===void 0&&(d=!0));c||b.scrollIntoView(!d)}if(this.explorer.onCursorChanged)this.explorer.onCursorChanged(e,i)}},getSelection:function(){return this._selections},getSelectionIds:function(){for(var b=
[],c=0;c<this._selections.length;c++)b.push(this.model.getId(this._selections[c]));return b},getRowDiv:function(b){b=b?b:this._modelIterator.cursor();if(!b)return null;var b=this.model.getId(b),c=this._navDict.getValue(b);return c&&c.rowDomNode?c.rowDomNode:k.node(b)},iterate:function(b,c,d){this.topIterationNodes.length!==0&&this._modelIterator.iterate(b,c)&&(this.cursorOn(null,!1,b),d&&(b=this._inSelection(this._modelIterator.prevCursor()),c=this._inSelection(this._modelIterator.cursor()),b>=0&&
c>=0?this.setSelection(this._modelIterator.prevCursor(),!0):this.setSelection(this.currentModel(),!0)))},_checkRow:function(b,c){if(this.explorer.renderer._useCheckboxSelection){var d=this.getRowDiv(b);if(d){var a=k.node(this.explorer.renderer.getCheckBoxId(d.id)),e=c?!a.checked:!0;if(e!==a.checked)this.explorer.renderer.onCheck(d,a,e,!0)}}else this._select(b,c)},_select:function(b){b||(b=this._modelIterator.cursor());var c=this.getRowDiv(b);c&&(this._inSelection(b)<0?c.classList.add("checkedRow"):
c.classList.remove("checkedRow"))},_onModelGrid:function(b,c){var d=this._getGridChildren(b);if(d)for(var a=0;a<d.length;a++)if(c.target===d[a].domNode)return!0;return!1},onClick:function(b,e){var d=k.node(this.explorer.renderer.expandCollapseImageId(this.model.getId(b)));if(e.target!==d&&!(this.gridClickSelectionPolicy==="none"&&this._onModelGrid(b,e)))if(this.cursorOn(b,!0,!1,!0),c)this.setSelection(b,!0);else if(this._ctrlKeyOn(e))this.setSelection(b,!0,!0);else if(e.shiftKey&&this._shiftSelectionAnchor){if(d=
this._modelIterator.scan(this._shiftSelectionAnchor,b)){this._clearSelection(!0);for(var a=0;a<d.length;a++)this.setSelection(d[a],!0)}}else this.setSelection(b,!1,!0)},onCollapse:function(b){this._modelIterator.collapse(b)&&this.cursorOn()},onUpArrow:function(b){this.iterate(!1,!1,b.shiftKey);!this._ctrlKeyOn(b)&&!b.shiftKey&&this.setSelection(this.currentModel(),!1,!0);b.preventDefault();return!1},onDownArrow:function(b){this.iterate(!0,!1,b.shiftKey);!this._ctrlKeyOn(b)&&!b.shiftKey&&this.setSelection(this.currentModel(),
!1,!0);b.preventDefault();return!1},_shouldMoveColumn:function(b){var c=this.currentModel(),d=this._getGridChildren(c);return d&&d.length>1?this.isExpandable(c)?this._ctrlKeyOn(b):!0:!1},onLeftArrow:function(b){if(this._shouldMoveColumn(b))return this.moveColumn(null,-1),b.preventDefault(),!0;var c=this._modelIterator.cursor();if(!c)return!1;if(this.isExpandable(c)&&this.isExpanded(c))return this.explorer.myTree.collapse(c),b.preventDefault(),!0;this._modelIterator.topLevel(c)?this.explorer.scopeUp&&
typeof this.explorer.scopeUp==="function"&&this.explorer.scopeUp():(this.cursorOn(c.parent),this.setSelection(c.parent,!1,!0))},onRightArrow:function(b){if(this._shouldMoveColumn(b))return this.moveColumn(null,1),b.preventDefault(),!0;var c=this._modelIterator.cursor();if(!c)return!1;if(this.isExpandable(c)&&!this.isExpanded(c))return this.explorer.myTree.expand(c),b.preventDefault(),!1},_isRowSelectable:function(b){return this.explorer.isRowSelectable?this.explorer.isRowSelectable(b):!0},onSpace:function(b){this.setSelection(this.currentModel(),
!0,!0);b.preventDefault()},onEnter:function(b){var c=this.getCurrentGrid(this._modelIterator.cursor());if(c)if(c.widget)if(typeof c.onClick==="function")c.onClick();else typeof c.widget.focus==="function"&&c.widget.focus();else{var d=document.createEvent("MouseEvents");d.initMouseEvent("click",!0,!0,window,0,0,0,0,0,this._ctrlKeyOn(b),!1,!1,!1,0,null);c.domNode.dispatchEvent(d)}else if(this.explorer.renderer.getRowActionElement&&(c=this._modelIterator.cursor()))if(c=this.explorer.renderer.getRowActionElement(this.model.getId(c)),
c.href)this._ctrlKeyOn(b)?window.open(c.href):window.location.href=c.href}};return b}();g.ExplorerNavDict=function(){function b(b){this._dict={};this._model=b}b.prototype={addRow:function(b,c){this._dict[this._model.getId(b)]={model:b,rowDomNode:c}},getValue:function(b){return this._dict[b]},getGridNavHolder:function(b,c){if(!b)return null;var d=this._model.getId(b);if(this._dict[d]){if(!this._dict[d].gridChildren&&c)this._dict[d].gridChildren=[];return this._dict[d].gridChildren}return null},initGridNavHolder:function(b){if(!b)return null;
b=this._model.getId(b);if(this._dict[b])this._dict[b].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,i){var b={};b.Explorer=function(){function b(c,d,a,f){this.registry=c;this.renderer=a;this.selection=d;this.commandService=f;this.myTree=null}b.prototype={destroy:function(){this.model&&this.model.destroy();this.myTree&&this.myTree.destroy();this.destroyed=!0},changedItem:function(b,d){this.myTree&&
this.myTree.refresh.bind(this.myTree)(b,d,!0)},updateCommands:function(b){this.myTree&&this.myTree._renderer.updateCommands.bind(this.myTree._renderer)(b)},makeNewItemPlaceHolder:function(b,d,a){b=this.getRow(b);if(a)return b=b.childNodes[a],b.appendChild(document.createElement("br")),a=document.createElement("span"),a.id=d+"placeHolderRow",b.appendChild(a),{tempNode:a,refNode:a};if(b){a=document.createElement("tr");a.id=d+"placeHolderRow";var c=document.createElement("td");c.id=d+"placeHolderCol";
a.appendChild(c);b.appendChild(a);a=j.node(d+"placeHolderRow");b=j.node(d+"placeHolderCol");if(a&&b)return{tempNode:a,refNode:b}}return null},getRow:function(b){if(b=this.model.getId(b))return j.node(b)},collapseAll:function(){for(var b=this._navHandler.getTopLevelNodes(),d=0;d<b.length;d++)this.myTree.collapse(b[d])},expandAll:function(b){if(b)this._expandRecursively(b);else if(this._navHandler)for(var b=this._navHandler.getTopLevelNodes(),d=0;d<b.length;d++)this._expandRecursively(b[d])},_expandRecursively:function(b){if(this._navHandler&&
this._navHandler.isExpandable(b)){var d=this;this.myTree.expand(b,function(){d.model.getChildren(b,function(a){if(!(a===void 0||a===null))for(var b=a.length,c=0;c<b;c++)d._expandRecursively(a[c])})})}},createTree:function(b,d,a){b=typeof b==="string"?b:b.id||b;this.selection&&this.selection.setSelections([]);this.getNavHandler()&&this.getNavHandler()._clearSelection();var f=b+"innerTree",i=j.node(f);i&&j.empty(i);if(d)d.rootId=f;this.model=d;this._parentId=b;this._treeOptions=a;if(!a||a&&!a.noSelection)this.selectionPolicy=
a?a.selectionPolicy:"",this._navDict=new c.ExplorerNavDict(this.model);this.myTree=new e.TableTree({id:f,model:d,parent:b,labelColumnIndex:this.renderer.getLabelColumnIndex(),renderer:this.renderer,showRoot:a?!!a.showRoot:!1,indent:a?a.indent:void 0,onCollapse:a?a.onCollapse:void 0,navHandlerFactory:a?a.navHandlerFactory:void 0,tableElement:a?a.tableElement:void 0,tableBodyElement:a?a.tableBodyElement:void 0,tableRowElement:a?a.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 b=this.getNavHandler(),d=[];if(b&&this.getNavDict())for(var a=b.getSelection(),c=0;c<a.length;c++){var f=b.getRowDiv(a[c]);f&&f.parentNode&&(f=this.getNavDict().getValue(this.model.getId(a[c])),f.model&&d.push(f.model))}this.selection.setSelections(d)}},getRootPath:function(){return this.model&&this.model.root?this.model.root.Location:
null},initNavHandler:function(){var b=this._treeOptions;if(!b||b&&!b.noSelection){if(!this.getNavHandler())this._navHandler=b&&b.navHandlerFactory&&typeof b.navHandlerFactory.createNavHandler==="function"?b.navHandlerFactory.createNavHandler(this,this._navDict,b):new c.ExplorerNavHandler(this,this._navDict,{getChildrenFunc:b?b.getChildrenFunc:null,setFocus:b&&b.setFocus,selectionPolicy:b?b.selectionPolicy:null});var d=this;this.model.getRoot(function(a){a instanceof Array?d.getNavHandler().refreshModel(d.getNavDict(),
d.model,a):a.children&&a.children instanceof Array&&d.getNavHandler().refreshModel(d.getNavDict(),d.model,a.children);b&&b.setFocus&&d.getNavHandler().cursorOn(null,!1,!1,!0)})}},_lastHash:null,checkbox:!1};return b}();b.createExplorerCommands=function(b,c){function d(a){return typeof a.getItemCount==="function"?a.getItemCount()>0?c?c(a):!0:!1:!1}var a=new i.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 i.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()}});b.addCommand(a);b.addCommand(e)};b.ExplorerModel=function(){function b(c,d,a){this.rootPath=c;this.fetchItems=d;this.idPrefix=a||""}b.prototype={destroy:function(){this.destroyed=!0},getRoot:function(b){var d=this;this.fetchItems(this.rootPath).then(function(a){d.root=
a;b(a)})},getChildren:function(b,d){b.Children?d(b.Children):b.ChildrenLocation?this.fetchItems(b.ChildrenLocation).then(function(a){b.Children=a;d(a)}):d([])},getId:function(b){if(b.Location===this.root.Location)return this.rootId;for(var b=b.Location.replace(/[\\\/]/g,""),d=this.idPrefix,a=0;a<b.length;a++)d+=b[a].match(/[^\.\:\-\_0-9A-Za-z]/g)?b.charCodeAt(a):b[a];return d}};return b}();b.ExplorerFlatModel=function(){function c(b,d,a){this.rootPath=b;this.fetchItems=d;this.root=a}c.prototype=new b.ExplorerModel;
c.prototype.getRoot=function(b){if(this.root)b(this.root);else{var d=this;this.fetchItems(this.rootPath).then(function(a){d.root=a;b(a)})}};c.prototype.getChildren=function(b,d){b===this.root?d(this.root):d([])};return c}();b.ExplorerRenderer=function(){function b(c,d){this.explorer=d;this._init(c);this._expandImageClass="core-sprite-openarrow";this._collapseImageClass="core-sprite-closedarrow";this._twistieSpriteClass="modelDecorationSprite"}b.prototype={_init:function(b){if(b){this._useCheckboxSelection=
b.checkbox===void 0?!1:b.checkbox;this.selectionPolicy=b.singleSelection?"singleSelection":"";this._cachePrefix=b.cachePrefix;this.getCheckedFunc=b.getCheckedFunc;this.onCheckedFunc=b.onCheckedFunc;this._highlightSelection=!0;this._treeTableClass=b.treeTableClass||"treetable";if(b.highlightSelection===!1)this._highlightSelection=!1;if(!this.actionScopeId)this.actionScopeId=b.actionScopeId;if(!this.commandService)this.commandService=b.commandService}},getLabelColumnIndex:function(){return this.explorer.checkbox?
1:0},initTable:function(b,d){this.tableTree=d;j.empty(b);this._treeTableClass&&b.classList.add(this._treeTableClass);this.renderTableHeader(b)},getActionsColumn:function(b,d,a,c,f){var a=a||"tool",e=document.createElement("td");e.id=d.id+"actionswrapper";c&&e.classList.add(c);this.actionScopeId&&this.commandService?this.commandService.renderCommands(this.actionScopeId,e,b,this.explorer,a,null,f&&this.explorer.getNavDict()?this.explorer.getNavDict().getGridNavHolder(b,!0):null):window.console.log("Warning, no command service or action scope was specified.  No commands rendered.");
return e},initCheckboxColumn:function(){if(this._useCheckboxSelection)return document.createElement("th")},getCheckboxColumn:function(b,d){if(this._useCheckboxSelection){var a=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(b),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"));a.appendChild(c);var f=this;c.addEventListener("click",function(a){f.onCheck(d,a.target,a.target.checked?!1:!0,!0)},!1);return a}},getCheckBoxId:function(b){return b+"selectedState"},onCheck:function(b,d,a,c,f){(d.checked=a)?d.classList.add("core-sprite-check_on"):d.classList.remove("core-sprite-check_on");if(this.onCheckedFunc)this.onCheckedFunc(d.rowId,a,c);this.explorer.getNavHandler()&&f&&this.explorer.getNavHandler().setSelection(this.explorer.getNavDict().getValue(b.id).model,
!0)},storeSelections:function(){if(this.explorer.getNavHandler()){var b=this.explorer.getNavHandler().getSelectionIds(),d=this._getUIStatePreferencePath();d&&window.sessionStorage&&(window.sessionStorage[d+"selection"]=JSON.stringify(b))}},_restoreSelections:function(b){var d=this.explorer.getNavDict(),a=this.explorer.getNavHandler();if(a&&d&&a.getSelectionPolicy()!=="cursorOnly"&&(b=window.sessionStorage[b+"selection"],typeof b==="string"&&(b=b.length>0?JSON.parse(b):null),b)){for(var c=[],a=0;a<
b.length;a++){var f=d.getValue(b[a]);if(f&&f.rowDomNode&&f.model&&(c.push(f.model),this._highlightSelection&&f.rowDomNode.classList.add("checkedRow"),f=j.node(this.getCheckBoxId(f.rowDomNode.id))))f.checked=!0,f.classList.add("core-sprite-check_on")}this.explorer.selection&&(this.explorer.selection.setSelections(c),this.explorer.getNavHandler()&&this.explorer.getNavHandler().refreshSelection())}},_storeExpansions:function(b){window.sessionStorage[b+"expanded"]=JSON.stringify(this._expanded)},_restoreExpansions:function(b){var d=
!1,a=window.sessionStorage[b+"expanded"];typeof a==="string"&&(a=a.length>0?JSON.parse(a):null);var c;if(a)for(c=0;c<a.length;c++)if(j.node(a[c])){this._expanded.push(a[c]);var f=this;this.tableTree.expand(a[c],function(){f._restoreSelections(b)});d=!0}return!d},_getUIStatePreferencePath:function(){if(this.explorer){var b=this.explorer.getRootPath();if(this._cachePrefix&&b)return"/"+this._cachePrefix+"/"+b.replace(/[^\.\:\-\_0-9A-Za-z]/g,"")+"/uiState"}return null},expandCollapseImageId:function(b){return b+
"__expand"},updateExpandVisuals:function(b,d){var a=j.node(this.expandCollapseImageId(b.id));a&&(a.classList.add(d?this._expandImageClass:this._collapseImageClass),a.classList.remove(d?this._collapseImageClass:this._expandImageClass))},getExpandImage:function(b,d,a,c){var f=document.createElement("span");f.id=this.expandCollapseImageId(b.id);d.appendChild(f);f.classList.add(this._twistieSpriteClass);f.classList.add(this._collapseImageClass);if(a){var e=document.createElement("span");d.appendChild(e);
e.classList.add(c||"imageSprite");e.classList.add(a)}var i=this;f.onclick=function(){i.tableTree.toggle(b.id);if(i.tableTree.isExpanded(b.id))i._expanded.push(b.id);else for(var a in i._expanded)if(i._expanded[a]===b.id){i._expanded.splice(a,1);break}(a=i._getUIStatePreferencePath())&&window.sessionStorage&&i._storeExpansions(a)};return f},render:function(b,d){d.classList.add("navRow");this.renderRow(b,d)},rowsChanged:function(){this.explorer.selectionPolicy!=="cursorOnly"&&(this.explorer.refreshSelection(),
this.explorer.initNavHandler())},updateCommands:function(){if(this.commandService)for(var b=j.$$array(".treeTableRow"),d=0;d<b.length;d++){var a=b[d],c=j.node(a.id+"actionswrapper");this.commandService.destroy(c);this.actionScopeId&&this.commandService.renderCommands(this.actionScopeId,c,a._item,this.explorer,"tool")}},_initializeUIState:function(){this._expanded=[];var b=this._getUIStatePreferencePath();b&&window.sessionStorage&&this._restoreExpansions(b)&&this._restoreSelections(b)}};return b}();
b.SelectionRenderer=function(){function c(b,d){this._init(b);this.explorer=d}c.prototype=new b.ExplorerRenderer;c.prototype.renderTableHeader=function(b){var d=document.createElement("thead"),a=document.createElement("tr");d.classList.add("navTableHeading");this._useCheckboxSelection&&a.appendChild(this.initCheckboxColumn(b));for(var c=0,f=this.getCellHeaderElement(c);f;)f.innerHTML.length>0&&f.classList.add("navColumn"),a.appendChild(f),f=this.getCellHeaderElement(++c);d.appendChild(a);c>0&&b.appendChild(d)};
c.prototype.renderRow=function(b,d){d.verticalAlign="baseline";d.classList.add("treeTableRow");var a=this.explorer.getNavDict();if(a){a.addRow(b,d);var c=this;d.addEventListener("click",function(a){if(c.explorer.getNavHandler())c.explorer.getNavHandler().onClick(b,a)},!1)}if(a=this.getCheckboxColumn(b,d))a.classList.add("checkColumn"),d.appendChild(a);for(var a=0,f=this.getCellElement(a,b,d);f;)d.appendChild(f),a===0?this.getPrimColumnStyle?f.classList.add(this.getPrimColumnStyle()):f.classList.add("navColumn"):
this.getSecondaryColumnStyle?f.classList.add(this.getSecondaryColumnStyle()):f.classList.add("secondaryColumn"),f=this.getCellElement(++a,b,d)};c.prototype.getCellHeaderElement=function(){};c.prototype.getCellElement=function(){};return c}();b.SimpleFlatModel=function(){function c(b,d,a){this.items=b;this.getKey=a;this.idPrefix=d;this.root={children:b}}c.prototype=new b.ExplorerModel;c.prototype.getRoot=function(b){b(this.root)};c.prototype.getId=function(b){for(var b=this.getKey(b).replace(/[\\\/]/g,
""),d="",a=0;a<b.length;a++)d+=b[a].match(/[^\.\:\-\_0-9A-Za-z]/g)?b.charCodeAt(a):b[a];return this.idPrefix+d};c.prototype.getChildren=function(b,d){b===this.root?d(this.items):d([])};return c}();return b});
define("orion/explorers/navigatorRenderer","i18n!orion/navigate/nls/messages,orion/Deferred,orion/explorers/explorer,orion/explorers/navigationUtils,orion/extensionCommands,orion/objects,orion/URITemplate,orion/webui/littlelib".split(","),function(g,k,j,e,c,i,b,f){function h(d,f,e,h,g,j,r,u,w){var f=i.clone(f),v;if(f.Directory)v=document.createElement("a"),v.className="navlinkonpage",v.href=!d?a:(new b(d+"#{,resource,params*}")).expand({resource:f.ChildrenLocation}),f.Name&&v.appendChild(document.createTextNode(f.Name));
else{g||(g=c.getOpenWithCommands(e));if(!j)for(d=0;d<g.length;d++)g[d].isEditor==="default"&&(j=g[d]);v=document.createElement("a");v.className="navlink targetSelector";r&&typeof r==="object"&&Object.keys(r).forEach(function(a){v[a]=r[a]});var q=null,p=null;if(q=w?w.holderDom:v)p=document.createElement("span"),p.className="core-sprite-file modelDecorationSprite",q.appendChild(p);f.Name&&v.appendChild(document.createTextNode(f.Name));var x=!1,D=f.Location;if(u&&typeof u==="object")f.params={},i.mixin(f.params,
u);for(d=0;d<g.length;d++)if(u=g[d],u.visibleWhen(f)){D=u.hrefCallback({items:f});x=!0;break}k.when(h.getFileContentType(f),function(a){var b;if(b=!x)if(b=j){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&&(D=j.hrefCallback({items:f}));if(q){b=q;var d=f.Location,c=p,e;switch(a&&a.id){case "image/jpeg":case "image/png":case "image/gif":case "image/ico":case "image/tiff":case "image/svg":e=document.createElement("img");
e.src=d;e.classList.add("thumbnail");break;default:if(a&&a.image)e=document.createElement("img"),e.src=a.image,e.classList.add("thumbnail")}e&&b.replaceChild(e,c)}v.href=D})}return v}function d(a,b,d,c){this.explorer=b;this.commandService=d;this.contentTypeService=c;this.openWithCommands=null;this.actionScopeId=a.actionScopeId;this._init(a);this.target="_self"}var a=new b("#{,resource,params*}");d.prototype=new j.SelectionRenderer;d.prototype.wrapperCallback=function(a){a.setAttribute("role","tree")};
d.prototype.tableCallback=function(a){a.setAttribute("aria-label",g.Navigator);a.setAttribute("role","presentation")};d.prototype.rowCallback=function(a){a.setAttribute("role","treeitem")};d.prototype.emptyCallback=function(a){var b=document.createElement("tr"),d=document.createElement("td");d.colSpan=this.oneColumn?1:3;var c=document.createElement("div");c.classList.add("noFile");c.textContent=g.NoFile;var e=document.createElement("span");e.classList.add("core-sprite-addcontent");e.classList.add("icon-inline");
e.classList.add("imageSprite");f.processDOMNodes(c,[e]);d.appendChild(c);b.appendChild(d);a.appendChild(b)};d.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"}};d.prototype.setTarget=function(a){this.target=a};d.prototype.getFolderImage=function(){if(!this.showFolderImage)return null;var a=document.createElement("span");a.className="core-sprite-folder modelDecorationSprite";return a};d.prototype.createFolderNode=
function(a){var b;this.showFolderLinks?(b=h(this.folderLink||"",a,this.commandService,this.contentTypeService),(a=this.getFolderImage(a))&&b.insertBefore(a,b.firstChild)):(b=document.createElement("span"),b.textContent=a.Name);return b};d.prototype.showFolderLinks=!0;d.prototype.getCellElement=function(a,b,d){switch(a){case 0:var a=document.createElement("td"),f=document.createElement("span");f.id=d.id+"MainCol";f.setAttribute("role","presentation");a.appendChild(f);a.setAttribute("role","presentation");
f.className="mainNavColumn";var i;if(b.Directory)this.getExpandImage(d,f),i=this.createFolderNode(b),f.appendChild(i),this.explorer._makeDropTarget(b,i),this.explorer._makeDropTarget(b,d);else{if(!this.openWithCommands){this.openWithCommands=c.getOpenWithCommands(this.commandService);for(i=0;i<this.openWithCommands.length;i++)if(this.openWithCommands[i].isEditor==="default")this.defaultEditor=this.openWithCommands[i]}i=h("",b,this.commandService,this.contentTypeService,this.openWithCommands,this.defaultEditor,
{target:this.target});f.appendChild(i)}if(i)i.id=d.id+"NameLink",i.nodeType===1&&(e.addNavGrid(this.explorer.getNavDict(),b,i),i.setAttribute("role","link"),i.setAttribute("tabindex","-1"));this.actionScopeId&&this.commandService.renderCommands(this.actionScopeId,f,b,this.explorer,"tool",null,!0);return a;case 1:if(this.oneColumn)return null;d=document.createElement("td");if(b.LocalTimeStamp)d.textContent=(new Date(b.LocalTimeStamp)).toLocaleString();return d;case 2:if(this.oneColumn)return null;
d=document.createElement("td");if(!b.Directory&&typeof b.Length==="number")b=parseInt(b.Length,10)/1024,d.textContent=Math.ceil(b).toLocaleString()+" KB";d.style.textAlign="right";return d}};d.prototype.constructor=d;return{NavigatorRenderer:d,createLink:h}});
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,i,b,f,h){function d(a,b){this.serviceRegistry=a;this.commandRegistry=b;this.openWithCommands=null}function a(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(a,d,i,o,t){var s=this.serviceRegistry,r=this.commandRegistry;this.openWithCommands=this.openWithCommands||f.createOpenWithCommands(s,a,r);var u=this;return function(f,s,q,p){h.when(u.openWithCommands,function(h){if(q)j.empty(d),h=document.createElement("div"),h.appendChild(document.createTextNode(g["Search failed."])),d.appendChild(h),typeof o==="function"&&o(d);else{var D=
function(){function a(b,d){var c=d.folderName?d.folderName:d.path,f=document.createElement("span");f.id=c.replace(/[^a-zA-Z0-9_\.:\-]/g,"");f.appendChild(document.createTextNode(" - "+c+" "));b.appendChild(f)}var b={};return function(d,c){var f=c.name;if(b.hasOwnProperty(f)){a(d,c);var e=b[f];typeof e==="function"&&(b[f]=null,e())}else b[f]=function(){a(d,c)}}}(),A=!1;j.empty(d);if(f&&f.length>0){var F=document.createElement("table");F.setAttribute("role","presentation");for(var G=0;G<f.length;G++){var y=
f[G],z;if(!A&&(A=!0,i))z=F.insertRow(0).insertCell(0),z.textContent=i;z=F.insertRow(-1).insertCell(0);z.colspan=2;t&&t(z);var B={Name:y.name,Directory:y.directory,Location:y.path||y.location},u=null;if(typeof y.LineNumber==="number")u={},u.line=y.LineNumber;if(p&&p.keyword&&!p.nameSearch){var I=c.generateSearchHelper(p),u=u||{};u.find=I.inFileQuery.searchStr;u.regEx=I.inFileQuery.wildCard?!0:void 0}B=b.createLink(k.toUrl("edit/edit.html"),B,r,a,h,null,{"aria-describedby":(y.folderName?y.folderName:
y.path).replace(/[^a-zA-Z0-9_\.:\-]/g,""),style:{verticalAlign:"middle"}},u);y.LineNumber&&B.appendChild(document.createTextNode(" (Line "+y.LineNumber+")"));z.appendChild(B);D(z,y)}d.appendChild(F);typeof o==="function"&&o(d)}!A&&s&&(h=e.formatMessage(g["No matches found for ${0}"],s),j.empty(d),d.appendChild(document.createTextNode(h)),typeof o==="function"&&o(d))}})}};a.prototype={search:function(a,b,d){var f=function(a){for(var b=[],d=0;d<a.response.docs.length;d++){var f=a.response.docs[d];b.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 b};if(this._crawler&&a.nameSearch)this._crawler.searchName(a,function(b){d(f(b),a.keyword,null,a)});else try{this.registry.getService("orion.page.progress").progress(this._fileService.search(a),"Searching "+a.keyword).then(function(b){var c=a.keyword,c=c.substring(c.indexOf("}")+1),c=c.substring(c.indexOf(":")+1);d(f(b),c,null,a)},function(a){d(null,null,a,null)})}catch(e){typeof e===
"string"&&e.indexOf("search")>-1&&this._crawler?this._crawler.searchName(a,function(b){d(f(b),null,null,a)}):typeof e==="string"&&e.indexOf("search")>-1&&!a.nameSearch?(new i.SearchCrawler(this.registry,this._fileService,a,{childrenLocation:this.getChildrenLocation()})).search(function(b){d(f(b),null,null,a)}):this.registry.getService("orion.page.message").setErrorMessage(e)}},getFileService:function(){return this._fileService},setCrawler:function(a){this._crawler=a},handleError:function(a,b){console.error(a);
j.empty(b);b.appendChild(document.createTextNode(a));return a},setLocationByMetaData:function(a,b){var d="",c=null;this._searchRootLocation=this._fileService.fileServiceRootURL(a.Location);b&&a&&a.Parents&&a.Parents.length>0?c=b.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),d=c.Name,this._childrenLocation=c.ChildrenLocation;else if(a)this.setLocationbyURL(this._searchRootLocation),d=this._fileService.fileServiceName(a.Location),
this._childrenLocation=a.ChildrenLocation;c=j.node("search");d||(d="");if(c&&c.placeholder){c.value="";var f=e.formatMessage(g["Search ${0}"],d);c.placeholder=f.length>30?f.substring(0,27)+"...":e.formatMessage(g["Search ${0}"],d)}if(c&&c.title)c.title=g["Type a keyword or wild card to search in "]+d},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,b,d,c){d=d?this.getSearchRootLocation():this.getSearchLocation();return b?{resource:d,sort:"NameLower asc",rows:100,start:0,nameSearch:!0,keyword:a}:{resource:d,
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}}};a.prototype.constructor=a;return{Searcher:a}});
define("orion/widgets/themes/editor/ThemeData",["i18n!orion/settings/nls/messages","orion/editor/textTheme"],function(g,k){function j(){}function e(){this.styles=[];var c=new j;c.name="Eclipse";c.annotationRuler="white";c.background="white";c.comment="green";c.keyword="#7f0055";c.text="darkSlateGray";c.string="blue";c.overviewRuler="white";c.lineNumberOdd="#444";c.lineNumberEven="#444";c.lineNumber="#444";c.currentLine="#EAF2FE";c.tag="darkorange";c.attribute="cadetBlue";c.fontFamily=i;c.fontSize=
b;this.styles.push(c);c=new j;c.name="Prospecto";c.annotationRuler="white";c.background="white";c.comment="#3C802C";c.keyword="#CC4C07";c.text="#333";c.string="#446FBD";c.overviewRuler="white";c.lineNumberOdd="silver";c.lineNumberEven="silver";c.lineNumber="silver";c.currentLine="#EAF2FE";c.tag="#CC4C07";c.attribute="cadetBlue";c.fontFamily=i;c.fontSize=b;this.styles.push(c);c=new j;c.name="Blue";c.annotationRuler="lavender";c.background="aliceBlue";c.comment="indigo";c.keyword="cornFlowerBlue";c.text=
"navy";c.string="cornFlowerBlue";c.overviewRuler="lavender";c.lineNumberOdd="darkSlateGray";c.lineNumberEven="darkSlateGray";c.lineNumber="darkSlateGray";c.currentLine="white";c.tag="cornFlowerBlue";c.attribute="cadetBlue";c.fontFamily=i;c.fontSize=b;this.styles.push(c);c=new j;c.name="Ambience";c.annotationRuler="#3D3D3D";c.background="#202020";c.comment="mediumslateblue";c.keyword="cornFlowerBlue";c.text="darkseagreen";c.string="lightcoral";c.overviewRuler="white";c.lineNumberOdd="black";c.lineNumberEven=
"black";c.lineNumber="black";c.currentLine="lightcyan";c.tag="cornFlowerBlue";c.attribute="cadetBlue";c.fontFamily=i;c.fontSize=b;this.styles.push(c);c=new j;c.name="Tierra";c.annotationRuler="moccasin";c.background="lemonchiffon";c.comment="darkseagreen";c.keyword="darkred";c.text="#555555";c.string="orangered";c.overviewRuler="moccasin";c.lineNumberOdd="chocolate";c.lineNumberEven="chocolate";c.lineNumber="chocolate";c.currentLine="#baa289";c.tag="darkred";c.attribute="cadetBlue";c.fontFamily=i;
c.fontSize=b;this.styles.push(c);c=new j;c.name="Nimbus";c.annotationRuler="#444";c.background="dimgray";c.comment="darkseagreen";c.keyword="darkorange";c.text="white";c.string="cornflowerblue";c.overviewRuler="#444";c.lineNumberOdd="#aaa";c.lineNumberEven="#aaa";c.lineNumber="#aaa";c.currentLine="#aabfbb";c.tag="darkorange";c.attribute="cadetBlue";c.fontFamily=i;c.fontSize=b;this.styles.push(c);c=new j;c.name="Adelante";c.annotationRuler="#E2D2B2";c.background="#F1E7C8";c.comment="#5D774E";c.keyword=
"#AF473B";c.text="dimgray";c.string="#DE5D3B";c.overviewRuler="#E2D2B2";c.lineNumberOdd="#AF473B";c.lineNumberEven="#AF473B";c.lineNumber="#AF473B";c.currentLine="#9e937b";c.tag="#AF473B";c.attribute="cadetBlue";c.fontFamily=i;c.fontSize=b;this.styles.push(c);c=new j;c.name="Raspberry Pi";c.annotationRuler="seashell";c.background="seashell";c.comment="#66B32F";c.keyword="#E73E36";c.text="dimgray";c.string="darkorange";c.overviewRuler="seashell";c.lineNumberOdd="#E73E36";c.lineNumberEven="#E73E36";
c.lineNumber="#E73E36";c.currentLine="#F5B1AE";c.tag="#E73E36";c.attribute="cadetBlue";c.fontFamily=i;c.fontSize=b;this.styles.push(c)}function c(){return this.styles}var i='"Consolas", "Monaco", "Vera Mono", "monospace"',b="10pt";e.prototype.styles=[];e.prototype.getStyles=c;e.prototype.fontSettable=!0;e.prototype.getThemeStorageInfo=function(){return{storage:"/themes",styleset:"editorstyles",defaultTheme:"Prospecto",selectedKey:"editorSelected"}};e.prototype.parseToXML=function(b){try{var c=null;
if(window.DOMParser){var c=(new DOMParser).parseFromString(b,"text/xml"),d=c.getElementsByTagName("parsererror");return!d||!d.length||!d[0].childNodes.length?c:null}else return c=new ActiveXObject("Microsoft.XMLDOM"),c.async=!1,c.loadXML(b),c}catch(a){}};e.prototype.selectFontSize=function(b){console.log("fontsize: "+b)};e.prototype.importTheme=function(b){console.log("import theme");console.log(b);var c=this.parseToXML(b.parameters.valueFor("name")),d=new j;d.name=c.getElementsByTagName("colorTheme")[0].attributes[1].value;
d.annotationRuler=c.getElementsByTagName("background")[0].attributes[0].value;d.background=c.getElementsByTagName("background")[0].attributes[0].value;d.comment=c.getElementsByTagName("singleLineComment")[0].attributes[0].value;d.keyword=c.getElementsByTagName("keyword")[0].attributes[0].value;d.text=c.getElementsByTagName("foreground")[0].attributes[0].value;d.string=c.getElementsByTagName("string")[0].attributes[0].value;d.overviewRuler=c.getElementsByTagName("background")[0].attributes[0].value;
d.lineNumberOdd=c.getElementsByTagName("lineNumber")[0].attributes[0].value;d.lineNumberEven=c.getElementsByTagName("lineNumber")[0].attributes[0].value;d.lineNumber=c.getElementsByTagName("lineNumber")[0].attributes[0].value;d.currentLine=c.getElementsByTagName("selectionBackground")[0].attributes[0].value;b.items.addTheme(d)};e.prototype.processSettings=function(b){var c=k.TextTheme.getTheme();c.setThemeClass("editorTheme",c.buildStyleSheet("editorTheme",b))};e.prototype.getViewData=function(){var b=
{top:10,left:10,width:400,height:350},c=b.left,d=b.top;b.shapes=[{type:"TEXT",name:g["Line Numbers"],label:"1",x:c+20,y:d+20,fill:"darkSlateGray",family:"lineNumber",font:"9pt sans-serif"},{type:"RECTANGLE",name:g.Background,x:c+46,y:d,width:290,height:b.height,family:"background",fill:"white"},{type:"TEXT",name:g.Strings,label:"'text/javascript'",x:c+134,y:d+20,fill:"darkorange",family:"string",font:"9pt sans-serif"},{type:"TEXT",name:g.Foreground,label:"=",x:c+124,y:d+20,fill:"darkSlateGray",family:"text",
font:"9pt sans-serif"},{type:"RECTANGLE",name:g["Current Line"],x:c+46,y:d+87,width:290,height:18,family:"currentLine",fill:"#eaf2fd"},{type:"TEXT",name:g["HTML Attribute"],label:"type",x:c+98,y:d+20,fill:"darkGray",family:"attribute",font:"9pt sans-serif"},{type:"RECTANGLE",name:g["Overview Ruler"],x:c+336,y:d,width:14,height:b.height,family:"overviewRuler",fill:"white"},{type:"TEXT",name:g.Comments,label:"/* comment */",x:c+75,y:d+40,fill:"darkSeaGreen",family:"comment",font:"9pt sans-serif"},{type:"TEXT",
name:g["HTML Tag"],label:"<script",x:c+55,y:d+20,fill:"darkorange",family:"keyword",font:"9pt sans-serif"},{type:"TEXT",name:g["HTML Tag"],label:">",x:c+213,y:d+20,fill:"darkorange",family:"keyword",font:"9pt sans-serif"},{type:"TEXT",name:g.Strings,label:"'Result'",x:c+164,y:d+80,fill:"cornflowerBlue",family:"string",font:"9pt sans-serif"},{type:"TEXT",name:g.Foreground,label:"multiply(a,b){",x:c+120,y:d+60,fill:"darkSlateGray",family:"text",font:"9pt sans-serif"},{type:"TEXT",name:g.Keywords,label:"function",
x:c+75,y:d+60,fill:"darkorange",family:"keyword",font:"9pt sans-serif"},{type:"TEXT",name:g.Keywords,label:"var",x:c+95,y:d+80,fill:"darkorange",family:"keyword",font:"9pt sans-serif"},{type:"TEXT",name:g.Foreground,label:"output = ",x:c+115,y:d+80,fill:"darkSlateGray",family:"text",font:"9pt sans-serif"},{type:"TEXT",name:g.Foreground,label:";",x:c+205,y:d+80,fill:"darkSlateGray",family:"text",font:"9pt sans-serif"},{type:"TEXT",name:g.Keywords,label:"var",x:c+95,y:d+100,fill:"darkorange",family:"keyword",
font:"9pt sans-serif"},{type:"TEXT",name:g.Foreground,label:"result = a*b;",x:c+115,y:d+100,fill:"darkSlateGray",family:"text",font:"9pt sans-serif"},{type:"TEXT",name:g.Keywords,label:"return",x:c+95,y:d+120,fill:"darkorange",family:"keyword",font:"9pt sans-serif"},{type:"TEXT",name:g.Foreground,label:"output + result;",x:c+135,y:d+120,fill:"darkSlateGray",family:"text",font:"9pt sans-serif"},{type:"TEXT",name:g.Foreground,label:"}",x:c+75,y:d+140,fill:"darkSlateGray",family:"text",font:"9pt sans-serif"},
{type:"TEXT",name:g["HTML Tag"],label:"<\/script>",x:c+55,y:d+160,fill:"darkorange",family:"keyword",font:"9pt sans-serif"},{type:"TEXT",name:g["HTML Tag"],label:"<style",x:c+55,y:d+200,fill:"darkorange",family:"keyword",font:"9pt sans-serif"},{type:"TEXT",name:g["HTML Attribute"],label:"type",x:c+95,y:d+200,fill:"darkGray",family:"attribute",font:"9pt sans-serif"},{type:"TEXT",name:g.Foreground,label:"=",x:c+121,y:d+200,fill:"darkSlateGray",family:"text",font:"9pt sans-serif"},{type:"TEXT",name:g.Strings,
label:"'text/css'",x:c+131,y:d+200,fill:"darkorange",family:"string",font:"9pt sans-serif"},{type:"TEXT",name:g["HTML Tag"],label:">",x:c+180,y:d+200,fill:"darkorange",family:"keyword",font:"9pt sans-serif"},{type:"TEXT",name:g["CSS Class Name"],label:".some-class",x:c+75,y:d+220,fill:"darkorange",family:"keyword",font:"9pt sans-serif"},{type:"TEXT",name:g["CSS Class Name"],label:"{",x:c+145,y:d+220,fill:"darkSlateGray",family:"text",font:"9pt sans-serif"},{type:"TEXT",name:g["CSS Attribute"],label:"color:",
x:c+95,y:d+240,fill:"darkSlateGray",family:"text",font:"9pt sans-serif"},{type:"TEXT",name:g["CSS Value"],label:"#123456",x:c+130,y:d+240,fill:"darkSlateGray",family:"string",font:"9pt sans-serif"},{type:"TEXT",name:g["CSS Text"],label:";",x:c+180,y:d+240,fill:"darkSlateGray",family:"text",font:"9pt sans-serif"},{type:"TEXT",name:g["CSS Class Name"],label:"}",x:c+75,y:d+260,fill:"darkSlateGray",family:"text",font:"9pt sans-serif"},{type:"TEXT",name:g["HTML Tag"],label:"</style>",x:c+55,y:d+280,fill:"darkorange",
family:"keyword",font:"9pt sans-serif"},{type:"RECTANGLE",name:g["Annotation Ruler"],x:c,y:d,width:46,height:b.height,family:"annotationRuler",fill:"white"}];for(var a=0;a<16;a++)b.shapes.push({type:"TEXT",name:g["Line Numbers"],label:a+1,x:c+20,y:d+20*a+20,fill:"darkSlateGray",family:"lineNumber",font:"9pt sans-serif"});return b};return{ThemeData:e,getStyles:c}});
define("orion/section",["orion/webui/littlelib","orion/selection","orion/commandRegistry","orion/commonHTMLFragments"],function(g,k,j,e){function c(b,c){var h=this;this._expandImageClass="core-sprite-openarrow";this._collapseImageClass="core-sprite-closedarrow";this._twistieSpriteClass="modelDecorationSprite";if(!c.id)throw Error("Missing required argument: id");this.id=c.id;if(!c.title)throw Error("Missing required argument: title");var d=c.useAuxStyle?["sectionWrapper","sectionWrapperAux","toolComposite"]:
["sectionWrapper","toolComposite"];this.domNode=document.createElement("div");b.appendChild(this.domNode);for(var a=0;a<d.length;a++)this.domNode.classList.add(d[a]);this.domNode.id=c.id;if(c.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===h.titleNode||a.target===h.twistie)&&h._changeExpandedState()},!1),this.domNode.addEventListener("keydown",function(a){a.keyCode===g.KEY.ENTER&&(a.target===h.domNode||a.target===h.titleNode||a.target===h.twistie)&&h._changeExpandedState()},!1);if(c.iconClass){var i=document.createElement("span");i.classList.add("sectionIcon");this.domNode.appendChild(i);(Array.isArray(c.iconClass)?c.iconClass:[c.iconClass]).forEach(function(a){i.classList.add(a)})}this.titleNode=document.createElement("div");
this.titleNode.id=c.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=c.title;if(typeof c.getItemCount==="function")d=document.createElement("div"),d.classList.add("layoutLeft"),d.classList.add("sectionItemCount"),this.domNode.appendChild(d),d.textContent=c.getItemCount(this);this._progressNode=document.createElement("div");this._progressNode.id=
c.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=c.id+"FilterSearchBox";this.domNode.appendChild(d);this._toolActionsNode=document.createElement("div");this._toolActionsNode.id=c.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=c.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=c.id+"SelectionArea";this.selectionNode.classList.add("layoutRight");this.selectionNode.classList.add("sectionActions");
this.domNode.appendChild(this.selectionNode);c.slideout&&(d=e.slideoutHTMLFragment(c.id),a=document.createRange(),a.selectNode(this.domNode),d=a.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);b.appendChild(this._contentParent);c.content&&this.setContent(c.content);
this.hidden=c.hidden;if(typeof c.onExpandCollapse==="function")this._onExpandCollapse=c.onExpandCollapse;this._preferenceService=c.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=c.commandService;this._lastMonitor=0;this._loading={}}function i(b){this._section=b;this._id=++b._lastMonitor}c.prototype={setTitle:function(b){this.titleNode.textContent=b},setContent:function(b){typeof b==="string"?this._contentParent.innerHTML=b:(this._contentParent.innerHTML="",this._contentParent.appendChild(b))},getContentElement:function(){return this._contentParent},createProgressMonitor:function(){return new i(this)},_setMonitorMessage:function(b,c){this._progressNode.style.visibility=
"visible";this._loading[b]=c;var e="",d;for(d in this._loading)e!==""&&(e+="\n"),e+=this._loading[d];this._progressNode.title=e},_monitorDone:function(b){delete this._loading[b];var b="",c;for(c in this._loading)b!==""&&(b+="\n"),b+=this._loading[c];this._progressNode.title=b;if(b==="")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(b,c){var e=this.twistie,d=this.id;e&&(e.classList.add(b?this._expandImageClass:this._collapseImageClass),e.classList.remove(b?this._collapseImageClass:this._expandImageClass));this._preferenceService&&c&&this._preferenceService.getPreferences("/window/views").then(function(a){a.put(d,b)});this._onExpandCollapse&&this._onExpandCollapse(b,this)}};c.prototype.constructor=c;i.prototype={begin:function(b){this.status=b;this._section._setMonitorMessage(this.id,b)},worked:function(b){this.status=
b;this._section._setMonitorMessage(this.id,b)},done:function(b){this.status=b;this._section._monitorDone(this.id)}};i.prototype.constructor=i;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:","${0} files compared. The two folders are identical.":"${0} files compared. The two folders are identical."});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 c(b){this.setOptions(b,!0)}c.prototype={setOptions:function(b,c){if(c)this.options={};if(!this.options)this.options={};b&&Object.keys(b).forEach(function(c){this.options[c]=b[c]}.bind(this))},getOptions:function(){return this.options},initCommands:function(b){var c=this.options.commandSpanId,e=
this.options.commandService;if(e&&c){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 b.type==="twoWay"&&b.options.newFile&&!b.options.newFile.readonly}.bind(this),callback:function(a){a.items.copyToLeft()}}),a=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 b.type==="twoWay"&&b.options.oldFile&&!b.options.oldFile.readonly}.bind(this),callback:function(a){a.items.copyToRight()}}),i=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()}}),
o=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()}}),t=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()}}),s=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)}});e.addCommand(d);e.addCommand(a);e.addCommand(n);e.addCommand(i);e.addCommand(m);e.addCommand(o);e.addCommand(t);e.addCommand(s);e.registerCommandContribution(c,"orion.compare.toggle2Inline",108);e.registerCommandContribution(c,"orion.compare.toggle2TwoWay",109);e.registerCommandContribution(c,"orion.compare.copyToLeft",110,null,!1,new j.KeyBinding(37,!0,!1,!0));
e.registerCommandContribution(c,"orion.compare.copyToRight",111,null,!1,new j.KeyBinding(39,!0,!1,!0));e.registerCommandContribution(c,"orion.compare.nextDiff",112,null,!1,new j.KeyBinding(40,!0));e.registerCommandContribution(c,"orion.compare.prevDiff",113,null,!1,new j.KeyBinding(38,!0));b.options.wordLevelNav?(e.registerCommandContribution(c,"orion.compare.nextChange",114,null,!1,new j.KeyBinding(40,!0,!0)),e.registerCommandContribution(c,"orion.compare.prevChange",115,null,!1,new j.KeyBinding(38,
!0,!0))):(e.registerCommandContribution(c,"orion.compare.nextChange",114,null,!0,new j.KeyBinding(40,!0,!0)),e.registerCommandContribution(c,"orion.compare.prevChange",115,null,!0,new j.KeyBinding(38,!0,!0)))}},renderCommands:function(b){var c=this.options.commandSpanId,h=this.options.commandService;h&&c&&(e.empty(e.node(c)),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),h.renderCommands(c,c,b,b,"tool",null,this.options.gridRenderer.navGridHolder)):(h.renderCommands(c,c,b,b,"tool",null,this.options.gridRenderer.navGridHolder),this.options.gridRenderer.additionalCmdRender(this.options.gridRenderer.navGridHolder)):h.renderCommands(c,c,b,b,"tool",null,this.options.gridRenderer.navGridHolder)):h.renderCommands(c,c,b,b,"tool",null))}};return c}();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 i=0,b=0;b<g.length;b++){var f=g[b][e];f===0&&(f=1);if(c>=i&&c<i+f)return{mapperIndex:b,startFrom:i};if(b===g.length-1)break;i+=g[b][e]}return{mapperIndex:g.length-1,startFrom:i}};k.compareUtils.lookUpLineIndex=function(g,e,c){if(c===0)return 0;for(var i=0,b=0;b<c;b++)i+=g[b][e];return i};k.compareUtils.updateMapper=function(g,e,c,i,
b){if(i!==b&&(i>0||b>0)){var f=k.compareUtils.lookUpMapper(g,e,c);if(!(f.mapperIndex<0)){if(i>0)for(var h=c-f.startFrom,c=f.mapperIndex;c<g.length;c++){h=g[c][e]-h;if(i<=h){g[c][e]-=i;break}g[c][e]-=h;i-=h;h=0}b>0&&(g[f.mapperIndex][e]+=b)}}};k.compareUtils.overlapMapper=function(g,e,c,i,b){g=c+g[e]-1;g<c&&(g=c);b<i&&(b=i);return g<i||b<c?!1:!0};k.compareUtils.findFirstDiff=function(g,e,c,i){for(var b=0,f=null,h=0;h<g.length;h++){if(b>i)break;if(k.compareUtils.overlapMapper(g[h],e,b,c,i)&&(f={mapperIndex:h,
startFrom:b},g[h][2]!==0))break;b+=g[h][e]}return f};k.compareUtils.matchMapper=function(g,e,c,i){if(g.length===0)return c;var b=c+Math.round((i-c)/3),f=k.compareUtils.findFirstDiff(g,e,c,i),h=g[f.mapperIndex][e]===0?f.startFrom:f.startFrom+g[f.mapperIndex][e]-1,d=k.compareUtils.lookUpLineIndex(g,1-e,f.mapperIndex),a=f.startFrom-c;return g[f.mapperIndex][2]===0?d-a:b>=f.startFrom&&b<=h?d-Math.round((i-c)/3):b<f.startFrom?d-a:(g[f.mapperIndex][1-e]===0?d:d+g[f.mapperIndex][1-e]-1)-(h-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,i,b,f){for(var h=0;h<e.length;h++){var d=e[h][0],a=c[e[h][1]];if(a[0]>0){for(var l="",n=0;n<a[0];n++)l=l+i[a[2]-1+n].substring(b)+f;a=g.getLineCount();d>=a&&(d=a-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,e,b){var f=new k;c[e].apply(c,b).then(function(b){f.resolve(b)},function(b){f.reject(b)});return f}function e(c,e){var b=c.getServiceReferences("orion.core.diff"),f,h=b;if(e){h=[];for(f=0;f<b.length;++f)e(b[f])&&h.push(b[f])}var d=[],a=[];for(f=0;f<h.length;++f)d[f]=RegExp(h[f].getProperty("pattern")||".*"),a[f]=c.getService(h[f]);this._getService=function(b){if(b.indexOf("://")===-1){var c=
document.createElement("a");c.href=b;b=c.href}for(c=0;c<d.length;++c)if(d[c].test(b))return a[c];throw g["No Matching DiffService for location:"]+b;}}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,i,b){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 f=0;f<c;f++){var h=this._parseHunkRange(f);h&&this._hunkRanges.push(h)}if(0===this._hunkRanges.length)return{outPutFile:e,
mapper:[]};this._DEBUG&&(console.log("***Diff contents: \n"),this._diffContents.forEach(function(b){console.log(b)}),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(i);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));b||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,i,b){b===i&&e===" "||(i=[i,b-i,"s"],e==="-"?i[2]="r":e==="+"?i[2]="a":e==="c"&&(i[2]="c"),c.push(i))},_createMinusBlock:function(e,c,i){var b=this._oBlocks.length;b===0||e!==this._oBlocks[b-
1][0]?(this._oBlocks.push([e===0?1:e,i]),this._nBlocks.push([c,0,-2])):this._oBlocks[b-1][1]+=i},_createPlusBlock:function(e,c,i,b){var f=this._nBlocks.length;f===0||c!==this._nBlocks[f-1][0]?(this._oBlocks.push([e===0?1:e,0]),this._nBlocks.push([c,i,b])):(this._nBlocks[f-1][1]+=i,this._nBlocks[f-1][2]=b)},_parseHunkBlock:function(e){for(var c=" ",i=this._hunkRanges[e][0]+1,b=e===this._hunkRanges.length-1?this._diffContents.length:this._hunkRanges[e+1][0],f=0,h=0,d=this._hunkRanges[e][1],a=this._hunkRanges[e][3],
g=i,n=i;n<b;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>i&&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]+f;a=this._hunkRanges[e][3]+h;break;case "-":this._createMinusBlock(d,a,this._hunkRanges[e][1]+f-d);break;case "+":this._createPlusBlock(d,a,this._hunkRanges[e][3]+h-a,g)}c=m}switch(m){case "-":f++;break;case "+":h++;break;case " ":f++,h++}}}switch(c){case "-":this._createMinusBlock(d,a,this._hunkRanges[e][1]+f-d);break;case "+":this._createPlusBlock(d,
a,this._hunkRanges[e][3]+h-a,g)}},_detectConflictes:function(e,c){if(e<0)return!1;for(var i=e+c,b=e;b<i;b++){var f=this._diffContents[b];if(f.indexOf("<<<<<")>-1||f.indexOf(">>>>>")>-1)return!0}return!1},_buildMap:function(e){var c=this._oBlocks.length,i=this._oFileContents.length,b=0,f;f=1;for(var h=0;h<c;h++)f=this._oBlocks[h][0]-f,f>0&&(this._deltaMap.push([f,f,0]),b+=f),e&&this._detectConflictes(this._nBlocks[h][2],this._nBlocks[h][1])?this._deltaMap.push([this._nBlocks[h][1],this._oBlocks[h][1],
this._nBlocks[h][2]+1,1]):this._deltaMap.push([this._nBlocks[h][1],this._oBlocks[h][1],this._nBlocks[h][2]+1]),b+=this._oBlocks[h][1],f=this._oBlocks[h][0]+this._oBlocks[h][1];0<i-f&&(this._deltaMap.push([i-f+1,i-f+1,0]),b+=i-f+1);b<i&&(f=i-b,e=this._deltaMap[this._deltaMap.length-1],e[2]===0?(e[0]+=f,e[1]+=f):e[2]===-1?this._deltaMap.push([f,f,0]):this._nNewLineAtEnd===this._oNewLineAtEnd?this._deltaMap.push([f,f,0]):(this._nNewLineAtEnd&&(e[0]+=f),this._oNewLineAtEnd&&(e[1]+=f)))},_buildNewFile:function(){var e=
1,c=!1,i=this._deltaMap.length,b,f;for(b=0;b<i;b++){c=!1;if(this._deltaMap[b][2]===0){for(f=0;f<this._deltaMap[b][0];f++)this._nFileContents.push(this._oFileContents[e+f-1]);c=!0}else if(this._deltaMap[b][2]>0)for(f=0;f<this._deltaMap[b][0];f++)this._nFileContents.push(this._diffContents[this._deltaMap[b][2]+f-1].substring(1));e+=this._deltaMap[b][1]}this._nNewLineAtEnd&&!c&&this._nFileContents.push("")},_parseHRangeBody:function(e,c){if(0<e.indexOf(",")){var i=e.split(","),b=parseInt(i[0],10),i=
parseInt(i[1],10);c.push(b>=0?b:1);c.push(i>=0?i:1)}else b=parseInt(e,10),c.push(b>=0?b: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),i=c.indexOf("@@");if(i<0)return null;var c=c.substring(0,i),i=c.indexOf("-"),b=c.indexOf("+");if(i<0||b<0)return null;e=[e];i<b?(c=c.substring(i+1).split("+"),this._parseHRangeBody(c[0],e),this._parseHRangeBody(c[1],e)):(c=c.substring(b+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,i){this._location=e||"left";this._overview=c||"page";this._rulerStyle=i;this._editor=null;var b=this;this._listener={onModelChanged:function(c){b._onModelChanged(c)}}}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 i=[],b=e;b<c;b++){var f=this.getStyle(b);f&&(i[b]={html:this.getHTML(b),style:f})}return i},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,i,b,f,h){k.CompareRuler.call(this,i,"page",b);this._diffNavigator=e;this._oddStyle=f||{style:{backgroundColor:"white"}};this._evenStyle=h||{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(),
i=this._diffNavigator.getFeeder(this._mapperColumnIndex===0);return!i?"":e===-1?c.getLineCount():i.getLineNumber?(e=i.getLineNumber(e),e===-1?"":e+1):e+1};g.prototype._onModelChanged=function(e){var e=e.start,c=this._editor.getModel(),i=c.getLineCount(),b=(i+"").length;if(this._numOfDigits!==b)this._numOfDigits=b,this._editor.redrawLines(c.getLineAtOffset(e),i,this)};return g}();k.CompareOverviewRuler=function(){function j(e,c,i,b){this._diffNavigator=i;this._onClick=b;k.CompareRuler.call(this,e,
"document",c)}j.prototype=new k.CompareRuler;j.prototype.getStyle=function(e){var c,i;if(e===void 0)c=this._rulerStyle||{},i=c.style||(c.style={}),i.lineHeight="1px",i.fontSize="1px",i.width="14px";else if(c=e!==-1?{styleClass:"annotationOverview breakpoint"}:{},i=c.style||(c.style={}),i.cursor="pointer",i.width="8px",i.left="2px",e>=0){var b;if(this._diffNavigator&&this._diffNavigator.getFeeder())b=this._diffNavigator.getFeeder().getDiffBlocks();else return null;e=g.getAnnotationIndex(b,e);if(e===
-1)return null;b=g.getAnnotationMapperIndex(b,e);var f;f=this._diffNavigator.getMapper();if(b=g.isMapperConflict(f,b))i.border="1px #FF0000 solid";if(e===this._diffNavigator.getCurrentBlockIndex())i.backgroundColor=b?"red":"blue";e=this._diffNavigator.getFeeder().getDiffBlockH(e);b=this._diffNavigator.getFeeder().getOverviewLineCount();if(e<0)return null;f=this._editor.getClientArea();e=Math.floor(f.height*e/b);e<2&&(e=2);i.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,i,b){this._rightIniting=this._rightIniting=this._leftIniting=!0;this._mapper=e;this._leftEditor=c;this._rightEditor=i;this._leftTextView=c.getTextView();
this._rightTextView=i.getTextView();this._diffNavigator=b;this.render()},matchPositionFrom:function(e){var c=e?this._leftTextView:this._rightTextView,i=e?this._rightTextView:this._leftTextView,b=c.getTopIndex(),c=c.getBottomIndex(),e=g.matchMapper(this._mapper,e?0:1,b,c);i.setTopIndex(e)},copyTo:function(e){if(this._diffNavigator.iterator){var c=this._diffNavigator.iterator.cursor();if(c&&(c.type==="word"?!c.copied&&!c.parent.copied:!c.copied)){var i=e?this._rightTextView.getText(c.oldA.start,c.oldA.end):
this._leftTextView.getText(c.newA.start,c.newA.end),b=e?c.newA:c.oldA;(e?this._leftTextView:this._rightTextView).setText(i,b.start,b.end);c.copied=!0}}},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(),i=this._leftTextView.getBottomIndex(),b=this._rightTextView.getTopIndex(),f=this._rightTextView.getBottomIndex();this._leftLineH=
this._leftTextView.getLineHeight();this._rightLineH=this._rightTextView.getLineHeight();for(var h=0,d=0,a=!1,l=0;l<this._mapper.length;l++){if(this._mapper[l][2]!==0)if(g.overlapMapper(this._mapper[l],0,h,c,i)||g.overlapMapper(this._mapper[l],1,d,b,f))this._renderCurve(l,h,d,this._canvasDiv,e,c,i,b,f),a=!0;else if(a)break;h+=this._mapper[l][0];d+=this._mapper[l][1]}e.stroke()}},_renderCurve:function(e,c,i,b,f){var h=this._mapper[e],c=this._leftTextView.getLinePixel(c+h[0]/2)+h[0]%2*this._leftLineH/
3-this._leftTextView.getTopPixel(),i=this._rightTextView.getLinePixel(i+h[1]/2)+h[1]%2*this._rightLineH/3-this._rightTextView.getTopPixel(),b=b.parentNode.clientWidth;e===this._diffNavigator.getCurrentMapperIndex()?(f.stroke(),f.strokeStyle="#000",f.lineWidth=1,f.beginPath(),f.moveTo(0,c),f.bezierCurveTo(b/3,c,b*0.666,i,b,i),f.stroke(),f.strokeStyle="#AAAAAA",f.lineWidth=1,f.beginPath()):(f.moveTo(0,c),f.bezierCurveTo(b/3,c,b*0.666,i,b,i),f.stroke())},onChanged:function(e,c){var i=c?this._rightIniting:
this._leftIniting;if(e.removedLineCount!==e.addedLineCount){var b=c?this._rightTextView:this._leftTextView;i||g.updateMapper(this._mapper,c?1:0,b.getModel().getLineAtOffset(e.start),e.removedLineCount,e.addedLineCount);(e.removedLineCount>0||e.addedLineCount>0)&&this.render()}c?this._rightIniting=!1:this._leftIniting=!1;return i}};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",committerOnTime:"${0} on ${1}",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",trimTrailingWhitespaces:"Trim Trailing Whitespaces",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",viStar:"Search Word Under Cursor",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,i=c,b=e.caseInsensitive;!e.regex&&c&&(i=c.replace(/([\\$\^*\/+?\.\(\)|{}\[\]])/g,"\\$&"),b&&(i=i.replace(/[iI\u0130\u0131]/g,"[Ii\u0130\u0131]")));var f=null,h;if(i){var c=e.reverse,d=e.wrap,a=e.wholeWord,
g=e.start||0,e=e.end,n=e!==null&&e!==void 0,m="";m.indexOf("g")===-1&&(m+="g");b&&m.indexOf("i")===-1&&(m+="i");a&&(i="\\b"+i+"\\b");var j=this._text[0],k,s,r=0;n&&(b=g<e?g:e,j=j.substring(b,g<e?e:g),r=b);var u=RegExp(i,m);if(c)h=function(){var a=null;for(u.lastIndex=0;;){s=u.lastIndex;k=u.exec(j);if(s===u.lastIndex)return null;if(k){if(!(k.index+r<g)){if(!d||a)break;g=j.length+r}a={start:k.index+r,end:u.lastIndex+r}}else break}if(a)g=a.start;return a};else{if(!n)u.lastIndex=g;h=function(){for(;;){s=
u.lastIndex;k=u.exec(j);if(s===u.lastIndex)break;if(k)return{start:k.index+r,end:u.lastIndex+r};if(!(s!==0&&d))break}return null}}f=h()}return{next:function(){var a=f;a&&(f=h());return a},hasNext:function(){return f!==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 i=this.getLineCount();if(!(0<=e&&e<i))return null;var b=this._lineOffsets[e];if(e+1<i){i=this.getText(b,this._lineOffsets[e+1]);if(c)return i;for(var b=
i.length,f;(f=i.charCodeAt(b-1))===10||f===13;)b--;return i.substring(0,b)}else return this.getText(b)},getLineAtOffset:function(e){var c=this.getCharCount();if(!(0<=e&&e<=c))return-1;var i=this.getLineCount();if(e===c)return i-1;var b,f,h=this._lastLineIndex;if(0<=h&&h<i&&(b=this._lineOffsets[h],f=h+1<i?this._lineOffsets[h+1]:c,b<=e&&e<f))return h;for(var d=i,a=-1;d-a>1;)if(h=Math.floor((d+a)/2),b=this._lineOffsets[h],f=h+1<i?this._lineOffsets[h+1]:c,e<=b)d=h;else if(e<f){d=h;break}else a=h;return this._lastLineIndex=
d},getLineCount:function(){return this._lineOffsets.length},getLineDelimiter:function(){return this._lineDelimiter},getLineEnd:function(e,c){var i=this.getLineCount();if(!(0<=e&&e<i))return-1;if(e+1<i){i=this._lineOffsets[e+1];if(c)return i;for(var b=this.getText(Math.max(this._lineOffsets[e],i-2),i),f=b.length,h;(h=b.charCodeAt(f-1))===10||h===13;)f--;return i-(b.length-f)}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 i=0,b=0,f;b<this._text.length;){f=this._text[b].length;if(e<=i+f)break;i+=f;b++}for(var h=i,d=b;b<this._text.length;){f=this._text[b].length;if(c<=i+f)break;i+=f;b++}if(d===b)return this._text[d].substring(e-h,c-i);h=this._text[d].substring(e-h);i=this._text[b].substring(0,c-i);return h+this._text.slice(d+1,b).join("")+i},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 i=this.getLineCount();if(i>1){for(var b=Array(i),f=0;f<i;f++)b[f]=this.getLine(f);this.setText(b.join(this._lineDelimiter))}}},setText:function(e,c,i){e===void 0&&(e="");c===void 0&&(c=0);i===void 0&&(i=this.getCharCount());if(!(c===i&&e==="")){for(var b=this.getLineAtOffset(c),f=this.getLineAtOffset(i),h=c,d=
i-c,a=f-b,g=e.length,n=0,m=this.getLineCount(),j=0,k=0,s=0,r=[];;){j!==-1&&j<=s&&(j=e.indexOf("\r",s));k!==-1&&k<=s&&(k=e.indexOf("\n",s));if(k===-1&&j===-1)break;s=j!==-1&&k!==-1?j+1===k?k+1:(j<k?j:k)+1:j!==-1?j+1:k+1;r.push(c+s);n++}this.onChanging({type:"Changing",text:e,start:h,removedCharCount:d,addedCharCount:g,removedLineCount:a,addedLineCount:n});r.length===0&&(s=this.getLineStart(b),f=f+1<m?this.getLineStart(f+1):this.getCharCount(),c!==s&&(e=this.getText(s,c)+e,c=s),i!==f&&(e+=this.getText(i,
f),i=f));s=g-d;for(f=b+a+1;f<m;f++)this._lineOffsets[f]+=s;if(r.length<5E4)b=[b+1,a].concat(r),Array.prototype.splice.apply(this._lineOffsets,b);else{s=b+1;this._lineOffsets.splice(s,a);for(m=0;m<r.length;m+=5E4)b=[s,0].concat(r.slice(m,Math.min(r.length,m+5E4))),Array.prototype.splice.apply(this._lineOffsets,b),s+=5E4}for(s=m=0;s<this._text.length;){f=this._text[s].length;if(c<=m+f)break;m+=f;s++}b=m;for(r=s;s<this._text.length;){f=this._text[s].length;if(i<=m+f)break;m+=f;s++}f=this._text[s];c=
this._text[r].substring(0,c-b);i=f.substring(i-m);r=[r,s-r+1];c&&r.push(c);e&&r.push(e);i&&r.push(i);Array.prototype.splice.apply(this._text,r);if(this._text.length===0)this._text=[""];this.onChanged({type:"Changed",start:h,removedCharCount:d,addedCharCount:g,removedLineCount:a,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 e=[],b=this._keyBindings,f=0;f<b.length;f++)b[f].actionID===c&&e.push(b[f].keyBinding);return e},getView:function(){return this._view},isActive:function(){return this._view.getKeyModes().indexOf(this)!==-1},
match:function(c){if(c.type==="keydown")switch(c.keyCode){case 16:case 17:case 18:case 91:return}for(var e=this._keyBindingIndex,b=this._matchingKeyBindings||this._keyBindings,f=[],h=0;h<b.length;h++){var d=b[h],a=d.keyBinding.match(c,e);if(a===!0)return this._keyBindingIndex=0,this._matchingKeyBindings=null,d.actionID;else typeof a==="number"&&f.push(d)}if(f.length===0)this._keyBindingIndex=0,this._matchingKeyBindings=null;else return this._keyBindingIndex++,this._matchingKeyBindings=f,"noop"},setKeyBinding:function(c,
e){for(var b=this._keyBindings,f=0;f<b.length;f++){var h=b[f];if(h.keyBinding.equals(c)){e?h.actionID=e:h.predefined?h.actionID="noop":b.splice(f,1);return}}e&&b.push({keyBinding:c,actionID:e})},setView:function(c){this._view=c}};e.prototype=new j;e.prototype.createKeyBindings=function(){var c=g.KeyBinding,e=[];e.push({actionID:"lineUp",keyBinding:new c(38),predefined:!0});e.push({actionID:"lineDown",keyBinding:new c(40),predefined:!0});e.push({actionID:"charPrevious",keyBinding:new c(37),predefined:!0});
e.push({actionID:"charNext",keyBinding:new c(39),predefined:!0});k.isMac?(e.push({actionID:"scrollPageUp",keyBinding:new c(33),predefined:!0}),e.push({actionID:"scrollPageDown",keyBinding:new c(34),predefined:!0}),e.push({actionID:"pageUp",keyBinding:new c(33,null,null,!0),predefined:!0}),e.push({actionID:"pageDown",keyBinding:new c(34,null,null,!0),predefined:!0}),e.push({actionID:"lineStart",keyBinding:new c(37,!0),predefined:!0}),e.push({actionID:"lineEnd",keyBinding:new c(39,!0),predefined:!0}),
e.push({actionID:"wordPrevious",keyBinding:new c(37,null,null,!0),predefined:!0}),e.push({actionID:"wordNext",keyBinding:new c(39,null,null,!0),predefined:!0}),e.push({actionID:"scrollTextStart",keyBinding:new c(36),predefined:!0}),e.push({actionID:"scrollTextEnd",keyBinding:new c(35),predefined:!0}),e.push({actionID:"textStart",keyBinding:new c(38,!0),predefined:!0}),e.push({actionID:"textEnd",keyBinding:new c(40,!0),predefined:!0}),e.push({actionID:"scrollPageUp",keyBinding:new c(38,null,null,null,
!0),predefined:!0}),e.push({actionID:"scrollPageDown",keyBinding:new c(40,null,null,null,!0),predefined:!0}),e.push({actionID:"lineStart",keyBinding:new c(37,null,null,null,!0),predefined:!0}),e.push({actionID:"lineEnd",keyBinding:new c(39,null,null,null,!0),predefined:!0}),e.push({actionID:"lineStart",keyBinding:new c(38,null,null,!0),predefined:!0}),e.push({actionID:"lineEnd",keyBinding:new c(40,null,null,!0),predefined:!0})):(e.push({actionID:"pageUp",keyBinding:new c(33),predefined:!0}),e.push({actionID:"pageDown",
keyBinding:new c(34),predefined:!0}),e.push({actionID:"lineStart",keyBinding:new c(36),predefined:!0}),e.push({actionID:"lineEnd",keyBinding:new c(35),predefined:!0}),e.push({actionID:"wordPrevious",keyBinding:new c(37,!0),predefined:!0}),e.push({actionID:"wordNext",keyBinding:new c(39,!0),predefined:!0}),e.push({actionID:"textStart",keyBinding:new c(36,!0),predefined:!0}),e.push({actionID:"textEnd",keyBinding:new c(35,!0),predefined:!0}));k.isFirefox&&k.isLinux&&(e.push({actionID:"lineUp",keyBinding:new c(38,
!0),predefined:!0}),e.push({actionID:"lineDown",keyBinding:new c(40,!0),predefined:!0}));k.isWindows&&(e.push({actionID:"scrollLineUp",keyBinding:new c(38,!0),predefined:!0}),e.push({actionID:"scrollLineDown",keyBinding:new c(40,!0),predefined:!0}));e.push({actionID:"selectLineUp",keyBinding:new c(38,null,!0),predefined:!0});e.push({actionID:"selectLineDown",keyBinding:new c(40,null,!0),predefined:!0});e.push({actionID:"selectCharPrevious",keyBinding:new c(37,null,!0),predefined:!0});e.push({actionID:"selectCharNext",
keyBinding:new c(39,null,!0),predefined:!0});e.push({actionID:"selectPageUp",keyBinding:new c(33,null,!0),predefined:!0});e.push({actionID:"selectPageDown",keyBinding:new c(34,null,!0),predefined:!0});k.isMac?(e.push({actionID:"selectLineStart",keyBinding:new c(37,!0,!0),predefined:!0}),e.push({actionID:"selectLineEnd",keyBinding:new c(39,!0,!0),predefined:!0}),e.push({actionID:"selectWordPrevious",keyBinding:new c(37,null,!0,!0),predefined:!0}),e.push({actionID:"selectWordNext",keyBinding:new c(39,
null,!0,!0),predefined:!0}),e.push({actionID:"selectTextStart",keyBinding:new c(36,null,!0),predefined:!0}),e.push({actionID:"selectTextEnd",keyBinding:new c(35,null,!0),predefined:!0}),e.push({actionID:"selectTextStart",keyBinding:new c(38,!0,!0),predefined:!0}),e.push({actionID:"selectTextEnd",keyBinding:new c(40,!0,!0),predefined:!0}),e.push({actionID:"selectLineStart",keyBinding:new c(37,null,!0,null,!0),predefined:!0}),e.push({actionID:"selectLineEnd",keyBinding:new c(39,null,!0,null,!0),predefined:!0}),
e.push({actionID:"selectLineStart",keyBinding:new c(38,null,!0,!0),predefined:!0}),e.push({actionID:"selectLineEnd",keyBinding:new c(40,null,!0,!0),predefined:!0})):(k.isLinux&&(e.push({actionID:"selectWholeLineUp",keyBinding:new c(38,!0,!0),predefined:!0}),e.push({actionID:"selectWholeLineDown",keyBinding:new c(40,!0,!0),predefined:!0})),e.push({actionID:"selectLineStart",keyBinding:new c(36,null,!0),predefined:!0}),e.push({actionID:"selectLineEnd",keyBinding:new c(35,null,!0),predefined:!0}),e.push({actionID:"selectWordPrevious",
keyBinding:new c(37,!0,!0),predefined:!0}),e.push({actionID:"selectWordNext",keyBinding:new c(39,!0,!0),predefined:!0}),e.push({actionID:"selectTextStart",keyBinding:new c(36,!0,!0),predefined:!0}),e.push({actionID:"selectTextEnd",keyBinding:new c(35,!0,!0),predefined:!0}));e.push({actionID:"undo",keyBinding:new g.KeyBinding("z",!0),predefined:!0});k.isMac?e.push({actionID:"redo",keyBinding:new g.KeyBinding("z",!0,!0),predefined:!0}):e.push({actionID:"redo",keyBinding:new g.KeyBinding("y",!0),predefined:!0});
e.push({actionID:"deletePrevious",keyBinding:new c(8),predefined:!0});e.push({actionID:"deletePrevious",keyBinding:new c(8,null,!0),predefined:!0});e.push({actionID:"deleteNext",keyBinding:new c(46),predefined:!0});e.push({actionID:"deleteWordPrevious",keyBinding:new c(8,!0),predefined:!0});e.push({actionID:"deleteWordPrevious",keyBinding:new c(8,!0,!0),predefined:!0});e.push({actionID:"deleteWordNext",keyBinding:new c(46,!0),predefined:!0});e.push({actionID:"tab",keyBinding:new c(9),predefined:!0});
e.push({actionID:"shiftTab",keyBinding:new c(9,null,!0),predefined:!0});e.push({actionID:"enter",keyBinding:new c(13),predefined:!0});e.push({actionID:"enter",keyBinding:new c(13,null,!0),predefined:!0});e.push({actionID:"selectAll",keyBinding:new c("a",!0),predefined:!0});e.push({actionID:"toggleTabMode",keyBinding:new c("m",!0),predefined:!0});k.isMac&&(e.push({actionID:"deleteNext",keyBinding:new c(46,null,!0),predefined:!0}),e.push({actionID:"deleteWordPrevious",keyBinding:new c(8,null,null,!0),
predefined:!0}),e.push({actionID:"deleteWordNext",keyBinding:new c(46,null,null,!0),predefined:!0}));e.push({actionID:"toggleWrapMode",keyBinding:new g.KeyBinding("w",!0,!1,!0)});e.push({actionID:"toggleOverwriteMode",keyBinding:new g.KeyBinding(45)});if(!k.isFirefox){var b=k.isMac&&k.isChrome;e.push({actionID:"noop",keyBinding:new c("u",!b,!1,!1,b),predefined:!0});e.push({actionID:"noop",keyBinding:new c("i",!b,!1,!1,b),predefined:!0});e.push({actionID:"noop",keyBinding:new c("b",!b,!1,!1,b),predefined:!0})}k.isFirefox&&
(e.push({actionID:"copy",keyBinding:new c(45,!0),predefined:!0}),e.push({actionID:"paste",keyBinding:new c(45,null,!0),predefined:!0}),e.push({actionID:"cut",keyBinding:new c(46,null,!0),predefined:!0}));k.isMac&&(e.push({actionID:"lineStart",keyBinding:new c("a",!1,!1,!1,!0),predefined:!0}),e.push({actionID:"lineEnd",keyBinding:new c("e",!1,!1,!1,!0),predefined:!0}),e.push({actionID:"lineUp",keyBinding:new c("p",!1,!1,!1,!0),predefined:!0}),e.push({actionID:"lineDown",keyBinding:new c("n",!1,!1,
!1,!0),predefined:!0}),e.push({actionID:"charPrevious",keyBinding:new c("b",!1,!1,!1,!0),predefined:!0}),e.push({actionID:"charNext",keyBinding:new c("f",!1,!1,!1,!0),predefined:!0}),e.push({actionID:"deletePrevious",keyBinding:new c("h",!1,!1,!1,!0),predefined:!0}),e.push({actionID:"deleteNext",keyBinding:new c("d",!1,!1,!1,!0),predefined:!0}),e.push({actionID:"deleteLineEnd",keyBinding:new c("k",!1,!1,!1,!0),predefined:!0}),k.isFirefox?(e.push({actionID:"scrollPageDown",keyBinding:new c("v",!1,
!1,!1,!0),predefined:!0}),e.push({actionID:"deleteLineStart",keyBinding:new c("u",!1,!1,!1,!0),predefined:!0}),e.push({actionID:"deleteWordPrevious",keyBinding:new c("w",!1,!1,!1,!0),predefined:!0})):(e.push({actionID:"pageDown",keyBinding:new c("v",!1,!1,!1,!0),predefined:!0}),e.push({actionID:"centerLine",keyBinding:new c("l",!1,!1,!1,!0),predefined:!0}),e.push({actionID:"enterNoCursor",keyBinding:new c("o",!1,!1,!1,!0),predefined:!0})));return e};return{KeyMode:j,DefaultKeyMode:e}});
define("orion/editor/util",[],function(){return{contains:function(g,k){if(!k)return!1;if(!g.compareDocumentPosition){for(var j=k;j;){if(g===j)return!0;j=j.parentNode}return!1}return g===k||(g.compareDocumentPosition(k)&16)!==0},addEventListener:function(g,k,j,e){typeof g.addEventListener==="function"?g.addEventListener(k,j,e===!0):g.attachEvent("on"+k,j)},removeEventListener:function(g,k,j,e){typeof g.removeEventListener==="function"?g.removeEventListener(k,j,e===!0):g.detachEvent("on"+k,j)}}});
define("orion/editor/textView","i18n!orion/editor/nls/messages,orion/editor/textModel,orion/editor/keyModes,orion/editor/eventTarget,orion/editor/textTheme,orion/editor/util,orion/util".split(","),function(g,k,j,e,c,i,b){function f(a,d,c){if(c){d.className="";for(var c=d.attributes,e=c.length;e-- >0;)(!b.isIE||b.isIE>=9||b.isIE<9&&c[e].specified)&&d.removeAttribute(c[e].name)}if(a){if(a.styleClass)d.className=a.styleClass;if(c=a.style)for(var f in c)c.hasOwnProperty(f)&&(d.style[f]=c[f]);if(a=a.attributes)for(var h in a)a.hasOwnProperty(h)&&
d.setAttribute(h,a[h])}}function h(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 a(b,d){if(b===d)return!0;if(b&&!d||!b&&d)return!1;if(b&&b.constructor===String||d&&d.constructor===String)return!1;if(b instanceof Array||d instanceof Array){if(!(b instanceof Array&&d instanceof Array))return!1;if(b.length!==d.length)return!1;for(var c=0;c<b.length;c++)if(!a(b[c],d[c]))return!1;
return!0}if(!(b instanceof Object)||!(d instanceof Object))return!1;for(c in b)if(b.hasOwnProperty(c)){if(!d.hasOwnProperty(c))return!1;if(!a(b[c],d[c]))return!1}for(c in d)if(!b.hasOwnProperty(c))return!1;return!0}function l(a,b,d){for(var c=0,e=0,f=0,h=a.length;f<h;){c!==-1&&c<=f&&(c=a.indexOf("\r",f));e!==-1&&e<=f&&(e=a.indexOf("\n",f));var g=f,i;if(e===-1&&c===-1){b(a.substring(f));break}c!==-1&&e!==-1?c+1===e?(i=c,f=e+1):(i=c<e?c:e,f=(c<e?c:e)+1):c!==-1?(i=c,f=c+1):(i=e,f=e+1);b(a.substring(g,
i));d()}}function n(a){var b,d,c,e,f=a.ownerDocument.defaultView||a.ownerDocument.parentWindow;if(f.getComputedStyle)a=f.getComputedStyle(a,null),b=a.getPropertyValue("padding-left"),d=a.getPropertyValue("padding-top"),c=a.getPropertyValue("padding-right"),e=a.getPropertyValue("padding-bottom");else if(a.currentStyle)b=a.currentStyle.paddingLeft,d=a.currentStyle.paddingTop,c=a.currentStyle.paddingRight,e=a.currentStyle.paddingBottom;return{left:parseInt(b,10)||0,top:parseInt(d,10)||0,right:parseInt(c,
10)||0,bottom:parseInt(e,10)||0}}function m(a){var b,d,c,e,f=a._trim;if(!f){var f=n(a),h=a.ownerDocument.defaultView||a.ownerDocument.parentWindow;if(h.getComputedStyle)e=h.getComputedStyle(a,null),b=e.getPropertyValue("border-left-width"),d=e.getPropertyValue("border-top-width"),c=e.getPropertyValue("border-right-width"),e=e.getPropertyValue("border-bottom-width");else if(a.currentStyle)b=a.currentStyle.borderLeftWidth,d=a.currentStyle.borderTopWidth,c=a.currentStyle.borderRightWidth,e=a.currentStyle.borderBottomWidth;
b=parseInt(b,10)||0;d=parseInt(d,10)||0;c=parseInt(c,10)||0;e=parseInt(e,10)||0;f.left+=b;f.top+=d;f.right+=c;f.bottom+=e;a._trim=f}return f}function o(a,b,d){this.start=a;this.end=b;this.caret=d}function t(a){this.left=a.left;this.top=a.top;this.right=a.right;this.bottom=a.bottom}function s(a,b,d){this.view=a;this.lineIndex=b;this._lineDiv=d}function r(a){this._init(a||{})}var u=i.addEventListener,w=i.removeEventListener,v=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],e=this.options.curve[1],f=e-c,q=-1,h,i=this;this.interval=this.options.window.setInterval(function(){q=q===-1?(new Date).getTime():q;var g=((new Date).getTime()-q)/a;g<1?(g=b(g),h=c+g*f,d(h)):(d(e),i.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}();o.prototype={clone:function(){return new o(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}};t.prototype={toString:function(){return"{l="+this.left+", t="+this.top+", r="+this.right+", b="+this.bottom+"}"}};s.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(d,c,e){var h=this.view,g=h._model,i=g.getLine(e),l=g.getLineStart(e),n={type:"LineStyle",textView:h,lineIndex:e,lineText:i,lineStart:l};if(i.length<2E3)h.onLineStyle(n);g=c||b.createElement(d.ownerDocument,"div");if(!c||!a(c.viewStyle,n.style)){f(n.style,g,c);if(c)c._trim=null;g.viewStyle=n.style;g.setAttribute("role","presentation")}g.lineIndex=e;e=[];this._createRanges(n.ranges,i,0,i.length,l,{tabOffset:0,ranges:e});i=" ";!h._fullSelection&&b.isIE<9&&(i="\ufeff");
b.isWebkit&&(i="\u200c");n={text:i,style:h._metrics.largestFontStyle,ignoreChars:1};e.length===0||!e[e.length-1].style||e[e.length-1].style.tagName!=="div"?e.push(n):e.splice(e.length-1,0,n);var m,j,k,o,t,i=h=0,s,r;if(c){if(j=c.modelChangedEvent)j.removedLineCount===0&&j.addedLineCount===0?(r=j.start-l,s=j.addedCharCount-j.removedCharCount):r=-1,c.modelChangedEvent=void 0;j=c.firstChild}for(l=0;l<e.length;l++){n=e[l];o=n.text;h+=o.length;m=n.style;if(j)if(t=j.firstChild.data,k=j.viewStyle,t===o&&
a(m,k)){i+=t.length;j._rectsCache=void 0;m=j=j.nextSibling;continue}else for(;j;){if(r!==-1){k=h;k>=r&&(k-=s);t=(t=j.firstChild.data)?t.length:0;if(i+t>k)break;i+=t}k=j.nextSibling;g.removeChild(j);j=k}m=this._createSpan(g,o,m,n.ignoreChars);j?g.insertBefore(m,j):g.appendChild(m);if(c)c.lineWidth=void 0}if(c)for(d=m?m.nextSibling:null;d;)k=d.nextSibling,c.removeChild(d),d=k;else d.appendChild(g);return g},_createRanges:function(b,d,c,e,f,h){if(!(c>e)){if(b)for(var g=0;g<b.length;g++){var i=b[g];if(!(i.end<
f+c)){var l=Math.max(f+c,i.start)-f;if(l>e)break;var n=Math.min(f+e,i.end)-f;if(l<=n){l=Math.max(c,l);n=Math.min(e,n);c<l&&this._createRange(d,c,l,null,h);if(!i.style||!i.style.unmergeable)for(;g+1<b.length&&b[g+1].start-f===n&&a(i.style,b[g+1].style);)i=b[g+1],n=Math.min(f+e,i.end)-f,g++;this._createRange(d,l,n,i.style,h);c=n}}}c<e&&this._createRange(d,c,e,null,h)}},_createRange:function(a,b,d,c,e){if(!(b>d)){var f=this.view._customTabSize;if(f&&f!==8)for(var h=a.indexOf("\t",b);h!==-1&&h<d;){b<
h&&(b={text:a.substring(b,h),style:c},e.ranges.push(b),e.tabOffset+=b.text.length);b=f-e.tabOffset%f;if(b>0){for(var g="\u00a0",i=1;i<b;i++)g+=" ";b={text:g,style:c,ignoreChars:b-1};e.ranges.push(b);e.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},e.ranges.push(b),e.tabOffset+=b.text.length)}},_createSpan:function(a,d,c,e){var h=this.view,g="span";c&&c.tagName&&(g=c.tagName.toLowerCase());var i=g==="a";if(i)a.hasLink=!0;i&&!h._linksVisible&&
(g="span");i=a.ownerDocument;a=b.createElement(a.ownerDocument,g);c&&c.html?(a.innerHTML=c.html,a.ignore=!0):c&&c.node?(a.appendChild(c.node),a.ignore=!0):a.appendChild(i.createTextNode(c&&c.text?c.text:d));f(c,a);if(g==="a"){var l=h._getWindow();u(a,"click",function(a){return h._handleLinkClick(a?a:l.event)},!1)}a.viewStyle=c;if(e)a.ignoreChars=e;return a},_ensureCreated:function(){return this._lineDiv?this._lineDiv:this._createdDiv=this.create(this.view._clientDiv,null)},getBoundingClientRect:function(a,
d){var c=this._ensureCreated(),e=this.view;if(a===void 0)return this._getLineBoundingClientRect(c,!0);var f=e._model,h=c.ownerDocument,g=this.lineIndex,i=null;if(a<f.getLineEnd(g)){g=f.getLineStart(g);for(f=c.firstChild;f;){if(!f.ignore){var l=f.firstChild,n=l.length;f.ignoreChars&&(n-=f.ignoreChars);if(g+n>a){i=a-g;if(l.length===1)i=new t(f.getBoundingClientRect());else if(e._isRangeRects)h=h.createRange(),h.setStart(l,i),h.setEnd(l,i+1),i=new t(h.getBoundingClientRect());else if(b.isIE){if(h=h.body.createTextRange(),
h.moveToElementText(f),h.collapse(),(g=i===0&&b.isIE===8)&&(i=1),h.moveEnd("character",i+1),h.moveStart("character",i),i=new t(h.getBoundingClientRect()),g)i.left=f.getClientRects()[0].left}else{var m=l.data;f.removeChild(l);f.appendChild(h.createTextNode(m.substring(0,i)));var j=b.createElement(h,"span");j.appendChild(h.createTextNode(m.substring(i,i+1)));f.appendChild(j);f.appendChild(h.createTextNode(m.substring(i+1)));i=new t(j.getBoundingClientRect());f.innerHTML="";f.appendChild(l);this._createdDiv||
(h=e._getSelection(),(g<=h.start&&h.start<g+n||g<=h.end&&h.end<g+n)&&e._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}g+=n}f=f.nextSibling}}c=this.getBoundingClientRect();if(!i)e._wrapMode?(e=this.getClientRects(),i=e[e.length-1],i.left=i.right,i.left+=c.left,i.top+=c.top,i.right+=c.left,i.bottom+=c.top):(i=new t(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,e,f;if(!a._rectsCache){d=a.getClientRects();c=Array(d.length);for(f=0;f<d.length;f++)e=c[f]=new t(d[f]),e.left-=b.left,e.top-=b.top,e.right-=b.left,e.bottom-=b.top;a._rectsCache=c}d=a._rectsCache;c=[d.length];for(f=0;f<d.length;f++)c[f]=new t(d[f]);return c},getClientRects:function(a){if(!this.view._wrapMode)return[this.getBoundingClientRect()];for(var b=this._ensureCreated(),
d=[],c=b.firstChild,e,f=b.getBoundingClientRect();c;){if(!c.ignore)for(var h=this._getClientRects(c,f),b=0;b<h.length;b++){var i=h[b],g;if(i.top!==i.bottom){var l=i.top+(i.bottom-i.top)/2;for(g=0;g<d.length;g++)if(e=d[g],e.top<=l&&l<e.bottom)break;if(g===d.length)d.push(i);else{if(i.left<e.left)e.left=i.left;if(i.top<e.top)e.top=i.top;if(i.right>e.right)e.right=i.right;if(i.bottom>e.bottom)e.bottom=i.bottom}}}c=c.nextSibling}return a!==void 0?d[a]:d},_getLineBoundingClientRect:function(a,b){var d=
new t(a.getBoundingClientRect());if(!this.view._wrapMode){d.right=d.left;for(var c=a.lastChild;c&&c.ignoreChars===c.firstChild.length;)c=c.previousSibling;if(c)c=c.getBoundingClientRect(),d.right=c.right+m(a).right}b&&(c=m(a),d.left+=c.left,d.right-=c.right);return d},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,e=c._model,f=this.lineIndex,h=e.getLineStart(f),i=e.getLineEnd(f);if(h===i)return h;var g=this._ensureCreated(),l=this.getBoundingClientRect(),n,m;if(c._wrapMode){n=this.getClientRects();if(d<n[0].top)d=n[0].top;for(var j=
0;j<n.length;j++)if(m=n[j],m.top<=d&&d<m.bottom)break;if(a<m.left)a=m.left;a>m.right&&(a=m.right-1)}else a<0&&(a=0),a>l.right-l.left&&(a=l.right-l.left);var k=g.ownerDocument,j=k.defaultView||k.parentWindow,o=b.isIE?j.screen.logicalXDPI/j.screen.deviceXDPI:1,t=b.isIE?j.screen.logicalYDPI/j.screen.deviceYDPI:1,j=h,s=g.firstChild;a:for(;s;){if(!s.ignore){var r=s.firstChild,g=r.length;s.ignoreChars&&(g-=s.ignoreChars);var u,w,v;n=this._getClientRects(s,l);for(var H=0;H<n.length;H++)if(m=n[H],m.left<=
a&&a<m.right&&(!c._wrapMode||m.top<=d&&d<m.bottom)){var H=m.left+l.left,C;if(b.isIE||c._isRangeRects){for(var k=c._isRangeRects?k.createRange():k.body.createTextRange(),E=g,L=-1;E-L>1;){var Q=Math.floor((E+L)/2);n=L+1;m=Q===g-1&&s.ignoreChars?r.length:Q+1;C=n===0&&b.isIE===8;c._isRangeRects?(k.setStart(r,n),k.setEnd(r,m)):(C&&(n=1),k.moveToElementText(s),k.move("character",n),k.moveEnd("character",m-n));n=k.getClientRects();for(var M=!1,P=0;P<n.length;P++)if(m=n[P],u=(C?H:m.left)*o-l.left,v=m.right*
o-l.left,w=m.top*t-l.top,m=m.bottom*t-l.top,u<=a&&a<v&&(!c._wrapMode||w<=d&&d<m)){M=!0;break}M?E=Q:L=Q}j+=E;n=E;m=E===g-1&&s.ignoreChars?r.length:Math.min(E+1,r.length);c._isRangeRects?(k.setStart(r,n),k.setEnd(r,m)):(k.moveToElementText(s),k.move("character",n),k.moveEnd("character",m-n));n=k.getClientRects();c=!1;n.length>0&&(m=n[0],u=(C?H:m.left)*o-l.left,v=m.right*o-l.left,c=a>u+(v-u)/2);l=j-h;e=e.getLine(f);f=e.charCodeAt(l);55296<=f&&f<=56319&&c?l<e.length&&(f=e.charCodeAt(l+1),56320<=f&&f<=
57343&&(j+=1)):56320<=f&&f<=57343&&!c&&l>0&&(f=e.charCodeAt(l-1),55296<=f&&f<=56319&&(j-=1));c&&j++}else{e=[];for(f=0;f<g;f++)e.push("<span>"),f===g-1?e.push(r.data.substring(f)):e.push(r.data.substring(f,f+1)),e.push("</span>");s.innerHTML=e.join("");for(e=s.firstChild;e;){m=e.getBoundingClientRect();u=m.left-l.left;v=m.right-l.left;if(u<=a&&a<v){a>u+(v-u)/2&&j++;break}j++;e=e.nextSibling}if(!this._createdDiv)s.innerHTML="",s.appendChild(r),l=c._getSelection(),(j<=l.start&&l.start<j+g||j<=l.end&&
l.end<j+g)&&c._updateDOMSelection()}break a}j+=g}s=s.nextSibling}return Math.min(i,Math.max(h,j))},getNextOffset:function(a,d){if(d.unit==="line"){var c=this.view._model,e=c.getLineAtOffset(a);if(d.count>0)return d.count--,c.getLineEnd(e);d.count++;return c.getLineStart(e)}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,b){function d(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 e=this.view._model,f=e.getLineAtOffset(a),h=e.getLine(f),i=e.getLineStart(f),e=e.getLineEnd(f),f=h.length,g=a-i,l,n=b.count<0?-1:1;if(b.unit==="word"||b.unit==="wordend"||b.unit==="wordWS"||b.unit==="wordendWS")for(var m,j,k;b.count!==0;){if(b.count>0){if(g===f)return e;l=h.charCodeAt(g);m=d(l);j=!m&&!c(l);for(g++;g<f;){l=h.charCodeAt(g);if(b.unit!=="wordWS"&&b.unit!=="wordendWS"){k=d(l);if(b.unit==="wordend"){if(!k&&
m)break}else if(k&&!m)break;l=!k&&!c(l)}else l=!c(l);if(b.unit==="wordend"||b.unit==="wordendWS"){if(!l&&j)break}else if(l&&!j)break;j=l;m=k;g++}}else{if(g===0)return i;g--;l=h.charCodeAt(g);m=d(l);for(j=!m&&!c(l);0<g;){l=h.charCodeAt(g-1);if(b.unit!=="wordWS"&&b.unit!=="wordendWS"){k=d(l);if(b.unit==="wordend"){if(k&&!m)break}else if(!k&&m)break;l=!k&&!c(l)}else l=!c(l);if(b.unit==="wordend"||b.unit==="wordendWS"){if(l&&!j)break}else if(!l&&j)break;j=l;m=k;g--}}b.count-=n}else for(;b.count!==0&&
0<=g+n&&g+n<=f;)g+=n,l=h.charCodeAt(g),56320<=l&&l<=57343&&g>0&&(l=h.charCodeAt(g-1),55296<=l&&l<=56319&&(g+=n)),b.count-=n;return i+g},_getNextOffset_IE:function(a,b){var d=this._ensureCreated(),c=this.view._model,e=this.lineIndex,f=0,h;h=c.getLineStart(e);var i=d.ownerDocument,g=b.count<0?-1:1;if(a===c.getLineEnd(e)){for(d=d.lastChild;d&&d.ignoreChars===d.firstChild.length;)d=d.previousSibling;if(!d)return h;f=i.body.createTextRange();f.moveToElementText(d);h=f.text.length;f.moveEnd(b.unit,g);f=
a+f.text.length-h}else if(a===h&&b.count<0)f=h;else for(d=d.firstChild;d;){c=d.firstChild.length;d.ignoreChars&&(c-=d.ignoreChars);if(h+c>a){f=i.body.createTextRange();a===h&&b.count<0?f.moveToElementText(d.previousSibling):(f.moveToElementText(d),f.collapse(),f.moveEnd("character",a-h));h=f.text.length;f.moveEnd(b.unit,g);f=a+f.text.length-h;break}h=c+h;d=d.nextSibling}b.count-=g;return f},destroy:function(){var a=this._createdDiv;if(a)a.parentNode.removeChild(a),this._createdDiv=null}};r.prototype=
{addKeyMode:function(a,b){var d=this._keyModes;b!==void 0?d.splice(b,0,a):d.push(a);a._modeAdded&&a._modeAdded()},addRuler:function(a,b){a.setView(this);var d=this._rulers;if(b!==void 0){var c,e;for(c=0,e=0;c<d.length&&e<b;c++)a.getLocation()===d[c].getLocation()&&e++;d.splice(e,0,a);b=e}else d.push(a);this._createRuler(a,b);this._update()},computeSize:function(){var a=0,d=0,c=this._model,e=this._clientDiv;if(!e)return{width:a,height:d};var f=e.style.width;if(b.isWebkit)e.style.width="0x7fffffffpx";
for(var c=c.getLineCount(),h=0;h<c;h++){var i=this._getLine(h),g=i.getBoundingClientRect(),a=Math.max(a,g.right-g.left);d+=g.bottom-g.top;i.destroy()}if(b.isWebkit)e.style.width=f;e=this._getViewPadding();a+=e.right+e.left+this._metrics.scrollWidth;d+=e.bottom+e.top+this._metrics.scrollWidth;return{width:a,height:d}},convert:function(a,b,d){if(this._clientDiv){var c=this._getScroll(),e=this._getViewPadding(),f=this._viewDiv.getBoundingClientRect();b==="document"&&(a.x!==void 0&&(a.x+=-c.x+f.left+
e.left),a.y!==void 0&&(a.y+=-c.y+f.top+e.top));d==="document"&&(a.x!==void 0&&(a.x+=c.x-f.left-e.left),a.y!==void 0&&(a.y+=c.y-f.top-e.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(),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 b=[],d=this._actions,c;for(c in d)d.hasOwnProperty(c)&&(a||!d[c].defaultHandler)&&b.push(c);return b},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 b=[],d=this._keyModes,c=0;c<d.length;c++)b=b.concat(d[c].getKeyBindings(a));return b},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 b=this._model,a=Math.min(Math.max(0,a),b.getCharCount()),b=b.getLineAtOffset(a),d=this._getLine(b),a=d.getBoundingClientRect(a);d.destroy();d=a.left;b=this._getLinePixel(b)+a.top;return{x:d,y:b}},getNextOffset:function(a,b){var d=new o(a,a,!1);this._doMove(b,d);return d.getCaret()},
getOptions:function(){var a;if(arguments.length===0)a=this._defaultOptions();else if(arguments.length===1){if(a=arguments[0],typeof a==="string")return h(this["_"+a])}else{a={};for(var b in arguments)arguments.hasOwnProperty(b)&&(a[arguments[b]]=void 0)}for(var d in a)a.hasOwnProperty(d)&&(a[d]=h(this["_"+d]));return a},getModel:function(){return this._model},getOffsetAtLocation:function(a,b){if(!this._clientDiv)return 0;var d=this._getLineIndex(b),c=this._getLine(d),d=c.getOffset(a,b-this._getLinePixel(d));
c.destroy();return d},getRulers:function(){return this._rulers.slice(0)},getSelection:function(){var a=this._getSelection();return{start:a.start,end:a.end}},getText:function(a,b){return this._model.getText(a,b)},getTopIndex:function(a){return!this._clientDiv?0:this._getTopIndex(a)},getTopPixel:function(){return!this._clientDiv?0:this._getScroll().y},invokeAction:function(a,b,d){if(this._clientDiv){if(a=this._actions[a]){if(!b&&a.handler&&a.handler(d))return!0;if(a.defaultHandler)return typeof a.defaultHandler(d)===
"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,
b){if(!(this._redrawCount>0))for(var d=this.getRulers(),c=0;c<d.length;c++)this.redrawLines(a,b,d[c])},redrawLines:function(a,b,d){if(!(this._redrawCount>0)&&(a===void 0&&(a=0),b===void 0&&(b=this._model.getLineCount()),a!==b)){var c=this._clientDiv;if(c){if(d)for(c=this._getRulerParent(d).firstChild;c;){if(c._ruler===d)break;c=c.nextSibling}d?c.rulerChanged=!0:this._lineHeight&&this._resetLineHeight(a,b);if(!d||d.getOverview()==="page")for(c=c.firstChild;c;){var e=c.lineIndex;if(a<=e&&e<b)c.lineChanged=
!0;c=c.nextSibling}if(!d&&!this._wrapMode&&a<=this._maxLineIndex&&this._maxLineIndex<b)this._checkMaxLineIndex=this._maxLineIndex,this._maxLineIndex=-1,this._maxLineWidth=0;this._queueUpdate()}}},redrawRange:function(a,b){if(!(this._redrawCount>0)){var d=this._model;a===void 0&&(a=0);b===void 0&&(b=d.getCharCount());var c=d.getLineAtOffset(a),d=d.getLineAtOffset(Math.max(a,b-1))+1;this.redrawLines(c,d)}},removeKeyMode:function(a){for(var b=this._keyModes,d=0;d<b.length;d++)if(b[d]===a){b.splice(d,
1);break}a._modeRemoved&&a._modeRemoved()},removeRuler:function(a){for(var b=this._rulers,d=0;d<b.length;d++)if(b[d]===a){b.splice(d,1);a.setView(null);this._destroyRuler(a);this._update();break}},resize:function(){this._clientDiv&&this._handleResize(null)},setAction:function(a,b,d){if(a){var c=this._actions,e=c[a];e||(e=c[a]={});e.handler=b;if(d!==void 0)e.actionDescription=d}},setKeyBinding:function(a,b){this._keyModes[0].setKeyBinding(a,b)},setCaretOffset:function(a,b,d){var c=this._model.getCharCount(),
a=Math.max(0,Math.min(a,c));this._setSelection(new o(a,a,!1),b===void 0||b,!0,d)},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 b=this._model.getLineCount(),
d=this._model.getCharCount(),c=a.getLineCount(),e=a.getCharCount(),f={type:"ModelChanging",text:a.getText(),start:0,removedCharCount:d,addedCharCount:e,removedLineCount:b,addedLineCount:c};this.onModelChanging(f);this._model=a;f={type:"ModelChanged",start:0,removedCharCount:d,addedCharCount:e,removedLineCount:b,addedLineCount:c};this.onModelChanged(f);this._model.addEventListener("preChanging",this._modelListener.onChanging);this._model.addEventListener("postChanged",this._modelListener.onChanged);
this._reset();this._update()}},setOptions:function(b){var d=this._defaultOptions(),c;for(c in b)if(b.hasOwnProperty(c)){var e=b[c];if(!a(this["_"+c],e)){var f=d[c]?d[c].update:null;f?f.call(this,e):this["_"+c]=h(e)}}},setSelection:function(a,b,d,c){var e=a>b;if(e)var f=a,a=b,b=f;f=this._model.getCharCount();a=Math.max(0,Math.min(a,f));b=Math.max(0,Math.min(b,f));this._setSelection(new o(a,b,e),d===void 0||d,!0,c)},setText:function(a,d,c){var e=d===void 0&&c===void 0;d===void 0&&(d=0);c===void 0&&
(c=this._model.getCharCount());if(e)this._variableLineHeight=!1;this._modifyContent({text:a,start:d,end:c,_code:!0},!e);if(e)this._columnX=-1,this._setSelection(new o(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,b){this._clientDiv&&
(a&&this._updateStyle(),b===void 0||b?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 e=
this;this._getWindow().setTimeout(function(){e._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}},_handleDocKeyUp:function(a){(b.isMac?a.metaKey:a.ctrlKey)||this._setLinksVisible(!1)},_handleKeyUp:function(a){if(!this._ignoreEvent(a)){if(this.isListening("KeyUp")){var b=this._createKeyEvent("KeyUp",a);this.onKeyUp(b);if(b.defaultPrevented){a.preventDefault();
return}}this._handleDocKeyUp(a);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,e=d;if(b.isIE||b.isFirefox&&!this._overlayDiv)e=this._clientDiv;if(this._overlayDiv){if(this._hasFocus)this._ignoreFocus=!0;var f=this;d.setTimeout(function(){f.focus();f._ignoreFocus=!1},0)}this._clickCount===1?(c=this._setSelectionTo(a.clientX,a.clientY,a.shiftKey,!b.isOpera&&
this._hasFocus&&this.isListening("DragStart")))&&this._setGrab(e):(this._isW3CEvents&&this._setGrab(e),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(),e=c-this._lastMouseTime,f=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&&e<=this._clickTime&&f<=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,e=this._getViewPadding(),f=this._viewDiv.getBoundingClientRect(),h=this._getClientWidth(),g=this._getClientHeight(),c=f.left+e.left,i=f.top+e.top,h=f.left+e.left+h,e=f.top+e.top+g;a<i?this._doAutoScroll("up",d,a-i):a>e?this._doAutoScroll("down",
d,a-e):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 b=this._overlayDiv||this._clientDiv,a=a.target?a.target:a.srcElement;a;){if(b===a)return!0;a=a.parentNode}return!1},_createKeyEvent:function(a,b){return{type:a,event:b,preventDefault:function(){this.defaultPrevented=!0}}},_createMouseEvent:function(a,b){var d=this.convert({x:b.clientX,y:b.clientY},
"page","document");return{type:a,event:b,clickCount:this._clickCount,x:d.x,y:d.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,e=0;b.isIE||b.isOpera?e=-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:e=d):b.isMac?(e=a.timeStamp-this._wheelTimeStamp,this._wheelTimeStamp=a.timeStamp,c=a.wheelDeltaX%120!==0?1:e<40?40/(40-e):40,e=a.wheelDeltaY%120!==0?1:e<40?40/(40-e):40,c=
Math.ceil(-a.wheelDeltaX/c),-1<c&&c<0&&(c=-1),0<c&&c<1&&(c=1),e=Math.ceil(-a.wheelDeltaY/e),-1<e&&e<0&&(e=-1),0<e&&e<1&&(e=1)):(c=-a.wheelDeltaX,e=-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,e);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 d=this._parent.clientWidth,c=this._parent.clientHeight;if(this._parentWidth!==d||this._parentHeight!==c){this._parentWidth!==d&&this._wrapMode&&this._resetLineHeight();this._parentWidth=d;this._parentHeight=c;d=b.isIE<9;c=this._calculateMetrics();if(!a(c,this._metrics)){if(this._variableLineHeight)this._variableLineHeight=
!1,this._resetLineHeight();this._metrics=c;d=!0}d?this._queueUpdate():this._update()}},_handleRulerEvent:function(a){for(var b=a.target?a.target:a.srcElement,d=b.lineIndex;b&&!b._ruler;){if(d===void 0&&b.lineIndex!==void 0)d=b.lineIndex;b=b.parentNode}var c=b?b._ruler:null;if(d===void 0&&c&&c.getOverview()==="document"){var d=this._getClientHeight(),e=this._model.getLineCount(),f=this._getViewPadding(),h=this._viewDiv.getBoundingClientRect(),d=Math.floor((a.clientY-h.top-this._metrics.scrollWidth)*
e/(d+f.top+f.bottom-2*this._metrics.scrollWidth));0<=d&&d<e||(d=void 0)}if(c)switch(a.type){case "click":if(c.onClick)c.onClick(d,a);break;case "dblclick":if(c.onDblClick)c.onDblClick(d,a);break;case "mousemove":if(c.onMouseMove)c.onMouseMove(d,a);break;case "mouseover":if(c.onMouseOver)c.onMouseOver(d,a);break;case "mouseout":if(c.onMouseOut){for(e=a.relatedTarget;e&&e!==this._rootDiv;){if(e===b)return;e=e.parentNode}c.onMouseOut(d,a)}}},_handleScroll:function(){var a=this._getScroll(!1),b=this._hScroll,
d=this._vScroll;if(b!==a.x||d!==a.y)this._hScroll=a.x,this._vScroll=a.y,this._commitIME(),this._update(d===a.y),this.onScroll({type:"Scroll",oldValue:{x:b,y:d},newValue:a})},_handleSelectStart:function(a){if(this._ignoreSelect)return a&&a.preventDefault&&a.preventDefault(),!1},_getModelOffset:function(a,b){if(a){var d;d=a.tagName==="DIV"?a:a.parentNode.parentNode;var c=0,e=d.lineIndex;if(a.tagName!=="DIV")for(d=d.firstChild;d;){var f=d.firstChild;if(f===a){d.ignoreChars&&(c-=d.ignoreChars);c+=b;break}d.ignoreChars&&
(c-=d.ignoreChars);c+=f.data.length;d=d.nextSibling}return Math.max(0,c)+this._model.getLineStart(e)}},_updateSelectionFromDOM:function(){var a=this._getWindow().getSelection(),b=this._getModelOffset(a.anchorNode,a.anchorOffset),a=this._getModelOffset(a.focusNode,a.focusOffset);b===void 0||a===void 0||this._setSelection(new o(b,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 e=this._model,f=c.lineIndex,h=e.getLine(f),g=h,i=0,e=e.getLineStart(f);if(d.rangeCount>0)d.getRangeAt(0).deleteContents(),f=c.ownerDocument.createTextNode(a.data),d.getRangeAt(0).insertNode(f),
i=this._getDOMText(c,f),g=i.text,i=i.offset,f.parentNode.removeChild(f);c.lineRemoved=!0;for(c=0;h.charCodeAt(c)===g.charCodeAt(c)&&c<i;)c++;d=h.length-1;for(f=g.length-h.length;h.charCodeAt(d)===g.charCodeAt(d+f)&&d+f>=i+a.data.length;)d--;d++;h=g.substring(c,d+f);c+=e;d+=e;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],e=c.clientX,f=c.clientY;this._touchStartX=e;this._touchStartY=f;if(b.isAndroid&&(f<c.pageY-d.pageYOffset||e<c.pageX-d.pageXOffset))e=c.pageX-d.pageXOffset,f=c.pageY-d.pageYOffset;d=this.convert({x:e,y:f},"page","document");this._lastTouchOffset=this.getOffsetAtLocation(d.x,d.y);this._touchStartTime=a.timeStamp;this._touching=!0}},_handleTouchMove:function(a){var b=
a.touches;if(b.length===1){b=b[0];this._touchCurrentX=b.clientX;this._touchCurrentY=b.clientY;if(!this._touchScrollTimer&&a.timeStamp-this._touchStartTime<200){this._vScrollDiv.style.display="block";if(!this._wrapMode)this._hScrollDiv.style.display="block";var d=this,c=this._getWindow();this._touchScrollTimer=c.setInterval(function(){var a=0,b=0;if(d._touching)a=d._touchStartX-d._touchCurrentX,b=d._touchStartY-d._touchCurrentY,d._touchSpeedX=a/10,d._touchSpeedY=b/10,d._touchStartX=d._touchCurrentX,
d._touchStartY=d._touchCurrentY;else if(Math.abs(d._touchSpeedX)<0.1&&Math.abs(d._touchSpeedY)<0.1){d._vScrollDiv.style.display="none";d._hScrollDiv.style.display="none";c.clearInterval(d._touchScrollTimer);d._touchScrollTimer=null;return}else a=d._touchSpeedX*10,b=d._touchSpeedY*10,d._touchSpeedX*=0.95,d._touchSpeedY*=0.95;d._scrollView(a,b)},10)}this._touchScrollTimer&&a.preventDefault()}},_handleTouchEnd:function(a){if(a.touches.length===0)this._touching=!1},_doAction:function(a){var b,d,c=this._keyModes;
for(d=c.length-1;d>=0;d--)if(b=c[d],typeof b.match==="function"&&(b=b.match(a),b!==void 0))return this.invokeAction(b);return!1},_doMove:function(a,b){var d=this._model,c=b.getCaret(),e=d.getLineAtOffset(c);if(!a.count)a.count=1;for(;a.count!==0;){var f=d.getLineStart(e);if(a.count<0&&c===f)if(e>0)a.unit==="character"&&a.count++,e--,b.extend(d.getLineEnd(e));else break;else if(a.count>0&&c===d.getLineEnd(e))if(e+1<d.getLineCount())a.unit==="character"&&a.count--,e++,b.extend(d.getLineStart(e));else break;
else{var h=!1;a.expandTab&&a.unit==="character"&&(c-f)%this._tabSize===0&&(h=!/[^ ]/.test(d.getText(f,c)));h?(b.extend(c-this._tabSize),a.count+=a.count<0?1:-1):(f=this._getLine(e),b.extend(f.getNextOffset(c,a)),f.destroy())}c=b.getCaret()}return b},_doBackspace:function(a){var b=this._getSelection();if(b.isEmpty()){if(!a.count)a.count=1;a.count*=-1;a.expandTab=this._expandTab;this._doMove(a,b)}this._modifyContent({text:"",start:b.start,end:b.end},!0);return!0},_doCase:function(a){var b=this._getSelection();
this._doMove(a,b);var d=this.getText(b.start,b.end);this._setSelection(b,!0);switch(a.type){case "lower":d=d.toLowerCase();break;case "capitalize":d=d.replace(/(?:^|\s)\S/g,function(a){return a.toUpperCase()});break;case "reverse":a="";for(b=0;b<d.length;b++){var c=d[b],e=c.toLowerCase(),c=e!==c?e:c.toUpperCase();a+=c}d=a;break;default:d=d.toUpperCase()}this._doContent(d);return!0},_doContent:function(a){var b=this._getSelection();if(this._overwriteMode&&b.isEmpty()){var d=this._model,c=d.getLineAtOffset(b.end);
b.end<d.getLineEnd(c)&&(d=this._getLine(c),b.extend(d.getNextOffset(b.getCaret(),{unit:"character",count:1})),d.destroy())}this._modifyContent({text:a,start:b.start,end:b.end,_ignoreDOMSelection:!0},!0)},_doCopy:function(a){var b=this._getSelection();return!b.isEmpty()?this._setClipboardText(this._getBaseText(b.start,b.end),a):!0},_doCursorNext:function(a){var b=this._getSelection();!b.isEmpty()&&!a.select?b.start=b.end:this._doMove(a,b);a.select||b.collapse();this._setSelection(b,!0);return!0},_doCursorPrevious:function(a){var b=
this._getSelection();if(!b.isEmpty()&&!a.select)b.end=b.start;else{if(!a.count)a.count=1;a.count*=-1;this._doMove(a,b)}a.select||b.collapse();this._setSelection(b,!0);return!0},_doCut:function(a){var b=this._getSelection();return!b.isEmpty()?(b=this._getBaseText(b.start,b.end),this._doContent(""),this._setClipboardText(b,a)):!0},_doDelete:function(a){var b=this._getSelection();b.isEmpty()&&this._doMove(a,b);this._modifyContent({text:"",start:b.start,end:b.end},!0);return!0},_doEnd:function(a){var b=
this._getSelection(),d=this._model,c;if(a.ctrl)b.extend(d.getCharCount()),c=function(){};else{var e=b.getCaret(),f=d.getLineAtOffset(e);if(this._wrapMode){var h=this._getLine(f),e=h.getLineIndex(e),e=e===h.getLineCount()-1?d.getLineEnd(f):h.getLineStart(e+1)-1;h.destroy()}else a.count&&a.count>0&&(f=Math.min(f+a.count-1,d.getLineCount()-1)),e=d.getLineEnd(f);b.extend(e)}a.select||b.collapse();this._setSelection(b,!0,!0,c);return!0},_doEnter:function(a){var b=this._model,d=this._getSelection();this._doContent(b.getLineDelimiter());
if(a&&a.noCursor)d.end=d.start,this._setSelection(d,!0);return!0},_doHome:function(a){var b=this._getSelection(),d=this._model,c;if(a.ctrl)b.extend(0),c=function(){};else{var e=b.getCaret(),f=d.getLineAtOffset(e);this._wrapMode?(d=this._getLine(f),e=d.getLineIndex(e),e=d.getLineStart(e),d.destroy()):e=d.getLineStart(f);b.extend(e)}a.select||b.collapse();this._setSelection(b,!0,!0,c);return!0},_doLineDown:function(a){var d=this._model,c=this._getSelection(),e=c.getCaret(),f=d.getLineAtOffset(e),h=
this._getLine(f),g=this._columnX,i=1,l=!1;if(g===-1||a.wholeLine||a.select&&b.isIE)g=a.wholeLine?d.getLineEnd(f+1):e,g=h.getBoundingClientRect(g).left;(e=h.getLineIndex(e))<h.getLineCount()-1?i=h.getClientRects(e+1).top+1:(e=d.getLineCount()-1,l=f===e,a.count&&a.count>0?f=Math.min(f+a.count,e):f++);e=!1;if(l){if(a.select||b.isMac||b.isLinux)c.extend(d.getCharCount()),e=!0}else h.lineIndex!==f&&(h.destroy(),h=this._getLine(f)),c.extend(h.getOffset(g,i)),e=!0;e&&(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(),e=c.getCaret(),f=d.getLineAtOffset(e),h=this._getLine(f),g=this._columnX,i=!1,l;if(g===-1||a.wholeLine||a.select&&b.isIE)g=a.wholeLine?d.getLineStart(f-1):e,g=h.getBoundingClientRect(g).left;(e=h.getLineIndex(e))>0?l=h.getClientRects(e-1).top+1:(i=f===0,i||(a.count&&a.count>0?f=Math.max(f-a.count,0):f--,l=this._getLineHeight(f)-1));e=!1;if(i){if(a.select||b.isMac||b.isLinux)c.extend(0),e=!0}else h.lineIndex!==
f&&(h.destroy(),h=this._getLine(f)),c.extend(h.getOffset(g,l)),e=!0;e&&(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,e=this._getSelection(),f=e.getCaret(),h=c.getLineAtOffset(f),g=c.getLineCount(),i=this._getScroll(),c=this._getClientHeight(),l,n;if(this._lineHeight){l=this._columnX;i=this._getBoundsAtOffset(f);if(l===-1||a.select&&b.isIE)l=i.left;f=this._getLineIndex(i.top+c);
n=this._getLine(f);h=this._getLinePixel(f);f=n.getOffset(l,i.top+c-h);c=n.getBoundingClientRect(f);n.destroy();e.extend(f);a.select||e.collapse();this._setSelection(e,!0,!0,function(){d._columnX=l},c.top+h-i.top);return!0}if(h<g-1){var m=this._getLineHeight(),j=Math.min(g-h-1,Math.floor(c/m)),j=Math.max(1,j);l=this._columnX;if(l===-1||a.select&&b.isIE)n=this._getLine(h),l=n.getBoundingClientRect(f).left,n.destroy();n=this._getLine(h+j);e.extend(n.getOffset(l,0));n.destroy();a.select||e.collapse();
a=g*m;f=i.y+j*m;f+c>a&&(f=a-c);this._setSelection(e,!0,!0,function(){d._columnX=l},f-i.y)}return!0},_doPageUp:function(a){var d=this,c=this._model,e=this._getSelection(),f=e.getCaret(),h=c.getLineAtOffset(f),g=this._getScroll(),i=this._getClientHeight(),l;if(this._lineHeight){l=this._columnX;g=this._getBoundsAtOffset(f);if(l===-1||a.select&&b.isIE)l=g.left;f=this._getLineIndex(g.bottom-i);c=this._getLine(f);h=this._getLinePixel(f);f=c.getOffset(l,g.bottom-i-h);i=c.getBoundingClientRect(f);c.destroy();
e.extend(f);a.select||e.collapse();this._setSelection(e,!0,!0,function(){d._columnX=l},i.top+h-g.top);return!0}if(h>0){var n=this._getLineHeight(),i=Math.max(1,Math.min(h,Math.floor(i/n)));l=this._columnX;if(l===-1||a.select&&b.isIE)c=this._getLine(h),l=c.getBoundingClientRect(f).left,c.destroy();c=this._getLine(h-i);e.extend(c.getOffset(l,this._getLineHeight(h-i)-1));c.destroy();a.select||e.collapse();a=Math.max(0,g.y-i*n);this._setSelection(e,!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 b=a.type,d=this._model,c=d.getLineCount(),a=this._getClientHeight(),e=this._getLineHeight();c*=e;var f=this._getScroll().y,h;switch(b){case "textStart":h=0;break;case "textEnd":h=c-a;break;case "pageDown":h=f+a;break;case "pageUp":h=f-a;break;case "lineDown":h=
f+e;break;case "lineUp":h=f-e;break;case "centerLine":b=this._getSelection(),h=d.getLineAtOffset(b.start),d=(d.getLineAtOffset(b.end)-h+1)*e,h=h*e-a/2+d/2}h!==void 0&&(h=Math.min(Math.max(0,h),c-a),this._scrollViewAnimated(0,h-f,function(){}));return!0},_doSelectAll:function(){var a=this._model,b=this._getSelection();b.setCaret(0);b.extend(a.getCharCount());this._setSelection(b,!1);return!0},_doTab:function(){if(this._tabMode&&!this._readonly){var a="\t";if(this._expandTab)var b=this._model,a=this._getSelection().getCaret(),
d=b.getLineAtOffset(a),b=b.getLineStart(d),a=Array(this._tabSize-(a-b)%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"),e=d.getCaret(),f=a.getLineCount(),h=a.getLineAtOffset(e),g;if(this._autoScrollDir==="up"||this._autoScrollDir==="down")e=this._autoScrollY/this._getLineHeight(),e=e<0?Math.floor(e):Math.ceil(e),g=Math.max(0,Math.min(f-1,h+e));else if(this._autoScrollDir==="left"||this._autoScrollDir==="right")g=this._getLineIndex(c.y),h=this._getLine(h),c.x+=h.getBoundingClientRect(e,!1).left,h.destroy();
g===0&&(b.isMac||b.isLinux)?d.extend(0):g===f-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 b=this._model.getLineCount(),d=0;if(a){for(var a=
0,c=(new Date).getTime(),e=0;d<b;)if(this._lineHeight[d]||(a++,e||(e=d),this._lineHeight[d]=this._calculateLineHeight(d)),d++,(new Date).getTime()-c>100)break;this.redrawRulers(0,b);this._queueUpdate()}a=this._getWindow();if(d!==b){var f=this;this._calculateLHTimer=a.setTimeout(function(){f._calculateLHTimer=null;f._calculateLineHeightTimer(!0)},0)}else if(this._calculateLHTimer)a.clearTimeout(this._calculateLHTimer),this._calculateLHTimer=void 0}},_calculateLineHeight:function(a){var a=this._getLine(a),
b=a.getBoundingClientRect();a.destroy();return Math.max(1,b.bottom-b.top)},_calculateMetrics:function(){var a=this._clientDiv,d=a.ownerDocument,c=b.createElement(d,"div");c.style.lineHeight="normal";var e={type:"LineStyle",textView:this,0:0,lineText:this._model.getLine(0),lineStart:0};this.onLineStyle(e);f(e.style,c);c.style.position="fixed";c.style.left="-1000px";var h=b.createElement(d,"span");h.appendChild(d.createTextNode(" "));c.appendChild(h);var g=b.createElement(d,"span");g.style.fontStyle=
"italic";g.appendChild(d.createTextNode(" "));c.appendChild(g);var i=b.createElement(d,"span");i.style.fontWeight="bold";i.appendChild(d.createTextNode(" "));c.appendChild(i);e=b.createElement(d,"span");e.style.fontWeight="bold";e.style.fontStyle="italic";e.appendChild(d.createTextNode(" "));c.appendChild(e);a.appendChild(c);var l=c.getBoundingClientRect(),h=h.getBoundingClientRect(),g=g.getBoundingClientRect(),i=i.getBoundingClientRect(),e=e.getBoundingClientRect(),h=h.bottom-h.top,g=g.bottom-g.top,
i=i.bottom-i.top,j=e.bottom-e.top,k=0,e=l.bottom-l.top<=0,l=Math.max(1,l.bottom-l.top);g>h&&(k=1);i>g&&(k=2);j>i&&(k=3);var o;if(k!==0){o={style:{}};if((k&1)!==0)o.style.fontStyle="italic";if((k&2)!==0)o.style.fontWeight="bold"}h=m(c);a.removeChild(c);j=n(this._viewDiv);c=b.createElement(d,"div");c.style.position="fixed";c.style.left="-1000px";c.style.paddingLeft=j.left+"px";c.style.paddingTop=j.top+"px";c.style.paddingRight=j.right+"px";c.style.paddingBottom=j.bottom+"px";c.style.width="100px";c.style.height=
"100px";j=b.createElement(d,"div");j.style.width="100%";j.style.height="100%";c.appendChild(j);a.appendChild(c);k=c.getBoundingClientRect();g=j.getBoundingClientRect();i=0;if(!this._singleMode)c.style.overflow="hidden",j.style.height="200px",i=c.clientWidth,c.style.overflow="scroll",i-=c.clientWidth;a.removeChild(c);j={left:g.left-k.left,top:g.top-k.top,right:k.right-g.right,bottom:k.bottom-g.bottom};g=k=0;if(!e&&(this._wrapOffset||this._marginOffset))c=b.createElement(d,"div"),c.style.position="fixed",
c.style.left="-1000px",c.innerHTML=Array(this._wrapOffset+1).join(" "),a.appendChild(c),k=c.getBoundingClientRect(),k=Math.ceil(k.right-k.left),c.innerHTML=Array(this._marginOffset+1).join(" "),g=c.getBoundingClientRect(),g=Math.ceil(g.right-g.left),a.removeChild(c);return{lineHeight:l,largestFontStyle:o,lineTrim:h,viewPadding:j,scrollWidth:i,wrapWidth:k,marginWidth:g,invalid:e}},_cancelAnimation:function(){if(this._animation)this._animation.stop(),this._animation=null},_clearSelection:function(a){var b=
this._getSelection();if(b.isEmpty())return!1;a==="next"?b.start=b.end:b.end=b.start;this._setSelection(b,!0);return!0},_commitIME:function(){if(this._imeOffset!==-1){this._scrollDiv.focus();this._clientDiv.focus();var a=this._model,b=a.getLineAtOffset(this._imeOffset),d=a.getLineStart(b),c=this._getDOMText(this._getLineNode(b)).text,a=a.getLine(b),d=this._imeOffset-d,a=d+c.length-a.length;d!==a&&this._doContent(c.substring(d,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}}}},_createRulerParent:function(a){var d=b.createElement(document,"div");d.className=a;d.tabIndex=-1;d.style.overflow="hidden";d.style.MozUserSelect="none";d.style.WebkitUserSelect="none";d.style.position="absolute";d.style.top="0px";d.style.bottom=
"0px";d.style.cursor="default";d.style.display="none";d.setAttribute("aria-hidden","true");this._rootDiv.appendChild(d);return d},_createRuler:function(a,d){if(this._clientDiv){var c=this._getRulerParent(a);if(c){if(c!==this._marginDiv||this._marginOffset)c.style.display="block";var e=b.createElement(c.ownerDocument,"div");e._ruler=a;e.rulerChanged=!0;e.style.position="relative";e.style.cssFloat="left";e.style.styleFloat="left";e.style.outline="none";if(d===void 0||d<0||d>=c.children.length)c.appendChild(e);
else{for(var f=c.firstChild;f&&d-- >0;)f=f.nextSibling;c.insertBefore(e,f)}}}},_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);this._leftDiv=this._createRulerParent("textviewLeftRuler");
a=b.createElement(d,"div");a.className="textviewScroll";this._viewDiv=a;a.tabIndex=-1;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);(this._rightDiv=this._createRulerParent("textviewRightRuler")).style.right="0px";var e=b.createElement(d,"div");this._scrollDiv=e;e.style.margin="0px";e.style.borderWidth=
"0px";e.style.padding="0px";a.appendChild(e);(this._marginDiv=this._createRulerParent("textviewMarginRuler")).style.zIndex="4";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=e=b.createElement(d,"div"),e.style.position="absolute",e.style.height="1px",e.style.top="-1000px",e.style.background="transparent",
a.appendChild(e);this._setFullSelection(this._fullSelection,!0);a=b.createElement(d,"div");a.className="textviewContent";this._clientDiv=a;a.tabIndex=0;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=
e=b.createElement(d,"div"),e.style.position="absolute",e.style.borderWidth="1px",e.style.borderColor="white",e.style.borderStyle="solid",e.style.borderRadius="4px",e.style.backgroundColor="black",e.style.opacity="0.5",e.style.margin="0px",e.style.padding="0px",e.style.outline="none",e.style.zIndex="3",e.style.width="8px",e.style.display="none",c.appendChild(e),this._hScrollDiv=e=b.createElement(d,"div"),e.style.position="absolute",e.style.borderWidth="1px",e.style.borderColor="white",e.style.borderStyle=
"solid",e.style.borderRadius="4px",e.style.backgroundColor="black",e.style.opacity="0.5",e.style.margin="0px",e.style.padding="0px",e.style.outline="none",e.style.zIndex="3",e.style.height="8px",e.style.display="none",c.appendChild(e);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._setMarginOffset(this._marginOffset,!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},singleMode:{value:!1,update:this._setSingleMode},overwriteMode:{value:!1,update:this._setOverwriteMode},blockCursorVisible:{value:!1,update:this._setBlockCursor},marginOffset:{value:0,update:this._setMarginOffset},wrapOffset:{value:0,update:this._setWrapOffset},
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 b=this._getRulerParent(a);if(b)for(var d=b.firstChild;d;){if(d._ruler===a){d._ruler=void 0;b.removeChild(d);if(b.children.length===0&&(b!==this._marginDiv||!this._marginOffset))b.style.display="none";break}d=d.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._cursorDiv=this._marginDiv=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,b,d){this._autoScrollDir=a;this._autoScrollX=b;this._autoScrollY=d;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 b=this._hasFocus;this._ignoreFocus=!0;b&&a.blur();a.contentEditable=!1;a.contentEditable=!0;b&&a.focus();this._ignoreFocus=
!1}},_getBaseText:function(a,b){var d=this._model;d.getBaseModel&&(a=d.mapOffset(a),b=d.mapOffset(b),d=d.getBaseModel());return d.getText(a,b)},_getBottomIndex:function(a){var b=this._bottomChild;if(a&&this._getClientHeight()>this._getLineHeight()){var a=b.getBoundingClientRect(),d=this._clientDiv.getBoundingClientRect();a.bottom>d.bottom&&(b=this._getLinePrevious(b)||b)}return b.lineIndex},_getBoundsAtOffset:function(a){var b=this._getLine(this._model.getLineAtOffset(a)),a=b.getBoundingClientRect(a),
d=this._getLinePixel(b.lineIndex);a.top+=d;a.bottom+=d;b.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(),e,f,h=this._getWindow(),g=h.clipboardData;if(!g&&a)g=a.clipboardData;if(g)return e=[],f=g.getData(b.isIE?"Text":"text/plain"),
l(f,function(a){e.push(a)},function(){e.push(c)}),f=e.join(""),d&&d(f),f;if(b.isFirefox){this._ignoreFocus=!0;var i=this._clipboardDiv,g=this._rootDiv.ownerDocument;if(!i)this._clipboardDiv=i=b.createElement(g,"div"),i.style.position="fixed",i.style.whiteSpace="pre",i.style.left="-1000px",this._rootDiv.appendChild(i);i.innerHTML="<pre contenteditable=''></pre>";i.firstChild.focus();var n=this,j=function(){var a=n._getTextFromElement(i);i.innerHTML="";e=[];l(a,function(a){e.push(a)},function(){e.push(c)});
return e.join("")},m=!1;this._ignorePaste=!0;if(!b.isLinux||this._lastMouseButton!==2)try{m=g.execCommand("paste",!1,null)}catch(k){m=i.childNodes.length>1||i.firstChild&&i.firstChild.childNodes.length>0}this._ignorePaste=!1;if(!m)return a?(h.setTimeout(function(){n.focus();(f=j())&&d&&d(f);n._ignoreFocus=!1},0),null):(this.focus(),this._ignoreFocus=!1,"");this.focus();this._ignoreFocus=!1;(f=j())&&d&&d(f);return f}return""},_getDOMText:function(a,b){for(var d=a.firstChild,c="",e=0;d;){var f;if(!d.ignore)if(d.ignoreChars){f=
d.lastChild;for(var h=0,g=[],i=-1;f;){for(var l=f.data,n=l.length-1;n>=0;n--){var m=l.substring(n,n+1);h<d.ignoreChars&&(m===" "||m==="\u200c"||m==="\ufeff")?h++:g.push(m==="\u00a0"?"\t":m)}if(b===f)i=g.length;f=f.previousSibling}g=g.reverse().join("");i!==-1&&(e=c.length+g.length-i);c+=g}else for(f=d.firstChild;f;){if(b===f)e=c.length;c+=f.data;f=f.nextSibling}d=d.nextSibling}return{text:c,offset:e}},_getTextFromElement:function(a){var b=a.ownerDocument,d=b.defaultView;if(!d.getSelection)return a.innerText||
a.textContent;b=b.createRange();b.selectNode(a);var a=d.getSelection(),d=[],c;for(c=0;c<a.rangeCount;c++)d.push(a.getRangeAt(c));this._ignoreSelect=!0;a.removeAllRanges();a.addRange(b);b=a.toString();a.removeAllRanges();for(c=0;c<d.length;c++)a.addRange(d[c]);this._ignoreSelect=!1;return b},_getViewPadding:function(){return this._metrics.viewPadding},_getLine:function(a){var b=this._getLineNode(a);return b&&!b.lineChanged&&!b.lineRemoved?b._line:new s(this,a)},_getLineHeight:function(a,b){if(a!==
void 0&&this._lineHeight){var d=this._lineHeight[a];if(d)return d;if(b||b===void 0)return this._lineHeight[a]=this._calculateLineHeight(a)}return this._metrics.lineHeight},_getLineNode:function(a){for(var b=this._clientDiv.firstChild;b;){if(a===b.lineIndex)return b;b=b.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 b=this._getTopIndex(),d=-this._topIndexY+this._getScroll().y;if(a>b)for(;b<a;b++)d+=this._getLineHeight(b);else for(b-=1;b>=a;b--)d-=this._getLineHeight(b);return d}return this._getLineHeight()*a},_getLineIndex:function(a){var b,d=0,c=this._model.getLineCount();if(this._lineHeight){var d=this._getTopIndex(),e=-this._topIndexY+this._getScroll().y;if(a!==e)if(a<e)for(;a<
e&&d>0;)a+=this._getLineHeight(--d);else for(b=this._getLineHeight(d);a-b>=e&&d<c-1;)a-=b,b=this._getLineHeight(++d)}else b=this._getLineHeight(),d=Math.floor(a/b);return Math.max(0,Math.min(c-1,d))},_getRulerParent:function(a){switch(a.getLocation()){case "left":return this._leftDiv;case "right":return this._rightDiv;case "margin":return this._marginDiv}return null},_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 b=this._topChild;if(a&&this._getClientHeight()>this._getLineHeight()){var a=b.getBoundingClientRect(),d=this._getViewPadding(),c=this._viewDiv.getBoundingClientRect();a.top<c.top+d.top&&(b=this._getLineNext(b)||b)}return b.lineIndex},_hookEvents:function(){var a=this;this._modelListener={onChanging:function(b){a._onModelChanging(b)},onChanged:function(b){a._onModelChanged(b)}};this._model.addEventListener("preChanging",this._modelListener.onChanging);this._model.addEventListener("postChanged",
this._modelListener.onChanged);this._themeListener={onChanged:function(){a._setThemeClass(a._themeClass)}};this._theme.addEventListener("ThemeChanged",this._themeListener.onChanged);var d=this._handlers=[],c=this._clientDiv,e=this._viewDiv,f=this._rootDiv,h=this._overlayDiv||c,g=c.ownerDocument,i=this._getWindow(),l=b.isIE?g:i;d.push({target:i,type:"resize",handler:function(b){return a._handleResize(b?b:i.event)}});d.push({target:c,type:"blur",handler:function(b){return a._handleBlur(b?b:i.event)}});
d.push({target:c,type:"focus",handler:function(b){return a._handleFocus(b?b:i.event)}});d.push({target:e,type:"focus",handler:function(){c.focus()}});d.push({target:e,type:"scroll",handler:function(b){return a._handleScroll(b?b:i.event)}});d.push({target:c,type:"textInput",handler:function(b){return a._handleTextInput(b?b:i.event)}});d.push({target:c,type:"keydown",handler:function(b){return a._handleKeyDown(b?b:i.event)}});d.push({target:c,type:"keypress",handler:function(b){return a._handleKeyPress(b?
b:i.event)}});d.push({target:c,type:"keyup",handler:function(b){return a._handleKeyUp(b?b:i.event)}});b.isIE&&d.push({target:g,type:"keyup",handler:function(b){return a._handleDocKeyUp(b?b:i.event)}});d.push({target:c,type:"contextmenu",handler:function(b){return a._handleContextMenu(b?b:i.event)}});d.push({target:c,type:"copy",handler:function(b){return a._handleCopy(b?b:i.event)}});d.push({target:c,type:"cut",handler:function(b){return a._handleCut(b?b:i.event)}});d.push({target:c,type:"paste",
handler:function(b){return a._handlePaste(b?b:i.event)}});if(b.isIOS||b.isAndroid)d.push({target:g,type:"selectionchange",handler:function(b){return a._handleSelectionChange(b?b:i.event)}}),d.push({target:c,type:"touchstart",handler:function(b){return a._handleTouchStart(b?b:i.event)}}),d.push({target:c,type:"touchmove",handler:function(b){return a._handleTouchMove(b?b:i.event)}}),d.push({target:c,type:"touchend",handler:function(b){return a._handleTouchEnd(b?b:i.event)}});else{d.push({target:c,type:"selectstart",
handler:function(b){return a._handleSelectStart(b?b:i.event)}});d.push({target:c,type:"mousedown",handler:function(b){return a._handleMouseDown(b?b:i.event)}});d.push({target:c,type:"mouseover",handler:function(b){return a._handleMouseOver(b?b:i.event)}});d.push({target:c,type:"mouseout",handler:function(b){return a._handleMouseOut(b?b:i.event)}});d.push({target:l,type:"mouseup",handler:function(b){return a._handleMouseUp(b?b:i.event)}});d.push({target:l,type:"mousemove",handler:function(b){return a._handleMouseMove(b?
b:i.event)}});d.push({target:f,type:"mousedown",handler:function(b){return a._handleRootMouseDown(b?b:i.event)}});d.push({target:f,type:"mouseup",handler:function(b){return a._handleRootMouseUp(b?b:i.event)}});d.push({target:h,type:"dragstart",handler:function(b){return a._handleDragStart(b?b:i.event)}});d.push({target:h,type:"drag",handler:function(b){return a._handleDrag(b?b:i.event)}});d.push({target:h,type:"dragend",handler:function(b){return a._handleDragEnd(b?b:i.event)}});d.push({target:h,
type:"dragenter",handler:function(b){return a._handleDragEnter(b?b:i.event)}});d.push({target:h,type:"dragover",handler:function(b){return a._handleDragOver(b?b:i.event)}});d.push({target:h,type:"dragleave",handler:function(b){return a._handleDragLeave(b?b:i.event)}});d.push({target:h,type:"drop",handler:function(b){return a._handleDrop(b?b:i.event)}});d.push({target:this._clientDiv,type:b.isFirefox?"DOMMouseScroll":"mousewheel",handler:function(b){return a._handleMouseWheel(b?b:i.event)}});this._clipDiv&&
d.push({target:this._clipDiv,type:b.isFirefox?"DOMMouseScroll":"mousewheel",handler:function(b){return a._handleMouseWheel(b?b:i.event)}});if(b.isFirefox&&(!b.isWindows||b.isFirefox>=15))(e=i.MutationObserver||i.MozMutationObserver)?(this._mutationObserver=new e(function(b){a._handleDataModified(b)}),this._mutationObserver.observe(c,{subtree:!0,characterData:!0})):d.push({target:this._clientDiv,type:"DOMCharacterDataModified",handler:function(b){return a._handleDataModified(b?b:i.event)}});this._overlayDiv&&
(d.push({target:this._overlayDiv,type:"mousedown",handler:function(b){return a._handleMouseDown(b?b:i.event)}}),d.push({target:this._overlayDiv,type:"mouseover",handler:function(b){return a._handleMouseOver(b?b:i.event)}}),d.push({target:this._overlayDiv,type:"mouseout",handler:function(b){return a._handleMouseOut(b?b:i.event)}}),d.push({target:this._overlayDiv,type:"contextmenu",handler:function(b){return a._handleContextMenu(b?b:i.event)}}));this._isW3CEvents||d.push({target:this._clientDiv,type:"dblclick",
handler:function(b){return a._handleDblclick(b?b:i.event)}})}this._hookRulerEvents(this._leftDiv,d);this._hookRulerEvents(this._rightDiv,d);this._hookRulerEvents(this._marginDiv,d);for(e=0;e<d.length;e++)f=d[e],u(f.target,f.type,f.handler,f.capture)},_hookRulerEvents:function(a,d){if(a){var c=this,e=this._getWindow();b.isIE&&d.push({target:a,type:"selectstart",handler:function(){return!1}});d.push({target:a,type:b.isFirefox?"DOMMouseScroll":"mousewheel",handler:function(a){return c._handleMouseWheel(a?
a:e.event)}});d.push({target:a,type:"click",handler:function(a){c._handleRulerEvent(a?a:e.event)}});d.push({target:a,type:"dblclick",handler:function(a){c._handleRulerEvent(a?a:e.event)}});d.push({target:a,type:"mousemove",handler:function(a){c._handleRulerEvent(a?a:e.event)}});d.push({target:a,type:"mouseover",handler:function(a){c._handleRulerEvent(a?a:e.event)}});d.push({target:a,type:"mouseout",handler:function(a){c._handleRulerEvent(a?a:e.event)}})}},_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(),e;for(e in c)c.hasOwnProperty(e)&&(this["_"+e]=a[e]!==void 0?a[e]:c[e].value);this._keyModes=[];this._rulers=[];this._selection=new o(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,b){if(!this._readonly||a._code)if(a.type="Verify",this.onVerify(a),!(a.text===null||a.text===void 0)){var d=this._model;try{if(a._ignoreDOMSelection)this._ignoreDOMSelection=!0;d.setText(a.text,a.start,a.end)}finally{if(a._ignoreDOMSelection)this._ignoreDOMSelection=!1}b&&(d=
this._getSelection(),d.setCaret(a.start+a.text.length),this._setSelection(d,!0));this.onModify({type:"Modify"})}},_onModelChanged:function(a){a.type="ModelChanged";this.onModelChanged(a);a.type="Changed";var b=a.start,d=a.addedCharCount,c=a.removedCharCount,e=a.addedLineCount,f=a.removedLineCount,h=this._getSelection();h.end>b&&(h.end>b&&h.start<b+c?h.setCaret(b+d):(h.start+=d-c,h.end+=d-c),this._setSelection(h,!1,!1));b=this._model.getLineAtOffset(b);for(d=this._getLineNext();d;){c=d.lineIndex;if(b<=
c&&c<=b+f)b===c&&!d.modelChangedEvent&&!d.lineRemoved?(d.modelChangedEvent=a,d.lineChanged=!0):(d.lineRemoved=!0,d.lineChanged=!1,d.modelChangedEvent=null);if(c>b+f)d.lineIndex=c+e-f,d._line.lineIndex=d.lineIndex;d=this._getLineNext(d)}this._lineHeight&&(a=[b,f].concat(Array(e)),Array.prototype.splice.apply(this._lineHeight,a));if(!this._wrapMode&&b<=this._maxLineIndex&&this._maxLineIndex<=b+f)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,b){if(this._wrapMode||this._variableLineHeight){if(a!==void 0&&b!==void 0)for(var d=a;d<b;d++)this._lineHeight[d]=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 o(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,b,d){var c=this._getWindow();if(d&&this._scrollAnimation){var e=this;this._animation=new v({window:c,duration:this._scrollAnimation,curve:[b,0],onAnimate:function(a){a=b-Math.floor(a);e._scrollView(0,a);b-=a},onEnd:function(){e._animation=null;e._scrollView(a,b);d&&c.setTimeout(d,0)}});this._animation.play()}else this._scrollView(a,b),d&&c.setTimeout(d,0)},_scrollView:function(a,
b){this._ensureCaretVisible=!1;var d=this._viewDiv;a&&(d.scrollLeft+=a);b&&(d.scrollTop+=b)},_setClipboardText:function(a,d){var c,e=this._getWindow(),f=e.clipboardData;if(!f&&d)f=d.clipboardData;if(f&&(c=[],l(a,function(a){c.push(a)},function(){c.push(b.platformDelimiter)}),f.setData(b.isIE?"Text":"text/plain",c.join(""))))return!0;var h=this._parent.ownerDocument,i=b.createElement(h,"pre");i.style.position="fixed";i.style.left="-1000px";l(a,function(a){i.appendChild(h.createTextNode(a))},function(){i.appendChild(b.createElement(h,
"br"))});i.appendChild(h.createTextNode(" "));this._clientDiv.appendChild(i);f=h.createRange();f.setStart(i.firstChild,0);f.setEndBefore(i.lastChild);var g=e.getSelection();g.rangeCount>0&&g.removeAllRanges();g.addRange(f);var n=this,f=function(){i&&i.parentNode===n._clientDiv&&n._clientDiv.removeChild(i);n._updateDOMSelection()},g=!1;this._ignoreCopy=!0;try{g=h.execCommand("copy",!1,null)}catch(m){}this._ignoreCopy=!1;if(!g&&d)return e.setTimeout(f,0),!1;f();return!0},_setDOMSelection:function(a,
d,c,e,f){for(var h,i,g,l,n=0,m=a.firstChild,j,k,o=this._model.getLine(a.lineIndex).length;m;){if(!m.ignore){j=m.firstChild;k=j.length;m.ignoreChars&&(k-=m.ignoreChars);if(n+k>d||n+k>=o){h=j;i=d-n;m.ignoreChars&&k>0&&i===k&&(i+=m.ignoreChars);break}n+=k}m=m.nextSibling}for(var n=0,m=c.firstChild,t=this._model.getLine(c.lineIndex).length;m;){if(!m.ignore){j=m.firstChild;k=j.length;m.ignoreChars&&(k-=m.ignoreChars);if(k+n>e||n+k>=t){g=j;l=e-n;m.ignoreChars&&k>0&&l===k&&(l+=m.ignoreChars);break}n+=k}m=
m.nextSibling}this._setDOMFullSelection(a,d,o,c,e,t);a=this._getWindow();d=this._parent.ownerDocument;if(a.getSelection){c=a.getSelection();a=d.createRange();a.setStart(h,i);a.setEnd(g,l);if(this._hasFocus&&(c.anchorNode!==h||c.anchorOffset!==i||c.focusNode!==g||c.focusOffset!==l||c.anchorNode!==g||c.anchorOffset!==l||c.focusNode!==h||c.focusOffset!==i))this._ignoreSelect=!1,c.rangeCount>0&&c.removeAllRanges(),c.addRange(a),this._ignoreSelect=!0;if(this._cursorDiv&&(a=d.createRange(),f?(a.setStart(h,
i),a.setEnd(h,i)):(a.setStart(g,l),a.setEnd(g,l)),g=a.getClientRects()[0],l=this._cursorDiv.parentNode,h=l.getBoundingClientRect(),g&&h))this._cursorDiv.style.top=g.top-h.top+l.scrollTop+"px",this._cursorDiv.style.left=g.left-h.left+l.scrollLeft+"px"}else if(d.selection&&this._hasFocus)f=d.body,a=b.createElement(d,"div"),f.appendChild(a),f.removeChild(a),a=f.createTextRange(),a.moveToElementText(h.parentNode),a.moveStart("character",i),h=f.createTextRange(),h.moveToElementText(g.parentNode),h.moveStart("character",
l),a.setEndPoint("EndToStart",h),this._ignoreSelect=!1,a.select(),this._ignoreSelect=!0},_setDOMFullSelection:function(a,b,d,c,e){if(this._selDiv1&&(d=this._selDiv1,d.style.width="0px",d.style.height="0px",d=this._selDiv2,d.style.width="0px",d.style.height="0px",d=this._selDiv3,d.style.width="0px",d.style.height="0px",!(a===c&&b===e))){var f=this._model,h=this._getViewPadding(),i=this._clientDiv.getBoundingClientRect(),g=this._viewDiv.getBoundingClientRect(),d=g.left+h.left,l=i.right,h=g.top+h.top,
n=i.bottom,g=i=0;this._clipDiv?(g=this._clipDiv.getBoundingClientRect(),i=g.left-this._clipDiv.scrollLeft):(g=this._rootDiv.getBoundingClientRect(),i=g.left);g=g.top;this._ignoreDOMSelection=!0;var m=(new s(this,a.lineIndex,a)).getBoundingClientRect(f.getLineStart(a.lineIndex)+b,!1),j=m.left,b=(new s(this,c.lineIndex,c)).getBoundingClientRect(f.getLineStart(c.lineIndex)+e,!1),f=b.left;this._ignoreDOMSelection=!1;var k=this._selDiv1,j=Math.min(l,Math.max(d,j)),o=Math.min(n,Math.max(h,m.top)),t=l,e=
Math.min(n,Math.max(h,m.bottom));k.style.left=j-i+"px";k.style.top=o-g+"px";k.style.width=Math.max(0,t-j)+"px";k.style.height=Math.max(0,e-o)+"px";if(a.lineIndex===c.lineIndex)t=Math.min(f,l),k.style.width=Math.max(0,t-j)+"px";else if(m=Math.min(n,Math.max(h,b.top)),f=Math.min(l,Math.max(d,f)),h=Math.min(n,Math.max(h,b.bottom)),n=this._selDiv3,n.style.left=d-i+"px",n.style.top=m-g+"px",n.style.width=Math.max(0,f-d)+"px",n.style.height=Math.max(0,h-m)+"px",Math.abs(a.lineIndex-c.lineIndex)>1)a=this._selDiv2,
a.style.left=d-i+"px",a.style.top=e-g+"px",a.style.width=Math.max(0,l-d)+"px",a.style.height=Math.max(0,m-e)+"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,e=d.viewStyle;e&&e.tagName&&e.tagName.toLowerCase()==="a"&&a.replaceChild(a._line._createSpan(a,d.firstChild.data,e),d);d=c}a=this._getLineNext(a)}this._updateDOMSelection()}},_setSelection:function(a,b,d,c,e){if(a){this._columnX=-1;d===void 0&&(d=!0);var f=this._selection;this._selection=a;b!==!1&&this._showCaret(!1,c,b,
e);d&&this._updateDOMSelection();if(!f.equals(a))this.onSelection({type:"Selection",oldValue:{start:f.start,end:f.end},newValue:{start:a.start,end:a.end}})}},_setSelectionTo:function(a,b,d,c){var e=this._model,f=this._getSelection(),b=this.convert({x:a,y:b},"page","document"),a=this._getLineIndex(b.y);if(this._clickCount===1){e=this._getLine(a);a=e.getOffset(b.x,b.y-this._getLinePixel(a));e.destroy();if(c&&!d&&f.start<=a&&a<f.end)return this._dragOffset=a,!1;f.extend(a);d||f.collapse()}else(this._clickCount&
1)===0?(e=this._getLine(a),a=e.getOffset(b.x,b.y-this._getLinePixel(a)),this._doubleClickSelection?a>=this._doubleClickSelection.start?(d=this._doubleClickSelection.start,c=e.getNextOffset(a,{unit:"wordend",count:1})):(d=e.getNextOffset(a,{unit:"word",count:-1}),c=this._doubleClickSelection.end):(d=e.getNextOffset(a,{unit:"word",count:-1}),c=e.getNextOffset(d,{unit:"wordend",count:1})),e.destroy()):this._doubleClickSelection?(c=e.getLineAtOffset(this._doubleClickSelection.start),a>=c?(d=e.getLineStart(c),
c=e.getLineEnd(a)):(d=e.getLineStart(a),c=e.getLineEnd(c))):(d=e.getLineStart(a),c=e.getLineEnd(a)),f.setCaret(d),f.extend(c);this._setSelection(f,!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 e=c.ownerDocument;this._highlightRGB=b.isWebkit?"transparent":"Highlight";var f=b.createElement(e,"div");this._selDiv1=f;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);var h=b.createElement(e,"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=
e=b.createElement(e,"div");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);if(b.isFirefox&&b.isMac){c=this._getWindow().getComputedStyle(e,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;f.style.background=c;h.style.background=c;e.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},_setMarginOffset:function(a,b){this._marginOffset=a;this._marginDiv.style.display=a?"block":"none";if(!b)this._metrics=this._calculateMetrics(),this._queueUpdate()},_setWrapOffset:function(a,b){this._wrapOffset=a;if(!b)this._metrics=this._calculateMetrics(),
this._queueUpdate()},_setReadOnly:function(a){this._readonly=a;this._clientDiv.setAttribute("aria-readonly",a?"true":"false")},_setSingleMode:function(a,b){this._singleMode=a;this._updateOverflow();this._updateStyle(b)},_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,b){this._themeClass=a;var d="textview",c=this._theme.getThemeClass();c&&(d+=" "+c);this._themeClass&&c!==this._themeClass&&(d+=" "+this._themeClass);
this._rootDiv.className=d;this._updateStyle(b)},_setWrapMode:function(a,b){this._wrapMode=a&&this._wrappable;var d=this._clientDiv;this._wrapMode?(d.style.whiteSpace="pre-wrap",d.style.wordWrap="break-word"):(d.style.whiteSpace="pre",d.style.wordWrap="normal");this._updateOverflow();b||(this.redraw(),this._resetLineWidth());this._resetLineHeight()},_showCaret:function(a,b,d,c){if(this._clientDiv){var e=this._model,f=this._getSelection(),h=this._getScroll(),i=f.getCaret(),g=f.start,l=f.end,n=e.getLineAtOffset(l),
m=Math.max(Math.max(g,e.getLineStart(n)),l-1),e=this._getClientWidth(),n=this._getClientHeight(),j=e/4,k=this._getBoundsAtOffset(i===g?g:m),o=k.left,t=k.right,s=k.top,r=k.bottom;a&&!f.isEmpty()&&(k=this._getBoundsAtOffset(i===l?g:m),k.top===s?i===g?t=o+Math.min(k.right-o,e):o=t-Math.min(t-k.left,e):i===g?r=s+Math.min(k.bottom-s,n):s=r-Math.min(r-k.top,n));a=0;o<h.x&&(a=Math.min(o-h.x,-j));t>h.x+e&&(a=Math.max(t-h.x-e,j));f=0;s<h.y?f=s-h.y:r>h.y+n&&(f=r-h.y-n);c&&(c>0?f>0&&(f=Math.max(f,c)):f<0&&(f=
Math.min(f,c)));if(a!==0||f!==0)return f!==0&&typeof d==="number"&&(d<0&&(d=0),d>1&&(d=1),f+=Math.floor(f>0?d*n:-d*n)),this._scrollViewAnimated(a,f,b),n!==this._getClientHeight()||e!==this._getClientWidth()?this._showCaret():this._ensureCaretVisible=!0,!0;else b&&b();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 b=this._handlers[a];w(b.target,b.type,b.handler)}this._handlers=null;if(this._mutationObserver)this._mutationObserver.disconnect(),this._mutationObserver=null},_updateDOMSelection:function(){if(!(this._redrawCount>0)&&!this._ignoreDOMSelection&&
this._clientDiv){var a=this._getSelection(),b=this._model,d=b.getLineAtOffset(a.start),c=b.getLineAtOffset(a.end),e=this._getLineNext();if(e){var f=this._getLinePrevious(),h;d<e.lineIndex?(h=e,d=0):d>f.lineIndex?(h=f,d=0):(h=this._getLineNode(d),d=a.start-b.getLineStart(d));c<e.lineIndex?b=0:c>f.lineIndex?(e=f,b=0):(e=this._getLineNode(c),b=a.end-b.getLineStart(c));this._setDOMSelection(h,d,e,b,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,c=this._viewDiv;if(d){if(this._metrics.invalid)this._ignoreQueueUpdate=!0,this._updateStyle(),this._ignoreQueueUpdate=!1;var e=this._model,f=this._getScroll(!1),h=this._getViewPadding(),i=e.getLineCount(),g=this._getLineHeight(),l=!1,n=!1,m=!1,j=this._metrics.scrollWidth;if(this._wrapMode)d.style.width=(this._metrics.wrapWidth||this._getClientWidth())+"px";var k,o,t,r,u=0,w=0,v;if(this._lineHeight){for(;w<i;){v=this._getLineHeight(w);if(u+v>f.y)break;
u+=v;w++}k=w;o=Math.max(0,k-1);t=e=f.y-u;k>0&&(e+=this._getLineHeight(k-1))}else r=Math.max(0,f.y)/g,k=Math.floor(r),o=Math.max(0,k-1),e=Math.round((r-o)*g),t=Math.round((r-k)*g);this._topIndexY=t;r=this._parent;var N=r.clientWidth,H=r.clientHeight;if(a){g=0;this._leftDiv&&(k=this._leftDiv.getBoundingClientRect(),g=k.right-k.left);k=this._getClientWidth();r=this._getClientHeight();n=k;if(this._wrapMode){if(this._metrics.wrapWidth)n=this._metrics.wrapWidth}else n=Math.max(this._maxLineWidth,n);for(;w<
i;)v=this._getLineHeight(w,!1),u+=v,w++;i=u}else{r=this._getClientHeight();t=Math.min(k+Math.floor((r+t)/g),i-1);var f=Math.min(t+1,i-1),C;for(v=d.firstChild;v;){C=v.lineIndex;var E=v.nextSibling;if(!(o<=C&&C<=f)||v.lineRemoved||v.lineIndex===-1)this._mouseWheelLine===v?(v.style.display="none",v.lineIndex=-1):d.removeChild(v);v=E}v=this._getLineNext();var E=c.ownerDocument,L=E.createDocumentFragment();for(C=o;C<=f;C++)if(!v||v.lineIndex>C)(new s(this,C)).create(L,null);else{L.firstChild&&(d.insertBefore(L,
v),L=E.createDocumentFragment());if(v&&v.lineChanged)v=(new s(this,C)).create(L,v),v.lineChanged=!1;v=this._getLineNext(v)}L.firstChild&&d.insertBefore(L,v);if(b.isWebkit&&!this._wrapMode)d.style.width="0x7fffffffpx";v=this._getLineNext();C=r+e;for(L=!1;v;){o=v.lineWidth;if(o===void 0)if(E=v._line.getBoundingClientRect(),o=v.lineWidth=Math.ceil(E.right-E.left),E=E.bottom-E.top,this._lineHeight)this._lineHeight[v.lineIndex]=E;else if(g!==0&&E!==0&&Math.ceil(g)!==Math.ceil(E))this._variableLineHeight=
!0,this._lineHeight=[],this._lineHeight[v.lineIndex]=E;if(this._lineHeight&&!L&&(C-=this._lineHeight[v.lineIndex],C<0))t=v.lineIndex,L=!0;if(!this._wrapMode){if(o>=this._maxLineWidth)this._maxLineWidth=o,this._maxLineIndex=v.lineIndex;if(this._checkMaxLineIndex===v.lineIndex)this._checkMaxLineIndex=-1}if(v.lineIndex===k)this._topChild=v;if(v.lineIndex===t)this._bottomChild=v;v=this._getLineNext(v)}if(this._checkMaxLineIndex!==-1&&(C=this._checkMaxLineIndex,this._checkMaxLineIndex=-1,0<=C&&C<i)){g=
new s(this,C);E=g.getBoundingClientRect();o=E.right-E.left;if(o>=this._maxLineWidth)this._maxLineWidth=o,this._maxLineIndex=C;g.destroy()}for(;w<i;)v=this._getLineHeight(w,w<=t),u+=v,w++;i=u;this._updateRuler(this._leftDiv,k,f,H);this._updateRuler(this._rightDiv,k,f,H);this._updateRuler(this._marginDiv,k,f,H);g=0;this._leftDiv&&(k=this._leftDiv.getBoundingClientRect(),g=k.right-k.left);f=0;this._rightDiv&&(f=this._rightDiv.getBoundingClientRect(),f=f.right-f.left);c.style.left=g+"px";c.style.right=
f+"px";f=this._scrollDiv;f.style.height=i+"px";k=this._getClientWidth();if(!this._singleMode&&!this._wrapMode){u=l=r;(w=c.style.overflowX==="scroll")?l+=j:u-=j;v=t=k;(o=c.style.overflowY==="scroll")?t+=j:v-=j;r=l;k=t;i>r&&(m=!0,k=v);this._maxLineWidth>k&&(n=!0,r=u,i>r&&(m=!0,k=v));if(w!==n)c.style.overflowX=n?"scroll":"hidden";if(o!==m)c.style.overflowY=m?"scroll":"hidden";l=w!==n||o!==m}m=k;if(this._wrapMode){if(this._metrics.wrapWidth)m=this._metrics.wrapWidth}else m=Math.max(this._maxLineWidth,
m);n=m;if((!b.isIE||b.isIE>=9)&&this._maxLineWidth>k)m+=h.right+h.left;f.style.width=m+"px";if(this._clipScrollDiv)this._clipScrollDiv.style.width=m+"px";f=this._getScroll(!1)}if(this._vScrollDiv)m=r-8,u=Math.max(15,Math.ceil(Math.min(1,m/(i+h.top+h.bottom))*m)),this._vScrollDiv.style.left=g+k-8+"px",this._vScrollDiv.style.top=Math.floor(Math.max(0,f.y*m/i))+"px",this._vScrollDiv.style.height=u+"px";if(!this._wrapMode&&this._hScrollDiv)m=k-8,u=Math.max(15,Math.ceil(Math.min(1,m/(this._maxLineWidth+
h.left+h.right))*m)),this._hScrollDiv.style.left=g+Math.floor(Math.max(0,Math.floor(f.x*m/this._maxLineWidth)))+"px",this._hScrollDiv.style.top=r-9+"px",this._hScrollDiv.style.width=u+"px";w=f.x;u=this._clipDiv;m=this._overlayDiv;if(t=this._marginDiv)t.style.left=-w+g+this._metrics.marginWidth+h.left+"px",t.style.bottom=(c.style.overflowX==="scroll"?j:0)+"px";if(u){u.scrollLeft=w;u.scrollTop=0;c=g+h.left;j=h.top;a=k;g=r;w=0;t=-e;if(f.x===0)c-=h.left,a+=h.left,w=h.left;f.x+k===n&&(a+=h.right);f.y===
0&&(j-=h.top,g+=h.top,t+=h.top);f.y+r===i&&(g+=h.bottom);u.style.left=c+"px";u.style.top=j+"px";u.style.right=N-a-c+"px";u.style.bottom=H-g-j+"px";d.style.left=w+"px";d.style.top=t+"px";d.style.width=n+"px";d.style.height=r+e+"px";if(m)m.style.left=d.style.left,m.style.top=d.style.top,m.style.width=d.style.width,m.style.height=d.style.height}else{c=w;j=e;N=w+k;H=e+r;c===0&&(c-=h.left);j===0&&(j-=h.top);N===n&&(N+=h.right);f.y+r===i&&(H+=h.bottom);d.style.clip="rect("+j+"px,"+N+"px,"+H+"px,"+c+"px)";
d.style.left=-w+g+h.left+"px";d.style.width=(this._wrapMode||b.isWebkit?n:k+w)+"px";if(!a)d.style.top=-e+h.top+"px",d.style.height=r+e+"px";if(m&&(m.style.clip=d.style.clip,m.style.left=d.style.left,m.style.width=d.style.width,!a))m.style.top=d.style.top,m.style.height=d.style.height}this._updateDOMSelection();if(l)d=this._ensureCaretVisible,this._ensureCaretVisible=!1,d&&this._showCaret(),this._queueUpdate()}}},_updateOverflow:function(){var a=this._viewDiv;this._wrapMode?(a.style.overflowX="hidden",
a.style.overflowY="scroll"):a.style.overflow="hidden"},_updateRuler:function(a,d,c,e){if(a)for(var h=this._parent.ownerDocument,i=this._getLineHeight(),g=this._getViewPadding(),a=a.firstChild;a;){var l=a._ruler,n=i,m=l.getOverview();m==="page"&&(n+=this._topIndexY);a.style.top=-n+"px";a.style.height=e+n+"px";a.rulerChanged&&f(l.getRulerStyle(),a);var j,k=a.firstChild;k?(j=k,k=k.nextSibling):(j=b.createElement(h,"div"),j.style.visibility="hidden",a.appendChild(j));var o;if(a.rulerChanged&&j){n=-1;
if(o=l.getWidestAnnotation())if(f(o.style,j),o.html)j.innerHTML=o.html;j.lineIndex=n;j.style.height=i+g.top+"px"}var t;if(m==="page"){for(l=l.getAnnotations(d,c+1);k;)n=k.lineIndex,o=k.nextSibling,(!(d<=n&&n<=c)||k.lineChanged)&&a.removeChild(k),k=o;k=a.firstChild.nextSibling;t=h.createDocumentFragment();for(n=d;n<=c;n++)if(!k||k.lineIndex>n){j=b.createElement(h,"div");if(o=l[n]){f(o.style,j);if(o.html)j.innerHTML=o.html;j.annotation=o}j.lineIndex=n;j.style.height=this._getLineHeight(n)+"px";t.appendChild(j)}else if(t.firstChild&&
(a.insertBefore(t,k),t=h.createDocumentFragment()),k)k=k.nextSibling;t.firstChild&&a.insertBefore(t,k)}else{o=this._getClientHeight();n=this._model.getLineCount();k=o+g.top+g.bottom-2*this._metrics.scrollWidth;m=i*n<k?i:k/n;if(a.rulerChanged){for(o=a.childNodes.length;o>1;)a.removeChild(a.lastChild),o--;l=l.getAnnotations(0,n);t=h.createDocumentFragment();for(var s in l)if(n=s>>>0,!(n<0)){j=b.createElement(h,"div");o=l[s];f(o.style,j);j.style.position="absolute";j.style.top=this._metrics.scrollWidth+
i+Math.floor(n*m)+"px";if(o.html)j.innerHTML=o.html;j.annotation=o;j.lineIndex=n;t.appendChild(j)}a.appendChild(t)}else if(a._oldTrackHeight!==k)for(j=a.firstChild?a.firstChild.nextSibling:null;j;)j.style.top=this._metrics.scrollWidth+i+Math.floor(j.lineIndex*m)+"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,i=this._projections;e._lineIndex=c.getLineAtOffset(e.start);e._lineCount=c.getLineAtOffset(e.end)-e._lineIndex;var b=e.text;b||(b="");e._model=typeof b==="string"?new g.TextModel(b,c.getLineDelimiter()):b;var c=this.mapOffset(e.start,!0),b=e.end-e.start,f=e._lineCount,h=e._model.getCharCount(),
d=e._model.getLineCount()-1;this.onChanging({type:"Changing",text:e._model.getText(),start:c,removedCharCount:b,addedCharCount:h,removedLineCount:f,addedLineCount:d});var a=this._binarySearch(i,e.start);i.splice(a,0,e);this.onChanged({type:"Changed",start:c,removedCharCount:b,addedCharCount:h,removedLineCount:f,addedLineCount:d})}},getProjections:function(){return this._projections.slice(0)},getBaseModel:function(){return this._model},mapOffset:function(e,c){var i=this._projections,b=0,f,h;if(c){for(f=
0;f<i.length;f++){h=i[f];if(h.start>e)break;if(h.end>e)return-1;b+=h._model.getCharCount()-(h.end-h.start)}return e+b}for(f=0;f<i.length;f++){h=i[f];if(h.start>e-b)break;var d=h._model.getCharCount();if(h.start+d>e-b)return-1;b+=d-(h.end-h.start)}return e-b},removeProjection:function(e){var c,i=0;for(c=0;c<this._projections.length;c++){var b=this._projections[c];if(b===e){e=b;break}i+=b._model.getCharCount()-(b.end-b.start)}if(c<this._projections.length){var b=this._model,i=e.start+i,f=e.end-e.start,
h=e._lineCount,d=e._model.getCharCount(),a=e._model.getLineCount()-1;this.onChanging({type:"Changing",text:b.getText(e.start,e.end),start:i,removedCharCount:d,addedCharCount:f,removedLineCount:a,addedLineCount:h});this._projections.splice(c,1);this.onChanged({type:"Changed",start:i,removedCharCount:d,addedCharCount:f,removedLineCount:a,addedLineCount:h})}},_binarySearch:function(e,c){for(var i=e.length,b=-1,f;i-b>1;)f=Math.floor((i+b)/2),c<=e[f].start?i=f:b=f;return i},getCharCount:function(){for(var e=
this._model.getCharCount(),c=this._projections,i=0;i<c.length;i++){var b=c[i];e+=b._model.getCharCount()-(b.end-b.start)}return e},getLine:function(e,c){if(e<0)return null;var i=this._model,b=this._projections,f=0,h=[],d=0,a,g,n;for(a=0;a<b.length;a++){n=b[a];if(n._lineIndex>=e-f)break;g=n._model.getLineCount()-1;if(n._lineIndex+g>=e-f)if(d=e-(n._lineIndex+f),d<g)return n._model.getLine(d,c);else h.push(n._model.getLine(g));d=n.end;f+=g-n._lineCount}for(d=Math.max(d,i.getLineStart(e-f));a<b.length;a++){n=
b[a];if(n._lineIndex>e-f)break;h.push(i.getText(d,n.start));g=n._model.getLineCount()-1;if(n._lineIndex+g>e-f)return h.push(n._model.getLine(0,c)),h.join("");h.push(n._model.getText());d=n.end;f+=g-n._lineCount}b=i.getLineEnd(e-f,c);d<b&&h.push(i.getText(d,b));return h.join("")},getLineAtOffset:function(e){for(var c=this._model,i=this._projections,b=0,f=0,h=0;h<i.length;h++){var d=i[h];if(d.start>e-b)break;var a=d._model.getCharCount();if(d.start+a>e-b){i=e-(d.start+b);f+=d._model.getLineAtOffset(i);
b+=i;break}f+=d._model.getLineCount()-1-d._lineCount;b+=a-(d.end-d.start)}return c.getLineAtOffset(e-b)+f},getLineCount:function(){for(var e=this._projections,c=this._model.getLineCount(),i=0;i<e.length;i++){var b=e[i];c+=b._model.getLineCount()-1-b._lineCount}return c},getLineDelimiter:function(){return this._model.getLineDelimiter()},getLineEnd:function(e,c){if(e<0)return-1;for(var i=this._model,b=this._projections,f=0,h=0,d=0;d<b.length;d++){var a=b[d];if(a._lineIndex>e-f)break;var g=a._model.getLineCount()-
1;if(a._lineIndex+g>e-f)return a._model.getLineEnd(e-(a._lineIndex+f),c)+a.start+h;h+=a._model.getCharCount()-(a.end-a.start);f+=g-a._lineCount}return i.getLineEnd(e-f,c)+h},getLineStart:function(e){if(e<0)return-1;for(var c=this._model,i=this._projections,b=0,f=0,h=0;h<i.length;h++){var d=i[h];if(d._lineIndex>=e-b)break;var a=d._model.getLineCount()-1;if(d._lineIndex+a>=e-b)return d._model.getLineStart(e-(d._lineIndex+b))+d.start+f;f+=d._model.getCharCount()-(d.end-d.start);b+=a-d._lineCount}return c.getLineStart(e-
b)+f},getText:function(e,c){e===void 0&&(e=0);var i=this._model,b=this._projections,f=0,h=[],d,a,g;for(d=0;d<b.length;d++){a=b[d];if(a.start>e-f)break;g=a._model.getCharCount();if(a.start+g>e-f)if(c!==void 0&&a.start+g>c-f)return a._model.getText(e-(a.start+f),c-(a.start+f));else h.push(a._model.getText(e-(a.start+f))),e=a.end+f+g-(a.end-a.start);f+=g-(a.end-a.start)}var n=e-f;if(c!==void 0){for(;d<b.length;d++){a=b[d];if(a.start>c-f)break;h.push(i.getText(n,a.start));g=a._model.getCharCount();if(a.start+
g>c-f)return h.push(a._model.getText(0,c-(a.start+f))),h.join("");h.push(a._model.getText());n=a.end;f+=g-(a.end-a.start)}h.push(i.getText(n,c-f))}else{for(;d<b.length;d++)a=b[d],h.push(i.getText(n,a.start)),h.push(a._model.getText()),n=a.end;h.push(i.getText(n))}return h.join("")},_onChanging:function(e,c,g,b,f,h){for(var d=this._model,a=this._projections,l,n=0,m,j=c+g;l<a.length;l++){g=a[l];if(g.start>c)break;n+=g._model.getCharCount()-(g.end-g.start)}c+=n;for(var k=l;l<a.length;l++){g=a[l];if(g.start>
j)break;n+=g._model.getCharCount()-(g.end-g.start);m+=g._model.getLineCount()-1-g._lineCount}g=j+n;n=l;this.onChanging(c,g-c,b,f+m,h);a.splice(a,n-k);for(e=e.length-(g-c);l<a.length;l++)g=a[l],g.start+=e,g.end+=e,g._lineIndex=d.getLineAtOffset(g.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,g){e===void 0&&(e="");c===void 0&&(c=0);var b=c,f=g,h=this._model,
d=this._projections,a=0,l=0,n,m,j,k,s,r=0;for(n=0;n<d.length;n++){m=d[n];if(m.start>c-a)break;j=m._model.getCharCount();if(m.start+j>c-a)if(g!==void 0&&m.start+j>g-a){m._model.setText(e,c-(m.start+a),g-(m.start+a));return}else r=m._model.getLineCount()-1-m._model.getLineAtOffset(c-(m.start+a)),k={projection:m,start:c-(m.start+a)},c=m.end+a+j-(m.end-m.start);l+=m._model.getLineCount()-1-m._lineCount;a+=j-(m.end-m.start)}c-=a;var u=n,r=h.getLineAtOffset(c)+l-r;if(g!==void 0)for(;n<d.length;n++){m=d[n];
if(m.start>g-a)break;j=m._model.getCharCount();if(m.start+j>g-a){l+=m._model.getLineAtOffset(g-(m.start+a));j=g-(m.start+a);g=m.end+a;s={projection:m,end:j};break}l+=m._model.getLineCount()-1-m._lineCount;a+=j-(m.end-m.start)}else{for(;n<d.length;n++)m=d[n],l+=m._model.getLineCount()-1-m._lineCount,a+=m._model.getCharCount()-(m.end-m.start);g=f=h.getCharCount()+a}g-=a;m=h.getLineAtOffset(g)+l;f-=b;for(var l=m-r,r=e.length,w=j=m=a=0;;){m!==-1&&m<=w&&(m=e.indexOf("\r",w));j!==-1&&j<=w&&(j=e.indexOf("\n",
w));if(j===-1&&m===-1)break;w=m!==-1&&j!==-1?m+1===j?j+1:(m<j?m:j)+1:m!==-1?m+1:j+1;a++}this.onChanging({type:"Changing",text:e,start:b,removedCharCount:f,addedCharCount:r,removedLineCount:l,addedLineCount:a});h.setText(e,c,g);if(k)m=k.projection,m._model.setText("",k.start);if(s)m=s.projection,m._model.setText("",0,s.end),m.start=m.end,m._lineCount=0;d.splice(u,n-u);for(e=e.length-(g-c);n<d.length;n++)m=d[n],m.start+=e,m.end+=e,m._lineIndex=h.getLineAtOffset(m.start);this.onChanged({type:"Changed",
start:b,removedCharCount:f,addedCharCount:r,removedLineCount:l,addedLineCount:a})}};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/editor/util,orion/util".split(","),function(g,k,j,e,c,i){function b(b){this._view=b;this._fadeDelay=500;this._hideDelay=200;this._showDelay=500;this._autoHideDelay=5E3;this._create(b.getOptions("parent").ownerDocument)}b.getTooltip=function(c){if(!c._tooltip)c._tooltip=new b(c);return c._tooltip};b.prototype={_create:function(b){if(!this._tooltipDiv){var e=
this._tooltipDiv=i.createElement(b,"div");e.tabIndex=0;e.className="textviewTooltip";e.setAttribute("aria-live","assertive");e.setAttribute("aria-atomic","true");var d=this._tooltipContents=i.createElement(b,"div");e.appendChild(d);b.body.appendChild(e);var a=this;c.addEventListener(e,"mouseover",function(){if(a._hideDelay){var b=a._getWindow();if(a._delayedHideTimeout)b.clearTimeout(a._delayedHideTimeout),a._delayedHideTimeout=null;if(a._hideTimeout)b.clearTimeout(a._hideTimeout),a._hideTimeout=
null;a._nextTarget=null}},!1);c.addEventListener(e,"mouseout",function(b){b=b.relatedTarget||b.toElement;b===e||a._hasFocus()||(!b||!c.contains(e,b))&&a._hide()},!1);c.addEventListener(e,"keydown",function(b){b.keyCode===27&&a._hide()},!1);c.addEventListener(b,"mousedown",this._mouseDownHandler=function(b){a.isVisible()&&(c.contains(e,b.target||b.srcElement)||a._hide())},!0);this._view.addEventListener("Destroy",function(){a.destroy()});this._hide()}},_getWindow:function(){var b=this._tooltipDiv.ownerDocument;
return b.defaultView||b.parentWindow},destroy:function(){if(this._tooltipDiv){this._hide();var b=this._tooltipDiv.parentNode;b&&b.removeChild(this._tooltipDiv);c.removeEventListener(this._tooltipDiv.ownerDocument,"mousedown",this._mouseDownHandler,!0);this._tooltipDiv=null}},_hasFocus:function(){var b=this._tooltipDiv;return!b?!1:c.contains(b,b.ownerDocument.activeElement)},hide:function(b){if(b===void 0)b=this._hideDelay;var c=this._getWindow();if(this._delayedHideTimeout)c.clearTimeout(this._delayedHideTimeout),
this._delayedHideTimeout=null;var d=this;b?d._delayedHideTimeout=c.setTimeout(function(){d._delayedHideTimeout=null;d._hide();d.setTarget(d._nextTarget,0)},b):(d._hide(),d.setTarget(d._nextTarget,0))},_hide:function(){var b=this._tooltipDiv;if(b){this._hasFocus()&&this._view.focus();if(this._contentsView)this._contentsView.destroy(),this._contentsView=null;if(this._tooltipContents)this._tooltipContents.innerHTML="";b.style.visibility="hidden";b=this._getWindow();if(this._showTimeout)b.clearTimeout(this._showTimeout),
this._showTimeout=null;if(this._delayedHideTimeout)b.clearTimeout(this._delayedHideTimeout),this._delayedHideTimeout=null;if(this._hideTimeout)b.clearTimeout(this._hideTimeout),this._hideTimeout=null;if(this._fadeTimeout)b.clearInterval(this._fadeTimeout),this._fadeTimeout=null}},isVisible:function(){return this._tooltipDiv&&this._tooltipDiv.style.visibility==="visible"},setTarget:function(b,c,d){if(this.isVisible()){if(!this._hasFocus())this._nextTarget=b,this.hide(d)}else if(this._target=b){var a=
this,b=a._getWindow();if(a._showTimeout)b.clearTimeout(a._showTimeout),a._showTimeout=null;c===0?a.show(!0):a._showTimeout=b.setTimeout(function(){a._showTimeout=null;a.show(!0)},c?c:a._showDelay)}},show:function(b){if(this._target){var c=this._target.getTooltipInfo();if(c){var d=this._tooltipDiv,a=this._tooltipContents;d.style.left=d.style.right=d.style.width=d.style.height=a.style.width=a.style.height="auto";var g=c.contents;g instanceof Array&&(g=this._getAnnotationContents(g));if(typeof g==="string")a.innerHTML=
g;else if(this._isNode(g))a.appendChild(g);else if(g instanceof e.ProjectionTextModel){var i=this._view,j=i.getOptions();j.wrapMode=!1;j.parent=a;var o=j.themeClass;o?((o=o.replace("tooltipTheme",""))&&(o=" "+o),o="tooltipTheme"+o):o="tooltipTheme";j.themeClass=o;j=this._contentsView=new k.TextView(j);j.addEventListener("LineStyle",function(a){i.onLineStyle(a)});j.setModel(g);g=j.computeSize();a.style.width=g.width+"px";a.style.height=g.height+"px";j.resize()}else return;a=d.ownerDocument.documentElement;
c.anchor==="right"?(g=a.clientWidth-c.x,d.style.right=g+"px"):(g=parseInt(this._getNodeStyle(d,"padding-left","0"),10),g+=parseInt(this._getNodeStyle(d,"border-left-width","0"),10),g=c.x-g,d.style.left=g+"px");d.style.maxWidth=a.clientWidth-g-10+"px";g=parseInt(this._getNodeStyle(d,"padding-top","0"),10);g+=parseInt(this._getNodeStyle(d,"border-top-width","0"),10);g=c.y-g;d.style.top=g+"px";d.style.maxHeight=a.clientHeight-g-10+"px";d.style.opacity="1";d.style.visibility="visible";if(b){var t=this,
s=this._getWindow();t._hideTimeout=s.setTimeout(function(){t._hideTimeout=null;var a=parseFloat(t._getNodeStyle(d,"opacity","1"));t._fadeTimeout=s.setInterval(function(){d.style.visibility==="visible"&&a>0?(a-=0.1,d.style.opacity=a):t._hide()},t._fadeDelay/10)},t._autoHideDelay)}}}},_getAnnotationContents:function(b){function h(a,b){var d=r.getLineStart(r.getLineAtOffset(a)),c=r.getLineEnd(r.getLineAtOffset(b),!0);return r.getText(d,c)}function d(a){var b=a.title,d=i.createElement(k,"div");d.className=
"tooltipRow";if(a.html)d.innerHTML=a.html,d.lastChild&&c.addEventListener(d.lastChild,"click",function(){var b=a.start,d=a.end;s.getBaseModel&&(b=s.mapOffset(b,!0),d=s.mapOffset(d,!0));t.setSelection(b,d,1/3,function(){j._hide()})},!1),d.appendChild(k.createTextNode("\u00a0"));b||(b=h(a.start,a.end));typeof b==="function"&&(b=a.title());if(typeof b==="string"){var e=i.createElement(k,"span");e.appendChild(k.createTextNode(b));b=e}d.appendChild(b);return d}for(var a,l=[],n=0;n<b.length;n++)a=b[n],
a.title!==""&&!a.groupAnnotation&&l.push(a);b=l;if(b.length===0)return null;var j=this,k=this._tooltipDiv.ownerDocument,t=this._view,s=t.getModel(),r=s.getBaseModel?s.getBaseModel():s;if(b.length===1)if(a=b[0],a.title!==void 0){a=d(a);if(a.firstChild)(b=a.firstChild.className)&&(b+=" "),b+="single",a.firstChild.className=b;return a}else return b=new e.ProjectionTextModel(r),l=r.getLineStart(r.getLineAtOffset(a.start)),n=r.getCharCount(),a.end!==n&&b.addProjection({start:a.end,end:n}),l>0&&b.addProjection({start:0,
end:l}),b;else{l=i.createElement(k,"div");a=i.createElement(k,"em");a.appendChild(k.createTextNode(g.multipleAnnotations));l.appendChild(a);for(n=0;n<b.length;n++)a=b[n],(a=d(a))&&l.appendChild(a);return l}},_getNodeStyle:function(b,c,d){var a;if(b&&(a=b.style[c],!a))if(b.currentStyle){for(a=0;(a=c.indexOf("-",a))!==-1;)c=c.substring(0,a)+c.substring(a+1,a+2).toUpperCase()+c.substring(a+2);a=b.currentStyle[c]}else a=(b=b.ownerDocument.defaultView.getComputedStyle(b,null))?b.getPropertyValue(c):null;
return a||d},_isNode:function(b){return typeof Node==="object"?b instanceof Node:b&&typeof b==="object"&&typeof b.nodeType==="number"&&typeof b.nodeName==="string"}};return{Tooltip:b}});
define("orion/editor/annotations",["i18n!orion/editor/nls/messages","orion/editor/eventTarget"],function(g,k){function j(b,a,c){this.start=b;this.end=a;this._projectionModel=c;this.html=this._expandedHTML;this.style=this._expandedStyle;this.expanded=!0}function e(){}function c(b,a){var c=b.lastIndexOf("."),c=b.substring(c+1),f={title:g[c],style:{styleClass:"annotation "+c},html:"<div class='annotationHTML "+c+"'></div>",overviewStyle:{styleClass:"annotationOverview "+c}};a?f.lineStyle={styleClass:"annotationLine "+
c}:f.rangeStyle={styleClass:"annotationRange "+c};e.registerType(b,f)}function i(){}function b(b){this._annotations=[];var a=this;this._listener={onChanged:function(b){a._onChanged(b)}};this.setTextModel(b)}function f(b,a){this._view=b;this._annotationModel=a;var c=this;this._listener={onDestroy:function(a){c._onDestroy(a)},onLineStyle:function(a){c._onLineStyle(a)},onChanged:function(a){c._onAnnotationModelChanged(a)}};b.addEventListener("Destroy",this._listener.onDestroy);b.addEventListener("postLineStyle",
this._listener.onLineStyle);a.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 b=this._projectionModel,a=b.getBaseModel();this._projection=
{start:a.getLineStart(a.getLineAtOffset(this.start)+1),end:a.getLineEnd(a.getLineAtOffset(this.end),!0)};b.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";e.ANNOTATION_BLAME="orion.annotation.blame";e.ANNOTATION_CURRENT_BLAME="orion.annotation.currentBlame";var h={};e.registerType=function(b,a){var c=a;if(typeof c!=="function")c=function(a,b,d){this.start=a;this.end=b;if(d!==void 0)this.title=d},c.prototype=a;c.prototype.type=b;h[b]=c;return b};e.createAnnotation=
function(b,a,c,e){return new (this.getType(b))(a,c,e)};e.getType=function(b){return h[b]};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);c(e.ANNOTATION_BLAME,!0);c(e.ANNOTATION_CURRENT_BLAME,!0);e.registerType(e.ANNOTATION_FOLDING,j);i.addMixin=function(b){var a=i.prototype,c;for(c in a)a.hasOwnProperty(c)&&(b[c]=a[c])};i.prototype={addAnnotationType:function(b){if(!this._annotationTypes)this._annotationTypes=[];this._annotationTypes.push(b)},getAnnotationTypePriority:function(b){if(this._annotationTypes)for(var a=0;a<this._annotationTypes.length;a++)if(this._annotationTypes[a]===b)return a+1;return 0},
getAnnotationsByType:function(b,a,c){b=b.getAnnotations(a,c);for(c=[];b.hasNext();)a=b.next(),this.getAnnotationTypePriority(a.type)!==0&&c.push(a);var e=this;c.sort(function(a,b){return e.getAnnotationTypePriority(a.type)-e.getAnnotationTypePriority(b.type)});return c},isAnnotationTypeVisible:function(b){return this.getAnnotationTypePriority(b)!==0},removeAnnotationType:function(b){if(this._annotationTypes)for(var a=0;a<this._annotationTypes.length;a++)if(this._annotationTypes[a]===b){this._annotationTypes.splice(a,
1);break}}};b.prototype={addAnnotation:function(b){if(b){var a=this._annotations,c=this._binarySearch(a,b.start);a.splice(c,0,b);this.onChanged({type:"Changed",added:[b],removed:[],changed:[]})}},getTextModel:function(){return this._model},getAnnotations:function(b,a){var c=this._annotations,e,f=0,h=function(){for(;f<c.length;){var e=c[f++];if(b===e.start||(b>e.start?b<e.end:e.start<a))return e;if(e.start>=a)break}return null};e=h();return{next:function(){var a=e;a&&(e=h());return a},hasNext:function(){return e!==
null}}},modifyAnnotation:function(b){if(b&&!(this._getAnnotationIndex(b)<0))this.onChanged({type:"Changed",added:[],removed:[],changed:[b]})},onChanged:function(b){return this.dispatchEvent(b)},removeAnnotations:function(b){var a=this._annotations,c,e;if(b){c=[];for(e=a.length-1;e>=0;e--){var f=a[e];f.type===b&&(a.splice(e,1),c.splice(0,0,f))}}else c=a;this.onChanged({type:"Changed",removed:c,added:[],changed:[]})},removeAnnotation:function(b){if(b&&(b=this._getAnnotationIndex(b),!(b<0)))this.onChanged({type:"Changed",
removed:this._annotations.splice(b,1),added:[],changed:[]})},replaceAnnotations:function(b,a){var c=this._annotations,e,f,h,g=[];if(b)for(e=b.length-1;e>=0;e--)h=b[e],f=this._getAnnotationIndex(h),f<0||(c.splice(f,1),g.splice(0,0,h));a||(a=[]);for(e=0;e<a.length;e++)h=a[e],f=this._binarySearch(c,h.start),c.splice(f,0,h);this.onChanged({type:"Changed",removed:g,added:a,changed:[]})},setTextModel:function(b){this._model&&this._model.removeEventListener("Changed",this._listener.onChanged);(this._model=
b)&&this._model.addEventListener("Changed",this._listener.onChanged)},_binarySearch:function(b,a){for(var c=b.length,e=-1,f;c-e>1;)f=Math.floor((c+e)/2),a<=b[f].start?c=f:e=f;return c},_getAnnotationIndex:function(b){for(var a=this._annotations,c=this._binarySearch(a,b.start);c<a.length&&a[c].start===b.start;){if(a[c]===b)return c;c++}return-1},_onChanged:function(b){var a=b.start,c=b.removedCharCount,e=this._annotations,f=a+c;if(0<e.length){for(var h={type:"Changed",added:[],removed:[],changed:[],
textModelChangedEvent:b},b=b.addedCharCount-c,c=0;c<e.length;c++){var g=e[c];g.start>=f?(g.start+=b,g.end+=b,h.changed.push(g)):g.end<=a||(g.start<a&&f<g.end?(g.end+=b,h.changed.push(g)):(e.splice(c,1),h.removed.push(g),c--))}if(h.added.length>0||h.removed.length>0||h.changed.length>0)this.onChanged(h)}}};k.EventTarget.addMixin(b.prototype);f.prototype={destroy:function(){var b=this._view;if(b)b.removeEventListener("Destroy",this._listener.onDestroy),b.removeEventListener("LineStyle",this._listener.onLineStyle),
this.view=null;(b=this._annotationModel)&&b.removeEventListener("Changed",this._listener.onChanged)},_mergeStyle:function(b,a){if(a){b||(b={});b.styleClass&&a.styleClass&&b.styleClass!==a.styleClass?b.styleClass+=" "+a.styleClass:b.styleClass=a.styleClass;var c;if(a.tagName&&!b.tagName)b.tagName=a.tagName;if(a.style){if(!b.style)b.style={};for(c in a.style)b.style[c]||(b.style[c]=a.style[c])}if(a.attributes){if(!b.attributes)b.attributes={};for(c in a.attributes)b.attributes[c]||(b.attributes[c]=
a.attributes[c])}}return b},_mergeStyleRanges:function(b,a){b||(b=[]);var c,e;for(e=0;e<b.length&&a;e++){var f=b[e];if(a.end<=f.start)break;if(!(a.start>=f.end)){c=this._mergeStyle({},f.style);c=this._mergeStyle(c,a.style);var h=[];h.push(e,1);a.start<f.start&&h.push({start:a.start,end:f.start,style:a.style});a.start>f.start&&h.push({start:f.start,end:a.start,style:f.style});h.push({start:Math.max(f.start,a.start),end:Math.min(f.end,a.end),style:c});a.end<f.end&&h.push({start:a.end,end:f.end,style:f.style});
a=a.end>f.end?{start:f.end,end:a.end,style:a.style}:null;Array.prototype.splice.apply(b,h)}}a&&(c=this._mergeStyle({},a.style),b.splice(e,0,{start:a.start,end:a.end,style:c}));return b},_onAnnotationModelChanged:function(b){function a(a){for(var b=0;b<a.length;b++)if(e.isAnnotationTypeVisible(a[b].type)){var d=a[b].start,h=a[b].end;f.getBaseModel&&(d=f.mapOffset(d,!0),h=f.mapOffset(h,!0));d!==-1&&h!==-1&&c.redrawRange(d,h)}}if(!b.textModelChangedEvent){var c=this._view;if(c){var e=this,f=c.getModel();
a(b.added);a(b.removed);a(b.changed)}}},_onDestroy:function(){this.destroy()},_onLineStyle:function(b){var a=this._annotationModel,c=b.textView.getModel(),e=a.getTextModel(),f=b.lineStart,h=b.lineStart+b.lineText.length;e!==c&&(f=c.mapOffset(f),h=c.mapOffset(h));for(a=a.getAnnotations(f,h);a.hasNext();)if(f=a.next(),this.isAnnotationTypeVisible(f.type)){if(f.rangeStyle){var h=f.start,g=f.end;e!==c&&(h=c.mapOffset(h,!0),g=c.mapOffset(g,!0));b.ranges=this._mergeStyleRanges(b.ranges,{start:h,end:g,style:f.rangeStyle})}if(f.lineStyle)b.style=
this._mergeStyle({},b.style),b.style=this._mergeStyle(b.style,f.lineStyle)}}};i.addMixin(f.prototype);return{FoldingAnnotation:j,AnnotationType:e,AnnotationTypeList:i,AnnotationModel:b,AnnotationStyler:f}});
define("orion/editor/editor","i18n!orion/editor/nls/messages,orion/editor/eventTarget,orion/editor/tooltip,orion/editor/annotations,orion/objects,orion/util".split(","),function(g,k,j,e,c,i){function b(b){b=b||{};this._domNode=b.domNode;this._statusReporter=b.statusReporter;this._dirty=!1;this._title=null}function f(d){d=d||{};b.call(this,d);this._textViewFactory=d.textViewFactory;this._undoStackFactory=d.undoStackFactory;this._textDNDFactory=d.textDNDFactory;this._annotationFactory=d.annotationFactory;
this._foldingRulerFactory=d.foldingRulerFactory;this._lineNumberRulerFactory=d.lineNumberRulerFactory;this._contentAssistFactory=d.contentAssistFactory;this._keyBindingFactory=d.keyBindingFactory;this._contentAssist=this._foldingRuler=this._overviewRuler=this._lineNumberRuler=this._annotationRuler=this._annotationModel=this._annotationStyler=null}var h=e.AnnotationType;b.prototype={destroy:function(){this.uninstall();this._statusReporter=this._domNode=null},focus:function(){},getModel:function(){return this._model},
getText:function(b,a){return this.getModel().getText(b,a)},getTitle:function(){return this._title},install:function(){},isDirty:function(){return this._dirty},markClean:function(){this.setDirty(!1)},onDirtyChanged:function(b){return this.dispatchEvent(b)},onInputChanged:function(b){return this.dispatchEvent(b)},reportStatus:function(b,a,c){this._statusReporter&&this._statusReporter(b,a,c)},resize:function(){},setDirty:function(b){if(this._dirty!==b)this._dirty=b,this.onDirtyChanged({type:"DirtyChanged"})},
setInput:function(b,a,c,e){this._title=b;this.onInputChanged({type:"InputChanged",title:b,message:a,contents:c,contentsSaved:e})},uninstall:function(){}};k.EventTarget.addMixin(b.prototype);f.prototype=new b;c.mixin(f.prototype,{destroy:function(){b.prototype.destroy.call(this);this._textViewFactory=this._undoStackFactory=this._textDNDFactory=this._annotationFactory=this._foldingRulerFactory=this._lineNumberRulerFactory=this._contentAssistFactory=this._keyBindingFactory=null},getAnnotationModel:function(){return this._annotationModel},
getAnnotationRuler:function(){return this._annotationRuler},getAnnotationStyler:function(){return this._annotationStyler},getContentAssist:function(){return this._contentAssist},getFoldingRuler:function(){return this._foldingRuler},getLineNumberRuler:function(){return this._lineNumberRuler},getModel:function(){var b=this._textView.getModel();b.getBaseModel&&(b=b.getBaseModel());return b},getOverviewRuler:function(){return this._overviewRuler},getTextView:function(){return this._textView},getUndoStack:function(){return this._undoStack},
getKeyModes:function(){return this._textView.getKeyModes()},getSourceCodeActions:function(){return this._sourceCodeActions},getLinkedMode:function(){return this._linkedMode},getTextActions:function(){return this._textActions},focus:function(){this._textView&&this._textView.focus()},markClean:function(){this.getUndoStack().markClean()},resize:function(){this._textView&&this._textView.resize()},setAnnotationRulerVisible:function(b,a){if(this._annotationRulerVisible!==b||a)if(this._annotationRulerVisible=
b,this._annotationRuler){var c=this._textView;b?c.addRuler(this._annotationRuler,0):c.removeRuler(this._annotationRuler)}},setFoldingRulerVisible:function(b,a){if(this._foldingRulerVisible!==b||a)if(this._foldingRulerVisible=b,this._foldingRuler){var c=this._textView;c.getModel().getBaseModel&&(b?c.addRuler(this._foldingRuler):c.removeRuler(this._foldingRuler))}},setLineNumberRulerVisible:function(b,a){if(this._lineNumberRulerVisible!==b||a)if(this._lineNumberRulerVisible=b,this._lineNumberRuler){var c=
this._textView;b?c.addRuler(this._lineNumberRuler,!this._annotationRulerVisible?0:1):c.removeRuler(this._lineNumberRuler)}},setOverviewRulerVisible:function(b,a){if(this._overviewRulerVisible!==b||a)if(this._overviewRulerVisible=b,this._overviewRuler){var c=this._textView;b?c.addRuler(this._overviewRuler):c.removeRuler(this._overviewRuler)}},mapOffset:function(b,a){var c=this._textView.getModel();c.getBaseModel&&(b=c.mapOffset(b,a));return b},getCaretOffset:function(){return this.mapOffset(this._textView.getCaretOffset())},
getSelection:function(){var b=this._textView,a=b.getSelection(),b=b.getModel();if(b.getBaseModel)a.start=b.mapOffset(a.start),a.end=b.mapOffset(a.end);return a},_expandOffset:function(b){var a=this._textView.getModel(),c=this._annotationModel;if(c&&a.getBaseModel)for(b=c.getAnnotations(b,b+1);b.hasNext();)a=b.next(),a.type===h.ANNOTATION_FOLDING&&a.expand&&(a.expand(),c.modifyAnnotation(a))},setCaretOffset:function(b,a,c){var e=this._textView,f=e.getModel();f.getBaseModel&&(this._expandOffset(b),
b=f.mapOffset(b,!0));e.setCaretOffset(b,a,c)},setText:function(b,a,c){var e=this._textView,f=e.getModel();f.getBaseModel&&(a!==void 0&&(this._expandOffset(a),a=f.mapOffset(a,!0)),c!==void 0&&(this._expandOffset(c),c=f.mapOffset(c,!0)));e.setText(b,a,c)},setSelection:function(b,a,c,e){var f=this._textView,h=f.getModel();h.getBaseModel&&(this._expandOffset(b),this._expandOffset(a),b=h.mapOffset(b,!0),a=h.mapOffset(a,!0));f.setSelection(b,a,c,e)},moveSelection:function(b,a,c,e){var f=this._textView;
this.setSelection(b,a||b,1/3,function(){(e===void 0||e)&&f.focus();c&&c()})},checkDirty:function(){this.setDirty(!this._undoStack.isClean())},_getTooltipInfo:function(b,a){var c=this._textView,e=this.getAnnotationModel();if(!e)return null;var f=this._annotationStyler;if(!f)return null;var h=c.getOffsetAtLocation(b,a);if(h===-1)return null;h=this.mapOffset(h);f=f.getAnnotationsByType(e,h,h+1);e=[];for(h=0;h<f.length;h++)f[h].rangeStyle&&e.push(f[h]);if(e.length===0)return null;c=c.convert({x:b,y:a},
"document","page");return{contents:e,anchor:"left",x:c.x+10,y:c.y+20}},_highlightCurrentLine:function(b,a){var c=this._annotationModel;if(c){var e=this._textView;if(!e.getOptions("singleMode")){var f=e.getModel(),g=a?f.getLineAtOffset(a.start):-1,i=f.getLineAtOffset(b.start),e=b.start===b.end,j=!a||a.start===a.end,k=f.getLineStart(i),u=f.getLineEnd(i);f.getBaseModel&&(k=f.mapOffset(k),u=f.mapOffset(u));f=this._currentLineAnnotation;if(!(g===i&&j&&e&&f&&f.start===k&&f.end===u)){var g=f?[f]:null,w;
e&&(f=h.createAnnotation(h.ANNOTATION_CURRENT_LINE,k,u),w=[f]);this._currentLineAnnotation=f;c.replaceAnnotations(g,w)}}}},install:function(){this.installTextView()},installTextView:function(){if(!this._textView){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 b=this,a=this._textView,c=this;this._listener={onModelChanged:function(){c.checkDirty()},onMouseOver:function(a){c._listener.onMouseMove(a)},onMouseMove:function(b){var d=j.Tooltip.getTooltip(a);if(d&&!(c._listener.lastMouseX===b.event.clientX&&c._listener.lastMouseY===b.event.clientY))c._listener.lastMouseX=b.event.clientX,c._listener.lastMouseY=b.event.clientY,d.setTarget({x:b.x,y:b.y,getTooltipInfo:function(){return c._getTooltipInfo(this.x,this.y)}})},onMouseOut:function(b){var d=j.Tooltip.getTooltip(a);
if(d&&!(c._listener.lastMouseX===b.event.clientX&&c._listener.lastMouseY===b.event.clientY))c._listener.lastMouseX=b.event.clientX,c._listener.lastMouseY=b.event.clientY,d.setTarget(null)},onScroll:function(){var b=j.Tooltip.getTooltip(a);b&&b.setTarget(null,0,0)},onSelection:function(a){c._updateCursorStatus();c._highlightCurrentLine(a.newValue,a.oldValue)}};a.addEventListener("ModelChanged",this._listener.onModelChanged);a.addEventListener("Selection",this._listener.onSelection);a.addEventListener("MouseOver",
this._listener.onMouseOver);a.addEventListener("MouseOut",this._listener.onMouseOut);a.addEventListener("MouseMove",this._listener.onMouseMove);a.addEventListener("Scroll",this._listener.onScroll);if(this._keyBindingFactory){var e;if(e=typeof this._keyBindingFactory==="function"?this._keyBindingFactory(this,this.getKeyModes(),this._undoStack,this._contentAssist):this._keyBindingFactory.createKeyBindings(b,this._undoStack,this._contentAssist))this._textActions=e.textActions,this._linkedMode=e.linkedMode,
this._sourceCodeActions=e.sourceCodeActions}e=function(a){if(a!==void 0&&a!==-1){for(var c=this.getView().getModel(),e=this.getAnnotationModel(),f=b.mapOffset(c.getLineStart(a)),a=b.mapOffset(c.getLineEnd(a)),c=e.getAnnotations(f,a),g=null;c.hasNext();){var i=c.next();if(i.type===h.ANNOTATION_BOOKMARK){g=i;break}}g?e.removeAnnotation(g):(g=h.createAnnotation(h.ANNOTATION_BOOKMARK,f,a),g.title=void 0,e.addAnnotation(g))}};if(this._annotationFactory){var f=a.getModel();f.getBaseModel&&(f=f.getBaseModel());
if(this._annotationModel=this._annotationFactory.createAnnotationModel(f))if(f=this._annotationStyler=this._annotationFactory.createAnnotationStyler(a,this._annotationModel))f.addAnnotationType(h.ANNOTATION_CURRENT_SEARCH),f.addAnnotationType(h.ANNOTATION_MATCHING_SEARCH),f.addAnnotationType(h.ANNOTATION_ERROR),f.addAnnotationType(h.ANNOTATION_WARNING),f.addAnnotationType(h.ANNOTATION_MATCHING_BRACKET),f.addAnnotationType(h.ANNOTATION_CURRENT_BRACKET),f.addAnnotationType(h.ANNOTATION_CURRENT_LINE),
f.addAnnotationType(h.ANNOTATION_READ_OCCURRENCE),f.addAnnotationType(h.ANNOTATION_WRITE_OCCURRENCE),f.addAnnotationType(h.ANNOTATION_SELECTED_LINKED_GROUP),f.addAnnotationType(h.ANNOTATION_CURRENT_LINKED_GROUP),f.addAnnotationType(h.ANNOTATION_LINKED_GROUP),f.addAnnotationType("orion.annotation.highlightError");a.annotationModel=this._annotationModel;var f=this._annotationFactory.createAnnotationRulers(this._annotationModel),g=this._annotationRuler=f.annotationRuler;if(g)g.onDblClick=e,g.setMultiAnnotationOverlay({html:"<div class='annotationHTML overlay'></div>"}),
g.addAnnotationType(h.ANNOTATION_ERROR),g.addAnnotationType(h.ANNOTATION_WARNING),g.addAnnotationType(h.ANNOTATION_TASK),g.addAnnotationType(h.ANNOTATION_BOOKMARK);this.setAnnotationRulerVisible(this._annotationRulerVisible||this._annotationRulerVisible===void 0,!0);if(g=this._overviewRuler=f.overviewRuler)g.addAnnotationType(h.ANNOTATION_CURRENT_SEARCH),g.addAnnotationType(h.ANNOTATION_MATCHING_SEARCH),g.addAnnotationType(h.ANNOTATION_READ_OCCURRENCE),g.addAnnotationType(h.ANNOTATION_WRITE_OCCURRENCE),
g.addAnnotationType(h.ANNOTATION_CURRENT_BLAME),g.addAnnotationType(h.ANNOTATION_ERROR),g.addAnnotationType(h.ANNOTATION_WARNING),g.addAnnotationType(h.ANNOTATION_TASK),g.addAnnotationType(h.ANNOTATION_BOOKMARK),g.addAnnotationType(h.ANNOTATION_MATCHING_BRACKET),g.addAnnotationType(h.ANNOTATION_CURRENT_BRACKET),g.addAnnotationType(h.ANNOTATION_CURRENT_LINE);this.setOverviewRulerVisible(this._overviewRulerVisible||this._overviewRulerVisible===void 0,!0)}if(this._lineNumberRulerFactory)this._lineNumberRuler=
this._lineNumberRulerFactory.createLineNumberRuler(this._annotationModel),this._lineNumberRuler.addAnnotationType(h.ANNOTATION_CURRENT_BLAME),this._lineNumberRuler.addAnnotationType(h.ANNOTATION_BLAME),this._lineNumberRuler.onDblClick=e,this.setLineNumberRulerVisible(this._lineNumberRulerVisible||this._lineNumberRulerVisible===void 0,!0);if(this._foldingRulerFactory)this._foldingRuler=this._foldingRulerFactory.createFoldingRuler(this._annotationModel),this._foldingRuler.addAnnotationType(h.ANNOTATION_FOLDING),
this.setFoldingRulerVisible(this._foldingRulerVisible||this._foldingRulerVisible===void 0,!0);this.dispatchEvent({type:"TextViewInstalled",textView:a})}},uninstall:function(){this.uninstallTextView()},uninstallTextView:function(){var b=this._textView;if(b)b.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._foldingRulerVisible=this._overviewRulerVisible=this._lineNumberRulerVisible=this._annotationRulerVisible=void 0,this.dispatchEvent({type:"TextViewUninstalled",textView:b})},_updateCursorStatus:function(){var b=this.getModel(),a=this.getCaretOffset(),c=b.getLineAtOffset(a),b=b.getLineStart(c);a-=b;for(var b=this.getKeyModes(),e=0;e<b.length;e++){var f=b[e];if(f.isActive()&&f.isStatusActive&&f.isStatusActive())return}this.reportStatus(i.formatMessage(g.lineColumn,
c+1,a+1))},showAnnotations:function(b,a,c,e){var f=this._annotationModel;if(f){for(var g=[],i=[],j=f.getTextModel(),k=f.getAnnotations(0,j.getCharCount()),u;k.hasNext();)u=k.next(),a.indexOf(u.type)!==-1&&u.creatorID===this&&g.push(u);if(b)for(a=0;a<b.length;a++)if(u=b[a]){if(c)u=c(u);else{var w;typeof u.line==="number"?(w=j.getLineStart(u.line-1),k=w+u.start-1,w+=u.end):(k=u.start,w=u.end);var v=e(u);if(!v)continue;u=h.createAnnotation(v,k,w,u.description)}u.creatorID=this;i.push(u)}f.replaceAnnotations(g,
i)}},showProblems:function(b){this.showAnnotations(b,[h.ANNOTATION_ERROR,h.ANNOTATION_WARNING,h.ANNOTATION_TASK],null,function(a){switch(a.severity){case "error":return h.ANNOTATION_ERROR;case "warning":return h.ANNOTATION_WARNING;case "task":return h.ANNOTATION_TASK}return null})},showOccurrences:function(b){this.showAnnotations(b,[h.ANNOTATION_READ_OCCURRENCE,h.ANNOTATION_WRITE_OCCURRENCE],null,function(a){return a.readAccess?h.ANNOTATION_READ_OCCURRENCE:h.ANNOTATION_WRITE_OCCURRENCE})},showBlame:function(b){var a=
this._blameRGB,f=this.getTextView().getOptions("parent").ownerDocument;if(!a){var n=i.createElement(f,"div");n.className="annotation blame";f.body.appendChild(n);var j=(f.defaultView||f.parentWindow).getComputedStyle(n).getPropertyValue("background-color");n.parentNode.removeChild(n);var n=j.indexOf("("),k=j.indexOf(")"),j=j.substring(n+1,k);this._blameRGB=a=j.split(",").slice(0,3)}var t=function(){var a=e.AnnotationType.createAnnotation(this.groupType,this.start,this.end,this.title);a.style=c.mixin({},
a.style);a.style.style=c.mixin({},a.style.style);a.style.style.backgroundColor="";this.groupAnnotation=a;a.blame=this.blame;a.html=this.html;a.creatorID=this.creatorID;return a},s=function(){var a=i.createElement(f,"div");a.className="tooltipTitle";var b=this.blame.Message.indexOf("\n");if(b===-1)b=this.blame.Message.length;var c=i.createElement(f,"a");c.href=this.blame.CommitLink;c.appendChild(f.createTextNode(this.blame.Message.substring(0,b)));a.appendChild(c);a.appendChild(i.createElement(f,"br"));
a.appendChild(f.createTextNode(i.formatMessage(g.committerOnTime,this.blame.AuthorName,this.blame.Time)));return a},r=this.getModel();this.showAnnotations(b,[h.ANNOTATION_BLAME,h.ANNOTATION_CURRENT_BLAME],function(b){var d=r.getLineStart(b.Start-1),f=r.getLineEnd(b.End-1,!0),d=e.AnnotationType.createAnnotation(h.ANNOTATION_BLAME,d,f,s),f=a.slice(0);f.push(b.Shade);d.style=c.mixin({},d.style);d.style.style=c.mixin({},d.style.style);d.style.style.backgroundColor="rgba("+f.join()+")";d.groupId=b.Name;
d.groupType=h.ANNOTATION_CURRENT_BLAME;d.createGroupAnnotation=t;d.html='<img class="annotationHTML blame" src="'+b.AuthorImage+'"/>';d.blame=b;return d})},showSelection:function(b,a,c,e,f){typeof b==="number"?(typeof a!=="number"&&(a=b),this.moveSelection(b,a)):typeof c==="number"&&(b=this.getModel().getLineStart(c-1),typeof e==="number"&&(b+=e),typeof f!=="number"&&(f=0),this.moveSelection(b,b+f))},setInput:function(c,a,e,f){this._textView&&(f||(a?this._textView.setText(a):e!==null&&e!==void 0&&
(this._textView.setText(e),this._textView.getModel().setLineDelimiter("auto"),this._highlightCurrentLine(this._textView.getSelection())),this._undoStack.reset(),this._textView.focus()),this.checkDirty());b.prototype.setInput.call(this,c,a,e,f)},onGotoLine:function(b,a,c,e){if(this._textView){var f=this.getModel(),b=Math.max(0,Math.min(b,f.getLineCount()-1)),h=f.getLineStart(b),g=0;c===void 0&&(c=0);typeof a==="string"?(b=f.getLine(b).indexOf(a),b!==-1&&(g=b,c=g+a.length)):(g=a,a=f.getLineEnd(b)-h,
g=Math.min(g,a),c=Math.min(c,a));this.moveSelection(h+g,h+c,e)}}});return{BaseEditor:b,Editor:f}});
define("orion/editor/find","i18n!orion/editor/nls/messages,orion/keyBinding,orion/editor/keyModes,orion/editor/annotations,orion/regex,orion/objects,orion/util".split(","),function(g,k,j,e,c,i,b){function f(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,e=b.getModel(),f=b.mapOffset(a.start),b=b.mapOffset(a.end),e=e.getText(f,b);if((e=d._prefix.match(RegExp("^"+c.escape(e),"i")))&&e.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 h(a,b,c){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 d=this;this._listeners={onEditorFocus:function(a){d._removeCurrentAnnotation(a)}};this.setOptions(c)}}var d={};f.prototype=new j.KeyMode;i.mixin(f.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 c=this._prefix;if(c.length===0)return!1;var d=this.editor,e=d.getModel(),e=a?this._success?b?this._start:d.getCaretOffset()+
1:0:this._success?b?this._start:d.getCaretOffset():e.getCharCount()-1;if(c=d.getModel().find({string:c,start:e,reverse:!a,caseInsensitive:c.toLowerCase()===c}).next()){if(!b)this._start=e;this._ignoreSelection=this._success=!0;d.moveSelection(a?c.start:c.end,a?c.end:c.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 a;a=this._forward?this._success?g.incrementalFindStr:g.incrementalFindStrNotFound:this._success?g.incrementalFindReverseStr:g.incrementalFindReverseStrNotFound;a=b.formatMessage(a,this._prefix);this.editor.reportStatus(a,this._success?"":"error")}else this.editor.reportStatus("")}});
d.IncrementalFind=f;h.prototype={find:function(a,b,c){this.setOptions({reverse:!a});var d=this.getFindString(),e;if(b)d=b.findString||d,e=b.count;a=this.getOptions();this.setOptions(b);b=c?this._startOffset:this.getStartOffset();if((e=this._doFind(d,b,e))&&!c)this._startOffset=e.start;this.setOptions(a);this._hideAfterFind&&this.hide();return e},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(),a=this._editor.getText(a.start,a.end);this._regex&&(a=c.escape(a));return a||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();var a=this._editor.getTextView();a&&(a.removeEventListener("Focus",this._listeners.onEditorFocus),a.focus())},_processReplaceString:function(a){var b=a;if(this._regex){for(var b="",c=!1,d=this._editor.getModel().getLineDelimiter(),e=0;e<a.length;e++){var f=a.substring(e,e+1);if(c){switch(f){case "R":b+=d;break;case "r":b+=
"\r";break;case "n":b+="\n";break;case "t":b+="\t";break;case "\\":b+="\\";break;default:b+="\\"+f}c=!1}else f==="\\"?c=!0:b+=f}c&&(b+="\\")}return b},isVisible:function(){return this._visible},replace:function(){var a=this.getFindString();if(a){var b=this._editor,c=this._processReplaceString(this.getReplaceString()),d=b.getSelection().start;if(b=b.getModel().find({string:a,start:d,reverse:!1,wrap:this._wrap,regex:this._regex,wholeWord:this._wholeWord,caseInsensitive:this._caseInsensitive}).next())this.startUndo(),
this._doReplace(b.start,b.end,a,c),this.endUndo()}this._findAfterReplace&&a&&this._doFind(a,this.getStartOffset())},replaceAll:function(){var a=this.getFindString();if(a){this._replacingAll=!0;var c=this._editor,d=c.getTextView();c.reportStatus(g.replaceAll);var e=this._processReplaceString(this.getReplaceString()),f=this;window.setTimeout(function(){for(var h=0,i=0;;){var j=f._doFind(a,h,null,!0);if(!j)break;i++;i===1&&(d.setRedraw(!1),f.startUndo());f._doReplace(j.start,j.end,a,e);h=f.getStartOffset()}i>
0&&(f.endUndo(),d.setRedraw(!0));h>0?c.reportStatus(b.formatMessage(g.replacedMatches,i)):c.reportStatus(g.nothingReplaced,"error");f._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()},_find:function(a,b,c){return this._editor.getModel().find({string:a,start:b,end:this._end,reverse:this._reverse,wrap:c?!1:this._wrap,regex:this._regex,wholeWord:this._wholeWord,caseInsensitive:this._caseInsensitive})},_doFind:function(a,b,c,d){var c=c||1,f=this._editor;if(!a)return this._removeAllAnnotations(),null;this._lastString=a;var h,i;if(this._regex)try{i=this._find(a,b,d)}catch(j){f.reportStatus(j.message,
"error");return}else i=this._find(a,b,d);for(a=0;a<c&&i.hasNext();a++)h=i.next();if(!this._replacingAll){h?this._editor.reportStatus(""):this._editor.reportStatus(g.notFound,"error");if(this.isVisible()){c=e.AnnotationType.ANNOTATION_CURRENT_SEARCH;if(i=f.getAnnotationModel())i.removeAnnotations(c),h&&i.addAnnotation(e.AnnotationType.createAnnotation(c,h.start,h.end));if(this._showAll){this._timer&&window.clearTimeout(this._timer);var k=this;this._timer=window.setTimeout(function(){k._markAllOccurrences();
k._timer=null},500)}}this._findCallback?this._findCallback(h):h&&f.moveSelection(h.start,h.end,null,!1)}return h},_doReplace:function(a,b,c,d){var e=this._editor;if(this._regex&&(d=e.getText(a,b).replace(RegExp(c,this._caseInsensitive?"i":""),d),!d))return;e.setText(d,a,b);e.setSelection(a,a+d.length,!0)},_markAllOccurrences:function(){var a=this._editor.getAnnotationModel();if(a){for(var b=e.AnnotationType.ANNOTATION_MATCHING_SEARCH,c=a.getAnnotations(0,a.getTextModel().getCharCount()),d=[],f;c.hasNext();){var h=
c.next();h.type===b&&d.push(h)}if(this.isVisible()){c=this.getFindString();c=this._editor.getModel().find({string:c,regex:this._regex,wholeWord:this._wholeWord,caseInsensitive:this._caseInsensitive});for(f=[];c.hasNext();)h=c.next(),f.push(e.AnnotationType.createAnnotation(b,h.start,h.end))}a.replaceAnnotations(d,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=h;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,i){function b(a,b,d){this.editor=a;this.undoStack=b;this._incrementalFind=new c.IncrementalFind(a);this._find=d?d:new c.Find(a,b);this._lastEditLocation=null;this.init()}function f(a,b,c,d){this.editor=a;this.undoStack=b;this.contentAssist=c;this.linkedMode=d;this.contentAssist&&this.contentAssist.addEventListener("ProposalApplied",
this.contentAssistProposalApplied.bind(this));this.init()}var h=j.AnnotationType,d={};b.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",!i.isMac,!1,!1,i.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",!i.isMac,!1,!1,i.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(),d=b.getLineAtOffset(c.start),c=b.getLineAtOffset(c.end>c.start?c.end-1:
c.end),e=b.getLineStart(d),d=b.getLineEnd(c,!0),f=b.getLineCount(),h="",e=b.getText(e,d);c===f-1&&(e=(h=b.getLineDelimiter())+e);a.setText(e,d,d);a.setSelection(d+h.length,d+e.length);return!0},copyLinesUp:function(){var a=this.editor;if(a.getTextView().getOptions("readonly"))return!1;var b=a.getModel(),c=a.getSelection(),d=b.getLineAtOffset(c.start),c=b.getLineAtOffset(c.end>c.start?c.end-1:c.end),d=b.getLineStart(d),e=b.getLineEnd(c,!0),f=b.getLineCount(),h="",e=b.getText(d,e);c===f-1&&(e+=h=b.getLineDelimiter());
a.setText(e,d,d);a.setSelection(d,d+e.length-h.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 d=b.getSelection(),e=b.getModel(),f=e.getLineAtOffset(d.start),a=e.getLineStart(f),c=d.start!==d.end||c===1?e.getLineAtOffset(d.end>d.start?d.end-1:d.end):Math.min(f+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 d=b.getModel(),e=b.getCaretOffset(),f=d.getLineAtOffset(e),e=d.getLineStart(f),f=d.getLineEnd(f,!0);d.getBaseModel&&(e=d.mapOffset(e),f=d.mapOffset(f),d.getBaseModel());for(var h,d=c.getAnnotations(e,f);!h&&d.hasNext();)e=d.next(),e.type===j.AnnotationType.ANNOTATION_FOLDING&&(h=e);h&&a!==h.expanded&&(a?h.expand():(b.setCaretOffset(h.start),h.collapse()),c.modifyAnnotation(h));return!0},expandAnnotations:function(a){var b=this.editor,c=b.getTextView(),d=b.getAnnotationModel();if(!d)return!0;
var b=b.getModel(),e=d.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(),d.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(),d=a.getSelection(),e=c.getLineAtOffset(d.start),f=c.getLineAtOffset(d.end>d.start?d.end-1:d.end);if(e!==f){var h=[];h.push("");
for(var g=e;g<=f;g++)h.push(c.getLine(g,!0));g=c.getLineStart(e);c=c.getLineEnd(f,!0);b=b.getOptions("tabSize","expandTab");b=b.expandTab?Array(b.tabSize+1).join(" "):"\t";a.setText(h.join(b),g,c);a.setSelection(g===d.start?d.start:d.start+b.length,d.end+(f-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(),d=b.getLineAtOffset(c.start),e=b.getLineAtOffset(c.end>c.start?c.end-1:c.end),f=b.getLineCount();if(e===f-1)return!0;var d=b.getLineStart(d),c=b.getLineEnd(e,!0),h=b.getLineEnd(e+1,!0)-(c-d),g=0;e!==f-2?b=b.getText(d,c):(e=b.getLineEnd(e),b=b.getText(e,c)+b.getText(d,e),g+=c-e);this.startUndo();
a.setText("",d,c);a.setText(b,h,h);a.setSelection(h+g,h+g+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(),d=b.getLineAtOffset(c.start);if(d===0)return!0;var e=b.getLineAtOffset(c.end>c.start?c.end-1:c.end),f=b.getLineCount(),c=b.getLineStart(d-1),h=b.getLineStart(d),g=b.getLineEnd(e,!0),i=b.getText(h,g),j=0;e===f-1&&(e=b.getLineEnd(d-1),d=b.getLineEnd(d-1,!0),i+=b.getText(e,d),h=e,
j=d-e);this.startUndo();a.setText("",h,g);a.setText(i,c,c);a.setSelection(c,c+i.length-j);this.endUndo();return!0},nextAnnotation:function(a){var b=this.editor,c=b.getAnnotationModel();if(!c)return!0;var d=b.getOverviewRuler()||b.getAnnotationStyler();if(!d)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 j=c.next();if(a){if(j.start<=g)continue}else if(j.start>=g)continue;if(!j.lineStyle&&!(j.type===h.ANNOTATION_MATCHING_BRACKET||
j.type===h.ANNOTATION_CURRENT_BRACKET||!d.isAnnotationTypeVisible(j.type)))if(i=j,a)break}if(i){var k=b.getTextView(),w=f.getLineAtOffset(i.start),v=e.Tooltip.getTooltip(k);if(!v)return b.moveSelection(i.start),!0;b.moveSelection(i.start,i.start,function(){v.setTarget({getTooltipInfo:function(){var a=k.convert({x:k.getLocationAtOffset(i.start).x,y:k.getLocationAtOffset(f.getLineStart(w)).y},"document","page");return{contents:[i],x:a.x,y:a.y+Math.floor(k.getLineHeight(w)*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(),d=a.getSelection(),e=c.getLineAtOffset(d.start),f=c.getLineAtOffset(d.end>d.start?d.end-1:d.end),h=b.getOptions("tabSize"),g=Array(h+1).join(" "),i=[],j=b=0,k=e;k<=f;k++){var q=c.getLine(k,!0);if(c.getLineStart(k)!==c.getLineEnd(k))if(q.indexOf("\t")===0)q=q.substring(1),b++;else if(q.indexOf(g)===0)q=q.substring(h),b+=h;else return!0;k===e&&(j=b);i.push(q)}e=c.getLineStart(e);h=c.getLineEnd(f,
!0);c=c.getLineStart(f);a.setText(i.join(""),e,h);f=e===d.start?d.start:d.start-j;d=Math.max(f,d.end-b+(d.end===c+1&&d.start!==d.end?1:0));a.setSelection(f,d);return!0}},startUndo:function(){this.undoStack&&this.undoStack.startCompoundChange()},endUndo:function(){this.undoStack&&this.undoStack.endCompoundChange()}};d.TextActions=b;f.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("t",!0,!1,!0),"trimTrailingWhitespaces");a.setAction("trimTrailingWhitespaces",function(){return this.trimTrailingWhitespaces()}.bind(this),{name:g.trimTrailingWhitespaces});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,!i.isMac,!1,i.isMac),"addBlockComment");a.setAction("addBlockComment",function(){return this.addBlockComment()}.bind(this),
{name:g.addBlockComment});a.setKeyBinding(new k.KeyBinding(220,!0,!i.isMac,!1,i.isMac),"removeBlockComment");a.setAction("removeBlockComment",function(){return this.removeBlockComment()}.bind(this),{name:g.removeBlockComment});a.setKeyBinding(new k.KeyBinding("[",!1,!1,!1,!1,"keypress"),"autoPairSquareBracket");a.setAction("autoPairSquareBracket",function(){return this.autoPairBrackets("[","]")}.bind(this));a.setKeyBinding(new k.KeyBinding("]",!1,!1,!1,!1,"keypress"),"skipClosingSquareBracket");a.setAction("skipClosingSquareBracket",
function(){return this.skipClosingBracket("]")}.bind(this));a.setKeyBinding(new k.KeyBinding("<",!1,!1,!1,!1,"keypress"),"autoPairAngleBracket");a.setAction("autoPairAngleBracket",function(){return this.autoPairBrackets("<",">")}.bind(this));a.setKeyBinding(new k.KeyBinding(">",!1,!1,!1,!1,"keypress"),"skipClosingAngleBracket");a.setAction("skipClosingAngleBracket",function(){return this.skipClosingBracket(">")}.bind(this));a.setKeyBinding(new k.KeyBinding("(",!1,!1,!1,!1,"keypress"),"autoPairParentheses");
a.setAction("autoPairParentheses",function(){return this.autoPairBrackets("(",")")}.bind(this));a.setKeyBinding(new k.KeyBinding(")",!1,!1,!1,!1,"keypress"),"skipClosingParenthesis");a.setAction("skipClosingParenthesis",function(){return this.skipClosingBracket(")")}.bind(this));a.setKeyBinding(new k.KeyBinding("{",!1,!1,!1,!1,"keypress"),"autoPairBraces");a.setAction("autoPairBraces",function(){return this.autoPairBrackets("{","}")}.bind(this));a.setKeyBinding(new k.KeyBinding("}",!1,!1,!1,!1,"keypress"),
"skipClosingBrace");a.setAction("skipClosingBrace",function(){return this.skipClosingBracket("}")}.bind(this));a.setKeyBinding(new k.KeyBinding("'",!1,!1,!1,!1,"keypress"),"autoPairSingleQuotation");a.setAction("autoPairSingleQuotation",function(){return this.autoPairQuotations("'")}.bind(this));a.setKeyBinding(new k.KeyBinding('"',!1,!1,!1,!1,"keypress"),"autoPairDblQuotation");a.setAction("autoPairDblQuotation",function(){return this.autoPairQuotations('"')}.bind(this));a.setAction("deletePrevious",
function(){return this.deletePrevious()}.bind(this))},autoIndent:function(){var a=this.editor,b=a.getTextView();if(b.getOptions("readonly"))return!1;var c=a.getSelection();if(c.start===c.end){for(var d=a.getModel(),e=d.getLineAtOffset(c.start),f=d.getLine(e,!1),h=d.getLineStart(e),g=0,i=c.start-h,j;g<i&&((j=f.charCodeAt(g))===32||j===9);)g++;var h=f.substring(0,g),b=b.getOptions("tabSize","expandTab"),k=b.expandTab?Array(b.tabSize+1).join(" "):"\t",b=d.getLineDelimiter(),q=/^[\s]*\/\*[\*]*[\s]*$/,
p=/^[\s]*\*/,x=/\*\/[\s]*$/,D=f.substring(0,i),A=f.substring(i),F;if(this.smartIndentation&&f.charCodeAt(F=D.trimRight().length-1)===123)return d=i-F-1,A=A.length-A.trimLeft().length,f=f.charCodeAt(i+A)===125?b+h+k+b+h:b+h+k,a.setText(f,c.start-d,c.end+A),a.setCaretOffset(c.start+b.length+h.length+k.length-d),!0;else if(this.autoCompleteComments&&!x.test(D)&&(q.test(D)||p.test(D))){if(g=q.exec(D)){f=b+h+" * ";f+=x.test(A)?A.substring(0,A.length-2).trim():A.trim();if(d.getLineCount()===e+1||!p.test(d.getLine(e+
1)))f+=b+h+" */";a.setText(f,c.start,c.end+A.length);a.setCaretOffset(c.start+b.length+h.length+3);return!0}if(g=p.exec(D))for(e-=1;e>=0;e--)if(g=d.getLine(e,!1),q.test(g))return x.test(A)||f.charCodeAt(i)===47?(f=b+h+"*"+A,h=c.start+b.length+h.length+1):(f=b+h+"* "+A,h=c.start+b.length+h.length+2),a.setText(f,c.start,c.end+A.length),a.setCaretOffset(h),!0;else if(!p.test(g))break}else if(x.test(D))return f=f.substring(c.start)+b+h.substring(0,h.length-1),a.setText(f,c.start,c.end),a.setCaretOffset(c.start+
f.length),!0;else if(g>0){for(g=i;g<f.length&&((j=f.charCodeAt(g++))===32||j===9);)c.end++;a.setText(d.getLineDelimiter()+h,c.start,c.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(),d=this._findEnclosingComment(b,c.start,c.end);if(d.commentStart!==void 0&&d.commentEnd!==void 0)return!0;b=b.getText(c.start,c.end);if(b.length===0)return!0;var d=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-d));return!0},autoPairBrackets:function(a,b){if(a==="["&&!this.autoPairSquareBrackets)return!1;else if(a==="{"&&!this.autoPairBraces)return!1;else if(a==="("&&!this.autoPairParentheses)return!1;else if(a==="<"&&!this.autoPairAngleBrackets)return!1;var c=this.editor;if(c.getTextView().getOptions("readonly"))return!1;var d=c.getSelection(),e=c.getModel(),f=c.getCaretOffset()===e.getCharCount()?"":e.getText(d.start,d.start+1).trim(),
h=/^$|[)}\]>]/;if(d.start===d.end&&h.test(f))return c.setText(a+b,d.start,d.start),c.setCaretOffset(d.start+1),!0;else if(d.start!==d.end)return e=e.getText(d.start,d.end),c.setText(a+e+b,d.start,d.end),c.setSelection(d.start+1,d.end+1),!0;return!1},autoPairQuotations:function(a){if(!this.autoPairQuotation)return!1;var b=this.editor;if(b.getTextView().getOptions("readonly"))return!1;var c=b.getSelection(),d=b.getModel(),e=b.getCaretOffset(),f=e===0?"":d.getText(c.start-1,c.start).trim(),h=e===d.getCharCount()?
"":d.getText(c.start,c.start+1).trim(),e=/^"$|^'$/,g=/\w/,i=/^$|[)}\]>]/;if(c.start!==c.end){d=d.getText(c.start,c.end);if(e.test(d))return!1;b.setText(a+d+a,c.start,c.end);b.setSelection(c.start+1,c.end+1)}else if(h===a)b.setCaretOffset(c.start+1);else if(f===a||e.test(h)||g.test(f)||!i.test(h))return!1;else b.setText(a+a,c.start,c.start),b.setCaretOffset(c.start+1);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},deletePrevious:function(){var a=this.editor;if(a.getTextView().getOptions("readonly"))return!1;
var b=a.getSelection(),c=a.getModel(),d=a.getCaretOffset(),e=d===0?"":c.getText(b.start-1,b.start),c=d===c.getCharCount()?"":c.getText(b.start,b.start+1);(e==="("&&c===")"||e==="["&&c==="]"||e==="{"&&c==="}"||e==="<"&&c===">"||e==='"'&&c==='"'||e==="'"&&c==="'")&&a.setText("",b.start,b.start+1);return!1},_findEnclosingComment:function(a,b,c){var d=a.getLineAtOffset(b),e=a.getLineAtOffset(c),f,h,g,i,j,k;for(f=d;f>=0;f--)if(h=a.getLine(f),g=f===d?b-a.getLineStart(d):h.length,i=h.lastIndexOf("/*",g),
h=h.lastIndexOf("*/",g),h>i)break;else if(i!==-1){j=a.getLineStart(f)+i;break}for(f=e;f<a.getLineCount();f++)if(h=a.getLine(f),g=f===e?c-a.getLineStart(e):0,i=h.indexOf("/*",g),h=h.indexOf("*/",g),i!==-1&&i<h)break;else if(h!==-1){k=a.getLineStart(f)+h;break}return{commentStart:j,commentEnd:k}},lineStart:function(){for(var a=this.editor,b=a.getModel(),c=a.getCaretOffset(),d=b.getLineAtOffset(c),e=b.getLineStart(d),b=b.getLine(d),d=0;d<b.length;d++){var f=b.charCodeAt(d);if(!(f===32||f===9))break}d+=
e;return c!==d?(a.setSelection(d,d),!0):!1},removeBlockComment:function(){var a=this.editor;if(a.getTextView().getOptions("readonly"))return!1;var b=a.getModel(),c=a.getSelection(),d=b.getText(c.start,c.end),e,f,h;for(h=0;h<d.length;h++)if(d.substring(h,h+2)==="/*"){e=c.start+h;break}for(;h<d.length;h++)if(d.substring(h,h+2)==="*/"){f=c.start+h;break}if(e!==void 0&&f!==void 0)a.setText(b.getText(e+2,f),e,f+2),a.setSelection(e,f);else{d=this._findEnclosingComment(b,c.start,c.end);if(d.commentStart===
void 0||d.commentEnd===void 0)return!0;b=b.getText(d.commentStart+2,d.commentEnd);a.setText(b,d.commentStart,d.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(),d=b.getLineAtOffset(c.start),e=b.getLineAtOffset(c.end>c.start?c.end-1:c.end),f=!0,h=[],g,i,j=d;j<=e;j++)if(g=b.getLine(j,!0),h.push(g),!f||(i=g.indexOf("//"))===-1)f=!1;else if(i!==0){var k;for(k=
0;k<i;k++)if(f=g.charCodeAt(k),!(f===32||f===9))break;f=k===i}j=b.getLineStart(d);k=b.getLineEnd(e,!0);if(f){for(f=0;f<h.length;f++)g=h[f],i=g.indexOf("//"),h[f]=g.substring(0,i)+g.substring(i+2);h=h.join("");g=b.getLineStart(e);b=j===c.start?c.start:c.start-2;c=c.end-2*(e-d+1)+(c.end===g+1?2:0)}else h.splice(0,0,""),h=h.join("//"),b=j===c.start?c.start:c.start+2,c=c.end+2*(e-d+1);a.setText(h,j,k);a.setSelection(b,c);return!0},trimTrailingWhitespaces:function(){var a=this.editor,b=a.getModel(),c=
a.getSelection();a.getTextView().setRedraw(!1);a.getUndoStack().startCompoundChange();for(var d=/(\s+$)/,e=b.getLineCount(),f=0;f<e;f++){var h=b.getLine(f),g=d.exec(h);if(g){var i=b.getLineStart(f),h=g[0].length,g=i+g.index;b.setText("",g,g+h);if(c.start>g)c.start=Math.max(g,c.start-h);if(c.start!==c.end&&c.end>g)c.end=Math.max(g,c.end-h)}}a.getUndoStack().endCompoundChange();a.getTextView().setRedraw(!0);a.setSelection(c.start,c.end,!1)},startUndo:function(){this.undoStack&&this.undoStack.startCompoundChange()},
skipClosingBracket:function(a){var b=this.editor;if(b.getTextView().getOptions("readonly"))return!1;var c=b.getSelection(),d=b.getModel();return(b.getCaretOffset()===d.getCharCount()?"":d.getText(c.start,c.start+1))===a?(b.setCaretOffset(c.start+1),!0):!1},endUndo:function(){this.undoStack&&this.undoStack.endCompoundChange()},setAutoPairParentheses:function(a){this.autoPairParentheses=a},setAutoPairBraces:function(a){this.autoPairBraces=a},setAutoPairSquareBrackets:function(a){this.autoPairSquareBrackets=
a},setAutoPairAngleBrackets:function(a){this.autoPairAngleBrackets=a},setAutoPairQuotations:function(a){this.autoPairQuotation=a},setAutoCompleteComments:function(a){this.autoCompleteComments=a},setSmartIndentation:function(a){this.smartIndentation=a}};d.SourceCodeActions=f;if(!String.prototype.trimLeft)String.prototype.trimLeft=function(){return this.replace(/^\s+/g,"")};if(!String.prototype.trimRight)String.prototype.trimRight=function(){return this.replace(/\s+$/g,"")};return d});
define("orion/editor/undoStack",[],function(){function g(e,c,g,b){this.offset=e;this.text=c;this.previousText=g;this.type=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 g=e.getModel();g.getBaseModel&&(g=g.getBaseModel());this.model=g;var b=this;this._listener={onChanging:function(c){b._onChanging(c)},onDestroy:function(c){b._onDestroy(c)}};g.addEventListener("Changing",this._listener.onChanging);e.addEventListener("Destroy",this._listener.onDestroy)}
g.prototype={getRedoChanges:function(){return[{start:this.offset,end:this.offset+this.previousText.length,text:this.text}]},getUndoChanges:function(){return[{start:this.offset,end:this.offset+this.text.length,text:this.previousText}]},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},merge:function(e,c,g,b,f){if(b===this.type)if(b===1&&e===this.offset+this.text.length)return this.text+=
c,!0;else if(b===-1&&f===this.offset)return this.offset=e,this.previousText=g+this.previousText,!0;else if(b===-1&&e===this.offset)return this.previousText+=g,!0;return!1},_doUndoRedo:function(e,c,g,b,f){var h=b.getModel();if(h.mapOffset&&b.annotationModel){var d=h.mapOffset(e,!0);if(d<0)for(var a=b.annotationModel.getAnnotations(e,e+1);a.hasNext();){var j=a.next();if(j.type==="orion.annotation.folding"){j.expand();d=h.mapOffset(e,!0);break}}if(d<0)return;e=d}h.setText(c,e,e+g.length);f&&b.setSelection(e,
e+c.length)}};k.prototype={getRedoChanges:function(){for(var e=[],c=0;c<this.changes.length;c++)e=e.concat(this.changes[c].getRedoChanges());return e},getUndoChanges:function(){for(var e=[],c=this.changes.length-1;c>=0;c--)e=e.concat(this.changes[c].getUndoChanges());return e},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 g=this.changes.length-
1;g>=0;g--)this.changes[g].undo(e,!1);this.changes.length>1&&e.setRedraw(!0);if(c){var g=this.startSelection.start,b=this.startSelection.end;e.setSelection(this.startCaret?g:b,this.startCaret?b:g)}(g=this.owner)&&g.undo&&g.undo();return this.changes.length>0},redo:function(e,c){this.changes.length>1&&e.setRedraw(!1);for(var g=0;g<this.changes.length;g++)this.changes[g].redo(e,!1);this.changes.length>1&&e.setRedraw(!0);if(c){var g=this.endSelection.start,b=this.endSelection.end;e.setSelection(this.endCaret?
g:b,this.endCaret?b:g)}(g=this.owner)&&g.redo&&g.redo();return this.changes.length>0},merge:function(e,c,g,b,f){var h=this.changes.length;return h>0?this.changes[h-1].merge(e,c,g,b,f):!1},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--))},markClean:function(){this._commitUndo();if(this.cleanChange=this.stack[this.index-1])this.cleanChange.type=2},isClean:function(){return this.cleanChange===this.stack[this.index-1]},canUndo:function(){return this.index>0},canRedo:function(){return this.stack.length-this.index>0},endCompoundChange:function(){this.compoundChange&&this.compoundChange.end(this.view);this.compoundChange=void 0},getSize:function(){return{undo:this.index,redo:this.stack.length-this.index}},getRedoChanges:function(){this._commitUndo();
for(var e=[],c=this.index;c<this.stack.length;c++)e=e.concat(this.stack[c].getRedoChanges());return e},getUndoChanges:function(){this._commitUndo();for(var e=[],c=this.index;c>=0;c--)e=e.concat(this.stack[c].getUndoChanges());return 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=0;this.cleanChange=void 0;this.stack=[];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(){this.endCompoundChange()},_onDestroy:function(){this.model.removeEventListener("Changing",this._listener.onChanging);
this.view.removeEventListener("Destroy",this._listener.onDestroy)},_onChanging:function(e){if(!this._ignoreUndo){var c=e.text,i=e.start,b=e.addedCharCount,f=e.removedCharCount,e=i+f,h=0;b===0&&f===1?h=-1:b===1&&f===0&&(h=1);b=this.stack.length;f=this.model.getText(i,e);(!(b>0&&this.index===b)||!this.stack[b-1].merge(i,c,f,h,e))&&this.add(new g(i,c,f,h))}}};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(b,a,c,e){this._location=a||"left";this._overview=c||"page";this._rulerStyle=e;this._view=null;var f=this;this._listener={onTextModelChanged:function(a){f._onTextModelChanged(a)},onAnnotationModelChanged:function(a){f._onAnnotationModelChanged(a)}};this.setAnnotationModel(b)}function i(b,a,e,f,h){c.call(this,b,a,"page",e);this._oddStyle=f||{style:{backgroundColor:"white"}};
this._evenStyle=h||{style:{backgroundColor:"white"}};this._numOfDigits=0;this._firstLine=1}function b(b,a,e){c.call(this,b,a,"page",e)}function f(b,a,e){c.call(this,b,a,"document",e)}function h(c,a,e){b.call(this,c,a,e)}c.prototype={getAnnotations:function(b,a){var c=this._annotationModel;if(!c)return[];var e=this._view.getModel(),f=e.getLineStart(b),h=e.getLineEnd(a-1),g=e;e.getBaseModel&&(g=e.getBaseModel(),f=e.mapOffset(f),h=e.mapOffset(h));for(var i=[],c=this.getAnnotationsByType(c,f,h),f=0;f<
c.length;f++)for(var h=c[f],j=g.getLineAtOffset(h.start),k=g.getLineAtOffset(Math.max(h.start,h.end-1)),w=j;w<=k;w++){var v=w;if(e!==g){v=g.getLineStart(w);v=e.mapOffset(v,!0);if(v===-1)continue;v=e.getLineAtOffset(v)}if(b<=v&&v<a){var q=this._mergeAnnotation(i[v],h,w-j,k-j+1);q&&(i[v]=q)}}if(!this._multiAnnotation&&this._multiAnnotationOverlay)for(var p in i)i[p]._multiple&&(i[p].html+=this._multiAnnotationOverlay.html);return i},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(b){this._annotationModel&&this._annotationModel.removEventListener("Changed",this._listener.onAnnotationModelChanged);(this._annotationModel=b)&&this._annotationModel.addEventListener("Changed",this._listener.onAnnotationModelChanged)},setMultiAnnotation:function(b){this._multiAnnotation=b},setMultiAnnotationOverlay:function(b){this._multiAnnotationOverlay=
b},setView:function(b){this._onTextModelChanged&&this._view&&this._view.removeEventListener("ModelChanged",this._listener.onTextModelChanged);this._view=b;this._onTextModelChanged&&this._view&&this._view.addEventListener("ModelChanged",this._listener.onTextModelChanged)},onClick:function(b){if(b!==void 0){var a=this._view,c=a.getModel(),e=c,f=c.getLineStart(b),h=f,g=f,i=this._annotationModel;if(i){a=a.getSelection();g=c.getLineEnd(b,!0);if(f<=a.start&&a.start<g)f=a.start;c.getBaseModel&&(f=c.mapOffset(f),
g=c.mapOffset(g),e=c.getBaseModel());for(var k,g=i.getAnnotations(f,g),i=null;!k&&g.hasNext();)a=g.next(),this.isAnnotationTypeVisible(a.type)&&(i=a,a.start<=f||(k=a));if(i&&i.groupId!==void 0)this._currentClickGroup=this._currentClickGroup===i.groupId?null:i.groupId,this._setCurrentGroup(b);k&&e.getLineAtOffset(k.start)===e.getLineAtOffset(f)?(f=k.start,g=k.end):g=f=h;c.getBaseModel&&(f=c.mapOffset(f,!0),g=c.mapOffset(g,!0))}(b=j.Tooltip.getTooltip(this._view))&&b.setTarget(null);this._view.setSelection(g,
f,1/3,function(){})}},onDblClick:function(){},onMouseMove:function(b,a){var c=j.Tooltip.getTooltip(this._view);if(c&&!(c.isVisible()&&this._tooltipLineIndex===b)){this._tooltipLineIndex=b;var e=this;c.setTarget({y:a.clientY,getTooltipInfo:function(){return e._getTooltipInfo(e._tooltipLineIndex,this.y)}})}},onMouseOver:function(b,a){this.onMouseMove(b,a);this._currentClickGroup||this._setCurrentGroup(b)},onMouseOut:function(){this._currentClickGroup||this._setCurrentGroup(-1);var b=j.Tooltip.getTooltip(this._view);
b&&b.setTarget(null)},_getTooltipInfo:function(b,a){if(b!==void 0){var c=this._view,e=c.getModel(),f=this._annotationModel,h=[];if(f){var h=e.getLineStart(b),g=e.getLineEnd(b);e.getBaseModel&&(h=e.mapOffset(h),g=e.mapOffset(g));h=this.getAnnotationsByType(f,h,g)}f=this._getTooltipContents(b,h);if(!f)return null;f={contents:f,anchor:this.getLocation()};h=c.getClientArea();h.y=this.getOverview()==="document"?c.convert({y:a},"view","document").y:c.getLocationAtOffset(e.getLineStart(b)).y;c.convert(h,
"document","page");f.x=h.x;f.y=h.y;f.anchor==="right"&&(f.x+=h.width);return f}},_getTooltipContents:function(b,a){return a},_onAnnotationModelChanged:function(b){function a(a){for(var b=0;b<a.length;b++)if(f.isAnnotationTypeVisible(a[b].type)){var d=a[b].start,h=a[b].end;e.getBaseModel&&(d=e.mapOffset(d,!0),h=e.mapOffset(h,!0));d!==-1&&h!==-1&&c.redrawLines(e.getLineAtOffset(d),e.getLineAtOffset(Math.max(d,h-1))+1,f)}}var c=this._view;if(c){var e=c.getModel(),f=this,h=e.getLineCount();b.textModelChangedEvent?
(b=b.textModelChangedEvent.start,e.getBaseModel&&(b=e.mapOffset(b,!0)),b=e.getLineAtOffset(b),c.redrawLines(b,h,f)):(a(b.added),a(b.removed),a(b.changed))}},_mergeAnnotation:function(b,a,c){b||(b={});if(c===0)if(b.html&&a.html){if(a.html!==b.html&&!b._multiple&&this._multiAnnotation)b.html=this._multiAnnotation.html;b._multiple=!0}else b.html=a.html;b.style=this._mergeStyle(b.style,a.style);return b},_mergeStyle:function(b,a){if(a){b||(b={});b.styleClass&&a.styleClass&&b.styleClass!==a.styleClass?
b.styleClass+=" "+a.styleClass:b.styleClass=a.styleClass;var c;if(a.style){if(!b.style)b.style={};for(c in a.style)b.style[c]===void 0&&(b.style[c]=a.style[c])}if(a.attributes){if(!b.attributes)b.attributes={};for(c in a.attributes)b.attributes[c]===void 0&&(b.attributes[c]=a.attributes[c])}}return b},_setCurrentGroup:function(b){var a=this._annotationModel,c=null,e=a.getTextModel(),f,h,g=this._currentGroupAnnotation;if(b!==-1){var i=e.getLineStart(b),j=e.getLineEnd(b);e.getBaseModel&&(i=e.mapOffset(i),
j=e.mapOffset(j));for(h=a.getAnnotations(i,j);h.hasNext();)if(f=h.next(),this.isAnnotationTypeVisible(f.type)&&f.start<=i&&f.end>=j&&f.groupId!==void 0){c=f;break}if(g&&c&&g.groupId===c.groupId)return}this._currentGroupAnnotation=null;g&&a.removeAnnotations(g.groupType);if(c&&b!==-1){this._currentGroupAnnotation=c;h=a.getAnnotations(0,e.getCharCount());for(b=[];h.hasNext();)f=h.next(),delete f.groupAnnotation,f.groupId===c.groupId&&(f=f.createGroupAnnotation(),b.push(f));a.replaceAnnotations(null,
b)}}};k.AnnotationTypeList.addMixin(c.prototype);i.prototype=new c;i.prototype.getAnnotations=function(b,a){for(var e=c.prototype.getAnnotations.call(this,b,a),f=this._view.getModel(),h=b;h<a;h++){var g=h&1?this._oddStyle:this._evenStyle,i=h;f.getBaseModel&&(i=f.getLineStart(i),i=f.getBaseModel().getLineAtOffset(f.mapOffset(i)));e[h]||(e[h]={});e[h].html=this._firstLine+i+"";if(!e[h].style)e[h].style=g}return e};i.prototype.getWidestAnnotation=function(){var b=this._view.getModel().getLineCount();
return this.getAnnotations(b-1,b)[b-1]};i.prototype.setFirstLine=function(b){this._firstLine=b!==void 0?b:1};i.prototype._onTextModelChanged=function(b){var b=b.start,a=this._view.getModel(),c=(this._firstLine+(a.getBaseModel?a.getBaseModel().getLineCount():a.getLineCount())-1+"").length;if(this._numOfDigits!==c)this._numOfDigits=c,this._view.redrawLines(a.getLineAtOffset(b),a.getLineCount(),this)};b.prototype=new c;f.prototype=new c;f.prototype.getRulerStyle=function(){var b={style:{lineHeight:"1px",
fontSize:"1px"}};return b=this._mergeStyle(b,this._rulerStyle)};f.prototype._getTooltipContents=function(b,a){if(a.length===0){var f=this._view.getModel(),h=b;f.getBaseModel&&(h=f.getLineStart(h),h=f.getBaseModel().getLineAtOffset(f.mapOffset(h)));return e.formatMessage(g.line,h+1)}return c.prototype._getTooltipContents.call(this,b,a)};f.prototype._mergeAnnotation=function(b,a,c,e){if(c===0){if(!b)b={html:"&nbsp;",style:{style:{height:3*e+"px"}}},b.style=this._mergeStyle(b.style,a.overviewStyle);
return b}};h.prototype=new b;h.prototype.onClick=function(b){if(b!==void 0){var a=this._annotationModel;if(a){var c=this._view.getModel(),e=c.getLineStart(b),b=c.getLineEnd(b,!0);c.getBaseModel&&(e=c.mapOffset(e),b=c.mapOffset(b),c=c.getBaseModel());for(var f,a=a.getAnnotations(e,b);!f&&a.hasNext();)b=a.next(),this.isAnnotationTypeVisible(b.type)&&(f=b);f&&c.getLineAtOffset(f.start)===c.getLineAtOffset(e)&&((c=j.Tooltip.getTooltip(this._view))&&c.setTarget(null),f.expanded?f.collapse():f.expand(),
this._annotationModel.modifyAnnotation(f))}}};h.prototype._getTooltipContents=function(c,a){return a.length===1&&a[0].expanded?null:b.prototype._getTooltipContents.call(this,c,a)};h.prototype._onAnnotationModelChanged=function(c){function a(a){for(g=0;g<a.length;g++)if(h.isAnnotationTypeVisible(a[g].type)){var b=a[g].start;f.getBaseModel&&(b=f.mapOffset(b,!0));b!==-1&&(j=Math.min(j,f.getLineAtOffset(b)))}}if(c.textModelChangedEvent)b.prototype._onAnnotationModelChanged.call(this,c);else{var e=this._view;
if(e){var f=e.getModel(),h=this,g,i=f.getLineCount(),j=i;a(c.added);a(c.removed);a(c.changed);c=e.getRulers();for(g=0;g<c.length;g++)e.redrawLines(j,i,c[g])}}};return{Ruler:c,AnnotationRuler:b,LineNumberRuler:i,OverviewRuler:f,FoldingRuler:h}});
define("orion/editor/textDND",["orion/util"],function(g){function k(g,e){this._view=g;this._undoStack=e;this._dragSelection=null;this._dropOffset=-1;this._dropText=null;var c=this;this._listener={onDragStart:function(e){c._onDragStart(e)},onDragEnd:function(e){c._onDragEnd(e)},onDragEnter:function(e){c._onDragEnter(e)},onDragOver:function(e){c._onDragOver(e)},onDrop:function(e){c._onDrop(e)},onDestroy:function(e){c._onDestroy(e)}};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)}k.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 e=this._view,c=e.getSelection(),e=e.getModel();if(e.getBaseModel)c.start=e.mapOffset(c.start),c.end=e.mapOffset(c.end),e=e.getBaseModel();if(e=e.getText(c.start,c.end))this._dragSelection=c,g.event.dataTransfer.effectAllowed="copyMove",g.event.dataTransfer.setData("Text",e)},_onDragEnd:function(j){if(this._dragSelection){var e=
this._view,c=j.event.dataTransfer.dropEffect;if(!g.isFirefox&&(c!=="none"||this._dropText))c=j.event.dataTransfer.dropEffect=this._dropEffect;this._undoStack&&this._undoStack.startCompoundChange();(j=c==="move")&&e.setText("",this._dragSelection.start,this._dragSelection.end);if(this._dropText){var c=this._dropText,i=this._dropOffset;if(j)if(i>=this._dragSelection.end)i-=this._dragSelection.end-this._dragSelection.start;else if(i>=this._dragSelection.start)i=this._dragSelection.start;e.setText(c,
i,i);e.setSelection(i,i+c.length);this._dropText=null;this._dropOffset=-1}this._undoStack&&this._undoStack.endCompoundChange()}this._dragSelection=null},_onDragEnter:function(g){this._onDragOver(g)},_onDragOver:function(j){var e=j.event.dataTransfer.types,c=!this._view.getOptions("readonly");c&&e&&(c=e.contains?e.contains("text/plain")||e.contains("Text"):e.indexOf("text/plain")!==-1||e.indexOf("Text")!==-1);if(c){if(!g.isFirefox)this._dropEffect=j.event.dataTransfer.dropEffect=(g.isMac?j.event.altKey:
j.event.ctrlKey)?"copy":"move"}else j.event.dataTransfer.dropEffect="none"},_onDrop:function(j){var e=this._view,c=j.event.dataTransfer.getData("Text");if(c){if(!g.isFirefox)j.event.dataTransfer.dropEffect=this._dropEffect;j=e.getOffsetAtLocation(j.x,j.y);this._dragSelection?(this._dropOffset=j,this._dropText=c):(e.setText(c,j,j),e.setSelection(j,j+c.length))}}};return{TextDND:k}});
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={},i,b=c.delimiter!==void 0?c.delimiter:"\n";c.indentation&&(b+=c.indentation);for(var f=c.tab!==void 0?c.tab:"\t",h=0,d=this.variables,a=this.segments,c=[],k=0;k<a.length;k++){var n=a[k],m=d[n];if(m!==void 0)switch(n){case "${tab}":n=
f;break;case "${delimiter}":n=b;break;case "${cursor}":n="";i=h;break;default:var o=e[n];o||(o=e[n]={data:m.data,positions:[]});n=m.substitution;o.data&&o.data.values&&(n=o.data.values[0]);o.positions.push({offset:g+h,length:n.length})}c.push(n);h+=n.length}var b=[],t;for(t in e)e.hasOwnProperty(t)&&b.push(e[t]);c=c.join("");if(i===void 0)i=c.length;return{proposal:c,description:this.description,groups:b,escapePosition:g+i}},match:function(g){return this.prefix.indexOf(g)===0},_parse:function(){var g=
this.template,e=[],c={},i,b=0,g=g.replace(/\n/g,"${delimiter}"),g=g.replace(/\t/g,"${tab}");g.replace(/\$\{((?:[^\\}]+|\\.))*\}/g,function(f,h,d){var a=f.substring(2,f.length-1),h=f,k=a,n=null,m=k.indexOf(":");m!==-1&&(k=k.substring(0,m),h="${"+k+"}",n=JSON.parse(a.substring(m+1).replace("\\}","}").trim()));(a=c[h])||(a=c[h]={});a.substitution=k;if(n)a.data=n;(i=g.substring(b,d))&&e.push(i);e.push(h);b=d+f.length;return k});(i=g.substring(b,g.length))&&e.push(i);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 i=this.getPrefix(g,e,c),b=[];if(!this.isValid(i,g,e,c))return b;b=b.concat(this.getTemplateProposals(i,e,c));return b=b.concat(this.getKeywordProposals(i))},getKeywords:function(){return this._keywords},getKeywordProposals:function(g){var e=[],c=this.getKeywords();if(c)for(var i=0;i<c.length;i++)c[i].indexOf(g)===0&&
e.push({proposal:c[i].substring(g.length),description:c[i]});return e},getPrefix:function(g,e,c){return c.prefix},getTemplates:function(){return this._templates},getTemplateProposals:function(g,e,c){for(var i=[],b=this.getTemplates(),f=0;f<b.length;f++){var h=b[f];h.match(g)&&(h=h.getProposal(g,e,c),this.removePrefix(g,h),i.push(h))}return i},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,i){function b(b,c,a){var e=b.getTextView();j.KeyMode.call(this,e);this.editor=b;this.undoStack=c;this.contentAssist=a;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.editor.mapOffset(a.start),c=this.linkedModeModel,d,e;c;)if(d=this._getPositionChanged(c,b,b+a.removedCharCount),e=d.position,e===void 0||e.model!==c)this.exitLinkedMode(!1),c=this.linkedModeModel;else break;if(c){c=0;a=a.addedCharCount-a.removedCharCount;d=d.positions;for(var f,h=0;h<d.length;++h){f=d[h];e=f.position;var g=e.offset<=b&&b<=e.offset+e.length;g&&!f.ansestor?(e.offset+=c,e.length+=a,c+=a):(e.offset+=c,f.ansestor&&g&&(e.length+=
a));if(f.escape)f.model.escapePosition=e.offset}this._updateAnnotations(d)}}}.bind(this),onVerify:function(a){if(!this.ignoreVerify){for(var b=this.editor,c=b.mapOffset(a.start),d=this.editor.mapOffset(a.end),e=this.linkedModeModel,f,h;e;)if(f=this._getPositionChanged(e,c,d),h=f.position,h===void 0||h.model!==e)this.exitLinkedMode(!1),e=this.linkedModeModel;else break;if(e){var g=this._compoundChange;g?g.owner.model===e&&g.owner.group===h.group||(this.endUndo(),this.startUndo()):this.startUndo();
e.selectedGroupIndex=h.group;var g=0,i=a.text.length-(d-c);f=f.positions;var j;c-=h.position.offset;for(var k=d-h.position.offset,l=0;l<f.length;++l)if(j=f[l],d=j.position,j.oldOffset=d.offset,j.model===e&&j.group===h.group?(d.offset+=g,d.length+=i,g+=i):(d.offset+=g,j.ansestor&&(d.length+=h.count*i)),j.escape)j.model.escapePosition=d.offset;this.ignoreVerify=!0;for(l=f.length-1;l>=0;l--)j=f[l],j.model===e&&j.group===h.group&&b.setText(a.text,j.oldOffset+c,j.oldOffset+k);this.ignoreVerify=!1;a.text=
null;this._updateAnnotations(f)}}}.bind(this)}}var f={};b.prototype=new j.KeyMode;i.mixin(b.prototype,{createKeyBindings:function(){var b=k.KeyBinding,c=[];c.push({actionID:"linkedModeEnter",keyBinding:new b(13)});c.push({actionID:"linkedModeCancel",keyBinding:new b(27)});c.push({actionID:"linkedModeNextGroup",keyBinding:new b(9)});c.push({actionID:"linkedModePreviousGroup",keyBinding:new b(9,!1,!0)});return c},enterLinkedMode:function(b){if(!this.linkedModeModel){var c=this.editor.getTextView();
c.addKeyMode(this);c.addEventListener("Verify",this.linkedModeListener.onVerify);c.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)b.previousModel=this.linkedModeModel,b.parentGroup=this.linkedModeModel.selectedGroupIndex,this.linkedModeModel.nextModel=b;this.linkedModeModel=b;this.selectLinkedGroup(0)},
exitLinkedMode:function(b){if(this.isActive()){if(this._compoundChange)this.endUndo(),this._compoundChange=null;this._sortedPositions=null;var c=this.linkedModeModel;this.linkedModeModel=c.previousModel;c.parentGroup=c.previousModel=void 0;if(this.linkedModeModel)this.linkedModeModel.nextModel=void 0;if(!this.linkedModeModel){var a=this.editor,e=a.getTextView();e.removeKeyMode(this);e.removeEventListener("Verify",this.linkedModeListener.onVerify);e.removeEventListener("ModelChanged",this.linkedModeListener.onModelChanged);
e=this.contentAssist;e.removeEventListener("Activating",this.linkedModeListener.onActivating);e.offset=void 0;this.editor.reportStatus(g.linkedModeExited,null,!0);b&&a.setCaretOffset(c.escapePosition,!1)}this.selectLinkedGroup(0)}},startUndo:function(){if(this.undoStack){var b=this,c=this.linkedModeModel;this._compoundChange=this.undoStack.startCompoundChange({model:c,group:c.selectedGroupIndex,end:function(){b._compoundChange=null}})}},endUndo:function(){this.undoStack&&this.undoStack.endCompoundChange()},
isActive:function(){return!!this.linkedModeModel},isStatusActive:function(){return!!this.linkedModeModel},selectLinkedGroup:function(b){var d=this.linkedModeModel;if(d){d.selectedGroupIndex=b;var b=d.groups[b],a=b.positions[0],e=this.editor;e.setSelection(a.offset,a.offset+a.length);if(d=this.contentAssist)if(d.offset=void 0,b.data&&b.data.type==="link"&&b.data.values)(this._groupContentAssistProvider=new c.TemplateContentAssist(b.data.values)).getPrefix=function(){var b=e.getSelection();return b.start===
b.end&&(b=e.getCaretOffset(),a.offset<=b&&b<=a.offset+a.length)?e.getText(a.offset,b):""},d.offset=a.offset,d.deactivate(),d.activate();else if(this._groupContentAssistProvider)this._groupContentAssistProvider=null,d.deactivate()}this._updateAnnotations()},_getModelPositions:function(b,c,a){for(var e=c.groups,f=0;f<e.length;f++)for(var g=e[f].positions,i=0;i<g.length;i++){var j=g[i];a&&(j={offset:j.offset+a,length:j.length});j={index:i,group:f,count:g.length,model:c,position:j};b.push(j);if(c.nextModel&&
c.nextModel.parentGroup===f)j.ansestor=!0,this._getModelPositions(b,c.nextModel,(a||0)+g[i].offset-g[0].offset)}},_getSortedPositions:function(b){var c=this._sortedPositions;if(!c){for(c=[];b.previousModel;)b=b.previousModel;for(this._getModelPositions(c,b);b;)b.escapePosition!==void 0&&c.push({escape:!0,model:b,position:{offset:b.escapePosition,length:0}}),b=b.nextModel;c.sort(function(a,b){return a.position.offset-b.position.offset});this._sortedPositions=c}return c},_getPositionChanged:function(b,
c,a){for(var e,b=this._getSortedPositions(b),f=b.length-1;f>=0;f--){var g=b[f].position;if(g.offset<=c&&a<=g.offset+g.length){e=b[f];break}}return{position:e,positions:b}},_updateAnnotations:function(b){var c=this.editor.getAnnotationModel();if(c){for(var a=[],f=[],g=c.getTextModel(),g=c.getAnnotations(0,g.getCharCount()),i;g.hasNext();)switch(i=g.next(),i.type){case e.AnnotationType.ANNOTATION_LINKED_GROUP:case e.AnnotationType.ANNOTATION_CURRENT_LINKED_GROUP:case e.AnnotationType.ANNOTATION_SELECTED_LINKED_GROUP:a.push(i)}if(g=
this.linkedModeModel)for(var b=b||this._getSortedPositions(g),j=0;j<b.length;j++)if(i=b[j],i.model===g){var k=e.AnnotationType.ANNOTATION_LINKED_GROUP;i.group===g.selectedGroupIndex&&(k=i.index===0?e.AnnotationType.ANNOTATION_SELECTED_LINKED_GROUP:e.AnnotationType.ANNOTATION_CURRENT_LINKED_GROUP);i=i.position;i=e.AnnotationType.createAnnotation(k,i.offset,i.offset+i.length,"");f.push(i)}c.replaceAnnotations(a,f)}}});f.LinkedMode=b;return f});
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,i){function b(){}function f(){}function h(){}function d(){}function a(){}function l(){}var n={};b.prototype={createKeyBindings:function(a,b,c,d){var d=new g.TextActions(a,b,d),e=new i.LinkedMode(a,b,c),a=new g.SourceCodeActions(a,b,c,e);return{textActions:d,linkedMode:e,sourceCodeActions:a}}};n.KeyBindingsFactory=
b;f.prototype={createUndoStack:function(a){a=a.getTextView();return new k.UndoStack(a,200)}};n.UndoFactory=f;h.prototype={createLineNumberRuler:function(a){return new j.LineNumberRuler(a,"left",{styleClass:"ruler lines"},{styleClass:"rulerLines odd"},{styleClass:"rulerLines even"})}};n.LineNumberRulerFactory=h;d.prototype={createFoldingRuler:function(a){return new j.FoldingRuler(a,"left",{styleClass:"ruler folding"})}};n.FoldingRulerFactory=d;a.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=a;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","orion/objects"],function(g,k,j,e){return e.mixin({},g,k,j)});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(c){this._parentDivID=c.parentDivID;this._commandSpanId=c.commandSpanId;this._showTitle=c.showTitle;this._leftTitle=c.leftTitle;this._rightTitle=c.rightTitle;this._showLineStatus=c.showLineStatus}c.prototype={_init:function(){var c=this._parentDivID+"_";this._topWidgetDiv=g.node("topWidget_id");
this._topWidgetDiv.id=c+"topWidget_id";this._leftEditorParentDiv=g.node("left_editor_id");this._leftEditorParentDiv.id=c+"left_editor_id";this._rightEditorParentDiv=g.node("right_editor_id");this._rightEditorParentDiv.id=c+"right_editor_id";this._rightEditorWrapperDiv=g.node("right_editor_wrapper_id");this._rightEditorWrapperDiv.id=c+"right_editor_wrapper_id";this._leftTitleDiv=g.node("left_title_id");this._leftTitleDiv.id=c+"left_title_id";this._rightTitleDiv=g.node("right_title_id");this._rightTitleDiv.id=
c+"right_title_id";this._leftStatusDiv=g.node("left_status_id");this._leftStatusDiv.id=c+"left_status_id";this._rightStatusDiv=g.node("right_status_id");this._rightStatusDiv.id=c+"right_status_id";this._diffCanvasDiv=g.node("diff_canvas_id");this._diffCanvasDiv.id=c+"diff_canvas_id";this._splitterId=c+"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 c=g.$(".split",this._topWidgetDiv);c.id=this._splitterId;var b=g.$(".leftPanelLayout",this._topWidgetDiv),e=g.$(".rightPanelLayout",this._topWidgetDiv);if(c&&b&&e)this._splitter=new k.Splitter({node:c,sidePanel:b,mainPanel:e})},buildUI:function(){g.node(this._parentDivID).innerHTML=
j;this._init();this._createSplitter()},destroy:function(){},getSplitter:function(){return this._splitter},isLeftPane:function(c){return g.$(".leftPanelLayout",this._topWidgetDiv)===c},getEditorParentDiv:function(c){return c?this._leftEditorParentDiv:this._rightEditorParentDiv},getTitleDiv:function(c){return c?this._leftTitleDiv:this._rightTitleDiv},getStatusDiv:function(c){return c?this._leftStatusDiv:this._rightStatusDiv},getCommandSpanId:function(){return this._commandSpanId},getDiffCanvasDiv:function(){return this._diffCanvasDiv}};
return c}();return e});
var JsDiff=function(){function g(b){for(var c=[],d=0;d<b.length;d++)b[d]&&c.push(b[d]);return c}function k(b){b=b.replace(/&/g,"&amp;");b=b.replace(/</g,"&lt;");b=b.replace(/>/g,"&gt;");return b=b.replace(/"/g,"&quot;")}var j=function(b){this.ignoreWhitespace=b};j.prototype={diff:function(b,c){if(c==b)return[{value:c}];if(!c)return[{value:b,removed:!0}];if(!b)return[{value:c,added:!0}];var c=this.tokenize(c),b=this.tokenize(b),d=c.length,a=b.length,e=d+a,g=[{newPos:-1,components:[]}],i=this.extractCommon(g[0],
c,b,0);if(g[0].newPos+1>=d&&i+1>=a)return g[0].components;for(var j=1;j<=e;j++)for(var k=-1*j;k<=j;k+=2){var s;s=g[k-1];var r=g[k+1],i=(r?r.newPos:0)-k;s&&(g[k-1]=void 0);var u=s&&s.newPos+1<d,w=r&&0<=i&&i<a;if(!u&&!w)g[k]=void 0;else if(!u||w&&s.newPos<r.newPos?(s={newPos:r.newPos,components:r.components.slice(0)},this.pushComponent(s.components,b[i],void 0,!0)):(s={newPos:s.newPos,components:s.components.slice(0)},s.newPos++,this.pushComponent(s.components,c[s.newPos],!0,void 0)),i=this.extractCommon(s,
c,b,k),s.newPos+1>=d&&i+1>=a)return s.components;else g[k]=s}},pushComponent:function(b,c,d,a){var e=b[b.length-1];e&&e.added===d&&e.removed===a?b[b.length-1]={value:this.join(e.value,c),added:d,removed:a}:b.push({value:c,added:d,removed:a})},extractCommon:function(b,c,d,a){for(var e=c.length,g=d.length,i=b.newPos,a=i-a;i+1<e&&a+1<g&&this.equals(c[i+1],d[a+1]);)i++,a++,this.pushComponent(b.components,c[i],void 0,void 0);b.newPos=i;return a},equals:function(b,c){var d=/\S/;return this.ignoreWhitespace&&
!d.test(b)&&!d.test(c)?!0:b==c},join:function(b,c){return b+c},tokenize:function(b){return b}};var e=new j,c=new j(!1);c.tokenize=function(b){return g(b.split(/(\s+|\b)/))};var i=new j(!0);i.tokenize=function(b){return g(b.split(/([{}:;,]|\s+)/))};var b=new j;b.tokenize=function(b){return b.split(/^/m)};return{diffChars:function(b,c){return e.diff(b,c)},diffWords:function(b,e){return c.diff(b,e)},diffLines:function(c,e){return b.diff(c,e)},diffCss:function(b,c){return i.diff(b,c)},createPatch:function(c,
e,d,a,g){var i=[];i.push("Index: "+c);i.push("===================================================================");i.push("--- "+c+"\t"+a);i.push("+++ "+c+"\t"+g);c=b.diff(e,d);c.push({value:"",lines:[]});for(var d=e=0,a=[],j=g=1,k=0;k<c.length;k++){var t=c[k],s=t.lines||t.value.replace(/\n$/,"").split("\n");t.lines=s;if(t.added||t.removed){if(!e){var r=c[k-1],e=g,d=j;r&&(a.push.apply(a,r.lines.slice(-4).map(function(a){return" "+a})),e-=4,d-=4)}a.push.apply(a,s.map(function(a){return(t.added?"+":
"-")+a}));t.added?j+=s.length:g+=s.length}else e&&(s.length<=8&&k<c.length-1?a.push.apply(a,s.map(function(a){return" "+a})):(r=Math.min(s.length,4),i.push("@@ -"+e+","+(g-e+r)+" +"+d+","+(j-d+r)+" @@"),i.push.apply(i,a),i.push.apply(i,s.slice(0,r).map(function(a){return" "+a})),d=e=0,a=[])),g+=s.length,j+=s.length}c.length>1&&!/\n$/.test(c[c.length-2].value)&&i.push("\\ No newline at end of file\n");return i.join("\n")},convertChangesToXML:function(b){for(var c=[],d=0;d<b.length;d++){var a=b[d];
a.added?c.push("<ins>"):a.removed&&c.push("<del>");c.push(k(a.value));a.added?c.push("</ins>"):a.removed&&c.push("</del>")}return c.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,g){return c.value===e&&g!==e},adapt:function(e,c,i){i||(i="\n");for(var b=e.split(i),f=c.split(i),h=b[b.length-1]==="",f=f[f.length-1]==="",d=g.diffLines(e,c),e=[],c=[],a=0,j=0,k=-1,m=0,o=!0,t=i,s=0;s<d.length;s++){var r=d[s],u=r.lines||r.value.split(i),w=u.length,v=0;u.length>1&&u[u.length-1]===""&&w--;w>1&&!o&&u[0]===""&&(w--,v++);r.lines=u;
if(!r.added&&!r.removed){if(!this._specialLine(i,r,t)){if(a||j)e.push([a,j,k]),j=a=0,k=-1,m+=j;e.push([w,w,0]);m+=w}}else if(r.added){k===-1&&(k=c.length+1);a+=w;for(o=v;o<w+v;o++)c.push(r.lines[o])}else j+=w;o=!1;u.length>1&&u[u.length-1]===""&&(o=!0);t=r.value?r.value[r.value.length-1]:i}if(a||j)e.push([a,j,k]),m+=j;m<b.length&&b.length>1&&(i=e[e.length-1],i[2]===0?(i[0]+=1,i[1]+=1):i[2]===-1?e.push([1,1,0]):h===f?e.push([1,1,0]):(f&&(i[0]+=1),h&&(i[1]+=1)));return{mapper:e,changContents:{array:c,
index:0}}},adaptCharDiff:function(e,c,i){for(var e=i?g.diffWords(e,c):g.diffChars(e,c),c=[],b=i=0,f=0,h=0,d=0;d<e.length;d++){var a=e[d];if(!a.added&&!a.removed){if(f>0||h>0)c.push([b,b+f,i,i+h]),b+=f,i+=h,h=f=0;b+=a.value.length;i+=a.value.length}else a.added?f+=a.value.length:h+=a.value.length}(f>0||h>0)&&c.push([b,b+f,i,i+h]);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={},i,b,f,h,d,a,l,n,m,o,t,s,r,u,w,v;c.DiffTreeNavigator=function(){function c(a,b,d,e,f,g){this._root={type:"root",children:[]};this._initialized=!1;this.initAll(a,b,d,e,f,g)}i="orion.annotation.diff.addedBlock";b="orion.annotation.diff.currentAddedBlock";f="orion.annotation.diff.deletedBlock";h="orion.annotation.diff.currentDeletedBlock";
d="orion.annotation.diff.blockTop";a="orion.annotation.diff.currentBlockTop";l="orion.annotation.diff.blockConflict";n="orion.annotation.diff.currentBlockConflict";m="orion.annotation.diff.addedWord";o="orion.annotation.diff.currentAddedWord";t="orion.annotation.diff.deletedWord";s="orion.annotation.diff.currentDeletedWord";r="orion.annotation.diff.emptyDeletedWordLeft";u="orion.annotation.diff.emptyDeletedWordRight";w="orion.annotation.diff.emptyAddedWordLeft";v="orion.annotation.diff.emptyAddedWordRight";
j.AnnotationType.registerType(i,{title:"",html:"",lineStyle:{styleClass:"annotationLine addedBlockDiff"}});j.AnnotationType.registerType(b,{title:"",html:"",lineStyle:{styleClass:"annotationLine currentAddedBlockDiff"}});j.AnnotationType.registerType(f,{title:"",html:"",lineStyle:{styleClass:"annotationLine deletedBlockDiff"}});j.AnnotationType.registerType(h,{title:"",html:"",lineStyle:{styleClass:"annotationLine currentDeletedBlockDiff"}});j.AnnotationType.registerType(d,{title:"",html:"",lineStyle:{styleClass:"annotationLine blockDiffTopOnly"}});
j.AnnotationType.registerType(a,{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(o,{title:"",
html:"",rangeStyle:{styleClass:"annotationRange currentAddedWordDiff"}});j.AnnotationType.registerType(t,{title:"word deleted",html:"",rangeStyle:{styleClass:"annotationRange deletedWordDiff"}});j.AnnotationType.registerType(s,{title:"",html:"",rangeStyle:{styleClass:"annotationRange currentDeletedWordDiff"}});j.AnnotationType.registerType(r,{title:"",html:"",rangeStyle:{styleClass:"annotationRange emptyDeletedWordDiffLeft"}});j.AnnotationType.registerType(u,{title:"",html:"",rangeStyle:{styleClass:"annotationRange emptyDeletedWordDiffRight"}});
j.AnnotationType.registerType(w,{title:"",html:"",rangeStyle:{styleClass:"annotationRange emptyAddedWordDiffLeft"}});j.AnnotationType.registerType(v,{title:"",html:"",rangeStyle:{styleClass:"annotationRange emptyAddedWordDiffRight"}});c.prototype={initAll:function(a,b,c,d,e,f,g){this._charOrWordDiff=a?a:"word";if(b)this._initialized=!0;this.editorWrapper=[{editor:b,diffFeeder:d},{editor:c,diffFeeder:e}];this._curveRuler=g;(this._overviewRuler=f)&&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,e){if(this.editorWrapper[b].annoTypes)for(var f=0;f<this.editorWrapper[b].annoTypes.length;f++)this.editorWrapper[b].annoTypes[f].type===c&&this.replaceDiffAnnotations(this.editorWrapper[b].editor,e?e:this.editorWrapper[b].annoTypes[f].list,d?this.editorWrapper[b].annoTypes[f].normal:this.editorWrapper[b].annoTypes[f].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],e=a===0?c.oldA:c.newA;if(b>=e.start&&b<=e.end){d=c;if(c.children&&c.children.length>0)for(e=0;e<c.children.length;e++){var f=c.children[e],g=a===0?f.oldA:f.newA;if(b>=g.start&&b<=g.end){d=f;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 e=
a.getAnnotations(0,a.getTextModel().getCharCount()),f=[];d&&e.hasNext();){var g=e.next();g.type===c&&f.push(g)}a.replaceAnnotations(f,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,e,f={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(f,this.editorWrapper[0].editor.getTextView().getModel()),e=this.editorWrapper[1].diffFeeder.getCurrentWordAnnoType(g,this.editorWrapper[1].editor.getTextView().getModel())):(d=this.editorWrapper[0].diffFeeder.getCurrentBlockAnnoType(c.index),e=this.editorWrapper[1].diffFeeder.getCurrentBlockAnnoType(c.index));d&&this.replaceDiffAnnotations(this.editorWrapper[0].editor,[new (j.AnnotationType.getType(d.current))(f.start,f.end)],d,!0);
e&&this.replaceDiffAnnotations(this.editorWrapper[1].editor,[new (j.AnnotationType.getType(e.current))(g.start,g.end)],e,!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),e=this.editorWrapper[1].diffFeeder.getTextOnBlock(b),b=null,f=0,g=0;if(d&&e&&d.text&&e.text&&d.text.length<=5E3&&e.text.length<=
5E3)b=c.adaptCharDiff(d.text,e.text,this._charOrWordDiff==="word"),g=e.start,f=d.start;else return null;c=[];d=[];this.generateWordDiffAnnotations(0,c,f,b,2,3);this.generateWordDiffAnnotations(1,d,g,b,0,1);b=[];for(f=0;f<c.length;f++)b.push({parent:a,index:f,type:"word",oldA:c[f],newA:d[f]});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),e=this.editorWrapper[a].diffFeeder.getCharRange(b),c=j.AnnotationType.createAnnotation(c.normal,e.start,e.end);d&&d.push(c);return c},generateWordDiffAnnotations:function(a,b,c,d,e,f){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][e]+c,d[h][f]+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:o,normal:m,list:[]}):a.push({type:"word",current:s,normal:t,list:[]});a.push({type:"word",current:r});a.push({type:"word",current:u});a.push({type:"word",current:w});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:t}:this._mapperColumnIndex===0?{current:o,normal:m}:{current:s,normal:t}},_repositionEmptyWord:function(a,
b){var c=b.getLineAtOffset(a.start),d=b.getLineStart(c),e=b.getLineEnd(c);if(d!==e){if(a.start===e)return a.start--,this._mapperColumnIndex===0?v:u;a.end++}else if(c>0&&(c--,d=b.getLineStart(c),e=b.getLineEnd(c),d!==e))return a.start=e-1,a.end=e,this._mapperColumnIndex===0?v:u;return this._mapperColumnIndex===0?w: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:i,current:b,list:[]}):c.push({type:"block",normal:f,current:h,list:[]});c.push({type:"block",normal:d,current:a,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:a};else if(k.isMapperConflict(this.getMapper(),c))return{normal:l,current:n};else if(this._mapperColumnIndex===0)return{type:"block",normal:i,current:b,list:[]};return{type:"block",normal:f,current:h,list:[]}};return e}();c.inlineDiffBlockFeeder=function(){function a(b,c){this._mapperColumnIndex=c;this.init(b)}a.prototype=new c.DiffBlockFeeder;a.prototype.setModel=function(a){this._textModel=a};a.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]}}};a.prototype.getBlockAnnoTypes=function(a){this._mapperColumnIndex===0?a.push({type:"block",normal:i,current:b,list:[]}):a.push({type:"block",normal:f,current:h,list:[]});a.push({type:"block",normal:l,current:n,list:[]})};a.prototype.getCurrentBlockAnnoType=function(a){if(!this._diffBlocks||this._diffBlocks.length===0)return null;a=this._diffBlocks[a][1];if(this._mapper[a][this._mapperColumnIndex]===0)return{current:o,normal:m};else if(k.isMapperConflict(this.getMapper(),
a))return{normal:l,current:n};else if(this._mapperColumnIndex===0)return{type:"block",normal:i,current:b,list:[]};return{type:"block",normal:f,current:h,list:[]}};a.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]};a.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 a}();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,i,b,f,h,d,a,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,e){var f=this._getLineDelim(a,c);this._diffParser.setLineDelim(f);if(this.options.mapper&&this.options.toggler)return{delim:f,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,f);if(this.options.toggler)this.options.mapper=
a.mapper,this.options.newFile.Content=b,this.options.diffArray=a.changContents;return{delim:f,mapper:a.mapper,output:b,diffArray:a.changContents}}else{b=this._diffParser.parse(a,c,d,e);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:f,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 a(b){this.setOptions(b,!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())}
a.prototype=new m.CompareView;a.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)};a.prototype.getEditors=function(){return this._editors};a.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)};a.prototype.copyToLeft=function(){this._curveRuler.copyTo(!0)};a.prototype.copyToRight=function(){this._curveRuler.copyTo(!1)};
a.prototype.resizeEditors=function(){this._editors.forEach(function(a){a.getTextView().resize()})};a.prototype.getSplitter=function(){return this._uiFactory.getSplitter()};a.prototype._createEditor=function(a,c,d,e,f){var j=typeof e.readonly==="undefined"?!0:e.readonly,k=function(){var a=new h.TextView({parent:c,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)?f:!f)&&a.resize()}}.bind(this));return a}.bind(this),p=e.keyBindingFactory;p||(p=new b.KeyBindingsFactory);var n=null;if(d)var l="",n=function(a,b){if(d)l=b?g["ERROR: "]+a:a,d.textContent=""+l};k=new i.Editor({textViewFactory:k,undoStackFactory:new b.UndoFactory,annotationFactory:new b.AnnotationFactory,keyBindingFactory:p,statusReporter:n,domNode:c});k.installTextView();k.setInput(null,null,e.Content?e.Content:a);k.setOverviewRulerVisible(!1);var m=k.getTextView();
m.addEventListener("Selection",function(a){a.newValue&&a.newValue.start!==a.newValue.end||!this._diffNavigator.autoSelecting&&this._diffNavigator.editorWrapper[0].diffFeeder&&this._diffNavigator.gotoDiff(m.getCaretOffset(),m)}.bind(this));m.getModel().addEventListener("Changed",function(a){if(!this._curveRuler.onChanged(a,!f))this.options.mapper=null}.bind(this));f?m.addEventListener("Scroll",function(){this._curveRuler&&(this._curveRuler.matchPositionFrom(!0),this._curveRuler.render());if(this.onScroll)this.onScroll()}.bind(this)):
m.addEventListener("Scroll",function(){this._curveRuler&&this._curveRuler.render()}.bind(this));return k};a.prototype.destroy=function(){this._editors&&(this._diffNavigator.destroy(),this._editors.forEach(function(a){a.destroy()}),this._uiFactory.destroy())};a.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}};a.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 e=new n.TwoWayDiffBlockFeeder(this._editors[0].getTextView().getModel(),d.mapper,1),f=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],e,f,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 a}();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(a){var d=j.node(this._editorDiv),e=function(){return new h.TextView({parent:d,readonly:!0,tabSize:4})}.bind(this);this._editor=
new i.Editor({textViewFactory:e,undoStackFactory:new b.UndoFactory,annotationFactory:new b.AnnotationFactory,domNode:d});this._editor.installTextView();this._editor.setInput(null,null,a);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 b=this.options.oldFile.Content,c=this._generateMapper(b,this.options.newFile.Content,this.options.diffContent,this.options.hasConflicts,!this.options.toggler);this._textView.getModel().setText(b);var b=new n.inlineDiffBlockFeeder(c.mapper,
1),d=new n.inlineDiffBlockFeeder(c.mapper,0);a.mergeDiffBlocks(this._textView.getModel(),d.getDiffBlocks(),c.mapper,c.diffArray.array,c.diffArray.index,this._diffParser._lineDelimiter);b.setModel(this._textView.getModel());d.setModel(this._textView.getModel());this._diffNavigator.initAll(this.options.charDiff?"char":"word",this._editor,this._editor,b,d,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();c=this._textView.getTopIndex();this._textView.redrawLines(c,c+1,this._overviewRuler);this._textView.redrawLines(c,c+1,this._rulerOrigin);this._textView.redrawLines(c,c+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 i(){j.call(this,null,!1)}function b(a,b,g){this.commentStart="/*";this.commentEnd="*/";var k=[];switch(b){case "java":k=h;break;case "js":k=f;break;case "css":k=d}this.whitespacesVisible=this.spacesVisible=this.tabsVisible=!1;this.detectHyperlinks=
!0;this.highlightCaretLine=!1;this.detectTasks=this.foldingEnabled=!0;this._scanner=new j(k,this.whitespacesVisible);this._firstScanner=new i;this._commentScanner=new c(this.whitespacesVisible);this._whitespaceScanner=new e;if(b==="css")this._scanner.isCSS=!0,this._firstScanner.isCSS=!0;this.view=a;this.annotationModel=g;this._bracketAnnotations=void 0;var n=this;this._listener={onChanged:function(a){n._onModelChanged(a)},onDestroy:function(a){n._onDestroy(a)},onLineStyle:function(a){n._onLineStyle(a)},
onMouseDown:function(a){n._onMouseDown(a)},onSelection:function(a){n._onSelection(a)}};b=a.getModel();b.getBaseModel&&(b=b.getBaseModel());b.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 f=k.JSKeywords,
h=k.JAVAKeywords,d=k.CSSKeywords,a={styleClass:"token_singleline_comment"},l={styleClass:"token_multiline_comment"},n={styleClass:"token_doc_comment"},m={styleClass:"token_doc_html_markup"},o={styleClass:"token_task_tag"},t={styleClass:"token_doc_tag"},s={styleClass:"token_string"},r={styleClass:"token_number"},u={styleClass:"token_keyword"},w={styleClass:"token_space",unmergeable:!0},v={styleClass:"token_tab",unmergeable:!0},q={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,e=!1,f=
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&&f===48&&this.offset-c===2)b=d=e=!0;else if(!(48<=a&&a<=57||e&&(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}}};i.prototype=new j(null);i.prototype._default=function(a){for(;;)switch(a=this._read(),a){case 47:case 34:case 39:case -1:return this._unread(a),1}};b.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,b){if(this.whitespacesVisible!==a)this.whitespacesVisible=a,this._scanner.whitespacesVisible=a,this._commentScanner.whitespacesVisible=a,b&&this.view.redraw()},setTabsVisible:function(a){if(this.tabsVisible!==
a)this.tabsVisible=a,this.setWhitespacesVisible(this.tabsVisible||this.spacesVisible,!1),this.view.redraw()},setSpacesVisible:function(a){if(this.spacesVisible!==a)this.spacesVisible=a,this.setWhitespacesVisible(this.tabsVisible||this.spacesVisible,!1),this.view.redraw()},setDetectHyperlinks:function(a){this.detectHyperlinks=a},setFoldingEnabled:function(a){this.foldingEnabled=a},setDetectTasks:function(a){this.detectTasks=a},_binarySearch:function(a,b,c,d,e){var f;d===void 0&&(d=-1);if(e===void 0)e=
a.length;for(;e-d>1;)if(f=Math.floor((e+d)/2),b<=a[f].start)e=f;else if(c&&b<a[f].end){e=f;break}else d=f;return e},_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(),e=this.comments,f=0;f<e.length;f++){var h=
e[f];(h=this._createFoldingAnnotation(a,d,h.start,h.end))&&c.push(h)}b.replaceAnnotations(null,c)}}}},_createFoldingAnnotation:function(a,b,c,d){var e=b.getLineAtOffset(c),b=b.getLineAtOffset(d);return e===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 e=this.view.getModel(),f=e;e.getBaseModel&&(f=e.getBaseModel());for(var h=d.getAnnotations(b,c),e=[],i=g.AnnotationType.ANNOTATION_TASK;h.hasNext();){var j=
h.next();j.type===i&&e.push(j)}h=[];j=this._commentScanner;j.setText(f.getText(b,c));for(var k;k=j.nextToken();){var n=j.getStartOffset()+b;k===14&&(k=f.getLineEnd(f.getLineAtOffset(n)),a!==6&&(k=Math.min(k,c-this.commentEnd.length)),h.push(g.AnnotationType.createAnnotation(i,n,k,f.getText(n,k))))}d.replaceAnnotations(e,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 q}return null},
_getStyles:function(a,b,c){a.getBaseModel&&(c=a.mapOffset(c));for(var d=c+b.length,e=[],f=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;f<i&&this._parse(b.substring(f-c,i-c),f,e);var k=g[h].type,m;switch(k){case 8:m=n;break;case 7:m=l;break;case 5:m=s}f=Math.max(f,i);i=Math.min(d,j);(k===8||k===7)&&(this.whitespacesVisible||this.detectHyperlinks)?this._parseComment(b.substring(f-c,i-c),f,e,m,k):k===5&&this.whitespacesVisible?this._parseString(b.substring(f-
c,i-c),f,e,s):e.push({start:f,end:i,style:m});f=j}f<d&&this._parse(b.substring(f-c,d-c),f,e);if(a.getBaseModel)for(b=0;b<e.length;b++)c=e[b].end-e[b].start,e[b].start=a.mapOffset(e[b].start,!0),e[b].end=e[b].start+c;return e},_parse:function(b,c,d){var e=this._scanner;for(e.setText(b);b=e.nextToken();){var f=e.getStartOffset()+c,g=null;switch(b){case 2:g=u;break;case 3:g=r;break;case 5:case 4:if(this.whitespacesVisible){this._parseString(e.getData(),f,d,s);continue}else g=s;break;case 8:this._parseComment(e.getData(),
f,d,n,b);continue;case 6:this._parseComment(e.getData(),f,d,a,b);continue;case 7:this._parseComment(e.getData(),f,d,l,b);continue;case 10:this.whitespacesVisible&&this.tabsVisible&&(g=v);break;case 11:this.whitespacesVisible&&this.spacesVisible&&(g=w)}d.push({start:f,end:e.getOffset()+c,style:g})}},_parseComment:function(a,b,c,d,e){var f=this._commentScanner;f.setText(a);for(f.setType(e);a=f.nextToken();){var e=f.getStartOffset()+b,g=d;switch(a){case 10:this.whitespacesVisible&&this.tabsVisible&&
(g=v);break;case 11:this.whitespacesVisible&&this.spacesVisible&&(g=w);break;case 12:g=m;break;case 13:g=t;break;case 14:g=o;break;default:this.detectHyperlinks&&(g=this._detectHyperlinks(f.getData(),e,c,g))}g&&c.push({start:e,end:f.getOffset()+b,style:g})}},_parseString:function(a,b,c,d){var e=this._whitespaceScanner;for(e.setText(a);a=e.nextToken();){var f=e.getStartOffset()+b,g=d;switch(a){case 10:this.whitespacesVisible&&this.tabsVisible&&(g=v);break;case 11:this.whitespacesVisible&&this.spacesVisible&&
(g=w)}g&&c.push({start:f,end:e.getOffset()+b,style:g})}},_detectHyperlinks:function(a,b,c,d){var e=null,f;if((f=a.indexOf("://"))>0){for(var e=a,g=f;g>0;){f=e.charCodeAt(g-1);if(!(97<=f&&f<=122||65<=f&&f<=90||45===f||48<=f&&f<=57))break;g--}if(g>0&&(f="\"\"''(){}[]<>".indexOf(e.substring(g-1,g)),f!==-1&&(f&1)===0&&(f=e.lastIndexOf("\"\"''(){}[]<>".substring(f+1,f+2)))!==-1)){var h=f;f=this._clone(d);f.tagName="a";f.attributes={href:e.substring(g,h)};c.push({start:b,end:b+g,style:d});c.push({start:b+
g,end:b+h,style:f});c.push({start:b+h,end:b+a.length,style:d});return null}}else a.toLowerCase().indexOf("bug#")===0&&(e="https://bugs.eclipse.org/bugs/show_bug.cgi?id="+parseInt(a.substring(4),10));return e?(f=this._clone(d),f.tagName="a",f.attributes={href:e},f):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 e=[];d=c.nextToken();)(d===7||d===8||d===5)&&e.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 e},_findMatchingBracket:function(a,b){var c="{}()[]<>",d=a.getText(b,b+1),e=c.indexOf(d,0);if(e===-1)return-1;var f;f=e&1?c.substring(e-1,e):c.substring(e+1,e+2);for(var g=a.getLineAtOffset(b),c=a.getLine(g),h=a.getLineStart(g),i=a.getLineEnd(g),c=this._findBrackets(d,f,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(e&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,f,c,h,h,i);for(e=c.length-1;e>=0;e--)if(h=c[e]>=0?1:-1,j+=h,j===0)return c[e]*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(e=a.getLineCount();g<e;){c=a.getLine(g);h=a.getLineStart(g);i=a.getLineEnd(g);c=this._findBrackets(d,f,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,e,f){for(var g=[],a=a.charCodeAt(0),b=b.charCodeAt(0),h=e,i=this._scanner,j,k=this.comments,n=this._binarySearch(k,e,!0);n<k.length;n++){if(k[n].start>=f)break;j=k[n].start;var l=k[n].end;if(h<j)for(i.setText(c.substring(h-e,j-e));j=i.nextToken();)j===a?g.push(i.getStartOffset()+h-e+d+1):j===b&&g.push(-(i.getStartOffset()+h-e+d+1));h=l}if(h<f)for(i.setText(c.substring(h-e,f-e));j=i.nextToken();)j===a?g.push(i.getStartOffset()+h-e+d+1):j===b&&g.push(-(i.getStartOffset()+h-e+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(),e;if(this.highlightCaretLine){var f=a.getLineAtOffset(b.start);e=a.getLineAtOffset(c.start);var h=c.start===c.end,b=b.start===b.end;f===e&&b&&h||(b&&d.redrawLines(f,f+1),(f!==e||!b)&&h&&d.redrawLines(e,e+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 e=d-1,f=c;c.getBaseModel&&(e=c.mapOffset(e),f=c.getBaseModel());e=this._findMatchingBracket(f,e);e!==-1&&(a.preventDefault(),a=e,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,e=this.view,a=e.getModel(),f=a.getBaseModel?a.getBaseModel():a,c=b+c,h=f.getCharCount(),i=this.comments.length,j=f.getLineStart(f.getLineAtOffset(b)),k=this._binarySearch(this.comments,j,!0),n=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 l;n<i?(l=this.comments[n].end,l>b&&(l+=d),n+=1):(n=i,l=h);for(var m,h=this._findComments(f.getText(j,l),j),i=k;i<this.comments.length;i++)m=this.comments[i],m.start>b&&(m.start+=d),m.start>b&&(m.end+=d);var q=n-k!==h.length;if(!q)for(i=0;i<h.length;i++){m=this.comments[k+i];var o=h[i];if(m.start!==o.start||m.end!==o.end||
m.type!==o.type){q=!0;break}}i=[k,n-k].concat(h);Array.prototype.splice.apply(this.comments,i);q&&(i=j,m=l,a!==f&&(i=a.mapOffset(i,!0),m=a.mapOffset(m,!0)),e.redrawRange(i,m));if(this.foldingEnabled&&f!==a&&this.annotationModel){e=this.annotationModel;k=e.getAnnotations(j,l);j=[];for(l=[];k.hasNext();)if(m=k.next(),m.type===g.AnnotationType.ANNOTATION_FOLDING){l.push(m);for(i=0;i<h.length;i++)if(m.start===h[i].start&&m.end===h[i].end)break;i===h.length?(j.push(m),m.expand()):(i=m.start,n=m.end,i>
b&&(i-=d),n>b&&(n-=d),i<=b&&b<n&&i<=c&&c<n&&(i=f.getLineAtOffset(m.start),n=f.getLineAtOffset(m.end),i!==n?m.expanded||(m.expand(),e.modifyAnnotation(m)):e.removeAnnotation(m)))}b=[];for(i=0;i<h.length;i++){m=h[i];for(d=0;d<l.length;d++)if(l[d].start===m.start&&l[d].end===m.end)break;d===l.length&&(m=this._createFoldingAnnotation(a,f,m.start,m.end))&&b.push(m)}e.replaceAnnotations(j,b)}}};return{TextStyler:b}});
define("orion/editor/textMateStyler",["orion/regex"],function(g){function k(c){var e;if(c instanceof Array){e=Array(c.length);for(var b=0;b<c.length;b++)e[b]=k(c[b])}else for(b in e={},c)if(Object.prototype.hasOwnProperty.call(c,b)){var f=c[b];e[b]=typeof f==="object"&&f!==null?k(f):f}return e}function j(c,e,b){this.initialize(c);this.grammar=k(e);this.externalGrammars=b?k(b):[];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 g(b,a){throw Error('Unsupported regex feature "'+b+'": "'+a[0]+'" at index: '+a.index+" in "+a.input);}var b="",f,c=e.processGlobalFlag("x",c,function(b){for(var a="",c=!1,e=b.length,f=0;f<e;){var g=b.charAt(f);if(!c&&g==="#")for(;f<e&&g!=="\r"&&g!=="\n";)g=b.charAt(++f);
else if(!c&&/\s/.test(g))for(;f<e&&/\s/.test(g);)g=b.charAt(++f);else g==="\\"?(a+=g,/\s/.test(b.charAt(f+1))||(a+=b.charAt(f+1),f+=1)):(g==="["?c=!0:g==="]"&&(c=!1),a+=g),f+=1}return a}),c=e.processGlobalFlag("i",c,function(c){b+="i";return c});for(f=0;f<this.unsupported.length;f++){var h;(h=this.unsupported[f].regex.exec(c))&&g(this.unsupported[f].func(h),h)}return RegExp(c,b)},processGlobalFlag:function(c,e,b){function f(b,a){for(var c=0,e=b.length,f=-1,g=a;g<e&&f===-1;g++)switch(b.charAt(g)){case "\\":g++;
break;case "(":c++;break;case ")":c--,c===0&&(f=g)}return f}var g="(?"+c+")",c="(?"+c+":";if(e.substring(0,g.length)===g)return b(e.substring(g.length));else if(e.substring(0,c.length)===c){g=f(e,0);if(g<e.length-1)throw Error("Only a "+c+") group that encloses the entire regex is supported in: "+e);return b(e.substring(c.length,g))}return e},hasBackReference:function(c){return/\\\d+/.test(c.source)},getSubstitutedRegex:function(c,e,b){for(var b=typeof b==="undefined"?!0:!1,c=c.source.split(/(\\\d+)/g),
f=[],h=0;h<c.length;h++){var d=c[h],a=/\\(\d+)/.exec(d);a?(d=e[a[1]]||"",f.push(b?g.escape(d):d)):f.push(d)}return RegExp(f.join(""))},groupify:function(c,e){for(var b=c.source,f=b.length,g=[],d=0,a=[],j=1,k=1,m=[],o={},t={},s=0;s<f;s++){var r=g[g.length-1],u=b.charAt(s);switch(u){case "(":if(r===4)g.pop(),m.push(")"),a[a.length-1].end=s;var w=s+2<f?b.charAt(s+1)+""+b.charAt(s+2):null;if(w==="?:"||w==="?="||w==="?!"){var v;w==="?:"?v=1:(v=3,d++);g.push(v);a.push({start:s,end:-1,type:v});m.push(u);
m.push(w);s+=w.length}else g.push(2),a.push({start:s,end:-1,type:2,oldNum:j,num:k}),m.push(u),d===0&&(t[k]=null),o[j]=k,j++,k++;break;case ")":r=g.pop();r===3&&d--;a[a.length-1].end=s;m.push(u);break;case "*":case "+":case "?":case "}":var q=u,p=b.charAt(s-1),w=s-1;if(u==="}"){for(v=s-1;b.charAt(v)!=="{"&&v>=0;v--);p=b.charAt(v-1);w=v-1;q=b.substring(v,s+1)}v=a[a.length-1];if(p===")"&&(v.type===2||v.type===4)){m.splice(v.start,0,"(");m.push(q);m.push(")");u={start:v.start,end:m.length-1,type:4,num:v.num};
for(p=0;p<a.length;p++)if(r=a[p],(r.type===2||r.type===4)&&r.start>=v.start&&r.end<=w)if(r.start+=1,r.end+=1,r.num+=1,r.type===2)o[r.oldNum]=r.num;a.push(u);k++;break}default:u!=="|"&&r!==2&&r!==4&&d===0&&(g.push(4),a.push({start:s,end:-1,type:4,num:k}),m.push("("),t[k]=null,k++),m.push(u),u==="\\"&&(u=b.charAt(s+1),m.push(u),s+=1)}}for(;g.length;)g.pop(),m.push(")");var b=RegExp(m.join("")),f={},e=e||o,x;for(x in e)e.hasOwnProperty(x)&&(f[x]="\\"+e[x]);b=this.getSubstitutedRegex(b,f,!1);return[b,
o,t]},complexCaptures:function(c){if(!c)return!1;for(var e in c)if(c.hasOwnProperty(e)&&e!=="0")return!0;return!1}};j.prototype={initialize:function(c){this.textView=c;this.textView.stylerOptions=this;var e=this;this._listener={onModelChanged:function(b){e.onModelChanged(b)},onDestroy:function(b){e.onDestroy(b)},onLineStyle:function(b){e.onLineStyle(b)},onStorage:function(b){e.onStorage(b)}};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 e=
c.pop();if(!e._resolvedRule||!e._typedRule)if(e._resolvedRule=this._resolve(e),e._typedRule=this._createTypedRule(e),this.addStyles(e.name),this.addStyles(e.contentName),this.addStylesForCaptures(e.captures),this.addStylesForCaptures(e.beginCaptures),this.addStylesForCaptures(e.endCaptures),e._resolvedRule!==e&&c.push(e._resolvedRule),e.patterns)for(var b=0;b<e.patterns.length;b++)c.push(e.patterns[b])}},addStyles:function(c){if(c&&!this._styles[c]){this._styles[c]=[];for(var e=c.split("."),b=0;b<
e.length;b++)this._styles[c].push(e.slice(0,b+1).join("-"))}},addStylesForCaptures:function(c){for(var e in c)c.hasOwnProperty(e)&&this.addStyles(c[e].name)},ContainerRule:function(){function c(c){this.rule=c;this.subrules=c.patterns}c.prototype.valueOf=function(){return"aa"};return c}(),BeginEndRule:function(){function c(c){this.rule=c;this.beginRegex=e.toRegExp(c.begin);this.endRegex=e.toRegExp(c.end);this.subrules=c.patterns||[];this.endRegexHasBackRef=e.hasBackReference(this.endRegex);var b=e.complexCaptures(c.captures),
c=e.complexCaptures(c.beginCaptures)||e.complexCaptures(c.endCaptures);if(this.isComplex=b||c)b=e.groupify(this.beginRegex),this.beginRegex=b[0],this.beginOld2New=b[1],this.beginConsuming=b[2],b=e.groupify(this.endRegex,this.beginOld2New),this.endRegex=b[0],this.endOld2New=b[1],this.endConsuming=b[2]}c.prototype.valueOf=function(){return this.beginRegex};return c}(),MatchRule:function(){function c(c){this.rule=c;this.matchRegex=e.toRegExp(c.match);if(this.isComplex=e.complexCaptures(c.captures))c=
e.groupify(this.matchRegex),this.matchRegex=c[0],this.matchOld2New=c[1],this.matchConsuming=c[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 e=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(e=this.grammar.repository&&this.grammar.repository[c.substring(1)],
!e)throw Error("Couldn't find included rule "+c+" in grammar repository");}else if(c==="$self")e=this.grammar;else if(c==="$base")throw Error('Include "$base" is not supported');else if(e=this._allGrammars[c],!e)for(var b=0;b<this.externalGrammars.length;b++){var f=this.externalGrammars[b];if(f.scopeName===c){this.preprocess(f);e=this._allGrammars[c]=f;break}}}return e},ContainerNode:function(){function c(c,b){this.parent=c;this.rule=b;this.children=[];this.end=this.start=null}c.prototype.addChild=
function(c){this.children.push(c)};c.prototype.valueOf=function(){var c=this.rule;return"ContainerNode { "+(c.include||"")+" "+(c.name||"")+(c.comment||"")+"}"};return c}(),BeginEndNode:function(){function c(c,b,f){this.parent=c;this.rule=b;this.children=[];this.setStart(f);this.endMatch=this.end=null;this.endRegexSubstituted=b.endRegexHasBackRef?e.getSubstitutedRegex(b.endRegex,f):null}c.prototype.addChild=function(c){this.children.push(c)};c.prototype.getIndexInParent=function(){return this.parent?
this.parent.children.indexOf(this):-1};c.prototype.setStart=function(c){this.start=c.index;this.beginMatch=c};c.prototype.setEnd=function(c){c&&typeof c==="object"?(this.endMatch=c,this.end=c.index+c[0].length):(this.endMatch=null,this.end=c)};c.prototype.shiftStart=function(c){this.start+=c;this.beginMatch.index+=c};c.prototype.shiftEnd=function(c){this.end+=c;this.endMatch&&(this.endMatch.index+=c)};c.prototype.valueOf=function(){return"{"+this.rule.beginRegex+" range="+this.start+".."+this.end+
"}"};return c}(),push:function(c,e){if(e)for(var b=e.length;b>0;)c.push(e[--b])},exec:function(c,e,b){(e=c.exec(e))&&(e.index+=b);c.lastIndex=0;return e},afterMatch:function(c){return c.index+c[0].length},getEndMatch:function(c,e,b){if(c instanceof this.BeginEndNode){var f=c.rule,c=c.endRegexSubstituted||f.endRegex;return!c?null:this.exec(c,e,b)}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 e=c.addedCharCount,b=c.removedCharCount,c=c.start;if(this._tree){var f=this.textView.getModel(),g=f.getCharCount(),f=f.getLineEnd(f.getLineAtOffset(c)-1),d=this.getFirstDamaged(f,f),f=f===-1?0:f,e=d?this.parse(d,!0,f,c,e,b):g;this.textView.redrawRange(f,e)}else this.initialParse()},getFirstDamaged:function(c,e){if(c<0)return this._tree;for(var b=[this._tree],f=null;b.length;){var g=b.pop();if(!g.parent||this.isDamaged(g,c,e)){g instanceof this.BeginEndNode&&(f=
g);for(var d=0;d<g.children.length;d++)b.push(g.children[d])}}return f||this._tree},isDamaged:function(c,e,b){return c.start<=b&&c.end>e},parse:function(c,e,b,f,g,d){var a=this.textView.getModel(),j=a.getLineStart(a.getLineCount()-1),k=a.getCharCount(),m=this.getInitialExpected(c,b),o=-1;if(e)c.repaired=!0,c.endNeedsUpdate=!0,o=(o=c.children[c.children.length-1])?a.getLineEnd(a.getLineAtOffset(o.end+(g-d))):-1,f=a.getLineEnd(a.getLineAtOffset(f+d)),o=Math.max(o,f);for(var o=o===-1?k:o,f=m,t=c,s=!1,
r=b,u=-1;t&&(!e||r<o);){var w=this.getNextMatch(a,t,r);w||(r=r>=j?k:a.getLineStart(a.getLineAtOffset(r)+1));var v=w&&w.match,q=w&&w.rule,p=w&&w.isEnd;if(w&&w.isSub){if(r=this.afterMatch(v),q instanceof this.BeginEndRule)s=!0,e&&q===f.rule&&t===f.parent?(t=f,t.setStart(v),t.repaired=!0,t.endNeedsUpdate=!0,f=this.getNextExpected(f,"begin")):(e&&(this.prune(t,f),e=!1),v=new this.BeginEndNode(t,q,v),t.addChild(v),t=v)}else if(p||r===k){if(t instanceof this.BeginEndNode)v?(s=!0,u=Math.max(u,t.end),t.setEnd(v),
r=this.afterMatch(v),e&&t===f&&t.parent===f.parent?(t.repaired=!0,delete t.endNeedsUpdate,f=this.getNextExpected(f,"end")):e&&(this.prune(t,f),e=!1)):(t.setEnd(k),delete t.endNeedsUpdate);t=t.parent}e&&r>=o&&!s&&(this.prune(c,m),e=!1)}this.removeUnrepairedChildren(c,e,b);this.cleanup(e,c,b,o,k,g,d);return e?Math.max(u,r):r},removeUnrepairedChildren:function(c,e,b){if(e){for(var e=c.children,f=-1,g=0;g<e.length;g++){var d=e[g];if(!d.repaired&&this.isDamaged(d,b,Number.MAX_VALUE)){f=g;break}}if(f!==
-1)c.children.length=f}},cleanup:function(c,e,b,f,g,d,a){if(c){c=d-a;g=this.getIntersecting(f-c+1,g);e=this.getIntersecting(b,f);for(b=0;b<g.length;b++)f=g[b],!f.repaired&&f instanceof this.BeginEndNode&&(f.shiftEnd(c),f.shiftStart(c));for(b=0;b<e.length;b++)f=e[b],f.repaired&&f.endNeedsUpdate&&f.shiftEnd(c),delete f.endNeedsUpdate,delete f.repaired}else{e=this.getIntersecting(b,f);for(b=0;b<e.length;b++)delete e[b].repaired}},getNextMatch:function(c,e,b,f){var g=c.getLineAtOffset(b),g=c.getLineEnd(g),
d=c.getText(b,g),a=[],j=[],c=[],g=[];for(this.push(a,e.rule.subrules);a.length;){var k=a.length?a.pop():null,k=k&&k._resolvedRule._typedRule;if(k instanceof this.ContainerRule&&j.indexOf(k)===-1)j.push(k),this.push(a,k.subrules);else if(!k||!f||k.matchRegex){var m=k&&this.exec(k.matchRegex||k.beginRegex,d,b);m&&(c.push(m),g.push(k))}}a=Number.MAX_VALUE;j=-1;for(k=0;k<c.length;k++)if(m=c[k],m.index<a)a=m.index,j=k;if(!f&&(b=this.getEndMatch(e,d,b)))if(f=e.rule.applyEndPatternLast,j===-1||b.index<a||
!f&&b.index===a)return{isEnd:!0,rule:e.rule,match:b};return j===-1?null:{isSub:!0,rule:g[j],match:c[j]}},getInitialExpected:function(c,e){var b,f;if(c===this._tree)for(b=0;b<c.children.length;b++){if(f=c.children[b],f.start>=e)return f}else if(c instanceof this.BeginEndNode&&c.endMatch){var g=c.endMatch.index;for(b=0;b<c.children.length;b++)if(f=c.children[b],f.start>=e)break;if(f&&f.start<g)return f}return c},getNextExpected:function(c,e){if(e==="begin"){var b=c.children[0];return b?b:c}else if(e===
"end"&&(b=c.parent)){var f=b.children[b.children.indexOf(c)+1];return f?f:b}return null},prune:function(c,e){if(e.parent===c)c.children.length=e.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 e=c.lineStart,b=this.textView.getModel(),f=b.getLineEnd(c.lineIndex),g=b.getLineEnd(b.getLineAtOffset(e)-1),g=this.getFirstDamaged(g,g),e=this.getLineScope(b,
g,e,f);c.ranges=this.toStyleRanges(e);c.ranges.sort(function(b,a){return b.start-a.start})},getLineScope:function(c,e,b,f){for(var g=b,d=this.getInitialExpected(e,b),a=[],j=[];e&&g<f;){var k=this.getNextMatch(c,e,g);if(!k)break;var m=k&&k.match,o=k&&k.rule,t=k&&k.isSub,k=k&&k.isEnd;m.index!==g&&j.push({start:g,end:m.index,node:e});if(t)g=this.afterMatch(m),o instanceof this.BeginEndRule?(this.addBeginScope(a,m,o),e=d,d=this.getNextExpected(d,"begin")):this.addMatchScope(a,m,o);else if(k)g=this.afterMatch(m),
this.addEndScope(a,m,o),d=this.getNextExpected(d,"end"),e=e.parent}g<f&&j.push({start:g,end:f,node:e});c=this.getInheritedLineScope(j,b,f);return a.concat(c)},getInheritedLineScope:function(c){for(var e=[],b=0;b<c.length;b++)for(var f=c[b],g=f.node;g;){var d=g.rule.rule,a=d.name;if(d=d.contentName||a){this.addScopeRange(e,f.start,f.end,d);break}g=g.parent}return e},addBeginScope:function(c,e,b){var f=b.rule;this.addCapturesScope(c,e,f.beginCaptures||f.captures,b.isComplex,b.beginOld2New,b.beginConsuming)},
addEndScope:function(c,e,b){var f=b.rule;this.addCapturesScope(c,e,f.endCaptures||f.captures,b.isComplex,b.endOld2New,b.endConsuming)},addMatchScope:function(c,e,b){var f=b.rule,g=f.name;(f=f.captures)?this.addCapturesScope(c,e,f,b.isComplex,b.matchOld2New,b.matchConsuming):this.addScope(c,e,g)},addScope:function(c,e,b){b&&c.push({start:e.index,end:this.afterMatch(e),scope:b})},addScopeRange:function(c,e,b,f){f&&c.push({start:e,end:b,scope:f})},addCapturesScope:function(c,e,b,f,g,d){if(b)if(f){for(var f=
{1:0},a=0,j=1;e[j]!==void 0;j++)d[j]!==void 0&&(a+=e[j].length),e[j+1]!==void 0&&(f[j+1]=a);d=e.index;for(a=1;b[a];a++){var j=b[a].name,k=g[a],m=d+f[k];typeof e[k]!=="undefined"&&this.addScopeRange(c,m,m+e[k].length,j)}}else this.addScope(c,e,b[0]&&b[0].name)},getIntersecting:function(c,e){for(var b=[],f=this._tree?[this._tree]:[];f.length;){var g=f.pop(),d=!1;g instanceof this.ContainerNode?d=!0:this.isDamaged(g,c,e)&&(d=!0,b.push(g));if(d)for(var d=g.children.length,a=0;a<d;a++)f.push(g.children[a])}return b.reverse()},
toStyleRanges:function(c){for(var e=[],b=0;b<c.length;b++){var f=c[b],g=this._styles[f.scope];if(!g)throw Error("styles not found for "+f.scope);g=g.join(" ");e.push({start:f.start,end:f.end,style:{styleClass:g}})}return e}};return{RegexUtil:e,TextMateStyler:j}});
define("orion/editor/AsyncStyler",["i18n!orion/editor/nls/messages","orion/editor/annotations"],function(g,k){function j(b){return b.getProperty("objectClass").indexOf(c)!==-1&&b.getProperty("type")==="highlighter"}function e(b,c,e){this.initialize(b,c,e);this.lineStyles=[]}var c="orion.edit.highlighter",i=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(b,e,g){this.textView=b;this.serviceRegistry=e;this.annotationModel=g;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))}};b.addEventListener("ModelChanging",this.listener.onModelChanging);b.addEventListener("ModelChanged",this.listener.onModelChanged);b.addEventListener("Destroy",this.listener.onDestroy);b.addEventListener("LineStyle",this.listener.onLineStyle);e.addEventListener("registered",this.listener.onServiceAdded);e.addEventListener("unregistering",this.listener.onServiceRemoved);b=e.getServiceReferences(c);for(g=0;g<b.length;g++){var a=b[g];j(a)&&this.addServiceListener(e.getService(a))}},
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 b=0;b<this.services.length;b++)this.removeServiceListener(this.services[b]);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(b){this.startLine=this.textView.getModel().getLineAtOffset(b.start)},onModelChanged:function(b){var c=this.startLine;(b.addedLineCount||b.removedLineCount)&&Array.prototype.splice.apply(this.lineStyles,[c,b.removedLineCount].concat(this._getEmptyStyle(b.addedLineCount)))},
onStyleReady:function(b){var c=b.lineStyles||b.style,b=Number.MAX_VALUE,e=-1,d=this.textView.getModel(),a;for(a in c)Object.prototype.hasOwnProperty.call(c,a)&&(this.lineStyles[a]=c[a],b=Math.min(b,a),e=Math.max(e,a));b=Math.max(b,0);e=Math.min(e,d.getLineCount());if(c=this.annotationModel){for(var g=c.getAnnotations(d.getLineStart(b),d.getLineEnd(e)),i=[];g.hasNext();){var j=g.next();j.type==="orion.annotation.highlightError"&&i.push(j)}g=[];for(j=b;j<=e;j++){a=j;var o=this.lineStyles[a],o=o&&o.errors;
a=d.getLineStart(a);if(o)for(var t=0;t<o.length;t++){var s=o[t];g.push(k.AnnotationType.createAnnotation("orion.annotation.highlightError",s.start+a,s.end+a))}}c.replaceAnnotations(i,g)}this.textView.redrawLines(b,e+1)},onLineStyle:function(b){function c(b,a){for(var e=b.length,f=[],g=0;g<e;g++){var h=b[g];f.push({start:h.start+a,end:h.end+a,style:h.style})}return f}var e=this.lineStyles[b.lineIndex];if(e)if(e.ranges)b.ranges=c(e.ranges,b.lineStart);else if(e.style)b.style=e.style},_getEmptyStyle:function(b){for(var c=
[],e=0;e<b;e++)c.push(null);return c},setContentType:function(b){this.contentType=b;if(this.services)for(b=0;b<this.services.length;b++){var c=this.services[b];if(c.setContentType){var e=this.serviceRegistry.getService("orion.page.progress");e?e.progress(c.setContentType(this.contentType),"Styling content type: "+this.contentType.id?this.contentType.id:this.contentType):c.setContentType(this.contentType)}}},onServiceAdded:function(b,c){j(b)&&this.addServiceListener(c)},onServiceRemoved:function(b,
c){this.services.indexOf(c)!==-1&&this.removeServiceListener(c)},addServiceListener:function(b){if(typeof b.addEventListener==="function"){if(b.addEventListener("orion.edit.highlighter.styleReady",this.listener.onStyleReady),this.services.push(b),b.setContentType&&this.contentType){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)}}else typeof console!==
"undefined"&&console.log(Error(i))},removeServiceListener:function(b){typeof b.removeEventListener==="function"?(b.removeEventListener("orion.edit.highlighter.styleReady",this.listener.onStyleReady),b=this.services.indexOf(b),b!==-1&&this.services.splice(b,1)):typeof console!=="undefined"&&console.log(Error(i))}};return e});
define("orion/highlight",["examples/editor/textStyler","orion/editor/textMateStyler","orion/editor/AsyncStyler","orion/Deferred"],function(g,k,j,e){function c(b,c,h,d,a,i,n){function m(a,b){var d=a.getProperty("contentType"),g=a.getProperty("fileTypes");if(d)return c.isSomeExtensionOf(h,d).then(function(b){return b?a:null});else if(b&&g&&g.indexOf(b)!==-1)return d=new e,d.resolve(a),d;return null}var o=function(b){var c=null;switch(b&&b.id){case "application/javascript":case "application/json":c=
new g.TextStyler(d,"js",a);break;case "text/x-java-source":c=new g.TextStyler(d,"java",a);break;case "text/css":c=new g.TextStyler(d,"css",a)}return c}(h);if(o)return i=new e,i.resolve(o),i;for(var o=i&&i.split(".").pop().toLowerCase(),i=b.getServiceReferences("orion.edit.highlighter"),t=[],s=[],r=0;r<i.length;r++){var u=i[r];u.getProperty("type")==="grammar"&&t.push(u.getProperty("grammar"));(u=m(u,o))&&s.push(u)}return e.all(s,function(a){return{_error:a}}).then(function(c){for(var e,f=c.length-
1;f>=0;f--){var g=c[f];if(g&&!g._error&&(n||g.getProperty("type")!=="highlighter")){e=g;break}}var i;if(e)if(c=e.getProperty("type"),c==="highlighter")i=new j(d,b,a),i.setContentType(h);else if(c==="grammar"||typeof c==="undefined")e=e.getProperty("grammar"),i=new k.TextMateStyler(d,e,t);return i})}function i(b){this.serviceRegistry=b;this.styler=null}i.prototype={setup:function(b,e,g,d,a){a=typeof a==="undefined"?!0:a;if(this.styler)this.styler.destroy&&this.styler.destroy(),this.styler=null;var i=
this;return c(this.serviceRegistry,this.serviceRegistry.getService("orion.core.contentTypeRegistry"),b,e,g,d,a).then(function(a){return i.styler=a})},getStyler:function(){return this.styler}};return{createStyler:c,SyntaxHighlighter:i}});
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 i(b,c,e,d){k.Find.call(this,b,e,d);this._commandService=c}i.prototype=new k.Find;e.mixin(i.prototype,{getFindString:function(){var b=document.getElementById("localSearchFindWith");return!b?k.Find.prototype.getFindString.call(this):b.value},getReplaceString:function(){var b=document.getElementById("localSearchReplaceWith");
return!b?k.Find.prototype.getReplaceString(this):b.value},hide:function(){var b=this.isVisible();k.Find.prototype.hide.call(this);b&&this._commandService.closeParameterCollector()},show:function(b){k.Find.prototype.show.call(this,b);var c=b.findString,b=b.replaceString,e=document.getElementById("localSearchFindWith");e||(this._createActionTable(),e=document.getElementById("localSearchFindWith"));if(c)e.value=c;if(b)document.getElementById("localSearchReplaceWith").value=b;window.setTimeout(function(){e.select();
e.focus()},10)},_showReplaceInfo:function(){this._regex?(this._replaceInfo.src="data:image/gif;base64,R0lGODlhBwAIAMQAAMzX6cbT5kh4qFiIuKC40FCIuGSXwmWZw2SaxGacxmadxmWcxbPM4GigyJW92JzC26DI0P///////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAABIALAAAAAAHAAgAAAUmoEQUQkFI0PBEz5A2yII0w9AwkUPbRpTsjUNEQUsFIgCXiGSShAAAOw==",this._replaceInfo.title=g["Regular expression is on. You can click here or use options to turn it off - e.g. when the option is on you can replace <td([\\s\\S]*?)</td> with <span$1</span>."]):
(this._replaceInfo.src="data:image/gif;base64,R0lGODlhBwAIAEAAACH5BAEAABIALAAAAAAHAAgAhwAAAAAAMwAAZgAAmQAAzAAA/wArAAArMwArZgArmQArzAAr/wBVAABVMwBVZgBVmQBVzABV/wCAAACAMwCAZgCAmQCAzACA/wCqAACqMwCqZgCqmQCqzACq/wDVAADVMwDVZgDVmQDVzADV/wD/AAD/MwD/ZgD/mQD/zAD//zMAADMAMzMAZjMAmTMAzDMA/zMrADMrMzMrZjMrmTMrzDMr/zNVADNVMzNVZjNVmTNVzDNV/zOAADOAMzOAZjOAmTOAzDOA/zOqADOqMzOqZjOqmTOqzDOq/zPVADPVMzPVZjPVmTPVzDPV/zP/ADP/MzP/ZjP/mTP/zDP//2YAAGYAM2YAZmYAmWYAzGYA/2YrAGYrM2YrZmYrmWYrzGYr/2ZVAGZVM2ZVZmZVmWZVzGZV/2aAAGaAM2aAZmaAmWaAzGaA/2aqAGaqM2aqZmaqmWaqzGaq/2bVAGbVM2bVZmbVmWbVzGbV/2b/AGb/M2b/Zmb/mWb/zGb//5kAAJkAM5kAZpkAmZkAzJkA/5krAJkrM5krZpkrmZkrzJkr/5lVAJlVM5lVZplVmZlVzJlV/5mAAJmAM5mAZpmAmZmAzJmA/5mqAJmqM5mqZpmqmZmqzJmq/5nVAJnVM5nVZpnVmZnVzJnV/5n/AJn/M5n/Zpn/mZn/zJn//8wAAMwAM8wAZswAmcwAzMwA/8wrAMwrM8wrZswrmcwrzMwr/8xVAMxVM8xVZsxVmcxVzMxV/8yAAMyAM8yAZsyAmcyAzMyA/8yqAMyqM8yqZsyqmcyqzMyq/8zVAMzVM8zVZszVmczVzMzV/8z/AMz/M8z/Zsz/mcz/zMz///8AAP8AM/8AZv8Amf8AzP8A//8rAP8rM/8rZv8rmf8rzP8r//9VAP9VM/9VZv9Vmf9VzP9V//+AAP+AM/+AZv+Amf+AzP+A//+qAP+qM/+qZv+qmf+qzP+q///VAP/VM//VZv/Vmf/VzP/V////AP//M///Zv//mf//zP///wAAAAAAAAAAAAAAAAgsAPcpQzMJjbJ9xNAQQ6hwUqaHDws+3PeQoMN9DiUuzFRQ2ZiDyyYdHFhwYUAAOw==",
this._replaceInfo.title=g["Regular expression is off. You can click here or use options to turn it on for replacement - e.g. when the option is on you can replace <td([\\s\\S]*?)</td> with <span$1</span>."]);this._replaceInfo.style.display=""},_createActionTable:function(){var b=this;this._commandService.openParameterCollector("pageNavigationActions",function(c){var e=document.createElement("input");e.type="text";e.name=g["Find:"];e.className="parameterInput";e.id="localSearchFindWith";e.placeholder=
g["Find With"];e.oninput=function(a){return b._handleInput(a)};e.onkeydown=function(a){return b._handleKeyDown(a)};c.appendChild(e);b._createButton("Next",c,function(){b.find(!0)});b._createButton("Previous",c,function(){b.find(!1)});var d=b._editor.getTextView().getOptions("readonly");if(!d){var a=document.createElement("input");a.type="text";a.name=g["ReplaceWith:"];a.className="parameterInput";a.id="localSearchReplaceWith";a.placeholder=g["Replace With"];a.onkeydown=function(a){return b._handleKeyDown(a)};
c.appendChild(a);b._replaceInfo=b._createInfoImage(null,c,null);b._showReplaceInfo();b._createButton(g.Replace,c,function(){b.replace()});b._createButton(g["Replace All"],c,function(){b.replaceAll()})}a=document.createElement("div");c.appendChild(a);a.classList.add("findOptionsDiv");var i=j.createDropdownMenu(a,g.Options,null,"dismissButton",null,!0);i.menuButton.classList.add("parameterInlineButton");j.createCheckedMenuItem(i.menu,g["Show all"],b._showAll,function(a){b.setOptions({showAll:a.target.checked});
i.dropdown.close(!0)});j.createCheckedMenuItem(i.menu,g["Case sensitive"],!b._caseInsensitive,function(a){b.setOptions({caseInsensitive:!a.target.checked});i.dropdown.close(!0);b.find(!0)});j.createCheckedMenuItem(i.menu,g["Wrap search"],b._wrap,function(a){b.setOptions({wrap:a.target.checked});i.dropdown.close(!0)});j.createCheckedMenuItem(i.menu,g["Incremental search"],b._incremental,function(a){b.setOptions({incremental:a.target.checked});i.dropdown.close(!0)});j.createCheckedMenuItem(i.menu,g["Whole Word"],
b._wholeWord,function(a){b.setOptions({wholeWord:a.target.checked});i.dropdown.close(!0);b.find(!0)});b._regExBox=j.createCheckedMenuItem(i.menu,g["Regular expression"],b._regex,function(a){b.setOptions({regex:a.target.checked});i.dropdown.close(!0);b.find(!0);b._showReplaceInfo()});d||j.createCheckedMenuItem(i.menu,g["Find after replace"],b._findAfterReplace,function(a){b.setOptions({findAfterReplace:a.target.checked});i.dropdown.close(!0)});return e},function(){b.hide()})},_createButton:function(b,
e,g){var d=document.createElement("button");d.addEventListener("click",g.bind(this),!1);var a=this;d.addEventListener("keydown",function(b){b.keyCode===c.KEY.ESCAPE&&a.hide()});d.appendChild(document.createTextNode(b));d.className="dismissButton parameterInlineButton";e.appendChild(d)},_createInfoImage:function(b,c){var e=document.createElement("img");e.classList.add("replaceInfo");e.addEventListener("click",function(){this._regExBox.checked=!this._regex;this.setOptions({regex:!this._regex});this.find(!0);
this._showReplaceInfo()}.bind(this));c.appendChild(e);return e},_handleInput:function(){this._incremental&&this.find(!0,null,!0);return!0},_handleKeyDown:function(b){var c=(this.isMac?b.metaKey:b.ctrlKey)&&!b.altKey&&!b.shiftKey;if(c&&b.keyCode===70)return b.stopPropagation&&b.stopPropagation(),b.cancelBubble=!0,!1;if((this.isMac?b.metaKey:b.ctrlKey)&&!b.altKey&&b.keyCode===75||b.keyCode===13)return b.stopPropagation&&b.stopPropagation(),b.cancelBubble=!0,b.keyCode===13?this.find(this._reverse?b.shiftKey:
!b.shiftKey):this.find(!b.shiftKey),!1;if(c&&b.keyCode===82)return b.stopPropagation&&b.stopPropagation(),b.cancelBubble=!0,this.replace(),!1;return b.keyCode===27?(this.hide(),!1):!0}});return{TextSearcher:i}});
define("orion/edit/nls/root/messages",{Fetching:"Fetching: ${0}",confirmUnsavedChanges:"There are unsaved changes.  Do you still want to navigate away?",searchFiles:"Search Files",searchTerm:"Enter search term:",unsavedChanges:"There are unsaved changes.",Save:"Save",Saved:"Saved",Blame:"Blame",BlameTooltip:"Show blame annotations",saveOutOfSync:"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.",
ReadingMetadata:"Reading metadata of ${0}",Reading:"Reading ${0}",readonly:"Read Only.",saveFile:"Save this file",gotoLine:"Go to Line",gotoLineTooltip:"Go to specified line number",gotoLinePrompt:"Go to line:",Undo:"Undo",Redo:"Redo",Find:"Find",noResponse:"No response from server.  Check your internet connection and try again.",savingFile:"Saving file ${0}",running:"Running ${0}","Saving...":"Saving...",View:"View",ViewTooltip:"View",Actions:"Actions",Navigator:"Navigator",FolderNavigator:"Folder Navigator",
Project:"Project",New:"New",Add:"Add",NoFile:"Use the ${0} to create new files and folders. Click a file to start coding.",LocalEditorSettings:"Local Editor Settings",NoProject:"${0} is not a project. To convert it to a project use ${1}.",ChooseFS:"Choose Filesystem",ChooseFSTooltip:"Choose the filesystem you want to view.",FSTitle:"${0} (${1})"});
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/blamer",["orion/extensionCommands","orion/PageLinks","orion/URITemplate"],function(g,k,j){function e(c,e){for(var b=e.getFileMetadata(),f=c.getServiceReferences("orion.edit.blamer"),h=0;h<f.length;h++){var d=f[h],a={};a.validationProperties=d.getProperty("validationProperties");a.forceSingleItem=!0;a=g._makeValidator(a,c);if(a.validationFunction.bind(a)(b))return c.getService(d)}return null}return{isVisible:function(c,g){return!!e(c,g)&&!!c.getService("orion.core.blame")},getBlame:function(c,
g){var b=e(c,g);b&&b.doBlame(g.getInput()).then(function(b){for(var e=k.getOrionHome(),d=0;d<b.length;d++){var a=b[d],g=new j(a.CommitLink),i={};i.OrionHome=e;a.CommitLink=g.expand(i)}c.getService("orion.core.blame")._setAnnotations(b)})}}});
define("orion/edit/editorContext",[],function(){return{getEditorContext:function(g){var k={};g.getServiceReferences("orion.edit.context").forEach(function(j){var e=g.getService(j);Object.keys(e).forEach(function(c){typeof e[c]==="function"&&(k[c]=e[c].bind(e))})});return k}}});
define("orion/editorCommands","i18n!orion/edit/nls/messages,orion/i18nUtil,orion/webui/littlelib,orion/webui/dialogs/OpenResourceDialog,orion/widgets/input/DropDownMenu,orion/Deferred,orion/URITemplate,orion/commands,orion/keyBinding,orion/commandRegistry,orion/extensionCommands,orion/contentTypes,orion/searchUtils,orion/PageUtil,orion/PageLinks,orion/blamer,orion/regex,orion/util,orion/edit/editorContext".split(","),function(g,k,j,e,c,i,b,f,h,d,a,l,n,m,o,t,s,r,u){function w(a){var c=new b(a.uriTemplate),
d=a.params||{};d.OrionHome=d.OrionHome||o.getOrionHome();var c=c.expand(d),d=document.createElement("div"),e=document.createElement("iframe");e.id=a.id;e.name=a.id;e.type="text/html";e.sandbox="allow-scripts allow-same-origin";e.frameborder=a.border!==void 0?a.border:1;e.src=c;e.className="delegatedUI";if(a.width)d.style.width=a.width,e.style.width=a.width;if(a.height)d.style.height=a.height,e.style.height=a.height;e.style.visibility="hidden";a.parent!==null&&(a.parent||window.document.body).appendChild(d);
d.appendChild(e);e.style.left=a.left||(window.innerWidth-parseInt(e.clientWidth,10))/2+"px";e.style.top=a.top||(window.innerHeight-parseInt(e.clientHeight,10))/2+"px";e.style.visibility="";window.addEventListener("message",function y(b){if(b.source===e.contentWindow&&typeof b.data==="string"&&(b=JSON.parse(b.data),b.pageService==="orion.page.delegatedUI"&&b.source===a.id)){if(b.cancelled)a.cancelled&&a.cancelled();else if(b.result)a.done&&a.done(b.result);else if(b.Status||b.status)a.status&&a.status(b.Status||
b.status);window.removeEventListener("message",y,!1);e.parentNode.removeChild(e)}},!1);return d}function v(a,b,c,d,e,f,g,h,i,j,k){this.serviceRegistry=a;this.commandService=b;this.fileClient=c;this.inputManager=d;this.toolbarId=e;this.pageNavId=g;this.isReadOnly=f;this._localSearcher=h;this._searcher=i;this.editorSettings=j;this.localSettings=k}var q={},p=null;q.createDelegatedUI=w;v.prototype={generateEditorCommands:function(a){this._generateSettingsCommand(a);this._generateSearchFilesCommand(a);
this.isReadOnly||(this._generateUndoStackCommands(a),this._generateSaveCommand(a));this._generateGotoLineCommnand(a);this._generateFindCommnand(a);this._generateBlame(a);this.isReadOnly||this._generateEditCommands(a)},_generateSettingsCommand:function(a){var b=this,d=new f.Command({imageClass:"core-sprite-wrench",tooltip:g.LocalEditorSettings,id:"orion.edit.settings",visibleWhen:function(){return!!a.getTextView()},callback:function(e){var f=d.settingsDropDown;if(!f||f.isDestroyed())f=d.settingsDropDown=
new c(e.domParent,e.domNode,{noClick:!0,selectionClass:"dropdownSelection",onShow:function(){f.focus()},onHide:function(){a.focus()}}),f.updateContent=b.localSettings.show.bind(b.localSettings),f.getContentNode().tabIndex=0;f.click()}});this.commandService.addCommand(d);this.commandService.registerCommandContribution("settingsActions","orion.edit.settings",1,null,!1,new h.KeyBinding("s",!0,!0))},_generateUndoStackCommands:function(a){this.commandService.addCommand(new f.Command({name:g.Undo,id:"orion.undo",
visibleWhen:function(){return!!a.getTextView()},callback:function(){a.getTextView().invokeAction("undo")}}));this.commandService.registerCommandContribution(this.toolbarId,"orion.undo",400,null,!0,a.getTextView().getKeyBindings("undo")[0]);this.commandService.addCommand(new f.Command({name:g.Redo,id:"orion.redo",visibleWhen:function(){return!!a.getTextView()},callback:function(){a.getTextView().invokeAction("redo")}}));this.commandService.registerCommandContribution(this.toolbarId,"orion.redo",401,
null,!0,a.getTextView().getKeyBindings("redo")[0])},_generateSearchFilesCommand:function(a){var b=this;if(b._searcher){var c=!1,d=new f.Command({name:g.searchFiles,tooltip:g.searchFiles,id:"orion.searchFiles",visibleWhen:function(){return!!a.getTextView()},callback:function(){a.getTextView().invokeAction("searchFiles")}});this.commandService.addCommand(d);this.commandService.registerCommandContribution(this.pageNavId,"orion.searchFiles",1,null,!0,new h.KeyBinding("h",!0));a.getTextView().setKeyBinding(new h.KeyBinding("h",
!0),"searchFiles");a.getTextView().setAction("searchFiles",function(){if(!c){var d=a.getSelection(),d=a.getText(d.start,d.end),f=b.serviceRegistry.getService("orion.page.progress"),h=new e.OpenResourceDialog({searcher:b._searcher,progress:f,searchRenderer:b._searcher.defaultRenderer,nameSearch:!1,title:g.searchFiles,message:g.searchTerm,initialText:d,onHide:function(){c=!1;a.focus()}});window.setTimeout(function(){c=!0;h.show(j.node(b.toolbarId))},0);return!0}},d)}},_generateSaveCommand:function(a){var b=
this;a.getTextView().setKeyBinding(new h.KeyBinding("s",!0),"save");a.getTextView().setAction("save",function(){if(b.inputManager.save)b.inputManager.save();else if(b.inputManager.onSave){var c=a.getText();b.inputManager.onSave(b.inputManager.getInput(),c,function(){a.setInput(b.inputManager.getInput(),null,c,!0);b.inputManager.afterSave&&b.inputManager.afterSave()},function(a){a.log=!0})}return!0},{name:g.Save});this.commandService.addCommand(new f.Command({name:g.Save,tooltip:g.saveFile,id:"orion.save",
visibleWhen:function(){return!a.getTextView()||b.inputManager.getReadOnly()?!1:!b.editorSettings||!b.editorSettings().autoSave},callback:function(){a.getTextView().invokeAction("save")}}));this.commandService.registerCommandContribution(this.toolbarId,"orion.save",1,null,!1,new h.KeyBinding("s",!0))},_generateGotoLineCommnand:function(a){var b=this,c=new d.ParametersDescription([new d.CommandParameter("line","number","Line:")],{hasOptionalParameters:!1},function(){var b=a.getModel().getLineAtOffset(a.getCaretOffset())+
1;return[new d.CommandParameter("line","number","Line:",b.toString())]}),c=new f.Command({name:g.gotoLine,tooltip:g.gotoLineTooltip,id:"orion.gotoLine",visibleWhen:function(){return!!a.getTextView()},parameters:c,callback:function(b){var c=a.getModel();b.parameters&&b.parameters.valueFor("line")?b=b.parameters.valueFor("line"):(b=c.getLineAtOffset(a.getCaretOffset()),(b=prompt(g.gotoLinePrompt,b+1))&&(b=parseInt(b,10)));if(b)a.onGotoLine(b-1,0)}});this.commandService.addCommand(c);this.commandService.registerCommandContribution(this.pageNavId,
"orion.gotoLine",1,null,!0,new h.KeyBinding("l",!r.isMac,!1,!1,r.isMac),new d.URLBinding("gotoLine","line"));a.getTextView().setAction("gotoLine",function(c){if(c)return a.onGotoLine(c.line-1,0,void 0,c.callback),!0;b.commandService.runCommand("orion.gotoLine");return!0},c)},_generateFindCommnand:function(a){var b=this,c=new d.ParametersDescription([new d.CommandParameter("find","text","Find:")],{clientCollect:!0},function(){var c=a.getSelection(),e="";c.end>c.start&&(e=a.getModel().getText(c.start,
c.end),b._localSearcher&&b._localSearcher.getOptions().regex&&(e=s.escape(e)));return[new d.CommandParameter("find","text","Find:",e)]}),c=new f.Command({name:g.Find,tooltip:g.Find,id:"orion.editor.find",visibleWhen:function(){return!!a.getTextView()},parameters:c,callback:function(c){if(b._localSearcher){var d="",e=null,f=a.getSelection();f.end>f.start&&c.parameters.valueFor("useEditorSelection")?(d=a.getModel().getText(f.start,f.end),b._localSearcher.getOptions().regex&&(d=s.escape(d))):c.parameters&&
c.parameters.valueFor("find")&&(d=c.parameters.valueFor("find"),e=m.matchResourceParameters(),n.convertFindURLBinding(e));if(e){b._localSearcher.setOptions({regex:e.regEx,caseInsensitive:!e.caseSensitive});c={};if(e.atLine)c.start=a.getModel().getLineStart(e.atLine-1);b._localSearcher.show({findString:d,replaceString:e.replaceWith});b._localSearcher.find(!0,c)}else b._localSearcher.show({findString:d});return!0}return!1}});this.commandService.addCommand(c);this.commandService.registerCommandContribution(this.pageNavId,
"orion.editor.find",2,null,!0,new h.KeyBinding("f",!0),new d.URLBinding("find","find"));a.getTextView().setAction("find",function(a){if(a)return b._localSearcher.show(a),!0;b.commandService.runCommand("orion.editor.find",null,null,new d.ParametersDescription([new d.CommandParameter("useEditorSelection","text","","true")],{clientCollect:!0}));return!0},c)},_generateBlame:function(a){var b=this,c=new f.Command({name:g.Blame,tooltip:g.BlameTooltip,id:"orion.edit.blame",parameters:new d.ParametersDescription([new d.CommandParameter("blame",
"boolean")],{clientCollect:!0}),visibleWhen:function(){return!a.getTextView()?!1:b.editorSettings&&!b.editorSettings().showBlame?!1:t.isVisible(b.serviceRegistry,b.inputManager)},callback:function(d){c.visible=!c.visible;if(d.parameters&&d.parameters.valueFor("blame"))c.visible=d.parameters.valueFor("blame")==="true";c.visible?t.getBlame(b.serviceRegistry,b.inputManager):a.showBlame([])}});this.commandService.addCommand(c);this.commandService.registerCommandContribution(this.toolbarId,"orion.edit.blame",
1,null,!1,new h.KeyBinding("b",!0,!0),new d.URLBinding("blame","blame"))},_generateEditCommands:function(b){function c(a){var b=new h.KeyBinding;h.KeyBinding.apply(b,a);return b}function d(a,b){!b&&a&&typeof a.HTML!=="undefined"&&delete a.HTML;var c=e.serviceRegistry.getService("orion.page.message");c?c.setProgressResult(a):window.console.log(a)}var e=this,n=this.serviceRegistry,m=n.getServiceReferences("orion.edit.command"),q=this.inputManager,t=n.getService("orion.page.progress"),o=function(a,c,
h){var i=h.visibleWhen;h.visibleWhen=function(a){return!b.getTextView()||e.inputManager.getReadOnly()?!1:!i||i(a)};h.callback=function(){b=this;var e=b.getSelection(),f=b.getModel(),h=function(a){typeof a==="object"&&a?(a.text&&b.setText(a.text),a.selection&&(b.setSelection(a.selection.start,a.selection.end,!0),b.focus())):typeof a==="string"&&(b.setText(a,e.start,e.end,!0),b.setSelection(e.start,e.start+a.length),b.focus())},i;c.execute?(f={contentType:q.getContentType(),input:q.getInput()},i=u.getEditorContext(n),
i.openDelegatedUI=w,i.setStatus=d,f=c.execute(i,f),i=null):(f=c.run(f.getText(e.start,e.end),f.getText(),e,q.getInput()),i=function(b){if(b&&b.uriTemplate){var c={};c.uriTemplate=b.uriTemplate;c.params=q.getFileMetadata();c.id=a.id;c.width=b.width;c.height=b.height;c.done=h;c.status=d;w(c)}else b.Status||b.status?d(b.Status||b.status):h(b)});t.showWhile(f,k.formatMessage(g.running,a.name)).then(i);return!0};h.callback=h.callback.bind(b);return new f.Command(h)};i.when(function(a){if(p)return p;var b=
a.getService("orion.core.contentTypeRegistry");b||(b=new l.ContentTypeRegistry(a),b=a.getService("orion.core.contentTypeRegistry"));return b.getContentTypes().then(function(a){return p=a})}(this.serviceRegistry),function(){var d=[],f=100;m.forEach(function(g){for(var h=e.serviceRegistry.getService(g),i={},j=g.getPropertyKeys(),k=0;k<j.length;k++)i[j[k]]=g.getProperty(j[k]);i.forceSingleItem=!0;g=a._createCommandOptions(i,g,e.serviceRegistry,p,!1,function(){return q.getFileMetadata()});d.push(g);g.then(function(a){a=
o(i,h,a);e.commandService.addCommand(a);e.commandService.registerCommandContribution(e.toolbarId,a.id,f);if(i.key){var d=b.getTextView();d.setKeyBinding(c(i.key),a.id);d.setAction(a.id,a.callback,a)}});f++});i.all(d,function(a){return{_error:a}}).then(function(){var a;if(a=q.getFileMetadata()){var c=j.node("pageActions");c&&(e.commandService.destroy(c),e.commandService.renderCommands(c.id,c,a,b,"button"));if(c=j.node("pageNavigationActions"))e.commandService.destroy(c),e.commandService.renderCommands(c.id,
c,b,b,"button")}})})}};q.EditorCommandFactory=v;return q});
define("orion/inputManager","i18n!orion/edit/nls/messages,orion/i18nUtil,orion/Deferred,orion/EventTarget,orion/objects,orion/PageUtil".split(","),function(g,k,j,e,c,i){function b(b){this._document=b.document||document;this._timeout=b.timeout;for(var b="keypress,keydown,keyup,mousemove,mousedown,mousemove".split(","),a=function(){this._resetTimer()}.bind(this),c=0;c<b.length;c++)this._document.addEventListener(b[c],a,!0);e.attach(this)}function f(b,a){if(b){if(a.status===0)a={Severity:"Error",Message:g.noResponse};
else{var c=a.responseText;if(c)try{a=JSON.parse(c)}catch(e){a={Severity:"Error",Message:c}}}b.setProgressResult(a)}else window.console.log(a)}function h(b){e.attach(this);this.editor=b.editor;this.serviceRegistry=b.serviceRegistry;this.fileClient=b.fileClient;this.progressService=b.progressService;this.contentTypeRegistry=b.contentTypeRegistry;this.selection=b.selection;this._input=this._title="";this.dispatcher=null;this._unsavedChanges=[]}b.prototype={_resetTimer:function(){var b=this._document.defaultView||
this._document.parentWindow;if(this._timer)b.clearTimeout(this._timer),this._timer=null;if(this._timeout!==-1)this._timer=b.setTimeout(function(){this.onIdle({type:"Idle"});this._timer=null;this._resetTimer()}.bind(this),this._timeout)},onIdle:function(b){return this.dispatchEvent(b)},setTimeout:function(b){this._timeout=b;this._resetTimer()}};c.mixin(h.prototype,{_maybeLoadWorkspace:function(b){var a=this.fileClient;return b===a.fileServiceRootURL(b)?a.loadWorkspace(b).then(function(a){return a.Location}):
(new j).resolve(b)},_read:function(b){var a=this.fileClient,c=Array.prototype.slice.call(arguments,1);return this._maybeLoadWorkspace(b).then(function(b){return a.read.apply(a,[b].concat(c))})},load:function(){var b=this.getInput();if(b){var a=this.fileClient,c=this._parsedLocation.resource,e=this.progressService,h=function(a,b,c){return!e?a:e.progress(a,k.formatMessage(b,c))},i=this.getEditor();if(this._fileMetadata)!this._saving&&!this._fileMetadata.Directory&&!this._readonly&&h(a.read(c,!0),g.ReadingMetadata,
b).then(function(e){if(this._fileMetadata&&this._fileMetadata.Location===e.Location&&this._fileMetadata.ETag!==e.ETag)this._fileMetadata=e,(!i.isDirty()||window.confirm(g.loadOutOfSync))&&h(a.read(c),g.Reading,b).then(function(a){i.setInput(b,null,a);this._unsavedChanges=[]}.bind(this))}.bind(this));else{var j=c;if(j.indexOf("/gitapi/commit/")===0){var s=j.indexOf("/file"),r=j.indexOf("?",s);if(r===-1)r=j.length;j=j.substring(s,r);this._readonly=!0}var u=window.setTimeout(function(){u=null;i.reportStatus(k.formatMessage(g.Fetching,
b))},800),w=function(){i.reportStatus("");u&&window.clearTimeout(u)},v=function(a){w();var b=this.serviceRegistry.getService("orion.page.message");f(b,a);this._setNoInput()}.bind(this);this._acceptPatch=null;h(this._read(j,!0),g.ReadingMetadata,j).then(function(e){e.Directory?h(a.fetchChildren(e.ChildrenLocation),g.Reading,b).then(function(a){w();e.Children=a;this._setInputContents(this._parsedLocation,b,a,e)}.bind(this),v):h(a.read(c,!1,!0),g.Reading,b).then(function(a){w();if(typeof a!=="string")this._acceptPatch=
a.acceptPatch,a=a.result;this._setInputContents(this._parsedLocation,b,a,e)}.bind(this),v)}.bind(this),v)}}},processParameters:function(b){var a=this.getEditor();a.processParameters&&a.processParameters(b)},getEditor:function(){return this.editor},getInput:function(){return this._input},getTitle:function(){return this._title},getFileMetadata:function(){return this._fileMetadata},getReadOnly:function(){var b=this._fileMetadata;return this._readonly||!b||b.Attributes&&b.Attributes.ReadOnly},getContentType:function(){return this._contentType},
save:function(){function b(a){if(h===p.getInput())p.getFileMetadata().ETag=a.ETag,c.setInput(h,null,i,!0);c.reportStatus("");e&&q.setProgressResult({Message:g.Saved,Severity:"Normal"});p.afterSave&&p.afterSave();p._saving=!1}function a(a){c.reportStatus("");f(q,a);p._saving=!1;p._errorSaving=!0}if(!this._saving){var c=this.getEditor();if(c.isDirty()&&!this.getReadOnly()){var e=this._errorSaving;this._saving=!0;var h=this.getInput();c.reportStatus(g["Saving..."]);this.dispatchEvent({type:"Saving",
inputManager:this});c.markClean();var i=c.getText(),j=i;if(this._getSaveDiffsEnabled()&&!this._errorSaving){for(var s=this._unsavedChanges,r=0,u=0;u<s.length;u++)r+=s[u].text.length;i.length>r&&(j={diff:s})}this._unsavedChanges=[];this._errorSaving=!1;var s={ETag:this.getFileMetadata().ETag},w=this._parsedLocation.resource,j=this.fileClient.write(w,j,s),v=this.progressService,q=this.serviceRegistry.getService("orion.page.message");v&&(j=v.progress(j,k.formatMessage(g.savingFile,h)));var p=this;j.then(b,
function(c){c.status===412?window.confirm(g.saveOutOfSync)?(c=p.fileClient.write(w,i),v&&(c=v.progress(c,k.formatMessage(g.savingFile,h))),c.then(b,a)):p._saving=!1:a(c)})}}},setAutoLoadEnabled:function(b){this._autoLoadEnabled=b},setAutoSaveTimeout:function(c){this._autoSaveEnabled=c!==-1;this._idle?this._idle.setTimeout(c):(this._idle=new b({document:document,timeout:c}),this._idle.addEventListener("Idle",function(){this._errorSaving||this.save()}.bind(this)))},setContentType:function(b){this._contentType=
b},setInput:function(b){if(!this._ignoreInput&&(b||(b=i.hash()),typeof b==="string")){var a=this.getEditor();b&&b[0]!=="#"&&(b="#"+b);var c=i.matchResourceParameters(b);if(a.isDirty()&&(a=this._location,i.matchResourceParameters(a).resource!==c.resource))if(this._autoSaveEnabled)this.save();else if(!window.confirm(g.confirmUnsavedChanges)){window.location.hash=a;return}this._location=b;this._parsedLocation=c;this._ignoreInput=!0;this.selection.setSelections(b);this._ignoreInput=!1;(b=c.resource)?
b===this._input?this.processParameters(c):(this._input=b,this._readonly=!1,this._fileMetadata=null,this.load()):this._setNoInput(!0)}},setTitle:function(b){var a=b.lastIndexOf("/");a!==-1&&(b=b.substring(a+1));this._title=b},setSaveDiffsEnabled:function(b){this._saveDiffsEnabled=b},_getSaveDiffsEnabled:function(){return this._saveDiffsEnabled&&this._acceptPatch!==null&&this._acceptPatch.indexOf("application/json-patch")!==-1},_setNoInput:function(b){b?this.fileClient.loadWorkspace("").then(function(a){this._input=
a.ChildrenLocation;this._setInputContents(a.ChildrenLocation,null,a,a)}.bind(this)):(this._input=this._title=null,this.setContentType(null),this.editor.uninstall(),this.dispatchEvent({type:"InputChanged",input:null}))},_setInputContents:function(b,a,c,e){var f,g=!1;e?(this._fileMetadata=e,this.setTitle(e.Location||String(e)),this.setContentType(this.contentTypeRegistry.getFileContentType(e)),f=e.Name,g=e.Directory):(this._fileMetadata=null,this.setTitle(a),this.setContentType(this.contentTypeRegistry.getFilenameContentType(this.getTitle())),
f=this.getTitle());var h=this.getEditor();g?h.uninstall():h.getTextView()||(h.install(),h.getTextView().addEventListener("Focus",function(){this._autoSaveEnabled&&this._errorSaving?this.save():this._autoLoadEnabled&&this.load()}.bind(this)),h.getModel().addEventListener("Changing",function(a){if(this._getSaveDiffsEnabled()){var b=this._unsavedChanges.length,c=a.removedCharCount,d=a.start,e=a.start+c,f=0;a.addedCharCount===0?f=-1:c===0&&(f=1);if(b>0&&f===this.previousChangeType){b=this._unsavedChanges[b-
1];if(c===0&&d===b.end+b.text.length){b.text+=a.text;return}if(a.addedCharCount===0&&e===b.start){b.start=d;return}}this.previousChangeType=f;this._unsavedChanges.push({start:d,end:e,text:a.text})}}.bind(this)));this.dispatchEvent({type:"InputChanged",input:b,name:f,title:a,contentType:this.getContentType(),metadata:e,location:window.location,contents:c});if(!g)h.setInput(a,null,c),this._unsavedChanges=[],this.processParameters(b)}});return{InputManager:h}});
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,i,b,f,h,d,a,l,n,m,o,t,s){function r(a){this._syntaxHighlither=
new f.SyntaxHighlighter(a)}k={};k.DefaultDiffProvider=function(){function a(b){this.serviceRegistry=b;this._diffProvider=new i.DiffProvider(b)}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 e=d[0],d=d[1];return(new j).resolve({oldFile:{URL:a,Name:c._resolveFileName(a),Type:e},newFile:{URL:b,Name:c._resolveFileName(b),Type:d},diffContent:c._diffContent})}else return e=
a?c._resolveFileName(a):"",d=b?c._resolveFileName(b):"",(new j).resolve({oldFile:{URL:a,Name:e,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.contentTypeRegistry").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 f(a,c,i,j){this._registry=a;this._commandService=c;this._fileClient=new h.FileClient(a);this._fileClient=new h.FileClient(a);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 b.toggleableCompareView(i.type==="inline"?"inline":"twoWay",j):i.type==="inline"?new b.inlineCompareView(j):new b.TwoWayCompareView(j);this._compareView.getWidget().setOptions({extCmdHolder:this});
j.highlighters||this._compareView.getWidget().setOptions({highlighters:[new r(a),new r(a)]});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 t.InputManager({serviceRegistry:a,fileClient:k._fileClient,progressService:k._progress});o.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){this._parsedLocation={resource: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(b,c){var e;if(c)e=c.Name;d.setPageTarget({task:g.Compare,name:e,target:c,serviceRegistry:a,commandService:k._commandService,searchService:k._searchService,fileService:k._fileClient});b.charAt(0)==="*"?(d.setDirtyIndicator(!0),b.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);c=(new s.KeyBindingsFactory).createKeyBindings(a,c,d,b);(new m.EditorCommandFactory(k._registry,k._commandService,k._fileClient,k._inputManager,"pageActions",!1,"pageNavigationActions",b)).generateEditorCommands(a);
return c};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))}}f.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 b=this._compareView.getWidget().options.commandProvider;if(b&&b.getOptions().commandSpanId){var b=b.getOptions().commandSpanId,c=new a.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)}}),d=new a.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(c);this._commandService.addCommand(d);this._commandService.registerCommandContribution(b,
"orion.compare.openComparePage",98);this._commandService.registerCommandContribution(b,"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 f}();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(b){for(var c=0;c<f.length;c++)if(b.type===f[c])return!0;return!1}function i(c){for(var d=0;d<b.length;d++)if(c.type===b[d])return!0;return!1}var b=["Missing","Modified","Untracked","Conflicting"],f=["Added","Changed","Removed"];return{statusUILocation:"git/git-status.html",isStaged:c,isUnstaged:i,isChange:function(b){return c(b)||
i(b)},hasStagedChanges:function(b){for(var c=0;c<f.length;c++)if(b[f[c]].length>0)return!0;return!1},hasUnstagedChanges:function(c){for(var d=0;d<b.length;d++)if(c[b[d]].length>0)return!0;return!1},createCompareWidget:function(b,c,a,f,g,i,o,t,s){var r=new j.DefaultDiffProvider(b),i=new k.CompareCommandFactory({commandService:c,commandSpanId:i,gridRenderer:t});(new j.ResourceComparer(b,c,{toggleable:!0,type:"inline",readonly:!0,hasConflicts:f,diffProvider:r,resource:a,compareTo:s,editableInComparePage:o},
{parentDivId:g,commandProvider:i})).start().then(function(a){var b=420;a<b&&(b=a);e.node(g).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 i=new g;this._preferenceService.getPreferences(this._prefix,2).then(function(b){var e=b.get("settings");e===void 0?i.reject():e.enabled?(b.put(j,c),i.resolve()):i.reject()});return i},get:function(j){var e={gitSshUsername:"",gitSshPassword:"",gitPrivateKey:"",gitPassphrase:""},c=new g;this._preferenceService.getPreferences(this._prefix,2).then(function(g){var b=
g.get("settings");b===void 0?c.reject():b.enabled?(g=g.get(j),g!==void 0?c.resolve(g):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(),g=0;g<e.length;++g)e[g]!=="settings"&&c.push(e[g]);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(b,c){this.explorer=c;this._init(b)}function i(b){this._init(b)}var b=function(){function b(c,d,a,e){this.gitClient=c;this.rootPath=d;this.fetchItems=a;this.root=e?e:null}b.prototype=new j.ExplorerModel;b.prototype.getRoot=function(b){var c=this;this.root?b(this.root):this.fetchItems(this.rootPath).then(function(a){c.root=a;b(a)})};
b.prototype.getIdentity=function(b){b.Location?(b=b.Location,b=b.replace(/[^\.\:\-\_0-9A-Za-z]/g,"")):b="ROOT";return b};b.prototype.getChildren=function(b,c){b.children=[];if(b.Children){for(var a=0;a<b.Children.length;a++)b.Children[a].parent=b,b.children[a]=b.Children[a];c(b.Children)}else b.BranchLocation&&b.RemoteLocation?(b.children=[{GroupNode:"true",Location:b.BranchLocation,Name:"Branches",parent:b},{GroupNode:"true",Location:b.RemoteLocation,BranchLocation:b.BranchLocation,Name:"Remotes",
parent:b},{GroupNode:"true",Location:b.TagLocation,Name:"Tags",parent:b}],c(b.children)):b.GroupNode?this.gitClient.getGitBranch(b.Location).then(function(a){b.children=a.Children;for(var e=0;e<a.Children.length;e++)a.Children[e].parent=b;c(a.Children)}):b.Type==="Remote"&&this.gitClient.getGitBranch(b.Location).then(function(a){b.children=a.Children;for(var e=0;e<a.Children.length;e++)a.Children[e].parent=b;c(a.Children)})};return b}();c.prototype=new j.SelectionRenderer;c.prototype.constructor=
c;c.prototype.getLabelColumnIndex=function(){return 0};c.prototype.getCellElement=function(b,c,d){var a=document.createElement("td");d.appendChild(a);b=document.createElement("span");b.id=d.id+"navSpan";a.appendChild(b);b.className="mainNavColumn singleNavColumn";(c.children||c.Children||c.GroupNode||c.Type==="Remote"||c.BranchLocation&&c.RemoteLocation)&&this.getExpandImage(d,b);d=c.Name;c.Type==="RemoteTrackingBranch"&&!c.Id&&(d=c.Name+g[" [New branch]"]);b.appendChild(document.createTextNode(d))};
i.prototype=new k.Dialog;i.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>';i.prototype._init=function(b){var c=this;this.title=b.title||g["Choose a Folder"];this.modal=!0;this.messages=g;this.func=b.func;this.treeRoot=b.treeRoot;this.gitClient=
b.gitClient;this.hideNewBranch=b.hideNewBranch;this.serviceRegistry=b.serviceRegistry;this.buttons=[];this.buttons.push({callback:function(){c.$remoteOk.classList.contains(this.DISABLED)||(c.destroy(),c._execute.bind(c)())},text:"OK",isDefault:!0,id:"remoteOk"})};i.prototype._bindToDom=function(){var b=this;this.$newBranch.addEventListener("input",function(){b._validate()});if(this.hideNewBranch)this.$newBranchPane.style.display="none"};i.prototype._beforeShowing=function(){this._initialize();this._loadRemoteChildren()};
i.prototype._afterShowing=function(){this.$treeContentPane.focus();this._validate()};i.prototype._loadRemoteChildren=function(){this._createTree(new b(this.gitClient,null,this.gitClient.getGitClone,this.treeRoot))};i.prototype._createTree=function(b){var g=this,d=this.serviceRegistry.getService("orion.remotePrompter.selection");d||(d=new e.Selection(this.serviceRegistry,"orion.remotePrompter.selection"));var a=new c({checkbox:!1,singleSelection:!0,treeTableClass:"directoryPrompter"});this.explorer=
new j.Explorer(this.serviceRegistry,d,a);a.explorer=this.explorer;this.explorer.createTree("treeContentPane",b);d.addEventListener("selectionChanged",function(a){g.$newBranch.disabled=a.selection&&a.selection.Type==="Remote"?!1:!0;g._validate(a.selection)})};i.prototype._validate=function(b){var c=function(b){b&&b.Type==="RemoteTrackingBranch"?this.$remoteOk.classList.remove(this.DISABLED):b&&b.Type==="Remote"&&this.$newBranch.value!==""?this.$remoteOk.classList.remove(this.DISABLED):this.$remoteOk.classList.add(this.DISABLED)};
b?c.bind(this)(b):this.serviceRegistry.getService("orion.remotePrompter.selection").getSelection(c.bind(this))};i.prototype._execute=function(){var b=this;this.serviceRegistry.getService("orion.remotePrompter.selection").getSelection(function(c){if(b.func)if(c.Type==="RemoteTrackingBranch")b.func(c,c.parent);else{var d=c.CloneLocation.substring(c.CloneLocation.indexOf(c.CloneLocation.split("/")[3])),a={};a.parent=c;a.FullName="refs/remotes/"+c.Name+"/"+b.$newBranch.value;a.Name=c.Name+"/"+b.$newBranch.value;
a.Type="RemoteTrackingBranch";a.Location="/gitapi/remote/"+c.Name+"/"+encodeURIComponent(b.$newBranch.value)+"/"+d;b.func(null,c,a)}})};i.prototype.constructor=i;return{RemotePrompterDialog:i}});
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:g.Submit});this._initialize()};j.prototype._bindToDom=function(){this.$reviewReqUrl.value=this.url};j.prototype.constructor=j;return{ReviewRequestDialog: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/explorers/explorer-table","i18n!orion/navigate/nls/messages,require,orion/Deferred,orion/webui/littlelib,orion/i18nUtil,orion/fileUtils,orion/explorers/explorer,orion/EventTarget,orion/util".split(","),function(g,k,j,e,c,i,b,f,h){function d(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 a(a){f.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=a.modelEventDispatcher?a.modelEventDispatcher:new f;this.modelEventDispatcher=b;var c=this;this._modelListeners={};"copy,copyMultiple,create,delete,deleteMultiple,import,move,moveMultiple".split(",").forEach(function(a){b.addEventListener(a,
c._modelListeners[a]=c.modelHandler[a].bind(c))});var d=this.renderer;this.registry&&this.registry.registerService("orion.cm.managedservice",{updated:function(a){a=a&&a["links.newtab"]!=="undefined"?a["links.newtab"]?"_blank":"_self":"_self";d.setTarget&&d.setTarget(a)}},{pid:"nav.config"})}d.prototype=new b.ExplorerModel;d.prototype.getRoot=function(a){a(this.root)};d.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};d.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){c.destroyed||b(c.processParent(a,d))}):b([])};d.prototype.hasChildren=function(){var a=!1;this.root.Children&&(a=this.root.Children.length>0);return a};d.prototype.constructor=d;a.prototype=Object.create(b.Explorer.prototype);a.prototype.destroy=function(){var a=this;Object.keys(this._modelListeners).forEach(function(b){a.modelEventDispatcher.removeEventListener(b,a._modelListeners[b])});b.Explorer.prototype.destroy.call(this)};a.prototype.modelHandler=
{copy:function(){},copyMultiple:function(a){var b=this,c={};a.items.forEach(function(a){a=a.newValue.Parents&&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)}};var l;a.prototype._makeDropTarget=function(a,b,d){function f(a,b,d,e,h,j){b=b||"";if(a.isFile)i.isAtRoot(d.Location)?e.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(d,a,e,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(c){k.readEntries(function(d){for(var g=0;g<d.length;g++)f(d[g],b+a.name+"/",c,e,h,j)})},n=e.registry.getService("orion.page.progress");i.isAtRoot(d.Location)?n.progress(j.createProject(d.ChildrenLocation,a.name),"Initializing project "+a.name).then(function(a){e.loadResourceList(e.treeRoot.Path,!0);n.progress(j.read(a.ContentLocation,!0),"Loading project info "+a.name).then(function(a){l(a)})}):n.progress(j.createFolder(d.Location,
a.name),"Creating folder "+a.name).then(function(a){e.changedItem(d,!0);l(a)})}}if(this.dragAndDrop){var j=this,k=this.dragAndDrop,u=function(a){l=a.target};if(d)this._oldDragStart&&b.removeEventListener("dragstart",this._oldDragStart,!1),this._oldDragStart=u;b.addEventListener("dragstart",u,!1);u=function(){l=null};if(d)this._oldDragEnd&&b.removeEventListener("dragend",this._oldDragEnd,!1),this._oldDragEnd=u;b.addEventListener("dragend",u,!1);u=function(a){b.classList.remove("dragOver");a.preventDefault();
a.stopPropagation()};if(d)this._oldDragLeave&&b.removeEventListener("dragleave",this._oldDragLeave,!1),this._oldDragLeave=u;b.addEventListener("dragleave",u,!1);u=function(a){if(!h.isIE&&(a.dataTransfer.effectAllowed==="all"||a.dataTransfer.effectAllowed==="uninitialized"||a.dataTransfer.effectAllowed.indexOf("copy")>=0))a.dataTransfer.dropEffect="copy";b.classList.add("dragOver");e.stop(a)};if(d)this._oldDragEnter&&b.removeEventListener("dragenter",this._oldDragEnter,!1),this._oldDragEnter=u;b.addEventListener("dragenter",
u,!1);u=function(a){if(!h.isIE&&(a.dataTransfer.effectAllowed==="all"||a.dataTransfer.effectAllowed==="uninitialized"||a.dataTransfer.effectAllowed.indexOf("copy")>=0))a.dataTransfer.dropEffect="copy";e.stop(a)};if(d&&!this._oldDragOver)b.addEventListener("dragover",u,!1),this._oldDragOver=u;u=function(d){b.classList.remove("dragOver");if(l){var h=j.fileClient,q=l.href,p=q.indexOf("#"),q=q.substring(p+1),o=j.registry.getService("orion.page.progress");o.showWhile(h.copyFile(q,a.Location),c.formatMessage(g["Copying ${0}"],
q)).then(function(){j.changedItem(a,!0)},function(a){o?o.setProgressResult(a):window.console.log(a)})}else if(d.dataTransfer.items&&d.dataTransfer.items.length>0)for(h=0;h<d.dataTransfer.items.length;h++)q=null,typeof d.dataTransfer.items[h].getAsEntry==="function"?q=d.dataTransfer.items[h].getAsEntry():typeof d.dataTransfer.items[h].webkitGetAsEntry==="function"&&(q=d.dataTransfer.items[h].webkitGetAsEntry()),q&&f(q,null,a,j,k,j.fileClient);else if(d.dataTransfer.files&&d.dataTransfer.files.length>
0)for(h=0;h<d.dataTransfer.files.length;h++)q=d.dataTransfer.files[h],!q.length&&(!q.type||q.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."],q.name)}):i.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,q,j,q.name.indexOf(".zip")===
q.name.length-4&&window.confirm(c.formatMessage(g["Unzip ${0}?"],q.name)));e.stop(d)};if(d)this._oldDrop&&b.removeEventListener("drop",this._oldDrop,!1),this._oldDrop=u;b.addEventListener("drop",u,!1)}};a.prototype.changedItem=function(a,b){if(this.treeRoot&&this.treeRoot.Location===a.Location)return this.loadResourceList(this.treeRoot,b);var c=this,d=new j;a.children=null;this.model.getChildren(a,function(e){c.getNavHandler();c.myTree.refresh.bind(c.myTree)(a,e,b);d.resolve(e)});return d};a.prototype.isExpanded=
function(a){return this.renderer.tableTree.isExpanded(this.model.getId(a))};a.prototype.getNameNode=function(a){if(a=this.model.getId(a))return e.node(a+"NameLink")};a.prototype.scopeUp=function(){};a.prototype.scopeDown=function(){};a.prototype.loadResourceList=function(a,b,c){a&&typeof a==="object"&&(a=a.ChildrenLocation||a.ContentLocation);a=i.makeRelative(a);if(!b&&a===this._lastPath)return(new j).resolve(this.treeRoot);this._lastPath=a;var d=this;return b||a!==this.treeRoot.Path?this.load(this.fileClient.loadWorkspace(a),
"Loading "+a).then(function(){d.treeRoot.Path=a;typeof c==="function"&&c();d.dispatchEvent({type:"rootChanged",root:d.treeRoot});return(new j).resolve(d.treeRoot)},function(a){d.treeRoot.Path=null;d.dispatchEvent({type:"rootChanged",root:d.treeRoot});return(new j).reject(a)}):(new j).resolve(d.treeRoot)};a.prototype.load=function(a,b,c){var f=e.node(this.parentId),g=e.node("progress");if(!g)g=document.createElement("div"),g.id="progress",e.empty(f),f.appendChild(g);e.empty(g);var h=setTimeout(function(){e.empty(g);
g.appendChild(document.createTextNode(b))},500),i=this;return j.when(a,function(a){clearTimeout(h);if(!i.destroyed){i.treeRoot={};for(var b in a)i.treeRoot[b]=a[b];i.model=new d(i.registry,i.treeRoot,i.fileClient,i.parentId,i.excludeFiles,i.excludeFolders);i.model.processParent(i.treeRoot,a.Children);if(i.dragAndDrop)i._hookedDrag?i._makeDropTarget(i.treeRoot,f,!0):(a=(a=f&&("draggable"in f||"ondragstart"in f&&"ondrop"in f))&&!(!window.File||!window.FileList||!window.FileReader),i._hookedDrag=!0,
a?i._makeDropTarget(i.treeRoot,f,!0):(i.dragAndDrop=null,window.console.log("Local file drag and drop is not supported in this browser.")));i.createTree(i.parentId,i.model,{navHandlerFactory:i.navHandlerFactory,setFocus:typeof i.setFocus==="undefined"?!0:i.setFocus,selectionPolicy:i.renderer.selectionPolicy,onCollapse:function(a){if(i.getNavHandler())i.getNavHandler().onCollapse(a)}});if(typeof c==="function")try{c()}catch(e){i.registry&&i.registry.getService("orion.page.message").setErrorMessage(e)}if(typeof i.onchange===
"function")i.onchange(i.treeRoot);return(new j).resolve(i.treeRoot)}},function(a){clearTimeout(h);i.registry.getService("orion.page.message").setProgressResult(a);return(new j).reject(a)})};a.prototype.onchange=function(){};a.prototype.constructor=a;return{FileExplorer:a,FileModel:d}});
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,i,b,f){function h(a,b){this.explorer=b;this._init(a)}function d(a){this._init(a)}h.prototype=new b.SelectionRenderer;h.prototype.constructor=h;h.prototype.getLabelColumnIndex=function(){return 0};h.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 f.FileExplorer({treeRoot:{children:[]},selection:this.selection,serviceRegistry:this._serviceRegistry,fileClient:this._fileClient,parentId:"directoryTree",excludeFiles:!0,rendererFactory:function(a){return new h({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","orion/URITemplate","require"],function(g,k,j,e,c){function i(b){this._init(b)}var b=new e("edit/edit.html#{,resource,params*}");i.prototype=new j.Dialog;i.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>';i.prototype._init=
function(b){var c=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(){c.destroy();c._execute()},text:"OK"});this._initialize()};i.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()};i.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)};i.prototype._showAdvanced=function(){this.advancedShown=!0;this.$advancedPane.style.display="";this.$advancedLink.style.display=
"none";this.$advancedLinkHide.style.display=""};i.prototype._hideAdvanced=function(){this.advancedShown=!1;this.$advancedPane.style.display="none";this.$advancedLink.style.display="";this.$advancedLinkHide.style.display="none"};i.prototype._checkNewExisting=function(){this.$isExistingProject.checked?this._openDirectoryPickerDialog():this.$gitName.focus()};i.prototype._showNewProject=function(){this.$isNewProject.checked=!0};i.prototype._openDirectoryPickerDialog=function(){function e(a){var d=document.createElement("a");
d.href=c.toUrl(b.expand({resource:a.ChildrenLocation}));d.textContent=a.Name;return d}var h=this;this.$isExistingProject.checked=!0;var d=new k.DirectoryPrompterDialog({title:g["Choose a Folder"],serviceRegistry:this.serviceRegistry,fileClient:this.fileClient,func:function(a){if(a&&a.Location){for(h.$gitPath.value=a.Location;h.$shownGitPath.hasChildNodes();)h.$shownGitPath.removeChild(h.$shownGitPath.lastChild);for(h.$shownGitPath.appendChild(e(a));a.parent&&a.parent.Location!=="/";)h.$shownGitPath.insertBefore(document.createTextNode("/"),
h.$shownGitPath.firstChild),h.$shownGitPath.insertBefore(e(a.parent),h.$shownGitPath.firstChild),a=a.parent}}});this._addChildDialog(d);d.show()};i.prototype.constructor=i;return{CloneGitRepositoryDialog:i}});
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 e=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(){e.destroy();
e._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(e){if(!e)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(e){c.privateKeyFile=e.target.files[0]})};e.prototype._execute=function(){var c=this,e=this.$gitPrivateKey.value,
b=this.$url.textContent,f=function(b){if(c._sshService)c._sshService.getKnownHosts().then(function(a){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?b:"",gitPassphrase:c.$isPrivateKey.checked?c.$gitPassphrase.value:
"",knownHosts:a})}});else if(c.options.func){var a=typeof c.options.failedOperation==="undefined"?c.options.errordata.failedOperation:c.options.failedOperation;a!=="undefined"&&c._progressService.removeOperation(a);c.options.func({gitSshUsername:c.$gitSshUsername.value,gitSshPassword:c.$gitSshPassword.value,gitPrivateKey:b,gitPassphrase:c.$gitPassphrase.value,knownHosts:c.$gitSshKnownHosts.value})}};if(this.privateKeyFile){var g=new FileReader;g.onload=function(){return function(d){e=d.target.result;
d=new k(c.options.serviceRegistry);c.$gitSaveCredentials.checked?d.put(b,{gitPrivateKey:e,gitPassphrase:c.$gitPassphrase.value}).then(function(){f(e)}):f(e)}}(this.privateKeyFile);g.readAsText(this.privateKeyFile)}else e.length>0?(g=new k(c.options.serviceRegistry),c.$gitSaveCredentials.checked?g.put(b,{gitPrivateKey:e,gitPassphrase:c.$gitPassphrase.value}).then(function(){f(e)}):f(e)):(g=new k(c.options.serviceRegistry),c.$gitSaveCredentials.checked?g.put(b,{gitSshUsername:c.$gitSshUsername.value,
gitSshPassword:c.$gitSshPassword.value}).then(function(){f(e)}):f(e))};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/URITemplate,orion/webui/littlelib".split(","),function(g,k,j,e,c,i,b){function f(b){this._init(b)}var h=new i("git/git-commit.html#{,resource,params*}?page=1&pageSize=1");f.prototype=new c.Dialog;f.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>';f.prototype._init=
function(b){this.title=b.title||k["Find Commit"];this.modal=!0;this.messages=k;this.SEARCH_DELAY=500;this.timeoutId=null;this.time=0;this.serviceRegistry=b.serviceRegistry;if(!this.serviceRegistry)throw Error("Missing required argument: serviceRegistry");this.repositories=b.repositories;if(!this.repositories)throw Error("Missing required argument: repositories");this.commitName=b.commitName;this._initialize()};f.prototype._bindToDom=function(){var c=this;this.$resourceName.addEventListener("input",
function(){c.time=+new Date;c.timeoutId&&clearTimeout(c.timeoutId);c.timeoutId=setTimeout(c._checkSearch.bind(c),0)},!1);this.$resourceName.addEventListener("keydown",function(a){if(a.keyCode===b.KEY.ENTER){var e=b.$("a",c.$results);e&&(b.stop(a),window.open(e.href),c.hide())}},!1);this.$resourceName.value=this.commitName};f.prototype._checkSearch=function(){clearTimeout(this.timeoutId);var b=(new Date).getTime();b-this.time>this.SEARCH_DELAY?(this.time=b,this._doSearch()):this.timeoutId=setTimeout(this._checkSearch.bind(this),
50)};f.prototype._findCommitLocation=function(b,a,c){var f=this;c||(c=new e);b.length>0?this.serviceRegistry.getService("orion.page.progress").progress(f.serviceRegistry.getService("orion.git.provider").doGitLog("/gitapi/commit/"+a+b[0].ContentLocation+"?page=1&pageSize=1"),"Getting commit details "+a).then(function(a){c.resolve(a.Children[0])},function(){f._findCommitLocation(b.slice(1),a,c)}):c.reject();return c};f.prototype._doSearch=function(){var c=this,a=this.$resourceName&&this.$resourceName.value;
if(a){var e=document.createElement("div");e.appendChild(document.createTextNode(k["Searching..."]));b.empty(this.$results);this.$results.appendChild(e);this.serviceRegistry.getService("orion.page.message").setProgressMessage(k["Looking for the commit"]);this._findCommitLocation(this.repositories,a).then(function(a){b.empty(c.$results);c._displayCommit(a,c.$results);c.serviceRegistry.getService("orion.page.message").setProgressMessage("")},function(){var a=document.createElement("div");a.appendChild(document.createTextNode("No commits found"));
b.empty(c.$results);c.$results.appendChild(a);c.serviceRegistry.getService("orion.page.message").setProgressMessage("")})}};f.prototype._displayCommit=function(c,a){var e=this,f=document.createElement("div");f.style.padding="10px";f.style.maxWidth="480px";b.empty(a);a.appendChild(f);var i=c.Message.split(/(\r?\n|$)/)[0],o=document.createElement("a");o.className="navlinkonpage";o.href=g.toUrl(h.expand({resource:c.Location}));o.textContent=i;f.appendChild(o);o.addEventListener("mouseup",function(a){a.button===
0&&!a.ctrlKey&&!a.metaKey&&e.hide()},!1);o.addEventListener("keyup",function(a){a.keyCode===b.KEY.ENTER&&e.hide()},!1);i=document.createElement("div");i.style.paddingTop="15px";f.appendChild(i);if(c.AuthorImage)f=new Image,f.src=c.AuthorImage,f.name=c.AuthorName,f.className="git-author-icon",i.appendChild(f);f=document.createElement("div");f.textContent=j.formatMessage(k[" authored by ${0} {${1}) on ${2}"],c.AuthorName,c.AuthorEmail,(new Date(c.Time)).toLocaleString());i.appendChild(f);f=document.createElement("div");
f.textContent=j.formatMessage(k["committed by 0 (1)"],c.CommitterName,c.CommitterEmail);i.appendChild(f);f=document.createElement("div");f.style.paddingTop="15px";f.textContent=k["commit:"]+c.Name;i.appendChild(f);if(c.Parents&&c.Parents.length>0)a=document.createElement("div"),a.textContent=k["parent:"],f=document.createElement("a"),f.className="navlinkonpage",f.href=g.toUrl(h.expand({resource:c.Parents[0].Location})),f.textContent=c.Parents[0].Name,a.appendChild(f),f.addEventListener("mouseup",
function(a){a.button===0&&!a.ctrlKey&&!a.metaKey&&e.hide()},!1),f.addEventListener("keyup",function(a){a.keyCode===b.KEY.ENTER&&e.hide()},!1),i.appendChild(a)};f.prototype._beforeHiding=function(){clearTimeout(this._timeoutId)};f.prototype.constructor=f;return{OpenCommitDialog:f}});
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/>'+g["URL:"]+'<input type="text" name="url" id="url"/></div><div style="padding:4px"><input type="radio" name="radio" value="fileRadio" id="fileRadio"/>'+g["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:g.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,i,b,f,h,d,a,l,n,m,o,t,s,r,u,w,v,q){var p={};(function(){function x(a){return k.toUrl(B.expand({resource:a}))}function w(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 A=!1,F=new q("git/git-repository.html#{,resource,params*}"),G=new q("git/git-log.html#{,resource,params*}?page=1"),y=new q("git/git-log.html#{,resource,params*}"),z=new q("git/git-commit.html#{,resource,params*}?page=1&pageSize=1"),B=new q(f.statusUILocation+
"#{,resource,params*}"),J=new q("edit/edit.html#{,resource,params*}");p.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");A||(A=!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"))}))};p.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)})})}};
p.handleSshAuthenticationError=function(a,b,c,e,f){var b=b?b.Url:void 0,g=function(){(new t.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)};p.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};p.handleProgressServiceResponse=
function(a,b,c,d,e,f){a&&a.status!==void 0&&(a=w(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;p.handleSshAuthenticationError(c,a.JsonData,b,e,f);break;case 400:if(a.JsonData&&a.JsonData.HostKey){if(a.failedOperation)b.failedOperation=a.failedOperation;p.handleKnownHostsError(c,a.JsonData,b,e);break}else if(a.JsonData&&a.JsonData.Host){if(a.JsonData)b.errordata=a.JsonData;if(a.failedOperation)b.failedOperation=
a.failedOperation;p.handleSshAuthenticationError(c,a.JsonData,b,e,f);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)}};p.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 t.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};p.handleGitServiceResponse=function(a,b,c,d){a&&a.status!==void 0&&(a=w(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)}};p.createFileCommands=function(a,c,f){function q(b){var c={Severity:"Error",HTML:!1};try{var d=JSON.parse(b.responseText);c.Message=d.DetailedMessage?d.DetailedMessage:d.Message?d.Message:g["Problem while performing the action"]}catch(e){c.Message=g["Problem while performing the action"]}a.getService("orion.page.message").setProgressResult(c)}var o=new b.ParametersDescription([new b.CommandParameter("name",
"text",g["Local Branch Name:"])]),o=new i.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(b){var c=b.items,d=function(b,c,d){a.getService("orion.page.progress").showWhile(a.getService("orion.git.provider").checkoutTag(b,c,d),e.formatMessage(g["Checking out tag ${0}"],d)).then(function(){f.changedItem()},q)},h=c.Repository?
c.Repository.Location:c.CloneLocation;b.parameters.valueFor("name")&&!b.parameters.optionsRequested&&d(h,c.Name,b.parameters.valueFor("name"))},visibleWhen:function(a){return a.Type==="Tag"}});c.addCommand(o);o=new i.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(b){var c=b.items,d=a.getService("orion.git.provider"),h=a.getService("orion.page.message"),i=a.getService("orion.page.progress");h.setProgressMessage(c.Name?e.formatMessage(g["Checking out branch ${0}..."],c.Name):g["Checking out branch..."]);c.Type==="Branch"?i.progress(d.checkoutBranch(c.CloneLocation,c.Name),"Checking out branch "+c.Name).then(function(){h.setProgressResult(g["Branch checked out."]);f.changedItem(c.parent)},function(a){q(a)}):i.progress(d.addBranch(c.Repository?
c.Repository.BranchLocation:c.parent.parent.BranchLocation,null,c.Name),"Adding branch "+c.Name).then(function(a){i.progress(d.checkoutBranch(a.CloneLocation,a.Name),"Checking out branch "+c.Name).then(function(){h.setProgressResult(g["Branch checked out."]);f.changedItem(c.Repository?c.Repository.BranchLocation:c.parent.parent.parent)},function(a){q(a)})},function(a){q(a)})},visibleWhen:function(a){return a.Type==="Branch"||a.Type==="RemoteTrackingBranch"}});c.addCommand(o);o=new b.ParametersDescription([new b.CommandParameter("name",
"text","Name:")]);o=new i.Command({name:g["New Branch"],tooltip:g["Add a new local branch to the repository"],id:"eclipse.addBranch",parameters:o,callback:function(b){var c=b.items,d=a.getService("orion.page.progress"),e=function(b,e){d.progress(a.getService("orion.git.provider").addBranch(b,e),"Adding branch "+e).then(function(){f.changedItem(c)},q)},g;g=c.Type==="Clone"?c.BranchLocation:c.Location;b.parameters.valueFor("name")&&!b.parameters.optionsRequested&&e(g,b.parameters.valueFor("name"))},
visibleWhen:function(a){return a.GroupNode&&a.Name==="Branches"||a.Type==="Clone"&&f.parentId==="artifacts"}});c.addCommand(o);o=new i.Command({name:g.Delete,tooltip:g["Delete the local branch from the repository"],imageClass:"core-sprite-delete",id:"eclipse.removeBranch",callback:function(b){var c=b.items,b=a.getService("orion.page.progress");confirm(e.formatMessage(g["Are you sure you want to delete branch ${0}?"],c.Name))&&b.progress(a.getService("orion.git.provider").removeBranch(c.Location),
"Removing branch "+c.Name).then(function(){f.changedItem?f.changedItem(c.parent):f.displayBranches&&f.displayBranches(c.ParentLocation,null)},q)},visibleWhen:function(a){return a.Type==="Branch"&&!a.Current}});c.addCommand(o);o=new i.Command({name:g.Delete,tooltip:g["Delete the remote tracking branch from the repository"],imageClass:"core-sprite-delete",id:"eclipse.removeRemoteBranch",callback:function(b){var c=b.items,d=a.getService("orion.page.progress");confirm(e.formatMessage(g["You're going to delete remote branch ${0} and push the change."],
c.Name)+"\n\n"+g["Are you sure?"])&&p.getDefaultSshOptions(a).then(function(b){var e=arguments.callee,h=a.getService("orion.git.provider"),i=a.getService("orion.page.message"),h=d.progress(h.doPush(c.Location,"",!1,!1,b.gitSshUsername,b.gitSshPassword,b.knownHosts,b.gitPrivateKey,b.gitPassphrase),g["Removing remote branch: "]+c.Name);i.createProgressMonitor(h,g["Removing remote branch: "]+c.Name);h.then(function(d){p.handleProgressServiceResponse(d,b,a,function(a){a.Result.Severity=="Ok"&&f.changedItem(c.parent)},
e,g["Delete Remote Branch"])},function(d){p.handleProgressServiceResponse(d,b,a,function(){},e,g["Removing remote branch: "]+c.Name)})})},visibleWhen:function(a){return a.Type==="RemoteTrackingBranch"}});c.addCommand(o);o=new b.ParametersDescription([new b.CommandParameter("name","text","Name:"),new b.CommandParameter("url","url","Url:")]);o=new i.Command({name:g["New Remote"],tooltip:g["Add a new remote to the repository"],id:"eclipse.addRemote",parameters:o,callback:function(b){var c=b.items,d=
a.getService("orion.page.progress"),e=function(b,e,g){d.progress(a.getService("orion.git.provider").addRemote(b,e,g),"Adding remote "+b).then(function(){f.changedItem(c)},q)},g;g=c.Type==="Clone"?c.RemoteLocation:c.Location;b.parameters.valueFor("name")&&b.parameters.valueFor("url")&&e(g,b.parameters.valueFor("name"),b.parameters.valueFor("url"))},visibleWhen:function(a){return a.GroupNode&&a.Name==="Remotes"||a.Type==="Clone"&&f.parentId==="artifacts"}});c.addCommand(o);o=new i.Command({name:g.Delete,
tooltip:g["Delete the remote from the repository"],imageClass:"core-sprite-delete",id:"eclipse.removeRemote",callback:function(b){var c=b.items;confirm(e.formatMessage(g["Are you sure you want to delete remote ${0}?"],c.Name))&&a.getService("orion.page.progress").progress(a.getService("orion.git.provider").removeRemote(c.Location),"Removing remote "+c.Name).then(function(){f.changedItem(c.parent)},q)},visibleWhen:function(a){return a.Type==="Remote"}});c.addCommand(o);o=new i.Command({name:g.Pull,
tooltip:g["Pull from the repository"],imageClass:"git-sprite-pull",spriteClass:"gitCommandSprite",id:"eclipse.orion.git.pull",callback:function(b){var c=b.items,d=c.Location,e=c.Name;p.getDefaultSshOptions(a).then(function(b){var h=arguments.callee,i=a.getService("orion.git.provider"),j=a.getService("orion.page.message"),i=a.getService("orion.page.progress").progress(i.doPull(d,!1,b.gitSshUsername,b.gitSshPassword,b.knownHosts,b.gitPrivateKey,b.gitPassphrase),g["Pulling: "]+e);j.createProgressMonitor(i,
g["Pulling: "]+e);var k;i.then(function(d){p.handleProgressServiceResponse(d,b,a,function(){c.Type==="Clone"&&f.changedItem(c)},h,"Pull Git Repository")},function(d){if(k)d.failedOperation=k;p.handleProgressServiceResponse(d,b,a,function(){f.changedItem(c)},h,g["Pull Git Repository"])},function(a){k=a.Location})})},visibleWhen:function(a){return a.Type==="Clone"}});c.addCommand(o);o=new i.Command({name:g["Git Log"],tooltip:g["Open the log for the branch"],id:"eclipse.openGitLog",hrefCallback:function(a){return k.toUrl(G.expand({resource:a.items.CommitLocation}))},
visibleWhen:function(a){return a.Type==="Branch"||a.Type==="RemoteTrackingBranch"}});c.addCommand(o);o=new i.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(G.expand({resource:a.items.CommitLocation}))},visibleWhen:function(a){return!a.CommitLocation||!a.StatusLocation?!1:!0}});c.addCommand(o);o=new i.Command({name:g["Git Status"],tooltip:g["Open the status for the repository"],
id:"eclipse.openGitStatus",hrefCallback:function(a){return x(a.items.StatusLocation)},visibleWhen:function(a){return!a.StatusLocation?!1:!0}});c.addCommand(o);o=new i.Command({name:g.ShowInEditor,tooltip:g.ShowInEditorTooltip,id:"eclipse.openCloneContent",hrefCallback:function(a){return k.toUrl(J.expand({resource:a.items.ContentLocation}))},visibleWhen:function(a){return!a.ContentLocation?!1:!0}});c.addCommand(o);o=new i.Command({name:g["Compare With Each Other"],id:"eclipse.compareGitCommits",hrefCallback:function(b){b=
b.items;return a.getService("orion.page.progress").progress(a.getService("orion.git.provider").getDiff(b[1].DiffLocation,b[0].Name),"Generating Diff for "+b[0].Name+" and "+b[1].Name).then(function(a){return h.generateCompareHref(a.Location,{readonly:!0})})},visibleWhen:function(a){return f.isDirectory?!1:Array.isArray(a)&&a.length===2&&a[0].Type==="Commit"&&a[1].Type==="Commit"?!0:!1}});c.addCommand(o);o=new i.Command({name:g["Compare With Working Tree"],imageClass:"git-sprite-compare",spriteClass:"gitCommandSprite",
id:"eclipse.compareWithWorkingTree",hrefCallback:function(a){return h.generateCompareHref(a.items.DiffLocation,{})},visibleWhen:function(a){return a.Type==="Commit"&&a.ContentLocation!==null&&!f.isDirectory}});c.addCommand(o);o=new i.Command({name:g.Open,id:"eclipse.openGitCommit",imageClass:"git-sprite-open",spriteClass:"gitCommandSprite",hrefCallback:function(a){return k.toUrl(J.expand({resource:a.items.ContentLocation}))},visibleWhen:function(a){return a.Type==="Commit"&&a.ContentLocation!=null&&
!f.isDirectory}});c.addCommand(o);o=new i.Command({name:g.Fetch,tooltip:g["Fetch from the remote"],imageClass:"git-sprite-fetch",spriteClass:"gitCommandSprite",id:"eclipse.orion.git.fetch",callback:function(e){var h=e.items,i=h.Location,j=h.Name,k=function(e,f){e.JsonData.HostKey?(f.parameters=null,f.errorData=e.JsonData,f.errorData.failedOperation=e.failedOperation,c.collectParameters(f)):f.optionsRequested?(f.errorData=e.JsonData,f.errorData.failedOperation=e.failedOperation,c.collectParameters(f)):
(new d(a)).isEnabled().then(function(a){f.parameters=a?e.JsonData.User?new b.ParametersDescription([new b.CommandParameter("sshpassword","password",g["SSH Password:"]),new b.CommandParameter("saveCredentials","boolean",g["Don't prompt me again:"])],{hasOptionalParameters:!0}):new b.ParametersDescription([new b.CommandParameter("sshuser","text",g["SSH User Name:"]),new b.CommandParameter("sshpassword","password",g["SSH Password:"]),new b.CommandParameter("saveCredentials","boolean",g["Don't prompt me again:"])],
{hasOptionalParameters:!0}):e.JsonData.User?new b.ParametersDescription([new b.CommandParameter("sshpassword","password",g["SSH Password:"])],{hasOptionalParameters:!0}):new b.ParametersDescription([new b.CommandParameter("sshuser","text",g["SSH User Name:"]),new b.CommandParameter("sshpassword","password",g["SSH Password:"])],{hasOptionalParameters:!0});f.errorData=e.JsonData;f.errorData.failedOperation=e.failedOperation;c.collectParameters(f)})},l=function(){e.parameters&&e.parameters.optionsRequested?
(e.parameters=null,e.optionsRequested=!0,c.collectParameters(e)):(e.errorData&&e.errorData.failedOperation&&a.getService("orion.page.progress").removeOperation(e.errorData.failedOperation),p.gatherSshCredentials(a,e).then(function(b){var c=a.getService("orion.git.provider"),d=a.getService("orion.page.message"),b=a.getService("orion.page.progress").progress(c.doFetch(i,!1,b.gitSshUsername,b.gitSshPassword,b.knownHosts,b.gitPrivateKey,b.gitPassphrase),g["Fetching remote: "]+j);d.createProgressMonitor(b,
g["Fetching remote: "]+j);b.then(function(b){p.handleGitServiceResponse(b,a,function(){f.changedItem(h)},function(a){k(a,e)})},function(b){p.handleGitServiceResponse(b,a,function(){f.changedItem(h)},function(a){k(a,e)})})}))};if(e.items.GitUrl)l();else{var n=a.getService("orion.git.provider"),m=a.getService("orion.page.progress");m.progress(n.getGitRemote(i),"Getting remote details "+j).then(function(a){m.progress(n.getGitClone(a.CloneLocation),"Getting git repository information "+a.Name).then(function(a){e.items.GitUrl=
a.Children[0].GitUrl;l()},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}});c.addCommand(o);o=new i.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(e){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 h=e.items,i=h.Location,j=h.Name,k=function(e,f){e.JsonData.HostKey?(f.parameters=null,f.errorData=e.JsonData,f.errorData.failedOperation=e.failedOperation,c.collectParameters(f)):f.optionsRequested?(f.errorData=e.JsonData,c.collectParameters(f)):(new d(a)).isEnabled().then(function(a){f.parameters=a?e.JsonData.User?new b.ParametersDescription([new b.CommandParameter("sshpassword","password",g["SSH Password:"]),new b.CommandParameter("saveCredentials","boolean",g["Don't prompt me again:"])],
{hasOptionalParameters:!0}):new b.ParametersDescription([new b.CommandParameter("sshuser","text",g["SSH User Name:"]),new b.CommandParameter("sshpassword","password",g["SSH Password:"]),new b.CommandParameter("saveCredentials","boolean",g["Don't prompt me again:"])],{hasOptionalParameters:!0}):e.JsonData.User?new b.ParametersDescription([new b.CommandParameter("sshpassword","password",g["SSH Password:"])],{hasOptionalParameters:!0}):new b.ParametersDescription([new b.CommandParameter("sshuser","text",
g["SSH User Name:"]),new b.CommandParameter("sshpassword","password",g["SSH Password:"])],{hasOptionalParameters:!0});f.errorData=e.JsonData;f.errorData.failedOperation=e.failedOperation;c.collectParameters(f)})},l=function(){e.parameters&&e.parameters.optionsRequested?(e.parameters=null,e.optionsRequested=!0,c.collectParameters(e)):(e.errorData&&e.errorData.failedOperation&&a.getService("orion.page.progress").removeOperation(e.errorData.failedOperation),p.gatherSshCredentials(a,e).then(function(b){var c=
a.getService("orion.git.provider"),d=a.getService("orion.page.progress"),l=a.getService("orion.page.message"),b=d.progress(c.doFetch(i,!0,b.gitSshUsername,b.gitSshPassword,b.knownHosts,b.gitPrivateKey,b.gitPassphrase),g["Fetching remote: "]+j);l.createProgressMonitor(b,g["Fetching remote: "]+j);b.then(function(b){p.handleGitServiceResponse(b,a,function(){f.changedItem(h)},function(a){k(a,e)})},function(b){p.handleGitServiceResponse(b,a,function(){f.changedItem(h)},function(a){k(a,e)})})}))};if(e.items.GitUrl)l();
else{var n=a.getService("orion.git.provider");n.getGitRemote(i).then(function(a){n.getGitClone(a.CloneLocation).then(function(a){e.items.GitUrl=a.Children[0].GitUrl;l()})})}}},visibleWhen:function(a){return a.Type==="RemoteTrackingBranch"?!0:a.Type==="Remote"?!0:a.Type==="Commit"&&a.toRef&&a.toRef.Type==="RemoteTrackingBranch"?!0:!1}});c.addCommand(o);o=new i.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(b){var c=b.items,b=a.getService("orion.git.provider"),d=a.getService("orion.page.progress"),h=a.getService("orion.page.message");d.progress(b.doMerge(c.HeadLocation,c.Name,!1),"Merging "+c.Name).then(function(a){var b={};if(a.Result==="FAST_FORWARD"||a.Result==="ALREADY_UP_TO_DATE")b.Severity="Ok",b.HTML=!1,b.Message=a.Result;else if(a.Result){var d=c.HeadLocation.replace("commit/HEAD","status");b.Severity="Warning";b.HTML=!0;b.Message="<span>"+a.Result;
if(a.FailingPaths){var i="",j=!0,k;for(k in a.FailingPaths)j||(i+=", "),j=!1,i+=k;if(!j)b.Severity="Error",b.Message+=". "+e.formatMessage(g["Failing paths: ${0}"],i)}b.Message+=e.formatMessage(g[". Go to ${0}."],'<a href="'+x(d)+'">'+g["Git Status page"]+"</a>")+"</span>"}else if(a.error)d=c.HeadLocation.replace("commit/HEAD","status"),b.Severity="Error",a.error.responseText&&JSON.parse(a.error.responseText)?(a=JSON.parse(a.error.responseText),b.Message=a.DetailedMessage?a.DetailedMessage:a.Message):
b.Message=a.error.message,b.HTML=!0,b.Message="<span>"+b.Message+e.formatMessage(g[". Go to ${0}."],'<a href="'+x(d)+'">'+g["Git Status page"]+"</a>")+"</span>";h.setProgressResult(b);f.changedItem(c)},function(b,d){var h=[],i=c.HeadLocation.replace("commit/HEAD","status");h.Severity="Error";h.HTML=!0;h.Message="<span>"+JSON.stringify(d.xhr.responseText).DetailedMessage+e.formatMessage(g[". Go to ${0}."],'<a href="'+x(i)+'">'+g["Git Status page"]+"</a>")+".</span>";a.getService("orion.page.message").setProgressResult(h);
f.changedItem(c)})},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}});c.addCommand(o);o=new i.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(b){var c=b.items,b=a.getService("orion.git.provider"),d=a.getService("orion.page.progress"),
h=a.getService("orion.page.message");d.progress(b.doMerge(c.HeadLocation,c.Name,!0),"Merging "+c.Name).then(function(a){var b=[];if(a.Result==="FAST_FORWARD_SQUASHED"||a.Result==="ALREADY_UP_TO_DATE")b.Severity="Ok",b.HTML=!1,b.Message=a.Result;else if(a.Result){var d=c.HeadLocation.replace("commit/HEAD","status");b.Severity="Warning";b.HTML=!0;b.Message="<span>"+a.Result+e.formatMessage(g[". Go to ${0}."],'<a href="'+x(d)+'">'+g["Git Status page"]+"</a>")+"</span>"}else if(a.error)d=c.HeadLocation.replace("commit/HEAD",
"status"),b.Severity="Error",a.error.responseText&&JSON.parse(a.error.responseText)?(a=JSON.parse(a.error.responseText),b.Message=a.DetailedMessage?a.DetailedMessage:a.Message):b.Message=a.error.message,b.HTML=!0,b.Message="<span>"+b.Message+e.formatMessage(g[". Go to ${0}."],'<a href="'+x(d)+'">'+g["Git Status page"]+"</a>")+"</span>";h.setProgressResult(b);f.changedItem(c)},function(b,d){var h=[],i=c.HeadLocation.replace("commit/HEAD","status");h.Severity="Error";h.HTML=!0;h.Message="<span>"+JSON.stringify(d.xhr.responseText).DetailedMessage+
e.formatMessage(g[". Go to ${0}."],'<a href="'+x(i)+'">'+g["Git Status page"]+"</a>")+".</span>";a.getService("orion.page.message").setProgressResult(h);f.changedItem(c)})},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}});c.addCommand(o);o=new i.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(b){var c=b.items,b=a.getService("orion.page.message"),d=a.getService("orion.page.progress").progress(a.getService("orion.git.provider").doRebase(c.HeadLocation,c.Name,"BEGIN"),c.Name?g["Rebase on top of "]+c.Name:g.Rebase);b.createProgressMonitor(d,c.Name?g["Rebase on top of "]+c.Name:g.Rebase);d.then(function(b){var d=[],h=c.HeadLocation.replace("commit/HEAD",
"status");b.Result==="OK"||b.Result==="FAST_FORWARD"||b.Result==="UP_TO_DATE"?(d.Severity="Ok",d.HTML=!1,d.Message=b.Result):b.Result==="STOPPED"?(d.Severity="Warning",d.HTML=!0,d.Message="<span>"+b.Result+g[". Some conflicts occurred. Please resolve them and continue, skip patch or abort rebasing"]+e.formatMessage(g[". Go to ${0}."],'<a href="'+x(h)+'">'+g["Git Status page"]+"</a>")+".</span>"):b.Result==="FAILED_WRONG_REPOSITORY_STATE"?(d.Severity="Error",d.HTML=!0,d.Message="<span>"+b.Result+g[". Repository state is invalid (i.e. already during rebasing)"]+
e.formatMessage(". Go to ${0}.",'<a href="'+x(h)+'">'+g["Git Status page"]+"</a>")+".</span>"):b.Result==="FAILED_UNMERGED_PATHS"?(d.Severity="Error",d.HTML=!0,d.Message="<span>"+b.Result+g[". Repository contains unmerged paths"]+e.formatMessage(g[". Go to ${0}."],'<a href="'+x(h)+'">'+g["Git Status page"]+"</a>")+".</span>"):b.Result==="FAILED_PENDING_CHANGES"?(d.Severity="Error",d.HTML=!0,d.Message="<span>"+b.Result+g[". Repository contains pending changes. Please commit or stash them"]+e.formatMessage(g[". Go to ${0}."],
'<a href="'+x(h)+'">Git Status page</a>')+".</span>"):(d.Severity="Warning",d.HTML=!0,d.Message="<span>"+b.Result+e.formatMessage(g[". Go to ${0}."],'<a href="'+x(h)+'">'+g["Git Status page"]+"</a>")+".</span>");a.getService("orion.page.message").setProgressResult(d);f.changedItem(c)},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}});c.addCommand(o);o=new i.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(e){var h=e.targetBranch,i,k=e.items;if(k.toRef)k=k.toRef;k.CloneLocation.split("/");var m=function(e,f){e.JsonData.HostKey?(f.parameters=null,f.errorData=e.JsonData,f.errorData.failedOperation=
e.failedOperation,c.collectParameters(f)):f.optionsRequested?(f.errorData=e.JsonData,f.errorData.failedOperation=e.failedOperation,c.collectParameters(f)):(new d(a)).isEnabled().then(function(a){f.parameters=a?e.JsonData.User?new b.ParametersDescription([new b.CommandParameter("sshpassword","password",g["SSH Password:"]),new b.CommandParameter("saveCredentials","boolean",g["Don't prompt me again:"])],{hasOptionalParameters:!0}):new b.ParametersDescription([new b.CommandParameter("sshuser","text",
g["SSH User Name:"]),new b.CommandParameter("sshpassword","password",g["SSH Password:"]),new b.CommandParameter("saveCredentials","boolean",g["Don't prompt me again:"])],{hasOptionalParameters:!0}):e.JsonData.User?new b.ParametersDescription([new b.CommandParameter("sshpassword","password",g["SSH Password:"])],{hasOptionalParameters:!0}):new b.ParametersDescription([new b.CommandParameter("sshuser","text",g["SSH User Name:"]),new b.CommandParameter("sshpassword","password",g["SSH Password:"])],{hasOptionalParameters:!0});
f.errorData=e.JsonData;f.errorData.failedOperation=e.failedOperation;c.collectParameters(f)})};if(e.parameters&&e.parameters.optionsRequested)e.parameters=null,e.optionsRequested=!0,c.collectParameters(e);else{var q=a.getService("orion.git.provider"),o=a.getService("orion.page.progress");e.errorData&&e.errorData.failedOperation&&o.removeOperation(e.errorData.failedOperation);var v=function(b,c,d,h,i){var j=a.getService("orion.page.message"),b=o.progress(q.doPush(c,d,!0,i,b.gitSshUsername,b.gitSshPassword,
b.knownHosts,b.gitPrivateKey,b.gitPassphrase),g["Pushing remote: "]+h);j.createProgressMonitor(b,g["Pushing remote: "]+h);b.then(function(b){p.handleGitServiceResponse(b,a,function(){f.changedItem()},function(a){m(a,e)})},function(b){p.handleGitServiceResponse(b,a,function(){f.changedItem()},function(a){m(a,e)})})};o.progress(q.getGitClone(k.CloneLocation),"Getting git repository details "+k.Name).then(function(b){var c=b.Children[0].RemoteLocation,d=b.Children[0].ConfigLocation,f=function(b){p.handleProgressServiceResponse(b,
{},a)};p.gatherSshCredentials(a,e).then(function(b){var m=new j;if(k.RemoteLocation.length===1&&k.RemoteLocation[0].Children.length===1)m=o.progress(q.getGitRemote(c),"Getting git remote details "+k.Name);else{var p={};p.Children=k.RemoteLocation;m.resolve(p)}m.then(function(c){h?v(b,h.Location,"HEAD",h.Name,!1):(c=new n.RemotePrompterDialog({title:g["Choose Branch"],serviceRegistry:a,gitClient:q,treeRoot:{Children:c.Children},hideNewBranch:!1,func:function(a,c,g){i=a===null?g:a;var h="branch."+k.Name+
".remote";o.progress(q.addCloneConfigurationProperty(d,h,i.parent.Name),"Adding git configuration property "+k.Name).then(function(){e.targetBranch=i;v(b,i.Location,"HEAD",i.Name,!1)},function(a){a.status===409?q.getGitCloneConfig(d).then(function(a){if(a.Children)for(var c=0;c<a.Children.length;c++)if(a.Children[c].Key===h){o.progress(q.editCloneConfigurationProperty(a.Children[c].Location,i.parent.Name),"Updating configuration property "+i.parent.Name).then(function(){e.targetBranch=i;v(b,i.Location,
"HEAD",i.Name,!1)},f);break}},f):f(a)})}}),k.RemoteLocation.length===1&&k.RemoteLocation[0].Children.length===1&&(c=new l.ConfirmPushDialog({title:g["Choose Branch"],serviceRegistry:a,gitClient:q,dialog:c,location:k.RemoteLocation[0].Children[0].Name,func:function(){e.targetBranch=k.RemoteLocation[0].Children[0];v(b,k.RemoteLocation[0].Children[0].Location,"HEAD",k.Name,!1)}})),c.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}});c.addCommand(o);o=new i.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(e){var h=e.confirmedWarnings,i=e.targetBranch;if(!h)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?"]))h=e.confirmedWarnings=!0;else return;var k,m=e.items;if(m.toRef)m=m.toRef;var q=m.CloneLocation.split("/"),o=function(e,f){e.JsonData.HostKey?(f.parameters=null,f.errorData=e.JsonData,c.collectParameters(f)):f.optionsRequested?(f.errorData=e.JsonData,c.collectParameters(f)):(new d(a)).isEnabled().then(function(a){f.parameters=a?e.JsonData.User?new b.ParametersDescription([new b.CommandParameter("sshpassword","password",g["SSH Password:"]),new b.CommandParameter("saveCredentials",
"boolean",g["Don't prompt me again:"])],{hasOptionalParameters:!0}):new b.ParametersDescription([new b.CommandParameter("sshuser","text",g["SSH User Name:"]),new b.CommandParameter("sshpassword","password",g["SSH Password:"]),new b.CommandParameter("saveCredentials","boolean",g["Don't prompt me again:"])],{hasOptionalParameters:!0}):e.JsonData.User?new b.ParametersDescription([new b.CommandParameter("sshpassword","password",g["SSH Password:"])],{hasOptionalParameters:!0}):new b.ParametersDescription([new b.CommandParameter("sshuser",
"text",g["SSH User Name:"]),new b.CommandParameter("sshpassword","password",g["SSH Password:"])],{hasOptionalParameters:!0});f.errorData=e.JsonData;c.collectParameters(f)})};if(e.parameters&&e.parameters.optionsRequested)e.parameters=null,e.optionsRequested=!0,c.collectParameters(e);else{var v=a.getService("orion.git.provider"),r=a.getService("orion.page.progress"),s=function(b,c,d,h,i){var j=a.getService("orion.page.message"),b=r.progress(v.doPush(c,d,!0,i,b.gitSshUsername,b.gitSshPassword,b.knownHosts,
b.gitPrivateKey,b.gitPassphrase),g["Pushing remote: "]+h);j.createProgressMonitor(b,g["Pushing remote: "]+h);b.then(function(b){p.handleGitServiceResponse(b,a,function(){f.changedItem()},function(a){o(a,e)})},function(b){p.handleGitServiceResponse(b,a,function(){f.changedItem(m)},function(a){o(a,e)})})};r.progress(v.getGitClone(m.CloneLocation),"Getting git repository details "+m.Name).then(function(b){var c=b.Children[0].RemoteLocation,d=b.Children[0].ConfigLocation;p.gatherSshCredentials(a,e).then(function(b){var f=
new j;if(m.RemoteLocation.length===1&&m.RemoteLocation[0].Children.length===1)f=r.progress(v.getGitRemote(c),"Getting remote details "+m.Name);else{var h={};h.Children=m.RemoteLocation;f.resolve(h)}f.then(function(c){i?s(b,i.Location,"HEAD",i.Name,!0):(c=new n.RemotePrompterDialog({title:g["Choose Branch"],serviceRegistry:a,gitClient:v,treeRoot:{Children:c.Children},hideNewBranch:!1,func:function(a,c,f){k=a===null?f:a;var g="/gitapi/config/branch."+m.Name+".remote/clone/file/"+q[4];r.progress(v.addCloneConfigurationProperty(d,
"branch."+m.Name+".remote",k.parent.Name),"Setting git configuration property "+m.Name).then(function(){e.targetBranch=k;s(b,k.Location,"HEAD",k.Name,!0)},function(a){a.status===409&&r.progres(v.editCloneConfigurationProperty(g,k.parent.Name),"Setting git configuration property "+k.parent.Name).then(function(){e.targetBranch=k;s(b,k.Location,"HEAD",k.Name,!0)})})}}),m.RemoteLocation.length===1&&m.RemoteLocation[0].Children.length===1&&(c=new l.ConfirmPushDialog({title:g["Choose Branch"],serviceRegistry:a,
gitClient:v,dialog:c,location:m.RemoteLocation[0].Children[0].Name,func:function(){e.targetBranch=m.RemoteLocation[0].Children[0];s(b,m.RemoteLocation[0].Children[0].Location,"HEAD",m.Location,!0)}})),c.show())})})})}},visibleWhen:function(a){if(a.toRef)return a.RepositoryPath===""&&a.toRef.Type==="Branch"&&a.toRef.Current&&a.toRef.RemoteLocation}});c.addCommand(o);o=new i.Command({name:g["< Previous Page"],tooltip:g["Show previous page of git log"],id:"eclipse.orion.git.previousLogPage",hrefCallback:function(a){return k.toUrl(y.expand({resource:a.items.PreviousLocation}))},
visibleWhen:function(a){return a.Type==="RemoteTrackingBranch"||a.toRef&&a.toRef.Type==="Branch"||a.RepositoryPath!==null?a.PreviousLocation!==void 0:!1}});c.addCommand(o);o=new i.Command({name:g["Next Page >"],tooltip:g["Show next page of git log"],id:"eclipse.orion.git.nextLogPage",hrefCallback:function(a){return k.toUrl(y.expand({resource:a.items.NextLocation}))},visibleWhen:function(a){return a.Type==="RemoteTrackingBranch"||a.toRef&&a.toRef.Type==="Branch"||a.RepositoryPath!==null?a.NextLocation!==
void 0:!1}});c.addCommand(o);o=new i.Command({name:g["< Previous Page"],tooltip:g["Show previous page of git tags"],id:"eclipse.orion.git.previousTagPage",hrefCallback:function(a){return k.toUrl(F.expand({resource:a.items.PreviousLocation}))},visibleWhen:function(a){return a.Type==="Tag"?a.PreviousLocation!==void 0:!1}});c.addCommand(o);o=new i.Command({name:g["Next Page >"],tooltip:g["Show next page of git tags"],id:"eclipse.orion.git.nextTagPage",hrefCallback:function(a){return k.toUrl(F.expand({resource:a.items.NextLocation}))},
visibleWhen:function(a){return a.Type==="Tag"?a.NextLocation!==void 0:!1}});c.addCommand(o);o=new i.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(b){var c=b.items;if(confirm(e.formatMessage(g.GitResetIndexConfirm,c.Name))){var b=a.getService("orion.git.provider"),d=a.getService("orion.page.message"),
b=a.getService("orion.page.progress").progress(b.resetIndex(c.IndexLocation,c.Name),"Resetting git index for "+c.Name);d.createProgressMonitor(b,g["Resetting index..."]);b.then(function(){f.changedItem(c);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"}});c.addCommand(o);o=new b.ParametersDescription([new b.CommandParameter("name",
"text",g["Name:"])]);o=new i.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(b){var c=b.items,d=function(b,d){a.getService("orion.page.progress").progress(a.getService("orion.git.provider").doAddTag(b,d),"Adding tag "+d).then(function(){f.changedItem(c)},q)},e=c.Location;b.parameters.valueFor("name")&&!b.parameters.optionsRequested&&d(e,b.parameters.valueFor("name"))},
visibleWhen:function(a){return a.Type==="Commit"}});c.addCommand(o);o=new i.Command({name:g.Delete,tooltip:g["Delete the tag from the repository"],imageClass:"core-sprite-delete",id:"eclipse.removeTag",callback:function(b){var c=b.items;confirm(e.formatMessage(g["Are you sure you want to delete tag ${0}?"],c.Name))&&a.getService("orion.page.progress").progress(a.getService("orion.git.provider").doRemoveTag(c.Location),"Removing tag "+c.Name).then(function(){f.changedItem(c.parent)},q)},visibleWhen:function(a){return a.Type===
"Tag"}});c.addCommand(o);o=new b.ParametersDescription([new b.CommandParameter("reviewer","text",g["Reviewer name"])],{hasOptionalParameters:!0});o=new i.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(b){var c=a.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=b.items,g=f.Location.replace(f.Name,"HEAD"),h=f.AuthorName,i=f.Name,j=f.Message;c.progress(a.getService("orion.git.provider").getGitClone(f.CloneLocation),"Getting repository details "+f.Name).then(function(b){window.location.href.split("#");var k=v.getOrionHome(),b=d(b.Children[0].GitUrl),k=k+"/git/reviewRequest.html#"+b+"_"+f.Name;c.progress(a.getService("orion.git.provider").sendCommitReviewRequest(i,g,e,k,h,j),"Sending review request for "+i).then(function(b){var c=
{Severity:"Ok",HTML:!1};c.Message=b.Result;a.getService("orion.page.message").setProgressResult(c)},q)})};if(b.parameters.valueFor("reviewer")&&!b.parameters.optionsRequested)e(b.parameters.valueFor("reviewer"));else{var f=b.items;c.progress(a.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"}});c.addCommand(o);o=new i.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(b){var c=b.items,b=a.getService("orion.page.progress"),d=a.getService("orion.git.provider"),f=c.Location.replace(c.Name,"HEAD");b.progress(d.doCherryPick(f,
c.Name),"Cherry picking "+c.Name).then(function(b){var d=[],f=c.Location.replace("commit/"+c.Name,"status");if(b.Result==="OK")d.Severity="Ok",b.HeadUpdated?(d.HTML=!1,d.Message=b.Result):(d.HTML=!0,d.Message="<span>"+g["Nothing changed."]+"</span>");else if(b.Result==="CONFLICTING")d.Severity="Warning",d.HTML=!0,f=e.formatMessage(g[". Go to ${0}."],'<a href="'+x(f)+'">'+g["Git Status page"]+"</a>")+"</span>",d.Message="<span>"+b.Result+g[". Some conflicts occurred"]+f;else if(b.Result==="FAILED"){d.Severity=
"Error";d.HTML=!0;d.Message="<span>"+b.Result;if(b.FailingPaths){var h="",i=!0,j;for(j in b.FailingPaths)i||(h+=", "),i=!1,h+=j;i||(d.Message+=". "+e.formatMessage(g["Failing paths: ${0}"],h))}d.Message+=e.formatMessage(g[". Go to ${0}."],'<a href="'+x(f)+'">'+g["Git Status page"]+"</a>")+"</span>"}else d.Severity="Warning",d.HTML=!1,d.Message=b.Result;a.getService("orion.page.message").setProgressResult(d)},q)},visibleWhen:function(a){return a.Type==="Commit"}});c.addCommand(o);o=new i.Command({name:g.Revert,
tooltip:g["Revert changes introduced by the commit into your active branch"],id:"eclipse.orion.git.revert",imageClass:"git-sprite-reset",spriteClass:"gitCommandSprite",callback:function(b){var c=b.items,b=a.getService("orion.page.progress"),d=a.getService("orion.git.provider"),f=c.Location.replace(c.Name,"HEAD");b.progress(d.doRevert(f,c.Name),"Reverting "+c.Name).then(function(b){var d=[],f=c.Location.replace("commit/"+c.Name,"status");b.Result==="OK"?(d.Severity="Ok",d.HTML=!1,d.Message=b.Result):
b.Result==="FAILURE"?(f=e.formatMessage(g[". Go to ${0}."],'<a href="'+x(f)+'">'+g["Git Status page"]+"</a>")+"</span>",d.Severity="Warning",d.HTML=!0,d.Message="<span>"+b.Result+g[". Could not revert into active branch"]+f):(d.Severity="Warning",d.HTML=!1,d.Message=b.Result);a.getService("orion.page.message").setProgressResult(d)},q)},visibleWhen:function(a){return a.Type==="Commit"}});c.addCommand(o)};p.createGitClonesCommands=function(c,f,h,l,n,m){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)}function v(a){Array.isArray(a)&&(a=a.length>1?{}:a[0]);return a}l=new b.ParametersDescription([new b.CommandParameter("key","text",g["Key:"]),new b.CommandParameter("value","text",g["Value:"])]);l=new i.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(){h.changedItem(b)},
q)}});f.addCommand(l);l=new b.ParametersDescription([new b.CommandParameter("value","text",g["Value:"])]);l=new i.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(){h.changedItem(b)},q)},visibleWhen:function(a){return a.Key&&a.Value&&a.Location}});f.addCommand(l);l=new i.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(){h.changedItem(b)},q)},visibleWhen:function(a){return a.Key&&a.Value&&a.Location}});f.addCommand(l);l=new b.ParametersDescription([new b.CommandParameter("url","url",g["Repository URL:"])],{hasOptionalParameters:!0});n=new i.Command({name:g["Clone Repository"],tooltip:g["Clone an existing Git repository to a folder"],id:"eclipse.createGitProject",callback:function(b){var d=b.items,e=c.getService("orion.git.provider"),f=c.getService("orion.page.progress"),
i=function(b,i,j){p.getDefaultSshOptions(c).then(function(l){var n=arguments.callee,q=new a(c);c.getService("orion.page.message").setProgressMessage("Your project is being set up. This may take a minute...");q.getConfig().then(function(a){f.progress(e.cloneGitRepository(j,b,i,h.defaultPath,l.gitSshUsername,l.gitSshPassword,l.knownHosts,l.gitPrivateKey,l.gitPassphrase,a,!0),"Cloning repository "+j).then(function(a){p.handleProgressServiceResponse(a,l,c,function(a){e.getGitClone(a.Location).then(function(a){var b=
"",c;for(c in d.projectDescription)b+=c+"="+d.projectDescription[c]+"\n";m.write(a.Children[0].ContentLocation+".git/.projectInfo",b).then(function(){var b=k.toUrl(J.expand({resource:a.Children[0].ContentLocation}));window.location=b})})},n,g["Clone Git Repository"])},function(a){p.handleProgressServiceResponse(a,l,c,function(){},n,g["Clone Git Repository"])})})})};d.url&&d.projectDescription.name&&(c.getService("orion.page.message").setProgressMessage("Looking for project "+d.projectDescription.name),
m.loadWorkspace().then(function(a){for(var b=0;b<a.Children.length;++b){var c=a.Children[b];if(c.Name===d.projectDescription.name){c.Git?e.getGitClone(c.Git.CloneLocation).then(function(a){a.Children[0].GitUrl===d.url?window.location=k.toUrl(J.expand({resource:a.Children[0].ContentLocation+"?depth=1"})):console.info("Folder project is used")}):console.info("Folder project is used");return}}i(d.url,null,d.projectDescription.name)}))},visibleWhen:function(){return!0}});f.addCommand(n);l=new i.Command({name:g["Clone Repository"],
tooltip:g["Clone an existing Git repository to a folder"],id:"eclipse.cloneGitRepository",parameters:l,callback:function(b){var d=c.getService("orion.git.provider"),e=c.getService("orion.page.progress"),f=function(b,f,i){p.getDefaultSshOptions(c).then(function(j){var k=arguments.callee;(new a(c)).getConfig().then(function(a){a=e.progress(d.cloneGitRepository(i,b,f,h.defaultPath,j.gitSshUsername,j.gitSshPassword,j.knownHosts,j.gitPrivateKey,j.gitPassphrase,a),"Cloning repository "+i);c.getService("orion.page.message").createProgressMonitor(a,
g["Cloning repository: "]+b);a.then(function(a){p.handleProgressServiceResponse(a,j,c,function(){h.changedItem&&h.changedItem()},k,g["Clone Git Repository"])},function(a){p.handleProgressServiceResponse(a,j,c,function(){},k,g["Clone Git Repository"])})})})};b.parameters.valueFor("url")&&!b.parameters.optionsRequested?f(b.parameters.valueFor("url")):(new o.CloneGitRepositoryDialog({serviceRegistry:c,fileClient:m,url:b.parameters.valueFor("url"),alwaysShowAdvanced:b.parameters.optionsRequested,func:f})).show()},
visibleWhen:function(){return!0}});f.addCommand(l);l=new i.Command({name:g["Clone Repository"],tooltip:g["Clone an existing Git repository to a folder"],id:"eclipse.cloneGitRepositoryReviewReq",callback:function(b){var d=c.getService("orion.git.provider"),e=c.getService("orion.page.progress");(new o.CloneGitRepositoryDialog({serviceRegistry:c,fileClient:m,url:b.userData,alwaysShowAdvanced:!1,func:function(b,f,i){p.getDefaultSshOptions(c).then(function(j){var k=arguments.callee;(new a(c)).getConfig().then(function(a){a=
e.progress(d.cloneGitRepository(i,b,f,h.defaultPath,j.gitSshUsername,j.gitSshPassword,j.knownHosts,j.gitPrivateKey,j.gitPassphrase,a),"Cloning git repository "+i);c.getService("orion.page.message").createProgressMonitor(a,g["Cloning repository: "]+b);a.then(function(a){p.handleProgressServiceResponse(a,j,c,function(){h.changedItem&&h.changedItem()},k,g["Clone Git Repository"])},function(a){p.handleProgressServiceResponse(a,j,c,function(){},k,g["Clone Git Repository"])})})})}})).show()},visibleWhen:function(){return!0}});
f.addCommand(l);l=new i.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(a){if(a.parameters&&a.parameters.valueFor("remoteName"))a.remoteName=a.parameters.valueFor("remoteName");var e=function(a,e){a.JsonData.HostKey?(e.parameters=null,e.errorData=a.JsonData,f.collectParameters(e)):e.optionsRequested?(e.errorData=a.JsonData,f.collectParameters(e)):
(new d(c)).isEnabled().then(function(c){e.parameters=c?a.JsonData.User?new b.ParametersDescription([new b.CommandParameter("sshpassword","password",g["SSH Password:"]),new b.CommandParameter("saveCredentials","boolean",g["Don't prompt me again:"])],{hasOptionalParameters:!0}):new b.ParametersDescription([new b.CommandParameter("sshuser","text",g["SSH User Name:"]),new b.CommandParameter("sshpassword","password",g["SSH Password:"]),new b.CommandParameter("saveCredentials","boolean",g["Don't prompt me again:"])],
{hasOptionalParameters:!0}):a.JsonData.User?new b.ParametersDescription([new b.CommandParameter("sshpassword","password",g["SSH Password:"])],{hasOptionalParameters:!0}):new b.ParametersDescription([new b.CommandParameter("sshuser","text",g["SSH User Name:"]),new b.CommandParameter("sshpassword","password",g["SSH Password:"])],{hasOptionalParameters:!0});e.errorData=a.JsonData;f.collectParameters(e)})};if(a.parameters&&a.parameters.optionsRequested)a.parameters=null,a.optionsRequested=!0,f.collectParameters(a);
else{var i=function(b,d,f){var i=c.getService("orion.page.progress");i.progress(c.getService("orion.git.provider").addRemote(b,d,a.userData),"Adding git remote "+d).then(function(){p.gatherSshCredentials(c,a).then(function(b){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 n=c.getService("orion.git.provider"),j=c.getService("orion.page.message"),l=i.progress(n.doFetch(k.Location,
!1,b.gitSshUsername,b.gitSshPassword,b.knownHosts,b.gitPrivateKey,b.gitPassphrase),"Fetching remote "+d);j.createProgressMonitor(l,g["Fetching remote: "]+k.Location);l.then(function(b){p.handleGitServiceResponse(b,c,function(){i.progress(n.getGitRemote(k.Location),"Getting remote details "+d).then(function(){h.changedItem(f)},q)},function(b){e(b,a)})},function(b){p.handleGitServiceResponse(b,c,function(){h.changedItem(f)},function(b){e(b,a)})})})})},q)};a.remoteName?i(a.items.RemoteLocation,a.remoteName,
a.items):(a.parameters=new b.ParametersDescription([new b.CommandParameter("remoteName","text",g["Remote Name:"])],{hasOptionalParameters:!1}),f.collectParameters(a))}},visibleWhen:function(){return!0}});f.addCommand(l);l=new b.ParametersDescription([new b.CommandParameter("folderName","text",g["New folder:"])],{hasOptionalParameters:!0});l=new i.Command({name:g["Init Repository"],tooltip:g["Create a new Git repository in a new folder"],id:"eclipse.initGitRepository",parameters:l,callback:function(b){var d=
c.getService("orion.git.provider"),e=c.getService("orion.page.progress"),f=function(b,f,i){p.getDefaultSshOptions(c).then(function(j){var k=arguments.callee;(new a(c)).getConfig().then(function(a){a=e.progress(d.cloneGitRepository(i,b,f,h.defaultPath,null,null,null,null,null,a),g["Initializing repository: "]+i);c.getService("orion.page.message").createProgressMonitor(a,g["Initializing repository: "]+i);a.then(function(a){p.handleProgressServiceResponse(a,j,c,function(){h.changedItem&&h.changedItem()},
k,g["Init Git Repository"])},function(a){p.handleProgressServiceResponse(a,j,c,function(){},k,g["Init Git Repository"])})})})};b.parameters.valueFor("folderName")&&!b.parameters.optionsRequested?f(null,null,b.parameters.valueFor("folderName")):(new o.CloneGitRepositoryDialog({serviceRegistry:c,title:g["Init Git Repository"],fileClient:m,advancedOnly:!0,func:f})).show()},visibleWhen:function(){return!0}});f.addCommand(l);l=new i.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,i=0;i<b.length;i++)d.progress(a.removeGitRepository(b[i].Location),"Removing repository "+b.Name).then(function(){f++;f>=b.length&&h.changedItem&&h.changedItem()},q)}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(){if(h.changedItem)window.location=k.toUrl(F.expand({}))},q)}});f.addCommand(l);l=new i.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=v(a.items),b=new j;(new u.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 b.ParametersDescription([new b.CommandParameter("commitName","text",g["Commit name:"])],{hasOptionalParameters:!0});l=new i.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 s.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(z.expand({resource:a})),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.items.Type==="Clone"){var f=
[a.items];e(f)}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)}):(f=a.items,e(f))},visibleWhen:function(a){return a.Type==="Clone"||a.CloneLocation||a.length>1&&a[0].Type==="Clone"}});f.addCommand(l)};p.createGitStatusCommands=function(a,c,d){function e(b){var c={Severity:"Error",HTML:!1};try{var d=JSON.parse(b.responseText);c.Message=d.DetailedMessage?d.DetailedMessage:d.Message?
d.Message:g["Problem while performing the action"]}catch(f){c.Message=g["Problem while performing the action"]}a.getService("orion.page.message").setProgressResult(c)}function h(a){Array.isArray(a)||(a=[a]);return a}function j(b,c){var f=a.getService("orion.page.message"),h=a.getService("orion.page.progress").progress(a.getService("orion.git.provider").doRebase(b,"",c),"Rebasing git repository");f.createProgressMonitor(h,c);h.then(function(b){if(b.Result==="OK"||b.Result==="ABORTED"||b.Result==="FAST_FORWARD"||
b.Result==="UP_TO_DATE"){var c=[];c.Severity="Ok";c.HTML=!1;c.Message=b.Result;a.getService("orion.page.message").setProgressResult(c);d.changedItem({})}if(b.Result==="STOPPED")c=[],c.Severity="Warning",c.HTML=!1,c.Message=b.Result+g[". Repository still contains conflicts."],a.getService("orion.page.message").setProgressResult(c),d.changedItem({});else if(b.Result==="FAILED_UNMERGED_PATHS")c=[],c.Severity="Error",c.HTML=!1,c.Message=b.Result+g[". Repository contains unmerged paths. Resolve conflicts first."],
a.getService("orion.page.message").setProgressResult(c)},e)}var k=new i.Command({name:g.Stage,tooltip:g["Stage the change"],imageClass:"git-sprite-stage",spriteClass:"gitCommandSprite",id:"eclipse.orion.git.stageCommand",callback:function(b){var c=h(b.items),f=a.getService("orion.page.message"),i=a.getService("orion.page.progress");if(c.length===1)b=i.progress(a.getService("orion.git.provider").stage(c[0].indexURI),g["Staging changes"]),f.createProgressMonitor(b,g["Staging changes"]);else{for(var j=
[],k=0;k<c.length;k++)j[k]=c[k].name;b=i.progress(a.getService("orion.git.provider").stageMultipleFiles(b.userData.Clone.IndexLocation,j),g["Staging changes"]);f.createProgressMonitor(b,"Staging changes")}b.then(function(){d.changedItem(c)},e)},visibleWhen:function(a){a=h(a);if(a.length===0)return!1;for(var b=0;b<a.length;b++)if(!f.isChange(a[b])||f.isStaged(a[b]))return!1;return!0}});c.addCommand(k);k=new i.Command({name:g.Unstage,tooltip:g["Unstage the change"],imageClass:"git-sprite-unstage",spriteClass:"gitCommandSprite",
id:"eclipse.orion.git.unstageCommand",callback:function(b){var c=h(b.items),f=a.getService("orion.page.message"),i=a.getService("orion.page.progress");if(c.length===1)b=i.progress(a.getService("orion.git.provider").unstage(c[0].indexURI,c[0].name),"Unstaging changes");else{for(var j=[],k=0;k<c.length;k++)j[k]=c[k].name;b=i.progress(a.getService("orion.git.provider").unstage(b.userData.Clone.IndexLocation,j),"Unstaging changes")}f.createProgressMonitor(b,g["Staging changes"]);b.then(function(){d.changedItem(c)},
e)},visibleWhen:function(a){a=h(a);if(a.length===0)return!1;for(var b=0;b<a.length;b++)if(!f.isChange(a[b])||!f.isStaged(a[b]))return!1;return!0}});c.addCommand(k);k=new b.ParametersDescription([new b.CommandParameter("name","text",g["Commit message:"],"",4),new b.CommandParameter("amend","boolean",g["Amend:"],!1)],{hasOptionalParameters:!0});k=new i.Command({name:g.Commit,tooltip:g.Commit,id:"eclipse.orion.git.commitCommand",parameters:k,callback:function(b){var c=b.items.status,f=function(b){var f=
a.getService("orion.page.message"),b=a.getService("orion.page.progress").progress(a.getService("orion.git.provider").commitAll(c.Clone.HeadLocation,null,JSON.stringify(b)),g["Committing changes"]);f.createProgressMonitor(b,g["Committing changes"]);b.then(function(){d.changedItem(c)},e)},h=function(a,c){for(var d=0;d<c.length;d++)if(c[d].Key==="user.name")a.CommitterName=c[d].Value,a.AuthorName=c[d].Value;else if(c[d].Key==="user.email")a.CommitterEmail=c[d].Value,a.AuthorEmail=c[d].Value;a.Message&&
a.CommitterName&&a.CommitterEmail&&!b.parameters.optionsRequested?f(a):(new r.CommitDialog({body:a,func:f})).show()},i={};i.Message=b.parameters.valueFor("name");i.Amend=b.parameters.valueFor("amend");var j=c.Clone.Config;if(i.Amend&&!i.Message){var k=a.getService("orion.page.message"),l=a.getService("orion.page.progress").progress(a.getService("orion.git.provider").doGitLog(c.CommitLocation+"?page=1&pageSize=1"),g["Committing changes"]);k.createProgressMonitor(l,g["Committing changes"]);l.then(function(a){i.Message=
a.Children[0].Message;h(i,j)},function(){h(i,j)})}else h(i,j)},visibleWhen:function(){return!0}});c.addCommand(k);k=new i.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(b){var c=b.items;a.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(b){if(b){var b=a.getService("orion.page.message"),f=a.getService("orion.page.progress").progress(a.getService("orion.git.provider").unstageAll(c.IndexLocation,"HARD"),g["Resetting local changes"]);b.createProgressMonitor(f,g["Resetting local changes"]);f.then(function(){d.changedItem(c)},e)}})},visibleWhen:function(a){return f.hasStagedChanges(a)||f.hasUnstagedChanges(a)}});c.addCommand(k);k=new i.Command({name:g.Checkout,tooltip:g["Checkout files, discarding all changes"],imageClass:"git-sprite-checkout",
spriteClass:"gitCommandSprite",id:"eclipse.orion.git.checkoutCommand",callback:function(b){var c=h(b.items);a.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(f){if(f){for(var f=a.getService("orion.page.message"),h=a.getService("orion.page.progress"),i=[],j=0;j<c.length;j++)i[j]=c[j].name;h=h.progress(a.getService("orion.git.provider").checkoutPath(b.userData.Clone.Location,
i),g["Resetting local changes"]);f.createProgressMonitor(h,g["Resetting local changes"]);h.then(function(){d.changedItem(c)},e)}})},visibleWhen:function(a){a=h(a);if(a.length===0)return!1;for(var b=0;b<a.length;b++)if(!f.isChange(a[b])||f.isStaged(a[b]))return!1;return!0}});c.addCommand(k);k=new i.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(f.isStaged(a[b]))return!1;return!0}});c.addCommand(k);k=new i.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}});c.addCommand(k);k=new i.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}});c.addCommand(k);k=new i.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}});c.addCommand(k)}})();return p});
define("orion/git/widgets/CommitTooltipDialog","i18n!git/nls/gitmessages,require,orion/URITemplate,orion/webui/littlelib,orion/i18nUtil,orion/webui/popupdialog".split(","),function(g,k,j,e,c,i){function b(b){this._init(b)}var f=new j("git/git-commit.html#{,resource,params*}?page=1&pageSize=1");b.prototype=new i.PopupDialog;b.prototype.TEMPLATE='<div id="parentPane" style="padding:10px; width:520px"></div>';b.prototype._init=function(b){this.commit=b.commit;this._initialize(b.triggerNode,null,null,
"mouseover",1E3)};b.prototype._bindToDom=function(){this._displayCommit(this.commit)};b.prototype._displayCommit=function(b){var d=this.$parentPane,a=b.Message.split(/(\r?\n|$)/)[0],e=document.createElement("a");e.className="navlinkonpage";e.href=k.toUrl(f.expand({resource:b.Location}));e.textContent=a;d.appendChild(e);a=document.createElement("div");a.style.paddingTop="15px";d.appendChild(a);if(b.AuthorImage)d=new Image,d.src=b.AuthorImage,d.name=b.AuthorName,d.className="git-author-icon",a.appendChild(d);
d=document.createElement("div");d.textContent=c.formatMessage(g[" authored by ${0} {${1}) on ${2}"],b.AuthorName,b.AuthorEmail,(new Date(b.Time)).toLocaleString());a.appendChild(d);d=document.createElement("div");d.textContent=c.formatMessage(g["committed by 0 (1)"],b.CommitterName,b.CommitterEmail);a.appendChild(d);d=document.createElement("div");d.style.paddingTop="15px";d.textContent=g["commit:"]+b.Name;a.appendChild(d);if(b.Parents&&b.Parents.length>0)d=document.createElement("div"),d.textContent=
g["parent:"],e=document.createElement("a"),e.className="navlinkonpage",e.href=k.toUrl(f.expand({resource:b.Parents[0].Location})),e.textContent=b.Parents[0].Name,d.appendChild(e),a.appendChild(d);e=b.Tags&&b.Tags.length>0;if(b.Branches&&b.Branches.length>0){d=document.createElement("section");d.style.paddingTop="15px";d.textContent=g["branches: "];a.appendChild(d);var i=document.createElement("div");d.appendChild(i);for(d=0;d<b.Branches.length;++d){var j=document.createElement("span");j.style.paddingLeft=
"10px";j.textContent=b.Branches[d].FullName;i.appendChild(j)}}if(e){d=document.createElement("div");d.style.paddingTop="15px";a.appendChild(d);d=document.createElement("section");a.appendChild(d);a=document.createElement("span");a.textContent=g["tags: "];d.appendChild(a);a=document.createElement("div");d.appendChild(a);for(d=0;d<b.Tags.length;++d)e=document.createElement("span"),e.style.paddingLeft="10px",e.textContent=b.Tags[d].Name,a.appendChild(e)}};b.prototype.constructor=b;return{CommitTooltipDialog:b}});
define("orion/git/gitStatusExplorer","require,i18n!git/nls/gitmessages,orion/explorers/explorer,orion/selection,orion/section,orion/URITemplate,orion/PageUtil,orion/webui/littlelib,orion/i18nUtil,orion/globalCommands,orion/git/util,orion/git/gitCommands,orion/Deferred,orion/git/widgets/CommitTooltipDialog,orion/webui/tooltip".split(","),function(g,k,j,e,c,i,b,f,h,d,a,l,n,m,o){var n={},t=new i("git/git-repository.html#{,resource,params*}"),s=new i("git/git-log.html#{,resource,params*}?page=1"),r=new i("git/git-commit.html#{,resource,params*}?page=1&pageSize=1"),
u=function(){function a(){this.selectedItem=this.selectedFileId=void 0;this.interestedUnstagedGroup=["Missing","Modified","Untracked","Conflicting"];this.interestedStagedGroup=["Added","Changed","Removed"];this.conflictPatterns=[["Both","Modified","Added","Changed","Missing"],["RemoteDelete","Untracked","Removed"],["LocalDelete","Modified","Added","Missing"]];this.conflictType="Conflicting";this.statusTypeMap={Missing:{imageClass:"gitImageSprite git-sprite-removal",tooltip:k["Unstaged removal"]},
Removed:{imageClass:"gitImageSprite git-sprite-removal",tooltip:k["Staged removal"]},Modified:{imageClass:"gitImageSprite git-sprite-file",tooltip:k["Unstaged change"]},Changed:{imageClass:"gitImageSprite git-sprite-file",tooltip:k["Staged change"]},Untracked:{imageClass:"gitImageSprite git-sprite-addition",tooltip:k["Unstaged addition"]},Added:{imageClass:"gitImageSprite git-sprite-addition",tooltip:k["Staged addition"]},Conflicting:{imageClass:"gitImageSprite git-sprite-conflict-file",tooltip:k.Conflicting}}}
a.prototype={destroy:function(){},interestedCategory:function(){},init:function(a){this.items=a},getModelType:function(a,b){return b},_markConflict:function(a){var b=this.getGroupData(a[1]);if(b)for(var c=0;c<b.length;c++)if(!b[c].Conflicting){for(var d=b[c].Location,e=[],f=2;f<a.length;f++){var g=this.getGroupData(a[f]);g&&(g=this._findSameFile(d,g))&&e.push(g)}if(e.length===a.length-2){b[c].Conflicting=a[0];for(d=0;d<e.length;d++)e[d].Conflicting="Hide"}}},_findSameFile:function(a,b){for(var c=
0;c<b.length;c++)if(!b[c].Conflicting&&a===b[c].Location)return b[c]},getGroupData:function(a){return this.items[a]},isStaged:function(a){for(var b=0;b<this.interestedStagedGroup.length;b++)if(a===this.interestedStagedGroup[b])return!0;return!1},getClass:function(a){return this.statusTypeMap[a].imageClass},getTooltip:function(a){return this.statusTypeMap[a].tooltip}};return a}();n.GitStatusExplorer=function(){function i(a,b,c,d,e,f,g,h){this.parentId=e;this.registry=a;this.commandService=b;this.linkService=
c;this.selection=d;this.parentId=e;this.toolbarId=f;this.selectionToolsId=g;this.checkbox=!1;this.actionScopeId=h;j.createExplorerCommands(b)}i.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.DetailedMessage||a.Message||a.message}this.registry.getService("orion.page.message").setProgressResult(b);a.status===404&&(this.initTitleBar(),this.displayCommit())};i.prototype.changedItem=
function(){this.redisplay()};i.prototype.redisplay=function(){this.display(b.matchResourceParameters().resource)};i.prototype.display=function(a){var b=this,c=this.registry.getService("orion.page.progress");c.progress(this.registry.getService("orion.git.provider").getGitStatus(a),k["Loading..."]).then(function(a){if(a.Type==="Status")b._model=new u,b._model.init(a),c.progress(b.registry.getService("orion.git.provider").getGitClone(a.CloneLocation),"Getting repository information").then(function(d){var e=
d.Children;c.progress(b.registry.getService("orion.git.provider").getGitCloneConfig(e[0].ConfigLocation),"Getting repository configuration ",e[0].Name).then(function(c){c=c.Children;a.Clone=e[0];a.Clone.Config=[];for(var d=0;d<c.length;d++)(c[d].Key==="user.name"||c[d].Key==="user.email")&&a.Clone.Config.push(c[d]);c=f.node("table");f.empty(c);b.initTitleBar(a,e[0]);b.displayUnstaged(a,e[0]);b.displayStaged(a,e[0]);b.displayCommits(e[0]);l.updateNavTools(b.registry,b.commandService,b,"pageActions",
"selectionTools",a)},function(a){b.handleError(a)})},function(a){b.handleError(a)})},function(a){b.handleError(a)})};i.prototype.initTitleBar=function(a,b){var c={};c.Name=k.Status+(a.RepositoryState&&a.RepositoryState.indexOf("REBASING")!==-1?k[" (Rebase in Progress)"]:"");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.Repo;d.setPageTarget({task:k.Status,target:b,breadcrumbTarget:c,
makeBreadcrumbLink:function(a,b){a.href=g.toUrl(t.expand({resource:b||""}))},serviceRegistry:this.registry,commandService:this.commandService})};i.prototype._sortBlock=function(a){for(var b=[],c=0;c<a.length;c++){var d=a[c],e=this._model.getGroupData(d);if(e)for(var f=0;f<e.length;f++){var g=this._model.getModelType(e[f],d);g&&b.push({name:e[f].Name,type:g,location:e[f].Location,path:e[f].Path,commitURI:e[f].Git.CommitLocation,indexURI:e[f].Git.IndexLocation,diffURI:e[f].Git.DiffLocation,CloneLocation:this._model.items.CloneLocation,
conflicting:g==="Conflicting"})}}b.sort(function(a,b){var c=a.name&&a.name.toLowerCase(),d=b.name&&b.name.toLowerCase();return c<d?-1:c>d?1:0});return b};i.prototype.displayUnstaged=function(b,d){var g=this,h=this._sortBlock(this._model.interestedUnstagedGroup),i=f.node("table"),l=new c.Section(i,{id:"unstagedSection",title:h.length>0?k.Unstaged:k["No Unstaged Changes"],content:'<div id="unstagedNode"></div>',canHide:!0,onExpandCollapse:function(a,b){g.commandService.destroy(b.selectionNode);a&&g.commandService.renderCommands(b.selectionNode.id,
b.selectionNode,null,g,"button",{Clone:d})}});this.commandService.registerCommandContribution(l.actionsNode.id,"orion.explorer.expandAll",200);this.commandService.registerCommandContribution(l.actionsNode.id,"orion.explorer.collapseAll",300);this.commandService.registerCommandContribution(l.selectionNode.id,"eclipse.orion.git.showPatchCommand",100);this.commandService.registerCommandContribution(l.selectionNode.id,"eclipse.orion.git.stageCommand",200);this.commandService.registerCommandContribution(l.selectionNode.id,
"eclipse.orion.git.checkoutCommand",300);if(!this.unstagedOnce){if(!this.unstagedSelection)this.unstagedSelection=new e.Selection(this.registry,"orion.unstagedSection.selection"),this.commandService.registerSelectionService(l.selectionNode.id,this.unstagedSelection);this.registry.getService("orion.unstagedSection.selection").addEventListener("selectionChanged",function(a){var b=f.node(l.selectionNode.id);b&&(g.commandService.destroy(b),g.commandService.renderCommands(l.selectionNode.id,b,a.selections,
g,"button",{Clone:d}))});this.unstagedOnce=!0}this.commandService.registerCommandContribution("DefaultActionWrapper","eclipse.orion.git.stageCommand",100);var n=function(){function b(){}b.prototype={destroy:function(){},getRoot:function(a){a(h)},getChildren:function(b,c){if(b instanceof Array&&b.length>0)c(b);else if(a.isChange(b)){if(!b.children)b.children=[],b.children.push({diffUri:b.diffURI,Type:"Diff",parent:b});c(b.children)}else c([])},getId:function(b){return b instanceof Array&&b.length>
0?"unstagedRoot":a.isChange(b)?"unstaged"+b.name:"unstaged"+b.diffUri}};return b}(),m=function(){function b(a,c){this._init(a);this.options=a;this.explorer=c;this.registry=a.registry}b.prototype=new j.SelectionRenderer;b.prototype.getCellElement=function(b,c,d){switch(b){case 0:if(a.isChange(c)){var b=document.createElement("td"),e=document.createElement("div");e.className="sectionTableItem";b.appendChild(e);this.getExpandImage(d,e);var d=this.explorer.getNavDict()?this.explorer.getNavDict().getGridNavHolder(c,
!0):null,f=document.createElement("span");f.id="unstaged"+c.name+"DiffActionWrapper";f.className="sectionExplorerActions";e.appendChild(f);g.commandService.destroy(f);g.commandService.renderCommands("DefaultActionWrapper",f,c,g,"tool",null,d);d=document.createElement("span");d.className=g._model.getClass(c.type);d.commandTooltip=new o.Tooltip({node:d,text:g._model.getTooltip(c.type),position:["above","below","right","left"]});e.appendChild(d);d=document.createElement("span");d.textContent=c.name;
e.appendChild(d)}else{b=document.createElement("td");b.colSpan=2;e=document.createElement("div");e.className="sectionTableItem";b.appendChild(e);f=document.createElement("div");f.className="sectionExplorerActions";f.id="unstaged"+c.parent.name+"CompareWidgetActionWrapper";e.appendChild(f);var h=document.createElement("div");h.id="diffArea_"+c.diffUri;h.style.height="420px";h.style.border="1px solid lightgray";h.style.overflow="hidden";e.appendChild(h);d=this.explorer.getNavDict()?this.explorer.getNavDict().getGridNavHolder(c,
!0):null;a.createCompareWidget(g.registry,g.commandService,c.diffUri,c.parent.type==="Conflicting",h,f.id,!0,{navGridHolder:d})}return b}};return b}(),i=new (function(){function b(a,c,d,e){this.registry=a;this.checkbox=!1;this.parentId=d;this.selection=c;this.actionScopeId=e;this.renderer=new m({registry:this.registry,cachePrefix:"UnstagedNavigator",checkbox:!1},this);this.createTree(this.parentId,new n,{setFocus:!0})}b.prototype=new j.Explorer;b.prototype.isRowSelectable=function(b){return a.isChange(b)};
b.prototype.getItemCount=function(){return h.length};return b}())(this.registry,this.unstagedSelection,"unstagedNode");this.commandService.renderCommands(l.actionsNode.id,l.actionsNode.id,i,i,"button")};i.prototype.displayStaged=function(b,d){var g=this,h=this._sortBlock(this._model.interestedStagedGroup),i=f.node("table"),l=new c.Section(i,{id:"stagedSection",title:h.length>0?k.Staged:k["No Staged Changes"],content:'<div id="stagedNode"></div>',slideout:!0,canHide:!0,onExpandCollapse:function(a,
b){g.commandService.destroy(b.selectionNode);a&&g.commandService.renderCommands(b.selectionNode.id,b.selectionNode,null,g,"button",{Clone:d})}});this.commandService.registerCommandContribution(l.actionsNode.id,"eclipse.orion.git.commitCommand",100);this.commandService.registerCommandContribution(l.actionsNode.id,"orion.explorer.expandAll",200);this.commandService.registerCommandContribution(l.actionsNode.id,"orion.explorer.collapseAll",300);this.commandService.registerCommandContribution(l.selectionNode.id,
"eclipse.orion.git.unstageCommand",100);if(!this.stagedOnce){if(!this.stagedSelection)this.stagedSelection=new e.Selection(this.registry,"orion.stagedSection.selection"),this.commandService.registerSelectionService(l.selectionNode.id,this.stagedSelection);this.registry.getService("orion.stagedSection.selection").addEventListener("selectionChanged",function(a){var b=f.node(l.selectionNode.id);b&&(g.commandService.destroy(b),g.commandService.renderCommands(l.selectionNode.id,b,a.selections,g,"button",
{Clone:d}))});this.stagedOnce=!0}this.commandService.registerCommandContribution("DefaultActionWrapper","eclipse.orion.git.unstageCommand",100);var n=function(){function b(){}b.prototype={destroy:function(){},getRoot:function(a){a(h)},getChildren:function(b,c){if(b instanceof Array&&b.length>0)c(b);else if(a.isChange(b)){if(!b.children)b.children=[],b.children.push({diffUri:b.diffURI,Type:"Diff",parent:b});c(b.children)}else c([])},getId:function(b){return b instanceof Array&&b.length>0?"stagedRoot":
a.isChange(b)?"staged"+b.name:"staged"+b.diffUri}};return b}(),m=function(){function b(a,c){this._init(a);this.options=a;this.explorer=c;this.registry=a.registry}b.prototype=new j.SelectionRenderer;b.prototype.getCellElement=function(b,c,d){switch(b){case 0:if(a.isChange(c)){var b=document.createElement("td"),e=document.createElement("div");e.className="sectionTableItem";b.appendChild(e);this.getExpandImage(d,e);var d=this.explorer.getNavDict()?this.explorer.getNavDict().getGridNavHolder(c,!0):null,
f=document.createElement("span");f.id="staged"+c.name+"DiffActionWrapper";f.className="sectionExplorerActions";e.appendChild(f);g.commandService.destroy(f);g.commandService.renderCommands("DefaultActionWrapper",f,c,g,"tool",null,d);d=document.createElement("span");d.className=g._model.getClass(c.type);d.commandTooltip=new o.Tooltip({node:d,text:g._model.getTooltip(c.type),position:["above","below","right","left"]});e.appendChild(d);d=document.createElement("span");d.textContent=c.name;e.appendChild(d)}else{b=
document.createElement("td");b.colSpan=2;e=document.createElement("div");e.className="sectionTableItem";b.appendChild(e);f=document.createElement("div");f.className="sectionExplorerActions";f.id="staged"+c.parent.name+"CompareWidgetActionWrapper";e.appendChild(f);var h=document.createElement("div");h.id="diffArea_"+c.diffUri;h.style.height="420px";h.style.border="1px solid lightgray";h.style.overflow="hidden";e.appendChild(h);d=this.explorer.getNavDict()?this.explorer.getNavDict().getGridNavHolder(c,
!0):null;a.createCompareWidget(g.registry,g.commandService,c.diffUri,c.parent.type==="Conflicting",h,f.id,!1,{navGridHolder:d})}return b}};return b}(),i=new (function(){function c(a,d,e,f){this.registry=a;this.checkbox=!1;this.parentId=e;this.status=b;this.selection=d;this.actionScopeId=f;this.renderer=new m({registry:this.registry,cachePrefix:"StagedNavigator",checkbox:!1},this);this.createTree(this.parentId,new n)}c.prototype=new j.Explorer;c.prototype.isRowSelectable=function(b){return a.isChange(b)};
c.prototype.getItemCount=function(){return h.length};return c}())(this.registry,this.stagedSelection,"stagedNode");this.commandService.renderCommands(l.actionsNode.id,l.actionsNode.id,i,i,"button")};i.prototype.displayCommits=function(a){var b=this,d=f.node("table"),e=new c.Section(d,{id:"commitSection",title:k.Commits,content:'<div id="commitNode" class="mainPadding"></div>',slideout:!0,canHide:!0,preferenceService:this.registry.getService("orion.core.preference")}),g=e.createProgressMonitor();g.begin(k["Getting current branch"]);
this.registry.getService("orion.page.progress").progress(this.registry.getService("orion.git.provider").getGitBranch(a.BranchLocation),"Getting current branch "+a.Name).then(function(a){for(var a=a.Children,c,d=0;d<a.length;d++)if(a[d].Current){c=a[d];break}c?(a=c.RemoteLocation.length===1&&c.RemoteLocation[0].Children.length===1,e.setTitle(h.formatMessage(k['Commits for "${0}" branch'],c.Name)),b.commandService.destroy(e.actionsNode.id),b.commandService.registerCommandContribution(e.actionsNode.id,
"eclipse.orion.git.repositories.viewAllCommand",10),b.commandService.renderCommands(e.actionsNode.id,e.actionsNode.id,{ViewAllLink:s.expand({resource:c.CommitLocation}),ViewAllLabel:k["See Full Log"],ViewAllTooltip:k["See the full log"]},b,"button"),a&&(b.commandService.registerCommandContribution(e.actionsNode.id,"eclipse.orion.git.fetch",100),b.commandService.registerCommandContribution(e.actionsNode.id,"eclipse.orion.git.merge",100),b.commandService.registerCommandContribution(e.actionsNode.id,
"eclipse.orion.git.rebase",100),b.commandService.registerCommandContribution(e.actionsNode.id,"eclipse.orion.git.resetIndex",100),b.commandService.renderCommands(e.actionsNode.id,e.actionsNode.id,c.RemoteLocation[0].Children[0],b,"button")),b.commandService.registerCommandContribution(e.actionsNode.id,"eclipse.orion.git.push",100),b.commandService.renderCommands(e.actionsNode.id,e.actionsNode.id,c,b,"button"),c.RemoteLocation[0]===null?(g.done(),b.renderNoCommit()):(g.worked(h.formatMessage(k['Getting commits for "${0}" branch'],
c.Name)),a&&c.RemoteLocation[0].Children[0].CommitLocation?b.registry.getService("orion.page.progress").progress(b.registry.getService("orion.git.provider").getLog(c.RemoteLocation[0].Children[0].CommitLocation+"?page=1&pageSize=20","HEAD"),h.formatMessage(k['Getting commits for "${0}" branch'],c.Name)).then(function(a){g.worked(k["Rendering commits"]);for(var d=a.Children.length,e=0;e<a.Children.length;e++)b.renderCommit(a.Children[e],!0,e);g.worked(k["Getting outgoing commits"]);b.registry.getService("orion.page.progress").progress(b.registry.getService("orion.git.provider").getLog(c.CommitLocation+
"?page=1&pageSize=20",c.RemoteLocation[0].Children[0].Id),k["Getting outgoing commits"]).then(function(a){g.worked(k["Rendering commits"]);for(var c=0;c<a.Children.length;c++)b.renderCommit(a.Children[c],!1,c+d);d+=a.Children.length;d===0&&b.renderNoCommit();g.done()},function(a){g.done(a)})},function(a){g.done(a)}):b.registry.getService("orion.page.progress").progress(b.registry.getService("orion.git.provider").doGitLog(c.CommitLocation+"?page=1&pageSize=20"),h.formatMessage(k['Getting commits for "${0}" branch'],
c.Name)).then(function(a){g.worked(k["Rendering commits"]);for(var c=0;c<a.Children.length;c++)b.renderCommit(a.Children[c],!0,c);a.Children.length===0&&b.renderNoCommit();g.done()},function(a){g.done(a)}))):g.done()},b.handleError.bind(b))};i.prototype.renderNoCommit=function(){var a=f.node("commitNode");a.innerHTML="";var b=document.createElement("div");b.className="sectionTableItem";a.appendChild(b);a=document.createElement("div");b.appendChild(a);b=document.createElement("div");b.appendChild(document.createTextNode(k["The branch is up to date."]));
a.appendChild(b);b=document.createElement("div");b.appendChild(document.createTextNode(k["You have no outgoing or incoming commits."]));a.appendChild(b)};i.prototype.renderCommit=function(a,b){var c=f.node("commitNode"),d=document.createElement("div");d.className="sectionTableItem lightTreeTableRow";c.appendChild(d);c=document.createElement("div");c.className="sectionTableItem";c.style.overflow="hidden";d.appendChild(c);var d=b?"git-sprite-outgoing-commit":"git-sprite-incoming-commit",e=document.createElement("span");
e.className="sectionIcon gitImageSprite "+d;c.appendChild(e);if(a.AuthorImage)d=document.createElement("div"),d.style["float"]="left",e=new Image,e.src=a.AuthorImage,e.name=a.AuthorName,e.className="git-author-icon",d.appendChild(e),c.appendChild(d);d=document.createElement("div");d.className="stretch";c.appendChild(d);c=document.createElement("a");c.className="navlinkonpage";c.href=g.toUrl(r.expand({resource:a.Location}));c.textContent=a.Message;d.appendChild(c);new m.CommitTooltipDialog({commit:a,
triggerNode:c});c=document.createElement("div");c.textContent=" (SHA "+a.Name+") by "+a.AuthorName+" on "+(new Date(a.Time)).toLocaleString();d.appendChild(c)};return i}();return n});
define("orion/operation",["orion/xhr","orion/Deferred"],function(g,k){function j(c,e,b,f){g("GET",c,{headers:{"Orion-Version":"1"},timeout:15E3}).then(function(h){h=h.response?JSON.parse(h.response):null;e.progress(h);!h.type||h.type==="loadstart"||h.type==="progress"?setTimeout(function(){j(c,e,b,f)},2E3):(h.type==="error"||h.type==="abort"?e.reject(f?f(h):h.Result):e.resolve(b?b(h):h.Result.JsonData),h.Location||g("DELETE",c,{headers:{"Orion-Version":"1"},timeout:15E3}))},function(b){var c=b;if(b.responseText!==
void 0){c=b.responseText;try{c=JSON.parse(b.responseText)}catch(a){}}c.Message!==void 0?(c.HttpCode=c.HttpCode===void 0?b.status:c.HttpCode,c.Severity=c.Severity===void 0?"Error":c.Severity,e.reject(c)):e.reject({Severity:"Error",Message:c,HttpCode:b.status})})}function e(c,e){e.then(null,function(b){b instanceof Error&&b.name==="Cancel"&&g("PUT",c,{headers:{"Orion-Version":"1"},data:JSON.stringify({abort:!0}),timeout:15E3})})}return{handle:function(c,g,b){var f=new k;e(c,f);j(c,f,g,b);return f}}});
define("orion/git/gitClient",["require","orion/xhr","orion/Deferred","orion/operation"],function(g,k,j,e){var c=c||{};c.GitService=function(){function c(b){if(b)this._serviceRegistry=b,this._serviceRegistration=b.registerService("orion.git.provider",this),this._sshService=b.getService("orion.net.ssh")}c.prototype={checkGitService:function(){},cloneGitRepository:function(b,c,e,d,a,i,n,m,o,t,s){var r=this,u={};if(b)u.Name=b;if(e)u.Path=e;if(c)u.GitUrl=c;u.Location=d;if(a)u.GitSshUsername=a;if(i)u.GitSshPassword=
i;if(n)u.GitSshKnownHost=n;if(m)u.GitSshPrivateKey=m;if(o)u.GitSshPassphrase=o;if(t){if(t.GitMail)u.GitMail=t.GitMail;if(t.GitName)u.GitName=t.GitName}if(s)u.initProject=s;var b=g.toUrl("gitapi/clone/._"),b=b.substring(0,b.length-2),w=new j;k("POST",b,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify(u)}).then(function(a){r._getGitServiceResponse(w,a)},function(a){r._handleGitServiceResponseError(w,a)});return w},removeGitRepository:function(b){var c=
this,e=new j;k("DELETE",b,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json"}).then(function(b){c._getGitServiceResponse(e,b)},function(b){c._handleGitServiceResponseError(e,b)});return e},getGitStatus:function(b){var c=this,e=new j;k("GET",b,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json"}).then(function(b){c._getGitServiceResponse(e,b)},function(b){c._handleGitServiceResponseError(e,b)});return e},stage:function(b){var c=
this,e=new j;k("PUT",b,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json"}).then(function(b){c._getGitServiceResponse(e,b)},function(b){c._handleGitServiceResponseError(e,b)});return e},stageMultipleFiles:function(b,c){var e=this,d=new j;k("PUT",b,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify({Path:c})}).then(function(a){e._getGitServiceResponse(d,a)},function(a){e._handleGitServiceResponseError(d,
a)});return d},unstageAll:function(b,c){var e=this,d=new j;k("POST",b,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify({Reset:c})}).then(function(a){e._getGitServiceResponse(d,a)},function(a){e._handleGitServiceResponseError(d,a)});return d},unstage:function(b,c){var e=this,d=new j;k("POST",b,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify({Path:c})}).then(function(a){e._getGitServiceResponse(d,
a)},function(a){e._handleGitServiceResponseError(d,a)});return d},checkoutPath:function(b,c){var e=this,d=new j;k("PUT",b,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify({Path:c,RemoveUntracked:"true"})}).then(function(a){e._getGitServiceResponse(d,a)},function(a){e._handleGitServiceResponseError(d,a)});return d},commitAll:function(b,c,e){var d=this,a=new j;k("POST",b,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,
handleAs:"json",data:e}).then(function(b){d._getGitServiceResponse(a,b)},function(b){d._handleGitServiceResponseError(a,b)});return a},getGitClone:function(b){var c=this,e=new j;k("GET",b,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json"}).then(function(b){c._getGitServiceResponse(e,b)},function(b){c._handleGitServiceResponseError(e,b)});return e},getGitCloneConfig:function(b){var c=this,e=new j;k("GET",b,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},
timeout:15E3,handleAs:"json"}).then(function(b){c._getGitServiceResponse(e,b)},function(b){c._handleGitServiceResponseError(e,b)});return e},getGitBranch:function(b){var c=this,e=new j;k("GET",b,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json"}).then(function(b){c._getGitServiceResponse(e,b)},function(b){c._handleGitServiceResponseError(e,b)});return e},getGitRemote:function(b){var c=this,e=new j;k("GET",b,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},
timeout:15E3,handleAs:"json"}).then(function(b){c._getGitServiceResponse(e,b)},function(b){c._handleGitServiceResponseError(e,b)});return e},checkoutBranch:function(b,c){var e=this,d=new j;k("PUT",b,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify({Branch:c})}).then(function(a){e._getGitServiceResponse(d,a)},function(a){e._handleGitServiceResponseError(d,a)});return d},resetIndex:function(b,c){var e=this,d=new j;k("POST",b,{headers:{"Orion-Version":"1",
"Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify({Commit:c,Reset:"HARD"})}).then(function(a){e._getGitServiceResponse(d,a)},function(a){e._handleGitServiceResponseError(d,a)});return d},addBranch:function(b,c,e){var d=this,a={};if(c)a.Name=c;if(e)a.Branch=e;var g=new j;k("POST",b,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify(a)}).then(function(a){d._getGitServiceResponse(g,a)},function(a){d._handleGitServiceResponseError(g,
a)});return g},removeBranch:function(b){var c=this,e=new j;k("DELETE",b,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json"}).then(function(b){c._getGitServiceResponse(e,b)},function(b){c._handleGitServiceResponseError(e,b)});return e},addRemote:function(b,c,e){var d=this,a=new j;k("POST",b,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify({Remote:c,RemoteURI:e})}).then(function(b){d._getGitServiceResponse(a,
b)},function(b){d._handleGitServiceResponseError(a,b)});return a},removeRemote:function(b){var c=this,e=new j;k("DELETE",b,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json"}).then(function(b){c._getGitServiceResponse(e,b)},function(b){c._handleGitServiceResponseError(e,b)});return e},doGitLog:function(b){var c=this,e=new j;k("GET",b,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json"}).then(function(b){c._getGitServiceResponse(e,
b)},function(b){c._handleGitServiceResponseError(e,b)});return e},getDiff:function(b,c){var e=this,d=new j;k("POST",b,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify({New:c})}).then(function(a){e._getGitServiceResponse(d,a)},function(a){e._handleGitServiceResponseError(d,a)});return d},doFetch:function(b,c,e,d,a,g,i){var m=this,o=new j;k("POST",b,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json",
data:JSON.stringify({Fetch:"true",Force:c,GitSshUsername:e,GitSshPassword:d,GitSshKnownHost:a,GitSshPrivateKey:g,GitSshPassphrase:i})}).then(function(a){m._getGitServiceResponse(o,a)},function(a){m._handleGitServiceResponseError(o,a)});return o},doPull:function(b,c,e,d,a,g,i){var m=this,o=new j;k("POST",b,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify({Pull:"true",Force:c,GitSshUsername:e,GitSshPassword:d,GitSshKnownHost:a,GitSshPrivateKey:g,
GitSshPassphrase:i})}).then(function(a){m._getGitServiceResponse(o,a)},function(a){m._handleGitServiceResponseError(o,a)});return o},doMerge:function(b,c,e){var d=this,a=new j;k("POST",b,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify({Merge:c,Squash:e})}).then(function(b){d._getGitServiceResponse(a,b)},function(b){d._handleGitServiceResponseError(a,b)});return a},doCherryPick:function(b,c){var e=this,d=new j;k("POST",b,{headers:{"Orion-Version":"1",
"Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify({"Cherry-Pick":c})}).then(function(a){e._getGitServiceResponse(d,a)},function(a){e._handleGitServiceResponseError(d,a)});return d},doRevert:function(b,c){var e=this,d=new j;k("POST",b,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify({Revert:c})}).then(function(a){e._getGitServiceResponse(d,a)},function(a){e._handleGitServiceResponseError(d,a)});return d},doRebase:function(b,
c,e){var d=this,a={};a.Rebase=c;if(e)a.Operation=e;var g=new j;k("POST",b,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify(a)}).then(function(a){d._getGitServiceResponse(g,a)},function(a){d._handleGitServiceResponseError(g,a)});return g},doPush:function(b,c,e,d,a,g,i,m,o){var t=this,s=new j;k("POST",b,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify({PushSrcRef:c,PushTags:e,
Force:d,GitSshUsername:a,GitSshPassword:g,GitSshKnownHost:i,GitSshPrivateKey:m,GitSshPassphrase:o})}).then(function(a){t._getGitServiceResponse(s,a)},function(a){t._handleGitServiceResponseError(s,a)});return s},getLog:function(b,c){var e=this,d=new j,a=new j;k("POST",b,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify({New:c})}).then(function(b){a.resolve(b.xhr.getResponseHeader("Location"))},function(a){e._handleGitServiceResponseError(d,
a)});a.then(function(a){k("GET",a,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json"}).then(function(a){e._getGitServiceResponse(d,a)},function(a){e._handleGitServiceResponseError(d,a)})});return d},getDefaultRemoteBranch:function(b){var c=this,e=new j,d=new j;k("GET",b,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json"}).then(function(a){c._getGitServiceResponse(d,a)},function(a){c._handleGitServiceResponseError(e,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){c._getGitServiceResponse(e,a)},function(a){c._handleGitServiceResponseError(e,a)})});return e},doAddTag:function(b,c){var e=this,d=new j;k("PUT",b,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify({Name:c})}).then(function(a){e._getGitServiceResponse(d,a)},function(a){e._handleGitServiceResponseError(d,
a)});return d},doRemoveTag:function(b){var c=this,e=new j;k("DELETE",b,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json"}).then(function(b){c._getGitServiceResponse(e,b)},function(b){c._handleGitServiceResponseError(e,b)});return e},checkoutTag:function(b,c,e){var d=this,a=new j;k("PUT",b,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify({Tag:c,Branch:e})}).then(function(b){d._getGitServiceResponse(a,
b)},function(b){d._handleGitServiceResponseError(a,b)});return a},addCloneConfigurationProperty:function(b,c,e){var d=this,a=new j;k("POST",b,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify({Key:c,Value:e})}).then(function(b){d._getGitServiceResponse(a,b)},function(b){d._handleGitServiceResponseError(a,b)});return a},editCloneConfigurationProperty:function(b,c){var e=this,d=new j;k("PUT",b,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},
timeout:15E3,handleAs:"json",data:JSON.stringify({Value:c})}).then(function(a){e._getGitServiceResponse(d,a)},function(a){e._handleGitServiceResponseError(d,a)});return d},deleteCloneConfigurationProperty:function(b){var c=this,e=new j;k("DELETE",b,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json"}).then(function(b){c._getGitServiceResponse(e,b)},function(b){c._handleGitServiceResponseError(e,b)});return e},sendCommitReviewRequest:function(b,c,e,d,a,g){var i=
this,m=new j;k("POST",c,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify({ReviewReqCommit:b,ReviewReqUrl:d,ReviewReqNotifyLogin:e,ReviewReqAuthorName:a,ReviewMessage:g})}).then(function(a){i._getGitServiceResponse(m,a)},function(a){i._handleGitServiceResponseError(m,a)});return m},_getGitServiceResponse:function(b,c){var g=c.response?JSON.parse(c.response):null;if(c.xhr&&c.xhr.status===202){var d=e.handle(g.Location);d.then(b.resolve,function(a){a.failedOperation=
g.Location;b.reject(a)},b.progress);b.then(null,function(a){d.reject(a)})}else b.resolve(g)},_handleGitServiceResponseError:function(b,c){b.reject(c)}};return c}();return c});
define("orion/ssh/sshTools",[],function(){var g=g||{};g.SshService=function(){function g(j){if(j)this._serviceRegistry=j,this._serviceRegistration=j.registerService("orion.net.ssh",this)}g.prototype={_KNOWN_HOSTS:"known_hosts",addKnownHosts:function(g,e){e||(e="");var c=localStorage.getItem(e+this._KNOWN_HOSTS);c?c.indexOf(g)<0&&localStorage.setItem(e+this._KNOWN_HOSTS,c+"\n"+g):localStorage.setItem(e+this._KNOWN_HOSTS,g)},clearKnownhosts:function(g){g||(g="");localStorage.removeItem(g+this._KNOWN_HOSTS)},
getKnownHosts:function(g){g||(g="");return localStorage.getItem(g+this._KNOWN_HOSTS)}};return g}();return g});
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,i){var b=g.search(e);b>0&&(j.appendChild(document.createTextNode(g.substring(0,b))),g=g.substring(b));var e=g.replace(e,""),b=g.substring(0,g.length-e.length),f=b.split(" ",c);if(f.length===c){for(var g=document.createElement("a"),h=0;h<c;h++)i=i.replace("%"+
(h+1),f[h]);g.setAttribute("href",i);g.textContent=b;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 i=c[0],c=RegExp(i.getProperty("pattern"),"i"),b=i.getProperty("words"),i=i.getProperty("anchor"),f=g.search(c);f>=0;)g=this._replaceLink(g,e,c,b,i),f=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-status.js',"i18n!git/nls/gitmessages,require,orion/browserCompatibility,orion/bootstrap,orion/status,orion/progress,orion/commandRegistry,orion/commands,orion/dialogs,orion/selection,orion/fileClient,orion/operationsClient,orion/searchClient,orion/globalCommands,orion/widgets/themes/ThemePreferences,orion/widgets/themes/editor/ThemeData,orion/git/gitStatusExplorer,orion/git/gitCommands,orion/git/gitClient,orion/ssh/sshTools,orion/links,orion/contentTypes,orion/PageUtil".split(","),function(g,
k,j,e,c,i,b,f,h,d,a,l,n,m,o,t,s,r,u,w,v,q,p){e.startup().then(function(e){var j=e.serviceRegistry,e=e.preferences;new h.DialogService(j);var A=new d.Selection(j);new w.SshService(j);var A=new b.CommandRegistry({selection:A}),F=new l.OperationsClient(j);new c.StatusReportingService(j,F,"statusPane","notifications","notificationArea");new i.ProgressService(j,F,A);(new o.ThemePreferences(e,new t.ThemeData)).apply();F=new v.TextLinkService({serviceRegistry:j});new u.GitService(j);var G=new a.FileClient(j);
new q.ContentTypeRegistry(j);var y=new n.Searcher({serviceRegistry:j,commandService:A,fileService:G}),z=new s.GitStatusExplorer(j,A,F,null,"artifacts","pageActions",null,"itemLevelCommands");m.setPageCommandExclusions(["eclipse.git.status2","eclipse.git.status"]);m.generateBanner("orion-git-status",j,A,e,y,z);r.createFileCommands(j,A,z,"pageActions","selectionTools");r.createGitClonesCommands(j,A,z,"pageActions","selectionTools",G);r.createGitStatusCommands(j,A,z);A.addCommandGroup("pageActions",
"eclipse.gitGroup",100);A.registerCommandContribution("pageActions","eclipse.orion.git.resetCommand",100,"eclipse.gitGroup");A.registerCommandContribution("pageActions","eclipse.orion.git.rebaseContinueCommand",200,"eclipse.gitGroup");A.registerCommandContribution("pageActions","eclipse.orion.git.rebaseSkipPatchCommand",300,"eclipse.gitGroup");A.registerCommandContribution("pageActions","eclipse.orion.git.rebaseAbortCommand",400,"eclipse.gitGroup");j=new f.Command({name:g["View All"],id:"eclipse.orion.git.repositories.viewAllCommand",
hrefCallback:function(a){return k.toUrl(a.items.ViewAllLink)},visibleWhen:function(a){this.name=a.ViewAllLabel;this.tooltip=a.ViewAllTooltip;return a.ViewAllLabel&&a.ViewAllTooltip&&a.ViewAllLink}});A.addCommand(j);j=p.matchResourceParameters();z.display(j.resource);window.addEventListener("hashchange",function(){var a=p.matchResourceParameters();z.display(a.resource)},!1)})});