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

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

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

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

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

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

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

 Copyright (c) 2011, 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, 2014 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made
 available under the terms of the Eclipse Public License v1.0
 (http://www.eclipse.org/legal/epl-v10.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, 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) 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, 2014 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://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, 2014 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.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, 2014 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.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) 2014 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.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) 2014 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.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) 2014 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.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) 2014 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.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) 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) 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
 Adrian Aichner - regular expression capture group support in replace

 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, 2014 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.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, 2014 IBM Corporation and others. All rights
 reserved. This program and the accompanying materials are made
 available under the terms of the Eclipse Public License v1.0
 (http://www.eclipse.org/legal/epl-v10.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, 2014 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.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, 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
*/
(function(){function h(d,f,b,g,e,c){f[d]&&(b.push(d),(f[d]===!0||f[d]===1)&&g.push(e+d+"/"+c))}function k(d,f,b,g,e){f=g+f+"/"+e;require._fileExists(d.toUrl(f+".js"))&&b.push(f)}function j(d,f,b){for(var g in f)f.hasOwnProperty(g)&&(!d.hasOwnProperty(g)||b)?d[g]=f[g]:typeof f[g]==="object"&&j(d[g],f[g],b)}var f=/(^.*(^|\/)nls(\/|$))([^\/]*)\/?([^\/]*)/;define("i18n",["module"],function(d){var i=d.config?d.config():{};return{version:"2.0.1+",load:function(b,g,e,c){c=c||{};if(c.locale)i.locale=c.locale;
var a=f.exec(b),d=a[1],m=a[4],o=a[5],s=m.split("-"),p=[],u={},v,t="";if(a[5])d=a[1],b=d+o;else{o=a[4];m=i.locale;if(!m)m=i.locale=typeof navigator==="undefined"?"root":(navigator.language||navigator.userLanguage||"root").toLowerCase();s=m.split("-")}if(c.isBuild){p.push(b);k(g,"root",p,d,o);for(v=0;v<s.length;v++)c=s[v],t+=(t?"-":"")+c,k(g,t,p,d,o);g(p,function(){e()})}else g([b],function(a){var c=[],b;h("root",a,c,p,d,o);for(v=0;v<s.length;v++)b=s[v],t+=(t?"-":"")+b,h(t,a,c,p,d,o);g(p,function(){var b,
n,f;for(b=c.length-1;b>-1&&c[b];b--){f=c[b];n=a[f];if(n===!0||n===1)n=g(d+f+"/"+o);j(u,n)}e(u)})})}}})})();
define("orion/i18n",[],function(){return{load:function(h,k,j,f){var f=f||{},d=/(^.*(?:^|\/)nls(?:\/|$))([^\/]*)\/?([^\/]*)/,i=d.exec(h);if(i){if(!k.defined||k.defined(h))try{j(k(h));return}catch(b){}if(f.isBuild||f.isTest)j({});else if(k.specified&&!k.specified("orion/bootstrap"))j({});else{var g=i[1],e=i[3]?i[2]:"",c=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(e)a.some(function(a){return h===a.getProperty("name")?
(b.getService(a).getMessageBundle().then(function(a){j(a)},function(){j({})}),!0):!1})||j({});else{var o={},s;a.forEach(function(a){var b=a.getProperty("name");if((i=d.exec(b))&&g===i[1]&&c===(i[3]||i[2]))if(e=i[3]?i[2]:""){if((a=f.locale||(typeof navigator!=="undefined"?navigator.language||navigator.userLanguage:null))&&a.toLowerCase().indexOf(e.toLowerCase())===0)o[e]=!0,(!k.specified||!k.specified(b))&&define(b,["orion/i18n!"+b],function(a){return a})}else s=a});!k.specified||!k.specified(h)?s?
b.getService(s).getMessageBundle().then(function(a){Object.keys(o).forEach(function(c){typeof a[c]==="undefined"&&(a[c]=o[c])});define(h,[],a);j(a)},function(){define(h,[],o);j(o)}):(define(h,[],o),j(o)):j(o)}})})}}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:"All 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":"Open the Git Status page for the repository containing this file or folder.","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":"Open the Git Repository page for this file or folder.","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:","ChangeId:":"ChangeId:","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:","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:","No remote selected":"No remote selected","Enter a name...":"Enter a name...",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":"Open the remote Git Log page for this file or folder.","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":"Open the local Git Log page for this file or folder.","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","Password:":"Password:","User Name:":"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",
"Push Branch":"Push Branch","Push commits without tags from your local branch into the remote branch":"Push commits without tags from your local branch into the remote branch","Push for Review":"Push for Review","Push commits to Gerrit Code Review":"Push commits to Gerrit Code Review","Force Push Branch":"Force Push Branch","Push commits without tags from your local branch into the remote branch overriding its current content":"Push commits without tags from your local branch into the remote branch overriding its current content",
"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","Fetching previous commit message":"Fetching previous commit message","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",Login:"Login","Authentication required for: ${0}. ${1} and re-try the request.":"Authentication required for: ${0}. ${1} and re-try the request."});
define("git/nls/gitmessages",["orion/i18n!git/nls/gitmessages","git/nls/root/gitmessages"],function(h,k){var j={root:k};Object.keys(h).forEach(function(f){typeof j[f]==="undefined"&&(j[f]=h[f])});return j});
(function(){function h(){for(var d=navigator.userAgent,f={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:"Microsoft Internet Explorer",regExp:/Trident\/(\d+)/i,minVersion:6},{name:"Safari",regExp:/version\/(\d+).*?safari/i,minVersion:6}],g=0;g<b.length;g++){var e=b[g],c=d.match(e.regExp);if(c){f.browser=
!0;f.version=c[1]>=e.minVersion;f.name=e.name;break}}return f}function k(){try{return"localStorage"in window&&window.localStorage!==null}catch(d){return!1}}function j(d){alert(d);throw Error("unsupported browser");}var f=h();if(f.browser)f.version||j("Sorry, your browser version is not supported.\n\nTo use Orion, please upgrade to the latest version of "+f.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:h,supportsLocalStorage:k,throwBrowserAlert:j}})();define("orion/browserCompatibility",function(){});
(function(h,k){typeof define==="function"&&define.amd?define("orion/Deferred",k):typeof exports==="object"?module.exports=k():(h.orion=h.orion||{},h.orion.Deferred=k())})(this,function(){function h(){for(var b;b=d.shift();)b();i=!1}function k(b){d.push(b);i||(i=!0,setTimeout(h,0))}function j(b){return function(){b.apply(void 0,arguments)}}function f(){function b(){for(var c;c=m.shift();){var e=c.deferred,b=l==="fulfilled"?"resolve":"reject";if(typeof c[b]==="function")try{var g=(0,c[b])(a),f=g&&(typeof g===
"object"||typeof g==="function")&&g.then;if(typeof f==="function")if(g===e.promise)e.reject(new TypeError);else{var i=g.cancel;typeof i==="function"?e._protected(d).parentCancel=i.bind(g):delete e._protected(d).parentCancel;f.call(g,j(e.resolve),j(e.reject),j(e.progress))}else e.resolve(g)}catch(n){e.reject(n)}else e[b](a)}}function g(c){delete h.parentCancel;l="rejected";a=c;m.length&&k(b)}function e(c){function d(a){return function(c){j||(j=!0,a(c))}}var j=!1;delete h.parentCancel;try{var t=c&&
(typeof c==="object"||typeof c==="function")&&c.then;if(typeof t==="function")if(c===i)g(new TypeError);else{l="assumed";var q=c&&c.cancel;if(typeof q!=="function"){var w=new f,c=w.promise;try{t(w.resolve,w.reject,w.progress)}catch(n){w.reject(n)}q=c.cancel;t=c.then}a=c;t.call(c,d(e),d(g));h.parentCancel=q.bind(c)}else l="fulfilled",a=c,m.length&&k(b)}catch(r){d(g)(r)}}function c(){var a=h.parentCancel;if(a)delete h.parentCancel,a();else if(!l)a=Error("Cancel"),a.name="Cancel",g(a)}var a,l,m=[],i=
this,h={};Object.defineProperty(this,"_protected",{value:function(a){if(a!==d)throw Error("protected");return h}});this.resolve=function(a){l||e(a);return i};this.reject=function(a){l||g(a);return i};this.progress=function(a){l||m.forEach(function(c){if(c.progress)try{c.progress(a)}catch(e){}});return i.promise};this.cancel=function(){h.parentCancel?setTimeout(c,0):c();return i};this.then=function(a,c,e){a={resolve:a,reject:c,progress:e,deferred:new f};m.push(a);a.deferred._protected(d).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 d=[],i=!1;f.all=function(b,g){function e(c,e){m||(d[c]=e,--a===0&&i.resolve(d))}function c(a,c){if(!m){if(g)try{e(a,g(c));return}catch(b){c=b}i.reject(c)}}var a=b.length,d=[],m=!1,i=new f;i.then(void 0,function(){m=!0;b.forEach(function(a){a.cancel&&a.cancel()})});a===0?i.resolve(d):b.forEach(function(a,b){a.then(e.bind(void 0,b),c.bind(void 0,b))});return i.promise};
f.when=function(b,g,e,c){var a;if(!(b&&typeof b.then==="function"))a=new f,a.resolve(b),b=a.promise;return b.then(g,e,c)};return f});
define("orion/EventTarget",[],function(){function h(){this._namedListeners={}}h.prototype={dispatchEvent:function(h){if(!h.type)throw Error("unspecified type");var j=this._namedListeners[h.type];j&&j.forEach(function(f){try{typeof f==="function"?f(h):f.handleEvent(h)}catch(d){typeof console!=="undefined"&&console.log(d)}});return!h.defaultPrevented},addEventListener:function(h,j){if(typeof j==="function"||j.handleEvent)this._namedListeners[h]=this._namedListeners[h]||[],this._namedListeners[h].push(j)},
removeEventListener:function(h,j){var f=this._namedListeners[h];if(f)for(var d=0;d<f.length;d++)if(f[d]===j){f.length===1?delete this._namedListeners[h]:f.splice(d,1);break}}};h.prototype.constructor=h;h.attach=function(k){var j=new h;k.dispatchEvent=j.dispatchEvent.bind(j);k.addEventListener=j.addEventListener.bind(j);k.removeEventListener=j.removeEventListener.bind(j)};return h});
define("orion/serviceregistry",["orion/Deferred","orion/EventTarget"],function(h,k){function j(b,e,c){this._properties=c||{};this._properties["service.id"]=b;this._properties.objectClass=e;this._properties["service.names"]=e}function f(b,e,c){this._serviceId=b;this._serviceReference=e;this._internalRegistry=c}function d(b,e){function c(a){return function(){var c;try{if(!e())throw Error("Service was unregistered");var d=b[a].apply(b,Array.prototype.slice.call(arguments));if(d&&typeof d.then==="function")return d;
else c=new h,c.resolve(d)}catch(f){c=new h,c.reject(f)}return c.promise}}for(var a in b)typeof b[a]==="function"&&(this[a]=c(a))}function i(b,e){this.type=b;this.serviceReference=e}function b(){this._entries=[];this._namedReferences={};this._serviceEventTarget=new k;var b=this;this._internalRegistry={isRegistered:function(e){return b._entries[e]?!0:!1},unregisterService:function(e){var c=b._entries[e];if(!c)throw Error("Service has already been unregistered: "+e);var a=c.reference;b._serviceEventTarget.dispatchEvent(new i("unregistering",
a));b._entries[e]=null;a.getProperty("objectClass").forEach(function(c){for(var e=b._namedReferences[c],d=0;d<e.length;d++)if(e[d]===a){e.length===1?delete b._namedReferences[c]:e.splice(d,1);break}})},modifyService:function(e){var c=b._entries[e];if(!c)throw Error("Service not found while trying to send modified event: "+e);b._serviceEventTarget.dispatchEvent(new i("modified",c.reference))}}}j.prototype={getPropertyKeys:function(){var b=[],e;for(e in this._properties)this._properties.hasOwnProperty(e)&&
b.push(e);return b},getProperty:function(b){return this._properties[b]}};j.prototype.constructor=j;f.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(b){var e=this._serviceReference._properties;this._serviceReference._properties=b||{};b["service.id"]=this._serviceId;
b.objectClass=e.objectClass;b["service.names"]=e["service.names"];this._internalRegistry.modifyService(this._serviceId)}};f.prototype.constructor=f;b.prototype={getService:function(b){var e;if(typeof b==="string")(b=this._namedReferences[b])&&b.some(function(c){e=this._entries[c.getProperty("service.id")].service;return!!e},this);else if(b=this._entries[b.getProperty("service.id")])e=b.service;return e||null},getServiceReferences:function(b){if(b)return this._namedReferences[b]?this._namedReferences[b]:
[];var e=[];this._entries.forEach(function(c){c&&e.push(c.reference)});return e},registerService:function(b,e,c){if(typeof e==="undefined"||e===null)throw Error("invalid service");typeof b==="string"?b=[b]:Array.isArray(b)||(b=[]);var a=this._entries.length,l=new j(a,b,c),m=this._namedReferences;b.forEach(function(a){m[a]=m[a]||[];m[a].push(l)});b=new d(e,this._internalRegistry.isRegistered.bind(null,a));this._entries.push({reference:l,service:b});b=this._internalRegistry;this._serviceEventTarget.dispatchEvent(new i("registered",
l));return new f(a,l,b)},addEventListener:function(b,e){this._serviceEventTarget.addEventListener(b,e)},removeEventListener:function(b,e){this._serviceEventTarget.removeEventListener(b,e)}};b.prototype.constructor=b;return{ServiceRegistry:b}});
define("orion/xhr",["orion/Deferred"],function(h){function k(h,f,d,i){var b=typeof d.response!=="undefined"?d.response:d.responseText,g;try{g=d.status}catch(e){g=0}h={args:f,response:b,responseText:typeof b==="string"?b:null,status:g,url:h,xhr:d};if(typeof i!=="undefined")h.error=i;return h}return function(j,f,d){var d=d||{},i=arguments.length>3&&arguments[3]?arguments[3]:new XMLHttpRequest,b=new h,g=d.headers||{},e=d.log||!1,c;typeof g["X-Requested-With"]==="undefined"&&(g["X-Requested-With"]="XMLHttpRequest");
if(typeof d.data!=="undefined"&&(j==="POST"||j==="PUT"))c=d.data;var a=!1,l=!1;b.promise.then(void 0,function(c){a=!0;!l&&c instanceof Error&&c.name==="Cancel"&&i.abort()});i.onabort=function(){l=!0;if(!a){var c=Error("Cancel");c.name="Cancel";b.reject(c)}};i.onload=function(){var a=k(f,d,i);200<=i.status&&i.status<400?b.resolve(a):(b.reject(a),e&&typeof console!=="undefined"&&console.log(Error(i.statusText)))};i.onerror=function(){var a=k(f,d,i);b.reject(a);e&&typeof console!=="undefined"&&console.log(Error(i.statusText))};
i.onprogress=function(a){a.xhr=i;b.progress(a)};try{i.open(j,f,!0);if(typeof d.responseType==="string")i.responseType=d.responseType;if(typeof d.timeout==="number")if(typeof i.timeout==="number")i.timeout=d.timeout,i.addEventListener("timeout",function(){b.reject(k(f,d,i,"Timeout exceeded"))});else{var m=setTimeout(function(){b.reject(k(f,d,i,"Timeout exceeded"))},d.timeout);b.promise.then(clearTimeout.bind(null,m),clearTimeout.bind(null,m))}Object.keys(g).forEach(function(a){i.setRequestHeader(a,
g[a])});i.send(c||null)}catch(o){b.reject(k(f,d,i,o))}return b.promise}});
define("orion/preferences",["require","orion/Deferred","orion/xhr"],function(h,k,j){function f(c,a){this._name=c;this._providers=a;this._flushPending=!1;this._cached=null;this._stores=[];this._pendingDeletes=[];this._dirty=[]}function d(c,a){return{get:function(e,b){if(a===0)return null;var g=localStorage.getItem(c+e);if(g===null)return null;g=JSON.parse(g);return b||a===-1||g._expires&&g._expires>(new Date).getTime()?(delete g._expires,g):null},set:function(e,b){if(a!==0){if(a!==-1)b._expires=(new Date).getTime()+
1E3*a;if(Object.keys(b).length===0)localStorage.removeItem(c+e);else{var g=JSON.stringify(b);localStorage.setItem(c+e,g);delete b._expires}}},remove:function(a){localStorage.removeItem(c+a)}}}function i(c){this._currentPromises={};this._cache=new d("/orion/preferences/user",3600);this._service=null;this.available=function(){if(!this._service){var a=c.getServiceReferences("orion.core.preference.provider");if(a.length>0)this._service=c.getService(a[0])}return!!this._service}}function b(c){this._location=
c;this._currentPromise=null;this._cache=new d("/orion/preferences/default",3600)}function g(){this._cache=new d("/orion/preferences/local",-1)}function e(c,a){this._userProvider=new i(c);this._localProvider=new g;a=a||"defaults.pref";a.indexOf("://")===-1&&(a=h.toUrl(a));this._defaultsProvider=new b(a);this._serviceRegistration=c.registerService("orion.core.preference",this)}f.prototype={_flush:function(){for(var c=[],a=0;a<this._stores.length;++a){var e=this._stores[a];this._dirty.indexOf(e)!==-1&&
c.push(this._providers[a].put(this._name,e));if(this._pendingDeletes[a]&&this._pendingDeletes[a].length>0){for(e=0;e<this._pendingDeletes[a].length;e++)c.push(this._providers[a].remove(this._name,this._pendingDeletes[a][e]));delete this._pendingDeletes[a]}}this._dirty=[];return k.all(c)},_scheduleFlush:function(c){c&&this._dirty.indexOf(c)===-1&&this._dirty.push(c);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 c=0;c<this._stores.length;++c){var a=this._stores[c],e;for(e in a)a.hasOwnProperty(e)&&typeof this._cached[e]==="undefined"&&(this._cached[e]=a[e])}}return this._cached},keys:function(){return Object.keys(this._getCached())},get:function(c){return this._getCached()[c]},put:function(c,a){if(this._stores.length!==0){var e=this._stores[0];if(e[c]!==a)e[c]=a,this._cached=null,this._scheduleFlush(e)}},remove:function(c){for(var a=0;a<
this._stores.length;++a){var e=this._stores[a];if(e.hasOwnProperty(c))return delete e[c],this._pendingDeletes[a]||(this._pendingDeletes[a]=[]),this._pendingDeletes[a].push(c),this._cached=null,this._scheduleFlush(),!0}return!1},clear:function(){for(var c=0;c<this._stores.length;++c)this._stores[c]={},this._scheduleFlush(this._stores[c]);this._cached=null},sync:function(c){if(this._flushPending)return this._flushPending=!1,this._flush();for(var a=this,e=[],b=0;b<this._providers.length;++b)e.push(this._providers[b].get(this._name,
c).then(function(c){return function(e){a._stores[c]=e}}(b)));return k.all(e).then(function(){a._cached=null;a._getCached()})},flush:function(){this._flush()}};i.prototype={get:function(c,a){if(this._currentPromises[c])return this._currentPromises[c];var e=new k,b=null;a?this._cache.remove(c):b=this._cache.get(c);if(b!==null)e.resolve(b);else{this._currentPromises[c]=e;var g=this;this._service.get(c).then(function(a){g._cache.set(c,a);delete g._currentPromises[c];e.resolve(a)},function(a){a.status===
404?(a={},g._cache.set(c,a),delete g._currentPromises[c],e.resolve(a)):(delete g._currentPromises[c],e.resolve(g._cache.get(c,!0)||{}))})}return e},put:function(c,a){this._cache.set(c,a);return this._service.put(c,a)},remove:function(c,a){var e=this._cache.get(c);delete e[a];this._cache.set(c,e);return this._service.remove(c,a)}};b.prototype={get:function(c,a){if(this._currentPromise)return this._currentPromise;var e=new k,b=null;a?this._cache.remove(c):b=this._cache.get(c);if(b!==null)e.resolve(b);
else{this._currentPromise=e;var g=this;j("GET",this._location,{headers:{"Orion-Version":"1"},timeout:15E3}).then(function(a){a=JSON.parse(a.response);g._cache.set(c,a[c]||{});g._currentPromise=null;e.resolve(a[c]||{})},function(a){a.xhr.status===401||a.xhr.status===404?(g._cache.set(c,{}),g._currentPromise=null,e.resolve({})):(g._currentPromise=null,a=g._cache.get(c,!0),a!==null?e.resolve(a[c]||{}):e.resolve({}))})}return e},put:function(){var c=new k;c.resolve();return c},remove:function(c,a){var e=
this._cache.get(c);delete e[a];this.put(c,e)}};g.prototype={get:function(c){var a=new k,c=this._cache.get(c);c!==null?a.resolve(c):a.resolve({});return a},put:function(c,a){var e=new k;this._cache.set(c,a);e.resolve();return e},remove:function(c,a){var e=this._cache.get(c);delete e[a];this.put(c,e)}};e.DEFAULT_SCOPE=1;e.LOCAL_SCOPE=2;e.USER_SCOPE=4;e.prototype={listenForChangedSettings:function(c,a,b){if(!a||typeof a!=="number"||a>7||a<1)b=a,a=e.DEFAULT_SCOPE|e.LOCAL_SCOPE|e.USER_SCOPE;window.addEventListener("storage",
b,!1);if((e.USER_SCOPE&a)!==0)return"/orion/preferences/user"+c;else if((e.LOCAL_SCOPE&a)!==0)return"/orion/preferences/local"+c;return"/orion/preferences/default"+c},getPreferences:function(c,a){if(!a||typeof a!=="number"||a>7||a<1)a=e.DEFAULT_SCOPE|e.LOCAL_SCOPE|e.USER_SCOPE;var b=[];e.USER_SCOPE&a&&this._userProvider.available()&&b.push(this._userProvider);e.LOCAL_SCOPE&a&&b.push(this._localProvider);e.DEFAULT_SCOPE&a&&b.push(this._defaultsProvider);var g=new f(c,b);return g.sync().then(function(){return g})},
getSetting:function(c,a,e){for(var b,g=0;g<c.length;g++)if(c[g].label===a)for(var d=0;d<c[g].data.length;d++)if(c[g].data[d].label===e){b=c[g].data[d].value;break}return b}};return{PreferencesService:e}});
(function(){function h(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 f(a){var c=/([^=]*)(?:=?)(.*)/.exec(a),a=c[1]?decodeURIComponent(c[1]):"",c=c[2]?decodeURIComponent(c[2]):"";return[a,c]}function d(a){var c=encodeURIComponent(a[0]);a[1]&&(c+="="+encodeURIComponent(a[1]));return c}function i(a,c){var e="",b=[],n=0;return{next:function(){if(e!==a.query)e=a.query,b=k(e);if(n<b.length){var g=f(b[n++]);
switch(c){case "keys":return g[0];case "values":return g[1];case "keys+values":return[g[0],g[1]];default:throw new TypeError;}}throw z;}}}function b(a){Object.defineProperty(this,"_url",{get:function(){return a._url}})}function g(a){return a?/[1-9]\d*$/.exec(a)[0]:""}function e(a){var c=[];a.split("/").forEach(function(a){a===".."?c.pop():a!=="."&&c.push(a)});return c.join("/")}function c(a){return a.replace(/\s/g,function(a){return"%"+a.charCodeAt(0).toString(16)})}function a(a,b){if(typeof a!==
"string")throw new TypeError;var a=c(a),n=s.exec(a);if(!n)return null;var d={};d.scheme=n[1]||"";if(d.scheme&&!u.test(d.scheme))return null;var r=n[2];if(r&&(r=p.exec(r),d.userinfo=r[1],d.host=r[2],d.port=r[3],d.port&&!v.test(d.port)))return null;d.path=n[3];d.query=n[4];d.fragment=n[5];if(!d.scheme&&b&&(d.scheme=b.scheme,!d.host&&b.host))d.userinfo=b.userinfo,d.host=b.host,d.port=b.port,d.pathRelative=!0;if(d.pathRelative)if(d.path){if(d.path[0]!=="/")n=/^(.*\/)[^\/]*$/.exec(b.path)[1]||"/",d.path=
n+d.path}else d.path=b.path;if(d.scheme)d.scheme=d.scheme.toLowerCase();if(d.port)d.port=g(d.port);if(d.host&&d.path)d.path=e(d.path);return d}function l(c,e){var n;if(e){e=e.href||e;n=a(e);if(!n||!n.scheme)throw new SyntaxError;Object.defineProperty(this,"_baseURL",{value:n})}n=a(c,n);if(!n)throw new SyntaxError;Object.defineProperty(this,"_input",{value:c,writable:!0});Object.defineProperty(this,"_url",{value:n,writable:!0});var g=new b(this);Object.defineProperty(this,"query",{get:function(){return this._url?
g:null},enumerable:!0})}try{var m;if(typeof window.URL==="function"&&window.URL.length!==0&&(m=new window.URL("http://www.w3.org?q")).protocol==="http:"&&m.query)return}catch(o){}var s=/^(?:([^:\/?#]+):)?(?:\/\/([^\/?#]*))?([^?#]*)(?:\?([^#]*))?(?:#(.*))?$/,p=/^(?:(.*)@)?(\[[^\]]*\]|[^:]*)(?::(.*))?$/,u=/^([a-zA-Z](?:[a-zA-Z0-9+-.])*)$/,v=/^\d*$/,t=/^(\[[^\]\/?#\s]*\]|[^:\/?#\s]*)$/,q=/^(\[[^\]\/?#\s]*\]|[^:\/?#\s]*)(?::(\d*))?$/,w=/^([^?#\s]*)$/,n=/^([^\s]*)$/,r=/^\S*$/,x=/([^:]*):?(.*)/,z=typeof StopIteration!==
"undefined"?StopIteration:Error("Stop Iteration"),A={"ftp:":"21","gopher:":"70","http:":"80","https:":"443","ws:":"80","wss:":"443"};Object.defineProperties(b.prototype,{get:{value:function(a){h(a);var c;k(this._url.query).some(function(e){e=f(e);if(e[0]===a)return c=e[1],!0});return c},enumerable:!0},set:{value:function(a,c){h(a);h(c);var e=k(this._url.query);e.some(function(b,n){var g=f(b);if(g[0]===a)return g[1]=c,e[n]=d(g),!0})||e.push(d([a,c]));this._url.query=j(e)},enumerable:!0},has:{value:function(a){h(a);
return k(this._url.query).some(function(c){if(f(c)[0]===a)return!0})},enumerable:!0},"delete":{value:function(a){h(a);var c=k(this._url.query),e=c.filter(function(c){return f(c)[0]!==a});return e.length!==c.length?(this._url.query=j(e),!0):!1},enumerable:!0},clear:{value:function(){this._url.query=""},enumerable:!0},forEach:{value:function(a,c){if(typeof a!=="function")throw new TypeError;var e=i(this._url,"keys+values");try{for(;;){var b=e.next();a.call(c,b[1],b[0],this)}}catch(n){if(n!==z)throw n;
}},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){h(a);var c=[];k(this._url.query).forEach(function(e){e=f(e);e[0]===a&&c.push(e[1])});return c},enumerable:!0},append:{value:function(a,c){h(a);h(c);var e=k(this._url.query);e.push(d([a,c]));this._url.query=
j(e)},enumerable:!0}});Object.defineProperties(l.prototype,{href:{get:function(){var a;if(this._url){a=this._url;var c=a.scheme?a.scheme+":":"";a.host&&(c+="//",a.userinfo&&(c+=a.userinfo+"@"),c+=a.host,a.port&&(c+=":"+a.port));c+=a.path;a.query&&(c+="?"+a.query);a.fragment&&(c+="#"+a.fragment);a=c}else a=this._input;return a},set:function(c){h(c);this._input=c;this._url=a(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){h(a);if(this._url&&(a=a.slice(-1)===":"?a.substring(0,a.length-1):a,a===""||u.test(a)))this._url.scheme=a.toLowerCase()},enumerable:!0},_userinfo:{get:function(){return this._url?this._url.userinfo:""},set:function(a){h(a);if(this._url)this._url.userinfo=a}},username:{get:function(){if(!this._url)return"";var a=x.exec(this._userinfo);return decodeURIComponent(a[1]||"")},set:function(a){h(a);if(this._url){var c=
x.exec(this._userinfo),a=[encodeURIComponent(a||"")];c[2]&&a.push(c[2]);this._userinfo=a.join(":")}},enumerable:!0},password:{get:function(){if(!this._url)return"";var a=x.exec(this._userinfo);return decodeURIComponent(a[2]||"")},set:function(a){h(a);if(this._url){var c=[x.exec(this._userinfo)[1]||""];a&&c.push(encodeURIComponent(a));this._userinfo=c.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){h(a);if(this._url&&(a=q.exec(a)))this._url.host=a[1],this._url.port=g(a[2])},enumerable:!0},hostname:{get:function(){return this._url?this._url.host:""},set:function(a){h(a);if(this._url&&t.exec(a))this._url.host=a},enumerable:!0},port:{get:function(){var a=this._url?this._url.port||"":"";a&&a===A[this.protocol]&&(a="");return a},set:function(a){h(a);if(this._url&&v.exec(a))this._url.port=g(a)},enumerable:!0},pathname:{get:function(){return this._url?this._url.path:""},set:function(a){h(a);
if(this._url&&w.exec(a))this._url.host&&a&&a[0]!=="/"&&(a="/"+a),this._url.path=a?e(a):""},enumerable:!0},search:{get:function(){return this._url&&this._url.query?"?"+this._url.query:""},set:function(a){h(a);if(this._url&&(a&&a[0]==="?"&&(a=a.substring(1)),n.exec(a)))this._url.query=a},enumerable:!0},hash:{get:function(){return this._url&&this._url.fragment?"#"+this._url.fragment:""},set:function(a){h(a);if(this._url&&(a&&a[0]==="#"&&(a=a.substring(1)),r.exec(a)))this._url.fragment=a},enumerable:!0}});
if((m=window.URL||window.webkitURL)&&m.createObjectURL)Object.defineProperty(l,"createObjectURL",{value:m.createObjectURL.bind(m),enumerable:!1}),Object.defineProperty(l,"revokeObjectURL",{value:m.revokeObjectURL.bind(m),enumerable:!1});window.URL=l})();define("orion/URL-shim",function(){});
define("orion/pluginregistry",["orion/Deferred","orion/EventTarget","orion/URL-shim"],function(h,k){function j(a,c){var e=Object.keys(a),b=Object.keys(c);if(e.length!==b.length)return!1;e.sort();b.sort();for(var g=0,d=e.length;g<d;g++){var f=e[g];if(f!==b[g])return!1;var i=a[f],f=c[f];if(i!==f&&JSON.stringify(i)!==JSON.stringify(f))return!1}return!0}function f(a){if(a.indexOf("://")===-1)try{return(new URL(a,location.href)).href}catch(c){}return a}function d(a){var c=null,e={key:function(e){return(c=
c||Object.keys(a))[e]},getItem:function(c){return a[c]},setItem:function(e,b){a[e]=b;c=null},removeItem:function(e){delete a[e];c=null},clear:function(){(c=c||Object.keys(a)).forEach(function(c){delete a[c]}.bind(this));c=null}};Object.defineProperty(e,"length",{get:function(){return(c=c||Object.keys(a)).length}});return e}function i(a,c){if(c&&c instanceof XMLHttpRequest){var e,b;try{e=c.status,b=c.statusText}catch(g){e=0,b=""}return{status:e||0,statusText:b}}return c}function b(a){var c=a?JSON.parse(JSON.stringify(a,
i)):a;if(a instanceof Error)c.__isError=!0,c.message=c.message||a.message,c.name=c.name||a.name;return c}function g(a,c){this.type=a;this.plugin=c}function e(a,c){this.__objectId=a;this.__methods=c}function c(a,c,d){function f(a){B&&d.postMessage(a,B)}function i(a){if(!B)return(new h).reject(Error("plugin not connected"));a.id=String(Y++);var c=new h;R[a.id]=c;c.then(null,function(c){y==="active"&&c instanceof Error&&c.name==="Cancel"&&f({requestId:a.id,method:"cancel",params:c.message?[c.message]:
[]})});var b=Object.prototype.toString;a.params.forEach(function(n,g){if(b.call(n)==="[object Object]"&&!(n instanceof e)){var d,r;for(d in n)b.call(n[d])==="[object Function]"&&(r=r||[],r.push(d));if(r){var l=W++;S[l]=n;d=function(){delete S[l]};c.then(d,d);a.params[g]=new e(l,r)}}});d.postMessage(a,B);return c.promise}function u(a,c){a||a===0?f({id:a,result:null,error:c}):console.log(c)}function v(a,c,e,n){n.forEach(function(a,c){if(a&&typeof a.__objectId!=="undefined"){var e={};a.__methods.forEach(function(c){e[c]=
function(){return i({objectId:a.__objectId,method:c,params:Array.prototype.slice.call(arguments)})}});n[c]=e}});var g=typeof a===void 0?null:{id:a,result:null,error:null};try{var d=e.apply(c,n);if(g)d&&typeof d.then==="function"?(Q[a]=d,d.then(function(c){delete Q[a];g.result=c;f(g)},function(c){if(Q[a])delete Q[a],g.error=b(c),f(g)},function(){f({responseId:a,method:"progress",params:Array.prototype.slice.call(arguments)})})):(g.result=d,f(g))}catch(r){if(g)g.error=b(r),f(g)}}function t(a){try{if(a.method){var c=
a.method,e=a.params||[];if("serviceId"in a){var b=O[a.serviceId];b||u(a.id,"service not found");c in b?v(a.id,b,b[c],e):u(a.id,"method not found")}else if("objectId"in a){var n=S[a.objectId];n||u(a.id,"object not found");c in n?v(a.id,n,n[c],e):u(a.id,"method not found")}else if("requestId"in a){var g=Q[a.requestId];g&&c==="cancel"&&g.cancel&&g.cancel.apply(g,e)}else if("responseId"in a){var r=R[a.responseId];r&&c==="progress"&&r.progress&&r.progress.apply(r,e)}else if("plugin"===a.method){var l=
a.params[0];J({headers:l.headers,services:l.services}).then(function(){F&&F.resolve(x)})}else if("timeout"===a.method)F&&F.reject(a.error);else throw Error("Bad method: "+a.method);}else{var f=R[String(a.id)];delete R[String(a.id)];if(a.error){var i=d.handleServiceError(x,a.error);f.reject(i)}else f.resolve(a.result)}}catch(m){console.log("Plugin._messageHandler "+m)}}function q(a){var c={};if(a.methods&&(a.methods.forEach(function(e){c[e]=function(){var c={serviceId:a.serviceId,method:e,params:Array.prototype.slice.call(arguments)};
return y==="active"?i(c):x.start({"transient":!0}).then(function(){return i(c)})}}),c.addEventListener&&c.removeEventListener)){var b=new k,n=W++;S[n]={handleEvent:b.dispatchEvent.bind(b)};var g=new e(n,["handleEvent"]),d=c.addEventListener;c.addEventListener=function(a,c){b._namedListeners[a]||d(a,g);b.addEventListener(a,c)};var r=c.removeEventListener;c.removeEventListener=function(a,c){b.removeEventListener(a,c);b._namedListeners[a]||r(a,g)}}return c}function w(c){var e=JSON.parse(JSON.stringify(c.properties));
e.__plugin__=a;c=c.names||c.type||[];Array.isArray(c)||(c=[c]);e.objectClass=c;return e}function n(a){var c=q(a),e=w(a),e=d.registerService(a.names||a.type,c,e);K[a.serviceId]={registration:e,proxy:c}}function r(){d.persist(a,{created:z,headers:A,services:D,autostart:I,lastModified:E})}var x=this,c=c||{},z=c.created||(new Date).getTime(),A=c.headers||{},D=c.services||[],I=c.autostart,E=c.lastModified||0,y="installed",G,F,B,M,K={},Y=0,W=0,Q={},R={},S={},O={},J;this._persist=r;this._resolve=function(){y=
"resolved";d.dispatchEvent(new g("resolved",x))};this._getAutostart=function(){return I};this._getCreated=function(){return z};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 E};this.getServiceReferences=function(){var a=[];Object.keys(K).forEach(function(c){a.push(K[c].registration.getReference())});
return a};this.setParent=function(a){return M!==a?(M=a,x.stop({"transient":!0}).then(function(){if("started"===I)return x.start({"transient":!0});else if("lazy"===I)return x.start({lazy:!0,"transient":!0})})):(new h).resolve()};this.getState=function(){return y};this.start=function(c){if(y==="uninstalled")return(new h).reject(Error("Plugin is uninstalled"));if(G)return G.promise.then(this.start.bind(this,c));if(y==="active")return(new h).resolve();if(!c||!c.transient){var e=c&&c.lazy?"lazy":"started";
e!==I&&(I=e,r())}e=d.getState();if(e!=="starting"&&e!=="active")return c.transient?(new h).reject(Error("start transient error")):(new h).resolve();if(y==="installed")try{this._resolve()}catch(b){return(new h).reject(b)}y==="resolved"&&D.forEach(function(a){n(a)});if(c&&c.lazy)return y!=="starting"&&(y="starting",d.dispatchEvent(new g("lazy activation",x))),(new h).resolve();var f=new h;G=f;y="starting";d.dispatchEvent(new g("starting",x));F=new h;B=d.connect(a,t,M);F.then(function(){F=null;y="active";
d.dispatchEvent(new g("started",x));G=null;f.resolve()},function(){F=null;y="stopping";d.dispatchEvent(new g("stopping",x));Object.keys(K).forEach(function(a){K[a].registration.unregister();delete K[a]});d.disconnect(B);B=null;y="resolved";G=null;d.dispatchEvent(new g("stopped",x));f.reject(Error("plugin activation error"))});return f.promise};this.stop=function(a){if(y==="uninstalled")return(new h).reject(Error("Plugin is uninstalled"));if(G)return G.promise.then(this.stop.bind(this,a));if((!a||
!a.transient)&&"stopped"!==I)I="stopped",r();if(y!=="active"&&y!=="starting")return(new h).resolve();G=a=new h;y="stopping";d.dispatchEvent(new g("stopping",x));Object.keys(K).forEach(function(a){K[a].registration.unregister();delete K[a]});B&&(d.disconnect(B),B=null);y="resolved";G=null;d.dispatchEvent(new g("stopped",x));a.resolve();return a.promise};J=function(c){if(y==="uninstalled")return(new h).reject(Error("Plugin is uninstalled"));if(!c)return E===0&&(E=(new Date).getTime(),r()),d.loadManifest(a).then(J);
var e=A,b=D,f=I;A=c.headers||{};D=c.services||{};I=c.autostart||I;c.lastModified?E=c.lastModified:(E=(new Date).getTime(),r());if(j(A,e)&&j(D,b)&&I===f)return(new h).resolve();if(y==="active"||y==="starting"){var i=[];Object.keys(D).forEach(function(a){var c=D[a];i.push(a);var e=K[a];if(e){if(j(c.methods,Object.keys(e.proxy))){var a=w(c),b=e.registration.getReference(),g={};b.getPropertyKeys().forEach(function(a){g[a]=b.getProperty(a)});j(a,g)||e.registration.setProperties(a);return}e.registration.unregister();
delete K[a]}n(c)});Object.keys(K).forEach(function(a){i.indexOf(a)===-1&&(K[a].registration.unregister(),delete K[a])})}y==="active"&&(d.disconnect(B),F=new h,B=d.connect(a,t,M),F.then(function(){F=null},function(){F=null;y="stopping";d.dispatchEvent(new g("stopping"),x);Object.keys(K).forEach(function(a){K[a].registration.unregister();delete K[a]});d.disconnect(B);B=null;y="resolved";d.dispatchEvent(new g("stopped",x))}));return(new h).resolve()};this.update=function(a){return J(a).then(function(){d.dispatchEvent(new g("updated",
x))})};this.uninstall=function(){if(y==="uninstalled")return(new h).reject(Error("Plugin is uninstalled"));if(y==="active"||y==="starting"||y==="stopping")return this.stop().then(this.uninstall.bind(this),this.uninstall.bind(this));d.removePlugin(this);y="uninstalled";d.dispatchEvent(new g("uninstalled",x));return(new h).resolve()}}var a=/^http[s]?/i;return{Plugin:c,PluginRegistry:function(e,b){function i(a){var c=a.source;t.some(function(e){if(c===e.target){try{var b;if(typeof e.useStructuredClone===
"undefined"){var n=typeof a.data!=="string";b=n?a.data:JSON.parse(a.data);e.useStructuredClone=n}else b=e.useStructuredClone?a.data:JSON.parse(a.data);e.handler(b)}catch(g){}return!0}})}var b=b||{},j=b.storage||localStorage;j.getItem||(j=d(j));var p="installed",u,v=[],t=[],q=new k,w={},n={registerService:e.registerService.bind(e),connect:function(a,c,e,b){function n(a){a=Error(a);a.name="timeout";c({method:"timeout",error:a})}var g={handler:c,url:a},d=setTimeout(n.bind(null,"Load timeout for: "+a),
b||15E3),l=document.createElement("iframe");l.name=a+"_"+(new Date).getTime();l.src=a;l.onload=function(){clearTimeout(d);d=setTimeout(n.bind(null,"Plugin handshake timeout for: "+a),5E3)};l.sandbox="allow-scripts allow-same-origin";l.style.width=l.style.height="100%";l.frameBorder=0;(e||u).appendChild(l);g.target=l.contentWindow;g.close=function(){clearTimeout(d);if(l){var a=l.parentNode;a&&a.removeChild(l);l=null}};t.push(g);return g},disconnect:function(a){for(var c=0;c<t.length;c++)if(a===t[c]){t.splice(c,
1);try{a.close()}catch(e){}break}},removePlugin:function(a){for(var c=0;c<v.length;c++)if(a===v[c]){v.splice(c,1);break}j.removeItem("plugin."+a.getLocation())},persist:function(a,c){j.setItem("plugin."+a,JSON.stringify(c))},postMessage:function(a,c){c.target.postMessage(c.useStructuredClone?a:JSON.stringify(a),c.url)},dispatchEvent:function(a){try{q.dispatchEvent(a)}catch(c){console&&console.log("PluginRegistry.dispatchEvent "+c)}},loadManifest:function(a){var c=new h,e=n.connect(a,function(a){e&&
a.method&&("manifest"===a.method||"plugin"===a.method?(a=a.params[0],n.disconnect(e),e=null,c.resolve(a)):"timeout"===a.method&&(n.disconnect(e),e=null,c.reject(a.error)))});return c.promise},getState:function(){return p},handleServiceError:function(c,e){if(e&&e.status===401){var b=c.getHeaders(),n=c.getName()||c.getLocation(),g=document.createElement("span");g.appendChild(document.createTextNode("Authentication required for: "+n+"."));if(b.login)g.appendChild(document.createTextNode(" ")),n=document.createElement("a"),
n.target="_blank",n.textContent="Login",n.href=b.login,a.test(n.href)?(g.appendChild(n),g.appendChild(document.createTextNode(" and re-try the request."))):console.log("Illegal Login URL: "+b.login);return{Severity:"Error",HTML:!0,Message:(new XMLSerializer).serializeToString(g)}}if(e.__isError){var d=e,e=Error(d.message);Object.keys(d).forEach(function(a){e[a]=d[a]});delete e.__isError}return e}};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=n.getState;this.init=function(){if(!(p==="starting"||p==="active"||p==="stopping")){addEventListener("message",i,!1);for(var a=[],e=0,g=j.length;e<g;e++)a.push(j.key(e));a.forEach(function(a){if(a.indexOf("plugin.")===0){var e=a.substring(7),a=JSON.parse(j.getItem(a));a.created&&v.push(new c(e,a,n))}});v.sort(function(a,c){return a._getCreated()<c._getCreated()?-1:1});if(b.parent)u=b.parent;else{u=document.createElement("div");
if(!b.visible)u.style.display="none",u.style.visibility="hidden";document.body.appendChild(u)}b.plugins&&Object.keys(b.plugins).forEach(function(a){a=f(a);if(!this.getPlugin(a)){var e=b.plugins[a];typeof e!=="object"&&(e={});e.autostart=e.autostart||b.defaultAutostart||"lazy";v.push(new c(a,e,n))}}.bind(this));p="starting"}};this.start=function(){p!=="starting"&&this.init();if(p!=="starting")return(new h).reject("Cannot start framework. Framework is already "+p+".");var a=[],c=(new Date).getTime();
v.forEach(function(e){var b=e._getAutostart();e.getLastModified()===0?a.push(e.update().then(function(){if("started"===b)return e.start({"transient":!0});if("lazy"===b)return e.start({lazy:!0,"transient":!0});e._resolve()})):"started"===b?a.push(e.start({"transient":!0})):"lazy"===b?(a.push(e.start({lazy:!0,"transient":!0})),c>e.getLastModified()+864E5&&e.update()):e._resolve()});return h.all(a,function(a){console.log("PluginRegistry.stop "+a)}).then(function(){p="active"})};this.stop=function(){if(p!==
"starting"&&p!=="active")return(new h).reject("Cannot stop registry. Registry is already "+p+".");p="stopping";var a=[];v.forEach(function(c){a.push(c.stop({"transient":!0}))});return h.all(a,function(a){console.log("PluginRegistry.stop "+a)}).then(function(){if(!b.parent){var a=u.parentNode;a&&a.removeChild(u)}u=null;removeEventListener("message",i);p="resolved"})};this.update=function(){this.stop().then(this.start.bind(this))};this.uninstall=function(){return(new h).reject("Cannot uninstall registry")};
this.installPlugin=function(a,e){var a=f(a),b=this.getPlugin(a);if(b)return(new h).resolve(b);if(w[a])return w[a];if(e)return b=new c(a,e,n),v.push(b),b._persist(),n.dispatchEvent(new g("installed",b)),(new h).resolve(b);var d=n.loadManifest(a).then(function(e){b=new c(a,e,n);v.push(b);b._persist();delete w[a];n.dispatchEvent(new g("installed",b));return b},function(c){delete w[a];throw c;});return w[a]=d};this.getPlugins=function(){return v.slice()};this.getPlugin=function(a){var c=null,a=f(a);v.some(function(e){if(a===
e.getLocation())return c=e,!0});return c};this.addEventListener=q.addEventListener.bind(q);this.removeEventListener=q.removeEventListener.bind(q);this.resolvePlugins=function(){var a=!0;v.forEach(function(c){a=a&&c._resolve()});return a}}}});
define("orion/serviceTracker",[],function(){function h(f,d){function i(a){var c=a.getProperty("service.id"),b=this.addingService(a);b&&(g[c]=a,e[c]=b)}function b(a){var c=a.getProperty("service.id"),b=e[c];delete g[c];delete e[c];this.removedService(a,b)}this.serviceRegistry=f;var g={},e={},c=k,a,l;this.close=function(){if(c!==j)throw"Already closed";c=k;f.removeEventListener("registered",a);f.removeEventListener("unregistering",l);l=a=null;var e=this;this.getServiceReferences().forEach(function(a){b.call(e,
a)});if(typeof this.onClose==="function")this.onClose()};this.getServiceReferences=function(){var a=Object.keys(g);return!a.length?null:a.map(function(a){return g[a]})};this.open=function(){if(c!==k)throw"Already open";c=j;var e=this;a=function(a){if(a.serviceReference.getProperty("objectClass").indexOf(d)!==-1&&(i.call(e,a.serviceReference),typeof e.onServiceAdded==="function"))return e.onServiceAdded(a.serviceReference,e.serviceRegistry.getService(a.serviceReference))};l=function(a){a.serviceReference.getProperty("objectClass").indexOf(d)!==
-1&&b.call(e,a.serviceReference)};f.addEventListener("registered",a);f.addEventListener("unregistering",l);f.getServiceReferences(d).forEach(function(a){i.call(e,a);if(typeof e.onServiceAdded==="function")return e.onServiceAdded(a,f.getService(a))});if(typeof this.onOpen==="function")this.onOpen()}}var k=0,j=1;h.prototype={addingService:function(f){return this.serviceRegistry.getService(f)},onOpen:null,onClose:null,onServiceAdded:null,removedService:function(){}};return h});
define("orion/objects",[],function(){function h(h){for(var j=1;j<arguments.length;j++){var f=arguments[j],d;for(d in f)Object.prototype.hasOwnProperty.call(f,d)&&(h[d]=f[d])}return h}return{clone:function(k){if(Array.isArray(k))return Array.prototype.slice.call(k);var j=Object.create(Object.getPrototypeOf(k));h(j,k);return j},mixin:h,toArray:function(h){return Array.isArray(h)?h:[h]}}});
define("orion/config",["orion/Deferred","orion/serviceTracker","orion/objects"],function(h,k,j){var f,d,i,b,g,e="pid";f=function(a,c,b){function g(a,e,b){e.forEach(function(g,n){try{var d=a[n].getProperty("__plugin__"),f=d&&c.getPlugin(d);(!d||f&&f.getState()==="active")&&e[n].updated(b)}catch(i){typeof console!=="undefined"&&console.log(i)}})}k.call(this,a,"orion.cm.managedservice");var d={},f={},i=function(c){var g=[];c.plugin.getServiceReferences().forEach(function(c){if(c.getProperty("objectClass").indexOf("orion.cm.managedservice")!==
-1){var d=c.getProperty(e),c=a.getService(c);d&&c&&(d=(d=b._find(d))&&d.getProperties(),g.push(c.updated(d)))}});return h.all(g)};this.addingService=function(c){var b=c.getProperty(e),g=a.getService(c);if(!b||!g)return null;d[b]||(d[b]=[]);f[b]||(f[b]=[]);d[b].push(c);f[b].push(g);return g};this.onServiceAdded=function(a,c){var d=a.getProperty(e),d=b._find(d);g([a],[c],d&&d.getProperties())};this.onOpen=function(){c.addEventListener("started",i)};this.onClose=function(){c.removeEventListener("started",
i)};this.notifyUpdated=function(a){var c=a.getPid();g(d[c]||[],f[c]||[],a.getProperties())};this.notifyDeleted=function(a){a=a.getPid();g(d[a]||[],f[a]||[],null)};this.removedService=function(a,c){var b=a.getProperty(e),g=d[b],n=f[b];g.length>1?g.splice(g.indexOf(a),1):delete d[b];n.length>1?n.splice(n.indexOf(c),1):delete f[b]}};d=function(){function a(a,c,e){this.store=new i(this,e);this.configAdmin=new b(this,this.store);this.tracker=new f(a,c,this.store)}a.prototype={getConfigurationAdmin:function(){var a=
this;return this.configAdmin._init().then(function(c){a.tracker.open();return c})},notifyDeleted:function(a){this.tracker.notifyDeleted(a)},notifyUpdated:function(a){this.tracker.notifyUpdated(a)}};return a}();b=function(){function a(a,c){this.factory=a;this.store=c}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 c="/cm/configurations";
i=function(){function a(a,b){this.factory=a;this.prefsService=b;this.configs=Object.create(null);this.pref=null;var d=this;this.initPromise=this.prefsService.getPreferences(c).then(function(a){d.pref=a;a.keys().forEach(function(c){if(!d.configs[c]){var b=a.get(c);typeof b==="object"&&b!==null&&Object.keys(b).length>0&&(b[e]=c,d.configs[c]=new g(d.factory,d,b))}})})}a.prototype={_init:function(){return this.initPromise},_find:function(a){return this.configs[a]||null},get:function(a){var c=this._find(a);
c||(c=new g(this.factory,this,a),this.configs[a]=c);return c},list:function(){var a=this,c=[];this.pref.keys().forEach(function(e){(e=a._find(e))&&e.getProperties()!==null&&c.push(e)});return c},remove:function(a){this.pref.remove(a);delete this.configs[a]},save:function(a,c){this.pref.put(a,c.getProperties(!0)||{})}};return a}();g=function(){function a(a,c){c=j.clone(c);delete c[e];a.properties=c}function c(b,g,d){this.factory=b;this.store=g;if(d!==null&&typeof d==="object")this.pid=d[e],a(this,
d);else if(typeof d==="string")this.pid=d,this.properties=null;else throw Error("Invalid pid/properties "+d);}c.prototype={_checkRemoved:function(){if(this._removed)throw Error("Configuration was removed");},getPid:function(){this._checkRemoved();return this.pid},getProperties:function(a){this._checkRemoved();var c=null;if(this.properties&&(c=j.clone(this.properties),!a))c[e]=this.pid;return c},remove:function(){this._checkRemoved();this.factory.notifyDeleted(this);this.store.remove(this.pid);this._removed=
!0},update:function(c){this._checkRemoved();a(this,c);this.store.save(this.pid,this);this.factory.notifyUpdated(this)},toString:function(){return"[ConfigImpl pid: "+this.pid+", properties: "+JSON.stringify(this.properties)+"]"}};return c}();return{ConfigurationAdminFactory:d}});
define("orion/bootstrap","require,orion/Deferred,orion/serviceregistry,orion/preferences,orion/pluginregistry,orion/config".split(","),function(h,k,j,f,d,i){var b;return{startup:function(){if(b)return b;b=new k;var g=new j.ServiceRegistry,e=new f.PreferencesService(g);return e.getPreferences("/plugins").then(function(c){var a={plugins:{}};c.keys().forEach(function(e){var b=h.toUrl(e);a.plugins[b]=c[e]});var l=new d.PluginRegistry(g,a);return l.start().then(function(){if(g.getServiceReferences("orion.core.preference.provider").length>
0)return e.getPreferences("/plugins",e.USER_SCOPE).then(function(a){var c=[];a.keys().forEach(function(a){a=h.toUrl(a);l.getPlugin(a)||c.push(l.installPlugin(a,{autostart:"lazy"}).then(function(a){return a.update().then(function(){return a.start({lazy:!0})})}))});return k.all(c,function(a){console.log(a)})})}).then(function(){return(new i.ConfigurationAdminFactory(g,l,e)).getConfigurationAdmin().then(g.registerService.bind(g,"orion.cm.configadmin"))}).then(function(){var a=g.getService("orion.core.auth");
if(a){var c=a.getUser().then(function(c){if(c)localStorage.setItem("lastLogin",(new Date).getTime());else return a.getAuthForm(window.location.href).then(function(a){setTimeout(function(){window.location=a},0)})}),e=localStorage.getItem("lastLogin");if(!e||e<(new Date).getTime()-9E5)return c}}).then(function(){var a={serviceRegistry:g,preferences:e,pluginRegistry:l};b.resolve(a);return a})})}}});
define("orion/nls/root/messages",{Navigator:"Navigator",Sites:"Sites",Shell:"Shell",ShellLinkWorkspace:"Workspace Shell","Get Plugins":"Get Plugins",Global:"Global",Editor:"Editor",EditorRelatedLink:"Show Current Folder",EditorRelatedLinkParent:"Show Enclosing Folder",EditorLinkWorkspace:"Show Workspace",EditorRelatedLinkProj:"Show Project","Filter bindings":"Filter bindings","Orion Editor":"Orion Editor","Orion Image Viewer":"Orion Image Viewer","Orion Markdown Viewer":"Orion Markdown Viewer","Orion JSON Editor":"Orion JSON 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.":"I20140226-2325","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.",Browser:"Web Browser",OutlineProgress:"Getting outline for ${0} from ${1}",UnknownError:"An unknown error occurred.",UnknownWarning:"An unknown warning occurred.",Filter:"Filter (* = any string, ? = any character)",
"To view the browser's context menu, trigger the context menu again.":"To view the browser's context menu, trigger the context menu again.",Edit:"Edit",CentralNavTooltip:"Toggle Navigation Menu"});define("orion/nls/messages",["orion/i18n!orion/nls/messages","orion/nls/root/messages"],function(h,k){var j={root:k};Object.keys(h).forEach(function(f){typeof j[f]==="undefined"&&(j[f]=h[f])});return j});
define("orion/util",[],function(){var h=navigator.userAgent,k=h.indexOf("MSIE")!==-1||h.indexOf("Trident")!==-1?document.documentMode:void 0,j=parseFloat(h.split("Firefox/")[1]||h.split("Minefield/")[1])||void 0,f=h.indexOf("Opera")!==-1?parseFloat(h.split("Version/")[1]):void 0,d=parseFloat(h.split("Chrome/")[1])||void 0,i=h.indexOf("Safari")!==-1&&!d,b=parseFloat(h.split("WebKit/")[1])||void 0,g=h.indexOf("Android")!==-1,e=h.indexOf("iPad")!==-1,h=h.indexOf("iPhone")!==-1,c=e||h,a=navigator.platform.indexOf("Mac")!==
-1,l=navigator.platform.indexOf("Win")!==-1,m=navigator.platform.indexOf("Linux")!==-1,o="ontouchstart"in document.createElement("input");return{formatMessage:function(a){var c=arguments;return a.replace(/\$\{([^\}]+)\}/g,function(a,e){return c[(e<<0)+1]})},createElement:function(a,c){return a.createElementNS?a.createElementNS("http://www.w3.org/1999/xhtml",c):a.createElement(c)},isIE:k,isFirefox:j,isOpera:f,isChrome:d,isSafari:i,isWebkit:b,isAndroid:g,isIPad:e,isIPhone:h,isIOS:c,isMac:a,isWindows:l,
isLinux:m,isTouch:o,platformDelimiter:l?"\r\n":"\n"}});
define("orion/webui/littlelib",["orion/util"],function(h){function k(e,c){c||(c=document);return c.querySelectorAll(e)}function j(e){var c=e.tabIndex;c===0&&h.isIE&&!{a:!0,body:!0,button:!0,frame:!0,iframe:!0,img:!0,input:!0,isindex:!0,object:!0,select:!0,textarea:!0}[e.nodeName.toLowerCase()]&&!e.attributes.tabIndex&&(c=-1);return c}function f(e){if(j(e)>=0)return e;if(e.hasChildNodes())for(var c=0;c<e.childNodes.length;c++){var a=f(e.childNodes[c]);if(a)return a}return null}function d(e){if(j(e)>=
0)return e;if(e.hasChildNodes())for(var c=e.childNodes.length-1;c>=0;c--){var a=d(e.childNodes[c]);if(a)return a}return null}function i(e,c){if(e.nodeType===3){var a=b.exec(e.nodeValue);a&&a.length>1&&c(e,a)}if(e.hasChildNodes())for(a=0;a<e.childNodes.length;a++)i(e.childNodes[a],c)}var b=/\$\{([^\}]+)\}/,g=null;return{$:function(e,c){c||(c=document);return c.querySelector(e)},$$:k,$$array:function(e,c){return Array.prototype.slice.call(k(e,c))},node:function(e){var c=e;typeof e==="string"&&(c=document.getElementById(e));
return c},contains:function(e,c){if(!e||!c)return!1;if(e===c)return!0;var a=e.compareDocumentPosition(c);return Boolean(a&16)},bounds:function(e){e=e.getBoundingClientRect();return{left:e.left+document.documentElement.scrollLeft,top:e.top+document.documentElement.scrollTop,width:e.width,height:e.height}},empty:function(e){for(;e.hasChildNodes();)e.removeChild(e.firstChild)},firstTabbable:f,lastTabbable:d,stop:function(e){if(window.document.all)e.keyCode=0;e.preventDefault&&(e.preventDefault(),e.stopPropagation())},
processTextNodes:function(e,c){i(e,function(a,e){a.parentNode.replaceChild(document.createTextNode(c[e[1]]||e[1]),a)})},processDOMNodes:function(e,c){i(e,function(a,e){var b=c[e[1]];if(b){var g=document.createRange(),d=e.index;g.setStart(a,d);g.setEnd(a,d+e[0].length);g.deleteContents();g.insertNode(b)}})},addAutoDismiss:function(e,c){function a(a){g.forEach(function(c){var e=!1,b=c.excludeNodes.some(function(c){return document.body.contains(c)?(e=!0,c.contains(a.target)):!1});if(e&&!b)try{c.dismiss(a)}catch(g){typeof console!==
"undefined"&&console&&console.error(g&&g.message)}});g=g.filter(function(a){return a.excludeNodes.some(function(a){return document.body.contains(a)})})}g===null&&(g=[],document.addEventListener("click",a,!0),h.isIOS&&document.addEventListener("touchend",function(a){function c(){a.target.removeEventListener("click",c)}a.touches.length===0&&a.target.addEventListener("click",c)},!1));g.push({excludeNodes:e,dismiss:c})},setFramesEnabled:function(e){for(var c=document.getElementsByTagName("iframe"),a=
0;a<c.length;a++)c[a].parentNode.style.pointerEvents=e?"":"none"},removeAutoDismiss:function(e){g=g.filter(function(c){return e!==c.dismiss})},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(h){var k,j,f=["Msxml2.XMLHTTP","Microsoft.XMLHTTP","Msxml2.XMLHTTP.4.0"],d=/^\s*<\?xml(\s)+version=[\'\"](\d)*.(\d)*[\'\"](\s)*\?>/im,i=/<body[^>]*>\s*([\s\S]+)\s*<\/body>/im,b=typeof location!=="undefined"&&location.href,g=b&&location.protocol&&location.protocol.replace(/\:/,""),e=b&&location.hostname,c=b&&(location.port||void 0),a=[],l=h.config&&h.config()||{};k={version:"2.0.5",strip:function(a){if(a){var a=a.replace(d,""),c=a.match(i);c&&(a=c[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,c,e;if(typeof XMLHttpRequest!=="undefined")return new XMLHttpRequest;else if(typeof ActiveXObject!=="undefined")for(c=0;c<3;c+=1){e=f[c];try{a=new ActiveXObject(e)}catch(b){}if(a){f=[e];break}}return a},parseName:function(a){var c,
e,b=!1,g=a.indexOf(".");c=a.indexOf("./")===0||a.indexOf("../")===0;g!==-1&&(!c||g>1)?(c=a.substring(0,g),e=a.substring(g+1,a.length)):c=a;a=e||c;g=a.indexOf("!");g!==-1&&(b=a.substring(g+1)==="strip",a=a.substring(0,g),e?e=a:c=a);return{moduleName:c,ext:e,strip:b}},xdRegExp:/^((\w+)\:)?\/\/([^\/\\]+)/,useXhr:function(a,c,e,b){var g,d;g=k.xdRegExp.exec(a);if(!g)return!0;a=g[2];g=g[3];g=g.split(":");d=g[1];g=g[0];return(!a||a===c)&&(!g||g.toLowerCase()===e.toLowerCase())&&(!d&&!g||d===b)},finishLoad:function(c,
e,b,g){b=e?k.strip(b):b;l.isBuild&&(a[c]=b);g(b)},load:function(a,d,f,i){if(i.isBuild&&!i.inlineText)f();else{l.isBuild=i.isBuild;var h=k.parseName(a),i=h.moduleName+(h.ext?"."+h.ext:""),j=d.toUrl(i),t=l.useXhr||k.useXhr;!b||t(j,g,e,c)?k.get(j,function(c){k.finishLoad(a,h.strip,c,f)},function(a){f.error&&f.error(a)}):d([i],function(a){k.finishLoad(h.moduleName+"."+h.ext,h.strip,a,f)})}},write:function(c,e,b){if(a.hasOwnProperty(e)){var g=k.jsEscape(a[e]);b.asModule(c+"!"+e,"define(function () { return '"+
g+"';});\n")}},writeFile:function(a,c,e,b,g){var c=k.parseName(c),d=c.ext?"."+c.ext:"",l=c.moduleName+d,f=e.toUrl(c.moduleName+d)+".js";k.load(l,e,function(){var c=function(a){return b(f,a)};c.asModule=function(a,c){return b.asModule(a,f,c)};k.write(a,l,c,g)},g)}};if(l.env==="node"||!l.env&&typeof process!=="undefined"&&process.versions&&process.versions.node)j=require.nodeRequire("fs"),k.get=function(a,c){var e=j.readFileSync(a,"utf8");e.indexOf("\ufeff")===0&&(e=e.substring(1));c(e)};else if(l.env===
"xhr"||!l.env&&k.createXhr())k.get=function(a,c,e,b){var g=k.createXhr(),d;g.open("GET",a,!0);if(b)for(d in b)b.hasOwnProperty(d)&&g.setRequestHeader(d.toLowerCase(),b[d]);if(l.onXhr)l.onXhr(g,a);g.onreadystatechange=function(){var b;if(g.readyState===4)b=g.status,b>399&&b<600?(b=Error(a+" HTTP status: "+b),b.xhr=g,e(b)):c(g.responseText)};g.send(null)};else if(l.env==="rhino"||!l.env&&typeof Packages!=="undefined"&&typeof java!=="undefined")k.get=function(a,c){var e,b,g=new java.io.File(a),d=java.lang.System.getProperty("line.separator"),
g=new java.io.BufferedReader(new java.io.InputStreamReader(new java.io.FileInputStream(g),"utf-8")),l="";try{e=new java.lang.StringBuffer;(b=g.readLine())&&b.length()&&b.charAt(0)===65279&&(b=b.substring(1));for(b!==null&&e.append(b);(b=g.readLine())!==null;)e.append(d),e.append(b);l=String(e.toString())}finally{g.close()}c(l)};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(h,k,j){return{slideoutHTMLFragment:function(f){var d=document.createElement("div");d.innerHTML=j;var i=k.$("#slideContainer",d);i.id=f+i.id;i=k.$("#pageCommandParameters",d);i.id=f+i.id;i=k.$("#pageCommandDismiss",d);i.id=f+i.id;return d.innerHTML}}});
define("orion/keyBinding",["orion/util"],function(h){function k(f,d,i,b,g,e){this.type=e||"keydown";this.keyCode=typeof f==="string"&&this.type==="keydown"?f.toUpperCase().charCodeAt(0):f;this.mod1=d!==void 0&&d!==null?d:!1;this.mod2=i!==void 0&&i!==null?i:!1;this.mod3=b!==void 0&&b!==null?b:!1;this.mod4=g!==void 0&&g!==null?g:!1}function j(f){this.keys=f}k.prototype={getKeys:function(){return[this]},match:function(f,d){if(d!==void 0){if(d!==0)return!1}else if(f instanceof Array){if(f.length>1)return!1;
f=f[0]}return f.type!==this.type?!1:this.keyCode===f.keyCode||this.keyCode===String.fromCharCode(h.isOpera?f.which:f.charCode!==void 0?f.charCode:f.keyCode)?this.mod1!==(h.isMac?f.metaKey:f.ctrlKey)?!1:this.type==="keydown"&&this.mod2!==f.shiftKey?!1:this.mod3!==f.altKey?!1:h.isMac&&this.mod4!==f.ctrlKey?!1:!0:!1},equals:function(f){return!f?!1:this.keyCode!==f.keyCode?!1:this.mod1!==f.mod1?!1:this.mod2!==f.mod2?!1:this.mod3!==f.mod3?!1:this.mod4!==f.mod4?!1:this.type!==f.type?!1:!0}};j.prototype=
{getKeys:function(){return this.keys.slice(0)},match:function(f,d){var i=this.keys;if(d!==void 0)return d>i.length?!1:i[d].match(f)?d===i.length-1?!0:d+1:!1;else{f instanceof Array||(f=[f]);if(f.length>i.length)return!1;var b;for(b=0;b<f.length;b++)if(!i[b].match(f[b]))return!1;return b===i.length?!0:b}},equals:function(f){if(!f.keys)return!1;if(f.keys.length!==this.keys.length)return!1;for(var d=0;d<f.keys.length;d++)if(!f.keys[d].equals(this.keys[d]))return!1;return!0}};return{KeyBinding:k,KeyStroke:k,
KeySequence:j}});
define("orion/webui/dropdown",["require","orion/webui/littlelib","orion/EventTarget"],function(h,k,j){function f(d){j.attach(this);this._init(d)}f.prototype={_init:function(d){this._dropdownNode=k.node(d.dropdown);if(!this._dropdownNode)throw"no dom node for dropdown found";this._populate=d.populate;this._selectionClass=d.selectionClass;this._parentDropdown=d.parentDropdown;this._positioningNode=d.positioningNode;if(!this._parentDropdown)for(var f=this._dropdownNode.parentNode;f&&document!==f;){if(f.classList&&
f.classList.contains("dropdownMenu")){this._parentDropdown=f.dropdown;break}f=f.parentNode}this._triggerNode=d.triggerNode?d.triggerNode:k.$(".dropdownTrigger",this._dropdownNode.parentNode);if(!this._triggerNode)throw"no dom node for dropdown trigger found";if(!d.skipTriggerEventListeners){var b=this;this._triggerNode.addEventListener("click",function(g){b.toggle(g)&&k.stop(g)},!1);this._triggerNode.tagName.toLowerCase()==="span"&&this._triggerNode.addEventListener("keydown",function(g){if(g.keyCode===
k.KEY.ENTER||g.keyCode===k.KEY.SPACE)b.toggle(),k.stop(g)},!1)}this._dropdownNode.addEventListener("keydown",this._dropdownKeyDown.bind(this),!1)},addTriggerNode:function(d){var f=this;d.addEventListener("click",function(b){f.toggle(b)&&k.stop(b)},!1)},toggle:function(d){return this.isVisible()?this.close():this.open(d)},isVisible:function(){return this._isVisible},open:function(d){var f=!1;if(!this.isVisible()){this.dispatchEvent({type:"triggered",dropdown:this,event:d});k.setFramesEnabled(!1);this._populate&&
(this.empty(),this._populate(this._dropdownNode));var b=this.getItems();if(b.length>0){if(!this._hookedAutoDismiss)this._boundAutoDismiss?k.removeAutoDismiss(this._boundAutoDismiss):this._boundAutoDismiss=this._autoDismiss.bind(this),f=k.$$array(".dropdownSubMenu",this._dropdownNode),k.addAutoDismiss([this._triggerNode].concat(f),this._boundAutoDismiss),this._hookedAutoDismiss=!0;this._triggerNode.classList.add("dropdownTriggerOpen");this._selectionClass&&this._triggerNode.classList.add(this._selectionClass);
this._dropdownNode.classList.add("dropdownMenuOpen");this._isVisible=!0;this._positionDropdown(d);b[0].focus();f=!0;this._parentDropdown&&this._parentDropdown.submenuOpen(this)}}return f},_autoDismiss:function(d){if(this.close(!1)&&this._dropdownNode.contains(d.target))for(d=this._parentDropdown;d;)d.close(!1),d=d._parentDropdown},_positionDropdown:function(){this._dropdownNode.style.left="";this._dropdownNode.style.top="";if(this._positioningNode)this._dropdownNode.style.left=this._positioningNode.offsetLeft+
"px";else{var d=k.bounds(this._dropdownNode),f=k.bounds(document.body);if(d.left+d.width>f.left+f.width)if(this._triggerNode.classList.contains("dropdownMenuItem"))this._dropdownNode.style.left=-d.width+"px";else{var b=k.bounds(this._boundingNode(this._triggerNode)),g=k.bounds(this._triggerNode);this._dropdownNode.style.left=g.left-b.left-d.width+g.width+"px"}d=d.top+d.height-(f.top+f.height);if(0<d)this._dropdownNode.style.top=Math.floor(this._dropdownNode.style.top-d)+"px"}},_boundingNode:function(d){var f=
window.getComputedStyle(d,null);return f===null?d:f.getPropertyValue("position")==="absolute"||!d.parentNode||d===document.body?d:this._boundingNode(d.parentNode)},close:function(d){var f=!1;if(this.isVisible())this._triggerNode.classList.remove("dropdownTriggerOpen"),this._selectionClass&&this._triggerNode.classList.remove(this._selectionClass),this._dropdownNode.classList.remove("dropdownMenuOpen"),k.setFramesEnabled(!0),d&&this._triggerNode.focus(),this._isVisible=!1,f=!0;return f},getItems:function(){var d=
[],f=this;k.$$array("li:not(.dropdownSeparator) > .dropdownMenuItem",this._dropdownNode,!0).forEach(function(b){b.parentNode.parentNode===f._dropdownNode&&d.push(b)});d.forEach(function(b){if(!b._hasDropdownMouseover)b.addEventListener("mouseover",function(g){b.dropdown?b.dropdown.open(g):(f._closeSelectedSubmenu(),k.stop(g))}),b._hasDropdownMouseover=!0});return d},empty:function(){var d=this;k.$$array("li",this._dropdownNode).forEach(function(f){f.parentNode===d._dropdownNode&&f.parentNode.removeChild(f)});
this._hookedAutoDismiss=!1},_dropdownKeyDown:function(d){if(d.keyCode===k.KEY.UP||d.keyCode===k.KEY.DOWN||d.keyCode===k.KEY.RIGHT||d.keyCode===k.KEY.ENTER||d.keyCode===k.KEY.LEFT){var f=this.getItems(),b=document.activeElement;if(f.length&&f.length>0&&b){var g=f.indexOf(b);g<0&&(g=f.indexOf(b.parentNode));g>=0&&(d.keyCode===k.KEY.UP&&g>0?(g--,f[g].focus()):d.keyCode===k.KEY.DOWN&&g<f.length-1?(g++,f[g].focus()):d.keyCode===k.KEY.ENTER||d.keyCode===k.KEY.RIGHT?b.classList.contains("dropdownTrigger")&&
b.dropdown&&b.dropdown.open():d.keyCode===k.KEY.LEFT&&b.parentNode.parentNode.classList.contains("dropdownMenuOpen")&&this.close(!0),k.stop(d))}}else d.keyCode===k.KEY.ESCAPE&&(this.close(!0),k.stop(d))},submenuOpen:function(d){if(d!==this._selectedSubmenu)this._closeSelectedSubmenu(),this._selectedSubmenu=d},_closeSelectedSubmenu:function(){for(var d=this._selectedSubmenu;d;)d.close(),d=d._selectedSubmenu},destroy:function(){this.empty();this._boundAutoDismiss&&k.removeAutoDismiss(this._boundAutoDismiss)}};
f.prototype.constructor=f;return{Dropdown:f}});define("text!orion/webui/dropdowntriggerbutton.html",[],function(){return'<button class="dropdownTrigger">${ButtonText}<\!--span class="dropdownArrowDown core-sprite-openarrow"></span--\></button><ul class="dropdownMenu"></ul>'});define("text!orion/webui/dropdowntriggerbuttonwitharrow.html",[],function(){return'<button class="dropdownTrigger dropdownDefaultButton">${ButtonText}<span class="dropdownArrowDown core-sprite-openarrow"></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"><span class="dropdownCommandName">${ButtonText}</span><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(h,k){function j(f){this._init(f)}j.prototype={_init:function(f){this._node=k.node(f.node);if(!this._node)throw"no dom node for tooltip found";this._position=f.position||["right","above","below","left"];this._text=f.text;this._hideDelay=f.hideDelay===void 0?200:f.hideDelay;this._tailSize=f.tailSize||10;this._trigger=f.trigger||"mouseover";this._afterShowing=f.afterShowing;this._afterHiding=f.afterHiding;var d=this;if(this._trigger===
"click")this._showDelay=0,this._node.addEventListener("click",this._clickHandler=function(b){b.target===d._node&&(d.show(),k.stop(b))},!1);else if(this._trigger==="mouseover"){this._showDelay=f.showDelay===void 0?500:f.showDelay;f=["mouseout","click"];this._node.addEventListener("mouseover",this._mouseoverHandler=function(b){k.contains(d._node,b.target)&&(d.show(),k.stop(b))},!1);this._leaveHandler=function(b){k.contains(d._node,b.target)&&d.hide()};for(var i=0;i<f.length;i++)this._node.addEventListener(f[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 f=this;k.addAutoDismiss([this._tip,this._node],function(){f.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(f._timeout)window.clearTimeout(f._timeout),f._timeout=null;f._tip.addEventListener("mouseout",function(d){k.contains(f._tip,d.target)&&(f.hide(),k.stop(d))},
!1)},!1)}return this._tip},_positionTip:function(f,d){this._makeTipNode();f==="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),g;switch(f){case "above":g=b.top-i.height-this._tailSize-1;b=b.left-this._tailSize;break;case "below":g=b.top+b.height+this._tailSize+1;b=b.left-this._tailSize;break;case "left":g=b.top-this._tailSize/2;b=b.left-i.width-
this._tailSize-1;break;default:g=b.top-this._tailSize/2,b=b.left+b.width+this._tailSize+1}var e=k.bounds(document.documentElement);if(g+i.height>e.height)if(d)g=e.height-i.height-1;else return!1;if(b+i.width>e.width)if(d)b=e.width-i.width-1;else return!1;if(b<0)if(d)b=4;else return!1;if(g<0)if(d)g=4;else return!1;if(this._tail&&this._tail.previousPosition!==f)this._tip.removeChild(this._tail),this._tail=null;if(!this._tail){this._tail=document.createElement("span");this._tail.classList.add("tooltipTailFrom"+
f);f==="above"||f==="left"?this._tip.appendChild(this._tail):this._tip.insertBefore(this._tail,this._tipInner);if(f==="left")this._tail.style.left=i.width+"px";this._tail.previousPosition=f}this._tip.style.top=g+"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")){if(this._timeout)window.clearTimeout(this._timeout),this._timeout=null;this._showDelay?this._timeout=
window.setTimeout(this._showImmediately.bind(this),this._showDelay):this._showImmediately()}},_showImmediately:function(){for(var f=!1,d=0;!f&&d<this._position.length;)f=this._positionTip(this._position[d]),d++;f||this._positionTip(this._position[0],!0);this._tip.classList.add("tooltipShowing");this._afterShowing&&this._afterShowing()},hide:function(f){if(this._timeout)window.clearTimeout(this._timeout),this._timeout=null;if(this._tip&&this._tip.classList.contains("tooltipShowing")){if(f===void 0)f=
this._hideDelay;var d=this;this._timeout=window.setTimeout(function(){d._tip.classList.remove("tooltipShowing");d._tip.removeAttribute("style");d._afterHiding&&d._afterHiding()},f)}},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 f=["mouseout","click"],d=0;d<f.length;d++)this._node.removeEventListener(f[d],this._leaveHandler,!1)}}};j.prototype.constructor=j;return{Tooltip:j}});
define("orion/commands","orion/util,orion/webui/littlelib,orion/webui/dropdown,text!orion/webui/dropdowntriggerbutton.html,text!orion/webui/dropdowntriggerbuttonwitharrow.html,text!orion/webui/submenutriggerbutton.html,text!orion/webui/checkedmenuitem.html,orion/webui/tooltip".split(","),function(h,k,j,f,d,i,b,g){function e(a){var c=a.invocation;if(c){var e=a.command;if(e.hrefCallback)return a=e.hrefCallback.call(c.handler||window,c),a.then?a.then(function(a){window.open(a)}):window.open(a),!0;else if(c.commandRegistry)return c.commandRegistry._invoke(c),
!0;else if(e.onClick||e.callback)return window.setTimeout(function(){(e.onClick||e.callback).call(c.handler||window,c)},0),!0}return!1}function c(a,c){for(var b in c)if(c[b]&&c[b].keyBinding&&c[b].command&&c[b].keyBinding.match(a)){var g=c[b],d=g.keyBinding;if((!d.domScope||k.contains(k.node(d.domScope),a.target))&&e(g)){k.stop(a);break}}}function a(){var a={};if(t){var c,e,b;e=Object.keys(q);for(c=0;c<e.length;c++)b=e[c],a[b]=q[b];var g=t();e=Object.keys(g);for(c=0;c<e.length;c++)b=e[c],a[b]=g[b]}else a=
q;return a}function l(e){c(e,a())}function m(a,c){a=a||window.event;if(function(a){if(h.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;if(a.ctrlKey)return!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 e=a.target.nodeName.toLowerCase();if(e==="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(e==="textarea")return}c?c(a):l(a)}function o(){this._init()}
function s(a,c,e){c.classList.add("commandImage");var b;a.imageClass?a.addImageClassToElement?c.classList.add(a.imageClass):(b=document.createElement("span"),c.appendChild(b),b.classList.add(a.spriteClass),b.classList.add(a.imageClass)):(b=new Image,b.alt=a.name,b.name=e,b.id=e,b.src=a.image,c.appendChild(b));return b}function p(a,c){var e=document.createElement("span");e.classList.add("dropdownKeyBinding");e.appendChild(document.createTextNode(c));a.appendChild(e)}function u(a,c,e,b,g){this.commandRegistry=
g;this.handler=a;this.items=c;this.userData=e;this.command=b;if(b.parameters)this.parameters=b.parameters.makeCopy();this.id=b.id}function v(a){this._init(a)}var t=null,q={};o.prototype={setProxy:function(a){this.proxy=a},setKeyBindings:function(a){this.bindings=a},_init:function(){var a=this;document.addEventListener("keydown",function(c){return m(c,function(c){var e=a.proxy,b=a.bindings;if(b&&e)for(var g=0;g<b.length;g++)b[g].match(c)&&(e.processKey({type:c.type,keyCode:c.keyCode,altKey:c.altKey,
ctrlKey:c.ctrlKey,metaKey:c.metaKey,shiftKey:c.shiftKey}),k.stop(c))})})}};window.document.addEventListener("keydown",m,!1);u.prototype={collectsParameters:function(){return this.commandRegistry&&this.commandRegistry.collectsParameters()},makeCopy:function(a){var c=new u(this.handler,this.items,this.userData,this.command,this.commandRegistry);c.domNode=this.domNode;c.domParent=this.domParent;if(a)c.parameters=a.makeCopy();else if(this.parameters)c.parameters=this.parameters.makeCopy();return c}};
u.prototype.constructor=u;v.prototype={_init:function(a){this.id=a.id;this.name=a.name;this.tooltip=a.tooltip;this.callback=a.callback;this.hrefCallback=a.hrefCallback;this.choiceCallback=a.choiceCallback;this.positioningNode=a.positioningNode;this.image=a.image||"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQAQMAAAAlPW0iAAAAA1BMVEUAAACnej3aAAAAAXRSTlMAQObYZgAAAAtJREFUCNdjIBEAAAAwAAFletZ8AAAAAElFTkSuQmCC";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;this.isEditor=a.isEditor},populateChoicesMenu:function(a,c,e,b,g){var e=this.getChoices(c,e,b),d=e.some(function(a){return a.checked});e.forEach(function(e){if(e.name){var b=document.createElement("li");a.appendChild(b);var r=document.createElement("span");r.tabIndex=0;r.role="menuitem";r.classList.add("dropdownMenuItem");if(d){var f=document.createElement("span");f.classList.add("check");
f.appendChild(document.createTextNode(e.checked?"\u25cf":""));r.appendChild(f)}f=document.createTextNode(e.name);r.appendChild(f);b.appendChild(r);r.choice=e;r.addEventListener("click",function(a){a.target.choice&&a.target.choice.callback.call(a.target.choice,c)},!1);r.addEventListener("keydown",function(a){(a.keyCode===k.KEY.ENTER||a.keyCode===k.KEY.SPACE)&&a.target.choice&&a.target.choice.callback.call(a.target.choice,c)},!1)}else g._generateMenuSeparator(a)})},getChoices:function(a,c,e){return this.choiceCallback?
this.choiceCallback.call(c,a,e):null},makeChoiceCallback:function(a,c){return function(e){a.callback&&a.callback.call(a,c,e)}},hasImage:function(){return this.imageClass||this.image!=="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQAQMAAAAlPW0iAAAAA1BMVEUAAACnej3aAAAAAXRSTlMAQObYZgAAAAtJREFUCNdjIBEAAAAwAAFletZ8AAAAAElFTkSuQmCC"}};v.prototype.constructor=v;return{Command:v,CommandInvocation:u,createDropdownMenu:function(a,c,e,b,g,l,i,m,h){a=k.node(a);if(!a)throw"no parent node was specified";
var o=document.createRange();o.selectNode(a);o=h?o.createContextualFragment(d):o.createContextualFragment(f);k.processTextNodes(o,{ButtonText:c});a.appendChild(o);var a=a.lastChild,p;h?(h=a.previousSibling,p=h.lastChild):h=a.previousSibling;b?h.classList.add(b):(h.classList.add("orionButton"),h.classList.add("commandButton"));if(g){if(!l)h.textContent="",h.setAttribute("aria-label",c);s({spriteClass:"commandSprite",imageClass:g},h,c);h.classList.add("orionButton")}h.dropdown=new j.Dropdown({dropdown:a,
populate:e,selectionClass:i,skipTriggerEventListeners:!!p,positioningNode:m});a.dropdown=h.dropdown;return{menuButton:h,menu:a,dropdown:h.dropdown,dropdownArrow:p}},createCheckedMenuItem:function(a,c,e,g){a=k.node(a);if(!a)throw"no parent node was specified";var d=document.createRange();d.selectNode(a);d=d.createContextualFragment(b);k.processTextNodes(d,{ItemText:c});a.appendChild(d);a=k.$(".checkedMenuItem",a.lastChild);a.checked=e;a.addEventListener("change",g,!1);return a},createCommandItem:function(a,
c,e,b,d,f,l){var i,f=f||!c.name&&c.hasImage();if(c.hrefCallback)i=document.createElement("a"),i.id=b,f&&c.hasImage()?s(c,i,b):(i.className="commandLink",i.appendChild(document.createTextNode(c.name))),l=c.hrefCallback.call(e.handler,e),l.then?l.then(function(a){i.href=a}):i.href=l?l:"#";else{i=document.createElement("button");i.className="orionButton";f?c.hasImage()?(s(c,i,b),c.name&&i.setAttribute("aria-label",c.name)):(i.classList.add("commandButton"),i.classList.add("commandMissingImageButton"),
i.appendChild(document.createTextNode(c.name))):(i.classList.add("commandButton"),b=document.createTextNode(c.name),i.appendChild(b));var m=l||c.callback;if(m)c.onClick=m,i.addEventListener("click",function(){m.call(e.handler,e)},!1)}a.nodeName.toLowerCase()==="ul"?(l=document.createElement("li"),a.appendChild(l),a=l):i.classList.add("commandMargins");a.appendChild(i);if(c.tooltip)i.commandTooltip=new g.Tooltip({node:i,text:c.tooltip,position:["above","below","right","left"]});d&&(q[c.id]={keyBinding:d,
command:c,invocation:e});return i},createCommandMenuItem:function(a,c,e,b,d,f){var l,i=a.dropdown;if(c.hrefCallback){l=document.createElement("a");var m=document.createElement("span");m.appendChild(document.createTextNode(c.name));m.classList.add("dropdownCommandName");l.appendChild(m);d=c.hrefCallback.call(e.handler,e);d.then?d.then(function(a){l.href=a}):l.href=d?d:"#";l.addEventListener("keydown",function(a){(a.keyCode===k.KEY.ENTER||a.keyCode===k.KEY.SPACE)&&l.click()},!1)}else{l=document.createElement("span");
l.tabIndex=0;m=document.createElement("span");m.appendChild(document.createTextNode(c.name));m.classList.add("dropdownCommandName");l.appendChild(m);var h=d||c.callback;if(h)c.onClick=h,l.addEventListener("click",function(){i.close(!0);h.call(e.handler,e)},!1),l.addEventListener("keydown",function(a){if(a.keyCode===k.KEY.ENTER||a.keyCode===k.KEY.SPACE)a.preventDefault(),l.click()},!1)}l.className="dropdownMenuItem";l.role="menuitem";if(c.tooltip)l.commandTooltip=new g.Tooltip({node:l,text:c.tooltip,
position:["above","below","right","left"]});f&&p(l,f);f=document.createElement("li");a.appendChild(f);f.appendChild(l);b&&(q[c.id]={keyBinding:b,command:c,invocation:e});return l},executeBinding:e,setKeyBindingProvider:function(a){t=a},localKeyBindings:q,CommandsProxy:o,getKeyBindings:a,processKey:l,NO_IMAGE:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQAQMAAAAlPW0iAAAAA1BMVEUAAACnej3aAAAAAXRSTlMAQObYZgAAAAtJREFUCNdjIBEAAAAwAAFletZ8AAAAAElFTkSuQmCC",_testMethodProcessKey:c}});
define("orion/explorers/navigationUtils",[],function(){function h(h,f){if(!k&&h)h.push({domNode:f}),f.tabIndex=-1,f.style.outline="none"}var k=navigator.userAgent.indexOf("iPad")!==-1;return{addNavGrid:function(j,f,d){j&&(j=j.getGridNavHolder(f,!0))&&h(j,d)},generateNavGrid:h,removeNavGrid:function(h,f){if(h)for(var d=0;d<h.length;d++)if(h[d].domNode===f){h.splice(d,1);break}}}});
define("orion/PageUtil",[],function(){var h=/^http[s]?/i;return{hash:function(){var h=window.location.href.split("#")[1];return h?"#"+h:""},matchResourceParameters:function(h){var h=h||window.location.toString(),j={resource:""},f=h.indexOf("#");if(f!==-1&&(h=h.substring(f+1),h.length!==0)){h=h.split(",");j.resource=decodeURIComponent(h[0]);for(f=1;f<h.length;f++){var d=/([^=]*)(=?)(.*)/.exec(h[f]),i=decodeURIComponent(d[1]||""),d=decodeURIComponent(d[3]||"");i!==""&&i!=="resource"&&(j[i]=d)}}return j},
validateURLScheme:function(k,j){var f=k;if(k.indexOf("://")===-1){var d=document.createElement("a");d.href=k;f=d.href}d=!1;return(d=j?j.some(function(d){return RegExp("^"+d+":","i").test(f)}):h.test(f))?k:(console.log("Illegal URL Scheme: '"+k+"'"),"")}}});
define("orion/uiUtils",["orion/webui/littlelib"],function(h){function k(f){var d="",i=navigator.platform.indexOf("Mac")!==-1;i?(f.mod4&&(d+="\u2303"),f.mod3&&(d+="\u2325"),f.mod2&&(d+="\u21e7"),f.mod1&&(d+="\u2318")):(f.mod1&&(d+="Ctrl+"),f.mod2&&(d+="Shift+"),f.mod3&&(d+="Alt+"));if(f.alphaKey)return d+f.alphaKey;if(f.type==="keypress")return d+f.keyCode;for(var b in h.KEY)if(typeof(h.KEY[b]==="number")&&h.KEY[b]===f.keyCode){if(i)switch(h.KEY[b]){case h.KEY.BKSPC:b="\u232b";break;case h.KEY.TAB:b=
"\u21e5";break;case h.KEY.ENTER:b="\u23ce";break;case h.KEY.ESCAPE:b="\u238b";break;case h.KEY.SPACE:b="\u2423";break;case h.KEY.PAGEUP:b="\u21de";break;case h.KEY.PAGEDOWN:b="\u21df";break;case h.KEY.END:b="\u21f2";break;case h.KEY.HOME:b="\u21f1";break;case h.KEY.DEL:b="\u2326"}switch(h.KEY[b]){case h.KEY.DOWN:b="\u2193";break;case h.KEY.UP:b="\u2191";break;case h.KEY.RIGHT:b="\u2192";break;case h.KEY.LEFT:b="\u2190"}return d+b}var g;switch(f.keyCode){case 59:g=f.mod2?":":";";break;case 61:g=f.mod2?
"+":"=";break;case 188:g=f.mod2?"<":",";break;case 190:g=f.mod2?">":".";break;case 191:g=f.mod2?"?":"/";break;case 192:g=f.mod2?"~":"`";break;case 219:g=f.mod2?"{":"[";break;case 220:g=f.mod2?"|":"\\";break;case 221:g=f.mod2?"}":"]";break;case 222:g=f.mod2?'"':"'"}return g?d+g:f.keyCode>=112&&f.keyCode<=123?d+"F"+(f.keyCode-111):d+String.fromCharCode(f.keyCode)}function j(f){var d=window.navigator.platform.indexOf("Mac")!==-1;return d&&f.metaKey||!d&&f.ctrlKey}return{getUserKeyString:function(f){for(var d=
"",f=f.getKeys(),i=0;i<f.length;i++)i!==0&&(d+=" "),d+=k(f[i]);return d},getUserText:function(f){var d=f.id,i=f.refNode,b=f.hideRefNode,g=f.initialText,e=f.onComplete,c=f.onEditDestroy,a=f.selectTo,l=f.isInitialValid,f=f.insertAsChild,m=!1,o=function(a){return function(f){if(!m){var o=h.node(d),j=o.value;if(o)if(a&&f.keyCode===h.KEY.ESCAPE){if(b)i.style.display="inline";m=!0;o.parentNode.removeChild(o);c&&c()}else if(!(a&&f.keyCode!==h.KEY.ENTER)){if(j.length===0||!l&&j===g){if(b)i.style.display=
"inline"}else if(e(j),b&&i.parentNode)i.style.display="inline";m=!0;o.parentNode&&o.parentNode.removeChild(o);c&&c()}}}},j=document.createElement("input");j.id=d;j.value=g||"";f?i.appendChild(j):i.parentNode.insertBefore(j,i.nextSibling);j.classList.add("userEditBoxPrompt");if(b)i.style.display="none";j.addEventListener("keydown",o(!0),!1);j.addEventListener("blur",o(!1),!1);window.setTimeout(function(){j.focus();if(g){var c=h.node(d),e=a?g.indexOf(a):-1;if(e>0)if(c.createTextRange)c=c.createTextRange(),
c.collapse(!0),c.moveStart("character",0),c.moveEnd("character",e),c.select();else if(c.setSelectionRange)c.setSelectionRange(0,e);else{if(c.selectionStart!==void 0)c.selectionStart=0,c.selectionEnd=e}else c.select()}},0)},openInNewWindow:j,followLink:function(f,d){d&&j(d)?window.open(f):window.location=f},createButton:function(f,d){var i=document.createElement("button");i.className="orionButton commandButton commandMargins";i.addEventListener("click",function(b){d();h.stop(b)},!1);f&&i.appendChild(document.createTextNode(f));
return i},createDropdownButton:function(){},isFormElement:function(f){switch(f.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","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(h,k,j,f,d,i,b,g,e,c){function a(a){this._commandList={};this._contributionsByScopeId={};this._activeBindings={};this._urlBindings={};this._pendingBindings={};this._init(a);this._parameterCollector=
null}function l(a,c){this.token=a;this.parameterName=c}function m(a,c,e){this.event=a;this.handler=c;this.capture=e||!1}function o(a,c,e,b,g,d){this.name=a;this.type=c;this.label=e;this.value=b;this.lines=g||1;this.eventListeners=Array.isArray(d)?d:d?[d]:[]}function s(a,c,e){this._storeParameters(a);this._hasOptionalParameters=c&&c.hasOptionalParameters;this._options=c;this.optionsRequested=!1;this.getParameters=e;this.clientCollect=c&&c.clientCollect}a.prototype={_init:function(a){this._selectionService=
a.selection;var c=this;h.setKeyBindingProvider(function(){return c._activeBindings})},processURL:function(a){for(var c in this._urlBindings)if(this._urlBindings[c]&&this._urlBindings[c].urlBinding&&this._urlBindings[c].command){var e=this._urlBindings[c].urlBinding.match(a);if(e){var b=this._urlBindings[c],g=b.command,d=b.invocation;if(d&&d.parameters&&g.callback){d.parameters.setValue(e.parameterName,e.parameterValue);var n=this;window.setTimeout(function(){n._invoke(d)},0);break}}}},findCommand:function(a){return this._commandList[a]},
runCommand:function(a,c,e,b){c?(a=this._commandList[a])&&(a.visibleWhen?a.visibleWhen(c):1)&&a.callback&&this._invoke(new h.CommandInvocation(e,c,null,a,this),b):(c=this._urlBindings[a])&&c.command&&c.command.callback&&this._invoke(c.invocation,b)},getSelectionService:function(){return this._selectionService},setParameterCollector:function(a){this._parameterCollector=a},openParameterCollector:function(a,c,e){this._parameterCollector&&(this._parameterCollector.close(),this._parameterCollector.open(a,
c,e))},confirm:function(a,c,e,b,g,d){var n=!1;if(this._parameterCollector&&!g){var r=this;this._parameterCollector.close();if(this._parameterCollector.open(a,function(a,g){var d=document.createElement("span");d.classList.add("parameterPrompt");d.textContent=c;a.appendChild(d);d=document.createElement("button");d.addEventListener("click",function(){n=!0;r._parameterCollector.close()},!1);g.appendChild(d);d.appendChild(document.createTextNode(e));d.className="dismissButton";var f=document.createElement("button");
f.addEventListener("click",function(){n=!1;r._parameterCollector.close()},!1);g.appendChild(f);f.appendChild(document.createTextNode(b));f.className="dismissButton";return d},function(){d(n)}))return}n=window.confirm(c);d(n)},closeParameterCollector:function(){this._parameterCollector&&this._parameterCollector.close()},collectsParameters:function(){return this._parameterCollector},_invoke:function(a,c){return this._collectAndInvoke(a.makeCopy(c),!1)},_collectAndInvoke:function(a,c){if(a)if(this._parameterCollector&&
a.parameters&&a.parameters.hasParameters()&&(c||a.parameters.shouldCollectParameters())){var e=!1;a.parameters.updateParameters(a);if(a.parameters.shouldCollectParameters()&&(e=this._parameterCollector.collectParameters(a),!e)){var g=new b.Tooltip({node:a.domNode,afterHiding:function(){this.destroy()},trigger:"click",position:["below","right","above","left"]}),e=g.contentContainer();e.classList.add("parameterPopup");var d=window.document.activeElement,f=this._parameterCollector.getFillFunction(a,
function(){d&&d.focus();g.destroy()})(e);g.show();window.setTimeout(function(){f.focus();f.select()},0);e=!0}e||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 c(a){return function(){h.executeBinding(a)}}var e={},b,g,d=[],n;for(n in this._activeBindings)(g=
this._activeBindings[n])&&g.keyBinding&&g.command&&(g.command.name||g.command.tooltip)&&d.push(g);d.sort(function(a,c){return(a.command.name||a.command.tooltip).localeCompare(c.command.name||c.command.tooltip)});for(n=0;n<d.length;n++)g=d[n],g.keyBinding.scopeName?(e[g.keyBinding.scopeName]||(e[g.keyBinding.scopeName]=[]),e[g.keyBinding.scopeName].push(g)):(b=f.getUserKeyString(g.keyBinding),a.createItem(b,g.command.name||g.command.tooltip,c(g)));for(var r in e)e[r].length&&e[r].length>0&&(a.createHeader(r),
e[r].forEach(function(e){b=f.getUserKeyString(e.keyBinding);a.createItem(b,e.command.name||e.command.tooltip,c(e))}))},addCommand:function(a){this._commandList[a.id]=a;var c=this._pendingBindings[a.id];if(c){var e=this;c.forEach(function(c){e._addBinding(a,c.type,c.binding,c.bindingOnly)});delete this._pendingBindings[a.id]}},addCommandGroup:function(a,c,e,b,g,d,n,r,f,l){this._contributionsByScopeId[a]||(this._contributionsByScopeId[a]={});a=this._contributionsByScopeId[a];g&&(a=this._createEntryForPath(a,
g));if(a[c]){if(b)a[c].title=b;if(e)a[c].position=e;if(n)a[c].imageClass=n;if(r)a[c].tooltip=r;if(f)a[c].selectionClass=f;l===!0?a[c].pretendDefaultActionId=!0:a[c].defaultActionId=l;a[c].emptyGroupMessage=d}else a[c]={title:b,position:e,emptyGroupMessage:d,imageClass:n,tooltip:r,selectionClass:f,defaultActionId:l===!0?null:l,pretendDefaultActionId:l===!0,children:{}},a.sortedContributions=null},_createEntryForPath:function(a,c){c&&c.split("/").forEach(function(c){if(c.length>1){if(!a[c])a[c]={position:0,
children:{}},a.sortedContributions=null;a=a[c].children}});return a},registerSelectionService:function(a,c){this._contributionsByScopeId[a]||(this._contributionsByScopeId[a]={});this._contributionsByScopeId[a].localSelectionService=c},registerCommandContribution:function(a,c,e,b,g,d,n){this._contributionsByScopeId[a]||(this._contributionsByScopeId[a]={});a=this._contributionsByScopeId[a];b&&(a=this._createEntryForPath(a,b));a[c]={position:e};d&&((e=this._commandList[c])?this._addBinding(e,"key",d,
g):this._addPendingBinding(c,"key",d,g));n&&((e=this._commandList[c])?this._addBinding(e,"url",n,g):this._addPendingBinding(c,"url",n,g));a.sortedContributions=null},unregisterCommandContribution:function(a,c,e){if(this._contributionsByScopeId[a]){delete this._commandList[c];delete this._activeBindings[c];delete this._urlBindings[c];delete this._pendingBindings[c];var b=this._contributionsByScopeId[a];e&&e.split("/").forEach(function(a){if(a.length>1&&b[a])b=b[a].children});delete b[c];b.sortedContributions=
null}},_addBinding:function(a,c,e,b){if(!a.id)throw Error("No command id: "+a);c==="key"?this._activeBindings[a.id]={command:a,keyBinding:e,bindingOnly:b}:c==="url"&&(this._urlBindings[a.id]={command:a,urlBinding:e,bindingOnly:b})},_addPendingBinding:function(a,c,e,b){this._pendingBindings[a]=this._pendingBindings[a]||[];this._pendingBindings[a].push({type:c,binding:e,bindingOnly:b})},_checkForTrailingSeparator:function(a,c,e){var b;if(c==="tool"||c==="button")if((b=a.childNodes.length>0?a.childNodes[a.childNodes.length-
1]:null)&&b.classList.contains("commandSeparator"))return e?(a.removeChild(b),!1):!0;if(c==="menu"&&(a=d.$$array("li > *",a),a.length>0&&a[a.length-1].classList.contains("dropdownSeparator")))if(b=a[a.length-1],e)b.parentNode.parentNode.removeChild(b.parentNode);else return!0;return!1},renderCommands:function(a,c,e,b,g,f,n){if(typeof a!=="string")throw"a scope id for rendering must be specified";c=d.node(c);if(!c)throw"no parent";var r=this._contributionsByScopeId[a];if(!e&&r){var e=r.localSelectionService||
this._selectionService,l=this;e&&e.getSelections(function(e){l.renderCommands(a,c,e,b,g,f)})}else r&&(this._render(r,c,e,b,g||"button",f,n),this._checkForTrailingSeparator(c,g,!0))},destroy:function(a){a=d.node(a);if(!a)throw"no parent";for(;a.hasChildNodes();){var c=a.firstChild;c.commandTooltip&&c.commandTooltip.destroy();c.emptyGroupTooltip&&c.emptyGroupTooltip.destroy();this.destroy(c);a.removeChild(c)}},_render:function(a,c,e,g,d,l,n){var r=a.sortedContributions;if(!r){var r=[],i=!1,z;for(z in a)if(Object.prototype.hasOwnProperty.call(a,
z)){var m=a[z];if(m&&typeof m.position==="number")m.id=z,r.push(m),i=!0}if(i)r.sort(function(a,c){return a.position-c.position}),a.sortedContributions=r}var o=0,j=this;r.forEach(function(a){var r;if(!a.imageClass)a.imageClass=null;if(a.children&&Object.getOwnPropertyNames(a.children).length>0){var i=a.children;if(d==="tool"||d==="button")if(a.title){var z;if(a.defaultActionId)(i=j._commandList[a.defaultActionId])&&(i.visibleWhen?i.visibleWhen(e):1)?(z=new h.CommandInvocation(g,e,l,i,j),z.domParent=
c):a.pretendDefaultActionId=!0;i=j._createDropdownMenu(c,a.title,null,null,a.imageClass,a.tooltip,a.selectionClass,null,z,a.pretendDefaultActionId);n&&k.generateNavGrid(n,i.menuButton);if(i)if(j._render(a.children,i.menu,e,g,"menu",l,n),j._checkForTrailingSeparator(i.menu,"menu",!0),i.menu.childNodes.length===0)if(a.emptyGroupMessage){if(!i.menuButton.emptyGroupTooltip)i.menuButton.emptyGroupTooltip=new b.Tooltip({node:i.menuButton,text:a.emptyGroupMessage,trigger:"click",position:["below","right",
"above","left"]})}else n&&k.removeNavGrid(n,i.menuButton),a=function(a){a&&a.parentNode&&a.parentNode.removeChild(a)},a(i.menu),a(i.menuButton),a(i.destroyButton);else i.menuButton.style.visibility="visible"}else{var m;c.childNodes.length>0&&!j._checkForTrailingSeparator(c,d)&&(m=j.generateSeparatorImage(c));j._render(i,c,e,g,d,l,n);c.childNodes.length>0&&c.childNodes[c.childNodes.length-1]!==m&&(m=j.generateSeparatorImage(c))}else if(a.title){if(a=j._createDropdownMenu(c,a.title,!0,null,null,a.imageClass))j._render(i,
a.menu,e,g,"menu",l,n),j._checkForTrailingSeparator(a.menu,"menu",!0),a.menu.childNodes.length===0&&a.destroyButton&&c.removeChild(a.destroyButton)}else c.childNodes.length>0&&j._generateMenuSeparator(c),j._render(i,c,e,g,d,l,n),j._generateMenuSeparator(c)}else{var x=j._commandList[a.id],i=x?!0:!1;z=a=null;if(x){r=new h.CommandInvocation(g,e,l,x,j);r.domParent=c;m=i&&(x.visibleWhen?x.visibleWhen(e):!0);if(j._activeBindings[x.id]&&j._activeBindings[x.id].keyBinding)a=j._activeBindings[x.id],a.invocation=
m?r:null,a.bindingOnly&&(i=!1);if(j._urlBindings[x.id]&&j._urlBindings[x.id].urlBinding)z=j._urlBindings[x.id],z.invocation=m?r:null,z.bindingOnly&&(i=!1);i=i&&m}if(i)x.choiceCallback?(d==="tool"||d==="button"?(a=c,i=!1,c.nodeName.toLowerCase()==="ul"&&(a=document.createElement("li"),c.appendChild(a))):(a=c,i=!0),j._createDropdownMenu(a,x.name,i,function(a){x.populateChoicesMenu(a,e,g,l,j)}.bind(x),x.imageClass,x.tooltip||x.title,x.selectionClass,x.positioningNode)):(r.handler=r.handler||this,r.domParent=
c,i=function(){j._invoke(r)},d==="menu"?(z=null,a&&a.keyBinding&&(z=f.getUserKeyString(a.keyBinding)),a=h.createCommandMenuItem(c,x,r,null,i,z)):(a=d+x.id+o,a=h.createCommandItem(c,x,r,a,null,d==="tool",i)),k.generateNavGrid(n,a),r.domNode=a,o++)}})},_createDropdownMenu:function(a,e,g,f,l,m,n,r,x,z){a=d.node(a);if(!a||!d.contains(document.body,a))return null;var o,j,s=a;if(g)m=document.createRange(),m.selectNode(a),m=m.createContextualFragment(c),d.processTextNodes(m,{ButtonText:e}),a.appendChild(m),
j=a.lastChild,l=j.lastChild,e=l.previousSibling,e.dropdown=new i.Dropdown({dropdown:l,populate:f,parentDropdown:a.dropdown}),l.dropdown=e.dropdown;else{a.nodeName.toLowerCase()==="ul"&&(s=document.createElement("li"),a.appendChild(s),j=s);a=null;l&&(a="dropdownButtonWithIcon",m=m||e);var m=l?m||e:m,k=h.createDropdownMenu(s,e,f,a,l,!1,n,r,x||z);o=k.dropdownArrow;e=k.menuButton;if(o){if(x)x.domNode=k.menuButton;var y=this;e.onclick=function(a){var c=d.bounds(o);a.clientX>=c.left&&k.dropdown?k.dropdown.toggle(a):
y._invoke(x)};if(k.dropdown)e.onkeydown=function(a){d.KEY.DOWN===a.keyCode&&(k.dropdown.toggle(a),d.stop(a))}}var l=k.menu,G;(f=x&&x.command&&(x.command.tooltip||x.command.name))?G=x.command.tooltip||x.command.name:f&&(G=m);if(G)e.commandTooltip=new b.Tooltip({node:e,text:G,position:["above","below","right","left"]})}return{menuButton:e,menu:l,dropdown:e.dropdown,destroyButton:j,dropdownArrow:o}},_generateMenuSeparator:function(a){if(!this._checkForTrailingSeparator(a,"menu")){var c=document.createElement("li");
c.classList.add("dropdownSeparator");var e=document.createElement("span");e.classList.add("dropdownSeparator");c.appendChild(e);a.appendChild(c)}},generateSeparatorImage:function(a){var c;c=a.nodeName.toLowerCase()==="ul"?document.createElement("li"):document.createElement("span");a.appendChild(c);c.classList.add("core-sprite-sep");c.classList.add("imageSprite");c.classList.add("commandSeparator");return c}};a.prototype.constructor=a;l.prototype={match:function(a){a=j.matchResourceParameters(a);return typeof a[this.token]!==
"undefined"?(this.parameterValue=a[this.token],this):null}};l.prototype.constructor=l;m.prototype.constructor=m;o.prototype={optionsRequested:function(){return this.optionsRequested}};o.prototype.constructor=o;s.prototype={_storeParameters:function(a){this.parameterTable=null;if(a){var c=this.parameterTable={};a.forEach(function(a){c[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,c){var e=this.parameterTable[a];if(e)e.value=c},forEach:function(a){for(var c in this.parameterTable)this.parameterTable[c].type&&this.parameterTable[c].name&&a(this.parameterTable[c])},makeCopy:function(){var a=[];this.forEach(function(c){c=new o(c.name,c.type,c.label,
c.value,c.lines,c.eventListeners);a.push(c)});var c=new s(a,this._options,this.getParameters);c.clientCollect=this.clientCollect;return c},hasOptionalParameters:function(){return this._hasOptionalParameters}};s.prototype.constructor=s;return{CommandRegistry:a,URLBinding:l,ParametersDescription:s,CommandParameter:o,CommandEventListener:m}});
define("orion/parameterCollectors",["i18n!orion/nls/messages","require","orion/webui/littlelib"],function(h,k,j){function f(d,f){this._activeContainer=null;this._getElementsFunction=d;this._toolbarLayoutFunction=f}f.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(d,f,b){typeof d==="string"&&(d=j.node(d));if(this._activeElements&&this._activeElements.slideContainer&&this._activeElements.commandNode===d)return this._activeElements.focusNode&&
this._activeElements.focusNode.focus(),!0;this.close();this._activeElements=null;if((this._activeElements=this._getElementsFunction(d))&&this._activeElements.parameterArea&&this._activeElements.slideContainer){this._activeElements.onClose=b;var g=f(this._activeElements.parameterArea,this._activeElements.dismissArea);if(!g)return!1;this._activeElements.focusNode=g;d=j.$$array("#closebox",this._activeElements.dismissArea||this._activeElements.parameterArea);if(d.length===0){f=this._activeElements.dismissArea||
this._activeElements.parameterArea;d=document.createElement("button");d.id="closebox";d.className="imageSprite core-sprite-close dismissButton";d.title=h.Close;f.appendChild(d);var e=this;d.addEventListener("click",function(){e.close()},!1)}this._activeElements.slideContainer.classList.add("slideContainerActive");this._toolbarLayoutFunction(this._activeElements);if(g)this._oldFocusNode=window.document.activeElement,window.setTimeout(function(){g.focus();g.select&&g.select()},0);this._activeElements.commandNode&&
this._activeElements.commandNode.classList.add("activeCommand");return!0}return!1},_collectAndCall:function(d,f){j.$$array("input",f).forEach(function(b){b.type==="checkbox"?d.parameters.setValue(b.parameterName,b.checked):b.type!=="button"&&d.parameters.setValue(b.parameterName,b.value.trim())});j.$$array("textArea",f).forEach(function(b){d.parameters.setValue(b.parameterName,b.value.trim())});d.command.callback&&d.command.callback.call(d.handler,d)},collectParameters:function(d){return d.parameters?
(d.domNode&&d.domNode.classList.add("commandMarker"),this.open(d.domNode||d.domParent,this.getFillFunction(d))):!1},getFillFunction:function(d,f){var b=this;return function(g,e){var c=null,a=function(){f&&f();b.close()},l=function(c){c.keyCode===j.KEY.ENTER&&b._collectAndCall(d,g);if(c.keyCode===j.KEY.ESCAPE||c.keyCode===j.KEY.ENTER)a(),j.stop(c)};d.parameters.forEach(function(e){var b=null;if(e.label)b=document.createElement("label"),b.classList.add("parameterInput"),b.setAttribute("for",e.name+
"parameterCollector"),b.textContent=e.label,g.appendChild(b);var f=e.name+"parameterCollector",i,b=b||g;if(e.type==="text"&&typeof e.lines==="number"&&e.lines>1)i=document.createElement("textarea"),i.rows=e.lines,i.type="textarea",i.id=f,b.appendChild(i),l=function(c){c.keyCode===j.KEY.ESCAPE&&(a(),j.stop(c))};else if(e.type==="boolean"){if(i=document.createElement("input"),i.type="checkbox",i.id=f,b.appendChild(i),e.value)i.checked=!0}else if(i=document.createElement("input"),i.type=e.type,i.id=
f,b.appendChild(i),e.value)i.value=e.value;i.classList.add("parameterInput");i.setAttribute("speech","speech");i.setAttribute("x-webkit-speech","x-webkit-speech");i.parameterName=e.name;c||(c=i);e.eventListeners.length>0&&e.eventListeners.forEach(function(a){i.addEventListener(a.event,function(c){return a.handler(c,d)},a.capture)});i.addEventListener("keydown",l,!1)});var m=e;m||(m=document.createElement("span"),m.classList.add("layoutRight"),m.classList.add("parametersDismiss"),g.appendChild(m));
var o=function(a,c){var e=document.createElement("button");c.appendChild(e);a&&e.appendChild(document.createTextNode(a));e.classList.add("dismissButton");return e};if(d.parameters.hasOptionalParameters())d.parameters.optionsRequested=!1,o(h.More,m).addEventListener("click",function(){d.parameters.optionsRequested=!0;b._collectAndCall(d,g);a()},!1);o(h.Submit,m).addEventListener("click",function(){b._collectAndCall(d,g);a()},!1);m=o(null,m);m.id="closebox";m.classList.add("imageSprite");m.classList.add("core-sprite-close");
m.title=h.Close;m.addEventListener("click",function(){a()},!1);return c}}};f.prototype.constructor=f;return{CommandParameterCollector:f}});define("orion/regex",[],function(){return{escape:function(h){return h.replace(/([\\$\^*\/+?\.\(\)|{}\[\]])/g,"\\$&")},parse:function(h){return(h=/^\s*\/(.+)\/([gim]{0,3})\s*$/.exec(h))?{pattern:h[1],flags:h[2]}:null}}});
define("orion/contentTypes",[],function(){function h(c,a){function e(a,c,b,g){var b=c.filename.indexOf(b)>=0,d;d=g.toLowerCase();d=c.extension.indexOf(d)!==-1;if(b||d){if(!(d=!a))b&&(g=g.toLowerCase(),b=a.extension.indexOf(g)!==-1),d=b;if(d)return c}return a}if(typeof c!=="string")return null;for(var b=c&&c.split(".").pop(),g=null,d=0;d<a.length;d++){var f=a[d];e(g,f,c,b)===f&&(g=f)}return g}function k(c){return c===null||typeof c==="undefined"?[]:Array.isArray(c)?c:[c]}function j(c){return k(c).map(function(a){return String.prototype.toLowerCase.call(a)})}
function f(c){return{id:c.id,name:c.name,image:c.image,imageClass:c.imageClass,"extends":c["extends"],extension:j(c.extension),filename:k(c.filename)}}function d(c){var a=Object.create(null);c.map(f).forEach(function(c){Object.prototype.hasOwnProperty.call(a,c.id)||(a[c.id]=c)});return a}function i(c){if(c&&c.registerService){this.serviceRegistry=c;for(var a=c.getServiceReferences(g).concat(c.getServiceReferences(e)),f=[],i=0;i<a.length;i++)for(var h=k(a[i].getProperty("contentTypes")),j=0;j<h.length;j++)f.push(h[j]);
this.map=d(f);c.registerService(b,this)}else if(Array.isArray(c))this.serviceRegistry=null,this.map=d(c);else throw Error("Invalid parameter");}var b="orion.core.contentTypeRegistry",g="orion.core.contenttype",e="orion.file.contenttype";i.prototype={getContentTypes:function(){var c=this.getContentTypesMap(),a=[],e;for(e in c)Object.prototype.hasOwnProperty.call(c,e)&&a.push(c[e]);return a},getContentTypesMap:function(){return this.map},getFileContentType:function(c){return h(c.Name,this.getContentTypes())},
getFilenameContentType:function(c){return h(c,this.getContentTypes())},getContentType:function(c){return this.map[c]||null},isExtensionOf:function(c,a){c=typeof c==="string"?this.getContentType(c):c;a=typeof a==="string"?this.getContentType(a):a;if(!c||!a)return!1;if(c.id===a.id)return!0;else for(var e=c,b={};e&&(e=this.getContentType(e["extends"]));){if(e.id===a.id)return!0;if(b[e.id])throw Error("Cycle: "+e.id);b[e.id]=!0}return!1},isSomeExtensionOf:function(c,a){for(var e=0;e<a.length;e++)if(this.isExtensionOf(c,
a[e]))return!0;return!1}};return{ContentTypeRegistry:i,getFilenameContentType:h}});
define("orion/URITemplate",[],function(){function h(a){this._text=a}function k(a){return a.replace("%25","%")}function j(a,e){if(e==="U")return encodeURIComponent(a).replace(/[!'()*]/g,function(a){return"%"+a.charCodeAt(0).toString(16).toUpperCase()});if(e==="U+R")return encodeURI(a).replace(/%5B/g,"[").replace(/%5D/g,"]").replace(c,k);if(e==="U+R-,")return encodeURI(a).replace(/%5B/g,"[").replace(/%5D/g,"]").replace(/,/g,"%2C");throw Error("Unknown allowed character set: "+e);}function f(a,c,e){for(var b=
[],g=0;g<a.length;g++)typeof a[g]!=="undefined"&&b.push(j(a[g],c));return b.join(e)}function d(a,c,e,b){for(var g=Object.keys(a),d=[],f=0;f<g.length;f++)typeof a[g[f]]!=="undefined"&&d.push(j(g[f],c)+e+j(a[g[f]],c));return d.join(b)}function i(a){if(a.length===0)throw Error("Invalid Expression: 0 length expression");(this._operator=g[a[0]])?a=a.substring(1):this._operator=g.NUL;for(var c=[],b=a.split(","),d=0;d<b.length;d++){var f=b[d].match(e);if(f===null)throw Error("Bad VarSpec: "+a);c.push({name:f[1],
explode:!!f[2],prefix:f[3]?parseInt(f[3],10):-1})}this._varSpecList=c}function b(a){for(var c=[],e=0,b=a.indexOf("{",e);b!==-1;){c.push(new h(a.substring(e,b)));e=a.indexOf("}",b+1);if(e===-1)throw Error("Invalid template: "+a);c.push(new i(a.substring(b+1,e)));e+=1;b=a.indexOf("{",e)}c.push(new h(a.substring(e)));this._templateComponents=c}var g={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-,"}},e=/^((?:(?:[a-zA-Z0-9_])|(?:%[0-9A-F][0-9A-F]))(?:(?:[a-zA-Z0-9_.])|(?:%[0-9A-F][0-9A-F]))*)(?:(\*)|:([0-9]+))?$/,c=/%25[0-9A-F][0-9A-F]/g;h.prototype={expand:function(){return encodeURI(this._text)}};
i.prototype={expand:function(a){for(var c=[],e=0;e<this._varSpecList.length;e++){var b=this._varSpecList[e],g=b.name,i=a[g],h=typeof i;if(h!=="undefined"&&i!==null){var k=c.length===0?this._operator.first:this._operator.sep;if(h==="string")this._operator.named&&(k+=j(g,"U+R"),k+=i.length===0?this._operator.ifemp:"="),b.prefix!==-1&&b.prefix<i.length&&(i=i.substring(0,b.prefix)),k+=j(i,this._operator.allow);else if(Array.isArray(i)){if(i.length===0)continue;b.explode?k+=f(i,this._operator.allow,this._operator.sep):
(b=f(i,this._operator.allow,","),this._operator.named&&(k+=j(g,"U+R"),k+=b.length===0?this._operator.ifemp:"="),k+=b)}else if(h==="object"){if(Object.keys(i).length===0)continue;b.explode?k+=d(i,this._operator.allow,"=",this._operator.sep):(b=d(i,this._operator.allow,",",","),this._operator.named&&(k+=j(g,"U+R"),k+=b.length===0?this._operator.ifemp:"="),k+=b)}else throw Error("bad param type: "+g+" : "+h);c.push(k)}}return c.join("")}};b.prototype={expand:function(a){for(var c=[],e=0;e<this._templateComponents.length;e++)c.push(this._templateComponents[e].expand(a));
return c.join("")}};return b});
define("orion/i18nUtil",["require","orion/Deferred"],function(h,k){function j(d){if(d=localStorage.getItem("orion/messageBundle/"+d))if(d=JSON.parse(d),d._expires&&d._expires>(new Date).getTime())return delete d._expires,d;return null}var f={};return{getMessageBundle:function(d){function i(a){a?h(["i18n!"+d],function(a){if(a){var c=d;a._expires=(new Date).getTime()+9E5;localStorage.setItem("orion/messageBundle/"+c,JSON.stringify(a));delete a._expires}g.resolve(a)}):b(Error(d))}function b(a){g.reject(a)}
if(f[d])return f[d];var g=new k;f[d]=g;var e=j(d);if(e)return g.resolve(e),g;try{h([d],i,b)}catch(c){h(["orion/i18n!"+d],i,b)}return g},formatMessage:function(d){var f=arguments;return d.replace(/\$\{([^\}]+)\}/g,function(b,g){return f[(g<<0)+1]})}}});
define("orion/PageLinks","require,orion/Deferred,orion/PageUtil,orion/URITemplate,orion/i18nUtil,orion/objects,orion/URL-shim".split(","),function(h,k,j,f,d,i){function b(){return h.toUrl?(new URL(h.toUrl("orion/../"),window.location.href)).href.slice(0,-1):(new URL("/",window.location.href)).href.slice(0,-1)}function g(a){var c={};a.getPropertyKeys().forEach(function(e){e!=="objectClass"&&e!=="service.names"&&e!=="service.id"&&e!=="__plugin__"&&(c[e]=a.getProperty(e))});return c}function e(a){return d.getMessageBundle(a.nls).then(function(c){a.textContent=
a.nameKey?c[a.nameKey]:a.name;return a},function(){a.textContent=a.nameKey||a.name;return a})}function c(a,c){var d=a.getServiceReferences(c||"orion.page.link"),l=j.matchResourceParameters(window.location.href),i={OrionHome:b(),Location:l.resource},m=[];d.forEach(function(a){a=g(a);if(a.uriTemplate&&(a.nls||a.name)){var c=(new f(a.uriTemplate)).expand(i),c=j.validateURLScheme(c);a.href=c;a.nls?m.push(e(a)):(a.textContent=a.name,m.push((new k).resolve(a)))}});return k.all(m)}function a(a){var c=this.categories=
Object.create(null);a.forEach(function(a){c[a.id]=a})}function l(a){this.allPageLinks=a;this.allPageLinks.sort(m)}function m(a,c){var e=a.textContent&&a.textContent.toLowerCase(),b=c.textContent&&c.textContent.toLowerCase();return e<b?-1:e>b?1:0}var o;i.mixin(a.prototype,{getCategoryIDs:function(){return Object.keys(this.categories)},getCategory:function(a){return this.categories[a]||null}});i.mixin(l.prototype,{createLinkElements:function(){return this.allPageLinks.map(function(a){var c=a.href,a=
a.textContent,e=document.createElement("a");e.href=c;e.target="_self";e.classList.add("targetSelector");e.textContent=a;return e})},getAllLinks:function(){return this.allPageLinks}});return{getCategoriesInfo:function(c){var b;return!o?(b=[],c.getServiceReferences("orion.page.link.category").forEach(function(a){a=g(a);if(a.id&&(a.name||a.nameKey))a.nls?b.push(e(a)):(a.textContent=a.name,b.push((new k).resolve(a)))}),k.all(b).then(function(c){return o=new a(c)})):(new k).resolve(o)},getPageLinksInfo:function(a,
e){return c(a,e).then(function(a){return new l(a)})},getOrionHome:b}});
define("orion/edit/nls/root/messages",{Editor:"Editor",switchEditor:"Switch Editor",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.",unsavedAutoSaveChanges:"Please stay on the page until Auto Save is complete.",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}",ReadingMetadataError:"Can not get 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",SidePanel:"Side Panel",SidePanelTooltip:"Choose what to show in the side panel.",Actions:"Actions",Navigator:"Navigator",FolderNavigator:"Folder Navigator",Project:"Project",New:"New",File:"File",Edit:"Edit",Tools:"Tools",Add:"Add",noActions:"There are no actions for the current selection.",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}.",NoProjects:"There are no projects in your workspace. Use the ${0} menu to create projects.",disconnected:"(disconnected)",ChooseFS:"Choose Filesystem",ChooseFSTooltip:"Choose the filesystem you want to view.",FSTitle:"${0} (${1})",Deploy:"Deploy","Deploy As":"Deploy As",Import:"Import",Export:"Export",OpenWith:"Open With",OpenRelated:"Open Related",Dependency:"Dependency",UnnamedCommand:"Unnamed"});
define("orion/edit/nls/messages",["orion/i18n!orion/edit/nls/messages","orion/edit/nls/root/messages"],function(h,k){var j={root:k};Object.keys(h).forEach(function(f){typeof j[f]==="undefined"&&(j[f]=h[f])});return j});
define("orion/extensionCommands","require,orion/Deferred,orion/commands,orion/regex,orion/contentTypes,orion/URITemplate,orion/i18nUtil,orion/URL-shim,orion/PageLinks,i18n!orion/edit/nls/messages".split(","),function(h,k,j,f,d,i,b,g,e,c){function a(a){var c={};a.getPropertyKeys().forEach(function(e){c[e]=a.getProperty(e)});return c}var l={},m=e.getOrionHome();l._cloneItemWithoutChildren=function u(a){if(a===null||typeof a!=="object")return a;var c=a.constructor(),e;for(e in a)e!=="children"&&e!==
"Children"&&(c[e]=u(a[e]));return c};l._getOpenWithNavCommandExtensions=function(a){function c(a,e){for(var b=a.getServiceReferences("orion.navigate.openWith"),g=[],d=[],n=0;n<b.length;n++){var r=b[n];if(r.getProperty("editor")===e.id){var f=r.getProperty("contentType");f instanceof Array?g=g.concat(f):g.push(f||"*/*");r=r.getProperty("excludedContentTypes");r instanceof Array?d=d.concat(r):r!==null&&typeof r!=="undefined"&&d.push(r)}}0===g.length&&(g=null);0===d.length&&(d=null);return{contentTypes:g,
excludedContentTypes:d}}for(var e=function(){for(var c=a.getServiceReferences("orion.edit.editor"),e=[],b=0;b<c.length;b++){var g=c[b],d=g.getProperty("id");e.push({id:d,"default":g.getProperty("default")||!1,name:g.getProperty("name"),nameKey:g.getProperty("nameKey"),nls:g.getProperty("nls"),uriTemplate:g.getProperty("orionTemplate")||g.getProperty("uriTemplate"),validationProperties:g.getProperty("validationProperties")||[]})}return e}(),b=[],g=0;g<e.length;g++){var d=e[g],r=c(a,d);b.push({properties:{name:d.name||
d.id,nameKey:d.nameKey,id:"eclipse.openWithCommand."+d.id,contentType:r.contentTypes,excludedContentTypes:r.excludedContentTypes,uriTemplate:d.uriTemplate,nls:d.nls,forceSingleItem:!0,isEditor:d["default"]?"default":"editor",validationProperties:d.validationProperties},service:{}})}return b};l._makeValidator=function(a,c,e,b){function g(a,c,e,b){var d=e.match,n,f;if((n=c.indexOf("["))>=0){if((f=c.indexOf("]"))<0)return!1;var l=c.substring(0,n),i;if(!(i=a[l])||!Array.isArray(i))return!1;n=c.substring(n+
1,f);n=parseInt(n,10);if(isNaN(n))return!1;n<0&&(n+=i.length);c=c.substring(f+1);c=l+":"+String(n)+c}if(c.indexOf("|")>=0)return n=c.substring(0,c.indexOf("|")),c=c.substring(c.indexOf("|")+1),g(a,n,e,b)?!0:g(a,c,e,b);else if(c.indexOf(":")>=0)return n=c.substring(0,c.indexOf(":")),c=c.substring(c.indexOf(":")+1),a[n]?g(a[n],c,e,b):!1;else{a:{var l=!1,m;if(c.charAt(0)==="!")e=typeof a[c.substring(1)]==="undefined";else if(typeof a[c]!=="undefined"){if(typeof d==="undefined")m=a[c],l=!0;else if(typeof d===
"string"){if(!typeof(a[c]==="string")){e=!1;break a}if(e.variableName){if(d=RegExp(d).exec(a[c]))m=d[0],m=e.variableMatchPosition==="before"?a[c].substring(0,d.index):e.variableMatchPosition==="after"?a[c].substring(d.index+m.length):e.variableMatchPosition==="only"?m:a[c],l=!0}else{e=RegExp(d).test(a[c]);break a}}else a[c]===d&&(m=a[c],l=!0);if(l&&e.variableName&&(b[e.variableName]=m,b.itemCached=a,e.replacements))for(a=0;a<e.replacements.length;a++)m=!1,e.replacements[a].pattern?b[e.variableName]=
b[e.variableName].replace(RegExp(e.replacements[a].pattern),e.replacements[a].replacement||""):m=!0,m&&window.console.log("Invalid replacements specified in validation property.  "+e.replacements[a]);e=l}else e=!1}return e}}function n(c,e,b){if(b.info.validationProperties)for(var n=0;n<b.info.validationProperties.length;n++){var f=b.info.validationProperties[n];if(typeof f.source!=="undefined"){if(!g(c,f.source,f,b))return!1}else return window.console.log("Invalid validationProperties in "+a.id+".  No source property specified."),
!1}var n=!0,l=e?d.getFilenameContentType(c.Name,e):null,l=l||{id:"application/octet-stream"};b.info.excludedContentTypes&&e&&(n=b.info.excludedContentTypes.every(function(a){a=a.replace(/([*?])/g,".$1");return-1!==l.id.search(a)?!1:!0}));n&&b.info.contentType&&e&&(n=b.info.contentType.some(function(a){a=a.replace(/([*?])/g,".$1");return-1!==l.id.search(a)?!0:!1}));return n}return{info:a,validationFunction:function(a){typeof b==="function"&&(a=b.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 c=0;c<a.length;c++)if(!n(a[c],e,this))return!1;return!0}return!1},generatesURI:function(){return!!this.info.uriTemplate},getURI:function(a){if(this.info.uriTemplate){var c={},e;for(e in a)Object.prototype.hasOwnProperty.call(a,e)&&(c[e]=a[e]);if(this.info.validationProperties)for(e=0;e<this.info.validationProperties.length;e++){var b=this.info.validationProperties[e];b.source&&b.variableName&&(this.itemCached===
a&&this[b.variableName]||g(a,b.source,b,this),a[b.variableName]?window.console.log("Variable name "+b.variableName+" in the extension "+this.info.id+" conflicts with an existing property in the item metadata."):c[b.variableName]=this[b.variableName])}c.OrionHome=m;return(new i(this.info.uriTemplate)).expand(c)}return null}}};var o=c.UnnamedCommand;l._createCommandOptions=function(a,c,e,g,d,n){function f(b,r){var i=l._makeValidator(a,e,g,n);b.visibleWhen=i.validationFunction.bind(i);if(d)if(i.generatesURI.bind(i)())b.hrefCallback=
function(a){a=Array.isArray(a.items)?a.items[0]:a.items;return i.getURI.bind(i)(a)};else{var m=a;b.callback=function(a){var g;if(m.forceSingleItem)a=Array.isArray(a.items)?a.items[0]:a.items,g=l._cloneItemWithoutChildren(a);else if(Array.isArray(a.items)){g=[];for(var d=0;d<a.items.length;d++)g.push(l._cloneItemWithoutChildren(a.items[d]))}else g=l._cloneItemWithoutChildren(a.items);if(e)var n=e.getService("orion.page.progress");c.run?n?n.progress(c.run(g),"Running command: "+b.name):c.run(g):e&&
(n?n.progress(e.getService(c).run(g),"Running command: "+b.name):e.getService(c).run(g))}}r.resolve(b)}var i=new k;if(a.nls){var m=function(c){var e;c?(e=a.tooltipKey&&c[a.tooltipKey],c=a.nameKey&&c[a.nameKey]||a.name||o,e=e||a.tooltip||""):(c=a.name||a.nameKey||o,e=a.tooltip||a.tooltipKey||"");f({name:c,image:a.image,id:a.id||a.name,tooltip:e,isEditor:a.isEditor,showGlobally:a.showGlobally},i)};b.getMessageBundle(a.nls).then(m,m.bind(this,null))}else f({name:a.name,image:a.image,id:a.id||a.name,
tooltip:a.tooltip,isEditor:a.isEditor,showGlobally:a.showGlobally},i);return i};l.getOpenWithCommand=function(a,c,e){for(var b,a=e||l.getOpenWithCommands(a),e=0;e<a.length;e++)if(a[e].visibleWhen(c)){var g=a[e].isEditor==="default";if(!b||g)if(b=a[e],g)break}return b};l.getOpenWithCommands=function(a){var c=[],e;for(e in a._commandList){var b=a._commandList[e];b.isEditor&&c.push(b)}return c};var s;l.createAndPlaceFileCommandsExtension=function(a,e,b,g,d,n){return l.createFileCommands(a,null,n?"all":
void 0,!!n,e).then(function(a){d&&0<a.length&&(e.addCommandGroup(b,"eclipse.openWith",1E3,c.OpenWith,d,null,null,null,"dropdownSelection"),e.addCommandGroup(b,"eclipse.fileCommandExtensions",1E3,c.OpenRelated,d));a.forEach(function(a){var c=null;d&&(c=a.isEditor?d+"/eclipse.openWith":d+"/eclipse.fileCommandExtensions");e.registerCommandContribution(b,a.id,g,c)});return{}})};l.createFileCommands=function(a,c,e,b,g){var e=e===void 0?"global":e,b=b===void 0?!0:b,d=[];l._cachedFileCommands||l._createCachedFileCommands(a);
(e==="all"||e==="global")&&l._cachedFileCommands.forEach(function(a){var c=a.properties;(e==="all"||c.forceSingleItem&&c.showGlobally)&&d.push(a)});return k.when(function(){var e=a.getService("orion.core.contentTypeRegistry")||c;return s||k.when(e.getContentTypes(),function(a){return s=a})}(),function(){if(b){if(!l._cachedOpenWithExtensions)l._cachedOpenWithExtensions=l._getOpenWithNavCommandExtensions(a,s);d=d.concat(l._cachedOpenWithExtensions);g._addedOpenWithCommands=b}var c=d.map(function(c){var e=
c.properties,c=c.service,b=g.findCommand(e.id||e.name);return b?(new k).resolve(b):l._createCommandOptions(e,c,a,s,!0).then(function(a){a=new j.Command(a);g.addCommand(a);return a})});return k.all(c,function(a){return{_error:a}}).then(function(a){return a})})};l._createCachedFileCommands=function(c){var e=c.getServiceReferences("orion.navigate.command");l._cachedFileCommands=[];for(var b=0;b<e.length;b++)if(e[b].getProperty("id")!=="orion.navigateFromMetadata"){var g=c.getService(e[b]),d=a(e[b]);
l._cachedFileCommands.push({properties:d,service:g})}};l.getFileCommandIds=function(){var a=[];if(l._cachedFileCommands)l._cachedFileCommands.length&&(a=l._cachedFileCommands.map(function(a){return a.properties.id}));else throw"extensionCommandUtils._cachedFileCommands is not initialized";return a};l.createOpenWithCommands=function(a,c,e){return e&&e._addedOpenWithCommands?(new k).resolve(l.getOpenWithCommands(e)):l.createFileCommands(a,c,"none",!0,e)};return l});
define("orion/breadcrumbs",["require","orion/webui/littlelib"],function(h,k){function j(f){this._init(f)}j.prototype={_init:function(f){var d=k.node(f.container);if(!d)throw"no parent container";this._container=d;d.classList.remove("currentLocation");this._id=f.id||"eclipse.breadcrumbs";this._resource=f.resource||null;this._rootSegmentName=f.rootSegmentName;this._workspaceRootSegmentName=f.workspaceRootSegmentName;this._workspaceRootURL=f.workspaceRootURL;this._makeHref=f.makeHref;this._makeFinalHref=
f.makeFinalHref;this._maxLength=f.maxLength;this.path="";this.measure();this.render()},getNavigatorWorkspaceRootSegment:function(){if(this._workspaceRootSegmentName){var f;if(this._resource&&this._resource.Parents&&!this._resource.skip){f=document.createElement("a");var d=this._workspaceRootURL?this._workspaceRootURL:"";this._makeHref?this._makeHref(f,d):f.href=h.toUrl("edit/edit.html")+"#"+d}else f=document.createElement("span");k.empty(f);f.appendChild(document.createTextNode(this._workspaceRootSegmentName));
return f}return null},MAX_LENGTH:500,INCLUDE_FIRST_SECTION:!0,segments:[],buildSegment:function(f){var d=document.createElement("a");d.classList.add("breadcrumb");d.appendChild(document.createTextNode(f));return d},addSegmentHref:function(f,d){this._makeHref?this._makeHref(f,d.Location,d):f.href=h.toUrl("edit/edit.html")+"#"+d.ChildrenLocation},buildSegments:function(f,d){if(this._resource.Parents){var i=this._resource.Parents.slice(0),b,g;i&&(i=i.slice(0),d==="reverse"&&(i=i.reverse().slice(0)),
i.forEach(function(e){if(!e.skip)f?(g=f,f=null):g=e.Name,b=this.buildSegment(g),this.path+=e.Name,this.addSegmentHref(b,e),b.include=!1,this.segments.push(b)}.bind(this)))}},addDivider:function(){var f=document.createElement("span");f.appendChild(document.createTextNode(" / "));this.path+="/";f.classList.add("breadcrumbSeparator");this.append(f)},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(f){this.crumbs.appendChild(f)},addTitle:function(f,d){var i=d||document.title;this.crumbs.childNodes.length===0&&(f=document.createElement("span"),f.appendChild(document.createTextNode(i)),
f.classList.add("breadcrumb"),f.classList.add("currentLocation"),this.append(f))},finalSegment:function(f,d){if(!this._resource.skip){var i;i=d?d:this._resource.Name;this._makeFinalHref?(f=this.buildSegment(i),this.addSegmentHref(f,this._resource)):(f=document.createElement("span"),f.appendChild(document.createTextNode(i)));f.classList.add("currentLocation");this.path+=this._resource.Name;this.append(f)}},firstSegment:function(f){if(f)if(this.append(f),this._resource&&this._resource.Parents&&!this._resource.skip)f.classList.add("breadcrumb"),
this.addDivider();else{if(!this._resource.skip)f.href="";f.classList.add("currentLocation")}},drawSegments:function(){this._resource.Parents&&this.segments.slice(0).forEach(function(f){f.include===!0&&(this.append(f),this.addDivider())}.bind(this))},measureSegments:function(){this.INCLUDE_FIRST_SECTION=!0;if(this._resource.Parents){var f=this.segments.slice(0).reverse();f.forEach(function(d){this.append(d);this.addDivider();this.crumbs.offsetWidth<this.MAX_LENGTH?d.include=!0:this.INCLUDE_FIRST_SECTION=
!1}.bind(this));this.segments=f.reverse()}},measure:function(){var f=this._container;f.style.width="auto";this.MAX_LENGTH=this._maxLength?this._maxLength:f.offsetWidth;this.refresh();this.segments=[];this.crumbs.style.visibility="hidden";var f=this.getNavigatorWorkspaceRootSegment(),d=this._rootSegmentName;if(d)this.addTitle(f,d);else if(this.finalSegment(f,d),this._resource&&this._resource.Parents&&(this.buildSegments(d,"reverse"),this.measureSegments(),this.firstSegment(f)),this.crumbs.offsetWidth>=
this.MAX_LENGTH)this.INCLUDE_FIRST_SECTION=!1},render:function(){this.refresh();var f=this.getNavigatorWorkspaceRootSegment(),d=this._rootSegmentName;d?this.addTitle(f,d):(this.INCLUDE_FIRST_SECTION===!0&&this.firstSegment(f),this._resource&&this._resource.Parents&&(this.drawSegments(),this.finalSegment(f,d)));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(h,k,j){function f(d){k.attach(this);this._init(d)}f.prototype={_init:function(d){this._tracking=null;this._animationDelay=501;this._closeReversely=d.closeReversely;this.$node=j.node(d.node);if(!this.$node)throw"no dom node for splitter found";this.$sideNode=j.node(d.sidePanel);if(!this.$sideNode)throw"no dom node for side panel found";this.$mainNode=j.node(d.mainPanel);if(!this.$mainNode)throw"no dom node for main panel found";
this._vertical=d.vertical;this._prefix="/orion/splitter/"+(this.$node.id||document.body.id||"");if(d.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 d.closeByDefault!=="undefined")this._closeByDefault=d.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(d){this.addEventListener("resize",function(f){d(f.node)})},_initializeFromStoredSettings:function(){var d=localStorage.getItem(this._prefix+"/toggleState");this._closed=typeof d==="string"?d==="closed":this._closeByDefault;var d=j.bounds(this.$node.parentNode),f=j.bounds(this.$node),b;if(this._vertical)if(b=localStorage.getItem(this._prefix+"/yPosition")){if(this._splitTop=parseInt(b,10),this._splitTop>d.top+d.height-f.height)this._splitTop=d.top+d.height/
2}else{if(this._closeByDefault)this._initialSplit=this._getSplitPosition(),this._splitTop=0}else if(b=localStorage.getItem(this._prefix+"/xPosition")){if(this._splitLeft=parseInt(b,10),this._splitLeft>d.left+d.width-f.width)this._splitLeft=d.left+d.width/2}else if(this._closeByDefault)this._initialSplit=this._getSplitPosition(),this._splitLeft=0},_getSplitPosition:function(){var d=j.bounds(this.$node),f=j.bounds(this.$node.parentNode);return this.vertical?d.top-f.top:d.left-f.left},_adjustToSplitPosition:function(d){var f=
j.bounds(this.$node),b=j.bounds(this.$node.parentNode);if(this._vertical){this._splitHeight=f.height;if(d||!this._splitTop)this._splitTop=f.top,localStorage.setItem(this._prefix+"/yPosition",this._splitTop);d=this._splitTop;this.$node.parentNode.style.position==="relative"&&(d=this._splitTop-b.top);this.$sideNode.style.height=d+"px";this.$sideNode.style.display="block";this.$node.style.top=d+"px"}else{this._splitWidth=f.width;if(d||!this._splitLeft)this._splitLeft=f.left,localStorage.setItem(this._prefix+
"/xPosition",this._splitLeft);d=this._splitLeft;this.$node.parentNode.style.position==="relative"&&(d=this._splitLeft-b.left);this.$sideNode.style.width=d+"px";this.$sideNode.style.display="block";this.$node.style.left=d+"px"}this._resize()},_resize:function(d,f,b){var d=d||0,g=j.bounds(this.$node.parentNode),e=j.bounds(this.$node);this._vertical?(b===void 0&&(b=e.top-g.top),b+=e.height,this.$mainNode.style.top=b+"px"):(f===void 0&&(f=e.left-g.left),f+=e.width,this.$mainNode.style.left=f+"px");var c=
this;window.setTimeout(function(){c._notifyResizeListeners(c.$mainNode);c._notifyResizeListeners(c.$sideNode)},d)},_notifyResizeListeners:function(d){this.dispatchEvent({type:"resize",node:d})},_notifyToggleListeners:function(){this.dispatchEvent({type:"toggle",closed:this._closed})},_thumbDown:function(d,f){d||this._addAnimation();var b=this._splitTop,g=this._splitLeft;if(this._closed){if(this._closed=!1,!this._splitLeft&&!this._splitTop&&typeof this._initialSplit==="number")b=g=this._initialSplit}else if(this._closed=
!0,this._closeReversely){var e=j.bounds(this.$node.parentNode),c=j.bounds(this.$node);this._vertical?b=e.height-c.height:g=e.width-c.width}else b=g=0;this._vertical?(this.$sideNode.style.height=b+"px",this.$node.style.top=b+"px"):(this.$sideNode.style.width=g+"px",this.$node.style.left=g+"px");this._resize(this._animationDelay,g,b);d||this._removeAnimation();f||localStorage.setItem(this._prefix+"/toggleState",this._closed?"closed":null);var a=this;window.setTimeout(function(){a._notifyToggleListeners()},
this._animationDelay)},_removeAnimation:function(){var d=this;window.setTimeout(function(){d.$sideNode.classList.remove(d._vertical?"sidePanelVerticalLayoutAnimation":"sidePanelLayoutAnimation");d.$mainNode.classList.remove(d._vertical?"mainPanelVerticalLayoutAnimation":"mainPanelLayoutAnimation");d.$node.classList.remove(d._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(d){if(d.target===this._thumb)return j.stop(d),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.setFramesEnabled(!1),j.stop(d)},_mouseMove:function(d){if(this._tracking){var f=j.bounds(this.$node.parentNode);if(this._vertical){this._splitTop=d.clientY;if(this._splitTop<f.top+5)this._splitTop=f.top+5;else if(this._splitTop>f.top+f.height-5)this._splitTop=f.top+f.height-5;var b=this._splitTop,b=this._splitTop-f.top;this.$node.style.top=b+"px"}else{this._splitLeft=d.clientX;if(this._splitLeft<f.left+5)this._splitLeft=f.left+5;else if(this._splitLeft>
f.left+f.width-5)this._splitLeft=f.left+f.width-5;b=this._splitLeft;b=this._splitLeft-2*f.left;this.$node.style.left=b+"px"}this._adjustToSplitPosition(!0);j.stop(d)}},_mouseUp:function(d){if(this._tracking)j.setFramesEnabled(!0),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(d)}};f.prototype.constructor=f;return{Splitter:f}});
define("orion/keyAssist",["i18n!orion/nls/messages","orion/webui/littlelib","orion/util"],function(h,k,j){function f(d){this.commandRegistry=d.commandRegistry;this.create();this._filterString="";this._providers=[]}f.prototype={addProvider:function(d){this._providers.push(d)},create:function(){var d=this._keyAssistDiv=document.createElement("div");d.id="keyAssist";d.style.display="none";d.classList.add("keyAssistFloat");d.setAttribute("role","menu");var f=this._keyAssistInput=document.createElement("input");
f.classList.add("keyAssistInput");f.type="text";f.placeholder=h["Filter bindings"];d.appendChild(f);var b=this._keyAssistContents=document.createElement("div");b.classList.add("keyAssistContents");if(j.isIOS||j.isAndroid)b.style.overflowY="auto";d.appendChild(b);var g=this._keyAssistTable=document.createElement("table");g.tabIndex=0;g.classList.add("keyAssistList");b.appendChild(g);document.body.appendChild(d);f.addEventListener("keydown",function(e){this._keyDown(e)}.bind(this));g.addEventListener("keydown",
function(e){this._keyDown(e)}.bind(this));f.addEventListener("input",function(){this.filterChanged()}.bind(this));b.addEventListener(j.isFirefox?"DOMMouseScroll":"mousewheel",function(e){this._scrollWheel(e)}.bind(this));document.addEventListener("keydown",function(e){e.keyCode===k.KEY.ESCAPE&&this.hide()}.bind(this));k.addAutoDismiss([d],function(){this.hide()}.bind(this))},createContents:function(){k.empty(this._keyAssistTable);this._selectedIndex=-1;this._selectedRow=null;for(var d=this._idCount=
this._keyAssistContents.scrollTop=0;d<this._providers.length;d++)this._providers[d].showKeyBindings(this);this.createHeader(h.Global);this.commandRegistry.showKeyBindings(this)},createItem:function(d,f,b){if(this._filterString){var g=this._filterString.toLowerCase(),e;g!==this._filterString?(g=this._filterString,e=function(a){return a}):e=function(a){return a.toLowerCase()};if(e(f).indexOf(g)===-1&&e(d).indexOf(g)===-1&&e(this._lastHeader).indexOf(g)===-1)return}var c=this._keyAssistTable.insertRow(-1);
c.id="keyAssist-keyBinding-"+this._idCount++;c.setAttribute("role","menuitem");c._execute=b;c.classList.add("keyAssistItem");c.addEventListener("click",function(a){this._selectedRow=c;this.execute();a.preventDefault()}.bind(this));b=c.insertCell(-1);b.classList.add("keyAssistName");b.appendChild(document.createTextNode(f));b=c.insertCell(-1);b.classList.add("keyAssistAccel");b.appendChild(document.createTextNode(d))},createHeader:function(d){this._lastHeader=d;var f=this._keyAssistTable.insertRow(-1);
f.classList.add("keyAssistSection");var f=f.insertCell(-1),b=document.createElement("h2");b.appendChild(document.createTextNode(d));f.appendChild(b)},execute:function(){window.setTimeout(function(){this.hide();var d=this._selectedRow;this._selectedRow=null;d&&d._execute&&d._execute()}.bind(this),0)},filterChanged:function(){this._timeout&&window.clearTimeout(this._timeout);this._timeout=window.setTimeout(function(){this._timeout=null;var d=this._keyAssistInput.value;if(this._filterString!==d)this._filterString=
d,this.createContents()}.bind(this),100)},hide:function(){if(this.isVisible()){var d=document.activeElement,f=this._keyAssistDiv,d=f===d||(f.compareDocumentPosition(d)&16)!==0;f.style.display="none";d&&document.compareDocumentPosition(this._previousActiveElement)!==1&&this._previousActiveElement.focus();this._previousActiveElement=null}},isVisible:function(){return this._keyAssistDiv.style.display==="block"},removeProvider:function(d){d=this._providers.indexOf(d);d!==-1&&this._providers.splice(d,
1)},select:function(d){var f=this._keyAssistTable.querySelectorAll(".keyAssistItem");if(f.length===0)this._selectedIndex=-1;else{var b=this._selectedIndex;b+=d?1:-1;b%=f.length;b<0&&(b=f.length-1);if(this._selectedIndex!==-1)d=f[this._selectedIndex],d.classList.remove("selected"),this._selectedRow=null;this._selectedIndex=b;if(this._selectedIndex!==-1){this._selectedRow=d=f[this._selectedIndex];d.classList.add("selected");this._keyAssistTable.setAttribute("aria-activedescendant",d.id);this._keyAssistTable.focus();
var f=d.getBoundingClientRect(),g=this._keyAssistContents,e=g.getBoundingClientRect();d.offsetTop<g.scrollTop?b===0?g.scrollTop=0:d.scrollIntoView(!0):f.bottom>e.bottom&&d.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(d){if(d.keyCode===40)this.select(!0);else if(d.keyCode===38)this.select(!1);else if(d.keyCode===13)this.execute();else return;d.preventDefault()},_scrollWheel:function(d){var f=0,f=j.isIE||j.isOpera?-d.wheelDelta:j.isFirefox?d.detail*40:-d.wheelDeltaY,b=this._keyAssistContents,g=b.scrollTop;b.scrollTop+=f;if(g!==b.scrollTop)return d.preventDefault&&d.preventDefault(),!1}};return{KeyAssistPanel:f}});
define("orion/widgets/themes/ThemePreferences",[],function(){function h(h,j){this._preferences=h;this._themeData=j;var f=j.getThemeStorageInfo();this._themeVersion=f.version;var d=h.listenForChangedSettings(f.storage,2,function(f){f.key===d&&this.apply()}.bind(this))}h.prototype={_initialize:function(h,j,f){var d,i;this._themeVersion===void 0||f.get("version")===this._themeVersion?(d=f.get(h.styleset),(i=f.get("selected"))&&(i=JSON.parse(i))):i=d=null;d||(d=j.getStyles(),f.put(h.styleset,JSON.stringify(d)));
if(!i||i[h.selectedKey]===void 0)i=i||{},i[h.selectedKey]=h.defaultTheme,f.put("selected",JSON.stringify(i));f.put("version",this._themeVersion)},apply:function(){this.setTheme()},getTheme:function(h){var j=this._themeData,f=j.getThemeStorageInfo();this._preferences.getPreferences(f.storage,2).then(function(d){this._initialize(f,j,d);var i=JSON.parse(d.get("selected")),d=JSON.parse(d.get(f.styleset)),b;if(d)for(var g=0;g<d.length;g++)if(d[g].name===i[f.selectedKey]){b=d[g];break}h({style:b,styles:d})}.bind(this))},
setTheme:function(h,j){var f=this._themeData,d=f.getThemeStorageInfo();this._preferences.getPreferences(d.storage,2).then(function(i){this._initialize(d,f,i);var b=JSON.parse(i.get("selected"));h||(h=b[d.selectedKey]);b[d.selectedKey]=h;i.put("selected",JSON.stringify(b));j?i.put(d.styleset,JSON.stringify(j)):j=JSON.parse(i.get(d.styleset));for(var g=0;g<j.length;g++)if(j[g].name===b[d.selectedKey]){f.processSettings(j[g]);break}i.put("version",this._themeVersion)}.bind(this))},setFontSize:function(h){var j=
this._themeData,f=j.getThemeStorageInfo();this._preferences.getPreferences(f.storage,2).then(function(d){this._initialize(f,j,d);var i=JSON.parse(d.get("selected")),b=JSON.parse(d.get(f.styleset)),g;if(b)for(var e=0;e<b.length;e++)b[e].fontSize=h,b[e].name===i[f.selectedKey]&&(g=b[e]);d.put(f.styleset,JSON.stringify(b));j.processSettings(g)}.bind(this))}};return{ThemePreferences:h}});
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:"Git","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",Export:"Export","Export a theme":"Export a theme","Theme name:":"Theme name:",yourTheme:"yourTheme",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 the local editor settings drop down.",editorSettingsInfo:"Use the ${0} and ${1} to toggle whether a given setting is shown in the local editor settings drop down ${2}.",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",languageTools:"Language Tools",showOccurrences:"Show Occurrences",contentAssistAutoTrigger:"Show Content Assist automatically","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(h,k){var j={root:k};Object.keys(h).forEach(function(f){typeof j[f]==="undefined"&&(j[f]=h[f])});return j});
define("orion/editor/eventTarget",[],function(){function h(){}h.addMixin=function(k){var j=h.prototype,f;for(f in j)j.hasOwnProperty(f)&&(k[f]=j[f])};h.prototype={addEventListener:function(h,j,f){if(!this._eventTypes)this._eventTypes={};var d=this._eventTypes[h];d||(d=this._eventTypes[h]={level:0,listeners:[]});d.listeners.push({listener:j,useCapture:f})},dispatchEvent:function(h){var j=h.type;this._dispatchEvent("pre"+j,h);this._dispatchEvent(j,h);this._dispatchEvent("post"+j,h)},_dispatchEvent:function(h,
j){var f=this._eventTypes?this._eventTypes[h]:null;if(f){var d=f.listeners;try{if(f.level++,d)for(var i=0,b=d.length;i<b;i++)if(d[i]){var g=d[i].listener;typeof g==="function"?g.call(this,j):g.handleEvent&&typeof g.handleEvent==="function"&&g.handleEvent(j)}}finally{if(f.level--,f.compact&&f.level===0){for(i=d.length-1;i>=0;i--)d[i]||d.splice(i,1);d.length===0&&delete this._eventTypes[h];f.compact=!1}}}},isListening:function(h){return!this._eventTypes?!1:this._eventTypes[h]!==void 0},removeEventListener:function(h,
j,f){if(this._eventTypes){var d=this._eventTypes[h];if(d){for(var i=d.listeners,b=0,g=i.length;b<g;b++){var e=i[b];if(e&&e.listener===j&&e.useCapture===f){d.level!==0?(i[b]=null,d.compact=!0):i.splice(b,1);break}}i.length===0&&delete this._eventTypes[h]}}}};return{EventTarget:h}});
define("orion/editor/textTheme",["require","orion/editor/eventTarget","orion/util"],function(h,k,j){function f(d){d=d||{};this._document=d.document||document}var d={};f.getTheme=function(i){var i=i||"default",b=d[i];b||(b=d[i]=new f);return b};f.prototype={getThemeClass:function(){return this._themeClass},setThemeClass:function(d,b){var g=this,e=g._themeClass;g._themeClass=d;this._load(d,b,function(){g.onThemeChanged({type:"ThemeChanged",oldValue:e,newValue:g.getThemeClass()})})},onThemeChanged:function(d){return this.dispatchEvent(d)},
buildStyleSheet:function(d,b){function g(c,a,b){a&&(e.push("."+d+" ."+c+" {"),e.push("\t"+(b?"background-color":"color")+": "+a+";"),e.push("}"))}var e=[];e.push("");e.push("."+d+" {");b.fontFamily&&e.push("\tfont-family: "+b.fontFamily+";");b.fontSize&&e.push("\tfont-size: "+b.fontSize+";");b.fontSize&&e.push("\tcolor: "+b.text+";");e.push("}");e.push("."+d+".textview {");b.background&&e.push("\tbackground-color: "+b.background+";");e.push("}");g("ruler.annotations",b.annotationRuler,!0);g("ruler.lines",
b.annotationRuler,!0);g("ruler.folding",b.annotationRuler,!0);g("ruler.overview",b.overviewRuler,!0);g("rulerLines",b.lineNumber,!1);g("rulerLines.even",b.lineNumberEven,!1);g("rulerLines.odd",b.lineNumberOdd,!1);g("annotationLine.currentLine",b.currentLine,!0);g("entity-name-tag",b.keyword,!1);g("entity-other-attribute-name",b.attribute,!1);g("string-quoted",b.string,!1);g("meta.annotation.currentLine",b.currentLine,!0);g("keyword",b.keyword,!1);g("string",b.string,!1);g("comment",b.comment,!1);
g("comment.block.documentation",b.comment,!1);g("keyword.other.documentation.markup",b.comment,!1);return e.join("\n")},_createStyle:function(d,b,g,e){var c=this._document,d="orion-theme-"+d,a=c.getElementById(d);if(a){if(e||a.firstChild.data===b)return;a.removeChild(a.firstChild);a.appendChild(c.createTextNode(b))}else e?(a=j.createElement(c,"link"),a.rel="stylesheet",a.type="text/css",a.href=b,a.addEventListener("load",function(){g()})):(a=j.createElement(c,"style"),a.appendChild(c.createTextNode(b))),
a.id=d,(c.getElementsByTagName("head")[0]||c.documentElement).appendChild(a);e||g()},_load:function(d,b,g){if(d)if(typeof b==="string")this._createStyle(d,b,g);else if(b=b.href,b.substring(b.length-4)!==".css"&&(b+=".css"),/^\//.test(b)||/[a-zA-Z0-9]+:\/\//i.test(b)||!h.toUrl)this._createStyle(d,b,g,!0);else{var e=this;h(["text!"+b],function(c){e._createStyle(d,c,g,!1)})}else g()}};k.EventTarget.addMixin(f.prototype);return{TextTheme:f}});
define("orion/widgets/themes/ThemeClass",[],function(){function h(h){this.attributes=[];this.element=document.createElement("div");this.style=this.element.style;this.className=h;this.classString="."+h+"{ "}h.prototype.className=null;h.prototype.classString=void 0;h.prototype.style=void 0;h.prototype.closeString=" }\n";h.prototype.toString=function(){return this.classString=this.classString+this.style.cssText+this.closeString};return{ThemeClass:h}});
define("orion/widgets/themes/container/ThemeSheetWriter",["orion/widgets/themes/ThemeClass"],function(h){function k(){}k.prototype.navbar="white";k.prototype.button="#777777";k.prototype.location="#EFEFEF";k.prototype.selection="#cedce7";k.prototype.sidepanel="#F7F7F7";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="",f=[],d=new h.ThemeClass("orionPage");
d.style.backgroundColor="#fdfdfd";d.style.width="100%";d.style.height="100%";f.push(d);d=new h.ThemeClass("topRowBanner");d.style.margin="0";d.style.border="0";d.style.backgroundColor=this.navbar;d.style.height="16px";d.style.padding="10px";d.style.paddingLeft="6px";d.style.paddingRight="2px";d.style.borderBottom="none";d.style.boxShadow="0 2px 2px 0 rgba(0, 0, 0, 0.1),0 1px 0 0 rgba(0, 0, 0, 0.1)";d.style.zIndex="100";f.push(d);d=new h.ThemeClass("a");d.style.textDecoration="none";d.style.color=
this.content;f.push(d);d=new h.ThemeClass("navlink");d.style.display="inline-block";d.style.padding="2px";d.style.color=this.content;d.style.verticalAlign="bottom";f.push(d);d=new h.ThemeClass("primaryNav");d.style.color=this.navtext;d.style.fontSize="8pt";d.style.fontWeight="normal";d.style.paddingTop="0";d.style.verticalAlign="baseline";f.push(d);d=new h.ThemeClass("primaryNav a");d.style.fontSize="8pt";d.style.color=this.navtext;d.style.marginRight="6px";d.style.marginLeft="6px";d.style.verticalAlign=
"baseline";d.style.textDecoration="none";f.push(d);d=new h.ThemeClass("primaryNav a:hover");d.style.color="#bfbfbf";d.style.cursor="hand";d.style.color="white";d.style.fontWeight="normal";f.push(d);for(var i in f)j+=f[i].toString();return j};k.prototype.writeLocationStyle=function(){var j="",f=[],d=new h.ThemeClass("titleArea");d.style.margin="0";d.style.paddingTop="5px";d.style.border="0";d.style.background=this.location;d.style.background="-webkit-gradient(linear, left top, left bottom, color-stop(0%,"+
this.location+"), color-stop(100%,"+this.location+"))";d.style.borderBottom="1px solid "+this.location;d.style.minHeight="20px";f.push(d);d=new h.ThemeClass("breadcrumb");d.style.fontSize="8pt";d.style.textDecoration="none";d.style.color="#f1f1f2;";d.style.paddingTop="2px";f.push(d);d=new h.ThemeClass("a.breadcrumb:hover");d.style.textDecoration="none";d.style.borderBottom="1px dotted";d.style.color="#F58B0F";d.style.cursor="pointer";f.push(d);d=new h.ThemeClass("breadcrumbSeparator");d.style.fontSize=
"8pt";d.style.textDecoration="none";d.style.color=this.separator;d.style.fontWeight="bold";f.push(d);d=new h.ThemeClass("currentLocation");d.style.fontWeight="bold";d.style.fontSize="8pt";d.style.color=this.breadcrumb;d.style.textDecoration="none";d.style.textWrap="normal";d.style.lineHeight="10pt";f.push(d);d=new h.ThemeClass("a.currentLocation:hover");d.style.fontWeight="bold";d.style.fontSize="10pt";d.style.color="#666666";d.style.textDecoration="none";d.style.borderBottom="0";f.push(d);d=new h.ThemeClass("navlinkonpage");
d.style.color=this.content;d.style.verticalAlign="middle";f.push(d);if(this.bannerProgress)d=new h.ThemeClass("topRowBanner .progressPane_running"),d.style.borderColor=this.bannerProgress,f.push(d);for(var i in f)j+=f[i].toString();return j};k.prototype.writeButtonStyle=function(){var j="",f=[],d=new h.ThemeClass("commandButton");d.style.color="#666";d.style.border="1px solid #dedede";d.style.backgroundColor="#ddd";d.style.textAlign="center";d.style.verticalAlign="middle";d.style.cursor="pointer";
d.style.display="inline-block";d.style.padding="4px 6px";d.style.borderRadius="3px";d.style.lineHeight="12px";d.style.fontSize="9pt";d.style.userSelect="none";f.push(d);d=new h.ThemeClass("commandButton:over");d.style.backgroundColor="#e6e6e6";d.style.border="1px solid #808080";f.push(d);d=new h.ThemeClass("commandMenu");d.style.color="#222";d.style.display="inline-block";d.style.verticalAlign="baseline";d.style.margin="0";d.style.fontSize="8pt";d.style.fontWeight="normal";d.style.border="1px solid #dedede";
d.style.backgroundColor="#efefef";d.style.cursor="pointer";d.style.borderRadius="1px";f.push(d);d=new h.ThemeClass("commandMenuItem");d.style.border="0";d.style.padding="0";d.style.margin="0";f.push(d);for(var i in f)j+=f[i].toString();return j};k.prototype.writeMainStyle=function(){var j="",f=[],d=new h.ThemeClass("searchbox");d.style.backgroundImage="url(../images/core_sprites.png)";d.style.backgroundRepeat="no-repeat";d.style.backgroundPosition="4px -297px";d.style.width="12px";d.style.height=
"12px";d.style.backgroundColor=this.search;d.style.border="1px solid "+this.search;d.style.fontSize="11px";d.style.width="15em";d.style.height="16px";d.style.borderRadius="10px";d.style.color="#999";d.style.padding="0";d.style.paddingLeft="20px";d.style.marginLeft="5px";d.style.marginTop="6px !important";d.style.font="7pt Lucida Sans Unicode,Lucida Grande,Verdana,Arial,Helvetica,Myriad,Tahoma,clean,sans-serif !important";f.push(d);d=new h.ThemeClass("searchbox:focus");d.style.color="white";d.style.outline=
"none";f.push(d);d=new h.ThemeClass("checkedRow");d.style.cssText="background-color:"+this.selection+" !important;";f.push(d);d=new h.ThemeClass("navbar-item-selected");d.style.background=this.selection;d.style.color=this.content;f.push(d);d=new h.ThemeClass("auxpane");d.style.border="0";d.style.background=this.sidepanel;f.push(d);d=new h.ThemeClass("mainpane");d.style.background=this.mainpanel;d.style.border=0;f.push(d);d=new h.ThemeClass("mainToolbar");d.style.background=this.toolpanel;f.push(d);
for(var i in f)j+=f[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(h){h.navbar.value?(this.navbar=h.navbar.value,this.button=h.button.value,this.location=h.location.value,this.selection=h.selection.value,this.sidepanel=h.sidepanel.value,this.mainpanel=h.mainpanel.value,this.navtext=h.navtext.value,this.search=
h.search.value,this.content=h.content.value,this.toolpanel=h.toolpanel.value,this.bannerProgress=h.bannerProgress.value):(this.navbar=h.navbar,this.button=h.button,this.location=h.location,this.selection=h.selection,this.sidepanel=h.sidepanel,this.mainpanel=h.mainpanel,this.navtext=h.navtext,this.search=h.search,this.content=h.content,this.toolpanel=h.toolpanel,this.bannerProgress=h.bannerProgress);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(h,k,j){function f(){}function d(){this.styles=[];var b=new f;b.name="Orion";b.navbar="white";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";b.bannerProgress="whitesmoke";
this.styles.push(b);b=new f;b.name="Orion2014";b.navbar="white";b.button="#EFEFEF";b.location="#EFEFEF";b.selection="FEC";b.sidepanel="#EEEEEE";b.mainpanel="#EEEEEE";b.toolpanel="#EEEEEE";b.navtext="#BFBFBF";b.content="#333333";b.search="#444444";b.breadcrumb="#333333";b.separator="#333333";b.bannerProgress="orange";this.styles.push(b);b=new f;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";b.bannerProgress="#F2F2F2";this.styles.push(b);b=new f;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";b.bannerProgress="#F2F2F2";this.styles.push(b);b=new f;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";b.bannerProgress="#F2F2F2";this.styles.push(b);b=new f;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";b.bannerProgress="#F2F2F2";this.styles.push(b);b=new f;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";b.bannerProgress="#F2F2F2";this.styles.push(b);
b=new f;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";b.bannerProgress="#F2F2F2";this.styles.push(b)}function i(){return this.styles}f.prototype.name="Orion";f.prototype.navbar="#404648";f.prototype.button="#EFEFEF";f.prototype.location="#333";f.prototype.breadcrumb="#3087B3";f.prototype.separator=
"#333";f.prototype.selection="FEC";f.prototype.sidepanel="#FBFBFB";f.prototype.mainpanel="white";f.prototype.toolpanel="white";f.prototype.navtext="#bfbfbf";f.prototype.content="#3087B3";f.prototype.search="#444";f.prototype.bannerProgress="white";d.prototype.styles=[];d.prototype.getStyles=i;d.prototype.getThemeStorageInfo=function(){return{storage:"/themes",styleset:"styles",defaultTheme:"Orion2014",selectedKey:"selected",version:"5.0"}};d.prototype.getViewData=function(){var b={top:10,left:10,
width:350,height:350};b.shapes=[{type:"RECTANGLE",name:h["Navigation Bar"],x:10,y:10,width:350,height:32,family:"navbar",fill:"#333",order:1},{type:"TEXT",name:h["Navigation Text"],label:"UserName",x:290,y:30,family:"navtext",fill:"#bfbfbf",font:"8pt sans-serif"},{type:"ROUNDRECTANGLE",name:h["Search Box"],x:215,y:20,width:70,height:12,family:"search",fill:"#444",order:3},{type:"RECTANGLE",name:h["Tool Panel"],x:150,y:71,width:209,height:30,family:"toolpanel",fill:"white",order:4},{type:"RECTANGLE",
name:h["Selection Bar"],x:155,y:133,width:200,height:20,family:"selection",fill:"#FEC",order:7},{type:"RECTANGLE",name:h.Location,x:10,y:42,width:350,height:29,family:"location",fill:"#efefef",order:8},{type:"TEXT",name:h["Navigation Text"],label:"Navigator",x:60,y:30,family:"navtext",fill:"#bfbfbf",font:"8pt sans-serif",order:2},{type:"TEXT",name:h.Content,label:"Breadcrumb",x:15,y:60,family:"content",fill:"#3087B3",font:"8pt sans-serif"},{type:"TEXT",name:h.Content,label:"/",x:78,y:60,family:"content",
fill:"#3087B3",font:"8pt sans-serif",order:9},{type:"TEXT",name:h.Content,label:"Location",x:84,y:60,family:"content",fill:"#3087B3",font:"8pt sans-serif"},{type:"RECTANGLE",name:h["Main Panel"],x:150,y:101,width:209,height:258,family:"mainpanel",fill:"white",order:6},{type:"ROUNDRECTANGLE",name:h.Button,x:155,y:76,width:37,height:20,family:"button",fill:"#EFEFEF",order:11},{type:"TEXT",name:h["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:h["Section Text"],label:"Section",x:30,y:94,family:"navbar",fill:"#333",font:"8pt sans-serif"},{type:"LINE",name:h["Line Color"],x1:150,y1:101,x2:360,y2:101,linewidth:2,fill:"#DEDEDE"},{type:"LINE",name:h["Line Color"],x1:150,y1:71,x2:150,y2:360,linewidth:2,fill:"#DEDEDE"},{type:"LINE",name:h["Line Color"],
x1:20,y1:100,x2:140,y2:100,linewidth:2,fill:"#DEDEDE"},{type:"RECTANGLE",name:h["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:h["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 g=0;g<3;g++)b.shapes.push({type:"TEXT",name:h.Content,label:"org.eclipse.orion.content",x:170,y:127+20*g,fill:"#3087B3",family:"content"});for(g=0;g<3;g++)b.shapes.push({type:"TEXT",name:h.Content,label:"Item",x:25,y:115+20*g,fill:"#3087B3",family:"content"});for(g=0;g<3;g++)b.shapes.push({type:"TRIANGLE",
name:"twisty",x1:160,y1:121+g*20,x2:165,y2:124+g*20,x3:160,y3:127+g*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};d.prototype.processSettings=function(b){var g=new j.ThemeSheetWriter;(new k.TextTheme.getTheme("orionTheme")).setThemeClass("orionTheme",g.getSheet(b))};return{ThemeData:d,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","FileName FolderName":"FileName FolderName(Optional)","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","Report a Bug":"Report a Bug","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(h,k){var j={root:k};Object.keys(h).forEach(function(f){typeof j[f]==="undefined"&&(j[f]=h[f])});return j});
define("orion/widgets/userAssistance/UATaskPanel",["orion/webui/littlelib"],function(h){function k(j,f,d){this.elements=d;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);f===!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),h.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(h){var f=document.createElement("span");f.className="UAContainer-icon";f.innerHTML='<span class="workingSpan"><img src="'+h.image+'" id="'+h.label+'ImageNode" alt="'+h.alt+'" height="64" width="64"></span><span class="UAIcon-label"><span class="UALabel" id="'+h.label+'LabelNode" >'+h.label+"</span></span>";f.onmouseover=function(){document.getElementById(h.label+"ImageNode").src=h.secondaryImage;document.getElementById(h.label+"LabelNode").className="UALabel-live";f.className="UAContainer-icon-live"};
f.onmouseout=function(){document.getElementById(h.label+"ImageNode").src=h.image;document.getElementById(h.label+"LabelNode").className="UALabel";f.className="UAContainer-icon"};var d=this;f.onclick=function(){d.showMedia(h)};this.elementNode.appendChild(f)};k.prototype.clearElements=function(){this.elementNode.innerHTML=""};k.prototype.showMedia=function(h){this.clearElements();this.addElement(h);var f=document.createElement("span");f.className="UAContainer-media";f.innerHTML='<div></div><div></div><span class="mediaSpan"><img src="'+
h.media+'" alt="'+h.alt+'" height="300" width="400"></span>';this.elementNode.appendChild(f);setTimeout(function(){f.style.opacity=1},100);h=document.getElementById(h.label+"switch");this.chosenSwitch.firstChild.className="circle";this.chosenSwitch=h.parentNode;h.className="chosenCircle"};k.prototype.createSwitch=function(h){var f;f=h?h.label+"switch":"indexSwitch";var d=document.createElement("span");d.className="workingSpan";d.innerHTML='<div class="circle" id ="'+f+'"></div>';var i=this;d.onclick=
h?function(){i.showMedia(h)}:function(){i.initialize();i.chosenSwitch.firstChild.className="circle";i.chosenSwitch=d;i.chosenSwitch.firstChild.className="chosenCircle"};this.switches.appendChild(d);return this.radioButtons[this.radioButtons.length]=d};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(h,k,j,f){function d(){}var i=null;d.prototype={DISABLED:"disabled",CONTAINERTEMPLATE:'<div class="dialog" role="dialog"><div class="dialogTitle"><span id="title" class="dialogTitleText layoutLeft"></span><button aria-label="Close" class="dismissButton layoutRight core-sprite-close imageSprite" id="closeDialog"></button></div><div id="dialogContent" class="dialogContent layoutBlock"></div><div id="buttons" class="dialogButtons"></div></div>',
_initialize:function(){var b=document.body;this.$frameParent=b;this.$$modalExclusions=this.$$modalExclusions||[];var g=document.createRange();g.selectNode(b);g=g.createContextualFragment(this.CONTAINERTEMPLATE);b.appendChild(g);this.$frame=b.lastChild;this.title&&j.$("#title",this.$frame).appendChild(document.createTextNode(this.title));this.$close=j.$("#closeDialog",this.$frame);var e=this;this.$close.addEventListener("click",function(){e.hide()},!1);this.$parent=j.$(".dialogContent",this.$frame);
g=document.createRange();g.selectNode(this.$parent);b=g.createContextualFragment(this.TEMPLATE);this.messages&&j.processTextNodes(b,this.messages);this.$parent.appendChild(b);this.$buttonContainer=j.$(".dialogButtons",this.$frame);this._makeButtons();this.$frame.addEventListener("keydown",function(c){c.keyCode===j.KEY.ESCAPE?e.hide():c.keyCode===j.KEY.ENTER&&typeof e._defaultCallback==="function"&&e._defaultCallback()},!1);this._bindElements(this.$parent);typeof this._bindToDom==="function"&&this._bindToDom(this.$parent);
this.modal&&this._makeModal()},_makeButtons:function(){if(this.$buttonContainer&&Array.isArray(this.buttons)){var b=this;this.buttons.forEach(function(g){var e=f.createButton(g.text,g.callback);if(g.id)e.id=g.id,b["$"+e.id]=e;if(g.isDefault)b._defaultCallback=g.callback,b._defaultButton=e;b.$buttonContainer.appendChild(e)})}},_makeModal:function(){var b=this;this.$frame.addEventListener("blur",function(a){b.$lastFocusedElement=a.target},!0);this._modalListener=function(a){var c=!j.contains(b.$frame,
a.target);if(c)for(var e=0;e<b.$$modalExclusions.length;e++)if(j.contains(b.$$modalExclusions[e],a.target)){c=!1;break}c&&(window.setTimeout(function(){(b.$lastFocusedElement||b.$parent).focus()},0),j.stop(a))};this.$frameParent.addEventListener("focus",this._modalListener,!0);this.$frameParent.addEventListener("click",this._modalListener,!0);var g=this.$frameParent.childNodes,e=!1;this._addedBackdrop=[];for(var c=0;c<g.length;c++){for(var a=0;a<this.$$modalExclusions.length;a++)if(j.contains(this.$$modalExclusions[a],
g[c])){e=!0;break}!e&&g[c]!==b.$frame&&g[c].classList&&!g[c].classList.contains("tooltipContainer")&&(a=g[c],a.classList.contains("modalBackdrop")||(a.classList.add("modalBackdrop"),this._addedBackdrop.push(a)))}(g=j.lastTabbable(this.$buttonContainer)||j.lastTabbable(this.$parent))&&g.addEventListener("keydown",function(a){if(a.keyCode===j.KEY.TAB){var c=b._getFirstFocusField();c&&c!==a.target&&c.focus();j.stop(a)}},!1)},_addChildDialog:function(b){this.$$modalExclusions.push(b.$frame||b.$parent)},
_inModalExclusion:function(b){return this.$$modalExclusions.some(function(g){return b.$frame===g||b.$parent===g})},_bindElements:function(b){for(var g=0;g<b.childNodes.length;g++){var e=b.childNodes[g];e.id&&(this["$"+e.id]=e);this._bindElements(e)}},hide:function(b){!b&&i===this&&(i=null);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");j.setFramesEnabled(!0);typeof this._afterHiding==="function"&&this._afterHiding();var g=this;this.keepAlive||window.setTimeout(function(){g.destroy()},0)},show:function(b){if(this.modal)if(i){if(!i._inModalExclusion(this)){this.hide(!0);return}}else i=this;typeof this._beforeShowing==="function"&&this._beforeShowing();j.setFramesEnabled(!1);var g=j.bounds(this.$frame),e=j.bounds(document.documentElement),c;b?(c=j.bounds(b),b=c.top+c.height+4,c=c.left+
4,b+g.height>e.height&&(b=Math.max(0,e.height-g.height-4)),c+g.width>e.width&&(c=Math.max(0,e.width-g.width-4))):(c=Math.max(0,(e.width-g.width)/2),b=Math.max(0,(e.height-g.height)/2));this.$lastFocusedElement=document.activeElement;this.$frame.style.top=b+"px";this.$frame.style.left=c+"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(){if(this.$frame)i===this&&(i=null),j.setFramesEnabled(!0),this._addedBackdrop&&this._addedBackdrop.length>0&&this._addedBackdrop.forEach(function(b){b.classList.remove("modalBackdrop")}),this.$frameParent.removeEventListener("focus",this._modalListener,!0),this.$frameParent.removeEventListener("click",this._modalListener,!0),this.$frameParent.removeChild(this.$frame),this.$parent=this.$frame=void 0}};d.prototype.constructor=
d;return{Dialog:d}});
define("orion/widgets/UserMenu","i18n!orion/widgets/nls/messages,require,orion/webui/littlelib,orion/PageLinks,orion/widgets/userAssistance/UATaskPanel,orion/webui/dialog".split(","),function(h,k,j,f,d){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 g=0,e;for(e in b)b.hasOwnProperty(e)&&g++;return g},_makeMenuItem:function(b,
g){var e=document.createElement("span");e.role="menuitem";e.tabIndex=0;var c=document.createTextNode(b);e.appendChild(c);typeof this._dropDownItemClass==="string"?this._dropDownItemClass!==""&&e.classList.add(this._dropDownItemClass):e.classList.add("dropdownMenuItem");e.addEventListener("click",g,!1);e.addEventListener("keydown",function(a){(a.keyCode===j.KEY.ENTER||a.keyCode===j.KEY.SPACE)&&g()},!1);return e},_renderAuthenticatedService:function(b){var g=this,e=this.authenticatedServices[b].authService;
if(e&&e.logout&&this._displaySignOut){var c=document.createElement("li"),a=this._makeMenuItem(h["Sign Out"],function(){e.logout().then(function(){g.addUserItem(b,e,g.authenticatedServices[b].label);localStorage.removeItem(b);localStorage.removeItem("lastLogin");for(var a=localStorage.length-1;a>=0;a--){var c=localStorage.key(a);c&&c.indexOf("/orion/preferences/user")===0&&localStorage.removeItem(c)}e.getAuthForm(window.location.href).then(function(a){window.location=a})})});c.appendChild(a);this._dropdownNode.appendChild(c)}},
renderServices:function(){function b(a){e[a]||(e[a]=g.createDocumentFragment());return e[a]}var g=document,e=[],c=this._serviceRegistry;f.getPageLinksInfo(c,"orion.page.link.user").then(function(a){this._dropdown?this._dropdown.empty():this._dropdownNode&&j.empty(this._dropdownNode);a.getAllLinks().forEach(function(a){var c,e;if(a.category&&(e=/user\.(\d+)/.exec(a.category)))c=parseInt(e[1],10);if(typeof c!=="number"||isNaN(c))c=1;c=b(c);e=g.createElement("li");var d=g.createElement("a");d.role="menuitem";
typeof this._dropDownItemClass==="string"?this._dropDownItemClass!==""&&d.classList.add(this._dropDownItemClass):d.classList.add("dropdownMenuItem");d.href=a.href;d.textContent=a.textContent;e.appendChild(d);c.appendChild(e);d.addEventListener("keydown",function(a){(a.keyCode===j.KEY.ENTER||a.keyCode===j.KEY.SPACE)&&d.click()},!1)}.bind(this));if(this.keyAssistFunction){var a=document.createElement("li"),d=this._makeMenuItem(h["Keyboard Shortcuts"],this.keyAssistFunction);typeof this._keyAssistClass===
"string"?this._keyAssistClass!==""&&d.classList.add(this._keyAssistClass):d.classList.add("key-assist-menuitem");a.appendChild(d);b(0).appendChild(a)}if(a=c.getServiceReferences("orion.page.getstarted")[0])d=a.getProperty("data"),a=document.createElement("li"),d=this._makeMenuItem("Getting Started",this.getStartedDialog.bind(this,d)),a.appendChild(d),b(0).appendChild(a);var f=this;e.sort(function(a,c){return a-c}).forEach(function(a,c){if(c<e.length-1&&!this._noSeparator){var b=document.createElement("li");
b.classList.add("dropdownSeparator");var g=document.createElement("span");g.classList.add("dropdownSeparator");b.appendChild(g);a.appendChild(b)}f._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 d(null,!0,b)},setKeyAssist:function(b){this.keyAssistFunction=b;this.renderServices()},addUserItem:function(b,g,e,c){c?
(this.unauthenticatedServices[b]&&delete this.unauthenticatedServices[b],this.authenticatedServices[b]={authService:g,label:e,data:c}):(this.authenticatedServices[b]&&delete this.authenticatedServices[b],this.unauthenticatedServices[b]=this.unauthenticatedServices[b]?{authService:g,label:e,pending:this.unauthenticatedServices[b].pending}:{authService:g,label:e});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(h,k){var j={root:k};Object.keys(h).forEach(function(f){typeof j[f]==="undefined"&&(j[f]=h[f])});return j});
define("orion/searchUtils","i18n!orion/nls/messages,require,orion/regex,orion/commandRegistry,orion/PageUtil,orion/URITemplate".split(","),function(h,k,j,f,d,i){function b(e,c,a){var b="";a&&(b="^");if(b=j.parse("/"+b+e.searchStr+"/"))a=b.pattern,b=b.flags,b.indexOf("i")===-1&&!c.caseSensitive&&(b+="i"),e.regExp={pattern:a,flags:b},e.wildCard=!0}var g={ALL_FILE_TYPE:"*.*"};g.doSearch=function(e,c,a,b){if(e){var d=!0;a==="*"&&(a="");a===""&&(d=b&&b.type!==g.ALL_FILE_TYPE);if(d)a!==""&&g.addRecentSearch(c,
a,b?b.regEx:!1),e=e.createSearchParams(a,!1,!1,b),e=g.generateSearchHref(e),window.location=e}else window.alert(h["Can't search: no search service is available"])};g.generateSearchHelper=function(e,c){var a=e.keyword,d=a,f={};e.fileType&&e.fileType!==g.ALL_FILE_TYPE&&a===""&&(d="*."+e.fileType);if(e.regEx)f.searchStr=a,b(f,e,c);else{var i=a.indexOf("*")>-1,h=a.indexOf("?")>-1;i&&(a=a.split("*").join(".*"));h&&(a=a.split("?").join("."));!i&&!h&&!e.nameSearch?(f.searchStr=e.caseSensitive?a.split("\\").join(""):
a.split("\\").join("").toLowerCase(),f.wildCard=!1):(f.searchStr=e.caseSensitive?a:a.toLowerCase(),b(f,e,c),f.wildCard=!0)}f.searchStrLength=f.searchStr.length;return{params:e,inFileQuery:f,displayedSearchTerm:d}};g.convertSearchParams=function(e){if(e.rows!==void 0)e.rows=parseInt(e.rows,10);if(e.start!==void 0)e.start=parseInt(e.start,10);if(typeof e.regEx==="string")e.regEx=e.regEx.toLowerCase()==="true";if(typeof e.caseSensitive==="string")e.caseSensitive=e.caseSensitive.toLowerCase()==="true";
if(typeof e.nameSearch==="string")e.nameSearch=e.nameSearch.toLowerCase()==="true"};g.copySearchParams=function(e,c){var a={},b;for(b in e)if(e[b]!==void 0&&e[b]!==null&&(c||b!=="replace"))a[b]=e[b];return a};g.generateSearchHref=function(e){var c=k.toUrl("search/search.html"),e=g.copySearchParams(e,!0),a=e.resource;e.resource=void 0;return typeof e.keyword!=="undefined"?(new i(c+"#{,resource,params*}")).expand({resource:a,params:e}):(new i(c+"#{,resource}")).expand({resource:a})};g.generateFindURLBinding=
function(e,c,a,b,g){e={find:c.searchStr,regEx:c.wildCard?!0:void 0,caseSensitive:e.caseSensitive?!0:void 0,replaceWith:typeof b==="string"?b:void 0,atLine:typeof a==="number"?a:void 0};return g?e:","+(new i("{,params*}")).expand({params:e})};g.convertFindURLBinding=function(e){if(typeof e.regEx==="string")e.regEx=e.regEx.toLowerCase()==="true";if(typeof e.caseSensitive==="string")e.caseSensitive=e.caseSensitive.toLowerCase()==="true";if(typeof e.atLine==="string")e.atLine=parseInt(e.atLine,10)};g.replaceRegEx=
function(e,c,a){return e.replace(RegExp(c.pattern,c.flags),a)};g.replaceStringLiteral=function(e,c,a){c=j.parse("/"+c+"/gim");return g.replaceRegEx(e,c,a)};g.searchOnelineLiteral=function(e,c,a){var b;b=0;for(var g=!1,d=[];;)if(b=c.indexOf(e.searchStr,b),b<0)break;else{d.push({startIndex:b,length:e.searchStrLength});g=!0;if(a)break;b+=e.searchStrLength}return g?d:null};g.findRegExp=function(e,c,a,b){if(!c)return null;a=a||"";a+=(a.indexOf("g")===-1?"g":"")+(a.indexOf("m")===-1?"m":"");var g=null;
return(g=RegExp(c,a).exec(e.substring(b)))&&{startIndex:g.index+b,length:g[0].length}};g.searchOnelineRegEx=function(e,c,a){for(var b=0,d=!1,f=[];;)if(b=g.findRegExp(c,e.regExp.pattern,e.regExp.flags,b)){f.push(b);d=!0;if(a)break;b=b.startIndex+b.length}else break;return d?f:null};g.generateNewContents=function(e,c,a,b,d,f){if(b&&c){if(!e)a.contents=[];for(var i=0;i<c.length;i++){for(var h=c[i],j=!1,k=!1,t=[],q,w=0,n=0;n<b.children.length;n++)if(b.children[n].lineNumber-1===i){w=n;for(j=0;j<b.children[n].matches.length;j++)b.children[n+
j].checked!==!1&&t.push(j);k=t.length>0;q=b.children[n].matches;j=!0;break}if(j){if(k){t=g.replaceCheckedMatches(h,d,q,t,f);h=t.replacedStr;for(j=0;j<b.children[w].matches.length;j++)b.children[w+j].newMatches=t.newMatches}else for(j=0;j<b.children[w].matches.length;j++)b.children[w+j].newMatches=b.children[w+j].matches;e?a.contents[i]=h:a.contents.push(h)}else e||a.contents.push(h)}}};g.generateMatchContext=function(e,c,a){var b=[],g=e*2+1,d;c.length<=g?(d=0,e=c.length-1):(d=a-e,d<0?(d=0,e=d+g-1):
(e=a+e,e>c.length-1&&(e=c.length-1,d=e-g+1)));for(g=d;g<=e;g++)b.push({context:c[g],current:g===a});return b};g.splitFile=function(e){for(var c=0,a=0,b=0,g=0,d=[];;){c!==-1&&c<=b&&(c=e.indexOf("\r",b));a!==-1&&a<=b&&(a=e.indexOf("\n",b));if(a===-1&&c===-1){d.push(e.substring(g));break}var f=1;c!==-1&&a!==-1?c+1===a?(f=2,b=a+1):b=(c<a?c:a)+1:b=c!==-1?c+1:a+1;d.push(e.substring(g,b-f));g=b}return d};g.searchWithinFile=function(e,c,a,b,d,f){a=g.splitFile(a);if(d)c.contents=a;if(c){c.children=[];for(var i=
b=0;i<a.length;i++){var h=a[i];if(h&&h.length>0){var j=f?h:h.toLowerCase();if(j=e.wildCard?g.searchOnelineRegEx(e,j):g.searchOnelineLiteral(e,j)){var k,t=i+1;if(d)for(var q=0;q<j.length;q++)k=q+1,k={parent:c,checked:c.checked,type:"detail",matches:j,lineNumber:t,matchNumber:k,name:h,location:c.location+"-"+t+"-"+k},c.children.push(k);else k={parent:c,context:g.generateMatchContext(2,a,i),checked:c.checked,type:"detail",matches:j,lineNumber:t,name:h,location:c.location+"-"+t},c.children.push(k);b+=
j.length}}}c.totalMatches=b}};g.replaceCheckedMatches=function(e,c,a,b,g){for(var d=0,f="",i=[],h=0;h<a.length;h++){d!==a[h].startIndex&&(f+=e.substring(d,a[h].startIndex));if(a[h].length)g=a[h].length;for(var d=!1,j=0;j<b.length;j++)if(b[j]===h){d=!0;break}d?(i.push({startIndex:f.length,length:c.length}),f+=c):(i.push({startIndex:f.length,length:g}),f+=e.substring(a[h].startIndex,a[h].startIndex+g));d=a[h].startIndex+g}d<e.length&&(f+=e.substring(d));return{replacedStr:f,newMatches:i}};g.fullPathNameByMeta=
function(e){var c=e.length,a="";if(c>0)for(c-=1;c>-1;c--)a=a+(a===""?"":"/")+e[c].Name;return a};g.path2FolderName=function(e,c,a){return e.substring(0,e.length-c.length-(a?0:1))};g._storeRecentSearch=function(e,c,a,b){e.getService("orion.core.preference").getPreferences("/window/favorites").then(function(e){e.put("recentSearch",c);a&&window.setTimeout(function(){a.dispatchEvent({type:"inputDataListChanged",deleting:b})}.bind(this),20)})};g.addRecentSearch=function(e,c,a){typeof c==="string"&&c&&
e.getService("orion.core.preference").getPreferences("/window/favorites").then(function(b){var d,b=b.get("recentSearch");typeof b==="string"&&(b=JSON.parse(b));if(b){for(d in b)if(b[d].name===c)return;b.length>=20&&b.splice(19,b.length-20+1)}else b=[];b.splice(0,0,{name:c,regEx:a});g._storeRecentSearch(e,b)})};g.removeRecentSearch=function(e,c,a){typeof c==="string"&&c&&e.getService("orion.core.preference").getPreferences("/window/favorites").then(function(b){var d,b=b.get("recentSearch");typeof b===
"string"&&(b=JSON.parse(b));if(b)for(d in b)if(b[d].name===c){b.splice(d,1);g._storeRecentSearch(e,b,a,!0);break}})};g.getSearches=function(e,c,a){e.getService("orion.core.preference").getPreferences("/window/favorites").then(function(e){e=e.get(c);typeof e==="string"&&(e=JSON.parse(e));e&&a&&a(e)})};g.getMixedSearches=function(e,c,a,b){e.getService("orion.core.preference").getPreferences("/window/favorites").then(function(e){var d=e.get("recentSearch");typeof d==="string"&&(d=JSON.parse(d));c&&(e=
e.get("search"),typeof e==="string"&&(e=JSON.parse(e)),e&&e.forEach(function(c){if(a){var e=g.parseQueryStr(c.query);d.some(function(a){return e.searchStrTitle===a.name})||d.push({name:e.searchStrTitle,label:c.name})}else d.push({name:null,label:c.name,value:c.query})}));d&&b&&b(d)})};g.getOpenSearchPref=function(e,c){e.getService("orion.core.preference").getPreferences("/cm/configurations").then(function(a){a=a.get("nav.config");c(a&&a["links.newtab"]!=="undefined"?a["links.newtab"]?!0:!1:!1)})};
g.setOpenSearchPref=function(e,c){e.getService("orion.core.preference").getPreferences("/window/favorites").then(function(a){a.put("openSearchPref",{openInNewTab:c})})};return g});
define("orion/crawler/searchCrawler","i18n!orion/crawler/nls/messages,require,orion/i18nUtil,orion/searchUtils,orion/contentTypes,orion/Deferred".split(","),function(h,k,j,f,d,i){function b(b,e,c,a){this.registry=b;this.fileClient=e;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=c;this.searchHelper=this._searchOnName||
this._buildSkeletonOnly?null:f.generateSearchHelper(c);this._location=a&&a.location;this._childrenLocation=a&&a.childrenLocation?a.childrenLocation:this._location;this._cancelled=!1;this._statusService=this.registry.getService("orion.page.message");this._progressService=this.registry.getService("orion.page.progress");this._statusService&&this._statusService.setCancelFunction(function(){this._cancelFileContentsSearch()}.bind(this))}b.prototype.search=function(b){var e=this.registry.getService("orion.core.contentTypeRegistry");
this._onSearchComplete=b;this._cancelled=!1;this._deferredArray=[];e.getContentTypes().then(function(c){this.contentTypesCache=c;var a=this;this._visitRecursively(this._childrenLocation).then(function(){a._cancelled||a._reportResult()}.bind(a),function(c){a._reportResult();a._statusService&&c.name==="Cancel"&&(console.log("Crawling search cancelled. Deferred array length : "+a._deferredArray.length),a._statusService.setProgressResult({Message:h["Search cancelled by user"],Severity:"Warning"}))}.bind(a))}.bind(this))};
b.prototype.searchName=function(b,e){if(b)this._searchParams=b,this.searchHelper=f.generateSearchHelper(b,!0);if(e)this.onSearchNameComplete=e;var c=[];this._cancelled=!1;this._deferredArray=[];this._sort(this.fileSkeleton);if(this.fileSkeleton.length>0){for(var a=0;a<this.fileSkeleton.length;a++){var d=this.fileSkeleton[a].Name.toLowerCase();if(this.searchHelper.inFileQuery.wildCard?f.searchOnelineRegEx(this.searchHelper.inFileQuery,d,!0):f.searchOnelineLiteral(this.searchHelper.inFileQuery,d,!0))if(c.push(this.fileSkeleton[a]),
c.length>=this.searchHelper.params.rows)break}this.onSearchNameComplete({response:{numFound:c.length,docs:c}})}else this.onSearchNameComplete({response:{numFound:0,docs:[]}})};b.prototype.buildSkeleton=function(b,e){this._buildingSkeleton=!0;var c=this.registry.getService("orion.core.contentTypeRegistry");this._cancelled=!1;this._deferredArray=[];var a=this;b();c.getContentTypes().then(function(c){a.contentTypesCache=c;a._visitRecursively(a._childrenLocation).then(function(){a._buildingSkeleton=!1;
e();a.searchHelper&&!a._buildSkeletonOnly&&a.searchName()})})};b.prototype._sort=function(b){b.sort(function(e,c){var a,b;if(this._searchParams.sort==="Path asc"){a=e.Location&&e.Location.toLowerCase();a=f.path2FolderName(a,e.Name&&e.Name.toLowerCase(),!0);b=c.Location&&c.Location.toLowerCase();b=f.path2FolderName(b,c.Name&&c.Name.toLowerCase(),!0);if(a<b)return-1;if(a>b)return 1}return this._sortOnNameSingle(e,c)}.bind(this))};b.prototype._reportResult=function(){this._sort(this.fileLocations);this._onSearchComplete({response:{numFound:this.fileLocations.length,
docs:this.fileLocations}})};b.prototype._sortOnNameSingle=function(b,e){var c=b.Name&&b.Name.toLowerCase(),a=e.Name&&e.Name.toLowerCase();return c<a?-1:c>a?1:0};b.prototype._onFileType=function(b){return this.searchHelper.params.fileType?this.searchHelper.params.fileType===f.ALL_FILE_TYPE?!0:b.extension.indexOf(this.searchHelper.params.fileType)>=0:!0};b.prototype._visitRecursively=function(b){var e=[],c=this;this._fetchChildrenCallBack&&this._fetchChildrenCallBack(b);return(c._progressService?this._progressService.progress(c.fileClient.fetchChildren(b),
"Crawling search for children of "+b):c.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(c._searchOnName)e.push(c._buildSingleSkeleton(a[b]));else if(c._buildSkeletonOnly)e.push(c._buildSingleSkeleton(a[b]));else{if(!c._cancelled){var g=d.getFilenameContentType(a[b].Name,c.contentTypesCache);if(g&&(g["extends"]==="text/plain"||g.id==="text/plain")&&c._onFileType(g))g=c._sniffSearch(a[b]),e.push(g),c._deferredArray.push(g)}}else if(a[b].Location)if(c._cancelled)break;
else g=c._visitRecursively(a[b].ChildrenLocation),e.push(g),c._deferredArray.push(g);return i.all(e)})};b.prototype._hitOnceWithinFile=function(b){b=this._searchParams.caseSensitive?b:b.toLowerCase();return this.searchHelper.inFileQuery.wildCard?f.searchOnelineRegEx(this.searchHelper.inFileQuery,b,!0):f.searchOnelineLiteral(this.searchHelper.inFileQuery,b,!0)};b.prototype._reportSingleHit=function(b){if(!this._cancelled)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()})};b.prototype._sniffSearch=function(b){this._totalCounter++;var e=this;if(!this._cancelled)if(this.searchHelper.params.keyword==="")this._reportSingleHit(b),this._statusService&&this._statusService.setProgressResult({Message:j.formatMessage(h["${0} files found out of ${1}"],
this._hitCounter,this._totalCounter)});else return(e._progressService?e._progressService.progress(e.fileClient.read(b.Location),"Reading file "+b.Location):e.fileClient.read(b.Location)).then(function(c){e._hitOnceWithinFile(c)&&e._reportSingleHit(b);e._statusService&&e._statusService.setProgressResult({Message:j.formatMessage(h["${0} files found out of ${1}"],e._hitCounter,e._totalCounter)},h.Cancel)},function(c){c&&c.message&&c.message.toLowerCase()!=="cancel"&&console.error("Error loading file content: "+
c.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(h,k,j,f,d,i,b){function g(e){this._init(e)}g.prototype=new b.Dialog;g.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="'+
f.toUrl("../../../images/progress_running.gif")+'" class="progressPane_running_dialog" id="crawlingProgress"></img></div><div id="results" style="max-height:250px; height:auto; overflow-y:auto;" aria-live="off"></div><div id="statusbar"></div></div>';g.prototype._init=function(e){this.title=e.title||h["Find File Named"];this.modal=!0;this.messages=h;this._searcher=e.searcher;this._progress=e.progress;this._onHide=e.onHide;this._contentTypeService=new j.ContentTypeRegistry(this._searcher.registry);
if(!this._searcher)throw Error("Missing required argument: searcher");this._searchDelay=e.searchDelay||500;this._time=0;this._searcher.setCrawler(null);this._forceUseCrawler=!1;this._initialText=e.initialText;this._message=e.message;this._nameSearch=!0;if(e.nameSearch!==void 0)this._nameSearch=e.nameSearch;this._searchOnRoot=!0;this._fileService=this._searcher.getFileService();if(!this._fileService)throw Error(h["Missing required argument: fileService"]);this._searchRenderer=e.searchRenderer;if(!this._searchRenderer||
typeof this._searchRenderer.makeRenderFunction!=="function")throw Error(h["Missing required argument: searchRenderer"]);this._initialize()};g.prototype._bindToDom=function(e){var c=this;c.$crawlingProgress.style.display="none";this._nameSearch?this.$fileName.setAttribute("placeholder",h["FileName FolderName"]):this.$fileName.setAttribute("placeholder",h.Search);this.$fileName.addEventListener("input",function(){c._time=+new Date;c._timeoutId&&clearTimeout(c._timeoutId);c._timeoutId=setTimeout(c.checkSearch.bind(c),
0)},!1);this.$fileName.addEventListener("keydown",function(a){if(a.keyCode===d.KEY.ENTER){var e=d.$("a",c.$results);if(e)d.stop(a),(i.isMac?a.metaKey:a.ctrlKey)?window.open(e.href):(window.location.href=e.href,c.hide())}},!1);e.addEventListener("keydown",function(a){var e,b,g;if(a.keyCode===d.KEY.DOWN||a.keyCode===d.KEY.UP)e=d.$$array("a",c.$results),b=document.activeElement,g=e.indexOf(b),a.keyCode===d.KEY.DOWN?g>=0?(b.classList.remove("treeIterationCursor"),e=g<e.length-1?e[g+1]:e[0],e.focus(),
e.classList.add("treeIterationCursor")):e.length>0&&(e=-1<e.length-1?e[0]:e[0],e.focus(),e.classList.add("treeIterationCursor")):g>=0?(b.classList.remove("treeIterationCursor"),b=c.$fileName,e=g>0?e[g-1]:b,e.focus(),g>0&&e.classList.add("treeIterationCursor")):e.length>0&&(e[e.length-1].focus(),e[e.length-1].classList.add("treeIterationCursor")),d.stop(a)});e.addEventListener("mouseup",function(a){a.target.focus()},!1);setTimeout(function(){if(c._forceUseCrawler||!c._fileService.getService(c._searcher.getSearchLocation()).search){var a=
c._searchOnRoot?c._searcher.getSearchRootLocation():c._searcher.getChildrenLocation(),a=new k.SearchCrawler(c._searcher.registry,c._fileService,"",{searchOnName:!0,location:a});c._searcher.setCrawler(a);a.buildSkeleton(function(){c.$crawlingProgress.style.display="inline";c.$progress.appendChild(document.createTextNode(h["Building file skeleton..."]))},function(){c.$crawlingProgress.style.display="none";c.$progress.removeChild(c.$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()};g.prototype.checkSearch=function(){clearTimeout(this._timeoutId);var e=(new Date).getTime();e-this._time>this._searchDelay?(this._time=e,this.doSearch()):this._timeoutId=setTimeout(this.checkSearch.bind(this),50)};g.prototype._detectFolderKeyword=function(e){var c,a=e,b=null;if(this._nameSearch&&(c=/(\S+)\s*(.*)/,(e=c.exec(e))&&e.length===3))e[1]&&
(a=e[1]),e[2]&&(b=e[2]);return{keyword:a,folderKeyword:b}};g.prototype.doSearch=function(){var e=this.$fileName.value;if(e){var c=this._detectFolderKeyword(e),a=this._searcher.createSearchParams(c.keyword,this._nameSearch,this._searchOnRoot),b=this._searchRenderer.makeRenderFunction(this._contentTypeService,this.$results,!1,this.decorateResult.bind(this));this.currentSearch=b;var g=document.createElement("div");g.appendChild(document.createTextNode(this._nameSearch?h["Searching..."]:i.formatMessage(h["Searching for occurrences of"],
e)));d.empty(this.$results);this.$results.appendChild(g);this._searcher.search(a,c.folderKeyword,function(){b===this.currentSearch&&b.apply(null,arguments)}.bind(this))}};g.prototype.decorateResult=function(e){function c(c){c.button===0&&!c.ctrlKey&&!c.metaKey&&a.hide()}for(var a=this,e=d.$$array("a",e),b=0;b<e.length;b++)e[b].addEventListener("click",c,!1)};g.prototype._beforeHiding=function(){clearTimeout(this._timeoutId)};g.prototype._afterHiding=function(){this._onHide&&this._onHide()};g.prototype.constructor=
g;return{OpenResourceDialog:g}});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\n\t<div id="staticBanner" class="layoutBlock topRowBanner"> <\!-- primaryNav --\>\n\t\t<div id="centralNavigationArea" style="position:absolute;left:0;top:0;width:39px;height:36px; z-index:1;border-right:1px solid #ddd;"></div>\n\n\t\t<\!-- Static "Home" link. TODO delete this --\>\n\t\t<a id="home" class="layoutLeft "></a>\n\n\t\t<\!-- Left banner component: hamburger --\>\n\t\t<nav id="primaryNav" class="bannerLeftArea" style="z-index:2;" role="navigation">\n\t\t\t\t<button class="centralNavigation commandSprite core-sprite-hamburger" type="button"id="centralNavigation"></button>\n\t\t</nav>\n\n\t\t<\!-- Middle banner component: Breadcrumb bar --\>\n\t\t<div class="clear navigationBreadcrumb bannerMiddleArea" >\n\t\t\t<div id="location" class="currentLocation"></div>\n\t\t</div>\n\n\t\t<\!-- Right banner component: user identity --\>\n\t\t<div class="bannerRightArea" style="z-index:2;">\n\t\t\t<\!-- Global commands support. --\>\n\t\t\t<div id="globalActions" class="spacingLeft layoutLeft"></div>\n\n\t\t\t<\!-- Search. TODO delete this --\>\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\n\t\t\t<\!-- User identity menu and Progress --\>\n\t\t\t<div id="userMenu" class="spacingRight layoutRight" style="color:#ccc;line-height:16px;">\n\t\t\t\t<div style="position: absolute;right: 0px;top:0;width: 39px;height:36px; z-index:-50;border-left: 1px solid #ddd;"></div>\n\n\t\t\t\t<\!-- Progress indicator --\>\n\t\t\t\t<img class="progressPane" id="progressPane" tabindex="0" role="progressbar"></img>\n\n\t\t\t\t<\!-- User identity menu --\>\n\t\t\t\t<span id="userTrigger" tabindex="0" role="button" class="dropdownTrigger" style="z-index:2;">\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\n\t<\!-- IDE notification messages go in here --\>\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'<\!--\n<footer id="footerContent" class="layoutBlock footerLayout" role="contentinfo">\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="https://bugs.eclipse.org/bugs/enter_bug.cgi?product=Orion&version=5.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>\n--\>'});
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<ul class="layoutRight commandList pageActions" id="settingsActions"></ul>\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(h,k){function j(f,d,i){if(f=k.node(f))this._parent=f;else throw Error("Parent node of dropdown menu not found");this.options=i=i||{};this.navDropDownId=this._parent.id+"_navdropdown";this.selectionClass=i.selectionClass;f=document.createElement("div");f.classList.add("dropDownContainer");f.id=this.navDropDownId;f.style.display="none";this._parent.appendChild(f);this._dropdownMenu=f;if(d=k.node(d))this._triggerNode=
d;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))}h.mixin(j.prototype,{click:function(){this._dropdownMenu.style.display==="none"?this.updateContent(this.getContentNode(),function(){k.setFramesEnabled(!1);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",k.setFramesEnabled(!0),this.selectionClass&&this._triggerNode.classList.remove(this.selectionClass),this.options.onHide))this.options.onHide()},
addContent:function(f){this._dropdownMenu.innerHTML=f},getContentNode:function(){return this._dropdownMenu},updateContent:function(f,d){d()},_positionDropdown:function(){this._dropdownMenu.style.right="";var f=k.bounds(this._dropdownMenu),d=k.bounds(document.body);if(f.left+f.width>d.left+d.width)f=k.bounds(this._boundingNode(this._triggerNode)),d=k.bounds(this._triggerNode),this._dropdownMenu.style.right=f.width-(d.left-f.left+d.width)+"px"},_boundingNode:function(f){var d=window.getComputedStyle(f,
null);return d===null?f:d.getPropertyValue("position")==="absolute"||!f.parentNode||f===document.body?f:this._boundingNode(f.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.setFramesEnabled(!0),k.empty(this._parent),this._parent=this.select=null}});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","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":"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":"File","Create a new file":"Create a new file","Name:":"Name:","New Folder":"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...":"File System","Copy files and folders from your local file system":"Copy files and folders from your local file system","SFTP from...":"SFTP","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","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",Cut:"Cut",Copy:"Copy","Fetching children of ":"Fetching children of ",Paste:"Paste","Cannot paste into the Workspace root":"Cannot paste into the Workspace root","Open With":"Open With",
"Loading ":"Loading ",New:"New",File:"File",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...":"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} menu 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(h,k){var j={root:k};Object.keys(h).forEach(function(f){typeof j[f]==="undefined"&&(j[f]=h[f])});return j});
define("orion/fileClient",["i18n!orion/navigate/nls/messages","orion/Deferred","orion/i18nUtil"],function(h,k,j){function f(b,d,e){if(!b[d])throw d+h[" is not supported in this file system"];return b[d].apply(b,e)}function d(b,g,e,c){if(!b.readBlob)throw h["source file service does not support binary read"];if(!e.writeBlob)throw h["target file service does not support binary write"];if(g[g.length-1]!=="/")return f(b,"readBlob",[g]).then(function(a){return f(e,"writeBlob",[c,a])});var a=c.substring(0,
c.length-1),i=decodeURIComponent(a.substring(a.lastIndexOf("/")+1)),a=a.substring(0,a.lastIndexOf("/")+1);return f(e,"createFolder",[a,i]).then(function(){},function(){}).then(function(){return f(b,"fetchChildren",[g]).then(function(a){for(var g=[],f=0;f<a.length;++f){var i=a[f].Location,l=i;a[f].Directory&&(l=i.substring(0,i.length-1));l=decodeURIComponent(l.substring(l.lastIndexOf("/")+1));l=c+encodeURIComponent(l);a[f].Directory&&(l+="/");g[f]=d(b,i,e,l)}return k.all(g)})})}function i(b,d){function e(a){var c=
new k;c.reject(h["No Matching FileService for location:"]+a);return c}var c=b.getServiceReferences("orion.core.file"),a=c;if(d)for(var a=[],f=0;f<c.length;++f)d(c[f])&&a.push(c[f]);for(var i=[],o=[],s=[],p=[],u={fetchChildren:function(){var a=new k;a.resolve(p);return a},createWorkspace:function(){var a=new k;a.reject(h["no file service"]);return a},loadWorkspaces:function(){var a=new k;a.reject(h["no file service"]);return a},loadWorkspace:function(){var a=new k;window.setTimeout(function(){a.resolve({Directory:!0,
Length:0,LocalTimeStamp:0,Name:h["File Servers"],Location:"/",Children:p,ChildrenLocation:"/"})},100);return a},search:e,createProject:e,createFolder:e,createFile:e,deleteFile:e,moveFile:e,copyFile:e,read:e,write:e},c=0;c<a.length;++c)p[c]={Directory:!0,Length:0,LocalTimeStamp:0,Location:a[c].getProperty("top"),ChildrenLocation:a[c].getProperty("top"),Name:a[c].getProperty("Name")},f=a[c].getProperty("pattern")||a[c].getProperty("top").replace(/([.*+?^=!:${}()|\[\]\/\\])/g,"\\$1"),f[0]!=="^"&&(f=
"^"+f),i[c]=RegExp(f),o[c]=b.getService(a[c]),s[c]=a[c].getProperty("Name"),a[c].getProperty("NameKey")&&a[c].getProperty("nls")&&j.getMessageBundle(a[c].getProperty("nls")).then(function(c,e){p[c].Name=e[a[c].getProperty("NameKey")];s[c]=e[a[c].getProperty("NameKey")]}.bind(this,c));this._getServiceIndex=function(a){if(a==="/")return-1;else if(!a||a.length&&a.length===0)return o[0]?0:-1;for(var c=0;c<i.length;++c)if(i[c].test(a))return c;throw h["No Matching FileService for location:"]+a;};this._getService=
function(a){a=this._getServiceIndex(a);return a===-1?u:o[a]};this._getServiceName=function(a){a=this._getServiceIndex(a);return a===-1?u.Name:s[a]};this._getServiceRootURL=function(a){a=this._getServiceIndex(a);return a===-1?u.Location:p[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 f(this._getService(b),"fetchChildren",
arguments)},createWorkspace:function(b){return f(this._getService(),"createWorkspace",arguments)},loadWorkspaces:function(){return f(this._getService(),"loadWorkspaces",arguments)},loadWorkspace:function(b){return f(this._getService(b),"loadWorkspace",arguments)},createProject:function(b,d,e,c){return f(this._getService(b),"createProject",arguments)},createFolder:function(b,d){return f(this._getService(b),"createFolder",arguments)},createFile:function(b,d){return f(this._getService(b),"createFile",
arguments)},deleteFile:function(b){return f(this._getService(b),"deleteFile",arguments)},moveFile:function(b,g,e){var c=this._getService(b),a=this._getService(g);if(c===a)return f(c,"moveFile",arguments);var i=b[b.length-1]==="/",h=g;h[h.length-1]!=="/"&&(h+="/");if(e)h+=encodeURIComponent(e);else{var o=b;i&&(o=o.substring(0,o.length-1));h+=o.substring(o.lastIndexOf("/")+1)}i&&h[h.length-1]!=="/"&&(h+="/");return d(c,b,a,h).then(function(){return f(c,"deleteFile",[b])})},copyFile:function(b,g,e){var c=
this._getService(b),a=this._getService(g);if(c===a)return f(c,"copyFile",arguments);var i=b[b.length-1]==="/",h=g;h[h.length-1]!=="/"&&(h+="/");if(e)h+=encodeURIComponent(e);else{var o=b;i&&(o=o.substring(0,o.length-1));h+=o.substring(o.lastIndexOf("/")+1)}i&&h[h.length-1]!=="/"&&(h+="/");return d(c,b,a,h)},read:function(b,d){return f(this._getService(b),"read",arguments)},readBlob:function(b){return f(this._getService(b),"readBlob",arguments)},write:function(b,d,e){return f(this._getService(b),"write",
arguments)},remoteImport:function(b,d){return f(this._getService(b),"remoteImport",arguments)},remoteExport:function(b,d){return f(this._getService(b),"remoteExport",arguments)},search:function(b){return f(this._getService(b.resource),"search",arguments)}};i.prototype.constructor=i;return{FileClient:i}});
define("orion/webui/SideMenu","orion/commands,orion/objects,orion/webui/littlelib,orion/PageLinks,orion/PageUtil,orion/URITemplate,orion/URL-shim,orion/util".split(","),function(h,k,j,f,d,i,b,g){function e(a,c){this.parentNode=j.node(a);this.contentNode=j.node(c);if(!this.parentNode)throw Error("Missing parentNode");this.menuitems=Object.create(null);this.categories=this.links=null;this.anchor=document.createElement("ul");this.anchor.classList.add("sideMenuList");this.parentNode.appendChild(this.anchor);
this.anchor.addEventListener("click",this._handleEvent.bind(this));this.anchor.addEventListener("touchstart",this._handleEvent.bind(this));this.anchor.addEventListener("focus",this._handleEvent.bind(this),!0);j.addAutoDismiss([this.anchor],this._expandMenu.bind(this,null))}function c(a){return!a.isRelatedLink}function a(a,c){var e=a.order,b=c.order;if(e<b)return-1;else if(b<e)return 1;return 0}function l(a,c){var e=a.source.order,b=c.source.order,e=typeof e==="number"?e:100,b=typeof b==="number"?
b:100;return e===b?a.textContent.localeCompare(c.textContent):e<b?-1:1}var m=g.isTouch;k.mixin(e.prototype,{LOCAL_STORAGE_NAME:"sideMenuNavigation",OPEN_STATE:"open",CLOSED_STATE:"closed",DEFAULT_STATE:"open",SIDE_MENU_OPEN_WIDTH:"40px",TRANSITION_DURATION_MS:301,addMenuItem:function(a,c,e){var b=this.anchor,a=this.createListItem(a,c);e&&a.classList.add("sideMenuItemActive");b.appendChild(a);this.menuitems[c]=a},setSideMenu:function(){var a=this.getDisplayState(),c=this.parentNode;if(c){if(a===this.CLOSED_STATE){this.setPageContentLeft("0");
if(this._timeout)window.clearTimeout(this._timeout),this._timeout=null;this._timeout=window.setTimeout(function(){c.style.display="none"},this.TRANSITION_DURATION_MS);c.classList.add("animating")}if(a===this.OPEN_STATE){if(this._timeout)window.clearTimeout(this._timeout),this._timeout=null;c.classList.remove("animating");c.style.display="block";c.style.width=this.SIDE_MENU_OPEN_WIDTH;this.setPageContentLeft(this.SIDE_MENU_OPEN_WIDTH)}}},setPageContentLeft:function(a){var c=this.contentNode;if(c)c.style.left=
a},toggleSideMenu:function(){var a=this.getDisplayState(),c=this.contentNode;c&&c.classList.add("content-fixedHeight-animation");a=a===this.OPEN_STATE?this.CLOSED_STATE:this.OPEN_STATE;a===this.DEFAULT_STATE?localStorage.removeItem(this.LOCAL_STORAGE_NAME):localStorage.setItem(this.LOCAL_STORAGE_NAME,a);this.setSideMenu()},clearMenuItems:function(){this.menuitems=[];j.empty(this.anchor)},getMenuItems:function(){var a=this.menuitems;return Object.keys(a).map(function(c){return a[c]})},getMenuItem:function(a){return this.menuitems[a]},
getDisplayState:function(){var a=localStorage.getItem(this.LOCAL_STORAGE_NAME);if(!a)a=this.DEFAULT_STATE;return a},createListItem:function(a,c){var e=document.createElement("li");e.className=a;e.classList.add("sideMenuItem");e.categoryId=c;return e},setCategories:function(a){this.categories=a;this.links=Object.create(null)},setPageLinks:function(a){this.pageLinks=a;var c=this,e=a.createLinkElements();a.getAllLinks().forEach(function(a,b){var d=e[b];d.source=a;c._getLinksBin(a.category).push(d)});
this._renderLinks()},setRelatedLinks:function(a,e){this.relatedLinks=a;var b=this;Object.keys(this.links).forEach(function(a){var e=b._getLinksBin(a);b.links[a]=e.filter(c)});var d=document.createDocumentFragment();a.forEach(function(a){var c=a.relatedLink,e=b._getLinksBin(c.category),a=h.createCommandMenuItem(d,a.command,a.invocation);a.classList.remove("dropdownMenuItem");a.isRelatedLink=!0;a.source=c;e.push(a)});this._renderLinks(e)},_getLinksBin:function(a){if(a){var c=this.links;c[a]=c[a]||[];
return c[a]}else return[]},_sort:function(){var a=this.links;Object.keys(a).forEach(function(c){a[c].sort(l)})},_renderCategories:function(){var c=this.categories,e=this,b=new URL(window.location.href),g=d.matchResourceParameters();g.OrionHome=f.getOrionHome();var l=!1;this.clearMenuItems();c.getCategoryIDs().map(function(a){return c.getCategory(a)}).sort(a).forEach(function(a){var c=e._getLinksBin(a.id);c.length&&(l?e.addMenuItem(a.imageClass,a.id,!1):(c=c.some(function(a){if(!a.source.uriTemplate)return!1;
a=new i(a.source.uriTemplate);a=new URL(a.expand(g),window.location);return a.protocol===b.protocol&&a.host===b.host&&a.hostname===b.hostname&&a.port===b.port&&a.pathname===b.pathname&&a.search===b.search?l=!0:!1}),e.addMenuItem(a.imageClass,a.id,c)))})},_renderLinks:function(a){a=a||[];this._sort();this._renderCategories();var c=this,e=window.location.href;Object.keys(this.menuitems).forEach(function(b){var d=c.getMenuItem(b);if(d){for(var g=c._getLinksBin(b).slice(),g=g.filter(function(c){var b=
c.source;return a.indexOf(b.id)>=0||!b.default&&!b.force&&c.href===e?!1:!0}),g=g.filter(function(a){a=a.source;return!(g.length>1&&a.default&&!a.force)}),f=g.length-1;f>0;f--)g[f].href===g[f-1].href&&g.splice(f,1);if(g.length){d.appendChild(c._createCategoryElement(b,d,g[0]));var i=document.createElement("ul");i.className="sideMenuSubMenu";g.forEach(function(a){var c=document.createElement("li");c.className="sideMenuSubMenuItem";var e=document.createElement("a");e.href=a;e.className="sideMenuSubMenuItemLink";
var b=document.createElement("span");b.innerHTML=a.innerHTML;b.className="sideMenuSubMenuItemSpan";e.appendChild(b);c.appendChild(e);i.appendChild(c)});d.appendChild(i)}}})},_createCategoryElement:function(a,c,e){var a=this.categories.getCategory(a),b;m?(b=document.createElement("button"),b.type="button"):(b=document.createElement("a"),b.href=e.href);b.className+=a.imageClass;b.classList.add("submenu-trigger");b.tabIndex="0";c.classList.remove(a.imageClass);return b},_handleEvent:function(a){var c=
a.target,a=a.type==="focus";if(c.tagName!=="A"||a)c.classList.contains("submenu-trigger")&&(m||a)&&this._expandMenu(j.$(".sideMenuSubMenu",c.parentNode))},_expandMenu:function(a){this.getMenuItems().forEach(function(c){c=j.$(".sideMenuSubMenu",c);a!==c&&c.classList.remove("expanded")});a&&a.classList.toggle("expanded")}});return e});
define("orion/globalCommands","i18n!orion/nls/messages,require,orion/commonHTMLFragments,orion/keyBinding,orion/EventTarget,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/keyAssist,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/util,orion/customGlobalCommands,orion/fileClient,orion/webui/SideMenu,orion/objects".split(","),function(h,
k,j,f,d,i,b,g,e,c,a,l,m,o,s,p,u,v,t,q,w,n,r,x,z,A,D,I,E,y,G,F,B,M,K){var Y,W,Q,R,S,O,J,H;function C(a,c){if(a.getLabel)return a.getLabel();else{var e=new r;e.resolve(c.properties.name);return e}}function L(a){m.node("progressPane").setAttribute("aria-label",h["Operations - Press spacebar to show current operations"]);(a=a.getService("orion.page.progress"))&&a.init.bind(a)("progressPane")}function T(a,c){var e=a.getServiceReferences("orion.core.auth");ea=[];var b=Y.apply(this,arguments);if(b)for(var d=
0;d<e.length;d++){var g=e[d],n=a.getService(g);C(n,g).then(function(a){n.getKey().then(function(c){ea.push(c);n.getUser().then(function(e){b.addUserItem(c,n,a,e)},function(e,d){b.addUserItem(c,n,a,d)});window.addEventListener("storage",function(){da[c]!==localStorage.getItem(c)&&(da[c]=localStorage.getItem(c),n.getUser().then(function(e){b.addUserItem(c,n,a,e)},function(){b.addUserItem(c,n,a)}))},!1)})})}}function V(a){return a}function U(a,c,d,g,n){function f(a){for(var c={},e=a.getPropertyKeys(),
b,d=0;d<e.length;d++)b=e[d],c[b]=a.getProperty(b);return c}function i(a,c){var e=null;a.some(function(a){return c===a.getProperty("id")?!!(e=a):!1});return e}function l(a){var e=a.command;if(!e.visibleWhen||e.visibleWhen(c))return a.invocation=new b.CommandInvocation(c,c,null,e,g),(new r).resolve(a);else if(typeof n==="function")return m||(m=n()),r.when(m,function(d){if(d&&c===fa&&(!e.visibleWhen||e.visibleWhen(d)))return a.invocation=new b.CommandInvocation(d,d,null,e,g),a});return(new r).resolve()}
function h(a,c,e){return e?(new r).resolve({relatedLink:a,command:e}):c.then(function(c){return{relatedLink:a,command:new b.Command(c)}})}var z=arguments,x,m,j=a&&a.getServiceReferences("orion.page.link.related");if(j&&j.length!==0){var o=this;r.when(function(){if(x)return x;var c=a.getService("orion.core.contentTypeRegistry");c||(c=new u.ContentTypeRegistry(a),c=a.getService("orion.core.contentTypeRegistry"));return c.getContentTypes().then(function(a){return x=a})}(),function(){if(W.apply(o,z)){var c=
a.getServiceReferences("orion.navigate.command"),b=[];j.forEach(function(d){var n=f(d);if(n.id){var r;if((n.nls&&n.nameKey||n.name)&&n.uriTemplate)r=e._createCommandOptions(n,d,a,x,!0),b.push(h(n,r,null));else if(r=i(c,n.id)){var l=f(r),d={};K.mixin(d,l,n);(n=g.findCommand(n.id))?b.push(h(d,null,n)):(r=e._createCommandOptions(l,r,a,x,!0),b.push(h(d,r,null)))}}});r.all(b,V).then(function(a){a.sort(function(a,c){return a.command.name.localeCompare(c.command.name)});return r.all(a.map(l),V).then(function(c){var e=
[],c=c.filter(function(c,b){if(c)return!0;e.push(a[b]);return!1});Q.call(o,g,c,e,d);R.apply(o,z)})})}})}}function ha(a){var c=m.node("globalActions");c&&(a.destroy(c),a.renderCommands(c.id,c,{},{},"tool"))}function aa(a){var c=window.getComputedStyle(a,null);return c===null?a:c.getPropertyValue("position")==="absolute"||!a.parentNode||a===document.body?a:aa(a.parentNode)}function ba(a){var c={},e=null;typeof a==="string"&&(a=m.node(a));a||(a=m.node("pageActions"));for(var b=a;b&&b.classList;){if(b.classList.contains("toolComposite")){e=
b;break}b=b.parentNode}if(a.classList.contains("commandMarker"))c.commandNode=a;if(e&&(c.slideContainer=m.$(".slideParameters",e),c.parameterArea=m.$(".parameters",e),c.dismissArea=m.$(".parametersDismiss",e),c.notifications=m.$("#notificationArea",e),e.parentNode&&(c.toolbarTarget=m.$(".toolbarTarget",e.parentNode),c.toolbarTarget)))a=m.bounds(c.toolbarTarget),b=m.bounds(aa(c.toolbarTarget.parentNode)),c.toolbarTargetY=a.top-b.top,c.toolbar=e;return c}function ca(a){if(a=a.slideContainer)if(a.style.left=
"",a.style.top="",a.classList.contains("slideContainerActive")){var c=m.bounds(a),e=m.bounds(a.parentNode);a.style.left=(e.width-c.width)/2+"px";a.style.top="0"}}var i=function(a){var c=document.createElement("a");c.href=a;return c.href}(k.toUrl("auth/NotifyAuthentication.html")),da={},P=null;Y=F.createMenuGenerator||function(a,c){if(m.node("userMenu")){var e=m.node("userDropdown"),b=new s.Dropdown({dropdown:e}),e=new x.UserMenu({dropdownNode:e,dropdown:b,serviceRegistry:a}),b=m.node("userTrigger");
new p.Tooltip({node:b,text:h.Options,position:["below","left"]});var b=document.getElementById("userTrigger"),d=b.className;d+=" imageSprite core-sprite-silhouette";b.className=d;e.setKeyAssist(c);return e}};W=F.beforeGenerateRelatedLinks||function(){return!0};Q=F.addRelatedLinkCommands||function(a,c,e,b){this.sideMenu&&this.sideMenu.setRelatedLinks(c,b)};R=F.afterGenerateRelatedLinks||function(){};S=F.afterSetPageTarget||function(){};O=F.generateNavigationMenu||function(){var a=m.node("sideMenu");
if(a){var c=m.node("centralNavigation");new p.Tooltip({node:c,text:h.CentralNavTooltip,position:["right"]});P=this.sideMenu=new M(a,m.node("pageContent"));c.addEventListener("click",P.toggleSideMenu.bind(P));(a=m.node("sideMenuToggle"))&&a.addEventListener("click",P.toggleSideMenu.bind(P))}};J=F.afterGenerateNavigationMenu||function(){};H=F.afterGenerateBanner||function(){};var ea=[],fa,$=[],N,Z=null,X=null,ga=new d;return{generateBanner:function(a,c,e,d,i,l,x,s){function p(a){a.registerService("orion.cm.managedservice",
{updated:function(a){for(var a=a&&a["links.newtab"]!=="undefined"?a["links.newtab"]?"_blank":"_self":"_self",c=m.$$array(".targetSelector"),e=0;e<c.length;e++)c[e].target=a}},{pid:"nav.config"})}(new w.ThemePreferences(d,new n.ThemeData)).apply();var q=m.node(a);if(!q)throw h["could not find banner parent, id was "]+a;var u=document.createRange();u.selectNode(q);u=u.createContextualFragment(D);m.processTextNodes(u,h);q.firstChild?q.insertBefore(u,q.firstChild):q.appendChild(u);q=m.node("home");q.href=
k.toUrl("edit/edit.html");q.setAttribute("aria-label",h["Orion Home"]);m.node("progressPane").src=b.NO_IMAGE;if(q=m.node("pageToolbar"))q.classList.add("toolbarLayout"),q.innerHTML=E+j.slideoutHTMLFragment("mainToolbar");(q=m.node("closeNotifications"))&&q.setAttribute("aria-label",h["Close notification"]);if(G.isFirefox<=17&&(q=m.node("staticBanner")))q.style.width="100%",q.style.MozBoxSizing="border-box";if(q=m.node("footer"))q.innerHTML=I,m.processTextNodes(q,h);e.setParameterCollector(new g.CommandParameterCollector(ba,
ca));document.addEventListener("keydown",function(a){a.keyCode===m.KEY.ESCAPE&&(a=c.getService("orion.page.message"))&&a.setProgressMessage("")},!1);O.apply(this,arguments);J.apply(this,arguments);q=z.getCategoriesInfo(c);u=z.getPageLinksInfo(c,"orion.page.link");r.all([q,u]).then(function(a){if(P){var c=a[1];P.setCategories(a[0]);P.setPageLinks(c);P.setSideMenu()}});if(q=m.$(".split")){var u=m.$(".sidePanelLayout"),B=m.$(".mainPanelLayout");if(u&&B)Z={side:u,main:B},Z.splitter=new o.Splitter({node:q,
sidePanel:u,mainPanel:B,toggle:!0,closeByDefault:s}),q=new b.Command({name:h["Toggle side panel"],tooltip:h["Open or close the side panel"],id:"orion.toggleSidePane",callback:function(){Z.splitter.toggleSidePanel()}}),e.addCommand(q),e.registerCommandContribution("pageActions","orion.toggleSidePane",1,null,!0,new f.KeyBinding("l",G.isMac?!1:!0,!0,!1,G.isMac?!0:!1))}var y=!1,v=function(a,c){if(!y){var e=c.getService("orion.page.progress"),b=new A.OpenResourceDialog({searcher:a,progress:e,searchRenderer:a.defaultRenderer,
onHide:function(){y=!1}});window.setTimeout(function(){y=!0;b.show()},0)}},q=new b.Command({name:h["Find File Named..."],tooltip:h["Choose a file by name and open an editor on it"],id:"orion.openResource",callback:function(){v(i,c)}});e.addCommand(q);e.registerCommandContribution("globalActions","orion.openResource",100,null,!0,new f.KeyBinding("f",!0,!0));q=new b.Command({name:h["Toggle banner and footer"],tooltip:h["Hide or show the page banner and footer"],id:"orion.toggleTrim",callback:function(){var a=
m.node("banner"),c=m.node("footer"),e=m.node("sideMenu"),b=m.$(".content-fixedHeight"),d=a.style.visibility==="hidden";d?(a.style.visibility="visible",c.style.visibility="visible",b.classList.remove("content-fixedHeight-maximized"),e&&e.classList.remove("sideMenu-maximized")):(a.style.visibility="hidden",c.style.visibility="hidden",b.classList.add("content-fixedHeight-maximized"),e&&e.classList.add("sideMenu-maximized"));ga.dispatchEvent({type:"toggleTrim",maximized:!d});return!0}});e.addCommand(q);
e.registerCommandContribution("globalActions","orion.toggleTrim",100,null,!0,new f.KeyBinding("m",!0,!0));q=new b.Command({name:h["System Configuration Details"],tooltip:h["System Config Tooltip"],id:"orion.configDetailsPage",hrefCallback:function(){return k.toUrl("help/about.html")}});e.addCommand(q);e.registerCommandContribution("globalActions","orion.configDetailsPage",100,null,!0,new f.KeyBinding(112,!0,!0));q=new b.Command({name:h["Background Operations"],tooltip:h["Background Operations Tooltip"],
id:"orion.backgroundOperations",hrefCallback:function(){return k.toUrl("operations/list.html")}});e.addCommand(q);e.registerCommandContribution("globalActions","orion.backgroundOperations",100,null,!0,new f.KeyBinding("o",!0,!0));X=new t.KeyAssistPanel({commandRegistry:e});q=new b.Command({name:h["Show Keys"],tooltip:h["Show a list of all the keybindings on this page"],id:"orion.keyAssist",callback:function(){X.isVisible()?X.hide():X.show();return!0}});e.addCommand(q);e.registerCommandContribution("globalActions",
"orion.keyAssist",100,null,!0,new f.KeyBinding(191,!1,!0));ha(e);T(c,q.callback);L(c);window.addEventListener("hashchange",function(){e.processURL(window.location.href)},!1);window.setTimeout(function(){p(c)},0);H.apply(this,arguments)},getToolbarElements:ba,getMainSplitter:function(){return Z},getKeyAssist:function(){return X},getGlobalEventTarget:function(){return ga},layoutToolbarElements:ca,setPageTarget:function(a){var c,e,b=a.breadcrumbRootName,d=a.serviceRegistry;a.target?(a.searchService&&
a.searchService.setLocationByMetaData(a.target),a.fileService&&!a.breadcrumbTarget&&(e=b?b+" ":"",e+=a.fileService.fileServiceName(a.target.Location),b=null),c=a.name||a.target.Name,fa=a.target,U.call(this,d,a.target,$,a.commandService,a.makeAlternate)):(a.breadcrumbTarget||(b=b||a.task||a.name),c=a.name,U.call(this,d,{NoTarget:""},$,a.commandService,a.makeAlternate));(N=a.title)||(N=c?c+" - "+a.task:a.task);window.document.title=N;S.apply(this,arguments);if(c=a.breadCrumbContainer?m.node(a.breadCrumbContainer):
m.node("location")){m.empty(c);var g=d&&new B.FileClient(d),d=a.breadcrumbTarget||a.target,g=g&&d&&d.Location?g.fileServiceRootURL(d.Location):null;new l.BreadCrumbs({container:c,resource:d,rootSegmentName:b,workspaceRootSegmentName:e,workspaceRootURL:g,makeFinalHref:a.makeBreadcrumFinalLink,makeHref:a.makeBreadcrumbLink})}},setDirtyIndicator:function(a){if(N)N.charAt(0)==="*"&&!a&&(N=N.substring(1)),a&&N.charAt(0)!=="*"&&(N="*"+N),window.document.title=N;var c=m.node("dirty");if(c)c.textContent=
a?"*":""},setPageCommandExclusions:function(a){$=a},notifyAuthenticationSite:i}});
define("orion/urlUtils",["orion/PageUtil","orion/URL-shim"],function(h){return{detectValidURL:function(k){for(var j=/\[([^\]]*)\]\(([^\)]+)\)/g,f=j.exec(k),d=[],i=0;f;){if(f.length===3&&f[2].length>0){var b=new URL(f[2]);b.protocol!==":"&&h.validateURLScheme(b.href)&&(f.index>i&&d.push({segmentStr:k.substring(i,f.index)}),d.push({segmentStr:f[1].length>0?f[1]:f[2],urlStr:f[2]}),i=f.index+f[0].length)}f=j.exec(k)}if(i===0)return null;i<k.length-1&&d.push({segmentStr:k.substring(i)});return d},processURLSegments:function(h,
j){j.forEach(function(f){if(f.urlStr){var d=document.createElement("a");d.href=f.urlStr;d.appendChild(document.createTextNode(f.segmentStr))}else d=document.createElement("span"),d.textContent=f.segmentStr;h.appendChild(d)})}}});
define("orion/status",["i18n!orion/nls/messages","orion/webui/littlelib","orion/globalCommands","orion/urlUtils"],function(h,k,j,f){function d(b,d,e,c,a){this._serviceRegistry=b;this._serviceRegistration=b.registerService("orion.page.message",this);this._operationsClient=d;this.notificationContainerDomId=a;this.domId=e;this.progressDomId=c||e;this._hookedClose=!1;this._timer=null;this._clickToDisMiss=!0;this._cancelMsg=null}var i;d.prototype={_init:function(){var b=k.node("closeNotifications");if(b&&
!this._hookedClose){b.style.cursor="pointer";this._hookedClose=!0;var d=k.node(this.notificationContainerDomId);k.addAutoDismiss([d],function(){this._clickToDisMiss&&this.close()}.bind(this));b.addEventListener("click",function(){this.close()}.bind(this));d.addEventListener("click",function(e){e&&e.target&&e.target.nodeName.toLowerCase()==="a"&&(e=k.$$("a",d))&&e.length&&e.length===1&&this.close()}.bind(this))}},close:function(){window.clearTimeout(this._timer);var b=k.node("closeNotifications");
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):this.setProgressMessage("")},_getNotifierElements:function(){if(!this._notifierElements)this._notifierElements=j.getToolbarElements(this.notificationContainerDomId);return this._notifierElements},setMessage:function(b,d,e){this._init();this.currentMessage=b;var c=k.node(this.domId);
if(typeof e==="boolean"){var a=c.getAttribute("aria-live");c.setAttribute("aria-live",e?"polite":"off");window.setTimeout(function(){b===this.currentMessage&&(k.empty(c),c.appendChild(document.createTextNode(b)),window.setTimeout(function(){c.setAttribute("aria-live",a)},100))}.bind(this),100)}else k.empty(c),c.appendChild(document.createTextNode(b));typeof d==="number"&&window.setTimeout(function(){b===this.currentMessage&&(k.empty(c),c.appendChild(document.createTextNode("")))}.bind(this),d)},setErrorMessage:function(b){this._clickToDisMiss=
!0;this.currentMessage=b;this._init();var d=b.responseText||b.message||b;if(typeof d==="string")try{d=JSON.parse(d)}catch(e){}var b=d.Message||d,c="red";if(d.Severity)switch(d.Severity){case "Warning":c="#FFCC00";break;case "Error":c="red";break;case "Info":case "Ok":c="green"}d=document.createElement("span");d.style.color=c;d.appendChild(document.createTextNode(b));b=k.node(this.domId);k.empty(b);b.appendChild(d)},setProgressMessage:function(b){this._clickToDisMiss=!1;this._init();this.currentMessage=
b;var d=document.createElement("span");d.classList.add("progressIcon");var e=k.node(this.progressDomId);k.empty(e);e.appendChild(d);e.appendChild(document.createTextNode(b));d=k.node(this.notificationContainerDomId);d.classList.remove("notificationHide");if(b&&b.length>0)d.classList.add("progressNormal"),d.classList.add("notificationShow");else if(this._progressMonitors&&this._progressMonitors.length>0)return this._renderOngoingMonitors();else d.classList.remove("notificationShow"),d.classList.add("notificationHide")},
setCancelFunction:function(b){this._cancelFunc=b},setProgressResult:function(b,d){this._clickToDisMiss=!1;this._cancelMsg=d;this.currentMessage=b;var e=b.responseText||b;if(typeof e==="string")try{e=JSON.parse(e)}catch(c){}this._init();var a=e.Message||e.toString(),i=h.UnknownError,m="core-sprite-information",j="progressNormal",s=document.createElement("span");s.classList.add("imageSprite");s.classList.add("progressIcon");var p=[];if(e.Severity)switch(e.Severity){case "Warning":i=h.UnknownWarning;
m="core-sprite-warning";j="progressWarning";p.push("progressInfo");p.push("progressError");p.push("progressNormal");this._clickToDisMiss=!0;break;case "Error":m="core-sprite-error";j="progressError";p.push("progressWarning");p.push("progressInfo");p.push("progressNormal");this._clickToDisMiss=!0;break;default:j="progressNormal",p.push("progressWarning"),p.push("progressError"),p.push("progressNormal")}p.push("notificationHide");s.classList.add(m);var u=k.node(this.progressDomId),m=k.node(this.notificationContainerDomId);
k.empty(u);u.appendChild(s);a===Object.prototype.toString()&&(a=i);if(e.HTML)e=document.createElement("span"),e.innerHTML=a,u.appendChild(e);else{if(i=f.detectValidURL(a))a=document.createDocumentFragment(),f.processURLSegments(a,i),Array.prototype.forEach.call(k.$$("a",a),function(a){a.target="_blank"});else{if(e.Severity!=="Warning"&&e.Severity!=="Error"&&!d)this._timer&&window.clearTimeout(this._timer),this._timer=window.setTimeout(function(){this.setProgressMessage("");this._timer=null}.bind(this),
5E3);a=document.createTextNode(a)}u.appendChild(a)}if(j&&this.progressDomId!==this.domId){m.classList.add(j);for(j=0;j<p.length;j++)m.classList.remove(p[j])}m.classList.add("notificationShow");if(p=k.node("closeNotifications"))this._cancelMsg?(p.classList.add("cancelButton"),p.classList.remove("dismissButton"),p.classList.remove("core-sprite-close"),p.classList.remove("imageSprite"),p.innerHTML=this._cancelMsg):(p.innerHTML="",p.classList.remove("cancelButton"),p.classList.add("dismissButton"),p.classList.add("core-sprite-close"),
p.classList.add("imageSprite"))},showWhile:function(b,d){var e=this;if(d){e.setProgressMessage(d);var c=function(){d===e.currentMessage&&e.setProgressMessage("")};b.then(c,c)}return b},_lastProgressId:0,_progressMonitors:{length:0},createProgressMonitor:function(b,d){return new i(this,++this._lastProgressId,b,d)},_renderOngoingMonitors:function(){if(this._progressMonitors.length>0){var b="",d=!0,e;for(e in this._progressMonitors)this._progressMonitors[e].status&&(d||(b+=", "),b+=this._progressMonitors[e].status,
d=!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()}};d.prototype.constructor=
d;i=function(b,d,e,c){this.statusService=b;this.progressId=d;if(e){this.deferred=e;this.begin(c);var a=this;e.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:d,
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(h,k){var j={root:k};Object.keys(h).forEach(function(f){typeof j[f]==="undefined"&&(j[f]=h[f])});return j});
define("orion/webui/popupdialog",["i18n!orion/widgets/nls/messages","require","orion/webui/littlelib","orion/webui/tooltip"],function(h,k,j,f){function d(){}d.prototype={_initialize:function(d,b,g,e,c){this._tooltip=new f.Tooltip({node:d,hideDelay:c||0,afterShowing:this._afterShowingFunction(b).bind(this),afterHiding:g,trigger:e?e:"click"});this.$parent=this._tooltip.contentContainer();this.$parent.role="dialog";d=document.createRange();d.selectNode(this.$parent);d=d.createContextualFragment(this.TEMPLATE);
this.messages&&j.processTextNodes(d,h);this.$parent.appendChild(d);var a=this._tooltip;this.$parent.addEventListener("keydown",function(c){c.keyCode===j.KEY.ESCAPE&&a.hide()},!1);this._bindElements(this.$parent);typeof this._bindToDom==="function"&&this._bindToDom(this.$parent)},_bindElements:function(d){for(var b=0;b<d.childNodes.length;b++){var g=d.childNodes[b];g.id&&(this["$"+g.id]=g);this._bindElements(g)}},_afterShowingFunction:function(d){return function(){d&&d.bind(this)();if(!this.customFocus){var b=
j.firstTabbable(this.$parent);b&&b.focus()}}},hide:function(){this._tooltip.hide()},show:function(){this._tooltip.show()}};d.prototype.constructor=d;return{PopupDialog:d}});
define("orion/operationsCommands",["i18n!orion/operations/nls/messages","require","orion/webui/littlelib","orion/commands"],function(h,k,j,f){var d={};(function(){var i=!1;d.updateNavTools=function(b,d,e,c,a,f){var m=j.node(c);if(m)d.destroy(m);else throw h["could not find toolbar "]+c;d.renderCommands(c,m,f,e,"button");if(a&&(c=j.node(a)))d.destroy(c),d.renderCommands(a,c,null,e,"button");i||(i=!0,b.getService("orion.page.selection").addEventListener("selectionChanged",function(c){var b=j.node(a);
b&&(d.destroy(b),d.renderCommands(a,b,c.selections,e,"button"))}))};d.createOperationsCommands=function(b,d,e){function c(a){return!a.operation||!a.operation.type?!1:a.operation.type==="loadstart"||a.operation.type==="progress"}var a=new f.Command({name:h["Remove Completed"],tooltip:h["Remove all completed operations"],id:"eclipse.removeCompletedOperations",callback:function(){e.removeCompletedOperations().then(function(){d.loadOperations.bind(d)()})},visibleWhen:function(){return!0}});b.addCommand(a);
a=new f.Command({name:h.Remove,tooltip:h["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],c=0;c<a.length;c++){var b=a[c];e.removeOperation.bind(e)(b.Location).then(function(){d.loadOperations.bind(d)()},function(){d.loadOperations.bind(d)()})}},visibleWhen:function(a){if(!Array.isArray(a)||a.length===0)return!c(a);for(var e in a)if(c(a[e]))return!1;return!0}});b.addCommand(a);
a=new f.Command({name:h.Cancel,tooltip:h["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],c=0;c<a.length;c++){var e=a[c];e.deferred&&e.deferred.cancel()}},visibleWhen:function(a){if(!Array.isArray(a)||a.length===0)return c(a)&&(a.operation&&a.operation.cancelable?!0:!1);for(var e in a)if(!c(a[e])||!a[e].operation||!a[e].operation.cancelable)return!1;return!0}});b.addCommand(a)}})();
return d});
define("orion/webui/dialogs/OperationsDialog",["i18n!orion/operations/nls/messages","require","orion/webui/littlelib","orion/webui/popupdialog","orion/operationsCommands"],function(h,k,j,f,d){function i(b){this._options=b}i.prototype=new f.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;d.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,d){this._myOperations||this._init(this._options);this._myOperations=
[];this._operationsDeferreds=[];if(b)for(var e in b)this._myOperations.push(b[e]),this._operationsDeferreds.push(d[e]);this._renderOperations()};i.prototype.parseProgressResult=function(b){if(!b)return{};b=b.responseText||b;try{b=JSON.parse(b)}catch(d){}var e={Message:b.Message||b,Severity:b.Severity};if(b.DetailedMessage&&b.DetailedMessage!==e.Message)e.DetailedMessage=b.DetailedMessage;return e};i.prototype._renderOperations=function(){this._renderOperationsTable(this.$myOperationsList,this._myOperations,
this._operationsDeferreds)};i.prototype._renderOperationsTable=function(b,d,e){j.empty(b);for(var c=0;c<d.length;c++){var a=d[c],f=document.createElement("tr"),i=document.createElement("td");i.style.paddingLeft="5px";i.style.paddingRight="5px";i.textContent=a.Name;f.appendChild(i);var o=document.createElement("div");i.appendChild(o);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",
h["Operation resulted in a warning."]);break;case "error":i.classList.add("core-sprite-error");i.setAttribute("aria-label",h["Operation resulted in an error."]);break;case "loadstart":case "progress":i.classList.add("core-sprite-start");i.setAttribute("aria-label",h["Operation is running."]);break;case "abort":i.classList.add("core-sprite-stop");i.setAttribute("aria-label",h["Operation is canceled."]);break;case "load":case "loadend":i.classList.add("core-sprite-ok"),i.setAttribute("aria-label","Operation ok.")}o.appendChild(i);
i=document.createElement("span");i.classList.add("operationStatus");i.textContent=a.Name;o.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",o,{operation:a,deferred:e[c]},this,"tool");b.appendChild(f)}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(h,k,j,f,d){function i(b,e){if(!this._progressPane){this._progressPane=f.node(b);this._operationsDialog=new d.OperationsDialog({triggerNode:this._progressPane,commandRegistry:e});var c=this;this._progressPane.addEventListener("keydown",function(a){(a.charOrCode===" "||a.keyCode===f.KEY.ENTER)&&c._operationsDialog.show()})}}function b(b,e,c,a){this._serviceRegistry=
b;this._serviceRegistration=b.registerService("orion.page.progress",this);this._commandRegistry=c;this._operationsClient=e;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,e){var c=
{},a;for(a in b)b[a].progressMonitor||(c[a]=b[a]);if(this._isEmpty(c))this._switchIconTo("progressPane_empty"),this._progressPane.title=h.Operations,this._progressPane.alt=h.Operations,this._progressPane.hasAttribute("aria-valuetext")&&this._progressPane.removeAttribute("aria-valuetext");else{var d="";for(a in c){var f=c[a];if(f.type&&(f.type==="loadstart"||f.type==="progress")){d="running";break}}switch(d){case "running":this._progressPane.title=h["Operations running"];this._progressPane.alt=h["Operations running"];
this._progressPane.setAttribute("aria-valuetext",h["Operations running"]);this._switchIconTo("progressPane_running");break;case "warning":this._progressPane.title=h["Some operations finished with warning"];this._progressPane.alt=h["Some operations finished with warning"];this._progressPane.setAttribute("aria-valuetext",h["Some operations finished with warning"]);this._switchIconTo("progressPane_warning");break;case "error":this._progressPane.title=h["Some operations finished with error"];this._progressPane.alt=
h["Some operations finished with error"];this._progressPane.setAttribute("aria-valuetext",h["Some operations finished with error"]);this._switchIconTo("progressPane_error");break;default:this._progressPane.title=h.Operations,this._progressPane.alt=h.Operations,this._progressPane.hasAttribute("aria-valuetext")&&this._progressPane.removeAttribute("aria-valuetext"),this._switchIconTo("progressPane_operations")}}this._operationsDialog.setOperations(c,e)},_isEmpty:function(b){for(var e 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,e,c){var a=this,d=this._operationsIndex++;!c&&this._progressMonitorClass&&(c=new this._progressMonitorClass,c.begin(e));b.then(function(){if(a._operations[d]){var f=a._operations[d];if(e)f.Name=e;a._lastOperation=f;f.type="loadend";if(c)f.progressMonitor=c;a.writeOperation.bind(a)(d,f,b);f.Location||a._removeOperationFromTheList.bind(a)(d)}},
function(f){if(a._operations[d]){var i=a._operations[d];if(e)i.Name=e;if(c)i.progressMonitor=c;a._lastOperation=i;i.type=f.canceled?"abort":"error";i.error=f;a.writeOperation.bind(a)(d,i,b);i.Location||a._removeOperationFromTheList.bind(a)(d)}},function(f){if(e)f.Name=e;if(c)f.progressMonitor=c;a.writeOperation.bind(a)(d,f,b)});return b},removeOperation:function(b){for(var e in this._operations)if(this._operations[e].Location&&this._operations[e].Location===b){this._removeOperationFromTheList(e);
break}this._operationsClient.removeOperation.bind(this._operationsClient)(b)},_removeOperationFromTheList:function(b){var e=this._operations[b].progressMonitor;delete this._operations[b];delete this._operationDeferrds[b];e?e.done():this._progressMonitorTool.generateOperationsInfo(this._operations,this._operationDeferrds)},removeCompletedOperations:function(){for(var b in this._operations){var e=this._operations[b];if(e.type&&e.type!=="loadstart"&&e.type!=="progress")(e=this._operations[b].progressMonitor)&&
e.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,e,c){e&&this._serviceRegistry.getService("orion.page.message").setProgressMessage(e);var a=this;b.then(function(){a._serviceRegistry.getService("orion.page.message").setProgressMessage("")},function(e){c?a._serviceRegistry.getService("orion.page.message").setProgressMessage(""):
a.setProgressResult.bind(a)(e);return e});return this.progress(b,e)},writeOperation:function(b,e,c){this._operations[b]=e;this._operationDeferrds[b]=c;e.Location&&this._serviceRegistry.getService("orion.core.preference").getPreferences("/operations").then(function(a){a.put(e.Location,{Name:e.Name,expires:e.expires})});e.progressMonitor?e.progressMonitor.progress(e.Name):this._progressMonitorTool.generateOperationsInfo(this._operations,this._operationDeferrds)}};b.prototype.constructor=b;return{ProgressService:b}});
define("orion/dialogs",[],function(){function h(h){this._serviceRegistry=h;this._serviceRegistration=h.registerService("orion.page.dialog",this)}h.prototype={confirm:function(h,j){j(window.confirm(h))},openFiles:function(){}};h.prototype.constructor=h;return{DialogService:h}});
define("orion/selection",["orion/EventTarget","orion/Deferred"],function(h){function k(j,f){f||(f="orion.page.selection");this._serviceRegistry=j;h.attach(this);this._serviceRegistration=j.registerService(f,this);this._selections=null}k.prototype={getSelection:function(h){var f=this._getSingleSelection();typeof h==="function"&&h(f);return f},getSelections:function(h){var f=Array.isArray(this._selections)?this._selections.slice():[];typeof h==="function"&&h(f);return f},_getSingleSelection:function(){return this._selections&&
this._selections.length>0?this._selections[0]:null},setSelections:function(h){var f=this._selections;this._selections=Array.isArray(h)?h.length>0?h.slice():null:h?[h]:null;f!==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(h,k){function j(b,d,e){return b[d].apply(b,e)}function f(b){this._location=b}function d(){var b=new k;b.reject(h["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 d=b.getServiceReferences("orion.core.operation"),
e=0;e<d.length;e++){var c=b.getService(d[e]);this._services[e]=c;c=d[e].getProperty("pattern")||".*";c[0]!=="^"&&(c="^"+c);this._patterns[e]=RegExp(c)}this._getService=function(a){if(!a)return this._services[0];for(var c=0;c<this._patterns.length;++c)if(this._patterns[c].test(a))return this._services[c];this._operations.remove(a);return new f(a)}}f.prototype={getOperation:d,getOperations:d,removeCompletedOperations:d,removeOperation:d,cancelOperation:d};f.prototype.constructor=f;i.prototype={getOperations:function(){var b=
new k;if(this._operations)return b.resolve(this._operations),b;var d=this;this._preferenceService.getPreferences("/operations").then(function(e){d._operations=e;b.resolve(d._operations)});return b},getOperation:function(b){return j(this._getService(b),"getOperation",arguments)},removeCompletedOperations:function(){for(var b=[],d=this,e=0;e<this._services.length;e++){var c=this._patterns[e],a=new k;b[e]=a.promise;j(this._services[e],"removeCompletedOperations").then(function(a){return function(e){Array.isArray(e)&&
d.getOperations.bind(d)().then(function(b){for(var d=b.keys(),g=0;g<d.length;g++){var f=d[g];c.test(f)&&e.indexOf(f)<0&&b.remove(f)}a.resolve()})}}(a),function(a){return function(c){a.reject(c)}}(a))}return k.all(b)},removeOperation:function(b){var d=this;return j(this._getService(b),"removeOperation",arguments).then(function(){d.getOperations.bind(d)().then(function(e){e.remove(b)})},function(e){return e},function(e){return e})}};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",Next:"Next",Previous:"Previous",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","${0} is already saved":"${0} is already saved","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 the Search page for this folder.","${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(h,k){var j={root:k};Object.keys(h).forEach(function(f){typeof j[f]==="undefined"&&(j[f]=h[f])});return j});
define("orion/webui/treetable",["i18n!orion/nls/messages","orion/webui/littlelib"],function(h,k){function j(f){this._init(f)}j.prototype={_init:function(f){var d=f.parent,i=this,d=k.node(d);if(!d)throw h["no parent"];if(!f.model)throw h["no tree model"];if(!f.renderer)throw h["no renderer"];this._parent=d;this._treeModel=f.model;this._onComplete=f.onComplete;this._renderer=f.renderer;this._showRoot=f.showRoot===void 0?!1:f.showRoot;this._indent=f.indent===void 0?16:f.indent;this._onCollapse=f.onCollapse;
this._labelColumnIndex=f.labelColumnIndex===void 0?0:f.labelColumnIndex;this._id=f.id===void 0?"treetable":f.id;this._tableStyle=f.tableStyle;this._tableElement=f.tableElement||"table";this._tableBodyElement=f.tableBodyElement||"tbody";this._tableRowElement=f.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(f,
d){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";f.length===0?this._renderer.emptyCallback&&this._renderer.emptyCallback(this._bodyElement):this._generateChildren(f,d);b.appendChild(this._bodyElement);i.appendChild(b);this._parent.appendChild(i);this._rowsChanged();this._onComplete&&this._onComplete(this)},_generateChildren:function(f,d,i){for(var b=0;b<f.length;b++){var g=document.createElement(this._tableRowElement);g.id=this._treeModel.getId(f[b]);g._depth=d;g._item=f[b];this._renderer.render(f[b],g);g.childNodes[this._labelColumnIndex].style.paddingLeft=
this._indent*d+"px";this._renderer.rowCallback&&this._renderer.rowCallback(g,f[b]);i?(this._bodyElement.insertBefore(g,i.nextSibling),i&&(i=g)):this._bodyElement.appendChild(g)}},_rowsChanged:function(){this._renderer.rowsChanged&&this._renderer.rowsChanged()},getSelected:function(){return this._renderer.getSelected()},refresh:function(f,d,i){var b=this._treeModel.getId(f),g;if(b===this._id)this._removeChildRows(b),this._generateChildren(d,0),this._rowsChanged();else{var e=k.node(b);e?(e._item=f,
e&&(i||e._expanded)?(this._removeChildRows(b),d?(e._expanded=!0,this._renderer.updateExpandVisuals(e,!0),this._generateChildren(d,e._depth+1,e),this._rowsChanged()):(g=this,this._renderer.updateExpandVisuals(e,"progress"),d=this._treeModel.getChildren(e._item,function(c){if(!g.destroyed&&(g._renderer.updateExpandVisuals(e,!0),!e._expanded))e._expanded=!0,g._generateChildren(c,e._depth+1,e),g._rowsChanged()}))):this._renderer.updateExpandVisuals(e,!1)):console.log(h["could not find table row "]+b)}},
getItem:function(f){var d=k.node(f);return d&&d._item?d._item:f},toggle:function(f){var d=k.node(f);d&&(d._expanded?this.collapse(f):this.expand(f))},isExpanded:function(f){f=typeof f==="string"?f:this._treeModel.getId(f);return(f=k.node(f))?f._expanded:!1},expand:function(f,d,i){var f=typeof f==="string"?f:this._treeModel.getId(f),b=k.node(f);if(b)if(b._expanded)d&&d.apply(g,i);else{var g=this;this._renderer.updateExpandVisuals(b,"progress");this._treeModel.getChildren(b._item,function(e){if(!g.destroyed){g._renderer.updateExpandVisuals(b,
!0);if(!b._expanded)b._expanded=!0,g._generateChildren(e,b._depth+1,b),g._rowsChanged();d&&d.apply(g,i)}})}},_removeChildRows:function(f){for(var d=f===this._id,i=!1,b=-1,g=[],e=k.$$array(".treeTableRow",this._parent),c=0;c<e.length;c++){var a=e[c];if(i)break;if(d)a._depth>b?g.push(a):i=!0;else if(a.id===f)d=!0,b=a._depth}for(f=0;f<g.length;f++)d=g[f],d.parentNode.removeChild(d)},collapse:function(f){var f=typeof f==="string"?f:this._treeModel.getId(f),d=k.node(f);if(d){if(!d._expanded)return;d._expanded=
!1;this._renderer.updateExpandVisuals(d,!1);this._removeChildRows(f);this._rowsChanged()}this._onCollapse&&this._onCollapse(d._item)},getIndent:function(){return this._indent}};j.prototype.constructor=j;return{TableTree:j}});
define("orion/treeModelIterator",[],function(){var h={};h.TreeModelIterator=function(){function h(j,f){this.firstLevelChildren=j;this.reset();this._init(f)}h.prototype={_init:function(h){if(h)this.isExpanded=h.isExpanded,this.isExpandable=h.isExpandable,this.forceExpandFunc=h.forceExpandFunc,this.getChildrenFunc=h.getChildrenFunc},topLevel:function(h){return h.parent?h.parent===this.root:!0},_getChildren:function(h){return typeof this.getChildrenFunc==="function"?this.getChildrenFunc(h):h?h.children:
null},_expanded:function(h){if(!h)return!0;var f=this._getChildren(h),f=f&&f.length>0;this.isExpanded&&f&&(f=this.isExpanded(h));return f},_expandable:function(h){return!h?!0:this.isExpandable?this.isExpandable(h):!1},_diveIn:function(h){return this._expanded(h)?(this.setCursor(this._getChildren(h)[0]),this.cursor()):null},_drillToLast:function(h){return this._expanded(h)?(h=this._getChildren(h),this._drillToLast(h[h.length-1])):h},_forward:function(h){if(!this._cursor)return null;var f=this._diveIn(this._cursor);
if(!f){if(h&&this._expandable(this._cursor)&&this.forceExpandFunc){var d=this;return this.forceExpandFunc(this._cursor,"first",function(f){f&&d.setCursor(f)})}(f=this._findSibling(this._cursor,!0))&&this.setCursor(f)}return f},_backward:function(h){if(!this._cursor)return null;var f=this._findSibling(this._cursor,!1);f&&f!==this._cursor.parent&&(f=this._drillToLast(f));if(h&&f&&this._expandable(f)&&this.forceExpandFunc&&f!==this._cursor.parent){var d=this;return this.forceExpandFunc(f,"last",function(f){f&&
d.setCursor(f)})}f&&this.setCursor(f);return f},_findSibling:function(h,f){for(var d=this.topLevel(h),i=this._getChildren(h.parent),i=d?this.firstLevelChildren:i,b=0;b<i.length;b++)if(i[b]===h)return b===0&&!f?d?null:h.parent:b===i.length-1&&f?d?null:this._findSibling(h.parent,f):f?i[b+1]:i[b-1];return null},_inParentChain:function(h,f){for(var d=h.parent;d;){if(d===f)return!0;d=d.parent}return!1},_getTopLevelParent:function(h){if(this.topLevel(h))return h;for(h=h.parent;h;){if(this.topLevel(h))return h;
h=h.parent}return null},_onCollapse:function(h){return this._expanded(h.parent)?h:this._onCollapse(h.parent)},_scan:function(h,f,d){this.setCursor(f);var i=[];for(i.push(f);;){if(this.iterate(h))i.push(this.cursor());else break;if(d===this.cursor())return i}return null},setCursor:function(h){this._prevCursor=this._cursor;this._cursor=h},setTree:function(h){this.firstLevelChildren=h;if(this.firstLevelChildren.length>0)this.root=this.firstLevelChildren[0].parent},scan:function(h,f){var d=this.cursor(),
i=this._scan(!0,h,f);i||(i=this._scan(!1,h,f));this.setCursor(d);return i},iterate:function(h,f){return h?this._forward(f):this._backward(f)},iterateOnTop:function(h,f){var d=this._findSibling(this._getTopLevelParent(this.cursor()),h);d?this.setCursor(d):f&&this.firstLevelChildren.length>0&&this.setCursor(h?this.firstLevelChildren[0]:this.firstLevelChildren[this.firstLevelChildren.length-1])},collapse:function(h){if(!this._cursor)return null;return this._inParentChain(this._cursor,h)?(this.setCursor(h),
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 h}();return h});
define("orion/explorers/explorerNavHandler",["orion/webui/littlelib","orion/treeModelIterator","orion/uiUtils"],function(h,k,j){var f={},d=navigator.userAgent.indexOf("iPad")!==-1,i=window.navigator.platform.indexOf("Mac")!==-1;f.ExplorerNavHandler=function(){function b(b,e,c){this.explorer=b;this.model=this.explorer.model;this._navDict=e;this._listeners=[];this._selections=[];this._currentColumn=0;b=this._getEventListeningDiv();b.tabIndex=0;b.classList.add("selectionModelContainer");var a=this;this._modelIterator=
new k.TreeModelIterator([],{isExpanded:this.isExpanded.bind(this),getChildrenFunc:c.getChildrenFunc,isExpandable:this.explorer.renderer.isExpandable?function(c){return a.explorer.renderer.isExpandable(c)}:function(c){return a.isExpandable(c)},forceExpandFunc:this.explorer.forceExpandFunc?function(c,e,b){return a.explorer.forceExpandFunc(c,e,b)}:void 0});this._init(c);(!c||c.setFocus!==!1)&&b.focus();c=function(c){if(j.isFormElement(c.target))return!0;if(a.explorer.preventDefaultFunc&&a.explorer.preventDefaultFunc(c,
a._modelIterator.cursor()))return!0;if(c.keyCode===h.KEY.DOWN)return a.onDownArrow(c);else if(c.keyCode===h.KEY.UP)return a.onUpArrow(c);else if(c.keyCode===h.KEY.RIGHT)return a.onRightArrow(c);else if(c.keyCode===h.KEY.LEFT)return a.onLeftArrow(c);else if(c.keyCode===h.KEY.SPACE)return a.onSpace(c);else if(c.keyCode===h.KEY.ENTER)return a.onEnter(c)};b.addEventListener("keydown",c,!1);this._listeners.push({type:"keydown",listener:c});c=function(){if(a.explorer.onFocus)a.explorer.onFocus(!1);else a.toggleCursor(null,
!1)};b.addEventListener("blur",c,!1);this._listeners.push({type:"blur",listener:c});c=function(){if(a.explorer.onFocus)a.explorer.onFocus(!0);else a.toggleCursor(null,!0)};b.addEventListener("focus",c,!1);this._listeners.push({type:"focus",listener:c});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):h.node(this.explorer._parentId)},isExpandable:function(b){return!b?!1:h.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,e){var c=this;this.explorer.selection&&this.explorer.selection.getSelections(function(a){c._clearSelection(e);for(var d=0;d<a.length;d++)c._selections.push(a[d]);c._selections.length>0?
c.cursorOn(c._selections[0],!0,!1,b):c.cursorOn(null,!1,!1,b);if(!(c._shiftSelectionAnchor&&c._inSelection(c._shiftSelectionAnchor)>=0))c._shiftSelectionAnchor=null})},refreshModel:function(b,e,c,a){this._currentColumn=0;this.topIterationNodes=[];this.model=e;this._navDict=b;if(this.model.getTopIterationNodes)this.topIterationNodes=this.model.getTopIterationNodes();else if(c)this.topIterationNodes=c;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),e=0;e<this._selections.length;e++)if(b===this.model.getId(this._selections[e]))return e;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,e,c){if(this._selectionPolicy==="cursorOnly")e&&this.explorer.renderer._useCheckboxSelection&&this._checkRow(b,!0);else if(this._isRowSelectable(b)){!e||this._selectionPolicy==="singleSelection"?(this._clearSelection(!0),this._checkRow(b,!1),this._selections.push(b),this._lastSelection=b):(e=this._inSelection(b),e>=0?(this._checkRow(b,!0),this._selections.splice(e,1)):(this._checkRow(b,
!1),this._selections.push(b),this._lastSelection=b));if(c)this._shiftSelectionAnchor=this._lastSelection;this.explorer.selection&&(this.explorer.renderer.storeSelections(),this.explorer.selection.setSelections(this._selections))}},moveColumn:function(b,e){b||(b=this.currentModel());var c=this._getGridChildren(b);if(c&&c.length>1||e===0&&c){e!==0&&this.toggleCursor(b,!1);var a=this._currentColumn,d=!0;a+=e;a<0?(this._linearGridMove&&e!==0&&(this._modelIterator.iterate(!1)?b=this.currentModel():d=!1),
a=d?c.length-1:this._currentColumn):a>=c.length&&(this._linearGridMove&&e!==0&&(this._modelIterator.iterate(!0)?b=this.currentModel():d=!1),a=d?0:this._currentColumn);this._currentColumn=a;e!==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 e=
this._parentDiv,c;b&&b!==e&&(c=b.getAttribute("role"))!=="grid"&&c!=="tree"&&c!=="treegrid";)b=b.parentNode;return b===e?null:b},toggleCursor:function(b,e){var c=this.getRowDiv(b),a=this.getCurrentGrid(b);a?(c&&(e?c.classList.add("treeIterationCursorRow"):c.classList.remove("treeIterationCursorRow")),a.domNode&&(c=this.getAriaContainerElement(a.domNode),e?(a.domNode.classList.add("treeIterationCursor"),c&&c.setAttribute("aria-activedescendant",a.domNode.id)):a.domNode.classList.remove("treeIterationCursor"))):
c&&(e?c.classList.add("treeIterationCursorRow_Dotted"):c.classList.remove("treeIterationCursorRow_Dotted"))},currentModel:function(){return this._modelIterator.cursor()},cursorOn:function(b,e,c,a){var d,f;if(b||e){if(f===this._modelIterator.cursor())return;d=this._modelIterator.cursor();f=b;this._modelIterator.setCursor(f)}else d=this._modelIterator.prevCursor(),f=this._modelIterator.cursor();if(d!==f||e)if(this.toggleCursor(d,!1),!e||f){this.moveColumn(null,0);this.toggleCursor(f,!0);if((b=this.getRowDiv())&&
!a){a=b.parentNode;for(e=document.documentElement;a&&a!==e;){var i=window.getComputedStyle(a,null);if(!i)break;i=i.getPropertyValue("overflow-y");if(i==="auto"||i==="scroll")break;a=a.parentNode}a&&(e=!0,b.offsetTop<=a.scrollTop?(e=!1,c===void 0&&(c=!1)):b.offsetTop+b.offsetHeight>=a.scrollTop+a.clientHeight&&(e=!1,c===void 0&&(c=!0)),e||b.scrollIntoView(!c))}if(this.explorer.onCursorChanged)this.explorer.onCursorChanged(d,f)}},getSelection:function(){return this._selections},getSelectionIds:function(){for(var b=
[],e=0;e<this._selections.length;e++)b.push(this.model.getId(this._selections[e]));return b},getRowDiv:function(b){b=b?b:this._modelIterator.cursor();if(!b)return null;var b=this.model.getId(b),e=this._navDict.getValue(b);return e&&e.rowDomNode?e.rowDomNode:h.node(b)},iterate:function(b,e,c,a){var d=null;if(this.topIterationNodes&&this.topIterationNodes.length!==0)if(a){a=this.currentModel();for((d=this._modelIterator.iterate(b,e))&&this._setCursorOnItem(b,c);d&&d.isNotSelectable;)(d=this._modelIterator.iterate(b,
e))&&this._setCursorOnItem(b,c);d||(this.cursorOn(a,!0,!1,!0),this._setCursorOnItem(b,c))}else(d=this._modelIterator.iterate(b,e))&&this._setCursorOnItem(b,c)},_setCursorOnItem:function(b,e){this.cursorOn(null,!1,b);if(e){var c=this._inSelection(this._modelIterator.prevCursor()),a=this._inSelection(this._modelIterator.cursor());c>=0&&a>=0?this.setSelection(this._modelIterator.prevCursor(),!0):this.setSelection(this.currentModel(),!0)}},_checkRow:function(b,e){if(this.explorer.renderer._useCheckboxSelection&&
this._selectionPolicy!=="singleSelection"){var c=this.getRowDiv(b);if(c){var a=h.node(this.explorer.renderer.getCheckBoxId(c.id)),d=e?!a.checked:!0;if(d!==a.checked)this.explorer.renderer.onCheck(c,a,d,!0)}}else this._select(b,e)},_select:function(b){b||(b=this._modelIterator.cursor());var e=this.getRowDiv(b);e&&(this._inSelection(b)<0?e.classList.add("checkedRow"):e.classList.remove("checkedRow"))},_onModelGrid:function(b,e){var c=this._getGridChildren(b);if(c)for(var a=0;a<c.length;a++)if(e.target===
c[a].domNode)return!0;return!1},onClick:function(b,e){if(this.isDisabled(this.getRowDiv(b)))h.stop(e);else{var c=h.node(this.explorer.renderer.expandCollapseImageId(this.model.getId(b)));if(e.target!==c&&!(this.gridClickSelectionPolicy==="none"&&this._onModelGrid(b,e)))if(this.cursorOn(b,!0,!1,!0),d)this.setSelection(b,!0);else if(this._ctrlKeyOn(e))this.setSelection(b,!0,!0);else if(e.shiftKey&&this._shiftSelectionAnchor){if(c=this._modelIterator.scan(this._shiftSelectionAnchor,b)){this._clearSelection(!0);
for(var a=0;a<c.length;a++)this.setSelection(c[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,!0);!this._ctrlKeyOn(b)&&!b.shiftKey&&this.setSelection(this.currentModel(),!1,!0);b.preventDefault();return!1},onDownArrow:function(b){this.iterate(!0,!1,b.shiftKey,!0);!this._ctrlKeyOn(b)&&!b.shiftKey&&this.setSelection(this.currentModel(),!1,!0);b.preventDefault();return!1},_shouldMoveColumn:function(b){var e=
this.currentModel(),c=this._getGridChildren(e);return c&&c.length>1?this.isExpandable(e)?this._ctrlKeyOn(b):!0:!1},onLeftArrow:function(b){if(this._shouldMoveColumn(b))return this.moveColumn(null,-1),b.preventDefault(),!0;var e=this._modelIterator.cursor();if(!e)return!1;if(this.isExpandable(e)&&this.isExpanded(e))return this.explorer.myTree.collapse(e),b.preventDefault(),!0;this._modelIterator.topLevel(e)?this.explorer.scopeUp&&typeof this.explorer.scopeUp==="function"&&this.explorer.scopeUp():(this.cursorOn(e.parent),
this.setSelection(e.parent,!1,!0))},onRightArrow:function(b){if(this._shouldMoveColumn(b))return this.moveColumn(null,1),b.preventDefault(),!0;var e=this._modelIterator.cursor();if(!e)return!1;if(this.isExpandable(e)&&!this.isExpanded(e))return this.explorer.myTree.expand(e),this.explorer.postUserExpand&&this.explorer.postUserExpand(this.model.getId(e)),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 e=this.getCurrentGrid(this._modelIterator.cursor());if(e)if(e.widget)if(typeof e.onClick==="function")e.onClick();else typeof e.widget.focus==="function"&&e.widget.focus();else{var c=document.createEvent("MouseEvents");c.initMouseEvent("click",!0,!0,window,0,0,0,0,0,this._ctrlKeyOn(b),!1,!1,!1,0,null);e.domNode.dispatchEvent(c)}else if(e=this._modelIterator.cursor()){if(this.explorer.renderer.getRowActionElement&&(c=this.explorer.renderer.getRowActionElement(this.model.getId(e)),
c.href))this._ctrlKeyOn(b)?window.open(c.href):window.location.href=c.href;if(this.explorer.renderer.performRowAction)return this.explorer.renderer.performRowAction(b,e),b.preventDefault(),!1}},setIsNotSelectable:function(b,e){b.isNotSelectable=e},disableItem:function(b){var e=this.getRowDiv(b);this.isExpandable(b)&&this.isExpanded(b)&&(this._modelIterator.collapse(b),this.explorer.myTree.toggle(e.id));e.classList.remove("checkedRow");e.classList.add("disabledNavRow");this.setIsNotSelectable(b,!0)},
isDisabled:function(b){return b.classList.contains("disabledNavRow")},enableItem:function(b){var e=this.getRowDiv(b);e&&(e.classList.remove("disabledNavRow"),this.setIsNotSelectable(b,!1))}};return b}();f.ExplorerNavDict=function(){function b(b){this._dict={};this._model=b}b.prototype={addRow:function(b,e){this._dict[this._model.getId(b)]={model:b,rowDomNode:e}},getValue:function(b){return this._dict[b]},getGridNavHolder:function(b,e){if(!b)return null;var c=this._model.getId(b);if(this._dict[c]){if(!this._dict[c].gridChildren&&
e)this._dict[c].gridChildren=[];return this._dict[c].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 f});
define("orion/explorers/explorer","i18n!orion/nls/messages,require,orion/webui/littlelib,orion/webui/treetable,orion/explorers/explorerNavHandler,orion/commands".split(","),function(h,k,j,f,d,i){var b={};b.Explorer=function(){function b(e,c,a,d){this.registry=e;this.renderer=a;this.selection=c;this.commandService=d;if(this.renderer)this.renderer.explorer=this;this.myTree=null}b.prototype={destroy:function(){this._navHandler&&this._navHandler.destroy();this.model&&this.model.destroy();this.myTree&&
this.myTree.destroy();this.destroyed=!0},changedItem:function(b,c){this.myTree&&this.myTree.refresh.bind(this.myTree)(b,c,!0)},updateCommands:function(b){this.myTree&&this.myTree._renderer.updateCommands.bind(this.myTree._renderer)(b)},makeNewItemPlaceHolder:function(b,c,a,d){b=this.getRow(b);if(a)return b=b.childNodes[a],b.appendChild(document.createElement("br")),d=document.createElement("span"),d.id=c+"placeHolderRow",b.appendChild(d),{tempNode:d,refNode:d};if(b){var g=document.createElement("tr");
g.id=c+"placeHolderRow";a=document.createElement("td");a.id=c+"placeHolderCol";g.appendChild(a);d?(b.parentNode.insertBefore(g,b.nextSibling),b=parseInt(b.firstChild.style.paddingLeft),a.style.paddingLeft=this.myTree.getIndent()+b+"px"):b.appendChild(g);d=j.node(c+"placeHolderRow");b=j.node(c+"placeHolderCol");if(d&&b)return{tempNode:d,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(),c=0;c<b.length;c++)this.myTree.collapse(b[c])},
expandAll:function(b){if(b)this._expandRecursively(b);else if(this._navHandler)for(var b=this._navHandler.getTopLevelNodes(),c=0;c<b.length;c++)this._expandRecursively(b[c])},_expandRecursively:function(b){if(this._navHandler&&this._navHandler.isExpandable(b)){var c=this;this.myTree.expand(b,function(){c.model.getChildren(b,function(a){if(!(a===void 0||a===null))for(var b=a.length,e=0;e<b;e++)c._expandRecursively(a[e])})})}},createTree:function(b,c,a){b=typeof b==="string"?b:b.id||b;this.selection&&
this.selection.setSelections([]);this.getNavHandler()&&this.getNavHandler()._clearSelection();var g=b+"innerTree",i=j.node(g);i&&j.empty(i);if(c)c.rootId=g;this.model=c;this._parentId=b;this._treeOptions=a;if(!a||a&&!a.noSelection)this.selectionPolicy=a?a.selectionPolicy:"",this._navDict=new d.ExplorerNavDict(this.model);this.myTree=new f.TableTree({id:g,model:c,parent:b,onComplete:a?a.onComplete:void 0,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(),c=[];
if(b&&this.getNavDict())for(var a=b.getSelection(),d=0;d<a.length;d++){var g=b.getRowDiv(a[d]);g&&g.parentNode&&(g=this.getNavDict().getValue(this.model.getId(a[d])),g.model&&c.push(g.model))}this.selection.setSelections(c)}},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 d.ExplorerNavHandler(this,this._navDict,{getChildrenFunc:b?b.getChildrenFunc:null,setFocus:b&&b.setFocus,selectionPolicy:b?b.selectionPolicy:null});var c=this;this.model.getRoot(function(a){a instanceof Array?c.getNavHandler().refreshModel(c.getNavDict(),c.model,a):a.children&&a.children instanceof Array&&c.getNavHandler().refreshModel(c.getNavDict(),c.model,a.children);b&&b.setFocus&&c.getNavHandler().cursorOn(null,!1,!1,!0)})}},
_lastHash:null,checkbox:!1};return b}();b.createExplorerCommands=function(b,e){function c(a){return typeof a.getItemCount==="function"?a.getItemCount()>0?e?e(a):!0:!1:!1}var a=new i.Command({tooltip:h["Expand all"],imageClass:"core-sprite-expandAll",id:"orion.explorer.expandAll",groupId:"orion.explorerGroup",visibleWhen:function(a){return c(a)},callback:function(a){a.items.expandAll()}}),d=new i.Command({tooltip:h["Collapse all"],imageClass:"core-sprite-collapseAll",id:"orion.explorer.collapseAll",
groupId:"orion.explorerGroup",visibleWhen:function(a){return c(a)},callback:function(a){a.items.collapseAll()}});b.addCommand(a);b.addCommand(d)};b.ExplorerModel=function(){function b(e,c,a){this.rootPath=e;this.fetchItems=c;this.idPrefix=a||""}b.prototype={destroy:function(){this.destroyed=!0},getRoot:function(b){var c=this;this.fetchItems(this.rootPath).then(function(a){c.root=a;b(a)})},getChildren:function(b,c){b.Children?c(b.Children):b.ChildrenLocation?this.fetchItems(b.ChildrenLocation).then(function(a){b.Children=
a;c(a)}):c([])},getId:function(b){if(b.Location===this.root.Location)return this.rootId;for(var b=b.Location.replace(/[\\\/]/g,""),c=this.idPrefix,a=0;a<b.length;a++)c+=b[a].match(/[^\.\:\-\_0-9A-Za-z]/g)?b.charCodeAt(a):b[a];return c}};return b}();b.ExplorerFlatModel=function(){function d(b,c,a){this.rootPath=b;this.fetchItems=c;this.root=a}d.prototype=new b.ExplorerModel;d.prototype.getRoot=function(b){if(this.root)b(this.root);else{var c=this;this.fetchItems(this.rootPath).then(function(a){c.root=
a;b(a)})}};d.prototype.getChildren=function(b,c){b===this.root?c(this.root):c([])};return d}();b.ExplorerRenderer=function(){function b(e,c){this.explorer=c;this._init(e);this._expandImageClass="core-sprite-openarrow";this._collapseImageClass="core-sprite-closedarrow";this._progressImageClass="core-sprite-progress";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,c){this.tableTree=c;this.tableNode=
b;j.empty(b);this._treeTableClass&&b.classList.add(this._treeTableClass);this.renderTableHeader(b)},getActionsColumn:function(b,c,a,d,g){var a=a||"tool",f=document.createElement("td");f.id=c.id+"actionswrapper";d&&f.classList.add(d);this.actionScopeId&&this.commandService?this.commandService.renderCommands(this.actionScopeId,f,b,this.explorer,a,null,g&&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 f},initCheckboxColumn:function(){if(this._useCheckboxSelection)return document.createElement("th")},getCheckboxColumn:function(b,c){if(this._useCheckboxSelection){var a=document.createElement("td"),d=document.createElement("span");d.id=this.getCheckBoxId(c.id);d.classList.add("core-sprite-check");d.classList.add("selectionCheckmarkSprite");d.rowId=c.id;if(this.getCheckedFunc)d.checked=this.getCheckedFunc(b),d.checked?(this._highlightSelection&&c.classList.add("checkedRow"),d.classList.add("core-sprite-check_on")):
(this._highlightSelection&&c.classList.remove("checkedRow"),d.classList.remove("core-sprite-check_on"));a.appendChild(d);var g=this;d.addEventListener("click",function(a){g.onCheck(c,a.target,a.target.checked?!1:!0,!0)},!1);return a}},getCheckBoxId:function(b){return b+"selectedState"},onCheck:function(b,c,a,d,g){(c.checked=a)?c.classList.add("core-sprite-check_on"):c.classList.remove("core-sprite-check_on");if(this.onCheckedFunc)this.onCheckedFunc(c.rowId,a,d);this.explorer.getNavHandler()&&g&&this.explorer.getNavHandler().setSelection(this.explorer.getNavDict().getValue(b.id).model,
!0)},storeSelections:function(){if(this.explorer.getNavHandler()){var b=this.explorer.getNavHandler().getSelectionIds(),c=this._getUIStatePreferencePath();c&&window.sessionStorage&&(window.sessionStorage[c+"selection"]=JSON.stringify(b))}},_restoreSelections:function(b){var c=this.explorer.getNavDict(),a=this.explorer.getNavHandler();if(a&&c&&a.getSelectionPolicy()!=="cursorOnly"&&(b=window.sessionStorage[b+"selection"],typeof b==="string"&&(b=b.length>0?JSON.parse(b):null),b)){for(var d=[],a=0;a<
b.length;a++){var g=c.getValue(b[a]);if(g&&g.rowDomNode&&g.model&&(d.push(g.model),this._highlightSelection&&g.rowDomNode.classList.add("checkedRow"),g=j.node(this.getCheckBoxId(g.rowDomNode.id))))g.checked=!0,g.classList.add("core-sprite-check_on")}this.explorer.selection&&(this.explorer.selection.setSelections(d),this.explorer.getNavHandler()&&this.explorer.getNavHandler().refreshSelection())}},_storeExpansions:function(b){window.sessionStorage[b+"expanded"]=JSON.stringify(this._expanded)},_restoreExpansions:function(b){var c=
!1,a=window.sessionStorage[b+"expanded"];typeof a==="string"&&(a=a.length>0?JSON.parse(a):null);var d;if(a)for(d=0;d<a.length;d++)if(j.node(a[d])){this._expanded.push(a[d]);var g=this;this.tableTree.expand(a[d],function(){g._restoreSelections(b)});c=!0}return!c},_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,c){var a=j.node(this.expandCollapseImageId(b.id));a&&(a.classList.remove(this._expandImageClass),a.classList.remove(this._collapseImageClass),a.classList.remove(this._progressImageClass),a.classList.add(c==="progress"?this._progressImageClass:c?this._expandImageClass:this._collapseImageClass))},getExpandImage:function(b,c,a,d){var g=document.createElement("span");g.id=this.expandCollapseImageId(b.id);c.appendChild(g);g.classList.add(this._twistieSpriteClass);
g.classList.add(this._collapseImageClass);if(a){var f=document.createElement("span");c.appendChild(f);f.classList.add(d||"imageSprite");f.classList.add(a)}var i=this;g.onclick=function(){if(!i.explorer.getNavHandler().isDisabled(b)){i.tableTree.toggle(b.id);if(i.tableTree.isExpanded(b.id))i._expanded.push(b.id),i.explorer.postUserExpand&&i.explorer.postUserExpand(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 g},render:function(b,c){c.classList.add("navRow");this.renderRow(b,c)},rowsChanged:function(){this.explorer.selectionPolicy!=="cursorOnly"&&(this.explorer.refreshSelection(),this.explorer.initNavHandler());(j.$(".sectionTreeTable",this.tableNode.parentNode)||j.$(".treetable",this.tableNode.parentNode))&&j.$$array(".treeTableRow",this.tableNode).forEach(function(b,c){var a=!(c%2)?"darkSectionTreeTableRow":"lightSectionTreeTableRow",d=a==="darkSectionTreeTableRow"?"lightSectionTreeTableRow":
"darkSectionTreeTableRow";b.classList.add(a);b.classList.remove(d)})},updateCommands:function(){if(this.commandService)for(var b=j.$$array(".treeTableRow"),c=0;c<b.length;c++){var a=b[c],d=j.node(a.id+"actionswrapper");this.commandService.destroy(d);this.actionScopeId&&this.commandService.renderCommands(this.actionScopeId,d,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 d(b,c){this._init(b);this.explorer=c}d.prototype=new b.ExplorerRenderer;d.prototype.renderTableHeader=function(b){var c=document.createElement("thead"),a=document.createElement("tr");c.classList.add("navTableHeading");this._useCheckboxSelection&&a.appendChild(this.initCheckboxColumn(b));for(var d=0,g=this.getCellHeaderElement(d);g;)g.innerHTML.length>0&&g.classList.add("navColumn"),a.appendChild(g),g=this.getCellHeaderElement(++d);c.appendChild(a);
d>0&&b.appendChild(c)};d.prototype.renderRow=function(b,c){c.verticalAlign="baseline";c.classList.add("treeTableRow");var a=this.explorer.getNavDict();if(a){a.addRow(b,c);var d=this;c.addEventListener("click",function(a){if(d.explorer.getNavHandler())d.explorer.getNavHandler().onClick(b,a)},!1)}if(a=this.getCheckboxColumn(b,c))a.classList.add("checkColumn"),c.appendChild(a);for(var a=0,g=this.getCellElement(a,b,c);g;)c.appendChild(g),a===0?this.getPrimColumnStyle?g.classList.add(this.getPrimColumnStyle(b)):
g.classList.add("navColumn"):this.getSecondaryColumnStyle?g.classList.add(this.getSecondaryColumnStyle()):g.classList.add("secondaryColumn"),g=this.getCellElement(++a,b,c)};d.prototype.getCellHeaderElement=function(){};d.prototype.getCellElement=function(){};return d}();b.SimpleFlatModel=function(){function d(b,c,a){this.items=b;this.getKey=a;this.idPrefix=c;this.root={children:b}}d.prototype=new b.ExplorerModel;d.prototype.getRoot=function(b){b(this.root)};d.prototype.getId=function(b){for(var b=
this.getKey(b).replace(/[\\\/]/g,""),c="",a=0;a<b.length;a++)c+=b[a].match(/[^\.\:\-\_0-9A-Za-z]/g)?b.charCodeAt(a):b[a];return this.idPrefix+c};d.prototype.getChildren=function(b,c){b===this.root?c(this.items):c([])};return d}();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(h,k,j,f,d,i,b,g){function e(a){switch(a&&a.id){case "image/jpeg":case "image/png":case "image/gif":case "image/ico":case "image/tiff":case "image/svg":return!0}return!1}function c(a,c,g,f,h,j,t,q,w){var c=i.clone(c),n;if(c.Directory)n=document.createElement("a"),
n.className="navlinkonpage",n.href=!a?l:(new b(a+"#{,resource,params*}")).expand({resource:c.ChildrenLocation}),c.Name&&n.appendChild(document.createTextNode(c.Name));else{h||(h=d.getOpenWithCommands(g));n=document.createElement("a");n.className="navlink targetSelector";j&&typeof j==="object"&&Object.keys(j).forEach(function(a){n[a]=j[a]});var r=null,x=null;if(r=q?q.holderDom:n)x=document.createElement("span"),x.className="core-sprite-file modelDecorationSprite thumbnail",r.appendChild(x);c.Name&&
n.appendChild(document.createTextNode(c.Name));var z=c.Location;if(t&&typeof t==="object")c.params={},i.mixin(c.params,t);(a=d.getOpenWithCommand(g,c,h))&&(z=a.hrefCallback({items:c}));k.when(f.getFileContentType(c),function(a){if(r){var b=r,d=x;if(a){var g,f=a.imageClass,i=a.image;if(f)g=document.createElement("span"),g.className+=f,g.classList.add("thumbnail");else if(i)g=document.createElement("img"),g.src=i,g.classList.add("thumbnail");g&&b.replaceChild(g,d)}}n.href=z;w&&typeof w.updateFileNode===
"function"&&w.updateFileNode(c,n,e(a))})}return n}function a(a,c,b,e){this.explorer=c;this.commandService=b;this.contentTypeService=e;this.openWithCommands=null;this.actionScopeId=a.actionScopeId;this._init(a);this.target="_self"}var l=new b("#{,resource,params*}");a.prototype=new j.SelectionRenderer;a.prototype.wrapperCallback=function(a){a.setAttribute("role","tree")};a.prototype.tableCallback=function(a){a.setAttribute("aria-label",h.Navigator);a.setAttribute("role","presentation")};a.prototype.rowCallback=
function(a){a.setAttribute("role","treeitem")};a.prototype.emptyCallback=function(a){var c=document.createElement("tr"),b=document.createElement("td");b.colSpan=this.oneColumn?1:3;var e=document.createElement("div");e.classList.add("noFile");e.textContent=h.NoFile;var d=document.createElement("span");d.appendChild(document.createTextNode(h.File));g.processDOMNodes(e,[d]);b.appendChild(e);c.appendChild(b);a.appendChild(c)};a.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"}};a.prototype.setTarget=function(a){this.target=a};a.prototype.getFolderImage=function(){if(!this.showFolderImage)return null;var a=document.createElement("span");a.className="core-sprite-folder modelDecorationSprite";return a};a.prototype.createFolderNode=function(a){var b;this.showFolderLinks?(b=c(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};a.prototype.updateFileNode=function(){};a.prototype.showFolderLinks=!0;a.prototype.getCellElement=function(a,b,e){switch(a){case 0:var a=document.createElement("td"),g=document.createElement("span");g.id=e.id+"MainCol";g.setAttribute("role","presentation");a.appendChild(g);a.setAttribute("role","presentation");g.className="mainNavColumn";var i;if(b.Directory)this.getExpandImage(e,g),i=this.createFolderNode(b),g.appendChild(i),this.explorer._makeDropTarget(b,
i),this.explorer._makeDropTarget(b,e);else{if(!this.openWithCommands)this.openWithCommands=d.getOpenWithCommands(this.commandService);i=c("",b,this.commandService,this.contentTypeService,this.openWithCommands,{target:this.target},null,null,this);g.appendChild(i)}if(i)i.id=e.id+"NameLink",i.nodeType===1&&(f.addNavGrid(this.explorer.getNavDict(),b,i),i.setAttribute("role","link"),i.setAttribute("tabindex","-1"));this.actionScopeId&&this.commandService.renderCommands(this.actionScopeId,g,b,this.explorer,
"tool",null,!0);return a;case 1:if(this.oneColumn)return null;e=document.createElement("td");if(b.LocalTimeStamp)e.textContent=(new Date(b.LocalTimeStamp)).toLocaleString();return e;case 2:if(this.oneColumn)return null;e=document.createElement("td");if(!b.Directory&&typeof b.Length==="number")b=parseInt(b.Length,10)/1024,e.textContent=Math.ceil(b).toLocaleString()+" KB";e.style.textAlign="right";return e}};a.prototype.constructor=a;return{NavigatorRenderer:a,isImage:e,createLink:c}});
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(h,k,j,f,d,i,b,g,e){function c(a,c){this.serviceRegistry=a;this.commandRegistry=c;this.openWithCommands=null}function a(a){this.registry=a.serviceRegistry;this._commandService=a.commandService;this._fileService=a.fileService;this.defaultRenderer=new c(this.registry,
this._commandService);this._fileService||console.error("No file service on search client")}c.prototype.makeRenderFunction=function(a,c,i,s,p){var u=this.serviceRegistry,v=this.commandRegistry;this.openWithCommands=this.openWithCommands||g.createOpenWithCommands(u,a,v);var t=this;return function(g,u,n,r){e.when(t.openWithCommands,function(e){if(n)j.empty(c),e=document.createElement("div"),e.appendChild(document.createTextNode(h["Search failed."])),c.appendChild(e),typeof s==="function"&&s(c);else{var z=
function(){function a(c,b){var e=b.folderName?b.folderName:b.path,d=document.createElement("span");d.id=e.replace(/[^a-zA-Z0-9_\.:\-]/g,"");d.appendChild(document.createTextNode(" - "+e+" "));c.appendChild(d)}var c={};return function(b,e){var d=e.name;if(c.hasOwnProperty(d)){a(b,e);var g=c[d];typeof g==="function"&&(c[d]=null,g())}else c[d]=function(){a(b,e)}}}(),A=!1;j.empty(c);if(g&&g.length>0){var D=document.createElement("table");D.setAttribute("role","presentation");for(var I=0;I<g.length;I++){var E=
g[I],y;if(!A&&(A=!0,i))y=D.insertRow(0).insertCell(0),y.textContent=i;y=D.insertRow(-1).insertCell(0);y.colspan=2;p&&p(y);var G={Name:E.name,Directory:E.directory,Location:E.path||E.location},t=null;if(typeof E.LineNumber==="number")t={},t.line=E.LineNumber;if(r&&r.keyword&&!r.nameSearch){var B=d.generateSearchHelper(r),t=t||{};t.find=B.inFileQuery.searchStr;t.regEx=B.inFileQuery.wildCard?!0:void 0}G=b.createLink(k.toUrl("edit/edit.html"),G,v,a,e,{"aria-describedby":(E.folderName?E.folderName:E.path).replace(/[^a-zA-Z0-9_\.:\-]/g,
""),style:{verticalAlign:"middle"}},t);E.LineNumber&&G.appendChild(document.createTextNode(" (Line "+E.LineNumber+")"));y.appendChild(G);z(y,E)}c.appendChild(D);typeof s==="function"&&s(c)}!A&&u&&(e=f.formatMessage(h["No matches found for ${0}"],u),j.empty(c),c.appendChild(document.createTextNode(e)),typeof s==="function"&&s(c))}})}};a.prototype={search:function(a,c,b){var e=function(a){for(var b=[],e=0;e<a.response.docs.length;e++){var g=a.response.docs[e],f=g.Location,n=d.path2FolderName(g.Path?
g.Path:g.Location,g.Name),r=n?n:f;(c?r.indexOf(c)>=0:1)&&b.push({name:g.Name,path:f,folderName:n,directory:g.Directory,lineNumber:g.LineNumber})}return b};if(this._crawler&&a.nameSearch)this._crawler.searchName(a,function(c){b(e(c),a.keyword,null,a)});else try{this.registry.getService("orion.page.progress").progress(this._fileService.search(a),"Searching "+a.keyword).then(function(c){var d=a.keyword,d=d.substring(d.indexOf("}")+1),d=d.substring(d.indexOf(":")+1);b(e(c),d,null,a)},function(a){b(null,
null,a,null)})}catch(g){typeof g==="string"&&g.indexOf("search")>-1&&this._crawler?this._crawler.searchName(a,function(c){b(e(c),null,null,a)}):typeof g==="string"&&g.indexOf("search")>-1&&!a.nameSearch?(new i.SearchCrawler(this.registry,this._fileService,a,{childrenLocation:this.getChildrenLocation()})).search(function(c){b(e(c),null,null,a)}):this.registry.getService("orion.page.message").setErrorMessage(g)}},getFileService:function(){return this._fileService},setCrawler:function(a){this._crawler=
a},handleError:function(a,c){console.error(a);j.empty(c);c.appendChild(document.createTextNode(a));return a},setLocationByMetaData:function(a,c){var b="",e=null;this._searchRootLocation=this._fileService.fileServiceRootURL(a.Location);c&&a&&a.Parents&&a.Parents.length>0?e=c.index==="last"?a.Parents[a.Parents.length-1]:a.Parents[0]:a&&a.Directory&&a.Location&&a.Parents&&(e=a);if(e)this.setLocationbyURL(e.Location),b=e.Name,this._childrenLocation=e.ChildrenLocation;else if(a)this.setLocationbyURL(this._searchRootLocation),
b=this._fileService.fileServiceName(a.Location),this._childrenLocation=a.ChildrenLocation;e=j.node("search");b||(b="");if(e&&e.placeholder){e.value="";var d=f.formatMessage(h["Search ${0}"],b);e.placeholder=d.length>30?d.substring(0,27)+"...":f.formatMessage(h["Search ${0}"],b)}if(e&&e.title)e.title=h["Type a keyword or wild card to search in "]+b},setLocationbyURL:function(a){this._searchLocation=a},setRootLocationbyURL:function(a){this._searchRootLocation=a},setChildrenLocationbyURL:function(a){this._childrenLocation=
a},getSearchLocation:function(){return this._searchLocation?this._searchLocation:this._fileService.fileServiceRootURL()},getSearchRootLocation:function(){return this._searchRootLocation?this._searchRootLocation:this._fileService.fileServiceRootURL()},getChildrenLocation:function(){return this._childrenLocation?this._childrenLocation:this._fileService.fileServiceRootURL()},createSearchParams:function(a,c,b,e){b=b?this.getSearchRootLocation():this.getSearchLocation();return c?{resource:b,sort:"NameLower asc",
rows:100,start:0,nameSearch:!0,keyword:a}:{resource:b,sort:e&&e.sort?e.sort:"Path asc",rows:e&&e.rows?e.rows:40,start:0,caseSensitive:e?e.caseSensitive:void 0,regEx:e?e.regEx:void 0,fileType:e?e.fileType:void 0,keyword:a,replace:e?e.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(h,k){function j(){}function f(){this.styles=[];var d=new j;d.name="Eclipse";d.annotationRuler="white";d.background="white";d.comment="green";d.keyword="#7f0055";d.text="darkSlateGray";d.string="blue";d.overviewRuler="white";d.lineNumberOdd="#444";d.lineNumberEven="#444";d.lineNumber="#444";d.currentLine="#EAF2FE";d.tag="darkorange";d.attribute="cadetBlue";d.fontFamily=i;d.fontSize=
b;this.styles.push(d);d=new j;d.name="Prospecto";d.annotationRuler="white";d.background="white";d.comment="#3C802C";d.keyword="#CC4C07";d.text="#333";d.string="#446FBD";d.overviewRuler="white";d.lineNumberOdd="silver";d.lineNumberEven="silver";d.lineNumber="silver";d.currentLine="#EAF2FE";d.tag="#CC4C07";d.attribute="cadetBlue";d.fontFamily=i;d.fontSize=b;this.styles.push(d);d=new j;d.name="Blue";d.annotationRuler="lavender";d.background="aliceBlue";d.comment="indigo";d.keyword="cornFlowerBlue";d.text=
"navy";d.string="cornFlowerBlue";d.overviewRuler="lavender";d.lineNumberOdd="darkSlateGray";d.lineNumberEven="darkSlateGray";d.lineNumber="darkSlateGray";d.currentLine="white";d.tag="cornFlowerBlue";d.attribute="cadetBlue";d.fontFamily=i;d.fontSize=b;this.styles.push(d);d=new j;d.name="Ambience";d.annotationRuler="#3D3D3D";d.background="#202020";d.comment="mediumslateblue";d.keyword="cornFlowerBlue";d.text="darkseagreen";d.string="lightcoral";d.overviewRuler="white";d.lineNumberOdd="black";d.lineNumberEven=
"black";d.lineNumber="black";d.currentLine="lightcyan";d.tag="cornFlowerBlue";d.attribute="cadetBlue";d.fontFamily=i;d.fontSize=b;this.styles.push(d);d=new j;d.name="Tierra";d.annotationRuler="moccasin";d.background="lemonchiffon";d.comment="darkseagreen";d.keyword="darkred";d.text="#555555";d.string="orangered";d.overviewRuler="moccasin";d.lineNumberOdd="chocolate";d.lineNumberEven="chocolate";d.lineNumber="chocolate";d.currentLine="#baa289";d.tag="darkred";d.attribute="cadetBlue";d.fontFamily=i;
d.fontSize=b;this.styles.push(d);d=new j;d.name="Nimbus";d.annotationRuler="#444";d.background="dimgray";d.comment="darkseagreen";d.keyword="darkorange";d.text="white";d.string="cornflowerblue";d.overviewRuler="#444";d.lineNumberOdd="#aaa";d.lineNumberEven="#aaa";d.lineNumber="#aaa";d.currentLine="#aabfbb";d.tag="darkorange";d.attribute="cadetBlue";d.fontFamily=i;d.fontSize=b;this.styles.push(d);d=new j;d.name="Adelante";d.annotationRuler="#E2D2B2";d.background="#F1E7C8";d.comment="#5D774E";d.keyword=
"#AF473B";d.text="dimgray";d.string="#DE5D3B";d.overviewRuler="#E2D2B2";d.lineNumberOdd="#AF473B";d.lineNumberEven="#AF473B";d.lineNumber="#AF473B";d.currentLine="#9e937b";d.tag="#AF473B";d.attribute="cadetBlue";d.fontFamily=i;d.fontSize=b;this.styles.push(d);d=new j;d.name="Raspberry Pi";d.annotationRuler="seashell";d.background="seashell";d.comment="#66B32F";d.keyword="#E73E36";d.text="dimgray";d.string="darkorange";d.overviewRuler="seashell";d.lineNumberOdd="#E73E36";d.lineNumberEven="#E73E36";
d.lineNumber="#E73E36";d.currentLine="#F5B1AE";d.tag="#E73E36";d.attribute="cadetBlue";d.fontFamily=i;d.fontSize=b;this.styles.push(d)}function d(){return this.styles}var i='"Consolas", "Monaco", "Vera Mono", "monospace"',b="10pt";f.prototype.styles=[];f.prototype.getStyles=d;f.prototype.fontSettable=!0;f.prototype.getThemeStorageInfo=function(){return{storage:"/themes",styleset:"editorstyles",defaultTheme:"Prospecto",selectedKey:"editorSelected",version:"5.0"}};f.prototype.parseToXML=function(b){try{var e=
null;if(window.DOMParser){var e=(new DOMParser).parseFromString(b,"text/xml"),c=e.getElementsByTagName("parsererror");return!c||!c.length||!c[0].childNodes.length?e:null}else return e=new ActiveXObject("Microsoft.XMLDOM"),e.async=!1,e.loadXML(b),e}catch(a){}};f.prototype.selectFontSize=function(b){console.log("fontsize: "+b)};f.prototype.importTheme=function(b){console.log("import theme");console.log(b);var e=this.parseToXML(b.parameters.valueFor("name")),c=new j;c.name=e.getElementsByTagName("colorTheme")[0].attributes[1].value;
c.annotationRuler=e.getElementsByTagName("background")[0].attributes[0].value;c.background=e.getElementsByTagName("background")[0].attributes[0].value;c.comment=e.getElementsByTagName("singleLineComment")[0].attributes[0].value;c.keyword=e.getElementsByTagName("keyword")[0].attributes[0].value;c.text=e.getElementsByTagName("foreground")[0].attributes[0].value;c.string=e.getElementsByTagName("string")[0].attributes[0].value;c.overviewRuler=e.getElementsByTagName("background")[0].attributes[0].value;
c.lineNumberOdd=e.getElementsByTagName("lineNumber")[0].attributes[0].value;c.lineNumberEven=e.getElementsByTagName("lineNumber")[0].attributes[0].value;c.lineNumber=e.getElementsByTagName("lineNumber")[0].attributes[0].value;c.currentLine=e.getElementsByTagName("selectionBackground")[0].attributes[0].value;b.items.addTheme(c)};f.prototype.processSettings=function(b){var e=k.TextTheme.getTheme();e.setThemeClass("editorTheme",e.buildStyleSheet("editorTheme",b))};f.prototype.getViewData=function(){var b=
{top:10,left:10,width:400,height:350},e=b.left,c=b.top;b.shapes=[{type:"TEXT",name:h["Line Numbers"],label:"1",x:e+20,y:c+20,fill:"darkSlateGray",family:"lineNumber",font:"9pt sans-serif"},{type:"RECTANGLE",name:h.Background,x:e+46,y:c,width:290,height:b.height,family:"background",fill:"white"},{type:"TEXT",name:h.Strings,label:"'text/javascript'",x:e+134,y:c+20,fill:"darkorange",family:"string",font:"9pt sans-serif"},{type:"TEXT",name:h.Foreground,label:"=",x:e+124,y:c+20,fill:"darkSlateGray",family:"text",
font:"9pt sans-serif"},{type:"RECTANGLE",name:h["Current Line"],x:e+46,y:c+87,width:290,height:18,family:"currentLine",fill:"#eaf2fd"},{type:"TEXT",name:h["HTML Attribute"],label:"type",x:e+98,y:c+20,fill:"darkGray",family:"attribute",font:"9pt sans-serif"},{type:"RECTANGLE",name:h["Overview Ruler"],x:e+336,y:c,width:14,height:b.height,family:"overviewRuler",fill:"white"},{type:"TEXT",name:h.Comments,label:"/* comment */",x:e+75,y:c+40,fill:"darkSeaGreen",family:"comment",font:"9pt sans-serif"},{type:"TEXT",
name:h["HTML Tag"],label:"<script",x:e+55,y:c+20,fill:"darkorange",family:"keyword",font:"9pt sans-serif"},{type:"TEXT",name:h["HTML Tag"],label:">",x:e+213,y:c+20,fill:"darkorange",family:"keyword",font:"9pt sans-serif"},{type:"TEXT",name:h.Strings,label:"'Result'",x:e+164,y:c+80,fill:"cornflowerBlue",family:"string",font:"9pt sans-serif"},{type:"TEXT",name:h.Foreground,label:"multiply(a,b){",x:e+120,y:c+60,fill:"darkSlateGray",family:"text",font:"9pt sans-serif"},{type:"TEXT",name:h.Keywords,label:"function",
x:e+75,y:c+60,fill:"darkorange",family:"keyword",font:"9pt sans-serif"},{type:"TEXT",name:h.Keywords,label:"var",x:e+95,y:c+80,fill:"darkorange",family:"keyword",font:"9pt sans-serif"},{type:"TEXT",name:h.Foreground,label:"output = ",x:e+115,y:c+80,fill:"darkSlateGray",family:"text",font:"9pt sans-serif"},{type:"TEXT",name:h.Foreground,label:";",x:e+205,y:c+80,fill:"darkSlateGray",family:"text",font:"9pt sans-serif"},{type:"TEXT",name:h.Keywords,label:"var",x:e+95,y:c+100,fill:"darkorange",family:"keyword",
font:"9pt sans-serif"},{type:"TEXT",name:h.Foreground,label:"result = a*b;",x:e+115,y:c+100,fill:"darkSlateGray",family:"text",font:"9pt sans-serif"},{type:"TEXT",name:h.Keywords,label:"return",x:e+95,y:c+120,fill:"darkorange",family:"keyword",font:"9pt sans-serif"},{type:"TEXT",name:h.Foreground,label:"output + result;",x:e+135,y:c+120,fill:"darkSlateGray",family:"text",font:"9pt sans-serif"},{type:"TEXT",name:h.Foreground,label:"}",x:e+75,y:c+140,fill:"darkSlateGray",family:"text",font:"9pt sans-serif"},
{type:"TEXT",name:h["HTML Tag"],label:"<\/script>",x:e+55,y:c+160,fill:"darkorange",family:"keyword",font:"9pt sans-serif"},{type:"TEXT",name:h["HTML Tag"],label:"<style",x:e+55,y:c+200,fill:"darkorange",family:"keyword",font:"9pt sans-serif"},{type:"TEXT",name:h["HTML Attribute"],label:"type",x:e+95,y:c+200,fill:"darkGray",family:"attribute",font:"9pt sans-serif"},{type:"TEXT",name:h.Foreground,label:"=",x:e+121,y:c+200,fill:"darkSlateGray",family:"text",font:"9pt sans-serif"},{type:"TEXT",name:h.Strings,
label:"'text/css'",x:e+131,y:c+200,fill:"darkorange",family:"string",font:"9pt sans-serif"},{type:"TEXT",name:h["HTML Tag"],label:">",x:e+180,y:c+200,fill:"darkorange",family:"keyword",font:"9pt sans-serif"},{type:"TEXT",name:h["CSS Class Name"],label:".some-class",x:e+75,y:c+220,fill:"darkorange",family:"keyword",font:"9pt sans-serif"},{type:"TEXT",name:h["CSS Class Name"],label:"{",x:e+145,y:c+220,fill:"darkSlateGray",family:"text",font:"9pt sans-serif"},{type:"TEXT",name:h["CSS Attribute"],label:"color:",
x:e+95,y:c+240,fill:"darkSlateGray",family:"text",font:"9pt sans-serif"},{type:"TEXT",name:h["CSS Value"],label:"#123456",x:e+130,y:c+240,fill:"darkSlateGray",family:"string",font:"9pt sans-serif"},{type:"TEXT",name:h["CSS Text"],label:";",x:e+180,y:c+240,fill:"darkSlateGray",family:"text",font:"9pt sans-serif"},{type:"TEXT",name:h["CSS Class Name"],label:"}",x:e+75,y:c+260,fill:"darkSlateGray",family:"text",font:"9pt sans-serif"},{type:"TEXT",name:h["HTML Tag"],label:"</style>",x:e+55,y:c+280,fill:"darkorange",
family:"keyword",font:"9pt sans-serif"},{type:"RECTANGLE",name:h["Annotation Ruler"],x:e,y:c,width:46,height:b.height,family:"annotationRuler",fill:"white"}];for(var a=0;a<16;a++)b.shapes.push({type:"TEXT",name:h["Line Numbers"],label:a+1,x:e+20,y:c+20*a+20,fill:"darkSlateGray",family:"lineNumber",font:"9pt sans-serif"});return b};return{ThemeData:f,getStyles:d}});
define("orion/section","orion/webui/littlelib,orion/selection,orion/commandRegistry,orion/commonHTMLFragments,orion/objects,orion/selection".split(","),function(h,k,j,f,d,i){function b(b,c){var a=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 g=0;g<d.length;g++)this.domNode.classList.add(d[g]);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("sectionTitleTwistie"),this.domNode.style.cursor="pointer",this.domNode.appendChild(this.twistie),this.domNode.tabIndex=
0,this.domNode.addEventListener("click",function(c){(c.target===a.titleNode||c.target===a.twistie)&&a._changeExpandedState()},!1),this.domNode.addEventListener("keydown",function(c){c.keyCode===h.KEY.ENTER&&(c.target===a.domNode||c.target===a.titleNode||c.target===a.twistie)&&a._changeExpandedState()},!1);if(c.iconClass){var i=document.createElement("span");i.classList.add("sectionIcon");this.domNode.appendChild(i);d=Array.isArray(c.iconClass)?c.iconClass:[c.iconClass];d.forEach(function(a){i.classList.add(a)})}c.headerClass&&
(d=Array.isArray(c.headerClass)?c.headerClass:[c.headerClass],d.forEach(function(a){this.domNode.classList.add(a)}.bind(this)));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("ul");this.actionsNode.id=c.id+"ActionArea";this.actionsNode.classList.add("layoutRight");this.actionsNode.classList.add("commandList");this.actionsNode.classList.add("sectionActions");
this.domNode.appendChild(this.actionsNode);this.selectionNode=document.createElement("ul");this.selectionNode.id=c.id+"SelectionArea";this.selectionNode.classList.add("layoutRight");this.selectionNode.classList.add("commandList");this.selectionNode.classList.add("sectionActions");this.domNode.appendChild(this.selectionNode);c.slideout&&(d=f.slideoutHTMLFragment(c.id),g=document.createRange(),g.selectNode(this.domNode),d=g.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";this.domNode.classList.add("sectionWrapperClosed");
if(this._preferenceService){var j=this;this._preferenceService.getPreferences("/window/views").then(function(a){a=a.get(j.id);if(a!==void 0)j.hidden=!a;if(!j.hidden)j._contentParent.style.display="block",j.domNode.classList.remove("sectionWrapperClosed");j._updateExpandedState(!j.hidden,!1)})}else{if(!this.hidden)this._contentParent.style.display="block",this.domNode.classList.remove("sectionWrapperClosed");this._updateExpandedState(!this.hidden,!1)}this._commandService=c.commandService;this._lastMonitor=
0;this._loading={}}function g(b){this._section=b;this._id=++b._lastMonitor}b.prototype={setTitle:function(b){this.titleNode.textContent=b},getHeaderElement:function(){return this.domNode},getTitleElement:function(){return this.titleNode},getActionElement:function(){return this._toolActionsNode},setContent:function(b){typeof b==="string"?this._contentParent.innerHTML=b:(this._contentParent.innerHTML="",this._contentParent.appendChild(b))},getContentElement:function(){return this._contentParent},embedExplorer:function(b,
c,a){this._contentParent.innerHTML="";if(!b.parent)b.parent=c;this._contentParent.appendChild(b.parent);b.section=this;d.mixin(b,{createActionSections:function(){this.actionsSections&&this.actionsSections.forEach(function(a){if(!h.node(a)){var c=document.createElement("ul");c.id=a;c.classList.add("commandList");c.classList.add("layoutRight");this.section.actionsNode.appendChild(c)}}.bind(this))},getCommandsVisible:function(){return this.section.actionsNode.style.visibility!=="hidden"},setCommandsVisible:function(a){this.section.actionsNode.style.visibility=
a?"":"hidden";var c=a?null:"cursorOnly";this.renderer.selectionPolicy=c;var b=this.getNavHandler();b&&b.setSelectionPolicy(c);a?this.updateCommands():this.actionsSections&&this.actionsSections.forEach(function(a){h.node(a)&&this.commandRegistry.destroy(a)}.bind(this))},destroy:function(){Object.getPrototypeOf(this).destroy.call(this);var a=this;this.actionsSections&&(this.actionsSections.forEach(function(c){delete a[c]}),delete this.actionsSections)},updateCommands:function(a){this.section.actionsNode&&
this.getCommandsVisible()&&(this.createActionSections(),Object.getPrototypeOf(this).updateCommands.call(this,a))},loaded:function(){var c=this;if(!this.selection&&!a)this.serviceRegistry||this.registry?(this.selection=new i.Selection(this.serviceRegistry||this.registry,this.parent.id+"Selection"),this.selection.addEventListener("selectionChanged",function(a){c.updateCommands(a.selections)})):window.console.error("Could not create a Selection for the explorer because of lack of serviceRegistry");var b=
this.registerCommands();!b||!b.then?c.updateCommands():b.then(function(){c.updateCommands()})}});if(b.renderer)b.renderer.section=this,d.mixin(b.renderer,{getCellHeaderElement:function(a){(a=Object.getPrototypeOf(this).getCellHeaderElement.call(this,a))&&this.section.setTitle(a.innerHTML);return null}})},createProgressMonitor:function(){return new g(this)},_setMonitorMessage:function(b,c){this._progressNode.style.visibility="visible";this._loading[b]=c;var a="",d;for(d in this._loading)a!==""&&(a+=
"\n"),a+=this._loading[d];this._progressNode.title=a},_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.domNode.classList.remove("sectionWrapperClosed"),this.hidden=!1):(this._contentParent.style.display="none",this.domNode.classList.add("sectionWrapperClosed"),
this.hidden=!0);this._updateExpandedState(!this.hidden,!0)},_updateExpandedState:function(b,c){var a=this.twistie,d=this.id;a&&(a.classList.add(b?this._expandImageClass:this._collapseImageClass),a.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)}};b.prototype.constructor=b;g.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)}};g.prototype.constructor=g;return{Section:b}});
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(h,k){var j={root:k};Object.keys(h).forEach(function(f){typeof j[f]==="undefined"&&(j[f]=h[f])});return j});
define("orion/compare/compareCommands",["i18n!orion/compare/nls/messages","orion/commands","orion/keyBinding","orion/webui/littlelib"],function(h,k,j,f){var d={};d.CompareCommandFactory=function(){function d(b){this.setOptions(b,!0)}d.prototype={setOptions:function(b,d){if(d)this.options={};if(!this.options)this.options={};b&&Object.keys(b).forEach(function(e){this.options[e]=b[e]}.bind(this))},getOptions:function(){return this.options},initCommands:function(b){var d=this.options.commandSpanId,e=
this.options.commandService;if(e&&d){var c=new k.Command({name:h["Copy current change from right to left"],tooltip:h["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.getImageMode()&&b.options.newFile&&!b.options.newFile.readonly}.bind(this),callback:function(a){a.items.copyToLeft()}}),a=new k.Command({name:h["Copy current change from left to right"],tooltip:h["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.getImageMode()&&b.options.oldFile&&!b.options.oldFile.readonly}.bind(this),callback:function(a){a.items.copyToRight()}}),f=new k.Command({tooltip:h["Switch to unified diff"],name:h.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()}}),
i=new k.Command({tooltip:h["Switch to side by side diff"],name:h["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()}}),o=new k.Command({name:h["Next diff block"],tooltip:h["Next diff block"],imageClass:"core-sprite-move-down",id:"orion.compare.nextDiff",groupId:"orion.compareGroup",visibleWhen:function(){return!b.getImageMode()},
callback:function(a){a.items.nextDiff()}}),s=new k.Command({name:h["Previous diff block"],tooltip:h["Previous diff block"],imageClass:"core-sprite-move-up",id:"orion.compare.prevDiff",groupId:"orion.compareGroup",visibleWhen:function(){return!b.getImageMode()},callback:function(a){a.items.prevDiff()}}),p=new k.Command({name:h["Next diff change"],tooltip:h["Next diff change"],imageClass:"core-sprite-move-down",id:"orion.compare.nextChange",groupId:"orion.compareGroup",visibleWhen:function(){return!b.getImageMode()},
callback:function(a){a.items.nextChange()}}),u=new k.Command({name:h["Previous diff change"],tooltip:h["Previous diff change"],imageClass:"core-sprite-move-up",id:"orion.compare.prevChange",groupId:"orion.compareGroup",visibleWhen:function(){return!b.getImageMode()},callback:function(a){a.items.prevChange(a)}});e.addCommand(c);e.addCommand(a);e.addCommand(i);e.addCommand(f);e.addCommand(o);e.addCommand(s);e.addCommand(p);e.addCommand(u);e.registerCommandContribution(d,"orion.compare.toggle2Inline",
108);e.registerCommandContribution(d,"orion.compare.toggle2TwoWay",109);e.registerCommandContribution(d,"orion.compare.copyToLeft",110,null,!1,new j.KeyBinding(37,!0,!1,!0));e.registerCommandContribution(d,"orion.compare.copyToRight",111,null,!1,new j.KeyBinding(39,!0,!1,!0));e.registerCommandContribution(d,"orion.compare.nextDiff",112,null,!1,new j.KeyBinding(40,!0));e.registerCommandContribution(d,"orion.compare.prevDiff",113,null,!1,new j.KeyBinding(38,!0));b.options.wordLevelNav?(e.registerCommandContribution(d,
"orion.compare.nextChange",114,null,!1,new j.KeyBinding(40,!0,!0)),e.registerCommandContribution(d,"orion.compare.prevChange",115,null,!1,new j.KeyBinding(38,!0,!0))):(e.registerCommandContribution(d,"orion.compare.nextChange",114,null,!0,new j.KeyBinding(40,!0,!0)),e.registerCommandContribution(d,"orion.compare.prevChange",115,null,!0,new j.KeyBinding(38,!0,!0)))}},renderCommands:function(b){var d=this.options.commandSpanId,e=this.options.commandService;e&&d&&(f.empty(f.node(d)),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),e.renderCommands(d,d,b,b,"tool",null,this.options.gridRenderer.navGridHolder)):(e.renderCommands(d,d,b,b,"tool",null,this.options.gridRenderer.navGridHolder),this.options.gridRenderer.additionalCmdRender(this.options.gridRenderer.navGridHolder)):
e.renderCommands(d,d,b,b,"tool",null,this.options.gridRenderer.navGridHolder)):e.renderCommands(d,d,b,b,"tool",null))}};return d}();return d});
define("orion/compare/compareUtils",["orion/URITemplate"],function(h){var k=k||{};k.compareUtils=k.compareUtils||{};k.compareUtils.lookUpMapper=function(h,f,d){for(var i=0,b=0;b<h.length;b++){var g=h[b][f];g===0&&(g=1);if(d>=i&&d<i+g)return{mapperIndex:b,startFrom:i};if(b===h.length-1)break;i+=h[b][f]}return{mapperIndex:h.length-1,startFrom:i}};k.compareUtils.lookUpLineIndex=function(h,f,d){if(d===0)return 0;for(var i=0,b=0;b<d;b++)i+=h[b][f];return i};k.compareUtils.updateMapper=function(h,f,d,i,
b){if(i!==b&&(i>0||b>0)){var g=k.compareUtils.lookUpMapper(h,f,d);if(!(g.mapperIndex<0)){if(i>0)for(var e=d-g.startFrom,d=g.mapperIndex;d<h.length;d++){e=h[d][f]-e;if(i<=e){h[d][f]-=i;break}h[d][f]-=e;i-=e;e=0}b>0&&(h[g.mapperIndex][f]+=b)}}};k.compareUtils.overlapMapper=function(h,f,d,i,b){h=d+h[f]-1;h<d&&(h=d);b<i&&(b=i);return h<i||b<d?!1:!0};k.compareUtils.findFirstDiff=function(h,f,d,i){for(var b=0,g=null,e=0;e<h.length;e++){if(b>i)break;if(k.compareUtils.overlapMapper(h[e],f,b,d,i)&&(g={mapperIndex:e,
startFrom:b},h[e][2]!==0))break;b+=h[e][f]}return g};k.compareUtils.matchMapper=function(h,f,d,i){if(h.length===0)return d;var b=d+Math.round((i-d)/3),g=k.compareUtils.findFirstDiff(h,f,d,i),e=h[g.mapperIndex][f]===0?g.startFrom:g.startFrom+h[g.mapperIndex][f]-1,c=k.compareUtils.lookUpLineIndex(h,1-f,g.mapperIndex),a=g.startFrom-d;return h[g.mapperIndex][2]===0?c-a:b>=g.startFrom&&b<=e?c-Math.round((i-d)/3):b<g.startFrom?c-a:(h[g.mapperIndex][1-f]===0?c:c+h[g.mapperIndex][1-f]-1)-(e-d)};k.compareUtils.getMapperLineCount=
function(h){for(var f=0,d=0;d<h.length;d++)f+=Math.max(h[d][0],h[d][1]);return f};k.compareUtils.getAnnotationIndex=function(h,f){for(var d=0;d<h.length;d++)if(h[d][0]===f)return d;return-1};k.compareUtils.getAnnotationMapperIndex=function(h,f){return h[f][1]};k.compareUtils.getAnnotationIndexByMapper=function(h,f){for(var d=0;d<h.length;d++)if(h[d][1]===f)return{current:d,prev:d-1,next:d+1};return{current:-1,prev:-1,next:-1}};k.compareUtils.isMapperConflict=function(h,f){return f<0?!1:!h[f][3]?!1:
h[f][3]===1};k.compareUtils.mergeDiffBlocks=function(h,f,d,i,b,g){for(var e=0;e<f.length;e++){var c=f[e][0],a=d[f[e][1]];if(a[0]>0){for(var l="",m=0;m<a[0];m++)l=l+i[a[2]-1+m].substring(b)+g;a=h.getLineCount();c>=a&&(c=h.getLineEnd(a-1),m=h.getLineEnd(a-1,!0),c===m?(h.setText(g,c,c),c=a):c=a-1);c=h.getLineStart(c);h.setText(l,c,c)}}};k.compareUtils.generateCompareHref=function(j,f){var d=require.toUrl("compare/compare.html");if(!f.conflict)f.conflict=void 0;if(!f.readonly)f.readonly=void 0;return(new h(d+
"#{,resource,params*}")).expand({resource:j,params:f})};k.compareUtils.generateCompareTreeHref=function(j,f){var d=require.toUrl("compare-tree/compare-tree.html");return(new h(d+"#{,resource,params*}")).expand({resource:j,params:f})};return k.compareUtils});
define("orion/compare/diffProvider",["i18n!orion/compare/nls/messages","orion/Deferred"],function(h,k){function j(d,f,b){var g=new k;d[f].apply(d,b).then(function(b){g.resolve(b)},function(b){g.reject(b)});return g}function f(d,f){var b=d.getServiceReferences("orion.core.diff"),g,e=b;if(f){e=[];for(g=0;g<b.length;++g)f(b[g])&&e.push(b[g])}var c=[],a=[];for(g=0;g<e.length;++g)c[g]=RegExp(e[g].getProperty("pattern")||".*"),a[g]=d.getService(e[g]);this._getService=function(b){if(b.indexOf("://")===-1){var d=
document.createElement("a");d.href=b;b=d.href}for(d=0;d<c.length;++d)if(c[d].test(b))return a[d];throw h["No Matching DiffService for location:"]+b;}}f.prototype={getDiffContent:function(d){return j(this._getService(d),"getDiffContent",arguments)},getDiffFileURI:function(d){return j(this._getService(d),"getDiffFileURI",arguments)}};return{DiffProvider:f}});
define("orion/compare/diffParser",[],function(){var h=h||{};h.DiffParser=function(){function h(f,d){this._lineDelimiter=f?f:j?"\r\n":"\n";this._diffLineDelimiter=d?d:this._lineDelimiter;this._DEBUG=!1}var j=window.navigator.platform.indexOf("Win")!==-1;h.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(f){this._diffLineDelimiter=this._lineDelimiter=f},getDiffArray:function(){return{array:this._diffContents,index:this._diffContentIndex}},parse:function(f,d,i,b){this._init();if(d==="")return{outPutFile:f,mapper:[]};this._oFileContents=f===""?[]:f.split(this._lineDelimiter);this._diffContents=d.split(this._diffLineDelimiter);d=this._diffContents.length;this._hunkRanges=[];for(var g=0;g<d;g++){var e=this._parseHunkRange(g);e&&this._hunkRanges.push(e)}if(0===this._hunkRanges.length)return{outPutFile:f,
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(f=0;f<this._hunkRanges.length;f++)this._parseHunkBlock(f);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 f=0;f<this._deltaMap.length;f++)if(console.log(JSON.stringify(this._deltaMap[f])),
this._deltaMap[f][2]>0){console.log("    **Diff content on change/add: \n");for(var d=0;d<this._deltaMap[f][0];d++)console.log("    "+this._diffContents[this._deltaMap[f][2]+d-1])}},_logNewFile:function(){for(var f=0;f<this._nFileContents.length;f++)console.log(this._nFileContents[f])},_createBlock:function(f,d,i,b){b===i&&f===" "||(i=[i,b-i,"s"],f==="-"?i[2]="r":f==="+"?i[2]="a":f==="c"&&(i[2]="c"),d.push(i))},_createMinusBlock:function(f,d,i){var b=this._oBlocks.length;b===0||f!==this._oBlocks[b-
1][0]?(this._oBlocks.push([f===0?1:f,i]),this._nBlocks.push([d,0,-2])):this._oBlocks[b-1][1]+=i},_createPlusBlock:function(f,d,i,b){var g=this._nBlocks.length;g===0||d!==this._nBlocks[g-1][0]?(this._oBlocks.push([f===0?1:f,0]),this._nBlocks.push([d,i,b])):(this._nBlocks[g-1][1]+=i,this._nBlocks[g-1][2]=b)},_parseHunkBlock:function(f){for(var d=" ",i=this._hunkRanges[f][0]+1,b=f===this._hunkRanges.length-1?this._diffContents.length:this._hunkRanges[f+1][0],g=0,e=0,c=this._hunkRanges[f][1],a=this._hunkRanges[f][3],
h=i,m=i;m<b;m++)if(0!==this._diffContents[m].length){var j=this._diffContents[m][0];if(j==="\\"&&("\\ No newline at end of file"===this._diffContents[m].substring(0,this._diffContents[m].length-1)||"\\ No newline at end of file"===this._diffContents[m]))d==="-"?this._oNewLineAtEnd=!1:d===" "?this._oNewLineAtEnd=this._nNewLineAtEnd=!1:this._nNewLineAtEnd=!1,m>i&&this._diffContents[m-1][this._diffContents[m-1].length-1]==="\r"&&(this._diffContents[m-1]=this._diffContents[m-1].substring(0,this._diffContents[m-
1].length-1));else{switch(j){case "-":case "+":case " ":break;default:continue}if(d!==j){j==="+"&&(h=m);switch(d){case " ":c=this._hunkRanges[f][1]+g;a=this._hunkRanges[f][3]+e;break;case "-":this._createMinusBlock(c,a,this._hunkRanges[f][1]+g-c);break;case "+":this._createPlusBlock(c,a,this._hunkRanges[f][3]+e-a,h)}d=j}switch(j){case "-":g++;break;case "+":e++;break;case " ":g++,e++}}}switch(d){case "-":this._createMinusBlock(c,a,this._hunkRanges[f][1]+g-c);break;case "+":this._createPlusBlock(c,
a,this._hunkRanges[f][3]+e-a,h)}},_detectConflictes:function(f,d){if(f<0)return!1;for(var i=f+d,b=f;b<i;b++){var g=this._diffContents[b];if(g.indexOf("<<<<<")>-1||g.indexOf(">>>>>")>-1)return!0}return!1},_buildMap:function(f){var d=this._oBlocks.length,i=this._oFileContents.length,b=0,g;g=1;for(var e=0;e<d;e++)g=this._oBlocks[e][0]-g,g>0&&(this._deltaMap.push([g,g,0]),b+=g),f&&this._detectConflictes(this._nBlocks[e][2],this._nBlocks[e][1])?this._deltaMap.push([this._nBlocks[e][1],this._oBlocks[e][1],
this._nBlocks[e][2]+1,1]):this._deltaMap.push([this._nBlocks[e][1],this._oBlocks[e][1],this._nBlocks[e][2]+1]),b+=this._oBlocks[e][1],g=this._oBlocks[e][0]+this._oBlocks[e][1];0<i-g&&(this._deltaMap.push([i-g+1,i-g+1,0]),b+=i-g+1);b<i&&(g=i-b,f=this._deltaMap[this._deltaMap.length-1],f[2]===0?(f[0]+=g,f[1]+=g):f[2]===-1?this._deltaMap.push([g,g,0]):this._nNewLineAtEnd===this._oNewLineAtEnd?this._deltaMap.push([g,g,0]):(this._nNewLineAtEnd&&(f[0]+=g),this._oNewLineAtEnd&&(f[1]+=g)))},_buildNewFile:function(){var f=
1,d=!1,i=this._deltaMap.length,b,g;for(b=0;b<i;b++){d=!1;if(this._deltaMap[b][2]===0){for(g=0;g<this._deltaMap[b][0];g++)this._nFileContents.push(this._oFileContents[f+g-1]);d=!0}else if(this._deltaMap[b][2]>0)for(g=0;g<this._deltaMap[b][0];g++)this._nFileContents.push(this._diffContents[this._deltaMap[b][2]+g-1].substring(1));f+=this._deltaMap[b][1]}this._nNewLineAtEnd&&!d&&this._nFileContents.push("")},_converHRangeBody:function(f,d){if(f){var i=parseInt(f,10);d.push(i>=0?i:1)}else d.push(1)},_parseHunkRange:function(f){var d=
this._diffContents[f],i=/^@@\s*\+([\+|\-]*[\d]+)\s*,*\s*([\d]*)\s*-([\+|\-]*[\d]+)\s*,*\s*([\d]*)\s*@@+/,b=/^@@\s*-([\+|\-]*[\d]+)\s*,*\s*([\d]*)\s*\+([\+|\-]*[\d]+)\s*,*\s*([\d]*)\s*@@+/.exec(d),g=null;if(b&&b.length===5)g=[f],this._converHRangeBody(b[1],g),this._converHRangeBody(b[2],g),this._converHRangeBody(b[3],g),this._converHRangeBody(b[4],g);else if((b=i.exec(d))&&b.length===5)g=[f],this._converHRangeBody(b[3],g),this._converHRangeBody(b[4],g),this._converHRangeBody(b[1],g),this._converHRangeBody(b[2],
g);return g}};return h}();return h});
define("orion/compare/compareRulers",["orion/compare/compareUtils"],function(h){var k=k||{};k.CompareRuler=function(){function h(f,d,i){this._location=f||"left";this._overview=d||"page";this._rulerStyle=i;this._editor=null;var b=this;this._listener={onModelChanged:function(d){b._onModelChanged(d)}}}h.prototype={setView:function(f){this._onModelChanged&&this._editor&&this._editor.removeEventListener("ModelChanged",this._listener.onModelChanged);this._editor=f;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(f,d){for(var i=[],b=f;b<d;b++){var g=this.getStyle(b);g&&(i[b]={html:this.getHTML(b),style:g})}return i},getWidestAnnotation:function(){return{html:this.getHTML(-1),style:this.getStyle(-1)}},
getRulerStyle:function(){return this.getStyle(void 0)}};return h}();k.LineNumberCompareRuler=function(){function h(f,d,i,b,g,e){k.CompareRuler.call(this,i,"page",b);this._diffNavigator=f;this._oddStyle=g||{style:{backgroundColor:"white"}};this._evenStyle=e||{style:{backgroundColor:"white"}};this._numOfDigits=0;this._mapperColumnIndex=d}h.prototype=new k.CompareRuler;h.prototype.getStyle=function(f){return f===void 0?this._rulerStyle:this._evenStyle};h.prototype.getHTML=function(f){var d=this._editor.getModel(),
i=this._diffNavigator.getFeeder(this._mapperColumnIndex===0);return!i?"":f===-1?d.getLineCount():i.getLineNumber?(f=i.getLineNumber(f),f===-1?"":f+1):f+1};h.prototype._onModelChanged=function(f){var f=f.start,d=this._editor.getModel(),i=d.getLineCount(),b=(i+"").length;if(this._numOfDigits!==b)this._numOfDigits=b,this._editor.redrawLines(d.getLineAtOffset(f),i,this)};return h}();k.CompareOverviewRuler=function(){function j(f,d,i,b){this._diffNavigator=i;this._onClick=b;k.CompareRuler.call(this,f,
"document",d)}j.prototype=new k.CompareRuler;j.prototype.getStyle=function(f){var d,i;if(f===void 0)d=this._rulerStyle||{},i=d.style||(d.style={}),i.lineHeight="1px",i.fontSize="1px",i.width="14px";else if(d=f!==-1?{styleClass:"annotationOverview breakpoint"}:{},i=d.style||(d.style={}),i.cursor="pointer",i.width="8px",i.left="2px",f>=0){var b;if(this._diffNavigator&&this._diffNavigator.getFeeder())b=this._diffNavigator.getFeeder().getDiffBlocks();else return null;f=h.getAnnotationIndex(b,f);if(f===
-1)return null;b=h.getAnnotationMapperIndex(b,f);var g;g=this._diffNavigator.getMapper();if(b=h.isMapperConflict(g,b))i.border="1px #FF0000 solid";if(f===this._diffNavigator.getCurrentBlockIndex())i.backgroundColor=b?"red":"blue";f=this._diffNavigator.getFeeder().getDiffBlockH(f);b=this._diffNavigator.getFeeder().getOverviewLineCount();if(f<0)return null;g=this._editor.getClientArea();f=Math.floor(g.height*f/b);f<2&&(f=2);i.height=f+"px"}else return null;return d};j.prototype.setDiffNavigator=function(f){this._diffNavigator=
f};j.prototype.getHTML=function(){return"&nbsp;"};j.prototype.onClick=function(f){f!==void 0&&this._onClick(f,this)};j.prototype._onModelChanged=function(){this._editor.getModel().getLineCount()>0&&this._editor.redrawLines(0,1,this)};return j}();k.CompareCurveRuler=function(){function j(f){this._canvasDiv=f;this._mapper=void 0}j.prototype={init:function(f,d,i,b){this._rightIniting=this._rightIniting=this._leftIniting=!0;this._mapper=f;this._leftEditor=d;this._rightEditor=i;this._leftTextView=d.getTextView();
this._rightTextView=i.getTextView();this._diffNavigator=b;this.render()},matchPositionFrom:function(f){var d=f?this._leftTextView:this._rightTextView,i=f?this._rightTextView:this._leftTextView,b=d.getTopIndex(),d=d.getBottomIndex(),f=h.matchMapper(this._mapper,f?0:1,b,d);i.setTopIndex(f)},copyTo:function(f){if(this._diffNavigator.iterator){var d=this._diffNavigator.iterator.cursor();if(d&&(d.type==="word"?!d.copied&&!d.parent.copied:!d.copied)){var i=f?this._rightTextView.getText(d.oldA.start,d.oldA.end):
this._leftTextView.getText(d.newA.start,d.newA.end),b=f?d.newA:d.oldA;(f?this._leftTextView:this._rightTextView).setText(i,b.start,b.end);d.copied=!0}}},render:function(){if(this._mapper){var f=this._canvasDiv.getContext("2d");f.clearRect(0,0,this._canvasDiv.width,this._canvasDiv.height);f.strokeStyle="#AAAAAA";f.lineWidth=1;f.beginPath();var d=this._leftTextView.getTopIndex(),i=this._leftTextView.getBottomIndex(),b=this._rightTextView.getTopIndex(),g=this._rightTextView.getBottomIndex();this._leftLineH=
this._leftTextView.getLineHeight();this._rightLineH=this._rightTextView.getLineHeight();for(var e=0,c=0,a=!1,l=0;l<this._mapper.length;l++){if(this._mapper[l][2]!==0)if(h.overlapMapper(this._mapper[l],0,e,d,i)||h.overlapMapper(this._mapper[l],1,c,b,g))this._renderCurve(l,e,c,this._canvasDiv,f,d,i,b,g),a=!0;else if(a)break;e+=this._mapper[l][0];c+=this._mapper[l][1]}f.stroke()}},_renderCurve:function(f,d,i,b,g){var e=this._mapper[f],d=this._leftTextView.getLinePixel(d+e[0]/2)+e[0]%2*this._leftLineH/
3-this._leftTextView.getTopPixel(),i=this._rightTextView.getLinePixel(i+e[1]/2)+e[1]%2*this._rightLineH/3-this._rightTextView.getTopPixel(),b=b.parentNode.clientWidth;f===this._diffNavigator.getCurrentMapperIndex()?(g.stroke(),g.strokeStyle="#000",g.lineWidth=1,g.beginPath(),g.moveTo(0,d),g.bezierCurveTo(b/3,d,b*0.666,i,b,i),g.stroke(),g.strokeStyle="#AAAAAA",g.lineWidth=1,g.beginPath()):(g.moveTo(0,d),g.bezierCurveTo(b/3,d,b*0.666,i,b,i),g.stroke())},onChanged:function(f,d){var i=d?this._rightIniting:
this._leftIniting;if(f.removedLineCount!==f.addedLineCount){var b=d?this._rightTextView:this._leftTextView;i||h.updateMapper(this._mapper,d?1:0,b.getModel().getLineAtOffset(f.start),f.removedLineCount,f.addedLineCount);(f.removedLineCount>0||f.addedLineCount>0)&&this.render()}d?this._rightIniting=!1:this._leftIniting=!1;return i}};return j}();return k});define("orion/editor/i18n",{load:function(h,k,j){k.specified&&k.specified("orion/bootstrap")?k(["orion/i18n!"+h],function(f){j(f)}):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(h,k){var j={root:k},f;for(f in h)h.hasOwnProperty(f)&&typeof j[f]==="undefined"&&(j[f]=h[f]);return j});
define("orion/editor/textModel",["orion/editor/eventTarget","orion/regex","orion/util"],function(h,k,j){function f(d,f){this._lastLineIndex=-1;this._text=[""];this._lineOffsets=[0];this.setText(d);this.setLineDelimiter(f)}f.prototype={destroy:function(){},find:function(d){if(this._text.length>1)this._text=[this._text.join("")];var f=d.string,b=d.regex,g=f,e="",c=d.caseInsensitive;if(g)if(b){if(f=k.parse(g))g=f.pattern,e=f.flags}else g=f.replace(/([\\$\^*\/+?\.\(\)|{}\[\]])/g,"\\$&"),c&&(g=g.replace(/[iI\u0130\u0131]/g,
"[Ii\u0130\u0131]"));var a=null,h;if(g){var f=d.reverse,m=d.wrap,b=d.wholeWord,j=d.start||0,d=d.end,s=d!==null&&d!==void 0;e.indexOf("g")===-1&&(e+="g");e.indexOf("m")===-1&&(e+="m");c&&e.indexOf("i")===-1&&(e+="i");b&&(g="\\b"+g+"\\b");var p=this._text[0],u,v,t=0;s&&(c=j<d?j:d,p=p.substring(c,j<d?d:j),t=c);var q=RegExp(g,e);if(f)h=function(){var a=null;for(q.lastIndex=0;;){v=q.lastIndex;u=q.exec(p);if(v===q.lastIndex)return null;if(u){if(!(u.index+t<j)){if(!m||a)break;j=p.length+t}a={start:u.index+
t,end:q.lastIndex+t}}else break}if(a)j=a.start;return a};else{if(!s)q.lastIndex=j;h=function(){for(;;){v=q.lastIndex;u=q.exec(p);if(v===q.lastIndex)break;if(u)return{start:u.index+t,end:q.lastIndex+t};if(!(v!==0&&m))break}return null}}a=h()}return{next:function(){var b=a;b&&(a=h());return b},hasNext:function(){return a!==null}}},getCharCount:function(){for(var d=0,f=0;f<this._text.length;f++)d+=this._text[f].length;return d},getLine:function(d,f){var b=this.getLineCount();if(!(0<=d&&d<b))return null;
var g=this._lineOffsets[d];if(d+1<b){b=this.getText(g,this._lineOffsets[d+1]);if(f)return b;for(var g=b.length,e;(e=b.charCodeAt(g-1))===10||e===13;)g--;return b.substring(0,g)}else return this.getText(g)},getLineAtOffset:function(d){var f=this.getCharCount();if(!(0<=d&&d<=f))return-1;var b=this.getLineCount();if(d===f)return b-1;var g,e,c=this._lastLineIndex;if(0<=c&&c<b&&(g=this._lineOffsets[c],e=c+1<b?this._lineOffsets[c+1]:f,g<=d&&d<e))return c;for(var a=b,h=-1;a-h>1;)if(c=Math.floor((a+h)/2),
g=this._lineOffsets[c],e=c+1<b?this._lineOffsets[c+1]:f,d<=g)a=c;else if(d<e){a=c;break}else h=c;return this._lastLineIndex=a},getLineCount:function(){return this._lineOffsets.length},getLineDelimiter:function(){return this._lineDelimiter},getLineEnd:function(d,f){var b=this.getLineCount();if(!(0<=d&&d<b))return-1;if(d+1<b){b=this._lineOffsets[d+1];if(f)return b;for(var g=this.getText(Math.max(this._lineOffsets[d],b-2),b),e=g.length,c;(c=g.charCodeAt(e-1))===10||c===13;)e--;return b-(g.length-e)}else return this.getCharCount()},
getLineStart:function(d){return!(0<=d&&d<this.getLineCount())?-1:this._lineOffsets[d]},getText:function(d,f){d===void 0&&(d=0);f===void 0&&(f=this.getCharCount());if(d===f)return"";for(var b=0,g=0,e;g<this._text.length;){e=this._text[g].length;if(d<=b+e)break;b+=e;g++}for(var c=b,a=g;g<this._text.length;){e=this._text[g].length;if(f<=b+e)break;b+=e;g++}if(a===g)return this._text[a].substring(d-c,f-b);c=this._text[a].substring(d-c);b=this._text[g].substring(0,f-b);return c+this._text.slice(a+1,g).join("")+
b},onChanging:function(d){return this.dispatchEvent(d)},onChanged:function(d){return this.dispatchEvent(d)},setLineDelimiter:function(d,f){d==="auto"&&(d=void 0,this.getLineCount()>1&&(d=this.getText(this.getLineEnd(0),this.getLineEnd(0,!0))));this._lineDelimiter=d?d:j.platformDelimiter;if(f){var b=this.getLineCount();if(b>1){for(var g=Array(b),e=0;e<b;e++)g[e]=this.getLine(e);this.setText(g.join(this._lineDelimiter))}}},setText:function(d,f,b){d===void 0&&(d="");f===void 0&&(f=0);b===void 0&&(b=
this.getCharCount());if(!(f===b&&d==="")){for(var g=this.getLineAtOffset(f),e=this.getLineAtOffset(b),c=f,a=b-f,h=e-g,m=d.length,j=0,k=this.getLineCount(),p=0,u=0,v=0,t=[];;){p!==-1&&p<=v&&(p=d.indexOf("\r",v));u!==-1&&u<=v&&(u=d.indexOf("\n",v));if(u===-1&&p===-1)break;v=p!==-1&&u!==-1?p+1===u?u+1:(p<u?p:u)+1:p!==-1?p+1:u+1;t.push(f+v);j++}this.onChanging({type:"Changing",text:d,start:c,removedCharCount:a,addedCharCount:m,removedLineCount:h,addedLineCount:j});t.length===0&&(v=this.getLineStart(g),
e=e+1<k?this.getLineStart(e+1):this.getCharCount(),f!==v&&(d=this.getText(v,f)+d,f=v),b!==e&&(d+=this.getText(b,e),b=e));v=m-a;for(e=g+h+1;e<k;e++)this._lineOffsets[e]+=v;if(t.length<5E4)g=[g+1,h].concat(t),Array.prototype.splice.apply(this._lineOffsets,g);else{v=g+1;this._lineOffsets.splice(v,h);for(k=0;k<t.length;k+=5E4)g=[v,0].concat(t.slice(k,Math.min(t.length,k+5E4))),Array.prototype.splice.apply(this._lineOffsets,g),v+=5E4}for(v=k=0;v<this._text.length;){e=this._text[v].length;if(f<=k+e)break;
k+=e;v++}g=k;for(t=v;v<this._text.length;){e=this._text[v].length;if(b<=k+e)break;k+=e;v++}e=this._text[v];f=this._text[t].substring(0,f-g);b=e.substring(b-k);t=[t,v-t+1];f&&t.push(f);d&&t.push(d);b&&t.push(b);Array.prototype.splice.apply(this._text,t);if(this._text.length===0)this._text=[""];this.onChanged({type:"Changed",start:c,removedCharCount:a,addedCharCount:m,removedLineCount:h,addedLineCount:j})}}};h.EventTarget.addMixin(f.prototype);return{TextModel:f}});
define("orion/editor/keyModes",["orion/keyBinding","orion/util"],function(h,k){function j(d){if(d)this._view=d,this._keyBindings=this.createKeyBindings(),this._keyBindingIndex=0}function f(d){j.call(this,d)}j.prototype={createKeyBindings:function(){return[]},getKeyBindings:function(d){for(var f=[],b=this._keyBindings,g=0;g<b.length;g++)b[g].actionID===d&&f.push(b[g].keyBinding);return f},getView:function(){return this._view},isActive:function(){return this._view.getKeyModes().indexOf(this)!==-1},
match:function(d){if(d.type==="keydown")switch(d.keyCode){case 16:case 17:case 18:case 91:return}for(var f=this._keyBindingIndex,b=this._matchingKeyBindings||this._keyBindings,g=[],e=0;e<b.length;e++){var c=b[e],a=c.keyBinding.match(d,f);if(a===!0)return this._keyBindingIndex=0,this._matchingKeyBindings=null,c.actionID;else typeof a==="number"&&g.push(c)}if(g.length===0)this._keyBindingIndex=0,this._matchingKeyBindings=null;else return this._keyBindingIndex++,this._matchingKeyBindings=g,"noop"},setKeyBinding:function(d,
f){for(var b=this._keyBindings,g=0;g<b.length;g++){var e=b[g];if(e.keyBinding.equals(d)){f?e.actionID=f:e.predefined?e.actionID="noop":b.splice(g,1);return}}f&&b.push({keyBinding:d,actionID:f})},setView:function(d){this._view=d}};f.prototype=new j;f.prototype.createKeyBindings=function(){var d=h.KeyBinding,f=[];f.push({actionID:"lineUp",keyBinding:new d(38),predefined:!0});f.push({actionID:"lineDown",keyBinding:new d(40),predefined:!0});f.push({actionID:"charPrevious",keyBinding:new d(37),predefined:!0});
f.push({actionID:"charNext",keyBinding:new d(39),predefined:!0});k.isMac?(f.push({actionID:"scrollPageUp",keyBinding:new d(33),predefined:!0}),f.push({actionID:"scrollPageDown",keyBinding:new d(34),predefined:!0}),f.push({actionID:"pageUp",keyBinding:new d(33,null,null,!0),predefined:!0}),f.push({actionID:"pageDown",keyBinding:new d(34,null,null,!0),predefined:!0}),f.push({actionID:"lineStart",keyBinding:new d(37,!0),predefined:!0}),f.push({actionID:"lineEnd",keyBinding:new d(39,!0),predefined:!0}),
f.push({actionID:"wordPrevious",keyBinding:new d(37,null,null,!0),predefined:!0}),f.push({actionID:"wordNext",keyBinding:new d(39,null,null,!0),predefined:!0}),f.push({actionID:"scrollTextStart",keyBinding:new d(36),predefined:!0}),f.push({actionID:"scrollTextEnd",keyBinding:new d(35),predefined:!0}),f.push({actionID:"textStart",keyBinding:new d(38,!0),predefined:!0}),f.push({actionID:"textEnd",keyBinding:new d(40,!0),predefined:!0}),f.push({actionID:"scrollPageUp",keyBinding:new d(38,null,null,null,
!0),predefined:!0}),f.push({actionID:"scrollPageDown",keyBinding:new d(40,null,null,null,!0),predefined:!0}),f.push({actionID:"lineStart",keyBinding:new d(37,null,null,null,!0),predefined:!0}),f.push({actionID:"lineEnd",keyBinding:new d(39,null,null,null,!0),predefined:!0}),f.push({actionID:"lineStart",keyBinding:new d(38,null,null,!0),predefined:!0}),f.push({actionID:"lineEnd",keyBinding:new d(40,null,null,!0),predefined:!0})):(f.push({actionID:"pageUp",keyBinding:new d(33),predefined:!0}),f.push({actionID:"pageDown",
keyBinding:new d(34),predefined:!0}),f.push({actionID:"lineStart",keyBinding:new d(36),predefined:!0}),f.push({actionID:"lineEnd",keyBinding:new d(35),predefined:!0}),f.push({actionID:"wordPrevious",keyBinding:new d(37,!0),predefined:!0}),f.push({actionID:"wordNext",keyBinding:new d(39,!0),predefined:!0}),f.push({actionID:"textStart",keyBinding:new d(36,!0),predefined:!0}),f.push({actionID:"textEnd",keyBinding:new d(35,!0),predefined:!0}));k.isFirefox&&k.isLinux&&(f.push({actionID:"lineUp",keyBinding:new d(38,
!0),predefined:!0}),f.push({actionID:"lineDown",keyBinding:new d(40,!0),predefined:!0}));k.isWindows&&(f.push({actionID:"scrollLineUp",keyBinding:new d(38,!0),predefined:!0}),f.push({actionID:"scrollLineDown",keyBinding:new d(40,!0),predefined:!0}));f.push({actionID:"selectLineUp",keyBinding:new d(38,null,!0),predefined:!0});f.push({actionID:"selectLineDown",keyBinding:new d(40,null,!0),predefined:!0});f.push({actionID:"selectCharPrevious",keyBinding:new d(37,null,!0),predefined:!0});f.push({actionID:"selectCharNext",
keyBinding:new d(39,null,!0),predefined:!0});f.push({actionID:"selectPageUp",keyBinding:new d(33,null,!0),predefined:!0});f.push({actionID:"selectPageDown",keyBinding:new d(34,null,!0),predefined:!0});k.isMac?(f.push({actionID:"selectLineStart",keyBinding:new d(37,!0,!0),predefined:!0}),f.push({actionID:"selectLineEnd",keyBinding:new d(39,!0,!0),predefined:!0}),f.push({actionID:"selectWordPrevious",keyBinding:new d(37,null,!0,!0),predefined:!0}),f.push({actionID:"selectWordNext",keyBinding:new d(39,
null,!0,!0),predefined:!0}),f.push({actionID:"selectTextStart",keyBinding:new d(36,null,!0),predefined:!0}),f.push({actionID:"selectTextEnd",keyBinding:new d(35,null,!0),predefined:!0}),f.push({actionID:"selectTextStart",keyBinding:new d(38,!0,!0),predefined:!0}),f.push({actionID:"selectTextEnd",keyBinding:new d(40,!0,!0),predefined:!0}),f.push({actionID:"selectLineStart",keyBinding:new d(37,null,!0,null,!0),predefined:!0}),f.push({actionID:"selectLineEnd",keyBinding:new d(39,null,!0,null,!0),predefined:!0}),
f.push({actionID:"selectLineStart",keyBinding:new d(38,null,!0,!0),predefined:!0}),f.push({actionID:"selectLineEnd",keyBinding:new d(40,null,!0,!0),predefined:!0})):(k.isLinux&&(f.push({actionID:"selectWholeLineUp",keyBinding:new d(38,!0,!0),predefined:!0}),f.push({actionID:"selectWholeLineDown",keyBinding:new d(40,!0,!0),predefined:!0})),f.push({actionID:"selectLineStart",keyBinding:new d(36,null,!0),predefined:!0}),f.push({actionID:"selectLineEnd",keyBinding:new d(35,null,!0),predefined:!0}),f.push({actionID:"selectWordPrevious",
keyBinding:new d(37,!0,!0),predefined:!0}),f.push({actionID:"selectWordNext",keyBinding:new d(39,!0,!0),predefined:!0}),f.push({actionID:"selectTextStart",keyBinding:new d(36,!0,!0),predefined:!0}),f.push({actionID:"selectTextEnd",keyBinding:new d(35,!0,!0),predefined:!0}));f.push({actionID:"undo",keyBinding:new h.KeyBinding("z",!0),predefined:!0});k.isMac?f.push({actionID:"redo",keyBinding:new h.KeyBinding("z",!0,!0),predefined:!0}):f.push({actionID:"redo",keyBinding:new h.KeyBinding("y",!0),predefined:!0});
f.push({actionID:"deletePrevious",keyBinding:new d(8),predefined:!0});f.push({actionID:"deletePrevious",keyBinding:new d(8,null,!0),predefined:!0});f.push({actionID:"deleteNext",keyBinding:new d(46),predefined:!0});f.push({actionID:"deleteWordPrevious",keyBinding:new d(8,!0),predefined:!0});f.push({actionID:"deleteWordPrevious",keyBinding:new d(8,!0,!0),predefined:!0});f.push({actionID:"deleteWordNext",keyBinding:new d(46,!0),predefined:!0});f.push({actionID:"tab",keyBinding:new d(9),predefined:!0});
f.push({actionID:"shiftTab",keyBinding:new d(9,null,!0),predefined:!0});f.push({actionID:"enter",keyBinding:new d(13),predefined:!0});f.push({actionID:"enter",keyBinding:new d(13,null,!0),predefined:!0});f.push({actionID:"selectAll",keyBinding:new d("a",!0),predefined:!0});f.push({actionID:"toggleTabMode",keyBinding:new d("m",!0),predefined:!0});k.isMac&&(f.push({actionID:"deleteNext",keyBinding:new d(46,null,!0),predefined:!0}),f.push({actionID:"deleteWordPrevious",keyBinding:new d(8,null,null,!0),
predefined:!0}),f.push({actionID:"deleteWordNext",keyBinding:new d(46,null,null,!0),predefined:!0}));f.push({actionID:"toggleWrapMode",keyBinding:new h.KeyBinding("w",!0,!1,!0)});f.push({actionID:"toggleOverwriteMode",keyBinding:new h.KeyBinding(45)});if(!k.isFirefox){var b=k.isMac&&k.isChrome;f.push({actionID:"noop",keyBinding:new d("u",!b,!1,!1,b),predefined:!0});f.push({actionID:"noop",keyBinding:new d("i",!b,!1,!1,b),predefined:!0});f.push({actionID:"noop",keyBinding:new d("b",!b,!1,!1,b),predefined:!0})}k.isFirefox&&
(f.push({actionID:"copy",keyBinding:new d(45,!0),predefined:!0}),f.push({actionID:"paste",keyBinding:new d(45,null,!0),predefined:!0}),f.push({actionID:"cut",keyBinding:new d(46,null,!0),predefined:!0}));k.isMac&&(f.push({actionID:"lineStart",keyBinding:new d("a",!1,!1,!1,!0),predefined:!0}),f.push({actionID:"lineEnd",keyBinding:new d("e",!1,!1,!1,!0),predefined:!0}),f.push({actionID:"lineUp",keyBinding:new d("p",!1,!1,!1,!0),predefined:!0}),f.push({actionID:"lineDown",keyBinding:new d("n",!1,!1,
!1,!0),predefined:!0}),f.push({actionID:"charPrevious",keyBinding:new d("b",!1,!1,!1,!0),predefined:!0}),f.push({actionID:"charNext",keyBinding:new d("f",!1,!1,!1,!0),predefined:!0}),f.push({actionID:"deletePrevious",keyBinding:new d("h",!1,!1,!1,!0),predefined:!0}),f.push({actionID:"deleteNext",keyBinding:new d("d",!1,!1,!1,!0),predefined:!0}),f.push({actionID:"deleteLineEnd",keyBinding:new d("k",!1,!1,!1,!0),predefined:!0}),k.isFirefox?(f.push({actionID:"scrollPageDown",keyBinding:new d("v",!1,
!1,!1,!0),predefined:!0}),f.push({actionID:"deleteLineStart",keyBinding:new d("u",!1,!1,!1,!0),predefined:!0}),f.push({actionID:"deleteWordPrevious",keyBinding:new d("w",!1,!1,!1,!0),predefined:!0})):(f.push({actionID:"pageDown",keyBinding:new d("v",!1,!1,!1,!0),predefined:!0}),f.push({actionID:"centerLine",keyBinding:new d("l",!1,!1,!1,!0),predefined:!0}),f.push({actionID:"enterNoCursor",keyBinding:new d("o",!1,!1,!1,!0),predefined:!0})));return f};return{KeyMode:j,DefaultKeyMode:f}});
define("orion/editor/util",[],function(){return{contains:function(h,k){if(!k)return!1;if(!h.compareDocumentPosition){for(var j=k;j;){if(h===j)return!0;j=j.parentNode}return!1}return h===k||(h.compareDocumentPosition(k)&16)!==0},addEventListener:function(h,k,j,f){typeof h.addEventListener==="function"?h.addEventListener(k,j,f===!0):h.attachEvent("on"+k,j)},removeEventListener:function(h,k,j,f){typeof h.removeEventListener==="function"?h.removeEventListener(k,j,f===!0):h.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(h,k,j,f,d,i,b){function g(a,c,d){if(d){c.className="";for(var d=c.attributes,e=d.length;e-- >0;)(!b.isIE||b.isIE>=9||b.isIE<9&&d[e].specified)&&c.removeAttribute(d[e].name)}if(a){if(a.styleClass)c.className=a.styleClass;if(d=a.style)for(var f in d)d.hasOwnProperty(f)&&(c.style[f]=d[f]);if(a=a.attributes)for(var g in a)a.hasOwnProperty(g)&&
c.setAttribute(g,a[g])}}function e(a){return a instanceof Array?a.slice(0):a}function c(a,b){if(!a)return b;if(!b)return a;for(var c in b)b.hasOwnProperty(c)&&(a.hasOwnProperty(c)||(a[c]=b[c]));return a}function a(b,c){if(b===c)return!0;if(b&&!c||!b&&c)return!1;if(b&&b.constructor===String||c&&c.constructor===String)return!1;if(b instanceof Array||c instanceof Array){if(!(b instanceof Array&&c instanceof Array))return!1;if(b.length!==c.length)return!1;for(var d=0;d<b.length;d++)if(!a(b[d],c[d]))return!1;
return!0}if(!(b instanceof Object)||!(c instanceof Object))return!1;for(d in b)if(b.hasOwnProperty(d)){if(!c.hasOwnProperty(d))return!1;if(!a(b[d],c[d]))return!1}for(d in c)if(!b.hasOwnProperty(d))return!1;return!0}function l(a,b,c){for(var d=0,e=0,f=0,g=a.length;f<g;){d!==-1&&d<=f&&(d=a.indexOf("\r",f));e!==-1&&e<=f&&(e=a.indexOf("\n",f));var h=f,i;if(e===-1&&d===-1){b(a.substring(f));break}d!==-1&&e!==-1?d+1===e?(i=d,f=e+1):(i=d<e?d:e,f=(d<e?d:e)+1):d!==-1?(i=d,f=d+1):(i=e,f=e+1);b(a.substring(h,
i));c()}}function m(a){var b,c,d,e,f=a.ownerDocument.defaultView||a.ownerDocument.parentWindow;if(f.getComputedStyle)a=f.getComputedStyle(a,null),b=a.getPropertyValue("padding-left"),c=a.getPropertyValue("padding-top"),d=a.getPropertyValue("padding-right"),e=a.getPropertyValue("padding-bottom");else if(a.currentStyle)b=a.currentStyle.paddingLeft,c=a.currentStyle.paddingTop,d=a.currentStyle.paddingRight,e=a.currentStyle.paddingBottom;return{left:parseInt(b,10)||0,top:parseInt(c,10)||0,right:parseInt(d,
10)||0,bottom:parseInt(e,10)||0}}function o(a){var b,c,d,e,f=a._trim;if(!f){var f=m(a),g=a.ownerDocument.defaultView||a.ownerDocument.parentWindow;if(g.getComputedStyle)e=g.getComputedStyle(a,null),b=e.getPropertyValue("border-left-width"),c=e.getPropertyValue("border-top-width"),d=e.getPropertyValue("border-right-width"),e=e.getPropertyValue("border-bottom-width");else if(a.currentStyle)b=a.currentStyle.borderLeftWidth,c=a.currentStyle.borderTopWidth,d=a.currentStyle.borderRightWidth,e=a.currentStyle.borderBottomWidth;
b=parseInt(b,10)||0;c=parseInt(c,10)||0;d=parseInt(d,10)||0;e=parseInt(e,10)||0;f.left+=b;f.top+=c;f.right+=d;f.bottom+=e;a._trim=f}return f}function s(a,b,c){this.start=a;this.end=b;this.caret=c}function p(a){this.left=a.left;this.top=a.top;this.right=a.right;this.bottom=a.bottom}function u(a,b,c){this.view=a;this.lineIndex=b;this._lineDiv=c}function v(a){this._init(a||{})}var t=i.addEventListener,q=i.removeEventListener,w=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,c=this.options.onAnimate||function(){},d=this.options.curve[0],e=this.options.curve[1],f=e-d,n=-1,g,h=this;this.interval=this.options.window.setInterval(function(){n=n===-1?(new Date).getTime():n;var i=((new Date).getTime()-n)/a;i<1?(i=b(i),g=d+i*f,c(g)):(c(e),h.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}();s.prototype={clone:function(){return new s(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}};p.prototype={toString:function(){return"{l="+this.left+", t="+this.top+", r="+this.right+", b="+this.bottom+"}"}};u.prototype={create:function(a,b){if(!this._lineDiv){var c=this._lineDiv=this._createLine(a,b,this.lineIndex);c._line=
this;return c}},_createLine:function(c,d,e){var f=this.view,h=f._model,i=h.getLine(e),l=h.getLineStart(e),m={type:"LineStyle",textView:f,lineIndex:e,lineText:i,lineStart:l};if(i.length<2E3)f.onLineStyle(m);h=d||b.createElement(c.ownerDocument,"div");if(!d||!a(d.viewStyle,m.style)){g(m.style,h,d);if(d)d._trim=null;h.viewStyle=m.style;h.setAttribute("role","presentation")}h.lineIndex=e;e=[];this._createRanges(m.ranges,i,0,i.length,l,{tabOffset:0,ranges:e});i=" ";!f._fullSelection&&b.isIE<9&&(i="\ufeff");
m={text:i,style:f._metrics.largestFontStyle,ignoreChars:1};e.length===0||!e[e.length-1].style||e[e.length-1].style.tagName!=="div"?e.push(m):e.splice(e.length-1,0,m);var j,o,k,s,p,i=f=0,q,u;if(d){if(o=d.modelChangedEvent)o.removedLineCount===0&&o.addedLineCount===0?(u=o.start-l,q=o.addedCharCount-o.removedCharCount):u=-1,d.modelChangedEvent=void 0;o=d.firstChild}for(l=0;l<e.length;l++){m=e[l];s=m.text;f+=s.length;j=m.style;if(o)if(p=o.firstChild.data,k=o.viewStyle,p===s&&a(j,k)){i+=p.length;o._rectsCache=
void 0;j=o=o.nextSibling;continue}else for(;o;){if(u!==-1){k=f;k>=u&&(k-=q);p=(p=o.firstChild.data)?p.length:0;if(i+p>k)break;i+=p}k=o.nextSibling;h.removeChild(o);o=k}j=this._createSpan(h,s,j,m.ignoreChars);o?h.insertBefore(j,o):h.appendChild(j);if(d)d.lineWidth=void 0}if(d)for(c=j?j.nextSibling:null;c;)k=c.nextSibling,d.removeChild(c),c=k;else c.appendChild(h);return h},_createRanges:function(b,c,d,e,f,g){if(!(d>e)){if(b)for(var h=0;h<b.length;h++){var i=b[h];if(!(i.end<f+d)){var l=Math.max(f+d,
i.start)-f;if(l>e)break;var m=Math.min(f+e,i.end)-f;if(l<=m){l=Math.max(d,l);m=Math.min(e,m);d<l&&this._createRange(c,d,l,null,g);if(!i.style||!i.style.unmergeable)for(;h+1<b.length&&b[h+1].start-f===m&&a(i.style,b[h+1].style);)i=b[h+1],m=Math.min(f+e,i.end)-f,h++;this._createRange(c,l,m,i.style,g);d=m}}}d<e&&this._createRange(c,d,e,null,g)}},_createRange:function(a,b,c,d,e){if(!(b>c)){var f=this.view._customTabSize;if(f&&f!==8)for(var g=a.indexOf("\t",b);g!==-1&&g<c;){b<g&&(b={text:a.substring(b,
g),style:d},e.ranges.push(b),e.tabOffset+=b.text.length);b=f-e.tabOffset%f;if(b>0){for(var h="\u00a0",i=1;i<b;i++)h+=" ";b={text:h,style:d,ignoreChars:b-1};e.ranges.push(b);e.tabOffset+=b.text.length}b=g+1;if(b===c)return;g=a.indexOf("\t",b)}b<=c&&(b={text:a.substring(b,c),style:d},e.ranges.push(b),e.tabOffset+=b.text.length)}},_createSpan:function(a,c,d,e){var f=this.view,h="span";d&&d.tagName&&(h=d.tagName.toLowerCase());var i=h==="a";if(i)a.hasLink=!0;i&&!f._linksVisible&&(h="span");i=a.ownerDocument;
a=b.createElement(a.ownerDocument,h);d&&d.html?(a.innerHTML=d.html,a.ignore=!0):d&&d.node?(a.appendChild(d.node),a.ignore=!0):a.appendChild(i.createTextNode(d&&d.text?d.text:c));g(d,a);if(h==="a"){var l=f._getWindow();t(a,"click",function(a){return f._handleLinkClick(a?a:l.event)},!1)}a.viewStyle=d;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,c){var d=this._ensureCreated(),
e=this.view;if(a===void 0)return this._getLineBoundingClientRect(d,!0);var f=e._model,g=d.ownerDocument,h=this.lineIndex,i=null;if(a<f.getLineEnd(h)){h=f.getLineStart(h);for(f=d.firstChild;f;){if(!f.ignore){var l=f.firstChild,m=l.length;f.ignoreChars&&(m-=f.ignoreChars);if(h+m>a){i=a-h;if(l.length===1)i=new p(f.getBoundingClientRect());else if(e._isRangeRects)g=g.createRange(),g.setStart(l,i),g.setEnd(l,i+1),i=new p(g.getBoundingClientRect());else if(b.isIE){if(g=g.body.createTextRange(),g.moveToElementText(f),
g.collapse(),(h=i===0&&b.isIE===8)&&(i=1),g.moveEnd("character",i+1),g.moveStart("character",i),i=new p(g.getBoundingClientRect()),h)i.left=f.getClientRects()[0].left}else{var j=l.data;f.removeChild(l);f.appendChild(g.createTextNode(j.substring(0,i)));var o=b.createElement(g,"span");o.appendChild(g.createTextNode(j.substring(i,i+1)));f.appendChild(o);f.appendChild(g.createTextNode(j.substring(i+1)));i=new p(o.getBoundingClientRect());f.innerHTML="";f.appendChild(l);this._createdDiv||(g=e._getSelection(),
(h<=g.start&&g.start<h+m||h<=g.end&&g.end<h+m)&&e._updateDOMSelection())}b.isIE&&(g=d.ownerDocument.defaultView||d.ownerDocument.parentWindow,d=g.screen.logicalXDPI/g.screen.deviceXDPI,g=g.screen.logicalYDPI/g.screen.deviceYDPI,i.left*=d,i.right*=d,i.top*=g,i.bottom*=g);break}h+=m}f=f.nextSibling}}d=this.getBoundingClientRect();if(!i)e._wrapMode?(e=this.getClientRects(),i=e[e.length-1],i.left=i.right,i.left+=d.left,i.top+=d.top,i.right+=d.left,i.bottom+=d.top):(i=new p(d),i.left=i.right);if(c||c===
void 0)i.left-=d.left,i.top-=d.top,i.right-=d.left,i.bottom-=d.top;return i},_getClientRects:function(a,b){var c,d,e,f;if(!a._rectsCache){c=a.getClientRects();d=Array(c.length);for(f=0;f<c.length;f++)e=d[f]=new p(c[f]),e.left-=b.left,e.top-=b.top,e.right-=b.left,e.bottom-=b.top;a._rectsCache=d}c=a._rectsCache;d=[c.length];for(f=0;f<c.length;f++)d[f]=new p(c[f]);return d},getClientRects:function(a){if(!this.view._wrapMode)return[this.getBoundingClientRect()];for(var b=this._ensureCreated(),c=[],d=
b.firstChild,e,f=b.getBoundingClientRect();d;){if(!d.ignore)for(var g=this._getClientRects(d,f),b=0;b<g.length;b++){var h=g[b],i;if(h.top!==h.bottom){var l=h.top+(h.bottom-h.top)/2;for(i=0;i<c.length;i++)if(e=c[i],e.top<=l&&l<e.bottom)break;if(i===c.length)c.push(h);else{if(h.left<e.left)e.left=h.left;if(h.top<e.top)e.top=h.top;if(h.right>e.right)e.right=h.right;if(h.bottom>e.bottom)e.bottom=h.bottom}}}d=d.nextSibling}return a!==void 0?c[a]:c},_getLineBoundingClientRect:function(a,b){var c=new p(a.getBoundingClientRect());
if(!this.view._wrapMode){c.right=c.left;for(var d=a.lastChild;d&&d.ignoreChars===d.firstChild.length;)d=d.previousSibling;if(d)d=d.getBoundingClientRect(),c.right=d.right+o(a).right}b&&(d=o(a),c.left+=d.left,c.right-=d.right);return c},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,c=0;c<b.length;c++)if(b[c].top<=a&&
a<b[c].bottom)return c;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,c){var d=this.view,e=d._model,f=this.lineIndex,g=e.getLineStart(f),h=e.getLineEnd(f);if(g===h)return g;var i=this._ensureCreated(),l=this.getBoundingClientRect(),m,j;if(d._wrapMode){m=this.getClientRects();if(c<m[0].top)c=m[0].top;for(var o=0;o<m.length;o++)if(j=m[o],
j.top<=c&&c<j.bottom)break;if(a<j.left)a=j.left;a>j.right&&(a=j.right-1)}else a<0&&(a=0),a>l.right-l.left&&(a=l.right-l.left);var k=i.ownerDocument,o=k.defaultView||k.parentWindow,s=b.isIE?o.screen.logicalXDPI/o.screen.deviceXDPI:1,p=b.isIE?o.screen.logicalYDPI/o.screen.deviceYDPI:1,o=g,q=i.firstChild;a:for(;q;){if(!q.ignore){var u=q.firstChild,i=u.length;q.ignoreChars&&(i-=q.ignoreChars);var w,v,t;m=this._getClientRects(q,l);for(var J=0;J<m.length;J++)if(j=m[J],j.left<=a&&a<j.right&&(!d._wrapMode||
j.top<=c&&c<j.bottom)){var J=j.left+l.left,H;if(b.isIE||d._isRangeRects){for(var k=d._isRangeRects?k.createRange():k.body.createTextRange(),C=i,L=-1;C-L>1;){var T=Math.floor((C+L)/2);m=L+1;j=T===i-1&&q.ignoreChars?u.length:T+1;H=m===0&&b.isIE===8;d._isRangeRects?(k.setStart(u,m),k.setEnd(u,j)):(H&&(m=1),k.moveToElementText(q),k.move("character",m),k.moveEnd("character",j-m));m=k.getClientRects();for(var V=!1,U=0;U<m.length;U++)if(j=m[U],w=(H?J:j.left)*s-l.left,t=j.right*s-l.left,v=j.top*p-l.top,j=
j.bottom*p-l.top,w<=a&&a<t&&(!d._wrapMode||v<=c&&c<j)){V=!0;break}V?C=T:L=T}o+=C;m=C;j=C===i-1&&q.ignoreChars?u.length:Math.min(C+1,u.length);d._isRangeRects?(k.setStart(u,m),k.setEnd(u,j)):(k.moveToElementText(q),k.move("character",m),k.moveEnd("character",j-m));m=k.getClientRects();d=!1;m.length>0&&(j=m[0],w=(H?J:j.left)*s-l.left,t=j.right*s-l.left,d=a>w+(t-w)/2);l=o-g;e=e.getLine(f);f=e.charCodeAt(l);55296<=f&&f<=56319&&d?l<e.length&&(f=e.charCodeAt(l+1),56320<=f&&f<=57343&&(o+=1)):56320<=f&&f<=
57343&&!d&&l>0&&(f=e.charCodeAt(l-1),55296<=f&&f<=56319&&(o-=1));d&&o++}else{e=[];for(f=0;f<i;f++)e.push("<span>"),f===i-1?e.push(u.data.substring(f)):e.push(u.data.substring(f,f+1)),e.push("</span>");q.innerHTML=e.join("");for(e=q.firstChild;e;){j=e.getBoundingClientRect();w=j.left-l.left;t=j.right-l.left;if(w<=a&&a<t){a>w+(t-w)/2&&o++;break}o++;e=e.nextSibling}if(!this._createdDiv)q.innerHTML="",q.appendChild(u),l=d._getSelection(),(o<=l.start&&l.start<o+i||o<=l.end&&l.end<o+i)&&d._updateDOMSelection()}break a}o+=
i}q=q.nextSibling}return Math.min(h,Math.max(g,o))},getNextOffset:function(a,c){if(c.unit==="line"){var d=this.view._model,e=d.getLineAtOffset(a);if(c.count>0)return c.count--,d.getLineEnd(e);c.count++;return d.getLineStart(e)}return c.unit==="wordend"||c.unit==="wordWS"||c.unit==="wordendWS"?this._getNextOffset_W3C(a,c):b.isIE?this._getNextOffset_IE(a,c):this._getNextOffset_W3C(a,c)},_getNextOffset_W3C:function(a,c){function b(a){return 33<=a&&a<=47||58<=a&&a<=64||91<=a&&a<=94||a===96||123<=a&&a<=
126}function d(a){return a===32||a===9}var e=this.view._model,f=e.getLineAtOffset(a),g=e.getLine(f),h=e.getLineStart(f),e=e.getLineEnd(f),f=g.length,i=a-h,l,m=c.count<0?-1:1;if(c.unit==="word"||c.unit==="wordend"||c.unit==="wordWS"||c.unit==="wordendWS")for(var j,o,k;c.count!==0;){if(c.count>0){if(i===f)return e;l=g.charCodeAt(i);j=b(l);o=!j&&!d(l);for(i++;i<f;){l=g.charCodeAt(i);if(c.unit!=="wordWS"&&c.unit!=="wordendWS"){k=b(l);if(c.unit==="wordend"){if(!k&&j)break}else if(k&&!j)break;l=!k&&!d(l)}else l=
!d(l);if(c.unit==="wordend"||c.unit==="wordendWS"){if(!l&&o)break}else if(l&&!o)break;o=l;j=k;i++}}else{if(i===0)return h;i--;l=g.charCodeAt(i);j=b(l);for(o=!j&&!d(l);0<i;){l=g.charCodeAt(i-1);if(c.unit!=="wordWS"&&c.unit!=="wordendWS"){k=b(l);if(c.unit==="wordend"){if(k&&!j)break}else if(!k&&j)break;l=!k&&!d(l)}else l=!d(l);if(c.unit==="wordend"||c.unit==="wordendWS"){if(l&&!o)break}else if(!l&&o)break;o=l;j=k;i--}}c.count-=m}else for(;c.count!==0&&0<=i+m&&i+m<=f;)i+=m,l=g.charCodeAt(i),56320<=l&&
l<=57343&&i>0&&(l=g.charCodeAt(i-1),55296<=l&&l<=56319&&(i+=m)),c.count-=m;return h+i},_getNextOffset_IE:function(a,c){var b=this._ensureCreated(),d=this.view._model,e=this.lineIndex,f=0,g;g=d.getLineStart(e);var h=b.ownerDocument,i=c.count<0?-1:1;if(a===d.getLineEnd(e)){for(b=b.lastChild;b&&b.ignoreChars===b.firstChild.length;)b=b.previousSibling;if(!b)return g;f=h.body.createTextRange();f.moveToElementText(b);g=f.text.length;f.moveEnd(c.unit,i);f=a+f.text.length-g}else if(a===g&&c.count<0)f=g;else for(b=
b.firstChild;b;){d=b.firstChild.length;b.ignoreChars&&(d-=b.ignoreChars);if(g+d>a){f=h.body.createTextRange();if(a===g&&c.count<0){for(g=b.previousSibling;g;){if(g.firstChild&&g.firstChild.length)break;g=g.previousSibling}f.moveToElementText(g?g:b.previousSibling)}else f.moveToElementText(b),f.collapse(),f.moveEnd("character",a-g);g=f.text.length;f.moveEnd(c.unit,i);f=a+f.text.length-g;break}g=d+g;b=b.nextSibling}c.count-=i;return f},destroy:function(){var a=this._createdDiv;if(a)a.parentNode.removeChild(a),
this._createdDiv=null}};v.prototype={addKeyMode:function(a,c){var b=this._keyModes;c!==void 0?b.splice(c,0,a):b.push(a);a._modeAdded&&a._modeAdded()},addRuler:function(a,c){a.setView(this);var b=this._rulers;if(c!==void 0){var d,e;for(d=0,e=0;d<b.length&&e<c;d++)a.getLocation()===b[d].getLocation()&&e++;b.splice(e,0,a);c=e}else b.push(a);this._createRuler(a,c);this._update()},computeSize:function(){var a=0,c=0,d=this._model,e=this._clientDiv;if(!e)return{width:a,height:c};var f=e.style.width;if(b.isWebkit)e.style.width=
"0x7fffffffpx";for(var d=d.getLineCount(),g=0;g<d;g++){var h=this._getLine(g),i=h.getBoundingClientRect(),a=Math.max(a,i.right-i.left);c+=i.bottom-i.top;h.destroy()}if(b.isWebkit)e.style.width=f;e=this._getViewPadding();a+=e.right+e.left+this._metrics.scrollWidth;c+=e.bottom+e.top+this._metrics.scrollWidth;return{width:a,height:c}},convert:function(a,c,b){if(this._clientDiv){var d=this._getScroll(),e=this._getViewPadding(),f=this._viewDiv.getBoundingClientRect();c==="document"&&(a.x!==void 0&&(a.x+=
-d.x+f.left+e.left),a.y!==void 0&&(a.y+=-d.y+f.top+e.top));b==="document"&&(a.x!==void 0&&(a.x+=d.x-f.left-e.left),a.y!==void 0&&(a.y+=d.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._parent=null;this._model&&this._model.destroy&&this._model.destroy();this._actions=this._keyModes=this._doubleClickSelection=this._selection=this._theme=this._model=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 c=[],b=this._actions,d;for(d in b)b.hasOwnProperty(d)&&(a||!b[d].defaultHandler)&&c.push(d);return c},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 c=[],b=this._keyModes,d=0;d<b.length;d++)c=c.concat(b[d].getKeyBindings(a));return c},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 c=this._model,a=Math.min(Math.max(0,a),c.getCharCount()),c=c.getLineAtOffset(a),b=this._getLine(c),a=b.getBoundingClientRect(a);b.destroy();b=a.left;c=this._getLinePixel(c)+a.top;return{x:b,y:c}},getNextOffset:function(a,
c){var b=new s(a,a,!1);this._doMove(c,b);return b.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 e(this["_"+a])}else{a={};for(var c in arguments)arguments.hasOwnProperty(c)&&(a[arguments[c]]=void 0)}for(var b in a)a.hasOwnProperty(b)&&(a[b]=e(this["_"+b]));return a},getModel:function(){return this._model},getOffsetAtLocation:function(a,c){if(!this._clientDiv)return 0;var b=this._getLineIndex(c),
d=this._getLine(b),b=d.getOffset(a,c-this._getLinePixel(b));d.destroy();return b},getLineAtOffset:function(a){this.getModel().getLineAtOffset(a)},getLineStart:function(a){this.getModel().getLineStart(a)},getRulers:function(){return this._rulers.slice(0)},getSelection:function(){var a=this._getSelection();return{start:a.start,end:a.end}},getText:function(a,c){return this._model.getText(a,c)},getTopIndex:function(a){return!this._clientDiv?0:this._getTopIndex(a)},getTopPixel:function(){return!this._clientDiv?
0:this._getScroll().y},invokeAction:function(a,c,b){if(this._clientDiv){if(a=this._actions[a]){if(!c&&a.handler&&a.handler(b))return!0;if(a.defaultHandler)return typeof a.defaultHandler(b)==="boolean"}return!1}},isDestroyed:function(){return!this._clientDiv},onContextMenu:function(a){return this.dispatchEvent(a)},onDragStart:function(a){return this.dispatchEvent(a)},onDrag:function(a){return this.dispatchEvent(a)},onDragEnd:function(a){return this.dispatchEvent(a)},onDragEnter:function(a){return this.dispatchEvent(a)},
onDragOver:function(a){return this.dispatchEvent(a)},onDragLeave:function(a){return this.dispatchEvent(a)},onDrop:function(a){return this.dispatchEvent(a)},onDestroy:function(a){return this.dispatchEvent(a)},onLineStyle:function(a){return this.dispatchEvent(a)},onKeyDown:function(a){return this.dispatchEvent(a)},onKeyPress:function(a){return this.dispatchEvent(a)},onKeyUp:function(a){return this.dispatchEvent(a)},onModelChanged:function(a){return this.dispatchEvent(a)},onModelChanging:function(a){return this.dispatchEvent(a)},
onModify:function(a){return this.dispatchEvent(a)},onMouseDown:function(a){return this.dispatchEvent(a)},onMouseUp:function(a){return this.dispatchEvent(a)},onMouseMove:function(a){return this.dispatchEvent(a)},onMouseOver:function(a){return this.dispatchEvent(a)},onMouseOut:function(a){return this.dispatchEvent(a)},onSelection:function(a){return this.dispatchEvent(a)},onScroll:function(a){return this.dispatchEvent(a)},onVerify:function(a){return this.dispatchEvent(a)},onFocus:function(a){return this.dispatchEvent(a)},
onBlur:function(a){return this.dispatchEvent(a)},redraw:function(){if(!(this._redrawCount>0)){var a=this._model.getLineCount();this.redrawRulers(0,a);this.redrawLines(0,a)}},redrawRulers:function(a,c){if(!(this._redrawCount>0))for(var b=this.getRulers(),d=0;d<b.length;d++)this.redrawLines(a,c,b[d])},redrawLines:function(a,c,b){if(!(this._redrawCount>0)&&(a===void 0&&(a=0),c===void 0&&(c=this._model.getLineCount()),a!==c)){var d=this._clientDiv;if(d){if(b)for(d=this._getRulerParent(b).firstChild;d;){if(d._ruler===
b)break;d=d.nextSibling}b?d.rulerChanged=!0:this._lineHeight&&this._resetLineHeight(a,c);if(!b||b.getOverview()==="page")for(d=d.firstChild;d;){var e=d.lineIndex;if(a<=e&&e<c)d.lineChanged=!0;d=d.nextSibling}if(!b&&!this._wrapMode&&a<=this._maxLineIndex&&this._maxLineIndex<c)this._checkMaxLineIndex=this._maxLineIndex,this._maxLineIndex=-1,this._maxLineWidth=0;this._queueUpdate()}}},redrawRange:function(a,c){if(!(this._redrawCount>0)){var b=this._model;a===void 0&&(a=0);c===void 0&&(c=b.getCharCount());
var d=b.getLineAtOffset(a),b=b.getLineAtOffset(Math.max(a,c-1))+1;this.redrawLines(d,b)}},removeKeyMode:function(a){for(var c=this._keyModes,b=0;b<c.length;b++)if(c[b]===a){c.splice(b,1);break}a._modeRemoved&&a._modeRemoved()},removeRuler:function(a){for(var c=this._rulers,b=0;b<c.length;b++)if(c[b]===a){c.splice(b,1);a.setView(null);this._destroyRuler(a);this._update();break}},resize:function(){this._clientDiv&&this._handleResize(null)},setAction:function(a,c,b){if(a){var d=this._actions,e=d[a];
e||(e=d[a]={});e.handler=c;if(b!==void 0)e.actionDescription=b}},setKeyBinding:function(a,c){this._keyModes[0].setKeyBinding(a,c)},setCaretOffset:function(a,c,b){var d=this._model.getCharCount(),a=Math.max(0,Math.min(a,d));this._setSelection(new s(a,a,!1),c===void 0||c,!0,b)},setHorizontalPixel:function(a){this._clientDiv&&(a=Math.max(0,a),this._scrollView(a-this._getScroll().x,0))},setRedraw:function(a){a?--this._redrawCount===0&&this.redraw():this._redrawCount++},setModel:function(a){if(a&&a!==
this._model){this._model.removeEventListener("preChanging",this._modelListener.onChanging);this._model.removeEventListener("postChanged",this._modelListener.onChanged);var c=this._model.getLineCount(),b=this._model.getCharCount(),d=a.getLineCount(),e=a.getCharCount(),f={type:"ModelChanging",text:a.getText(),start:0,removedCharCount:b,addedCharCount:e,removedLineCount:c,addedLineCount:d};this.onModelChanging(f);this._model=a;f={type:"ModelChanged",start:0,removedCharCount:b,addedCharCount:e,removedLineCount:c,
addedLineCount:d};this.onModelChanged(f);this._model.addEventListener("preChanging",this._modelListener.onChanging);this._model.addEventListener("postChanged",this._modelListener.onChanged);this._reset();this._update()}},setOptions:function(c){var b=this._defaultOptions(),d;for(d in c)if(c.hasOwnProperty(d)){var f=c[d];if(!a(this["_"+d],f)){var g=b[d]?b[d].update:null;g?g.call(this,f):this["_"+d]=e(f)}}},setSelection:function(a,c,b,d){var e=a>c;if(e)var f=a,a=c,c=f;f=this._model.getCharCount();a=
Math.max(0,Math.min(a,f));c=Math.max(0,Math.min(c,f));this._setSelection(new s(a,c,e),b===void 0||b,!0,d)},setText:function(a,c,d){var e=c===void 0&&d===void 0;c===void 0&&(c=0);d===void 0&&(d=this._model.getCharCount());if(e)this._variableLineHeight=!1;this._modifyContent({text:a,start:c,end:d,_code:!0},!e);if(e)this._columnX=-1,this._setSelection(new s(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,c){this._clientDiv&&(a&&this._updateStyle(),c===void 0||c?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 c=this._overlayDiv||this._clientDiv;if(b.isIE<9)c=
this._viewDiv;for(var d=a.target?a.target:a.srcElement;d;){if(c===d)return;d=d.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,c=b.createElement(a.ownerDocument,"div");a.appendChild(c);a.removeChild(c)}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(),c=this._selDiv1.ownerDocument,a.getSelection){c=a.getSelection();for(a=c.anchorNode;a;){if(a===this._clientDiv){c.rangeCount>0&&c.removeAllRanges();
break}a=a.parentNode}}else if(c.selection){this._ignoreSelect=!1;for(a=c.selection.createRange().parentElement();a;){if(a===this._clientDiv){c.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 c=!1;this.isListening("ContextMenu")?(c=this._createMouseEvent("ContextMenu",a),c.screenX=a.screenX,c.screenY=a.screenY,this.onContextMenu(c),
c=c.defaultPrevented):b.isMac&&b.isFirefox&&a.button===0&&(c=!0);if(c)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 c=this;this._getWindow().setTimeout(function(){c._clientDiv.contentEditable=!0;c._clientDiv.draggable=!1;c._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 c=!0;this._dropTarget=
!0;this.isListening("DragEnter")&&(c=!1,this.onDragEnter(this._createMouseEvent("DragEnter",a)));if(b.isWebkit||c)return a.preventDefault&&a.preventDefault(),!1}},_handleDragOver:function(a){if(!this._ignoreEvent(a)){var c=!0;this.isListening("DragOver")&&(c=!1,this.onDragOver(this._createMouseEvent("DragOver",a)));if(b.isWebkit||c){if(c)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 c=this._createKeyEvent("KeyDown",a);this.onKeyDown(c);if(c.defaultPrevented){if(b.isFirefox)this._keyDownPrevented=!0;a.preventDefault();return}}c=!1;switch(a.keyCode){case 16:case 17:case 18:case 91:c=!0;break;default:this._setLinksVisible(!1)}if(a.keyCode===229){if(this._readonly)return a.preventDefault&&
a.preventDefault(),!1;c=!0;if(b.isSafari&&b.isMac&&a.ctrlKey)c=!1,a.keyCode=129;c&&this._startIME()}else c||this._commitIME();if((b.isMac||b.isLinux)&&b.isFirefox<4||b.isOpera<12.16)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<12.16)&&this._doAction(this._keyDownEvent))return a.preventDefault&&a.preventDefault(),!1;var c=b.isMac?a.metaKey:a.ctrlKey;if(a.charCode!==void 0&&c)switch(a.charCode){case 99:case 118:case 120:return!0}if(this.isListening("KeyPress")&&(c=this._createKeyEvent("KeyPress",a),this.onKeyPress(c),c.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;c=!1;if(b.isMac){if(a.ctrlKey||a.metaKey)c=!0}else if(b.isFirefox){if(a.ctrlKey||a.altKey)c=!0}else a.ctrlKey^a.altKey&&(c=!0);if(!c&&(c=b.isOpera?a.which:a.charCode!==void 0?a.charCode:a.keyCode,c>31))return this._doContent(String.fromCharCode(c)),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 c=this._createKeyEvent("KeyUp",a);this.onKeyUp(c);if(c.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 c=this._getWindow(),d=!0,e=c;if(b.isIE||b.isFirefox&&!this._overlayDiv)e=this._clientDiv;if(this._overlayDiv){if(this._hasFocus)this._ignoreFocus=
!0;var f=this;c.setTimeout(function(){f.focus();f._ignoreFocus=!1},0)}this._clickCount===1?(d=this._setSelectionTo(a.clientX,a.clientY,a.shiftKey,(!b.isOpera||b.isOpera>=12.16)&&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 d},_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 c=a.which;c||(a.button===4&&(c=2),a.button===2&&(c=3),a.button===1&&(c=1));var d=c!==2&&a.timeStamp?a.timeStamp:(new Date).getTime(),e=d-this._lastMouseTime,f=Math.abs(this._lastMouseX-a.clientX),g=Math.abs(this._lastMouseY-a.clientY),h=this._lastMouseButton===c;this._lastMouseX=a.clientX;this._lastMouseY=a.clientY;this._lastMouseTime=d;this._lastMouseButton=c;if(c===1)this._isMouseDown=!0,h&&e<=this._clickTime&&
f<=this._clickDist&&g<=this._clickDist?this._clickCount++:this._clickCount=1;if(this.isListening("MouseDown")&&(d=this._createMouseEvent("MouseDown",a),this.onMouseDown(d),d.defaultPrevented)){a.preventDefault();return}if(c===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 c=this._isClientDiv(a);if(this.isListening("MouseMove")&&c)this.onMouseMove(this._createMouseEvent("MouseMove",a));if(!this._dropTarget){var d=this._linksVisible||this._lastMouseMoveX!==
a.clientX||this._lastMouseMoveY!==a.clientY;this._lastMouseMoveX=a.clientX;this._lastMouseMoveY=a.clientY;this._setLinksVisible(d&&!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&&c)return this._clickCount=2,this._handleMouse(a,this._clickCount)}if(this._isMouseDown&&this._dragOffset===-1){var c=a.clientX,a=a.clientY,e=this._getViewPadding(),f=this._viewDiv.getBoundingClientRect(),
g=this._getClientWidth(),h=this._getClientHeight(),d=f.left+e.left,i=f.top+e.top,g=f.left+e.left+g,e=f.top+e.top+h;a<i?this._doAutoScroll("up",c,a-i):a>e?this._doAutoScroll("down",c,a-e):c<d&&!this._wrapMode?this._doAutoScroll("left",c-d,a):c>g&&!this._wrapMode?this._doAutoScroll("right",c-g,a):(this._endAutoScroll(),this._setSelectionTo(c,a,!0))}}}},_isClientDiv:function(a){for(var c=this._overlayDiv||this._clientDiv,a=a.target?a.target:a.srcElement;a;){if(c===a)return!0;a=a.parentNode}return!1},
_createKeyEvent:function(a,c){return{type:a,event:c,preventDefault:function(){this.defaultPrevented=!0}}},_createMouseEvent:function(a,c){var b=this.convert({x:c.clientX,y:c.clientY},"page","document");return{type:a,event:c,clickCount:this._clickCount,x:b.x,y:b.y,preventDefault:function(){this.defaultPrevented=!0}}},_handleMouseUp:function(a){var c=a.which?a.button===0:a.button===1;if(this.isListening("MouseUp")&&(this._isClientDiv(a)||c&&this._isMouseDown))this.onMouseUp(this._createMouseEvent("MouseUp",
a));if(!this._linksVisible&&c&&this._isMouseDown){if(this._dragOffset!==-1)c=this._getSelection(),c.extend(this._dragOffset),c.collapse(),this._setSelection(c,!0,!0),this._dragOffset=-1;this._isMouseDown=!1;this._endAutoScroll();this._isW3CEvents&&this._setGrab(null);b.isFirefox&&a.preventDefault()}},_handleMouseWheel:function(a){var c=this._getLineHeight(),d=0,e=0;b.isIE||b.isOpera?e=-a.wheelDelta/40*c:b.isFirefox?a.type==="wheel"?a.deltaMode?(d=Math.max(-256,Math.min(256,a.deltaX))*c,e=Math.max(-256,
Math.min(256,a.deltaY))*c):(d=a.deltaX,e=a.deltaY):(c=b.isMac?a.detail*3:Math.max(-256,Math.min(256,a.detail))*c,a.axis===a.HORIZONTAL_AXIS?d=c:e=c):b.isMac?(e=a.timeStamp-this._wheelTimeStamp,this._wheelTimeStamp=a.timeStamp,d=a.wheelDeltaX%120!==0?1:e<40?40/(40-e):40,e=a.wheelDeltaY%120!==0?1:e<40?40/(40-e):40,d=Math.ceil(-a.wheelDeltaX/d),-1<d&&d<0&&(d=-1),0<d&&d<1&&(d=1),e=Math.ceil(-a.wheelDeltaY/e),-1<e&&e<0&&(e=-1),0<e&&e<1&&(e=1)):(d=-a.wheelDeltaX,e=-a.wheelDeltaY/120*8*c);if(b.isSafari||
b.isChrome&&b.isMac){for(c=a.target;c&&c.lineIndex===void 0;)c=c.parentNode;this._mouseWheelLine=c}c=this._getScroll();this._scrollView(d,e);d=this._getScroll();if(c.x!==d.x||c.y!==d.y)return a.preventDefault&&a.preventDefault(),!1},_handlePaste:function(a){if(!this._ignoreEvent(a)&&!this._ignorePaste&&this._doPaste(a)){if(b.isIE){var c=this;this._ignoreFocus=!0;this._getWindow().setTimeout(function(){c._updateDOMSelection();c._ignoreFocus=!1},0)}a.preventDefault&&a.preventDefault();return!1}},_handleResize:function(){var c=
this._rootDiv.clientWidth,d=this._rootDiv.clientHeight;if(this._rootWidth!==c||this._rootHeight!==d){this._rootWidth!==c&&this._wrapMode&&this._resetLineHeight();this._rootWidth=c;this._rootHeight=d;c=b.isIE<9;d=this._calculateMetrics();if(!a(d,this._metrics)){if(this._variableLineHeight)this._variableLineHeight=!1,this._resetLineHeight();this._metrics=d;c=!0}c?this._queueUpdate():this._update()}},_handleRulerEvent:function(a){for(var c=a.target?a.target:a.srcElement,b=c.lineIndex;c&&!c._ruler;){if(b===
void 0&&c.lineIndex!==void 0)b=c.lineIndex;c=c.parentNode}var d=c?c._ruler:null;if(b===void 0&&d&&d.getOverview()==="document"){var b=this._getClientHeight(),e=this._model.getLineCount(),f=this._getViewPadding(),g=this._viewDiv.getBoundingClientRect(),b=Math.floor((a.clientY-g.top-this._metrics.scrollWidth)*e/(b+f.top+f.bottom-2*this._metrics.scrollWidth));0<=b&&b<e||(b=void 0)}if(d)switch(a.type){case "click":if(d.onClick)d.onClick(b,a);break;case "dblclick":if(d.onDblClick)d.onDblClick(b,a);break;
case "mousemove":if(d.onMouseMove)d.onMouseMove(b,a);break;case "mouseover":if(d.onMouseOver)d.onMouseOver(b,a);break;case "mouseout":if(d.onMouseOut){for(e=a.relatedTarget;e&&e!==this._rootDiv;){if(e===c)return;e=e.parentNode}d.onMouseOut(b,a)}}},_handleScroll:function(){var a=this._getScroll(!1),c=this._hScroll,b=this._vScroll;if(c!==a.x||b!==a.y)this._hScroll=a.x,this._vScroll=a.y,this._commitIME(),this._update(b===a.y),this.onScroll({type:"Scroll",oldValue:{x:c,y:b},newValue:a})},_handleSelectStart:function(a){if(this._ignoreSelect)return a&&
a.preventDefault&&a.preventDefault(),!1},_getModelOffset:function(a,c){if(a){var b;b=a.tagName==="DIV"?a:a.parentNode.parentNode;var d=0,e=b.lineIndex;if(a.tagName!=="DIV")for(b=b.firstChild;b;){var f=b.firstChild;if(f===a){b.ignoreChars&&(d-=b.ignoreChars);d+=c;break}b.ignoreChars&&(d-=b.ignoreChars);d+=f.data.length;b=b.nextSibling}return Math.max(0,d)+this._model.getLineStart(e)}},_updateSelectionFromDOM:function(){var a=this._getWindow().getSelection(),c=this._getModelOffset(a.anchorNode,a.anchorOffset),
a=this._getModelOffset(a.focusNode,a.focusOffset);c===void 0||a===void 0||this._setSelection(new s(c,a),!1,!1)},_handleSelectionChange:function(){if(this._imeOffset===-1)if(b.isAndroid){var a=this._getWindow();this._selTimer&&a.clearTimeout(this._selTimer);var c=this;this._selTimer=a.setTimeout(function(){if(c._clientDiv)c._selTimer=null,c._updateSelectionFromDOM()},250)}else this._updateSelectionFromDOM()},_handleTextInput:function(a){if(!this._ignoreEvent(a)){this._imeOffset=-1;var c=this._getWindow().getSelection();
if(c.anchorNode!==this._anchorNode||c.focusNode!==this._focusNode||c.anchorOffset!==this._anchorOffset||c.focusOffset!==this._focusOffset){for(var b=c.anchorNode;b;){if(b.lineIndex!==void 0)break;b=b.parentNode}if(b){var d=this._model,e=b.lineIndex,f=d.getLine(e),g=f,h=0,d=d.getLineStart(e);if(c.rangeCount>0)c.getRangeAt(0).deleteContents(),e=b.ownerDocument.createTextNode(a.data),c.getRangeAt(0).insertNode(e),h=this._getDOMText(b,e),g=h.text,h=h.offset,e.parentNode.removeChild(e);b.lineRemoved=!0;
for(b=0;f.charCodeAt(b)===g.charCodeAt(b)&&b<h;)b++;c=f.length-1;for(e=g.length-f.length;f.charCodeAt(c)===g.charCodeAt(c+e)&&c+e>=h+a.data.length;)c--;c++;f=g.substring(b,c+e);b+=d;c+=d;this._modifyContent({text:f,start:b,end:c,_ignoreDOMSelection:!0},!0)}}else this._doContent(a.data);a.preventDefault()}},_handleTouchStart:function(a){this._commitIME();var c=this._getWindow();if(this._touchScrollTimer)this._vScrollDiv.style.display="none",this._hScrollDiv.style.display="none",c.clearInterval(this._touchScrollTimer),
this._touchScrollTimer=null;var d=a.touches;if(d.length===1){var d=d[0],e=d.clientX,f=d.clientY;this._touchStartX=e;this._touchStartY=f;if(b.isAndroid&&(f<d.pageY-c.pageYOffset||e<d.pageX-c.pageXOffset))e=d.pageX-c.pageXOffset,f=d.pageY-c.pageYOffset;c=this.convert({x:e,y:f},"page","document");this._lastTouchOffset=this.getOffsetAtLocation(c.x,c.y);this._touchStartTime=a.timeStamp;this._touching=!0}},_handleTouchMove:function(a){var c=a.touches;if(c.length===1){c=c[0];this._touchCurrentX=c.clientX;
this._touchCurrentY=c.clientY;if(!this._touchScrollTimer&&a.timeStamp-this._touchStartTime<200){this._vScrollDiv.style.display="block";if(!this._wrapMode)this._hScrollDiv.style.display="block";var b=this,d=this._getWindow();this._touchScrollTimer=d.setInterval(function(){var a=0,c=0;if(b._touching)a=b._touchStartX-b._touchCurrentX,c=b._touchStartY-b._touchCurrentY,b._touchSpeedX=a/10,b._touchSpeedY=c/10,b._touchStartX=b._touchCurrentX,b._touchStartY=b._touchCurrentY;else if(Math.abs(b._touchSpeedX)<
0.1&&Math.abs(b._touchSpeedY)<0.1){b._vScrollDiv.style.display="none";b._hScrollDiv.style.display="none";d.clearInterval(b._touchScrollTimer);b._touchScrollTimer=null;return}else a=b._touchSpeedX*10,c=b._touchSpeedY*10,b._touchSpeedX*=0.95,b._touchSpeedY*=0.95;b._scrollView(a,c)},10)}this._touchScrollTimer&&a.preventDefault()}},_handleTouchEnd:function(a){if(a.touches.length===0)this._touching=!1},_doAction:function(a){var c,b,d=this._keyModes;for(b=d.length-1;b>=0;b--)if(c=d[b],typeof c.match===
"function"&&(c=c.match(a),c!==void 0))return this.invokeAction(c);return!1},_doMove:function(a,c){var b=this._model,d=c.getCaret(),e=b.getLineAtOffset(d);if(!a.count)a.count=1;for(;a.count!==0;){var f=b.getLineStart(e);if(a.count<0&&d===f)if(e>0)a.unit==="character"&&a.count++,e--,c.extend(b.getLineEnd(e));else break;else if(a.count>0&&d===b.getLineEnd(e))if(e+1<b.getLineCount())a.unit==="character"&&a.count--,e++,c.extend(b.getLineStart(e));else break;else{var g=!1;a.expandTab&&a.unit==="character"&&
(d-f)%this._tabSize===0&&(g=!/[^ ]/.test(b.getText(f,d)));g?(c.extend(d-this._tabSize),a.count+=a.count<0?1:-1):(f=this._getLine(e),c.extend(f.getNextOffset(d,a)),f.destroy())}d=c.getCaret()}return c},_doBackspace:function(a){var c=this._getSelection();if(c.isEmpty()){if(!a.count)a.count=1;a.count*=-1;a.expandTab=this._expandTab;this._doMove(a,c)}this._modifyContent({text:"",start:c.start,end:c.end},!0);return!0},_doCase:function(a){var c=this._getSelection();this._doMove(a,c);var b=this.getText(c.start,
c.end);this._setSelection(c,!0);switch(a.type){case "lower":b=b.toLowerCase();break;case "capitalize":b=b.replace(/(?:^|\s)\S/g,function(a){return a.toUpperCase()});break;case "reverse":a="";for(c=0;c<b.length;c++){var d=b[c],e=d.toLowerCase(),d=e!==d?e:d.toUpperCase();a+=d}b=a;break;default:b=b.toUpperCase()}this._doContent(b);return!0},_doContent:function(a){var c=this._getSelection();if(this._overwriteMode&&c.isEmpty()){var b=this._model,d=b.getLineAtOffset(c.end);c.end<b.getLineEnd(d)&&(b=this._getLine(d),
c.extend(b.getNextOffset(c.getCaret(),{unit:"character",count:1})),b.destroy())}this._modifyContent({text:a,start:c.start,end:c.end,_ignoreDOMSelection:!0},!0)},_doCopy:function(a){var c=this._getSelection();return!c.isEmpty()?this._setClipboardText(this._getBaseText(c.start,c.end),a):!0},_doCursorNext:function(a){var c=this._getSelection();!c.isEmpty()&&!a.select?c.start=c.end:this._doMove(a,c);a.select||c.collapse();this._setSelection(c,!0);return!0},_doCursorPrevious:function(a){var c=this._getSelection();
if(!c.isEmpty()&&!a.select)c.end=c.start;else{if(!a.count)a.count=1;a.count*=-1;this._doMove(a,c)}a.select||c.collapse();this._setSelection(c,!0);return!0},_doCut:function(a){var c=this._getSelection();return!c.isEmpty()?(c=this._getBaseText(c.start,c.end),this._doContent(""),this._setClipboardText(c,a)):!0},_doDelete:function(a){var c=this._getSelection();c.isEmpty()&&this._doMove(a,c);this._modifyContent({text:"",start:c.start,end:c.end},!0);return!0},_doEnd:function(a){var c=this._getSelection(),
b=this._model,d;if(a.ctrl)c.extend(b.getCharCount()),d=function(){};else{var e=c.getCaret(),f=b.getLineAtOffset(e);if(this._wrapMode){var g=this._getLine(f),e=g.getLineIndex(e),e=e===g.getLineCount()-1?b.getLineEnd(f):g.getLineStart(e+1)-1;g.destroy()}else a.count&&a.count>0&&(f=Math.min(f+a.count-1,b.getLineCount()-1)),e=b.getLineEnd(f);c.extend(e)}a.select||c.collapse();this._setSelection(c,!0,!0,d);return!0},_doEnter:function(a){var c=this._model,b=this._getSelection();this._doContent(c.getLineDelimiter());
if(a&&a.noCursor)b.end=b.start,this._setSelection(b,!0);return!0},_doHome:function(a){var c=this._getSelection(),b=this._model,d;if(a.ctrl)c.extend(0),d=function(){};else{var e=c.getCaret(),f=b.getLineAtOffset(e);this._wrapMode?(b=this._getLine(f),e=b.getLineIndex(e),e=b.getLineStart(e),b.destroy()):e=b.getLineStart(f);c.extend(e)}a.select||c.collapse();this._setSelection(c,!0,!0,d);return!0},_doLineDown:function(a){var c=this._model,d=this._getSelection(),e=d.getCaret(),f=c.getLineAtOffset(e),g=
this._getLine(f),h=this._columnX,i=1,l=!1;if(h===-1||a.wholeLine||a.select&&b.isIE)h=a.wholeLine?c.getLineEnd(f+1):e,h=g.getBoundingClientRect(h).left;(e=g.getLineIndex(e))<g.getLineCount()-1?i=g.getClientRects(e+1).top+1:(e=c.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)d.extend(c.getCharCount()),e=!0}else g.lineIndex!==f&&(g.destroy(),g=this._getLine(f)),d.extend(g.getOffset(h,i)),e=!0;e&&(a.select||d.collapse(),this._setSelection(d,
!0,!0));this._columnX=h;g.destroy();return!0},_doLineUp:function(a){var c=this._model,d=this._getSelection(),e=d.getCaret(),f=c.getLineAtOffset(e),g=this._getLine(f),h=this._columnX,i=!1,l;if(h===-1||a.wholeLine||a.select&&b.isIE)h=a.wholeLine?c.getLineStart(f-1):e,h=g.getBoundingClientRect(h).left;(e=g.getLineIndex(e))>0?l=g.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)d.extend(0),e=!0}else g.lineIndex!==
f&&(g.destroy(),g=this._getLine(f)),d.extend(g.getOffset(h,l)),e=!0;e&&(a.select||d.collapse(),this._setSelection(d,!0,!0));this._columnX=h;g.destroy();return!0},_doNoop:function(){return!0},_doPageDown:function(a){var c=this,d=this._model,e=this._getSelection(),f=e.getCaret(),g=d.getLineAtOffset(f),h=d.getLineCount(),i=this._getScroll(),d=this._getClientHeight(),l,m;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+d);
m=this._getLine(f);g=this._getLinePixel(f);f=m.getOffset(l,i.top+d-g);d=m.getBoundingClientRect(f);m.destroy();e.extend(f);a.select||e.collapse();this._setSelection(e,!0,!0,function(){c._columnX=l},d.top+g-i.top);return!0}if(g<h-1){var j=this._getLineHeight(),o=Math.min(h-g-1,Math.floor(d/j)),o=Math.max(1,o);l=this._columnX;if(l===-1||a.select&&b.isIE)m=this._getLine(g),l=m.getBoundingClientRect(f).left,m.destroy();m=this._getLine(g+o);e.extend(m.getOffset(l,0));m.destroy();a.select||e.collapse();
a=h*j;f=i.y+o*j;f+d>a&&(f=a-d);this._setSelection(e,!0,!0,function(){c._columnX=l},f-i.y)}return!0},_doPageUp:function(a){var c=this,d=this._model,e=this._getSelection(),f=e.getCaret(),g=d.getLineAtOffset(f),h=this._getScroll(),i=this._getClientHeight(),l;if(this._lineHeight){l=this._columnX;h=this._getBoundsAtOffset(f);if(l===-1||a.select&&b.isIE)l=h.left;f=this._getLineIndex(h.bottom-i);d=this._getLine(f);g=this._getLinePixel(f);f=d.getOffset(l,h.bottom-i-g);i=d.getBoundingClientRect(f);d.destroy();
e.extend(f);a.select||e.collapse();this._setSelection(e,!0,!0,function(){c._columnX=l},i.top+g-h.top);return!0}if(g>0){var m=this._getLineHeight(),i=Math.max(1,Math.min(g,Math.floor(i/m)));l=this._columnX;if(l===-1||a.select&&b.isIE)d=this._getLine(g),l=d.getBoundingClientRect(f).left,d.destroy();d=this._getLine(g-i);e.extend(d.getOffset(l,this._getLineHeight(g-i)-1));d.destroy();a.select||e.collapse();a=Math.max(0,h.y-i*m);this._setSelection(e,!0,!0,function(){c._columnX=l},a-h.y)}return!0},_doPaste:function(a){var c=
this;return this._getClipboardText(a,function(a){a&&(b.isLinux&&c._lastMouseButton===2&&(new Date).getTime()-c._lastMouseTime<=c._clickTime&&c._setSelectionTo(c._lastMouseX,c._lastMouseY),c._doContent(a))})!==null},_doScroll:function(a){var c=a.type,b=this._model,d=b.getLineCount(),a=this._getClientHeight(),e=this._getLineHeight();d*=e;var f=this._getScroll().y,g;switch(c){case "textStart":g=0;break;case "textEnd":g=d-a;break;case "pageDown":g=f+a;break;case "pageUp":g=f-a;break;case "lineDown":g=
f+e;break;case "lineUp":g=f-e;break;case "centerLine":c=this._getSelection(),g=b.getLineAtOffset(c.start),b=(b.getLineAtOffset(c.end)-g+1)*e,g=g*e-a/2+b/2}g!==void 0&&(g=Math.min(Math.max(0,g),d-a),this._scrollViewAnimated(0,g-f,function(){}));return!0},_doSelectAll:function(){var a=this._model,c=this._getSelection();c.setCaret(0);c.extend(a.getCharCount());this._setSelection(c,!1);return!0},_doTab:function(){if(this._tabMode&&!this._readonly){var a="\t";if(this._expandTab)var c=this._model,a=this._getSelection().getCaret(),
b=c.getLineAtOffset(a),c=c.getLineStart(b),a=Array(this._tabSize-(a-c)%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,c=this._getSelection(),d=this.convert({x:this._autoScrollX,y:this._autoScrollY},"page","document"),e=c.getCaret(),f=a.getLineCount(),g=a.getLineAtOffset(e),h;if(this._autoScrollDir==="up"||this._autoScrollDir==="down")e=this._autoScrollY/this._getLineHeight(),e=e<0?Math.floor(e):Math.ceil(e),h=Math.max(0,Math.min(f-1,g+e));else if(this._autoScrollDir==="left"||this._autoScrollDir==="right")h=this._getLineIndex(d.y),g=this._getLine(g),d.x+=g.getBoundingClientRect(e,!1).left,g.destroy();
h===0&&(b.isMac||b.isLinux)?c.extend(0):h===f-1&&(b.isMac||b.isLinux)?c.extend(a.getCharCount()):(g=this._getLine(h),c.extend(g.getOffset(d.x,d.y-this._getLinePixel(h))),g.destroy());this._setSelection(c,!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 c=this._model.getLineCount(),b=0;if(a){for(var a=
0,d=(new Date).getTime(),e=0;b<c;)if(this._lineHeight[b]||(a++,e||(e=b),this._lineHeight[b]=this._calculateLineHeight(b)),b++,(new Date).getTime()-d>100)break;this.redrawRulers(0,c);this._queueUpdate()}a=this._getWindow();if(b!==c){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),
c=a.getBoundingClientRect();a.destroy();return Math.max(1,c.bottom-c.top)},_calculateMetrics:function(){var a=this._clientDiv,c=a.ownerDocument,d=b.createElement(c,"div");d.style.lineHeight="normal";var e={type:"LineStyle",textView:this,0:0,lineText:this._model.getLine(0),lineStart:0};this.onLineStyle(e);g(e.style,d);d.style.position="fixed";d.style.left="-1000px";var f=b.createElement(c,"span");f.appendChild(c.createTextNode(" "));d.appendChild(f);var h=b.createElement(c,"span");h.style.fontStyle=
"italic";h.appendChild(c.createTextNode(" "));d.appendChild(h);var i=b.createElement(c,"span");i.style.fontWeight="bold";i.appendChild(c.createTextNode(" "));d.appendChild(i);e=b.createElement(c,"span");e.style.fontWeight="bold";e.style.fontStyle="italic";e.appendChild(c.createTextNode(" "));d.appendChild(e);a.appendChild(d);var l=d.getBoundingClientRect(),f=f.getBoundingClientRect(),h=h.getBoundingClientRect(),i=i.getBoundingClientRect(),e=e.getBoundingClientRect(),f=f.bottom-f.top,h=h.bottom-h.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);h>f&&(k=1);i>h&&(k=2);j>i&&(k=3);var s;if(k!==0){s={style:{}};if((k&1)!==0)s.style.fontStyle="italic";if((k&2)!==0)s.style.fontWeight="bold"}f=o(d);a.removeChild(d);j=m(this._viewDiv);d=b.createElement(c,"div");d.style.position="fixed";d.style.left="-1000px";d.style.paddingLeft=j.left+"px";d.style.paddingTop=j.top+"px";d.style.paddingRight=j.right+"px";d.style.paddingBottom=j.bottom+"px";d.style.width="100px";d.style.height=
"100px";j=b.createElement(c,"div");j.style.width="100%";j.style.height="100%";d.appendChild(j);a.appendChild(d);k=d.getBoundingClientRect();h=j.getBoundingClientRect();i=0;if(!this._singleMode)d.style.overflow="hidden",j.style.height="200px",i=d.clientWidth,d.style.overflow="scroll",i-=d.clientWidth;a.removeChild(d);j={left:h.left-k.left,top:h.top-k.top,right:k.right-h.right,bottom:k.bottom-h.bottom};h=k=0;if(!e&&(this._wrapOffset||this._marginOffset))d=b.createElement(c,"div"),d.style.position="fixed",
d.style.left="-1000px",d.innerHTML=Array(this._wrapOffset+1).join(" "),a.appendChild(d),k=d.getBoundingClientRect(),k=Math.ceil(k.right-k.left),d.innerHTML=Array(this._marginOffset+1).join(" "),h=d.getBoundingClientRect(),h=Math.ceil(h.right-h.left),a.removeChild(d);return{lineHeight:l,largestFontStyle:s,lineTrim:f,viewPadding:j,scrollWidth:i,wrapWidth:k,marginWidth:h,invalid:e}},_cancelAnimation:function(){if(this._animation)this._animation.stop(),this._animation=null},_clearSelection:function(a){var c=
this._getSelection();if(c.isEmpty())return!1;a==="next"?c.start=c.end:c.end=c.start;this._setSelection(c,!0);return!0},_commitIME:function(){if(this._imeOffset!==-1){this._scrollDiv.focus();this._clientDiv.focus();var a=this._model,c=a.getLineAtOffset(this._imeOffset),b=a.getLineStart(c),d=this._getDOMText(this._getLineNode(c)).text,a=a.getLine(c),b=this._imeOffset-b,a=b+d.length-a.length;b!==a&&this._doContent(d.substring(b,a));this._imeOffset=-1}},_createActions:function(){this.addKeyMode(new j.DefaultKeyMode(this));
var a=this;this._actions={noop:{defaultHandler:function(){return a._doNoop()}},lineUp:{defaultHandler:function(b){return a._doLineUp(c(b,{select:!1}))},actionDescription:{name:h.lineUp}},lineDown:{defaultHandler:function(b){return a._doLineDown(c(b,{select:!1}))},actionDescription:{name:h.lineDown}},lineStart:{defaultHandler:function(b){return a._doHome(c(b,{select:!1,ctrl:!1}))},actionDescription:{name:h.lineStart}},lineEnd:{defaultHandler:function(b){return a._doEnd(c(b,{select:!1,ctrl:!1}))},actionDescription:{name:h.lineEnd}},
charPrevious:{defaultHandler:function(b){return a._doCursorPrevious(c(b,{select:!1,unit:"character"}))},actionDescription:{name:h.charPrevious}},charNext:{defaultHandler:function(b){return a._doCursorNext(c(b,{select:!1,unit:"character"}))},actionDescription:{name:h.charNext}},pageUp:{defaultHandler:function(b){return a._doPageUp(c(b,{select:!1}))},actionDescription:{name:h.pageUp}},pageDown:{defaultHandler:function(b){return a._doPageDown(c(b,{select:!1}))},actionDescription:{name:h.pageDown}},scrollPageUp:{defaultHandler:function(b){return a._doScroll(c(b,
{type:"pageUp"}))},actionDescription:{name:h.scrollPageUp}},scrollPageDown:{defaultHandler:function(b){return a._doScroll(c(b,{type:"pageDown"}))},actionDescription:{name:h.scrollPageDown}},scrollLineUp:{defaultHandler:function(b){return a._doScroll(c(b,{type:"lineUp"}))},actionDescription:{name:h.scrollLineUp}},scrollLineDown:{defaultHandler:function(b){return a._doScroll(c(b,{type:"lineDown"}))},actionDescription:{name:h.scrollLineDown}},wordPrevious:{defaultHandler:function(b){return a._doCursorPrevious(c(b,
{select:!1,unit:"word"}))},actionDescription:{name:h.wordPrevious}},wordNext:{defaultHandler:function(b){return a._doCursorNext(c(b,{select:!1,unit:"word"}))},actionDescription:{name:h.wordNext}},textStart:{defaultHandler:function(b){return a._doHome(c(b,{select:!1,ctrl:!0}))},actionDescription:{name:h.textStart}},textEnd:{defaultHandler:function(b){return a._doEnd(c(b,{select:!1,ctrl:!0}))},actionDescription:{name:h.textEnd}},scrollTextStart:{defaultHandler:function(b){return a._doScroll(c(b,{type:"textStart"}))},
actionDescription:{name:h.scrollTextStart}},scrollTextEnd:{defaultHandler:function(b){return a._doScroll(c(b,{type:"textEnd"}))},actionDescription:{name:h.scrollTextEnd}},centerLine:{defaultHandler:function(b){return a._doScroll(c(b,{type:"centerLine"}))},actionDescription:{name:h.centerLine}},selectLineUp:{defaultHandler:function(b){return a._doLineUp(c(b,{select:!0}))},actionDescription:{name:h.selectLineUp}},selectLineDown:{defaultHandler:function(b){return a._doLineDown(c(b,{select:!0}))},actionDescription:{name:h.selectLineDown}},
selectWholeLineUp:{defaultHandler:function(b){return a._doLineUp(c(b,{select:!0,wholeLine:!0}))},actionDescription:{name:h.selectWholeLineUp}},selectWholeLineDown:{defaultHandler:function(b){return a._doLineDown(c(b,{select:!0,wholeLine:!0}))},actionDescription:{name:h.selectWholeLineDown}},selectLineStart:{defaultHandler:function(b){return a._doHome(c(b,{select:!0,ctrl:!1}))},actionDescription:{name:h.selectLineStart}},selectLineEnd:{defaultHandler:function(b){return a._doEnd(c(b,{select:!0,ctrl:!1}))},
actionDescription:{name:h.selectLineEnd}},selectCharPrevious:{defaultHandler:function(b){return a._doCursorPrevious(c(b,{select:!0,unit:"character"}))},actionDescription:{name:h.selectCharPrevious}},selectCharNext:{defaultHandler:function(b){return a._doCursorNext(c(b,{select:!0,unit:"character"}))},actionDescription:{name:h.selectCharNext}},selectPageUp:{defaultHandler:function(b){return a._doPageUp(c(b,{select:!0}))},actionDescription:{name:h.selectPageUp}},selectPageDown:{defaultHandler:function(b){return a._doPageDown(c(b,
{select:!0}))},actionDescription:{name:h.selectPageDown}},selectWordPrevious:{defaultHandler:function(b){return a._doCursorPrevious(c(b,{select:!0,unit:"word"}))},actionDescription:{name:h.selectWordPrevious}},selectWordNext:{defaultHandler:function(b){return a._doCursorNext(c(b,{select:!0,unit:"word"}))},actionDescription:{name:h.selectWordNext}},selectTextStart:{defaultHandler:function(b){return a._doHome(c(b,{select:!0,ctrl:!0}))},actionDescription:{name:h.selectTextStart}},selectTextEnd:{defaultHandler:function(b){return a._doEnd(c(b,
{select:!0,ctrl:!0}))},actionDescription:{name:h.selectTextEnd}},deletePrevious:{defaultHandler:function(b){return a._doBackspace(c(b,{unit:"character"}))},actionDescription:{name:h.deletePrevious}},deleteNext:{defaultHandler:function(b){return a._doDelete(c(b,{unit:"character"}))},actionDescription:{name:h.deleteNext}},deleteWordPrevious:{defaultHandler:function(b){return a._doBackspace(c(b,{unit:"word"}))},actionDescription:{name:h.deleteWordPrevious}},deleteWordNext:{defaultHandler:function(b){return a._doDelete(c(b,
{unit:"word"}))},actionDescription:{name:h.deleteWordNext}},deleteLineStart:{defaultHandler:function(b){return a._doBackspace(c(b,{unit:"line"}))},actionDescription:{name:h.deleteLineStart}},deleteLineEnd:{defaultHandler:function(b){return a._doDelete(c(b,{unit:"line"}))},actionDescription:{name:h.deleteLineEnd}},tab:{defaultHandler:function(){return a._doTab()},actionDescription:{name:h.tab}},shiftTab:{defaultHandler:function(){return a._doShiftTab()},actionDescription:{name:h.shiftTab}},enter:{defaultHandler:function(){return a._doEnter()},
actionDescription:{name:h.enter}},enterNoCursor:{defaultHandler:function(b){return a._doEnter(c(b,{noCursor:!0}))},actionDescription:{name:h.enterNoCursor}},selectAll:{defaultHandler:function(){return a._doSelectAll()},actionDescription:{name:h.selectAll}},copy:{defaultHandler:function(){return a._doCopy()},actionDescription:{name:h.copy}},cut:{defaultHandler:function(){return a._doCut()},actionDescription:{name:h.cut}},paste:{defaultHandler:function(){return a._doPaste()},actionDescription:{name:h.paste}},
uppercase:{defaultHandler:function(b){return a._doCase(c(b,{type:"upper"}))},actionDescription:{name:h.uppercase}},lowercase:{defaultHandler:function(b){return a._doCase(c(b,{type:"lower"}))},actionDescription:{name:h.lowercase}},capitalize:{defaultHandler:function(b){return a._doCase(c(b,{unit:"word",type:"capitalize"}))},actionDescription:{name:h.capitalize}},reversecase:{defaultHandler:function(b){return a._doCase(c(b,{type:"reverse"}))},actionDescription:{name:h.reversecase}},toggleOverwriteMode:{defaultHandler:function(){return a._doOverwriteMode()},
actionDescription:{name:h.toggleOverwriteMode}},toggleTabMode:{defaultHandler:function(){return a._doTabMode()},actionDescription:{name:h.toggleTabMode}},toggleWrapMode:{defaultHandler:function(){return a._doWrapMode()},actionDescription:{name:h.toggleWrapMode}}}},_createRulerParent:function(a){var c=b.createElement(document,"div");c.className=a;c.tabIndex=-1;c.style.overflow="hidden";c.style.MozUserSelect="none";c.style.WebkitUserSelect="none";c.style.position="absolute";c.style.top="0px";c.style.bottom=
"0px";c.style.cursor="default";c.style.display="none";c.setAttribute("aria-hidden","true");this._rootDiv.appendChild(c);return c},_createRuler:function(a,c){if(this._clientDiv){var d=this._getRulerParent(a);if(d){if(d!==this._marginDiv||this._marginOffset)d.style.display="block";var e=b.createElement(d.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(c===void 0||c<0||c>=d.children.length)d.appendChild(e);
else{for(var f=d.firstChild;f&&c-- >0;)f=f.nextSibling;d.insertBefore(e,f)}}}},_createView:function(){if(!this._clientDiv){for(var a=this._parent;a.hasChildNodes();)a.removeChild(a.lastChild);var c=a.ownerDocument,d=b.createElement(c,"div");this._rootDiv=d;d.tabIndex=-1;d.style.position="relative";d.style.overflow="hidden";d.style.width="100%";d.style.height="100%";d.style.overflow="hidden";d.style.WebkitTextSizeAdjust="100%";d.setAttribute("role","application");a.appendChild(d);this._leftDiv=this._createRulerParent("textviewLeftRuler");
a=b.createElement(c,"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";d.appendChild(a);var e=this._createRulerParent("textviewRightRuler");this._rightDiv=e;e.style.right="0px";this._scrollDiv=e=b.createElement(c,"div");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(c,"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",d.appendChild(a),this._clipScrollDiv=e=b.createElement(c,"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(c,"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||d).appendChild(a);if(b.isIOS||b.isAndroid)this._vScrollDiv=
e=b.createElement(c,"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",d.appendChild(e),this._hScrollDiv=e=b.createElement(c,"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",d.appendChild(e);if(b.isFirefox&&!a.setCapture)this._overlayDiv=c=b.createElement(c,"div"),c.style.position=a.style.position,c.style.borderWidth=a.style.borderWidth,c.style.margin=a.style.margin,c.style.padding=a.style.padding,c.style.cursor="text",c.style.zIndex="2",(this._clipDiv||
d).appendChild(c);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();d=this._rulers;for(c=0;c<d.length;c++)this._createRuler(d[c]);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:d.TextTheme.getTheme(),update:this._setTheme},themeClass:{value:void 0,update:this._setThemeClass}}},_destroyRuler:function(a){var c=this._getRulerParent(a);if(c)for(var b=c.firstChild;b;){if(b._ruler===a){b._ruler=void 0;c.removeChild(b);if(c.children.length===0&&(c!==this._marginDiv||!this._marginOffset))c.style.display="none";break}b=b.nextSibling}},_destroyView:function(){if(this._clientDiv){this._setGrab(null);
this._unhookEvents();var a=this._getWindow();if(this._autoScrollTimerID)a.clearTimeout(this._autoScrollTimerID),this._autoScrollTimerID=null;if(this._updateTimer)a.clearTimeout(this._updateTimer),this._updateTimer=null;a=this._rootDiv;a.parentNode.removeChild(a);this._hScrollDiv=this._vScrollDiv=this._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,c,b){this._autoScrollDir=a;this._autoScrollX=c;this._autoScrollY=b;this._autoScrollTimerID||this._autoScrollTimer()},_endAutoScroll:function(){this._autoScrollTimerID&&this._getWindow().clearTimeout(this._autoScrollTimerID);this._autoScrollTimerID=this._autoScrollDir=void 0},_fixCaret:function(){var a=this._clientDiv;if(a){var c=this._hasFocus;this._ignoreFocus=!0;c&&a.blur();a.contentEditable=!1;a.contentEditable=!0;c&&a.focus();this._ignoreFocus=
!1}},_getBaseText:function(a,c){var b=this._model;b.getBaseModel&&(a=b.mapOffset(a),c=b.mapOffset(c),b=b.getBaseModel());return b.getText(a,c)},_getBottomIndex:function(a){var c=this._bottomChild;if(a&&this._getClientHeight()>this._getLineHeight()){var a=c.getBoundingClientRect(),b=this._clientDiv.getBoundingClientRect();a.bottom>b.bottom&&(c=this._getLinePrevious(c)||c)}return c.lineIndex},_getBoundsAtOffset:function(a){var c=this._getLine(this._model.getLineAtOffset(a)),a=c.getBoundingClientRect(a),
b=this._getLinePixel(c.lineIndex);a.top+=b;a.bottom+=b;c.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,c){var d=this._model.getLineDelimiter(),e,f,g=this._getWindow(),h=g.clipboardData;if(!h&&a)h=a.clipboardData;if(h)return e=[],f=h.getData(b.isIE?"Text":"text/plain"),
l(f,function(a){e.push(a)},function(){e.push(d)}),f=e.join(""),c&&c(f),f;if(b.isFirefox){this._ignoreFocus=!0;var i=this._clipboardDiv,h=this._rootDiv.ownerDocument;if(!i)this._clipboardDiv=i=b.createElement(h,"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 m=this,j=function(){var a=m._getTextFromElement(i);i.innerHTML="";e=[];l(a,function(a){e.push(a)},function(){e.push(d)});
return e.join("")},o=!1;this._ignorePaste=!0;if(!b.isLinux||this._lastMouseButton!==2)try{o=h.execCommand("paste",!1,null)}catch(k){o=i.childNodes.length>1||i.firstChild&&i.firstChild.childNodes.length>0}this._ignorePaste=!1;if(!o)return a?(g.setTimeout(function(){m.focus();(f=j())&&c&&c(f);m._ignoreFocus=!1},0),null):(this.focus(),this._ignoreFocus=!1,"");this.focus();this._ignoreFocus=!1;(f=j())&&c&&c(f);return f}return""},_getDOMText:function(a,c){for(var b=a.firstChild,d="",e=0;b;){var f;if(!b.ignore)if(b.ignoreChars){f=
b.lastChild;for(var g=0,h=[],i=-1;f;){var l=f.data;if(l)for(var m=l.length-1;m>=0;m--){var j=l.substring(m,m+1);g<b.ignoreChars&&(j===" "||j==="\u200b"||j==="\ufeff")?g++:h.push(j==="\u00a0"?"\t":j)}if(c===f)i=h.length;f=f.previousSibling}h=h.reverse().join("");i!==-1&&(e=d.length+h.length-i);d+=h}else for(f=b.firstChild;f;){if(c===f)e=d.length;d+=f.data;f=f.nextSibling}b=b.nextSibling}return{text:d,offset:e}},_getTextFromElement:function(a){var c=a.ownerDocument,b=c.defaultView;if(!b.getSelection)return a.innerText||
a.textContent;c=c.createRange();c.selectNode(a);var a=b.getSelection(),b=[],d;for(d=0;d<a.rangeCount;d++)b.push(a.getRangeAt(d));this._ignoreSelect=!0;a.removeAllRanges();a.addRange(c);c=a.toString();a.removeAllRanges();for(d=0;d<b.length;d++)a.addRange(b[d]);this._ignoreSelect=!1;return c},_getViewPadding:function(){return this._metrics.viewPadding},_getLine:function(a){var c=this._getLineNode(a);return c&&!c.lineChanged&&!c.lineRemoved?c._line:new u(this,a)},_getLineHeight:function(a,c){if(a!==
void 0&&this._lineHeight){var b=this._lineHeight[a];if(b)return b;if(c||c===void 0)return this._lineHeight[a]=this._calculateLineHeight(a)}return this._metrics.lineHeight},_getLineNode:function(a){for(var c=this._clientDiv.firstChild;c;){if(a===c.lineIndex)return c;c=c.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 c=this._getTopIndex(),b=-this._topIndexY+this._getScroll().y;if(a>c)for(;c<a;c++)b+=this._getLineHeight(c);else for(c-=1;c>=a;c--)b-=this._getLineHeight(c);return b}return this._getLineHeight()*a},_getLineIndex:function(a){var c,b=0,d=this._model.getLineCount();if(this._lineHeight){var b=this._getTopIndex(),e=-this._topIndexY+this._getScroll().y;if(a!==e)if(a<e)for(;a<
e&&b>0;)a+=this._getLineHeight(--b);else for(c=this._getLineHeight(b);a-c>=e&&b<d-1;)a-=c,c=this._getLineHeight(++b)}else c=this._getLineHeight(),b=Math.floor(a/c);return Math.max(0,Math.min(d-1,b))},_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 c=this._topChild;if(a&&this._getClientHeight()>this._getLineHeight()){var a=c.getBoundingClientRect(),b=this._getViewPadding(),d=this._viewDiv.getBoundingClientRect();a.top<d.top+b.top&&(c=this._getLineNext(c)||c)}return c.lineIndex},_hookEvents:function(){var a=this;this._modelListener={onChanging:function(c){a._onModelChanging(c)},onChanged:function(c){a._onModelChanged(c)}};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 c=this._handlers=[],d=this._clientDiv,e=this._viewDiv,f=this._rootDiv,g=this._overlayDiv||d,h=d.ownerDocument,i=this._getWindow(),l=b.isIE?h:i;c.push({target:i,type:"resize",handler:function(c){return a._handleResize(c?c:i.event)}});c.push({target:d,type:"blur",handler:function(c){return a._handleBlur(c?c:i.event)}});
c.push({target:d,type:"focus",handler:function(c){return a._handleFocus(c?c:i.event)}});c.push({target:e,type:"focus",handler:function(){d.focus()}});c.push({target:e,type:"scroll",handler:function(c){return a._handleScroll(c?c:i.event)}});c.push({target:d,type:"textInput",handler:function(c){return a._handleTextInput(c?c:i.event)}});c.push({target:d,type:"keydown",handler:function(c){return a._handleKeyDown(c?c:i.event)}});c.push({target:d,type:"keypress",handler:function(c){return a._handleKeyPress(c?
c:i.event)}});c.push({target:d,type:"keyup",handler:function(c){return a._handleKeyUp(c?c:i.event)}});b.isIE&&c.push({target:h,type:"keyup",handler:function(c){return a._handleDocKeyUp(c?c:i.event)}});c.push({target:d,type:"contextmenu",handler:function(c){return a._handleContextMenu(c?c:i.event)}});c.push({target:d,type:"copy",handler:function(c){return a._handleCopy(c?c:i.event)}});c.push({target:d,type:"cut",handler:function(c){return a._handleCut(c?c:i.event)}});c.push({target:d,type:"paste",
handler:function(c){return a._handlePaste(c?c:i.event)}});if(b.isIOS||b.isAndroid)c.push({target:h,type:"selectionchange",handler:function(c){return a._handleSelectionChange(c?c:i.event)}}),c.push({target:d,type:"touchstart",handler:function(c){return a._handleTouchStart(c?c:i.event)}}),c.push({target:d,type:"touchmove",handler:function(c){return a._handleTouchMove(c?c:i.event)}}),c.push({target:d,type:"touchend",handler:function(c){return a._handleTouchEnd(c?c:i.event)}});else{c.push({target:d,type:"selectstart",
handler:function(c){return a._handleSelectStart(c?c:i.event)}});c.push({target:d,type:"mousedown",handler:function(c){return a._handleMouseDown(c?c:i.event)}});c.push({target:d,type:"mouseover",handler:function(c){return a._handleMouseOver(c?c:i.event)}});c.push({target:d,type:"mouseout",handler:function(c){return a._handleMouseOut(c?c:i.event)}});c.push({target:l,type:"mouseup",handler:function(c){return a._handleMouseUp(c?c:i.event)}});c.push({target:l,type:"mousemove",handler:function(c){return a._handleMouseMove(c?
c:i.event)}});c.push({target:f,type:"mousedown",handler:function(c){return a._handleRootMouseDown(c?c:i.event)}});c.push({target:f,type:"mouseup",handler:function(c){return a._handleRootMouseUp(c?c:i.event)}});c.push({target:g,type:"dragstart",handler:function(c){return a._handleDragStart(c?c:i.event)}});c.push({target:g,type:"drag",handler:function(c){return a._handleDrag(c?c:i.event)}});c.push({target:g,type:"dragend",handler:function(c){return a._handleDragEnd(c?c:i.event)}});c.push({target:g,
type:"dragenter",handler:function(c){return a._handleDragEnter(c?c:i.event)}});c.push({target:g,type:"dragover",handler:function(c){return a._handleDragOver(c?c:i.event)}});c.push({target:g,type:"dragleave",handler:function(c){return a._handleDragLeave(c?c:i.event)}});c.push({target:g,type:"drop",handler:function(c){return a._handleDrop(c?c:i.event)}});c.push({target:this._clientDiv,type:b.isFirefox>26?"wheel":b.isFirefox?"DOMMouseScroll":"mousewheel",handler:function(c){return a._handleMouseWheel(c?
c:i.event)}});this._clipDiv&&c.push({target:this._clipDiv,type:b.isFirefox>26?"wheel":b.isFirefox?"DOMMouseScroll":"mousewheel",handler:function(c){return a._handleMouseWheel(c?c:i.event)}});if(b.isFirefox&&(!b.isWindows||b.isFirefox>=15))(e=i.MutationObserver||i.MozMutationObserver)?(this._mutationObserver=new e(function(c){a._handleDataModified(c)}),this._mutationObserver.observe(d,{subtree:!0,characterData:!0})):c.push({target:this._clientDiv,type:"DOMCharacterDataModified",handler:function(c){return a._handleDataModified(c?
c:i.event)}});this._overlayDiv&&(c.push({target:this._overlayDiv,type:"mousedown",handler:function(c){return a._handleMouseDown(c?c:i.event)}}),c.push({target:this._overlayDiv,type:"mouseover",handler:function(c){return a._handleMouseOver(c?c:i.event)}}),c.push({target:this._overlayDiv,type:"mouseout",handler:function(c){return a._handleMouseOut(c?c:i.event)}}),c.push({target:this._overlayDiv,type:"contextmenu",handler:function(c){return a._handleContextMenu(c?c:i.event)}}));this._isW3CEvents||c.push({target:this._clientDiv,
type:"dblclick",handler:function(c){return a._handleDblclick(c?c:i.event)}})}this._hookRulerEvents(this._leftDiv,c);this._hookRulerEvents(this._rightDiv,c);this._hookRulerEvents(this._marginDiv,c);for(e=0;e<c.length;e++)f=c[e],t(f.target,f.type,f.handler,f.capture)},_hookRulerEvents:function(a,c){if(a){var d=this,e=this._getWindow();b.isIE&&c.push({target:a,type:"selectstart",handler:function(){return!1}});c.push({target:a,type:b.isFirefox>26?"wheel":b.isFirefox?"DOMMouseScroll":"mousewheel",handler:function(a){return d._handleMouseWheel(a?
a:e.event)}});c.push({target:a,type:"click",handler:function(a){d._handleRulerEvent(a?a:e.event)}});c.push({target:a,type:"dblclick",handler:function(a){d._handleRulerEvent(a?a:e.event)}});c.push({target:a,type:"mousemove",handler:function(a){d._handleRulerEvent(a?a:e.event)}});c.push({target:a,type:"mouseover",handler:function(a){d._handleRulerEvent(a?a:e.event)}});c.push({target:a,type:"mouseout",handler:function(a){d._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 c=a.parent;typeof c==="string"&&(c=(a.document||document).getElementById(c));if(!c)throw"no parent";a.parent=c;a.model=a.model||new k.TextModel;var d=this._defaultOptions(),e;for(e in d)d.hasOwnProperty(e)&&(this["_"+e]=a[e]!==void 0?a[e]:d[e].value);this._keyModes=[];this._rulers=[];this._selection=new s(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 c.ownerDocument.createRange().getBoundingClientRect==="function";this._isW3CEvents=c.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,c){if(!this._readonly||a._code)if(a.type="Verify",this.onVerify(a),!(a.text===null||a.text===void 0)){var b=this._model;try{if(a._ignoreDOMSelection)this._ignoreDOMSelection=!0;b.setText(a.text,a.start,a.end)}finally{if(a._ignoreDOMSelection)this._ignoreDOMSelection=!1}c&&(b=
this._getSelection(),b.setCaret(a.start+a.text.length),this._setSelection(b,!0));this.onModify({type:"Modify"})}},_onModelChanged:function(a){a.type="ModelChanged";this.onModelChanged(a);a.type="Changed";var c=a.start,b=a.addedCharCount,d=a.removedCharCount,e=a.addedLineCount,f=a.removedLineCount,g=this._getSelection();g.end>c&&(g.end>c&&g.start<c+d?g.setCaret(c+b):(g.start+=b-d,g.end+=b-d),this._setSelection(g,!1,!1));c=this._model.getLineAtOffset(c);for(b=this._getLineNext();b;){d=b.lineIndex;if(c<=
d&&d<=c+f)c===d&&!b.modelChangedEvent&&!b.lineRemoved?(b.modelChangedEvent=a,b.lineChanged=!0):(b.lineRemoved=!0,b.lineChanged=!1,b.modelChangedEvent=null);if(d>c+f)b.lineIndex=d+e-f,b._line.lineIndex=b.lineIndex;b=this._getLineNext(b)}this._lineHeight&&(a=[c,f].concat(Array(e)),Array.prototype.splice.apply(this._lineHeight,a));if(!this._wrapMode&&c<=this._maxLineIndex&&this._maxLineIndex<=c+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,c){if(this._wrapMode||this._variableLineHeight){if(a!==void 0&&c!==void 0)for(var b=a;b<c;b++)this._lineHeight[b]=void 0;else this._lineHeight=Array(this._model.getLineCount());this._calculateLineHeightTimer()}else this._lineHeight=null},
_resetLineWidth:function(){var a=this._clientDiv;if(a)for(a=a.firstChild;a;)a.lineWidth=void 0,a=a.nextSibling},_reset:function(){this._maxLineIndex=-1;this._maxLineWidth=0;this._columnX=-1;this._bottomChild=this._topChild=null;this._topIndexY=0;this._variableLineHeight=!1;this._resetLineHeight();this._setSelection(new s(0,0,!1),!1,!1);if(this._viewDiv)this._viewDiv.scrollLeft=0,this._viewDiv.scrollTop=0;var a=this._clientDiv;if(a){for(var c=a.firstChild;c;)c.lineRemoved=!0,c=c.nextSibling;if(b.isFirefox)this._ignoreFocus=
!1,(c=this._hasFocus)&&a.blur(),a.contentEditable=!1,a.contentEditable=!0,c&&a.focus(),this._ignoreFocus=!1}},_scrollViewAnimated:function(a,c,b){var d=this._getWindow();if(b&&this._scrollAnimation){var e=this;this._animation=new w({window:d,duration:this._scrollAnimation,curve:[c,0],onAnimate:function(a){a=c-Math.floor(a);e._scrollView(0,a);c-=a},onEnd:function(){e._animation=null;e._scrollView(a,c);b&&d.setTimeout(b,0)}});this._animation.play()}else this._scrollView(a,c),b&&d.setTimeout(b,0)},_scrollView:function(a,
c){this._ensureCaretVisible=!1;var b=this._viewDiv;a&&(b.scrollLeft+=a);c&&(b.scrollTop+=c)},_setClipboardText:function(a,c){var d,e=this._getWindow(),f=e.clipboardData;if(!f&&c)f=c.clipboardData;if(f&&(d=[],l(a,function(a){d.push(a)},function(){d.push(b.platformDelimiter)}),f.setData(b.isIE?"Text":"text/plain",d.join(""))))return!0;var g=this._parent.ownerDocument,i=b.createElement(g,"pre");i.style.position="fixed";i.style.left="-1000px";l(a,function(a){i.appendChild(g.createTextNode(a))},function(){i.appendChild(b.createElement(g,
"br"))});i.appendChild(g.createTextNode(" "));this._clientDiv.appendChild(i);f=g.createRange();f.setStart(i.firstChild,0);f.setEndBefore(i.lastChild);var h=e.getSelection();h.rangeCount>0&&h.removeAllRanges();h.addRange(f);var m=this,f=function(){i&&i.parentNode===m._clientDiv&&m._clientDiv.removeChild(i);m._updateDOMSelection()},h=!1;this._ignoreCopy=!0;try{h=g.execCommand("copy",!1,null)}catch(j){}this._ignoreCopy=!1;if(!h&&c)return e.setTimeout(f,0),!1;f();return!0},_setDOMSelection:function(a,
c,d,e,f){for(var g,i,h,l,m=0,j=a.firstChild,o,k,s=this._model.getLine(a.lineIndex).length;j;){if(!j.ignore){o=j.firstChild;k=o.length;j.ignoreChars&&(k-=j.ignoreChars);if(m+k>c||m+k>=s){g=o;i=c-m;j.ignoreChars&&k>0&&i===k&&(i+=j.ignoreChars);break}m+=k}j=j.nextSibling}for(var m=0,j=d.firstChild,q=this._model.getLine(d.lineIndex).length;j;){if(!j.ignore){o=j.firstChild;k=o.length;j.ignoreChars&&(k-=j.ignoreChars);if(k+m>e||m+k>=q){h=o;l=e-m;j.ignoreChars&&k>0&&l===k&&(l+=j.ignoreChars);break}m+=k}j=
j.nextSibling}this._setDOMFullSelection(a,c,s,d,e,q);a=this._getWindow();c=this._parent.ownerDocument;if(a.getSelection){d=a.getSelection();a=c.createRange();a.setStart(g,i);a.setEnd(h,l);if(this._hasFocus&&(d.anchorNode!==g||d.anchorOffset!==i||d.focusNode!==h||d.focusOffset!==l||d.anchorNode!==h||d.anchorOffset!==l||d.focusNode!==g||d.focusOffset!==i))this._anchorNode=g,this._anchorOffset=i,this._focusNode=h,this._focusOffset=l,this._ignoreSelect=!1,d.rangeCount>0&&d.removeAllRanges(),d.addRange(a),
this._ignoreSelect=!0;if(this._cursorDiv&&(a=c.createRange(),f?(a.setStart(g,i),a.setEnd(g,i)):(a.setStart(h,l),a.setEnd(h,l)),h=a.getClientRects()[0],l=this._cursorDiv.parentNode,g=l.getBoundingClientRect(),h&&g))this._cursorDiv.style.top=h.top-g.top+l.scrollTop+"px",this._cursorDiv.style.left=h.left-g.left+l.scrollLeft+"px"}else if(c.selection&&this._hasFocus)f=c.body,a=b.createElement(c,"div"),f.appendChild(a),f.removeChild(a),a=f.createTextRange(),a.moveToElementText(g.parentNode),a.moveStart("character",
i),g=f.createTextRange(),g.moveToElementText(h.parentNode),g.moveStart("character",l),a.setEndPoint("EndToStart",g),this._ignoreSelect=!1,a.select(),this._ignoreSelect=!0},_setDOMFullSelection:function(a,c,b,d,e){if(this._selDiv1&&(b=this._selDiv1,b.style.width="0px",b.style.height="0px",b=this._selDiv2,b.style.width="0px",b.style.height="0px",b=this._selDiv3,b.style.width="0px",b.style.height="0px",!(a===d&&c===e))){var f=this._model,g=this._getViewPadding(),i=this._clientDiv.getBoundingClientRect(),
h=this._viewDiv.getBoundingClientRect(),b=h.left+g.left,l=i.right,g=h.top+g.top,m=i.bottom,h=i=0;this._clipDiv?(h=this._clipDiv.getBoundingClientRect(),i=h.left-this._clipDiv.scrollLeft):(h=this._rootDiv.getBoundingClientRect(),i=h.left);h=h.top;this._ignoreDOMSelection=!0;var j=(new u(this,a.lineIndex,a)).getBoundingClientRect(f.getLineStart(a.lineIndex)+c,!1),o=j.left,c=(new u(this,d.lineIndex,d)).getBoundingClientRect(f.getLineStart(d.lineIndex)+e,!1),f=c.left;this._ignoreDOMSelection=!1;var k=
this._selDiv1,o=Math.min(l,Math.max(b,o)),s=Math.min(m,Math.max(g,j.top)),q=l,e=Math.min(m,Math.max(g,j.bottom));k.style.left=o-i+"px";k.style.top=s-h+"px";k.style.width=Math.max(0,q-o)+"px";k.style.height=Math.max(0,e-s)+"px";if(a.lineIndex===d.lineIndex)q=Math.min(f,l),k.style.width=Math.max(0,q-o)+"px";else if(j=Math.min(m,Math.max(g,c.top)),f=Math.min(l,Math.max(b,f)),g=Math.min(m,Math.max(g,c.bottom)),m=this._selDiv3,m.style.left=b-i+"px",m.style.top=j-h+"px",m.style.width=Math.max(0,f-b)+"px",
m.style.height=Math.max(0,g-j)+"px",Math.abs(a.lineIndex-d.lineIndex)>1)a=this._selDiv2,a.style.left=b-i+"px",a.style.top=e-h+"px",a.style.width=Math.max(0,l-b)+"px",a.style.height=Math.max(0,j-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 c=this._clientDiv;c.contentEditable=!a;this._hadFocus&&!a&&c.focus();if(this._overlayDiv)this._overlayDiv.style.zIndex=a?"-1":"1";for(a=this._getLineNext();a;){if(a.hasLink)for(c=a.firstChild;c;)if(c.ignore)c=c.nextSibling;else{var d=c.nextSibling,e=c.viewStyle;e&&e.tagName&&e.tagName.toLowerCase()==="a"&&a.replaceChild(a._line._createSpan(a,c.firstChild.data,e),c);c=d}a=this._getLineNext(a)}this._updateDOMSelection()}},_setSelection:function(a,c,b,d,e){if(a){this._columnX=-1;b===
void 0&&(b=!0);var f=this._selection;this._selection=a;c!==!1&&this._showCaret(!1,d,c,e);b&&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,c,b,d){var e=this._model,f=this._getSelection(),c=this.convert({x:a,y:c},"page","document"),a=this._getLineIndex(c.y);if(this._clickCount===1){e=this._getLine(a);a=e.getOffset(c.x,c.y-this._getLinePixel(a));e.destroy();if(d&&!b&&f.start<=
a&&a<f.end)return this._dragOffset=a,!1;f.extend(a);b||f.collapse()}else(this._clickCount&1)===0?(e=this._getLine(a),a=e.getOffset(c.x,c.y-this._getLinePixel(a)),this._doubleClickSelection?a>=this._doubleClickSelection.start?(b=this._doubleClickSelection.start,d=e.getNextOffset(a,{unit:"wordend",count:1})):(b=e.getNextOffset(a,{unit:"word",count:-1}),d=this._doubleClickSelection.end):(b=e.getNextOffset(a,{unit:"word",count:-1}),d=e.getNextOffset(b,{unit:"wordend",count:1})),e.destroy()):this._doubleClickSelection?
(d=e.getLineAtOffset(this._doubleClickSelection.start),a>=d?(b=e.getLineStart(d),d=e.getLineEnd(a)):(b=e.getLineStart(a),d=e.getLineEnd(d))):(b=e.getLineStart(a),d=e.getLineEnd(a)),f.setCaret(b),f.extend(d);this._setSelection(f,!0,!0);return!0},_setFullSelection:function(a,c){this._fullSelection=a;if(b.isWebkit)this._fullSelection=!0;var d=this._clipDiv||this._rootDiv;if(d)if(this._fullSelection){if(!this._selDiv1&&this._fullSelection&&!b.isIOS){var e=d.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";d.appendChild(f);var g=b.createElement(e,"div");this._selDiv2=g;g.style.position="absolute";g.style.borderWidth="0px";g.style.margin="0px";g.style.padding="0px";g.style.outline="none";g.style.background=this._highlightRGB;
g.style.width="0px";g.style.height="0px";g.style.zIndex="0";d.appendChild(g);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";d.appendChild(e);if(b.isFirefox&&b.isMac){d=this._getWindow().getComputedStyle(e,null).getPropertyValue("background-color");switch(d){case "rgb(119, 141, 168)":d="rgb(199, 208, 218)";
break;case "rgb(127, 127, 127)":d="rgb(198, 198, 198)";break;case "rgb(255, 193, 31)":d="rgb(250, 236, 115)";break;case "rgb(243, 70, 72)":d="rgb(255, 176, 139)";break;case "rgb(255, 138, 34)":d="rgb(255, 209, 129)";break;case "rgb(102, 197, 71)":d="rgb(194, 249, 144)";break;case "rgb(140, 78, 184)":d="rgb(232, 184, 255)";break;default:d="rgb(180, 213, 255)"}this._highlightRGB=d;f.style.background=d;g.style.background=d;e.style.background=d}c||this._updateDOMSelection()}}else{if(this._selDiv1)d.removeChild(this._selDiv1),
this._selDiv1=null;if(this._selDiv2)d.removeChild(this._selDiv2),this._selDiv2=null;if(this._selDiv3)d.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,c){this._marginOffset=a;this._marginDiv.style.display=a?"block":"none";if(!c)this._metrics=this._calculateMetrics(),this._queueUpdate()},_setWrapOffset:function(a,
c){this._wrapOffset=a;if(!c)this._metrics=this._calculateMetrics(),this._queueUpdate()},_setReadOnly:function(a){this._readonly=a;this._clientDiv.setAttribute("aria-readonly",a?"true":"false")},_setSingleMode:function(a,c){this._singleMode=a;this._updateOverflow();this._updateStyle(c)},_setTabSize:function(a,c){this._tabSize=a;this._customTabSize=void 0;var d=this._clientDiv;if(b.isOpera){if(d)d.style.OTabSize=this._tabSize+""}else if(b.isWebkit>=537.1){if(d)d.style.tabSize=this._tabSize+""}else if(b.isFirefox>=
4){if(d)d.style.MozTabSize=this._tabSize+""}else if(this._tabSize!==8)this._customTabSize=this._tabSize;c||(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,c){this._themeClass=a;var b="textview",d=this._theme.getThemeClass();d&&(b+=" "+
d);this._themeClass&&d!==this._themeClass&&(b+=" "+this._themeClass);this._rootDiv.className=b;this._updateStyle(c)},_setWrapMode:function(a,c){this._wrapMode=a&&this._wrappable;var b=this._clientDiv;this._wrapMode?(b.style.whiteSpace="pre-wrap",b.style.wordWrap="break-word"):(b.style.whiteSpace="pre",b.style.wordWrap="normal");this._updateOverflow();c||(this.redraw(),this._resetLineWidth());this._resetLineHeight()},_showCaret:function(a,c,b,d){if(this._clientDiv){var e=this._model,f=this._getSelection(),
g=this._getScroll(),i=f.getCaret(),h=f.start,l=f.end,m=e.getLineAtOffset(l),j=Math.max(Math.max(h,e.getLineStart(m)),l-1),e=this._getClientWidth(),m=this._getClientHeight(),o=e/4,k=this._getBoundsAtOffset(i===h?h:j),s=k.left,q=k.right,p=k.top,u=k.bottom;a&&!f.isEmpty()&&(k=this._getBoundsAtOffset(i===l?h:j),k.top===p?i===h?q=s+Math.min(k.right-s,e):s=q-Math.min(q-k.left,e):i===h?u=p+Math.min(k.bottom-p,m):p=u-Math.min(u-k.top,m));a=0;s<g.x&&(a=Math.min(s-g.x,-o));q>g.x+e&&(a=Math.max(q-g.x-e,o));
f=0;p<g.y?f=p-g.y:u>g.y+m&&(f=u-g.y-m);d&&(d>0?f>0&&(f=Math.max(f,d)):f<0&&(f=Math.min(f,d)));if(a!==0||f!==0)return f!==0&&typeof b==="number"&&(b<0&&(b=0),b>1&&(b=1),f+=Math.floor(f>0?b*m:-b*m)),this._scrollViewAnimated(a,f,c),m!==this._getClientHeight()||e!==this._getClientWidth()?this._showCaret():this._ensureCaretVisible=!0,!0;else c&&c();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 c=this._handlers[a];q(c.target,c.type,c.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(),c=this._model,b=c.getLineAtOffset(a.start),d=c.getLineAtOffset(a.end),e=this._getLineNext();if(e){var f=this._getLinePrevious(),g;b<e.lineIndex?(g=e,b=0):b>f.lineIndex?(g=f,b=0):(g=this._getLineNode(b),b=a.start-c.getLineStart(b));d<e.lineIndex?c=0:d>f.lineIndex?(e=f,c=0):(e=this._getLineNode(d),c=a.end-c.getLineStart(d));this._setDOMSelection(g,b,e,c,a.caret)}}},
_update:function(a){if(!(this._redrawCount>0)){if(this._updateTimer)this._getWindow().clearTimeout(this._updateTimer),this._updateTimer=null,a=!1;var c=this._clientDiv,d=this._viewDiv;if(c){if(this._metrics.invalid)this._ignoreQueueUpdate=!0,this._updateStyle(),this._ignoreQueueUpdate=!1;var e=this._model,f=this._getScroll(!1),g=this._getViewPadding(),i=e.getLineCount(),h=this._getLineHeight(),l=!1,m=!1,j=!1,o=this._metrics.scrollWidth;if(this._wrapMode)c.style.width=(this._metrics.wrapWidth||this._getClientWidth())+
"px";var k,s,q,p,w=0,v=0,t;if(this._lineHeight){for(;v<i;){t=this._getLineHeight(v);if(w+t>f.y)break;w+=t;v++}k=v;s=Math.max(0,k-1);q=e=f.y-w;k>0&&(e+=this._getLineHeight(k-1))}else p=Math.max(0,f.y)/h,k=Math.floor(p),s=Math.max(0,k-1),e=Math.round((p-s)*h),q=Math.round((p-k)*h);this._topIndexY=q;p=this._rootDiv;var O=p.clientWidth,J=p.clientHeight;if(a){h=0;this._leftDiv&&(k=this._leftDiv.getBoundingClientRect(),h=k.right-k.left);k=this._getClientWidth();p=this._getClientHeight();m=k;if(this._wrapMode){if(this._metrics.wrapWidth)m=
this._metrics.wrapWidth}else m=Math.max(this._maxLineWidth,m);for(;v<i;)t=this._getLineHeight(v,!1),w+=t,v++;i=w}else{p=this._getClientHeight();q=Math.min(k+Math.floor((p+q)/h),i-1);var f=Math.min(q+1,i-1),H;for(t=c.firstChild;t;){H=t.lineIndex;var C=t.nextSibling;if(!(s<=H&&H<=f)||t.lineRemoved||t.lineIndex===-1)this._mouseWheelLine===t?(t.style.display="none",t.lineIndex=-1):c.removeChild(t);t=C}t=this._getLineNext();var C=d.ownerDocument,L=C.createDocumentFragment();for(H=s;H<=f;H++)if(!t||t.lineIndex>
H)(new u(this,H)).create(L,null);else{L.firstChild&&(c.insertBefore(L,t),L=C.createDocumentFragment());if(t&&t.lineChanged)t=(new u(this,H)).create(L,t),t.lineChanged=!1;t=this._getLineNext(t)}L.firstChild&&c.insertBefore(L,t);if(b.isWebkit&&!this._wrapMode)c.style.width="0x7fffffffpx";t=this._getLineNext();H=p+e;for(L=!1;t;){s=t.lineWidth;if(s===void 0)if(C=t._line.getBoundingClientRect(),s=t.lineWidth=Math.ceil(C.right-C.left),C=C.bottom-C.top,this._lineHeight)this._lineHeight[t.lineIndex]=C;else if(h!==
0&&C!==0&&Math.ceil(h)!==Math.ceil(C))this._variableLineHeight=!0,this._lineHeight=[],this._lineHeight[t.lineIndex]=C;if(this._lineHeight&&!L&&(H-=this._lineHeight[t.lineIndex],H<0))q=t.lineIndex,L=!0;if(!this._wrapMode){if(s>=this._maxLineWidth)this._maxLineWidth=s,this._maxLineIndex=t.lineIndex;if(this._checkMaxLineIndex===t.lineIndex)this._checkMaxLineIndex=-1}if(t.lineIndex===k)this._topChild=t;if(t.lineIndex===q)this._bottomChild=t;t=this._getLineNext(t)}if(this._checkMaxLineIndex!==-1&&(H=this._checkMaxLineIndex,
this._checkMaxLineIndex=-1,0<=H&&H<i)){h=new u(this,H);C=h.getBoundingClientRect();s=C.right-C.left;if(s>=this._maxLineWidth)this._maxLineWidth=s,this._maxLineIndex=H;h.destroy()}for(;v<i;)t=this._getLineHeight(v,v<=q),w+=t,v++;i=w;this._updateRuler(this._leftDiv,k,f,J);this._updateRuler(this._rightDiv,k,f,J);this._updateRuler(this._marginDiv,k,f,J);h=0;this._leftDiv&&(k=this._leftDiv.getBoundingClientRect(),h=k.right-k.left);f=0;this._rightDiv&&(f=this._rightDiv.getBoundingClientRect(),f=f.right-
f.left);d.style.left=h+"px";d.style.right=f+"px";f=this._scrollDiv;f.style.height=i+"px";k=this._getClientWidth();if(!this._singleMode&&!this._wrapMode){w=l=p;(v=d.style.overflowX==="scroll")?l+=o:w-=o;t=q=k;(s=d.style.overflowY==="scroll")?q+=o:t-=o;p=l;k=q;i>p&&(j=!0,k=t);this._maxLineWidth>k&&(m=!0,p=w,i>p&&(j=!0,k=t));if(v!==m)d.style.overflowX=m?"scroll":"hidden";if(s!==j)d.style.overflowY=j?"scroll":"hidden";l=v!==m||s!==j}j=k;if(this._wrapMode){if(this._metrics.wrapWidth)j=this._metrics.wrapWidth}else j=
Math.max(this._maxLineWidth,j);m=j;if((!b.isIE||b.isIE>=9)&&this._maxLineWidth>k)j+=g.right+g.left;f.style.width=j+"px";if(this._clipScrollDiv)this._clipScrollDiv.style.width=j+"px";f=this._getScroll(!1)}if(this._vScrollDiv)j=p-8,w=Math.max(15,Math.ceil(Math.min(1,j/(i+g.top+g.bottom))*j)),this._vScrollDiv.style.left=h+k-8+"px",this._vScrollDiv.style.top=Math.floor(Math.max(0,f.y*j/i))+"px",this._vScrollDiv.style.height=w+"px";if(!this._wrapMode&&this._hScrollDiv)j=k-8,w=Math.max(15,Math.ceil(Math.min(1,
j/(this._maxLineWidth+g.left+g.right))*j)),this._hScrollDiv.style.left=h+Math.floor(Math.max(0,Math.floor(f.x*j/this._maxLineWidth)))+"px",this._hScrollDiv.style.top=p-9+"px",this._hScrollDiv.style.width=w+"px";v=f.x;w=this._clipDiv;j=this._overlayDiv;if(q=this._marginDiv)q.style.left=-v+h+this._metrics.marginWidth+g.left+"px",q.style.bottom=(d.style.overflowX==="scroll"?o:0)+"px";if(w){w.scrollLeft=v;w.scrollTop=0;d=h+g.left;o=g.top;a=k;h=p;v=0;q=-e;if(f.x===0)d-=g.left,a+=g.left,v=g.left;f.x+k===
m&&(a+=g.right);f.y===0&&(o-=g.top,h+=g.top,q+=g.top);f.y+p===i&&(h+=g.bottom);w.style.left=d+"px";w.style.top=o+"px";w.style.right=O-a-d+"px";w.style.bottom=J-h-o+"px";c.style.left=v+"px";c.style.top=q+"px";c.style.width=m+"px";c.style.height=p+e+"px";if(j)j.style.left=c.style.left,j.style.top=c.style.top,j.style.width=c.style.width,j.style.height=c.style.height}else{d=v;o=e;O=v+k;J=e+p;d===0&&(d-=g.left);o===0&&(o-=g.top);O===m&&(O+=g.right);f.y+p===i&&(J+=g.bottom);c.style.clip="rect("+o+"px,"+
O+"px,"+J+"px,"+d+"px)";c.style.left=-v+h+g.left+"px";c.style.width=(this._wrapMode||b.isWebkit?m:k+v)+"px";if(!a)c.style.top=-e+g.top+"px",c.style.height=p+e+"px";if(j&&(j.style.clip=c.style.clip,j.style.left=c.style.left,j.style.width=c.style.width,!a))j.style.top=c.style.top,j.style.height=c.style.height}this._updateDOMSelection();if(l)c=this._ensureCaretVisible,this._ensureCaretVisible=!1,c&&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,c,d,e){if(a)for(var f=this._parent.ownerDocument,h=this._getLineHeight(),i=this._getViewPadding(),a=a.firstChild;a;){var l=a._ruler,m=h,j=l.getOverview();j==="page"&&(m+=this._topIndexY);a.style.top=-m+"px";a.style.height=e+m+"px";a.rulerChanged&&g(l.getRulerStyle(),a);var o,k=a.firstChild;k?(o=k,k=k.nextSibling):(o=b.createElement(f,"div"),o.style.visibility="hidden",a.appendChild(o));var s;
if(a.rulerChanged&&o){m=-1;if(s=l.getWidestAnnotation())if(g(s.style,o),s.html)o.innerHTML=s.html;o.lineIndex=m;o.style.height=h+i.top+"px"}var q;if(j==="page"){for(l=l.getAnnotations(c,d+1);k;)m=k.lineIndex,s=k.nextSibling,(!(c<=m&&m<=d)||k.lineChanged)&&a.removeChild(k),k=s;k=a.firstChild.nextSibling;q=f.createDocumentFragment();for(m=c;m<=d;m++)if(!k||k.lineIndex>m){o=b.createElement(f,"div");if(s=l[m]){g(s.style,o);if(s.html)o.innerHTML=s.html;o.annotation=s}o.lineIndex=m;o.style.height=this._getLineHeight(m)+
"px";q.appendChild(o)}else if(q.firstChild&&(a.insertBefore(q,k),q=f.createDocumentFragment()),k)k=k.nextSibling;q.firstChild&&a.insertBefore(q,k)}else{s=this._getClientHeight();m=this._model.getLineCount();k=s+i.top+i.bottom-2*this._metrics.scrollWidth;j=h*m<k?h:k/m;if(a.rulerChanged){for(s=a.childNodes.length;s>1;)a.removeChild(a.lastChild),s--;l=l.getAnnotations(0,m);q=f.createDocumentFragment();for(var p in l)if(m=p>>>0,!(m<0)){o=b.createElement(f,"div");s=l[p];g(s.style,o);o.style.position="absolute";
o.style.top=this._metrics.scrollWidth+h+Math.floor(m*j)+"px";if(s.html)o.innerHTML=s.html;o.annotation=s;o.lineIndex=m;q.appendChild(o)}a.appendChild(q)}else if(a._oldTrackHeight!==k)for(o=a.firstChild?a.firstChild.nextSibling:null;o;)o.style.top=this._metrics.scrollWidth+h+Math.floor(o.lineIndex*j)+"px",o=o.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 c=document.getElementById("_textviewStyle");if(c)c.removeChild(c.firstChild),c.appendChild(document.createTextNode(a));else{c=b.createElement(document,"style");c.id="_textviewStyle";var d=document.getElementsByTagName("head")[0]||document.documentElement;c.appendChild(document.createTextNode(a));d.insertBefore(c,d.firstChild)}}},_updateStyle:function(a){if(!a&&
b.isIE)this._rootDiv.style.lineHeight="normal";var c=this._metrics=this._calculateMetrics();this._rootDiv.style.lineHeight=b.isIE?c.lineHeight-(c.lineTrim.top+c.lineTrim.bottom)+"px":"normal";this._updateStyleSheet();a||(this.redraw(),this._resetLineWidth())}};f.EventTarget.addMixin(v.prototype);return{TextView:v}});
define("orion/editor/projectionTextModel",["orion/editor/textModel","orion/editor/eventTarget"],function(h,k){function j(f){this._model=f;this._projections=[];var d=this;this._listener={onChanged:function(f){d._onChanged(f)},onChanging:function(f){d._onChanging(f)}};f.addEventListener("postChanged",this._listener.onChanged);f.addEventListener("preChanging",this._listener.onChanging)}j.prototype={destroy:function(){if(this._model)this._model.removeEventListener("postChanged",this._listener.onChanged),
this._model.removeEventListener("preChanging",this._listener.onChanging),this._model=null},addProjection:function(f){if(f){var d=this._model,i=this._projections;f._lineIndex=d.getLineAtOffset(f.start);f._lineCount=d.getLineAtOffset(f.end)-f._lineIndex;var b=f.text;b||(b="");f._model=typeof b==="string"?new h.TextModel(b,d.getLineDelimiter()):b;var d=this.mapOffset(f.start,!0),b=f.end-f.start,g=f._lineCount,e=f._model.getCharCount(),c=f._model.getLineCount()-1;this.onChanging({type:"Changing",text:f._model.getText(),
start:d,removedCharCount:b,addedCharCount:e,removedLineCount:g,addedLineCount:c});var a=this._binarySearch(i,f.start);i.splice(a,0,f);this.onChanged({type:"Changed",start:d,removedCharCount:b,addedCharCount:e,removedLineCount:g,addedLineCount:c})}},getProjections:function(){return this._projections.slice(0)},getBaseModel:function(){return this._model},mapOffset:function(f,d){var h=this._projections,b=0,g,e;if(d){for(g=0;g<h.length;g++){e=h[g];if(e.start>f)break;if(e.end>f)return-1;b+=e._model.getCharCount()-
(e.end-e.start)}return f+b}for(g=0;g<h.length;g++){e=h[g];if(e.start>f-b)break;var c=e._model.getCharCount();if(e.start+c>f-b)return-1;b+=c-(e.end-e.start)}return f-b},removeProjection:function(f){var d,h=0;for(d=0;d<this._projections.length;d++){var b=this._projections[d];if(b===f){f=b;break}h+=b._model.getCharCount()-(b.end-b.start)}if(d<this._projections.length){var b=this._model,h=f.start+h,g=f.end-f.start,e=f._lineCount,c=f._model.getCharCount(),a=f._model.getLineCount()-1;this.onChanging({type:"Changing",
text:b.getText(f.start,f.end),start:h,removedCharCount:c,addedCharCount:g,removedLineCount:a,addedLineCount:e});this._projections.splice(d,1);this.onChanged({type:"Changed",start:h,removedCharCount:c,addedCharCount:g,removedLineCount:a,addedLineCount:e})}},_binarySearch:function(f,d){for(var h=f.length,b=-1,g;h-b>1;)g=Math.floor((h+b)/2),d<=f[g].start?h=g:b=g;return h},getCharCount:function(){for(var f=this._model.getCharCount(),d=this._projections,h=0;h<d.length;h++){var b=d[h];f+=b._model.getCharCount()-
(b.end-b.start)}return f},getLine:function(f,d){if(f<0)return null;var h=this._model,b=this._projections,g=0,e=[],c=0,a,l,m;for(a=0;a<b.length;a++){m=b[a];if(m._lineIndex>=f-g)break;l=m._model.getLineCount()-1;if(m._lineIndex+l>=f-g)if(c=f-(m._lineIndex+g),c<l)return m._model.getLine(c,d);else e.push(m._model.getLine(l));c=m.end;g+=l-m._lineCount}for(c=Math.max(c,h.getLineStart(f-g));a<b.length;a++){m=b[a];if(m._lineIndex>f-g)break;e.push(h.getText(c,m.start));l=m._model.getLineCount()-1;if(m._lineIndex+
l>f-g)return e.push(m._model.getLine(0,d)),e.join("");e.push(m._model.getText());c=m.end;g+=l-m._lineCount}b=h.getLineEnd(f-g,d);c<b&&e.push(h.getText(c,b));return e.join("")},getLineAtOffset:function(f){for(var d=this._model,h=this._projections,b=0,g=0,e=0;e<h.length;e++){var c=h[e];if(c.start>f-b)break;var a=c._model.getCharCount();if(c.start+a>f-b){h=f-(c.start+b);g+=c._model.getLineAtOffset(h);b+=h;break}g+=c._model.getLineCount()-1-c._lineCount;b+=a-(c.end-c.start)}return d.getLineAtOffset(f-
b)+g},getLineCount:function(){for(var f=this._projections,d=this._model.getLineCount(),h=0;h<f.length;h++){var b=f[h];d+=b._model.getLineCount()-1-b._lineCount}return d},getLineDelimiter:function(){return this._model.getLineDelimiter()},getLineEnd:function(f,d){if(f<0)return-1;for(var h=this._model,b=this._projections,g=0,e=0,c=0;c<b.length;c++){var a=b[c];if(a._lineIndex>f-g)break;var l=a._model.getLineCount()-1;if(a._lineIndex+l>f-g)return a._model.getLineEnd(f-(a._lineIndex+g),d)+a.start+e;e+=
a._model.getCharCount()-(a.end-a.start);g+=l-a._lineCount}return h.getLineEnd(f-g,d)+e},getLineStart:function(f){if(f<0)return-1;for(var d=this._model,h=this._projections,b=0,g=0,e=0;e<h.length;e++){var c=h[e];if(c._lineIndex>=f-b)break;var a=c._model.getLineCount()-1;if(c._lineIndex+a>=f-b)return c._model.getLineStart(f-(c._lineIndex+b))+c.start+g;g+=c._model.getCharCount()-(c.end-c.start);b+=a-c._lineCount}return d.getLineStart(f-b)+g},getText:function(f,d){f===void 0&&(f=0);var h=this._model,b=
this._projections,g=0,e=[],c,a,l;for(c=0;c<b.length;c++){a=b[c];if(a.start>f-g)break;l=a._model.getCharCount();if(a.start+l>f-g)if(d!==void 0&&a.start+l>d-g)return a._model.getText(f-(a.start+g),d-(a.start+g));else e.push(a._model.getText(f-(a.start+g))),f=a.end+g+l-(a.end-a.start);g+=l-(a.end-a.start)}var m=f-g;if(d!==void 0){for(;c<b.length;c++){a=b[c];if(a.start>d-g)break;e.push(h.getText(m,a.start));l=a._model.getCharCount();if(a.start+l>d-g)return e.push(a._model.getText(0,d-(a.start+g))),e.join("");
e.push(a._model.getText());m=a.end;g+=l-(a.end-a.start)}e.push(h.getText(m,d-g))}else{for(;c<b.length;c++)a=b[c],e.push(h.getText(m,a.start)),e.push(a._model.getText()),m=a.end;e.push(h.getText(m))}return e.join("")},_onChanged:function(){var f=this._change,d=f.baseStart,h=f.baseEnd,b,g,e=this._projections;for(b=0;b<e.length;b++)if(g=e[b],g.end>d)break;var c=b;for(b=0;b<e.length;b++)if(g=e[b],g.start>=h)break;var a=b,l=this._model,d=f.baseText.length-(h-d);for(b=a;b<e.length;b++)g=e[b],g.start+=d,
g.end+=d,g._lineIndex=l.getLineAtOffset(g.start);g=e.splice(c,a-c);for(b=0;b<g.length;b++)g[b].annotation&&g[b].annotation._expand();this.onChanged({type:"Changed",start:f.start,removedCharCount:f.removedCharCount,addedCharCount:f.addedCharCount,removedLineCount:f.removedLineCount,addedLineCount:f.addedLineCount});this._change=void 0},_onChanging:function(f){var d=!!this._change,h=this._change||{},b=f.start,g=b+f.removedCharCount;h.baseStart=b;h.baseEnd=g;h.baseText=f.text;h.addedLineCount=f.addedLineCount;
if(!d){this._change=h;h.text=f.text;var e=this._projections,c,a,l,f=function(b){for(a=0,c=0;a<e.length;a++){l=e[a];if(l.start>b)break;if(l.end>b)return-1;c+=l._model.getCharCount()-(l.end-l.start)}return b+c};h.start=f(b);if(h.start===-1)h.text=this._model.getText(l.start,b)+h.text,h.addedLineCount+=this._model.getLineAtOffset(b)-this._model.getLineAtOffset(l.start),h.start=l.start+c;h.end=f(g);if(h.end===-1)h.text+=this._model.getText(g,l.end),h.addedLineCount+=this._model.getLineAtOffset(l.end)-
this._model.getLineAtOffset(g),h.end=l.start+c}h.addedCharCount=h.text.length;h.removedCharCount=h.end-h.start;h.removedLineCount=this.getLineAtOffset(h.end)-this.getLineAtOffset(h.start);this.onChanging({type:"Changing",text:h.text,start:h.start,removedCharCount:h.removedCharCount,addedCharCount:h.addedCharCount,removedLineCount:h.removedLineCount,addedLineCount:h.addedLineCount})},onChanging:function(f){return this.dispatchEvent(f)},onChanged:function(f){return this.dispatchEvent(f)},setLineDelimiter:function(f){this._model.setLineDelimiter(f)},
setText:function(f,d,h){function b(b){for(c=0,e=0;c<g.length;c++){a=g[c];if(a.start>b-e)break;var d=a._model.getCharCount();if(a.start+d>b-e)return-1;e+=d-(a.end-a.start)}return b-e}this._change={text:f||"",start:d||0,end:h===void 0?this.getCharCount():h};var g=this._projections,e,c,a,l,m,f=b(this._change.start);if(f===-1)l={projection:a,start:this._change.start-(a.start+e)},f=a.end;d=b(this._change.end);if(d===-1)m={projection:a,end:this._change.end-(a.start+e)},d=a.start;if(l&&m&&l.projection===
m.projection)a._model.setText(this._change.text,l.start,m.end);else{this._model.setText(this._change.text,f,d);if(l)a=l.projection,a._model.setText("",l.start);if(m)a=m.projection,a._model.setText("",0,m.end),a.start=a.end,a._lineCount=0}this._change=void 0}};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(h,k,j,f,d,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(d){if(!d._tooltip)d._tooltip=new b(d);return d._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 c=this._tooltipContents=i.createElement(b,"div");e.appendChild(c);b.body.appendChild(e);var a=this;d.addEventListener(e,"mouseover",function(){if(a._hideDelay){var c=a._getWindow();if(a._delayedHideTimeout)c.clearTimeout(a._delayedHideTimeout),a._delayedHideTimeout=null;if(a._hideTimeout)c.clearTimeout(a._hideTimeout),a._hideTimeout=
null;a._nextTarget=null}},!1);d.addEventListener(e,"mouseout",function(c){c=c.relatedTarget||c.toElement;c===e||a._hasFocus()||(!c||!d.contains(e,c))&&a._hide()},!1);d.addEventListener(e,"keydown",function(c){c.keyCode===27&&a._hide()},!1);d.addEventListener(b,"mousedown",this._mouseDownHandler=function(c){a.isVisible()&&(d.contains(e,c.target||c.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);d.removeEventListener(this._tooltipDiv.ownerDocument,"mousedown",this._mouseDownHandler,!0);this._tooltipDiv=null}},_hasFocus:function(){var b=this._tooltipDiv;return!b?!1:d.contains(b,b.ownerDocument.activeElement)},hide:function(b){if(b===void 0)b=this._hideDelay;var d=this._getWindow();if(this._delayedHideTimeout)d.clearTimeout(this._delayedHideTimeout),
this._delayedHideTimeout=null;var c=this;b?c._delayedHideTimeout=d.setTimeout(function(){c._delayedHideTimeout=null;c._hide();c.setTarget(c._nextTarget,0)},b):(c._hide(),c.setTarget(c._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,d,c){if(this.isVisible()){if(!this._hasFocus())this._nextTarget=b,this.hide(c)}else if(this._target=b){var a=
this,b=a._getWindow();if(a._showTimeout)b.clearTimeout(a._showTimeout),a._showTimeout=null;d===0?a.show(!0):a._showTimeout=b.setTimeout(function(){a._showTimeout=null;a.show(!0)},d?d:a._showDelay)}},show:function(b){if(this._target){var d=this._target.getTooltipInfo();if(d){var c=this._tooltipDiv,a=this._tooltipContents;c.style.left=c.style.right=c.style.width=c.style.height=a.style.width=a.style.height="auto";var h=d.contents;h instanceof Array&&(h=this._getAnnotationContents(h));if(typeof h==="string")a.innerHTML=
h;else if(this._isNode(h))a.appendChild(h);else if(h instanceof f.ProjectionTextModel){var i=this._view,j=i.getOptions();j.wrapMode=!1;j.parent=a;var s=j.themeClass;s?((s=s.replace("tooltipTheme",""))&&(s=" "+s),s="tooltipTheme"+s):s="tooltipTheme";j.themeClass=s;j=this._contentsView=new k.TextView(j);j.addEventListener("LineStyle",function(a){i.onLineStyle(a)});j.setModel(h);h=j.computeSize();a.style.width=h.width+"px";a.style.height=h.height+"px";j.resize()}else return;a=c.ownerDocument.documentElement;
d.anchor==="right"?(h=a.clientWidth-d.x,c.style.right=h+"px"):(h=parseInt(this._getNodeStyle(c,"padding-left","0"),10),h+=parseInt(this._getNodeStyle(c,"border-left-width","0"),10),h=d.x-h,c.style.left=h+"px");c.style.maxWidth=a.clientWidth-h-10+"px";h=parseInt(this._getNodeStyle(c,"padding-top","0"),10);h+=parseInt(this._getNodeStyle(c,"border-top-width","0"),10);h=d.y-h;c.style.top=h+"px";c.style.maxHeight=a.clientHeight-h-10+"px";c.style.opacity="1";c.style.visibility="visible";if(b){var p=this,
u=this._getWindow();p._hideTimeout=u.setTimeout(function(){p._hideTimeout=null;var a=parseFloat(p._getNodeStyle(c,"opacity","1"));p._fadeTimeout=u.setInterval(function(){c.style.visibility==="visible"&&a>0?(a-=0.1,c.style.opacity=a):p._hide()},p._fadeDelay/10)},p._autoHideDelay)}}}},_getAnnotationContents:function(b){function e(a,c){var b=v.getLineStart(v.getLineAtOffset(a)),d=v.getLineEnd(v.getLineAtOffset(c),!0);return v.getText(b,d)}function c(a){var c=a.title,b=i.createElement(k,"div");b.className=
"tooltipRow";if(a.html)b.innerHTML=a.html,b.lastChild&&d.addEventListener(b.lastChild,"click",function(){var c=a.start,b=a.end;u.getBaseModel&&(c=u.mapOffset(c,!0),b=u.mapOffset(b,!0));p.setSelection(c,b,1/3,function(){j._hide()})},!1),b.appendChild(k.createTextNode("\u00a0"));c||(c=e(a.start,a.end));typeof c==="function"&&(c=a.title());if(typeof c==="string"){var f=i.createElement(k,"span");f.appendChild(k.createTextNode(c));c=f}b.appendChild(c);return b}for(var a,l=[],m=0;m<b.length;m++)a=b[m],
a.title!==""&&!a.groupAnnotation&&l.push(a);b=l;if(b.length===0)return null;var j=this,k=this._tooltipDiv.ownerDocument,p=this._view,u=p.getModel(),v=u.getBaseModel?u.getBaseModel():u;if(b.length===1)if(a=b[0],a.title!==void 0){a=c(a);if(a.firstChild)(b=a.firstChild.className)&&(b+=" "),b+="single",a.firstChild.className=b;return a}else return b=new f.ProjectionTextModel(v),l=v.getLineStart(v.getLineAtOffset(a.start)),m=v.getCharCount(),a.end!==m&&b.addProjection({start:a.end,end:m}),l>0&&b.addProjection({start:0,
end:l}),b;else{l=i.createElement(k,"div");a=i.createElement(k,"em");a.appendChild(k.createTextNode(h.multipleAnnotations));l.appendChild(a);for(m=0;m<b.length;m++)a=b[m],(a=c(a))&&l.appendChild(a);return l}},_getNodeStyle:function(b,d,c){var a;if(b&&(a=b.style[d],!a))if(b.currentStyle){for(a=0;(a=d.indexOf("-",a))!==-1;)d=d.substring(0,a)+d.substring(a+1,a+2).toUpperCase()+d.substring(a+2);a=b.currentStyle[d]}else a=(b=b.ownerDocument.defaultView.getComputedStyle(b,null))?b.getPropertyValue(d):null;
return a||c},_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(h,k){function j(c,a,b){this.start=c;this.end=a;this._projectionModel=b;this.html=this._expandedHTML;this.style=this._expandedStyle;this.expanded=!0}function f(){}function d(c,a){var b=c.lastIndexOf("."),b=c.substring(b+1),d={title:h[b],style:{styleClass:"annotation "+b},html:"<div class='annotationHTML "+b+"'></div>",overviewStyle:{styleClass:"annotationOverview "+b}};a?d.lineStyle={styleClass:"annotationLine "+
b}:d.rangeStyle={styleClass:"annotationRange "+b};f.registerType(c,d)}function i(){}function b(c){this._annotations=[];var a=this;this._listener={onChanged:function(c){a._onChanged(c)}};this.setTextModel(c)}function g(c,a){this._view=c;this._annotationModel=a;var b=this;this._listener={onDestroy:function(a){b._onDestroy(a)},onLineStyle:function(a){b._onLineStyle(a)},onChanged:function(a){b._onAnnotationModelChanged(a)}};c.addEventListener("Destroy",this._listener.onDestroy);c.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)return!1;this.expanded=!1;this.html=this._collapsedHTML;this.style=this._collapsedStyle;this._annotationModel&&this._annotationModel.modifyAnnotation(this);
return!0},_expand:function(){if(this.expanded)return!1;this.expanded=!0;this.html=this._expandedHTML;this.style=this._expandedStyle;this._annotationModel&&this._annotationModel.modifyAnnotation(this);return!0},collapse:function(){if(this._collapse()){var c=this._projectionModel,a=c.getBaseModel();this._projection={annotation:this,start:a.getLineStart(a.getLineAtOffset(this.start)+1),end:a.getLineEnd(a.getLineAtOffset(this.end),!0)};c.addProjection(this._projection)}},expand:function(){this._expand()&&
this._projectionModel.removeProjection(this._projection)}};f.ANNOTATION_ERROR="orion.annotation.error";f.ANNOTATION_WARNING="orion.annotation.warning";f.ANNOTATION_TASK="orion.annotation.task";f.ANNOTATION_BREAKPOINT="orion.annotation.breakpoint";f.ANNOTATION_BOOKMARK="orion.annotation.bookmark";f.ANNOTATION_FOLDING="orion.annotation.folding";f.ANNOTATION_CURRENT_BRACKET="orion.annotation.currentBracket";f.ANNOTATION_MATCHING_BRACKET="orion.annotation.matchingBracket";f.ANNOTATION_CURRENT_LINE="orion.annotation.currentLine";
f.ANNOTATION_CURRENT_SEARCH="orion.annotation.currentSearch";f.ANNOTATION_MATCHING_SEARCH="orion.annotation.matchingSearch";f.ANNOTATION_READ_OCCURRENCE="orion.annotation.readOccurrence";f.ANNOTATION_WRITE_OCCURRENCE="orion.annotation.writeOccurrence";f.ANNOTATION_SELECTED_LINKED_GROUP="orion.annotation.selectedLinkedGroup";f.ANNOTATION_CURRENT_LINKED_GROUP="orion.annotation.currentLinkedGroup";f.ANNOTATION_LINKED_GROUP="orion.annotation.linkedGroup";f.ANNOTATION_BLAME="orion.annotation.blame";f.ANNOTATION_CURRENT_BLAME=
"orion.annotation.currentBlame";var e={};f.registerType=function(c,a){var b=a;if(typeof b!=="function")b=function(a,c,b){this.start=a;this.end=c;if(b!==void 0)this.title=b},b.prototype=a;b.prototype.type=c;e[c]=b;return c};f.createAnnotation=function(c,a,b,d){return new (this.getType(c))(a,b,d)};f.getType=function(c){return e[c]};d(f.ANNOTATION_ERROR);d(f.ANNOTATION_WARNING);d(f.ANNOTATION_TASK);d(f.ANNOTATION_BREAKPOINT);d(f.ANNOTATION_BOOKMARK);d(f.ANNOTATION_CURRENT_BRACKET);d(f.ANNOTATION_MATCHING_BRACKET);
d(f.ANNOTATION_CURRENT_SEARCH);d(f.ANNOTATION_MATCHING_SEARCH);d(f.ANNOTATION_READ_OCCURRENCE);d(f.ANNOTATION_WRITE_OCCURRENCE);d(f.ANNOTATION_SELECTED_LINKED_GROUP);d(f.ANNOTATION_CURRENT_LINKED_GROUP);d(f.ANNOTATION_LINKED_GROUP);d(f.ANNOTATION_CURRENT_LINE,!0);d(f.ANNOTATION_BLAME,!0);d(f.ANNOTATION_CURRENT_BLAME,!0);f.registerType(f.ANNOTATION_FOLDING,j);i.addMixin=function(c){var a=i.prototype,b;for(b in a)a.hasOwnProperty(b)&&(c[b]=a[b])};i.prototype={addAnnotationType:function(c){if(!this._annotationTypes)this._annotationTypes=
[];this._annotationTypes.push(c)},getAnnotationTypePriority:function(c){if(this._annotationTypes)for(var a=0;a<this._annotationTypes.length;a++)if(this._annotationTypes[a]===c)return a+1;return 0},getAnnotationsByType:function(c,a,b){c=c.getAnnotations(a,b);for(b=[];c.hasNext();)a=c.next(),this.getAnnotationTypePriority(a.type)!==0&&b.push(a);var d=this;b.sort(function(a,c){return d.getAnnotationTypePriority(a.type)-d.getAnnotationTypePriority(c.type)});return b},isAnnotationTypeVisible:function(c){return this.getAnnotationTypePriority(c)!==
0},removeAnnotationType:function(c){if(this._annotationTypes)for(var a=0;a<this._annotationTypes.length;a++)if(this._annotationTypes[a]===c){this._annotationTypes.splice(a,1);break}}};b.prototype={addAnnotation:function(c){if(c){var a=this._annotations,b=this._binarySearch(a,c.start);a.splice(b,0,c);c._annotationModel=this;this.onChanged({type:"Changed",added:[c],removed:[],changed:[]})}},getTextModel:function(){return this._model},getAnnotations:function(c,a){var b=this._annotations,d,e=0,f;f=c===
void 0&&a===void 0?function(){return e<b.length?b[e++]:null}:function(){for(;e<b.length;){var d=b[e++];if(c===d.start||(c>d.start?c<d.end:d.start<a))return d;if(d.start>=a)break}return null};d=f();return{next:function(){var a=d;a&&(d=f());return a},hasNext:function(){return d!==null}}},modifyAnnotation:function(c){if(c&&!(this._getAnnotationIndex(c)<0))this.onChanged({type:"Changed",added:[],removed:[],changed:[c]})},onChanged:function(c){return this.dispatchEvent(c)},removeAnnotations:function(c){var a=
this._annotations,b,d;if(c){b=[];for(d=a.length-1;d>=0;d--){var e=a[d];if(e.type===c)a.splice(d,1),b.splice(0,0,e),e._annotationModel=null}}else b=a;this.onChanged({type:"Changed",removed:b,added:[],changed:[]})},removeAnnotation:function(c){if(c){var a=this._getAnnotationIndex(c);if(!(a<0))c._annotationModel=null,this.onChanged({type:"Changed",removed:this._annotations.splice(a,1),added:[],changed:[]})}},replaceAnnotations:function(c,a){var b=this._annotations,d,e,f,g=[];if(c)for(d=c.length-1;d>=
0;d--)if(f=c[d],e=this._getAnnotationIndex(f),!(e<0))f._annotationModel=null,b.splice(e,1),g.splice(0,0,f);a||(a=[]);for(d=0;d<a.length;d++)f=a[d],e=this._binarySearch(b,f.start),f._annotationModel=this,b.splice(e,0,f);this.onChanged({type:"Changed",removed:g,added:a,changed:[]})},setTextModel:function(c){this._model&&this._model.removeEventListener("Changed",this._listener.onChanged);(this._model=c)&&this._model.addEventListener("Changed",this._listener.onChanged)},_binarySearch:function(c,a){for(var b=
c.length,d=-1,e;b-d>1;)e=Math.floor((b+d)/2),a<=c[e].start?b=e:d=e;return b},_getAnnotationIndex:function(c){for(var a=this._annotations,b=this._binarySearch(a,c.start);b<a.length&&a[b].start===c.start;){if(a[b]===c)return b;b++}return-1},_onChanged:function(c){var a=c.start,b=c.removedCharCount,d=this._annotations,e=a+b;if(0<d.length){for(var f={type:"Changed",added:[],removed:[],changed:[],textModelChangedEvent:c},c=c.addedCharCount-b,b=0;b<d.length;b++){var g=d[b];if(g.start>=e)g._oldStart=g.start,
g._oldEnd=g.end,g.start+=c,g.end+=c,f.changed.push(g);else if(!(g.end<=a))g.start<a&&e<g.end?(g._oldStart=g.start,g._oldEnd=g.end,g.end+=c,f.changed.push(g)):(d.splice(b,1),f.removed.push(g),g._annotationModel=null,g.expand&&g.expand(),b--)}if(f.added.length>0||f.removed.length>0||f.changed.length>0)this.onChanged(f)}}};k.EventTarget.addMixin(b.prototype);g.prototype={destroy:function(){var c=this._view;if(c)c.removeEventListener("Destroy",this._listener.onDestroy),c.removeEventListener("LineStyle",
this._listener.onLineStyle),this.view=null;(c=this._annotationModel)&&c.removeEventListener("Changed",this._listener.onChanged)},_mergeStyle:function(c,a){if(a){c||(c={});c.styleClass&&a.styleClass&&c.styleClass!==a.styleClass?c.styleClass+=" "+a.styleClass:c.styleClass=a.styleClass;var b;if(a.tagName&&!c.tagName)c.tagName=a.tagName;if(a.style){if(!c.style)c.style={};for(b in a.style)c.style[b]||(c.style[b]=a.style[b])}if(a.attributes){if(!c.attributes)c.attributes={};for(b in a.attributes)c.attributes[b]||
(c.attributes[b]=a.attributes[b])}}return c},_mergeStyleRanges:function(c,a){c||(c=[]);var b,d;for(d=0;d<c.length&&a;d++){var e=c[d];if(a.end<=e.start)break;if(!(a.start>=e.end)){b=this._mergeStyle({},e.style);b=this._mergeStyle(b,a.style);var f=[];f.push(d,1);a.start<e.start&&f.push({start:a.start,end:e.start,style:a.style});a.start>e.start&&f.push({start:e.start,end:a.start,style:e.style});f.push({start:Math.max(e.start,a.start),end:Math.min(e.end,a.end),style:b});a.end<e.end&&f.push({start:a.end,
end:e.end,style:e.style});a=a.end>e.end?{start:e.end,end:a.end,style:a.style}:null;Array.prototype.splice.apply(c,f)}}a&&(b=this._mergeStyle({},a.style),c.splice(d,0,{start:a.start,end:a.end,style:b}));return c},_onAnnotationModelChanged:function(c){function a(a,c){f.getBaseModel&&(a=f.mapOffset(a,!0),c=f.mapOffset(c,!0));a!==-1&&c!==-1&&d.redrawRange(a,c)}function b(c,d){for(var f=0;f<c.length;f++)if(e.isAnnotationTypeVisible(c[f].type)){var g=c[f];a(g.start,g.end);d&&g._oldStart!==void 0&&g._oldEnd&&
a(g._oldStart,g._oldEnd)}}var d=this._view;if(d){var e=this,f=d.getModel();b(c.added);b(c.removed);b(c.changed,!0)}},_onDestroy:function(){this.destroy()},_onLineStyle:function(c){var a=this._annotationModel,b=c.textView.getModel(),d=a.getTextModel(),e=c.lineStart,f=c.lineStart+c.lineText.length;d!==b&&(e=b.mapOffset(e),f=b.mapOffset(f));for(a=a.getAnnotations(e,f);a.hasNext();)if(e=a.next(),this.isAnnotationTypeVisible(e.type)){if(e.rangeStyle){var f=e.start,g=e.end;d!==b&&(f=b.mapOffset(f,!0),g=
b.mapOffset(g,!0));c.ranges=this._mergeStyleRanges(c.ranges,{start:f,end:g,style:e.rangeStyle})}if(e.lineStyle)c.style=this._mergeStyle({},c.style),c.style=this._mergeStyle(c.style,e.lineStyle)}}};i.addMixin(g.prototype);return{FoldingAnnotation:j,AnnotationType:f,AnnotationTypeList:i,AnnotationModel:b,AnnotationStyler:g}});
define("orion/editor/editor","i18n!orion/editor/nls/messages,orion/editor/eventTarget,orion/editor/tooltip,orion/editor/annotations,orion/objects,orion/util".split(","),function(h,k,j,f,d,i){function b(c){c=c||{};this._domNode=c.domNode;this._model=c.model;this._undoStack=c.undoStack;this._statusReporter=c.statusReporter;this._title=null;var a=this;this._listener={onChanged:function(c){a.onChanged(c)}};this._model&&this._model.addEventListener("Changed",this._listener.onChanged);this.checkDirty()}
function g(c){c=c||{};b.call(this,c);this._textViewFactory=c.textViewFactory;this._undoStackFactory=c.undoStackFactory;this._textDNDFactory=c.textDNDFactory;this._annotationFactory=c.annotationFactory;this._foldingRulerFactory=c.foldingRulerFactory;this._lineNumberRulerFactory=c.lineNumberRulerFactory;this._contentAssistFactory=c.contentAssistFactory;this._keyBindingFactory=c.keyBindingFactory;this._contentAssist=this._foldingRuler=this._overviewRuler=this._lineNumberRuler=this._annotationRuler=this._annotationModel=
this._annotationStyler=null}var e=f.AnnotationType;b.prototype={destroy:function(){this.uninstall();this._statusReporter=this._domNode=null;this._model&&this._model.removeEventListener("Changed",this._listener.onChanged)},checkDirty:function(){this.setDirty(this._undoStack&&!this._undoStack.isClean())},focus:function(){},getModel:function(){return this._model},getText:function(c,a){return this.getModel().getText(c,a)},getTitle:function(){return this._title},getUndoStack:function(){return this._undoStack},
install:function(){this.installed=!0},isDirty:function(){return this._dirty},markClean:function(){this.getUndoStack().markClean();this.setDirty(!1)},onDirtyChanged:function(c){return this.dispatchEvent(c)},onInputChanged:function(c){return this.dispatchEvent(c)},onChanged:function(){this.checkDirty()},reportStatus:function(c,a,b){this._statusReporter&&this._statusReporter(c,a,b)},resize:function(){},setDirty:function(c){if(this._dirty!==c)this._dirty=c,this.onDirtyChanged({type:"DirtyChanged"})},
_setModelText:function(c){this._model&&this._model.setText(c)},setInput:function(c,a,b,d){this._title=c;d||(a?this.reportStatus(a,"error"):b!==null&&b!==void 0&&typeof b==="string"&&this._setModelText(b),this._undoStack&&this._undoStack.reset());this.checkDirty();this.onInputChanged({type:"InputChanged",title:c,message:a,contents:b,contentsSaved:d})},setText:function(c,a,b){this.getModel().setText(c,a,b)},uninstall:function(){this.installed=!1}};k.EventTarget.addMixin(b.prototype);g.prototype=new b;
d.mixin(g.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(){if(!this._textView)return null;var c=this._textView.getModel();c.getBaseModel&&(c=c.getBaseModel());return c},getOverviewRuler:function(){return this._overviewRuler},getTextView:function(){return this._textView},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()},resize:function(){this._textView&&this._textView.resize()},setAnnotationRulerVisible:function(c,a){if(this._annotationRulerVisible!==c||a)if(this._annotationRulerVisible=c,this._annotationRuler){var b=this._textView;c?b.addRuler(this._annotationRuler,0):b.removeRuler(this._annotationRuler)}},setFoldingRulerVisible:function(c,a){if(this._foldingRulerVisible!==c||a)if(this._foldingRulerVisible=
c,this._foldingRuler){var b=this._textView;b.getModel().getBaseModel&&(c?b.addRuler(this._foldingRuler):b.removeRuler(this._foldingRuler))}},setLineNumberRulerVisible:function(c,a){if(this._lineNumberRulerVisible!==c||a)if(this._lineNumberRulerVisible=c,this._lineNumberRuler){var b=this._textView;c?b.addRuler(this._lineNumberRuler,!this._annotationRulerVisible?0:1):b.removeRuler(this._lineNumberRuler)}},setOverviewRulerVisible:function(c,a){if(this._overviewRulerVisible!==c||a)if(this._overviewRulerVisible=
c,this._overviewRuler){var b=this._textView;c?b.addRuler(this._overviewRuler):b.removeRuler(this._overviewRuler)}},mapOffset:function(c,a){var b=this._textView.getModel();b.getBaseModel&&(c=b.mapOffset(c,a));return c},getLineAtOffset:function(c){return this.getModel().getLineAtOffset(this.mapOffset(c))},getLineStart:function(c){return this.getModel().getLineStart(c)},getCaretOffset:function(){return this.mapOffset(this._textView.getCaretOffset())},getSelection:function(){var c=this._textView,a=c.getSelection(),
c=c.getModel();if(c.getBaseModel)a.start=c.mapOffset(a.start),a.end=c.mapOffset(a.end);return a},_expandOffset:function(c){var a=this._textView.getModel(),b=this._annotationModel;if(b&&a.getBaseModel)for(c=b.getAnnotations(c,c+1);c.hasNext();)a=c.next(),a.type===e.ANNOTATION_FOLDING&&a.expand&&a.expand()},setCaretOffset:function(c,a,b){var d=this._textView,e=d.getModel();e.getBaseModel&&(this._expandOffset(c),c=e.mapOffset(c,!0));d.setCaretOffset(c,a,b)},setText:function(c,a,b){var d=this._textView,
e=d.getModel();e.getBaseModel&&(a!==void 0&&(this._expandOffset(a),a=e.mapOffset(a,!0)),b!==void 0&&(this._expandOffset(b),b=e.mapOffset(b,!0)));d.setText(c,a,b)},setSelection:function(c,a,b,d){var e=this._textView,f=e.getModel();f.getBaseModel&&(this._expandOffset(c),this._expandOffset(a),c=f.mapOffset(c,!0),a=f.mapOffset(a,!0));e.setSelection(c,a,b,d)},moveSelection:function(c,a,b,d){var e=this._textView;this.setSelection(c,a||c,1/3,function(){(d===void 0||d)&&e.focus();b&&b()})},_getTooltipInfo:function(c,
a){var b=this._textView,d=this.getAnnotationModel();if(!d)return null;var e=this._annotationStyler;if(!e)return null;var f=b.getOffsetAtLocation(c,a);if(f===-1)return null;f=this.mapOffset(f);e=e.getAnnotationsByType(d,f,f+1);d=[];for(f=0;f<e.length;f++)e[f].rangeStyle&&d.push(e[f]);if(d.length===0)return null;b=b.convert({x:c,y:a},"document","page");return{contents:d,anchor:"left",x:b.x+10,y:b.y+20}},_highlightCurrentLine:function(c,a){var b=this._annotationModel;if(b){var d=this._textView;if(!d.getOptions("singleMode")){var f=
d.getModel(),g=a?f.getLineAtOffset(a.start):-1,h=f.getLineAtOffset(c.start),d=c.start===c.end,i=!a||a.start===a.end,j=f.getLineStart(h),k=f.getLineEnd(h);f.getBaseModel&&(j=f.mapOffset(j),k=f.mapOffset(k));f=this._currentLineAnnotation;if(!(g===h&&i&&d&&f&&f.start===j&&f.end===k)){var g=f?[f]:null,q;d&&(f=e.createAnnotation(e.ANNOTATION_CURRENT_LINE,j,k),q=[f]);this._currentLineAnnotation=f;b.replaceAnnotations(g,q)}}}},installTextView:function(){this.install()},install:function(){if(!this._textView){this._textView=
this._textViewFactory();if(this._undoStackFactory)this._undoStack=this._undoStackFactory.createUndoStack(this),this.checkDirty();if(this._textDNDFactory)this._textDND=this._textDNDFactory.createTextDND(this,this._undoStack);if(this._contentAssistFactory)this._contentAssist=this._contentAssistFactory.createContentAssistMode(this).getContentAssist();var c=this,a=this._textView,d=this;this._listener={onModelChanged:function(){d.checkDirty()},onMouseOver:function(a){d._listener.onMouseMove(a)},onMouseMove:function(c){var b=
j.Tooltip.getTooltip(a);if(b&&!(d._listener.lastMouseX===c.event.clientX&&d._listener.lastMouseY===c.event.clientY))d._listener.lastMouseX=c.event.clientX,d._listener.lastMouseY=c.event.clientY,b.setTarget({x:c.x,y:c.y,getTooltipInfo:function(){return d._getTooltipInfo(this.x,this.y)}})},onMouseOut:function(c){var b=j.Tooltip.getTooltip(a);if(b&&!(d._listener.lastMouseX===c.event.clientX&&d._listener.lastMouseY===c.event.clientY))d._listener.lastMouseX=c.event.clientX,d._listener.lastMouseY=c.event.clientY,
b.setTarget(null)},onScroll:function(){var c=j.Tooltip.getTooltip(a);c&&c.setTarget(null,0,0)},onSelection:function(a){d._updateCursorStatus();d._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 f;if(f=typeof this._keyBindingFactory==="function"?this._keyBindingFactory(this,this.getKeyModes(),this._undoStack,this._contentAssist):this._keyBindingFactory.createKeyBindings(c,this._undoStack,this._contentAssist))this._textActions=f.textActions,this._linkedMode=f.linkedMode,this._sourceCodeActions=f.sourceCodeActions}f=function(a){if(a!==void 0&&a!==-1){for(var b=this.getView().getModel(),d=this.getAnnotationModel(),f=c.mapOffset(b.getLineStart(a)),
a=c.mapOffset(b.getLineEnd(a)),b=d.getAnnotations(f,a),g=null;b.hasNext();){var h=b.next();if(h.type===e.ANNOTATION_BOOKMARK){g=h;break}}g?d.removeAnnotation(g):(g=e.createAnnotation(e.ANNOTATION_BOOKMARK,f,a),g.title=void 0,d.addAnnotation(g))}};if(this._annotationFactory){var g=a.getModel();g.getBaseModel&&(g=g.getBaseModel());if(this._annotationModel=this._annotationFactory.createAnnotationModel(g))if(g=this._annotationStyler=this._annotationFactory.createAnnotationStyler(a,this._annotationModel))g.addAnnotationType(e.ANNOTATION_CURRENT_SEARCH),
g.addAnnotationType(e.ANNOTATION_MATCHING_SEARCH),g.addAnnotationType(e.ANNOTATION_ERROR),g.addAnnotationType(e.ANNOTATION_WARNING),g.addAnnotationType(e.ANNOTATION_MATCHING_BRACKET),g.addAnnotationType(e.ANNOTATION_CURRENT_BRACKET),g.addAnnotationType(e.ANNOTATION_CURRENT_LINE),g.addAnnotationType(e.ANNOTATION_READ_OCCURRENCE),g.addAnnotationType(e.ANNOTATION_WRITE_OCCURRENCE),g.addAnnotationType(e.ANNOTATION_SELECTED_LINKED_GROUP),g.addAnnotationType(e.ANNOTATION_CURRENT_LINKED_GROUP),g.addAnnotationType(e.ANNOTATION_LINKED_GROUP),
g.addAnnotationType("orion.annotation.highlightError");var g=this._annotationFactory.createAnnotationRulers(this._annotationModel),h=this._annotationRuler=g.annotationRuler;if(h)h.onDblClick=f,h.setMultiAnnotationOverlay({html:"<div class='annotationHTML overlay'></div>"}),h.addAnnotationType(e.ANNOTATION_ERROR),h.addAnnotationType(e.ANNOTATION_WARNING),h.addAnnotationType(e.ANNOTATION_TASK),h.addAnnotationType(e.ANNOTATION_BOOKMARK);this.setAnnotationRulerVisible(this._annotationRulerVisible||this._annotationRulerVisible===
void 0,!0);if(h=this._overviewRuler=g.overviewRuler)h.addAnnotationType(e.ANNOTATION_CURRENT_SEARCH),h.addAnnotationType(e.ANNOTATION_MATCHING_SEARCH),h.addAnnotationType(e.ANNOTATION_READ_OCCURRENCE),h.addAnnotationType(e.ANNOTATION_WRITE_OCCURRENCE),h.addAnnotationType(e.ANNOTATION_CURRENT_BLAME),h.addAnnotationType(e.ANNOTATION_ERROR),h.addAnnotationType(e.ANNOTATION_WARNING),h.addAnnotationType(e.ANNOTATION_TASK),h.addAnnotationType(e.ANNOTATION_BOOKMARK),h.addAnnotationType(e.ANNOTATION_MATCHING_BRACKET),
h.addAnnotationType(e.ANNOTATION_CURRENT_BRACKET),h.addAnnotationType(e.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(e.ANNOTATION_CURRENT_BLAME),this._lineNumberRuler.addAnnotationType(e.ANNOTATION_BLAME),this._lineNumberRuler.onDblClick=f,this.setLineNumberRulerVisible(this._lineNumberRulerVisible||
this._lineNumberRulerVisible===void 0,!0);if(this._foldingRulerFactory)this._foldingRuler=this._foldingRulerFactory.createFoldingRuler(this._annotationModel),this._foldingRuler.addAnnotationType(e.ANNOTATION_FOLDING),this.setFoldingRulerVisible(this._foldingRulerVisible||this._foldingRulerVisible===void 0,!0);this.dispatchEvent({type:"TextViewInstalled",textView:a});b.prototype.install.call(this)}},uninstallTextView:function(){this.uninstall()},uninstall:function(){var c=this._textView;if(c)c.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:c}),b.prototype.uninstall.call(this)},_updateCursorStatus:function(){var c=
this.getModel(),a=this.getCaretOffset(),b=c.getLineAtOffset(a),c=c.getLineStart(b);a-=c;for(var c=this.getKeyModes(),d=0;d<c.length;d++){var e=c[d];if(e.isActive()&&e.isStatusActive&&e.isStatusActive())return}this.reportStatus(i.formatMessage(h.lineColumn,b+1,a+1))},showAnnotations:function(c,a,b,d){var f=this._annotationModel;if(f){for(var g=[],h=[],i=f.getTextModel(),j=f.getAnnotations(),k;j.hasNext();)k=j.next(),a.indexOf(k.type)!==-1&&k.creatorID===this&&g.push(k);if(c)for(a=0;a<c.length;a++)if(k=
c[a]){if(b)k=b(k);else{var q;typeof k.line==="number"?(q=i.getLineStart(k.line-1),j=q+k.start-1,q=q+k.end-1):(j=k.start,q=k.end);var w=d(k);if(!w)continue;k=e.createAnnotation(w,j,q,k.description)}k.creatorID=this;h.push(k)}f.replaceAnnotations(g,h)}},showProblems:function(c){this.showAnnotations(c,[e.ANNOTATION_ERROR,e.ANNOTATION_WARNING,e.ANNOTATION_TASK],null,function(a){switch(a.severity){case "error":return e.ANNOTATION_ERROR;case "warning":return e.ANNOTATION_WARNING;case "task":return e.ANNOTATION_TASK}return null})},
showOccurrences:function(c){this.showAnnotations(c,[e.ANNOTATION_READ_OCCURRENCE,e.ANNOTATION_WRITE_OCCURRENCE],null,function(a){return a.readAccess?e.ANNOTATION_READ_OCCURRENCE:e.ANNOTATION_WRITE_OCCURRENCE})},showBlame:function(c){var a=this._blameRGB,b=this.getTextView().getOptions("parent").ownerDocument;if(!a){var g=i.createElement(b,"div");g.className="annotation blame";b.body.appendChild(g);var j=(b.defaultView||b.parentWindow).getComputedStyle(g).getPropertyValue("background-color");g.parentNode.removeChild(g);
var g=j.indexOf("("),k=j.indexOf(")"),j=j.substring(g+1,k);this._blameRGB=a=j.split(",").slice(0,3)}var p=function(){var a=f.AnnotationType.createAnnotation(this.groupType,this.start,this.end,this.title);a.style=d.mixin({},a.style);a.style.style=d.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},u=function(){var a=i.createElement(b,"div");a.className="tooltipTitle";var c=this.blame.Message.indexOf("\n");
if(c===-1)c=this.blame.Message.length;var d=i.createElement(b,"a");d.href=this.blame.CommitLink;d.appendChild(b.createTextNode(this.blame.Message.substring(0,c)));a.appendChild(d);a.appendChild(i.createElement(b,"br"));a.appendChild(b.createTextNode(i.formatMessage(h.committerOnTime,this.blame.AuthorName,this.blame.Time)));return a},v=this.getModel();this.showAnnotations(c,[e.ANNOTATION_BLAME,e.ANNOTATION_CURRENT_BLAME],function(c){var b=v.getLineStart(c.Start-1),g=v.getLineEnd(c.End-1,!0),b=f.AnnotationType.createAnnotation(e.ANNOTATION_BLAME,
b,g,u),g=a.slice(0);g.push(c.Shade);b.style=d.mixin({},b.style);b.style.style=d.mixin({},b.style.style);b.style.style.backgroundColor="rgba("+g.join()+")";b.groupId=c.Name;b.groupType=e.ANNOTATION_CURRENT_BLAME;b.createGroupAnnotation=p;b.html='<img class="annotationHTML blame" src="'+c.AuthorImage+'"/>';b.blame=c;return b})},showSelection:function(c,a,b,d,e){typeof c==="number"?(typeof a!=="number"&&(a=c),this.moveSelection(c,a)):typeof b==="number"&&(c=this.getModel().getLineStart(b-1),typeof d===
"number"&&(c+=d),typeof e!=="number"&&(e=0),this.moveSelection(c,c+e))},_setModelText:function(c){this._textView&&(this._textView.setText(c),this._textView.getModel().setLineDelimiter("auto"),this._highlightCurrentLine(this._textView.getSelection()))},setInput:function(c,a,d,e,f){b.prototype.setInput.call(this,c,a,d,e);this._textView&&!e&&!f&&this._textView.focus()},onGotoLine:function(c,a,b,d){if(this._textView){var e=this.getModel(),c=Math.max(0,Math.min(c,e.getLineCount()-1)),f=e.getLineStart(c),
g=0;b===void 0&&(b=0);typeof a==="string"?(c=e.getLine(c).indexOf(a),c!==-1&&(g=c,b=g+a.length)):(g=a,a=e.getLineEnd(c)-f,g=Math.min(g,a),b=Math.min(b,a));this.moveSelection(f+g,f+b,d)}}});return{BaseEditor:b,Editor:g}});
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(h,k,j,f,d,i,b){function g(a){var c=a.getTextView();j.KeyMode.call(this,c);this.editor=a;this._active=!1;this._success=!0;this._ignoreSelection=!1;this._prefix="";c.setAction("incrementalFindCancel",function(){this.setActive(!1);return!0}.bind(this));c.setAction("incrementalFindBackspace",function(){return this._backspace()}.bind(this));
var b=this;this._listener={onVerify:function(a){var c=b.editor,e=c.getModel(),f=c.mapOffset(a.start),c=c.mapOffset(a.end),e=e.getText(f,c);if((e=b._prefix.match(RegExp("^"+d.escape(e),"i")))&&e.length>0)b._prefix+=a.text,b._success=!0,b._status(),b.find(b._forward,!0),a.text=null},onSelection:function(){b._ignoreSelection||b.setActive(!1)}}}function e(a,c,b){if(a){this._editor=a;this._undoStack=c;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(b)}}var c={};g.prototype=new j.KeyMode;i.mixin(g.prototype,{createKeyBindings:function(){var a=k.KeyBinding,c=[];c.push({actionID:"incrementalFindBackspace",keyBinding:new a(8)});c.push({actionID:"incrementalFindCancel",keyBinding:new a(13)});c.push({actionID:"incrementalFindCancel",
keyBinding:new a(27)});c.push({actionID:"incrementalFindReverse",keyBinding:new a(38)});c.push({actionID:"incrementalFind",keyBinding:new a(40)});c.push({actionID:"incrementalFindReverse",keyBinding:new a("k",!0,!0)});c.push({actionID:"incrementalFind",keyBinding:new a("k",!0)});return c},find:function(a,c){this._forward=a;if(!this.isActive())return this.setActive(!0),!1;var b=this._prefix;if(b.length===0)return!1;var d=this.editor,e=d.getModel(),e=a?this._success?c?this._start:d.getCaretOffset()+
1:0:this._success?c?this._start:d.getCaretOffset():e.getCharCount()-1;if(b=d.getModel().find({string:b,start:e,reverse:!a,caseInsensitive:b.toLowerCase()===b}).next()){if(!c)this._start=e;this._ignoreSelection=this._success=!0;d.moveSelection(a?b.start:b.end,a?b.end:b.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?h.incrementalFindStr:h.incrementalFindStrNotFound:this._success?h.incrementalFindReverseStr:h.incrementalFindReverseStrNotFound;a=b.formatMessage(a,this._prefix);this.editor.reportStatus(a,this._success?"":"error")}else this.editor.reportStatus("")}});
c.IncrementalFind=g;e.prototype={find:function(a,c,b){this.setOptions({reverse:!a});var d=this.getFindString(),e;if(c)d=c.findString||d,e=c.count;a=this.getOptions();this.setOptions(c);c=b?this._startOffset:this.getStartOffset();if((e=this._doFind(d,c,e))&&!b)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=d.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 c=a;if(this._regex){for(var c="",b=!1,d=this._editor.getModel().getLineDelimiter(),e=0;e<a.length;e++){var f=a.substring(e,e+1);if(b){switch(f){case "R":c+=d;break;case "r":c+=
"\r";break;case "n":c+="\n";break;case "t":c+="\t";break;case "\\":c+="\\";break;default:c+="\\"+f}b=!1}else f==="\\"?b=!0:c+=f}b&&(c+="\\")}return c},isVisible:function(){return this._visible},replace:function(){var a=this.getFindString();if(a){var c=this._editor,b=this._processReplaceString(this.getReplaceString()),d=c.getSelection().start;if(c=c.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(c.start,c.end,a,b),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(h.replaceAll);var e=this._processReplaceString(this.getReplaceString()),f=this;window.setTimeout(function(){for(var g=0,i=0;;){var j=f._doFind(a,g,null,!0);if(!j)break;i++;i===1&&(d.setRedraw(!1),f.startUndo());f._doReplace(j.start,j.end,a,e);g=f.getStartOffset()}i>
0&&(f.endUndo(),d.setRedraw(!0));g>0?c.reportStatus(b.formatMessage(h.replacedMatches,i)):c.reportStatus(h.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 c=this._editor.getAnnotationModel();c&&c.removeAnnotations(f.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 c=this;window.setTimeout(function(){c._incremental&&c.find(!0,null,!0)},0)},startUndo:function(){this._undoStack&&
this._undoStack.startCompoundChange()},endUndo:function(){this._undoStack&&this._undoStack.endCompoundChange()},_find:function(a,c,b){return this._editor.getModel().find({string:a,start:c,end:this._end,reverse:this._reverse,wrap:b?!1:this._wrap,regex:this._regex,wholeWord:this._wholeWord,caseInsensitive:this._caseInsensitive})},_doFind:function(a,c,b,d){var b=b||1,e=this._editor;if(!a)return this._removeAllAnnotations(),null;this._lastString=a;var g,i;if(this._regex)try{i=this._find(a,c,d)}catch(j){e.reportStatus(j.message,
"error");return}else i=this._find(a,c,d);for(a=0;a<b&&i.hasNext();a++)g=i.next();if(!this._replacingAll){g?this._editor.reportStatus(""):this._editor.reportStatus(h.notFound,"error");if(this.isVisible()){b=f.AnnotationType.ANNOTATION_CURRENT_SEARCH;if(i=e.getAnnotationModel())i.removeAnnotations(b),g&&i.addAnnotation(f.AnnotationType.createAnnotation(b,g.start,g.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(g):g&&e.moveSelection(g.start,g.end,null,!1)}return g},_doReplace:function(a,c,b,d){var e=this._editor;if(this._regex&&(d=e.getText(a,c).replace(RegExp(b,this._caseInsensitive?"i":""),d),!d))return;e.setText(d,a,c);e.setSelection(a,a+d.length,!0)},_markAllOccurrences:function(){var a=this._editor.getAnnotationModel();if(a){for(var c=f.AnnotationType.ANNOTATION_MATCHING_SEARCH,b=a.getAnnotations(),d=[],e;b.hasNext();){var g=b.next();g.type===
c&&d.push(g)}if(this.isVisible()){b=this.getFindString();b=this._editor.getModel().find({string:b,regex:this._regex,wholeWord:this._wholeWord,caseInsensitive:this._caseInsensitive});for(e=[];b.hasNext();)g=b.next(),e.push(f.AnnotationType.createAnnotation(c,g.start,g.end))}a.replaceAnnotations(d,e)}},_removeAllAnnotations:function(){var a=this._editor.getAnnotationModel();a&&(a.removeAnnotations(f.AnnotationType.ANNOTATION_CURRENT_SEARCH),a.removeAnnotations(f.AnnotationType.ANNOTATION_MATCHING_SEARCH))},
_removeCurrentAnnotation:function(){var a=this._editor.getAnnotationModel();a&&a.removeAnnotations(f.AnnotationType.ANNOTATION_CURRENT_SEARCH)}};c.Find=e;return c});
define("orion/editor/actions","i18n!orion/editor/nls/messages,orion/keyBinding,orion/editor/annotations,orion/editor/tooltip,orion/editor/find,orion/util".split(","),function(h,k,j,f,d,i){function b(a,c,b){this.editor=a;this.undoStack=c;this._incrementalFind=new d.IncrementalFind(a);this._find=b?b:new d.Find(a,c);this._lastEditLocation=null;this.init()}function g(a,c,b,d){this.editor=a;this.undoStack=c;this.contentAssist=b;this.linkedMode=d;this.contentAssist&&this.contentAssist.addEventListener("ProposalApplied",
this.contentAssistProposalApplied.bind(this));this.init()}var e=j.AnnotationType,c={};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(a){if(this.undoStack){var c=1;if(a&&a.count)c=a.count;for(;c>0;)this.undoStack.undo(),--c;return!0}return!1}.bind(this),
{name:h.undo});a.setAction("redo",function(a){if(this.undoStack){var c=1;if(a&&a.count)c=a.count;for(;c>0;)this.undoStack.redo(),--c;return!0}return!1}.bind(this),{name:h.redo});a.setKeyBinding(new k.KeyBinding("f",!0),"find");a.setAction("find",function(){if(this._find){var a=this.editor.getSelection();(a=prompt(h.find,this.editor.getText(a.start,a.end)))&&this._find.find(!0,{findString:a})}}.bind(this),{name:h.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:h.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:h.findPrevious});a.setKeyBinding(new k.KeyBinding("j",!0),"incrementalFind");a.setAction("incrementalFind",function(){this._incrementalFind&&this._incrementalFind.find(!0);return!0}.bind(this),{name:h.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:h.incrementalFindReverse});a.setAction("tab",function(){return this.indentLines()}.bind(this));a.setAction("shiftTab",function(){return this.unindentLines()}.bind(this),{name:h.unindentLines});a.setKeyBinding(new k.KeyBinding(38,!1,!1,!0),"moveLinesUp");a.setAction("moveLinesUp",function(){return this.moveLinesUp()}.bind(this),{name:h.moveLinesUp});a.setKeyBinding(new k.KeyBinding(40,
!1,!1,!0),"moveLinesDown");a.setAction("moveLinesDown",function(){return this.moveLinesDown()}.bind(this),{name:h.moveLinesDown});a.setKeyBinding(new k.KeyBinding(38,!0,!1,!0),"copyLinesUp");a.setAction("copyLinesUp",function(){return this.copyLinesUp()}.bind(this),{name:h.copyLinesUp});a.setKeyBinding(new k.KeyBinding(40,!0,!1,!0),"copyLinesDown");a.setAction("copyLinesDown",function(){return this.copyLinesDown()}.bind(this),{name:h.copyLinesDown});a.setKeyBinding(new k.KeyBinding("d",!0,!1,!1),
"deleteLines");a.setAction("deleteLines",function(a){return this.deleteLines(a)}.bind(this),{name:h.deleteLines});a.setKeyBinding(new k.KeyBinding("l",!i.isMac,!1,!1,i.isMac),"gotoLine");a.setAction("gotoLine",function(){return this.gotoLine()}.bind(this),{name:h.gotoLine});a.setKeyBinding(new k.KeyBinding(190,!0),"nextAnnotation");a.setAction("nextAnnotation",function(){return this.nextAnnotation(!0)}.bind(this),{name:h.nextAnnotation});a.setKeyBinding(new k.KeyBinding(188,!0),"previousAnnotation");
a.setAction("previousAnnotation",function(){return this.nextAnnotation(!1)}.bind(this),{name:h.prevAnnotation});a.setKeyBinding(new k.KeyBinding("e",!0,!1,!0,!1),"expand");a.setAction("expand",function(){return this.expandAnnotation(!0)}.bind(this),{name:h.expand});a.setKeyBinding(new k.KeyBinding("c",!0,!1,!0,!1),"collapse");a.setAction("collapse",function(){return this.expandAnnotation(!1)}.bind(this),{name:h.collapse});a.setKeyBinding(new k.KeyBinding("e",!0,!0,!0,!1),"expandAll");a.setAction("expandAll",
function(){return this.expandAnnotations(!0)}.bind(this),{name:h.expandAll});a.setKeyBinding(new k.KeyBinding("c",!0,!0,!0,!1),"collapseAll");a.setAction("collapseAll",function(){return this.expandAnnotations(!1)}.bind(this),{name:h.collapseAll});a.setKeyBinding(new k.KeyBinding("q",!i.isMac,!1,!1,i.isMac),"lastEdit");a.setAction("lastEdit",function(){return this.gotoLastEdit()}.bind(this),{name:h.lastEdit})},copyLinesDown:function(){var a=this.editor;if(a.getTextView().getOptions("readonly"))return!1;
var c=a.getModel(),b=a.getSelection(),d=c.getLineAtOffset(b.start),b=c.getLineAtOffset(b.end>b.start?b.end-1:b.end),e=c.getLineStart(d),d=c.getLineEnd(b,!0),f=c.getLineCount(),g="",e=c.getText(e,d);b===f-1&&(e=(g=c.getLineDelimiter())+e);a.setText(e,d,d);a.setSelection(d+g.length,d+e.length);return!0},copyLinesUp:function(){var a=this.editor;if(a.getTextView().getOptions("readonly"))return!1;var c=a.getModel(),b=a.getSelection(),d=c.getLineAtOffset(b.start),b=c.getLineAtOffset(b.end>b.start?b.end-
1:b.end),d=c.getLineStart(d),e=c.getLineEnd(b,!0),f=c.getLineCount(),g="",e=c.getText(d,e);b===f-1&&(e+=g=c.getLineDelimiter());a.setText(e,d,d);a.setSelection(d,d+e.length-g.length);return!0},deleteLines:function(a){var c=this.editor;if(c.getTextView().getOptions("readonly"))return!1;var b=1;if(a&&a.count)b=a.count;var d=c.getSelection(),e=c.getModel(),f=e.getLineAtOffset(d.start),a=e.getLineStart(f),b=d.start!==d.end||b===1?e.getLineAtOffset(d.end>d.start?d.end-1:d.end):Math.min(f+b-1,e.getLineCount()-
1),b=e.getLineEnd(b,!0);c.setText("",a,b);return!0},expandAnnotation:function(a){var c=this.editor,b=c.getAnnotationModel();if(!b)return!0;var d=c.getModel(),e=c.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 g,b=b.getAnnotations(e,f);!g&&b.hasNext();)d=b.next(),d.type===j.AnnotationType.ANNOTATION_FOLDING&&(g=d);g&&a!==g.expanded&&(a?g.expand():(c.setCaretOffset(g.start),g.collapse()));
return!0},expandAnnotations:function(a){var c=this.editor,b=c.getTextView(),d=c.getAnnotationModel();if(!d)return!0;c.getModel();d=d.getAnnotations();for(b.setRedraw(!1);d.hasNext();)c=d.next(),c.type===j.AnnotationType.ANNOTATION_FOLDING&&a!==c.expanded&&(a?c.expand():c.collapse());b.setRedraw(!0);return!0},indentLines:function(){var a=this.editor,c=a.getTextView();if(c.getOptions("readonly"))return!1;if(c.getOptions("tabMode")){var b=a.getModel(),d=a.getSelection(),e=b.getLineAtOffset(d.start),
f=b.getLineAtOffset(d.end>d.start?d.end-1:d.end);if(e!==f){var g=[];g.push("");for(var h=e;h<=f;h++)g.push(b.getLine(h,!0));h=b.getLineStart(e);b=b.getLineEnd(f,!0);c=c.getOptions("tabSize","expandTab");c=c.expandTab?Array(c.tabSize+1).join(" "):"\t";a.setText(g.join(c),h,b);a.setSelection(h===d.start?d.start:d.start+c.length,d.end+(f-e+1)*c.length);return!0}return!1}},gotoLastEdit:function(){typeof this._lastEditLocation==="number"&&this.editor.showSelection(this._lastEditLocation);return!0},gotoLine:function(){var a=
this.editor,c=a.getModel().getLineAtOffset(a.getCaretOffset());if(c=prompt(h.gotoLinePrompty,c+1))c=parseInt(c,10),a.onGotoLine(c-1,0);return!0},moveLinesDown:function(){var a=this.editor;if(a.getTextView().getOptions("readonly"))return!1;var c=a.getModel(),b=a.getSelection(),d=c.getLineAtOffset(b.start),e=c.getLineAtOffset(b.end>b.start?b.end-1:b.end),f=c.getLineCount();if(e===f-1)return!0;var d=c.getLineStart(d),b=c.getLineEnd(e,!0),g=c.getLineEnd(e+1,!0)-(b-d),h=0;e!==f-2?c=c.getText(d,b):(e=c.getLineEnd(e),
c=c.getText(e,b)+c.getText(d,e),h+=b-e);this.startUndo();a.setText("",d,b);a.setText(c,g,g);a.setSelection(g+h,g+h+c.length);this.endUndo();return!0},moveLinesUp:function(){var a=this.editor;if(a.getTextView().getOptions("readonly"))return!1;var c=a.getModel(),b=a.getSelection(),d=c.getLineAtOffset(b.start);if(d===0)return!0;var e=c.getLineAtOffset(b.end>b.start?b.end-1:b.end),f=c.getLineCount(),b=c.getLineStart(d-1),g=c.getLineStart(d),h=c.getLineEnd(e,!0),i=c.getText(g,h),j=0;e===f-1&&(e=c.getLineEnd(d-
1),d=c.getLineEnd(d-1,!0),i+=c.getText(e,d),g=e,j=d-e);this.startUndo();a.setText("",g,h);a.setText(i,b,b);a.setSelection(b,b+i.length-j);this.endUndo();return!0},nextAnnotation:function(a){function c(a){return!!a.lineStyle||a.type===e.ANNOTATION_MATCHING_BRACKET||a.type===e.ANNOTATION_CURRENT_BRACKET||!g.isAnnotationTypeVisible(a.type)}var b=this.editor,d=b.getAnnotationModel();if(!d)return!0;var g=b.getOverviewRuler()||b.getAnnotationStyler();if(!g)return!0;for(var h=b.getModel(),i=b.getCaretOffset(),
j=d.getAnnotations(a?i:0,a?h.getCharCount():i),k=null;j.hasNext();){var q=j.next();if(a){if(q.start<=i)continue}else if(q.start>=i)continue;if(!c(q)&&(k=q,a))break}if(k){for(var w=[k],j=d.getAnnotations(k.start,k.start);j.hasNext();)q=j.next(),q!==k&&!c(q)&&w.push(q);var n=b.getTextView(),r=h.getLineAtOffset(k.start),x=f.Tooltip.getTooltip(n);if(!x)return b.moveSelection(k.start),!0;b.moveSelection(k.start,k.start,function(){x.setTarget({getTooltipInfo:function(){var a=n.convert({x:n.getLocationAtOffset(k.start).x,
y:n.getLocationAtOffset(h.getLineStart(r)).y},"document","page");return{contents:w,x:a.x,y:a.y+Math.floor(n.getLineHeight(r)*1.33)}}},0)})}return!0},unindentLines:function(){var a=this.editor,c=a.getTextView();if(c.getOptions("readonly"))return!1;if(c.getOptions("tabMode")){for(var b=a.getModel(),d=a.getSelection(),e=b.getLineAtOffset(d.start),f=b.getLineAtOffset(d.end>d.start?d.end-1:d.end),g=c.getOptions("tabSize"),h=Array(g+1).join(" "),i=[],j=c=0,k=e;k<=f;k++){var n=b.getLine(k,!0);if(b.getLineStart(k)!==
b.getLineEnd(k))if(n.indexOf("\t")===0)n=n.substring(1),c++;else if(n.indexOf(h)===0)n=n.substring(g),c+=g;else return!0;k===e&&(j=c);i.push(n)}e=b.getLineStart(e);g=b.getLineEnd(f,!0);b=b.getLineStart(f);a.setText(i.join(""),e,g);f=e===d.start?d.start:d.start-j;d=Math.max(f,d.end-c+(d.end===b+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()}};c.TextActions=
b;g.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:h.trimTrailingWhitespaces});a.setKeyBinding(new k.KeyBinding(191,!0),"toggleLineComment");a.setAction("toggleLineComment",
function(){return this.toggleLineComment()}.bind(this),{name:h.toggleLineComment});a.setKeyBinding(new k.KeyBinding(191,!0,!i.isMac,!1,i.isMac),"addBlockComment");a.setAction("addBlockComment",function(){return this.addBlockComment()}.bind(this),{name:h.addBlockComment});a.setKeyBinding(new k.KeyBinding(220,!0,!i.isMac,!1,i.isMac),"removeBlockComment");a.setAction("removeBlockComment",function(){return this.removeBlockComment()}.bind(this),{name:h.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,c=a.getTextView();if(c.getOptions("readonly"))return!1;var b=a.getSelection();if(b.start===b.end){for(var d=a.getModel(),e=d.getLineAtOffset(b.start),f=d.getLine(e,!1),g=d.getLineStart(e),h=0,i=b.start-
g,j;h<i&&((j=f.charCodeAt(h))===32||j===9);)h++;var g=f.substring(0,h),c=c.getOptions("tabSize","expandTab"),k=c.expandTab?Array(c.tabSize+1).join(" "):"\t",c=d.getLineDelimiter(),n=/^[\s]*\/\*[\*]*[\s]*$/,r=/^[\s]*\*/,x=/\*\/[\s]*$/,z=f.substring(0,i),A=f.substring(i),D;if(this.smartIndentation&&f.charCodeAt(D=z.trimRight().length-1)===123)return d=i-D-1,A=A.length-A.trimLeft().length,f=f.charCodeAt(i+A)===125?c+g+k+c+g:c+g+k,a.setText(f,b.start-d,b.end+A),a.setCaretOffset(b.start+c.length+g.length+
k.length-d),!0;else if(this.autoCompleteComments&&!x.test(z)&&(n.test(z)||r.test(z))){if(h=n.exec(z)){f=c+g+" * ";f+=x.test(A)?A.substring(0,A.length-2).trim():A.trim();if(d.getLineCount()===e+1||!r.test(d.getLine(e+1)))f+=c+g+" */";a.setText(f,b.start,b.end+A.length);a.setCaretOffset(b.start+c.length+g.length+3);return!0}if(h=r.exec(z))for(e-=1;e>=0;e--)if(h=d.getLine(e,!1),n.test(h))return x.test(A)||f.charCodeAt(i)===47?(f=c+g+"*"+A,g=b.start+c.length+g.length+1):(f=c+g+"* "+A,g=b.start+c.length+
g.length+2),a.setText(f,b.start,b.end+A.length),a.setCaretOffset(g),!0;else if(!r.test(h))break}else if(x.test(z)&&g.charCodeAt(g.length-1)===32)return f=c+g.substring(0,g.length-1),a.setText(f,b.start,b.end),a.setCaretOffset(b.start+f.length),!0;else if(h>0){for(h=i;h<f.length&&((j=f.charCodeAt(h++))===32||j===9);)b.end++;a.setText(d.getLineDelimiter()+g,b.start,b.end);return!0}}return!1},addBlockComment:function(){var a=this.editor;if(a.getTextView().getOptions("readonly"))return!1;var c=a.getModel(),
b=a.getSelection(),d=this._findEnclosingComment(c,b.start,b.end);if(d.commentStart!==void 0&&d.commentEnd!==void 0)return!0;c=c.getText(b.start,b.end);if(c.length===0)return!0;var d=c.length,c=c.replace(/\/\*|\*\//g,""),e=c.length;a.setText("/*"+c+"*/",b.start,b.end);a.setSelection(b.start+2,b.end+2+(e-d));return!0},autoPairBrackets:function(a,c){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 b=this.editor;if(b.getTextView().getOptions("readonly"))return!1;var d=b.getSelection(),e=b.getModel(),f=b.getCaretOffset()===e.getCharCount()?"":e.getText(d.start,d.start+1).trim(),g=/^$|[)}\]>]/;if(d.start===d.end&&g.test(f))return b.setText(a+c,d.start,d.start),b.setCaretOffset(d.start+1),!0;else if(d.start!==d.end)return e=e.getText(d.start,d.end),b.setText(a+e+c,d.start,d.end),b.setSelection(d.start+1,d.end+1),!0;return!1},autoPairQuotations:function(a){if(!this.autoPairQuotation)return!1;
var c=this.editor;if(c.getTextView().getOptions("readonly"))return!1;var b=c.getSelection(),d=c.getModel(),e=c.getCaretOffset(),f=e===0?"":d.getText(b.start-1,b.start).trim(),g=e===d.getCharCount()?"":d.getText(b.start,b.start+1).trim(),e=/^"$|^'$/,h=/\w/,i=/^$|[)}\]>]/;if(b.start!==b.end){d=d.getText(b.start,b.end);if(e.test(d))return!1;c.setText(a+d+a,b.start,b.end);c.setSelection(b.start+1,b.end+1)}else if(g===a)c.setCaretOffset(b.start+1);else if(f===a||e.test(g)||h.test(f)||!i.test(g))return!1;
else c.setText(a+a,b.start,b.start),c.setCaretOffset(b.start+1);return!0},contentAssistProposalApplied:function(a){a=a.data.proposal;if(a.positions&&a.positions.length>0&&this.linkedMode){for(var c=[],b=0;b<a.positions.length;++b)c[b]={positions:[{offset:a.positions[b].offset,length:a.positions[b].length}]};this.linkedMode.enterLinkedMode({groups:c,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 c=a.getSelection();if(c.start!==c.end)return!1;var b=a.getModel(),d=a.getCaretOffset(),e=d===0?"":b.getText(c.start-1,c.start),b=d===b.getCharCount()?"":b.getText(c.start,c.start+1);(e==="("&&b===")"||e==="["&&b==="]"||e==="{"&&b==="}"||e==="<"&&b===">"||e==='"'&&b==='"'||e==="'"&&b==="'")&&a.setText("",c.start,c.start+
1);return!1},_findEnclosingComment:function(a,c,b){var d=a.getLineAtOffset(c),e=a.getLineAtOffset(b),f,g,h,i,j,k;for(f=d;f>=0;f--)if(g=a.getLine(f),h=f===d?c-a.getLineStart(d):g.length,i=g.lastIndexOf("/*",h),g=g.lastIndexOf("*/",h),g>i)break;else if(i!==-1){j=a.getLineStart(f)+i;break}for(f=e;f<a.getLineCount();f++)if(g=a.getLine(f),h=f===e?b-a.getLineStart(e):0,i=g.indexOf("/*",h),g=g.indexOf("*/",h),i!==-1&&i<g)break;else if(g!==-1){k=a.getLineStart(f)+g;break}return{commentStart:j,commentEnd:k}},
lineStart:function(){for(var a=this.editor,c=a.getModel(),b=a.getCaretOffset(),d=c.getLineAtOffset(b),e=c.getLineStart(d),c=c.getLine(d),d=0;d<c.length;d++){var f=c.charCodeAt(d);if(!(f===32||f===9))break}d+=e;return b!==d?(a.setSelection(d,d),!0):!1},removeBlockComment:function(){var a=this.editor;if(a.getTextView().getOptions("readonly"))return!1;var c=a.getModel(),b=a.getSelection(),d=c.getText(b.start,b.end),e,f,g;for(g=0;g<d.length;g++)if(d.substring(g,g+2)==="/*"){e=b.start+g;break}for(;g<d.length;g++)if(d.substring(g,
g+2)==="*/"){f=b.start+g;break}if(e!==void 0&&f!==void 0)a.setText(c.getText(e+2,f),e,f+2),a.setSelection(e,f);else{d=this._findEnclosingComment(c,b.start,b.end);if(d.commentStart===void 0||d.commentEnd===void 0)return!0;c=c.getText(d.commentStart+2,d.commentEnd);a.setText(c,d.commentStart,d.commentEnd+2);a.setSelection(b.start-2,b.end-2)}return!0},toggleLineComment:function(){var a=this.editor;if(a.getTextView().getOptions("readonly"))return!1;for(var c=a.getModel(),b=a.getSelection(),d=c.getLineAtOffset(b.start),
e=c.getLineAtOffset(b.end>b.start?b.end-1:b.end),f=!0,g=[],h,i,j=d;j<=e;j++)if(h=c.getLine(j,!0),g.push(h),!f||(i=h.indexOf("//"))===-1)f=!1;else if(i!==0){var k;for(k=0;k<i;k++)if(f=h.charCodeAt(k),!(f===32||f===9))break;f=k===i}j=c.getLineStart(d);k=c.getLineEnd(e,!0);if(f){for(f=0;f<g.length;f++)h=g[f],i=h.indexOf("//"),g[f]=h.substring(0,i)+h.substring(i+2);g=g.join("");h=c.getLineStart(e);c=j===b.start?b.start:b.start-2;b=b.end-2*(e-d+1)+(b.end===h+1?2:0)}else g.splice(0,0,""),g=g.join("//"),
c=j===b.start?b.start:b.start+2,b=b.end+2*(e-d+1);a.setText(g,j,k);a.setSelection(c,b);return!0},trimTrailingWhitespaces:function(){var a=this.editor,c=a.getModel(),b=a.getSelection();a.getTextView().setRedraw(!1);a.getUndoStack().startCompoundChange();for(var d=/(\s+$)/,e=c.getLineCount(),f=0;f<e;f++){var g=c.getLine(f),h=d.exec(g);if(h){var i=c.getLineStart(f),g=h[0].length,h=i+h.index;c.setText("",h,h+g);if(b.start>h)b.start=Math.max(h,b.start-g);if(b.start!==b.end&&b.end>h)b.end=Math.max(h,b.end-
g)}}a.getUndoStack().endCompoundChange();a.getTextView().setRedraw(!0);a.setSelection(b.start,b.end,!1)},startUndo:function(){this.undoStack&&this.undoStack.startCompoundChange()},skipClosingBracket:function(a){var c=this.editor;if(c.getTextView().getOptions("readonly"))return!1;var b=c.getSelection(),d=c.getModel();return(c.getCaretOffset()===d.getCharCount()?"":d.getText(b.start,b.start+1))===a?(c.setCaretOffset(b.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}};c.SourceCodeActions=g;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 c});
define("orion/editor/undoStack",[],function(){function h(f,d,h,b,g){this.model=f;this.offset=d;this.text=h;this.previousText=b;this.type=g}function k(f){this.owner=f;this.changes=[]}function j(f,d){this.size=d!==void 0?d:100;this.reset();var h=this;this._listener={onChanging:function(b){h._onChanging(b)},onDestroy:function(b){h._onDestroy(b)}};if(f.getModel){var b=f.getModel();b.getBaseModel&&(b=b.getBaseModel());this.model=b;this.setView(f)}else this.shared=!0,this.model=f;this.model.addEventListener("Changing",
this._listener.onChanging)}h.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(f,d){this._doUndoRedo(this.offset,this.previousText,this.text,f,d);return!0},redo:function(f,d){this._doUndoRedo(this.offset,this.text,this.previousText,f,d);return!0},merge:function(f,d,h,b,g){if(b===this.type)if(b===1&&f===
this.offset+this.text.length)return this.text+=d,!0;else if(b===-1&&g===this.offset)return this.offset=f,this.previousText=h+this.previousText,!0;else if(b===-1&&f===this.offset)return this.previousText+=h,!0;return!1},_doUndoRedo:function(f,d,h,b,g){this.model.setText(d,f,f+h.length);g&&b&&(h=b.getModel(),h!==this.model&&(f=h.mapOffset(f,!0)),b.setSelection(f,f+d.length))}};k.prototype={getRedoChanges:function(){for(var f=[],d=0;d<this.changes.length;d++)f=f.concat(this.changes[d].getRedoChanges());
return f},getUndoChanges:function(){for(var f=[],d=this.changes.length-1;d>=0;d--)f=f.concat(this.changes[d].getUndoChanges());return f},add:function(f){this.changes.push(f)},end:function(f){if(f)this.endSelection=f.getSelection(),this.endCaret=f.getCaretOffset();(f=this.owner)&&f.end&&f.end()},undo:function(f,d){this.changes.length>1&&f&&f.setRedraw(!1);for(var h=this.changes.length-1;h>=0;h--)this.changes[h].undo(f,!1);this.changes.length>1&&f&&f.setRedraw(!0);if(d&&f){var h=this.startSelection.start,
b=this.startSelection.end;f.setSelection(this.startCaret?h:b,this.startCaret?b:h)}(h=this.owner)&&h.undo&&h.undo();return this.changes.length>0},redo:function(f,d){this.changes.length>1&&f&&f.setRedraw(!1);for(var h=0;h<this.changes.length;h++)this.changes[h].redo(f,!1);f&&f.setRedraw(!0);if(d&&f){var h=this.endSelection.start,b=this.endSelection.end;f.setSelection(this.endCaret?h:b,this.endCaret?b:h)}(h=this.owner)&&h.redo&&h.redo();return this.changes.length>0},merge:function(f,d,h,b,g){var e=this.changes.length;
return e>0?this.changes[e-1].merge(f,d,h,b,g):!1},start:function(f){if(f)this.startSelection=f.getSelection(),this.startCaret=f.getCaretOffset();(f=this.owner)&&f.start&&f.start()}};j.prototype={destroy:function(){this._onDestroy()},add:function(f){this.compoundChange?this.compoundChange.add(f):(this.stack.splice(this.index,this.stack.length-this.index,f),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 f=[],d=this.index;d<this.stack.length;d++)f=f.concat(this.stack[d].getRedoChanges());
return f},getUndoChanges:function(){this._commitUndo();for(var f=[],d=this.index;d>=0;d--)f=f.concat(this.stack[d].getUndoChanges());return f},undo:function(){this._commitUndo();var f;f=!1;this._ignoreUndo=!0;do{if(this.index<=0)break;f=this.stack[--this.index]}while(!(f=f.undo(this.view,!0)));this._ignoreUndo=!1;return f},redo:function(){this._commitUndo();var f;this._ignoreUndo=!0;do{if(this.index>=this.stack.length)break;f=this.stack[this.index++]}while(!f.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},setView:function(f){if(this.view!==f)this.view&&f.removeEventListener("Destroy",this._listener.onDestroy),(this.view=f)&&f.addEventListener("Destroy",this._listener.onDestroy)},startCompoundChange:function(f){this._commitUndo();f=new k(f);this.add(f);this.compoundChange=f;this.compoundChange.start(this.view);return this.compoundChange},_commitUndo:function(){this.endCompoundChange()},
_onDestroy:function(f){(!f||!this.shared)&&this.model.removeEventListener("Changing",this._listener.onChanging);if(this.view)this.view.removeEventListener("Destroy",this._listener.onDestroy),this.view=null},_onChanging:function(f){if(!this._ignoreUndo){var d=f.text,i=f.start,b=f.addedCharCount,g=f.removedCharCount,f=i+g,e=0;b===0&&g===1?e=-1:b===1&&g===0&&(e=1);b=this.stack.length;g=this.model.getText(i,f);(!(b>0&&this.index===b)||!this.stack[b-1].merge(i,d,g,e,f))&&this.add(new h(this.model,i,d,
g,e))}}};return{UndoStack:j}});
define("orion/editor/rulers",["i18n!orion/editor/nls/messages","orion/editor/annotations","orion/editor/tooltip","orion/util"],function(h,k,j,f){function d(c,a,b,d){this._location=a||"left";this._overview=b||"page";this._rulerStyle=d;this._view=null;var e=this;this._listener={onTextModelChanged:function(a){e._onTextModelChanged(a)},onAnnotationModelChanged:function(a){e._onAnnotationModelChanged(a)}};this.setAnnotationModel(c)}function i(c,a,b,e,f){d.call(this,c,a,"page",b);this._oddStyle=e||{style:{backgroundColor:"white"}};
this._evenStyle=f||{style:{backgroundColor:"white"}};this._numOfDigits=0;this._firstLine=1}function b(c,a,b){d.call(this,c,a,"page",b)}function g(c,a,b){d.call(this,c,a,"document",b)}function e(c,a,d){b.call(this,c,a,d)}d.prototype={getAnnotations:function(c,a){var b=this._annotationModel;if(!b)return[];var d=this._view.getModel(),e=d.getLineStart(c),f=d.getLineEnd(a-1),g=d;d.getBaseModel&&(g=d.getBaseModel(),e=d.mapOffset(e),f=d.mapOffset(f));for(var h=[],b=this.getAnnotationsByType(b,e,f),e=0;e<
b.length;e++)for(var f=b[e],i=g.getLineAtOffset(f.start),j=g.getLineAtOffset(Math.max(f.start,f.end-1)),k=i;k<=j;k++){var w=k;if(d!==g){w=g.getLineStart(k);w=d.mapOffset(w,!0);if(w===-1)continue;w=d.getLineAtOffset(w)}if(c<=w&&w<a){var n=this._mergeAnnotation(h[w],f,k-i,j-i+1);n&&(h[w]=n)}}if(!this._multiAnnotation&&this._multiAnnotationOverlay)for(var r in h)h[r]._multiple&&(h[r].html+=this._multiAnnotationOverlay.html);return h},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(c){this._annotationModel&&this._annotationModel.removEventListener("Changed",this._listener.onAnnotationModelChanged);(this._annotationModel=c)&&this._annotationModel.addEventListener("Changed",this._listener.onAnnotationModelChanged)},setMultiAnnotation:function(c){this._multiAnnotation=c},setMultiAnnotationOverlay:function(c){this._multiAnnotationOverlay=
c},setView:function(c){this._onTextModelChanged&&this._view&&this._view.removeEventListener("ModelChanged",this._listener.onTextModelChanged);this._view=c;this._onTextModelChanged&&this._view&&this._view.addEventListener("ModelChanged",this._listener.onTextModelChanged)},onClick:function(c){if(c!==void 0){var a=this._view,b=a.getModel(),d=b,e=b.getLineStart(c),f=e,g=e,h=this._annotationModel;if(h){a=a.getSelection();g=b.getLineEnd(c,!0);if(e<=a.start&&a.start<g)e=a.start;b.getBaseModel&&(e=b.mapOffset(e),
g=b.mapOffset(g),d=b.getBaseModel());for(var i,g=h.getAnnotations(e,g),h=null;!i&&g.hasNext();)a=g.next(),this.isAnnotationTypeVisible(a.type)&&(h=a,a.start<=e||(i=a));if(h&&h.groupId!==void 0)this._currentClickGroup=this._currentClickGroup===h.groupId?null:h.groupId,this._setCurrentGroup(c);i&&d.getLineAtOffset(i.start)===d.getLineAtOffset(e)?(e=i.start,g=i.end):g=e=f;b.getBaseModel&&(e=b.mapOffset(e,!0),g=b.mapOffset(g,!0))}(c=j.Tooltip.getTooltip(this._view))&&c.setTarget(null);this._view.setSelection(g,
e,1/3,function(){})}},onDblClick:function(){},onMouseMove:function(c,a){var b=j.Tooltip.getTooltip(this._view);if(b&&!(b.isVisible()&&this._tooltipLineIndex===c)){this._tooltipLineIndex=c;var d=this;b.setTarget({y:a.clientY,getTooltipInfo:function(){return d._getTooltipInfo(d._tooltipLineIndex,this.y)}})}},onMouseOver:function(c,a){this.onMouseMove(c,a);this._currentClickGroup||this._setCurrentGroup(c)},onMouseOut:function(){this._currentClickGroup||this._setCurrentGroup(-1);var c=j.Tooltip.getTooltip(this._view);
c&&c.setTarget(null)},_getTooltipInfo:function(c,a){if(c!==void 0){var b=this._view,d=b.getModel(),e=this._annotationModel,f=[];if(e){var f=d.getLineStart(c),g=d.getLineEnd(c);d.getBaseModel&&(f=d.mapOffset(f),g=d.mapOffset(g));f=this.getAnnotationsByType(e,f,g)}e=this._getTooltipContents(c,f);if(!e)return null;e={contents:e,anchor:this.getLocation()};f=b.getClientArea();f.y=this.getOverview()==="document"?b.convert({y:a},"view","document").y:b.getLocationAtOffset(d.getLineStart(c)).y;b.convert(f,
"document","page");e.x=f.x;e.y=f.y;e.anchor==="right"&&(e.x+=f.width);return e}},_getTooltipContents:function(c,a){return a},_onAnnotationModelChanged:function(c){function a(a){for(var c=0;c<a.length;c++)if(e.isAnnotationTypeVisible(a[c].type)){var f=a[c].start,g=a[c].end;d.getBaseModel&&(f=d.mapOffset(f,!0),g=d.mapOffset(g,!0));f!==-1&&g!==-1&&b.redrawLines(d.getLineAtOffset(f),d.getLineAtOffset(Math.max(f,g-1))+1,e)}}var b=this._view;if(b){var d=b.getModel(),e=this,f=d.getLineCount();c.textModelChangedEvent?
(c=c.textModelChangedEvent.start,d.getBaseModel&&(c=d.mapOffset(c,!0)),c=d.getLineAtOffset(c),b.redrawLines(c,f,e)):(a(c.added),a(c.removed),a(c.changed))}},_mergeAnnotation:function(c,a,b){c||(c={});if(b===0)if(c.html&&a.html){if(a.html!==c.html&&!c._multiple&&this._multiAnnotation)c.html=this._multiAnnotation.html;c._multiple=!0}else c.html=a.html;c.style=this._mergeStyle(c.style,a.style);return c},_mergeStyle:function(c,a){if(a){c||(c={});c.styleClass&&a.styleClass&&c.styleClass!==a.styleClass?
c.styleClass+=" "+a.styleClass:c.styleClass=a.styleClass;var b;if(a.style){if(!c.style)c.style={};for(b in a.style)c.style[b]===void 0&&(c.style[b]=a.style[b])}if(a.attributes){if(!c.attributes)c.attributes={};for(b in a.attributes)c.attributes[b]===void 0&&(c.attributes[b]=a.attributes[b])}}return c},_setCurrentGroup:function(c){var a=this._annotationModel,b=null,d=a.getTextModel(),e,f=this._currentGroupAnnotation;if(c!==-1){var g=d.getLineStart(c),h=d.getLineEnd(c);d.getBaseModel&&(g=d.mapOffset(g),
h=d.mapOffset(h));for(e=a.getAnnotations(g,h);e.hasNext();)if(d=e.next(),this.isAnnotationTypeVisible(d.type)&&d.start<=g&&d.end>=h&&d.groupId!==void 0){b=d;break}if(f&&b&&f.groupId===b.groupId)return}this._currentGroupAnnotation=null;f&&a.removeAnnotations(f.groupType);if(b&&c!==-1){this._currentGroupAnnotation=b;e=a.getAnnotations();for(c=[];e.hasNext();)d=e.next(),delete d.groupAnnotation,d.groupId===b.groupId&&(d=d.createGroupAnnotation(),c.push(d));a.replaceAnnotations(null,c)}}};k.AnnotationTypeList.addMixin(d.prototype);
i.prototype=new d;i.prototype.getAnnotations=function(c,a){for(var b=d.prototype.getAnnotations.call(this,c,a),e=this._view.getModel(),f=c;f<a;f++){var g=f&1?this._oddStyle:this._evenStyle,h=f;e.getBaseModel&&(h=e.getLineStart(h),h=e.getBaseModel().getLineAtOffset(e.mapOffset(h)));b[f]||(b[f]={});b[f].html=this._firstLine+h+"";if(!b[f].style)b[f].style=g}return b};i.prototype.getWidestAnnotation=function(){var c=this._view.getModel().getLineCount();return this.getAnnotations(c-1,c)[c-1]};i.prototype.setFirstLine=
function(c){this._firstLine=c!==void 0?c:1};i.prototype._onTextModelChanged=function(c){var c=c.start,a=this._view.getModel(),b=(this._firstLine+(a.getBaseModel?a.getBaseModel().getLineCount():a.getLineCount())-1+"").length;if(this._numOfDigits!==b)this._numOfDigits=b,this._view.redrawLines(a.getLineAtOffset(c),a.getLineCount(),this)};b.prototype=new d;g.prototype=new d;g.prototype.getRulerStyle=function(){var c={style:{lineHeight:"1px",fontSize:"1px"}};return c=this._mergeStyle(c,this._rulerStyle)};
g.prototype._getTooltipContents=function(c,a){if(a.length===0){var b=this._view.getModel(),e=c;b.getBaseModel&&(e=b.getLineStart(e),e=b.getBaseModel().getLineAtOffset(b.mapOffset(e)));return f.formatMessage(h.line,e+1)}return d.prototype._getTooltipContents.call(this,c,a)};g.prototype._mergeAnnotation=function(c,a,b,d){if(b===0){if(!c)c={html:"&nbsp;",style:{style:{height:3*d+"px"}}},c.style=this._mergeStyle(c.style,a.overviewStyle);return c}};e.prototype=new b;e.prototype.onClick=function(c){if(c!==
void 0){var a=this._annotationModel;if(a){var b=this._view.getModel(),d=b.getLineStart(c),c=b.getLineEnd(c,!0);b.getBaseModel&&(d=b.mapOffset(d),c=b.mapOffset(c),b=b.getBaseModel());for(var e,a=a.getAnnotations(d,c);!e&&a.hasNext();)c=a.next(),this.isAnnotationTypeVisible(c.type)&&(e=c);e&&b.getLineAtOffset(e.start)===b.getLineAtOffset(d)&&((b=j.Tooltip.getTooltip(this._view))&&b.setTarget(null),e.expanded?e.collapse():e.expand())}}};e.prototype._getTooltipContents=function(c,a){return a.length===
1&&a[0].expanded?null:b.prototype._getTooltipContents.call(this,c,a)};e.prototype._onAnnotationModelChanged=function(c){function a(a){for(g=0;g<a.length;g++)if(f.isAnnotationTypeVisible(a[g].type)){var c=a[g].start;e.getBaseModel&&(c=e.mapOffset(c,!0));c!==-1&&(i=Math.min(i,e.getLineAtOffset(c)))}}if(c.textModelChangedEvent)b.prototype._onAnnotationModelChanged.call(this,c);else{var d=this._view;if(d){var e=d.getModel(),f=this,g,h=e.getLineCount(),i=h;a(c.added);a(c.removed);a(c.changed);c=d.getRulers();
for(g=0;g<c.length;g++)d.redrawLines(i,h,c[g])}}};return{Ruler:d,AnnotationRuler:b,LineNumberRuler:i,OverviewRuler:g,FoldingRuler:e}});
define("orion/editor/textDND",["orion/util"],function(h){function k(h,f){this._view=h;this._undoStack=f;this._dragSelection=null;this._dropOffset=-1;this._dropText=null;var d=this;this._listener={onDragStart:function(f){d._onDragStart(f)},onDragEnd:function(f){d._onDragEnd(f)},onDragEnter:function(f){d._onDragEnter(f)},onDragOver:function(f){d._onDragOver(f)},onDrop:function(f){d._onDrop(f)},onDestroy:function(f){d._onDestroy(f)}};h.addEventListener("DragStart",this._listener.onDragStart);h.addEventListener("DragEnd",
this._listener.onDragEnd);h.addEventListener("DragEnter",this._listener.onDragEnter);h.addEventListener("DragOver",this._listener.onDragOver);h.addEventListener("Drop",this._listener.onDrop);h.addEventListener("Destroy",this._listener.onDestroy)}k.prototype={destroy:function(){var h=this._view;if(h)h.removeEventListener("DragStart",this._listener.onDragStart),h.removeEventListener("DragEnd",this._listener.onDragEnd),h.removeEventListener("DragEnter",this._listener.onDragEnter),h.removeEventListener("DragOver",
this._listener.onDragOver),h.removeEventListener("Drop",this._listener.onDrop),h.removeEventListener("Destroy",this._listener.onDestroy),this._view=null},_onDestroy:function(){this.destroy()},_onDragStart:function(h){var f=this._view,d=f.getSelection(),f=f.getModel();if(f.getBaseModel)d.start=f.mapOffset(d.start),d.end=f.mapOffset(d.end),f=f.getBaseModel();if(f=f.getText(d.start,d.end))this._dragSelection=d,h.event.dataTransfer.effectAllowed="copyMove",h.event.dataTransfer.setData("Text",f)},_onDragEnd:function(j){if(this._dragSelection){var f=
this._view,d=j.event.dataTransfer.dropEffect;if(!h.isFirefox&&(d!=="none"||this._dropText))d=j.event.dataTransfer.dropEffect=this._dropEffect;this._undoStack&&this._undoStack.startCompoundChange();(j=d==="move")&&f.setText("",this._dragSelection.start,this._dragSelection.end);if(this._dropText){var d=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;f.setText(d,
i,i);f.setSelection(i,i+d.length);this._dropText=null;this._dropOffset=-1}this._undoStack&&this._undoStack.endCompoundChange()}this._dragSelection=null},_onDragEnter:function(h){this._onDragOver(h)},_onDragOver:function(j){var f=j.event.dataTransfer.types,d=!this._view.getOptions("readonly");d&&f&&(d=f.contains?f.contains("text/plain")||f.contains("Text"):f.indexOf("text/plain")!==-1||f.indexOf("Text")!==-1);if(d){if(!h.isFirefox)this._dropEffect=j.event.dataTransfer.dropEffect=(h.isMac?j.event.altKey:
j.event.ctrlKey)?"copy":"move"}else j.event.dataTransfer.dropEffect="none"},_onDrop:function(j){var f=this._view,d=j.event.dataTransfer.getData("Text");if(d){if(!h.isFirefox)j.event.dataTransfer.dropEffect=this._dropEffect;j=f.getOffsetAtLocation(j.x,j.y);this._dragSelection?(this._dropOffset=j,this._dropText=d):(f.setText(d,j,j),f.setSelection(j,j+d.length))}}};return{TextDND:k}});
define("orion/editor/templates",[],function(){function h(h,f,d,i){this.prefix=h;this.description=f;this.template=d;this.name=i;this._parse()}function k(h,f){this._keywords=h||[];this._templates=[];this.addTemplates(f||[])}h.prototype={getProposal:function(h,f,d){var h=f-h.length,f={},i,b=d.delimiter!==void 0?d.delimiter:"\n";d.indentation&&(b+=d.indentation);for(var g=d.tab!==void 0?d.tab:"\t",e=0,c=this.variables,a=this.segments,d=[],k=0;k<a.length;k++){var m=a[k],o=c[m];if(o!==void 0)switch(m){case "${tab}":m=
g;break;case "${delimiter}":m=b;break;case "${cursor}":m="";i=e;break;default:var s=f[m];s||(s=f[m]={data:o.data,positions:[]});m=o.substitution;s.data&&s.data.values&&(m=s.data.values[0]);s.positions.push({offset:h+e,length:m.length})}d.push(m);e+=m.length}var b=[],p;for(p in f)f.hasOwnProperty(p)&&b.push(f[p]);d=d.join("");if(i===void 0)i=d.length;return{proposal:d,name:this.name,description:this.description,groups:b,escapePosition:h+i,style:"noemphasis"}},match:function(h){return this.prefix.indexOf(h)===
0},_parse:function(){var h=this.template,f=[],d={},i,b=0,h=h.replace(/\n/g,"${delimiter}"),h=h.replace(/\t/g,"${tab}");h.replace(/\$\{((?:[^\\}]+|\\.))*\}/g,function(g,e,c){var a=g.substring(2,g.length-1),e=g,k=a,m=null,o=k.indexOf(":");o!==-1&&(k=k.substring(0,o),e="${"+k+"}",m=JSON.parse(a.substring(o+1).replace("\\}","}").trim()));(a=d[e])||(a=d[e]={});a.substitution=k;if(m)a.data=m;(i=h.substring(b,c))&&f.push(i);f.push(e);b=c+g.length;return k});(i=h.substring(b,h.length))&&f.push(i);this.segments=
f;this.variables=d}};k.prototype={addTemplates:function(j){for(var f=this.getTemplates(),d=0;d<j.length;d++)f.push(new h(j[d].prefix,j[d].description,j[d].template,j[d].name))},computeProposals:function(h,f,d){var i=this.getPrefix(h,f,d),b=[];this.isValid(i,h,f,d)&&(b=b.concat(this.getTemplateProposals(i,f,d)),b=b.concat(this.getKeywordProposals(i)));return b},getKeywords:function(){return this._keywords},getKeywordProposals:function(h){var f=[],d=this.getKeywords();if(d){for(var i=0;i<d.length;i++)d[i].indexOf(h)===
0&&f.push({proposal:d[i].substring(h.length),description:d[i],style:"noemphasis_keyword"});0<f.length&&f.splice(0,0,{proposal:"",description:"Keywords",style:"noemphasis_title_keywords",unselectable:!0})}return f},getPrefix:function(h,f,d){return d.prefix},getTemplates:function(){return this._templates},getTemplateProposals:function(h,f,d){for(var i=[],b=this.getTemplates(),g=0;g<b.length;g++){var e=b[g];e.match(h)&&(e=e.getProposal(h,f,d),this.removePrefix(h,e),i.push(e))}0<i.length&&(i.sort(function(c,
a){return c.name<a.name?-1:c.name>a.name?1:0}),i.splice(0,0,{proposal:"",description:"Templates",style:"noemphasis_title",unselectable:!0}));return i},removePrefix:function(h,f){if(!(f.overwrite=f.proposal.substring(0,h.length)!==h))f.proposal=f.proposal.substring(h.length)},isValid:function(){return!0}};return{Template:h,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(h,k,j,f,d,i){function b(b,c,a){var d=b.getTextView();j.KeyMode.call(this,d);this.editor=b;this.undoStack=c;this.contentAssist=a;this.linkedModeModel=null;d.setAction("linkedModeEnter",function(){this.exitLinkedMode(!0);return!0}.bind(this));d.setAction("linkedModeCancel",function(){this.exitLinkedMode(!1);
return!0}.bind(this));d.setAction("linkedModeNextGroup",function(){var a=this.linkedModeModel;this.selectLinkedGroup((a.selectedGroupIndex+1)%a.groups.length);return!0}.bind(this));d.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 c=this.editor.mapOffset(a.start),b=this.linkedModeModel,d,e;b;)if(d=this._getPositionChanged(b,c,c+a.removedCharCount),e=d.position,e===void 0||e.model!==b)this.exitLinkedMode(!1),b=this.linkedModeModel;else break;if(b){b=0;a=a.addedCharCount-a.removedCharCount;d=d.positions;for(var f,g=0;g<d.length;++g){f=d[g];e=f.position;var h=e.offset<=c&&c<=e.offset+e.length;h&&!f.ansestor?(e.offset+=b,
e.length+=a,b+=a):(e.offset+=b,f.ansestor&&h&&(e.length+=a));if(f.escape)f.model.escapePosition=e.offset}this._updateAnnotations(d)}}}.bind(this),onVerify:function(a){if(!this.ignoreVerify){for(var c=this.editor,b=c.mapOffset(a.start),d=this.editor.mapOffset(a.end),e=this.linkedModeModel,f,g;e;)if(f=this._getPositionChanged(e,b,d),g=f.position,g===void 0||g.model!==e)this.exitLinkedMode(!1),e=this.linkedModeModel;else break;if(e){var h=this._compoundChange;h?h.owner.model===e&&h.owner.group===g.group||
(this.endUndo(),this.startUndo()):this.startUndo();e.selectedGroupIndex=g.group;var h=0,i=a.text.length-(d-b);f=f.positions;var j;b-=g.position.offset;for(var k=d-g.position.offset,l=0;l<f.length;++l)if(j=f[l],d=j.position,j.oldOffset=d.offset,j.model===e&&j.group===g.group?(d.offset+=h,d.length+=i,h+=i):(d.offset+=h,j.ansestor&&(d.length+=g.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===g.group&&c.setText(a.text,j.oldOffset+
b,j.oldOffset+k);this.ignoreVerify=!1;a.text=null;this._updateAnnotations(f)}}}.bind(this)}}var g={};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(h.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,d=a.getTextView();d.removeKeyMode(this);d.removeEventListener("Verify",this.linkedModeListener.onVerify);d.removeEventListener("ModelChanged",
this.linkedModeListener.onModelChanged);d=this.contentAssist;d.removeEventListener("Activating",this.linkedModeListener.onActivating);d.offset=void 0;this.editor.reportStatus(h.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 c=this.linkedModeModel;if(c){c.selectedGroupIndex=b;var b=c.groups[b],a=b.positions[0],f=this.editor;f.setSelection(a.offset,a.offset+a.length);if(c=this.contentAssist)if(c.offset=void 0,b.data&&b.data.type==="link"&&b.data.values)(this._groupContentAssistProvider=new d.TemplateContentAssist(b.data.values)).getPrefix=function(){var c=
f.getSelection();return c.start===c.end&&(c=f.getCaretOffset(),a.offset<=c&&c<=a.offset+a.length)?f.getText(a.offset,c):""},c.offset=a.offset,c.deactivate(),c.activate();else if(this._groupContentAssistProvider)this._groupContentAssistProvider=null,c.deactivate()}this._updateAnnotations()},_getModelPositions:function(b,c,a){for(var d=c.groups,f=0;f<d.length;f++)for(var g=d[f].positions,h=0;h<g.length;h++){var i=g[h];a&&(i={offset:i.offset+a,length:i.length});i={index:h,group:f,count:g.length,model:c,
position:i};b.push(i);if(c.nextModel&&c.nextModel.parentGroup===f)i.ansestor=!0,this._getModelPositions(b,c.nextModel,(a||0)+g[h].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,c){return a.position.offset-c.position.offset});this._sortedPositions=c}return c},
_getPositionChanged:function(b,c,a){for(var d,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){d=b[f];break}}return{position:d,positions:b}},_updateAnnotations:function(b){var c=this.editor.getAnnotationModel();if(c){var a=[],d=[];c.getTextModel();for(var g=c.getAnnotations(),h;g.hasNext();)switch(h=g.next(),h.type){case f.AnnotationType.ANNOTATION_LINKED_GROUP:case f.AnnotationType.ANNOTATION_CURRENT_LINKED_GROUP:case f.AnnotationType.ANNOTATION_SELECTED_LINKED_GROUP:a.push(h)}if(g=
this.linkedModeModel)for(var b=b||this._getSortedPositions(g),i=0;i<b.length;i++)if(h=b[i],h.model===g){var j=f.AnnotationType.ANNOTATION_LINKED_GROUP;h.group===g.selectedGroupIndex&&(j=h.index===0?f.AnnotationType.ANNOTATION_SELECTED_LINKED_GROUP:f.AnnotationType.ANNOTATION_CURRENT_LINKED_GROUP);h=h.position;h=f.AnnotationType.createAnnotation(j,h.offset,h.offset+h.length,"");d.push(h)}c.replaceAnnotations(a,d)}}});g.LinkedMode=b;return g});
define("orion/editor/factories","orion/editor/actions,orion/editor/undoStack,orion/editor/rulers,orion/editor/annotations,orion/editor/textDND,orion/editor/linkedMode".split(","),function(h,k,j,f,d,i){function b(){}function g(){}function e(){}function c(){}function a(){}function l(){}var m={};b.prototype={createKeyBindings:function(a,c,b,d){var d=new h.TextActions(a,c,d),e=new i.LinkedMode(a,c,b),a=new h.SourceCodeActions(a,c,b,e);return{textActions:d,linkedMode:e,sourceCodeActions:a}}};m.KeyBindingsFactory=
b;g.prototype={createUndoStack:function(a){a=a.getTextView();return new k.UndoStack(a,200)}};m.UndoFactory=g;e.prototype={createLineNumberRuler:function(a){return new j.LineNumberRuler(a,"left",{styleClass:"ruler lines"},{styleClass:"rulerLines odd"},{styleClass:"rulerLines even"})}};m.LineNumberRulerFactory=e;c.prototype={createFoldingRuler:function(a){return new j.FoldingRuler(a,"left",{styleClass:"ruler folding"})}};m.FoldingRulerFactory=c;a.prototype={createAnnotationModel:function(a){return new f.AnnotationModel(a)},
createAnnotationStyler:function(a,c){return new f.AnnotationStyler(a,c)},createAnnotationRulers:function(a){var c=new j.AnnotationRuler(a,"left",{styleClass:"ruler annotations"}),a=new j.OverviewRuler(a,"right",{styleClass:"ruler overview"});return{annotationRuler:c,overviewRuler:a}}};m.AnnotationFactory=a;l.prototype={createTextDND:function(a,c){return new d.TextDND(a.getTextView(),c)}};m.TextDNDFactory=l;return m});
define("orion/editor/editorFeatures",["orion/editor/factories","orion/editor/actions","orion/editor/linkedMode","orion/objects"],function(h,k,j,f){return f.mixin({},h,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="titleActionContainer">\n\t\t\t<div class="compareActionContainer" id="left_action_id"></div>\n\t\t\t<div class="titleContainer" id="left_title_id"></div>\n\t\t</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="titleActionContainer">\n\t\t\t<div class="compareActionContainer" id="right_action_id"></div>\n\t\t\t<div class="titleContainer" id="right_title_id"></div>\n\t\t</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(h,k,j){var f=f||{};f.TwoWayCompareUIFactory=function(){function d(d){this._parentDivID=d.parentDivID;this._commandSpanId=d.commandSpanId;this._showTitle=d.showTitle;this._leftTitle=d.leftTitle;this._rightTitle=d.rightTitle;this._showLineStatus=d.showLineStatus}d.prototype={_init:function(){var d=this._parentDivID+"_";this._topWidgetDiv=h.node("topWidget_id");
this._topWidgetDiv.id=d+"topWidget_id";this._leftEditorParentDiv=h.node("left_editor_id");this._leftEditorParentDiv.id=d+"left_editor_id";this._rightEditorParentDiv=h.node("right_editor_id");this._rightEditorParentDiv.id=d+"right_editor_id";this._rightEditorWrapperDiv=h.node("right_editor_wrapper_id");this._rightEditorWrapperDiv.id=d+"right_editor_wrapper_id";this._leftActionDiv=h.node("left_action_id");this._leftActionDiv.id=d+"left_action_id";this._rightActionDiv=h.node("right_action_id");this._rightActionDiv.id=
d+"right_action_id";this._leftTitleDiv=h.node("left_title_id");this._leftTitleDiv.id=d+"left_title_id";this._rightTitleDiv=h.node("right_title_id");this._rightTitleDiv.id=d+"right_title_id";this._leftStatusDiv=h.node("left_status_id");this._leftStatusDiv.id=d+"left_status_id";this._rightStatusDiv=h.node("right_status_id");this._rightStatusDiv.id=d+"right_status_id";this._diffCanvasDiv=h.node("diff_canvas_id");this._diffCanvasDiv.id=d+"diff_canvas_id";this._splitterId=d+"orion_splitter";this._showTitle||
this.disableTitle();this._showLineStatus||this.disableLineStatus()},_createSplitter:function(){var d=h.$(".split",this._topWidgetDiv);d.id=this._splitterId;var b=h.$(".leftPanelLayout",this._topWidgetDiv),f=h.$(".rightPanelLayout",this._topWidgetDiv);if(d&&b&&f)this._splitter=new k.Splitter({node:d,sidePanel:b,mainPanel:f})},buildUI:function(){h.node(this._parentDivID).innerHTML=j;this._init();this._createSplitter()},destroy:function(){},getSplitter:function(){return this._splitter},isLeftPane:function(d){return h.$(".leftPanelLayout",
this._topWidgetDiv)===d},getEditorParentDiv:function(d){return d?this._leftEditorParentDiv:this._rightEditorParentDiv},getTitleDiv:function(d){return d?this._leftTitleDiv:this._rightTitleDiv},getActionDivId:function(d){return d?this._leftActionDiv.id:this._rightActionDiv.id},getStatusDiv:function(d){return d?this._leftStatusDiv:this._rightStatusDiv},getCommandSpanId:function(){return this._commandSpanId},getDiffCanvasDiv:function(){return this._diffCanvasDiv},disableTitle:function(){this._leftEditorParentDiv.style.top=
"0px";this._rightEditorWrapperDiv.style.top="0px";this._leftTitleDiv.style.height="0px";this._rightTitleDiv.style.height="0px"},disableLineStatus:function(){this._leftEditorParentDiv.style.marginBottom="0px";this._rightEditorWrapperDiv.style.marginBottom="0px";this._leftStatusDiv.style.height="0px";this._rightStatusDiv.style.height="0px"}};return d}();return f});
var JsDiff=function(){function h(b){for(var d=[],c=0;c<b.length;c++)b[c]&&d.push(b[c]);return d}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,d){if(d==b)return[{value:d}];if(!d)return[{value:b,removed:!0}];if(!b)return[{value:d,added:!0}];var d=this.tokenize(d),b=this.tokenize(b),c=d.length,a=b.length,f=c+a,h=[{newPos:-1,components:[]}],i=this.extractCommon(h[0],
d,b,0);if(h[0].newPos+1>=c&&i+1>=a)return h[0].components;for(var j=1;j<=f;j++)for(var k=-1*j;k<=j;k+=2){var u;u=h[k-1];var v=h[k+1],i=(v?v.newPos:0)-k;u&&(h[k-1]=void 0);var t=u&&u.newPos+1<c,q=v&&0<=i&&i<a;if(!t&&!q)h[k]=void 0;else if(!t||q&&u.newPos<v.newPos?(u={newPos:v.newPos,components:v.components.slice(0)},this.pushComponent(u.components,b[i],void 0,!0)):(u={newPos:u.newPos,components:u.components.slice(0)},u.newPos++,this.pushComponent(u.components,d[u.newPos],!0,void 0)),i=this.extractCommon(u,
d,b,k),u.newPos+1>=c&&i+1>=a)return u.components;else h[k]=u}},pushComponent:function(b,d,c,a){var f=b[b.length-1];f&&f.added===c&&f.removed===a?b[b.length-1]={value:this.join(f.value,d),added:c,removed:a}:b.push({value:d,added:c,removed:a})},extractCommon:function(b,d,c,a){for(var f=d.length,h=c.length,i=b.newPos,a=i-a;i+1<f&&a+1<h&&this.equals(d[i+1],c[a+1]);)i++,a++,this.pushComponent(b.components,d[i],void 0,void 0);b.newPos=i;return a},equals:function(b,d){var c=/\S/;return this.ignoreWhitespace&&
!c.test(b)&&!c.test(d)?!0:b==d},join:function(b,d){return b+d},tokenize:function(b){return b}};var f=new j,d=new j(!1);d.tokenize=function(b){return h(b.split(/(\s+|\b)/))};var i=new j(!0);i.tokenize=function(b){return h(b.split(/([{}:;,]|\s+)/))};var b=new j;b.tokenize=function(b){return b.split(/^/m)};return{diffChars:function(b,d){return f.diff(b,d)},diffWords:function(b,e){return d.diff(b,e)},diffLines:function(d,e){return b.diff(d,e)},diffCss:function(b,d){return i.diff(b,d)},createPatch:function(d,
e,c,a,f){var h=[];h.push("Index: "+d);h.push("===================================================================");h.push("--- "+d+"\t"+a);h.push("+++ "+d+"\t"+f);d=b.diff(e,c);d.push({value:"",lines:[]});for(var c=e=0,a=[],i=f=1,j=0;j<d.length;j++){var k=d[j],u=k.lines||k.value.replace(/\n$/,"").split("\n");k.lines=u;if(k.added||k.removed){if(!e){var v=d[j-1],e=f,c=i;v&&(a.push.apply(a,v.lines.slice(-4).map(function(a){return" "+a})),e-=4,c-=4)}a.push.apply(a,u.map(function(a){return(k.added?"+":
"-")+a}));k.added?i+=u.length:f+=u.length}else e&&(u.length<=8&&j<d.length-1?a.push.apply(a,u.map(function(a){return" "+a})):(v=Math.min(u.length,4),h.push("@@ -"+e+","+(f-e+v)+" +"+c+","+(i-c+v)+" @@"),h.push.apply(h,a),h.push.apply(h,u.slice(0,v).map(function(a){return" "+a})),c=e=0,a=[])),f+=u.length,i+=u.length}d.length>1&&!/\n$/.test(d[d.length-2].value)&&h.push("\\ No newline at end of file\n");return h.join("\n")},convertChangesToXML:function(b){for(var d=[],c=0;c<b.length;c++){var a=b[c];
a.added?d.push("<ins>"):a.removed&&d.push("<del>");d.push(k(a.value));a.added?d.push("</ins>"):a.removed&&d.push("</del>")}return d.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(h){var k=k||{};k.JSDiffAdapter=function(){function j(){}j.prototype={_specialLine:function(f,d,h){return d.value===f&&h!==f},adapt:function(f,d,i){i||(i="\n");for(var b=f.split(i),g=d.split(i),e=b[b.length-1]==="",g=g[g.length-1]==="",c=h.diffLines(f,d),f=[],d=[],a=0,j=0,k=-1,o=0,s=!0,p=i,u=0;u<c.length;u++){var v=c[u],t=v.lines||v.value.split(i),q=t.length,w=0;t.length>1&&t[t.length-1]===""&&q--;q>1&&!s&&t[0]===""&&(q--,w++);v.lines=t;
if(!v.added&&!v.removed){if(!this._specialLine(i,v,p)){if(a||j)f.push([a,j,k]),j=a=0,k=-1,o+=j;f.push([q,q,0]);o+=q}}else if(v.added){k===-1&&(k=d.length+1);a+=q;for(s=w;s<q+w;s++)d.push(v.lines[s])}else j+=q;s=!1;t.length>1&&t[t.length-1]===""&&(s=!0);p=v.value?v.value[v.value.length-1]:i}if(a||j)f.push([a,j,k]),o+=j;o<b.length&&b.length>1&&(i=f[f.length-1],i[2]===0?(i[0]+=1,i[1]+=1):i[2]===-1?f.push([1,1,0]):e===g?f.push([1,1,0]):(g&&(i[0]+=1),e&&(i[1]+=1)));return{mapper:f,changContents:{array:d,
index:0}}},adaptCharDiff:function(f,d,i){for(var f=i?h.diffWords(f,d):h.diffChars(f,d),d=[],b=i=0,g=0,e=0,c=0;c<f.length;c++){var a=f[c];if(!a.added&&!a.removed){if(g>0||e>0)d.push([b,b+g,i,i+e]),b+=g,i+=e,e=g=0;b+=a.value.length;i+=a.value.length}else a.added?g+=a.value.length:e+=a.value.length}(g>0||e>0)&&d.push([b,b+g,i,i+e]);return d}};return j}();return k});
define("orion/compare/diffTreeNavigator",["orion/treeModelIterator","orion/compare/compareUtils","orion/editor/annotations","orion/compare/jsdiffAdapter"],function(h,k,j,f){var d={},i,b,g,e,c,a,l,m,o,s,p,u,v,t,q,w;d.DiffTreeNavigator=function(){function d(a,c,b,e,f,g){this._root={type:"root",children:[]};this._initialized=!1;this.initAll(a,c,b,e,f,g)}i="orion.annotation.diff.addedBlock";b="orion.annotation.diff.currentAddedBlock";g="orion.annotation.diff.deletedBlock";e="orion.annotation.diff.currentDeletedBlock";
c="orion.annotation.diff.blockTop";a="orion.annotation.diff.currentBlockTop";l="orion.annotation.diff.blockConflict";m="orion.annotation.diff.currentBlockConflict";o="orion.annotation.diff.addedWord";s="orion.annotation.diff.currentAddedWord";p="orion.annotation.diff.deletedWord";u="orion.annotation.diff.currentDeletedWord";v="orion.annotation.diff.emptyDeletedWordLeft";t="orion.annotation.diff.emptyDeletedWordRight";q="orion.annotation.diff.emptyAddedWordLeft";w="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(g,{title:"",html:"",lineStyle:{styleClass:"annotationLine deletedBlockDiff"}});j.AnnotationType.registerType(e,{title:"",html:"",lineStyle:{styleClass:"annotationLine currentDeletedBlockDiff"}});j.AnnotationType.registerType(c,{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(m,{title:"",html:"",lineStyle:{styleClass:"annotationLine currentBlockDiffConflict"}});j.AnnotationType.registerType(o,{title:"word added",html:"",rangeStyle:{styleClass:"annotationRange addedWordDiff"}});j.AnnotationType.registerType(s,{title:"",
html:"",rangeStyle:{styleClass:"annotationRange currentAddedWordDiff"}});j.AnnotationType.registerType(p,{title:"word deleted",html:"",rangeStyle:{styleClass:"annotationRange deletedWordDiff"}});j.AnnotationType.registerType(u,{title:"",html:"",rangeStyle:{styleClass:"annotationRange currentDeletedWordDiff"}});j.AnnotationType.registerType(v,{title:"",html:"",rangeStyle:{styleClass:"annotationRange emptyDeletedWordDiffLeft"}});j.AnnotationType.registerType(t,{title:"",html:"",rangeStyle:{styleClass:"annotationRange emptyDeletedWordDiffRight"}});
j.AnnotationType.registerType(q,{title:"",html:"",rangeStyle:{styleClass:"annotationRange emptyAddedWordDiffLeft"}});j.AnnotationType.registerType(w,{title:"",html:"",rangeStyle:{styleClass:"annotationRange emptyAddedWordDiffRight"}});d.prototype={initAll:function(a,c,b,d,e,f,g){this._charOrWordDiff=a?a:"word";if(c)this._initialized=!0;this.editorWrapper=[{editor:c,diffFeeder:d},{editor:b,diffFeeder:e}];this._curveRuler=g;(this._overviewRuler=f)&&this._overviewRuler.setDiffNavigator(this)},initMapper:function(a){if(a)for(var c=
0;c<this.editorWrapper.length;c++)this.editorWrapper[c].diffFeeder.init(this.editorWrapper[c].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 c=0;c<this.editorWrapper[a].annoTypes.length;c++)this.editorWrapper[a].annoTypes[c].current&&
this.editorWrapper[a].editor.getAnnotationStyler().addAnnotationType(this.editorWrapper[a].annoTypes[c].current),this.editorWrapper[a].annoTypes[c].normal&&this.editorWrapper[a].editor.getAnnotationStyler().addAnnotationType(this.editorWrapper[a].annoTypes[c].normal)}this._root.children=[];c=this.editorWrapper[0].diffFeeder.getDiffBlocks();if(!c||c.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 b=new f.JSDiffAdapter;for(a=0;a<c.length;a++){var d=this.generatePairBlockAnnotations(this._root,a);this._root.children.push(d);var e=this.generatePairWordAnnotations(d,a,b);if(e)d.children=e}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 h.TreeModelIterator(this._root.children)}},replaceAllAnnotations:function(a,c,b,d,e){if(this.editorWrapper[c].annoTypes)for(var f=0;f<this.editorWrapper[c].annoTypes.length;f++)this.editorWrapper[c].annoTypes[f].type===b&&this.replaceDiffAnnotations(this.editorWrapper[c].editor,e?e:this.editorWrapper[c].annoTypes[f].list,d?this.editorWrapper[c].annoTypes[f].normal:this.editorWrapper[c].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,c){this.iterator&&(this.iterator.iterateOnTop(a,c),this.updateCurrentAnnotation(!0))},iterateOnChange:function(a){if(!this.iterator)return null;var c=this.iterator.iterate(a);if(c){var b=this.iterator.cursor();b.type==="block"&&b.children&&b.children.length>0&&this.iterator.iterate(a);this.updateCurrentAnnotation(!0)}return c},
gotoBlock:function(a,c){if(this.iterator){if(a<0||a>=this._root.children.length||this._root.children.length===0)a=0;c!==void 0&&c>=0&&this._root.children[a].children&&c<this._root.children[a].children.length?this.iterator.setCursor(this._root.children[a].children[c]):this.iterator.setCursor(this._root.children[a]);this.updateCurrentAnnotation(!1);this._positionDiffBlock()}},_hitDiffAnnotation:function(a,c,b){if(b===this.editorWrapper[a].editor.getTextView()){for(var d=0;d<this._root.children.length;d++){var b=
this._root.children[d],e=a===0?b.oldA:b.newA;if(c>=e.start&&c<=e.end){d=b;if(b.children&&b.children.length>0)for(e=0;e<b.children.length;e++){var f=b.children[e],g=a===0?f.oldA:f.newA;if(c>=g.start&&c<=g.end){d=f;break}}return d}}return null}},gotoChange:function(a,c){for(var b=0;b<this.editorWrapper.length;b++){var d=this._hitDiffAnnotation(b,a,c);if(d)return this.iterator.setCursor(d),this.updateCurrentAnnotation(!1,c),!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 c=this.getFeeder().getDiffBlocks();if(!c||c.length===0)return-1;a>c.length-1&&(a=0);return c[a][1]},replaceDiffAnnotations:function(a,c,b,d){if(c&&b&&(a=a.getAnnotationModel())){for(var e=
a.getAnnotations(),f=[];d&&e.hasNext();){var g=e.next();g.type===b&&f.push(g)}a.replaceAnnotations(f,c)}},updateCurrentAnnotation:function(a,c){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 b=this.iterator.cursor();if(b){var d,e,f={start:b.oldA.start,end:b.oldA.end},g={start:b.newA.start,end:b.newA.end};b.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(b.index),e=this.editorWrapper[1].diffFeeder.getCurrentBlockAnnoType(b.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(b.oldA.start,b.oldA.end,!0),this.editorWrapper[1].editor.setSelection(b.newA.start,b.newA.end,!0),this.autoSelecting=!1;else if(c)this.autoSelecting=!0,c!==this.editorWrapper[0].editor.getTextView()&&this.editorWrapper[0].editor.setSelection(b.oldA.start,b.oldA.end,!0),c!==this.editorWrapper[1].editor.getTextView()&&this.editorWrapper[1].editor.setSelection(b.newA.start,b.newA.end,!0),this.autoSelecting=!1}}},generatePairBlockAnnotations:function(a,
c){var b=this.generateBlockDiffAnnotations(0,c),d=this.generateBlockDiffAnnotations(1,c);return{parent:a,index:c,type:"block",oldA:b,newA:d}},generatePairWordAnnotations:function(a,c,b){var d=this.editorWrapper[0].diffFeeder.getTextOnBlock(c),e=this.editorWrapper[1].diffFeeder.getTextOnBlock(c),c=null,f=0,g=0;if(d&&e&&d.text&&e.text&&d.text.length<=5E3&&e.text.length<=5E3)c=b.adaptCharDiff(d.text,e.text,this._charOrWordDiff==="word"),g=e.start,f=d.start;else return null;b=[];d=[];this.generateWordDiffAnnotations(0,
b,f,c,2,3);this.generateWordDiffAnnotations(1,d,g,c,0,1);c=[];for(f=0;f<b.length;f++)c.push({parent:a,index:f,type:"word",oldA:b[f],newA:d[f]});return c},getAnnoModelList:function(a,c,b){for(var d=0;d<this.editorWrapper[a].annoTypes.length;d++)if(this.editorWrapper[a].annoTypes[d].type===c&&this.editorWrapper[a].annoTypes[d].normal===b)return this.editorWrapper[a].annoTypes[d].list;return null},generateBlockDiffAnnotations:function(a,c){var b=this.editorWrapper[a].diffFeeder.getCurrentBlockAnnoType(c),
d=this.getAnnoModelList(a,"block",b.normal),e=this.editorWrapper[a].diffFeeder.getCharRange(c),b=j.AnnotationType.createAnnotation(b.normal,e.start,e.end);d&&d.push(b);return b},generateWordDiffAnnotations:function(a,c,b,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]+b,d[h][f]+b);a.push(i);c.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,c){var b=a.getLineHeight(),d=a.getClientArea(),b=Math.floor(d.height/b/3);a.setTopIndex(c-b>0?c-b:0)},_positionDiffBlock:function(){var a=this.getCurrentBlockIndex();a<0&&(a=0);var c=this.getFeeder().getDiffBlocks();c.length!==0&&(this._setTextViewPosition(this.editorWrapper[0].editor.getTextView(),
c[a][0]),this.editorWrapper[0].editor!==this.editorWrapper[1].editor&&(a=k.lookUpLineIndex(this.getMapper(),0,c[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,c){this.gotoChange(a,c)&&(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 d}();d.DiffBlockFeeder=function(){function a(){}a.prototype={_isAddedSide:function(){return this._mapperColumnIndex===0},getWordAnnoTypes:function(a){this._isAddedSide()?a.push({type:"word",current:s,normal:o,list:[]}):a.push({type:"word",
current:u,normal:p,list:[]});a.push({type:"word",current:v});a.push({type:"word",current:t});a.push({type:"word",current:q});a.push({type:"word",current:w})},getCurrentWordAnnoType:function(a,c){return a.start===a.end&&c?this._isAddedSide()?{current:this._repositionEmptyWord(a,c),normal:o}:{current:this._repositionEmptyWord(a,c),normal:p}:this._isAddedSide()?{current:s,normal:o}:{current:u,normal:p}},_repositionEmptyWord:function(a,c){var b=c.getLineAtOffset(a.start),d=c.getLineStart(b),e=c.getLineEnd(b);
if(d!==e){if(a.start===e)return a.start--,this._isAddedSide()?w:t;a.end++}else if(b>0&&(b--,d=c.getLineStart(b),e=c.getLineEnd(b),d!==e))return a.start=e-1,a.end=e,this._isAddedSide()?w:t;return this._isAddedSide()?q:v},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 c=this._diffBlocks[a][0],b=c+this._mapper[this._diffBlocks[a][1]][this._mapperColumnIndex]-1,a=this._textModel.getLineStart(c);if(b<c)return{start:a,end:a};c=this._textModel.getLineEnd(b,!0);return{start:a,end:c}},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}();d.TwoWayDiffBlockFeeder=function(){function f(a,c,b,d){this._mapperColumnIndex=b;this._reverseAnnotation=d;this.init(a,c)}f.prototype=new d.DiffBlockFeeder;f.prototype._isAddedSide=function(){return this._reverseAnnotation?this._mapperColumnIndex!==0:this._mapperColumnIndex===0};f.prototype.init=function(a,c){this._textModel=a;this._diffBlocks=void 0;if(c){this._mapper=c;this._diffBlocks=[];for(var b=0,d=0;d<this._mapper.length;d++)this._mapper[d][2]!==
0&&this._diffBlocks.push([b,d]),b+=this._mapper[d][this._mapperColumnIndex]}};f.prototype.getBlockAnnoTypes=function(d){this._isAddedSide()?d.push({type:"block",normal:i,current:b,list:[]}):d.push({type:"block",normal:g,current:e,list:[]});d.push({type:"block",normal:c,current:a,list:[]});d.push({type:"block",normal:l,current:m,list:[]})};f.prototype.getCurrentBlockAnnoType=function(d){if(!this._diffBlocks||this._diffBlocks.length===0||this._diffBlocks.length<=d)return null;d=this._diffBlocks[d][1];
if(this._mapper[d][this._mapperColumnIndex]===0)return{normal:c,current:a};else if(k.isMapperConflict(this.getMapper(),d))return{normal:l,current:m};else if(this._isAddedSide())return{type:"block",normal:i,current:b,list:[]};return{type:"block",normal:g,current:e,list:[]}};return f}();d.inlineDiffBlockFeeder=function(){function a(c,b){this._mapperColumnIndex=b;this.init(c)}a.prototype=new d.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 c=a=0,b=0;b<this._mapper.length;b++){if(this._mapper[b][2]!==0){if(this._isAddedSide()){var d=a+this._mapper[b][1];this._diffBlocks.push([d,b]);this._gapBlocks.push([d,d+this._mapper[b][0],c])}else this._diffBlocks.push([a,b]),this._gapBlocks.push([a,a+this._mapper[b][1],c]);a+=this._mapper[b][0]+this._mapper[b][1]}else this._gapBlocks.push([a,a+this._mapper[b][this._mapperColumnIndex],c]),a+=this._mapper[b][this._mapperColumnIndex];
c+=this._mapper[b][this._mapperColumnIndex]}}};a.prototype.getBlockAnnoTypes=function(a){this._isAddedSide()?a.push({type:"block",normal:i,current:b,list:[]}):a.push({type:"block",normal:g,current:e,list:[]});a.push({type:"block",normal:l,current:m,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:s,normal:o};else if(k.isMapperConflict(this.getMapper(),
a))return{normal:l,current:m};else if(this._isAddedSide())return{type:"block",normal:i,current:b,list:[]};return{type:"block",normal:g,current:e,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 c=0;c<this._gapBlocks.length;c++)if(this._gapBlocks[c][0]!==this._gapBlocks[c][1]&&a>=this._gapBlocks[c][0]&&a<this._gapBlocks[c][1])return a-
this._gapBlocks[c][0]+this._gapBlocks[c][2];return-1};return a}();return d});
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(h,k,j,f,d,i,b,g,e,c,a,l,m){var o={};o.CompareView=function(){function a(){this._diffParser=new f.DiffParser}a.prototype=
{_clearOptions:function(){this.options={};this.options.blockNumber=1;this.options.changeNumber=0},_getLineDelim:function(){return"\n"},_generateMapper:function(a,c,b,d,e){var f=this._getLineDelim(a,b);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 c==="string"&&typeof a==="string"){a=(new l.JSDiffAdapter).adapt(a,c,f);if(this.options.toggler)this.options.mapper=
a.mapper,this.options.newFile.Content=c,this.options.diffArray=a.changContents;return{delim:f,mapper:a.mapper,output:c,diffArray:a.changContents}}else{c=this._diffParser.parse(a,b,d,e);a=this._diffParser.getDiffArray();if(this.options.toggler)this.options.mapper=c.mapper,this.options.newFile.Content=c.outPutFile,this.options.diffArray=a;return{delim:f,mapper:c.mapper,output:c.outPutFile,diffArray:a}}},_loadImageFile:function(a,c,b){var d=document.createElement("img");d.src=a;var e=new k;d.onload=
function(){c.appendChild(d);if(b){var a=document.createElement("hr");c.appendChild(a)}e.resolve(d.height)};d.onerror=function(){e.resolve(0)};return e},_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(c){a.push(c.highlighter.highlight(c.target.fileName,c.target.contentType,c.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,c){c&&this._clearOptions();if(!this.options)this.options={};a&&Object.keys(a).forEach(function(c){this.options[c]=a[c]}.bind(this));if(a.newFileOnRight){var b=this.options.newFile;this.options.newFile=this.options.oldFile;this.options.oldFile=b}},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(){},initImageMode:function(){}};return a}();o.TwoWayCompareView=function(){function a(b){this.setOptions(b,!0);this._diffNavigator=new m.DiffTreeNavigator("word");this.type="twoWay";this._uiFactory=this.options.uiFactory;
if(!this._uiFactory)this._uiFactory=new c.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 d.CompareCurveRuler(this._uiFactory.getDiffCanvasDiv())}a.prototype=new o.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 d.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 h["There are unsaved changes."]}.bind(this)};
a.prototype.initImageMode=function(){if(this._editors)this._editors.forEach(function(a){a.destroy()}),this._editors=null;this._uiFactory.getEditorParentDiv(!0).classList.add("compareEditorParentImageMode");this._uiFactory.getEditorParentDiv().classList.add("compareEditorParentImageMode");this._uiFactory.disableTitle();this._uiFactory.disableLineStatus();this._imageMode=!0};a.prototype.getImageMode=function(){return this._imageMode};a.prototype.getEditors=function(){return this._editors};a.prototype.gotoDiff=
function(a,c,b){b=b?this._editors[1].getTextView():this._editors[0].getTextView();this._diffNavigator.gotoDiff(b.getModel().getLineStart(a)+c,b)};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,f,g){var j=typeof f.readonly===
"undefined"?!0:f.readonly,k=function(){var a=new e.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(c){if(c){var b=!1;(b=this._uiFactory.isLeftPane(c)?g:!g)&&a.resize()}}.bind(this));return a}.bind(this),l=f.keyBindingFactory;l||(l=new b.KeyBindingsFactory);var m=null;if(d)var z="",m=function(a,c){if(d)z=c?h["ERROR: "]+
a:a,d.textContent=""+z};k=new i.Editor({textViewFactory:k,undoStackFactory:new b.UndoFactory,annotationFactory:new b.AnnotationFactory,keyBindingFactory:l,statusReporter:m,domNode:c});k.installTextView();k.setInput(null,null,f.Content?f.Content:a);k.setOverviewRulerVisible(!1);var o=k.getTextView();o.addEventListener("Selection",function(a){a.newValue&&a.newValue.start!==a.newValue.end||!this._diffNavigator.autoSelecting&&this._diffNavigator.editorWrapper[0].diffFeeder&&this._diffNavigator.gotoDiff(o.getCaretOffset(),
o)}.bind(this));o.getModel().addEventListener("Changed",function(a){if(!this._curveRuler.onChanged(a,!g))this.options.mapper=null}.bind(this));g?o.addEventListener("Scroll",function(){this._curveRuler&&(this._curveRuler.matchPositionFrom(!0),this._curveRuler.render());if(this.onScroll)this.onScroll()}.bind(this)):o.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 d.LineNumberCompareRuler(this._diffNavigator,0,"left",{styleClass:"ruler lines"},{styleClass:"rulerLines odd"},{styleClass:"rulerLines even"}),c=new d.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(c);this._editors[0].getTextView().addRuler(this._overviewRuler);
this._hasRuler=!0}};a.prototype.refresh=function(a){if(this._imageMode){this.options.commandProvider&&this.options.commandProvider.renderCommands(this);var c=this;return this._loadImageFile(this.options.newFile.URL,this._uiFactory.getEditorParentDiv(!0)).then(function(a){return c._loadImageFile(c.options.oldFile.URL,c._uiFactory.getEditorParentDiv()).then(function(c){return(new k).resolve(a>c?a:c)})})}var b=this.options.oldFile.Content,d=this.options.newFile.Content,e=this.options.diffContent;typeof d===
"string"?e=this._generateMapper(b,d,e,this.options.hasConflicts):(e=this._generateMapper(b,d,e,this.options.hasConflicts),d=e.output);var f=new m.TwoWayDiffBlockFeeder(this._editors[0].getTextView().getModel(),e.mapper,1,this.options.newFileOnRight),g=new m.TwoWayDiffBlockFeeder(this._editors[1].getTextView().getModel(),e.mapper,0,this.options.newFileOnRight);this._diffNavigator.initAll(this.options.charDiff?"char":"word",this._editors[0],this._editors[1],f,g,this._overviewRuler,this._curveRuler);
this._curveRuler.init(e.mapper,this._editors[1],this._editors[0],this._diffNavigator);a&&(this._editors[1].setInput(this.options.newFile.Name,null,d),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);this.refreshTitle(0);this.refreshTitle(1);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};a.prototype.refreshTitle=function(a,c){if(a===1){var b=this._uiFactory.getTitleDiv(!0);b&&(j.empty(b),
b.appendChild(document.createTextNode(c||this._editors[a].isDirty()?this.options.newFile.Name+"*":this.options.newFile.Name)))}else if(b=this._uiFactory.getTitleDiv(!1))j.empty(b),b.appendChild(document.createTextNode(c||this._editors[a].isDirty()?this.options.oldFile.Name+"*":this.options.oldFile.Name))};return a}();o.InlineCompareView=function(){function c(a){this.setOptions(a,!0);this._diffNavigator=new m.DiffTreeNavigator("word");this.type="inline";this.options.commandProvider&&this.options.commandProvider.initCommands(this);
this._editorDiv=this.options.parentDivId}c.prototype=new o.CompareView;c.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};c.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};c.prototype.destroyEditor=function(){this._textView&&(this._diffNavigator.destroy(),this._textView.setText(""),this.removeRulers())};c.prototype.destroy=function(){this._textView&&(this._diffNavigator.destroy(),this._textView.destroy())};c.prototype.initEditors=function(a){var c=j.node(this._editorDiv),f=function(){return new e.TextView({parent:c,readonly:!0,tabSize:4})}.bind(this);this._editor=new i.Editor({textViewFactory:f,undoStackFactory:new b.UndoFactory,annotationFactory:new b.AnnotationFactory,
domNode:c});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 d.LineNumberCompareRuler(this._diffNavigator,1,"left",{styleClass:"ruler lines inlineRulerLeft"},{styleClass:"rulerLines odd"},{styleClass:"rulerLines even"});this._rulerNew=new d.LineNumberCompareRuler(this._diffNavigator,0,"left",{styleClass:"ruler lines"},{styleClass:"rulerLines odd"},
{styleClass:"rulerLines even"});this._overviewRuler=new d.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))};c.prototype.initImageMode=
function(){if(this._editor)this._editor.destroy(),this._editor=null;j.node(this._editorDiv).classList.add("compareEditorParentImageMode");this._imageMode=!0};c.prototype.getImageMode=function(){return this._imageMode};c.prototype._initDiffPosition=function(a){var c=a.getModel();if(c&&c.getAnnotations&&(c=c.getAnnotations(),c.length>0)){var c=c[0][0],b=a.getLineHeight(),d=a.getClientArea(),b=Math.floor(d.height/b/3);a.setTopIndex(c-b>0?c-b:0)}};c.prototype.refresh=function(){if(this._imageMode){this.options.commandProvider&&
this.options.commandProvider.renderCommands(this);var c=this;return this._loadImageFile(this.options.newFile.URL,j.node(this._editorDiv),!0).then(function(a){return c._loadImageFile(c.options.oldFile.URL,j.node(c._editorDiv)).then(function(c){return(new k).resolve(a+c+20)})})}var b=this.options.oldFile.Content,d=this.options.newFile.Content,e=this._generateMapper(b,d,this.options.diffContent,this.options.hasConflicts,!this.options.toggler);if(typeof d!=="string")d=e.output;this._textView.getModel().setText(b);
b=new m.inlineDiffBlockFeeder(e.mapper,1);d=new m.inlineDiffBlockFeeder(e.mapper,0);a.mergeDiffBlocks(this._textView.getModel(),d.getDiffBlocks(),e.mapper,e.diffArray.array,e.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();e=this._textView.getTopIndex();this._textView.redrawLines(e,e+1,this._overviewRuler);this._textView.redrawLines(e,e+1,this._rulerOrigin);this._textView.redrawLines(e,e+1,this._rulerNew);this._diffNavigator.gotoBlock(this.options.blockNumber-1,this.options.changeNumber-1);return this._textView.getLineHeight()*this._textView.getModel().getLineCount()+5};c.prototype.setConflicting=
function(a){this._conflcit=a};return c}();o.toggleableCompareView=function(){function a(c,b){if(b)b.toggler=this;this._widget=c==="inline"?new o.InlineCompareView(b):new o.TwoWayCompareView(b)}a.prototype={startup:function(){this._widget.startup()},initImageMode:function(){this._imageMode=!0;this._widget.initImageMode()},toggle:function(){var a=this._widget.options;if(!this._imageMode){var c=this._widget.getCurrentDiffPos();a.blockNumber=c.block;a.changeNumber=c.change}this._widget.destroy();j.empty(j.node(a.parentDivId));
this._widget=this._widget.type==="inline"?new o.TwoWayCompareView(a):new o.InlineCompareView(a);this._imageMode?this._widget.initImageMode():this._widget.initEditors();this._widget.refresh(!0)},getWidget:function(){return this._widget}};return a}();return o});
define("orion/editor/stylers/lib/syntax",[],function(){return{id:"orion.lib",grammars:[{id:"orion.lib",patterns:[{include:"#brace_open"},{include:"#brace_close"},{include:"#bracket_open"},{include:"#bracket_close"},{include:"#parenthesis_open"},{include:"#parenthesis_close"},{include:"#number_decimal"},{include:"#number_hex"},{include:"#string_doubleQuote"},{include:"#string_singleQuote"}],repository:{brace_open:{match:"{",name:"punctuation.section.block.begin"},brace_close:{match:"}",name:"punctuation.section.block.end"},
bracket_open:{match:"\\[",name:"punctuation.section.bracket.begin"},bracket_close:{match:"\\]",name:"punctuation.section.bracket.end"},parenthesis_open:{match:"\\(",name:"punctuation.section.parens.begin"},parenthesis_close:{match:"\\)",name:"punctuation.section.parens.end"},doc_block:{begin:"/\\*\\*",end:"\\*/",name:"comment.block.documentation",patterns:[{match:"@(?:(?!\\*/)\\S)*",name:"keyword.other.documentation.tag"},{match:"\\<\\S*\\>",name:"keyword.other.documentation.markup"},{match:"(\\b)(TODO)(\\b)(((?!\\*/).)*)",
name:"meta.annotation.task.todo",captures:{2:{name:"keyword.other.documentation.task"},4:{name:"comment.block"}}}]},number_decimal:{match:"\\b-?(?:\\.\\d+|\\d+\\.?\\d*)(?:[eE][+-]?\\d+)?\\b",name:"constant.numeric.number"},number_hex:{match:"\\b0[xX][0-9A-Fa-f]+\\b",name:"constant.numeric.hex"},string_doubleQuote:{match:'"(?:\\\\.|[^"])*"?',name:"string.quoted.double"},string_singleQuote:{match:"'(?:\\\\.|[^'])*'?",name:"string.quoted.single"},todo_comment_singleLine:{match:"(\\b)(TODO)(\\b)(.*)",
name:"meta.annotation.task.todo",captures:{2:{name:"keyword.other.documentation.task"},4:{name:"comment.line"}}}}},{id:"orion.c-like",patterns:[{include:"orion.lib"},{include:"#comment_singleLine"},{include:"#comment_block"}],repository:{comment_singleLine:{match:"//.*",name:"comment.line.double-slash",patterns:[{include:"orion.lib#todo_comment_singleLine"}]},comment_block:{begin:"/\\*",end:"\\*/",name:"comment.block",patterns:[{match:"(\\b)(TODO)(\\b)(((?!\\*/).)*)",name:"meta.annotation.task.todo",
captures:{2:{name:"keyword.other.documentation.task"},4:{name:"comment.block"}}}]}}}],keywords:[]}});
define("orion/editor/stylers/application_javascript/syntax",["orion/editor/stylers/lib/syntax"],function(h){var k="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(","),h=h.grammars;h.push({id:"orion.js",contentTypes:["application/javascript"],patterns:[{include:"orion.lib#doc_block"},
{include:"orion.c-like"},{match:"\\b(?:"+k.join("|")+")\\b",name:"keyword.control.js"},{match:"/(?![\\s])(?:\\\\.|[^/])+/(?:[gim]{0,3})",name:"string.regexp.js"},{begin:"'(?:\\\\.|[^\\\\'])*\\\\$",end:"^(?:$|(?:\\\\.|[^\\\\'])*('|[^\\\\]$))",name:"string.quoted.single.js"},{begin:'"(?:\\\\.|[^\\\\"])*\\\\$',end:'^(?:$|(?:\\\\.|[^\\\\"])*("|[^\\\\]$))',name:"string.quoted.double.js"}]});return{id:h[h.length-1].id,grammars:h,keywords:k}});
define("orion/editor/stylers/text_x-java-source/syntax",["orion/editor/stylers/lib/syntax"],function(h){var k="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(","),h=h.grammars;h.push({id:"orion.java",contentTypes:["text/x-java-source"],
patterns:[{include:"orion.lib#doc_block"},{include:"orion.c-like"},{match:"\\b(?:"+k.join("|")+")\\b",name:"keyword.control.java"}],repository:{string_singleQuote:{}}});return{id:h[h.length-1].id,grammars:h,keywords:k}});
define("orion/editor/stylers/text_css/syntax",["orion/editor/stylers/lib/syntax"],function(h){var k="alignment-adjust,alignment-baseline,animation-delay,animation-direction,animation-duration,animation-iteration-count,animation-name,animation-play-state,animation-timing-function,animation,appearance,azimuth,backface-visibility,background-attachment,background-clip,background-color,background-image,background-origin,background-position,background-repeat,background-size,background,baseline-shift,binding,bleed,bookmark-label,bookmark-level,bookmark-state,bookmark-target,border-bottom-color,border-bottom-left-radius,border-bottom-right-radius,border-bottom-style,border-bottom-width,border-bottom,border-collapse,border-color,border-image-outset,border-image-repeat,border-image-slice,border-image-source,border-image-width,border-image,border-left-color,border-left-style,border-left-width,border-left,border-radius,border-right-color,border-right-style,border-right-width,border-right,border-spacing,border-style,border-top-color,border-top-left-radius,border-top-right-radius,border-top-style,border-top-width,border-top,border-width,border,bottom,box-align,box-decoration-break,box-direction,box-flex-group,box-flex,box-lines,box-ordinal-group,box-orient,box-pack,box-shadow,box-sizing,break-after,break-before,break-inside,caption-side,clear,clip,color-profile,color,column-count,column-fill,column-gap,column-rule-color,column-rule-style,column-rule-width,column-rule,column-span,column-width,columns,content,counter-increment,counter-reset,crop,cue-after,cue-before,cue,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-position,fit,flex-align,flex-flow,flex-inline-pack,flex-order,flex-pack,float-offset,float,font-family,font-size,font-size-adjust,font-stretch,font-style,font-variant,font-weight,font,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-ruby,line-stacking-shift,line-stacking-strategy,line-stacking,list-style-image,list-style-position,list-style-type,list-style,margin-bottom,margin-left,margin-right,margin-top,margin,mark-after,mark-before,mark,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-color,outline-offset,outline-style,outline-width,outline,overflow-style,overflow-x,overflow-y,overflow,padding-bottom,padding-left,padding-right,padding-top,padding,page-break-after,page-break-before,page-break-inside,page-policy,page,pause-after,pause-before,pause,perspective-origin,perspective,phonemes,pitch-range,pitch,play-during,position,presentation-level,punctuation-trim,quotes,rendering-intent,resize,rest-after,rest-before,rest,richness,right,rotation-point,rotation,ruby-align,ruby-overhang,ruby-position,ruby-span,size,speak-header,speak-numeral,speak-punctuation,speak,speech-rate,stress,string-set,table-layout,target-name,target-new,target-position,target,text-align-last,text-align,text-decoration,text-emphasis,text-height,text-indent,text-justify,text-outline,text-shadow,text-transform,text-wrap,top,transform-origin,transform-style,transform,transition-delay,transition-duration,transition-property,transition-timing-function,transition,unicode-bidi,vertical-align,visibility,voice-balance,voice-duration,voice-family,voice-pitch-range,voice-pitch,voice-rate,voice-stress,voice-volume,volume,white-space-collapse,white-space,widows,width,word-break,word-spacing,word-wrap,z-index".split(","),h=
h.grammars;h.push({id:"orion.css",contentTypes:["text/css"],patterns:[{include:"orion.lib"},{include:"orion.c-like#comment_block"},{match:"(?:-webkit-|-moz-|-ms-|\\b)(?:"+k.join("|")+")\\b",name:"keyword.control.css"},{match:"(?i)\\b-?(?:\\.\\d+|\\d+\\.?\\d*)(?:%|em|ex|ch|rem|vw|vh|vmin|vmax|in|cm|mm|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?\\b",name:"constant.numeric.value.css"},{begin:"(['\"])(?:\\\\.|[^\\\\\\1])*\\\\$",end:"^(?:$|(?:\\\\.|[^\\\\\\1])*(\\1|[^\\\\]$))",name:"string.quoted.multiline.css"}],
repository:{number_hex:{match:"#[0-9A-Fa-f]+\\b",name:"constant.numeric.hex.css"}}});return{id:h[h.length-1].id,grammars:h,keywords:k}});
define("examples/editor/textStyler",["orion/editor/annotations","orion/editor/stylers/application_javascript/syntax","orion/editor/stylers/text_x-java-source/syntax","orion/editor/stylers/text_css/syntax"],function(h,k,j,f){function d(a,c){this.keywords=a;this.whitespacesVisible=c;this.setText("")}function i(){d.call(this,null,!0)}function b(a){d.call(this,null,a)}function g(){d.call(this,null,!1)}function e(e,f,h){this.commentStart="/*";this.commentEnd="*/";var j=[];switch(f){case "java":j=a;break;
case "js":j=c;break;case "css":j=l}this.whitespacesVisible=this.spacesVisible=this.tabsVisible=!1;this.detectHyperlinks=!0;this.highlightCaretLine=!1;this.detectTasks=this.foldingEnabled=!0;this._scanner=new d(j,this.whitespacesVisible);this._firstScanner=new g;this._commentScanner=new b(this.whitespacesVisible);this._whitespaceScanner=new i;if(f==="css")this._scanner.isCSS=!0,this._firstScanner.isCSS=!0;this.view=e;this.annotationModel=h;this._bracketAnnotations=void 0;var k=this;this._listener=
{onChanged:function(a){k._onModelChanged(a)},onDestroy:function(a){k._onDestroy(a)},onLineStyle:function(a){k._onLineStyle(a)},onMouseDown:function(a){k._onMouseDown(a)},onSelection:function(a){k._onSelection(a)}};f=e.getModel();f.getBaseModel&&(f=f.getBaseModel());f.addEventListener("Changed",this._listener.onChanged);e.addEventListener("MouseDown",this._listener.onMouseDown);e.addEventListener("Selection",this._listener.onSelection);e.addEventListener("Destroy",this._listener.onDestroy);e.addEventListener("LineStyle",
this._listener.onLineStyle);this._computeComments();this._computeFolding();e.redrawLines()}var c=k.keywords,a=j.keywords,l=f.keywords,m={styleClass:"comment"},o={styleClass:"comment"},s={styleClass:"comment block documentation"},p={styleClass:"keyword other documentation markup"},u={styleClass:"keyword other documentation task"},v={styleClass:"keyword other documentation tag"},t={styleClass:"string"},q={styleClass:"constant numeric"},w={styleClass:"keyword"},n={styleClass:"punctuation separator space",
unmergeable:!0},r={styleClass:"punctuation separator tab",unmergeable:!0},x={styleClass:"meta annotation currentLine"};d.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 c=this.isCSS,b=this.offset-1;if(!c&&48<=a&&a<=57){var d=c=!1,e=!1,f=a;do if(a=this._read(),a===46&&!c)c=!0;else if(a===101&&!d)c=d=!0,a=this._read(),a!==45&&this._unread(a);else if(a===120&&f===48&&this.offset-b===2)c=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&&c){do a=this._read();while(97<=a&&
a<=122||65<=a&&a<=90||a===95||48<=a&&a<=57||45===a&&c);this._unread(a);a=this.keywords;if(a.length>0){b=this.text.substring(b,this.offset);for(c=0;c<a.length;c++)if(this.keywords[c]===b)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(),c;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();c=7;for(a===42&&(c=8);;){for(;a===42;)if(a=this._read(),a===47)return c;if(a===-1)return this._unread(a),c;a=this._read()}}this._unread(a);return 1;case 39:for(c=4;;)switch(a=this._read(),a){case 39:return c;case 13:case 10:case -1:return this._unread(a),c;case 92:switch(a=this._read(),a){case 10:c=5;break;case 13:c=5,a=this._read(),a!==10&&this._unread(a)}}break;case 34:for(c=4;;)switch(a=this._read(),a){case 34:return c;
case 13:case 10:case -1:return this._unread(a),c;case 92:switch(a=this._read(),a){case 10:c=5;break;case 13:c=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}};i.prototype=new d(null);i.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}}};b.prototype=new d(null);b.prototype.setType=function(a){this._type=a};b.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}}};g.prototype=new d(null);g.prototype._default=function(a){for(;;)switch(a=this._read(),a){case 47:case 34:case 39:case -1:return this._unread(a),
1}};e.prototype={destroy:function(){var a=this.view;if(a){var c=a.getModel();c.getBaseModel&&(c=c.getBaseModel());c.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,
c){if(this.whitespacesVisible!==a)this.whitespacesVisible=a,this._scanner.whitespacesVisible=a,this._commentScanner.whitespacesVisible=a,c&&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,c,b,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),c<=a[f].start)e=f;else if(b&&c<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 c=this.annotationModel;if(c){c.removeAnnotations(h.AnnotationType.ANNOTATION_FOLDING);for(var b=[],d=a.getBaseModel(),e=this.comments,f=0;f<e.length;f++){var g=e[f];(g=this._createFoldingAnnotation(a,d,g.start,g.end))&&b.push(g)}c.replaceAnnotations(null,b)}}}},_createFoldingAnnotation:function(a,c,b,d){var e=c.getLineAtOffset(b),c=c.getLineAtOffset(d);return e===c?null:new (h.AnnotationType.getType(h.AnnotationType.ANNOTATION_FOLDING))(b,d,a)},_computeTasks:function(a,c,b){if(this.detectTasks){var d=
this.annotationModel;if(d){var e=this.view.getModel(),f=e;e.getBaseModel&&(f=e.getBaseModel());for(var g=d.getAnnotations(c,b),e=[],i=h.AnnotationType.ANNOTATION_TASK;g.hasNext();){var j=g.next();j.type===i&&e.push(j)}g=[];j=this._commentScanner;j.setText(f.getText(c,b));for(var k;k=j.nextToken();){var l=j.getStartOffset()+c;k===14&&(k=f.getLineEnd(f.getLineAtOffset(l)),a!==6&&(k=Math.min(k,b-this.commentEnd.length)),g.push(h.AnnotationType.createAnnotation(i,l,k,f.getText(l,k))))}d.replaceAnnotations(e,
g)}}},_getLineStyle:function(a){if(this.highlightCaretLine){var c=this.view,b=c.getModel(),c=c.getSelection();if(c.start===c.end&&b.getLineAtOffset(c.start)===a)return x}return null},_getStyles:function(a,c,b){a.getBaseModel&&(b=a.mapOffset(b));for(var d=b+c.length,e=[],f=b,g=this.comments,h=this._binarySearch(g,b,!0);h<g.length;h++){if(g[h].start>=d)break;var i=g[h].start,j=g[h].end;f<i&&this._parse(c.substring(f-b,i-b),f,e);var k=g[h].type,l;switch(k){case 8:l=s;break;case 7:l=o;break;case 5:l=
t}f=Math.max(f,i);i=Math.min(d,j);(k===8||k===7)&&(this.whitespacesVisible||this.detectHyperlinks)?this._parseComment(c.substring(f-b,i-b),f,e,l,k):k===5&&this.whitespacesVisible?this._parseString(c.substring(f-b,i-b),f,e,t):e.push({start:f,end:i,style:l});f=j}f<d&&this._parse(c.substring(f-b,d-b),f,e);if(a.getBaseModel)for(c=0;c<e.length;c++)b=e[c].end-e[c].start,e[c].start=a.mapOffset(e[c].start,!0),e[c].end=e[c].start+b;return e},_parse:function(a,c,b){var d=this._scanner;for(d.setText(a);a=d.nextToken();){var e=
d.getStartOffset()+c,f=null;switch(a){case 2:f=w;break;case 3:f=q;break;case 5:case 4:if(this.whitespacesVisible){this._parseString(d.getData(),e,b,t);continue}else f=t;break;case 8:this._parseComment(d.getData(),e,b,s,a);continue;case 6:this._parseComment(d.getData(),e,b,m,a);continue;case 7:this._parseComment(d.getData(),e,b,o,a);continue;case 10:this.whitespacesVisible&&this.tabsVisible&&(f=r);break;case 11:this.whitespacesVisible&&this.spacesVisible&&(f=n)}b.push({start:e,end:d.getOffset()+c,
style:f})}},_parseComment:function(a,c,b,d,e){var f=this._commentScanner;f.setText(a);for(f.setType(e);a=f.nextToken();){var e=f.getStartOffset()+c,g=d;switch(a){case 10:this.whitespacesVisible&&this.tabsVisible&&(g=r);break;case 11:this.whitespacesVisible&&this.spacesVisible&&(g=n);break;case 12:g=p;break;case 13:g=v;break;case 14:g=u;break;default:this.detectHyperlinks&&(g=this._detectHyperlinks(f.getData(),e,b,g))}g&&b.push({start:e,end:f.getOffset()+c,style:g})}},_parseString:function(a,c,b,d){var e=
this._whitespaceScanner;for(e.setText(a);a=e.nextToken();){var f=e.getStartOffset()+c,g=d;switch(a){case 10:this.whitespacesVisible&&this.tabsVisible&&(g=r);break;case 11:this.whitespacesVisible&&this.spacesVisible&&(g=n)}g&&b.push({start:f,end:e.getOffset()+c,style:g})}},_detectHyperlinks:function(a,c,b,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)};b.push({start:c,end:c+g,style:d});b.push({start:c+g,end:c+h,style:f});b.push({start:c+h,end:c+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 c={},b;for(b in a)a.hasOwnProperty(b)&&(c[b]=a[b]);return c},_findComments:function(a,c){var c=c||0,b=this._firstScanner,d;b.setText(a);for(var e=[];d=b.nextToken();)(d===7||d===8||d===5)&&e.push({start:b.getStartOffset()+c,end:b.getOffset()+c,type:d}),(d===6||d===7||d===8)&&this._computeTasks(d,b.getStartOffset()+c,b.getOffset()+c);return e},_findMatchingBracket:function(a,c){var b="{}()[]<>",d=a.getText(c,c+1),e=b.indexOf(d,0);if(e===-1)return-1;var f;f=e&1?b.substring(e-1,e):b.substring(e+
1,e+2);for(var g=a.getLineAtOffset(c),b=a.getLine(g),h=a.getLineStart(g),i=a.getLineEnd(g),b=this._findBrackets(d,f,b,h,h,i),i=0;i<b.length;i++)if(h=b[i]>=0?1:-1,b[i]*h-1===c){var j=1;if(e&1){for(i--;i>=0;i--)if(h=b[i]>=0?1:-1,j+=h,j===0)return b[i]*h-1;for(g-=1;g>=0;){b=a.getLine(g);h=a.getLineStart(g);i=a.getLineEnd(g);b=this._findBrackets(d,f,b,h,h,i);for(e=b.length-1;e>=0;e--)if(h=b[e]>=0?1:-1,j+=h,j===0)return b[e]*h-1;g--}}else{for(i++;i<b.length;i++)if(h=b[i]>=0?1:-1,j+=h,j===0)return b[i]*
h-1;g+=1;for(e=a.getLineCount();g<e;){b=a.getLine(g);h=a.getLineStart(g);i=a.getLineEnd(g);b=this._findBrackets(d,f,b,h,h,i);for(i=0;i<b.length;i++)if(h=b[i]>=0?1:-1,j+=h,j===0)return b[i]*h-1;g++}}break}return-1},_findBrackets:function(a,c,b,d,e,f){for(var g=[],a=a.charCodeAt(0),c=c.charCodeAt(0),h=e,i=this._scanner,j,k=this.comments,l=this._binarySearch(k,e,!0);l<k.length;l++){if(k[l].start>=f)break;j=k[l].start;var m=k[l].end;if(h<j)for(i.setText(b.substring(h-e,j-e));j=i.nextToken();)j===a?g.push(i.getStartOffset()+
h-e+d+1):j===c&&g.push(-(i.getStartOffset()+h-e+d+1));h=m}if(h<f)for(i.setText(b.substring(h-e,f-e));j=i.nextToken();)j===a?g.push(i.getStartOffset()+h-e+d+1):j===c&&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 c=a.oldValue,b=a.newValue,d=this.view,a=d.getModel(),e;if(this.highlightCaretLine){var f=
a.getLineAtOffset(c.start);e=a.getLineAtOffset(b.start);var g=b.start===b.end,c=c.start===c.end;f===e&&c&&g||(c&&d.redrawLines(f,f+1),(f!==e||!c)&&g&&d.redrawLines(e,e+1))}if(this.annotationModel){var c=this._bracketAnnotations,i,j;if(b.start===b.end&&(j=d.getCaretOffset())>0)j-=1,a.getBaseModel&&(j=a.mapOffset(j),a=a.getBaseModel()),a=this._findMatchingBracket(a,j),a!==-1&&(i=[h.AnnotationType.createAnnotation(h.AnnotationType.ANNOTATION_MATCHING_BRACKET,a,a+1),h.AnnotationType.createAnnotation(h.AnnotationType.ANNOTATION_CURRENT_BRACKET,
j,j+1)]);this._bracketAnnotations=i;this.annotationModel.replaceAnnotations(c,i)}},_onMouseDown:function(a){if(a.clickCount===2){var c=this.view,b=c.getModel(),d=c.getOffsetAtLocation(a.x,a.y);if(d>0){var e=d-1,f=b;b.getBaseModel&&(e=b.mapOffset(e),f=b.getBaseModel());e=this._findMatchingBracket(f,e);e!==-1&&(a.preventDefault(),a=e,b.getBaseModel&&(a=b.mapOffset(a,!0)),d>a&&(d--,a++),c.setSelection(a,d))}}},_onModelChanged:function(a){var c=a.start,b=a.removedCharCount,d=a.addedCharCount-b,e=this.view,
a=e.getModel(),f=a.getBaseModel?a.getBaseModel():a,b=c+b,g=f.getCharCount(),i=this.comments.length,j=f.getLineStart(f.getLineAtOffset(c)),k=this._binarySearch(this.comments,j,!0),l=this._binarySearch(this.comments,b,!1,k-1,i);k<i&&this.comments[k].start<=j&&j<this.comments[k].end?(j=this.comments[k].start,j>c&&(j+=d)):j=k===i&&i>0&&g-d===this.comments[i-1].end?this.comments[i-1].start:j;var m;l<i?(m=this.comments[l].end,m>c&&(m+=d),l+=1):(l=i,m=g);for(var q,g=this._findComments(f.getText(j,m),j),
i=k;i<this.comments.length;i++)q=this.comments[i],q.start>c&&(q.start+=d),q.start>c&&(q.end+=d);var n=l-k!==g.length;if(!n)for(i=0;i<g.length;i++){q=this.comments[k+i];var r=g[i];if(q.start!==r.start||q.end!==r.end||q.type!==r.type){n=!0;break}}i=[k,l-k].concat(g);Array.prototype.splice.apply(this.comments,i);n&&(i=j,q=m,a!==f&&(i=a.mapOffset(i,!0),q=a.mapOffset(q,!0)),e.redrawRange(i,q));if(this.foldingEnabled&&f!==a&&this.annotationModel){e=this.annotationModel;k=e.getAnnotations(j,m);j=[];for(m=
[];k.hasNext();)if(q=k.next(),q.type===h.AnnotationType.ANNOTATION_FOLDING){m.push(q);for(i=0;i<g.length;i++)if(q.start===g[i].start&&q.end===g[i].end)break;i===g.length?(j.push(q),q.expand()):(i=q.start,l=q.end,i>c&&(i-=d),l>c&&(l-=d),i<=c&&c<l&&i<=b&&b<l&&(i=f.getLineAtOffset(q.start),l=f.getLineAtOffset(q.end),i!==l?q.expanded||q.expand():e.removeAnnotation(q)))}c=[];for(i=0;i<g.length;i++){q=g[i];for(d=0;d<m.length;d++)if(m[d].start===q.start&&m[d].end===q.end)break;d===m.length&&(q=this._createFoldingAnnotation(a,
f,q.start,q.end))&&c.push(q)}e.replaceAnnotations(j,c)}}};return{TextStyler:e}});
define("orion/editor/textStyler",["orion/editor/annotations"],function(h){function k(a,c){this._unnamedCounter=0;this._patterns=[];this._rootId=c;a.forEach(function(a){this._addRepositoryPatterns(a.repository||{},a.id);this._addPatterns(a.patterns||[],a.id)}.bind(this))}function j(a,c,b,d,e){this.start=a.start;this.end=a.end;this.contentStart=a.contentStart;this.contentEnd=a.contentEnd;this.pattern=c;this._styler=b;this._parent=e;this._linePatterns=[];this._blockPatterns=[];this._enclosurePatterns=
{};if(d)this._initPatterns(),this._subBlocks=v(d,d.getText(this.start,this.end),this,this.start)}function f(a){this._styler=a}function d(a,c,b,d){this.highlightCaretLine=this.whitespacesVisible=this.spacesVisible=this.tabsVisible=!1;this.detectTasks=this.foldingEnabled=!0;this.view=a;this.annotationModel=c;this.patternManager=new k(b,d);this._accessor=new f(this);this._bracketAnnotations=void 0;var e=this;this._listener={onChanged:function(a){e._onModelChanged(a)},onDestroy:function(a){e._onDestroy(a)},
onLineStyle:function(a){e._onLineStyle(a)},onMouseDown:function(a){e._onMouseDown(a)},onSelection:function(a){e._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);d=b.getCharCount();this._rootBlock=
new j({start:0,contentStart:0,end:d,contentEnd:d},null,this,b);this._computeFolding(this._rootBlock.getBlocks());c&&this.detectTasks&&(d=[],t(this._rootBlock,b,d),c.replaceAnnotations([],d));a.redrawLines()}var i={styleClass:"meta annotation currentLine"},b=/$/,g=/\\(\d)/g,e=/(.*)(?:[\r\n]|$)/g,c={regex:/ /g,style:{styleClass:"punctuation separator space",unmergeable:!0}},a={regex:/\t/g,style:{styleClass:"punctuation separator tab",unmergeable:!0}},l=function(a,c,b,d){var f=b,g=a.lastIndex;e.lastIndex=
b;var b=e.exec(c),h,i;a.lastIndex=0;if(b){for(i=b.index;0<=--i;)if(h=c.charAt(i),h==="\n"||h==="\r")break;h=c.substring(i+1,b.index+b[1].length);a.lastIndex=i=b.index-i-1}for(;b&&b.index<c.length;){var j;if(d){var k=a.lastIndex;if(a.test(h))a.lastIndex=k,j=a.exec(h)}else j=a.exec(h);if(j)return j.index+=f,j.index-=i,a.lastIndex=g,j;i=0;f+=b[0].length;if(b=e.exec(c))h=b[1],a.lastIndex=0}a.lastIndex=g;return null},m=function(a,c){var b=a.toString();g.lastIndex=0;if(!g.test(b))return a;g.lastIndex=0;
for(var d=g.exec(b);d;)b=b.replace(d[0],c[d[1]]||""),g.lastIndex=0,d=g.exec(b);return RegExp(b.substring(1,b.length-2),"g")},o=function(a,c,b,d){if(c=l(a.pattern.regex?a.pattern.regex:a.pattern.regexBegin,c,d,!0)){a.result=c;for(d=0;d<b.length;d++)if(c.index<b[d].result.index||c.index===b[d].result.index&&a.pattern.pattern.index<b[d].pattern.pattern.index){b.splice(d,0,a);return}b.push(a)}},s=function(a,c,b,d){if(c[0])d.push({start:b,end:b+a[0].length,style:c[0].name});else for(var e=0,f=1;f<a.length;f++)if(a[f]){var g=
c[f];if(g){var h=b+e;d.push({start:h,end:h+a[f].length,style:g.name})}e+=a[f].length}},p=function(a,c,b){var d=a.start;c.forEach(function(c){d<=c.start&&b.push({start:d,end:c.start,style:a.style});b.push(c);d=c.end});d<a.end&&b.push({start:d,end:a.end,style:a.style})},u=function(a,c,d,e,f){if(d=d.getLinePatterns()){var g=[];d.forEach(function(c){var b=c.regex||c.regexBegin;b.oldLastIndex=b.lastIndex;(b=l(b,a,0))&&g.push({result:b,pattern:c})});g.sort(function(a,c){return a.result.index<c.result.index?
-1:a.result.index>c.result.index?1:a.pattern.pattern.index<c.pattern.pattern.index?-1:1});for(var h=0;g.length>0;){var i=g[0];g.splice(0,1);if(!(i.result.index<h)){var j=i.result.index,k,u=[];if(i.pattern.regex){h=i.result;k=j+h[0].length;k={start:c+j,end:c+k,style:i.pattern.pattern.name};if(!f){i.pattern.pattern.captures&&s(h,i.pattern.pattern.captures,c+j,u);u.sort(function(a,c){return a.start<c.start?-1:a.start>c.start?1:0});for(j=0;j<u.length-1;j++)if(u[j+1].start<u[j].end){var v={start:u[j+1].end,
end:u[j].end,style:u[j].style};u[j].end=u[j+1].start;u.splice(j+2,0,v)}}p(k,u,e)}else{h=i.pattern.regexEnd;h=m(h,i.result);h=l(h,a,i.result.index+i.result[0].length);if(!h)b.lastIndex=0,h=b.exec(a);k=h.index+h[0].length;e.push({start:c+j,end:c+k,style:i.pattern.pattern.name})}h=h.index+h[0].length}o(i,a,g,h)}d.forEach(function(a){a=a.regex||a.regexBegin;a.lastIndex=a.oldLastIndex})}},v=function(a,c,d,e){var f=[];d.getBlockPatterns().forEach(function(a){var b=l(a.regexBegin||a.regex,c,0);b&&f.push({result:b,
pattern:a})}.bind(this));if(!f.length)return f;f.sort(function(a,c){return a.result.index<c.result.index?-1:a.result.index>c.result.index?1:a.pattern.pattern.index<c.pattern.pattern.index?-1:1});for(var g=0,h=[];f.length>0;){var i=f[0];f.splice(0,1);if(!(i.result.index<g)){var k=a.getLineAtOffset(e+i.result.index),s=a.getLine(k),p=[];u(s,a.getLineStart(k),d,p);k=e+i.result.index;for(s=0;s<p.length;s++)if(p[s].start===k){var g=i.result.index,v=null,t=i.pattern.regexEnd;if(t){g+=i.result[0].length;
for(var t=m(t,i.result),B=g;!v;){B=l(t,c,B);if(!B)b.lastIndex=0,B=b.exec(c);var M=[],K=new j({start:k,end:e+B.index+B[0].length,contentStart:e+g,contentEnd:e+B.index},i.pattern,d.getStyler(),a,d);u(c.substring(g,B.index+B[0].length),g,K,M);if(!M.length||M[M.length-1].end<=B.index)v=K;B=B.index+B[0].length}}else v=new j({start:k,end:k+i.result[0].length,contentStart:k,contentEnd:k+i.result[0].length},i.pattern,d.getStyler(),a,d);h.push(v);g=v.end-e;break}s===p.length&&(g=i.result.index+1)}o(i,c,f,
g)}return h},t=function(a,c,b){if(a.getAnnotationModel()){var d=h.AnnotationType.ANNOTATION_TASK;if(a.getLinePatterns().length&&a.pattern&&a.pattern.pattern.name&&a.pattern.pattern.name.indexOf("comment")===0){var e=[];u(c.getText(a.contentStart,a.end),a.contentStart,a,e,!0);for(var f=0;f<e.length;f++)e[f].style==="meta.annotation.task.todo"&&b.push(h.AnnotationType.createAnnotation(d,e[f].start,e[f].end,c.getText(e[f].start,e[f].end)))}a.getBlocks().forEach(function(a){t(a,c,b)}.bind(this))}};k.prototype=
{getPatterns:function(a){var c=[0],b={},d=RegExp("^"+(a?typeof a==="string"?a:a.qualifiedId:this._rootId)+"#[^#]+$"),e=[];this._patterns.forEach(function(a){if(d.test(a.qualifiedId))a.include?e.push(a):(a.index=c[0]++,b[a.id]=a)}.bind(this));e.forEach(function(a){this._processInclude(a,c,b)}.bind(this));var f=[];Object.keys(b).forEach(function(a){f.push(b[a])});return f},_addPatterns:function(a,c){a.forEach(function(a){this._addPattern(a,this._NO_ID+this._unnamedCounter++,c)}.bind(this))},_addRepositoryPatterns:function(a,
c){Object.keys(a).forEach(function(b){this._addPattern(a[b],b,c)}.bind(this))},_addPattern:function(a,c,b){a.parentId=b;a.id=c;a.qualifiedId=a.parentId+"#"+a.id;this._patterns.push(a);a.patterns&&!a.include&&this._addPatterns(a.patterns,a.qualifiedId)},_processInclude:function(a,c,b){var d,e=a.include.indexOf("#");d=e===0?RegExp("^"+a.qualifiedId.substring(0,a.qualifiedId.indexOf("#"))+a.include+"$"):e===-1?RegExp("^"+a.include+"#"+this._NO_ID+"[^#]+$"):RegExp("^"+a.include+"$");var f=[];this._patterns.forEach(function(a){if(d.test(a.qualifiedId))if(a.include)f.push(a);
else if(!b[a.id])a.index=c[0]++,b[a.id]=a}.bind(this));f.forEach(function(a){this._processInclude(a,c,b)}.bind(this))},_NO_ID:"NoID"};j.prototype={adjustEnd:function(a){this.end+=a;this.contentEnd+=a;this._subBlocks.forEach(function(c){c.adjustEnd(a)})},adjustStart:function(a){this.start+=a;this.contentStart+=a;this._subBlocks.forEach(function(c){c.adjustStart(a)})},computeStyle:function(a,c){if(!this.pattern||!(this.start<=c&&c<this.end))return null;var b={start:this.start,end:this.end,style:this.pattern.pattern.name};
if(this.contentStart<=c&&c<this.contentEnd)return this.pattern.pattern.contentName?{start:this.contentStart,end:this.contentEnd,style:this.pattern.pattern.contentName}:b;var d,e,f,g;if(c<this.contentStart){e=this.pattern.pattern.beginCaptures||this.pattern.pattern.captures;if(!e)return b;d=this.pattern.regexBegin;f=a.getText(this.start,this.contentStart);g=this.start}else{e=this.pattern.pattern.endCaptures||this.pattern.pattern.captures;if(!e)return b;d=this.pattern.regexEnd;f=a.getText(this.contentEnd,
this.end);g=this.contentEnd}d.lastIndex=0;if(f=d.exec(f)){d=[];s(f,e,g,d);for(e=0;e<d.length;e++)if(d[e].start<=c&&c<d[e].end)return d[e]}return b},getAnnotationModel:function(){return this._styler._getAnnotationModel()},getBlockPatterns:function(){return this._blockPatterns},getBlocks:function(){return this._subBlocks},getEnclosurePatterns:function(){return this._enclosurePatterns},getLinePatterns:function(){return this._linePatterns},getParent:function(){return this._parent},getPatternManager:function(){return this._styler._getPatternManager()},
getStyler:function(){return this._styler},isRenderingWhitespace:function(){return this._styler._isRenderingWhitespace()},_initPatterns:function(){var a=function(a){var c=/^\(\?i\)\s*/.exec(a);c&&(a=a.substring(c[0].length));return a};this.getPatternManager().getPatterns(this.pattern?this.pattern.pattern:null).forEach(function(c){var b;if(c.match&&!c.begin&&!c.end){b="g";var d=a(c.match);d!==c.match&&(b+="i");b={regex:RegExp(d,b),pattern:c};this._linePatterns.push(b);if(c.patterns)this._blockPatterns.push(b);
else if(c.name&&c.name.indexOf("punctuation.section")===0&&(c.name.indexOf(".begin")!==-1||c.name.indexOf(".end")!==-1))this._enclosurePatterns[c.name]=b}else if(!c.match&&c.begin&&c.end){b="g";d=a(c.begin);d!==c.begin&&(b+="i");var e="g",f=a(c.end);f!==c.end&&(e+="i");b={regexBegin:RegExp(d,b),regexEnd:RegExp(f,e),pattern:c};this._linePatterns.push(b);this._blockPatterns.push(b)}}.bind(this))}};f.prototype={getStyles:function(a){return this._styler.getStyles(a)}};d.prototype={destroy:function(){var a=
this.view;if(a){var c=a.getModel();c.getBaseModel&&(c=c.getBaseModel());c.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}},getStyleAccessor:function(){return this._accessor},getStyles:function(a){var c=[],b=this.view.getModel();b.getBaseModel&&
(b=b.getBaseModel());var d=this._findBlock(this._rootBlock,a),e=b.getLineAtOffset(a),f=b.getLine(e),g=[];u(f,b.getLineStart(e),d,g);for(e=0;e<g.length;e++){if(a<g[e].start)break;if(g[e].start<=a&&a<g[e].end){c.push(g[e]);break}}for(;d;)(g=d.computeStyle(b,a))&&c.splice(0,0,g),d=d.getParent();return c},setHighlightCaretLine:function(a){this.highlightCaretLine=a},setWhitespacesVisible:function(a,c){if(this.whitespacesVisible!==a)this.whitespacesVisible=a,c&&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(){},setFoldingEnabled:function(a){this.foldingEnabled=a},setDetectTasks:function(a){this.detectTasks=a},_binarySearch:function(a,c,b,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),c<=a[f].start)e=f;else if(b&&c<a[f].end){e=f;break}else d=f;return e},_computeFolding:function(a){if(this.foldingEnabled){var c=this.view.getModel();if(c.getBaseModel){var b=this.annotationModel;if(b){b.removeAnnotations(h.AnnotationType.ANNOTATION_FOLDING);for(var d=[],e=c.getBaseModel(),f=0;f<a.length;f++){var g=a[f];(g=this._createFoldingAnnotation(c,e,g.start,g.end))&&d.push(g)}b.replaceAnnotations(null,d)}}}},_createFoldingAnnotation:function(a,c,b,d){var e=c.getLineAtOffset(b),
c=c.getLineAtOffset(d);return e===c?null:new (h.AnnotationType.getType(h.AnnotationType.ANNOTATION_FOLDING))(b,d,a)},_findBlock:function(a,c){var b=a.getBlocks();if(!b.length)return a;var d=this._binarySearch(b,c,!0);return d<b.length&&b[d].start<=c&&c<b[d].end?this._findBlock(b[d],c):a},_findBrackets:function(a,c,b,d,e,f){for(var g=[],h=[],i=e,j=b.getBlocks(),k=this._binarySearch(j,e,!0);k<j.length;k++){if(j[k].start>=f)break;var l=j[k].start,m=j[k].end;i<l&&(u(d.substring(i-e,l-e),i,b,h),h.forEach(function(b){b.style.indexOf(a.pattern.name)===
0?g.push(b.start+1):b.style.indexOf(c.pattern.name)===0&&g.push(-(b.start+1))}),h=[]);i=m}i<f&&(u(d.substring(i-e,f-e),i,b,h),h.forEach(function(b){b.style.indexOf(a.pattern.name)===0?g.push(b.start+1):b.style.indexOf(c.pattern.name)===0&&g.push(-(b.start+1))}));return g},_findMatchingBracket:function(a,c,b){for(var d=a.getLineAtOffset(b),e=a.getLineEnd(d),f=a.getText(b,e),g,h=c.getEnclosurePatterns(),i=Object.keys(h),j=0;j<i.length;j++){var k=h[i[j]],m=l(k.regex,f,0);if(m&&m.index===0){g=k;break}}if(!g)return-1;
f=!1;g.pattern.name.indexOf(".begin")!==-1?(f=!0,j=g.pattern.name.replace(".begin",".end")):j=g.pattern.name.replace(".end",".begin");h=h[j];if(!h)return-1;i=a.getLine(d);k=a.getLineStart(d);e=this._findBrackets(g,h,c,i,k,e);for(j=0;j<e.length;j++)if(i=e[j]>=0?1:-1,e[j]*i-1===b){b=1;if(f){for(j++;j<e.length;j++)if(i=e[j]>=0?1:-1,b+=i,b===0)return e[j]*i-1;d+=1;for(j=a.getLineCount();d<j;){i=a.getLine(d);k=a.getLineStart(d);e=a.getLineEnd(d);e=this._findBrackets(g,h,c,i,k,e);for(f=0;f<e.length;f++)if(i=
e[f]>=0?1:-1,b+=i,b===0)return e[f]*i-1;d++}}else{for(j--;j>=0;j--)if(i=e[j]>=0?1:-1,b+=i,b===0)return e[j]*i-1;for(d-=1;d>=0;){i=a.getLine(d);k=a.getLineStart(d);e=a.getLineEnd(d);e=this._findBrackets(g,h,c,i,k,e);for(j=e.length-1;j>=0;j--)if(i=e[j]>=0?1:-1,b+=i,b===0)return e[j]*i-1;d--}}break}return-1},_getAnnotationModel:function(){return this.annotationModel},_getLineStyle:function(a){if(this.highlightCaretLine){var c=this.view,b=c.getModel(),c=c.getSelection();if(c.start===c.end&&b.getLineAtOffset(c.start)===
a)return i}return null},_getPatternManager:function(){return this.patternManager},_getStyles:function(a,c,b,d){c.getBaseModel&&(d=c.mapOffset(d));for(var e=d+b.length,f=[],g=d,h=a.getBlocks(),i=this._binarySearch(h,d,!0);i<h.length;i++){if(h[i].start>=e)break;var j=h[i].start,k=h[i].end;g<j&&u(b.substring(g-d,j-d),g,a,f);var m=Math.max(g,j);if(m===j&&h[i].pattern.regexBegin){var o=l(h[i].pattern.regexBegin,b.substring(m-d),0);if(o){var B=h[i].pattern.pattern.beginCaptures||h[i].pattern.pattern.captures;
B?s(o,B,m,f):f.push({start:m,end:m+o[0].length,style:h[i].pattern.pattern.name});m+=o[0].length}}var j=Math.min(e,k),p=[];if(j===k&&h[i].pattern.regexEnd&&(g=b.substring(j-g-(h[i].end-h[i].contentEnd)),o=l(h[i].pattern.regexEnd,g,0)))(B=h[i].pattern.pattern.endCaptures||h[i].pattern.pattern.captures)?s(o,B,j-o[0].length,p):h[i].pattern.pattern.name&&p.push({start:j-o[0].length,end:j,style:h[i].pattern.pattern.name}),j-=o[0].length;var g=this._getStyles(h[i],c,b.substring(m-d,j-d),m),v=h[i].pattern.pattern.contentName||
h[i].pattern.pattern.name;if(v){var t=m;g.forEach(function(a){a.start-t&&f.push({start:t,end:a.start,style:v});f.push(a);t=a.end});j-t&&f.push({start:t,end:j,style:v})}else f=f.concat(g);f=f.concat(p);g=k}g<e&&u(b.substring(g-d,e-d),g,a,f);if(c.getBaseModel)for(a=0;a<f.length;a++)b=f[a].end-f[a].start,f[a].start=c.mapOffset(f[a].start,!0),f[a].end=f[a].start+b;return f},_isRenderingWhitespace:function(){return this.whitespacesVisible&&(this.tabsVisible||this.spacesVisible)},_onDestroy:function(){this.destroy()},
_onLineStyle:function(b){if(b.textView===this.view)b.style=this._getLineStyle(b.lineIndex);b.ranges=this._getStyles(this._rootBlock,b.textView.getModel(),b.lineText,b.lineStart);b.ranges.forEach(function(a){if(a.style)a.style={styleClass:a.style.replace(/\./g," ")}});this._isRenderingWhitespace()&&(this.spacesVisible&&this._spliceStyles(c,b.ranges,b.lineText,b.lineStart),this.tabsVisible&&this._spliceStyles(a,b.ranges,b.lineText,b.lineStart))},_onSelection:function(a){var c=a.oldValue,b=a.newValue,
d=this.view,a=d.getModel(),e;if(this.highlightCaretLine){var f=a.getLineAtOffset(c.start);e=a.getLineAtOffset(b.start);var g=b.start===b.end,c=c.start===c.end;f===e&&c&&g||(c&&d.redrawLines(f,f+1),(f!==e||!c)&&g&&d.redrawLines(e,e+1))}if(this.annotationModel){var c=this._bracketAnnotations,i,j;if(b.start===b.end&&(j=d.getCaretOffset())>0)j-=1,a.getBaseModel&&(j=a.mapOffset(j),a=a.getBaseModel()),b=this._findBlock(this._rootBlock,j),a=this._findMatchingBracket(a,b,j),a!==-1&&(i=[h.AnnotationType.createAnnotation(h.AnnotationType.ANNOTATION_MATCHING_BRACKET,
a,a+1),h.AnnotationType.createAnnotation(h.AnnotationType.ANNOTATION_CURRENT_BRACKET,j,j+1)]);this._bracketAnnotations=i;this.annotationModel.replaceAnnotations(c,i)}},_onMouseDown:function(a){if(a.clickCount===2){var c=this.view,b=c.getModel(),d=c.getOffsetAtLocation(a.x,a.y);if(d>0){var e=d-1,f=b;b.getBaseModel&&(e=b.mapOffset(e),f=b.getBaseModel());var g=this._findBlock(this._rootBlock,e),e=this._findMatchingBracket(f,g,e);e!==-1&&(a.preventDefault(),a=e,b.getBaseModel&&(a=b.mapOffset(a,!0)),d>
a&&(d--,a++),c.setSelection(a,d))}}},_onModelChanged:function(a){var c=a.start,b=a.removedCharCount,a=a.addedCharCount-b,d=this.view,e=d.getModel(),f=e.getBaseModel?e.getBaseModel():e,b=c+b,g=f.getCharCount(),i=this._rootBlock.getBlocks(),j=i.length,k=f.getLineStart(f.getLineAtOffset(c)),l=this._binarySearch(i,k,!0),m=this._binarySearch(i,b,!1,l-1,j),o;l<j&&i[l].start<=k&&k<i[l].end?(o=i[l].start,o>c&&(o+=a)):o=l===j&&j>0&&g-a===i[j-1].end?i[j-1].start:k;var s;do m<j?(s=i[m].end,s>c&&(s+=a),m+=1):
(m=j,s=g),k=f.getText(o,s),k=v(f,k,this._rootBlock,o);while(k.length&&i.length&&m<j&&k[k.length-1].pattern.pattern.id!==i[m-1].pattern.pattern.id);for(g=l;g<i.length;g++)j=i[g],j.start>c&&j.adjustStart(a),j.start>c&&j.adjustEnd(a);var u=m-l!==k.length;if(!u)for(g=0;g<k.length;g++){var j=i[l+g],p=k[g];if(j.start!==p.start||j.end!==p.end||j.type!==p.type){u=!0;break}}g=[l,m-l].concat(k);Array.prototype.splice.apply(i,g);u&&(g=o,j=s,e!==f&&(g=e.mapOffset(g,!0),j=e.mapOffset(j,!0)),d.redrawRange(g,j));
if(this.annotationModel){d=[];i=[];l=[];o=this.annotationModel.getAnnotations(o,s);for(s=this.foldingEnabled&&f!==e;o.hasNext();)if(j=o.next(),s&&j.type===h.AnnotationType.ANNOTATION_FOLDING){l.push(j);for(g=0;g<k.length;g++)if(j.start===k[g].start&&j.end===k[g].end)break;g===k.length?(d.push(j),j.expand()):(g=j.start,m=j.end,g>c&&(g-=a),m>c&&(m-=a),g<=c&&c<m&&g<=b&&b<m&&(g=f.getLineAtOffset(j.start),m=f.getLineAtOffset(j.end),g!==m?j.expanded||j.expand():this.annotationModel.removeAnnotation(j)));
for(g=0;g<k.length;g++){j=k[g];for(m=0;m<l.length;m++)if(l[m].start===j.start&&l[m].end===j.end)break;m===l.length&&(j=this._createFoldingAnnotation(e,f,j.start,j.end))&&i.push(j)}}else j.type===h.AnnotationType.ANNOTATION_TASK&&d.push(j);if(this.detectTasks)for(g=0;g<k.length;g++)t(k[g],f,i);this.annotationModel.replaceAnnotations(d,i)}},_spliceStyles:function(a,c,b,d){for(var e=a.regex,f=e.lastIndex=0,g=e.exec(b);g;){for(g=d+g.index;f<c.length;){if(g<c[f].end)break;f++}var h={start:g,end:g+1,style:a.style};
if(f<c.length&&c[f].start<=g){var i={start:g+1,end:c[f].end,style:c[f].style};c[f].end=g;c.splice(f+1,0,i);c.splice(f+1,0,h);f+=2}else c.splice(f,0,h),f++;g=e.exec(b)}}};return{TextStyler:d}});
define("orion/editor/textMateStyler",["orion/regex"],function(h){function k(d){var f;if(d instanceof Array){f=Array(d.length);for(var b=0;b<d.length;b++)f[b]=k(d[b])}else for(b in f={},d)if(Object.prototype.hasOwnProperty.call(d,b)){var g=d[b];f[b]=typeof g==="object"&&g!==null?k(g):g}return f}function j(d,f,b){this.initialize(d);this.grammar=k(f);this.externalGrammars=b?k(b):[];this._styles={};this._tree=null;this._allGrammars={};this.preprocess(this.grammar)}var f={unsupported:[{regex:/\(\?[ims\-]:/,
func:function(){return"option on/off for subexp"}},{regex:/\(\?<([=!])/,func:function(d){return d[1]==="="?"lookbehind":"negative lookbehind"}},{regex:/\(\?>/,func:function(){return"atomic group"}}],toRegExp:function(d){function h(c,a){throw Error('Unsupported regex feature "'+c+'": "'+a[0]+'" at index: '+a.index+" in "+a.input);}var b="",g,d=f.processGlobalFlag("x",d,function(c){for(var a="",b=!1,d=c.length,e=0;e<d;){var f=c.charAt(e);if(!b&&f==="#")for(;e<d&&f!=="\r"&&f!=="\n";)f=c.charAt(++e);
else if(!b&&/\s/.test(f))for(;e<d&&/\s/.test(f);)f=c.charAt(++e);else f==="\\"?(a+=f,/\s/.test(c.charAt(e+1))||(a+=c.charAt(e+1),e+=1)):(f==="["?b=!0:f==="]"&&(b=!1),a+=f),e+=1}return a}),d=f.processGlobalFlag("i",d,function(c){b+="i";return c});for(g=0;g<this.unsupported.length;g++){var e;(e=this.unsupported[g].regex.exec(d))&&h(this.unsupported[g].func(e),e)}return RegExp(d,b)},processGlobalFlag:function(d,f,b){function g(c,a){for(var b=0,d=c.length,e=-1,f=a;f<d&&e===-1;f++)switch(c.charAt(f)){case "\\":f++;
break;case "(":b++;break;case ")":b--,b===0&&(e=f)}return e}var e="(?"+d+")",d="(?"+d+":";if(f.substring(0,e.length)===e)return b(f.substring(e.length));else if(f.substring(0,d.length)===d){e=g(f,0);if(e<f.length-1)throw Error("Only a "+d+") group that encloses the entire regex is supported in: "+f);return b(f.substring(d.length,e))}return f},hasBackReference:function(d){return/\\\d+/.test(d.source)},getSubstitutedRegex:function(d,f,b){for(var b=typeof b==="undefined"?!0:!1,d=d.source.split(/(\\\d+)/g),
g=[],e=0;e<d.length;e++){var c=d[e],a=/\\(\d+)/.exec(c);a?(c=f[a[1]]||"",g.push(b?h.escape(c):c)):g.push(c)}return RegExp(g.join(""))},groupify:function(d,f){for(var b=d.source,g=b.length,e=[],c=0,a=[],h=1,j=1,k=[],s={},p={},u=0;u<g;u++){var v=e[e.length-1],t=b.charAt(u);switch(t){case "(":if(v===4)e.pop(),k.push(")"),a[a.length-1].end=u;var q=u+2<g?b.charAt(u+1)+""+b.charAt(u+2):null;if(q==="?:"||q==="?="||q==="?!"){var w;q==="?:"?w=1:(w=3,c++);e.push(w);a.push({start:u,end:-1,type:w});k.push(t);
k.push(q);u+=q.length}else e.push(2),a.push({start:u,end:-1,type:2,oldNum:h,num:j}),k.push(t),c===0&&(p[j]=null),s[h]=j,h++,j++;break;case ")":v=e.pop();v===3&&c--;a[a.length-1].end=u;k.push(t);break;case "*":case "+":case "?":case "}":var n=t,r=b.charAt(u-1),q=u-1;if(t==="}"){for(w=u-1;b.charAt(w)!=="{"&&w>=0;w--);r=b.charAt(w-1);q=w-1;n=b.substring(w,u+1)}w=a[a.length-1];if(r===")"&&(w.type===2||w.type===4)){k.splice(w.start,0,"(");k.push(n);k.push(")");t={start:w.start,end:k.length-1,type:4,num:w.num};
for(r=0;r<a.length;r++)if(v=a[r],(v.type===2||v.type===4)&&v.start>=w.start&&v.end<=q)if(v.start+=1,v.end+=1,v.num+=1,v.type===2)s[v.oldNum]=v.num;a.push(t);j++;break}default:t!=="|"&&v!==2&&v!==4&&c===0&&(e.push(4),a.push({start:u,end:-1,type:4,num:j}),k.push("("),p[j]=null,j++),k.push(t),t==="\\"&&(t=b.charAt(u+1),k.push(t),u+=1)}}for(;e.length;)e.pop(),k.push(")");var b=RegExp(k.join("")),g={},f=f||s,x;for(x in f)f.hasOwnProperty(x)&&(g[x]="\\"+f[x]);b=this.getSubstitutedRegex(b,g,!1);return[b,
s,p]},complexCaptures:function(d){if(!d)return!1;for(var f in d)if(d.hasOwnProperty(f)&&f!=="0")return!0;return!1}};j.prototype={initialize:function(d){this.textView=d;this.textView.stylerOptions=this;var f=this;this._listener={onModelChanged:function(b){f.onModelChanged(b)},onDestroy:function(b){f.onDestroy(b)},onLineStyle:function(b){f.onLineStyle(b)},onStorage:function(b){f.onStorage(b)}};d.addEventListener("ModelChanged",this._listener.onModelChanged);d.addEventListener("Destroy",this._listener.onDestroy);
d.addEventListener("LineStyle",this._listener.onLineStyle);d.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(d){for(d=[d];d.length!==0;){var f=
d.pop();if(!f._resolvedRule||!f._typedRule)if(f._resolvedRule=this._resolve(f),f._typedRule=this._createTypedRule(f),this.addStyles(f.name),this.addStyles(f.contentName),this.addStylesForCaptures(f.captures),this.addStylesForCaptures(f.beginCaptures),this.addStylesForCaptures(f.endCaptures),f._resolvedRule!==f&&d.push(f._resolvedRule),f.patterns)for(var b=0;b<f.patterns.length;b++)d.push(f.patterns[b])}},addStyles:function(d){if(d&&!this._styles[d]){this._styles[d]=[];for(var f=d.split("."),b=0;b<
f.length;b++)this._styles[d].push(f.slice(0,b+1).join("-"))}},addStylesForCaptures:function(d){for(var f in d)d.hasOwnProperty(f)&&this.addStyles(d[f].name)},ContainerRule:function(){function d(d){this.rule=d;this.subrules=d.patterns}d.prototype.valueOf=function(){return"aa"};return d}(),BeginEndRule:function(){function d(d){this.rule=d;this.beginRegex=f.toRegExp(d.begin);this.endRegex=f.toRegExp(d.end);this.subrules=d.patterns||[];this.endRegexHasBackRef=f.hasBackReference(this.endRegex);var b=f.complexCaptures(d.captures),
d=f.complexCaptures(d.beginCaptures)||f.complexCaptures(d.endCaptures);if(this.isComplex=b||d)b=f.groupify(this.beginRegex),this.beginRegex=b[0],this.beginOld2New=b[1],this.beginConsuming=b[2],b=f.groupify(this.endRegex,this.beginOld2New),this.endRegex=b[0],this.endOld2New=b[1],this.endConsuming=b[2]}d.prototype.valueOf=function(){return this.beginRegex};return d}(),MatchRule:function(){function d(d){this.rule=d;this.matchRegex=f.toRegExp(d.match);if(this.isComplex=f.complexCaptures(d.captures))d=
f.groupify(this.matchRegex),this.matchRegex=d[0],this.matchOld2New=d[1],this.matchConsuming=d[2]}d.prototype.valueOf=function(){return this.matchRegex};return d}(),_createTypedRule:function(d){return d.match?new this.MatchRule(d):d.begin?new this.BeginEndRule(d):new this.ContainerRule(d)},_resolve:function(d){var f=d;if(d.include){if(d.begin||d.end||d.match)throw Error('Unexpected regex pattern in "include" rule '+d.include);d=d.include;if(d.charAt(0)==="#"){if(f=this.grammar.repository&&this.grammar.repository[d.substring(1)],
!f)throw Error("Couldn't find included rule "+d+" in grammar repository");}else if(d==="$self")f=this.grammar;else if(d==="$base")throw Error('Include "$base" is not supported');else if(f=this._allGrammars[d],!f)for(var b=0;b<this.externalGrammars.length;b++){var g=this.externalGrammars[b];if(g.scopeName===d){this.preprocess(g);f=this._allGrammars[d]=g;break}}}return f},ContainerNode:function(){function d(d,b){this.parent=d;this.rule=b;this.children=[];this.end=this.start=null}d.prototype.addChild=
function(d){this.children.push(d)};d.prototype.valueOf=function(){var d=this.rule;return"ContainerNode { "+(d.include||"")+" "+(d.name||"")+(d.comment||"")+"}"};return d}(),BeginEndNode:function(){function d(d,b,g){this.parent=d;this.rule=b;this.children=[];this.setStart(g);this.endMatch=this.end=null;this.endRegexSubstituted=b.endRegexHasBackRef?f.getSubstitutedRegex(b.endRegex,g):null}d.prototype.addChild=function(d){this.children.push(d)};d.prototype.getIndexInParent=function(){return this.parent?
this.parent.children.indexOf(this):-1};d.prototype.setStart=function(d){this.start=d.index;this.beginMatch=d};d.prototype.setEnd=function(d){d&&typeof d==="object"?(this.endMatch=d,this.end=d.index+d[0].length):(this.endMatch=null,this.end=d)};d.prototype.shiftStart=function(d){this.start+=d;this.beginMatch.index+=d};d.prototype.shiftEnd=function(d){this.end+=d;this.endMatch&&(this.endMatch.index+=d)};d.prototype.valueOf=function(){return"{"+this.rule.beginRegex+" range="+this.start+".."+this.end+
"}"};return d}(),push:function(d,f){if(f)for(var b=f.length;b>0;)d.push(f[--b])},exec:function(d,f,b){(f=d.exec(f))&&(f.index+=b);d.lastIndex=0;return f},afterMatch:function(d){return d.index+d[0].length},getEndMatch:function(d,f,b){if(d instanceof this.BeginEndNode){var g=d.rule,d=d.endRegexSubstituted||g.endRegex;return!d?null:this.exec(d,f,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(d){var f=d.addedCharCount,b=d.removedCharCount,d=d.start;if(this._tree){var g=this.textView.getModel(),e=g.getCharCount(),g=g.getLineEnd(g.getLineAtOffset(d)-1),c=this.getFirstDamaged(g,g),g=g===-1?0:g,f=c?this.parse(c,!0,g,d,f,b):e;this.textView.redrawRange(g,f)}else this.initialParse()},getFirstDamaged:function(d,f){if(d<0)return this._tree;for(var b=[this._tree],g=null;b.length;){var e=b.pop();if(!e.parent||this.isDamaged(e,d,f)){e instanceof this.BeginEndNode&&(g=
e);for(var c=0;c<e.children.length;c++)b.push(e.children[c])}}return g||this._tree},isDamaged:function(d,f,b){return d.start<=b&&d.end>f},parse:function(d,f,b,g,e,c){var a=this.textView.getModel(),h=a.getLineStart(a.getLineCount()-1),j=a.getCharCount(),k=this.getInitialExpected(d,b),s=-1;if(f)d.repaired=!0,d.endNeedsUpdate=!0,s=(s=d.children[d.children.length-1])?a.getLineEnd(a.getLineAtOffset(s.end+(e-c))):-1,g=a.getLineEnd(a.getLineAtOffset(g+c)),s=Math.max(s,g);for(var s=s===-1?j:s,g=k,p=d,u=!1,
v=b,t=-1;p&&(!f||v<s);){var q=this.getNextMatch(a,p,v);q||(v=v>=h?j:a.getLineStart(a.getLineAtOffset(v)+1));var w=q&&q.match,n=q&&q.rule,r=q&&q.isEnd;if(q&&q.isSub){if(v=this.afterMatch(w),n instanceof this.BeginEndRule)u=!0,f&&n===g.rule&&p===g.parent?(p=g,p.setStart(w),p.repaired=!0,p.endNeedsUpdate=!0,g=this.getNextExpected(g,"begin")):(f&&(this.prune(p,g),f=!1),w=new this.BeginEndNode(p,n,w),p.addChild(w),p=w)}else if(r||v===j){if(p instanceof this.BeginEndNode)w?(u=!0,t=Math.max(t,p.end),p.setEnd(w),
v=this.afterMatch(w),f&&p===g&&p.parent===g.parent?(p.repaired=!0,delete p.endNeedsUpdate,g=this.getNextExpected(g,"end")):f&&(this.prune(p,g),f=!1)):(p.setEnd(j),delete p.endNeedsUpdate);p=p.parent}f&&v>=s&&!u&&(this.prune(d,k),f=!1)}this.removeUnrepairedChildren(d,f,b);this.cleanup(f,d,b,s,j,e,c);return f?Math.max(t,v):v},removeUnrepairedChildren:function(d,f,b){if(f){for(var f=d.children,g=-1,e=0;e<f.length;e++){var c=f[e];if(!c.repaired&&this.isDamaged(c,b,Number.MAX_VALUE)){g=e;break}}if(g!==
-1)d.children.length=g}},cleanup:function(d,f,b,g,e,c,a){if(d){d=c-a;e=this.getIntersecting(g-d+1,e);f=this.getIntersecting(b,g);for(b=0;b<e.length;b++)g=e[b],!g.repaired&&g instanceof this.BeginEndNode&&(g.shiftEnd(d),g.shiftStart(d));for(b=0;b<f.length;b++)g=f[b],g.repaired&&g.endNeedsUpdate&&g.shiftEnd(d),delete g.endNeedsUpdate,delete g.repaired}else{f=this.getIntersecting(b,g);for(b=0;b<f.length;b++)delete f[b].repaired}},getNextMatch:function(d,f,b,g){var e=d.getLineAtOffset(b),e=d.getLineEnd(e),
c=d.getText(b,e),a=[],h=[],d=[],e=[];for(this.push(a,f.rule.subrules);a.length;){var j=a.length?a.pop():null,j=j&&j._resolvedRule._typedRule;if(j instanceof this.ContainerRule&&h.indexOf(j)===-1)h.push(j),this.push(a,j.subrules);else if(!j||!g||j.matchRegex){var k=j&&this.exec(j.matchRegex||j.beginRegex,c,b);k&&(d.push(k),e.push(j))}}a=Number.MAX_VALUE;h=-1;for(j=0;j<d.length;j++)if(k=d[j],k.index<a)a=k.index,h=j;if(!g&&(b=this.getEndMatch(f,c,b)))if(g=f.rule.applyEndPatternLast,h===-1||b.index<a||
!g&&b.index===a)return{isEnd:!0,rule:f.rule,match:b};return h===-1?null:{isSub:!0,rule:e[h],match:d[h]}},getInitialExpected:function(d,f){var b,g;if(d===this._tree)for(b=0;b<d.children.length;b++){if(g=d.children[b],g.start>=f)return g}else if(d instanceof this.BeginEndNode&&d.endMatch){var e=d.endMatch.index;for(b=0;b<d.children.length;b++)if(g=d.children[b],g.start>=f)break;if(g&&g.start<e)return g}return d},getNextExpected:function(d,f){if(f==="begin"){var b=d.children[0];return b?b:d}else if(f===
"end"&&(b=d.parent)){var g=b.children[b.children.indexOf(d)+1];return g?g:b}return null},prune:function(d,f){if(f.parent===d)d.children.length=f.getIndexInParent();else if(d instanceof this.BeginEndNode)d.endMatch=null,d.end=null;if(d.parent)d.parent.children.length=d.getIndexInParent()+1},onLineStyle:function(d){this._tree||this.initialParse();var f=d.lineStart,b=this.textView.getModel(),g=b.getLineEnd(d.lineIndex),e=b.getLineEnd(b.getLineAtOffset(f)-1),e=this.getFirstDamaged(e,e),f=this.getLineScope(b,
e,f,g);d.ranges=this.toStyleRanges(f);d.ranges.sort(function(c,a){return c.start-a.start})},getLineScope:function(d,f,b,g){for(var e=b,c=this.getInitialExpected(f,b),a=[],h=[];f&&e<g;){var j=this.getNextMatch(d,f,e);if(!j)break;var k=j&&j.match,s=j&&j.rule,p=j&&j.isSub,j=j&&j.isEnd;k.index!==e&&h.push({start:e,end:k.index,node:f});if(p)e=this.afterMatch(k),s instanceof this.BeginEndRule?(this.addBeginScope(a,k,s),f=c,c=this.getNextExpected(c,"begin")):this.addMatchScope(a,k,s);else if(j)e=this.afterMatch(k),
this.addEndScope(a,k,s),c=this.getNextExpected(c,"end"),f=f.parent}e<g&&h.push({start:e,end:g,node:f});d=this.getInheritedLineScope(h,b,g);return a.concat(d)},getInheritedLineScope:function(d){for(var f=[],b=0;b<d.length;b++)for(var g=d[b],e=g.node;e;){var c=e.rule.rule,a=c.name;if(c=c.contentName||a){this.addScopeRange(f,g.start,g.end,c);break}e=e.parent}return f},addBeginScope:function(d,f,b){var g=b.rule;this.addCapturesScope(d,f,g.beginCaptures||g.captures,b.isComplex,b.beginOld2New,b.beginConsuming)},
addEndScope:function(d,f,b){var g=b.rule;this.addCapturesScope(d,f,g.endCaptures||g.captures,b.isComplex,b.endOld2New,b.endConsuming)},addMatchScope:function(d,f,b){var g=b.rule,e=g.name;(g=g.captures)?this.addCapturesScope(d,f,g,b.isComplex,b.matchOld2New,b.matchConsuming):this.addScope(d,f,e)},addScope:function(d,f,b){b&&d.push({start:f.index,end:this.afterMatch(f),scope:b})},addScopeRange:function(d,f,b,g){g&&d.push({start:f,end:b,scope:g})},addCapturesScope:function(d,f,b,g,e,c){if(b)if(g){for(var g=
{1:0},a=0,h=1;f[h]!==void 0;h++)c[h]!==void 0&&(a+=f[h].length),f[h+1]!==void 0&&(g[h+1]=a);c=f.index;for(a=1;b[a];a++){var h=b[a].name,j=e[a],k=c+g[j];typeof f[j]!=="undefined"&&this.addScopeRange(d,k,k+f[j].length,h)}}else this.addScope(d,f,b[0]&&b[0].name)},getIntersecting:function(d,f){for(var b=[],g=this._tree?[this._tree]:[];g.length;){var e=g.pop(),c=!1;e instanceof this.ContainerNode?c=!0:this.isDamaged(e,d,f)&&(c=!0,b.push(e));if(c)for(var c=e.children.length,a=0;a<c;a++)g.push(e.children[a])}return b.reverse()},
toStyleRanges:function(d){for(var f=[],b=0;b<d.length;b++){var g=d[b],e=this._styles[g.scope];if(!e)throw Error("styles not found for "+g.scope);e=e.join(" ");f.push({start:g.start,end:g.end,style:{styleClass:e}})}return f}};return{RegexUtil:f,TextMateStyler:j}});
define("orion/editor/AsyncStyler",["i18n!orion/editor/nls/messages","orion/editor/annotations"],function(h,k){function j(b){return b.getProperty("objectClass").indexOf(d)!==-1&&b.getProperty("type")==="highlighter"}function f(b,d,e){this.initialize(b,d,e);this.lineStyles=[]}var d="orion.edit.highlighter",i=d+" service must be an event emitter";k.AnnotationType.registerType("orion.annotation.highlightError",{title:h.syntaxError,html:"<div class='annotationHTML error'></div>",rangeStyle:{styleClass:"annotationRange error"}});
f.prototype={initialize:function(b,f,e){this.textView=b;this.serviceRegistry=f;this.annotationModel=e;this.services=[];var c=this;this.listener={onModelChanging:function(a){c.onModelChanging(a)},onModelChanged:function(a){c.onModelChanged(a)},onDestroy:function(a){c.onDestroy(a)},onLineStyle:function(a){c.onLineStyle(a)},onStyleReady:function(a){c.onStyleReady(a)},onServiceAdded:function(a){c.onServiceAdded(a.serviceReference,c.serviceRegistry.getService(a.serviceReference))},onServiceRemoved:function(a){c.onServiceRemoved(a.serviceReference,
c.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);f.addEventListener("registered",this.listener.onServiceAdded);f.addEventListener("unregistering",this.listener.onServiceRemoved);b=f.getServiceReferences(d);for(e=0;e<b.length;e++){var a=b[e];j(a)&&this.addServiceListener(f.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 d=this.startLine;(b.addedLineCount||b.removedLineCount)&&Array.prototype.splice.apply(this.lineStyles,[d,b.removedLineCount].concat(this._getEmptyStyle(b.addedLineCount)))},
onStyleReady:function(b){var d=b.lineStyles||b.style,b=Number.MAX_VALUE,e=-1,c=this.textView.getModel(),a;for(a in d)Object.prototype.hasOwnProperty.call(d,a)&&(this.lineStyles[a]=d[a],b=Math.min(b,a),e=Math.max(e,a));b=Math.max(b,0);e=Math.min(e,c.getLineCount());if(d=this.annotationModel){for(var f=d.getAnnotations(c.getLineStart(b),c.getLineEnd(e)),h=[];f.hasNext();){var i=f.next();i.type==="orion.annotation.highlightError"&&h.push(i)}f=[];for(i=b;i<=e;i++){a=i;var j=this.lineStyles[a],j=j&&j.errors;
a=c.getLineStart(a);if(j)for(var p=0;p<j.length;p++){var u=j[p];f.push(k.AnnotationType.createAnnotation("orion.annotation.highlightError",u.start+a,u.end+a))}}d.replaceAnnotations(h,f)}this.textView.redrawLines(b,e+1)},onLineStyle:function(b){function d(c,a){for(var b=c.length,e=[],f=0;f<b;f++){var g=c[f];e.push({start:g.start+a,end:g.end+a,style:g.style})}return e}var e=this.lineStyles[b.lineIndex];if(e)if(e.ranges)b.ranges=d(e.ranges,b.lineStart);else if(e.style)b.style=e.style},_getEmptyStyle:function(b){for(var d=
[],e=0;e<b;e++)d.push(null);return d},setContentType:function(b){this.contentType=b;if(this.services)for(b=0;b<this.services.length;b++){var d=this.services[b];if(d.setContentType){var e=this.serviceRegistry.getService("orion.page.progress");e?e.progress(d.setContentType(this.contentType),"Styling content type: "+this.contentType.id?this.contentType.id:this.contentType):d.setContentType(this.contentType)}}},onServiceAdded:function(b,d){j(b)&&this.addServiceListener(d)},onServiceRemoved:function(b,
d){this.services.indexOf(d)!==-1&&this.removeServiceListener(d)},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 d=this.serviceRegistry.getService("orion.page.progress");d?d.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 f});
define("orion/highlight",["examples/editor/textStyler","orion/editor/textStyler","orion/editor/textMateStyler","orion/editor/AsyncStyler","orion/Deferred"],function(h,k,j,f,d){function i(b,c,a,i,m,o,s){function p(b,e){var f=b.getProperty("contentType")||b.getProperty("contentTypes"),g=b.getProperty("fileTypes");if(f)return d.when(c.isSomeExtensionOf(a,f)).then(function(a){return a?b:null});else if(e&&g&&g.indexOf(e)!==-1)return f=new d,f.resolve(b),f;return null}function u(a){var c=null;switch(a&&
a.id){case "application/javascript":case "application/json":c=new h.TextStyler(i,"js",m);break;case "text/x-java-source":c=new h.TextStyler(i,"java",m);break;case "text/css":c=new h.TextStyler(i,"css",m)}return c}if(!g){var v=u(a);if(v)return o=new d,o.resolve(v),o}if(g&&!this.orionGrammars)this.orionGrammars={};for(var v=o&&o.split(".").pop().toLowerCase(),o=b.getServiceReferences("orion.edit.highlighter"),t=[],q=[],w=0;w<o.length;w++){var n=o[w],r=n.getProperty("type");r==="grammar"||!g&&typeof r===
"undefined"?t.push(n.getProperty("grammar")):r!=="highlighter"&&(r=n.getProperty("id"))&&!this.orionGrammars[r]&&(this.orionGrammars[r]={id:r,contentTypes:n.getProperty("contentTypes"),patterns:n.getProperty("patterns"),repository:n.getProperty("repository")});(n=p(n,v))&&q.push(n)}return d.all(q,function(a){return{_error:a}}).then(function(c){for(var d,h=c.length-1;h>=0;h--){var o=c[h];if(o&&!o._error&&(s||o.getProperty("type")!=="highlighter")){d=o;break}}var n;if(d)if(c=d.getProperty("type"),c===
"highlighter")n=new f(i,b,m),n.setContentType(a);else if(c==="grammar"||!g&&typeof c==="undefined")d=d.getProperty("grammar"),n=new j.TextMateStyler(i,d,t);else if(g){n=[];for(var r in this.orionGrammars)n.push(this.orionGrammars[r]);n=new k.TextStyler(i,m,n,d.getProperty("id"))}return n})}function b(b,c){this.serviceRegistry=b;this.contentTypeService=c;this.styler=null}var g=1;b.prototype={setup:function(b,c,a,d,f){f=typeof f==="undefined"?!0:f;if(this.styler)this.styler.destroy&&this.styler.destroy(),
this.styler=null;var g=this;return i(this.serviceRegistry,this.contentTypeService?this.contentTypeService:this.serviceRegistry.getService("orion.core.contentTypeRegistry"),b,c,a,d,f).then(function(a){return g.styler=a})},getStyler:function(){return this.styler}};return{createStyler:i,SyntaxHighlighter:b}});
define("orion/inputCompletion/inputCompletion",["orion/EventTarget"],function(h){function k(j,f,d){h.attach(this);this._binderFunc=f;this.setInputField(j);(j=d?d.group:null)||(j=this._inputField&&this._inputField.id?this._inputField.id:"default__input__group");this._completionIdPrefix=j+"__completion__";this._proposeFromStart=d?d.proposeFromStart:!1;this._extendedProvider=d?d.extendedProvider:null;this._serviceRegistry=d?d.serviceRegistry:null;this._onDelete=d?d.onDelete:null;this._deleteToolTips=
d?d.deleteToolTips:"";this._proposalIndex=-1;this._dismissed=!0;this._mouseDown=!1;this._dataList=[];this._initUI();this._listeners=[];d=function(d){this._binderFunc&&this._binderFunc(function(b){this._bind(b);d.deleting&&(this._proposeOn(this._inputField.value),this._selectProposal(this._proposalIndex,!0))}.bind(this))}.bind(this);this.addEventListener("inputDataListChanged",d);this._listeners.push({evtTarget:this,type:"inputDataListChanged",handler:d});d=function(){this._mouseDown=!0}.bind(this);
this._completionUIContainer.addEventListener("mousedown",d);this._listeners.push({evtTarget:this._completionUIContainer,type:"mousedown",handler:d});d=function(){this._mouseDown=!1}.bind(this);this._completionUIContainer.addEventListener("mouseup",d);this._listeners.push({evtTarget:this._completionUIContainer,type:"mouseup",handler:d})}k.prototype._removeListeners=function(h){h&&h.forEach(function(f){f.evtTarget.removeEventListener(f.type,f.handler,!1)})};k.prototype.destroy=function(){this._removeListeners(this._inputFieldListeners);
this._removeListeners(this.listeners)};k.prototype.hasValueOf=function(h){return this._dataList.some(function(f){return f.value===h})};k.prototype.setInputField=function(h){this._inputField&&this._inputFieldListeners&&this._removeListeners(this._inputFieldListeners);this._inputFieldListeners=[];this._inputField=h;if(typeof this._inputField==="string")this._inputField=document.getElementById(this._inputField);h=function(){this._mouseDown?window.setTimeout(function(){this._inputField.focus()}.bind(this),
200):this._dismiss()}.bind(this);this._inputField.addEventListener("blur",h);this._inputFieldListeners.push({evtTarget:this._inputField,type:"blur",handler:h});h=function(f){this.onKeyDown(f)}.bind(this);this._inputField.addEventListener("keydown",h);this._inputFieldListeners.push({evtTarget:this._inputField,type:"keydown",handler:h});h=function(){this._proposeOn(this._inputField.value)}.bind(this);this._inputField.addEventListener("input",h);this._inputFieldListeners.push({evtTarget:this._inputField,
type:"input",handler:h});h=function(){if(this._dismissed&&this._binderFunc)this._dismissing?this._dismissing=!1:this._binderFunc&&this._binderFunc(function(f){this._bind(f)}.bind(this))}.bind(this);this._inputField.addEventListener("focus",h);this._inputFieldListeners.push({evtTarget:this._inputField,type:"focus",handler:h})};k.prototype.onKeyDown=function(h){if(this._dismissed)return!0;var f=h.charCode||h.keyCode;if(f===13){if(this._proposalList&&this._proposalList.length>0&&this._proposalIndex>=
0&&this._proposalIndex<this._proposalList.length)return h.preventDefault(),this._dismiss(this._proposalList[this._proposalIndex].item.value,h.ctrlKey),h.stopPropagation(),!1}else if((f===40||f===38)&&this._proposalList&&this._proposalList.length>0)return h.preventDefault(),this._walk(f===40),h.stopPropagation(),!1;else if(f===27)return h.preventDefault(),this._dismiss(),!1;else if(f===46&&this._proposalIndex>-1&&this._onDelete)return h.preventDefault(),this._onDelete(this._proposalList[this._proposalIndex].item.value,
this),this._resetIndexAfterDeletion(),h.stopPropagation(),!1;return!0};k.prototype._resetIndexAfterDeletion=function(){if(this._proposalList.length<=1)this._proposalIndex=-1;else if(this._proposalIndex===this._proposalList.length-1)this._proposalIndex=this._proposalList.length-2};k.prototype._bind=function(h){this._dataList=h};k.prototype._getUIContainerID=function(){return this._completionIdPrefix+"UIContainer"};k.prototype._getUIProposalListId=function(){return this._completionIdPrefix+"UIProposalList"};
k.prototype._initUI=function(){this._completionUIContainer=document.getElementById(this._getUIContainerID());if(!this._completionUIContainer)this._completionUIContainer=document.createElement("div"),this._completionUIContainer.id=this._getUIContainerID(),this._completionUIContainer.style.display="none",this._completionUIContainer.className="inputCompletionContainer",this._completionUIContainer.setAttribute("role","list"),this._completionUIContainer.setAttribute("aria-atomic","true"),this._completionUIContainer.setAttribute("aria-live",
"assertive"),document.body.appendChild(this._completionUIContainer);this._completionUIContainer.textContent="";this._completionUL=document.getElementById(this._getUIProposalListId());if(!this._completionUL)this._completionUL=document.createElement("ul"),this._completionUL.id=this._getUIProposalListId(),this._completionUL.className="inputCompletionUL";this._completionUL.textContent="";this._completionUIContainer.appendChild(this._completionUL)};k.prototype._createProposalLink=function(h,f,d,i){var b=
document.createElement("a");b.href=require.toUrl(f);b.appendChild(this._createBoldText(h,d,i));return b};k.prototype._createBoldText=function(h,f,d,i){if(f<0)return document.createTextNode(h);var i=i?i:document.createElement("span"),b;0!==f&&(b=document.createTextNode(h.substring(0,f)),i.appendChild(b));var g=document.createElement("b");i.appendChild(g);b=document.createTextNode(h.substring(f,f+d));g.appendChild(b);f+d<h.length&&(b=document.createTextNode(h.substring(f+d)),i.appendChild(b));return i};
k.prototype._proposeOnCategory=function(h,f){if(f.length!==0){var d;if(h){d=document.createElement("li");d.className="inputCompletionLICategory";var i=document.createTextNode(h);d.appendChild(i);this._completionUL.appendChild(d)}f.forEach(function(b){d=document.createElement("li");d.onmouseover=function(a){this._selectProposal(a.currentTarget)}.bind(this);d.onclick=function(a){this._dismiss(a.currentTarget.completionItem.value)}.bind(this);d.className="inputCompletionLINormal";d.completionItem=b.item;
var f;if(typeof b.item.value==="string"){var e=document.createElement("table");e.style.width="100%";e.style.tableLayout="fixed";e.style.borderSpacing="0";var c=document.createElement("tr");c.style.width=this._inputField.offsetWidth+"px";e.appendChild(c);var a=document.createElement("td");a.classList.add("inputCompletionLILeftTD");var h=this._createBoldText(b.item.value,b.boldIndex,b.boldLength);a.appendChild(h);a.style.overflow="hidden";c.appendChild(a);if(this._onDelete)f=document.createElement("button"),
f.classList.add("inputCompletionDismissButton"),f.classList.add("layoutRight"),f.classList.add("core-sprite-close"),f.classList.add("imageSprite"),f.style.display="none",f.style.margin="0 0 0",f.title=this._deleteToolTips,f.onclick=function(a){a.stopPropagation();this._onDelete(b.item.value,this);this._resetIndexAfterDeletion()}.bind(this),a=document.createElement("td"),a.classList.add("inputCompletionLIRightTD"),a.appendChild(f),c.appendChild(a);d.appendChild(e)}else b.item.value.name&&b.item.value.type===
"link"&&d.appendChild(this._createProposalLink(b.item.value.name,b.item.value.value,b.boldIndex,b.boldLength));this._completionUL.appendChild(d);this._proposalList.push({item:b.item,domNode:d,deleteBtn:f})}.bind(this))}};k.prototype._domNode2Index=function(h){if(this._proposalList)for(var f=0;f<this._proposalList.length;f++)if(this._proposalList[f].domNode===h)return f;return-1};k.prototype._highlight=function(h,f){var d=h,i,b=!1;if(!isNaN(d))b=!0,this._proposalList&&h>=0&&h<this._proposalList.length?
(d=this._proposalList[h].domNode,i=this._proposalList[h].deleteBtn):d=null;if(d){d.className=f?"inputCompletionLISelected":"inputCompletionLINormal";if(i)i.style.display=f?"":"none";f&&b&&(d.offsetTop<this._completionUIContainer.scrollTop?d.scrollIntoView(!0):d.offsetTop+d.offsetHeight>this._completionUIContainer.scrollTop+this._completionUIContainer.clientHeight&&d.scrollIntoView(!1))}};k.prototype._selectProposal=function(h,f){var d=h;isNaN(d)&&(d=this._domNode2Index(h));if(d!==this._proposalIndex||
f)this._highlight(this._proposalIndex,!1),this._proposalIndex=d,this._highlight(this._proposalIndex,!0)};k.prototype._dismiss=function(h,f){if(!this._mouseDown){this._dismissed=!0;this._proposalList=null;this._proposalIndex=-1;if(typeof h==="string")this._inputField.value=h,this._dismissing=!0,this._inputField.focus();else if(h&&h.name&&h.type==="link")f?window.open(h.value):window.location.href=h.value;window.setTimeout(function(){this._completionUIContainer.style.display="none"}.bind(this),200)}};
k.prototype._show=function(){if(this._proposalList&&this._proposalList.length>0){for(var h=0,f=0,d=this._inputField;d;)h+=d.offsetLeft,f+=d.offsetTop,d=d.offsetParent;this._completionUIContainer.style.display="block";this._completionUIContainer.style.top=f+this._inputField.offsetHeight+2+"px";this._completionUIContainer.style.left=h+"px";this._completionUIContainer.style.width=this._inputField.offsetWidth+"px";this._dismissed=this._mouseDown=!1}else this._dismissed=!0,this._proposalList=null,this._proposalIndex=
-1,this._completionUIContainer.style.display="none"};k.prototype._walk=function(h){h=this._proposalIndex+(h?1:-1);h<-1?h=this._proposalList.length-1:h>=this._proposalList.length&&(h=-1);this._selectProposal(h)};k.prototype._proposeOnList=function(h,f,d){var i="",b=[],g=f?f.length:0;h.forEach(function(e){if(e.type==="category")this._proposeOnCategory(i,b),i=e.label,b=[];else{var c=!0,a=-1;if(f&&d){var h;typeof e.value==="string"?h=e.value.toLowerCase():e.value.name&&(h=e.value.name.toLowerCase());
a=h.indexOf(f);a<0?c=!1:this._proposeFromStart&&(c=a===0)}c&&b.push({item:e,boldIndex:a,boldLength:g})}}.bind(this));this._proposeOnCategory(i,b)};k.prototype._proposeOn=function(h){this._completionUL.textContent="";var f=h?h.toLowerCase():null;this._proposalList=[];this._proposeOnList(this._dataList,f,!0);this._extendedProvider&&f?this._extendedProvider(h,function(d){d&&d.forEach(function(d){this._proposeOnList(d.proposals,d.filterForMe?f:h,d.filterForMe)}.bind(this));this._show()}.bind(this),[]):
this._show()};k.prototype.constructor=k;return{InputCompletion:k}});
define("orion/searchAndReplace/textSearcher","i18n!orion/search/nls/messages,orion/editor/find,orion/commands,orion/objects,orion/searchUtils,orion/inputCompletion/inputCompletion,orion/webui/littlelib".split(","),function(h,k,j,f,d,i,b){function g(b,c,a,d,f){k.Find.call(this,b,d,f);this._serviceRegistry=c;this._commandService=a}g.prototype=new k.Find;f.mixin(g.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;this._addRecentfind(c);var b=b.replaceString,a=document.getElementById("localSearchFindWith");a||(this._createActionTable(),a=document.getElementById("localSearchFindWith"));
if(c)a.value=c;if(b)document.getElementById("localSearchReplaceWith").value=b;window.setTimeout(function(){a.select();a.focus()},10)},_showReplaceInfo:function(){this._regex?(this._replaceInfo.src="data:image/gif;base64,R0lGODlhBwAIAMQAAMzX6cbT5kh4qFiIuKC40FCIuGSXwmWZw2SaxGacxmadxmWcxbPM4GigyJW92JzC26DI0P///////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAABIALAAAAAAHAAgAAAUmoEQUQkFI0PBEz5A2yII0w9AwkUPbRpTsjUNEQUsFIgCXiGSShAAAOw==",this._replaceInfo.title=h["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=h["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 a=document.createElement("input");a.type="text";a.name=h["Find:"];a.className="parameterInput";a.id="localSearchFindWith";a.placeholder=
h["Find With"];a.oninput=function(a){return b._handleInput(a)};a.onkeydown=function(a){return b._handleKeyDown(a)};c.appendChild(a);b._initCompletion(a);b._createButton(h.Next,c,function(){b._addRecentfind(b.getFindString());b.find(!0)});b._createButton(h.Previous,c,function(){b._addRecentfind(b.getFindString());b.find(!1)});var d=b._editor.getTextView().getOptions("readonly");if(!d){var f=document.createElement("input");f.type="text";f.name=h["ReplaceWith:"];f.className="parameterInput";f.id="localSearchReplaceWith";
f.placeholder=h["Replace With"];f.onkeydown=function(a){return b._handleKeyDown(a)};c.appendChild(f);b._replaceInfo=b._createInfoImage(null,c,null);b._showReplaceInfo();b._createButton(h.Replace,c,function(){b.replace()});b._createButton(h["Replace All"],c,function(){b.replaceAll()})}f=document.createElement("div");c.appendChild(f);f.classList.add("findOptionsDiv");var g=j.createDropdownMenu(f,h.Options,null,"dismissButton",null,!0);g.menuButton.classList.add("parameterInlineButton");j.createCheckedMenuItem(g.menu,
h["Show all"],b._showAll,function(a){b.setOptions({showAll:a.target.checked});g.dropdown.close(!0)});j.createCheckedMenuItem(g.menu,h["Case sensitive"],!b._caseInsensitive,function(a){b.setOptions({caseInsensitive:!a.target.checked});g.dropdown.close(!0);b.find(!0)});j.createCheckedMenuItem(g.menu,h["Wrap search"],b._wrap,function(a){b.setOptions({wrap:a.target.checked});g.dropdown.close(!0)});j.createCheckedMenuItem(g.menu,h["Incremental search"],b._incremental,function(a){b.setOptions({incremental:a.target.checked});
g.dropdown.close(!0)});j.createCheckedMenuItem(g.menu,h["Whole Word"],b._wholeWord,function(a){b.setOptions({wholeWord:a.target.checked});g.dropdown.close(!0);b.find(!0)});b._regExBox=j.createCheckedMenuItem(g.menu,h["Regular expression"],b._regex,function(a){b.setOptions({regex:a.target.checked});g.dropdown.close(!0);b.find(!0);b._showReplaceInfo()});d||j.createCheckedMenuItem(g.menu,h["Find after replace"],b._findAfterReplace,function(a){b.setOptions({findAfterReplace:a.target.checked});g.dropdown.close(!0)});
return a},function(){b.hide()})},_storeRecentFind:function(b,c,a){this._serviceRegistry.getService("orion.core.preference").getPreferences("/window/favorites").then(function(d){d.put("recentFind",b);c&&window.setTimeout(function(){c.dispatchEvent({type:"inputDataListChanged",deleting:a})}.bind(this),20)})},_addRecentfind:function(b){typeof b==="string"&&b&&(!this._completion||!this._completion.hasValueOf(b))&&this._serviceRegistry.getService("orion.core.preference").getPreferences("/window/favorites").then(function(c){var a,
c=c.get("recentFind");typeof c==="string"&&(c=JSON.parse(c));if(c){for(a in c)if(c[a].name===b)return;c.length>=30&&c.splice(29,c.length-30+1)}else c=[];c.splice(0,0,{name:b});this._storeRecentFind(c,this._completion)}.bind(this))},_removeRecentSearch:function(b,c){typeof b==="string"&&b&&this._serviceRegistry.getService("orion.core.preference").getPreferences("/window/favorites").then(function(a){var d,a=a.get("recentFind");typeof a==="string"&&(a=JSON.parse(a));if(a)for(d in a)if(a[d].name===b){a.splice(d,
1);this._storeRecentFind(a,c,!0);break}}.bind(this))},_initCompletion:function(b){if(this._completion)this._completion.setInputField(b);else{var c=function(a){this._serviceRegistry.getService("orion.core.preference").getPreferences("/window/favorites").then(function(c){c=c.get("recentFind");typeof c==="string"&&(c=JSON.parse(c));if(c){var b=[];c.forEach(function(a){b.push({type:"proposal",label:a.name,value:a.name})});a(b)}})}.bind(this);this._completion=new i.InputCompletion(b,c,{serviceRegistry:this._serviceRegistry,
group:"localSearch",onDelete:function(a,c){this._removeRecentSearch(a,c)}.bind(this),deleteToolTips:h["Click or use delete key to delete the search term"]})}},_createButton:function(d,c,a){var f=document.createElement("button");f.addEventListener("click",a.bind(this),!1);var g=this;f.addEventListener("keydown",function(a){a.keyCode===b.KEY.ESCAPE&&g.hide()});f.appendChild(document.createTextNode(d));f.className="dismissButton parameterInlineButton";c.appendChild(f)},_createInfoImage:function(b,c){var a=
document.createElement("img");a.classList.add("replaceInfo");a.addEventListener("click",function(){this._regExBox.checked=!this._regex;this.setOptions({regex:!this._regex});this.find(!0);this._showReplaceInfo()}.bind(this));c.appendChild(a);return a},_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,this._addRecentfind(this.getFindString()),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:g}});
define("orion/blamer",["orion/extensionCommands","orion/PageLinks","orion/URITemplate"],function(h,k,j){function f(d,f){for(var b=f.getFileMetadata(),g=d.getServiceReferences("orion.edit.blamer"),e=0;e<g.length;e++){var c=g[e],a={};a.validationProperties=c.getProperty("validationProperties");a.forceSingleItem=!0;a=h._makeValidator(a,d);if(a.validationFunction.bind(a)(b))return d.getService(c)}return null}return{isVisible:function(d,h){return!!f(d,h)&&!!d.getService("orion.core.blame")},getBlame:function(d,
h){var b=f(d,h);b&&b.doBlame(h.getInput()).then(function(b){for(var e=k.getOrionHome(),c=0;c<b.length;c++){var a=b[c],f=new j(a.CommitLink),h={};h.OrionHome=e;a.CommitLink=f.expand(h)}d.getService("orion.core.blame")._setAnnotations(b)})}}});
define("orion/edit/editorContext",[],function(){return{getEditorContext:function(h){var k=Object.create(null);h.getServiceReferences("orion.edit.context").forEach(function(j){var f=h.getService(j);Object.keys(f).forEach(function(d){typeof f[d]==="function"&&(k[d]=f[d].bind(f))})});return k},getOptions:function(h){var k=Object.create(null);h.getServiceReferences("orion.edit.context").forEach(function(h){h.getPropertyKeys().forEach(function(f){f!=="service.id"&&f!=="service.names"&&f!=="objectClass"&&
(k[f]=h.getProperty(f))})});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/editor/annotations,orion/blamer,orion/regex,orion/util,orion/edit/editorContext".split(","),function(h,k,j,f,d,i,b,g,e,c,a,l,m,o,s,p,u,v,t,q){function w(a){var c=
new b(a.uriTemplate),d=a.params||{};d.OrionHome=d.OrionHome||s.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(c){if(c.source===e.contentWindow&&typeof c.data==="string"&&(c=JSON.parse(c.data),c.pageService==="orion.page.delegatedUI"&&c.source===a.id)){if(c.cancelled)a.cancelled&&a.cancelled();else if(c.result)a.done&&a.done(c.result);else if(c.Status||c.status)a.status&&a.status(c.Status||
c.status);window.removeEventListener("message",y,!1);e.parentNode.removeChild(e)}},!1);return d}function n(a){this.serviceRegistry=a.serviceRegistry;this.commandService=a.commandRegistry;this.fileClient=a.fileClient;this.inputManager=a.inputManager;this.toolbarId=a.toolbarId;this.saveToolbarId=a.saveToolbarId;this.editToolbarId=a.editToolbarId;this.pageNavId=a.navToolbarId;this.isReadOnly=a.readonly;this._localSearcher=a.textSearcher;this._searcher=a.searcher;this.editorSettings=a.editorSettings;
this.localSettings=a.localSettings}var r={},x=null;r.createDelegatedUI=w;n.prototype={generateSimpleEditorCommands:function(a,c){this.isReadOnly||(this._generateUndoStackCommands(a),this._generateSaveCommand(a,c));this._generateSearchFilesCommand(a);this._generateGotoLineCommnand(a);this._generateFindCommnand(a)},generateEditorCommands:function(a){this.generateBaseEditorCommands(a);this.generateExtraEditorCommands(a)},generateBaseEditorCommands:function(a){this.isReadOnly||(this._generateUndoStackCommands(a),
this._generateSaveCommand(a),this._generateEditCommands(a))},generateExtraEditorCommands:function(a){this._generateSettingsCommand(a);this._generateSearchFilesCommand(a);this._generateGotoLineCommnand(a);this._generateFindCommnand(a);this._generateBlame(a)},_generateSettingsCommand:function(a){var c=this,b=new g.Command({imageClass:"core-sprite-wrench",tooltip:h.LocalEditorSettings,id:"orion.edit.settings",visibleWhen:function(){return a.installed},callback:function(e){var f=b.settingsDropDown;if(!f||
f.isDestroyed())f=b.settingsDropDown=new d(e.domNode.parentNode,e.domNode,{noClick:!0,selectionClass:"dropdownSelection",onShow:function(){f.focus()},onHide:function(){a.focus()}}),f.updateContent=c.localSettings.show.bind(c.localSettings),e=f.getContentNode(),e.tabIndex=e.style.marginTop=0;f.click()}});this.commandService.addCommand(b);this.commandService.registerCommandContribution("settingsActions","orion.edit.settings",1,null,!1,new e.KeyBinding("s",!0,!0))},_generateUndoStackCommands:function(a){this.commandService.addCommand(new g.Command({name:h.Undo,
id:"orion.undo",visibleWhen:function(){return a.installed},callback:function(){a.getUndoStack().undo()}}));this.commandService.registerCommandContribution(this.editToolbarId||this.toolbarId,"orion.undo",400,this.editToolbarId?"orion.menuBarEditGroup/orion.undoGroup":null,!this.editToolbarId,new e.KeyBinding("z",!0));this.commandService.addCommand(new g.Command({name:h.Redo,id:"orion.redo",visibleWhen:function(){return a.installed},callback:function(){a.getUndoStack().redo()}}));this.commandService.registerCommandContribution(this.editToolbarId||
this.toolbarId,"orion.redo",401,this.editToolbarId?"orion.menuBarEditGroup/orion.undoGroup":null,!this.editToolbarId,t.isMac?new e.KeyBinding("z",!0,!0):new e.KeyBinding("y",!0))},_generateSearchFilesCommand:function(a){var c=this;if(c._searcher){var b=!1;this.commandService.addCommand(new g.Command({name:h.searchFiles,tooltip:h.searchFiles,id:"orion.searchFiles",visibleWhen:function(){return a.installed},callback:function(){if(!b){var d=a.getSelection(),d=a.getText(d.start,d.end),e=c.serviceRegistry.getService("orion.page.progress"),
g=new f.OpenResourceDialog({searcher:c._searcher,progress:e,searchRenderer:c._searcher.defaultRenderer,nameSearch:!1,title:h.searchFiles,message:h.searchTerm,initialText:d,onHide:function(){b=!1;a.focus()}});window.setTimeout(function(){b=!0;g.show(j.node(c.toolbarId))},0)}}}));this.commandService.registerCommandContribution(this.editToolbarId||this.pageNavId,"orion.searchFiles",1,this.editToolbarId?"orion.menuBarEditGroup/orion.findGroup":null,!this.editToolbarId,new e.KeyBinding("h",!0))}},_generateSaveCommand:function(a,
c){var b=this,d=c?c:"orion.save",f=new g.Command({name:h.Save,tooltip:h.saveFile,id:d,visibleWhen:function(){return!a.installed||b.inputManager.getReadOnly()?!1:!0},callback:function(){b.inputManager.save();return!0}});this.commandService.addCommand(f);this.commandService.registerCommandContribution(this.saveToolbarId||this.toolbarId,d,1,this.saveToolbarId?"orion.menuBarFileGroup/orion.saveGroup":null,!1,new e.KeyBinding("s",!0));a.getTextView&&a.getTextView()&&(a.getTextView().setKeyBinding(new e.KeyBinding("s",
!0),"save"),a.getTextView().setAction("save",f.callback,f))},_generateGotoLineCommnand:function(a){var b=this,d=new c.ParametersDescription([new c.CommandParameter("line","number","Line:")],{hasOptionalParameters:!1},function(){var b=a.getModel().getLineAtOffset(a.getCaretOffset())+1;return[new c.CommandParameter("line","number","Line:",b.toString())]}),d=new g.Command({name:h.gotoLine,tooltip:h.gotoLineTooltip,id:"orion.gotoLine",visibleWhen:function(){return a.installed},parameters:d,callback:function(c){var b=
a.getModel();c.parameters&&c.parameters.valueFor("line")?c=c.parameters.valueFor("line"):(c=b.getLineAtOffset(a.getCaretOffset()),(c=prompt(h.gotoLinePrompt,c+1))&&(c=parseInt(c,10)));if(c)a.onGotoLine(c-1,0)}});this.commandService.addCommand(d);this.commandService.registerCommandContribution(this.editToolbarId||this.pageNavId,"orion.gotoLine",3,this.editToolbarId?"orion.menuBarEditGroup/orion.findGroup":null,!this.editToolbarId,new e.KeyBinding("l",!t.isMac,!1,!1,t.isMac),new c.URLBinding("gotoLine",
"line"));a.getTextView&&a.getTextView()&&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},d)},_generateFindCommnand:function(a){var b=this,d=new c.ParametersDescription([new c.CommandParameter("find","text","Find:")],{clientCollect:!0},function(){var d=a.getSelection(),e="";d.end>d.start&&(e=a.getModel().getText(d.start,d.end),b._localSearcher&&b._localSearcher.getOptions().regex&&(e=
v.escape(e)));return[new c.CommandParameter("find","text","Find:",e)]}),d=new g.Command({name:h.Find,tooltip:h.Find,id:"orion.editor.find",visibleWhen:function(){return a.installed},parameters:d,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=v.escape(d))):c.parameters&&c.parameters.valueFor("find")&&(d=c.parameters.valueFor("find"),
e=o.matchResourceParameters(),m.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(d);this.commandService.registerCommandContribution(this.editToolbarId||this.pageNavId,"orion.editor.find",0,
this.editToolbarId?"orion.menuBarEditGroup/orion.findGroup":null,!this.editToolbarId,new e.KeyBinding("f",!0),new c.URLBinding("find","find"));a.getTextView&&a.getTextView()&&a.getTextView().setAction("find",function(a){if(a)return b._localSearcher.show(a),!0;b.commandService.runCommand("orion.editor.find",null,null,new c.ParametersDescription([new c.CommandParameter("useEditorSelection","text","","true")],{clientCollect:!0}));return!0},d)},_generateBlame:function(a){var b=this;this.commandService.addCommand(new g.Command({name:h.Blame,
tooltip:h.BlameTooltip,id:"orion.edit.blame",parameters:new c.ParametersDescription([new c.CommandParameter("blame","boolean")],{clientCollect:!0}),visibleWhen:function(){return!a.installed?!1:u.isVisible(b.serviceRegistry,b.inputManager)},callback:function(c){for(var d=!1,e=a.getAnnotationModel().getAnnotations();e.hasNext();)if(e.next().type===p.AnnotationType.ANNOTATION_BLAME){d=!0;break}d=!d;c.parameters&&c.parameters.valueFor("blame")&&(d=c.parameters.valueFor("blame")==="true");d?u.getBlame(b.serviceRegistry,
b.inputManager):a.showBlame([])}}));this.commandService.registerCommandContribution(this.toolbarId,"orion.edit.blame",1,"orion.menuBarToolsGroup",!1,new e.KeyBinding("b",!0,!0),new c.URLBinding("blame","blame"))},_generateEditCommands:function(c){function b(a){if(!a)return null;var c=new e.KeyBinding;e.KeyBinding.apply(c,a);return c}function d(a,c){!c&&a&&typeof a.HTML!=="undefined"&&delete a.HTML;var b=f.serviceRegistry.getService("orion.page.message");b?b.setProgressResult(a):window.console.log(a)}
var f=this,m=this.toolbarId,o=this.serviceRegistry,n=o.getServiceReferences("orion.edit.command"),r=this.inputManager,B=o.getService("orion.page.progress"),s=function(a,b,e){var i=e.visibleWhen;e.visibleWhen=function(a){return!c.installed||f.inputManager.getReadOnly()?!1:!i||i(a)};e.callback=function(){c=this;var e=c.getSelection?c.getSelection():{start:0,end:0},f=c.getModel(),g=function(a){typeof a==="object"&&a?(a.text&&c.setText(a.text),a.selection&&(c.setSelection&&c.setSelection(a.selection.start,
a.selection.end,!0),c.focus())):typeof a==="string"&&(c.setText(a,e.start,e.end,!0),c.setSelection&&c.setSelection(e.start,e.start+a.length),c.focus())},i;b.execute?(f={contentType:r.getContentType(),input:r.getInput()},i=q.getEditorContext(o),i.openDelegatedUI=w,i.setStatus=d,f=b.execute(i,f),i=null):(f=b.run(f.getText(e.start,e.end),f.getText(),e,r.getInput()),i=function(c){if(c&&c.uriTemplate){var b={};b.uriTemplate=c.uriTemplate;b.params=r.getFileMetadata();b.id=a.id;b.width=c.width;b.height=
c.height;b.done=g;b.status=d;w(b)}else c&&(c.Status||c.status)?d(c.Status||c.status):g(c)});B.showWhile(f,k.formatMessage(h.running,a.name)).then(i);return!0};e.callback=e.callback.bind(c);return new g.Command(e)};i.when(function(a){if(x)return x;var c=a.getService("orion.core.contentTypeRegistry");c||(c=new l.ContentTypeRegistry(a),c=a.getService("orion.core.contentTypeRegistry"));return c.getContentTypes().then(function(a){return x=a})}(this.serviceRegistry),function(){var d=[],e=100;n.forEach(function(g){var h=
g.getProperty("editor");if(!h||!(c.id&&h!==c.id)){for(var i=f.serviceRegistry.getService(g),j={},h=g.getPropertyKeys(),k=0;k<h.length;k++)j[h[k]]=g.getProperty(h[k]);j.forceSingleItem=!0;g=a._createCommandOptions(j,g,f.serviceRegistry,x,!1,function(){return r.getFileMetadata()});d.push(g);g.then(function(a){a=s(j,i,a);f.commandService.addCommand(a);f.commandService.registerCommandContribution(f.toolbarId,a.id,e,"orion.menuBarToolsGroup",!1,b(j.key))});e++}});i.all(d,function(a){return{_error:a}}).then(function(){var a;
if(a=r.getFileMetadata()){var b=j.node(m);b&&(f.commandService.destroy(b),f.commandService.renderCommands(b.id,b,a,c,"button"));if(b=j.node("pageNavigationActions"))f.commandService.destroy(b),f.commandService.renderCommands(b.id,b,c,c,"button")}})})}};r.EditorCommandFactory=n;return r});
define("orion/inputManager","i18n!orion/edit/nls/messages,orion/i18nUtil,orion/Deferred,orion/EventTarget,orion/objects,orion/PageUtil".split(","),function(h,k,j,f,d,i){function b(c){this._document=c.document||document;this._timeout=c.timeout;for(var c="keypress,keydown,keyup,mousemove,mousedown,mousemove".split(","),a=function(){this._resetTimer()}.bind(this),b=0;b<c.length;b++)this._document.addEventListener(c[b],a,!0);f.attach(this)}function g(c,a){if(c){if(!a.Severity){var b=a,d={Severity:"Error",
Message:h.noResponse};if(b.status!==0)if(b.responseText){b=b.responseText;try{var e=JSON.parse(b);d.Severity=e.Severity||d.Severity;d.Message=e.Message||d.Message}catch(f){d.Message=b}}else try{d.Message=JSON.stringify(b)}catch(g){}a=d}c.setProgressResult(a)}else window.console.log(a)}function e(c){f.attach(this);this.serviceRegistry=c.serviceRegistry;this.statusService=c.statusService;this.fileClient=c.fileClient;this.progressService=c.progressService;this.contentTypeRegistry=c.contentTypeRegistry;
this.selection=c.selection;this._input=this._title="";this.dispatcher=null;this._unsavedChanges=[]}b.prototype={_resetTimer:function(){var c=this._document.defaultView||this._document.parentWindow;if(this._timer)c.clearTimeout(this._timer),this._timer=null;if(this._timeout!==-1)this._timer=c.setTimeout(function(){this.onIdle({type:"Idle"});this._timer=null;this._resetTimer()}.bind(this),this._timeout)},onIdle:function(c){return this.dispatchEvent(c)},setTimeout:function(c){this._timeout=c;this._resetTimer()}};
d.mixin(e.prototype,{_maybeLoadWorkspace:function(c){var a=this.fileClient;return c===a.fileServiceRootURL(c)?a.loadWorkspace(c).then(function(a){return a.Location}):(new j).resolve(c)},_read:function(c){if(this.cachedMetadata&&this.cachedMetadata.Location===c)return(new j).resolve(this.cachedMetadata);var a=this.fileClient,b=Array.prototype.slice.call(arguments,1);return this._maybeLoadWorkspace(c).then(function(c){return a.read.apply(a,[c].concat(b))})},load:function(){var c=this.getInput();if(c){var a=
this.fileClient,b=this._parsedLocation.resource,d=this.progressService,e=function(a,c,b){return!d?a:d.progress(a,k.formatMessage(c,b))},f=this.getEditor();if(this._fileMetadata)!this._saving&&!this._fileMetadata.Directory&&!this._readonly&&e(a.read(b,!0),h.ReadingMetadata,c).then(function(d){if(this._fileMetadata&&this._fileMetadata.Location===d.Location&&this._fileMetadata.ETag!==d.ETag)this._fileMetadata=d,(!f.isDirty()||window.confirm(h.loadOutOfSync))&&e(a.read(b),h.Reading,c).then(function(a){f.setInput(c,
null,a);this._unsavedChanges=[]}.bind(this))}.bind(this));else{var i=b;if(i.indexOf("/gitapi/commit/")===0){var u=i.indexOf("/file"),v=i.indexOf("?",u);if(v===-1)v=i.length;i=i.substring(u,v);this._readonly=!0}var t=window.setTimeout(function(){t=null;this.reportStatus(k.formatMessage(h.Fetching,c))}.bind(this),800),q=function(){this.reportStatus("");t&&window.clearTimeout(t)}.bind(this),w=function(a){q();var c=null;if(this.serviceRegistry)c=this.serviceRegistry.getService("orion.page.message");else if(this.statusService)c=
this.statusService;g(c,a);this._setNoInput()}.bind(this);this._acceptPatch=null;e(this._read(i,!0),h.ReadingMetadata,i).then(function(d){d?d.Directory?j.when(d.Children||e(a.fetchChildren(d.ChildrenLocation),h.Reading,c),function(a){q();d.Children=a;this._setInputContents(this._parsedLocation,c,a,d)}.bind(this),w):this._isText(d)?e(a.read(b,!1,!0),h.Reading,c).then(function(a){q();if(typeof a!=="string")this._acceptPatch=a.acceptPatch,a=a.result;this._setInputContents(this._parsedLocation,c,a,d)}.bind(this),
w):e(a._getService(b).readBlob(b),h.Reading,c).then(function(a){q();this._setInputContents(this._parsedLocation,c,a,d)}.bind(this),w):w({responseText:k.formatMessage(h.ReadingMetadataError,i)})}.bind(this),w)}}},processParameters:function(c){var a=this.getEditor();a&&a.processParameters&&a.processParameters(c)},getAutoLoadEnabled:function(){return this._autoLoadEnabled},getAutoSaveEnabled:function(){return this._autoSaveEnabled},getEditor:function(){return this.editor},getInput:function(){return this._input},
getTitle:function(){return this._title},getFileMetadata:function(){return this._fileMetadata},getReadOnly:function(){var c=this._fileMetadata;return this._readonly||!c||c.Attributes&&c.Attributes.ReadOnly},getContentType:function(){return this._contentType},onFocus:function(){this._autoSaveEnabled&&this._errorSaving?this.save():this._autoLoadEnabled&&this.load()},onChanging:function(c){if(this._getSaveDiffsEnabled()){var a=this._unsavedChanges.length,b=c.removedCharCount,d=c.start,e=c.start+b,f=0;
c.addedCharCount===0?f=-1:b===0&&(f=1);if(a>0&&f===this.previousChangeType){a=this._unsavedChanges[a-1];if(b===0&&d===a.end+a.text.length){a.text+=c.text;return}if(c.addedCharCount===0&&e===a.start){a.start=d;return}}this.previousChangeType=f;this._unsavedChanges.push({start:d,end:e,text:c.text})}},reportStatus:function(c){this.statusReporter?this.statusReporter(c):this.editor&&this.editor.reportStatus(c)},save:function(){function c(a){if(e===r.getInput())r.getFileMetadata().ETag=a.ETag,b.setInput(e,
null,f,!0);r.reportStatus("");d&&n&&n.setProgressResult({Message:h.Saved,Severity:"Normal"});r.afterSave&&r.afterSave();r._saving=!1}function a(a){r.reportStatus("");g(n,a);r._saving=!1;r._errorSaving=!0}if(!this._saving){var b=this.getEditor();if(b&&b.isDirty()&&!this.getReadOnly()){var d=this._errorSaving;this._saving=!0;var e=this.getInput();this.reportStatus(h["Saving..."]);this.dispatchEvent({type:"Saving",inputManager:this});b.markClean();var f=b.getText(),i=f;if(this._getSaveDiffsEnabled()&&
!this._errorSaving){for(var j=this._unsavedChanges,v=0,t=0;t<j.length;t++)v+=j[t].text.length;f.length>v&&(i={diff:j})}this._unsavedChanges=[];this._errorSaving=!1;var j={ETag:this.getFileMetadata().ETag},q=this._parsedLocation.resource,i=this.fileClient.write(q,i,j),w=this.progressService,n=null;this.serviceRegistry&&(n=this.serviceRegistry.getService("orion.page.message"));w&&(i=w.progress(i,k.formatMessage(h.savingFile,e)));var r=this;i.then(c,function(b){b.status===412?window.confirm(h.saveOutOfSync)?
(b=r.fileClient.write(q,f),w&&(b=w.progress(b,k.formatMessage(h.savingFile,e))),b.then(c,a)):r._saving=!1:a(b)})}}},setAutoLoadEnabled:function(c){this._autoLoadEnabled=c},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(c){this._contentType=c},setInput:function(c){if(!this._ignoreInput&&
(c||(c=i.hash()),typeof c==="string")){var a=this.getEditor();c&&c[0]!=="#"&&(c="#"+c);var b=i.matchResourceParameters(c),d=this._parsedLocation||{};if(a&&a.isDirty()){var e=this._location;if(d.resource!==b.resource)if(this._autoSaveEnabled)this.save();else if(!window.confirm(h.confirmUnsavedChanges)){window.location.hash=e;return}}a=a&&d.editor!==b.editor;this._location=c;this._parsedLocation=b;this._ignoreInput=!0;this.selection&&this.selection.setSelections(c);this._ignoreInput=!1;(c=b.resource)?
c===this._input?a?(this.reportStatus(""),this._setInputContents(b,c,null,this._fileMetadata,this._isText(this._fileMetadata))):this.processParameters(b):(this._input=c,this._readonly=!1,this._fileMetadata=null,this.load()):this._setNoInput(!0)}},setTitle:function(c){var a=c.lastIndexOf("/");a!==-1&&(c=c.substring(a+1));this._title=c},setSaveDiffsEnabled:function(c){this._saveDiffsEnabled=c},_getSaveDiffsEnabled:function(){return this._saveDiffsEnabled&&this._acceptPatch!==null&&this._acceptPatch.indexOf("application/json-patch")!==
-1},_isText:function(c){c=this.contentTypeRegistry.getFileContentType(c);if(!c)return!0;var a=this.contentTypeRegistry.getContentType("text/plain");return this.contentTypeRegistry.isExtensionOf(c,a)},_setNoInput:function(c){c?this.fileClient.loadWorkspace("").then(function(a){this._input=a.ChildrenLocation;this._setInputContents(a.ChildrenLocation,null,a,a)}.bind(this)):(this._input=this._title=this._fileMetadata=null,this.setContentType(null),this.dispatchEvent({type:"InputChanged",input:null}))},
_setInputContents:function(c,a,b,d,e){var f,g=!1;d?(this._fileMetadata=d,this.setTitle(d.Location||String(d)),this.setContentType(this.contentTypeRegistry.getFileContentType(d)),f=d.Name,g=d.Directory):(this._fileMetadata=null,this.setTitle(a),this.setContentType(this.contentTypeRegistry.getFilenameContentType(this.getTitle())),f=this.getTitle());var h=this.getEditor();if(this._focusListener)h&&h.getTextView&&h.getTextView()&&h.getTextView().removeEventListener("Focus",this._focusListener),this._focusListener=
null;if(this._changingListener)h&&h.getModel&&h.getModel()&&h.getModel().removeEventListener("Changing",this._changingListener),this._changingListener=null;d={type:"InputChanged",input:c,name:f,title:a,contentType:this.getContentType(),metadata:d,location:window.location,contents:b};this.dispatchEvent(d);this.editor=h=d.editor;if(!g){if(h&&h.getModel&&h.getModel())h.getModel().addEventListener("Changing",this._changingListener=this.onChanging.bind(this));e||h.setInput(a,null,b);if(h&&h.getTextView&&
h.getTextView())h.getTextView().addEventListener("Focus",this._focusListener=this.onFocus.bind(this));this._unsavedChanges=[];this.processParameters(c)}}});return{handleError:g,InputManager:e}});
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(h,k,j,f,d,i,b,g,e,c,a,l,m,o,s,p,u){function v(a){this._syntaxHighlither=
new g.SyntaxHighlighter(a)}k={};k.DefaultDiffProvider=function(){function a(c){this.serviceRegistry=c;this._diffProvider=new i.DiffProvider(c)}a.prototype={_resolveTwoFiles:function(a,c){var b=this;return j.all([b._getContentType(a),b._getContentType(c)],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:b._resolveFileName(a),Type:e},newFile:{URL:c,Name:b._resolveFileName(c),Type:d},diffContent:b._diffContent})}else return e=
a?b._resolveFileName(a):"",d=c?b._resolveFileName(c):"",(new j).resolve({oldFile:{URL:a,Name:e,Type:null},newFile:{URL:c,Name:d,Type:null},diffContent:b._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 c=this;return this._diffProvider.getDiffFileURI(a).then(function(a){return c._resolveTwoFiles(a.Old,
a.New)},function(){})},resolveDiff:function(a,c,b){this._hasConflicts=b;if(c)return this._resolveTwoFiles(c,a);else if(this._diffProvider){var d=this;return d._diffProvider.getDiffContent(a).then(function(c){d._diffContent=d._hasConflicts?c.split("diff --git")[1]:c;return d._resolveComplexFileURL(a)},function(){})}else console.log("A diff provider is needed for compound diff URL")}};return a}();v.prototype={highlight:function(a,c,b){return this._syntaxHighlither.setup(c,b.getTextView(),null,a,!1)}};
k.ResourceComparer=function(){function g(a,c,d,f){this._registry=a;this._commandService=c;this._fileClient=new e.FileClient(a);this._fileClient=new e.FileClient(a);this._searchService=this._registry.getService("orion.core.search");this._progress=this._registry.getService("orion.page.progress");this.setOptions(d,!0);this._compareView=d.toggleable?new b.toggleableCompareView(d.type==="inline"?"inline":"twoWay",f):d.type==="inline"?new b.inlineCompareView(f):new b.TwoWayCompareView(f);this._compareView.getWidget().setOptions({extCmdHolder:this});
f.highlighters||this._compareView.getWidget().setOptions({highlighters:[new v(a),new v(a)]});f.oldFile||this._compareView.getWidget().setOptions({oldFile:{readonly:this._checkReadonly(d.readonlyRight)}});f.newFile||this._compareView.getWidget().setOptions({newFile:{readonly:this._checkReadonly(d.readonly,!0)}});this.initExtCmds();this._initInputManagers();this._compareView.getWidget().initEditors(h["fetching..."]);this._inputManagers.forEach(function(a){if(a.manager){var c=this._compareView.getWidget().getEditors()[a.manager._editorIndex];
c.addEventListener("DirtyChanged",function(){a.manager.setDirty(c.isDirty())})}}.bind(this))}g.prototype={_clearOptions:function(){this.options={}},_checkReadonly:function(a,c){return c?typeof a==="undefined"?!1:a:typeof a==="undefined"?!0:a},_getFileOptions:function(a){return a===1?this._compareView.getWidget().options.newFile:this._compareView.getWidget().options.oldFile},_createInputManager:function(){return new p.InputManager({serviceRegistry:this._registry,fileClient:this._fileClient,progressService:this._progress})},
_initInputManagers:function(){this._inputManagers=[{},{}];if(!this.options.toggleable&&this._compareView.getWidget()._uiFactory&&this._compareView.getWidget().type==="twoWay"){if(!this._checkReadonly(this.options.readonlyRight))this._inputManagers[0].manager=this._createInputManager(),this._initInputManager(this._inputManagers[0].manager,0,this._compareView.getWidget()._uiFactory.getActionDivId());if(!this._checkReadonly(this.options.readonly,!0))this._inputManagers[1].manager=this._createInputManager(),
this._initInputManager(this._inputManagers[1].manager,1,this._compareView.getWidget()._uiFactory.getActionDivId(!0))}var a=this;this._inputManagers.forEach(function(c){if(c.manager)this._getFileOptions(c.manager._editorIndex).keyBindingFactory=function(b,d,e,f){d=new m.TextSearcher(b,a._registry,a._commandService,e);e=(new u.KeyBindingsFactory).createKeyBindings(b,e,f,d);(new o.EditorCommandFactory({serviceRegistry:a._registry,commandRegistry:a._commandService,fileClient:a._fileClient,inputManager:c.manager,
toolbarId:c.manager._actionBarId,readonly:!1,navToolbarId:"pageNavigationActions",textSearcher:d})).generateSimpleEditorCommands(b,c.manager._editorIndex===1?"orion.compare.save.left":"orion.compare.save.right");return e}}.bind(this))},_initInputManager:function(a,b,d){var e=this;s.mixin(a,{filePath:"",_editorIndex:b,_actionBarId:d,getInput:function(){return this.filePath},setDirty:function(a){var b=e._compareView.getWidget().getEditors(),d=a;b&&b.length===2&&(d=b[0].isDirty()||b[1].isDirty());c.setDirtyIndicator(d);
e._compareView.getWidget().refreshTitle&&e._compareView.getWidget().refreshTitle(this._editorIndex,a)},getFileMetadata:function(){return this._fileMetadata},getEditor:function(){return e._compareView.getWidget().getEditors()[this._editorIndex]},setInput:function(a){this._parsedLocation={resource:a};e._progress.progress(e._fileClient.read(a,!0),"Getting file metadata "+a).then(function(a){this._fileMetadata=a;var c=f.node(this._actionBarId);if(c){e._commandService.destroy(c);var b=this._editorIndex;
e._commandService.renderCommands(c.id,c,e._compareView.getWidget().getEditors()[b],e._compareView.getWidget().getEditors()[b],"button")}a&&this.setTitle(a.Location,a)}.bind(this),function(c){console.error("Error loading file metadata: "+c.message);this.setTitle(a)}.bind(this));this.lastFilePath=a},setTitle:function(a){a.charAt(0)==="*"?c.setDirtyIndicator(!0):c.setDirtyIndicator(!1)},afterSave:function(){var a=e._compareView.getWidget().getEditors()[this._editorIndex].getTextView().getText();e._getFileOptions(this._editorIndex).Content=
a;e._compareView.getWidget().refresh()}})},setOptions:function(a,c){c&&this._clearOptions();if(!this.options)this.options={};a&&Object.keys(a).forEach(function(c){this.options[c]=a[c]}.bind(this))},generateLink:function(a){a=a.getCurrentDiffPos();a=d.generateCompareHref(this.options.resource,{compareTo:this.options.compareTo,readonly:this.options.readonly,readonlyRight:this.options.readonlyRight,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(h["Copy the link URL:"],a)},openComparePage:function(a){a=a.getCurrentDiffPos();return d.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 c=this._compareView.getWidget().options.commandProvider;if(c&&c.getOptions().commandSpanId){var c=c.getOptions().commandSpanId,b=new a.Command({tooltip:h["Generate link of the current diff"],
name:h["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:h["Open the compare page"],name:h.Compare,id:"orion.compare.openComparePage",groupId:"orion.compareGroup",visibleWhen:function(a){return a.options.extCmdHolder.options.resource&&!a.options.extCmdHolder.options.generateLink},
hrefCallback:function(a){return a.items.options.extCmdHolder.openComparePage(a.items)}});this._commandService.addCommand(b);this._commandService.addCommand(d);this._commandService.registerCommandContribution(c,"orion.compare.openComparePage",98);this._commandService.registerCommandContribution(c,"orion.compare.generateLink",99,null,!1,new l.KeyBinding("l",!0,!0))}},_getFilesContents:function(a){var c=[];a.forEach(function(a){c.push(this._loadSingleFile(a))}.bind(this));return j.all(c,function(a){return{_error:a}})},
_isImage:function(a){switch(a&&a.id){case "image/jpeg":case "image/png":case "image/gif":case "image/ico":case "image/tiff":case "image/svg":return!0}return!1},_loadSingleFile:function(a){return this._registry.getService("orion.page.progress").progress(this._fileClient.read(a.URL),"Getting contents of "+a.URL).then(function(c){a.Content=c;return a}.bind(this),function(c){if(c.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(c){a._compareView.getWidget().setOptions(c);var c=a._isImage(c.newFile.Type),b=a._compareView.getWidget().options;if(a._checkReadonly(a.options.readonlyRight)||c)b.oldFile.readonly=!0;if(a._checkReadonly(a.options.readonly,!0)||c)b.newFile.readonly=!0;return c?(a._compareView.initImageMode(),a._compareView.getWidget().refresh().then(function(a){return(new j).resolve(a+5)})):
a._getFilesContents(b.diffContent?[b.oldFile]:[b.oldFile,b.newFile]).then(function(){var c=a._compareView.getWidget().refresh(!0);this._inputManagers.forEach(function(c){if(c.manager){var b=a._getFileOptions(c.manager._editorIndex),d=a._compareView.getWidget().getEditors()[c.manager._editorIndex];c.manager.filePath=b.URL;c.manager.setInput(b.URL,d)}});return(new j).resolve(c)}.bind(a))})}else console.log("A diff provider is needed for Complex diff URL")}};return g}();return k});
define("orion/git/util",["orion/URL-shim"],function(){function h(d){for(var h=0;h<f.length;h++)if(d.type===f[h])return!0;return!1}function k(d){for(var f=0;f<j.length;f++)if(d.type===j[f])return!0;return!1}var j=["Missing","Modified","Untracked","Conflicting"],f=["Added","Changed","Removed"];return{statusUILocation:"git/git-status.html",isStaged:h,isUnstaged:k,isChange:function(d){return h(d)||k(d)},hasStagedChanges:function(d){for(var h=0;h<f.length;h++)if(d[f[h]].length>0)return!0;return!1},hasUnstagedChanges:function(d){for(var f=
0;f<j.length;f++)if(d[j[f]].length>0)return!0;return!1},parseSshGitUrl:function(d){try{var f=new URL(d);return{host:f.hostname,port:f.port}}catch(b){try{var g=d.split(":")[0].split("@");return{host:g.length>1?g[1]:g[0],port:22}}catch(e){return{host:"",port:""}}}}}});
define("orion/git/uiUtil",["orion/compare/compareCommands","orion/compare/resourceComparer","orion/webui/littlelib","orion/git/util"],function(h,k,j,f){f=Object.create(f);f.createCompareWidget=function(d,f,b,g,e,c,a,l,m){var o=new k.DefaultDiffProvider(d),c=new h.CompareCommandFactory({commandService:f,commandSpanId:c,gridRenderer:l});(new k.ResourceComparer(d,f,{toggleable:!0,type:"inline",readonly:!0,hasConflicts:g,diffProvider:o,resource:b,compareTo:m,editableInComparePage:a},{parentDivId:e,commandProvider:c})).start().then(function(a){var c=
420;a<c&&(c=a);j.node(e).style.height=c+"px"})};return f});
define("orion/git/gitPreferenceStorage",["orion/Deferred"],function(h){function k(h){this._prefix="/git/credentials";this._preferenceService=h.getService("orion.core.preference")}k.prototype={put:function(j,f){var d={gitSshUsername:"",gitSshPassword:"",gitPrivateKey:"",gitPassphrase:""};if(f!==void 0){if(f.gitSshUsername!==void 0&&f.gitSshUsername!==null)d.gitSshUsername=f.gitSshUsername;if(f.gitSshPassword!==void 0&&f.gitSshPassword!==null)d.gitSshPassword=f.gitSshPassword;if(f.gitPrivateKey!==void 0&&
f.gitPrivateKey!==null)d.gitPrivateKey=f.gitPrivateKey;if(f.gitPassphrase!==void 0&&f.gitPassphrase!==null)d.gitPassphrase=f.gitPassphrase}var i=new h;this._preferenceService.getPreferences(this._prefix,2).then(function(b){var f=b.get("settings");f===void 0?i.reject():f.enabled?(b.put(j,d),i.resolve()):i.reject()});return i},get:function(j){var f={gitSshUsername:"",gitSshPassword:"",gitPrivateKey:"",gitPassphrase:""},d=new h;this._preferenceService.getPreferences(this._prefix,2).then(function(h){var b=
h.get("settings");b===void 0?d.reject():b.enabled?(h=h.get(j),h!==void 0?d.resolve(h):d.resolve(f)):d.reject()});return d},isEnabled:function(){var j=new h;this._preferenceService.getPreferences(this._prefix,2).then(function(f){f=f.get("settings");f===void 0?j.resolve(!1):j.resolve(f.enabled)});return j},enable:function(){var j=new h;this._preferenceService.getPreferences(this._prefix,2).then(function(f){f.put("settings",{enabled:!0});j.resolve()});return j},disable:function(){var j=new h;this._preferenceService.getPreferences(this._prefix,
2).then(function(f){f.put("settings",{enabled:!1});j.resolve()});return j},remove:function(j){var f=new h;this._preferenceService.getPreferences(this._prefix,2).then(function(d){d.remove(j);f.resolve()});return f},getRepositories:function(){var j=new h;this._preferenceService.getPreferences(this._prefix,2).then(function(f){for(var d=[],f=f.keys(),h=0;h<f.length;++h)f[h]!=="settings"&&d.push(f[h]);j.resolve(d)});return j}};return k.prototype.constructor=k});
define("orion/git/gitConfigPreference",["orion/Deferred"],function(h){function k(h){this._prefix="/git/config";this._preferenceService=h.getService("orion.core.preference")}k.prototype={getConfig:function(){var j=new h;this._preferenceService.getPreferences(this._prefix).then(function(f){f=f.get("userInfo");j.resolve(f)});return j},setConfig:function(j){var f=new h;this._preferenceService.getPreferences(this._prefix).then(function(d){d.put("userInfo",j);f.resolve()});return f}};return k.prototype.constructor=
k});
define("orion/git/widgets/ConfirmPushDialog",["i18n!git/nls/gitmessages","orion/webui/dialog"],function(h,k){function j(f){this._init(f)}j.prototype=new k.Dialog;j.prototype.TEMPLATE='<div id="header"></div>';j.prototype._init=function(f){var d=this;this.title="Git Push";this.modal=!0;this.messages=h;this.location=f.location;this.dialog2=f.dialog;this.func=f.func;this.buttons=[];this.dialog2&&this.buttons.push({callback:function(){d.destroy();d.dialog2.show()},text:"More"});this.buttons.push({callback:function(){d.destroy();d.func()},
text:"OK"});this._initialize()};j.prototype._bindToDom=function(){var f=this.$header;f.appendChild(document.createTextNode("You are going to push to the following remote: "+this.location));f.appendChild(document.createElement("br"));this.dialog2&&f.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(h,k,j,f){function d(b,d){this.explorer=d;this._init(b)}function i(b){this._init(b)}var b=function(){function b(d,c,a,f){this.gitClient=d;this.rootPath=c;this.fetchItems=a;this.root=f?f: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 d=0;d<a.Children.length;d++)a.Children[d].parent=b;c(a.Children)}):b.Type==="Remote"&&this.gitClient.getGitBranch(b.Location).then(function(a){b.children=a.Children;for(var d=0;d<a.Children.length;d++)a.Children[d].parent=b;c(a.Children)})};return b}();d.prototype=new j.SelectionRenderer;d.prototype.constructor=
d;d.prototype.getLabelColumnIndex=function(){return 0};d.prototype.getCellElement=function(b,d,c){var a=document.createElement("td");c.appendChild(a);b=document.createElement("span");b.id=c.id+"navSpan";a.appendChild(b);b.className="mainNavColumn singleNavColumn";(d.children||d.Children||d.GroupNode||d.Type==="Remote"||d.BranchLocation&&d.RemoteLocation)&&this.getExpandImage(c,b);c=d.Name;d.Type==="RemoteTrackingBranch"&&!d.Id&&(c=d.Name+h[" [New branch]"]);b.appendChild(document.createTextNode(c))};
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 d=this;this.title=b.title||h["Choose a Folder"];this.modal=!0;this.messages=h;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(){d.$remoteOk.classList.contains(this.DISABLED)||(d.destroy(),d._execute.bind(d)())},text:"OK",isDefault:!0,id:"remoteOk"})};i.prototype._bindToDom=function(){var b=this;this.$newBranch.addEventListener("input",function(){b._validate()});this.$newBranch.placeholder=h["No remote selected"];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 e=this,c=this.serviceRegistry.getService("orion.remotePrompter.selection");c||(c=new f.Selection(this.serviceRegistry,"orion.remotePrompter.selection"));var a=new d({checkbox:!1,singleSelection:!0,
treeTableClass:"directoryPrompter"});this.explorer=new j.Explorer(this.serviceRegistry,c,a);a.explorer=this.explorer;this.explorer.createTree("treeContentPane",b);c.addEventListener("selectionChanged",function(a){a.selection&&a.selection.Type==="Remote"?(e.$newBranch.disabled=!1,e.$newBranch.placeholder=h["Enter a name..."]):(e.$newBranch.disabled=!0,e.$newBranch.placeholder=h["No remote selected"]);e._validate(a.selection)})};i.prototype._validate=function(b){var d=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?d.bind(this)(b):this.serviceRegistry.getService("orion.remotePrompter.selection").getSelection(d.bind(this))};i.prototype._execute=function(){var b=this;this.serviceRegistry.getService("orion.remotePrompter.selection").getSelection(function(d){if(b.func)if(d.Type==="RemoteTrackingBranch")b.func(d,d.parent);else{var c=
d.CloneLocation.substring(d.CloneLocation.indexOf(d.CloneLocation.split("/")[3])),a={};a.parent=d;a.FullName="refs/remotes/"+d.Name+"/"+b.$newBranch.value;a.Name=d.Name+"/"+b.$newBranch.value;a.Type="RemoteTrackingBranch";a.Location="/gitapi/remote/"+d.Name+"/"+encodeURIComponent(encodeURIComponent(b.$newBranch.value))+"/"+c;b.func(null,d,a)}})};i.prototype.constructor=i;return{RemotePrompterDialog:i}});
define("orion/git/widgets/ReviewRequestDialog",["i18n!git/nls/gitmessages","orion/webui/dialog"],function(h,k){function j(f){this._init(f)}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(f){var d=this;this.title=f.title||h["Contribution Review Request"];this.modal=!0;this.messages=h;this.url=f.url;this.func=f.func;this.buttons=[];this.buttons.push({callback:function(){d.destroy();d.func(d.$reviewerName.value)},text:h.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(h){return{makeRelative:function(h){if(!h)return h;var j=window.location.protocol+"//"+window.location.host;return h.indexOf(j)===0?h.substring(j.length):h},isAtRoot:function(k){if(!k)return!1;if(k==="/workspace")return!0;var j=new URL(h.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,orion/Deferred,orion/webui/littlelib,orion/i18nUtil,orion/fileUtils,orion/explorers/explorer,orion/EventTarget,orion/objects,orion/util".split(","),function(h,k,j,f,d,i,b,g,e){function c(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){b.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 c=a.modelEventDispatcher?a.modelEventDispatcher:new b;this.modelEventDispatcher=c;var d=this;this._modelListeners={};"copy,copyMultiple,create,delete,deleteMultiple,import,move,moveMultiple".split(",").forEach(function(a){c.addEventListener(a,
d._modelListeners[a]=d.modelHandler[a].bind(d))});this._clickListener=function(a){if(a.target.tagName==="A"){for(a=a.target;a;){if(a._item)break;a=a.parentNode}if(a&&a._item)d.onLinkClick({type:"linkClick",item:a._item})}};(a=j.node(this.parentId))&&a.addEventListener("click",this._clickListener);var e=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";e.setTarget&&
e.setTarget(a)}},{pid:"nav.config"})}c.prototype=new i.ExplorerModel;g.mixin(c.prototype,{getRoot:function(a){a(this.root)},processParent:function(a,b){var c=a.Projects?[]:[a].concat(a.Parents||[]);if(this.excludeFiles||this.excludeFolders){var d=[],e;for(e in b)if(!(b[e].Directory?this.excludeFolders:this.excludeFiles))if(d.push(b[e]),b[e].parent=a,!b[e].Parents)b[e].Parents=c;b=d}else for(d in b)if(b[d].parent=a,!b[d].Parents)b[d].Parents=c;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},getChildren:function(a,b){var c=this;if(a.children)b(a.children);else if(a.Directory!==void 0&&a.Directory===!1)b([]);else if(a.Children)b(c.processParent(a,a.Children));else if(a.Location){var d=null;this.registry&&(d=this.registry.getService("orion.page.progress"));(d?d.progress(this.fileClient.fetchChildren(a.ChildrenLocation),h["Fetching children of "]+a.Name):this.fileClient.fetchChildren(a.ChildrenLocation)).then(function(d){c.destroyed||
b(c.processParent(a,d))},function(){b([])})}else b([])},hasChildren:function(){var a=!1;this.root.Children&&(a=this.root.Children.length>0);return a}});c.prototype.constructor=c;var l,m;a.prototype=Object.create(i.Explorer.prototype);g.mixin(a.prototype,{destroy:function(){var a=this;Object.keys(this._modelListeners).forEach(function(b){a.modelEventDispatcher.removeEventListener(b,a._modelListeners[b])});var b=j.node(this.parentId);b&&b.removeEventListener("click",this._clickListener);i.Explorer.prototype.destroy.call(this)},
onLinkClick:function(a){this.dispatchEvent(a)},onModelCreate:function(a){return this.changedItem(a.parent,!0)},onModelCopy:function(a){var b=this,c={};(a.items||[a]).forEach(function(a){var n;n=(a=a.parent)||b.treeRoot,a=n;c[a.Location]=a});return k.all(Object.keys(c).map(function(a){return b.changedItem(c[a],!0)}))},onModelMove:function(a){var b=this,c={};(a.items||[a]).forEach(function(a){var d=b.treeRoot;if((d.Location||d.ContentLocation)===a.oldValue.Location){var e=b.treeRoot,a=a.newValue,a=
a.ChildrenLocation?a:this.fileClient.read(a.ContentLocation,!0);return k.when(a,function(a){b.dispatchEvent({type:"rootMoved",oldValue:e,newValue:a});b.loadResourceList(a)})}d=(d=a.oldValue.parent)||b.treeRoot;c[d.Location]=d;d=(d=a.parent)||b.treeRoot;c[d.Location]=d;if(a.oldValue.Directory&&a.newValue&&b.isExpanded(a.oldValue))c[a.newValue.Location]=a.newValue});return k.all(Object.keys(c).map(function(a){return b.changedItem(c[a],!0)}))},onModelDelete:function(a){var a=a.items||[a],b=this,c=b.treeRoot,
d;if(a.some(function(a){if(a.oldValue.Location===(c.Location||c.ContentLocation)){if(a.oldValue.Location!==(a.parent.Location||a.parent.ContentLocation))d=a.parent;return!0}return!1}))return this.loadResourceList(d);else{var e={};a.forEach(function(a){a=a.parent;e[a.Location]=a});return k.all(Object.keys(e).map(function(a){return b.changedItem(e[a],!0)}))}},modelHandler:{copy:function(a){return a.count?void 0:this.onModelCopy(a)},copyMultiple:function(a){return this.onModelCopy(a)},create:function(a){return this.onModelCreate(a)},
"delete":function(a){return a.count?void 0:this.onModelDelete(a)},deleteMultiple:function(a){return this.onModelDelete(a)},"import":function(a){return this.changedItem(a.target,!0)},move:function(a){return a.count?void 0:this.onModelMove(a)},moveMultiple:function(a){return this.onModelMove(a)}},_makeDropTarget:function(a,b,c){if(this.dragAndDrop){var g=this,i=this.dragAndDrop,k=function(a){l=a.target};if(c)this._oldDragStart&&b.removeEventListener("dragstart",this._oldDragStart,!1),this._oldDragStart=
k;b.addEventListener("dragstart",k,!1);k=function(){l=null};if(c)this._oldDragEnd&&b.removeEventListener("dragend",this._oldDragEnd,!1),this._oldDragEnd=k;b.addEventListener("dragend",k,!1);k=function(a){b.classList.remove("dragOver");a.preventDefault();a.stopPropagation()};if(c)this._oldDragLeave&&b.removeEventListener("dragleave",this._oldDragLeave,!1),this._oldDragLeave=k;b.addEventListener("dragleave",k,!1);k=function(a){if(l)m=a.dataTransfer.dropEffect=(e.isMac?a.altKey:a.ctrlKey)?"copy":"move";
else if(!e.isIE&&(a.dataTransfer.effectAllowed==="all"||a.dataTransfer.effectAllowed==="uninitialized"||a.dataTransfer.effectAllowed.indexOf("copy")>=0))a.dataTransfer.dropEffect="copy";b.classList.add("dragOver");j.stop(a)};if(c)this._oldDragEnter&&b.removeEventListener("dragenter",this._oldDragEnter,!1),this._oldDragEnter=k;b.addEventListener("dragenter",k,!1);k=function(a){if(l)m=a.dataTransfer.dropEffect=(e.isMac?a.altKey:a.ctrlKey)?"copy":"move";else if(!e.isIE&&(a.dataTransfer.effectAllowed===
"all"||a.dataTransfer.effectAllowed==="uninitialized"||a.dataTransfer.effectAllowed.indexOf("copy")>=0))a.dataTransfer.dropEffect="copy";j.stop(a)};if(c&&!this._oldDragOver)b.addEventListener("dragover",k,!1),this._oldDragOver=k;var q=null;g.registry&&(q=g.registry.getService("orion.page.progress"));var w=function(a){q?q.setProgressResult(a):window.console.log(a)},n=function(b,c,e,g,i,j){if(!e.Location&&e.fileMetadata)e=e.fileMetadata;c=c||"";if(b.isFile)d.isAtRoot(e.Location)?g.registry&&g.registry.getService("orion.page.message").setProgressResult({Severity:"Error",
Message:h["You cannot copy files directly into the workspace.  Create a folder first."]}):b.file(function(a){i(e,a,g,a.name.indexOf(".zip")===a.name.length-4&&window.confirm(f.formatMessage(h["Unzip ${0}?"],a.name)))});else if(b.isDirectory){var k=b.createReader(),l=function(a){k.readEntries(function(d){for(var e=0;e<d.length;e++)n(d[e],c+b.name+"/",a,g,i,j)})};d.isAtRoot(e.Location)?(q?q.progress(j.createProject(e.ChildrenLocation,b.name),f.formatMessage(h["Creating ${0}"],b.name)):j.createProject(e.ChildrenLocation,
b.name)).then(function(a){g.loadResourceList(g.treeRoot.Path,!0);(q?q.progress(j.read(a.ContentLocation,!0),h["Loading "]+a.name):j.read(a.ContentLocation,!0)).then(function(a){l(a)},w)},w):(q?q.progress(j.createFolder(e.Location,b.name),f.formatMessage(h["Creating ${0}"],b.name)):j.createFolder(e.Location,b.name)).then(function(b){g.modelEventDispatcher.dispatchEvent({type:"create",parent:a,newValue:b});l(b)},w)}},k=function(c){var e;b.classList.remove("dragOver");if(l){e=g.fileClient;for(var k=
l,p;k;){if(k._item){p=k._item;break}k=k.parentNode}if(!p)return;var t=m==="copy",k=t?e.copyFile:e.moveFile;(q?q.showWhile(k.apply(e,[p.Location,a.Location]),f.formatMessage(h[t?"Copying ${0}":"Moving ${0}"],p.Location)):k.apply(e,[p.Location,a.Location])).then(function(b){g.modelEventDispatcher.dispatchEvent({type:t?"copy":"move",oldValue:p,newValue:b,parent:a})},w)}else if(c.dataTransfer.items&&c.dataTransfer.items.length>0)for(e=0;e<c.dataTransfer.items.length;e++)k=null,typeof c.dataTransfer.items[e].getAsEntry===
"function"?k=c.dataTransfer.items[e].getAsEntry():typeof c.dataTransfer.items[e].webkitGetAsEntry==="function"&&(k=c.dataTransfer.items[e].webkitGetAsEntry()),k&&n(k,null,a,g,i,g.fileClient);else if(c.dataTransfer.files&&c.dataTransfer.files.length>0)for(e=0;e<c.dataTransfer.files.length;e++)k=c.dataTransfer.files[e],!k.size&&!k.type?g.registry&&g.registry.getService("orion.page.message").setProgressResult({Severity:"Error",Message:f.formatMessage(h["Did not drop ${0}.  Folder drop is not supported in this browser."],
k.name)}):d.isAtRoot(a.Location)?g.registry&&g.registry.getService("orion.page.message").setProgressResult({Severity:"Error",Message:h["You cannot copy files directly into the workspace.  Create a folder first."]}):i(a,k,g,k.name.indexOf(".zip")===k.name.length-4&&window.confirm(f.formatMessage(h["Unzip ${0}?"],k.name)));j.stop(c)};if(c)this._oldDrop&&b.removeEventListener("drop",this._oldDrop,!1),this._oldDrop=k;b.addEventListener("drop",k,!1)}},createModel:function(){return new c(this.registry,
this.treeRoot,this.fileClient,this.parentId,this.excludeFiles,this.excludeFolders)},changedItem:function(a,b){if(this.treeRoot&&this.treeRoot.Location===a.Location)return this.loadResourceList(this.treeRoot,b);var c=this,d=new k;a.children=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},showItem:function(a,b){var c=new k;if(!a||!this.model||!this.myTree||!this.myTree.showRoot&&a.Location===this.treeRoot.Location)return c.reject();
var d=this.getRow(a);if(d)c.resolve(d._item||a);else return a.Parents&&a.Parents.length>0?(a.Parents[0].Parents=a.Parents.slice(1),this.expandItem(a.Parents[0],b).then(function(b){var c=this.getRow(a);return!c?this.changedItem(b,!0).then(function(){var b=this.getRow(a);return b?b._item:(new k).reject()}.bind(this)):c._item||a}.bind(this))):b===void 0||b?this.reroot(a):c.reject();return c},expandItem:function(a,b){var c=new k;this.showItem(a,b).then(function(a){this.myTree.isExpanded(a)?c.resolve(a):
this.myTree.expand(this.model.getId(a),function(){c.resolve(a)})}.bind(this),c.reject);return c},reveal:function(a,b){return this.showItem(a,b).then(function(a){var b=this.getNavHandler();b&&(b.cursorOn(a,!0),b.setSelection(a));return a}.bind(this))},reroot:function(){return(new k).reject()},isExpanded:function(a){return this.renderer.tableTree.isExpanded(this.model.getId(a))},getNameNode:function(a){if(a=this.model.getId(a))return j.node(a+"NameLink")},scopeUp:function(){},scopeDown:function(){},
loadResourceList:function(a,b,c){a&&typeof a==="object"&&(a=a.ChildrenLocation||a.ContentLocation);a=d.makeRelative(a);if(!b&&a===this._lastPath)return(new k).resolve(this.treeRoot);this._lastPath=a;var e=this;return b||a!==this.treeRoot.Path?this.load(this.fileClient.loadWorkspace(a),h["Loading "]+a).then(function(){e.treeRoot.Path=a;typeof c==="function"&&c();e.dispatchEvent({type:"rootChanged",root:e.treeRoot});return(new k).resolve(e.treeRoot)},function(a){e.treeRoot.Path=null;e.dispatchEvent({type:"rootChanged",
root:e.treeRoot});return(new k).reject(a)}):(new k).resolve(e.treeRoot)},load:function(a,b,c){var d=j.node(this.parentId),e=j.node("progress");if(!e)e=document.createElement("div"),e.id="progress",j.empty(d),d.appendChild(e);j.empty(e);var f=setTimeout(function(){j.empty(e);e.appendChild(document.createTextNode(b))},500),g=this;return k.when(a,function(a){clearTimeout(f);if(!g.destroyed){g.treeRoot={};for(var b in a)g.treeRoot[b]=a[b];g.model=g.createModel();if(g.dragAndDrop)g._hookedDrag?g._makeDropTarget(g.treeRoot,
d,!0):(a=(a=d&&("draggable"in d||"ondragstart"in d&&"ondrop"in d))&&!(!window.File||!window.FileList||!window.FileReader),g._hookedDrag=!0,a?g._makeDropTarget(g.treeRoot,d,!0):(g.dragAndDrop=null,window.console.log("Local file drag and drop is not supported in this browser.")));var e=new k;g.createTree(g.parentId,g.model,{onComplete:function(a){e.resolve(a)},navHandlerFactory:g.navHandlerFactory,setFocus:typeof g.setFocus==="undefined"?!0:g.setFocus,selectionPolicy:g.renderer.selectionPolicy,onCollapse:function(a){if(g.getNavHandler())g.getNavHandler().onCollapse(a)}});
return e.then(function(){if(typeof c==="function")try{c()}catch(a){g.registry&&g.registry.getService("orion.page.message").setErrorMessage(a)}if(typeof g.onchange==="function")g.onchange(g.treeRoot);return g.treeRoot})}},function(a){clearTimeout(f);g.registry&&g.registry.getService("orion.page.message").setProgressResult(a);return(new k).reject(a)})},onchange:function(){}});a.prototype.constructor=a;return{FileExplorer:a,FileModel:c}});
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(h,k,j,f,d,i,b,g){function e(a,b){this.explorer=b;this._init(a)}function c(a){this._init(a)}e.prototype=new b.SelectionRenderer;e.prototype.constructor=e;e.prototype.getLabelColumnIndex=function(){return 0};e.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))};c.prototype=new j.Dialog;c.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>';
c.prototype._init=function(a){this.title=a.title||h["Choose a Folder"];this.modal=!0;this.buttons=[{text:h.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()};c.prototype._bindToDom=function(){this.loadFolderList("/");this._message?this.$message.appendChild(document.createTextNode(this._message)):this.$message.style.display="none";this.$directoryTree.focus()};
c.prototype.loadFolderList=function(a){a=f.makeRelative(a);this.selection=new d.Selection(this._serviceRegistry,"orion.directoryPrompter.selection");this.explorer=new g.FileExplorer({treeRoot:{children:[]},selection:this.selection,serviceRegistry:this._serviceRegistry,fileClient:this._fileClient,parentId:"directoryTree",excludeFiles:!0,rendererFactory:function(a){return new e({checkbox:!1,singleSelection:!0,treeTableClass:"directoryPrompter"},a)}});this.explorer.loadResourceList(a,!0,null)};c.prototype.done=
function(){this.selection.getSelection(function(a){this.hide();this._func(a)}.bind(this))};c.prototype.constructor=c;return{DirectoryPrompterDialog:c}});
define("orion/git/widgets/CloneGitRepositoryDialog",["i18n!git/nls/gitmessages","orion/webui/dialogs/DirectoryPrompterDialog","orion/webui/dialog","orion/URITemplate","require"],function(h,k,j,f,d){function i(b){this._init(b)}var b=new f("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 d=this;this.title=b.title?b.title:h["Clone Git Repository"];this.modal=!0;this.messages=h;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(){d.destroy();d._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 f(a){var c=document.createElement("a");
c.href=d.toUrl(b.expand({resource:a.ChildrenLocation}));c.textContent=a.Name;return c}var e=this;this.$isExistingProject.checked=!0;var c=new k.DirectoryPrompterDialog({title:h["Choose a Folder"],serviceRegistry:this.serviceRegistry,fileClient:this.fileClient,func:function(a){if(a&&a.Location){for(e.$gitPath.value=a.Location;e.$shownGitPath.hasChildNodes();)e.$shownGitPath.removeChild(e.$shownGitPath.lastChild);for(e.$shownGitPath.appendChild(f(a));a.parent&&a.parent.Location!=="/";)e.$shownGitPath.insertBefore(document.createTextNode("/"),
e.$shownGitPath.firstChild),e.$shownGitPath.insertBefore(f(a.parent),e.$shownGitPath.firstChild),a=a.parent}}});this._addChildDialog(c);c.show()};i.prototype.constructor=i;return{CloneGitRepositoryDialog:i}});
define("orion/git/widgets/GitCredentialsDialog",["i18n!git/nls/gitmessages","orion/git/gitPreferenceStorage","orion/webui/dialog","orion/git/util"],function(h,k,j,f){function d(d){this._init(d)}d.prototype=new j.Dialog;d.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">${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>';d.prototype._init=
function(d){var b=this;this.title=d.title||h["Git Credentials"];this.modal=!0;this.messages=h;this.options=d;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(d.serviceRegistry)this._sshService=d.serviceRegistry.getService("orion.net.ssh"),this._progressService=d.serviceRegistry.getService("orion.page.progress");this.buttons=[];this.buttons.push({callback:function(){b.destroy();
b._execute()},text:"OK",isDefault:!0});this._initialize()};d.prototype._bindToDom=function(){var d=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(){d.$gitSshPassword.focus()},400);(new k(this.options.serviceRegistry)).isEnabled().then(function(b){if(!b)d.$gitSaveCredentials.style.display="none",d.$gitSaveCredentialsLabel.style.display="none",d.$gitSaveCredentialsInfo.style.display=
"none"});this.$gitSshPassword.addEventListener("focus",function(){d.$isSshPassword.checked=!0});this.$gitPrivateKey.addEventListener("focus",function(){d.$isPrivateKey.checked=!0});this.$gitPrivateKeyFile.addEventListener("focus",function(){d.$isPrivateKey.checked=!0});this.$gitPassphrase.addEventListener("focus",function(){d.$isPrivateKey.checked=!0});this.$gitPrivateKeyFile.addEventListener("change",function(b){d.privateKeyFile=b.target.files[0]})};d.prototype._execute=function(){var d=this,b=this.$gitPrivateKey.value,
g=this.$url.textContent,e=function(a){if(d._sshService){var b=f.parseSshGitUrl(g);d._sshService.getKnownHostCredentials(b.host,b.port).then(function(b){if(d.options.func){var c=typeof d.options.failedOperation==="undefined"?d.options.errordata.failedOperation:d.options.failedOperation;c!=="undefined"&&d._progressService.removeOperation(c);d.options.func({gitSshUsername:d.$gitSshUsername.value,gitSshPassword:d.$isSshPassword.checked?d.$gitSshPassword.value:"",gitPrivateKey:d.$isPrivateKey.checked?
a:"",gitPassphrase:d.$isPrivateKey.checked?d.$gitPassphrase.value:"",knownHosts:b})}})}else d.options.func&&(b=typeof d.options.failedOperation==="undefined"?d.options.errordata.failedOperation:d.options.failedOperation,b!=="undefined"&&d._progressService.removeOperation(b),d.options.func({gitSshUsername:d.$gitSshUsername.value,gitSshPassword:d.$gitSshPassword.value,gitPrivateKey:a,gitPassphrase:d.$gitPassphrase.value,knownHosts:d.$gitSshKnownHosts.value}))};if(this.privateKeyFile){var c=new FileReader;
c.onload=function(){return function(a){b=a.target.result;a=new k(d.options.serviceRegistry);d.$gitSaveCredentials.checked?a.put(g,{gitPrivateKey:b,gitPassphrase:d.$gitPassphrase.value}).then(function(){e(b)}):e(b)}}(this.privateKeyFile);c.readAsText(this.privateKeyFile)}else b.length>0?(c=new k(d.options.serviceRegistry),d.$gitSaveCredentials.checked?c.put(g,{gitPrivateKey:b,gitPassphrase:d.$gitPassphrase.value}).then(function(){e(b)}):e(b)):(c=new k(d.options.serviceRegistry),d.$gitSaveCredentials.checked?
c.put(g,{gitSshUsername:d.$gitSshUsername.value,gitSshPassword:d.$gitSshPassword.value}).then(function(){e(b)}):e(b))};d.prototype.constructor=d;return{GitCredentialsDialog:d}});
define("orion/git/widgets/OpenCommitDialog","require,i18n!git/nls/gitmessages,orion/i18nUtil,orion/Deferred,orion/webui/dialog,orion/URITemplate,orion/webui/littlelib".split(","),function(h,k,j,f,d,i,b){function g(b){this._init(b)}var e=new i("git/git-commit.html#{,resource,params*}?page=1&pageSize=1");g.prototype=new d.Dialog;g.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>';
g.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()};g.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 d=b.$("a",c.$results);d&&(b.stop(a),window.open(d.href),c.hide())}},!1);this.$resourceName.value=this.commitName};g.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)};g.prototype._findCommitLocation=function(b,a,d){var e=this;d||(d=new f);b.length>0?this.serviceRegistry.getService("orion.page.progress").progress(e.serviceRegistry.getService("orion.git.provider").doGitLog("/gitapi/commit/"+a+b[0].ContentLocation+"?page=1&pageSize=1"),"Getting commit details "+a).then(function(a){d.resolve(a.Children[0])},function(){e._findCommitLocation(b.slice(1),a,d)}):d.reject();return d};g.prototype._doSearch=function(){var c=this,a=this.$resourceName&&this.$resourceName.value;
if(a){var d=document.createElement("div");d.appendChild(document.createTextNode(k["Searching..."]));b.empty(this.$results);this.$results.appendChild(d);this.serviceRegistry.getService("orion.page.message").setProgressMessage(k["Looking for the commit"]);this._findCommitLocation(this.repositories,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("")})}};g.prototype._displayCommit=function(c,a){var d=this,f=document.createElement("div");f.style.padding="10px";f.style.maxWidth="480px";b.empty(a);a.appendChild(f);var g=c.Message.split(/(\r?\n|$)/)[0],i=document.createElement("a");i.className="navlinkonpage";i.href=h.toUrl(e.expand({resource:c.Location}));i.textContent=g;f.appendChild(i);i.addEventListener("mouseup",function(a){a.button===
0&&!a.ctrlKey&&!a.metaKey&&d.hide()},!1);i.addEventListener("keyup",function(a){a.keyCode===b.KEY.ENTER&&d.hide()},!1);g=document.createElement("div");g.style.paddingTop="15px";f.appendChild(g);if(c.AuthorImage)f=new Image,f.src=c.AuthorImage,f.name=c.AuthorName,f.className="git-author-icon",g.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());g.appendChild(f);f=document.createElement("div");
f.textContent=j.formatMessage(k["committed by 0 (1)"],c.CommitterName,c.CommitterEmail);g.appendChild(f);f=document.createElement("div");f.style.paddingTop="15px";f.textContent=k["commit:"]+c.Name;g.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=h.toUrl(e.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&&d.hide()},!1),f.addEventListener("keyup",function(a){a.keyCode===b.KEY.ENTER&&d.hide()},!1),g.appendChild(a)};g.prototype._beforeHiding=function(){clearTimeout(this._timeoutId)};g.prototype.constructor=g;return{OpenCommitDialog:g}});
define("orion/git/widgets/CommitDialog",["i18n!git/nls/gitmessages","orion/webui/dialog"],function(h,k){function j(f){this._init(f)}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="changeIdLabel" for="changeId">${ChangeId:}</label><input id="changeId" 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(f){var d=this;this.title=h["Commit Changes"];this.modal=!0;this.messages=h;this.options=f;this.buttons=[];this.buttons.push({callback:function(){d._execute()},text:"OK",id:"commitChangesButton"});this._initialize()};j.prototype._bindToDom=function(){var f=this;if(this.options.body.Message)this.$commitMessage.value=this.options.body.Message;this.$commitMessage.addEventListener("keyup",function(){f._validate()});if(this.options.body.Amend)this.$amend.checked=!0;if(this.options.body.ChangeId)this.$changeId.checked=
!0;if(this.options.body.CommitterName)this.$committerName.value=this.options.body.CommitterName;this.$committerName.addEventListener("keyup",function(){f._validate()});if(this.options.body.CommitterEmail)this.$committerEmail.value=this.options.body.CommitterEmail;this.$committerEmail.addEventListener("keyup",function(){f._validate()});if(this.options.body.AuthorName)this.$authorName.value=this.options.body.AuthorName;this.$authorName.addEventListener("keyup",function(){f._validate()});if(this.options.body.AuthorEmail)this.$authorEmail.value=
this.options.body.AuthorEmail;this.$authorEmail.addEventListener("keyup",function(){f._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=
h["The author mail is required."]):(this.$commitInfoBar.style.display="block",this.$commitChangesButton.classList.add(this.DISABLED),this.$commitInfo.textContent=h["The author name is required."]):(this.$commitInfoBar.style.display="block",this.$commitChangesButton.classList.add(this.DISABLED),this.$commitInfo.textContent=h["The committer mail is required."]):(this.$commitInfoBar.style.display="block",this.$commitChangesButton.classList.add(this.DISABLED),this.$commitInfo.textContent=h["The committer name is required."]):
(this.$commitInfoBar.style.display="block",this.$commitChangesButton.classList.add(this.DISABLED),this.$commitInfo.textContent=h["The commit message is required."])};j.prototype._execute=function(){if(!this.$commitChangesButton.classList.contains(this.DISABLED)){if(this.options.func){var f={};f.Message=this.$commitMessage.value;f.Amend=this.$amend.checked?!0:!1;f.ChangeId=this.$changeId.checked?!0:!1;f.CommitterName=this.$committerName.value;f.CommitterEmail=this.$committerEmail.value;f.AuthorName=
this.$authorName.value;f.AuthorEmail=this.$authorEmail.value;this.options.func(f)}this.hide()}};j.prototype.constructor=j;return{CommitDialog:j}});
define("orion/git/widgets/ApplyPatchDialog",["i18n!git/nls/gitmessages","orion/webui/dialog"],function(h,k){function j(f){this._init(f)}j.prototype=new k.Dialog;j.prototype.TEMPLATE='<div style="padding:4px"><input type="radio" name="radio" value="urlRadio" id="urlRadio" checked/>'+h["URL:"]+'<input type="text" name="url" id="url"/></div><div style="padding:4px"><input type="radio" name="radio" value="fileRadio" id="fileRadio"/>'+h["File:"]+'<input type="file" name="selectedFile" id="selectedFile" class="uploadChooser" /></div>';
j.prototype._init=function(f){var d=this;this.title=h["Apply Patch"];this.modal=!0;this.messages=h;this.options=f;this.buttons=[];this.buttons.push({callback:function(){d._applyPatch()},text:h.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 f=
new FormData;f.append("uploadedfile",this.$selectedFile.files[0]);f.append("url",this.$url.value);f.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(f)};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(h,
k,j,f,d,i,b,g,e,c,a,l,m,o,s,p,u,v,t,q,w,n){var r={};(function(){function q(a){return k.toUrl(G.expand({resource:a}))}function z(a){var b;try{b=JSON.parse(a.responseText)}catch(c){b={Message:h["Problem while performing the action"]}}b.HttpCode=a.status;return b}var A=!1,D=new n("git/git-repository.html#{,resource,params*}"),I=new n("git/git-log.html#{,resource,params*}?page=1"),E=new n("git/git-log.html#{,resource,params*}"),y=new n("git/git-commit.html#{,resource,params*}?page=1&pageSize=1"),G=new n(g.statusUILocation+
"#{,resource,params*}"),F=new n("edit/edit.html#{,resource,params*}");r.updateNavTools=function(a,b,c,e,f,g,h){var i=d.node(e);if(i)b.destroy(i);else throw"could not find toolbar "+e;b.renderCommands(e,i,g,c,"button");if(h&&(e=d.node(h)))b.destroy(e),b.renderCommands(h,e,g,c,"button");if(f&&(g=d.node(f)))b.destroy(f),b.renderCommands(f,g,null,c,"button");A||(A=!0,a.getService("orion.page.selection").addEventListener("selectionChanged",function(a){var e=d.node(f);e&&(b.destroy(e),b.renderCommands(f,
e,a.selections,c,"button"))}))};r.handleKnownHostsError=function(a,b,c,d){if(confirm(f.formatMessage(h["Would you like to add ${0} key for host ${1} to continue operation? Key fingerpt is ${2}."],b.KeyType,b.Host,b.HostFingerprint))){var e=g.parseSshGitUrl(b.Url),b={host:b.Host,keyType:b.KeyType,hostKey:b.HostKey,port:e.port};a.getService("orion.net.ssh").addKnownHost(b).then(function(b){c.knownHosts=b;typeof c.failedOperation!=="undefined"&&a.getService("orion.page.progress").removeOperation(c.failedOperation);
d(c)})}};r.handleSshAuthenticationError=function(a,b,d,e,f){var b=b?b.Url:void 0,g=function(){(new p.GitCredentialsDialog({title:f,serviceRegistry:a,func:e,errordata:d.errordata,failedOperation:d.failedOperation})).show()};d.gitSshUsername&&d.gitSshUsername!==""||d.gitSshPassword&&d.gitSshPassword!==""||d.gitPrivateKey&&d.gitPrivateKey!==""?g():(new c(a)).get(b).then(function(b){b.gitPrivateKey!==""||b.gitSshUsername!==""||b.gitSshPassword!==""?(typeof d.failedOperation!=="undefined"&&a.getService("orion.page.progress").removeOperation(d.failedOperation),
e({knownHosts:d.knownHosts,gitSshUsername:b.gitSshUsername,gitSshPassword:b.gitSshPassword,gitPrivateKey:b.gitPrivateKey,gitPassphrase:b.gitPassphrase})):g()},g)};r.getDefaultSshOptions=function(a,b,c){var d=new j,a=a.getService("orion.net.ssh"),e=c&&!c.optionsRequested?c.valueFor("sshuser"):"",f=c&&!c.optionsRequested?c.valueFor("sshpassword"):"",h;if(b.GitUrl!==void 0)h=b.GitUrl;else if(b.errorData!==void 0)h=b.errorData.Url;else if(b.toRef!==void 0)h=b.toRef.RemoteLocation[0].GitUrl;else if(b.RemoteLocation!==
void 0)h=b.RemoteLocation[0].GitUrl;if(!h)return d.resolve({knownHosts:"",gitSshUsername:e,gitSshPassword:f,gitPrivateKey:"",gitPassphrase:""}),d;b=g.parseSshGitUrl(h);a.getKnownHostCredentials(b.host,b.port).then(function(a){d.resolve({knownHosts:a,gitSshUsername:e,gitSshPassword:f,gitPrivateKey:"",gitPassphrase:""})});return d};r.handleProgressServiceResponse=function(a,b,c,d,e,f){a&&a.status!==void 0&&(a=z(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;r.handleSshAuthenticationError(c,a.JsonData,b,e,f);break;case 400:if(a.JsonData&&a.JsonData.HostKey){if(a.failedOperation)b.failedOperation=a.failedOperation;r.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;r.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)}};r.gatherSshCredentials=function(a,b,d){var e=new j,i;if(b.items.RemoteLocation!==void 0)i=b.items.RemoteLocation[0].GitUrl;else if(b.items.GitUrl!==void 0)i=b.items.GitUrl;else if(b.items.errorData!==void 0)i=b.items.errorData.Url;else if(b.items.toRef!==void 0)i=b.items.toRef.RemoteLocation[0].GitUrl;var k=a.getService("orion.net.ssh"),l=g.parseSshGitUrl(i),m=function(c){a.getService("orion.net.ssh").getKnownHostCredentials(l.host,
l.port).then(function(a){b.sshObject=c;e.resolve({knownHosts:a,gitSshUsername:c.gitSshUsername,gitSshPassword:c.gitSshPassword,gitPrivateKey:c.gitPrivateKey,gitPassphrase:c.gitPassphrase})})},n=b.errorData;if(n&&n.HostKey){if(confirm(f.formatMessage(h["Would you like to add ${0} key for host ${1} to continue operation? Key fingerpt is ${2}."],n.KeyType,n.Host,n.HostFingerprint))){var o=g.parseSshGitUrl(n.Url);k.addKnownHost({host:n.Host,keyType:n.KeyType,hostKey:n.HostKey,port:o.port}).then(function(){b.sshObject&&
(b.sshObject.gitSshUsername!==""||b.sshObject.gitSshPassword!==""||b.sshObject.gitPrivateKey!=="")?m({gitSshUsername:"",gitSshPassword:"",gitPrivateKey:"",gitPassphrase:""}):(new c(a)).get(i).then(function(a){m(a)},function(){m({gitSshUsername:"",gitSshPassword:"",gitPrivateKey:"",gitPassphrase:""})})})}return e}var r=function(){if(!b.parameters&&!b.optionsRequested)m({gitSshUsername:"",gitSshPassword:"",gitPrivateKey:"",gitPassphrase:""});else if(b.parameters&&!b.optionsRequested){var e=b.parameters&&
b.parameters.valueFor("sshuser")?b.parameters.valueFor("sshuser"):b.errorData.User,f=b.parameters?b.parameters.valueFor("sshpassword"):"",g=b.parameters&&b.parameters.valueFor("saveCredentials")?b.parameters.valueFor("saveCredentials"):!1,h=new c(a);g?h.put(i,{gitSshUsername:e,gitSshPassword:f}).then(function(){m({gitSshUsername:e,gitSshPassword:f,gitPrivateKey:"",gitPassphrase:""})}):m({gitSshUsername:e,gitSshPassword:f,gitPrivateKey:"",gitPassphrase:""})}else(new p.GitCredentialsDialog({title:d,
serviceRegistry:a,func:m,errordata:n})).show()};b.sshObject&&(b.sshObject.gitSshUsername!==""||b.sshObject.gitSshPassword!==""||b.sshObject.gitPrivateKey!=="")?r():(new c(a)).get(i).then(function(a){a.gitPrivateKey!==""||a.gitSshUsername!==""||a.gitSshPassword!==""?m(a):r()},r);return e};r.handleGitServiceResponse=function(a,b,c,d){a&&a.status!==void 0&&(a=z(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)}};r.createFileCommands=function(a,d,g){function n(b){var c={Severity:"Error",HTML:!1};try{var d=JSON.parse(b.responseText);b.status===401?(c.HTML=!0,c.Message="<span>",c.Message+=f.formatMessage(h["Authentication required for: ${0}. ${1} and re-try the request."],d.label,'<a target="_blank" href="'+d.SignInLocation+'">'+h.Login+"</a>")+"</span>"):
c.Message=d.DetailedMessage?d.DetailedMessage:d.Message?d.Message:h["Problem while performing the action"]}catch(e){c.Message=h["Problem while performing the action"]}a.getService("orion.page.message").setProgressResult(c)}var p=new b.ParametersDescription([new b.CommandParameter("name","text",h["Local Branch Name:"])]),p=new i.Command({name:h.Checkout,tooltip:h["Checkout the current tag, creating a local branch based on its contents."],imageClass:"git-sprite-checkout",spriteClass:"gitCommandSprite",
id:"eclipse.checkoutTag",parameters:p,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),f.formatMessage(h["Checking out tag ${0}"],d)).then(function(){g.changedItem()},n)},e=c.Repository?c.Repository.Location:c.CloneLocation;b.parameters.valueFor("name")&&!b.parameters.optionsRequested&&d(e,c.Name,b.parameters.valueFor("name"))},visibleWhen:function(a){return a.Type==="Tag"}});d.addCommand(p);p=
new i.Command({name:h.Checkout,tooltip:h["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"),e=a.getService("orion.page.message"),i=a.getService("orion.page.progress");e.setProgressMessage(c.Name?f.formatMessage(h["Checking out branch ${0}..."],
c.Name):h["Checking out branch..."]);c.Type==="Branch"?i.progress(d.checkoutBranch(c.CloneLocation,c.Name),"Checking out branch "+c.Name).then(function(){e.setProgressResult(h["Branch checked out."]);g.changedItem(c.parent)},function(a){n(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(){e.setProgressResult(h["Branch checked out."]);
g.changedItem(c.Repository?c.Repository.BranchLocation:c.parent.parent.parent)},function(a){n(a)})},function(a){n(a)})},visibleWhen:function(a){return a.Type==="Branch"||a.Type==="RemoteTrackingBranch"}});d.addCommand(p);p=new b.ParametersDescription([new b.CommandParameter("name","text","Name:")]);p=new i.Command({name:h["New Branch"],tooltip:h["Add a new local branch to the repository"],id:"eclipse.addBranch",parameters:p,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(){g.changedItem(c)},n)},f;f=c.Type==="Clone"?c.BranchLocation:c.Location;b.parameters.valueFor("name")&&!b.parameters.optionsRequested&&e(f,b.parameters.valueFor("name"))},visibleWhen:function(a){return a.GroupNode&&a.Name==="Branches"||a.Type==="Clone"&&g.parentId==="artifacts"}});d.addCommand(p);p=new i.Command({name:h.Delete,tooltip:h["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(f.formatMessage(h["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(){g.changedItem?g.changedItem(c.parent):g.displayBranches&&g.displayBranches(c.ParentLocation,null)},n)},visibleWhen:function(a){return a.Type==="Branch"&&!a.Current}});d.addCommand(p);p=new i.Command({name:h.Delete,
tooltip:h["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(f.formatMessage(h["You're going to delete remote branch ${0} and push the change."],c.Name)+"\n\n"+h["Are you sure?"])&&r.getDefaultSshOptions(a,c).then(function(b){var e=arguments.callee,f=a.getService("orion.git.provider"),i=a.getService("orion.page.message"),f=d.progress(f.doPush(c.Location,
"",!1,!1,b.gitSshUsername,b.gitSshPassword,b.knownHosts,b.gitPrivateKey,b.gitPassphrase),h["Removing remote branch: "]+c.Name);i.createProgressMonitor(f,h["Removing remote branch: "]+c.Name);f.then(function(d){r.handleProgressServiceResponse(d,b,a,function(a){a.Result.Severity=="Ok"&&g.changedItem(c.parent)},e,h["Delete Remote Branch"])},function(d){r.handleProgressServiceResponse(d,b,a,function(){},e,h["Removing remote branch: "]+c.Name)})})},visibleWhen:function(a){return a.Type==="RemoteTrackingBranch"}});
d.addCommand(p);p=new b.ParametersDescription([new b.CommandParameter("name","text","Name:"),new b.CommandParameter("url","url","Url:")]);p=new i.Command({name:h["New Remote"],tooltip:h["Add a new remote to the repository"],id:"eclipse.addRemote",parameters:p,callback:function(b){var c=b.items,d=a.getService("orion.page.progress"),e=function(b,e,f){d.progress(a.getService("orion.git.provider").addRemote(b,e,f),"Adding remote "+b).then(function(){g.changedItem(c)},n)},f;f=c.Type==="Clone"?c.RemoteLocation:
c.Location;b.parameters.valueFor("name")&&b.parameters.valueFor("url")&&e(f,b.parameters.valueFor("name"),b.parameters.valueFor("url"))},visibleWhen:function(a){return a.GroupNode&&a.Name==="Remotes"||a.Type==="Clone"&&g.parentId==="artifacts"}});d.addCommand(p);p=new i.Command({name:h.Delete,tooltip:h["Delete the remote from the repository"],imageClass:"core-sprite-delete",id:"eclipse.removeRemote",callback:function(b){var c=b.items;confirm(f.formatMessage(h["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(){g.changedItem(c.parent)},n)},visibleWhen:function(a){return a.Type==="Remote"}});d.addCommand(p);p=new i.Command({name:h.Pull,tooltip:h["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;r.getDefaultSshOptions(a,c).then(function(b){var f=
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),h["Pulling: "]+e);j.createProgressMonitor(i,h["Pulling: "]+e);var k;i.then(function(d){r.handleProgressServiceResponse(d,b,a,function(){c.Type==="Clone"&&g.changedItem(c)},f,"Pull Git Repository")},function(d){if(k)d.failedOperation=k;r.handleProgressServiceResponse(d,
b,a,function(){g.changedItem(c)},f,h["Pull Git Repository"])},function(a){k=a.Location})})},visibleWhen:function(a){return a.Type==="Clone"}});d.addCommand(p);p=new i.Command({name:h["Git Log"],tooltip:h["Open the log for the branch"],id:"eclipse.openGitLog",hrefCallback:function(a){return k.toUrl(I.expand({resource:a.items.CommitLocation}))},visibleWhen:function(a){return a.Type==="Branch"||a.Type==="RemoteTrackingBranch"}});d.addCommand(p);p=new i.Command({name:h["Git Log"],tooltip:h["Open the log for the repository"],
id:"eclipse.openGitLogAll",imageClass:"git-sprite-log",spriteClass:"gitCommandSprite",hrefCallback:function(a){return k.toUrl(I.expand({resource:a.items.CommitLocation}))},visibleWhen:function(a){return!a.CommitLocation||!a.StatusLocation?!1:!0}});d.addCommand(p);p=new i.Command({name:h["Git Status"],tooltip:h["Open the status for the repository"],id:"eclipse.openGitStatus",hrefCallback:function(a){return q(a.items.StatusLocation)},visibleWhen:function(a){return!a.StatusLocation?!1:!0}});d.addCommand(p);
p=new i.Command({name:h.ShowInEditor,tooltip:h.ShowInEditorTooltip,id:"eclipse.openCloneContent",hrefCallback:function(a){return k.toUrl(F.expand({resource:a.items.ContentLocation}))},visibleWhen:function(a){return!a.ContentLocation?!1:!0}});d.addCommand(p);p=new i.Command({name:h["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 e.generateCompareHref(a.Location,{readonly:!0})})},visibleWhen:function(a){return g.isDirectory?!1:Array.isArray(a)&&a.length===2&&a[0].Type==="Commit"&&a[1].Type==="Commit"?!0:!1}});d.addCommand(p);p=new i.Command({name:h["Compare With Working Tree"],imageClass:"git-sprite-compare",spriteClass:"gitCommandSprite",id:"eclipse.compareWithWorkingTree",hrefCallback:function(a){return e.generateCompareHref(a.items.DiffLocation,{})},visibleWhen:function(a){return a.Type===
"Commit"&&a.ContentLocation!==null&&!g.isDirectory}});d.addCommand(p);p=new i.Command({name:h.Open,id:"eclipse.openGitCommit",imageClass:"git-sprite-open",spriteClass:"gitCommandSprite",hrefCallback:function(a){return k.toUrl(F.expand({resource:a.items.ContentLocation}))},visibleWhen:function(a){return a.Type==="Commit"&&a.ContentLocation!=null&&!g.isDirectory}});d.addCommand(p);p=new i.Command({name:h.Fetch,tooltip:h["Fetch from the remote"],imageClass:"git-sprite-fetch",spriteClass:"gitCommandSprite",
id:"eclipse.orion.git.fetch",callback:function(e){var f=e.items,i=f.Location,j=f.Name,k=function(e,f){e.JsonData.HostKey?(f.parameters=null,f.errorData=e.JsonData,f.errorData.failedOperation=e.failedOperation,d.collectParameters(f)):f.optionsRequested?(f.errorData=e.JsonData,f.errorData.failedOperation=e.failedOperation,d.collectParameters(f)):(new c(a)).isEnabled().then(function(a){f.parameters=a?e.JsonData.User?new b.ParametersDescription([new b.CommandParameter("sshpassword","password",h["Password:"]),
new b.CommandParameter("saveCredentials","boolean",h["Don't prompt me again:"])],{hasOptionalParameters:!0}):new b.ParametersDescription([new b.CommandParameter("sshuser","text",h["User Name:"]),new b.CommandParameter("sshpassword","password",h["Password:"]),new b.CommandParameter("saveCredentials","boolean",h["Don't prompt me again:"])],{hasOptionalParameters:!0}):e.JsonData.User?new b.ParametersDescription([new b.CommandParameter("sshpassword","password",h["Password:"])],{hasOptionalParameters:!0}):
new b.ParametersDescription([new b.CommandParameter("sshuser","text",h["User Name:"]),new b.CommandParameter("sshpassword","password",h["Password:"])],{hasOptionalParameters:!0});f.errorData=e.JsonData;f.errorData.failedOperation=e.failedOperation;d.collectParameters(f)})},l=function(){e.parameters&&e.parameters.optionsRequested?(e.parameters=null,e.optionsRequested=!0,d.collectParameters(e)):(e.errorData&&e.errorData.failedOperation&&a.getService("orion.page.progress").removeOperation(e.errorData.failedOperation),
r.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),h["Fetching remote: "]+j);d.createProgressMonitor(b,h["Fetching remote: "]+j);b.then(function(b){r.handleGitServiceResponse(b,a,function(){g.changedItem(f)},function(a){k(a,e)})},function(b){r.handleGitServiceResponse(b,a,function(){g.changedItem(f)},
function(a){k(a,e)})})}))};if(e.items.GitUrl)l();else{var m=a.getService("orion.git.provider"),o=a.getService("orion.page.progress");o.progress(m.getGitRemote(i),"Getting remote details "+j).then(function(a){o.progress(m.getGitClone(a.CloneLocation),"Getting git repository information "+a.Name).then(function(a){e.items.GitUrl=a.Children[0].GitUrl;l()},n)},n)}},visibleWhen:function(a){return a.Type==="RemoteTrackingBranch"?!0:a.Type==="Remote"?!0:a.Type==="Commit"&&a.toRef&&a.toRef.Type==="RemoteTrackingBranch"?
!0:!1}});d.addCommand(p);p=new i.Command({name:h["Force Fetch"],imageClass:"git-sprite-fetch",spriteClass:"gitCommandSprite",tooltip:h["Fetch from the remote branch into your remote tracking branch overriding its current content"],id:"eclipse.orion.git.fetchForce",callback:function(e){if(confirm(h["You're going to override content of the remote tracking branch. This can cause the branch to lose commits."]+"\n\n"+h["Are you sure?"])){var f=e.items,i=f.Location,j=f.Name,k=function(e,f){e.JsonData.HostKey?
(f.parameters=null,f.errorData=e.JsonData,f.errorData.failedOperation=e.failedOperation,d.collectParameters(f)):f.optionsRequested?(f.errorData=e.JsonData,d.collectParameters(f)):(new c(a)).isEnabled().then(function(a){f.parameters=a?e.JsonData.User?new b.ParametersDescription([new b.CommandParameter("sshpassword","password",h["Password:"]),new b.CommandParameter("saveCredentials","boolean",h["Don't prompt me again:"])],{hasOptionalParameters:!0}):new b.ParametersDescription([new b.CommandParameter("sshuser",
"text",h["User Name:"]),new b.CommandParameter("sshpassword","password",h["Password:"]),new b.CommandParameter("saveCredentials","boolean",h["Don't prompt me again:"])],{hasOptionalParameters:!0}):e.JsonData.User?new b.ParametersDescription([new b.CommandParameter("sshpassword","password",h["Password:"])],{hasOptionalParameters:!0}):new b.ParametersDescription([new b.CommandParameter("sshuser","text",h["User Name:"]),new b.CommandParameter("sshpassword","password",h["Password:"])],{hasOptionalParameters:!0});
f.errorData=e.JsonData;f.errorData.failedOperation=e.failedOperation;d.collectParameters(f)})},l=function(){e.parameters&&e.parameters.optionsRequested?(e.parameters=null,e.optionsRequested=!0,d.collectParameters(e)):(e.errorData&&e.errorData.failedOperation&&a.getService("orion.page.progress").removeOperation(e.errorData.failedOperation),r.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),h["Fetching remote: "]+j);l.createProgressMonitor(b,h["Fetching remote: "]+j);b.then(function(b){r.handleGitServiceResponse(b,a,function(){g.changedItem(f)},function(a){k(a,e)})},function(b){r.handleGitServiceResponse(b,a,function(){g.changedItem(f)},function(a){k(a,e)})})}))};if(e.items.GitUrl)l();else{var m=a.getService("orion.git.provider");m.getGitRemote(i).then(function(a){m.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}});d.addCommand(p);p=new i.Command({name:h.Merge,tooltip:h["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"),
e=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+=". "+f.formatMessage(h["Failing paths: ${0}"],
i)}b.Message+=f.formatMessage(h[". Go to ${0}."],'<a href="'+q(d)+'">'+h["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+f.formatMessage(h[". Go to ${0}."],'<a href="'+q(d)+'">'+h["Git Status page"]+"</a>")+"</span>";
e.setProgressResult(b);g.changedItem(c)},function(b,d){var e=[],i=c.HeadLocation.replace("commit/HEAD","status");e.Severity="Error";e.HTML=!0;e.Message="<span>"+JSON.stringify(d.xhr.responseText).DetailedMessage+f.formatMessage(h[". Go to ${0}."],'<a href="'+q(i)+'">'+h["Git Status page"]+"</a>")+".</span>";a.getService("orion.page.message").setProgressResult(e);g.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}});d.addCommand(p);p=new i.Command({name:h["Merge Squash"],tooltip:h["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"),e=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+f.formatMessage(h[". Go to ${0}."],'<a href="'+q(d)+'">'+h["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+f.formatMessage(h[". Go to ${0}."],'<a href="'+q(d)+'">'+h["Git Status page"]+"</a>")+"</span>";e.setProgressResult(b);g.changedItem(c)},function(b,d){var e=[],i=c.HeadLocation.replace("commit/HEAD","status");e.Severity="Error";e.HTML=!0;e.Message="<span>"+JSON.stringify(d.xhr.responseText).DetailedMessage+f.formatMessage(h[". Go to ${0}."],'<a href="'+q(i)+'">'+h["Git Status page"]+
"</a>")+".</span>";a.getService("orion.page.message").setProgressResult(e);g.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}});d.addCommand(p);p=new i.Command({name:h.Rebase,tooltip:h["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?h["Rebase on top of "]+c.Name:h.Rebase);b.createProgressMonitor(d,c.Name?h["Rebase on top of "]+c.Name:h.Rebase);d.then(function(b){var d=[],e=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+h[". Some conflicts occurred. Please resolve them and continue, skip patch or abort rebasing"]+f.formatMessage(h[". Go to ${0}."],'<a href="'+q(e)+'">'+h["Git Status page"]+"</a>")+".</span>"):b.Result==="FAILED_WRONG_REPOSITORY_STATE"?(d.Severity="Error",d.HTML=!0,d.Message="<span>"+b.Result+h[". Repository state is invalid (i.e. already during rebasing)"]+
f.formatMessage(". Go to ${0}.",'<a href="'+q(e)+'">'+h["Git Status page"]+"</a>")+".</span>"):b.Result==="FAILED_UNMERGED_PATHS"?(d.Severity="Error",d.HTML=!0,d.Message="<span>"+b.Result+h[". Repository contains unmerged paths"]+f.formatMessage(h[". Go to ${0}."],'<a href="'+q(e)+'">'+h["Git Status page"]+"</a>")+".</span>"):b.Result==="FAILED_PENDING_CHANGES"?(d.Severity="Error",d.HTML=!0,d.Message="<span>"+b.Result+h[". Repository contains pending changes. Please commit or stash them"]+f.formatMessage(h[". Go to ${0}."],
'<a href="'+q(e)+'">Git Status page</a>')+".</span>"):(d.Severity="Warning",d.HTML=!0,d.Message="<span>"+b.Result+f.formatMessage(h[". Go to ${0}."],'<a href="'+q(e)+'">'+h["Git Status page"]+"</a>")+".</span>");a.getService("orion.page.message").setProgressResult(d);g.changedItem(c)},n)},visibleWhen:function(a){this.tooltip=h["Rebase your commits by removing them from the active branch, "]+h["starting the active branch again based on the latest state of '"]+a.Name+"' "+h["and applying each commit again to the updated active branch."];
return a.Type==="RemoteTrackingBranch"||a.Type==="Branch"&&!a.Current}});d.addCommand(p);p=new i.Command({name:h["Push All"],tooltip:h["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 f=e.targetBranch,i,k=e.items;if(k.toRef)k=k.toRef;k.CloneLocation.split("/");var n=function(e,f){e.JsonData.HostKey?(f.parameters=null,f.errorData=e.JsonData,f.errorData.failedOperation=
e.failedOperation,d.collectParameters(f)):f.optionsRequested?(f.errorData=e.JsonData,f.errorData.failedOperation=e.failedOperation,d.collectParameters(f)):(new c(a)).isEnabled().then(function(a){f.parameters=a?e.JsonData.User?new b.ParametersDescription([new b.CommandParameter("sshpassword","password",h["Password:"]),new b.CommandParameter("saveCredentials","boolean",h["Don't prompt me again:"])],{hasOptionalParameters:!0}):new b.ParametersDescription([new b.CommandParameter("sshuser","text",h["User Name:"]),
new b.CommandParameter("sshpassword","password",h["Password:"]),new b.CommandParameter("saveCredentials","boolean",h["Don't prompt me again:"])],{hasOptionalParameters:!0}):e.JsonData.User?new b.ParametersDescription([new b.CommandParameter("sshpassword","password",h["Password:"])],{hasOptionalParameters:!0}):new b.ParametersDescription([new b.CommandParameter("sshuser","text",h["User Name:"]),new b.CommandParameter("sshpassword","password",h["Password:"])],{hasOptionalParameters:!0});f.errorData=
e.JsonData;f.errorData.failedOperation=e.failedOperation;d.collectParameters(f)})};if(e.parameters&&e.parameters.optionsRequested)e.parameters=null,e.optionsRequested=!0,d.collectParameters(e);else{var o=a.getService("orion.git.provider"),p=a.getService("orion.page.progress");e.errorData&&e.errorData.failedOperation&&p.removeOperation(e.errorData.failedOperation);var q=function(b,c,d,f,i){var j=a.getService("orion.page.message"),b=p.progress(o.doPush(c,d,!0,i,b.gitSshUsername,b.gitSshPassword,b.knownHosts,
b.gitPrivateKey,b.gitPassphrase),h["Pushing remote: "]+f);j.createProgressMonitor(b,h["Pushing remote: "]+f);b.then(function(b){r.handleGitServiceResponse(b,a,function(){g.changedItem()},function(a){n(a,e)})},function(b){r.handleGitServiceResponse(b,a,function(){g.changedItem()},function(a){n(a,e)})})};p.progress(o.getGitClone(k.CloneLocation),"Getting git repository details "+k.Name).then(function(b){var c=b.Children[0].RemoteLocation,d=b.Children[0].ConfigLocation,g=function(b){r.handleProgressServiceResponse(b,
{},a)};r.gatherSshCredentials(a,e).then(function(b){var n=new j;if(k.RemoteLocation.length===1&&k.RemoteLocation[0].Children.length===1)n=p.progress(o.getGitRemote(c),"Getting git remote details "+k.Name);else{var r={};r.Children=k.RemoteLocation;n.resolve(r)}n.then(function(c){f?q(b,f.Location,"HEAD",f.Name,!1):(c=new m.RemotePrompterDialog({title:h["Choose Branch"],serviceRegistry:a,gitClient:o,treeRoot:{Children:c.Children},hideNewBranch:!1,func:function(a,c,f){i=a===null?f:a;var h="branch."+k.Name+
".remote";p.progress(o.addCloneConfigurationProperty(d,h,i.parent.Name),"Adding git configuration property "+k.Name).then(function(){e.targetBranch=i;q(b,i.Location,"HEAD",i.Name,!1)},function(a){a.status===409?o.getGitCloneConfig(d).then(function(a){if(a.Children)for(var c=0;c<a.Children.length;c++)if(a.Children[c].Key===h){p.progress(o.editCloneConfigurationProperty(a.Children[c].Location,i.parent.Name),"Updating configuration property "+i.parent.Name).then(function(){e.targetBranch=i;q(b,i.Location,
"HEAD",i.Name,!1)},g);break}},g):g(a)})}}),k.RemoteLocation.length===1&&k.RemoteLocation[0].Children.length===1&&(c=new l.ConfirmPushDialog({title:h["Choose Branch"],serviceRegistry:a,gitClient:o,dialog:c,location:k.RemoteLocation[0].Children[0].Name,func:function(){e.targetBranch=k.RemoteLocation[0].Children[0];q(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}});d.addCommand(p);p=new i.Command({name:h["Push Branch"],tooltip:h["Push commits without tags from your local branch into the remote branch"],imageClass:"git-sprite-push",spriteClass:"gitCommandSprite",id:"eclipse.orion.git.pushBranch",callback:function(e){var f=e.targetBranch,i,k=e.items;if(k.toRef)k=k.toRef;k.CloneLocation.split("/");var n=function(e,f){e.JsonData.HostKey?(f.parameters=null,f.errorData=e.JsonData,f.errorData.failedOperation=
e.failedOperation,d.collectParameters(f)):f.optionsRequested?(f.errorData=e.JsonData,f.errorData.failedOperation=e.failedOperation,d.collectParameters(f)):(new c(a)).isEnabled().then(function(a){f.parameters=a?e.JsonData.User?new b.ParametersDescription([new b.CommandParameter("sshpassword","password",h["Password:"]),new b.CommandParameter("saveCredentials","boolean",h["Don't prompt me again:"])],{hasOptionalParameters:!0}):new b.ParametersDescription([new b.CommandParameter("sshuser","text",h["User Name:"]),
new b.CommandParameter("sshpassword","password",h["Password:"]),new b.CommandParameter("saveCredentials","boolean",h["Don't prompt me again:"])],{hasOptionalParameters:!0}):e.JsonData.User?new b.ParametersDescription([new b.CommandParameter("sshpassword","password",h["Password:"])],{hasOptionalParameters:!0}):new b.ParametersDescription([new b.CommandParameter("sshuser","text",h["User Name:"]),new b.CommandParameter("sshpassword","password",h["Password:"])],{hasOptionalParameters:!0});f.errorData=
e.JsonData;f.errorData.failedOperation=e.failedOperation;d.collectParameters(f)})};if(e.parameters&&e.parameters.optionsRequested)e.parameters=null,e.optionsRequested=!0,d.collectParameters(e);else{var o=a.getService("orion.git.provider"),p=a.getService("orion.page.progress");e.errorData&&e.errorData.failedOperation&&p.removeOperation(e.errorData.failedOperation);var q=function(b,c,d,f,i){var j=a.getService("orion.page.message"),b=p.progress(o.doPush(c,d,!1,i,b.gitSshUsername,b.gitSshPassword,b.knownHosts,
b.gitPrivateKey,b.gitPassphrase),h["Pushing remote: "]+f);j.createProgressMonitor(b,h["Pushing remote: "]+f);b.then(function(b){r.handleGitServiceResponse(b,a,function(){g.changedItem()},function(a){n(a,e)})},function(b){r.handleGitServiceResponse(b,a,function(){g.changedItem()},function(a){n(a,e)})})};p.progress(o.getGitClone(k.CloneLocation),"Getting git repository details "+k.Name).then(function(b){var c=b.Children[0].RemoteLocation,d=b.Children[0].ConfigLocation,g=function(b){r.handleProgressServiceResponse(b,
{},a)};r.gatherSshCredentials(a,e).then(function(b){var n=new j;if(k.RemoteLocation.length===1&&k.RemoteLocation[0].Children.length===1)n=p.progress(o.getGitRemote(c),"Getting git remote details "+k.Name);else{var r={};r.Children=k.RemoteLocation;n.resolve(r)}n.then(function(c){f?q(b,f.Location,"HEAD",f.Name,!1):(c=new m.RemotePrompterDialog({title:h["Choose Branch"],serviceRegistry:a,gitClient:o,treeRoot:{Children:c.Children},hideNewBranch:!1,func:function(a,c,f){i=a===null?f:a;var h="branch."+k.Name+
".remote";p.progress(o.addCloneConfigurationProperty(d,h,i.parent.Name),"Adding git configuration property "+k.Name).then(function(){e.targetBranch=i;q(b,i.Location,"HEAD",i.Name,!1)},function(a){a.status===409?o.getGitCloneConfig(d).then(function(a){if(a.Children)for(var c=0;c<a.Children.length;c++)if(a.Children[c].Key===h){p.progress(o.editCloneConfigurationProperty(a.Children[c].Location,i.parent.Name),"Updating configuration property "+i.parent.Name).then(function(){e.targetBranch=i;q(b,i.Location,
"HEAD",i.Name,!1)},g);break}},g):g(a)})}}),k.RemoteLocation.length===1&&k.RemoteLocation[0].Children.length===1&&(c=new l.ConfirmPushDialog({title:h["Choose Branch"],serviceRegistry:a,gitClient:o,dialog:c,location:k.RemoteLocation[0].Children[0].Name,func:function(){e.targetBranch=k.RemoteLocation[0].Children[0];q(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}});d.addCommand(p);p=new i.Command({name:h["Push for Review"],tooltip:h["Push commits to Gerrit Code Review"],imageClass:"git-sprite-push",spriteClass:"gitCommandSprite",id:"eclipse.orion.git.pushToGerrit",callback:function(e){var f=e.targetBranch,i=e.items;if(i.toRef)i=i.toRef;i.CloneLocation.split("/");var k=function(e,f){e.JsonData.HostKey?(f.parameters=null,f.errorData=e.JsonData,f.errorData.failedOperation=e.failedOperation,
d.collectParameters(f)):f.optionsRequested?(f.errorData=e.JsonData,f.errorData.failedOperation=e.failedOperation,d.collectParameters(f)):(new c(a)).isEnabled().then(function(a){f.parameters=a?e.JsonData.User?new b.ParametersDescription([new b.CommandParameter("sshpassword","password",h["Password:"]),new b.CommandParameter("saveCredentials","boolean",h["Don't prompt me again:"])],{hasOptionalParameters:!0}):new b.ParametersDescription([new b.CommandParameter("sshuser","text",h["User Name:"]),new b.CommandParameter("sshpassword",
"password",h["Password:"]),new b.CommandParameter("saveCredentials","boolean",h["Don't prompt me again:"])],{hasOptionalParameters:!0}):e.JsonData.User?new b.ParametersDescription([new b.CommandParameter("sshpassword","password",h["Password:"])],{hasOptionalParameters:!0}):new b.ParametersDescription([new b.CommandParameter("sshuser","text",h["User Name:"]),new b.CommandParameter("sshpassword","password",h["Password:"])],{hasOptionalParameters:!0});f.errorData=e.JsonData;f.errorData.failedOperation=
e.failedOperation;d.collectParameters(f)})};if(e.parameters&&e.parameters.optionsRequested)e.parameters=null,e.optionsRequested=!0,d.collectParameters(e);else{var m=a.getService("orion.git.provider"),n=a.getService("orion.page.progress");e.errorData&&e.errorData.failedOperation&&n.removeOperation(e.errorData.failedOperation);var o=function(b,c,d,f,i){var j=a.getService("orion.page.message"),b=n.progress(m.doPush(c,d,!1,i,b.gitSshUsername,b.gitSshPassword,b.knownHosts,b.gitPrivateKey,b.gitPassphrase),
h["Pushing remote: "]+f);j.createProgressMonitor(b,h["Pushing remote: "]+f);b.then(function(b){r.handleGitServiceResponse(b,a,function(){g.changedItem()},function(a){k(a,e)})},function(b){r.handleGitServiceResponse(b,a,function(){g.changedItem()},function(a){k(a,e)})})};n.progress(m.getGitClone(i.CloneLocation),"Getting git repository details "+i.Name).then(function(b){var c=b.Children[0].RemoteLocation;r.gatherSshCredentials(a,e).then(function(b){var d=new j;if(i.RemoteLocation.length===1&&i.RemoteLocation[0].Children.length===
1)d=n.progress(m.getGitRemote(c),"Getting git remote details "+i.Name);else{var g={};g.Children=i.RemoteLocation;d.resolve(g)}d.then(function(){if(f)o(b,f.Location,"HEAD",f.Name,!1);else{e.targetBranch=i.RemoteLocation[0].Children[0];var c=i.RemoteLocation[0].Children[0].Location.split("/");c[4]=encodeURIComponent(encodeURIComponent("refs/for/master"));var d=c.join("/");e.targetBranch.Location=d;e.targetBranch.Name="refs/for/master";dialog=new l.ConfirmPushDialog({title:h["Choose Branch"],serviceRegistry:a,
gitClient:m,dialog:null,location:"refs/for/master",func:function(){o(b,d,"HEAD","refs/for/master",!1)}});dialog.show()}})})})}},visibleWhen:function(a){return a.toRef?a.RepositoryPath===""&&a.toRef.Type==="Branch"&&a.toRef.Current&&a.toRef.RemoteLocation&&a.toRef.RemoteLocation[0].IsGerrit:a.Type==="Branch"&&a.Current&&a.RemoteLocation&&a.RemoteLocation[0].IsGerrit}});d.addCommand(p);p=new i.Command({name:h["Force Push All"],tooltip:h["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 f=e.confirmedWarnings,i=e.targetBranch;if(!f)if(confirm(h["You're going to override content of the remote branch. This can cause the remote repository to lose commits."]+"\n\n"+h["Are you sure?"]))f=e.confirmedWarnings=!0;else return;var k,n=e.items;if(n.toRef)n=n.toRef;var o=n.CloneLocation.split("/"),p=function(e,f){e.JsonData.HostKey?(f.parameters=null,f.errorData=e.JsonData,d.collectParameters(f)):
f.optionsRequested?(f.errorData=e.JsonData,d.collectParameters(f)):(new c(a)).isEnabled().then(function(a){f.parameters=a?e.JsonData.User?new b.ParametersDescription([new b.CommandParameter("sshpassword","password",h["Password:"]),new b.CommandParameter("saveCredentials","boolean",h["Don't prompt me again:"])],{hasOptionalParameters:!0}):new b.ParametersDescription([new b.CommandParameter("sshuser","text",h["User Name:"]),new b.CommandParameter("sshpassword","password",h["Password:"]),new b.CommandParameter("saveCredentials",
"boolean",h["Don't prompt me again:"])],{hasOptionalParameters:!0}):e.JsonData.User?new b.ParametersDescription([new b.CommandParameter("sshpassword","password",h["Password:"])],{hasOptionalParameters:!0}):new b.ParametersDescription([new b.CommandParameter("sshuser","text",h["User Name:"]),new b.CommandParameter("sshpassword","password",h["Password:"])],{hasOptionalParameters:!0});f.errorData=e.JsonData;d.collectParameters(f)})};if(e.parameters&&e.parameters.optionsRequested)e.parameters=null,e.optionsRequested=
!0,d.collectParameters(e);else{var q=a.getService("orion.git.provider"),s=a.getService("orion.page.progress"),t=function(b,c,d,f,i){var j=a.getService("orion.page.message"),b=s.progress(q.doPush(c,d,!0,i,b.gitSshUsername,b.gitSshPassword,b.knownHosts,b.gitPrivateKey,b.gitPassphrase),h["Pushing remote: "]+f);j.createProgressMonitor(b,h["Pushing remote: "]+f);b.then(function(b){r.handleGitServiceResponse(b,a,function(){g.changedItem()},function(a){p(a,e)})},function(b){r.handleGitServiceResponse(b,
a,function(){g.changedItem(n)},function(a){p(a,e)})})};s.progress(q.getGitClone(n.CloneLocation),"Getting git repository details "+n.Name).then(function(b){var c=b.Children[0].RemoteLocation,d=b.Children[0].ConfigLocation;r.gatherSshCredentials(a,e).then(function(b){var f=new j;if(n.RemoteLocation.length===1&&n.RemoteLocation[0].Children.length===1)f=s.progress(q.getGitRemote(c),"Getting remote details "+n.Name);else{var g={};g.Children=n.RemoteLocation;f.resolve(g)}f.then(function(c){i?t(b,i.Location,
"HEAD",i.Name,!0):(c=new m.RemotePrompterDialog({title:h["Choose Branch"],serviceRegistry:a,gitClient:q,treeRoot:{Children:c.Children},hideNewBranch:!1,func:function(a,c,f){k=a===null?f:a;var g="/gitapi/config/branch."+n.Name+".remote/clone/file/"+o[4];s.progress(q.addCloneConfigurationProperty(d,"branch."+n.Name+".remote",k.parent.Name),"Setting git configuration property "+n.Name).then(function(){e.targetBranch=k;t(b,k.Location,"HEAD",k.Name,!0)},function(a){a.status===409&&s.progres(q.editCloneConfigurationProperty(g,
k.parent.Name),"Setting git configuration property "+k.parent.Name).then(function(){e.targetBranch=k;t(b,k.Location,"HEAD",k.Name,!0)})})}}),n.RemoteLocation.length===1&&n.RemoteLocation[0].Children.length===1&&(c=new l.ConfirmPushDialog({title:h["Choose Branch"],serviceRegistry:a,gitClient:q,dialog:c,location:n.RemoteLocation[0].Children[0].Name,func:function(){e.targetBranch=n.RemoteLocation[0].Children[0];t(b,n.RemoteLocation[0].Children[0].Location,"HEAD",n.Location,!0)}})),c.show())})})})}},
visibleWhen:function(a){if(a.toRef)return a.RepositoryPath===""&&a.toRef.Type==="Branch"&&a.toRef.Current&&a.toRef.RemoteLocation}});d.addCommand(p);p=new i.Command({name:h["Force Push Branch"],tooltip:h["Push commits without tags from your local branch into the remote branch overriding its current content"],imageClass:"git-sprite-push",spriteClass:"gitCommandSprite",id:"eclipse.orion.git.pushForceBranch",callback:function(e){var f=e.confirmedWarnings,i=e.targetBranch;if(!f)if(confirm(h["You're going to override content of the remote branch. This can cause the remote repository to lose commits."]+
"\n\n"+h["Are you sure?"]))f=e.confirmedWarnings=!0;else return;var k,n=e.items;if(n.toRef)n=n.toRef;var o=n.CloneLocation.split("/"),p=function(e,f){e.JsonData.HostKey?(f.parameters=null,f.errorData=e.JsonData,d.collectParameters(f)):f.optionsRequested?(f.errorData=e.JsonData,d.collectParameters(f)):(new c(a)).isEnabled().then(function(a){f.parameters=a?e.JsonData.User?new b.ParametersDescription([new b.CommandParameter("sshpassword","password",h["Password:"]),new b.CommandParameter("saveCredentials",
"boolean",h["Don't prompt me again:"])],{hasOptionalParameters:!0}):new b.ParametersDescription([new b.CommandParameter("sshuser","text",h["User Name:"]),new b.CommandParameter("sshpassword","password",h["Password:"]),new b.CommandParameter("saveCredentials","boolean",h["Don't prompt me again:"])],{hasOptionalParameters:!0}):e.JsonData.User?new b.ParametersDescription([new b.CommandParameter("sshpassword","password",h["Password:"])],{hasOptionalParameters:!0}):new b.ParametersDescription([new b.CommandParameter("sshuser",
"text",h["User Name:"]),new b.CommandParameter("sshpassword","password",h["Password:"])],{hasOptionalParameters:!0});f.errorData=e.JsonData;d.collectParameters(f)})};if(e.parameters&&e.parameters.optionsRequested)e.parameters=null,e.optionsRequested=!0,d.collectParameters(e);else{var q=a.getService("orion.git.provider"),s=a.getService("orion.page.progress"),t=function(b,c,d,f,i){var j=a.getService("orion.page.message"),b=s.progress(q.doPush(c,d,!1,i,b.gitSshUsername,b.gitSshPassword,b.knownHosts,
b.gitPrivateKey,b.gitPassphrase),h["Pushing remote: "]+f);j.createProgressMonitor(b,h["Pushing remote: "]+f);b.then(function(b){r.handleGitServiceResponse(b,a,function(){g.changedItem()},function(a){p(a,e)})},function(b){r.handleGitServiceResponse(b,a,function(){g.changedItem(n)},function(a){p(a,e)})})};s.progress(q.getGitClone(n.CloneLocation),"Getting git repository details "+n.Name).then(function(b){var c=b.Children[0].RemoteLocation,d=b.Children[0].ConfigLocation;r.gatherSshCredentials(a,e).then(function(b){var f=
new j;if(n.RemoteLocation.length===1&&n.RemoteLocation[0].Children.length===1)f=s.progress(q.getGitRemote(c),"Getting remote details "+n.Name);else{var g={};g.Children=n.RemoteLocation;f.resolve(g)}f.then(function(c){i?t(b,i.Location,"HEAD",i.Name,!0):(c=new m.RemotePrompterDialog({title:h["Choose Branch"],serviceRegistry:a,gitClient:q,treeRoot:{Children:c.Children},hideNewBranch:!1,func:function(a,c,f){k=a===null?f:a;var g="/gitapi/config/branch."+n.Name+".remote/clone/file/"+o[4];s.progress(q.addCloneConfigurationProperty(d,
"branch."+n.Name+".remote",k.parent.Name),"Setting git configuration property "+n.Name).then(function(){e.targetBranch=k;t(b,k.Location,"HEAD",k.Name,!0)},function(a){a.status===409&&s.progres(q.editCloneConfigurationProperty(g,k.parent.Name),"Setting git configuration property "+k.parent.Name).then(function(){e.targetBranch=k;t(b,k.Location,"HEAD",k.Name,!0)})})}}),n.RemoteLocation.length===1&&n.RemoteLocation[0].Children.length===1&&(c=new l.ConfirmPushDialog({title:h["Choose Branch"],serviceRegistry:a,
gitClient:q,dialog:c,location:n.RemoteLocation[0].Children[0].Name,func:function(){e.targetBranch=n.RemoteLocation[0].Children[0];t(b,n.RemoteLocation[0].Children[0].Location,"HEAD",n.Location,!0)}})),c.show())})})})}},visibleWhen:function(a){if(a.toRef)return a.RepositoryPath===""&&a.toRef.Type==="Branch"&&a.toRef.Current&&a.toRef.RemoteLocation}});d.addCommand(p);p=new i.Command({name:h["< Previous Page"],tooltip:h["Show previous page of git log"],id:"eclipse.orion.git.previousLogPage",hrefCallback:function(a){return k.toUrl(E.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}});d.addCommand(p);p=new i.Command({name:h["Next Page >"],tooltip:h["Show next page of git log"],id:"eclipse.orion.git.nextLogPage",hrefCallback:function(a){return k.toUrl(E.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}});d.addCommand(p);p=new i.Command({name:h["< Previous Page"],tooltip:h["Show previous page of git tags"],id:"eclipse.orion.git.previousTagPage",hrefCallback:function(a){return k.toUrl(D.expand({resource:a.items.PreviousLocation}))},visibleWhen:function(a){return a.Type==="Tag"?a.PreviousLocation!==void 0:!1}});d.addCommand(p);p=new i.Command({name:h["Next Page >"],tooltip:h["Show next page of git tags"],id:"eclipse.orion.git.nextTagPage",hrefCallback:function(a){return k.toUrl(D.expand({resource:a.items.NextLocation}))},
visibleWhen:function(a){return a.Type==="Tag"?a.NextLocation!==void 0:!1}});d.addCommand(p);p=new i.Command({name:h.Reset,tooltip:h["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(f.formatMessage(h.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,h["Resetting index..."]);b.then(function(){g.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"}});d.addCommand(p);p=new b.ParametersDescription([new b.CommandParameter("name",
"text",h["Name:"])]);p=new i.Command({name:h.Tag,tooltip:h["Create a tag for the commit"],imageClass:"git-sprite-tag",spriteClass:"gitCommandSprite",id:"eclipse.orion.git.addTag",parameters:p,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(){g.changedItem(c)},n)},e=c.Location;b.parameters.valueFor("name")&&!b.parameters.optionsRequested&&d(e,b.parameters.valueFor("name"))},
visibleWhen:function(a){return a.Type==="Commit"}});d.addCommand(p);p=new i.Command({name:h.Delete,tooltip:h["Delete the tag from the repository"],imageClass:"core-sprite-delete",id:"eclipse.removeTag",callback:function(b){var c=b.items;confirm(f.formatMessage(h["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(){g.changedItem(c.parent)},n)},visibleWhen:function(a){return a.Type===
"Tag"}});d.addCommand(p);p=new b.ParametersDescription([new b.CommandParameter("reviewer","text",h["Reviewer name"])],{hasOptionalParameters:!0});p=new i.Command({name:h["Ask for review"],tooltip:h["Ask for review tooltip"],imageClass:"core-sprite-tag",id:"eclipse.orion.git.askForReviewCommand",parameters:p,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=w.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)},n)})};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=w.getOrionHome(),a=d(a.Children[0].GitUrl);(new o.ReviewRequestDialog({title:h["Contribution Review Request"],
url:b+"/git/reviewRequest.html#"+a+"_"+f.Name,func:e})).show()},n)}},visibleWhen:function(a){return a.Type==="Commit"}});d.addCommand(p);p=new i.Command({name:h["Cherry-Pick"],tooltip:h["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"),e=c.Location.replace(c.Name,"HEAD");b.progress(d.doCherryPick(e,
c.Name),"Cherry picking "+c.Name).then(function(b){var d=[],e=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>"+h["Nothing changed."]+"</span>");else if(b.Result==="CONFLICTING")d.Severity="Warning",d.HTML=!0,e=f.formatMessage(h[". Go to ${0}."],'<a href="'+q(e)+'">'+h["Git Status page"]+"</a>")+"</span>",d.Message="<span>"+b.Result+h[". Some conflicts occurred"]+e;else if(b.Result==="FAILED"){d.Severity=
"Error";d.HTML=!0;d.Message="<span>"+b.Result;if(b.FailingPaths){var g="",i=!0,j;for(j in b.FailingPaths)i||(g+=", "),i=!1,g+=j;i||(d.Message+=". "+f.formatMessage(h["Failing paths: ${0}"],g))}d.Message+=f.formatMessage(h[". Go to ${0}."],'<a href="'+q(e)+'">'+h["Git Status page"]+"</a>")+"</span>"}else d.Severity="Warning",d.HTML=!1,d.Message=b.Result;a.getService("orion.page.message").setProgressResult(d)},n)},visibleWhen:function(a){return a.Type==="Commit"}});d.addCommand(p);p=new i.Command({name:h.Revert,
tooltip:h["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"),e=c.Location.replace(c.Name,"HEAD");b.progress(d.doRevert(e,c.Name),"Reverting "+c.Name).then(function(b){var d=[],e=c.Location.replace("commit/"+c.Name,"status");b.Result==="OK"?(d.Severity="Ok",d.HTML=!1,d.Message=b.Result):
b.Result==="FAILURE"?(e=f.formatMessage(h[". Go to ${0}."],'<a href="'+q(e)+'">'+h["Git Status page"]+"</a>")+"</span>",d.Severity="Warning",d.HTML=!0,d.Message="<span>"+b.Result+h[". Could not revert into active branch"]+e):(d.Severity="Warning",d.HTML=!1,d.Message=b.Result);a.getService("orion.page.message").setProgressResult(d)},n)},visibleWhen:function(a){return a.Type==="Commit"}});d.addCommand(p)};r.createGitClonesCommands=function(d,e,g,l,m,n){function o(a){var b={Severity:"Error",HTML:!1};
try{var c=JSON.parse(a.responseText);b.Message=c.DetailedMessage?c.DetailedMessage:c.Message?c.Message:h["Problem while performing the action"]}catch(e){b.Message=h["Problem while performing the action"]}d.getService("orion.page.message").setProgressResult(b)}function p(a){Array.isArray(a)&&(a=a.length>1?{}:a[0]);return a}l=new b.ParametersDescription([new b.CommandParameter("key","text",h["Key:"]),new b.CommandParameter("value","text",h["Value:"])]);l=new i.Command({name:h["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,c=d.getService("orion.git.provider"),e=d.getService("orion.page.progress");a.parameters.valueFor("key")&&a.parameters.valueFor("value")&&e.progress(c.addCloneConfigurationProperty(b.ConfigLocation,a.parameters.valueFor("key"),a.parameters.valueFor("value")),"Setting configuration propetry: "+a.parameters.valueFor("key")).then(function(){g.changedItem(b)},
o)}});e.addCommand(l);l=new b.ParametersDescription([],null,function(a){var a=a.items,c;if(a)c=a.Value;return[new b.CommandParameter("value","text",h["Value:"],c)]});l=new i.Command({name:h.Edit,tooltip:h["Edit the configuration entry"],imageClass:"core-sprite-edit",id:"eclipse.orion.git.editConfigEntryCommand",parameters:l,callback:function(a){var b=a.items,c=d.getService("orion.git.provider"),e=d.getService("orion.page.progress");a.parameters.valueFor("value")&&e.progress(c.editCloneConfigurationProperty(b.Location,
a.parameters.valueFor("value")),"Editing configuration property "+b.Key).then(function(){g.changedItem(b)},o)},visibleWhen:function(a){return a.Key&&a.Value&&a.Location}});e.addCommand(l);l=new i.Command({name:h.Delete,tooltip:h["Delete the configuration entry"],imageClass:"core-sprite-delete",id:"eclipse.orion.git.deleteConfigEntryCommand",callback:function(a){var b=a.items,a=d.getService("orion.git.provider"),c=d.getService("orion.page.progress");confirm(f.formatMessage(h["Are you sure you want to delete ${0}?"],
b.Key))&&c.progress(a.deleteCloneConfigurationProperty(b.Location),"Deleting configuration property "+b.Key).then(function(){g.changedItem(b)},o)},visibleWhen:function(a){return a.Key&&a.Value&&a.Location}});e.addCommand(l);l=new b.ParametersDescription([new b.CommandParameter("url","url",h["Repository URL:"])],{hasOptionalParameters:!0});m=new i.Command({name:h["Clone Repository"],tooltip:h["Clone an existing Git repository to a folder"],id:"eclipse.createGitProject",callback:function(b){var c=b.items,
e=d.getService("orion.git.provider"),f=d.getService("orion.page.progress"),i=function(b,i,j){c.GitUrl=b;r.getDefaultSshOptions(d,c).then(function(l){var m=arguments.callee,o=new a(d);d.getService("orion.page.message").setProgressMessage("Your project is being set up. This may take a minute...");o.getConfig().then(function(a){f.progress(e.cloneGitRepository(j,b,i,g.defaultPath,l.gitSshUsername,l.gitSshPassword,l.knownHosts,l.gitPrivateKey,l.gitPassphrase,a,!0),"Cloning repository "+j).then(function(a){r.handleProgressServiceResponse(a,
l,d,function(a){e.getGitClone(a.Location).then(function(a){var b="",d;for(d in c.projectDescription)b+=d+"="+c.projectDescription[d]+"\n";n.write(a.Children[0].ContentLocation+".git/.projectInfo",b).then(function(){var b=k.toUrl(F.expand({resource:a.Children[0].ContentLocation}));window.location=b})})},m,h["Clone Git Repository"])},function(a){r.handleProgressServiceResponse(a,l,d,function(){},m,h["Clone Git Repository"])})})})};c.url&&c.projectDescription.name&&(d.getService("orion.page.message").setProgressMessage("Looking for project "+
c.projectDescription.name),n.loadWorkspace().then(function(a){for(var b=0;b<a.Children.length;++b){var d=a.Children[b];if(d.Name===c.projectDescription.name){d.Git?e.getGitClone(d.Git.CloneLocation).then(function(a){a.Children[0].GitUrl===c.url?window.location=k.toUrl(F.expand({resource:a.Children[0].ContentLocation})):console.info("Folder project is used")}):console.info("Folder project is used");return}}i(c.url,null,c.projectDescription.name)}))},visibleWhen:function(){return!0}});e.addCommand(m);
l=new i.Command({name:h["Clone Repository"],tooltip:h["Clone an existing Git repository to a folder"],id:"eclipse.cloneGitRepository",parameters:l,callback:function(b){var c=b.items,e=d.getService("orion.git.provider"),f=d.getService("orion.page.progress"),i=function(b,i,j){c.GitUrl=b;r.getDefaultSshOptions(d,c).then(function(c){var k=arguments.callee;(new a(d)).getConfig().then(function(a){a=f.progress(e.cloneGitRepository(j,b,i,g.defaultPath,c.gitSshUsername,c.gitSshPassword,c.knownHosts,c.gitPrivateKey,
c.gitPassphrase,a),"Cloning repository "+j);d.getService("orion.page.message").createProgressMonitor(a,h["Cloning repository: "]+b);a.then(function(a){r.handleProgressServiceResponse(a,c,d,function(){g.changedItem&&g.changedItem()},k,h["Clone Git Repository"])},function(a){r.handleProgressServiceResponse(a,c,d,function(){},k,h["Clone Git Repository"])})})})};b.parameters.valueFor("url")&&!b.parameters.optionsRequested?i(b.parameters.valueFor("url")):(new s.CloneGitRepositoryDialog({serviceRegistry:d,
fileClient:n,url:b.parameters.valueFor("url"),alwaysShowAdvanced:b.parameters.optionsRequested,func:i})).show()},visibleWhen:function(){return!0}});e.addCommand(l);l=new i.Command({name:h["Clone Repository"],tooltip:h["Clone an existing Git repository to a folder"],id:"eclipse.cloneGitRepositoryReviewReq",callback:function(b){var c=b.items,e=d.getService("orion.git.provider"),f=d.getService("orion.page.progress");(new s.CloneGitRepositoryDialog({serviceRegistry:d,fileClient:n,url:b.userData,alwaysShowAdvanced:!1,
func:function(b,i,j){c.GitUrl=b;r.getDefaultSshOptions(d,c).then(function(c){var k=arguments.callee;(new a(d)).getConfig().then(function(a){a=f.progress(e.cloneGitRepository(j,b,i,g.defaultPath,c.gitSshUsername,c.gitSshPassword,c.knownHosts,c.gitPrivateKey,c.gitPassphrase,a),"Cloning git repository "+j);d.getService("orion.page.message").createProgressMonitor(a,h["Cloning repository: "]+b);a.then(function(a){r.handleProgressServiceResponse(a,c,d,function(){g.changedItem&&g.changedItem()},k,h["Clone Git Repository"])},
function(a){r.handleProgressServiceResponse(a,c,d,function(){},k,h["Clone Git Repository"])})})})}})).show()},visibleWhen:function(){return!0}});e.addCommand(l);l=new i.Command({name:h["Add Remote"],tooltip:h["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 f=function(a,f){a.JsonData.HostKey?
(f.parameters=null,f.errorData=a.JsonData,e.collectParameters(f)):f.optionsRequested?(f.errorData=a.JsonData,e.collectParameters(f)):(new c(d)).isEnabled().then(function(c){f.parameters=c?a.JsonData.User?new b.ParametersDescription([new b.CommandParameter("sshpassword","password",h["Password:"]),new b.CommandParameter("saveCredentials","boolean",h["Don't prompt me again:"])],{hasOptionalParameters:!0}):new b.ParametersDescription([new b.CommandParameter("sshuser","text",h["User Name:"]),new b.CommandParameter("sshpassword",
"password",h["Password:"]),new b.CommandParameter("saveCredentials","boolean",h["Don't prompt me again:"])],{hasOptionalParameters:!0}):a.JsonData.User?new b.ParametersDescription([new b.CommandParameter("sshpassword","password",h["Password:"])],{hasOptionalParameters:!0}):new b.ParametersDescription([new b.CommandParameter("sshuser","text",h["User Name:"]),new b.CommandParameter("sshpassword","password",h["Password:"])],{hasOptionalParameters:!0});f.errorData=a.JsonData;e.collectParameters(f)})};
if(a.parameters&&a.parameters.optionsRequested)a.parameters=null,a.optionsRequested=!0,e.collectParameters(a);else{var i=function(b,c,e){var i=d.getService("orion.page.progress");i.progress(d.getService("orion.git.provider").addRemote(b,c,a.userData),"Adding git remote "+c).then(function(){r.gatherSshCredentials(d,a).then(function(b){d.getService("orion.git.provider").getGitRemote(e.RemoteLocation).then(function(j){for(var k,l=0;l<j.Children.length;l++)j.Children[l].Name===c&&(k=j.Children[l]);var m=
d.getService("orion.git.provider"),j=d.getService("orion.page.message"),l=i.progress(m.doFetch(k.Location,!1,b.gitSshUsername,b.gitSshPassword,b.knownHosts,b.gitPrivateKey,b.gitPassphrase),"Fetching remote "+c);j.createProgressMonitor(l,h["Fetching remote: "]+k.Location);l.then(function(b){r.handleGitServiceResponse(b,d,function(){i.progress(m.getGitRemote(k.Location),"Getting remote details "+c).then(function(){g.changedItem(e)},o)},function(b){f(b,a)})},function(b){r.handleGitServiceResponse(b,
d,function(){g.changedItem(e)},function(b){f(b,a)})})})})},o)};a.remoteName?i(a.items.RemoteLocation,a.remoteName,a.items):(a.parameters=new b.ParametersDescription([new b.CommandParameter("remoteName","text",h["Remote Name:"])],{hasOptionalParameters:!1}),e.collectParameters(a))}},visibleWhen:function(){return!0}});e.addCommand(l);l=new b.ParametersDescription([new b.CommandParameter("folderName","text",h["New folder:"])],{hasOptionalParameters:!0});l=new i.Command({name:h["Init Repository"],tooltip:h["Create a new Git repository in a new folder"],
id:"eclipse.initGitRepository",parameters:l,callback:function(b){var c=b.items,e=d.getService("orion.git.provider"),f=d.getService("orion.page.progress"),i=function(b,i,j){c.GitUrl=b;r.getDefaultSshOptions(d,c).then(function(c){var k=arguments.callee;(new a(d)).getConfig().then(function(a){a=f.progress(e.cloneGitRepository(j,b,i,g.defaultPath,null,null,null,null,null,a),h["Initializing repository: "]+j);d.getService("orion.page.message").createProgressMonitor(a,h["Initializing repository: "]+j);a.then(function(a){r.handleProgressServiceResponse(a,
c,d,function(){g.changedItem&&g.changedItem()},k,h["Init Git Repository"])},function(a){r.handleProgressServiceResponse(a,c,d,function(){},k,h["Init Git Repository"])})})})};b.parameters.valueFor("folderName")&&!b.parameters.optionsRequested?i(null,null,b.parameters.valueFor("folderName")):(new s.CloneGitRepositoryDialog({serviceRegistry:d,title:h["Init Git Repository"],fileClient:n,advancedOnly:!0,func:i})).show()},visibleWhen:function(){return!0}});e.addCommand(l);l=new i.Command({name:h.Delete,
tooltip:h["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=d.getService("orion.git.provider"),c=d.getService("orion.page.progress");if(Array.isArray(b)){if(confirm(f.formatMessage(h["Are you sure you want do delete ${0} repositories?"],b.length)))for(var e=0,i=0;i<b.length;i++)c.progress(a.removeGitRepository(b[i].Location),"Removing repository "+b.Name).then(function(){e++;e>=
b.length&&g.changedItem&&g.changedItem()},o)}else confirm(f.formatMessage(h["Are you sure you want to delete ${0}?"],b.Name))&&c.progress(a.removeGitRepository(b.Location),"Removing repository "+b.Name).then(function(){if(g.changedItem)window.location=k.toUrl(D.expand({})),g.changedItem()},o)}});e.addCommand(l);l=new i.Command({name:h["Apply Patch"],tooltip:h["Apply a patch on the selected repository"],id:"eclipse.orion.git.applyPatch",imageClass:"git-sprite-apply-patch",spriteClass:"gitCommandSprite",
callback:function(a){var a=p(a.items),b=new j;(new t.ApplyPatchDialog({title:h["Apply Patch"],diffLocation:a.DiffLocation,deferred:b})).show();var c=d.getService("orion.page.message");b.then(function(a){var b;try{var d=JSON.parse(a);if(d.JsonData&&d.JsonData.modifiedFieles){b="Patch applied, files modified: ";for(var a=!0,e=0;e<d.JsonData.modifiedFieles.length;e++)a||(b+=", "),b+=d.JsonData.modifiedFieles[e],a=!1;d=[];d.Severity="Info";d.HTML=!1;d.Message=b;c.setProgressResult(d);return}}catch(f){}c.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;c.setProgressResult(b)})},visibleWhen:function(a){return a.Type==="Clone"}});e.addCommand(l);l=new b.ParametersDescription([new b.CommandParameter("commitName","text",h["Commit name:"])],{hasOptionalParameters:!0});l=new i.Command({name:h["Open Commit"],tooltip:h["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=d.getService("orion.page.progress"),c=function(e,f,g){g==null&&(g=new j);e.length>0?b.progress(d.getService("orion.git.provider").doGitLog("/gitapi/commit/"+a.parameters.valueFor("commitName")+e[0].ContentLocation+"?page=1&pageSize=1",null,null,h["Looking for the commit"]),"Looking for commit "+a.parameters.valueFor("commitName")).then(function(a){g.resolve(a.Children[0].Location)},function(){c(e.slice(1),
f,g)}):g.reject();return g},e=function(b){a.parameters.optionsRequested?(new u.OpenCommitDialog({repositories:b,serviceRegistry:d,commitName:a.parameters.valueFor("commitName")})).show():(d.getService("orion.page.message").setProgressMessage(h["Looking for the commit"]),c(b,a.parameters.valueFor("commitName")).then(function(a){a&&(a=k.toUrl(y.expand({resource:a})),window.open(a));d.getService("orion.page.message").setProgressMessage("")},function(){var a=[];a.Severity="warning";a.HTML=!1;a.Message=
h["No commits found"];d.getService("orion.page.message").setProgressResult(a)}))};if(a.items.Type==="Clone"){var f=[a.items];e(f)}else a.items.CloneLocation?b.progress(d.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"}});e.addCommand(l)};r.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:h["Problem while performing the action"]}catch(f){c.Message=h["Problem while performing the action"]}a.getService("orion.page.message").setProgressResult(c)}function f(a){Array.isArray(a)||(a=[a]);return a}function j(b,c){var f=a.getService("orion.page.message"),g=a.getService("orion.page.progress").progress(a.getService("orion.git.provider").doRebase(b,"",c),"Rebasing git repository");
f.createProgressMonitor(g,c);g.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+h[". 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+h[". Repository contains unmerged paths. Resolve conflicts first."],a.getService("orion.page.message").setProgressResult(c)},e)}var k=new i.Command({name:h.Stage,tooltip:h["Stage the change"],imageClass:"git-sprite-stage",spriteClass:"gitCommandSprite",id:"eclipse.orion.git.stageCommand",callback:function(b){var c=f(b.items),g=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),
h["Staging changes"]),g.createProgressMonitor(b,h["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),h["Staging changes"]);g.createProgressMonitor(b,"Staging changes")}b.then(function(){d.changedItem(c)},e)},visibleWhen:function(a){a=f(a);if(a.length===0)return!1;for(var b=0;b<a.length;b++)if(!g.isChange(a[b])||g.isStaged(a[b]))return!1;return!0}});c.addCommand(k);k=new i.Command({name:h.Unstage,
tooltip:h["Unstage the change"],imageClass:"git-sprite-unstage",spriteClass:"gitCommandSprite",id:"eclipse.orion.git.unstageCommand",callback:function(b){var c=f(b.items),g=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")}g.createProgressMonitor(b,h["Staging changes"]);b.then(function(){d.changedItem(c)},e)},visibleWhen:function(a){a=f(a);if(a.length===0)return!1;for(var b=0;b<a.length;b++)if(!g.isChange(a[b])||!g.isStaged(a[b]))return!1;return!0}});c.addCommand(k);k=new b.CommandEventListener("change",function(b,c){var d=b.target,e=c.items.status,f=document.getElementById("nameparameterCollector");d.checked?(d=a.getService("orion.page.message"),e=a.getService("orion.page.progress").progress(a.getService("orion.git.provider").doGitLog(e.CommitLocation+
"?page=1&pageSize=1"),h["Fetching previous commit message"]),d.createProgressMonitor(e,h["Fetching previous commit message"],e.then(function(a){f.value=a.Children[0].Message}),function(){f.value=""})):f.value=""});k=new b.ParametersDescription([new b.CommandParameter("name","text",h["Commit message:"],"",4),new b.CommandParameter("amend","boolean",h["Amend:"],!1,null,k),new b.CommandParameter("changeId","boolean",h["ChangeId:"],!1)],{hasOptionalParameters:!0});k=new i.Command({name:h.Commit,tooltip:h.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)),h["Committing changes"]);f.createProgressMonitor(b,h["Committing changes"]);b.then(function(){d.changedItem(c)},e)},g=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 v.CommitDialog({body:a,func:f})).show()},i={};i.Message=b.parameters.valueFor("name");i.Amend=b.parameters.valueFor("amend");i.ChangeId=b.parameters.valueFor("changeId");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"),h["Committing changes"]);k.createProgressMonitor(l,h["Committing changes"]);l.then(function(a){i.Message=a.Children[0].Message;g(i,j)},function(){g(i,j)})}else g(i,j)},visibleWhen:function(){return!0}});c.addCommand(k);k=new i.Command({name:h.Reset,tooltip:h["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(h["All unstaged and staged changes in the working directory and index will be discarded and cannot be recovered."]+
"\n"+h["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"),h["Resetting local changes"]);b.createProgressMonitor(f,h["Resetting local changes"]);f.then(function(){d.changedItem(c)},e)}})},visibleWhen:function(a){return g.hasStagedChanges(a)||g.hasUnstagedChanges(a)}});c.addCommand(k);k=new i.Command({name:h.Checkout,tooltip:h["Checkout all the selected files, discarding all changes"],
imageClass:"git-sprite-checkout",spriteClass:"gitCommandSprite",id:"eclipse.orion.git.checkoutCommand",callback:function(b){var c=f(b.items);a.getService("orion.page.dialog").confirm(h["Your changes to the selected files will be discarded and cannot be recovered."]+"\n"+h["Are you sure you want to continue?"],function(f){if(f){for(var f=a.getService("orion.page.message"),g=a.getService("orion.page.progress"),i=[],j=0;j<c.length;j++)i[j]=c[j].name;g=g.progress(a.getService("orion.git.provider").checkoutPath(b.userData.Clone.Location,
i),h["Resetting local changes"]);f.createProgressMonitor(g,h["Resetting local changes"]);g.then(function(){d.changedItem(c)},e)}})},visibleWhen:function(a){a=f(a);if(a.length===0)return!1;for(var b=0;b<a.length;b++)if(!g.isChange(a[b])||g.isStaged(a[b]))return!1;return!0}});c.addCommand(k);k=new i.Command({name:h["Show Patch"],tooltip:h["Show workspace changes as a patch"],id:"eclipse.orion.git.showPatchCommand",hrefCallback:function(a){for(var b=f(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=f(a);if(a.length===0)return!1;for(var b=0;b<a.length;b++)if(g.isStaged(a[b]))return!1;return!0}});c.addCommand(k);k=new i.Command({name:h.Continue,tooltip:h["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:h["Skip Patch"],
tooltip:h["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:h.Abort,tooltip:h["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 r});
define("orion/git/widgets/CommitTooltipDialog","i18n!git/nls/gitmessages,require,orion/URITemplate,orion/webui/littlelib,orion/i18nUtil,orion/webui/popupdialog".split(","),function(h,k,j,f,d,i){function b(b){this._init(b)}var g=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 c=this.$parentPane,a=b.Message.split(/(\r?\n|$)/)[0],f=document.createElement("a");f.className="navlinkonpage";f.href=k.toUrl(g.expand({resource:b.Location}));f.textContent=a;c.appendChild(f);a=document.createElement("div");a.style.paddingTop="15px";c.appendChild(a);if(b.AuthorImage)c=new Image,c.src=b.AuthorImage,c.name=b.AuthorName,c.className="git-author-icon",a.appendChild(c);
c=document.createElement("div");c.textContent=d.formatMessage(h[" authored by ${0} {${1}) on ${2}"],b.AuthorName,b.AuthorEmail,(new Date(b.Time)).toLocaleString());a.appendChild(c);c=document.createElement("div");c.textContent=d.formatMessage(h["committed by 0 (1)"],b.CommitterName,b.CommitterEmail);a.appendChild(c);c=document.createElement("div");c.style.paddingTop="15px";c.textContent=h["commit:"]+b.Name;a.appendChild(c);if(b.Parents&&b.Parents.length>0)c=document.createElement("div"),c.textContent=
h["parent:"],f=document.createElement("a"),f.className="navlinkonpage",f.href=k.toUrl(g.expand({resource:b.Parents[0].Location})),f.textContent=b.Parents[0].Name,c.appendChild(f),a.appendChild(c);f=b.Tags&&b.Tags.length>0;if(b.Branches&&b.Branches.length>0){c=document.createElement("section");c.style.paddingTop="15px";c.textContent=h["branches: "];a.appendChild(c);var i=document.createElement("div");c.appendChild(i);for(c=0;c<b.Branches.length;++c){var j=document.createElement("span");j.style.paddingLeft=
"10px";j.textContent=b.Branches[c].FullName;i.appendChild(j)}}if(f){c=document.createElement("div");c.style.paddingTop="15px";a.appendChild(c);c=document.createElement("section");a.appendChild(c);a=document.createElement("span");a.textContent=h["tags: "];c.appendChild(a);a=document.createElement("div");c.appendChild(a);for(c=0;c<b.Tags.length;++c)f=document.createElement("span"),f.style.paddingLeft="10px",f.textContent=b.Tags[c].Name,a.appendChild(f)}};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/uiUtil,orion/git/gitCommands,orion/Deferred,orion/git/widgets/CommitTooltipDialog,orion/webui/tooltip".split(","),function(h,k,j,f,d,i,b,g,e,c,a,l,m,o,s){var m={},p=new i("git/git-repository.html#{,resource,params*}"),u=new i("git/git-log.html#{,resource,params*}?page=1"),v=
new i("git/git-commit.html#{,resource,params*}?page=1&pageSize=1"),t=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}();m.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 t,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=g.node("table");g.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 d={};d.Name=k.Status+(a.RepositoryState&&a.RepositoryState.indexOf("REBASING")!==-1?k[" (Rebase in Progress)"]:"");d.Parents=[];d.Parents[0]={};d.Parents[0].Name=b.Name;d.Parents[0].Location=b.Location;d.Parents[0].ChildrenLocation=b.Location;d.Parents[1]={};d.Parents[1].Name=k.Repo;c.setPageTarget({task:k.Status,target:b,breadcrumbTarget:d,
makeBreadcrumbLink:function(a,b){a.href=h.toUrl(p.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,c){var e=this,h=this._sortBlock(this._model.interestedUnstagedGroup),i=g.node("table"),l=new d.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){e.commandService.destroy(b.selectionNode);a&&e.commandService.renderCommands(b.selectionNode.id,
b.selectionNode,null,e,"button",{Clone:c})}});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 f.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=g.node(l.selectionNode.id);b&&(e.commandService.destroy(b),e.commandService.renderCommands(l.selectionNode.id,b,a.selections,
e,"button",{Clone:c}))});this.unstagedOnce=!0}this.commandService.registerCommandContribution("DefaultActionWrapper","eclipse.orion.git.stageCommand",100);var m=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}(),o=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"),f=document.createElement("div");f.className="sectionTableItem";b.appendChild(f);this.getExpandImage(d,f);var d=this.explorer.getNavDict()?this.explorer.getNavDict().getGridNavHolder(c,
!0):null,g=document.createElement("span");g.id="unstaged"+c.name+"DiffActionWrapper";g.className="sectionExplorerActions";f.appendChild(g);e.commandService.destroy(g);e.commandService.renderCommands("DefaultActionWrapper",g,c,e,"tool",null,d);d=document.createElement("span");d.className=e._model.getClass(c.type);d.commandTooltip=new s.Tooltip({node:d,text:e._model.getTooltip(c.type),position:["above","below","right","left"]});f.appendChild(d);d=document.createElement("span");d.textContent=c.name;
f.appendChild(d)}else{b=document.createElement("td");b.colSpan=2;f=document.createElement("div");f.className="sectionTableItem";b.appendChild(f);g=document.createElement("div");g.className="sectionExplorerActions";g.id="unstaged"+c.parent.name+"CompareWidgetActionWrapper";f.appendChild(g);var h=document.createElement("div");h.id="diffArea_"+c.diffUri;h.style.height="420px";h.style.border="1px solid lightgray";h.style.overflow="hidden";f.appendChild(h);d=this.explorer.getNavDict()?this.explorer.getNavDict().getGridNavHolder(c,
!0):null;a.createCompareWidget(e.registry,e.commandService,c.diffUri,c.parent.type==="Conflicting",h,g.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 o({registry:this.registry,cachePrefix:"UnstagedNavigator",checkbox:!1},this);this.createTree(this.parentId,new m,{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,c){var e=this,h=this._sortBlock(this._model.interestedStagedGroup),i=g.node("table"),l=new d.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){e.commandService.destroy(b.selectionNode);a&&e.commandService.renderCommands(b.selectionNode.id,b.selectionNode,null,e,"button",{Clone:c})}});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 f.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=g.node(l.selectionNode.id);b&&(e.commandService.destroy(b),e.commandService.renderCommands(l.selectionNode.id,b,a.selections,e,"button",
{Clone:c}))});this.stagedOnce=!0}this.commandService.registerCommandContribution("DefaultActionWrapper","eclipse.orion.git.unstageCommand",100);var m=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}(),o=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"),f=document.createElement("div");f.className="sectionTableItem";b.appendChild(f);this.getExpandImage(d,f);var d=this.explorer.getNavDict()?this.explorer.getNavDict().getGridNavHolder(c,!0):null,
g=document.createElement("span");g.id="staged"+c.name+"DiffActionWrapper";g.className="sectionExplorerActions";f.appendChild(g);e.commandService.destroy(g);e.commandService.renderCommands("DefaultActionWrapper",g,c,e,"tool",null,d);d=document.createElement("span");d.className=e._model.getClass(c.type);d.commandTooltip=new s.Tooltip({node:d,text:e._model.getTooltip(c.type),position:["above","below","right","left"]});f.appendChild(d);d=document.createElement("span");d.textContent=c.name;f.appendChild(d)}else{b=
document.createElement("td");b.colSpan=2;f=document.createElement("div");f.className="sectionTableItem";b.appendChild(f);g=document.createElement("div");g.className="sectionExplorerActions";g.id="staged"+c.parent.name+"CompareWidgetActionWrapper";f.appendChild(g);var h=document.createElement("div");h.id="diffArea_"+c.diffUri;h.style.height="420px";h.style.border="1px solid lightgray";h.style.overflow="hidden";f.appendChild(h);d=this.explorer.getNavDict()?this.explorer.getNavDict().getGridNavHolder(c,
!0):null;a.createCompareWidget(e.registry,e.commandService,c.diffUri,c.parent.type==="Conflicting",h,g.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 o({registry:this.registry,cachePrefix:"StagedNavigator",checkbox:!1},this);this.createTree(this.parentId,new m)}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,c=g.node("table"),f=new d.Section(c,{id:"commitSection",title:k.Commits,content:'<div id="commitNode" class="mainPadding"></div>',slideout:!0,canHide:!0,preferenceService:this.registry.getService("orion.core.preference")}),h=f.createProgressMonitor();h.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,f.setTitle(e.formatMessage(k['Commits for "${0}" branch'],c.Name)),b.commandService.destroy(f.actionsNode.id),b.commandService.registerCommandContribution(f.actionsNode.id,
"eclipse.orion.git.repositories.viewAllCommand",10),b.commandService.renderCommands(f.actionsNode.id,f.actionsNode.id,{ViewAllLink:u.expand({resource:c.CommitLocation}),ViewAllLabel:k["See Full Log"],ViewAllTooltip:k["See the full log"]},b,"button"),a&&(b.commandService.registerCommandContribution(f.actionsNode.id,"eclipse.orion.git.fetch",100),b.commandService.registerCommandContribution(f.actionsNode.id,"eclipse.orion.git.merge",100),b.commandService.registerCommandContribution(f.actionsNode.id,
"eclipse.orion.git.rebase",100),b.commandService.registerCommandContribution(f.actionsNode.id,"eclipse.orion.git.resetIndex",100),b.commandService.renderCommands(f.actionsNode.id,f.actionsNode.id,c.RemoteLocation[0].Children[0],b,"button")),b.commandService.addCommandGroup(f.actionsNode.id,"eclipse.gitPushGroup",1E3,"Push",null,null,null,"Push",null,"eclipse.orion.git.push"),b.commandService.registerCommandContribution(f.actionsNode.id,"eclipse.orion.git.push",1100,"eclipse.gitPushGroup"),b.commandService.registerCommandContribution(f.actionsNode.id,
"eclipse.orion.git.pushBranch",1200,"eclipse.gitPushGroup"),b.commandService.registerCommandContribution(f.actionsNode.id,"eclipse.orion.git.pushToGerrit",1200,"eclipse.gitPushGroup"),b.commandService.renderCommands(f.actionsNode.id,f.actionsNode.id,c,b,"button"),c.RemoteLocation[0]===null?(h.done(),b.renderNoCommit()):(h.worked(e.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"),e.formatMessage(k['Getting commits for "${0}" branch'],c.Name)).then(function(a){h.worked(k["Rendering commits"]);for(var d=a.Children.length,e=0;e<a.Children.length;e++)b.renderCommit(a.Children[e],!0,e);h.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){h.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();h.done()},function(a){h.done(a)})},function(a){h.done(a)}):b.registry.getService("orion.page.progress").progress(b.registry.getService("orion.git.provider").doGitLog(c.CommitLocation+"?page=1&pageSize=20"),e.formatMessage(k['Getting commits for "${0}" branch'],c.Name)).then(function(a){h.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();h.done()},function(a){h.done(a)}))):h.done()},b.handleError.bind(b))};i.prototype.renderNoCommit=function(){var a=g.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=g.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=h.toUrl(v.expand({resource:a.Location}));c.textContent=a.Message;d.appendChild(c);new o.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 m});
define("orion/operation",["orion/xhr","orion/Deferred"],function(h,k){function j(d,f,b,g){h("GET",d,{headers:{"Orion-Version":"1"},timeout:15E3}).then(function(e){e=e.response?JSON.parse(e.response):null;f.progress(e);!e.type||e.type==="loadstart"||e.type==="progress"?setTimeout(function(){j(d,f,b,g)},2E3):(e.type==="error"||e.type==="abort"?f.reject(g?g(e):e.Result):f.resolve(b?b(e):e.Result.JsonData),e.Location||h("DELETE",d,{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,f.reject(c)):f.reject({Severity:"Error",Message:c,HttpCode:b.status})})}function f(d,f){f.then(null,function(b){b instanceof Error&&b.name==="Cancel"&&h("PUT",d,{headers:{"Orion-Version":"1"},data:JSON.stringify({abort:!0}),timeout:15E3})})}return{handle:function(d,h,b){var g=new k;f(d,g);j(d,g,h,b);return g}}});
define("orion/git/gitClient",["require","orion/xhr","orion/Deferred","orion/operation"],function(h,k,j,f){var d=d||{};d.GitService=function(){function d(b){if(b)this._serviceRegistry=b,this._serviceRegistration=b.registerService("orion.git.provider",this)}d.prototype={checkGitService:function(){},cloneGitRepository:function(b,d,e,c,a,f,i,o,s,p,u){var v=this,t={};if(b)t.Name=b;if(e)t.Path=e;if(d)t.GitUrl=d;t.Location=c;if(a)t.GitSshUsername=a;if(f)t.GitSshPassword=f;if(i)t.GitSshKnownHost=i;if(o)t.GitSshPrivateKey=
o;if(s)t.GitSshPassphrase=s;if(p){if(p.GitMail)t.GitMail=p.GitMail;if(p.GitName)t.GitName=p.GitName}if(u)t.initProject=u;var b=h.toUrl("gitapi/clone/._"),b=b.substring(0,b.length-2),q=new j;k("POST",b,{headers:{"Orion-Version":"1","Content-Type":"application/json; charset=UTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify(t)}).then(function(a){v._getGitServiceResponse(q,a)},function(a){v._handleGitServiceResponseError(q,a)});return q},removeGitRepository:function(b){var d=this,e=new j;k("DELETE",
b,{headers:{"Orion-Version":"1","Content-Type":"application/json; charset=UTF-8"},timeout:15E3,handleAs:"json"}).then(function(b){d._getGitServiceResponse(e,b)},function(b){d._handleGitServiceResponseError(e,b)});return e},getGitStatus:function(b){var d=this,e=new j;k("GET",b,{headers:{"Orion-Version":"1","Content-Type":"application/json; charset=UTF-8"},timeout:15E3,handleAs:"json"}).then(function(b){d._getGitServiceResponse(e,b)},function(b){d._handleGitServiceResponseError(e,b)});return e},stage:function(b){var d=
this,e=new j;k("PUT",b,{headers:{"Orion-Version":"1","Content-Type":"application/json; charset=UTF-8"},timeout:15E3,handleAs:"json"}).then(function(b){d._getGitServiceResponse(e,b)},function(b){d._handleGitServiceResponseError(e,b)});return e},stageMultipleFiles:function(b,d){var e=this,c=new j;k("PUT",b,{headers:{"Orion-Version":"1","Content-Type":"application/json; charset=UTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify({Path:d})}).then(function(a){e._getGitServiceResponse(c,a)},function(a){e._handleGitServiceResponseError(c,
a)});return c},unstageAll:function(b,d){var e=this,c=new j;k("POST",b,{headers:{"Orion-Version":"1","Content-Type":"application/json; charset=UTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify({Reset:d})}).then(function(a){e._getGitServiceResponse(c,a)},function(a){e._handleGitServiceResponseError(c,a)});return c},unstage:function(b,d){var e=this,c=new j;k("POST",b,{headers:{"Orion-Version":"1","Content-Type":"application/json; charset=UTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify({Path:d})}).then(function(a){e._getGitServiceResponse(c,
a)},function(a){e._handleGitServiceResponseError(c,a)});return c},checkoutPath:function(b,d){var e=this,c=new j;k("PUT",b,{headers:{"Orion-Version":"1","Content-Type":"application/json; charset=UTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify({Path:d,RemoveUntracked:"true"})}).then(function(a){e._getGitServiceResponse(c,a)},function(a){e._handleGitServiceResponseError(c,a)});return c},commitAll:function(b,d,e){var c=this,a=new j;k("POST",b,{headers:{"Orion-Version":"1","Content-Type":"application/json; charset=UTF-8"},
timeout:15E3,handleAs:"json",data:e}).then(function(b){c._getGitServiceResponse(a,b)},function(b){c._handleGitServiceResponseError(a,b)});return a},getGitClone:function(b){var d=this,e=new j;k("GET",b,{headers:{"Orion-Version":"1","Content-Type":"application/json; charset=UTF-8"},timeout:15E3,handleAs:"json"}).then(function(b){d._getGitServiceResponse(e,b)},function(b){d._handleGitServiceResponseError(e,b)});return e},getGitCloneConfig:function(b){var d=this,e=new j;k("GET",b,{headers:{"Orion-Version":"1",
"Content-Type":"application/json; charset=UTF-8"},timeout:15E3,handleAs:"json"}).then(function(b){d._getGitServiceResponse(e,b)},function(b){d._handleGitServiceResponseError(e,b)});return e},getGitBranch:function(b){var d=this,e=new j;k("GET",b,{headers:{"Orion-Version":"1","Content-Type":"application/json; charset=UTF-8"},timeout:15E3,handleAs:"json"}).then(function(b){d._getGitServiceResponse(e,b)},function(b){d._handleGitServiceResponseError(e,b)});return e},getGitRemote:function(b){var d=this,
e=new j;k("GET",b,{headers:{"Orion-Version":"1","Content-Type":"application/json; charset=UTF-8"},timeout:15E3,handleAs:"json"}).then(function(b){d._getGitServiceResponse(e,b)},function(b){d._handleGitServiceResponseError(e,b)});return e},checkoutBranch:function(b,d){var e=this,c=new j;k("PUT",b,{headers:{"Orion-Version":"1","Content-Type":"application/json; charset=UTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify({Branch:d})}).then(function(a){e._getGitServiceResponse(c,a)},function(a){e._handleGitServiceResponseError(c,
a)});return c},resetIndex:function(b,d){var e=this,c=new j;k("POST",b,{headers:{"Orion-Version":"1","Content-Type":"application/json; charset=UTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify({Commit:d,Reset:"HARD"})}).then(function(a){e._getGitServiceResponse(c,a)},function(a){e._handleGitServiceResponseError(c,a)});return c},addBranch:function(b,d,e){var c=this,a={};if(d)a.Name=d;if(e)a.Branch=e;var f=new j;k("POST",b,{headers:{"Orion-Version":"1","Content-Type":"application/json; charset=UTF-8"},
timeout:15E3,handleAs:"json",data:JSON.stringify(a)}).then(function(a){c._getGitServiceResponse(f,a)},function(a){c._handleGitServiceResponseError(f,a)});return f},removeBranch:function(b){var d=this,e=new j;k("DELETE",b,{headers:{"Orion-Version":"1","Content-Type":"application/json; charset=UTF-8"},timeout:15E3,handleAs:"json"}).then(function(b){d._getGitServiceResponse(e,b)},function(b){d._handleGitServiceResponseError(e,b)});return e},addRemote:function(b,d,e){var c=this,a=new j;k("POST",b,{headers:{"Orion-Version":"1",
"Content-Type":"application/json; charset=UTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify({Remote:d,RemoteURI:e})}).then(function(b){c._getGitServiceResponse(a,b)},function(b){c._handleGitServiceResponseError(a,b)});return a},removeRemote:function(b){var d=this,e=new j;k("DELETE",b,{headers:{"Orion-Version":"1","Content-Type":"application/json; charset=UTF-8"},timeout:15E3,handleAs:"json"}).then(function(b){d._getGitServiceResponse(e,b)},function(b){d._handleGitServiceResponseError(e,b)});
return e},doGitLog:function(b){var d=this,e=new j;k("GET",b,{headers:{"Orion-Version":"1","Content-Type":"application/json; charset=UTF-8"},timeout:15E3,handleAs:"json"}).then(function(b){d._getGitServiceResponse(e,b)},function(b){d._handleGitServiceResponseError(e,b)});return e},getDiff:function(b,d){var e=this,c=new j;k("POST",b,{headers:{"Orion-Version":"1","Content-Type":"application/json; charset=UTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify({New:d})}).then(function(a){e._getGitServiceResponse(c,
a)},function(a){e._handleGitServiceResponseError(c,a)});return c},doFetch:function(b,d,e,c,a,f,h){var i=this,s=new j;k("POST",b,{headers:{"Orion-Version":"1","Content-Type":"application/json; charset=UTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify({Fetch:"true",Force:d,GitSshUsername:e,GitSshPassword:c,GitSshKnownHost:a,GitSshPrivateKey:f,GitSshPassphrase:h})}).then(function(a){i._getGitServiceResponse(s,a)},function(a){i._handleGitServiceResponseError(s,a)});return s},doPull:function(b,
d,e,c,a,f,h){var i=this,s=new j;k("POST",b,{headers:{"Orion-Version":"1","Content-Type":"application/json; charset=UTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify({Pull:"true",Force:d,GitSshUsername:e,GitSshPassword:c,GitSshKnownHost:a,GitSshPrivateKey:f,GitSshPassphrase:h})}).then(function(a){i._getGitServiceResponse(s,a)},function(a){i._handleGitServiceResponseError(s,a)});return s},doMerge:function(b,d,e){var c=this,a=new j;k("POST",b,{headers:{"Orion-Version":"1","Content-Type":"application/json; charset=UTF-8"},
timeout:15E3,handleAs:"json",data:JSON.stringify({Merge:d,Squash:e})}).then(function(b){c._getGitServiceResponse(a,b)},function(b){c._handleGitServiceResponseError(a,b)});return a},doCherryPick:function(b,d){var e=this,c=new j;k("POST",b,{headers:{"Orion-Version":"1","Content-Type":"application/json; charset=UTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify({"Cherry-Pick":d})}).then(function(a){e._getGitServiceResponse(c,a)},function(a){e._handleGitServiceResponseError(c,a)});return c},doRevert:function(b,
d){var e=this,c=new j;k("POST",b,{headers:{"Orion-Version":"1","Content-Type":"application/json; charset=UTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify({Revert:d})}).then(function(a){e._getGitServiceResponse(c,a)},function(a){e._handleGitServiceResponseError(c,a)});return c},doRebase:function(b,d,e){var c=this,a={};a.Rebase=d;if(e)a.Operation=e;var f=new j;k("POST",b,{headers:{"Orion-Version":"1","Content-Type":"application/json; charset=UTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify(a)}).then(function(a){c._getGitServiceResponse(f,
a)},function(a){c._handleGitServiceResponseError(f,a)});return f},doPush:function(b,d,e,c,a,f,h,i,s){var p=this,u=new j;k("POST",b,{headers:{"Orion-Version":"1","Content-Type":"application/json; charset=UTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify({PushSrcRef:d,PushTags:e,Force:c,GitSshUsername:a,GitSshPassword:f,GitSshKnownHost:h,GitSshPrivateKey:i,GitSshPassphrase:s})}).then(function(a){p._getGitServiceResponse(u,a)},function(a){p._handleGitServiceResponseError(u,a)});return u},getLog:function(b,
d){var e=this,c=new j,a=new j;k("POST",b,{headers:{"Orion-Version":"1","Content-Type":"application/json; charset=UTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify({New:d})}).then(function(b){a.resolve(b.xhr.getResponseHeader("Location"))},function(a){e._handleGitServiceResponseError(c,a)});a.then(function(a){k("GET",a,{headers:{"Orion-Version":"1","Content-Type":"application/json; charset=UTF-8"},timeout:15E3,handleAs:"json"}).then(function(a){e._getGitServiceResponse(c,a)},function(a){e._handleGitServiceResponseError(c,
a)})});return c},getDefaultRemoteBranch:function(b){var d=this,e=new j,c=new j;k("GET",b,{headers:{"Orion-Version":"1","Content-Type":"application/json; charset=UTF-8"},timeout:15E3,handleAs:"json"}).then(function(a){d._getGitServiceResponse(c,a)},function(a){d._handleGitServiceResponseError(e,a)});c.then(function(a){k("GET",a.Children[0].Location,{headers:{"Orion-Version":"1","Content-Type":"application/json; charset=UTF-8"},timeout:15E3,handleAs:"json"}).then(function(a){d._getGitServiceResponse(e,
a)},function(a){d._handleGitServiceResponseError(e,a)})});return e},doAddTag:function(b,d){var e=this,c=new j;k("PUT",b,{headers:{"Orion-Version":"1","Content-Type":"application/json; charset=UTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify({Name:d})}).then(function(a){e._getGitServiceResponse(c,a)},function(a){e._handleGitServiceResponseError(c,a)});return c},doRemoveTag:function(b){var d=this,e=new j;k("DELETE",b,{headers:{"Orion-Version":"1","Content-Type":"application/json; charset=UTF-8"},
timeout:15E3,handleAs:"json"}).then(function(b){d._getGitServiceResponse(e,b)},function(b){d._handleGitServiceResponseError(e,b)});return e},checkoutTag:function(b,d,e){var c=this,a=new j;k("PUT",b,{headers:{"Orion-Version":"1","Content-Type":"application/json; charset=UTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify({Tag:d,Branch:e})}).then(function(b){c._getGitServiceResponse(a,b)},function(b){c._handleGitServiceResponseError(a,b)});return a},addCloneConfigurationProperty:function(b,d,e){var c=
this,a=new j;k("POST",b,{headers:{"Orion-Version":"1","Content-Type":"application/json; charset=UTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify({Key:d,Value:e})}).then(function(b){c._getGitServiceResponse(a,b)},function(b){c._handleGitServiceResponseError(a,b)});return a},editCloneConfigurationProperty:function(b,d){var e=this,c=new j;k("PUT",b,{headers:{"Orion-Version":"1","Content-Type":"application/json; charset=UTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify({Value:d})}).then(function(a){e._getGitServiceResponse(c,
a)},function(a){e._handleGitServiceResponseError(c,a)});return c},deleteCloneConfigurationProperty:function(b){var d=this,e=new j;k("DELETE",b,{headers:{"Orion-Version":"1","Content-Type":"application/json; charset=UTF-8"},timeout:15E3,handleAs:"json"}).then(function(b){d._getGitServiceResponse(e,b)},function(b){d._handleGitServiceResponseError(e,b)});return e},sendCommitReviewRequest:function(b,d,e,c,a,f){var h=this,i=new j;k("POST",d,{headers:{"Orion-Version":"1","Content-Type":"application/json; charset=UTF-8"},
timeout:15E3,handleAs:"json",data:JSON.stringify({ReviewReqCommit:b,ReviewReqUrl:c,ReviewReqNotifyLogin:e,ReviewReqAuthorName:a,ReviewMessage:f})}).then(function(a){h._getGitServiceResponse(i,a)},function(a){h._handleGitServiceResponseError(i,a)});return i},_getGitServiceResponse:function(b,d){var e=d.response?JSON.parse(d.response):null;if(d.xhr&&d.xhr.status===202){var c=f.handle(e.Location);c.then(b.resolve,function(a){a.failedOperation=e.Location;b.reject(a)},b.progress);b.then(null,function(a){c.reject(a)})}else b.resolve(e)},
_handleGitServiceResponseError:function(b,d){b.reject(d)}};return d}();return d});
define("orion/ssh/sshTools",["orion/Deferred","orion/xhr"],function(h,k){var j=j||{};j.SshService=function(){function f(d){if(d&&(this._serviceRegistry=d,this._authService=d.getService("orion.core.auth"),this._serviceRegistration=d.registerService("orion.net.ssh",this),!this._authService)){var f;this._authService={getUser:function(){if(f){var b=new h;b.resolve(f);return b}return k("POST","../../login",{headers:{"Orion-Version":"1"},timeout:15E3}).then(function(b){return f=b.response?JSON.parse(b.response):
null},function(b){f=null;return b instanceof Error&&b.name==="Cancel"?"_cancel":b.response?JSON.parse(b.response):null})}}}}f.prototype={KNOWN_HOSTS:"knownHosts",addKnownHost:function(d){var d=d||{},f=new h,b=this,g=d.host,e=d.keyType,c=d.hostKey,a=d.port||22;if(!g||!e||!c||!a)return f.reject(),f;this._authService.getUser().then(function(d){for(var h=localStorage.getItem(d.login+"/"+b.KNOWN_HOSTS),h=h?JSON.parse(h):[],j=0;j<h.length;++j){var k=h[j];if(k.host===g&&k.port===a){f.resolve(k.host+" "+
k.keyType+" "+k.hostKey);return}}k={host:g,port:a,keyType:e,hostKey:c};h.push(k);localStorage.setItem(d.login+"/"+b.KNOWN_HOSTS,JSON.stringify(h));f.resolve(k.host+" "+k.keyType+" "+k.hostKey)},function(a){f.reject(a)});return f},clearKnownHosts:function(){var d=new h,f=this;this._authService.getUser().then(function(b){var g=localStorage.getItem(b.login+"/"+f.KNOWN_HOSTS),g=g?JSON.parse(g):[];localStorage.removeItem(b.login+"/"+f.KNOWN_HOSTS);d.resolve(g)},function(b){d.reject(b)});return d},getKnownHostCredentials:function(d,
f){var b=new h,g=this,f=f||22;if(!d||!f)return b.reject(),b;this._authService.getUser().then(function(e){for(var e=(e=localStorage.getItem(e.login+"/"+g.KNOWN_HOSTS))?JSON.parse(e):[],c=0;c<e.length;++c){var a=e[c];if(a.host===d&&a.port===f){b.resolve(a.host+" "+a.keyType+" "+a.hostKey);return}}b.resolve("")},function(d){b.reject(d)});return b}};return f}();return j});
define("orion/links",[],function(){function h(h){this._init(h)}h.prototype={_init:function(h){this._registry=h.serviceRegistry;this._serviceRegistration=this._registry.registerService("orion.core.textlink",this)},_replaceLink:function(h,j,f,d,i){var b=h.search(f);b>0&&(j.appendChild(document.createTextNode(h.substring(0,b))),h=h.substring(b));var f=h.replace(f,""),b=h.substring(0,h.length-f.length),g=b.split(" ",d);if(g.length===d){for(var h=document.createElement("a"),e=0;e<d;e++)i=i.replace("%"+
(e+1),g[e]);h.setAttribute("href",i);h.textContent=b;j.appendChild(h);h=f}return h},addLinks:function(h,j){var f=j||document.createElement("div"),d=this._registry.getServiceReferences("orion.core.linkScanner");if(d.length>0)for(var i=d[0],d=RegExp(i.getProperty("pattern"),"i"),b=i.getProperty("words"),i=i.getProperty("anchor"),g=h.search(d);g>=0;)h=this._replaceLink(h,f,d,b,i),g=h.search(d);h.length>0&&f.appendChild(document.createTextNode(h));return f}};h.prototype.constructor=h;return{TextLinkService:h}});
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(h,
k,j,f,d,i,b,g,e,c,a,l,m,o,s,p,u,v,t,q,w,n,r){f.startup().then(function(f){var j=f.serviceRegistry,f=f.preferences;new e.DialogService(j);var A=new c.Selection(j);new q.SshService(j);var A=new b.CommandRegistry({selection:A}),D=new l.OperationsClient(j);new d.StatusReportingService(j,D,"statusPane","notifications","notificationArea");new i.ProgressService(j,D,A);(new s.ThemePreferences(f,new p.ThemeData)).apply();D=new w.TextLinkService({serviceRegistry:j});new t.GitService(j);var I=new a.FileClient(j);
new n.ContentTypeRegistry(j);var E=new m.Searcher({serviceRegistry:j,commandService:A,fileService:I}),y=new u.GitStatusExplorer(j,A,D,null,"artifacts","pageActions",null,"itemLevelCommands");o.setPageCommandExclusions(["eclipse.git.status2","eclipse.git.status"]);o.generateBanner("orion-git-status",j,A,f,E,y);v.createFileCommands(j,A,y,"pageActions","selectionTools");v.createGitClonesCommands(j,A,y,"pageActions","selectionTools",I);v.createGitStatusCommands(j,A,y);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 g.Command({name:h["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=r.matchResourceParameters();y.display(j.resource);window.addEventListener("hashchange",function(){var a=r.matchResourceParameters();y.display(a.resource)},!1)})});