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

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

/*

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


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

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


 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: Anton McConville - IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

 Copyright (c) 2012 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.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) 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
*/
(function(){function j(){for(var a=navigator.userAgent,d={browser:!1,version:!1},f=[{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}],e=0;e<f.length;e++){var h=f[e],c=a.match(h.regExp);if(c){d.browser=
!0;d.version=c[1]>=h.minVersion;d.name=h.name;break}}return d}function k(){try{return"localStorage"in window&&window.localStorage!==null}catch(a){return!1}}function i(a){alert(a);throw Error("unsupported browser");}var d=j();if(d.browser)d.version||i("Sorry, your browser version is not supported.\n\nTo use Orion, please upgrade to the latest version of "+d.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()||i("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:j,supportsLocalStorage:k,throwBrowserAlert:i}})();define("orion/browserCompatibility",function(){});
(function(j,k){typeof define==="function"&&define.amd?define("orion/Deferred",k):typeof exports==="object"?module.exports=k():(j.orion=j.orion||{},j.orion.Deferred=k())})(this,function(){function j(){for(var f;f=a.shift();)f();g=!1}function k(f){a.push(f);g||(g=!0,setTimeout(j,0))}function i(a){return function(){a.apply(void 0,arguments)}}function d(){function f(){for(var c;c=m.shift();){var e=c.deferred,h=l==="fulfilled"?"resolve":"reject";if(typeof c[h]==="function")try{var f=(0,c[h])(b),d=f&&(typeof f===
"object"||typeof f==="function")&&f.then;if(typeof d==="function")if(f===e.promise)e.reject(new TypeError);else{var g=f.cancel;typeof g==="function"?e._protected(a).parentCancel=g.bind(f):delete e._protected(a).parentCancel;d.call(f,i(e.resolve),i(e.reject),i(e.progress))}else e.resolve(f)}catch(n){e.reject(n)}else e[h](b)}}function e(c){delete r.parentCancel;l="rejected";b=c;m.length&&k(f)}function h(c){function a(b){return function(n){i||(i=!0,b(n))}}var i=!1;delete r.parentCancel;try{var j=c&&
(typeof c==="object"||typeof c==="function")&&c.then;if(typeof j==="function")if(c===g)e(new TypeError);else{l="assumed";var t=c&&c.cancel;if(typeof t!=="function"){var v=new d,c=v.promise;try{j(v.resolve,v.reject,v.progress)}catch(n){v.reject(n)}t=c.cancel;j=c.then}b=c;j.call(c,a(h),a(e));r.parentCancel=t.bind(c)}else l="fulfilled",b=c,m.length&&k(f)}catch(w){a(e)(w)}}function c(){var b=r.parentCancel;if(b)delete r.parentCancel,b();else if(!l)b=Error("Cancel"),b.name="Cancel",e(b)}var b,l,m=[],g=
this,r={};Object.defineProperty(this,"_protected",{value:function(b){if(b!==a)throw Error("protected");return r}});this.resolve=function(b){l||h(b);return g};this.reject=function(b){l||e(b);return g};this.progress=function(b){l||m.forEach(function(c){if(c.progress)try{c.progress(b)}catch(e){}});return g.promise};this.cancel=function(){r.parentCancel?setTimeout(c,0):c();return g};this.then=function(b,c,e){b={resolve:b,reject:c,progress:e,deferred:new d};m.push(b);b.deferred._protected(a).parentCancel=
g.promise.cancel.bind(g);(l==="fulfilled"||l==="rejected")&&k(f);return b.deferred.promise};this.promise={then:g.then,cancel:g.cancel}}var a=[],g=!1;d.all=function(a,e){function h(c,e){m||(l[c]=e,--b===0&&g.resolve(l))}function c(b,c){if(!m){if(e)try{h(b,e(c));return}catch(a){c=a}g.reject(c)}}var b=a.length,l=[],m=!1,g=new d;g.then(void 0,function(){m=!0;a.forEach(function(b){b.cancel&&b.cancel()})});b===0?g.resolve(l):a.forEach(function(b,e){b.then(h.bind(void 0,e),c.bind(void 0,e))});return g.promise};
d.when=function(a,e,h,c){var b;if(!(a&&typeof a.then==="function"))b=new d,b.resolve(a),a=b.promise;return a.then(e,h,c)};return d});
define("orion/EventTarget",[],function(){function j(){this._namedListeners={}}j.prototype={dispatchEvent:function(j){if(!j.type)throw Error("unspecified type");var i=this._namedListeners[j.type];i&&i.forEach(function(d){try{typeof d==="function"?d(j):d.handleEvent(j)}catch(a){typeof console!=="undefined"&&console.log(a)}});return!j.defaultPrevented},addEventListener:function(j,i){if(typeof i==="function"||i.handleEvent)this._namedListeners[j]=this._namedListeners[j]||[],this._namedListeners[j].push(i)},
removeEventListener:function(j,i){var d=this._namedListeners[j];if(d)for(var a=0;a<d.length;a++)if(d[a]===i){d.length===1?delete this._namedListeners[j]:d.splice(a,1);break}}};j.prototype.constructor=j;j.attach=function(k){var i=new j;k.dispatchEvent=i.dispatchEvent.bind(i);k.addEventListener=i.addEventListener.bind(i);k.removeEventListener=i.removeEventListener.bind(i)};return j});
define("orion/serviceregistry",["orion/Deferred","orion/EventTarget"],function(j,k){function i(e,a,c){this._properties=c||{};this._properties["service.id"]=e;this._properties.objectClass=a;this._properties["service.names"]=a}function d(e,a,c){this._serviceId=e;this._serviceReference=a;this._internalRegistry=c}function a(e,a){function c(b){return function(){var c;try{if(!a())throw Error("Service was unregistered");var f=e[b].apply(e,Array.prototype.slice.call(arguments));if(f&&typeof f.then==="function")return f;
else c=new j,c.resolve(f)}catch(d){c=new j,c.reject(d)}return c.promise}}for(var b in e)typeof e[b]==="function"&&(this[b]=c(b))}function g(e,a){this.type=e;this.serviceReference=a}function f(){this._entries=[];this._namedReferences={};this._serviceEventTarget=new k;var e=this;this._internalRegistry={isRegistered:function(a){return e._entries[a]?!0:!1},unregisterService:function(a){var c=e._entries[a];if(!c)throw Error("Service has already been unregistered: "+a);var b=c.reference;e._serviceEventTarget.dispatchEvent(new g("unregistering",
b));e._entries[a]=null;b.getProperty("objectClass").forEach(function(c){for(var a=e._namedReferences[c],h=0;h<a.length;h++)if(a[h]===b){a.length===1?delete e._namedReferences[c]:a.splice(h,1);break}})},modifyService:function(a){var c=e._entries[a];if(!c)throw Error("Service not found while trying to send modified event: "+a);e._serviceEventTarget.dispatchEvent(new g("modified",c.reference))}}}i.prototype={getPropertyKeys:function(){var a=[],h;for(h in this._properties)this._properties.hasOwnProperty(h)&&
a.push(h);return a},getProperty:function(a){return this._properties[a]}};i.prototype.constructor=i;d.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(a){var h=this._serviceReference._properties;this._serviceReference._properties=a||{};a["service.id"]=this._serviceId;
a.objectClass=h.objectClass;a["service.names"]=h["service.names"];this._internalRegistry.modifyService(this._serviceId)}};d.prototype.constructor=d;f.prototype={getService:function(a){var h;if(typeof a==="string")(a=this._namedReferences[a])&&a.some(function(c){h=this._entries[c.getProperty("service.id")].service;return!!h},this);else if(a=this._entries[a.getProperty("service.id")])h=a.service;return h||null},getServiceReferences:function(a){if(a)return this._namedReferences[a]?this._namedReferences[a]:
[];var h=[];this._entries.forEach(function(c){c&&h.push(c.reference)});return h},registerService:function(e,h,c){if(typeof h==="undefined"||h===null)throw Error("invalid service");typeof e==="string"?e=[e]:Array.isArray(e)||(e=[]);var b=this._entries.length,f=new i(b,e,c),m=this._namedReferences;e.forEach(function(b){m[b]=m[b]||[];m[b].push(f)});e=new a(h,this._internalRegistry.isRegistered.bind(null,b));this._entries.push({reference:f,service:e});e=this._internalRegistry;this._serviceEventTarget.dispatchEvent(new g("registered",
f));return new d(b,f,e)},addEventListener:function(a,h){this._serviceEventTarget.addEventListener(a,h)},removeEventListener:function(a,h){this._serviceEventTarget.removeEventListener(a,h)}};f.prototype.constructor=f;return{ServiceRegistry:f}});
define("orion/xhr",["orion/Deferred"],function(j){function k(i,d,a,g){var f=typeof a.response!=="undefined"?a.response:a.responseText,e;try{e=a.status}catch(h){e=0}i={args:d,response:f,responseText:typeof f==="string"?f:null,status:e,url:i,xhr:a};if(typeof g!=="undefined")i.error=g;return i}return function(i,d,a){var a=a||{},g=arguments.length>3&&arguments[3]?arguments[3]:new XMLHttpRequest,f=new j,e=a.headers||{},h=a.log||!1,c;typeof e["X-Requested-With"]==="undefined"&&(e["X-Requested-With"]="XMLHttpRequest");
if(typeof a.data!=="undefined"&&(i==="POST"||i==="PUT"))c=a.data;var b=!1,l=!1;f.promise.then(void 0,function(c){b=!0;!l&&c instanceof Error&&c.name==="Cancel"&&g.abort()});g.onabort=function(){l=!0;if(!b){var c=Error("Cancel");c.name="Cancel";f.reject(c)}};g.onload=function(){var b=k(d,a,g);200<=g.status&&g.status<400?f.resolve(b):(f.reject(b),h&&typeof console!=="undefined"&&console.log(Error(g.statusText)))};g.onerror=function(){var b=k(d,a,g);f.reject(b);h&&typeof console!=="undefined"&&console.log(Error(g.statusText))};
g.onprogress=function(b){b.xhr=g;f.progress(b)};try{g.open(i,d,!0);if(typeof a.responseType==="string")g.responseType=a.responseType;if(typeof a.timeout==="number")if(typeof g.timeout==="number")g.timeout=a.timeout,g.addEventListener("timeout",function(){f.reject(k(d,a,g,"Timeout exceeded"))});else{var m=setTimeout(function(){f.reject(k(d,a,g,"Timeout exceeded"))},a.timeout);f.promise.then(clearTimeout.bind(null,m),clearTimeout.bind(null,m))}Object.keys(e).forEach(function(b){g.setRequestHeader(b,
e[b])});g.send(c||null)}catch(o){f.reject(k(d,a,g,o))}return f.promise}});
define("orion/preferences",["require","orion/Deferred","orion/xhr"],function(j,k,i){function d(c,b){this._name=c;this._providers=b;this._flushPending=!1;this._cached=null;this._stores=[];this._pendingDeletes=[];this._dirty=[]}function a(c,b){return{get:function(a,e){if(b===0)return null;var h=localStorage.getItem(c+a);if(h===null)return null;h=JSON.parse(h);return e||b===-1||h._expires&&h._expires>(new Date).getTime()?(delete h._expires,h):null},set:function(a,e){if(b!==0){if(b!==-1)e._expires=(new Date).getTime()+
1E3*b;if(Object.keys(e).length===0)localStorage.removeItem(c+a);else{var h=JSON.stringify(e);localStorage.setItem(c+a,h);delete e._expires}}},remove:function(b){localStorage.removeItem(c+b)}}}function g(c){this._currentPromises={};this._cache=new a("/orion/preferences/user",3600);this._service=null;this.available=function(){if(!this._service){var b=c.getServiceReferences("orion.core.preference.provider");if(b.length>0)this._service=c.getService(b[0])}return!!this._service}}function f(c){this._location=
c;this._currentPromise=null;this._cache=new a("/orion/preferences/default",3600)}function e(){this._cache=new a("/orion/preferences/local",-1)}function h(c,b){this._userProvider=new g(c);this._localProvider=new e;b=b||"defaults.pref";b.indexOf("://")===-1&&(b=j.toUrl(b));this._defaultsProvider=new f(b);this._serviceRegistration=c.registerService("orion.core.preference",this)}d.prototype={_flush:function(){for(var c=[],b=0;b<this._stores.length;++b){var a=this._stores[b];this._dirty.indexOf(a)!==-1&&
c.push(this._providers[b].put(this._name,a));if(this._pendingDeletes[b]&&this._pendingDeletes[b].length>0){for(a=0;a<this._pendingDeletes[b].length;a++)c.push(this._providers[b].remove(this._name,this._pendingDeletes[b][a]));delete this._pendingDeletes[b]}}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 b=this._stores[c],a;for(a in b)b.hasOwnProperty(a)&&typeof this._cached[a]==="undefined"&&(this._cached[a]=b[a])}}return this._cached},keys:function(){return Object.keys(this._getCached())},get:function(c){return this._getCached()[c]},put:function(c,b){if(this._stores.length!==0){var a=this._stores[0];if(a[c]!==b)a[c]=b,this._cached=null,this._scheduleFlush(a)}},remove:function(c){for(var b=0;b<
this._stores.length;++b){var a=this._stores[b];if(a.hasOwnProperty(c))return delete a[c],this._pendingDeletes[b]||(this._pendingDeletes[b]=[]),this._pendingDeletes[b].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 b=this,a=[],e=0;e<this._providers.length;++e)a.push(this._providers[e].get(this._name,
c).then(function(c){return function(a){b._stores[c]=a}}(e)));return k.all(a).then(function(){b._cached=null;b._getCached()})},flush:function(){this._flush()}};g.prototype={get:function(c,b){if(this._currentPromises[c])return this._currentPromises[c];var a=new k,e=null;b?this._cache.remove(c):e=this._cache.get(c);if(e!==null)a.resolve(e);else{this._currentPromises[c]=a;var h=this;this._service.get(c).then(function(b){h._cache.set(c,b);delete h._currentPromises[c];a.resolve(b)},function(b){b.status===
404?(b={},h._cache.set(c,b),delete h._currentPromises[c],a.resolve(b)):(delete h._currentPromises[c],a.resolve(h._cache.get(c,!0)||{}))})}return a},put:function(c,b){this._cache.set(c,b);return this._service.put(c,b)},remove:function(c,b){var a=this._cache.get(c);delete a[b];this._cache.set(c,a);return this._service.remove(c,b)}};f.prototype={get:function(c,b){if(this._currentPromise)return this._currentPromise;var a=new k,e=null;b?this._cache.remove(c):e=this._cache.get(c);if(e!==null)a.resolve(e);
else{this._currentPromise=a;var h=this;i("GET",this._location,{headers:{"Orion-Version":"1"},timeout:15E3}).then(function(b){b=JSON.parse(b.response);h._cache.set(c,b[c]||{});h._currentPromise=null;a.resolve(b[c]||{})},function(b){b.xhr.status===401||b.xhr.status===404?(h._cache.set(c,{}),h._currentPromise=null,a.resolve({})):(h._currentPromise=null,b=h._cache.get(c,!0),b!==null?a.resolve(b[c]||{}):a.resolve({}))})}return a},put:function(){var c=new k;c.resolve();return c},remove:function(c,b){var a=
this._cache.get(c);delete a[b];this.put(c,a)}};e.prototype={get:function(c){var b=new k,c=this._cache.get(c);c!==null?b.resolve(c):b.resolve({});return b},put:function(c,b){var a=new k;this._cache.set(c,b);a.resolve();return a},remove:function(c,b){var a=this._cache.get(c);delete a[b];this.put(c,a)}};h.DEFAULT_SCOPE=1;h.LOCAL_SCOPE=2;h.USER_SCOPE=4;h.prototype={listenForChangedSettings:function(c,b,a){if(!b||typeof b!=="number"||b>7||b<1)a=b,b=h.DEFAULT_SCOPE|h.LOCAL_SCOPE|h.USER_SCOPE;window.addEventListener("storage",
a,!1);if((h.USER_SCOPE&b)!==0)return"/orion/preferences/user"+c;else if((h.LOCAL_SCOPE&b)!==0)return"/orion/preferences/local"+c;return"/orion/preferences/default"+c},getPreferences:function(c,b){if(!b||typeof b!=="number"||b>7||b<1)b=h.DEFAULT_SCOPE|h.LOCAL_SCOPE|h.USER_SCOPE;var a=[];h.USER_SCOPE&b&&this._userProvider.available()&&a.push(this._userProvider);h.LOCAL_SCOPE&b&&a.push(this._localProvider);h.DEFAULT_SCOPE&b&&a.push(this._defaultsProvider);var e=new d(c,a);return e.sync().then(function(){return e})},
getSetting:function(c,b,a){for(var e,h=0;h<c.length;h++)if(c[h].label===b)for(var f=0;f<c[h].data.length;f++)if(c[h].data[f].label===a){e=c[h].data[f].value;break}return e}};return{PreferencesService:h}});
(function(){function j(b){if(typeof b!=="string")throw new TypeError;}function k(b){return b?b.split("&"):[]}function i(b){return b.length===0?"":b.join("&")}function d(b){var n=/([^=]*)(?:=?)(.*)/.exec(b),b=n[1]?decodeURIComponent(n[1]):"",n=n[2]?decodeURIComponent(n[2]):"";return[b,n]}function a(b){var n=encodeURIComponent(b[0]);b[1]&&(n+="="+encodeURIComponent(b[1]));return n}function g(b,n){var c="",a=[],e=0;return{next:function(){if(c!==b.query)c=b.query,a=k(c);if(e<a.length){var h=d(a[e++]);
switch(n){case "keys":return h[0];case "values":return h[1];case "keys+values":return[h[0],h[1]];default:throw new TypeError;}}throw y;}}}function f(b){Object.defineProperty(this,"_url",{get:function(){return b._url}})}function e(b){return b?/[1-9]\d*$/.exec(b)[0]:""}function h(b){var n=[];b.split("/").forEach(function(b){b===".."?n.pop():b!=="."&&n.push(b)});return n.join("/")}function c(b){return b.replace(/\s/g,function(b){return"%"+b.charCodeAt(0).toString(16)})}function b(b,n){if(typeof b!==
"string")throw new TypeError;var b=c(b),a=r.exec(b);if(!a)return null;var f={};f.scheme=a[1]||"";if(f.scheme&&!s.test(f.scheme))return null;var w=a[2];if(w&&(w=q.exec(w),f.userinfo=w[1],f.host=w[2],f.port=w[3],f.port&&!u.test(f.port)))return null;f.path=a[3];f.query=a[4];f.fragment=a[5];if(!f.scheme&&n&&(f.scheme=n.scheme,!f.host&&n.host))f.userinfo=n.userinfo,f.host=n.host,f.port=n.port,f.pathRelative=!0;if(f.pathRelative)if(f.path){if(f.path[0]!=="/")a=/^(.*\/)[^\/]*$/.exec(n.path)[1]||"/",f.path=
a+f.path}else f.path=n.path;if(f.scheme)f.scheme=f.scheme.toLowerCase();if(f.port)f.port=e(f.port);if(f.host&&f.path)f.path=h(f.path);return f}function l(n,c){var a;if(c){c=c.href||c;a=b(c);if(!a||!a.scheme)throw new SyntaxError;Object.defineProperty(this,"_baseURL",{value:a})}a=b(n,a);if(!a)throw new SyntaxError;Object.defineProperty(this,"_input",{value:n,writable:!0});Object.defineProperty(this,"_url",{value:a,writable:!0});var e=new f(this);Object.defineProperty(this,"query",{get:function(){return this._url?
e: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 r=/^(?:([^:\/?#]+):)?(?:\/\/([^\/?#]*))?([^?#]*)(?:\?([^#]*))?(?:#(.*))?$/,q=/^(?:(.*)@)?(\[[^\]]*\]|[^:]*)(?::(.*))?$/,s=/^([a-zA-Z](?:[a-zA-Z0-9+-.])*)$/,u=/^\d*$/,p=/^(\[[^\]\/?#\s]*\]|[^:\/?#\s]*)$/,t=/^(\[[^\]\/?#\s]*\]|[^:\/?#\s]*)(?::(\d*))?$/,v=/^([^?#\s]*)$/,n=/^([^\s]*)$/,w=/^\S*$/,x=/([^:]*):?(.*)/,y=typeof StopIteration!==
"undefined"?StopIteration:Error("Stop Iteration"),A={"ftp:":"21","gopher:":"70","http:":"80","https:":"443","ws:":"80","wss:":"443"};Object.defineProperties(f.prototype,{get:{value:function(b){j(b);var n;k(this._url.query).some(function(a){a=d(a);if(a[0]===b)return n=a[1],!0});return n},enumerable:!0},set:{value:function(b,n){j(b);j(n);var c=k(this._url.query);c.some(function(e,h){var f=d(e);if(f[0]===b)return f[1]=n,c[h]=a(f),!0})||c.push(a([b,n]));this._url.query=i(c)},enumerable:!0},has:{value:function(b){j(b);
return k(this._url.query).some(function(n){if(d(n)[0]===b)return!0})},enumerable:!0},"delete":{value:function(b){j(b);var n=k(this._url.query),a=n.filter(function(n){return d(n)[0]!==b});return a.length!==n.length?(this._url.query=i(a),!0):!1},enumerable:!0},clear:{value:function(){this._url.query=""},enumerable:!0},forEach:{value:function(b,n){if(typeof b!=="function")throw new TypeError;var a=g(this._url,"keys+values");try{for(;;){var c=a.next();b.call(n,c[1],c[0],this)}}catch(e){if(e!==y)throw e;
}},enumerable:!0},keys:{value:function(){return g(this._url,"keys")},enumerable:!0},values:{value:function(){return g(this._url,"values")},enumerable:!0},items:{value:function(){return g(this._url,"keys+values")}},size:{get:function(){return k(this._url.query).length},enumerable:!0},getAll:{value:function(b){j(b);var n=[];k(this._url.query).forEach(function(a){a=d(a);a[0]===b&&n.push(a[1])});return n},enumerable:!0},append:{value:function(b,n){j(b);j(n);var c=k(this._url.query);c.push(a([b,n]));this._url.query=
i(c)},enumerable:!0}});Object.defineProperties(l.prototype,{href:{get:function(){var b;if(this._url){b=this._url;var n=b.scheme?b.scheme+":":"";b.host&&(n+="//",b.userinfo&&(n+=b.userinfo+"@"),n+=b.host,b.port&&(n+=":"+b.port));n+=b.path;b.query&&(n+="?"+b.query);b.fragment&&(n+="#"+b.fragment);b=n}else b=this._input;return b},set:function(n){j(n);this._input=n;this._url=b(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(b){j(b);if(this._url&&(b=b.slice(-1)===":"?b.substring(0,b.length-1):b,b===""||s.test(b)))this._url.scheme=b.toLowerCase()},enumerable:!0},_userinfo:{get:function(){return this._url?this._url.userinfo:""},set:function(b){j(b);if(this._url)this._url.userinfo=b}},username:{get:function(){if(!this._url)return"";var b=x.exec(this._userinfo);return decodeURIComponent(b[1]||"")},set:function(b){j(b);if(this._url){var n=
x.exec(this._userinfo),b=[encodeURIComponent(b||"")];n[2]&&b.push(n[2]);this._userinfo=b.join(":")}},enumerable:!0},password:{get:function(){if(!this._url)return"";var b=x.exec(this._userinfo);return decodeURIComponent(b[2]||"")},set:function(b){j(b);if(this._url){var n=[x.exec(this._userinfo)[1]||""];b&&n.push(encodeURIComponent(b));this._userinfo=n.join(":")}},enumerable:!0},host:{get:function(){var b="";this._url&&this._url.host&&(b+=this._url.host,this._url.port&&(b+=":"+this._url.port));return b},
set:function(b){j(b);if(this._url&&(b=t.exec(b)))this._url.host=b[1],this._url.port=e(b[2])},enumerable:!0},hostname:{get:function(){return this._url?this._url.host:""},set:function(b){j(b);if(this._url&&p.exec(b))this._url.host=b},enumerable:!0},port:{get:function(){var b=this._url?this._url.port||"":"";b&&b===A[this.protocol]&&(b="");return b},set:function(b){j(b);if(this._url&&u.exec(b))this._url.port=e(b)},enumerable:!0},pathname:{get:function(){return this._url?this._url.path:""},set:function(b){j(b);
if(this._url&&v.exec(b))this._url.host&&b&&b[0]!=="/"&&(b="/"+b),this._url.path=b?h(b):""},enumerable:!0},search:{get:function(){return this._url&&this._url.query?"?"+this._url.query:""},set:function(b){j(b);if(this._url&&(b&&b[0]==="?"&&(b=b.substring(1)),n.exec(b)))this._url.query=b},enumerable:!0},hash:{get:function(){return this._url&&this._url.fragment?"#"+this._url.fragment:""},set:function(b){j(b);if(this._url&&(b&&b[0]==="#"&&(b=b.substring(1)),w.exec(b)))this._url.fragment=b},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(j,k){function i(b,a){var c=Object.keys(b),e=Object.keys(a);if(c.length!==e.length)return!1;c.sort();e.sort();for(var h=0,f=c.length;h<f;h++){var d=c[h];if(d!==e[h])return!1;var g=b[d],d=a[d];if(g!==d&&JSON.stringify(g)!==JSON.stringify(d))return!1}return!0}function d(b){if(b.indexOf("://")===-1)try{return(new URL(b,location.href)).href}catch(a){}return b}function a(b){var a=null,c={key:function(c){return(a=
a||Object.keys(b))[c]},getItem:function(a){return b[a]},setItem:function(c,e){b[c]=e;a=null},removeItem:function(c){delete b[c];a=null},clear:function(){(a=a||Object.keys(b)).forEach(function(a){delete b[a]}.bind(this));a=null}};Object.defineProperty(c,"length",{get:function(){return(a=a||Object.keys(b)).length}});return c}function g(b,a){if(a&&a instanceof XMLHttpRequest){var c,e;try{c=a.status,e=a.statusText}catch(h){c=0,e=""}return{status:c||0,statusText:e}}return a}function f(b){var a=b?JSON.parse(JSON.stringify(b,
g)):b;if(b instanceof Error)a.__isError=!0,a.message=a.message||b.message,a.name=a.name||b.name;return a}function e(b,a){this.type=b;this.plugin=a}function h(b,a){this.__objectId=b;this.__methods=a}function c(b,a,c){function d(b){C&&c.postMessage(b,C)}function g(b){if(!C)return(new j).reject(Error("plugin not connected"));b.id=String(O++);var n=new j;S[b.id]=n;n.then(null,function(n){z==="active"&&n instanceof Error&&n.name==="Cancel"&&d({requestId:b.id,method:"cancel",params:n.message?[n.message]:
[]})});var a=Object.prototype.toString;b.params.forEach(function(c,e){if(a.call(c)==="[object Object]"&&!(c instanceof h)){var f,w;for(f in c)a.call(c[f])==="[object Function]"&&(w=w||[],w.push(f));if(w){var l=X++;T[l]=c;f=function(){delete T[l]};n.then(f,f);b.params[e]=new h(l,w)}}});c.postMessage(b,C);return n.promise}function s(b,n){b||b===0?d({id:b,result:null,error:n}):console.log(n)}function u(b,n,c,a){a.forEach(function(b,n){if(b&&typeof b.__objectId!=="undefined"){var c={};b.__methods.forEach(function(n){c[n]=
function(){return g({objectId:b.__objectId,method:n,params:Array.prototype.slice.call(arguments)})}});a[n]=c}});var e=typeof b===void 0?null:{id:b,result:null,error:null};try{var h=c.apply(n,a);if(e)h&&typeof h.then==="function"?(R[b]=h,h.then(function(n){delete R[b];e.result=n;d(e)},function(n){if(R[b])delete R[b],e.error=f(n),d(e)},function(){d({responseId:b,method:"progress",params:Array.prototype.slice.call(arguments)})})):(e.result=h,d(e))}catch(w){if(e)e.error=f(w),d(e)}}function p(b){try{if(b.method){var n=
b.method,a=b.params||[];if("serviceId"in b){var e=P[b.serviceId];e||s(b.id,"service not found");n in e?u(b.id,e,e[n],a):s(b.id,"method not found")}else if("objectId"in b){var h=T[b.objectId];h||s(b.id,"object not found");n in h?u(b.id,h,h[n],a):s(b.id,"method not found")}else if("requestId"in b){var f=R[b.requestId];f&&n==="cancel"&&f.cancel&&f.cancel.apply(f,a)}else if("responseId"in b){var w=S[b.responseId];w&&n==="progress"&&w.progress&&w.progress.apply(w,a)}else if("plugin"===b.method){var l=
b.params[0];G({headers:l.headers,services:l.services}).then(function(){B&&B.resolve(x)})}else if("timeout"===b.method)B&&B.reject(b.error);else throw Error("Bad method: "+b.method);}else{var d=S[String(b.id)];delete S[String(b.id)];if(b.error){var y=c.handleServiceError(x,b.error);d.reject(y)}else d.resolve(b.result)}}catch(m){console.log("Plugin._messageHandler "+m)}}function t(b){var n={};if(b.methods&&(b.methods.forEach(function(a){n[a]=function(){var n={serviceId:b.serviceId,method:a,params:Array.prototype.slice.call(arguments)};
return z==="active"?g(n):x.start({"transient":!0}).then(function(){return g(n)})}}),n.addEventListener&&n.removeEventListener)){var a=new k,c=X++;T[c]={handleEvent:a.dispatchEvent.bind(a)};var e=new h(c,["handleEvent"]),f=n.addEventListener;n.addEventListener=function(b,n){a._namedListeners[b]||f(b,e);a.addEventListener(b,n)};var w=n.removeEventListener;n.removeEventListener=function(b,n){a.removeEventListener(b,n);a._namedListeners[b]||w(b,e)}}return n}function v(n){var a=JSON.parse(JSON.stringify(n.properties));
a.__plugin__=b;n=n.names||n.type||[];Array.isArray(n)||(n=[n]);a.objectClass=n;return a}function n(b){var n=t(b),a=v(b),a=c.registerService(b.names||b.type,n,a);H[b.serviceId]={registration:a,proxy:n}}function w(){c.persist(b,{created:y,headers:A,services:K,autostart:J,lastModified:I})}var x=this,a=a||{},y=a.created||(new Date).getTime(),A=a.headers||{},K=a.services||[],J=a.autostart,I=a.lastModified||0,z="installed",F,B,C,M,H={},O=0,X=0,R={},S={},T={},P={},G;this._persist=w;this._resolve=function(){z=
"resolved";c.dispatchEvent(new e("resolved",x))};this._getAutostart=function(){return J};this._getCreated=function(){return y};this.getLocation=function(){return b};this.getHeaders=function(){return JSON.parse(JSON.stringify(A))};this.getName=function(){var b=this.getHeaders();return b?b.name||"":null};this.getVersion=function(){var b=this.getHeaders();return b?b.version||"0.0.0":null};this.getLastModified=function(){return I};this.getServiceReferences=function(){var b=[];Object.keys(H).forEach(function(n){b.push(H[n].registration.getReference())});
return b};this.setParent=function(b){return M!==b?(M=b,x.stop({"transient":!0}).then(function(){if("started"===J)return x.start({"transient":!0});else if("lazy"===J)return x.start({lazy:!0,"transient":!0})})):(new j).resolve()};this.getState=function(){return z};this.start=function(a){if(z==="uninstalled")return(new j).reject(Error("Plugin is uninstalled"));if(F)return F.promise.then(this.start.bind(this,a));if(z==="active")return(new j).resolve();if(!a||!a.transient){var h=a&&a.lazy?"lazy":"started";
h!==J&&(J=h,w())}h=c.getState();if(h!=="starting"&&h!=="active")return a.transient?(new j).reject(Error("start transient error")):(new j).resolve();if(z==="installed")try{this._resolve()}catch(f){return(new j).reject(f)}z==="resolved"&&K.forEach(function(b){n(b)});if(a&&a.lazy)return z!=="starting"&&(z="starting",c.dispatchEvent(new e("lazy activation",x))),(new j).resolve();var d=new j;F=d;z="starting";c.dispatchEvent(new e("starting",x));B=new j;C=c.connect(b,p,M);B.then(function(){B=null;z="active";
c.dispatchEvent(new e("started",x));F=null;d.resolve()},function(){B=null;z="stopping";c.dispatchEvent(new e("stopping",x));Object.keys(H).forEach(function(b){H[b].registration.unregister();delete H[b]});c.disconnect(C);C=null;z="resolved";F=null;c.dispatchEvent(new e("stopped",x));d.reject(Error("plugin activation error"))});return d.promise};this.stop=function(b){if(z==="uninstalled")return(new j).reject(Error("Plugin is uninstalled"));if(F)return F.promise.then(this.stop.bind(this,b));if((!b||
!b.transient)&&"stopped"!==J)J="stopped",w();if(z!=="active"&&z!=="starting")return(new j).resolve();F=b=new j;z="stopping";c.dispatchEvent(new e("stopping",x));Object.keys(H).forEach(function(b){H[b].registration.unregister();delete H[b]});C&&(c.disconnect(C),C=null);z="resolved";F=null;c.dispatchEvent(new e("stopped",x));b.resolve();return b.promise};G=function(a){if(z==="uninstalled")return(new j).reject(Error("Plugin is uninstalled"));if(!a)return I===0&&(I=(new Date).getTime(),w()),c.loadManifest(b).then(G);
var h=A,f=K,d=J;A=a.headers||{};K=a.services||{};J=a.autostart||J;a.lastModified?I=a.lastModified:(I=(new Date).getTime(),w());if(i(A,h)&&i(K,f)&&J===d)return(new j).resolve();if(z==="active"||z==="starting"){var y=[];Object.keys(K).forEach(function(b){var a=K[b];y.push(b);var c=H[b];if(c){if(i(a.methods,Object.keys(c.proxy))){var b=v(a),e=c.registration.getReference(),h={};e.getPropertyKeys().forEach(function(b){h[b]=e.getProperty(b)});i(b,h)||c.registration.setProperties(b);return}c.registration.unregister();
delete H[b]}n(a)});Object.keys(H).forEach(function(b){y.indexOf(b)===-1&&(H[b].registration.unregister(),delete H[b])})}z==="active"&&(c.disconnect(C),B=new j,C=c.connect(b,p,M),B.then(function(){B=null},function(){B=null;z="stopping";c.dispatchEvent(new e("stopping"),x);Object.keys(H).forEach(function(b){H[b].registration.unregister();delete H[b]});c.disconnect(C);C=null;z="resolved";c.dispatchEvent(new e("stopped",x))}));return(new j).resolve()};this.update=function(b){return G(b).then(function(){c.dispatchEvent(new e("updated",
x))})};this.uninstall=function(){if(z==="uninstalled")return(new j).reject(Error("Plugin is uninstalled"));if(z==="active"||z==="starting"||z==="stopping")return this.stop().then(this.uninstall.bind(this),this.uninstall.bind(this));c.removePlugin(this);z="uninstalled";c.dispatchEvent(new e("uninstalled",x));return(new j).resolve()}}var b=/^http[s]?/i;return{Plugin:c,PluginRegistry:function(h,f){function g(b){var n=b.source;p.some(function(a){if(n===a.target){try{var c;if(typeof a.useStructuredClone===
"undefined"){var e=typeof b.data!=="string";c=e?b.data:JSON.parse(b.data);a.useStructuredClone=e}else c=a.useStructuredClone?b.data:JSON.parse(b.data);a.handler(c)}catch(h){}return!0}})}var f=f||{},r=f.storage||localStorage;r.getItem||(r=a(r));var q="installed",s,i=[],p=[],t=new k,v={},n={registerService:h.registerService.bind(h),connect:function(b,n,a,c){function e(b){b=Error(b);b.name="timeout";n({method:"timeout",error:b})}var h={handler:n,url:b},f=setTimeout(e.bind(null,"Load timeout for: "+b),
c||15E3),l=document.createElement("iframe");l.name=b+"_"+(new Date).getTime();l.src=b;l.onload=function(){clearTimeout(f);f=setTimeout(e.bind(null,"Plugin handshake timeout for: "+b),5E3)};l.sandbox="allow-scripts allow-same-origin";l.style.width=l.style.height="100%";l.frameBorder=0;(a||s).appendChild(l);h.target=l.contentWindow;h.close=function(){clearTimeout(f);if(l){var b=l.parentNode;b&&b.removeChild(l);l=null}};p.push(h);return h},disconnect:function(b){for(var n=0;n<p.length;n++)if(b===p[n]){p.splice(n,
1);try{b.close()}catch(a){}break}},removePlugin:function(b){for(var n=0;n<i.length;n++)if(b===i[n]){i.splice(n,1);break}r.removeItem("plugin."+b.getLocation())},persist:function(b,n){r.setItem("plugin."+b,JSON.stringify(n))},postMessage:function(b,n){n.target.postMessage(n.useStructuredClone?b:JSON.stringify(b),n.url)},dispatchEvent:function(b){try{t.dispatchEvent(b)}catch(n){console&&console.log("PluginRegistry.dispatchEvent "+n)}},loadManifest:function(b){var a=new j,c=n.connect(b,function(b){c&&
b.method&&("manifest"===b.method||"plugin"===b.method?(b=b.params[0],n.disconnect(c),c=null,a.resolve(b)):"timeout"===b.method&&(n.disconnect(c),c=null,a.reject(b.error)))});return a.promise},getState:function(){return q},handleServiceError:function(n,a){if(a&&a.status===401){var c=n.getHeaders(),e=n.getName()||n.getLocation(),h=document.createElement("span");h.appendChild(document.createTextNode("Authentication required for: "+e+"."));if(c.login)h.appendChild(document.createTextNode(" ")),e=document.createElement("a"),
e.target="_blank",e.textContent="Login",e.href=c.login,b.test(e.href)?(h.appendChild(e),h.appendChild(document.createTextNode(" and re-try the request."))):console.log("Illegal Login URL: "+c.login);return{Severity:"Error",HTML:!0,Message:(new XMLSerializer).serializeToString(h)}}if(a.__isError){var f=a,a=Error(f.message);Object.keys(f).forEach(function(b){a[b]=f[b]});delete a.__isError}return a}};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(!(q==="starting"||q==="active"||q==="stopping")){addEventListener("message",g,!1);for(var b=[],a=0,e=r.length;a<e;a++)b.push(r.key(a));b.forEach(function(b){if(b.indexOf("plugin.")===0){var a=b.substring(7),b=JSON.parse(r.getItem(b));b.created&&i.push(new c(a,b,n))}});i.sort(function(b,n){return b._getCreated()<n._getCreated()?-1:1});if(f.parent)s=f.parent;else{s=document.createElement("div");
if(!f.visible)s.style.display="none",s.style.visibility="hidden";document.body.appendChild(s)}f.plugins&&Object.keys(f.plugins).forEach(function(b){b=d(b);if(!this.getPlugin(b)){var a=f.plugins[b];typeof a!=="object"&&(a={});a.autostart=a.autostart||f.defaultAutostart||"lazy";i.push(new c(b,a,n))}}.bind(this));q="starting"}};this.start=function(){q!=="starting"&&this.init();if(q!=="starting")return(new j).reject("Cannot start framework. Framework is already "+q+".");var b=[],n=(new Date).getTime();
i.forEach(function(a){var c=a._getAutostart();a.getLastModified()===0?b.push(a.update().then(function(){if("started"===c)return a.start({"transient":!0});if("lazy"===c)return a.start({lazy:!0,"transient":!0});a._resolve()})):"started"===c?b.push(a.start({"transient":!0})):"lazy"===c?(b.push(a.start({lazy:!0,"transient":!0})),n>a.getLastModified()+864E5&&a.update()):a._resolve()});return j.all(b,function(b){console.log("PluginRegistry.stop "+b)}).then(function(){q="active"})};this.stop=function(){if(q!==
"starting"&&q!=="active")return(new j).reject("Cannot stop registry. Registry is already "+q+".");q="stopping";var b=[];i.forEach(function(n){b.push(n.stop({"transient":!0}))});return j.all(b,function(b){console.log("PluginRegistry.stop "+b)}).then(function(){if(!f.parent){var b=s.parentNode;b&&b.removeChild(s)}s=null;removeEventListener("message",g);q="resolved"})};this.update=function(){this.stop().then(this.start.bind(this))};this.uninstall=function(){return(new j).reject("Cannot uninstall registry")};
this.installPlugin=function(b,a){var b=d(b),h=this.getPlugin(b);if(h)return(new j).resolve(h);if(v[b])return v[b];if(a)return h=new c(b,a,n),i.push(h),h._persist(),n.dispatchEvent(new e("installed",h)),(new j).resolve(h);var f=n.loadManifest(b).then(function(a){h=new c(b,a,n);i.push(h);h._persist();delete v[b];n.dispatchEvent(new e("installed",h));return h},function(n){delete v[b];throw n;});return v[b]=f};this.getPlugins=function(){return i.slice()};this.getPlugin=function(b){var n=null,b=d(b);i.some(function(a){if(b===
a.getLocation())return n=a,!0});return n};this.addEventListener=t.addEventListener.bind(t);this.removeEventListener=t.removeEventListener.bind(t);this.resolvePlugins=function(){var b=!0;i.forEach(function(n){b=b&&n._resolve()});return b}}}});
define("orion/serviceTracker",[],function(){function j(d,a){function g(b){var a=b.getProperty("service.id"),c=this.addingService(b);c&&(e[a]=b,h[a]=c)}function f(b){var a=b.getProperty("service.id"),c=h[a];delete e[a];delete h[a];this.removedService(b,c)}this.serviceRegistry=d;var e={},h={},c=k,b,l;this.close=function(){if(c!==i)throw"Already closed";c=k;d.removeEventListener("registered",b);d.removeEventListener("unregistering",l);l=b=null;var a=this;this.getServiceReferences().forEach(function(b){f.call(a,
b)});if(typeof this.onClose==="function")this.onClose()};this.getServiceReferences=function(){var b=Object.keys(e);return!b.length?null:b.map(function(b){return e[b]})};this.open=function(){if(c!==k)throw"Already open";c=i;var e=this;b=function(b){if(b.serviceReference.getProperty("objectClass").indexOf(a)!==-1&&(g.call(e,b.serviceReference),typeof e.onServiceAdded==="function"))return e.onServiceAdded(b.serviceReference,e.serviceRegistry.getService(b.serviceReference))};l=function(b){b.serviceReference.getProperty("objectClass").indexOf(a)!==
-1&&f.call(e,b.serviceReference)};d.addEventListener("registered",b);d.addEventListener("unregistering",l);d.getServiceReferences(a).forEach(function(b){g.call(e,b);if(typeof e.onServiceAdded==="function")return e.onServiceAdded(b,d.getService(b))});if(typeof this.onOpen==="function")this.onOpen()}}var k=0,i=1;j.prototype={addingService:function(d){return this.serviceRegistry.getService(d)},onOpen:null,onClose:null,onServiceAdded:null,removedService:function(){}};return j});
define("orion/objects",[],function(){function j(j){for(var i=1;i<arguments.length;i++){var d=arguments[i],a;for(a in d)Object.prototype.hasOwnProperty.call(d,a)&&(j[a]=d[a])}return j}return{clone:function(k){if(Array.isArray(k))return Array.prototype.slice.call(k);var i=Object.create(Object.getPrototypeOf(k));j(i,k);return i},mixin:j,toArray:function(j){return Array.isArray(j)?j:[j]}}});
define("orion/config",["orion/Deferred","orion/serviceTracker","orion/objects"],function(j,k,i){var d,a,g,f,e,h="pid";d=function(b,a,c){function e(b,c,h){c.forEach(function(e,n){try{var f=b[n].getProperty("__plugin__"),d=f&&a.getPlugin(f);(!f||d&&d.getState()==="active")&&c[n].updated(h)}catch(g){typeof console!=="undefined"&&console.log(g)}})}k.call(this,b,"orion.cm.managedservice");var f={},d={},g=function(a){var e=[];a.plugin.getServiceReferences().forEach(function(a){if(a.getProperty("objectClass").indexOf("orion.cm.managedservice")!==
-1){var f=a.getProperty(h),a=b.getService(a);f&&a&&(f=(f=c._find(f))&&f.getProperties(),e.push(a.updated(f)))}});return j.all(e)};this.addingService=function(a){var c=a.getProperty(h),e=b.getService(a);if(!c||!e)return null;f[c]||(f[c]=[]);d[c]||(d[c]=[]);f[c].push(a);d[c].push(e);return e};this.onServiceAdded=function(b,a){var f=b.getProperty(h),f=c._find(f);e([b],[a],f&&f.getProperties())};this.onOpen=function(){a.addEventListener("started",g)};this.onClose=function(){a.removeEventListener("started",
g)};this.notifyUpdated=function(b){var a=b.getPid();e(f[a]||[],d[a]||[],b.getProperties())};this.notifyDeleted=function(b){b=b.getPid();e(f[b]||[],d[b]||[],null)};this.removedService=function(b,a){var c=b.getProperty(h),e=f[c],n=d[c];e.length>1?e.splice(e.indexOf(b),1):delete f[c];n.length>1?n.splice(n.indexOf(a),1):delete d[c]}};a=function(){function b(b,a,c){this.store=new g(this,c);this.configAdmin=new f(this,this.store);this.tracker=new d(b,a,this.store)}b.prototype={getConfigurationAdmin:function(){var b=
this;return this.configAdmin._init().then(function(a){b.tracker.open();return a})},notifyDeleted:function(b){this.tracker.notifyDeleted(b)},notifyUpdated:function(b){this.tracker.notifyUpdated(b)}};return b}();f=function(){function b(b,a){this.factory=b;this.store=a}b.prototype={_init:function(){var b=this;return this.store._init().then(function(){return b})},getConfiguration:function(b){return this.store.get(b)},listConfigurations:function(){return this.store.list()}};return b}();var c="/cm/configurations";
g=function(){function b(b,a){this.factory=b;this.prefsService=a;this.configs=Object.create(null);this.pref=null;var f=this;this.initPromise=this.prefsService.getPreferences(c).then(function(b){f.pref=b;b.keys().forEach(function(a){if(!f.configs[a]){var c=b.get(a);typeof c==="object"&&c!==null&&Object.keys(c).length>0&&(c[h]=a,f.configs[a]=new e(f.factory,f,c))}})})}b.prototype={_init:function(){return this.initPromise},_find:function(b){return this.configs[b]||null},get:function(b){var a=this._find(b);
a||(a=new e(this.factory,this,b),this.configs[b]=a);return a},list:function(){var b=this,a=[];this.pref.keys().forEach(function(c){(c=b._find(c))&&c.getProperties()!==null&&a.push(c)});return a},remove:function(b){this.pref.remove(b);delete this.configs[b]},save:function(b,a){this.pref.put(b,a.getProperties(!0)||{})}};return b}();e=function(){function b(b,a){a=i.clone(a);delete a[h];b.properties=a}function a(c,e,f){this.factory=c;this.store=e;if(f!==null&&typeof f==="object")this.pid=f[h],b(this,
f);else if(typeof f==="string")this.pid=f,this.properties=null;else throw Error("Invalid pid/properties "+f);}a.prototype={_checkRemoved:function(){if(this._removed)throw Error("Configuration was removed");},getPid:function(){this._checkRemoved();return this.pid},getProperties:function(b){this._checkRemoved();var a=null;if(this.properties&&(a=i.clone(this.properties),!b))a[h]=this.pid;return a},remove:function(){this._checkRemoved();this.factory.notifyDeleted(this);this.store.remove(this.pid);this._removed=
!0},update:function(a){this._checkRemoved();b(this,a);this.store.save(this.pid,this);this.factory.notifyUpdated(this)},toString:function(){return"[ConfigImpl pid: "+this.pid+", properties: "+JSON.stringify(this.properties)+"]"}};return a}();return{ConfigurationAdminFactory:a}});
define("orion/bootstrap","require,orion/Deferred,orion/serviceregistry,orion/preferences,orion/pluginregistry,orion/config".split(","),function(j,k,i,d,a,g){var f;return{startup:function(){if(f)return f;f=new k;var e=new i.ServiceRegistry,h=new d.PreferencesService(e);return h.getPreferences("/plugins").then(function(c){var b={plugins:{}};c.keys().forEach(function(a){var e=j.toUrl(a);b.plugins[e]=c[a]});var l=new a.PluginRegistry(e,b);return l.start().then(function(){if(e.getServiceReferences("orion.core.preference.provider").length>
0)return h.getPreferences("/plugins",h.USER_SCOPE).then(function(b){var a=[];b.keys().forEach(function(b){b=j.toUrl(b);l.getPlugin(b)||a.push(l.installPlugin(b,{autostart:"lazy"}).then(function(b){return b.update().then(function(){return b.start({lazy:!0})})}))});return k.all(a,function(b){console.log(b)})})}).then(function(){return(new g.ConfigurationAdminFactory(e,l,h)).getConfigurationAdmin().then(e.registerService.bind(e,"orion.cm.configadmin"))}).then(function(){var b=e.getService("orion.core.auth");
if(b){var a=b.getUser().then(function(a){if(a)localStorage.setItem("lastLogin",(new Date).getTime());else return b.getAuthForm(window.location.href).then(function(b){setTimeout(function(){window.location=b},0)})}),c=localStorage.getItem("lastLogin");if(!c||c<(new Date).getTime()-9E5)return a}}).then(function(){var b={serviceRegistry:e,preferences:h,pluginRegistry:l};f.resolve(b);return b})})}}});
(function(){function j(a,d,f,e,h,c){d[a]&&(f.push(a),(d[a]===!0||d[a]===1)&&e.push(h+a+"/"+c))}function k(a,d,f,e,h){d=e+d+"/"+h;require._fileExists(a.toUrl(d+".js"))&&f.push(d)}function i(a,d,f){for(var e in d)d.hasOwnProperty(e)&&(!a.hasOwnProperty(e)||f)?a[e]=d[e]:typeof d[e]==="object"&&i(a[e],d[e],f)}var d=/(^.*(^|\/)nls(\/|$))([^\/]*)\/?([^\/]*)/;define("i18n",["module"],function(a){var g=a.config?a.config():{};return{version:"2.0.1+",load:function(a,e,h,c){c=c||{};if(c.locale)g.locale=c.locale;
var b=d.exec(a),l=b[1],m=b[4],o=b[5],r=m.split("-"),q=[],s={},u,p="";if(b[5])l=b[1],a=l+o;else{o=b[4];m=g.locale;if(!m)m=g.locale=typeof navigator==="undefined"?"root":(navigator.language||navigator.userLanguage||"root").toLowerCase();r=m.split("-")}if(c.isBuild){q.push(a);k(e,"root",q,l,o);for(u=0;u<r.length;u++)c=r[u],p+=(p?"-":"")+c,k(e,p,q,l,o);e(q,function(){h()})}else e([a],function(b){var a=[],n;j("root",b,a,q,l,o);for(u=0;u<r.length;u++)n=r[u],p+=(p?"-":"")+n,j(p,b,a,q,l,o);e(q,function(){var n,
c,f;for(n=a.length-1;n>-1&&a[n];n--){f=a[n];c=b[f];if(c===!0||c===1)c=e(l+f+"/"+o);i(s,c)}h(s)})})}}})})();
define("orion/i18n",[],function(){return{load:function(j,k,i,d){var d=d||{},a=/(^.*(?:^|\/)nls(?:\/|$))([^\/]*)\/?([^\/]*)/,g=a.exec(j);if(g){if(!k.defined||k.defined(j))try{i(k(j));return}catch(f){}if(d.isBuild||d.isTest)i({});else if(k.specified&&!k.specified("orion/bootstrap"))i({});else{var e=g[1],h=g[3]?g[2]:"",c=g[3]||g[2];k(["orion/bootstrap"],function(b){b.startup().then(function(b){var f=b.serviceRegistry,b=f.getServiceReferences("orion.i18n.message");if(h)b.some(function(b){return j===b.getProperty("name")?
(f.getService(b).getMessageBundle().then(function(b){i(b)},function(){i({})}),!0):!1})||i({});else{var o={},r;b.forEach(function(b){var f=b.getProperty("name");if((g=a.exec(f))&&e===g[1]&&c===(g[3]||g[2]))if(h=g[3]?g[2]:""){if((b=d.locale||(typeof navigator!=="undefined"?navigator.language||navigator.userLanguage:null))&&b.toLowerCase().indexOf(h.toLowerCase())===0)o[h]=!0,(!k.specified||!k.specified(f))&&define(f,["orion/i18n!"+f],function(b){return b})}else r=b});!k.specified||!k.specified(j)?r?
f.getService(r).getMessageBundle().then(function(b){Object.keys(o).forEach(function(a){typeof b[a]==="undefined"&&(b[a]=o[a])});define(j,[],b);i(b)},function(){define(j,[],o);i(o)}):(define(j,[],o),i(o)):i(o)}})})}}else i(null)}}});
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(j,k){var i={root:k};Object.keys(j).forEach(function(d){typeof i[d]==="undefined"&&(i[d]=j[d])});return i});
define("orion/util",[],function(){var j=navigator.userAgent,k=j.indexOf("MSIE")!==-1||j.indexOf("Trident")!==-1?document.documentMode:void 0,i=parseFloat(j.split("Firefox/")[1]||j.split("Minefield/")[1])||void 0,d=j.indexOf("Opera")!==-1?parseFloat(j.split("Version/")[1]):void 0,a=parseFloat(j.split("Chrome/")[1])||void 0,g=j.indexOf("Safari")!==-1&&!a,f=parseFloat(j.split("WebKit/")[1])||void 0,e=j.indexOf("Android")!==-1,h=j.indexOf("iPad")!==-1,j=j.indexOf("iPhone")!==-1,c=h||j,b=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(b){var a=arguments;return b.replace(/\$\{([^\}]+)\}/g,function(b,c){return a[(c<<0)+1]})},createElement:function(b,a){return b.createElementNS?b.createElementNS("http://www.w3.org/1999/xhtml",a):b.createElement(a)},isIE:k,isFirefox:i,isOpera:d,isChrome:a,isSafari:g,isWebkit:f,isAndroid:e,isIPad:h,isIPhone:j,isIOS:c,isMac:b,isWindows:l,
isLinux:m,isTouch:o,platformDelimiter:l?"\r\n":"\n"}});
define("orion/webui/littlelib",["orion/util"],function(j){function k(a,c){c||(c=document);return c.querySelectorAll(a)}function i(a){var c=a.tabIndex;c===0&&j.isIE&&!{a:!0,body:!0,button:!0,frame:!0,iframe:!0,img:!0,input:!0,isindex:!0,object:!0,select:!0,textarea:!0}[a.nodeName.toLowerCase()]&&!a.attributes.tabIndex&&(c=-1);return c}function d(a){if(i(a)>=0)return a;if(a.hasChildNodes())for(var c=0;c<a.childNodes.length;c++){var b=d(a.childNodes[c]);if(b)return b}return null}function a(e){if(i(e)>=
0)return e;if(e.hasChildNodes())for(var c=e.childNodes.length-1;c>=0;c--){var b=a(e.childNodes[c]);if(b)return b}return null}function g(a,c){if(a.nodeType===3){var b=f.exec(a.nodeValue);b&&b.length>1&&c(a,b)}if(a.hasChildNodes())for(b=0;b<a.childNodes.length;b++)g(a.childNodes[b],c)}var f=/\$\{([^\}]+)\}/,e=null;return{$:function(a,c){c||(c=document);return c.querySelector(a)},$$:k,$$array:function(a,c){return Array.prototype.slice.call(k(a,c))},node:function(a){var c=a;typeof a==="string"&&(c=document.getElementById(a));
return c},contains:function(a,c){if(!a||!c)return!1;if(a===c)return!0;var b=a.compareDocumentPosition(c);return Boolean(b&16)},bounds:function(a){a=a.getBoundingClientRect();return{left:a.left+document.documentElement.scrollLeft,top:a.top+document.documentElement.scrollTop,width:a.width,height:a.height}},empty:function(a){for(;a.hasChildNodes();)a.removeChild(a.firstChild)},firstTabbable:d,lastTabbable:a,stop:function(a){if(window.document.all)a.keyCode=0;a.preventDefault&&(a.preventDefault(),a.stopPropagation())},
processTextNodes:function(a,c){g(a,function(b,a){b.parentNode.replaceChild(document.createTextNode(c[a[1]]||a[1]),b)})},processDOMNodes:function(a,c){g(a,function(b,a){var e=c[a[1]];if(e){var f=document.createRange(),h=a.index;f.setStart(b,h);f.setEnd(b,h+a[0].length);f.deleteContents();f.insertNode(e)}})},addAutoDismiss:function(a,c){function b(b){e.forEach(function(a){var c=!1,e=a.excludeNodes.some(function(a){return document.body.contains(a)?(c=!0,a.contains(b.target)):!1});if(c&&!e)try{a.dismiss(b)}catch(f){typeof console!==
"undefined"&&console&&console.error(f&&f.message)}});e=e.filter(function(b){return b.excludeNodes.some(function(b){return document.body.contains(b)})})}e===null&&(e=[],document.addEventListener("click",b,!0),j.isIOS&&document.addEventListener("touchend",function(b){function a(){b.target.removeEventListener("click",a)}b.touches.length===0&&b.target.addEventListener("click",a)},!1));e.push({excludeNodes:a,dismiss:c})},setFramesEnabled:function(a){for(var c=document.getElementsByTagName("iframe"),b=
0;b<c.length;b++)c[b].parentNode.style.pointerEvents=a?"":"none"},removeAutoDismiss:function(a){e=e.filter(function(c){return a!==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(j){var k,i,d=["Msxml2.XMLHTTP","Microsoft.XMLHTTP","Msxml2.XMLHTTP.4.0"],a=/^\s*<\?xml(\s)+version=[\'\"](\d)*.(\d)*[\'\"](\s)*\?>/im,g=/<body[^>]*>\s*([\s\S]+)\s*<\/body>/im,f=typeof location!=="undefined"&&location.href,e=f&&location.protocol&&location.protocol.replace(/\:/,""),h=f&&location.hostname,c=f&&(location.port||void 0),b=[],l=j.config&&j.config()||{};k={version:"2.0.5",strip:function(b){if(b){var b=b.replace(a,""),c=b.match(g);c&&(b=c[1])}else b="";return b},
jsEscape:function(b){return b.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 b,a,c;if(typeof XMLHttpRequest!=="undefined")return new XMLHttpRequest;else if(typeof ActiveXObject!=="undefined")for(a=0;a<3;a+=1){c=d[a];try{b=new ActiveXObject(c)}catch(e){}if(b){d=[c];break}}return b},parseName:function(b){var a,
c,e=!1,f=b.indexOf(".");a=b.indexOf("./")===0||b.indexOf("../")===0;f!==-1&&(!a||f>1)?(a=b.substring(0,f),c=b.substring(f+1,b.length)):a=b;b=c||a;f=b.indexOf("!");f!==-1&&(e=b.substring(f+1)==="strip",b=b.substring(0,f),c?c=b:a=b);return{moduleName:a,ext:c,strip:e}},xdRegExp:/^((\w+)\:)?\/\/([^\/\\]+)/,useXhr:function(b,a,c,e){var f,h;f=k.xdRegExp.exec(b);if(!f)return!0;b=f[2];f=f[3];f=f.split(":");h=f[1];f=f[0];return(!b||b===a)&&(!f||f.toLowerCase()===c.toLowerCase())&&(!h&&!f||h===e)},finishLoad:function(a,
c,e,f){e=c?k.strip(e):e;l.isBuild&&(b[a]=e);f(e)},load:function(b,a,d,g){if(g.isBuild&&!g.inlineText)d();else{l.isBuild=g.isBuild;var i=k.parseName(b),g=i.moduleName+(i.ext?"."+i.ext:""),j=a.toUrl(g),p=l.useXhr||k.useXhr;!f||p(j,e,h,c)?k.get(j,function(a){k.finishLoad(b,i.strip,a,d)},function(b){d.error&&d.error(b)}):a([g],function(b){k.finishLoad(i.moduleName+"."+i.ext,i.strip,b,d)})}},write:function(a,c,e){if(b.hasOwnProperty(c)){var f=k.jsEscape(b[c]);e.asModule(a+"!"+c,"define(function () { return '"+
f+"';});\n")}},writeFile:function(b,a,c,e,f){var a=k.parseName(a),h=a.ext?"."+a.ext:"",l=a.moduleName+h,d=c.toUrl(a.moduleName+h)+".js";k.load(l,c,function(){var a=function(b){return e(d,b)};a.asModule=function(b,a){return e.asModule(b,d,a)};k.write(b,l,a,f)},f)}};if(l.env==="node"||!l.env&&typeof process!=="undefined"&&process.versions&&process.versions.node)i=require.nodeRequire("fs"),k.get=function(b,a){var c=i.readFileSync(b,"utf8");c.indexOf("\ufeff")===0&&(c=c.substring(1));a(c)};else if(l.env===
"xhr"||!l.env&&k.createXhr())k.get=function(b,a,c,e){var f=k.createXhr(),h;f.open("GET",b,!0);if(e)for(h in e)e.hasOwnProperty(h)&&f.setRequestHeader(h.toLowerCase(),e[h]);if(l.onXhr)l.onXhr(f,b);f.onreadystatechange=function(){var e;if(f.readyState===4)e=f.status,e>399&&e<600?(e=Error(b+" HTTP status: "+e),e.xhr=f,c(e)):a(f.responseText)};f.send(null)};else if(l.env==="rhino"||!l.env&&typeof Packages!=="undefined"&&typeof java!=="undefined")k.get=function(b,a){var c,e,f=new java.io.File(b),h=java.lang.System.getProperty("line.separator"),
f=new java.io.BufferedReader(new java.io.InputStreamReader(new java.io.FileInputStream(f),"utf-8")),l="";try{c=new java.lang.StringBuffer;(e=f.readLine())&&e.length()&&e.charAt(0)===65279&&(e=e.substring(1));for(e!==null&&c.append(e);(e=f.readLine())!==null;)c.append(h),c.append(e);l=String(c.toString())}finally{f.close()}a(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(j,k,i){return{slideoutHTMLFragment:function(d){var a=document.createElement("div");a.innerHTML=i;var g=k.$("#slideContainer",a);g.id=d+g.id;g=k.$("#pageCommandParameters",a);g.id=d+g.id;g=k.$("#pageCommandDismiss",a);g.id=d+g.id;return a.innerHTML}}});
define("orion/keyBinding",["orion/util"],function(j){function k(d,a,g,f,e,h){this.type=h||"keydown";this.keyCode=typeof d==="string"&&this.type==="keydown"?d.toUpperCase().charCodeAt(0):d;this.mod1=a!==void 0&&a!==null?a:!1;this.mod2=g!==void 0&&g!==null?g:!1;this.mod3=f!==void 0&&f!==null?f:!1;this.mod4=e!==void 0&&e!==null?e:!1}function i(d){this.keys=d}k.prototype={getKeys:function(){return[this]},match:function(d,a){if(a!==void 0){if(a!==0)return!1}else if(d instanceof Array){if(d.length>1)return!1;
d=d[0]}return d.type!==this.type?!1:this.keyCode===d.keyCode||this.keyCode===String.fromCharCode(j.isOpera?d.which:d.charCode!==void 0?d.charCode:d.keyCode)?this.mod1!==(j.isMac?d.metaKey:d.ctrlKey)?!1:this.type==="keydown"&&this.mod2!==d.shiftKey?!1:this.mod3!==d.altKey?!1:j.isMac&&this.mod4!==d.ctrlKey?!1:!0:!1},equals:function(d){return!d?!1:this.keyCode!==d.keyCode?!1:this.mod1!==d.mod1?!1:this.mod2!==d.mod2?!1:this.mod3!==d.mod3?!1:this.mod4!==d.mod4?!1:this.type!==d.type?!1:!0}};i.prototype=
{getKeys:function(){return this.keys.slice(0)},match:function(d,a){var g=this.keys;if(a!==void 0)return a>g.length?!1:g[a].match(d)?a===g.length-1?!0:a+1:!1;else{d instanceof Array||(d=[d]);if(d.length>g.length)return!1;var f;for(f=0;f<d.length;f++)if(!g[f].match(d[f]))return!1;return f===g.length?!0:f}},equals:function(d){if(!d.keys)return!1;if(d.keys.length!==this.keys.length)return!1;for(var a=0;a<d.keys.length;a++)if(!d.keys[a].equals(this.keys[a]))return!1;return!0}};return{KeyBinding:k,KeyStroke:k,
KeySequence:i}});
define("orion/webui/dropdown",["require","orion/webui/littlelib","orion/EventTarget"],function(j,k,i){function d(a){i.attach(this);this._init(a)}d.prototype={_init:function(a){this._dropdownNode=k.node(a.dropdown);if(!this._dropdownNode)throw"no dom node for dropdown found";this._populate=a.populate;this._selectionClass=a.selectionClass;this._parentDropdown=a.parentDropdown;this._positioningNode=a.positioningNode;if(!this._parentDropdown)for(var d=this._dropdownNode.parentNode;d&&document!==d;){if(d.classList&&
d.classList.contains("dropdownMenu")){this._parentDropdown=d.dropdown;break}d=d.parentNode}this._triggerNode=a.triggerNode?a.triggerNode:k.$(".dropdownTrigger",this._dropdownNode.parentNode);if(!this._triggerNode)throw"no dom node for dropdown trigger found";if(!a.skipTriggerEventListeners){var f=this;this._triggerNode.addEventListener("click",function(a){f.toggle(a)&&k.stop(a)},!1);this._triggerNode.tagName.toLowerCase()==="span"&&this._triggerNode.addEventListener("keydown",function(a){if(a.keyCode===
k.KEY.ENTER||a.keyCode===k.KEY.SPACE)f.toggle(),k.stop(a)},!1)}this._dropdownNode.addEventListener("keydown",this._dropdownKeyDown.bind(this),!1)},addTriggerNode:function(a){var d=this;a.addEventListener("click",function(a){d.toggle(a)&&k.stop(a)},!1)},toggle:function(a){return this.isVisible()?this.close():this.open(a)},isVisible:function(){return this._isVisible},open:function(a){var d=!1;if(!this.isVisible()){this.dispatchEvent({type:"triggered",dropdown:this,event:a});k.setFramesEnabled(!1);this._populate&&
(this.empty(),this._populate(this._dropdownNode));var f=this.getItems();if(f.length>0){if(!this._hookedAutoDismiss)this._boundAutoDismiss?k.removeAutoDismiss(this._boundAutoDismiss):this._boundAutoDismiss=this._autoDismiss.bind(this),d=k.$$array(".dropdownSubMenu",this._dropdownNode),k.addAutoDismiss([this._triggerNode].concat(d),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(a);f[0].focus();d=!0;this._parentDropdown&&this._parentDropdown.submenuOpen(this)}}return d},_autoDismiss:function(a){if(this.close(!1)&&this._dropdownNode.contains(a.target))for(a=this._parentDropdown;a;)a.close(!1),a=a._parentDropdown},_positionDropdown:function(){this._dropdownNode.style.left="";this._dropdownNode.style.top="";if(this._positioningNode)this._dropdownNode.style.left=this._positioningNode.offsetLeft+
"px";else{var a=k.bounds(this._dropdownNode),d=k.bounds(document.body);if(a.left+a.width>d.left+d.width)if(this._triggerNode.classList.contains("dropdownMenuItem"))this._dropdownNode.style.left=-a.width+"px";else{var f=k.bounds(this._boundingNode(this._triggerNode)),e=k.bounds(this._triggerNode);this._dropdownNode.style.left=e.left-f.left-a.width+e.width+"px"}a=a.top+a.height-(d.top+d.height);if(0<a)this._dropdownNode.style.top=Math.floor(this._dropdownNode.style.top-a)+"px"}},_boundingNode:function(a){var d=
window.getComputedStyle(a,null);return d===null?a:d.getPropertyValue("position")==="absolute"||!a.parentNode||a===document.body?a:this._boundingNode(a.parentNode)},close:function(a){var d=!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),a&&this._triggerNode.focus(),this._isVisible=!1,d=!0;return d},getItems:function(){var a=
[],d=this;k.$$array("li:not(.dropdownSeparator) > .dropdownMenuItem",this._dropdownNode,!0).forEach(function(f){f.parentNode.parentNode===d._dropdownNode&&a.push(f)});a.forEach(function(a){if(!a._hasDropdownMouseover)a.addEventListener("mouseover",function(e){a.dropdown?a.dropdown.open(e):(d._closeSelectedSubmenu(),k.stop(e))}),a._hasDropdownMouseover=!0});return a},empty:function(){var a=this;k.$$array("li",this._dropdownNode).forEach(function(d){d.parentNode===a._dropdownNode&&d.parentNode.removeChild(d)});
this._hookedAutoDismiss=!1},_dropdownKeyDown:function(a){if(a.keyCode===k.KEY.UP||a.keyCode===k.KEY.DOWN||a.keyCode===k.KEY.RIGHT||a.keyCode===k.KEY.ENTER||a.keyCode===k.KEY.LEFT){var d=this.getItems(),f=document.activeElement;if(d.length&&d.length>0&&f){var e=d.indexOf(f);e<0&&(e=d.indexOf(f.parentNode));e>=0&&(a.keyCode===k.KEY.UP&&e>0?(e--,d[e].focus()):a.keyCode===k.KEY.DOWN&&e<d.length-1?(e++,d[e].focus()):a.keyCode===k.KEY.ENTER||a.keyCode===k.KEY.RIGHT?f.classList.contains("dropdownTrigger")&&
f.dropdown&&f.dropdown.open():a.keyCode===k.KEY.LEFT&&f.parentNode.parentNode.classList.contains("dropdownMenuOpen")&&this.close(!0),k.stop(a))}}else a.keyCode===k.KEY.ESCAPE&&(this.close(!0),k.stop(a))},submenuOpen:function(a){if(a!==this._selectedSubmenu)this._closeSelectedSubmenu(),this._selectedSubmenu=a},_closeSelectedSubmenu:function(){for(var a=this._selectedSubmenu;a;)a.close(),a=a._selectedSubmenu},destroy:function(){this.empty();this._boundAutoDismiss&&k.removeAutoDismiss(this._boundAutoDismiss)}};
d.prototype.constructor=d;return{Dropdown:d}});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(j,k){function i(d){this._init(d)}i.prototype={_init:function(d){this._node=k.node(d.node);if(!this._node)throw"no dom node for tooltip found";this._position=d.position||["right","above","below","left"];this._text=d.text;this._hideDelay=d.hideDelay===void 0?200:d.hideDelay;this._tailSize=d.tailSize||10;this._trigger=d.trigger||"mouseover";this._afterShowing=d.afterShowing;this._afterHiding=d.afterHiding;var a=this;if(this._trigger===
"click")this._showDelay=0,this._node.addEventListener("click",this._clickHandler=function(f){f.target===a._node&&(a.show(),k.stop(f))},!1);else if(this._trigger==="mouseover"){this._showDelay=d.showDelay===void 0?500:d.showDelay;d=["mouseout","click"];this._node.addEventListener("mouseover",this._mouseoverHandler=function(f){k.contains(a._node,f.target)&&(a.show(),k.stop(f))},!1);this._leaveHandler=function(f){k.contains(a._node,f.target)&&a.hide()};for(var g=0;g<d.length;g++)this._node.addEventListener(d[g],
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 d=this;k.addAutoDismiss([this._tip,this._node],function(){d.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(d._timeout)window.clearTimeout(d._timeout),d._timeout=null;d._tip.addEventListener("mouseout",function(a){k.contains(d._tip,a.target)&&(d.hide(),k.stop(a))},
!1)},!1)}return this._tip},_positionTip:function(d,a){this._makeTipNode();d==="left"?this._tipInner.classList.add("left"):this._tipInner.classList.remove("left");var g=this._node,f;for(f=k.bounds(g);g&&!f.width&&!f.height;g=g.parentNode)f=k.bounds(g);var g=k.bounds(this._tipInner),e;switch(d){case "above":e=f.top-g.height-this._tailSize-1;f=f.left-this._tailSize;break;case "below":e=f.top+f.height+this._tailSize+1;f=f.left-this._tailSize;break;case "left":e=f.top-this._tailSize/2;f=f.left-g.width-
this._tailSize-1;break;default:e=f.top-this._tailSize/2,f=f.left+f.width+this._tailSize+1}var h=k.bounds(document.documentElement);if(e+g.height>h.height)if(a)e=h.height-g.height-1;else return!1;if(f+g.width>h.width)if(a)f=h.width-g.width-1;else return!1;if(f<0)if(a)f=4;else return!1;if(e<0)if(a)e=4;else return!1;if(this._tail&&this._tail.previousPosition!==d)this._tip.removeChild(this._tail),this._tail=null;if(!this._tail){this._tail=document.createElement("span");this._tail.classList.add("tooltipTailFrom"+
d);d==="above"||d==="left"?this._tip.appendChild(this._tail):this._tip.insertBefore(this._tail,this._tipInner);if(d==="left")this._tail.style.left=g.width+"px";this._tail.previousPosition=d}this._tip.style.top=e+"px";this._tip.style.left=f+"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 d=!1,a=0;!d&&a<this._position.length;)d=this._positionTip(this._position[a]),a++;d||this._positionTip(this._position[0],!0);this._tip.classList.add("tooltipShowing");this._afterShowing&&this._afterShowing()},hide:function(d){if(this._timeout)window.clearTimeout(this._timeout),this._timeout=null;if(this._tip&&this._tip.classList.contains("tooltipShowing")){if(d===void 0)d=
this._hideDelay;var a=this;this._timeout=window.setTimeout(function(){a._tip.classList.remove("tooltipShowing");a._tip.removeAttribute("style");a._afterHiding&&a._afterHiding()},d)}},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 d=["mouseout","click"],a=0;a<d.length;a++)this._node.removeEventListener(d[a],this._leaveHandler,!1)}}};i.prototype.constructor=i;return{Tooltip:i}});
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(j,k,i,d,a,g,f,e){function h(b){var a=b.invocation;if(a){var c=b.command;if(c.hrefCallback)return b=c.hrefCallback.call(a.handler||window,a),b.then?b.then(function(b){window.open(b)}):window.open(b),!0;else if(a.commandRegistry)return a.commandRegistry._invoke(a),
!0;else if(c.onClick||c.callback)return window.setTimeout(function(){(c.onClick||c.callback).call(a.handler||window,a)},0),!0}return!1}function c(b,a){for(var c in a)if(a[c]&&a[c].keyBinding&&a[c].command&&a[c].keyBinding.match(b)){var e=a[c],f=e.keyBinding;if((!f.domScope||k.contains(k.node(f.domScope),b.target))&&h(e)){k.stop(b);break}}}function b(){var b={};if(p){var a,c,e;c=Object.keys(t);for(a=0;a<c.length;a++)e=c[a],b[e]=t[e];var f=p();c=Object.keys(f);for(a=0;a<c.length;a++)e=c[a],b[e]=f[e]}else b=
t;return b}function l(a){c(a,b())}function m(b,a){b=b||window.event;if(function(b){if(j.isMac){if(b.metaKey&&!b.altKey)return!b.shiftKey&&!b.ctrlKey&&(b.keyCode===65||b.keyCode===67||b.keyCode===86||b.keyCode===88||b.keyCode===90)?!0:!1;if(b.ctrlKey)return!1}else{if(b.ctrlKey&&!b.altKey)return!b.shiftKey&&(b.keyCode===65||b.keyCode===67||b.keyCode===86||b.keyCode===88||b.keyCode===90)?!0:!1;if(b.altKey&&!b.ctrlKey)return!1}if(b["char"])return b["char"].length>0;else if(b.charCode||b.keyCode)switch(b=
b.charCode||b.keyCode,b){case 8:case 9:case 13:case 46:return!0;default:return b>=32&&b<112||b>123}return!1}(b)){if(b.target.contentEditable==="true")return;var c=b.target.nodeName.toLowerCase();if(c==="input")switch(b.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(c==="textarea")return}a?a(b):l(b)}function o(){this._init()}
function r(b,a,c){a.classList.add("commandImage");var e;b.imageClass?b.addImageClassToElement?a.classList.add(b.imageClass):(e=document.createElement("span"),a.appendChild(e),e.classList.add(b.spriteClass),e.classList.add(b.imageClass)):(e=new Image,e.alt=b.name,e.name=c,e.id=c,e.src=b.image,a.appendChild(e));return e}function q(b,a){var c=document.createElement("span");c.classList.add("dropdownKeyBinding");c.appendChild(document.createTextNode(a));b.appendChild(c)}function s(b,a,c,e,f){this.commandRegistry=
f;this.handler=b;this.items=a;this.userData=c;this.command=e;if(e.parameters)this.parameters=e.parameters.makeCopy();this.id=e.id}function u(b){this._init(b)}var p=null,t={};o.prototype={setProxy:function(b){this.proxy=b},setKeyBindings:function(b){this.bindings=b},_init:function(){var b=this;document.addEventListener("keydown",function(a){return m(a,function(a){var c=b.proxy,n=b.bindings;if(n&&c)for(var e=0;e<n.length;e++)n[e].match(a)&&(c.processKey({type:a.type,keyCode:a.keyCode,altKey:a.altKey,
ctrlKey:a.ctrlKey,metaKey:a.metaKey,shiftKey:a.shiftKey}),k.stop(a))})})}};window.document.addEventListener("keydown",m,!1);s.prototype={collectsParameters:function(){return this.commandRegistry&&this.commandRegistry.collectsParameters()},makeCopy:function(b){var a=new s(this.handler,this.items,this.userData,this.command,this.commandRegistry);a.domNode=this.domNode;a.domParent=this.domParent;if(b)a.parameters=b.makeCopy();else if(this.parameters)a.parameters=this.parameters.makeCopy();return a}};
s.prototype.constructor=s;u.prototype={_init:function(b){this.id=b.id;this.name=b.name;this.tooltip=b.tooltip;this.callback=b.callback;this.hrefCallback=b.hrefCallback;this.choiceCallback=b.choiceCallback;this.positioningNode=b.positioningNode;this.image=b.image||"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQAQMAAAAlPW0iAAAAA1BMVEUAAACnej3aAAAAAXRSTlMAQObYZgAAAAtJREFUCNdjIBEAAAAwAAFletZ8AAAAAElFTkSuQmCC";this.imageClass=b.imageClass;this.addImageClassToElement=b.addImageClassToElement;this.selectionClass=
b.selectionClass;this.spriteClass=b.spriteClass||"commandSprite";this.visibleWhen=b.visibleWhen;this.parameters=b.parameters;this.isEditor=b.isEditor},populateChoicesMenu:function(b,a,c,e,f){var c=this.getChoices(a,c,e),h=c.some(function(b){return b.checked});c.forEach(function(c){if(c.name){var e=document.createElement("li");b.appendChild(e);var w=document.createElement("span");w.tabIndex=0;w.role="menuitem";w.classList.add("dropdownMenuItem");if(h){var d=document.createElement("span");d.classList.add("check");
d.appendChild(document.createTextNode(c.checked?"\u25cf":""));w.appendChild(d)}d=document.createTextNode(c.name);w.appendChild(d);e.appendChild(w);w.choice=c;w.addEventListener("click",function(b){b.target.choice&&b.target.choice.callback.call(b.target.choice,a)},!1);w.addEventListener("keydown",function(b){(b.keyCode===k.KEY.ENTER||b.keyCode===k.KEY.SPACE)&&b.target.choice&&b.target.choice.callback.call(b.target.choice,a)},!1)}else f._generateMenuSeparator(b)})},getChoices:function(b,a,c){return this.choiceCallback?
this.choiceCallback.call(a,b,c):null},makeChoiceCallback:function(b,a){return function(c){b.callback&&b.callback.call(b,a,c)}},hasImage:function(){return this.imageClass||this.image!=="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQAQMAAAAlPW0iAAAAA1BMVEUAAACnej3aAAAAAXRSTlMAQObYZgAAAAtJREFUCNdjIBEAAAAwAAFletZ8AAAAAElFTkSuQmCC"}};u.prototype.constructor=u;return{Command:u,CommandInvocation:s,createDropdownMenu:function(b,c,e,f,h,l,g,m,o){b=k.node(b);if(!b)throw"no parent node was specified";
var q=document.createRange();q.selectNode(b);q=o?q.createContextualFragment(a):q.createContextualFragment(d);k.processTextNodes(q,{ButtonText:c});b.appendChild(q);var b=b.lastChild,s;o?(o=b.previousSibling,s=o.lastChild):o=b.previousSibling;f?o.classList.add(f):(o.classList.add("orionButton"),o.classList.add("commandButton"));if(h){if(!l)o.textContent="",o.setAttribute("aria-label",c);r({spriteClass:"commandSprite",imageClass:h},o,c);o.classList.add("orionButton")}o.dropdown=new i.Dropdown({dropdown:b,
populate:e,selectionClass:g,skipTriggerEventListeners:!!s,positioningNode:m});b.dropdown=o.dropdown;return{menuButton:o,menu:b,dropdown:o.dropdown,dropdownArrow:s}},createCheckedMenuItem:function(b,a,c,e){b=k.node(b);if(!b)throw"no parent node was specified";var h=document.createRange();h.selectNode(b);h=h.createContextualFragment(f);k.processTextNodes(h,{ItemText:a});b.appendChild(h);b=k.$(".checkedMenuItem",b.lastChild);b.checked=c;b.addEventListener("change",e,!1);return b},createCommandItem:function(b,
a,c,f,h,d,l){var g,d=d||!a.name&&a.hasImage();if(a.hrefCallback)g=document.createElement("a"),g.id=f,d&&a.hasImage()?r(a,g,f):(g.className="commandLink",g.appendChild(document.createTextNode(a.name))),l=a.hrefCallback.call(c.handler,c),l.then?l.then(function(b){g.href=b}):g.href=l?l:"#";else{g=document.createElement("button");g.className="orionButton";d?a.hasImage()?(r(a,g,f),a.name&&g.setAttribute("aria-label",a.name)):(g.classList.add("commandButton"),g.classList.add("commandMissingImageButton"),
g.appendChild(document.createTextNode(a.name))):(g.classList.add("commandButton"),f=document.createTextNode(a.name),g.appendChild(f));var m=l||a.callback;if(m)a.onClick=m,g.addEventListener("click",function(){m.call(c.handler,c)},!1)}b.nodeName.toLowerCase()==="ul"?(l=document.createElement("li"),b.appendChild(l),b=l):g.classList.add("commandMargins");b.appendChild(g);if(a.tooltip)g.commandTooltip=new e.Tooltip({node:g,text:a.tooltip,position:["above","below","right","left"]});h&&(t[a.id]={keyBinding:h,
command:a,invocation:c});return g},createCommandMenuItem:function(b,a,c,f,h,d){var l,g=b.dropdown;if(a.hrefCallback){l=document.createElement("a");var m=document.createElement("span");m.appendChild(document.createTextNode(a.name));m.classList.add("dropdownCommandName");l.appendChild(m);h=a.hrefCallback.call(c.handler,c);h.then?h.then(function(b){l.href=b}):l.href=h?h:"#";l.addEventListener("keydown",function(b){(b.keyCode===k.KEY.ENTER||b.keyCode===k.KEY.SPACE)&&l.click()},!1)}else{l=document.createElement("span");
l.tabIndex=0;m=document.createElement("span");m.appendChild(document.createTextNode(a.name));m.classList.add("dropdownCommandName");l.appendChild(m);var o=h||a.callback;if(o)a.onClick=o,l.addEventListener("click",function(){g.close(!0);o.call(c.handler,c)},!1),l.addEventListener("keydown",function(b){if(b.keyCode===k.KEY.ENTER||b.keyCode===k.KEY.SPACE)b.preventDefault(),l.click()},!1)}l.className="dropdownMenuItem";l.role="menuitem";if(a.tooltip)l.commandTooltip=new e.Tooltip({node:l,text:a.tooltip,
position:["above","below","right","left"]});d&&q(l,d);d=document.createElement("li");b.appendChild(d);d.appendChild(l);f&&(t[a.id]={keyBinding:f,command:a,invocation:c});return l},executeBinding:h,setKeyBindingProvider:function(b){p=b},localKeyBindings:t,CommandsProxy:o,getKeyBindings:b,processKey:l,NO_IMAGE:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQAQMAAAAlPW0iAAAAA1BMVEUAAACnej3aAAAAAXRSTlMAQObYZgAAAAtJREFUCNdjIBEAAAAwAAFletZ8AAAAAElFTkSuQmCC",_testMethodProcessKey:c}});
define("orion/explorers/navigationUtils",[],function(){function j(i,d){if(!k&&i)i.push({domNode:d}),d.tabIndex=-1,d.style.outline="none"}var k=navigator.userAgent.indexOf("iPad")!==-1;return{addNavGrid:function(i,d,a){i&&(i=i.getGridNavHolder(d,!0))&&j(i,a)},generateNavGrid:j,removeNavGrid:function(i,d){if(i)for(var a=0;a<i.length;a++)if(i[a].domNode===d){i.splice(a,1);break}}}});
define("orion/PageUtil",[],function(){var j=/^http[s]?/i;return{hash:function(){var j=window.location.href.split("#")[1];return j?"#"+j:""},matchResourceParameters:function(j){var j=j||window.location.toString(),i={resource:""},d=j.indexOf("#");if(d!==-1&&(j=j.substring(d+1),j.length!==0)){j=j.split(",");i.resource=decodeURIComponent(j[0]);for(d=1;d<j.length;d++){var a=/([^=]*)(=?)(.*)/.exec(j[d]),g=decodeURIComponent(a[1]||""),a=decodeURIComponent(a[3]||"");g!==""&&g!=="resource"&&(i[g]=a)}}return i},
validateURLScheme:function(k,i){var d=k;if(k.indexOf("://")===-1){var a=document.createElement("a");a.href=k;d=a.href}a=!1;return(a=i?i.some(function(a){return RegExp("^"+a+":","i").test(d)}):j.test(d))?k:(console.log("Illegal URL Scheme: '"+k+"'"),"")}}});
define("orion/uiUtils",["orion/webui/littlelib"],function(j){function k(d){var a="",g=navigator.platform.indexOf("Mac")!==-1;g?(d.mod4&&(a+="\u2303"),d.mod3&&(a+="\u2325"),d.mod2&&(a+="\u21e7"),d.mod1&&(a+="\u2318")):(d.mod1&&(a+="Ctrl+"),d.mod2&&(a+="Shift+"),d.mod3&&(a+="Alt+"));if(d.alphaKey)return a+d.alphaKey;if(d.type==="keypress")return a+d.keyCode;for(var f in j.KEY)if(typeof(j.KEY[f]==="number")&&j.KEY[f]===d.keyCode){if(g)switch(j.KEY[f]){case j.KEY.BKSPC:f="\u232b";break;case j.KEY.TAB:f=
"\u21e5";break;case j.KEY.ENTER:f="\u23ce";break;case j.KEY.ESCAPE:f="\u238b";break;case j.KEY.SPACE:f="\u2423";break;case j.KEY.PAGEUP:f="\u21de";break;case j.KEY.PAGEDOWN:f="\u21df";break;case j.KEY.END:f="\u21f2";break;case j.KEY.HOME:f="\u21f1";break;case j.KEY.DEL:f="\u2326"}switch(j.KEY[f]){case j.KEY.DOWN:f="\u2193";break;case j.KEY.UP:f="\u2191";break;case j.KEY.RIGHT:f="\u2192";break;case j.KEY.LEFT:f="\u2190"}return a+f}var e;switch(d.keyCode){case 59:e=d.mod2?":":";";break;case 61:e=d.mod2?
"+":"=";break;case 188:e=d.mod2?"<":",";break;case 190:e=d.mod2?">":".";break;case 191:e=d.mod2?"?":"/";break;case 192:e=d.mod2?"~":"`";break;case 219:e=d.mod2?"{":"[";break;case 220:e=d.mod2?"|":"\\";break;case 221:e=d.mod2?"}":"]";break;case 222:e=d.mod2?'"':"'"}return e?a+e:d.keyCode>=112&&d.keyCode<=123?a+"F"+(d.keyCode-111):a+String.fromCharCode(d.keyCode)}function i(d){var a=window.navigator.platform.indexOf("Mac")!==-1;return a&&d.metaKey||!a&&d.ctrlKey}return{getUserKeyString:function(d){for(var a=
"",d=d.getKeys(),g=0;g<d.length;g++)g!==0&&(a+=" "),a+=k(d[g]);return a},getUserText:function(d){var a=d.id,g=d.refNode,f=d.hideRefNode,e=d.initialText,h=d.onComplete,c=d.onEditDestroy,b=d.selectTo,l=d.isInitialValid,d=d.insertAsChild,m=!1,o=function(b){return function(d){if(!m){var o=j.node(a),i=o.value;if(o)if(b&&d.keyCode===j.KEY.ESCAPE){if(f)g.style.display="inline";m=!0;o.parentNode.removeChild(o);c&&c()}else if(!(b&&d.keyCode!==j.KEY.ENTER)){if(i.length===0||!l&&i===e){if(f)g.style.display=
"inline"}else if(h(i),f&&g.parentNode)g.style.display="inline";m=!0;o.parentNode&&o.parentNode.removeChild(o);c&&c()}}}},i=document.createElement("input");i.id=a;i.value=e||"";d?g.appendChild(i):g.parentNode.insertBefore(i,g.nextSibling);i.classList.add("userEditBoxPrompt");if(f)g.style.display="none";i.addEventListener("keydown",o(!0),!1);i.addEventListener("blur",o(!1),!1);window.setTimeout(function(){i.focus();if(e){var c=j.node(a),f=b?e.indexOf(b):-1;if(f>0)if(c.createTextRange)c=c.createTextRange(),
c.collapse(!0),c.moveStart("character",0),c.moveEnd("character",f),c.select();else if(c.setSelectionRange)c.setSelectionRange(0,f);else{if(c.selectionStart!==void 0)c.selectionStart=0,c.selectionEnd=f}else c.select()}},0)},openInNewWindow:i,followLink:function(d,a){a&&i(a)?window.open(d):window.location=d},createButton:function(d,a){var g=document.createElement("button");g.className="orionButton commandButton commandMargins";g.addEventListener("click",function(f){a();j.stop(f)},!1);d&&g.appendChild(document.createTextNode(d));
return g},createDropdownButton:function(){},isFormElement:function(d){switch(d.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(j,k,i,d,a,g,f,e,h,c){function b(b){this._commandList={};this._contributionsByScopeId={};this._activeBindings={};this._urlBindings={};this._pendingBindings={};this._init(b);this._parameterCollector=
null}function l(b,a){this.token=b;this.parameterName=a}function m(b,a,c){this.event=b;this.handler=a;this.capture=c||!1}function o(b,a,c,e,f,h){this.name=b;this.type=a;this.label=c;this.value=e;this.lines=f||1;this.eventListeners=Array.isArray(h)?h:h?[h]:[]}function r(b,a,c){this._storeParameters(b);this._hasOptionalParameters=a&&a.hasOptionalParameters;this._options=a;this.optionsRequested=!1;this.getParameters=c;this.clientCollect=a&&a.clientCollect}b.prototype={_init:function(b){this._selectionService=
b.selection;var a=this;j.setKeyBindingProvider(function(){return a._activeBindings})},processURL:function(b){for(var a in this._urlBindings)if(this._urlBindings[a]&&this._urlBindings[a].urlBinding&&this._urlBindings[a].command){var c=this._urlBindings[a].urlBinding.match(b);if(c){var e=this._urlBindings[a],f=e.command,h=e.invocation;if(h&&h.parameters&&f.callback){h.parameters.setValue(c.parameterName,c.parameterValue);var n=this;window.setTimeout(function(){n._invoke(h)},0);break}}}},findCommand:function(b){return this._commandList[b]},
runCommand:function(b,a,c,e){a?(b=this._commandList[b])&&(b.visibleWhen?b.visibleWhen(a):1)&&b.callback&&this._invoke(new j.CommandInvocation(c,a,null,b,this),e):(a=this._urlBindings[b])&&a.command&&a.command.callback&&this._invoke(a.invocation,e)},getSelectionService:function(){return this._selectionService},setParameterCollector:function(b){this._parameterCollector=b},openParameterCollector:function(b,a,c){this._parameterCollector&&(this._parameterCollector.close(),this._parameterCollector.open(b,
a,c))},confirm:function(b,a,c,e,f,h){var n=!1;if(this._parameterCollector&&!f){var w=this;this._parameterCollector.close();if(this._parameterCollector.open(b,function(b,f){var h=document.createElement("span");h.classList.add("parameterPrompt");h.textContent=a;b.appendChild(h);h=document.createElement("button");h.addEventListener("click",function(){n=!0;w._parameterCollector.close()},!1);f.appendChild(h);h.appendChild(document.createTextNode(c));h.className="dismissButton";var l=document.createElement("button");
l.addEventListener("click",function(){n=!1;w._parameterCollector.close()},!1);f.appendChild(l);l.appendChild(document.createTextNode(e));l.className="dismissButton";return h},function(){h(n)}))return}n=window.confirm(a);h(n)},closeParameterCollector:function(){this._parameterCollector&&this._parameterCollector.close()},collectsParameters:function(){return this._parameterCollector},_invoke:function(b,a){return this._collectAndInvoke(b.makeCopy(a),!1)},_collectAndInvoke:function(b,a){if(b)if(this._parameterCollector&&
b.parameters&&b.parameters.hasParameters()&&(a||b.parameters.shouldCollectParameters())){var c=!1;b.parameters.updateParameters(b);if(b.parameters.shouldCollectParameters()&&(c=this._parameterCollector.collectParameters(b),!c)){var e=new f.Tooltip({node:b.domNode,afterHiding:function(){this.destroy()},trigger:"click",position:["below","right","above","left"]}),c=e.contentContainer();c.classList.add("parameterPopup");var h=window.document.activeElement,l=this._parameterCollector.getFillFunction(b,
function(){h&&h.focus();e.destroy()})(c);e.show();window.setTimeout(function(){l.focus();l.select()},0);c=!0}c||b.command.callback.call(b.handler||window,b)}else b.command.callback.call(b.handler||window,b);else window.console.log("Client attempted to invoke command without an available (rendered) command invocation")},collectParameters:function(b){this._collectAndInvoke(b,!0)},showKeyBindings:function(b){function a(b){return function(){j.executeBinding(b)}}var c={},e,f,h=[],n;for(n in this._activeBindings)(f=
this._activeBindings[n])&&f.keyBinding&&f.command&&(f.command.name||f.command.tooltip)&&h.push(f);h.sort(function(b,a){return(b.command.name||b.command.tooltip).localeCompare(a.command.name||a.command.tooltip)});for(n=0;n<h.length;n++)f=h[n],f.keyBinding.scopeName?(c[f.keyBinding.scopeName]||(c[f.keyBinding.scopeName]=[]),c[f.keyBinding.scopeName].push(f)):(e=d.getUserKeyString(f.keyBinding),b.createItem(e,f.command.name||f.command.tooltip,a(f)));for(var w in c)c[w].length&&c[w].length>0&&(b.createHeader(w),
c[w].forEach(function(c){e=d.getUserKeyString(c.keyBinding);b.createItem(e,c.command.name||c.command.tooltip,a(c))}))},addCommand:function(b){this._commandList[b.id]=b;var a=this._pendingBindings[b.id];if(a){var c=this;a.forEach(function(a){c._addBinding(b,a.type,a.binding,a.bindingOnly)});delete this._pendingBindings[b.id]}},addCommandGroup:function(b,a,c,e,f,h,n,w,l,d){this._contributionsByScopeId[b]||(this._contributionsByScopeId[b]={});b=this._contributionsByScopeId[b];f&&(b=this._createEntryForPath(b,
f));if(b[a]){if(e)b[a].title=e;if(c)b[a].position=c;if(n)b[a].imageClass=n;if(w)b[a].tooltip=w;if(l)b[a].selectionClass=l;d===!0?b[a].pretendDefaultActionId=!0:b[a].defaultActionId=d;b[a].emptyGroupMessage=h}else b[a]={title:e,position:c,emptyGroupMessage:h,imageClass:n,tooltip:w,selectionClass:l,defaultActionId:d===!0?null:d,pretendDefaultActionId:d===!0,children:{}},b.sortedContributions=null},_createEntryForPath:function(b,a){a&&a.split("/").forEach(function(a){if(a.length>1){if(!b[a])b[a]={position:0,
children:{}},b.sortedContributions=null;b=b[a].children}});return b},registerSelectionService:function(b,a){this._contributionsByScopeId[b]||(this._contributionsByScopeId[b]={});this._contributionsByScopeId[b].localSelectionService=a},registerCommandContribution:function(b,a,c,e,f,h,n){this._contributionsByScopeId[b]||(this._contributionsByScopeId[b]={});b=this._contributionsByScopeId[b];e&&(b=this._createEntryForPath(b,e));b[a]={position:c};h&&((c=this._commandList[a])?this._addBinding(c,"key",h,
f):this._addPendingBinding(a,"key",h,f));n&&((c=this._commandList[a])?this._addBinding(c,"url",n,f):this._addPendingBinding(a,"url",n,f));b.sortedContributions=null},unregisterCommandContribution:function(b,a,c){if(this._contributionsByScopeId[b]){delete this._commandList[a];delete this._activeBindings[a];delete this._urlBindings[a];delete this._pendingBindings[a];var e=this._contributionsByScopeId[b];c&&c.split("/").forEach(function(b){if(b.length>1&&e[b])e=e[b].children});delete e[a];e.sortedContributions=
null}},_addBinding:function(b,a,c,e){if(!b.id)throw Error("No command id: "+b);a==="key"?this._activeBindings[b.id]={command:b,keyBinding:c,bindingOnly:e}:a==="url"&&(this._urlBindings[b.id]={command:b,urlBinding:c,bindingOnly:e})},_addPendingBinding:function(b,a,c,e){this._pendingBindings[b]=this._pendingBindings[b]||[];this._pendingBindings[b].push({type:a,binding:c,bindingOnly:e})},_checkForTrailingSeparator:function(b,c,e){var f;if(c==="tool"||c==="button")if((f=b.childNodes.length>0?b.childNodes[b.childNodes.length-
1]:null)&&f.classList.contains("commandSeparator"))return e?(b.removeChild(f),!1):!0;if(c==="menu"&&(b=a.$$array("li > *",b),b.length>0&&b[b.length-1].classList.contains("dropdownSeparator")))if(f=b[b.length-1],e)f.parentNode.parentNode.removeChild(f.parentNode);else return!0;return!1},renderCommands:function(b,c,e,f,h,l,n){if(typeof b!=="string")throw"a scope id for rendering must be specified";c=a.node(c);if(!c)throw"no parent";var w=this._contributionsByScopeId[b];if(!e&&w){var e=w.localSelectionService||
this._selectionService,d=this;e&&e.getSelections(function(a){d.renderCommands(b,c,a,f,h,l)})}else w&&(this._render(w,c,e,f,h||"button",l,n),this._checkForTrailingSeparator(c,h,!0))},destroy:function(b){b=a.node(b);if(!b)throw"no parent";for(;b.hasChildNodes();){var c=b.firstChild;c.commandTooltip&&c.commandTooltip.destroy();c.emptyGroupTooltip&&c.emptyGroupTooltip.destroy();this.destroy(c);b.removeChild(c)}},_render:function(b,a,c,e,h,l,n){var w=b.sortedContributions;if(!w){var w=[],g=!1,y;for(y in b)if(Object.prototype.hasOwnProperty.call(b,
y)){var m=b[y];if(m&&typeof m.position==="number")m.id=y,w.push(m),g=!0}if(g)w.sort(function(b,a){return b.position-a.position}),b.sortedContributions=w}var o=0,i=this;w.forEach(function(b){var w;if(!b.imageClass)b.imageClass=null;if(b.children&&Object.getOwnPropertyNames(b.children).length>0){var g=b.children;if(h==="tool"||h==="button")if(b.title){var y;if(b.defaultActionId)(g=i._commandList[b.defaultActionId])&&(g.visibleWhen?g.visibleWhen(c):1)?(y=new j.CommandInvocation(e,c,l,g,i),y.domParent=
a):b.pretendDefaultActionId=!0;g=i._createDropdownMenu(a,b.title,null,null,b.imageClass,b.tooltip,b.selectionClass,null,y,b.pretendDefaultActionId);n&&k.generateNavGrid(n,g.menuButton);if(g)if(i._render(b.children,g.menu,c,e,"menu",l,n),i._checkForTrailingSeparator(g.menu,"menu",!0),g.menu.childNodes.length===0)if(b.emptyGroupMessage){if(!g.menuButton.emptyGroupTooltip)g.menuButton.emptyGroupTooltip=new f.Tooltip({node:g.menuButton,text:b.emptyGroupMessage,trigger:"click",position:["below","right",
"above","left"]})}else n&&k.removeNavGrid(n,g.menuButton),b=function(b){b&&b.parentNode&&b.parentNode.removeChild(b)},b(g.menu),b(g.menuButton),b(g.destroyButton);else g.menuButton.style.visibility="visible"}else{var x;a.childNodes.length>0&&!i._checkForTrailingSeparator(a,h)&&(x=i.generateSeparatorImage(a));i._render(g,a,c,e,h,l,n);a.childNodes.length>0&&a.childNodes[a.childNodes.length-1]!==x&&(x=i.generateSeparatorImage(a))}else if(b.title){if(b=i._createDropdownMenu(a,b.title,!0,null,null,b.imageClass))i._render(g,
b.menu,c,e,"menu",l,n),i._checkForTrailingSeparator(b.menu,"menu",!0),b.menu.childNodes.length===0&&b.destroyButton&&a.removeChild(b.destroyButton)}else a.childNodes.length>0&&i._generateMenuSeparator(a),i._render(g,a,c,e,h,l,n),i._generateMenuSeparator(a)}else{var m=i._commandList[b.id],g=m?!0:!1;y=b=null;if(m){w=new j.CommandInvocation(e,c,l,m,i);w.domParent=a;x=g&&(m.visibleWhen?m.visibleWhen(c):!0);if(i._activeBindings[m.id]&&i._activeBindings[m.id].keyBinding)b=i._activeBindings[m.id],b.invocation=
x?w:null,b.bindingOnly&&(g=!1);if(i._urlBindings[m.id]&&i._urlBindings[m.id].urlBinding)y=i._urlBindings[m.id],y.invocation=x?w:null,y.bindingOnly&&(g=!1);g=g&&x}if(g)m.choiceCallback?(h==="tool"||h==="button"?(b=a,g=!1,a.nodeName.toLowerCase()==="ul"&&(b=document.createElement("li"),a.appendChild(b))):(b=a,g=!0),i._createDropdownMenu(b,m.name,g,function(b){m.populateChoicesMenu(b,c,e,l,i)}.bind(m),m.imageClass,m.tooltip||m.title,m.selectionClass,m.positioningNode)):(w.handler=w.handler||this,w.domParent=
a,g=function(){i._invoke(w)},h==="menu"?(y=null,b&&b.keyBinding&&(y=d.getUserKeyString(b.keyBinding)),b=j.createCommandMenuItem(a,m,w,null,g,y)):(b=h+m.id+o,b=j.createCommandItem(a,m,w,b,null,h==="tool",g)),k.generateNavGrid(n,b),w.domNode=b,o++)}})},_createDropdownMenu:function(b,e,h,l,d,m,n,w,x,y){b=a.node(b);if(!b||!a.contains(document.body,b))return null;var o,i,r=b;if(h)m=document.createRange(),m.selectNode(b),m=m.createContextualFragment(c),a.processTextNodes(m,{ButtonText:e}),b.appendChild(m),
i=b.lastChild,d=i.lastChild,e=d.previousSibling,e.dropdown=new g.Dropdown({dropdown:d,populate:l,parentDropdown:b.dropdown}),d.dropdown=e.dropdown;else{b.nodeName.toLowerCase()==="ul"&&(r=document.createElement("li"),b.appendChild(r),i=r);b=null;d&&(b="dropdownButtonWithIcon",m=m||e);var m=d?m||e:m,k=j.createDropdownMenu(r,e,l,b,d,!1,n,w,x||y);o=k.dropdownArrow;e=k.menuButton;if(o){if(x)x.domNode=k.menuButton;var z=this;e.onclick=function(b){var c=a.bounds(o);b.clientX>=c.left&&k.dropdown?k.dropdown.toggle(b):
z._invoke(x)};if(k.dropdown)e.onkeydown=function(b){a.KEY.DOWN===b.keyCode&&(k.dropdown.toggle(b),a.stop(b))}}var d=k.menu,F;(l=x&&x.command&&(x.command.tooltip||x.command.name))?F=x.command.tooltip||x.command.name:l&&(F=m);if(F)e.commandTooltip=new f.Tooltip({node:e,text:F,position:["above","below","right","left"]})}return{menuButton:e,menu:d,dropdown:e.dropdown,destroyButton:i,dropdownArrow:o}},_generateMenuSeparator:function(b){if(!this._checkForTrailingSeparator(b,"menu")){var a=document.createElement("li");
a.classList.add("dropdownSeparator");var c=document.createElement("span");c.classList.add("dropdownSeparator");a.appendChild(c);b.appendChild(a)}},generateSeparatorImage:function(b){var a;a=b.nodeName.toLowerCase()==="ul"?document.createElement("li"):document.createElement("span");b.appendChild(a);a.classList.add("core-sprite-sep");a.classList.add("imageSprite");a.classList.add("commandSeparator");return a}};b.prototype.constructor=b;l.prototype={match:function(b){b=i.matchResourceParameters(b);return typeof b[this.token]!==
"undefined"?(this.parameterValue=b[this.token],this):null}};l.prototype.constructor=l;m.prototype.constructor=m;o.prototype={optionsRequested:function(){return this.optionsRequested}};o.prototype.constructor=o;r.prototype={_storeParameters:function(b){this.parameterTable=null;if(b){var a=this.parameterTable={};b.forEach(function(b){a[b.name]=b})}},updateParameters:function(b){typeof this.getParameters==="function"&&this._storeParameters(this.getParameters(b))},hasParameters:function(){return this.parameterTable!==
null},shouldCollectParameters:function(){return!this.clientCollect&&this.hasParameters()},parameterNamed:function(b){return this.parameterTable[b]},valueFor:function(b){return(b=this.parameterTable[b])?b.value:null},setValue:function(b,a){var c=this.parameterTable[b];if(c)c.value=a},forEach:function(b){for(var a in this.parameterTable)this.parameterTable[a].type&&this.parameterTable[a].name&&b(this.parameterTable[a])},makeCopy:function(){var b=[];this.forEach(function(a){a=new o(a.name,a.type,a.label,
a.value,a.lines,a.eventListeners);b.push(a)});var a=new r(b,this._options,this.getParameters);a.clientCollect=this.clientCollect;return a},hasOptionalParameters:function(){return this._hasOptionalParameters}};r.prototype.constructor=r;return{CommandRegistry:b,URLBinding:l,ParametersDescription:r,CommandParameter:o,CommandEventListener:m}});
define("orion/parameterCollectors",["i18n!orion/nls/messages","require","orion/webui/littlelib"],function(j,k,i){function d(a,d){this._activeContainer=null;this._getElementsFunction=a;this._toolbarLayoutFunction=d}d.prototype={close:function(){if(this._activeElements){this._activeElements.parameterArea&&i.empty(this._activeElements.parameterArea);this._activeElements.slideContainer&&this._activeElements.slideContainer.classList.remove("slideContainerActive");this._activeElements.dismissArea&&i.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(a,d,f){typeof a==="string"&&(a=i.node(a));if(this._activeElements&&this._activeElements.slideContainer&&this._activeElements.commandNode===a)return this._activeElements.focusNode&&
this._activeElements.focusNode.focus(),!0;this.close();this._activeElements=null;if((this._activeElements=this._getElementsFunction(a))&&this._activeElements.parameterArea&&this._activeElements.slideContainer){this._activeElements.onClose=f;var e=d(this._activeElements.parameterArea,this._activeElements.dismissArea);if(!e)return!1;this._activeElements.focusNode=e;a=i.$$array("#closebox",this._activeElements.dismissArea||this._activeElements.parameterArea);if(a.length===0){d=this._activeElements.dismissArea||
this._activeElements.parameterArea;a=document.createElement("button");a.id="closebox";a.className="imageSprite core-sprite-close dismissButton";a.title=j.Close;d.appendChild(a);var h=this;a.addEventListener("click",function(){h.close()},!1)}this._activeElements.slideContainer.classList.add("slideContainerActive");this._toolbarLayoutFunction(this._activeElements);if(e)this._oldFocusNode=window.document.activeElement,window.setTimeout(function(){e.focus();e.select&&e.select()},0);this._activeElements.commandNode&&
this._activeElements.commandNode.classList.add("activeCommand");return!0}return!1},_collectAndCall:function(a,d){i.$$array("input",d).forEach(function(f){f.type==="checkbox"?a.parameters.setValue(f.parameterName,f.checked):f.type!=="button"&&a.parameters.setValue(f.parameterName,f.value.trim())});i.$$array("textArea",d).forEach(function(f){a.parameters.setValue(f.parameterName,f.value.trim())});a.command.callback&&a.command.callback.call(a.handler,a)},collectParameters:function(a){return a.parameters?
(a.domNode&&a.domNode.classList.add("commandMarker"),this.open(a.domNode||a.domParent,this.getFillFunction(a))):!1},getFillFunction:function(a,d){var f=this;return function(e,h){var c=null,b=function(){d&&d();f.close()},l=function(c){c.keyCode===i.KEY.ENTER&&f._collectAndCall(a,e);if(c.keyCode===i.KEY.ESCAPE||c.keyCode===i.KEY.ENTER)b(),i.stop(c)};a.parameters.forEach(function(f){var h=null;if(f.label)h=document.createElement("label"),h.classList.add("parameterInput"),h.setAttribute("for",f.name+
"parameterCollector"),h.textContent=f.label,e.appendChild(h);var d=f.name+"parameterCollector",g,h=h||e;if(f.type==="text"&&typeof f.lines==="number"&&f.lines>1)g=document.createElement("textarea"),g.rows=f.lines,g.type="textarea",g.id=d,h.appendChild(g),l=function(a){a.keyCode===i.KEY.ESCAPE&&(b(),i.stop(a))};else if(f.type==="boolean"){if(g=document.createElement("input"),g.type="checkbox",g.id=d,h.appendChild(g),f.value)g.checked=!0}else if(g=document.createElement("input"),g.type=f.type,g.id=
d,h.appendChild(g),f.value)g.value=f.value;g.classList.add("parameterInput");g.setAttribute("speech","speech");g.setAttribute("x-webkit-speech","x-webkit-speech");g.parameterName=f.name;c||(c=g);f.eventListeners.length>0&&f.eventListeners.forEach(function(b){g.addEventListener(b.event,function(c){return b.handler(c,a)},b.capture)});g.addEventListener("keydown",l,!1)});var m=h;m||(m=document.createElement("span"),m.classList.add("layoutRight"),m.classList.add("parametersDismiss"),e.appendChild(m));
var o=function(b,a){var c=document.createElement("button");a.appendChild(c);b&&c.appendChild(document.createTextNode(b));c.classList.add("dismissButton");return c};if(a.parameters.hasOptionalParameters())a.parameters.optionsRequested=!1,o(j.More,m).addEventListener("click",function(){a.parameters.optionsRequested=!0;f._collectAndCall(a,e);b()},!1);o(j.Submit,m).addEventListener("click",function(){f._collectAndCall(a,e);b()},!1);m=o(null,m);m.id="closebox";m.classList.add("imageSprite");m.classList.add("core-sprite-close");
m.title=j.Close;m.addEventListener("click",function(){b()},!1);return c}}};d.prototype.constructor=d;return{CommandParameterCollector:d}});define("orion/regex",[],function(){return{escape:function(j){return j.replace(/([\\$\^*\/+?\.\(\)|{}\[\]])/g,"\\$&")},parse:function(j){return(j=/^\s*\/(.+)\/([gim]{0,3})\s*$/.exec(j))?{pattern:j[1],flags:j[2]}:null}}});
define("orion/contentTypes",[],function(){function j(a,b){function e(b,a,c,f){var c=a.filename.indexOf(c)>=0,h;h=f.toLowerCase();h=a.extension.indexOf(h)!==-1;if(c||h){if(!(h=!b))c&&(f=f.toLowerCase(),c=b.extension.indexOf(f)!==-1),h=c;if(h)return a}return b}if(typeof a!=="string")return null;for(var f=a&&a.split(".").pop(),h=null,d=0;d<b.length;d++){var g=b[d];e(h,g,a,f)===g&&(h=g)}return h}function k(a){return a===null||typeof a==="undefined"?[]:Array.isArray(a)?a:[a]}function i(a){return k(a).map(function(b){return String.prototype.toLowerCase.call(b)})}
function d(a){return{id:a.id,name:a.name,image:a.image,imageClass:a.imageClass,"extends":a["extends"],extension:i(a.extension),filename:k(a.filename)}}function a(a){var b=Object.create(null);a.map(d).forEach(function(a){Object.prototype.hasOwnProperty.call(b,a.id)||(b[a.id]=a)});return b}function g(c){if(c&&c.registerService){this.serviceRegistry=c;for(var b=c.getServiceReferences(e).concat(c.getServiceReferences(h)),d=[],g=0;g<b.length;g++)for(var o=k(b[g].getProperty("contentTypes")),i=0;i<o.length;i++)d.push(o[i]);
this.map=a(d);c.registerService(f,this)}else if(Array.isArray(c))this.serviceRegistry=null,this.map=a(c);else throw Error("Invalid parameter");}var f="orion.core.contentTypeRegistry",e="orion.core.contenttype",h="orion.file.contenttype";g.prototype={getContentTypes:function(){var a=this.getContentTypesMap(),b=[],e;for(e in a)Object.prototype.hasOwnProperty.call(a,e)&&b.push(a[e]);return b},getContentTypesMap:function(){return this.map},getFileContentType:function(a){return j(a.Name,this.getContentTypes())},
getFilenameContentType:function(a){return j(a,this.getContentTypes())},getContentType:function(a){return this.map[a]||null},isExtensionOf:function(a,b){a=typeof a==="string"?this.getContentType(a):a;b=typeof b==="string"?this.getContentType(b):b;if(!a||!b)return!1;if(a.id===b.id)return!0;else for(var e=a,f={};e&&(e=this.getContentType(e["extends"]));){if(e.id===b.id)return!0;if(f[e.id])throw Error("Cycle: "+e.id);f[e.id]=!0}return!1},isSomeExtensionOf:function(a,b){for(var e=0;e<b.length;e++)if(this.isExtensionOf(a,
b[e]))return!0;return!1}};return{ContentTypeRegistry:g,getFilenameContentType:j}});
define("orion/URITemplate",[],function(){function j(b){this._text=b}function k(b){return b.replace("%25","%")}function i(b,a){if(a==="U")return encodeURIComponent(b).replace(/[!'()*]/g,function(b){return"%"+b.charCodeAt(0).toString(16).toUpperCase()});if(a==="U+R")return encodeURI(b).replace(/%5B/g,"[").replace(/%5D/g,"]").replace(c,k);if(a==="U+R-,")return encodeURI(b).replace(/%5B/g,"[").replace(/%5D/g,"]").replace(/,/g,"%2C");throw Error("Unknown allowed character set: "+a);}function d(b,a,c){for(var e=
[],f=0;f<b.length;f++)typeof b[f]!=="undefined"&&e.push(i(b[f],a));return e.join(c)}function a(b,a,c,e){for(var f=Object.keys(b),h=[],d=0;d<f.length;d++)typeof b[f[d]]!=="undefined"&&h.push(i(f[d],a)+c+i(b[f[d]],a));return h.join(e)}function g(b){if(b.length===0)throw Error("Invalid Expression: 0 length expression");(this._operator=e[b[0]])?b=b.substring(1):this._operator=e.NUL;for(var a=[],c=b.split(","),f=0;f<c.length;f++){var d=c[f].match(h);if(d===null)throw Error("Bad VarSpec: "+b);a.push({name:d[1],
explode:!!d[2],prefix:d[3]?parseInt(d[3],10):-1})}this._varSpecList=a}function f(b){for(var a=[],c=0,e=b.indexOf("{",c);e!==-1;){a.push(new j(b.substring(c,e)));c=b.indexOf("}",e+1);if(c===-1)throw Error("Invalid template: "+b);a.push(new g(b.substring(e+1,c)));c+=1;e=b.indexOf("{",c)}a.push(new j(b.substring(c)));this._templateComponents=a}var e={NUL:{first:"",sep:",",named:!1,ifemp:"",allow:"U"},"+":{first:"",sep:",",named:!1,ifemp:"",allow:"U+R"},".":{first:".",sep:",",named:!1,ifemp:"",allow:"U"},
"/":{first:"/",sep:"/",named:!1,ifemp:"",allow:"U"},";":{first:";",sep:";",named:!0,ifemp:"",allow:"U"},"?":{first:"?",sep:"&",named:!0,ifemp:"=",allow:"U"},"&":{first:"&",sep:"&",named:!0,ifemp:"=",allow:"U"},"#":{first:"#",sep:",",named:!1,ifemp:"",allow:"U+R"},",":{first:"",sep:",",named:!1,ifemp:"",allow:"U+R-,"}},h=/^((?:(?:[a-zA-Z0-9_])|(?:%[0-9A-F][0-9A-F]))(?:(?:[a-zA-Z0-9_.])|(?:%[0-9A-F][0-9A-F]))*)(?:(\*)|:([0-9]+))?$/,c=/%25[0-9A-F][0-9A-F]/g;j.prototype={expand:function(){return encodeURI(this._text)}};
g.prototype={expand:function(b){for(var c=[],e=0;e<this._varSpecList.length;e++){var f=this._varSpecList[e],h=f.name,g=b[h],j=typeof g;if(j!=="undefined"&&g!==null){var k=c.length===0?this._operator.first:this._operator.sep;if(j==="string")this._operator.named&&(k+=i(h,"U+R"),k+=g.length===0?this._operator.ifemp:"="),f.prefix!==-1&&f.prefix<g.length&&(g=g.substring(0,f.prefix)),k+=i(g,this._operator.allow);else if(Array.isArray(g)){if(g.length===0)continue;f.explode?k+=d(g,this._operator.allow,this._operator.sep):
(f=d(g,this._operator.allow,","),this._operator.named&&(k+=i(h,"U+R"),k+=f.length===0?this._operator.ifemp:"="),k+=f)}else if(j==="object"){if(Object.keys(g).length===0)continue;f.explode?k+=a(g,this._operator.allow,"=",this._operator.sep):(f=a(g,this._operator.allow,",",","),this._operator.named&&(k+=i(h,"U+R"),k+=f.length===0?this._operator.ifemp:"="),k+=f)}else throw Error("bad param type: "+h+" : "+j);c.push(k)}}return c.join("")}};f.prototype={expand:function(b){for(var a=[],c=0;c<this._templateComponents.length;c++)a.push(this._templateComponents[c].expand(b));
return a.join("")}};return f});
define("orion/i18nUtil",["require","orion/Deferred"],function(j,k){function i(a){if(a=localStorage.getItem("orion/messageBundle/"+a))if(a=JSON.parse(a),a._expires&&a._expires>(new Date).getTime())return delete a._expires,a;return null}var d={};return{getMessageBundle:function(a){function g(b){b?j(["i18n!"+a],function(b){if(b){var c=a;b._expires=(new Date).getTime()+9E5;localStorage.setItem("orion/messageBundle/"+c,JSON.stringify(b));delete b._expires}e.resolve(b)}):f(Error(a))}function f(b){e.reject(b)}
if(d[a])return d[a];var e=new k;d[a]=e;var h=i(a);if(h)return e.resolve(h),e;try{j([a],g,f)}catch(c){j(["orion/i18n!"+a],g,f)}return e},formatMessage:function(a){var d=arguments;return a.replace(/\$\{([^\}]+)\}/g,function(a,e){return d[(e<<0)+1]})}}});
define("orion/PageLinks","require,orion/Deferred,orion/PageUtil,orion/URITemplate,orion/i18nUtil,orion/objects,orion/URL-shim".split(","),function(j,k,i,d,a,g){function f(){return j.toUrl?(new URL(j.toUrl("orion/../"),window.location.href)).href.slice(0,-1):(new URL("/",window.location.href)).href.slice(0,-1)}function e(b){var a={};b.getPropertyKeys().forEach(function(c){c!=="objectClass"&&c!=="service.names"&&c!=="service.id"&&c!=="__plugin__"&&(a[c]=b.getProperty(c))});return a}function h(b){return a.getMessageBundle(b.nls).then(function(a){b.textContent=
b.nameKey?a[b.nameKey]:b.name;return b},function(){b.textContent=b.nameKey||b.name;return b})}function c(b,a){var c=b.getServiceReferences(a||"orion.page.link"),l=i.matchResourceParameters(window.location.href),g={OrionHome:f(),Location:l.resource},m=[];c.forEach(function(b){b=e(b);if(b.uriTemplate&&(b.nls||b.name)){var a=(new d(b.uriTemplate)).expand(g),a=i.validateURLScheme(a);b.href=a;b.nls?m.push(h(b)):(b.textContent=b.name,m.push((new k).resolve(b)))}});return k.all(m)}function b(b){var a=this.categories=
Object.create(null);b.forEach(function(b){a[b.id]=b})}function l(b){this.allPageLinks=b;this.allPageLinks.sort(m)}function m(b,a){var c=b.textContent&&b.textContent.toLowerCase(),e=a.textContent&&a.textContent.toLowerCase();return c<e?-1:c>e?1:0}var o;g.mixin(b.prototype,{getCategoryIDs:function(){return Object.keys(this.categories)},getCategory:function(b){return this.categories[b]||null}});g.mixin(l.prototype,{createLinkElements:function(){return this.allPageLinks.map(function(b){var a=b.href,b=
b.textContent,c=document.createElement("a");c.href=a;c.target="_self";c.classList.add("targetSelector");c.textContent=b;return c})},getAllLinks:function(){return this.allPageLinks}});return{getCategoriesInfo:function(a){var c;return!o?(c=[],a.getServiceReferences("orion.page.link.category").forEach(function(b){b=e(b);if(b.id&&(b.name||b.nameKey))b.nls?c.push(h(b)):(b.textContent=b.name,c.push((new k).resolve(b)))}),k.all(c).then(function(a){return o=new b(a)})):(new k).resolve(o)},getPageLinksInfo:function(b,
a){return c(b,a).then(function(b){return new l(b)})},getOrionHome:f}});
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(j,k){var i={root:k};Object.keys(j).forEach(function(d){typeof i[d]==="undefined"&&(i[d]=j[d])});return i});
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(j,k,i,d,a,g,f,e,h,c){function b(b){var a={};b.getPropertyKeys().forEach(function(c){a[c]=b.getProperty(c)});return a}var l={},m=h.getOrionHome();l._cloneItemWithoutChildren=function s(b){if(b===null||typeof b!=="object")return b;var a=b.constructor(),c;for(c in b)c!=="children"&&c!==
"Children"&&(a[c]=s(b[c]));return a};l._getOpenWithNavCommandExtensions=function(b){function a(b,c){for(var e=b.getServiceReferences("orion.navigate.openWith"),f=[],n=[],h=0;h<e.length;h++){var d=e[h];if(d.getProperty("editor")===c.id){var w=d.getProperty("contentType");w instanceof Array?f=f.concat(w):f.push(w||"*/*");d=d.getProperty("excludedContentTypes");d instanceof Array?n=n.concat(d):d!==null&&typeof d!=="undefined"&&n.push(d)}}0===f.length&&(f=null);0===n.length&&(n=null);return{contentTypes:f,
excludedContentTypes:n}}for(var c=function(){for(var a=b.getServiceReferences("orion.edit.editor"),c=[],e=0;e<a.length;e++){var f=a[e],n=f.getProperty("id");c.push({id:n,"default":f.getProperty("default")||!1,name:f.getProperty("name"),nameKey:f.getProperty("nameKey"),nls:f.getProperty("nls"),uriTemplate:f.getProperty("orionTemplate")||f.getProperty("uriTemplate"),validationProperties:f.getProperty("validationProperties")||[]})}return c}(),e=[],f=0;f<c.length;f++){var n=c[f],h=a(b,n);e.push({properties:{name:n.name||
n.id,nameKey:n.nameKey,id:"eclipse.openWithCommand."+n.id,contentType:h.contentTypes,excludedContentTypes:h.excludedContentTypes,uriTemplate:n.uriTemplate,nls:n.nls,forceSingleItem:!0,isEditor:n["default"]?"default":"editor",validationProperties:n.validationProperties},service:{}})}return e};l._makeValidator=function(b,c,e,f){function h(b,a,c,e){var f=c.match,n,d;if((n=a.indexOf("["))>=0){if((d=a.indexOf("]"))<0)return!1;var l=a.substring(0,n),g;if(!(g=b[l])||!Array.isArray(g))return!1;n=a.substring(n+
1,d);n=parseInt(n,10);if(isNaN(n))return!1;n<0&&(n+=g.length);a=a.substring(d+1);a=l+":"+String(n)+a}if(a.indexOf("|")>=0)return n=a.substring(0,a.indexOf("|")),a=a.substring(a.indexOf("|")+1),h(b,n,c,e)?!0:h(b,a,c,e);else if(a.indexOf(":")>=0)return n=a.substring(0,a.indexOf(":")),a=a.substring(a.indexOf(":")+1),b[n]?h(b[n],a,c,e):!1;else{a:{var l=!1,m;if(a.charAt(0)==="!")c=typeof b[a.substring(1)]==="undefined";else if(typeof b[a]!=="undefined"){if(typeof f==="undefined")m=b[a],l=!0;else if(typeof f===
"string"){if(!typeof(b[a]==="string")){c=!1;break a}if(c.variableName){if(f=RegExp(f).exec(b[a]))m=f[0],m=c.variableMatchPosition==="before"?b[a].substring(0,f.index):c.variableMatchPosition==="after"?b[a].substring(f.index+m.length):c.variableMatchPosition==="only"?m:b[a],l=!0}else{c=RegExp(f).test(b[a]);break a}}else b[a]===f&&(m=b[a],l=!0);if(l&&c.variableName&&(e[c.variableName]=m,e.itemCached=b,c.replacements))for(b=0;b<c.replacements.length;b++)m=!1,c.replacements[b].pattern?e[c.variableName]=
e[c.variableName].replace(RegExp(c.replacements[b].pattern),c.replacements[b].replacement||""):m=!0,m&&window.console.log("Invalid replacements specified in validation property.  "+c.replacements[b]);c=l}else c=!1}return c}}function n(c,e,f){if(f.info.validationProperties)for(var n=0;n<f.info.validationProperties.length;n++){var d=f.info.validationProperties[n];if(typeof d.source!=="undefined"){if(!h(c,d.source,d,f))return!1}else return window.console.log("Invalid validationProperties in "+b.id+".  No source property specified."),
!1}var n=!0,l=e?a.getFilenameContentType(c.Name,e):null,l=l||{id:"application/octet-stream"};f.info.excludedContentTypes&&e&&(n=f.info.excludedContentTypes.every(function(b){b=b.replace(/([*?])/g,".$1");return-1!==l.id.search(b)?!1:!0}));n&&f.info.contentType&&e&&(n=f.info.contentType.some(function(b){b=b.replace(/([*?])/g,".$1");return-1!==l.id.search(b)?!0:!1}));return n}return{info:b,validationFunction:function(b){typeof f==="function"&&(b=f.call(this,b));if(b){if(Array.isArray(b)){if((this.info.forceSingleItem||
this.info.uriTemplate)&&b.length!==1)return!1;if(b.length<1)return!1}else b=[b];for(var a=0;a<b.length;a++)if(!n(b[a],e,this))return!1;return!0}return!1},generatesURI:function(){return!!this.info.uriTemplate},getURI:function(b){if(this.info.uriTemplate){var a={},c;for(c in b)Object.prototype.hasOwnProperty.call(b,c)&&(a[c]=b[c]);if(this.info.validationProperties)for(c=0;c<this.info.validationProperties.length;c++){var e=this.info.validationProperties[c];e.source&&e.variableName&&(this.itemCached===
b&&this[e.variableName]||h(b,e.source,e,this),b[e.variableName]?window.console.log("Variable name "+e.variableName+" in the extension "+this.info.id+" conflicts with an existing property in the item metadata."):a[e.variableName]=this[e.variableName])}a.OrionHome=m;return(new g(this.info.uriTemplate)).expand(a)}return null}}};var o=c.UnnamedCommand;l._createCommandOptions=function(b,a,c,e,h,n){function d(f,w){var g=l._makeValidator(b,c,e,n);f.visibleWhen=g.validationFunction.bind(g);if(h)if(g.generatesURI.bind(g)())f.hrefCallback=
function(b){b=Array.isArray(b.items)?b.items[0]:b.items;return g.getURI.bind(g)(b)};else{var m=b;f.callback=function(b){var e;if(m.forceSingleItem)b=Array.isArray(b.items)?b.items[0]:b.items,e=l._cloneItemWithoutChildren(b);else if(Array.isArray(b.items)){e=[];for(var n=0;n<b.items.length;n++)e.push(l._cloneItemWithoutChildren(b.items[n]))}else e=l._cloneItemWithoutChildren(b.items);if(c)var h=c.getService("orion.page.progress");a.run?h?h.progress(a.run(e),"Running command: "+f.name):a.run(e):c&&
(h?h.progress(c.getService(a).run(e),"Running command: "+f.name):c.getService(a).run(e))}}w.resolve(f)}var g=new k;if(b.nls){var m=function(a){var c;a?(c=b.tooltipKey&&a[b.tooltipKey],a=b.nameKey&&a[b.nameKey]||b.name||o,c=c||b.tooltip||""):(a=b.name||b.nameKey||o,c=b.tooltip||b.tooltipKey||"");d({name:a,image:b.image,id:b.id||b.name,tooltip:c,isEditor:b.isEditor,showGlobally:b.showGlobally},g)};f.getMessageBundle(b.nls).then(m,m.bind(this,null))}else d({name:b.name,image:b.image,id:b.id||b.name,
tooltip:b.tooltip,isEditor:b.isEditor,showGlobally:b.showGlobally},g);return g};l.getOpenWithCommand=function(b,a,c){for(var e,b=c||l.getOpenWithCommands(b),c=0;c<b.length;c++)if(b[c].visibleWhen(a)){var f=b[c].isEditor==="default";if(!e||f)if(e=b[c],f)break}return e};l.getOpenWithCommands=function(b){var a=[],c;for(c in b._commandList){var e=b._commandList[c];e.isEditor&&a.push(e)}return a};var r;l.createAndPlaceFileCommandsExtension=function(b,a,e,f,h,n){return l.createFileCommands(b,null,n?"all":
void 0,!!n,a).then(function(b){h&&0<b.length&&(a.addCommandGroup(e,"eclipse.openWith",1E3,c.OpenWith,h,null,null,null,"dropdownSelection"),a.addCommandGroup(e,"eclipse.fileCommandExtensions",1E3,c.OpenRelated,h));b.forEach(function(b){var c=null;h&&(c=b.isEditor?h+"/eclipse.openWith":h+"/eclipse.fileCommandExtensions");a.registerCommandContribution(e,b.id,f,c)});return{}})};l.createFileCommands=function(b,a,c,e,f){var c=c===void 0?"global":c,e=e===void 0?!0:e,n=[];l._cachedFileCommands||l._createCachedFileCommands(b);
(c==="all"||c==="global")&&l._cachedFileCommands.forEach(function(b){var a=b.properties;(c==="all"||a.forceSingleItem&&a.showGlobally)&&n.push(b)});return k.when(function(){var c=b.getService("orion.core.contentTypeRegistry")||a;return r||k.when(c.getContentTypes(),function(b){return r=b})}(),function(){if(e){if(!l._cachedOpenWithExtensions)l._cachedOpenWithExtensions=l._getOpenWithNavCommandExtensions(b,r);n=n.concat(l._cachedOpenWithExtensions);f._addedOpenWithCommands=e}var a=n.map(function(a){var c=
a.properties,a=a.service,e=f.findCommand(c.id||c.name);return e?(new k).resolve(e):l._createCommandOptions(c,a,b,r,!0).then(function(b){b=new i.Command(b);f.addCommand(b);return b})});return k.all(a,function(b){return{_error:b}}).then(function(b){return b})})};l._createCachedFileCommands=function(a){var c=a.getServiceReferences("orion.navigate.command");l._cachedFileCommands=[];for(var e=0;e<c.length;e++)if(c[e].getProperty("id")!=="orion.navigateFromMetadata"){var f=a.getService(c[e]),h=b(c[e]);
l._cachedFileCommands.push({properties:h,service:f})}};l.getFileCommandIds=function(){var b=[];if(l._cachedFileCommands)l._cachedFileCommands.length&&(b=l._cachedFileCommands.map(function(b){return b.properties.id}));else throw"extensionCommandUtils._cachedFileCommands is not initialized";return b};l.createOpenWithCommands=function(b,a,c){return c&&c._addedOpenWithCommands?(new k).resolve(l.getOpenWithCommands(c)):l.createFileCommands(b,a,"none",!0,c)};return l});
define("orion/breadcrumbs",["require","orion/webui/littlelib"],function(j,k){function i(d){this._init(d)}i.prototype={_init:function(d){var a=k.node(d.container);if(!a)throw"no parent container";this._container=a;a.classList.remove("currentLocation");this._id=d.id||"eclipse.breadcrumbs";this._resource=d.resource||null;this._rootSegmentName=d.rootSegmentName;this._workspaceRootSegmentName=d.workspaceRootSegmentName;this._workspaceRootURL=d.workspaceRootURL;this._makeHref=d.makeHref;this._makeFinalHref=
d.makeFinalHref;this._maxLength=d.maxLength;this.path="";this.measure();this.render()},getNavigatorWorkspaceRootSegment:function(){if(this._workspaceRootSegmentName){var d;if(this._resource&&this._resource.Parents&&!this._resource.skip){d=document.createElement("a");var a=this._workspaceRootURL?this._workspaceRootURL:"";this._makeHref?this._makeHref(d,a):d.href=j.toUrl("edit/edit.html")+"#"+a}else d=document.createElement("span");k.empty(d);d.appendChild(document.createTextNode(this._workspaceRootSegmentName));
return d}return null},MAX_LENGTH:500,INCLUDE_FIRST_SECTION:!0,segments:[],buildSegment:function(d){var a=document.createElement("a");a.classList.add("breadcrumb");a.appendChild(document.createTextNode(d));return a},addSegmentHref:function(d,a){this._makeHref?this._makeHref(d,a.Location,a):d.href=j.toUrl("edit/edit.html")+"#"+a.ChildrenLocation},buildSegments:function(d,a){if(this._resource.Parents){var g=this._resource.Parents.slice(0),f,e;g&&(g=g.slice(0),a==="reverse"&&(g=g.reverse().slice(0)),
g.forEach(function(a){if(!a.skip)d?(e=d,d=null):e=a.Name,f=this.buildSegment(e),this.path+=a.Name,this.addSegmentHref(f,a),f.include=!1,this.segments.push(f)}.bind(this)))}},addDivider:function(){var d=document.createElement("span");d.appendChild(document.createTextNode(" / "));this.path+="/";d.classList.add("breadcrumbSeparator");this.append(d)},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(d){this.crumbs.appendChild(d)},addTitle:function(d,a){var g=a||document.title;this.crumbs.childNodes.length===0&&(d=document.createElement("span"),d.appendChild(document.createTextNode(g)),
d.classList.add("breadcrumb"),d.classList.add("currentLocation"),this.append(d))},finalSegment:function(d,a){if(!this._resource.skip){var g;g=a?a:this._resource.Name;this._makeFinalHref?(d=this.buildSegment(g),this.addSegmentHref(d,this._resource)):(d=document.createElement("span"),d.appendChild(document.createTextNode(g)));d.classList.add("currentLocation");this.path+=this._resource.Name;this.append(d)}},firstSegment:function(d){if(d)if(this.append(d),this._resource&&this._resource.Parents&&!this._resource.skip)d.classList.add("breadcrumb"),
this.addDivider();else{if(!this._resource.skip)d.href="";d.classList.add("currentLocation")}},drawSegments:function(){this._resource.Parents&&this.segments.slice(0).forEach(function(d){d.include===!0&&(this.append(d),this.addDivider())}.bind(this))},measureSegments:function(){this.INCLUDE_FIRST_SECTION=!0;if(this._resource.Parents){var d=this.segments.slice(0).reverse();d.forEach(function(a){this.append(a);this.addDivider();this.crumbs.offsetWidth<this.MAX_LENGTH?a.include=!0:this.INCLUDE_FIRST_SECTION=
!1}.bind(this));this.segments=d.reverse()}},measure:function(){var d=this._container;d.style.width="auto";this.MAX_LENGTH=this._maxLength?this._maxLength:d.offsetWidth;this.refresh();this.segments=[];this.crumbs.style.visibility="hidden";var d=this.getNavigatorWorkspaceRootSegment(),a=this._rootSegmentName;if(a)this.addTitle(d,a);else if(this.finalSegment(d,a),this._resource&&this._resource.Parents&&(this.buildSegments(a,"reverse"),this.measureSegments(),this.firstSegment(d)),this.crumbs.offsetWidth>=
this.MAX_LENGTH)this.INCLUDE_FIRST_SECTION=!1},render:function(){this.refresh();var d=this.getNavigatorWorkspaceRootSegment(),a=this._rootSegmentName;a?this.addTitle(d,a):(this.INCLUDE_FIRST_SECTION===!0&&this.firstSegment(d),this._resource&&this._resource.Parents&&(this.drawSegments(),this.finalSegment(d,a)));this.crumbs.parentNode.style.width=this.crumbs.offsetWidth+20+"px"}};i.prototype.constructor=i;return{BreadCrumbs:i}});
define("orion/webui/splitter",["require","orion/EventTarget","orion/webui/littlelib"],function(j,k,i){function d(a){k.attach(this);this._init(a)}d.prototype={_init:function(a){this._tracking=null;this._animationDelay=501;this._closeReversely=a.closeReversely;this.$node=i.node(a.node);if(!this.$node)throw"no dom node for splitter found";this.$sideNode=i.node(a.sidePanel);if(!this.$sideNode)throw"no dom node for side panel found";this.$mainNode=i.node(a.mainPanel);if(!this.$mainNode)throw"no dom node for main panel found";
this._vertical=a.vertical;this._prefix="/orion/splitter/"+(this.$node.id||document.body.id||"");if(a.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 a.closeByDefault!=="undefined")this._closeByDefault=a.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(a){this.addEventListener("resize",function(d){a(d.node)})},_initializeFromStoredSettings:function(){var a=localStorage.getItem(this._prefix+"/toggleState");this._closed=typeof a==="string"?a==="closed":this._closeByDefault;var a=i.bounds(this.$node.parentNode),d=i.bounds(this.$node),f;if(this._vertical)if(f=localStorage.getItem(this._prefix+"/yPosition")){if(this._splitTop=parseInt(f,10),this._splitTop>a.top+a.height-d.height)this._splitTop=a.top+a.height/
2}else{if(this._closeByDefault)this._initialSplit=this._getSplitPosition(),this._splitTop=0}else if(f=localStorage.getItem(this._prefix+"/xPosition")){if(this._splitLeft=parseInt(f,10),this._splitLeft>a.left+a.width-d.width)this._splitLeft=a.left+a.width/2}else if(this._closeByDefault)this._initialSplit=this._getSplitPosition(),this._splitLeft=0},_getSplitPosition:function(){var a=i.bounds(this.$node),d=i.bounds(this.$node.parentNode);return this.vertical?a.top-d.top:a.left-d.left},_adjustToSplitPosition:function(a){var d=
i.bounds(this.$node),f=i.bounds(this.$node.parentNode);if(this._vertical){this._splitHeight=d.height;if(a||!this._splitTop)this._splitTop=d.top,localStorage.setItem(this._prefix+"/yPosition",this._splitTop);a=this._splitTop;this.$node.parentNode.style.position==="relative"&&(a=this._splitTop-f.top);this.$sideNode.style.height=a+"px";this.$sideNode.style.display="block";this.$node.style.top=a+"px"}else{this._splitWidth=d.width;if(a||!this._splitLeft)this._splitLeft=d.left,localStorage.setItem(this._prefix+
"/xPosition",this._splitLeft);a=this._splitLeft;this.$node.parentNode.style.position==="relative"&&(a=this._splitLeft-f.left);this.$sideNode.style.width=a+"px";this.$sideNode.style.display="block";this.$node.style.left=a+"px"}this._resize()},_resize:function(a,d,f){var a=a||0,e=i.bounds(this.$node.parentNode),h=i.bounds(this.$node);this._vertical?(f===void 0&&(f=h.top-e.top),f+=h.height,this.$mainNode.style.top=f+"px"):(d===void 0&&(d=h.left-e.left),d+=h.width,this.$mainNode.style.left=d+"px");var c=
this;window.setTimeout(function(){c._notifyResizeListeners(c.$mainNode);c._notifyResizeListeners(c.$sideNode)},a)},_notifyResizeListeners:function(a){this.dispatchEvent({type:"resize",node:a})},_notifyToggleListeners:function(){this.dispatchEvent({type:"toggle",closed:this._closed})},_thumbDown:function(a,d){a||this._addAnimation();var f=this._splitTop,e=this._splitLeft;if(this._closed){if(this._closed=!1,!this._splitLeft&&!this._splitTop&&typeof this._initialSplit==="number")f=e=this._initialSplit}else if(this._closed=
!0,this._closeReversely){var h=i.bounds(this.$node.parentNode),c=i.bounds(this.$node);this._vertical?f=h.height-c.height:e=h.width-c.width}else f=e=0;this._vertical?(this.$sideNode.style.height=f+"px",this.$node.style.top=f+"px"):(this.$sideNode.style.width=e+"px",this.$node.style.left=e+"px");this._resize(this._animationDelay,e,f);a||this._removeAnimation();d||localStorage.setItem(this._prefix+"/toggleState",this._closed?"closed":null);var b=this;window.setTimeout(function(){b._notifyToggleListeners()},
this._animationDelay)},_removeAnimation:function(){var a=this;window.setTimeout(function(){a.$sideNode.classList.remove(a._vertical?"sidePanelVerticalLayoutAnimation":"sidePanelLayoutAnimation");a.$mainNode.classList.remove(a._vertical?"mainPanelVerticalLayoutAnimation":"mainPanelLayoutAnimation");a.$node.classList.remove(a._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(a){if(a.target===this._thumb)return i.stop(a),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),i.setFramesEnabled(!1),i.stop(a)},_mouseMove:function(a){if(this._tracking){var d=i.bounds(this.$node.parentNode);if(this._vertical){this._splitTop=a.clientY;if(this._splitTop<d.top+5)this._splitTop=d.top+5;else if(this._splitTop>d.top+d.height-5)this._splitTop=d.top+d.height-5;var f=this._splitTop,f=this._splitTop-d.top;this.$node.style.top=f+"px"}else{this._splitLeft=a.clientX;if(this._splitLeft<d.left+5)this._splitLeft=d.left+5;else if(this._splitLeft>
d.left+d.width-5)this._splitLeft=d.left+d.width-5;f=this._splitLeft;f=this._splitLeft-2*d.left;this.$node.style.left=f+"px"}this._adjustToSplitPosition(!0);i.stop(a)}},_mouseUp:function(a){if(this._tracking)i.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"),i.stop(a)}};d.prototype.constructor=d;return{Splitter:d}});
define("orion/keyAssist",["i18n!orion/nls/messages","orion/webui/littlelib","orion/util"],function(j,k,i){function d(a){this.commandRegistry=a.commandRegistry;this.create();this._filterString="";this._providers=[]}d.prototype={addProvider:function(a){this._providers.push(a)},create:function(){var a=this._keyAssistDiv=document.createElement("div");a.id="keyAssist";a.style.display="none";a.classList.add("keyAssistFloat");a.setAttribute("role","menu");var d=this._keyAssistInput=document.createElement("input");
d.classList.add("keyAssistInput");d.type="text";d.placeholder=j["Filter bindings"];a.appendChild(d);var f=this._keyAssistContents=document.createElement("div");f.classList.add("keyAssistContents");if(i.isIOS||i.isAndroid)f.style.overflowY="auto";a.appendChild(f);var e=this._keyAssistTable=document.createElement("table");e.tabIndex=0;e.classList.add("keyAssistList");f.appendChild(e);document.body.appendChild(a);d.addEventListener("keydown",function(a){this._keyDown(a)}.bind(this));e.addEventListener("keydown",
function(a){this._keyDown(a)}.bind(this));d.addEventListener("input",function(){this.filterChanged()}.bind(this));f.addEventListener(i.isFirefox?"DOMMouseScroll":"mousewheel",function(a){this._scrollWheel(a)}.bind(this));document.addEventListener("keydown",function(a){a.keyCode===k.KEY.ESCAPE&&this.hide()}.bind(this));k.addAutoDismiss([a],function(){this.hide()}.bind(this))},createContents:function(){k.empty(this._keyAssistTable);this._selectedIndex=-1;this._selectedRow=null;for(var a=this._idCount=
this._keyAssistContents.scrollTop=0;a<this._providers.length;a++)this._providers[a].showKeyBindings(this);this.createHeader(j.Global);this.commandRegistry.showKeyBindings(this)},createItem:function(a,d,f){if(this._filterString){var e=this._filterString.toLowerCase(),h;e!==this._filterString?(e=this._filterString,h=function(b){return b}):h=function(b){return b.toLowerCase()};if(h(d).indexOf(e)===-1&&h(a).indexOf(e)===-1&&h(this._lastHeader).indexOf(e)===-1)return}var c=this._keyAssistTable.insertRow(-1);
c.id="keyAssist-keyBinding-"+this._idCount++;c.setAttribute("role","menuitem");c._execute=f;c.classList.add("keyAssistItem");c.addEventListener("click",function(b){this._selectedRow=c;this.execute();b.preventDefault()}.bind(this));f=c.insertCell(-1);f.classList.add("keyAssistName");f.appendChild(document.createTextNode(d));f=c.insertCell(-1);f.classList.add("keyAssistAccel");f.appendChild(document.createTextNode(a))},createHeader:function(a){this._lastHeader=a;var d=this._keyAssistTable.insertRow(-1);
d.classList.add("keyAssistSection");var d=d.insertCell(-1),f=document.createElement("h2");f.appendChild(document.createTextNode(a));d.appendChild(f)},execute:function(){window.setTimeout(function(){this.hide();var a=this._selectedRow;this._selectedRow=null;a&&a._execute&&a._execute()}.bind(this),0)},filterChanged:function(){this._timeout&&window.clearTimeout(this._timeout);this._timeout=window.setTimeout(function(){this._timeout=null;var a=this._keyAssistInput.value;if(this._filterString!==a)this._filterString=
a,this.createContents()}.bind(this),100)},hide:function(){if(this.isVisible()){var a=document.activeElement,d=this._keyAssistDiv,a=d===a||(d.compareDocumentPosition(a)&16)!==0;d.style.display="none";a&&document.compareDocumentPosition(this._previousActiveElement)!==1&&this._previousActiveElement.focus();this._previousActiveElement=null}},isVisible:function(){return this._keyAssistDiv.style.display==="block"},removeProvider:function(a){a=this._providers.indexOf(a);a!==-1&&this._providers.splice(a,
1)},select:function(a){var d=this._keyAssistTable.querySelectorAll(".keyAssistItem");if(d.length===0)this._selectedIndex=-1;else{var f=this._selectedIndex;f+=a?1:-1;f%=d.length;f<0&&(f=d.length-1);if(this._selectedIndex!==-1)a=d[this._selectedIndex],a.classList.remove("selected"),this._selectedRow=null;this._selectedIndex=f;if(this._selectedIndex!==-1){this._selectedRow=a=d[this._selectedIndex];a.classList.add("selected");this._keyAssistTable.setAttribute("aria-activedescendant",a.id);this._keyAssistTable.focus();
var d=a.getBoundingClientRect(),e=this._keyAssistContents,h=e.getBoundingClientRect();a.offsetTop<e.scrollTop?f===0?e.scrollTop=0:a.scrollIntoView(!0):d.bottom>h.bottom&&a.scrollIntoView(!1)}}},show:function(){if(!this.isVisible())this._previousActiveElement=document.activeElement,this.createContents(),this._keyAssistContents.style.height=Math.floor(this._keyAssistDiv.parentNode.clientHeight*0.75)+"px",this._keyAssistDiv.style.display="block",this._keyAssistInput.value=this._filterString,this._keyAssistInput.focus(),
this._keyAssistInput.select()},_keyDown:function(a){if(a.keyCode===40)this.select(!0);else if(a.keyCode===38)this.select(!1);else if(a.keyCode===13)this.execute();else return;a.preventDefault()},_scrollWheel:function(a){var d=0,d=i.isIE||i.isOpera?-a.wheelDelta:i.isFirefox?a.detail*40:-a.wheelDeltaY,f=this._keyAssistContents,e=f.scrollTop;f.scrollTop+=d;if(e!==f.scrollTop)return a.preventDefault&&a.preventDefault(),!1}};return{KeyAssistPanel:d}});
define("orion/widgets/themes/ThemePreferences",[],function(){function j(j,i){this._preferences=j;this._themeData=i;var d=i.getThemeStorageInfo();this._themeVersion=d.version;var a=j.listenForChangedSettings(d.storage,2,function(d){d.key===a&&this.apply()}.bind(this))}j.prototype={_initialize:function(j,i,d){var a,g;this._themeVersion===void 0||d.get("version")===this._themeVersion?(a=d.get(j.styleset),(g=d.get("selected"))&&(g=JSON.parse(g))):g=a=null;a||(a=i.getStyles(),d.put(j.styleset,JSON.stringify(a)));
if(!g||g[j.selectedKey]===void 0)g=g||{},g[j.selectedKey]=j.defaultTheme,d.put("selected",JSON.stringify(g));d.put("version",this._themeVersion)},apply:function(){this.setTheme()},getTheme:function(j){var i=this._themeData,d=i.getThemeStorageInfo();this._preferences.getPreferences(d.storage,2).then(function(a){this._initialize(d,i,a);var g=JSON.parse(a.get("selected")),a=JSON.parse(a.get(d.styleset)),f;if(a)for(var e=0;e<a.length;e++)if(a[e].name===g[d.selectedKey]){f=a[e];break}j({style:f,styles:a})}.bind(this))},
setTheme:function(j,i){var d=this._themeData,a=d.getThemeStorageInfo();this._preferences.getPreferences(a.storage,2).then(function(g){this._initialize(a,d,g);var f=JSON.parse(g.get("selected"));j||(j=f[a.selectedKey]);f[a.selectedKey]=j;g.put("selected",JSON.stringify(f));i?g.put(a.styleset,JSON.stringify(i)):i=JSON.parse(g.get(a.styleset));for(var e=0;e<i.length;e++)if(i[e].name===f[a.selectedKey]){d.processSettings(i[e]);break}g.put("version",this._themeVersion)}.bind(this))},setFontSize:function(j){var i=
this._themeData,d=i.getThemeStorageInfo();this._preferences.getPreferences(d.storage,2).then(function(a){this._initialize(d,i,a);var g=JSON.parse(a.get("selected")),f=JSON.parse(a.get(d.styleset)),e;if(f)for(var h=0;h<f.length;h++)f[h].fontSize=j,f[h].name===g[d.selectedKey]&&(e=f[h]);a.put(d.styleset,JSON.stringify(f));i.processSettings(e)}.bind(this))}};return{ThemePreferences:j}});
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(j,k){var i={root:k};Object.keys(j).forEach(function(d){typeof i[d]==="undefined"&&(i[d]=j[d])});return i});
define("orion/editor/eventTarget",[],function(){function j(){}j.addMixin=function(k){var i=j.prototype,d;for(d in i)i.hasOwnProperty(d)&&(k[d]=i[d])};j.prototype={addEventListener:function(j,i,d){if(!this._eventTypes)this._eventTypes={};var a=this._eventTypes[j];a||(a=this._eventTypes[j]={level:0,listeners:[]});a.listeners.push({listener:i,useCapture:d})},dispatchEvent:function(j){var i=j.type;this._dispatchEvent("pre"+i,j);this._dispatchEvent(i,j);this._dispatchEvent("post"+i,j)},_dispatchEvent:function(j,
i){var d=this._eventTypes?this._eventTypes[j]:null;if(d){var a=d.listeners;try{if(d.level++,a)for(var g=0,f=a.length;g<f;g++)if(a[g]){var e=a[g].listener;typeof e==="function"?e.call(this,i):e.handleEvent&&typeof e.handleEvent==="function"&&e.handleEvent(i)}}finally{if(d.level--,d.compact&&d.level===0){for(g=a.length-1;g>=0;g--)a[g]||a.splice(g,1);a.length===0&&delete this._eventTypes[j];d.compact=!1}}}},isListening:function(j){return!this._eventTypes?!1:this._eventTypes[j]!==void 0},removeEventListener:function(j,
i,d){if(this._eventTypes){var a=this._eventTypes[j];if(a){for(var g=a.listeners,f=0,e=g.length;f<e;f++){var h=g[f];if(h&&h.listener===i&&h.useCapture===d){a.level!==0?(g[f]=null,a.compact=!0):g.splice(f,1);break}}g.length===0&&delete this._eventTypes[j]}}}};return{EventTarget:j}});
define("orion/editor/textTheme",["require","orion/editor/eventTarget","orion/util"],function(j,k,i){function d(a){a=a||{};this._document=a.document||document}var a={};d.getTheme=function(g){var g=g||"default",f=a[g];f||(f=a[g]=new d);return f};d.prototype={getThemeClass:function(){return this._themeClass},setThemeClass:function(a,f){var e=this,h=e._themeClass;e._themeClass=a;this._load(a,f,function(){e.onThemeChanged({type:"ThemeChanged",oldValue:h,newValue:e.getThemeClass()})})},onThemeChanged:function(a){return this.dispatchEvent(a)},
buildStyleSheet:function(a,f){function e(c,b,e){b&&(h.push("."+a+" ."+c+" {"),h.push("\t"+(e?"background-color":"color")+": "+b+";"),h.push("}"))}var h=[];h.push("");h.push("."+a+" {");f.fontFamily&&h.push("\tfont-family: "+f.fontFamily+";");f.fontSize&&h.push("\tfont-size: "+f.fontSize+";");f.fontSize&&h.push("\tcolor: "+f.text+";");h.push("}");h.push("."+a+".textview {");f.background&&h.push("\tbackground-color: "+f.background+";");h.push("}");e("ruler.annotations",f.annotationRuler,!0);e("ruler.lines",
f.annotationRuler,!0);e("ruler.folding",f.annotationRuler,!0);e("ruler.overview",f.overviewRuler,!0);e("rulerLines",f.lineNumber,!1);e("rulerLines.even",f.lineNumberEven,!1);e("rulerLines.odd",f.lineNumberOdd,!1);e("annotationLine.currentLine",f.currentLine,!0);e("entity-name-tag",f.keyword,!1);e("entity-other-attribute-name",f.attribute,!1);e("string-quoted",f.string,!1);e("meta.annotation.currentLine",f.currentLine,!0);e("keyword",f.keyword,!1);e("string",f.string,!1);e("comment",f.comment,!1);
e("comment.block.documentation",f.comment,!1);e("keyword.other.documentation.markup",f.comment,!1);return h.join("\n")},_createStyle:function(a,f,e,h){var c=this._document,a="orion-theme-"+a,b=c.getElementById(a);if(b){if(h||b.firstChild.data===f)return;b.removeChild(b.firstChild);b.appendChild(c.createTextNode(f))}else h?(b=i.createElement(c,"link"),b.rel="stylesheet",b.type="text/css",b.href=f,b.addEventListener("load",function(){e()})):(b=i.createElement(c,"style"),b.appendChild(c.createTextNode(f))),
b.id=a,(c.getElementsByTagName("head")[0]||c.documentElement).appendChild(b);h||e()},_load:function(a,f,e){if(a)if(typeof f==="string")this._createStyle(a,f,e);else if(f=f.href,f.substring(f.length-4)!==".css"&&(f+=".css"),/^\//.test(f)||/[a-zA-Z0-9]+:\/\//i.test(f)||!j.toUrl)this._createStyle(a,f,e,!0);else{var h=this;j(["text!"+f],function(c){h._createStyle(a,c,e,!1)})}else e()}};k.EventTarget.addMixin(d.prototype);return{TextTheme:d}});
define("orion/widgets/themes/ThemeClass",[],function(){function j(j){this.attributes=[];this.element=document.createElement("div");this.style=this.element.style;this.className=j;this.classString="."+j+"{ "}j.prototype.className=null;j.prototype.classString=void 0;j.prototype.style=void 0;j.prototype.closeString=" }\n";j.prototype.toString=function(){return this.classString=this.classString+this.style.cssText+this.closeString};return{ThemeClass:j}});
define("orion/widgets/themes/container/ThemeSheetWriter",["orion/widgets/themes/ThemeClass"],function(j){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 i="",d=[],a=new j.ThemeClass("orionPage");
a.style.backgroundColor="#fdfdfd";a.style.width="100%";a.style.height="100%";d.push(a);a=new j.ThemeClass("topRowBanner");a.style.margin="0";a.style.border="0";a.style.backgroundColor=this.navbar;a.style.height="16px";a.style.padding="10px";a.style.paddingLeft="6px";a.style.paddingRight="2px";a.style.borderBottom="none";a.style.boxShadow="0 2px 2px 0 rgba(0, 0, 0, 0.1),0 1px 0 0 rgba(0, 0, 0, 0.1)";a.style.zIndex="100";d.push(a);a=new j.ThemeClass("a");a.style.textDecoration="none";a.style.color=
this.content;d.push(a);a=new j.ThemeClass("navlink");a.style.display="inline-block";a.style.padding="2px";a.style.color=this.content;a.style.verticalAlign="bottom";d.push(a);a=new j.ThemeClass("primaryNav");a.style.color=this.navtext;a.style.fontSize="8pt";a.style.fontWeight="normal";a.style.paddingTop="0";a.style.verticalAlign="baseline";d.push(a);a=new j.ThemeClass("primaryNav a");a.style.fontSize="8pt";a.style.color=this.navtext;a.style.marginRight="6px";a.style.marginLeft="6px";a.style.verticalAlign=
"baseline";a.style.textDecoration="none";d.push(a);a=new j.ThemeClass("primaryNav a:hover");a.style.color="#bfbfbf";a.style.cursor="hand";a.style.color="white";a.style.fontWeight="normal";d.push(a);for(var g in d)i+=d[g].toString();return i};k.prototype.writeLocationStyle=function(){var i="",d=[],a=new j.ThemeClass("titleArea");a.style.margin="0";a.style.paddingTop="5px";a.style.border="0";a.style.background=this.location;a.style.background="-webkit-gradient(linear, left top, left bottom, color-stop(0%,"+
this.location+"), color-stop(100%,"+this.location+"))";a.style.borderBottom="1px solid "+this.location;a.style.minHeight="20px";d.push(a);a=new j.ThemeClass("breadcrumb");a.style.fontSize="8pt";a.style.textDecoration="none";a.style.color="#f1f1f2;";a.style.paddingTop="2px";d.push(a);a=new j.ThemeClass("a.breadcrumb:hover");a.style.textDecoration="none";a.style.borderBottom="1px dotted";a.style.color="#F58B0F";a.style.cursor="pointer";d.push(a);a=new j.ThemeClass("breadcrumbSeparator");a.style.fontSize=
"8pt";a.style.textDecoration="none";a.style.color=this.separator;a.style.fontWeight="bold";d.push(a);a=new j.ThemeClass("currentLocation");a.style.fontWeight="bold";a.style.fontSize="8pt";a.style.color=this.breadcrumb;a.style.textDecoration="none";a.style.textWrap="normal";a.style.lineHeight="10pt";d.push(a);a=new j.ThemeClass("a.currentLocation:hover");a.style.fontWeight="bold";a.style.fontSize="10pt";a.style.color="#666666";a.style.textDecoration="none";a.style.borderBottom="0";d.push(a);a=new j.ThemeClass("navlinkonpage");
a.style.color=this.content;a.style.verticalAlign="middle";d.push(a);if(this.bannerProgress)a=new j.ThemeClass("topRowBanner .progressPane_running"),a.style.borderColor=this.bannerProgress,d.push(a);for(var g in d)i+=d[g].toString();return i};k.prototype.writeButtonStyle=function(){var i="",d=[],a=new j.ThemeClass("commandButton");a.style.color="#666";a.style.border="1px solid #dedede";a.style.backgroundColor="#ddd";a.style.textAlign="center";a.style.verticalAlign="middle";a.style.cursor="pointer";
a.style.display="inline-block";a.style.padding="4px 6px";a.style.borderRadius="3px";a.style.lineHeight="12px";a.style.fontSize="9pt";a.style.userSelect="none";d.push(a);a=new j.ThemeClass("commandButton:over");a.style.backgroundColor="#e6e6e6";a.style.border="1px solid #808080";d.push(a);a=new j.ThemeClass("commandMenu");a.style.color="#222";a.style.display="inline-block";a.style.verticalAlign="baseline";a.style.margin="0";a.style.fontSize="8pt";a.style.fontWeight="normal";a.style.border="1px solid #dedede";
a.style.backgroundColor="#efefef";a.style.cursor="pointer";a.style.borderRadius="1px";d.push(a);a=new j.ThemeClass("commandMenuItem");a.style.border="0";a.style.padding="0";a.style.margin="0";d.push(a);for(var g in d)i+=d[g].toString();return i};k.prototype.writeMainStyle=function(){var i="",d=[],a=new j.ThemeClass("searchbox");a.style.backgroundImage="url(../images/core_sprites.png)";a.style.backgroundRepeat="no-repeat";a.style.backgroundPosition="4px -297px";a.style.width="12px";a.style.height=
"12px";a.style.backgroundColor=this.search;a.style.border="1px solid "+this.search;a.style.fontSize="11px";a.style.width="15em";a.style.height="16px";a.style.borderRadius="10px";a.style.color="#999";a.style.padding="0";a.style.paddingLeft="20px";a.style.marginLeft="5px";a.style.marginTop="6px !important";a.style.font="7pt Lucida Sans Unicode,Lucida Grande,Verdana,Arial,Helvetica,Myriad,Tahoma,clean,sans-serif !important";d.push(a);a=new j.ThemeClass("searchbox:focus");a.style.color="white";a.style.outline=
"none";d.push(a);a=new j.ThemeClass("checkedRow");a.style.cssText="background-color:"+this.selection+" !important;";d.push(a);a=new j.ThemeClass("navbar-item-selected");a.style.background=this.selection;a.style.color=this.content;d.push(a);a=new j.ThemeClass("auxpane");a.style.border="0";a.style.background=this.sidepanel;d.push(a);a=new j.ThemeClass("mainpane");a.style.background=this.mainpanel;a.style.border=0;d.push(a);a=new j.ThemeClass("mainToolbar");a.style.background=this.toolpanel;d.push(a);
for(var g in d)i+=d[g].toString();return i};k.prototype.render=function(){console.log(this.writeNavigationStyle());console.log(this.writeLocationStyle());console.log(this.writeMainStyle());console.log(this.writeButtonStyle())};k.prototype.getSheet=function(i){i.navbar.value?(this.navbar=i.navbar.value,this.button=i.button.value,this.location=i.location.value,this.selection=i.selection.value,this.sidepanel=i.sidepanel.value,this.mainpanel=i.mainpanel.value,this.navtext=i.navtext.value,this.search=
i.search.value,this.content=i.content.value,this.toolpanel=i.toolpanel.value,this.bannerProgress=i.bannerProgress.value):(this.navbar=i.navbar,this.button=i.button,this.location=i.location,this.selection=i.selection,this.sidepanel=i.sidepanel,this.mainpanel=i.mainpanel,this.navtext=i.navtext,this.search=i.search,this.content=i.content,this.toolpanel=i.toolpanel,this.bannerProgress=i.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(j,k,i){function d(){}function a(){this.styles=[];var a=new d;a.name="Orion";a.navbar="white";a.button="#EFEFEF";a.location="#efefef";a.selection="FEC";a.sidepanel="#FBFBFB";a.mainpanel="white";a.toolpanel="white";a.navtext="#bfbfbf";a.content="#3087B3";a.search="#444";a.breadcrumb="#3087B3";a.separator="#333";a.bannerProgress="whitesmoke";
this.styles.push(a);a=new d;a.name="Orion2014";a.navbar="white";a.button="#EFEFEF";a.location="#EFEFEF";a.selection="FEC";a.sidepanel="#EEEEEE";a.mainpanel="#EEEEEE";a.toolpanel="#EEEEEE";a.navtext="#BFBFBF";a.content="#333333";a.search="#444444";a.breadcrumb="#333333";a.separator="#333333";a.bannerProgress="orange";this.styles.push(a);a=new d;a.name="Green Zone";a.navbar="seagreen";a.button="lavender";a.location="darkseagreen";a.selection="moccasin";a.sidepanel="aliceblue";a.mainpanel="white";a.toolpanel=
"white";a.navtext="#FBFBFB";a.content="darkgreen";a.search="darkgreen";a.breadcrumb="#3087B3";a.separator="seagreen";a.bannerProgress="#F2F2F2";this.styles.push(a);a=new d;a.name="Pretty In Pink";a.navbar="plum";a.button="lavender";a.location="pink";a.selection="lavender";a.sidepanel="seashell";a.mainpanel="white";a.toolpanel="white";a.navtext="#FBFBFB";a.content="mediumorchid";a.search="violet";a.breadcrumb="#3087B3";a.separator="plum";a.bannerProgress="#F2F2F2";this.styles.push(a);a=new d;a.name=
"Blue Monday";a.navbar="cornflowerblue";a.button="lavender";a.location="skyblue";a.selection="lavender";a.sidepanel="aliceblue";a.mainpanel="white";a.toolpanel="white";a.navtext="#FBFBFB";a.content="royalblue";a.search="royalblue";a.breadcrumb="#3087B3";a.separator="cornflowerblue";a.bannerProgress="#F2F2F2";this.styles.push(a);a=new d;a.name="Vanilla Skies";a.navbar="sandybrown";a.button="lemmonchiffon";a.location="cornsilk";a.selection="lemonchiffon";a.sidepanel="white";a.mainpanel="white";a.toolpanel=
"white";a.navtext="lemonchiffon";a.content="chocolate";a.search="moccasin";a.breadcrumb="#3087B3";a.separator="sandybrown";a.bannerProgress="#F2F2F2";this.styles.push(a);a=new d;a.name="Beetlejuice";a.navbar="indigo";a.button="slateblue";a.location="darkslateblue";a.selection="silver";a.sidepanel="lavender";a.mainpanel="white";a.toolpanel="white";a.navtext="#FBFBFB";a.content="mediumslateblue";a.search="#444";a.breadcrumb="#3087B3";a.separator="indigo";a.bannerProgress="#F2F2F2";this.styles.push(a);
a=new d;a.name="Red";a.navbar="#CD2127";a.button="#777777";a.location="#D85F56";a.selection="lightcoral";a.sidepanel="#EFDAB2";a.mainpanel="#FDFADD";a.toolpanel="#FDFADD";a.navtext="#FBFBFB";a.content="darkred";a.search="#D85F56";a.breadcrumb="darkred";a.separator="#CD2127";a.bannerProgress="#F2F2F2";this.styles.push(a)}function g(){return this.styles}d.prototype.name="Orion";d.prototype.navbar="#404648";d.prototype.button="#EFEFEF";d.prototype.location="#333";d.prototype.breadcrumb="#3087B3";d.prototype.separator=
"#333";d.prototype.selection="FEC";d.prototype.sidepanel="#FBFBFB";d.prototype.mainpanel="white";d.prototype.toolpanel="white";d.prototype.navtext="#bfbfbf";d.prototype.content="#3087B3";d.prototype.search="#444";d.prototype.bannerProgress="white";a.prototype.styles=[];a.prototype.getStyles=g;a.prototype.getThemeStorageInfo=function(){return{storage:"/themes",styleset:"styles",defaultTheme:"Orion2014",selectedKey:"selected",version:"5.0"}};a.prototype.getViewData=function(){var a={top:10,left:10,
width:350,height:350};a.shapes=[{type:"RECTANGLE",name:j["Navigation Bar"],x:10,y:10,width:350,height:32,family:"navbar",fill:"#333",order:1},{type:"TEXT",name:j["Navigation Text"],label:"UserName",x:290,y:30,family:"navtext",fill:"#bfbfbf",font:"8pt sans-serif"},{type:"ROUNDRECTANGLE",name:j["Search Box"],x:215,y:20,width:70,height:12,family:"search",fill:"#444",order:3},{type:"RECTANGLE",name:j["Tool Panel"],x:150,y:71,width:209,height:30,family:"toolpanel",fill:"white",order:4},{type:"RECTANGLE",
name:j["Selection Bar"],x:155,y:133,width:200,height:20,family:"selection",fill:"#FEC",order:7},{type:"RECTANGLE",name:j.Location,x:10,y:42,width:350,height:29,family:"location",fill:"#efefef",order:8},{type:"TEXT",name:j["Navigation Text"],label:"Navigator",x:60,y:30,family:"navtext",fill:"#bfbfbf",font:"8pt sans-serif",order:2},{type:"TEXT",name:j.Content,label:"Breadcrumb",x:15,y:60,family:"content",fill:"#3087B3",font:"8pt sans-serif"},{type:"TEXT",name:j.Content,label:"/",x:78,y:60,family:"content",
fill:"#3087B3",font:"8pt sans-serif",order:9},{type:"TEXT",name:j.Content,label:"Location",x:84,y:60,family:"content",fill:"#3087B3",font:"8pt sans-serif"},{type:"RECTANGLE",name:j["Main Panel"],x:150,y:101,width:209,height:258,family:"mainpanel",fill:"white",order:6},{type:"ROUNDRECTANGLE",name:j.Button,x:155,y:76,width:37,height:20,family:"button",fill:"#EFEFEF",order:11},{type:"TEXT",name:j["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:j["Section Text"],label:"Section",x:30,y:94,family:"navbar",fill:"#333",font:"8pt sans-serif"},{type:"LINE",name:j["Line Color"],x1:150,y1:101,x2:360,y2:101,linewidth:2,fill:"#DEDEDE"},{type:"LINE",name:j["Line Color"],x1:150,y1:71,x2:150,y2:360,linewidth:2,fill:"#DEDEDE"},{type:"LINE",name:j["Line Color"],
x1:20,y1:100,x2:140,y2:100,linewidth:2,fill:"#DEDEDE"},{type:"RECTANGLE",name:j["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:j["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 e=0;e<3;e++)a.shapes.push({type:"TEXT",name:j.Content,label:"org.eclipse.orion.content",x:170,y:127+20*e,fill:"#3087B3",family:"content"});for(e=0;e<3;e++)a.shapes.push({type:"TEXT",name:j.Content,label:"Item",x:25,y:115+20*e,fill:"#3087B3",family:"content"});for(e=0;e<3;e++)a.shapes.push({type:"TRIANGLE",
name:"twisty",x1:160,y1:121+e*20,x2:165,y2:124+e*20,x3:160,y3:127+e*20,family:"navbar",fill:"#333"});a.shapes.push({type:"IMAGE",name:"logo",x:15,y:18,source:"../../images/orion-transparent.png",family:"logo"});return a};a.prototype.processSettings=function(a){var e=new i.ThemeSheetWriter;(new k.TextTheme.getTheme("orionTheme")).setThemeClass("orionTheme",e.getSheet(a))};return{ThemeData:a,getStyles:g}});
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(j,k){var i={root:k};Object.keys(j).forEach(function(d){typeof i[d]==="undefined"&&(i[d]=j[d])});return i});
define("orion/widgets/userAssistance/UATaskPanel",["orion/webui/littlelib"],function(j){function k(i,d,a){this.elements=a;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);d===!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),j.addAutoDismiss([this.container],this.destroy.bind(this))):i.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(i){var d=document.createElement("span");d.className="UAContainer-icon";d.innerHTML='<span class="workingSpan"><img src="'+i.image+'" id="'+i.label+'ImageNode" alt="'+i.alt+'" height="64" width="64"></span><span class="UAIcon-label"><span class="UALabel" id="'+i.label+'LabelNode" >'+i.label+"</span></span>";d.onmouseover=function(){document.getElementById(i.label+"ImageNode").src=i.secondaryImage;document.getElementById(i.label+"LabelNode").className="UALabel-live";d.className="UAContainer-icon-live"};
d.onmouseout=function(){document.getElementById(i.label+"ImageNode").src=i.image;document.getElementById(i.label+"LabelNode").className="UALabel";d.className="UAContainer-icon"};var a=this;d.onclick=function(){a.showMedia(i)};this.elementNode.appendChild(d)};k.prototype.clearElements=function(){this.elementNode.innerHTML=""};k.prototype.showMedia=function(i){this.clearElements();this.addElement(i);var d=document.createElement("span");d.className="UAContainer-media";d.innerHTML='<div></div><div></div><span class="mediaSpan"><img src="'+
i.media+'" alt="'+i.alt+'" height="300" width="400"></span>';this.elementNode.appendChild(d);setTimeout(function(){d.style.opacity=1},100);i=document.getElementById(i.label+"switch");this.chosenSwitch.firstChild.className="circle";this.chosenSwitch=i.parentNode;i.className="chosenCircle"};k.prototype.createSwitch=function(i){var d;d=i?i.label+"switch":"indexSwitch";var a=document.createElement("span");a.className="workingSpan";a.innerHTML='<div class="circle" id ="'+d+'"></div>';var g=this;a.onclick=
i?function(){g.showMedia(i)}:function(){g.initialize();g.chosenSwitch.firstChild.className="circle";g.chosenSwitch=a;g.chosenSwitch.firstChild.className="chosenCircle"};this.switches.appendChild(a);return this.radioButtons[this.radioButtons.length]=a};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(j,k,i,d){function a(){}var g=null;a.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 a=document.body;this.$frameParent=a;this.$$modalExclusions=this.$$modalExclusions||[];var e=document.createRange();e.selectNode(a);e=e.createContextualFragment(this.CONTAINERTEMPLATE);a.appendChild(e);this.$frame=a.lastChild;this.title&&i.$("#title",this.$frame).appendChild(document.createTextNode(this.title));this.$close=i.$("#closeDialog",this.$frame);var h=this;this.$close.addEventListener("click",function(){h.hide()},!1);this.$parent=i.$(".dialogContent",this.$frame);
e=document.createRange();e.selectNode(this.$parent);a=e.createContextualFragment(this.TEMPLATE);this.messages&&i.processTextNodes(a,this.messages);this.$parent.appendChild(a);this.$buttonContainer=i.$(".dialogButtons",this.$frame);this._makeButtons();this.$frame.addEventListener("keydown",function(a){a.keyCode===i.KEY.ESCAPE?h.hide():a.keyCode===i.KEY.ENTER&&typeof h._defaultCallback==="function"&&h._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 a=this;this.buttons.forEach(function(e){var h=d.createButton(e.text,e.callback);if(e.id)h.id=e.id,a["$"+h.id]=h;if(e.isDefault)a._defaultCallback=e.callback,a._defaultButton=h;a.$buttonContainer.appendChild(h)})}},_makeModal:function(){var a=this;this.$frame.addEventListener("blur",function(b){a.$lastFocusedElement=b.target},!0);this._modalListener=function(b){var c=!i.contains(a.$frame,
b.target);if(c)for(var e=0;e<a.$$modalExclusions.length;e++)if(i.contains(a.$$modalExclusions[e],b.target)){c=!1;break}c&&(window.setTimeout(function(){(a.$lastFocusedElement||a.$parent).focus()},0),i.stop(b))};this.$frameParent.addEventListener("focus",this._modalListener,!0);this.$frameParent.addEventListener("click",this._modalListener,!0);var e=this.$frameParent.childNodes,h=!1;this._addedBackdrop=[];for(var c=0;c<e.length;c++){for(var b=0;b<this.$$modalExclusions.length;b++)if(i.contains(this.$$modalExclusions[b],
e[c])){h=!0;break}!h&&e[c]!==a.$frame&&e[c].classList&&!e[c].classList.contains("tooltipContainer")&&(b=e[c],b.classList.contains("modalBackdrop")||(b.classList.add("modalBackdrop"),this._addedBackdrop.push(b)))}(e=i.lastTabbable(this.$buttonContainer)||i.lastTabbable(this.$parent))&&e.addEventListener("keydown",function(b){if(b.keyCode===i.KEY.TAB){var c=a._getFirstFocusField();c&&c!==b.target&&c.focus();i.stop(b)}},!1)},_addChildDialog:function(a){this.$$modalExclusions.push(a.$frame||a.$parent)},
_inModalExclusion:function(a){return this.$$modalExclusions.some(function(e){return a.$frame===e||a.$parent===e})},_bindElements:function(a){for(var e=0;e<a.childNodes.length;e++){var h=a.childNodes[e];h.id&&(this["$"+h.id]=h);this._bindElements(h)}},hide:function(a){!a&&g===this&&(g=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");i.setFramesEnabled(!0);typeof this._afterHiding==="function"&&this._afterHiding();var e=this;this.keepAlive||window.setTimeout(function(){e.destroy()},0)},show:function(a){if(this.modal)if(g){if(!g._inModalExclusion(this)){this.hide(!0);return}}else g=this;typeof this._beforeShowing==="function"&&this._beforeShowing();i.setFramesEnabled(!1);var e=i.bounds(this.$frame),h=i.bounds(document.documentElement),c;a?(c=i.bounds(a),a=c.top+c.height+4,c=c.left+
4,a+e.height>h.height&&(a=Math.max(0,h.height-e.height-4)),c+e.width>h.width&&(c=Math.max(0,h.width-e.width-4))):(c=Math.max(0,(h.width-e.width)/2),a=Math.max(0,(h.height-e.height)/2));this.$lastFocusedElement=document.activeElement;this.$frame.style.top=a+"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 i.firstTabbable(this.$parent)||
this._defaultButton||i.firstTabbable(this.$buttonContainer)||this.$close},destroy:function(){if(this.$frame)g===this&&(g=null),i.setFramesEnabled(!0),this._addedBackdrop&&this._addedBackdrop.length>0&&this._addedBackdrop.forEach(function(a){a.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}};a.prototype.constructor=
a;return{Dialog:a}});
define("orion/widgets/UserMenu","i18n!orion/widgets/nls/messages,require,orion/webui/littlelib,orion/PageLinks,orion/widgets/userAssistance/UATaskPanel,orion/webui/dialog".split(","),function(j,k,i,d,a){function g(a){this._displaySignOut=!0;this._init(a)}g.prototype={_init:function(a){this._dropdownNode=i.node(a.dropdownNode);if(!this._dropdownNode)throw"no dom node for dropdown found";this._dropdown=a.dropdown;this._serviceRegistry=a.serviceRegistry;this.authenticatedServices={};this.unauthenticatedServices=
{};this._noSeparator=a.noSeparator;this._dropDownItemClass=a.dropDownItemClass;this._keyAssistClass=a.keyAssistClass;if(a.signOut!==void 0)this._displaySignOut=a.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(a){var e=0,h;for(h in a)a.hasOwnProperty(h)&&e++;return e},_makeMenuItem:function(a,
e){var h=document.createElement("span");h.role="menuitem";h.tabIndex=0;var c=document.createTextNode(a);h.appendChild(c);typeof this._dropDownItemClass==="string"?this._dropDownItemClass!==""&&h.classList.add(this._dropDownItemClass):h.classList.add("dropdownMenuItem");h.addEventListener("click",e,!1);h.addEventListener("keydown",function(b){(b.keyCode===i.KEY.ENTER||b.keyCode===i.KEY.SPACE)&&e()},!1);return h},_renderAuthenticatedService:function(a){var e=this,h=this.authenticatedServices[a].authService;
if(h&&h.logout&&this._displaySignOut){var c=document.createElement("li"),b=this._makeMenuItem(j["Sign Out"],function(){h.logout().then(function(){e.addUserItem(a,h,e.authenticatedServices[a].label);localStorage.removeItem(a);localStorage.removeItem("lastLogin");for(var b=localStorage.length-1;b>=0;b--){var c=localStorage.key(b);c&&c.indexOf("/orion/preferences/user")===0&&localStorage.removeItem(c)}h.getAuthForm(window.location.href).then(function(b){window.location=b})})});c.appendChild(b);this._dropdownNode.appendChild(c)}},
renderServices:function(){function a(b){h[b]||(h[b]=e.createDocumentFragment());return h[b]}var e=document,h=[],c=this._serviceRegistry;d.getPageLinksInfo(c,"orion.page.link.user").then(function(b){this._dropdown?this._dropdown.empty():this._dropdownNode&&i.empty(this._dropdownNode);b.getAllLinks().forEach(function(b){var c,h;if(b.category&&(h=/user\.(\d+)/.exec(b.category)))c=parseInt(h[1],10);if(typeof c!=="number"||isNaN(c))c=1;c=a(c);h=e.createElement("li");var d=e.createElement("a");d.role="menuitem";
typeof this._dropDownItemClass==="string"?this._dropDownItemClass!==""&&d.classList.add(this._dropDownItemClass):d.classList.add("dropdownMenuItem");d.href=b.href;d.textContent=b.textContent;h.appendChild(d);c.appendChild(h);d.addEventListener("keydown",function(b){(b.keyCode===i.KEY.ENTER||b.keyCode===i.KEY.SPACE)&&d.click()},!1)}.bind(this));if(this.keyAssistFunction){var b=document.createElement("li"),d=this._makeMenuItem(j["Keyboard Shortcuts"],this.keyAssistFunction);typeof this._keyAssistClass===
"string"?this._keyAssistClass!==""&&d.classList.add(this._keyAssistClass):d.classList.add("key-assist-menuitem");b.appendChild(d);a(0).appendChild(b)}if(b=c.getServiceReferences("orion.page.getstarted")[0])d=b.getProperty("data"),b=document.createElement("li"),d=this._makeMenuItem("Getting Started",this.getStartedDialog.bind(this,d)),b.appendChild(d),a(0).appendChild(b);var g=this;h.sort(function(b,a){return b-a}).forEach(function(b,a){if(a<h.length-1&&!this._noSeparator){var c=document.createElement("li");
c.classList.add("dropdownSeparator");var e=document.createElement("span");e.classList.add("dropdownSeparator");c.appendChild(e);b.appendChild(c)}g._dropdownNode.appendChild(b)}.bind(this));if(this.isSingleService())for(var o in this.authenticatedServices)this.authenticatedServices.hasOwnProperty(o)&&this._renderAuthenticatedService(o,0)}.bind(this))},getStartedDialog:function(f){new a(null,!0,f)},setKeyAssist:function(a){this.keyAssistFunction=a;this.renderServices()},addUserItem:function(a,e,h,c){c?
(this.unauthenticatedServices[a]&&delete this.unauthenticatedServices[a],this.authenticatedServices[a]={authService:e,label:h,data:c}):(this.authenticatedServices[a]&&delete this.authenticatedServices[a],this.unauthenticatedServices[a]=this.unauthenticatedServices[a]?{authService:e,label:h,pending:this.unauthenticatedServices[a].pending}:{authService:e,label:h});this.renderServices()}};g.prototype.constructor=g;return{UserMenu:g}});
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(j,k){var i={root:k};Object.keys(j).forEach(function(d){typeof i[d]==="undefined"&&(i[d]=j[d])});return i});
define("orion/searchUtils","i18n!orion/nls/messages,require,orion/regex,orion/commandRegistry,orion/PageUtil,orion/URITemplate".split(","),function(j,k,i,d,a,g){function f(a,c,b){var e="";b&&(e="^");if(e=i.parse("/"+e+a.searchStr+"/"))b=e.pattern,e=e.flags,e.indexOf("i")===-1&&!c.caseSensitive&&(e+="i"),a.regExp={pattern:b,flags:e},a.wildCard=!0}var e={ALL_FILE_TYPE:"*.*"};e.doSearch=function(a,c,b,f){if(a){var d=!0;b==="*"&&(b="");b===""&&(d=f&&f.type!==e.ALL_FILE_TYPE);if(d)b!==""&&e.addRecentSearch(c,
b,f?f.regEx:!1),a=a.createSearchParams(b,!1,!1,f),a=e.generateSearchHref(a),window.location=a}else window.alert(j["Can't search: no search service is available"])};e.generateSearchHelper=function(a,c){var b=a.keyword,d=b,g={};a.fileType&&a.fileType!==e.ALL_FILE_TYPE&&b===""&&(d="*."+a.fileType);if(a.regEx)g.searchStr=b,f(g,a,c);else{var o=b.indexOf("*")>-1,i=b.indexOf("?")>-1;o&&(b=b.split("*").join(".*"));i&&(b=b.split("?").join("."));!o&&!i&&!a.nameSearch?(g.searchStr=a.caseSensitive?b.split("\\").join(""):
b.split("\\").join("").toLowerCase(),g.wildCard=!1):(g.searchStr=a.caseSensitive?b:b.toLowerCase(),f(g,a,c),g.wildCard=!0)}g.searchStrLength=g.searchStr.length;return{params:a,inFileQuery:g,displayedSearchTerm:d}};e.convertSearchParams=function(a){if(a.rows!==void 0)a.rows=parseInt(a.rows,10);if(a.start!==void 0)a.start=parseInt(a.start,10);if(typeof a.regEx==="string")a.regEx=a.regEx.toLowerCase()==="true";if(typeof a.caseSensitive==="string")a.caseSensitive=a.caseSensitive.toLowerCase()==="true";
if(typeof a.nameSearch==="string")a.nameSearch=a.nameSearch.toLowerCase()==="true"};e.copySearchParams=function(a,c){var b={},e;for(e in a)if(a[e]!==void 0&&a[e]!==null&&(c||e!=="replace"))b[e]=a[e];return b};e.generateSearchHref=function(a){var c=k.toUrl("search/search.html"),a=e.copySearchParams(a,!0),b=a.resource;a.resource=void 0;return typeof a.keyword!=="undefined"?(new g(c+"#{,resource,params*}")).expand({resource:b,params:a}):(new g(c+"#{,resource}")).expand({resource:b})};e.generateFindURLBinding=
function(a,c,b,e,f){a={find:c.searchStr,regEx:c.wildCard?!0:void 0,caseSensitive:a.caseSensitive?!0:void 0,replaceWith:typeof e==="string"?e:void 0,atLine:typeof b==="number"?b:void 0};return f?a:","+(new g("{,params*}")).expand({params:a})};e.convertFindURLBinding=function(a){if(typeof a.regEx==="string")a.regEx=a.regEx.toLowerCase()==="true";if(typeof a.caseSensitive==="string")a.caseSensitive=a.caseSensitive.toLowerCase()==="true";if(typeof a.atLine==="string")a.atLine=parseInt(a.atLine,10)};e.replaceRegEx=
function(a,c,b){return a.replace(RegExp(c.pattern,c.flags),b)};e.replaceStringLiteral=function(a,c,b){c=i.parse("/"+c+"/gim");return e.replaceRegEx(a,c,b)};e.searchOnelineLiteral=function(a,c,b){var e;e=0;for(var f=!1,d=[];;)if(e=c.indexOf(a.searchStr,e),e<0)break;else{d.push({startIndex:e,length:a.searchStrLength});f=!0;if(b)break;e+=a.searchStrLength}return f?d:null};e.findRegExp=function(a,c,b,e){if(!c)return null;b=b||"";b+=(b.indexOf("g")===-1?"g":"")+(b.indexOf("m")===-1?"m":"");var f=null;
return(f=RegExp(c,b).exec(a.substring(e)))&&{startIndex:f.index+e,length:f[0].length}};e.searchOnelineRegEx=function(a,c,b){for(var f=0,d=!1,g=[];;)if(f=e.findRegExp(c,a.regExp.pattern,a.regExp.flags,f)){g.push(f);d=!0;if(b)break;f=f.startIndex+f.length}else break;return d?g:null};e.generateNewContents=function(a,c,b,f,d,g){if(f&&c){if(!a)b.contents=[];for(var i=0;i<c.length;i++){for(var j=c[i],k=!1,u=!1,p=[],t,v=0,n=0;n<f.children.length;n++)if(f.children[n].lineNumber-1===i){v=n;for(k=0;k<f.children[n].matches.length;k++)f.children[n+
k].checked!==!1&&p.push(k);u=p.length>0;t=f.children[n].matches;k=!0;break}if(k){if(u){p=e.replaceCheckedMatches(j,d,t,p,g);j=p.replacedStr;for(k=0;k<f.children[v].matches.length;k++)f.children[v+k].newMatches=p.newMatches}else for(k=0;k<f.children[v].matches.length;k++)f.children[v+k].newMatches=f.children[v+k].matches;a?b.contents[i]=j:b.contents.push(j)}else a||b.contents.push(j)}}};e.generateMatchContext=function(a,c,b){var e=[],f=a*2+1,d;c.length<=f?(d=0,a=c.length-1):(d=b-a,d<0?(d=0,a=d+f-1):
(a=b+a,a>c.length-1&&(a=c.length-1,d=a-f+1)));for(f=d;f<=a;f++)e.push({context:c[f],current:f===b});return e};e.splitFile=function(a){for(var c=0,b=0,e=0,f=0,d=[];;){c!==-1&&c<=e&&(c=a.indexOf("\r",e));b!==-1&&b<=e&&(b=a.indexOf("\n",e));if(b===-1&&c===-1){d.push(a.substring(f));break}var g=1;c!==-1&&b!==-1?c+1===b?(g=2,e=b+1):e=(c<b?c:b)+1:e=c!==-1?c+1:b+1;d.push(a.substring(f,e-g));f=e}return d};e.searchWithinFile=function(a,c,b,f,d,g){b=e.splitFile(b);if(d)c.contents=b;if(c){c.children=[];for(var i=
f=0;i<b.length;i++){var j=b[i];if(j&&j.length>0){var k=g?j:j.toLowerCase();if(k=a.wildCard?e.searchOnelineRegEx(a,k):e.searchOnelineLiteral(a,k)){var u,p=i+1;if(d)for(var t=0;t<k.length;t++)u=t+1,u={parent:c,checked:c.checked,type:"detail",matches:k,lineNumber:p,matchNumber:u,name:j,location:c.location+"-"+p+"-"+u},c.children.push(u);else u={parent:c,context:e.generateMatchContext(2,b,i),checked:c.checked,type:"detail",matches:k,lineNumber:p,name:j,location:c.location+"-"+p},c.children.push(u);f+=
k.length}}}c.totalMatches=f}};e.replaceCheckedMatches=function(a,c,b,e,f){for(var d=0,g="",i=[],j=0;j<b.length;j++){d!==b[j].startIndex&&(g+=a.substring(d,b[j].startIndex));if(b[j].length)f=b[j].length;for(var d=!1,k=0;k<e.length;k++)if(e[k]===j){d=!0;break}d?(i.push({startIndex:g.length,length:c.length}),g+=c):(i.push({startIndex:g.length,length:f}),g+=a.substring(b[j].startIndex,b[j].startIndex+f));d=b[j].startIndex+f}d<a.length&&(g+=a.substring(d));return{replacedStr:g,newMatches:i}};e.fullPathNameByMeta=
function(a){var c=a.length,b="";if(c>0)for(c-=1;c>-1;c--)b=b+(b===""?"":"/")+a[c].Name;return b};e.path2FolderName=function(a,c,b){return a.substring(0,a.length-c.length-(b?0:1))};e._storeRecentSearch=function(a,c,b,e){a.getService("orion.core.preference").getPreferences("/window/favorites").then(function(a){a.put("recentSearch",c);b&&window.setTimeout(function(){b.dispatchEvent({type:"inputDataListChanged",deleting:e})}.bind(this),20)})};e.addRecentSearch=function(a,c,b){typeof c==="string"&&c&&
a.getService("orion.core.preference").getPreferences("/window/favorites").then(function(f){var d,f=f.get("recentSearch");typeof f==="string"&&(f=JSON.parse(f));if(f){for(d in f)if(f[d].name===c)return;f.length>=20&&f.splice(19,f.length-20+1)}else f=[];f.splice(0,0,{name:c,regEx:b});e._storeRecentSearch(a,f)})};e.removeRecentSearch=function(a,c,b){typeof c==="string"&&c&&a.getService("orion.core.preference").getPreferences("/window/favorites").then(function(f){var d,f=f.get("recentSearch");typeof f===
"string"&&(f=JSON.parse(f));if(f)for(d in f)if(f[d].name===c){f.splice(d,1);e._storeRecentSearch(a,f,b,!0);break}})};e.getSearches=function(a,c,b){a.getService("orion.core.preference").getPreferences("/window/favorites").then(function(a){a=a.get(c);typeof a==="string"&&(a=JSON.parse(a));a&&b&&b(a)})};e.getMixedSearches=function(a,c,b,f){a.getService("orion.core.preference").getPreferences("/window/favorites").then(function(a){var h=a.get("recentSearch");typeof h==="string"&&(h=JSON.parse(h));c&&(a=
a.get("search"),typeof a==="string"&&(a=JSON.parse(a)),a&&a.forEach(function(a){if(b){var c=e.parseQueryStr(a.query);h.some(function(b){return c.searchStrTitle===b.name})||h.push({name:c.searchStrTitle,label:a.name})}else h.push({name:null,label:a.name,value:a.query})}));h&&f&&f(h)})};e.getOpenSearchPref=function(a,c){a.getService("orion.core.preference").getPreferences("/cm/configurations").then(function(b){b=b.get("nav.config");c(b&&b["links.newtab"]!=="undefined"?b["links.newtab"]?!0:!1:!1)})};
e.setOpenSearchPref=function(a,c){a.getService("orion.core.preference").getPreferences("/window/favorites").then(function(b){b.put("openSearchPref",{openInNewTab:c})})};return e});
define("orion/crawler/searchCrawler","i18n!orion/crawler/nls/messages,require,orion/i18nUtil,orion/searchUtils,orion/contentTypes,orion/Deferred".split(","),function(j,k,i,d,a,g){function f(a,f,c,b){this.registry=a;this.fileClient=f;this.fileLocations=[];this.fileSkeleton=[];this._totalCounter=this._hitCounter=0;this._searchOnName=b&&b.searchOnName;this._buildSkeletonOnly=b&&b.buildSkeletonOnly;this._fetchChildrenCallBack=b&&b.fetchChildrenCallBack;this._searchParams=c;this.searchHelper=this._searchOnName||
this._buildSkeletonOnly?null:d.generateSearchHelper(c);this._location=b&&b.location;this._childrenLocation=b&&b.childrenLocation?b.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))}f.prototype.search=function(a){var f=this.registry.getService("orion.core.contentTypeRegistry");
this._onSearchComplete=a;this._cancelled=!1;this._deferredArray=[];f.getContentTypes().then(function(a){this.contentTypesCache=a;var b=this;this._visitRecursively(this._childrenLocation).then(function(){b._cancelled||b._reportResult()}.bind(b),function(a){b._reportResult();b._statusService&&a.name==="Cancel"&&(console.log("Crawling search cancelled. Deferred array length : "+b._deferredArray.length),b._statusService.setProgressResult({Message:j["Search cancelled by user"],Severity:"Warning"}))}.bind(b))}.bind(this))};
f.prototype.searchName=function(a,f){if(a)this._searchParams=a,this.searchHelper=d.generateSearchHelper(a,!0);if(f)this.onSearchNameComplete=f;var c=[];this._cancelled=!1;this._deferredArray=[];this._sort(this.fileSkeleton);if(this.fileSkeleton.length>0){for(var b=0;b<this.fileSkeleton.length;b++){var l=this.fileSkeleton[b].Name.toLowerCase();if(this.searchHelper.inFileQuery.wildCard?d.searchOnelineRegEx(this.searchHelper.inFileQuery,l,!0):d.searchOnelineLiteral(this.searchHelper.inFileQuery,l,!0))if(c.push(this.fileSkeleton[b]),
c.length>=this.searchHelper.params.rows)break}this.onSearchNameComplete({response:{numFound:c.length,docs:c}})}else this.onSearchNameComplete({response:{numFound:0,docs:[]}})};f.prototype.buildSkeleton=function(a,f){this._buildingSkeleton=!0;var c=this.registry.getService("orion.core.contentTypeRegistry");this._cancelled=!1;this._deferredArray=[];var b=this;a();c.getContentTypes().then(function(a){b.contentTypesCache=a;b._visitRecursively(b._childrenLocation).then(function(){b._buildingSkeleton=!1;
f();b.searchHelper&&!b._buildSkeletonOnly&&b.searchName()})})};f.prototype._sort=function(a){a.sort(function(a,c){var b,e;if(this._searchParams.sort==="Path asc"){b=a.Location&&a.Location.toLowerCase();b=d.path2FolderName(b,a.Name&&a.Name.toLowerCase(),!0);e=c.Location&&c.Location.toLowerCase();e=d.path2FolderName(e,c.Name&&c.Name.toLowerCase(),!0);if(b<e)return-1;if(b>e)return 1}return this._sortOnNameSingle(a,c)}.bind(this))};f.prototype._reportResult=function(){this._sort(this.fileLocations);this._onSearchComplete({response:{numFound:this.fileLocations.length,
docs:this.fileLocations}})};f.prototype._sortOnNameSingle=function(a,f){var c=a.Name&&a.Name.toLowerCase(),b=f.Name&&f.Name.toLowerCase();return c<b?-1:c>b?1:0};f.prototype._onFileType=function(a){return this.searchHelper.params.fileType?this.searchHelper.params.fileType===d.ALL_FILE_TYPE?!0:a.extension.indexOf(this.searchHelper.params.fileType)>=0:!0};f.prototype._visitRecursively=function(e){var f=[],c=this;this._fetchChildrenCallBack&&this._fetchChildrenCallBack(e);return(c._progressService?this._progressService.progress(c.fileClient.fetchChildren(e),
"Crawling search for children of "+e):c.fileClient.fetchChildren(e)).then(function(b){for(var e=0;e<b.length;e++)if(b[e].Directory!==void 0&&b[e].Directory===!1)if(c._searchOnName)f.push(c._buildSingleSkeleton(b[e]));else if(c._buildSkeletonOnly)f.push(c._buildSingleSkeleton(b[e]));else{if(!c._cancelled){var d=a.getFilenameContentType(b[e].Name,c.contentTypesCache);if(d&&(d["extends"]==="text/plain"||d.id==="text/plain")&&c._onFileType(d))d=c._sniffSearch(b[e]),f.push(d),c._deferredArray.push(d)}}else if(b[e].Location)if(c._cancelled)break;
else d=c._visitRecursively(b[e].ChildrenLocation),f.push(d),c._deferredArray.push(d);return g.all(f)})};f.prototype._hitOnceWithinFile=function(a){a=this._searchParams.caseSensitive?a:a.toLowerCase();return this.searchHelper.inFileQuery.wildCard?d.searchOnelineRegEx(this.searchHelper.inFileQuery,a,!0):d.searchOnelineLiteral(this.searchHelper.inFileQuery,a,!0)};f.prototype._reportSingleHit=function(a){if(!this._cancelled)a.LastModified=a.LocalTimeStamp,this.fileLocations.push(a),this._hitCounter++,
this._sort(this.fileLocations),this._onSearchComplete({response:{numFound:this.fileLocations.length,docs:this.fileLocations}},!0)};f.prototype._cancelFileContentsSearch=function(){(this._cancelled=!0)&&this._deferredArray.forEach(function(a){a.cancel()})};f.prototype._sniffSearch=function(a){this._totalCounter++;var f=this;if(!this._cancelled)if(this.searchHelper.params.keyword==="")this._reportSingleHit(a),this._statusService&&this._statusService.setProgressResult({Message:i.formatMessage(j["${0} files found out of ${1}"],
this._hitCounter,this._totalCounter)});else return(f._progressService?f._progressService.progress(f.fileClient.read(a.Location),"Reading file "+a.Location):f.fileClient.read(a.Location)).then(function(c){f._hitOnceWithinFile(c)&&f._reportSingleHit(a);f._statusService&&f._statusService.setProgressResult({Message:i.formatMessage(j["${0} files found out of ${1}"],f._hitCounter,f._totalCounter)},j.Cancel)},function(a){a&&a.message&&a.message.toLowerCase()!=="cancel"&&console.error("Error loading file content: "+
a.message)})};f.prototype._buildSingleSkeleton=function(a){this._totalCounter++;this.fileSkeleton.push(a);this.searchHelper&&!this._buildSkeletonOnly&&this._totalCounter%100===0&&this.searchName();a=new g;a.resolve(this._totalCounter);return a};f.prototype.constructor=f;return{SearchCrawler:f}});
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(j,k,i,d,a,g,f){function e(a){this._init(a)}e.prototype=new f.Dialog;e.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="'+
d.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>';e.prototype._init=function(a){this.title=a.title||j["Find File Named"];this.modal=!0;this.messages=j;this._searcher=a.searcher;this._progress=a.progress;this._onHide=a.onHide;this._contentTypeService=new i.ContentTypeRegistry(this._searcher.registry);
if(!this._searcher)throw Error("Missing required argument: searcher");this._searchDelay=a.searchDelay||500;this._time=0;this._searcher.setCrawler(null);this._forceUseCrawler=!1;this._initialText=a.initialText;this._message=a.message;this._nameSearch=!0;if(a.nameSearch!==void 0)this._nameSearch=a.nameSearch;this._searchOnRoot=!0;this._fileService=this._searcher.getFileService();if(!this._fileService)throw Error(j["Missing required argument: fileService"]);this._searchRenderer=a.searchRenderer;if(!this._searchRenderer||
typeof this._searchRenderer.makeRenderFunction!=="function")throw Error(j["Missing required argument: searchRenderer"]);this._initialize()};e.prototype._bindToDom=function(e){var c=this;c.$crawlingProgress.style.display="none";this._nameSearch?this.$fileName.setAttribute("placeholder",j["FileName FolderName"]):this.$fileName.setAttribute("placeholder",j.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(b){if(b.keyCode===a.KEY.ENTER){var e=a.$("a",c.$results);if(e)a.stop(b),(g.isMac?b.metaKey:b.ctrlKey)?window.open(e.href):(window.location.href=e.href,c.hide())}},!1);e.addEventListener("keydown",function(b){var e,f,h;if(b.keyCode===a.KEY.DOWN||b.keyCode===a.KEY.UP)e=a.$$array("a",c.$results),f=document.activeElement,h=e.indexOf(f),b.keyCode===a.KEY.DOWN?h>=0?(f.classList.remove("treeIterationCursor"),e=h<e.length-1?e[h+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")):h>=0?(f.classList.remove("treeIterationCursor"),f=c.$fileName,e=h>0?e[h-1]:f,e.focus(),h>0&&e.classList.add("treeIterationCursor")):e.length>0&&(e[e.length-1].focus(),e[e.length-1].classList.add("treeIterationCursor")),a.stop(b)});e.addEventListener("mouseup",function(b){b.target.focus()},!1);setTimeout(function(){if(c._forceUseCrawler||!c._fileService.getService(c._searcher.getSearchLocation()).search){var b=
c._searchOnRoot?c._searcher.getSearchRootLocation():c._searcher.getChildrenLocation(),b=new k.SearchCrawler(c._searcher.registry,c._fileService,"",{searchOnName:!0,location:b});c._searcher.setCrawler(b);b.buildSkeleton(function(){c.$crawlingProgress.style.display="inline";c.$progress.appendChild(document.createTextNode(j["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()};e.prototype.checkSearch=function(){clearTimeout(this._timeoutId);var a=(new Date).getTime();a-this._time>this._searchDelay?(this._time=a,this.doSearch()):this._timeoutId=setTimeout(this.checkSearch.bind(this),50)};e.prototype._detectFolderKeyword=function(a){var c,b=a,e=null;if(this._nameSearch&&(c=/(\S+)\s*(.*)/,(a=c.exec(a))&&a.length===3))a[1]&&
(b=a[1]),a[2]&&(e=a[2]);return{keyword:b,folderKeyword:e}};e.prototype.doSearch=function(){var e=this.$fileName.value;if(e){var c=this._detectFolderKeyword(e),b=this._searcher.createSearchParams(c.keyword,this._nameSearch,this._searchOnRoot),f=this._searchRenderer.makeRenderFunction(this._contentTypeService,this.$results,!1,this.decorateResult.bind(this));this.currentSearch=f;var d=document.createElement("div");d.appendChild(document.createTextNode(this._nameSearch?j["Searching..."]:g.formatMessage(j["Searching for occurrences of"],
e)));a.empty(this.$results);this.$results.appendChild(d);this._searcher.search(b,c.folderKeyword,function(){f===this.currentSearch&&f.apply(null,arguments)}.bind(this))}};e.prototype.decorateResult=function(e){function c(a){a.button===0&&!a.ctrlKey&&!a.metaKey&&b.hide()}for(var b=this,e=a.$$array("a",e),f=0;f<e.length;f++)e[f].addEventListener("click",c,!1)};e.prototype._beforeHiding=function(){clearTimeout(this._timeoutId)};e.prototype._afterHiding=function(){this._onHide&&this._onHide()};e.prototype.constructor=
e;return{OpenResourceDialog:e}});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(j,k){function i(d,a,g){if(d=k.node(d))this._parent=d;else throw Error("Parent node of dropdown menu not found");this.options=g=g||{};this.navDropDownId=this._parent.id+"_navdropdown";this.selectionClass=g.selectionClass;d=document.createElement("div");d.classList.add("dropDownContainer");d.id=this.navDropDownId;d.style.display="none";this._parent.appendChild(d);this._dropdownMenu=d;if(a=k.node(a))this._triggerNode=
a;else throw"Trigger node of dropdown menu not found";if(this._triggerNode.style.visibility==="hidden")this._triggerNode.style.visibility="visible";if(!g.noClick)this._triggerNode.onclick=this.click.bind(this);this._dropdownMenu.addEventListener("keydown",function(a){a.keyCode===k.KEY.ESCAPE&&this.clearPanel()}.bind(this))}j.mixin(i.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(d){this._dropdownMenu.innerHTML=d},getContentNode:function(){return this._dropdownMenu},updateContent:function(d,a){a()},_positionDropdown:function(){this._dropdownMenu.style.right="";var d=k.bounds(this._dropdownMenu),a=k.bounds(document.body);if(d.left+d.width>a.left+a.width)d=k.bounds(this._boundingNode(this._triggerNode)),a=k.bounds(this._triggerNode),this._dropdownMenu.style.right=d.width-(a.left-d.left+a.width)+"px"},_boundingNode:function(d){var a=window.getComputedStyle(d,
null);return a===null?d:a.getPropertyValue("position")==="absolute"||!d.parentNode||d===document.body?d:this._boundingNode(d.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 i});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(j,k){var i={root:k};Object.keys(j).forEach(function(d){typeof i[d]==="undefined"&&(i[d]=j[d])});return i});
define("orion/fileClient",["i18n!orion/navigate/nls/messages","orion/Deferred","orion/i18nUtil"],function(j,k,i){function d(a,e,d){if(!a[e])throw e+j[" is not supported in this file system"];return a[e].apply(a,d)}function a(f,e,h,c){if(!f.readBlob)throw j["source file service does not support binary read"];if(!h.writeBlob)throw j["target file service does not support binary write"];if(e[e.length-1]!=="/")return d(f,"readBlob",[e]).then(function(b){return d(h,"writeBlob",[c,b])});var b=c.substring(0,
c.length-1),g=decodeURIComponent(b.substring(b.lastIndexOf("/")+1)),b=b.substring(0,b.lastIndexOf("/")+1);return d(h,"createFolder",[b,g]).then(function(){},function(){}).then(function(){return d(f,"fetchChildren",[e]).then(function(b){for(var e=[],d=0;d<b.length;++d){var g=b[d].Location,l=g;b[d].Directory&&(l=g.substring(0,g.length-1));l=decodeURIComponent(l.substring(l.lastIndexOf("/")+1));l=c+encodeURIComponent(l);b[d].Directory&&(l+="/");e[d]=a(f,g,h,l)}return k.all(e)})})}function g(a,e){function d(b){var a=
new k;a.reject(j["No Matching FileService for location:"]+b);return a}var c=a.getServiceReferences("orion.core.file"),b=c;if(e)for(var b=[],g=0;g<c.length;++g)e(c[g])&&b.push(c[g]);for(var m=[],o=[],r=[],q=[],s={fetchChildren:function(){var b=new k;b.resolve(q);return b},createWorkspace:function(){var b=new k;b.reject(j["no file service"]);return b},loadWorkspaces:function(){var b=new k;b.reject(j["no file service"]);return b},loadWorkspace:function(){var b=new k;window.setTimeout(function(){b.resolve({Directory:!0,
Length:0,LocalTimeStamp:0,Name:j["File Servers"],Location:"/",Children:q,ChildrenLocation:"/"})},100);return b},search:d,createProject:d,createFolder:d,createFile:d,deleteFile:d,moveFile:d,copyFile:d,read:d,write:d},c=0;c<b.length;++c)q[c]={Directory:!0,Length:0,LocalTimeStamp:0,Location:b[c].getProperty("top"),ChildrenLocation:b[c].getProperty("top"),Name:b[c].getProperty("Name")},g=b[c].getProperty("pattern")||b[c].getProperty("top").replace(/([.*+?^=!:${}()|\[\]\/\\])/g,"\\$1"),g[0]!=="^"&&(g=
"^"+g),m[c]=RegExp(g),o[c]=a.getService(b[c]),r[c]=b[c].getProperty("Name"),b[c].getProperty("NameKey")&&b[c].getProperty("nls")&&i.getMessageBundle(b[c].getProperty("nls")).then(function(a,c){q[a].Name=c[b[a].getProperty("NameKey")];r[a]=c[b[a].getProperty("NameKey")]}.bind(this,c));this._getServiceIndex=function(b){if(b==="/")return-1;else if(!b||b.length&&b.length===0)return o[0]?0:-1;for(var a=0;a<m.length;++a)if(m[a].test(b))return a;throw j["No Matching FileService for location:"]+b;};this._getService=
function(b){b=this._getServiceIndex(b);return b===-1?s:o[b]};this._getServiceName=function(b){b=this._getServiceIndex(b);return b===-1?s.Name:r[b]};this._getServiceRootURL=function(b){b=this._getServiceIndex(b);return b===-1?s.Location:q[b].Location}}g.prototype={getService:function(a){return this._getService(a)},fileServiceName:function(a){return this._getServiceName(a)},fileServiceRootURL:function(a){return this._getServiceRootURL(a)},fetchChildren:function(a){return d(this._getService(a),"fetchChildren",
arguments)},createWorkspace:function(a){return d(this._getService(),"createWorkspace",arguments)},loadWorkspaces:function(){return d(this._getService(),"loadWorkspaces",arguments)},loadWorkspace:function(a){return d(this._getService(a),"loadWorkspace",arguments)},createProject:function(a,e,h,c){return d(this._getService(a),"createProject",arguments)},createFolder:function(a,e){return d(this._getService(a),"createFolder",arguments)},createFile:function(a,e){return d(this._getService(a),"createFile",
arguments)},deleteFile:function(a){return d(this._getService(a),"deleteFile",arguments)},moveFile:function(f,e,h){var c=this._getService(f),b=this._getService(e);if(c===b)return d(c,"moveFile",arguments);var g=f[f.length-1]==="/",m=e;m[m.length-1]!=="/"&&(m+="/");if(h)m+=encodeURIComponent(h);else{var i=f;g&&(i=i.substring(0,i.length-1));m+=i.substring(i.lastIndexOf("/")+1)}g&&m[m.length-1]!=="/"&&(m+="/");return a(c,f,b,m).then(function(){return d(c,"deleteFile",[f])})},copyFile:function(f,e,h){var c=
this._getService(f),b=this._getService(e);if(c===b)return d(c,"copyFile",arguments);var g=f[f.length-1]==="/",m=e;m[m.length-1]!=="/"&&(m+="/");if(h)m+=encodeURIComponent(h);else{var i=f;g&&(i=i.substring(0,i.length-1));m+=i.substring(i.lastIndexOf("/")+1)}g&&m[m.length-1]!=="/"&&(m+="/");return a(c,f,b,m)},read:function(a,e){return d(this._getService(a),"read",arguments)},readBlob:function(a){return d(this._getService(a),"readBlob",arguments)},write:function(a,e,h){return d(this._getService(a),"write",
arguments)},remoteImport:function(a,e){return d(this._getService(a),"remoteImport",arguments)},remoteExport:function(a,e){return d(this._getService(a),"remoteExport",arguments)},search:function(a){return d(this._getService(a.resource),"search",arguments)}};g.prototype.constructor=g;return{FileClient:g}});
define("orion/webui/SideMenu","orion/commands,orion/objects,orion/webui/littlelib,orion/PageLinks,orion/PageUtil,orion/URITemplate,orion/URL-shim,orion/util".split(","),function(j,k,i,d,a,g,f,e){function h(b,a){this.parentNode=i.node(b);this.contentNode=i.node(a);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);i.addAutoDismiss([this.anchor],this._expandMenu.bind(this,null))}function c(b){return!b.isRelatedLink}function b(b,a){var c=b.order,e=a.order;if(c<e)return-1;else if(e<c)return 1;return 0}function l(b,a){var c=b.source.order,e=a.source.order,c=typeof c==="number"?c:100,e=typeof e==="number"?
e:100;return c===e?b.textContent.localeCompare(a.textContent):c<e?-1:1}var m=e.isTouch;k.mixin(h.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(b,a,c){var e=this.anchor,b=this.createListItem(b,a);c&&b.classList.add("sideMenuItemActive");e.appendChild(b);this.menuitems[a]=b},setSideMenu:function(){var b=this.getDisplayState(),a=this.parentNode;if(a){if(b===this.CLOSED_STATE){this.setPageContentLeft("0");
if(this._timeout)window.clearTimeout(this._timeout),this._timeout=null;this._timeout=window.setTimeout(function(){a.style.display="none"},this.TRANSITION_DURATION_MS);a.classList.add("animating")}if(b===this.OPEN_STATE){if(this._timeout)window.clearTimeout(this._timeout),this._timeout=null;a.classList.remove("animating");a.style.display="block";a.style.width=this.SIDE_MENU_OPEN_WIDTH;this.setPageContentLeft(this.SIDE_MENU_OPEN_WIDTH)}}},setPageContentLeft:function(b){var a=this.contentNode;if(a)a.style.left=
b},toggleSideMenu:function(){var b=this.getDisplayState(),a=this.contentNode;a&&a.classList.add("content-fixedHeight-animation");b=b===this.OPEN_STATE?this.CLOSED_STATE:this.OPEN_STATE;b===this.DEFAULT_STATE?localStorage.removeItem(this.LOCAL_STORAGE_NAME):localStorage.setItem(this.LOCAL_STORAGE_NAME,b);this.setSideMenu()},clearMenuItems:function(){this.menuitems=[];i.empty(this.anchor)},getMenuItems:function(){var b=this.menuitems;return Object.keys(b).map(function(a){return b[a]})},getMenuItem:function(b){return this.menuitems[b]},
getDisplayState:function(){var b=localStorage.getItem(this.LOCAL_STORAGE_NAME);if(!b)b=this.DEFAULT_STATE;return b},createListItem:function(b,a){var c=document.createElement("li");c.className=b;c.classList.add("sideMenuItem");c.categoryId=a;return c},setCategories:function(b){this.categories=b;this.links=Object.create(null)},setPageLinks:function(b){this.pageLinks=b;var a=this,c=b.createLinkElements();b.getAllLinks().forEach(function(b,e){var f=c[e];f.source=b;a._getLinksBin(b.category).push(f)});
this._renderLinks()},setRelatedLinks:function(b,a){this.relatedLinks=b;var e=this;Object.keys(this.links).forEach(function(b){var a=e._getLinksBin(b);e.links[b]=a.filter(c)});var f=document.createDocumentFragment();b.forEach(function(b){var a=b.relatedLink,c=e._getLinksBin(a.category),b=j.createCommandMenuItem(f,b.command,b.invocation);b.classList.remove("dropdownMenuItem");b.isRelatedLink=!0;b.source=a;c.push(b)});this._renderLinks(a)},_getLinksBin:function(b){if(b){var a=this.links;a[b]=a[b]||[];
return a[b]}else return[]},_sort:function(){var b=this.links;Object.keys(b).forEach(function(a){b[a].sort(l)})},_renderCategories:function(){var c=this.categories,e=this,f=new URL(window.location.href),h=a.matchResourceParameters();h.OrionHome=d.getOrionHome();var l=!1;this.clearMenuItems();c.getCategoryIDs().map(function(b){return c.getCategory(b)}).sort(b).forEach(function(b){var a=e._getLinksBin(b.id);a.length&&(l?e.addMenuItem(b.imageClass,b.id,!1):(a=a.some(function(b){if(!b.source.uriTemplate)return!1;
b=new g(b.source.uriTemplate);b=new URL(b.expand(h),window.location);return b.protocol===f.protocol&&b.host===f.host&&b.hostname===f.hostname&&b.port===f.port&&b.pathname===f.pathname&&b.search===f.search?l=!0:!1}),e.addMenuItem(b.imageClass,b.id,a)))})},_renderLinks:function(b){b=b||[];this._sort();this._renderCategories();var a=this,c=window.location.href;Object.keys(this.menuitems).forEach(function(e){var f=a.getMenuItem(e);if(f){for(var d=a._getLinksBin(e).slice(),d=d.filter(function(a){var e=
a.source;return b.indexOf(e.id)>=0||!e.default&&!e.force&&a.href===c?!1:!0}),d=d.filter(function(b){b=b.source;return!(d.length>1&&b.default&&!b.force)}),h=d.length-1;h>0;h--)d[h].href===d[h-1].href&&d.splice(h,1);if(d.length){f.appendChild(a._createCategoryElement(e,f,d[0]));var g=document.createElement("ul");g.className="sideMenuSubMenu";d.forEach(function(b){var a=document.createElement("li");a.className="sideMenuSubMenuItem";var c=document.createElement("a");c.href=b;c.className="sideMenuSubMenuItemLink";
var e=document.createElement("span");e.innerHTML=b.innerHTML;e.className="sideMenuSubMenuItemSpan";c.appendChild(e);a.appendChild(c);g.appendChild(a)});f.appendChild(g)}}})},_createCategoryElement:function(b,a,c){var b=this.categories.getCategory(b),e;m?(e=document.createElement("button"),e.type="button"):(e=document.createElement("a"),e.href=c.href);e.className+=b.imageClass;e.classList.add("submenu-trigger");e.tabIndex="0";a.classList.remove(b.imageClass);return e},_handleEvent:function(b){var a=
b.target,b=b.type==="focus";if(a.tagName!=="A"||b)a.classList.contains("submenu-trigger")&&(m||b)&&this._expandMenu(i.$(".sideMenuSubMenu",a.parentNode))},_expandMenu:function(b){this.getMenuItems().forEach(function(a){a=i.$(".sideMenuSubMenu",a);b!==a&&a.classList.remove("expanded")});b&&b.classList.toggle("expanded")}});return h});
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(j,
k,i,d,a,g,f,e,h,c,b,l,m,o,r,q,s,u,p,t,v,n,w,x,y,A,K,J,I,z,F,B,C,M,H){var O,X,R,S,T,P,G,E;function D(b,a){if(b.getLabel)return b.getLabel();else{var c=new w;c.resolve(a.properties.name);return c}}function L(b){m.node("progressPane").setAttribute("aria-label",j["Operations - Press spacebar to show current operations"]);(b=b.getService("orion.page.progress"))&&b.init.bind(b)("progressPane")}function U(b,a){var c=b.getServiceReferences("orion.core.auth");ea=[];var e=O.apply(this,arguments);if(e)for(var n=
0;n<c.length;n++){var f=c[n],d=b.getService(f);D(d,f).then(function(b){d.getKey().then(function(a){ea.push(a);d.getUser().then(function(c){e.addUserItem(a,d,b,c)},function(c,n){e.addUserItem(a,d,b,n)});window.addEventListener("storage",function(){da[a]!==localStorage.getItem(a)&&(da[a]=localStorage.getItem(a),d.getUser().then(function(c){e.addUserItem(a,d,b,c)},function(){e.addUserItem(a,d,b)}))},!1)})})}}function W(b){return b}function V(b,a,c,e,n){function d(b){for(var a={},c=b.getPropertyKeys(),
e,n=0;n<c.length;n++)e=c[n],a[e]=b.getProperty(e);return a}function g(b,a){var c=null;b.some(function(b){return a===b.getProperty("id")?!!(c=b):!1});return c}function l(b){var c=b.command;if(!c.visibleWhen||c.visibleWhen(a))return b.invocation=new f.CommandInvocation(a,a,null,c,e),(new w).resolve(b);else if(typeof n==="function")return i||(i=n()),w.when(i,function(n){if(n&&a===fa&&(!c.visibleWhen||c.visibleWhen(n)))return b.invocation=new f.CommandInvocation(n,n,null,c,e),b});return(new w).resolve()}
function y(b,a,c){return c?(new w).resolve({relatedLink:b,command:c}):a.then(function(a){return{relatedLink:b,command:new f.Command(a)}})}var x=arguments,m,i,A=b&&b.getServiceReferences("orion.page.link.related");if(A&&A.length!==0){var o=this;w.when(function(){if(m)return m;var a=b.getService("orion.core.contentTypeRegistry");a||(a=new s.ContentTypeRegistry(b),a=b.getService("orion.core.contentTypeRegistry"));return a.getContentTypes().then(function(b){return m=b})}(),function(){if(X.apply(o,x)){var a=
b.getServiceReferences("orion.navigate.command"),n=[];A.forEach(function(c){var f=d(c);if(f.id){var w;if((f.nls&&f.nameKey||f.name)&&f.uriTemplate)w=h._createCommandOptions(f,c,b,m,!0),n.push(y(f,w,null));else if(w=g(a,f.id)){var l=d(w),c={};H.mixin(c,l,f);(f=e.findCommand(f.id))?n.push(y(c,null,f)):(w=h._createCommandOptions(l,w,b,m,!0),n.push(y(c,w,null)))}}});w.all(n,W).then(function(b){b.sort(function(b,a){return b.command.name.localeCompare(a.command.name)});return w.all(b.map(l),W).then(function(a){var n=
[],a=a.filter(function(a,c){if(a)return!0;n.push(b[c]);return!1});R.call(o,e,a,n,c);S.apply(o,x)})})}})}}function ha(b){var a=m.node("globalActions");a&&(b.destroy(a),b.renderCommands(a.id,a,{},{},"tool"))}function aa(b){var a=window.getComputedStyle(b,null);return a===null?b:a.getPropertyValue("position")==="absolute"||!b.parentNode||b===document.body?b:aa(b.parentNode)}function ba(b){var a={},c=null;typeof b==="string"&&(b=m.node(b));b||(b=m.node("pageActions"));for(var e=b;e&&e.classList;){if(e.classList.contains("toolComposite")){c=
e;break}e=e.parentNode}if(b.classList.contains("commandMarker"))a.commandNode=b;if(c&&(a.slideContainer=m.$(".slideParameters",c),a.parameterArea=m.$(".parameters",c),a.dismissArea=m.$(".parametersDismiss",c),a.notifications=m.$("#notificationArea",c),c.parentNode&&(a.toolbarTarget=m.$(".toolbarTarget",c.parentNode),a.toolbarTarget)))b=m.bounds(a.toolbarTarget),e=m.bounds(aa(a.toolbarTarget.parentNode)),a.toolbarTargetY=b.top-e.top,a.toolbar=c;return a}function ca(b){if(b=b.slideContainer)if(b.style.left=
"",b.style.top="",b.classList.contains("slideContainerActive")){var a=m.bounds(b),c=m.bounds(b.parentNode);b.style.left=(c.width-a.width)/2+"px";b.style.top="0"}}var g=function(b){var a=document.createElement("a");a.href=b;return a.href}(k.toUrl("auth/NotifyAuthentication.html")),da={},Q=null;O=B.createMenuGenerator||function(b,a){if(m.node("userMenu")){var c=m.node("userDropdown"),e=new r.Dropdown({dropdown:c}),c=new x.UserMenu({dropdownNode:c,dropdown:e,serviceRegistry:b}),e=m.node("userTrigger");
new q.Tooltip({node:e,text:j.Options,position:["below","left"]});var e=document.getElementById("userTrigger"),n=e.className;n+=" imageSprite core-sprite-silhouette";e.className=n;c.setKeyAssist(a);return c}};X=B.beforeGenerateRelatedLinks||function(){return!0};R=B.addRelatedLinkCommands||function(b,a,c,e){this.sideMenu&&this.sideMenu.setRelatedLinks(a,e)};S=B.afterGenerateRelatedLinks||function(){};T=B.afterSetPageTarget||function(){};P=B.generateNavigationMenu||function(){var b=m.node("sideMenu");
if(b){var a=m.node("centralNavigation");new q.Tooltip({node:a,text:j.CentralNavTooltip,position:["right"]});Q=this.sideMenu=new M(b,m.node("pageContent"));a.addEventListener("click",Q.toggleSideMenu.bind(Q));(b=m.node("sideMenuToggle"))&&b.addEventListener("click",Q.toggleSideMenu.bind(Q))}};G=B.afterGenerateNavigationMenu||function(){};E=B.afterGenerateBanner||function(){};var ea=[],fa,$=[],N,Z=null,Y=null,ga=new a;return{generateBanner:function(b,a,c,h,g,l,x,r){function q(b){b.registerService("orion.cm.managedservice",
{updated:function(b){for(var b=b&&b["links.newtab"]!=="undefined"?b["links.newtab"]?"_blank":"_self":"_self",a=m.$$array(".targetSelector"),c=0;c<a.length;c++)a[c].target=b}},{pid:"nav.config"})}(new v.ThemePreferences(h,new n.ThemeData)).apply();var t=m.node(b);if(!t)throw j["could not find banner parent, id was "]+b;var s=document.createRange();s.selectNode(t);s=s.createContextualFragment(K);m.processTextNodes(s,j);t.firstChild?t.insertBefore(s,t.firstChild):t.appendChild(s);t=m.node("home");t.href=
k.toUrl("edit/edit.html");t.setAttribute("aria-label",j["Orion Home"]);m.node("progressPane").src=f.NO_IMAGE;if(t=m.node("pageToolbar"))t.classList.add("toolbarLayout"),t.innerHTML=I+i.slideoutHTMLFragment("mainToolbar");(t=m.node("closeNotifications"))&&t.setAttribute("aria-label",j["Close notification"]);if(F.isFirefox<=17&&(t=m.node("staticBanner")))t.style.width="100%",t.style.MozBoxSizing="border-box";if(t=m.node("footer"))t.innerHTML=J,m.processTextNodes(t,j);c.setParameterCollector(new e.CommandParameterCollector(ba,
ca));document.addEventListener("keydown",function(b){b.keyCode===m.KEY.ESCAPE&&(b=a.getService("orion.page.message"))&&b.setProgressMessage("")},!1);P.apply(this,arguments);G.apply(this,arguments);t=y.getCategoriesInfo(a);s=y.getPageLinksInfo(a,"orion.page.link");w.all([t,s]).then(function(b){if(Q){var a=b[1];Q.setCategories(b[0]);Q.setPageLinks(a);Q.setSideMenu()}});if(t=m.$(".split")){var s=m.$(".sidePanelLayout"),z=m.$(".mainPanelLayout");if(s&&z)Z={side:s,main:z},Z.splitter=new o.Splitter({node:t,
sidePanel:s,mainPanel:z,toggle:!0,closeByDefault:r}),t=new f.Command({name:j["Toggle side panel"],tooltip:j["Open or close the side panel"],id:"orion.toggleSidePane",callback:function(){Z.splitter.toggleSidePanel()}}),c.addCommand(t),c.registerCommandContribution("pageActions","orion.toggleSidePane",1,null,!0,new d.KeyBinding("l",F.isMac?!1:!0,!0,!1,F.isMac?!0:!1))}var u=!1,B=function(b,a){if(!u){var c=a.getService("orion.page.progress"),e=new A.OpenResourceDialog({searcher:b,progress:c,searchRenderer:b.defaultRenderer,
onHide:function(){u=!1}});window.setTimeout(function(){u=!0;e.show()},0)}},t=new f.Command({name:j["Find File Named..."],tooltip:j["Choose a file by name and open an editor on it"],id:"orion.openResource",callback:function(){B(g,a)}});c.addCommand(t);c.registerCommandContribution("globalActions","orion.openResource",100,null,!0,new d.KeyBinding("f",!0,!0));t=new f.Command({name:j["Toggle banner and footer"],tooltip:j["Hide or show the page banner and footer"],id:"orion.toggleTrim",callback:function(){var b=
m.node("banner"),a=m.node("footer"),c=m.node("sideMenu"),e=m.$(".content-fixedHeight"),n=b.style.visibility==="hidden";n?(b.style.visibility="visible",a.style.visibility="visible",e.classList.remove("content-fixedHeight-maximized"),c&&c.classList.remove("sideMenu-maximized")):(b.style.visibility="hidden",a.style.visibility="hidden",e.classList.add("content-fixedHeight-maximized"),c&&c.classList.add("sideMenu-maximized"));ga.dispatchEvent({type:"toggleTrim",maximized:!n});return!0}});c.addCommand(t);
c.registerCommandContribution("globalActions","orion.toggleTrim",100,null,!0,new d.KeyBinding("m",!0,!0));t=new f.Command({name:j["System Configuration Details"],tooltip:j["System Config Tooltip"],id:"orion.configDetailsPage",hrefCallback:function(){return k.toUrl("help/about.html")}});c.addCommand(t);c.registerCommandContribution("globalActions","orion.configDetailsPage",100,null,!0,new d.KeyBinding(112,!0,!0));t=new f.Command({name:j["Background Operations"],tooltip:j["Background Operations Tooltip"],
id:"orion.backgroundOperations",hrefCallback:function(){return k.toUrl("operations/list.html")}});c.addCommand(t);c.registerCommandContribution("globalActions","orion.backgroundOperations",100,null,!0,new d.KeyBinding("o",!0,!0));Y=new p.KeyAssistPanel({commandRegistry:c});t=new f.Command({name:j["Show Keys"],tooltip:j["Show a list of all the keybindings on this page"],id:"orion.keyAssist",callback:function(){Y.isVisible()?Y.hide():Y.show();return!0}});c.addCommand(t);c.registerCommandContribution("globalActions",
"orion.keyAssist",100,null,!0,new d.KeyBinding(191,!1,!0));ha(c);U(a,t.callback);L(a);window.addEventListener("hashchange",function(){c.processURL(window.location.href)},!1);window.setTimeout(function(){q(a)},0);E.apply(this,arguments)},getToolbarElements:ba,getMainSplitter:function(){return Z},getKeyAssist:function(){return Y},getGlobalEventTarget:function(){return ga},layoutToolbarElements:ca,setPageTarget:function(b){var a,c,e=b.breadcrumbRootName,n=b.serviceRegistry;b.target?(b.searchService&&
b.searchService.setLocationByMetaData(b.target),b.fileService&&!b.breadcrumbTarget&&(c=e?e+" ":"",c+=b.fileService.fileServiceName(b.target.Location),e=null),a=b.name||b.target.Name,fa=b.target,V.call(this,n,b.target,$,b.commandService,b.makeAlternate)):(b.breadcrumbTarget||(e=e||b.task||b.name),a=b.name,V.call(this,n,{NoTarget:""},$,b.commandService,b.makeAlternate));(N=b.title)||(N=a?a+" - "+b.task:b.task);window.document.title=N;T.apply(this,arguments);if(a=b.breadCrumbContainer?m.node(b.breadCrumbContainer):
m.node("location")){m.empty(a);var f=n&&new C.FileClient(n),n=b.breadcrumbTarget||b.target,f=f&&n&&n.Location?f.fileServiceRootURL(n.Location):null;new l.BreadCrumbs({container:a,resource:n,rootSegmentName:e,workspaceRootSegmentName:c,workspaceRootURL:f,makeFinalHref:b.makeBreadcrumFinalLink,makeHref:b.makeBreadcrumbLink})}},setDirtyIndicator:function(b){if(N)N.charAt(0)==="*"&&!b&&(N=N.substring(1)),b&&N.charAt(0)!=="*"&&(N="*"+N),window.document.title=N;var a=m.node("dirty");if(a)a.textContent=
b?"*":""},setPageCommandExclusions:function(b){$=b},notifyAuthenticationSite:g}});
define("orion/urlUtils",["orion/PageUtil","orion/URL-shim"],function(j){return{detectValidURL:function(k){for(var i=/\[([^\]]*)\]\(([^\)]+)\)/g,d=i.exec(k),a=[],g=0;d;){if(d.length===3&&d[2].length>0){var f=new URL(d[2]);f.protocol!==":"&&j.validateURLScheme(f.href)&&(d.index>g&&a.push({segmentStr:k.substring(g,d.index)}),a.push({segmentStr:d[1].length>0?d[1]:d[2],urlStr:d[2]}),g=d.index+d[0].length)}d=i.exec(k)}if(g===0)return null;g<k.length-1&&a.push({segmentStr:k.substring(g)});return a},processURLSegments:function(j,
i){i.forEach(function(d){if(d.urlStr){var a=document.createElement("a");a.href=d.urlStr;a.appendChild(document.createTextNode(d.segmentStr))}else a=document.createElement("span"),a.textContent=d.segmentStr;j.appendChild(a)})}}});
define("orion/status",["i18n!orion/nls/messages","orion/webui/littlelib","orion/globalCommands","orion/urlUtils"],function(j,k,i,d){function a(a,e,d,c,b){this._serviceRegistry=a;this._serviceRegistration=a.registerService("orion.page.message",this);this._operationsClient=e;this.notificationContainerDomId=b;this.domId=d;this.progressDomId=c||d;this._hookedClose=!1;this._timer=null;this._clickToDisMiss=!0;this._cancelMsg=null}var g;a.prototype={_init:function(){var a=k.node("closeNotifications");if(a&&
!this._hookedClose){a.style.cursor="pointer";this._hookedClose=!0;var e=k.node(this.notificationContainerDomId);k.addAutoDismiss([e],function(){this._clickToDisMiss&&this.close()}.bind(this));a.addEventListener("click",function(){this.close()}.bind(this));e.addEventListener("click",function(a){a&&a.target&&a.target.nodeName.toLowerCase()==="a"&&(a=k.$$("a",e))&&a.length&&a.length===1&&this.close()}.bind(this))}},close:function(){window.clearTimeout(this._timer);var a=k.node("closeNotifications");
this._cancelMsg&&this._cancelFunc&&a?(a.innerHTML="",a.classList.remove("cancelButton"),a.classList.add("dismissButton"),a.classList.add("core-sprite-close"),a.classList.add("imageSprite"),this._cancelFunc(),this._cancelMsg=null):this.setProgressMessage("")},_getNotifierElements:function(){if(!this._notifierElements)this._notifierElements=i.getToolbarElements(this.notificationContainerDomId);return this._notifierElements},setMessage:function(a,e,d){this._init();this.currentMessage=a;var c=k.node(this.domId);
if(typeof d==="boolean"){var b=c.getAttribute("aria-live");c.setAttribute("aria-live",d?"polite":"off");window.setTimeout(function(){a===this.currentMessage&&(k.empty(c),c.appendChild(document.createTextNode(a)),window.setTimeout(function(){c.setAttribute("aria-live",b)},100))}.bind(this),100)}else k.empty(c),c.appendChild(document.createTextNode(a));typeof e==="number"&&window.setTimeout(function(){a===this.currentMessage&&(k.empty(c),c.appendChild(document.createTextNode("")))}.bind(this),e)},setErrorMessage:function(a){this._clickToDisMiss=
!0;this.currentMessage=a;this._init();var e=a.responseText||a.message||a;if(typeof e==="string")try{e=JSON.parse(e)}catch(d){}var a=e.Message||e,c="red";if(e.Severity)switch(e.Severity){case "Warning":c="#FFCC00";break;case "Error":c="red";break;case "Info":case "Ok":c="green"}e=document.createElement("span");e.style.color=c;e.appendChild(document.createTextNode(a));a=k.node(this.domId);k.empty(a);a.appendChild(e)},setProgressMessage:function(a){this._clickToDisMiss=!1;this._init();this.currentMessage=
a;var e=document.createElement("span");e.classList.add("progressIcon");var d=k.node(this.progressDomId);k.empty(d);d.appendChild(e);d.appendChild(document.createTextNode(a));e=k.node(this.notificationContainerDomId);e.classList.remove("notificationHide");if(a&&a.length>0)e.classList.add("progressNormal"),e.classList.add("notificationShow");else if(this._progressMonitors&&this._progressMonitors.length>0)return this._renderOngoingMonitors();else e.classList.remove("notificationShow"),e.classList.add("notificationHide")},
setCancelFunction:function(a){this._cancelFunc=a},setProgressResult:function(a,e){this._clickToDisMiss=!1;this._cancelMsg=e;this.currentMessage=a;var h=a.responseText||a;if(typeof h==="string")try{h=JSON.parse(h)}catch(c){}this._init();var b=h.Message||h.toString(),g=j.UnknownError,m="core-sprite-information",i="progressNormal",r=document.createElement("span");r.classList.add("imageSprite");r.classList.add("progressIcon");var q=[];if(h.Severity)switch(h.Severity){case "Warning":g=j.UnknownWarning;
m="core-sprite-warning";i="progressWarning";q.push("progressInfo");q.push("progressError");q.push("progressNormal");this._clickToDisMiss=!0;break;case "Error":m="core-sprite-error";i="progressError";q.push("progressWarning");q.push("progressInfo");q.push("progressNormal");this._clickToDisMiss=!0;break;default:i="progressNormal",q.push("progressWarning"),q.push("progressError"),q.push("progressNormal")}q.push("notificationHide");r.classList.add(m);var s=k.node(this.progressDomId),m=k.node(this.notificationContainerDomId);
k.empty(s);s.appendChild(r);b===Object.prototype.toString()&&(b=g);if(h.HTML)h=document.createElement("span"),h.innerHTML=b,s.appendChild(h);else{if(g=d.detectValidURL(b))b=document.createDocumentFragment(),d.processURLSegments(b,g),Array.prototype.forEach.call(k.$$("a",b),function(b){b.target="_blank"});else{if(h.Severity!=="Warning"&&h.Severity!=="Error"&&!e)this._timer&&window.clearTimeout(this._timer),this._timer=window.setTimeout(function(){this.setProgressMessage("");this._timer=null}.bind(this),
5E3);b=document.createTextNode(b)}s.appendChild(b)}if(i&&this.progressDomId!==this.domId){m.classList.add(i);for(i=0;i<q.length;i++)m.classList.remove(q[i])}m.classList.add("notificationShow");if(q=k.node("closeNotifications"))this._cancelMsg?(q.classList.add("cancelButton"),q.classList.remove("dismissButton"),q.classList.remove("core-sprite-close"),q.classList.remove("imageSprite"),q.innerHTML=this._cancelMsg):(q.innerHTML="",q.classList.remove("cancelButton"),q.classList.add("dismissButton"),q.classList.add("core-sprite-close"),
q.classList.add("imageSprite"))},showWhile:function(a,e){var d=this;if(e){d.setProgressMessage(e);var c=function(){e===d.currentMessage&&d.setProgressMessage("")};a.then(c,c)}return a},_lastProgressId:0,_progressMonitors:{length:0},createProgressMonitor:function(a,e){return new g(this,++this._lastProgressId,a,e)},_renderOngoingMonitors:function(){if(this._progressMonitors.length>0){var a="",e=!0,d;for(d in this._progressMonitors)this._progressMonitors[d].status&&(e||(a+=", "),a+=this._progressMonitors[d].status,
e=!1);this.setProgressMessage(a)}else this.setProgressMessage("")},_beginProgressMonitor:function(a){this._progressMonitors[a.progressId]=a;this._progressMonitors.length++;this._renderOngoingMonitors()},_workedProgressMonitor:function(a){this._progressMonitors[a.progressId]=a;this._renderOngoingMonitors()},_doneProgressMonitor:function(a){delete this._progressMonitors[a.progressId];this._progressMonitors.length--;a.status?this.setProgressResult(a.status):this._renderOngoingMonitors()}};a.prototype.constructor=
a;g=function(a,e,d,c){this.statusService=a;this.progressId=e;if(d){this.deferred=d;this.begin(c);var b=this;d.then(function(){b.done.bind(b)()},function(){b.done.bind(b)()})}};g.prototype.begin=function(a){this.status=a;this.statusService._beginProgressMonitor(this)};g.prototype.done=function(a){this.status=a;this.statusService._doneProgressMonitor(this)};g.prototype.worked=function(a){this.status=a;this.statusService._workedProgressMonitor(this)};g.prototype.constructor=g;return{StatusReportingService:a,
ProgressMonitor:g}});
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(j,k){var i={root:k};Object.keys(j).forEach(function(d){typeof i[d]==="undefined"&&(i[d]=j[d])});return i});
define("orion/webui/popupdialog",["i18n!orion/widgets/nls/messages","require","orion/webui/littlelib","orion/webui/tooltip"],function(j,k,i,d){function a(){}a.prototype={_initialize:function(a,f,e,h,c){this._tooltip=new d.Tooltip({node:a,hideDelay:c||0,afterShowing:this._afterShowingFunction(f).bind(this),afterHiding:e,trigger:h?h:"click"});this.$parent=this._tooltip.contentContainer();this.$parent.role="dialog";a=document.createRange();a.selectNode(this.$parent);a=a.createContextualFragment(this.TEMPLATE);
this.messages&&i.processTextNodes(a,j);this.$parent.appendChild(a);var b=this._tooltip;this.$parent.addEventListener("keydown",function(a){a.keyCode===i.KEY.ESCAPE&&b.hide()},!1);this._bindElements(this.$parent);typeof this._bindToDom==="function"&&this._bindToDom(this.$parent)},_bindElements:function(a){for(var f=0;f<a.childNodes.length;f++){var e=a.childNodes[f];e.id&&(this["$"+e.id]=e);this._bindElements(e)}},_afterShowingFunction:function(a){return function(){a&&a.bind(this)();if(!this.customFocus){var f=
i.firstTabbable(this.$parent);f&&f.focus()}}},hide:function(){this._tooltip.hide()},show:function(){this._tooltip.show()}};a.prototype.constructor=a;return{PopupDialog:a}});
define("orion/operationsCommands",["i18n!orion/operations/nls/messages","require","orion/webui/littlelib","orion/commands"],function(j,k,i,d){var a={};(function(){var g=!1;a.updateNavTools=function(a,e,d,c,b,l){var m=i.node(c);if(m)e.destroy(m);else throw j["could not find toolbar "]+c;e.renderCommands(c,m,l,d,"button");if(b&&(c=i.node(b)))e.destroy(c),e.renderCommands(b,c,null,d,"button");g||(g=!0,a.getService("orion.page.selection").addEventListener("selectionChanged",function(a){var c=i.node(b);
c&&(e.destroy(c),e.renderCommands(b,c,a.selections,d,"button"))}))};a.createOperationsCommands=function(a,e,h){function c(b){return!b.operation||!b.operation.type?!1:b.operation.type==="loadstart"||b.operation.type==="progress"}var b=new d.Command({name:j["Remove Completed"],tooltip:j["Remove all completed operations"],id:"eclipse.removeCompletedOperations",callback:function(){h.removeCompletedOperations().then(function(){e.loadOperations.bind(e)()})},visibleWhen:function(){return!0}});a.addCommand(b);
b=new d.Command({name:j.Remove,tooltip:j["Remove operations from the operations list."],imageClass:"core-sprite-delete",id:"eclipse.removeOperation",callback:function(b){for(var b=Array.isArray(b.items)?b.items:[b.items],a=0;a<b.length;a++){var c=b[a];h.removeOperation.bind(h)(c.Location).then(function(){e.loadOperations.bind(e)()},function(){e.loadOperations.bind(e)()})}},visibleWhen:function(b){if(!Array.isArray(b)||b.length===0)return!c(b);for(var a in b)if(c(b[a]))return!1;return!0}});a.addCommand(b);
b=new d.Command({name:j.Cancel,tooltip:j["Cancel operations from the operations list."],imageClass:"core-sprite-stop",id:"eclipse.cancelOperation",callback:function(b){for(var b=Array.isArray(b.items)?b.items:[b.items],a=0;a<b.length;a++){var c=b[a];c.deferred&&c.deferred.cancel()}},visibleWhen:function(b){if(!Array.isArray(b)||b.length===0)return c(b)&&(b.operation&&b.operation.cancelable?!0:!1);for(var a in b)if(!c(b[a])||!b[a].operation||!b[a].operation.cancelable)return!1;return!0}});a.addCommand(b)}})();
return a});
define("orion/webui/dialogs/OperationsDialog",["i18n!orion/operations/nls/messages","require","orion/webui/littlelib","orion/webui/popupdialog","orion/operationsCommands"],function(j,k,i,d,a){function g(a){this._options=a}g.prototype=new d.PopupDialog;g.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>';g.prototype._init=
function(f){this._myOperations=[];this._operationsDeferreds=[];this._commandService=f.commandRegistry;a.createOperationsCommands(this._commandService);this._commandService.registerCommandContribution("operationsDialogItems","eclipse.cancelOperation",1);this._initialize(f.triggerNode)};g.prototype._bindToDom=function(){this.$allOperationsLink.href=k.toUrl("operations/list.html");this._setOperationsVisibility()};g.prototype.setOperations=function(a,e){this._myOperations||this._init(this._options);this._myOperations=
[];this._operationsDeferreds=[];if(a)for(var d in a)this._myOperations.push(a[d]),this._operationsDeferreds.push(e[d]);this._renderOperations()};g.prototype.parseProgressResult=function(a){if(!a)return{};a=a.responseText||a;try{a=JSON.parse(a)}catch(e){}var d={Message:a.Message||a,Severity:a.Severity};if(a.DetailedMessage&&a.DetailedMessage!==d.Message)d.DetailedMessage=a.DetailedMessage;return d};g.prototype._renderOperations=function(){this._renderOperationsTable(this.$myOperationsList,this._myOperations,
this._operationsDeferreds)};g.prototype._renderOperationsTable=function(a,e,d){i.empty(a);for(var c=0;c<e.length;c++){var b=e[c],g=document.createElement("tr"),m=document.createElement("td");m.style.paddingLeft="5px";m.style.paddingRight="5px";m.textContent=b.Name;g.appendChild(m);var o=document.createElement("div");m.appendChild(o);m=document.createElement("span");m.style.paddingRight="5px";m.classList.add("imageSprite");switch(b.type){case "Warning":m.classList.add("core-sprite-warning");m.setAttribute("aria-label",
j["Operation resulted in a warning."]);break;case "error":m.classList.add("core-sprite-error");m.setAttribute("aria-label",j["Operation resulted in an error."]);break;case "loadstart":case "progress":m.classList.add("core-sprite-start");m.setAttribute("aria-label",j["Operation is running."]);break;case "abort":m.classList.add("core-sprite-stop");m.setAttribute("aria-label",j["Operation is canceled."]);break;case "load":case "loadend":m.classList.add("core-sprite-ok"),m.setAttribute("aria-label","Operation ok.")}o.appendChild(m);
m=document.createElement("span");m.classList.add("operationStatus");m.textContent=b.Name;o.appendChild(m);if(b.error){var r=b.error.Message||b.error;b.error.DetailedMessage&&b.error.DetailedMessage!==""&&(r+=": "+b.error.DetailedMessage);m.textContent=r;m.classList.remove("operationStatus");m.classList.add("operationError")}this._commandService.renderCommands("operationsDialogItems",o,{operation:b,deferred:d[c]},this,"tool");a.appendChild(g)}this._setOperationsVisibility()};g.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"};g.prototype.constructor=g;return{OperationsDialog:g}});
define("orion/progress",["i18n!orion/nls/messages","require","orion/Deferred","orion/webui/littlelib","orion/webui/dialogs/OperationsDialog"],function(j,k,i,d,a){function g(e,f){if(!this._progressPane){this._progressPane=d.node(e);this._operationsDialog=new a.OperationsDialog({triggerNode:this._progressPane,commandRegistry:f});var c=this;this._progressPane.addEventListener("keydown",function(b){(b.charOrCode===" "||b.keyCode===d.KEY.ENTER)&&c._operationsDialog.show()})}}function f(a,f,c,b){this._serviceRegistry=
a;this._serviceRegistration=a.registerService("orion.page.progress",this);this._commandRegistry=c;this._operationsClient=f;this._operations={};this._operationDeferrds={};this._operationsIndex=0;this._lastIconClass=this._lastOperation=null;this._progressMonitorClass=b}g.prototype={_switchIconTo:function(a){this._lastIconClass&&this._progressPane.classList.remove(this._lastIconClass);this._lastIconClass=a;this._progressPane.classList.add(this._lastIconClass)},generateOperationsInfo:function(a,f){var c=
{},b;for(b in a)a[b].progressMonitor||(c[b]=a[b]);if(this._isEmpty(c))this._switchIconTo("progressPane_empty"),this._progressPane.title=j.Operations,this._progressPane.alt=j.Operations,this._progressPane.hasAttribute("aria-valuetext")&&this._progressPane.removeAttribute("aria-valuetext");else{var d="";for(b in c){var g=c[b];if(g.type&&(g.type==="loadstart"||g.type==="progress")){d="running";break}}switch(d){case "running":this._progressPane.title=j["Operations running"];this._progressPane.alt=j["Operations running"];
this._progressPane.setAttribute("aria-valuetext",j["Operations running"]);this._switchIconTo("progressPane_running");break;case "warning":this._progressPane.title=j["Some operations finished with warning"];this._progressPane.alt=j["Some operations finished with warning"];this._progressPane.setAttribute("aria-valuetext",j["Some operations finished with warning"]);this._switchIconTo("progressPane_warning");break;case "error":this._progressPane.title=j["Some operations finished with error"];this._progressPane.alt=
j["Some operations finished with error"];this._progressPane.setAttribute("aria-valuetext",j["Some operations finished with error"]);this._switchIconTo("progressPane_error");break;default:this._progressPane.title=j.Operations,this._progressPane.alt=j.Operations,this._progressPane.hasAttribute("aria-valuetext")&&this._progressPane.removeAttribute("aria-valuetext"),this._switchIconTo("progressPane_operations")}}this._operationsDialog.setOperations(c,f)},_isEmpty:function(a){for(var f in a)return!1;return!0}};
g.prototype.constructon=g;f.prototype={init:function(a){if(!this._progressMonitorClass)this._progressMonitorTool=new g(a,this._commandRegistry)},progress:function(a,f,c){var b=this,d=this._operationsIndex++;!c&&this._progressMonitorClass&&(c=new this._progressMonitorClass,c.begin(f));a.then(function(){if(b._operations[d]){var g=b._operations[d];if(f)g.Name=f;b._lastOperation=g;g.type="loadend";if(c)g.progressMonitor=c;b.writeOperation.bind(b)(d,g,a);g.Location||b._removeOperationFromTheList.bind(b)(d)}},
function(g){if(b._operations[d]){var i=b._operations[d];if(f)i.Name=f;if(c)i.progressMonitor=c;b._lastOperation=i;i.type=g.canceled?"abort":"error";i.error=g;b.writeOperation.bind(b)(d,i,a);i.Location||b._removeOperationFromTheList.bind(b)(d)}},function(g){if(f)g.Name=f;if(c)g.progressMonitor=c;b.writeOperation.bind(b)(d,g,a)});return a},removeOperation:function(a){for(var f in this._operations)if(this._operations[f].Location&&this._operations[f].Location===a){this._removeOperationFromTheList(f);
break}this._operationsClient.removeOperation.bind(this._operationsClient)(a)},_removeOperationFromTheList:function(a){var f=this._operations[a].progressMonitor;delete this._operations[a];delete this._operationDeferrds[a];f?f.done():this._progressMonitorTool.generateOperationsInfo(this._operations,this._operationDeferrds)},removeCompletedOperations:function(){for(var a in this._operations){var f=this._operations[a];if(f.type&&f.type!=="loadstart"&&f.type!=="progress")(f=this._operations[a].progressMonitor)&&
f.done(),delete this._operations[a],delete this._operationDeferrds[a]}this._progressMonitorTool.generateOperationsInfo(this._operations,this._operationDeferrds)},setProgressResult:function(a){this._serviceRegistry.getService("orion.page.message").setProgressResult(a)},showWhile:function(a,f,c){f&&this._serviceRegistry.getService("orion.page.message").setProgressMessage(f);var b=this;a.then(function(){b._serviceRegistry.getService("orion.page.message").setProgressMessage("")},function(a){c?b._serviceRegistry.getService("orion.page.message").setProgressMessage(""):
b.setProgressResult.bind(b)(a);return a});return this.progress(a,f)},writeOperation:function(a,f,c){this._operations[a]=f;this._operationDeferrds[a]=c;f.Location&&this._serviceRegistry.getService("orion.core.preference").getPreferences("/operations").then(function(b){b.put(f.Location,{Name:f.Name,expires:f.expires})});f.progressMonitor?f.progressMonitor.progress(f.Name):this._progressMonitorTool.generateOperationsInfo(this._operations,this._operationDeferrds)}};f.prototype.constructor=f;return{ProgressService:f}});
define("orion/operationsClient",["i18n!orion/operations/nls/messages","orion/Deferred"],function(j,k){function i(a,e,d){return a[e].apply(a,d)}function d(a){this._location=a}function a(){var a=new k;a.reject(j["No Matching OperationService for location:"]+this._location);return a}function g(a){this._services=[];this._patterns=[];this._operationListeners=[];this._currentLongpollingIds=[];this._preferenceService=a.getService("orion.core.preference");for(var e=a.getServiceReferences("orion.core.operation"),
h=0;h<e.length;h++){var c=a.getService(e[h]);this._services[h]=c;c=e[h].getProperty("pattern")||".*";c[0]!=="^"&&(c="^"+c);this._patterns[h]=RegExp(c)}this._getService=function(b){if(!b)return this._services[0];for(var a=0;a<this._patterns.length;++a)if(this._patterns[a].test(b))return this._services[a];this._operations.remove(b);return new d(b)}}d.prototype={getOperation:a,getOperations:a,removeCompletedOperations:a,removeOperation:a,cancelOperation:a};d.prototype.constructor=d;g.prototype={getOperations:function(){var a=
new k;if(this._operations)return a.resolve(this._operations),a;var e=this;this._preferenceService.getPreferences("/operations").then(function(d){e._operations=d;a.resolve(e._operations)});return a},getOperation:function(a){return i(this._getService(a),"getOperation",arguments)},removeCompletedOperations:function(){for(var a=[],e=this,d=0;d<this._services.length;d++){var c=this._patterns[d],b=new k;a[d]=b.promise;i(this._services[d],"removeCompletedOperations").then(function(b){return function(a){Array.isArray(a)&&
e.getOperations.bind(e)().then(function(e){for(var f=e.keys(),d=0;d<f.length;d++){var h=f[d];c.test(h)&&a.indexOf(h)<0&&e.remove(h)}b.resolve()})}}(b),function(b){return function(a){b.reject(a)}}(b))}return k.all(a)},removeOperation:function(a){var e=this;return i(this._getService(a),"removeOperation",arguments).then(function(){e.getOperations.bind(e)().then(function(e){e.remove(a)})},function(a){return a},function(a){return a})}};g.prototype.constructor=g;return{OperationsClient:g}});
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(j,k){var i={root:k};Object.keys(j).forEach(function(d){typeof i[d]==="undefined"&&(i[d]=j[d])});return i});
define("orion/webui/treetable",["i18n!orion/nls/messages","orion/webui/littlelib"],function(j,k){function i(d){this._init(d)}i.prototype={_init:function(d){var a=d.parent,g=this,a=k.node(a);if(!a)throw j["no parent"];if(!d.model)throw j["no tree model"];if(!d.renderer)throw j["no renderer"];this._parent=a;this._treeModel=d.model;this._onComplete=d.onComplete;this._renderer=d.renderer;this._showRoot=d.showRoot===void 0?!1:d.showRoot;this._indent=d.indent===void 0?16:d.indent;this._onCollapse=d.onCollapse;
this._labelColumnIndex=d.labelColumnIndex===void 0?0:d.labelColumnIndex;this._id=d.id===void 0?"treetable":d.id;this._tableStyle=d.tableStyle;this._tableElement=d.tableElement||"table";this._tableBodyElement=d.tableBodyElement||"tbody";this._tableRowElement=d.tableRowElement||"tr";this._root=this._treeModel.getRoot(function(a){g._showRoot?(a._depth=0,g._generate([a],0)):g._treeModel.getChildren(a,function(a){g.destroyed||g._generate(a,0)})})},destroy:function(){this.destroyed=!0},_generate:function(d,
a){k.empty(this._parent);var g=document.createElement("div");this._renderer.wrapperCallback&&this._renderer.wrapperCallback(g);var f=document.createElement(this._tableElement);this._renderer.tableCallback&&this._renderer.tableCallback(f);f.id=this._id;this._tableStyle&&f.classList.add(this._tableStyle);this._renderer.initTable(f,this);this._bodyElement=document.createElement(this._tableBodyElement);this._renderer.bodyCallback&&this._renderer.bodyCallback(this._bodyElement);this._bodyElement.id=this._id+
"tbody";d.length===0?this._renderer.emptyCallback&&this._renderer.emptyCallback(this._bodyElement):this._generateChildren(d,a);f.appendChild(this._bodyElement);g.appendChild(f);this._parent.appendChild(g);this._rowsChanged();this._onComplete&&this._onComplete(this)},_generateChildren:function(d,a,g){for(var f=0;f<d.length;f++){var e=document.createElement(this._tableRowElement);e.id=this._treeModel.getId(d[f]);e._depth=a;e._item=d[f];this._renderer.render(d[f],e);e.childNodes[this._labelColumnIndex].style.paddingLeft=
this._indent*a+"px";this._renderer.rowCallback&&this._renderer.rowCallback(e,d[f]);g?(this._bodyElement.insertBefore(e,g.nextSibling),g&&(g=e)):this._bodyElement.appendChild(e)}},_rowsChanged:function(){this._renderer.rowsChanged&&this._renderer.rowsChanged()},getSelected:function(){return this._renderer.getSelected()},refresh:function(d,a,g){var f=this._treeModel.getId(d),e;if(f===this._id)this._removeChildRows(f),this._generateChildren(a,0),this._rowsChanged();else{var h=k.node(f);h?(h._item=d,
h&&(g||h._expanded)?(this._removeChildRows(f),a?(h._expanded=!0,this._renderer.updateExpandVisuals(h,!0),this._generateChildren(a,h._depth+1,h),this._rowsChanged()):(e=this,this._renderer.updateExpandVisuals(h,"progress"),a=this._treeModel.getChildren(h._item,function(a){if(!e.destroyed&&(e._renderer.updateExpandVisuals(h,!0),!h._expanded))h._expanded=!0,e._generateChildren(a,h._depth+1,h),e._rowsChanged()}))):this._renderer.updateExpandVisuals(h,!1)):console.log(j["could not find table row "]+f)}},
getItem:function(d){var a=k.node(d);return a&&a._item?a._item:d},toggle:function(d){var a=k.node(d);a&&(a._expanded?this.collapse(d):this.expand(d))},isExpanded:function(d){d=typeof d==="string"?d:this._treeModel.getId(d);return(d=k.node(d))?d._expanded:!1},expand:function(d,a,g){var d=typeof d==="string"?d:this._treeModel.getId(d),f=k.node(d);if(f)if(f._expanded)a&&a.apply(e,g);else{var e=this;this._renderer.updateExpandVisuals(f,"progress");this._treeModel.getChildren(f._item,function(d){if(!e.destroyed){e._renderer.updateExpandVisuals(f,
!0);if(!f._expanded)f._expanded=!0,e._generateChildren(d,f._depth+1,f),e._rowsChanged();a&&a.apply(e,g)}})}},_removeChildRows:function(d){for(var a=d===this._id,g=!1,f=-1,e=[],h=k.$$array(".treeTableRow",this._parent),c=0;c<h.length;c++){var b=h[c];if(g)break;if(a)b._depth>f?e.push(b):g=!0;else if(b.id===d)a=!0,f=b._depth}for(d=0;d<e.length;d++)a=e[d],a.parentNode.removeChild(a)},collapse:function(d){var d=typeof d==="string"?d:this._treeModel.getId(d),a=k.node(d);if(a){if(!a._expanded)return;a._expanded=
!1;this._renderer.updateExpandVisuals(a,!1);this._removeChildRows(d);this._rowsChanged()}this._onCollapse&&this._onCollapse(a._item)},getIndent:function(){return this._indent}};i.prototype.constructor=i;return{TableTree:i}});
define("orion/treeModelIterator",[],function(){var j={};j.TreeModelIterator=function(){function j(i,d){this.firstLevelChildren=i;this.reset();this._init(d)}j.prototype={_init:function(i){if(i)this.isExpanded=i.isExpanded,this.isExpandable=i.isExpandable,this.forceExpandFunc=i.forceExpandFunc,this.getChildrenFunc=i.getChildrenFunc},topLevel:function(i){return i.parent?i.parent===this.root:!0},_getChildren:function(i){return typeof this.getChildrenFunc==="function"?this.getChildrenFunc(i):i?i.children:
null},_expanded:function(i){if(!i)return!0;var d=this._getChildren(i),d=d&&d.length>0;this.isExpanded&&d&&(d=this.isExpanded(i));return d},_expandable:function(i){return!i?!0:this.isExpandable?this.isExpandable(i):!1},_diveIn:function(i){return this._expanded(i)?(this.setCursor(this._getChildren(i)[0]),this.cursor()):null},_drillToLast:function(i){return this._expanded(i)?(i=this._getChildren(i),this._drillToLast(i[i.length-1])):i},_forward:function(i){if(!this._cursor)return null;var d=this._diveIn(this._cursor);
if(!d){if(i&&this._expandable(this._cursor)&&this.forceExpandFunc){var a=this;return this.forceExpandFunc(this._cursor,"first",function(d){d&&a.setCursor(d)})}(d=this._findSibling(this._cursor,!0))&&this.setCursor(d)}return d},_backward:function(i){if(!this._cursor)return null;var d=this._findSibling(this._cursor,!1);d&&d!==this._cursor.parent&&(d=this._drillToLast(d));if(i&&d&&this._expandable(d)&&this.forceExpandFunc&&d!==this._cursor.parent){var a=this;return this.forceExpandFunc(d,"last",function(d){d&&
a.setCursor(d)})}d&&this.setCursor(d);return d},_findSibling:function(i,d){for(var a=this.topLevel(i),g=this._getChildren(i.parent),g=a?this.firstLevelChildren:g,f=0;f<g.length;f++)if(g[f]===i)return f===0&&!d?a?null:i.parent:f===g.length-1&&d?a?null:this._findSibling(i.parent,d):d?g[f+1]:g[f-1];return null},_inParentChain:function(i,d){for(var a=i.parent;a;){if(a===d)return!0;a=a.parent}return!1},_getTopLevelParent:function(i){if(this.topLevel(i))return i;for(i=i.parent;i;){if(this.topLevel(i))return i;
i=i.parent}return null},_onCollapse:function(i){return this._expanded(i.parent)?i:this._onCollapse(i.parent)},_scan:function(i,d,a){this.setCursor(d);var g=[];for(g.push(d);;){if(this.iterate(i))g.push(this.cursor());else break;if(a===this.cursor())return g}return null},setCursor:function(i){this._prevCursor=this._cursor;this._cursor=i},setTree:function(i){this.firstLevelChildren=i;if(this.firstLevelChildren.length>0)this.root=this.firstLevelChildren[0].parent},scan:function(i,d){var a=this.cursor(),
g=this._scan(!0,i,d);g||(g=this._scan(!1,i,d));this.setCursor(a);return g},iterate:function(i,d){return i?this._forward(d):this._backward(d)},iterateOnTop:function(i,d){var a=this._findSibling(this._getTopLevelParent(this.cursor()),i);a?this.setCursor(a):d&&this.firstLevelChildren.length>0&&this.setCursor(i?this.firstLevelChildren[0]:this.firstLevelChildren[this.firstLevelChildren.length-1])},collapse:function(i){if(!this._cursor)return null;return this._inParentChain(this._cursor,i)?(this.setCursor(i),
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 j}();return j});
define("orion/explorers/explorerNavHandler",["orion/webui/littlelib","orion/treeModelIterator","orion/uiUtils"],function(j,k,i){var d={},a=navigator.userAgent.indexOf("iPad")!==-1,g=window.navigator.platform.indexOf("Mac")!==-1;d.ExplorerNavHandler=function(){function f(a,f,c){this.explorer=a;this.model=this.explorer.model;this._navDict=f;this._listeners=[];this._selections=[];this._currentColumn=0;a=this._getEventListeningDiv();a.tabIndex=0;a.classList.add("selectionModelContainer");var b=this;this._modelIterator=
new k.TreeModelIterator([],{isExpanded:this.isExpanded.bind(this),getChildrenFunc:c.getChildrenFunc,isExpandable:this.explorer.renderer.isExpandable?function(a){return b.explorer.renderer.isExpandable(a)}:function(a){return b.isExpandable(a)},forceExpandFunc:this.explorer.forceExpandFunc?function(a,c,e){return b.explorer.forceExpandFunc(a,c,e)}:void 0});this._init(c);(!c||c.setFocus!==!1)&&a.focus();c=function(a){if(i.isFormElement(a.target))return!0;if(b.explorer.preventDefaultFunc&&b.explorer.preventDefaultFunc(a,
b._modelIterator.cursor()))return!0;if(a.keyCode===j.KEY.DOWN)return b.onDownArrow(a);else if(a.keyCode===j.KEY.UP)return b.onUpArrow(a);else if(a.keyCode===j.KEY.RIGHT)return b.onRightArrow(a);else if(a.keyCode===j.KEY.LEFT)return b.onLeftArrow(a);else if(a.keyCode===j.KEY.SPACE)return b.onSpace(a);else if(a.keyCode===j.KEY.ENTER)return b.onEnter(a)};a.addEventListener("keydown",c,!1);this._listeners.push({type:"keydown",listener:c});c=function(){if(b.explorer.onFocus)b.explorer.onFocus(!1);else b.toggleCursor(null,
!1)};a.addEventListener("blur",c,!1);this._listeners.push({type:"blur",listener:c});c=function(){if(b.explorer.onFocus)b.explorer.onFocus(!0);else b.toggleCursor(null,!0)};a.addEventListener("focus",c,!1);this._listeners.push({type:"focus",listener:c});this._parentDiv=a}f.prototype={destroy:function(){this._parentDiv.classList.remove("selectionModelContainer");this.removeListeners()},_init:function(a){this._linearGridMove=!1;if(a)this._selectionPolicy=a.selectionPolicy,this.gridClickSelectionPolicy=
a.gridClickSelectionPolicy||"none",this.preventDefaultFunc=a.preventDefaultFunc,this.postDefaultFunc=a.postDefaultFunc},_ctrlKeyOn:function(a){return g?a.metaKey:a.ctrlKey},removeListeners:function(){if(this._listeners)for(var a=0;a<this._listeners.length;a++)this._parentDiv.removeEventListener(this._listeners[a].type,this._listeners[a].listener,!1)},focus:function(){var a=this._getEventListeningDiv();a&&a.focus()},_getEventListeningDiv:function(a){return this.explorer.keyEventListeningDiv&&typeof this.explorer.keyEventListeningDiv===
"function"?this.explorer.keyEventListeningDiv(a):j.node(this.explorer._parentId)},isExpandable:function(a){return!a?!1:j.node(this.explorer.renderer.expandCollapseImageId(this.model.getId(a)))?!0:!1},isExpanded:function(a){return!a?!1:this.explorer.myTree.isExpanded(this.model.getId(a))},refreshSelection:function(a,f){var c=this;this.explorer.selection&&this.explorer.selection.getSelections(function(b){c._clearSelection(f);for(var d=0;d<b.length;d++)c._selections.push(b[d]);c._selections.length>0?
c.cursorOn(c._selections[0],!0,!1,a):c.cursorOn(null,!1,!1,a);if(!(c._shiftSelectionAnchor&&c._inSelection(c._shiftSelectionAnchor)>=0))c._shiftSelectionAnchor=null})},refreshModel:function(a,f,c,b){this._currentColumn=0;this.topIterationNodes=[];this.model=f;this._navDict=a;if(this.model.getTopIterationNodes)this.topIterationNodes=this.model.getTopIterationNodes();else if(c)this.topIterationNodes=c;this._modelIterator.setTree(this.topIterationNodes);!b&&this.explorer.selection&&(this.toggleCursor(this._modelIterator.cursor(),
!1),this._modelIterator.reset());this.refreshSelection(!0)},getTopLevelNodes:function(){return this._modelIterator.firstLevelChildren},_inSelection:function(a){for(var a=this.model.getId(a),f=0;f<this._selections.length;f++)if(a===this.model.getId(this._selections[f]))return f;return-1},_clearSelection:function(a){if(a)for(a=0;a<this._selections.length;a++)this._checkRow(this._selections[a],!0);this._selections=[]},getSelectionPolicy:function(){return this._selectionPolicy},setSelectionPolicy:function(a){if(this._selectionPolicy!==
a)this._selectionPolicy=a,this._selectionPolicy==="cursorOnly"&&this._clearSelection(!0)},setSelection:function(a,f,c){if(this._selectionPolicy==="cursorOnly")f&&this.explorer.renderer._useCheckboxSelection&&this._checkRow(a,!0);else if(this._isRowSelectable(a)){!f||this._selectionPolicy==="singleSelection"?(this._clearSelection(!0),this._checkRow(a,!1),this._selections.push(a),this._lastSelection=a):(f=this._inSelection(a),f>=0?(this._checkRow(a,!0),this._selections.splice(f,1)):(this._checkRow(a,
!1),this._selections.push(a),this._lastSelection=a));if(c)this._shiftSelectionAnchor=this._lastSelection;this.explorer.selection&&(this.explorer.renderer.storeSelections(),this.explorer.selection.setSelections(this._selections))}},moveColumn:function(a,f){a||(a=this.currentModel());var c=this._getGridChildren(a);if(c&&c.length>1||f===0&&c){f!==0&&this.toggleCursor(a,!1);var b=this._currentColumn,d=!0;b+=f;b<0?(this._linearGridMove&&f!==0&&(this._modelIterator.iterate(!1)?a=this.currentModel():d=!1),
b=d?c.length-1:this._currentColumn):b>=c.length&&(this._linearGridMove&&f!==0&&(this._modelIterator.iterate(!0)?a=this.currentModel():d=!1),b=d?0:this._currentColumn);this._currentColumn=b;f!==0&&this.toggleCursor(a,!0);return!0}return!1},_getGridChildren:function(a){return this._navDict?this._navDict.getGridNavHolder(a):null},getCurrentGrid:function(a){a||(a=this.currentModel());return(a=this._getGridChildren(a))&&a.length>0?a[this._currentColumn]:null},getAriaContainerElement:function(a){for(var f=
this._parentDiv,c;a&&a!==f&&(c=a.getAttribute("role"))!=="grid"&&c!=="tree"&&c!=="treegrid";)a=a.parentNode;return a===f?null:a},toggleCursor:function(a,f){var c=this.getRowDiv(a),b=this.getCurrentGrid(a);b?(c&&(f?c.classList.add("treeIterationCursorRow"):c.classList.remove("treeIterationCursorRow")),b.domNode&&(c=this.getAriaContainerElement(b.domNode),f?(b.domNode.classList.add("treeIterationCursor"),c&&c.setAttribute("aria-activedescendant",b.domNode.id)):b.domNode.classList.remove("treeIterationCursor"))):
c&&(f?c.classList.add("treeIterationCursorRow_Dotted"):c.classList.remove("treeIterationCursorRow_Dotted"))},currentModel:function(){return this._modelIterator.cursor()},cursorOn:function(a,f,c,b){var d,g;if(a||f){if(g===this._modelIterator.cursor())return;d=this._modelIterator.cursor();g=a;this._modelIterator.setCursor(g)}else d=this._modelIterator.prevCursor(),g=this._modelIterator.cursor();if(d!==g||f)if(this.toggleCursor(d,!1),!f||g){this.moveColumn(null,0);this.toggleCursor(g,!0);if((a=this.getRowDiv())&&
!b){b=a.parentNode;for(f=document.documentElement;b&&b!==f;){var i=window.getComputedStyle(b,null);if(!i)break;i=i.getPropertyValue("overflow-y");if(i==="auto"||i==="scroll")break;b=b.parentNode}b&&(f=!0,a.offsetTop<=b.scrollTop?(f=!1,c===void 0&&(c=!1)):a.offsetTop+a.offsetHeight>=b.scrollTop+b.clientHeight&&(f=!1,c===void 0&&(c=!0)),f||a.scrollIntoView(!c))}if(this.explorer.onCursorChanged)this.explorer.onCursorChanged(d,g)}},getSelection:function(){return this._selections},getSelectionIds:function(){for(var a=
[],f=0;f<this._selections.length;f++)a.push(this.model.getId(this._selections[f]));return a},getRowDiv:function(a){a=a?a:this._modelIterator.cursor();if(!a)return null;var a=this.model.getId(a),f=this._navDict.getValue(a);return f&&f.rowDomNode?f.rowDomNode:j.node(a)},iterate:function(a,f,c,b){var d=null;if(this.topIterationNodes&&this.topIterationNodes.length!==0)if(b){b=this.currentModel();for((d=this._modelIterator.iterate(a,f))&&this._setCursorOnItem(a,c);d&&d.isNotSelectable;)(d=this._modelIterator.iterate(a,
f))&&this._setCursorOnItem(a,c);d||(this.cursorOn(b,!0,!1,!0),this._setCursorOnItem(a,c))}else(d=this._modelIterator.iterate(a,f))&&this._setCursorOnItem(a,c)},_setCursorOnItem:function(a,f){this.cursorOn(null,!1,a);if(f){var c=this._inSelection(this._modelIterator.prevCursor()),b=this._inSelection(this._modelIterator.cursor());c>=0&&b>=0?this.setSelection(this._modelIterator.prevCursor(),!0):this.setSelection(this.currentModel(),!0)}},_checkRow:function(a,f){if(this.explorer.renderer._useCheckboxSelection&&
this._selectionPolicy!=="singleSelection"){var c=this.getRowDiv(a);if(c){var b=j.node(this.explorer.renderer.getCheckBoxId(c.id)),d=f?!b.checked:!0;if(d!==b.checked)this.explorer.renderer.onCheck(c,b,d,!0)}}else this._select(a,f)},_select:function(a){a||(a=this._modelIterator.cursor());var f=this.getRowDiv(a);f&&(this._inSelection(a)<0?f.classList.add("checkedRow"):f.classList.remove("checkedRow"))},_onModelGrid:function(a,f){var c=this._getGridChildren(a);if(c)for(var b=0;b<c.length;b++)if(f.target===
c[b].domNode)return!0;return!1},onClick:function(e,f){if(this.isDisabled(this.getRowDiv(e)))j.stop(f);else{var c=j.node(this.explorer.renderer.expandCollapseImageId(this.model.getId(e)));if(f.target!==c&&!(this.gridClickSelectionPolicy==="none"&&this._onModelGrid(e,f)))if(this.cursorOn(e,!0,!1,!0),a)this.setSelection(e,!0);else if(this._ctrlKeyOn(f))this.setSelection(e,!0,!0);else if(f.shiftKey&&this._shiftSelectionAnchor){if(c=this._modelIterator.scan(this._shiftSelectionAnchor,e)){this._clearSelection(!0);
for(var b=0;b<c.length;b++)this.setSelection(c[b],!0)}}else this.setSelection(e,!1,!0)}},onCollapse:function(a){this._modelIterator.collapse(a)&&this.cursorOn()},onUpArrow:function(a){this.iterate(!1,!1,a.shiftKey,!0);!this._ctrlKeyOn(a)&&!a.shiftKey&&this.setSelection(this.currentModel(),!1,!0);a.preventDefault();return!1},onDownArrow:function(a){this.iterate(!0,!1,a.shiftKey,!0);!this._ctrlKeyOn(a)&&!a.shiftKey&&this.setSelection(this.currentModel(),!1,!0);a.preventDefault();return!1},_shouldMoveColumn:function(a){var f=
this.currentModel(),c=this._getGridChildren(f);return c&&c.length>1?this.isExpandable(f)?this._ctrlKeyOn(a):!0:!1},onLeftArrow:function(a){if(this._shouldMoveColumn(a))return this.moveColumn(null,-1),a.preventDefault(),!0;var f=this._modelIterator.cursor();if(!f)return!1;if(this.isExpandable(f)&&this.isExpanded(f))return this.explorer.myTree.collapse(f),a.preventDefault(),!0;this._modelIterator.topLevel(f)?this.explorer.scopeUp&&typeof this.explorer.scopeUp==="function"&&this.explorer.scopeUp():(this.cursorOn(f.parent),
this.setSelection(f.parent,!1,!0))},onRightArrow:function(a){if(this._shouldMoveColumn(a))return this.moveColumn(null,1),a.preventDefault(),!0;var f=this._modelIterator.cursor();if(!f)return!1;if(this.isExpandable(f)&&!this.isExpanded(f))return this.explorer.myTree.expand(f),this.explorer.postUserExpand&&this.explorer.postUserExpand(this.model.getId(f)),a.preventDefault(),!1},_isRowSelectable:function(a){return this.explorer.isRowSelectable?this.explorer.isRowSelectable(a):!0},onSpace:function(a){this.setSelection(this.currentModel(),
!0,!0);a.preventDefault()},onEnter:function(a){var f=this.getCurrentGrid(this._modelIterator.cursor());if(f)if(f.widget)if(typeof f.onClick==="function")f.onClick();else typeof f.widget.focus==="function"&&f.widget.focus();else{var c=document.createEvent("MouseEvents");c.initMouseEvent("click",!0,!0,window,0,0,0,0,0,this._ctrlKeyOn(a),!1,!1,!1,0,null);f.domNode.dispatchEvent(c)}else if(f=this._modelIterator.cursor()){if(this.explorer.renderer.getRowActionElement&&(c=this.explorer.renderer.getRowActionElement(this.model.getId(f)),
c.href))this._ctrlKeyOn(a)?window.open(c.href):window.location.href=c.href;if(this.explorer.renderer.performRowAction)return this.explorer.renderer.performRowAction(a,f),a.preventDefault(),!1}},setIsNotSelectable:function(a,f){a.isNotSelectable=f},disableItem:function(a){var f=this.getRowDiv(a);this.isExpandable(a)&&this.isExpanded(a)&&(this._modelIterator.collapse(a),this.explorer.myTree.toggle(f.id));f.classList.remove("checkedRow");f.classList.add("disabledNavRow");this.setIsNotSelectable(a,!0)},
isDisabled:function(a){return a.classList.contains("disabledNavRow")},enableItem:function(a){var f=this.getRowDiv(a);f&&(f.classList.remove("disabledNavRow"),this.setIsNotSelectable(a,!1))}};return f}();d.ExplorerNavDict=function(){function a(e){this._dict={};this._model=e}a.prototype={addRow:function(a,f){this._dict[this._model.getId(a)]={model:a,rowDomNode:f}},getValue:function(a){return this._dict[a]},getGridNavHolder:function(a,f){if(!a)return null;var c=this._model.getId(a);if(this._dict[c]){if(!this._dict[c].gridChildren&&
f)this._dict[c].gridChildren=[];return this._dict[c].gridChildren}return null},initGridNavHolder:function(a){if(!a)return null;a=this._model.getId(a);if(this._dict[a])this._dict[a].gridChildren=null}};return a}();return d});
define("orion/explorers/explorer","i18n!orion/nls/messages,require,orion/webui/littlelib,orion/webui/treetable,orion/explorers/explorerNavHandler,orion/commands".split(","),function(j,k,i,d,a,g){var f={};f.Explorer=function(){function e(a,c,b,e){this.registry=a;this.renderer=b;this.selection=c;this.commandService=e;if(this.renderer)this.renderer.explorer=this;this.myTree=null}e.prototype={destroy:function(){this._navHandler&&this._navHandler.destroy();this.model&&this.model.destroy();this.myTree&&
this.myTree.destroy();this.destroyed=!0},changedItem:function(a,c){this.myTree&&this.myTree.refresh.bind(this.myTree)(a,c,!0)},updateCommands:function(a){this.myTree&&this.myTree._renderer.updateCommands.bind(this.myTree._renderer)(a)},makeNewItemPlaceHolder:function(a,c,b,e){a=this.getRow(a);if(b)return a=a.childNodes[b],a.appendChild(document.createElement("br")),e=document.createElement("span"),e.id=c+"placeHolderRow",a.appendChild(e),{tempNode:e,refNode:e};if(a){var f=document.createElement("tr");
f.id=c+"placeHolderRow";b=document.createElement("td");b.id=c+"placeHolderCol";f.appendChild(b);e?(a.parentNode.insertBefore(f,a.nextSibling),a=parseInt(a.firstChild.style.paddingLeft),b.style.paddingLeft=this.myTree.getIndent()+a+"px"):a.appendChild(f);e=i.node(c+"placeHolderRow");a=i.node(c+"placeHolderCol");if(e&&a)return{tempNode:e,refNode:a}}return null},getRow:function(a){if(a=this.model.getId(a))return i.node(a)},collapseAll:function(){for(var a=this._navHandler.getTopLevelNodes(),c=0;c<a.length;c++)this.myTree.collapse(a[c])},
expandAll:function(a){if(a)this._expandRecursively(a);else if(this._navHandler)for(var a=this._navHandler.getTopLevelNodes(),c=0;c<a.length;c++)this._expandRecursively(a[c])},_expandRecursively:function(a){if(this._navHandler&&this._navHandler.isExpandable(a)){var c=this;this.myTree.expand(a,function(){c.model.getChildren(a,function(a){if(!(a===void 0||a===null))for(var e=a.length,f=0;f<e;f++)c._expandRecursively(a[f])})})}},createTree:function(e,c,b){e=typeof e==="string"?e:e.id||e;this.selection&&
this.selection.setSelections([]);this.getNavHandler()&&this.getNavHandler()._clearSelection();var f=e+"innerTree",g=i.node(f);g&&i.empty(g);if(c)c.rootId=f;this.model=c;this._parentId=e;this._treeOptions=b;if(!b||b&&!b.noSelection)this.selectionPolicy=b?b.selectionPolicy:"",this._navDict=new a.ExplorerNavDict(this.model);this.myTree=new d.TableTree({id:f,model:c,parent:e,onComplete:b?b.onComplete:void 0,labelColumnIndex:this.renderer.getLabelColumnIndex(),renderer:this.renderer,showRoot:b?!!b.showRoot:
!1,indent:b?b.indent:void 0,onCollapse:b?b.onCollapse:void 0,navHandlerFactory:b?b.navHandlerFactory:void 0,tableElement:b?b.tableElement:void 0,tableBodyElement:b?b.tableBodyElement:void 0,tableRowElement:b?b.tableRowElement:void 0});this.renderer._initializeUIState();this.selectionPolicy==="cursorOnly"&&this.initNavHandler()},getNavHandler:function(){return this._navHandler},getNavDict:function(){return this._navDict},refreshSelection:function(){if(this.selection){var a=this.getNavHandler(),c=[];
if(a&&this.getNavDict())for(var b=a.getSelection(),e=0;e<b.length;e++){var f=a.getRowDiv(b[e]);f&&f.parentNode&&(f=this.getNavDict().getValue(this.model.getId(b[e])),f.model&&c.push(f.model))}this.selection.setSelections(c)}},getRootPath:function(){return this.model&&this.model.root?this.model.root.Location:null},initNavHandler:function(){var e=this._treeOptions;if(!e||e&&!e.noSelection){if(!this.getNavHandler())this._navHandler=e&&e.navHandlerFactory&&typeof e.navHandlerFactory.createNavHandler===
"function"?e.navHandlerFactory.createNavHandler(this,this._navDict,e):new a.ExplorerNavHandler(this,this._navDict,{getChildrenFunc:e?e.getChildrenFunc:null,setFocus:e&&e.setFocus,selectionPolicy:e?e.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);e&&e.setFocus&&c.getNavHandler().cursorOn(null,!1,!1,!0)})}},
_lastHash:null,checkbox:!1};return e}();f.createExplorerCommands=function(a,f){function c(a){return typeof a.getItemCount==="function"?a.getItemCount()>0?f?f(a):!0:!1:!1}var b=new g.Command({tooltip:j["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 g.Command({tooltip:j["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()}});a.addCommand(b);a.addCommand(d)};f.ExplorerModel=function(){function a(e,c,b){this.rootPath=e;this.fetchItems=c;this.idPrefix=b||""}a.prototype={destroy:function(){this.destroyed=!0},getRoot:function(a){var c=this;this.fetchItems(this.rootPath).then(function(b){c.root=b;a(b)})},getChildren:function(a,c){a.Children?c(a.Children):a.ChildrenLocation?this.fetchItems(a.ChildrenLocation).then(function(b){a.Children=
b;c(b)}):c([])},getId:function(a){if(a.Location===this.root.Location)return this.rootId;for(var a=a.Location.replace(/[\\\/]/g,""),c=this.idPrefix,b=0;b<a.length;b++)c+=a[b].match(/[^\.\:\-\_0-9A-Za-z]/g)?a.charCodeAt(b):a[b];return c}};return a}();f.ExplorerFlatModel=function(){function a(e,c,b){this.rootPath=e;this.fetchItems=c;this.root=b}a.prototype=new f.ExplorerModel;a.prototype.getRoot=function(a){if(this.root)a(this.root);else{var c=this;this.fetchItems(this.rootPath).then(function(b){c.root=
b;a(b)})}};a.prototype.getChildren=function(a,c){a===this.root?c(this.root):c([])};return a}();f.ExplorerRenderer=function(){function a(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"}a.prototype={_init:function(a){if(a){this._useCheckboxSelection=a.checkbox===void 0?!1:a.checkbox;this.selectionPolicy=a.singleSelection?
"singleSelection":"";this._cachePrefix=a.cachePrefix;this.getCheckedFunc=a.getCheckedFunc;this.onCheckedFunc=a.onCheckedFunc;this._highlightSelection=!0;this._treeTableClass=a.treeTableClass||"treetable";if(a.highlightSelection===!1)this._highlightSelection=!1;if(!this.actionScopeId)this.actionScopeId=a.actionScopeId;if(!this.commandService)this.commandService=a.commandService}},getLabelColumnIndex:function(){return this.explorer.checkbox?1:0},initTable:function(a,c){this.tableTree=c;this.tableNode=
a;i.empty(a);this._treeTableClass&&a.classList.add(this._treeTableClass);this.renderTableHeader(a)},getActionsColumn:function(a,c,b,e,f){var b=b||"tool",d=document.createElement("td");d.id=c.id+"actionswrapper";e&&d.classList.add(e);this.actionScopeId&&this.commandService?this.commandService.renderCommands(this.actionScopeId,d,a,this.explorer,b,null,f&&this.explorer.getNavDict()?this.explorer.getNavDict().getGridNavHolder(a,!0):null):window.console.log("Warning, no command service or action scope was specified.  No commands rendered.");
return d},initCheckboxColumn:function(){if(this._useCheckboxSelection)return document.createElement("th")},getCheckboxColumn:function(a,c){if(this._useCheckboxSelection){var b=document.createElement("td"),e=document.createElement("span");e.id=this.getCheckBoxId(c.id);e.classList.add("core-sprite-check");e.classList.add("selectionCheckmarkSprite");e.rowId=c.id;if(this.getCheckedFunc)e.checked=this.getCheckedFunc(a),e.checked?(this._highlightSelection&&c.classList.add("checkedRow"),e.classList.add("core-sprite-check_on")):
(this._highlightSelection&&c.classList.remove("checkedRow"),e.classList.remove("core-sprite-check_on"));b.appendChild(e);var f=this;e.addEventListener("click",function(a){f.onCheck(c,a.target,a.target.checked?!1:!0,!0)},!1);return b}},getCheckBoxId:function(a){return a+"selectedState"},onCheck:function(a,c,b,e,f){(c.checked=b)?c.classList.add("core-sprite-check_on"):c.classList.remove("core-sprite-check_on");if(this.onCheckedFunc)this.onCheckedFunc(c.rowId,b,e);this.explorer.getNavHandler()&&f&&this.explorer.getNavHandler().setSelection(this.explorer.getNavDict().getValue(a.id).model,
!0)},storeSelections:function(){if(this.explorer.getNavHandler()){var a=this.explorer.getNavHandler().getSelectionIds(),c=this._getUIStatePreferencePath();c&&window.sessionStorage&&(window.sessionStorage[c+"selection"]=JSON.stringify(a))}},_restoreSelections:function(a){var c=this.explorer.getNavDict(),b=this.explorer.getNavHandler();if(b&&c&&b.getSelectionPolicy()!=="cursorOnly"&&(a=window.sessionStorage[a+"selection"],typeof a==="string"&&(a=a.length>0?JSON.parse(a):null),a)){for(var e=[],b=0;b<
a.length;b++){var f=c.getValue(a[b]);if(f&&f.rowDomNode&&f.model&&(e.push(f.model),this._highlightSelection&&f.rowDomNode.classList.add("checkedRow"),f=i.node(this.getCheckBoxId(f.rowDomNode.id))))f.checked=!0,f.classList.add("core-sprite-check_on")}this.explorer.selection&&(this.explorer.selection.setSelections(e),this.explorer.getNavHandler()&&this.explorer.getNavHandler().refreshSelection())}},_storeExpansions:function(a){window.sessionStorage[a+"expanded"]=JSON.stringify(this._expanded)},_restoreExpansions:function(a){var c=
!1,b=window.sessionStorage[a+"expanded"];typeof b==="string"&&(b=b.length>0?JSON.parse(b):null);var e;if(b)for(e=0;e<b.length;e++)if(i.node(b[e])){this._expanded.push(b[e]);var f=this;this.tableTree.expand(b[e],function(){f._restoreSelections(a)});c=!0}return!c},_getUIStatePreferencePath:function(){if(this.explorer){var a=this.explorer.getRootPath();if(this._cachePrefix&&a)return"/"+this._cachePrefix+"/"+a.replace(/[^\.\:\-\_0-9A-Za-z]/g,"")+"/uiState"}return null},expandCollapseImageId:function(a){return a+
"__expand"},updateExpandVisuals:function(a,c){var b=i.node(this.expandCollapseImageId(a.id));b&&(b.classList.remove(this._expandImageClass),b.classList.remove(this._collapseImageClass),b.classList.remove(this._progressImageClass),b.classList.add(c==="progress"?this._progressImageClass:c?this._expandImageClass:this._collapseImageClass))},getExpandImage:function(a,c,b,e){var f=document.createElement("span");f.id=this.expandCollapseImageId(a.id);c.appendChild(f);f.classList.add(this._twistieSpriteClass);
f.classList.add(this._collapseImageClass);if(b){var d=document.createElement("span");c.appendChild(d);d.classList.add(e||"imageSprite");d.classList.add(b)}var g=this;f.onclick=function(){if(!g.explorer.getNavHandler().isDisabled(a)){g.tableTree.toggle(a.id);if(g.tableTree.isExpanded(a.id))g._expanded.push(a.id),g.explorer.postUserExpand&&g.explorer.postUserExpand(a.id);else for(var b in g._expanded)if(g._expanded[b]===a.id){g._expanded.splice(b,1);break}(b=g._getUIStatePreferencePath())&&window.sessionStorage&&
g._storeExpansions(b)}};return f},render:function(a,c){c.classList.add("navRow");this.renderRow(a,c)},rowsChanged:function(){this.explorer.selectionPolicy!=="cursorOnly"&&(this.explorer.refreshSelection(),this.explorer.initNavHandler());(i.$(".sectionTreeTable",this.tableNode.parentNode)||i.$(".treetable",this.tableNode.parentNode))&&i.$$array(".treeTableRow",this.tableNode).forEach(function(a,c){var b=!(c%2)?"darkSectionTreeTableRow":"lightSectionTreeTableRow",e=b==="darkSectionTreeTableRow"?"lightSectionTreeTableRow":
"darkSectionTreeTableRow";a.classList.add(b);a.classList.remove(e)})},updateCommands:function(){if(this.commandService)for(var a=i.$$array(".treeTableRow"),c=0;c<a.length;c++){var b=a[c],e=i.node(b.id+"actionswrapper");this.commandService.destroy(e);this.actionScopeId&&this.commandService.renderCommands(this.actionScopeId,e,b._item,this.explorer,"tool")}},_initializeUIState:function(){this._expanded=[];var a=this._getUIStatePreferencePath();a&&window.sessionStorage&&this._restoreExpansions(a)&&this._restoreSelections(a)}};
return a}();f.SelectionRenderer=function(){function a(e,c){this._init(e);this.explorer=c}a.prototype=new f.ExplorerRenderer;a.prototype.renderTableHeader=function(a){var c=document.createElement("thead"),b=document.createElement("tr");c.classList.add("navTableHeading");this._useCheckboxSelection&&b.appendChild(this.initCheckboxColumn(a));for(var e=0,f=this.getCellHeaderElement(e);f;)f.innerHTML.length>0&&f.classList.add("navColumn"),b.appendChild(f),f=this.getCellHeaderElement(++e);c.appendChild(b);
e>0&&a.appendChild(c)};a.prototype.renderRow=function(a,c){c.verticalAlign="baseline";c.classList.add("treeTableRow");var b=this.explorer.getNavDict();if(b){b.addRow(a,c);var e=this;c.addEventListener("click",function(b){if(e.explorer.getNavHandler())e.explorer.getNavHandler().onClick(a,b)},!1)}if(b=this.getCheckboxColumn(a,c))b.classList.add("checkColumn"),c.appendChild(b);for(var b=0,f=this.getCellElement(b,a,c);f;)c.appendChild(f),b===0?this.getPrimColumnStyle?f.classList.add(this.getPrimColumnStyle(a)):
f.classList.add("navColumn"):this.getSecondaryColumnStyle?f.classList.add(this.getSecondaryColumnStyle()):f.classList.add("secondaryColumn"),f=this.getCellElement(++b,a,c)};a.prototype.getCellHeaderElement=function(){};a.prototype.getCellElement=function(){};return a}();f.SimpleFlatModel=function(){function a(e,c,b){this.items=e;this.getKey=b;this.idPrefix=c;this.root={children:e}}a.prototype=new f.ExplorerModel;a.prototype.getRoot=function(a){a(this.root)};a.prototype.getId=function(a){for(var a=
this.getKey(a).replace(/[\\\/]/g,""),c="",b=0;b<a.length;b++)c+=a[b].match(/[^\.\:\-\_0-9A-Za-z]/g)?a.charCodeAt(b):a[b];return this.idPrefix+c};a.prototype.getChildren=function(a,c){a===this.root?c(this.items):c([])};return a}();return f});
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(j,k,i,d,a,g,f,e){function h(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(b,c,e,d,i,j,p,t,v){var c=g.clone(c),n;if(c.Directory)n=document.createElement("a"),
n.className="navlinkonpage",n.href=!b?l:(new f(b+"#{,resource,params*}")).expand({resource:c.ChildrenLocation}),c.Name&&n.appendChild(document.createTextNode(c.Name));else{i||(i=a.getOpenWithCommands(e));n=document.createElement("a");n.className="navlink targetSelector";j&&typeof j==="object"&&Object.keys(j).forEach(function(a){n[a]=j[a]});var w=null,x=null;if(w=t?t.holderDom:n)x=document.createElement("span"),x.className="core-sprite-file modelDecorationSprite thumbnail",w.appendChild(x);c.Name&&
n.appendChild(document.createTextNode(c.Name));var y=c.Location;if(p&&typeof p==="object")c.params={},g.mixin(c.params,p);(b=a.getOpenWithCommand(e,c,i))&&(y=b.hrefCallback({items:c}));k.when(d.getFileContentType(c),function(a){if(w){var b=w,e=x;if(a){var f,d=a.imageClass,g=a.image;if(d)f=document.createElement("span"),f.className+=d,f.classList.add("thumbnail");else if(g)f=document.createElement("img"),f.src=g,f.classList.add("thumbnail");f&&b.replaceChild(f,e)}}n.href=y;v&&typeof v.updateFileNode===
"function"&&v.updateFileNode(c,n,h(a))})}return n}function b(a,b,c,e){this.explorer=b;this.commandService=c;this.contentTypeService=e;this.openWithCommands=null;this.actionScopeId=a.actionScopeId;this._init(a);this.target="_self"}var l=new f("#{,resource,params*}");b.prototype=new i.SelectionRenderer;b.prototype.wrapperCallback=function(a){a.setAttribute("role","tree")};b.prototype.tableCallback=function(a){a.setAttribute("aria-label",j.Navigator);a.setAttribute("role","presentation")};b.prototype.rowCallback=
function(a){a.setAttribute("role","treeitem")};b.prototype.emptyCallback=function(a){var b=document.createElement("tr"),c=document.createElement("td");c.colSpan=this.oneColumn?1:3;var f=document.createElement("div");f.classList.add("noFile");f.textContent=j.NoFile;var d=document.createElement("span");d.appendChild(document.createTextNode(j.File));e.processDOMNodes(f,[d]);c.appendChild(f);b.appendChild(c);a.appendChild(b)};b.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"}};b.prototype.setTarget=function(a){this.target=a};b.prototype.getFolderImage=function(){if(!this.showFolderImage)return null;var a=document.createElement("span");a.className="core-sprite-folder modelDecorationSprite";return a};b.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};b.prototype.updateFileNode=function(){};b.prototype.showFolderLinks=!0;b.prototype.getCellElement=function(b,e,f){switch(b){case 0:var b=document.createElement("td"),g=document.createElement("span");g.id=f.id+"MainCol";g.setAttribute("role","presentation");b.appendChild(g);b.setAttribute("role","presentation");g.className="mainNavColumn";var h;if(e.Directory)this.getExpandImage(f,g),h=this.createFolderNode(e),g.appendChild(h),this.explorer._makeDropTarget(e,
h),this.explorer._makeDropTarget(e,f);else{if(!this.openWithCommands)this.openWithCommands=a.getOpenWithCommands(this.commandService);h=c("",e,this.commandService,this.contentTypeService,this.openWithCommands,{target:this.target},null,null,this);g.appendChild(h)}if(h)h.id=f.id+"NameLink",h.nodeType===1&&(d.addNavGrid(this.explorer.getNavDict(),e,h),h.setAttribute("role","link"),h.setAttribute("tabindex","-1"));this.actionScopeId&&this.commandService.renderCommands(this.actionScopeId,g,e,this.explorer,
"tool",null,!0);return b;case 1:if(this.oneColumn)return null;f=document.createElement("td");if(e.LocalTimeStamp)f.textContent=(new Date(e.LocalTimeStamp)).toLocaleString();return f;case 2:if(this.oneColumn)return null;f=document.createElement("td");if(!e.Directory&&typeof e.Length==="number")e=parseInt(e.Length,10)/1024,f.textContent=Math.ceil(e).toLocaleString()+" KB";f.style.textAlign="right";return f}};b.prototype.constructor=b;return{NavigatorRenderer:b,isImage:h,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(j,k,i,d,a,g,f,e,h){function c(a,b){this.serviceRegistry=a;this.commandRegistry=b;this.openWithCommands=null}function b(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(b,c,g,r,q){var s=this.serviceRegistry,u=this.commandRegistry;this.openWithCommands=this.openWithCommands||e.createOpenWithCommands(s,b,u);var p=this;return function(e,s,n,w){h.when(p.openWithCommands,function(h){if(n)i.empty(c),h=document.createElement("div"),h.appendChild(document.createTextNode(j["Search failed."])),c.appendChild(h),typeof r==="function"&&r(c);else{var y=
function(){function a(b,c){var e=c.folderName?c.folderName:c.path,f=document.createElement("span");f.id=e.replace(/[^a-zA-Z0-9_\.:\-]/g,"");f.appendChild(document.createTextNode(" - "+e+" "));b.appendChild(f)}var b={};return function(c,e){var f=e.name;if(b.hasOwnProperty(f)){a(c,e);var n=b[f];typeof n==="function"&&(b[f]=null,n())}else b[f]=function(){a(c,e)}}}(),A=!1;i.empty(c);if(e&&e.length>0){var K=document.createElement("table");K.setAttribute("role","presentation");for(var J=0;J<e.length;J++){var I=
e[J],z;if(!A&&(A=!0,g))z=K.insertRow(0).insertCell(0),z.textContent=g;z=K.insertRow(-1).insertCell(0);z.colspan=2;q&&q(z);var F={Name:I.name,Directory:I.directory,Location:I.path||I.location},B=null;if(typeof I.LineNumber==="number")B={},B.line=I.LineNumber;if(w&&w.keyword&&!w.nameSearch){var p=a.generateSearchHelper(w),B=B||{};B.find=p.inFileQuery.searchStr;B.regEx=p.inFileQuery.wildCard?!0:void 0}F=f.createLink(k.toUrl("edit/edit.html"),F,u,b,h,{"aria-describedby":(I.folderName?I.folderName:I.path).replace(/[^a-zA-Z0-9_\.:\-]/g,
""),style:{verticalAlign:"middle"}},B);I.LineNumber&&F.appendChild(document.createTextNode(" (Line "+I.LineNumber+")"));z.appendChild(F);y(z,I)}c.appendChild(K);typeof r==="function"&&r(c)}!A&&s&&(h=d.formatMessage(j["No matches found for ${0}"],s),i.empty(c),c.appendChild(document.createTextNode(h)),typeof r==="function"&&r(c))}})}};b.prototype={search:function(b,c,e){var f=function(b){for(var e=[],f=0;f<b.response.docs.length;f++){var d=b.response.docs[f],g=d.Location,n=a.path2FolderName(d.Path?
d.Path:d.Location,d.Name),w=n?n:g;(c?w.indexOf(c)>=0:1)&&e.push({name:d.Name,path:g,folderName:n,directory:d.Directory,lineNumber:d.LineNumber})}return e};if(this._crawler&&b.nameSearch)this._crawler.searchName(b,function(a){e(f(a),b.keyword,null,b)});else try{this.registry.getService("orion.page.progress").progress(this._fileService.search(b),"Searching "+b.keyword).then(function(a){var c=b.keyword,c=c.substring(c.indexOf("}")+1),c=c.substring(c.indexOf(":")+1);e(f(a),c,null,b)},function(a){e(null,
null,a,null)})}catch(d){typeof d==="string"&&d.indexOf("search")>-1&&this._crawler?this._crawler.searchName(b,function(a){e(f(a),null,null,b)}):typeof d==="string"&&d.indexOf("search")>-1&&!b.nameSearch?(new g.SearchCrawler(this.registry,this._fileService,b,{childrenLocation:this.getChildrenLocation()})).search(function(a){e(f(a),null,null,b)}):this.registry.getService("orion.page.message").setErrorMessage(d)}},getFileService:function(){return this._fileService},setCrawler:function(a){this._crawler=
a},handleError:function(a,b){console.error(a);i.empty(b);b.appendChild(document.createTextNode(a));return a},setLocationByMetaData:function(a,b){var c="",e=null;this._searchRootLocation=this._fileService.fileServiceRootURL(a.Location);b&&a&&a.Parents&&a.Parents.length>0?e=b.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),c=e.Name,this._childrenLocation=e.ChildrenLocation;else if(a)this.setLocationbyURL(this._searchRootLocation),
c=this._fileService.fileServiceName(a.Location),this._childrenLocation=a.ChildrenLocation;e=i.node("search");c||(c="");if(e&&e.placeholder){e.value="";var f=d.formatMessage(j["Search ${0}"],c);e.placeholder=f.length>30?f.substring(0,27)+"...":d.formatMessage(j["Search ${0}"],c)}if(e&&e.title)e.title=j["Type a keyword or wild card to search in "]+c},setLocationbyURL:function(a){this._searchLocation=a},setRootLocationbyURL:function(a){this._searchRootLocation=a},setChildrenLocationbyURL:function(a){this._childrenLocation=
a},getSearchLocation:function(){return this._searchLocation?this._searchLocation:this._fileService.fileServiceRootURL()},getSearchRootLocation:function(){return this._searchRootLocation?this._searchRootLocation:this._fileService.fileServiceRootURL()},getChildrenLocation:function(){return this._childrenLocation?this._childrenLocation:this._fileService.fileServiceRootURL()},createSearchParams:function(a,b,c,e){c=c?this.getSearchRootLocation():this.getSearchLocation();return b?{resource:c,sort:"NameLower asc",
rows:100,start:0,nameSearch:!0,keyword:a}:{resource:c,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}}};b.prototype.constructor=b;return{Searcher: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(j,k){var i={root:k};Object.keys(j).forEach(function(d){typeof i[d]==="undefined"&&(i[d]=j[d])});return i});
define("orion/compare/compareCommands",["i18n!orion/compare/nls/messages","orion/commands","orion/keyBinding","orion/webui/littlelib"],function(j,k,i,d){var a={};a.CompareCommandFactory=function(){function a(f){this.setOptions(f,!0)}a.prototype={setOptions:function(a,e){if(e)this.options={};if(!this.options)this.options={};a&&Object.keys(a).forEach(function(e){this.options[e]=a[e]}.bind(this))},getOptions:function(){return this.options},initCommands:function(a){var e=this.options.commandSpanId,d=
this.options.commandService;if(d&&e){var c=new k.Command({name:j["Copy current change from right to left"],tooltip:j["Copy current change from right to left"],imageClass:"core-sprite-leftarrow",id:"orion.compare.copyToLeft",groupId:"orion.compareGroup",visibleWhen:function(){return a.type==="twoWay"&&!a.getImageMode()&&a.options.newFile&&!a.options.newFile.readonly}.bind(this),callback:function(a){a.items.copyToLeft()}}),b=new k.Command({name:j["Copy current change from left to right"],tooltip:j["Copy current change from left to right"],
imageClass:"core-sprite-rightarrow",id:"orion.compare.copyToRight",groupId:"orion.compareGroup",visibleWhen:function(){return a.type==="twoWay"&&!a.getImageMode()&&a.options.oldFile&&!a.options.oldFile.readonly}.bind(this),callback:function(a){a.items.copyToRight()}}),g=new k.Command({tooltip:j["Switch to unified diff"],name:j.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()}}),
m=new k.Command({tooltip:j["Switch to side by side diff"],name:j["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:j["Next diff block"],tooltip:j["Next diff block"],imageClass:"core-sprite-move-down",id:"orion.compare.nextDiff",groupId:"orion.compareGroup",visibleWhen:function(){return!a.getImageMode()},
callback:function(a){a.items.nextDiff()}}),r=new k.Command({name:j["Previous diff block"],tooltip:j["Previous diff block"],imageClass:"core-sprite-move-up",id:"orion.compare.prevDiff",groupId:"orion.compareGroup",visibleWhen:function(){return!a.getImageMode()},callback:function(a){a.items.prevDiff()}}),q=new k.Command({name:j["Next diff change"],tooltip:j["Next diff change"],imageClass:"core-sprite-move-down",id:"orion.compare.nextChange",groupId:"orion.compareGroup",visibleWhen:function(){return!a.getImageMode()},
callback:function(a){a.items.nextChange()}}),s=new k.Command({name:j["Previous diff change"],tooltip:j["Previous diff change"],imageClass:"core-sprite-move-up",id:"orion.compare.prevChange",groupId:"orion.compareGroup",visibleWhen:function(){return!a.getImageMode()},callback:function(a){a.items.prevChange(a)}});d.addCommand(c);d.addCommand(b);d.addCommand(m);d.addCommand(g);d.addCommand(o);d.addCommand(r);d.addCommand(q);d.addCommand(s);d.registerCommandContribution(e,"orion.compare.toggle2Inline",
108);d.registerCommandContribution(e,"orion.compare.toggle2TwoWay",109);d.registerCommandContribution(e,"orion.compare.copyToLeft",110,null,!1,new i.KeyBinding(37,!0,!1,!0));d.registerCommandContribution(e,"orion.compare.copyToRight",111,null,!1,new i.KeyBinding(39,!0,!1,!0));d.registerCommandContribution(e,"orion.compare.nextDiff",112,null,!1,new i.KeyBinding(40,!0));d.registerCommandContribution(e,"orion.compare.prevDiff",113,null,!1,new i.KeyBinding(38,!0));a.options.wordLevelNav?(d.registerCommandContribution(e,
"orion.compare.nextChange",114,null,!1,new i.KeyBinding(40,!0,!0)),d.registerCommandContribution(e,"orion.compare.prevChange",115,null,!1,new i.KeyBinding(38,!0,!0))):(d.registerCommandContribution(e,"orion.compare.nextChange",114,null,!0,new i.KeyBinding(40,!0,!0)),d.registerCommandContribution(e,"orion.compare.prevChange",115,null,!0,new i.KeyBinding(38,!0,!0)))}},renderCommands:function(a){var e=this.options.commandSpanId,g=this.options.commandService;g&&e&&(d.empty(d.node(e)),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),g.renderCommands(e,e,a,a,"tool",null,this.options.gridRenderer.navGridHolder)):(g.renderCommands(e,e,a,a,"tool",null,this.options.gridRenderer.navGridHolder),this.options.gridRenderer.additionalCmdRender(this.options.gridRenderer.navGridHolder)):
g.renderCommands(e,e,a,a,"tool",null,this.options.gridRenderer.navGridHolder)):g.renderCommands(e,e,a,a,"tool",null))}};return a}();return a});
define("orion/compare/compareUtils",["orion/URITemplate"],function(j){var k=k||{};k.compareUtils=k.compareUtils||{};k.compareUtils.lookUpMapper=function(i,d,a){for(var g=0,f=0;f<i.length;f++){var e=i[f][d];e===0&&(e=1);if(a>=g&&a<g+e)return{mapperIndex:f,startFrom:g};if(f===i.length-1)break;g+=i[f][d]}return{mapperIndex:i.length-1,startFrom:g}};k.compareUtils.lookUpLineIndex=function(i,d,a){if(a===0)return 0;for(var g=0,f=0;f<a;f++)g+=i[f][d];return g};k.compareUtils.updateMapper=function(i,d,a,g,
f){if(g!==f&&(g>0||f>0)){var e=k.compareUtils.lookUpMapper(i,d,a);if(!(e.mapperIndex<0)){if(g>0)for(var h=a-e.startFrom,a=e.mapperIndex;a<i.length;a++){h=i[a][d]-h;if(g<=h){i[a][d]-=g;break}i[a][d]-=h;g-=h;h=0}f>0&&(i[e.mapperIndex][d]+=f)}}};k.compareUtils.overlapMapper=function(i,d,a,g,f){i=a+i[d]-1;i<a&&(i=a);f<g&&(f=g);return i<g||f<a?!1:!0};k.compareUtils.findFirstDiff=function(i,d,a,g){for(var f=0,e=null,h=0;h<i.length;h++){if(f>g)break;if(k.compareUtils.overlapMapper(i[h],d,f,a,g)&&(e={mapperIndex:h,
startFrom:f},i[h][2]!==0))break;f+=i[h][d]}return e};k.compareUtils.matchMapper=function(i,d,a,g){if(i.length===0)return a;var f=a+Math.round((g-a)/3),e=k.compareUtils.findFirstDiff(i,d,a,g),h=i[e.mapperIndex][d]===0?e.startFrom:e.startFrom+i[e.mapperIndex][d]-1,c=k.compareUtils.lookUpLineIndex(i,1-d,e.mapperIndex),b=e.startFrom-a;return i[e.mapperIndex][2]===0?c-b:f>=e.startFrom&&f<=h?c-Math.round((g-a)/3):f<e.startFrom?c-b:(i[e.mapperIndex][1-d]===0?c:c+i[e.mapperIndex][1-d]-1)-(h-a)};k.compareUtils.getMapperLineCount=
function(i){for(var d=0,a=0;a<i.length;a++)d+=Math.max(i[a][0],i[a][1]);return d};k.compareUtils.getAnnotationIndex=function(i,d){for(var a=0;a<i.length;a++)if(i[a][0]===d)return a;return-1};k.compareUtils.getAnnotationMapperIndex=function(i,d){return i[d][1]};k.compareUtils.getAnnotationIndexByMapper=function(i,d){for(var a=0;a<i.length;a++)if(i[a][1]===d)return{current:a,prev:a-1,next:a+1};return{current:-1,prev:-1,next:-1}};k.compareUtils.isMapperConflict=function(i,d){return d<0?!1:!i[d][3]?!1:
i[d][3]===1};k.compareUtils.mergeDiffBlocks=function(i,d,a,g,f,e){for(var h=0;h<d.length;h++){var c=d[h][0],b=a[d[h][1]];if(b[0]>0){for(var l="",m=0;m<b[0];m++)l=l+g[b[2]-1+m].substring(f)+e;b=i.getLineCount();c>=b&&(c=i.getLineEnd(b-1),m=i.getLineEnd(b-1,!0),c===m?(i.setText(e,c,c),c=b):c=b-1);c=i.getLineStart(c);i.setText(l,c,c)}}};k.compareUtils.generateCompareHref=function(i,d){var a=require.toUrl("compare/compare.html");if(!d.conflict)d.conflict=void 0;if(!d.readonly)d.readonly=void 0;return(new j(a+
"#{,resource,params*}")).expand({resource:i,params:d})};k.compareUtils.generateCompareTreeHref=function(i,d){var a=require.toUrl("compare-tree/compare-tree.html");return(new j(a+"#{,resource,params*}")).expand({resource:i,params:d})};return k.compareUtils});
define("orion/compare/diffProvider",["i18n!orion/compare/nls/messages","orion/Deferred"],function(j,k){function i(a,d,f){var e=new k;a[d].apply(a,f).then(function(a){e.resolve(a)},function(a){e.reject(a)});return e}function d(a,d){var f=a.getServiceReferences("orion.core.diff"),e,h=f;if(d){h=[];for(e=0;e<f.length;++e)d(f[e])&&h.push(f[e])}var c=[],b=[];for(e=0;e<h.length;++e)c[e]=RegExp(h[e].getProperty("pattern")||".*"),b[e]=a.getService(h[e]);this._getService=function(a){if(a.indexOf("://")===-1){var e=
document.createElement("a");e.href=a;a=e.href}for(e=0;e<c.length;++e)if(c[e].test(a))return b[e];throw j["No Matching DiffService for location:"]+a;}}d.prototype={getDiffContent:function(a){return i(this._getService(a),"getDiffContent",arguments)},getDiffFileURI:function(a){return i(this._getService(a),"getDiffFileURI",arguments)}};return{DiffProvider:d}});
define("orion/compare/diffParser",[],function(){var j=j||{};j.DiffParser=function(){function j(d,a){this._lineDelimiter=d?d:i?"\r\n":"\n";this._diffLineDelimiter=a?a:this._lineDelimiter;this._DEBUG=!1}var i=window.navigator.platform.indexOf("Win")!==-1;j.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(d){this._diffLineDelimiter=this._lineDelimiter=d},getDiffArray:function(){return{array:this._diffContents,index:this._diffContentIndex}},parse:function(d,a,g,f){this._init();if(a==="")return{outPutFile:d,mapper:[]};this._oFileContents=d===""?[]:d.split(this._lineDelimiter);this._diffContents=a.split(this._diffLineDelimiter);a=this._diffContents.length;this._hunkRanges=[];for(var e=0;e<a;e++){var h=this._parseHunkRange(e);h&&this._hunkRanges.push(h)}if(0===this._hunkRanges.length)return{outPutFile:d,
mapper:[]};this._DEBUG&&(console.log("***Diff contents: \n"),this._diffContents.forEach(function(a){console.log(a)}),console.log("***Hunk ranges: \n"),console.log(JSON.stringify(this._hunkRanges)));for(d=0;d<this._hunkRanges.length;d++)this._parseHunkBlock(d);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(g);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));f||this._buildNewFile();return{outPutFile:this._nFileContents.join(this._diffLineDelimiter),mapper:this._deltaMap}},_logMap:function(){for(var d=0;d<this._deltaMap.length;d++)if(console.log(JSON.stringify(this._deltaMap[d])),
this._deltaMap[d][2]>0){console.log("    **Diff content on change/add: \n");for(var a=0;a<this._deltaMap[d][0];a++)console.log("    "+this._diffContents[this._deltaMap[d][2]+a-1])}},_logNewFile:function(){for(var d=0;d<this._nFileContents.length;d++)console.log(this._nFileContents[d])},_createBlock:function(d,a,g,f){f===g&&d===" "||(g=[g,f-g,"s"],d==="-"?g[2]="r":d==="+"?g[2]="a":d==="c"&&(g[2]="c"),a.push(g))},_createMinusBlock:function(d,a,g){var f=this._oBlocks.length;f===0||d!==this._oBlocks[f-
1][0]?(this._oBlocks.push([d===0?1:d,g]),this._nBlocks.push([a,0,-2])):this._oBlocks[f-1][1]+=g},_createPlusBlock:function(d,a,g,f){var e=this._nBlocks.length;e===0||a!==this._nBlocks[e-1][0]?(this._oBlocks.push([d===0?1:d,0]),this._nBlocks.push([a,g,f])):(this._nBlocks[e-1][1]+=g,this._nBlocks[e-1][2]=f)},_parseHunkBlock:function(d){for(var a=" ",g=this._hunkRanges[d][0]+1,f=d===this._hunkRanges.length-1?this._diffContents.length:this._hunkRanges[d+1][0],e=0,h=0,c=this._hunkRanges[d][1],b=this._hunkRanges[d][3],
l=g,m=g;m<f;m++)if(0!==this._diffContents[m].length){var i=this._diffContents[m][0];if(i==="\\"&&("\\ 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]))a==="-"?this._oNewLineAtEnd=!1:a===" "?this._oNewLineAtEnd=this._nNewLineAtEnd=!1:this._nNewLineAtEnd=!1,m>g&&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(i){case "-":case "+":case " ":break;default:continue}if(a!==i){i==="+"&&(l=m);switch(a){case " ":c=this._hunkRanges[d][1]+e;b=this._hunkRanges[d][3]+h;break;case "-":this._createMinusBlock(c,b,this._hunkRanges[d][1]+e-c);break;case "+":this._createPlusBlock(c,b,this._hunkRanges[d][3]+h-b,l)}a=i}switch(i){case "-":e++;break;case "+":h++;break;case " ":e++,h++}}}switch(a){case "-":this._createMinusBlock(c,b,this._hunkRanges[d][1]+e-c);break;case "+":this._createPlusBlock(c,
b,this._hunkRanges[d][3]+h-b,l)}},_detectConflictes:function(d,a){if(d<0)return!1;for(var g=d+a,f=d;f<g;f++){var e=this._diffContents[f];if(e.indexOf("<<<<<")>-1||e.indexOf(">>>>>")>-1)return!0}return!1},_buildMap:function(d){var a=this._oBlocks.length,g=this._oFileContents.length,f=0,e;e=1;for(var h=0;h<a;h++)e=this._oBlocks[h][0]-e,e>0&&(this._deltaMap.push([e,e,0]),f+=e),d&&this._detectConflictes(this._nBlocks[h][2],this._nBlocks[h][1])?this._deltaMap.push([this._nBlocks[h][1],this._oBlocks[h][1],
this._nBlocks[h][2]+1,1]):this._deltaMap.push([this._nBlocks[h][1],this._oBlocks[h][1],this._nBlocks[h][2]+1]),f+=this._oBlocks[h][1],e=this._oBlocks[h][0]+this._oBlocks[h][1];0<g-e&&(this._deltaMap.push([g-e+1,g-e+1,0]),f+=g-e+1);f<g&&(e=g-f,d=this._deltaMap[this._deltaMap.length-1],d[2]===0?(d[0]+=e,d[1]+=e):d[2]===-1?this._deltaMap.push([e,e,0]):this._nNewLineAtEnd===this._oNewLineAtEnd?this._deltaMap.push([e,e,0]):(this._nNewLineAtEnd&&(d[0]+=e),this._oNewLineAtEnd&&(d[1]+=e)))},_buildNewFile:function(){var d=
1,a=!1,g=this._deltaMap.length,f,e;for(f=0;f<g;f++){a=!1;if(this._deltaMap[f][2]===0){for(e=0;e<this._deltaMap[f][0];e++)this._nFileContents.push(this._oFileContents[d+e-1]);a=!0}else if(this._deltaMap[f][2]>0)for(e=0;e<this._deltaMap[f][0];e++)this._nFileContents.push(this._diffContents[this._deltaMap[f][2]+e-1].substring(1));d+=this._deltaMap[f][1]}this._nNewLineAtEnd&&!a&&this._nFileContents.push("")},_converHRangeBody:function(d,a){if(d){var g=parseInt(d,10);a.push(g>=0?g:1)}else a.push(1)},_parseHunkRange:function(d){var a=
this._diffContents[d],g=/^@@\s*\+([\+|\-]*[\d]+)\s*,*\s*([\d]*)\s*-([\+|\-]*[\d]+)\s*,*\s*([\d]*)\s*@@+/,f=/^@@\s*-([\+|\-]*[\d]+)\s*,*\s*([\d]*)\s*\+([\+|\-]*[\d]+)\s*,*\s*([\d]*)\s*@@+/.exec(a),e=null;if(f&&f.length===5)e=[d],this._converHRangeBody(f[1],e),this._converHRangeBody(f[2],e),this._converHRangeBody(f[3],e),this._converHRangeBody(f[4],e);else if((f=g.exec(a))&&f.length===5)e=[d],this._converHRangeBody(f[3],e),this._converHRangeBody(f[4],e),this._converHRangeBody(f[1],e),this._converHRangeBody(f[2],
e);return e}};return j}();return j});
define("orion/compare/compareRulers",["orion/compare/compareUtils"],function(j){var k=k||{};k.CompareRuler=function(){function i(d,a,g){this._location=d||"left";this._overview=a||"page";this._rulerStyle=g;this._editor=null;var f=this;this._listener={onModelChanged:function(a){f._onModelChanged(a)}}}i.prototype={setView:function(d){this._onModelChanged&&this._editor&&this._editor.removeEventListener("ModelChanged",this._listener.onModelChanged);this._editor=d;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(d,a){for(var g=[],f=d;f<a;f++){var e=this.getStyle(f);e&&(g[f]={html:this.getHTML(f),style:e})}return g},getWidestAnnotation:function(){return{html:this.getHTML(-1),style:this.getStyle(-1)}},
getRulerStyle:function(){return this.getStyle(void 0)}};return i}();k.LineNumberCompareRuler=function(){function i(d,a,g,f,e,h){k.CompareRuler.call(this,g,"page",f);this._diffNavigator=d;this._oddStyle=e||{style:{backgroundColor:"white"}};this._evenStyle=h||{style:{backgroundColor:"white"}};this._numOfDigits=0;this._mapperColumnIndex=a}i.prototype=new k.CompareRuler;i.prototype.getStyle=function(d){return d===void 0?this._rulerStyle:this._evenStyle};i.prototype.getHTML=function(d){var a=this._editor.getModel(),
g=this._diffNavigator.getFeeder(this._mapperColumnIndex===0);return!g?"":d===-1?a.getLineCount():g.getLineNumber?(d=g.getLineNumber(d),d===-1?"":d+1):d+1};i.prototype._onModelChanged=function(d){var d=d.start,a=this._editor.getModel(),g=a.getLineCount(),f=(g+"").length;if(this._numOfDigits!==f)this._numOfDigits=f,this._editor.redrawLines(a.getLineAtOffset(d),g,this)};return i}();k.CompareOverviewRuler=function(){function i(d,a,g,f){this._diffNavigator=g;this._onClick=f;k.CompareRuler.call(this,d,
"document",a)}i.prototype=new k.CompareRuler;i.prototype.getStyle=function(d){var a,g;if(d===void 0)a=this._rulerStyle||{},g=a.style||(a.style={}),g.lineHeight="1px",g.fontSize="1px",g.width="14px";else if(a=d!==-1?{styleClass:"annotationOverview breakpoint"}:{},g=a.style||(a.style={}),g.cursor="pointer",g.width="8px",g.left="2px",d>=0){var f;if(this._diffNavigator&&this._diffNavigator.getFeeder())f=this._diffNavigator.getFeeder().getDiffBlocks();else return null;d=j.getAnnotationIndex(f,d);if(d===
-1)return null;f=j.getAnnotationMapperIndex(f,d);var e;e=this._diffNavigator.getMapper();if(f=j.isMapperConflict(e,f))g.border="1px #FF0000 solid";if(d===this._diffNavigator.getCurrentBlockIndex())g.backgroundColor=f?"red":"blue";d=this._diffNavigator.getFeeder().getDiffBlockH(d);f=this._diffNavigator.getFeeder().getOverviewLineCount();if(d<0)return null;e=this._editor.getClientArea();d=Math.floor(e.height*d/f);d<2&&(d=2);g.height=d+"px"}else return null;return a};i.prototype.setDiffNavigator=function(d){this._diffNavigator=
d};i.prototype.getHTML=function(){return"&nbsp;"};i.prototype.onClick=function(d){d!==void 0&&this._onClick(d,this)};i.prototype._onModelChanged=function(){this._editor.getModel().getLineCount()>0&&this._editor.redrawLines(0,1,this)};return i}();k.CompareCurveRuler=function(){function i(d){this._canvasDiv=d;this._mapper=void 0}i.prototype={init:function(d,a,g,f){this._rightIniting=this._rightIniting=this._leftIniting=!0;this._mapper=d;this._leftEditor=a;this._rightEditor=g;this._leftTextView=a.getTextView();
this._rightTextView=g.getTextView();this._diffNavigator=f;this.render()},matchPositionFrom:function(d){var a=d?this._leftTextView:this._rightTextView,g=d?this._rightTextView:this._leftTextView,f=a.getTopIndex(),a=a.getBottomIndex(),d=j.matchMapper(this._mapper,d?0:1,f,a);g.setTopIndex(d)},copyTo:function(d){if(this._diffNavigator.iterator){var a=this._diffNavigator.iterator.cursor();if(a&&(a.type==="word"?!a.copied&&!a.parent.copied:!a.copied)){var g=d?this._rightTextView.getText(a.oldA.start,a.oldA.end):
this._leftTextView.getText(a.newA.start,a.newA.end),f=d?a.newA:a.oldA;(d?this._leftTextView:this._rightTextView).setText(g,f.start,f.end);a.copied=!0}}},render:function(){if(this._mapper){var d=this._canvasDiv.getContext("2d");d.clearRect(0,0,this._canvasDiv.width,this._canvasDiv.height);d.strokeStyle="#AAAAAA";d.lineWidth=1;d.beginPath();var a=this._leftTextView.getTopIndex(),g=this._leftTextView.getBottomIndex(),f=this._rightTextView.getTopIndex(),e=this._rightTextView.getBottomIndex();this._leftLineH=
this._leftTextView.getLineHeight();this._rightLineH=this._rightTextView.getLineHeight();for(var h=0,c=0,b=!1,l=0;l<this._mapper.length;l++){if(this._mapper[l][2]!==0)if(j.overlapMapper(this._mapper[l],0,h,a,g)||j.overlapMapper(this._mapper[l],1,c,f,e))this._renderCurve(l,h,c,this._canvasDiv,d,a,g,f,e),b=!0;else if(b)break;h+=this._mapper[l][0];c+=this._mapper[l][1]}d.stroke()}},_renderCurve:function(d,a,g,f,e){var h=this._mapper[d],a=this._leftTextView.getLinePixel(a+h[0]/2)+h[0]%2*this._leftLineH/
3-this._leftTextView.getTopPixel(),g=this._rightTextView.getLinePixel(g+h[1]/2)+h[1]%2*this._rightLineH/3-this._rightTextView.getTopPixel(),f=f.parentNode.clientWidth;d===this._diffNavigator.getCurrentMapperIndex()?(e.stroke(),e.strokeStyle="#000",e.lineWidth=1,e.beginPath(),e.moveTo(0,a),e.bezierCurveTo(f/3,a,f*0.666,g,f,g),e.stroke(),e.strokeStyle="#AAAAAA",e.lineWidth=1,e.beginPath()):(e.moveTo(0,a),e.bezierCurveTo(f/3,a,f*0.666,g,f,g),e.stroke())},onChanged:function(d,a){var g=a?this._rightIniting:
this._leftIniting;if(d.removedLineCount!==d.addedLineCount){var f=a?this._rightTextView:this._leftTextView;g||j.updateMapper(this._mapper,a?1:0,f.getModel().getLineAtOffset(d.start),d.removedLineCount,d.addedLineCount);(d.removedLineCount>0||d.addedLineCount>0)&&this.render()}a?this._rightIniting=!1:this._leftIniting=!1;return g}};return i}();return k});define("orion/editor/i18n",{load:function(j,k,i){k.specified&&k.specified("orion/bootstrap")?k(["orion/i18n!"+j],function(d){i(d)}):i({})}});
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(j,k){var i={root:k},d;for(d in j)j.hasOwnProperty(d)&&typeof i[d]==="undefined"&&(i[d]=j[d]);return i});
define("orion/editor/textModel",["orion/editor/eventTarget","orion/regex","orion/util"],function(j,k,i){function d(a,d){this._lastLineIndex=-1;this._text=[""];this._lineOffsets=[0];this.setText(a);this.setLineDelimiter(d)}d.prototype={destroy:function(){},find:function(a){if(this._text.length>1)this._text=[this._text.join("")];var d=a.string,f=a.regex,e=d,h="",c=a.caseInsensitive;if(e)if(f){if(d=k.parse(e))e=d.pattern,h=d.flags}else e=d.replace(/([\\$\^*\/+?\.\(\)|{}\[\]])/g,"\\$&"),c&&(e=e.replace(/[iI\u0130\u0131]/g,
"[Ii\u0130\u0131]"));var b=null,l;if(e){var d=a.reverse,i=a.wrap,f=a.wholeWord,j=a.start||0,a=a.end,r=a!==null&&a!==void 0;h.indexOf("g")===-1&&(h+="g");h.indexOf("m")===-1&&(h+="m");c&&h.indexOf("i")===-1&&(h+="i");f&&(e="\\b"+e+"\\b");var q=this._text[0],s,u,p=0;r&&(c=j<a?j:a,q=q.substring(c,j<a?a:j),p=c);var t=RegExp(e,h);if(d)l=function(){var a=null;for(t.lastIndex=0;;){u=t.lastIndex;s=t.exec(q);if(u===t.lastIndex)return null;if(s){if(!(s.index+p<j)){if(!i||a)break;j=q.length+p}a={start:s.index+
p,end:t.lastIndex+p}}else break}if(a)j=a.start;return a};else{if(!r)t.lastIndex=j;l=function(){for(;;){u=t.lastIndex;s=t.exec(q);if(u===t.lastIndex)break;if(s)return{start:s.index+p,end:t.lastIndex+p};if(!(u!==0&&i))break}return null}}b=l()}return{next:function(){var a=b;a&&(b=l());return a},hasNext:function(){return b!==null}}},getCharCount:function(){for(var a=0,d=0;d<this._text.length;d++)a+=this._text[d].length;return a},getLine:function(a,d){var f=this.getLineCount();if(!(0<=a&&a<f))return null;
var e=this._lineOffsets[a];if(a+1<f){f=this.getText(e,this._lineOffsets[a+1]);if(d)return f;for(var e=f.length,h;(h=f.charCodeAt(e-1))===10||h===13;)e--;return f.substring(0,e)}else return this.getText(e)},getLineAtOffset:function(a){var d=this.getCharCount();if(!(0<=a&&a<=d))return-1;var f=this.getLineCount();if(a===d)return f-1;var e,h,c=this._lastLineIndex;if(0<=c&&c<f&&(e=this._lineOffsets[c],h=c+1<f?this._lineOffsets[c+1]:d,e<=a&&a<h))return c;for(var b=f,l=-1;b-l>1;)if(c=Math.floor((b+l)/2),
e=this._lineOffsets[c],h=c+1<f?this._lineOffsets[c+1]:d,a<=e)b=c;else if(a<h){b=c;break}else l=c;return this._lastLineIndex=b},getLineCount:function(){return this._lineOffsets.length},getLineDelimiter:function(){return this._lineDelimiter},getLineEnd:function(a,d){var f=this.getLineCount();if(!(0<=a&&a<f))return-1;if(a+1<f){f=this._lineOffsets[a+1];if(d)return f;for(var e=this.getText(Math.max(this._lineOffsets[a],f-2),f),h=e.length,c;(c=e.charCodeAt(h-1))===10||c===13;)h--;return f-(e.length-h)}else return this.getCharCount()},
getLineStart:function(a){return!(0<=a&&a<this.getLineCount())?-1:this._lineOffsets[a]},getText:function(a,d){a===void 0&&(a=0);d===void 0&&(d=this.getCharCount());if(a===d)return"";for(var f=0,e=0,h;e<this._text.length;){h=this._text[e].length;if(a<=f+h)break;f+=h;e++}for(var c=f,b=e;e<this._text.length;){h=this._text[e].length;if(d<=f+h)break;f+=h;e++}if(b===e)return this._text[b].substring(a-c,d-f);c=this._text[b].substring(a-c);f=this._text[e].substring(0,d-f);return c+this._text.slice(b+1,e).join("")+
f},onChanging:function(a){return this.dispatchEvent(a)},onChanged:function(a){return this.dispatchEvent(a)},setLineDelimiter:function(a,d){a==="auto"&&(a=void 0,this.getLineCount()>1&&(a=this.getText(this.getLineEnd(0),this.getLineEnd(0,!0))));this._lineDelimiter=a?a:i.platformDelimiter;if(d){var f=this.getLineCount();if(f>1){for(var e=Array(f),h=0;h<f;h++)e[h]=this.getLine(h);this.setText(e.join(this._lineDelimiter))}}},setText:function(a,d,f){a===void 0&&(a="");d===void 0&&(d=0);f===void 0&&(f=
this.getCharCount());if(!(d===f&&a==="")){for(var e=this.getLineAtOffset(d),h=this.getLineAtOffset(f),c=d,b=f-d,l=h-e,i=a.length,j=0,k=this.getLineCount(),q=0,s=0,u=0,p=[];;){q!==-1&&q<=u&&(q=a.indexOf("\r",u));s!==-1&&s<=u&&(s=a.indexOf("\n",u));if(s===-1&&q===-1)break;u=q!==-1&&s!==-1?q+1===s?s+1:(q<s?q:s)+1:q!==-1?q+1:s+1;p.push(d+u);j++}this.onChanging({type:"Changing",text:a,start:c,removedCharCount:b,addedCharCount:i,removedLineCount:l,addedLineCount:j});p.length===0&&(u=this.getLineStart(e),
h=h+1<k?this.getLineStart(h+1):this.getCharCount(),d!==u&&(a=this.getText(u,d)+a,d=u),f!==h&&(a+=this.getText(f,h),f=h));u=i-b;for(h=e+l+1;h<k;h++)this._lineOffsets[h]+=u;if(p.length<5E4)e=[e+1,l].concat(p),Array.prototype.splice.apply(this._lineOffsets,e);else{u=e+1;this._lineOffsets.splice(u,l);for(k=0;k<p.length;k+=5E4)e=[u,0].concat(p.slice(k,Math.min(p.length,k+5E4))),Array.prototype.splice.apply(this._lineOffsets,e),u+=5E4}for(u=k=0;u<this._text.length;){h=this._text[u].length;if(d<=k+h)break;
k+=h;u++}e=k;for(p=u;u<this._text.length;){h=this._text[u].length;if(f<=k+h)break;k+=h;u++}h=this._text[u];d=this._text[p].substring(0,d-e);f=h.substring(f-k);p=[p,u-p+1];d&&p.push(d);a&&p.push(a);f&&p.push(f);Array.prototype.splice.apply(this._text,p);if(this._text.length===0)this._text=[""];this.onChanged({type:"Changed",start:c,removedCharCount:b,addedCharCount:i,removedLineCount:l,addedLineCount:j})}}};j.EventTarget.addMixin(d.prototype);return{TextModel:d}});
define("orion/editor/keyModes",["orion/keyBinding","orion/util"],function(j,k){function i(a){if(a)this._view=a,this._keyBindings=this.createKeyBindings(),this._keyBindingIndex=0}function d(a){i.call(this,a)}i.prototype={createKeyBindings:function(){return[]},getKeyBindings:function(a){for(var d=[],f=this._keyBindings,e=0;e<f.length;e++)f[e].actionID===a&&d.push(f[e].keyBinding);return d},getView:function(){return this._view},isActive:function(){return this._view.getKeyModes().indexOf(this)!==-1},
match:function(a){if(a.type==="keydown")switch(a.keyCode){case 16:case 17:case 18:case 91:return}for(var d=this._keyBindingIndex,f=this._matchingKeyBindings||this._keyBindings,e=[],h=0;h<f.length;h++){var c=f[h],b=c.keyBinding.match(a,d);if(b===!0)return this._keyBindingIndex=0,this._matchingKeyBindings=null,c.actionID;else typeof b==="number"&&e.push(c)}if(e.length===0)this._keyBindingIndex=0,this._matchingKeyBindings=null;else return this._keyBindingIndex++,this._matchingKeyBindings=e,"noop"},setKeyBinding:function(a,
d){for(var f=this._keyBindings,e=0;e<f.length;e++){var h=f[e];if(h.keyBinding.equals(a)){d?h.actionID=d:h.predefined?h.actionID="noop":f.splice(e,1);return}}d&&f.push({keyBinding:a,actionID:d})},setView:function(a){this._view=a}};d.prototype=new i;d.prototype.createKeyBindings=function(){var a=j.KeyBinding,d=[];d.push({actionID:"lineUp",keyBinding:new a(38),predefined:!0});d.push({actionID:"lineDown",keyBinding:new a(40),predefined:!0});d.push({actionID:"charPrevious",keyBinding:new a(37),predefined:!0});
d.push({actionID:"charNext",keyBinding:new a(39),predefined:!0});k.isMac?(d.push({actionID:"scrollPageUp",keyBinding:new a(33),predefined:!0}),d.push({actionID:"scrollPageDown",keyBinding:new a(34),predefined:!0}),d.push({actionID:"pageUp",keyBinding:new a(33,null,null,!0),predefined:!0}),d.push({actionID:"pageDown",keyBinding:new a(34,null,null,!0),predefined:!0}),d.push({actionID:"lineStart",keyBinding:new a(37,!0),predefined:!0}),d.push({actionID:"lineEnd",keyBinding:new a(39,!0),predefined:!0}),
d.push({actionID:"wordPrevious",keyBinding:new a(37,null,null,!0),predefined:!0}),d.push({actionID:"wordNext",keyBinding:new a(39,null,null,!0),predefined:!0}),d.push({actionID:"scrollTextStart",keyBinding:new a(36),predefined:!0}),d.push({actionID:"scrollTextEnd",keyBinding:new a(35),predefined:!0}),d.push({actionID:"textStart",keyBinding:new a(38,!0),predefined:!0}),d.push({actionID:"textEnd",keyBinding:new a(40,!0),predefined:!0}),d.push({actionID:"scrollPageUp",keyBinding:new a(38,null,null,null,
!0),predefined:!0}),d.push({actionID:"scrollPageDown",keyBinding:new a(40,null,null,null,!0),predefined:!0}),d.push({actionID:"lineStart",keyBinding:new a(37,null,null,null,!0),predefined:!0}),d.push({actionID:"lineEnd",keyBinding:new a(39,null,null,null,!0),predefined:!0}),d.push({actionID:"lineStart",keyBinding:new a(38,null,null,!0),predefined:!0}),d.push({actionID:"lineEnd",keyBinding:new a(40,null,null,!0),predefined:!0})):(d.push({actionID:"pageUp",keyBinding:new a(33),predefined:!0}),d.push({actionID:"pageDown",
keyBinding:new a(34),predefined:!0}),d.push({actionID:"lineStart",keyBinding:new a(36),predefined:!0}),d.push({actionID:"lineEnd",keyBinding:new a(35),predefined:!0}),d.push({actionID:"wordPrevious",keyBinding:new a(37,!0),predefined:!0}),d.push({actionID:"wordNext",keyBinding:new a(39,!0),predefined:!0}),d.push({actionID:"textStart",keyBinding:new a(36,!0),predefined:!0}),d.push({actionID:"textEnd",keyBinding:new a(35,!0),predefined:!0}));k.isFirefox&&k.isLinux&&(d.push({actionID:"lineUp",keyBinding:new a(38,
!0),predefined:!0}),d.push({actionID:"lineDown",keyBinding:new a(40,!0),predefined:!0}));k.isWindows&&(d.push({actionID:"scrollLineUp",keyBinding:new a(38,!0),predefined:!0}),d.push({actionID:"scrollLineDown",keyBinding:new a(40,!0),predefined:!0}));d.push({actionID:"selectLineUp",keyBinding:new a(38,null,!0),predefined:!0});d.push({actionID:"selectLineDown",keyBinding:new a(40,null,!0),predefined:!0});d.push({actionID:"selectCharPrevious",keyBinding:new a(37,null,!0),predefined:!0});d.push({actionID:"selectCharNext",
keyBinding:new a(39,null,!0),predefined:!0});d.push({actionID:"selectPageUp",keyBinding:new a(33,null,!0),predefined:!0});d.push({actionID:"selectPageDown",keyBinding:new a(34,null,!0),predefined:!0});k.isMac?(d.push({actionID:"selectLineStart",keyBinding:new a(37,!0,!0),predefined:!0}),d.push({actionID:"selectLineEnd",keyBinding:new a(39,!0,!0),predefined:!0}),d.push({actionID:"selectWordPrevious",keyBinding:new a(37,null,!0,!0),predefined:!0}),d.push({actionID:"selectWordNext",keyBinding:new a(39,
null,!0,!0),predefined:!0}),d.push({actionID:"selectTextStart",keyBinding:new a(36,null,!0),predefined:!0}),d.push({actionID:"selectTextEnd",keyBinding:new a(35,null,!0),predefined:!0}),d.push({actionID:"selectTextStart",keyBinding:new a(38,!0,!0),predefined:!0}),d.push({actionID:"selectTextEnd",keyBinding:new a(40,!0,!0),predefined:!0}),d.push({actionID:"selectLineStart",keyBinding:new a(37,null,!0,null,!0),predefined:!0}),d.push({actionID:"selectLineEnd",keyBinding:new a(39,null,!0,null,!0),predefined:!0}),
d.push({actionID:"selectLineStart",keyBinding:new a(38,null,!0,!0),predefined:!0}),d.push({actionID:"selectLineEnd",keyBinding:new a(40,null,!0,!0),predefined:!0})):(k.isLinux&&(d.push({actionID:"selectWholeLineUp",keyBinding:new a(38,!0,!0),predefined:!0}),d.push({actionID:"selectWholeLineDown",keyBinding:new a(40,!0,!0),predefined:!0})),d.push({actionID:"selectLineStart",keyBinding:new a(36,null,!0),predefined:!0}),d.push({actionID:"selectLineEnd",keyBinding:new a(35,null,!0),predefined:!0}),d.push({actionID:"selectWordPrevious",
keyBinding:new a(37,!0,!0),predefined:!0}),d.push({actionID:"selectWordNext",keyBinding:new a(39,!0,!0),predefined:!0}),d.push({actionID:"selectTextStart",keyBinding:new a(36,!0,!0),predefined:!0}),d.push({actionID:"selectTextEnd",keyBinding:new a(35,!0,!0),predefined:!0}));d.push({actionID:"undo",keyBinding:new j.KeyBinding("z",!0),predefined:!0});k.isMac?d.push({actionID:"redo",keyBinding:new j.KeyBinding("z",!0,!0),predefined:!0}):d.push({actionID:"redo",keyBinding:new j.KeyBinding("y",!0),predefined:!0});
d.push({actionID:"deletePrevious",keyBinding:new a(8),predefined:!0});d.push({actionID:"deletePrevious",keyBinding:new a(8,null,!0),predefined:!0});d.push({actionID:"deleteNext",keyBinding:new a(46),predefined:!0});d.push({actionID:"deleteWordPrevious",keyBinding:new a(8,!0),predefined:!0});d.push({actionID:"deleteWordPrevious",keyBinding:new a(8,!0,!0),predefined:!0});d.push({actionID:"deleteWordNext",keyBinding:new a(46,!0),predefined:!0});d.push({actionID:"tab",keyBinding:new a(9),predefined:!0});
d.push({actionID:"shiftTab",keyBinding:new a(9,null,!0),predefined:!0});d.push({actionID:"enter",keyBinding:new a(13),predefined:!0});d.push({actionID:"enter",keyBinding:new a(13,null,!0),predefined:!0});d.push({actionID:"selectAll",keyBinding:new a("a",!0),predefined:!0});d.push({actionID:"toggleTabMode",keyBinding:new a("m",!0),predefined:!0});k.isMac&&(d.push({actionID:"deleteNext",keyBinding:new a(46,null,!0),predefined:!0}),d.push({actionID:"deleteWordPrevious",keyBinding:new a(8,null,null,!0),
predefined:!0}),d.push({actionID:"deleteWordNext",keyBinding:new a(46,null,null,!0),predefined:!0}));d.push({actionID:"toggleWrapMode",keyBinding:new j.KeyBinding("w",!0,!1,!0)});d.push({actionID:"toggleOverwriteMode",keyBinding:new j.KeyBinding(45)});if(!k.isFirefox){var f=k.isMac&&k.isChrome;d.push({actionID:"noop",keyBinding:new a("u",!f,!1,!1,f),predefined:!0});d.push({actionID:"noop",keyBinding:new a("i",!f,!1,!1,f),predefined:!0});d.push({actionID:"noop",keyBinding:new a("b",!f,!1,!1,f),predefined:!0})}k.isFirefox&&
(d.push({actionID:"copy",keyBinding:new a(45,!0),predefined:!0}),d.push({actionID:"paste",keyBinding:new a(45,null,!0),predefined:!0}),d.push({actionID:"cut",keyBinding:new a(46,null,!0),predefined:!0}));k.isMac&&(d.push({actionID:"lineStart",keyBinding:new a("a",!1,!1,!1,!0),predefined:!0}),d.push({actionID:"lineEnd",keyBinding:new a("e",!1,!1,!1,!0),predefined:!0}),d.push({actionID:"lineUp",keyBinding:new a("p",!1,!1,!1,!0),predefined:!0}),d.push({actionID:"lineDown",keyBinding:new a("n",!1,!1,
!1,!0),predefined:!0}),d.push({actionID:"charPrevious",keyBinding:new a("b",!1,!1,!1,!0),predefined:!0}),d.push({actionID:"charNext",keyBinding:new a("f",!1,!1,!1,!0),predefined:!0}),d.push({actionID:"deletePrevious",keyBinding:new a("h",!1,!1,!1,!0),predefined:!0}),d.push({actionID:"deleteNext",keyBinding:new a("d",!1,!1,!1,!0),predefined:!0}),d.push({actionID:"deleteLineEnd",keyBinding:new a("k",!1,!1,!1,!0),predefined:!0}),k.isFirefox?(d.push({actionID:"scrollPageDown",keyBinding:new a("v",!1,
!1,!1,!0),predefined:!0}),d.push({actionID:"deleteLineStart",keyBinding:new a("u",!1,!1,!1,!0),predefined:!0}),d.push({actionID:"deleteWordPrevious",keyBinding:new a("w",!1,!1,!1,!0),predefined:!0})):(d.push({actionID:"pageDown",keyBinding:new a("v",!1,!1,!1,!0),predefined:!0}),d.push({actionID:"centerLine",keyBinding:new a("l",!1,!1,!1,!0),predefined:!0}),d.push({actionID:"enterNoCursor",keyBinding:new a("o",!1,!1,!1,!0),predefined:!0})));return d};return{KeyMode:i,DefaultKeyMode:d}});
define("orion/editor/util",[],function(){return{contains:function(j,k){if(!k)return!1;if(!j.compareDocumentPosition){for(var i=k;i;){if(j===i)return!0;i=i.parentNode}return!1}return j===k||(j.compareDocumentPosition(k)&16)!==0},addEventListener:function(j,k,i,d){typeof j.addEventListener==="function"?j.addEventListener(k,i,d===!0):j.attachEvent("on"+k,i)},removeEventListener:function(j,k,i,d){typeof j.removeEventListener==="function"?j.removeEventListener(k,i,d===!0):j.detachEvent("on"+k,i)}}});
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(j,k,i,d,a,g,f){function e(a,b,c){if(c){b.className="";for(var c=b.attributes,e=c.length;e-- >0;)(!f.isIE||f.isIE>=9||f.isIE<9&&c[e].specified)&&b.removeAttribute(c[e].name)}if(a){if(a.styleClass)b.className=a.styleClass;if(c=a.style)for(var d in c)c.hasOwnProperty(d)&&(b.style[d]=c[d]);if(a=a.attributes)for(var h in a)a.hasOwnProperty(h)&&
b.setAttribute(h,a[h])}}function h(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 b(a,c){if(a===c)return!0;if(a&&!c||!a&&c)return!1;if(a&&a.constructor===String||c&&c.constructor===String)return!1;if(a instanceof Array||c instanceof Array){if(!(a instanceof Array&&c instanceof Array))return!1;if(a.length!==c.length)return!1;for(var e=0;e<a.length;e++)if(!b(a[e],c[e]))return!1;
return!0}if(!(a instanceof Object)||!(c instanceof Object))return!1;for(e in a)if(a.hasOwnProperty(e)){if(!c.hasOwnProperty(e))return!1;if(!b(a[e],c[e]))return!1}for(e in c)if(!a.hasOwnProperty(e))return!1;return!0}function l(a,b,c){for(var e=0,d=0,f=0,h=a.length;f<h;){e!==-1&&e<=f&&(e=a.indexOf("\r",f));d!==-1&&d<=f&&(d=a.indexOf("\n",f));var g=f,l;if(d===-1&&e===-1){b(a.substring(f));break}e!==-1&&d!==-1?e+1===d?(l=e,f=d+1):(l=e<d?e:d,f=(e<d?e:d)+1):e!==-1?(l=e,f=e+1):(l=d,f=d+1);b(a.substring(g,
l));c()}}function m(a){var b,c,e,d,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"),e=a.getPropertyValue("padding-right"),d=a.getPropertyValue("padding-bottom");else if(a.currentStyle)b=a.currentStyle.paddingLeft,c=a.currentStyle.paddingTop,e=a.currentStyle.paddingRight,d=a.currentStyle.paddingBottom;return{left:parseInt(b,10)||0,top:parseInt(c,10)||0,right:parseInt(e,
10)||0,bottom:parseInt(d,10)||0}}function o(a){var b,c,e,d,f=a._trim;if(!f){var f=m(a),h=a.ownerDocument.defaultView||a.ownerDocument.parentWindow;if(h.getComputedStyle)d=h.getComputedStyle(a,null),b=d.getPropertyValue("border-left-width"),c=d.getPropertyValue("border-top-width"),e=d.getPropertyValue("border-right-width"),d=d.getPropertyValue("border-bottom-width");else if(a.currentStyle)b=a.currentStyle.borderLeftWidth,c=a.currentStyle.borderTopWidth,e=a.currentStyle.borderRightWidth,d=a.currentStyle.borderBottomWidth;
b=parseInt(b,10)||0;c=parseInt(c,10)||0;e=parseInt(e,10)||0;d=parseInt(d,10)||0;f.left+=b;f.top+=c;f.right+=e;f.bottom+=d;a._trim=f}return f}function r(a,b,c){this.start=a;this.end=b;this.caret=c}function q(a){this.left=a.left;this.top=a.top;this.right=a.right;this.bottom=a.bottom}function s(a,b,c){this.view=a;this.lineIndex=b;this._lineDiv=c}function u(a){this._init(a||{})}var p=g.addEventListener,t=g.removeEventListener,v=function(){function a(b){this.options=b}a.prototype.play=function(){var a=
typeof this.options.duration==="number"?this.options.duration:350,b=this.options.easing||this.defaultEasing,c=this.options.onAnimate||function(){},e=this.options.curve[0],d=this.options.curve[1],f=d-e,n=-1,h,g=this;this.interval=this.options.window.setInterval(function(){n=n===-1?(new Date).getTime():n;var l=((new Date).getTime()-n)/a;l<1?(l=b(l),h=e+l*f,c(h)):(c(d),g.stop())},typeof this.options.rate==="number"?this.options.rate:20)};a.prototype.stop=function(){this.options.window.clearInterval(this.interval);
(this.options.onEnd||function(){})()};a.prototype.defaultEasing=function(a){return Math.sin(a*(Math.PI/2))};return a}();r.prototype={clone:function(){return new r(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}};q.prototype={toString:function(){return"{l="+this.left+", t="+this.top+", r="+this.right+", b="+this.bottom+"}"}};s.prototype={create:function(a,b){if(!this._lineDiv){var c=this._lineDiv=this._createLine(a,b,this.lineIndex);c._line=
this;return c}},_createLine:function(a,c,d){var h=this.view,g=h._model,l=g.getLine(d),i=g.getLineStart(d),m={type:"LineStyle",textView:h,lineIndex:d,lineText:l,lineStart:i};if(l.length<2E3)h.onLineStyle(m);g=c||f.createElement(a.ownerDocument,"div");if(!c||!b(c.viewStyle,m.style)){e(m.style,g,c);if(c)c._trim=null;g.viewStyle=m.style;g.setAttribute("role","presentation")}g.lineIndex=d;d=[];this._createRanges(m.ranges,l,0,l.length,i,{tabOffset:0,ranges:d});l=" ";!h._fullSelection&&f.isIE<9&&(l="\ufeff");
m={text:l,style:h._metrics.largestFontStyle,ignoreChars:1};d.length===0||!d[d.length-1].style||d[d.length-1].style.tagName!=="div"?d.push(m):d.splice(d.length-1,0,m);var j,o,k,t,r,l=h=0,q,s;if(c){if(o=c.modelChangedEvent)o.removedLineCount===0&&o.addedLineCount===0?(s=o.start-i,q=o.addedCharCount-o.removedCharCount):s=-1,c.modelChangedEvent=void 0;o=c.firstChild}for(i=0;i<d.length;i++){m=d[i];t=m.text;h+=t.length;j=m.style;if(o)if(r=o.firstChild.data,k=o.viewStyle,r===t&&b(j,k)){l+=r.length;o._rectsCache=
void 0;j=o=o.nextSibling;continue}else for(;o;){if(s!==-1){k=h;k>=s&&(k-=q);r=(r=o.firstChild.data)?r.length:0;if(l+r>k)break;l+=r}k=o.nextSibling;g.removeChild(o);o=k}j=this._createSpan(g,t,j,m.ignoreChars);o?g.insertBefore(j,o):g.appendChild(j);if(c)c.lineWidth=void 0}if(c)for(a=j?j.nextSibling:null;a;)k=a.nextSibling,c.removeChild(a),a=k;else a.appendChild(g);return g},_createRanges:function(a,c,e,d,f,h){if(!(e>d)){if(a)for(var g=0;g<a.length;g++){var l=a[g];if(!(l.end<f+e)){var i=Math.max(f+e,
l.start)-f;if(i>d)break;var m=Math.min(f+d,l.end)-f;if(i<=m){i=Math.max(e,i);m=Math.min(d,m);e<i&&this._createRange(c,e,i,null,h);if(!l.style||!l.style.unmergeable)for(;g+1<a.length&&a[g+1].start-f===m&&b(l.style,a[g+1].style);)l=a[g+1],m=Math.min(f+d,l.end)-f,g++;this._createRange(c,i,m,l.style,h);e=m}}}e<d&&this._createRange(c,e,d,null,h)}},_createRange:function(a,b,c,e,d){if(!(b>c)){var f=this.view._customTabSize;if(f&&f!==8)for(var h=a.indexOf("\t",b);h!==-1&&h<c;){b<h&&(b={text:a.substring(b,
h),style:e},d.ranges.push(b),d.tabOffset+=b.text.length);b=f-d.tabOffset%f;if(b>0){for(var g="\u00a0",l=1;l<b;l++)g+=" ";b={text:g,style:e,ignoreChars:b-1};d.ranges.push(b);d.tabOffset+=b.text.length}b=h+1;if(b===c)return;h=a.indexOf("\t",b)}b<=c&&(b={text:a.substring(b,c),style:e},d.ranges.push(b),d.tabOffset+=b.text.length)}},_createSpan:function(a,b,c,d){var h=this.view,g="span";c&&c.tagName&&(g=c.tagName.toLowerCase());var l=g==="a";if(l)a.hasLink=!0;l&&!h._linksVisible&&(g="span");l=a.ownerDocument;
a=f.createElement(a.ownerDocument,g);c&&c.html?(a.innerHTML=c.html,a.ignore=!0):c&&c.node?(a.appendChild(c.node),a.ignore=!0):a.appendChild(l.createTextNode(c&&c.text?c.text:b));e(c,a);if(g==="a"){var i=h._getWindow();p(a,"click",function(a){return h._handleLinkClick(a?a:i.event)},!1)}a.viewStyle=c;if(d)a.ignoreChars=d;return a},_ensureCreated:function(){return this._lineDiv?this._lineDiv:this._createdDiv=this.create(this.view._clientDiv,null)},getBoundingClientRect:function(a,b){var c=this._ensureCreated(),
e=this.view;if(a===void 0)return this._getLineBoundingClientRect(c,!0);var d=e._model,h=c.ownerDocument,g=this.lineIndex,l=null;if(a<d.getLineEnd(g)){g=d.getLineStart(g);for(d=c.firstChild;d;){if(!d.ignore){var i=d.firstChild,m=i.length;d.ignoreChars&&(m-=d.ignoreChars);if(g+m>a){l=a-g;if(i.length===1)l=new q(d.getBoundingClientRect());else if(e._isRangeRects)h=h.createRange(),h.setStart(i,l),h.setEnd(i,l+1),l=new q(h.getBoundingClientRect());else if(f.isIE){if(h=h.body.createTextRange(),h.moveToElementText(d),
h.collapse(),(g=l===0&&f.isIE===8)&&(l=1),h.moveEnd("character",l+1),h.moveStart("character",l),l=new q(h.getBoundingClientRect()),g)l.left=d.getClientRects()[0].left}else{var j=i.data;d.removeChild(i);d.appendChild(h.createTextNode(j.substring(0,l)));var o=f.createElement(h,"span");o.appendChild(h.createTextNode(j.substring(l,l+1)));d.appendChild(o);d.appendChild(h.createTextNode(j.substring(l+1)));l=new q(o.getBoundingClientRect());d.innerHTML="";d.appendChild(i);this._createdDiv||(h=e._getSelection(),
(g<=h.start&&h.start<g+m||g<=h.end&&h.end<g+m)&&e._updateDOMSelection())}f.isIE&&(h=c.ownerDocument.defaultView||c.ownerDocument.parentWindow,c=h.screen.logicalXDPI/h.screen.deviceXDPI,h=h.screen.logicalYDPI/h.screen.deviceYDPI,l.left*=c,l.right*=c,l.top*=h,l.bottom*=h);break}g+=m}d=d.nextSibling}}c=this.getBoundingClientRect();if(!l)e._wrapMode?(e=this.getClientRects(),l=e[e.length-1],l.left=l.right,l.left+=c.left,l.top+=c.top,l.right+=c.left,l.bottom+=c.top):(l=new q(c),l.left=l.right);if(b||b===
void 0)l.left-=c.left,l.top-=c.top,l.right-=c.left,l.bottom-=c.top;return l},_getClientRects:function(a,b){var c,e,d,f;if(!a._rectsCache){c=a.getClientRects();e=Array(c.length);for(f=0;f<c.length;f++)d=e[f]=new q(c[f]),d.left-=b.left,d.top-=b.top,d.right-=b.left,d.bottom-=b.top;a._rectsCache=e}c=a._rectsCache;e=[c.length];for(f=0;f<c.length;f++)e[f]=new q(c[f]);return e},getClientRects:function(a){if(!this.view._wrapMode)return[this.getBoundingClientRect()];for(var b=this._ensureCreated(),c=[],e=
b.firstChild,d,f=b.getBoundingClientRect();e;){if(!e.ignore)for(var h=this._getClientRects(e,f),b=0;b<h.length;b++){var g=h[b],l;if(g.top!==g.bottom){var i=g.top+(g.bottom-g.top)/2;for(l=0;l<c.length;l++)if(d=c[l],d.top<=i&&i<d.bottom)break;if(l===c.length)c.push(g);else{if(g.left<d.left)d.left=g.left;if(g.top<d.top)d.top=g.top;if(g.right>d.right)d.right=g.right;if(g.bottom>d.bottom)d.bottom=g.bottom}}}e=e.nextSibling}return a!==void 0?c[a]:c},_getLineBoundingClientRect:function(a,b){var c=new q(a.getBoundingClientRect());
if(!this.view._wrapMode){c.right=c.left;for(var e=a.lastChild;e&&e.ignoreChars===e.firstChild.length;)e=e.previousSibling;if(e)e=e.getBoundingClientRect(),c.right=e.right+o(a).right}b&&(e=o(a),c.left+=e.left,c.right-=e.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,b){var c=this.view,e=c._model,d=this.lineIndex,h=e.getLineStart(d),g=e.getLineEnd(d);if(h===g)return h;var l=this._ensureCreated(),i=this.getBoundingClientRect(),m,j;if(c._wrapMode){m=this.getClientRects();if(b<m[0].top)b=m[0].top;for(var o=0;o<m.length;o++)if(j=m[o],
j.top<=b&&b<j.bottom)break;if(a<j.left)a=j.left;a>j.right&&(a=j.right-1)}else a<0&&(a=0),a>i.right-i.left&&(a=i.right-i.left);var k=l.ownerDocument,o=k.defaultView||k.parentWindow,r=f.isIE?o.screen.logicalXDPI/o.screen.deviceXDPI:1,t=f.isIE?o.screen.logicalYDPI/o.screen.deviceYDPI:1,o=h,q=l.firstChild;a:for(;q;){if(!q.ignore){var s=q.firstChild,l=s.length;q.ignoreChars&&(l-=q.ignoreChars);var v,u,p;m=this._getClientRects(q,i);for(var G=0;G<m.length;G++)if(j=m[G],j.left<=a&&a<j.right&&(!c._wrapMode||
j.top<=b&&b<j.bottom)){var G=j.left+i.left,E;if(f.isIE||c._isRangeRects){for(var k=c._isRangeRects?k.createRange():k.body.createTextRange(),D=l,L=-1;D-L>1;){var U=Math.floor((D+L)/2);m=L+1;j=U===l-1&&q.ignoreChars?s.length:U+1;E=m===0&&f.isIE===8;c._isRangeRects?(k.setStart(s,m),k.setEnd(s,j)):(E&&(m=1),k.moveToElementText(q),k.move("character",m),k.moveEnd("character",j-m));m=k.getClientRects();for(var W=!1,V=0;V<m.length;V++)if(j=m[V],v=(E?G:j.left)*r-i.left,p=j.right*r-i.left,u=j.top*t-i.top,j=
j.bottom*t-i.top,v<=a&&a<p&&(!c._wrapMode||u<=b&&b<j)){W=!0;break}W?D=U:L=U}o+=D;m=D;j=D===l-1&&q.ignoreChars?s.length:Math.min(D+1,s.length);c._isRangeRects?(k.setStart(s,m),k.setEnd(s,j)):(k.moveToElementText(q),k.move("character",m),k.moveEnd("character",j-m));m=k.getClientRects();c=!1;m.length>0&&(j=m[0],v=(E?G:j.left)*r-i.left,p=j.right*r-i.left,c=a>v+(p-v)/2);i=o-h;e=e.getLine(d);d=e.charCodeAt(i);55296<=d&&d<=56319&&c?i<e.length&&(d=e.charCodeAt(i+1),56320<=d&&d<=57343&&(o+=1)):56320<=d&&d<=
57343&&!c&&i>0&&(d=e.charCodeAt(i-1),55296<=d&&d<=56319&&(o-=1));c&&o++}else{e=[];for(d=0;d<l;d++)e.push("<span>"),d===l-1?e.push(s.data.substring(d)):e.push(s.data.substring(d,d+1)),e.push("</span>");q.innerHTML=e.join("");for(e=q.firstChild;e;){j=e.getBoundingClientRect();v=j.left-i.left;p=j.right-i.left;if(v<=a&&a<p){a>v+(p-v)/2&&o++;break}o++;e=e.nextSibling}if(!this._createdDiv)q.innerHTML="",q.appendChild(s),i=c._getSelection(),(o<=i.start&&i.start<o+l||o<=i.end&&i.end<o+l)&&c._updateDOMSelection()}break a}o+=
l}q=q.nextSibling}return Math.min(g,Math.max(h,o))},getNextOffset:function(a,b){if(b.unit==="line"){var c=this.view._model,e=c.getLineAtOffset(a);if(b.count>0)return b.count--,c.getLineEnd(e);b.count++;return c.getLineStart(e)}return b.unit==="wordend"||b.unit==="wordWS"||b.unit==="wordendWS"?this._getNextOffset_W3C(a,b):f.isIE?this._getNextOffset_IE(a,b):this._getNextOffset_W3C(a,b)},_getNextOffset_W3C:function(a,b){function c(a){return 33<=a&&a<=47||58<=a&&a<=64||91<=a&&a<=94||a===96||123<=a&&a<=
126}function e(a){return a===32||a===9}var d=this.view._model,f=d.getLineAtOffset(a),h=d.getLine(f),g=d.getLineStart(f),d=d.getLineEnd(f),f=h.length,l=a-g,i,m=b.count<0?-1:1;if(b.unit==="word"||b.unit==="wordend"||b.unit==="wordWS"||b.unit==="wordendWS")for(var j,o,k;b.count!==0;){if(b.count>0){if(l===f)return d;i=h.charCodeAt(l);j=c(i);o=!j&&!e(i);for(l++;l<f;){i=h.charCodeAt(l);if(b.unit!=="wordWS"&&b.unit!=="wordendWS"){k=c(i);if(b.unit==="wordend"){if(!k&&j)break}else if(k&&!j)break;i=!k&&!e(i)}else i=
!e(i);if(b.unit==="wordend"||b.unit==="wordendWS"){if(!i&&o)break}else if(i&&!o)break;o=i;j=k;l++}}else{if(l===0)return g;l--;i=h.charCodeAt(l);j=c(i);for(o=!j&&!e(i);0<l;){i=h.charCodeAt(l-1);if(b.unit!=="wordWS"&&b.unit!=="wordendWS"){k=c(i);if(b.unit==="wordend"){if(k&&!j)break}else if(!k&&j)break;i=!k&&!e(i)}else i=!e(i);if(b.unit==="wordend"||b.unit==="wordendWS"){if(i&&!o)break}else if(!i&&o)break;o=i;j=k;l--}}b.count-=m}else for(;b.count!==0&&0<=l+m&&l+m<=f;)l+=m,i=h.charCodeAt(l),56320<=i&&
i<=57343&&l>0&&(i=h.charCodeAt(l-1),55296<=i&&i<=56319&&(l+=m)),b.count-=m;return g+l},_getNextOffset_IE:function(a,b){var c=this._ensureCreated(),e=this.view._model,d=this.lineIndex,f=0,h;h=e.getLineStart(d);var g=c.ownerDocument,l=b.count<0?-1:1;if(a===e.getLineEnd(d)){for(c=c.lastChild;c&&c.ignoreChars===c.firstChild.length;)c=c.previousSibling;if(!c)return h;f=g.body.createTextRange();f.moveToElementText(c);h=f.text.length;f.moveEnd(b.unit,l);f=a+f.text.length-h}else if(a===h&&b.count<0)f=h;else for(c=
c.firstChild;c;){e=c.firstChild.length;c.ignoreChars&&(e-=c.ignoreChars);if(h+e>a){f=g.body.createTextRange();if(a===h&&b.count<0){for(h=c.previousSibling;h;){if(h.firstChild&&h.firstChild.length)break;h=h.previousSibling}f.moveToElementText(h?h:c.previousSibling)}else f.moveToElementText(c),f.collapse(),f.moveEnd("character",a-h);h=f.text.length;f.moveEnd(b.unit,l);f=a+f.text.length-h;break}h=e+h;c=c.nextSibling}b.count-=l;return f},destroy:function(){var a=this._createdDiv;if(a)a.parentNode.removeChild(a),
this._createdDiv=null}};u.prototype={addKeyMode:function(a,b){var c=this._keyModes;b!==void 0?c.splice(b,0,a):c.push(a);a._modeAdded&&a._modeAdded()},addRuler:function(a,b){a.setView(this);var c=this._rulers;if(b!==void 0){var e,d;for(e=0,d=0;e<c.length&&d<b;e++)a.getLocation()===c[e].getLocation()&&d++;c.splice(d,0,a);b=d}else c.push(a);this._createRuler(a,b);this._update()},computeSize:function(){var a=0,b=0,c=this._model,e=this._clientDiv;if(!e)return{width:a,height:b};var d=e.style.width;if(f.isWebkit)e.style.width=
"0x7fffffffpx";for(var c=c.getLineCount(),h=0;h<c;h++){var g=this._getLine(h),l=g.getBoundingClientRect(),a=Math.max(a,l.right-l.left);b+=l.bottom-l.top;g.destroy()}if(f.isWebkit)e.style.width=d;e=this._getViewPadding();a+=e.right+e.left+this._metrics.scrollWidth;b+=e.bottom+e.top+this._metrics.scrollWidth;return{width:a,height:b}},convert:function(a,b,c){if(this._clientDiv){var e=this._getScroll(),d=this._getViewPadding(),f=this._viewDiv.getBoundingClientRect();b==="document"&&(a.x!==void 0&&(a.x+=
-e.x+f.left+d.left),a.y!==void 0&&(a.y+=-e.y+f.top+d.top));c==="document"&&(a.x!==void 0&&(a.x+=e.x-f.left-d.left),a.y!==void 0&&(a.y+=e.y-f.top-d.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 b=[],c=this._actions,e;for(e in c)c.hasOwnProperty(e)&&(a||!c[e].defaultHandler)&&b.push(e);return b},getBottomIndex:function(a){return!this._clientDiv?0:this._getBottomIndex(a)},getBottomPixel:function(){return!this._clientDiv?0:this._getScroll().y+this._getClientHeight()},
getCaretOffset:function(){return this._getSelection().getCaret()},getClientArea:function(){if(!this._clientDiv)return{x:0,y:0,width:0,height:0};var a=this._getScroll();return{x:a.x,y:a.y,width:this._getClientWidth(),height:this._getClientHeight()}},getHorizontalPixel:function(){return!this._clientDiv?0:this._getScroll().x},getKeyBindings:function(a){for(var b=[],c=this._keyModes,e=0;e<c.length;e++)b=b.concat(c[e].getKeyBindings(a));return b},getKeyModes:function(){return this._keyModes.slice(0)},
getLineHeight:function(a){return!this._clientDiv?0:this._getLineHeight(a)},getLineIndex:function(a){return!this._clientDiv?0:this._getLineIndex(a)},getLinePixel:function(a){return!this._clientDiv?0:this._getLinePixel(a)},getLocationAtOffset:function(a){if(!this._clientDiv)return{x:0,y:0};var b=this._model,a=Math.min(Math.max(0,a),b.getCharCount()),b=b.getLineAtOffset(a),c=this._getLine(b),a=c.getBoundingClientRect(a);c.destroy();c=a.left;b=this._getLinePixel(b)+a.top;return{x:c,y:b}},getNextOffset:function(a,
b){var c=new r(a,a,!1);this._doMove(b,c);return c.getCaret()},getOptions:function(){var a;if(arguments.length===0)a=this._defaultOptions();else if(arguments.length===1){if(a=arguments[0],typeof a==="string")return h(this["_"+a])}else{a={};for(var b in arguments)arguments.hasOwnProperty(b)&&(a[arguments[b]]=void 0)}for(var c in a)a.hasOwnProperty(c)&&(a[c]=h(this["_"+c]));return a},getModel:function(){return this._model},getOffsetAtLocation:function(a,b){if(!this._clientDiv)return 0;var c=this._getLineIndex(b),
e=this._getLine(c),c=e.getOffset(a,b-this._getLinePixel(c));e.destroy();return c},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,b){return this._model.getText(a,b)},getTopIndex:function(a){return!this._clientDiv?0:this._getTopIndex(a)},getTopPixel:function(){return!this._clientDiv?
0:this._getScroll().y},invokeAction:function(a,b,c){if(this._clientDiv){if(a=this._actions[a]){if(!b&&a.handler&&a.handler(c))return!0;if(a.defaultHandler)return typeof a.defaultHandler(c)==="boolean"}return!1}},isDestroyed:function(){return!this._clientDiv},onContextMenu:function(a){return this.dispatchEvent(a)},onDragStart:function(a){return this.dispatchEvent(a)},onDrag:function(a){return this.dispatchEvent(a)},onDragEnd:function(a){return this.dispatchEvent(a)},onDragEnter:function(a){return this.dispatchEvent(a)},
onDragOver:function(a){return this.dispatchEvent(a)},onDragLeave:function(a){return this.dispatchEvent(a)},onDrop:function(a){return this.dispatchEvent(a)},onDestroy:function(a){return this.dispatchEvent(a)},onLineStyle:function(a){return this.dispatchEvent(a)},onKeyDown:function(a){return this.dispatchEvent(a)},onKeyPress:function(a){return this.dispatchEvent(a)},onKeyUp:function(a){return this.dispatchEvent(a)},onModelChanged:function(a){return this.dispatchEvent(a)},onModelChanging:function(a){return this.dispatchEvent(a)},
onModify:function(a){return this.dispatchEvent(a)},onMouseDown:function(a){return this.dispatchEvent(a)},onMouseUp:function(a){return this.dispatchEvent(a)},onMouseMove:function(a){return this.dispatchEvent(a)},onMouseOver:function(a){return this.dispatchEvent(a)},onMouseOut:function(a){return this.dispatchEvent(a)},onSelection:function(a){return this.dispatchEvent(a)},onScroll:function(a){return this.dispatchEvent(a)},onVerify:function(a){return this.dispatchEvent(a)},onFocus:function(a){return this.dispatchEvent(a)},
onBlur:function(a){return this.dispatchEvent(a)},redraw:function(){if(!(this._redrawCount>0)){var a=this._model.getLineCount();this.redrawRulers(0,a);this.redrawLines(0,a)}},redrawRulers:function(a,b){if(!(this._redrawCount>0))for(var c=this.getRulers(),e=0;e<c.length;e++)this.redrawLines(a,b,c[e])},redrawLines:function(a,b,c){if(!(this._redrawCount>0)&&(a===void 0&&(a=0),b===void 0&&(b=this._model.getLineCount()),a!==b)){var e=this._clientDiv;if(e){if(c)for(e=this._getRulerParent(c).firstChild;e;){if(e._ruler===
c)break;e=e.nextSibling}c?e.rulerChanged=!0:this._lineHeight&&this._resetLineHeight(a,b);if(!c||c.getOverview()==="page")for(e=e.firstChild;e;){var d=e.lineIndex;if(a<=d&&d<b)e.lineChanged=!0;e=e.nextSibling}if(!c&&!this._wrapMode&&a<=this._maxLineIndex&&this._maxLineIndex<b)this._checkMaxLineIndex=this._maxLineIndex,this._maxLineIndex=-1,this._maxLineWidth=0;this._queueUpdate()}}},redrawRange:function(a,b){if(!(this._redrawCount>0)){var c=this._model;a===void 0&&(a=0);b===void 0&&(b=c.getCharCount());
var e=c.getLineAtOffset(a),c=c.getLineAtOffset(Math.max(a,b-1))+1;this.redrawLines(e,c)}},removeKeyMode:function(a){for(var b=this._keyModes,c=0;c<b.length;c++)if(b[c]===a){b.splice(c,1);break}a._modeRemoved&&a._modeRemoved()},removeRuler:function(a){for(var b=this._rulers,c=0;c<b.length;c++)if(b[c]===a){b.splice(c,1);a.setView(null);this._destroyRuler(a);this._update();break}},resize:function(){this._clientDiv&&this._handleResize(null)},setAction:function(a,b,c){if(a){var e=this._actions,d=e[a];
d||(d=e[a]={});d.handler=b;if(c!==void 0)d.actionDescription=c}},setKeyBinding:function(a,b){this._keyModes[0].setKeyBinding(a,b)},setCaretOffset:function(a,b,c){var e=this._model.getCharCount(),a=Math.max(0,Math.min(a,e));this._setSelection(new r(a,a,!1),b===void 0||b,!0,c)},setHorizontalPixel:function(a){this._clientDiv&&(a=Math.max(0,a),this._scrollView(a-this._getScroll().x,0))},setRedraw:function(a){a?--this._redrawCount===0&&this.redraw():this._redrawCount++},setModel:function(a){if(a&&a!==
this._model){this._model.removeEventListener("preChanging",this._modelListener.onChanging);this._model.removeEventListener("postChanged",this._modelListener.onChanged);var b=this._model.getLineCount(),c=this._model.getCharCount(),e=a.getLineCount(),d=a.getCharCount(),f={type:"ModelChanging",text:a.getText(),start:0,removedCharCount:c,addedCharCount:d,removedLineCount:b,addedLineCount:e};this.onModelChanging(f);this._model=a;f={type:"ModelChanged",start:0,removedCharCount:c,addedCharCount:d,removedLineCount:b,
addedLineCount:e};this.onModelChanged(f);this._model.addEventListener("preChanging",this._modelListener.onChanging);this._model.addEventListener("postChanged",this._modelListener.onChanged);this._reset();this._update()}},setOptions:function(a){var c=this._defaultOptions(),e;for(e in a)if(a.hasOwnProperty(e)){var d=a[e];if(!b(this["_"+e],d)){var f=c[e]?c[e].update:null;f?f.call(this,d):this["_"+e]=h(d)}}},setSelection:function(a,b,c,e){var d=a>b;if(d)var f=a,a=b,b=f;f=this._model.getCharCount();a=
Math.max(0,Math.min(a,f));b=Math.max(0,Math.min(b,f));this._setSelection(new r(a,b,d),c===void 0||c,!0,e)},setText:function(a,b,c){var e=b===void 0&&c===void 0;b===void 0&&(b=0);c===void 0&&(c=this._model.getCharCount());if(e)this._variableLineHeight=!1;this._modifyContent({text:a,start:b,end:c,_code:!0},!e);if(e)this._columnX=-1,this._setSelection(new r(0,0,!1),!0),f.isFirefox&&this._fixCaret()},setTopIndex:function(a){this._clientDiv&&this._scrollView(0,this._getLinePixel(Math.max(0,a))-this._getScroll().y)},
setTopPixel:function(a){this._clientDiv&&this._scrollView(0,Math.max(0,a)-this._getScroll().y)},showSelection:function(){return this._showCaret(!0)},update:function(a,b){this._clientDiv&&(a&&this._updateStyle(),b===void 0||b?this._update():this._queueUpdate())},_handleRootMouseDown:function(a){if(!this._ignoreEvent(a)){if(f.isFirefox&&a.which===1)this._clientDiv.contentEditable=!1,this._ignoreBlur=(this._overlayDiv||this._clientDiv).draggable=!0;var b=this._overlayDiv||this._clientDiv;if(f.isIE<9)b=
this._viewDiv;for(var c=a.target?a.target:a.srcElement;c;){if(b===c)return;c=c.parentNode}a.preventDefault&&a.preventDefault();a.stopPropagation&&a.stopPropagation();if(!this._isW3CEvents){var e=this;this._getWindow().setTimeout(function(){e._clientDiv.focus()},0)}}},_handleRootMouseUp:function(a){if(!this._ignoreEvent(a)&&f.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(f.isIE<9&&!this._getSelection().isEmpty()){var a=this._rootDiv,b=f.createElement(a.ownerDocument,"div");a.appendChild(b);a.removeChild(b)}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(),b=this._selDiv1.ownerDocument,a.getSelection){b=a.getSelection();for(a=b.anchorNode;a;){if(a===this._clientDiv){b.rangeCount>0&&b.removeAllRanges();
break}a=a.parentNode}}else if(b.selection){this._ignoreSelect=!1;for(a=b.selection.createRange().parentElement();a;){if(a===this._clientDiv){b.selection.empty();break}a=a.parentNode}this._ignoreSelect=!0}if(!this._ignoreFocus)this.onBlur({type:"Blur"})}},_handleContextMenu:function(a){if(!this._ignoreEvent(a)){f.isIE&&this._lastMouseButton===3&&this._updateDOMSelection();var b=!1;this.isListening("ContextMenu")?(b=this._createMouseEvent("ContextMenu",a),b.screenX=a.screenX,b.screenY=a.screenY,this.onContextMenu(b),
b=b.defaultPrevented):f.isMac&&f.isFirefox&&a.button===0&&(b=!0);if(b)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(f.isFirefox){var b=this;this._getWindow().setTimeout(function(){b._clientDiv.contentEditable=!0;b._clientDiv.draggable=!1;b._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));f.isFirefox&&(this._fixCaret(),a.dataTransfer.dropEffect==="none"&&!a.dataTransfer.mozUserCancelled&&this._fixCaret())}},_handleDragEnter:function(a){if(!this._ignoreEvent(a)){var b=!0;this._dropTarget=
!0;this.isListening("DragEnter")&&(b=!1,this.onDragEnter(this._createMouseEvent("DragEnter",a)));if(f.isWebkit||b)return a.preventDefault&&a.preventDefault(),!1}},_handleDragOver:function(a){if(!this._ignoreEvent(a)){var b=!0;this.isListening("DragOver")&&(b=!1,this.onDragOver(this._createMouseEvent("DragOver",a)));if(f.isWebkit||b){if(b)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;f.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 b=this._createKeyEvent("KeyDown",a);this.onKeyDown(b);if(b.defaultPrevented){if(f.isFirefox)this._keyDownPrevented=!0;a.preventDefault();return}}b=!1;switch(a.keyCode){case 16:case 17:case 18:case 91:b=!0;break;default:this._setLinksVisible(!1)}if(a.keyCode===229){if(this._readonly)return a.preventDefault&&
a.preventDefault(),!1;b=!0;if(f.isSafari&&f.isMac&&a.ctrlKey)b=!1,a.keyCode=129;b&&this._startIME()}else b||this._commitIME();if((f.isMac||f.isLinux)&&f.isFirefox<4||f.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(f.isMac&&f.isWebkit&&(63232<=a.keyCode&&a.keyCode<=63487||a.keyCode===13||a.keyCode===8))return a.preventDefault&&a.preventDefault(),!1;if(((f.isMac||f.isLinux)&&f.isFirefox<4||f.isOpera<12.16)&&this._doAction(this._keyDownEvent))return a.preventDefault&&a.preventDefault(),!1;var b=f.isMac?a.metaKey:a.ctrlKey;if(a.charCode!==void 0&&b)switch(a.charCode){case 99:case 118:case 120:return!0}if(this.isListening("KeyPress")&&(b=this._createKeyEvent("KeyPress",a),this.onKeyPress(b),b.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;b=!1;if(f.isMac){if(a.ctrlKey||a.metaKey)b=!0}else if(f.isFirefox){if(a.ctrlKey||a.altKey)b=!0}else a.ctrlKey^a.altKey&&(b=!0);if(!b&&(b=f.isOpera?a.which:a.charCode!==void 0?a.charCode:a.keyCode,b>31))return this._doContent(String.fromCharCode(b)),a.preventDefault&&a.preventDefault(),!1}},_handleDocKeyUp:function(a){(f.isMac?a.metaKey:a.ctrlKey)||this._setLinksVisible(!1)},
_handleKeyUp:function(a){if(!this._ignoreEvent(a)){if(this.isListening("KeyUp")){var b=this._createKeyEvent("KeyUp",a);this.onKeyUp(b);if(b.defaultPrevented){a.preventDefault();return}}this._handleDocKeyUp(a);a.keyCode===13&&this._commitIME()}},_handleLinkClick:function(a){if(!(f.isMac?a.metaKey:a.ctrlKey))return a.preventDefault&&a.preventDefault(),!1},_handleMouse:function(a){var b=this._getWindow(),c=!0,e=b;if(f.isIE||f.isFirefox&&!this._overlayDiv)e=this._clientDiv;if(this._overlayDiv){if(this._hasFocus)this._ignoreFocus=
!0;var d=this;b.setTimeout(function(){d.focus();d._ignoreFocus=!1},0)}this._clickCount===1?(c=this._setSelectionTo(a.clientX,a.clientY,a.shiftKey,(!f.isOpera||f.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 c},_handleMouseDown:function(a){if(!this._ignoreEvent(a)){if(this._linksVisible)if((a.target||
a.srcElement).tagName!=="A")this._setLinksVisible(!1);else return;this._commitIME();var b=a.which;b||(a.button===4&&(b=2),a.button===2&&(b=3),a.button===1&&(b=1));var c=b!==2&&a.timeStamp?a.timeStamp:(new Date).getTime(),e=c-this._lastMouseTime,d=Math.abs(this._lastMouseX-a.clientX),h=Math.abs(this._lastMouseY-a.clientY),g=this._lastMouseButton===b;this._lastMouseX=a.clientX;this._lastMouseY=a.clientY;this._lastMouseTime=c;this._lastMouseButton=b;if(b===1)this._isMouseDown=!0,g&&e<=this._clickTime&&
d<=this._clickDist&&h<=this._clickDist?this._clickCount++:this._clickCount=1;if(this.isListening("MouseDown")&&(c=this._createMouseEvent("MouseDown",a),this.onMouseDown(c),c.defaultPrevented)){a.preventDefault();return}if(b===1&&this._handleMouse(a)&&(f.isIE>=9||f.isOpera||f.isChrome||f.isSafari||f.isFirefox&&!this._overlayDiv))this._hasFocus||this.focus(),a.preventDefault();f.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 b=this._isClientDiv(a);if(this.isListening("MouseMove")&&b)this.onMouseMove(this._createMouseEvent("MouseMove",a));if(!this._dropTarget){var c=this._linksVisible||this._lastMouseMoveX!==
a.clientX||this._lastMouseMoveY!==a.clientY;this._lastMouseMoveX=a.clientX;this._lastMouseMoveY=a.clientY;this._setLinksVisible(c&&!this._isMouseDown&&(f.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&&b)return this._clickCount=2,this._handleMouse(a,this._clickCount)}if(this._isMouseDown&&this._dragOffset===-1){var b=a.clientX,a=a.clientY,e=this._getViewPadding(),d=this._viewDiv.getBoundingClientRect(),
h=this._getClientWidth(),g=this._getClientHeight(),c=d.left+e.left,l=d.top+e.top,h=d.left+e.left+h,e=d.top+e.top+g;a<l?this._doAutoScroll("up",b,a-l):a>e?this._doAutoScroll("down",b,a-e):b<c&&!this._wrapMode?this._doAutoScroll("left",b-c,a):b>h&&!this._wrapMode?this._doAutoScroll("right",b-h,a):(this._endAutoScroll(),this._setSelectionTo(b,a,!0))}}}},_isClientDiv:function(a){for(var b=this._overlayDiv||this._clientDiv,a=a.target?a.target:a.srcElement;a;){if(b===a)return!0;a=a.parentNode}return!1},
_createKeyEvent:function(a,b){return{type:a,event:b,preventDefault:function(){this.defaultPrevented=!0}}},_createMouseEvent:function(a,b){var c=this.convert({x:b.clientX,y:b.clientY},"page","document");return{type:a,event:b,clickCount:this._clickCount,x:c.x,y:c.y,preventDefault:function(){this.defaultPrevented=!0}}},_handleMouseUp:function(a){var b=a.which?a.button===0:a.button===1;if(this.isListening("MouseUp")&&(this._isClientDiv(a)||b&&this._isMouseDown))this.onMouseUp(this._createMouseEvent("MouseUp",
a));if(!this._linksVisible&&b&&this._isMouseDown){if(this._dragOffset!==-1)b=this._getSelection(),b.extend(this._dragOffset),b.collapse(),this._setSelection(b,!0,!0),this._dragOffset=-1;this._isMouseDown=!1;this._endAutoScroll();this._isW3CEvents&&this._setGrab(null);f.isFirefox&&a.preventDefault()}},_handleMouseWheel:function(a){var b=this._getLineHeight(),c=0,e=0;f.isIE||f.isOpera?e=-a.wheelDelta/40*b:f.isFirefox?a.type==="wheel"?a.deltaMode?(c=Math.max(-256,Math.min(256,a.deltaX))*b,e=Math.max(-256,
Math.min(256,a.deltaY))*b):(c=a.deltaX,e=a.deltaY):(b=f.isMac?a.detail*3:Math.max(-256,Math.min(256,a.detail))*b,a.axis===a.HORIZONTAL_AXIS?c=b:e=b):f.isMac?(e=a.timeStamp-this._wheelTimeStamp,this._wheelTimeStamp=a.timeStamp,c=a.wheelDeltaX%120!==0?1:e<40?40/(40-e):40,e=a.wheelDeltaY%120!==0?1:e<40?40/(40-e):40,c=Math.ceil(-a.wheelDeltaX/c),-1<c&&c<0&&(c=-1),0<c&&c<1&&(c=1),e=Math.ceil(-a.wheelDeltaY/e),-1<e&&e<0&&(e=-1),0<e&&e<1&&(e=1)):(c=-a.wheelDeltaX,e=-a.wheelDeltaY/120*8*b);if(f.isSafari||
f.isChrome&&f.isMac){for(b=a.target;b&&b.lineIndex===void 0;)b=b.parentNode;this._mouseWheelLine=b}b=this._getScroll();this._scrollView(c,e);c=this._getScroll();if(b.x!==c.x||b.y!==c.y)return a.preventDefault&&a.preventDefault(),!1},_handlePaste:function(a){if(!this._ignoreEvent(a)&&!this._ignorePaste&&this._doPaste(a)){if(f.isIE){var b=this;this._ignoreFocus=!0;this._getWindow().setTimeout(function(){b._updateDOMSelection();b._ignoreFocus=!1},0)}a.preventDefault&&a.preventDefault();return!1}},_handleResize:function(){var a=
this._rootDiv.clientWidth,c=this._rootDiv.clientHeight;if(this._rootWidth!==a||this._rootHeight!==c){this._rootWidth!==a&&this._wrapMode&&this._resetLineHeight();this._rootWidth=a;this._rootHeight=c;a=f.isIE<9;c=this._calculateMetrics();if(!b(c,this._metrics)){if(this._variableLineHeight)this._variableLineHeight=!1,this._resetLineHeight();this._metrics=c;a=!0}a?this._queueUpdate():this._update()}},_handleRulerEvent:function(a){for(var b=a.target?a.target:a.srcElement,c=b.lineIndex;b&&!b._ruler;){if(c===
void 0&&b.lineIndex!==void 0)c=b.lineIndex;b=b.parentNode}var e=b?b._ruler:null;if(c===void 0&&e&&e.getOverview()==="document"){var c=this._getClientHeight(),d=this._model.getLineCount(),f=this._getViewPadding(),h=this._viewDiv.getBoundingClientRect(),c=Math.floor((a.clientY-h.top-this._metrics.scrollWidth)*d/(c+f.top+f.bottom-2*this._metrics.scrollWidth));0<=c&&c<d||(c=void 0)}if(e)switch(a.type){case "click":if(e.onClick)e.onClick(c,a);break;case "dblclick":if(e.onDblClick)e.onDblClick(c,a);break;
case "mousemove":if(e.onMouseMove)e.onMouseMove(c,a);break;case "mouseover":if(e.onMouseOver)e.onMouseOver(c,a);break;case "mouseout":if(e.onMouseOut){for(d=a.relatedTarget;d&&d!==this._rootDiv;){if(d===b)return;d=d.parentNode}e.onMouseOut(c,a)}}},_handleScroll:function(){var a=this._getScroll(!1),b=this._hScroll,c=this._vScroll;if(b!==a.x||c!==a.y)this._hScroll=a.x,this._vScroll=a.y,this._commitIME(),this._update(c===a.y),this.onScroll({type:"Scroll",oldValue:{x:b,y:c},newValue:a})},_handleSelectStart:function(a){if(this._ignoreSelect)return a&&
a.preventDefault&&a.preventDefault(),!1},_getModelOffset:function(a,b){if(a){var c;c=a.tagName==="DIV"?a:a.parentNode.parentNode;var e=0,d=c.lineIndex;if(a.tagName!=="DIV")for(c=c.firstChild;c;){var f=c.firstChild;if(f===a){c.ignoreChars&&(e-=c.ignoreChars);e+=b;break}c.ignoreChars&&(e-=c.ignoreChars);e+=f.data.length;c=c.nextSibling}return Math.max(0,e)+this._model.getLineStart(d)}},_updateSelectionFromDOM:function(){var a=this._getWindow().getSelection(),b=this._getModelOffset(a.anchorNode,a.anchorOffset),
a=this._getModelOffset(a.focusNode,a.focusOffset);b===void 0||a===void 0||this._setSelection(new r(b,a),!1,!1)},_handleSelectionChange:function(){if(this._imeOffset===-1)if(f.isAndroid){var a=this._getWindow();this._selTimer&&a.clearTimeout(this._selTimer);var b=this;this._selTimer=a.setTimeout(function(){if(b._clientDiv)b._selTimer=null,b._updateSelectionFromDOM()},250)}else this._updateSelectionFromDOM()},_handleTextInput:function(a){if(!this._ignoreEvent(a)){this._imeOffset=-1;var b=this._getWindow().getSelection();
if(b.anchorNode!==this._anchorNode||b.focusNode!==this._focusNode||b.anchorOffset!==this._anchorOffset||b.focusOffset!==this._focusOffset){for(var c=b.anchorNode;c;){if(c.lineIndex!==void 0)break;c=c.parentNode}if(c){var e=this._model,d=c.lineIndex,f=e.getLine(d),h=f,g=0,e=e.getLineStart(d);if(b.rangeCount>0)b.getRangeAt(0).deleteContents(),d=c.ownerDocument.createTextNode(a.data),b.getRangeAt(0).insertNode(d),g=this._getDOMText(c,d),h=g.text,g=g.offset,d.parentNode.removeChild(d);c.lineRemoved=!0;
for(c=0;f.charCodeAt(c)===h.charCodeAt(c)&&c<g;)c++;b=f.length-1;for(d=h.length-f.length;f.charCodeAt(b)===h.charCodeAt(b+d)&&b+d>=g+a.data.length;)b--;b++;f=h.substring(c,b+d);c+=e;b+=e;this._modifyContent({text:f,start:c,end:b,_ignoreDOMSelection:!0},!0)}}else this._doContent(a.data);a.preventDefault()}},_handleTouchStart:function(a){this._commitIME();var b=this._getWindow();if(this._touchScrollTimer)this._vScrollDiv.style.display="none",this._hScrollDiv.style.display="none",b.clearInterval(this._touchScrollTimer),
this._touchScrollTimer=null;var c=a.touches;if(c.length===1){var c=c[0],e=c.clientX,d=c.clientY;this._touchStartX=e;this._touchStartY=d;if(f.isAndroid&&(d<c.pageY-b.pageYOffset||e<c.pageX-b.pageXOffset))e=c.pageX-b.pageXOffset,d=c.pageY-b.pageYOffset;b=this.convert({x:e,y:d},"page","document");this._lastTouchOffset=this.getOffsetAtLocation(b.x,b.y);this._touchStartTime=a.timeStamp;this._touching=!0}},_handleTouchMove:function(a){var b=a.touches;if(b.length===1){b=b[0];this._touchCurrentX=b.clientX;
this._touchCurrentY=b.clientY;if(!this._touchScrollTimer&&a.timeStamp-this._touchStartTime<200){this._vScrollDiv.style.display="block";if(!this._wrapMode)this._hScrollDiv.style.display="block";var c=this,e=this._getWindow();this._touchScrollTimer=e.setInterval(function(){var a=0,b=0;if(c._touching)a=c._touchStartX-c._touchCurrentX,b=c._touchStartY-c._touchCurrentY,c._touchSpeedX=a/10,c._touchSpeedY=b/10,c._touchStartX=c._touchCurrentX,c._touchStartY=c._touchCurrentY;else if(Math.abs(c._touchSpeedX)<
0.1&&Math.abs(c._touchSpeedY)<0.1){c._vScrollDiv.style.display="none";c._hScrollDiv.style.display="none";e.clearInterval(c._touchScrollTimer);c._touchScrollTimer=null;return}else a=c._touchSpeedX*10,b=c._touchSpeedY*10,c._touchSpeedX*=0.95,c._touchSpeedY*=0.95;c._scrollView(a,b)},10)}this._touchScrollTimer&&a.preventDefault()}},_handleTouchEnd:function(a){if(a.touches.length===0)this._touching=!1},_doAction:function(a){var b,c,e=this._keyModes;for(c=e.length-1;c>=0;c--)if(b=e[c],typeof b.match===
"function"&&(b=b.match(a),b!==void 0))return this.invokeAction(b);return!1},_doMove:function(a,b){var c=this._model,e=b.getCaret(),d=c.getLineAtOffset(e);if(!a.count)a.count=1;for(;a.count!==0;){var f=c.getLineStart(d);if(a.count<0&&e===f)if(d>0)a.unit==="character"&&a.count++,d--,b.extend(c.getLineEnd(d));else break;else if(a.count>0&&e===c.getLineEnd(d))if(d+1<c.getLineCount())a.unit==="character"&&a.count--,d++,b.extend(c.getLineStart(d));else break;else{var h=!1;a.expandTab&&a.unit==="character"&&
(e-f)%this._tabSize===0&&(h=!/[^ ]/.test(c.getText(f,e)));h?(b.extend(e-this._tabSize),a.count+=a.count<0?1:-1):(f=this._getLine(d),b.extend(f.getNextOffset(e,a)),f.destroy())}e=b.getCaret()}return b},_doBackspace:function(a){var b=this._getSelection();if(b.isEmpty()){if(!a.count)a.count=1;a.count*=-1;a.expandTab=this._expandTab;this._doMove(a,b)}this._modifyContent({text:"",start:b.start,end:b.end},!0);return!0},_doCase:function(a){var b=this._getSelection();this._doMove(a,b);var c=this.getText(b.start,
b.end);this._setSelection(b,!0);switch(a.type){case "lower":c=c.toLowerCase();break;case "capitalize":c=c.replace(/(?:^|\s)\S/g,function(a){return a.toUpperCase()});break;case "reverse":a="";for(b=0;b<c.length;b++){var e=c[b],d=e.toLowerCase(),e=d!==e?d:e.toUpperCase();a+=e}c=a;break;default:c=c.toUpperCase()}this._doContent(c);return!0},_doContent:function(a){var b=this._getSelection();if(this._overwriteMode&&b.isEmpty()){var c=this._model,e=c.getLineAtOffset(b.end);b.end<c.getLineEnd(e)&&(c=this._getLine(e),
b.extend(c.getNextOffset(b.getCaret(),{unit:"character",count:1})),c.destroy())}this._modifyContent({text:a,start:b.start,end:b.end,_ignoreDOMSelection:!0},!0)},_doCopy:function(a){var b=this._getSelection();return!b.isEmpty()?this._setClipboardText(this._getBaseText(b.start,b.end),a):!0},_doCursorNext:function(a){var b=this._getSelection();!b.isEmpty()&&!a.select?b.start=b.end:this._doMove(a,b);a.select||b.collapse();this._setSelection(b,!0);return!0},_doCursorPrevious:function(a){var b=this._getSelection();
if(!b.isEmpty()&&!a.select)b.end=b.start;else{if(!a.count)a.count=1;a.count*=-1;this._doMove(a,b)}a.select||b.collapse();this._setSelection(b,!0);return!0},_doCut:function(a){var b=this._getSelection();return!b.isEmpty()?(b=this._getBaseText(b.start,b.end),this._doContent(""),this._setClipboardText(b,a)):!0},_doDelete:function(a){var b=this._getSelection();b.isEmpty()&&this._doMove(a,b);this._modifyContent({text:"",start:b.start,end:b.end},!0);return!0},_doEnd:function(a){var b=this._getSelection(),
c=this._model,e;if(a.ctrl)b.extend(c.getCharCount()),e=function(){};else{var d=b.getCaret(),f=c.getLineAtOffset(d);if(this._wrapMode){var h=this._getLine(f),d=h.getLineIndex(d),d=d===h.getLineCount()-1?c.getLineEnd(f):h.getLineStart(d+1)-1;h.destroy()}else a.count&&a.count>0&&(f=Math.min(f+a.count-1,c.getLineCount()-1)),d=c.getLineEnd(f);b.extend(d)}a.select||b.collapse();this._setSelection(b,!0,!0,e);return!0},_doEnter:function(a){var b=this._model,c=this._getSelection();this._doContent(b.getLineDelimiter());
if(a&&a.noCursor)c.end=c.start,this._setSelection(c,!0);return!0},_doHome:function(a){var b=this._getSelection(),c=this._model,e;if(a.ctrl)b.extend(0),e=function(){};else{var d=b.getCaret(),f=c.getLineAtOffset(d);this._wrapMode?(c=this._getLine(f),d=c.getLineIndex(d),d=c.getLineStart(d),c.destroy()):d=c.getLineStart(f);b.extend(d)}a.select||b.collapse();this._setSelection(b,!0,!0,e);return!0},_doLineDown:function(a){var b=this._model,c=this._getSelection(),e=c.getCaret(),d=b.getLineAtOffset(e),h=
this._getLine(d),g=this._columnX,l=1,i=!1;if(g===-1||a.wholeLine||a.select&&f.isIE)g=a.wholeLine?b.getLineEnd(d+1):e,g=h.getBoundingClientRect(g).left;(e=h.getLineIndex(e))<h.getLineCount()-1?l=h.getClientRects(e+1).top+1:(e=b.getLineCount()-1,i=d===e,a.count&&a.count>0?d=Math.min(d+a.count,e):d++);e=!1;if(i){if(a.select||f.isMac||f.isLinux)c.extend(b.getCharCount()),e=!0}else h.lineIndex!==d&&(h.destroy(),h=this._getLine(d)),c.extend(h.getOffset(g,l)),e=!0;e&&(a.select||c.collapse(),this._setSelection(c,
!0,!0));this._columnX=g;h.destroy();return!0},_doLineUp:function(a){var b=this._model,c=this._getSelection(),e=c.getCaret(),d=b.getLineAtOffset(e),h=this._getLine(d),g=this._columnX,l=!1,i;if(g===-1||a.wholeLine||a.select&&f.isIE)g=a.wholeLine?b.getLineStart(d-1):e,g=h.getBoundingClientRect(g).left;(e=h.getLineIndex(e))>0?i=h.getClientRects(e-1).top+1:(l=d===0,l||(a.count&&a.count>0?d=Math.max(d-a.count,0):d--,i=this._getLineHeight(d)-1));e=!1;if(l){if(a.select||f.isMac||f.isLinux)c.extend(0),e=!0}else h.lineIndex!==
d&&(h.destroy(),h=this._getLine(d)),c.extend(h.getOffset(g,i)),e=!0;e&&(a.select||c.collapse(),this._setSelection(c,!0,!0));this._columnX=g;h.destroy();return!0},_doNoop:function(){return!0},_doPageDown:function(a){var b=this,c=this._model,e=this._getSelection(),d=e.getCaret(),h=c.getLineAtOffset(d),g=c.getLineCount(),l=this._getScroll(),c=this._getClientHeight(),i,m;if(this._lineHeight){i=this._columnX;l=this._getBoundsAtOffset(d);if(i===-1||a.select&&f.isIE)i=l.left;d=this._getLineIndex(l.top+c);
m=this._getLine(d);h=this._getLinePixel(d);d=m.getOffset(i,l.top+c-h);c=m.getBoundingClientRect(d);m.destroy();e.extend(d);a.select||e.collapse();this._setSelection(e,!0,!0,function(){b._columnX=i},c.top+h-l.top);return!0}if(h<g-1){var j=this._getLineHeight(),o=Math.min(g-h-1,Math.floor(c/j)),o=Math.max(1,o);i=this._columnX;if(i===-1||a.select&&f.isIE)m=this._getLine(h),i=m.getBoundingClientRect(d).left,m.destroy();m=this._getLine(h+o);e.extend(m.getOffset(i,0));m.destroy();a.select||e.collapse();
a=g*j;d=l.y+o*j;d+c>a&&(d=a-c);this._setSelection(e,!0,!0,function(){b._columnX=i},d-l.y)}return!0},_doPageUp:function(a){var b=this,c=this._model,e=this._getSelection(),d=e.getCaret(),h=c.getLineAtOffset(d),g=this._getScroll(),l=this._getClientHeight(),i;if(this._lineHeight){i=this._columnX;g=this._getBoundsAtOffset(d);if(i===-1||a.select&&f.isIE)i=g.left;d=this._getLineIndex(g.bottom-l);c=this._getLine(d);h=this._getLinePixel(d);d=c.getOffset(i,g.bottom-l-h);l=c.getBoundingClientRect(d);c.destroy();
e.extend(d);a.select||e.collapse();this._setSelection(e,!0,!0,function(){b._columnX=i},l.top+h-g.top);return!0}if(h>0){var m=this._getLineHeight(),l=Math.max(1,Math.min(h,Math.floor(l/m)));i=this._columnX;if(i===-1||a.select&&f.isIE)c=this._getLine(h),i=c.getBoundingClientRect(d).left,c.destroy();c=this._getLine(h-l);e.extend(c.getOffset(i,this._getLineHeight(h-l)-1));c.destroy();a.select||e.collapse();a=Math.max(0,g.y-l*m);this._setSelection(e,!0,!0,function(){b._columnX=i},a-g.y)}return!0},_doPaste:function(a){var b=
this;return this._getClipboardText(a,function(a){a&&(f.isLinux&&b._lastMouseButton===2&&(new Date).getTime()-b._lastMouseTime<=b._clickTime&&b._setSelectionTo(b._lastMouseX,b._lastMouseY),b._doContent(a))})!==null},_doScroll:function(a){var b=a.type,c=this._model,e=c.getLineCount(),a=this._getClientHeight(),d=this._getLineHeight();e*=d;var f=this._getScroll().y,h;switch(b){case "textStart":h=0;break;case "textEnd":h=e-a;break;case "pageDown":h=f+a;break;case "pageUp":h=f-a;break;case "lineDown":h=
f+d;break;case "lineUp":h=f-d;break;case "centerLine":b=this._getSelection(),h=c.getLineAtOffset(b.start),c=(c.getLineAtOffset(b.end)-h+1)*d,h=h*d-a/2+c/2}h!==void 0&&(h=Math.min(Math.max(0,h),e-a),this._scrollViewAnimated(0,h-f,function(){}));return!0},_doSelectAll:function(){var a=this._model,b=this._getSelection();b.setCaret(0);b.extend(a.getCharCount());this._setSelection(b,!1);return!0},_doTab:function(){if(this._tabMode&&!this._readonly){var a="\t";if(this._expandTab)var b=this._model,a=this._getSelection().getCaret(),
c=b.getLineAtOffset(a),b=b.getLineStart(c),a=Array(this._tabSize-(a-b)%this._tabSize+1).join(" ");this._doContent(a);return!0}},_doShiftTab:function(){return!this._tabMode||this._readonly?void 0:!0},_doOverwriteMode:function(){if(!this._readonly)return this.setOptions({overwriteMode:!this.getOptions("overwriteMode")}),!0},_doTabMode:function(){this._tabMode=!this._tabMode;return!0},_doWrapMode:function(){this.setOptions({wrapMode:!this.getOptions("wrapMode")});return!0},_autoScroll:function(){var a=
this._model,b=this._getSelection(),c=this.convert({x:this._autoScrollX,y:this._autoScrollY},"page","document"),e=b.getCaret(),d=a.getLineCount(),h=a.getLineAtOffset(e),g;if(this._autoScrollDir==="up"||this._autoScrollDir==="down")e=this._autoScrollY/this._getLineHeight(),e=e<0?Math.floor(e):Math.ceil(e),g=Math.max(0,Math.min(d-1,h+e));else if(this._autoScrollDir==="left"||this._autoScrollDir==="right")g=this._getLineIndex(c.y),h=this._getLine(h),c.x+=h.getBoundingClientRect(e,!1).left,h.destroy();
g===0&&(f.isMac||f.isLinux)?b.extend(0):g===d-1&&(f.isMac||f.isLinux)?b.extend(a.getCharCount()):(h=this._getLine(g),b.extend(h.getOffset(c.x,c.y-this._getLinePixel(g))),h.destroy());this._setSelection(b,!0)},_autoScrollTimer:function(){this._autoScroll();var a=this;this._autoScrollTimerID=this._getWindow().setTimeout(function(){a._autoScrollTimer()},this._AUTO_SCROLL_RATE)},_calculateLineHeightTimer:function(a){if(this._lineHeight&&!this._calculateLHTimer){var b=this._model.getLineCount(),c=0;if(a){for(var a=
0,e=(new Date).getTime(),d=0;c<b;)if(this._lineHeight[c]||(a++,d||(d=c),this._lineHeight[c]=this._calculateLineHeight(c)),c++,(new Date).getTime()-e>100)break;this.redrawRulers(0,b);this._queueUpdate()}a=this._getWindow();if(c!==b){var f=this;this._calculateLHTimer=a.setTimeout(function(){f._calculateLHTimer=null;f._calculateLineHeightTimer(!0)},0)}else if(this._calculateLHTimer)a.clearTimeout(this._calculateLHTimer),this._calculateLHTimer=void 0}},_calculateLineHeight:function(a){var a=this._getLine(a),
b=a.getBoundingClientRect();a.destroy();return Math.max(1,b.bottom-b.top)},_calculateMetrics:function(){var a=this._clientDiv,b=a.ownerDocument,c=f.createElement(b,"div");c.style.lineHeight="normal";var d={type:"LineStyle",textView:this,0:0,lineText:this._model.getLine(0),lineStart:0};this.onLineStyle(d);e(d.style,c);c.style.position="fixed";c.style.left="-1000px";var h=f.createElement(b,"span");h.appendChild(b.createTextNode(" "));c.appendChild(h);var g=f.createElement(b,"span");g.style.fontStyle=
"italic";g.appendChild(b.createTextNode(" "));c.appendChild(g);var l=f.createElement(b,"span");l.style.fontWeight="bold";l.appendChild(b.createTextNode(" "));c.appendChild(l);d=f.createElement(b,"span");d.style.fontWeight="bold";d.style.fontStyle="italic";d.appendChild(b.createTextNode(" "));c.appendChild(d);a.appendChild(c);var i=c.getBoundingClientRect(),h=h.getBoundingClientRect(),g=g.getBoundingClientRect(),l=l.getBoundingClientRect(),d=d.getBoundingClientRect(),h=h.bottom-h.top,g=g.bottom-g.top,
l=l.bottom-l.top,j=d.bottom-d.top,k=0,d=i.bottom-i.top<=0,i=Math.max(1,i.bottom-i.top);g>h&&(k=1);l>g&&(k=2);j>l&&(k=3);var r;if(k!==0){r={style:{}};if((k&1)!==0)r.style.fontStyle="italic";if((k&2)!==0)r.style.fontWeight="bold"}h=o(c);a.removeChild(c);j=m(this._viewDiv);c=f.createElement(b,"div");c.style.position="fixed";c.style.left="-1000px";c.style.paddingLeft=j.left+"px";c.style.paddingTop=j.top+"px";c.style.paddingRight=j.right+"px";c.style.paddingBottom=j.bottom+"px";c.style.width="100px";c.style.height=
"100px";j=f.createElement(b,"div");j.style.width="100%";j.style.height="100%";c.appendChild(j);a.appendChild(c);k=c.getBoundingClientRect();g=j.getBoundingClientRect();l=0;if(!this._singleMode)c.style.overflow="hidden",j.style.height="200px",l=c.clientWidth,c.style.overflow="scroll",l-=c.clientWidth;a.removeChild(c);j={left:g.left-k.left,top:g.top-k.top,right:k.right-g.right,bottom:k.bottom-g.bottom};g=k=0;if(!d&&(this._wrapOffset||this._marginOffset))c=f.createElement(b,"div"),c.style.position="fixed",
c.style.left="-1000px",c.innerHTML=Array(this._wrapOffset+1).join(" "),a.appendChild(c),k=c.getBoundingClientRect(),k=Math.ceil(k.right-k.left),c.innerHTML=Array(this._marginOffset+1).join(" "),g=c.getBoundingClientRect(),g=Math.ceil(g.right-g.left),a.removeChild(c);return{lineHeight:i,largestFontStyle:r,lineTrim:h,viewPadding:j,scrollWidth:l,wrapWidth:k,marginWidth:g,invalid:d}},_cancelAnimation:function(){if(this._animation)this._animation.stop(),this._animation=null},_clearSelection:function(a){var b=
this._getSelection();if(b.isEmpty())return!1;a==="next"?b.start=b.end:b.end=b.start;this._setSelection(b,!0);return!0},_commitIME:function(){if(this._imeOffset!==-1){this._scrollDiv.focus();this._clientDiv.focus();var a=this._model,b=a.getLineAtOffset(this._imeOffset),c=a.getLineStart(b),e=this._getDOMText(this._getLineNode(b)).text,a=a.getLine(b),c=this._imeOffset-c,a=c+e.length-a.length;c!==a&&this._doContent(e.substring(c,a));this._imeOffset=-1}},_createActions:function(){this.addKeyMode(new i.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:j.lineUp}},lineDown:{defaultHandler:function(b){return a._doLineDown(c(b,{select:!1}))},actionDescription:{name:j.lineDown}},lineStart:{defaultHandler:function(b){return a._doHome(c(b,{select:!1,ctrl:!1}))},actionDescription:{name:j.lineStart}},lineEnd:{defaultHandler:function(b){return a._doEnd(c(b,{select:!1,ctrl:!1}))},actionDescription:{name:j.lineEnd}},
charPrevious:{defaultHandler:function(b){return a._doCursorPrevious(c(b,{select:!1,unit:"character"}))},actionDescription:{name:j.charPrevious}},charNext:{defaultHandler:function(b){return a._doCursorNext(c(b,{select:!1,unit:"character"}))},actionDescription:{name:j.charNext}},pageUp:{defaultHandler:function(b){return a._doPageUp(c(b,{select:!1}))},actionDescription:{name:j.pageUp}},pageDown:{defaultHandler:function(b){return a._doPageDown(c(b,{select:!1}))},actionDescription:{name:j.pageDown}},scrollPageUp:{defaultHandler:function(b){return a._doScroll(c(b,
{type:"pageUp"}))},actionDescription:{name:j.scrollPageUp}},scrollPageDown:{defaultHandler:function(b){return a._doScroll(c(b,{type:"pageDown"}))},actionDescription:{name:j.scrollPageDown}},scrollLineUp:{defaultHandler:function(b){return a._doScroll(c(b,{type:"lineUp"}))},actionDescription:{name:j.scrollLineUp}},scrollLineDown:{defaultHandler:function(b){return a._doScroll(c(b,{type:"lineDown"}))},actionDescription:{name:j.scrollLineDown}},wordPrevious:{defaultHandler:function(b){return a._doCursorPrevious(c(b,
{select:!1,unit:"word"}))},actionDescription:{name:j.wordPrevious}},wordNext:{defaultHandler:function(b){return a._doCursorNext(c(b,{select:!1,unit:"word"}))},actionDescription:{name:j.wordNext}},textStart:{defaultHandler:function(b){return a._doHome(c(b,{select:!1,ctrl:!0}))},actionDescription:{name:j.textStart}},textEnd:{defaultHandler:function(b){return a._doEnd(c(b,{select:!1,ctrl:!0}))},actionDescription:{name:j.textEnd}},scrollTextStart:{defaultHandler:function(b){return a._doScroll(c(b,{type:"textStart"}))},
actionDescription:{name:j.scrollTextStart}},scrollTextEnd:{defaultHandler:function(b){return a._doScroll(c(b,{type:"textEnd"}))},actionDescription:{name:j.scrollTextEnd}},centerLine:{defaultHandler:function(b){return a._doScroll(c(b,{type:"centerLine"}))},actionDescription:{name:j.centerLine}},selectLineUp:{defaultHandler:function(b){return a._doLineUp(c(b,{select:!0}))},actionDescription:{name:j.selectLineUp}},selectLineDown:{defaultHandler:function(b){return a._doLineDown(c(b,{select:!0}))},actionDescription:{name:j.selectLineDown}},
selectWholeLineUp:{defaultHandler:function(b){return a._doLineUp(c(b,{select:!0,wholeLine:!0}))},actionDescription:{name:j.selectWholeLineUp}},selectWholeLineDown:{defaultHandler:function(b){return a._doLineDown(c(b,{select:!0,wholeLine:!0}))},actionDescription:{name:j.selectWholeLineDown}},selectLineStart:{defaultHandler:function(b){return a._doHome(c(b,{select:!0,ctrl:!1}))},actionDescription:{name:j.selectLineStart}},selectLineEnd:{defaultHandler:function(b){return a._doEnd(c(b,{select:!0,ctrl:!1}))},
actionDescription:{name:j.selectLineEnd}},selectCharPrevious:{defaultHandler:function(b){return a._doCursorPrevious(c(b,{select:!0,unit:"character"}))},actionDescription:{name:j.selectCharPrevious}},selectCharNext:{defaultHandler:function(b){return a._doCursorNext(c(b,{select:!0,unit:"character"}))},actionDescription:{name:j.selectCharNext}},selectPageUp:{defaultHandler:function(b){return a._doPageUp(c(b,{select:!0}))},actionDescription:{name:j.selectPageUp}},selectPageDown:{defaultHandler:function(b){return a._doPageDown(c(b,
{select:!0}))},actionDescription:{name:j.selectPageDown}},selectWordPrevious:{defaultHandler:function(b){return a._doCursorPrevious(c(b,{select:!0,unit:"word"}))},actionDescription:{name:j.selectWordPrevious}},selectWordNext:{defaultHandler:function(b){return a._doCursorNext(c(b,{select:!0,unit:"word"}))},actionDescription:{name:j.selectWordNext}},selectTextStart:{defaultHandler:function(b){return a._doHome(c(b,{select:!0,ctrl:!0}))},actionDescription:{name:j.selectTextStart}},selectTextEnd:{defaultHandler:function(b){return a._doEnd(c(b,
{select:!0,ctrl:!0}))},actionDescription:{name:j.selectTextEnd}},deletePrevious:{defaultHandler:function(b){return a._doBackspace(c(b,{unit:"character"}))},actionDescription:{name:j.deletePrevious}},deleteNext:{defaultHandler:function(b){return a._doDelete(c(b,{unit:"character"}))},actionDescription:{name:j.deleteNext}},deleteWordPrevious:{defaultHandler:function(b){return a._doBackspace(c(b,{unit:"word"}))},actionDescription:{name:j.deleteWordPrevious}},deleteWordNext:{defaultHandler:function(b){return a._doDelete(c(b,
{unit:"word"}))},actionDescription:{name:j.deleteWordNext}},deleteLineStart:{defaultHandler:function(b){return a._doBackspace(c(b,{unit:"line"}))},actionDescription:{name:j.deleteLineStart}},deleteLineEnd:{defaultHandler:function(b){return a._doDelete(c(b,{unit:"line"}))},actionDescription:{name:j.deleteLineEnd}},tab:{defaultHandler:function(){return a._doTab()},actionDescription:{name:j.tab}},shiftTab:{defaultHandler:function(){return a._doShiftTab()},actionDescription:{name:j.shiftTab}},enter:{defaultHandler:function(){return a._doEnter()},
actionDescription:{name:j.enter}},enterNoCursor:{defaultHandler:function(b){return a._doEnter(c(b,{noCursor:!0}))},actionDescription:{name:j.enterNoCursor}},selectAll:{defaultHandler:function(){return a._doSelectAll()},actionDescription:{name:j.selectAll}},copy:{defaultHandler:function(){return a._doCopy()},actionDescription:{name:j.copy}},cut:{defaultHandler:function(){return a._doCut()},actionDescription:{name:j.cut}},paste:{defaultHandler:function(){return a._doPaste()},actionDescription:{name:j.paste}},
uppercase:{defaultHandler:function(b){return a._doCase(c(b,{type:"upper"}))},actionDescription:{name:j.uppercase}},lowercase:{defaultHandler:function(b){return a._doCase(c(b,{type:"lower"}))},actionDescription:{name:j.lowercase}},capitalize:{defaultHandler:function(b){return a._doCase(c(b,{unit:"word",type:"capitalize"}))},actionDescription:{name:j.capitalize}},reversecase:{defaultHandler:function(b){return a._doCase(c(b,{type:"reverse"}))},actionDescription:{name:j.reversecase}},toggleOverwriteMode:{defaultHandler:function(){return a._doOverwriteMode()},
actionDescription:{name:j.toggleOverwriteMode}},toggleTabMode:{defaultHandler:function(){return a._doTabMode()},actionDescription:{name:j.toggleTabMode}},toggleWrapMode:{defaultHandler:function(){return a._doWrapMode()},actionDescription:{name:j.toggleWrapMode}}}},_createRulerParent:function(a){var b=f.createElement(document,"div");b.className=a;b.tabIndex=-1;b.style.overflow="hidden";b.style.MozUserSelect="none";b.style.WebkitUserSelect="none";b.style.position="absolute";b.style.top="0px";b.style.bottom=
"0px";b.style.cursor="default";b.style.display="none";b.setAttribute("aria-hidden","true");this._rootDiv.appendChild(b);return b},_createRuler:function(a,b){if(this._clientDiv){var c=this._getRulerParent(a);if(c){if(c!==this._marginDiv||this._marginOffset)c.style.display="block";var e=f.createElement(c.ownerDocument,"div");e._ruler=a;e.rulerChanged=!0;e.style.position="relative";e.style.cssFloat="left";e.style.styleFloat="left";e.style.outline="none";if(b===void 0||b<0||b>=c.children.length)c.appendChild(e);
else{for(var d=c.firstChild;d&&b-- >0;)d=d.nextSibling;c.insertBefore(e,d)}}}},_createView:function(){if(!this._clientDiv){for(var a=this._parent;a.hasChildNodes();)a.removeChild(a.lastChild);var b=a.ownerDocument,c=f.createElement(b,"div");this._rootDiv=c;c.tabIndex=-1;c.style.position="relative";c.style.overflow="hidden";c.style.width="100%";c.style.height="100%";c.style.overflow="hidden";c.style.WebkitTextSizeAdjust="100%";c.setAttribute("role","application");a.appendChild(c);this._leftDiv=this._createRulerParent("textviewLeftRuler");
a=f.createElement(b,"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(f.isMac&&f.isWebkit)a.style.pointerEvents="none",a.style.zIndex="2";c.appendChild(a);var e=this._createRulerParent("textviewRightRuler");this._rightDiv=e;e.style.right="0px";this._scrollDiv=e=f.createElement(b,"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(!f.isIE&&!f.isIOS)this._clipDiv=a=f.createElement(b,"div"),a.style.position="absolute",a.style.overflow="hidden",a.style.margin="0px",a.style.borderWidth="0px",a.style.padding="0px",a.style.background="transparent",c.appendChild(a),this._clipScrollDiv=e=f.createElement(b,"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=f.createElement(b,"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(f.isIOS||f.isAndroid)a.style.WebkitTapHighlightColor="transparent";(this._clipDiv||c).appendChild(a);if(f.isIOS||f.isAndroid)this._vScrollDiv=
e=f.createElement(b,"div"),e.style.position="absolute",e.style.borderWidth="1px",e.style.borderColor="white",e.style.borderStyle="solid",e.style.borderRadius="4px",e.style.backgroundColor="black",e.style.opacity="0.5",e.style.margin="0px",e.style.padding="0px",e.style.outline="none",e.style.zIndex="3",e.style.width="8px",e.style.display="none",c.appendChild(e),this._hScrollDiv=e=f.createElement(b,"div"),e.style.position="absolute",e.style.borderWidth="1px",e.style.borderColor="white",e.style.borderStyle=
"solid",e.style.borderRadius="4px",e.style.backgroundColor="black",e.style.opacity="0.5",e.style.margin="0px",e.style.padding="0px",e.style.outline="none",e.style.zIndex="3",e.style.height="8px",e.style.display="none",c.appendChild(e);if(f.isFirefox&&!a.setCapture)this._overlayDiv=b=f.createElement(b,"div"),b.style.position=a.style.position,b.style.borderWidth=a.style.borderWidth,b.style.margin=a.style.margin,b.style.padding=a.style.padding,b.style.cursor="text",b.style.zIndex="2",(this._clipDiv||
c).appendChild(b);a.contentEditable="true";a.setAttribute("role","textbox");a.setAttribute("aria-multiline","true");this._setWrapMode(this._wrapMode,!0);this._setReadOnly(this._readonly);this._setThemeClass(this._themeClass,!0);this._setTabSize(this._tabSize,!0);this._setMarginOffset(this._marginOffset,!0);this._hookEvents();c=this._rulers;for(b=0;b<c.length;b++)this._createRuler(c[b]);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:a.TextTheme.getTheme(),update:this._setTheme},themeClass:{value:void 0,update:this._setThemeClass}}},_destroyRuler:function(a){var b=this._getRulerParent(a);if(b)for(var c=b.firstChild;c;){if(c._ruler===a){c._ruler=void 0;b.removeChild(c);if(b.children.length===0&&(b!==this._marginDiv||!this._marginOffset))b.style.display="none";break}c=c.nextSibling}},_destroyView:function(){if(this._clientDiv){this._setGrab(null);
this._unhookEvents();var a=this._getWindow();if(this._autoScrollTimerID)a.clearTimeout(this._autoScrollTimerID),this._autoScrollTimerID=null;if(this._updateTimer)a.clearTimeout(this._updateTimer),this._updateTimer=null;a=this._rootDiv;a.parentNode.removeChild(a);this._hScrollDiv=this._vScrollDiv=this._cursorDiv=this._marginDiv=this._rightDiv=this._leftDiv=this._overlayDiv=this._clientDiv=this._clipScrollDiv=this._clipDiv=this._viewDiv=this._scrollDiv=this._rootDiv=this._clipboardDiv=this._selDiv3=
this._selDiv2=this._selDiv1=null}},_doAutoScroll:function(a,b,c){this._autoScrollDir=a;this._autoScrollX=b;this._autoScrollY=c;this._autoScrollTimerID||this._autoScrollTimer()},_endAutoScroll:function(){this._autoScrollTimerID&&this._getWindow().clearTimeout(this._autoScrollTimerID);this._autoScrollTimerID=this._autoScrollDir=void 0},_fixCaret:function(){var a=this._clientDiv;if(a){var b=this._hasFocus;this._ignoreFocus=!0;b&&a.blur();a.contentEditable=!1;a.contentEditable=!0;b&&a.focus();this._ignoreFocus=
!1}},_getBaseText:function(a,b){var c=this._model;c.getBaseModel&&(a=c.mapOffset(a),b=c.mapOffset(b),c=c.getBaseModel());return c.getText(a,b)},_getBottomIndex:function(a){var b=this._bottomChild;if(a&&this._getClientHeight()>this._getLineHeight()){var a=b.getBoundingClientRect(),c=this._clientDiv.getBoundingClientRect();a.bottom>c.bottom&&(b=this._getLinePrevious(b)||b)}return b.lineIndex},_getBoundsAtOffset:function(a){var b=this._getLine(this._model.getLineAtOffset(a)),a=b.getBoundingClientRect(a),
c=this._getLinePixel(b.lineIndex);a.top+=c;a.bottom+=c;b.destroy();return a},_getClientHeight:function(){var a=this._getViewPadding();return Math.max(0,this._viewDiv.clientHeight-a.top-a.bottom)},_getClientWidth:function(){var a=this._getViewPadding();return Math.max(0,this._viewDiv.clientWidth-a.left-a.right)},_getClipboardText:function(a,b){var c=this._model.getLineDelimiter(),e,d,h=this._getWindow(),g=h.clipboardData;if(!g&&a)g=a.clipboardData;if(g)return e=[],d=g.getData(f.isIE?"Text":"text/plain"),
l(d,function(a){e.push(a)},function(){e.push(c)}),d=e.join(""),b&&b(d),d;if(f.isFirefox){this._ignoreFocus=!0;var i=this._clipboardDiv,g=this._rootDiv.ownerDocument;if(!i)this._clipboardDiv=i=f.createElement(g,"div"),i.style.position="fixed",i.style.whiteSpace="pre",i.style.left="-1000px",this._rootDiv.appendChild(i);i.innerHTML="<pre contenteditable=''></pre>";i.firstChild.focus();var m=this,j=function(){var a=m._getTextFromElement(i);i.innerHTML="";e=[];l(a,function(a){e.push(a)},function(){e.push(c)});
return e.join("")},o=!1;this._ignorePaste=!0;if(!f.isLinux||this._lastMouseButton!==2)try{o=g.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?(h.setTimeout(function(){m.focus();(d=j())&&b&&b(d);m._ignoreFocus=!1},0),null):(this.focus(),this._ignoreFocus=!1,"");this.focus();this._ignoreFocus=!1;(d=j())&&b&&b(d);return d}return""},_getDOMText:function(a,b){for(var c=a.firstChild,e="",d=0;c;){var f;if(!c.ignore)if(c.ignoreChars){f=
c.lastChild;for(var h=0,g=[],l=-1;f;){var i=f.data;if(i)for(var m=i.length-1;m>=0;m--){var j=i.substring(m,m+1);h<c.ignoreChars&&(j===" "||j==="\u200b"||j==="\ufeff")?h++:g.push(j==="\u00a0"?"\t":j)}if(b===f)l=g.length;f=f.previousSibling}g=g.reverse().join("");l!==-1&&(d=e.length+g.length-l);e+=g}else for(f=c.firstChild;f;){if(b===f)d=e.length;e+=f.data;f=f.nextSibling}c=c.nextSibling}return{text:e,offset:d}},_getTextFromElement:function(a){var b=a.ownerDocument,c=b.defaultView;if(!c.getSelection)return a.innerText||
a.textContent;b=b.createRange();b.selectNode(a);var a=c.getSelection(),c=[],e;for(e=0;e<a.rangeCount;e++)c.push(a.getRangeAt(e));this._ignoreSelect=!0;a.removeAllRanges();a.addRange(b);b=a.toString();a.removeAllRanges();for(e=0;e<c.length;e++)a.addRange(c[e]);this._ignoreSelect=!1;return b},_getViewPadding:function(){return this._metrics.viewPadding},_getLine:function(a){var b=this._getLineNode(a);return b&&!b.lineChanged&&!b.lineRemoved?b._line:new s(this,a)},_getLineHeight:function(a,b){if(a!==
void 0&&this._lineHeight){var c=this._lineHeight[a];if(c)return c;if(b||b===void 0)return this._lineHeight[a]=this._calculateLineHeight(a)}return this._metrics.lineHeight},_getLineNode:function(a){for(var b=this._clientDiv.firstChild;b;){if(a===b.lineIndex)return b;b=b.nextSibling}},_getLineNext:function(a){for(a=a?a.nextSibling:this._clientDiv.firstChild;a&&a.lineIndex===-1;)a=a.nextSibling;return a},_getLinePrevious:function(a){for(a=a?a.previousSibling:this._clientDiv.lastChild;a&&a.lineIndex===
-1;)a=a.previousSibling;return a},_getLinePixel:function(a){a=Math.min(Math.max(0,a),this._model.getLineCount());if(this._lineHeight){var b=this._getTopIndex(),c=-this._topIndexY+this._getScroll().y;if(a>b)for(;b<a;b++)c+=this._getLineHeight(b);else for(b-=1;b>=a;b--)c-=this._getLineHeight(b);return c}return this._getLineHeight()*a},_getLineIndex:function(a){var b,c=0,e=this._model.getLineCount();if(this._lineHeight){var c=this._getTopIndex(),d=-this._topIndexY+this._getScroll().y;if(a!==d)if(a<d)for(;a<
d&&c>0;)a+=this._getLineHeight(--c);else for(b=this._getLineHeight(c);a-b>=d&&c<e-1;)a-=b,b=this._getLineHeight(++c)}else b=this._getLineHeight(),c=Math.floor(a/b);return Math.max(0,Math.min(e-1,c))},_getRulerParent:function(a){switch(a.getLocation()){case "left":return this._leftDiv;case "right":return this._rightDiv;case "margin":return this._marginDiv}return null},_getScroll:function(a){(a===void 0||a)&&this._cancelAnimation();a=this._viewDiv;return{x:a.scrollLeft,y:a.scrollTop}},_getSelection:function(){return this._selection.clone()},
_getTopIndex:function(a){var b=this._topChild;if(a&&this._getClientHeight()>this._getLineHeight()){var a=b.getBoundingClientRect(),c=this._getViewPadding(),e=this._viewDiv.getBoundingClientRect();a.top<e.top+c.top&&(b=this._getLineNext(b)||b)}return b.lineIndex},_hookEvents:function(){var a=this;this._modelListener={onChanging:function(b){a._onModelChanging(b)},onChanged:function(b){a._onModelChanged(b)}};this._model.addEventListener("preChanging",this._modelListener.onChanging);this._model.addEventListener("postChanged",
this._modelListener.onChanged);this._themeListener={onChanged:function(){a._setThemeClass(a._themeClass)}};this._theme.addEventListener("ThemeChanged",this._themeListener.onChanged);var b=this._handlers=[],c=this._clientDiv,e=this._viewDiv,d=this._rootDiv,h=this._overlayDiv||c,g=c.ownerDocument,l=this._getWindow(),i=f.isIE?g:l;b.push({target:l,type:"resize",handler:function(b){return a._handleResize(b?b:l.event)}});b.push({target:c,type:"blur",handler:function(b){return a._handleBlur(b?b:l.event)}});
b.push({target:c,type:"focus",handler:function(b){return a._handleFocus(b?b:l.event)}});b.push({target:e,type:"focus",handler:function(){c.focus()}});b.push({target:e,type:"scroll",handler:function(b){return a._handleScroll(b?b:l.event)}});b.push({target:c,type:"textInput",handler:function(b){return a._handleTextInput(b?b:l.event)}});b.push({target:c,type:"keydown",handler:function(b){return a._handleKeyDown(b?b:l.event)}});b.push({target:c,type:"keypress",handler:function(b){return a._handleKeyPress(b?
b:l.event)}});b.push({target:c,type:"keyup",handler:function(b){return a._handleKeyUp(b?b:l.event)}});f.isIE&&b.push({target:g,type:"keyup",handler:function(b){return a._handleDocKeyUp(b?b:l.event)}});b.push({target:c,type:"contextmenu",handler:function(b){return a._handleContextMenu(b?b:l.event)}});b.push({target:c,type:"copy",handler:function(b){return a._handleCopy(b?b:l.event)}});b.push({target:c,type:"cut",handler:function(b){return a._handleCut(b?b:l.event)}});b.push({target:c,type:"paste",
handler:function(b){return a._handlePaste(b?b:l.event)}});if(f.isIOS||f.isAndroid)b.push({target:g,type:"selectionchange",handler:function(b){return a._handleSelectionChange(b?b:l.event)}}),b.push({target:c,type:"touchstart",handler:function(b){return a._handleTouchStart(b?b:l.event)}}),b.push({target:c,type:"touchmove",handler:function(b){return a._handleTouchMove(b?b:l.event)}}),b.push({target:c,type:"touchend",handler:function(b){return a._handleTouchEnd(b?b:l.event)}});else{b.push({target:c,type:"selectstart",
handler:function(b){return a._handleSelectStart(b?b:l.event)}});b.push({target:c,type:"mousedown",handler:function(b){return a._handleMouseDown(b?b:l.event)}});b.push({target:c,type:"mouseover",handler:function(b){return a._handleMouseOver(b?b:l.event)}});b.push({target:c,type:"mouseout",handler:function(b){return a._handleMouseOut(b?b:l.event)}});b.push({target:i,type:"mouseup",handler:function(b){return a._handleMouseUp(b?b:l.event)}});b.push({target:i,type:"mousemove",handler:function(b){return a._handleMouseMove(b?
b:l.event)}});b.push({target:d,type:"mousedown",handler:function(b){return a._handleRootMouseDown(b?b:l.event)}});b.push({target:d,type:"mouseup",handler:function(b){return a._handleRootMouseUp(b?b:l.event)}});b.push({target:h,type:"dragstart",handler:function(b){return a._handleDragStart(b?b:l.event)}});b.push({target:h,type:"drag",handler:function(b){return a._handleDrag(b?b:l.event)}});b.push({target:h,type:"dragend",handler:function(b){return a._handleDragEnd(b?b:l.event)}});b.push({target:h,
type:"dragenter",handler:function(b){return a._handleDragEnter(b?b:l.event)}});b.push({target:h,type:"dragover",handler:function(b){return a._handleDragOver(b?b:l.event)}});b.push({target:h,type:"dragleave",handler:function(b){return a._handleDragLeave(b?b:l.event)}});b.push({target:h,type:"drop",handler:function(b){return a._handleDrop(b?b:l.event)}});b.push({target:this._clientDiv,type:f.isFirefox>26?"wheel":f.isFirefox?"DOMMouseScroll":"mousewheel",handler:function(b){return a._handleMouseWheel(b?
b:l.event)}});this._clipDiv&&b.push({target:this._clipDiv,type:f.isFirefox>26?"wheel":f.isFirefox?"DOMMouseScroll":"mousewheel",handler:function(b){return a._handleMouseWheel(b?b:l.event)}});if(f.isFirefox&&(!f.isWindows||f.isFirefox>=15))(e=l.MutationObserver||l.MozMutationObserver)?(this._mutationObserver=new e(function(b){a._handleDataModified(b)}),this._mutationObserver.observe(c,{subtree:!0,characterData:!0})):b.push({target:this._clientDiv,type:"DOMCharacterDataModified",handler:function(b){return a._handleDataModified(b?
b:l.event)}});this._overlayDiv&&(b.push({target:this._overlayDiv,type:"mousedown",handler:function(b){return a._handleMouseDown(b?b:l.event)}}),b.push({target:this._overlayDiv,type:"mouseover",handler:function(b){return a._handleMouseOver(b?b:l.event)}}),b.push({target:this._overlayDiv,type:"mouseout",handler:function(b){return a._handleMouseOut(b?b:l.event)}}),b.push({target:this._overlayDiv,type:"contextmenu",handler:function(b){return a._handleContextMenu(b?b:l.event)}}));this._isW3CEvents||b.push({target:this._clientDiv,
type:"dblclick",handler:function(b){return a._handleDblclick(b?b:l.event)}})}this._hookRulerEvents(this._leftDiv,b);this._hookRulerEvents(this._rightDiv,b);this._hookRulerEvents(this._marginDiv,b);for(e=0;e<b.length;e++)d=b[e],p(d.target,d.type,d.handler,d.capture)},_hookRulerEvents:function(a,b){if(a){var c=this,e=this._getWindow();f.isIE&&b.push({target:a,type:"selectstart",handler:function(){return!1}});b.push({target:a,type:f.isFirefox>26?"wheel":f.isFirefox?"DOMMouseScroll":"mousewheel",handler:function(a){return c._handleMouseWheel(a?
a:e.event)}});b.push({target:a,type:"click",handler:function(a){c._handleRulerEvent(a?a:e.event)}});b.push({target:a,type:"dblclick",handler:function(a){c._handleRulerEvent(a?a:e.event)}});b.push({target:a,type:"mousemove",handler:function(a){c._handleRulerEvent(a?a:e.event)}});b.push({target:a,type:"mouseover",handler:function(a){c._handleRulerEvent(a?a:e.event)}});b.push({target:a,type:"mouseout",handler:function(a){c._handleRulerEvent(a?a:e.event)}})}},_getWindow:function(){return this._parent.ownerDocument.defaultView||
this._parent.ownerDocument.parentWindow},_ignoreEvent:function(a){for(a=a.target;a&&a!==this._clientDiv;){if(a.ignore)return!0;a=a.parentNode}return!1},_init:function(a){var b=a.parent;typeof b==="string"&&(b=(a.document||document).getElementById(b));if(!b)throw"no parent";a.parent=b;a.model=a.model||new k.TextModel;var c=this._defaultOptions(),e;for(e in c)c.hasOwnProperty(e)&&(this["_"+e]=a[e]!==void 0?a[e]:c[e].value);this._keyModes=[];this._rulers=[];this._selection=new r(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=(!f.isIE||f.isIE>=9)&&typeof b.ownerDocument.createRange().getBoundingClientRect==="function";this._isW3CEvents=b.addEventListener;this._autoScrollTimerID=this._autoScrollY=this._autoScrollX=null;this._AUTO_SCROLL_RATE=50;this._mouseUpClosure=this._moseMoveClosure=this._grabControl=null;this._clickCount=this._lastMouseTime=this._lastMouseY=
this._lastMouseX=0;this._clickTime=250;this._clickDist=5;this._isMouseDown=!1;this._doubleClickSelection=null;this._vScroll=this._hScroll=0;this._imeOffset=-1;this._createActions();this._createView()},_modifyContent:function(a,b){if(!this._readonly||a._code)if(a.type="Verify",this.onVerify(a),!(a.text===null||a.text===void 0)){var c=this._model;try{if(a._ignoreDOMSelection)this._ignoreDOMSelection=!0;c.setText(a.text,a.start,a.end)}finally{if(a._ignoreDOMSelection)this._ignoreDOMSelection=!1}b&&(c=
this._getSelection(),c.setCaret(a.start+a.text.length),this._setSelection(c,!0));this.onModify({type:"Modify"})}},_onModelChanged:function(a){a.type="ModelChanged";this.onModelChanged(a);a.type="Changed";var b=a.start,c=a.addedCharCount,e=a.removedCharCount,d=a.addedLineCount,f=a.removedLineCount,h=this._getSelection();h.end>b&&(h.end>b&&h.start<b+e?h.setCaret(b+c):(h.start+=c-e,h.end+=c-e),this._setSelection(h,!1,!1));b=this._model.getLineAtOffset(b);for(c=this._getLineNext();c;){e=c.lineIndex;if(b<=
e&&e<=b+f)b===e&&!c.modelChangedEvent&&!c.lineRemoved?(c.modelChangedEvent=a,c.lineChanged=!0):(c.lineRemoved=!0,c.lineChanged=!1,c.modelChangedEvent=null);if(e>b+f)c.lineIndex=e+d-f,c._line.lineIndex=c.lineIndex;c=this._getLineNext(c)}this._lineHeight&&(a=[b,f].concat(Array(d)),Array.prototype.splice.apply(this._lineHeight,a));if(!this._wrapMode&&b<=this._maxLineIndex&&this._maxLineIndex<=b+f)this._checkMaxLineIndex=this._maxLineIndex,this._maxLineIndex=-1,this._maxLineWidth=0;this._update()},_onModelChanging:function(a){a.type=
"ModelChanging";this.onModelChanging(a);a.type="Changing"},_queueUpdate:function(){if(!this._updateTimer&&!this._ignoreQueueUpdate){var a=this;this._updateTimer=this._getWindow().setTimeout(function(){a._updateTimer=null;a._update()},0)}},_resetLineHeight:function(a,b){if(this._wrapMode||this._variableLineHeight){if(a!==void 0&&b!==void 0)for(var c=a;c<b;c++)this._lineHeight[c]=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 r(0,0,!1),!1,!1);if(this._viewDiv)this._viewDiv.scrollLeft=0,this._viewDiv.scrollTop=0;var a=this._clientDiv;if(a){for(var b=a.firstChild;b;)b.lineRemoved=!0,b=b.nextSibling;if(f.isFirefox)this._ignoreFocus=
!1,(b=this._hasFocus)&&a.blur(),a.contentEditable=!1,a.contentEditable=!0,b&&a.focus(),this._ignoreFocus=!1}},_scrollViewAnimated:function(a,b,c){var e=this._getWindow();if(c&&this._scrollAnimation){var d=this;this._animation=new v({window:e,duration:this._scrollAnimation,curve:[b,0],onAnimate:function(a){a=b-Math.floor(a);d._scrollView(0,a);b-=a},onEnd:function(){d._animation=null;d._scrollView(a,b);c&&e.setTimeout(c,0)}});this._animation.play()}else this._scrollView(a,b),c&&e.setTimeout(c,0)},_scrollView:function(a,
b){this._ensureCaretVisible=!1;var c=this._viewDiv;a&&(c.scrollLeft+=a);b&&(c.scrollTop+=b)},_setClipboardText:function(a,b){var c,e=this._getWindow(),d=e.clipboardData;if(!d&&b)d=b.clipboardData;if(d&&(c=[],l(a,function(a){c.push(a)},function(){c.push(f.platformDelimiter)}),d.setData(f.isIE?"Text":"text/plain",c.join(""))))return!0;var h=this._parent.ownerDocument,g=f.createElement(h,"pre");g.style.position="fixed";g.style.left="-1000px";l(a,function(a){g.appendChild(h.createTextNode(a))},function(){g.appendChild(f.createElement(h,
"br"))});g.appendChild(h.createTextNode(" "));this._clientDiv.appendChild(g);d=h.createRange();d.setStart(g.firstChild,0);d.setEndBefore(g.lastChild);var i=e.getSelection();i.rangeCount>0&&i.removeAllRanges();i.addRange(d);var m=this,d=function(){g&&g.parentNode===m._clientDiv&&m._clientDiv.removeChild(g);m._updateDOMSelection()},i=!1;this._ignoreCopy=!0;try{i=h.execCommand("copy",!1,null)}catch(j){}this._ignoreCopy=!1;if(!i&&b)return e.setTimeout(d,0),!1;d();return!0},_setDOMSelection:function(a,
b,c,e,d){for(var h,g,l,i,m=0,j=a.firstChild,o,k,r=this._model.getLine(a.lineIndex).length;j;){if(!j.ignore){o=j.firstChild;k=o.length;j.ignoreChars&&(k-=j.ignoreChars);if(m+k>b||m+k>=r){h=o;g=b-m;j.ignoreChars&&k>0&&g===k&&(g+=j.ignoreChars);break}m+=k}j=j.nextSibling}for(var m=0,j=c.firstChild,t=this._model.getLine(c.lineIndex).length;j;){if(!j.ignore){o=j.firstChild;k=o.length;j.ignoreChars&&(k-=j.ignoreChars);if(k+m>e||m+k>=t){l=o;i=e-m;j.ignoreChars&&k>0&&i===k&&(i+=j.ignoreChars);break}m+=k}j=
j.nextSibling}this._setDOMFullSelection(a,b,r,c,e,t);a=this._getWindow();b=this._parent.ownerDocument;if(a.getSelection){c=a.getSelection();a=b.createRange();a.setStart(h,g);a.setEnd(l,i);if(this._hasFocus&&(c.anchorNode!==h||c.anchorOffset!==g||c.focusNode!==l||c.focusOffset!==i||c.anchorNode!==l||c.anchorOffset!==i||c.focusNode!==h||c.focusOffset!==g))this._anchorNode=h,this._anchorOffset=g,this._focusNode=l,this._focusOffset=i,this._ignoreSelect=!1,c.rangeCount>0&&c.removeAllRanges(),c.addRange(a),
this._ignoreSelect=!0;if(this._cursorDiv&&(a=b.createRange(),d?(a.setStart(h,g),a.setEnd(h,g)):(a.setStart(l,i),a.setEnd(l,i)),l=a.getClientRects()[0],i=this._cursorDiv.parentNode,h=i.getBoundingClientRect(),l&&h))this._cursorDiv.style.top=l.top-h.top+i.scrollTop+"px",this._cursorDiv.style.left=l.left-h.left+i.scrollLeft+"px"}else if(b.selection&&this._hasFocus)d=b.body,a=f.createElement(b,"div"),d.appendChild(a),d.removeChild(a),a=d.createTextRange(),a.moveToElementText(h.parentNode),a.moveStart("character",
g),h=d.createTextRange(),h.moveToElementText(l.parentNode),h.moveStart("character",i),a.setEndPoint("EndToStart",h),this._ignoreSelect=!1,a.select(),this._ignoreSelect=!0},_setDOMFullSelection:function(a,b,c,e,d){if(this._selDiv1&&(c=this._selDiv1,c.style.width="0px",c.style.height="0px",c=this._selDiv2,c.style.width="0px",c.style.height="0px",c=this._selDiv3,c.style.width="0px",c.style.height="0px",!(a===e&&b===d))){var f=this._model,h=this._getViewPadding(),g=this._clientDiv.getBoundingClientRect(),
l=this._viewDiv.getBoundingClientRect(),c=l.left+h.left,i=g.right,h=l.top+h.top,m=g.bottom,l=g=0;this._clipDiv?(l=this._clipDiv.getBoundingClientRect(),g=l.left-this._clipDiv.scrollLeft):(l=this._rootDiv.getBoundingClientRect(),g=l.left);l=l.top;this._ignoreDOMSelection=!0;var j=(new s(this,a.lineIndex,a)).getBoundingClientRect(f.getLineStart(a.lineIndex)+b,!1),o=j.left,b=(new s(this,e.lineIndex,e)).getBoundingClientRect(f.getLineStart(e.lineIndex)+d,!1),f=b.left;this._ignoreDOMSelection=!1;var k=
this._selDiv1,o=Math.min(i,Math.max(c,o)),r=Math.min(m,Math.max(h,j.top)),t=i,d=Math.min(m,Math.max(h,j.bottom));k.style.left=o-g+"px";k.style.top=r-l+"px";k.style.width=Math.max(0,t-o)+"px";k.style.height=Math.max(0,d-r)+"px";if(a.lineIndex===e.lineIndex)t=Math.min(f,i),k.style.width=Math.max(0,t-o)+"px";else if(j=Math.min(m,Math.max(h,b.top)),f=Math.min(i,Math.max(c,f)),h=Math.min(m,Math.max(h,b.bottom)),m=this._selDiv3,m.style.left=c-g+"px",m.style.top=j-l+"px",m.style.width=Math.max(0,f-c)+"px",
m.style.height=Math.max(0,h-j)+"px",Math.abs(a.lineIndex-e.lineIndex)>1)a=this._selDiv2,a.style.left=c-g+"px",a.style.top=d-l+"px",a.style.width=Math.max(0,i-c)+"px",a.style.height=Math.max(0,j-d)+"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(f.isIE&&a)this._hadFocus=
this._hasFocus;var b=this._clientDiv;b.contentEditable=!a;this._hadFocus&&!a&&b.focus();if(this._overlayDiv)this._overlayDiv.style.zIndex=a?"-1":"1";for(a=this._getLineNext();a;){if(a.hasLink)for(b=a.firstChild;b;)if(b.ignore)b=b.nextSibling;else{var c=b.nextSibling,e=b.viewStyle;e&&e.tagName&&e.tagName.toLowerCase()==="a"&&a.replaceChild(a._line._createSpan(a,b.firstChild.data,e),b);b=c}a=this._getLineNext(a)}this._updateDOMSelection()}},_setSelection:function(a,b,c,e,d){if(a){this._columnX=-1;c===
void 0&&(c=!0);var f=this._selection;this._selection=a;b!==!1&&this._showCaret(!1,e,b,d);c&&this._updateDOMSelection();if(!f.equals(a))this.onSelection({type:"Selection",oldValue:{start:f.start,end:f.end},newValue:{start:a.start,end:a.end}})}},_setSelectionTo:function(a,b,c,e){var d=this._model,f=this._getSelection(),b=this.convert({x:a,y:b},"page","document"),a=this._getLineIndex(b.y);if(this._clickCount===1){d=this._getLine(a);a=d.getOffset(b.x,b.y-this._getLinePixel(a));d.destroy();if(e&&!c&&f.start<=
a&&a<f.end)return this._dragOffset=a,!1;f.extend(a);c||f.collapse()}else(this._clickCount&1)===0?(d=this._getLine(a),a=d.getOffset(b.x,b.y-this._getLinePixel(a)),this._doubleClickSelection?a>=this._doubleClickSelection.start?(c=this._doubleClickSelection.start,e=d.getNextOffset(a,{unit:"wordend",count:1})):(c=d.getNextOffset(a,{unit:"word",count:-1}),e=this._doubleClickSelection.end):(c=d.getNextOffset(a,{unit:"word",count:-1}),e=d.getNextOffset(c,{unit:"wordend",count:1})),d.destroy()):this._doubleClickSelection?
(e=d.getLineAtOffset(this._doubleClickSelection.start),a>=e?(c=d.getLineStart(e),e=d.getLineEnd(a)):(c=d.getLineStart(a),e=d.getLineEnd(e))):(c=d.getLineStart(a),e=d.getLineEnd(a)),f.setCaret(c),f.extend(e);this._setSelection(f,!0,!0);return!0},_setFullSelection:function(a,b){this._fullSelection=a;if(f.isWebkit)this._fullSelection=!0;var c=this._clipDiv||this._rootDiv;if(c)if(this._fullSelection){if(!this._selDiv1&&this._fullSelection&&!f.isIOS){var e=c.ownerDocument;this._highlightRGB=f.isWebkit?
"transparent":"Highlight";var d=f.createElement(e,"div");this._selDiv1=d;d.style.position="absolute";d.style.borderWidth="0px";d.style.margin="0px";d.style.padding="0px";d.style.outline="none";d.style.background=this._highlightRGB;d.style.width="0px";d.style.height="0px";d.style.zIndex="0";c.appendChild(d);var h=f.createElement(e,"div");this._selDiv2=h;h.style.position="absolute";h.style.borderWidth="0px";h.style.margin="0px";h.style.padding="0px";h.style.outline="none";h.style.background=this._highlightRGB;
h.style.width="0px";h.style.height="0px";h.style.zIndex="0";c.appendChild(h);this._selDiv3=e=f.createElement(e,"div");e.style.position="absolute";e.style.borderWidth="0px";e.style.margin="0px";e.style.padding="0px";e.style.outline="none";e.style.background=this._highlightRGB;e.style.width="0px";e.style.height="0px";e.style.zIndex="0";c.appendChild(e);if(f.isFirefox&&f.isMac){c=this._getWindow().getComputedStyle(e,null).getPropertyValue("background-color");switch(c){case "rgb(119, 141, 168)":c="rgb(199, 208, 218)";
break;case "rgb(127, 127, 127)":c="rgb(198, 198, 198)";break;case "rgb(255, 193, 31)":c="rgb(250, 236, 115)";break;case "rgb(243, 70, 72)":c="rgb(255, 176, 139)";break;case "rgb(255, 138, 34)":c="rgb(255, 209, 129)";break;case "rgb(102, 197, 71)":c="rgb(194, 249, 144)";break;case "rgb(140, 78, 184)":c="rgb(232, 184, 255)";break;default:c="rgb(180, 213, 255)"}this._highlightRGB=c;d.style.background=c;h.style.background=c;e.style.background=c}b||this._updateDOMSelection()}}else{if(this._selDiv1)c.removeChild(this._selDiv1),
this._selDiv1=null;if(this._selDiv2)c.removeChild(this._selDiv2),this._selDiv2=null;if(this._selDiv3)c.removeChild(this._selDiv3),this._selDiv3=null}},_setBlockCursor:function(a){this._blockCursorVisible=a;this._updateBlockCursorVisible()},_setOverwriteMode:function(a){this._overwriteMode=a;this._updateBlockCursorVisible()},_updateBlockCursorVisible:function(){if(this._blockCursorVisible||this._overwriteMode){if(!this._cursorDiv){var a=f.createElement(document,"div");a.className="textviewBlockCursor";
this._cursorDiv=a;a.tabIndex=-1;a.style.zIndex="2";a.style.color="transparent";a.style.position="absolute";a.style.pointerEvents="none";a.innerHTML="&nbsp;";this._viewDiv.appendChild(a);this._updateDOMSelection()}}else if(this._cursorDiv)this._cursorDiv.parentNode.removeChild(this._cursorDiv),this._cursorDiv=null},_setMarginOffset:function(a,b){this._marginOffset=a;this._marginDiv.style.display=a?"block":"none";if(!b)this._metrics=this._calculateMetrics(),this._queueUpdate()},_setWrapOffset:function(a,
b){this._wrapOffset=a;if(!b)this._metrics=this._calculateMetrics(),this._queueUpdate()},_setReadOnly:function(a){this._readonly=a;this._clientDiv.setAttribute("aria-readonly",a?"true":"false")},_setSingleMode:function(a,b){this._singleMode=a;this._updateOverflow();this._updateStyle(b)},_setTabSize:function(a,b){this._tabSize=a;this._customTabSize=void 0;var c=this._clientDiv;if(f.isOpera){if(c)c.style.OTabSize=this._tabSize+""}else if(f.isWebkit>=537.1){if(c)c.style.tabSize=this._tabSize+""}else if(f.isFirefox>=
4){if(c)c.style.MozTabSize=this._tabSize+""}else if(this._tabSize!==8)this._customTabSize=this._tabSize;b||(this.redrawLines(),this._resetLineWidth())},_setTheme:function(a){this._theme&&this._theme.removeEventListener("ThemeChanged",this._themeListener.onChanged);(this._theme=a)&&this._theme.addEventListener("ThemeChanged",this._themeListener.onChanged);this._setThemeClass(this._themeClass)},_setThemeClass:function(a,b){this._themeClass=a;var c="textview",e=this._theme.getThemeClass();e&&(c+=" "+
e);this._themeClass&&e!==this._themeClass&&(c+=" "+this._themeClass);this._rootDiv.className=c;this._updateStyle(b)},_setWrapMode:function(a,b){this._wrapMode=a&&this._wrappable;var c=this._clientDiv;this._wrapMode?(c.style.whiteSpace="pre-wrap",c.style.wordWrap="break-word"):(c.style.whiteSpace="pre",c.style.wordWrap="normal");this._updateOverflow();b||(this.redraw(),this._resetLineWidth());this._resetLineHeight()},_showCaret:function(a,b,c,e){if(this._clientDiv){var d=this._model,f=this._getSelection(),
h=this._getScroll(),g=f.getCaret(),l=f.start,i=f.end,m=d.getLineAtOffset(i),j=Math.max(Math.max(l,d.getLineStart(m)),i-1),d=this._getClientWidth(),m=this._getClientHeight(),o=d/4,k=this._getBoundsAtOffset(g===l?l:j),r=k.left,t=k.right,q=k.top,s=k.bottom;a&&!f.isEmpty()&&(k=this._getBoundsAtOffset(g===i?l:j),k.top===q?g===l?t=r+Math.min(k.right-r,d):r=t-Math.min(t-k.left,d):g===l?s=q+Math.min(k.bottom-q,m):q=s-Math.min(s-k.top,m));a=0;r<h.x&&(a=Math.min(r-h.x,-o));t>h.x+d&&(a=Math.max(t-h.x-d,o));
f=0;q<h.y?f=q-h.y:s>h.y+m&&(f=s-h.y-m);e&&(e>0?f>0&&(f=Math.max(f,e)):f<0&&(f=Math.min(f,e)));if(a!==0||f!==0)return f!==0&&typeof c==="number"&&(c<0&&(c=0),c>1&&(c=1),f+=Math.floor(f>0?c*m:-c*m)),this._scrollViewAnimated(a,f,b),m!==this._getClientHeight()||d!==this._getClientWidth()?this._showCaret():this._ensureCaretVisible=!0,!0;else b&&b();return!1}},_startIME:function(){if(this._imeOffset===-1){var a=this._getSelection();a.isEmpty()||this._modifyContent({text:"",start:a.start,end:a.end},!0);
this._imeOffset=a.start}},_unhookEvents:function(){this._model.removeEventListener("preChanging",this._modelListener.onChanging);this._model.removeEventListener("postChanged",this._modelListener.onChanged);this._theme.removeEventListener("ThemeChanged",this._themeListener.onChanged);this._modelListener=null;for(var a=0;a<this._handlers.length;a++){var b=this._handlers[a];t(b.target,b.type,b.handler)}this._handlers=null;if(this._mutationObserver)this._mutationObserver.disconnect(),this._mutationObserver=
null},_updateDOMSelection:function(){if(!(this._redrawCount>0)&&!this._ignoreDOMSelection&&this._clientDiv){var a=this._getSelection(),b=this._model,c=b.getLineAtOffset(a.start),e=b.getLineAtOffset(a.end),d=this._getLineNext();if(d){var f=this._getLinePrevious(),h;c<d.lineIndex?(h=d,c=0):c>f.lineIndex?(h=f,c=0):(h=this._getLineNode(c),c=a.start-b.getLineStart(c));e<d.lineIndex?b=0:e>f.lineIndex?(d=f,b=0):(d=this._getLineNode(e),b=a.end-b.getLineStart(e));this._setDOMSelection(h,c,d,b,a.caret)}}},
_update:function(a){if(!(this._redrawCount>0)){if(this._updateTimer)this._getWindow().clearTimeout(this._updateTimer),this._updateTimer=null,a=!1;var b=this._clientDiv,c=this._viewDiv;if(b){if(this._metrics.invalid)this._ignoreQueueUpdate=!0,this._updateStyle(),this._ignoreQueueUpdate=!1;var e=this._model,d=this._getScroll(!1),h=this._getViewPadding(),g=e.getLineCount(),l=this._getLineHeight(),i=!1,m=!1,j=!1,o=this._metrics.scrollWidth;if(this._wrapMode)b.style.width=(this._metrics.wrapWidth||this._getClientWidth())+
"px";var k,r,t,q,v=0,u=0,p;if(this._lineHeight){for(;u<g;){p=this._getLineHeight(u);if(v+p>d.y)break;v+=p;u++}k=u;r=Math.max(0,k-1);t=e=d.y-v;k>0&&(e+=this._getLineHeight(k-1))}else q=Math.max(0,d.y)/l,k=Math.floor(q),r=Math.max(0,k-1),e=Math.round((q-r)*l),t=Math.round((q-k)*l);this._topIndexY=t;q=this._rootDiv;var P=q.clientWidth,G=q.clientHeight;if(a){l=0;this._leftDiv&&(k=this._leftDiv.getBoundingClientRect(),l=k.right-k.left);k=this._getClientWidth();q=this._getClientHeight();m=k;if(this._wrapMode){if(this._metrics.wrapWidth)m=
this._metrics.wrapWidth}else m=Math.max(this._maxLineWidth,m);for(;u<g;)p=this._getLineHeight(u,!1),v+=p,u++;g=v}else{q=this._getClientHeight();t=Math.min(k+Math.floor((q+t)/l),g-1);var d=Math.min(t+1,g-1),E;for(p=b.firstChild;p;){E=p.lineIndex;var D=p.nextSibling;if(!(r<=E&&E<=d)||p.lineRemoved||p.lineIndex===-1)this._mouseWheelLine===p?(p.style.display="none",p.lineIndex=-1):b.removeChild(p);p=D}p=this._getLineNext();var D=c.ownerDocument,L=D.createDocumentFragment();for(E=r;E<=d;E++)if(!p||p.lineIndex>
E)(new s(this,E)).create(L,null);else{L.firstChild&&(b.insertBefore(L,p),L=D.createDocumentFragment());if(p&&p.lineChanged)p=(new s(this,E)).create(L,p),p.lineChanged=!1;p=this._getLineNext(p)}L.firstChild&&b.insertBefore(L,p);if(f.isWebkit&&!this._wrapMode)b.style.width="0x7fffffffpx";p=this._getLineNext();E=q+e;for(L=!1;p;){r=p.lineWidth;if(r===void 0)if(D=p._line.getBoundingClientRect(),r=p.lineWidth=Math.ceil(D.right-D.left),D=D.bottom-D.top,this._lineHeight)this._lineHeight[p.lineIndex]=D;else if(l!==
0&&D!==0&&Math.ceil(l)!==Math.ceil(D))this._variableLineHeight=!0,this._lineHeight=[],this._lineHeight[p.lineIndex]=D;if(this._lineHeight&&!L&&(E-=this._lineHeight[p.lineIndex],E<0))t=p.lineIndex,L=!0;if(!this._wrapMode){if(r>=this._maxLineWidth)this._maxLineWidth=r,this._maxLineIndex=p.lineIndex;if(this._checkMaxLineIndex===p.lineIndex)this._checkMaxLineIndex=-1}if(p.lineIndex===k)this._topChild=p;if(p.lineIndex===t)this._bottomChild=p;p=this._getLineNext(p)}if(this._checkMaxLineIndex!==-1&&(E=this._checkMaxLineIndex,
this._checkMaxLineIndex=-1,0<=E&&E<g)){l=new s(this,E);D=l.getBoundingClientRect();r=D.right-D.left;if(r>=this._maxLineWidth)this._maxLineWidth=r,this._maxLineIndex=E;l.destroy()}for(;u<g;)p=this._getLineHeight(u,u<=t),v+=p,u++;g=v;this._updateRuler(this._leftDiv,k,d,G);this._updateRuler(this._rightDiv,k,d,G);this._updateRuler(this._marginDiv,k,d,G);l=0;this._leftDiv&&(k=this._leftDiv.getBoundingClientRect(),l=k.right-k.left);d=0;this._rightDiv&&(d=this._rightDiv.getBoundingClientRect(),d=d.right-
d.left);c.style.left=l+"px";c.style.right=d+"px";d=this._scrollDiv;d.style.height=g+"px";k=this._getClientWidth();if(!this._singleMode&&!this._wrapMode){v=i=q;(u=c.style.overflowX==="scroll")?i+=o:v-=o;p=t=k;(r=c.style.overflowY==="scroll")?t+=o:p-=o;q=i;k=t;g>q&&(j=!0,k=p);this._maxLineWidth>k&&(m=!0,q=v,g>q&&(j=!0,k=p));if(u!==m)c.style.overflowX=m?"scroll":"hidden";if(r!==j)c.style.overflowY=j?"scroll":"hidden";i=u!==m||r!==j}j=k;if(this._wrapMode){if(this._metrics.wrapWidth)j=this._metrics.wrapWidth}else j=
Math.max(this._maxLineWidth,j);m=j;if((!f.isIE||f.isIE>=9)&&this._maxLineWidth>k)j+=h.right+h.left;d.style.width=j+"px";if(this._clipScrollDiv)this._clipScrollDiv.style.width=j+"px";d=this._getScroll(!1)}if(this._vScrollDiv)j=q-8,v=Math.max(15,Math.ceil(Math.min(1,j/(g+h.top+h.bottom))*j)),this._vScrollDiv.style.left=l+k-8+"px",this._vScrollDiv.style.top=Math.floor(Math.max(0,d.y*j/g))+"px",this._vScrollDiv.style.height=v+"px";if(!this._wrapMode&&this._hScrollDiv)j=k-8,v=Math.max(15,Math.ceil(Math.min(1,
j/(this._maxLineWidth+h.left+h.right))*j)),this._hScrollDiv.style.left=l+Math.floor(Math.max(0,Math.floor(d.x*j/this._maxLineWidth)))+"px",this._hScrollDiv.style.top=q-9+"px",this._hScrollDiv.style.width=v+"px";u=d.x;v=this._clipDiv;j=this._overlayDiv;if(t=this._marginDiv)t.style.left=-u+l+this._metrics.marginWidth+h.left+"px",t.style.bottom=(c.style.overflowX==="scroll"?o:0)+"px";if(v){v.scrollLeft=u;v.scrollTop=0;c=l+h.left;o=h.top;a=k;l=q;u=0;t=-e;if(d.x===0)c-=h.left,a+=h.left,u=h.left;d.x+k===
m&&(a+=h.right);d.y===0&&(o-=h.top,l+=h.top,t+=h.top);d.y+q===g&&(l+=h.bottom);v.style.left=c+"px";v.style.top=o+"px";v.style.right=P-a-c+"px";v.style.bottom=G-l-o+"px";b.style.left=u+"px";b.style.top=t+"px";b.style.width=m+"px";b.style.height=q+e+"px";if(j)j.style.left=b.style.left,j.style.top=b.style.top,j.style.width=b.style.width,j.style.height=b.style.height}else{c=u;o=e;P=u+k;G=e+q;c===0&&(c-=h.left);o===0&&(o-=h.top);P===m&&(P+=h.right);d.y+q===g&&(G+=h.bottom);b.style.clip="rect("+o+"px,"+
P+"px,"+G+"px,"+c+"px)";b.style.left=-u+l+h.left+"px";b.style.width=(this._wrapMode||f.isWebkit?m:k+u)+"px";if(!a)b.style.top=-e+h.top+"px",b.style.height=q+e+"px";if(j&&(j.style.clip=b.style.clip,j.style.left=b.style.left,j.style.width=b.style.width,!a))j.style.top=b.style.top,j.style.height=b.style.height}this._updateDOMSelection();if(i)b=this._ensureCaretVisible,this._ensureCaretVisible=!1,b&&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,b,c,d){if(a)for(var h=this._parent.ownerDocument,g=this._getLineHeight(),l=this._getViewPadding(),a=a.firstChild;a;){var i=a._ruler,m=g,j=i.getOverview();j==="page"&&(m+=this._topIndexY);a.style.top=-m+"px";a.style.height=d+m+"px";a.rulerChanged&&e(i.getRulerStyle(),a);var o,k=a.firstChild;k?(o=k,k=k.nextSibling):(o=f.createElement(h,"div"),o.style.visibility="hidden",a.appendChild(o));var r;
if(a.rulerChanged&&o){m=-1;if(r=i.getWidestAnnotation())if(e(r.style,o),r.html)o.innerHTML=r.html;o.lineIndex=m;o.style.height=g+l.top+"px"}var t;if(j==="page"){for(i=i.getAnnotations(b,c+1);k;)m=k.lineIndex,r=k.nextSibling,(!(b<=m&&m<=c)||k.lineChanged)&&a.removeChild(k),k=r;k=a.firstChild.nextSibling;t=h.createDocumentFragment();for(m=b;m<=c;m++)if(!k||k.lineIndex>m){o=f.createElement(h,"div");if(r=i[m]){e(r.style,o);if(r.html)o.innerHTML=r.html;o.annotation=r}o.lineIndex=m;o.style.height=this._getLineHeight(m)+
"px";t.appendChild(o)}else if(t.firstChild&&(a.insertBefore(t,k),t=h.createDocumentFragment()),k)k=k.nextSibling;t.firstChild&&a.insertBefore(t,k)}else{r=this._getClientHeight();m=this._model.getLineCount();k=r+l.top+l.bottom-2*this._metrics.scrollWidth;j=g*m<k?g:k/m;if(a.rulerChanged){for(r=a.childNodes.length;r>1;)a.removeChild(a.lastChild),r--;i=i.getAnnotations(0,m);t=h.createDocumentFragment();for(var q in i)if(m=q>>>0,!(m<0)){o=f.createElement(h,"div");r=i[q];e(r.style,o);o.style.position="absolute";
o.style.top=this._metrics.scrollWidth+g+Math.floor(m*j)+"px";if(r.html)o.innerHTML=r.html;o.annotation=r;o.lineIndex=m;t.appendChild(o)}a.appendChild(t)}else if(a._oldTrackHeight!==k)for(o=a.firstChild?a.firstChild.nextSibling:null;o;)o.style.top=this._metrics.scrollWidth+g+Math.floor(o.lineIndex*j)+"px",o=o.nextSibling;a._oldTrackHeight=k}a.rulerChanged=!1;a=a.nextSibling}},_updateStyleSheet:function(){var a="";f.isWebkit&&this._metrics.scrollWidth>0&&(a+="\n.textview ::-webkit-scrollbar-corner {background: #eeeeee;}");
f.isFirefox&&f.isMac&&this._highlightRGB&&this._highlightRGB!=="Highlight"&&(a+="\n.textview ::-moz-selection {background: "+this._highlightRGB+";}");if(a){var b=document.getElementById("_textviewStyle");if(b)b.removeChild(b.firstChild),b.appendChild(document.createTextNode(a));else{b=f.createElement(document,"style");b.id="_textviewStyle";var c=document.getElementsByTagName("head")[0]||document.documentElement;b.appendChild(document.createTextNode(a));c.insertBefore(b,c.firstChild)}}},_updateStyle:function(a){if(!a&&
f.isIE)this._rootDiv.style.lineHeight="normal";var b=this._metrics=this._calculateMetrics();this._rootDiv.style.lineHeight=f.isIE?b.lineHeight-(b.lineTrim.top+b.lineTrim.bottom)+"px":"normal";this._updateStyleSheet();a||(this.redraw(),this._resetLineWidth())}};d.EventTarget.addMixin(u.prototype);return{TextView:u}});
define("orion/editor/projectionTextModel",["orion/editor/textModel","orion/editor/eventTarget"],function(j,k){function i(d){this._model=d;this._projections=[];var a=this;this._listener={onChanged:function(d){a._onChanged(d)},onChanging:function(d){a._onChanging(d)}};d.addEventListener("postChanged",this._listener.onChanged);d.addEventListener("preChanging",this._listener.onChanging)}i.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(d){if(d){var a=this._model,g=this._projections;d._lineIndex=a.getLineAtOffset(d.start);d._lineCount=a.getLineAtOffset(d.end)-d._lineIndex;var f=d.text;f||(f="");d._model=typeof f==="string"?new j.TextModel(f,a.getLineDelimiter()):f;var a=this.mapOffset(d.start,!0),f=d.end-d.start,e=d._lineCount,h=d._model.getCharCount(),c=d._model.getLineCount()-1;this.onChanging({type:"Changing",text:d._model.getText(),
start:a,removedCharCount:f,addedCharCount:h,removedLineCount:e,addedLineCount:c});var b=this._binarySearch(g,d.start);g.splice(b,0,d);this.onChanged({type:"Changed",start:a,removedCharCount:f,addedCharCount:h,removedLineCount:e,addedLineCount:c})}},getProjections:function(){return this._projections.slice(0)},getBaseModel:function(){return this._model},mapOffset:function(d,a){var g=this._projections,f=0,e,h;if(a){for(e=0;e<g.length;e++){h=g[e];if(h.start>d)break;if(h.end>d)return-1;f+=h._model.getCharCount()-
(h.end-h.start)}return d+f}for(e=0;e<g.length;e++){h=g[e];if(h.start>d-f)break;var c=h._model.getCharCount();if(h.start+c>d-f)return-1;f+=c-(h.end-h.start)}return d-f},removeProjection:function(d){var a,g=0;for(a=0;a<this._projections.length;a++){var f=this._projections[a];if(f===d){d=f;break}g+=f._model.getCharCount()-(f.end-f.start)}if(a<this._projections.length){var f=this._model,g=d.start+g,e=d.end-d.start,h=d._lineCount,c=d._model.getCharCount(),b=d._model.getLineCount()-1;this.onChanging({type:"Changing",
text:f.getText(d.start,d.end),start:g,removedCharCount:c,addedCharCount:e,removedLineCount:b,addedLineCount:h});this._projections.splice(a,1);this.onChanged({type:"Changed",start:g,removedCharCount:c,addedCharCount:e,removedLineCount:b,addedLineCount:h})}},_binarySearch:function(d,a){for(var g=d.length,f=-1,e;g-f>1;)e=Math.floor((g+f)/2),a<=d[e].start?g=e:f=e;return g},getCharCount:function(){for(var d=this._model.getCharCount(),a=this._projections,g=0;g<a.length;g++){var f=a[g];d+=f._model.getCharCount()-
(f.end-f.start)}return d},getLine:function(d,a){if(d<0)return null;var g=this._model,f=this._projections,e=0,h=[],c=0,b,l,i;for(b=0;b<f.length;b++){i=f[b];if(i._lineIndex>=d-e)break;l=i._model.getLineCount()-1;if(i._lineIndex+l>=d-e)if(c=d-(i._lineIndex+e),c<l)return i._model.getLine(c,a);else h.push(i._model.getLine(l));c=i.end;e+=l-i._lineCount}for(c=Math.max(c,g.getLineStart(d-e));b<f.length;b++){i=f[b];if(i._lineIndex>d-e)break;h.push(g.getText(c,i.start));l=i._model.getLineCount()-1;if(i._lineIndex+
l>d-e)return h.push(i._model.getLine(0,a)),h.join("");h.push(i._model.getText());c=i.end;e+=l-i._lineCount}f=g.getLineEnd(d-e,a);c<f&&h.push(g.getText(c,f));return h.join("")},getLineAtOffset:function(d){for(var a=this._model,g=this._projections,f=0,e=0,h=0;h<g.length;h++){var c=g[h];if(c.start>d-f)break;var b=c._model.getCharCount();if(c.start+b>d-f){g=d-(c.start+f);e+=c._model.getLineAtOffset(g);f+=g;break}e+=c._model.getLineCount()-1-c._lineCount;f+=b-(c.end-c.start)}return a.getLineAtOffset(d-
f)+e},getLineCount:function(){for(var d=this._projections,a=this._model.getLineCount(),g=0;g<d.length;g++){var f=d[g];a+=f._model.getLineCount()-1-f._lineCount}return a},getLineDelimiter:function(){return this._model.getLineDelimiter()},getLineEnd:function(d,a){if(d<0)return-1;for(var g=this._model,f=this._projections,e=0,h=0,c=0;c<f.length;c++){var b=f[c];if(b._lineIndex>d-e)break;var l=b._model.getLineCount()-1;if(b._lineIndex+l>d-e)return b._model.getLineEnd(d-(b._lineIndex+e),a)+b.start+h;h+=
b._model.getCharCount()-(b.end-b.start);e+=l-b._lineCount}return g.getLineEnd(d-e,a)+h},getLineStart:function(d){if(d<0)return-1;for(var a=this._model,g=this._projections,f=0,e=0,h=0;h<g.length;h++){var c=g[h];if(c._lineIndex>=d-f)break;var b=c._model.getLineCount()-1;if(c._lineIndex+b>=d-f)return c._model.getLineStart(d-(c._lineIndex+f))+c.start+e;e+=c._model.getCharCount()-(c.end-c.start);f+=b-c._lineCount}return a.getLineStart(d-f)+e},getText:function(d,a){d===void 0&&(d=0);var g=this._model,f=
this._projections,e=0,h=[],c,b,l;for(c=0;c<f.length;c++){b=f[c];if(b.start>d-e)break;l=b._model.getCharCount();if(b.start+l>d-e)if(a!==void 0&&b.start+l>a-e)return b._model.getText(d-(b.start+e),a-(b.start+e));else h.push(b._model.getText(d-(b.start+e))),d=b.end+e+l-(b.end-b.start);e+=l-(b.end-b.start)}var i=d-e;if(a!==void 0){for(;c<f.length;c++){b=f[c];if(b.start>a-e)break;h.push(g.getText(i,b.start));l=b._model.getCharCount();if(b.start+l>a-e)return h.push(b._model.getText(0,a-(b.start+e))),h.join("");
h.push(b._model.getText());i=b.end;e+=l-(b.end-b.start)}h.push(g.getText(i,a-e))}else{for(;c<f.length;c++)b=f[c],h.push(g.getText(i,b.start)),h.push(b._model.getText()),i=b.end;h.push(g.getText(i))}return h.join("")},_onChanged:function(){var d=this._change,a=d.baseStart,g=d.baseEnd,f,e,h=this._projections;for(f=0;f<h.length;f++)if(e=h[f],e.end>a)break;var c=f;for(f=0;f<h.length;f++)if(e=h[f],e.start>=g)break;var b=f,l=this._model,a=d.baseText.length-(g-a);for(f=b;f<h.length;f++)e=h[f],e.start+=a,
e.end+=a,e._lineIndex=l.getLineAtOffset(e.start);e=h.splice(c,b-c);for(f=0;f<e.length;f++)e[f].annotation&&e[f].annotation._expand();this.onChanged({type:"Changed",start:d.start,removedCharCount:d.removedCharCount,addedCharCount:d.addedCharCount,removedLineCount:d.removedLineCount,addedLineCount:d.addedLineCount});this._change=void 0},_onChanging:function(d){var a=!!this._change,g=this._change||{},f=d.start,e=f+d.removedCharCount;g.baseStart=f;g.baseEnd=e;g.baseText=d.text;g.addedLineCount=d.addedLineCount;
if(!a){this._change=g;g.text=d.text;var h=this._projections,c,b,l,d=function(a){for(b=0,c=0;b<h.length;b++){l=h[b];if(l.start>a)break;if(l.end>a)return-1;c+=l._model.getCharCount()-(l.end-l.start)}return a+c};g.start=d(f);if(g.start===-1)g.text=this._model.getText(l.start,f)+g.text,g.addedLineCount+=this._model.getLineAtOffset(f)-this._model.getLineAtOffset(l.start),g.start=l.start+c;g.end=d(e);if(g.end===-1)g.text+=this._model.getText(e,l.end),g.addedLineCount+=this._model.getLineAtOffset(l.end)-
this._model.getLineAtOffset(e),g.end=l.start+c}g.addedCharCount=g.text.length;g.removedCharCount=g.end-g.start;g.removedLineCount=this.getLineAtOffset(g.end)-this.getLineAtOffset(g.start);this.onChanging({type:"Changing",text:g.text,start:g.start,removedCharCount:g.removedCharCount,addedCharCount:g.addedCharCount,removedLineCount:g.removedLineCount,addedLineCount:g.addedLineCount})},onChanging:function(d){return this.dispatchEvent(d)},onChanged:function(d){return this.dispatchEvent(d)},setLineDelimiter:function(d){this._model.setLineDelimiter(d)},
setText:function(d,a,g){function f(a){for(c=0,h=0;c<e.length;c++){b=e[c];if(b.start>a-h)break;var d=b._model.getCharCount();if(b.start+d>a-h)return-1;h+=d-(b.end-b.start)}return a-h}this._change={text:d||"",start:a||0,end:g===void 0?this.getCharCount():g};var e=this._projections,h,c,b,l,i,d=f(this._change.start);if(d===-1)l={projection:b,start:this._change.start-(b.start+h)},d=b.end;a=f(this._change.end);if(a===-1)i={projection:b,end:this._change.end-(b.start+h)},a=b.start;if(l&&i&&l.projection===
i.projection)b._model.setText(this._change.text,l.start,i.end);else{this._model.setText(this._change.text,d,a);if(l)b=l.projection,b._model.setText("",l.start);if(i)b=i.projection,b._model.setText("",0,i.end),b.start=b.end,b._lineCount=0}this._change=void 0}};k.EventTarget.addMixin(i.prototype);return{ProjectionTextModel:i}});
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(j,k,i,d,a,g){function f(a){this._view=a;this._fadeDelay=500;this._hideDelay=200;this._showDelay=500;this._autoHideDelay=5E3;this._create(a.getOptions("parent").ownerDocument)}f.getTooltip=function(a){if(!a._tooltip)a._tooltip=new f(a);return a._tooltip};f.prototype={_create:function(e){if(!this._tooltipDiv){var d=
this._tooltipDiv=g.createElement(e,"div");d.tabIndex=0;d.className="textviewTooltip";d.setAttribute("aria-live","assertive");d.setAttribute("aria-atomic","true");var c=this._tooltipContents=g.createElement(e,"div");d.appendChild(c);e.body.appendChild(d);var b=this;a.addEventListener(d,"mouseover",function(){if(b._hideDelay){var a=b._getWindow();if(b._delayedHideTimeout)a.clearTimeout(b._delayedHideTimeout),b._delayedHideTimeout=null;if(b._hideTimeout)a.clearTimeout(b._hideTimeout),b._hideTimeout=
null;b._nextTarget=null}},!1);a.addEventListener(d,"mouseout",function(c){c=c.relatedTarget||c.toElement;c===d||b._hasFocus()||(!c||!a.contains(d,c))&&b._hide()},!1);a.addEventListener(d,"keydown",function(a){a.keyCode===27&&b._hide()},!1);a.addEventListener(e,"mousedown",this._mouseDownHandler=function(c){b.isVisible()&&(a.contains(d,c.target||c.srcElement)||b._hide())},!0);this._view.addEventListener("Destroy",function(){b.destroy()});this._hide()}},_getWindow:function(){var a=this._tooltipDiv.ownerDocument;
return a.defaultView||a.parentWindow},destroy:function(){if(this._tooltipDiv){this._hide();var e=this._tooltipDiv.parentNode;e&&e.removeChild(this._tooltipDiv);a.removeEventListener(this._tooltipDiv.ownerDocument,"mousedown",this._mouseDownHandler,!0);this._tooltipDiv=null}},_hasFocus:function(){var e=this._tooltipDiv;return!e?!1:a.contains(e,e.ownerDocument.activeElement)},hide:function(a){if(a===void 0)a=this._hideDelay;var d=this._getWindow();if(this._delayedHideTimeout)d.clearTimeout(this._delayedHideTimeout),
this._delayedHideTimeout=null;var c=this;a?c._delayedHideTimeout=d.setTimeout(function(){c._delayedHideTimeout=null;c._hide();c.setTarget(c._nextTarget,0)},a):(c._hide(),c.setTarget(c._nextTarget,0))},_hide:function(){var a=this._tooltipDiv;if(a){this._hasFocus()&&this._view.focus();if(this._contentsView)this._contentsView.destroy(),this._contentsView=null;if(this._tooltipContents)this._tooltipContents.innerHTML="";a.style.visibility="hidden";a=this._getWindow();if(this._showTimeout)a.clearTimeout(this._showTimeout),
this._showTimeout=null;if(this._delayedHideTimeout)a.clearTimeout(this._delayedHideTimeout),this._delayedHideTimeout=null;if(this._hideTimeout)a.clearTimeout(this._hideTimeout),this._hideTimeout=null;if(this._fadeTimeout)a.clearInterval(this._fadeTimeout),this._fadeTimeout=null}},isVisible:function(){return this._tooltipDiv&&this._tooltipDiv.style.visibility==="visible"},setTarget:function(a,d,c){if(this.isVisible()){if(!this._hasFocus())this._nextTarget=a,this.hide(c)}else if(this._target=a){var b=
this,a=b._getWindow();if(b._showTimeout)a.clearTimeout(b._showTimeout),b._showTimeout=null;d===0?b.show(!0):b._showTimeout=a.setTimeout(function(){b._showTimeout=null;b.show(!0)},d?d:b._showDelay)}},show:function(a){if(this._target){var f=this._target.getTooltipInfo();if(f){var c=this._tooltipDiv,b=this._tooltipContents;c.style.left=c.style.right=c.style.width=c.style.height=b.style.width=b.style.height="auto";var g=f.contents;g instanceof Array&&(g=this._getAnnotationContents(g));if(typeof g==="string")b.innerHTML=
g;else if(this._isNode(g))b.appendChild(g);else if(g instanceof d.ProjectionTextModel){var i=this._view,j=i.getOptions();j.wrapMode=!1;j.parent=b;var r=j.themeClass;r?((r=r.replace("tooltipTheme",""))&&(r=" "+r),r="tooltipTheme"+r):r="tooltipTheme";j.themeClass=r;j=this._contentsView=new k.TextView(j);j.addEventListener("LineStyle",function(a){i.onLineStyle(a)});j.setModel(g);g=j.computeSize();b.style.width=g.width+"px";b.style.height=g.height+"px";j.resize()}else return;b=c.ownerDocument.documentElement;
f.anchor==="right"?(g=b.clientWidth-f.x,c.style.right=g+"px"):(g=parseInt(this._getNodeStyle(c,"padding-left","0"),10),g+=parseInt(this._getNodeStyle(c,"border-left-width","0"),10),g=f.x-g,c.style.left=g+"px");c.style.maxWidth=b.clientWidth-g-10+"px";g=parseInt(this._getNodeStyle(c,"padding-top","0"),10);g+=parseInt(this._getNodeStyle(c,"border-top-width","0"),10);g=f.y-g;c.style.top=g+"px";c.style.maxHeight=b.clientHeight-g-10+"px";c.style.opacity="1";c.style.visibility="visible";if(a){var q=this,
s=this._getWindow();q._hideTimeout=s.setTimeout(function(){q._hideTimeout=null;var a=parseFloat(q._getNodeStyle(c,"opacity","1"));q._fadeTimeout=s.setInterval(function(){c.style.visibility==="visible"&&a>0?(a-=0.1,c.style.opacity=a):q._hide()},q._fadeDelay/10)},q._autoHideDelay)}}}},_getAnnotationContents:function(e){function f(a,b){var c=u.getLineStart(u.getLineAtOffset(a)),e=u.getLineEnd(u.getLineAtOffset(b),!0);return u.getText(c,e)}function c(b){var c=b.title,e=g.createElement(k,"div");e.className=
"tooltipRow";if(b.html)e.innerHTML=b.html,e.lastChild&&a.addEventListener(e.lastChild,"click",function(){var a=b.start,c=b.end;s.getBaseModel&&(a=s.mapOffset(a,!0),c=s.mapOffset(c,!0));q.setSelection(a,c,1/3,function(){o._hide()})},!1),e.appendChild(k.createTextNode("\u00a0"));c||(c=f(b.start,b.end));typeof c==="function"&&(c=b.title());if(typeof c==="string"){var d=g.createElement(k,"span");d.appendChild(k.createTextNode(c));c=d}e.appendChild(c);return e}for(var b,l=[],i=0;i<e.length;i++)b=e[i],
b.title!==""&&!b.groupAnnotation&&l.push(b);e=l;if(e.length===0)return null;var o=this,k=this._tooltipDiv.ownerDocument,q=this._view,s=q.getModel(),u=s.getBaseModel?s.getBaseModel():s;if(e.length===1)if(b=e[0],b.title!==void 0){b=c(b);if(b.firstChild)(e=b.firstChild.className)&&(e+=" "),e+="single",b.firstChild.className=e;return b}else return e=new d.ProjectionTextModel(u),l=u.getLineStart(u.getLineAtOffset(b.start)),i=u.getCharCount(),b.end!==i&&e.addProjection({start:b.end,end:i}),l>0&&e.addProjection({start:0,
end:l}),e;else{l=g.createElement(k,"div");b=g.createElement(k,"em");b.appendChild(k.createTextNode(j.multipleAnnotations));l.appendChild(b);for(i=0;i<e.length;i++)b=e[i],(b=c(b))&&l.appendChild(b);return l}},_getNodeStyle:function(a,d,c){var b;if(a&&(b=a.style[d],!b))if(a.currentStyle){for(b=0;(b=d.indexOf("-",b))!==-1;)d=d.substring(0,b)+d.substring(b+1,b+2).toUpperCase()+d.substring(b+2);b=a.currentStyle[d]}else b=(a=a.ownerDocument.defaultView.getComputedStyle(a,null))?a.getPropertyValue(d):null;
return b||c},_isNode:function(a){return typeof Node==="object"?a instanceof Node:a&&typeof a==="object"&&typeof a.nodeType==="number"&&typeof a.nodeName==="string"}};return{Tooltip:f}});
define("orion/editor/annotations",["i18n!orion/editor/nls/messages","orion/editor/eventTarget"],function(j,k){function i(a,b,e){this.start=a;this.end=b;this._projectionModel=e;this.html=this._expandedHTML;this.style=this._expandedStyle;this.expanded=!0}function d(){}function a(a,b){var e=a.lastIndexOf("."),e=a.substring(e+1),f={title:j[e],style:{styleClass:"annotation "+e},html:"<div class='annotationHTML "+e+"'></div>",overviewStyle:{styleClass:"annotationOverview "+e}};b?f.lineStyle={styleClass:"annotationLine "+
e}:f.rangeStyle={styleClass:"annotationRange "+e};d.registerType(a,f)}function g(){}function f(a){this._annotations=[];var b=this;this._listener={onChanged:function(a){b._onChanged(a)}};this.setTextModel(a)}function e(a,b){this._view=a;this._annotationModel=b;var e=this;this._listener={onDestroy:function(a){e._onDestroy(a)},onLineStyle:function(a){e._onLineStyle(a)},onChanged:function(a){e._onAnnotationModelChanged(a)}};a.addEventListener("Destroy",this._listener.onDestroy);a.addEventListener("postLineStyle",
this._listener.onLineStyle);b.addEventListener("Changed",this._listener.onChanged)}i.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 a=this._projectionModel,b=a.getBaseModel();this._projection={annotation:this,start:b.getLineStart(b.getLineAtOffset(this.start)+1),end:b.getLineEnd(b.getLineAtOffset(this.end),!0)};a.addProjection(this._projection)}},expand:function(){this._expand()&&
this._projectionModel.removeProjection(this._projection)}};d.ANNOTATION_ERROR="orion.annotation.error";d.ANNOTATION_WARNING="orion.annotation.warning";d.ANNOTATION_TASK="orion.annotation.task";d.ANNOTATION_BREAKPOINT="orion.annotation.breakpoint";d.ANNOTATION_BOOKMARK="orion.annotation.bookmark";d.ANNOTATION_FOLDING="orion.annotation.folding";d.ANNOTATION_CURRENT_BRACKET="orion.annotation.currentBracket";d.ANNOTATION_MATCHING_BRACKET="orion.annotation.matchingBracket";d.ANNOTATION_CURRENT_LINE="orion.annotation.currentLine";
d.ANNOTATION_CURRENT_SEARCH="orion.annotation.currentSearch";d.ANNOTATION_MATCHING_SEARCH="orion.annotation.matchingSearch";d.ANNOTATION_READ_OCCURRENCE="orion.annotation.readOccurrence";d.ANNOTATION_WRITE_OCCURRENCE="orion.annotation.writeOccurrence";d.ANNOTATION_SELECTED_LINKED_GROUP="orion.annotation.selectedLinkedGroup";d.ANNOTATION_CURRENT_LINKED_GROUP="orion.annotation.currentLinkedGroup";d.ANNOTATION_LINKED_GROUP="orion.annotation.linkedGroup";d.ANNOTATION_BLAME="orion.annotation.blame";d.ANNOTATION_CURRENT_BLAME=
"orion.annotation.currentBlame";var h={};d.registerType=function(a,b){var e=b;if(typeof e!=="function")e=function(a,b,c){this.start=a;this.end=b;if(c!==void 0)this.title=c},e.prototype=b;e.prototype.type=a;h[a]=e;return a};d.createAnnotation=function(a,b,e,d){return new (this.getType(a))(b,e,d)};d.getType=function(a){return h[a]};a(d.ANNOTATION_ERROR);a(d.ANNOTATION_WARNING);a(d.ANNOTATION_TASK);a(d.ANNOTATION_BREAKPOINT);a(d.ANNOTATION_BOOKMARK);a(d.ANNOTATION_CURRENT_BRACKET);a(d.ANNOTATION_MATCHING_BRACKET);
a(d.ANNOTATION_CURRENT_SEARCH);a(d.ANNOTATION_MATCHING_SEARCH);a(d.ANNOTATION_READ_OCCURRENCE);a(d.ANNOTATION_WRITE_OCCURRENCE);a(d.ANNOTATION_SELECTED_LINKED_GROUP);a(d.ANNOTATION_CURRENT_LINKED_GROUP);a(d.ANNOTATION_LINKED_GROUP);a(d.ANNOTATION_CURRENT_LINE,!0);a(d.ANNOTATION_BLAME,!0);a(d.ANNOTATION_CURRENT_BLAME,!0);d.registerType(d.ANNOTATION_FOLDING,i);g.addMixin=function(a){var b=g.prototype,e;for(e in b)b.hasOwnProperty(e)&&(a[e]=b[e])};g.prototype={addAnnotationType:function(a){if(!this._annotationTypes)this._annotationTypes=
[];this._annotationTypes.push(a)},getAnnotationTypePriority:function(a){if(this._annotationTypes)for(var b=0;b<this._annotationTypes.length;b++)if(this._annotationTypes[b]===a)return b+1;return 0},getAnnotationsByType:function(a,b,e){a=a.getAnnotations(b,e);for(e=[];a.hasNext();)b=a.next(),this.getAnnotationTypePriority(b.type)!==0&&e.push(b);var d=this;e.sort(function(a,b){return d.getAnnotationTypePriority(a.type)-d.getAnnotationTypePriority(b.type)});return e},isAnnotationTypeVisible:function(a){return this.getAnnotationTypePriority(a)!==
0},removeAnnotationType:function(a){if(this._annotationTypes)for(var b=0;b<this._annotationTypes.length;b++)if(this._annotationTypes[b]===a){this._annotationTypes.splice(b,1);break}}};f.prototype={addAnnotation:function(a){if(a){var b=this._annotations,e=this._binarySearch(b,a.start);b.splice(e,0,a);a._annotationModel=this;this.onChanged({type:"Changed",added:[a],removed:[],changed:[]})}},getTextModel:function(){return this._model},getAnnotations:function(a,b){var e=this._annotations,d,f=0,h;h=a===
void 0&&b===void 0?function(){return f<e.length?e[f++]:null}:function(){for(;f<e.length;){var d=e[f++];if(a===d.start||(a>d.start?a<d.end:d.start<b))return d;if(d.start>=b)break}return null};d=h();return{next:function(){var a=d;a&&(d=h());return a},hasNext:function(){return d!==null}}},modifyAnnotation:function(a){if(a&&!(this._getAnnotationIndex(a)<0))this.onChanged({type:"Changed",added:[],removed:[],changed:[a]})},onChanged:function(a){return this.dispatchEvent(a)},removeAnnotations:function(a){var b=
this._annotations,e,d;if(a){e=[];for(d=b.length-1;d>=0;d--){var f=b[d];if(f.type===a)b.splice(d,1),e.splice(0,0,f),f._annotationModel=null}}else e=b;this.onChanged({type:"Changed",removed:e,added:[],changed:[]})},removeAnnotation:function(a){if(a){var b=this._getAnnotationIndex(a);if(!(b<0))a._annotationModel=null,this.onChanged({type:"Changed",removed:this._annotations.splice(b,1),added:[],changed:[]})}},replaceAnnotations:function(a,b){var e=this._annotations,d,f,h,g=[];if(a)for(d=a.length-1;d>=
0;d--)if(h=a[d],f=this._getAnnotationIndex(h),!(f<0))h._annotationModel=null,e.splice(f,1),g.splice(0,0,h);b||(b=[]);for(d=0;d<b.length;d++)h=b[d],f=this._binarySearch(e,h.start),h._annotationModel=this,e.splice(f,0,h);this.onChanged({type:"Changed",removed:g,added:b,changed:[]})},setTextModel:function(a){this._model&&this._model.removeEventListener("Changed",this._listener.onChanged);(this._model=a)&&this._model.addEventListener("Changed",this._listener.onChanged)},_binarySearch:function(a,b){for(var e=
a.length,d=-1,f;e-d>1;)f=Math.floor((e+d)/2),b<=a[f].start?e=f:d=f;return e},_getAnnotationIndex:function(a){for(var b=this._annotations,e=this._binarySearch(b,a.start);e<b.length&&b[e].start===a.start;){if(b[e]===a)return e;e++}return-1},_onChanged:function(a){var b=a.start,e=a.removedCharCount,d=this._annotations,f=b+e;if(0<d.length){for(var h={type:"Changed",added:[],removed:[],changed:[],textModelChangedEvent:a},a=a.addedCharCount-e,e=0;e<d.length;e++){var g=d[e];if(g.start>=f)g._oldStart=g.start,
g._oldEnd=g.end,g.start+=a,g.end+=a,h.changed.push(g);else if(!(g.end<=b))g.start<b&&f<g.end?(g._oldStart=g.start,g._oldEnd=g.end,g.end+=a,h.changed.push(g)):(d.splice(e,1),h.removed.push(g),g._annotationModel=null,g.expand&&g.expand(),e--)}if(h.added.length>0||h.removed.length>0||h.changed.length>0)this.onChanged(h)}}};k.EventTarget.addMixin(f.prototype);e.prototype={destroy:function(){var a=this._view;if(a)a.removeEventListener("Destroy",this._listener.onDestroy),a.removeEventListener("LineStyle",
this._listener.onLineStyle),this.view=null;(a=this._annotationModel)&&a.removeEventListener("Changed",this._listener.onChanged)},_mergeStyle:function(a,b){if(b){a||(a={});a.styleClass&&b.styleClass&&a.styleClass!==b.styleClass?a.styleClass+=" "+b.styleClass:a.styleClass=b.styleClass;var e;if(b.tagName&&!a.tagName)a.tagName=b.tagName;if(b.style){if(!a.style)a.style={};for(e in b.style)a.style[e]||(a.style[e]=b.style[e])}if(b.attributes){if(!a.attributes)a.attributes={};for(e in b.attributes)a.attributes[e]||
(a.attributes[e]=b.attributes[e])}}return a},_mergeStyleRanges:function(a,b){a||(a=[]);var e,d;for(d=0;d<a.length&&b;d++){var f=a[d];if(b.end<=f.start)break;if(!(b.start>=f.end)){e=this._mergeStyle({},f.style);e=this._mergeStyle(e,b.style);var h=[];h.push(d,1);b.start<f.start&&h.push({start:b.start,end:f.start,style:b.style});b.start>f.start&&h.push({start:f.start,end:b.start,style:f.style});h.push({start:Math.max(f.start,b.start),end:Math.min(f.end,b.end),style:e});b.end<f.end&&h.push({start:b.end,
end:f.end,style:f.style});b=b.end>f.end?{start:f.end,end:b.end,style:b.style}:null;Array.prototype.splice.apply(a,h)}}b&&(e=this._mergeStyle({},b.style),a.splice(d,0,{start:b.start,end:b.end,style:e}));return a},_onAnnotationModelChanged:function(a){function b(a,b){h.getBaseModel&&(a=h.mapOffset(a,!0),b=h.mapOffset(b,!0));a!==-1&&b!==-1&&d.redrawRange(a,b)}function e(a,c){for(var d=0;d<a.length;d++)if(f.isAnnotationTypeVisible(a[d].type)){var h=a[d];b(h.start,h.end);c&&h._oldStart!==void 0&&h._oldEnd&&
b(h._oldStart,h._oldEnd)}}var d=this._view;if(d){var f=this,h=d.getModel();e(a.added);e(a.removed);e(a.changed,!0)}},_onDestroy:function(){this.destroy()},_onLineStyle:function(a){var b=this._annotationModel,e=a.textView.getModel(),d=b.getTextModel(),f=a.lineStart,h=a.lineStart+a.lineText.length;d!==e&&(f=e.mapOffset(f),h=e.mapOffset(h));for(b=b.getAnnotations(f,h);b.hasNext();)if(f=b.next(),this.isAnnotationTypeVisible(f.type)){if(f.rangeStyle){var h=f.start,g=f.end;d!==e&&(h=e.mapOffset(h,!0),g=
e.mapOffset(g,!0));a.ranges=this._mergeStyleRanges(a.ranges,{start:h,end:g,style:f.rangeStyle})}if(f.lineStyle)a.style=this._mergeStyle({},a.style),a.style=this._mergeStyle(a.style,f.lineStyle)}}};g.addMixin(e.prototype);return{FoldingAnnotation:i,AnnotationType:d,AnnotationTypeList:g,AnnotationModel:f,AnnotationStyler:e}});
define("orion/editor/editor","i18n!orion/editor/nls/messages,orion/editor/eventTarget,orion/editor/tooltip,orion/editor/annotations,orion/objects,orion/util".split(","),function(j,k,i,d,a,g){function f(a){a=a||{};this._domNode=a.domNode;this._model=a.model;this._undoStack=a.undoStack;this._statusReporter=a.statusReporter;this._title=null;var b=this;this._listener={onChanged:function(a){b.onChanged(a)}};this._model&&this._model.addEventListener("Changed",this._listener.onChanged);this.checkDirty()}
function e(a){a=a||{};f.call(this,a);this._textViewFactory=a.textViewFactory;this._undoStackFactory=a.undoStackFactory;this._textDNDFactory=a.textDNDFactory;this._annotationFactory=a.annotationFactory;this._foldingRulerFactory=a.foldingRulerFactory;this._lineNumberRulerFactory=a.lineNumberRulerFactory;this._contentAssistFactory=a.contentAssistFactory;this._keyBindingFactory=a.keyBindingFactory;this._contentAssist=this._foldingRuler=this._overviewRuler=this._lineNumberRuler=this._annotationRuler=this._annotationModel=
this._annotationStyler=null}var h=d.AnnotationType;f.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(a,b){return this.getModel().getText(a,b)},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(a){return this.dispatchEvent(a)},onInputChanged:function(a){return this.dispatchEvent(a)},onChanged:function(){this.checkDirty()},reportStatus:function(a,b,e){this._statusReporter&&this._statusReporter(a,b,e)},resize:function(){},setDirty:function(a){if(this._dirty!==a)this._dirty=a,this.onDirtyChanged({type:"DirtyChanged"})},
_setModelText:function(a){this._model&&this._model.setText(a)},setInput:function(a,b,e,d){this._title=a;d||(b?this.reportStatus(b,"error"):e!==null&&e!==void 0&&typeof e==="string"&&this._setModelText(e),this._undoStack&&this._undoStack.reset());this.checkDirty();this.onInputChanged({type:"InputChanged",title:a,message:b,contents:e,contentsSaved:d})},setText:function(a,b,e){this.getModel().setText(a,b,e)},uninstall:function(){this.installed=!1}};k.EventTarget.addMixin(f.prototype);e.prototype=new f;
a.mixin(e.prototype,{destroy:function(){f.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 a=this._textView.getModel();a.getBaseModel&&(a=a.getBaseModel());return a},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(a,b){if(this._annotationRulerVisible!==a||b)if(this._annotationRulerVisible=a,this._annotationRuler){var e=this._textView;a?e.addRuler(this._annotationRuler,0):e.removeRuler(this._annotationRuler)}},setFoldingRulerVisible:function(a,b){if(this._foldingRulerVisible!==a||b)if(this._foldingRulerVisible=
a,this._foldingRuler){var e=this._textView;e.getModel().getBaseModel&&(a?e.addRuler(this._foldingRuler):e.removeRuler(this._foldingRuler))}},setLineNumberRulerVisible:function(a,b){if(this._lineNumberRulerVisible!==a||b)if(this._lineNumberRulerVisible=a,this._lineNumberRuler){var e=this._textView;a?e.addRuler(this._lineNumberRuler,!this._annotationRulerVisible?0:1):e.removeRuler(this._lineNumberRuler)}},setOverviewRulerVisible:function(a,b){if(this._overviewRulerVisible!==a||b)if(this._overviewRulerVisible=
a,this._overviewRuler){var e=this._textView;a?e.addRuler(this._overviewRuler):e.removeRuler(this._overviewRuler)}},mapOffset:function(a,b){var e=this._textView.getModel();e.getBaseModel&&(a=e.mapOffset(a,b));return a},getLineAtOffset:function(a){return this.getModel().getLineAtOffset(this.mapOffset(a))},getLineStart:function(a){return this.getModel().getLineStart(a)},getCaretOffset:function(){return this.mapOffset(this._textView.getCaretOffset())},getSelection:function(){var a=this._textView,b=a.getSelection(),
a=a.getModel();if(a.getBaseModel)b.start=a.mapOffset(b.start),b.end=a.mapOffset(b.end);return b},_expandOffset:function(a){var b=this._textView.getModel(),e=this._annotationModel;if(e&&b.getBaseModel)for(a=e.getAnnotations(a,a+1);a.hasNext();)b=a.next(),b.type===h.ANNOTATION_FOLDING&&b.expand&&b.expand()},setCaretOffset:function(a,b,e){var d=this._textView,f=d.getModel();f.getBaseModel&&(this._expandOffset(a),a=f.mapOffset(a,!0));d.setCaretOffset(a,b,e)},setText:function(a,b,e){var d=this._textView,
f=d.getModel();f.getBaseModel&&(b!==void 0&&(this._expandOffset(b),b=f.mapOffset(b,!0)),e!==void 0&&(this._expandOffset(e),e=f.mapOffset(e,!0)));d.setText(a,b,e)},setSelection:function(a,b,e,d){var f=this._textView,h=f.getModel();h.getBaseModel&&(this._expandOffset(a),this._expandOffset(b),a=h.mapOffset(a,!0),b=h.mapOffset(b,!0));f.setSelection(a,b,e,d)},moveSelection:function(a,b,e,d){var f=this._textView;this.setSelection(a,b||a,1/3,function(){(d===void 0||d)&&f.focus();e&&e()})},_getTooltipInfo:function(a,
b){var e=this._textView,d=this.getAnnotationModel();if(!d)return null;var f=this._annotationStyler;if(!f)return null;var h=e.getOffsetAtLocation(a,b);if(h===-1)return null;h=this.mapOffset(h);f=f.getAnnotationsByType(d,h,h+1);d=[];for(h=0;h<f.length;h++)f[h].rangeStyle&&d.push(f[h]);if(d.length===0)return null;e=e.convert({x:a,y:b},"document","page");return{contents:d,anchor:"left",x:e.x+10,y:e.y+20}},_highlightCurrentLine:function(a,b){var e=this._annotationModel;if(e){var d=this._textView;if(!d.getOptions("singleMode")){var f=
d.getModel(),g=b?f.getLineAtOffset(b.start):-1,i=f.getLineAtOffset(a.start),d=a.start===a.end,j=!b||b.start===b.end,k=f.getLineStart(i),p=f.getLineEnd(i);f.getBaseModel&&(k=f.mapOffset(k),p=f.mapOffset(p));f=this._currentLineAnnotation;if(!(g===i&&j&&d&&f&&f.start===k&&f.end===p)){var g=f?[f]:null,t;d&&(f=h.createAnnotation(h.ANNOTATION_CURRENT_LINE,k,p),t=[f]);this._currentLineAnnotation=f;e.replaceAnnotations(g,t)}}}},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 a=this,b=this._textView,e=this;this._listener={onModelChanged:function(){e.checkDirty()},onMouseOver:function(a){e._listener.onMouseMove(a)},onMouseMove:function(a){var c=
i.Tooltip.getTooltip(b);if(c&&!(e._listener.lastMouseX===a.event.clientX&&e._listener.lastMouseY===a.event.clientY))e._listener.lastMouseX=a.event.clientX,e._listener.lastMouseY=a.event.clientY,c.setTarget({x:a.x,y:a.y,getTooltipInfo:function(){return e._getTooltipInfo(this.x,this.y)}})},onMouseOut:function(a){var c=i.Tooltip.getTooltip(b);if(c&&!(e._listener.lastMouseX===a.event.clientX&&e._listener.lastMouseY===a.event.clientY))e._listener.lastMouseX=a.event.clientX,e._listener.lastMouseY=a.event.clientY,
c.setTarget(null)},onScroll:function(){var a=i.Tooltip.getTooltip(b);a&&a.setTarget(null,0,0)},onSelection:function(a){e._updateCursorStatus();e._highlightCurrentLine(a.newValue,a.oldValue)}};b.addEventListener("ModelChanged",this._listener.onModelChanged);b.addEventListener("Selection",this._listener.onSelection);b.addEventListener("MouseOver",this._listener.onMouseOver);b.addEventListener("MouseOut",this._listener.onMouseOut);b.addEventListener("MouseMove",this._listener.onMouseMove);b.addEventListener("Scroll",
this._listener.onScroll);if(this._keyBindingFactory){var d;if(d=typeof this._keyBindingFactory==="function"?this._keyBindingFactory(this,this.getKeyModes(),this._undoStack,this._contentAssist):this._keyBindingFactory.createKeyBindings(a,this._undoStack,this._contentAssist))this._textActions=d.textActions,this._linkedMode=d.linkedMode,this._sourceCodeActions=d.sourceCodeActions}d=function(b){if(b!==void 0&&b!==-1){for(var e=this.getView().getModel(),d=this.getAnnotationModel(),f=a.mapOffset(e.getLineStart(b)),
b=a.mapOffset(e.getLineEnd(b)),e=d.getAnnotations(f,b),g=null;e.hasNext();){var i=e.next();if(i.type===h.ANNOTATION_BOOKMARK){g=i;break}}g?d.removeAnnotation(g):(g=h.createAnnotation(h.ANNOTATION_BOOKMARK,f,b),g.title=void 0,d.addAnnotation(g))}};if(this._annotationFactory){var g=b.getModel();g.getBaseModel&&(g=g.getBaseModel());if(this._annotationModel=this._annotationFactory.createAnnotationModel(g))if(g=this._annotationStyler=this._annotationFactory.createAnnotationStyler(b,this._annotationModel))g.addAnnotationType(h.ANNOTATION_CURRENT_SEARCH),
g.addAnnotationType(h.ANNOTATION_MATCHING_SEARCH),g.addAnnotationType(h.ANNOTATION_ERROR),g.addAnnotationType(h.ANNOTATION_WARNING),g.addAnnotationType(h.ANNOTATION_MATCHING_BRACKET),g.addAnnotationType(h.ANNOTATION_CURRENT_BRACKET),g.addAnnotationType(h.ANNOTATION_CURRENT_LINE),g.addAnnotationType(h.ANNOTATION_READ_OCCURRENCE),g.addAnnotationType(h.ANNOTATION_WRITE_OCCURRENCE),g.addAnnotationType(h.ANNOTATION_SELECTED_LINKED_GROUP),g.addAnnotationType(h.ANNOTATION_CURRENT_LINKED_GROUP),g.addAnnotationType(h.ANNOTATION_LINKED_GROUP),
g.addAnnotationType("orion.annotation.highlightError");var g=this._annotationFactory.createAnnotationRulers(this._annotationModel),j=this._annotationRuler=g.annotationRuler;if(j)j.onDblClick=d,j.setMultiAnnotationOverlay({html:"<div class='annotationHTML overlay'></div>"}),j.addAnnotationType(h.ANNOTATION_ERROR),j.addAnnotationType(h.ANNOTATION_WARNING),j.addAnnotationType(h.ANNOTATION_TASK),j.addAnnotationType(h.ANNOTATION_BOOKMARK);this.setAnnotationRulerVisible(this._annotationRulerVisible||this._annotationRulerVisible===
void 0,!0);if(j=this._overviewRuler=g.overviewRuler)j.addAnnotationType(h.ANNOTATION_CURRENT_SEARCH),j.addAnnotationType(h.ANNOTATION_MATCHING_SEARCH),j.addAnnotationType(h.ANNOTATION_READ_OCCURRENCE),j.addAnnotationType(h.ANNOTATION_WRITE_OCCURRENCE),j.addAnnotationType(h.ANNOTATION_CURRENT_BLAME),j.addAnnotationType(h.ANNOTATION_ERROR),j.addAnnotationType(h.ANNOTATION_WARNING),j.addAnnotationType(h.ANNOTATION_TASK),j.addAnnotationType(h.ANNOTATION_BOOKMARK),j.addAnnotationType(h.ANNOTATION_MATCHING_BRACKET),
j.addAnnotationType(h.ANNOTATION_CURRENT_BRACKET),j.addAnnotationType(h.ANNOTATION_CURRENT_LINE);this.setOverviewRulerVisible(this._overviewRulerVisible||this._overviewRulerVisible===void 0,!0)}if(this._lineNumberRulerFactory)this._lineNumberRuler=this._lineNumberRulerFactory.createLineNumberRuler(this._annotationModel),this._lineNumberRuler.addAnnotationType(h.ANNOTATION_CURRENT_BLAME),this._lineNumberRuler.addAnnotationType(h.ANNOTATION_BLAME),this._lineNumberRuler.onDblClick=d,this.setLineNumberRulerVisible(this._lineNumberRulerVisible||
this._lineNumberRulerVisible===void 0,!0);if(this._foldingRulerFactory)this._foldingRuler=this._foldingRulerFactory.createFoldingRuler(this._annotationModel),this._foldingRuler.addAnnotationType(h.ANNOTATION_FOLDING),this.setFoldingRulerVisible(this._foldingRulerVisible||this._foldingRulerVisible===void 0,!0);this.dispatchEvent({type:"TextViewInstalled",textView:b});f.prototype.install.call(this)}},uninstallTextView:function(){this.uninstall()},uninstall:function(){var a=this._textView;if(a)a.destroy(),
this._textView=this._undoStack=this._textDND=this._contentAssist=this._listener=this._annotationModel=this._annotationStyler=this._annotationRuler=this._overviewRuler=this._lineNumberRuler=this._foldingRuler=this._currentLineAnnotation=this._title=null,this._dirty=!1,this._foldingRulerVisible=this._overviewRulerVisible=this._lineNumberRulerVisible=this._annotationRulerVisible=void 0,this.dispatchEvent({type:"TextViewUninstalled",textView:a}),f.prototype.uninstall.call(this)},_updateCursorStatus:function(){var a=
this.getModel(),b=this.getCaretOffset(),e=a.getLineAtOffset(b),a=a.getLineStart(e);b-=a;for(var a=this.getKeyModes(),d=0;d<a.length;d++){var f=a[d];if(f.isActive()&&f.isStatusActive&&f.isStatusActive())return}this.reportStatus(g.formatMessage(j.lineColumn,e+1,b+1))},showAnnotations:function(a,b,e,d){var f=this._annotationModel;if(f){for(var g=[],i=[],j=f.getTextModel(),k=f.getAnnotations(),p;k.hasNext();)p=k.next(),b.indexOf(p.type)!==-1&&p.creatorID===this&&g.push(p);if(a)for(b=0;b<a.length;b++)if(p=
a[b]){if(e)p=e(p);else{var t;typeof p.line==="number"?(t=j.getLineStart(p.line-1),k=t+p.start-1,t=t+p.end-1):(k=p.start,t=p.end);var v=d(p);if(!v)continue;p=h.createAnnotation(v,k,t,p.description)}p.creatorID=this;i.push(p)}f.replaceAnnotations(g,i)}},showProblems:function(a){this.showAnnotations(a,[h.ANNOTATION_ERROR,h.ANNOTATION_WARNING,h.ANNOTATION_TASK],null,function(a){switch(a.severity){case "error":return h.ANNOTATION_ERROR;case "warning":return h.ANNOTATION_WARNING;case "task":return h.ANNOTATION_TASK}return null})},
showOccurrences:function(a){this.showAnnotations(a,[h.ANNOTATION_READ_OCCURRENCE,h.ANNOTATION_WRITE_OCCURRENCE],null,function(a){return a.readAccess?h.ANNOTATION_READ_OCCURRENCE:h.ANNOTATION_WRITE_OCCURRENCE})},showBlame:function(c){var b=this._blameRGB,e=this.getTextView().getOptions("parent").ownerDocument;if(!b){var f=g.createElement(e,"div");f.className="annotation blame";e.body.appendChild(f);var i=(e.defaultView||e.parentWindow).getComputedStyle(f).getPropertyValue("background-color");f.parentNode.removeChild(f);
var f=i.indexOf("("),k=i.indexOf(")"),i=i.substring(f+1,k);this._blameRGB=b=i.split(",").slice(0,3)}var q=function(){var b=d.AnnotationType.createAnnotation(this.groupType,this.start,this.end,this.title);b.style=a.mixin({},b.style);b.style.style=a.mixin({},b.style.style);b.style.style.backgroundColor="";this.groupAnnotation=b;b.blame=this.blame;b.html=this.html;b.creatorID=this.creatorID;return b},s=function(){var a=g.createElement(e,"div");a.className="tooltipTitle";var b=this.blame.Message.indexOf("\n");
if(b===-1)b=this.blame.Message.length;var c=g.createElement(e,"a");c.href=this.blame.CommitLink;c.appendChild(e.createTextNode(this.blame.Message.substring(0,b)));a.appendChild(c);a.appendChild(g.createElement(e,"br"));a.appendChild(e.createTextNode(g.formatMessage(j.committerOnTime,this.blame.AuthorName,this.blame.Time)));return a},u=this.getModel();this.showAnnotations(c,[h.ANNOTATION_BLAME,h.ANNOTATION_CURRENT_BLAME],function(c){var e=u.getLineStart(c.Start-1),f=u.getLineEnd(c.End-1,!0),e=d.AnnotationType.createAnnotation(h.ANNOTATION_BLAME,
e,f,s),f=b.slice(0);f.push(c.Shade);e.style=a.mixin({},e.style);e.style.style=a.mixin({},e.style.style);e.style.style.backgroundColor="rgba("+f.join()+")";e.groupId=c.Name;e.groupType=h.ANNOTATION_CURRENT_BLAME;e.createGroupAnnotation=q;e.html='<img class="annotationHTML blame" src="'+c.AuthorImage+'"/>';e.blame=c;return e})},showSelection:function(a,b,e,d,f){typeof a==="number"?(typeof b!=="number"&&(b=a),this.moveSelection(a,b)):typeof e==="number"&&(a=this.getModel().getLineStart(e-1),typeof d===
"number"&&(a+=d),typeof f!=="number"&&(f=0),this.moveSelection(a,a+f))},_setModelText:function(a){this._textView&&(this._textView.setText(a),this._textView.getModel().setLineDelimiter("auto"),this._highlightCurrentLine(this._textView.getSelection()))},setInput:function(a,b,e,d,h){f.prototype.setInput.call(this,a,b,e,d);this._textView&&!d&&!h&&this._textView.focus()},onGotoLine:function(a,b,e,d){if(this._textView){var f=this.getModel(),a=Math.max(0,Math.min(a,f.getLineCount()-1)),h=f.getLineStart(a),
g=0;e===void 0&&(e=0);typeof b==="string"?(a=f.getLine(a).indexOf(b),a!==-1&&(g=a,e=g+b.length)):(g=b,b=f.getLineEnd(a)-h,g=Math.min(g,b),e=Math.min(e,b));this.moveSelection(h+g,h+e,d)}}});return{BaseEditor:f,Editor:e}});
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(j,k,i,d,a,g,f){function e(b){var c=b.getTextView();i.KeyMode.call(this,c);this.editor=b;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 e=this;this._listener={onVerify:function(b){var c=e.editor,d=c.getModel(),f=c.mapOffset(b.start),c=c.mapOffset(b.end),d=d.getText(f,c);if((d=e._prefix.match(RegExp("^"+a.escape(d),"i")))&&d.length>0)e._prefix+=b.text,e._success=!0,e._status(),e.find(e._forward,!0),b.text=null},onSelection:function(){e._ignoreSelection||e.setActive(!1)}}}function h(a,c,e){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(e)}}var c={};e.prototype=new i.KeyMode;g.mixin(e.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 e=this._prefix;if(e.length===0)return!1;var d=this.editor,f=d.getModel(),f=a?this._success?c?this._start:d.getCaretOffset()+
1:0:this._success?c?this._start:d.getCaretOffset():f.getCharCount()-1;if(e=d.getModel().find({string:e,start:f,reverse:!a,caseInsensitive:e.toLowerCase()===e}).next()){if(!c)this._start=f;this._ignoreSelection=this._success=!0;d.moveSelection(a?e.start:e.end,a?e.end:e.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?j.incrementalFindStr:j.incrementalFindStrNotFound:this._success?j.incrementalFindReverseStr:j.incrementalFindReverseStrNotFound;a=f.formatMessage(a,this._prefix);this.editor.reportStatus(a,this._success?"":"error")}else this.editor.reportStatus("")}});
c.IncrementalFind=e;h.prototype={find:function(a,c,e){this.setOptions({reverse:!a});var d=this.getFindString(),f;if(c)d=c.findString||d,f=c.count;a=this.getOptions();this.setOptions(c);c=e?this._startOffset:this.getStartOffset();if((f=this._doFind(d,c,f))&&!e)this._startOffset=f.start;this.setOptions(a);this._hideAfterFind&&this.hide();return f},getStartOffset:function(){return this._start!==void 0?this._start:this._reverse?this._editor.getSelection().start-1:this._editor.getCaretOffset()},getFindString:function(){var b=
this._editor.getSelection(),b=this._editor.getText(b.start,b.end);this._regex&&(b=a.escape(b));return b||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="",e=!1,d=this._editor.getModel().getLineDelimiter(),f=0;f<a.length;f++){var h=a.substring(f,f+1);if(e){switch(h){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+="\\"+h}e=!1}else h==="\\"?e=!0:c+=h}e&&(c+="\\")}return c},isVisible:function(){return this._visible},replace:function(){var a=this.getFindString();if(a){var c=this._editor,e=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,e),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,e=c.getTextView();c.reportStatus(j.replaceAll);var d=this._processReplaceString(this.getReplaceString()),h=this;window.setTimeout(function(){for(var g=0,i=0;;){var k=h._doFind(a,g,null,!0);if(!k)break;i++;i===1&&(e.setRedraw(!1),h.startUndo());h._doReplace(k.start,k.end,a,d);g=h.getStartOffset()}i>
0&&(h.endUndo(),e.setRedraw(!0));g>0?c.reportStatus(f.formatMessage(j.replacedMatches,i)):c.reportStatus(j.nothingReplaced,"error");h._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(d.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,e){return this._editor.getModel().find({string:a,start:c,end:this._end,reverse:this._reverse,wrap:e?!1:this._wrap,regex:this._regex,wholeWord:this._wholeWord,caseInsensitive:this._caseInsensitive})},_doFind:function(a,c,e,f){var e=e||1,h=this._editor;if(!a)return this._removeAllAnnotations(),null;this._lastString=a;var g,i;if(this._regex)try{i=this._find(a,c,f)}catch(k){h.reportStatus(k.message,
"error");return}else i=this._find(a,c,f);for(a=0;a<e&&i.hasNext();a++)g=i.next();if(!this._replacingAll){g?this._editor.reportStatus(""):this._editor.reportStatus(j.notFound,"error");if(this.isVisible()){e=d.AnnotationType.ANNOTATION_CURRENT_SEARCH;if(i=h.getAnnotationModel())i.removeAnnotations(e),g&&i.addAnnotation(d.AnnotationType.createAnnotation(e,g.start,g.end));if(this._showAll){this._timer&&window.clearTimeout(this._timer);var p=this;this._timer=window.setTimeout(function(){p._markAllOccurrences();
p._timer=null},500)}}this._findCallback?this._findCallback(g):g&&h.moveSelection(g.start,g.end,null,!1)}return g},_doReplace:function(a,c,e,d){var f=this._editor;if(this._regex&&(d=f.getText(a,c).replace(RegExp(e,this._caseInsensitive?"i":""),d),!d))return;f.setText(d,a,c);f.setSelection(a,a+d.length,!0)},_markAllOccurrences:function(){var a=this._editor.getAnnotationModel();if(a){for(var c=d.AnnotationType.ANNOTATION_MATCHING_SEARCH,e=a.getAnnotations(),f=[],h;e.hasNext();){var g=e.next();g.type===
c&&f.push(g)}if(this.isVisible()){e=this.getFindString();e=this._editor.getModel().find({string:e,regex:this._regex,wholeWord:this._wholeWord,caseInsensitive:this._caseInsensitive});for(h=[];e.hasNext();)g=e.next(),h.push(d.AnnotationType.createAnnotation(c,g.start,g.end))}a.replaceAnnotations(f,h)}},_removeAllAnnotations:function(){var a=this._editor.getAnnotationModel();a&&(a.removeAnnotations(d.AnnotationType.ANNOTATION_CURRENT_SEARCH),a.removeAnnotations(d.AnnotationType.ANNOTATION_MATCHING_SEARCH))},
_removeCurrentAnnotation:function(){var a=this._editor.getAnnotationModel();a&&a.removeAnnotations(d.AnnotationType.ANNOTATION_CURRENT_SEARCH)}};c.Find=h;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(j,k,i,d,a,g){function f(b,c,e){this.editor=b;this.undoStack=c;this._incrementalFind=new a.IncrementalFind(b);this._find=e?e:new a.Find(b,c);this._lastEditLocation=null;this.init()}function e(a,c,e,d){this.editor=a;this.undoStack=c;this.contentAssist=e;this.linkedMode=d;this.contentAssist&&this.contentAssist.addEventListener("ProposalApplied",
this.contentAssistProposalApplied.bind(this));this.init()}var h=i.AnnotationType,c={};f.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 b=1;if(a&&a.count)b=a.count;for(;b>0;)this.undoStack.undo(),--b;return!0}return!1}.bind(this),
{name:j.undo});a.setAction("redo",function(a){if(this.undoStack){var b=1;if(a&&a.count)b=a.count;for(;b>0;)this.undoStack.redo(),--b;return!0}return!1}.bind(this),{name:j.redo});a.setKeyBinding(new k.KeyBinding("f",!0),"find");a.setAction("find",function(){if(this._find){var a=this.editor.getSelection();(a=prompt(j.find,this.editor.getText(a.start,a.end)))&&this._find.find(!0,{findString:a})}}.bind(this),{name:j.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:j.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:j.findPrevious});a.setKeyBinding(new k.KeyBinding("j",!0),"incrementalFind");a.setAction("incrementalFind",function(){this._incrementalFind&&this._incrementalFind.find(!0);return!0}.bind(this),{name:j.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:j.incrementalFindReverse});a.setAction("tab",function(){return this.indentLines()}.bind(this));a.setAction("shiftTab",function(){return this.unindentLines()}.bind(this),{name:j.unindentLines});a.setKeyBinding(new k.KeyBinding(38,!1,!1,!0),"moveLinesUp");a.setAction("moveLinesUp",function(){return this.moveLinesUp()}.bind(this),{name:j.moveLinesUp});a.setKeyBinding(new k.KeyBinding(40,
!1,!1,!0),"moveLinesDown");a.setAction("moveLinesDown",function(){return this.moveLinesDown()}.bind(this),{name:j.moveLinesDown});a.setKeyBinding(new k.KeyBinding(38,!0,!1,!0),"copyLinesUp");a.setAction("copyLinesUp",function(){return this.copyLinesUp()}.bind(this),{name:j.copyLinesUp});a.setKeyBinding(new k.KeyBinding(40,!0,!1,!0),"copyLinesDown");a.setAction("copyLinesDown",function(){return this.copyLinesDown()}.bind(this),{name:j.copyLinesDown});a.setKeyBinding(new k.KeyBinding("d",!0,!1,!1),
"deleteLines");a.setAction("deleteLines",function(a){return this.deleteLines(a)}.bind(this),{name:j.deleteLines});a.setKeyBinding(new k.KeyBinding("l",!g.isMac,!1,!1,g.isMac),"gotoLine");a.setAction("gotoLine",function(){return this.gotoLine()}.bind(this),{name:j.gotoLine});a.setKeyBinding(new k.KeyBinding(190,!0),"nextAnnotation");a.setAction("nextAnnotation",function(){return this.nextAnnotation(!0)}.bind(this),{name:j.nextAnnotation});a.setKeyBinding(new k.KeyBinding(188,!0),"previousAnnotation");
a.setAction("previousAnnotation",function(){return this.nextAnnotation(!1)}.bind(this),{name:j.prevAnnotation});a.setKeyBinding(new k.KeyBinding("e",!0,!1,!0,!1),"expand");a.setAction("expand",function(){return this.expandAnnotation(!0)}.bind(this),{name:j.expand});a.setKeyBinding(new k.KeyBinding("c",!0,!1,!0,!1),"collapse");a.setAction("collapse",function(){return this.expandAnnotation(!1)}.bind(this),{name:j.collapse});a.setKeyBinding(new k.KeyBinding("e",!0,!0,!0,!1),"expandAll");a.setAction("expandAll",
function(){return this.expandAnnotations(!0)}.bind(this),{name:j.expandAll});a.setKeyBinding(new k.KeyBinding("c",!0,!0,!0,!1),"collapseAll");a.setAction("collapseAll",function(){return this.expandAnnotations(!1)}.bind(this),{name:j.collapseAll});a.setKeyBinding(new k.KeyBinding("q",!g.isMac,!1,!1,g.isMac),"lastEdit");a.setAction("lastEdit",function(){return this.gotoLastEdit()}.bind(this),{name:j.lastEdit})},copyLinesDown:function(){var a=this.editor;if(a.getTextView().getOptions("readonly"))return!1;
var c=a.getModel(),e=a.getSelection(),d=c.getLineAtOffset(e.start),e=c.getLineAtOffset(e.end>e.start?e.end-1:e.end),f=c.getLineStart(d),d=c.getLineEnd(e,!0),h=c.getLineCount(),g="",f=c.getText(f,d);e===h-1&&(f=(g=c.getLineDelimiter())+f);a.setText(f,d,d);a.setSelection(d+g.length,d+f.length);return!0},copyLinesUp:function(){var a=this.editor;if(a.getTextView().getOptions("readonly"))return!1;var c=a.getModel(),e=a.getSelection(),d=c.getLineAtOffset(e.start),e=c.getLineAtOffset(e.end>e.start?e.end-
1:e.end),d=c.getLineStart(d),f=c.getLineEnd(e,!0),h=c.getLineCount(),g="",f=c.getText(d,f);e===h-1&&(f+=g=c.getLineDelimiter());a.setText(f,d,d);a.setSelection(d,d+f.length-g.length);return!0},deleteLines:function(a){var c=this.editor;if(c.getTextView().getOptions("readonly"))return!1;var e=1;if(a&&a.count)e=a.count;var d=c.getSelection(),f=c.getModel(),h=f.getLineAtOffset(d.start),a=f.getLineStart(h),e=d.start!==d.end||e===1?f.getLineAtOffset(d.end>d.start?d.end-1:d.end):Math.min(h+e-1,f.getLineCount()-
1),e=f.getLineEnd(e,!0);c.setText("",a,e);return!0},expandAnnotation:function(a){var c=this.editor,e=c.getAnnotationModel();if(!e)return!0;var d=c.getModel(),f=c.getCaretOffset(),h=d.getLineAtOffset(f),f=d.getLineStart(h),h=d.getLineEnd(h,!0);d.getBaseModel&&(f=d.mapOffset(f),h=d.mapOffset(h),d.getBaseModel());for(var g,e=e.getAnnotations(f,h);!g&&e.hasNext();)d=e.next(),d.type===i.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,e=c.getTextView(),d=c.getAnnotationModel();if(!d)return!0;c.getModel();d=d.getAnnotations();for(e.setRedraw(!1);d.hasNext();)c=d.next(),c.type===i.AnnotationType.ANNOTATION_FOLDING&&a!==c.expanded&&(a?c.expand():c.collapse());e.setRedraw(!0);return!0},indentLines:function(){var a=this.editor,c=a.getTextView();if(c.getOptions("readonly"))return!1;if(c.getOptions("tabMode")){var e=a.getModel(),d=a.getSelection(),f=e.getLineAtOffset(d.start),
h=e.getLineAtOffset(d.end>d.start?d.end-1:d.end);if(f!==h){var g=[];g.push("");for(var i=f;i<=h;i++)g.push(e.getLine(i,!0));i=e.getLineStart(f);e=e.getLineEnd(h,!0);c=c.getOptions("tabSize","expandTab");c=c.expandTab?Array(c.tabSize+1).join(" "):"\t";a.setText(g.join(c),i,e);a.setSelection(i===d.start?d.start:d.start+c.length,d.end+(h-f+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(j.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(),e=a.getSelection(),d=c.getLineAtOffset(e.start),f=c.getLineAtOffset(e.end>e.start?e.end-1:e.end),h=c.getLineCount();if(f===h-1)return!0;var d=c.getLineStart(d),e=c.getLineEnd(f,!0),g=c.getLineEnd(f+1,!0)-(e-d),i=0;f!==h-2?c=c.getText(d,e):(f=c.getLineEnd(f),
c=c.getText(f,e)+c.getText(d,f),i+=e-f);this.startUndo();a.setText("",d,e);a.setText(c,g,g);a.setSelection(g+i,g+i+c.length);this.endUndo();return!0},moveLinesUp:function(){var a=this.editor;if(a.getTextView().getOptions("readonly"))return!1;var c=a.getModel(),e=a.getSelection(),d=c.getLineAtOffset(e.start);if(d===0)return!0;var f=c.getLineAtOffset(e.end>e.start?e.end-1:e.end),h=c.getLineCount(),e=c.getLineStart(d-1),g=c.getLineStart(d),i=c.getLineEnd(f,!0),j=c.getText(g,i),k=0;f===h-1&&(f=c.getLineEnd(d-
1),d=c.getLineEnd(d-1,!0),j+=c.getText(f,d),g=f,k=d-f);this.startUndo();a.setText("",g,i);a.setText(j,e,e);a.setSelection(e,e+j.length-k);this.endUndo();return!0},nextAnnotation:function(a){function c(a){return!!a.lineStyle||a.type===h.ANNOTATION_MATCHING_BRACKET||a.type===h.ANNOTATION_CURRENT_BRACKET||!g.isAnnotationTypeVisible(a.type)}var e=this.editor,f=e.getAnnotationModel();if(!f)return!0;var g=e.getOverviewRuler()||e.getAnnotationStyler();if(!g)return!0;for(var i=e.getModel(),j=e.getCaretOffset(),
k=f.getAnnotations(a?j:0,a?i.getCharCount():j),p=null;k.hasNext();){var t=k.next();if(a){if(t.start<=j)continue}else if(t.start>=j)continue;if(!c(t)&&(p=t,a))break}if(p){for(var v=[p],k=f.getAnnotations(p.start,p.start);k.hasNext();)t=k.next(),t!==p&&!c(t)&&v.push(t);var n=e.getTextView(),w=i.getLineAtOffset(p.start),x=d.Tooltip.getTooltip(n);if(!x)return e.moveSelection(p.start),!0;e.moveSelection(p.start,p.start,function(){x.setTarget({getTooltipInfo:function(){var a=n.convert({x:n.getLocationAtOffset(p.start).x,
y:n.getLocationAtOffset(i.getLineStart(w)).y},"document","page");return{contents:v,x:a.x,y:a.y+Math.floor(n.getLineHeight(w)*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 e=a.getModel(),d=a.getSelection(),f=e.getLineAtOffset(d.start),h=e.getLineAtOffset(d.end>d.start?d.end-1:d.end),g=c.getOptions("tabSize"),i=Array(g+1).join(" "),j=[],k=c=0,v=f;v<=h;v++){var n=e.getLine(v,!0);if(e.getLineStart(v)!==
e.getLineEnd(v))if(n.indexOf("\t")===0)n=n.substring(1),c++;else if(n.indexOf(i)===0)n=n.substring(g),c+=g;else return!0;v===f&&(k=c);j.push(n)}f=e.getLineStart(f);g=e.getLineEnd(h,!0);e=e.getLineStart(h);a.setText(j.join(""),f,g);h=f===d.start?d.start:d.start-k;d=Math.max(h,d.end-c+(d.end===e+1&&d.start!==d.end?1:0));a.setSelection(h,d);return!0}},startUndo:function(){this.undoStack&&this.undoStack.startCompoundChange()},endUndo:function(){this.undoStack&&this.undoStack.endCompoundChange()}};c.TextActions=
f;e.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:j.trimTrailingWhitespaces});a.setKeyBinding(new k.KeyBinding(191,!0),"toggleLineComment");a.setAction("toggleLineComment",
function(){return this.toggleLineComment()}.bind(this),{name:j.toggleLineComment});a.setKeyBinding(new k.KeyBinding(191,!0,!g.isMac,!1,g.isMac),"addBlockComment");a.setAction("addBlockComment",function(){return this.addBlockComment()}.bind(this),{name:j.addBlockComment});a.setKeyBinding(new k.KeyBinding(220,!0,!g.isMac,!1,g.isMac),"removeBlockComment");a.setAction("removeBlockComment",function(){return this.removeBlockComment()}.bind(this),{name:j.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 e=a.getSelection();if(e.start===e.end){for(var d=a.getModel(),f=d.getLineAtOffset(e.start),h=d.getLine(f,!1),g=d.getLineStart(f),i=0,j=e.start-
g,k;i<j&&((k=h.charCodeAt(i))===32||k===9);)i++;var g=h.substring(0,i),c=c.getOptions("tabSize","expandTab"),v=c.expandTab?Array(c.tabSize+1).join(" "):"\t",c=d.getLineDelimiter(),n=/^[\s]*\/\*[\*]*[\s]*$/,w=/^[\s]*\*/,x=/\*\/[\s]*$/,y=h.substring(0,j),A=h.substring(j),K;if(this.smartIndentation&&h.charCodeAt(K=y.trimRight().length-1)===123)return d=j-K-1,A=A.length-A.trimLeft().length,h=h.charCodeAt(j+A)===125?c+g+v+c+g:c+g+v,a.setText(h,e.start-d,e.end+A),a.setCaretOffset(e.start+c.length+g.length+
v.length-d),!0;else if(this.autoCompleteComments&&!x.test(y)&&(n.test(y)||w.test(y))){if(i=n.exec(y)){h=c+g+" * ";h+=x.test(A)?A.substring(0,A.length-2).trim():A.trim();if(d.getLineCount()===f+1||!w.test(d.getLine(f+1)))h+=c+g+" */";a.setText(h,e.start,e.end+A.length);a.setCaretOffset(e.start+c.length+g.length+3);return!0}if(i=w.exec(y))for(f-=1;f>=0;f--)if(i=d.getLine(f,!1),n.test(i))return x.test(A)||h.charCodeAt(j)===47?(h=c+g+"*"+A,g=e.start+c.length+g.length+1):(h=c+g+"* "+A,g=e.start+c.length+
g.length+2),a.setText(h,e.start,e.end+A.length),a.setCaretOffset(g),!0;else if(!w.test(i))break}else if(x.test(y)&&g.charCodeAt(g.length-1)===32)return h=c+g.substring(0,g.length-1),a.setText(h,e.start,e.end),a.setCaretOffset(e.start+h.length),!0;else if(i>0){for(i=j;i<h.length&&((k=h.charCodeAt(i++))===32||k===9);)e.end++;a.setText(d.getLineDelimiter()+g,e.start,e.end);return!0}}return!1},addBlockComment:function(){var a=this.editor;if(a.getTextView().getOptions("readonly"))return!1;var c=a.getModel(),
e=a.getSelection(),d=this._findEnclosingComment(c,e.start,e.end);if(d.commentStart!==void 0&&d.commentEnd!==void 0)return!0;c=c.getText(e.start,e.end);if(c.length===0)return!0;var d=c.length,c=c.replace(/\/\*|\*\//g,""),f=c.length;a.setText("/*"+c+"*/",e.start,e.end);a.setSelection(e.start+2,e.end+2+(f-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 e=this.editor;if(e.getTextView().getOptions("readonly"))return!1;var d=e.getSelection(),f=e.getModel(),h=e.getCaretOffset()===f.getCharCount()?"":f.getText(d.start,d.start+1).trim(),g=/^$|[)}\]>]/;if(d.start===d.end&&g.test(h))return e.setText(a+c,d.start,d.start),e.setCaretOffset(d.start+1),!0;else if(d.start!==d.end)return f=f.getText(d.start,d.end),e.setText(a+f+c,d.start,d.end),e.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 e=c.getSelection(),d=c.getModel(),f=c.getCaretOffset(),h=f===0?"":d.getText(e.start-1,e.start).trim(),g=f===d.getCharCount()?"":d.getText(e.start,e.start+1).trim(),f=/^"$|^'$/,i=/\w/,j=/^$|[)}\]>]/;if(e.start!==e.end){d=d.getText(e.start,e.end);if(f.test(d))return!1;c.setText(a+d+a,e.start,e.end);c.setSelection(e.start+1,e.end+1)}else if(g===a)c.setCaretOffset(e.start+1);else if(h===a||f.test(g)||i.test(h)||!j.test(g))return!1;
else c.setText(a+a,e.start,e.start),c.setCaretOffset(e.start+1);return!0},contentAssistProposalApplied:function(a){a=a.data.proposal;if(a.positions&&a.positions.length>0&&this.linkedMode){for(var c=[],e=0;e<a.positions.length;++e)c[e]={positions:[{offset:a.positions[e].offset,length:a.positions[e].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 e=a.getModel(),d=a.getCaretOffset(),f=d===0?"":e.getText(c.start-1,c.start),e=d===e.getCharCount()?"":e.getText(c.start,c.start+1);(f==="("&&e===")"||f==="["&&e==="]"||f==="{"&&e==="}"||f==="<"&&e===">"||f==='"'&&e==='"'||f==="'"&&e==="'")&&a.setText("",c.start,c.start+
1);return!1},_findEnclosingComment:function(a,c,e){var d=a.getLineAtOffset(c),f=a.getLineAtOffset(e),h,g,i,j,k,v;for(h=d;h>=0;h--)if(g=a.getLine(h),i=h===d?c-a.getLineStart(d):g.length,j=g.lastIndexOf("/*",i),g=g.lastIndexOf("*/",i),g>j)break;else if(j!==-1){k=a.getLineStart(h)+j;break}for(h=f;h<a.getLineCount();h++)if(g=a.getLine(h),i=h===f?e-a.getLineStart(f):0,j=g.indexOf("/*",i),g=g.indexOf("*/",i),j!==-1&&j<g)break;else if(g!==-1){v=a.getLineStart(h)+g;break}return{commentStart:k,commentEnd:v}},
lineStart:function(){for(var a=this.editor,c=a.getModel(),e=a.getCaretOffset(),d=c.getLineAtOffset(e),f=c.getLineStart(d),c=c.getLine(d),d=0;d<c.length;d++){var h=c.charCodeAt(d);if(!(h===32||h===9))break}d+=f;return e!==d?(a.setSelection(d,d),!0):!1},removeBlockComment:function(){var a=this.editor;if(a.getTextView().getOptions("readonly"))return!1;var c=a.getModel(),e=a.getSelection(),d=c.getText(e.start,e.end),f,h,g;for(g=0;g<d.length;g++)if(d.substring(g,g+2)==="/*"){f=e.start+g;break}for(;g<d.length;g++)if(d.substring(g,
g+2)==="*/"){h=e.start+g;break}if(f!==void 0&&h!==void 0)a.setText(c.getText(f+2,h),f,h+2),a.setSelection(f,h);else{d=this._findEnclosingComment(c,e.start,e.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(e.start-2,e.end-2)}return!0},toggleLineComment:function(){var a=this.editor;if(a.getTextView().getOptions("readonly"))return!1;for(var c=a.getModel(),e=a.getSelection(),d=c.getLineAtOffset(e.start),
f=c.getLineAtOffset(e.end>e.start?e.end-1:e.end),h=!0,g=[],i,j,k=d;k<=f;k++)if(i=c.getLine(k,!0),g.push(i),!h||(j=i.indexOf("//"))===-1)h=!1;else if(j!==0){var v;for(v=0;v<j;v++)if(h=i.charCodeAt(v),!(h===32||h===9))break;h=v===j}k=c.getLineStart(d);v=c.getLineEnd(f,!0);if(h){for(h=0;h<g.length;h++)i=g[h],j=i.indexOf("//"),g[h]=i.substring(0,j)+i.substring(j+2);g=g.join("");i=c.getLineStart(f);c=k===e.start?e.start:e.start-2;e=e.end-2*(f-d+1)+(e.end===i+1?2:0)}else g.splice(0,0,""),g=g.join("//"),
c=k===e.start?e.start:e.start+2,e=e.end+2*(f-d+1);a.setText(g,k,v);a.setSelection(c,e);return!0},trimTrailingWhitespaces:function(){var a=this.editor,c=a.getModel(),e=a.getSelection();a.getTextView().setRedraw(!1);a.getUndoStack().startCompoundChange();for(var d=/(\s+$)/,f=c.getLineCount(),h=0;h<f;h++){var g=c.getLine(h),i=d.exec(g);if(i){var j=c.getLineStart(h),g=i[0].length,i=j+i.index;c.setText("",i,i+g);if(e.start>i)e.start=Math.max(i,e.start-g);if(e.start!==e.end&&e.end>i)e.end=Math.max(i,e.end-
g)}}a.getUndoStack().endCompoundChange();a.getTextView().setRedraw(!0);a.setSelection(e.start,e.end,!1)},startUndo:function(){this.undoStack&&this.undoStack.startCompoundChange()},skipClosingBracket:function(a){var c=this.editor;if(c.getTextView().getOptions("readonly"))return!1;var e=c.getSelection(),d=c.getModel();return(c.getCaretOffset()===d.getCharCount()?"":d.getText(e.start,e.start+1))===a?(c.setCaretOffset(e.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=e;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 j(d,a,g,f,e){this.model=d;this.offset=a;this.text=g;this.previousText=f;this.type=e}function k(d){this.owner=d;this.changes=[]}function i(d,a){this.size=a!==void 0?a:100;this.reset();var g=this;this._listener={onChanging:function(a){g._onChanging(a)},onDestroy:function(a){g._onDestroy(a)}};if(d.getModel){var f=d.getModel();f.getBaseModel&&(f=f.getBaseModel());this.model=f;this.setView(d)}else this.shared=!0,this.model=d;this.model.addEventListener("Changing",
this._listener.onChanging)}j.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(d,a){this._doUndoRedo(this.offset,this.previousText,this.text,d,a);return!0},redo:function(d,a){this._doUndoRedo(this.offset,this.text,this.previousText,d,a);return!0},merge:function(d,a,g,f,e){if(f===this.type)if(f===1&&d===
this.offset+this.text.length)return this.text+=a,!0;else if(f===-1&&e===this.offset)return this.offset=d,this.previousText=g+this.previousText,!0;else if(f===-1&&d===this.offset)return this.previousText+=g,!0;return!1},_doUndoRedo:function(d,a,g,f,e){this.model.setText(a,d,d+g.length);e&&f&&(g=f.getModel(),g!==this.model&&(d=g.mapOffset(d,!0)),f.setSelection(d,d+a.length))}};k.prototype={getRedoChanges:function(){for(var d=[],a=0;a<this.changes.length;a++)d=d.concat(this.changes[a].getRedoChanges());
return d},getUndoChanges:function(){for(var d=[],a=this.changes.length-1;a>=0;a--)d=d.concat(this.changes[a].getUndoChanges());return d},add:function(d){this.changes.push(d)},end:function(d){if(d)this.endSelection=d.getSelection(),this.endCaret=d.getCaretOffset();(d=this.owner)&&d.end&&d.end()},undo:function(d,a){this.changes.length>1&&d&&d.setRedraw(!1);for(var g=this.changes.length-1;g>=0;g--)this.changes[g].undo(d,!1);this.changes.length>1&&d&&d.setRedraw(!0);if(a&&d){var g=this.startSelection.start,
f=this.startSelection.end;d.setSelection(this.startCaret?g:f,this.startCaret?f:g)}(g=this.owner)&&g.undo&&g.undo();return this.changes.length>0},redo:function(d,a){this.changes.length>1&&d&&d.setRedraw(!1);for(var g=0;g<this.changes.length;g++)this.changes[g].redo(d,!1);d&&d.setRedraw(!0);if(a&&d){var g=this.endSelection.start,f=this.endSelection.end;d.setSelection(this.endCaret?g:f,this.endCaret?f:g)}(g=this.owner)&&g.redo&&g.redo();return this.changes.length>0},merge:function(d,a,g,f,e){var h=this.changes.length;
return h>0?this.changes[h-1].merge(d,a,g,f,e):!1},start:function(d){if(d)this.startSelection=d.getSelection(),this.startCaret=d.getCaretOffset();(d=this.owner)&&d.start&&d.start()}};i.prototype={destroy:function(){this._onDestroy()},add:function(d){this.compoundChange?this.compoundChange.add(d):(this.stack.splice(this.index,this.stack.length-this.index,d),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 d=[],a=this.index;a<this.stack.length;a++)d=d.concat(this.stack[a].getRedoChanges());
return d},getUndoChanges:function(){this._commitUndo();for(var d=[],a=this.index;a>=0;a--)d=d.concat(this.stack[a].getUndoChanges());return d},undo:function(){this._commitUndo();var d;d=!1;this._ignoreUndo=!0;do{if(this.index<=0)break;d=this.stack[--this.index]}while(!(d=d.undo(this.view,!0)));this._ignoreUndo=!1;return d},redo:function(){this._commitUndo();var d;this._ignoreUndo=!0;do{if(this.index>=this.stack.length)break;d=this.stack[this.index++]}while(!d.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(d){if(this.view!==d)this.view&&d.removeEventListener("Destroy",this._listener.onDestroy),(this.view=d)&&d.addEventListener("Destroy",this._listener.onDestroy)},startCompoundChange:function(d){this._commitUndo();d=new k(d);this.add(d);this.compoundChange=d;this.compoundChange.start(this.view);return this.compoundChange},_commitUndo:function(){this.endCompoundChange()},
_onDestroy:function(d){(!d||!this.shared)&&this.model.removeEventListener("Changing",this._listener.onChanging);if(this.view)this.view.removeEventListener("Destroy",this._listener.onDestroy),this.view=null},_onChanging:function(d){if(!this._ignoreUndo){var a=d.text,g=d.start,f=d.addedCharCount,e=d.removedCharCount,d=g+e,h=0;f===0&&e===1?h=-1:f===1&&e===0&&(h=1);f=this.stack.length;e=this.model.getText(g,d);(!(f>0&&this.index===f)||!this.stack[f-1].merge(g,a,e,h,d))&&this.add(new j(this.model,g,a,
e,h))}}};return{UndoStack:i}});
define("orion/editor/rulers",["i18n!orion/editor/nls/messages","orion/editor/annotations","orion/editor/tooltip","orion/util"],function(j,k,i,d){function a(a,b,e,d){this._location=b||"left";this._overview=e||"page";this._rulerStyle=d;this._view=null;var f=this;this._listener={onTextModelChanged:function(a){f._onTextModelChanged(a)},onAnnotationModelChanged:function(a){f._onAnnotationModelChanged(a)}};this.setAnnotationModel(a)}function g(c,b,e,d,f){a.call(this,c,b,"page",e);this._oddStyle=d||{style:{backgroundColor:"white"}};
this._evenStyle=f||{style:{backgroundColor:"white"}};this._numOfDigits=0;this._firstLine=1}function f(c,b,e){a.call(this,c,b,"page",e)}function e(c,b,e){a.call(this,c,b,"document",e)}function h(a,b,e){f.call(this,a,b,e)}a.prototype={getAnnotations:function(a,b){var e=this._annotationModel;if(!e)return[];var d=this._view.getModel(),f=d.getLineStart(a),h=d.getLineEnd(b-1),g=d;d.getBaseModel&&(g=d.getBaseModel(),f=d.mapOffset(f),h=d.mapOffset(h));for(var i=[],e=this.getAnnotationsByType(e,f,h),f=0;f<
e.length;f++)for(var h=e[f],j=g.getLineAtOffset(h.start),k=g.getLineAtOffset(Math.max(h.start,h.end-1)),t=j;t<=k;t++){var v=t;if(d!==g){v=g.getLineStart(t);v=d.mapOffset(v,!0);if(v===-1)continue;v=d.getLineAtOffset(v)}if(a<=v&&v<b){var n=this._mergeAnnotation(i[v],h,t-j,k-j+1);n&&(i[v]=n)}}if(!this._multiAnnotation&&this._multiAnnotationOverlay)for(var w in i)i[w]._multiple&&(i[w].html+=this._multiAnnotationOverlay.html);return i},getAnnotationModel:function(){return this._annotationModel},getLocation:function(){return this._location},
getOverview:function(){return this._overview},getRulerStyle:function(){return this._rulerStyle},getView:function(){return this._view},getWidestAnnotation:function(){return null},setAnnotationModel:function(a){this._annotationModel&&this._annotationModel.removEventListener("Changed",this._listener.onAnnotationModelChanged);(this._annotationModel=a)&&this._annotationModel.addEventListener("Changed",this._listener.onAnnotationModelChanged)},setMultiAnnotation:function(a){this._multiAnnotation=a},setMultiAnnotationOverlay:function(a){this._multiAnnotationOverlay=
a},setView:function(a){this._onTextModelChanged&&this._view&&this._view.removeEventListener("ModelChanged",this._listener.onTextModelChanged);this._view=a;this._onTextModelChanged&&this._view&&this._view.addEventListener("ModelChanged",this._listener.onTextModelChanged)},onClick:function(a){if(a!==void 0){var b=this._view,e=b.getModel(),d=e,f=e.getLineStart(a),h=f,g=f,j=this._annotationModel;if(j){b=b.getSelection();g=e.getLineEnd(a,!0);if(f<=b.start&&b.start<g)f=b.start;e.getBaseModel&&(f=e.mapOffset(f),
g=e.mapOffset(g),d=e.getBaseModel());for(var k,g=j.getAnnotations(f,g),j=null;!k&&g.hasNext();)b=g.next(),this.isAnnotationTypeVisible(b.type)&&(j=b,b.start<=f||(k=b));if(j&&j.groupId!==void 0)this._currentClickGroup=this._currentClickGroup===j.groupId?null:j.groupId,this._setCurrentGroup(a);k&&d.getLineAtOffset(k.start)===d.getLineAtOffset(f)?(f=k.start,g=k.end):g=f=h;e.getBaseModel&&(f=e.mapOffset(f,!0),g=e.mapOffset(g,!0))}(a=i.Tooltip.getTooltip(this._view))&&a.setTarget(null);this._view.setSelection(g,
f,1/3,function(){})}},onDblClick:function(){},onMouseMove:function(a,b){var e=i.Tooltip.getTooltip(this._view);if(e&&!(e.isVisible()&&this._tooltipLineIndex===a)){this._tooltipLineIndex=a;var d=this;e.setTarget({y:b.clientY,getTooltipInfo:function(){return d._getTooltipInfo(d._tooltipLineIndex,this.y)}})}},onMouseOver:function(a,b){this.onMouseMove(a,b);this._currentClickGroup||this._setCurrentGroup(a)},onMouseOut:function(){this._currentClickGroup||this._setCurrentGroup(-1);var a=i.Tooltip.getTooltip(this._view);
a&&a.setTarget(null)},_getTooltipInfo:function(a,b){if(a!==void 0){var e=this._view,d=e.getModel(),f=this._annotationModel,h=[];if(f){var h=d.getLineStart(a),g=d.getLineEnd(a);d.getBaseModel&&(h=d.mapOffset(h),g=d.mapOffset(g));h=this.getAnnotationsByType(f,h,g)}f=this._getTooltipContents(a,h);if(!f)return null;f={contents:f,anchor:this.getLocation()};h=e.getClientArea();h.y=this.getOverview()==="document"?e.convert({y:b},"view","document").y:e.getLocationAtOffset(d.getLineStart(a)).y;e.convert(h,
"document","page");f.x=h.x;f.y=h.y;f.anchor==="right"&&(f.x+=h.width);return f}},_getTooltipContents:function(a,b){return b},_onAnnotationModelChanged:function(a){function b(a){for(var b=0;b<a.length;b++)if(f.isAnnotationTypeVisible(a[b].type)){var c=a[b].start,h=a[b].end;d.getBaseModel&&(c=d.mapOffset(c,!0),h=d.mapOffset(h,!0));c!==-1&&h!==-1&&e.redrawLines(d.getLineAtOffset(c),d.getLineAtOffset(Math.max(c,h-1))+1,f)}}var e=this._view;if(e){var d=e.getModel(),f=this,h=d.getLineCount();a.textModelChangedEvent?
(a=a.textModelChangedEvent.start,d.getBaseModel&&(a=d.mapOffset(a,!0)),a=d.getLineAtOffset(a),e.redrawLines(a,h,f)):(b(a.added),b(a.removed),b(a.changed))}},_mergeAnnotation:function(a,b,e){a||(a={});if(e===0)if(a.html&&b.html){if(b.html!==a.html&&!a._multiple&&this._multiAnnotation)a.html=this._multiAnnotation.html;a._multiple=!0}else a.html=b.html;a.style=this._mergeStyle(a.style,b.style);return a},_mergeStyle:function(a,b){if(b){a||(a={});a.styleClass&&b.styleClass&&a.styleClass!==b.styleClass?
a.styleClass+=" "+b.styleClass:a.styleClass=b.styleClass;var e;if(b.style){if(!a.style)a.style={};for(e in b.style)a.style[e]===void 0&&(a.style[e]=b.style[e])}if(b.attributes){if(!a.attributes)a.attributes={};for(e in b.attributes)a.attributes[e]===void 0&&(a.attributes[e]=b.attributes[e])}}return a},_setCurrentGroup:function(a){var b=this._annotationModel,e=null,d=b.getTextModel(),f,h=this._currentGroupAnnotation;if(a!==-1){var g=d.getLineStart(a),i=d.getLineEnd(a);d.getBaseModel&&(g=d.mapOffset(g),
i=d.mapOffset(i));for(f=b.getAnnotations(g,i);f.hasNext();)if(d=f.next(),this.isAnnotationTypeVisible(d.type)&&d.start<=g&&d.end>=i&&d.groupId!==void 0){e=d;break}if(h&&e&&h.groupId===e.groupId)return}this._currentGroupAnnotation=null;h&&b.removeAnnotations(h.groupType);if(e&&a!==-1){this._currentGroupAnnotation=e;f=b.getAnnotations();for(a=[];f.hasNext();)d=f.next(),delete d.groupAnnotation,d.groupId===e.groupId&&(d=d.createGroupAnnotation(),a.push(d));b.replaceAnnotations(null,a)}}};k.AnnotationTypeList.addMixin(a.prototype);
g.prototype=new a;g.prototype.getAnnotations=function(c,b){for(var e=a.prototype.getAnnotations.call(this,c,b),d=this._view.getModel(),f=c;f<b;f++){var h=f&1?this._oddStyle:this._evenStyle,g=f;d.getBaseModel&&(g=d.getLineStart(g),g=d.getBaseModel().getLineAtOffset(d.mapOffset(g)));e[f]||(e[f]={});e[f].html=this._firstLine+g+"";if(!e[f].style)e[f].style=h}return e};g.prototype.getWidestAnnotation=function(){var a=this._view.getModel().getLineCount();return this.getAnnotations(a-1,a)[a-1]};g.prototype.setFirstLine=
function(a){this._firstLine=a!==void 0?a:1};g.prototype._onTextModelChanged=function(a){var a=a.start,b=this._view.getModel(),e=(this._firstLine+(b.getBaseModel?b.getBaseModel().getLineCount():b.getLineCount())-1+"").length;if(this._numOfDigits!==e)this._numOfDigits=e,this._view.redrawLines(b.getLineAtOffset(a),b.getLineCount(),this)};f.prototype=new a;e.prototype=new a;e.prototype.getRulerStyle=function(){var a={style:{lineHeight:"1px",fontSize:"1px"}};return a=this._mergeStyle(a,this._rulerStyle)};
e.prototype._getTooltipContents=function(c,b){if(b.length===0){var e=this._view.getModel(),f=c;e.getBaseModel&&(f=e.getLineStart(f),f=e.getBaseModel().getLineAtOffset(e.mapOffset(f)));return d.formatMessage(j.line,f+1)}return a.prototype._getTooltipContents.call(this,c,b)};e.prototype._mergeAnnotation=function(a,b,e,d){if(e===0){if(!a)a={html:"&nbsp;",style:{style:{height:3*d+"px"}}},a.style=this._mergeStyle(a.style,b.overviewStyle);return a}};h.prototype=new f;h.prototype.onClick=function(a){if(a!==
void 0){var b=this._annotationModel;if(b){var e=this._view.getModel(),d=e.getLineStart(a),a=e.getLineEnd(a,!0);e.getBaseModel&&(d=e.mapOffset(d),a=e.mapOffset(a),e=e.getBaseModel());for(var f,b=b.getAnnotations(d,a);!f&&b.hasNext();)a=b.next(),this.isAnnotationTypeVisible(a.type)&&(f=a);f&&e.getLineAtOffset(f.start)===e.getLineAtOffset(d)&&((e=i.Tooltip.getTooltip(this._view))&&e.setTarget(null),f.expanded?f.collapse():f.expand())}}};h.prototype._getTooltipContents=function(a,b){return b.length===
1&&b[0].expanded?null:f.prototype._getTooltipContents.call(this,a,b)};h.prototype._onAnnotationModelChanged=function(a){function b(a){for(g=0;g<a.length;g++)if(h.isAnnotationTypeVisible(a[g].type)){var b=a[g].start;d.getBaseModel&&(b=d.mapOffset(b,!0));b!==-1&&(j=Math.min(j,d.getLineAtOffset(b)))}}if(a.textModelChangedEvent)f.prototype._onAnnotationModelChanged.call(this,a);else{var e=this._view;if(e){var d=e.getModel(),h=this,g,i=d.getLineCount(),j=i;b(a.added);b(a.removed);b(a.changed);a=e.getRulers();
for(g=0;g<a.length;g++)e.redrawLines(j,i,a[g])}}};return{Ruler:a,AnnotationRuler:f,LineNumberRuler:g,OverviewRuler:e,FoldingRuler:h}});
define("orion/editor/textDND",["orion/util"],function(j){function k(i,d){this._view=i;this._undoStack=d;this._dragSelection=null;this._dropOffset=-1;this._dropText=null;var a=this;this._listener={onDragStart:function(d){a._onDragStart(d)},onDragEnd:function(d){a._onDragEnd(d)},onDragEnter:function(d){a._onDragEnter(d)},onDragOver:function(d){a._onDragOver(d)},onDrop:function(d){a._onDrop(d)},onDestroy:function(d){a._onDestroy(d)}};i.addEventListener("DragStart",this._listener.onDragStart);i.addEventListener("DragEnd",
this._listener.onDragEnd);i.addEventListener("DragEnter",this._listener.onDragEnter);i.addEventListener("DragOver",this._listener.onDragOver);i.addEventListener("Drop",this._listener.onDrop);i.addEventListener("Destroy",this._listener.onDestroy)}k.prototype={destroy:function(){var i=this._view;if(i)i.removeEventListener("DragStart",this._listener.onDragStart),i.removeEventListener("DragEnd",this._listener.onDragEnd),i.removeEventListener("DragEnter",this._listener.onDragEnter),i.removeEventListener("DragOver",
this._listener.onDragOver),i.removeEventListener("Drop",this._listener.onDrop),i.removeEventListener("Destroy",this._listener.onDestroy),this._view=null},_onDestroy:function(){this.destroy()},_onDragStart:function(i){var d=this._view,a=d.getSelection(),d=d.getModel();if(d.getBaseModel)a.start=d.mapOffset(a.start),a.end=d.mapOffset(a.end),d=d.getBaseModel();if(d=d.getText(a.start,a.end))this._dragSelection=a,i.event.dataTransfer.effectAllowed="copyMove",i.event.dataTransfer.setData("Text",d)},_onDragEnd:function(i){if(this._dragSelection){var d=
this._view,a=i.event.dataTransfer.dropEffect;if(!j.isFirefox&&(a!=="none"||this._dropText))a=i.event.dataTransfer.dropEffect=this._dropEffect;this._undoStack&&this._undoStack.startCompoundChange();(i=a==="move")&&d.setText("",this._dragSelection.start,this._dragSelection.end);if(this._dropText){var a=this._dropText,g=this._dropOffset;if(i)if(g>=this._dragSelection.end)g-=this._dragSelection.end-this._dragSelection.start;else if(g>=this._dragSelection.start)g=this._dragSelection.start;d.setText(a,
g,g);d.setSelection(g,g+a.length);this._dropText=null;this._dropOffset=-1}this._undoStack&&this._undoStack.endCompoundChange()}this._dragSelection=null},_onDragEnter:function(i){this._onDragOver(i)},_onDragOver:function(i){var d=i.event.dataTransfer.types,a=!this._view.getOptions("readonly");a&&d&&(a=d.contains?d.contains("text/plain")||d.contains("Text"):d.indexOf("text/plain")!==-1||d.indexOf("Text")!==-1);if(a){if(!j.isFirefox)this._dropEffect=i.event.dataTransfer.dropEffect=(j.isMac?i.event.altKey:
i.event.ctrlKey)?"copy":"move"}else i.event.dataTransfer.dropEffect="none"},_onDrop:function(i){var d=this._view,a=i.event.dataTransfer.getData("Text");if(a){if(!j.isFirefox)i.event.dataTransfer.dropEffect=this._dropEffect;i=d.getOffsetAtLocation(i.x,i.y);this._dragSelection?(this._dropOffset=i,this._dropText=a):(d.setText(a,i,i),d.setSelection(i,i+a.length))}}};return{TextDND:k}});
define("orion/editor/templates",[],function(){function j(i,d,a,g){this.prefix=i;this.description=d;this.template=a;this.name=g;this._parse()}function k(i,d){this._keywords=i||[];this._templates=[];this.addTemplates(d||[])}j.prototype={getProposal:function(i,d,a){var i=d-i.length,d={},g,f=a.delimiter!==void 0?a.delimiter:"\n";a.indentation&&(f+=a.indentation);for(var e=a.tab!==void 0?a.tab:"\t",h=0,c=this.variables,b=this.segments,a=[],j=0;j<b.length;j++){var k=b[j],o=c[k];if(o!==void 0)switch(k){case "${tab}":k=
e;break;case "${delimiter}":k=f;break;case "${cursor}":k="";g=h;break;default:var r=d[k];r||(r=d[k]={data:o.data,positions:[]});k=o.substitution;r.data&&r.data.values&&(k=r.data.values[0]);r.positions.push({offset:i+h,length:k.length})}a.push(k);h+=k.length}var f=[],q;for(q in d)d.hasOwnProperty(q)&&f.push(d[q]);a=a.join("");if(g===void 0)g=a.length;return{proposal:a,name:this.name,description:this.description,groups:f,escapePosition:i+g,style:"noemphasis"}},match:function(i){return this.prefix.indexOf(i)===
0},_parse:function(){var i=this.template,d=[],a={},g,f=0,i=i.replace(/\n/g,"${delimiter}"),i=i.replace(/\t/g,"${tab}");i.replace(/\$\{((?:[^\\}]+|\\.))*\}/g,function(e,h,c){var b=e.substring(2,e.length-1),h=e,j=b,k=null,o=j.indexOf(":");o!==-1&&(j=j.substring(0,o),h="${"+j+"}",k=JSON.parse(b.substring(o+1).replace("\\}","}").trim()));(b=a[h])||(b=a[h]={});b.substitution=j;if(k)b.data=k;(g=i.substring(f,c))&&d.push(g);d.push(h);f=c+e.length;return j});(g=i.substring(f,i.length))&&d.push(g);this.segments=
d;this.variables=a}};k.prototype={addTemplates:function(i){for(var d=this.getTemplates(),a=0;a<i.length;a++)d.push(new j(i[a].prefix,i[a].description,i[a].template,i[a].name))},computeProposals:function(i,d,a){var g=this.getPrefix(i,d,a),f=[];this.isValid(g,i,d,a)&&(f=f.concat(this.getTemplateProposals(g,d,a)),f=f.concat(this.getKeywordProposals(g)));return f},getKeywords:function(){return this._keywords},getKeywordProposals:function(i){var d=[],a=this.getKeywords();if(a){for(var g=0;g<a.length;g++)a[g].indexOf(i)===
0&&d.push({proposal:a[g].substring(i.length),description:a[g],style:"noemphasis_keyword"});0<d.length&&d.splice(0,0,{proposal:"",description:"Keywords",style:"noemphasis_title_keywords",unselectable:!0})}return d},getPrefix:function(i,d,a){return a.prefix},getTemplates:function(){return this._templates},getTemplateProposals:function(i,d,a){for(var g=[],f=this.getTemplates(),e=0;e<f.length;e++){var h=f[e];h.match(i)&&(h=h.getProposal(i,d,a),this.removePrefix(i,h),g.push(h))}0<g.length&&(g.sort(function(a,
b){return a.name<b.name?-1:a.name>b.name?1:0}),g.splice(0,0,{proposal:"",description:"Templates",style:"noemphasis_title",unselectable:!0}));return g},removePrefix:function(i,d){if(!(d.overwrite=d.proposal.substring(0,i.length)!==i))d.proposal=d.proposal.substring(i.length)},isValid:function(){return!0}};return{Template:j,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(j,k,i,d,a,g){function f(a,c,b){var e=a.getTextView();i.KeyMode.call(this,e);this.editor=a;this.undoStack=c;this.contentAssist=b;this.linkedModeModel=null;e.setAction("linkedModeEnter",function(){this.exitLinkedMode(!0);return!0}.bind(this));e.setAction("linkedModeCancel",function(){this.exitLinkedMode(!1);
return!0}.bind(this));e.setAction("linkedModeNextGroup",function(){var a=this.linkedModeModel;this.selectLinkedGroup((a.selectedGroupIndex+1)%a.groups.length);return!0}.bind(this));e.setAction("linkedModePreviousGroup",function(){var a=this.linkedModeModel;this.selectLinkedGroup(a.selectedGroupIndex>0?a.selectedGroupIndex-1:a.groups.length-1);return!0}.bind(this));this.linkedModeListener={onActivating:function(){this._groupContentAssistProvider&&(this.contentAssist.setProviders([this._groupContentAssistProvider]),
this.contentAssist.setProgress(null))}.bind(this),onModelChanged:function(a){if(!this.ignoreVerify){for(var b=this.editor.mapOffset(a.start),c=this.linkedModeModel,e,d;c;)if(e=this._getPositionChanged(c,b,b+a.removedCharCount),d=e.position,d===void 0||d.model!==c)this.exitLinkedMode(!1),c=this.linkedModeModel;else break;if(c){c=0;a=a.addedCharCount-a.removedCharCount;e=e.positions;for(var f,h=0;h<e.length;++h){f=e[h];d=f.position;var g=d.offset<=b&&b<=d.offset+d.length;g&&!f.ansestor?(d.offset+=c,
d.length+=a,c+=a):(d.offset+=c,f.ansestor&&g&&(d.length+=a));if(f.escape)f.model.escapePosition=d.offset}this._updateAnnotations(e)}}}.bind(this),onVerify:function(a){if(!this.ignoreVerify){for(var b=this.editor,c=b.mapOffset(a.start),e=this.editor.mapOffset(a.end),d=this.linkedModeModel,f,h;d;)if(f=this._getPositionChanged(d,c,e),h=f.position,h===void 0||h.model!==d)this.exitLinkedMode(!1),d=this.linkedModeModel;else break;if(d){var g=this._compoundChange;g?g.owner.model===d&&g.owner.group===h.group||
(this.endUndo(),this.startUndo()):this.startUndo();d.selectedGroupIndex=h.group;var g=0,i=a.text.length-(e-c);f=f.positions;var j;c-=h.position.offset;for(var k=e-h.position.offset,l=0;l<f.length;++l)if(j=f[l],e=j.position,j.oldOffset=e.offset,j.model===d&&j.group===h.group?(e.offset+=g,e.length+=i,g+=i):(e.offset+=g,j.ansestor&&(e.length+=h.count*i)),j.escape)j.model.escapePosition=e.offset;this.ignoreVerify=!0;for(l=f.length-1;l>=0;l--)j=f[l],j.model===d&&j.group===h.group&&b.setText(a.text,j.oldOffset+
c,j.oldOffset+k);this.ignoreVerify=!1;a.text=null;this._updateAnnotations(f)}}}.bind(this)}}var e={};f.prototype=new i.KeyMode;g.mixin(f.prototype,{createKeyBindings:function(){var a=k.KeyBinding,c=[];c.push({actionID:"linkedModeEnter",keyBinding:new a(13)});c.push({actionID:"linkedModeCancel",keyBinding:new a(27)});c.push({actionID:"linkedModeNextGroup",keyBinding:new a(9)});c.push({actionID:"linkedModePreviousGroup",keyBinding:new a(9,!1,!0)});return c},enterLinkedMode:function(a){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(j.linkedModeEntered,null,!0)}this._sortedPositions=null;if(this.linkedModeModel)a.previousModel=this.linkedModeModel,a.parentGroup=this.linkedModeModel.selectedGroupIndex,this.linkedModeModel.nextModel=a;this.linkedModeModel=
a;this.selectLinkedGroup(0)},exitLinkedMode:function(a){if(this.isActive()){if(this._compoundChange)this.endUndo(),this._compoundChange=null;this._sortedPositions=null;var 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 b=this.editor,e=b.getTextView();e.removeKeyMode(this);e.removeEventListener("Verify",this.linkedModeListener.onVerify);e.removeEventListener("ModelChanged",
this.linkedModeListener.onModelChanged);e=this.contentAssist;e.removeEventListener("Activating",this.linkedModeListener.onActivating);e.offset=void 0;this.editor.reportStatus(j.linkedModeExited,null,!0);a&&b.setCaretOffset(c.escapePosition,!1)}this.selectLinkedGroup(0)}},startUndo:function(){if(this.undoStack){var a=this,c=this.linkedModeModel;this._compoundChange=this.undoStack.startCompoundChange({model:c,group:c.selectedGroupIndex,end:function(){a._compoundChange=null}})}},endUndo:function(){this.undoStack&&
this.undoStack.endCompoundChange()},isActive:function(){return!!this.linkedModeModel},isStatusActive:function(){return!!this.linkedModeModel},selectLinkedGroup:function(e){var c=this.linkedModeModel;if(c){c.selectedGroupIndex=e;var e=c.groups[e],b=e.positions[0],d=this.editor;d.setSelection(b.offset,b.offset+b.length);if(c=this.contentAssist)if(c.offset=void 0,e.data&&e.data.type==="link"&&e.data.values)(this._groupContentAssistProvider=new a.TemplateContentAssist(e.data.values)).getPrefix=function(){var a=
d.getSelection();return a.start===a.end&&(a=d.getCaretOffset(),b.offset<=a&&a<=b.offset+b.length)?d.getText(b.offset,a):""},c.offset=b.offset,c.deactivate(),c.activate();else if(this._groupContentAssistProvider)this._groupContentAssistProvider=null,c.deactivate()}this._updateAnnotations()},_getModelPositions:function(a,c,b){for(var e=c.groups,d=0;d<e.length;d++)for(var f=e[d].positions,g=0;g<f.length;g++){var i=f[g];b&&(i={offset:i.offset+b,length:i.length});i={index:g,group:d,count:f.length,model:c,
position:i};a.push(i);if(c.nextModel&&c.nextModel.parentGroup===d)i.ansestor=!0,this._getModelPositions(a,c.nextModel,(b||0)+f[g].offset-f[0].offset)}},_getSortedPositions:function(a){var c=this._sortedPositions;if(!c){for(c=[];a.previousModel;)a=a.previousModel;for(this._getModelPositions(c,a);a;)a.escapePosition!==void 0&&c.push({escape:!0,model:a,position:{offset:a.escapePosition,length:0}}),a=a.nextModel;c.sort(function(a,c){return a.position.offset-c.position.offset});this._sortedPositions=c}return c},
_getPositionChanged:function(a,c,b){for(var e,a=this._getSortedPositions(a),d=a.length-1;d>=0;d--){var f=a[d].position;if(f.offset<=c&&b<=f.offset+f.length){e=a[d];break}}return{position:e,positions:a}},_updateAnnotations:function(a){var c=this.editor.getAnnotationModel();if(c){var b=[],e=[];c.getTextModel();for(var f=c.getAnnotations(),g;f.hasNext();)switch(g=f.next(),g.type){case d.AnnotationType.ANNOTATION_LINKED_GROUP:case d.AnnotationType.ANNOTATION_CURRENT_LINKED_GROUP:case d.AnnotationType.ANNOTATION_SELECTED_LINKED_GROUP:b.push(g)}if(f=
this.linkedModeModel)for(var a=a||this._getSortedPositions(f),i=0;i<a.length;i++)if(g=a[i],g.model===f){var j=d.AnnotationType.ANNOTATION_LINKED_GROUP;g.group===f.selectedGroupIndex&&(j=g.index===0?d.AnnotationType.ANNOTATION_SELECTED_LINKED_GROUP:d.AnnotationType.ANNOTATION_CURRENT_LINKED_GROUP);g=g.position;g=d.AnnotationType.createAnnotation(j,g.offset,g.offset+g.length,"");e.push(g)}c.replaceAnnotations(b,e)}}});e.LinkedMode=f;return e});
define("orion/editor/factories","orion/editor/actions,orion/editor/undoStack,orion/editor/rulers,orion/editor/annotations,orion/editor/textDND,orion/editor/linkedMode".split(","),function(j,k,i,d,a,g){function f(){}function e(){}function h(){}function c(){}function b(){}function l(){}var m={};f.prototype={createKeyBindings:function(a,b,c,e){var e=new j.TextActions(a,b,e),d=new g.LinkedMode(a,b,c),a=new j.SourceCodeActions(a,b,c,d);return{textActions:e,linkedMode:d,sourceCodeActions:a}}};m.KeyBindingsFactory=
f;e.prototype={createUndoStack:function(a){a=a.getTextView();return new k.UndoStack(a,200)}};m.UndoFactory=e;h.prototype={createLineNumberRuler:function(a){return new i.LineNumberRuler(a,"left",{styleClass:"ruler lines"},{styleClass:"rulerLines odd"},{styleClass:"rulerLines even"})}};m.LineNumberRulerFactory=h;c.prototype={createFoldingRuler:function(a){return new i.FoldingRuler(a,"left",{styleClass:"ruler folding"})}};m.FoldingRulerFactory=c;b.prototype={createAnnotationModel:function(a){return new d.AnnotationModel(a)},
createAnnotationStyler:function(a,b){return new d.AnnotationStyler(a,b)},createAnnotationRulers:function(a){var b=new i.AnnotationRuler(a,"left",{styleClass:"ruler annotations"}),a=new i.OverviewRuler(a,"right",{styleClass:"ruler overview"});return{annotationRuler:b,overviewRuler:a}}};m.AnnotationFactory=b;l.prototype={createTextDND:function(b,c){return new a.TextDND(b.getTextView(),c)}};m.TextDNDFactory=l;return m});
define("orion/editor/editorFeatures",["orion/editor/factories","orion/editor/actions","orion/editor/linkedMode","orion/objects"],function(j,k,i,d){return d.mixin({},j,k,i)});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(j,k,i){var d=d||{};d.TwoWayCompareUIFactory=function(){function a(a){this._parentDivID=a.parentDivID;this._commandSpanId=a.commandSpanId;this._showTitle=a.showTitle;this._leftTitle=a.leftTitle;this._rightTitle=a.rightTitle;this._showLineStatus=a.showLineStatus}a.prototype={_init:function(){var a=this._parentDivID+"_";this._topWidgetDiv=j.node("topWidget_id");
this._topWidgetDiv.id=a+"topWidget_id";this._leftEditorParentDiv=j.node("left_editor_id");this._leftEditorParentDiv.id=a+"left_editor_id";this._rightEditorParentDiv=j.node("right_editor_id");this._rightEditorParentDiv.id=a+"right_editor_id";this._rightEditorWrapperDiv=j.node("right_editor_wrapper_id");this._rightEditorWrapperDiv.id=a+"right_editor_wrapper_id";this._leftActionDiv=j.node("left_action_id");this._leftActionDiv.id=a+"left_action_id";this._rightActionDiv=j.node("right_action_id");this._rightActionDiv.id=
a+"right_action_id";this._leftTitleDiv=j.node("left_title_id");this._leftTitleDiv.id=a+"left_title_id";this._rightTitleDiv=j.node("right_title_id");this._rightTitleDiv.id=a+"right_title_id";this._leftStatusDiv=j.node("left_status_id");this._leftStatusDiv.id=a+"left_status_id";this._rightStatusDiv=j.node("right_status_id");this._rightStatusDiv.id=a+"right_status_id";this._diffCanvasDiv=j.node("diff_canvas_id");this._diffCanvasDiv.id=a+"diff_canvas_id";this._splitterId=a+"orion_splitter";this._showTitle||
this.disableTitle();this._showLineStatus||this.disableLineStatus()},_createSplitter:function(){var a=j.$(".split",this._topWidgetDiv);a.id=this._splitterId;var d=j.$(".leftPanelLayout",this._topWidgetDiv),e=j.$(".rightPanelLayout",this._topWidgetDiv);if(a&&d&&e)this._splitter=new k.Splitter({node:a,sidePanel:d,mainPanel:e})},buildUI:function(){j.node(this._parentDivID).innerHTML=i;this._init();this._createSplitter()},destroy:function(){},getSplitter:function(){return this._splitter},isLeftPane:function(a){return j.$(".leftPanelLayout",
this._topWidgetDiv)===a},getEditorParentDiv:function(a){return a?this._leftEditorParentDiv:this._rightEditorParentDiv},getTitleDiv:function(a){return a?this._leftTitleDiv:this._rightTitleDiv},getActionDivId:function(a){return a?this._leftActionDiv.id:this._rightActionDiv.id},getStatusDiv:function(a){return a?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 a}();return d});
var JsDiff=function(){function j(a){for(var d=[],c=0;c<a.length;c++)a[c]&&d.push(a[c]);return d}function k(a){a=a.replace(/&/g,"&amp;");a=a.replace(/</g,"&lt;");a=a.replace(/>/g,"&gt;");return a=a.replace(/"/g,"&quot;")}var i=function(a){this.ignoreWhitespace=a};i.prototype={diff:function(a,d){if(d==a)return[{value:d}];if(!d)return[{value:a,removed:!0}];if(!a)return[{value:d,added:!0}];var d=this.tokenize(d),a=this.tokenize(a),c=d.length,b=a.length,f=c+b,g=[{newPos:-1,components:[]}],i=this.extractCommon(g[0],
d,a,0);if(g[0].newPos+1>=c&&i+1>=b)return g[0].components;for(var j=1;j<=f;j++)for(var k=-1*j;k<=j;k+=2){var s;s=g[k-1];var u=g[k+1],i=(u?u.newPos:0)-k;s&&(g[k-1]=void 0);var p=s&&s.newPos+1<c,t=u&&0<=i&&i<b;if(!p&&!t)g[k]=void 0;else if(!p||t&&s.newPos<u.newPos?(s={newPos:u.newPos,components:u.components.slice(0)},this.pushComponent(s.components,a[i],void 0,!0)):(s={newPos:s.newPos,components:s.components.slice(0)},s.newPos++,this.pushComponent(s.components,d[s.newPos],!0,void 0)),i=this.extractCommon(s,
d,a,k),s.newPos+1>=c&&i+1>=b)return s.components;else g[k]=s}},pushComponent:function(a,d,c,b){var f=a[a.length-1];f&&f.added===c&&f.removed===b?a[a.length-1]={value:this.join(f.value,d),added:c,removed:b}:a.push({value:d,added:c,removed:b})},extractCommon:function(a,d,c,b){for(var f=d.length,g=c.length,i=a.newPos,b=i-b;i+1<f&&b+1<g&&this.equals(d[i+1],c[b+1]);)i++,b++,this.pushComponent(a.components,d[i],void 0,void 0);a.newPos=i;return b},equals:function(a,d){var c=/\S/;return this.ignoreWhitespace&&
!c.test(a)&&!c.test(d)?!0:a==d},join:function(a,d){return a+d},tokenize:function(a){return a}};var d=new i,a=new i(!1);a.tokenize=function(a){return j(a.split(/(\s+|\b)/))};var g=new i(!0);g.tokenize=function(a){return j(a.split(/([{}:;,]|\s+)/))};var f=new i;f.tokenize=function(a){return a.split(/^/m)};return{diffChars:function(a,f){return d.diff(a,f)},diffWords:function(e,d){return a.diff(e,d)},diffLines:function(a,d){return f.diff(a,d)},diffCss:function(a,d){return g.diff(a,d)},createPatch:function(a,
d,c,b,g){var i=[];i.push("Index: "+a);i.push("===================================================================");i.push("--- "+a+"\t"+b);i.push("+++ "+a+"\t"+g);a=f.diff(d,c);a.push({value:"",lines:[]});for(var c=d=0,b=[],j=g=1,k=0;k<a.length;k++){var q=a[k],s=q.lines||q.value.replace(/\n$/,"").split("\n");q.lines=s;if(q.added||q.removed){if(!d){var u=a[k-1],d=g,c=j;u&&(b.push.apply(b,u.lines.slice(-4).map(function(a){return" "+a})),d-=4,c-=4)}b.push.apply(b,s.map(function(a){return(q.added?"+":
"-")+a}));q.added?j+=s.length:g+=s.length}else d&&(s.length<=8&&k<a.length-1?b.push.apply(b,s.map(function(a){return" "+a})):(u=Math.min(s.length,4),i.push("@@ -"+d+","+(g-d+u)+" +"+c+","+(j-c+u)+" @@"),i.push.apply(i,b),i.push.apply(i,s.slice(0,u).map(function(a){return" "+a})),c=d=0,b=[])),g+=s.length,j+=s.length}a.length>1&&!/\n$/.test(a[a.length-2].value)&&i.push("\\ No newline at end of file\n");return i.join("\n")},convertChangesToXML:function(a){for(var d=[],c=0;c<a.length;c++){var b=a[c];
b.added?d.push("<ins>"):b.removed&&d.push("<del>");d.push(k(b.value));b.added?d.push("</ins>"):b.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(j){var k=k||{};k.JSDiffAdapter=function(){function i(){}i.prototype={_specialLine:function(d,a,g){return a.value===d&&g!==d},adapt:function(d,a,g){g||(g="\n");for(var f=d.split(g),e=a.split(g),h=f[f.length-1]==="",e=e[e.length-1]==="",c=j.diffLines(d,a),d=[],a=[],b=0,i=0,k=-1,o=0,r=!0,q=g,s=0;s<c.length;s++){var u=c[s],p=u.lines||u.value.split(g),t=p.length,v=0;p.length>1&&p[p.length-1]===""&&t--;t>1&&!r&&p[0]===""&&(t--,v++);u.lines=p;
if(!u.added&&!u.removed){if(!this._specialLine(g,u,q)){if(b||i)d.push([b,i,k]),i=b=0,k=-1,o+=i;d.push([t,t,0]);o+=t}}else if(u.added){k===-1&&(k=a.length+1);b+=t;for(r=v;r<t+v;r++)a.push(u.lines[r])}else i+=t;r=!1;p.length>1&&p[p.length-1]===""&&(r=!0);q=u.value?u.value[u.value.length-1]:g}if(b||i)d.push([b,i,k]),o+=i;o<f.length&&f.length>1&&(g=d[d.length-1],g[2]===0?(g[0]+=1,g[1]+=1):g[2]===-1?d.push([1,1,0]):h===e?d.push([1,1,0]):(e&&(g[0]+=1),h&&(g[1]+=1)));return{mapper:d,changContents:{array:a,
index:0}}},adaptCharDiff:function(d,a,g){for(var d=g?j.diffWords(d,a):j.diffChars(d,a),a=[],f=g=0,e=0,h=0,c=0;c<d.length;c++){var b=d[c];if(!b.added&&!b.removed){if(e>0||h>0)a.push([f,f+e,g,g+h]),f+=e,g+=h,h=e=0;f+=b.value.length;g+=b.value.length}else b.added?e+=b.value.length:h+=b.value.length}(e>0||h>0)&&a.push([f,f+e,g,g+h]);return a}};return i}();return k});
define("orion/compare/diffTreeNavigator",["orion/treeModelIterator","orion/compare/compareUtils","orion/editor/annotations","orion/compare/jsdiffAdapter"],function(j,k,i,d){var a={},g,f,e,h,c,b,l,m,o,r,q,s,u,p,t,v;a.DiffTreeNavigator=function(){function a(b,c,e,d,f,g){this._root={type:"root",children:[]};this._initialized=!1;this.initAll(b,c,e,d,f,g)}g="orion.annotation.diff.addedBlock";f="orion.annotation.diff.currentAddedBlock";e="orion.annotation.diff.deletedBlock";h="orion.annotation.diff.currentDeletedBlock";
c="orion.annotation.diff.blockTop";b="orion.annotation.diff.currentBlockTop";l="orion.annotation.diff.blockConflict";m="orion.annotation.diff.currentBlockConflict";o="orion.annotation.diff.addedWord";r="orion.annotation.diff.currentAddedWord";q="orion.annotation.diff.deletedWord";s="orion.annotation.diff.currentDeletedWord";u="orion.annotation.diff.emptyDeletedWordLeft";p="orion.annotation.diff.emptyDeletedWordRight";t="orion.annotation.diff.emptyAddedWordLeft";v="orion.annotation.diff.emptyAddedWordRight";
i.AnnotationType.registerType(g,{title:"",html:"",lineStyle:{styleClass:"annotationLine addedBlockDiff"}});i.AnnotationType.registerType(f,{title:"",html:"",lineStyle:{styleClass:"annotationLine currentAddedBlockDiff"}});i.AnnotationType.registerType(e,{title:"",html:"",lineStyle:{styleClass:"annotationLine deletedBlockDiff"}});i.AnnotationType.registerType(h,{title:"",html:"",lineStyle:{styleClass:"annotationLine currentDeletedBlockDiff"}});i.AnnotationType.registerType(c,{title:"",html:"",lineStyle:{styleClass:"annotationLine blockDiffTopOnly"}});
i.AnnotationType.registerType(b,{title:"",html:"",lineStyle:{styleClass:"annotationLine currentBlockDiffTopOnly"}});i.AnnotationType.registerType(l,{title:"",html:"",lineStyle:{styleClass:"annotationLine blockDiffConflict"}});i.AnnotationType.registerType(m,{title:"",html:"",lineStyle:{styleClass:"annotationLine currentBlockDiffConflict"}});i.AnnotationType.registerType(o,{title:"word added",html:"",rangeStyle:{styleClass:"annotationRange addedWordDiff"}});i.AnnotationType.registerType(r,{title:"",
html:"",rangeStyle:{styleClass:"annotationRange currentAddedWordDiff"}});i.AnnotationType.registerType(q,{title:"word deleted",html:"",rangeStyle:{styleClass:"annotationRange deletedWordDiff"}});i.AnnotationType.registerType(s,{title:"",html:"",rangeStyle:{styleClass:"annotationRange currentDeletedWordDiff"}});i.AnnotationType.registerType(u,{title:"",html:"",rangeStyle:{styleClass:"annotationRange emptyDeletedWordDiffLeft"}});i.AnnotationType.registerType(p,{title:"",html:"",rangeStyle:{styleClass:"annotationRange emptyDeletedWordDiffRight"}});
i.AnnotationType.registerType(t,{title:"",html:"",rangeStyle:{styleClass:"annotationRange emptyAddedWordDiffLeft"}});i.AnnotationType.registerType(v,{title:"",html:"",rangeStyle:{styleClass:"annotationRange emptyAddedWordDiffRight"}});a.prototype={initAll:function(a,b,c,e,d,f,g){this._charOrWordDiff=a?a:"word";if(b)this._initialized=!0;this.editorWrapper=[{editor:b,diffFeeder:e},{editor:c,diffFeeder:d}];this._curveRuler=g;(this._overviewRuler=f)&&this._overviewRuler.setDiffNavigator(this)},initMapper:function(a){if(a)for(var b=
0;b<this.editorWrapper.length;b++)this.editorWrapper[b].diffFeeder.init(this.editorWrapper[b].editor.getTextView().getModel(),a)},destroy:function(){this.initAll(this._charOrWordDiff)},renderAnnotations:function(){var a;for(a=0;a<this.editorWrapper.length;a++){this.editorWrapper[a].annoTypes=[];this.editorWrapper[a].diffFeeder.getBlockAnnoTypes(this.editorWrapper[a].annoTypes);this.editorWrapper[a].diffFeeder.getWordAnnoTypes(this.editorWrapper[a].annoTypes);for(var b=0;b<this.editorWrapper[a].annoTypes.length;b++)this.editorWrapper[a].annoTypes[b].current&&
this.editorWrapper[a].editor.getAnnotationStyler().addAnnotationType(this.editorWrapper[a].annoTypes[b].current),this.editorWrapper[a].annoTypes[b].normal&&this.editorWrapper[a].editor.getAnnotationStyler().addAnnotationType(this.editorWrapper[a].annoTypes[b].normal)}this._root.children=[];b=this.editorWrapper[0].diffFeeder.getDiffBlocks();if(!b||b.length===0)this.replaceAllAnnotations(!0,0,"block",!1,[]),this.replaceAllAnnotations(!0,1,"block",!1,[]),this.replaceAllAnnotations(!0,0,"word",!1,[]),
this.replaceAllAnnotations(!0,1,"word",!1,[]),this.replaceAllAnnotations(!0,0,"block",!0,[]),this.replaceAllAnnotations(!0,1,"block",!0,[]),this.replaceAllAnnotations(!0,0,"word",!0,[]),this.replaceAllAnnotations(!0,1,"word",!0,[]);else{var c=new d.JSDiffAdapter;for(a=0;a<b.length;a++){var e=this.generatePairBlockAnnotations(this._root,a);this._root.children.push(e);var f=this.generatePairWordAnnotations(e,a,c);if(f)e.children=f}this.replaceAllAnnotations(!1,0,"block",!0);this.replaceAllAnnotations(!1,
1,"block",!0);this.replaceAllAnnotations(!1,0,"word",!0);this.replaceAllAnnotations(!1,1,"word",!0);this.iterator=new j.TreeModelIterator(this._root.children)}},replaceAllAnnotations:function(a,b,c,e,d){if(this.editorWrapper[b].annoTypes)for(var f=0;f<this.editorWrapper[b].annoTypes.length;f++)this.editorWrapper[b].annoTypes[f].type===c&&this.replaceDiffAnnotations(this.editorWrapper[b].editor,d?d:this.editorWrapper[b].annoTypes[f].list,e?this.editorWrapper[b].annoTypes[f].normal:this.editorWrapper[b].annoTypes[f].current,
a)},getMapper:function(){return this.editorWrapper[0].diffFeeder.getMapper()},getFeeder:function(a){return a?this.editorWrapper[1].diffFeeder:this.editorWrapper[0].diffFeeder},iterateOnBlock:function(a,b){this.iterator&&(this.iterator.iterateOnTop(a,b),this.updateCurrentAnnotation(!0))},iterateOnChange:function(a){if(!this.iterator)return null;var b=this.iterator.iterate(a);if(b){var c=this.iterator.cursor();c.type==="block"&&c.children&&c.children.length>0&&this.iterator.iterate(a);this.updateCurrentAnnotation(!0)}return b},
gotoBlock:function(a,b){if(this.iterator){if(a<0||a>=this._root.children.length||this._root.children.length===0)a=0;b!==void 0&&b>=0&&this._root.children[a].children&&b<this._root.children[a].children.length?this.iterator.setCursor(this._root.children[a].children[b]):this.iterator.setCursor(this._root.children[a]);this.updateCurrentAnnotation(!1);this._positionDiffBlock()}},_hitDiffAnnotation:function(a,b,c){if(c===this.editorWrapper[a].editor.getTextView()){for(var e=0;e<this._root.children.length;e++){var c=
this._root.children[e],d=a===0?c.oldA:c.newA;if(b>=d.start&&b<=d.end){e=c;if(c.children&&c.children.length>0)for(d=0;d<c.children.length;d++){var f=c.children[d],g=a===0?f.oldA:f.newA;if(b>=g.start&&b<=g.end){e=f;break}}return e}}return null}},gotoChange:function(a,b){for(var c=0;c<this.editorWrapper.length;c++){var e=this._hitDiffAnnotation(c,a,b);if(e)return this.iterator.setCursor(e),this.updateCurrentAnnotation(!1,b),!0}return!1},getCurrentBlockIndex:function(){if(!this.iterator)return-1;var a=
this.iterator.cursor();return!a?-1:a.type==="block"?a.index:a.parent.index},getCurrentPosition:function(){if(!this.iterator)return{};var a=this.iterator.cursor();return a.type==="block"?{block:a.index+1}:{block:a.parent.index+1,change:a.index+1}},getCurrentMapperIndex:function(){var a=this.getCurrentBlockIndex();a<0&&(a=0);var b=this.getFeeder().getDiffBlocks();if(!b||b.length===0)return-1;a>b.length-1&&(a=0);return b[a][1]},replaceDiffAnnotations:function(a,b,c,e){if(b&&c&&(a=a.getAnnotationModel())){for(var d=
a.getAnnotations(),f=[];e&&d.hasNext();){var g=d.next();g.type===c&&f.push(g)}a.replaceAnnotations(f,b)}},updateCurrentAnnotation:function(a,b){this.replaceAllAnnotations(!0,0,"block",!1,[]);this.replaceAllAnnotations(!0,1,"block",!1,[]);this.replaceAllAnnotations(!0,0,"word",!1,[]);this.replaceAllAnnotations(!0,1,"word",!1,[]);if(this.iterator){var c=this.iterator.cursor();if(c){var e,d,f={start:c.oldA.start,end:c.oldA.end},g={start:c.newA.start,end:c.newA.end};c.type==="word"?(e=this.editorWrapper[0].diffFeeder.getCurrentWordAnnoType(f,
this.editorWrapper[0].editor.getTextView().getModel()),d=this.editorWrapper[1].diffFeeder.getCurrentWordAnnoType(g,this.editorWrapper[1].editor.getTextView().getModel())):(e=this.editorWrapper[0].diffFeeder.getCurrentBlockAnnoType(c.index),d=this.editorWrapper[1].diffFeeder.getCurrentBlockAnnoType(c.index));e&&this.replaceDiffAnnotations(this.editorWrapper[0].editor,[new (i.AnnotationType.getType(e.current))(f.start,f.end)],e,!0);d&&this.replaceDiffAnnotations(this.editorWrapper[1].editor,[new (i.AnnotationType.getType(d.current))(g.start,
g.end)],d,!0);if(a)this.autoSelecting=!0,this.editorWrapper[0].editor.setSelection(c.oldA.start,c.oldA.end,!0),this.editorWrapper[1].editor.setSelection(c.newA.start,c.newA.end,!0),this.autoSelecting=!1;else if(b)this.autoSelecting=!0,b!==this.editorWrapper[0].editor.getTextView()&&this.editorWrapper[0].editor.setSelection(c.oldA.start,c.oldA.end,!0),b!==this.editorWrapper[1].editor.getTextView()&&this.editorWrapper[1].editor.setSelection(c.newA.start,c.newA.end,!0),this.autoSelecting=!1}}},generatePairBlockAnnotations:function(a,
b){var c=this.generateBlockDiffAnnotations(0,b),e=this.generateBlockDiffAnnotations(1,b);return{parent:a,index:b,type:"block",oldA:c,newA:e}},generatePairWordAnnotations:function(a,b,c){var e=this.editorWrapper[0].diffFeeder.getTextOnBlock(b),d=this.editorWrapper[1].diffFeeder.getTextOnBlock(b),b=null,f=0,g=0;if(e&&d&&e.text&&d.text&&e.text.length<=5E3&&d.text.length<=5E3)b=c.adaptCharDiff(e.text,d.text,this._charOrWordDiff==="word"),g=d.start,f=e.start;else return null;c=[];e=[];this.generateWordDiffAnnotations(0,
c,f,b,2,3);this.generateWordDiffAnnotations(1,e,g,b,0,1);b=[];for(f=0;f<c.length;f++)b.push({parent:a,index:f,type:"word",oldA:c[f],newA:e[f]});return b},getAnnoModelList:function(a,b,c){for(var e=0;e<this.editorWrapper[a].annoTypes.length;e++)if(this.editorWrapper[a].annoTypes[e].type===b&&this.editorWrapper[a].annoTypes[e].normal===c)return this.editorWrapper[a].annoTypes[e].list;return null},generateBlockDiffAnnotations:function(a,b){var c=this.editorWrapper[a].diffFeeder.getCurrentBlockAnnoType(b),
e=this.getAnnoModelList(a,"block",c.normal),d=this.editorWrapper[a].diffFeeder.getCharRange(b),c=i.AnnotationType.createAnnotation(c.normal,d.start,d.end);e&&e.push(c);return c},generateWordDiffAnnotations:function(a,b,c,e,d,f){if(e)for(var g=this.editorWrapper[a].diffFeeder.getCurrentWordAnnoType({start:-1,end:-1}),a=this.getAnnoModelList(a,"word",g.normal),h=0;h<e.length;h++){var j=i.AnnotationType.createAnnotation(g.normal,e[h][d]+c,e[h][f]+c);a.push(j);b.push(j)}},_updateOverviewRuler:function(){if(this._overviewRuler){var a=
this.editorWrapper[0].editor.getTextView().getTopIndex();this.editorWrapper[0].editor.getTextView().redrawLines(a,a+1,this._overviewRuler)}},_updateCurveRuler:function(){this._curveRuler&&this._curveRuler.render()},_setTextViewPosition:function(a,b){var c=a.getLineHeight(),e=a.getClientArea(),c=Math.floor(e.height/c/3);a.setTopIndex(b-c>0?b-c:0)},_positionDiffBlock:function(){var a=this.getCurrentBlockIndex();a<0&&(a=0);var b=this.getFeeder().getDiffBlocks();b.length!==0&&(this._setTextViewPosition(this.editorWrapper[0].editor.getTextView(),
b[a][0]),this.editorWrapper[0].editor!==this.editorWrapper[1].editor&&(a=k.lookUpLineIndex(this.getMapper(),0,b[a][1]),this._setTextViewPosition(this.editorWrapper[1].editor.getTextView(),a)),this._updateOverviewRuler(),this._updateCurveRuler())},matchPositionFromOverview:function(a){this._initialized&&this.gotoBlock(a<0?0:k.getAnnotationIndex(this.getFeeder().getDiffBlocks(),a))},gotoDiff:function(a,b){this.gotoChange(a,b)&&(this._updateOverviewRuler(),this._updateCurveRuler())},nextDiff:function(){this.iterateOnBlock(!0,
!0);this._positionDiffBlock()},prevDiff:function(){this.iterateOnBlock(!1,!0);this._positionDiffBlock()},nextChange:function(){var a=this.iterateOnChange(!0);this._positionDiffBlock();return a},prevChange:function(){this.iterateOnChange(!1);this._positionDiffBlock()}};return a}();a.DiffBlockFeeder=function(){function a(){}a.prototype={_isAddedSide:function(){return this._mapperColumnIndex===0},getWordAnnoTypes:function(a){this._isAddedSide()?a.push({type:"word",current:r,normal:o,list:[]}):a.push({type:"word",
current:s,normal:q,list:[]});a.push({type:"word",current:u});a.push({type:"word",current:p});a.push({type:"word",current:t});a.push({type:"word",current:v})},getCurrentWordAnnoType:function(a,b){return a.start===a.end&&b?this._isAddedSide()?{current:this._repositionEmptyWord(a,b),normal:o}:{current:this._repositionEmptyWord(a,b),normal:q}:this._isAddedSide()?{current:r,normal:o}:{current:s,normal:q}},_repositionEmptyWord:function(a,b){var c=b.getLineAtOffset(a.start),e=b.getLineStart(c),d=b.getLineEnd(c);
if(e!==d){if(a.start===d)return a.start--,this._isAddedSide()?v:p;a.end++}else if(c>0&&(c--,e=b.getLineStart(c),d=b.getLineEnd(c),e!==d))return a.start=d-1,a.end=d,this._isAddedSide()?v:p;return this._isAddedSide()?t:u},getMapper:function(){return this._mapper},getDiffBlocks:function(){return this._diffBlocks},getDiffBlockH:function(a){if(!this._diffBlocks||this._diffBlocks.length===0)return-1;a=this._diffBlocks[a][1];return a===-1?0:this._mapper[a][this._mapperColumnIndex]},getOverviewLineCount:function(){return this._textModel.getLineCount()},
getLineNumber:function(a){return a},getCharRange:function(a){if(!this._diffBlocks||this._diffBlocks.length===0)return null;var b=this._diffBlocks[a][0],c=b+this._mapper[this._diffBlocks[a][1]][this._mapperColumnIndex]-1,a=this._textModel.getLineStart(b);if(c<b)return{start:a,end:a};b=this._textModel.getLineEnd(c,!0);return{start:a,end:b}},getTextOnBlock:function(a){if(!this._diffBlocks||this._diffBlocks.length===0)return null;a=this.getCharRange(a);return{start:a.start,text:this._textModel.getText(a.start,
a.end)}},isMapperEmpty:function(){return this._mapper.length===0}};return a}();a.TwoWayDiffBlockFeeder=function(){function d(a,b,c,e){this._mapperColumnIndex=c;this._reverseAnnotation=e;this.init(a,b)}d.prototype=new a.DiffBlockFeeder;d.prototype._isAddedSide=function(){return this._reverseAnnotation?this._mapperColumnIndex!==0:this._mapperColumnIndex===0};d.prototype.init=function(a,b){this._textModel=a;this._diffBlocks=void 0;if(b){this._mapper=b;this._diffBlocks=[];for(var c=0,e=0;e<this._mapper.length;e++)this._mapper[e][2]!==
0&&this._diffBlocks.push([c,e]),c+=this._mapper[e][this._mapperColumnIndex]}};d.prototype.getBlockAnnoTypes=function(a){this._isAddedSide()?a.push({type:"block",normal:g,current:f,list:[]}):a.push({type:"block",normal:e,current:h,list:[]});a.push({type:"block",normal:c,current:b,list:[]});a.push({type:"block",normal:l,current:m,list:[]})};d.prototype.getCurrentBlockAnnoType=function(a){if(!this._diffBlocks||this._diffBlocks.length===0||this._diffBlocks.length<=a)return null;a=this._diffBlocks[a][1];
if(this._mapper[a][this._mapperColumnIndex]===0)return{normal:c,current:b};else if(k.isMapperConflict(this.getMapper(),a))return{normal:l,current:m};else if(this._isAddedSide())return{type:"block",normal:g,current:f,list:[]};return{type:"block",normal:e,current:h,list:[]}};return d}();a.inlineDiffBlockFeeder=function(){function b(a,c){this._mapperColumnIndex=c;this.init(a)}b.prototype=new a.DiffBlockFeeder;b.prototype.setModel=function(a){this._textModel=a};b.prototype.init=function(a){this._diffBlocks=
void 0;if(a){this._mapper=a;this._diffBlocks=[];this._gapBlocks=[];for(var b=a=0,c=0;c<this._mapper.length;c++){if(this._mapper[c][2]!==0){if(this._isAddedSide()){var e=a+this._mapper[c][1];this._diffBlocks.push([e,c]);this._gapBlocks.push([e,e+this._mapper[c][0],b])}else this._diffBlocks.push([a,c]),this._gapBlocks.push([a,a+this._mapper[c][1],b]);a+=this._mapper[c][0]+this._mapper[c][1]}else this._gapBlocks.push([a,a+this._mapper[c][this._mapperColumnIndex],b]),a+=this._mapper[c][this._mapperColumnIndex];
b+=this._mapper[c][this._mapperColumnIndex]}}};b.prototype.getBlockAnnoTypes=function(a){this._isAddedSide()?a.push({type:"block",normal:g,current:f,list:[]}):a.push({type:"block",normal:e,current:h,list:[]});a.push({type:"block",normal:l,current:m,list:[]})};b.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:r,normal:o};else if(k.isMapperConflict(this.getMapper(),
a))return{normal:l,current:m};else if(this._isAddedSide())return{type:"block",normal:g,current:f,list:[]};return{type:"block",normal:e,current:h,list:[]}};b.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]};b.prototype.getLineNumber=function(a){for(var b=0;b<this._gapBlocks.length;b++)if(this._gapBlocks[b][0]!==this._gapBlocks[b][1]&&a>=this._gapBlocks[b][0]&&a<this._gapBlocks[b][1])return a-
this._gapBlocks[b][0]+this._gapBlocks[b][2];return-1};return b}();return a});
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(j,k,i,d,a,g,f,e,h,c,b,l,m){var o={};o.CompareView=function(){function a(){this._diffParser=new d.DiffParser}a.prototype=
{_clearOptions:function(){this.options={};this.options.blockNumber=1;this.options.changeNumber=0},_getLineDelim:function(){return"\n"},_generateMapper:function(a,b,c,e,d){var f=this._getLineDelim(a,c);this._diffParser.setLineDelim(f);if(this.options.mapper&&this.options.toggler)return{delim:f,mapper:this.options.mapper,output:this.options.newFile.Content,diffArray:this.options.diffArray};if(typeof b==="string"&&typeof a==="string"){a=(new l.JSDiffAdapter).adapt(a,b,f);if(this.options.toggler)this.options.mapper=
a.mapper,this.options.newFile.Content=b,this.options.diffArray=a.changContents;return{delim:f,mapper:a.mapper,output:b,diffArray:a.changContents}}else{b=this._diffParser.parse(a,c,e,d);a=this._diffParser.getDiffArray();if(this.options.toggler)this.options.mapper=b.mapper,this.options.newFile.Content=b.outPutFile,this.options.diffArray=a;return{delim:f,mapper:b.mapper,output:b.outPutFile,diffArray:a}}},_loadImageFile:function(a,b,c){var e=document.createElement("img");e.src=a;var d=new k;e.onload=
function(){b.appendChild(e);if(c){var a=document.createElement("hr");b.appendChild(a)}d.resolve(e.height)};e.onerror=function(){d.resolve(0)};return d},_initSyntaxHighlighter:function(a){this._syntaxHighlighters=null;if(this.options.highlighters&&this.options.highlighters.length>0&&!(a.length<1||a.length>2))this._syntaxHighlighters=[{highlighter:this.options.highlighters[0],target:a[0]}],a.length===2&&this.options.highlighters.length===2&&this._syntaxHighlighters.push({highlighter:this.options.highlighters[1],
target:a[1]})},_highlightSyntax:function(){if(this._syntaxHighlighters){var a=[];this._syntaxHighlighters.forEach(function(b){a.push(b.highlighter.highlight(b.target.fileName,b.target.contentType,b.target.editor))}.bind(this));k.all(a,function(a){return{_error:a}}).then(function(){this._diffNavigator.renderAnnotations();this._diffNavigator.gotoBlock(this.options.blockNumber-1,this.options.changeNumber-1)}.bind(this))}else window.setTimeout(function(){this._diffNavigator.renderAnnotations();this._diffNavigator.gotoBlock(this.options.blockNumber-
1,this.options.changeNumber-1)}.bind(this),50)},setOptions:function(a,b){b&&this._clearOptions();if(!this.options)this.options={};a&&Object.keys(a).forEach(function(b){this.options[b]=a[b]}.bind(this));if(a.newFileOnRight){var c=this.options.newFile;this.options.newFile=this.options.oldFile;this.options.oldFile=c}},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 b(e){this.setOptions(e,!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 a.CompareCurveRuler(this._uiFactory.getDiffCanvasDiv())}b.prototype=new o.CompareView;b.prototype.initEditors=function(b){this._editors=
[];this._editors.push(this._createEditor(b,this._uiFactory.getEditorParentDiv(!1),this._uiFactory.getStatusDiv(!1),this.options.oldFile));this._editors.push(this._createEditor(b,this._uiFactory.getEditorParentDiv(!0),this._uiFactory.getStatusDiv(!0),this.options.newFile,!0));this._overviewRuler=new a.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 j["There are unsaved changes."]}.bind(this)};
b.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};b.prototype.getImageMode=function(){return this._imageMode};b.prototype.getEditors=function(){return this._editors};b.prototype.gotoDiff=
function(a,b,c){c=c?this._editors[1].getTextView():this._editors[0].getTextView();this._diffNavigator.gotoDiff(c.getModel().getLineStart(a)+b,c)};b.prototype.copyToLeft=function(){this._curveRuler.copyTo(!0)};b.prototype.copyToRight=function(){this._curveRuler.copyTo(!1)};b.prototype.resizeEditors=function(){this._editors.forEach(function(a){a.getTextView().resize()})};b.prototype.getSplitter=function(){return this._uiFactory.getSplitter()};b.prototype._createEditor=function(a,b,c,e,d){var i=typeof e.readonly===
"undefined"?!0:e.readonly,k=function(){var a=new h.TextView({parent:b,readonly:i,tabSize:4});this._viewLoadedCounter++;this._viewLoadedCounter===2&&this._diffNavigator.matchPositionFromOverview(-1);if(this.onLoad)this.onLoad();var c=this.getSplitter();c&&c.addResizeListener(function(b){if(b){var c=!1;(c=this._uiFactory.isLeftPane(b)?d:!d)&&a.resize()}}.bind(this));return a}.bind(this),l=e.keyBindingFactory;l||(l=new f.KeyBindingsFactory);var m=null;if(c)var y="",m=function(a,b){if(c)y=b?j["ERROR: "]+
a:a,c.textContent=""+y};k=new g.Editor({textViewFactory:k,undoStackFactory:new f.UndoFactory,annotationFactory:new f.AnnotationFactory,keyBindingFactory:l,statusReporter:m,domNode:b});k.installTextView();k.setInput(null,null,e.Content?e.Content:a);k.setOverviewRulerVisible(!1);var A=k.getTextView();A.addEventListener("Selection",function(a){a.newValue&&a.newValue.start!==a.newValue.end||!this._diffNavigator.autoSelecting&&this._diffNavigator.editorWrapper[0].diffFeeder&&this._diffNavigator.gotoDiff(A.getCaretOffset(),
A)}.bind(this));A.getModel().addEventListener("Changed",function(a){if(!this._curveRuler.onChanged(a,!d))this.options.mapper=null}.bind(this));d?A.addEventListener("Scroll",function(){this._curveRuler&&(this._curveRuler.matchPositionFrom(!0),this._curveRuler.render());if(this.onScroll)this.onScroll()}.bind(this)):A.addEventListener("Scroll",function(){this._curveRuler&&this._curveRuler.render()}.bind(this));return k};b.prototype.destroy=function(){this._editors&&(this._diffNavigator.destroy(),this._editors.forEach(function(a){a.destroy()}),
this._uiFactory.destroy())};b.prototype.addRulers=function(){if(this._editors&&!this._hasRuler){var b=new a.LineNumberCompareRuler(this._diffNavigator,0,"left",{styleClass:"ruler lines"},{styleClass:"rulerLines odd"},{styleClass:"rulerLines even"}),c=new a.LineNumberCompareRuler(this._diffNavigator,0,"left",{styleClass:"ruler lines"},{styleClass:"rulerLines odd"},{styleClass:"rulerLines even"});this._editors[1].getTextView().addRuler(b);this._editors[0].getTextView().addRuler(c);this._editors[0].getTextView().addRuler(this._overviewRuler);
this._hasRuler=!0}};b.prototype.refresh=function(a){if(this._imageMode){this.options.commandProvider&&this.options.commandProvider.renderCommands(this);var b=this;return this._loadImageFile(this.options.newFile.URL,this._uiFactory.getEditorParentDiv(!0)).then(function(a){return b._loadImageFile(b.options.oldFile.URL,b._uiFactory.getEditorParentDiv()).then(function(b){return(new k).resolve(a>b?a:b)})})}var c=this.options.oldFile.Content,e=this.options.newFile.Content,d=this.options.diffContent;typeof e===
"string"?d=this._generateMapper(c,e,d,this.options.hasConflicts):(d=this._generateMapper(c,e,d,this.options.hasConflicts),e=d.output);var f=new m.TwoWayDiffBlockFeeder(this._editors[0].getTextView().getModel(),d.mapper,1,this.options.newFileOnRight),g=new m.TwoWayDiffBlockFeeder(this._editors[1].getTextView().getModel(),d.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(d.mapper,this._editors[1],this._editors[0],this._diffNavigator);a&&(this._editors[1].setInput(this.options.newFile.Name,null,e),this._editors[0].setInput(this.options.oldFile.Name,null,c));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;c=this._editors[0].getTextView().getModel().getLineCount()*this._editors[0].getTextView().getLineHeight()+5;return a>c?a:c};b.prototype.refreshTitle=function(a,b){if(a===1){var c=this._uiFactory.getTitleDiv(!0);c&&(i.empty(c),
c.appendChild(document.createTextNode(b||this._editors[a].isDirty()?this.options.newFile.Name+"*":this.options.newFile.Name)))}else if(c=this._uiFactory.getTitleDiv(!1))i.empty(c),c.appendChild(document.createTextNode(b||this._editors[a].isDirty()?this.options.oldFile.Name+"*":this.options.oldFile.Name))};return b}();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(b){var c=i.node(this._editorDiv),e=function(){return new h.TextView({parent:c,readonly:!0,tabSize:4})}.bind(this);this._editor=new g.Editor({textViewFactory:e,undoStackFactory:new f.UndoFactory,annotationFactory:new f.AnnotationFactory,
domNode:c});this._editor.installTextView();this._editor.setInput(null,null,b);this._editor.setOverviewRulerVisible(!1);this._editor.setAnnotationRulerVisible(!1);this._textView=this._editor.getTextView();this._rulerOrigin=new a.LineNumberCompareRuler(this._diffNavigator,1,"left",{styleClass:"ruler lines inlineRulerLeft"},{styleClass:"rulerLines odd"},{styleClass:"rulerLines even"});this._rulerNew=new a.LineNumberCompareRuler(this._diffNavigator,0,"left",{styleClass:"ruler lines"},{styleClass:"rulerLines odd"},
{styleClass:"rulerLines even"});this._overviewRuler=new a.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;i.node(this._editorDiv).classList.add("compareEditorParentImageMode");this._imageMode=!0};c.prototype.getImageMode=function(){return this._imageMode};c.prototype._initDiffPosition=function(a){var b=a.getModel();if(b&&b.getAnnotations&&(b=b.getAnnotations(),b.length>0)){var b=b[0][0],c=a.getLineHeight(),e=a.getClientArea(),c=Math.floor(e.height/c/3);a.setTopIndex(b-c>0?b-c:0)}};c.prototype.refresh=function(){if(this._imageMode){this.options.commandProvider&&
this.options.commandProvider.renderCommands(this);var a=this;return this._loadImageFile(this.options.newFile.URL,i.node(this._editorDiv),!0).then(function(b){return a._loadImageFile(a.options.oldFile.URL,i.node(a._editorDiv)).then(function(a){return(new k).resolve(b+a+20)})})}var c=this.options.oldFile.Content,e=this.options.newFile.Content,d=this._generateMapper(c,e,this.options.diffContent,this.options.hasConflicts,!this.options.toggler);if(typeof e!=="string")e=d.output;this._textView.getModel().setText(c);
c=new m.inlineDiffBlockFeeder(d.mapper,1);e=new m.inlineDiffBlockFeeder(d.mapper,0);b.mergeDiffBlocks(this._textView.getModel(),e.getDiffBlocks(),d.mapper,d.diffArray.array,d.diffArray.index,this._diffParser._lineDelimiter);c.setModel(this._textView.getModel());e.setModel(this._textView.getModel());this._diffNavigator.initAll(this.options.charDiff?"char":"word",this._editor,this._editor,c,e,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();d=this._textView.getTopIndex();this._textView.redrawLines(d,d+1,this._overviewRuler);this._textView.redrawLines(d,d+1,this._rulerOrigin);this._textView.redrawLines(d,d+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(b,c){if(c)c.toggler=this;this._widget=b==="inline"?new o.InlineCompareView(c):new o.TwoWayCompareView(c)}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 b=this._widget.getCurrentDiffPos();a.blockNumber=b.block;a.changeNumber=b.change}this._widget.destroy();i.empty(i.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(j){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(","),j=j.grammars;j.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:j[j.length-1].id,grammars:j,keywords:k}});
define("orion/editor/stylers/text_x-java-source/syntax",["orion/editor/stylers/lib/syntax"],function(j){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(","),j=j.grammars;j.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:j[j.length-1].id,grammars:j,keywords:k}});
define("orion/editor/stylers/text_css/syntax",["orion/editor/stylers/lib/syntax"],function(j){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(","),j=
j.grammars;j.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:j[j.length-1].id,grammars:j,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(j,k,i,d){function a(a,b){this.keywords=a;this.whitespacesVisible=b;this.setText("")}function g(){a.call(this,null,!0)}function f(b){a.call(this,null,b)}function e(){a.call(this,null,!1)}function h(d,h,i){this.commentStart="/*";this.commentEnd="*/";var j=[];switch(h){case "java":j=b;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 a(j,this.whitespacesVisible);this._firstScanner=new e;this._commentScanner=new f(this.whitespacesVisible);this._whitespaceScanner=new g;if(h==="css")this._scanner.isCSS=!0,this._firstScanner.isCSS=!0;this.view=d;this.annotationModel=i;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)}};h=d.getModel();h.getBaseModel&&(h=h.getBaseModel());h.addEventListener("Changed",this._listener.onChanged);d.addEventListener("MouseDown",this._listener.onMouseDown);d.addEventListener("Selection",this._listener.onSelection);d.addEventListener("Destroy",this._listener.onDestroy);d.addEventListener("LineStyle",
this._listener.onLineStyle);this._computeComments();this._computeFolding();d.redrawLines()}var c=k.keywords,b=i.keywords,l=d.keywords,m={styleClass:"comment"},o={styleClass:"comment"},r={styleClass:"comment block documentation"},q={styleClass:"keyword other documentation markup"},s={styleClass:"keyword other documentation task"},u={styleClass:"keyword other documentation tag"},p={styleClass:"string"},t={styleClass:"constant numeric"},v={styleClass:"keyword"},n={styleClass:"punctuation separator space",
unmergeable:!0},w={styleClass:"punctuation separator tab",unmergeable:!0},x={styleClass:"meta annotation currentLine"};a.prototype={getOffset:function(){return this.offset},getStartOffset:function(){return this.startOffset},getData:function(){return this.text.substring(this.startOffset,this.offset)},getDataLength:function(){return this.offset-this.startOffset},_default:function(a){switch(a){case 32:case 9:if(this.whitespacesVisible)return a===32?11:10;do a=this._read();while(a===32||a===9);this._unread(a);
return 9;case 123:case 125:case 40:case 41:case 91:case 93:case 60:case 62:return a;default:var b=this.isCSS,c=this.offset-1;if(!b&&48<=a&&a<=57){var e=b=!1,d=!1,f=a;do if(a=this._read(),a===46&&!b)b=!0;else if(a===101&&!e)b=e=!0,a=this._read(),a!==45&&this._unread(a);else if(a===120&&f===48&&this.offset-c===2)b=e=d=!0;else if(!(48<=a&&a<=57||d&&(65<=a&&a<=70||97<=a&&a<=102)))break;while(1);this._unread(a);return 3}if(97<=a&&a<=122||65<=a&&a<=90||a===95||45===a&&b){do a=this._read();while(97<=a&&
a<=122||65<=a&&a<=90||a===95||48<=a&&a<=57||45===a&&b);this._unread(a);a=this.keywords;if(a.length>0){c=this.text.substring(c,this.offset);for(b=0;b<a.length;b++)if(this.keywords[b]===c)return 2}}return 1}},_read:function(){return this.offset<this.text.length?this.text.charCodeAt(this.offset++):-1},_unread:function(a){a!==-1&&this.offset--},nextToken:function(){for(this.startOffset=this.offset;;){var a=this._read(),b;switch(a){case -1:return null;case 47:a=this._read();if(!this.isCSS&&a===47)for(;;)if(a=
this._read(),a===-1||a===10||a===13)return this._unread(a),6;if(a===42){a=this._read();b=7;for(a===42&&(b=8);;){for(;a===42;)if(a=this._read(),a===47)return b;if(a===-1)return this._unread(a),b;a=this._read()}}this._unread(a);return 1;case 39:for(b=4;;)switch(a=this._read(),a){case 39:return b;case 13:case 10:case -1:return this._unread(a),b;case 92:switch(a=this._read(),a){case 10:b=5;break;case 13:b=5,a=this._read(),a!==10&&this._unread(a)}}break;case 34:for(b=4;;)switch(a=this._read(),a){case 34:return b;
case 13:case 10:case -1:return this._unread(a),b;case 92:switch(a=this._read(),a){case 10:b=5;break;case 13:b=5,a=this._read(),a!==10&&this._unread(a)}}break;default:return this._default(a)}}},setText:function(a){this.text=a;this.startOffset=this.offset=0}};g.prototype=new a(null);g.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}}};f.prototype=new a(null);f.prototype.setType=function(a){this._type=a};f.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}}};e.prototype=new a(null);e.prototype._default=function(a){for(;;)switch(a=this._read(),a){case 47:case 34:case 39:case -1:return this._unread(a),
1}};h.prototype={destroy:function(){var a=this.view;if(a){var b=a.getModel();b.getBaseModel&&(b=b.getBaseModel());b.removeEventListener("Changed",this._listener.onChanged);a.removeEventListener("MouseDown",this._listener.onMouseDown);a.removeEventListener("Selection",this._listener.onSelection);a.removeEventListener("Destroy",this._listener.onDestroy);a.removeEventListener("LineStyle",this._listener.onLineStyle);this.view=null}},setHighlightCaretLine:function(a){this.highlightCaretLine=a},setWhitespacesVisible:function(a,
b){if(this.whitespacesVisible!==a)this.whitespacesVisible=a,this._scanner.whitespacesVisible=a,this._commentScanner.whitespacesVisible=a,b&&this.view.redraw()},setTabsVisible:function(a){if(this.tabsVisible!==a)this.tabsVisible=a,this.setWhitespacesVisible(this.tabsVisible||this.spacesVisible,!1),this.view.redraw()},setSpacesVisible:function(a){if(this.spacesVisible!==a)this.spacesVisible=a,this.setWhitespacesVisible(this.tabsVisible||this.spacesVisible,!1),this.view.redraw()},setDetectHyperlinks:function(a){this.detectHyperlinks=
a},setFoldingEnabled:function(a){this.foldingEnabled=a},setDetectTasks:function(a){this.detectTasks=a},_binarySearch:function(a,b,c,e,d){var f;e===void 0&&(e=-1);if(d===void 0)d=a.length;for(;d-e>1;)if(f=Math.floor((d+e)/2),b<=a[f].start)d=f;else if(c&&b<a[f].end){d=f;break}else e=f;return d},_computeComments:function(){var a=this.view.getModel();a.getBaseModel&&(a=a.getBaseModel());this.comments=this._findComments(a.getText())},_computeFolding:function(){if(this.foldingEnabled){var a=this.view.getModel();
if(a.getBaseModel){var b=this.annotationModel;if(b){b.removeAnnotations(j.AnnotationType.ANNOTATION_FOLDING);for(var c=[],e=a.getBaseModel(),d=this.comments,f=0;f<d.length;f++){var g=d[f];(g=this._createFoldingAnnotation(a,e,g.start,g.end))&&c.push(g)}b.replaceAnnotations(null,c)}}}},_createFoldingAnnotation:function(a,b,c,e){var d=b.getLineAtOffset(c),b=b.getLineAtOffset(e);return d===b?null:new (j.AnnotationType.getType(j.AnnotationType.ANNOTATION_FOLDING))(c,e,a)},_computeTasks:function(a,b,c){if(this.detectTasks){var e=
this.annotationModel;if(e){var d=this.view.getModel(),f=d;d.getBaseModel&&(f=d.getBaseModel());for(var g=e.getAnnotations(b,c),d=[],h=j.AnnotationType.ANNOTATION_TASK;g.hasNext();){var i=g.next();i.type===h&&d.push(i)}g=[];i=this._commentScanner;i.setText(f.getText(b,c));for(var k;k=i.nextToken();){var l=i.getStartOffset()+b;k===14&&(k=f.getLineEnd(f.getLineAtOffset(l)),a!==6&&(k=Math.min(k,c-this.commentEnd.length)),g.push(j.AnnotationType.createAnnotation(h,l,k,f.getText(l,k))))}e.replaceAnnotations(d,
g)}}},_getLineStyle:function(a){if(this.highlightCaretLine){var b=this.view,c=b.getModel(),b=b.getSelection();if(b.start===b.end&&c.getLineAtOffset(b.start)===a)return x}return null},_getStyles:function(a,b,c){a.getBaseModel&&(c=a.mapOffset(c));for(var e=c+b.length,d=[],f=c,g=this.comments,h=this._binarySearch(g,c,!0);h<g.length;h++){if(g[h].start>=e)break;var i=g[h].start,j=g[h].end;f<i&&this._parse(b.substring(f-c,i-c),f,d);var k=g[h].type,l;switch(k){case 8:l=r;break;case 7:l=o;break;case 5:l=
p}f=Math.max(f,i);i=Math.min(e,j);(k===8||k===7)&&(this.whitespacesVisible||this.detectHyperlinks)?this._parseComment(b.substring(f-c,i-c),f,d,l,k):k===5&&this.whitespacesVisible?this._parseString(b.substring(f-c,i-c),f,d,p):d.push({start:f,end:i,style:l});f=j}f<e&&this._parse(b.substring(f-c,e-c),f,d);if(a.getBaseModel)for(b=0;b<d.length;b++)c=d[b].end-d[b].start,d[b].start=a.mapOffset(d[b].start,!0),d[b].end=d[b].start+c;return d},_parse:function(a,b,c){var e=this._scanner;for(e.setText(a);a=e.nextToken();){var d=
e.getStartOffset()+b,f=null;switch(a){case 2:f=v;break;case 3:f=t;break;case 5:case 4:if(this.whitespacesVisible){this._parseString(e.getData(),d,c,p);continue}else f=p;break;case 8:this._parseComment(e.getData(),d,c,r,a);continue;case 6:this._parseComment(e.getData(),d,c,m,a);continue;case 7:this._parseComment(e.getData(),d,c,o,a);continue;case 10:this.whitespacesVisible&&this.tabsVisible&&(f=w);break;case 11:this.whitespacesVisible&&this.spacesVisible&&(f=n)}c.push({start:d,end:e.getOffset()+b,
style:f})}},_parseComment:function(a,b,c,e,d){var f=this._commentScanner;f.setText(a);for(f.setType(d);a=f.nextToken();){var d=f.getStartOffset()+b,g=e;switch(a){case 10:this.whitespacesVisible&&this.tabsVisible&&(g=w);break;case 11:this.whitespacesVisible&&this.spacesVisible&&(g=n);break;case 12:g=q;break;case 13:g=u;break;case 14:g=s;break;default:this.detectHyperlinks&&(g=this._detectHyperlinks(f.getData(),d,c,g))}g&&c.push({start:d,end:f.getOffset()+b,style:g})}},_parseString:function(a,b,c,e){var d=
this._whitespaceScanner;for(d.setText(a);a=d.nextToken();){var f=d.getStartOffset()+b,g=e;switch(a){case 10:this.whitespacesVisible&&this.tabsVisible&&(g=w);break;case 11:this.whitespacesVisible&&this.spacesVisible&&(g=n)}g&&c.push({start:f,end:d.getOffset()+b,style:g})}},_detectHyperlinks:function(a,b,c,e){var d=null,f;if((f=a.indexOf("://"))>0){for(var d=a,g=f;g>0;){f=d.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(d.substring(g-
1,g)),f!==-1&&(f&1)===0&&(f=d.lastIndexOf("\"\"''(){}[]<>".substring(f+1,f+2)))!==-1)){var h=f;f=this._clone(e);f.tagName="a";f.attributes={href:d.substring(g,h)};c.push({start:b,end:b+g,style:e});c.push({start:b+g,end:b+h,style:f});c.push({start:b+h,end:b+a.length,style:e});return null}}else a.toLowerCase().indexOf("bug#")===0&&(d="https://bugs.eclipse.org/bugs/show_bug.cgi?id="+parseInt(a.substring(4),10));return d?(f=this._clone(e),f.tagName="a",f.attributes={href:d},f):e},_clone:function(a){if(!a)return a;
var b={},c;for(c in a)a.hasOwnProperty(c)&&(b[c]=a[c]);return b},_findComments:function(a,b){var b=b||0,c=this._firstScanner,e;c.setText(a);for(var d=[];e=c.nextToken();)(e===7||e===8||e===5)&&d.push({start:c.getStartOffset()+b,end:c.getOffset()+b,type:e}),(e===6||e===7||e===8)&&this._computeTasks(e,c.getStartOffset()+b,c.getOffset()+b);return d},_findMatchingBracket:function(a,b){var c="{}()[]<>",e=a.getText(b,b+1),d=c.indexOf(e,0);if(d===-1)return-1;var f;f=d&1?c.substring(d-1,d):c.substring(d+
1,d+2);for(var g=a.getLineAtOffset(b),c=a.getLine(g),h=a.getLineStart(g),i=a.getLineEnd(g),c=this._findBrackets(e,f,c,h,h,i),i=0;i<c.length;i++)if(h=c[i]>=0?1:-1,c[i]*h-1===b){var j=1;if(d&1){for(i--;i>=0;i--)if(h=c[i]>=0?1:-1,j+=h,j===0)return c[i]*h-1;for(g-=1;g>=0;){c=a.getLine(g);h=a.getLineStart(g);i=a.getLineEnd(g);c=this._findBrackets(e,f,c,h,h,i);for(d=c.length-1;d>=0;d--)if(h=c[d]>=0?1:-1,j+=h,j===0)return c[d]*h-1;g--}}else{for(i++;i<c.length;i++)if(h=c[i]>=0?1:-1,j+=h,j===0)return c[i]*
h-1;g+=1;for(d=a.getLineCount();g<d;){c=a.getLine(g);h=a.getLineStart(g);i=a.getLineEnd(g);c=this._findBrackets(e,f,c,h,h,i);for(i=0;i<c.length;i++)if(h=c[i]>=0?1:-1,j+=h,j===0)return c[i]*h-1;g++}}break}return-1},_findBrackets:function(a,b,c,e,d,f){for(var g=[],a=a.charCodeAt(0),b=b.charCodeAt(0),h=d,i=this._scanner,j,k=this.comments,l=this._binarySearch(k,d,!0);l<k.length;l++){if(k[l].start>=f)break;j=k[l].start;var n=k[l].end;if(h<j)for(i.setText(c.substring(h-d,j-d));j=i.nextToken();)j===a?g.push(i.getStartOffset()+
h-d+e+1):j===b&&g.push(-(i.getStartOffset()+h-d+e+1));h=n}if(h<f)for(i.setText(c.substring(h-d,f-d));j=i.nextToken();)j===a?g.push(i.getStartOffset()+h-d+e+1):j===b&&g.push(-(i.getStartOffset()+h-d+e+1));return g},_onDestroy:function(){this.destroy()},_onLineStyle:function(a){if(a.textView===this.view)a.style=this._getLineStyle(a.lineIndex);a.ranges=this._getStyles(a.textView.getModel(),a.lineText,a.lineStart)},_onSelection:function(a){var b=a.oldValue,c=a.newValue,e=this.view,a=e.getModel(),d;if(this.highlightCaretLine){var f=
a.getLineAtOffset(b.start);d=a.getLineAtOffset(c.start);var g=c.start===c.end,b=b.start===b.end;f===d&&b&&g||(b&&e.redrawLines(f,f+1),(f!==d||!b)&&g&&e.redrawLines(d,d+1))}if(this.annotationModel){var b=this._bracketAnnotations,h,i;if(c.start===c.end&&(i=e.getCaretOffset())>0)i-=1,a.getBaseModel&&(i=a.mapOffset(i),a=a.getBaseModel()),a=this._findMatchingBracket(a,i),a!==-1&&(h=[j.AnnotationType.createAnnotation(j.AnnotationType.ANNOTATION_MATCHING_BRACKET,a,a+1),j.AnnotationType.createAnnotation(j.AnnotationType.ANNOTATION_CURRENT_BRACKET,
i,i+1)]);this._bracketAnnotations=h;this.annotationModel.replaceAnnotations(b,h)}},_onMouseDown:function(a){if(a.clickCount===2){var b=this.view,c=b.getModel(),e=b.getOffsetAtLocation(a.x,a.y);if(e>0){var d=e-1,f=c;c.getBaseModel&&(d=c.mapOffset(d),f=c.getBaseModel());d=this._findMatchingBracket(f,d);d!==-1&&(a.preventDefault(),a=d,c.getBaseModel&&(a=c.mapOffset(a,!0)),e>a&&(e--,a++),b.setSelection(a,e))}}},_onModelChanged:function(a){var b=a.start,c=a.removedCharCount,e=a.addedCharCount-c,d=this.view,
a=d.getModel(),f=a.getBaseModel?a.getBaseModel():a,c=b+c,g=f.getCharCount(),h=this.comments.length,i=f.getLineStart(f.getLineAtOffset(b)),k=this._binarySearch(this.comments,i,!0),l=this._binarySearch(this.comments,c,!1,k-1,h);k<h&&this.comments[k].start<=i&&i<this.comments[k].end?(i=this.comments[k].start,i>b&&(i+=e)):i=k===h&&h>0&&g-e===this.comments[h-1].end?this.comments[h-1].start:i;var n;l<h?(n=this.comments[l].end,n>b&&(n+=e),l+=1):(l=h,n=g);for(var m,g=this._findComments(f.getText(i,n),i),
h=k;h<this.comments.length;h++)m=this.comments[h],m.start>b&&(m.start+=e),m.start>b&&(m.end+=e);var t=l-k!==g.length;if(!t)for(h=0;h<g.length;h++){m=this.comments[k+h];var o=g[h];if(m.start!==o.start||m.end!==o.end||m.type!==o.type){t=!0;break}}h=[k,l-k].concat(g);Array.prototype.splice.apply(this.comments,h);t&&(h=i,m=n,a!==f&&(h=a.mapOffset(h,!0),m=a.mapOffset(m,!0)),d.redrawRange(h,m));if(this.foldingEnabled&&f!==a&&this.annotationModel){d=this.annotationModel;k=d.getAnnotations(i,n);i=[];for(n=
[];k.hasNext();)if(m=k.next(),m.type===j.AnnotationType.ANNOTATION_FOLDING){n.push(m);for(h=0;h<g.length;h++)if(m.start===g[h].start&&m.end===g[h].end)break;h===g.length?(i.push(m),m.expand()):(h=m.start,l=m.end,h>b&&(h-=e),l>b&&(l-=e),h<=b&&b<l&&h<=c&&c<l&&(h=f.getLineAtOffset(m.start),l=f.getLineAtOffset(m.end),h!==l?m.expanded||m.expand():d.removeAnnotation(m)))}b=[];for(h=0;h<g.length;h++){m=g[h];for(e=0;e<n.length;e++)if(n[e].start===m.start&&n[e].end===m.end)break;e===n.length&&(m=this._createFoldingAnnotation(a,
f,m.start,m.end))&&b.push(m)}d.replaceAnnotations(i,b)}}};return{TextStyler:h}});
define("orion/editor/textStyler",["orion/editor/annotations"],function(j){function k(a,b){this._unnamedCounter=0;this._patterns=[];this._rootId=b;a.forEach(function(a){this._addRepositoryPatterns(a.repository||{},a.id);this._addPatterns(a.patterns||[],a.id)}.bind(this))}function i(a,b,c,e,d){this.start=a.start;this.end=a.end;this.contentStart=a.contentStart;this.contentEnd=a.contentEnd;this.pattern=b;this._styler=c;this._parent=d;this._linePatterns=[];this._blockPatterns=[];this._enclosurePatterns=
{};if(e)this._initPatterns(),this._subBlocks=u(e,e.getText(this.start,this.end),this,this.start)}function d(a){this._styler=a}function a(a,b,c,e){this.highlightCaretLine=this.whitespacesVisible=this.spacesVisible=this.tabsVisible=!1;this.detectTasks=this.foldingEnabled=!0;this.view=a;this.annotationModel=b;this.patternManager=new k(c,e);this._accessor=new d(this);this._bracketAnnotations=void 0;var f=this;this._listener={onChanged:function(a){f._onModelChanged(a)},onDestroy:function(a){f._onDestroy(a)},
onLineStyle:function(a){f._onLineStyle(a)},onMouseDown:function(a){f._onMouseDown(a)},onSelection:function(a){f._onSelection(a)}};c=a.getModel();c.getBaseModel&&(c=c.getBaseModel());c.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);e=c.getCharCount();this._rootBlock=
new i({start:0,contentStart:0,end:e,contentEnd:e},null,this,c);this._computeFolding(this._rootBlock.getBlocks());b&&this.detectTasks&&(e=[],p(this._rootBlock,c,e),b.replaceAnnotations([],e));a.redrawLines()}var g={styleClass:"meta annotation currentLine"},f=/$/,e=/\\(\d)/g,h=/(.*)(?:[\r\n]|$)/g,c={regex:/ /g,style:{styleClass:"punctuation separator space",unmergeable:!0}},b={regex:/\t/g,style:{styleClass:"punctuation separator tab",unmergeable:!0}},l=function(a,b,c,e){var d=c,f=a.lastIndex;h.lastIndex=
c;var c=h.exec(b),g,i;a.lastIndex=0;if(c){for(i=c.index;0<=--i;)if(g=b.charAt(i),g==="\n"||g==="\r")break;g=b.substring(i+1,c.index+c[1].length);a.lastIndex=i=c.index-i-1}for(;c&&c.index<b.length;){var j;if(e){var k=a.lastIndex;if(a.test(g))a.lastIndex=k,j=a.exec(g)}else j=a.exec(g);if(j)return j.index+=d,j.index-=i,a.lastIndex=f,j;i=0;d+=c[0].length;if(c=h.exec(b))g=c[1],a.lastIndex=0}a.lastIndex=f;return null},m=function(a,b){var c=a.toString();e.lastIndex=0;if(!e.test(c))return a;e.lastIndex=0;
for(var d=e.exec(c);d;)c=c.replace(d[0],b[d[1]]||""),e.lastIndex=0,d=e.exec(c);return RegExp(c.substring(1,c.length-2),"g")},o=function(a,b,c,e){if(b=l(a.pattern.regex?a.pattern.regex:a.pattern.regexBegin,b,e,!0)){a.result=b;for(e=0;e<c.length;e++)if(b.index<c[e].result.index||b.index===c[e].result.index&&a.pattern.pattern.index<c[e].pattern.pattern.index){c.splice(e,0,a);return}c.push(a)}},r=function(a,b,c,e){if(b[0])e.push({start:c,end:c+a[0].length,style:b[0].name});else for(var d=0,f=1;f<a.length;f++)if(a[f]){var g=
b[f];if(g){var h=c+d;e.push({start:h,end:h+a[f].length,style:g.name})}d+=a[f].length}},q=function(a,b,c){var e=a.start;b.forEach(function(b){e<=b.start&&c.push({start:e,end:b.start,style:a.style});c.push(b);e=b.end});e<a.end&&c.push({start:e,end:a.end,style:a.style})},s=function(a,b,c,e,d){if(c=c.getLinePatterns()){var g=[];c.forEach(function(b){var c=b.regex||b.regexBegin;c.oldLastIndex=c.lastIndex;(c=l(c,a,0))&&g.push({result:c,pattern:b})});g.sort(function(a,b){return a.result.index<b.result.index?
-1:a.result.index>b.result.index?1:a.pattern.pattern.index<b.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,p=[];if(i.pattern.regex){h=i.result;k=j+h[0].length;k={start:b+j,end:b+k,style:i.pattern.pattern.name};if(!d){i.pattern.pattern.captures&&r(h,i.pattern.pattern.captures,b+j,p);p.sort(function(a,b){return a.start<b.start?-1:a.start>b.start?1:0});for(j=0;j<p.length-1;j++)if(p[j+1].start<p[j].end){var s={start:p[j+1].end,
end:p[j].end,style:p[j].style};p[j].end=p[j+1].start;p.splice(j+2,0,s)}}q(k,p,e)}else{h=i.pattern.regexEnd;h=m(h,i.result);h=l(h,a,i.result.index+i.result[0].length);if(!h)f.lastIndex=0,h=f.exec(a);k=h.index+h[0].length;e.push({start:b+j,end:b+k,style:i.pattern.pattern.name})}h=h.index+h[0].length}o(i,a,g,h)}c.forEach(function(a){a=a.regex||a.regexBegin;a.lastIndex=a.oldLastIndex})}},u=function(a,b,c,e){var d=[];c.getBlockPatterns().forEach(function(a){var c=l(a.regexBegin||a.regex,b,0);c&&d.push({result:c,
pattern:a})}.bind(this));if(!d.length)return d;d.sort(function(a,b){return a.result.index<b.result.index?-1:a.result.index>b.result.index?1:a.pattern.pattern.index<b.pattern.pattern.index?-1:1});for(var g=0,h=[];d.length>0;){var j=d[0];d.splice(0,1);if(!(j.result.index<g)){var k=a.getLineAtOffset(e+j.result.index),r=a.getLine(k),p=[];s(r,a.getLineStart(k),c,p);k=e+j.result.index;for(r=0;r<p.length;r++)if(p[r].start===k){var g=j.result.index,q=null,u=j.pattern.regexEnd;if(u){g+=j.result[0].length;
for(var u=m(u,j.result),C=g;!q;){C=l(u,b,C);if(!C)f.lastIndex=0,C=f.exec(b);var M=[],H=new i({start:k,end:e+C.index+C[0].length,contentStart:e+g,contentEnd:e+C.index},j.pattern,c.getStyler(),a,c);s(b.substring(g,C.index+C[0].length),g,H,M);if(!M.length||M[M.length-1].end<=C.index)q=H;C=C.index+C[0].length}}else q=new i({start:k,end:k+j.result[0].length,contentStart:k,contentEnd:k+j.result[0].length},j.pattern,c.getStyler(),a,c);h.push(q);g=q.end-e;break}r===p.length&&(g=j.result.index+1)}o(j,b,d,
g)}return h},p=function(a,b,c){if(a.getAnnotationModel()){var e=j.AnnotationType.ANNOTATION_TASK;if(a.getLinePatterns().length&&a.pattern&&a.pattern.pattern.name&&a.pattern.pattern.name.indexOf("comment")===0){var d=[];s(b.getText(a.contentStart,a.end),a.contentStart,a,d,!0);for(var f=0;f<d.length;f++)d[f].style==="meta.annotation.task.todo"&&c.push(j.AnnotationType.createAnnotation(e,d[f].start,d[f].end,b.getText(d[f].start,d[f].end)))}a.getBlocks().forEach(function(a){p(a,b,c)}.bind(this))}};k.prototype=
{getPatterns:function(a){var b=[0],c={},e=RegExp("^"+(a?typeof a==="string"?a:a.qualifiedId:this._rootId)+"#[^#]+$"),d=[];this._patterns.forEach(function(a){if(e.test(a.qualifiedId))a.include?d.push(a):(a.index=b[0]++,c[a.id]=a)}.bind(this));d.forEach(function(a){this._processInclude(a,b,c)}.bind(this));var f=[];Object.keys(c).forEach(function(a){f.push(c[a])});return f},_addPatterns:function(a,b){a.forEach(function(a){this._addPattern(a,this._NO_ID+this._unnamedCounter++,b)}.bind(this))},_addRepositoryPatterns:function(a,
b){Object.keys(a).forEach(function(c){this._addPattern(a[c],c,b)}.bind(this))},_addPattern:function(a,b,c){a.parentId=c;a.id=b;a.qualifiedId=a.parentId+"#"+a.id;this._patterns.push(a);a.patterns&&!a.include&&this._addPatterns(a.patterns,a.qualifiedId)},_processInclude:function(a,b,c){var e,d=a.include.indexOf("#");e=d===0?RegExp("^"+a.qualifiedId.substring(0,a.qualifiedId.indexOf("#"))+a.include+"$"):d===-1?RegExp("^"+a.include+"#"+this._NO_ID+"[^#]+$"):RegExp("^"+a.include+"$");var f=[];this._patterns.forEach(function(a){if(e.test(a.qualifiedId))if(a.include)f.push(a);
else if(!c[a.id])a.index=b[0]++,c[a.id]=a}.bind(this));f.forEach(function(a){this._processInclude(a,b,c)}.bind(this))},_NO_ID:"NoID"};i.prototype={adjustEnd:function(a){this.end+=a;this.contentEnd+=a;this._subBlocks.forEach(function(b){b.adjustEnd(a)})},adjustStart:function(a){this.start+=a;this.contentStart+=a;this._subBlocks.forEach(function(b){b.adjustStart(a)})},computeStyle:function(a,b){if(!this.pattern||!(this.start<=b&&b<this.end))return null;var c={start:this.start,end:this.end,style:this.pattern.pattern.name};
if(this.contentStart<=b&&b<this.contentEnd)return this.pattern.pattern.contentName?{start:this.contentStart,end:this.contentEnd,style:this.pattern.pattern.contentName}:c;var e,d,f,g;if(b<this.contentStart){d=this.pattern.pattern.beginCaptures||this.pattern.pattern.captures;if(!d)return c;e=this.pattern.regexBegin;f=a.getText(this.start,this.contentStart);g=this.start}else{d=this.pattern.pattern.endCaptures||this.pattern.pattern.captures;if(!d)return c;e=this.pattern.regexEnd;f=a.getText(this.contentEnd,
this.end);g=this.contentEnd}e.lastIndex=0;if(f=e.exec(f)){e=[];r(f,d,g,e);for(d=0;d<e.length;d++)if(e[d].start<=b&&b<e[d].end)return e[d]}return c},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 b=/^\(\?i\)\s*/.exec(a);b&&(a=a.substring(b[0].length));return a};this.getPatternManager().getPatterns(this.pattern?this.pattern.pattern:null).forEach(function(b){var c;if(b.match&&!b.begin&&!b.end){c="g";var e=a(b.match);e!==b.match&&(c+="i");c={regex:RegExp(e,c),pattern:b};this._linePatterns.push(c);if(b.patterns)this._blockPatterns.push(c);
else if(b.name&&b.name.indexOf("punctuation.section")===0&&(b.name.indexOf(".begin")!==-1||b.name.indexOf(".end")!==-1))this._enclosurePatterns[b.name]=c}else if(!b.match&&b.begin&&b.end){c="g";e=a(b.begin);e!==b.begin&&(c+="i");var d="g",f=a(b.end);f!==b.end&&(d+="i");c={regexBegin:RegExp(e,c),regexEnd:RegExp(f,d),pattern:b};this._linePatterns.push(c);this._blockPatterns.push(c)}}.bind(this))}};d.prototype={getStyles:function(a){return this._styler.getStyles(a)}};a.prototype={destroy:function(){var a=
this.view;if(a){var b=a.getModel();b.getBaseModel&&(b=b.getBaseModel());b.removeEventListener("Changed",this._listener.onChanged);a.removeEventListener("MouseDown",this._listener.onMouseDown);a.removeEventListener("Selection",this._listener.onSelection);a.removeEventListener("Destroy",this._listener.onDestroy);a.removeEventListener("LineStyle",this._listener.onLineStyle);this.view=null}},getStyleAccessor:function(){return this._accessor},getStyles:function(a){var b=[],c=this.view.getModel();c.getBaseModel&&
(c=c.getBaseModel());var e=this._findBlock(this._rootBlock,a),d=c.getLineAtOffset(a),f=c.getLine(d),g=[];s(f,c.getLineStart(d),e,g);for(d=0;d<g.length;d++){if(a<g[d].start)break;if(g[d].start<=a&&a<g[d].end){b.push(g[d]);break}}for(;e;)(g=e.computeStyle(c,a))&&b.splice(0,0,g),e=e.getParent();return b},setHighlightCaretLine:function(a){this.highlightCaretLine=a},setWhitespacesVisible:function(a,b){if(this.whitespacesVisible!==a)this.whitespacesVisible=a,b&&this.view.redraw()},setTabsVisible:function(a){if(this.tabsVisible!==
a)this.tabsVisible=a,this.setWhitespacesVisible(this.tabsVisible||this.spacesVisible,!1),this.view.redraw()},setSpacesVisible:function(a){if(this.spacesVisible!==a)this.spacesVisible=a,this.setWhitespacesVisible(this.tabsVisible||this.spacesVisible,!1),this.view.redraw()},setDetectHyperlinks:function(){},setFoldingEnabled:function(a){this.foldingEnabled=a},setDetectTasks:function(a){this.detectTasks=a},_binarySearch:function(a,b,c,e,d){var f;e===void 0&&(e=-1);if(d===void 0)d=a.length;for(;d-e>1;)if(f=
Math.floor((d+e)/2),b<=a[f].start)d=f;else if(c&&b<a[f].end){d=f;break}else e=f;return d},_computeFolding:function(a){if(this.foldingEnabled){var b=this.view.getModel();if(b.getBaseModel){var c=this.annotationModel;if(c){c.removeAnnotations(j.AnnotationType.ANNOTATION_FOLDING);for(var e=[],d=b.getBaseModel(),f=0;f<a.length;f++){var g=a[f];(g=this._createFoldingAnnotation(b,d,g.start,g.end))&&e.push(g)}c.replaceAnnotations(null,e)}}}},_createFoldingAnnotation:function(a,b,c,e){var d=b.getLineAtOffset(c),
b=b.getLineAtOffset(e);return d===b?null:new (j.AnnotationType.getType(j.AnnotationType.ANNOTATION_FOLDING))(c,e,a)},_findBlock:function(a,b){var c=a.getBlocks();if(!c.length)return a;var e=this._binarySearch(c,b,!0);return e<c.length&&c[e].start<=b&&b<c[e].end?this._findBlock(c[e],b):a},_findBrackets:function(a,b,c,e,d,f){for(var g=[],h=[],i=d,j=c.getBlocks(),k=this._binarySearch(j,d,!0);k<j.length;k++){if(j[k].start>=f)break;var l=j[k].start,m=j[k].end;i<l&&(s(e.substring(i-d,l-d),i,c,h),h.forEach(function(c){c.style.indexOf(a.pattern.name)===
0?g.push(c.start+1):c.style.indexOf(b.pattern.name)===0&&g.push(-(c.start+1))}),h=[]);i=m}i<f&&(s(e.substring(i-d,f-d),i,c,h),h.forEach(function(c){c.style.indexOf(a.pattern.name)===0?g.push(c.start+1):c.style.indexOf(b.pattern.name)===0&&g.push(-(c.start+1))}));return g},_findMatchingBracket:function(a,b,c){for(var e=a.getLineAtOffset(c),d=a.getLineEnd(e),f=a.getText(c,d),g,h=b.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(e);k=a.getLineStart(e);d=this._findBrackets(g,h,b,i,k,d);for(j=0;j<d.length;j++)if(i=d[j]>=0?1:-1,d[j]*i-1===c){c=1;if(f){for(j++;j<d.length;j++)if(i=d[j]>=0?1:-1,c+=i,c===0)return d[j]*i-1;e+=1;for(j=a.getLineCount();e<j;){i=a.getLine(e);k=a.getLineStart(e);d=a.getLineEnd(e);d=this._findBrackets(g,h,b,i,k,d);for(f=0;f<d.length;f++)if(i=
d[f]>=0?1:-1,c+=i,c===0)return d[f]*i-1;e++}}else{for(j--;j>=0;j--)if(i=d[j]>=0?1:-1,c+=i,c===0)return d[j]*i-1;for(e-=1;e>=0;){i=a.getLine(e);k=a.getLineStart(e);d=a.getLineEnd(e);d=this._findBrackets(g,h,b,i,k,d);for(j=d.length-1;j>=0;j--)if(i=d[j]>=0?1:-1,c+=i,c===0)return d[j]*i-1;e--}}break}return-1},_getAnnotationModel:function(){return this.annotationModel},_getLineStyle:function(a){if(this.highlightCaretLine){var b=this.view,c=b.getModel(),b=b.getSelection();if(b.start===b.end&&c.getLineAtOffset(b.start)===
a)return g}return null},_getPatternManager:function(){return this.patternManager},_getStyles:function(a,b,c,e){b.getBaseModel&&(e=b.mapOffset(e));for(var d=e+c.length,f=[],g=e,h=a.getBlocks(),i=this._binarySearch(h,e,!0);i<h.length;i++){if(h[i].start>=d)break;var j=h[i].start,k=h[i].end;g<j&&s(c.substring(g-e,j-e),g,a,f);var m=Math.max(g,j);if(m===j&&h[i].pattern.regexBegin){var o=l(h[i].pattern.regexBegin,c.substring(m-e),0);if(o){var p=h[i].pattern.pattern.beginCaptures||h[i].pattern.pattern.captures;
p?r(o,p,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(d,k),q=[];if(j===k&&h[i].pattern.regexEnd&&(g=c.substring(j-g-(h[i].end-h[i].contentEnd)),o=l(h[i].pattern.regexEnd,g,0)))(p=h[i].pattern.pattern.endCaptures||h[i].pattern.pattern.captures)?r(o,p,j-o[0].length,q):h[i].pattern.pattern.name&&q.push({start:j-o[0].length,end:j,style:h[i].pattern.pattern.name}),j-=o[0].length;var g=this._getStyles(h[i],b,c.substring(m-e,j-e),m),u=h[i].pattern.pattern.contentName||
h[i].pattern.pattern.name;if(u){var O=m;g.forEach(function(a){a.start-O&&f.push({start:O,end:a.start,style:u});f.push(a);O=a.end});j-O&&f.push({start:O,end:j,style:u})}else f=f.concat(g);f=f.concat(q);g=k}g<d&&s(c.substring(g-e,d-e),g,a,f);if(b.getBaseModel)for(a=0;a<f.length;a++)c=f[a].end-f[a].start,f[a].start=b.mapOffset(f[a].start,!0),f[a].end=f[a].start+c;return f},_isRenderingWhitespace:function(){return this.whitespacesVisible&&(this.tabsVisible||this.spacesVisible)},_onDestroy:function(){this.destroy()},
_onLineStyle:function(a){if(a.textView===this.view)a.style=this._getLineStyle(a.lineIndex);a.ranges=this._getStyles(this._rootBlock,a.textView.getModel(),a.lineText,a.lineStart);a.ranges.forEach(function(a){if(a.style)a.style={styleClass:a.style.replace(/\./g," ")}});this._isRenderingWhitespace()&&(this.spacesVisible&&this._spliceStyles(c,a.ranges,a.lineText,a.lineStart),this.tabsVisible&&this._spliceStyles(b,a.ranges,a.lineText,a.lineStart))},_onSelection:function(a){var b=a.oldValue,c=a.newValue,
e=this.view,a=e.getModel(),d;if(this.highlightCaretLine){var f=a.getLineAtOffset(b.start);d=a.getLineAtOffset(c.start);var g=c.start===c.end,b=b.start===b.end;f===d&&b&&g||(b&&e.redrawLines(f,f+1),(f!==d||!b)&&g&&e.redrawLines(d,d+1))}if(this.annotationModel){var b=this._bracketAnnotations,h,i;if(c.start===c.end&&(i=e.getCaretOffset())>0)i-=1,a.getBaseModel&&(i=a.mapOffset(i),a=a.getBaseModel()),c=this._findBlock(this._rootBlock,i),a=this._findMatchingBracket(a,c,i),a!==-1&&(h=[j.AnnotationType.createAnnotation(j.AnnotationType.ANNOTATION_MATCHING_BRACKET,
a,a+1),j.AnnotationType.createAnnotation(j.AnnotationType.ANNOTATION_CURRENT_BRACKET,i,i+1)]);this._bracketAnnotations=h;this.annotationModel.replaceAnnotations(b,h)}},_onMouseDown:function(a){if(a.clickCount===2){var b=this.view,c=b.getModel(),e=b.getOffsetAtLocation(a.x,a.y);if(e>0){var d=e-1,f=c;c.getBaseModel&&(d=c.mapOffset(d),f=c.getBaseModel());var g=this._findBlock(this._rootBlock,d),d=this._findMatchingBracket(f,g,d);d!==-1&&(a.preventDefault(),a=d,c.getBaseModel&&(a=c.mapOffset(a,!0)),e>
a&&(e--,a++),b.setSelection(a,e))}}},_onModelChanged:function(a){var b=a.start,c=a.removedCharCount,a=a.addedCharCount-c,e=this.view,d=e.getModel(),f=d.getBaseModel?d.getBaseModel():d,c=b+c,g=f.getCharCount(),h=this._rootBlock.getBlocks(),i=h.length,k=f.getLineStart(f.getLineAtOffset(b)),l=this._binarySearch(h,k,!0),m=this._binarySearch(h,c,!1,l-1,i),o;l<i&&h[l].start<=k&&k<h[l].end?(o=h[l].start,o>b&&(o+=a)):o=l===i&&i>0&&g-a===h[i-1].end?h[i-1].start:k;var r;do m<i?(r=h[m].end,r>b&&(r+=a),m+=1):
(m=i,r=g),k=f.getText(o,r),k=u(f,k,this._rootBlock,o);while(k.length&&h.length&&m<i&&k[k.length-1].pattern.pattern.id!==h[m-1].pattern.pattern.id);for(g=l;g<h.length;g++)i=h[g],i.start>b&&i.adjustStart(a),i.start>b&&i.adjustEnd(a);var q=m-l!==k.length;if(!q)for(g=0;g<k.length;g++){var i=h[l+g],s=k[g];if(i.start!==s.start||i.end!==s.end||i.type!==s.type){q=!0;break}}g=[l,m-l].concat(k);Array.prototype.splice.apply(h,g);q&&(g=o,i=r,d!==f&&(g=d.mapOffset(g,!0),i=d.mapOffset(i,!0)),e.redrawRange(g,i));
if(this.annotationModel){e=[];h=[];l=[];o=this.annotationModel.getAnnotations(o,r);for(r=this.foldingEnabled&&f!==d;o.hasNext();)if(i=o.next(),r&&i.type===j.AnnotationType.ANNOTATION_FOLDING){l.push(i);for(g=0;g<k.length;g++)if(i.start===k[g].start&&i.end===k[g].end)break;g===k.length?(e.push(i),i.expand()):(g=i.start,m=i.end,g>b&&(g-=a),m>b&&(m-=a),g<=b&&b<m&&g<=c&&c<m&&(g=f.getLineAtOffset(i.start),m=f.getLineAtOffset(i.end),g!==m?i.expanded||i.expand():this.annotationModel.removeAnnotation(i)));
for(g=0;g<k.length;g++){i=k[g];for(m=0;m<l.length;m++)if(l[m].start===i.start&&l[m].end===i.end)break;m===l.length&&(i=this._createFoldingAnnotation(d,f,i.start,i.end))&&h.push(i)}}else i.type===j.AnnotationType.ANNOTATION_TASK&&e.push(i);if(this.detectTasks)for(g=0;g<k.length;g++)p(k[g],f,h);this.annotationModel.replaceAnnotations(e,h)}},_spliceStyles:function(a,b,c,e){for(var d=a.regex,f=d.lastIndex=0,g=d.exec(c);g;){for(g=e+g.index;f<b.length;){if(g<b[f].end)break;f++}var h={start:g,end:g+1,style:a.style};
if(f<b.length&&b[f].start<=g){var i={start:g+1,end:b[f].end,style:b[f].style};b[f].end=g;b.splice(f+1,0,i);b.splice(f+1,0,h);f+=2}else b.splice(f,0,h),f++;g=d.exec(c)}}};return{TextStyler:a}});
define("orion/editor/textMateStyler",["orion/regex"],function(j){function k(a){var d;if(a instanceof Array){d=Array(a.length);for(var f=0;f<a.length;f++)d[f]=k(a[f])}else for(f in d={},a)if(Object.prototype.hasOwnProperty.call(a,f)){var e=a[f];d[f]=typeof e==="object"&&e!==null?k(e):e}return d}function i(a,d,f){this.initialize(a);this.grammar=k(d);this.externalGrammars=f?k(f):[];this._styles={};this._tree=null;this._allGrammars={};this.preprocess(this.grammar)}var d={unsupported:[{regex:/\(\?[ims\-]:/,
func:function(){return"option on/off for subexp"}},{regex:/\(\?<([=!])/,func:function(a){return a[1]==="="?"lookbehind":"negative lookbehind"}},{regex:/\(\?>/,func:function(){return"atomic group"}}],toRegExp:function(a){function g(a,b){throw Error('Unsupported regex feature "'+a+'": "'+b[0]+'" at index: '+b.index+" in "+b.input);}var f="",e,a=d.processGlobalFlag("x",a,function(a){for(var b="",e=!1,d=a.length,f=0;f<d;){var g=a.charAt(f);if(!e&&g==="#")for(;f<d&&g!=="\r"&&g!=="\n";)g=a.charAt(++f);
else if(!e&&/\s/.test(g))for(;f<d&&/\s/.test(g);)g=a.charAt(++f);else g==="\\"?(b+=g,/\s/.test(a.charAt(f+1))||(b+=a.charAt(f+1),f+=1)):(g==="["?e=!0:g==="]"&&(e=!1),b+=g),f+=1}return b}),a=d.processGlobalFlag("i",a,function(a){f+="i";return a});for(e=0;e<this.unsupported.length;e++){var h;(h=this.unsupported[e].regex.exec(a))&&g(this.unsupported[e].func(h),h)}return RegExp(a,f)},processGlobalFlag:function(a,d,f){function e(a,b){for(var e=0,d=a.length,f=-1,g=b;g<d&&f===-1;g++)switch(a.charAt(g)){case "\\":g++;
break;case "(":e++;break;case ")":e--,e===0&&(f=g)}return f}var h="(?"+a+")",a="(?"+a+":";if(d.substring(0,h.length)===h)return f(d.substring(h.length));else if(d.substring(0,a.length)===a){h=e(d,0);if(h<d.length-1)throw Error("Only a "+a+") group that encloses the entire regex is supported in: "+d);return f(d.substring(a.length,h))}return d},hasBackReference:function(a){return/\\\d+/.test(a.source)},getSubstitutedRegex:function(a,d,f){for(var f=typeof f==="undefined"?!0:!1,a=a.source.split(/(\\\d+)/g),
e=[],h=0;h<a.length;h++){var c=a[h],b=/\\(\d+)/.exec(c);b?(c=d[b[1]]||"",e.push(f?j.escape(c):c)):e.push(c)}return RegExp(e.join(""))},groupify:function(a,d){for(var f=a.source,e=f.length,h=[],c=0,b=[],i=1,j=1,k=[],r={},q={},s=0;s<e;s++){var u=h[h.length-1],p=f.charAt(s);switch(p){case "(":if(u===4)h.pop(),k.push(")"),b[b.length-1].end=s;var t=s+2<e?f.charAt(s+1)+""+f.charAt(s+2):null;if(t==="?:"||t==="?="||t==="?!"){var v;t==="?:"?v=1:(v=3,c++);h.push(v);b.push({start:s,end:-1,type:v});k.push(p);
k.push(t);s+=t.length}else h.push(2),b.push({start:s,end:-1,type:2,oldNum:i,num:j}),k.push(p),c===0&&(q[j]=null),r[i]=j,i++,j++;break;case ")":u=h.pop();u===3&&c--;b[b.length-1].end=s;k.push(p);break;case "*":case "+":case "?":case "}":var n=p,w=f.charAt(s-1),t=s-1;if(p==="}"){for(v=s-1;f.charAt(v)!=="{"&&v>=0;v--);w=f.charAt(v-1);t=v-1;n=f.substring(v,s+1)}v=b[b.length-1];if(w===")"&&(v.type===2||v.type===4)){k.splice(v.start,0,"(");k.push(n);k.push(")");p={start:v.start,end:k.length-1,type:4,num:v.num};
for(w=0;w<b.length;w++)if(u=b[w],(u.type===2||u.type===4)&&u.start>=v.start&&u.end<=t)if(u.start+=1,u.end+=1,u.num+=1,u.type===2)r[u.oldNum]=u.num;b.push(p);j++;break}default:p!=="|"&&u!==2&&u!==4&&c===0&&(h.push(4),b.push({start:s,end:-1,type:4,num:j}),k.push("("),q[j]=null,j++),k.push(p),p==="\\"&&(p=f.charAt(s+1),k.push(p),s+=1)}}for(;h.length;)h.pop(),k.push(")");var f=RegExp(k.join("")),e={},d=d||r,x;for(x in d)d.hasOwnProperty(x)&&(e[x]="\\"+d[x]);f=this.getSubstitutedRegex(f,e,!1);return[f,
r,q]},complexCaptures:function(a){if(!a)return!1;for(var d in a)if(a.hasOwnProperty(d)&&d!=="0")return!0;return!1}};i.prototype={initialize:function(a){this.textView=a;this.textView.stylerOptions=this;var d=this;this._listener={onModelChanged:function(a){d.onModelChanged(a)},onDestroy:function(a){d.onDestroy(a)},onLineStyle:function(a){d.onLineStyle(a)},onStorage:function(a){d.onStorage(a)}};a.addEventListener("ModelChanged",this._listener.onModelChanged);a.addEventListener("Destroy",this._listener.onDestroy);
a.addEventListener("LineStyle",this._listener.onLineStyle);a.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(a){for(a=[a];a.length!==0;){var d=
a.pop();if(!d._resolvedRule||!d._typedRule)if(d._resolvedRule=this._resolve(d),d._typedRule=this._createTypedRule(d),this.addStyles(d.name),this.addStyles(d.contentName),this.addStylesForCaptures(d.captures),this.addStylesForCaptures(d.beginCaptures),this.addStylesForCaptures(d.endCaptures),d._resolvedRule!==d&&a.push(d._resolvedRule),d.patterns)for(var f=0;f<d.patterns.length;f++)a.push(d.patterns[f])}},addStyles:function(a){if(a&&!this._styles[a]){this._styles[a]=[];for(var d=a.split("."),f=0;f<
d.length;f++)this._styles[a].push(d.slice(0,f+1).join("-"))}},addStylesForCaptures:function(a){for(var d in a)a.hasOwnProperty(d)&&this.addStyles(a[d].name)},ContainerRule:function(){function a(a){this.rule=a;this.subrules=a.patterns}a.prototype.valueOf=function(){return"aa"};return a}(),BeginEndRule:function(){function a(a){this.rule=a;this.beginRegex=d.toRegExp(a.begin);this.endRegex=d.toRegExp(a.end);this.subrules=a.patterns||[];this.endRegexHasBackRef=d.hasBackReference(this.endRegex);var f=d.complexCaptures(a.captures),
a=d.complexCaptures(a.beginCaptures)||d.complexCaptures(a.endCaptures);if(this.isComplex=f||a)f=d.groupify(this.beginRegex),this.beginRegex=f[0],this.beginOld2New=f[1],this.beginConsuming=f[2],f=d.groupify(this.endRegex,this.beginOld2New),this.endRegex=f[0],this.endOld2New=f[1],this.endConsuming=f[2]}a.prototype.valueOf=function(){return this.beginRegex};return a}(),MatchRule:function(){function a(a){this.rule=a;this.matchRegex=d.toRegExp(a.match);if(this.isComplex=d.complexCaptures(a.captures))a=
d.groupify(this.matchRegex),this.matchRegex=a[0],this.matchOld2New=a[1],this.matchConsuming=a[2]}a.prototype.valueOf=function(){return this.matchRegex};return a}(),_createTypedRule:function(a){return a.match?new this.MatchRule(a):a.begin?new this.BeginEndRule(a):new this.ContainerRule(a)},_resolve:function(a){var d=a;if(a.include){if(a.begin||a.end||a.match)throw Error('Unexpected regex pattern in "include" rule '+a.include);a=a.include;if(a.charAt(0)==="#"){if(d=this.grammar.repository&&this.grammar.repository[a.substring(1)],
!d)throw Error("Couldn't find included rule "+a+" in grammar repository");}else if(a==="$self")d=this.grammar;else if(a==="$base")throw Error('Include "$base" is not supported');else if(d=this._allGrammars[a],!d)for(var f=0;f<this.externalGrammars.length;f++){var e=this.externalGrammars[f];if(e.scopeName===a){this.preprocess(e);d=this._allGrammars[a]=e;break}}}return d},ContainerNode:function(){function a(a,d){this.parent=a;this.rule=d;this.children=[];this.end=this.start=null}a.prototype.addChild=
function(a){this.children.push(a)};a.prototype.valueOf=function(){var a=this.rule;return"ContainerNode { "+(a.include||"")+" "+(a.name||"")+(a.comment||"")+"}"};return a}(),BeginEndNode:function(){function a(a,f,e){this.parent=a;this.rule=f;this.children=[];this.setStart(e);this.endMatch=this.end=null;this.endRegexSubstituted=f.endRegexHasBackRef?d.getSubstitutedRegex(f.endRegex,e):null}a.prototype.addChild=function(a){this.children.push(a)};a.prototype.getIndexInParent=function(){return this.parent?
this.parent.children.indexOf(this):-1};a.prototype.setStart=function(a){this.start=a.index;this.beginMatch=a};a.prototype.setEnd=function(a){a&&typeof a==="object"?(this.endMatch=a,this.end=a.index+a[0].length):(this.endMatch=null,this.end=a)};a.prototype.shiftStart=function(a){this.start+=a;this.beginMatch.index+=a};a.prototype.shiftEnd=function(a){this.end+=a;this.endMatch&&(this.endMatch.index+=a)};a.prototype.valueOf=function(){return"{"+this.rule.beginRegex+" range="+this.start+".."+this.end+
"}"};return a}(),push:function(a,d){if(d)for(var f=d.length;f>0;)a.push(d[--f])},exec:function(a,d,f){(d=a.exec(d))&&(d.index+=f);a.lastIndex=0;return d},afterMatch:function(a){return a.index+a[0].length},getEndMatch:function(a,d,f){if(a instanceof this.BeginEndNode){var e=a.rule,a=a.endRegexSubstituted||e.endRegex;return!a?null:this.exec(a,d,f)}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(a){var d=a.addedCharCount,f=a.removedCharCount,a=a.start;if(this._tree){var e=this.textView.getModel(),h=e.getCharCount(),e=e.getLineEnd(e.getLineAtOffset(a)-1),c=this.getFirstDamaged(e,e),e=e===-1?0:e,d=c?this.parse(c,!0,e,a,d,f):h;this.textView.redrawRange(e,d)}else this.initialParse()},getFirstDamaged:function(a,d){if(a<0)return this._tree;for(var f=[this._tree],e=null;f.length;){var h=f.pop();if(!h.parent||this.isDamaged(h,a,d)){h instanceof this.BeginEndNode&&(e=
h);for(var c=0;c<h.children.length;c++)f.push(h.children[c])}}return e||this._tree},isDamaged:function(a,d,f){return a.start<=f&&a.end>d},parse:function(a,d,f,e,h,c){var b=this.textView.getModel(),i=b.getLineStart(b.getLineCount()-1),j=b.getCharCount(),k=this.getInitialExpected(a,f),r=-1;if(d)a.repaired=!0,a.endNeedsUpdate=!0,r=(r=a.children[a.children.length-1])?b.getLineEnd(b.getLineAtOffset(r.end+(h-c))):-1,e=b.getLineEnd(b.getLineAtOffset(e+c)),r=Math.max(r,e);for(var r=r===-1?j:r,e=k,q=a,s=!1,
u=f,p=-1;q&&(!d||u<r);){var t=this.getNextMatch(b,q,u);t||(u=u>=i?j:b.getLineStart(b.getLineAtOffset(u)+1));var v=t&&t.match,n=t&&t.rule,w=t&&t.isEnd;if(t&&t.isSub){if(u=this.afterMatch(v),n instanceof this.BeginEndRule)s=!0,d&&n===e.rule&&q===e.parent?(q=e,q.setStart(v),q.repaired=!0,q.endNeedsUpdate=!0,e=this.getNextExpected(e,"begin")):(d&&(this.prune(q,e),d=!1),v=new this.BeginEndNode(q,n,v),q.addChild(v),q=v)}else if(w||u===j){if(q instanceof this.BeginEndNode)v?(s=!0,p=Math.max(p,q.end),q.setEnd(v),
u=this.afterMatch(v),d&&q===e&&q.parent===e.parent?(q.repaired=!0,delete q.endNeedsUpdate,e=this.getNextExpected(e,"end")):d&&(this.prune(q,e),d=!1)):(q.setEnd(j),delete q.endNeedsUpdate);q=q.parent}d&&u>=r&&!s&&(this.prune(a,k),d=!1)}this.removeUnrepairedChildren(a,d,f);this.cleanup(d,a,f,r,j,h,c);return d?Math.max(p,u):u},removeUnrepairedChildren:function(a,d,f){if(d){for(var d=a.children,e=-1,h=0;h<d.length;h++){var c=d[h];if(!c.repaired&&this.isDamaged(c,f,Number.MAX_VALUE)){e=h;break}}if(e!==
-1)a.children.length=e}},cleanup:function(a,d,f,e,h,c,b){if(a){a=c-b;h=this.getIntersecting(e-a+1,h);d=this.getIntersecting(f,e);for(f=0;f<h.length;f++)e=h[f],!e.repaired&&e instanceof this.BeginEndNode&&(e.shiftEnd(a),e.shiftStart(a));for(f=0;f<d.length;f++)e=d[f],e.repaired&&e.endNeedsUpdate&&e.shiftEnd(a),delete e.endNeedsUpdate,delete e.repaired}else{d=this.getIntersecting(f,e);for(f=0;f<d.length;f++)delete d[f].repaired}},getNextMatch:function(a,d,f,e){var h=a.getLineAtOffset(f),h=a.getLineEnd(h),
c=a.getText(f,h),b=[],i=[],a=[],h=[];for(this.push(b,d.rule.subrules);b.length;){var j=b.length?b.pop():null,j=j&&j._resolvedRule._typedRule;if(j instanceof this.ContainerRule&&i.indexOf(j)===-1)i.push(j),this.push(b,j.subrules);else if(!j||!e||j.matchRegex){var k=j&&this.exec(j.matchRegex||j.beginRegex,c,f);k&&(a.push(k),h.push(j))}}b=Number.MAX_VALUE;i=-1;for(j=0;j<a.length;j++)if(k=a[j],k.index<b)b=k.index,i=j;if(!e&&(f=this.getEndMatch(d,c,f)))if(e=d.rule.applyEndPatternLast,i===-1||f.index<b||
!e&&f.index===b)return{isEnd:!0,rule:d.rule,match:f};return i===-1?null:{isSub:!0,rule:h[i],match:a[i]}},getInitialExpected:function(a,d){var f,e;if(a===this._tree)for(f=0;f<a.children.length;f++){if(e=a.children[f],e.start>=d)return e}else if(a instanceof this.BeginEndNode&&a.endMatch){var h=a.endMatch.index;for(f=0;f<a.children.length;f++)if(e=a.children[f],e.start>=d)break;if(e&&e.start<h)return e}return a},getNextExpected:function(a,d){if(d==="begin"){var f=a.children[0];return f?f:a}else if(d===
"end"&&(f=a.parent)){var e=f.children[f.children.indexOf(a)+1];return e?e:f}return null},prune:function(a,d){if(d.parent===a)a.children.length=d.getIndexInParent();else if(a instanceof this.BeginEndNode)a.endMatch=null,a.end=null;if(a.parent)a.parent.children.length=a.getIndexInParent()+1},onLineStyle:function(a){this._tree||this.initialParse();var d=a.lineStart,f=this.textView.getModel(),e=f.getLineEnd(a.lineIndex),h=f.getLineEnd(f.getLineAtOffset(d)-1),h=this.getFirstDamaged(h,h),d=this.getLineScope(f,
h,d,e);a.ranges=this.toStyleRanges(d);a.ranges.sort(function(a,b){return a.start-b.start})},getLineScope:function(a,d,f,e){for(var h=f,c=this.getInitialExpected(d,f),b=[],i=[];d&&h<e;){var j=this.getNextMatch(a,d,h);if(!j)break;var k=j&&j.match,r=j&&j.rule,q=j&&j.isSub,j=j&&j.isEnd;k.index!==h&&i.push({start:h,end:k.index,node:d});if(q)h=this.afterMatch(k),r instanceof this.BeginEndRule?(this.addBeginScope(b,k,r),d=c,c=this.getNextExpected(c,"begin")):this.addMatchScope(b,k,r);else if(j)h=this.afterMatch(k),
this.addEndScope(b,k,r),c=this.getNextExpected(c,"end"),d=d.parent}h<e&&i.push({start:h,end:e,node:d});a=this.getInheritedLineScope(i,f,e);return b.concat(a)},getInheritedLineScope:function(a){for(var d=[],f=0;f<a.length;f++)for(var e=a[f],h=e.node;h;){var c=h.rule.rule,b=c.name;if(c=c.contentName||b){this.addScopeRange(d,e.start,e.end,c);break}h=h.parent}return d},addBeginScope:function(a,d,f){var e=f.rule;this.addCapturesScope(a,d,e.beginCaptures||e.captures,f.isComplex,f.beginOld2New,f.beginConsuming)},
addEndScope:function(a,d,f){var e=f.rule;this.addCapturesScope(a,d,e.endCaptures||e.captures,f.isComplex,f.endOld2New,f.endConsuming)},addMatchScope:function(a,d,f){var e=f.rule,h=e.name;(e=e.captures)?this.addCapturesScope(a,d,e,f.isComplex,f.matchOld2New,f.matchConsuming):this.addScope(a,d,h)},addScope:function(a,d,f){f&&a.push({start:d.index,end:this.afterMatch(d),scope:f})},addScopeRange:function(a,d,f,e){e&&a.push({start:d,end:f,scope:e})},addCapturesScope:function(a,d,f,e,h,c){if(f)if(e){for(var e=
{1:0},b=0,i=1;d[i]!==void 0;i++)c[i]!==void 0&&(b+=d[i].length),d[i+1]!==void 0&&(e[i+1]=b);c=d.index;for(b=1;f[b];b++){var i=f[b].name,j=h[b],k=c+e[j];typeof d[j]!=="undefined"&&this.addScopeRange(a,k,k+d[j].length,i)}}else this.addScope(a,d,f[0]&&f[0].name)},getIntersecting:function(a,d){for(var f=[],e=this._tree?[this._tree]:[];e.length;){var h=e.pop(),c=!1;h instanceof this.ContainerNode?c=!0:this.isDamaged(h,a,d)&&(c=!0,f.push(h));if(c)for(var c=h.children.length,b=0;b<c;b++)e.push(h.children[b])}return f.reverse()},
toStyleRanges:function(a){for(var d=[],f=0;f<a.length;f++){var e=a[f],h=this._styles[e.scope];if(!h)throw Error("styles not found for "+e.scope);h=h.join(" ");d.push({start:e.start,end:e.end,style:{styleClass:h}})}return d}};return{RegexUtil:d,TextMateStyler:i}});
define("orion/editor/AsyncStyler",["i18n!orion/editor/nls/messages","orion/editor/annotations"],function(j,k){function i(d){return d.getProperty("objectClass").indexOf(a)!==-1&&d.getProperty("type")==="highlighter"}function d(a,e,d){this.initialize(a,e,d);this.lineStyles=[]}var a="orion.edit.highlighter",g=a+" service must be an event emitter";k.AnnotationType.registerType("orion.annotation.highlightError",{title:j.syntaxError,html:"<div class='annotationHTML error'></div>",rangeStyle:{styleClass:"annotationRange error"}});
d.prototype={initialize:function(d,e,h){this.textView=d;this.serviceRegistry=e;this.annotationModel=h;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))}};d.addEventListener("ModelChanging",this.listener.onModelChanging);d.addEventListener("ModelChanged",this.listener.onModelChanged);d.addEventListener("Destroy",this.listener.onDestroy);d.addEventListener("LineStyle",this.listener.onLineStyle);e.addEventListener("registered",this.listener.onServiceAdded);e.addEventListener("unregistering",this.listener.onServiceRemoved);d=e.getServiceReferences(a);for(h=0;h<d.length;h++){var b=d[h];i(b)&&this.addServiceListener(e.getService(b))}},
onDestroy:function(){this.destroy()},destroy:function(){if(this.textView)this.textView.removeEventListener("ModelChanging",this.listener.onModelChanging),this.textView.removeEventListener("ModelChanged",this.listener.onModelChanged),this.textView.removeEventListener("Destroy",this.listener.onDestroy),this.textView.removeEventListener("LineStyle",this.listener.onLineStyle),this.textView=null;if(this.services){for(var a=0;a<this.services.length;a++)this.removeServiceListener(this.services[a]);this.services=
null}if(this.serviceRegistry)this.serviceRegistry.removeEventListener("registered",this.listener.onServiceAdded),this.serviceRegistry.removeEventListener("unregistering",this.listener.onServiceRemoved),this.serviceRegistry=null;this.lineStyles=this.listener=null},onModelChanging:function(a){this.startLine=this.textView.getModel().getLineAtOffset(a.start)},onModelChanged:function(a){var e=this.startLine;(a.addedLineCount||a.removedLineCount)&&Array.prototype.splice.apply(this.lineStyles,[e,a.removedLineCount].concat(this._getEmptyStyle(a.addedLineCount)))},
onStyleReady:function(a){var e=a.lineStyles||a.style,a=Number.MAX_VALUE,d=-1,c=this.textView.getModel(),b;for(b in e)Object.prototype.hasOwnProperty.call(e,b)&&(this.lineStyles[b]=e[b],a=Math.min(a,b),d=Math.max(d,b));a=Math.max(a,0);d=Math.min(d,c.getLineCount());if(e=this.annotationModel){for(var g=e.getAnnotations(c.getLineStart(a),c.getLineEnd(d)),i=[];g.hasNext();){var j=g.next();j.type==="orion.annotation.highlightError"&&i.push(j)}g=[];for(j=a;j<=d;j++){b=j;var r=this.lineStyles[b],r=r&&r.errors;
b=c.getLineStart(b);if(r)for(var q=0;q<r.length;q++){var s=r[q];g.push(k.AnnotationType.createAnnotation("orion.annotation.highlightError",s.start+b,s.end+b))}}e.replaceAnnotations(i,g)}this.textView.redrawLines(a,d+1)},onLineStyle:function(a){function e(a,b){for(var e=a.length,d=[],f=0;f<e;f++){var h=a[f];d.push({start:h.start+b,end:h.end+b,style:h.style})}return d}var d=this.lineStyles[a.lineIndex];if(d)if(d.ranges)a.ranges=e(d.ranges,a.lineStart);else if(d.style)a.style=d.style},_getEmptyStyle:function(a){for(var e=
[],d=0;d<a;d++)e.push(null);return e},setContentType:function(a){this.contentType=a;if(this.services)for(a=0;a<this.services.length;a++){var e=this.services[a];if(e.setContentType){var d=this.serviceRegistry.getService("orion.page.progress");d?d.progress(e.setContentType(this.contentType),"Styling content type: "+this.contentType.id?this.contentType.id:this.contentType):e.setContentType(this.contentType)}}},onServiceAdded:function(a,e){i(a)&&this.addServiceListener(e)},onServiceRemoved:function(a,
e){this.services.indexOf(e)!==-1&&this.removeServiceListener(e)},addServiceListener:function(a){if(typeof a.addEventListener==="function"){if(a.addEventListener("orion.edit.highlighter.styleReady",this.listener.onStyleReady),this.services.push(a),a.setContentType&&this.contentType){var e=this.serviceRegistry.getService("orion.page.progress");e?e.progress(a.setContentType(this.contentType),"Styling content type: "+this.contentType.id?this.contentType.id:this.contentType):a.setContentType(this.contentType)}}else typeof console!==
"undefined"&&console.log(Error(g))},removeServiceListener:function(a){typeof a.removeEventListener==="function"?(a.removeEventListener("orion.edit.highlighter.styleReady",this.listener.onStyleReady),a=this.services.indexOf(a),a!==-1&&this.services.splice(a,1)):typeof console!=="undefined"&&console.log(Error(g))}};return d});
define("orion/highlight",["examples/editor/textStyler","orion/editor/textStyler","orion/editor/textMateStyler","orion/editor/AsyncStyler","orion/Deferred"],function(j,k,i,d,a){function g(f,c,b,g,m,o,r){function q(e,d){var f=e.getProperty("contentType")||e.getProperty("contentTypes"),h=e.getProperty("fileTypes");if(f)return a.when(c.isSomeExtensionOf(b,f)).then(function(a){return a?e:null});else if(d&&h&&h.indexOf(d)!==-1)return f=new a,f.resolve(e),f;return null}function s(a){var b=null;switch(a&&
a.id){case "application/javascript":case "application/json":b=new j.TextStyler(g,"js",m);break;case "text/x-java-source":b=new j.TextStyler(g,"java",m);break;case "text/css":b=new j.TextStyler(g,"css",m)}return b}if(!e){var u=s(b);if(u)return o=new a,o.resolve(u),o}if(e&&!this.orionGrammars)this.orionGrammars={};for(var u=o&&o.split(".").pop().toLowerCase(),o=f.getServiceReferences("orion.edit.highlighter"),p=[],t=[],v=0;v<o.length;v++){var n=o[v],w=n.getProperty("type");w==="grammar"||!e&&typeof w===
"undefined"?p.push(n.getProperty("grammar")):w!=="highlighter"&&(w=n.getProperty("id"))&&!this.orionGrammars[w]&&(this.orionGrammars[w]={id:w,contentTypes:n.getProperty("contentTypes"),patterns:n.getProperty("patterns"),repository:n.getProperty("repository")});(n=q(n,u))&&t.push(n)}return a.all(t,function(a){return{_error:a}}).then(function(a){for(var c,j=a.length-1;j>=0;j--){var n=a[j];if(n&&!n._error&&(r||n.getProperty("type")!=="highlighter")){c=n;break}}var o;if(c)if(a=c.getProperty("type"),a===
"highlighter")o=new d(g,f,m),o.setContentType(b);else if(a==="grammar"||!e&&typeof a==="undefined")c=c.getProperty("grammar"),o=new i.TextMateStyler(g,c,p);else if(e){o=[];for(var t in this.orionGrammars)o.push(this.orionGrammars[t]);o=new k.TextStyler(g,m,o,c.getProperty("id"))}return o})}function f(a,c){this.serviceRegistry=a;this.contentTypeService=c;this.styler=null}var e=1;f.prototype={setup:function(a,c,b,e,d){d=typeof d==="undefined"?!0:d;if(this.styler)this.styler.destroy&&this.styler.destroy(),
this.styler=null;var f=this;return g(this.serviceRegistry,this.contentTypeService?this.contentTypeService:this.serviceRegistry.getService("orion.core.contentTypeRegistry"),a,c,b,e,d).then(function(a){return f.styler=a})},getStyler:function(){return this.styler}};return{createStyler:g,SyntaxHighlighter:f}});
define("orion/inputCompletion/inputCompletion",["orion/EventTarget"],function(j){function k(i,d,a){j.attach(this);this._binderFunc=d;this.setInputField(i);(i=a?a.group:null)||(i=this._inputField&&this._inputField.id?this._inputField.id:"default__input__group");this._completionIdPrefix=i+"__completion__";this._proposeFromStart=a?a.proposeFromStart:!1;this._extendedProvider=a?a.extendedProvider:null;this._serviceRegistry=a?a.serviceRegistry:null;this._onDelete=a?a.onDelete:null;this._deleteToolTips=
a?a.deleteToolTips:"";this._proposalIndex=-1;this._dismissed=!0;this._mouseDown=!1;this._dataList=[];this._initUI();this._listeners=[];a=function(a){this._binderFunc&&this._binderFunc(function(d){this._bind(d);a.deleting&&(this._proposeOn(this._inputField.value),this._selectProposal(this._proposalIndex,!0))}.bind(this))}.bind(this);this.addEventListener("inputDataListChanged",a);this._listeners.push({evtTarget:this,type:"inputDataListChanged",handler:a});a=function(){this._mouseDown=!0}.bind(this);
this._completionUIContainer.addEventListener("mousedown",a);this._listeners.push({evtTarget:this._completionUIContainer,type:"mousedown",handler:a});a=function(){this._mouseDown=!1}.bind(this);this._completionUIContainer.addEventListener("mouseup",a);this._listeners.push({evtTarget:this._completionUIContainer,type:"mouseup",handler:a})}k.prototype._removeListeners=function(i){i&&i.forEach(function(d){d.evtTarget.removeEventListener(d.type,d.handler,!1)})};k.prototype.destroy=function(){this._removeListeners(this._inputFieldListeners);
this._removeListeners(this.listeners)};k.prototype.hasValueOf=function(i){return this._dataList.some(function(d){return d.value===i})};k.prototype.setInputField=function(i){this._inputField&&this._inputFieldListeners&&this._removeListeners(this._inputFieldListeners);this._inputFieldListeners=[];this._inputField=i;if(typeof this._inputField==="string")this._inputField=document.getElementById(this._inputField);i=function(){this._mouseDown?window.setTimeout(function(){this._inputField.focus()}.bind(this),
200):this._dismiss()}.bind(this);this._inputField.addEventListener("blur",i);this._inputFieldListeners.push({evtTarget:this._inputField,type:"blur",handler:i});i=function(d){this.onKeyDown(d)}.bind(this);this._inputField.addEventListener("keydown",i);this._inputFieldListeners.push({evtTarget:this._inputField,type:"keydown",handler:i});i=function(){this._proposeOn(this._inputField.value)}.bind(this);this._inputField.addEventListener("input",i);this._inputFieldListeners.push({evtTarget:this._inputField,
type:"input",handler:i});i=function(){if(this._dismissed&&this._binderFunc)this._dismissing?this._dismissing=!1:this._binderFunc&&this._binderFunc(function(d){this._bind(d)}.bind(this))}.bind(this);this._inputField.addEventListener("focus",i);this._inputFieldListeners.push({evtTarget:this._inputField,type:"focus",handler:i})};k.prototype.onKeyDown=function(i){if(this._dismissed)return!0;var d=i.charCode||i.keyCode;if(d===13){if(this._proposalList&&this._proposalList.length>0&&this._proposalIndex>=
0&&this._proposalIndex<this._proposalList.length)return i.preventDefault(),this._dismiss(this._proposalList[this._proposalIndex].item.value,i.ctrlKey),i.stopPropagation(),!1}else if((d===40||d===38)&&this._proposalList&&this._proposalList.length>0)return i.preventDefault(),this._walk(d===40),i.stopPropagation(),!1;else if(d===27)return i.preventDefault(),this._dismiss(),!1;else if(d===46&&this._proposalIndex>-1&&this._onDelete)return i.preventDefault(),this._onDelete(this._proposalList[this._proposalIndex].item.value,
this),this._resetIndexAfterDeletion(),i.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(i){this._dataList=i};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(i,d,a,g){var f=
document.createElement("a");f.href=require.toUrl(d);f.appendChild(this._createBoldText(i,a,g));return f};k.prototype._createBoldText=function(i,d,a,g){if(d<0)return document.createTextNode(i);var g=g?g:document.createElement("span"),f;0!==d&&(f=document.createTextNode(i.substring(0,d)),g.appendChild(f));var e=document.createElement("b");g.appendChild(e);f=document.createTextNode(i.substring(d,d+a));e.appendChild(f);d+a<i.length&&(f=document.createTextNode(i.substring(d+a)),g.appendChild(f));return g};
k.prototype._proposeOnCategory=function(i,d){if(d.length!==0){var a;if(i){a=document.createElement("li");a.className="inputCompletionLICategory";var g=document.createTextNode(i);a.appendChild(g);this._completionUL.appendChild(a)}d.forEach(function(d){a=document.createElement("li");a.onmouseover=function(a){this._selectProposal(a.currentTarget)}.bind(this);a.onclick=function(a){this._dismiss(a.currentTarget.completionItem.value)}.bind(this);a.className="inputCompletionLINormal";a.completionItem=d.item;
var e;if(typeof d.item.value==="string"){var h=document.createElement("table");h.style.width="100%";h.style.tableLayout="fixed";h.style.borderSpacing="0";var c=document.createElement("tr");c.style.width=this._inputField.offsetWidth+"px";h.appendChild(c);var b=document.createElement("td");b.classList.add("inputCompletionLILeftTD");var g=this._createBoldText(d.item.value,d.boldIndex,d.boldLength);b.appendChild(g);b.style.overflow="hidden";c.appendChild(b);if(this._onDelete)e=document.createElement("button"),
e.classList.add("inputCompletionDismissButton"),e.classList.add("layoutRight"),e.classList.add("core-sprite-close"),e.classList.add("imageSprite"),e.style.display="none",e.style.margin="0 0 0",e.title=this._deleteToolTips,e.onclick=function(a){a.stopPropagation();this._onDelete(d.item.value,this);this._resetIndexAfterDeletion()}.bind(this),b=document.createElement("td"),b.classList.add("inputCompletionLIRightTD"),b.appendChild(e),c.appendChild(b);a.appendChild(h)}else d.item.value.name&&d.item.value.type===
"link"&&a.appendChild(this._createProposalLink(d.item.value.name,d.item.value.value,d.boldIndex,d.boldLength));this._completionUL.appendChild(a);this._proposalList.push({item:d.item,domNode:a,deleteBtn:e})}.bind(this))}};k.prototype._domNode2Index=function(i){if(this._proposalList)for(var d=0;d<this._proposalList.length;d++)if(this._proposalList[d].domNode===i)return d;return-1};k.prototype._highlight=function(i,d){var a=i,g,f=!1;if(!isNaN(a))f=!0,this._proposalList&&i>=0&&i<this._proposalList.length?
(a=this._proposalList[i].domNode,g=this._proposalList[i].deleteBtn):a=null;if(a){a.className=d?"inputCompletionLISelected":"inputCompletionLINormal";if(g)g.style.display=d?"":"none";d&&f&&(a.offsetTop<this._completionUIContainer.scrollTop?a.scrollIntoView(!0):a.offsetTop+a.offsetHeight>this._completionUIContainer.scrollTop+this._completionUIContainer.clientHeight&&a.scrollIntoView(!1))}};k.prototype._selectProposal=function(i,d){var a=i;isNaN(a)&&(a=this._domNode2Index(i));if(a!==this._proposalIndex||
d)this._highlight(this._proposalIndex,!1),this._proposalIndex=a,this._highlight(this._proposalIndex,!0)};k.prototype._dismiss=function(i,d){if(!this._mouseDown){this._dismissed=!0;this._proposalList=null;this._proposalIndex=-1;if(typeof i==="string")this._inputField.value=i,this._dismissing=!0,this._inputField.focus();else if(i&&i.name&&i.type==="link")d?window.open(i.value):window.location.href=i.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 i=0,d=0,a=this._inputField;a;)i+=a.offsetLeft,d+=a.offsetTop,a=a.offsetParent;this._completionUIContainer.style.display="block";this._completionUIContainer.style.top=d+this._inputField.offsetHeight+2+"px";this._completionUIContainer.style.left=i+"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(i){i=this._proposalIndex+(i?1:-1);i<-1?i=this._proposalList.length-1:i>=this._proposalList.length&&(i=-1);this._selectProposal(i)};k.prototype._proposeOnList=function(i,d,a){var g="",f=[],e=d?d.length:0;i.forEach(function(h){if(h.type==="category")this._proposeOnCategory(g,f),g=h.label,f=[];else{var c=!0,b=-1;if(d&&a){var i;typeof h.value==="string"?i=h.value.toLowerCase():h.value.name&&(i=h.value.name.toLowerCase());
b=i.indexOf(d);b<0?c=!1:this._proposeFromStart&&(c=b===0)}c&&f.push({item:h,boldIndex:b,boldLength:e})}}.bind(this));this._proposeOnCategory(g,f)};k.prototype._proposeOn=function(i){this._completionUL.textContent="";var d=i?i.toLowerCase():null;this._proposalList=[];this._proposeOnList(this._dataList,d,!0);this._extendedProvider&&d?this._extendedProvider(i,function(a){a&&a.forEach(function(a){this._proposeOnList(a.proposals,a.filterForMe?d:i,a.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(j,k,i,d,a,g,f){function e(a,c,b,d,e){k.Find.call(this,a,d,e);this._serviceRegistry=c;this._commandService=b}e.prototype=new k.Find;d.mixin(e.prototype,{getFindString:function(){var a=document.getElementById("localSearchFindWith");return!a?k.Find.prototype.getFindString.call(this):
a.value},getReplaceString:function(){var a=document.getElementById("localSearchReplaceWith");return!a?k.Find.prototype.getReplaceString(this):a.value},hide:function(){var a=this.isVisible();k.Find.prototype.hide.call(this);a&&this._commandService.closeParameterCollector()},show:function(a){k.Find.prototype.show.call(this,a);var c=a.findString;this._addRecentfind(c);var a=a.replaceString,b=document.getElementById("localSearchFindWith");b||(this._createActionTable(),b=document.getElementById("localSearchFindWith"));
if(c)b.value=c;if(a)document.getElementById("localSearchReplaceWith").value=a;window.setTimeout(function(){b.select();b.focus()},10)},_showReplaceInfo:function(){this._regex?(this._replaceInfo.src="data:image/gif;base64,R0lGODlhBwAIAMQAAMzX6cbT5kh4qFiIuKC40FCIuGSXwmWZw2SaxGacxmadxmWcxbPM4GigyJW92JzC26DI0P///////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAABIALAAAAAAHAAgAAAUmoEQUQkFI0PBEz5A2yII0w9AwkUPbRpTsjUNEQUsFIgCXiGSShAAAOw==",this._replaceInfo.title=j["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=j["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 a=this;this._commandService.openParameterCollector("pageNavigationActions",function(c){var b=document.createElement("input");b.type="text";b.name=j["Find:"];b.className="parameterInput";b.id="localSearchFindWith";b.placeholder=
j["Find With"];b.oninput=function(b){return a._handleInput(b)};b.onkeydown=function(b){return a._handleKeyDown(b)};c.appendChild(b);a._initCompletion(b);a._createButton(j.Next,c,function(){a._addRecentfind(a.getFindString());a.find(!0)});a._createButton(j.Previous,c,function(){a._addRecentfind(a.getFindString());a.find(!1)});var d=a._editor.getTextView().getOptions("readonly");if(!d){var e=document.createElement("input");e.type="text";e.name=j["ReplaceWith:"];e.className="parameterInput";e.id="localSearchReplaceWith";
e.placeholder=j["Replace With"];e.onkeydown=function(b){return a._handleKeyDown(b)};c.appendChild(e);a._replaceInfo=a._createInfoImage(null,c,null);a._showReplaceInfo();a._createButton(j.Replace,c,function(){a.replace()});a._createButton(j["Replace All"],c,function(){a.replaceAll()})}e=document.createElement("div");c.appendChild(e);e.classList.add("findOptionsDiv");var f=i.createDropdownMenu(e,j.Options,null,"dismissButton",null,!0);f.menuButton.classList.add("parameterInlineButton");i.createCheckedMenuItem(f.menu,
j["Show all"],a._showAll,function(b){a.setOptions({showAll:b.target.checked});f.dropdown.close(!0)});i.createCheckedMenuItem(f.menu,j["Case sensitive"],!a._caseInsensitive,function(b){a.setOptions({caseInsensitive:!b.target.checked});f.dropdown.close(!0);a.find(!0)});i.createCheckedMenuItem(f.menu,j["Wrap search"],a._wrap,function(b){a.setOptions({wrap:b.target.checked});f.dropdown.close(!0)});i.createCheckedMenuItem(f.menu,j["Incremental search"],a._incremental,function(b){a.setOptions({incremental:b.target.checked});
f.dropdown.close(!0)});i.createCheckedMenuItem(f.menu,j["Whole Word"],a._wholeWord,function(b){a.setOptions({wholeWord:b.target.checked});f.dropdown.close(!0);a.find(!0)});a._regExBox=i.createCheckedMenuItem(f.menu,j["Regular expression"],a._regex,function(b){a.setOptions({regex:b.target.checked});f.dropdown.close(!0);a.find(!0);a._showReplaceInfo()});d||i.createCheckedMenuItem(f.menu,j["Find after replace"],a._findAfterReplace,function(b){a.setOptions({findAfterReplace:b.target.checked});f.dropdown.close(!0)});
return b},function(){a.hide()})},_storeRecentFind:function(a,c,b){this._serviceRegistry.getService("orion.core.preference").getPreferences("/window/favorites").then(function(e){e.put("recentFind",a);c&&window.setTimeout(function(){c.dispatchEvent({type:"inputDataListChanged",deleting:b})}.bind(this),20)})},_addRecentfind:function(a){typeof a==="string"&&a&&(!this._completion||!this._completion.hasValueOf(a))&&this._serviceRegistry.getService("orion.core.preference").getPreferences("/window/favorites").then(function(c){var b,
c=c.get("recentFind");typeof c==="string"&&(c=JSON.parse(c));if(c){for(b in c)if(c[b].name===a)return;c.length>=30&&c.splice(29,c.length-30+1)}else c=[];c.splice(0,0,{name:a});this._storeRecentFind(c,this._completion)}.bind(this))},_removeRecentSearch:function(a,c){typeof a==="string"&&a&&this._serviceRegistry.getService("orion.core.preference").getPreferences("/window/favorites").then(function(b){var e,b=b.get("recentFind");typeof b==="string"&&(b=JSON.parse(b));if(b)for(e in b)if(b[e].name===a){b.splice(e,
1);this._storeRecentFind(b,c,!0);break}}.bind(this))},_initCompletion:function(a){if(this._completion)this._completion.setInputField(a);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 e=[];c.forEach(function(a){e.push({type:"proposal",label:a.name,value:a.name})});a(e)}})}.bind(this);this._completion=new g.InputCompletion(a,c,{serviceRegistry:this._serviceRegistry,
group:"localSearch",onDelete:function(a,c){this._removeRecentSearch(a,c)}.bind(this),deleteToolTips:j["Click or use delete key to delete the search term"]})}},_createButton:function(a,c,b){var e=document.createElement("button");e.addEventListener("click",b.bind(this),!1);var d=this;e.addEventListener("keydown",function(a){a.keyCode===f.KEY.ESCAPE&&d.hide()});e.appendChild(document.createTextNode(a));e.className="dismissButton parameterInlineButton";c.appendChild(e)},_createInfoImage:function(a,c){var b=
document.createElement("img");b.classList.add("replaceInfo");b.addEventListener("click",function(){this._regExBox.checked=!this._regex;this.setOptions({regex:!this._regex});this.find(!0);this._showReplaceInfo()}.bind(this));c.appendChild(b);return b},_handleInput:function(){this._incremental&&this.find(!0,null,!0);return!0},_handleKeyDown:function(a){var c=(this.isMac?a.metaKey:a.ctrlKey)&&!a.altKey&&!a.shiftKey;if(c&&a.keyCode===70)return a.stopPropagation&&a.stopPropagation(),a.cancelBubble=!0,
!1;if((this.isMac?a.metaKey:a.ctrlKey)&&!a.altKey&&a.keyCode===75||a.keyCode===13)return a.stopPropagation&&a.stopPropagation(),a.cancelBubble=!0,this._addRecentfind(this.getFindString()),a.keyCode===13?this.find(this._reverse?a.shiftKey:!a.shiftKey):this.find(!a.shiftKey),!1;if(c&&a.keyCode===82)return a.stopPropagation&&a.stopPropagation(),a.cancelBubble=!0,this.replace(),!1;return a.keyCode===27?(this.hide(),!1):!0}});return{TextSearcher:e}});
define("orion/blamer",["orion/extensionCommands","orion/PageLinks","orion/URITemplate"],function(j,k,i){function d(a,d){for(var f=d.getFileMetadata(),e=a.getServiceReferences("orion.edit.blamer"),h=0;h<e.length;h++){var c=e[h],b={};b.validationProperties=c.getProperty("validationProperties");b.forceSingleItem=!0;b=j._makeValidator(b,a);if(b.validationFunction.bind(b)(f))return a.getService(c)}return null}return{isVisible:function(a,g){return!!d(a,g)&&!!a.getService("orion.core.blame")},getBlame:function(a,
g){var f=d(a,g);f&&f.doBlame(g.getInput()).then(function(e){for(var d=k.getOrionHome(),c=0;c<e.length;c++){var b=e[c],f=new i(b.CommitLink),g={};g.OrionHome=d;b.CommitLink=f.expand(g)}a.getService("orion.core.blame")._setAnnotations(e)})}}});
define("orion/edit/editorContext",[],function(){return{getEditorContext:function(j){var k=Object.create(null);j.getServiceReferences("orion.edit.context").forEach(function(i){var d=j.getService(i);Object.keys(d).forEach(function(a){typeof d[a]==="function"&&(k[a]=d[a].bind(d))})});return k},getOptions:function(j){var k=Object.create(null);j.getServiceReferences("orion.edit.context").forEach(function(i){i.getPropertyKeys().forEach(function(d){d!=="service.id"&&d!=="service.names"&&d!=="objectClass"&&
(k[d]=i.getProperty(d))})});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(j,k,i,d,a,g,f,e,h,c,b,l,m,o,r,q,s,u,p,t){function v(a){var b=
new f(a.uriTemplate),c=a.params||{};c.OrionHome=c.OrionHome||r.getOrionHome();var b=b.expand(c),c=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=b;e.className="delegatedUI";if(a.width)c.style.width=a.width,e.style.width=a.width;if(a.height)c.style.height=a.height,e.style.height=a.height;e.style.visibility="hidden";a.parent!==null&&(a.parent||window.document.body).appendChild(c);
c.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 z(b){if(b.source===e.contentWindow&&typeof b.data==="string"&&(b=JSON.parse(b.data),b.pageService==="orion.page.delegatedUI"&&b.source===a.id)){if(b.cancelled)a.cancelled&&a.cancelled();else if(b.result)a.done&&a.done(b.result);else if(b.Status||b.status)a.status&&a.status(b.Status||
b.status);window.removeEventListener("message",z,!1);e.parentNode.removeChild(e)}},!1);return c}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 w={},x=null;w.createDelegatedUI=v;n.prototype={generateSimpleEditorCommands:function(a,b){this.isReadOnly||(this._generateUndoStackCommands(a),this._generateSaveCommand(a,b));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(b){var c=this,d=new e.Command({imageClass:"core-sprite-wrench",tooltip:j.LocalEditorSettings,id:"orion.edit.settings",visibleWhen:function(){return b.installed},callback:function(e){var f=d.settingsDropDown;if(!f||
f.isDestroyed())f=d.settingsDropDown=new a(e.domNode.parentNode,e.domNode,{noClick:!0,selectionClass:"dropdownSelection",onShow:function(){f.focus()},onHide:function(){b.focus()}}),f.updateContent=c.localSettings.show.bind(c.localSettings),e=f.getContentNode(),e.tabIndex=e.style.marginTop=0;f.click()}});this.commandService.addCommand(d);this.commandService.registerCommandContribution("settingsActions","orion.edit.settings",1,null,!1,new h.KeyBinding("s",!0,!0))},_generateUndoStackCommands:function(a){this.commandService.addCommand(new e.Command({name:j.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 h.KeyBinding("z",!0));this.commandService.addCommand(new e.Command({name:j.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,p.isMac?new h.KeyBinding("z",!0,!0):new h.KeyBinding("y",!0))},_generateSearchFilesCommand:function(a){var b=this;if(b._searcher){var c=!1;this.commandService.addCommand(new e.Command({name:j.searchFiles,tooltip:j.searchFiles,id:"orion.searchFiles",visibleWhen:function(){return a.installed},callback:function(){if(!c){var e=a.getSelection(),e=a.getText(e.start,e.end),f=b.serviceRegistry.getService("orion.page.progress"),
g=new d.OpenResourceDialog({searcher:b._searcher,progress:f,searchRenderer:b._searcher.defaultRenderer,nameSearch:!1,title:j.searchFiles,message:j.searchTerm,initialText:e,onHide:function(){c=!1;a.focus()}});window.setTimeout(function(){c=!0;g.show(i.node(b.toolbarId))},0)}}}));this.commandService.registerCommandContribution(this.editToolbarId||this.pageNavId,"orion.searchFiles",1,this.editToolbarId?"orion.menuBarEditGroup/orion.findGroup":null,!this.editToolbarId,new h.KeyBinding("h",!0))}},_generateSaveCommand:function(a,
b){var c=this,d=b?b:"orion.save",f=new e.Command({name:j.Save,tooltip:j.saveFile,id:d,visibleWhen:function(){return!a.installed||c.inputManager.getReadOnly()?!1:!0},callback:function(){c.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 h.KeyBinding("s",!0));a.getTextView&&a.getTextView()&&(a.getTextView().setKeyBinding(new h.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 e.Command({name:j.gotoLine,tooltip:j.gotoLineTooltip,id:"orion.gotoLine",visibleWhen:function(){return a.installed},parameters:d,callback:function(b){var c=
a.getModel();b.parameters&&b.parameters.valueFor("line")?b=b.parameters.valueFor("line"):(b=c.getLineAtOffset(a.getCaretOffset()),(b=prompt(j.gotoLinePrompt,b+1))&&(b=parseInt(b,10)));if(b)a.onGotoLine(b-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 h.KeyBinding("l",!p.isMac,!1,!1,p.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 e=a.getSelection(),d="";e.end>e.start&&(d=a.getModel().getText(e.start,e.end),b._localSearcher&&b._localSearcher.getOptions().regex&&(d=
u.escape(d)));return[new c.CommandParameter("find","text","Find:",d)]}),d=new e.Command({name:j.Find,tooltip:j.Find,id:"orion.editor.find",visibleWhen:function(){return a.installed},parameters:d,callback:function(c){if(b._localSearcher){var e="",d=null,f=a.getSelection();f.end>f.start&&c.parameters.valueFor("useEditorSelection")?(e=a.getModel().getText(f.start,f.end),b._localSearcher.getOptions().regex&&(e=u.escape(e))):c.parameters&&c.parameters.valueFor("find")&&(e=c.parameters.valueFor("find"),
d=o.matchResourceParameters(),m.convertFindURLBinding(d));if(d){b._localSearcher.setOptions({regex:d.regEx,caseInsensitive:!d.caseSensitive});c={};if(d.atLine)c.start=a.getModel().getLineStart(d.atLine-1);b._localSearcher.show({findString:e,replaceString:d.replaceWith});b._localSearcher.find(!0,c)}else b._localSearcher.show({findString:e});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 h.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 e.Command({name:j.Blame,
tooltip:j.BlameTooltip,id:"orion.edit.blame",parameters:new c.ParametersDescription([new c.CommandParameter("blame","boolean")],{clientCollect:!0}),visibleWhen:function(){return!a.installed?!1:s.isVisible(b.serviceRegistry,b.inputManager)},callback:function(c){for(var e=!1,d=a.getAnnotationModel().getAnnotations();d.hasNext();)if(d.next().type===q.AnnotationType.ANNOTATION_BLAME){e=!0;break}e=!e;c.parameters&&c.parameters.valueFor("blame")&&(e=c.parameters.valueFor("blame")==="true");e?s.getBlame(b.serviceRegistry,
b.inputManager):a.showBlame([])}}));this.commandService.registerCommandContribution(this.toolbarId,"orion.edit.blame",1,"orion.menuBarToolsGroup",!1,new h.KeyBinding("b",!0,!0),new c.URLBinding("blame","blame"))},_generateEditCommands:function(a){function c(a){if(!a)return null;var b=new h.KeyBinding;h.KeyBinding.apply(b,a);return b}function d(a,b){!b&&a&&typeof a.HTML!=="undefined"&&delete a.HTML;var c=f.serviceRegistry.getService("orion.page.message");c?c.setProgressResult(a):window.console.log(a)}
var f=this,m=this.toolbarId,n=this.serviceRegistry,o=n.getServiceReferences("orion.edit.command"),p=this.inputManager,q=n.getService("orion.page.progress"),r=function(b,c,g){var h=g.visibleWhen;g.visibleWhen=function(b){return!a.installed||f.inputManager.getReadOnly()?!1:!h||h(b)};g.callback=function(){a=this;var e=a.getSelection?a.getSelection():{start:0,end:0},f=a.getModel(),g=function(b){typeof b==="object"&&b?(b.text&&a.setText(b.text),b.selection&&(a.setSelection&&a.setSelection(b.selection.start,
b.selection.end,!0),a.focus())):typeof b==="string"&&(a.setText(b,e.start,e.end,!0),a.setSelection&&a.setSelection(e.start,e.start+b.length),a.focus())},h;c.execute?(f={contentType:p.getContentType(),input:p.getInput()},h=t.getEditorContext(n),h.openDelegatedUI=v,h.setStatus=d,f=c.execute(h,f),h=null):(f=c.run(f.getText(e.start,e.end),f.getText(),e,p.getInput()),h=function(a){if(a&&a.uriTemplate){var c={};c.uriTemplate=a.uriTemplate;c.params=p.getFileMetadata();c.id=b.id;c.width=a.width;c.height=
a.height;c.done=g;c.status=d;v(c)}else a&&(a.Status||a.status)?d(a.Status||a.status):g(a)});q.showWhile(f,k.formatMessage(j.running,b.name)).then(h);return!0};g.callback=g.callback.bind(a);return new e.Command(g)};g.when(function(a){if(x)return x;var b=a.getService("orion.core.contentTypeRegistry");b||(b=new l.ContentTypeRegistry(a),b=a.getService("orion.core.contentTypeRegistry"));return b.getContentTypes().then(function(a){return x=a})}(this.serviceRegistry),function(){var e=[],d=100;o.forEach(function(g){var h=
g.getProperty("editor");if(!h||!(a.id&&h!==a.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=b._createCommandOptions(j,g,f.serviceRegistry,x,!1,function(){return p.getFileMetadata()});e.push(g);g.then(function(a){a=r(j,i,a);f.commandService.addCommand(a);f.commandService.registerCommandContribution(f.toolbarId,a.id,d,"orion.menuBarToolsGroup",!1,c(j.key))});d++}});g.all(e,function(a){return{_error:a}}).then(function(){var b;
if(b=p.getFileMetadata()){var c=i.node(m);c&&(f.commandService.destroy(c),f.commandService.renderCommands(c.id,c,b,a,"button"));if(c=i.node("pageNavigationActions"))f.commandService.destroy(c),f.commandService.renderCommands(c.id,c,a,a,"button")}})})}};w.EditorCommandFactory=n;return w});
define("orion/inputManager","i18n!orion/edit/nls/messages,orion/i18nUtil,orion/Deferred,orion/EventTarget,orion/objects,orion/PageUtil".split(","),function(j,k,i,d,a,g){function f(a){this._document=a.document||document;this._timeout=a.timeout;for(var a="keypress,keydown,keyup,mousemove,mousedown,mousemove".split(","),b=function(){this._resetTimer()}.bind(this),e=0;e<a.length;e++)this._document.addEventListener(a[e],b,!0);d.attach(this)}function e(a,b){if(a){if(!b.Severity){var e=b,d={Severity:"Error",
Message:j.noResponse};if(e.status!==0)if(e.responseText){e=e.responseText;try{var f=JSON.parse(e);d.Severity=f.Severity||d.Severity;d.Message=f.Message||d.Message}catch(g){d.Message=e}}else try{d.Message=JSON.stringify(e)}catch(h){}b=d}a.setProgressResult(b)}else window.console.log(b)}function h(a){d.attach(this);this.serviceRegistry=a.serviceRegistry;this.statusService=a.statusService;this.fileClient=a.fileClient;this.progressService=a.progressService;this.contentTypeRegistry=a.contentTypeRegistry;
this.selection=a.selection;this._input=this._title="";this.dispatcher=null;this._unsavedChanges=[]}f.prototype={_resetTimer:function(){var a=this._document.defaultView||this._document.parentWindow;if(this._timer)a.clearTimeout(this._timer),this._timer=null;if(this._timeout!==-1)this._timer=a.setTimeout(function(){this.onIdle({type:"Idle"});this._timer=null;this._resetTimer()}.bind(this),this._timeout)},onIdle:function(a){return this.dispatchEvent(a)},setTimeout:function(a){this._timeout=a;this._resetTimer()}};
a.mixin(h.prototype,{_maybeLoadWorkspace:function(a){var b=this.fileClient;return a===b.fileServiceRootURL(a)?b.loadWorkspace(a).then(function(a){return a.Location}):(new i).resolve(a)},_read:function(a){if(this.cachedMetadata&&this.cachedMetadata.Location===a)return(new i).resolve(this.cachedMetadata);var b=this.fileClient,e=Array.prototype.slice.call(arguments,1);return this._maybeLoadWorkspace(a).then(function(a){return b.read.apply(b,[a].concat(e))})},load:function(){var a=this.getInput();if(a){var b=
this.fileClient,d=this._parsedLocation.resource,f=this.progressService,g=function(a,b,c){return!f?a:f.progress(a,k.formatMessage(b,c))},h=this.getEditor();if(this._fileMetadata)!this._saving&&!this._fileMetadata.Directory&&!this._readonly&&g(b.read(d,!0),j.ReadingMetadata,a).then(function(e){if(this._fileMetadata&&this._fileMetadata.Location===e.Location&&this._fileMetadata.ETag!==e.ETag)this._fileMetadata=e,(!h.isDirty()||window.confirm(j.loadOutOfSync))&&g(b.read(d),j.Reading,a).then(function(b){h.setInput(a,
null,b);this._unsavedChanges=[]}.bind(this))}.bind(this));else{var q=d;if(q.indexOf("/gitapi/commit/")===0){var s=q.indexOf("/file"),u=q.indexOf("?",s);if(u===-1)u=q.length;q=q.substring(s,u);this._readonly=!0}var p=window.setTimeout(function(){p=null;this.reportStatus(k.formatMessage(j.Fetching,a))}.bind(this),800),t=function(){this.reportStatus("");p&&window.clearTimeout(p)}.bind(this),v=function(a){t();var b=null;if(this.serviceRegistry)b=this.serviceRegistry.getService("orion.page.message");else if(this.statusService)b=
this.statusService;e(b,a);this._setNoInput()}.bind(this);this._acceptPatch=null;g(this._read(q,!0),j.ReadingMetadata,q).then(function(e){e?e.Directory?i.when(e.Children||g(b.fetchChildren(e.ChildrenLocation),j.Reading,a),function(b){t();e.Children=b;this._setInputContents(this._parsedLocation,a,b,e)}.bind(this),v):this._isText(e)?g(b.read(d,!1,!0),j.Reading,a).then(function(b){t();if(typeof b!=="string")this._acceptPatch=b.acceptPatch,b=b.result;this._setInputContents(this._parsedLocation,a,b,e)}.bind(this),
v):g(b._getService(d).readBlob(d),j.Reading,a).then(function(b){t();this._setInputContents(this._parsedLocation,a,b,e)}.bind(this),v):v({responseText:k.formatMessage(j.ReadingMetadataError,q)})}.bind(this),v)}}},processParameters:function(a){var b=this.getEditor();b&&b.processParameters&&b.processParameters(a)},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 a=this._fileMetadata;return this._readonly||!a||a.Attributes&&a.Attributes.ReadOnly},getContentType:function(){return this._contentType},onFocus:function(){this._autoSaveEnabled&&this._errorSaving?this.save():this._autoLoadEnabled&&this.load()},onChanging:function(a){if(this._getSaveDiffsEnabled()){var b=this._unsavedChanges.length,e=a.removedCharCount,d=a.start,f=a.start+e,g=0;
a.addedCharCount===0?g=-1:e===0&&(g=1);if(b>0&&g===this.previousChangeType){b=this._unsavedChanges[b-1];if(e===0&&d===b.end+b.text.length){b.text+=a.text;return}if(a.addedCharCount===0&&f===b.start){b.start=d;return}}this.previousChangeType=g;this._unsavedChanges.push({start:d,end:f,text:a.text})}},reportStatus:function(a){this.statusReporter?this.statusReporter(a):this.editor&&this.editor.reportStatus(a)},save:function(){function a(b){if(g===w.getInput())w.getFileMetadata().ETag=b.ETag,d.setInput(g,
null,h,!0);w.reportStatus("");f&&n&&n.setProgressResult({Message:j.Saved,Severity:"Normal"});w.afterSave&&w.afterSave();w._saving=!1}function b(a){w.reportStatus("");e(n,a);w._saving=!1;w._errorSaving=!0}if(!this._saving){var d=this.getEditor();if(d&&d.isDirty()&&!this.getReadOnly()){var f=this._errorSaving;this._saving=!0;var g=this.getInput();this.reportStatus(j["Saving..."]);this.dispatchEvent({type:"Saving",inputManager:this});d.markClean();var h=d.getText(),i=h;if(this._getSaveDiffsEnabled()&&
!this._errorSaving){for(var s=this._unsavedChanges,u=0,p=0;p<s.length;p++)u+=s[p].text.length;h.length>u&&(i={diff:s})}this._unsavedChanges=[];this._errorSaving=!1;var s={ETag:this.getFileMetadata().ETag},t=this._parsedLocation.resource,i=this.fileClient.write(t,i,s),v=this.progressService,n=null;this.serviceRegistry&&(n=this.serviceRegistry.getService("orion.page.message"));v&&(i=v.progress(i,k.formatMessage(j.savingFile,g)));var w=this;i.then(a,function(e){e.status===412?window.confirm(j.saveOutOfSync)?
(e=w.fileClient.write(t,h),v&&(e=v.progress(e,k.formatMessage(j.savingFile,g))),e.then(a,b)):w._saving=!1:b(e)})}}},setAutoLoadEnabled:function(a){this._autoLoadEnabled=a},setAutoSaveTimeout:function(a){this._autoSaveEnabled=a!==-1;this._idle?this._idle.setTimeout(a):(this._idle=new f({document:document,timeout:a}),this._idle.addEventListener("Idle",function(){this._errorSaving||this.save()}.bind(this)))},setContentType:function(a){this._contentType=a},setInput:function(a){if(!this._ignoreInput&&
(a||(a=g.hash()),typeof a==="string")){var b=this.getEditor();a&&a[0]!=="#"&&(a="#"+a);var e=g.matchResourceParameters(a),d=this._parsedLocation||{};if(b&&b.isDirty()){var f=this._location;if(d.resource!==e.resource)if(this._autoSaveEnabled)this.save();else if(!window.confirm(j.confirmUnsavedChanges)){window.location.hash=f;return}}b=b&&d.editor!==e.editor;this._location=a;this._parsedLocation=e;this._ignoreInput=!0;this.selection&&this.selection.setSelections(a);this._ignoreInput=!1;(a=e.resource)?
a===this._input?b?(this.reportStatus(""),this._setInputContents(e,a,null,this._fileMetadata,this._isText(this._fileMetadata))):this.processParameters(e):(this._input=a,this._readonly=!1,this._fileMetadata=null,this.load()):this._setNoInput(!0)}},setTitle:function(a){var b=a.lastIndexOf("/");b!==-1&&(a=a.substring(b+1));this._title=a},setSaveDiffsEnabled:function(a){this._saveDiffsEnabled=a},_getSaveDiffsEnabled:function(){return this._saveDiffsEnabled&&this._acceptPatch!==null&&this._acceptPatch.indexOf("application/json-patch")!==
-1},_isText:function(a){a=this.contentTypeRegistry.getFileContentType(a);if(!a)return!0;var b=this.contentTypeRegistry.getContentType("text/plain");return this.contentTypeRegistry.isExtensionOf(a,b)},_setNoInput:function(a){a?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(a,b,e,d,f){var g,h=!1;d?(this._fileMetadata=d,this.setTitle(d.Location||String(d)),this.setContentType(this.contentTypeRegistry.getFileContentType(d)),g=d.Name,h=d.Directory):(this._fileMetadata=null,this.setTitle(b),this.setContentType(this.contentTypeRegistry.getFilenameContentType(this.getTitle())),g=this.getTitle());var i=this.getEditor();if(this._focusListener)i&&i.getTextView&&i.getTextView()&&i.getTextView().removeEventListener("Focus",this._focusListener),this._focusListener=
null;if(this._changingListener)i&&i.getModel&&i.getModel()&&i.getModel().removeEventListener("Changing",this._changingListener),this._changingListener=null;d={type:"InputChanged",input:a,name:g,title:b,contentType:this.getContentType(),metadata:d,location:window.location,contents:e};this.dispatchEvent(d);this.editor=i=d.editor;if(!h){if(i&&i.getModel&&i.getModel())i.getModel().addEventListener("Changing",this._changingListener=this.onChanging.bind(this));f||i.setInput(b,null,e);if(i&&i.getTextView&&
i.getTextView())i.getTextView().addEventListener("Focus",this._focusListener=this.onFocus.bind(this));this._unsavedChanges=[];this.processParameters(a)}}});return{handleError:e,InputManager:h}});
define("orion/compare/resourceComparer","i18n!orion/compare/nls/messages,require,orion/Deferred,orion/webui/littlelib,orion/compare/compareUtils,orion/compare/diffProvider,orion/compare/compareView,orion/highlight,orion/fileClient,orion/globalCommands,orion/commands,orion/keyBinding,orion/searchAndReplace/textSearcher,orion/editorCommands,orion/objects,orion/inputManager,orion/editor/editorFeatures,orion/URL-shim".split(","),function(j,k,i,d,a,g,f,e,h,c,b,l,m,o,r,q,s){function u(a){this._syntaxHighlither=
new e.SyntaxHighlighter(a)}k={};k.DefaultDiffProvider=function(){function a(b){this.serviceRegistry=b;this._diffProvider=new g.DiffProvider(b)}a.prototype={_resolveTwoFiles:function(a,b){var c=this;return i.all([c._getContentType(a),c._getContentType(b)],function(a){return{_error:a}}).then(function(e){if(Array.isArray(e)&&e.length===2&&e[0]&&e[1]){var d=e[0],e=e[1];return(new i).resolve({oldFile:{URL:a,Name:c._resolveFileName(a),Type:d},newFile:{URL:b,Name:c._resolveFileName(b),Type:e},diffContent:c._diffContent})}else return d=
a?c._resolveFileName(a):"",e=b?c._resolveFileName(b):"",(new i).resolve({oldFile:{URL:a,Name:d,Type:null},newFile:{URL:b,Name:e,Type:null},diffContent:c._diffContent})})},_resolveFileName:function(a){return a.split("?")[0]},_getContentType:function(a){a=this._resolveFileName(a);return this.serviceRegistry.getService("orion.core.contentTypeRegistry").getFilenameContentType(a)},_resolveComplexFileURL:function(a){var b=this;return this._diffProvider.getDiffFileURI(a).then(function(a){return b._resolveTwoFiles(a.Old,
a.New)},function(){})},resolveDiff:function(a,b,c){this._hasConflicts=c;if(b)return this._resolveTwoFiles(b,a);else if(this._diffProvider){var e=this;return e._diffProvider.getDiffContent(a).then(function(b){e._diffContent=e._hasConflicts?b.split("diff --git")[1]:b;return e._resolveComplexFileURL(a)},function(){})}else console.log("A diff provider is needed for compound diff URL")}};return a}();u.prototype={highlight:function(a,b,c){return this._syntaxHighlither.setup(b,c.getTextView(),null,a,!1)}};
k.ResourceComparer=function(){function e(a,b,c,d){this._registry=a;this._commandService=b;this._fileClient=new h.FileClient(a);this._fileClient=new h.FileClient(a);this._searchService=this._registry.getService("orion.core.search");this._progress=this._registry.getService("orion.page.progress");this.setOptions(c,!0);this._compareView=c.toggleable?new f.toggleableCompareView(c.type==="inline"?"inline":"twoWay",d):c.type==="inline"?new f.inlineCompareView(d):new f.TwoWayCompareView(d);this._compareView.getWidget().setOptions({extCmdHolder:this});
d.highlighters||this._compareView.getWidget().setOptions({highlighters:[new u(a),new u(a)]});d.oldFile||this._compareView.getWidget().setOptions({oldFile:{readonly:this._checkReadonly(c.readonlyRight)}});d.newFile||this._compareView.getWidget().setOptions({newFile:{readonly:this._checkReadonly(c.readonly,!0)}});this.initExtCmds();this._initInputManagers();this._compareView.getWidget().initEditors(j["fetching..."]);this._inputManagers.forEach(function(a){if(a.manager){var b=this._compareView.getWidget().getEditors()[a.manager._editorIndex];
b.addEventListener("DirtyChanged",function(){a.manager.setDirty(b.isDirty())})}}.bind(this))}e.prototype={_clearOptions:function(){this.options={}},_checkReadonly:function(a,b){return b?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 q.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(b){if(b.manager)this._getFileOptions(b.manager._editorIndex).keyBindingFactory=function(c,e,d,f){e=new m.TextSearcher(c,a._registry,a._commandService,d);d=(new s.KeyBindingsFactory).createKeyBindings(c,d,f,e);(new o.EditorCommandFactory({serviceRegistry:a._registry,commandRegistry:a._commandService,fileClient:a._fileClient,inputManager:b.manager,
toolbarId:b.manager._actionBarId,readonly:!1,navToolbarId:"pageNavigationActions",textSearcher:e})).generateSimpleEditorCommands(c,b.manager._editorIndex===1?"orion.compare.save.left":"orion.compare.save.right");return d}}.bind(this))},_initInputManager:function(a,b,e){var f=this;r.mixin(a,{filePath:"",_editorIndex:b,_actionBarId:e,getInput:function(){return this.filePath},setDirty:function(a){var b=f._compareView.getWidget().getEditors(),e=a;b&&b.length===2&&(e=b[0].isDirty()||b[1].isDirty());c.setDirtyIndicator(e);
f._compareView.getWidget().refreshTitle&&f._compareView.getWidget().refreshTitle(this._editorIndex,a)},getFileMetadata:function(){return this._fileMetadata},getEditor:function(){return f._compareView.getWidget().getEditors()[this._editorIndex]},setInput:function(a){this._parsedLocation={resource:a};f._progress.progress(f._fileClient.read(a,!0),"Getting file metadata "+a).then(function(a){this._fileMetadata=a;var b=d.node(this._actionBarId);if(b){f._commandService.destroy(b);var c=this._editorIndex;
f._commandService.renderCommands(b.id,b,f._compareView.getWidget().getEditors()[c],f._compareView.getWidget().getEditors()[c],"button")}a&&this.setTitle(a.Location,a)}.bind(this),function(b){console.error("Error loading file metadata: "+b.message);this.setTitle(a)}.bind(this));this.lastFilePath=a},setTitle:function(a){a.charAt(0)==="*"?c.setDirtyIndicator(!0):c.setDirtyIndicator(!1)},afterSave:function(){var a=f._compareView.getWidget().getEditors()[this._editorIndex].getTextView().getText();f._getFileOptions(this._editorIndex).Content=
a;f._compareView.getWidget().refresh()}})},setOptions:function(a,b){b&&this._clearOptions();if(!this.options)this.options={};a&&Object.keys(a).forEach(function(b){this.options[b]=a[b]}.bind(this))},generateLink:function(b){b=b.getCurrentDiffPos();b=a.generateCompareHref(this.options.resource,{compareTo:this.options.compareTo,readonly:this.options.readonly,readonlyRight:this.options.readonlyRight,conflict:this.options.hasConflicts,block:b.block?b.block:1,change:b.change?b.change:0});b=(new URL(b,window.location.href)).href;
prompt(j["Copy the link URL:"],b)},openComparePage:function(b){b=b.getCurrentDiffPos();return a.generateCompareHref(this.options.resource,{compareTo:this.options.compareTo,readonly:!this.options.editableInComparePage,conflict:this.options.hasConflicts,block:b.block?b.block:1,change:b.change?b.change:0})},initExtCmds:function(){var a=this._compareView.getWidget().options.commandProvider;if(a&&a.getOptions().commandSpanId){var a=a.getOptions().commandSpanId,c=new b.Command({tooltip:j["Generate link of the current diff"],
name:j["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)}}),e=new b.Command({tooltip:j["Open the compare page"],name:j.Compare,id:"orion.compare.openComparePage",groupId:"orion.compareGroup",visibleWhen:function(a){return a.options.extCmdHolder.options.resource&&!a.options.extCmdHolder.options.generateLink},
hrefCallback:function(a){return a.items.options.extCmdHolder.openComparePage(a.items)}});this._commandService.addCommand(c);this._commandService.addCommand(e);this._commandService.registerCommandContribution(a,"orion.compare.openComparePage",98);this._commandService.registerCommandContribution(a,"orion.compare.generateLink",99,null,!1,new l.KeyBinding("l",!0,!0))}},_getFilesContents:function(a){var b=[];a.forEach(function(a){b.push(this._loadSingleFile(a))}.bind(this));return i.all(b,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(b){a.Content=b;return a}.bind(this),function(b){if(b.status===404)a.Content="";return a}.bind(this))},start:function(){if(this.options.resource)if(this.options.diffProvider){var a=
this;return a.options.diffProvider.resolveDiff(a.options.resource,a.options.compareTo,a.options.hasConflicts).then(function(b){a._compareView.getWidget().setOptions(b);var b=a._isImage(b.newFile.Type),c=a._compareView.getWidget().options;if(a._checkReadonly(a.options.readonlyRight)||b)c.oldFile.readonly=!0;if(a._checkReadonly(a.options.readonly,!0)||b)c.newFile.readonly=!0;return b?(a._compareView.initImageMode(),a._compareView.getWidget().refresh().then(function(a){return(new i).resolve(a+5)})):
a._getFilesContents(c.diffContent?[c.oldFile]:[c.oldFile,c.newFile]).then(function(){var b=a._compareView.getWidget().refresh(!0);this._inputManagers.forEach(function(b){if(b.manager){var c=a._getFileOptions(b.manager._editorIndex),e=a._compareView.getWidget().getEditors()[b.manager._editorIndex];b.manager.filePath=c.URL;b.manager.setInput(c.URL,e)}});return(new i).resolve(b)}.bind(a))})}else console.log("A diff provider is needed for Complex diff URL")}};return e}();return k});
define("orion/widgets/themes/editor/ThemeData",["i18n!orion/settings/nls/messages","orion/editor/textTheme"],function(j,k){function i(){}function d(){this.styles=[];var a=new i;a.name="Eclipse";a.annotationRuler="white";a.background="white";a.comment="green";a.keyword="#7f0055";a.text="darkSlateGray";a.string="blue";a.overviewRuler="white";a.lineNumberOdd="#444";a.lineNumberEven="#444";a.lineNumber="#444";a.currentLine="#EAF2FE";a.tag="darkorange";a.attribute="cadetBlue";a.fontFamily=g;a.fontSize=
f;this.styles.push(a);a=new i;a.name="Prospecto";a.annotationRuler="white";a.background="white";a.comment="#3C802C";a.keyword="#CC4C07";a.text="#333";a.string="#446FBD";a.overviewRuler="white";a.lineNumberOdd="silver";a.lineNumberEven="silver";a.lineNumber="silver";a.currentLine="#EAF2FE";a.tag="#CC4C07";a.attribute="cadetBlue";a.fontFamily=g;a.fontSize=f;this.styles.push(a);a=new i;a.name="Blue";a.annotationRuler="lavender";a.background="aliceBlue";a.comment="indigo";a.keyword="cornFlowerBlue";a.text=
"navy";a.string="cornFlowerBlue";a.overviewRuler="lavender";a.lineNumberOdd="darkSlateGray";a.lineNumberEven="darkSlateGray";a.lineNumber="darkSlateGray";a.currentLine="white";a.tag="cornFlowerBlue";a.attribute="cadetBlue";a.fontFamily=g;a.fontSize=f;this.styles.push(a);a=new i;a.name="Ambience";a.annotationRuler="#3D3D3D";a.background="#202020";a.comment="mediumslateblue";a.keyword="cornFlowerBlue";a.text="darkseagreen";a.string="lightcoral";a.overviewRuler="white";a.lineNumberOdd="black";a.lineNumberEven=
"black";a.lineNumber="black";a.currentLine="lightcyan";a.tag="cornFlowerBlue";a.attribute="cadetBlue";a.fontFamily=g;a.fontSize=f;this.styles.push(a);a=new i;a.name="Tierra";a.annotationRuler="moccasin";a.background="lemonchiffon";a.comment="darkseagreen";a.keyword="darkred";a.text="#555555";a.string="orangered";a.overviewRuler="moccasin";a.lineNumberOdd="chocolate";a.lineNumberEven="chocolate";a.lineNumber="chocolate";a.currentLine="#baa289";a.tag="darkred";a.attribute="cadetBlue";a.fontFamily=g;
a.fontSize=f;this.styles.push(a);a=new i;a.name="Nimbus";a.annotationRuler="#444";a.background="dimgray";a.comment="darkseagreen";a.keyword="darkorange";a.text="white";a.string="cornflowerblue";a.overviewRuler="#444";a.lineNumberOdd="#aaa";a.lineNumberEven="#aaa";a.lineNumber="#aaa";a.currentLine="#aabfbb";a.tag="darkorange";a.attribute="cadetBlue";a.fontFamily=g;a.fontSize=f;this.styles.push(a);a=new i;a.name="Adelante";a.annotationRuler="#E2D2B2";a.background="#F1E7C8";a.comment="#5D774E";a.keyword=
"#AF473B";a.text="dimgray";a.string="#DE5D3B";a.overviewRuler="#E2D2B2";a.lineNumberOdd="#AF473B";a.lineNumberEven="#AF473B";a.lineNumber="#AF473B";a.currentLine="#9e937b";a.tag="#AF473B";a.attribute="cadetBlue";a.fontFamily=g;a.fontSize=f;this.styles.push(a);a=new i;a.name="Raspberry Pi";a.annotationRuler="seashell";a.background="seashell";a.comment="#66B32F";a.keyword="#E73E36";a.text="dimgray";a.string="darkorange";a.overviewRuler="seashell";a.lineNumberOdd="#E73E36";a.lineNumberEven="#E73E36";
a.lineNumber="#E73E36";a.currentLine="#F5B1AE";a.tag="#E73E36";a.attribute="cadetBlue";a.fontFamily=g;a.fontSize=f;this.styles.push(a)}function a(){return this.styles}var g='"Consolas", "Monaco", "Vera Mono", "monospace"',f="10pt";d.prototype.styles=[];d.prototype.getStyles=a;d.prototype.fontSettable=!0;d.prototype.getThemeStorageInfo=function(){return{storage:"/themes",styleset:"editorstyles",defaultTheme:"Prospecto",selectedKey:"editorSelected",version:"5.0"}};d.prototype.parseToXML=function(a){try{var d=
null;if(window.DOMParser){var d=(new DOMParser).parseFromString(a,"text/xml"),c=d.getElementsByTagName("parsererror");return!c||!c.length||!c[0].childNodes.length?d:null}else return d=new ActiveXObject("Microsoft.XMLDOM"),d.async=!1,d.loadXML(a),d}catch(b){}};d.prototype.selectFontSize=function(a){console.log("fontsize: "+a)};d.prototype.importTheme=function(a){console.log("import theme");console.log(a);var d=this.parseToXML(a.parameters.valueFor("name")),c=new i;c.name=d.getElementsByTagName("colorTheme")[0].attributes[1].value;
c.annotationRuler=d.getElementsByTagName("background")[0].attributes[0].value;c.background=d.getElementsByTagName("background")[0].attributes[0].value;c.comment=d.getElementsByTagName("singleLineComment")[0].attributes[0].value;c.keyword=d.getElementsByTagName("keyword")[0].attributes[0].value;c.text=d.getElementsByTagName("foreground")[0].attributes[0].value;c.string=d.getElementsByTagName("string")[0].attributes[0].value;c.overviewRuler=d.getElementsByTagName("background")[0].attributes[0].value;
c.lineNumberOdd=d.getElementsByTagName("lineNumber")[0].attributes[0].value;c.lineNumberEven=d.getElementsByTagName("lineNumber")[0].attributes[0].value;c.lineNumber=d.getElementsByTagName("lineNumber")[0].attributes[0].value;c.currentLine=d.getElementsByTagName("selectionBackground")[0].attributes[0].value;a.items.addTheme(c)};d.prototype.processSettings=function(a){var d=k.TextTheme.getTheme();d.setThemeClass("editorTheme",d.buildStyleSheet("editorTheme",a))};d.prototype.getViewData=function(){var a=
{top:10,left:10,width:400,height:350},d=a.left,c=a.top;a.shapes=[{type:"TEXT",name:j["Line Numbers"],label:"1",x:d+20,y:c+20,fill:"darkSlateGray",family:"lineNumber",font:"9pt sans-serif"},{type:"RECTANGLE",name:j.Background,x:d+46,y:c,width:290,height:a.height,family:"background",fill:"white"},{type:"TEXT",name:j.Strings,label:"'text/javascript'",x:d+134,y:c+20,fill:"darkorange",family:"string",font:"9pt sans-serif"},{type:"TEXT",name:j.Foreground,label:"=",x:d+124,y:c+20,fill:"darkSlateGray",family:"text",
font:"9pt sans-serif"},{type:"RECTANGLE",name:j["Current Line"],x:d+46,y:c+87,width:290,height:18,family:"currentLine",fill:"#eaf2fd"},{type:"TEXT",name:j["HTML Attribute"],label:"type",x:d+98,y:c+20,fill:"darkGray",family:"attribute",font:"9pt sans-serif"},{type:"RECTANGLE",name:j["Overview Ruler"],x:d+336,y:c,width:14,height:a.height,family:"overviewRuler",fill:"white"},{type:"TEXT",name:j.Comments,label:"/* comment */",x:d+75,y:c+40,fill:"darkSeaGreen",family:"comment",font:"9pt sans-serif"},{type:"TEXT",
name:j["HTML Tag"],label:"<script",x:d+55,y:c+20,fill:"darkorange",family:"keyword",font:"9pt sans-serif"},{type:"TEXT",name:j["HTML Tag"],label:">",x:d+213,y:c+20,fill:"darkorange",family:"keyword",font:"9pt sans-serif"},{type:"TEXT",name:j.Strings,label:"'Result'",x:d+164,y:c+80,fill:"cornflowerBlue",family:"string",font:"9pt sans-serif"},{type:"TEXT",name:j.Foreground,label:"multiply(a,b){",x:d+120,y:c+60,fill:"darkSlateGray",family:"text",font:"9pt sans-serif"},{type:"TEXT",name:j.Keywords,label:"function",
x:d+75,y:c+60,fill:"darkorange",family:"keyword",font:"9pt sans-serif"},{type:"TEXT",name:j.Keywords,label:"var",x:d+95,y:c+80,fill:"darkorange",family:"keyword",font:"9pt sans-serif"},{type:"TEXT",name:j.Foreground,label:"output = ",x:d+115,y:c+80,fill:"darkSlateGray",family:"text",font:"9pt sans-serif"},{type:"TEXT",name:j.Foreground,label:";",x:d+205,y:c+80,fill:"darkSlateGray",family:"text",font:"9pt sans-serif"},{type:"TEXT",name:j.Keywords,label:"var",x:d+95,y:c+100,fill:"darkorange",family:"keyword",
font:"9pt sans-serif"},{type:"TEXT",name:j.Foreground,label:"result = a*b;",x:d+115,y:c+100,fill:"darkSlateGray",family:"text",font:"9pt sans-serif"},{type:"TEXT",name:j.Keywords,label:"return",x:d+95,y:c+120,fill:"darkorange",family:"keyword",font:"9pt sans-serif"},{type:"TEXT",name:j.Foreground,label:"output + result;",x:d+135,y:c+120,fill:"darkSlateGray",family:"text",font:"9pt sans-serif"},{type:"TEXT",name:j.Foreground,label:"}",x:d+75,y:c+140,fill:"darkSlateGray",family:"text",font:"9pt sans-serif"},
{type:"TEXT",name:j["HTML Tag"],label:"<\/script>",x:d+55,y:c+160,fill:"darkorange",family:"keyword",font:"9pt sans-serif"},{type:"TEXT",name:j["HTML Tag"],label:"<style",x:d+55,y:c+200,fill:"darkorange",family:"keyword",font:"9pt sans-serif"},{type:"TEXT",name:j["HTML Attribute"],label:"type",x:d+95,y:c+200,fill:"darkGray",family:"attribute",font:"9pt sans-serif"},{type:"TEXT",name:j.Foreground,label:"=",x:d+121,y:c+200,fill:"darkSlateGray",family:"text",font:"9pt sans-serif"},{type:"TEXT",name:j.Strings,
label:"'text/css'",x:d+131,y:c+200,fill:"darkorange",family:"string",font:"9pt sans-serif"},{type:"TEXT",name:j["HTML Tag"],label:">",x:d+180,y:c+200,fill:"darkorange",family:"keyword",font:"9pt sans-serif"},{type:"TEXT",name:j["CSS Class Name"],label:".some-class",x:d+75,y:c+220,fill:"darkorange",family:"keyword",font:"9pt sans-serif"},{type:"TEXT",name:j["CSS Class Name"],label:"{",x:d+145,y:c+220,fill:"darkSlateGray",family:"text",font:"9pt sans-serif"},{type:"TEXT",name:j["CSS Attribute"],label:"color:",
x:d+95,y:c+240,fill:"darkSlateGray",family:"text",font:"9pt sans-serif"},{type:"TEXT",name:j["CSS Value"],label:"#123456",x:d+130,y:c+240,fill:"darkSlateGray",family:"string",font:"9pt sans-serif"},{type:"TEXT",name:j["CSS Text"],label:";",x:d+180,y:c+240,fill:"darkSlateGray",family:"text",font:"9pt sans-serif"},{type:"TEXT",name:j["CSS Class Name"],label:"}",x:d+75,y:c+260,fill:"darkSlateGray",family:"text",font:"9pt sans-serif"},{type:"TEXT",name:j["HTML Tag"],label:"</style>",x:d+55,y:c+280,fill:"darkorange",
family:"keyword",font:"9pt sans-serif"},{type:"RECTANGLE",name:j["Annotation Ruler"],x:d,y:c,width:46,height:a.height,family:"annotationRuler",fill:"white"}];for(var b=0;b<16;b++)a.shapes.push({type:"TEXT",name:j["Line Numbers"],label:b+1,x:d+20,y:c+20*b+20,fill:"darkSlateGray",family:"lineNumber",font:"9pt sans-serif"});return a};return{ThemeData:d,getStyles:a}});
define('built-compare.js',"orion/browserCompatibility,orion/bootstrap,orion/status,orion/progress,orion/operationsClient,orion/commandRegistry,orion/fileClient,orion/searchClient,orion/globalCommands,orion/compare/compareCommands,orion/compare/resourceComparer,orion/widgets/themes/ThemePreferences,orion/widgets/themes/editor/ThemeData,orion/compare/compareUtils,orion/contentTypes,orion/PageUtil,i18n!orion/compare/nls/messages".split(","),function(j,k,i,d,a,g,f,e,h,c,b,l,m,o,r,q,s){k.startup().then(function(j){var k=
j.serviceRegistry,j=j.preferences,o=new g.CommandRegistry({}),v=new f.FileClient(k);new r.ContentTypeRegistry(k);var v=new e.Searcher({serviceRegistry:k,commandService:o,fileService:v}),n=new a.OperationsClient(k);new i.StatusReportingService(k,n,"statusPane","notifications","notificationArea");new d.ProgressService(k,n,o);(new l.ThemePreferences(j,new m.ThemeData)).apply();h.generateBanner("orion-compare",k,o,j,v);h.setPageTarget({task:s.Compare,serviceRegistry:k,commandService:o});var w=new b.DefaultDiffProvider(k),
x=new c.CompareCommandFactory({commandService:o,commandSpanId:"pageNavigationActions"}),y=function(){var a=q.matchResourceParameters();(new b.ResourceComparer(k,o,{readonly:a.readonly==="true",readonlyRight:typeof a.readonlyRight==="undefined"||a.readonlyRight==="true",generateLink:!0,hasConflicts:a.conflict==="true",diffProvider:w,resource:a.resource,compareTo:a.compareTo},{parentDivId:"compareContainer",commandProvider:x,showTitle:!0,showLineStatus:!0,blockNumber:typeof a.block==="undefined"?1:
a.block,changeNumber:typeof a.change==="undefined"?0:a.change})).start()};y();window.addEventListener("hashchange",function(){y()},!1)})});