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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

 Contributors:
 IBM Corporation - initial API and implementation

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

 Contributors:
 IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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


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

 Contributors:
 IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors:  IBM Corporation - initial API and implementation

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


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


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

 Contributors:
 IBM Corporation - initial API and implementation

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

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

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

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

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

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

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


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


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

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

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

 Contributors:
 IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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


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


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

 Contributors:
 IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

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

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

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

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

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

 Contributors: IBM Corporation - initial API and implementation

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


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


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

 Contributors:
 IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - _initial API and implementation

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


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


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

 Contributors:
 IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors:
 IBM Corporation - initial API and implementation

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


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


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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors:
 IBM Corporation - initial API and implementation

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


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


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

 Contributors:
 IBM Corporation - initial API and implementation

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

 Contributors:
 IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors:
 IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

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

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

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

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

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

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

 Contributors:
 IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

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

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

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

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

 Contributors: IBM Corporation - initial API and implementation

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

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

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors:
 IBM Corporation - initial API and implementation

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

 Contributors:
 IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

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

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors:
 IBM Corporation - initial API and implementation

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

 Contributors:
 IBM Corporation - initial API and implementation

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

 Contributors:
 IBM Corporation - initial API and implementation

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

 Contributors:
 IBM Corporation - initial API and implementation

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

 Contributors:
 IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors:
 IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

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

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

 Contributors: IBM Corporation - initial API and implementation 

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

 Contributors: IBM Corporation - initial API and implementation 

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

 Contributors: IBM Corporation - initial API and implementation

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

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

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


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


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

 Contributors:
 IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation 

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

 Contributors:
 IBM Corporation - initial API and implementation

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

 Contributors:
 IBM Corporation - initial API and implementation

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

 Contributors:
 IBM Corporation - initial API and implementation

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

 Contributors: 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 d=navigator.userAgent,e={browser:!1,version:!1},c=[{name:"Chrome/Chromium",regExp:/(?:chrome|crios|chromium)\/(\d+)/i,minVersion:24},{name:"Firefox",regExp:/firefox\/(\d+)/i,minVersion:17},{name:"Microsoft Internet Explorer",regExp:/msie\s(\d+)/i,minVersion:10},{name:"Safari",regExp:/version\/(\d+).*?safari/i,minVersion:5}],a=0;a<c.length;a++){var i=c[a],g=d.match(i.regExp);if(g){e.browser=!0;e.version=g[1]>=i.minVersion;e.name=i.name;break}}return e}function k(){try{return"localStorage"in
window&&window.localStorage!==null}catch(d){return!1}}function h(d){alert(d);throw Error("unsupported browser");}var e=j();if(e.browser)e.version||h("Sorry, your browser version is not supported.\n\nTo use Orion, please upgrade to the latest version of "+e.name+".\n");else if(k()&&!localStorage.skipBrowserCheck)if(confirm("Sorry, your browser is not supported. The latest version of Chrome, Firefox or Safari web browser is recommended.\nContinue anyway?"))localStorage.skipBrowserCheck=1;else throw"unsupported browser";
else k()||h("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:h}})();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 c;c=d.shift();)c();f=!1}function k(c){d.push(c);f||(f=!0,setTimeout(j,0))}function h(c){return function(){c.apply(void 0,arguments)}}function e(){function c(){for(var a;a=n.shift();){var g=a.deferred,c=l==="fulfilled"?"resolve":"reject";if(typeof a[c]==="function")try{var i=(0,a[c])(b),e=i&&(typeof i===
"object"||typeof i==="function")&&i.then;if(typeof e==="function")if(i===g.promise)g.reject(new TypeError);else{var f=i.cancel;typeof f==="function"?g._protected(d).parentCancel=f.bind(i):delete g._protected(d).parentCancel;e.call(i,h(g.resolve),h(g.reject),h(g.progress))}else g.resolve(i)}catch(p){g.reject(p)}else g[c](b)}}function a(a){delete o.parentCancel;l="rejected";b=a;n.length&&k(c)}function i(g){function d(b){return function(q){h||(h=!0,b(q))}}var h=!1;delete o.parentCancel;try{var j=g&&
(typeof g==="object"||typeof g==="function")&&g.then;if(typeof j==="function")if(g===f)a(new TypeError);else{l="assumed";var w=g&&g.cancel;if(typeof w!=="function"){var u=new e,g=u.promise;try{j(u.resolve,u.reject,u.progress)}catch(p){u.reject(p)}w=g.cancel;j=g.then}b=g;j.call(g,d(i),d(a));o.parentCancel=w.bind(g)}else l="fulfilled",b=g,n.length&&k(c)}catch(q){d(a)(q)}}function g(){var b=o.parentCancel;if(b)delete o.parentCancel,b();else if(!l)b=Error("Cancel"),b.name="Cancel",a(b)}var b,l,n=[],f=
this,o={};Object.defineProperty(this,"_protected",{value:function(b){if(b!==d)throw Error("protected");return o}});this.resolve=function(b){l||i(b);return f};this.reject=function(b){l||a(b);return f};this.progress=function(b){l||n.forEach(function(g){if(g.progress)try{g.progress(b)}catch(a){}});return f.promise};this.cancel=function(){o.parentCancel?setTimeout(g,0):g();return f};this.then=function(b,g,a){b={resolve:b,reject:g,progress:a,deferred:new e};n.push(b);b.deferred._protected(d).parentCancel=
f.promise.cancel.bind(f);(l==="fulfilled"||l==="rejected")&&k(c);return b.deferred.promise};this.promise={then:f.then,cancel:f.cancel}}var d=[],f=!1;e.all=function(c,a){function d(g,a){n||(l[g]=a,--b===0&&f.resolve(l))}function g(b,g){if(!n){if(a)try{d(b,a(g));return}catch(c){g=c}f.reject(g)}}var b=c.length,l=[],n=!1,f=new e;f.then(void 0,function(){n=!0;c.forEach(function(b){b.cancel&&b.cancel()})});b===0?f.resolve(l):c.forEach(function(b,a){b.then(d.bind(void 0,a),g.bind(void 0,a))});return f.promise};
e.when=function(c,a,d,g){var b;if(!(c&&typeof c.then==="function"))b=new e,b.resolve(c),c=b.promise;return c.then(a,d,g)};return e});
define("orion/EventTarget",[],function(){function j(){this._namedListeners={}}j.prototype={dispatchEvent:function(j){if(!j.type)throw Error("unspecified type");var h=this._namedListeners[j.type];h&&h.forEach(function(e){try{typeof e==="function"?e(j):e.handleEvent(j)}catch(d){typeof console!=="undefined"&&console.log(d)}});return!j.defaultPrevented},addEventListener:function(j,h){if(typeof h==="function"||h.handleEvent)this._namedListeners[j]=this._namedListeners[j]||[],this._namedListeners[j].push(h)},
removeEventListener:function(j,h){var e=this._namedListeners[j];if(e)for(var d=0;d<e.length;d++)if(e[d]===h){e.length===1?delete this._namedListeners[j]:e.splice(d,1);break}}};j.prototype.constructor=j;j.attach=function(k){var h=new j;k.dispatchEvent=h.dispatchEvent.bind(h);k.addEventListener=h.addEventListener.bind(h);k.removeEventListener=h.removeEventListener.bind(h)};return j});
define("orion/serviceregistry",["orion/Deferred","orion/EventTarget"],function(j,k){function h(a,c,g){this._properties=g||{};this._properties["service.id"]=a;this._properties.objectClass=c;this._properties["service.names"]=c}function e(a,c,g){this._serviceId=a;this._serviceReference=c;this._internalRegistry=g}function d(a,c){function g(b){return function(){var g;try{if(!c())throw Error("Service was unregistered");var d=a[b].apply(a,Array.prototype.slice.call(arguments));if(d&&typeof d.then==="function")return d;
else g=new j,g.resolve(d)}catch(e){g=new j,g.reject(e)}return g.promise}}for(var b in a)typeof a[b]==="function"&&(this[b]=g(b))}function f(a,c){this.type=a;this.serviceReference=c}function c(){this._entries=[];this._namedReferences={};this._serviceEventTarget=new k;var a=this;this._internalRegistry={isRegistered:function(c){return a._entries[c]?!0:!1},unregisterService:function(c){var g=a._entries[c];if(!g)throw Error("Service has already been unregistered: "+c);var b=g.reference;a._serviceEventTarget.dispatchEvent(new f("unregistering",
b));a._entries[c]=null;b.getProperty("objectClass").forEach(function(g){for(var c=a._namedReferences[g],d=0;d<c.length;d++)if(c[d]===b){c.length===1?delete a._namedReferences[g]:c.splice(d,1);break}})},modifyService:function(c){var g=a._entries[c];if(!g)throw Error("Service not found while trying to send modified event: "+c);a._serviceEventTarget.dispatchEvent(new f("modified",g.reference))}}}h.prototype={getPropertyKeys:function(){var a=[],c;for(c in this._properties)this._properties.hasOwnProperty(c)&&
a.push(c);return a},getProperty:function(a){return this._properties[a]}};h.prototype.constructor=h;e.prototype={unregister:function(){this._internalRegistry.unregisterService(this._serviceId)},getReference:function(){if(!this._internalRegistry.isRegistered(this._serviceId))throw Error("Service has already been unregistered: "+this._serviceId);return this._serviceReference},setProperties:function(a){var c=this._serviceReference._properties;this._serviceReference._properties=a||{};a["service.id"]=this._serviceId;
a.objectClass=c.objectClass;a["service.names"]=c["service.names"];this._internalRegistry.modifyService(this._serviceId)}};e.prototype.constructor=e;c.prototype={getService:function(a){var c;if(typeof a==="string")(a=this._namedReferences[a])&&a.some(function(g){c=this._entries[g.getProperty("service.id")].service;return!!c},this);else if(a=this._entries[a.getProperty("service.id")])c=a.service;return c||null},getServiceReferences:function(a){if(a)return this._namedReferences[a]?this._namedReferences[a]:
[];var c=[];this._entries.forEach(function(g){g&&c.push(g.reference)});return c},registerService:function(a,c,g){if(typeof c==="undefined"||c===null)throw Error("invalid service");typeof a==="string"?a=[a]:Array.isArray(a)||(a=[]);var b=this._entries.length,l=new h(b,a,g),n=this._namedReferences;a.forEach(function(b){n[b]=n[b]||[];n[b].push(l)});a=new d(c,this._internalRegistry.isRegistered.bind(null,b));this._entries.push({reference:l,service:a});a=this._internalRegistry;this._serviceEventTarget.dispatchEvent(new f("registered",
l));return new e(b,l,a)},addEventListener:function(a,c){this._serviceEventTarget.addEventListener(a,c)},removeEventListener:function(a,c){this._serviceEventTarget.removeEventListener(a,c)}};c.prototype.constructor=c;return{ServiceRegistry:c}});
define("orion/xhr",["orion/Deferred"],function(j){function k(h,e,d,f){var c=typeof d.response!=="undefined"?d.response:d.responseText,a;try{a=d.status}catch(i){a=0}h={args:e,response:c,responseText:typeof c==="string"?c:null,status:a,url:h,xhr:d};if(typeof f!=="undefined")h.error=f;return h}return function(h,e,d){var d=d||{},f=arguments.length>3&&arguments[3]?arguments[3]:new XMLHttpRequest,c=new j,a=d.headers||{},i=d.log||!1,g;typeof a["X-Requested-With"]==="undefined"&&(a["X-Requested-With"]="XMLHttpRequest");
if(typeof d.data!=="undefined"&&(h==="POST"||h==="PUT"))g=d.data;var b=!1,l=!1;c.promise.then(void 0,function(g){b=!0;!l&&g instanceof Error&&g.name==="Cancel"&&f.abort()});f.onabort=function(){l=!0;if(!b){var g=Error("Cancel");g.name="Cancel";c.reject(g)}};f.onload=function(){var b=k(e,d,f);200<=f.status&&f.status<400?c.resolve(b):(c.reject(b),i&&typeof console!=="undefined"&&console.log(Error(f.statusText)))};f.onerror=function(){var b=k(e,d,f);c.reject(b);i&&typeof console!=="undefined"&&console.log(Error(f.statusText))};
f.onprogress=function(b){b.xhr=f;c.progress(b)};try{f.open(h,e,!0);if(typeof d.responseType==="string")f.responseType=d.responseType;if(typeof d.timeout==="number")if(typeof f.timeout==="number")f.timeout=d.timeout,f.addEventListener("timeout",function(){c.reject(k(e,d,f,"Timeout exceeded"))});else{var n=setTimeout(function(){c.reject(k(e,d,f,"Timeout exceeded"))},d.timeout);c.promise.then(clearTimeout.bind(null,n),clearTimeout.bind(null,n))}Object.keys(a).forEach(function(b){f.setRequestHeader(b,
a[b])});f.send(g||null)}catch(m){c.reject(k(e,d,f,m))}return c.promise}});
define("orion/preferences",["require","orion/Deferred","orion/xhr"],function(j,k,h){function e(g,b){this._name=g;this._providers=b;this._flushPending=!1;this._cached=null;this._stores=[];this._pendingDeletes=[];this._dirty=[]}function d(g,b){return{get:function(a,c){if(b===0)return null;var d=localStorage.getItem(g+a);if(d===null)return null;d=JSON.parse(d);return c||b===-1||d._expires&&d._expires>(new Date).getTime()?(delete d._expires,d):null},set:function(a,c){if(b!==0){if(b!==-1)c._expires=(new Date).getTime()+
1E3*b;if(Object.keys(c).length===0)localStorage.removeItem(g+a);else{var d=JSON.stringify(c);localStorage.setItem(g+a,d);delete c._expires}}},remove:function(b){localStorage.removeItem(g+b)}}}function f(g){this._currentPromises={};this._cache=new d("/orion/preferences/user",3600);this._service=null;this.available=function(){if(!this._service){var b=g.getServiceReferences("orion.core.preference.provider");if(b.length>0)this._service=g.getService(b[0])}return!!this._service}}function c(g){this._location=
g;this._currentPromise=null;this._cache=new d("/orion/preferences/default",3600)}function a(){this._cache=new d("/orion/preferences/local",-1)}function i(g,b){this._userProvider=new f(g);this._localProvider=new a;b=b||"defaults.pref";b.indexOf("://")===-1&&(b=j.toUrl(b));this._defaultsProvider=new c(b);this._serviceRegistration=g.registerService("orion.core.preference",this)}e.prototype={_flush:function(){for(var g=[],b=0;b<this._stores.length;++b){var a=this._stores[b];this._dirty.indexOf(a)!==-1&&
g.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++)g.push(this._providers[b].remove(this._name,this._pendingDeletes[b][a]));delete this._pendingDeletes[b]}}this._dirty=[];return k.all(g)},_scheduleFlush:function(g){g&&this._dirty.indexOf(g)===-1&&this._dirty.push(g);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 g=0;g<this._stores.length;++g){var b=this._stores[g],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(g){return this._getCached()[g]},put:function(g,b){if(this._stores.length!==0){var a=this._stores[0];if(a[g]!==b)a[g]=b,this._cached=null,this._scheduleFlush(a)}},remove:function(a){for(var b=0;b<
this._stores.length;++b){var c=this._stores[b];if(c.hasOwnProperty(a))return delete c[a],this._pendingDeletes[b]||(this._pendingDeletes[b]=[]),this._pendingDeletes[b].push(a),this._cached=null,this._scheduleFlush(),!0}return!1},clear:function(){for(var a=0;a<this._stores.length;++a)this._stores[a]={},this._scheduleFlush(this._stores[a]);this._cached=null},sync:function(a){if(this._flushPending)return this._flushPending=!1,this._flush();for(var b=this,c=[],d=0;d<this._providers.length;++d)c.push(this._providers[d].get(this._name,
a).then(function(a){return function(g){b._stores[a]=g}}(d)));return k.all(c).then(function(){b._cached=null;b._getCached()})},flush:function(){this._flush()}};f.prototype={get:function(a,b){if(this._currentPromises[a])return this._currentPromises[a];var c=new k,d=null;b?this._cache.remove(a):d=this._cache.get(a);if(d!==null)c.resolve(d);else{this._currentPromises[a]=c;var i=this;this._service.get(a).then(function(b){i._cache.set(a,b);delete i._currentPromises[a];c.resolve(b)},function(b){b.status===
404?(b={},i._cache.set(a,b),delete i._currentPromises[a],c.resolve(b)):(delete i._currentPromises[a],c.resolve(i._cache.get(a,!0)||{}))})}return c},put:function(a,b){this._cache.set(a,b);return this._service.put(a,b)},remove:function(a,b){var c=this._cache.get(a);delete c[b];this._cache.set(a,c);return this._service.remove(a,b)}};c.prototype={get:function(a,b){if(this._currentPromise)return this._currentPromise;var c=new k,d=null;b?this._cache.remove(a):d=this._cache.get(a);if(d!==null)c.resolve(d);
else{this._currentPromise=c;var i=this;h("GET",this._location,{headers:{"Orion-Version":"1"},timeout:15E3}).then(function(b){b=JSON.parse(b.response);i._cache.set(a,b[a]||{});i._currentPromise=null;c.resolve(b[a]||{})},function(b){b.xhr.status===401||b.xhr.status===404?(i._cache.set(a,{}),i._currentPromise=null,c.resolve({})):(i._currentPromise=null,b=i._cache.get(a,!0),b!==null?c.resolve(b[a]||{}):c.resolve({}))})}return c},put:function(){var a=new k;a.resolve();return a},remove:function(a,b){var c=
this._cache.get(a);delete c[b];this.put(a,c)}};a.prototype={get:function(a){var b=new k,a=this._cache.get(a);a!==null?b.resolve(a):b.resolve({});return b},put:function(a,b){var c=new k;this._cache.set(a,b);c.resolve();return c},remove:function(a,b){var c=this._cache.get(a);delete c[b];this.put(a,c)}};i.DEFAULT_SCOPE=1;i.LOCAL_SCOPE=2;i.USER_SCOPE=4;i.prototype={listenForChangedSettings:function(a,b,c){if(!b||typeof b!=="number"||b>7||b<1)c=b,b=i.DEFAULT_SCOPE|i.LOCAL_SCOPE|i.USER_SCOPE;window.addEventListener("storage",
c,!1);if((i.USER_SCOPE&b)!==0)return"/orion/preferences/user"+a;else if((i.LOCAL_SCOPE&b)!==0)return"/orion/preferences/local"+a;return"/orion/preferences/default"+a},getPreferences:function(a,b){if(!b||typeof b!=="number"||b>7||b<1)b=i.DEFAULT_SCOPE|i.LOCAL_SCOPE|i.USER_SCOPE;var c=[];i.USER_SCOPE&b&&this._userProvider.available()&&c.push(this._userProvider);i.LOCAL_SCOPE&b&&c.push(this._localProvider);i.DEFAULT_SCOPE&b&&c.push(this._defaultsProvider);var d=new e(a,c);return d.sync().then(function(){return d})},
getSetting:function(a,b,c){for(var d,i=0;i<a.length;i++)if(a[i].label===b)for(var e=0;e<a[i].data.length;e++)if(a[i].data[e].label===c){d=a[i].data[e].value;break}return d}};return{PreferencesService:i}});
(function(){function j(b){if(typeof b!=="string")throw new TypeError;}function k(b){return b?b.split("&"):[]}function h(b){return b.length===0?"":b.join("&")}function e(b){var a=/([^=]*)(?:=?)(.*)/.exec(b),b=a[1]?decodeURIComponent(a[1]):"",a=a[2]?decodeURIComponent(a[2]):"";return[b,a]}function d(b){var a=encodeURIComponent(b[0]);b[1]&&(a+="="+encodeURIComponent(b[1]));return a}function f(b,a){var c="",q=[],p=0;return{next:function(){if(c!==b.query)c=b.query,q=k(c);if(p<q.length){var g=e(q[p++]);
switch(a){case "keys":return g[0];case "values":return g[1];case "keys+values":return[g[0],g[1]];default:throw new TypeError;}}throw x;}}}function c(b){Object.defineProperty(this,"_url",{get:function(){return b._url}})}function a(b){var a=[];b.split("/").forEach(function(b){b===".."?a.pop():b!=="."&&a.push(b)});return a.join("/")}function i(b){return b.replace(/\s/g,function(b){return"%"+b.charCodeAt(0).toString(16)})}function g(b,c){if(typeof b!=="string")throw new TypeError;var b=i(b),q=m.exec(b);
if(!q)return null;var p={};p.scheme=q[1]||"";if(p.scheme&&!t.test(p.scheme))return null;var g=q[2];if(g&&(g=o.exec(g),p.userinfo=g[1],p.host=g[2],p.port=g[3],p.port&&!r.test(p.port)))return null;p.path=q[3];p.query=q[4];p.fragment=q[5];if(!p.scheme&&c&&(p.scheme=c.scheme,!p.host&&c.host))p.userinfo=c.userinfo,p.host=c.host,p.port=c.port,p.pathRelative=!0;if(p.pathRelative)if(p.path){if(p.path[0]!=="/")q=/^(.*\/)[^\/]*$/.exec(c.path)[1]||"/",p.path=q+p.path}else p.path=c.path;if(p.scheme)p.scheme=
p.scheme.toLowerCase();if(p.port)p.port=/[1-9]\d*$/.exec(p.port)[0];if(p.host&&p.path)p.path=a(p.path);return p}function b(b,a){var p;if(a){a=a.href||a;p=g(a);if(!p||!p.scheme)throw new SyntaxError;Object.defineProperty(this,"_baseURL",{value:p})}p=g(b,p);if(!p)throw new SyntaxError;Object.defineProperty(this,"_input",{value:b,writable:!0});Object.defineProperty(this,"_url",{value:p,writable:!0});var q=new c(this);Object.defineProperty(this,"query",{get:function(){return this._url?q:null},enumerable:!0})}
try{var l;if(typeof window.URL==="function"&&window.URL.length!==0&&(l=new window.URL("http://www.w3.org?q")).protocol==="http:"&&l.query)return}catch(n){}var m=/^(?:([^:\/?#]+):)?(?:\/\/([^\/?#]*))?([^?#]*)(?:\?([^#]*))?(?:#(.*))?$/,o=/^(?:(.*)@)?(\[[^\]]*\]|[^:]*)(?::(.*))?$/,t=/^([a-zA-Z](?:[a-zA-Z0-9+-.])*)$/,r=/^\d*$/,s=/^(\[[^\]\/?#\s]*\]|[^:\/?#\s]*)$/,v=/^(\[[^\]\/?#\s]*\]|[^:\/?#\s]*)(?::(\d*))?$/,w=/^([^?#\s]*)$/,u=/^([^\s]*)$/,p=/^\S*$/,q=/([^:]*):?(.*)/,x=typeof StopIteration!=="undefined"?
StopIteration:Error("Stop Iteration"),A={"ftp:":"21","gopher:":"70","http:":"80","https:":"443","ws:":"80","wss:":"443"};Object.defineProperties(c.prototype,{get:{value:function(b){j(b);var a;k(this._url.query).some(function(p){p=e(p);if(p[0]===b)return a=p[1],!0});return a},enumerable:!0},set:{value:function(b,a){j(b);j(a);var p=k(this._url.query);p.some(function(c,q){var g=e(c);if(g[0]===b)return g[1]=a,p[q]=d(g),!0})||p.push(d([b,a]));this._url.query=h(p)},enumerable:!0},has:{value:function(b){j(b);
return k(this._url.query).some(function(a){if(e(a)[0]===b)return!0})},enumerable:!0},"delete":{value:function(b){j(b);var a=k(this._url.query),p=a.filter(function(a){return e(a)[0]!==b});return p.length!==a.length?(this._url.query=h(p),!0):!1},enumerable:!0},clear:{value:function(){this._url.query=""},enumerable:!0},forEach:{value:function(b,a){if(typeof b!=="function")throw new TypeError;var p=f(this._url,"keys+values");try{for(;;){var c=p.next();b.call(a,c[1],c[0],this)}}catch(q){if(q!==x)throw q;
}},enumerable:!0},keys:{value:function(){return f(this._url,"keys")},enumerable:!0},values:{value:function(){return f(this._url,"values")},enumerable:!0},items:{value:function(){return f(this._url,"keys+values")}},size:{get:function(){return k(this._url.query).length},enumerable:!0},getAll:{value:function(b){j(b);var a=[];k(this._url.query).forEach(function(p){p=e(p);p[0]===b&&a.push(p[1])});return a},enumerable:!0},append:{value:function(b,a){j(b);j(a);var p=k(this._url.query);p.push(d([b,a]));this._url.query=
h(p)},enumerable:!0}});Object.defineProperties(b.prototype,{href:{get:function(){var b;if(this._url){b=this._url;var a=b.scheme?b.scheme+":":"";b.host&&(a+="//",b.userinfo&&(a+=b.userinfo+"@"),a+=b.host,b.port&&(a+=":"+b.port));a+=b.path;b.query&&(a+="?"+b.query);b.fragment&&(a+="#"+b.fragment);b=a}else b=this._input;return b},set:function(b){j(b);this._input=b;this._url=g(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,t.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=q.exec(this._userinfo);return decodeURIComponent(b[1]||"")},set:function(b){j(b);if(this._url){var a=
q.exec(this._userinfo),b=[encodeURIComponent(b||"")];a[2]&&b.push(a[2]);this._userinfo=b.join(":")}},enumerable:!0},password:{get:function(){if(!this._url)return"";var b=q.exec(this._userinfo);return decodeURIComponent(b[2]||"")},set:function(b){j(b);if(this._url){var a=[q.exec(this._userinfo)[1]||""];b&&a.push(encodeURIComponent(b));this._userinfo=a.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=v.exec(b)))this._url.host=b[1],this._url.port=/[1-9]\d*$/.exec(b[2])[0]},enumerable:!0},hostname:{get:function(){return this._url?this._url.host:""},set:function(b){j(b);if(this._url&&s.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&&r.exec(b))this._url.port=/[1-9]\d*$/.exec(b)[0]},enumerable:!0},pathname:{get:function(){return this._url?
this._url.path:""},set:function(b){j(b);if(this._url&&w.exec(b))this._url.host&&b&&b[0]!=="/"&&(b="/"+b),this._url.path=b?a(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)),u.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)),p.exec(b)))this._url.fragment=
b},enumerable:!0}});window.URL&&window.URL.createObjectURL&&(Object.defineProperty(b,"createObjectURL",{value:window.URL.createObjectURL.bind(window.URL),enumerable:!1}),Object.defineProperty(b,"revokeObjectURL",{value:window.URL.revokeObjectURL.bind(window.URL),enumerable:!1}));window.URL=b})();define("orion/URL-shim",function(){});
define("orion/pluginregistry",["orion/Deferred","orion/EventTarget","orion/URL-shim"],function(j,k){function h(b,a){var c=Object.keys(b),g=Object.keys(a);if(c.length!==g.length)return!1;c.sort();g.sort();for(var d=0,i=c.length;d<i;d++){var e=c[d];if(e!==g[d])return!1;var f=b[e],e=a[e];if(f!==e&&JSON.stringify(f)!==JSON.stringify(e))return!1}return!0}function e(b){if(b.indexOf("://")===-1)try{return(new URL(b,location.href)).href}catch(a){}return b}function d(b){var a=null,c={key:function(c){return(a=
a||Object.keys(b))[c]},getItem:function(a){return b[a]},setItem:function(c,g){b[c]=g;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 f(b,a){if(a&&a instanceof XMLHttpRequest){var c,g;try{c=a.status,g=a.statusText}catch(d){c=0,g=""}return{status:c||0,statusText:g}}return a}function c(b){var a=b?JSON.parse(JSON.stringify(b,
f)):b;if(b instanceof Error)a.__isError=!0,a.message=a.message||b.message,a.name=a.name||b.name;return a}function a(b,a){this.type=b;this.plugin=a}function i(b,a){this.__objectId=b;this.__methods=a}function g(b,g,d){function e(b){F&&d.postMessage(b,F)}function f(b){if(!F)return(new j).reject(Error("plugin not connected"));b.id=String(V++);var a=new j;T[b.id]=a;a.then(null,function(a){z==="active"&&a instanceof Error&&a.name==="Cancel"&&e({requestId:b.id,method:"cancel",params:a.message?[a.message]:
[]})});var p=Object.prototype.toString;b.params.forEach(function(c,q){if(p.call(c)==="[object Object]"&&!(c instanceof i)){var g,d;for(g in c)p.call(c[g])==="[object Function]"&&(d=d||[],d.push(g));if(d){var l=O++;S[l]=c;g=function(){delete S[l]};a.then(g,g);b.params[q]=new i(l,d)}}});d.postMessage(b,F);return a.promise}function r(b,a){b||b===0?e({id:b,result:null,error:a}):console.log(a)}function s(b,a,p,q){q.forEach(function(b,a){if(b&&typeof b.__objectId!=="undefined"){var p={};b.__methods.forEach(function(a){p[a]=
function(){return f({objectId:b.__objectId,method:a,params:Array.prototype.slice.call(arguments)})}});q[a]=p}});var g=typeof b===void 0?null:{id:b,result:null,error:null};try{var d=p.apply(a,q);if(g)d&&typeof d.then==="function"?(P[b]=d,d.then(function(a){delete P[b];g.result=a;e(g)},function(a){if(P[b])delete P[b],g.error=c(a),e(g)},function(){e({responseId:b,method:"progress",params:Array.prototype.slice.call(arguments)})})):(g.result=d,e(g))}catch(i){if(g)g.error=c(i),e(g)}}function v(b){try{if(b.method){var a=
b.method,p=b.params||[];if("serviceId"in b){var c=U[b.serviceId];c||r(b.id,"service not found");a in c?s(b.id,c,c[a],p):r(b.id,"method not found")}else if("objectId"in b){var q=S[b.objectId];q||r(b.id,"object not found");a in q?s(b.id,q,q[a],p):r(b.id,"method not found")}else if("requestId"in b){var g=P[b.requestId];g&&a==="cancel"&&g.cancel&&g.cancel.apply(g,p)}else if("responseId"in b){var i=T[b.responseId];i&&a==="progress"&&i.progress&&i.progress.apply(i,p)}else if("plugin"===b.method){var l=
b.params[0];N({headers:l.headers,services:l.services}).then(function(){J.resolve(x)})}else if("timeout"===b.method)J&&J.reject(b.error);else throw Error("Bad method: "+b.method);}else{var e=T[String(b.id)];delete T[String(b.id)];if(b.error){var f=d.handleServiceError(x,b.error);e.reject(f)}else e.resolve(b.result)}}catch(n){console.log("Plugin._messageHandler "+n)}}function w(b){var a={};if(b.methods&&(b.methods.forEach(function(p){a[p]=function(){var a={serviceId:b.serviceId,method:p,params:Array.prototype.slice.call(arguments)};
return z==="active"?f(a):x.start({"transient":!0}).then(function(){return f(a)})}}),a.addEventListener&&a.removeEventListener)){var p=new k,c=O++;S[c]={handleEvent:p.dispatchEvent.bind(p)};var q=new i(c,["handleEvent"]),g=a.addEventListener;a.addEventListener=function(b,a){p._namedListeners[b]||g(b,q);p.addEventListener(b,a)};var d=a.removeEventListener;a.removeEventListener=function(b,a){p.removeEventListener(b,a);p._namedListeners[b]||d(b,q)}}return a}function u(a){var p=JSON.parse(JSON.stringify(a.properties));
p.__plugin__=b;a=a.names||a.type||[];Array.isArray(a)||(a=[a]);p.objectClass=a;return p}function p(b){var a=w(b),p=u(b),p=d.registerService(b.names||b.type,a,p);G[b.serviceId]={registration:p,proxy:a}}function q(){d.persist(b,{created:A,headers:E,services:K,autostart:H,lastModified:y})}var x=this,g=g||{},A=g.created||(new Date).getTime(),E=g.headers||{},K=g.services||[],H=g.autostart,y=g.lastModified||0,z="installed",B,J,F,G={},V=0,O=0,P={},T={},S={},U={},N;this._persist=q;this._resolve=function(){z=
"resolved";d.dispatchEvent(new a("resolved",x))};this._getAutostart=function(){return H};this._getCreated=function(){return A};this.getLocation=function(){return b};this.getHeaders=function(){return JSON.parse(JSON.stringify(E))};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 y};this.getServiceReferences=function(){var b=[];Object.keys(G).forEach(function(a){b.push(G[a].registration.getReference())});
return b};this.getState=function(){return z};this.start=function(c){if(z==="uninstalled")return(new j).reject(Error("Plugin is uninstalled"));if(B)return B.promise.then(this.start.bind(this,c));if(z==="active")return(new j).resolve();if(!c||!c.transient){var g=c&&c.lazy?"lazy":"started";g!==H&&(H=g,q())}g=d.getState();if(g!=="starting"&&g!=="active")return c.transient?(new j).reject(Error("start transient error")):(new j).resolve();if(z==="installed")try{this._resolve()}catch(i){return(new j).reject(i)}z===
"resolved"&&K.forEach(function(b){p(b)});if(c&&c.lazy)return z!=="starting"&&(z="starting",d.dispatchEvent(new a("lazy activation",x))),(new j).resolve();var e=new j;B=e;z="starting";d.dispatchEvent(new a("starting",x));J=new j;F=d.connect(b,v);J.then(function(){J=null;z="active";d.dispatchEvent(new a("started",x));B=null;e.resolve()},function(){J=null;z="stopping";d.dispatchEvent(new a("stopping",x));Object.keys(G).forEach(function(b){G[b].registration.unregister();delete G[b]});d.disconnect(F);
F=null;z="resolved";B=null;d.dispatchEvent(new a("stopped",x));e.reject(Error("plugin activation error"))});return e.promise};this.stop=function(b){if(z==="uninstalled")return(new j).reject(Error("Plugin is uninstalled"));if(B)return B.promise.then(this.stop.bind(this,b));if((!b||!b.transient)&&"stopped"!==H)H="stopped",q();if(z!=="active"&&z!=="starting")return(new j).resolve();B=b=new j;z="stopping";d.dispatchEvent(new a("stopping",x));Object.keys(G).forEach(function(b){G[b].registration.unregister();
delete G[b]});F&&(d.disconnect(F),F=null);z="resolved";B=null;d.dispatchEvent(new a("stopped",x));b.resolve();return b.promise};N=function(c){if(z==="uninstalled")return(new j).reject(Error("Plugin is uninstalled"));if(!c)return y===0&&(y=(new Date).getTime(),q()),d.loadManifest(b).then(N);var g=E,i=K,e=H;E=c.headers||{};K=c.services||{};H=c.autostart||H;c.lastModified?y=c.lastModified:(y=(new Date).getTime(),q());if(h(E,g)&&h(K,i)&&H===e)return(new j).resolve();if(z==="active"||z==="starting"){var f=
[];Object.keys(K).forEach(function(b){var a=K[b];f.push(b);var c=G[b];if(c){if(h(a.methods,Object.keys(c.proxy))){var b=u(a),q=c.registration.getReference(),g={};q.getPropertyKeys().forEach(function(b){g[b]=q.getProperty(b)});h(b,g)||c.registration.setProperties(b);return}c.registration.unregister();delete G[b]}p(a)});Object.keys(G).forEach(function(b){f.indexOf(b)===-1&&(G[b].registration.unregister(),delete G[b])})}z==="active"&&(d.disconnect(F),J=new j,F=d.connect(b,v),J.then(function(){J=null},
function(){J=null;z="stopping";d.dispatchEvent(new a("stopping"),x);Object.keys(G).forEach(function(b){G[b].registration.unregister();delete G[b]});d.disconnect(F);F=null;z="resolved";d.dispatchEvent(new a("stopped",x))}));return(new j).resolve()};this.update=function(b){return N(b).then(function(){d.dispatchEvent(new a("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));d.removePlugin(this);z="uninstalled";d.dispatchEvent(new a("uninstalled",x));return(new j).resolve()}}var b=/^http[s]?/i;return{Plugin:g,PluginRegistry:function(c,i){function f(b){var a=b.source;h.some(function(c){if(a===c.target){try{var g;if(typeof c.useStructuredClone==="undefined"){var d=typeof b.data!=="string";g=d?b.data:JSON.parse(b.data);c.useStructuredClone=d}else g=c.useStructuredClone?b.data:JSON.parse(b.data);c.handler(g)}catch(i){}return!0}})}var i=i||{},o=
i.storage||localStorage;o.getItem||(o=d(o));var t="installed",r=[],h=[],v=new k,w={},u={registerService:c.registerService.bind(c),connect:function(b,a,c){function g(b){b=Error(b);b.name="timeout";a({method:"timeout",error:b})}var d={handler:a,url:b},l=setTimeout(g.bind(null,"Load timeout for: "+b),c||15E3),e=document.createElement("iframe");e.name=b+"_"+(new Date).getTime();if(!i.visible)e.style.display="none",e.style.visibility="hidden";e.src=b;e.onload=function(){clearTimeout(l);setTimeout(g.bind(null,
"Plugin handshake timeout for: "+b),5E3)};e.sandbox="allow-scripts allow-same-origin";document.body.appendChild(e);d.target=e.contentWindow;d.close=function(){e&&(document.body.removeChild(e),e=null)};h.push(d);return d},disconnect:function(b){for(var a=0;a<h.length;a++)if(b===h[a]){h.splice(a,1);try{b.close()}catch(c){}break}},removePlugin:function(b){for(var a=0;a<r.length;a++)if(b===r[a]){r.splice(a,1);break}o.removeItem("plugin."+b.getLocation())},persist:function(b,a){o.setItem("plugin."+b,JSON.stringify(a))},
postMessage:function(b,a){a.target.postMessage(a.useStructuredClone?b:JSON.stringify(b),a.url)},dispatchEvent:function(b){try{v.dispatchEvent(b)}catch(a){console&&console.log("PluginRegistry.dispatchEvent "+a)}},loadManifest:function(b){var a=new j,c=u.connect(b,function(b){c&&b.method&&("manifest"===b.method||"plugin"===b.method?(b=b.params[0],u.disconnect(c),c=null,a.resolve(b)):"timeout"===b.method&&(u.disconnect(c),c=null,a.reject(b.error)))});return a.promise},getState:function(){return t},handleServiceError:function(a,
c){if(c&&c.status===401){var g=a.getHeaders(),d=a.getName()||a.getLocation(),i=document.createElement("span");i.appendChild(document.createTextNode("Authentication required for: "+d+"."));if(g.login)i.appendChild(document.createTextNode(" ")),d=document.createElement("a"),d.target="_blank",d.textContent="Login",d.href=g.login,b.test(d.href)?(i.appendChild(d),i.appendChild(document.createTextNode(" and re-try the request."))):console.log("Illegal Login URL: "+g.login);return{Severity:"Error",HTML:!0,
Message:(new XMLSerializer).serializeToString(i)}}if(c.__isError){var l=c,c=Error(l.message);Object.keys(l).forEach(function(b){c[b]=l[b]});delete c.__isError}return c}};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=u.getState;this.init=function(){if(!(t==="starting"||t==="active"||t==="stopping")){addEventListener("message",f,
!1);for(var b=[],a=0,c=o.length;a<c;a++)b.push(o.key(a));b.forEach(function(b){if(b.indexOf("plugin.")===0){var a=b.substring(7),b=JSON.parse(o.getItem(b));b.created&&r.push(new g(a,b,u))}});r.sort(function(b,a){return b._getCreated()<a._getCreated()?-1:1});i.plugins&&Object.keys(i.plugins).forEach(function(b){b=e(b);if(!this.getPlugin(b)){var a=i.plugins[b],a=typeof a==="object"||{};a.autostart=a.autostart||i.defaultAutostart||"lazy";r.push(new g(b,a,u))}}.bind(this));t="starting"}};this.start=function(){t!==
"starting"&&this.init();if(t!=="starting")return(new j).reject("Cannot start framework. Framework is already "+t+".");var b=[],a=(new Date).getTime();r.forEach(function(c){var g=c._getAutostart();c.getLastModified()===0?b.push(c.update().then(function(){if("started"===g)return c.start({"transient":!0});if("lazy"===g)return c.start({lazy:!0,"transient":!0});c._resolve()})):"started"===g?b.push(c.start({"transient":!0})):"lazy"===g?(b.push(c.start({lazy:!0,"transient":!0})),a>c.getLastModified()+864E5&&
c.update()):c._resolve()});return j.all(b,function(b){console.log("PluginRegistry.stop "+b)}).then(function(){t="active"})};this.stop=function(){if(t!=="starting"&&t!=="active")return(new j).reject("Cannot stop registry. Registry is already "+t+".");t="stopping";var b=[];r.forEach(function(a){b.push(a.stop({"transient":!0}))});return j.all(b,function(b){console.log("PluginRegistry.stop "+b)}).then(function(){removeEventListener("message",f);t="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,c){var b=e(b),d=this.getPlugin(b);if(d)return(new j).resolve(d);if(w[b])return w[b];if(c)return d=new g(b,c,u),r.push(d),d._persist(),u.dispatchEvent(new a("installed",d)),(new j).resolve(d);var i=u.loadManifest(b).then(function(c){d=new g(b,c,u);r.push(d);d._persist();delete w[b];u.dispatchEvent(new a("installed",d));return d},function(a){delete w[b];throw a;});return w[b]=i};this.getPlugins=
function(){return r.slice()};this.getPlugin=function(b){var a=null,b=e(b);r.some(function(c){if(b===c.getLocation())return a=c,!0});return a};this.addEventListener=v.addEventListener.bind(v);this.removeEventListener=v.removeEventListener.bind(v);this.resolvePlugins=function(){var b=!0;r.forEach(function(a){b=b&&a._resolve()});return b}}}});
define("orion/serviceTracker",[],function(){function j(e,d){function f(b){var c=b.getProperty("service.id"),g=this.addingService(b);g&&(a[c]=b,i[c]=g)}function c(b){var c=b.getProperty("service.id"),g=i[c];delete a[c];delete i[c];this.removedService(b,g)}this.serviceRegistry=e;var a={},i={},g=k,b,l;this.close=function(){if(g!==h)throw"Already closed";g=k;e.removeEventListener("registered",b);e.removeEventListener("unregistering",l);l=b=null;var a=this;this.getServiceReferences().forEach(function(b){c.call(a,
b)});if(typeof this.onClose==="function")this.onClose()};this.getServiceReferences=function(){var b=Object.keys(a);return!b.length?null:b.map(function(b){return a[b]})};this.open=function(){if(g!==k)throw"Already open";g=h;var a=this;b=function(b){if(b.serviceReference.getProperty("objectClass").indexOf(d)!==-1&&(f.call(a,b.serviceReference),typeof a.onServiceAdded==="function"))return a.onServiceAdded(b.serviceReference,a.serviceRegistry.getService(b.serviceReference))};l=function(b){b.serviceReference.getProperty("objectClass").indexOf(d)!==
-1&&c.call(a,b.serviceReference)};e.addEventListener("registered",b);e.addEventListener("unregistering",l);e.getServiceReferences(d).forEach(function(b){f.call(a,b)});if(typeof this.onOpen==="function")this.onOpen()}}var k=0,h=1;j.prototype={addingService:function(e){return this.serviceRegistry.getService(e)},onOpen:null,onClose:null,onServiceAdded:null,removedService:function(){}};return j});
define("orion/objects",[],function(){function j(j){for(var h=1;h<arguments.length;h++){var e=arguments[h],d;for(d in e)Object.prototype.hasOwnProperty.call(e,d)&&(j[d]=e[d])}return j}return{clone:function(k){if(Array.isArray(k))return Array.prototype.slice.call(k);var h=Object.create(Object.getPrototypeOf(k));j(h,k);return h},mixin:j,toArray:function(j){return Array.isArray(j)?j:[j]}}});
define("orion/config",["orion/Deferred","orion/serviceTracker","orion/objects"],function(j,k,h){var e,d,f,c,a,i="pid";e=function(b,a,c){function g(b,c,d){c.forEach(function(g,p){try{var q=b[p].getProperty("__plugin__"),i=q&&a.getPlugin(q);(!q||i&&i.getState()==="active")&&c[p].updated(d)}catch(e){typeof console!=="undefined"&&console.log(e)}})}k.call(this,b,"orion.cm.managedservice");var d={},e={},f=function(a){var g=[];a.plugin.getServiceReferences().forEach(function(a){if(a.getProperty("objectClass").indexOf("orion.cm.managedservice")!==
-1){var d=a.getProperty(i),a=b.getService(a);d&&a&&(d=(d=c._find(d))&&d.getProperties(),g.push(a.updated(d)))}});return j.all(g)};this.addingService=function(a){var c=a.getProperty(i),g=b.getService(a);if(!c||!g)return null;d[c]||(d[c]=[]);e[c]||(e[c]=[]);d[c].push(a);e[c].push(g);return g};this.onServiceAdded=function(b,a){var d=b.getProperty(i),d=c._find(d);g([b],[a],d&&d.getProperties())};this.onOpen=function(){a.addEventListener("started",f)};this.onClose=function(){a.removeEventListener("started",
f)};this.notifyUpdated=function(b){var a=b.getPid();g(d[a]||[],e[a]||[],b.getProperties())};this.notifyDeleted=function(b){b=b.getPid();g(d[b]||[],e[b]||[],null)};this.removedService=function(b,a){var c=b.getProperty(i),g=d[c],p=e[c];g.length>1?g.splice(g.indexOf(b),1):delete d[c];p.length>1?p.splice(p.indexOf(a),1):delete e[c]}};d=function(){function b(b,a,g){this.store=new f(this,g);this.configAdmin=new c(this,this.store);this.tracker=new e(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}();c=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 g="/cm/configurations";
f=function(){function b(b,c){this.factory=b;this.prefsService=c;this.configs=Object.create(null);this.pref=null;var d=this;this.initPromise=this.prefsService.getPreferences(g).then(function(b){d.pref=b;b.keys().forEach(function(c){if(!d.configs[c]){var g=b.get(c);typeof g==="object"&&g!==null&&Object.keys(g).length>0&&(g[i]=c,d.configs[c]=new a(d.factory,d,g))}})})}b.prototype={_init:function(){return this.initPromise},_find:function(b){return this.configs[b]||null},get:function(b){var c=this._find(b);
c||(c=new a(this.factory,this,b),this.configs[b]=c);return c},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}();a=function(){function b(b,a){a=h.clone(a);delete a[i];b.properties=a}function a(c,g,d){this.factory=c;this.store=g;if(d!==null&&typeof d==="object")this.pid=d[i],b(this,
d);else if(typeof d==="string")this.pid=d,this.properties=null;else throw Error("Invalid pid/properties "+d);}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=h.clone(this.properties),!b))a[i]=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:d}});
define("orion/bootstrap","require,orion/Deferred,orion/serviceregistry,orion/preferences,orion/pluginregistry,orion/config".split(","),function(j,k,h,e,d,f){var c;return{startup:function(){if(c)return c;c=new k;var a=new h.ServiceRegistry,i=new e.PreferencesService(a);return i.getPreferences("/plugins").then(function(g){var b={plugins:{}};g.keys().forEach(function(a){var c=j.toUrl(a);b.plugins[c]=g[a]});var l=new d.PluginRegistry(a,b);return l.start().then(function(){if(a.getServiceReferences("orion.core.preference.provider").length>
0)return i.getPreferences("/plugins",i.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 f.ConfigurationAdminFactory(a,l,i)).getConfigurationAdmin().then(a.registerService.bind(a,"orion.cm.configadmin"))}).then(function(){var b=a.getService("orion.core.auth");
if(b){var c=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)})}),g=localStorage.getItem("lastLogin");if(!g||g<(new Date).getTime()-9E5)return c}}).then(function(){var b={serviceRegistry:a,preferences:i,pluginRegistry:l};c.resolve(b);return b})})}}});
(function(){function j(d,e,c,a,i,g){e[d]&&(c.push(d),(e[d]===!0||e[d]===1)&&a.push(i+d+"/"+g))}function k(d,e,c,a,i){e=a+e+"/"+i;require._fileExists(d.toUrl(e+".js"))&&c.push(e)}function h(d,e,c){for(var a in e)e.hasOwnProperty(a)&&(!d.hasOwnProperty(a)||c)?d[a]=e[a]:typeof e[a]==="object"&&h(d[a],e[a],c)}var e=/(^.*(^|\/)nls(\/|$))([^\/]*)\/?([^\/]*)/;define("i18n",["module"],function(d){var f=d.config?d.config():{};return{version:"2.0.1+",load:function(c,a,d,g){g=g||{};if(g.locale)f.locale=g.locale;
var b=e.exec(c),l=b[1],n=b[4],m=b[5],o=n.split("-"),t=[],r={},s,v="";if(b[5])l=b[1],c=l+m;else{m=b[4];n=f.locale;if(!n)n=f.locale=typeof navigator==="undefined"?"root":(navigator.language||navigator.userLanguage||"root").toLowerCase();o=n.split("-")}if(g.isBuild){t.push(c);k(a,"root",t,l,m);for(s=0;s<o.length;s++)g=o[s],v+=(v?"-":"")+g,k(a,v,t,l,m);a(t,function(){d()})}else a([c],function(b){var c=[],g;j("root",b,c,t,l,m);for(s=0;s<o.length;s++)g=o[s],v+=(v?"-":"")+g,j(v,b,c,t,l,m);a(t,function(){var g,
p,e;for(g=c.length-1;g>-1&&c[g];g--){e=c[g];p=b[e];if(p===!0||p===1)p=a(l+e+"/"+m);h(r,p)}d(r)})})}}})})();
define("orion/i18n",[],function(){return{load:function(j,k,h,e){var e=e||{},d=/(^.*(?:^|\/)nls(?:\/|$))([^\/]*)\/?([^\/]*)/,f=d.exec(j);if(f){if(!k.defined||k.defined(j))try{h(k(j));return}catch(c){}if(e.isBuild||e.isTest)h({});else{var a=f[1],i=f[3]?f[2]:"",g=f[3]||f[2];k(["orion/bootstrap"],function(b){b.startup().then(function(b){var c=b.serviceRegistry,b=c.getServiceReferences("orion.i18n.message");if(i)b.some(function(b){return j===b.getProperty("name")?(c.getService(b).getMessageBundle().then(function(b){h(b)},
function(){h({})}),!0):!1})||h({});else{var m={},o;b.forEach(function(b){var c=b.getProperty("name");if((f=d.exec(c))&&a===f[1]&&g===(f[3]||f[2]))if(i=f[3]?f[2]:""){if((b=e.locale||(typeof navigator!=="undefined"?navigator.language||navigator.userLanguage:null))&&b.toLowerCase().indexOf(i.toLowerCase())===0)m[i]=!0,(!k.specified||!k.specified(c))&&define(c,["orion/i18n!"+c],function(b){return b})}else o=b});!k.specified||!k.specified(j)?o?c.getService(o).getMessageBundle().then(function(b){Object.keys(m).forEach(function(a){typeof b[a]===
"undefined"&&(b[a]=m[a])});define(j,[],b);h(b)},function(){define(j,[],m);h(m)}):(define(j,[],m),h(m)):h(m)}})})}}else h(null)}}});
define("orion/nls/root/messages",{Navigator:"Navigator",Sites:"Sites",Shell:"Shell","Get Plugins":"Get Plugins",Global:"Global",Editor:"Editor","Filter bindings":"Filter bindings","Orion Editor":"Orion Editor","View on Site":"View on Site","View this file or folder on a web site hosted by Orion":"View this file or folder on a web site hosted by Orion","Show a list of all the keybindings on this page":"Show a list of all the keybindings on this page","Show Keys":"Show Keys","Hide or show the page banner and footer":"Hide or show the page banner and footer",
"Toggle banner and footer":"Toggle banner and footer","Choose a file by name and open an editor on it":"Choose a file by name and open an editor on it","Find File Named...":"Find File Named...","System Configuration Details":"System Configuration Details","System Config Tooltip":"Go to the System Configuration Details page","Background Operations":"Background Operations","Background Operations Tooltip":"Go to the Background Operations page","Operation status is unknown":"Operation status is unknown",
"Unknown item":"Unknown item","Can't search: no search service is available":"Can't search: no search service is available","could not find banner parent, id was ":"could not find banner parent, id was ",Related:"Related",Options:"Options",FAQ:"FAQ","Report a Bug":"Bugs","Privacy Policy":"Privacy","Terms of Use":"Terms","Copyright Agent":"Copyright","Orion Logo":"Orion Logo","Orion is in Beta. Please try it out but BEWARE your data may be lost.":"I20131030-1703","LOG: ":"LOG: ",View:"View","no parent":"no parent",
"no tree model":"no tree model","no renderer":"no renderer","could not find table row ":"could not find table row ","Resource is out of sync with the server. Do you want to save it anyway?":"Resource is out of sync with the server. Do you want to save it anyway?",Operations:"Operations","Operations running":"Operations running","Some operations finished with warning":"Some operations finished with warning","Some operations finished with error":"Some operations finished with error","no service registry":"no service registry",
Tasks:"Tasks",Close:"Close","Expand all":"Expand all","Collapse all":"Collapse all",Search:"Search","Advanced search":"Advanced search",Submit:"Submit",More:"More","Saved searches":"Saved searches","Recent searches":"Recent searches","Regular expression":"Regular expression","Search options":"Search options","Global search":"Global search","Orion Home":"Orion Home","Close notification":"Close notification","Operations - Press spacebar to show current operations":"Operations - Press spacebar to show current operations",
"Type a keyword or wild card to search in root":"Type a keyword or wild card to search in root","Toggle side panel":"Toggle side panel","Open or close the side panel":"Open or close the side panel",Projects:"Projects","Toggle Sidebar":"Toggle Sidebar","Sample HTML5 Site":"Sample HTML5 Site","Generate an HTML5 'Hello World' website, including JavaScript, HTML, and CSS files.":"Generate an HTML5 'Hello World' website, including JavaScript, HTML, and CSS files.","Sample Orion Plugin":"Sample Orion Plugin",
"Generate a sample plugin for integrating with Orion.":"Generate a sample plugin for integrating with Orion.",Raw:"Raw","Open the raw file or folder in the browser":"Open the raw file or folder in the browser",OutlineProgress:"Getting outline for ${0} from ${1}",UnknownError:"An unknown error occurred.",UnknownWarning:"An unknown warning occurred."});
define("orion/nls/messages",["orion/i18n!orion/nls/messages","orion/nls/root/messages"],function(j,k){var h={root:k};Object.keys(j).forEach(function(e){typeof h[e]==="undefined"&&(h[e]=j[e])});return h});
define("orion/util",[],function(){var j=navigator.userAgent,k=j.indexOf("MSIE")!==-1||j.indexOf("Trident")!==-1?document.documentMode:void 0,h=parseFloat(j.split("Firefox/")[1]||j.split("Minefield/")[1])||void 0,e=j.indexOf("Opera")!==-1,d=parseFloat(j.split("Chrome/")[1])||void 0,f=j.indexOf("Safari")!==-1&&!d,c=parseFloat(j.split("WebKit/")[1])||void 0,a=j.indexOf("Android")!==-1,i=j.indexOf("iPad")!==-1,j=j.indexOf("iPhone")!==-1,g=i||j,b=navigator.platform.indexOf("Mac")!==-1,l=navigator.platform.indexOf("Win")!==
-1,n=navigator.platform.indexOf("Linux")!==-1;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:h,isOpera:e,isChrome:d,isSafari:f,isWebkit:c,isAndroid:a,isIPad:i,isIPhone:j,isIOS:g,isMac:b,isWindows:l,isLinux:n,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 h(a){if(a.tabIndex>=0)return a;if(a.hasChildNodes())for(var c=0;c<a.childNodes.length;c++){var g=h(a.childNodes[c]);if(g)return g}return null}function e(a){if(a.tabIndex>=0)return a;if(a.hasChildNodes())for(var c=a.childNodes.length-1;c>=0;c--){var g=e(a.childNodes[c]);if(g)return g}return null}function d(a,c){if(a.nodeType===3){var g=f.exec(a.nodeValue);g&&g.length>1&&c(a,
g)}if(a.hasChildNodes())for(g=0;g<a.childNodes.length;g++)d(a.childNodes[g],c)}var f=/\$\{([^\}]+)\}/,c=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 g=a.compareDocumentPosition(c);return Boolean(g&16)},bounds:function(a){a=a.getBoundingClientRect();return{left:a.left+
document.body.scrollLeft,top:a.top+document.body.scrollTop,width:a.width,height:a.height}},empty:function(a){for(;a.hasChildNodes();)a.removeChild(a.firstChild)},firstTabbable:h,lastTabbable:e,stop:function(a){if(window.document.all)a.keyCode=0;a.preventDefault&&(a.preventDefault(),a.stopPropagation())},processTextNodes:function(a,c){d(a,function(a,b){a.parentNode.replaceChild(document.createTextNode(c[b[1]]||b[1]),a)})},processDOMNodes:function(a,c){d(a,function(a,b){var d=c[b[1]];if(d){var e=document.createRange(),
f=b.index;e.setStart(a,f);e.setEnd(a,f+b[0].length);e.deleteContents();e.insertNode(d)}})},addAutoDismiss:function(a,d){function g(b){c.forEach(function(a){var c=!1,g=a.excludeNodes.some(function(a){return document.body.contains(a)?(c=!0,a.contains(b.target)):!1});if(c&&!g)try{a.dismiss()}catch(d){typeof console!=="undefined"&&console&&console.error(d&&d.message)}});c=c.filter(function(b){return b.excludeNodes.some(function(b){return document.body.contains(b)})})}c===null&&(c=[],document.addEventListener("click",
g,!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));c.push({excludeNodes:a,dismiss:d})},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,h,e=["Msxml2.XMLHTTP","Microsoft.XMLHTTP","Msxml2.XMLHTTP.4.0"],d=/^\s*<\?xml(\s)+version=[\'\"](\d)*.(\d)*[\'\"](\s)*\?>/im,f=/<body[^>]*>\s*([\s\S]+)\s*<\/body>/im,c=typeof location!=="undefined"&&location.href,a=c&&location.protocol&&location.protocol.replace(/\:/,""),i=c&&location.hostname,g=c&&(location.port||void 0),b=[],l=j.config&&j.config()||{};k={version:"2.0.5",strip:function(b){if(b){var b=b.replace(d,""),a=b.match(f);a&&(b=a[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=e[a];try{b=new ActiveXObject(c)}catch(g){}if(b){e=[c];break}}return b},parseName:function(b){var a,
c,g=!1,d=b.indexOf(".");a=b.indexOf("./")===0||b.indexOf("../")===0;d!==-1&&(!a||d>1)?(a=b.substring(0,d),c=b.substring(d+1,b.length)):a=b;b=c||a;d=b.indexOf("!");d!==-1&&(g=b.substring(d+1)==="strip",b=b.substring(0,d),c?c=b:a=b);return{moduleName:a,ext:c,strip:g}},xdRegExp:/^((\w+)\:)?\/\/([^\/\\]+)/,useXhr:function(b,a,c,g){var d,i;d=k.xdRegExp.exec(b);if(!d)return!0;b=d[2];d=d[3];d=d.split(":");i=d[1];d=d[0];return(!b||b===a)&&(!d||d.toLowerCase()===c.toLowerCase())&&(!i&&!d||i===g)},finishLoad:function(a,
c,g,d){g=c?k.strip(g):g;l.isBuild&&(b[a]=g);d(g)},load:function(b,d,e,f){if(f.isBuild&&!f.inlineText)e();else{l.isBuild=f.isBuild;var r=k.parseName(b),f=r.moduleName+(r.ext?"."+r.ext:""),h=d.toUrl(f),j=l.useXhr||k.useXhr;!c||j(h,a,i,g)?k.get(h,function(a){k.finishLoad(b,r.strip,a,e)},function(b){e.error&&e.error(b)}):d([f],function(b){k.finishLoad(r.moduleName+"."+r.ext,r.strip,b,e)})}},write:function(a,c,g){if(b.hasOwnProperty(c)){var d=k.jsEscape(b[c]);g.asModule(a+"!"+c,"define(function () { return '"+
d+"';});\n")}},writeFile:function(b,a,c,g,d){var a=k.parseName(a),i=a.ext?"."+a.ext:"",l=a.moduleName+i,e=c.toUrl(a.moduleName+i)+".js";k.load(l,c,function(){var a=function(b){return g(e,b)};a.asModule=function(b,a){return g.asModule(b,e,a)};k.write(b,l,a,d)},d)}};if(l.env==="node"||!l.env&&typeof process!=="undefined"&&process.versions&&process.versions.node)h=require.nodeRequire("fs"),k.get=function(b,a){var c=h.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,g){var d=k.createXhr(),i;d.open("GET",b,!0);if(g)for(i in g)g.hasOwnProperty(i)&&d.setRequestHeader(i.toLowerCase(),g[i]);if(l.onXhr)l.onXhr(d,b);d.onreadystatechange=function(){var g;if(d.readyState===4)g=d.status,g>399&&g<600?(g=Error(b+" HTTP status: "+g),g.xhr=d,c(g)):a(d.responseText)};d.send(null)};else if(l.env==="rhino"||!l.env&&typeof Packages!=="undefined"&&typeof java!=="undefined")k.get=function(b,a){var c,g,d=new java.io.File(b),i=java.lang.System.getProperty("line.separator"),
d=new java.io.BufferedReader(new java.io.InputStreamReader(new java.io.FileInputStream(d),"utf-8")),l="";try{c=new java.lang.StringBuffer;(g=d.readLine())&&g.length()&&g.charAt(0)===65279&&(g=g.substring(1));for(c.append(g);(g=d.readLine())!==null;)c.append(i),c.append(g);l=String(c.toString())}finally{d.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,h){return{slideoutHTMLFragment:function(e){var d=document.createElement("div");d.innerHTML=h;var f=k.$("#slideContainer",d);f.id=e+f.id;f=k.$("#pageCommandParameters",d);f.id=e+f.id;f=k.$("#pageCommandDismiss",d);f.id=e+f.id;return d.innerHTML}}});
define("orion/keyBinding",["orion/util"],function(j){function k(e,d,f,c,a,i){this.type=i||"keydown";this.keyCode=typeof e==="string"&&this.type==="keydown"?e.toUpperCase().charCodeAt(0):e;this.mod1=d!==void 0&&d!==null?d:!1;this.mod2=f!==void 0&&f!==null?f:!1;this.mod3=c!==void 0&&c!==null?c:!1;this.mod4=a!==void 0&&a!==null?a:!1}function h(e){this.keys=e}k.prototype={getKeys:function(){return[this]},match:function(e,d){if(d!==void 0){if(d!==0)return!1}else if(e instanceof Array){if(e.length>1)return!1;
e=e[0]}return e.type!==this.type?!1:this.keyCode===e.keyCode||this.keyCode===String.fromCharCode(j.isOpera?e.which:e.charCode!==void 0?e.charCode:e.keyCode)?this.mod1!==(j.isMac?e.metaKey:e.ctrlKey)?!1:this.type==="keydown"&&this.mod2!==e.shiftKey?!1:this.mod3!==e.altKey?!1:j.isMac&&this.mod4!==e.ctrlKey?!1:!0:!1},equals:function(e){return!e?!1:this.keyCode!==e.keyCode?!1:this.mod1!==e.mod1?!1:this.mod2!==e.mod2?!1:this.mod3!==e.mod3?!1:this.mod4!==e.mod4?!1:this.type!==e.type?!1:!0}};h.prototype=
{getKeys:function(){return this.keys.slice(0)},match:function(e,d){var f=this.keys;if(d!==void 0)return d>f.length?!1:f[d].match(e)?d===f.length-1?!0:d+1:!1;else{e instanceof Array||(e=[e]);if(e.length>f.length)return!1;var c;for(c=0;c<e.length;c++)if(!f[c].match(e[c]))return!1;return c===f.length?!0:c}},equals:function(e){if(!e.keys)return!1;if(e.keys.length!==this.keys.length)return!1;for(var d=0;d<e.keys.length;d++)if(!e.keys[d].equals(this.keys[d]))return!1;return!0}};return{KeyBinding:k,KeyStroke:k,
KeySequence:h}});
define("orion/webui/dropdown",["require","orion/webui/littlelib"],function(j,k){function h(e){this._init(e)}h.prototype={_init:function(e){this._dropdownNode=k.node(e.dropdown);if(!this._dropdownNode)throw"no dom node for dropdown found";this._triggerNode=k.$(".dropdownTrigger",this._dropdownNode.parentNode);if(!this._triggerNode)throw"no dom node for dropdown trigger found";this._populate=e.populate;this._selectionClass=e.selectionClass;var d=this;this._triggerNode.addEventListener("click",function(e){d.toggle()&&
k.stop(e)},!1);this._triggerNode.tagName.toLowerCase()==="span"&&this._triggerNode.addEventListener("keydown",function(e){if(e.keyCode===k.KEY.ENTER||e.keyCode===k.KEY.SPACE)d.toggle(),k.stop(e)},!1);this._dropdownNode.addEventListener("keydown",this._dropdownKeyDown.bind(this),!1)},toggle:function(){return this.isVisible()?this.close():this.open()},isVisible:function(){return this._triggerNode.classList.contains("dropdownTriggerOpen")},open:function(){if(!this.isVisible()){this._populate&&(this.empty(),
this._populate(this._dropdownNode));var e=this.getItems();if(e.length>0){if(!this._hookedAutoDismiss){var d=k.$$(".dropdownSubMenu",this._dropdownNode);k.addAutoDismiss([this._triggerNode].concat(Array.prototype.slice.call(d)),function(){if(this.isVisible()){this.close();for(var d=this._dropdownNode.parentNode;d;)d.dropdown&&typeof d.dropdown.close==="function"&&d.dropdown.close(),d=d.parentNode}}.bind(this));this._hookedAutoDismiss=!0}this._triggerNode.classList.add("dropdownTriggerOpen");this._selectionClass&&
this._triggerNode.classList.add(this._selectionClass);this._dropdownNode.classList.add("dropdownMenuOpen");this._positionDropdown();e[0].focus();return!0}return!1}},_positionDropdown:function(){this._dropdownNode.style.left="";var e=k.bounds(this._dropdownNode),d=k.bounds(document.body);if(e.left+e.width>d.left+d.width)if(this._triggerNode.classList.contains("dropdownMenuItem"))this._dropdownNode.style.left=-e.width+"px";else{var d=k.bounds(this._boundingNode(this._triggerNode)),f=k.bounds(this._triggerNode);
this._dropdownNode.style.left=f.left-d.left-e.width+f.width+"px"}},_boundingNode:function(e){var d=window.getComputedStyle(e,null);return d===null?e:d.getPropertyValue("position")==="absolute"||!e.parentNode||e===document.body?e:this._boundingNode(e.parentNode)},close:function(e){if(this.isVisible())return this._triggerNode.classList.remove("dropdownTriggerOpen"),this._selectionClass&&this._triggerNode.classList.remove(this._selectionClass),this._dropdownNode.classList.remove("dropdownMenuOpen"),
e&&this._triggerNode.focus(),!0},getItems:function(){var e=[],d=this;k.$$array("li:not(.dropdownSeparator) > .dropdownMenuItem",this._dropdownNode,!0).forEach(function(f){f.parentNode.parentNode===d._dropdownNode&&e.push(f)});return e},empty:function(){var e=this;k.$$array("li",this._dropdownNode).forEach(function(d){d.parentNode===e._dropdownNode&&d.parentNode.removeChild(d)})},_dropdownKeyDown:function(e){if(e.keyCode===k.KEY.UP||e.keyCode===k.KEY.DOWN||e.keyCode===k.KEY.RIGHT||e.keyCode===k.KEY.ENTER||
e.keyCode===k.KEY.LEFT){var d=this.getItems(),f=document.activeElement;if(d.length&&d.length>0&&f){var c=d.indexOf(f);c<0&&(c=d.indexOf(f.parentNode));c>=0&&(e.keyCode===k.KEY.UP&&c>0?(c--,d[c].focus()):e.keyCode===k.KEY.DOWN&&c<d.length-1?(c++,d[c].focus()):e.keyCode===k.KEY.ENTER||e.keyCode===k.KEY.RIGHT?f.classList.contains("dropdownTrigger")&&f.dropdown&&f.dropdown.open():e.keyCode===k.KEY.LEFT&&f.parentNode.parentNode.classList.contains("dropdownMenuOpen")&&this.close(!0),k.stop(e))}}else e.keyCode===
k.KEY.ESCAPE&&(this.close(!0),k.stop(e))}};h.prototype.constructor=h;return{Dropdown:h}});define("text!orion/webui/dropdowntriggerbutton.html",[],function(){return'<button class="dropdownTrigger">${ButtonText}<span class="dropdownArrowDown core-sprite-downarrow"></span></button><ul class="dropdownMenu"></ul>'});define("text!orion/webui/submenutriggerbutton.html",[],function(){return'<li class="dropdownSubMenu"><span class="dropdownTrigger dropdownMenuItem" role="menuitem" tabindex="0">${ButtonText}<span class="dropdownArrowRight core-sprite-closedarrow"></span></span><ul class="dropdownMenu"></ul></li>'});
define("text!orion/webui/checkedmenuitem.html",[],function(){return'<li><label class="dropdownMenuItem"><input class="checkedMenuItem" role="menuitem" type="checkbox" />${ItemText}</label></li>'});
define("orion/webui/tooltip",["require","orion/webui/littlelib"],function(j,k){function h(e){this._init(e)}h.prototype={_init:function(e){this._node=k.node(e.node);if(!this._node)throw"no dom node for tooltip found";this._position=e.position||["right","above","below","left"];this._text=e.text;this._hideDelay=e.hideDelay===void 0?200:e.hideDelay;this._tailSize=e.tailSize||10;this._trigger=e.trigger||"mouseover";this._afterShowing=e.afterShowing;this._afterHiding=e.afterHiding;var d=this;if(this._trigger===
"click")this._showDelay=0,this._node.addEventListener("click",this._clickHandler=function(c){c.target===d._node&&(d.show(),k.stop(c))},!1);else if(this._trigger==="mouseover"){this._showDelay=e.showDelay===void 0?500:e.showDelay;e=["mouseout","click"];this._node.addEventListener("mouseover",this._mouseoverHandler=function(c){k.contains(d._node,c.target)&&(d.show(),k.stop(c))},!1);this._leaveHandler=function(c){k.contains(d._node,c.target)&&d.hide()};for(var f=0;f<e.length;f++)this._node.addEventListener(e[f],
this._leaveHandler,!1)}},_makeTipNode:function(){if(!this._tip){this._tip=document.createElement("span");this._tip.classList.add("tooltipContainer");this._tipInner=document.createElement("div");this._tipInner.classList.add("tooltip");if(this._text)this._tipTextContent=document.createElement("div"),this._tipTextContent.classList.add("textContent"),this._tipInner.appendChild(this._tipTextContent),this._tipTextContent.appendChild(document.createTextNode(this._text));this._tip.appendChild(this._tipInner);
document.body.appendChild(this._tip);var e=this;k.addAutoDismiss([this._tip,this._node],function(){e.hide()});if(this._trigger==="mouseover")this._tipInner.role="tooltip",this._tipInner.id="tooltip"+(new Date).getTime().toString(),this._node.setAttribute("aria-describedby",this._tipInner.id),this._tip.addEventListener("mouseover",function(){if(e._timeout)window.clearTimeout(e._timeout),e._timeout=null;e._tip.addEventListener("mouseout",function(d){k.contains(e._tip,d.target)&&(e.hide(),k.stop(d))},
!1)},!1)}return this._tip},_positionTip:function(e,d){this._makeTipNode();e==="left"?this._tipInner.classList.add("left"):this._tipInner.classList.remove("left");var f=this._node,c;for(c=k.bounds(f);f&&!c.width&&!c.height;f=f.parentNode)c=k.bounds(f);var f=k.bounds(this._tipInner),a;switch(e){case "above":a=c.top-f.height-this._tailSize-1;c=c.left-this._tailSize;break;case "below":a=c.top+c.height+this._tailSize+1;c=c.left-this._tailSize;break;case "left":a=c.top-this._tailSize/2;c=c.left-f.width-
this._tailSize-1;break;default:a=c.top-this._tailSize/2,c=c.left+c.width+this._tailSize+1}var i=k.bounds(document.documentElement);if(a+f.height>i.height)if(d)a=i.height-f.height-1;else return!1;if(c+f.width>i.width)if(d)c=i.width-f.width-1;else return!1;if(c<0)if(d)c=4;else return!1;if(a<0)if(d)a=4;else return!1;if(!this._tail&&(this._tail=document.createElement("span"),this._tail.classList.add("tooltipTailFrom"+e),e==="above"||e==="left"?this._tip.appendChild(this._tail):this._tip.insertBefore(this._tail,
this._tipInner),e==="left"))this._tail.style.left=f.width+"px";this._tip.style.top=a+"px";this._tip.style.left=c+"px";return!0},contentContainer:function(){this._makeTipNode();return this._tipInner},show:function(){if(!this._tip||!this._tip.classList.contains("tooltipShowing")){var e=this;if(this._timeout)window.clearTimeout(this._timeout),this._timeout=null;this._timeout=window.setTimeout(function(){for(var d=!1,f=0;!d&&f<e._position.length;)d=e._positionTip(e._position[f]),f++;d||e._positionTip(e._position[0],
!0);e._tip.classList.add("tooltipShowing");e._afterShowing&&e._afterShowing()},this._showDelay)}},hide:function(e){if(this._timeout)window.clearTimeout(this._timeout),this._timeout=null;if(this._tip&&this._tip.classList.contains("tooltipShowing")){if(e===void 0)e=this._hideDelay;var d=this;this._timeout=window.setTimeout(function(){d._tip.classList.remove("tooltipShowing");d._tip.removeAttribute("style");d._afterHiding&&d._afterHiding()},e)}},destroy:function(){if(this._timeout)window.clearTimeout(this._timeout),
this._timeout=null;if(this._tip)document.body.removeChild(this._tip),this._tail=this._tipTextContent=this._tipInner=this._tip=null;if(this._node){this._node.removeEventListener("click",this._clickHandler,!1);this._node.removeEventListener("mouseover",this._mouseoverHandler,!1);for(var e=["mouseout","click"],d=0;d<e.length;d++)this._node.removeEventListener(e[d],this._leaveHandler,!1)}}};h.prototype.constructor=h;return{Tooltip:h}});
define("orion/commands","require,orion/util,orion/webui/littlelib,orion/webui/dropdown,text!orion/webui/dropdowntriggerbutton.html,text!orion/webui/submenutriggerbutton.html,text!orion/webui/checkedmenuitem.html,orion/webui/tooltip".split(","),function(j,k,h,e,d,f,c,a){function i(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 g(b,a){for(var c in a)if(a[c]&&a[c].keyBinding&&a[c].command&&a[c].keyBinding.match(b)){var g=a[c],d=g.keyBinding;if((!d.domScope||h.contains(h.node(d.domScope),b.target))&&i(g)){h.stop(b);break}}}function b(b,a,c){a.classList.add("commandImage");var g;b.imageClass?b.addImageClassToElement?a.classList.add(b.imageClass):(g=document.createElement("span"),a.appendChild(g),
g.classList.add(b.spriteClass),g.classList.add(b.imageClass)):(g=new Image,g.alt=b.name,g.name=c,g.id=c,g.src=b.image,a.appendChild(g));return g}function l(b,a,c,g,d){this.commandRegistry=d;this.handler=b;this.items=a;this.userData=c;this.command=g;if(g.parameters)this.parameters=g.parameters.makeCopy();this.id=g.id}function n(b){this._init(b)}var m=null,o={};window.document.addEventListener("keydown",function(b){b=b||window.event;if(function(b){if(k.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}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 a=b.target.nodeName.toLowerCase();if(a==="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(a==="textarea")return}a={};if(m){var c,d,i;d=Object.keys(o);for(c=0;c<d.length;c++)i=d[c],a[i]=o[i];var l=m();d=Object.keys(l);for(c=0;c<d.length;c++)i=d[c],a[i]=l[i]}else a=o;g(b,a)},!1);l.prototype=
{collectsParameters:function(){return this.commandRegistry&&this.commandRegistry.collectsParameters()},makeCopy:function(b){var a=new l(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}};l.prototype.constructor=l;n.prototype={_init:function(b){this.id=b.id;this.name=b.name;this.tooltip=b.tooltip||b.name;this.callback=b.callback;
this.hrefCallback=b.hrefCallback;this.choiceCallback=b.choiceCallback;this.image=b.image||j.toUrl("images/none.png");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},populateChoicesMenu:function(b,a,c,g,d){this.getChoices(a,c,g).forEach(function(c){if(c.name){var g=document.createElement("li");b.appendChild(g);var q=document.createElement("span");
q.tabIndex=0;q.role="menuitem";q.classList.add("dropdownMenuItem");var i=document.createTextNode(c.name);q.appendChild(i);g.appendChild(q);q.choice=c;q.addEventListener("click",function(b){b.target.choice&&b.target.choice.callback.call(b.target.choice,a)},!1);q.addEventListener("keydown",function(b){(b.keyCode===h.KEY.ENTER||b.keyCode===h.KEY.SPACE)&&b.target.choice&&b.target.choice.callback.call(b.target.choice,a)},!1)}else d._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!==j.toUrl("images/none.png")}};n.prototype.constructor=n;return{Command:n,CommandInvocation:l,createDropdownMenu:function(a,c,g,i,l,f,p){a=h.node(a);if(!a)throw"no parent node was specified";var q=document.createRange();q.selectNode(a);q=q.createContextualFragment(d);h.processTextNodes(q,{ButtonText:c});a.appendChild(q);
a=a.lastChild;q=a.previousSibling;i?q.classList.add(i):(q.classList.add("orionButton"),q.classList.add("commandButton"));if(l){if(!f)q.textContent="",q.setAttribute("aria-label",c);b({spriteClass:"commandSprite",imageClass:l},q,c);q.classList.add("orionButton")}q.dropdown=new e.Dropdown({dropdown:a,populate:g,selectionClass:p});a.dropdown=q.dropdown;return{menuButton:q,menu:a,dropdown:q.dropdown}},createCheckedMenuItem:function(b,a,g,d){b=h.node(b);if(!b)throw"no parent node was specified";var i=
document.createRange();i.selectNode(b);i=i.createContextualFragment(c);h.processTextNodes(i,{ItemText:a});b.appendChild(i);b=h.$(".checkedMenuItem",b.lastChild);b.checked=g;b.addEventListener("change",d,!1);return b},createCommandItem:function(c,g,d,i,l,e,p){var q,e=e||!g.name&&g.hasImage();if(g.hrefCallback)q=document.createElement("a"),q.id=i,e&&g.hasImage()?b(g,q,i):(q.className="commandLink",q.appendChild(document.createTextNode(g.name))),p=g.hrefCallback.call(d.handler,d),p.then?p.then(function(b){q.href=
b}):q.href=p?p:"#";else{q=document.createElement("button");q.className="orionButton";e?g.hasImage()?(b(g,q,i),g.name&&q.setAttribute("aria-label",g.name)):(q.classList.add("commandButton"),q.classList.add("commandMissingImageButton"),q.appendChild(document.createTextNode(g.name))):(q.classList.add("commandButton"),i=document.createTextNode(g.name),q.appendChild(i));var f=p||g.callback;if(f)g.onClick=f,q.addEventListener("click",function(){f.call(d.handler,d)},!1)}c.nodeName.toLowerCase()==="ul"?(p=
document.createElement("li"),c.appendChild(p),c=p):q.classList.add("commandMargins");c.appendChild(q);if(g.tooltip)q.commandTooltip=new a.Tooltip({node:q,text:g.tooltip,position:["above","below","right","left"]});l&&(o[g.id]={keyBinding:l,command:g,invocation:d});return q},createCommandMenuItem:function(b,c,g,d,i){var l,p=b.dropdown;if(c.hrefCallback)l=document.createElement("a"),l.appendChild(document.createTextNode(c.name)),i=c.hrefCallback.call(g.handler,g),i.then?i.then(function(b){l.href=b}):
l.href=i?i:"#",l.addEventListener("keydown",function(b){(b.keyCode===h.KEY.ENTER||b.keyCode===h.KEY.SPACE)&&l.click()},!1);else{l=document.createElement("span");l.tabIndex=0;l.appendChild(document.createTextNode(c.name));var q=i||c.callback;if(q)c.onClick=q,l.addEventListener("click",function(){p.close(!0);q.call(g.handler,g)},!1),l.addEventListener("keydown",function(b){if(b.keyCode===h.KEY.ENTER||b.keyCode===h.KEY.SPACE)b.preventDefault(),l.click()},!1)}if(c.tooltip)l.commandTooltip=new a.Tooltip({node:l,
text:c.tooltip,position:["right","left","above","below"]});l.className="dropdownMenuItem";l.role="menuitem";i=document.createElement("li");b.appendChild(i);i.appendChild(l);d&&(o[c.id]={keyBinding:d,command:c,invocation:g});return l},executeBinding:i,setKeyBindingProvider:function(b){m=b},localKeyBindings:o,_testMethodProcessKey:g}});
define("orion/explorers/navigationUtils",[],function(){function j(h,e){if(!k&&h)h.push({domNode:e}),e.tabIndex=-1,e.style.outline="none"}var k=navigator.userAgent.indexOf("iPad")!==-1;return{addNavGrid:function(h,e,d){h&&(h=h.getGridNavHolder(e,!0))&&j(h,d)},generateNavGrid:j,removeNavGrid:function(h,e){if(h)for(var d=0;d<h.length;d++)if(h[d].domNode===e){h.splice(d,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(),h={resource:""},e=j.indexOf("#");if(e!==-1&&(j=j.substring(e+1),j.length!==0)){j=j.split(",");h.resource=decodeURIComponent(j[0]);for(e=1;e<j.length;e++){var d=/([^=]*)(=?)(.*)/.exec(j[e]),f=decodeURIComponent(d[1]||""),d=decodeURIComponent(d[3]||"");f!==""&&f!=="resource"&&(h[f]=d)}}return h},
validateURLScheme:function(k,h){var e=k;if(k.indexOf("://")===-1){var d=document.createElement("a");d.href=k;e=d.href}d=!1;return(d=h?h.some(function(d){return RegExp("^"+d+":","i").test(e)}):j.test(e))?k:(console.log("Illegal URL Scheme: '"+k+"'"),"")}}});
define("orion/uiUtils",["i18n!orion/nls/messages","orion/webui/littlelib"],function(j,k){function h(d){var e="",c=navigator.platform.indexOf("Mac")!==-1;d.mod1&&(e+=c?"Cmd+":"Ctrl+");d.mod2&&(e+="Shift+");d.mod3&&(e+="Alt+");d.mod4&&c&&(e+="Ctrl+");if(d.alphaKey)return e+d.alphaKey;if(d.type==="keypress")return e+d.keyCode;for(var a in k.KEY)if(typeof(k.KEY[a]==="number")&&k.KEY[a]===d.keyCode)return e+a;var i;switch(d.keyCode){case 59:i=d.mod2?":":";";break;case 61:i=d.mod2?"+":"=";break;case 188:i=
d.mod2?"<":",";break;case 190:i=d.mod2?">":".";break;case 191:i=d.mod2?"?":"/";break;case 192:i=d.mod2?"~":"`";break;case 219:i=d.mod2?"{":"[";break;case 220:i=d.mod2?"|":"\\";break;case 221:i=d.mod2?"}":"]";break;case 222:i=d.mod2?'"':"'"}return i?e+i:d.keyCode>=112&&d.keyCode<=123?e+"F"+(d.keyCode-111):e+String.fromCharCode(d.keyCode)}function e(d){var e=window.navigator.platform.indexOf("Mac")!==-1;return e&&d.metaKey||!e&&d.ctrlKey}return{getUserKeyString:function(d){for(var e="",d=d.getKeys(),
c=0;c<d.length;c++)c!==0&&(e+=" "),e+=h(d[c]);return e},getUserText:function(d,e,c,a,i,g,b,l,n){var m=!1,b=function(b){return function(l){if(!m){var h=k.node(d),o=h.value;if(h)if(b&&l.keyCode===k.KEY.ESCAPE){if(c)e.style.display="inline";m=!0;h.parentNode.removeChild(h);g&&g()}else if(!(b&&l.keyCode!==k.KEY.ENTER)){if(o.length===0||!n&&o===a){if(c)e.style.display="inline"}else if(i(o),c&&e.parentNode)e.style.display="inline";m=!0;h.parentNode&&h.parentNode.removeChild(h);g&&g()}}}},h=document.createElement("input");
h.id=d;h.value=a||"";e.parentNode.insertBefore(h,e.nextSibling);h.classList.add("userEditBoxPrompt");if(c)e.style.display="none";h.addEventListener("keydown",b(!0),!1);h.addEventListener("blur",b(!1),!1);window.setTimeout(function(){h.focus();if(a){var b=k.node(d),c=l?a.indexOf(l):-1;if(c>0)if(b.createTextRange)b=b.createTextRange(),b.collapse(!0),b.moveStart("character",0),b.moveEnd("character",c),b.select();else if(b.setSelectionRange)b.setSelectionRange(0,c);else{if(b.selectionStart!==void 0)b.selectionStart=
0,b.selectionEnd=c}else b.select()}},0)},openInNewWindow:e,followLink:function(d,f){f&&e(f)?window.open(d):window.location=d},createButton:function(d,e){var c=document.createElement("button");c.className="orionButton commandButton commandMargins";c.addEventListener("click",function(a){e();k.stop(a)},!1);d&&c.appendChild(document.createTextNode(d));return c},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","require,orion/commands,orion/explorers/navigationUtils,orion/PageUtil,orion/uiUtils,orion/webui/littlelib,orion/webui/dropdown,orion/webui/tooltip,text!orion/webui/checkedmenuitem.html,text!orion/webui/dropdowntriggerbutton.html,text!orion/webui/submenutriggerbutton.html".split(","),function(j,k,h,e,d,f,c,a,i,g,b){function l(b){this._commandList={};this._contributionsByScopeId={};this._activeBindings={};this._urlBindings={};this._pendingBindings={};this._init(b);this._parameterCollector=
null}function n(b,a){this.token=b;this.parameterName=a}function m(b,a,c,g,d){this.name=b;this.type=a;this.label=c;this.value=g;this.lines=d||1}function o(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}l.prototype={_init:function(b){this._selectionService=b.selection;var a=this;k.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 g=this._urlBindings[a],d=g.command,i=g.invocation;if(i&&i.parameters&&d.callback){i.parameters.setValue(c.parameterName,c.parameterValue);var p=this;window.setTimeout(function(){p._invoke(i)},0);break}}}},findCommand:function(b){return this._commandList[b]},runCommand:function(b,a,c,g){a?(b=this._commandList[b])&&(b.visibleWhen?b.visibleWhen(a):1)&&b.callback&&this._invoke(new k.CommandInvocation(c,
a,null,b,this),g):(a=this._urlBindings[b])&&a.command&&a.command.callback&&this._invoke(a.invocation,g)},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,g,d,i){var p=!1;if(this._parameterCollector&&!d){var q=this;this._parameterCollector.close();if(this._parameterCollector.open(b,
function(b,d){var i=document.createElement("span");i.classList.add("parameterPrompt");i.textContent=a;b.appendChild(i);i=document.createElement("button");i.addEventListener("click",function(){p=!0;q._parameterCollector.close()},!1);d.appendChild(i);i.appendChild(document.createTextNode(c));i.className="dismissButton";var l=document.createElement("button");l.addEventListener("click",function(){p=!1;q._parameterCollector.close()},!1);d.appendChild(l);l.appendChild(document.createTextNode(g));l.className=
"dismissButton";return i},function(){i(p)}))return}p=window.confirm(a);i(p)},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,c){if(b)if(this._parameterCollector&&b.parameters&&b.parameters.hasParameters()&&(c||b.parameters.shouldCollectParameters())){var g=!1;b.parameters.updateParameters(b);
if(b.parameters.shouldCollectParameters()&&(g=this._parameterCollector.collectParameters(b),!g)){var d=new a.Tooltip({node:b.domNode,afterHiding:function(){this.destroy()},trigger:"click",position:["below","right","above","left"]}),g=d.contentContainer();g.classList.add("parameterPopup");var i=window.document.activeElement,l=this._parameterCollector.getFillFunction(b,function(){i&&i.focus();d.destroy()})(g);d.show();window.setTimeout(function(){l.focus();l.select()},0);g=!0}g||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(){k.executeBinding(b)}}var c={},g,i,l=[],p;for(p in this._activeBindings)(i=this._activeBindings[p])&&i.keyBinding&&i.command&&(i.command.name||i.command.tooltip)&&l.push(i);l.sort(function(b,a){return(b.command.name||
b.command.tooltip).localeCompare(a.command.name||a.command.tooltip)});for(p=0;p<l.length;p++)i=l[p],i.keyBinding.scopeName?(c[i.keyBinding.scopeName]||(c[i.keyBinding.scopeName]=[]),c[i.keyBinding.scopeName].push(i)):(g=d.getUserKeyString(i.keyBinding),b.createItem(g,i.command.name||i.command.tooltip,a(i)));for(var q in c)c[q].length&&c[q].length>0&&(b.createHeader(q),c[q].forEach(function(c){g=d.getUserKeyString(c.keyBinding);b.createItem(g,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,g,d,i,p,q,l){this._contributionsByScopeId[b]||(this._contributionsByScopeId[b]={});b=this._contributionsByScopeId[b];d&&(b=this._createEntryForPath(b,d));if(b[a]){if(g)b[a].title=g;if(c)b[a].position=c;if(p)b[a].imageClass=p;if(q)b[a].tooltip=q;if(l)b[a].selectionClass=l;b[a].emptyGroupMessage=i}else b[a]={title:g,
position:c,emptyGroupMessage:i,imageClass:p,tooltip:q,selectionClass:l,children:{}},b.sortedContributions=null},_createEntryForPath:function(b,a){a&&a.split("/").forEach(function(a){if(a.length>1)b[a]||(b[a]={position:0,children:{}}),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,g,d,i,p){this._contributionsByScopeId[b]||
(this._contributionsByScopeId[b]={});b=this._contributionsByScopeId[b];g&&(b=this._createEntryForPath(b,g));b[a]={position:c};i&&((c=this._commandList[a])?this._addBinding(c,"key",i,d):this._addPendingBinding(a,"key",i,d));p&&((c=this._commandList[a])?this._addBinding(c,"url",p,d):this._addPendingBinding(a,"url",p,d));b.sortedContributions=null},_addBinding:function(b,a,c,g){if(!b.id)throw Error("No command id: "+b);a==="key"?this._activeBindings[b.id]={command:b,keyBinding:c,bindingOnly:g}:a==="url"&&
(this._urlBindings[b.id]={command:b,urlBinding:c,bindingOnly:g})},_addPendingBinding:function(b,a,c,g){this._pendingBindings[b]=this._pendingBindings[b]||[];this._pendingBindings[b].push({type:a,binding:c,bindingOnly:g})},_checkForTrailingSeparator:function(b,a,c){var g;if(a==="tool"||a==="button")if((g=b.childNodes.length>0?b.childNodes[b.childNodes.length-1]:null)&&g.classList.contains("commandSeparator"))return c?(b.removeChild(g),!1):!0;if(a==="menu"&&(b=f.$$array("li > *",b),b.length>0&&b[b.length-
1].classList.contains("dropdownSeparator")))if(g=b[b.length-1],c)g.parentNode.parentNode.removeChild(g.parentNode);else return!0;return!1},renderCommands:function(b,a,c,g,d,i,p){if(typeof b!=="string")throw"a scope id for rendering must be specified";a=f.node(a);if(!a)throw"no parent";var q=this._contributionsByScopeId[b];if(!c&&q){var c=q.localSelectionService||this._selectionService,l=this;c&&c.getSelections(function(c){l.renderCommands(b,a,c,g,d,i)})}else q&&(this._render(this._contributionsByScopeId[b],
a,c,g,d||"button",i,p),this._checkForTrailingSeparator(a,d,!0))},destroy:function(b){b=f.node(b);if(!b)throw"no parent";for(;b.hasChildNodes();){var a=b.firstChild;a.commandTooltip&&a.commandTooltip.destroy();a.emptyGroupTooltip&&a.emptyGroupTooltip.destroy();this.destroy(a);b.removeChild(a)}},_render:function(b,c,g,d,i,l,p){var q=b.sortedContributions;if(!q){var q=[],e=!1,f;for(f in b)if(Object.prototype.hasOwnProperty.call(b,f)){var n=b[f];if(n&&typeof n.position==="number")n.id=f,q.push(n),e=!0}if(e)q.sort(function(b,
a){return b.position-a.position}),b.sortedContributions=q}var m=0,o=this;q.forEach(function(b){var q,e;if(!b.imageClass)b.imageClass=null;if(b.children&&Object.getOwnPropertyNames(b.children).length>0){q=b.children;var f;if(i==="tool"||i==="button")if(b.title)f=o._createDropdownMenu(c,b.title,null,null,b.imageClass,b.tooltip,b.selectionClass),p&&h.generateNavGrid(p,f.menuButton),window.setTimeout(function(){o._render(b.children,f.menu,g,d,"menu",l,p);o._checkForTrailingSeparator(f.menu,"menu",!0);
if(f.menu.childNodes.length===0)if(b.emptyGroupMessage){if(!f.menuButton.emptyGroupTooltip)f.menuButton.emptyGroupTooltip=new a.Tooltip({node:f.menuButton,text:b.emptyGroupMessage,trigger:"click",position:["below","right","above","left"]})}else p&&h.removeNavGrid(p,f.menuButton),f.menu.parentNode&&f.menu.parentNode.removeChild(f.menu),f.destroyButton&&f.destroyButton.parentNode&&f.destroyButton.parentNode.removeChild(f.destroyButton);else f.menuButton.style.visibility="visible"},0);else{var x;c.childNodes.length>
0&&!o._checkForTrailingSeparator(c,i)&&(x=o.generateSeparatorImage(c));o._render(q,c,g,d,i,l,p);c.childNodes.length>0&&c.childNodes[c.childNodes.length-1]!==x&&(x=o.generateSeparatorImage(c))}else if(b.title){if(x=o._createDropdownMenu(c,b.title,!0,null,null,b.imageClass))o._render(q,x.menu,g,d,"menu",l,p),x.menu.childNodes.length===0&&x.destroyButton&&c.removeChild(x.destroyButton)}else c.childNodes.length>0&&o._generateMenuSeparator(c),o._render(q,c,g,d,i,l,p),o._generateMenuSeparator(c)}else{var n=
o._commandList[b.id];q=n?!0:!1;var A=null,A=null;if(n){e=new k.CommandInvocation(d,g,l,n,o);e.domParent=c;x=q&&(n.visibleWhen?n.visibleWhen(g):!0);if(o._activeBindings[n.id]&&o._activeBindings[n.id].keyBinding)A=o._activeBindings[n.id],A.invocation=x?e:null,A.bindingOnly&&(q=!1);if(o._urlBindings[n.id]&&o._urlBindings[n.id].urlBinding)A=o._urlBindings[n.id],A.invocation=x?e:null,A.bindingOnly&&(q=!1);q=q&&x}if(q)n.choiceCallback?(i==="tool"||i==="button"?(q=c,x=!1,c.nodeName.toLowerCase()==="ul"&&
(q=document.createElement("li"),c.appendChild(q))):(q=c,x=!0),o._createDropdownMenu(q,n.name,x,function(b){n.populateChoicesMenu(b,g,d,l,o)}.bind(n),n.imageClass,n.tooltip||n.title,n.selectionClass)):(e.handler=e.handler||this,e.domParent=c,x=function(){o._invoke(e)},i==="menu"?q=k.createCommandMenuItem(c,n,e,null,x):(q=i+n.id+m,q=k.createCommandItem(c,n,e,q,null,i==="tool",x)),h.generateNavGrid(p,q),e.domNode=q,m++)}})},_createDropdownMenu:function(g,d,i,l,e,n,p){g=f.node(g);if(!g||!f.contains(document.body,
g))return null;var q,x=g;if(i)n=document.createRange(),n.selectNode(g),n=n.createContextualFragment(b),f.processTextNodes(n,{ButtonText:d}),g.appendChild(n),q=g.lastChild,g=q.lastChild,d=g.previousSibling,d.dropdown=new c.Dropdown({dropdown:g,populate:l}),g.dropdown=d.dropdown;else if(g.nodeName.toLowerCase()==="ul"&&(x=document.createElement("li"),g.appendChild(x),q=x),g=null,e&&(g="dropdownButtonWithIcon",n=n||d),n=e?n||d:n,l=k.createDropdownMenu(x,d,l,g,e,!1,p),d=l.menuButton,g=l.menu,n)d.commandTooltip=
new a.Tooltip({node:d,text:n,position:["above","below","right","left"]});return{menuButton:d,menu:g,dropdown:d.dropdown,destroyButton:q}},_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}};l.prototype.constructor=l;n.prototype={match:function(b){b=e.matchResourceParameters(b);return typeof b[this.token]!=="undefined"?(this.parameterValue=b[this.token],this):null}};n.prototype.constructor=n;m.prototype={optionsRequested:function(){return this.optionsRequested}};m.prototype.constructor=m;o.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 m(a.name,a.type,a.label,a.value,a.lines);b.push(a)});var a=new o(b,this._options,this.getParameters);a.clientCollect=this.clientCollect;return a},hasOptionalParameters:function(){return this._hasOptionalParameters}};o.prototype.constructor=o;return{CommandRegistry:l,URLBinding:n,ParametersDescription:o,
CommandParameter:m}});
define("orion/parameterCollectors",["i18n!orion/nls/messages","require","orion/webui/littlelib"],function(j,k,h){function e(d,e){this._activeContainer=null;this._getElementsFunction=d;this._toolbarLayoutFunction=e}e.prototype={close:function(){if(this._activeElements){this._activeElements.parameterArea&&h.empty(this._activeElements.parameterArea);this._activeElements.slideContainer&&this._activeElements.slideContainer.classList.remove("slideContainerActive");this._activeElements.dismissArea&&h.empty(this._activeElements.dismissArea);
this._activeElements.commandNode&&this._activeElements.commandNode.classList.remove("activeCommand");this._toolbarLayoutFunction(this._activeElements);if(this._activeElements.onClose)this._activeElements.onClose();if(this._oldFocusNode)this._oldFocusNode.focus(),this._oldFocusNode=null}this._activeElements=null},open:function(d,e,c){typeof d==="string"&&(d=h.node(d));if(this._activeElements&&this._activeElements.slideContainer&&this._activeElements.commandNode===d)return this._activeElements.focusNode&&
this._activeElements.focusNode.focus(),!0;this.close();this._activeElements=null;if((this._activeElements=this._getElementsFunction(d))&&this._activeElements.parameterArea&&this._activeElements.slideContainer){this._activeElements.onClose=c;var a=e(this._activeElements.parameterArea,this._activeElements.dismissArea);if(!a)return!1;this._activeElements.focusNode=a;d=h.$$array("#closebox",this._activeElements.dismissArea||this._activeElements.parameterArea);if(d.length===0){e=this._activeElements.dismissArea||
this._activeElements.parameterArea;d=document.createElement("button");d.id="closebox";d.className="imageSprite core-sprite-close dismissButton";d.title=j.Close;e.appendChild(d);var i=this;d.addEventListener("click",function(){i.close()},!1)}this._activeElements.slideContainer.classList.add("slideContainerActive");this._toolbarLayoutFunction(this._activeElements);if(a)this._oldFocusNode=window.document.activeElement,window.setTimeout(function(){a.focus();a.select&&a.select()},0);this._activeElements.commandNode&&
this._activeElements.commandNode.classList.add("activeCommand");return!0}return!1},_collectAndCall:function(d,e){h.$$array("input",e).forEach(function(c){c.type==="checkbox"?d.parameters.setValue(c.parameterName,c.checked):c.type!=="button"&&d.parameters.setValue(c.parameterName,c.value.trim())});h.$$array("textArea",e).forEach(function(c){d.parameters.setValue(c.parameterName,c.value.trim())});d.command.callback&&d.command.callback.call(d.handler,d)},collectParameters:function(d){return d.parameters?
(d.domNode&&d.domNode.classList.add("commandMarker"),this.open(d.domNode||d.domParent,this.getFillFunction(d))):!1},getFillFunction:function(d,e){var c=this;return function(a,i){var g=null,b=function(){e&&e();c.close()},l=function(g){g.keyCode===h.KEY.ENTER&&c._collectAndCall(d,a);if(g.keyCode===h.KEY.ESCAPE||g.keyCode===h.KEY.ENTER)b(),h.stop(g)};d.parameters.forEach(function(c){var d=null;if(c.label)d=document.createElement("label"),d.classList.add("parameterInput"),d.setAttribute("for",c.name+
"parameterCollector"),d.textContent=c.label,a.appendChild(d);var i=c.name+"parameterCollector",e=d||a;if(c.type==="text"&&typeof c.lines==="number"&&c.lines>1)d=document.createElement("textarea"),d.rows=c.lines,d.type="textarea",d.id=i,e.appendChild(d),l=function(a){a.keyCode===h.KEY.ESCAPE&&(b(),h.stop(a))};else if(c.type==="boolean"){if(d=document.createElement("input"),d.type="checkbox",d.id=i,e.appendChild(d),c.value)d.checked=!0}else if(d=document.createElement("input"),d.type=c.type,d.id=i,
e.appendChild(d),c.value)d.value=c.value;d.classList.add("parameterInput");d.setAttribute("speech","speech");d.setAttribute("x-webkit-speech","x-webkit-speech");d.parameterName=c.name;g||(g=d);d.addEventListener("keydown",l,!1)});var n=i;n||(n=document.createElement("span"),n.classList.add("layoutRight"),n.classList.add("parametersDismiss"),a.appendChild(n));var m=function(b,a){var c=document.createElement("button");a.appendChild(c);b&&c.appendChild(document.createTextNode(b));c.classList.add("dismissButton");
return c};if(d.parameters.hasOptionalParameters())d.parameters.optionsRequested=!1,m(j.More,n).addEventListener("click",function(){d.parameters.optionsRequested=!0;c._collectAndCall(d,a);b()},!1);m(j.Submit,n).addEventListener("click",function(){c._collectAndCall(d,a);b()},!1);n=m(null,n);n.id="closebox";n.classList.add("imageSprite");n.classList.add("core-sprite-close");n.title=j.Close;n.addEventListener("click",function(){b()},!1);return g}}};e.prototype.constructor=e;return{CommandParameterCollector:e}});
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(d,c){function a(b,a,c,g){var c=a.filename.indexOf(c)>=0,d;d=g.toLowerCase();d=a.extension.indexOf(d)!==-1;if(c||d){if(!(d=!b))c&&(g=g.toLowerCase(),c=b.extension.indexOf(g)!==-1),d=c;if(d)return a}return b}if(typeof d!=="string")return null;for(var i=d&&d.split(".").pop(),g=null,b=0;b<c.length;b++){var l=c[b];a(g,l,d,i)===l&&(g=l)}return g}function k(f){this.serviceRegistry=f;this.map=function(c){function a(b){return b===null||typeof b==="undefined"?
[]:Array.isArray(b)?b:[b]}function i(b){return a(b).map(function(b){return String.prototype.toLowerCase.call(b)})}for(var c=c.getServiceReferences(e).concat(c.getServiceReferences(d)),g={},b=0;b<c.length;b++)for(var l=a(c[b].getProperty("contentTypes")),f=0;f<l.length;f++){var m=l[f];g[m.id]||(g[m.id]={id:m.id,name:m.name,image:m.image,"extends":m["extends"],extension:i(m.extension),filename:a(m.filename)})}return g}(f);f.registerService(h,this)}var h="orion.core.contentTypeRegistry",e="orion.core.contenttype",
d="orion.file.contenttype";k.prototype={getContentTypes:function(){var d=this.getContentTypesMap(),c=[],a;for(a in d)Object.prototype.hasOwnProperty.call(d,a)&&c.push(d[a]);return c},getContentTypesMap:function(){return this.map},getFileContentType:function(d){return j(d.Name,this.getContentTypes())},getFilenameContentType:function(d){return j(d,this.getContentTypes())},getContentType:function(d){return this.map[d]||null},isExtensionOf:function(d,c){d=typeof d==="string"?this.getContentType(d):d;
c=typeof c==="string"?this.getContentType(c):c;if(!d||!c)return!1;if(d.id===c.id)return!0;else for(var a=d,i={};a&&(a=this.getContentType(a["extends"]));){if(a.id===c.id)return!0;if(i[a.id])throw Error("Cycle: "+a.id);i[a.id]=!0}return!1},isSomeExtensionOf:function(d,c){for(var a=0;a<c.length;a++)if(this.isExtensionOf(d,c[a]))return!0;return!1}};return{ContentTypeRegistry:k,getFilenameContentType:j}});
define("orion/URITemplate",[],function(){function j(b){this._text=b}function k(b){return b.replace("%25","%")}function h(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(g,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 e(b,a,c){for(var g=
[],d=0;d<b.length;d++)typeof b[d]!=="undefined"&&g.push(h(b[d],a));return g.join(c)}function d(b,a,c,g){for(var d=Object.keys(b),i=[],e=0;e<d.length;e++)typeof b[d[e]]!=="undefined"&&i.push(h(d[e],a)+c+h(b[d[e]],a));return i.join(g)}function f(b){if(b.length===0)throw Error("Invalid Expression: 0 length expression");(this._operator=a[b[0]])?b=b.substring(1):this._operator=a.NUL;for(var c=[],g=b.split(","),d=0;d<g.length;d++){var e=g[d].match(i);if(e===null)throw Error("Bad VarSpec: "+b);c.push({name:e[1],
explode:!!e[2],prefix:e[3]?parseInt(e[3],10):-1})}this._varSpecList=c}function c(b){for(var a=[],c=0,g=b.indexOf("{",c);g!==-1;){a.push(new j(b.substring(c,g)));c=b.indexOf("}",g+1);if(c===-1)throw Error("Invalid template: "+b);a.push(new f(b.substring(g+1,c)));c+=1;g=b.indexOf("{",c)}a.push(new j(b.substring(c)));this._templateComponents=a}var a={NUL:{first:"",sep:",",named:!1,ifemp:"",allow:"U"},"+":{first:"",sep:",",named:!1,ifemp:"",allow:"U+R"},".":{first:".",sep:",",named:!1,ifemp:"",allow:"U"},
"/":{first:"/",sep:"/",named:!1,ifemp:"",allow:"U"},";":{first:";",sep:";",named:!0,ifemp:"",allow:"U"},"?":{first:"?",sep:"&",named:!0,ifemp:"=",allow:"U"},"&":{first:"&",sep:"&",named:!0,ifemp:"=",allow:"U"},"#":{first:"#",sep:",",named:!1,ifemp:"",allow:"U+R"},",":{first:"",sep:",",named:!1,ifemp:"",allow:"U+R-,"}},i=/^((?:(?:[a-zA-Z0-9_])|(?:%[0-9A-F][0-9A-F]))(?:(?:[a-zA-Z0-9_.])|(?:%[0-9A-F][0-9A-F]))*)(?:(\*)|:([0-9]+))?$/,g=/%25[0-9A-F][0-9A-F]/g;j.prototype={expand:function(){return encodeURI(this._text)}};
f.prototype={expand:function(b){for(var a=[],c=0;c<this._varSpecList.length;c++){var g=this._varSpecList[c],i=g.name,f=b[i],j=typeof f;if(j!=="undefined"&&f!==null){var k=a.length===0?this._operator.first:this._operator.sep;if(j==="string")this._operator.named&&(k+=h(i,"U+R"),k+=f.length===0?this._operator.ifemp:"="),g.prefix!==-1&&g.prefix<f.length&&(f=f.substring(0,g.prefix)),k+=h(f,this._operator.allow);else if(Array.isArray(f))g.explode?k+=e(f,this._operator.allow,this._operator.sep):(this._operator.named&&
(k+=h(i,"U+R"),k+=f.length===0?this._operator.ifemp:"="),k+=e(f,this._operator.allow,","));else if(j==="object")g.explode?k+=d(f,this._operator.allow,"=",this._operator.sep):(this._operator.named&&(k+=h(i,"U+R"),k+=Object.keys(f).length===0?this._operator.ifemp:"="),k+=d(f,this._operator.allow,",",","));else throw Error("bad param type: "+i+" : "+j);a.push(k)}}return a.join("")}};c.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 c});
define("orion/i18nUtil",["require","orion/Deferred"],function(j,k){function h(d){if(d=localStorage.getItem("orion/messageBundle/"+d))if(d=JSON.parse(d),d._expires&&d._expires>(new Date).getTime())return delete d._expires,d;return null}var e={};return{getMessageBundle:function(d){function f(){j(["i18n!"+d],function(a){if(a){var b=d;a._expires=(new Date).getTime()+9E5;localStorage.setItem("orion/messageBundle/"+b,JSON.stringify(a));delete a._expires}c.resolve(a)})}if(e[d])return e[d];var c=new k;e[d]=
c;var a=h(d);if(a)return c.resolve(a),c;try{j([d],f)}catch(i){j(["orion/i18n!"+d],f)}return c},formatMessage:function(d){var e=arguments;return d.replace(/\$\{([^\}]+)\}/g,function(c,a){return e[(a<<0)+1]})}}});
define("orion/PageLinks","require,orion/Deferred,orion/PageUtil,orion/URITemplate,orion/i18nUtil,orion/URL-shim".split(","),function(j,k,h,e,d){function f(){return(new URL(j.toUrl("orion/../"),window.location.href)).href.slice(0,-1)}function c(a,c){var g=a.getServiceReferences(c||"orion.page.link"),b=h.matchResourceParameters(window.location.href),l={OrionHome:f(),Location:b.resource},n=[];g.forEach(function(b){var a={};b.getPropertyKeys().forEach(function(c){a[c]=b.getProperty(c)});if(a.uriTemplate&&
a.nls&&(a.name||a.nameKey)){var c=new k;d.getMessageBundle(a.nls).then(function(b){var g=(new e(a.uriTemplate)).expand(l),g=h.validateURLScheme(g);a.href=g;a.textContent=a.nameKey?b[a.nameKey]:a.name;c.resolve(a)});n.push(c)}else if(a.uriTemplate&&a.name){var g=(new e(a.uriTemplate)).expand(l),g=h.validateURLScheme(g);a.href=g;a.textContent=a.name;n.push((new k).resolve(a))}});return k.all(n)}return{createPageLinks:function(a,d){return c(a,d).then(function(a){a.sort(function(b,a){var c=b.textContent&&
b.textContent.toLowerCase(),g=a.textContent&&a.textContent.toLowerCase();return c<g?-1:c>g?1:0});return a.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})})},getPageLinksInfo:c,getOrionHome:f}});
define("orion/extensionCommands","require,orion/Deferred,orion/commands,orion/regex,orion/contentTypes,orion/URITemplate,orion/i18nUtil,orion/URL-shim,orion/PageLinks".split(","),function(j,k,h,e,d,f,c,a,i){var g={},b=i.getOrionHome();g._cloneItemWithoutChildren=function m(b){if(b===null||typeof b!=="object")return b;var a=b.constructor(),c;for(c in b)c!=="children"&&c!=="Children"&&(a[c]=m(b[c]));return a};g._getOpenWithNavCommandExtensions=function(b){function a(b,c){for(var g=b.getServiceReferences("orion.navigate.openWith"),
d=[],p=0;p<g.length;p++){var i=g[p];i.getProperty("editor")===c.id&&(i=i.getProperty("contentType"),i instanceof Array?d=d.concat(i):i!==null&&typeof i!=="undefined"&&d.push(i))}return d}for(var c=function(){for(var a=b.getServiceReferences("orion.edit.editor"),c=[],g=0;g<a.length;g++){var d=a[g],p=d.getProperty("id");c.push({id:p,name:d.getProperty("name"),nameKey:d.getProperty("nameKey"),nls:d.getProperty("nls"),uriTemplate:d.getProperty("orionTemplate")||d.getProperty("uriTemplate"),validationProperties:d.getProperty("validationProperties")||
[]})}return c}(),g=function(b){for(b=b.getServiceReferences("orion.navigate.openWith.default");0<b.length;)return{editor:b[0].getProperty("editor")};return null}(b),d=[],i=0;i<c.length;i++){var e=c[i],l=g&&g.editor===e.id,p=a(b,e);p.length&&d.push({properties:{name:e.name||e.id,nameKey:e.nameKey,id:"eclipse.openWithCommand."+e.id,tooltip:e.name,tooltipKey:e.nameKey,contentType:p,uriTemplate:e.uriTemplate,nls:e.nls,forceSingleItem:!0,isEditor:l?"default":"editor",validationProperties:e.validationProperties},
service:{}})}return d};g._makeValidator=function(a,c,g,i){function e(b,a,c,g){var d=c.match,i;if(a.indexOf("[")===0){if(a.indexOf("]")<0)return!1;if(!Array.isArray(b))return!1;i=a.replace("[","").replace("]","");for(a=0;a<b.length;a++)if(e(b[a],i,c,g))return!0}else if(a.indexOf("|")>=0)return i=a.substring(0,a.indexOf("|")),a=a.substring(a.indexOf("|")+1),e(b,i,c,g)?!0:e(b,a,c,g);else if(a.indexOf(":")>=0)return i=a.substring(0,a.indexOf(":")),a=a.substring(a.indexOf(":")+1),b[i]?e(b[i],a,c,g):!1;
else{a:{i=!1;var l;if(a.charAt(0)==="!")c=typeof b[a.substring(1)]==="undefined";else if(typeof b[a]!=="undefined"){if(typeof d==="undefined")l=b[a],i=!0;else if(typeof d==="string"){if(!typeof(b[a]==="string")){c=!1;break a}if(c.variableName){if(d=RegExp(d).exec(b[a]))i=d[0],l=c.variableMatchPosition==="before"?b[a].substring(0,d.index):c.variableMatchPosition==="after"?b[a].substring(d.index+i.length):c.variableMatchPosition==="only"?i:b[a],i=!0}else{c=RegExp(d).test(b[a]);break a}}else b[a]===
d&&(l=b[a],i=!0);if(i&&c.variableName&&(g[c.variableName]=l,g.itemCached=b,c.replacements))for(b=0;b<c.replacements.length;b++)a=!1,c.replacements[b].pattern?g[c.variableName]=g[c.variableName].replace(RegExp(c.replacements[b].pattern),c.replacements[b].replacement||""):a=!0,a&&window.console.log("Invalid replacements specified in validation property.  "+c.replacements[b]);c=i}else c=!1}return c}}return{info:a,validationFunction:function(b){typeof i==="function"&&(b=i.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 c=0;c<b.length;c++){var l;a:{var p=b[c],q=g;if(this.info.validationProperties)for(l=0;l<this.info.validationProperties.length;l++){var f=this.info.validationProperties[l];if(typeof f.source!=="undefined"){if(!e(p,f.source,f,this)){l=!1;break a}}else{window.console.log("Invalid validationProperties in "+a.id+".  No source property specified.");l=!1;break a}}if(this.info.contentType&&q){f=!1;if(p=d.getFilenameContentType(p.Name,
q))for(l=0;l<this.info.contentType.length;l++)if(p.id===this.info.contentType[l]){f=!0;break}l=f}else l=!0}if(!l)return!1}return!0}return!1},generatesURI:function(){return!!this.info.uriTemplate},getURI:function(a){if(this.info.uriTemplate){var c={},g;for(g in a)Object.prototype.hasOwnProperty.call(a,g)&&(c[g]=a[g]);if(this.info.validationProperties)for(g=0;g<this.info.validationProperties.length;g++){var d=this.info.validationProperties[g];d.source&&d.variableName&&(this.itemCached===a&&this[d.variableName]||
e(a,d.source,d,this),a[d.variableName]?window.console.log("Variable name "+d.variableName+" in the extension "+this.info.id+" conflicts with an existing property in the item metadata."):c[d.variableName]=this[d.variableName])}c.OrionHome=b;return(new f(this.info.uriTemplate)).expand(c)}return null}}};g._createCommandOptions=function(b,a,d,i,e,l){function f(c,q){var x=g._makeValidator(b,d,i,l);c.visibleWhen=x.validationFunction.bind(x);if(e)if(x.generatesURI.bind(x)())c.hrefCallback=function(b){b=
Array.isArray(b.items)?b.items[0]:b.items;return x.getURI.bind(x)(b)};else{var h=b;c.callback=function(b){var q;if(h.forceSingleItem)b=Array.isArray(b.items)?b.items[0]:b.items,q=g._cloneItemWithoutChildren(b);else if(Array.isArray(b.items)){q=[];for(var i=0;i<b.items.length;i++)q.push(g._cloneItemWithoutChildren(b.items[i]))}else q=g._cloneItemWithoutChildren(b.items);if(d)var e=d.getService("orion.page.progress");a.run?e?e.progress(a.run(q),"Running command: "+c.name):a.run(q):d&&(e?e.progress(d.getService(a).run(q),
"Running command: "+c.name):d.getService(a).run(q))}}q.resolve(c)}var h=new k;b.nls?c.getMessageBundle(b.nls).then(function(a){f({name:b.nameKey?a[b.nameKey]:b.name,image:b.image,id:b.id||b.name,tooltip:b.tooltipKey?a[b.tooltipKey]:b.tooltip,isEditor:b.isEditor,showGlobally:b.showGlobally},h)}):f({name:b.name,image:b.image,id:b.id||b.name,tooltip:b.tooltip,isEditor:b.isEditor,showGlobally:b.showGlobally},h);return h};g.getOpenWithCommands=function(b){var a=[],c;for(c in b._commandList){var g=b._commandList[c];
g.isEditor&&a.push(g)}return a};var l;g.createAndPlaceFileCommandsExtension=function(b,a,c,d,i,e){var l=!!e;return g.createFileCommands(b,null,e?"all":void 0,l).then(function(b){a._addedOpenWithCommands=l;var g=!1,q=!1;b.forEach(function(b){a.addCommand(b);i&&!g&&(g=!0,a.addCommandGroup(c,"eclipse.fileCommandExtensions",1E3,null,i));i&&!q&&(q=!0,a.addCommandGroup(c,"eclipse.openWith",1E3,"Open With",i+"/eclipse.fileCommandExtensions"));this.isEditor?a.registerCommandContribution(c,b.id,d+this.index,
i?i+"/eclipse.fileCommandExtensions/eclipse.openWith":null):a.registerCommandContribution(c,b.id,d+this.index,i?i+"/eclipse.fileCommandExtensions":null)});return{}})};g.createFileCommands=function(b,a,c,d){var c=c===void 0?"global":c,d=d===void 0?!0:d,i=b.getServiceReferences("orion.navigate.command"),e=[];if(c==="all"||c==="global")for(var f=0;f<i.length;f++)if(i[f].getProperty("id")!=="orion.navigateFromMetadata"){for(var j=b.getService(i[f]),p={},q=i[f].getPropertyKeys(),x=0;x<q.length;x++)p[q[x]]=
i[f].getProperty(q[x]);(c==="all"||p.forceSingleItem&&p.showGlobally)&&e.push({properties:p,service:j})}return k.when(function(){var c=b.getService("orion.core.contentTypeRegistry")||a;return l||k.when(c.getContentTypes(),function(b){return l=b})}(),function(){e=d?e.concat(g._getOpenWithNavCommandExtensions(b,l)):e;var a=e.map(function(a){var c=a.properties;return g._createCommandOptions(c,a.service,b,l,!0).then(function(b){b=new h.Command(b);if(c.isEditor)b.isEditor=c.isEditor;return b})});return k.all(a,
function(b){return{_error:b}}).then(function(b){return b})})};g.createOpenWithCommands=function(b,a,c){return c&&c._addedOpenWithCommands?(new k).resolve(g.getOpenWithCommands(c)):g.createFileCommands(b,a,"none",!0)};return g});
define("orion/breadcrumbs",["require","orion/webui/littlelib"],function(j,k){function h(e){this._init(e)}h.prototype={_init:function(e){var d=k.node(e.container);if(!d)throw"no parent container";this._container=d;d.classList.remove("currentLocation");this._id=e.id||"eclipse.breadcrumbs";this._resource=e.resource||null;this._rootSegmentName=e.rootSegmentName;this._workspaceRootSegmentName=e.workspaceRootSegmentName;this._workspaceRootURL=e.workspaceRootURL;this._makeHref=e.makeHref;this.path="";this.measure();
this.render()},getNavigatorWorkspaceRootSegment:function(){if(this._workspaceRootSegmentName){var e;if(this._resource&&this._resource.Parents){e=document.createElement("a");var d=this._workspaceRootURL?this._workspaceRootURL:"";this._makeHref?this._makeHref(e,d):e.href=j.toUrl("edit/edit.html")+"#"+d}else e=document.createElement("span");k.empty(e);e.appendChild(document.createTextNode(this._workspaceRootSegmentName));return e}return null},MAX_LENGTH:500,INCLUDE_FIRST_SECTION:!0,segments:[],buildSegment:function(e){var d=
document.createElement("a");d.classList.add("breadcrumb");d.appendChild(document.createTextNode(e));return d},addSegmentHref:function(e,d){this._makeHref?this._makeHref(e,d.Location,d):e.href=j.toUrl("edit/edit.html")+"#"+d.ChildrenLocation},buildSegments:function(e,d){if(this._resource.Parents){var f=this._resource.Parents.slice(0),c,a;f&&(f=f.slice(0),d==="reverse"&&(f=f.reverse().slice(0)),f.forEach(function(d){e?(a=e,e=null):a=d.Name;c=this.buildSegment(a);this.path+=d.Name;this.addSegmentHref(c,
d);c.include=!1;this.segments.push(c)}.bind(this)))}},addDivider:function(){var e=document.createElement("span");e.appendChild(document.createTextNode(" / "));this.path+="/";e.classList.add("breadcrumbSeparator");this.append(e)},refresh:function(){(this.crumbs=k.node(this._id))?k.empty(this.crumbs):(this.crumbs=document.createElement("span"),this.crumbs.id=this._id,this._container.appendChild(this.crumbs),this.dirty=document.createElement("span"),this.dirty.id="dirty",this.dirty.className="modifiedFileMarker",
this._container.appendChild(this.dirty));this.crumbs.style.width="auto";this.crumbs.style.visibility="visible";this.crumbs.parentNode.className="currentLocation";this.crumbs.parentNode.style.width="auto"},append:function(e){this.crumbs.appendChild(e)},addTitle:function(e,d){var f=d||document.title;this.crumbs.childNodes.length===0&&(e=document.createElement("span"),e.appendChild(document.createTextNode(f)),e.classList.add("breadcrumb"),e.classList.add("currentLocation"),this.append(e))},finalSegment:function(e,
d){e=document.createElement("span");d?e.appendChild(document.createTextNode(d)):e.appendChild(document.createTextNode(this._resource.Name));e.classList.add("currentLocation");this.path+=this._resource.Name;this.append(e)},firstSegment:function(e){if(e)this.append(e),this._resource&&this._resource.Parents?(e.classList.add("breadcrumb"),this.addDivider()):(e.href="",e.classList.add("currentLocation"))},drawSegments:function(){this._resource.Parents&&this.segments.slice(0).forEach(function(e){e.include===
!0&&(this.append(e),this.addDivider())}.bind(this))},measureSegments:function(){this.INCLUDE_FIRST_SECTION=!0;if(this._resource.Parents){var e=this.segments.slice(0).reverse();e.forEach(function(d){this.append(d);this.addDivider();this.crumbs.offsetWidth<this.MAX_LENGTH?d.include=!0:this.INCLUDE_FIRST_SECTION=!1}.bind(this));this.segments=e.reverse()}},measure:function(){var e=document.getElementById("location");e.style.width="auto";this.MAX_LENGTH=e.offsetWidth;this.refresh();this.segments=[];this.crumbs.style.visibility=
"hidden";var e=this.getNavigatorWorkspaceRootSegment(),d=this._rootSegmentName;if(d)this.addTitle(e,d);else if(this.finalSegment(e,d),this._resource&&this._resource.Parents&&(this.buildSegments(d,"reverse"),this.measureSegments(),this.firstSegment(e)),this.crumbs.offsetWidth>=this.MAX_LENGTH)this.INCLUDE_FIRST_SECTION=!1},render:function(){this.refresh();var e=this.getNavigatorWorkspaceRootSegment(),d=this._rootSegmentName;d?this.addTitle(e,d):(this.INCLUDE_FIRST_SECTION===!0&&this.firstSegment(e),
this._resource&&this._resource.Parents&&(this.drawSegments(),this.finalSegment(e,d)));this.crumbs.parentNode.style.width=this.crumbs.offsetWidth+20+"px"}};h.prototype.constructor=h;return{BreadCrumbs:h}});
define("orion/webui/splitter",["require","orion/EventTarget","orion/webui/littlelib"],function(j,k,h){function e(d){k.attach(this);this._init(d)}e.prototype={_init:function(d){this._tracking=null;this._animationDelay=501;this.$node=h.node(d.node);if(!this.$node)throw"no dom node for splitter found";this.$sideNode=h.node(d.sidePanel);if(!this.$sideNode)throw"no dom node for side panel found";this.$mainNode=h.node(d.mainPanel);if(!this.$mainNode)throw"no dom node for main panel found";this._vertical=
d.vertical;this._prefix="/orion/splitter/"+(this.$node.id||document.body.id||"");if(d.toggle)this._thumb=document.createElement("div"),this.$node.appendChild(this._thumb),this._thumb.classList.add("splitThumb"),this._thumb.classList.add(this._vertical?"splitVerticalThumbLayout":"splitThumbLayout");this._closeByDefault=this.$node.getAttribute("data-initial-state")==="closed";if(typeof d.closeByDefault!=="undefined")this._closeByDefault=d.closeByDefault;this._initializeFromStoredSettings();this._closed?
(this._closed=!1,this._thumbDown(!0,!0)):this._adjustToSplitPosition();this.$node.style.visibility="visible";this.$mainNode.style.display="block";this.$sideNode.style.display="block";this.$node.addEventListener("mousedown",this._mouseDown.bind(this),!1);window.addEventListener("mouseup",this._mouseUp.bind(this),!1);window.addEventListener("resize",this._resize.bind(this),!1)},isClosed:function(){return this._closed},toggleSidePanel:function(){this._thumbDown()},openSidePanel:function(){this._closed||
this._thumbDown()},addResizeListener:function(d){this.addEventListener("resize",function(e){d(e.node)})},_initializeFromStoredSettings:function(){var d=localStorage.getItem(this._prefix+"/toggleState");this._closed=typeof d==="string"?d==="closed":this._closeByDefault;if(this._vertical)if(d=localStorage.getItem(this._prefix+"/yPosition"))this._splitTop=parseInt(d,10);else{if(this._closeByDefault)this._initialSplit=this._getSplitPosition(),this._splitTop=0}else if(d=localStorage.getItem(this._prefix+
"/xPosition"))this._splitLeft=parseInt(d,10);else if(this._closeByDefault)this._initialSplit=this._getSplitPosition(),this._splitLeft=0},_getSplitPosition:function(){var d=h.bounds(this.$node),e=h.bounds(this.$node.parentNode);return this.vertical?d.top-e.top:d.left-e.left},_adjustToSplitPosition:function(d){var e=h.bounds(this.$node),c=h.bounds(this.$node.parentNode);if(this._vertical){this._splitHeight=e.height;if(d||!this._splitTop)this._splitTop=e.top,localStorage.setItem(this._prefix+"/yPosition",
this._splitTop);d=this._splitTop;this.$node.parentNode.style.position==="relative"&&(d=this._splitTop-c.top);this.$sideNode.style.height=d+"px";this.$sideNode.style.display="block";this.$node.style.top=d+"px"}else{this._splitWidth=e.width;if(d||!this._splitLeft)this._splitLeft=e.left,localStorage.setItem(this._prefix+"/xPosition",this._splitLeft);d=this._splitLeft;this.$node.parentNode.style.position==="relative"&&(d=this._splitLeft-c.left);this.$sideNode.style.width=d+"px";this.$sideNode.style.display=
"block";this.$node.style.left=d+"px"}this._resize()},_resize:function(d,e,c){var d=d||0,a=h.bounds(this.$node.parentNode),i=h.bounds(this.$node);if(this._vertical){if(c===void 0)c=i.top,this.$node.parentNode.style.position==="relative"&&(c-=a.top);c+=i.height;this.$mainNode.style.top=c+"px"}else{if(e===void 0)e=i.left,this.$node.parentNode.style.position==="relative"&&(e-=a.left);e+=i.width;this.$mainNode.style.left=e+"px"}var g=this;window.setTimeout(function(){g._notifyResizeListeners(g.$mainNode);
g._notifyResizeListeners(g.$sideNode)},d)},_notifyResizeListeners:function(d){this.dispatchEvent({type:"resize",node:d})},_notifyToggleListeners:function(){this.dispatchEvent({type:"toggle",closed:this._closed})},_thumbDown:function(d,e){d||this._addAnimation();var c=this._splitTop,a=this._splitLeft;if(this._closed){if(this._closed=!1,!this._splitLeft&&!this._splitTop&&typeof this._initialSplit==="number")c=a=this._initialSplit}else this._closed=!0,c=a=0;this._vertical?(this.$sideNode.style.height=
c+"px",this.$node.style.top=c+"px"):(this.$sideNode.style.width=a+"px",this.$node.style.left=a+"px");this._resize(this._animationDelay,a,c);d||this._removeAnimation();e||localStorage.setItem(this._prefix+"/toggleState",this._closed?"closed":null);var i=this;window.setTimeout(function(){i._notifyToggleListeners()},this._animationDelay)},_removeAnimation:function(){var d=this;window.setTimeout(function(){d.$sideNode.classList.remove(d._vertical?"sidePanelVerticalLayoutAnimation":"sidePanelLayoutAnimation");
d.$mainNode.classList.remove(d._vertical?"mainPanelVerticalLayoutAnimation":"mainPanelLayoutAnimation");d.$node.classList.remove(d._vertical?"splitVerticalLayoutAnimation":"splitLayoutAnimation")},this._animationDelay)},_addAnimation:function(){this.$sideNode.classList.add(this._vertical?"sidePanelVerticalLayoutAnimation":"sidePanelLayoutAnimation");this.$mainNode.classList.add(this._vertical?"mainPanelVerticalLayoutAnimation":"mainPanelLayoutAnimation");this.$node.classList.add(this._vertical?"splitVerticalLayoutAnimation":
"splitLayoutAnimation")},_mouseDown:function(d){if(d.target===this._thumb)return h.stop(d),this._thumbDown();if(!this._tracking)this.$node.classList.add("splitTracking"),this.$mainNode.classList.add("panelTracking"),this.$sideNode.classList.add("panelTracking"),this._tracking=this._mouseMove.bind(this),window.addEventListener("mousemove",this._tracking),h.stop(d)},_mouseMove:function(d){if(this._tracking){var e=h.bounds(this.$node.parentNode);if(this._vertical){this._splitTop=d.clientY;if(this._splitTop<
e.top+5)this._splitTop=e.top+5;else if(this._splitTop>e.top+e.height-5)this._splitTop=e.top+e.height-5;var c=this._splitTop;this.$node.parentNode.style.position==="relative"&&(c=this._splitTop-e.top);this.$node.style.top=c+"px"}else{this._splitLeft=d.clientX;if(this._splitLeft<e.left+5)this._splitLeft=e.left+5;else if(this._splitLeft>e.left+e.width-5)this._splitLeft=e.left+e.width-5;c=this._splitLeft;this.$node.parentNode.style.position==="relative"&&(c=this._splitLeft-e.left);this.$node.style.left=
c+"px"}this._adjustToSplitPosition(!0);h.stop(d)}},_mouseUp:function(d){if(this._tracking)window.removeEventListener("mousemove",this._tracking),this._tracking=null,this.$node.classList.remove("splitTracking"),this.$mainNode.classList.remove("panelTracking"),this.$sideNode.classList.remove("panelTracking"),h.stop(d)}};e.prototype.constructor=e;return{Splitter:e}});
define("orion/widgets/themes/ThemePreferences",[],function(){function j(j,h){this._preferences=j;this._themeData=h;var e=h.getThemeStorageInfo(),d=j.listenForChangedSettings(e.storage,2,function(e){e.key===d&&this.apply()}.bind(this))}j.prototype={_initialize:function(j,h,e){var d=e.get(j.styleset);d||(d=h.getStyles(),e.put(j.styleset,JSON.stringify(d)));(h=e.get("selected"))&&(h=JSON.parse(h));if(!h||h[j.selectedKey]===void 0)h=h||{},h[j.selectedKey]=j.defaultTheme,e.put("selected",JSON.stringify(h))},
apply:function(){this.setTheme()},getTheme:function(j){var h=this._themeData,e=h.getThemeStorageInfo();this._preferences.getPreferences(e.storage,2).then(function(d){this._initialize(e,h,d);var f=JSON.parse(d.get("selected")),d=JSON.parse(d.get(e.styleset)),c;if(d)for(var a=0;a<d.length;a++)if(d[a].name===f[e.selectedKey]){c=d[a];break}j({style:c,styles:d})}.bind(this))},setTheme:function(j,h){var e=this._themeData,d=e.getThemeStorageInfo();this._preferences.getPreferences(d.storage,2).then(function(f){this._initialize(d,
e,f);var c=JSON.parse(f.get("selected"));j||(j=c[d.selectedKey]);c[d.selectedKey]=j;f.put("selected",JSON.stringify(c));h?f.put(d.styleset,JSON.stringify(h)):h=JSON.parse(f.get(d.styleset));for(f=0;f<h.length;f++)if(h[f].name===c[d.selectedKey]){e.processSettings(h[f]);break}}.bind(this))},setFontSize:function(j){var h=this._themeData,e=h.getThemeStorageInfo();this._preferences.getPreferences(e.storage,2).then(function(d){this._initialize(e,h,d);var f=JSON.parse(d.get("selected")),c=JSON.parse(d.get(e.styleset)),
a;if(c)for(var i=0;i<c.length;i++)c[i].fontSize=j,c[i].name===f[e.selectedKey]&&(a=c[i]);d.put(e.styleset,JSON.stringify(c));h.processSettings(a)}.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 Settings":"Git Settings",General:"General",Navigation:"Navigation",Links:"Links","Open in same tab":"Open in same tab","Open in new tab":"Open in new tab",Font:"Font",Family:"Family","Sans Serif":"Sans Serif",Serif:"Serif",Size:"Size","8pt":"8pt","9pt":"9pt","10pt":"10pt","12pt":"12pt",Color:"Color",
Background:"Background",Strings:"Strings","String Types":"String Types",blue:"blue",Weight:"Weight",Normal:"Normal",Bold:"Bold",Comments:"Comments","Comment Types":"Comment Types",green:"green",Keywords:"Keywords","Keyword Types":"Keyword Types",darkred:"darkred",Categories:"Categories",Username:"Username","Full Name":"Full Name","Email Address":"Email Address","Email Confirmed":"Email Confirmed",Account:"Account","Current Password":"Current Password","New Password":"New Password","Verify Password":"Verify Password",
Password:"Password",OpenId:"OpenId",AOL:"AOL",Yahoo:"Yahoo",Google:"Google",Unlink:"Unlink",Link:"Link",Unlinked:"Unlinked",Linked:"Linked","Linked Accounts":"Linked Accounts","Git Email Address":"Git Email Address","Git Username":"Git Username","Git Credentials Storage":"Git Credentials Storage",Update:"Update","Update Profile Settings":"Update Profile Settings","Update Git User Settings":"Update Git User Settings","Update Git Credentials":"Update Git Credentials","User profile data successfully updated.":"User profile data successfully updated.",
"Git user data successfully updated.":"Git user data successfully updated.","Git Credentials successfully updated.":"Git Credentials successfully updated.","Edit Plugin JavaScript":"Edit Plugin JavaScript","Install Plugin":"Install Plugin","Plugin Name:":"Plugin Name:","Author Name:":"Author Name:","Licence:":"Licence:","Description:":"Description:","A plugin for Eclipse Orion":"A plugin for Eclipse Orion","Plugin Link":"Plugin Link",Install:"Install","Install a plugin by specifying its URL":"Install a plugin by specifying its URL",
"Plugin URL:":"Plugin URL:",Disable:"Disable",DisableTooltip:"Disable the plugin",Enable:"Enable",EnableTooltip:"Enable the plugin","Reload all":"Reload all","Reload all installed plugins":"Reload all installed plugins","Create a new Orion Plugin":"Create a new Orion Plugin","Find More Orion Plugins":"Find More Orion Plugins","Get Plugins":"Get Plugins",Reload:"Reload","Reload the plugin":"Reload the plugin",Delete:"Delete","Delete this plugin from the configuration":"Delete this plugin from the configuration",
"Type a plugin url here ...":"Type a plugin url here ...","Installed ":"Installed ","Installing ":"Installing ","Already installed":"Already installed"," plugin":" plugin","Reloaded ":"Reloaded ","Uninstalled ":"Uninstalled ","Are you sure you want to uninstall '":"Are you sure you want to uninstall '",Services:"Services",Value:"Value","JavaScript Object":"JavaScript Object","click here, then check javascript console to drill down":"click here, then check javascript console to drill down",Item:"Item",
"Git Config":"Git Config","Clear Git Credentials":"Clear Git Credentials","Enable Storage":"Enable Storage","Please be aware that your credentials will be stored persistently in the browser.":"Please be aware that your credentials will be stored persistently in the browser.","Do you wish to enable the Key Storage?":"Do you wish to enable the Key Storage?",general:"General",validation:"Validation","Deleted git credentials for ${0}":"Deleted git credentials for ${0}",Editor:"Editor",editorSettings:"Settings",
EditorThemes:"Themes",Import:"Import","Import a theme":"Import a theme",fileManagement:"File Management",typing:"Typing",autoSave:"Auto Save",autoSaveTimeout:"Save interval (ms)",autoLoad:"Auto Load",saveDiffs:"Save file as diffs",trimTrailingWhiteSpace:"Trim Trailing Whitespace on Save",Restore:"Restore Defaults",Default:"Default",keys:"Keys",tabs:"Tabs",tabSize:"Tab Size",expandTab:"Insert spaces for tabs",smoothScrolling:"Smooth Scrolling",scrollAnimation:"Scrolling Animation",scrollAnimationTimeout:"Scrolling Duration (ms)",
keyBindings:"Key Bindings",rulers:"Rulers",annotationRuler:"Show Annotation Ruler",lineNumberRuler:"Show Line Number Ruler",foldingRuler:"Show Folding Ruler",overviewRuler:"Show Overview Ruler",whitespaces:"White Spaces",wrapping:"Wrapping",wordWrap:"Word Wrap",showMargin:"Show Margin",marginOffset:"Margin Column",showTabs:"Show Tabs",showSpaces:"Show Spaces",autoSaveTimeoutInvalid:"Invalid save interval.",scrollAnimationTimeoutInvalid:"Invalid scrolling duration.",tabSizeInvalid:"Invalid tab size.",
localSettingsTooltip:"Toggle whether this setting is shown in local editor settings drop down.",autoPairParentheses:"Autopair (Parentheses)",autoPairBraces:"Autopair {Braces}",autoPairSquareBrackets:"Autopair [Square] Brackets",autoPairAngleBrackets:"Autopair <Angle> Brackets",autoPairQuotations:'Autopair "Strings"',autoCompleteComments:"Autocomplete /** Block Comments */",smartIndentation:"Smart Indentation",sourceControl:"Source Control",showBlame:"Show Blame","Editor preferences updated":"Editor preferences updated",
"Editor defaults restored":"Editor defaults restored",Theme:"Theme","Font Size":"Font Size","New Theme Name:":"New Theme Name:","Font Size:":"Font Size:","UI Theme":"UI Theme","Navigation Bar":"Navigation Bar","Navigation Text":"Navigation Text","Search Box":"Search Box","Tool Panel":"Tool Panel","Selection Bar":"Selection Bar",Location:"Location",Content:"Content","Main Panel":"Main Panel",Button:"Button","Button Text":"Button Text","Section Text":"Section Text","Side Panel":"Side Panel","Line Color":"Line Color",
"Line Numbers":"Line Numbers",Foreground:"Foreground","Current Line":"Current Line","HTML Attribute":"HTML Attribute","Overview Ruler":"Overview Ruler","HTML Tag":"HTML Tag","Annotation Ruler":"Annotation Ruler","Show Guide":"Show Guide","Check Guide":"Check Guide",Cancel:"Cancel","Revert Theme":"Revert Theme","Update Theme":"Update Theme","Theme:":"Theme:",clickDiagram:"Click diagram to style.",clickUpdate:"Click Update button to save preview.","CSS Class Name":"CSS Class Name","CSS Attribute":"CSS Attribute",
"CSS Value":"CSS Value","CSS Text":"CSS Text","COLOR:":"Color:","NEW COLOR:":"New Color:",Ok:"Ok","OR HEX:":"Or Hex: "});define("orion/settings/nls/messages",["orion/i18n!orion/settings/nls/messages","orion/settings/nls/root/messages"],function(j,k){var h={root:k};Object.keys(j).forEach(function(e){typeof h[e]==="undefined"&&(h[e]=j[e])});return h});
define("orion/editor/eventTarget",[],function(){function j(){}j.addMixin=function(k){var h=j.prototype,e;for(e in h)h.hasOwnProperty(e)&&(k[e]=h[e])};j.prototype={addEventListener:function(j,h,e){if(!this._eventTypes)this._eventTypes={};var d=this._eventTypes[j];d||(d=this._eventTypes[j]={level:0,listeners:[]});d.listeners.push({listener:h,useCapture:e})},dispatchEvent:function(j){var h=j.type;this._dispatchEvent("pre"+h,j);this._dispatchEvent(h,j);this._dispatchEvent("post"+h,j)},_dispatchEvent:function(j,
h){var e=this._eventTypes?this._eventTypes[j]:null;if(e){var d=e.listeners;try{if(e.level++,d)for(var f=0,c=d.length;f<c;f++)if(d[f]){var a=d[f].listener;typeof a==="function"?a.call(this,h):a.handleEvent&&typeof a.handleEvent==="function"&&a.handleEvent(h)}}finally{if(e.level--,e.compact&&e.level===0){for(f=d.length-1;f>=0;f--)d[f]||d.splice(f,1);d.length===0&&delete this._eventTypes[j];e.compact=!1}}}},isListening:function(j){return!this._eventTypes?!1:this._eventTypes[j]!==void 0},removeEventListener:function(j,
h,e){if(this._eventTypes){var d=this._eventTypes[j];if(d){for(var f=d.listeners,c=0,a=f.length;c<a;c++){var i=f[c];if(i&&i.listener===h&&i.useCapture===e){d.level!==0?(f[c]=null,d.compact=!0):f.splice(c,1);break}}f.length===0&&delete this._eventTypes[j]}}}};return{EventTarget:j}});
define("orion/editor/textTheme",["require","orion/editor/eventTarget","orion/util"],function(j,k,h){function e(d){d=d||{};this._document=d.document||document}var d={};e.getTheme=function(f){var f=f||"default",c=d[f];c||(c=d[f]=new e);return c};e.prototype={getThemeClass:function(){return this._themeClass},setThemeClass:function(d,c){var a=this,i=a._themeClass;a._themeClass=d;this._load(d,c,function(){a.onThemeChanged({type:"ThemeChanged",oldValue:i,newValue:a.getThemeClass()})})},onThemeChanged:function(d){return this.dispatchEvent(d)},
buildStyleSheet:function(d,c){function a(a,b,c){b&&(i.push("."+d+" ."+a+" {"),i.push("\t"+(c?"background-color":"color")+": "+b+";"),i.push("}"))}var i=[];i.push("");i.push("."+d+" {");c.fontFamily&&i.push("\tfont-family: "+c.fontFamily+";");c.fontSize&&i.push("\tfont-size: "+c.fontSize+";");c.fontSize&&i.push("\tcolor: "+c.text+";");i.push("}");i.push("."+d+".textview {");c.background&&i.push("\tbackground-color: "+c.background+";");i.push("}");a("ruler.annotations",c.annotationRuler,!0);a("ruler.lines",
c.annotationRuler,!0);a("ruler.folding",c.annotationRuler,!0);a("ruler.overview",c.overviewRuler,!0);a("rulerLines",c.lineNumber,!1);a("rulerLines.even",c.lineNumberEven,!1);a("rulerLines.odd",c.lineNumberOdd,!1);a("annotationLine.currentLine",c.currentLine,!0);a("entity-name-tag",c.keyword,!1);a("entity-other-attribute-name",c.attribute,!1);a("string-quoted",c.string,!1);a("line_caret",c.currentLine,!0);a("token_keyword",c.keyword,!1);a("token_string",c.string,!1);a("token_singleline_comment",c.comment,
!1);a("token_multiline_comment",c.comment,!1);a("token_doc_comment",c.comment,!1);a("token_doc_html_markup",c.comment,!1);return i.join("\n")},_createStyle:function(d,c,a,i){var g=this._document,d="orion-theme-"+d,b=g.getElementById(d);if(b){if(i||b.firstChild.data===c)return;b.removeChild(b.firstChild);b.appendChild(g.createTextNode(c))}else i?(b=h.createElement(g,"link"),b.rel="stylesheet",b.type="text/css",b.href=c,b.addEventListener("load",function(){a()})):(b=h.createElement(g,"style"),b.appendChild(g.createTextNode(c))),
b.id=d,(g.getElementsByTagName("head")[0]||g.documentElement).appendChild(b);i||a()},_load:function(d,c,a){if(d)if(typeof c==="string")this._createStyle(d,c,a);else if(c=c.href,c.substring(c.length-4)!==".css"&&(c+=".css"),/^\//.test(c)||/[a-zA-Z0-9]+:\/\//i.test(c)||!j.toUrl)this._createStyle(d,c,a,!0);else{var i=this;j(["text!"+c],function(c){i._createStyle(d,c,a,!1)})}else a()}};k.EventTarget.addMixin(e.prototype);return{TextTheme:e}});
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="#333";k.prototype.button="#777777";k.prototype.location="#EFEFEF";k.prototype.selection="FEC";k.prototype.sidepanel="#FBFBFB";k.prototype.mainpanel="white";k.prototype.navtext="#bfbfbf";k.prototype.content="#3087B3";k.prototype.search="#444";k.prototype.toolpanel="white";k.prototype.writeNavigationStyle=function(){var h="",e=[],d=new j.ThemeClass("orionPage");
d.style.backgroundColor="#fdfdfd";d.style.width="100%";d.style.height="100%";e.push(d);d=new j.ThemeClass("topRowBanner");d.style.margin="0";d.style.border="0";d.style.backgroundColor=this.navbar;d.style.height="16px";d.style.padding="10px";d.style.paddingLeft="6px";d.style.paddingRight="2px";e.push(d);d=new j.ThemeClass("a");d.style.textDecoration="none";d.style.color=this.content;e.push(d);d=new j.ThemeClass("navlink");d.style.display="inline-block";d.style.padding="2px";d.style.color=this.content;
e.push(d);d=new j.ThemeClass("primaryNav");d.style.color=this.navtext;d.style.fontSize="8pt";d.style.fontWeight="normal";d.style.paddingTop="0";d.style.verticalAlign="baseline";e.push(d);d=new j.ThemeClass("primaryNav a");d.style.fontSize="8pt";d.style.color=this.navtext;d.style.marginRight="6px";d.style.marginLeft="6px";d.style.verticalAlign="baseline";d.style.textDecoration="none";e.push(d);d=new j.ThemeClass("primaryNav a:hover");d.style.color="#bfbfbf";d.style.cursor="hand";d.style.color="white";
d.style.fontWeight="normal";e.push(d);for(var f in e)h+=e[f].toString();return h};k.prototype.writeLocationStyle=function(){var h="",e=[],d=new j.ThemeClass("titleArea");d.style.margin="0";d.style.paddingTop="5px";d.style.border="0";d.style.background=this.location;d.style.background="-webkit-gradient(linear, left top, left bottom, color-stop(0%,"+this.location+"), color-stop(100%,"+this.location+"))";d.style.borderBottom="1px solid "+this.location;d.style.minHeight="20px";e.push(d);d=new j.ThemeClass("breadcrumb");
d.style.fontSize="8pt";d.style.textDecoration="none";d.style.color="#f1f1f2;";d.style.paddingTop="2px";e.push(d);d=new j.ThemeClass("a.breadcrumb:hover");d.style.textDecoration="none";d.style.borderBottom="1px dotted";d.style.color="#F58B0F";d.style.cursor="pointer";e.push(d);d=new j.ThemeClass("breadcrumbSeparator");d.style.fontSize="8pt";d.style.textDecoration="none";d.style.color="#f1f1f2";d.style.fontWeight="bold";e.push(d);d=new j.ThemeClass("currentLocation");d.style.fontWeight="bold";d.style.fontSize=
"8pt";d.style.color="#f1f1f2";d.style.textDecoration="none";d.style.textWrap="normal";d.style.lineHeight="10pt";e.push(d);d=new j.ThemeClass("a.currentLocation:hover");d.style.fontWeight="bold";d.style.fontSize="10pt";d.style.color="#666666";d.style.textDecoration="none";d.style.borderBottom="0";e.push(d);d=new j.ThemeClass("navlinkonpage");d.style.color=this.content;e.push(d);d=new j.ThemeClass("progressPane_running");d.style.background="url(../images/progress_running_dark.gif) no-repeat center";
d.style.width="16px";d.style.height="16px";e.push(d);for(var f in e)h+=e[f].toString();return h};k.prototype.writeButtonStyle=function(){var h="",e=[],d=new j.ThemeClass("commandButton");d.style.color="#666";d.style.border="1px solid #dedede";d.style.backgroundColor="#ddd";d.style.textAlign="center";d.style.verticalAlign="baseline";d.style.cursor="pointer";d.style.display="inline-block";d.style.padding="4px 6px";d.style.borderRadius="3px";d.style.lineHeight="12px";d.style.fontSize="8pt";d.style.userSelect=
"none";e.push(d);d=new j.ThemeClass("commandButton:over");d.style.backgroundColor="#e6e6e6";d.style.border="1px solid #808080";e.push(d);d=new j.ThemeClass("commandMenu");d.style.color="#222";d.style.display="inline-block";d.style.verticalAlign="baseline";d.style.margin="0";d.style.fontSize="8pt";d.style.fontWeight="normal";d.style.border="1px solid #dedede";d.style.backgroundColor="#efefef";d.style.cursor="pointer";d.style.borderRadius="1px";e.push(d);d=new j.ThemeClass("commandMenuItem");d.style.border=
"0";d.style.padding="0";d.style.margin="0";e.push(d);for(var f in e)h+=e[f].toString();return h};k.prototype.writeMainStyle=function(){var h="",e=[],d=new j.ThemeClass("searchbox");d.style.backgroundImage="url(../images/core_sprites.png)";d.style.backgroundRepeat="no-repeat";d.style.backgroundPosition="4px -297px";d.style.width="12px";d.style.height="12px";d.style.backgroundColor=this.search;d.style.border="1px solid "+this.search;d.style.fontSize="11px";d.style.width="15em";d.style.height="16px";
d.style.borderRadius="10px";d.style.color="#999";d.style.padding="0";d.style.paddingLeft="20px";d.style.marginLeft="5px";d.style.marginTop="6px !important";d.style.font="7pt Lucida Sans Unicode,Lucida Grande,Verdana,Arial,Helvetica,Myriad,Tahoma,clean,sans-serif !important";e.push(d);d=new j.ThemeClass("searchbox:focus");d.style.color="white";d.style.outline="none";e.push(d);d=new j.ThemeClass("checkedRow");d.style.cssText="background-color:"+this.selection+" !important;";e.push(d);d=new j.ThemeClass("navbar-item-selected");
d.style.background=this.selection;d.style.color=this.content;e.push(d);d=new j.ThemeClass("auxpane");d.style.border="0";d.style.background=this.sidepanel;d.style.background="-webkit-gradient(linear, left top, left bottom, color-stop(0%,"+this.sidepanel+"), color-stop(100%,"+this.sidepanel+"))";d.style.background="-moz-linear-gradient(top, "+this.sidepanel+" 0%, "+this.sidepanel+" 100%)";e.push(d);d=new j.ThemeClass("mainpane");d.style.background=this.mainpanel;d.style.border=0;e.push(d);d=new j.ThemeClass("mainToolbar");
d.style.background=this.toolpanel;d.style.height="32px";d.style.borderBottom="1px solid #ebebeb";d.style.paddingTop="3px";e.push(d);for(var f in e)h+=e[f].toString();return h};k.prototype.render=function(){console.log(this.writeNavigationStyle());console.log(this.writeLocationStyle());console.log(this.writeMainStyle());console.log(this.writeButtonStyle())};k.prototype.getSheet=function(h){h.navbar.value?(this.navbar=h.navbar.value,this.button=h.button.value,this.location=h.location.value,this.selection=
h.selection.value,this.sidepanel=h.sidepanel.value,this.mainpanel=h.mainpanel.value,this.navtext=h.navtext.value,this.search=h.search.value,this.content=h.content.value,this.toolpanel=h.toolpanel.value):(this.navbar=h.navbar,this.button=h.button,this.location=h.location,this.selection=h.selection,this.sidepanel=h.sidepanel,this.mainpanel=h.mainpanel,this.navtext=h.navtext,this.search=h.search,this.content=h.content,this.toolpanel=h.toolpanel);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,h){function e(){}function d(){this.styles=[];var c=new e;c.name="Orion";c.navbar="#404648";c.button="#EFEFEF";c.location="#efefef";c.selection="FEC";c.sidepanel="#FBFBFB";c.mainpanel="white";c.toolpanel="white";c.navtext="#bfbfbf";c.content="#3087B3";c.search="#444";c.breadcrumb="#3087B3";c.separator="#333";this.styles.push(c);
c=new e;c.name="Green Zone";c.navbar="seagreen";c.button="lavender";c.location="darkseagreen";c.selection="moccasin";c.sidepanel="aliceblue";c.mainpanel="white";c.toolpanel="white";c.navtext="#FBFBFB";c.content="darkgreen";c.search="darkgreen";c.breadcrumb="#3087B3";c.separator="seagreen";this.styles.push(c);c=new e;c.name="Pretty In Pink";c.navbar="plum";c.button="lavender";c.location="pink";c.selection="lavender";c.sidepanel="seashell";c.mainpanel="white";c.toolpanel="white";c.navtext="#FBFBFB";
c.content="mediumorchid";c.search="violet";c.breadcrumb="#3087B3";c.separator="plum";this.styles.push(c);c=new e;c.name="Blue Monday";c.navbar="cornflowerblue";c.button="lavender";c.location="skyblue";c.selection="lavender";c.sidepanel="aliceblue";c.mainpanel="white";c.toolpanel="white";c.navtext="#FBFBFB";c.content="royalblue";c.search="royalblue";c.breadcrumb="#3087B3";c.separator="cornflowerblue";this.styles.push(c);c=new e;c.name="Vanilla Skies";c.navbar="sandybrown";c.button="lemmonchiffon";
c.location="cornsilk";c.selection="lemonchiffon";c.sidepanel="white";c.mainpanel="white";c.toolpanel="white";c.navtext="lemonchiffon";c.content="chocolate";c.search="moccasin";c.breadcrumb="#3087B3";c.separator="sandybrown";this.styles.push(c);c=new e;c.name="Beetlejuice";c.navbar="indigo";c.button="slateblue";c.location="darkslateblue";c.selection="silver";c.sidepanel="lavender";c.mainpanel="white";c.toolpanel="white";c.navtext="#FBFBFB";c.content="mediumslateblue";c.search="#444";c.breadcrumb="#3087B3";
c.separator="indigo";this.styles.push(c);c=new e;c.name="Red";c.navbar="#CD2127";c.button="#777777";c.location="#D85F56";c.selection="lightcoral";c.sidepanel="#EFDAB2";c.mainpanel="#FDFADD";c.toolpanel="#FDFADD";c.navtext="#FBFBFB";c.content="darkred";c.search="#D85F56";c.breadcrumb="darkred";c.separator="#CD2127";this.styles.push(c)}function f(){return this.styles}e.prototype.name="Orion";e.prototype.navbar="#404648";e.prototype.button="#EFEFEF";e.prototype.location="#333";e.prototype.breadcrumb=
"#3087B3";e.prototype.separator="#333";e.prototype.selection="FEC";e.prototype.sidepanel="#FBFBFB";e.prototype.mainpanel="white";e.prototype.toolpanel="white";e.prototype.navtext="#bfbfbf";e.prototype.content="#3087B3";e.prototype.search="#444";d.prototype.styles=[];d.prototype.getStyles=f;d.prototype.getThemeStorageInfo=function(){return{storage:"/themes",styleset:"styles",defaultTheme:"Orion",selectedKey:"selected"}};d.prototype.getViewData=function(){var c={top:10,left:10,width:350,height:350};
c.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 a=0;a<3;a++)c.shapes.push({type:"TEXT",name:j.Content,label:"org.eclipse.orion.content",x:170,y:127+20*a,fill:"#3087B3",family:"content"});for(a=0;a<3;a++)c.shapes.push({type:"TEXT",name:j.Content,label:"Item",x:25,y:115+20*a,fill:"#3087B3",family:"content"});for(a=0;a<3;a++)c.shapes.push({type:"TRIANGLE",
name:"twisty",x1:160,y1:121+a*20,x2:165,y2:124+a*20,x3:160,y3:127+a*20,family:"navbar",fill:"#333"});c.shapes.push({type:"IMAGE",name:"logo",x:15,y:18,source:"../../images/orion-transparent.png",family:"logo"});return c};d.prototype.processSettings=function(c){var a=new h.ThemeSheetWriter;(new k.TextTheme.getTheme("orionTheme")).setThemeClass("orionTheme",a.getSheet(c))};return{ThemeData:d,getStyles:f}});
define("orion/widgets/nls/root/messages",{"no input":"no input","no output":"no output","Choose a Folder":"Choose a Folder",OK:"OK",Profile:"Profile","Sign out":"Sign out","N/A":"N/A","logged in since ":"logged in since ","Sign in":"Sign in","Authentication required!":"Authentication required!","Name:":"Name:","Plug-ins":"Plug-ins"," <No available services or timed out, check URL and try reloading>":" <No available services or timed out, check URL and try reloading>",Properties:"Properties"," (Service Id: ":" (Service Id: ",
Services:"Services","SFTP Transfer":"SFTP Transfer","Remote host:":"Remote host:","Port:":"SFTP Port:","Remote path:":"Remote path:","User name:":"User name:","Password:":"Password:","Start Transfer":"Start Transfer","Location:":"Location:","orion.sftpConnections":"orion.sftpConnections","Drag a file here":"Drag a file here","unzip zips":"Unzip *.zip files","or if you prefer":"(or upload a file using the buttons below)",Upload:"Upload","Browse...":"Browse...","Import a file or zip":"Import a file or zip",
"Missing required argument: searchRenderer":"Missing required argument: searchRenderer","Missing required argument: favService":"Missing required argument: favService","Find File Named":"Find File Named","Type the name of a file to open (? = any character, * = any string):":"Type the name of a file to open (? = any character, * = any string):",Search:"Search","Searching...":"Searching...","Searching for occurrences of":'Searching for occurrences of: "${0}"',name:"name","orion.widgets.UserMenu":"orion.widgets.UserMenu",
test:"test","Sign Out":"Sign Out","Sign Out ":"Sign Out ","</a>":"</a>",">":">","Sign In To ":"Sign In To ","Sign In":"Sign In",Help:"Help","Keyboard Shortcuts":"Keyboard Shortcuts",Settings:"Settings","View profile of ":"View profile of ",Profiles:"Profiles","Information Needed":"Information Needed",Cancel:"Cancel","If the same file exists in both the source and destination:":"If the same file exists in both the source and destination:","Cancel the transfer":"Cancel the transfer","Always overwrite destination":"Always overwrite destination",
"Overwrite if source is newer":"Overwrite if source is newer",New:"New","Building file skeleton...":"Building file skeleton...",Add:"Add","Upload...":"Upload...","For a list of available commands type '${0}'.":"For a list of available commands type '${0}'.","Main Pages":"Main Pages","Related Links":"Related Links"});
define("orion/widgets/nls/messages",["orion/i18n!orion/widgets/nls/messages","orion/widgets/nls/root/messages"],function(j,k){var h={root:k};Object.keys(j).forEach(function(e){typeof h[e]==="undefined"&&(h[e]=j[e])});return h});
define("orion/widgets/userAssistance/UATaskPanel",["orion/webui/littlelib"],function(j){function k(h,e,d){this.elements=d;this.taskPanel=document.createElement("div");this.taskPanel.className="UAContainer";this.taskPanel.innerHTML='<header class="UAHeader">Develop software from within the cloud</header>';this.elementNode=document.createElement("div");this.switchesContainer=document.createElement("div");this.switches=document.createElement("span");this.radioButtons=[];this.elementNode.className="UAContainer-body";
this.taskPanel.appendChild(this.elementNode);this.switchesContainer.className="UAContainer-switch-body";this.switches.className="UAContainer-switches";this.switchesContainer.innerHTML="";this.switchesContainer.appendChild(this.switches);this.taskPanel.appendChild(this.switchesContainer);e===!0?(this.container=document.createElement("div"),this.container.className="UAModal",this.container.appendChild(this.taskPanel),this.backdrop=document.createElement("div"),this.backdrop.className="UAModalBackground",
document.body.appendChild(this.backdrop),document.body.appendChild(this.container),j.addAutoDismiss([this.container],this.destroy.bind(this))):h.appendChild(this.taskPanel);this.chosenSwitch=this.createSwitch(null,!0);this.chosenSwitch.firstChild.className="chosenCircle";this.initialize();this.elements.forEach(this.createSwitch.bind(this))}k.prototype.elementNode=null;k.prototype.switchesContainer=null;k.prototype.switches=null;k.prototype.radioButtons=null;k.prototype.chosenSwitch=null;k.prototype.addElement=
function(h){var e=document.createElement("span");e.className="UAContainer-icon";e.innerHTML='<span class="workingSpan"><img src="'+h.image+'" id="'+h.label+'ImageNode" alt="'+h.alt+'" height="64" width="64"></span><span class="UAIcon-label"><span class="UALabel" id="'+h.label+'LabelNode" >'+h.label+"</span></span>";e.onmouseover=function(){document.getElementById(h.label+"ImageNode").src=h.secondaryImage;document.getElementById(h.label+"LabelNode").className="UALabel-live";e.className="UAContainer-icon-live"};
e.onmouseout=function(){document.getElementById(h.label+"ImageNode").src=h.image;document.getElementById(h.label+"LabelNode").className="UALabel";e.className="UAContainer-icon"};var d=this;e.onclick=function(){d.showMedia(h)};this.elementNode.appendChild(e)};k.prototype.clearElements=function(){this.elementNode.innerHTML=""};k.prototype.showMedia=function(h){this.clearElements();this.addElement(h);var e=document.createElement("span");e.className="UAContainer-media";e.innerHTML='<div></div><div></div><span class="mediaSpan"><img src="'+
h.media+'" alt="'+h.alt+'" height="300" width="400"></span>';this.elementNode.appendChild(e);setTimeout(function(){e.style.opacity=1},100);h=document.getElementById(h.label+"switch");this.chosenSwitch.firstChild.className="circle";this.chosenSwitch=h.parentNode;h.className="chosenCircle"};k.prototype.createSwitch=function(h){var e;e=h?h.label+"switch":"indexSwitch";var d=document.createElement("span");d.className="workingSpan";d.innerHTML='<div class="circle" id ="'+e+'"></div>';var f=this;d.onclick=
h?function(){f.showMedia(h)}:function(){f.initialize();f.chosenSwitch.firstChild.className="circle";f.chosenSwitch=d;f.chosenSwitch.firstChild.className="chosenCircle"};this.switches.appendChild(d);return this.radioButtons[this.radioButtons.length]=d};k.prototype.initialize=function(){this.clearElements();this.elements.forEach(this.addElement.bind(this))};k.prototype.destroy=function(){document.body.removeChild(this.backdrop);document.body.removeChild(this.container)};return k});
define("orion/webui/dialog",["i18n!orion/widgets/nls/messages","require","orion/webui/littlelib","orion/uiUtils"],function(j,k,h,e){function d(){}d.prototype={DISABLED:"disabled",CONTAINERTEMPLATE:'<div class="dialog" role="dialog"><div class="dialogTitle"><span id="title" class="dialogTitleText layoutLeft"></span><button aria-label="Close" class="dismissButton layoutRight core-sprite-close imageSprite" id="closeDialog"></button></div><div id="dialogContent" class="dialogContent layoutBlock"></div><div id="buttons" class="dialogButtons"></div></div>',
_initialize:function(){var d=document.body;this.$frameParent=d;this.$$modalExclusions=this.$$modalExclusions||[];var c=document.createRange();c.selectNode(d);c=c.createContextualFragment(this.CONTAINERTEMPLATE);d.appendChild(c);this.$frame=d.lastChild;this.title&&h.$("#title",this.$frame).appendChild(document.createTextNode(this.title));this.$close=h.$("#closeDialog",this.$frame);var a=this;this.$close.addEventListener("click",function(){a.hide()},!1);this.$parent=h.$(".dialogContent",this.$frame);
c=document.createRange();c.selectNode(this.$parent);d=c.createContextualFragment(this.TEMPLATE);this.messages&&h.processTextNodes(d,this.messages);this.$parent.appendChild(d);this.$buttonContainer=h.$(".dialogButtons",this.$frame);this._makeButtons();this.$frame.addEventListener("keydown",function(c){c.keyCode===h.KEY.ESCAPE?a.hide():c.keyCode===h.KEY.ENTER&&typeof a._defaultCallback==="function"&&a._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 d=this;this.buttons.forEach(function(c){var a=e.createButton(c.text,c.callback);if(c.id)a.id=c.id,d["$"+a.id]=a;if(c.isDefault)d._defaultCallback=c.callback,d._defaultButton=a;d.$buttonContainer.appendChild(a)})}},_makeModal:function(){var d=this;this.$frame.addEventListener("blur",function(b){d.$lastFocusedElement=b.target},!0);this._modalListener=function(b){var a=!h.contains(d.$frame,
b.target);if(a)for(var c=0;c<d.$$modalExclusions.length;c++)if(h.contains(d.$$modalExclusions[c],b.target)){a=!1;break}a&&(window.setTimeout(function(){(d.$lastFocusedElement||d.$parent).focus()},0),h.stop(b))};this.$frameParent.addEventListener("focus",this._modalListener,!0);this.$frameParent.addEventListener("click",this._modalListener,!0);var c=this.$frameParent.childNodes,a=!1;this._addedBackdrop=[];for(var i=0;i<c.length;i++){for(var g=0;g<this.$$modalExclusions.length;g++)if(h.contains(this.$$modalExclusions[g],
c[i])){a=!0;break}!a&&c[i]!==d.$frame&&c[i].classList&&!c[i].classList.contains("tooltipContainer")&&(g=c[i],g.classList.contains("modalBackdrop")||(g.classList.add("modalBackdrop"),this._addedBackdrop.push(g)))}(c=h.lastTabbable(this.$buttonContainer)||h.lastTabbable(this.$parent))&&c.addEventListener("keydown",function(b){if(b.keyCode===h.KEY.TAB){var a=d._getFirstFocusField();a&&a!==b.target&&a.focus();h.stop(b)}},!1)},_addChildDialog:function(d){this.$$modalExclusions.push(d.$frame||d.$parent)},
_bindElements:function(d){for(var c=0;c<d.childNodes.length;c++){var a=d.childNodes[c];a.id&&(this["$"+a.id]=a);this._bindElements(a)}},hide:function(){typeof this._beforeHiding==="function"&&this._beforeHiding();this._modalListener&&(this.$frameParent.removeEventListener("focus",this._modalListener,!0),this.$frameParent.removeEventListener("click",this._modalListener,!0));this.$frame.classList.remove("dialogShowing");typeof this._afterHiding==="function"&&this._afterHiding();var d=this;this.keepAlive||
window.setTimeout(function(){d.destroy()},0)},show:function(d){typeof this._beforeShowing==="function"&&this._beforeShowing();var c=h.bounds(this.$frame),a=h.bounds(document.documentElement),i;d?(i=h.bounds(d),d=i.top+i.height+4,i=i.left+4,d+c.height>a.height&&(d=Math.max(0,a.height-c.height-4)),i+c.width>a.width&&(i=Math.max(0,a.width-c.width-4))):(i=Math.max(0,(a.width-c.width)/2),d=Math.max(0,(a.height-c.height)/2));this.$lastFocusedElement=document.activeElement;this.$frame.style.top=d+"px";this.$frame.style.left=
i+"px";this.$frame.classList.add("dialogShowing");typeof this._afterShowing==="function"&&this._afterShowing();this.customFocus||this._getFirstFocusField().focus()},_getFirstFocusField:function(){return h.firstTabbable(this.$parent)||this._defaultButton||h.firstTabbable(this.$buttonContainer)||this.$close},destroy:function(){this._addedBackdrop&&this._addedBackdrop.length>0&&this._addedBackdrop.forEach(function(d){d.classList.remove("modalBackdrop")});this.$frameParent.removeEventListener("focus",
this._modalListener,!0);this.$frameParent.removeEventListener("click",this._modalListener,!0);this.$frameParent.removeChild(this.$frame);this.$parent=this.$frame=void 0}};d.prototype.constructor=d;return{Dialog:d}});
define("orion/widgets/UserMenu","i18n!orion/widgets/nls/messages,require,orion/webui/littlelib,orion/PageLinks,orion/widgets/userAssistance/UATaskPanel,orion/webui/dialog".split(","),function(j,k,h,e,d){function f(c){this._displaySignOut=!0;this._init(c)}f.prototype={_init:function(c){this._dropdownNode=h.node(c.dropdownNode);if(!this._dropdownNode)throw"no dom node for dropdown found";this._dropdown=c.dropdown;this._serviceRegistry=c.serviceRegistry;this.authenticatedServices={};this.unauthenticatedServices=
{};this._noSeparator=c.noSeparator;this._dropDownItemClass=c.dropDownItemClass;this._keyAssistClass=c.keyAssistClass;if(c.signOut!==void 0)this._displaySignOut=c.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(c){var a=0,d;for(d in c)c.hasOwnProperty(d)&&a++;return a},_makeMenuItem:function(c,
a){var d=document.createElement("span");d.role="menuitem";d.tabIndex=0;var g=document.createTextNode(c);d.appendChild(g);typeof this._dropDownItemClass==="string"?this._dropDownItemClass!==""&&d.classList.add(this._dropDownItemClass):d.classList.add("dropdownMenuItem");d.addEventListener("click",a,!1);d.addEventListener("keydown",function(b){(b.keyCode===h.KEY.ENTER||b.keyCode===h.KEY.SPACE)&&a()},!1);return d},_renderAuthenticatedService:function(c){var a=this,d=this.authenticatedServices[c].authService;
if(d&&d.logout&&this._displaySignOut){var g=document.createElement("li"),b=this._makeMenuItem(j["Sign Out"],function(){d.logout().then(function(){a.addUserItem(c,d,a.authenticatedServices[c].label);localStorage.removeItem(c);localStorage.removeItem("lastLogin");for(var b=localStorage.length-1;b>=0;b--){var g=localStorage.key(b);g&&g.indexOf("/orion/preferences/user")===0&&localStorage.removeItem(g)}d.getAuthForm(window.location.href).then(function(b){window.location=b})})});g.appendChild(b);this._dropdownNode.appendChild(g)}},
renderServices:function(){function c(b){d[b]||(d[b]=a.createDocumentFragment());return d[b]}var a=document,d=[],g=this._serviceRegistry;e.getPageLinksInfo(g,"orion.page.link.user").then(function(b){this._dropdown?this._dropdown.empty():this._dropdownNode&&h.empty(this._dropdownNode);b.forEach(function(b){var d=c(typeof b.category==="number"?b.category:1),g=a.createElement("li"),i=a.createElement("a");i.role="menuitem";typeof this._dropDownItemClass==="string"?this._dropDownItemClass!==""&&i.classList.add(this._dropDownItemClass):
i.classList.add("dropdownMenuItem");i.href=b.href;i.textContent=b.textContent;g.appendChild(i);d.appendChild(g);i.addEventListener("keydown",function(b){(b.keyCode===h.KEY.ENTER||b.keyCode===h.KEY.SPACE)&&i.click()},!1)}.bind(this));if(this.keyAssistFunction){var b=document.createElement("li"),e=this._makeMenuItem(j["Keyboard Shortcuts"],this.keyAssistFunction);typeof this._keyAssistClass==="string"?this._keyAssistClass!==""&&e.classList.add(this._keyAssistClass):e.classList.add("key-assist-menuitem");
b.appendChild(e);c(0).appendChild(b)}if(b=g.getServiceReferences("orion.page.getstarted")[0])e=b.getProperty("data"),b=document.createElement("li"),e=this._makeMenuItem("Getting Started",this.getStartedDialog.bind(this,e)),b.appendChild(e),c(0).appendChild(b);var f=this;d.sort(function(b,a){return b-a}).forEach(function(b,a){if(a<d.length-1&&!this._noSeparator){var c=document.createElement("li");c.classList.add("dropdownSeparator");var g=document.createElement("span");g.classList.add("dropdownSeparator");
c.appendChild(g);b.appendChild(c)}f._dropdownNode.appendChild(b)}.bind(this));if(this.isSingleService())for(var m in this.authenticatedServices)this.authenticatedServices.hasOwnProperty(m)&&this._renderAuthenticatedService(m,0)}.bind(this))},getStartedDialog:function(c){new d(null,!0,c)},setKeyAssist:function(c){this.keyAssistFunction=c;this.renderServices()},addUserItem:function(c,a,d,g){g?(this.unauthenticatedServices[c]&&delete this.unauthenticatedServices[c],this.authenticatedServices[c]={authService:a,
label:d,data:g}):(this.authenticatedServices[c]&&delete this.authenticatedServices[c],this.unauthenticatedServices[c]=this.unauthenticatedServices[c]?{authService:a,label:d,pending:this.unauthenticatedServices[c].pending}:{authService:a,label:d});this.renderServices()}};f.prototype.constructor=f;return{UserMenu:f}});
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 h={root:k};Object.keys(j).forEach(function(e){typeof h[e]==="undefined"&&(h[e]=j[e])});return h});
define("orion/searchUtils","i18n!orion/nls/messages,require,orion/regex,orion/commandRegistry,orion/PageUtil,orion/URITemplate".split(","),function(j,k,h,e,d,f){function c(a,c,b){var d="";b&&(d="^");if(d=h.parse("/"+d+a.searchStr+"/"))b=d.pattern,d=d.flags,d.indexOf("i")===-1&&!c.caseSensitive&&(d+="i"),a.regExp={pattern:b,flags:d},a.wildCard=!0}var a={ALL_FILE_TYPE:"*.*"};a.doSearch=function(c,d,b,e){if(c){var f=!0;b==="*"&&(b="");b===""&&(f=e&&e.type!==a.ALL_FILE_TYPE);if(f){b!==""&&a.addRecentSearch(d,
b,e?e.regEx:!1);var c=c.createSearchParams(b,!1,!1,e),m=a.generateSearchHref(c);a.getOpenSearchPref(d,function(b){b?window.open(m):window.location=m})}}else window.alert(j["Can't search: no search service is available"])};a.generateSearchHelper=function(d,g){var b=d.keyword,e=b,f={};d.fileType&&d.fileType!==a.ALL_FILE_TYPE&&b===""&&(e="*."+d.fileType);if(d.regEx)f.searchStr=b,c(f,d,g);else{var m=b.indexOf("*")>-1,h=b.indexOf("?")>-1;m&&(b=b.split("*").join(".*"));h&&(b=b.split("?").join("."));!m&&
!h&&!d.nameSearch?(f.searchStr=d.caseSensitive?b.split("\\").join(""):b.split("\\").join("").toLowerCase(),f.wildCard=!1):(f.searchStr=d.caseSensitive?b:b.toLowerCase(),c(f,d,g),f.wildCard=!0)}f.searchStrLength=f.searchStr.length;return{params:d,inFileQuery:f,displayedSearchTerm:e}};a.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"};a.copySearchParams=function(a,c){var b={},d;for(d in a)if(a[d]!==void 0&&a[d]!==null&&(c||d!=="replace"))b[d]=a[d];return b};a.generateSearchHref=function(c){var d=k.toUrl("search/search.html"),c=a.copySearchParams(c,!0),b=c.resource;c.resource=void 0;return typeof c.keyword!=="undefined"?(new f(d+"#{,resource,params*}")).expand({resource:b,params:c}):
(new f(d+"#{,resource}")).expand({resource:b})};a.generateFindURLBinding=function(a,c,b,d,e){a={find:c.searchStr,regEx:c.wildCard?!0:void 0,caseSensitive:a.caseSensitive?!0:void 0,replaceWith:typeof d==="string"?d:void 0,atLine:typeof b==="number"?b:void 0};return e?a:","+(new f("{,params*}")).expand({params:a})};a.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)};a.replaceRegEx=function(a,c,b){return a.replace(RegExp(c.pattern,c.flags),b)};a.replaceStringLiteral=function(c,d,b){d=h.parse("/"+d+"/gim");return a.replaceRegEx(c,d,b)};a.searchOnelineLiteral=function(a,c,b){var d;d=0;for(var e=!1,f=[];;)if(d=c.indexOf(a.searchStr,d),d<0)break;else{f.push({startIndex:d,length:a.searchStrLength});e=!0;if(b)break;d+=a.searchStrLength}return e?f:null};a.findRegExp=function(a,c,b,d){if(!c)return null;
b=b||"";b+=(b.indexOf("g")===-1?"g":"")+(b.indexOf("m")===-1?"m":"");var e=null;return(e=RegExp(c,b).exec(a.substring(d)))&&{startIndex:e.index+d,length:e[0].length}};a.searchOnelineRegEx=function(c,d,b){for(var e=0,f=!1,m=[];;)if(e=a.findRegExp(d,c.regExp.pattern,c.regExp.flags,e)){m.push(e);f=!0;if(b)break;e=e.startIndex+e.length}else break;return f?m:null};a.generateNewContents=function(c,d,b,e,f,m){if(e&&d){if(!c)b.contents=[];for(var h=0;h<d.length;h++){for(var j=d[h],k=!1,s=!1,v=[],w,u=0,p=
0;p<e.children.length;p++)if(e.children[p].lineNumber-1===h){u=p;for(k=0;k<e.children[p].matches.length;k++)e.children[p+k].checked!==!1&&v.push(k);s=v.length>0;w=e.children[p].matches;k=!0;break}if(k){if(s){v=a.replaceCheckedMatches(j,f,w,v,m);j=v.replacedStr;for(k=0;k<e.children[u].matches.length;k++)e.children[u+k].newMatches=v.newMatches}else for(k=0;k<e.children[u].matches.length;k++)e.children[u+k].newMatches=e.children[u+k].matches;c?b.contents[h]=j:b.contents.push(j)}else c||b.contents.push(j)}}};
a.generateMatchContext=function(a,c,b){var d=[],e=a*2+1,f;c.length<=e?(f=0,a=c.length-1):(f=b-a,f<0?(f=0,a=f+e-1):(a=b+a,a>c.length-1&&(a=c.length-1,f=a-e+1)));for(e=f;e<=a;e++)d.push({context:c[e],current:e===b});return d};a.splitFile=function(a){for(var c=0,b=0,d=0,e=0,f=[];;){c!==-1&&c<=d&&(c=a.indexOf("\r",d));b!==-1&&b<=d&&(b=a.indexOf("\n",d));if(b===-1&&c===-1){f.push(a.substring(e));break}var h=1;c!==-1&&b!==-1?c+1===b?(h=2,d=b+1):d=(c<b?c:b)+1:d=c!==-1?c+1:b+1;f.push(a.substring(e,d-h));
e=d}return f};a.searchWithinFile=function(c,d,b,e,f,m){b=a.splitFile(b);if(f)d.contents=b;if(d){d.children=[];for(var h=e=0;h<b.length;h++){var j=b[h];if(j&&j.length>0){var k=m?j:j.toLowerCase();if(k=c.wildCard?a.searchOnelineRegEx(c,k):a.searchOnelineLiteral(c,k)){var s,v=h+1;if(f)for(var w=0;w<k.length;w++)s=w+1,s={parent:d,checked:d.checked,type:"detail",matches:k,lineNumber:v,matchNumber:s,name:j,location:d.location+"-"+v+"-"+s},d.children.push(s);else s={parent:d,context:a.generateMatchContext(2,
b,h),checked:d.checked,type:"detail",matches:k,lineNumber:v,name:j,location:d.location+"-"+v},d.children.push(s);e+=k.length}}}d.totalMatches=e}};a.replaceCheckedMatches=function(a,c,b,d,e){for(var f=0,h="",j=[],k=0;k<b.length;k++){f!==b[k].startIndex&&(h+=a.substring(f,b[k].startIndex));if(b[k].length)e=b[k].length;for(var f=!1,s=0;s<d.length;s++)if(d[s]===k){f=!0;break}f?(j.push({startIndex:h.length,length:c.length}),h+=c):(j.push({startIndex:h.length,length:e}),h+=a.substring(b[k].startIndex,b[k].startIndex+
e));f=b[k].startIndex+e}f<a.length&&(h+=a.substring(f));return{replacedStr:h,newMatches:j}};a.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};a.path2FolderName=function(a,c,b){return a.substring(0,a.length-c.length-(b?0:1))};a._storeRecentSearch=function(a,c,b){a.getService("orion.core.preference").getPreferences("/window/favorites").then(function(a){a.put("recentSearch",c);b&&window.setTimeout(function(){b.dispatchEvent({type:"recentSearchesChanged"})}.bind(this),
20)})};a.addRecentSearch=function(c,d,b){typeof d==="string"&&d&&c.getService("orion.core.preference").getPreferences("/window/favorites").then(function(e){var f,e=e.get("recentSearch");typeof e==="string"&&(e=JSON.parse(e));if(e){for(f in e)if(e[f].name===d)return;e.length>=20&&e.splice(19,e.length-20+1)}else e=[];e.splice(0,0,{name:d,regEx:b});a._storeRecentSearch(c,e)})};a.removeRecentSearch=function(c,d,b){typeof d==="string"&&d&&c.getService("orion.core.preference").getPreferences("/window/favorites").then(function(e){var f,
e=e.get("recentSearch");typeof e==="string"&&(e=JSON.parse(e));if(e)for(f in e)if(e[f].name===d){e.splice(f,1);a._storeRecentSearch(c,e,b);break}})};a.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)})};a.getMixedSearches=function(c,d,b,e){c.getService("orion.core.preference").getPreferences("/window/favorites").then(function(c){var i=c.get("recentSearch");typeof i===
"string"&&(i=JSON.parse(i));d&&(c=c.get("search"),typeof c==="string"&&(c=JSON.parse(c)),c&&c.forEach(function(c){if(b){var d=a.parseQueryStr(c.query);i.some(function(b){return d.searchStrTitle===b.name})||i.push({name:d.searchStrTitle,label:c.name})}else i.push({name:null,label:c.name,value:c.query})}));i&&e&&e(i)})};a.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)})};a.setOpenSearchPref=function(a,c){a.getService("orion.core.preference").getPreferences("/window/favorites").then(function(b){b.put("openSearchPref",{openInNewTab:c})})};return a});
define("orion/crawler/searchCrawler","i18n!orion/crawler/nls/messages,require,orion/i18nUtil,orion/searchUtils,orion/contentTypes,orion/Deferred".split(","),function(j,k,h,e,d,f){function c(a,c,d,b){this.registry=a;this.fileClient=c;this.fileLocations=[];this.fileSkeleton=[];this._totalCounter=this._hitCounter=0;this._searchOnName=b&&b.searchOnName;this._buildSkeletonOnly=b&&b.buildSkeletonOnly;this._fetchChildrenCallBack=b&&b.fetchChildrenCallBack;this._searchParams=d;this.searchHelper=this._searchOnName||
this._buildSkeletonOnly?null:e.generateSearchHelper(d);this._location=b&&b.location;this._childrenLocation=b&&b.childrenLocation?b.childrenLocation:this._location;this._cancelled=!1;this.registry.getService("orion.page.message").setCancelFunction(function(){this._cancelFileContentsSearch()}.bind(this))}c.prototype.search=function(a){var c=this.registry.getService("orion.core.contentTypeRegistry");this._onSearchComplete=a;this._cancelled=!1;this._deferredArray=[];c.getContentTypes().then(function(a){this.contentTypesCache=
a;this._visitRecursively(this._childrenLocation).then(function(){this._sort(this.fileLocations);this._onSearchComplete({response:{numFound:this.fileLocations.length,docs:this.fileLocations}})}.bind(this))}.bind(this))};c.prototype.searchName=function(a,c){if(a)this.searchHelper=e.generateSearchHelper(a,!0);if(c)this.onSearchNameComplete=c;var d=[];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?e.searchOnelineRegEx(this.searchHelper.inFileQuery,l,!0):e.searchOnelineLiteral(this.searchHelper.inFileQuery,l,!0))if(d.push(this.fileSkeleton[b]),d.length>=this.searchHelper.params.rows)break}this.onSearchNameComplete({response:{numFound:d.length,docs:d}})}};c.prototype.buildSkeleton=function(a,c){this._buildingSkeleton=!0;var d=this.registry.getService("orion.core.contentTypeRegistry");this._cancelled=!1;this._deferredArray=
[];var b=this;a();d.getContentTypes().then(function(a){b.contentTypesCache=a;b._visitRecursively(b._childrenLocation).then(function(){b._buildingSkeleton=!1;c();b.searchHelper&&!b._buildSkeletonOnly&&b.searchName()})})};c.prototype._searchCompleted=function(){console.log("Search Completed.")};c.prototype._searchFiles=function(){var a=[];if(this.fileLocations.length>0)for(var c=0;c<this.fileLocations.length;c++)a.push(this._sniffSearch(this.fileLocations[c]));return f.all(a)};c.prototype._sort=function(a){a.sort(function(a,
c){var b=a.Name&&a.Name.toLowerCase(),d=c.Name&&c.Name.toLowerCase();return b<d?-1:b>d?1:0})};c.prototype._onFileType=function(a){return this.searchHelper.params.fileType?this.searchHelper.params.fileType===e.ALL_FILE_TYPE?!0:a.extension.indexOf(this.searchHelper.params.fileType)>=0:!0};c.prototype._visitRecursively=function(a){var c=[],g=this;this._fetchChildrenCallBack&&this._fetchChildrenCallBack(a);var b=g.registry.getService("orion.page.progress");return(b?b.progress(g.fileClient.fetchChildren(a),
"Crawling search for children of "+a):g.fileClient.fetchChildren(a)).then(function(b){for(var a=0;a<b.length;a++)if(b[a].Directory!==void 0&&b[a].Directory===!1)if(g._searchOnName)c.push(g._buildSingleSkeleton(b[a]));else if(g._buildSkeletonOnly)c.push(g._buildSingleSkeleton(b[a]));else{if(!g._cancelled){var e=d.getFilenameContentType(b[a].Name,g.contentTypesCache);if(e&&(e["extends"]==="text/plain"||e.id==="text/plain")&&g._onFileType(e))e=g._sniffSearch(b[a]),c.push(e),g._deferredArray.push(e)}}else if(b[a].Location)if(g._cancelled)break;
else e=g._visitRecursively(b[a].ChildrenLocation),c.push(e),g._deferredArray.push(e);return f.all(c)})};c.prototype._hitOnceWithinFile=function(a){a=this._searchParams.caseSensitive?a:a.toLowerCase();return this.searchHelper.inFileQuery.wildCard?e.searchOnelineRegEx(this.searchHelper.inFileQuery,a,!0):e.searchOnelineLiteral(this.searchHelper.inFileQuery,a,!0)};c.prototype._reportSingleHit=function(a){a.LastModified=a.LocalTimeStamp;this.fileLocations.push(a);this._hitCounter++;this._sort(this.fileLocations);
this._onSearchComplete({response:{numFound:this.fileLocations.length,docs:this.fileLocations}},!0)};c.prototype._cancelFileContentsSearch=function(){(this._cancelled=!0)&&this._deferredArray.forEach(function(a){a.cancel()});this._sort(this.fileLocations);this._onSearchComplete({response:{numFound:this.fileLocations.length,docs:this.fileLocations}});console.log("Crawling search cancelled. Deferred array length : "+this._deferredArray.length);this.registry.getService("orion.page.message").setProgressResult({Message:j["Search cancelled by user"],
Severity:"Warning"})};c.prototype._sniffSearch=function(a){this._totalCounter++;var c=this;if(!this._cancelled)if(this.searchHelper.params.keyword==="")this._reportSingleHit(a),this.registry.getService("orion.page.message").setProgressResult({Message:h.formatMessage(j["${0} files found out of ${1}"],this._hitCounter,this._totalCounter)});else return this.registry.getService("orion.page.progress").progress(c.fileClient.read(a.Location),"Reading file "+a.Location).then(function(d){c._hitOnceWithinFile(d)&&
c._reportSingleHit(a);c.registry.getService("orion.page.message").setProgressResult({Message:h.formatMessage(j["${0} files found out of ${1}"],c._hitCounter,c._totalCounter)},j.Cancel)},function(a){a&&a.message&&a.message.toLowerCase()!=="cancel"&&console.error("Error loading file content: "+a.message)})};c.prototype._buildSingleSkeleton=function(a){this._totalCounter++;this.fileSkeleton.push(a);this.searchHelper&&!this._buildSkeletonOnly&&this._totalCounter%100===0&&this.searchName();a=new f;a.resolve(this._totalCounter);
return a};c.prototype.constructor=c;return{SearchCrawler:c}});
define("orion/webui/dialogs/OpenResourceDialog","i18n!orion/widgets/nls/messages,orion/crawler/searchCrawler,orion/contentTypes,require,orion/webui/littlelib,orion/util,orion/webui/dialog".split(","),function(j,k,h,e,d,f,c){function a(a){this._init(a)}a.prototype=new c.Dialog;a.prototype.TEMPLATE='<div role="search"><div><label id="fileNameMessage" for="fileName">${Type the name of a file to open (? = any character, * = any string):}</label></div><div><input id="fileName" type="text" class="setting-control" style="width:90%;"/></div><div id="progress" style="padding: 2px 0 0; width: 100%;"><img src="'+e.toUrl("../../../images/progress_running.gif")+
'" class="progressPane_running_dialog" id="crawlingProgress"></img></div><div id="results" style="max-height:400px; height:auto; overflow-y:auto;" aria-live="off"></div><div id="statusbar"></div></div>';a.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 h.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()};a.prototype._bindToDom=function(a){var c=this;c.$crawlingProgress.style.display="none";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===d.KEY.ENTER){var a=d.$("a",c.$results);
a&&(d.stop(b),window.open(a.href),c.hide())}},!1);a.addEventListener("keydown",function(b){var a,e,i;if(b.keyCode===d.KEY.DOWN||b.keyCode===d.KEY.UP)a=d.$$array("a",c.$results),e=document.activeElement,i=a.indexOf(e),b.keyCode===d.KEY.DOWN?i>=0?(e.classList.remove("treeIterationCursor"),a=i<a.length-1?a[i+1]:a[0],a.focus(),a.classList.add("treeIterationCursor")):a.length>0&&(a=-1<a.length-1?a[0]:a[0],a.focus(),a.classList.add("treeIterationCursor")):i>=0?(e.classList.remove("treeIterationCursor"),
e=c.$fileName,a=i>0?a[i-1]:e,a.focus(),i>0&&a.classList.add("treeIterationCursor")):a.length>0&&(a[a.length-1].focus(),a[a.length-1].classList.add("treeIterationCursor")),d.stop(b)});a.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()};a.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)};a.prototype.doSearch=function(){var a=this.$fileName.value;if(a){var c=this._searcher.createSearchParams(a,this._nameSearch,this._searchOnRoot),b=this._searchRenderer.makeRenderFunction(this._contentTypeService,this.$results,!1,this.decorateResult.bind(this));
this.currentSearch=b;var e=document.createElement("div");e.appendChild(document.createTextNode(this._nameSearch?j["Searching..."]:f.formatMessage(j["Searching for occurrences of"],a)));d.empty(this.$results);this.$results.appendChild(e);this._searcher.search(c,!1,function(){b===this.currentSearch&&b.apply(null,arguments)}.bind(this))}};a.prototype.decorateResult=function(a){for(var c=this,a=d.$$array("a",a),b=0;b<a.length;b++){var e=a[b];e.addEventListener("mouseup",function(b){b.button===0&&!b.ctrlKey&&
!b.metaKey&&c.hide()},!1);e.addEventListener("keyup",function(b){b.keyCode===d.KEY.ENTER&&c.hide()},!1)}};a.prototype._beforeHiding=function(){clearTimeout(this._timeoutId)};a.prototype._afterHiding=function(){this._onHide&&this._onHide()};a.prototype.constructor=a;return{OpenResourceDialog:a}});define("text!orion/banner/banner.html",[],function(){return'<header id="banner" role="banner">\n\t<\!-- Requires some js code to bind the home link, link to progress image, and binding NLS variables  --\>\n\t<\!-- Top row:  Logo + discovery links + search + user --\>\n\t<div id="staticBanner" class="layoutBlock topRowBanner"> <\!-- primaryNav --\>\n\t\t<a id="home" class="layoutLeft "></a>\n\t\t<nav id="primaryNav" class="bannerLeftArea" role="navigation">\n\t\t\t<button class="centralNavigation commandSprite core-sprite-hamburger" type="button"id="centralNavigation"></button>\n\t\t</nav>\n\t\t<div class="clear navigationBreadcrumb bannerMiddleArea" >\n\t\t\t<div id="location" class="currentLocation"></div>\n\t\t</div>\n\t\t<div class="bannerRightArea">\n\t\t\t<div id="globalActions" class="spacingLeft layoutLeft"></div>\n\t\t\t<input type="text" id="search" autocomplete="off" class="layoutLeft spacingLeft searchbox" role="search" style="display:none;">\n\t\t\t<div id="searchOptions" class="layoutLeft" style="padding-top:1px;display:none;"></div>\n\t\t\t<div id="userMenu" class="spacingRight layoutRight" style="color:#ccc;">\n\t\t\t\t<img class="progressPane" id="progressPane" tabindex="0" role="progressbar"></img>\n\t\t\t\t<span id="userTrigger" tabindex="0" role="button" class="dropdownTrigger">\n\t\t\t\t\t<span class="dropdownArrowEmpty"></span>\n\t\t\t\t</span>\n\t\t\t\t<ul id="userDropdown" class="dropdownMenu" role="menu"></ul>\n\t\t\t</div>\n\t\t</div>\n\t</div>\n\t<div id="notificationArea" class="notificationHide">\n\t\t<div class="layoutLeft" id="notifications" aria-live="assertive" aria-atomic="true"></div>\n\t\t<div class="layoutRight"><button aria-label="Close" class="dismissButton layoutRight core-sprite-close imageSprite" type="button" id="closeNotifications"></span></div>\n\t</div>\n</header>'});
define("text!orion/banner/footer.html",[],function(){return'<footer id="footerContent" class="layoutBlock footerLayout" role="contentinfo">\n\t<\!-- Requires some js code to bind the NLS variables  --\>\n\t<div class="logoFooter commandSprite core-sprite-orion-logo"></div>\n\t<div class="footerBlock">${Orion is in Beta. Please try it out but BEWARE your data may be lost.}</div>\n\t<div class="footerRightBlock">\n\t\t<ul>\n\t\t\t<\!-- <li><a href="http://wiki.eclipse.org/Orion/FAQ" target="_blank">${FAQ}</a></li --\>\n\t\t\t<li><a href="https://bugs.eclipse.org/bugs/enter_bug.cgi?product=Orion&version=4.0" target="_blank">${Report a Bug}</a>\n\t\t\t<li><a href="http://www.eclipse.org/legal/privacy.php" target="_blank">${Privacy Policy}</a></li>\n\t\t\t<li><a href="http://www.eclipse.org/legal/termsofuse.php" target="_blank">${Terms of Use}</a></li>\n\t\t\t<li><a href="http://www.eclipse.org/legal/copyright.php" target="_blank">${Copyright Agent}</a></li>\n\t\t</ul>\n\t</div>\n</footer>'});
define("text!orion/banner/toolbar.html",[],function(){return'<ul class="layoutLeft commandList pageActions" id="pageActions"></ul>\n<ul class="layoutLeft commandList pageActions" id="selectionTools"></ul>\n<ul class="layoutLeft commandList pageActions" id="navActions"></ul>\n<div class="layoutLeft" style="padding-left:7px;padding-right:7px;margin-top:2px;" id="filterBox" style="visibility: hidden;"></div>\n<div class="layoutRight commandList pageActions" id="settingsActions"></div>\n<div class="layoutRight status" id="statusPane" role="status" aria-live="off"></div>\n<ul class="layoutRight commandList pageActions" id="pageNavigationActions"></ul>'});
define("orion/widgets/input/DropDownMenu",["orion/objects","orion/webui/littlelib"],function(j,k){function h(e,d,f){if(e=k.node(e))this._parent=e;else throw Error("Parent node of dropdown menu not found");this.options=f=f||{};this.navDropDownId=this._parent.id+"_navdropdown";this.selectionClass=f.selectionClass;e=document.createElement("div");e.classList.add("dropDownContainer");e.id=this.navDropDownId;e.style.display="none";this._parent.appendChild(e);this._dropdownMenu=e;if(d=k.node(d))this._triggerNode=
d;else throw"Trigger node of dropdown menu not found";if(this._triggerNode.style.visibility==="hidden")this._triggerNode.style.visibility="visible";if(!f.noClick)this._triggerNode.onclick=this.click.bind(this);this._dropdownMenu.addEventListener("keydown",function(c){c.keyCode===k.KEY.ESCAPE&&this.clearPanel()}.bind(this))}j.mixin(h.prototype,{click:function(){this._dropdownMenu.style.display==="none"?this.updateContent(this.getContentNode(),function(){this._dropdownMenu.style.display="";this._positionDropdown();
this.selectionClass&&this._triggerNode.classList.add(this.selectionClass);this.handle=k.addAutoDismiss([this._triggerNode,this._dropdownMenu],this.clearPanel.bind(this));if(this.options.onShow)this.options.onShow()}.bind(this)):this.clearPanel()},clearPanel:function(){if(this.isVisible()&&(this._dropdownMenu.style.display="none",this.selectionClass&&this._triggerNode.classList.remove(this.selectionClass),this.options.onHide))this.options.onHide()},addContent:function(e){this._dropdownMenu.innerHTML=
e},getContentNode:function(){return this._dropdownMenu},updateContent:function(e,d){d()},_positionDropdown:function(){this._dropdownMenu.style.left="";var e=k.bounds(this._dropdownMenu),d=k.bounds(this._boundingNode(this._parent));if(e.left+e.width>d.left+d.width)this._dropdownMenu.style.right=0},_boundingNode:function(e){return e.style.right!==""||e.style.position==="absolute"||!e.parentNode||!e.parentNode.style?e:this._boundingNode(e.parentNode)},isDestroyed:function(){return!this._dropdownMenu.parentNode},
isVisible:function(){return this._dropdownMenu.style.display!=="none"&&!this.isDestroyed()},focus:function(){this._dropdownMenu.focus()},destroy:function(){if(this._parent)k.empty(this._parent),this._parent=this.select=null}});return h});
define("orion/widgets/input/GroupedContent",["i18n!orion/widgets/nls/messages","orion/objects","orion/webui/littlelib"],function(j,k){function h(){}k.mixin(h.prototype,{templateString:'<div style="float:left;"><section><span style="color:#333;padding:15px;">'+j["Main Pages"]+'</span><nav><ul id="navigationlinks"></ul></nav></section></div><div class="groupedContentDivider"></div><div style="float:left;"><section><span style="color:#333;padding:15px;">'+j["Related Links"]+'</span><nav><ul id="relatedLinks"></ul></nav></section></div>',
getContentPane:function(){return this.templateString}});return h});define("orion/customGlobalCommands",[],function(){return{}});
define("orion/navigate/nls/root/messages",{"Click one of the tasks below to create an Orion folder.  You can upload, import, or generate files.":"Click one of the tasks below to create an Orion folder.  You can upload, import, or generate files.","Toggle Left Pane":"Toggle Left Pane","Open or close the left pane":"Open or close the left pane",Navigator:"Navigator","Strings Xtrnalizr":"Strings Xtrnalizr","Externalize Strings from JavaScript files in this folder":"Externalize Strings from JavaScript files in this folder",
"Choose a Folder":"Choose a Folder","Copy of ${0}":"Copy of ${0}","Enter a new name for '${0}'":"Enter a new name for '${0}'","Choose folder...":"Choose folder...",Rename:"Rename","Rename the selected files or folders":"Rename the selected files or folders","Compare with each other":"Compare with each other","Compare the selected 2 files with each other":"Compare the selected 2 files with each other","Compare with...":"Compare with...","Compare the selected folder with a specified folder":"Compare the selected folder with a specified folder",
Delete:"Delete","Unknown item":"Unknown item","Delete the selected files or folders":"Delete the selected files or folders","Are you sure you want to delete these ${0} items?":"Are you sure you want to delete these ${0} items?","Are you sure you want to delete '${0}'?":"Are you sure you want to delete '${0}'?","Export as zip":"Export as zip","Create a zip file of the folder contents and download it":"Create a zip file of the folder contents and download it","New File":"New File","Create a new file":"Create a new file",
"Name:":"Name:","New Folder":"New Folder","Folder name:":"Folder name:","Create a new folder":"Create a new folder","Creating folder":"Creating folder",Folder:"Folder","Create an empty folder":"Create an empty folder","Create an empty folder on the Orion server.  You can import, upload, or create content in the editor.":"Create an empty folder on the Orion server.  You can import, upload, or create content in the editor.","Sample HTML5 Site":"Sample HTML5 Site","Generate a sample":"Generate a sample",
'Generate an HTML5 "Hello World" website, including JavaScript, HTML, and CSS files.':'Generate an HTML5 "Hello World" website, including JavaScript, HTML, and CSS files.',"Creating a folder for ${0}":"Creating a folder for ${0}","SFTP Import":"SFTP Import","Import content from SFTP":"Import content from SFTP","Import content from an SFTP location into an Orion folder.  You will be prompted for the SFTP location and credentials.":"Import content from an SFTP location into an Orion folder.  You will be prompted for the SFTP location and credentials.",
"Imported Content":"Imported Content","Upload a Zip":"Upload a Zip","Upload content from a local zip file":"Upload content from a local zip file","Upload content from a local zip file into an Orion folder.  You will be prompted for the local zip file.":"Upload content from a local zip file into an Orion folder.  You will be prompted for the local zip file.","Uploaded Content":"Uploaded Content","Creating an upload folder for ":"Creating an upload folder for ","Clone Git Repository":"Clone Git Repository",
"Clone a git repository":"Clone a git repository","Go to the Orion repositories page to provide a git repository URL.  Once the repository is created, it will appear in the Navigator.":"Go to the Orion repositories page to provide a git repository URL.  Once the repository is created, it will appear in the Navigator.","Link to Server":"Link to Server","Link to existing content on the server":"Link to existing content on the server","Create a folder that links to an existing folder on the server.":"Create a folder that links to an existing folder on the server.",
"Server path:":"Server path:","The name and server location were not specified.":"The name and server location were not specified.","Go Up":"Go Up","Move up to the parent folder":"Move up to the parent folder","Go Into":"Go Into","Move into the selected folder":"Move into the selected folder","Import local file...":"Import local file...","Copy files and folders from your local file system":"Copy files and folders from your local file system","SFTP from...":"SFTP from...","Copy files and folders from a specified SFTP connection":"Copy files and folders from a specified SFTP connection",
"Importing from ${0}":"Importing from ${0}","SFTP to...":"SFTP to...","Copy files and folders to a specified SFTP location":"Copy files and folders to a specified SFTP location",Exporting:"Exporting to ${0}","Pasting ${0}":"Pasting ${0}","Copy to":"Copy to","Move to":"Move to","Copying ${0}":"Copying ${0}","Moving ${0}":"Moving ${0}","Renaming ${0}":"Renaming ${0}","Deleting ${0}":"Deleting ${0}","Creating ${0}":"Creating ${0}","Linking to ${0}":"Linking to ${0}","Move files and folders to a new location":"Move files and folders to a new location",
"Copy Items":"Copy Items","Copy the selected items to the copy/paste buffer":"Copy the selected items to the copy/paste buffer","Paste Items":"Paste Items","Paste items from the copy/paste buffer":"Paste items from the copy/paste buffer","Cannot paste into the Workspace root":"Cannot paste into the Workspace root","Open With":"Open With","Loading ":"Loading ",New:"New",Actions:"Actions","Orion Content":"Orion Content"," is not supported in this file system":" is not supported in this file system",
"Create new content":"Create new content","Import from HTTP...":"Import from HTTP...","File URL:":"File URL:","Copy a file from a URL and optionally unzip it":"Copy a file from a URL and optionally unzip it","Unzip *.zip files:":"Unzip *.zip files:","Extracted from:":"Extracted from:","Did not drop ${0}.  Folder drop is not supported in this browser.":"Did not drop ${0}.  Folder drop is not supported in this browser.","You cannot copy files directly into the workspace.  Create a folder first.":"You cannot copy files directly into the workspace.  Create a folder first.",
"Unzip ${0}?":"Unzip ${0}?",NoFile:"Use the ${0} to create new files and folders. Click a file to start coding."});define("orion/navigate/nls/messages",["orion/i18n!orion/navigate/nls/messages","orion/navigate/nls/root/messages"],function(j,k){var h={root:k};Object.keys(j).forEach(function(e){typeof h[e]==="undefined"&&(h[e]=j[e])});return h});
define("orion/fileClient",["i18n!orion/navigate/nls/messages","orion/Deferred","orion/i18nUtil"],function(j,k,h){function e(c,a,d){if(!c[a])throw a+j[" is not supported in this file system"];return c[a].apply(c,d)}function d(c,a,i,g){if(!c.readBlob)throw j["source file service does not support binary read"];if(!i.writeBlob)throw j["target file service does not support binary write"];if(a[a.length-1]!=="/")return e(c,"readBlob",[a]).then(function(b){return e(i,"writeBlob",[g,b])});var b=g.substring(0,
g.length-1),l=decodeURIComponent(b.substring(b.lastIndexOf("/")+1)),b=b.substring(0,b.lastIndexOf("/")+1);return e(i,"createFolder",[b,l]).then(function(){},function(){}).then(function(){return e(c,"fetchChildren",[a]).then(function(b){for(var a=[],e=0;e<b.length;++e){var l=b[e].Location,f=l;b[e].Directory&&(f=l.substring(0,l.length-1));f=decodeURIComponent(f.substring(f.lastIndexOf("/")+1));f=g+encodeURIComponent(f);b[e].Directory&&(f+="/");a[e]=d(c,l,i,f)}return k.all(a)})})}function f(c,a){function d(b){var a=
new k;a.reject(j["No Matching FileService for location:"]+b);return a}var g=c.getServiceReferences("orion.core.file"),b=g;if(a)for(var b=[],e=0;e<g.length;++e)a(g[e])&&b.push(g[e]);for(var f=[],m=[],o=[],t=[],r={fetchChildren:function(){var b=new k;b.resolve(t);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:t,ChildrenLocation:"/"})},100);return b},search:d,createProject:d,createFolder:d,createFile:d,deleteFile:d,moveFile:d,copyFile:d,read:d,write:d},g=0;g<b.length;++g)t[g]={Directory:!0,Length:0,LocalTimeStamp:0,Location:b[g].getProperty("top"),ChildrenLocation:b[g].getProperty("top"),Name:b[g].getProperty("Name")},e=b[g].getProperty("pattern")||".*",e[0]!=="^"&&(e="^"+e),f[g]=RegExp(e),m[g]=c.getService(b[g]),o[g]=b[g].getProperty("Name"),
b[g].getProperty("NameKey")&&b[g].getProperty("nls")&&h.getMessageBundle(b[g].getProperty("nls")).then(function(a,c){t[a].Name=c[b[a].getProperty("NameKey")];o[a]=c[b[a].getProperty("NameKey")]}.bind(this,g));this._getServiceIndex=function(b){if(b==="/")return-1;else if(!b||b.length&&b.length===0)return m[0]?0:-1;for(var a=0;a<f.length;++a)if(f[a].test(b))return a;throw j["No Matching FileService for location:"]+b;};this._getService=function(b){b=this._getServiceIndex(b);return b===-1?r:m[b]};this._getServiceName=
function(b){b=this._getServiceIndex(b);return b===-1?r.Name:o[b]};this._getServiceRootURL=function(b){b=this._getServiceIndex(b);return b===-1?r.Location:t[b].Location}}f.prototype={getService:function(c){return this._getService(c)},fileServiceName:function(c){return this._getServiceName(c)},fileServiceRootURL:function(c){return this._getServiceRootURL(c)},fetchChildren:function(c){return e(this._getService(c),"fetchChildren",arguments)},createWorkspace:function(c){return e(this._getService(),"createWorkspace",
arguments)},loadWorkspaces:function(){return e(this._getService(),"loadWorkspaces",arguments)},loadWorkspace:function(c){return e(this._getService(c),"loadWorkspace",arguments)},createProject:function(c,a,d,g){return e(this._getService(c),"createProject",arguments)},createFolder:function(c,a){return e(this._getService(c),"createFolder",arguments)},createFile:function(c,a){return e(this._getService(c),"createFile",arguments)},deleteFile:function(c){return e(this._getService(c),"deleteFile",arguments)},
moveFile:function(c,a,i){var g=this._getService(c),b=this._getService(a);if(g===b)return e(g,"moveFile",arguments);var l=c[c.length-1]==="/",f=a;f[f.length-1]!=="/"&&(f+="/");if(i)f+=encodeURIComponent(i);else{var m=c;l&&(m=m.substring(0,m.length-1));f+=m.substring(m.lastIndexOf("/")+1)}l&&f[f.length-1]!=="/"&&(f+="/");return d(g,c,b,f).then(function(){return e(g,"deleteFile",[c])})},copyFile:function(c,a,i){var g=this._getService(c),b=this._getService(a);if(g===b)return e(g,"copyFile",arguments);
var l=c[c.length-1]==="/",f=a;f[f.length-1]!=="/"&&(f+="/");if(i)f+=encodeURIComponent(i);else{var m=c;l&&(m=m.substring(0,m.length-1));f+=m.substring(m.lastIndexOf("/")+1)}l&&f[f.length-1]!=="/"&&(f+="/");return d(g,c,b,f)},read:function(c,a){return e(this._getService(c),"read",arguments)},write:function(c,a,d){return e(this._getService(c),"write",arguments)},remoteImport:function(c,a){return e(this._getService(c),"remoteImport",arguments)},remoteExport:function(c,a){return e(this._getService(c),
"remoteExport",arguments)},search:function(c){return e(this._getService(c.resource),"search",arguments)}};f.prototype.constructor=f;return{FileClient:f}});
define("orion/globalCommands","i18n!orion/nls/messages,require,orion/commonHTMLFragments,orion/keyBinding,orion/commandRegistry,orion/commands,orion/parameterCollectors,orion/extensionCommands,orion/uiUtils,orion/keyBinding,orion/breadcrumbs,orion/webui/littlelib,orion/webui/splitter,orion/webui/dropdown,orion/webui/tooltip,orion/contentTypes,orion/URITemplate,orion/PageUtil,orion/widgets/themes/ThemePreferences,orion/widgets/themes/container/ThemeData,orion/Deferred,orion/widgets/UserMenu,orion/PageLinks,orion/webui/dialogs/OpenResourceDialog,text!orion/banner/banner.html,text!orion/banner/footer.html,text!orion/banner/toolbar.html,orion/widgets/input/DropDownMenu,orion/widgets/input/GroupedContent,orion/util,orion/customGlobalCommands,orion/fileClient".split(","),function(j,
k,h,e,d,f,c,a,i,g,b,l,n,m,o,t,r,s,v,w,u,p,q,x,A,E,K,H,y,z,B,J){function F(b,a){if(b.getLabel)return b.getLabel();else{var c=new u;c.resolve(a.properties.name);return c}}function G(b){l.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 V(b,a){var c=b.getServiceReferences("orion.core.auth");D=[];for(var d=C.createMenuGenerator.apply(this,arguments),g=0;g<c.length;g++){var e=
c[g],q=b.getService(e);F(q,e).then(function(b){q.getKey().then(function(a){D.push(a);q.getUser().then(function(c){d.addUserItem(a,q,b,c)},function(c,g){d.addUserItem(a,q,b,g)});window.addEventListener("storage",function(){L[a]!==localStorage.getItem(a)&&(L[a]=localStorage.getItem(a),q.getUser().then(function(c){d.addUserItem(a,q,b,c)},function(){d.addUserItem(a,q,b)}))},!1)})})}}function O(b){return b}function P(b,c,d,g,e){function q(b){if(b)if(!b.visibleWhen||b.visibleWhen(c)){var a=new f.CommandInvocation(c,
c,null,b,g);return(new u).resolve([b,a])}else if(typeof e==="function")return l||(l=e()),u.when(l,function(a){if(a&&c===I&&(!b.visibleWhen||b.visibleWhen(a)))return a=new f.CommandInvocation(a,a,null,b,g),[b,a]});return(new u).resolve()}var p=arguments,i,l,x=b&&b.getServiceReferences("orion.page.link.related");x&&x.length!==0&&u.when(function(){if(i)return i;var a=b.getService("orion.core.contentTypeRegistry");a||(a=new t.ContentTypeRegistry(b),a=b.getService("orion.core.contentTypeRegistry"));return a.getContentTypes().then(function(b){return i=
b})}(),function(){if(C.beforeGenerateRelatedLinks.apply(this,p)){for(var c=[],e=0;e<x.length;e++){var l={},n,m=x[e].getPropertyKeys();for(n=0;n<m.length;n++)l[m[n]]=x[e].getProperty(m[n]);if(l.id&&(n=n=null,d.indexOf(l.id)<0))if((l.nls&&l.nameKey||l.name)&&l.uriTemplate)n=a._createCommandOptions(l,x[e],b,i,!0),c.push(n);else if(n=g.findCommand(l.id))c.push((new u).resolve(n));else{var h=b.getServiceReferences("orion.navigate.command");for(n=0;n<h.length;n++)if(h[n].getProperty("id")===l.id){for(var l=
{},m=h[n].getPropertyKeys(),A=0;A<m.length;A++)l[m[A]]=h[n].getProperty(m[A]);n=a._createCommandOptions(l,h[n],b,i,!0);c.push(n);break}}}u.all(c,O).then(function(b){b=b.map(function(b){return b instanceof f.Command?b:new f.Command(b)}).sort(function(b,a){return b.name.localeCompare(a.name)});return u.all(b.map(q),O).then(function(b){b.forEach(function(b){b&&C.addRelatedLinkCommand(b[0],b[1])});C.afterGenerateRelatedLinks.apply(this,p)})})}})}function T(b){var a=l.node("globalActions");a&&(b.destroy(a),
b.renderCommands(a.id,a,{},{},"tool"))}function S(b){var a=window.getComputedStyle(b,null);return a===null?b:a.getPropertyValue("position")==="absolute"||!b.parentNode||b===document.body?b:S(b.parentNode)}function U(b){var a={},c=null;typeof b==="string"&&(b=l.node(b));b||(b=l.node("pageActions"));for(var d=b;d&&d.classList;){if(d.classList.contains("toolComposite")){c=d;break}d=d.parentNode}if(b.classList.contains("commandMarker"))a.commandNode=b;if(c&&(a.slideContainer=l.$(".slideParameters",c),
a.parameterArea=l.$(".parameters",c),a.dismissArea=l.$(".parametersDismiss",c),a.notifications=l.$("#notificationArea",c),c.parentNode&&(a.toolbarTarget=l.$(".toolbarTarget",c.parentNode),a.toolbarTarget)))b=l.bounds(a.toolbarTarget),d=l.bounds(S(a.toolbarTarget.parentNode)),a.toolbarTargetY=b.top-d.top,a.toolbar=c;return a}function N(b){if(b.toolbarTarget&&b.toolbarTargetY){var a=0,c;b.notifications&&b.notifications.classList.contains("slideContainerActive")&&(c=l.bounds(b.notifications),a+=c.height);
b.slideContainer&&b.slideContainer.classList.contains("slideContainerActive")&&(c=l.bounds(b.slideContainer),a+=c.height);a>0&&(a+=8);a?(b.toolbarTarget.style.top=b.toolbarTargetY+a+"px",b.toolbar.style.paddingBottom=a+"px"):b.toolbarTarget.style.top=b.toolbar.style.paddingBottom=""}}var d=function(b){var a=document.createElement("a");a.href=b;return a.href}(k.toUrl("auth/NotifyAuthentication.html")),L={},C={createMenuGenerator:B.createMenuGenerator||function(b,a){if(l.node("userMenu")){var c=l.node("userDropdown"),
d=new m.Dropdown({dropdown:c}),c=new p.UserMenu({dropdownNode:c,dropdown:d,serviceRegistry:b}),d=l.node("userTrigger");new o.Tooltip({node:d,text:j.Options,position:["below","left"]});var d=document.getElementById("userTrigger"),g=d.className;g+=" imageSprite core-sprite-silhouette";d.className=g;c.setKeyAssist(a);return c}},beforeGenerateRelatedLinks:B.beforeGenerateRelatedLinks||function(){var b=l.node("relatedLinks");l.empty(b);return!0},addRelatedLinkCommand:B.addRelatedLinkCommand||function(b,
a){var c=l.node("relatedLinks");f.createCommandMenuItem(c,b,a).classList.remove("dropdownMenuItem")},afterGenerateRelatedLinks:B.afterGenerateRelatedLinks||function(){},afterSetPageTarget:B.afterSetPageTarget||function(){},generateNavigationMenu:B.generateNavigationMenu||function(){var b=document.getElementById("centralNavigation");new o.Tooltip({node:b,text:"Navigation Menu",position:["right"]});var b=new H("primaryNav","centralNavigation"),a=new y;b.addContent(a.getContentPane())},afterGenerateBanner:B.afterGenerateBanner||
function(){}},D=[],I,R=[],M,Q=null;return{generateBanner:function(b,a,d,g,p,m,o,t){function r(){this.create();this._filterString=""}function H(b){b.registerService("orion.cm.managedservice",{updated:function(b){for(var b=b&&b["links.newtab"]!=="undefined"?b["links.newtab"]?"_blank":"_self":"_self",a=l.$$array(".targetSelector"),c=0;c<a.length;c++)a[c].target=b}},{pid:"nav.config"})}(new v.ThemePreferences(g,new w.ThemeData)).apply();var y=l.node(b);if(!y)throw j["could not find banner parent, id was "]+
b;var B=document.createRange();B.selectNode(y);B=B.createContextualFragment(A);l.processTextNodes(B,j);y.firstChild?y.insertBefore(B,y.firstChild):y.appendChild(B);y=l.node("home");y.href=k.toUrl("edit/edit.html");y.setAttribute("aria-label",j["Orion Home"]);l.node("progressPane").src=k.toUrl("images/none.png");if(y=l.node("pageToolbar"))y.classList.add("toolbarLayout"),y.innerHTML=K+h.slideoutHTMLFragment("mainToolbar");(y=l.node("closeNotifications"))&&y.setAttribute("aria-label",j["Close notification"]);
if(z.isFirefox<=17&&(y=l.node("staticBanner")))y.style.width="100%",y.style.MozBoxSizing="border-box";if(y=l.node("footer"))y.innerHTML=E,l.processTextNodes(y,j);d.setParameterCollector(new c.CommandParameterCollector(U,N));document.addEventListener("keydown",function(b){b.keyCode===l.KEY.ESCAPE&&(b=a.getService("orion.page.message"))&&b.setProgressMessage("")},!1);C.generateNavigationMenu.apply(this,arguments);var s=l.node("navigationlinks");s&&q.createPageLinks(a,"orion.page.link").then(function(b){b.forEach(function(b){var a=
document.createElement("li");a.appendChild(b);s.appendChild(a)})});if(y=l.$(".split")){var B=l.$(".sidePanelLayout"),J=l.$(".mainPanelLayout");if(B&&J)Q={side:B,main:J},Q.splitter=new n.Splitter({node:y,sidePanel:B,mainPanel:J,toggle:!0,closeByDefault:t}),y=new f.Command({name:j["Toggle side panel"],tooltip:j["Open or close the side panel"],id:"orion.toggleSidePane",callback:function(){Q.splitter.toggleSidePanel()}}),d.addCommand(y),d.registerCommandContribution("pageActions","orion.toggleSidePane",
1,null,!0,new e.KeyBinding("o",!0)),o&&Q.splitter.addResizeListener(function(b){o&&b===J&&o.resize()})}var u=!1,F=function(b,a,c){if(!u){var a=a.getService("orion.page.progress"),d=new x.OpenResourceDialog({searcher:b,progress:a,searchRenderer:b.defaultRenderer,onHide:function(){u=!1;c&&c.focus()}});window.setTimeout(function(){u=!0;d.show()},0)}},y=new f.Command({name:j["Find File Named..."],tooltip:j["Choose a file by name and open an editor on it"],id:"eclipse.openResource",callback:function(){F(p,
a,o)}});d.addCommand(y);d.registerCommandContribution("globalActions","eclipse.openResource",100,null,!0,new e.KeyBinding("f",!0,!0));y=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=l.node("banner"),a=l.node("footer"),c=l.$(".content-fixedHeight");b.style.visibility==="hidden"?(b.style.visibility="visible",a.style.visibility="visible",c.classList.remove("content-fixedHeight-maximized")):(b.style.visibility=
"hidden",a.style.visibility="hidden",c.classList.add("content-fixedHeight-maximized"));o&&o.resize();return!0}});d.addCommand(y);d.registerCommandContribution("globalActions","orion.toggleTrim",100,null,!0,new e.KeyBinding("m",!0,!0));y=new f.Command({name:j["System Configuration Details"],tooltip:j["System Config Tooltip"],id:"orion.configDetailsPage",hrefCallback:function(){return k.toUrl("help/about.html")}});d.addCommand(y);d.registerCommandContribution("globalActions","orion.configDetailsPage",
100,null,!0,new e.KeyBinding(112,!0,!0));y=new f.Command({name:j["Background Operations"],tooltip:j["Background Operations Tooltip"],id:"orion.backgroundOperations",hrefCallback:function(){return k.toUrl("operations/list.html")}});d.addCommand(y);d.registerCommandContribution("globalActions","orion.backgroundOperations",100,null,!0,new e.KeyBinding("o",!0,!0));r.prototype={create:function(){var b=this._keyAssistDiv=document.createElement("div");b.id="keyAssist";b.style.display="none";b.classList.add("keyAssistFloat");
b.setAttribute("role","menu");var a=this._keyAssistInput=document.createElement("input");a.classList.add("keyAssistInput");a.type="text";a.placeholder=j["Filter bindings"];b.appendChild(a);var c=this._keyAssistContents=document.createElement("div");c.classList.add("keyAssistContents");if(z.isIOS||z.isAndroid)c.style.overflowY="auto";b.appendChild(c);var d=this._keyAssistTable=document.createElement("table");d.tabIndex=0;d.classList.add("keyAssistList");c.appendChild(d);document.body.appendChild(b);
a.addEventListener("keydown",function(b){this._keyDown(b)}.bind(this));d.addEventListener("keydown",function(b){this._keyDown(b)}.bind(this));a.addEventListener("input",function(){this.filterChanged()}.bind(this));c.addEventListener(z.isFirefox?"DOMMouseScroll":"mousewheel",function(b){this._scrollWheel(b)}.bind(this));document.addEventListener("keydown",function(b){b.keyCode===l.KEY.ESCAPE&&this.hide()}.bind(this));l.addAutoDismiss([b],function(){this.hide()}.bind(this))},createContents:function(){l.empty(this._keyAssistTable);
this._selectedIndex=-1;this._selectedRow=null;this._idCount=this._keyAssistContents.scrollTop=0;if(o&&o.getTextView&&o.getTextView()){var b=o.getTextView(),a=b.getActions(!0).filter(function(a){return(a=b.getActionDescription(a))&&a.name});a.sort(function(a,c){return b.getActionDescription(a).name.localeCompare(b.getActionDescription(c).name)});this.createHeader(j.Editor);for(var c=function(a){return function(){b.focus();return b.invokeAction(a)}},g={},e,q=0;q<a.length;q++)for(var p=a[q],f=b.getActionDescription(p),
x=b.getKeyBindings(p),n=0;n<x.length;n++){e=x[n];var m=i.getUserKeyString(e);e.scopeName?(g[e.scopeName]||(g[e.scopeName]=[]),g[e.scopeName].push({bindingString:m,name:f.name,execute:c(p)})):this.createItem(m,f.name,c(p))}for(var h in g)if(g[h].length){this.createHeader(h);for(a=0;a<g[h].length;a++)e=g[h][a],this.createItem(e.bindingString,e.name,e.execute)}}this.createHeader(j.Global);d.showKeyBindings(this)},createItem:function(b,a,c){if(this._filterString){var d=this._filterString.toLowerCase(),
g;d!==this._filterString?(d=this._filterString,g=function(b){return b}):g=function(b){return b.toLowerCase()};if(g(a).indexOf(d)===-1&&g(b).indexOf(d)===-1&&g(this._lastHeader).indexOf(d)===-1)return}var e=this._keyAssistTable.insertRow(-1);e.id="keyAssist-keyBinding-"+this._idCount++;e.setAttribute("role","menuitem");e._execute=c;e.classList.add("keyAssistItem");e.addEventListener("click",function(b){this._selectedRow=e;this.execute();b.preventDefault()}.bind(this));c=e.insertCell(-1);c.classList.add("keyAssistName");
c.appendChild(document.createTextNode(a));c=e.insertCell(-1);c.classList.add("keyAssistAccel");c.appendChild(document.createTextNode(b))},createHeader:function(b){this._lastHeader=b;var a=this._keyAssistTable.insertRow(-1);a.classList.add("keyAssistSection");var a=a.insertCell(-1),c=document.createElement("h2");c.appendChild(document.createTextNode(b));a.appendChild(c)},execute:function(){window.setTimeout(function(){this.hide();var b=this._selectedRow;this._selectedRow=null;b&&b._execute&&b._execute()}.bind(this),
0)},filterChanged:function(){this._timeout&&window.clearTimeout(this._timeout);this._timeout=window.setTimeout(function(){this._timeout=null;var b=this._keyAssistInput.value;if(this._filterString!==b)this._filterString=b,this.createContents()}.bind(this),100)},hide:function(){if(this.isVisible()){var b=document.activeElement,a=this._keyAssistDiv,b=a===b||(a.compareDocumentPosition(b)&16)!==0;a.style.display="none";b&&document.compareDocumentPosition(this._previousActiveElement)!==1&&this._previousActiveElement.focus();
this._previousActiveElement=null}},isVisible:function(){return this._keyAssistDiv.style.display==="block"},select:function(b){var a=this._keyAssistTable.querySelectorAll(".keyAssistItem");if(a.length===0)this._selectedIndex=-1;else{var c=this._selectedIndex;c+=b?1:-1;c%=a.length;c<0&&(c=a.length-1);if(this._selectedIndex!==-1)b=a[this._selectedIndex],b.classList.remove("selected"),this._selectedRow=null;this._selectedIndex=c;if(this._selectedIndex!==-1){this._selectedRow=b=a[this._selectedIndex];
b.classList.add("selected");this._keyAssistTable.setAttribute("aria-activedescendant",b.id);this._keyAssistTable.focus();var a=b.getBoundingClientRect(),d=this._keyAssistContents,g=d.getBoundingClientRect();b.offsetTop<d.scrollTop?c===0?d.scrollTop=0:b.scrollIntoView(!0):a.bottom>g.bottom&&b.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(b){if(b.keyCode===40)this.select(!0);else if(b.keyCode===38)this.select(!1);else if(b.keyCode===13)this.execute();else return;b.preventDefault()},_scrollWheel:function(b){var a=0,a=z.isIE||z.isOpera?-b.wheelDelta:z.isFirefox?b.detail*40:-b.wheelDeltaY,c=this._keyAssistContents,d=c.scrollTop;c.scrollTop+=a;if(d!==c.scrollTop)return b.preventDefault&&
b.preventDefault(),!1}};var P=new r,O=new f.Command({name:j["Show Keys"],tooltip:j["Show a list of all the keybindings on this page"],id:"eclipse.keyAssist",callback:function(){P.isVisible()?P.hide():P.show();return!0}});d.addCommand(O);d.registerCommandContribution("globalActions","eclipse.keyAssist",100,null,!0,new e.KeyBinding(191,!1,!0));y=function(){o.getTextView().setKeyBinding(new e.KeyBinding(191,!1,!0,!z.isMac,z.isMac),O.id);o.getTextView().setAction(O.id,O.callback,O)};o&&o.getTextView&&
(o.getTextView()?y():o.addEventListener("TextViewInstalled",y));T(d);V(a,O.callback);G(a);window.addEventListener("hashchange",function(){d.processURL(window.location.href)},!1);window.setTimeout(function(){H(a)},0);C.afterGenerateBanner.apply(this,arguments)},getToolbarElements:U,getMainSplitter:function(){return Q},layoutToolbarElements:N,setPageTarget:function(a){var c,d,g=a.breadcrumbRootName,e=a.serviceRegistry;a.target?(a.searchService&&a.searchService.setLocationByMetaData(a.target),a.fileService&&
!a.breadcrumbTarget&&(d=g?g+" ":"",d+=a.fileService.fileServiceName(a.target.Location),g=null),c=a.name||a.target.Name,I=a.target,P(e,a.target,R,a.commandService,a.makeAlternate)):(a.breadcrumbTarget||(g=g||a.task||a.name),c=a.name,P(e,{NoTarget:""},R,a.commandService,a.makeAlternate));(M=a.title)||(M=c?c+" - "+a.task:a.task);window.document.title=M;C.afterSetPageTarget.apply(this,arguments);if(c=l.node("location")){l.empty(c);var q=e&&new J.FileClient(e),e=a.breadcrumbTarget||a.target,q=q&&e&&e.Location?
q.fileServiceRootURL(e.Location):null;new b.BreadCrumbs({container:c,resource:e,rootSegmentName:g,workspaceRootSegmentName:d,workspaceRootURL:q,makeHref:a.makeBreadcrumbLink})}},setDirtyIndicator:function(b){if(M)M.charAt(0)==="*"&&!b&&(M=M.substring(1)),b&&M.charAt(0)!=="*"&&(M="*"+M),window.document.title=M;var a=l.node("dirty");if(a)a.textContent=b?"*":""},setPageCommandExclusions:function(b){R=b},notifyAuthenticationSite:d}});
define("orion/urlUtils",["orion/PageUtil","orion/URL-shim"],function(j){return{detectValidURL:function(k){for(var h=/\[([^\]]*)\]\(([^\)]+)\)/g,e=h.exec(k),d=[],f=0;e;){if(e.length===3&&e[2].length>0){var c=new URL(e[2]);c.protocol!==":"&&j.validateURLScheme(c.href)&&(e.index>f&&d.push({segmentStr:k.substring(f,e.index)}),d.push({segmentStr:e[1].length>0?e[1]:e[2],urlStr:e[2]}),f=e.index+e[0].length)}e=h.exec(k)}if(f===0)return null;f<k.length-1&&d.push({segmentStr:k.substring(f)});return d},processURLSegments:function(j,
h){h.forEach(function(e){if(e.urlStr){var d=document.createElement("a");d.href=e.urlStr;d.appendChild(document.createTextNode(e.segmentStr))}else d=document.createElement("span"),d.textContent=e.segmentStr;j.appendChild(d)})}}});
define("orion/status",["i18n!orion/nls/messages","orion/webui/littlelib","orion/globalCommands","orion/urlUtils"],function(j,k,h,e){function d(c,a,d,g,b){this._serviceRegistry=c;this._serviceRegistration=c.registerService("orion.page.message",this);this._operationsClient=a;this.notificationContainerDomId=b;this.domId=d;this.progressDomId=g||d;this._hookedClose=!1;this._timer=null;this._clickToDisMiss=!0;this._cancelMsg=null}var f;d.prototype={_init:function(){var c=k.node("closeNotifications");if(c&&
!this._hookedClose){c.style.cursor="pointer";this._hookedClose=!0;var a=k.node(this.notificationContainerDomId);k.addAutoDismiss([a],function(){this._clickToDisMiss&&this.close()}.bind(this));c.addEventListener("click",function(){this.close()}.bind(this));a.addEventListener("click",function(c){c&&c.target&&c.target.nodeName.toLowerCase()==="a"&&(c=k.$$("a",a))&&c.length&&c.length===1&&this.close()}.bind(this))}},close:function(){window.clearTimeout(this._timer);this.setProgressMessage("");var c=k.node("closeNotifications");
if(this._cancelMsg&&this._cancelFunc&&c)c.innerHTML="",c.classList.remove("cancelButton"),c.classList.add("dismissButton"),c.classList.add("core-sprite-close"),c.classList.add("imageSprite"),this._cancelFunc(),this._cancelMsg=null},_getNotifierElements:function(){if(!this._notifierElements)this._notifierElements=h.getToolbarElements(this.notificationContainerDomId);return this._notifierElements},setMessage:function(c,a,d){this._init();this.currentMessage=c;var g=k.node(this.domId);if(typeof d==="boolean"){var b=
g.getAttribute("aria-live");g.setAttribute("aria-live",d?"polite":"off");window.setTimeout(function(){c===this.currentMessage&&(k.empty(g),g.appendChild(document.createTextNode(c)),window.setTimeout(function(){g.setAttribute("aria-live",b)},100))}.bind(this),100)}else k.empty(g),g.appendChild(document.createTextNode(c));typeof a==="number"&&window.setTimeout(function(){c===this.currentMessage&&(k.empty(g),g.appendChild(document.createTextNode("")))}.bind(this),a)},setErrorMessage:function(c){this._clickToDisMiss=
!0;this.currentMessage=c;this._init();var a=c.responseText||c.message||c;if(typeof a==="string")try{a=JSON.parse(a)}catch(d){}var c=a.Message||a,g="red";if(a.Severity)switch(a.Severity){case "Warning":g="#FFCC00";break;case "Error":g="red";break;case "Info":case "Ok":g="green"}a=document.createElement("span");a.style.color=g;a.appendChild(document.createTextNode(c));c=k.node(this.domId);k.empty(c);c.appendChild(a)},setProgressMessage:function(c){this._clickToDisMiss=!1;this._init();this.currentMessage=
c;var a=document.createElement("span");a.classList.add("imageSprite");a.classList.add("progressIcon");a.classList.add("core-sprite-progress");var d=k.node(this.progressDomId);k.empty(d);d.appendChild(a);d.appendChild(document.createTextNode(c));a=k.node(this.notificationContainerDomId);a.classList.remove("notificationHide");if(c&&c.length>0)a.classList.add("progressNormal"),a.classList.add("notificationShow");else if(this._progressMonitors&&this._progressMonitors.length>0)return this._renderOngoingMonitors();
else a.classList.remove("notificationShow"),a.classList.add("notificationHide")},setCancelFunction:function(c){this._cancelFunc=c},setProgressResult:function(c,a){this._clickToDisMiss=!1;this._cancelMsg=a;this.currentMessage=c;var d=c.responseText||c;if(typeof d==="string")try{d=JSON.parse(d)}catch(g){}this._init();var b=d.Message||d.toString(),l=j.UnknownError,f="core-sprite-information",m="progressNormal",h=document.createElement("span");h.classList.add("imageSprite");h.classList.add("progressIcon");
var t=[];if(d.Severity)switch(d.Severity){case "Warning":l=j.UnknownWarning;f="core-sprite-warning";m="progressWarning";t.push("progressInfo");t.push("progressError");t.push("progressNormal");this._clickToDisMiss=!0;break;case "Error":f="core-sprite-error";m="progressError";t.push("progressWarning");t.push("progressInfo");t.push("progressNormal");this._clickToDisMiss=!0;break;default:m="progressNormal",t.push("progressWarning"),t.push("progressError"),t.push("progressNormal")}t.push("notificationHide");
h.classList.add(f);var r=k.node(this.progressDomId),f=k.node(this.notificationContainerDomId);k.empty(r);r.appendChild(h);b===Object.prototype.toString()&&(b=l);if(d.HTML)d=document.createElement("span"),d.innerHTML=b,r.appendChild(d);else{if(l=e.detectValidURL(b))b=document.createDocumentFragment(),e.processURLSegments(b,l),Array.prototype.forEach.call(k.$$("a",b),function(b){b.target="_blank"});else{if(d.Severity!=="Warning"&&d.Severity!=="Error"&&!a)this._timer&&window.clearTimeout(this._timer),
this._timer=window.setTimeout(function(){this.setProgressMessage("");this._timer=null}.bind(this),5E3);b=document.createTextNode(b)}r.appendChild(b)}if(m&&this.progressDomId!==this.domId){f.classList.add(m);for(m=0;m<t.length;m++)f.classList.remove(t[m])}f.classList.add("notificationShow");if((t=k.node("closeNotifications"))&&this._cancelMsg)t.classList.add("cancelButton"),t.classList.remove("dismissButton"),t.classList.remove("core-sprite-close"),t.classList.remove("imageSprite"),t.innerHTML=this._cancelMsg},
showWhile:function(c,a){var d=this;if(a){d.setProgressMessage(a);var g=function(){a===d.currentMessage&&d.setProgressMessage("")};c.then(g,g)}return c},_lastProgressId:0,_progressMonitors:{length:0},createProgressMonitor:function(c,a){return new f(this,++this._lastProgressId,c,a)},_renderOngoingMonitors:function(){if(this._progressMonitors.length>0){var c="",a=!0,d;for(d in this._progressMonitors)this._progressMonitors[d].status&&(a||(c+=", "),c+=this._progressMonitors[d].status,a=!1);this.setProgressMessage(c)}else this.setProgressMessage("")},
_beginProgressMonitor:function(c){this._progressMonitors[c.progressId]=c;this._progressMonitors.length++;this._renderOngoingMonitors()},_workedProgressMonitor:function(c){this._progressMonitors[c.progressId]=c;this._renderOngoingMonitors()},_doneProgressMonitor:function(c){delete this._progressMonitors[c.progressId];this._progressMonitors.length--;c.status?this.setProgressResult(c.status):this._renderOngoingMonitors()}};d.prototype.constructor=d;f=function(c,a,d,g){this.statusService=c;this.progressId=
a;if(d){this.deferred=d;this.begin(g);var b=this;d.then(function(){b.done.bind(b)()},function(){b.done.bind(b)()})}};f.prototype.begin=function(c){this.status=c;this.statusService._beginProgressMonitor(this)};f.prototype.done=function(c){this.status=c;this.statusService._doneProgressMonitor(this)};f.prototype.worked=function(c){this.status=c;this.statusService._workedProgressMonitor(this)};f.prototype.constructor=f;return{StatusReportingService:d,ProgressMonitor:f}});
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 h={root:k};Object.keys(j).forEach(function(e){typeof h[e]==="undefined"&&(h[e]=j[e])});return h});
define("orion/webui/popupdialog",["i18n!orion/widgets/nls/messages","require","orion/webui/littlelib","orion/webui/tooltip"],function(j,k,h,e){function d(){}d.prototype={_initialize:function(d,c,a,i,g){this._tooltip=new e.Tooltip({node:d,hideDelay:g||0,afterShowing:this._afterShowingFunction(c).bind(this),afterHiding:a,trigger:i?i:"click"});this.$parent=this._tooltip.contentContainer();this.$parent.role="dialog";d=document.createRange();d.selectNode(this.$parent);d=d.createContextualFragment(this.TEMPLATE);
this.messages&&h.processTextNodes(d,j);this.$parent.appendChild(d);var b=this._tooltip;this.$parent.addEventListener("keydown",function(a){a.keyCode===h.KEY.ESCAPE&&b.hide()},!1);this._bindElements(this.$parent);typeof this._bindToDom==="function"&&this._bindToDom(this.$parent)},_bindElements:function(d){for(var c=0;c<d.childNodes.length;c++){var a=d.childNodes[c];a.id&&(this["$"+a.id]=a);this._bindElements(a)}},_afterShowingFunction:function(d){return function(){d&&d.bind(this)();if(!this.customFocus){var c=
h.firstTabbable(this.$parent);c&&c.focus()}}},hide:function(){this._tooltip.hide()},show:function(){this._tooltip.show()}};d.prototype.constructor=d;return{PopupDialog:d}});
define("orion/operationsCommands",["i18n!orion/operations/nls/messages","require","orion/webui/littlelib","orion/commands"],function(j,k,h,e){var d={};(function(){var f=!1;d.updateNavTools=function(c,a,d,g,b,e){var n=h.node(g);if(n)a.destroy(n);else throw j["could not find toolbar "]+g;a.renderCommands(g,n,e,d,"button");if(b&&(g=h.node(b)))a.destroy(g),a.renderCommands(b,g,null,d,"button");f||(f=!0,c.getService("orion.page.selection").addEventListener("selectionChanged",function(c){var g=h.node(b);
g&&(a.destroy(g),a.renderCommands(b,g,c.selections,d,"button"))}))};d.createOperationsCommands=function(c,a,d){function g(b){return!b.operation||!b.operation.type?!1:b.operation.type==="loadstart"||b.operation.type==="progress"}var b=new e.Command({name:j["Remove Completed"],tooltip:j["Remove all completed operations"],id:"eclipse.removeCompletedOperations",callback:function(){d.removeCompletedOperations().then(function(){a.loadOperations.bind(a)()})},visibleWhen:function(){return!0}});c.addCommand(b);
b=new e.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],c=0;c<b.length;c++){var g=b[c];d.removeOperation.bind(d)(g.Location).then(function(){a.loadOperations.bind(a)()},function(){a.loadOperations.bind(a)()})}},visibleWhen:function(b){if(!Array.isArray(b)||b.length===0)return!g(b);for(var a in b)if(g(b[a]))return!1;return!0}});c.addCommand(b);
b=new e.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 g(b)&&(b.operation&&b.operation.cancelable?!0:!1);for(var a in b)if(!g(b[a])||!b[a].operation||!b[a].operation.cancelable)return!1;return!0}});c.addCommand(b)}})();
return d});
define("orion/webui/dialogs/OperationsDialog",["i18n!orion/operations/nls/messages","require","orion/webui/littlelib","orion/webui/popupdialog","orion/operationsCommands"],function(j,k,h,e,d){function f(c){this._options=c}f.prototype=new e.PopupDialog;f.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>';f.prototype._init=
function(c){this._myOperations=[];this._operationsDeferreds=[];this._commandService=c.commandRegistry;d.createOperationsCommands(this._commandService);this._commandService.registerCommandContribution("operationsDialogItems","eclipse.cancelOperation",1);this._initialize(c.triggerNode)};f.prototype._bindToDom=function(){this.$allOperationsLink.href=k.toUrl("operations/list.html");this._setOperationsVisibility()};f.prototype.setOperations=function(c,a){this._myOperations||this._init(this._options);this._myOperations=
[];this._operationsDeferreds=[];if(c)for(var d in c)this._myOperations.push(c[d]),this._operationsDeferreds.push(a[d]);this._renderOperations()};f.prototype.parseProgressResult=function(c){if(!c)return{};c=c.responseText||c;try{c=JSON.parse(c)}catch(a){}var d={Message:c.Message||c,Severity:c.Severity};if(c.DetailedMessage&&c.DetailedMessage!==d.Message)d.DetailedMessage=c.DetailedMessage;return d};f.prototype._renderOperations=function(){this._renderOperationsTable(this.$myOperationsList,this._myOperations,
this._operationsDeferreds)};f.prototype._renderOperationsTable=function(c,a,d){h.empty(c);for(var g=0;g<a.length;g++){var b=a[g],e=document.createElement("tr"),f=document.createElement("td");f.style.paddingLeft="5px";f.style.paddingRight="5px";f.textContent=b.Name;e.appendChild(f);var m=document.createElement("div");f.appendChild(m);f=document.createElement("span");f.style.paddingRight="5px";f.classList.add("imageSprite");switch(b.type){case "Warning":f.classList.add("core-sprite-warning");f.setAttribute("aria-label",
j["Operation resulted in a warning."]);break;case "error":f.classList.add("core-sprite-error");f.setAttribute("aria-label",j["Operation resulted in an error."]);break;case "loadstart":case "progress":f.classList.add("core-sprite-start");f.setAttribute("aria-label",j["Operation is running."]);break;case "abort":f.classList.add("core-sprite-stop");f.setAttribute("aria-label",j["Operation is canceled."]);break;case "load":case "loadend":f.classList.add("core-sprite-ok"),f.setAttribute("aria-label","Operation ok.")}m.appendChild(f);
f=document.createElement("span");f.classList.add("operationStatus");f.textContent=b.Name;m.appendChild(f);if(b.error){var o=b.error.Message||b.error;b.error.DetailedMessage&&b.error.DetailedMessage!==""&&(o+=": "+b.error.DetailedMessage);f.textContent=o;f.classList.remove("operationStatus");f.classList.add("operationError")}this._commandService.renderCommands("operationsDialogItems",m,{operation:b,deferred:d[g]},this,"tool");c.appendChild(e)}this._setOperationsVisibility()};f.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"};f.prototype.constructor=f;return{OperationsDialog:f}});
define("orion/progress",["i18n!orion/nls/messages","require","orion/Deferred","orion/webui/littlelib","orion/webui/dialogs/OperationsDialog"],function(j,k,h,e,d){function f(a,c){if(!this._progressPane){this._progressPane=e.node(a);this._operationsDialog=new d.OperationsDialog({triggerNode:this._progressPane,commandRegistry:c});var g=this;this._progressPane.addEventListener("keydown",function(b){(b.charOrCode===" "||b.keyCode===e.KEY.ENTER)&&g._operationsDialog.show()})}}function c(a,c,d,b){this._serviceRegistry=
a;this._serviceRegistration=a.registerService("orion.page.progress",this);this._commandRegistry=d;this._operationsClient=c;this._operations={};this._operationDeferrds={};this._operationsIndex=0;this._lastIconClass=this._lastOperation=null;this._progressMonitorClass=b}f.prototype={_switchIconTo:function(a){this._lastIconClass&&this._progressPane.classList.remove(this._lastIconClass);this._lastIconClass=a;this._progressPane.classList.add(this._lastIconClass)},generateOperationsInfo:function(a,c){var d=
{},b;for(b in a)a[b].progressMonitor||(d[b]=a[b]);if(this._isEmpty(d))this._switchIconTo("progressPane_empty"),this._progressPane.title=j.Operations,this._progressPane.alt=j.Operations,this._progressPane.hasAttribute("aria-valuetext")&&this._progressPane.removeAttribute("aria-valuetext");else{var e="";for(b in d){var f=d[b];if(f.type&&(f.type==="loadstart"||f.type==="progress")){e="running";break}}switch(e){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(d,c)},_isEmpty:function(a){for(var c in a)return!1;return!0}};
f.prototype.constructon=f;c.prototype={init:function(a){if(!this._progressMonitorClass)this._progressMonitorTool=new f(a,this._commandRegistry)},progress:function(a,c,d){var b=this,e=this._operationsIndex++;!d&&this._progressMonitorClass&&(d=new this._progressMonitorClass,d.begin(c));a.then(function(){if(b._operations[e]){var f=b._operations[e];if(c)f.Name=c;b._lastOperation=f;f.type="loadend";if(d)f.progressMonitor=d;b.writeOperation.bind(b)(e,f,a);f.Location||b._removeOperationFromTheList.bind(b)(e)}},
function(f){if(b._operations[e]){var h=b._operations[e];if(c)h.Name=c;if(d)h.progressMonitor=d;b._lastOperation=h;h.type=f.canceled?"abort":"error";h.error=f;b.writeOperation.bind(b)(e,h,a);h.Location||b._removeOperationFromTheList.bind(b)(e)}},function(f){if(c)f.Name=c;if(d)f.progressMonitor=d;b.writeOperation.bind(b)(e,f,a)});return a},removeOperation:function(a){for(var c in this._operations)if(this._operations[c].Location&&this._operations[c].Location===a){this._removeOperationFromTheList(c);
break}this._operationsClient.removeOperation.bind(this._operationsClient)(a)},_removeOperationFromTheList:function(a){var c=this._operations[a].progressMonitor;delete this._operations[a];delete this._operationDeferrds[a];c?c.done():this._progressMonitorTool.generateOperationsInfo(this._operations,this._operationDeferrds)},removeCompletedOperations:function(){for(var a in this._operations){var c=this._operations[a];if(c.type&&c.type!=="loadstart"&&c.type!=="progress")(c=this._operations[a].progressMonitor)&&
c.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,c){c&&this._serviceRegistry.getService("orion.page.message").setProgressMessage(c);var d=this;a.then(function(){d._serviceRegistry.getService("orion.page.message").setProgressMessage("")},function(b){d.setProgressResult.bind(d)(b);
return b});return this.progress(a,c)},writeOperation:function(a,c,d){this._operations[a]=c;this._operationDeferrds[a]=d;c.Location&&this._serviceRegistry.getService("orion.core.preference").getPreferences("/operations").then(function(b){b.put(c.Location,{Name:c.Name,expires:c.expires})});c.progressMonitor?c.progressMonitor.progress(c.Name):this._progressMonitorTool.generateOperationsInfo(this._operations,this._operationDeferrds)}};c.prototype.constructor=c;return{ProgressService:c}});
define("orion/operationsClient",["i18n!orion/operations/nls/messages","orion/Deferred"],function(j,k){function h(c,a,d){return c[a].apply(c,d)}function e(c){this._location=c}function d(){var c=new k;c.reject(j["No Matching OperationService for location:"]+this._location);return c}function f(c){this._services=[];this._patterns=[];this._operationListeners=[];this._currentLongpollingIds=[];this._preferenceService=c.getService("orion.core.preference");for(var a=c.getServiceReferences("orion.core.operation"),
d=0;d<a.length;d++){var g=c.getService(a[d]);this._services[d]=g;g=a[d].getProperty("pattern")||".*";g[0]!=="^"&&(g="^"+g);this._patterns[d]=RegExp(g)}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 e(b)}}e.prototype={getOperation:d,getOperations:d,removeCompletedOperations:d,removeOperation:d,cancelOperation:d};e.prototype.constructor=e;f.prototype={getOperations:function(){var c=
new k;if(this._operations)return c.resolve(this._operations),c;var a=this;this._preferenceService.getPreferences("/operations").then(function(d){a._operations=d;c.resolve(a._operations)});return c},getOperation:function(c){return h(this._getService(c),"getOperation",arguments)},removeCompletedOperations:function(){for(var c=[],a=this,d=0;d<this._services.length;d++){var g=this._patterns[d],b=new k;c[d]=b.promise;h(this._services[d],"removeCompletedOperations").then(function(b){return function(c){Array.isArray(c)&&
a.getOperations.bind(a)().then(function(a){for(var d=a.keys(),e=0;e<d.length;e++){var i=d[e];g.test(i)&&c.indexOf(i)<0&&a.remove(i)}b.resolve()})}}(b),function(b){return function(a){b.reject(a)}}(b))}return k.all(c)},removeOperation:function(c){var a=this;return h(this._getService(c),"removeOperation",arguments).then(function(){a.getOperations.bind(a)().then(function(a){a.remove(c)})},function(a){return a},function(a){return a})}};f.prototype.constructor=f;return{OperationsClient:f}});
define("orion/search/nls/root/messages",{"Find:":"Find:","Find With":"Find With","ReplaceWith:":"ReplaceWith:","Replace With":"Replace With","Show all":"Show all","Wrap search":"Wrap search","Incremental search":"Incremental search","Whole Word":"Whole Word","Regular expression":"Regular expression","Find after replace":"Find after replace",Options:"Options","Find next match":"Find next match","Find previous match":"Find previous match",Replace:"Replace","Replace All":"Replace All","Search ${0}":"Search ${0}",
"Type a keyword or wild card to search in ":"Type a keyword or wild card to search in ","Search failed.":"Search failed.","No matches found for ${0}":"No matches found for ${0}","Searching...":"Searching...","Resource has been changed by others.":"Resource has been changed by others.","Failed to write file.":"Failed to write file.",Results:"Results","Files ${0} of ${1} matching ${2}":"Files ${0} of ${1} matching ${2}","Replace ${0} with ${1} for files ${2} of ${3}":"Replace ${0} with ${1} for files ${2} of ${3}",
Location:"Location","Click to compare":"Click to compare",'Search again in this folder with "${0}"':'Search again in this folder with "${0}"',"Files replaced":"Files replaced",Status:"Status","${0} out of ${1}  matches replaced.":"${0} out of ${1}  matches replaced.","Replace all matches with...":"Replace all matches with...","Apply Changes":"Apply Changes","Replace all selected matches":"Replace all selected matches","Hide Compare":"Hide Compare","Hide compare view of changes":"Hide compare view of changes",
"Show Compare":"Show Compare","Show compare view of changes":"Show compare view of changes","Show All":"Show All","Show all the results in one page":"Show all the results in one page","< Previous Page":"< Previous Page","Show previous page of search result":"Show previous page of search result","Next Page >":"Next Page >","Show next page of search result":"Show next page of search result","Next result":"Next result","Previous result":"Previous result","Expand all results":"Expand all results","Collapse all results":"Collapse all results",
"Writing files...":"Writing files...","Preparing preview...":"Preparing preview...","Replaced File (${0})":"Replaced File (${0})","Original File (${0})":"Original File (${0})","Sort by Name":"Sort by Name","Compare changes":"Compare changes","Search Results":"Search Results","Replace All Matches":"Replace All Matches","No matches":"No matches",Rename:"Rename","My Saved Searches":"My Saved Searches","Save frequently used searches by choosing ${0} shown above.":"Save frequently used searches by choosing ${0} shown above.",
"Save frequently used searches by clicking on the ${0} button above.":"Save frequently used searches by clicking on the ${0} button above.","Files that contain:":"Files that contain:",Search:"Search","All types":"All types","File type":"File type","All ${0} files":"All ${0} files","Type a search term":"Type a search term","Type a replace term":"Type a replace term","Case sensitive":"Case sensitive","Sort by":"Sort by","File name":"File name","Path name":"Path name",Save:"Save","Type a name for the search":"Type a name for the search",
"Save the current search":"Save the current search","Type filter text":"Type filter text","Scope Search":"Scope Search","Open in Search page for this directory":"Open in Search page for this directory","${0}. Try your search again.":"${0}. Try your search again.","Click or use delete key to delete the search term":"Click or use delete key to delete the search term","${0} matches":"${0} matches","Regular expression is off. You can click here or use options to turn it on for replacement - e.g. when the option is on you can replace <td([\\s\\S]*?)</td> with <span$1</span>.":"Regular expression is off. You can click here or use options to turn it on for replacement - e.g. when the option is on you can replace <td([\\s\\S]*?)</td> with <span$1</span>.",
"Regular expression is on. You can click here or use options to turn it off - e.g. when the option is on you can replace <td([\\s\\S]*?)</td> with <span$1</span>.":"Regular expression is on. You can click here or use options to turn it off - e.g. when the option is on you can replace <td([\\s\\S]*?)</td> with <span$1</span>."});
define("orion/search/nls/messages",["orion/i18n!orion/search/nls/messages","orion/search/nls/root/messages"],function(j,k){var h={root:k};Object.keys(j).forEach(function(e){typeof h[e]==="undefined"&&(h[e]=j[e])});return h});
define("orion/webui/treetable",["i18n!orion/nls/messages","orion/webui/littlelib"],function(j,k){function h(e){this._init(e)}h.prototype={_init:function(e){var d=e.parent,f=this,d=k.node(d);if(!d)throw j["no parent"];if(!e.model)throw j["no tree model"];if(!e.renderer)throw j["no renderer"];this._parent=d;this._treeModel=e.model;this._renderer=e.renderer;this._showRoot=e.showRoot===void 0?!1:e.showRoot;this._indent=e.indent===void 0?16:e.indent;this._onCollapse=e.onCollapse;this._labelColumnIndex=
e.labelColumnIndex===void 0?0:e.labelColumnIndex;this._id=e.id===void 0?"treetable":e.id;this._tableStyle=e.tableStyle;this._tableElement=e.tableElement||"table";this._tableBodyElement=e.tableBodyElement||"tbody";this._tableRowElement=e.tableRowElement||"tr";this._root=this._treeModel.getRoot(function(c){f._showRoot?(c._depth=0,f._generate([c],0)):f._treeModel.getChildren(c,function(a){f.destroyed||f._generate(a,0)})})},destroy:function(){this.destroyed=!0},_generate:function(e,d){k.empty(this._parent);
var f=document.createElement("div");this._renderer.wrapperCallback&&this._renderer.wrapperCallback(f);var c=document.createElement(this._tableElement);this._renderer.tableCallback&&this._renderer.tableCallback(c);c.id=this._id;this._tableStyle&&c.classList.add(this._tableStyle);this._renderer.initTable(c,this);this._bodyElement=document.createElement(this._tableBodyElement);this._renderer.bodyCallback&&this._renderer.bodyCallback(this._bodyElement);this._bodyElement.id=this._id+"tbody";e.length===
0?this._renderer.emptyCallback&&this._renderer.emptyCallback(this._bodyElement):this._generateChildren(e,d);c.appendChild(this._bodyElement);f.appendChild(c);this._parent.appendChild(f);this._rowsChanged()},_generateChildren:function(e,d,f){for(var c=0;c<e.length;c++){var a=document.createElement(this._tableRowElement);a.id=this._treeModel.getId(e[c]);this._renderer.rowCallback&&this._renderer.rowCallback(a);a._depth=d;a._item=e[c];this._renderer.render(e[c],a);a.childNodes[this._labelColumnIndex].style.paddingLeft=
this._indent*d+"px";f?(this._bodyElement.insertBefore(a,f.nextSibling),f&&(f=a)):this._bodyElement.appendChild(a)}},_rowsChanged:function(){this._renderer.rowsChanged&&this._renderer.rowsChanged()},getSelected:function(){return this._renderer.getSelected()},refresh:function(e,d,f){var c=this._treeModel.getId(e),a;if(c===this._id)this._removeChildRows(c),this._generateChildren(d,0),this._rowsChanged();else{var i=k.node(c);i?(i._item=e,i&&(f||i._expanded)?(this._removeChildRows(c),this._renderer.updateExpandVisuals(i,
!0),d?(i._expanded=!0,this._generateChildren(d,i._depth+1,i),this._rowsChanged()):(a=this,d=this._treeModel.getChildren(i._item,function(c){if(!a.destroyed&&!i._expanded)i._expanded=!0,a._generateChildren(c,i._depth+1,i),a._rowsChanged()}))):this._renderer.updateExpandVisuals(i,!1)):console.log(j["could not find table row "]+c)}},getItem:function(e){var d=k.node(e);return d&&d._item?d._item:e},toggle:function(e){var d=k.node(e);d&&(d._expanded?(this.collapse(e),this._renderer.updateExpandVisuals(d,
!1)):(this.expand(e),this._renderer.updateExpandVisuals(d,!0)))},isExpanded:function(e){e=typeof e==="string"?e:this._treeModel.getId(e);return(e=k.node(e))?e._expanded:!1},expand:function(e,d,f){var e=typeof e==="string"?e:this._treeModel.getId(e),c=k.node(e);if(c&&!c._expanded){var a=this;this._renderer.updateExpandVisuals(c,!0);this._treeModel.getChildren(c._item,function(e){if(!a.destroyed){if(!c._expanded)c._expanded=!0,a._generateChildren(e,c._depth+1,c),a._rowsChanged();d&&d.apply(a,f)}})}},
_removeChildRows:function(e){for(var d=e===this._id,f=!1,c=-1,a=[],i=k.$$array(".treeTableRow",this._parent),g=0;g<i.length;g++){var b=i[g];if(f)break;if(d)b._depth>c?a.push(b):f=!0;else if(b.id===e)d=!0,c=b._depth}for(e=0;e<a.length;e++)d=a[e],d.parentNode.removeChild(d)},collapse:function(e){var e=typeof e==="string"?e:this._treeModel.getId(e),d=k.node(e);if(d){if(!d._expanded)return;d._expanded=!1;this._renderer.updateExpandVisuals(d,!1);this._removeChildRows(e);this._rowsChanged()}this._onCollapse&&
this._onCollapse(d._item)}};h.prototype.constructor=h;return{TableTree:h}});
define("orion/treeModelIterator",[],function(){var j={};j.TreeModelIterator=function(){function j(h,e){this.firstLevelChildren=h;this.reset();this._init(e)}j.prototype={_init:function(h){if(h)this.isExpanded=h.isExpanded,this.isExpandable=h.isExpandable,this.forceExpandFunc=h.forceExpandFunc,this.getChildrenFunc=h.getChildrenFunc},topLevel:function(h){return h.parent?h.parent===this.root:!0},_getChildren:function(h){return typeof this.getChildrenFunc==="function"?this.getChildrenFunc(h):h?h.children:
null},_expanded:function(h){if(!h)return!0;var e=this._getChildren(h),e=e&&e.length>0;this.isExpanded&&e&&(e=this.isExpanded(h));return e},_expandable:function(h){return!h?!0:this.isExpandable?this.isExpandable(h):!1},_diveIn:function(h){return this._expanded(h)?(this.setCursor(this._getChildren(h)[0]),this.cursor()):null},_drillToLast:function(h){return this._expanded(h)?(h=this._getChildren(h),this._drillToLast(h[h.length-1])):h},_forward:function(h){if(!this._cursor)return null;var e=this._diveIn(this._cursor);
if(!e){if(h&&this._expandable(this._cursor)&&this.forceExpandFunc){var d=this;return this.forceExpandFunc(this._cursor,"first",function(e){e&&d.setCursor(e)})}(e=this._findSibling(this._cursor,!0))&&this.setCursor(e)}return e},_backward:function(h){if(!this._cursor)return null;var e=this._findSibling(this._cursor,!1);e&&e!==this._cursor.parent&&(e=this._drillToLast(e));if(h&&e&&this._expandable(e)&&this.forceExpandFunc&&e!==this._cursor.parent){var d=this;return this.forceExpandFunc(e,"last",function(e){e&&
d.setCursor(e)})}e&&this.setCursor(e);return e},_findSibling:function(h,e){for(var d=this.topLevel(h),f=this._getChildren(h.parent),f=d?this.firstLevelChildren:f,c=0;c<f.length;c++)if(f[c]===h)return c===0&&!e?d?null:h.parent:c===f.length-1&&e?d?null:this._findSibling(h.parent,e):e?f[c+1]:f[c-1];return null},_inParentChain:function(h,e){for(var d=h.parent;d;){if(d===e)return!0;d=d.parent}return!1},_getTopLevelParent:function(h){if(this.topLevel(h))return h;for(h=h.parent;h;){if(this.topLevel(h))return h;
h=h.parent}return null},_onCollapse:function(h){return this._expanded(h.parent)?h:this._onCollapse(h.parent)},_scan:function(h,e,d){this.setCursor(e);var f=[];for(f.push(e);;){if(this.iterate(h))f.push(this.cursor());else break;if(d===this.cursor())return f}return null},setCursor:function(h){this._prevCursor=this._cursor;this._cursor=h},setTree:function(h){this.firstLevelChildren=h;if(this.firstLevelChildren.length>0)this.root=this.firstLevelChildren[0].parent},scan:function(h,e){var d=this.cursor(),
f=this._scan(!0,h,e);f||(f=this._scan(!1,h,e));this.setCursor(d);return f},iterate:function(h,e){return h?this._forward(e):this._backward(e)},iterateOnTop:function(h,e){var d=this._findSibling(this._getTopLevelParent(this.cursor()),h);d?this.setCursor(d):e&&this.firstLevelChildren.length>0&&this.setCursor(h?this.firstLevelChildren[0]:this.firstLevelChildren[this.firstLevelChildren.length-1])},collapse:function(h){if(!this._cursor)return null;return this._inParentChain(this._cursor,h)?(this.setCursor(h),
this._cursor):null},reset:function(){this.root=this._prevCursor=this._cursor=null;if(this.firstLevelChildren.length>0)this._cursor=this.firstLevelChildren[0],this.root=this.firstLevelChildren[0].parent},cursorMoved:function(){return this._cursor!==this._prevCursor},cursor:function(){return this._cursor},prevCursor:function(){return this._prevCursor}};return j}();return j});
define("orion/explorers/explorerNavHandler",["i18n!orion/nls/messages","orion/webui/littlelib","orion/treeModelIterator","orion/uiUtils"],function(j,k,h,e){var j={},d=navigator.userAgent.indexOf("iPad")!==-1,f=window.navigator.platform.indexOf("Mac")!==-1;j.ExplorerNavHandler=function(){function c(a,c,d){this.explorer=a;this.model=this.explorer.model;this._navDict=c;this._listeners=[];this._selections=[];this._currentColumn=0;a=this._getEventListeningDiv();a.tabIndex=0;a.classList.add("selectionModelContainer");
var b=this;this._modelIterator=new h.TreeModelIterator([],{isExpanded:this.isExpanded.bind(this),getChildrenFunc:d.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,d){return b.explorer.forceExpandFunc(a,c,d)}:void 0});this._init(d);(!d||d.setFocus!==!1)&&a.focus();d=function(a){if(e.isFormElement(a.target))return!0;if(b.explorer.preventDefaultFunc&&
b.explorer.preventDefaultFunc(a,b._modelIterator.cursor()))return!0;if(a.keyCode===k.KEY.DOWN)return b.onDownArrow(a);else if(a.keyCode===k.KEY.UP)return b.onUpArrow(a);else if(a.keyCode===k.KEY.RIGHT)return b.onRightArrow(a);else if(a.keyCode===k.KEY.LEFT)return b.onLeftArrow(a);else if(a.keyCode===k.KEY.SPACE)return b.onSpace(a);else if(a.keyCode===k.KEY.ENTER)return b.onEnter(a)};a.addEventListener("keydown",d,!1);this._listeners.push({type:"keydown",listener:d});d=function(){if(b.explorer.onFocus)b.explorer.onFocus(!1);
else b.toggleCursor(null,!1)};a.addEventListener("blur",d,!1);this._listeners.push({type:"blur",listener:d});d=function(){if(b.explorer.onFocus)b.explorer.onFocus(!0);else b.toggleCursor(null,!0)};a.addEventListener("focus",d,!1);this._listeners.push({type:"focus",listener:d});this._parentDiv=a}c.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 f?a.metaKey:a.ctrlKey},removeListeners:function(){if(this._listeners)for(var a=0;a<this._listeners.length;a++)this._parentDiv.removeEventListener(this._listeners[a].type,this._listeners[a].listener,!1)},focus:function(){var a=this._getEventListeningDiv();a&&a.focus()},_getEventListeningDiv:function(a){return this.explorer.keyEventListeningDiv&&typeof this.explorer.keyEventListeningDiv===
"function"?this.explorer.keyEventListeningDiv(a):k.node(this.explorer._parentId)},isExpandable:function(a){return!a?!1:k.node(this.explorer.renderer.expandCollapseImageId(this.model.getId(a)))?!0:!1},isExpanded:function(a){return!a?!1:this.explorer.myTree.isExpanded(this.model.getId(a))},refreshSelection:function(a){var c=this;this.explorer.selection&&this.explorer.selection.getSelections(function(d){c._clearSelection();for(var b=0;b<d.length;b++)c._selections.push(d[b]);c._selections.length>0?c.cursorOn(c._selections[0],
!0,!1,a):c.cursorOn();if(!(c._shiftSelectionAnchor&&c._inSelection(c._shiftSelectionAnchor)>=0))c._shiftSelectionAnchor=null})},refreshModel:function(a,c,d,b){this._currentColumn=0;this.topIterationNodes=[];this.model=c;this._navDict=a;if(this.model.getTopIterationNodes)this.topIterationNodes=this.model.getTopIterationNodes();else if(d)this.topIterationNodes=d;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),c=0;c<this._selections.length;c++)if(a===this.model.getId(this._selections[c]))return c;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,c,d){if(this._selectionPolicy==="cursorOnly")c&&this.explorer.renderer._useCheckboxSelection&&this._checkRow(a,!0);else if(this._isRowSelectable(a)){!c||this._selectionPolicy==="singleSelection"?(this._clearSelection(!0),this._checkRow(a,!1),this._selections.push(a),this._lastSelection=a):(c=this._inSelection(a),c>=0?(this._checkRow(a,!0),this._selections.splice(c,1)):(this._checkRow(a,
!1),this._selections.push(a),this._lastSelection=a));if(d)this._shiftSelectionAnchor=this._lastSelection;this.explorer.selection&&(this.explorer.renderer.storeSelections(),this.explorer.selection.setSelections(this._selections))}},moveColumn:function(a,c){a||(a=this.currentModel());var d=this._getGridChildren(a);if(d&&d.length>1||c===0&&d){c!==0&&this.toggleCursor(a,!1);var b=this._currentColumn,e=!0;b+=c;b<0?(this._linearGridMove&&c!==0&&(this._modelIterator.iterate(!1)?a=this.currentModel():e=!1),
b=e?d.length-1:this._currentColumn):b>=d.length&&(this._linearGridMove&&c!==0&&(this._modelIterator.iterate(!0)?a=this.currentModel():e=!1),b=e?0:this._currentColumn);this._currentColumn=b;c!==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 c=
this._parentDiv,d;a&&a!==c&&(d=a.getAttribute("role"))!=="grid"&&d!=="tree"&&d!=="treegrid";)a=a.parentNode;return a===c?null:a},toggleCursor:function(a,c){var d=this.getRowDiv(a),b=this.getCurrentGrid(a);b?(d&&(c?d.classList.add("treeIterationCursorRow"):d.classList.remove("treeIterationCursorRow")),b.domNode&&(d=this.getAriaContainerElement(b.domNode),c?(b.domNode.classList.add("treeIterationCursor"),d&&d.setAttribute("aria-activedescendant",b.domNode.id)):b.domNode.classList.remove("treeIterationCursor"))):
d&&(c?d.classList.add("treeIterationCursorRow_Dotted"):d.classList.remove("treeIterationCursorRow_Dotted"))},currentModel:function(){return this._modelIterator.cursor()},cursorOn:function(a,c,d,b){var e,f;if(a||c){if(f===this._modelIterator.cursor())return;e=this._modelIterator.cursor();f=a;this._modelIterator.setCursor(f)}else e=this._modelIterator.prevCursor(),f=this._modelIterator.cursor();if(e!==f||c)if(this.toggleCursor(e,!1),!c||f){this.moveColumn(null,0);this.toggleCursor(f,!0);if((a=this.getRowDiv())&&
!b){for(b=a.parentNode;b;){c=window.getComputedStyle(b,null);if(!c)break;c=c.getPropertyValue("overflow-y");if(c==="hidden"||c==="auto"||c==="scroll")break;b=b.parentNode}if(!b)b=document.body;c=!0;a.offsetTop<=b.scrollTop?(c=!1,d===void 0&&(d=!1)):a.offsetTop+a.offsetHeight>=b.scrollTop+b.clientHeight&&(c=!1,d===void 0&&(d=!0));c||a.scrollIntoView(!d)}if(this.explorer.onCursorChanged)this.explorer.onCursorChanged(e,f)}},getSelection:function(){return this._selections},getSelectionIds:function(){for(var a=
[],c=0;c<this._selections.length;c++)a.push(this.model.getId(this._selections[c]));return a},getRowDiv:function(a){a=a?a:this._modelIterator.cursor();if(!a)return null;var a=this.model.getId(a),c=this._navDict.getValue(a);return c&&c.rowDomNode?c.rowDomNode:k.node(a)},iterate:function(a,c,d){this.topIterationNodes.length!==0&&this._modelIterator.iterate(a,c)&&(this.cursorOn(null,!1,a),d&&(a=this._inSelection(this._modelIterator.prevCursor()),c=this._inSelection(this._modelIterator.cursor()),a>=0&&
c>=0?this.setSelection(this._modelIterator.prevCursor(),!0):this.setSelection(this.currentModel(),!0)))},_checkRow:function(a,c){if(this.explorer.renderer._useCheckboxSelection){var d=this.getRowDiv(a);if(d){var b=k.node(this.explorer.renderer.getCheckBoxId(d.id)),e=c?!b.checked:!0;if(e!==b.checked)this.explorer.renderer.onCheck(d,b,e,!0)}}else this._select(a,c)},_select:function(a){a||(a=this._modelIterator.cursor());var c=this.getRowDiv(a);c&&(this._inSelection(a)<0?c.classList.add("checkedRow"):
c.classList.remove("checkedRow"))},_onModelGrid:function(a,c){var d=this._getGridChildren(a);if(d)for(var b=0;b<d.length;b++)if(c.target===d[b].domNode)return!0;return!1},onClick:function(a,c){var g=k.node(this.explorer.renderer.expandCollapseImageId(this.model.getId(a)));if(c.target!==g&&!(this.gridClickSelectionPolicy==="none"&&this._onModelGrid(a,c)))if(this.cursorOn(a,!0,!1,!0),d)this.setSelection(a,!0);else if(this._ctrlKeyOn(c))this.setSelection(a,!0,!0);else if(c.shiftKey&&this._shiftSelectionAnchor){if(g=
this._modelIterator.scan(this._shiftSelectionAnchor,a)){this._clearSelection(!0);for(var b=0;b<g.length;b++)this.setSelection(g[b],!0)}}else this.setSelection(a,!1,!0)},onCollapse:function(a){this._modelIterator.collapse(a)&&this.cursorOn()},onUpArrow:function(a){this.iterate(!1,!1,a.shiftKey);!this._ctrlKeyOn(a)&&!a.shiftKey&&this.setSelection(this.currentModel(),!1,!0);a.preventDefault();return!1},onDownArrow:function(a){this.iterate(!0,!1,a.shiftKey);!this._ctrlKeyOn(a)&&!a.shiftKey&&this.setSelection(this.currentModel(),
!1,!0);a.preventDefault();return!1},_shouldMoveColumn:function(a){var c=this.currentModel(),d=this._getGridChildren(c);return d&&d.length>1?this.isExpandable(c)?this._ctrlKeyOn(a):!0:!1},onLeftArrow:function(a){if(this._shouldMoveColumn(a))return this.moveColumn(null,-1),a.preventDefault(),!0;var c=this._modelIterator.cursor();if(!c)return!1;if(this.isExpandable(c)&&this.isExpanded(c))return this.explorer.myTree.collapse(c),a.preventDefault(),!0;this._modelIterator.topLevel(c)?this.explorer.scopeUp&&
typeof this.explorer.scopeUp==="function"&&this.explorer.scopeUp():(this.cursorOn(c.parent),this.setSelection(c.parent,!1,!0))},onRightArrow:function(a){if(this._shouldMoveColumn(a))return this.moveColumn(null,1),a.preventDefault(),!0;var c=this._modelIterator.cursor();if(!c)return!1;if(this.isExpandable(c)&&!this.isExpanded(c))return this.explorer.myTree.expand(c),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 c=this.getCurrentGrid(this._modelIterator.cursor());if(c)if(c.widget)if(typeof c.onClick==="function")c.onClick();else typeof c.widget.focus==="function"&&c.widget.focus();else{var d=document.createEvent("MouseEvents");d.initMouseEvent("click",!0,!0,window,0,0,0,0,0,this._ctrlKeyOn(a),!1,!1,!1,0,null);c.domNode.dispatchEvent(d)}else if(this.explorer.renderer.getRowActionElement&&(c=this._modelIterator.cursor()))if(c=this.explorer.renderer.getRowActionElement(this.model.getId(c)),
c.href)this._ctrlKeyOn(a)?window.open(c.href):window.location.href=c.href}};return c}();j.ExplorerNavDict=function(){function c(a){this._dict={};this._model=a}c.prototype={addRow:function(a,c){this._dict[this._model.getId(a)]={model:a,rowDomNode:c}},getValue:function(a){return this._dict[a]},getGridNavHolder:function(a,c){if(!a)return null;var d=this._model.getId(a);if(this._dict[d]){if(!this._dict[d].gridChildren&&c)this._dict[d].gridChildren=[];return this._dict[d].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 c}();return j});
define("orion/explorers/explorer","i18n!orion/nls/messages,require,orion/webui/littlelib,orion/webui/treetable,orion/explorers/explorerNavHandler,orion/commands,orion/commandRegistry".split(","),function(j,k,h,e,d,f){var c={};c.Explorer=function(){function a(a,c,b,d){this.registry=a;this.renderer=b;this.selection=c;this.commandService=d;this.myTree=null}a.prototype={destroy:function(){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){a=this.getRow(a);if(b)return a=a.childNodes[b],a.appendChild(document.createElement("br")),b=document.createElement("span"),b.id=c+"placeHolderRow",a.appendChild(b),{tempNode:b,refNode:b};if(a){b=document.createElement("tr");b.id=c+"placeHolderRow";var d=document.createElement("td");d.id=c+"placeHolderCol";
b.appendChild(d);a.appendChild(b);b=h.node(c+"placeHolderRow");a=h.node(c+"placeHolderCol");if(b&&a)return{tempNode:b,refNode:a}}return null},getRow:function(a){if(a=this.model.getId(a))return h.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(b){if(!(b===void 0||b===null))for(var a=b.length,d=0;d<a;d++)c._expandRecursively(b[d])})})}},createTree:function(a,c,b){a=typeof a==="string"?a:a.id||a;this.selection&&this.selection.setSelections([]);this.getNavHandler()&&this.getNavHandler()._clearSelection();var f=a+"innerTree",n=h.node(f);n&&h.empty(n);if(c)c.rootId=f;this.model=c;this._parentId=a;this._treeOptions=b;if(!b||b&&!b.noSelection)this.selectionPolicy=
b?b.selectionPolicy:"",this._navDict=new d.ExplorerNavDict(this.model);this.myTree=new e.TableTree({id:f,model:c,parent:a,labelColumnIndex:this.renderer.getLabelColumnIndex(),renderer:this.renderer,showRoot:b?!!b.showRoot:!1,indent:b?b.indent:void 0,onCollapse:b?b.onCollapse:void 0,navHandlerFactory:b?b.navHandlerFactory:void 0,tableElement:b?b.tableElement:void 0,tableBodyElement:b?b.tableBodyElement:void 0,tableRowElement:b?b.tableRowElement:void 0});this.renderer._initializeUIState();this.selectionPolicy===
"cursorOnly"&&this.initNavHandler()},getNavHandler:function(){return this._navHandler},getNavDict:function(){return this._navDict},refreshSelection:function(){if(this.selection){var a=this.getNavHandler(),c=[];if(a&&this.getNavDict())for(var b=a.getSelection(),d=0;d<b.length;d++){var e=a.getRowDiv(b[d]);e&&e.parentNode&&(e=this.getNavDict().getValue(this.model.getId(b[d])),e.model&&c.push(e.model))}this.selection.setSelections(c)}},getRootPath:function(){return this.model&&this.model.root?this.model.root.Location:
null},initNavHandler:function(){var a=this._treeOptions;if(!a||a&&!a.noSelection){if(!this.getNavHandler())this._navHandler=a&&a.navHandlerFactory&&typeof a.navHandlerFactory.createNavHandler==="function"?a.navHandlerFactory.createNavHandler(this,this._navDict,a):new d.ExplorerNavHandler(this,this._navDict,{getChildrenFunc:a?a.getChildrenFunc:null,setFocus:a&&a.setFocus,selectionPolicy:a?a.selectionPolicy:null});var c=this;this.model.getRoot(function(b){b instanceof Array?c.getNavHandler().refreshModel(c.getNavDict(),
c.model,b):b.children&&b.children instanceof Array&&c.getNavHandler().refreshModel(c.getNavDict(),c.model,b.children);a&&a.setFocus&&c.getNavHandler().cursorOn(null,!1,!1,!0)})}},_lastHash:null,checkbox:!1};return a}();c.createExplorerCommands=function(a,c){function d(b){return typeof b.getItemCount==="function"?b.getItemCount()>0?c?c(b):!0:!1:!1}var b=new f.Command({tooltip:j["Expand all"],imageClass:"core-sprite-expandAll",id:"orion.explorer.expandAll",groupId:"orion.explorerGroup",visibleWhen:function(b){return d(b)},
callback:function(b){b.items.expandAll()}}),e=new f.Command({tooltip:j["Collapse all"],imageClass:"core-sprite-collapseAll",id:"orion.explorer.collapseAll",groupId:"orion.explorerGroup",visibleWhen:function(b){return d(b)},callback:function(b){b.items.collapseAll()}});a.addCommand(b);a.addCommand(e)};c.ExplorerModel=function(){function a(a,c,b){this.rootPath=a;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}();c.ExplorerFlatModel=function(){function a(a,c,b){this.rootPath=a;this.fetchItems=c;this.root=b}a.prototype=new c.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}();c.ExplorerRenderer=function(){function a(a,c){this.explorer=c;this._init(a);this._expandImageClass="core-sprite-openarrow";this._collapseImageClass="core-sprite-closedarrow";this._twistieSpriteClass="modelDecorationSprite"}a.prototype={_init:function(a){if(a){this._useCheckboxSelection=
a.checkbox===void 0?!1:a.checkbox;this.selectionPolicy=a.singleSelection?"singleSelection":"";this._cachePrefix=a.cachePrefix;this.getCheckedFunc=a.getCheckedFunc;this.onCheckedFunc=a.onCheckedFunc;this._highlightSelection=!0;this._treeTableClass=a.treeTableClass||"treetable";if(a.highlightSelection===!1)this._highlightSelection=!1;if(!this.actionScopeId)this.actionScopeId=a.actionScopeId;if(!this.commandService)this.commandService=a.commandService}},getLabelColumnIndex:function(){return this.explorer.checkbox?
1:0},initTable:function(a,c){this.tableTree=c;h.empty(a);this._treeTableClass&&a.classList.add(this._treeTableClass);this.renderTableHeader(a)},getActionsColumn:function(a,c,b,d,e){var b=b||"tool",f=document.createElement("td");f.id=c.id+"actionswrapper";d&&f.classList.add(d);this.actionScopeId&&this.commandService?this.commandService.renderCommands(this.actionScopeId,f,a,this.explorer,b,null,e&&this.explorer.getNavDict()?this.explorer.getNavDict().getGridNavHolder(a,!0):null):window.console.log("Warning, no command service or action scope was specified.  No commands rendered.");
return f},initCheckboxColumn:function(){if(this._useCheckboxSelection)return document.createElement("th")},getCheckboxColumn:function(a,c){if(this._useCheckboxSelection){var b=document.createElement("td"),d=document.createElement("span");d.id=this.getCheckBoxId(c.id);d.classList.add("core-sprite-check");d.classList.add("selectionCheckmarkSprite");d.rowId=c.id;if(this.getCheckedFunc)d.checked=this.getCheckedFunc(a),d.checked?(this._highlightSelection&&c.classList.add("checkedRow"),d.classList.add("core-sprite-check_on")):
(this._highlightSelection&&c.classList.remove("checkedRow"),d.classList.remove("core-sprite-check_on"));b.appendChild(d);var e=this;d.addEventListener("click",function(b){e.onCheck(c,b.target,b.target.checked?!1:!0,!0)},!1);return b}},getCheckBoxId:function(a){return a+"selectedState"},onCheck:function(a,c,b,d,e){(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,d);this.explorer.getNavHandler()&&e&&this.explorer.getNavHandler().setSelection(this.explorer.getNavDict().getValue(a.id).model,
!0)},storeSelections:function(){if(this.explorer.getNavHandler()){var a=this.explorer.getNavHandler().getSelectionIds(),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 d=[],b=0;b<
a.length;b++){var e=c.getValue(a[b]);if(e&&e.rowDomNode&&e.model&&(d.push(e.model),this._highlightSelection&&e.rowDomNode.classList.add("checkedRow"),e=h.node(this.getCheckBoxId(e.rowDomNode.id))))e.checked=!0,e.classList.add("core-sprite-check_on")}this.explorer.selection&&(this.explorer.selection.setSelections(d),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 d;if(b)for(d=0;d<b.length;d++)if(h.node(b[d])){this._expanded.push(b[d]);var e=this;this.tableTree.expand(b[d],function(){e._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=h.node(this.expandCollapseImageId(a.id));b&&(b.classList.add(c?this._expandImageClass:this._collapseImageClass),b.classList.remove(c?this._collapseImageClass:this._expandImageClass))},getExpandImage:function(a,c,b,d){var e=document.createElement("span");e.id=this.expandCollapseImageId(a.id);c.appendChild(e);e.classList.add(this._twistieSpriteClass);e.classList.add(this._collapseImageClass);if(b){var f=document.createElement("span");c.appendChild(f);
f.classList.add(d||"imageSprite");f.classList.add(b)}var h=this;e.onclick=function(){h.tableTree.toggle(a.id);if(h.tableTree.isExpanded(a.id))h._expanded.push(a.id);else for(var b in h._expanded)if(h._expanded[b]===a.id){h._expanded.splice(b,1);break}(b=h._getUIStatePreferencePath())&&window.sessionStorage&&h._storeExpansions(b)};return e},render:function(a,c){c.classList.add("navRow");this.renderRow(a,c)},rowsChanged:function(){this.explorer.selectionPolicy!=="cursorOnly"&&(this.explorer.refreshSelection(),
this.explorer.initNavHandler())},updateCommands:function(){if(this.commandService)for(var a=h.$$array(".treeTableRow"),c=0;c<a.length;c++){var b=a[c],d=h.node(b.id+"actionswrapper");this.commandService.destroy(d);this.actionScopeId&&this.commandService.renderCommands(this.actionScopeId,d,b._item,this.explorer,"tool")}},_initializeUIState:function(){this._expanded=[];var a=this._getUIStatePreferencePath();a&&window.sessionStorage&&this._restoreExpansions(a)&&this._restoreSelections(a)}};return a}();
c.SelectionRenderer=function(){function a(a,c){this._init(a);this.explorer=c}a.prototype=new c.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 d=0,e=this.getCellHeaderElement(d);e;)e.innerHTML.length>0&&e.classList.add("navColumn"),b.appendChild(e),e=this.getCellHeaderElement(++d);c.appendChild(b);d>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 d=this;c.addEventListener("click",function(b){if(d.explorer.getNavHandler())d.explorer.getNavHandler().onClick(a,b)},!1)}if(b=this.getCheckboxColumn(a,c))b.classList.add("checkColumn"),c.appendChild(b);for(var b=0,e=this.getCellElement(b,a,c);e;)c.appendChild(e),b===0?this.getPrimColumnStyle?e.classList.add(this.getPrimColumnStyle()):e.classList.add("navColumn"):
this.getSecondaryColumnStyle?e.classList.add(this.getSecondaryColumnStyle()):e.classList.add("secondaryColumn"),e=this.getCellElement(++b,a,c)};a.prototype.getCellHeaderElement=function(){};a.prototype.getCellElement=function(){};return a}();c.SimpleFlatModel=function(){function a(a,c,b){this.items=a;this.getKey=b;this.idPrefix=c;this.root={children:a}}a.prototype=new c.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 c});
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,h,e,d,f,c,a){function i(a,e,g,i,h,j,s,v,w){var e=f.clone(e),u;if(e.Directory)u=document.createElement("a"),u.className="navlinkonpage",u.href=!a?b:(new c(a+"#{,resource,params*}")).expand({resource:e.ChildrenLocation}),e.Name&&u.appendChild(document.createTextNode(e.Name));
else{h||(h=d.getOpenWithCommands(g));if(!j)for(a=0;a<h.length;a++)h[a].isEditor==="default"&&(j=h[a]);u=document.createElement("a");u.className="navlink targetSelector";s&&typeof s==="object"&&Object.keys(s).forEach(function(b){u[b]=s[b]});var p=null,q=null;if(p=w?w.holderDom:u)q=document.createElement("span"),q.className="core-sprite-file modelDecorationSprite",p.appendChild(q);e.Name&&u.appendChild(document.createTextNode(e.Name));var x=!1,A=e.Location;if(v&&typeof v==="object")e.params={},f.mixin(e.params,
v);for(a=0;a<h.length;a++)if(v=h[a],v.visibleWhen(e)){A=v.hrefCallback({items:e});x=!0;break}k.when(i.getFileContentType(e),function(b){var a;if(a=!x)if(a=j){a:{switch(b&&b.id){case "image/jpeg":case "image/png":case "image/gif":case "image/ico":case "image/tiff":case "image/svg":a=!0;break a}a=!1}a=!a}a&&(A=j.hrefCallback({items:e}));if(p){a=p;var c=e.Location,d=q,g;switch(b&&b.id){case "image/jpeg":case "image/png":case "image/gif":case "image/ico":case "image/tiff":case "image/svg":g=document.createElement("img");
g.src=c;g.classList.add("thumbnail");break;default:if(b&&b.image)g=document.createElement("img"),g.src=b.image,g.classList.add("thumbnail")}g&&a.replaceChild(g,d)}u.href=A})}return u}function g(b,a,c,d){this.explorer=a;this.commandService=c;this.contentTypeService=d;this.openWithCommands=null;this.actionScopeId=b.actionScopeId;this._init(b);this.target="_self"}var b=new c("#{,resource,params*}");g.prototype=new h.SelectionRenderer;g.prototype.wrapperCallback=function(b){b.setAttribute("role","tree")};
g.prototype.tableCallback=function(b){b.setAttribute("aria-label",j.Navigator);b.setAttribute("role","presentation")};g.prototype.rowCallback=function(b){b.setAttribute("role","treeitem")};g.prototype.emptyCallback=function(b){var c=document.createElement("tr"),d=document.createElement("td");d.colSpan=this.oneColumn?1:3;var e=document.createElement("div");e.classList.add("noFile");e.textContent=j.NoFile;var g=document.createElement("span");g.classList.add("core-sprite-addcontent");g.classList.add("icon-inline");
g.classList.add("imageSprite");a.processDOMNodes(e,[g]);d.appendChild(e);c.appendChild(d);b.appendChild(c)};g.prototype.getCellHeaderElement=function(b){if(this.oneColumn&&b!==0)return null;switch(b){case 0:case 1:case 2:document.createElement("th").style.height="8px"}};g.prototype.setTarget=function(b){this.target=b};g.prototype.getFolderImage=function(){if(!this.showFolderImage)return null;var b=document.createElement("span");b.className="core-sprite-folder modelDecorationSprite";return b};g.prototype.createFolderNode=
function(b){var a;this.showFolderLinks?(a=i(this.folderLink||"",b,this.commandService,this.contentTypeService),(b=this.getFolderImage(b))&&a.insertBefore(b,a.firstChild)):(a=document.createElement("span"),a.textContent=b.Name);return a};g.prototype.showFolderLinks=!0;g.prototype.getCellElement=function(b,a,c){switch(b){case 0:var b=document.createElement("td"),g=document.createElement("span");g.id=c.id+"MainCol";g.setAttribute("role","presentation");b.appendChild(g);b.setAttribute("role","presentation");
g.className="mainNavColumn";var f;if(a.Directory)this.getExpandImage(c,g),f=this.createFolderNode(a),g.appendChild(f),this.explorer._makeDropTarget(a,f),this.explorer._makeDropTarget(a,c);else{if(!this.openWithCommands){this.openWithCommands=d.getOpenWithCommands(this.commandService);for(f=0;f<this.openWithCommands.length;f++)if(this.openWithCommands[f].isEditor==="default")this.defaultEditor=this.openWithCommands[f]}f=i("",a,this.commandService,this.contentTypeService,this.openWithCommands,this.defaultEditor,
{target:this.target});g.appendChild(f)}if(f)f.id=c.id+"NameLink",f.nodeType===1&&(e.addNavGrid(this.explorer.getNavDict(),a,f),f.setAttribute("role","link"),f.setAttribute("tabindex","-1"));this.actionScopeId&&this.commandService.renderCommands(this.actionScopeId,g,a,this.explorer,"tool",null,!0);return b;case 1:if(this.oneColumn)return null;c=document.createElement("td");if(a.LocalTimeStamp)c.textContent=(new Date(a.LocalTimeStamp)).toLocaleString();return c;case 2:if(this.oneColumn)return null;
c=document.createElement("td");if(!a.Directory&&typeof a.Length==="number")a=parseInt(a.Length,10)/1024,c.textContent=Math.ceil(a).toLocaleString()+" KB";c.style.textAlign="right";return c}};g.prototype.constructor=g;return{NavigatorRenderer:g,createLink:i}});
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,h,e,d,f,c,a,i){function g(b,a){this.serviceRegistry=b;this.commandRegistry=a;this.openWithCommands=null}function b(b){this.registry=b.serviceRegistry;this._commandService=b.commandService;this._fileService=b.fileService;this.defaultRenderer=new g(this.registry,
this._commandService);this._fileService||console.error("No file service on search client")}g.prototype.makeRenderFunction=function(b,g,f,o,t){var r=this.serviceRegistry,s=this.commandRegistry;this.openWithCommands=this.openWithCommands||a.createOpenWithCommands(r,b,s);var v=this;return function(a,r,p,q){i.when(v.openWithCommands,function(x){if(p)h.empty(g),x=document.createElement("div"),x.appendChild(document.createTextNode(j["Search failed."])),g.appendChild(x),typeof o==="function"&&o(g);else{var i=
function(){function b(a,c){var d=c.folderName?c.folderName:c.path,e=document.createElement("span");e.id=d.replace(/[^a-zA-Z0-9_\.:\-]/g,"");e.appendChild(document.createTextNode(" - "+d+" "));a.appendChild(e)}var a={};return function(c,d){var e=d.name;if(a.hasOwnProperty(e)){b(c,d);var g=a[e];typeof g==="function"&&(a[e]=null,g())}else a[e]=function(){b(c,d)}}}(),E=!1;h.empty(g);if(a&&a.length>0){var K=document.createElement("table");K.setAttribute("role","presentation");for(var H=0;H<a.length;H++){var y=
a[H],z;if(!E&&(E=!0,f))z=K.insertRow(0).insertCell(0),z.textContent=f;z=K.insertRow(-1).insertCell(0);z.colspan=2;t&&t(z);var B={Name:y.name,Directory:y.directory,Location:y.path||y.location},v=null;if(typeof y.LineNumber==="number")v={},v.line=y.LineNumber;if(q&&q.keyword&&!q.nameSearch){var F=d.generateSearchHelper(q),v=v||{};v.find=F.inFileQuery.searchStr;v.regEx=F.inFileQuery.wildCard?!0:void 0}B=c.createLink(k.toUrl("edit/edit.html"),B,s,b,x,null,{"aria-describedby":(y.folderName?y.folderName:
y.path).replace(/[^a-zA-Z0-9_\.:\-]/g,""),style:{verticalAlign:"middle"}},v);y.LineNumber&&B.appendChild(document.createTextNode(" (Line "+y.LineNumber+")"));z.appendChild(B);i(z,y)}g.appendChild(K);typeof o==="function"&&o(g)}!E&&r&&(x=e.formatMessage(j["No matches found for ${0}"],r),h.empty(g),g.appendChild(document.createTextNode(x)),typeof o==="function"&&o(g))}})}};b.prototype={search:function(b,a,c){var e=function(b){for(var a=[],c=0;c<b.response.docs.length;c++){var e=b.response.docs[c];a.push({name:e.Name,
path:e.Location,folderName:d.path2FolderName(e.Path?e.Path:e.Location,e.Name),directory:e.Directory,lineNumber:e.LineNumber})}return a};if(this._crawler&&b.nameSearch)this._crawler.searchName(b,function(a){c(e(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 d=b.keyword,d=d.substring(d.indexOf("}")+1),d=d.substring(d.indexOf(":")+1);c(e(a),d,null,b)},function(b){c(null,null,b,null)})}catch(g){typeof g===
"string"&&g.indexOf("search")>-1&&this._crawler?this._crawler.searchName(b,function(a){c(e(a),null,null,b)}):typeof g==="string"&&g.indexOf("search")>-1&&!b.nameSearch?(new f.SearchCrawler(this.registry,this._fileService,b,{childrenLocation:this.getChildrenLocation()})).search(function(a){c(e(a),null,null,b)}):this.registry.getService("orion.page.message").setErrorMessage(g)}},getFileService:function(){return this._fileService},setCrawler:function(b){this._crawler=b},handleError:function(b,a){console.error(b);
h.empty(a);a.appendChild(document.createTextNode(b));return b},setLocationByMetaData:function(b,a){var c="",d=null;this._searchRootLocation=this._fileService.fileServiceRootURL(b.Location);a&&b&&b.Parents&&b.Parents.length>0?d=a.index==="last"?b.Parents[b.Parents.length-1]:b.Parents[0]:b&&b.Directory&&b.Location&&b.Parents&&(d=b);if(d)this.setLocationbyURL(d.Location),c=d.Name,this._childrenLocation=d.ChildrenLocation;else if(b)this.setLocationbyURL(this._searchRootLocation),c=this._fileService.fileServiceName(b.Location),
this._childrenLocation=b.ChildrenLocation;d=h.node("search");c||(c="");if(d&&d.placeholder){d.value="";var g=e.formatMessage(j["Search ${0}"],c);d.placeholder=g.length>30?g.substring(0,27)+"...":e.formatMessage(j["Search ${0}"],c)}if(d&&d.title)d.title=j["Type a keyword or wild card to search in "]+c},setLocationbyURL:function(b){this._searchLocation=b},setRootLocationbyURL:function(b){this._searchRootLocation=b},setChildrenLocationbyURL:function(b){this._childrenLocation=b},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(b,a,c,d){c=c?this.getSearchRootLocation():this.getSearchLocation();return a?{resource:c,sort:"NameLower asc",rows:100,start:0,nameSearch:!0,keyword:b}:{resource:c,
sort:d&&d.sort?d.sort:"Path asc",rows:d&&d.rows?d.rows:40,start:0,caseSensitive:d?d.caseSensitive:void 0,regEx:d?d.regEx:void 0,fileType:d?d.fileType:void 0,keyword:b,replace:d?d.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 h={root:k};Object.keys(j).forEach(function(e){typeof h[e]==="undefined"&&(h[e]=j[e])});return h});
define("orion/compare/compareCommands",["i18n!orion/compare/nls/messages","orion/commands","orion/keyBinding","orion/webui/littlelib"],function(j,k,h,e){var d={};d.CompareCommandFactory=function(){function d(c){this.setOptions(c,!0)}d.prototype={setOptions:function(c,a){if(a)this.options={};if(!this.options)this.options={};c&&Object.keys(c).forEach(function(a){this.options[a]=c[a]}.bind(this))},getOptions:function(){return this.options},initCommands:function(c){var a=this.options.commandSpanId,d=
this.options.commandService;if(d&&a){var e=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 c.type==="twoWay"&&c.options.newFile&&!c.options.newFile.readonly}.bind(this),callback:function(b){b.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 c.type==="twoWay"&&c.options.oldFile&&!c.options.oldFile.readonly}.bind(this),callback:function(b){b.items.copyToRight()}}),f=new k.Command({tooltip:j["Switch to unified diff"],name:j.Unified,id:"orion.compare.toggle2Inline",groupId:"orion.compareGroup",visibleWhen:function(b){return b.options.toggler&&b.options.toggler.getWidget().type==="twoWay"},callback:function(b){b.items.options.toggler.toggle()}}),
n=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(b){return b.options.toggler&&b.options.toggler.getWidget().type==="inline"},callback:function(b){b.items.options.toggler.toggle()}}),m=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",callback:function(b){b.items.nextDiff()}}),
o=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",callback:function(b){b.items.prevDiff()}}),t=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",callback:function(b){b.items.nextChange()}}),r=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",callback:function(b){b.items.prevChange(b)}});d.addCommand(e);d.addCommand(b);d.addCommand(n);d.addCommand(f);d.addCommand(m);d.addCommand(o);d.addCommand(t);d.addCommand(r);d.registerCommandContribution(a,"orion.compare.toggle2Inline",108);d.registerCommandContribution(a,"orion.compare.toggle2TwoWay",109);d.registerCommandContribution(a,"orion.compare.copyToLeft",110,null,!1,new h.KeyBinding(37,!0,!1,!0));
d.registerCommandContribution(a,"orion.compare.copyToRight",111,null,!1,new h.KeyBinding(39,!0,!1,!0));d.registerCommandContribution(a,"orion.compare.nextDiff",112,null,!1,new h.KeyBinding(40,!0));d.registerCommandContribution(a,"orion.compare.prevDiff",113,null,!1,new h.KeyBinding(38,!0));c.options.wordLevelNav?(d.registerCommandContribution(a,"orion.compare.nextChange",114,null,!1,new h.KeyBinding(40,!0,!0)),d.registerCommandContribution(a,"orion.compare.prevChange",115,null,!1,new h.KeyBinding(38,
!0,!0))):(d.registerCommandContribution(a,"orion.compare.nextChange",114,null,!0,new h.KeyBinding(40,!0,!0)),d.registerCommandContribution(a,"orion.compare.prevChange",115,null,!0,new h.KeyBinding(38,!0,!0)))}},renderCommands:function(c){var a=this.options.commandSpanId,d=this.options.commandService;d&&a&&(e.empty(e.node(a)),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),d.renderCommands(a,a,c,c,"tool",null,this.options.gridRenderer.navGridHolder)):(d.renderCommands(a,a,c,c,"tool",null,this.options.gridRenderer.navGridHolder),this.options.gridRenderer.additionalCmdRender(this.options.gridRenderer.navGridHolder)):d.renderCommands(a,a,c,c,"tool",null,this.options.gridRenderer.navGridHolder)):d.renderCommands(a,a,c,c,"tool",null))}};return d}();return d});
define("orion/compare/compareUtils",["orion/URITemplate"],function(j){var k=k||{};k.compareUtils=k.compareUtils||{};k.compareUtils.lookUpMapper=function(h,e,d){for(var f=0,c=0;c<h.length;c++){var a=h[c][e];a===0&&(a=1);if(d>=f&&d<f+a)return{mapperIndex:c,startFrom:f};if(c===h.length-1)break;f+=h[c][e]}return{mapperIndex:h.length-1,startFrom:f}};k.compareUtils.lookUpLineIndex=function(h,e,d){if(d===0)return 0;for(var f=0,c=0;c<d;c++)f+=h[c][e];return f};k.compareUtils.updateMapper=function(h,e,d,f,
c){if(f!==c&&(f>0||c>0)){var a=k.compareUtils.lookUpMapper(h,e,d);if(!(a.mapperIndex<0)){if(f>0)for(var i=d-a.startFrom,d=a.mapperIndex;d<h.length;d++){i=h[d][e]-i;if(f<=i){h[d][e]-=f;break}h[d][e]-=i;f-=i;i=0}c>0&&(h[a.mapperIndex][e]+=c)}}};k.compareUtils.overlapMapper=function(h,e,d,f,c){h=d+h[e]-1;h<d&&(h=d);c<f&&(c=f);return h<f||c<d?!1:!0};k.compareUtils.findFirstDiff=function(h,e,d,f){for(var c=0,a=null,i=0;i<h.length;i++){if(c>f)break;if(k.compareUtils.overlapMapper(h[i],e,c,d,f)&&(a={mapperIndex:i,
startFrom:c},h[i][2]!==0))break;c+=h[i][e]}return a};k.compareUtils.matchMapper=function(h,e,d,f){if(h.length===0)return d;var c=d+Math.round((f-d)/3),a=k.compareUtils.findFirstDiff(h,e,d,f),i=h[a.mapperIndex][e]===0?a.startFrom:a.startFrom+h[a.mapperIndex][e]-1,g=k.compareUtils.lookUpLineIndex(h,1-e,a.mapperIndex),b=a.startFrom-d;return h[a.mapperIndex][2]===0?g-b:c>=a.startFrom&&c<=i?g-Math.round((f-d)/3):c<a.startFrom?g-b:(h[a.mapperIndex][1-e]===0?g:g+h[a.mapperIndex][1-e]-1)-(i-d)};k.compareUtils.getMapperLineCount=
function(h){for(var e=0,d=0;d<h.length;d++)e+=Math.max(h[d][0],h[d][1]);return e};k.compareUtils.getAnnotationIndex=function(h,e){for(var d=0;d<h.length;d++)if(h[d][0]===e)return d;return-1};k.compareUtils.getAnnotationMapperIndex=function(h,e){return h[e][1]};k.compareUtils.getAnnotationIndexByMapper=function(h,e){for(var d=0;d<h.length;d++)if(h[d][1]===e)return{current:d,prev:d-1,next:d+1};return{current:-1,prev:-1,next:-1}};k.compareUtils.isMapperConflict=function(h,e){return e<0?!1:!h[e][3]?!1:
h[e][3]===1};k.compareUtils.mergeDiffBlocks=function(h,e,d,f,c,a){for(var i=0;i<e.length;i++){var g=e[i][0],b=d[e[i][1]];if(b[0]>0){for(var l="",n=0;n<b[0];n++)l=l+f[b[2]-1+n].substring(c)+a;b=h.getLineCount();g>=b&&(g=b-1);g=h.getLineStart(g);h.setText(l,g,g)}}};k.compareUtils.generateCompareHref=function(h,e){var d=require.toUrl("compare/compare.html");if(!e.conflict)e.conflict=void 0;if(!e.readonly)e.readonly=void 0;return(new j(d+"#{,resource,params*}")).expand({resource:h,params:e})};k.compareUtils.generateCompareTreeHref=
function(h,e){var d=require.toUrl("compare-tree/compare-tree.html");return(new j(d+"#{,resource,params*}")).expand({resource:h,params:e})};return k.compareUtils});
define("orion/compare/diffProvider",["i18n!orion/compare/nls/messages","orion/Deferred"],function(j,k){function h(d,e,c){var a=new k;d[e].apply(d,c).then(function(c){a.resolve(c)},function(c){a.reject(c)});return a}function e(d,e){var c=d.getServiceReferences("orion.core.diff"),a,i=c;if(e){i=[];for(a=0;a<c.length;++a)e(c[a])&&i.push(c[a])}var g=[],b=[];for(a=0;a<i.length;++a)g[a]=RegExp(i[a].getProperty("pattern")||".*"),b[a]=d.getService(i[a]);this._getService=function(a){if(a.indexOf("://")===-1){var c=
document.createElement("a");c.href=a;a=c.href}for(c=0;c<g.length;++c)if(g[c].test(a))return b[c];throw j["No Matching DiffService for location:"]+a;}}e.prototype={getDiffContent:function(d){return h(this._getService(d),"getDiffContent",arguments)},getDiffFileURI:function(d){return h(this._getService(d),"getDiffFileURI",arguments)}};return{DiffProvider:e}});
define("orion/compare/diffParser",[],function(){var j=j||{};j.DiffParser=function(){function j(e,d){this._lineDelimiter=e?e:h?"\r\n":"\n";this._diffLineDelimiter=d?d:this._lineDelimiter;this._DEBUG=!1}var h=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(e){this._diffLineDelimiter=this._lineDelimiter=e},getDiffArray:function(){return{array:this._diffContents,index:this._diffContentIndex}},parse:function(e,d,f,c){this._init();if(d==="")return{outPutFile:e,mapper:[]};this._oFileContents=e===""?[]:e.split(this._lineDelimiter);this._diffContents=d.split(this._diffLineDelimiter);d=this._diffContents.length;this._hunkRanges=[];for(var a=0;a<d;a++){var i=this._parseHunkRange(a);i&&this._hunkRanges.push(i)}if(0===this._hunkRanges.length)return{outPutFile:e,
mapper:[]};this._DEBUG&&(console.log("***Diff contents: \n"),this._diffContents.forEach(function(a){console.log(a)}),console.log("***Hunk ranges: \n"),console.log(JSON.stringify(this._hunkRanges)));for(e=0;e<this._hunkRanges.length;e++)this._parseHunkBlock(e);this._DEBUG&&(console.log("***Original Hunk range blocks: \n"),console.log(JSON.stringify(this._oBlocks)),console.log("***New Hunk range blocks: \n"),console.log(JSON.stringify(this._nBlocks)));this._buildMap(f);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));c||this._buildNewFile();return{outPutFile:this._nFileContents.join(this._diffLineDelimiter),mapper:this._deltaMap}},_logMap:function(){for(var e=0;e<this._deltaMap.length;e++)if(console.log(JSON.stringify(this._deltaMap[e])),
this._deltaMap[e][2]>0){console.log("    **Diff content on change/add: \n");for(var d=0;d<this._deltaMap[e][0];d++)console.log("    "+this._diffContents[this._deltaMap[e][2]+d-1])}},_logNewFile:function(){for(var e=0;e<this._nFileContents.length;e++)console.log(this._nFileContents[e])},_createBlock:function(e,d,f,c){c===f&&e===" "||(f=[f,c-f,"s"],e==="-"?f[2]="r":e==="+"?f[2]="a":e==="c"&&(f[2]="c"),d.push(f))},_createMinusBlock:function(e,d,f){var c=this._oBlocks.length;c===0||e!==this._oBlocks[c-
1][0]?(this._oBlocks.push([e===0?1:e,f]),this._nBlocks.push([d,0,-2])):this._oBlocks[c-1][1]+=f},_createPlusBlock:function(e,d,f,c){var a=this._nBlocks.length;a===0||d!==this._nBlocks[a-1][0]?(this._oBlocks.push([e===0?1:e,0]),this._nBlocks.push([d,f,c])):(this._nBlocks[a-1][1]+=f,this._nBlocks[a-1][2]=c)},_parseHunkBlock:function(e){for(var d=" ",f=this._hunkRanges[e][0]+1,c=e===this._hunkRanges.length-1?this._diffContents.length:this._hunkRanges[e+1][0],a=0,i=0,g=this._hunkRanges[e][1],b=this._hunkRanges[e][3],
l=f,h=f;h<c;h++)if(0!==this._diffContents[h].length){var m=this._diffContents[h][0];if(m==="\\"&&("\\ No newline at end of file"===this._diffContents[h].substring(0,this._diffContents[h].length-1)||"\\ No newline at end of file"===this._diffContents[h]))d==="-"?this._oNewLineAtEnd=!1:d===" "?this._oNewLineAtEnd=this._nNewLineAtEnd=!1:this._nNewLineAtEnd=!1,h>f&&this._diffContents[h-1][this._diffContents[h-1].length-1]==="\r"&&(this._diffContents[h-1]=this._diffContents[h-1].substring(0,this._diffContents[h-
1].length-1));else{switch(m){case "-":case "+":case " ":break;default:continue}if(d!==m){m==="+"&&(l=h);switch(d){case " ":g=this._hunkRanges[e][1]+a;b=this._hunkRanges[e][3]+i;break;case "-":this._createMinusBlock(g,b,this._hunkRanges[e][1]+a-g);break;case "+":this._createPlusBlock(g,b,this._hunkRanges[e][3]+i-b,l)}d=m}switch(m){case "-":a++;break;case "+":i++;break;case " ":a++,i++}}}switch(d){case "-":this._createMinusBlock(g,b,this._hunkRanges[e][1]+a-g);break;case "+":this._createPlusBlock(g,
b,this._hunkRanges[e][3]+i-b,l)}},_detectConflictes:function(e,d){if(e<0)return!1;for(var f=e+d,c=e;c<f;c++){var a=this._diffContents[c];if(a.indexOf("<<<<<")>-1||a.indexOf(">>>>>")>-1)return!0}return!1},_buildMap:function(e){var d=this._oBlocks.length,f=this._oFileContents.length,c=0,a;a=1;for(var i=0;i<d;i++)a=this._oBlocks[i][0]-a,a>0&&(this._deltaMap.push([a,a,0]),c+=a),e&&this._detectConflictes(this._nBlocks[i][2],this._nBlocks[i][1])?this._deltaMap.push([this._nBlocks[i][1],this._oBlocks[i][1],
this._nBlocks[i][2]+1,1]):this._deltaMap.push([this._nBlocks[i][1],this._oBlocks[i][1],this._nBlocks[i][2]+1]),c+=this._oBlocks[i][1],a=this._oBlocks[i][0]+this._oBlocks[i][1];0<f-a&&(this._deltaMap.push([f-a+1,f-a+1,0]),c+=f-a+1);c<f&&(a=f-c,e=this._deltaMap[this._deltaMap.length-1],e[2]===0?(e[0]+=a,e[1]+=a):e[2]===-1?this._deltaMap.push([a,a,0]):this._nNewLineAtEnd===this._oNewLineAtEnd?this._deltaMap.push([a,a,0]):(this._nNewLineAtEnd&&(e[0]+=a),this._oNewLineAtEnd&&(e[1]+=a)))},_buildNewFile:function(){var e=
1,d=!1,f=this._deltaMap.length,c,a;for(c=0;c<f;c++){d=!1;if(this._deltaMap[c][2]===0){for(a=0;a<this._deltaMap[c][0];a++)this._nFileContents.push(this._oFileContents[e+a-1]);d=!0}else if(this._deltaMap[c][2]>0)for(a=0;a<this._deltaMap[c][0];a++)this._nFileContents.push(this._diffContents[this._deltaMap[c][2]+a-1].substring(1));e+=this._deltaMap[c][1]}this._nNewLineAtEnd&&!d&&this._nFileContents.push("")},_parseHRangeBody:function(e,d){if(0<e.indexOf(",")){var f=e.split(","),c=parseInt(f[0],10),f=
parseInt(f[1],10);d.push(c>=0?c:1);d.push(f>=0?f:1)}else c=parseInt(e,10),d.push(c>=0?c:1),d.push(1)},_parseHunkRange:function(e){var d=this._diffContents[e];if(8>d.length)return null;if("@@"!==d.substring(0,2))return null;var d=d.substring(2),f=d.indexOf("@@");if(f<0)return null;var d=d.substring(0,f),f=d.indexOf("-"),c=d.indexOf("+");if(f<0||c<0)return null;e=[e];f<c?(d=d.substring(f+1).split("+"),this._parseHRangeBody(d[0],e),this._parseHRangeBody(d[1],e)):(d=d.substring(c+1).split("-"),this._parseHRangeBody(d[1],
e),this._parseHRangeBody(d[0],e));return e}};return j}();return j});
define("orion/compare/compareRulers",["orion/compare/compareUtils"],function(j){var k=k||{};k.CompareRuler=function(){function h(e,d,f){this._location=e||"left";this._overview=d||"page";this._rulerStyle=f;this._editor=null;var c=this;this._listener={onModelChanged:function(a){c._onModelChanged(a)}}}h.prototype={setView:function(e){this._onModelChanged&&this._editor&&this._editor.removeEventListener("ModelChanged",this._listener.onModelChanged);this._editor=e;this._onModelChanged&&this._editor&&this._editor.addEventListener("ModelChanged",
this._listener.onModelChanged)},getLocation:function(){return this._location},getOverview:function(){return this._overview},getAnnotationModel:function(){return null},addAnnotationType:function(){},isAnnotationTypeVisible:function(){return!1},removeAnnotationType:function(){},setAnnotationModel:function(){},getAnnotations:function(e,d){for(var f=[],c=e;c<d;c++){var a=this.getStyle(c);a&&(f[c]={html:this.getHTML(c),style:a})}return f},getWidestAnnotation:function(){return{html:this.getHTML(-1),style:this.getStyle(-1)}},
getRulerStyle:function(){return this.getStyle(void 0)}};return h}();k.LineNumberCompareRuler=function(){function h(e,d,f,c,a,i){k.CompareRuler.call(this,f,"page",c);this._diffNavigator=e;this._oddStyle=a||{style:{backgroundColor:"white"}};this._evenStyle=i||{style:{backgroundColor:"white"}};this._numOfDigits=0;this._mapperColumnIndex=d}h.prototype=new k.CompareRuler;h.prototype.getStyle=function(e){return e===void 0?this._rulerStyle:this._evenStyle};h.prototype.getHTML=function(e){var d=this._editor.getModel(),
f=this._diffNavigator.getFeeder(this._mapperColumnIndex===0);return!f?"":e===-1?d.getLineCount():f.getLineNumber?(e=f.getLineNumber(e),e===-1?"":e+1):e+1};h.prototype._onModelChanged=function(e){var e=e.start,d=this._editor.getModel(),f=d.getLineCount(),c=(f+"").length;if(this._numOfDigits!==c)this._numOfDigits=c,this._editor.redrawLines(d.getLineAtOffset(e),f,this)};return h}();k.CompareOverviewRuler=function(){function h(e,d,f,c){this._diffNavigator=f;this._onClick=c;k.CompareRuler.call(this,e,
"document",d)}h.prototype=new k.CompareRuler;h.prototype.getStyle=function(e){var d,f;if(e===void 0)d=this._rulerStyle||{},f=d.style||(d.style={}),f.lineHeight="1px",f.fontSize="1px",f.width="14px";else if(d=e!==-1?{styleClass:"annotationOverview breakpoint"}:{},f=d.style||(d.style={}),f.cursor="pointer",f.width="8px",f.left="2px",e>=0){var c;if(this._diffNavigator&&this._diffNavigator.getFeeder())c=this._diffNavigator.getFeeder().getDiffBlocks();else return null;e=j.getAnnotationIndex(c,e);if(e===
-1)return null;c=j.getAnnotationMapperIndex(c,e);var a;a=this._diffNavigator.getMapper();if(c=j.isMapperConflict(a,c))f.border="1px #FF0000 solid";if(e===this._diffNavigator.getCurrentBlockIndex())f.backgroundColor=c?"red":"blue";e=this._diffNavigator.getFeeder().getDiffBlockH(e);c=this._diffNavigator.getFeeder().getOverviewLineCount();if(e<0)return null;a=this._editor.getClientArea();e=Math.floor(a.height*e/c);e<2&&(e=2);f.height=e+"px"}else return null;return d};h.prototype.setDiffNavigator=function(e){this._diffNavigator=
e};h.prototype.getHTML=function(){return"&nbsp;"};h.prototype.onClick=function(e){e!==void 0&&this._onClick(e,this)};h.prototype._onModelChanged=function(){this._editor.getModel().getLineCount()>0&&this._editor.redrawLines(0,1,this)};return h}();k.CompareCurveRuler=function(){function h(e){this._canvasDiv=e;this._mapper=void 0}h.prototype={init:function(e,d,f,c){this._rightIniting=this._rightIniting=this._leftIniting=!0;this._mapper=e;this._leftEditor=d;this._rightEditor=f;this._leftTextView=d.getTextView();
this._rightTextView=f.getTextView();this._diffNavigator=c;this.render()},matchPositionFrom:function(e){var d=e?this._leftTextView:this._rightTextView,f=e?this._rightTextView:this._leftTextView,c=d.getTopIndex(),d=d.getBottomIndex(),e=j.matchMapper(this._mapper,e?0:1,c,d);f.setTopIndex(e)},copyTo:function(e){if(this._diffNavigator.iterator){var d=this._diffNavigator.iterator.cursor();if(d&&(d.type==="word"?!d.copied&&!d.parent.copied:!d.copied)){var f=e?this._rightTextView.getText(d.oldA.start,d.oldA.end):
this._leftTextView.getText(d.newA.start,d.newA.end),c=e?d.newA:d.oldA;(e?this._leftTextView:this._rightTextView).setText(f,c.start,c.end);d.copied=!0}}},render:function(){if(this._mapper){var e=this._canvasDiv.getContext("2d");e.clearRect(0,0,this._canvasDiv.width,this._canvasDiv.height);e.strokeStyle="#AAAAAA";e.lineWidth=1;e.beginPath();var d=this._leftTextView.getTopIndex(),f=this._leftTextView.getBottomIndex(),c=this._rightTextView.getTopIndex(),a=this._rightTextView.getBottomIndex();this._leftLineH=
this._leftTextView.getLineHeight();this._rightLineH=this._rightTextView.getLineHeight();for(var i=0,g=0,b=!1,l=0;l<this._mapper.length;l++){if(this._mapper[l][2]!==0)if(j.overlapMapper(this._mapper[l],0,i,d,f)||j.overlapMapper(this._mapper[l],1,g,c,a))this._renderCurve(l,i,g,this._canvasDiv,e,d,f,c,a),b=!0;else if(b)break;i+=this._mapper[l][0];g+=this._mapper[l][1]}e.stroke()}},_renderCurve:function(e,d,f,c,a){var i=this._mapper[e],d=this._leftTextView.getLinePixel(d+i[0]/2)+i[0]%2*this._leftLineH/
3-this._leftTextView.getTopPixel(),f=this._rightTextView.getLinePixel(f+i[1]/2)+i[1]%2*this._rightLineH/3-this._rightTextView.getTopPixel(),c=c.parentNode.clientWidth;e===this._diffNavigator.getCurrentMapperIndex()?(a.stroke(),a.strokeStyle="#000",a.lineWidth=1,a.beginPath(),a.moveTo(0,d),a.bezierCurveTo(c/3,d,c*0.666,f,c,f),a.stroke(),a.strokeStyle="#AAAAAA",a.lineWidth=1,a.beginPath()):(a.moveTo(0,d),a.bezierCurveTo(c/3,d,c*0.666,f,c,f),a.stroke())},onChanged:function(e,d){var f=d?this._rightIniting:
this._leftIniting;if(e.removedLineCount!==e.addedLineCount){var c=d?this._rightTextView:this._leftTextView;f||j.updateMapper(this._mapper,d?1:0,c.getModel().getLineAtOffset(e.start),e.removedLineCount,e.addedLineCount);(e.removedLineCount>0||e.addedLineCount>0)&&this.render()}d?this._rightIniting=!1:this._leftIniting=!1;return f}};return h}();return k});define("orion/editor/i18n",{load:function(j,k,h){k.specified&&k.specified("orion/bootstrap")?k(["orion/i18n!"+j],function(e){h(e)}):h({})}});
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 h={root:k},e;for(e in j)j.hasOwnProperty(e)&&typeof h[e]==="undefined"&&(h[e]=j[e]);return h});
define("orion/editor/textModel",["orion/editor/eventTarget","orion/util"],function(j,k){function h(e,d){this._lastLineIndex=-1;this._text=[""];this._lineOffsets=[0];this.setText(e);this.setLineDelimiter(d)}h.prototype={find:function(e){if(this._text.length>1)this._text=[this._text.join("")];var d=e.string,f=d,c=e.caseInsensitive;!e.regex&&d&&(f=d.replace(/([\\$\^*\/+?\.\(\)|{}\[\]])/g,"\\$&"),c&&(f=f.replace(/[iI\u0130\u0131]/g,"[Ii\u0130\u0131]")));var a=null,i;if(f){var d=e.reverse,g=e.wrap,b=e.wholeWord,
l=e.start||0,e=e.end,h=e!==null&&e!==void 0,m="";m.indexOf("g")===-1&&(m+="g");c&&m.indexOf("i")===-1&&(m+="i");b&&(f="\\b"+f+"\\b");var j=this._text[0],k,r,s=0;h&&(c=l<e?l:e,j=j.substring(c,l<e?e:l),s=c);var v=RegExp(f,m);if(d)i=function(){var b=null;for(v.lastIndex=0;;){r=v.lastIndex;k=v.exec(j);if(r===v.lastIndex)return null;if(k){if(!(k.index+s<l)){if(!g||b)break;l=j.length+s}b={start:k.index+s,end:v.lastIndex+s}}else break}if(b)l=b.start;return b};else{if(!h)v.lastIndex=l;i=function(){for(;;){r=
v.lastIndex;k=v.exec(j);if(r===v.lastIndex)break;if(k)return{start:k.index+s,end:v.lastIndex+s};if(!(r!==0&&g))break}return null}}a=i()}return{next:function(){var b=a;b&&(a=i());return b},hasNext:function(){return a!==null}}},getCharCount:function(){for(var e=0,d=0;d<this._text.length;d++)e+=this._text[d].length;return e},getLine:function(e,d){var f=this.getLineCount();if(!(0<=e&&e<f))return null;var c=this._lineOffsets[e];if(e+1<f){f=this.getText(c,this._lineOffsets[e+1]);if(d)return f;for(var c=
f.length,a;(a=f.charCodeAt(c-1))===10||a===13;)c--;return f.substring(0,c)}else return this.getText(c)},getLineAtOffset:function(e){var d=this.getCharCount();if(!(0<=e&&e<=d))return-1;var f=this.getLineCount();if(e===d)return f-1;var c,a,i=this._lastLineIndex;if(0<=i&&i<f&&(c=this._lineOffsets[i],a=i+1<f?this._lineOffsets[i+1]:d,c<=e&&e<a))return i;for(var g=f,b=-1;g-b>1;)if(i=Math.floor((g+b)/2),c=this._lineOffsets[i],a=i+1<f?this._lineOffsets[i+1]:d,e<=c)g=i;else if(e<a){g=i;break}else b=i;return this._lastLineIndex=
g},getLineCount:function(){return this._lineOffsets.length},getLineDelimiter:function(){return this._lineDelimiter},getLineEnd:function(e,d){var f=this.getLineCount();if(!(0<=e&&e<f))return-1;if(e+1<f){f=this._lineOffsets[e+1];if(d)return f;for(var c=this.getText(Math.max(this._lineOffsets[e],f-2),f),a=c.length,i;(i=c.charCodeAt(a-1))===10||i===13;)a--;return f-(c.length-a)}else return this.getCharCount()},getLineStart:function(e){return!(0<=e&&e<this.getLineCount())?-1:this._lineOffsets[e]},getText:function(e,
d){e===void 0&&(e=0);d===void 0&&(d=this.getCharCount());if(e===d)return"";for(var f=0,c=0,a;c<this._text.length;){a=this._text[c].length;if(e<=f+a)break;f+=a;c++}for(var i=f,g=c;c<this._text.length;){a=this._text[c].length;if(d<=f+a)break;f+=a;c++}if(g===c)return this._text[g].substring(e-i,d-f);i=this._text[g].substring(e-i);f=this._text[c].substring(0,d-f);return i+this._text.slice(g+1,c).join("")+f},onChanging:function(e){return this.dispatchEvent(e)},onChanged:function(e){return this.dispatchEvent(e)},
setLineDelimiter:function(e,d){e==="auto"&&(e=void 0,this.getLineCount()>1&&(e=this.getText(this.getLineEnd(0),this.getLineEnd(0,!0))));this._lineDelimiter=e?e:k.platformDelimiter;if(d){var f=this.getLineCount();if(f>1){for(var c=Array(f),a=0;a<f;a++)c[a]=this.getLine(a);this.setText(c.join(this._lineDelimiter))}}},setText:function(e,d,f){e===void 0&&(e="");d===void 0&&(d=0);f===void 0&&(f=this.getCharCount());if(!(d===f&&e==="")){for(var c=this.getLineAtOffset(d),a=this.getLineAtOffset(f),i=d,g=
f-d,b=a-c,l=e.length,h=0,m=this.getLineCount(),j=0,k=0,r=0,s=[];;){j!==-1&&j<=r&&(j=e.indexOf("\r",r));k!==-1&&k<=r&&(k=e.indexOf("\n",r));if(k===-1&&j===-1)break;r=j!==-1&&k!==-1?j+1===k?k+1:(j<k?j:k)+1:j!==-1?j+1:k+1;s.push(d+r);h++}this.onChanging({type:"Changing",text:e,start:i,removedCharCount:g,addedCharCount:l,removedLineCount:b,addedLineCount:h});s.length===0&&(r=this.getLineStart(c),a=a+1<m?this.getLineStart(a+1):this.getCharCount(),d!==r&&(e=this.getText(r,d)+e,d=r),f!==a&&(e+=this.getText(f,
a),f=a));r=l-g;for(a=c+b+1;a<m;a++)this._lineOffsets[a]+=r;if(s.length<5E4)c=[c+1,b].concat(s),Array.prototype.splice.apply(this._lineOffsets,c);else{r=c+1;this._lineOffsets.splice(r,b);for(m=0;m<s.length;m+=5E4)c=[r,0].concat(s.slice(m,Math.min(s.length,m+5E4))),Array.prototype.splice.apply(this._lineOffsets,c),r+=5E4}for(r=m=0;r<this._text.length;){a=this._text[r].length;if(d<=m+a)break;m+=a;r++}c=m;for(s=r;r<this._text.length;){a=this._text[r].length;if(f<=m+a)break;m+=a;r++}a=this._text[r];d=
this._text[s].substring(0,d-c);f=a.substring(f-m);s=[s,r-s+1];d&&s.push(d);e&&s.push(e);f&&s.push(f);Array.prototype.splice.apply(this._text,s);if(this._text.length===0)this._text=[""];this.onChanged({type:"Changed",start:i,removedCharCount:g,addedCharCount:l,removedLineCount:b,addedLineCount:h})}}};j.EventTarget.addMixin(h.prototype);return{TextModel:h}});
define("orion/editor/keyModes",["orion/keyBinding","orion/util"],function(j,k){function h(d){if(d)this._view=d,this._keyBindings=this.createKeyBindings(),this._keyBindingIndex=0}function e(d){h.call(this,d)}h.prototype={createKeyBindings:function(){return[]},getKeyBindings:function(d){for(var e=[],c=this._keyBindings,a=0;a<c.length;a++)c[a].actionID===d&&e.push(c[a].keyBinding);return e},getView:function(){return this._view},isActive:function(){return this._view.getKeyModes().indexOf(this)!==-1},
match:function(d){if(d.type==="keydown")switch(d.keyCode){case 16:case 17:case 18:case 91:return}for(var e=this._keyBindingIndex,c=this._matchingKeyBindings||this._keyBindings,a=[],i=0;i<c.length;i++){var g=c[i],b=g.keyBinding.match(d,e);if(b===!0)return this._keyBindingIndex=0,this._matchingKeyBindings=null,g.actionID;else typeof b==="number"&&a.push(g)}if(a.length===0)this._keyBindingIndex=0,this._matchingKeyBindings=null;else return this._keyBindingIndex++,this._matchingKeyBindings=a,"noop"},setKeyBinding:function(d,
e){for(var c=this._keyBindings,a=0;a<c.length;a++){var i=c[a];if(i.keyBinding.equals(d)){e?i.actionID=e:i.predefined?i.actionID="noop":c.splice(a,1);return}}e&&c.push({keyBinding:d,actionID:e})},setView:function(d){this._view=d}};e.prototype=new h;e.prototype.createKeyBindings=function(){var d=j.KeyBinding,e=[];e.push({actionID:"lineUp",keyBinding:new d(38),predefined:!0});e.push({actionID:"lineDown",keyBinding:new d(40),predefined:!0});e.push({actionID:"charPrevious",keyBinding:new d(37),predefined:!0});
e.push({actionID:"charNext",keyBinding:new d(39),predefined:!0});k.isMac?(e.push({actionID:"scrollPageUp",keyBinding:new d(33),predefined:!0}),e.push({actionID:"scrollPageDown",keyBinding:new d(34),predefined:!0}),e.push({actionID:"pageUp",keyBinding:new d(33,null,null,!0),predefined:!0}),e.push({actionID:"pageDown",keyBinding:new d(34,null,null,!0),predefined:!0}),e.push({actionID:"lineStart",keyBinding:new d(37,!0),predefined:!0}),e.push({actionID:"lineEnd",keyBinding:new d(39,!0),predefined:!0}),
e.push({actionID:"wordPrevious",keyBinding:new d(37,null,null,!0),predefined:!0}),e.push({actionID:"wordNext",keyBinding:new d(39,null,null,!0),predefined:!0}),e.push({actionID:"scrollTextStart",keyBinding:new d(36),predefined:!0}),e.push({actionID:"scrollTextEnd",keyBinding:new d(35),predefined:!0}),e.push({actionID:"textStart",keyBinding:new d(38,!0),predefined:!0}),e.push({actionID:"textEnd",keyBinding:new d(40,!0),predefined:!0}),e.push({actionID:"scrollPageUp",keyBinding:new d(38,null,null,null,
!0),predefined:!0}),e.push({actionID:"scrollPageDown",keyBinding:new d(40,null,null,null,!0),predefined:!0}),e.push({actionID:"lineStart",keyBinding:new d(37,null,null,null,!0),predefined:!0}),e.push({actionID:"lineEnd",keyBinding:new d(39,null,null,null,!0),predefined:!0}),e.push({actionID:"lineStart",keyBinding:new d(38,null,null,!0),predefined:!0}),e.push({actionID:"lineEnd",keyBinding:new d(40,null,null,!0),predefined:!0})):(e.push({actionID:"pageUp",keyBinding:new d(33),predefined:!0}),e.push({actionID:"pageDown",
keyBinding:new d(34),predefined:!0}),e.push({actionID:"lineStart",keyBinding:new d(36),predefined:!0}),e.push({actionID:"lineEnd",keyBinding:new d(35),predefined:!0}),e.push({actionID:"wordPrevious",keyBinding:new d(37,!0),predefined:!0}),e.push({actionID:"wordNext",keyBinding:new d(39,!0),predefined:!0}),e.push({actionID:"textStart",keyBinding:new d(36,!0),predefined:!0}),e.push({actionID:"textEnd",keyBinding:new d(35,!0),predefined:!0}));k.isFirefox&&k.isLinux&&(e.push({actionID:"lineUp",keyBinding:new d(38,
!0),predefined:!0}),e.push({actionID:"lineDown",keyBinding:new d(40,!0),predefined:!0}));k.isWindows&&(e.push({actionID:"scrollLineUp",keyBinding:new d(38,!0),predefined:!0}),e.push({actionID:"scrollLineDown",keyBinding:new d(40,!0),predefined:!0}));e.push({actionID:"selectLineUp",keyBinding:new d(38,null,!0),predefined:!0});e.push({actionID:"selectLineDown",keyBinding:new d(40,null,!0),predefined:!0});e.push({actionID:"selectCharPrevious",keyBinding:new d(37,null,!0),predefined:!0});e.push({actionID:"selectCharNext",
keyBinding:new d(39,null,!0),predefined:!0});e.push({actionID:"selectPageUp",keyBinding:new d(33,null,!0),predefined:!0});e.push({actionID:"selectPageDown",keyBinding:new d(34,null,!0),predefined:!0});k.isMac?(e.push({actionID:"selectLineStart",keyBinding:new d(37,!0,!0),predefined:!0}),e.push({actionID:"selectLineEnd",keyBinding:new d(39,!0,!0),predefined:!0}),e.push({actionID:"selectWordPrevious",keyBinding:new d(37,null,!0,!0),predefined:!0}),e.push({actionID:"selectWordNext",keyBinding:new d(39,
null,!0,!0),predefined:!0}),e.push({actionID:"selectTextStart",keyBinding:new d(36,null,!0),predefined:!0}),e.push({actionID:"selectTextEnd",keyBinding:new d(35,null,!0),predefined:!0}),e.push({actionID:"selectTextStart",keyBinding:new d(38,!0,!0),predefined:!0}),e.push({actionID:"selectTextEnd",keyBinding:new d(40,!0,!0),predefined:!0}),e.push({actionID:"selectLineStart",keyBinding:new d(37,null,!0,null,!0),predefined:!0}),e.push({actionID:"selectLineEnd",keyBinding:new d(39,null,!0,null,!0),predefined:!0}),
e.push({actionID:"selectLineStart",keyBinding:new d(38,null,!0,!0),predefined:!0}),e.push({actionID:"selectLineEnd",keyBinding:new d(40,null,!0,!0),predefined:!0})):(k.isLinux&&(e.push({actionID:"selectWholeLineUp",keyBinding:new d(38,!0,!0),predefined:!0}),e.push({actionID:"selectWholeLineDown",keyBinding:new d(40,!0,!0),predefined:!0})),e.push({actionID:"selectLineStart",keyBinding:new d(36,null,!0),predefined:!0}),e.push({actionID:"selectLineEnd",keyBinding:new d(35,null,!0),predefined:!0}),e.push({actionID:"selectWordPrevious",
keyBinding:new d(37,!0,!0),predefined:!0}),e.push({actionID:"selectWordNext",keyBinding:new d(39,!0,!0),predefined:!0}),e.push({actionID:"selectTextStart",keyBinding:new d(36,!0,!0),predefined:!0}),e.push({actionID:"selectTextEnd",keyBinding:new d(35,!0,!0),predefined:!0}));e.push({actionID:"undo",keyBinding:new j.KeyBinding("z",!0),predefined:!0});k.isMac?e.push({actionID:"redo",keyBinding:new j.KeyBinding("z",!0,!0),predefined:!0}):e.push({actionID:"redo",keyBinding:new j.KeyBinding("y",!0),predefined:!0});
e.push({actionID:"deletePrevious",keyBinding:new d(8),predefined:!0});e.push({actionID:"deletePrevious",keyBinding:new d(8,null,!0),predefined:!0});e.push({actionID:"deleteNext",keyBinding:new d(46),predefined:!0});e.push({actionID:"deleteWordPrevious",keyBinding:new d(8,!0),predefined:!0});e.push({actionID:"deleteWordPrevious",keyBinding:new d(8,!0,!0),predefined:!0});e.push({actionID:"deleteWordNext",keyBinding:new d(46,!0),predefined:!0});e.push({actionID:"tab",keyBinding:new d(9),predefined:!0});
e.push({actionID:"shiftTab",keyBinding:new d(9,null,!0),predefined:!0});e.push({actionID:"enter",keyBinding:new d(13),predefined:!0});e.push({actionID:"enter",keyBinding:new d(13,null,!0),predefined:!0});e.push({actionID:"selectAll",keyBinding:new d("a",!0),predefined:!0});e.push({actionID:"toggleTabMode",keyBinding:new d("m",!0),predefined:!0});k.isMac&&(e.push({actionID:"deleteNext",keyBinding:new d(46,null,!0),predefined:!0}),e.push({actionID:"deleteWordPrevious",keyBinding:new d(8,null,null,!0),
predefined:!0}),e.push({actionID:"deleteWordNext",keyBinding:new d(46,null,null,!0),predefined:!0}));e.push({actionID:"toggleWrapMode",keyBinding:new j.KeyBinding("w",!0,!1,!0)});e.push({actionID:"toggleOverwriteMode",keyBinding:new j.KeyBinding(45)});if(!k.isFirefox){var c=k.isMac&&k.isChrome;e.push({actionID:"noop",keyBinding:new d("u",!c,!1,!1,c),predefined:!0});e.push({actionID:"noop",keyBinding:new d("i",!c,!1,!1,c),predefined:!0});e.push({actionID:"noop",keyBinding:new d("b",!c,!1,!1,c),predefined:!0})}k.isFirefox&&
(e.push({actionID:"copy",keyBinding:new d(45,!0),predefined:!0}),e.push({actionID:"paste",keyBinding:new d(45,null,!0),predefined:!0}),e.push({actionID:"cut",keyBinding:new d(46,null,!0),predefined:!0}));k.isMac&&(e.push({actionID:"lineStart",keyBinding:new d("a",!1,!1,!1,!0),predefined:!0}),e.push({actionID:"lineEnd",keyBinding:new d("e",!1,!1,!1,!0),predefined:!0}),e.push({actionID:"lineUp",keyBinding:new d("p",!1,!1,!1,!0),predefined:!0}),e.push({actionID:"lineDown",keyBinding:new d("n",!1,!1,
!1,!0),predefined:!0}),e.push({actionID:"charPrevious",keyBinding:new d("b",!1,!1,!1,!0),predefined:!0}),e.push({actionID:"charNext",keyBinding:new d("f",!1,!1,!1,!0),predefined:!0}),e.push({actionID:"deletePrevious",keyBinding:new d("h",!1,!1,!1,!0),predefined:!0}),e.push({actionID:"deleteNext",keyBinding:new d("d",!1,!1,!1,!0),predefined:!0}),e.push({actionID:"deleteLineEnd",keyBinding:new d("k",!1,!1,!1,!0),predefined:!0}),k.isFirefox?(e.push({actionID:"scrollPageDown",keyBinding:new d("v",!1,
!1,!1,!0),predefined:!0}),e.push({actionID:"deleteLineStart",keyBinding:new d("u",!1,!1,!1,!0),predefined:!0}),e.push({actionID:"deleteWordPrevious",keyBinding:new d("w",!1,!1,!1,!0),predefined:!0})):(e.push({actionID:"pageDown",keyBinding:new d("v",!1,!1,!1,!0),predefined:!0}),e.push({actionID:"centerLine",keyBinding:new d("l",!1,!1,!1,!0),predefined:!0}),e.push({actionID:"enterNoCursor",keyBinding:new d("o",!1,!1,!1,!0),predefined:!0})));return e};return{KeyMode:h,DefaultKeyMode:e}});
define("orion/editor/util",[],function(){return{contains:function(j,k){if(!k)return!1;if(!j.compareDocumentPosition){for(var h=k;h;){if(j===h)return!0;h=h.parentNode}return!1}return j===k||(j.compareDocumentPosition(k)&16)!==0},addEventListener:function(j,k,h,e){typeof j.addEventListener==="function"?j.addEventListener(k,h,e===!0):j.attachEvent("on"+k,h)},removeEventListener:function(j,k,h,e){typeof j.removeEventListener==="function"?j.removeEventListener(k,h,e===!0):j.detachEvent("on"+k,h)}}});
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,h,e,d,f,c){function a(b,a,d){if(d){a.className="";for(var d=a.attributes,e=d.length;e-- >0;)(!c.isIE||c.isIE>=9||c.isIE<9&&d[e].specified)&&a.removeAttribute(d[e].name)}if(b){if(b.styleClass)a.className=b.styleClass;if(d=b.style)for(var g in d)d.hasOwnProperty(g)&&(a.style[g]=d[g]);if(b=b.attributes)for(var f in b)b.hasOwnProperty(f)&&
a.setAttribute(f,b[f])}}function i(b){return b instanceof Array?b.slice(0):b}function g(b,a){if(!b)return a;if(!a)return b;for(var c in a)a.hasOwnProperty(c)&&(b.hasOwnProperty(c)||(b[c]=a[c]));return b}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 d=0;d<a.length;d++)if(!b(a[d],c[d]))return!1;
return!0}if(!(a instanceof Object)||!(c instanceof Object))return!1;for(d in a)if(a.hasOwnProperty(d)){if(!c.hasOwnProperty(d))return!1;if(!b(a[d],c[d]))return!1}for(d in c)if(!a.hasOwnProperty(d))return!1;return!0}function l(b,a,c){for(var d=0,e=0,g=0,f=b.length;g<f;){d!==-1&&d<=g&&(d=b.indexOf("\r",g));e!==-1&&e<=g&&(e=b.indexOf("\n",g));var l=g,i;if(e===-1&&d===-1){a(b.substring(g));break}d!==-1&&e!==-1?d+1===e?(i=d,g=e+1):(i=d<e?d:e,g=(d<e?d:e)+1):d!==-1?(i=d,g=d+1):(i=e,g=e+1);a(b.substring(l,
i));c()}}function n(b){var a,c,d,e,g=b.ownerDocument.defaultView||b.ownerDocument.parentWindow;if(g.getComputedStyle)b=g.getComputedStyle(b,null),a=b.getPropertyValue("padding-left"),c=b.getPropertyValue("padding-top"),d=b.getPropertyValue("padding-right"),e=b.getPropertyValue("padding-bottom");else if(b.currentStyle)a=b.currentStyle.paddingLeft,c=b.currentStyle.paddingTop,d=b.currentStyle.paddingRight,e=b.currentStyle.paddingBottom;return{left:parseInt(a,10)||0,top:parseInt(c,10)||0,right:parseInt(d,
10)||0,bottom:parseInt(e,10)||0}}function m(b){var a,c,d,e,g=b._trim;if(!g){var g=n(b),f=b.ownerDocument.defaultView||b.ownerDocument.parentWindow;if(f.getComputedStyle)e=f.getComputedStyle(b,null),a=e.getPropertyValue("border-left-width"),c=e.getPropertyValue("border-top-width"),d=e.getPropertyValue("border-right-width"),e=e.getPropertyValue("border-bottom-width");else if(b.currentStyle)a=b.currentStyle.borderLeftWidth,c=b.currentStyle.borderTopWidth,d=b.currentStyle.borderRightWidth,e=b.currentStyle.borderBottomWidth;
a=parseInt(a,10)||0;c=parseInt(c,10)||0;d=parseInt(d,10)||0;e=parseInt(e,10)||0;g.left+=a;g.top+=c;g.right+=d;g.bottom+=e;b._trim=g}return g}function o(b,a,c){this.start=b;this.end=a;this.caret=c}function t(b){this.left=b.left;this.top=b.top;this.right=b.right;this.bottom=b.bottom}function r(b,a,c){this.view=b;this.lineIndex=a;this._lineDiv=c}function s(b){this._init(b||{})}var v=f.addEventListener,w=f.removeEventListener,u=function(){function b(a){this.options=a}b.prototype.play=function(){var b=
typeof this.options.duration==="number"?this.options.duration:350,a=this.options.easing||this.defaultEasing,c=this.options.onAnimate||function(){},d=this.options.curve[0],e=this.options.curve[1],g=e-d,p=-1,f,l=this;this.interval=this.options.window.setInterval(function(){p=p===-1?(new Date).getTime():p;var i=((new Date).getTime()-p)/b;i<1?(i=a(i),f=d+i*g,c(f)):(c(e),l.stop())},typeof this.options.rate==="number"?this.options.rate:20)};b.prototype.stop=function(){this.options.window.clearInterval(this.interval);
(this.options.onEnd||function(){})()};b.prototype.defaultEasing=function(b){return Math.sin(b*(Math.PI/2))};return b}();o.prototype={clone:function(){return new o(this.start,this.end,this.caret)},collapse:function(){this.caret?this.end=this.start:this.start=this.end},extend:function(b){this.caret?this.start=b:this.end=b;if(this.start>this.end)b=this.start,this.start=this.end,this.end=b,this.caret=!this.caret},setCaret:function(b){this.end=this.start=b;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(b){return this.caret===b.caret&&this.start===b.start&&this.end===b.end}};t.prototype={toString:function(){return"{l="+this.left+", t="+this.top+", r="+this.right+", b="+this.bottom+"}"}};r.prototype={create:function(b,a){if(!this._lineDiv){var c=this._lineDiv=this._createLine(b,a,this.lineIndex);c._line=
this;return c}},_createLine:function(d,e,g){var f=this.view,l=f._model,i=l.getLine(g),h=l.getLineStart(g),n={type:"LineStyle",textView:f,lineIndex:g,lineText:i,lineStart:h};if(i.length<2E3)f.onLineStyle(n);l=e||c.createElement(d.ownerDocument,"div");if(!e||!b(e.viewStyle,n.style)){a(n.style,l,e);if(e)e._trim=null;l.viewStyle=n.style;l.setAttribute("role","presentation")}l.lineIndex=g;g=[];this._createRanges(n.ranges,i,0,i.length,h,{tabOffset:0,ranges:g});i=" ";!f._fullSelection&&c.isIE<9&&(i="\ufeff");
c.isWebkit&&(i="\u200c");n={text:i,style:f._metrics.largestFontStyle,ignoreChars:1};g.length===0||!g[g.length-1].style||g[g.length-1].style.tagName!=="div"?g.push(n):g.splice(g.length-1,0,n);var j,m,o,k,t,i=f=0,r,s;if(e){if(m=e.modelChangedEvent)m.removedLineCount===0&&m.addedLineCount===0?(s=m.start-h,r=m.addedCharCount-m.removedCharCount):s=-1,e.modelChangedEvent=void 0;m=e.firstChild}for(h=0;h<g.length;h++){n=g[h];k=n.text;f+=k.length;j=n.style;if(m)if(t=m.firstChild.data,o=m.viewStyle,t===k&&
b(j,o)){i+=t.length;m._rectsCache=void 0;j=m=m.nextSibling;continue}else for(;m;){if(s!==-1){o=f;o>=s&&(o-=r);t=(t=m.firstChild.data)?t.length:0;if(i+t>o)break;i+=t}o=m.nextSibling;l.removeChild(m);m=o}j=this._createSpan(l,k,j,n.ignoreChars);m?l.insertBefore(j,m):l.appendChild(j);if(e)e.lineWidth=void 0}if(e)for(d=j?j.nextSibling:null;d;)o=d.nextSibling,e.removeChild(d),d=o;else d.appendChild(l);return l},_createRanges:function(a,c,d,e,g,f){if(!(d>e)){if(a)for(var l=0;l<a.length;l++){var i=a[l];if(!(i.end<
g+d)){var h=Math.max(g+d,i.start)-g;if(h>e)break;var n=Math.min(g+e,i.end)-g;if(h<=n){h=Math.max(d,h);n=Math.min(e,n);d<h&&this._createRange(c,d,h,null,f);if(!i.style||!i.style.unmergeable)for(;l+1<a.length&&a[l+1].start-g===n&&b(i.style,a[l+1].style);)i=a[l+1],n=Math.min(g+e,i.end)-g,l++;this._createRange(c,h,n,i.style,f);d=n}}}d<e&&this._createRange(c,d,e,null,f)}},_createRange:function(b,a,c,d,e){if(!(a>c)){var g=this.view._customTabSize;if(g&&g!==8)for(var f=b.indexOf("\t",a);f!==-1&&f<c;){a<
f&&(a={text:b.substring(a,f),style:d},e.ranges.push(a),e.tabOffset+=a.text.length);a=g-e.tabOffset%g;if(a>0){for(var l="\u00a0",i=1;i<a;i++)l+=" ";a={text:l,style:d,ignoreChars:a-1};e.ranges.push(a);e.tabOffset+=a.text.length}a=f+1;if(a===c)return;f=b.indexOf("\t",a)}a<=c&&(a={text:b.substring(a,c),style:d},e.ranges.push(a),e.tabOffset+=a.text.length)}},_createSpan:function(b,d,e,g){var f=this.view,l="span";e&&e.tagName&&(l=e.tagName.toLowerCase());var i=l==="a";if(i)b.hasLink=!0;i&&!f._linksVisible&&
(l="span");i=b.ownerDocument;b=c.createElement(b.ownerDocument,l);e&&e.html?(b.innerHTML=e.html,b.ignore=!0):e&&e.node?(b.appendChild(e.node),b.ignore=!0):b.appendChild(i.createTextNode(e&&e.text?e.text:d));a(e,b);if(l==="a"){var h=f._getWindow();v(b,"click",function(b){return f._handleLinkClick(b?b:h.event)},!1)}b.viewStyle=e;if(g)b.ignoreChars=g;return b},_ensureCreated:function(){return this._lineDiv?this._lineDiv:this._createdDiv=this.create(this.view._clientDiv,null)},getBoundingClientRect:function(b,
a){var d=this._ensureCreated(),e=this.view;if(b===void 0)return this._getLineBoundingClientRect(d,!0);var g=e._model,f=d.ownerDocument,l=this.lineIndex,i=null;if(b<g.getLineEnd(l)){l=g.getLineStart(l);for(g=d.firstChild;g;){if(!g.ignore){var h=g.firstChild,n=h.length;g.ignoreChars&&(n-=g.ignoreChars);if(l+n>b){i=b-l;if(h.length===1)i=new t(g.getBoundingClientRect());else if(e._isRangeRects)f=f.createRange(),f.setStart(h,i),f.setEnd(h,i+1),i=new t(f.getBoundingClientRect());else if(c.isIE){if(f=f.body.createTextRange(),
f.moveToElementText(g),f.collapse(),(l=i===0&&c.isIE===8)&&(i=1),f.moveEnd("character",i+1),f.moveStart("character",i),i=new t(f.getBoundingClientRect()),l)i.left=g.getClientRects()[0].left}else{var m=h.data;g.removeChild(h);g.appendChild(f.createTextNode(m.substring(0,i)));var j=c.createElement(f,"span");j.appendChild(f.createTextNode(m.substring(i,i+1)));g.appendChild(j);g.appendChild(f.createTextNode(m.substring(i+1)));i=new t(j.getBoundingClientRect());g.innerHTML="";g.appendChild(h);this._createdDiv||
(f=e._getSelection(),(l<=f.start&&f.start<l+n||l<=f.end&&f.end<l+n)&&e._updateDOMSelection())}c.isIE&&(f=d.ownerDocument.defaultView||d.ownerDocument.parentWindow,d=f.screen.logicalXDPI/f.screen.deviceXDPI,f=f.screen.logicalYDPI/f.screen.deviceYDPI,i.left*=d,i.right*=d,i.top*=f,i.bottom*=f);break}l+=n}g=g.nextSibling}}d=this.getBoundingClientRect();if(!i)e._wrapMode?(e=this.getClientRects(),i=e[e.length-1],i.left=i.right,i.left+=d.left,i.top+=d.top,i.right+=d.left,i.bottom+=d.top):(i=new t(d),i.left=
i.right);if(a||a===void 0)i.left-=d.left,i.top-=d.top,i.right-=d.left,i.bottom-=d.top;return i},_getClientRects:function(b,a){var c,d,e,g;if(!b._rectsCache){c=b.getClientRects();d=Array(c.length);for(g=0;g<c.length;g++)e=d[g]=new t(c[g]),e.left-=a.left,e.top-=a.top,e.right-=a.left,e.bottom-=a.top;b._rectsCache=d}c=b._rectsCache;d=[c.length];for(g=0;g<c.length;g++)d[g]=new t(c[g]);return d},getClientRects:function(b){if(!this.view._wrapMode)return[this.getBoundingClientRect()];for(var a=this._ensureCreated(),
c=[],d=a.firstChild,e,g=a.getBoundingClientRect();d;){if(!d.ignore)for(var f=this._getClientRects(d,g),a=0;a<f.length;a++){var l=f[a],i;if(l.top!==l.bottom){var h=l.top+(l.bottom-l.top)/2;for(i=0;i<c.length;i++)if(e=c[i],e.top<=h&&h<e.bottom)break;if(i===c.length)c.push(l);else{if(l.left<e.left)e.left=l.left;if(l.top<e.top)e.top=l.top;if(l.right>e.right)e.right=l.right;if(l.bottom>e.bottom)e.bottom=l.bottom}}}d=d.nextSibling}return b!==void 0?c[b]:c},_getLineBoundingClientRect:function(b,a){var c=
new t(b.getBoundingClientRect());if(!this.view._wrapMode){c.right=c.left;for(var d=b.lastChild;d&&d.ignoreChars===d.firstChild.length;)d=d.previousSibling;if(d)d=d.getBoundingClientRect(),c.right=d.right+m(b).right}a&&(d=m(b),c.left+=d.left,c.right-=d.right);return c},getLineCount:function(){return!this.view._wrapMode?1:this.getClientRects().length},getLineIndex:function(b){if(!this.view._wrapMode)return 0;for(var a=this.getClientRects(),b=this.getBoundingClientRect(b),b=b.top+(b.bottom-b.top)/2,
c=0;c<a.length;c++)if(a[c].top<=b&&b<a[c].bottom)return c;return a.length-1},getLineStart:function(b){if(!this.view._wrapMode||b===0)return this.view._model.getLineStart(b);var a=this.getClientRects();return this.getOffset(a[b].left+1,a[b].top+1)},getOffset:function(b,a){var d=this.view,e=d._model,g=this.lineIndex,f=e.getLineStart(g),l=e.getLineEnd(g);if(f===l)return f;var i=this._ensureCreated(),h=this.getBoundingClientRect(),n,m;if(d._wrapMode){n=this.getClientRects();if(a<n[0].top)a=n[0].top;for(var j=
0;j<n.length;j++)if(m=n[j],m.top<=a&&a<m.bottom)break;if(b<m.left)b=m.left;b>m.right&&(b=m.right-1)}else b<0&&(b=0),b>h.right-h.left&&(b=h.right-h.left);var o=i.ownerDocument,j=o.defaultView||o.parentWindow,k=c.isIE?j.screen.logicalXDPI/j.screen.deviceXDPI:1,t=c.isIE?j.screen.logicalYDPI/j.screen.deviceYDPI:1,j=f,r=i.firstChild;a:for(;r;){if(!r.ignore){var s=r.firstChild,i=s.length;r.ignoreChars&&(i-=r.ignoreChars);var v,w,u;n=this._getClientRects(r,h);for(var L=0;L<n.length;L++)if(m=n[L],m.left<=
b&&b<m.right&&(!d._wrapMode||m.top<=a&&a<m.bottom)){var L=m.left+h.left,C;if(c.isIE||d._isRangeRects){for(var o=d._isRangeRects?o.createRange():o.body.createTextRange(),D=i,I=-1;D-I>1;){var R=Math.floor((D+I)/2);n=I+1;m=R===i-1&&r.ignoreChars?s.length:R+1;C=n===0&&c.isIE===8;d._isRangeRects?(o.setStart(s,n),o.setEnd(s,m)):(C&&(n=1),o.moveToElementText(r),o.move("character",n),o.moveEnd("character",m-n));n=o.getClientRects();for(var M=!1,Q=0;Q<n.length;Q++)if(m=n[Q],v=(C?L:m.left)*k-h.left,u=m.right*
k-h.left,w=m.top*t-h.top,m=m.bottom*t-h.top,v<=b&&b<u&&(!d._wrapMode||w<=a&&a<m)){M=!0;break}M?D=R:I=R}j+=D;n=D;m=D===i-1&&r.ignoreChars?s.length:Math.min(D+1,s.length);d._isRangeRects?(o.setStart(s,n),o.setEnd(s,m)):(o.moveToElementText(r),o.move("character",n),o.moveEnd("character",m-n));n=o.getClientRects();d=!1;n.length>0&&(m=n[0],v=(C?L:m.left)*k-h.left,u=m.right*k-h.left,d=b>v+(u-v)/2);h=j-f;e=e.getLine(g);g=e.charCodeAt(h);55296<=g&&g<=56319&&d?h<e.length&&(g=e.charCodeAt(h+1),56320<=g&&g<=
57343&&(j+=1)):56320<=g&&g<=57343&&!d&&h>0&&(g=e.charCodeAt(h-1),55296<=g&&g<=56319&&(j-=1));d&&j++}else{e=[];for(g=0;g<i;g++)e.push("<span>"),g===i-1?e.push(s.data.substring(g)):e.push(s.data.substring(g,g+1)),e.push("</span>");r.innerHTML=e.join("");for(e=r.firstChild;e;){m=e.getBoundingClientRect();v=m.left-h.left;u=m.right-h.left;if(v<=b&&b<u){b>v+(u-v)/2&&j++;break}j++;e=e.nextSibling}if(!this._createdDiv)r.innerHTML="",r.appendChild(s),h=d._getSelection(),(j<=h.start&&h.start<j+i||j<=h.end&&
h.end<j+i)&&d._updateDOMSelection()}break a}j+=i}r=r.nextSibling}return Math.min(l,Math.max(f,j))},getNextOffset:function(b,a){if(a.unit==="line"){var d=this.view._model,e=d.getLineAtOffset(b);if(a.count>0)return a.count--,d.getLineEnd(e);a.count++;return d.getLineStart(e)}return a.unit==="wordend"||a.unit==="wordWS"||a.unit==="wordendWS"?this._getNextOffset_W3C(b,a):c.isIE?this._getNextOffset_IE(b,a):this._getNextOffset_W3C(b,a)},_getNextOffset_W3C:function(b,a){function c(b){return 33<=b&&b<=47||
58<=b&&b<=64||91<=b&&b<=94||b===96||123<=b&&b<=126}function d(b){return b===32||b===9}var e=this.view._model,g=e.getLineAtOffset(b),f=e.getLine(g),i=e.getLineStart(g),e=e.getLineEnd(g),g=f.length,l=b-i,h,n=a.count<0?-1:1;if(a.unit==="word"||a.unit==="wordend"||a.unit==="wordWS"||a.unit==="wordendWS")for(var m,j,o;a.count!==0;){if(a.count>0){if(l===g)return e;h=f.charCodeAt(l);m=c(h);j=!m&&!d(h);for(l++;l<g;){h=f.charCodeAt(l);if(a.unit!=="wordWS"&&a.unit!=="wordendWS"){o=c(h);if(a.unit==="wordend"){if(!o&&
m)break}else if(o&&!m)break;h=!o&&!d(h)}else h=!d(h);if(a.unit==="wordend"||a.unit==="wordendWS"){if(!h&&j)break}else if(h&&!j)break;j=h;m=o;l++}}else{if(l===0)return i;l--;h=f.charCodeAt(l);m=c(h);for(j=!m&&!d(h);0<l;){h=f.charCodeAt(l-1);if(a.unit!=="wordWS"&&a.unit!=="wordendWS"){o=c(h);if(a.unit==="wordend"){if(o&&!m)break}else if(!o&&m)break;h=!o&&!d(h)}else h=!d(h);if(a.unit==="wordend"||a.unit==="wordendWS"){if(h&&!j)break}else if(!h&&j)break;j=h;m=o;l--}}a.count-=n}else for(;a.count!==0&&
0<=l+n&&l+n<=g;)l+=n,h=f.charCodeAt(l),56320<=h&&h<=57343&&l>0&&(h=f.charCodeAt(l-1),55296<=h&&h<=56319&&(l+=n)),a.count-=n;return i+l},_getNextOffset_IE:function(b,a){var c=this._ensureCreated(),d=this.view._model,e=this.lineIndex,g=0,f;f=d.getLineStart(e);var l=c.ownerDocument,i=a.count<0?-1:1;if(b===d.getLineEnd(e)){for(c=c.lastChild;c&&c.ignoreChars===c.firstChild.length;)c=c.previousSibling;if(!c)return f;g=l.body.createTextRange();g.moveToElementText(c);f=g.text.length;g.moveEnd(a.unit,i);g=
b+g.text.length-f}else if(b===f&&a.count<0)g=f;else for(c=c.firstChild;c;){d=c.firstChild.length;c.ignoreChars&&(d-=c.ignoreChars);if(f+d>b){g=l.body.createTextRange();b===f&&a.count<0?g.moveToElementText(c.previousSibling):(g.moveToElementText(c),g.collapse(),g.moveEnd("character",b-f));f=g.text.length;g.moveEnd(a.unit,i);g=b+g.text.length-f;break}f=d+f;c=c.nextSibling}a.count-=i;return g},destroy:function(){var b=this._createdDiv;if(b)b.parentNode.removeChild(b),this._createdDiv=null}};s.prototype=
{addKeyMode:function(b,a){var c=this._keyModes;a!==void 0?c.splice(a,0,b):c.push(b);b._modeAdded&&b._modeAdded()},addRuler:function(b,a){b.setView(this);var c=this._rulers;if(a!==void 0){var d,e;for(d=0,e=0;d<c.length&&e<a;d++)b.getLocation()===c[d].getLocation()&&e++;c.splice(e,0,b);a=e}else c.push(b);this._createRuler(b,a);this._update()},computeSize:function(){var b=0,a=0,d=this._model,e=this._clientDiv;if(!e)return{width:b,height:a};var g=e.style.width;if(c.isWebkit)e.style.width="0x7fffffffpx";
for(var d=d.getLineCount(),f=0;f<d;f++){var l=this._getLine(f),i=l.getBoundingClientRect(),b=Math.max(b,i.right-i.left);a+=i.bottom-i.top;l.destroy()}if(c.isWebkit)e.style.width=g;e=this._getViewPadding();b+=e.right+e.left+this._metrics.scrollWidth;a+=e.bottom+e.top+this._metrics.scrollWidth;return{width:b,height:a}},convert:function(b,a,c){if(this._clientDiv){var d=this._getScroll(),e=this._getViewPadding(),g=this._viewDiv.getBoundingClientRect();a==="document"&&(b.x!==void 0&&(b.x+=-d.x+g.left+
e.left),b.y!==void 0&&(b.y+=-d.y+g.top+e.top));c==="document"&&(b.x!==void 0&&(b.x+=d.x-g.left-e.left),b.y!==void 0&&(b.y+=d.y-g.top-e.top));return b}},destroy:function(){for(var b=0;b<this._rulers.length;b++)this._rulers[b].setView(null);this.rulers=null;this._destroyView();this.onDestroy({type:"Destroy"});this._actions=this._keyModes=this._doubleClickSelection=this._selection=this._theme=this._model=this._parent=null},focus:function(){this._clientDiv&&(this._updateDOMSelection(),this._clientDiv.focus(),
this._updateDOMSelection())},hasFocus:function(){return this._hasFocus},getActionDescription:function(b){if(b=this._actions[b])return b.actionDescription},getActions:function(b){var a=[],c=this._actions,d;for(d in c)c.hasOwnProperty(d)&&(b||!c[d].defaultHandler)&&a.push(d);return a},getBottomIndex:function(b){return!this._clientDiv?0:this._getBottomIndex(b)},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 b=this._getScroll();return{x:b.x,y:b.y,width:this._getClientWidth(),height:this._getClientHeight()}},getHorizontalPixel:function(){return!this._clientDiv?0:this._getScroll().x},getKeyBindings:function(b){for(var a=[],c=this._keyModes,d=0;d<c.length;d++)a=a.concat(c[d].getKeyBindings(b));return a},getKeyModes:function(){return this._keyModes.slice(0)},getLineHeight:function(b){return!this._clientDiv?0:this._getLineHeight(b)},
getLineIndex:function(b){return!this._clientDiv?0:this._getLineIndex(b)},getLinePixel:function(b){return!this._clientDiv?0:this._getLinePixel(b)},getLocationAtOffset:function(b){if(!this._clientDiv)return{x:0,y:0};var a=this._model,b=Math.min(Math.max(0,b),a.getCharCount()),a=a.getLineAtOffset(b),c=this._getLine(a),b=c.getBoundingClientRect(b);c.destroy();c=b.left;a=this._getLinePixel(a)+b.top;return{x:c,y:a}},getNextOffset:function(b,a){var c=new o(b,b,!1);this._doMove(a,c);return c.getCaret()},
getOptions:function(){var b;if(arguments.length===0)b=this._defaultOptions();else if(arguments.length===1){if(b=arguments[0],typeof b==="string")return i(this["_"+b])}else{b={};for(var a in arguments)arguments.hasOwnProperty(a)&&(b[arguments[a]]=void 0)}for(var c in b)b.hasOwnProperty(c)&&(b[c]=i(this["_"+c]));return b},getModel:function(){return this._model},getOffsetAtLocation:function(b,a){if(!this._clientDiv)return 0;var c=this._getLineIndex(a),d=this._getLine(c),c=d.getOffset(b,a-this._getLinePixel(c));
d.destroy();return c},getRulers:function(){return this._rulers.slice(0)},getSelection:function(){var b=this._getSelection();return{start:b.start,end:b.end}},getText:function(b,a){return this._model.getText(b,a)},getTopIndex:function(b){return!this._clientDiv?0:this._getTopIndex(b)},getTopPixel:function(){return!this._clientDiv?0:this._getScroll().y},invokeAction:function(b,a,c){if(this._clientDiv){if(b=this._actions[b]){if(!a&&b.handler&&b.handler(c))return!0;if(b.defaultHandler)return typeof b.defaultHandler(c)===
"boolean"}return!1}},isDestroyed:function(){return!this._clientDiv},onContextMenu:function(b){return this.dispatchEvent(b)},onDragStart:function(b){return this.dispatchEvent(b)},onDrag:function(b){return this.dispatchEvent(b)},onDragEnd:function(b){return this.dispatchEvent(b)},onDragEnter:function(b){return this.dispatchEvent(b)},onDragOver:function(b){return this.dispatchEvent(b)},onDragLeave:function(b){return this.dispatchEvent(b)},onDrop:function(b){return this.dispatchEvent(b)},onDestroy:function(b){return this.dispatchEvent(b)},
onLineStyle:function(b){return this.dispatchEvent(b)},onKeyDown:function(b){return this.dispatchEvent(b)},onKeyPress:function(b){return this.dispatchEvent(b)},onKeyUp:function(b){return this.dispatchEvent(b)},onModelChanged:function(b){return this.dispatchEvent(b)},onModelChanging:function(b){return this.dispatchEvent(b)},onModify:function(b){return this.dispatchEvent(b)},onMouseDown:function(b){return this.dispatchEvent(b)},onMouseUp:function(b){return this.dispatchEvent(b)},onMouseMove:function(b){return this.dispatchEvent(b)},
onMouseOver:function(b){return this.dispatchEvent(b)},onMouseOut:function(b){return this.dispatchEvent(b)},onSelection:function(b){return this.dispatchEvent(b)},onScroll:function(b){return this.dispatchEvent(b)},onVerify:function(b){return this.dispatchEvent(b)},onFocus:function(b){return this.dispatchEvent(b)},onBlur:function(b){return this.dispatchEvent(b)},redraw:function(){if(!(this._redrawCount>0)){var b=this._model.getLineCount();this.redrawRulers(0,b);this.redrawLines(0,b)}},redrawRulers:function(b,
a){if(!(this._redrawCount>0))for(var c=this.getRulers(),d=0;d<c.length;d++)this.redrawLines(b,a,c[d])},redrawLines:function(b,a,c){if(!(this._redrawCount>0)&&(b===void 0&&(b=0),a===void 0&&(a=this._model.getLineCount()),b!==a)){var d=this._clientDiv;if(d){if(c)for(d=this._getRulerParent(c).firstChild;d;){if(d._ruler===c)break;d=d.nextSibling}c?d.rulerChanged=!0:this._lineHeight&&this._resetLineHeight(b,a);if(!c||c.getOverview()==="page")for(d=d.firstChild;d;){var e=d.lineIndex;if(b<=e&&e<a)d.lineChanged=
!0;d=d.nextSibling}if(!c&&!this._wrapMode&&b<=this._maxLineIndex&&this._maxLineIndex<a)this._checkMaxLineIndex=this._maxLineIndex,this._maxLineIndex=-1,this._maxLineWidth=0;this._queueUpdate()}}},redrawRange:function(b,a){if(!(this._redrawCount>0)){var c=this._model;b===void 0&&(b=0);a===void 0&&(a=c.getCharCount());var d=c.getLineAtOffset(b),c=c.getLineAtOffset(Math.max(b,a-1))+1;this.redrawLines(d,c)}},removeKeyMode:function(b){for(var a=this._keyModes,c=0;c<a.length;c++)if(a[c]===b){a.splice(c,
1);break}b._modeRemoved&&b._modeRemoved()},removeRuler:function(b){for(var a=this._rulers,c=0;c<a.length;c++)if(a[c]===b){a.splice(c,1);b.setView(null);this._destroyRuler(b);this._update();break}},resize:function(){this._clientDiv&&this._handleResize(null)},setAction:function(b,a,c){if(b){var d=this._actions,e=d[b];e||(e=d[b]={});e.handler=a;if(c!==void 0)e.actionDescription=c}},setKeyBinding:function(b,a){this._keyModes[0].setKeyBinding(b,a)},setCaretOffset:function(b,a,c){var d=this._model.getCharCount(),
b=Math.max(0,Math.min(b,d));this._setSelection(new o(b,b,!1),a===void 0||a,!0,c)},setHorizontalPixel:function(b){this._clientDiv&&(b=Math.max(0,b),this._scrollView(b-this._getScroll().x,0))},setRedraw:function(b){b?--this._redrawCount===0&&this.redraw():this._redrawCount++},setModel:function(b){if(b&&b!==this._model){this._model.removeEventListener("preChanging",this._modelListener.onChanging);this._model.removeEventListener("postChanged",this._modelListener.onChanged);var a=this._model.getLineCount(),
c=this._model.getCharCount(),d=b.getLineCount(),e=b.getCharCount(),g={type:"ModelChanging",text:b.getText(),start:0,removedCharCount:c,addedCharCount:e,removedLineCount:a,addedLineCount:d};this.onModelChanging(g);this._model=b;g={type:"ModelChanged",start:0,removedCharCount:c,addedCharCount:e,removedLineCount:a,addedLineCount:d};this.onModelChanged(g);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(),d;for(d in a)if(a.hasOwnProperty(d)){var e=a[d];if(!b(this["_"+d],e)){var g=c[d]?c[d].update:null;g?g.call(this,e):this["_"+d]=i(e)}}},setSelection:function(b,a,c,d){var e=b>a;if(e)var g=b,b=a,a=g;g=this._model.getCharCount();b=Math.max(0,Math.min(b,g));a=Math.max(0,Math.min(a,g));this._setSelection(new o(b,a,e),c===void 0||c,!0,d)},setText:function(b,a,d){var e=a===void 0&&d===void 0;a===void 0&&(a=0);d===void 0&&
(d=this._model.getCharCount());if(e)this._variableLineHeight=!1;this._modifyContent({text:b,start:a,end:d,_code:!0},!e);if(e)this._columnX=-1,this._setSelection(new o(0,0,!1),!0),c.isFirefox&&this._fixCaret()},setTopIndex:function(b){this._clientDiv&&this._scrollView(0,this._getLinePixel(Math.max(0,b))-this._getScroll().y)},setTopPixel:function(b){this._clientDiv&&this._scrollView(0,Math.max(0,b)-this._getScroll().y)},showSelection:function(){return this._showCaret(!0)},update:function(b,a){this._clientDiv&&
(b&&this._updateStyle(),a===void 0||a?this._update():this._queueUpdate())},_handleRootMouseDown:function(b){if(!this._ignoreEvent(b)){if(c.isFirefox&&b.which===1)this._clientDiv.contentEditable=!1,this._ignoreBlur=(this._overlayDiv||this._clientDiv).draggable=!0;var a=this._overlayDiv||this._clientDiv;if(c.isIE<9)a=this._viewDiv;for(var d=b.target?b.target:b.srcElement;d;){if(a===d)return;d=d.parentNode}b.preventDefault&&b.preventDefault();b.stopPropagation&&b.stopPropagation();if(!this._isW3CEvents){var e=
this;this._getWindow().setTimeout(function(){e._clientDiv.focus()},0)}}},_handleRootMouseUp:function(b){if(!this._ignoreEvent(b)&&c.isFirefox&&b.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(c.isIE<9&&!this._getSelection().isEmpty()){var b=this._rootDiv,a=c.createElement(b.ownerDocument,"div");b.appendChild(a);b.removeChild(a)}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",b=this._getWindow(),a=this._selDiv1.ownerDocument,b.getSelection){a=b.getSelection();for(b=a.anchorNode;b;){if(b===this._clientDiv){a.rangeCount>0&&a.removeAllRanges();break}b=b.parentNode}}else if(a.selection){this._ignoreSelect=!1;for(b=a.selection.createRange().parentElement();b;){if(b===this._clientDiv){a.selection.empty();break}b=b.parentNode}this._ignoreSelect=
!0}if(!this._ignoreFocus)this.onBlur({type:"Blur"})}},_handleContextMenu:function(b){if(!this._ignoreEvent(b)){c.isIE&&this._lastMouseButton===3&&this._updateDOMSelection();var a=!1;this.isListening("ContextMenu")?(a=this._createMouseEvent("ContextMenu",b),a.screenX=b.screenX,a.screenY=b.screenY,this.onContextMenu(a),a=a.defaultPrevented):c.isMac&&c.isFirefox&&b.button===0&&(a=!0);if(a)return b.preventDefault&&b.preventDefault(),!1}},_handleCopy:function(b){if(!this._ignoreEvent(b)&&!this._ignoreCopy&&
this._doCopy(b))return b.preventDefault&&b.preventDefault(),!1},_handleCut:function(b){if(!this._ignoreEvent(b)&&this._doCut(b))return b.preventDefault&&b.preventDefault(),!1},_handleDataModified:function(b){this._ignoreEvent(b)||this._startIME()},_handleDblclick:function(b){if(!this._ignoreEvent(b)&&(this._lastMouseTime=b.timeStamp?b.timeStamp:(new Date).getTime(),this._clickCount!==2))this._clickCount=2,this._handleMouse(b)},_handleDragStart:function(b){if(!this._ignoreEvent(b)){if(c.isFirefox){var a=
this;this._getWindow().setTimeout(function(){a._clientDiv.contentEditable=!0;a._clientDiv.draggable=!1;a._ignoreBlur=!1},0)}if(this.isListening("DragStart")&&this._dragOffset!==-1)this._isMouseDown=!1,this.onDragStart(this._createMouseEvent("DragStart",b)),this._dragOffset=-1;else return b.preventDefault&&b.preventDefault(),!1}},_handleDrag:function(b){if(!this._ignoreEvent(b)&&this.isListening("Drag"))this.onDrag(this._createMouseEvent("Drag",b))},_handleDragEnd:function(b){if(!this._ignoreEvent(b)){this._dropTarget=
!1;this._dragOffset=-1;if(this.isListening("DragEnd"))this.onDragEnd(this._createMouseEvent("DragEnd",b));c.isFirefox&&(this._fixCaret(),b.dataTransfer.dropEffect==="none"&&!b.dataTransfer.mozUserCancelled&&this._fixCaret())}},_handleDragEnter:function(b){if(!this._ignoreEvent(b)){var a=!0;this._dropTarget=!0;this.isListening("DragEnter")&&(a=!1,this.onDragEnter(this._createMouseEvent("DragEnter",b)));if(c.isWebkit||a)return b.preventDefault&&b.preventDefault(),!1}},_handleDragOver:function(b){if(!this._ignoreEvent(b)){var a=
!0;this.isListening("DragOver")&&(a=!1,this.onDragOver(this._createMouseEvent("DragOver",b)));if(c.isWebkit||a){if(a)b.dataTransfer.dropEffect="none";b.preventDefault&&b.preventDefault();return!1}}},_handleDragLeave:function(b){if(!this._ignoreEvent(b)&&(this._dropTarget=!1,this.isListening("DragLeave")))this.onDragLeave(this._createMouseEvent("DragLeave",b))},_handleDrop:function(b){if(!this._ignoreEvent(b)){this._dropTarget=!1;if(this.isListening("Drop"))this.onDrop(this._createMouseEvent("Drop",
b));b.preventDefault&&b.preventDefault();return!1}},_handleFocus:function(){this._hasFocus=!0;c.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 b=this._highlightRGB;this._selDiv1.style.background=b;this._selDiv2.style.background=b;this._selDiv3.style.background=b}if(!this._ignoreFocus)this.onFocus({type:"Focus"})},_handleKeyDown:function(b){if(!this._ignoreEvent(b)){if(this.isListening("KeyDown")){var a=
this._createKeyEvent("KeyDown",b);this.onKeyDown(a);if(a.defaultPrevented){if(c.isFirefox)this._keyDownPrevented=!0;b.preventDefault();return}}a=!1;switch(b.keyCode){case 16:case 17:case 18:case 91:a=!0;break;default:this._setLinksVisible(!1)}if(b.keyCode===229){if(this._readonly)return b.preventDefault&&b.preventDefault(),!1;a=!0;if(c.isSafari&&c.isMac&&b.ctrlKey)a=!1,b.keyCode=129;a&&this._startIME()}else a||this._commitIME();if((c.isMac||c.isLinux)&&c.isFirefox<4||c.isOpera)return this._keyDownEvent=
b,!0;if(this._doAction(b))return b.preventDefault?(b.preventDefault(),b.stopPropagation()):(b.cancelBubble=!0,b.returnValue=!1,b.keyCode=0),!1}},_handleKeyPress:function(b){if(!this._ignoreEvent(b))if(this._keyDownPrevented)b.preventDefault&&(b.preventDefault(),b.stopPropagation()),this._keyDownPrevented=void 0;else{if(c.isMac&&c.isWebkit&&(63232<=b.keyCode&&b.keyCode<=63487||b.keyCode===13||b.keyCode===8))return b.preventDefault&&b.preventDefault(),!1;if(((c.isMac||c.isLinux)&&c.isFirefox<4||c.isOpera)&&
this._doAction(this._keyDownEvent))return b.preventDefault&&b.preventDefault(),!1;var a=c.isMac?b.metaKey:b.ctrlKey;if(b.charCode!==void 0&&a)switch(b.charCode){case 99:case 118:case 120:return!0}if(this.isListening("KeyPress")&&(a=this._createKeyEvent("KeyPress",b),this.onKeyPress(a),a.defaultPrevented)){b.preventDefault();return}if(this._doAction(b))return b.preventDefault?(b.preventDefault(),b.stopPropagation()):(b.cancelBubble=!0,b.returnValue=!1,b.keyCode=0),!1;a=!1;if(c.isMac){if(b.ctrlKey||
b.metaKey)a=!0}else if(c.isFirefox){if(b.ctrlKey||b.altKey)a=!0}else b.ctrlKey^b.altKey&&(a=!0);if(!a&&(a=c.isOpera?b.which:b.charCode!==void 0?b.charCode:b.keyCode,a>31))return this._doContent(String.fromCharCode(a)),b.preventDefault&&b.preventDefault(),!1}},_handleDocKeyUp:function(b){(c.isMac?b.metaKey:b.ctrlKey)||this._setLinksVisible(!1)},_handleKeyUp:function(b){if(!this._ignoreEvent(b)){if(this.isListening("KeyUp")){var a=this._createKeyEvent("KeyUp",b);this.onKeyUp(a);if(a.defaultPrevented){b.preventDefault();
return}}this._handleDocKeyUp(b);b.keyCode===13&&this._commitIME()}},_handleLinkClick:function(b){if(!(c.isMac?b.metaKey:b.ctrlKey))return b.preventDefault&&b.preventDefault(),!1},_handleMouse:function(b){var a=this._getWindow(),d=!0,e=a;if(c.isIE||c.isFirefox&&!this._overlayDiv)e=this._clientDiv;if(this._overlayDiv){if(this._hasFocus)this._ignoreFocus=!0;var g=this;a.setTimeout(function(){g.focus();g._ignoreFocus=!1},0)}this._clickCount===1?(d=this._setSelectionTo(b.clientX,b.clientY,b.shiftKey,!c.isOpera&&
this._hasFocus&&this.isListening("DragStart")))&&this._setGrab(e):(this._isW3CEvents&&this._setGrab(e),this._doubleClickSelection=null,this._setSelectionTo(b.clientX,b.clientY,b.shiftKey),this._doubleClickSelection=this._getSelection());return d},_handleMouseDown:function(b){if(!this._ignoreEvent(b)){if(this._linksVisible)if((b.target||b.srcElement).tagName!=="A")this._setLinksVisible(!1);else return;this._commitIME();var a=b.which;a||(b.button===4&&(a=2),b.button===2&&(a=3),b.button===1&&(a=1));
var d=a!==2&&b.timeStamp?b.timeStamp:(new Date).getTime(),e=d-this._lastMouseTime,g=Math.abs(this._lastMouseX-b.clientX),f=Math.abs(this._lastMouseY-b.clientY),l=this._lastMouseButton===a;this._lastMouseX=b.clientX;this._lastMouseY=b.clientY;this._lastMouseTime=d;this._lastMouseButton=a;if(a===1)this._isMouseDown=!0,l&&e<=this._clickTime&&g<=this._clickDist&&f<=this._clickDist?this._clickCount++:this._clickCount=1;if(this.isListening("MouseDown")&&(d=this._createMouseEvent("MouseDown",b),this.onMouseDown(d),
d.defaultPrevented)){b.preventDefault();return}if(a===1&&this._handleMouse(b)&&(c.isIE>=9||c.isOpera||c.isChrome||c.isSafari||c.isFirefox&&!this._overlayDiv))this._hasFocus||this.focus(),b.preventDefault();c.isFirefox&&this._lastMouseButton===3&&this._updateDOMSelection()}},_handleMouseOver:function(b){if(!this._ignoreEvent(b)&&!this._animation&&this.isListening("MouseOver"))this.onMouseOver(this._createMouseEvent("MouseOver",b))},_handleMouseOut:function(b){if(!this._ignoreEvent(b)&&!this._animation&&
this.isListening("MouseOut"))this.onMouseOut(this._createMouseEvent("MouseOut",b))},_handleMouseMove:function(b){if(!this._animation){var a=this._isClientDiv(b);if(this.isListening("MouseMove")&&a)this.onMouseMove(this._createMouseEvent("MouseMove",b));if(!this._dropTarget){var d=this._linksVisible||this._lastMouseMoveX!==b.clientX||this._lastMouseMoveY!==b.clientY;this._lastMouseMoveX=b.clientX;this._lastMouseMoveY=b.clientY;this._setLinksVisible(d&&!this._isMouseDown&&(c.isMac?b.metaKey:b.ctrlKey));
if(!this._isW3CEvents){if(b.button===0)return this._setGrab(null),!0;if(!this._isMouseDown&&b.button===1&&(this._clickCount&1)!==0&&a)return this._clickCount=2,this._handleMouse(b,this._clickCount)}if(this._isMouseDown&&this._dragOffset===-1){var a=b.clientX,b=b.clientY,e=this._getViewPadding(),g=this._viewDiv.getBoundingClientRect(),f=this._getClientWidth(),l=this._getClientHeight(),d=g.left+e.left,i=g.top+e.top,f=g.left+e.left+f,e=g.top+e.top+l;b<i?this._doAutoScroll("up",a,b-i):b>e?this._doAutoScroll("down",
a,b-e):a<d&&!this._wrapMode?this._doAutoScroll("left",a-d,b):a>f&&!this._wrapMode?this._doAutoScroll("right",a-f,b):(this._endAutoScroll(),this._setSelectionTo(a,b,!0))}}}},_isClientDiv:function(b){for(var a=this._overlayDiv||this._clientDiv,b=b.target?b.target:b.srcElement;b;){if(a===b)return!0;b=b.parentNode}return!1},_createKeyEvent:function(b,a){return{type:b,event:a,preventDefault:function(){this.defaultPrevented=!0}}},_createMouseEvent:function(b,a){var c=this.convert({x:a.clientX,y:a.clientY},
"page","document");return{type:b,event:a,clickCount:this._clickCount,x:c.x,y:c.y,preventDefault:function(){this.defaultPrevented=!0}}},_handleMouseUp:function(b){var a=b.which?b.button===0:b.button===1;if(this.isListening("MouseUp")&&(this._isClientDiv(b)||a&&this._isMouseDown))this.onMouseUp(this._createMouseEvent("MouseUp",b));if(!this._linksVisible&&a&&this._isMouseDown){if(this._dragOffset!==-1)a=this._getSelection(),a.extend(this._dragOffset),a.collapse(),this._setSelection(a,!0,!0),this._dragOffset=
-1;this._isMouseDown=!1;this._endAutoScroll();this._isW3CEvents&&this._setGrab(null);c.isFirefox&&b.preventDefault()}},_handleMouseWheel:function(b){var a=this._getLineHeight(),d=0,e=0;c.isIE||c.isOpera?e=-b.wheelDelta/40*a:c.isFirefox?(a=c.isMac?b.detail*3:Math.max(-256,Math.min(256,b.detail))*a,b.axis===b.HORIZONTAL_AXIS?d=a:e=a):c.isMac?(e=b.timeStamp-this._wheelTimeStamp,this._wheelTimeStamp=b.timeStamp,d=b.wheelDeltaX%120!==0?1:e<40?40/(40-e):40,e=b.wheelDeltaY%120!==0?1:e<40?40/(40-e):40,d=
Math.ceil(-b.wheelDeltaX/d),-1<d&&d<0&&(d=-1),0<d&&d<1&&(d=1),e=Math.ceil(-b.wheelDeltaY/e),-1<e&&e<0&&(e=-1),0<e&&e<1&&(e=1)):(d=-b.wheelDeltaX,e=-b.wheelDeltaY/120*8*a);if(c.isSafari){for(a=b.target;a&&a.lineIndex===void 0;)a=a.parentNode;this._mouseWheelLine=a}a=this._getScroll();this._scrollView(d,e);d=this._getScroll();if(a.x!==d.x||a.y!==d.y)return b.preventDefault&&b.preventDefault(),!1},_handlePaste:function(b){if(!this._ignoreEvent(b)&&!this._ignorePaste&&this._doPaste(b)){if(c.isIE){var a=
this;this._ignoreFocus=!0;this._getWindow().setTimeout(function(){a._updateDOMSelection();a._ignoreFocus=!1},0)}b.preventDefault&&b.preventDefault();return!1}},_handleResize:function(){var a=this._parent.clientWidth,d=this._parent.clientHeight;if(this._parentWidth!==a||this._parentHeight!==d){this._parentWidth!==a&&this._wrapMode&&this._resetLineHeight();this._parentWidth=a;this._parentHeight=d;a=c.isIE<9;d=this._calculateMetrics();if(!b(d,this._metrics)){if(this._variableLineHeight)this._variableLineHeight=
!1,this._resetLineHeight();this._metrics=d;a=!0}a?this._queueUpdate():this._update()}},_handleRulerEvent:function(b){for(var a=b.target?b.target:b.srcElement,c=a.lineIndex;a&&!a._ruler;){if(c===void 0&&a.lineIndex!==void 0)c=a.lineIndex;a=a.parentNode}var d=a?a._ruler:null;if(c===void 0&&d&&d.getOverview()==="document"){var c=this._getClientHeight(),e=this._model.getLineCount(),g=this._getViewPadding(),f=this._viewDiv.getBoundingClientRect(),c=Math.floor((b.clientY-f.top-this._metrics.scrollWidth)*
e/(c+g.top+g.bottom-2*this._metrics.scrollWidth));0<=c&&c<e||(c=void 0)}if(d)switch(b.type){case "click":if(d.onClick)d.onClick(c,b);break;case "dblclick":if(d.onDblClick)d.onDblClick(c,b);break;case "mousemove":if(d.onMouseMove)d.onMouseMove(c,b);break;case "mouseover":if(d.onMouseOver)d.onMouseOver(c,b);break;case "mouseout":if(d.onMouseOut){for(e=b.relatedTarget;e&&e!==this._rootDiv;){if(e===a)return;e=e.parentNode}d.onMouseOut(c,b)}}},_handleScroll:function(){var b=this._getScroll(!1),a=this._hScroll,
c=this._vScroll;if(a!==b.x||c!==b.y)this._hScroll=b.x,this._vScroll=b.y,this._commitIME(),this._update(c===b.y),this.onScroll({type:"Scroll",oldValue:{x:a,y:c},newValue:b})},_handleSelectStart:function(b){if(this._ignoreSelect)return b&&b.preventDefault&&b.preventDefault(),!1},_getModelOffset:function(b,a){if(b){var c;c=b.tagName==="DIV"?b:b.parentNode.parentNode;var d=0,e=c.lineIndex;if(b.tagName!=="DIV")for(c=c.firstChild;c;){var g=c.firstChild;if(g===b){c.ignoreChars&&(d-=c.ignoreChars);d+=a;break}c.ignoreChars&&
(d-=c.ignoreChars);d+=g.data.length;c=c.nextSibling}return Math.max(0,d)+this._model.getLineStart(e)}},_updateSelectionFromDOM:function(){var b=this._getWindow().getSelection(),a=this._getModelOffset(b.anchorNode,b.anchorOffset),b=this._getModelOffset(b.focusNode,b.focusOffset);a===void 0||b===void 0||this._setSelection(new o(a,b),!1,!1)},_handleSelectionChange:function(){if(this._imeOffset===-1)if(c.isAndroid){var b=this._getWindow();this._selTimer&&b.clearTimeout(this._selTimer);var a=this;this._selTimer=
b.setTimeout(function(){if(a._clientDiv)a._selTimer=null,a._updateSelectionFromDOM()},250)}else this._updateSelectionFromDOM()},_handleTextInput:function(b){if(!this._ignoreEvent(b)){this._imeOffset=-1;if(c.isAndroid){for(var a=this._getWindow().getSelection(),d=a.anchorNode;d;){if(d.lineIndex!==void 0)break;d=d.parentNode}if(d){var e=this._model,g=d.lineIndex,f=e.getLine(g),l=f,i=0,e=e.getLineStart(g);if(a.rangeCount>0)a.getRangeAt(0).deleteContents(),g=d.ownerDocument.createTextNode(b.data),a.getRangeAt(0).insertNode(g),
i=this._getDOMText(d,g),l=i.text,i=i.offset,g.parentNode.removeChild(g);d.lineRemoved=!0;for(d=0;f.charCodeAt(d)===l.charCodeAt(d)&&d<i;)d++;a=f.length-1;for(g=l.length-f.length;f.charCodeAt(a)===l.charCodeAt(a+g)&&a+g>=i+b.data.length;)a--;a++;f=l.substring(d,a+g);d+=e;a+=e;this._modifyContent({text:f,start:d,end:a,_ignoreDOMSelection:!0},!0)}}else this._doContent(b.data);b.preventDefault()}},_handleTouchStart:function(b){this._commitIME();var a=this._getWindow();if(this._touchScrollTimer)this._vScrollDiv.style.display=
"none",this._hScrollDiv.style.display="none",a.clearInterval(this._touchScrollTimer),this._touchScrollTimer=null;var d=b.touches;if(d.length===1){var d=d[0],e=d.clientX,g=d.clientY;this._touchStartX=e;this._touchStartY=g;if(c.isAndroid&&(g<d.pageY-a.pageYOffset||e<d.pageX-a.pageXOffset))e=d.pageX-a.pageXOffset,g=d.pageY-a.pageYOffset;a=this.convert({x:e,y:g},"page","document");this._lastTouchOffset=this.getOffsetAtLocation(a.x,a.y);this._touchStartTime=b.timeStamp;this._touching=!0}},_handleTouchMove:function(b){var a=
b.touches;if(a.length===1){a=a[0];this._touchCurrentX=a.clientX;this._touchCurrentY=a.clientY;if(!this._touchScrollTimer&&b.timeStamp-this._touchStartTime<200){this._vScrollDiv.style.display="block";if(!this._wrapMode)this._hScrollDiv.style.display="block";var c=this,d=this._getWindow();this._touchScrollTimer=d.setInterval(function(){var b=0,a=0;if(c._touching)b=c._touchStartX-c._touchCurrentX,a=c._touchStartY-c._touchCurrentY,c._touchSpeedX=b/10,c._touchSpeedY=a/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";d.clearInterval(c._touchScrollTimer);c._touchScrollTimer=null;return}else b=c._touchSpeedX*10,a=c._touchSpeedY*10,c._touchSpeedX*=0.95,c._touchSpeedY*=0.95;c._scrollView(b,a)},10)}this._touchScrollTimer&&b.preventDefault()}},_handleTouchEnd:function(b){if(b.touches.length===0)this._touching=!1},_doAction:function(b){var a,c,d=this._keyModes;
for(c=d.length-1;c>=0;c--)if(a=d[c],typeof a.match==="function"&&(a=a.match(b),a!==void 0))return this.invokeAction(a);return!1},_doMove:function(b,a){var c=this._model,d=a.getCaret(),e=c.getLineAtOffset(d);if(!b.count)b.count=1;for(;b.count!==0;){var g=c.getLineStart(e);if(b.count<0&&d===g)if(e>0)b.unit==="character"&&b.count++,e--,a.extend(c.getLineEnd(e));else break;else if(b.count>0&&d===c.getLineEnd(e))if(e+1<c.getLineCount())b.unit==="character"&&b.count--,e++,a.extend(c.getLineStart(e));else break;
else{var f=!1;b.expandTab&&b.unit==="character"&&(d-g)%this._tabSize===0&&(f=!/[^ ]/.test(c.getText(g,d)));f?(a.extend(d-this._tabSize),b.count+=b.count<0?1:-1):(g=this._getLine(e),a.extend(g.getNextOffset(d,b)),g.destroy())}d=a.getCaret()}return a},_doBackspace:function(b){var a=this._getSelection();if(a.isEmpty()){if(!b.count)b.count=1;b.count*=-1;b.expandTab=this._expandTab;this._doMove(b,a)}this._modifyContent({text:"",start:a.start,end:a.end},!0);return!0},_doCase:function(b){var a=this._getSelection();
this._doMove(b,a);var c=this.getText(a.start,a.end);this._setSelection(a,!0);switch(b.type){case "lower":c=c.toLowerCase();break;case "capitalize":c=c.replace(/(?:^|\s)\S/g,function(b){return b.toUpperCase()});break;case "reverse":b="";for(a=0;a<c.length;a++){var d=c[a],e=d.toLowerCase(),d=e!==d?e:d.toUpperCase();b+=d}c=b;break;default:c=c.toUpperCase()}this._doContent(c);return!0},_doContent:function(b){var a=this._getSelection();if(this._overwriteMode&&a.isEmpty()){var c=this._model,d=c.getLineAtOffset(a.end);
a.end<c.getLineEnd(d)&&(c=this._getLine(d),a.extend(c.getNextOffset(a.getCaret(),{unit:"character",count:1})),c.destroy())}this._modifyContent({text:b,start:a.start,end:a.end,_ignoreDOMSelection:!0},!0)},_doCopy:function(b){var a=this._getSelection();return!a.isEmpty()?this._setClipboardText(this._getBaseText(a.start,a.end),b):!0},_doCursorNext:function(b){var a=this._getSelection();!a.isEmpty()&&!b.select?a.start=a.end:this._doMove(b,a);b.select||a.collapse();this._setSelection(a,!0);return!0},_doCursorPrevious:function(b){var a=
this._getSelection();if(!a.isEmpty()&&!b.select)a.end=a.start;else{if(!b.count)b.count=1;b.count*=-1;this._doMove(b,a)}b.select||a.collapse();this._setSelection(a,!0);return!0},_doCut:function(b){var a=this._getSelection();return!a.isEmpty()?(a=this._getBaseText(a.start,a.end),this._doContent(""),this._setClipboardText(a,b)):!0},_doDelete:function(b){var a=this._getSelection();a.isEmpty()&&this._doMove(b,a);this._modifyContent({text:"",start:a.start,end:a.end},!0);return!0},_doEnd:function(b){var a=
this._getSelection(),c=this._model,d;if(b.ctrl)a.extend(c.getCharCount()),d=function(){};else{var e=a.getCaret(),g=c.getLineAtOffset(e);if(this._wrapMode){var f=this._getLine(g),e=f.getLineIndex(e),e=e===f.getLineCount()-1?c.getLineEnd(g):f.getLineStart(e+1)-1;f.destroy()}else b.count&&b.count>0&&(g=Math.min(g+b.count-1,c.getLineCount()-1)),e=c.getLineEnd(g);a.extend(e)}b.select||a.collapse();this._setSelection(a,!0,!0,d);return!0},_doEnter:function(b){var a=this._model,c=this._getSelection();this._doContent(a.getLineDelimiter());
if(b&&b.noCursor)c.end=c.start,this._setSelection(c,!0);return!0},_doHome:function(b){var a=this._getSelection(),c=this._model,d;if(b.ctrl)a.extend(0),d=function(){};else{var e=a.getCaret(),g=c.getLineAtOffset(e);this._wrapMode?(c=this._getLine(g),e=c.getLineIndex(e),e=c.getLineStart(e),c.destroy()):e=c.getLineStart(g);a.extend(e)}b.select||a.collapse();this._setSelection(a,!0,!0,d);return!0},_doLineDown:function(b){var a=this._model,d=this._getSelection(),e=d.getCaret(),g=a.getLineAtOffset(e),f=
this._getLine(g),l=this._columnX,i=1,h=!1;if(l===-1||b.wholeLine||b.select&&c.isIE)l=b.wholeLine?a.getLineEnd(g+1):e,l=f.getBoundingClientRect(l).left;(e=f.getLineIndex(e))<f.getLineCount()-1?i=f.getClientRects(e+1).top+1:(e=a.getLineCount()-1,h=g===e,b.count&&b.count>0?g=Math.min(g+b.count,e):g++);e=!1;if(h){if(b.select||c.isMac||c.isLinux)d.extend(a.getCharCount()),e=!0}else f.lineIndex!==g&&(f.destroy(),f=this._getLine(g)),d.extend(f.getOffset(l,i)),e=!0;e&&(b.select||d.collapse(),this._setSelection(d,
!0,!0));this._columnX=l;f.destroy();return!0},_doLineUp:function(b){var a=this._model,d=this._getSelection(),e=d.getCaret(),g=a.getLineAtOffset(e),f=this._getLine(g),l=this._columnX,i=!1,h;if(l===-1||b.wholeLine||b.select&&c.isIE)l=b.wholeLine?a.getLineStart(g-1):e,l=f.getBoundingClientRect(l).left;(e=f.getLineIndex(e))>0?h=f.getClientRects(e-1).top+1:(i=g===0,i||(b.count&&b.count>0?g=Math.max(g-b.count,0):g--,h=this._getLineHeight(g)-1));e=!1;if(i){if(b.select||c.isMac||c.isLinux)d.extend(0),e=!0}else f.lineIndex!==
g&&(f.destroy(),f=this._getLine(g)),d.extend(f.getOffset(l,h)),e=!0;e&&(b.select||d.collapse(),this._setSelection(d,!0,!0));this._columnX=l;f.destroy();return!0},_doNoop:function(){return!0},_doPageDown:function(b){var a=this,d=this._model,e=this._getSelection(),g=e.getCaret(),f=d.getLineAtOffset(g),l=d.getLineCount(),i=this._getScroll(),d=this._getClientHeight(),h,n;if(this._lineHeight){h=this._columnX;i=this._getBoundsAtOffset(g);if(h===-1||b.select&&c.isIE)h=i.left;g=this._getLineIndex(i.top+d);
n=this._getLine(g);f=this._getLinePixel(g);g=n.getOffset(h,i.top+d-f);d=n.getBoundingClientRect(g);n.destroy();e.extend(g);b.select||e.collapse();this._setSelection(e,!0,!0,function(){a._columnX=h},d.top+f-i.top);return!0}if(f<l-1){var m=this._getLineHeight(),j=Math.min(l-f-1,Math.floor(d/m)),j=Math.max(1,j);h=this._columnX;if(h===-1||b.select&&c.isIE)n=this._getLine(f),h=n.getBoundingClientRect(g).left,n.destroy();n=this._getLine(f+j);e.extend(n.getOffset(h,0));n.destroy();b.select||e.collapse();
b=l*m;g=i.y+j*m;g+d>b&&(g=b-d);this._setSelection(e,!0,!0,function(){a._columnX=h},g-i.y)}return!0},_doPageUp:function(b){var a=this,d=this._model,e=this._getSelection(),g=e.getCaret(),f=d.getLineAtOffset(g),l=this._getScroll(),i=this._getClientHeight(),h;if(this._lineHeight){h=this._columnX;l=this._getBoundsAtOffset(g);if(h===-1||b.select&&c.isIE)h=l.left;g=this._getLineIndex(l.bottom-i);d=this._getLine(g);f=this._getLinePixel(g);g=d.getOffset(h,l.bottom-i-f);i=d.getBoundingClientRect(g);d.destroy();
e.extend(g);b.select||e.collapse();this._setSelection(e,!0,!0,function(){a._columnX=h},i.top+f-l.top);return!0}if(f>0){var n=this._getLineHeight(),i=Math.max(1,Math.min(f,Math.floor(i/n)));h=this._columnX;if(h===-1||b.select&&c.isIE)d=this._getLine(f),h=d.getBoundingClientRect(g).left,d.destroy();d=this._getLine(f-i);e.extend(d.getOffset(h,this._getLineHeight(f-i)-1));d.destroy();b.select||e.collapse();b=Math.max(0,l.y-i*n);this._setSelection(e,!0,!0,function(){a._columnX=h},b-l.y)}return!0},_doPaste:function(b){var a=
this;return this._getClipboardText(b,function(b){b&&(c.isLinux&&a._lastMouseButton===2&&(new Date).getTime()-a._lastMouseTime<=a._clickTime&&a._setSelectionTo(a._lastMouseX,a._lastMouseY),a._doContent(b))})!==null},_doScroll:function(b){var a=b.type,c=this._model,d=c.getLineCount(),b=this._getClientHeight(),e=this._getLineHeight();d*=e;var g=this._getScroll().y,f;switch(a){case "textStart":f=0;break;case "textEnd":f=d-b;break;case "pageDown":f=g+b;break;case "pageUp":f=g-b;break;case "lineDown":f=
g+e;break;case "lineUp":f=g-e;break;case "centerLine":a=this._getSelection(),f=c.getLineAtOffset(a.start),c=(c.getLineAtOffset(a.end)-f+1)*e,f=f*e-b/2+c/2}f!==void 0&&(f=Math.min(Math.max(0,f),d-b),this._scrollViewAnimated(0,f-g,function(){}));return!0},_doSelectAll:function(){var b=this._model,a=this._getSelection();a.setCaret(0);a.extend(b.getCharCount());this._setSelection(a,!1);return!0},_doTab:function(){if(this._tabMode&&!this._readonly){var b="\t";if(this._expandTab)var a=this._model,b=this._getSelection().getCaret(),
c=a.getLineAtOffset(b),a=a.getLineStart(c),b=Array(this._tabSize-(b-a)%this._tabSize+1).join(" ");this._doContent(b);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 b=
this._model,a=this._getSelection(),d=this.convert({x:this._autoScrollX,y:this._autoScrollY},"page","document"),e=a.getCaret(),g=b.getLineCount(),f=b.getLineAtOffset(e),l;if(this._autoScrollDir==="up"||this._autoScrollDir==="down")e=this._autoScrollY/this._getLineHeight(),e=e<0?Math.floor(e):Math.ceil(e),l=Math.max(0,Math.min(g-1,f+e));else if(this._autoScrollDir==="left"||this._autoScrollDir==="right")l=this._getLineIndex(d.y),f=this._getLine(f),d.x+=f.getBoundingClientRect(e,!1).left,f.destroy();
l===0&&(c.isMac||c.isLinux)?a.extend(0):l===g-1&&(c.isMac||c.isLinux)?a.extend(b.getCharCount()):(f=this._getLine(l),a.extend(f.getOffset(d.x,d.y-this._getLinePixel(l))),f.destroy());this._setSelection(a,!0)},_autoScrollTimer:function(){this._autoScroll();var b=this;this._autoScrollTimerID=this._getWindow().setTimeout(function(){b._autoScrollTimer()},this._AUTO_SCROLL_RATE)},_calculateLineHeightTimer:function(b){if(this._lineHeight&&!this._calculateLHTimer){var a=this._model.getLineCount(),c=0;if(b){for(var b=
0,d=(new Date).getTime(),e=0;c<a;)if(this._lineHeight[c]||(b++,e||(e=c),this._lineHeight[c]=this._calculateLineHeight(c)),c++,(new Date).getTime()-d>100)break;this.redrawRulers(0,a);this._queueUpdate()}b=this._getWindow();if(c!==a){var g=this;this._calculateLHTimer=b.setTimeout(function(){g._calculateLHTimer=null;g._calculateLineHeightTimer(!0)},0)}else if(this._calculateLHTimer)b.clearTimeout(this._calculateLHTimer),this._calculateLHTimer=void 0}},_calculateLineHeight:function(b){var b=this._getLine(b),
a=b.getBoundingClientRect();b.destroy();return Math.max(1,a.bottom-a.top)},_calculateMetrics:function(){var b=this._clientDiv,d=b.ownerDocument,e=c.createElement(d,"div");e.style.lineHeight="normal";var g={type:"LineStyle",textView:this,0:0,lineText:this._model.getLine(0),lineStart:0};this.onLineStyle(g);a(g.style,e);e.style.position="fixed";e.style.left="-1000px";var f=c.createElement(d,"span");f.appendChild(d.createTextNode(" "));e.appendChild(f);var l=c.createElement(d,"span");l.style.fontStyle=
"italic";l.appendChild(d.createTextNode(" "));e.appendChild(l);var i=c.createElement(d,"span");i.style.fontWeight="bold";i.appendChild(d.createTextNode(" "));e.appendChild(i);g=c.createElement(d,"span");g.style.fontWeight="bold";g.style.fontStyle="italic";g.appendChild(d.createTextNode(" "));e.appendChild(g);b.appendChild(e);var h=e.getBoundingClientRect(),f=f.getBoundingClientRect(),l=l.getBoundingClientRect(),i=i.getBoundingClientRect(),g=g.getBoundingClientRect(),f=f.bottom-f.top,l=l.bottom-l.top,
i=i.bottom-i.top,j=g.bottom-g.top,o=0,g=h.bottom-h.top<=0,h=Math.max(1,h.bottom-h.top);l>f&&(o=1);i>l&&(o=2);j>i&&(o=3);var k;if(o!==0){k={style:{}};if((o&1)!==0)k.style.fontStyle="italic";if((o&2)!==0)k.style.fontWeight="bold"}f=m(e);b.removeChild(e);j=n(this._viewDiv);e=c.createElement(d,"div");e.style.position="fixed";e.style.left="-1000px";e.style.paddingLeft=j.left+"px";e.style.paddingTop=j.top+"px";e.style.paddingRight=j.right+"px";e.style.paddingBottom=j.bottom+"px";e.style.width="100px";e.style.height=
"100px";j=c.createElement(d,"div");j.style.width="100%";j.style.height="100%";e.appendChild(j);b.appendChild(e);o=e.getBoundingClientRect();l=j.getBoundingClientRect();i=0;if(!this._singleMode)e.style.overflow="hidden",j.style.height="200px",i=e.clientWidth,e.style.overflow="scroll",i-=e.clientWidth;b.removeChild(e);j={left:l.left-o.left,top:l.top-o.top,right:o.right-l.right,bottom:o.bottom-l.bottom};l=o=0;if(!g&&(this._wrapOffset||this._marginOffset))e=c.createElement(d,"div"),e.style.position="fixed",
e.style.left="-1000px",e.innerHTML=Array(this._wrapOffset+1).join(" "),b.appendChild(e),o=e.getBoundingClientRect(),o=Math.ceil(o.right-o.left),e.innerHTML=Array(this._marginOffset+1).join(" "),l=e.getBoundingClientRect(),l=Math.ceil(l.right-l.left),b.removeChild(e);return{lineHeight:h,largestFontStyle:k,lineTrim:f,viewPadding:j,scrollWidth:i,wrapWidth:o,marginWidth:l,invalid:g}},_cancelAnimation:function(){if(this._animation)this._animation.stop(),this._animation=null},_clearSelection:function(b){var a=
this._getSelection();if(a.isEmpty())return!1;b==="next"?a.start=a.end:a.end=a.start;this._setSelection(a,!0);return!0},_commitIME:function(){if(this._imeOffset!==-1){this._scrollDiv.focus();this._clientDiv.focus();var b=this._model,a=b.getLineAtOffset(this._imeOffset),c=b.getLineStart(a),d=this._getDOMText(this._getLineNode(a)).text,b=b.getLine(a),c=this._imeOffset-c,b=c+d.length-b.length;c!==b&&this._doContent(d.substring(c,b));this._imeOffset=-1}},_createActions:function(){this.addKeyMode(new h.DefaultKeyMode(this));
var b=this;this._actions={noop:{defaultHandler:function(){return b._doNoop()}},lineUp:{defaultHandler:function(a){return b._doLineUp(g(a,{select:!1}))},actionDescription:{name:j.lineUp}},lineDown:{defaultHandler:function(a){return b._doLineDown(g(a,{select:!1}))},actionDescription:{name:j.lineDown}},lineStart:{defaultHandler:function(a){return b._doHome(g(a,{select:!1,ctrl:!1}))},actionDescription:{name:j.lineStart}},lineEnd:{defaultHandler:function(a){return b._doEnd(g(a,{select:!1,ctrl:!1}))},actionDescription:{name:j.lineEnd}},
charPrevious:{defaultHandler:function(a){return b._doCursorPrevious(g(a,{select:!1,unit:"character"}))},actionDescription:{name:j.charPrevious}},charNext:{defaultHandler:function(a){return b._doCursorNext(g(a,{select:!1,unit:"character"}))},actionDescription:{name:j.charNext}},pageUp:{defaultHandler:function(a){return b._doPageUp(g(a,{select:!1}))},actionDescription:{name:j.pageUp}},pageDown:{defaultHandler:function(a){return b._doPageDown(g(a,{select:!1}))},actionDescription:{name:j.pageDown}},scrollPageUp:{defaultHandler:function(a){return b._doScroll(g(a,
{type:"pageUp"}))},actionDescription:{name:j.scrollPageUp}},scrollPageDown:{defaultHandler:function(a){return b._doScroll(g(a,{type:"pageDown"}))},actionDescription:{name:j.scrollPageDown}},scrollLineUp:{defaultHandler:function(a){return b._doScroll(g(a,{type:"lineUp"}))},actionDescription:{name:j.scrollLineUp}},scrollLineDown:{defaultHandler:function(a){return b._doScroll(g(a,{type:"lineDown"}))},actionDescription:{name:j.scrollLineDown}},wordPrevious:{defaultHandler:function(a){return b._doCursorPrevious(g(a,
{select:!1,unit:"word"}))},actionDescription:{name:j.wordPrevious}},wordNext:{defaultHandler:function(a){return b._doCursorNext(g(a,{select:!1,unit:"word"}))},actionDescription:{name:j.wordNext}},textStart:{defaultHandler:function(a){return b._doHome(g(a,{select:!1,ctrl:!0}))},actionDescription:{name:j.textStart}},textEnd:{defaultHandler:function(a){return b._doEnd(g(a,{select:!1,ctrl:!0}))},actionDescription:{name:j.textEnd}},scrollTextStart:{defaultHandler:function(a){return b._doScroll(g(a,{type:"textStart"}))},
actionDescription:{name:j.scrollTextStart}},scrollTextEnd:{defaultHandler:function(a){return b._doScroll(g(a,{type:"textEnd"}))},actionDescription:{name:j.scrollTextEnd}},centerLine:{defaultHandler:function(a){return b._doScroll(g(a,{type:"centerLine"}))},actionDescription:{name:j.centerLine}},selectLineUp:{defaultHandler:function(a){return b._doLineUp(g(a,{select:!0}))},actionDescription:{name:j.selectLineUp}},selectLineDown:{defaultHandler:function(a){return b._doLineDown(g(a,{select:!0}))},actionDescription:{name:j.selectLineDown}},
selectWholeLineUp:{defaultHandler:function(a){return b._doLineUp(g(a,{select:!0,wholeLine:!0}))},actionDescription:{name:j.selectWholeLineUp}},selectWholeLineDown:{defaultHandler:function(a){return b._doLineDown(g(a,{select:!0,wholeLine:!0}))},actionDescription:{name:j.selectWholeLineDown}},selectLineStart:{defaultHandler:function(a){return b._doHome(g(a,{select:!0,ctrl:!1}))},actionDescription:{name:j.selectLineStart}},selectLineEnd:{defaultHandler:function(a){return b._doEnd(g(a,{select:!0,ctrl:!1}))},
actionDescription:{name:j.selectLineEnd}},selectCharPrevious:{defaultHandler:function(a){return b._doCursorPrevious(g(a,{select:!0,unit:"character"}))},actionDescription:{name:j.selectCharPrevious}},selectCharNext:{defaultHandler:function(a){return b._doCursorNext(g(a,{select:!0,unit:"character"}))},actionDescription:{name:j.selectCharNext}},selectPageUp:{defaultHandler:function(a){return b._doPageUp(g(a,{select:!0}))},actionDescription:{name:j.selectPageUp}},selectPageDown:{defaultHandler:function(a){return b._doPageDown(g(a,
{select:!0}))},actionDescription:{name:j.selectPageDown}},selectWordPrevious:{defaultHandler:function(a){return b._doCursorPrevious(g(a,{select:!0,unit:"word"}))},actionDescription:{name:j.selectWordPrevious}},selectWordNext:{defaultHandler:function(a){return b._doCursorNext(g(a,{select:!0,unit:"word"}))},actionDescription:{name:j.selectWordNext}},selectTextStart:{defaultHandler:function(a){return b._doHome(g(a,{select:!0,ctrl:!0}))},actionDescription:{name:j.selectTextStart}},selectTextEnd:{defaultHandler:function(a){return b._doEnd(g(a,
{select:!0,ctrl:!0}))},actionDescription:{name:j.selectTextEnd}},deletePrevious:{defaultHandler:function(a){return b._doBackspace(g(a,{unit:"character"}))},actionDescription:{name:j.deletePrevious}},deleteNext:{defaultHandler:function(a){return b._doDelete(g(a,{unit:"character"}))},actionDescription:{name:j.deleteNext}},deleteWordPrevious:{defaultHandler:function(a){return b._doBackspace(g(a,{unit:"word"}))},actionDescription:{name:j.deleteWordPrevious}},deleteWordNext:{defaultHandler:function(a){return b._doDelete(g(a,
{unit:"word"}))},actionDescription:{name:j.deleteWordNext}},deleteLineStart:{defaultHandler:function(a){return b._doBackspace(g(a,{unit:"line"}))},actionDescription:{name:j.deleteLineStart}},deleteLineEnd:{defaultHandler:function(a){return b._doDelete(g(a,{unit:"line"}))},actionDescription:{name:j.deleteLineEnd}},tab:{defaultHandler:function(){return b._doTab()},actionDescription:{name:j.tab}},shiftTab:{defaultHandler:function(){return b._doShiftTab()},actionDescription:{name:j.shiftTab}},enter:{defaultHandler:function(){return b._doEnter()},
actionDescription:{name:j.enter}},enterNoCursor:{defaultHandler:function(a){return b._doEnter(g(a,{noCursor:!0}))},actionDescription:{name:j.enterNoCursor}},selectAll:{defaultHandler:function(){return b._doSelectAll()},actionDescription:{name:j.selectAll}},copy:{defaultHandler:function(){return b._doCopy()},actionDescription:{name:j.copy}},cut:{defaultHandler:function(){return b._doCut()},actionDescription:{name:j.cut}},paste:{defaultHandler:function(){return b._doPaste()},actionDescription:{name:j.paste}},
uppercase:{defaultHandler:function(a){return b._doCase(g(a,{type:"upper"}))},actionDescription:{name:j.uppercase}},lowercase:{defaultHandler:function(a){return b._doCase(g(a,{type:"lower"}))},actionDescription:{name:j.lowercase}},capitalize:{defaultHandler:function(a){return b._doCase(g(a,{unit:"word",type:"capitalize"}))},actionDescription:{name:j.capitalize}},reversecase:{defaultHandler:function(a){return b._doCase(g(a,{type:"reverse"}))},actionDescription:{name:j.reversecase}},toggleOverwriteMode:{defaultHandler:function(){return b._doOverwriteMode()},
actionDescription:{name:j.toggleOverwriteMode}},toggleTabMode:{defaultHandler:function(){return b._doTabMode()},actionDescription:{name:j.toggleTabMode}},toggleWrapMode:{defaultHandler:function(){return b._doWrapMode()},actionDescription:{name:j.toggleWrapMode}}}},_createRulerParent:function(b){var a=c.createElement(document,"div");a.className=b;a.tabIndex=-1;a.style.overflow="hidden";a.style.MozUserSelect="none";a.style.WebkitUserSelect="none";a.style.position="absolute";a.style.top="0px";a.style.bottom=
"0px";a.style.cursor="default";a.style.display="none";a.setAttribute("aria-hidden","true");this._rootDiv.appendChild(a);return a},_createRuler:function(b,a){if(this._clientDiv){var d=this._getRulerParent(b);if(d){if(d!==this._marginDiv||this._marginOffset)d.style.display="block";var e=c.createElement(d.ownerDocument,"div");e._ruler=b;e.rulerChanged=!0;e.style.position="relative";e.style.cssFloat="left";e.style.styleFloat="left";e.style.outline="none";if(a===void 0||a<0||a>=d.children.length)d.appendChild(e);
else{for(var g=d.firstChild;g&&a-- >0;)g=g.nextSibling;d.insertBefore(e,g)}}}},_createView:function(){if(!this._clientDiv){for(var b=this._parent;b.hasChildNodes();)b.removeChild(b.lastChild);var a=b.ownerDocument,d=c.createElement(a,"div");this._rootDiv=d;d.tabIndex=-1;d.style.position="relative";d.style.overflow="hidden";d.style.width="100%";d.style.height="100%";d.style.overflow="hidden";d.style.WebkitTextSizeAdjust="100%";d.setAttribute("role","application");b.appendChild(d);this._leftDiv=this._createRulerParent("textviewLeftRuler");
b=c.createElement(a,"div");b.className="textviewScroll";this._viewDiv=b;b.tabIndex=-1;b.style.position="absolute";b.style.top="0px";b.style.bottom="0px";b.style.borderWidth="0px";b.style.margin="0px";b.style.outline="none";b.style.background="transparent";if(c.isMac&&c.isWebkit)b.style.pointerEvents="none",b.style.zIndex="2";d.appendChild(b);(this._rightDiv=this._createRulerParent("textviewRightRuler")).style.right="0px";var e=c.createElement(a,"div");this._scrollDiv=e;e.style.margin="0px";e.style.borderWidth=
"0px";e.style.padding="0px";b.appendChild(e);(this._marginDiv=this._createRulerParent("textviewMarginRuler")).style.zIndex="4";if(!c.isIE&&!c.isIOS)this._clipDiv=b=c.createElement(a,"div"),b.style.position="absolute",b.style.overflow="hidden",b.style.margin="0px",b.style.borderWidth="0px",b.style.padding="0px",b.style.background="transparent",d.appendChild(b),this._clipScrollDiv=e=c.createElement(a,"div"),e.style.position="absolute",e.style.height="1px",e.style.top="-1000px",e.style.background="transparent",
b.appendChild(e);this._setFullSelection(this._fullSelection,!0);b=c.createElement(a,"div");b.className="textviewContent";this._clientDiv=b;b.tabIndex=0;b.style.position="absolute";b.style.borderWidth="0px";b.style.margin="0px";b.style.padding="0px";b.style.outline="none";b.style.zIndex="1";b.style.WebkitUserSelect="text";b.setAttribute("spellcheck","false");if(c.isIOS||c.isAndroid)b.style.WebkitTapHighlightColor="transparent";(this._clipDiv||d).appendChild(b);if(c.isIOS||c.isAndroid)this._vScrollDiv=
e=c.createElement(a,"div"),e.style.position="absolute",e.style.borderWidth="1px",e.style.borderColor="white",e.style.borderStyle="solid",e.style.borderRadius="4px",e.style.backgroundColor="black",e.style.opacity="0.5",e.style.margin="0px",e.style.padding="0px",e.style.outline="none",e.style.zIndex="3",e.style.width="8px",e.style.display="none",d.appendChild(e),this._hScrollDiv=e=c.createElement(a,"div"),e.style.position="absolute",e.style.borderWidth="1px",e.style.borderColor="white",e.style.borderStyle=
"solid",e.style.borderRadius="4px",e.style.backgroundColor="black",e.style.opacity="0.5",e.style.margin="0px",e.style.padding="0px",e.style.outline="none",e.style.zIndex="3",e.style.height="8px",e.style.display="none",d.appendChild(e);if(c.isFirefox&&!b.setCapture)this._overlayDiv=a=c.createElement(a,"div"),a.style.position=b.style.position,a.style.borderWidth=b.style.borderWidth,a.style.margin=b.style.margin,a.style.padding=b.style.padding,a.style.cursor="text",a.style.zIndex="2",(this._clipDiv||
d).appendChild(a);b.contentEditable="true";b.setAttribute("role","textbox");b.setAttribute("aria-multiline","true");this._setWrapMode(this._wrapMode,!0);this._setReadOnly(this._readonly);this._setThemeClass(this._themeClass,!0);this._setTabSize(this._tabSize,!0);this._setMarginOffset(this._marginOffset,!0);this._hookEvents();d=this._rulers;for(a=0;a<d.length;a++)this._createRuler(d[a]);this._update()}},_defaultOptions:function(){return{parent:{value:void 0,update:null},model:{value:void 0,update:this.setModel},
scrollAnimation:{value:0,update:null},readonly:{value:!1,update:this._setReadOnly},fullSelection:{value:!0,update:this._setFullSelection},tabMode:{value:!0,update:null},tabSize:{value:8,update:this._setTabSize},expandTab:{value:!1,update:null},singleMode:{value:!1,update:this._setSingleMode},overwriteMode:{value:!1,update:this._setOverwriteMode},blockCursorVisible:{value:!1,update:this._setBlockCursor},marginOffset:{value:0,update:this._setMarginOffset},wrapOffset:{value:0,update:this._setWrapOffset},
wrapMode:{value:!1,update:this._setWrapMode},wrappable:{value:!1,update:null},theme:{value:d.TextTheme.getTheme(),update:this._setTheme},themeClass:{value:void 0,update:this._setThemeClass}}},_destroyRuler:function(b){var a=this._getRulerParent(b);if(a)for(var c=a.firstChild;c;){if(c._ruler===b){c._ruler=void 0;a.removeChild(c);if(a.children.length===0&&(a!==this._marginDiv||!this._marginOffset))a.style.display="none";break}c=c.nextSibling}},_destroyView:function(){if(this._clientDiv){this._setGrab(null);
this._unhookEvents();var b=this._getWindow();if(this._autoScrollTimerID)b.clearTimeout(this._autoScrollTimerID),this._autoScrollTimerID=null;if(this._updateTimer)b.clearTimeout(this._updateTimer),this._updateTimer=null;b=this._rootDiv;b.parentNode.removeChild(b);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(b,a,c){this._autoScrollDir=b;this._autoScrollX=a;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 b=this._clientDiv;if(b){var a=this._hasFocus;this._ignoreFocus=!0;a&&b.blur();b.contentEditable=!1;b.contentEditable=!0;a&&b.focus();this._ignoreFocus=
!1}},_getBaseText:function(b,a){var c=this._model;c.getBaseModel&&(b=c.mapOffset(b),a=c.mapOffset(a),c=c.getBaseModel());return c.getText(b,a)},_getBottomIndex:function(b){var a=this._bottomChild;if(b&&this._getClientHeight()>this._getLineHeight()){var b=a.getBoundingClientRect(),c=this._clientDiv.getBoundingClientRect();b.bottom>c.bottom&&(a=this._getLinePrevious(a)||a)}return a.lineIndex},_getBoundsAtOffset:function(b){var a=this._getLine(this._model.getLineAtOffset(b)),b=a.getBoundingClientRect(b),
c=this._getLinePixel(a.lineIndex);b.top+=c;b.bottom+=c;a.destroy();return b},_getClientHeight:function(){var b=this._getViewPadding();return Math.max(0,this._viewDiv.clientHeight-b.top-b.bottom)},_getClientWidth:function(){var b=this._getViewPadding();return Math.max(0,this._viewDiv.clientWidth-b.left-b.right)},_getClipboardText:function(b,a){var d=this._model.getLineDelimiter(),e,g,f=this._getWindow(),i=f.clipboardData;if(!i&&b)i=b.clipboardData;if(i)return e=[],g=i.getData(c.isIE?"Text":"text/plain"),
l(g,function(b){e.push(b)},function(){e.push(d)}),g=e.join(""),a&&a(g),g;if(c.isFirefox){this._ignoreFocus=!0;var h=this._clipboardDiv,i=this._rootDiv.ownerDocument;if(!h)this._clipboardDiv=h=c.createElement(i,"div"),h.style.position="fixed",h.style.whiteSpace="pre",h.style.left="-1000px",this._rootDiv.appendChild(h);h.innerHTML="<pre contenteditable=''></pre>";h.firstChild.focus();var n=this,m=function(){var b=n._getTextFromElement(h);h.innerHTML="";e=[];l(b,function(b){e.push(b)},function(){e.push(d)});
return e.join("")},j=!1;this._ignorePaste=!0;if(!c.isLinux||this._lastMouseButton!==2)try{j=i.execCommand("paste",!1,null)}catch(o){j=h.childNodes.length>1||h.firstChild&&h.firstChild.childNodes.length>0}this._ignorePaste=!1;if(!j)return b?(f.setTimeout(function(){n.focus();(g=m())&&a&&a(g);n._ignoreFocus=!1},0),null):(this.focus(),this._ignoreFocus=!1,"");this.focus();this._ignoreFocus=!1;(g=m())&&a&&a(g);return g}return""},_getDOMText:function(b,a){for(var c=b.firstChild,d="",e=0;c;){var g;if(!c.ignore)if(c.ignoreChars){g=
c.lastChild;for(var f=0,l=[],i=-1;g;){for(var h=g.data,n=h.length-1;n>=0;n--){var m=h.substring(n,n+1);f<c.ignoreChars&&(m===" "||m==="\u200c"||m==="\ufeff")?f++:l.push(m==="\u00a0"?"\t":m)}if(a===g)i=l.length;g=g.previousSibling}l=l.reverse().join("");i!==-1&&(e=d.length+l.length-i);d+=l}else for(g=c.firstChild;g;){if(a===g)e=d.length;d+=g.data;g=g.nextSibling}c=c.nextSibling}return{text:d,offset:e}},_getTextFromElement:function(b){var a=b.ownerDocument,c=a.defaultView;if(!c.getSelection)return b.innerText||
b.textContent;a=a.createRange();a.selectNode(b);var b=c.getSelection(),c=[],d;for(d=0;d<b.rangeCount;d++)c.push(b.getRangeAt(d));this._ignoreSelect=!0;b.removeAllRanges();b.addRange(a);a=b.toString();b.removeAllRanges();for(d=0;d<c.length;d++)b.addRange(c[d]);this._ignoreSelect=!1;return a},_getViewPadding:function(){return this._metrics.viewPadding},_getLine:function(b){var a=this._getLineNode(b);return a&&!a.lineChanged&&!a.lineRemoved?a._line:new r(this,b)},_getLineHeight:function(b,a){if(b!==
void 0&&this._lineHeight){var c=this._lineHeight[b];if(c)return c;if(a||a===void 0)return this._lineHeight[b]=this._calculateLineHeight(b)}return this._metrics.lineHeight},_getLineNode:function(b){for(var a=this._clientDiv.firstChild;a;){if(b===a.lineIndex)return a;a=a.nextSibling}},_getLineNext:function(b){for(b=b?b.nextSibling:this._clientDiv.firstChild;b&&b.lineIndex===-1;)b=b.nextSibling;return b},_getLinePrevious:function(b){for(b=b?b.previousSibling:this._clientDiv.lastChild;b&&b.lineIndex===
-1;)b=b.previousSibling;return b},_getLinePixel:function(b){b=Math.min(Math.max(0,b),this._model.getLineCount());if(this._lineHeight){var a=this._getTopIndex(),c=-this._topIndexY+this._getScroll().y;if(b>a)for(;a<b;a++)c+=this._getLineHeight(a);else for(a-=1;a>=b;a--)c-=this._getLineHeight(a);return c}return this._getLineHeight()*b},_getLineIndex:function(b){var a,c=0,d=this._model.getLineCount();if(this._lineHeight){var c=this._getTopIndex(),e=-this._topIndexY+this._getScroll().y;if(b!==e)if(b<e)for(;b<
e&&c>0;)b+=this._getLineHeight(--c);else for(a=this._getLineHeight(c);b-a>=e&&c<d-1;)b-=a,a=this._getLineHeight(++c)}else a=this._getLineHeight(),c=Math.floor(b/a);return Math.max(0,Math.min(d-1,c))},_getRulerParent:function(b){switch(b.getLocation()){case "left":return this._leftDiv;case "right":return this._rightDiv;case "margin":return this._marginDiv}return null},_getScroll:function(b){(b===void 0||b)&&this._cancelAnimation();b=this._viewDiv;return{x:b.scrollLeft,y:b.scrollTop}},_getSelection:function(){return this._selection.clone()},
_getTopIndex:function(b){var a=this._topChild;if(b&&this._getClientHeight()>this._getLineHeight()){var b=a.getBoundingClientRect(),c=this._getViewPadding(),d=this._viewDiv.getBoundingClientRect();b.top<d.top+c.top&&(a=this._getLineNext(a)||a)}return a.lineIndex},_hookEvents:function(){var b=this;this._modelListener={onChanging:function(a){b._onModelChanging(a)},onChanged:function(a){b._onModelChanged(a)}};this._model.addEventListener("preChanging",this._modelListener.onChanging);this._model.addEventListener("postChanged",
this._modelListener.onChanged);this._themeListener={onChanged:function(){b._setThemeClass(b._themeClass)}};this._theme.addEventListener("ThemeChanged",this._themeListener.onChanged);var a=this._handlers=[],d=this._clientDiv,e=this._viewDiv,g=this._rootDiv,f=this._overlayDiv||d,l=d.ownerDocument,i=this._getWindow(),h=c.isIE?l:i;a.push({target:i,type:"resize",handler:function(a){return b._handleResize(a?a:i.event)}});a.push({target:d,type:"blur",handler:function(a){return b._handleBlur(a?a:i.event)}});
a.push({target:d,type:"focus",handler:function(a){return b._handleFocus(a?a:i.event)}});a.push({target:e,type:"focus",handler:function(){d.focus()}});a.push({target:e,type:"scroll",handler:function(a){return b._handleScroll(a?a:i.event)}});a.push({target:d,type:"textInput",handler:function(a){return b._handleTextInput(a?a:i.event)}});a.push({target:d,type:"keydown",handler:function(a){return b._handleKeyDown(a?a:i.event)}});a.push({target:d,type:"keypress",handler:function(a){return b._handleKeyPress(a?
a:i.event)}});a.push({target:d,type:"keyup",handler:function(a){return b._handleKeyUp(a?a:i.event)}});c.isIE&&a.push({target:l,type:"keyup",handler:function(a){return b._handleDocKeyUp(a?a:i.event)}});a.push({target:d,type:"contextmenu",handler:function(a){return b._handleContextMenu(a?a:i.event)}});a.push({target:d,type:"copy",handler:function(a){return b._handleCopy(a?a:i.event)}});a.push({target:d,type:"cut",handler:function(a){return b._handleCut(a?a:i.event)}});a.push({target:d,type:"paste",
handler:function(a){return b._handlePaste(a?a:i.event)}});if(c.isIOS||c.isAndroid)a.push({target:l,type:"selectionchange",handler:function(a){return b._handleSelectionChange(a?a:i.event)}}),a.push({target:d,type:"touchstart",handler:function(a){return b._handleTouchStart(a?a:i.event)}}),a.push({target:d,type:"touchmove",handler:function(a){return b._handleTouchMove(a?a:i.event)}}),a.push({target:d,type:"touchend",handler:function(a){return b._handleTouchEnd(a?a:i.event)}});else{a.push({target:d,type:"selectstart",
handler:function(a){return b._handleSelectStart(a?a:i.event)}});a.push({target:d,type:"mousedown",handler:function(a){return b._handleMouseDown(a?a:i.event)}});a.push({target:d,type:"mouseover",handler:function(a){return b._handleMouseOver(a?a:i.event)}});a.push({target:d,type:"mouseout",handler:function(a){return b._handleMouseOut(a?a:i.event)}});a.push({target:h,type:"mouseup",handler:function(a){return b._handleMouseUp(a?a:i.event)}});a.push({target:h,type:"mousemove",handler:function(a){return b._handleMouseMove(a?
a:i.event)}});a.push({target:g,type:"mousedown",handler:function(a){return b._handleRootMouseDown(a?a:i.event)}});a.push({target:g,type:"mouseup",handler:function(a){return b._handleRootMouseUp(a?a:i.event)}});a.push({target:f,type:"dragstart",handler:function(a){return b._handleDragStart(a?a:i.event)}});a.push({target:f,type:"drag",handler:function(a){return b._handleDrag(a?a:i.event)}});a.push({target:f,type:"dragend",handler:function(a){return b._handleDragEnd(a?a:i.event)}});a.push({target:f,
type:"dragenter",handler:function(a){return b._handleDragEnter(a?a:i.event)}});a.push({target:f,type:"dragover",handler:function(a){return b._handleDragOver(a?a:i.event)}});a.push({target:f,type:"dragleave",handler:function(a){return b._handleDragLeave(a?a:i.event)}});a.push({target:f,type:"drop",handler:function(a){return b._handleDrop(a?a:i.event)}});a.push({target:this._clientDiv,type:c.isFirefox?"DOMMouseScroll":"mousewheel",handler:function(a){return b._handleMouseWheel(a?a:i.event)}});this._clipDiv&&
a.push({target:this._clipDiv,type:c.isFirefox?"DOMMouseScroll":"mousewheel",handler:function(a){return b._handleMouseWheel(a?a:i.event)}});if(c.isFirefox&&(!c.isWindows||c.isFirefox>=15))(e=i.MutationObserver||i.MozMutationObserver)?(this._mutationObserver=new e(function(a){b._handleDataModified(a)}),this._mutationObserver.observe(d,{subtree:!0,characterData:!0})):a.push({target:this._clientDiv,type:"DOMCharacterDataModified",handler:function(a){return b._handleDataModified(a?a:i.event)}});this._overlayDiv&&
(a.push({target:this._overlayDiv,type:"mousedown",handler:function(a){return b._handleMouseDown(a?a:i.event)}}),a.push({target:this._overlayDiv,type:"mouseover",handler:function(a){return b._handleMouseOver(a?a:i.event)}}),a.push({target:this._overlayDiv,type:"mouseout",handler:function(a){return b._handleMouseOut(a?a:i.event)}}),a.push({target:this._overlayDiv,type:"contextmenu",handler:function(a){return b._handleContextMenu(a?a:i.event)}}));this._isW3CEvents||a.push({target:this._clientDiv,type:"dblclick",
handler:function(a){return b._handleDblclick(a?a:i.event)}})}this._hookRulerEvents(this._leftDiv,a);this._hookRulerEvents(this._rightDiv,a);this._hookRulerEvents(this._marginDiv,a);for(e=0;e<a.length;e++)g=a[e],v(g.target,g.type,g.handler,g.capture)},_hookRulerEvents:function(b,a){if(b){var d=this,e=this._getWindow();c.isIE&&a.push({target:b,type:"selectstart",handler:function(){return!1}});a.push({target:b,type:c.isFirefox?"DOMMouseScroll":"mousewheel",handler:function(b){return d._handleMouseWheel(b?
b:e.event)}});a.push({target:b,type:"click",handler:function(b){d._handleRulerEvent(b?b:e.event)}});a.push({target:b,type:"dblclick",handler:function(b){d._handleRulerEvent(b?b:e.event)}});a.push({target:b,type:"mousemove",handler:function(b){d._handleRulerEvent(b?b:e.event)}});a.push({target:b,type:"mouseover",handler:function(b){d._handleRulerEvent(b?b:e.event)}});a.push({target:b,type:"mouseout",handler:function(b){d._handleRulerEvent(b?b:e.event)}})}},_getWindow:function(){return this._parent.ownerDocument.defaultView||
this._parent.ownerDocument.parentWindow},_ignoreEvent:function(b){for(b=b.target;b&&b!==this._clientDiv;){if(b.ignore)return!0;b=b.parentNode}return!1},_init:function(b){var a=b.parent;typeof a==="string"&&(a=(b.document||document).getElementById(a));if(!a)throw"no parent";b.parent=a;b.model=b.model||new k.TextModel;var d=this._defaultOptions(),e;for(e in d)d.hasOwnProperty(e)&&(this["_"+e]=b[e]!==void 0?b[e]:d[e].value);this._keyModes=[];this._rulers=[];this._selection=new o(0,0,!1);this._linksVisible=
!1;this._maxLineWidth=this._redrawCount=0;this._maxLineIndex=-1;this._ignoreSelect=!0;this._hasFocus=this._ignoreFocus=!1;this._dragOffset=this._columnX=-1;this._isRangeRects=(!c.isIE||c.isIE>=9)&&typeof a.ownerDocument.createRange().getBoundingClientRect==="function";this._isW3CEvents=a.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(b,a){if(!this._readonly||b._code)if(b.type="Verify",this.onVerify(b),!(b.text===null||b.text===void 0)){var c=this._model;try{if(b._ignoreDOMSelection)this._ignoreDOMSelection=!0;c.setText(b.text,b.start,b.end)}finally{if(b._ignoreDOMSelection)this._ignoreDOMSelection=!1}a&&(c=
this._getSelection(),c.setCaret(b.start+b.text.length),this._setSelection(c,!0));this.onModify({type:"Modify"})}},_onModelChanged:function(b){b.type="ModelChanged";this.onModelChanged(b);b.type="Changed";var a=b.start,c=b.addedCharCount,d=b.removedCharCount,e=b.addedLineCount,g=b.removedLineCount,f=this._getSelection();f.end>a&&(f.end>a&&f.start<a+d?f.setCaret(a+c):(f.start+=c-d,f.end+=c-d),this._setSelection(f,!1,!1));a=this._model.getLineAtOffset(a);for(c=this._getLineNext();c;){d=c.lineIndex;if(a<=
d&&d<=a+g)a===d&&!c.modelChangedEvent&&!c.lineRemoved?(c.modelChangedEvent=b,c.lineChanged=!0):(c.lineRemoved=!0,c.lineChanged=!1,c.modelChangedEvent=null);if(d>a+g)c.lineIndex=d+e-g,c._line.lineIndex=c.lineIndex;c=this._getLineNext(c)}this._lineHeight&&(b=[a,g].concat(Array(e)),Array.prototype.splice.apply(this._lineHeight,b));if(!this._wrapMode&&a<=this._maxLineIndex&&this._maxLineIndex<=a+g)this._checkMaxLineIndex=this._maxLineIndex,this._maxLineIndex=-1,this._maxLineWidth=0;this._update()},_onModelChanging:function(b){b.type=
"ModelChanging";this.onModelChanging(b);b.type="Changing"},_queueUpdate:function(){if(!this._updateTimer&&!this._ignoreQueueUpdate){var b=this;this._updateTimer=this._getWindow().setTimeout(function(){b._updateTimer=null;b._update()},0)}},_resetLineHeight:function(b,a){if(this._wrapMode||this._variableLineHeight){if(b!==void 0&&a!==void 0)for(var c=b;c<a;c++)this._lineHeight[c]=void 0;else this._lineHeight=Array(this._model.getLineCount());this._calculateLineHeightTimer()}else this._lineHeight=null},
_resetLineWidth:function(){var b=this._clientDiv;if(b)for(b=b.firstChild;b;)b.lineWidth=void 0,b=b.nextSibling},_reset:function(){this._maxLineIndex=-1;this._maxLineWidth=0;this._columnX=-1;this._bottomChild=this._topChild=null;this._topIndexY=0;this._variableLineHeight=!1;this._resetLineHeight();this._setSelection(new o(0,0,!1),!1,!1);if(this._viewDiv)this._viewDiv.scrollLeft=0,this._viewDiv.scrollTop=0;var b=this._clientDiv;if(b){for(var a=b.firstChild;a;)a.lineRemoved=!0,a=a.nextSibling;if(c.isFirefox)this._ignoreFocus=
!1,(a=this._hasFocus)&&b.blur(),b.contentEditable=!1,b.contentEditable=!0,a&&b.focus(),this._ignoreFocus=!1}},_scrollViewAnimated:function(b,a,c){var d=this._getWindow();if(c&&this._scrollAnimation){var e=this;this._animation=new u({window:d,duration:this._scrollAnimation,curve:[a,0],onAnimate:function(b){b=a-Math.floor(b);e._scrollView(0,b);a-=b},onEnd:function(){e._animation=null;e._scrollView(b,a);c&&d.setTimeout(c,0)}});this._animation.play()}else this._scrollView(b,a),c&&d.setTimeout(c,0)},_scrollView:function(b,
a){this._ensureCaretVisible=!1;var c=this._viewDiv;b&&(c.scrollLeft+=b);a&&(c.scrollTop+=a)},_setClipboardText:function(b,a){var d,e=this._getWindow(),g=e.clipboardData;if(!g&&a)g=a.clipboardData;if(g&&(d=[],l(b,function(b){d.push(b)},function(){d.push(c.platformDelimiter)}),g.setData(c.isIE?"Text":"text/plain",d.join(""))))return!0;var f=this._parent.ownerDocument,i=c.createElement(f,"pre");i.style.position="fixed";i.style.left="-1000px";l(b,function(b){i.appendChild(f.createTextNode(b))},function(){i.appendChild(c.createElement(f,
"br"))});i.appendChild(f.createTextNode(" "));this._clientDiv.appendChild(i);g=f.createRange();g.setStart(i.firstChild,0);g.setEndBefore(i.lastChild);var h=e.getSelection();h.rangeCount>0&&h.removeAllRanges();h.addRange(g);var n=this,g=function(){i&&i.parentNode===n._clientDiv&&n._clientDiv.removeChild(i);n._updateDOMSelection()},h=!1;this._ignoreCopy=!0;try{h=f.execCommand("copy",!1,null)}catch(m){}this._ignoreCopy=!1;if(!h&&a)return e.setTimeout(g,0),!1;g();return!0},_setDOMSelection:function(b,
a,d,e,g){for(var f,i,l,h,n=0,m=b.firstChild,j,o,k=this._model.getLine(b.lineIndex).length;m;){if(!m.ignore){j=m.firstChild;o=j.length;m.ignoreChars&&(o-=m.ignoreChars);if(n+o>a||n+o>=k){f=j;i=a-n;m.ignoreChars&&o>0&&i===o&&(i+=m.ignoreChars);break}n+=o}m=m.nextSibling}for(var n=0,m=d.firstChild,t=this._model.getLine(d.lineIndex).length;m;){if(!m.ignore){j=m.firstChild;o=j.length;m.ignoreChars&&(o-=m.ignoreChars);if(o+n>e||n+o>=t){l=j;h=e-n;m.ignoreChars&&o>0&&h===o&&(h+=m.ignoreChars);break}n+=o}m=
m.nextSibling}this._setDOMFullSelection(b,a,k,d,e,t);b=this._getWindow();a=this._parent.ownerDocument;if(b.getSelection){d=b.getSelection();b=a.createRange();b.setStart(f,i);b.setEnd(l,h);if(this._hasFocus&&(d.anchorNode!==f||d.anchorOffset!==i||d.focusNode!==l||d.focusOffset!==h||d.anchorNode!==l||d.anchorOffset!==h||d.focusNode!==f||d.focusOffset!==i))this._ignoreSelect=!1,d.rangeCount>0&&d.removeAllRanges(),d.addRange(b),this._ignoreSelect=!0;if(this._cursorDiv&&(b=a.createRange(),g?(b.setStart(f,
i),b.setEnd(f,i)):(b.setStart(l,h),b.setEnd(l,h)),l=b.getClientRects()[0],h=this._cursorDiv.parentNode,f=h.getBoundingClientRect(),l&&f))this._cursorDiv.style.top=l.top-f.top+h.scrollTop+"px",this._cursorDiv.style.left=l.left-f.left+h.scrollLeft+"px"}else if(a.selection&&this._hasFocus)g=a.body,b=c.createElement(a,"div"),g.appendChild(b),g.removeChild(b),b=g.createTextRange(),b.moveToElementText(f.parentNode),b.moveStart("character",i),f=g.createTextRange(),f.moveToElementText(l.parentNode),f.moveStart("character",
h),b.setEndPoint("EndToStart",f),this._ignoreSelect=!1,b.select(),this._ignoreSelect=!0},_setDOMFullSelection:function(b,a,c,d,e){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",!(b===d&&a===e))){var g=this._model,f=this._getViewPadding(),i=this._clientDiv.getBoundingClientRect(),l=this._viewDiv.getBoundingClientRect(),c=l.left+f.left,h=i.right,f=l.top+f.top,
n=i.bottom,l=i=0;this._clipDiv?(l=this._clipDiv.getBoundingClientRect(),i=l.left-this._clipDiv.scrollLeft):(l=this._rootDiv.getBoundingClientRect(),i=l.left);l=l.top;this._ignoreDOMSelection=!0;var m=(new r(this,b.lineIndex,b)).getBoundingClientRect(g.getLineStart(b.lineIndex)+a,!1),j=m.left,a=(new r(this,d.lineIndex,d)).getBoundingClientRect(g.getLineStart(d.lineIndex)+e,!1),g=a.left;this._ignoreDOMSelection=!1;var o=this._selDiv1,j=Math.min(h,Math.max(c,j)),k=Math.min(n,Math.max(f,m.top)),t=h,e=
Math.min(n,Math.max(f,m.bottom));o.style.left=j-i+"px";o.style.top=k-l+"px";o.style.width=Math.max(0,t-j)+"px";o.style.height=Math.max(0,e-k)+"px";if(b.lineIndex===d.lineIndex)t=Math.min(g,h),o.style.width=Math.max(0,t-j)+"px";else if(m=Math.min(n,Math.max(f,a.top)),g=Math.min(h,Math.max(c,g)),f=Math.min(n,Math.max(f,a.bottom)),n=this._selDiv3,n.style.left=c-i+"px",n.style.top=m-l+"px",n.style.width=Math.max(0,g-c)+"px",n.style.height=Math.max(0,f-m)+"px",Math.abs(b.lineIndex-d.lineIndex)>1)b=this._selDiv2,
b.style.left=c-i+"px",b.style.top=e-l+"px",b.style.width=Math.max(0,h-c)+"px",b.style.height=Math.max(0,m-e)+"px"}},_setGrab:function(b){if(b!==this._grabControl)b?(b.setCapture&&b.setCapture(),this._grabControl=b):(this._grabControl.releaseCapture&&this._grabControl.releaseCapture(),this._grabControl=null)},_setLinksVisible:function(b){if(this._linksVisible!==b){this._linksVisible=b;if(c.isIE&&b)this._hadFocus=this._hasFocus;var a=this._clientDiv;a.contentEditable=!b;this._hadFocus&&!b&&a.focus();
if(this._overlayDiv)this._overlayDiv.style.zIndex=b?"-1":"1";for(b=this._getLineNext();b;){if(b.hasLink)for(a=b.firstChild;a;)if(a.ignore)a=a.nextSibling;else{var d=a.nextSibling,e=a.viewStyle;e&&e.tagName&&e.tagName.toLowerCase()==="a"&&b.replaceChild(b._line._createSpan(b,a.firstChild.data,e),a);a=d}b=this._getLineNext(b)}this._updateDOMSelection()}},_setSelection:function(b,a,c,d,e){if(b){this._columnX=-1;c===void 0&&(c=!0);var g=this._selection;this._selection=b;a!==!1&&this._showCaret(!1,d,a,
e);c&&this._updateDOMSelection();if(!g.equals(b))this.onSelection({type:"Selection",oldValue:{start:g.start,end:g.end},newValue:{start:b.start,end:b.end}})}},_setSelectionTo:function(b,a,c,d){var e=this._model,g=this._getSelection(),a=this.convert({x:b,y:a},"page","document"),b=this._getLineIndex(a.y);if(this._clickCount===1){e=this._getLine(b);b=e.getOffset(a.x,a.y-this._getLinePixel(b));e.destroy();if(d&&!c&&g.start<=b&&b<g.end)return this._dragOffset=b,!1;g.extend(b);c||g.collapse()}else(this._clickCount&
1)===0?(e=this._getLine(b),b=e.getOffset(a.x,a.y-this._getLinePixel(b)),this._doubleClickSelection?b>=this._doubleClickSelection.start?(c=this._doubleClickSelection.start,d=e.getNextOffset(b,{unit:"wordend",count:1})):(c=e.getNextOffset(b,{unit:"word",count:-1}),d=this._doubleClickSelection.end):(c=e.getNextOffset(b,{unit:"word",count:-1}),d=e.getNextOffset(c,{unit:"wordend",count:1})),e.destroy()):this._doubleClickSelection?(d=e.getLineAtOffset(this._doubleClickSelection.start),b>=d?(c=e.getLineStart(d),
d=e.getLineEnd(b)):(c=e.getLineStart(b),d=e.getLineEnd(d))):(c=e.getLineStart(b),d=e.getLineEnd(b)),g.setCaret(c),g.extend(d);this._setSelection(g,!0,!0);return!0},_setFullSelection:function(b,a){this._fullSelection=b;if(c.isWebkit)this._fullSelection=!0;var d=this._clipDiv||this._rootDiv;if(d)if(this._fullSelection){if(!this._selDiv1&&this._fullSelection&&!c.isIOS){var e=d.ownerDocument;this._highlightRGB=c.isWebkit?"transparent":"Highlight";var g=c.createElement(e,"div");this._selDiv1=g;g.style.position=
"absolute";g.style.borderWidth="0px";g.style.margin="0px";g.style.padding="0px";g.style.outline="none";g.style.background=this._highlightRGB;g.style.width="0px";g.style.height="0px";g.style.zIndex="0";d.appendChild(g);var f=c.createElement(e,"div");this._selDiv2=f;f.style.position="absolute";f.style.borderWidth="0px";f.style.margin="0px";f.style.padding="0px";f.style.outline="none";f.style.background=this._highlightRGB;f.style.width="0px";f.style.height="0px";f.style.zIndex="0";d.appendChild(f);this._selDiv3=
e=c.createElement(e,"div");e.style.position="absolute";e.style.borderWidth="0px";e.style.margin="0px";e.style.padding="0px";e.style.outline="none";e.style.background=this._highlightRGB;e.style.width="0px";e.style.height="0px";e.style.zIndex="0";d.appendChild(e);if(c.isFirefox&&c.isMac){d=this._getWindow().getComputedStyle(e,null).getPropertyValue("background-color");switch(d){case "rgb(119, 141, 168)":d="rgb(199, 208, 218)";break;case "rgb(127, 127, 127)":d="rgb(198, 198, 198)";break;case "rgb(255, 193, 31)":d=
"rgb(250, 236, 115)";break;case "rgb(243, 70, 72)":d="rgb(255, 176, 139)";break;case "rgb(255, 138, 34)":d="rgb(255, 209, 129)";break;case "rgb(102, 197, 71)":d="rgb(194, 249, 144)";break;case "rgb(140, 78, 184)":d="rgb(232, 184, 255)";break;default:d="rgb(180, 213, 255)"}this._highlightRGB=d;g.style.background=d;f.style.background=d;e.style.background=d}a||this._updateDOMSelection()}}else{if(this._selDiv1)d.removeChild(this._selDiv1),this._selDiv1=null;if(this._selDiv2)d.removeChild(this._selDiv2),
this._selDiv2=null;if(this._selDiv3)d.removeChild(this._selDiv3),this._selDiv3=null}},_setBlockCursor:function(b){this._blockCursorVisible=b;this._updateBlockCursorVisible()},_setOverwriteMode:function(b){this._overwriteMode=b;this._updateBlockCursorVisible()},_updateBlockCursorVisible:function(){if(this._blockCursorVisible||this._overwriteMode){if(!this._cursorDiv){var b=c.createElement(document,"div");b.className="textviewBlockCursor";this._cursorDiv=b;b.tabIndex=-1;b.style.zIndex="2";b.style.color=
"transparent";b.style.position="absolute";b.style.pointerEvents="none";b.innerHTML="&nbsp;";this._viewDiv.appendChild(b);this._updateDOMSelection()}}else if(this._cursorDiv)this._cursorDiv.parentNode.removeChild(this._cursorDiv),this._cursorDiv=null},_setMarginOffset:function(b,a){this._marginOffset=b;this._marginDiv.style.display=b?"block":"none";if(!a)this._metrics=this._calculateMetrics(),this._queueUpdate()},_setWrapOffset:function(b,a){this._wrapOffset=b;if(!a)this._metrics=this._calculateMetrics(),
this._queueUpdate()},_setReadOnly:function(b){this._readonly=b;this._clientDiv.setAttribute("aria-readonly",b?"true":"false")},_setSingleMode:function(b,a){this._singleMode=b;this._updateOverflow();this._updateStyle(a)},_setTabSize:function(b,a){this._tabSize=b;this._customTabSize=void 0;var d=this._clientDiv;if(c.isOpera){if(d)d.style.OTabSize=this._tabSize+""}else if(c.isWebkit>=537.1){if(d)d.style.tabSize=this._tabSize+""}else if(c.isFirefox>=4){if(d)d.style.MozTabSize=this._tabSize+""}else if(this._tabSize!==
8)this._customTabSize=this._tabSize;a||(this.redrawLines(),this._resetLineWidth())},_setTheme:function(b){this._theme&&this._theme.removeEventListener("ThemeChanged",this._themeListener.onChanged);(this._theme=b)&&this._theme.addEventListener("ThemeChanged",this._themeListener.onChanged);this._setThemeClass(this._themeClass)},_setThemeClass:function(b,a){this._themeClass=b;var c="textview",d=this._theme.getThemeClass();d&&(c+=" "+d);this._themeClass&&d!==this._themeClass&&(c+=" "+this._themeClass);
this._rootDiv.className=c;this._updateStyle(a)},_setWrapMode:function(b,a){this._wrapMode=b&&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();a||(this.redraw(),this._resetLineWidth());this._resetLineHeight()},_showCaret:function(b,a,c,d){if(this._clientDiv){var e=this._model,g=this._getSelection(),f=this._getScroll(),i=g.getCaret(),l=g.start,h=g.end,n=e.getLineAtOffset(h),
m=Math.max(Math.max(l,e.getLineStart(n)),h-1),e=this._getClientWidth(),n=this._getClientHeight(),j=e/4,o=this._getBoundsAtOffset(i===l?l:m),k=o.left,t=o.right,r=o.top,s=o.bottom;b&&!g.isEmpty()&&(o=this._getBoundsAtOffset(i===h?l:m),o.top===r?i===l?t=k+Math.min(o.right-k,e):k=t-Math.min(t-o.left,e):i===l?s=r+Math.min(o.bottom-r,n):r=s-Math.min(s-o.top,n));b=0;k<f.x&&(b=Math.min(k-f.x,-j));t>f.x+e&&(b=Math.max(t-f.x-e,j));g=0;r<f.y?g=r-f.y:s>f.y+n&&(g=s-f.y-n);d&&(d>0?g>0&&(g=Math.max(g,d)):g<0&&(g=
Math.min(g,d)));if(b!==0||g!==0)return g!==0&&typeof c==="number"&&(c<0&&(c=0),c>1&&(c=1),g+=Math.floor(g>0?c*n:-c*n)),this._scrollViewAnimated(b,g,a),n!==this._getClientHeight()||e!==this._getClientWidth()?this._showCaret():this._ensureCaretVisible=!0,!0;else a&&a();return!1}},_startIME:function(){if(this._imeOffset===-1){var b=this._getSelection();b.isEmpty()||this._modifyContent({text:"",start:b.start,end:b.end},!0);this._imeOffset=b.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 b=0;b<this._handlers.length;b++){var a=this._handlers[b];w(a.target,a.type,a.handler)}this._handlers=null;if(this._mutationObserver)this._mutationObserver.disconnect(),this._mutationObserver=null},_updateDOMSelection:function(){if(!(this._redrawCount>0)&&!this._ignoreDOMSelection&&
this._clientDiv){var b=this._getSelection(),a=this._model,c=a.getLineAtOffset(b.start),d=a.getLineAtOffset(b.end),e=this._getLineNext();if(e){var g=this._getLinePrevious(),f;c<e.lineIndex?(f=e,c=0):c>g.lineIndex?(f=g,c=0):(f=this._getLineNode(c),c=b.start-a.getLineStart(c));d<e.lineIndex?a=0:d>g.lineIndex?(e=g,a=0):(e=this._getLineNode(d),a=b.end-a.getLineStart(d));this._setDOMSelection(f,c,e,a,b.caret)}}},_update:function(b){if(!(this._redrawCount>0)){if(this._updateTimer)this._getWindow().clearTimeout(this._updateTimer),
this._updateTimer=null,b=!1;var a=this._clientDiv,d=this._viewDiv;if(a){if(this._metrics.invalid)this._ignoreQueueUpdate=!0,this._updateStyle(),this._ignoreQueueUpdate=!1;var e=this._model,g=this._getScroll(!1),f=this._getViewPadding(),i=e.getLineCount(),l=this._getLineHeight(),h=!1,n=!1,m=!1,j=this._metrics.scrollWidth;if(this._wrapMode)a.style.width=(this._metrics.wrapWidth||this._getClientWidth())+"px";var o,k,t,s,v=0,w=0,u;if(this._lineHeight){for(;w<i;){u=this._getLineHeight(w);if(v+u>g.y)break;
v+=u;w++}o=w;k=Math.max(0,o-1);t=e=g.y-v;o>0&&(e+=this._getLineHeight(o-1))}else s=Math.max(0,g.y)/l,o=Math.floor(s),k=Math.max(0,o-1),e=Math.round((s-k)*l),t=Math.round((s-o)*l);this._topIndexY=t;s=this._parent;var N=s.clientWidth,L=s.clientHeight;if(b){l=0;this._leftDiv&&(o=this._leftDiv.getBoundingClientRect(),l=o.right-o.left);o=this._getClientWidth();s=this._getClientHeight();n=o;if(this._wrapMode){if(this._metrics.wrapWidth)n=this._metrics.wrapWidth}else n=Math.max(this._maxLineWidth,n);for(;w<
i;)u=this._getLineHeight(w,!1),v+=u,w++;i=v}else{s=this._getClientHeight();t=Math.min(o+Math.floor((s+t)/l),i-1);var g=Math.min(t+1,i-1),C;for(u=a.firstChild;u;){C=u.lineIndex;var D=u.nextSibling;if(!(k<=C&&C<=g)||u.lineRemoved||u.lineIndex===-1)this._mouseWheelLine===u?(u.style.display="none",u.lineIndex=-1):a.removeChild(u);u=D}u=this._getLineNext();var D=d.ownerDocument,I=D.createDocumentFragment();for(C=k;C<=g;C++)if(!u||u.lineIndex>C)(new r(this,C)).create(I,null);else{I.firstChild&&(a.insertBefore(I,
u),I=D.createDocumentFragment());if(u&&u.lineChanged)u=(new r(this,C)).create(I,u),u.lineChanged=!1;u=this._getLineNext(u)}I.firstChild&&a.insertBefore(I,u);if(c.isWebkit&&!this._wrapMode)a.style.width="0x7fffffffpx";u=this._getLineNext();C=s+e;for(I=!1;u;){k=u.lineWidth;if(k===void 0)if(D=u._line.getBoundingClientRect(),k=u.lineWidth=Math.ceil(D.right-D.left),D=D.bottom-D.top,this._lineHeight)this._lineHeight[u.lineIndex]=D;else if(l!==0&&D!==0&&Math.ceil(l)!==Math.ceil(D))this._variableLineHeight=
!0,this._lineHeight=[],this._lineHeight[u.lineIndex]=D;if(this._lineHeight&&!I&&(C-=this._lineHeight[u.lineIndex],C<0))t=u.lineIndex,I=!0;if(!this._wrapMode){if(k>=this._maxLineWidth)this._maxLineWidth=k,this._maxLineIndex=u.lineIndex;if(this._checkMaxLineIndex===u.lineIndex)this._checkMaxLineIndex=-1}if(u.lineIndex===o)this._topChild=u;if(u.lineIndex===t)this._bottomChild=u;u=this._getLineNext(u)}if(this._checkMaxLineIndex!==-1&&(C=this._checkMaxLineIndex,this._checkMaxLineIndex=-1,0<=C&&C<i)){l=
new r(this,C);D=l.getBoundingClientRect();k=D.right-D.left;if(k>=this._maxLineWidth)this._maxLineWidth=k,this._maxLineIndex=C;l.destroy()}for(;w<i;)u=this._getLineHeight(w,w<=t),v+=u,w++;i=v;this._updateRuler(this._leftDiv,o,g,L);this._updateRuler(this._rightDiv,o,g,L);this._updateRuler(this._marginDiv,o,g,L);l=0;this._leftDiv&&(o=this._leftDiv.getBoundingClientRect(),l=o.right-o.left);g=0;this._rightDiv&&(g=this._rightDiv.getBoundingClientRect(),g=g.right-g.left);d.style.left=l+"px";d.style.right=
g+"px";g=this._scrollDiv;g.style.height=i+"px";o=this._getClientWidth();if(!this._singleMode&&!this._wrapMode){v=h=s;(w=d.style.overflowX==="scroll")?h+=j:v-=j;u=t=o;(k=d.style.overflowY==="scroll")?t+=j:u-=j;s=h;o=t;i>s&&(m=!0,o=u);this._maxLineWidth>o&&(n=!0,s=v,i>s&&(m=!0,o=u));if(w!==n)d.style.overflowX=n?"scroll":"hidden";if(k!==m)d.style.overflowY=m?"scroll":"hidden";h=w!==n||k!==m}m=o;if(this._wrapMode){if(this._metrics.wrapWidth)m=this._metrics.wrapWidth}else m=Math.max(this._maxLineWidth,
m);n=m;if((!c.isIE||c.isIE>=9)&&this._maxLineWidth>o)m+=f.right+f.left;g.style.width=m+"px";if(this._clipScrollDiv)this._clipScrollDiv.style.width=m+"px";g=this._getScroll(!1)}if(this._vScrollDiv)m=s-8,v=Math.max(15,Math.ceil(Math.min(1,m/(i+f.top+f.bottom))*m)),this._vScrollDiv.style.left=l+o-8+"px",this._vScrollDiv.style.top=Math.floor(Math.max(0,g.y*m/i))+"px",this._vScrollDiv.style.height=v+"px";if(!this._wrapMode&&this._hScrollDiv)m=o-8,v=Math.max(15,Math.ceil(Math.min(1,m/(this._maxLineWidth+
f.left+f.right))*m)),this._hScrollDiv.style.left=l+Math.floor(Math.max(0,Math.floor(g.x*m/this._maxLineWidth)))+"px",this._hScrollDiv.style.top=s-9+"px",this._hScrollDiv.style.width=v+"px";w=g.x;v=this._clipDiv;m=this._overlayDiv;if(t=this._marginDiv)t.style.left=-w+l+this._metrics.marginWidth+f.left+"px",t.style.bottom=(d.style.overflowX==="scroll"?j:0)+"px";if(v){v.scrollLeft=w;v.scrollTop=0;d=l+f.left;j=f.top;b=o;l=s;w=0;t=-e;if(g.x===0)d-=f.left,b+=f.left,w=f.left;g.x+o===n&&(b+=f.right);g.y===
0&&(j-=f.top,l+=f.top,t+=f.top);g.y+s===i&&(l+=f.bottom);v.style.left=d+"px";v.style.top=j+"px";v.style.right=N-b-d+"px";v.style.bottom=L-l-j+"px";a.style.left=w+"px";a.style.top=t+"px";a.style.width=n+"px";a.style.height=s+e+"px";if(m)m.style.left=a.style.left,m.style.top=a.style.top,m.style.width=a.style.width,m.style.height=a.style.height}else{d=w;j=e;N=w+o;L=e+s;d===0&&(d-=f.left);j===0&&(j-=f.top);N===n&&(N+=f.right);g.y+s===i&&(L+=f.bottom);a.style.clip="rect("+j+"px,"+N+"px,"+L+"px,"+d+"px)";
a.style.left=-w+l+f.left+"px";a.style.width=(this._wrapMode||c.isWebkit?n:o+w)+"px";if(!b)a.style.top=-e+f.top+"px",a.style.height=s+e+"px";if(m&&(m.style.clip=a.style.clip,m.style.left=a.style.left,m.style.width=a.style.width,!b))m.style.top=a.style.top,m.style.height=a.style.height}this._updateDOMSelection();if(h)a=this._ensureCaretVisible,this._ensureCaretVisible=!1,a&&this._showCaret(),this._queueUpdate()}}},_updateOverflow:function(){var b=this._viewDiv;this._wrapMode?(b.style.overflowX="hidden",
b.style.overflowY="scroll"):b.style.overflow="hidden"},_updateRuler:function(b,d,e,g){if(b)for(var f=this._parent.ownerDocument,i=this._getLineHeight(),l=this._getViewPadding(),b=b.firstChild;b;){var h=b._ruler,n=i,m=h.getOverview();m==="page"&&(n+=this._topIndexY);b.style.top=-n+"px";b.style.height=g+n+"px";b.rulerChanged&&a(h.getRulerStyle(),b);var j,o=b.firstChild;o?(j=o,o=o.nextSibling):(j=c.createElement(f,"div"),j.style.visibility="hidden",b.appendChild(j));var k;if(b.rulerChanged&&j){n=-1;
if(k=h.getWidestAnnotation())if(a(k.style,j),k.html)j.innerHTML=k.html;j.lineIndex=n;j.style.height=i+l.top+"px"}var t;if(m==="page"){for(h=h.getAnnotations(d,e+1);o;)n=o.lineIndex,k=o.nextSibling,(!(d<=n&&n<=e)||o.lineChanged)&&b.removeChild(o),o=k;o=b.firstChild.nextSibling;t=f.createDocumentFragment();for(n=d;n<=e;n++)if(!o||o.lineIndex>n){j=c.createElement(f,"div");if(k=h[n]){a(k.style,j);if(k.html)j.innerHTML=k.html;j.annotation=k}j.lineIndex=n;j.style.height=this._getLineHeight(n)+"px";t.appendChild(j)}else if(t.firstChild&&
(b.insertBefore(t,o),t=f.createDocumentFragment()),o)o=o.nextSibling;t.firstChild&&b.insertBefore(t,o)}else{k=this._getClientHeight();n=this._model.getLineCount();o=k+l.top+l.bottom-2*this._metrics.scrollWidth;m=i*n<o?i:o/n;if(b.rulerChanged){for(k=b.childNodes.length;k>1;)b.removeChild(b.lastChild),k--;h=h.getAnnotations(0,n);t=f.createDocumentFragment();for(var r in h)if(n=r>>>0,!(n<0)){j=c.createElement(f,"div");k=h[r];a(k.style,j);j.style.position="absolute";j.style.top=this._metrics.scrollWidth+
i+Math.floor(n*m)+"px";if(k.html)j.innerHTML=k.html;j.annotation=k;j.lineIndex=n;t.appendChild(j)}b.appendChild(t)}else if(b._oldTrackHeight!==o)for(j=b.firstChild?b.firstChild.nextSibling:null;j;)j.style.top=this._metrics.scrollWidth+i+Math.floor(j.lineIndex*m)+"px",j=j.nextSibling;b._oldTrackHeight=o}b.rulerChanged=!1;b=b.nextSibling}},_updateStyleSheet:function(){var b="";c.isWebkit&&this._metrics.scrollWidth>0&&(b+="\n.textview ::-webkit-scrollbar-corner {background: #eeeeee;}");c.isFirefox&&
c.isMac&&this._highlightRGB&&this._highlightRGB!=="Highlight"&&(b+="\n.textview ::-moz-selection {background: "+this._highlightRGB+";}");if(b){var a=document.getElementById("_textviewStyle");if(a)a.removeChild(a.firstChild),a.appendChild(document.createTextNode(b));else{a=c.createElement(document,"style");a.id="_textviewStyle";var d=document.getElementsByTagName("head")[0]||document.documentElement;a.appendChild(document.createTextNode(b));d.insertBefore(a,d.firstChild)}}},_updateStyle:function(b){if(!b&&
c.isIE)this._rootDiv.style.lineHeight="normal";var a=this._metrics=this._calculateMetrics();this._rootDiv.style.lineHeight=c.isIE?a.lineHeight-(a.lineTrim.top+a.lineTrim.bottom)+"px":"normal";this._updateStyleSheet();b||(this.redraw(),this._resetLineWidth())}};e.EventTarget.addMixin(s.prototype);return{TextView:s}});
define("orion/editor/projectionTextModel",["orion/editor/textModel","orion/editor/eventTarget"],function(j,k){function h(e){this._model=e;this._projections=[]}h.prototype={addProjection:function(e){if(e){var d=this._model,f=this._projections;e._lineIndex=d.getLineAtOffset(e.start);e._lineCount=d.getLineAtOffset(e.end)-e._lineIndex;var c=e.text;c||(c="");e._model=typeof c==="string"?new j.TextModel(c,d.getLineDelimiter()):c;var d=this.mapOffset(e.start,!0),c=e.end-e.start,a=e._lineCount,i=e._model.getCharCount(),
g=e._model.getLineCount()-1;this.onChanging({type:"Changing",text:e._model.getText(),start:d,removedCharCount:c,addedCharCount:i,removedLineCount:a,addedLineCount:g});var b=this._binarySearch(f,e.start);f.splice(b,0,e);this.onChanged({type:"Changed",start:d,removedCharCount:c,addedCharCount:i,removedLineCount:a,addedLineCount:g})}},getProjections:function(){return this._projections.slice(0)},getBaseModel:function(){return this._model},mapOffset:function(e,d){var f=this._projections,c=0,a,i;if(d){for(a=
0;a<f.length;a++){i=f[a];if(i.start>e)break;if(i.end>e)return-1;c+=i._model.getCharCount()-(i.end-i.start)}return e+c}for(a=0;a<f.length;a++){i=f[a];if(i.start>e-c)break;var g=i._model.getCharCount();if(i.start+g>e-c)return-1;c+=g-(i.end-i.start)}return e-c},removeProjection:function(e){var d,f=0;for(d=0;d<this._projections.length;d++){var c=this._projections[d];if(c===e){e=c;break}f+=c._model.getCharCount()-(c.end-c.start)}if(d<this._projections.length){var c=this._model,f=e.start+f,a=e.end-e.start,
i=e._lineCount,g=e._model.getCharCount(),b=e._model.getLineCount()-1;this.onChanging({type:"Changing",text:c.getText(e.start,e.end),start:f,removedCharCount:g,addedCharCount:a,removedLineCount:b,addedLineCount:i});this._projections.splice(d,1);this.onChanged({type:"Changed",start:f,removedCharCount:g,addedCharCount:a,removedLineCount:b,addedLineCount:i})}},_binarySearch:function(e,d){for(var f=e.length,c=-1,a;f-c>1;)a=Math.floor((f+c)/2),d<=e[a].start?f=a:c=a;return f},getCharCount:function(){for(var e=
this._model.getCharCount(),d=this._projections,f=0;f<d.length;f++){var c=d[f];e+=c._model.getCharCount()-(c.end-c.start)}return e},getLine:function(e,d){if(e<0)return null;var f=this._model,c=this._projections,a=0,i=[],g=0,b,l,h;for(b=0;b<c.length;b++){h=c[b];if(h._lineIndex>=e-a)break;l=h._model.getLineCount()-1;if(h._lineIndex+l>=e-a)if(g=e-(h._lineIndex+a),g<l)return h._model.getLine(g,d);else i.push(h._model.getLine(l));g=h.end;a+=l-h._lineCount}for(g=Math.max(g,f.getLineStart(e-a));b<c.length;b++){h=
c[b];if(h._lineIndex>e-a)break;i.push(f.getText(g,h.start));l=h._model.getLineCount()-1;if(h._lineIndex+l>e-a)return i.push(h._model.getLine(0,d)),i.join("");i.push(h._model.getText());g=h.end;a+=l-h._lineCount}c=f.getLineEnd(e-a,d);g<c&&i.push(f.getText(g,c));return i.join("")},getLineAtOffset:function(e){for(var d=this._model,f=this._projections,c=0,a=0,i=0;i<f.length;i++){var g=f[i];if(g.start>e-c)break;var b=g._model.getCharCount();if(g.start+b>e-c){f=e-(g.start+c);a+=g._model.getLineAtOffset(f);
c+=f;break}a+=g._model.getLineCount()-1-g._lineCount;c+=b-(g.end-g.start)}return d.getLineAtOffset(e-c)+a},getLineCount:function(){for(var e=this._projections,d=this._model.getLineCount(),f=0;f<e.length;f++){var c=e[f];d+=c._model.getLineCount()-1-c._lineCount}return d},getLineDelimiter:function(){return this._model.getLineDelimiter()},getLineEnd:function(e,d){if(e<0)return-1;for(var f=this._model,c=this._projections,a=0,i=0,g=0;g<c.length;g++){var b=c[g];if(b._lineIndex>e-a)break;var l=b._model.getLineCount()-
1;if(b._lineIndex+l>e-a)return b._model.getLineEnd(e-(b._lineIndex+a),d)+b.start+i;i+=b._model.getCharCount()-(b.end-b.start);a+=l-b._lineCount}return f.getLineEnd(e-a,d)+i},getLineStart:function(e){if(e<0)return-1;for(var d=this._model,f=this._projections,c=0,a=0,i=0;i<f.length;i++){var g=f[i];if(g._lineIndex>=e-c)break;var b=g._model.getLineCount()-1;if(g._lineIndex+b>=e-c)return g._model.getLineStart(e-(g._lineIndex+c))+g.start+a;a+=g._model.getCharCount()-(g.end-g.start);c+=b-g._lineCount}return d.getLineStart(e-
c)+a},getText:function(e,d){e===void 0&&(e=0);var f=this._model,c=this._projections,a=0,i=[],g,b,l;for(g=0;g<c.length;g++){b=c[g];if(b.start>e-a)break;l=b._model.getCharCount();if(b.start+l>e-a)if(d!==void 0&&b.start+l>d-a)return b._model.getText(e-(b.start+a),d-(b.start+a));else i.push(b._model.getText(e-(b.start+a))),e=b.end+a+l-(b.end-b.start);a+=l-(b.end-b.start)}var h=e-a;if(d!==void 0){for(;g<c.length;g++){b=c[g];if(b.start>d-a)break;i.push(f.getText(h,b.start));l=b._model.getCharCount();if(b.start+
l>d-a)return i.push(b._model.getText(0,d-(b.start+a))),i.join("");i.push(b._model.getText());h=b.end;a+=l-(b.end-b.start)}i.push(f.getText(h,d-a))}else{for(;g<c.length;g++)b=c[g],i.push(f.getText(h,b.start)),i.push(b._model.getText()),h=b.end;i.push(f.getText(h))}return i.join("")},_onChanging:function(e,d,f,c,a,i){for(var g=this._model,b=this._projections,l,h=0,m,j=d+f;l<b.length;l++){f=b[l];if(f.start>d)break;h+=f._model.getCharCount()-(f.end-f.start)}d+=h;for(var k=l;l<b.length;l++){f=b[l];if(f.start>
j)break;h+=f._model.getCharCount()-(f.end-f.start);m+=f._model.getLineCount()-1-f._lineCount}f=j+h;h=l;this.onChanging(d,f-d,c,a+m,i);b.splice(b,h-k);for(e=e.length-(f-d);l<b.length;l++)f=b[l],f.start+=e,f.end+=e,f._lineIndex=g.getLineAtOffset(f.start)},onChanging:function(e){return this.dispatchEvent(e)},onChanged:function(e){return this.dispatchEvent(e)},setLineDelimiter:function(e){this._model.setLineDelimiter(e)},setText:function(e,d,f){e===void 0&&(e="");d===void 0&&(d=0);var c=d,a=f,i=this._model,
g=this._projections,b=0,l=0,h,m,j,k,r,s=0;for(h=0;h<g.length;h++){m=g[h];if(m.start>d-b)break;j=m._model.getCharCount();if(m.start+j>d-b)if(f!==void 0&&m.start+j>f-b){m._model.setText(e,d-(m.start+b),f-(m.start+b));return}else s=m._model.getLineCount()-1-m._model.getLineAtOffset(d-(m.start+b)),k={projection:m,start:d-(m.start+b)},d=m.end+b+j-(m.end-m.start);l+=m._model.getLineCount()-1-m._lineCount;b+=j-(m.end-m.start)}d-=b;var v=h,s=i.getLineAtOffset(d)+l-s;if(f!==void 0)for(;h<g.length;h++){m=g[h];
if(m.start>f-b)break;j=m._model.getCharCount();if(m.start+j>f-b){l+=m._model.getLineAtOffset(f-(m.start+b));j=f-(m.start+b);f=m.end+b;r={projection:m,end:j};break}l+=m._model.getLineCount()-1-m._lineCount;b+=j-(m.end-m.start)}else{for(;h<g.length;h++)m=g[h],l+=m._model.getLineCount()-1-m._lineCount,b+=m._model.getCharCount()-(m.end-m.start);f=a=i.getCharCount()+b}f-=b;m=i.getLineAtOffset(f)+l;a-=c;for(var l=m-s,s=e.length,w=j=m=b=0;;){m!==-1&&m<=w&&(m=e.indexOf("\r",w));j!==-1&&j<=w&&(j=e.indexOf("\n",
w));if(j===-1&&m===-1)break;w=m!==-1&&j!==-1?m+1===j?j+1:(m<j?m:j)+1:m!==-1?m+1:j+1;b++}this.onChanging({type:"Changing",text:e,start:c,removedCharCount:a,addedCharCount:s,removedLineCount:l,addedLineCount:b});i.setText(e,d,f);if(k)m=k.projection,m._model.setText("",k.start);if(r)m=r.projection,m._model.setText("",0,r.end),m.start=m.end,m._lineCount=0;g.splice(v,h-v);for(e=e.length-(f-d);h<g.length;h++)m=g[h],m.start+=e,m.end+=e,m._lineIndex=i.getLineAtOffset(m.start);this.onChanged({type:"Changed",
start:c,removedCharCount:a,addedCharCount:s,removedLineCount:l,addedLineCount:b})}};k.EventTarget.addMixin(h.prototype);return{ProjectionTextModel:h}});
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,h,e,d,f){function c(a){this._view=a;this._fadeDelay=500;this._hideDelay=200;this._showDelay=500;this._autoHideDelay=5E3;this._create(a.getOptions("parent").ownerDocument)}c.getTooltip=function(a){if(!a._tooltip)a._tooltip=new c(a);return a._tooltip};c.prototype={_create:function(a){if(!this._tooltipDiv){var c=
this._tooltipDiv=f.createElement(a,"div");c.tabIndex=0;c.className="textviewTooltip";c.setAttribute("aria-live","assertive");c.setAttribute("aria-atomic","true");var e=this._tooltipContents=f.createElement(a,"div");c.appendChild(e);a.body.appendChild(c);var b=this;d.addEventListener(c,"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);d.addEventListener(c,"mouseout",function(a){a=a.relatedTarget||a.toElement;a===c||b._hasFocus()||(!a||!d.contains(c,a))&&b._hide()},!1);d.addEventListener(c,"keydown",function(a){a.keyCode===27&&b._hide()},!1);d.addEventListener(a,"mousedown",this._mouseDownHandler=function(a){b.isVisible()&&(d.contains(c,a.target||a.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 a=this._tooltipDiv.parentNode;a&&a.removeChild(this._tooltipDiv);d.removeEventListener(this._tooltipDiv.ownerDocument,"mousedown",this._mouseDownHandler,!0);this._tooltipDiv=null}},_hasFocus:function(){var a=this._tooltipDiv;return!a?!1:d.contains(a,a.ownerDocument.activeElement)},hide:function(a){if(a===void 0)a=this._hideDelay;var c=this._getWindow();if(this._delayedHideTimeout)c.clearTimeout(this._delayedHideTimeout),
this._delayedHideTimeout=null;var d=this;a?d._delayedHideTimeout=c.setTimeout(function(){d._delayedHideTimeout=null;d._hide();d.setTarget(d._nextTarget,0)},a):(d._hide(),d.setTarget(d._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,c,d){if(this.isVisible()){if(!this._hasFocus())this._nextTarget=a,this.hide(d)}else if(this._target=a){var b=
this,a=b._getWindow();if(b._showTimeout)a.clearTimeout(b._showTimeout),b._showTimeout=null;c===0?b.show(!0):b._showTimeout=a.setTimeout(function(){b._showTimeout=null;b.show(!0)},c?c:b._showDelay)}},show:function(a){if(this._target){var c=this._target.getTooltipInfo();if(c){var d=this._tooltipDiv,b=this._tooltipContents;d.style.left=d.style.right=d.style.width=d.style.height=b.style.width=b.style.height="auto";var f=c.contents;f instanceof Array&&(f=this._getAnnotationContents(f));if(typeof f==="string")b.innerHTML=
f;else if(this._isNode(f))b.appendChild(f);else if(f instanceof e.ProjectionTextModel){var h=this._view,j=h.getOptions();j.wrapMode=!1;j.parent=b;var o=j.themeClass;o?((o=o.replace("tooltipTheme",""))&&(o=" "+o),o="tooltipTheme"+o):o="tooltipTheme";j.themeClass=o;j=this._contentsView=new k.TextView(j);j.addEventListener("LineStyle",function(b){h.onLineStyle(b)});j.setModel(f);f=j.computeSize();b.style.width=f.width+"px";b.style.height=f.height+"px";j.resize()}else return;b=d.ownerDocument.documentElement;
c.anchor==="right"?(f=b.clientWidth-c.x,d.style.right=f+"px"):(f=parseInt(this._getNodeStyle(d,"padding-left","0"),10),f+=parseInt(this._getNodeStyle(d,"border-left-width","0"),10),f=c.x-f,d.style.left=f+"px");d.style.maxWidth=b.clientWidth-f-10+"px";f=parseInt(this._getNodeStyle(d,"padding-top","0"),10);f+=parseInt(this._getNodeStyle(d,"border-top-width","0"),10);f=c.y-f;d.style.top=f+"px";d.style.maxHeight=b.clientHeight-f-10+"px";d.style.opacity="1";d.style.visibility="visible";if(a){var t=this,
r=this._getWindow();t._hideTimeout=r.setTimeout(function(){t._hideTimeout=null;var b=parseFloat(t._getNodeStyle(d,"opacity","1"));t._fadeTimeout=r.setInterval(function(){d.style.visibility==="visible"&&b>0?(b-=0.1,d.style.opacity=b):t._hide()},t._fadeDelay/10)},t._autoHideDelay)}}}},_getAnnotationContents:function(a){function c(b,a){var d=s.getLineStart(s.getLineAtOffset(b)),e=s.getLineEnd(s.getLineAtOffset(a),!0);return s.getText(d,e)}function g(b){var a=b.title,e=f.createElement(o,"div");e.className=
"tooltipRow";if(b.html)e.innerHTML=b.html,e.lastChild&&d.addEventListener(e.lastChild,"click",function(){var a=b.start,c=b.end;r.getBaseModel&&(a=r.mapOffset(a,!0),c=r.mapOffset(c,!0));k.setSelection(a,c,1/3,function(){m._hide()})},!1),e.appendChild(o.createTextNode("\u00a0"));a||(a=c(b.start,b.end));typeof a==="function"&&(a=b.title());if(typeof a==="string"){var g=f.createElement(o,"span");g.appendChild(o.createTextNode(a));a=g}e.appendChild(a);return e}for(var b,l=[],h=0;h<a.length;h++)b=a[h],
b.title!==""&&!b.groupAnnotation&&l.push(b);a=l;if(a.length===0)return null;var m=this,o=this._tooltipDiv.ownerDocument,k=this._view,r=k.getModel(),s=r.getBaseModel?r.getBaseModel():r;if(a.length===1)if(b=a[0],b.title!==void 0){b=g(b);if(b.firstChild)(a=b.firstChild.className)&&(a+=" "),a+="single",b.firstChild.className=a;return b}else return a=new e.ProjectionTextModel(s),l=s.getLineStart(s.getLineAtOffset(b.start)),h=s.getCharCount(),b.end!==h&&a.addProjection({start:b.end,end:h}),l>0&&a.addProjection({start:0,
end:l}),a;else{l=f.createElement(o,"div");b=f.createElement(o,"em");b.appendChild(o.createTextNode(j.multipleAnnotations));l.appendChild(b);for(h=0;h<a.length;h++)b=a[h],(b=g(b))&&l.appendChild(b);return l}},_getNodeStyle:function(a,c,d){var b;if(a&&(b=a.style[c],!b))if(a.currentStyle){for(b=0;(b=c.indexOf("-",b))!==-1;)c=c.substring(0,b)+c.substring(b+1,b+2).toUpperCase()+c.substring(b+2);b=a.currentStyle[c]}else b=(a=a.ownerDocument.defaultView.getComputedStyle(a,null))?a.getPropertyValue(c):null;
return b||d},_isNode:function(a){return typeof Node==="object"?a instanceof Node:a&&typeof a==="object"&&typeof a.nodeType==="number"&&typeof a.nodeName==="string"}};return{Tooltip:c}});
define("orion/editor/annotations",["i18n!orion/editor/nls/messages","orion/editor/eventTarget"],function(j,k){function h(a,b,c){this.start=a;this.end=b;this._projectionModel=c;this.html=this._expandedHTML;this.style=this._expandedStyle;this.expanded=!0}function e(){}function d(a,b){var c=a.lastIndexOf("."),c=a.substring(c+1),d={title:j[c],style:{styleClass:"annotation "+c},html:"<div class='annotationHTML "+c+"'></div>",overviewStyle:{styleClass:"annotationOverview "+c}};b?d.lineStyle={styleClass:"annotationLine "+
c}:d.rangeStyle={styleClass:"annotationRange "+c};e.registerType(a,d)}function f(){}function c(a){this._annotations=[];var b=this;this._listener={onChanged:function(a){b._onChanged(a)}};this.setTextModel(a)}function a(a,b){this._view=a;this._annotationModel=b;var c=this;this._listener={onDestroy:function(b){c._onDestroy(b)},onLineStyle:function(b){c._onLineStyle(b)},onChanged:function(b){c._onAnnotationModelChanged(b)}};a.addEventListener("Destroy",this._listener.onDestroy);a.addEventListener("postLineStyle",
this._listener.onLineStyle);b.addEventListener("Changed",this._listener.onChanged)}h.prototype={_expandedHTML:"<div class='annotationHTML expanded'></div>",_expandedStyle:{styleClass:"annotation expanded"},_collapsedHTML:"<div class='annotationHTML collapsed'></div>",_collapsedStyle:{styleClass:"annotation collapsed"},collapse:function(){if(this.expanded){this.expanded=!1;this.html=this._collapsedHTML;this.style=this._collapsedStyle;var a=this._projectionModel,b=a.getBaseModel();this._projection=
{start:b.getLineStart(b.getLineAtOffset(this.start)+1),end:b.getLineEnd(b.getLineAtOffset(this.end),!0)};a.addProjection(this._projection)}},expand:function(){if(!this.expanded)this.expanded=!0,this.html=this._expandedHTML,this.style=this._expandedStyle,this._projectionModel.removeProjection(this._projection)}};e.ANNOTATION_ERROR="orion.annotation.error";e.ANNOTATION_WARNING="orion.annotation.warning";e.ANNOTATION_TASK="orion.annotation.task";e.ANNOTATION_BREAKPOINT="orion.annotation.breakpoint";
e.ANNOTATION_BOOKMARK="orion.annotation.bookmark";e.ANNOTATION_FOLDING="orion.annotation.folding";e.ANNOTATION_CURRENT_BRACKET="orion.annotation.currentBracket";e.ANNOTATION_MATCHING_BRACKET="orion.annotation.matchingBracket";e.ANNOTATION_CURRENT_LINE="orion.annotation.currentLine";e.ANNOTATION_CURRENT_SEARCH="orion.annotation.currentSearch";e.ANNOTATION_MATCHING_SEARCH="orion.annotation.matchingSearch";e.ANNOTATION_READ_OCCURRENCE="orion.annotation.readOccurrence";e.ANNOTATION_WRITE_OCCURRENCE="orion.annotation.writeOccurrence";
e.ANNOTATION_SELECTED_LINKED_GROUP="orion.annotation.selectedLinkedGroup";e.ANNOTATION_CURRENT_LINKED_GROUP="orion.annotation.currentLinkedGroup";e.ANNOTATION_LINKED_GROUP="orion.annotation.linkedGroup";e.ANNOTATION_BLAME="orion.annotation.blame";e.ANNOTATION_CURRENT_BLAME="orion.annotation.currentBlame";var i={};e.registerType=function(a,b){var c=b;if(typeof c!=="function")c=function(b,a,c){this.start=b;this.end=a;if(c!==void 0)this.title=c},c.prototype=b;c.prototype.type=a;i[a]=c;return a};e.createAnnotation=
function(a,b,c,d){return new (this.getType(a))(b,c,d)};e.getType=function(a){return i[a]};d(e.ANNOTATION_ERROR);d(e.ANNOTATION_WARNING);d(e.ANNOTATION_TASK);d(e.ANNOTATION_BREAKPOINT);d(e.ANNOTATION_BOOKMARK);d(e.ANNOTATION_CURRENT_BRACKET);d(e.ANNOTATION_MATCHING_BRACKET);d(e.ANNOTATION_CURRENT_SEARCH);d(e.ANNOTATION_MATCHING_SEARCH);d(e.ANNOTATION_READ_OCCURRENCE);d(e.ANNOTATION_WRITE_OCCURRENCE);d(e.ANNOTATION_SELECTED_LINKED_GROUP);d(e.ANNOTATION_CURRENT_LINKED_GROUP);d(e.ANNOTATION_LINKED_GROUP);
d(e.ANNOTATION_CURRENT_LINE,!0);d(e.ANNOTATION_BLAME,!0);d(e.ANNOTATION_CURRENT_BLAME,!0);e.registerType(e.ANNOTATION_FOLDING,h);f.addMixin=function(a){var b=f.prototype,c;for(c in b)b.hasOwnProperty(c)&&(a[c]=b[c])};f.prototype={addAnnotationType:function(a){if(!this._annotationTypes)this._annotationTypes=[];this._annotationTypes.push(a)},getAnnotationTypePriority:function(a){if(this._annotationTypes)for(var b=0;b<this._annotationTypes.length;b++)if(this._annotationTypes[b]===a)return b+1;return 0},
getAnnotationsByType:function(a,b,c){a=a.getAnnotations(b,c);for(c=[];a.hasNext();)b=a.next(),this.getAnnotationTypePriority(b.type)!==0&&c.push(b);var d=this;c.sort(function(b,a){return d.getAnnotationTypePriority(b.type)-d.getAnnotationTypePriority(a.type)});return c},isAnnotationTypeVisible:function(a){return this.getAnnotationTypePriority(a)!==0},removeAnnotationType:function(a){if(this._annotationTypes)for(var b=0;b<this._annotationTypes.length;b++)if(this._annotationTypes[b]===a){this._annotationTypes.splice(b,
1);break}}};c.prototype={addAnnotation:function(a){if(a){var b=this._annotations,c=this._binarySearch(b,a.start);b.splice(c,0,a);this.onChanged({type:"Changed",added:[a],removed:[],changed:[]})}},getTextModel:function(){return this._model},getAnnotations:function(a,b){var c=this._annotations,d,e=0,f=function(){for(;e<c.length;){var d=c[e++];if(a===d.start||(a>d.start?a<d.end:d.start<b))return d;if(d.start>=b)break}return null};d=f();return{next:function(){var b=d;b&&(d=f());return b},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,c,d;if(a){c=[];for(d=b.length-1;d>=0;d--){var e=b[d];e.type===a&&(b.splice(d,1),c.splice(0,0,e))}}else c=b;this.onChanged({type:"Changed",removed:c,added:[],changed:[]})},removeAnnotation:function(a){if(a&&(a=this._getAnnotationIndex(a),!(a<0)))this.onChanged({type:"Changed",
removed:this._annotations.splice(a,1),added:[],changed:[]})},replaceAnnotations:function(a,b){var c=this._annotations,d,e,f,i=[];if(a)for(d=a.length-1;d>=0;d--)f=a[d],e=this._getAnnotationIndex(f),e<0||(c.splice(e,1),i.splice(0,0,f));b||(b=[]);for(d=0;d<b.length;d++)f=b[d],e=this._binarySearch(c,f.start),c.splice(e,0,f);this.onChanged({type:"Changed",removed:i,added:b,changed:[]})},setTextModel:function(a){this._model&&this._model.removeEventListener("Changed",this._listener.onChanged);(this._model=
a)&&this._model.addEventListener("Changed",this._listener.onChanged)},_binarySearch:function(a,b){for(var c=a.length,d=-1,e;c-d>1;)e=Math.floor((c+d)/2),b<=a[e].start?c=e:d=e;return c},_getAnnotationIndex:function(a){for(var b=this._annotations,c=this._binarySearch(b,a.start);c<b.length&&b[c].start===a.start;){if(b[c]===a)return c;c++}return-1},_onChanged:function(a){var b=a.start,c=a.removedCharCount,d=this._annotations,e=b+c;if(0<d.length){for(var f={type:"Changed",added:[],removed:[],changed:[],
textModelChangedEvent:a},a=a.addedCharCount-c,c=0;c<d.length;c++){var i=d[c];i.start>=e?(i.start+=a,i.end+=a,f.changed.push(i)):i.end<=b||(i.start<b&&e<i.end?(i.end+=a,f.changed.push(i)):(d.splice(c,1),f.removed.push(i),c--))}if(f.added.length>0||f.removed.length>0||f.changed.length>0)this.onChanged(f)}}};k.EventTarget.addMixin(c.prototype);a.prototype={destroy:function(){var a=this._view;if(a)a.removeEventListener("Destroy",this._listener.onDestroy),a.removeEventListener("LineStyle",this._listener.onLineStyle),
this.view=null;(a=this._annotationModel)&&a.removeEventListener("Changed",this._listener.onChanged)},_mergeStyle:function(a,b){if(b){a||(a={});a.styleClass&&b.styleClass&&a.styleClass!==b.styleClass?a.styleClass+=" "+b.styleClass:a.styleClass=b.styleClass;var c;if(b.tagName&&!a.tagName)a.tagName=b.tagName;if(b.style){if(!a.style)a.style={};for(c in b.style)a.style[c]||(a.style[c]=b.style[c])}if(b.attributes){if(!a.attributes)a.attributes={};for(c in b.attributes)a.attributes[c]||(a.attributes[c]=
b.attributes[c])}}return a},_mergeStyleRanges:function(a,b){a||(a=[]);var c,d;for(d=0;d<a.length&&b;d++){var e=a[d];if(b.end<=e.start)break;if(!(b.start>=e.end)){c=this._mergeStyle({},e.style);c=this._mergeStyle(c,b.style);var f=[];f.push(d,1);b.start<e.start&&f.push({start:b.start,end:e.start,style:b.style});b.start>e.start&&f.push({start:e.start,end:b.start,style:e.style});f.push({start:Math.max(e.start,b.start),end:Math.min(e.end,b.end),style:c});b.end<e.end&&f.push({start:b.end,end:e.end,style:e.style});
b=b.end>e.end?{start:e.end,end:b.end,style:b.style}:null;Array.prototype.splice.apply(a,f)}}b&&(c=this._mergeStyle({},b.style),a.splice(d,0,{start:b.start,end:b.end,style:c}));return a},_onAnnotationModelChanged:function(a){function b(b){for(var a=0;a<b.length;a++)if(d.isAnnotationTypeVisible(b[a].type)){var g=b[a].start,f=b[a].end;e.getBaseModel&&(g=e.mapOffset(g,!0),f=e.mapOffset(f,!0));g!==-1&&f!==-1&&c.redrawRange(g,f)}}if(!a.textModelChangedEvent){var c=this._view;if(c){var d=this,e=c.getModel();
b(a.added);b(a.removed);b(a.changed)}}},_onDestroy:function(){this.destroy()},_onLineStyle:function(a){var b=this._annotationModel,c=a.textView.getModel(),d=b.getTextModel(),e=a.lineStart,f=a.lineStart+a.lineText.length;d!==c&&(e=c.mapOffset(e),f=c.mapOffset(f));for(b=b.getAnnotations(e,f);b.hasNext();)if(e=b.next(),this.isAnnotationTypeVisible(e.type)){if(e.rangeStyle){var f=e.start,i=e.end;d!==c&&(f=c.mapOffset(f,!0),i=c.mapOffset(i,!0));a.ranges=this._mergeStyleRanges(a.ranges,{start:f,end:i,style:e.rangeStyle})}if(e.lineStyle)a.style=
this._mergeStyle({},a.style),a.style=this._mergeStyle(a.style,e.lineStyle)}}};f.addMixin(a.prototype);return{FoldingAnnotation:h,AnnotationType:e,AnnotationTypeList:f,AnnotationModel:c,AnnotationStyler:a}});
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,h,e,d,f){function c(a){a=a||{};this._domNode=a.domNode;this._statusReporter=a.statusReporter;this._dirty=!1;this._title=null}function a(a){a=a||{};c.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 i=e.AnnotationType;c.prototype={destroy:function(){this.uninstall();this._statusReporter=this._domNode=null},focus:function(){},getModel:function(){return this._model},
getText:function(a,b){return this.getModel().getText(a,b)},getTitle:function(){return this._title},install:function(){},isDirty:function(){return this._dirty},markClean:function(){this.setDirty(!1)},onDirtyChanged:function(a){return this.dispatchEvent(a)},onInputChanged:function(a){return this.dispatchEvent(a)},reportStatus:function(a,b,c){this._statusReporter&&this._statusReporter(a,b,c)},resize:function(){},setDirty:function(a){if(this._dirty!==a)this._dirty=a,this.onDirtyChanged({type:"DirtyChanged"})},
setInput:function(a,b,c,d){this._title=a;this.onInputChanged({type:"InputChanged",title:a,message:b,contents:c,contentsSaved:d})},uninstall:function(){}};k.EventTarget.addMixin(c.prototype);a.prototype=new c;d.mixin(a.prototype,{destroy:function(){c.prototype.destroy.call(this);this._textViewFactory=this._undoStackFactory=this._textDNDFactory=this._annotationFactory=this._foldingRulerFactory=this._lineNumberRulerFactory=this._contentAssistFactory=this._keyBindingFactory=null},getAnnotationModel:function(){return this._annotationModel},
getAnnotationRuler:function(){return this._annotationRuler},getAnnotationStyler:function(){return this._annotationStyler},getContentAssist:function(){return this._contentAssist},getFoldingRuler:function(){return this._foldingRuler},getLineNumberRuler:function(){return this._lineNumberRuler},getModel:function(){var a=this._textView.getModel();a.getBaseModel&&(a=a.getBaseModel());return a},getOverviewRuler:function(){return this._overviewRuler},getTextView:function(){return this._textView},getUndoStack:function(){return this._undoStack},
getKeyModes:function(){return this._textView.getKeyModes()},getSourceCodeActions:function(){return this._sourceCodeActions},getLinkedMode:function(){return this._linkedMode},getTextActions:function(){return this._textActions},focus:function(){this._textView&&this._textView.focus()},markClean:function(){this.getUndoStack().markClean()},resize:function(){this._textView&&this._textView.resize()},setAnnotationRulerVisible:function(a,b){if(this._annotationRulerVisible!==a||b)if(this._annotationRulerVisible=
a,this._annotationRuler){var c=this._textView;a?c.addRuler(this._annotationRuler,0):c.removeRuler(this._annotationRuler)}},setFoldingRulerVisible:function(a,b){if(this._foldingRulerVisible!==a||b)if(this._foldingRulerVisible=a,this._foldingRuler){var c=this._textView;c.getModel().getBaseModel&&(a?c.addRuler(this._foldingRuler):c.removeRuler(this._foldingRuler))}},setLineNumberRulerVisible:function(a,b){if(this._lineNumberRulerVisible!==a||b)if(this._lineNumberRulerVisible=a,this._lineNumberRuler){var c=
this._textView;a?c.addRuler(this._lineNumberRuler,!this._annotationRulerVisible?0:1):c.removeRuler(this._lineNumberRuler)}},setOverviewRulerVisible:function(a,b){if(this._overviewRulerVisible!==a||b)if(this._overviewRulerVisible=a,this._overviewRuler){var c=this._textView;a?c.addRuler(this._overviewRuler):c.removeRuler(this._overviewRuler)}},mapOffset:function(a,b){var c=this._textView.getModel();c.getBaseModel&&(a=c.mapOffset(a,b));return 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(),c=this._annotationModel;if(c&&b.getBaseModel)for(a=c.getAnnotations(a,a+1);a.hasNext();)b=a.next(),b.type===i.ANNOTATION_FOLDING&&b.expand&&(b.expand(),c.modifyAnnotation(b))},setCaretOffset:function(a,b,c){var d=this._textView,e=d.getModel();e.getBaseModel&&(this._expandOffset(a),
a=e.mapOffset(a,!0));d.setCaretOffset(a,b,c)},setText:function(a,b,c){var d=this._textView,e=d.getModel();e.getBaseModel&&(b!==void 0&&(this._expandOffset(b),b=e.mapOffset(b,!0)),c!==void 0&&(this._expandOffset(c),c=e.mapOffset(c,!0)));d.setText(a,b,c)},setSelection:function(a,b,c,d){var e=this._textView,f=e.getModel();f.getBaseModel&&(this._expandOffset(a),this._expandOffset(b),a=f.mapOffset(a,!0),b=f.mapOffset(b,!0));e.setSelection(a,b,c,d)},moveSelection:function(a,b,c,d){var e=this._textView;
this.setSelection(a,b||a,1/3,function(){(d===void 0||d)&&e.focus();c&&c()})},checkDirty:function(){this.setDirty(!this._undoStack.isClean())},_getTooltipInfo:function(a,b){var c=this._textView,d=this.getAnnotationModel();if(!d)return null;var e=this._annotationStyler;if(!e)return null;var f=c.getOffsetAtLocation(a,b);if(f===-1)return null;f=this.mapOffset(f);e=e.getAnnotationsByType(d,f,f+1);d=[];for(f=0;f<e.length;f++)e[f].rangeStyle&&d.push(e[f]);if(d.length===0)return null;c=c.convert({x:a,y:b},
"document","page");return{contents:d,anchor:"left",x:c.x+10,y:c.y+20}},_highlightCurrentLine:function(a,b){var c=this._annotationModel;if(c){var d=this._textView;if(!d.getOptions("singleMode")){var e=d.getModel(),f=b?e.getLineAtOffset(b.start):-1,h=e.getLineAtOffset(a.start),d=a.start===a.end,j=!b||b.start===b.end,k=e.getLineStart(h),v=e.getLineEnd(h);e.getBaseModel&&(k=e.mapOffset(k),v=e.mapOffset(v));e=this._currentLineAnnotation;if(!(f===h&&j&&d&&e&&e.start===k&&e.end===v)){var f=e?[e]:null,w;
d&&(e=i.createAnnotation(i.ANNOTATION_CURRENT_LINE,k,v),w=[e]);this._currentLineAnnotation=e;c.replaceAnnotations(f,w)}}}},install:function(){this.installTextView()},installTextView:function(){if(!this._textView){this._textView=this._textViewFactory();if(this._undoStackFactory)this._undoStack=this._undoStackFactory.createUndoStack(this);if(this._textDNDFactory)this._textDND=this._textDNDFactory.createTextDND(this,this._undoStack);if(this._contentAssistFactory)this._contentAssist=this._contentAssistFactory.createContentAssistMode(this).getContentAssist();
var a=this,b=this._textView,c=this;this._listener={onModelChanged:function(){c.checkDirty()},onMouseOver:function(b){c._listener.onMouseMove(b)},onMouseMove:function(a){var d=h.Tooltip.getTooltip(b);if(d&&!(c._listener.lastMouseX===a.event.clientX&&c._listener.lastMouseY===a.event.clientY))c._listener.lastMouseX=a.event.clientX,c._listener.lastMouseY=a.event.clientY,d.setTarget({x:a.x,y:a.y,getTooltipInfo:function(){return c._getTooltipInfo(this.x,this.y)}})},onMouseOut:function(a){var d=h.Tooltip.getTooltip(b);
if(d&&!(c._listener.lastMouseX===a.event.clientX&&c._listener.lastMouseY===a.event.clientY))c._listener.lastMouseX=a.event.clientX,c._listener.lastMouseY=a.event.clientY,d.setTarget(null)},onScroll:function(){var a=h.Tooltip.getTooltip(b);a&&a.setTarget(null,0,0)},onSelection:function(b){c._updateCursorStatus();c._highlightCurrentLine(b.newValue,b.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 c=this.getView().getModel(),d=this.getAnnotationModel(),e=a.mapOffset(c.getLineStart(b)),b=a.mapOffset(c.getLineEnd(b)),c=d.getAnnotations(e,b),f=null;c.hasNext();){var h=c.next();if(h.type===i.ANNOTATION_BOOKMARK){f=h;break}}f?d.removeAnnotation(f):(f=i.createAnnotation(i.ANNOTATION_BOOKMARK,e,b),f.title=void 0,d.addAnnotation(f))}};if(this._annotationFactory){var e=b.getModel();e.getBaseModel&&(e=e.getBaseModel());
if(this._annotationModel=this._annotationFactory.createAnnotationModel(e))if(e=this._annotationStyler=this._annotationFactory.createAnnotationStyler(b,this._annotationModel))e.addAnnotationType(i.ANNOTATION_CURRENT_SEARCH),e.addAnnotationType(i.ANNOTATION_MATCHING_SEARCH),e.addAnnotationType(i.ANNOTATION_ERROR),e.addAnnotationType(i.ANNOTATION_WARNING),e.addAnnotationType(i.ANNOTATION_MATCHING_BRACKET),e.addAnnotationType(i.ANNOTATION_CURRENT_BRACKET),e.addAnnotationType(i.ANNOTATION_CURRENT_LINE),
e.addAnnotationType(i.ANNOTATION_READ_OCCURRENCE),e.addAnnotationType(i.ANNOTATION_WRITE_OCCURRENCE),e.addAnnotationType(i.ANNOTATION_SELECTED_LINKED_GROUP),e.addAnnotationType(i.ANNOTATION_CURRENT_LINKED_GROUP),e.addAnnotationType(i.ANNOTATION_LINKED_GROUP),e.addAnnotationType("orion.annotation.highlightError");b.annotationModel=this._annotationModel;var e=this._annotationFactory.createAnnotationRulers(this._annotationModel),f=this._annotationRuler=e.annotationRuler;if(f)f.onDblClick=d,f.setMultiAnnotationOverlay({html:"<div class='annotationHTML overlay'></div>"}),
f.addAnnotationType(i.ANNOTATION_ERROR),f.addAnnotationType(i.ANNOTATION_WARNING),f.addAnnotationType(i.ANNOTATION_TASK),f.addAnnotationType(i.ANNOTATION_BOOKMARK);this.setAnnotationRulerVisible(this._annotationRulerVisible||this._annotationRulerVisible===void 0,!0);if(f=this._overviewRuler=e.overviewRuler)f.addAnnotationType(i.ANNOTATION_CURRENT_SEARCH),f.addAnnotationType(i.ANNOTATION_MATCHING_SEARCH),f.addAnnotationType(i.ANNOTATION_READ_OCCURRENCE),f.addAnnotationType(i.ANNOTATION_WRITE_OCCURRENCE),
f.addAnnotationType(i.ANNOTATION_CURRENT_BLAME),f.addAnnotationType(i.ANNOTATION_ERROR),f.addAnnotationType(i.ANNOTATION_WARNING),f.addAnnotationType(i.ANNOTATION_TASK),f.addAnnotationType(i.ANNOTATION_BOOKMARK),f.addAnnotationType(i.ANNOTATION_MATCHING_BRACKET),f.addAnnotationType(i.ANNOTATION_CURRENT_BRACKET),f.addAnnotationType(i.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(i.ANNOTATION_CURRENT_BLAME),this._lineNumberRuler.addAnnotationType(i.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(i.ANNOTATION_FOLDING),
this.setFoldingRulerVisible(this._foldingRulerVisible||this._foldingRulerVisible===void 0,!0);this.dispatchEvent({type:"TextViewInstalled",textView:b})}},uninstall:function(){this.uninstallTextView()},uninstallTextView:function(){var a=this._textView;if(a)a.destroy(),this._textView=this._undoStack=this._textDND=this._contentAssist=this._listener=this._annotationModel=this._annotationStyler=this._annotationRuler=this._overviewRuler=this._lineNumberRuler=this._foldingRuler=this._currentLineAnnotation=
this._title=null,this._dirty=!1,this._foldingRulerVisible=this._overviewRulerVisible=this._lineNumberRulerVisible=this._annotationRulerVisible=void 0,this.dispatchEvent({type:"TextViewUninstalled",textView:a})},_updateCursorStatus:function(){var a=this.getModel(),b=this.getCaretOffset(),c=a.getLineAtOffset(b),a=a.getLineStart(c);b-=a;for(var a=this.getKeyModes(),d=0;d<a.length;d++){var e=a[d];if(e.isActive()&&e.isStatusActive&&e.isStatusActive())return}this.reportStatus(f.formatMessage(j.lineColumn,
c+1,b+1))},showAnnotations:function(a,b,c,d){var e=this._annotationModel;if(e){for(var f=[],h=[],j=e.getTextModel(),k=e.getAnnotations(0,j.getCharCount()),v;k.hasNext();)v=k.next(),b.indexOf(v.type)!==-1&&v.creatorID===this&&f.push(v);if(a)for(b=0;b<a.length;b++)if(v=a[b]){if(c)v=c(v);else{var w;typeof v.line==="number"?(w=j.getLineStart(v.line-1),k=w+v.start-1,w+=v.end):(k=v.start,w=v.end);var u=d(v);if(!u)continue;v=i.createAnnotation(u,k,w,v.description)}v.creatorID=this;h.push(v)}e.replaceAnnotations(f,
h)}},showProblems:function(a){this.showAnnotations(a,[i.ANNOTATION_ERROR,i.ANNOTATION_WARNING,i.ANNOTATION_TASK],null,function(b){switch(b.severity){case "error":return i.ANNOTATION_ERROR;case "warning":return i.ANNOTATION_WARNING;case "task":return i.ANNOTATION_TASK}return null})},showOccurrences:function(a){this.showAnnotations(a,[i.ANNOTATION_READ_OCCURRENCE,i.ANNOTATION_WRITE_OCCURRENCE],null,function(b){return b.readAccess?i.ANNOTATION_READ_OCCURRENCE:i.ANNOTATION_WRITE_OCCURRENCE})},showBlame:function(a){var b=
this._blameRGB,c=this.getTextView().getOptions("parent").ownerDocument;if(!b){var h=f.createElement(c,"div");h.className="annotation blame";c.body.appendChild(h);var m=(c.defaultView||c.parentWindow).getComputedStyle(h).getPropertyValue("background-color");h.parentNode.removeChild(h);var h=m.indexOf("("),k=m.indexOf(")"),m=m.substring(h+1,k);this._blameRGB=b=m.split(",").slice(0,3)}var t=function(){var b=e.AnnotationType.createAnnotation(this.groupType,this.start,this.end,this.title);b.style=d.mixin({},
b.style);b.style.style=d.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},r=function(){var b=f.createElement(c,"div");b.className="tooltipTitle";var a=this.blame.Message.indexOf("\n");if(a===-1)a=this.blame.Message.length;var d=f.createElement(c,"a");d.href=this.blame.CommitLink;d.appendChild(c.createTextNode(this.blame.Message.substring(0,a)));b.appendChild(d);b.appendChild(f.createElement(c,"br"));
b.appendChild(c.createTextNode(f.formatMessage(j.committerOnTime,this.blame.AuthorName,this.blame.Time)));return b},s=this.getModel();this.showAnnotations(a,[i.ANNOTATION_BLAME,i.ANNOTATION_CURRENT_BLAME],function(a){var c=s.getLineStart(a.Start-1),g=s.getLineEnd(a.End-1,!0),c=e.AnnotationType.createAnnotation(i.ANNOTATION_BLAME,c,g,r),g=b.slice(0);g.push(a.Shade);c.style=d.mixin({},c.style);c.style.style=d.mixin({},c.style.style);c.style.style.backgroundColor="rgba("+g.join()+")";c.groupId=a.Name;
c.groupType=i.ANNOTATION_CURRENT_BLAME;c.createGroupAnnotation=t;c.html='<img class="annotationHTML blame" src="'+a.AuthorImage+'"/>';c.blame=a;return c})},showSelection:function(a,b,c,d,e){typeof a==="number"?(typeof b!=="number"&&(b=a),this.moveSelection(a,b)):typeof c==="number"&&(a=this.getModel().getLineStart(c-1),typeof d==="number"&&(a+=d),typeof e!=="number"&&(e=0),this.moveSelection(a,a+e))},setInput:function(a,b,d,e){this._textView&&(e||(b?this._textView.setText(b):d!==null&&d!==void 0&&
(this._textView.setText(d),this._textView.getModel().setLineDelimiter("auto"),this._highlightCurrentLine(this._textView.getSelection())),this._undoStack.reset(),this._textView.focus()),this.checkDirty());c.prototype.setInput.call(this,a,b,d,e)},onGotoLine:function(a,b,c,d){if(this._textView){var e=this.getModel(),a=Math.max(0,Math.min(a,e.getLineCount()-1)),f=e.getLineStart(a),i=0;c===void 0&&(c=0);typeof b==="string"?(a=e.getLine(a).indexOf(b),a!==-1&&(i=a,c=i+b.length)):(i=b,b=e.getLineEnd(a)-f,
i=Math.min(i,b),c=Math.min(c,b));this.moveSelection(f+i,f+c,d)}}});return{BaseEditor:c,Editor:a}});
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,h,e,d,f,c){function a(b){var a=b.getTextView();h.KeyMode.call(this,a);this.editor=b;this._active=!1;this._success=!0;this._ignoreSelection=!1;this._prefix="";a.setAction("incrementalFindCancel",function(){this.setActive(!1);return!0}.bind(this));a.setAction("incrementalFindBackspace",function(){return this._backspace()}.bind(this));
var c=this;this._listener={onVerify:function(b){var a=c.editor,e=a.getModel(),g=a.mapOffset(b.start),a=a.mapOffset(b.end),e=e.getText(g,a);if((e=c._prefix.match(RegExp("^"+d.escape(e),"i")))&&e.length>0)c._prefix+=b.text,c._success=!0,c._status(),c.find(c._forward,!0),b.text=null},onSelection:function(){c._ignoreSelection||c.setActive(!1)}}}function i(b,a,c){if(b){this._editor=b;this._undoStack=a;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(b){d._removeCurrentAnnotation(b)}};this.setOptions(c)}}var g={};a.prototype=new h.KeyMode;f.mixin(a.prototype,{createKeyBindings:function(){var b=k.KeyBinding,a=[];a.push({actionID:"incrementalFindBackspace",keyBinding:new b(8)});a.push({actionID:"incrementalFindCancel",keyBinding:new b(13)});a.push({actionID:"incrementalFindCancel",
keyBinding:new b(27)});a.push({actionID:"incrementalFindReverse",keyBinding:new b(38)});a.push({actionID:"incrementalFind",keyBinding:new b(40)});a.push({actionID:"incrementalFindReverse",keyBinding:new b("k",!0,!0)});a.push({actionID:"incrementalFind",keyBinding:new b("k",!0)});return a},find:function(b,a){this._forward=b;if(!this.isActive())return this.setActive(!0),!1;var c=this._prefix;if(c.length===0)return!1;var d=this.editor,e=d.getModel(),e=b?this._success?a?this._start:d.getCaretOffset()+
1:0:this._success?a?this._start:d.getCaretOffset():e.getCharCount()-1;if(c=d.getModel().find({string:c,start:e,reverse:!b,caseInsensitive:c.toLowerCase()===c}).next()){if(!a)this._start=e;this._ignoreSelection=this._success=!0;d.moveSelection(b?c.start:c.end,b?c.end:c.start);this._ignoreSelection=!1}else this._success=!1;this._status();return!0},isActive:function(){return this._active},isStatusActive:function(){return this.isActive()},setActive:function(b){if(this._active!==b)this._active=b,this._prefix=
"",this._success=!0,b=this.editor.getTextView(),this._start=this.editor.getCaretOffset(),this.editor.setCaretOffset(this._start),this._active?(b.addEventListener("Verify",this._listener.onVerify),b.addEventListener("Selection",this._listener.onSelection),b.addKeyMode(this)):(b.removeEventListener("Verify",this._listener.onVerify),b.removeEventListener("Selection",this._listener.onSelection),b.removeKeyMode(this)),this._status()},_backspace:function(){var b=this._prefix,b=this._prefix=b.substring(0,
b.length-1);return b.length===0?(this._ignoreSelection=this._success=!0,this.editor.setCaretOffset(this.editor.getSelection().start),this._ignoreSelection=!1,this._status(),!0):this.find(this._forward,!0)},_status:function(){if(this.isActive()){var b;b=this._forward?this._success?j.incrementalFindStr:j.incrementalFindStrNotFound:this._success?j.incrementalFindReverseStr:j.incrementalFindReverseStrNotFound;b=c.formatMessage(b,this._prefix);this.editor.reportStatus(b,this._success?"":"error")}else this.editor.reportStatus("")}});
g.IncrementalFind=a;i.prototype={find:function(b,a,c){this.setOptions({reverse:!b});var d=this.getFindString(),e;if(a)d=a.findString||d,e=a.count;b=this.getOptions();this.setOptions(a);a=c?this._startOffset:this.getStartOffset();if((e=this._doFind(d,a,e))&&!c)this._startOffset=e.start;this.setOptions(b);this._hideAfterFind&&this.hide();return e},getStartOffset:function(){return this._start!==void 0?this._start:this._reverse?this._editor.getSelection().start-1:this._editor.getCaretOffset()},getFindString:function(){var b=
this._editor.getSelection(),b=this._editor.getText(b.start,b.end);this._regex&&(b=d.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 b=this._editor.getTextView();b&&(b.removeEventListener("Focus",this._listeners.onEditorFocus),b.focus())},_processReplaceString:function(b){var a=b;if(this._regex){for(var a="",c=!1,d=this._editor.getModel().getLineDelimiter(),e=0;e<b.length;e++){var g=b.substring(e,e+1);if(c){switch(g){case "R":a+=d;break;case "r":a+=
"\r";break;case "n":a+="\n";break;case "t":a+="\t";break;case "\\":a+="\\";break;default:a+="\\"+g}c=!1}else g==="\\"?c=!0:a+=g}c&&(a+="\\")}return a},isVisible:function(){return this._visible},replace:function(){var b=this.getFindString();if(b){var a=this._editor,c=this._processReplaceString(this.getReplaceString()),d=a.getSelection().start;if(a=a.getModel().find({string:b,start:d,reverse:!1,wrap:this._wrap,regex:this._regex,wholeWord:this._wholeWord,caseInsensitive:this._caseInsensitive}).next())this.startUndo(),
this._doReplace(a.start,a.end,b,c),this.endUndo()}this._findAfterReplace&&b&&this._doFind(b,this.getStartOffset())},replaceAll:function(){var b=this.getFindString();if(b){this._replacingAll=!0;var a=this._editor,d=a.getTextView();a.reportStatus(j.replaceAll);var e=this._processReplaceString(this.getReplaceString()),g=this;window.setTimeout(function(){for(var f=0,i=0;;){var h=g._doFind(b,f,null,!0);if(!h)break;i++;i===1&&(d.setRedraw(!1),g.startUndo());g._doReplace(h.start,h.end,b,e);f=g.getStartOffset()}i>
0&&(g.endUndo(),d.setRedraw(!0));f>0?a.reportStatus(c.formatMessage(j.replacedMatches,i)):a.reportStatus(j.nothingReplaced,"error");g._replacingAll=!1},100)}},setOptions:function(b){if(b){if((b.showAll===!0||b.showAll===!1)&&this._showAll!==b.showAll)if(this._showAll=b.showAll,this.isVisible())if(this._showAll)this._markAllOccurrences();else{var a=this._editor.getAnnotationModel();a&&a.removeAnnotations(e.AnnotationType.ANNOTATION_MATCHING_SEARCH)}if(b.caseInsensitive===!0||b.caseInsensitive===!1)this._caseInsensitive=
b.caseInsensitive;if(b.wrap===!0||b.wrap===!1)this._wrap=b.wrap;if(b.wholeWord===!0||b.wholeWord===!1)this._wholeWord=b.wholeWord;if(b.incremental===!0||b.incremental===!1)this._incremental=b.incremental;if(b.regex===!0||b.regex===!1)this._regex=b.regex;if(b.findAfterReplace===!0||b.findAfterReplace===!1)this._findAfterReplace=b.findAfterReplace;if(b.hideAfterFind===!0||b.hideAfterFind===!1)this._hideAfterFind=b.hideAfterFind;if(b.reverse===!0||b.reverse===!1)this._reverse=b.reverse;if(b.hasOwnProperty("findCallback"))this._findCallback=
b.findCallback;if(b.hasOwnProperty("start"))this._start=b.start;if(b.hasOwnProperty("end"))this._end=b.end}},show:function(b){this._visible=!0;if(b){if(!this._savedOptions)this._savedOptions=[];this._savedOptions.push(this.getOptions());this.setOptions(b)}this._startOffset=this._editor.getSelection().start;this._editor.getTextView().addEventListener("Focus",this._listeners.onEditorFocus);var a=this;window.setTimeout(function(){a._incremental&&a.find(!0,null,!0)},0)},startUndo:function(){this._undoStack&&
this._undoStack.startCompoundChange()},endUndo:function(){this._undoStack&&this._undoStack.endCompoundChange()},_find:function(b,a,c){return this._editor.getModel().find({string:b,start:a,end:this._end,reverse:this._reverse,wrap:c?!1:this._wrap,regex:this._regex,wholeWord:this._wholeWord,caseInsensitive:this._caseInsensitive})},_doFind:function(b,a,c,d){var c=c||1,g=this._editor;if(!b)return this._removeAllAnnotations(),null;this._lastString=b;var f,i;if(this._regex)try{i=this._find(b,a,d)}catch(h){g.reportStatus(h.message,
"error");return}else i=this._find(b,a,d);for(b=0;b<c&&i.hasNext();b++)f=i.next();if(!this._replacingAll){f?this._editor.reportStatus(""):this._editor.reportStatus(j.notFound,"error");if(this.isVisible()){c=e.AnnotationType.ANNOTATION_CURRENT_SEARCH;if(i=g.getAnnotationModel())i.removeAnnotations(c),f&&i.addAnnotation(e.AnnotationType.createAnnotation(c,f.start,f.end));if(this._showAll){this._timer&&window.clearTimeout(this._timer);var k=this;this._timer=window.setTimeout(function(){k._markAllOccurrences();
k._timer=null},500)}}this._findCallback?this._findCallback(f):f&&g.moveSelection(f.start,f.end,null,!1)}return f},_doReplace:function(b,a,c,d){var e=this._editor;if(this._regex&&(d=e.getText(b,a).replace(RegExp(c,this._caseInsensitive?"i":""),d),!d))return;e.setText(d,b,a);e.setSelection(b,b+d.length,!0)},_markAllOccurrences:function(){var b=this._editor.getAnnotationModel();if(b){for(var a=e.AnnotationType.ANNOTATION_MATCHING_SEARCH,c=b.getAnnotations(0,b.getTextModel().getCharCount()),d=[],g;c.hasNext();){var f=
c.next();f.type===a&&d.push(f)}if(this.isVisible()){c=this.getFindString();c=this._editor.getModel().find({string:c,regex:this._regex,wholeWord:this._wholeWord,caseInsensitive:this._caseInsensitive});for(g=[];c.hasNext();)f=c.next(),g.push(e.AnnotationType.createAnnotation(a,f.start,f.end))}b.replaceAnnotations(d,g)}},_removeAllAnnotations:function(){var b=this._editor.getAnnotationModel();b&&(b.removeAnnotations(e.AnnotationType.ANNOTATION_CURRENT_SEARCH),b.removeAnnotations(e.AnnotationType.ANNOTATION_MATCHING_SEARCH))},
_removeCurrentAnnotation:function(){var b=this._editor.getAnnotationModel();b&&b.removeAnnotations(e.AnnotationType.ANNOTATION_CURRENT_SEARCH)}};g.Find=i;return g});
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,h,e,d,f){function c(b,a,c){this.editor=b;this.undoStack=a;this._incrementalFind=new d.IncrementalFind(b);this._find=c?c:new d.Find(b,a);this._lastEditLocation=null;this.init()}function a(b,a,c,d){this.editor=b;this.undoStack=a;this.contentAssist=c;this.linkedMode=d;this.contentAssist&&this.contentAssist.addEventListener("ProposalApplied",
this.contentAssistProposalApplied.bind(this));this.init()}var i=h.AnnotationType,g={};c.prototype={init:function(){var b=this.editor.getTextView();this._lastEditListener={onModelChanged:function(b){if(this.editor.isDirty())this._lastEditLocation=b.start+b.addedCharCount}.bind(this)};b.addEventListener("ModelChanged",this._lastEditListener.onModelChanged);b.setAction("undo",function(){return this.undoStack?(this.undoStack.undo(),!0):!1}.bind(this),{name:j.undo});b.setAction("redo",function(){return this.undoStack?
(this.undoStack.redo(),!0):!1}.bind(this),{name:j.redo});b.setKeyBinding(new k.KeyBinding("f",!0),"find");b.setAction("find",function(){if(this._find){var b=this.editor.getSelection();(b=prompt(j.find,this.editor.getText(b.start,b.end)))&&this._find.find(!0,{findString:b})}}.bind(this),{name:j.find});b.setKeyBinding(new k.KeyBinding("k",!0),"findNext");b.setAction("findNext",function(b){return this._find?(this._find.find(!0,b),!0):!1}.bind(this),{name:j.findNext});b.setKeyBinding(new k.KeyBinding("k",
!0,!0),"findPrevious");b.setAction("findPrevious",function(b){return this._find?(this._find.find(!1,b),!0):!1}.bind(this),{name:j.findPrevious});b.setKeyBinding(new k.KeyBinding("j",!0),"incrementalFind");b.setAction("incrementalFind",function(){this._incrementalFind&&this._incrementalFind.find(!0);return!0}.bind(this),{name:j.incrementalFind});b.setKeyBinding(new k.KeyBinding("j",!0,!0),"incrementalFindReverse");b.setAction("incrementalFindReverse",function(){this._incrementalFind&&this._incrementalFind.find(!1);
return!0}.bind(this),{name:j.incrementalFindReverse});b.setAction("tab",function(){return this.indentLines()}.bind(this));b.setAction("shiftTab",function(){return this.unindentLines()}.bind(this),{name:j.unindentLines});b.setKeyBinding(new k.KeyBinding(38,!1,!1,!0),"moveLinesUp");b.setAction("moveLinesUp",function(){return this.moveLinesUp()}.bind(this),{name:j.moveLinesUp});b.setKeyBinding(new k.KeyBinding(40,!1,!1,!0),"moveLinesDown");b.setAction("moveLinesDown",function(){return this.moveLinesDown()}.bind(this),
{name:j.moveLinesDown});b.setKeyBinding(new k.KeyBinding(38,!0,!1,!0),"copyLinesUp");b.setAction("copyLinesUp",function(){return this.copyLinesUp()}.bind(this),{name:j.copyLinesUp});b.setKeyBinding(new k.KeyBinding(40,!0,!1,!0),"copyLinesDown");b.setAction("copyLinesDown",function(){return this.copyLinesDown()}.bind(this),{name:j.copyLinesDown});b.setKeyBinding(new k.KeyBinding("d",!0,!1,!1),"deleteLines");b.setAction("deleteLines",function(b){return this.deleteLines(b)}.bind(this),{name:j.deleteLines});
b.setKeyBinding(new k.KeyBinding("l",!f.isMac,!1,!1,f.isMac),"gotoLine");b.setAction("gotoLine",function(){return this.gotoLine()}.bind(this),{name:j.gotoLine});b.setKeyBinding(new k.KeyBinding(190,!0),"nextAnnotation");b.setAction("nextAnnotation",function(){return this.nextAnnotation(!0)}.bind(this),{name:j.nextAnnotation});b.setKeyBinding(new k.KeyBinding(188,!0),"previousAnnotation");b.setAction("previousAnnotation",function(){return this.nextAnnotation(!1)}.bind(this),{name:j.prevAnnotation});
b.setKeyBinding(new k.KeyBinding("e",!0,!1,!0,!1),"expand");b.setAction("expand",function(){return this.expandAnnotation(!0)}.bind(this),{name:j.expand});b.setKeyBinding(new k.KeyBinding("c",!0,!1,!0,!1),"collapse");b.setAction("collapse",function(){return this.expandAnnotation(!1)}.bind(this),{name:j.collapse});b.setKeyBinding(new k.KeyBinding("e",!0,!0,!0,!1),"expandAll");b.setAction("expandAll",function(){return this.expandAnnotations(!0)}.bind(this),{name:j.expandAll});b.setKeyBinding(new k.KeyBinding("c",
!0,!0,!0,!1),"collapseAll");b.setAction("collapseAll",function(){return this.expandAnnotations(!1)}.bind(this),{name:j.collapseAll});b.setKeyBinding(new k.KeyBinding("q",!f.isMac,!1,!1,f.isMac),"lastEdit");b.setAction("lastEdit",function(){return this.gotoLastEdit()}.bind(this),{name:j.lastEdit})},copyLinesDown:function(){var b=this.editor;if(b.getTextView().getOptions("readonly"))return!1;var a=b.getModel(),c=b.getSelection(),d=a.getLineAtOffset(c.start),c=a.getLineAtOffset(c.end>c.start?c.end-1:
c.end),e=a.getLineStart(d),d=a.getLineEnd(c,!0),g=a.getLineCount(),f="",e=a.getText(e,d);c===g-1&&(e=(f=a.getLineDelimiter())+e);b.setText(e,d,d);b.setSelection(d+f.length,d+e.length);return!0},copyLinesUp:function(){var b=this.editor;if(b.getTextView().getOptions("readonly"))return!1;var a=b.getModel(),c=b.getSelection(),d=a.getLineAtOffset(c.start),c=a.getLineAtOffset(c.end>c.start?c.end-1:c.end),d=a.getLineStart(d),e=a.getLineEnd(c,!0),g=a.getLineCount(),f="",e=a.getText(d,e);c===g-1&&(e+=f=a.getLineDelimiter());
b.setText(e,d,d);b.setSelection(d,d+e.length-f.length);return!0},deleteLines:function(b){var a=this.editor;if(a.getTextView().getOptions("readonly"))return!1;var c=1;if(b&&b.count)c=b.count;var d=a.getSelection(),e=a.getModel(),g=e.getLineAtOffset(d.start),b=e.getLineStart(g),c=d.start!==d.end||c===1?e.getLineAtOffset(d.end>d.start?d.end-1:d.end):Math.min(g+c-1,e.getLineCount()-1),c=e.getLineEnd(c,!0);a.setText("",b,c);return!0},expandAnnotation:function(b){var a=this.editor,c=a.getAnnotationModel();
if(!c)return!0;var d=a.getModel(),e=a.getCaretOffset(),g=d.getLineAtOffset(e),e=d.getLineStart(g),g=d.getLineEnd(g,!0);d.getBaseModel&&(e=d.mapOffset(e),g=d.mapOffset(g),d.getBaseModel());for(var f,d=c.getAnnotations(e,g);!f&&d.hasNext();)e=d.next(),e.type===h.AnnotationType.ANNOTATION_FOLDING&&(f=e);f&&b!==f.expanded&&(b?f.expand():(a.setCaretOffset(f.start),f.collapse()),c.modifyAnnotation(f));return!0},expandAnnotations:function(b){var a=this.editor,c=a.getTextView(),d=a.getAnnotationModel();if(!d)return!0;
var a=a.getModel(),e=d.getAnnotations(0,a.getCharCount());for(c.setRedraw(!1);e.hasNext();)a=e.next(),a.type===h.AnnotationType.ANNOTATION_FOLDING&&b!==a.expanded&&(b?a.expand():a.collapse(),d.modifyAnnotation(a));c.setRedraw(!0);return!0},indentLines:function(){var b=this.editor,a=b.getTextView();if(a.getOptions("readonly"))return!1;if(a.getOptions("tabMode")){var c=b.getModel(),d=b.getSelection(),e=c.getLineAtOffset(d.start),g=c.getLineAtOffset(d.end>d.start?d.end-1:d.end);if(e!==g){var f=[];f.push("");
for(var i=e;i<=g;i++)f.push(c.getLine(i,!0));i=c.getLineStart(e);c=c.getLineEnd(g,!0);a=a.getOptions("tabSize","expandTab");a=a.expandTab?Array(a.tabSize+1).join(" "):"\t";b.setText(f.join(a),i,c);b.setSelection(i===d.start?d.start:d.start+a.length,d.end+(g-e+1)*a.length);return!0}return!1}},gotoLastEdit:function(){typeof this._lastEditLocation==="number"&&this.editor.showSelection(this._lastEditLocation);return!0},gotoLine:function(){var b=this.editor,a=b.getModel().getLineAtOffset(b.getCaretOffset());
if(a=prompt(j.gotoLinePrompty,a+1))a=parseInt(a,10),b.onGotoLine(a-1,0);return!0},moveLinesDown:function(){var b=this.editor;if(b.getTextView().getOptions("readonly"))return!1;var a=b.getModel(),c=b.getSelection(),d=a.getLineAtOffset(c.start),e=a.getLineAtOffset(c.end>c.start?c.end-1:c.end),g=a.getLineCount();if(e===g-1)return!0;var d=a.getLineStart(d),c=a.getLineEnd(e,!0),f=a.getLineEnd(e+1,!0)-(c-d),i=0;e!==g-2?a=a.getText(d,c):(e=a.getLineEnd(e),a=a.getText(e,c)+a.getText(d,e),i+=c-e);this.startUndo();
b.setText("",d,c);b.setText(a,f,f);b.setSelection(f+i,f+i+a.length);this.endUndo();return!0},moveLinesUp:function(){var b=this.editor;if(b.getTextView().getOptions("readonly"))return!1;var a=b.getModel(),c=b.getSelection(),d=a.getLineAtOffset(c.start);if(d===0)return!0;var e=a.getLineAtOffset(c.end>c.start?c.end-1:c.end),g=a.getLineCount(),c=a.getLineStart(d-1),f=a.getLineStart(d),i=a.getLineEnd(e,!0),h=a.getText(f,i),j=0;e===g-1&&(e=a.getLineEnd(d-1),d=a.getLineEnd(d-1,!0),h+=a.getText(e,d),f=e,
j=d-e);this.startUndo();b.setText("",f,i);b.setText(h,c,c);b.setSelection(c,c+h.length-j);this.endUndo();return!0},nextAnnotation:function(b){var a=this.editor,c=a.getAnnotationModel();if(!c)return!0;var d=a.getOverviewRuler()||a.getAnnotationStyler();if(!d)return!0;for(var g=a.getModel(),f=a.getCaretOffset(),c=c.getAnnotations(b?f:0,b?g.getCharCount():f),h=null;c.hasNext();){var j=c.next();if(b){if(j.start<=f)continue}else if(j.start>=f)continue;if(!j.lineStyle&&!(j.type===i.ANNOTATION_MATCHING_BRACKET||
j.type===i.ANNOTATION_CURRENT_BRACKET||!d.isAnnotationTypeVisible(j.type)))if(h=j,b)break}if(h){var k=a.getTextView(),w=g.getLineAtOffset(h.start),u=e.Tooltip.getTooltip(k);if(!u)return a.moveSelection(h.start),!0;a.moveSelection(h.start,h.start,function(){u.setTarget({getTooltipInfo:function(){var b=k.convert({x:k.getLocationAtOffset(h.start).x,y:k.getLocationAtOffset(g.getLineStart(w)).y},"document","page");return{contents:[h],x:b.x,y:b.y+Math.floor(k.getLineHeight(w)*1.33)}}},0)})}return!0},unindentLines:function(){var b=
this.editor,a=b.getTextView();if(a.getOptions("readonly"))return!1;if(a.getOptions("tabMode")){for(var c=b.getModel(),d=b.getSelection(),e=c.getLineAtOffset(d.start),g=c.getLineAtOffset(d.end>d.start?d.end-1:d.end),f=a.getOptions("tabSize"),i=Array(f+1).join(" "),h=[],j=a=0,k=e;k<=g;k++){var p=c.getLine(k,!0);if(c.getLineStart(k)!==c.getLineEnd(k))if(p.indexOf("\t")===0)p=p.substring(1),a++;else if(p.indexOf(i)===0)p=p.substring(f),a+=f;else return!0;k===e&&(j=a);h.push(p)}e=c.getLineStart(e);f=c.getLineEnd(g,
!0);c=c.getLineStart(g);b.setText(h.join(""),e,f);g=e===d.start?d.start:d.start-j;d=Math.max(g,d.end-a+(d.end===c+1&&d.start!==d.end?1:0));b.setSelection(g,d);return!0}},startUndo:function(){this.undoStack&&this.undoStack.startCompoundChange()},endUndo:function(){this.undoStack&&this.undoStack.endCompoundChange()}};g.TextActions=c;a.prototype={init:function(){var b=this.editor.getTextView();b.setAction("lineStart",function(){return this.lineStart()}.bind(this));b.setAction("enter",function(){return this.autoIndent()}.bind(this));
b.setKeyBinding(new k.KeyBinding("t",!0,!1,!0),"trimTrailingWhitespaces");b.setAction("trimTrailingWhitespaces",function(){return this.trimTrailingWhitespaces()}.bind(this),{name:j.trimTrailingWhitespaces});b.setKeyBinding(new k.KeyBinding(191,!0),"toggleLineComment");b.setAction("toggleLineComment",function(){return this.toggleLineComment()}.bind(this),{name:j.toggleLineComment});b.setKeyBinding(new k.KeyBinding(191,!0,!f.isMac,!1,f.isMac),"addBlockComment");b.setAction("addBlockComment",function(){return this.addBlockComment()}.bind(this),
{name:j.addBlockComment});b.setKeyBinding(new k.KeyBinding(220,!0,!f.isMac,!1,f.isMac),"removeBlockComment");b.setAction("removeBlockComment",function(){return this.removeBlockComment()}.bind(this),{name:j.removeBlockComment});b.setKeyBinding(new k.KeyBinding("[",!1,!1,!1,!1,"keypress"),"autoPairSquareBracket");b.setAction("autoPairSquareBracket",function(){return this.autoPairBrackets("[","]")}.bind(this));b.setKeyBinding(new k.KeyBinding("]",!1,!1,!1,!1,"keypress"),"skipClosingSquareBracket");b.setAction("skipClosingSquareBracket",
function(){return this.skipClosingBracket("]")}.bind(this));b.setKeyBinding(new k.KeyBinding("<",!1,!1,!1,!1,"keypress"),"autoPairAngleBracket");b.setAction("autoPairAngleBracket",function(){return this.autoPairBrackets("<",">")}.bind(this));b.setKeyBinding(new k.KeyBinding(">",!1,!1,!1,!1,"keypress"),"skipClosingAngleBracket");b.setAction("skipClosingAngleBracket",function(){return this.skipClosingBracket(">")}.bind(this));b.setKeyBinding(new k.KeyBinding("(",!1,!1,!1,!1,"keypress"),"autoPairParentheses");
b.setAction("autoPairParentheses",function(){return this.autoPairBrackets("(",")")}.bind(this));b.setKeyBinding(new k.KeyBinding(")",!1,!1,!1,!1,"keypress"),"skipClosingParenthesis");b.setAction("skipClosingParenthesis",function(){return this.skipClosingBracket(")")}.bind(this));b.setKeyBinding(new k.KeyBinding("{",!1,!1,!1,!1,"keypress"),"autoPairBraces");b.setAction("autoPairBraces",function(){return this.autoPairBrackets("{","}")}.bind(this));b.setKeyBinding(new k.KeyBinding("}",!1,!1,!1,!1,"keypress"),
"skipClosingBrace");b.setAction("skipClosingBrace",function(){return this.skipClosingBracket("}")}.bind(this));b.setKeyBinding(new k.KeyBinding("'",!1,!1,!1,!1,"keypress"),"autoPairSingleQuotation");b.setAction("autoPairSingleQuotation",function(){return this.autoPairQuotations("'")}.bind(this));b.setKeyBinding(new k.KeyBinding('"',!1,!1,!1,!1,"keypress"),"autoPairDblQuotation");b.setAction("autoPairDblQuotation",function(){return this.autoPairQuotations('"')}.bind(this));b.setAction("deletePrevious",
function(){return this.deletePrevious()}.bind(this))},autoIndent:function(){var b=this.editor,a=b.getTextView();if(a.getOptions("readonly"))return!1;var c=b.getSelection();if(c.start===c.end){for(var d=b.getModel(),e=d.getLineAtOffset(c.start),g=d.getLine(e,!1),f=d.getLineStart(e),i=0,h=c.start-f,j;i<h&&((j=g.charCodeAt(i))===32||j===9);)i++;var f=g.substring(0,i),a=a.getOptions("tabSize","expandTab"),k=a.expandTab?Array(a.tabSize+1).join(" "):"\t",a=d.getLineDelimiter(),p=/^[\s]*\/\*[\*]*[\s]*$/,
q=/^[\s]*\*/,x=/\*\/[\s]*$/,A=g.substring(0,h),E=g.substring(h),K;if(this.smartIndentation&&g.charCodeAt(K=A.trimRight().length-1)===123)return d=h-K-1,E=E.length-E.trimLeft().length,g=g.charCodeAt(h+E)===125?a+f+k+a+f:a+f+k,b.setText(g,c.start-d,c.end+E),b.setCaretOffset(c.start+a.length+f.length+k.length-d),!0;else if(this.autoCompleteComments&&!x.test(A)&&(p.test(A)||q.test(A))){if(i=p.exec(A)){g=a+f+" * ";g+=x.test(E)?E.substring(0,E.length-2).trim():E.trim();if(d.getLineCount()===e+1||!q.test(d.getLine(e+
1)))g+=a+f+" */";b.setText(g,c.start,c.end+E.length);b.setCaretOffset(c.start+a.length+f.length+3);return!0}if(i=q.exec(A))for(e-=1;e>=0;e--)if(i=d.getLine(e,!1),p.test(i))return x.test(E)||g.charCodeAt(h)===47?(g=a+f+"*"+E,f=c.start+a.length+f.length+1):(g=a+f+"* "+E,f=c.start+a.length+f.length+2),b.setText(g,c.start,c.end+E.length),b.setCaretOffset(f),!0;else if(!q.test(i))break}else if(x.test(A))return g=g.substring(c.start)+a+f.substring(0,f.length-1),b.setText(g,c.start,c.end),b.setCaretOffset(c.start+
g.length),!0;else if(i>0){for(i=h;i<g.length&&((j=g.charCodeAt(i++))===32||j===9);)c.end++;b.setText(d.getLineDelimiter()+f,c.start,c.end);return!0}}return!1},addBlockComment:function(){var b=this.editor;if(b.getTextView().getOptions("readonly"))return!1;var a=b.getModel(),c=b.getSelection(),d=this._findEnclosingComment(a,c.start,c.end);if(d.commentStart!==void 0&&d.commentEnd!==void 0)return!0;a=a.getText(c.start,c.end);if(a.length===0)return!0;var d=a.length,a=a.replace(/\/\*|\*\//g,""),e=a.length;
b.setText("/*"+a+"*/",c.start,c.end);b.setSelection(c.start+2,c.end+2+(e-d));return!0},autoPairBrackets:function(b,a){if(b==="["&&!this.autoPairSquareBrackets)return!1;else if(b==="{"&&!this.autoPairBraces)return!1;else if(b==="("&&!this.autoPairParentheses)return!1;else if(b==="<"&&!this.autoPairAngleBrackets)return!1;var c=this.editor;if(c.getTextView().getOptions("readonly"))return!1;var d=c.getSelection(),e=c.getModel(),g=c.getCaretOffset()===e.getCharCount()?"":e.getText(d.start,d.start+1).trim(),
f=/^$|[)}\]>]/;if(d.start===d.end&&f.test(g))return c.setText(b+a,d.start,d.start),c.setCaretOffset(d.start+1),!0;else if(d.start!==d.end)return e=e.getText(d.start,d.end),c.setText(b+e+a,d.start,d.end),c.setSelection(d.start+1,d.end+1),!0;return!1},autoPairQuotations:function(b){if(!this.autoPairQuotation)return!1;var a=this.editor;if(a.getTextView().getOptions("readonly"))return!1;var c=a.getSelection(),d=a.getModel(),e=a.getCaretOffset(),g=e===0?"":d.getText(c.start-1,c.start).trim(),f=e===d.getCharCount()?
"":d.getText(c.start,c.start+1).trim(),e=/^"$|^'$/,i=/\w/,h=/^$|[)}\]>]/;if(c.start!==c.end){d=d.getText(c.start,c.end);if(e.test(d))return!1;a.setText(b+d+b,c.start,c.end);a.setSelection(c.start+1,c.end+1)}else if(f===b)a.setCaretOffset(c.start+1);else if(g===b||e.test(f)||i.test(g)||!h.test(f))return!1;else a.setText(b+b,c.start,c.start),a.setCaretOffset(c.start+1);return!0},contentAssistProposalApplied:function(b){b=b.data.proposal;if(b.positions&&b.positions.length>0&&this.linkedMode){for(var a=
[],c=0;c<b.positions.length;++c)a[c]={positions:[{offset:b.positions[c].offset,length:b.positions[c].length}]};this.linkedMode.enterLinkedMode({groups:a,escapePosition:b.escapePosition})}else b.groups&&b.groups.length>0&&this.linkedMode?this.linkedMode.enterLinkedMode({groups:b.groups,escapePosition:b.escapePosition}):b.escapePosition&&this.editor.getTextView().setCaretOffset(b.escapePosition);return!0},deletePrevious:function(){var b=this.editor;if(b.getTextView().getOptions("readonly"))return!1;
var a=b.getSelection(),c=b.getModel(),d=b.getCaretOffset(),e=d===0?"":c.getText(a.start-1,a.start),c=d===c.getCharCount()?"":c.getText(a.start,a.start+1);(e==="("&&c===")"||e==="["&&c==="]"||e==="{"&&c==="}"||e==="<"&&c===">"||e==='"'&&c==='"'||e==="'"&&c==="'")&&b.setText("",a.start,a.start+1);return!1},_findEnclosingComment:function(b,a,c){var d=b.getLineAtOffset(a),e=b.getLineAtOffset(c),g,f,i,h,j,k;for(g=d;g>=0;g--)if(f=b.getLine(g),i=g===d?a-b.getLineStart(d):f.length,h=f.lastIndexOf("/*",i),
f=f.lastIndexOf("*/",i),f>h)break;else if(h!==-1){j=b.getLineStart(g)+h;break}for(g=e;g<b.getLineCount();g++)if(f=b.getLine(g),i=g===e?c-b.getLineStart(e):0,h=f.indexOf("/*",i),f=f.indexOf("*/",i),h!==-1&&h<f)break;else if(f!==-1){k=b.getLineStart(g)+f;break}return{commentStart:j,commentEnd:k}},lineStart:function(){for(var b=this.editor,a=b.getModel(),c=b.getCaretOffset(),d=a.getLineAtOffset(c),e=a.getLineStart(d),a=a.getLine(d),d=0;d<a.length;d++){var g=a.charCodeAt(d);if(!(g===32||g===9))break}d+=
e;return c!==d?(b.setSelection(d,d),!0):!1},removeBlockComment:function(){var b=this.editor;if(b.getTextView().getOptions("readonly"))return!1;var a=b.getModel(),c=b.getSelection(),d=a.getText(c.start,c.end),e,g,f;for(f=0;f<d.length;f++)if(d.substring(f,f+2)==="/*"){e=c.start+f;break}for(;f<d.length;f++)if(d.substring(f,f+2)==="*/"){g=c.start+f;break}if(e!==void 0&&g!==void 0)b.setText(a.getText(e+2,g),e,g+2),b.setSelection(e,g);else{d=this._findEnclosingComment(a,c.start,c.end);if(d.commentStart===
void 0||d.commentEnd===void 0)return!0;a=a.getText(d.commentStart+2,d.commentEnd);b.setText(a,d.commentStart,d.commentEnd+2);b.setSelection(c.start-2,c.end-2)}return!0},toggleLineComment:function(){var b=this.editor;if(b.getTextView().getOptions("readonly"))return!1;for(var a=b.getModel(),c=b.getSelection(),d=a.getLineAtOffset(c.start),e=a.getLineAtOffset(c.end>c.start?c.end-1:c.end),g=!0,f=[],i,h,j=d;j<=e;j++)if(i=a.getLine(j,!0),f.push(i),!g||(h=i.indexOf("//"))===-1)g=!1;else if(h!==0){var k;for(k=
0;k<h;k++)if(g=i.charCodeAt(k),!(g===32||g===9))break;g=k===h}j=a.getLineStart(d);k=a.getLineEnd(e,!0);if(g){for(g=0;g<f.length;g++)i=f[g],h=i.indexOf("//"),f[g]=i.substring(0,h)+i.substring(h+2);f=f.join("");i=a.getLineStart(e);a=j===c.start?c.start:c.start-2;c=c.end-2*(e-d+1)+(c.end===i+1?2:0)}else f.splice(0,0,""),f=f.join("//"),a=j===c.start?c.start:c.start+2,c=c.end+2*(e-d+1);b.setText(f,j,k);b.setSelection(a,c);return!0},trimTrailingWhitespaces:function(){var b=this.editor,a=b.getModel(),c=
b.getSelection();b.getTextView().setRedraw(!1);b.getUndoStack().startCompoundChange();for(var d=/(\s+$)/,e=a.getLineCount(),g=0;g<e;g++){var f=a.getLine(g),i=d.exec(f);if(i){var h=a.getLineStart(g),f=i[0].length,i=h+i.index;a.setText("",i,i+f);if(c.start>i)c.start=Math.max(i,c.start-f);if(c.start!==c.end&&c.end>i)c.end=Math.max(i,c.end-f)}}b.getUndoStack().endCompoundChange();b.getTextView().setRedraw(!0);b.setSelection(c.start,c.end,!1)},startUndo:function(){this.undoStack&&this.undoStack.startCompoundChange()},
skipClosingBracket:function(b){var a=this.editor;if(a.getTextView().getOptions("readonly"))return!1;var c=a.getSelection(),d=a.getModel();return(a.getCaretOffset()===d.getCharCount()?"":d.getText(c.start,c.start+1))===b?(a.setCaretOffset(c.start+1),!0):!1},endUndo:function(){this.undoStack&&this.undoStack.endCompoundChange()},setAutoPairParentheses:function(b){this.autoPairParentheses=b},setAutoPairBraces:function(b){this.autoPairBraces=b},setAutoPairSquareBrackets:function(b){this.autoPairSquareBrackets=
b},setAutoPairAngleBrackets:function(b){this.autoPairAngleBrackets=b},setAutoPairQuotations:function(b){this.autoPairQuotation=b},setAutoCompleteComments:function(b){this.autoCompleteComments=b},setSmartIndentation:function(b){this.smartIndentation=b}};g.SourceCodeActions=a;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 g});
define("orion/editor/undoStack",[],function(){function j(e,d,f,c){this.offset=e;this.text=d;this.previousText=f;this.type=c}function k(e){this.owner=e;this.changes=[]}function h(e,d){this.view=e;this.size=d!==void 0?d:100;this.reset();var f=e.getModel();f.getBaseModel&&(f=f.getBaseModel());this.model=f;var c=this;this._listener={onChanging:function(a){c._onChanging(a)},onDestroy:function(a){c._onDestroy(a)}};f.addEventListener("Changing",this._listener.onChanging);e.addEventListener("Destroy",this._listener.onDestroy)}
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(e,d){this._doUndoRedo(this.offset,this.previousText,this.text,e,d);return!0},redo:function(e,d){this._doUndoRedo(this.offset,this.text,this.previousText,e,d);return!0},merge:function(e,d,f,c,a){if(c===this.type)if(c===1&&e===this.offset+this.text.length)return this.text+=
d,!0;else if(c===-1&&a===this.offset)return this.offset=e,this.previousText=f+this.previousText,!0;else if(c===-1&&e===this.offset)return this.previousText+=f,!0;return!1},_doUndoRedo:function(e,d,f,c,a){var i=c.getModel();if(i.mapOffset&&c.annotationModel){var g=i.mapOffset(e,!0);if(g<0)for(var b=c.annotationModel.getAnnotations(e,e+1);b.hasNext();){var h=b.next();if(h.type==="orion.annotation.folding"){h.expand();g=i.mapOffset(e,!0);break}}if(g<0)return;e=g}i.setText(d,e,e+f.length);a&&c.setSelection(e,
e+d.length)}};k.prototype={getRedoChanges:function(){for(var e=[],d=0;d<this.changes.length;d++)e=e.concat(this.changes[d].getRedoChanges());return e},getUndoChanges:function(){for(var e=[],d=this.changes.length-1;d>=0;d--)e=e.concat(this.changes[d].getUndoChanges());return e},add:function(e){this.changes.push(e)},end:function(e){this.endSelection=e.getSelection();this.endCaret=e.getCaretOffset();(e=this.owner)&&e.end&&e.end()},undo:function(e,d){this.changes.length>1&&e.setRedraw(!1);for(var f=this.changes.length-
1;f>=0;f--)this.changes[f].undo(e,!1);this.changes.length>1&&e.setRedraw(!0);if(d){var f=this.startSelection.start,c=this.startSelection.end;e.setSelection(this.startCaret?f:c,this.startCaret?c:f)}(f=this.owner)&&f.undo&&f.undo();return this.changes.length>0},redo:function(e,d){this.changes.length>1&&e.setRedraw(!1);for(var f=0;f<this.changes.length;f++)this.changes[f].redo(e,!1);this.changes.length>1&&e.setRedraw(!0);if(d){var f=this.endSelection.start,c=this.endSelection.end;e.setSelection(this.endCaret?
f:c,this.endCaret?c:f)}(f=this.owner)&&f.redo&&f.redo();return this.changes.length>0},merge:function(e,d,f,c,a){var i=this.changes.length;return i>0?this.changes[i-1].merge(e,d,f,c,a):!1},start:function(e){this.startSelection=e.getSelection();this.startCaret=e.getCaretOffset();(e=this.owner)&&e.start&&e.start()}};h.prototype={add:function(e){this.compoundChange?this.compoundChange.add(e):(this.stack.splice(this.index,this.stack.length-this.index,e),this.index++,this.stack.length>this.size&&(this.stack.shift(),
this.index--))},markClean:function(){this._commitUndo();if(this.cleanChange=this.stack[this.index-1])this.cleanChange.type=2},isClean:function(){return this.cleanChange===this.stack[this.index-1]},canUndo:function(){return this.index>0},canRedo:function(){return this.stack.length-this.index>0},endCompoundChange:function(){this.compoundChange&&this.compoundChange.end(this.view);this.compoundChange=void 0},getSize:function(){return{undo:this.index,redo:this.stack.length-this.index}},getRedoChanges:function(){this._commitUndo();
for(var e=[],d=this.index;d<this.stack.length;d++)e=e.concat(this.stack[d].getRedoChanges());return e},getUndoChanges:function(){this._commitUndo();for(var e=[],d=this.index;d>=0;d--)e=e.concat(this.stack[d].getUndoChanges());return e},undo:function(){this._commitUndo();var e;e=!1;this._ignoreUndo=!0;do{if(this.index<=0)break;e=this.stack[--this.index]}while(!(e=e.undo(this.view,!0)));this._ignoreUndo=!1;return e},redo:function(){this._commitUndo();var e;this._ignoreUndo=!0;do{if(this.index>=this.stack.length)break;
e=this.stack[this.index++]}while(!e.redo(this.view,!0));this._ignoreUndo=!1;return!0},reset:function(){this.index=0;this.cleanChange=void 0;this.stack=[];this._ignoreUndo=!1;this._compoundChange=void 0},startCompoundChange:function(e){this._commitUndo();e=new k(e);this.add(e);this.compoundChange=e;this.compoundChange.start(this.view);return this.compoundChange},_commitUndo:function(){this.endCompoundChange()},_onDestroy:function(){this.model.removeEventListener("Changing",this._listener.onChanging);
this.view.removeEventListener("Destroy",this._listener.onDestroy)},_onChanging:function(e){if(!this._ignoreUndo){var d=e.text,f=e.start,c=e.addedCharCount,a=e.removedCharCount,e=f+a,i=0;c===0&&a===1?i=-1:c===1&&a===0&&(i=1);c=this.stack.length;a=this.model.getText(f,e);(!(c>0&&this.index===c)||!this.stack[c-1].merge(f,d,a,i,e))&&this.add(new j(f,d,a,i))}}};return{UndoStack:h}});
define("orion/editor/rulers",["i18n!orion/editor/nls/messages","orion/editor/annotations","orion/editor/tooltip","orion/util"],function(j,k,h,e){function d(a,b,c,d){this._location=b||"left";this._overview=c||"page";this._rulerStyle=d;this._view=null;var e=this;this._listener={onTextModelChanged:function(b){e._onTextModelChanged(b)},onAnnotationModelChanged:function(b){e._onAnnotationModelChanged(b)}};this.setAnnotationModel(a)}function f(a,b,c,e,f){d.call(this,a,b,"page",c);this._oddStyle=e||{style:{backgroundColor:"white"}};
this._evenStyle=f||{style:{backgroundColor:"white"}};this._numOfDigits=0;this._firstLine=1}function c(a,b,c){d.call(this,a,b,"page",c)}function a(a,b,c){d.call(this,a,b,"document",c)}function i(a,b,d){c.call(this,a,b,d)}d.prototype={getAnnotations:function(a,b){var c=this._annotationModel;if(!c)return[];var d=this._view.getModel(),e=d.getLineStart(a),f=d.getLineEnd(b-1),i=d;d.getBaseModel&&(i=d.getBaseModel(),e=d.mapOffset(e),f=d.mapOffset(f));for(var h=[],c=this.getAnnotationsByType(c,e,f),e=0;e<
c.length;e++)for(var f=c[e],j=i.getLineAtOffset(f.start),k=i.getLineAtOffset(Math.max(f.start,f.end-1)),w=j;w<=k;w++){var u=w;if(d!==i){u=i.getLineStart(w);u=d.mapOffset(u,!0);if(u===-1)continue;u=d.getLineAtOffset(u)}if(a<=u&&u<b){var p=this._mergeAnnotation(h[u],f,w-j,k-j+1);p&&(h[u]=p)}}if(!this._multiAnnotation&&this._multiAnnotationOverlay)for(var q in h)h[q]._multiple&&(h[q].html+=this._multiAnnotationOverlay.html);return h},getAnnotationModel:function(){return this._annotationModel},getLocation:function(){return this._location},
getOverview:function(){return this._overview},getRulerStyle:function(){return this._rulerStyle},getView:function(){return this._view},getWidestAnnotation:function(){return null},setAnnotationModel:function(a){this._annotationModel&&this._annotationModel.removEventListener("Changed",this._listener.onAnnotationModelChanged);(this._annotationModel=a)&&this._annotationModel.addEventListener("Changed",this._listener.onAnnotationModelChanged)},setMultiAnnotation:function(a){this._multiAnnotation=a},setMultiAnnotationOverlay:function(a){this._multiAnnotationOverlay=
a},setView:function(a){this._onTextModelChanged&&this._view&&this._view.removeEventListener("ModelChanged",this._listener.onTextModelChanged);this._view=a;this._onTextModelChanged&&this._view&&this._view.addEventListener("ModelChanged",this._listener.onTextModelChanged)},onClick:function(a){if(a!==void 0){var b=this._view,c=b.getModel(),d=c,e=c.getLineStart(a),f=e,i=e,j=this._annotationModel;if(j){b=b.getSelection();i=c.getLineEnd(a,!0);if(e<=b.start&&b.start<i)e=b.start;c.getBaseModel&&(e=c.mapOffset(e),
i=c.mapOffset(i),d=c.getBaseModel());for(var k,i=j.getAnnotations(e,i),j=null;!k&&i.hasNext();)b=i.next(),this.isAnnotationTypeVisible(b.type)&&(j=b,b.start<=e||(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(e)?(e=k.start,i=k.end):i=e=f;c.getBaseModel&&(e=c.mapOffset(e,!0),i=c.mapOffset(i,!0))}(a=h.Tooltip.getTooltip(this._view))&&a.setTarget(null);this._view.setSelection(i,
e,1/3,function(){})}},onDblClick:function(){},onMouseMove:function(a,b){var c=h.Tooltip.getTooltip(this._view);if(c&&!(c.isVisible()&&this._tooltipLineIndex===a)){this._tooltipLineIndex=a;var d=this;c.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=h.Tooltip.getTooltip(this._view);
a&&a.setTarget(null)},_getTooltipInfo:function(a,b){if(a!==void 0){var c=this._view,d=c.getModel(),e=this._annotationModel,f=[];if(e){var f=d.getLineStart(a),i=d.getLineEnd(a);d.getBaseModel&&(f=d.mapOffset(f),i=d.mapOffset(i));f=this.getAnnotationsByType(e,f,i)}e=this._getTooltipContents(a,f);if(!e)return null;e={contents:e,anchor:this.getLocation()};f=c.getClientArea();f.y=this.getOverview()==="document"?c.convert({y:b},"view","document").y:c.getLocationAtOffset(d.getLineStart(a)).y;c.convert(f,
"document","page");e.x=f.x;e.y=f.y;e.anchor==="right"&&(e.x+=f.width);return e}},_getTooltipContents:function(a,b){return b},_onAnnotationModelChanged:function(a){function b(b){for(var a=0;a<b.length;a++)if(e.isAnnotationTypeVisible(b[a].type)){var g=b[a].start,f=b[a].end;d.getBaseModel&&(g=d.mapOffset(g,!0),f=d.mapOffset(f,!0));g!==-1&&f!==-1&&c.redrawLines(d.getLineAtOffset(g),d.getLineAtOffset(Math.max(g,f-1))+1,e)}}var c=this._view;if(c){var d=c.getModel(),e=this,f=d.getLineCount();a.textModelChangedEvent?
(a=a.textModelChangedEvent.start,d.getBaseModel&&(a=d.mapOffset(a,!0)),a=d.getLineAtOffset(a),c.redrawLines(a,f,e)):(b(a.added),b(a.removed),b(a.changed))}},_mergeAnnotation:function(a,b,c){a||(a={});if(c===0)if(a.html&&b.html){if(b.html!==a.html&&!a._multiple&&this._multiAnnotation)a.html=this._multiAnnotation.html;a._multiple=!0}else a.html=b.html;a.style=this._mergeStyle(a.style,b.style);return a},_mergeStyle:function(a,b){if(b){a||(a={});a.styleClass&&b.styleClass&&a.styleClass!==b.styleClass?
a.styleClass+=" "+b.styleClass:a.styleClass=b.styleClass;var c;if(b.style){if(!a.style)a.style={};for(c in b.style)a.style[c]===void 0&&(a.style[c]=b.style[c])}if(b.attributes){if(!a.attributes)a.attributes={};for(c in b.attributes)a.attributes[c]===void 0&&(a.attributes[c]=b.attributes[c])}}return a},_setCurrentGroup:function(a){var b=this._annotationModel,c=null,d=b.getTextModel(),e,f,i=this._currentGroupAnnotation;if(a!==-1){var h=d.getLineStart(a),j=d.getLineEnd(a);d.getBaseModel&&(h=d.mapOffset(h),
j=d.mapOffset(j));for(f=b.getAnnotations(h,j);f.hasNext();)if(e=f.next(),this.isAnnotationTypeVisible(e.type)&&e.start<=h&&e.end>=j&&e.groupId!==void 0){c=e;break}if(i&&c&&i.groupId===c.groupId)return}this._currentGroupAnnotation=null;i&&b.removeAnnotations(i.groupType);if(c&&a!==-1){this._currentGroupAnnotation=c;f=b.getAnnotations(0,d.getCharCount());for(a=[];f.hasNext();)e=f.next(),delete e.groupAnnotation,e.groupId===c.groupId&&(e=e.createGroupAnnotation(),a.push(e));b.replaceAnnotations(null,
a)}}};k.AnnotationTypeList.addMixin(d.prototype);f.prototype=new d;f.prototype.getAnnotations=function(a,b){for(var c=d.prototype.getAnnotations.call(this,a,b),e=this._view.getModel(),f=a;f<b;f++){var i=f&1?this._oddStyle:this._evenStyle,h=f;e.getBaseModel&&(h=e.getLineStart(h),h=e.getBaseModel().getLineAtOffset(e.mapOffset(h)));c[f]||(c[f]={});c[f].html=this._firstLine+h+"";if(!c[f].style)c[f].style=i}return c};f.prototype.getWidestAnnotation=function(){var a=this._view.getModel().getLineCount();
return this.getAnnotations(a-1,a)[a-1]};f.prototype.setFirstLine=function(a){this._firstLine=a!==void 0?a:1};f.prototype._onTextModelChanged=function(a){var a=a.start,b=this._view.getModel(),c=(this._firstLine+(b.getBaseModel?b.getBaseModel().getLineCount():b.getLineCount())-1+"").length;if(this._numOfDigits!==c)this._numOfDigits=c,this._view.redrawLines(b.getLineAtOffset(a),b.getLineCount(),this)};c.prototype=new d;a.prototype=new d;a.prototype.getRulerStyle=function(){var a={style:{lineHeight:"1px",
fontSize:"1px"}};return a=this._mergeStyle(a,this._rulerStyle)};a.prototype._getTooltipContents=function(a,b){if(b.length===0){var c=this._view.getModel(),f=a;c.getBaseModel&&(f=c.getLineStart(f),f=c.getBaseModel().getLineAtOffset(c.mapOffset(f)));return e.formatMessage(j.line,f+1)}return d.prototype._getTooltipContents.call(this,a,b)};a.prototype._mergeAnnotation=function(a,b,c,d){if(c===0){if(!a)a={html:"&nbsp;",style:{style:{height:3*d+"px"}}},a.style=this._mergeStyle(a.style,b.overviewStyle);
return a}};i.prototype=new c;i.prototype.onClick=function(a){if(a!==void 0){var b=this._annotationModel;if(b){var c=this._view.getModel(),d=c.getLineStart(a),a=c.getLineEnd(a,!0);c.getBaseModel&&(d=c.mapOffset(d),a=c.mapOffset(a),c=c.getBaseModel());for(var e,b=b.getAnnotations(d,a);!e&&b.hasNext();)a=b.next(),this.isAnnotationTypeVisible(a.type)&&(e=a);e&&c.getLineAtOffset(e.start)===c.getLineAtOffset(d)&&((c=h.Tooltip.getTooltip(this._view))&&c.setTarget(null),e.expanded?e.collapse():e.expand(),
this._annotationModel.modifyAnnotation(e))}}};i.prototype._getTooltipContents=function(a,b){return b.length===1&&b[0].expanded?null:c.prototype._getTooltipContents.call(this,a,b)};i.prototype._onAnnotationModelChanged=function(a){function b(b){for(i=0;i<b.length;i++)if(f.isAnnotationTypeVisible(b[i].type)){var a=b[i].start;e.getBaseModel&&(a=e.mapOffset(a,!0));a!==-1&&(j=Math.min(j,e.getLineAtOffset(a)))}}if(a.textModelChangedEvent)c.prototype._onAnnotationModelChanged.call(this,a);else{var d=this._view;
if(d){var e=d.getModel(),f=this,i,h=e.getLineCount(),j=h;b(a.added);b(a.removed);b(a.changed);a=d.getRulers();for(i=0;i<a.length;i++)d.redrawLines(j,h,a[i])}}};return{Ruler:d,AnnotationRuler:c,LineNumberRuler:f,OverviewRuler:a,FoldingRuler:i}});
define("orion/editor/textDND",["orion/util"],function(j){function k(h,e){this._view=h;this._undoStack=e;this._dragSelection=null;this._dropOffset=-1;this._dropText=null;var d=this;this._listener={onDragStart:function(e){d._onDragStart(e)},onDragEnd:function(e){d._onDragEnd(e)},onDragEnter:function(e){d._onDragEnter(e)},onDragOver:function(e){d._onDragOver(e)},onDrop:function(e){d._onDrop(e)},onDestroy:function(e){d._onDestroy(e)}};h.addEventListener("DragStart",this._listener.onDragStart);h.addEventListener("DragEnd",
this._listener.onDragEnd);h.addEventListener("DragEnter",this._listener.onDragEnter);h.addEventListener("DragOver",this._listener.onDragOver);h.addEventListener("Drop",this._listener.onDrop);h.addEventListener("Destroy",this._listener.onDestroy)}k.prototype={destroy:function(){var h=this._view;if(h)h.removeEventListener("DragStart",this._listener.onDragStart),h.removeEventListener("DragEnd",this._listener.onDragEnd),h.removeEventListener("DragEnter",this._listener.onDragEnter),h.removeEventListener("DragOver",
this._listener.onDragOver),h.removeEventListener("Drop",this._listener.onDrop),h.removeEventListener("Destroy",this._listener.onDestroy),this._view=null},_onDestroy:function(){this.destroy()},_onDragStart:function(h){var e=this._view,d=e.getSelection(),e=e.getModel();if(e.getBaseModel)d.start=e.mapOffset(d.start),d.end=e.mapOffset(d.end),e=e.getBaseModel();if(e=e.getText(d.start,d.end))this._dragSelection=d,h.event.dataTransfer.effectAllowed="copyMove",h.event.dataTransfer.setData("Text",e)},_onDragEnd:function(h){if(this._dragSelection){var e=
this._view,d=h.event.dataTransfer.dropEffect;if(!j.isFirefox&&(d!=="none"||this._dropText))d=h.event.dataTransfer.dropEffect=this._dropEffect;this._undoStack&&this._undoStack.startCompoundChange();(h=d==="move")&&e.setText("",this._dragSelection.start,this._dragSelection.end);if(this._dropText){var d=this._dropText,f=this._dropOffset;if(h)if(f>=this._dragSelection.end)f-=this._dragSelection.end-this._dragSelection.start;else if(f>=this._dragSelection.start)f=this._dragSelection.start;e.setText(d,
f,f);e.setSelection(f,f+d.length);this._dropText=null;this._dropOffset=-1}this._undoStack&&this._undoStack.endCompoundChange()}this._dragSelection=null},_onDragEnter:function(h){this._onDragOver(h)},_onDragOver:function(h){var e=h.event.dataTransfer.types,d=!this._view.getOptions("readonly");d&&e&&(d=e.contains?e.contains("text/plain")||e.contains("Text"):e.indexOf("text/plain")!==-1||e.indexOf("Text")!==-1);if(d){if(!j.isFirefox)this._dropEffect=h.event.dataTransfer.dropEffect=(j.isMac?h.event.altKey:
h.event.ctrlKey)?"copy":"move"}else h.event.dataTransfer.dropEffect="none"},_onDrop:function(h){var e=this._view,d=h.event.dataTransfer.getData("Text");if(d){if(!j.isFirefox)h.event.dataTransfer.dropEffect=this._dropEffect;h=e.getOffsetAtLocation(h.x,h.y);this._dragSelection?(this._dropOffset=h,this._dropText=d):(e.setText(d,h,h),e.setSelection(h,h+d.length))}}};return{TextDND:k}});
define("orion/editor/templates",[],function(){function j(h,e,d){this.prefix=h;this.description=e;this.template=d;this._parse()}function k(h,e){this._keywords=h||[];this._templates=[];this.addTemplates(e||[])}j.prototype={getProposal:function(h,e,d){var h=e-h.length,e={},f,c=d.delimiter!==void 0?d.delimiter:"\n";d.indentation&&(c+=d.indentation);for(var a=d.tab!==void 0?d.tab:"\t",i=0,g=this.variables,b=this.segments,d=[],j=0;j<b.length;j++){var k=b[j],m=g[k];if(m!==void 0)switch(k){case "${tab}":k=
a;break;case "${delimiter}":k=c;break;case "${cursor}":k="";f=i;break;default:var o=e[k];o||(o=e[k]={data:m.data,positions:[]});k=m.substitution;o.data&&o.data.values&&(k=o.data.values[0]);o.positions.push({offset:h+i,length:k.length})}d.push(k);i+=k.length}var c=[],t;for(t in e)e.hasOwnProperty(t)&&c.push(e[t]);d=d.join("");if(f===void 0)f=d.length;return{proposal:d,description:this.description,groups:c,escapePosition:h+f}},match:function(h){return this.prefix.indexOf(h)===0},_parse:function(){var h=
this.template,e=[],d={},f,c=0,h=h.replace(/\n/g,"${delimiter}"),h=h.replace(/\t/g,"${tab}");h.replace(/\$\{((?:[^\\}]+|\\.))*\}/g,function(a,i,g){var b=a.substring(2,a.length-1),i=a,j=b,k=null,m=j.indexOf(":");m!==-1&&(j=j.substring(0,m),i="${"+j+"}",k=JSON.parse(b.substring(m+1).replace("\\}","}").trim()));(b=d[i])||(b=d[i]={});b.substitution=j;if(k)b.data=k;(f=h.substring(c,g))&&e.push(f);e.push(i);c=g+a.length;return j});(f=h.substring(c,h.length))&&e.push(f);this.segments=e;this.variables=d}};
k.prototype={addTemplates:function(h){for(var e=this.getTemplates(),d=0;d<h.length;d++)e.push(new j(h[d].prefix,h[d].description,h[d].template))},computeProposals:function(h,e,d){var f=this.getPrefix(h,e,d),c=[];if(!this.isValid(f,h,e,d))return c;c=c.concat(this.getTemplateProposals(f,e,d));return c=c.concat(this.getKeywordProposals(f))},getKeywords:function(){return this._keywords},getKeywordProposals:function(h){var e=[],d=this.getKeywords();if(d)for(var f=0;f<d.length;f++)d[f].indexOf(h)===0&&
e.push({proposal:d[f].substring(h.length),description:d[f]});return e},getPrefix:function(h,e,d){return d.prefix},getTemplates:function(){return this._templates},getTemplateProposals:function(h,e,d){for(var f=[],c=this.getTemplates(),a=0;a<c.length;a++){var i=c[a];i.match(h)&&(i=i.getProposal(h,e,d),this.removePrefix(h,i),f.push(i))}return f},removePrefix:function(h,e){if(!(e.overwrite=e.proposal.substring(0,h.length)!==h))e.proposal=e.proposal.substring(h.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,h,e,d,f){function c(a,c,b){var d=a.getTextView();h.KeyMode.call(this,d);this.editor=a;this.undoStack=c;this.contentAssist=b;this.linkedModeModel=null;d.setAction("linkedModeEnter",function(){this.exitLinkedMode(!0);return!0}.bind(this));d.setAction("linkedModeCancel",function(){this.exitLinkedMode(!1);return!0}.bind(this));
d.setAction("linkedModeNextGroup",function(){var b=this.linkedModeModel;this.selectLinkedGroup((b.selectedGroupIndex+1)%b.groups.length);return!0}.bind(this));d.setAction("linkedModePreviousGroup",function(){var b=this.linkedModeModel;this.selectLinkedGroup(b.selectedGroupIndex>0?b.selectedGroupIndex-1:b.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(b){if(!this.ignoreVerify){for(var a=this.editor.mapOffset(b.start),c=this.linkedModeModel,d,e;c;)if(d=this._getPositionChanged(c,a,a+b.removedCharCount),e=d.position,e===void 0||e.model!==c)this.exitLinkedMode(!1),c=this.linkedModeModel;else break;if(c){c=0;b=b.addedCharCount-b.removedCharCount;d=d.positions;for(var g,f=0;f<d.length;++f){g=d[f];e=g.position;var i=e.offset<=a&&a<=e.offset+e.length;i&&!g.ansestor?(e.offset+=c,e.length+=b,c+=b):(e.offset+=c,g.ansestor&&i&&(e.length+=
b));if(g.escape)g.model.escapePosition=e.offset}this._updateAnnotations(d)}}}.bind(this),onVerify:function(b){if(!this.ignoreVerify){for(var a=this.editor,c=a.mapOffset(b.start),d=this.editor.mapOffset(b.end),e=this.linkedModeModel,g,f;e;)if(g=this._getPositionChanged(e,c,d),f=g.position,f===void 0||f.model!==e)this.exitLinkedMode(!1),e=this.linkedModeModel;else break;if(e){var i=this._compoundChange;i?i.owner.model===e&&i.owner.group===f.group||(this.endUndo(),this.startUndo()):this.startUndo();
e.selectedGroupIndex=f.group;var i=0,h=b.text.length-(d-c);g=g.positions;var j;c-=f.position.offset;for(var q=d-f.position.offset,l=0;l<g.length;++l)if(j=g[l],d=j.position,j.oldOffset=d.offset,j.model===e&&j.group===f.group?(d.offset+=i,d.length+=h,i+=h):(d.offset+=i,j.ansestor&&(d.length+=f.count*h)),j.escape)j.model.escapePosition=d.offset;this.ignoreVerify=!0;for(l=g.length-1;l>=0;l--)j=g[l],j.model===e&&j.group===f.group&&a.setText(b.text,j.oldOffset+c,j.oldOffset+q);this.ignoreVerify=!1;b.text=
null;this._updateAnnotations(g)}}}.bind(this)}}var a={};c.prototype=new h.KeyMode;f.mixin(c.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,d=b.getTextView();d.removeKeyMode(this);d.removeEventListener("Verify",this.linkedModeListener.onVerify);d.removeEventListener("ModelChanged",this.linkedModeListener.onModelChanged);
d=this.contentAssist;d.removeEventListener("Activating",this.linkedModeListener.onActivating);d.offset=void 0;this.editor.reportStatus(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(a){var c=this.linkedModeModel;if(c){c.selectedGroupIndex=a;var a=c.groups[a],b=a.positions[0],e=this.editor;e.setSelection(b.offset,b.offset+b.length);if(c=this.contentAssist)if(c.offset=void 0,a.data&&a.data.type==="link"&&a.data.values)(this._groupContentAssistProvider=new d.TemplateContentAssist(a.data.values)).getPrefix=function(){var a=e.getSelection();return a.start===
a.end&&(a=e.getCaretOffset(),b.offset<=a&&a<=b.offset+b.length)?e.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 d=c.groups,e=0;e<d.length;e++)for(var f=d[e].positions,h=0;h<f.length;h++){var j=f[h];b&&(j={offset:j.offset+b,length:j.length});j={index:h,group:e,count:f.length,model:c,position:j};a.push(j);if(c.nextModel&&
c.nextModel.parentGroup===e)j.ansestor=!0,this._getModelPositions(a,c.nextModel,(b||0)+f[h].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 d,a=this._getSortedPositions(a),e=a.length-1;e>=0;e--){var f=a[e].position;if(f.offset<=c&&b<=f.offset+f.length){d=a[e];break}}return{position:d,positions:a}},_updateAnnotations:function(a){var c=this.editor.getAnnotationModel();if(c){for(var b=[],d=[],f=c.getTextModel(),f=c.getAnnotations(0,f.getCharCount()),h;f.hasNext();)switch(h=f.next(),h.type){case e.AnnotationType.ANNOTATION_LINKED_GROUP:case e.AnnotationType.ANNOTATION_CURRENT_LINKED_GROUP:case e.AnnotationType.ANNOTATION_SELECTED_LINKED_GROUP:b.push(h)}if(f=
this.linkedModeModel)for(var a=a||this._getSortedPositions(f),j=0;j<a.length;j++)if(h=a[j],h.model===f){var k=e.AnnotationType.ANNOTATION_LINKED_GROUP;h.group===f.selectedGroupIndex&&(k=h.index===0?e.AnnotationType.ANNOTATION_SELECTED_LINKED_GROUP:e.AnnotationType.ANNOTATION_CURRENT_LINKED_GROUP);h=h.position;h=e.AnnotationType.createAnnotation(k,h.offset,h.offset+h.length,"");d.push(h)}c.replaceAnnotations(b,d)}}});a.LinkedMode=c;return a});
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,h,e,d,f){function c(){}function a(){}function i(){}function g(){}function b(){}function l(){}var n={};c.prototype={createKeyBindings:function(a,b,c,d){var d=new j.TextActions(a,b,d),e=new f.LinkedMode(a,b,c),a=new j.SourceCodeActions(a,b,c,e);return{textActions:d,linkedMode:e,sourceCodeActions:a}}};n.KeyBindingsFactory=
c;a.prototype={createUndoStack:function(a){a=a.getTextView();return new k.UndoStack(a,200)}};n.UndoFactory=a;i.prototype={createLineNumberRuler:function(a){return new h.LineNumberRuler(a,"left",{styleClass:"ruler lines"},{styleClass:"rulerLines odd"},{styleClass:"rulerLines even"})}};n.LineNumberRulerFactory=i;g.prototype={createFoldingRuler:function(a){return new h.FoldingRuler(a,"left",{styleClass:"ruler folding"})}};n.FoldingRulerFactory=g;b.prototype={createAnnotationModel:function(a){return new e.AnnotationModel(a)},
createAnnotationStyler:function(a,b){return new e.AnnotationStyler(a,b)},createAnnotationRulers:function(a){var b=new h.AnnotationRuler(a,"left",{styleClass:"ruler annotations"}),a=new h.OverviewRuler(a,"right",{styleClass:"ruler overview"});return{annotationRuler:b,overviewRuler:a}}};n.AnnotationFactory=b;l.prototype={createTextDND:function(a,b){return new d.TextDND(a.getTextView(),b)}};n.TextDNDFactory=l;return n});
define("orion/editor/editorFeatures",["orion/editor/factories","orion/editor/actions","orion/editor/linkedMode","orion/objects"],function(j,k,h,e){return e.mixin({},j,k,h)});define("text!orion/compare/sideBySideTemplate.html",[],function(){return'<div id="topWidget_id" style="height:100%;width:100%;position:relative">\n\t<div class="leftPanelLayout ">\n\t\t<div class="titleContainer" id="left_title_id"></div>\n\t\t<div class="compareEditorParent" id="left_editor_id"></div>\n\t\t<div class="statusContainer" id="left_status_id"></div>\n\t</div>\n\t<div class="split compareSplitLayout"></div>\n\t<div class="rightPanelLayout">\n\t\t<div class="titleContainer" id="right_title_id"></div>\n\t\t<div class="compareEditorParent"  id="right_editor_wrapper_id">\n\t\t\t<div class="canvasContainer">\n\t\t\t\t<canvas id="diff_canvas_id" class="compareCanvas" width="46" height="3000"></canvas>\n\t\t\t</div>\n\t\t\t<div class="compareEditorParentWithCanvas" id="right_editor_id"></div>\n\t\t</div>\n\t\t<div class="statusContainer" id="right_status_id"></div>\n\t</div>\n</div>'});
define("orion/compare/compareUIFactory",["orion/webui/littlelib","orion/webui/splitter","text!orion/compare/sideBySideTemplate.html"],function(j,k,h){var e=e||{};e.TwoWayCompareUIFactory=function(){function d(d){this._parentDivID=d.parentDivID;this._commandSpanId=d.commandSpanId;this._showTitle=d.showTitle;this._leftTitle=d.leftTitle;this._rightTitle=d.rightTitle;this._showLineStatus=d.showLineStatus}d.prototype={_init:function(){var d=this._parentDivID+"_";this._topWidgetDiv=j.node("topWidget_id");
this._topWidgetDiv.id=d+"topWidget_id";this._leftEditorParentDiv=j.node("left_editor_id");this._leftEditorParentDiv.id=d+"left_editor_id";this._rightEditorParentDiv=j.node("right_editor_id");this._rightEditorParentDiv.id=d+"right_editor_id";this._rightEditorWrapperDiv=j.node("right_editor_wrapper_id");this._rightEditorWrapperDiv.id=d+"right_editor_wrapper_id";this._leftTitleDiv=j.node("left_title_id");this._leftTitleDiv.id=d+"left_title_id";this._rightTitleDiv=j.node("right_title_id");this._rightTitleDiv.id=
d+"right_title_id";this._leftStatusDiv=j.node("left_status_id");this._leftStatusDiv.id=d+"left_status_id";this._rightStatusDiv=j.node("right_status_id");this._rightStatusDiv.id=d+"right_status_id";this._diffCanvasDiv=j.node("diff_canvas_id");this._diffCanvasDiv.id=d+"diff_canvas_id";this._splitterId=d+"orion_splitter";if(!this._showTitle)this._leftEditorParentDiv.style.top="0px",this._rightEditorWrapperDiv.style.top="0px",this._leftTitleDiv.style.height="0px",this._rightTitleDiv.style.height="0px";
if(!this._showLineStatus)this._leftEditorParentDiv.style.marginBottom="0px",this._rightEditorWrapperDiv.style.marginBottom="0px",this._leftStatusDiv.style.height="0px",this._rightStatusDiv.style.height="0px"},_createSplitter:function(){var d=j.$(".split",this._topWidgetDiv);d.id=this._splitterId;var c=j.$(".leftPanelLayout",this._topWidgetDiv),a=j.$(".rightPanelLayout",this._topWidgetDiv);if(d&&c&&a)this._splitter=new k.Splitter({node:d,sidePanel:c,mainPanel:a})},buildUI:function(){j.node(this._parentDivID).innerHTML=
h;this._init();this._createSplitter()},destroy:function(){},getSplitter:function(){return this._splitter},isLeftPane:function(d){return j.$(".leftPanelLayout",this._topWidgetDiv)===d},getEditorParentDiv:function(d){return d?this._leftEditorParentDiv:this._rightEditorParentDiv},getTitleDiv:function(d){return d?this._leftTitleDiv:this._rightTitleDiv},getStatusDiv:function(d){return d?this._leftStatusDiv:this._rightStatusDiv},getCommandSpanId:function(){return this._commandSpanId},getDiffCanvasDiv:function(){return this._diffCanvasDiv}};
return d}();return e});
var JsDiff=function(){function j(a){for(var c=[],d=0;d<a.length;d++)a[d]&&c.push(a[d]);return c}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 h=function(a){this.ignoreWhitespace=a};h.prototype={diff:function(a,c){if(c==a)return[{value:c}];if(!c)return[{value:a,removed:!0}];if(!a)return[{value:c,added:!0}];var c=this.tokenize(c),a=this.tokenize(a),d=c.length,b=a.length,e=d+b,f=[{newPos:-1,components:[]}],h=this.extractCommon(f[0],
c,a,0);if(f[0].newPos+1>=d&&h+1>=b)return f[0].components;for(var j=1;j<=e;j++)for(var k=-1*j;k<=j;k+=2){var r;r=f[k-1];var s=f[k+1],h=(s?s.newPos:0)-k;r&&(f[k-1]=void 0);var v=r&&r.newPos+1<d,w=s&&0<=h&&h<b;if(!v&&!w)f[k]=void 0;else if(!v||w&&r.newPos<s.newPos?(r={newPos:s.newPos,components:s.components.slice(0)},this.pushComponent(r.components,a[h],void 0,!0)):(r={newPos:r.newPos,components:r.components.slice(0)},r.newPos++,this.pushComponent(r.components,c[r.newPos],!0,void 0)),h=this.extractCommon(r,
c,a,k),r.newPos+1>=d&&h+1>=b)return r.components;else f[k]=r}},pushComponent:function(a,c,d,b){var e=a[a.length-1];e&&e.added===d&&e.removed===b?a[a.length-1]={value:this.join(e.value,c),added:d,removed:b}:a.push({value:c,added:d,removed:b})},extractCommon:function(a,c,d,b){for(var e=c.length,f=d.length,h=a.newPos,b=h-b;h+1<e&&b+1<f&&this.equals(c[h+1],d[b+1]);)h++,b++,this.pushComponent(a.components,c[h],void 0,void 0);a.newPos=h;return b},equals:function(a,c){var d=/\S/;return this.ignoreWhitespace&&
!d.test(a)&&!d.test(c)?!0:a==c},join:function(a,c){return a+c},tokenize:function(a){return a}};var e=new h,d=new h(!1);d.tokenize=function(a){return j(a.split(/(\s+|\b)/))};var f=new h(!0);f.tokenize=function(a){return j(a.split(/([{}:;,]|\s+)/))};var c=new h;c.tokenize=function(a){return a.split(/^/m)};return{diffChars:function(a,c){return e.diff(a,c)},diffWords:function(a,c){return d.diff(a,c)},diffLines:function(a,d){return c.diff(a,d)},diffCss:function(a,c){return f.diff(a,c)},createPatch:function(a,
d,e,b,f){var h=[];h.push("Index: "+a);h.push("===================================================================");h.push("--- "+a+"\t"+b);h.push("+++ "+a+"\t"+f);a=c.diff(d,e);a.push({value:"",lines:[]});for(var e=d=0,b=[],j=f=1,k=0;k<a.length;k++){var t=a[k],r=t.lines||t.value.replace(/\n$/,"").split("\n");t.lines=r;if(t.added||t.removed){if(!d){var s=a[k-1],d=f,e=j;s&&(b.push.apply(b,s.lines.slice(-4).map(function(a){return" "+a})),d-=4,e-=4)}b.push.apply(b,r.map(function(a){return(t.added?"+":
"-")+a}));t.added?j+=r.length:f+=r.length}else d&&(r.length<=8&&k<a.length-1?b.push.apply(b,r.map(function(a){return" "+a})):(s=Math.min(r.length,4),h.push("@@ -"+d+","+(f-d+s)+" +"+e+","+(j-e+s)+" @@"),h.push.apply(h,b),h.push.apply(h,r.slice(0,s).map(function(a){return" "+a})),e=d=0,b=[])),f+=r.length,j+=r.length}a.length>1&&!/\n$/.test(a[a.length-2].value)&&h.push("\\ No newline at end of file\n");return h.join("\n")},convertChangesToXML:function(a){for(var c=[],d=0;d<a.length;d++){var b=a[d];
b.added?c.push("<ins>"):b.removed&&c.push("<del>");c.push(k(b.value));b.added?c.push("</ins>"):b.removed&&c.push("</del>")}return c.join("")}}}();if(typeof module!=="undefined")module.exports=JsDiff;typeof define==="function"&&define.amd&&define("jsdiff/diff",[],function(){return JsDiff});
define("orion/compare/jsdiffAdapter",["jsdiff/diff"],function(j){var k=k||{};k.JSDiffAdapter=function(){function h(){}h.prototype={_specialLine:function(e,d,f){return d.value===e&&f!==e},adapt:function(e,d,f){f||(f="\n");for(var c=e.split(f),a=d.split(f),i=c[c.length-1]==="",a=a[a.length-1]==="",g=j.diffLines(e,d),e=[],d=[],b=0,h=0,k=-1,m=0,o=!0,t=f,r=0;r<g.length;r++){var s=g[r],v=s.lines||s.value.split(f),w=v.length,u=0;v.length>1&&v[v.length-1]===""&&w--;w>1&&!o&&v[0]===""&&(w--,u++);s.lines=v;
if(!s.added&&!s.removed){if(!this._specialLine(f,s,t)){if(b||h)e.push([b,h,k]),h=b=0,k=-1,m+=h;e.push([w,w,0]);m+=w}}else if(s.added){k===-1&&(k=d.length+1);b+=w;for(o=u;o<w+u;o++)d.push(s.lines[o])}else h+=w;o=!1;v.length>1&&v[v.length-1]===""&&(o=!0);t=s.value?s.value[s.value.length-1]:f}if(b||h)e.push([b,h,k]),m+=h;m<c.length&&c.length>1&&(f=e[e.length-1],f[2]===0?(f[0]+=1,f[1]+=1):f[2]===-1?e.push([1,1,0]):i===a?e.push([1,1,0]):(a&&(f[0]+=1),i&&(f[1]+=1)));return{mapper:e,changContents:{array:d,
index:0}}},adaptCharDiff:function(e,d,f){for(var e=f?j.diffWords(e,d):j.diffChars(e,d),d=[],c=f=0,a=0,i=0,g=0;g<e.length;g++){var b=e[g];if(!b.added&&!b.removed){if(a>0||i>0)d.push([c,c+a,f,f+i]),c+=a,f+=i,i=a=0;c+=b.value.length;f+=b.value.length}else b.added?a+=b.value.length:i+=b.value.length}(a>0||i>0)&&d.push([c,c+a,f,f+i]);return d}};return h}();return k});
define("orion/compare/diffTreeNavigator",["orion/treeModelIterator","orion/compare/compareUtils","orion/editor/annotations","orion/compare/jsdiffAdapter"],function(j,k,h,e){var d={},f,c,a,i,g,b,l,n,m,o,t,r,s,v,w,u;d.DiffTreeNavigator=function(){function d(a,b,c,e,f,g){this._root={type:"root",children:[]};this._initialized=!1;this.initAll(a,b,c,e,f,g)}f="orion.annotation.diff.addedBlock";c="orion.annotation.diff.currentAddedBlock";a="orion.annotation.diff.deletedBlock";i="orion.annotation.diff.currentDeletedBlock";
g="orion.annotation.diff.blockTop";b="orion.annotation.diff.currentBlockTop";l="orion.annotation.diff.blockConflict";n="orion.annotation.diff.currentBlockConflict";m="orion.annotation.diff.addedWord";o="orion.annotation.diff.currentAddedWord";t="orion.annotation.diff.deletedWord";r="orion.annotation.diff.currentDeletedWord";s="orion.annotation.diff.emptyDeletedWordLeft";v="orion.annotation.diff.emptyDeletedWordRight";w="orion.annotation.diff.emptyAddedWordLeft";u="orion.annotation.diff.emptyAddedWordRight";
h.AnnotationType.registerType(f,{title:"",html:"",lineStyle:{styleClass:"annotationLine addedBlockDiff"}});h.AnnotationType.registerType(c,{title:"",html:"",lineStyle:{styleClass:"annotationLine currentAddedBlockDiff"}});h.AnnotationType.registerType(a,{title:"",html:"",lineStyle:{styleClass:"annotationLine deletedBlockDiff"}});h.AnnotationType.registerType(i,{title:"",html:"",lineStyle:{styleClass:"annotationLine currentDeletedBlockDiff"}});h.AnnotationType.registerType(g,{title:"",html:"",lineStyle:{styleClass:"annotationLine blockDiffTopOnly"}});
h.AnnotationType.registerType(b,{title:"",html:"",lineStyle:{styleClass:"annotationLine currentBlockDiffTopOnly"}});h.AnnotationType.registerType(l,{title:"",html:"",lineStyle:{styleClass:"annotationLine blockDiffConflict"}});h.AnnotationType.registerType(n,{title:"",html:"",lineStyle:{styleClass:"annotationLine currentBlockDiffConflict"}});h.AnnotationType.registerType(m,{title:"word added",html:"",rangeStyle:{styleClass:"annotationRange addedWordDiff"}});h.AnnotationType.registerType(o,{title:"",
html:"",rangeStyle:{styleClass:"annotationRange currentAddedWordDiff"}});h.AnnotationType.registerType(t,{title:"word deleted",html:"",rangeStyle:{styleClass:"annotationRange deletedWordDiff"}});h.AnnotationType.registerType(r,{title:"",html:"",rangeStyle:{styleClass:"annotationRange currentDeletedWordDiff"}});h.AnnotationType.registerType(s,{title:"",html:"",rangeStyle:{styleClass:"annotationRange emptyDeletedWordDiffLeft"}});h.AnnotationType.registerType(v,{title:"",html:"",rangeStyle:{styleClass:"annotationRange emptyDeletedWordDiffRight"}});
h.AnnotationType.registerType(w,{title:"",html:"",rangeStyle:{styleClass:"annotationRange emptyAddedWordDiffLeft"}});h.AnnotationType.registerType(u,{title:"",html:"",rangeStyle:{styleClass:"annotationRange emptyAddedWordDiffRight"}});d.prototype={initAll:function(a,b,c,d,e,f,g){this._charOrWordDiff=a?a:"word";if(b)this._initialized=!0;this.editorWrapper=[{editor:b,diffFeeder:d},{editor:c,diffFeeder:e}];this._curveRuler=g;(this._overviewRuler=f)&&this._overviewRuler.setDiffNavigator(this)},initMapper:function(a){if(a)for(var b=
0;b<this.editorWrapper.length;b++)this.editorWrapper[b].diffFeeder.init(this.editorWrapper[b].editor.getTextView().getModel(),a)},destroy:function(){this.initAll(this._charOrWordDiff)},renderAnnotations:function(){var a;for(a=0;a<this.editorWrapper.length;a++){this.editorWrapper[a].annoTypes=[];this.editorWrapper[a].diffFeeder.getBlockAnnoTypes(this.editorWrapper[a].annoTypes);this.editorWrapper[a].diffFeeder.getWordAnnoTypes(this.editorWrapper[a].annoTypes);for(var b=0;b<this.editorWrapper[a].annoTypes.length;b++)this.editorWrapper[a].annoTypes[b].current&&
this.editorWrapper[a].editor.getAnnotationStyler().addAnnotationType(this.editorWrapper[a].annoTypes[b].current),this.editorWrapper[a].annoTypes[b].normal&&this.editorWrapper[a].editor.getAnnotationStyler().addAnnotationType(this.editorWrapper[a].annoTypes[b].normal)}this._root.children=[];b=this.editorWrapper[0].diffFeeder.getDiffBlocks();if(!b||b.length===0)this.replaceAllAnnotations(!0,0,"block",!1,[]),this.replaceAllAnnotations(!0,1,"block",!1,[]),this.replaceAllAnnotations(!0,0,"word",!1,[]),
this.replaceAllAnnotations(!0,1,"word",!1,[]),this.replaceAllAnnotations(!0,0,"block",!0,[]),this.replaceAllAnnotations(!0,1,"block",!0,[]),this.replaceAllAnnotations(!0,0,"word",!0,[]),this.replaceAllAnnotations(!0,1,"word",!0,[]);else{var c=new e.JSDiffAdapter;for(a=0;a<b.length;a++){var d=this.generatePairBlockAnnotations(this._root,a);this._root.children.push(d);var f=this.generatePairWordAnnotations(d,a,c);if(f)d.children=f}this.replaceAllAnnotations(!1,0,"block",!0);this.replaceAllAnnotations(!1,
1,"block",!0);this.replaceAllAnnotations(!1,0,"word",!0);this.replaceAllAnnotations(!1,1,"word",!0);this.iterator=new j.TreeModelIterator(this._root.children)}},replaceAllAnnotations:function(a,b,c,d,e){if(this.editorWrapper[b].annoTypes)for(var f=0;f<this.editorWrapper[b].annoTypes.length;f++)this.editorWrapper[b].annoTypes[f].type===c&&this.replaceDiffAnnotations(this.editorWrapper[b].editor,e?e:this.editorWrapper[b].annoTypes[f].list,d?this.editorWrapper[b].annoTypes[f].normal:this.editorWrapper[b].annoTypes[f].current,
a)},getMapper:function(){return this.editorWrapper[0].diffFeeder.getMapper()},getFeeder:function(a){return a?this.editorWrapper[1].diffFeeder:this.editorWrapper[0].diffFeeder},iterateOnBlock:function(a,b){this.iterator&&(this.iterator.iterateOnTop(a,b),this.updateCurrentAnnotation(!0))},iterateOnChange:function(a){if(!this.iterator)return null;var b=this.iterator.iterate(a);if(b){var c=this.iterator.cursor();c.type==="block"&&c.children&&c.children.length>0&&this.iterator.iterate(a);this.updateCurrentAnnotation(!0)}return b},
gotoBlock:function(a,b){if(this.iterator){if(a<0||a>=this._root.children.length||this._root.children.length===0)a=0;b!==void 0&&b>=0&&this._root.children[a].children&&b<this._root.children[a].children.length?this.iterator.setCursor(this._root.children[a].children[b]):this.iterator.setCursor(this._root.children[a]);this.updateCurrentAnnotation(!1);this._positionDiffBlock()}},_hitDiffAnnotation:function(a,b,c){if(c===this.editorWrapper[a].editor.getTextView()){for(var d=0;d<this._root.children.length;d++){var c=
this._root.children[d],e=a===0?c.oldA:c.newA;if(b>=e.start&&b<=e.end){d=c;if(c.children&&c.children.length>0)for(e=0;e<c.children.length;e++){var f=c.children[e],g=a===0?f.oldA:f.newA;if(b>=g.start&&b<=g.end){d=f;break}}return d}}return null}},gotoChange:function(a,b){for(var c=0;c<this.editorWrapper.length;c++){var d=this._hitDiffAnnotation(c,a,b);if(d)return this.iterator.setCursor(d),this.updateCurrentAnnotation(!1,b),!0}return!1},getCurrentBlockIndex:function(){if(!this.iterator)return-1;var a=
this.iterator.cursor();return!a?-1:a.type==="block"?a.index:a.parent.index},getCurrentPosition:function(){if(!this.iterator)return{};var a=this.iterator.cursor();return a.type==="block"?{block:a.index+1}:{block:a.parent.index+1,change:a.index+1}},getCurrentMapperIndex:function(){var a=this.getCurrentBlockIndex();a<0&&(a=0);var b=this.getFeeder().getDiffBlocks();if(!b||b.length===0)return-1;a>b.length-1&&(a=0);return b[a][1]},replaceDiffAnnotations:function(a,b,c,d){if(b&&c&&(a=a.getAnnotationModel())){for(var e=
a.getAnnotations(0,a.getTextModel().getCharCount()),f=[];d&&e.hasNext();){var g=e.next();g.type===c&&f.push(g)}a.replaceAnnotations(f,b)}},updateCurrentAnnotation:function(a,b){this.replaceAllAnnotations(!0,0,"block",!1,[]);this.replaceAllAnnotations(!0,1,"block",!1,[]);this.replaceAllAnnotations(!0,0,"word",!1,[]);this.replaceAllAnnotations(!0,1,"word",!1,[]);if(this.iterator){var c=this.iterator.cursor();if(c){var d,e,f={start:c.oldA.start,end:c.oldA.end},g={start:c.newA.start,end:c.newA.end};c.type===
"word"?(d=this.editorWrapper[0].diffFeeder.getCurrentWordAnnoType(f,this.editorWrapper[0].editor.getTextView().getModel()),e=this.editorWrapper[1].diffFeeder.getCurrentWordAnnoType(g,this.editorWrapper[1].editor.getTextView().getModel())):(d=this.editorWrapper[0].diffFeeder.getCurrentBlockAnnoType(c.index),e=this.editorWrapper[1].diffFeeder.getCurrentBlockAnnoType(c.index));d&&this.replaceDiffAnnotations(this.editorWrapper[0].editor,[new (h.AnnotationType.getType(d.current))(f.start,f.end)],d,!0);
e&&this.replaceDiffAnnotations(this.editorWrapper[1].editor,[new (h.AnnotationType.getType(e.current))(g.start,g.end)],e,!0);if(a)this.autoSelecting=!0,this.editorWrapper[0].editor.setSelection(c.oldA.start,c.oldA.end,!0),this.editorWrapper[1].editor.setSelection(c.newA.start,c.newA.end,!0),this.autoSelecting=!1;else if(b)this.autoSelecting=!0,b!==this.editorWrapper[0].editor.getTextView()&&this.editorWrapper[0].editor.setSelection(c.oldA.start,c.oldA.end,!0),b!==this.editorWrapper[1].editor.getTextView()&&
this.editorWrapper[1].editor.setSelection(c.newA.start,c.newA.end,!0),this.autoSelecting=!1}}},generatePairBlockAnnotations:function(a,b){var c=this.generateBlockDiffAnnotations(0,b),d=this.generateBlockDiffAnnotations(1,b);return{parent:a,index:b,type:"block",oldA:c,newA:d}},generatePairWordAnnotations:function(a,b,c){var d=this.editorWrapper[0].diffFeeder.getTextOnBlock(b),e=this.editorWrapper[1].diffFeeder.getTextOnBlock(b),b=null,f=0,g=0;if(d&&e&&d.text&&e.text&&d.text.length<=5E3&&e.text.length<=
5E3)b=c.adaptCharDiff(d.text,e.text,this._charOrWordDiff==="word"),g=e.start,f=d.start;else return null;c=[];d=[];this.generateWordDiffAnnotations(0,c,f,b,2,3);this.generateWordDiffAnnotations(1,d,g,b,0,1);b=[];for(f=0;f<c.length;f++)b.push({parent:a,index:f,type:"word",oldA:c[f],newA:d[f]});return b},getAnnoModelList:function(a,b,c){for(var d=0;d<this.editorWrapper[a].annoTypes.length;d++)if(this.editorWrapper[a].annoTypes[d].type===b&&this.editorWrapper[a].annoTypes[d].normal===c)return this.editorWrapper[a].annoTypes[d].list;
return null},generateBlockDiffAnnotations:function(a,b){var c=this.editorWrapper[a].diffFeeder.getCurrentBlockAnnoType(b),d=this.getAnnoModelList(a,"block",c.normal),e=this.editorWrapper[a].diffFeeder.getCharRange(b),c=h.AnnotationType.createAnnotation(c.normal,e.start,e.end);d&&d.push(c);return c},generateWordDiffAnnotations:function(a,b,c,d,e,f){if(d)for(var g=this.editorWrapper[a].diffFeeder.getCurrentWordAnnoType({start:-1,end:-1}),a=this.getAnnoModelList(a,"word",g.normal),i=0;i<d.length;i++){var j=
h.AnnotationType.createAnnotation(g.normal,d[i][e]+c,d[i][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(),d=a.getClientArea(),c=Math.floor(d.height/c/3);a.setTopIndex(b-c>0?b-c:0)},_positionDiffBlock:function(){var a=
this.getCurrentBlockIndex();a<0&&(a=0);var b=this.getFeeder().getDiffBlocks();b.length!==0&&(this._setTextViewPosition(this.editorWrapper[0].editor.getTextView(),b[a][0]),this.editorWrapper[0].editor!==this.editorWrapper[1].editor&&(a=k.lookUpLineIndex(this.getMapper(),0,b[a][1]),this._setTextViewPosition(this.editorWrapper[1].editor.getTextView(),a)),this._updateOverviewRuler(),this._updateCurveRuler())},matchPositionFromOverview:function(a){this._initialized&&this.gotoBlock(a<0?0:k.getAnnotationIndex(this.getFeeder().getDiffBlocks(),
a))},gotoDiff:function(a,b){this.gotoChange(a,b)&&(this._updateOverviewRuler(),this._updateCurveRuler())},nextDiff:function(){this.iterateOnBlock(!0,!0);this._positionDiffBlock()},prevDiff:function(){this.iterateOnBlock(!1,!0);this._positionDiffBlock()},nextChange:function(){var a=this.iterateOnChange(!0);this._positionDiffBlock();return a},prevChange:function(){this.iterateOnChange(!1);this._positionDiffBlock()}};return d}();d.DiffBlockFeeder=function(){function a(){}a.prototype={getWordAnnoTypes:function(a){this._mapperColumnIndex===
0?a.push({type:"word",current:o,normal:m,list:[]}):a.push({type:"word",current:r,normal:t,list:[]});a.push({type:"word",current:s});a.push({type:"word",current:v});a.push({type:"word",current:w});a.push({type:"word",current:u})},getCurrentWordAnnoType:function(a,b){return a.start===a.end&&b?this._mapperColumnIndex===0?{current:this._repositionEmptyWord(a,b),normal:m}:{current:this._repositionEmptyWord(a,b),normal:t}:this._mapperColumnIndex===0?{current:o,normal:m}:{current:r,normal:t}},_repositionEmptyWord:function(a,
b){var c=b.getLineAtOffset(a.start),d=b.getLineStart(c),e=b.getLineEnd(c);if(d!==e){if(a.start===e)return a.start--,this._mapperColumnIndex===0?u:v;a.end++}else if(c>0&&(c--,d=b.getLineStart(c),e=b.getLineEnd(c),d!==e))return a.start=e-1,a.end=e,this._mapperColumnIndex===0?u:v;return this._mapperColumnIndex===0?w:s},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}();d.TwoWayDiffBlockFeeder=function(){function e(a,b,c){this._mapperColumnIndex=c;this.init(a,b)}e.prototype=new d.DiffBlockFeeder;e.prototype.init=function(a,b){this._textModel=a;this._diffBlocks=void 0;if(b){this._mapper=b;this._diffBlocks=[];for(var c=0,d=0;d<this._mapper.length;d++)this._mapper[d][2]!==
0&&this._diffBlocks.push([c,d]),c+=this._mapper[d][this._mapperColumnIndex]}};e.prototype.getBlockAnnoTypes=function(d){this._mapperColumnIndex===0?d.push({type:"block",normal:f,current:c,list:[]}):d.push({type:"block",normal:a,current:i,list:[]});d.push({type:"block",normal:g,current:b,list:[]});d.push({type:"block",normal:l,current:n,list:[]})};e.prototype.getCurrentBlockAnnoType=function(d){if(!this._diffBlocks||this._diffBlocks.length===0||this._diffBlocks.length<=d)return null;d=this._diffBlocks[d][1];
if(this._mapper[d][this._mapperColumnIndex]===0)return{normal:g,current:b};else if(k.isMapperConflict(this.getMapper(),d))return{normal:l,current:n};else if(this._mapperColumnIndex===0)return{type:"block",normal:f,current:c,list:[]};return{type:"block",normal:a,current:i,list:[]}};return e}();d.inlineDiffBlockFeeder=function(){function b(a,c){this._mapperColumnIndex=c;this.init(a)}b.prototype=new d.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._mapperColumnIndex===0){var d=a+this._mapper[c][1];this._diffBlocks.push([d,c]);this._gapBlocks.push([d,d+this._mapper[c][0],b])}else this._diffBlocks.push([a,c]),this._gapBlocks.push([a,a+this._mapper[c][1],b]);a+=this._mapper[c][0]+this._mapper[c][1]}else this._gapBlocks.push([a,a+this._mapper[c][this._mapperColumnIndex],b]),a+=this._mapper[c][this._mapperColumnIndex];
b+=this._mapper[c][this._mapperColumnIndex]}}};b.prototype.getBlockAnnoTypes=function(b){this._mapperColumnIndex===0?b.push({type:"block",normal:f,current:c,list:[]}):b.push({type:"block",normal:a,current:i,list:[]});b.push({type:"block",normal:l,current:n,list:[]})};b.prototype.getCurrentBlockAnnoType=function(b){if(!this._diffBlocks||this._diffBlocks.length===0)return null;b=this._diffBlocks[b][1];if(this._mapper[b][this._mapperColumnIndex]===0)return{current:o,normal:m};else if(k.isMapperConflict(this.getMapper(),
b))return{normal:l,current:n};else if(this._mapperColumnIndex===0)return{type:"block",normal:f,current:c,list:[]};return{type:"block",normal:a,current:i,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 d});
define("orion/compare/compareView","i18n!orion/compare/nls/messages,orion/Deferred,orion/webui/littlelib,orion/compare/diffParser,orion/compare/compareRulers,orion/editor/editor,orion/editor/editorFeatures,orion/keyBinding,orion/editor/textView,orion/compare/compareUIFactory,orion/compare/compareUtils,orion/compare/jsdiffAdapter,orion/compare/diffTreeNavigator".split(","),function(j,k,h,e,d,f,c,a,i,g,b,l,n){var m={};m.CompareView=function(){function a(){this._diffParser=new e.DiffParser}a.prototype=
{_clearOptions:function(){this.options={};this.options.blockNumber=1;this.options.changeNumber=0},_getLineDelim:function(){return"\n"},_generateMapper:function(a,b,c,d,e){var f=this._getLineDelim(a,c);this._diffParser.setLineDelim(f);if(this.options.mapper&&this.options.toggler)return{delim:f,mapper:this.options.mapper,output:this.options.newFile.Content,diffArray:this.options.diffArray};if(typeof b==="string"&&typeof a==="string"){a=(new l.JSDiffAdapter).adapt(a,b,f);if(this.options.toggler)this.options.mapper=
a.mapper,this.options.newFile.Content=b,this.options.diffArray=a.changContents;return{delim:f,mapper:a.mapper,output:b,diffArray:a.changContents}}else{b=this._diffParser.parse(a,c,d,e);a=this._diffParser.getDiffArray();if(this.options.toggler)this.options.mapper=b.mapper,this.options.newFile.Content=b.outPutFile,this.options.diffArray=a;return{delim:f,mapper:b.mapper,output:b.outPutFile,diffArray:a}}},_initSyntaxHighlighter:function(a){this._syntaxHighlighters=null;if(this.options.highlighters&&this.options.highlighters.length>
0&&!(a.length<1||a.length>2))this._syntaxHighlighters=[{highlighter:this.options.highlighters[0],target:a[0]}],a.length===2&&this.options.highlighters.length===2&&this._syntaxHighlighters.push({highlighter:this.options.highlighters[1],target:a[1]})},_highlightSyntax:function(){if(this._syntaxHighlighters){var a=[];this._syntaxHighlighters.forEach(function(b){a.push(b.highlighter.highlight(b.target.fileName,b.target.contentType,b.target.editor))}.bind(this));k.all(a,function(a){return{_error:a}}).then(function(){this._diffNavigator.renderAnnotations();
this._diffNavigator.gotoBlock(this.options.blockNumber-1,this.options.changeNumber-1)}.bind(this))}else window.setTimeout(function(){this._diffNavigator.renderAnnotations();this._diffNavigator.gotoBlock(this.options.blockNumber-1,this.options.changeNumber-1)}.bind(this),50)},setOptions:function(a,b){b&&this._clearOptions();if(!this.options)this.options={};a&&Object.keys(a).forEach(function(b){this.options[b]=a[b]}.bind(this))},getOptions:function(){return this.options},getCurrentDiffPos:function(){return this._diffNavigator.getCurrentPosition()},
initDiffNav:function(){this._diffNavigator.gotoBlock(0,0)},nextDiff:function(){this._diffNavigator.nextDiff()},prevDiff:function(){this._diffNavigator.prevDiff()},nextChange:function(){return this._diffNavigator.nextChange()},prevChange:function(){this._diffNavigator.prevChange()},getWidget:function(){return this},startup:function(){this.initEditors();this.refresh(!0)},initEditors:function(){}};return a}();m.TwoWayCompareView=function(){function a(b){this.setOptions(b,!0);this._diffNavigator=new n.DiffTreeNavigator("word");
this.type="twoWay";this._uiFactory=this.options.uiFactory;if(!this._uiFactory)this._uiFactory=new g.TwoWayCompareUIFactory({parentDivID:this.options.parentDivId,showTitle:this.options.showTitle?this.options.showTitle:!1,showLineStatus:this.options.showLineStatus?this.options.showLineStatus:!1}),this._uiFactory.buildUI();this._viewLoadedCounter=0;this.options.commandProvider&&this.options.commandProvider.initCommands(this);this._curveRuler=new d.CompareCurveRuler(this._uiFactory.getDiffCanvasDiv())}
a.prototype=new m.CompareView;a.prototype.initEditors=function(a){this._editors=[];this._editors.push(this._createEditor(a,this._uiFactory.getEditorParentDiv(!1),this._uiFactory.getStatusDiv(!1),this.options.oldFile));this._editors.push(this._createEditor(a,this._uiFactory.getEditorParentDiv(!0),this._uiFactory.getStatusDiv(!0),this.options.newFile,!0));this._overviewRuler=new d.CompareOverviewRuler("right",{styleClass:"ruler overview"},null,function(a){this._diffNavigator.matchPositionFromOverview(a)}.bind(this));
window.onbeforeunload=function(){if(this._editors&&this._editors.some(function(a){return a.isDirty()}))return j["There are unsaved changes."]}.bind(this)};a.prototype.getEditors=function(){return this._editors};a.prototype.gotoDiff=function(a,b,c){c=c?this._editors[1].getTextView():this._editors[0].getTextView();this._diffNavigator.gotoDiff(c.getModel().getLineStart(a)+b,c)};a.prototype.copyToLeft=function(){this._curveRuler.copyTo(!0)};a.prototype.copyToRight=function(){this._curveRuler.copyTo(!1)};
a.prototype.resizeEditors=function(){this._editors.forEach(function(a){a.getTextView().resize()})};a.prototype.getSplitter=function(){return this._uiFactory.getSplitter()};a.prototype._createEditor=function(a,b,d,e,g){var h=typeof e.readonly==="undefined"?!0:e.readonly,k=function(){var a=new i.TextView({parent:b,readonly:h,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)?g:!g)&&a.resize()}}.bind(this));return a}.bind(this),l=e.keyBindingFactory;l||(l=new c.KeyBindingsFactory);var m=null;if(d)var n="",m=function(a,b){if(d)n=b?j["ERROR: "]+a:a,d.textContent=""+n};k=new f.Editor({textViewFactory:k,undoStackFactory:new c.UndoFactory,annotationFactory:new c.AnnotationFactory,keyBindingFactory:l,statusReporter:m,domNode:b});k.installTextView();k.setInput(null,null,e.Content?e.Content:a);k.setOverviewRulerVisible(!1);var o=k.getTextView();
o.addEventListener("Selection",function(a){a.newValue&&a.newValue.start!==a.newValue.end||!this._diffNavigator.autoSelecting&&this._diffNavigator.editorWrapper[0].diffFeeder&&this._diffNavigator.gotoDiff(o.getCaretOffset(),o)}.bind(this));o.getModel().addEventListener("Changed",function(a){if(!this._curveRuler.onChanged(a,!g))this.options.mapper=null}.bind(this));g?o.addEventListener("Scroll",function(){this._curveRuler&&(this._curveRuler.matchPositionFrom(!0),this._curveRuler.render());if(this.onScroll)this.onScroll()}.bind(this)):
o.addEventListener("Scroll",function(){this._curveRuler&&this._curveRuler.render()}.bind(this));return k};a.prototype.destroy=function(){this._editors&&(this._diffNavigator.destroy(),this._editors.forEach(function(a){a.destroy()}),this._uiFactory.destroy())};a.prototype.addRulers=function(){if(this._editors&&!this._hasRuler){var a=new d.LineNumberCompareRuler(this._diffNavigator,0,"left",{styleClass:"ruler lines"},{styleClass:"rulerLines odd"},{styleClass:"rulerLines even"}),b=new d.LineNumberCompareRuler(this._diffNavigator,
0,"left",{styleClass:"ruler lines"},{styleClass:"rulerLines odd"},{styleClass:"rulerLines even"});this._editors[1].getTextView().addRuler(a);this._editors[0].getTextView().addRuler(b);this._editors[0].getTextView().addRuler(this._overviewRuler);this._hasRuler=!0}};a.prototype.refresh=function(a){var b=this.options.oldFile.Content,c=this.options.newFile.Content,d=this.options.diffContent;typeof c==="string"?d=this._generateMapper(b,c,d,this.options.hasConflicts):(d=this._generateMapper(b,c,d,this.options.hasConflicts),
c=d.output);var e=new n.TwoWayDiffBlockFeeder(this._editors[0].getTextView().getModel(),d.mapper,1),f=new n.TwoWayDiffBlockFeeder(this._editors[1].getTextView().getModel(),d.mapper,0);this._diffNavigator.initAll(this.options.charDiff?"char":"word",this._editors[0],this._editors[1],e,f,this._overviewRuler,this._curveRuler);this._curveRuler.init(d.mapper,this._editors[1],this._editors[0],this._diffNavigator);a&&(this._editors[1].setInput(this.options.newFile.Name,null,c),this._editors[0].setInput(this.options.oldFile.Name,
null,b));this._initSyntaxHighlighter([{fileName:this.options.newFile.Name,contentType:this.options.newFile.Type,editor:this._editors[1]},{fileName:this.options.oldFile.Name,contentType:this.options.oldFile.Type,editor:this._editors[0]}]);this._highlightSyntax();this.options.commandProvider&&this.options.commandProvider.renderCommands(this);this.addRulers();this._viewLoadedCounter===2&&this._diffNavigator.gotoBlock(this.options.blockNumber-1,this.options.changeNumber-1);a=this._uiFactory.getTitleDiv(!0);
if((b=this._uiFactory.getTitleDiv(!1))&&a)h.empty(b),h.empty(a),b.appendChild(document.createTextNode(this.options.oldFile.Name)),a.appendChild(document.createTextNode(this.options.newFile.Name));a=this._editors[1].getTextView().getModel().getLineCount()*this._editors[1].getTextView().getLineHeight()+5;b=this._editors[0].getTextView().getModel().getLineCount()*this._editors[0].getTextView().getLineHeight()+5;return a>b?a:b};return a}();m.InlineCompareView=function(){function a(b){this.setOptions(b,
!0);this._diffNavigator=new n.DiffTreeNavigator("word");this.type="inline";this.options.commandProvider&&this.options.commandProvider.initCommands(this);this._editorDiv=this.options.parentDivId}a.prototype=new m.CompareView;a.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};a.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};a.prototype.destroyEditor=function(){this._textView&&(this._diffNavigator.destroy(),this._textView.setText(""),this.removeRulers())};a.prototype.destroy=function(){this._textView&&(this._diffNavigator.destroy(),this._textView.destroy())};a.prototype.initEditors=function(a){var b=h.node(this._editorDiv),e=function(){return new i.TextView({parent:b,readonly:!0,tabSize:4})}.bind(this);this._editor=
new f.Editor({textViewFactory:e,undoStackFactory:new c.UndoFactory,annotationFactory:new c.AnnotationFactory,domNode:b});this._editor.installTextView();this._editor.setInput(null,null,a);this._editor.setOverviewRulerVisible(!1);this._editor.setAnnotationRulerVisible(!1);this._textView=this._editor.getTextView();this._rulerOrigin=new d.LineNumberCompareRuler(this._diffNavigator,1,"left",{styleClass:"ruler lines"},{styleClass:"rulerLines odd"},{styleClass:"rulerLines even"});this._rulerNew=new d.LineNumberCompareRuler(this._diffNavigator,
0,"left",{styleClass:"ruler lines"},{styleClass:"rulerLines odd"},{styleClass:"rulerLines even"});this._overviewRuler=new d.CompareOverviewRuler("right",{styleClass:"ruler overview"},null,function(a){this._diffNavigator.matchPositionFromOverview(a)}.bind(this));this._textView.addEventListener("Selection",function(a){a.newValue&&a.newValue.start!==a.newValue.end||!this._diffNavigator.autoSelecting&&this._diffNavigator.editorWrapper[0].diffFeeder&&this._diffNavigator.gotoDiff(this._textView.getCaretOffset(),
this._textView)}.bind(this))};a.prototype._initDiffPosition=function(a){var b=a.getModel();if(b&&b.getAnnotations&&(b=b.getAnnotations(),b.length>0)){var b=b[0][0],c=a.getLineHeight(),d=a.getClientArea(),c=Math.floor(d.height/c/3);a.setTopIndex(b-c>0?b-c:0)}};a.prototype.refresh=function(){var a=this.options.oldFile.Content,c=this._generateMapper(a,this.options.newFile.Content,this.options.diffContent,this.options.hasConflicts,!this.options.toggler);this._textView.getModel().setText(a);var a=new n.inlineDiffBlockFeeder(c.mapper,
1),d=new n.inlineDiffBlockFeeder(c.mapper,0);b.mergeDiffBlocks(this._textView.getModel(),d.getDiffBlocks(),c.mapper,c.diffArray.array,c.diffArray.index,this._diffParser._lineDelimiter);a.setModel(this._textView.getModel());d.setModel(this._textView.getModel());this._diffNavigator.initAll(this.options.charDiff?"char":"word",this._editor,this._editor,a,d,this._overviewRuler);this._initSyntaxHighlighter([{fileName:this.options.oldFile.Name,contentType:this.options.oldFile.Type,editor:this._editor}]);
this._highlightSyntax();this.options.commandProvider&&this.options.commandProvider.renderCommands(this);this.addRulers();c=this._textView.getTopIndex();this._textView.redrawLines(c,c+1,this._overviewRuler);this._textView.redrawLines(c,c+1,this._rulerOrigin);this._textView.redrawLines(c,c+1,this._rulerNew);this._diffNavigator.gotoBlock(this.options.blockNumber-1,this.options.changeNumber-1);return this._textView.getLineHeight()*this._textView.getModel().getLineCount()+5};a.prototype.setConflicting=
function(a){this._conflcit=a};return a}();m.toggleableCompareView=function(){function a(b,c){if(c)c.toggler=this;this._widget=b==="inline"?new m.InlineCompareView(c):new m.TwoWayCompareView(c)}a.prototype={startup:function(){this._widget.startup()},toggle:function(){var a=this._widget.options,b=this._widget.getCurrentDiffPos();a.blockNumber=b.block;a.changeNumber=b.change;this._widget.destroy();h.empty(h.node(a.parentDivId));this._widget=this._widget.type==="inline"?new m.TwoWayCompareView(a):new m.InlineCompareView(a);
this._widget.initEditors();this._widget.refresh(!0)},getWidget:function(){return this._widget}};return a}();return m});
define("orion/editor/keywords",[],function(){return{JSKeywords:"break,case,class,catch,continue,const,debugger,default,delete,do,else,enum,export,extends,false,finally,for,function,if,implements,import,in,instanceof,interface,let,new,null,package,private,protected,public,return,static,super,switch,this,throw,true,try,typeof,undefined,var,void,while,with,yield".split(","),CSSKeywords:"alignment-adjust,alignment-baseline,animation,animation-delay,animation-direction,animation-duration,animation-iteration-count,animation-name,animation-play-state,animation-timing-function,appearance,azimuth,backface-visibility,background,background-attachment,background-clip,background-color,background-image,background-origin,background-position,background-repeat,background-size,baseline-shift,binding,bleed,bookmark-label,bookmark-level,bookmark-state,bookmark-target,border,border-bottom,border-bottom-color,border-bottom-left-radius,border-bottom-right-radius,border-bottom-style,border-bottom-width,border-collapse,border-color,border-image,border-image-outset,border-image-repeat,border-image-slice,border-image-source,border-image-width,border-left,border-left-color,border-left-style,border-left-width,border-radius,border-right,border-right-color,border-right-style,border-right-width,border-spacing,border-style,border-top,border-top-color,border-top-left-radius,border-top-right-radius,border-top-style,border-top-width,border-width,bottom,box-align,box-decoration-break,box-direction,box-flex,box-flex-group,box-lines,box-ordinal-group,box-orient,box-pack,box-shadow,box-sizing,break-after,break-before,break-inside,caption-side,clear,clip,color,color-profile,column-count,column-fill,column-gap,column-rule,column-rule-color,column-rule-style,column-rule-width,column-span,column-width,columns,content,counter-increment,counter-reset,crop,cue,cue-after,cue-before,cursor,direction,display,dominant-baseline,drop-initial-after-adjust,drop-initial-after-align,drop-initial-before-adjust,drop-initial-before-align,drop-initial-size,drop-initial-value,elevation,empty-cells,fit,fit-position,flex-align,flex-flow,flex-inline-pack,flex-order,flex-pack,float,float-offset,font,font-family,font-size,font-size-adjust,font-stretch,font-style,font-variant,font-weight,grid-columns,grid-rows,hanging-punctuation,height,hyphenate-after,hyphenate-before,hyphenate-character,hyphenate-lines,hyphenate-resource,hyphens,icon,image-orientation,image-rendering,image-resolution,inline-box-align,left,letter-spacing,line-height,line-stacking,line-stacking-ruby,line-stacking-shift,line-stacking-strategy,list-style,list-style-image,list-style-position,list-style-type,margin,margin-bottom,margin-left,margin-right,margin-top,mark,mark-after,mark-before,marker-offset,marks,marquee-direction,marquee-loop,marquee-play-count,marquee-speed,marquee-style,max-height,max-width,min-height,min-width,move-to,nav-down,nav-index,nav-left,nav-right,nav-up,opacity,orphans,outline,outline-color,outline-offset,outline-style,outline-width,overflow,overflow-style,overflow-x,overflow-y,padding,padding-bottom,padding-left,padding-right,padding-top,page,page-break-after,page-break-before,page-break-inside,page-policy,pause,pause-after,pause-before,perspective,perspective-origin,phonemes,pitch,pitch-range,play-during,position,presentation-level,punctuation-trim,quotes,rendering-intent,resize,rest,rest-after,rest-before,richness,right,rotation,rotation-point,ruby-align,ruby-overhang,ruby-position,ruby-span,size,speak,speak-header,speak-numeral,speak-punctuation,speech-rate,stress,string-set,table-layout,target,target-name,target-new,target-position,text-align,text-align-last,text-decoration,text-emphasis,text-height,text-indent,text-justify,text-outline,text-shadow,text-transform,text-wrap,top,transform,transform-origin,transform-style,transition,transition-delay,transition-duration,transition-property,transition-timing-function,unicode-bidi,vertical-align,visibility,voice-balance,voice-duration,voice-family,voice-pitch,voice-pitch-range,voice-rate,voice-stress,voice-volume,volume,white-space,white-space-collapse,widows,width,word-break,word-spacing,word-wrap,z-index".split(","),JAVAKeywords:"abstract,boolean,break,byte,case,catch,char,class,continue,default,do,double,else,extends,false,final,finally,float,for,if,implements,import,instanceof,int,interface,long,native,new,null,package,private,protected,public,return,short,static,super,switch,synchronized,this,throw,throws,transient,true,try,void,volatile,while".split(",")}});
define("examples/editor/textStyler",["orion/editor/annotations","orion/editor/keywords"],function(j,k){function h(a,b){this.keywords=a;this.whitespacesVisible=b;this.setText("")}function e(){h.call(this,null,!0)}function d(a){h.call(this,null,a)}function f(){h.call(this,null,!1)}function c(b,c,j){this.commentStart="/*";this.commentEnd="*/";var k=[];switch(c){case "java":k=i;break;case "js":k=a;break;case "css":k=g}this.whitespacesVisible=this.spacesVisible=this.tabsVisible=!1;this.detectHyperlinks=
!0;this.highlightCaretLine=!1;this.detectTasks=this.foldingEnabled=!0;this._scanner=new h(k,this.whitespacesVisible);this._firstScanner=new f;this._commentScanner=new d(this.whitespacesVisible);this._whitespaceScanner=new e;if(c==="css")this._scanner.isCSS=!0,this._firstScanner.isCSS=!0;this.view=b;this.annotationModel=j;this._bracketAnnotations=void 0;var l=this;this._listener={onChanged:function(a){l._onModelChanged(a)},onDestroy:function(a){l._onDestroy(a)},onLineStyle:function(a){l._onLineStyle(a)},
onMouseDown:function(a){l._onMouseDown(a)},onSelection:function(a){l._onSelection(a)}};c=b.getModel();c.getBaseModel&&(c=c.getBaseModel());c.addEventListener("Changed",this._listener.onChanged);b.addEventListener("MouseDown",this._listener.onMouseDown);b.addEventListener("Selection",this._listener.onSelection);b.addEventListener("Destroy",this._listener.onDestroy);b.addEventListener("LineStyle",this._listener.onLineStyle);this._computeComments();this._computeFolding();b.redrawLines()}var a=k.JSKeywords,
i=k.JAVAKeywords,g=k.CSSKeywords,b={styleClass:"token_singleline_comment"},l={styleClass:"token_multiline_comment"},n={styleClass:"token_doc_comment"},m={styleClass:"token_doc_html_markup"},o={styleClass:"token_task_tag"},t={styleClass:"token_doc_tag"},r={styleClass:"token_string"},s={styleClass:"token_number"},v={styleClass:"token_keyword"},w={styleClass:"token_space",unmergeable:!0},u={styleClass:"token_tab",unmergeable:!0},p={styleClass:"line_caret"};h.prototype={getOffset:function(){return this.offset},
getStartOffset:function(){return this.startOffset},getData:function(){return this.text.substring(this.startOffset,this.offset)},getDataLength:function(){return this.offset-this.startOffset},_default:function(a){switch(a){case 32:case 9:if(this.whitespacesVisible)return a===32?11:10;do a=this._read();while(a===32||a===9);this._unread(a);return 9;case 123:case 125:case 40:case 41:case 91:case 93:case 60:case 62:return a;default:var b=this.isCSS,c=this.offset-1;if(!b&&48<=a&&a<=57){var d=b=!1,e=!1,f=
a;do if(a=this._read(),a===46&&!b)b=!0;else if(a===101&&!d)b=d=!0,a=this._read(),a!==45&&this._unread(a);else if(a===120&&f===48&&this.offset-c===2)b=d=e=!0;else if(!(48<=a&&a<=57||e&&(65<=a&&a<=70||97<=a&&a<=102)))break;while(1);this._unread(a);return 3}if(97<=a&&a<=122||65<=a&&a<=90||a===95||45===a&&b){do a=this._read();while(97<=a&&a<=122||65<=a&&a<=90||a===95||48<=a&&a<=57||45===a&&b);this._unread(a);a=this.keywords;if(a.length>0){c=this.text.substring(c,this.offset);for(b=0;b<a.length;b++)if(this.keywords[b]===
c)return 2}}return 1}},_read:function(){return this.offset<this.text.length?this.text.charCodeAt(this.offset++):-1},_unread:function(a){a!==-1&&this.offset--},nextToken:function(){for(this.startOffset=this.offset;;){var a=this._read(),b;switch(a){case -1:return null;case 47:a=this._read();if(!this.isCSS&&a===47)for(;;)if(a=this._read(),a===-1||a===10||a===13)return this._unread(a),6;if(a===42){a=this._read();b=7;for(a===42&&(b=8);;){for(;a===42;)if(a=this._read(),a===47)return b;if(a===-1)return this._unread(a),
b;a=this._read()}}this._unread(a);return 1;case 39:for(b=4;;)switch(a=this._read(),a){case 39:return b;case 13:case 10:case -1:return this._unread(a),b;case 92:switch(a=this._read(),a){case 10:b=5;break;case 13:b=5,a=this._read(),a!==10&&this._unread(a)}}break;case 34:for(b=4;;)switch(a=this._read(),a){case 34:return b;case 13:case 10:case -1:return this._unread(a),b;case 92:switch(a=this._read(),a){case 10:b=5;break;case 13:b=5,a=this._read(),a!==10&&this._unread(a)}}break;default:return this._default(a)}}},
setText:function(a){this.text=a;this.startOffset=this.offset=0}};e.prototype=new h(null);e.prototype.nextToken=function(){for(this.startOffset=this.offset;;){var a=this._read();switch(a){case -1:return null;case 32:return 11;case 9:return 10;default:do a=this._read();while(!(a===32||a===9||a===-1));this._unread(a);return 1}}};d.prototype=new h(null);d.prototype.setType=function(a){this._type=a};d.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}}};f.prototype=new h(null);f.prototype._default=function(a){for(;;)switch(a=this._read(),a){case 47:case 34:case 39:case -1:return this._unread(a),1}};c.prototype={destroy:function(){var a=this.view;if(a){var b=a.getModel();b.getBaseModel&&(b=b.getBaseModel());b.removeEventListener("Changed",this._listener.onChanged);a.removeEventListener("MouseDown",
this._listener.onMouseDown);a.removeEventListener("Selection",this._listener.onSelection);a.removeEventListener("Destroy",this._listener.onDestroy);a.removeEventListener("LineStyle",this._listener.onLineStyle);this.view=null}},setHighlightCaretLine:function(a){this.highlightCaretLine=a},setWhitespacesVisible:function(a,b){if(this.whitespacesVisible!==a)this.whitespacesVisible=a,this._scanner.whitespacesVisible=a,this._commentScanner.whitespacesVisible=a,b&&this.view.redraw()},setTabsVisible:function(a){if(this.tabsVisible!==
a)this.tabsVisible=a,this.setWhitespacesVisible(this.tabsVisible||this.spacesVisible,!1),this.view.redraw()},setSpacesVisible:function(a){if(this.spacesVisible!==a)this.spacesVisible=a,this.setWhitespacesVisible(this.tabsVisible||this.spacesVisible,!1),this.view.redraw()},setDetectHyperlinks:function(a){this.detectHyperlinks=a},setFoldingEnabled:function(a){this.foldingEnabled=a},setDetectTasks:function(a){this.detectTasks=a},_binarySearch:function(a,b,c,d,e){var f;d===void 0&&(d=-1);if(e===void 0)e=
a.length;for(;e-d>1;)if(f=Math.floor((e+d)/2),b<=a[f].start)e=f;else if(c&&b<a[f].end){e=f;break}else d=f;return e},_computeComments:function(){var a=this.view.getModel();a.getBaseModel&&(a=a.getBaseModel());this.comments=this._findComments(a.getText())},_computeFolding:function(){if(this.foldingEnabled){var a=this.view.getModel();if(a.getBaseModel){var b=this.annotationModel;if(b){b.removeAnnotations(j.AnnotationType.ANNOTATION_FOLDING);for(var c=[],d=a.getBaseModel(),e=this.comments,f=0;f<e.length;f++){var g=
e[f];(g=this._createFoldingAnnotation(a,d,g.start,g.end))&&c.push(g)}b.replaceAnnotations(null,c)}}}},_createFoldingAnnotation:function(a,b,c,d){var e=b.getLineAtOffset(c),b=b.getLineAtOffset(d);return e===b?null:new (j.AnnotationType.getType(j.AnnotationType.ANNOTATION_FOLDING))(c,d,a)},_computeTasks:function(a,b,c){if(this.detectTasks){var d=this.annotationModel;if(d){var e=this.view.getModel(),f=e;e.getBaseModel&&(f=e.getBaseModel());for(var g=d.getAnnotations(b,c),e=[],i=j.AnnotationType.ANNOTATION_TASK;g.hasNext();){var h=
g.next();h.type===i&&e.push(h)}g=[];h=this._commentScanner;h.setText(f.getText(b,c));for(var k;k=h.nextToken();){var l=h.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(i,l,k,f.getText(l,k))))}d.replaceAnnotations(e,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 p}return null},
_getStyles:function(a,b,c){a.getBaseModel&&(c=a.mapOffset(c));for(var d=c+b.length,e=[],f=c,g=this.comments,i=this._binarySearch(g,c,!0);i<g.length;i++){if(g[i].start>=d)break;var h=g[i].start,j=g[i].end;f<h&&this._parse(b.substring(f-c,h-c),f,e);var k=g[i].type,m;switch(k){case 8:m=n;break;case 7:m=l;break;case 5:m=r}f=Math.max(f,h);h=Math.min(d,j);(k===8||k===7)&&(this.whitespacesVisible||this.detectHyperlinks)?this._parseComment(b.substring(f-c,h-c),f,e,m,k):k===5&&this.whitespacesVisible?this._parseString(b.substring(f-
c,h-c),f,e,r):e.push({start:f,end:h,style:m});f=j}f<d&&this._parse(b.substring(f-c,d-c),f,e);if(a.getBaseModel)for(b=0;b<e.length;b++)c=e[b].end-e[b].start,e[b].start=a.mapOffset(e[b].start,!0),e[b].end=e[b].start+c;return e},_parse:function(a,c,d){var e=this._scanner;for(e.setText(a);a=e.nextToken();){var f=e.getStartOffset()+c,g=null;switch(a){case 2:g=v;break;case 3:g=s;break;case 5:case 4:if(this.whitespacesVisible){this._parseString(e.getData(),f,d,r);continue}else g=r;break;case 8:this._parseComment(e.getData(),
f,d,n,a);continue;case 6:this._parseComment(e.getData(),f,d,b,a);continue;case 7:this._parseComment(e.getData(),f,d,l,a);continue;case 10:this.whitespacesVisible&&this.tabsVisible&&(g=u);break;case 11:this.whitespacesVisible&&this.spacesVisible&&(g=w)}d.push({start:f,end:e.getOffset()+c,style:g})}},_parseComment:function(a,b,c,d,e){var f=this._commentScanner;f.setText(a);for(f.setType(e);a=f.nextToken();){var e=f.getStartOffset()+b,g=d;switch(a){case 10:this.whitespacesVisible&&this.tabsVisible&&
(g=u);break;case 11:this.whitespacesVisible&&this.spacesVisible&&(g=w);break;case 12:g=m;break;case 13:g=t;break;case 14:g=o;break;default:this.detectHyperlinks&&(g=this._detectHyperlinks(f.getData(),e,c,g))}g&&c.push({start:e,end:f.getOffset()+b,style:g})}},_parseString:function(a,b,c,d){var e=this._whitespaceScanner;for(e.setText(a);a=e.nextToken();){var f=e.getStartOffset()+b,g=d;switch(a){case 10:this.whitespacesVisible&&this.tabsVisible&&(g=u);break;case 11:this.whitespacesVisible&&this.spacesVisible&&
(g=w)}g&&c.push({start:f,end:e.getOffset()+b,style:g})}},_detectHyperlinks:function(a,b,c,d){var e=null,f;if((f=a.indexOf("://"))>0){for(var e=a,g=f;g>0;){f=e.charCodeAt(g-1);if(!(97<=f&&f<=122||65<=f&&f<=90||45===f||48<=f&&f<=57))break;g--}if(g>0&&(f="\"\"''(){}[]<>".indexOf(e.substring(g-1,g)),f!==-1&&(f&1)===0&&(f=e.lastIndexOf("\"\"''(){}[]<>".substring(f+1,f+2)))!==-1)){var i=f;f=this._clone(d);f.tagName="a";f.attributes={href:e.substring(g,i)};c.push({start:b,end:b+g,style:d});c.push({start:b+
g,end:b+i,style:f});c.push({start:b+i,end:b+a.length,style:d});return null}}else a.toLowerCase().indexOf("bug#")===0&&(e="https://bugs.eclipse.org/bugs/show_bug.cgi?id="+parseInt(a.substring(4),10));return e?(f=this._clone(d),f.tagName="a",f.attributes={href:e},f):d},_clone:function(a){if(!a)return a;var b={},c;for(c in a)a.hasOwnProperty(c)&&(b[c]=a[c]);return b},_findComments:function(a,b){var b=b||0,c=this._firstScanner,d;c.setText(a);for(var e=[];d=c.nextToken();)(d===7||d===8||d===5)&&e.push({start:c.getStartOffset()+
b,end:c.getOffset()+b,type:d}),(d===6||d===7||d===8)&&this._computeTasks(d,c.getStartOffset()+b,c.getOffset()+b);return e},_findMatchingBracket:function(a,b){var c="{}()[]<>",d=a.getText(b,b+1),e=c.indexOf(d,0);if(e===-1)return-1;var f;f=e&1?c.substring(e-1,e):c.substring(e+1,e+2);for(var g=a.getLineAtOffset(b),c=a.getLine(g),i=a.getLineStart(g),h=a.getLineEnd(g),c=this._findBrackets(d,f,c,i,i,h),h=0;h<c.length;h++)if(i=c[h]>=0?1:-1,c[h]*i-1===b){var j=1;if(e&1){for(h--;h>=0;h--)if(i=c[h]>=0?1:-1,
j+=i,j===0)return c[h]*i-1;for(g-=1;g>=0;){c=a.getLine(g);i=a.getLineStart(g);h=a.getLineEnd(g);c=this._findBrackets(d,f,c,i,i,h);for(e=c.length-1;e>=0;e--)if(i=c[e]>=0?1:-1,j+=i,j===0)return c[e]*i-1;g--}}else{for(h++;h<c.length;h++)if(i=c[h]>=0?1:-1,j+=i,j===0)return c[h]*i-1;g+=1;for(e=a.getLineCount();g<e;){c=a.getLine(g);i=a.getLineStart(g);h=a.getLineEnd(g);c=this._findBrackets(d,f,c,i,i,h);for(h=0;h<c.length;h++)if(i=c[h]>=0?1:-1,j+=i,j===0)return c[h]*i-1;g++}}break}return-1},_findBrackets:function(a,
b,c,d,e,f){for(var g=[],a=a.charCodeAt(0),b=b.charCodeAt(0),i=e,h=this._scanner,j,k=this.comments,l=this._binarySearch(k,e,!0);l<k.length;l++){if(k[l].start>=f)break;j=k[l].start;var m=k[l].end;if(i<j)for(h.setText(c.substring(i-e,j-e));j=h.nextToken();)j===a?g.push(h.getStartOffset()+i-e+d+1):j===b&&g.push(-(h.getStartOffset()+i-e+d+1));i=m}if(i<f)for(h.setText(c.substring(i-e,f-e));j=h.nextToken();)j===a?g.push(h.getStartOffset()+i-e+d+1):j===b&&g.push(-(h.getStartOffset()+i-e+d+1));return g},_onDestroy:function(){this.destroy()},
_onLineStyle:function(a){if(a.textView===this.view)a.style=this._getLineStyle(a.lineIndex);a.ranges=this._getStyles(a.textView.getModel(),a.lineText,a.lineStart)},_onSelection:function(a){var b=a.oldValue,c=a.newValue,d=this.view,a=d.getModel(),e;if(this.highlightCaretLine){var f=a.getLineAtOffset(b.start);e=a.getLineAtOffset(c.start);var g=c.start===c.end,b=b.start===b.end;f===e&&b&&g||(b&&d.redrawLines(f,f+1),(f!==e||!b)&&g&&d.redrawLines(e,e+1))}if(this.annotationModel){var b=this._bracketAnnotations,
i,h;if(c.start===c.end&&(h=d.getCaretOffset())>0)h-=1,a.getBaseModel&&(h=a.mapOffset(h),a=a.getBaseModel()),a=this._findMatchingBracket(a,h),a!==-1&&(i=[j.AnnotationType.createAnnotation(j.AnnotationType.ANNOTATION_MATCHING_BRACKET,a,a+1),j.AnnotationType.createAnnotation(j.AnnotationType.ANNOTATION_CURRENT_BRACKET,h,h+1)]);this._bracketAnnotations=i;this.annotationModel.replaceAnnotations(b,i)}},_onMouseDown:function(a){if(a.clickCount===2){var b=this.view,c=b.getModel(),d=b.getOffsetAtLocation(a.x,
a.y);if(d>0){var e=d-1,f=c;c.getBaseModel&&(e=c.mapOffset(e),f=c.getBaseModel());e=this._findMatchingBracket(f,e);e!==-1&&(a.preventDefault(),a=e,c.getBaseModel&&(a=c.mapOffset(a,!0)),d>a&&(d--,a++),b.setSelection(a,d))}}},_onModelChanged:function(a){var b=a.start,c=a.removedCharCount,d=a.addedCharCount-c,e=this.view,a=e.getModel(),f=a.getBaseModel?a.getBaseModel():a,c=b+c,g=f.getCharCount(),i=this.comments.length,h=f.getLineStart(f.getLineAtOffset(b)),k=this._binarySearch(this.comments,h,!0),l=this._binarySearch(this.comments,
c,!1,k-1,i);k<i&&this.comments[k].start<=h&&h<this.comments[k].end?(h=this.comments[k].start,h>b&&(h+=d)):h=k===i&&i>0&&g-d===this.comments[i-1].end?this.comments[i-1].start:h;var m;l<i?(m=this.comments[l].end,m>b&&(m+=d),l+=1):(l=i,m=g);for(var n,g=this._findComments(f.getText(h,m),h),i=k;i<this.comments.length;i++)n=this.comments[i],n.start>b&&(n.start+=d),n.start>b&&(n.end+=d);var o=l-k!==g.length;if(!o)for(i=0;i<g.length;i++){n=this.comments[k+i];var p=g[i];if(n.start!==p.start||n.end!==p.end||
n.type!==p.type){o=!0;break}}i=[k,l-k].concat(g);Array.prototype.splice.apply(this.comments,i);o&&(i=h,n=m,a!==f&&(i=a.mapOffset(i,!0),n=a.mapOffset(n,!0)),e.redrawRange(i,n));if(this.foldingEnabled&&f!==a&&this.annotationModel){e=this.annotationModel;k=e.getAnnotations(h,m);h=[];for(m=[];k.hasNext();)if(n=k.next(),n.type===j.AnnotationType.ANNOTATION_FOLDING){m.push(n);for(i=0;i<g.length;i++)if(n.start===g[i].start&&n.end===g[i].end)break;i===g.length?(h.push(n),n.expand()):(i=n.start,l=n.end,i>
b&&(i-=d),l>b&&(l-=d),i<=b&&b<l&&i<=c&&c<l&&(i=f.getLineAtOffset(n.start),l=f.getLineAtOffset(n.end),i!==l?n.expanded||(n.expand(),e.modifyAnnotation(n)):e.removeAnnotation(n)))}b=[];for(i=0;i<g.length;i++){n=g[i];for(d=0;d<m.length;d++)if(m[d].start===n.start&&m[d].end===n.end)break;d===m.length&&(n=this._createFoldingAnnotation(a,f,n.start,n.end))&&b.push(n)}e.replaceAnnotations(h,b)}}};return{TextStyler:c}});
define("orion/editor/textMateStyler",["orion/regex"],function(j){function k(d){var e;if(d instanceof Array){e=Array(d.length);for(var c=0;c<d.length;c++)e[c]=k(d[c])}else for(c in e={},d)if(Object.prototype.hasOwnProperty.call(d,c)){var a=d[c];e[c]=typeof a==="object"&&a!==null?k(a):a}return e}function h(d,e,c){this.initialize(d);this.grammar=k(e);this.externalGrammars=c?k(c):[];this._styles={};this._tree=null;this._allGrammars={};this.preprocess(this.grammar)}var e={unsupported:[{regex:/\(\?[ims\-]:/,
func:function(){return"option on/off for subexp"}},{regex:/\(\?<([=!])/,func:function(d){return d[1]==="="?"lookbehind":"negative lookbehind"}},{regex:/\(\?>/,func:function(){return"atomic group"}}],toRegExp:function(d){function f(a,b){throw Error('Unsupported regex feature "'+a+'": "'+b[0]+'" at index: '+b.index+" in "+b.input);}var c="",a,d=e.processGlobalFlag("x",d,function(a){for(var b="",c=!1,d=a.length,e=0;e<d;){var f=a.charAt(e);if(!c&&f==="#")for(;e<d&&f!=="\r"&&f!=="\n";)f=a.charAt(++e);
else if(!c&&/\s/.test(f))for(;e<d&&/\s/.test(f);)f=a.charAt(++e);else f==="\\"?(b+=f,/\s/.test(a.charAt(e+1))||(b+=a.charAt(e+1),e+=1)):(f==="["?c=!0:f==="]"&&(c=!1),b+=f),e+=1}return b}),d=e.processGlobalFlag("i",d,function(a){c+="i";return a});for(a=0;a<this.unsupported.length;a++){var i;(i=this.unsupported[a].regex.exec(d))&&f(this.unsupported[a].func(i),i)}return RegExp(d,c)},processGlobalFlag:function(d,e,c){function a(a,b){for(var c=0,d=a.length,e=-1,f=b;f<d&&e===-1;f++)switch(a.charAt(f)){case "\\":f++;
break;case "(":c++;break;case ")":c--,c===0&&(e=f)}return e}var i="(?"+d+")",d="(?"+d+":";if(e.substring(0,i.length)===i)return c(e.substring(i.length));else if(e.substring(0,d.length)===d){i=a(e,0);if(i<e.length-1)throw Error("Only a "+d+") group that encloses the entire regex is supported in: "+e);return c(e.substring(d.length,i))}return e},hasBackReference:function(d){return/\\\d+/.test(d.source)},getSubstitutedRegex:function(d,e,c){for(var c=typeof c==="undefined"?!0:!1,d=d.source.split(/(\\\d+)/g),
a=[],i=0;i<d.length;i++){var g=d[i],b=/\\(\d+)/.exec(g);b?(g=e[b[1]]||"",a.push(c?j.escape(g):g)):a.push(g)}return RegExp(a.join(""))},groupify:function(d,e){for(var c=d.source,a=c.length,i=[],g=0,b=[],h=1,j=1,k=[],o={},t={},r=0;r<a;r++){var s=i[i.length-1],v=c.charAt(r);switch(v){case "(":if(s===4)i.pop(),k.push(")"),b[b.length-1].end=r;var w=r+2<a?c.charAt(r+1)+""+c.charAt(r+2):null;if(w==="?:"||w==="?="||w==="?!"){var u;w==="?:"?u=1:(u=3,g++);i.push(u);b.push({start:r,end:-1,type:u});k.push(v);
k.push(w);r+=w.length}else i.push(2),b.push({start:r,end:-1,type:2,oldNum:h,num:j}),k.push(v),g===0&&(t[j]=null),o[h]=j,h++,j++;break;case ")":s=i.pop();s===3&&g--;b[b.length-1].end=r;k.push(v);break;case "*":case "+":case "?":case "}":var p=v,q=c.charAt(r-1),w=r-1;if(v==="}"){for(u=r-1;c.charAt(u)!=="{"&&u>=0;u--);q=c.charAt(u-1);w=u-1;p=c.substring(u,r+1)}u=b[b.length-1];if(q===")"&&(u.type===2||u.type===4)){k.splice(u.start,0,"(");k.push(p);k.push(")");v={start:u.start,end:k.length-1,type:4,num:u.num};
for(q=0;q<b.length;q++)if(s=b[q],(s.type===2||s.type===4)&&s.start>=u.start&&s.end<=w)if(s.start+=1,s.end+=1,s.num+=1,s.type===2)o[s.oldNum]=s.num;b.push(v);j++;break}default:v!=="|"&&s!==2&&s!==4&&g===0&&(i.push(4),b.push({start:r,end:-1,type:4,num:j}),k.push("("),t[j]=null,j++),k.push(v),v==="\\"&&(v=c.charAt(r+1),k.push(v),r+=1)}}for(;i.length;)i.pop(),k.push(")");var c=RegExp(k.join("")),a={},e=e||o,x;for(x in e)e.hasOwnProperty(x)&&(a[x]="\\"+e[x]);c=this.getSubstitutedRegex(c,a,!1);return[c,
o,t]},complexCaptures:function(d){if(!d)return!1;for(var e in d)if(d.hasOwnProperty(e)&&e!=="0")return!0;return!1}};h.prototype={initialize:function(d){this.textView=d;this.textView.stylerOptions=this;var e=this;this._listener={onModelChanged:function(c){e.onModelChanged(c)},onDestroy:function(c){e.onDestroy(c)},onLineStyle:function(c){e.onLineStyle(c)},onStorage:function(c){e.onStorage(c)}};d.addEventListener("ModelChanged",this._listener.onModelChanged);d.addEventListener("Destroy",this._listener.onDestroy);
d.addEventListener("LineStyle",this._listener.onLineStyle);d.redrawLines()},onDestroy:function(){this.destroy()},destroy:function(){if(this.textView)this.textView.removeEventListener("ModelChanged",this._listener.onModelChanged),this.textView.removeEventListener("Destroy",this._listener.onDestroy),this.textView.removeEventListener("LineStyle",this._listener.onLineStyle),this.textView=null;this._listener=this._tree=this._styles=this.grammar=null},preprocess:function(d){for(d=[d];d.length!==0;){var e=
d.pop();if(!e._resolvedRule||!e._typedRule)if(e._resolvedRule=this._resolve(e),e._typedRule=this._createTypedRule(e),this.addStyles(e.name),this.addStyles(e.contentName),this.addStylesForCaptures(e.captures),this.addStylesForCaptures(e.beginCaptures),this.addStylesForCaptures(e.endCaptures),e._resolvedRule!==e&&d.push(e._resolvedRule),e.patterns)for(var c=0;c<e.patterns.length;c++)d.push(e.patterns[c])}},addStyles:function(d){if(d&&!this._styles[d]){this._styles[d]=[];for(var e=d.split("."),c=0;c<
e.length;c++)this._styles[d].push(e.slice(0,c+1).join("-"))}},addStylesForCaptures:function(d){for(var e in d)d.hasOwnProperty(e)&&this.addStyles(d[e].name)},ContainerRule:function(){function d(d){this.rule=d;this.subrules=d.patterns}d.prototype.valueOf=function(){return"aa"};return d}(),BeginEndRule:function(){function d(d){this.rule=d;this.beginRegex=e.toRegExp(d.begin);this.endRegex=e.toRegExp(d.end);this.subrules=d.patterns||[];this.endRegexHasBackRef=e.hasBackReference(this.endRegex);var c=e.complexCaptures(d.captures),
d=e.complexCaptures(d.beginCaptures)||e.complexCaptures(d.endCaptures);if(this.isComplex=c||d)c=e.groupify(this.beginRegex),this.beginRegex=c[0],this.beginOld2New=c[1],this.beginConsuming=c[2],c=e.groupify(this.endRegex,this.beginOld2New),this.endRegex=c[0],this.endOld2New=c[1],this.endConsuming=c[2]}d.prototype.valueOf=function(){return this.beginRegex};return d}(),MatchRule:function(){function d(d){this.rule=d;this.matchRegex=e.toRegExp(d.match);if(this.isComplex=e.complexCaptures(d.captures))d=
e.groupify(this.matchRegex),this.matchRegex=d[0],this.matchOld2New=d[1],this.matchConsuming=d[2]}d.prototype.valueOf=function(){return this.matchRegex};return d}(),_createTypedRule:function(d){return d.match?new this.MatchRule(d):d.begin?new this.BeginEndRule(d):new this.ContainerRule(d)},_resolve:function(d){var e=d;if(d.include){if(d.begin||d.end||d.match)throw Error('Unexpected regex pattern in "include" rule '+d.include);d=d.include;if(d.charAt(0)==="#"){if(e=this.grammar.repository&&this.grammar.repository[d.substring(1)],
!e)throw Error("Couldn't find included rule "+d+" in grammar repository");}else if(d==="$self")e=this.grammar;else if(d==="$base")throw Error('Include "$base" is not supported');else if(e=this._allGrammars[d],!e)for(var c=0;c<this.externalGrammars.length;c++){var a=this.externalGrammars[c];if(a.scopeName===d){this.preprocess(a);e=this._allGrammars[d]=a;break}}}return e},ContainerNode:function(){function d(d,c){this.parent=d;this.rule=c;this.children=[];this.end=this.start=null}d.prototype.addChild=
function(d){this.children.push(d)};d.prototype.valueOf=function(){var d=this.rule;return"ContainerNode { "+(d.include||"")+" "+(d.name||"")+(d.comment||"")+"}"};return d}(),BeginEndNode:function(){function d(d,c,a){this.parent=d;this.rule=c;this.children=[];this.setStart(a);this.endMatch=this.end=null;this.endRegexSubstituted=c.endRegexHasBackRef?e.getSubstitutedRegex(c.endRegex,a):null}d.prototype.addChild=function(d){this.children.push(d)};d.prototype.getIndexInParent=function(){return this.parent?
this.parent.children.indexOf(this):-1};d.prototype.setStart=function(d){this.start=d.index;this.beginMatch=d};d.prototype.setEnd=function(d){d&&typeof d==="object"?(this.endMatch=d,this.end=d.index+d[0].length):(this.endMatch=null,this.end=d)};d.prototype.shiftStart=function(d){this.start+=d;this.beginMatch.index+=d};d.prototype.shiftEnd=function(d){this.end+=d;this.endMatch&&(this.endMatch.index+=d)};d.prototype.valueOf=function(){return"{"+this.rule.beginRegex+" range="+this.start+".."+this.end+
"}"};return d}(),push:function(d,e){if(e)for(var c=e.length;c>0;)d.push(e[--c])},exec:function(d,e,c){(e=d.exec(e))&&(e.index+=c);d.lastIndex=0;return e},afterMatch:function(d){return d.index+d[0].length},getEndMatch:function(d,e,c){if(d instanceof this.BeginEndNode){var a=d.rule,d=d.endRegexSubstituted||a.endRegex;return!d?null:this.exec(d,e,c)}return null},initialParse:function(){this.textView.getModel().getCharCount();this._tree=new this.ContainerNode(null,this.grammar._typedRule);this.parse(this._tree,
!1,0)},onModelChanged:function(d){var e=d.addedCharCount,c=d.removedCharCount,d=d.start;if(this._tree){var a=this.textView.getModel(),i=a.getCharCount(),a=a.getLineEnd(a.getLineAtOffset(d)-1),g=this.getFirstDamaged(a,a),a=a===-1?0:a,e=g?this.parse(g,!0,a,d,e,c):i;this.textView.redrawRange(a,e)}else this.initialParse()},getFirstDamaged:function(d,e){if(d<0)return this._tree;for(var c=[this._tree],a=null;c.length;){var i=c.pop();if(!i.parent||this.isDamaged(i,d,e)){i instanceof this.BeginEndNode&&(a=
i);for(var g=0;g<i.children.length;g++)c.push(i.children[g])}}return a||this._tree},isDamaged:function(d,e,c){return d.start<=c&&d.end>e},parse:function(d,e,c,a,i,g){var b=this.textView.getModel(),h=b.getLineStart(b.getLineCount()-1),j=b.getCharCount(),k=this.getInitialExpected(d,c),o=-1;if(e)d.repaired=!0,d.endNeedsUpdate=!0,o=(o=d.children[d.children.length-1])?b.getLineEnd(b.getLineAtOffset(o.end+(i-g))):-1,a=b.getLineEnd(b.getLineAtOffset(a+g)),o=Math.max(o,a);for(var o=o===-1?j:o,a=k,t=d,r=!1,
s=c,v=-1;t&&(!e||s<o);){var w=this.getNextMatch(b,t,s);w||(s=s>=h?j:b.getLineStart(b.getLineAtOffset(s)+1));var u=w&&w.match,p=w&&w.rule,q=w&&w.isEnd;if(w&&w.isSub){if(s=this.afterMatch(u),p instanceof this.BeginEndRule)r=!0,e&&p===a.rule&&t===a.parent?(t=a,t.setStart(u),t.repaired=!0,t.endNeedsUpdate=!0,a=this.getNextExpected(a,"begin")):(e&&(this.prune(t,a),e=!1),u=new this.BeginEndNode(t,p,u),t.addChild(u),t=u)}else if(q||s===j){if(t instanceof this.BeginEndNode)u?(r=!0,v=Math.max(v,t.end),t.setEnd(u),
s=this.afterMatch(u),e&&t===a&&t.parent===a.parent?(t.repaired=!0,delete t.endNeedsUpdate,a=this.getNextExpected(a,"end")):e&&(this.prune(t,a),e=!1)):(t.setEnd(j),delete t.endNeedsUpdate);t=t.parent}e&&s>=o&&!r&&(this.prune(d,k),e=!1)}this.removeUnrepairedChildren(d,e,c);this.cleanup(e,d,c,o,j,i,g);return e?Math.max(v,s):s},removeUnrepairedChildren:function(d,e,c){if(e){for(var e=d.children,a=-1,i=0;i<e.length;i++){var g=e[i];if(!g.repaired&&this.isDamaged(g,c,Number.MAX_VALUE)){a=i;break}}if(a!==
-1)d.children.length=a}},cleanup:function(d,e,c,a,i,g,b){if(d){d=g-b;i=this.getIntersecting(a-d+1,i);e=this.getIntersecting(c,a);for(c=0;c<i.length;c++)a=i[c],!a.repaired&&a instanceof this.BeginEndNode&&(a.shiftEnd(d),a.shiftStart(d));for(c=0;c<e.length;c++)a=e[c],a.repaired&&a.endNeedsUpdate&&a.shiftEnd(d),delete a.endNeedsUpdate,delete a.repaired}else{e=this.getIntersecting(c,a);for(c=0;c<e.length;c++)delete e[c].repaired}},getNextMatch:function(d,e,c,a){var i=d.getLineAtOffset(c),i=d.getLineEnd(i),
g=d.getText(c,i),b=[],h=[],d=[],i=[];for(this.push(b,e.rule.subrules);b.length;){var j=b.length?b.pop():null,j=j&&j._resolvedRule._typedRule;if(j instanceof this.ContainerRule&&h.indexOf(j)===-1)h.push(j),this.push(b,j.subrules);else if(!j||!a||j.matchRegex){var k=j&&this.exec(j.matchRegex||j.beginRegex,g,c);k&&(d.push(k),i.push(j))}}b=Number.MAX_VALUE;h=-1;for(j=0;j<d.length;j++)if(k=d[j],k.index<b)b=k.index,h=j;if(!a&&(c=this.getEndMatch(e,g,c)))if(a=e.rule.applyEndPatternLast,h===-1||c.index<b||
!a&&c.index===b)return{isEnd:!0,rule:e.rule,match:c};return h===-1?null:{isSub:!0,rule:i[h],match:d[h]}},getInitialExpected:function(d,e){var c,a;if(d===this._tree)for(c=0;c<d.children.length;c++){if(a=d.children[c],a.start>=e)return a}else if(d instanceof this.BeginEndNode&&d.endMatch){var i=d.endMatch.index;for(c=0;c<d.children.length;c++)if(a=d.children[c],a.start>=e)break;if(a&&a.start<i)return a}return d},getNextExpected:function(d,e){if(e==="begin"){var c=d.children[0];return c?c:d}else if(e===
"end"&&(c=d.parent)){var a=c.children[c.children.indexOf(d)+1];return a?a:c}return null},prune:function(d,e){if(e.parent===d)d.children.length=e.getIndexInParent();else if(d instanceof this.BeginEndNode)d.endMatch=null,d.end=null;if(d.parent)d.parent.children.length=d.getIndexInParent()+1},onLineStyle:function(d){this._tree||this.initialParse();var e=d.lineStart,c=this.textView.getModel(),a=c.getLineEnd(d.lineIndex),i=c.getLineEnd(c.getLineAtOffset(e)-1),i=this.getFirstDamaged(i,i),e=this.getLineScope(c,
i,e,a);d.ranges=this.toStyleRanges(e);d.ranges.sort(function(a,b){return a.start-b.start})},getLineScope:function(d,e,c,a){for(var i=c,g=this.getInitialExpected(e,c),b=[],h=[];e&&i<a;){var j=this.getNextMatch(d,e,i);if(!j)break;var k=j&&j.match,o=j&&j.rule,t=j&&j.isSub,j=j&&j.isEnd;k.index!==i&&h.push({start:i,end:k.index,node:e});if(t)i=this.afterMatch(k),o instanceof this.BeginEndRule?(this.addBeginScope(b,k,o),e=g,g=this.getNextExpected(g,"begin")):this.addMatchScope(b,k,o);else if(j)i=this.afterMatch(k),
this.addEndScope(b,k,o),g=this.getNextExpected(g,"end"),e=e.parent}i<a&&h.push({start:i,end:a,node:e});d=this.getInheritedLineScope(h,c,a);return b.concat(d)},getInheritedLineScope:function(d){for(var e=[],c=0;c<d.length;c++)for(var a=d[c],i=a.node;i;){var g=i.rule.rule,b=g.name;if(g=g.contentName||b){this.addScopeRange(e,a.start,a.end,g);break}i=i.parent}return e},addBeginScope:function(d,e,c){var a=c.rule;this.addCapturesScope(d,e,a.beginCaptures||a.captures,c.isComplex,c.beginOld2New,c.beginConsuming)},
addEndScope:function(d,e,c){var a=c.rule;this.addCapturesScope(d,e,a.endCaptures||a.captures,c.isComplex,c.endOld2New,c.endConsuming)},addMatchScope:function(d,e,c){var a=c.rule,i=a.name;(a=a.captures)?this.addCapturesScope(d,e,a,c.isComplex,c.matchOld2New,c.matchConsuming):this.addScope(d,e,i)},addScope:function(d,e,c){c&&d.push({start:e.index,end:this.afterMatch(e),scope:c})},addScopeRange:function(d,e,c,a){a&&d.push({start:e,end:c,scope:a})},addCapturesScope:function(d,e,c,a,i,g){if(c)if(a){for(var a=
{1:0},b=0,h=1;e[h]!==void 0;h++)g[h]!==void 0&&(b+=e[h].length),e[h+1]!==void 0&&(a[h+1]=b);g=e.index;for(b=1;c[b];b++){var h=c[b].name,j=i[b],k=g+a[j];typeof e[j]!=="undefined"&&this.addScopeRange(d,k,k+e[j].length,h)}}else this.addScope(d,e,c[0]&&c[0].name)},getIntersecting:function(d,e){for(var c=[],a=this._tree?[this._tree]:[];a.length;){var i=a.pop(),g=!1;i instanceof this.ContainerNode?g=!0:this.isDamaged(i,d,e)&&(g=!0,c.push(i));if(g)for(var g=i.children.length,b=0;b<g;b++)a.push(i.children[b])}return c.reverse()},
toStyleRanges:function(d){for(var e=[],c=0;c<d.length;c++){var a=d[c],i=this._styles[a.scope];if(!i)throw Error("styles not found for "+a.scope);i=i.join(" ");e.push({start:a.start,end:a.end,style:{styleClass:i}})}return e}};return{RegexUtil:e,TextMateStyler:h}});
define("orion/editor/AsyncStyler",["i18n!orion/editor/nls/messages","orion/editor/annotations"],function(j,k){function h(c){return c.getProperty("objectClass").indexOf(d)!==-1&&c.getProperty("type")==="highlighter"}function e(c,a,d){this.initialize(c,a,d);this.lineStyles=[]}var d="orion.edit.highlighter",f=d+" 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"}});
e.prototype={initialize:function(c,a,e){this.textView=c;this.serviceRegistry=a;this.annotationModel=e;this.services=[];var g=this;this.listener={onModelChanging:function(a){g.onModelChanging(a)},onModelChanged:function(a){g.onModelChanged(a)},onDestroy:function(a){g.onDestroy(a)},onLineStyle:function(a){g.onLineStyle(a)},onStyleReady:function(a){g.onStyleReady(a)},onServiceAdded:function(a){g.onServiceAdded(a.serviceReference,g.serviceRegistry.getService(a.serviceReference))},onServiceRemoved:function(a){g.onServiceRemoved(a.serviceReference,
g.serviceRegistry.getService(a.serviceReference))}};c.addEventListener("ModelChanging",this.listener.onModelChanging);c.addEventListener("ModelChanged",this.listener.onModelChanged);c.addEventListener("Destroy",this.listener.onDestroy);c.addEventListener("LineStyle",this.listener.onLineStyle);a.addEventListener("registered",this.listener.onServiceAdded);a.addEventListener("unregistering",this.listener.onServiceRemoved);c=a.getServiceReferences(d);for(e=0;e<c.length;e++){var b=c[e];h(b)&&this.addServiceListener(a.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 c=0;c<this.services.length;c++)this.removeServiceListener(this.services[c]);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(c){this.startLine=this.textView.getModel().getLineAtOffset(c.start)},onModelChanged:function(c){var a=this.startLine;(c.addedLineCount||c.removedLineCount)&&Array.prototype.splice.apply(this.lineStyles,[a,c.removedLineCount].concat(this._getEmptyStyle(c.addedLineCount)))},
onStyleReady:function(c){var a=c.lineStyles||c.style,c=Number.MAX_VALUE,d=-1,e=this.textView.getModel(),b;for(b in a)Object.prototype.hasOwnProperty.call(a,b)&&(this.lineStyles[b]=a[b],c=Math.min(c,b),d=Math.max(d,b));c=Math.max(c,0);d=Math.min(d,e.getLineCount());if(a=this.annotationModel){for(var f=a.getAnnotations(e.getLineStart(c),e.getLineEnd(d)),h=[];f.hasNext();){var j=f.next();j.type==="orion.annotation.highlightError"&&h.push(j)}f=[];for(j=c;j<=d;j++){b=j;var o=this.lineStyles[b],o=o&&o.errors;
b=e.getLineStart(b);if(o)for(var t=0;t<o.length;t++){var r=o[t];f.push(k.AnnotationType.createAnnotation("orion.annotation.highlightError",r.start+b,r.end+b))}}a.replaceAnnotations(h,f)}this.textView.redrawLines(c,d+1)},onLineStyle:function(c){function a(a,b){for(var c=a.length,d=[],e=0;e<c;e++){var f=a[e];d.push({start:f.start+b,end:f.end+b,style:f.style})}return d}var d=this.lineStyles[c.lineIndex];if(d)if(d.ranges)c.ranges=a(d.ranges,c.lineStart);else if(d.style)c.style=d.style},_getEmptyStyle:function(c){for(var a=
[],d=0;d<c;d++)a.push(null);return a},setContentType:function(c){this.contentType=c;if(this.services)for(c=0;c<this.services.length;c++){var a=this.services[c];if(a.setContentType){var d=this.serviceRegistry.getService("orion.page.progress");d?d.progress(a.setContentType(this.contentType),"Styling content type: "+this.contentType.id?this.contentType.id:this.contentType):a.setContentType(this.contentType)}}},onServiceAdded:function(c,a){h(c)&&this.addServiceListener(a)},onServiceRemoved:function(c,
a){this.services.indexOf(a)!==-1&&this.removeServiceListener(a)},addServiceListener:function(c){if(typeof c.addEventListener==="function"){if(c.addEventListener("orion.edit.highlighter.styleReady",this.listener.onStyleReady),this.services.push(c),c.setContentType&&this.contentType){var a=this.serviceRegistry.getService("orion.page.progress");a?a.progress(c.setContentType(this.contentType),"Styling content type: "+this.contentType.id?this.contentType.id:this.contentType):c.setContentType(this.contentType)}}else typeof console!==
"undefined"&&console.log(Error(f))},removeServiceListener:function(c){typeof c.removeEventListener==="function"?(c.removeEventListener("orion.edit.highlighter.styleReady",this.listener.onStyleReady),c=this.services.indexOf(c),c!==-1&&this.services.splice(c,1)):typeof console!=="undefined"&&console.log(Error(f))}};return e});
define("orion/highlight",["examples/editor/textStyler","orion/editor/textMateStyler","orion/editor/AsyncStyler","orion/Deferred"],function(j,k,h,e){function d(c,a,d,g,b,f,n){function m(b,c){var g=b.getProperty("contentType"),f=b.getProperty("fileTypes");if(g)return a.isSomeExtensionOf(d,g).then(function(a){return a?b:null});else if(c&&f&&f.indexOf(c)!==-1)return g=new e,g.resolve(b),g;return null}var o=function(a){var c=null;switch(a&&a.id){case "application/javascript":case "application/json":c=
new j.TextStyler(g,"js",b);break;case "text/x-java-source":c=new j.TextStyler(g,"java",b);break;case "text/css":c=new j.TextStyler(g,"css",b)}return c}(d);if(o)return f=new e,f.resolve(o),f;for(var o=f&&f.split(".").pop().toLowerCase(),f=c.getServiceReferences("orion.edit.highlighter"),t=[],r=[],s=0;s<f.length;s++){var v=f[s];v.getProperty("type")==="grammar"&&t.push(v.getProperty("grammar"));(v=m(v,o))&&r.push(v)}return e.all(r,function(a){return{_error:a}}).then(function(a){for(var e,f=a.length-
1;f>=0;f--){var j=a[f];if(j&&!j._error&&(n||j.getProperty("type")!=="highlighter")){e=j;break}}var l;if(e)if(a=e.getProperty("type"),a==="highlighter")l=new h(g,c,b),l.setContentType(d);else if(a==="grammar"||typeof a==="undefined")e=e.getProperty("grammar"),l=new k.TextMateStyler(g,e,t);return l})}function f(c){this.serviceRegistry=c;this.styler=null}f.prototype={setup:function(c,a,e,g,b){b=typeof b==="undefined"?!0:b;if(this.styler)this.styler.destroy&&this.styler.destroy(),this.styler=null;var f=
this;return d(this.serviceRegistry,this.serviceRegistry.getService("orion.core.contentTypeRegistry"),c,a,e,g,b).then(function(a){return f.styler=a})},getStyler:function(){return this.styler}};return{createStyler:d,SyntaxHighlighter:f}});
define("orion/searchAndReplace/textSearcher",["i18n!orion/search/nls/messages","orion/editor/find","orion/commands","orion/objects","orion/webui/littlelib"],function(j,k,h,e,d){function f(c,a,d,e){k.Find.call(this,c,d,e);this._commandService=a}f.prototype=new k.Find;e.mixin(f.prototype,{getFindString:function(){var c=document.getElementById("localSearchFindWith");return!c?k.Find.prototype.getFindString.call(this):c.value},getReplaceString:function(){var c=document.getElementById("localSearchReplaceWith");
return!c?k.Find.prototype.getReplaceString(this):c.value},hide:function(){var c=this.isVisible();k.Find.prototype.hide.call(this);c&&this._commandService.closeParameterCollector()},show:function(c){k.Find.prototype.show.call(this,c);var a=c.findString,c=c.replaceString,d=document.getElementById("localSearchFindWith");d||(this._createActionTable(),d=document.getElementById("localSearchFindWith"));if(a)d.value=a;if(c)document.getElementById("localSearchReplaceWith").value=c;window.setTimeout(function(){d.select();
d.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 c=this;this._commandService.openParameterCollector("pageNavigationActions",function(a){var d=document.createElement("input");d.type="text";d.name=j["Find:"];d.className="parameterInput";d.id="localSearchFindWith";d.placeholder=
j["Find With"];d.oninput=function(a){return c._handleInput(a)};d.onkeydown=function(a){return c._handleKeyDown(a)};a.appendChild(d);c._createButton("Next",a,function(){c.find(!0)});c._createButton("Previous",a,function(){c.find(!1)});var e=c._editor.getTextView().getOptions("readonly");if(!e){var b=document.createElement("input");b.type="text";b.name=j["ReplaceWith:"];b.className="parameterInput";b.id="localSearchReplaceWith";b.placeholder=j["Replace With"];b.onkeydown=function(a){return c._handleKeyDown(a)};
a.appendChild(b);c._replaceInfo=c._createInfoImage(null,a,null);c._showReplaceInfo();c._createButton(j.Replace,a,function(){c.replace()});c._createButton(j["Replace All"],a,function(){c.replaceAll()})}b=document.createElement("div");a.appendChild(b);b.classList.add("findOptionsDiv");var f=h.createDropdownMenu(b,j.Options,null,"dismissButton",null,!0);f.menuButton.classList.add("parameterInlineButton");h.createCheckedMenuItem(f.menu,j["Show all"],c._showAll,function(a){c.setOptions({showAll:a.target.checked});
f.dropdown.close(!0)});h.createCheckedMenuItem(f.menu,j["Case sensitive"],!c._caseInsensitive,function(a){c.setOptions({caseInsensitive:!a.target.checked});f.dropdown.close(!0);c.find(!0)});h.createCheckedMenuItem(f.menu,j["Wrap search"],c._wrap,function(a){c.setOptions({wrap:a.target.checked});f.dropdown.close(!0)});h.createCheckedMenuItem(f.menu,j["Incremental search"],c._incremental,function(a){c.setOptions({incremental:a.target.checked});f.dropdown.close(!0)});h.createCheckedMenuItem(f.menu,j["Whole Word"],
c._wholeWord,function(a){c.setOptions({wholeWord:a.target.checked});f.dropdown.close(!0);c.find(!0)});c._regExBox=h.createCheckedMenuItem(f.menu,j["Regular expression"],c._regex,function(a){c.setOptions({regex:a.target.checked});f.dropdown.close(!0);c.find(!0);c._showReplaceInfo()});e||h.createCheckedMenuItem(f.menu,j["Find after replace"],c._findAfterReplace,function(a){c.setOptions({findAfterReplace:a.target.checked});f.dropdown.close(!0)});return d},function(){c.hide()})},_createButton:function(c,
a,e){var g=document.createElement("button");g.addEventListener("click",e.bind(this),!1);var b=this;g.addEventListener("keydown",function(a){a.keyCode===d.KEY.ESCAPE&&b.hide()});g.appendChild(document.createTextNode(c));g.className="dismissButton parameterInlineButton";a.appendChild(g)},_createInfoImage:function(c,a){var d=document.createElement("img");d.classList.add("replaceInfo");d.addEventListener("click",function(){this._regExBox.checked=!this._regex;this.setOptions({regex:!this._regex});this.find(!0);
this._showReplaceInfo()}.bind(this));a.appendChild(d);return d},_handleInput:function(){this._incremental&&this.find(!0,null,!0);return!0},_handleKeyDown:function(c){var a=(this.isMac?c.metaKey:c.ctrlKey)&&!c.altKey&&!c.shiftKey;if(a&&c.keyCode===70)return c.stopPropagation&&c.stopPropagation(),c.cancelBubble=!0,!1;if((this.isMac?c.metaKey:c.ctrlKey)&&!c.altKey&&c.keyCode===75||c.keyCode===13)return c.stopPropagation&&c.stopPropagation(),c.cancelBubble=!0,c.keyCode===13?this.find(this._reverse?c.shiftKey:
!c.shiftKey):this.find(!c.shiftKey),!1;if(a&&c.keyCode===82)return c.stopPropagation&&c.stopPropagation(),c.cancelBubble=!0,this.replace(),!1;return c.keyCode===27?(this.hide(),!1):!0}});return{TextSearcher:f}});
define("orion/edit/nls/root/messages",{Fetching:"Fetching: ${0}",confirmUnsavedChanges:"There are unsaved changes.  Do you still want to navigate away?",searchFiles:"Search Files",searchTerm:"Enter search term:",unsavedChanges:"There are unsaved changes.",Save:"Save",Saved:"Saved",Blame:"Blame",BlameTooltip:"Show blame annotations",saveOutOfSync:"Resource is out of sync with the server. Do you want to save it anyway?",loadOutOfSync:"Resource is out of sync with the server. Do you want to load it anyway? This will overwrite your local changes.",
ReadingMetadata:"Reading metadata of ${0}",Reading:"Reading ${0}",readonly:"Read Only.",saveFile:"Save this file",gotoLine:"Go to Line",gotoLineTooltip:"Go to specified line number",gotoLinePrompt:"Go to line:",Undo:"Undo",Redo:"Redo",Find:"Find",noResponse:"No response from server.  Check your internet connection and try again.",savingFile:"Saving file ${0}",running:"Running ${0}","Saving...":"Saving...",View:"View",ViewTooltip:"View",Actions:"Actions",Navigator:"Navigator",FolderNavigator:"Folder Navigator",
Project:"Project",New:"New",Add:"Add",NoFile:"Use the ${0} to create new files and folders. Click a file to start coding.",LocalEditorSettings:"Local Editor Settings",NoProject:"${0} is not a project. To convert it to a project use ${1}.",ChooseFS:"Choose Filesystem",ChooseFSTooltip:"Choose the filesystem you want to view.",FSTitle:"${0} (${1})"});
define("orion/edit/nls/messages",["orion/i18n!orion/edit/nls/messages","orion/edit/nls/root/messages"],function(j,k){var h={root:k};Object.keys(j).forEach(function(e){typeof h[e]==="undefined"&&(h[e]=j[e])});return h});
define("orion/blamer",["orion/extensionCommands","orion/PageLinks","orion/URITemplate"],function(j,k,h){function e(d,e){for(var c=e.getFileMetadata(),a=d.getServiceReferences("orion.edit.blamer"),h=0;h<a.length;h++){var g=a[h],b={};b.validationProperties=g.getProperty("validationProperties");b.forceSingleItem=!0;b=j._makeValidator(b,d);if(b.validationFunction.bind(b)(c))return d.getService(g)}return null}return{isVisible:function(d,f){return!!e(d,f)&&!!d.getService("orion.core.blame")},getBlame:function(d,
f){var c=e(d,f);c&&c.doBlame(f.getInput()).then(function(a){for(var c=k.getOrionHome(),e=0;e<a.length;e++){var b=a[e],f=new h(b.CommitLink),j={};j.OrionHome=c;b.CommitLink=f.expand(j)}d.getService("orion.core.blame")._setAnnotations(a)})}}});
define("orion/edit/editorContext",[],function(){return{getEditorContext:function(j){var k={};j.getServiceReferences("orion.edit.context").forEach(function(h){var e=j.getService(h);Object.keys(e).forEach(function(d){typeof e[d]==="function"&&(k[d]=e[d].bind(e))})});return k}}});
define("orion/editorCommands","i18n!orion/edit/nls/messages,orion/i18nUtil,orion/webui/littlelib,orion/webui/dialogs/OpenResourceDialog,orion/widgets/input/DropDownMenu,orion/Deferred,orion/URITemplate,orion/commands,orion/keyBinding,orion/commandRegistry,orion/extensionCommands,orion/contentTypes,orion/searchUtils,orion/PageUtil,orion/PageLinks,orion/blamer,orion/regex,orion/util,orion/edit/editorContext".split(","),function(j,k,h,e,d,f,c,a,i,g,b,l,n,m,o,t,r,s,v){function w(a){var b=new c(a.uriTemplate),
d=a.params||{};d.OrionHome=d.OrionHome||o.getOrionHome();var b=b.expand(d),d=document.createElement("div"),e=document.createElement("iframe");e.id=a.id;e.name=a.id;e.type="text/html";e.sandbox="allow-scripts allow-same-origin";e.frameborder=a.border!==void 0?a.border:1;e.src=b;e.className="delegatedUI";if(a.width)d.style.width=a.width,e.style.width=a.width;if(a.height)d.style.height=a.height,e.style.height=a.height;e.style.visibility="hidden";a.parent!==null&&(a.parent||window.document.body).appendChild(d);
d.appendChild(e);e.style.left=a.left||(window.innerWidth-parseInt(e.clientWidth,10))/2+"px";e.style.top=a.top||(window.innerHeight-parseInt(e.clientHeight,10))/2+"px";e.style.visibility="";window.addEventListener("message",function y(b){if(b.source===e.contentWindow&&typeof b.data==="string"&&(b=JSON.parse(b.data),b.pageService==="orion.page.delegatedUI"&&b.source===a.id)){if(b.cancelled)a.cancelled&&a.cancelled();else if(b.result)a.done&&a.done(b.result);else if(b.Status||b.status)a.status&&a.status(b.Status||
b.status);window.removeEventListener("message",y,!1);e.parentNode.removeChild(e)}},!1);return d}function u(a,b,c,d,e,g,f,h,i,j,k){this.serviceRegistry=a;this.commandService=b;this.fileClient=c;this.inputManager=d;this.toolbarId=e;this.pageNavId=f;this.isReadOnly=g;this._localSearcher=h;this._searcher=i;this.editorSettings=j;this.localSettings=k}var p={},q=null;p.createDelegatedUI=w;u.prototype={generateEditorCommands:function(a){this._generateSettingsCommand(a);this._generateSearchFilesCommand(a);
this.isReadOnly||(this._generateUndoStackCommands(a),this._generateSaveCommand(a));this._generateGotoLineCommnand(a);this._generateFindCommnand(a);this._generateBlame(a);this.isReadOnly||this._generateEditCommands(a)},_generateSettingsCommand:function(b){var c=this,e=new a.Command({imageClass:"core-sprite-wrench",tooltip:j.LocalEditorSettings,id:"orion.edit.settings",visibleWhen:function(){return!!b.getTextView()},callback:function(a){var g=e.settingsDropDown;if(!g||g.isDestroyed())g=e.settingsDropDown=
new d(a.domParent,a.domNode,{noClick:!0,selectionClass:"dropdownSelection",onShow:function(){g.focus()},onHide:function(){b.focus()}}),g.updateContent=c.localSettings.show.bind(c.localSettings),g.getContentNode().tabIndex=0;g.click()}});this.commandService.addCommand(e);this.commandService.registerCommandContribution("settingsActions","orion.edit.settings",1,null,!1,new i.KeyBinding("s",!0,!0))},_generateUndoStackCommands:function(b){this.commandService.addCommand(new a.Command({name:j.Undo,id:"orion.undo",
visibleWhen:function(){return!!b.getTextView()},callback:function(){b.getTextView().invokeAction("undo")}}));this.commandService.registerCommandContribution(this.toolbarId,"orion.undo",400,null,!0,b.getTextView().getKeyBindings("undo")[0]);this.commandService.addCommand(new a.Command({name:j.Redo,id:"orion.redo",visibleWhen:function(){return!!b.getTextView()},callback:function(){b.getTextView().invokeAction("redo")}}));this.commandService.registerCommandContribution(this.toolbarId,"orion.redo",401,
null,!0,b.getTextView().getKeyBindings("redo")[0])},_generateSearchFilesCommand:function(b){var c=this;if(c._searcher){var d=!1,g=new a.Command({name:j.searchFiles,tooltip:j.searchFiles,id:"orion.searchFiles",visibleWhen:function(){return!!b.getTextView()},callback:function(){b.getTextView().invokeAction("searchFiles")}});this.commandService.addCommand(g);this.commandService.registerCommandContribution(this.pageNavId,"orion.searchFiles",1,null,!0,new i.KeyBinding("h",!0));b.getTextView().setKeyBinding(new i.KeyBinding("h",
!0),"searchFiles");b.getTextView().setAction("searchFiles",function(){if(!d){var a=b.getSelection(),a=b.getText(a.start,a.end),g=c.serviceRegistry.getService("orion.page.progress"),f=new e.OpenResourceDialog({searcher:c._searcher,progress:g,searchRenderer:c._searcher.defaultRenderer,nameSearch:!1,title:j.searchFiles,message:j.searchTerm,initialText:a,onHide:function(){d=!1;b.focus()}});window.setTimeout(function(){d=!0;f.show(h.node(c.toolbarId))},0);return!0}},g)}},_generateSaveCommand:function(b){var c=
this;b.getTextView().setKeyBinding(new i.KeyBinding("s",!0),"save");b.getTextView().setAction("save",function(){if(c.inputManager.save)c.inputManager.save();else if(c.inputManager.onSave){var a=b.getText();c.inputManager.onSave(c.inputManager.getInput(),a,function(){b.setInput(c.inputManager.getInput(),null,a,!0);c.inputManager.afterSave&&c.inputManager.afterSave()},function(a){a.log=!0})}return!0},{name:j.Save});this.commandService.addCommand(new a.Command({name:j.Save,tooltip:j.saveFile,id:"orion.save",
visibleWhen:function(){return!b.getTextView()||c.inputManager.getReadOnly()?!1:!c.editorSettings||!c.editorSettings().autoSave},callback:function(){b.getTextView().invokeAction("save")}}));this.commandService.registerCommandContribution(this.toolbarId,"orion.save",1,null,!1,new i.KeyBinding("s",!0))},_generateGotoLineCommnand:function(b){var c=this,d=new g.ParametersDescription([new g.CommandParameter("line","number","Line:")],{hasOptionalParameters:!1},function(){var a=b.getModel().getLineAtOffset(b.getCaretOffset())+
1;return[new g.CommandParameter("line","number","Line:",a.toString())]}),d=new a.Command({name:j.gotoLine,tooltip:j.gotoLineTooltip,id:"orion.gotoLine",visibleWhen:function(){return!!b.getTextView()},parameters:d,callback:function(a){var c=b.getModel();a.parameters&&a.parameters.valueFor("line")?a=a.parameters.valueFor("line"):(a=c.getLineAtOffset(b.getCaretOffset()),(a=prompt(j.gotoLinePrompt,a+1))&&(a=parseInt(a,10)));if(a)b.onGotoLine(a-1,0)}});this.commandService.addCommand(d);this.commandService.registerCommandContribution(this.pageNavId,
"orion.gotoLine",1,null,!0,new i.KeyBinding("l",!s.isMac,!1,!1,s.isMac),new g.URLBinding("gotoLine","line"));b.getTextView().setAction("gotoLine",function(a){if(a)return b.onGotoLine(a.line-1,0,void 0,a.callback),!0;c.commandService.runCommand("orion.gotoLine");return!0},d)},_generateFindCommnand:function(b){var c=this,d=new g.ParametersDescription([new g.CommandParameter("find","text","Find:")],{clientCollect:!0},function(){var a=b.getSelection(),d="";a.end>a.start&&(d=b.getModel().getText(a.start,
a.end),c._localSearcher&&c._localSearcher.getOptions().regex&&(d=r.escape(d)));return[new g.CommandParameter("find","text","Find:",d)]}),d=new a.Command({name:j.Find,tooltip:j.Find,id:"orion.editor.find",visibleWhen:function(){return!!b.getTextView()},parameters:d,callback:function(a){if(c._localSearcher){var d="",e=null,g=b.getSelection();g.end>g.start&&a.parameters.valueFor("useEditorSelection")?(d=b.getModel().getText(g.start,g.end),c._localSearcher.getOptions().regex&&(d=r.escape(d))):a.parameters&&
a.parameters.valueFor("find")&&(d=a.parameters.valueFor("find"),e=m.matchResourceParameters(),n.convertFindURLBinding(e));if(e){c._localSearcher.setOptions({regex:e.regEx,caseInsensitive:!e.caseSensitive});a={};if(e.atLine)a.start=b.getModel().getLineStart(e.atLine-1);c._localSearcher.show({findString:d,replaceString:e.replaceWith});c._localSearcher.find(!0,a)}else c._localSearcher.show({findString:d});return!0}return!1}});this.commandService.addCommand(d);this.commandService.registerCommandContribution(this.pageNavId,
"orion.editor.find",2,null,!0,new i.KeyBinding("f",!0),new g.URLBinding("find","find"));b.getTextView().setAction("find",function(a){if(a)return c._localSearcher.show(a),!0;c.commandService.runCommand("orion.editor.find",null,null,new g.ParametersDescription([new g.CommandParameter("useEditorSelection","text","","true")],{clientCollect:!0}));return!0},d)},_generateBlame:function(b){var c=this,d=new a.Command({name:j.Blame,tooltip:j.BlameTooltip,id:"orion.edit.blame",parameters:new g.ParametersDescription([new g.CommandParameter("blame",
"boolean")],{clientCollect:!0}),visibleWhen:function(){return!b.getTextView()?!1:c.editorSettings&&!c.editorSettings().showBlame?!1:t.isVisible(c.serviceRegistry,c.inputManager)},callback:function(a){d.visible=!d.visible;if(a.parameters&&a.parameters.valueFor("blame"))d.visible=a.parameters.valueFor("blame")==="true";d.visible?t.getBlame(c.serviceRegistry,c.inputManager):b.showBlame([])}});this.commandService.addCommand(d);this.commandService.registerCommandContribution(this.toolbarId,"orion.edit.blame",
1,null,!1,new i.KeyBinding("b",!0,!0),new g.URLBinding("blame","blame"))},_generateEditCommands:function(c){function d(a){var b=new i.KeyBinding;i.KeyBinding.apply(b,a);return b}function e(a,b){!b&&a&&typeof a.HTML!=="undefined"&&delete a.HTML;var c=g.serviceRegistry.getService("orion.page.message");c?c.setProgressResult(a):window.console.log(a)}var g=this,m=this.serviceRegistry,n=m.getServiceReferences("orion.edit.command"),o=this.inputManager,p=m.getService("orion.page.progress"),r=function(b,d,
f){var h=f.visibleWhen;f.visibleWhen=function(a){return!c.getTextView()||g.inputManager.getReadOnly()?!1:!h||h(a)};f.callback=function(){c=this;var a=c.getSelection(),g=c.getModel(),f=function(b){typeof b==="object"&&b?(b.text&&c.setText(b.text),b.selection&&(c.setSelection(b.selection.start,b.selection.end,!0),c.focus())):typeof b==="string"&&(c.setText(b,a.start,a.end,!0),c.setSelection(a.start,a.start+b.length),c.focus())},h;d.execute?(g={contentType:o.getContentType(),input:o.getInput()},h=v.getEditorContext(m),
h.openDelegatedUI=w,h.setStatus=e,g=d.execute(h,g),h=null):(g=d.run(g.getText(a.start,a.end),g.getText(),a,o.getInput()),h=function(a){if(a&&a.uriTemplate){var c={};c.uriTemplate=a.uriTemplate;c.params=o.getFileMetadata();c.id=b.id;c.width=a.width;c.height=a.height;c.done=f;c.status=e;w(c)}else a.Status||a.status?e(a.Status||a.status):f(a)});p.showWhile(g,k.formatMessage(j.running,b.name)).then(h);return!0};f.callback=f.callback.bind(c);return new a.Command(f)};f.when(function(a){if(q)return q;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 q=a})}(this.serviceRegistry),function(){var a=[],e=100;n.forEach(function(f){for(var h=g.serviceRegistry.getService(f),i={},j=f.getPropertyKeys(),k=0;k<j.length;k++)i[j[k]]=f.getProperty(j[k]);i.forceSingleItem=!0;f=b._createCommandOptions(i,f,g.serviceRegistry,q,!1,function(){return o.getFileMetadata()});a.push(f);f.then(function(a){a=
r(i,h,a);g.commandService.addCommand(a);g.commandService.registerCommandContribution(g.toolbarId,a.id,e);if(i.key){var b=c.getTextView();b.setKeyBinding(d(i.key),a.id);b.setAction(a.id,a.callback,a)}});e++});f.all(a,function(a){return{_error:a}}).then(function(){var a;if(a=o.getFileMetadata()){var b=h.node("pageActions");b&&(g.commandService.destroy(b),g.commandService.renderCommands(b.id,b,a,c,"button"));if(b=h.node("pageNavigationActions"))g.commandService.destroy(b),g.commandService.renderCommands(b.id,
b,c,c,"button")}})})}};p.EditorCommandFactory=u;return p});
define("orion/inputManager","i18n!orion/edit/nls/messages,orion/i18nUtil,orion/Deferred,orion/EventTarget,orion/objects,orion/PageUtil".split(","),function(j,k,h,e,d,f){function c(a){this._document=a.document||document;this._timeout=a.timeout;for(var a="keypress,keydown,keyup,mousemove,mousedown,mousemove".split(","),b=function(){this._resetTimer()}.bind(this),c=0;c<a.length;c++)this._document.addEventListener(a[c],b,!0);e.attach(this)}function a(a,b){if(a){if(b.status===0)b={Severity:"Error",Message:j.noResponse};
else{var c=b.responseText;if(c)try{b=JSON.parse(c)}catch(d){b={Severity:"Error",Message:c}}}a.setProgressResult(b)}else window.console.log(b)}function i(a){e.attach(this);this.editor=a.editor;this.serviceRegistry=a.serviceRegistry;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=[]}c.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()}};d.mixin(i.prototype,{_maybeLoadWorkspace:function(a){var b=this.fileClient;return a===b.fileServiceRootURL(a)?b.loadWorkspace(a).then(function(a){return a.Location}):
(new h).resolve(a)},_read:function(a){var b=this.fileClient,c=Array.prototype.slice.call(arguments,1);return this._maybeLoadWorkspace(a).then(function(a){return b.read.apply(b,[a].concat(c))})},load:function(){var c=this.getInput();if(c){var b=this.fileClient,d=this._parsedLocation.resource,e=this.progressService,f=function(a,b,c){return!e?a:e.progress(a,k.formatMessage(b,c))},h=this.getEditor();if(this._fileMetadata)!this._saving&&!this._fileMetadata.Directory&&!this._readonly&&f(b.read(d,!0),j.ReadingMetadata,
c).then(function(a){if(this._fileMetadata&&this._fileMetadata.Location===a.Location&&this._fileMetadata.ETag!==a.ETag)this._fileMetadata=a,(!h.isDirty()||window.confirm(j.loadOutOfSync))&&f(b.read(d),j.Reading,c).then(function(a){h.setInput(c,null,a);this._unsavedChanges=[]}.bind(this))}.bind(this));else{var i=d;if(i.indexOf("/gitapi/commit/")===0){var r=i.indexOf("/file"),s=i.indexOf("?",r);if(s===-1)s=i.length;i=i.substring(r,s);this._readonly=!0}var v=window.setTimeout(function(){v=null;h.reportStatus(k.formatMessage(j.Fetching,
c))},800),w=function(){h.reportStatus("");v&&window.clearTimeout(v)},u=function(b){w();var c=this.serviceRegistry.getService("orion.page.message");a(c,b);this._setNoInput()}.bind(this);this._acceptPatch=null;f(this._read(i,!0),j.ReadingMetadata,i).then(function(a){a.Directory?f(b.fetchChildren(a.ChildrenLocation),j.Reading,c).then(function(b){w();a.Children=b;this._setInputContents(this._parsedLocation,c,b,a)}.bind(this),u):f(b.read(d,!1,!0),j.Reading,c).then(function(b){w();if(typeof b!=="string")this._acceptPatch=
b.acceptPatch,b=b.result;this._setInputContents(this._parsedLocation,c,b,a)}.bind(this),u)}.bind(this),u)}}},processParameters:function(a){var b=this.getEditor();b.processParameters&&b.processParameters(a)},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},
save:function(){function c(a){if(f===q.getInput())q.getFileMetadata().ETag=a.ETag,d.setInput(f,null,h,!0);d.reportStatus("");e&&p.setProgressResult({Message:j.Saved,Severity:"Normal"});q.afterSave&&q.afterSave();q._saving=!1}function b(b){d.reportStatus("");a(p,b);q._saving=!1;q._errorSaving=!0}if(!this._saving){var d=this.getEditor();if(d.isDirty()&&!this.getReadOnly()){var e=this._errorSaving;this._saving=!0;var f=this.getInput();d.reportStatus(j["Saving..."]);this.dispatchEvent({type:"Saving",
inputManager:this});d.markClean();var h=d.getText(),i=h;if(this._getSaveDiffsEnabled()&&!this._errorSaving){for(var r=this._unsavedChanges,s=0,v=0;v<r.length;v++)s+=r[v].text.length;h.length>s&&(i={diff:r})}this._unsavedChanges=[];this._errorSaving=!1;var r={ETag:this.getFileMetadata().ETag},w=this._parsedLocation.resource,i=this.fileClient.write(w,i,r),u=this.progressService,p=this.serviceRegistry.getService("orion.page.message");u&&(i=u.progress(i,k.formatMessage(j.savingFile,f)));var q=this;i.then(c,
function(a){a.status===412?window.confirm(j.saveOutOfSync)?(a=q.fileClient.write(w,h),u&&(a=u.progress(a,k.formatMessage(j.savingFile,f))),a.then(c,b)):q._saving=!1:b(a)})}}},setAutoLoadEnabled:function(a){this._autoLoadEnabled=a},setAutoSaveTimeout:function(a){this._autoSaveEnabled=a!==-1;this._idle?this._idle.setTimeout(a):(this._idle=new c({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=f.hash()),typeof a==="string")){var b=this.getEditor();a&&a[0]!=="#"&&(a="#"+a);var c=f.matchResourceParameters(a);if(b.isDirty()&&(b=this._location,f.matchResourceParameters(b).resource!==c.resource))if(this._autoSaveEnabled)this.save();else if(!window.confirm(j.confirmUnsavedChanges)){window.location.hash=b;return}this._location=a;this._parsedLocation=c;this._ignoreInput=!0;this.selection.setSelections(a);this._ignoreInput=!1;(a=c.resource)?
a===this._input?this.processParameters(c):(this._input=a,this._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},_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=null,this.setContentType(null),this.editor.uninstall(),this.dispatchEvent({type:"InputChanged",input:null}))},_setInputContents:function(a,b,c,d){var e,f=!1;d?(this._fileMetadata=d,this.setTitle(d.Location||String(d)),this.setContentType(this.contentTypeRegistry.getFileContentType(d)),e=d.Name,f=d.Directory):(this._fileMetadata=null,this.setTitle(b),this.setContentType(this.contentTypeRegistry.getFilenameContentType(this.getTitle())),
e=this.getTitle());var h=this.getEditor();f?h.uninstall():h.getTextView()||(h.install(),h.getTextView().addEventListener("Focus",function(){this._autoSaveEnabled&&this._errorSaving?this.save():this._autoLoadEnabled&&this.load()}.bind(this)),h.getModel().addEventListener("Changing",function(a){if(this._getSaveDiffsEnabled()){var b=this._unsavedChanges.length,c=a.removedCharCount,d=a.start,e=a.start+c,f=0;a.addedCharCount===0?f=-1:c===0&&(f=1);if(b>0&&f===this.previousChangeType){b=this._unsavedChanges[b-
1];if(c===0&&d===b.end+b.text.length){b.text+=a.text;return}if(a.addedCharCount===0&&e===b.start){b.start=d;return}}this.previousChangeType=f;this._unsavedChanges.push({start:d,end:e,text:a.text})}}.bind(this)));this.dispatchEvent({type:"InputChanged",input:a,name:e,title:b,contentType:this.getContentType(),metadata:d,location:window.location,contents:c});if(!f)h.setInput(b,null,c),this._unsavedChanges=[],this.processParameters(a)}});return{InputManager:i}});
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,h,e,d,f,c,a,i,g,b,l,n,m,o,t,r){function s(b){this._syntaxHighlither=
new a.SyntaxHighlighter(b)}k={};k.DefaultDiffProvider=function(){function a(b){this.serviceRegistry=b;this._diffProvider=new f.DiffProvider(b)}a.prototype={_resolveTwoFiles:function(a,b){var c=this;return h.all([c._getContentType(a),c._getContentType(b)],function(a){return{_error:a}}).then(function(d){if(Array.isArray(d)&&d.length===2&&d[0]&&d[1]){var e=d[0],d=d[1];return(new h).resolve({oldFile:{URL:a,Name:c._resolveFileName(a),Type:e},newFile:{URL:b,Name:c._resolveFileName(b),Type:d},diffContent:c._diffContent})}else return e=
a?c._resolveFileName(a):"",d=b?c._resolveFileName(b):"",(new h).resolve({oldFile:{URL:a,Name:e,Type:null},newFile:{URL:b,Name:d,Type:null},diffContent:c._diffContent})})},_resolveFileName:function(a){return a.split("?")[0]},_getContentType:function(a){a=this._resolveFileName(a);return this.serviceRegistry.getService("orion.core.contentTypeRegistry").getFilenameContentType(a)},_resolveComplexFileURL:function(a){var b=this;return this._diffProvider.getDiffFileURI(a).then(function(a){return b._resolveTwoFiles(a.Old,
a.New)},function(){})},resolveDiff:function(a,b,c){this._hasConflicts=c;if(b)return this._resolveTwoFiles(b,a);else if(this._diffProvider){var d=this;return d._diffProvider.getDiffContent(a).then(function(b){d._diffContent=d._hasConflicts?b.split("diff --git")[1]:b;return d._resolveComplexFileURL(a)},function(){})}else console.log("A diff provider is needed for compound diff URL")}};return a}();s.prototype={highlight:function(a,b,c){return this._syntaxHighlither.setup(b,c.getTextView(),null,a,!1)}};
k.ResourceComparer=function(){function a(b,d,f,h){this._registry=b;this._commandService=d;this._fileClient=new i.FileClient(b);this._fileClient=new i.FileClient(b);this._searchService=this._registry.getService("orion.core.search");this._progress=this._registry.getService("orion.page.progress");this.setOptions(f,!0);this._compareView=f.toggleable?new c.toggleableCompareView(f.type==="inline"?"inline":"twoWay",h):f.type==="inline"?new c.inlineCompareView(h):new c.TwoWayCompareView(h);this._compareView.getWidget().setOptions({extCmdHolder:this});
h.highlighters||this._compareView.getWidget().setOptions({highlighters:[new s(b),new s(b)]});h.oldFile||this._compareView.getWidget().setOptions({oldFile:{readonly:!0}});h.newFile||this._compareView.getWidget().setOptions({newFile:{readonly:f.readonly}});this.initExtCmds();var k=this;this._inputManager=new t.InputManager({serviceRegistry:b,fileClient:k._fileClient,progressService:k._progress});o.mixin(this._inputManager,{filePath:"",getInput:function(){return this.filePath},setDirty:function(a){g.setDirtyIndicator(a)},
getFileMetadata:function(){return this._fileMetadata},getEditor:function(){return k._compareView.getWidget().getEditors()[1]},setInput:function(a){this._parsedLocation={resource:a};k._progress.progress(k._fileClient.read(a,!0),"Getting file metadata "+a).then(function(a){this._fileMetadata=a;if(k.options.savable){var b=e.node("pageActions");b&&(k._commandService.destroy(b),k._commandService.renderCommands(b.id,b,k._compareView.getWidget().getEditors()[1],k._compareView.getWidget().getEditors()[1],
"button"))}a&&this.setTitle(a.Location,a)}.bind(this),function(b){console.error("Error loading file metadata: "+b.message);this.setTitle(a)}.bind(this));this.lastFilePath=a},setTitle:function(a,c){var d;if(c)d=c.Name;g.setPageTarget({task:j.Compare,name:d,target:c,serviceRegistry:b,commandService:k._commandService,searchService:k._searchService,fileService:k._fileClient});a.charAt(0)==="*"?(g.setDirtyIndicator(!0),a.substring(1)):g.setDirtyIndicator(!1)},afterSave:function(){var a=k._compareView.getWidget().getEditors()[1].getTextView().getText();
k._compareView.getWidget().options.newFile.Content=a;k._compareView.getWidget().refresh()}});if(!f.readonly&&!f.toggleable&&this._compareView.getWidget().type==="twoWay")this._compareView.getWidget().options.newFile.keyBindingFactory=function(a,b,c,d){b=new n.TextSearcher(a,k._commandService,c);c=(new r.KeyBindingsFactory).createKeyBindings(a,c,d,b);(new m.EditorCommandFactory(k._registry,k._commandService,k._fileClient,k._inputManager,"pageActions",!1,"pageNavigationActions",b)).generateEditorCommands(a);
return c};this._compareView.getWidget().initEditors(j["fetching..."]);if(!f.readonly&&!f.toggleable&&this._compareView.getWidget().type==="twoWay"){var l=this._compareView.getWidget().getEditors();l[1].addEventListener("DirtyChanged",function(){this._inputManager.setDirty(l[1].isDirty())}.bind(this))}}a.prototype={_clearOptions:function(){this.options={}},setOptions:function(a,b){b&&this._clearOptions();if(!this.options)this.options={};a&&Object.keys(a).forEach(function(b){this.options[b]=a[b]}.bind(this))},
generateLink:function(a){a=a.getCurrentDiffPos();a=d.generateCompareHref(this.options.resource,{compareTo:this.options.compareTo,readonly:this.options.readonly,conflict:this.options.hasConflicts,block:a.block?a.block:1,change:a.change?a.change:0});a=(new URL(a,window.location.href)).href;prompt(j["Copy the link URL:"],a)},openComparePage:function(a){a=a.getCurrentDiffPos();return d.generateCompareHref(this.options.resource,{compareTo:this.options.compareTo,readonly:!this.options.editableInComparePage,
conflict:this.options.hasConflicts,block:a.block?a.block:1,change:a.change?a.change:0})},initExtCmds:function(){var 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)}}),d=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(d);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 h.all(b,function(a){return{_error:a}})},_loadSingleFile:function(a){return this._registry.getService("orion.page.progress").progress(this._fileClient.read(a.URL),"Getting contents of "+a.URL).then(function(b){a.Content=b;return a}.bind(this),
function(b){if(b.status===404)a.Content="";return a}.bind(this))},start:function(){if(this.options.resource)if(this.options.diffProvider){var a=this;return a.options.diffProvider.resolveDiff(a.options.resource,a.options.compareTo,a.options.hasConflicts).then(function(b){a._compareView.getWidget().setOptions(b);var c=a._compareView.getWidget().options;c.oldFile.readonly=!0;if(a.options.readonly)c.newFile.readonly=!0;return a._getFilesContents(c.diffContent?[c.oldFile]:[c.oldFile,c.newFile]).then(function(){var b=
a._compareView.getWidget().refresh(!0);if(!a.options.readonly&&!a.options.toggleable&&a._compareView.getWidget().type==="twoWay")this._inputManager.filePath=a._compareView.getWidget().options.newFile.URL,a._inputManager.setInput(c.newFile.URL,a._compareView.getWidget().getEditors()[1]);return(new h).resolve(b)}.bind(a))})}else console.log("A diff provider is needed for Complex diff URL")}};return a}();return k});
define("orion/widgets/themes/editor/ThemeData",["i18n!orion/settings/nls/messages","orion/editor/textTheme"],function(j,k){function h(){}function e(){this.styles=[];var a=new h;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=f;a.fontSize=
c;this.styles.push(a);a=new h;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=f;a.fontSize=c;this.styles.push(a);a=new h;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=f;a.fontSize=c;this.styles.push(a);a=new h;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=f;a.fontSize=c;this.styles.push(a);a=new h;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=f;
a.fontSize=c;this.styles.push(a);a=new h;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=f;a.fontSize=c;this.styles.push(a);a=new h;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=f;a.fontSize=c;this.styles.push(a);a=new h;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=f;a.fontSize=c;this.styles.push(a)}function d(){return this.styles}var f='"Consolas", "Monaco", "Vera Mono", "monospace"',c="10pt";e.prototype.styles=[];e.prototype.getStyles=d;e.prototype.fontSettable=!0;e.prototype.getThemeStorageInfo=function(){return{storage:"/themes",styleset:"editorstyles",defaultTheme:"Prospecto",selectedKey:"editorSelected"}};e.prototype.parseToXML=function(a){try{var c=null;
if(window.DOMParser){var c=(new DOMParser).parseFromString(a,"text/xml"),d=c.getElementsByTagName("parsererror");return!d||!d.length||!d[0].childNodes.length?c:null}else return c=new ActiveXObject("Microsoft.XMLDOM"),c.async=!1,c.loadXML(a),c}catch(b){}};e.prototype.selectFontSize=function(a){console.log("fontsize: "+a)};e.prototype.importTheme=function(a){console.log("import theme");console.log(a);var c=this.parseToXML(a.parameters.valueFor("name")),d=new h;d.name=c.getElementsByTagName("colorTheme")[0].attributes[1].value;
d.annotationRuler=c.getElementsByTagName("background")[0].attributes[0].value;d.background=c.getElementsByTagName("background")[0].attributes[0].value;d.comment=c.getElementsByTagName("singleLineComment")[0].attributes[0].value;d.keyword=c.getElementsByTagName("keyword")[0].attributes[0].value;d.text=c.getElementsByTagName("foreground")[0].attributes[0].value;d.string=c.getElementsByTagName("string")[0].attributes[0].value;d.overviewRuler=c.getElementsByTagName("background")[0].attributes[0].value;
d.lineNumberOdd=c.getElementsByTagName("lineNumber")[0].attributes[0].value;d.lineNumberEven=c.getElementsByTagName("lineNumber")[0].attributes[0].value;d.lineNumber=c.getElementsByTagName("lineNumber")[0].attributes[0].value;d.currentLine=c.getElementsByTagName("selectionBackground")[0].attributes[0].value;a.items.addTheme(d)};e.prototype.processSettings=function(a){var c=k.TextTheme.getTheme();c.setThemeClass("editorTheme",c.buildStyleSheet("editorTheme",a))};e.prototype.getViewData=function(){var a=
{top:10,left:10,width:400,height:350},c=a.left,d=a.top;a.shapes=[{type:"TEXT",name:j["Line Numbers"],label:"1",x:c+20,y:d+20,fill:"darkSlateGray",family:"lineNumber",font:"9pt sans-serif"},{type:"RECTANGLE",name:j.Background,x:c+46,y:d,width:290,height:a.height,family:"background",fill:"white"},{type:"TEXT",name:j.Strings,label:"'text/javascript'",x:c+134,y:d+20,fill:"darkorange",family:"string",font:"9pt sans-serif"},{type:"TEXT",name:j.Foreground,label:"=",x:c+124,y:d+20,fill:"darkSlateGray",family:"text",
font:"9pt sans-serif"},{type:"RECTANGLE",name:j["Current Line"],x:c+46,y:d+87,width:290,height:18,family:"currentLine",fill:"#eaf2fd"},{type:"TEXT",name:j["HTML Attribute"],label:"type",x:c+98,y:d+20,fill:"darkGray",family:"attribute",font:"9pt sans-serif"},{type:"RECTANGLE",name:j["Overview Ruler"],x:c+336,y:d,width:14,height:a.height,family:"overviewRuler",fill:"white"},{type:"TEXT",name:j.Comments,label:"/* comment */",x:c+75,y:d+40,fill:"darkSeaGreen",family:"comment",font:"9pt sans-serif"},{type:"TEXT",
name:j["HTML Tag"],label:"<script",x:c+55,y:d+20,fill:"darkorange",family:"keyword",font:"9pt sans-serif"},{type:"TEXT",name:j["HTML Tag"],label:">",x:c+213,y:d+20,fill:"darkorange",family:"keyword",font:"9pt sans-serif"},{type:"TEXT",name:j.Strings,label:"'Result'",x:c+164,y:d+80,fill:"cornflowerBlue",family:"string",font:"9pt sans-serif"},{type:"TEXT",name:j.Foreground,label:"multiply(a,b){",x:c+120,y:d+60,fill:"darkSlateGray",family:"text",font:"9pt sans-serif"},{type:"TEXT",name:j.Keywords,label:"function",
x:c+75,y:d+60,fill:"darkorange",family:"keyword",font:"9pt sans-serif"},{type:"TEXT",name:j.Keywords,label:"var",x:c+95,y:d+80,fill:"darkorange",family:"keyword",font:"9pt sans-serif"},{type:"TEXT",name:j.Foreground,label:"output = ",x:c+115,y:d+80,fill:"darkSlateGray",family:"text",font:"9pt sans-serif"},{type:"TEXT",name:j.Foreground,label:";",x:c+205,y:d+80,fill:"darkSlateGray",family:"text",font:"9pt sans-serif"},{type:"TEXT",name:j.Keywords,label:"var",x:c+95,y:d+100,fill:"darkorange",family:"keyword",
font:"9pt sans-serif"},{type:"TEXT",name:j.Foreground,label:"result = a*b;",x:c+115,y:d+100,fill:"darkSlateGray",family:"text",font:"9pt sans-serif"},{type:"TEXT",name:j.Keywords,label:"return",x:c+95,y:d+120,fill:"darkorange",family:"keyword",font:"9pt sans-serif"},{type:"TEXT",name:j.Foreground,label:"output + result;",x:c+135,y:d+120,fill:"darkSlateGray",family:"text",font:"9pt sans-serif"},{type:"TEXT",name:j.Foreground,label:"}",x:c+75,y:d+140,fill:"darkSlateGray",family:"text",font:"9pt sans-serif"},
{type:"TEXT",name:j["HTML Tag"],label:"<\/script>",x:c+55,y:d+160,fill:"darkorange",family:"keyword",font:"9pt sans-serif"},{type:"TEXT",name:j["HTML Tag"],label:"<style",x:c+55,y:d+200,fill:"darkorange",family:"keyword",font:"9pt sans-serif"},{type:"TEXT",name:j["HTML Attribute"],label:"type",x:c+95,y:d+200,fill:"darkGray",family:"attribute",font:"9pt sans-serif"},{type:"TEXT",name:j.Foreground,label:"=",x:c+121,y:d+200,fill:"darkSlateGray",family:"text",font:"9pt sans-serif"},{type:"TEXT",name:j.Strings,
label:"'text/css'",x:c+131,y:d+200,fill:"darkorange",family:"string",font:"9pt sans-serif"},{type:"TEXT",name:j["HTML Tag"],label:">",x:c+180,y:d+200,fill:"darkorange",family:"keyword",font:"9pt sans-serif"},{type:"TEXT",name:j["CSS Class Name"],label:".some-class",x:c+75,y:d+220,fill:"darkorange",family:"keyword",font:"9pt sans-serif"},{type:"TEXT",name:j["CSS Class Name"],label:"{",x:c+145,y:d+220,fill:"darkSlateGray",family:"text",font:"9pt sans-serif"},{type:"TEXT",name:j["CSS Attribute"],label:"color:",
x:c+95,y:d+240,fill:"darkSlateGray",family:"text",font:"9pt sans-serif"},{type:"TEXT",name:j["CSS Value"],label:"#123456",x:c+130,y:d+240,fill:"darkSlateGray",family:"string",font:"9pt sans-serif"},{type:"TEXT",name:j["CSS Text"],label:";",x:c+180,y:d+240,fill:"darkSlateGray",family:"text",font:"9pt sans-serif"},{type:"TEXT",name:j["CSS Class Name"],label:"}",x:c+75,y:d+260,fill:"darkSlateGray",family:"text",font:"9pt sans-serif"},{type:"TEXT",name:j["HTML Tag"],label:"</style>",x:c+55,y:d+280,fill:"darkorange",
family:"keyword",font:"9pt sans-serif"},{type:"RECTANGLE",name:j["Annotation Ruler"],x:c,y:d,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:c+20,y:d+20*b+20,fill:"darkSlateGray",family:"lineNumber",font:"9pt sans-serif"});return a};return{ThemeData:e,getStyles:d}});
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,h,e,d,f,c,a,i,g,b,l,n,m,o,t,r){k.startup().then(function(j){var k=
j.serviceRegistry,j=j.preferences,m=new f.CommandRegistry({}),u=new c.FileClient(k);new o.ContentTypeRegistry(k);var u=new a.Searcher({serviceRegistry:k,commandService:m,fileService:u}),p=new d.OperationsClient(k);new h.StatusReportingService(k,p,"statusPane","notifications","notificationArea");new e.ProgressService(k,p,m);(new l.ThemePreferences(j,new n.ThemeData)).apply();i.generateBanner("orion-compare",k,m,j,u);i.setPageTarget({task:r.Compare,serviceRegistry:k,commandService:m});var q=new b.DefaultDiffProvider(k),
x=new g.CompareCommandFactory({commandService:m,commandSpanId:"pageNavigationActions"}),A=function(){var a=t.matchResourceParameters();(new b.ResourceComparer(k,m,{readonly:a.readonly==="true",generateLink:!0,savable:!a.readonly,hasConflicts:a.conflict==="true",diffProvider:q,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()};
A();window.addEventListener("hashchange",function(){A()},!1)})});