/**
 * @license RequireJS i18n 1.0.0 Copyright (c) 2010-2011, The Dojo Foundation All Rights Reserved.
 * Available via the MIT or new BSD license.
 * see: http://github.com/jrburke/requirejs for details
 */
/*******************************************************************************
 * @license
 * Copyright (c) 2012 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials are made 
 * available under the terms of the Eclipse Public License v1.0 
 * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 
 * 
 * Contributors: IBM Corporation - initial API and implementation
 ******************************************************************************/
/*******************************************************************************
 * @license
 * Copyright (c) 2012 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials are made 
 * available under the terms of the Eclipse Public License v1.0 
 * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 
 * 
 ******************************************************************************/
/*******************************************************************************
 * @license
 * Copyright (c) 2012 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials are made 
 * available under the terms of the Eclipse Public License v1.0 
 * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 
 * 
 ******************************************************************************/
/*******************************************************************************
 * @license
 * Copyright (c) 2012 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials are made 
 * available under the terms of the Eclipse Public License v1.0 
 * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 
 * 
 * Contributors: IBM Corporation - initial API and implementation
 ******************************************************************************/
/*******************************************************************************
 * @license
 * Copyright (c) 2012 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials are made 
 * available under the terms of the Eclipse Public License v1.0 
 * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 
 *
 * Contributors:
 *     IBM Corporation - initial API and implementation
 *******************************************************************************/
/*******************************************************************************
 * @license
 * Copyright (c) 2011, 2012 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials are made 
 * available under the terms of the Eclipse Public License v1.0 
 * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 
 *
 * Contributors:
 *     IBM Corporation - initial API and implementation
 *******************************************************************************/
/*******************************************************************************
 * @license
 * Copyright (c) 2012 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials are made 
 * available under the terms of the Eclipse Public License v1.0 
 * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 
 *
 * Contributors:
 *     IBM Corporation - initial API and implementation
 *******************************************************************************/
/*******************************************************************************
 * @license
 * Copyright (c) 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: IBM Corporation - initial API and implementation
 ******************************************************************************/
/*******************************************************************************
 * @license
 * Copyright (c) 2012 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials are made 
 * available under the terms of the Eclipse Public License v1.0 
 * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 
 * 
 * Contributors: IBM Corporation - initial API and implementation
 ******************************************************************************/
/*******************************************************************************
 * @license
 * Copyright (c) 2011, 2012 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials are made 
 * available under the terms of the Eclipse Public License v1.0 
 * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 
 *
 * Contributors:
 *     IBM Corporation - initial API and implementation
 *******************************************************************************/
/*******************************************************************************
 * @license
 * Copyright (c) 2012 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials are made 
 * available under the terms of the Eclipse Public License v1.0 
 * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 
 * 
 * Contributors: IBM Corporation - initial API and implementation
 ******************************************************************************/
/*******************************************************************************
 * @license
 * Copyright (c) 2012 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials are made 
 * available under the terms of the Eclipse Public License v1.0 
 * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 
 * 
 ******************************************************************************/
/*******************************************************************************
 * @license
 * Copyright (c) 2012 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials are made 
 * available under the terms of the Eclipse Public License v1.0 
 * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 
 * 
 ******************************************************************************/
/*******************************************************************************
 * @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
 * Copyright (c) 2012 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials are made 
 * available under the terms of the Eclipse Public License v1.0 
 * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 
 * 
 ******************************************************************************/
/*******************************************************************************
 * @license
 * Copyright (c) 2012 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials are made 
 * available under the terms of the Eclipse Public License v1.0 
 * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 
 * 
 ******************************************************************************/
/*******************************************************************************
 * @license
 * Copyright (c) 2012 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials are made 
 * available under the terms of the Eclipse Public License v1.0 
 * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 
 *
 * Contributors:
 *     IBM Corporation - initial API and implementation
 *******************************************************************************/
/*******************************************************************************
 * @license
 * Copyright (c) 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) 2012 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials are made 
 * available under the terms of the Eclipse Public License v1.0 
 * (http://www.eclipse.org/legal/epl-v10.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) 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, 2012 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials are made 
 * available under the terms of the Eclipse Public License v1.0 
 * (http://www.eclipse.org/legal/epl-v10.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) 2012 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials are made 
 * available under the terms of the Eclipse Public License v1.0 
 * (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) 2010, 2012 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials are made 
 * available under the terms of the Eclipse Public License v1.0 
 * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 
 * 
 * Contributors: IBM Corporation - initial API and implementation
 ******************************************************************************/
/*******************************************************************************
 * @license
 * Copyright (c) 2011, 2012 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials are made 
 * available under the terms of the Eclipse Public License v1.0 
 * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 
 *
 * Contributors:
 *     IBM Corporation - initial API and implementation
 *******************************************************************************/
/*******************************************************************************
 * @license
 * Copyright (c) 2012 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials are made 
 * available under the terms of the Eclipse Public License v1.0 
 * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 
 * 
 ******************************************************************************/
/*******************************************************************************
 * @license
 * Copyright (c) 2012 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials are made 
 * available under the terms of the Eclipse Public License v1.0 
 * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 
 * 
 ******************************************************************************/
/*******************************************************************************
 * @license
 * Copyright (c) 2011 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials are made 
 * available under the terms of the Eclipse Public License v1.0 
 * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 
 *
 * Contributors:
 *     IBM Corporation - initial API and implementation
 *******************************************************************************/
/*******************************************************************************
 * @license
 * Copyright (c) 2011, 2012 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials are made 
 * available under the terms of the Eclipse Public License v1.0 
 * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 
 *
 * Contributors:
 *     IBM Corporation - initial API and implementation
 *******************************************************************************/
/*******************************************************************************
 * @license
 * Copyright (c) 2012 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials are made 
 * available under the terms of the Eclipse Public License v1.0 
 * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 
 * 
 ******************************************************************************/
/*******************************************************************************
 * @license
 * Copyright (c) 2012 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials are made 
 * available under the terms of the Eclipse Public License v1.0 
 * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 
 * 
 ******************************************************************************/
/*******************************************************************************
 * @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) 2012 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials are made 
 * available under the terms of the Eclipse Public License v1.0 
 * (http://www.eclipse.org/legal/epl-v10.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: 
 *		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) 2012 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials are made 
 * available under the terms of the Eclipse Public License v1.0 
 * (http://www.eclipse.org/legal/epl-v10.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) 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: Anton McConville - 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) 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) 2012 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials are made 
 * available under the terms of the Eclipse Public License v1.0 
 * (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 1.0.7 Copyright (c) 2010-2011, The Dojo Foundation All Rights Reserved.
 * Available via the MIT or new BSD license.
 * see: http://github.com/jrburke/requirejs for details
 */
/*******************************************************************************
 * @license
 * Copyright (c) 2011, 2012 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials are made 
 * available under the terms of the Eclipse Public License v1.0 
 * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 
 *
 * Contributors:
 *     IBM Corporation - initial API and implementation
 *******************************************************************************/
/*******************************************************************************
 * @license
 * Copyright (c) 2010, 2012 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials are made 
 * available under the terms of the Eclipse Public License v1.0 
 * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 
 * 
 * Contributors: IBM Corporation - initial API and implementation
 ******************************************************************************/
/*******************************************************************************
 * @license
 * Copyright (c) 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) 2011, 2012 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials are made 
 * available under the terms of the Eclipse Public License v1.0 
 * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 
 * 
 * Contributors: IBM Corporation - initial API and implementation
 ******************************************************************************/
/*******************************************************************************
 * @license
 * Copyright (c) 2012 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials are made 
 * available under the terms of the Eclipse Public License v1.0 
 * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 
 * 
 ******************************************************************************/
/*******************************************************************************
 * @license
 * Copyright (c) 2012 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials are made 
 * available under the terms of the Eclipse Public License v1.0 
 * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 
 * 
 ******************************************************************************/
/******************************************************************************* 
 * @license
 * Copyright (c) 2011, 2012 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials are made 
 * available under the terms of the Eclipse Public License v1.0 
 * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 
 * 
 * Contributors: IBM Corporation - initial API and implementation
 ******************************************************************************/
/*******************************************************************************
 * @license
 * Copyright (c) 2010, 2012 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials are made 
 * available under the terms of the Eclipse Public License v1.0 
 * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 
 *
 * Contributors:
 *     IBM Corporation - initial API and implementation
 *******************************************************************************/
/*******************************************************************************
 * @license
 * Copyright (c) 2010, 2012 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials are made 
 * available under the terms of the Eclipse Public License v1.0 
 * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 
 * 
 * Contributors: IBM Corporation - initial API and implementation
 ******************************************************************************/
/*******************************************************************************
 * @license
 * Copyright (c) 2012 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials are made 
 * available under the terms of the Eclipse Public License v1.0 
 * (http://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) 2011, 2012 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials are made 
 * available under the terms of the Eclipse Public License v1.0 
 * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 
 *
 * Contributors:
 *     IBM Corporation - initial API and implementation
 *******************************************************************************/
/*******************************************************************************
 * @license
 * Copyright (c) 2010, 2012 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials are made 
 * available under the terms of the Eclipse Public License v1.0 
 * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 
 * 
 * Contributors: IBM Corporation - initial API and implementation
 ******************************************************************************/
/*******************************************************************************
 * @license
 * Copyright (c) 2012 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials are made 
 * available under the terms of the Eclipse Public License v1.0 
 * (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) 2010, 2012 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials are made 
 * available under the terms of the Eclipse Public License v1.0 
 * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 
 * 
 * Contributors: 
 *		Felipe Heidrich (IBM Corporation) - initial API and implementation
 *		Silenio Quarti (IBM Corporation) - initial API and implementation
 ******************************************************************************/
/*******************************************************************************
 * @license
 * Copyright (c) 2010, 2012 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials are made 
 * available under the terms of the Eclipse Public License v1.0 
 * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 
 * 
 * Contributors: 
 *		Felipe Heidrich (IBM Corporation) - initial API and implementation
 *		Silenio Quarti (IBM Corporation) - initial API and implementation
 ******************************************************************************/
/*******************************************************************************
 * @license
 * Copyright (c) 2010, 2012 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials are made 
 * available under the terms of the Eclipse Public License v1.0 
 * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 
 * 
 * Contributors: 
 *		Felipe Heidrich (IBM Corporation) - initial API and implementation
 *		Silenio Quarti (IBM Corporation) - initial API and implementation
 ******************************************************************************/
/*******************************************************************************
 * @license
 * Copyright (c) 2010, 2012 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials are made 
 * available under the terms of the Eclipse Public License v1.0 
 * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 
 * 
 * Contributors: 
 *		Felipe Heidrich (IBM Corporation) - initial API and implementation
 *		Silenio Quarti (IBM Corporation) - initial API and implementation
 ******************************************************************************/
/*******************************************************************************
 * @license
 * Copyright (c) 2010, 2012 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials are made 
 * available under the terms of the Eclipse Public License v1.0 
 * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 
 * 
 * Contributors: 
 *		Felipe Heidrich (IBM Corporation) - initial API and implementation
 *		Silenio Quarti (IBM Corporation) - initial API and implementation
 *		Mihai Sucan (Mozilla Foundation) - fix for Bug#334583 Bug#348471 Bug#349485 Bug#350595 Bug#360726 Bug#361180 Bug#362835 Bug#362428 Bug#362286 Bug#354270 Bug#361474 Bug#363945 Bug#366312 Bug#370584
 ******************************************************************************/
/*******************************************************************************
 * @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) 2010, 2012 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials are made 
 * available under the terms of the Eclipse Public License v1.0 
 * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 
 * 
 * Contributors: IBM Corporation - initial API and implementation
 ******************************************************************************/
/*******************************************************************************
 * @license
 * Copyright (c) 2011, 2012 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials are made 
 * available under the terms of the Eclipse Public License v1.0 
 * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 
 *
 * Contributors:
 *     IBM Corporation - initial API and implementation
 *******************************************************************************/
/*******************************************************************************
 * @license
 * Copyright (c) 2011, 2012 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials are made 
 * available under the terms of the Eclipse Public License v1.0 
 * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 
 *
 * Contributors:
 *     IBM Corporation - initial API and implementation
 *******************************************************************************/
/*******************************************************************************
 * @license
 * Copyright (c) 2010, 2012 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials are made 
 * available under the terms of the Eclipse Public License v1.0 
 * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 
 *
 * Contributors:
 *     IBM Corporation - initial API and implementation
 *******************************************************************************/
/*******************************************************************************
 * @license
 * Copyright (c) 2010, 2012 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials are made 
 * available under the terms of the Eclipse Public License v1.0 
 * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 
 *
 * Contributors:
 *     IBM Corporation - initial API and implementation
 *******************************************************************************/
/*******************************************************************************
 * @license
 * 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) 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: 
 *		Anton McConville (IBM Corporation) - initial API and implementation
 *		Felipe Heidrich (IBM Corporation) - initial API and implementation 
 ******************************************************************************/
/******************************************************************************* 
 * @license
 * Copyright (c) 2012 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials are made 
 * available under the terms of the Eclipse Public License v1.0 
 * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 
 * 
 * Contributors: IBM Corporation - initial API and implementation
 ******************************************************************************/
/*******************************************************************************
 * @license
 * Copyright (c) 2011, 2012 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials are made 
 * available under the terms of the Eclipse Public License v1.0 
 * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 
 * 
 * Contributors: IBM Corporation - initial API and implementation
 ******************************************************************************/
/*******************************************************************************
 * @license
 * Copyright (c) 2010, 2012 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials are made 
 * available under the terms of the Eclipse Public License v1.0 
 * (http://www.eclipse.org/legal/epl-v10.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) 2012 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials are made 
 * available under the terms of the Eclipse Public License v1.0 
 * (http://www.eclipse.org/legal/epl-v10.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: IBM Corporation - initial API and implementation
 ******************************************************************************/
/*******************************************************************************
 * @license Copyright (c) 2010, 2013 IBM Corporation and others. All rights
 *          reserved. This program and the accompanying materials are made
 *          available under the terms of the Eclipse Public License v1.0
 *          (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse
 *          Distribution License v1.0
 *          (http://www.eclipse.org/org/documents/edl-v10.html).
 * 
 * Contributors: IBM Corporation - initial API and implementation
 ******************************************************************************/
/*******************************************************************************
 * @license Copyright (c) 2012, 2013 IBM Corporation and others. All rights reserved.
 *          This program and the accompanying materials are made available under
 *          the terms of the Eclipse Public License v1.0
 *          (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse
 *          Distribution License v1.0
 *          (http://www.eclipse.org/org/documents/edl-v10.html).
 * 
 * Contributors: IBM Corporation - initial API and implementation
 ******************************************************************************/
/*******************************************************************************
 * @license Copyright (c) 2012 IBM Corporation and others. All rights reserved.
 *          This program and the accompanying materials are made available under
 *          the terms of the Eclipse Public License v1.0
 *          (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse
 *          Distribution License v1.0
 *          (http://www.eclipse.org/org/documents/edl-v10.html).
 * 
 * Contributors: IBM Corporation - initial API and implementation
 ******************************************************************************/
/*******************************************************************************
 * @license Copyright (c) 2011, 2013 IBM Corporation and others. All rights
 *          reserved. This program and the accompanying materials are made
 *          available under the terms of the Eclipse Public License v1.0
 *          (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse
 *          Distribution License v1.0
 *          (http://www.eclipse.org/org/documents/edl-v10.html).
 * 
 * Contributors: IBM Corporation - initial API and implementation
 ******************************************************************************/
/*******************************************************************************
 * @license
 * Copyright (c) 2012 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials are made 
 * available under the terms of the Eclipse Public License v1.0 
 * (http://www.eclipse.org/legal/epl-v10.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) 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
 ******************************************************************************/
/******************************************************************************* 
 * @license
 * Copyright (c) 2011, 2012 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials are made 
 * available under the terms of the Eclipse Public License v1.0 
 * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 
 * 
 * Contributors: IBM Corporation - initial API and implementation
 ******************************************************************************/
/*******************************************************************************
 * @license
 * Copyright (c) 2010, 2012 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials are made 
 * available under the terms of the Eclipse Public License v1.0 
 * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 
 * 
 * Contributors: IBM Corporation - initial API and implementation
 ******************************************************************************/
/*******************************************************************************
 * @license
 * Copyright (c) 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,2012 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials are made 
 * available under the terms of the Eclipse Public License v1.0 
 * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 
 *
 * Contributors:
 *     IBM Corporation - initial API and implementation
 *******************************************************************************/
/*******************************************************************************
 * @license
 * Copyright (c) 2012 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials are made 
 * available under the terms of the Eclipse Public License v1.0 
 * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 
 * 
 * Contributors: IBM Corporation - initial API and implementation
 ******************************************************************************/
/*******************************************************************************
 * @license
 * Copyright (c) 2011, 2012 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials are made 
 * available under the terms of the Eclipse Public License v1.0 
 * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 
 * 
 * Contributors: IBM Corporation - initial API and implementation
 ******************************************************************************/
/*******************************************************************************
 * @license Copyright (c) 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, 2012 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials are made 
 * available under the terms of the Eclipse Public License v1.0 
 * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 
 * 
 * Contributors: IBM Corporation - initial API and implementation
 ******************************************************************************/
/*******************************************************************************
 * @license
 * Copyright (c) 2011, 2012 IBM Corporation and others. 
 * All rights reserved. This program and the accompanying materials are made 
 * available under the terms of the Eclipse Public License v1.0 
 * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 
 * 
 * Contributors: IBM Corporation - initial API and implementation
 ******************************************************************************/
/*******************************************************************************
 * @license Copyright (c) 2010, 2012 IBM Corporation and others. All rights
 *          reserved. This program and the accompanying materials are made
 *          available under the terms of the Eclipse Public License v1.0
 *          (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse
 *          Distribution License v1.0
 *          (http://www.eclipse.org/org/documents/edl-v10.html).
 * 
 * Contributors: IBM Corporation - initial API and implementation
 ******************************************************************************/
/******************************************************************************* 
 * @license
 * Copyright (c) 2011, 2013 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials are made 
 * available under the terms of the Eclipse Public License v1.0 
 * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 
 * 
 * Contributors: IBM Corporation - initial API and implementation
 ******************************************************************************/
/*******************************************************************************
 * @license
 * Copyright (c) 2011, 2012 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials are made 
 * available under the terms of the Eclipse Public License v1.0 
 * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 
 *
 * Contributors:
 *     IBM Corporation - initial API and implementation
 *******************************************************************************/
/*******************************************************************************
 * @license
 * Copyright (c) 2009, 2012 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials are made 
 * available under the terms of the Eclipse Public License v1.0 
 * (http://www.eclipse.org/legal/epl-v10.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
 *     Andy Clement (vmware) - bug 344614
 *******************************************************************************/
/*******************************************************************************
 * @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, 2012 IBM Corporation and others. All rights reserved.
 * This program and the accompanying materials are made available under the
 * terms of the Eclipse Public License v1.0
 * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution
 * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html).
 * 
 * Contributors: 
 *	IBM Corporation - initial API and implementation
 *	Adrian Aichner - regular expression capture group support in replace
 ******************************************************************************/
/*******************************************************************************
 * @license
 * Copyright (c) 2012 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials are made 
 * available under the terms of the Eclipse Public License v1.0 
 * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 
 * 
 ******************************************************************************/
/*******************************************************************************
 * @license
 * Copyright (c) 2012 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials are made 
 * available under the terms of the Eclipse Public License v1.0 
 * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 
 * 
 * Contributors: IBM Corporation - initial API and implementation
 ******************************************************************************/
/*******************************************************************************
 * @license
 * Copyright (c) 2011, 2012 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials are made 
 * available under the terms of the Eclipse Public License v1.0 
 * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 
 *
 * Contributors:
 *     IBM Corporation - initial API and implementation
 *******************************************************************************/
/*******************************************************************************
 * @license
 * Copyright (c) 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, 2012 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials are made 
 * available under the terms of the Eclipse Public License v1.0 
 * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 
 *
 * Contributors:
 *     IBM Corporation - initial API and implementation
 *******************************************************************************/
/*******************************************************************************
 * @license
 * Copyright (c) 2010, 2012 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials are made 
 * available under the terms of the Eclipse Public License v1.0 
 * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 
 *
 * Contributors:
 *     IBM Corporation - initial API and implementation
 *******************************************************************************/
/*******************************************************************************
 * @license Copyright (c) 2011, 2012 IBM Corporation and others. All rights
 *          reserved. This program and the accompanying materials are made
 *          available under the terms of the Eclipse Public License v1.0
 *          (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse
 *          Distribution License v1.0
 *          (http://www.eclipse.org/org/documents/edl-v10.html).
 * 
 * Contributors: IBM Corporation - initial API and implementation
 ******************************************************************************/
/*******************************************************************************
 * @license Copyright (c) 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

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors:
 IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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


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


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


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


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

 Contributors: IBM Corporation - initial API and implementation

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


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


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

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


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


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

 Contributors:
 IBM Corporation - initial API and implementation

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


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


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

 Contributors:
 IBM Corporation - initial API and implementation

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

 Contributors:
 IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

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


 Copyright (c) 2012 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (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
 RequireJS text 1.0.7 Copyright (c) 2010-2011, The Dojo Foundation All Rights Reserved.
 Available via the MIT or new BSD license.
 see: http://github.com/jrburke/requirejs 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, 2012 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and 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). 


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

 Contributors:
 IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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


 Copyright (c) 2012 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (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: 
 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) 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
 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: 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) 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: 
 Anton McConville (IBM Corporation) - initial API and implementation
 Felipe Heidrich (IBM Corporation) - initial API and implementation 

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

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

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

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

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

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

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

 Contributors: IBM Corporation - initial API and implementation

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

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

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors:
 IBM Corporation - initial API and implementation

 Copyright (c) 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) 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
 Andy Clement (vmware) - bug 344614

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

 Contributors: IBM Corporation - initial API and implementation

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

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

 Copyright (c) 2012 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (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) 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
 RequireJS i18n 1.0.0 Copyright (c) 2010-2011, The Dojo Foundation All Rights Reserved.
 Available via the MIT or new BSD license.
 see: http://github.com/jrburke/requirejs for details

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

 Contributors:
 IBM Corporation - initial API and implementation

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

 Contributors:
 IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors:
 IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors:
 IBM Corporation - initial API and implementation
*/
(function(){function g(b,f,e,d,c,a){f[b]&&(e.push(b),(f[b]===!0||f[b]===1)&&d.push(c+b+"/"+a))}function k(b,f,e,d,c){f=d+f+"/"+c;require._fileExists(b.toUrl(f))&&e.push(f)}var j=/(^.*(^|\/)nls(\/|$))([^\/]*)\/?([^\/]*)/,b={};define("i18n",{version:"1.0.0",load:function(h,f,e,d){var d=d||{},c=j.exec(h),a=c[1],i=c[4],l=c[5],n=i.split("-"),q=[],t={},m,r,o="";c[5]?(a=c[1],h=a+l):(l=c[4],i=d.locale||(d.locale=typeof navigator==="undefined"?"root":(navigator.language||navigator.userLanguage||"root").toLowerCase()),
n=i.split("-"));if(d.isBuild){q.push(h);k(f,"root",q,a,l);for(m=0;r=n[m];m++)o+=(o?"-":"")+r,k(f,o,q,a,l);f(q,function(){e()})}else f([h],function(c){var i=[];g("root",c,i,q,a,l);for(m=0;r=n[m];m++)o+=(o?"-":"")+r,g(o,c,i,q,a,l);f(q,function(){var m,o;for(m=i.length-1;m>-1&&(r=i[m]);m--){o=c[r];if(o===!0||o===1)o=f(a+r+"/"+l);var d=t,n=void 0;for(n in o)!(n in b)&&!(n in d)&&(d[n]=o[n])}e(t)})})}})})();
define("orion/i18n",[],function(){return{load:function(g,k,j,b){var b=b||{},h=/(^.*(?:^|\/)nls(?:\/|$))([^\/]*)\/?([^\/]*)/,f=h.exec(g);if(f)if(k.defined(g))j(k(g));else if(b.isBuild||b.isTest)j({});else{var e=f[1],d=f[3]?f[2]:"",c=f[3]||f[2];k(["orion/bootstrap"],function(a){a.startup().then(function(a){var l=a.serviceRegistry,a=l.getServiceReferences("orion.i18n.message");if(d)a.some(function(a){return g===a.getProperty("name")?(l.getService(a).getMessageBundle().then(function(a){j(a)},function(){j({})}),
!0):!1})||j({});else{var n={},q;a.forEach(function(a){var m=a.getProperty("name");if((f=h.exec(m))&&e===f[1]&&c===(f[3]||f[2]))if(d=f[3]?f[2]:""){if((a=b.locale||(typeof navigator!=="undefined"?navigator.language||navigator.userLanguage:null))&&a.indexOf(d)===0)n[d]=!0,k.specified(m)||define(m,["orion/i18n!"+m],function(a){return a})}else q=a});k.specified(g)?j(n):q?l.getService(q).getMessageBundle().then(function(a){Object.keys(n).forEach(function(m){typeof a[m]==="undefined"&&(a[m]=n[m])});define(g,
[],a);j(a)},function(){define(g,[],n);j(n)}):(define(g,[],n),j(n))}})})}else j(null)}}});
define("git/nls/root/gitmessages",{Compare:"Compare","View the side-by-side compare":"View the side-by-side compare","Working Directory Version":"Working Directory Version","Working Directory":"Working Directory","View the working directory version of the file":"View the working directory version of the file","Loading...":"Loading...",Repositories:"Repositories","0 on 1 - Git":"${0} on ${1} - Git",Git:"Git","Show in eclipse.org":"Show in eclipse.org","Show this repository at eclipse.org":"Show this repository at eclipse.org",
"Show in GitHub":"Show in GitHub","Show this repository in GitHub":"Show this repository in GitHub","Commit Details":"Commit Details","No Commits":"No Commits","commit: 0":"commit: ${0}","parent: 0":"parent: ${0}","authored by 0 (1) on 2":"authored by ${0} (${1}) on ${2}","committed by 0 (1)":"committed by ${0} (${1})","Tags:":"Tags:","No Tags":"No Tags",Diffs:"Changes",More:"More","Loading git log...":"Loading git log...",local:"local",remote:"remote","Git Log for ${0} branch ${1} on ":"Git Log for ${0} branch ${1} on ",
"Git Log for ${0} branch ${1}":"Git Log for ${0} branch ${1}","Log for branch ${0} - Git":"Log for branch ${0} - Git","Log for ${0} on ${1} - Git":"Log for ${0} on ${1} - Git","View All":"View All","Error ${0}: ":"Error ${0}: ","Loading ":"Loading ",Message:"Message",Author:"Author",Date:"Date",Actions:"Actions",Branches:"Branches",Tags:"Tags",Stage:"Stage","Unstaged removal":"Unstaged removal",Unstage:"Unstage","Staged removal":"Staged removal","Unstaged change":"Unstaged change","Staged change":"Staged change",
"Unstaged add":"Unstaged add","Staged add":"Staged add","Resolve Conflict":"Resolve Conflict",Conflicting:"Conflicting","Commit message":"Commit message","Record changes in the active branch":"Record changes in the active branch",Commit:"Commit","Amend last commit":"Amend last commit"," Amend":" Amend","Rebase in progress. Choose action:":"Rebase in progress. Choose action:","Committer name:":"Committer name:","email:":"email:","Author name: ":"Author name: ","Select a file on the left to compare...":"Select a file on the left to compare...",
Unstaged:"Unstaged",Staged:"Staged","Recent commits on":"Recent commits on","Git Status":"Git Status","Go to Git Status":"Go to Git Status","Recent commits on ${0}":"Recent commits on ${0}","Status for ${0} - Git":"Status for ${0} - Git","Status (${0})":"Status (${0})","Getting git incoming changes...":"Getting git incoming changes...","Loading recent commits...":"Loading recent commits...","Show the side-by-side compare":"Show the side-by-side compare","Change Committer or Author":"Change Committer or Author",
"Use Default Committer and Author":"Use Default Committer and Author",Checkout:"Checkout","Checkout the file, discarding the unstaged change":"Checkout the file, discarding the unstaged change","Your changes to the file will be lost. Are you sure you want to checkout?":"Your changes to the file will be lost. Are you sure you want to checkout?","Checking out...":"Checking out...","Stage the change":"Stage the change","Stage the selected changes":"Stage the selected changes","Staging...":"Staging...",
"Checkout all the selected files, discarding all changes":"Checkout all the selected files, discarding all changes","Your changes to all the selected files will be lost. Are you sure you want to checkout?":"Your changes to all the selected files will be lost. Are you sure you want to checkout?","Save Patch":"Save Patch","Save workspace changes as a patch":"Save workspace changes as a patch","Unstage the change":"Unstage the change","Unstaging...":"Unstaging...",Reset:"Reset","Reset the branch, discarding all staged and unstaged changes":"Reset the branch, discarding all staged and unstaged changes",
"All unstaged and staged changes in the working directory and index will be discarded and cannot be recovered.":"All unstaged and staged changes in the working directory and index will be discarded and cannot be recovered.","Are you sure you want to continue?":"Are you sure you want to continue?","Resetting local changes...":"Resetting local changes...","Continue rebase...":"Continue rebase...","Skipping patch...":"Skipping patch...","Aborting rebase...":"Aborting rebase...","Complete log":"Complete log",
"local VS index":"local VS index","index VS HEAD":"index VS HEAD","Compare(${0} : ${1})":"Compare(${0} : ${1})","Loading status...":"Loading status...","Committing...":"Committing...","The committer name is required.":"The committer name is required.","The committer mail is required.":"The committer mail is required.","The author name is required.":"The author name is required.","The author mail is required.":"The author mail is required.",". Repository still contains conflicts.":". Repository still contains conflicts.",
". Repository contains unmerged paths. Resolve conflicts first.":". Repository contains unmerged paths. Resolve conflicts first.","Rendering ${0}":"Rendering ${0}",Configuration:"Configuration"," - Git":" - Git","Repositories - Git":"Repositories - Git",Repository:"Repository","Repository Not Found":"Repository Not Found","No Repositories":"No Repositories","Loading repository":"Loading repository","Loading repositories":"Loading repositories","(no remote)":"(no remote)","location: ":"location: ",
"${0} file(s) to stage and ${1} file(s) to commit.":"${0} file(s) to stage and ${1} file(s) to commit.","Nothing to commit.":"Nothing to commit.","Nothing to push.":"Nothing to push."," commit(s) to push.":" commit(s) to push.","You have no changes to commit.":"You have no changes to commit.","You have changes to commit in your workspace!":"You have changes to commit in your workspace!","Rebase in progress!":"Rebase in progress!","View all local and remote tracking branches":"View all local and remote tracking branches",
"tracks no branch, ":"tracks no branch, ","tracks ${0}, ":"tracks ${0}, ","last modified ${0} by ${1}":"last modified ${0} by ${1}","No Remote Branches":"No Remote Branches","Rendering branches":"Rendering branches",Commits:"Commits","Getting current branch":"Getting current branch","See Full Log":"See Full Log","See the full log":"See the full log",'Getting commits for "${0}" branch':'Getting commits for "${0}" branch',"Rendering commits":"Rendering commits","Getting outgoing commits":"Getting outgoing commits",
"The branch is up to date.":"The branch is up to date.","You have no outgoing or incoming commits.":"You have no outgoing or incoming commits.",") by ":") by "," (SHA ":" (SHA ","Getting tags":"Getting tags","View all tags":"View all tags"," on ":" on "," by ":" by ",Remotes:"Remotes","Rendering remotes":"Rendering remotes","No Remotes":"No Remotes","Getting confituration":"Getting confituration","View all configuration entries":"View all configuration entries","Unstaged addition":"Unstaged addition",
"Staged addition":"Staged addition"," (Rebase in Progress)":" (Rebase in Progress)",Status:"Status","Status for ${0} - Git ":"Status for ${0} - Git ","No Unstaged Changes":"No Unstaged Changes","No Staged Changes":"No Staged Changes",'Commits for "${0}" branch':'Commits for "${0}" branch',"Add Remote":"Add Remote","Remote Name:":"Remote Name:","Remote URI:":"Remote URI:","Apply Patch":"Apply Patch","Git Repository":"Git Repository","Go to the git repository":"Go to the git repository","Clone Git Repository":"Clone Git Repository",
"Repository URL:":"Repository URL:","Existing directory:":"Existing directory:","New folder:":"New folder:","Choose a Folder":"Choose a Folder","Commit Changes":"Commit Changes","Message:":"Message:","Amend:":"Amend:","Committer Name:":"Committer Name:","Committer Email:":"Committer Email:","Author Name:":"Author Name:","Author Email:":"Author Email:","The commit message is required.":"The commit message is required.","Git Credentials":"Git Credentials","Username:":"Username:","Ssh password:":"Ssh password:",
"Private key:":"Private key:","Passphrase (optional):":"Passphrase (optional):","commit:":"commit: ","parent:":"parent: ","branches: ":"branches: ","tags: ":"tags: "," authored by ${0} {${1}) on ${2}":" authored by ${0} {${1}) on ${2}",Content:"Content","Go to ${0} section":"Go to ${0} section","Find Commit":"Find Commit","Type the commit name (sha1):":"Type the commit name (sha1):",Search:"Search","Searching...":"Searching...","Looking for the commit":"Looking for the commit"," authored by ${0} (${1})) on ${2}":" authored by ${0} (${1})) on ${2}",
"New Branch:":"New Branch:",OK:"OK"," [New branch]":" [New branch]","Would you like to add ${0} key for host ${1} to continue operation? Key fingerpt is ${2}.":"Would you like to add ${0} key for host ${1} to continue operation? Key fingerpt is ${2}.","Link Repository":"Link Repository","Folder name:":"Folder name:","Repository was linked to ":"Repository was linked to ","Checkout the current tag, creating a local branch based on its contents.":"Checkout the current tag, creating a local branch based on its contents.",
"Checking out tag ${0}":"Checking out tag ${0}","Checkout the branch or corresponding local branch and make it active. If the remote tracking branch does not have a corresponding local branch, the local branch will be created first.":"Checkout the branch or corresponding local branch and make it active. If the remote tracking branch does not have a corresponding local branch, the local branch will be created first.","Checking out branch...":"Checking out branch...","Checking out branch ${0}...":"Checking out branch ${0}...",
"Branch checked out.":"Branch checked out.","New Branch":"New Branch","Add a new local branch to the repository":"Add a new local branch to the repository","Branch name":"Branch name",Delete:"Delete","Delete the local branch from the repository":"Delete the local branch from the repository","Are you sure you want to delete branch ${0}?":"Are you sure you want to delete branch ${0}?","Delete the remote tracking branch from the repository":"Delete the remote tracking branch from the repository","Are you sure?":"Are you sure?",
"You're going to delete remote branch ${0} and push the change.":"You're going to delete remote branch ${0} and push the change.","Removing remote branch: ":"Removing remote branch: ","Delete Remote Branch":"Delete Remote Branch","New Remote":"New Remote","Git Remote":"Git Remote","Go to Git Remote":"Go to Git Remote","Add a new remote to the repository":"Add a new remote to the repository","Delete the remote from the repository":"Delete the remote from the repository","Are you sure you want to delete remote ${0}?":"Are you sure you want to delete remote ${0}?",
Pull:"Pull","Pull from the repository":"Pull from the repository","Pulling: ":"Pulling: ","Pull Git Repository":"Pull Git Repository","Git Log":"Git Log","Go to Git Log":"Go to Git Log","Open the log for the branch":"Open the log for the branch","Open the log for the repository":"Open the log for the repository","Open the status for the repository":"Open the status for the repository","Show in Navigator":"Show in Navigator","Show the repository folder in the file navigator":"Show the repository folder in the file navigator",
"Compare With Each Other":"Compare With Each Other","Compare With Working Tree":"Compare With Working Tree",Open:"Open",Fetch:"Fetch","Fetch from the remote":"Fetch from the remote","SSH Password:":"SSH Password:","SSH User Name:":"SSH User Name:","Fetching remote: ":"Fetching remote: ","Force Fetch":"Force Fetch","Fetch from the remote branch into your remote tracking branch overriding its current content":"Fetch from the remote branch into your remote tracking branch overriding its current content",
"You're going to override content of the remote tracking branch. This can cause the branch to lose commits.":"You're going to override content of the remote tracking branch. This can cause the branch to lose commits.",Merge:"Merge","Merge the content from the branch to your active branch":"Merge the content from the branch to your active branch",". Go to ${0}.":". Go to ${0}.","Git Status page":"Git Status page",Rebase:"Rebase","Rebase your commits by removing them from the active branch, starting the active branch again based on the latest state of the selected branch ":"Rebase your commits by removing them from the active branch, starting the active branch again based on the latest state of the selected branch ",
"Rebase on top of ":"Rebase on top of ",". Some conflicts occurred. Please resolve them and continue, skip patch or abort rebasing":". Some conflicts occurred. Please resolve them and continue, skip patch or abort rebasing",". Repository state is invalid (i.e. already during rebasing)":". Repository state is invalid (i.e. already during rebasing)",". Repository contains unmerged paths":". Repository contains unmerged paths",". Repository contains pending changes. Please commit or stash them":". Repository contains pending changes. Please commit or stash them",
"Rebase your commits by removing them from the active branch, ":"Rebase your commits by removing them from the active branch, ","starting the active branch again based on the latest state of '":"starting the active branch again based on the latest state of '","and applying each commit again to the updated active branch.":"and applying each commit again to the updated active branch.","Push All":"Push All","Push commits and tags from your local branch into the remote branch":"Push commits and tags from your local branch into the remote branch",
"Pushing remote: ":"Pushing remote: ","Choose Branch":"Choose Branch","Force Push All":"Force Push All","Push commits and tags from your local branch into the remote branch overriding its current content":"Push commits and tags from your local branch into the remote branch overriding its current content","You're going to override content of the remote branch. This can cause the remote repository to lose commits.":"You're going to override content of the remote branch. This can cause the remote repository to lose commits.",
"< Previous Page":"< Previous Page","Show previous page of git log":"Show previous page of git log","Show previous page of git tags":"Show previous page of git tags","Next Page >":"Next Page >","Show next page of git log":"Show next page of git log","Show next page of git tags":"Show next page of git tags","Push from your local branch into the selected remote branch":"Push from your local branch into the selected remote branch","Reset your active branch to the state of the selected branch. Discard all staged and unstaged changes.":"Reset your active branch to the state of the selected branch. Discard all staged and unstaged changes.",
"The content of your active branch will be replaced with ":"The content of your active branch will be replaced with ","All unstaged and staged changes will be discarded and cannot be recovered. Are you sure?":"All unstaged and staged changes will be discarded and cannot be recovered. Are you sure?","Resetting index...":"Resetting index...","Name:":"Name:",Tag:"Tag","Create a tag for the commit":"Create a tag for the commit","Tag name":"Tag name","Delete the tag from the repository":"Delete the tag from the repository",
"Are you sure you want to delete tag ${0}?":"Are you sure you want to delete tag ${0}?","Cherry-Pick":"Cherry-Pick","Apply the change introduced by the commit to your active branch":"Apply the change introduced by the commit to your active branch","Nothing changed.":"Nothing changed.",". Some conflicts occurred":". Some conflicts occurred","Fetch from the remote branch into your remote tracking branch":"Fetch from the remote branch into your remote tracking branch","Fetch Git Repository":"Fetch Git Repository",
Push:"Push","Push from your local branch into the remote branch":"Push from your local branch into the remote branch","Push Git Repository":"Push Git Repository","Key:":"Key:","Value:":"Value:","New Configuration Entry":"New Configuration Entry",Edit:"Edit","Edit the configuration entry":"Edit the configuration entry","Delete the configuration entry":"Delete the configuration entry","Are you sure you want to delete ${0}?":"Are you sure you want to delete ${0}?","Clone Repository":"Clone Repository",
"Clone an existing Git repository to a folder":"Clone an existing Git repository to a folder","Cloning repository: ":"Cloning repository: ","Init Repository":"Init Repository","Create a new Git repository in a new folder":"Create a new Git repository in a new folder","Initializing repository: ":"Initializing repository: ","Init Git Repository":"Init Git Repository","Delete the repository":"Delete the repository","Are you sure you want do delete ${0} repositories?":"Are you sure you want do delete ${0} repositories?",
"Apply a patch on the selected repository":"Apply a patch on the selected repository","Show content":"Show content","Commit name:":"Commit name:","Open Commit":"Open Commit","Open the commit with the given name":"Open the commit with the given name","No commits found":"No commits found","Staging changes":"Staging changes","Commit message:":"Commit message:","Committing changes":"Committing changes","Resetting local changes":"Resetting local changes","Checkout files, discarding all changes":"Checkout files, discarding all changes",
"Show Patch":"Show Patch","Show workspace changes as a patch":"Show workspace changes as a patch",Continue:"Continue","Contibue Rebase":"Contibue Rebase","Skip Patch":"Skip Patch",Abort:"Abort","Abort Rebase":"Abort Rebase","Your changes to the selected files will be discarded and cannot be recovered.":"Your changes to the selected files will be discarded and cannot be recovered.","Active Branch Log":"Git Log (Active Branch)","Show the log for the active local branch":"Show the log for the active local branch",
"Remote Branch Log":"Git Log (Remote Branch)","Show the log for the corresponding remote tracking branch":"Show the log for the corresponding remote tracking branch","See Full Status":"See Full Status","See the status":"See the status","Choose target location":"Choose target location","Default target location":"Default target location","Change...":"Change...","Merge Squash":"Merge Squash","Squash the content of the branch to the index":"Squash the content of the branch to the index","Local Branch Name:":"Local Branch Name:",
"Filter items":"Filter items","Filter remote branches":"Filter remote branches","Paste link in email or IM":"Paste link in email or IM","Show Commit in GitHub":"Show Commit in GitHub","Show Repository in GitHub":"Show Repository in GitHub","Show this commit in GitHub":"Show this commit in GitHub","Show Commit in eclipse.org":"Show Commit in eclipse.org","Show this commit in eclipse.org":"Show this commit in eclipse.org","Show Repository in eclipse.org":"Show Repository in eclipse.org","Show this repository in eclipse.org":"Show this repository in eclipse.org",
"Ask for review":"Ask for review","Ask for review tooltip":"Send email with request for commit review","Reviewer name":"Reviewer name","Contribution Review Request":"Contribution Review Request","Send the link to the reviewer":"Send the link to the reviewer","Private key file (optional):":"Private key file (optional):","Don't prompt me again:":"Don't prompt me again:","Your private key will be saved in the browser for further use":"Your private key will be saved in the browser for further use","Loading Contribution Review Request...":"Loading Contribution Review Request...",
"The commit can be found in the following repositories":"The commit can be found in the following repositories","Try to update your repositories":"Try to update your repositories","Create new repository":"Create new repository","Attach the remote to one of your existing repositories":"Attach the remote to one of your existing repositories","You are reviewing contribution ${0} from ${1}":"You are reviewing contribution ${0} from ${1}","Unfortunately the commit can not be found in your workspace. To see it try one of the following: ":"Unfortunately the commit can not be found in your workspace. To see it try one of the following: ",
"To review the commit you can also:":"To review the commit you can also:","Contribution Review Request for ${0} on ${1}":"Contribution Review Request for ${0} on ${1}","Failing paths: ${0}":"Failing paths: ${0}","Problem while performing the action":"Problem while performing the action","Clone Git Repository":"Clone Git Repository","Go to the Orion repositories page to provide a git repository URL. Once the repository is created, it will appear in the Navigator.":"Go to the Orion repositories page to provide a git repository URL. Once the repository is created, it will appear in the Navigator."});
define("git/nls/gitmessages",["orion/i18n!git/nls/gitmessages","git/nls/root/gitmessages"],function(g,k){var j={root:k};Object.keys(g).forEach(function(b){typeof j[b]==="undefined"&&(j[b]=g[b])});return j});
(function(g,k){typeof define==="function"&&define.amd?define("orion/Deferred",[],k):typeof exports==="object"?module.exports=k():(g.orion=g.orion||{},g.orion.Deferred=k())})(this,function(){function g(){for(var a;a=e.shift()||d.shift();)a();c=!1}function k(a,i){(i?d:e).push(a);c||(c=!0,i?setTimeout(g,0):g())}function j(a){return function(){a.apply(null,arguments)}}function b(){}function h(){var a=Error("Cancel");a.name="Cancel";return a}function f(){function a(){for(var a;a=e.shift();){var m=a.deferred,
r=d==="resolved"?"resolve":"reject";if(typeof a[r]==="function")try{var o=a[r](c);o&&typeof o.then==="function"?(m.cancel=o.cancel||b,o.then(j(m.resolve),j(m.reject),m.progress)):m.resolve(o)}catch(x){m.reject(x)}else m[r](c)}}var c,d,e=[],q=this;this.reject=function(b){d||(d="rejected",c=b,e.length&&k(a));return q.promise};this.resolve=function(b){d||(d="resolved",c=b,e.length&&k(a));return q.promise};this.progress=function(a){d||e.forEach(function(m){m.progress&&m.progress(a)});return q.promise};
this.cancel=function(){d||q.reject(h())};this.then=function(c,m,i){var c={resolve:c,reject:m,progress:i,deferred:new f},o=c.deferred,b=this.cancel.bind(this),h=function(){k(function(){(o.cancel===h?b:o.cancel)()},!0)};o.cancel=h;m=o.promise;m.cancel=function(){o.cancel()};e.push(c);d&&k(a,!0);return m};this.promise={then:this.then,cancel:this.cancel}}var e=[],d=[],c=!1;f.all=function(a,c){function d(a,c){m||(h[a]=c,--b===0&&r.resolve(h))}function e(a,b){if(!m){if(c)try{d(a,c(b));return}catch(n){b=
n}r.reject(b)}}var b=a.length,h=[],m=!1,r=new f;r.then(null,function(){m=!0;a.forEach(function(a){a.cancel&&a.cancel()})});b===0?r.resolve(h):a.forEach(function(a,m){a.then(d.bind(null,m),e.bind(null,m))});return r.promise};f.when=function(a,c,d,e){var b;if(!(a&&typeof a.then==="function"))b=new f,b.resolve(a),a=b.promise;return a.then(c,d,e)};return f});
define("orion/EventTarget",[],function(){function g(){this._namedListeners={}}g.prototype={dispatchEvent:function(g){if(!g.type)throw Error("unspecified type");var j=this._namedListeners[g.type];j&&j.forEach(function(b){try{typeof b==="function"?b(g):b.handleEvent(g)}catch(h){typeof console!=="undefined"&&console.log(h)}});return!g.defaultPrevented},addEventListener:function(g,j){if(typeof j==="function"||j.handleEvent)this._namedListeners[g]=this._namedListeners[g]||[],this._namedListeners[g].push(j)},
removeEventListener:function(g,j){var b=this._namedListeners[g];if(b)for(var h=0;h<b.length;h++)if(b[h]===j){b.length===1?delete this._namedListeners[g]:b.splice(h,1);break}}};g.prototype.constructor=g;g.attach=function(k){var j=new g;k.dispatchEvent=j.dispatchEvent.bind(j);k.addEventListener=j.addEventListener.bind(j);k.removeEventListener=j.removeEventListener.bind(j)};return g});
define("orion/serviceregistry",["orion/Deferred","orion/EventTarget"],function(g,k){function j(d,c,a){this._properties=a||{};this._properties["service.id"]=d;this._properties.objectClass=c;this._properties["service.names"]=c}function b(d,c,a){this._serviceId=d;this._serviceReference=c;this._internalRegistry=a}function h(d,c){function a(a){return function(){var i;try{if(!c())throw Error("Service was unregistered");var e=d[a].apply(d,Array.prototype.slice.call(arguments));if(e&&typeof e.then==="function")return e;
else i=new g,i.resolve(e)}catch(b){i=new g,i.reject(b)}return i.promise}}for(var i in d)typeof d[i]==="function"&&(this[i]=a(i))}function f(d,c){this.type=d;this.serviceReference=c}function e(){this._entries=[];this._namedReferences={};this._serviceEventTarget=new k;var d=this;this._internalRegistry={isRegistered:function(c){return d._entries[c]?!0:!1},unregisterService:function(c){var a=d._entries[c];if(!a)throw Error("already unregistered");var i=a.reference;d._serviceEventTarget.dispatchEvent(new f("unregistering",
i));d._entries[c]=null;i.getProperty("objectClass").forEach(function(a){for(var c=d._namedReferences[a],e=0;e<c.length;e++)if(c[e]===i){c.length===1?delete d._namedReferences[a]:c.splice(e,1);break}})},modifyService:function(c){c=d._entries[c];if(!c)throw Error("already unregistered");d._serviceEventTarget.dispatchEvent(new f("modified",c.reference))}}}j.prototype={getPropertyKeys:function(){var d=[],c;for(c in this._properties)this._properties.hasOwnProperty(c)&&d.push(c);return d},getProperty:function(d){return this._properties[d]}};
j.prototype.constructor=j;b.prototype={unregister:function(){this._internalRegistry.unregisterService(this._serviceId)},getReference:function(){if(!this._internalRegistry.isRegistered(this._serviceId))throw Error("already unregistered");return this._serviceReference},setProperties:function(d){var c=this._serviceReference._properties;this._serviceReference._properties=d||{};d["service.id"]=this._serviceId;d.objectClass=c.objectClass;d["service.names"]=c["service.names"];this._internalRegistry.modifyService(this._serviceId)}};
b.prototype.constructor=b;e.prototype={getService:function(d){var c;if(typeof d==="string")(d=this._namedReferences[d])&&d.some(function(a){c=this._entries[a.getProperty("service.id")].service;return!!c},this);else if(d=this._entries[d.getProperty("service.id")])c=d.service;return c||null},getServiceReferences:function(d){if(d)return this._namedReferences[d]?this._namedReferences[d]:[];var c=[];this._entries.forEach(function(a){a&&c.push(a.reference)});return c},registerService:function(d,c,a){if(typeof c===
"undefined"||c===null)throw Error("invalid service");typeof d==="string"?d=[d]:Array.isArray(d)||(d=[]);var i=this._entries.length,e=new j(i,d,a),n=this._namedReferences;d.forEach(function(a){n[a]=n[a]||[];n[a].push(e)});d=new h(c,this._internalRegistry.isRegistered.bind(null,i));this._entries.push({reference:e,service:d});d=this._internalRegistry;this._serviceEventTarget.dispatchEvent(new f("registered",e));return new b(i,e,d)},addEventListener:function(d,c){this._serviceEventTarget.addEventListener(d,
c)},removeEventListener:function(d,c){this._serviceEventTarget.removeEventListener(d,c)}};e.prototype.constructor=e;return{ServiceRegistry:e}});
define("orion/xhr",["orion/Deferred"],function(g){function k(g,b,h,f){var e=typeof h.response!=="undefined"?h.response:h.responseText,d;try{d=h.status}catch(c){d=0}g={args:b,response:e,responseText:typeof e==="string"?e:null,status:d,url:g,xhr:h};if(typeof f!=="undefined")g.error=f;return g}return function(j,b,h){var h=h||{},f=arguments.length>3&&arguments[3]?arguments[3]:new XMLHttpRequest,e=new g,d=h.headers||{},c=h.log||!1,a;typeof d["X-Requested-With"]==="undefined"&&(d["X-Requested-With"]="XMLHttpRequest");
if(typeof h.data!=="undefined"&&(j==="POST"||j==="PUT"))a=h.data;if(typeof h.responseType==="string")f.responseType=h.responseType;f.onprogress=function(a){a.xhr=f;e.progress(a)};f.onreadystatechange=function(){if(f.readyState===4){var a=k(b,h,f),i=f.status;200<=i&&i<400?e.resolve(a):(c&&typeof console!=="undefined"&&console.log(Error(f.statusText)),e.reject(a))}};try{f.open(j,b,!0);if(typeof h.timeout==="number")if(typeof f.timeout==="number")f.timeout=h.timeout,f.addEventListener("timeout",function(){e.reject(k(b,
h,f,"Timeout exceeded"))});else{var i=setTimeout(function(){e.reject(k(b,h,f,"Timeout exceeded"))},h.timeout);e.then(clearTimeout.bind(null,i),clearTimeout.bind(null,i))}Object.keys(d).forEach(function(a){f.setRequestHeader(a,d[a])});f.send(a)}catch(l){e.reject(k(b,h,f,l))}return e.promise}});
define("orion/preferences",["require","orion/Deferred","orion/xhr"],function(g,k,j){function b(a,c){this._name=a;this._providers=c;this._flushPending=!1;this._cached=null;this._stores=[];this._dirty=[]}function h(a,c){return{get:function(d,e){if(c===0)return null;var b=localStorage.getItem(a+d);if(b===null)return null;b=JSON.parse(b);return e||c===-1||b._expires&&b._expires>(new Date).getTime()?(delete b._expires,b):null},set:function(d,e){if(c!==0){if(c!==-1)e._expires=(new Date).getTime()+1E3*c;
if(Object.keys(e).length===0)localStorage.removeItem(a+d);else{var b=JSON.stringify(e);localStorage.setItem(a+d,b);delete e._expires}}},remove:function(c){localStorage.removeItem(a+c)}}}function f(a){this._currentPromises={};this._cache=new h("/orion/preferences/user",3600);this._service=null;this.available=function(){if(!this._service){var c=a.getServiceReferences("orion.core.preference.provider");if(c.length>0)this._service=a.getService(c[0])}return!!this._service}}function e(a){this._location=
a;this._currentPromise=null;this._cache=new h("/orion/preferences/default",3600)}function d(){this._cache=new h("/orion/preferences/local",-1)}function c(a,c){this._userProvider=new f(a);this._localProvider=new d;c=c||"defaults.pref";c.indexOf("://")===-1&&(c=g.toUrl(c));this._defaultsProvider=new e(c);this._serviceRegistration=a.registerService("orion.core.preference",this)}b.prototype={_flush:function(){for(var a=[],c=0;c<this._stores.length;++c){var d=this._stores[c];this._dirty.indexOf(d)!==-1&&
a.push(this._providers[c].put(this._name,d))}this._dirty=[];return k.all(a)},_scheduleFlush:function(a){this._dirty.indexOf(a)===-1&&this._dirty.push(a);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 a=0;a<this._stores.length;++a){var c=this._stores[a],d;for(d in c)c.hasOwnProperty(d)&&typeof this._cached[d]==="undefined"&&(this._cached[d]=
c[d])}}return this._cached},keys:function(){return Object.keys(this._getCached())},get:function(a){return this._getCached()[a]},put:function(a,c){if(this._stores.length!==0){var d=this._stores[0];if(d[a]!==c)d[a]=c,this._cached=null,this._scheduleFlush(d)}},remove:function(a){for(var c=0;c<this._stores.length;++c){var d=this._stores[c];if(d.hasOwnProperty(a))return delete d[a],this._cached=null,this._scheduleFlush(d),!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 c=this,d=[],e=0;e<this._providers.length;++e)d.push(this._providers[e].get(this._name,a).then(function(a){return function(d){c._stores[a]=d}}(e)));return k.all(d).then(function(){c._cached=null;c._getCached()})},flush:function(){this._flush()}};f.prototype={get:function(a,c){if(this._currentPromises[a])return this._currentPromises[a];var d=new k,e=null;
c?this._cache.remove(a):e=this._cache.get(a);if(e!==null)d.resolve(e);else{this._currentPromises[a]=d;var b=this;this._service.get(a).then(function(c){b._cache.set(a,c);delete b._currentPromises[a];d.resolve(c)},function(c){c.status===404?(c={},b._cache.set(a,c),delete b._currentPromises[a],d.resolve(c)):(delete b._currentPromises[a],d.resolve(b._cache.get(a,!0)||{}))})}return d},put:function(a,c){this._cache.set(a,c);return this._service.put(a,c)}};e.prototype={get:function(a,c){if(this._currentPromise)return this._currentPromise;
var d=new k,e=null;c?this._cache.remove(a):e=this._cache.get(a);if(e!==null)d.resolve(e);else{this._currentPromise=d;var b=this;j("GET",this._location,{headers:{"Orion-Version":"1"},timeout:15E3}).then(function(c){c=JSON.parse(c.response);b._cache.set(a,c[a]||{});b._currentPromise=null;d.resolve(c[a]||{})},function(c){c.xhr.status===401||c.xhr.status===404?(b._cache.set(a,{}),b._currentPromise=null,d.resolve({})):(b._currentPromise=null,c=b._cache.get(a,!0),c!==null?d.resolve(c[a]||{}):d.resolve({}))})}return d},
put:function(){var a=new k;a.resolve();return a}};d.prototype={get:function(a){var c=new k,a=this._cache.get(a);a!==null?c.resolve(a):c.resolve({});return c},put:function(a,c){var d=new k;this._cache.set(a,c);d.resolve();return d}};c.DEFAULT_SCOPE=1;c.LOCAL_SCOPE=2;c.USER_SCOPE=4;c.prototype={listenForChangedSettings:function(a){window.addEventListener("storage",a,!1);return"/orion/preferences/local/settings"},getPreferences:function(a,i){if(!i||typeof i!=="number"||i>7||i<1)i=c.DEFAULT_SCOPE|c.LOCAL_SCOPE|
c.USER_SCOPE;var d=[];c.USER_SCOPE&i&&this._userProvider.available()&&d.push(this._userProvider);c.LOCAL_SCOPE&i&&d.push(this._localProvider);c.DEFAULT_SCOPE&i&&d.push(this._defaultsProvider);var e=new b(a,d);return e.sync().then(function(){return e})},getSetting:function(a,c,d){for(var e,b=0;b<a.length;b++)if(a[b].label===c)for(var f=0;f<a[b].data.length;f++)if(a[b].data[f].label===d){e=a[b].data[f].value;break}return e}};return{PreferencesService:c}});
define("orion/pluginregistry",["orion/Deferred","orion/EventTarget"],function(g,k){function j(c,a){var i=Object.keys(c),d=Object.keys(a);if(i.length!==d.length)return!1;i.sort();d.sort();for(var e=0,b=i.length;e<b;e++){var f=i[e];if(f!==d[e])return!1;var m=c[f],f=a[f];if(m!==f&&JSON.stringify(m)!==JSON.stringify(f))return!1}return!0}function b(c){if(c.indexOf("://")===-1){var a=document.createElement("a");a.href=c;return a.href}return c}function h(c){var a=null;return{key:function(i){return(a=a||
Object.keys(c))[i]},getItem:function(a){return c[a]},setItem:function(i,d){c[i]=d;a=null},removeItem:function(i){delete c[i];a=null},clear:function(){(a=a||Object.keys(c)).forEach(function(a){delete c[a]}.bind(this));a=null}}}function f(c,a){return{type:c,plugin:a}}function e(c,a,i){function d(a,m,c){if(!B)return(new g).reject(Error("plugin not connected"));var o=z++,e=new g;e.then(null,function(a){A==="active"&&a instanceof Error&&a.name==="Cancel"&&i.postMessage({id:o,cancel:a.message||"Cancel"},
B)});M[String(o)]=e;i.postMessage({id:o,serviceId:a,method:m,params:c},B);return e.promise}function e(a){var m={};if(a.methods&&(a.methods.forEach(function(c){m[c]=function(){var m=Array.prototype.slice.call(arguments);return A==="active"?d(a.serviceId,c,m):o.start({"transient":!0}).then(function(){return d(a.serviceId,c,m)})}}),m.addEventListener&&m.removeEventListener)){var c=new k;m.dispatchEvent=c.dispatchEvent.bind(c);var i=m.addEventListener;m.addEventListener=function(a,m){c._namedListeners[a]||
i(a);c.addEventListener(a,m)};var b=m.removeEventListener;m.removeEventListener=function(a,m){c.removeEventListener(a,m);c._namedListeners[a]&&b(a)}}return m}function b(a){var m=JSON.parse(JSON.stringify(a.properties));m.__plugin__=c;a=a.names||a.type||[];Array.isArray(a)||(a=[a]);m.objectClass=a;return m}function h(a){var m=e(a),c=b(a),c=i.registerService(a.names||a.type,m,c);D[a.serviceId]={registration:c,proxy:m}}function m(){i.persist(c,{created:x,headers:s,services:v,autostart:u,lastModified:y})}
function r(a){var m;try{if(a.method)if("manifest"===a.method||"plugin"===a.method){var c=a.params[0];E({headers:c.headers,services:c.services}).then(function(){w.resolve(o)})}else if("dispatchEvent"===a.method){var d=D[a.serviceId].proxy;d.dispatchEvent.apply(d,a.params)}else if("progress"===a.method)m=M[String(a.requestId)],m.progress.apply(m,a.params);else if("timeout"===a.method)w&&w.reject(a.error);else throw Error("Bad response method: "+a.method);else if(m=M[String(a.id)],delete M[String(a.id)],
a.error){var e=i.handleServiceError(o,a.error);m.reject(e)}else m.resolve(a.result)}catch(b){console.log("Plugin._responseHandler "+b)}}var o=this,a=a||{},x=a.created||(new Date).getTime(),s=a.headers||{},v=a.services||[],u=a.autostart,y=a.lastModified||0,A="installed",p,w,B,D={},z=0,M={},E;this._persist=m;this._resolve=function(){A="resolved";i.dispatchEvent(new f("resolved",o))};this._getAutostart=function(){return u};this._getCreated=function(){return x};this.getLocation=function(){return c};this.getHeaders=
function(){return JSON.parse(JSON.stringify(s))};this.getName=function(){var a=this.getHeaders();return a?a.name||"":null};this.getVersion=function(){var a=this.getHeaders();return a?a.version||"0.0.0":null};this.getLastModified=function(){return y};this.getServiceReferences=function(){var a=[];Object.keys(D).forEach(function(m){a.push(D[m].registration.getReference())});return a};this.getState=function(){return A};this.start=function(a){if(A==="uninstalled")return(new g).reject(Error("Plugin is uninstalled"));
if(p)return p.promise.then(this.start.bind(this,a));if(A==="active")return(new g).resolve();if(!a||!a["transient"]){var d=a&&a.lazy?"lazy":"started";d!==u&&(u=d,m())}d=i.getState();if(d!=="starting"&&d!=="active")return a["transient"]?(new g).reject(Error("start transient error")):(new g).resolve();if(A==="installed")try{this._resolve()}catch(e){return(new g).reject(e)}A==="resolved"&&v.forEach(function(a){h(a)});if(a&&a.lazy)return A!=="starting"&&(A="starting",i.dispatchEvent(new f("lazy activation",
o))),(new g).resolve();var b=new g;p=b;A="starting";i.dispatchEvent(new f("starting",o));w=new g;B=i.connect(c,r);w.then(function(){w=null;A="active";i.dispatchEvent(new f("started",o));p=null;b.resolve()},function(){w=null;A="stopping";i.dispatchEvent(new f("stopping",o));Object.keys(D).forEach(function(a){D[a].registration.unregister();delete D[a]});i.disconnect(B);B=null;A="resolved";p=null;i.dispatchEvent(new f("stopped",o));b.reject(Error("plugin activation error"))});return b.promise};this.stop=
function(a){if(A==="uninstalled")return(new g).reject(Error("Plugin is uninstalled"));if(p)return p.promise.then(this.stop.bind(this,a));if((!a||!a["transient"])&&"stopped"!==u)u="stopped",m();if(A!=="active"&&A!=="starting")return(new g).resolve();p=a=new g;A="stopping";i.dispatchEvent(new f("stopping",o));Object.keys(D).forEach(function(a){D[a].registration.unregister();delete D[a]});B&&(i.disconnect(B),B=null);A="resolved";p=null;i.dispatchEvent(new f("stopped",o));a.resolve();return a.promise};
E=function(a){if(A==="uninstalled")return(new g).reject(Error("Plugin is uninstalled"));if(!a)return y===0&&(y=(new Date).getTime(),m()),i.loadManifest(c).then(E);var d=s,e=v,l=u;s=a.headers||{};v=a.services||{};u=a.autostart||u;a.lastModified?y=a.lastModified:(y=(new Date).getTime(),m());if(j(s,d)&&j(v,e)&&u===l)return(new g).resolve();if(A==="active"||A==="starting"){var x=[];Object.keys(v).forEach(function(a){var m=v[a];x.push(a);var c=D[a];if(c){if(j(m.methods,Object.keys(c.proxy))){var a=b(m),
i=c.registration.getReference(),d={};i.getPropertyKeys().forEach(function(a){d[a]=i.getProperty(a)});j(a,d)||c.registration.setProperties(a);return}c.registration.unregister();delete D[a]}h(m)});Object.keys(D).forEach(function(a){x.indexOf(a)===-1&&(D[a].registration.unregister(),delete D[a])})}A==="active"&&(i.disconnect(B),w=new g,B=i.connect(c,r),w.then(function(){w=null},function(){w=null;A="stopping";i.dispatchEvent(new f("stopping"),o);Object.keys(D).forEach(function(a){D[a].registration.unregister();
delete D[a]});i.disconnect(B);B=null;A="resolved";i.dispatchEvent(new f("stopped",o))}));return(new g).resolve()};this.update=function(a){return E(a).then(function(){i.dispatchEvent(new f("updated",o))})};this.uninstall=function(){if(A==="uninstalled")return(new g).reject(Error("Plugin is uninstalled"));if(A==="active"||A==="starting"||A==="stopping")return this.stop().then(this.uninstall.bind(this),this.uninstall.bind(this));i.removePlugin(this);A="uninstalled";i.dispatchEvent(new f("uninstalled",
o));return(new g).resolve()}}var d=/^http[s]?/i;return{Plugin:e,PluginRegistry:function(c,a){function i(a){var m=a.source;j.some(function(c){if(m===c.target){if(typeof c.useStructuredClone==="undefined")c.useStructuredClone=typeof a.data!=="string";c.handler(c.useStructuredClone?a.data:JSON.parse(a.data));return!0}})}var a=a||{},l=a.storage||localStorage;l.getItem||(l=h(l));var n="installed",q=[],j=[],m=new k,r={},o={registerService:c.registerService.bind(c),connect:function(m,c,i){function d(a){a=
Error(a);a.name="timeout";c({method:"timeout",error:a})}var o={handler:c,url:m},e=setTimeout(d.bind(null,"Load timeout for: "+m),i||15E3),b=document.createElement("iframe");b.name=m+"_"+(new Date).getTime();if(!a.visible)b.style.display="none",b.style.visibility="hidden";b.src=m;b.onload=function(){clearTimeout(e);setTimeout(d.bind(null,"Plugin handshake timeout for: "+m),5E3)};b.sandbox="allow-scripts allow-same-origin";document.body.appendChild(b);o.target=b.contentWindow;o.close=function(){b&&
(document.body.removeChild(b),b=null)};j.push(o);return o},disconnect:function(a){for(var m=0;m<j.length;m++)if(a===j[m]){j.splice(m,1);try{a.close()}catch(c){}break}},removePlugin:function(a){for(var m=0;m<q.length;m++)if(a===q[m]){q.splice(m,1);break}l.removeItem("plugin."+a.getLocation())},persist:function(a,m){l.setItem("plugin."+a,JSON.stringify(m))},postMessage:function(a,m){m.target.postMessage(m.useStructuredClone?a:JSON.stringify(a),m.url)},dispatchEvent:function(a){try{m.dispatchEvent(a)}catch(c){console&&
console.log("PluginRegistry.dispatchEvent "+c)}},loadManifest:function(a){var m=new g,c=o.connect(a,function(a){c&&a.method&&("manifest"===a.method||"plugin"===a.method?(a=a.params[0],o.disconnect(c),c=null,m.resolve(a)):"timeout"===a.method&&(o.disconnect(c),c=null,m.reject(a.error)))});return m.promise},getState:function(){return n},handleServiceError:function(a,m){if(m&&m.status===401){var c=a.getHeaders(),i=a.getName()||a.getLocation(),o=document.createElement("span");o.appendChild(document.createTextNode("Authentication required for: "+
i+"."));if(c.login)o.appendChild(document.createTextNode(" ")),i=document.createElement("a"),i.target="_blank",i.textContent="Login",i.href=c.login,d.test(i.href)?(o.appendChild(i),o.appendChild(document.createTextNode(" and re-try the request."))):console.log("Illegal Login URL: "+c.login);return{Severity:"Error",HTML:!0,Message:(new XMLSerializer).serializeToString(o)}}if(m.__isError){var e=m,m=Error(e.message);Object.keys(e).forEach(function(a){m[a]=e[a]});delete m.__isError}return m}};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=o.getState;this.init=function(){if(!(n==="starting"||n==="active"||n==="stopping")){addEventListener("message",i,!1);for(var m=[],c=0,d=l.length;c<d;c++)m.push(l.key(c));m.forEach(function(a){if(a.indexOf("plugin.")===0){var m=a.substring(7),a=JSON.parse(l.getItem(a));a.created&&q.push(new e(m,a,o))}});
q.sort(function(a,m){return a._getCreated()<m._getCreated()?-1:1});a.plugins&&Object.keys(a.plugins).forEach(function(m){m=b(m);if(!this.getPlugin(m)){var c=a.plugins[m],c=typeof c==="object"||{};c.autostart=c.autostart||a.defaultAutostart||"lazy";q.push(new e(m,c,o))}}.bind(this));n="starting"}};this.start=function(){n!=="starting"&&this.init();if(n!=="starting")return(new g).reject("Cannot start framework. Framework is already "+n+".");var a=[],m=(new Date).getTime();q.forEach(function(c){var i=
c._getAutostart();c.getLastModified()===0?a.push(c.update().then(function(){if("started"===i)return c.start({"transient":!0});if("lazy"===i)return c.start({lazy:!0,"transient":!0});c._resolve()})):"started"===i?a.push(c.start({"transient":!0})):"lazy"===i?(a.push(c.start({lazy:!0,"transient":!0})),m>c.getLastModified()+864E5&&c.update()):c._resolve()});return g.all(a,function(a){console.log("PluginRegistry.stop "+a)}).then(function(){n="active"})};this.stop=function(){if(n!=="starting"&&n!=="active")return(new g).reject("Cannot stop registry. Registry is already "+
n+".");n="stopping";var a=[];q.forEach(function(m){a.push(m.stop({"transient":!0}))});return g.all(a,function(a){console.log("PluginRegistry.stop "+a)}).then(function(){removeEventListener("message",i);n="resolved"})};this.update=function(){this.stop().then(this.start.bind(this))};this.uninstall=function(){return(new g).reject("Cannot uninstall registry")};this.installPlugin=function(a,m){var a=b(a),c=this.getPlugin(a);if(c)return(new g).resolve(c);if(r[a])return r[a];if(m)return c=new e(a,m,o),q.push(c),
c._persist(),o.dispatchEvent(new f("installed",c)),(new g).resolve(c);var i=o.loadManifest(a).then(function(m){c=new e(a,m,o);q.push(c);c._persist();delete r[a];o.dispatchEvent(new f("installed",c));return c},function(m){delete r[a];throw m;});return r[a]=i};this.getPlugins=function(){return q.slice()};this.getPlugin=function(a){var m=null,a=b(a);q.some(function(c){if(a===c.getLocation())return m=c,!0});return m};this.addEventListener=m.addEventListener.bind(m);this.removeEventListener=m.removeEventListener.bind(m);
this.resolvePlugins=function(){var a=!0;q.forEach(function(m){a=a&&m._resolve()});return a}}}});
define("orion/serviceTracker",[],function(){function g(b,h){function f(a){var i=a.getProperty("service.id"),e=this.addingService(a);e&&(d[i]=a,c[i]=e)}function e(a){var i=a.getProperty("service.id"),e=c[i];delete d[i];delete c[i];this.removedService(a,e)}this.serviceRegistry=b;var d={},c={},a=k,i,l;this.close=function(){if(a!==j)throw"Already closed";a=k;b.removeEventListener("registered",i);b.removeEventListener("unregistering",l);l=i=null;var c=this;this.getServiceReferences().forEach(function(a){e.call(c,
a)});if(typeof this.onClose==="function")this.onClose()};this.getServiceReferences=function(){return d.length?Object.keys(d).map(function(a){return d[a]}):null};this.open=function(){if(a!==k)throw"Already open";a=j;var c=this;i=function(a){if(a.serviceReference.getProperty("objectClass").indexOf(h)!==-1&&(f.call(c,a.serviceReference),typeof c.onServiceAdded==="function"))return c.onServiceAdded(a.serviceReference,c.serviceRegistry.getService(a.serviceReference))};l=function(a){a.serviceReference.getProperty("objectClass").indexOf(h)!==
-1&&e.call(c,a.serviceReference)};b.addEventListener("registered",i);b.addEventListener("unregistering",l);b.getServiceReferences(h).forEach(function(a){f.call(c,a)});if(typeof this.onOpen==="function")this.onOpen()}}var k=0,j=1;g.prototype={addingService:function(b){return this.serviceRegistry.getService(b)},onOpen:null,onClose:null,onServiceAdded:null,removedService:function(){}};return g});
define("orion/config",["orion/Deferred","orion/serviceTracker"],function(g,k){var j,b,h,f,e,d="pid";j=function(a,c,e){function b(a,m,d){m.forEach(function(e,b){try{var l=a[b].getProperty("__plugin__"),f=l&&c.getPlugin(l);(!l||f&&f.getState()==="active")&&m[b].updated(d)}catch(h){typeof console!=="undefined"&&console.log(h)}})}k.call(this,a,"orion.cm.managedservice");var f={},h={},m=function(m){var c=[];m.plugin.getServiceReferences().forEach(function(m){if(m.getProperty("objectClass").indexOf("orion.cm.managedservice")!==
-1){var i=m.getProperty(d),m=a.getService(m);i&&m&&(i=(i=e._find(i))&&i.getProperties(),c.push(m.updated(i)))}});return g.all(c)};this.addingService=function(m){var c=m.getProperty(d),i=a.getService(m);if(!c||!i)return null;f[c]||(f[c]=[]);h[c]||(h[c]=[]);f[c].push(m);h[c].push(i);return i};this.onServiceAdded=function(a,m){var c=a.getProperty(d),c=e._find(c);b([a],[m],c&&c.getProperties())};this.onOpen=function(){c.addEventListener("started",m)};this.onClose=function(){c.removeEventListener("started",
m)};this.notifyUpdated=function(a){var m=a.getPid();b(f[m]||[],h[m]||[],a.getProperties())};this.notifyDeleted=function(a){a=a.getPid();b(f[a]||[],h[a]||[],null)};this.removedService=function(a,m){var c=a.getProperty(d),i=f[c],e=h[c];i.length>1?i.splice(i.indexOf(a),1):delete f[c];e.length>1?e.splice(e.indexOf(m),1):delete h[c]}};b=function(){function a(a,c,d){this.store=new h(this,d);this.configAdmin=new f(this,this.store);this.tracker=new j(a,c,this.store)}a.prototype={getConfigurationAdmin:function(){var a=
this;return this.configAdmin._init().then(function(c){a.tracker.open();return c})},notifyDeleted:function(a){this.tracker.notifyDeleted(a)},notifyUpdated:function(a){this.tracker.notifyUpdated(a)}};return a}();f=function(){function a(a,c){this.factory=a;this.store=c}a.prototype={_init:function(){var a=this;return this.store._init().then(function(){return a})},getConfiguration:function(a){return this.store.get(a)},listConfigurations:function(){return this.store.list()}};return a}();var c="/cm/configurations";
h=function(){function a(a,b){this.factory=a;this.prefsService=b;this.configs=Object.create(null);this.pref=null;var f=this;this.initPromise=this.prefsService.getPreferences(c).then(function(a){f.pref=a;a.keys().forEach(function(c){if(!f.configs[c]){var m=a.get(c);typeof m==="object"&&m!==null&&Object.keys(m).length>0&&(m[d]=c,f.configs[c]=new e(f.factory,f,m))}})})}a.prototype={_init:function(){return this.initPromise},_find:function(a){return this.configs[a]||null},get:function(a){var c=this._find(a);
c||(c=new e(this.factory,this,a),this.configs[a]=c);return c},list:function(){var a=this,c=[];this.pref.keys().forEach(function(d){(d=a._find(d))&&d.getProperties()!==null&&c.push(d)});return c},remove:function(a){this.pref.remove(a);delete this.configs[a]},save:function(a,c){this.pref.put(a,c.getProperties(!0)||{})}};return a}();e=function(){function a(a){for(var c={},i=Object.keys(a),d=0;d<i.length;d++){var m=i[d],e=a[m];c[m]=e instanceof Array?e.slice():e}return c}function c(i,e,b){this.factory=
i;this.store=e;if(b!==null&&typeof b==="object")this.pid=b[d],i=a(b),delete i[d],this.properties=i;else if(typeof b==="string")this.pid=b,this.properties=null;else throw Error("Invalid pid/properties "+b);}c.prototype={_checkRemoved:function(){if(this._removed)throw Error("Configuration was removed");},getPid:function(){this._checkRemoved();return this.pid},getProperties:function(c){this._checkRemoved();var i=null;if(this.properties&&(i=a(this.properties),!c))i[d]=this.pid;return i},remove:function(){this._checkRemoved();
this.factory.notifyDeleted(this);this.store.remove(this.pid);this._removed=!0},update:function(c){this._checkRemoved();c=a(c);delete c[d];this.properties=c;this.store.save(this.pid,this);this.factory.notifyUpdated(this)},toString:function(){return"[ConfigImpl pid: "+this.pid+", properties: "+JSON.stringify(this.properties)+"]"}};return c}();return{ConfigurationAdminFactory:b}});
define("orion/bootstrap","require,orion/Deferred,orion/serviceregistry,orion/preferences,orion/pluginregistry,orion/config".split(","),function(g,k,j,b,h,f){var e;return{startup:function(){if(e)return e;e=new k;var d=window.serviceRegistry=new j.ServiceRegistry,c=new b.PreferencesService(d);return c.getPreferences("/plugins").then(function(a){var i={plugins:{}};a.keys().forEach(function(c){var d=g.toUrl(c);i.plugins[d]=a[c]});var b=window.pluginRegistry=new h.PluginRegistry(d,i);return b.start().then(function(){if(d.getServiceReferences("orion.core.preference.provider").length>
0)return c.getPreferences("/plugins",c.USER_SCOPE).then(function(a){var c=[];a.keys().forEach(function(a){a=g.toUrl(a);b.getPlugin(a)||c.push(b.installPlugin(a,{autostart:"lazy"}).then(function(a){return a.update().then(function(){return a.start({lazy:!0})})}))});return k.all(c,function(a){console.log(a)})})}).then(function(){return(new f.ConfigurationAdminFactory(d,b,c)).getConfigurationAdmin().then(d.registerService.bind(d,"orion.cm.configadmin"))}).then(function(){var a=d.getService("orion.core.auth");
if(a){var c=a.getUser().then(function(m){if(m)localStorage.setItem("lastLogin",(new Date).getTime());else return a.getAuthForm(window.location.href).then(function(a){window.location=a})}),i=localStorage.getItem("lastLogin");if(!i||i<(new Date).getTime()-9E5)return c}}).then(function(){var a={serviceRegistry:d,preferences:c,pluginRegistry:b};e.resolve(a);return a})})}}});
define("orion/webui/littlelib",["require"],function(){function g(d,c){c||(c=document);return c.querySelectorAll(d)}function k(d,c){var a=d.compareDocumentPosition(c);return d===c||Boolean(a&16)}function j(d){if(d.tabIndex>=0)return d;if(d.hasChildNodes())for(var c=0;c<d.childNodes.length;c++){var a=j(d.childNodes[c]);if(a)return a}return null}function b(d){if(d.tabIndex>=0)return d;if(d.hasChildNodes())for(var c=d.childNodes.length-1;c>=0;c--){var a=b(d.childNodes[c]);if(a)return a}return null}function h(d,
c){if(d.nodeType===3){var a=f.exec(d.nodeValue);a&&a.length>1&&d.parentNode.replaceChild(document.createTextNode(c[a[1]]||a[1]),d)}if(d.hasChildNodes())for(a=0;a<d.childNodes.length;a++)h(d.childNodes[a],c)}var f=/\$\{([^\}]+)\}/,e=[];return{$:function(d,c){c||(c=document);return c.querySelector(d)},$$:g,$$array:function(d,c){return Array.prototype.slice.call(g(d,c))},node:function(d){var c=d;typeof d==="string"&&(c=document.getElementById(d));return c},contains:k,bounds:function(d){d=d.getBoundingClientRect();
return{left:d.left+document.body.scrollLeft,top:d.top+document.body.scrollTop,width:d.width,height:d.height}},empty:function(d){for(;d.hasChildNodes();)d.removeChild(d.firstChild)},firstTabbable:j,lastTabbable:b,stop:function(d){window.document.all?d.keyCode=0:(d.preventDefault(),d.stopPropagation())},processTextNodes:h,addAutoDismiss:function(d,c){e.length===0&&document.addEventListener("click",function(a){for(var c=[],d=0;d<e.length;d++){for(var b=e[d].excludeNodes,f=e[d].dismiss,h=!1,m=!0,r=0;r<
b.length;r++)if((h=document.compareDocumentPosition(document,b[r])!==1)&&k(b[r],a.target)){m=!1;break}m&&(f(),h=document.compareDocumentPosition(document,b[r])!==1);h&&c.push(e[d])}e=c},!0);e.push({excludeNodes:d,dismiss:c})},KEY:{BKSPC:8,TAB:9,ENTER:13,ESCAPE:27,SPACE:32,PAGEUP:33,PAGEDOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,INSERT:45,DEL:46}}});
define("orion/nls/root/messages",{Navigator:"Navigator",Sites:"Sites",Repositories:"Repositories",Shell:"Shell","Get Plugins":"Get Plugins",Global:"Global",Editor:"Editor","Orion Editor":"Orion Editor","View on Site":"View on Site","View this file or folder on a web site hosted by Orion":"View this file or folder on a web site hosted by Orion","Show a list of all the keybindings on this page":"Show a list of all the keybindings on this page","Show Keys":"Show Keys","Hide or show the page banner and footer":"Hide or show the page banner and footer",
"Toggle banner and footer":"Toggle banner and footer","Choose a file by name and open an editor on it":"Choose a file by name and open an editor on it","Find File Named...":"Find File Named...","System Configuration Details":"System Configuration Details","System Config Tooltip":"Go to the System Configuration Details page","Background Operations":"Background Operations","Background Operations Tooltip":"Go to the Background Operations page","Operation status is unknown":"Operation status is unknown",
" is already a favorite.":" is already a favorite.","Add to the favorites list":"Add to the favorites list","Make Favorite":"Make Favorite","Unknown item":"Unknown item","Can't search: no search service is available":"Can't search: no search service is available","could not find banner parent, id was ":"could not find banner parent, id was "," has been added to the favorites list.":" has been added to the favorites list.",Related:"Related",Options:"Options",FAQ:"FAQ","Report a Bug":"Report a Bug",
"Privacy Policy":"Privacy Policy","Terms of Use":"Terms of Use","Copyright Agent":"Copyright Agent","Orion Logo":"Orion Logo","Type a keyword or wild card to search in root":"Type a keyword or wild card to search in root","Orion is in Beta. Please try it out but BEWARE your data may be lost.":"Orion build I20130222-1257. See the FAQ for terms of service","Add this page to the favorites list":"Add this page to the favorites list","LOG: ":"LOG: ",Switch:"Switch","Switch the type of outliner used":"Switch the type of outliner used",
Outliner:"Outliner","no parent":"no parent","no tree model":"no tree model","no renderer":"no renderer","could not find table row ":"could not find table row ","Resource is out of sync with the server. Do you want to save it anyway?":"Resource is out of sync with the server. Do you want to save it anyway?","Orion Home":"Orion Home","Operations - Press spacebar to show current operations":"Operations - Press spacebar to show current operations",Operations:"Operations","Operations running":"Operations running",
"Some operations finished with warning":"Some operations finished with warning","Some operations finished with error":"Some operations finished with error","no service registry":"no service registry","Are you sure you want to delete '${0}' from the favorites?":"Are you sure you want to delete '${0}' from the favorites?","Are you sure you want to delete these ${0} favorites?":"Are you sure you want to delete these ${0} favorites?","You can create favorites by selecting any file or folder in the navigator and choosing ${0} from the More menu.":"You can create favorites by selecting any file or folder in the navigator and choosing ${0} from the More menu.",
Tasks:"Tasks",Close:"Close","Expand all":"Expand all","Collapse all":"Collapse all",Search:"Search","Advanced search":"Advanced search",Submit:"Submit",More:"More","Saved searches":"Saved searches","Recent searches":"Recent searches","Open in new tab":"Open in new tab","Regular expression":"Regular expression","Search options":"Search options","Global search":"Global search","Orion Home":"Orion Home","Close notification":"Close notification","Operations - Press spacebar to show current operations":"Operations - Press spacebar to show current operations",
"Type a keyword or wild card to search in root":"Type a keyword or wild card to search in root","Toggle side panel":"Toggle side panel","Open or close the side panel":"Open or close the side panel",Projects:"Projects","Toggle Outliner":"Toggle Outliner","Sample HTML5 Site":"Sample HTML5 Site","Generate an HTML5 'Hello World' website, including JavaScript, HTML, and CSS files.":"Generate an HTML5 'Hello World' website, including JavaScript, HTML, and CSS files.","Sample Orion Plugin":"Sample Orion Plugin",
"Generate a sample plugin for integrating with Orion.":"Generate a sample plugin for integrating with Orion."});define("orion/nls/messages",["orion/i18n!orion/nls/messages","orion/nls/root/messages"],function(g,k){var j={root:k};Object.keys(g).forEach(function(b){typeof j[b]==="undefined"&&(j[b]=g[b])});return j});
define("orion/operations/nls/root/messages",{More:"More","No Matching OperationService for location:":"No Matching OperationService for location:","No operations services registered.":"No operations services registered.","could not find toolbar ":"could not find toolbar ","Remove Completed":"Remove Completed","Remove all completed operations":"Remove all completed operations",Remove:"Remove","Remove operations from the operations list.":"Remove operations from the operations list.",Cancel:"Cancel",
"Cancel operations from the operations list.":"Cancel operations from the operations list.","Operation resulted in a warning.":"Operation resulted in a warning.","Operation resulted in an error.":"Operation resulted in an error.","Operation is running.":"Operation is running.","Operation is canceled.":"Operation is canceled.","Operation failed.":"Operation failed.",Name:"Name",Actions:"Actions",Status:"Status",Scheduled:"Scheduled"});
define("orion/operations/nls/messages",["orion/i18n!orion/operations/nls/messages","orion/operations/nls/root/messages"],function(g,k){var j={root:k};Object.keys(g).forEach(function(b){typeof j[b]==="undefined"&&(j[b]=g[b])});return j});
define("orion/webui/tooltip",["require","orion/webui/littlelib"],function(g,k){function j(b){this._init(b)}j.prototype={_init:function(b){this._node=k.node(b.node);if(!this._node)throw"no dom node for tooltip found";this._position=b.position||["right","above","below","left"];this._text=b.text;this._hideDelay=b.hideDelay===void 0?200:b.hideDelay;this._tailSize=b.tailSize||10;this._trigger=b.trigger||"mouseover";this._afterShowing=b.afterShowing;this._afterHiding=b.afterHiding;var h=this;if(this._trigger===
"click")this._showDelay=0,this._node.addEventListener("click",function(e){e.target===h._node&&(h.show(),k.stop(e))},!1);else if(this._trigger==="mouseover"){this._showDelay=b.showDelay===void 0?1E3:b.showDelay;b=["mouseout","click"];this._node.addEventListener("mouseover",function(e){k.contains(h._node,e.target)&&(h.show(),k.stop(e))},!1);for(var f=0;f<b.length;f++)this._node.addEventListener(b[f],function(e){k.contains(h._node,e.target)&&h.hide()},!1)}},_makeTipNode:function(){if(!this._tip){this._tip=
document.createElement("span");this._tip.classList.add("tooltipContainer");this._tipInner=document.createElement("span");this._tipInner.classList.add("tooltip");this._text&&this._tipInner.appendChild(document.createTextNode(this._text));this._tip.appendChild(this._tipInner);document.body.appendChild(this._tip);var b=this;k.addAutoDismiss([this._tip,this._node],function(){b.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(b._timeout)window.clearTimeout(b._timeout),b._timeout=null;b._tip.addEventListener("mouseout",function(h){k.contains(b._tip,h.target)&&(b.hide(),k.stop(h))},!1)},!1)}return this._tip},_positionTip:function(b,h){this._makeTipNode();if(this._tailBorder)this._tip.removeChild(this._tailBorder),this._tailBorder=null,this._tip.removeChild(this._tail),this._tail=null;b==="left"?this._tipInner.classList.add("left"):
this._tipInner.classList.remove("left");var f=k.bounds(this._node),e=k.bounds(this._tipInner),d;switch(b){case "above":d=f.top-e.height-this._tailSize-1;f=f.left-this._tailSize;break;case "below":d=f.top+f.height+this._tailSize+1;f=f.left-this._tailSize;break;case "left":d=f.top-this._tailSize/2;f=f.left-e.width-this._tailSize-1;break;default:d=f.top-this._tailSize/2,f=f.left+f.width+this._tailSize+1}var c=k.bounds(document.documentElement);if(d+e.height>c.height)if(h)d=c.height-e.height-1;else return!1;
if(f+e.width>c.width)if(h)f=c.width-e.width-1;else return!1;if(f<0)if(h)f=4;else return!1;if(d<0)if(h)d=4;else return!1;this._tailBorder=document.createElement("span");this._tailBorder.classList.add("tooltipTailBorderFrom"+b);this._tail=document.createElement("span");this._tail.classList.add("tooltipTailFrom"+b);b==="above"||b==="left"?(this._tip.appendChild(this._tailBorder),this._tip.appendChild(this._tail)):(this._tip.insertBefore(this._tailBorder,this._tipInner),this._tip.insertBefore(this._tail,
this._tipInner));this._tip.style.top=d+"px";this._tip.style.left=f+"px";this._tip.style.width=e.width+"px";this._tip.style.height=e.height+"px";return!0},contentContainer:function(){this._makeTipNode();return this._tipInner},show:function(){if(!this._tip||!this._tip.classList.contains("tooltipShowing")){var b=this;if(this._timeout)window.clearTimeout(this._timeout),this._timeout=null;this._timeout=window.setTimeout(function(){for(var h=!1,f=0;!h&&f<b._position.length;)h=b._positionTip(b._position[f]),
f++;h||b._positionTip(b._position[0],!0);b._tip.classList.add("tooltipShowing");b._afterShowing&&b._afterShowing()},this._showDelay)}},hide:function(b){if(this._timeout)window.clearTimeout(this._timeout),this._timeout=null;if(this._tip&&this._tip.classList.contains("tooltipShowing")){if(b===void 0)b=this._hideDelay;var h=this;this._timeout=window.setTimeout(function(){h._tip.classList.remove("tooltipShowing");h._afterHiding&&h._afterHiding()},b)}},destroy:function(){if(this._timeout)window.clearTimeout(this._timeout),
this._timeout=null;if(this._tip)document.body.removeChild(this._tip),this._tailBorder=this._tail=this._tipInner=this._tip=null}};j.prototype.constructor=j;return{Tooltip:j}});
define("orion/widgets/nls/root/messages",{"no input":"no input","no output":"no output","Choose a Folder":"Choose a Folder",OK:"OK",Profile:"Profile","Sign out":"Sign out","N/A":"N/A","logged in since ":"logged in since ","Sign in":"Sign in","Authentication required!":"Authentication required!","Name:":"Name:","Plug-ins":"Plug-ins"," <No available services or timed out, check URL and try reloading>":" <No available services or timed out, check URL and try reloading>",Properties:"Properties"," (Service Id: ":" (Service Id: ",
Services:"Services","SFTP Transfer":"SFTP Transfer","Remote host:":"Remote host:","Port:":"SFTP Port:","Remote path:":"Remote path:","User name:":"User name:","Password:":"Password:","Start Transfer":"Start Transfer","Location:":"Location:","orion.sftpConnections":"orion.sftpConnections","Drag a file here":"Drag a file here","unzip zips":"Unzip *.zip files","or if you prefer":"(or upload a file using the buttons below)",Upload:"Upload","Browse...":"Browse...","Import a file or zip":"Import a file or zip",
"Missing required argument: searchRenderer":"Missing required argument: searchRenderer","Missing required argument: favService":"Missing required argument: favService","Find File Named":"Find File Named","Type the name of a file to open (? = any character, * = any string):":"Type the name of a file to open (? = any character, * = any string):",Search:"Search","Populating favorites...":"Populating favorites...",Favorite:"Favorite","Searching...":"Searching...",name:"name","orion.widgets.UserMenu":"orion.widgets.UserMenu",
test:"test","Sign Out":"Sign Out","Sign Out ":"Sign Out ","</a>":"</a>",">":">","Sign In To ":"Sign In To ","Sign In":"Sign In",Help:"Help","Keyboard Shortcuts":"Keyboard Shortcuts",Settings:"Settings","View profile of ":"View profile of ",Profiles:"Profiles","Information Needed":"Information Needed",Cancel:"Cancel","If the same file exists in both the source and destination:":"If the same file exists in both the source and destination:","Cancel the transfer":"Cancel the transfer","Always overwrite destination":"Always overwrite destination",
"Overwrite if source is newer":"Overwrite if source is newer",New:"New","Building file skeleton...":"Building file skeleton...",Add:"Add","Upload...":"Upload...","For a list of available commands type '${0}'.":"For a list of available commands type '${0}'."});define("orion/widgets/nls/messages",["orion/i18n!orion/widgets/nls/messages","orion/widgets/nls/root/messages"],function(g,k){var j={root:k};Object.keys(g).forEach(function(b){typeof j[b]==="undefined"&&(j[b]=g[b])});return j});
define("orion/webui/popupdialog",["i18n!orion/widgets/nls/messages","require","orion/webui/littlelib","orion/webui/tooltip"],function(g,k,j,b){function h(){}h.prototype={_initialize:function(f,e,d,c,a){this._tooltip=new b.Tooltip({node:f,hideDelay:a||0,afterShowing:this._afterShowingFunction(e).bind(this),afterHiding:d,trigger:c?c:"click"});this.$parent=this._tooltip.contentContainer();this.$parent.role="dialog";f=document.createRange();f.selectNode(this.$parent);f=f.createContextualFragment(this.TEMPLATE);
this.messages&&j.processTextNodes(f,g);this.$parent.appendChild(f);var i=this._tooltip;this.$parent.addEventListener("keydown",function(a){a.keyCode===j.KEY.ESCAPE&&i.hide()},!1);this._bindElements(this.$parent);typeof this._bindToDom==="function"&&this._bindToDom(this.$parent)},_bindElements:function(b){for(var e=0;e<b.childNodes.length;e++){var d=b.childNodes[e];d.id&&(this["$"+d.id]=d);this._bindElements(d)}},_afterShowingFunction:function(b){return function(){b&&b.bind(this)();if(!this.customFocus){var e=
j.firstTabbable(this.$parent);e&&e.focus()}}},hide:function(){this._tooltip.hide()},show:function(){this._tooltip.show()}};h.prototype.constructor=h;return{PopupDialog:h}});
define("orion/uiUtils",["i18n!orion/nls/messages","orion/webui/littlelib"],function(g,k){function j(b){var h=window.navigator.platform.indexOf("Mac")!==-1;return h&&b.metaKey||!h&&b.ctrlKey}return{getUserKeyString:function(b){var h="",f=navigator.platform.indexOf("Mac")!==-1;b.mod1&&(h+=f?"Cmd+":"Ctrl+");b.mod2&&(h+="Shift+");b.mod3&&(h+="Alt+");b.mod4&&f&&(h+="Ctrl+");if(b.alphaKey)return h+b.alphaKey;for(var e in k.KEY)if(typeof(k.KEY[e]==="number")&&k.KEY[e]===b.keyCode)return h+e;var d;switch(b.keyCode){case 59:d=
b.mod2?":":";";break;case 61:d=b.mod2?"+":"=";break;case 188:d=b.mod2?"<":",";break;case 190:d=b.mod2?">":".";break;case 191:d=b.mod2?"?":"/";break;case 192:d=b.mod2?"~":"`";break;case 219:d=b.mod2?"{":"[";break;case 220:d=b.mod2?"|":"\\";break;case 221:d=b.mod2?"}":"]";break;case 222:d=b.mod2?'"':"'"}return d?h+d:b.keyCode>=112&&b.keyCode<=123?h+"F"+(b.keyCode-111):h+String.fromCharCode(b.keyCode)},getUserText:function(b,h,f,e,d,c,a,i,l){var n=!1,a=function(a){return function(m){if(!n){var i=k.node(b),
o=i.value;if(i)if(a&&m.keyCode===k.KEY.ESCAPE){if(f)h.style.display="inline";i.parentNode.removeChild(i);n=!0;c&&c()}else if(!(a&&m.keyCode!==k.KEY.ENTER)){if(o.length===0||!l&&o===e){if(f)h.style.display="inline"}else d(o);n=!0;i.parentNode&&i.parentNode.removeChild(i);c&&c()}}}},q=document.createElement("input");q.id=b;q.value=e||"";h.parentNode.insertBefore(q,h.nextSibling);q.classList.add("userEditBoxPrompt");if(f)h.style.display="none";q.addEventListener("keydown",a(!0),!1);q.addEventListener("blur",
a(!1),!1);window.setTimeout(function(){q.focus();if(e){var a=k.node(b),m=i?e.indexOf(i):-1;if(m>0)if(a.createTextRange)a=a.createTextRange(),a.collapse(!0),a.moveStart("character",0),a.moveEnd("character",m),a.select();else if(a.setSelectionRange)a.setSelectionRange(0,m);else{if(a.selectionStart!==void 0)a.selectionStart=0,a.selectionEnd=m}else a.select()}},0)},openInNewWindow:j,followLink:function(b,h){h&&j(h)?window.open(b):window.location=b},createButton:function(b,h){var f=document.createElement("span");
f.role="button";f.tabIndex=0;f.appendChild(document.createTextNode(b));f.className="commandButton commandMargins";f.addEventListener("click",function(e){h();k.stop(e)},!1);f.addEventListener("keydown",function(e){if(e.keyCode===k.KEY.ENTER||e.keyCode===k.KEY.SPACE)h(),k.stop(e)},!1);return f}}});
define("orion/webui/dropdown",["require","orion/webui/littlelib"],function(g,k){function j(b){this._init(b)}j.prototype={_init:function(b){this._dropdownNode=k.node(b.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=b.populate;var h=this;this._triggerNode.addEventListener("click",function(b){h.toggle()&&k.stop(b)},!1);this._triggerNode.tagName.toLowerCase()===
"span"&&this._triggerNode.addEventListener("keydown",function(b){if(b.keyCode===k.KEY.ENTER||b.keyCode===k.KEY.SPACE)h.toggle(),k.stop(b)},!1);this._dropdownNode.addEventListener("keydown",this._dropdownKeyDown.bind(this),!1)},toggle:function(){return this._triggerNode.classList.contains("dropdownTriggerOpen")?this.close():this.open()},open:function(){this._populate&&(this.empty(),this._populate(this._dropdownNode));var b=this.getItems();if(b.length>0){if(!this._hookedAutoDismiss)k.addAutoDismiss([this._triggerNode,
this._dropdownNode],this.close.bind(this)),this._hookedAutoDismiss=!0;this._positionDropdown();this._triggerNode.classList.add("dropdownTriggerOpen");this._dropdownNode.classList.add("dropdownMenuOpen");b[0].focus();return!0}return!1},_positionDropdown:function(){this._dropdownNode.style.left="";var b=k.bounds(this._dropdownNode),h=k.bounds(this._boundingNode(this._triggerNode));if(b.left+b.width>h.left+h.width)this._dropdownNode.style.right=0},_boundingNode:function(b){return b.style.right!==""||
b.style.position==="absolute"||!b.parentNode||!b.parentNode.style?b:this._boundingNode(b.parentNode)},close:function(b){this._triggerNode.classList.remove("dropdownTriggerOpen");this._dropdownNode.classList.remove("dropdownMenuOpen");b&&this._triggerNode.focus();return!0},getItems:function(){var b=[],h=this;k.$$array("li:not(.dropdownSeparator) > .dropdownMenuItem",this._dropdownNode,!0).forEach(function(f){f.parentNode.parentNode===h._dropdownNode&&b.push(f)});return b},empty:function(){var b=this;
k.$$array("li",this._dropdownNode).forEach(function(h){h.parentNode===b._dropdownNode&&h.parentNode.removeChild(h)})},_dropdownKeyDown:function(b){if(b.keyCode===k.KEY.UP||b.keyCode===k.KEY.DOWN||b.keyCode===k.KEY.RIGHT||b.keyCode===k.KEY.ENTER||b.keyCode===k.KEY.LEFT){var h=this.getItems(),f=document.activeElement;if(h.length&&h.length>0&&f){var e=h.indexOf(f);e>=0&&(b.keyCode===k.KEY.UP&&e>0?(e--,h[e].focus()):b.keyCode===k.KEY.DOWN&&e<h.length-1?(e++,h[e].focus()):b.keyCode===k.KEY.ENTER||b.keyCode===
k.KEY.RIGHT?f.classList.contains("dropdownTrigger")&&f.dropdown&&f.dropdown.open():b.keyCode===k.KEY.LEFT&&f.parentNode.parentNode.classList.contains("dropdownMenuOpen")&&this.close(!0),k.stop(b))}}else b.keyCode===k.KEY.ESCAPE&&(this.close(!0),k.stop(b))}};j.prototype.constructor=j;return{Dropdown:j}});
define("orion/explorers/navigationUtils",[],function(){function g(g,b){if(!k&&g)g.push({domNode:b}),b.tabIndex=-1,b.style.outline="none"}var k=navigator.userAgent.indexOf("iPad")!==-1;return{addNavGrid:function(j,b,h){j&&(j=j.getGridNavHolder(b,!0))&&g(j,h)},generateNavGrid:g,removeNavGrid:function(g,b){if(g)for(var h=0;h<g.length;h++)if(g[h].domNode===b){g.splice(h,1);break}}}});
define("orion/dialogs",[],function(){function g(g){this._serviceRegistry=g;this._serviceRegistration=g.registerService("orion.page.dialog",this)}g.prototype={confirm:function(g,j){j(window.confirm(g))},openFiles:function(){}};g.prototype.constructor=g;return{DialogService:g}});
define("orion/selection",["orion/EventTarget"],function(g){function k(j,b){b||(b="orion.page.selection");this._serviceRegistry=j;g.attach(this);this._serviceRegistration=j.registerService(b,this);this._selections=null}k.prototype={getSelection:function(g){g(this._getSingleSelection())},getSelections:function(g){g(this._selections||[])},_getSingleSelection:function(){return this._selections&&this._selections.length>0?this._selections[0]:null},setSelections:function(g){var b=this._selections;this._selections=
Array.isArray(g)?g.length>0?g:null:g?[g]:null;b!==this._selections&&this.dispatchEvent({type:"selectionChanged",selection:this._getSingleSelection(),selections:this._selections})}};k.prototype.constructor=k;return{Selection:k}});
define("orion/i18nUtil",["require","orion/Deferred"],function(g,k){function j(b){if(b=localStorage.getItem("orion/messageBundle/"+b))if(b=JSON.parse(b),b._expires&&b._expires>(new Date).getTime())return delete b._expires,b;return null}var b={};return{getMessageBundle:function(h){function f(){g(["i18n!"+h],function(a){if(a){var c=h;a._expires=(new Date).getTime()+9E5;localStorage.setItem("orion/messageBundle/"+c,JSON.stringify(a));delete a._expires}e.resolve(a)})}if(b[h])return b[h];var e=new k;b[h]=
e;var d=j(h);if(d)return e.resolve(d),e;try{g([h],f)}catch(c){g(["orion/i18n!"+h],f)}return e},formatMessage:function(b){var f=arguments;return b.replace(/\$\{([^\}]+)\}/g,function(b,d){return f[(d<<0)+1]})}}});
define("orion/navigate/nls/root/messages",{"Click one of the tasks below to create an Orion folder.  You can upload, import, or generate files.":"Click one of the tasks below to create an Orion folder.  You can upload, import, or generate files.","Toggle Left Pane":"Toggle Left Pane","Open or close the left pane":"Open or close the left pane",Navigator:"Navigator","Strings Xtrnalizr":"Strings Xtrnalizr","Externalize Strings from JavaScript files in this folder":"Externalize Strings from JavaScript files in this folder",
"Choose a Folder":"Choose a Folder","Copy of ${0}":"Copy of ${0}","Enter a new name for '${0}'":"Enter a new name for '${0}'","Choose folder...":"Choose folder...",Rename:"Rename","Rename the selected files or folders":"Rename the selected files or folders","Compare with each other":"Compare with each other","Compare the selected 2 files with each other":"Compare the selected 2 files with each other","Compare with...":"Compare with...","Compare the selected folder with a specified folder":"Compare the selected folder with a specified folder",
Delete:"Delete","Unknown item":"Unknown item","Make Favorite":"Make Favorite","Delete the selected files or folders":"Delete the selected files or folders","Are you sure you want to delete these ${0} items?":"Are you sure you want to delete these ${0} items?","Are you sure you want to delete '${0}'?":"Are you sure you want to delete '${0}'?","Are you sure you want to delete '${0}' from the favorites?":"Are you sure you want to delete '${0}' from the favorites?","Are you sure you want to delete these ${0} favorites?":"Are you sure you want to delete these ${0} favorites?",
"You can create favorites by selecting any file or folder in the navigator and choosing ${0} from the ${1} menu.":"You can create favorites by selecting any file or folder in the navigator and choosing ${0} from the ${1} menu.","Export as zip":"Export as zip","Create a zip file of the folder contents and download it":"Create a zip file of the folder contents and download it","New File":"New File","Create a new file":"Create a new file","Name:":"Name:","New Folder":"New Folder","Folder name:":"Folder name:",
"Create a new folder":"Create a new folder","Creating folder":"Creating folder",Folder:"Folder","Create an empty folder":"Create an empty folder","Create an empty folder on the Orion server.  You can import, upload, or create content in the editor.":"Create an empty folder on the Orion server.  You can import, upload, or create content in the editor.","Sample HTML5 Site":"Sample HTML5 Site","Generate a sample":"Generate a sample",'Generate an HTML5 "Hello World" website, including JavaScript, HTML, and CSS files.':'Generate an HTML5 "Hello World" website, including JavaScript, HTML, and CSS files.',
"Creating a folder for ${0}":"Creating a folder for ${0}","SFTP Import":"SFTP Import","Import content from SFTP":"Import content from SFTP","Import content from an SFTP location into an Orion folder.  You will be prompted for the SFTP location and credentials.":"Import content from an SFTP location into an Orion folder.  You will be prompted for the SFTP location and credentials.","Imported Content":"Imported Content","Upload a Zip":"Upload a Zip","Upload content from a local zip file":"Upload content from a local zip file",
"Upload content from a local zip file into an Orion folder.  You will be prompted for the local zip file.":"Upload content from a local zip file into an Orion folder.  You will be prompted for the local zip file.","Uploaded Content":"Uploaded Content","Creating an upload folder for ":"Creating an upload folder for ","Clone Git Repository":"Clone Git Repository","Clone a git repository":"Clone a git repository","Go to the Orion repositories page to provide a git repository URL.  Once the repository is created, it will appear in the Navigator.":"Go to the Orion repositories page to provide a git repository URL.  Once the repository is created, it will appear in the Navigator.",
"Link to Server":"Link to Server","Link to existing content on the server":"Link to existing content on the server","Create a folder that links to an existing folder on the server.":"Create a folder that links to an existing folder on the server.","Server path:":"Server path:","The name and server location were not specified.":"The name and server location were not specified.","Go Up":"Go Up","Move up to the parent folder":"Move up to the parent folder","Import local file...":"Import local file...",
"Copy files and folders from your local file system":"Copy files and folders from your local file system","SFTP from...":"SFTP from...","Copy files and folders from a specified SFTP connection":"Copy files and folders from a specified SFTP connection","Importing from ${0}":"Importing from ${0}","SFTP to...":"SFTP to...","Copy files and folders to a specified SFTP location":"Copy files and folders to a specified SFTP location","Exporting from ${0}":"Exporting from ${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","Click on an item to make a selection, then use this menu to see what actions are available.":"Click on an item to make a selection, then use this menu to see what actions are available.",Actions:"Actions","Orion Content":"Orion Content"," is not supported in this file system":" is not supported in this file system","Create new content":"Create new content",Favorites:"Favorites",
"Import from HTTP...":"Import from HTTP...","File URL:":"File URL:","Copy a file from a URL and optionally unzip it":"Copy a file from a URL and optionally unzip it","Unzip *.zip files:":"Unzip *.zip files:","Extracted from:":"Extracted from:","Did not drop ${0}.  Folder drop is not supported in this browser.":"Did not drop ${0}.  Folder drop is not supported in this browser.","You cannot copy files directly into the workspace.  Create a folder first.":"You cannot copy files directly into the workspace.  Create a folder first.",
"Unzip ${0}?":"Unzip ${0}?"});define("orion/navigate/nls/messages",["orion/i18n!orion/navigate/nls/messages","orion/navigate/nls/root/messages"],function(g,k){var j={root:k};Object.keys(g).forEach(function(b){typeof j[b]==="undefined"&&(j[b]=g[b])});return j});
define("orion/fileClient",["i18n!orion/navigate/nls/messages","orion/Deferred","orion/i18nUtil"],function(g,k,j){function b(b,d,c){if(!b[d])throw d+g[" is not supported in this file system"];return b[d].apply(b,c)}function h(e,d,c,a){if(!e.readBlob)throw g["source file service does not support binary read"];if(!c.writeBlob)throw g["target file service does not support binary write"];if(d[d.length-1]!=="/")return b(e,"readBlob",[d]).then(function(i){return b(c,"writeBlob",[a,i])});var i=a.substring(0,
a.length-1),l=decodeURIComponent(i.substring(i.lastIndexOf("/")+1)),i=i.substring(0,i.lastIndexOf("/")+1);return b(c,"createFolder",[i,l]).then(function(){},function(){}).then(function(){return b(e,"fetchChildren",[d]).then(function(i){for(var d=[],b=0;b<i.length;++b){var m=i[b].Location,r=m;i[b].Directory&&(r=m.substring(0,m.length-1));r=decodeURIComponent(r.substring(r.lastIndexOf("/")+1));r=a+encodeURIComponent(r);i[b].Directory&&(r+="/");d[b]=h(e,m,c,r)}return k.all(d)})})}function f(b,d){function c(a){var m=
new k;m.reject(g["No Matching FileService for location:"]+a);return m}var a=b.getServiceReferences("orion.core.file"),i=a;if(d)for(var i=[],l=0;l<a.length;++l)d(a[l])&&i.push(a[l]);for(var f=[],h=[],t=[],m=[],r={fetchChildren:function(){var a=new k;a.resolve(m);return a},createWorkspace:function(){var a=new k;a.reject(g["no file service"]);return a},loadWorkspaces:function(){var a=new k;a.reject(g["no file service"]);return a},loadWorkspace:function(){var a=new k;window.setTimeout(function(){a.resolve({Directory:!0,
Length:0,LocalTimeStamp:0,Name:g["File Servers"],Location:"/",Children:m,ChildrenLocation:"/"})},100);return a},search:c,createProject:c,createFolder:c,createFile:c,deleteFile:c,moveFile:c,copyFile:c,read:c,write:c},a=0;a<i.length;++a)m[a]={Directory:!0,Length:0,LocalTimeStamp:0,Location:i[a].getProperty("top"),ChildrenLocation:i[a].getProperty("top"),Name:i[a].getProperty("Name")},l=i[a].getProperty("pattern")||".*",l[0]!=="^"&&(l="^"+l),f[a]=RegExp(l),h[a]=b.getService(i[a]),t[a]=i[a].getProperty("Name"),
i[a].getProperty("NameKey")&&i[a].getProperty("nls")&&j.getMessageBundle(i[a].getProperty("nls")).then(function(a,c){m[a].Name=c[i[a].getProperty("NameKey")];t[a]=c[i[a].getProperty("NameKey")]}.bind(this,a));this._getServiceIndex=function(a){if(a==="/")return-1;else if(!a||a.length&&a.length===0)return h[0]?0:-1;for(var m=0;m<f.length;++m)if(f[m].test(a))return m;throw g["No Matching FileService for location:"]+a;};this._getService=function(a){a=this._getServiceIndex(a);return a===-1?r:h[a]};this._getServiceName=
function(a){a=this._getServiceIndex(a);return a===-1?r.Name:t[a]};this._getServiceRootURL=function(a){a=this._getServiceIndex(a);return a===-1?r.Location:m[a].Location}}f.prototype={getService:function(b){return this._getService(b)},fileServiceName:function(b){return this._getServiceName(b)},fileServiceRootURL:function(b){return this._getServiceRootURL(b)},fetchChildren:function(e){return b(this._getService(e),"fetchChildren",arguments)},createWorkspace:function(e){return b(this._getService(),"createWorkspace",
arguments)},loadWorkspaces:function(){return b(this._getService(),"loadWorkspaces",arguments)},loadWorkspace:function(e){return b(this._getService(e),"loadWorkspace",arguments)},createProject:function(e,d,c,a){return b(this._getService(e),"createProject",arguments)},createFolder:function(e,d){return b(this._getService(e),"createFolder",arguments)},createFile:function(e,d){return b(this._getService(e),"createFile",arguments)},deleteFile:function(e){return b(this._getService(e),"deleteFile",arguments)},
moveFile:function(e,d,c){var a=this._getService(e),i=this._getService(d);if(a===i)return b(a,"moveFile",arguments);var l=e[e.length-1]==="/",f=d;f[f.length-1]!=="/"&&(f+="/");if(c)f+=encodeURIComponent(c);else{var q=e;l&&(q=q.substring(0,q.length-1));f+=q.substring(q.lastIndexOf("/")+1)}l&&f[f.length-1]!=="/"&&(f+="/");return h(a,e,i,f).then(function(){return b(a,"deleteFile",[e])})},copyFile:function(e,d,c){var a=this._getService(e),i=this._getService(d);if(a===i)return b(a,"copyFile",arguments);
var l=e[e.length-1]==="/",f=d;f[f.length-1]!=="/"&&(f+="/");if(c)f+=encodeURIComponent(c);else{var q=e;l&&(q=q.substring(0,q.length-1));f+=q.substring(q.lastIndexOf("/")+1)}l&&f[f.length-1]!=="/"&&(f+="/");return h(a,e,i,f)},read:function(e,d){return b(this._getService(e),"read",arguments)},write:function(e,d,c){return b(this._getService(e),"write",arguments)},remoteImport:function(e,d){return b(this._getService(e),"remoteImport",arguments)},remoteExport:function(e,d){return b(this._getService(e),
"remoteExport",arguments)},search:function(e){return b(this._getService(e.resource),"search",arguments)}};f.prototype.constructor=f;return{FileClient:f}});
define("orion/operationsClient",["i18n!orion/operations/nls/messages","orion/Deferred"],function(g,k){function j(b,d,c){return b[d].apply(b,c)}function b(b){this._location=b}function h(){var b=new k;b.reject(g["No Matching OperationService for location:"]+this._location);return b}function f(e){this._services=[];this._patterns=[];this._operationListeners=[];this._currentLongpollingIds=[];this._preferenceService=e.getService("orion.core.preference");for(var d=e.getServiceReferences("orion.core.operation"),
c=0;c<d.length;c++){var a=e.getService(d[c]);this._services[c]=a;a=d[c].getProperty("pattern")||".*";a[0]!=="^"&&(a="^"+a);this._patterns[c]=RegExp(a)}this._getService=function(a){if(!a)return this._services[0];for(var c=0;c<this._patterns.length;++c)if(this._patterns[c].test(a))return this._services[c];return new b(a)}}b.prototype={getOperation:h,getOperations:h,removeCompletedOperations:h,removeOperation:h,cancelOperation:h};b.prototype.constructor=b;f.prototype={getOperations:function(){var b=
new k;if(this._operations)return b.resolve(this._operations),b;var d=this;this._preferenceService.getPreferences("/operations").then(function(c){d._operations=c;b.resolve(d._operations)});return b},getOperation:function(b){return j(this._getService(b),"getOperation",arguments)},removeCompletedOperations:function(){for(var b=[],d=this,c=0;c<this._services.length;c++){var a=this._patterns[c],i=new k;b[c]=i.promise;j(this._services[c],"removeCompletedOperations").then(function(c){return function(i){Array.isArray(i)&&
d.getOperations.bind(d)().then(function(d){for(var b=d.keys(),m=0;m<b.length;m++){var e=b[m];a.test(e)&&i.indexOf(e)<0&&d.remove(e)}c.resolve()})}}(i),function(a){return function(c){a.reject(c)}}(i))}return k.all(b)},removeOperation:function(b){var d=this;return j(this._getService(b),"removeOperation",arguments).then(function(){d.getOperations.bind(d)().then(function(c){c.remove(b)})},function(c){return c},function(c){return c})}};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","Case sensitive":"Case sensitive","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",
"Not found":"Not found","Replacing all...":"Replacing all..."," matches":" matches","Replaced ":"Replaced ","Nothing replaced":"Nothing replaced","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.","Save Search":"Save Search","Save search query":"Save search query",
"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","Search Again":"Search Again","Search again":"Search again","< 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",Searches:"Searches","You can save frequently used by searches by choosing ${0} in the search toolbar.":"You can save frequently used by searches by choosing ${0} in the search toolbar."});define("orion/search/nls/messages",["orion/i18n!orion/search/nls/messages","orion/search/nls/root/messages"],function(g,k){var j={root:k};Object.keys(g).forEach(function(b){typeof j[b]==="undefined"&&(j[b]=g[b])});return j});
define("orion/editor/regex",[],function(){return{escape:function(g){return g.replace(/([\\$\^*\/+?\.\(\)|{}\[\]])/g,"\\$&")},parse:function(g){return(g=/^\s*\/(.+)\/([gim]{0,3})\s*$/.exec(g))?{pattern:g[1],flags:g[2]}:null}}});
define("orion/URITemplate",[],function(){function g(c){this._text=c}function k(c,a){if(a==="U")return encodeURIComponent(c).replace(/[!'()*]/g,function(a){return"%"+a.charCodeAt(0).toString(16).toUpperCase()});if(a==="U+R")return encodeURI(c).replace(/%5B/g,"[").replace(/%5D/g,"]");if(a==="U+R-,")return encodeURI(c).replace(/%5B/g,"[").replace(/%5D/g,"]").replace(/,/g,"%2C");throw Error("Unknown allowed character set: "+a);}function j(c,a,i){for(var d=[],b=0;b<c.length;b++)typeof c[b]!=="undefined"&&
d.push(k(c[b],a));return d.join(i)}function b(c,a,i,d){for(var b=Object.keys(c),e=[],f=0;f<b.length;f++)typeof c[b[f]]!=="undefined"&&e.push(k(b[f],a)+i+k(c[b[f]],a));return e.join(d)}function h(c){if(c.length===0)throw Error("Invalid Expression: 0 length expression");(this._operator=e[c[0]])?c=c.substring(1):this._operator=e.NUL;for(var a=[],i=c.split(","),b=0;b<i.length;b++){var f=i[b].match(d);if(f===null)throw Error("Bad VarSpec: "+c);a.push({name:f[1],explode:!!f[2],prefix:f[3]?parseInt(f[3],
10):-1})}this._varSpecList=a}function f(c){for(var a=[],i=0,d=c.indexOf("{",i);d!==-1;){a.push(new g(c.substring(i,d)));i=c.indexOf("}",d+1);if(i===-1)throw Error("Invalid template: "+c);a.push(new h(c.substring(d+1,i)));i+=1;d=c.indexOf("{",i)}a.push(new g(c.substring(i)));this._templateComponents=a}var e={NUL:{first:"",sep:",",named:!1,ifemp:"",allow:"U"},"+":{first:"",sep:",",named:!1,ifemp:"",allow:"U+R"},".":{first:".",sep:",",named:!1,ifemp:"",allow:"U"},"/":{first:"/",sep:"/",named:!1,ifemp:"",
allow:"U"},";":{first:";",sep:";",named:!0,ifemp:"",allow:"U"},"?":{first:"?",sep:"&",named:!0,ifemp:"=",allow:"U"},"&":{first:"&",sep:"&",named:!0,ifemp:"=",allow:"U"},"#":{first:"#",sep:",",named:!1,ifemp:"",allow:"U+R"},",":{first:"",sep:",",named:!1,ifemp:"",allow:"U+R-,"}},d=/^((?:(?:[a-zA-Z0-9_])|(?:%[0-9A-F][0-9A-F]))(?:(?:[a-zA-Z0-9_.])|(?:%[0-9A-F][0-9A-F]))*)(?:(\*)|:([0-9]+))?$/;g.prototype={expand:function(){return encodeURI(this._text)}};h.prototype={expand:function(c){for(var a=[],i=
0;i<this._varSpecList.length;i++){var d=this._varSpecList[i],e=d.name,f=c[e],h=typeof f;if(h!=="undefined"&&f!==null){var m=a.length===0?this._operator.first:this._operator.sep;if(h==="string")this._operator.named&&(m+=k(e,"U+R"),m+=f.length===0?this._operator.ifemp:"="),d.prefix!==-1&&d.prefix<f.length&&(f=f.substring(0,d.prefix)),m+=k(f,this._operator.allow);else if(Array.isArray(f))d.explode?m+=j(f,this._operator.allow,this._operator.sep):(this._operator.named&&(m+=k(e,"U+R"),m+=f.length===0?this._operator.ifemp:
"="),m+=j(f,this._operator.allow,","));else if(h==="object")d.explode?m+=b(f,this._operator.allow,"=",this._operator.sep):(this._operator.named&&(m+=k(e,"U+R"),m+=Object.keys(f).length===0?this._operator.ifemp:"="),m+=b(f,this._operator.allow,",",","));else throw Error("bad param type: "+e+" : "+h);a.push(m)}}return a.join("")}};f.prototype={expand:function(c){for(var a=[],d=0;d<this._templateComponents.length;d++)a.push(this._templateComponents[d].expand(c));return a.join("")}};return 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?"});
define("orion/crawler/nls/messages",["orion/i18n!orion/crawler/nls/messages","orion/crawler/nls/root/messages"],function(g,k){var j={root:k};Object.keys(g).forEach(function(b){typeof j[b]==="undefined"&&(j[b]=g[b])});return j});
define("orion/parameterCollectors",["i18n!orion/nls/messages","require","orion/webui/littlelib"],function(g,k,j){function b(b,f){this._activeContainer=null;this._getElementsFunction=b;this._toolbarLayoutFunction=f}b.prototype={close:function(){if(this._activeElements){this._activeElements.parameterArea&&j.empty(this._activeElements.parameterArea);this._activeElements.slideContainer&&this._activeElements.slideContainer.classList.remove("slideContainerActive");this._activeElements.dismissArea&&j.empty(this._activeElements.dismissArea);
this._activeElements.commandNode&&this._activeElements.commandNode.classList.remove("activeCommand");this._toolbarLayoutFunction(this._activeElements);if(this._activeElements.onClose)this._activeElements.onClose();if(this._oldFocusNode)this._oldFocusNode.focus(),this._oldFocusNode=null}this._activeElements=null},open:function(b,f,e){typeof b==="string"&&(b=j.node(b));if(this._activeElements&&this._activeElements.slideContainer&&this._activeElements.commandNode===b)return this._activeElements.focusNode&&
this._activeElements.focusNode.focus(),!0;this.close();this._activeElements=null;if((this._activeElements=this._getElementsFunction(b))&&this._activeElements.parameterArea&&this._activeElements.slideContainer){this._activeElements.onClose=e;var d=f(this._activeElements.parameterArea,this._activeElements.dismissArea);if(!d)return!1;this._activeElements.focusNode=d;b=j.$$array("#closebox",this._activeElements.dismissArea||this._activeElements.parameterArea);if(b.length===0){f=this._activeElements.dismissArea||
this._activeElements.parameterArea;b=document.createElement("span");b.id="closebox";b.role="button";b.tabIndex=0;b.classList.add("imageSprite");b.classList.add("core-sprite-close");b.classList.add("dismiss");b.title=g.Close;f.appendChild(b);var c=this;b.addEventListener("click",function(){c.close()},!1);b.addEventListener("keydown",function(a){(a.keyCode===j.KEY.ENTER||a.keyCode===j.KEY.SPACE)&&c.close()},!1)}this._activeElements.slideContainer.classList.add("slideContainerActive");this._toolbarLayoutFunction(this._activeElements);
if(d)this._oldFocusNode=window.document.activeElement,window.setTimeout(function(){d.focus();d.select()},0);this._activeElements.commandNode&&this._activeElements.commandNode.classList.add("activeCommand");return!0}return!1},_collectAndCall:function(b,f){j.$$array("input",f).forEach(function(e){e.type==="checkbox"?b.parameters.setValue(e.parameterName,e.checked):e.type!=="button"&&b.parameters.setValue(e.parameterName,e.value.trim())});j.$$array("textArea",f).forEach(function(e){b.parameters.setValue(e.parameterName,
e.value.trim())});b.command.callback&&b.command.callback.call(b.handler,b)},collectParameters:function(b){return b.parameters?(b.domNode&&b.domNode.classList.add("commandMarker"),this.open(b.domNode||b.domParent,this.getFillFunction(b))):!1},getFillFunction:function(b,f){var e=this;return function(d,c){var a=null,i=function(){f&&f();e.close()},l=function(a){a.keyCode===j.KEY.ENTER&&e._collectAndCall(b,d);if(a.keyCode===j.KEY.ESCAPE||a.keyCode===j.KEY.ENTER)i(),j.stop(a)};b.parameters.forEach(function(c){var m=
null;if(c.label)m=document.createElement("label"),m.classList.add("parameterInput"),m.setAttribute("for",c.name+"parameterCollector"),m.textContent=c.label,d.appendChild(m);var b=c.name+"parameterCollector",e=m||d;if(c.type==="text"&&typeof c.lines==="number"&&c.lines>1)m=document.createElement("textarea"),m.rows=c.lines,m.type="textarea",m.id=b,e.appendChild(m),l=function(a){a.keyCode===j.KEY.ESCAPE&&(i(),j.stop(a))};else if(c.type==="boolean"){if(m=document.createElement("input"),m.type="checkbox",
m.id=b,e.appendChild(m),c.value)m.checked=!0}else if(m=document.createElement("input"),m.type=c.type,m.id=b,e.appendChild(m),c.value)m.value=c.value;m.classList.add("parameterInput");m.classList.add("parameterInput"+m.type);m.setAttribute("speech","speech");m.setAttribute("x-webkit-speech","x-webkit-speech");m.parameterName=c.name;a||(a=m);m.addEventListener("keydown",l,!1)});var n=c;if(!n)n=document.createElement("span"),n.className="layoutRight parametersDismiss",d.appendChild(n);var q=function(a){a._collectAndCall(b,
d);i()},k=function(a,m){var c=document.createElement("span");c.role="button";c.tabIndex=0;m.appendChild(c);a&&c.appendChild(document.createTextNode(a));c.classList.add("dismiss");return c};if(b.parameters.hasOptionalParameters()){b.parameters.optionsRequested=!1;var m=k(g.More,n);m.addEventListener("click",function(){b.parameters.optionsRequested=!0;q(e)},!1);m.addEventListener("keydown",function(a){if(a.keyCode===j.KEY.ENTER||a.keyCode===j.KEY.SPACE)b.parameters.optionsRequested=!0,q(e)},!1)}m=k(g.Submit,
n);m.addEventListener("click",function(){q(e)},!1);m.addEventListener("keydown",function(a){(a.keyCode===j.KEY.ENTER||a.keyCode===j.KEY.SPACE)&&q(e)},!1);n=k(null,n);n.id="closebox";n.classList.add("imageSprite");n.classList.add("core-sprite-close");n.title=g.Close;n.addEventListener("click",function(){i()},!1);n.addEventListener("keydown",function(a){(a.keyCode===j.KEY.ENTER||a.keyCode===j.KEY.SPACE)&&i()},!1);return a}}};b.prototype.constructor=b;return{CommandParameterCollector:b}});
(function(){function g(a){return a?a.slice(1).split("&"):[]}function k(a){return a.length===0?"":"?"+a.join("&")}function j(a){var c=/([^=]*)(?:=?)(.*)/.exec(a),a=c[1]?decodeURIComponent(c[1]):"",c=c[2]?decodeURIComponent(c[2]):"";return[a,c]}function b(a){var c=encodeURIComponent(a[0]);a[1]&&(c+="="+encodeURIComponent(a[1]));return c}function h(a,c){var b="",m=[],d=0;return{next:function(){if(b!==a.search)b=a.search,m=g(b);if(d<m.length){var i=j(m[d++]);switch(c){case "keys":return i[0];case "values":return i[1];
case "keys+values":return[i[0],i[1]];default:throw new TypeError;}}throw l;}}}function f(a){if(typeof a!=="string")throw new TypeError;}function e(a){var c=a.protocol;return!c||c===":"||c==="http:"&&!a.hostname?!1:!0}function d(a){Object.defineProperty(this,"_anchor",{value:a})}function c(a,c){a=a||"";if(typeof a!=="string")throw new TypeError("url");c=c?c.href||c:"";if(typeof c!=="string")throw new TypeError("base");Object.defineProperty(this,"_input",{value:a,writable:!0});var b=document.implementation.createHTMLDocument("");
if(c){var m=b.createElement("a");m.href=c;if(m.protocol.length<2||!m.host)throw Error("InvalidStateError");var i=b.createElement("base");i.href=m.href;b.head.appendChild(i)}var o=b.createElement("a");o.href=a;b.body.appendChild(o);Object.defineProperty(this,"_urlAnchor",{value:o});var f=new d(o);Object.defineProperty(this,"query",{get:function(){return e(o)?f:null},enumerable:!0})}try{if(typeof window.URL==="function"&&window.URL.length!==0&&(new window.URL("http://www.w3.org")).protocol==="http:")return}catch(a){}var i=
/([^:]*):?(.*)/,l=typeof StopIteration!=="undefined"?StopIteration:Error("Stop Iteration");Object.defineProperties(d.prototype,{get:{value:function(a){f(a);var c;g(this._anchor.search).some(function(b){b=j(b);if(b[0]===a)return c=b[1],!0});return c},enumerable:!0},set:{value:function(a,c){f(a);f(c);var d=g(this._anchor.search);d.some(function(m,i){var e=j(m);if(e[0]===a)return e[1]=c,d[i]=b(e),!0})||d.push(b([a,c]));this._anchor.search=k(d)},enumerable:!0},has:{value:function(a){f(a);return g(this._anchor.search).some(function(c){if(j(c)[0]===
a)return!0})},enumerable:!0},"delete":{value:function(a){f(a);var c=g(this._anchor.search),b=c.filter(function(c){return j(c)[0]!==a});return b.length!==c.length?(this._anchor.search=k(b),!0):!1},enumerable:!0},clear:{value:function(){this._anchor.search=""},enumerable:!0},forEach:{value:function(a,c){if(typeof a!=="function")throw new TypeError;var b=h(this._anchor,"keys+values");try{for(;;){var m=b.next();a.call(c,m[1],m[0],this)}}catch(d){if(d!==l)throw d;}},enumerable:!0},keys:{value:function(){return h(this._anchor,
"keys")},enumerable:!0},values:{value:function(){return h(this._anchor,"values")},enumerable:!0},items:{value:function(){return h(this._anchor,"keys+values")}},size:{get:function(){return g(this._anchor.search).length},enumerable:!0},getAll:{value:function(a){f(a);var c=[];g(this._anchor.search).forEach(function(b){b=j(b);b[0]===a&&c.push(b[1])});return c},enumerable:!0},append:{value:function(a,c){f(a);f(c);var d=g(this._anchor.search);d.push(b([a,c]));this._anchor.search=k(d)},enumerable:!0}});
Object.defineProperties(c.prototype,{href:{get:function(){return e(this._urlAnchor)?this._urlAnchor.href:this._input},set:function(a){f(a);this._input=a;this._urlAnchor.href=a},enumerable:!0},origin:{get:function(){return e(this._urlAnchor)?this._urlAnchor.protocol+"//"+this._urlAnchor.host:""},enumerable:!0},protocol:{get:function(){return e(this._urlAnchor)?this._urlAnchor.protocol:":"},set:function(a){f(a);this._urlAnchor.protocol=a},enumerable:!0},_userinfo:{get:function(){return!e(this._urlAnchor)?
"":RegExp("^"+this._urlAnchor.protocol+"(\\/\\/)(?:([^@]*)?@)?"+this._urlAnchor.host).exec(this._urlAnchor.href)[2]||""},set:function(a){f(a);this._urlAnchor.href=this._urlAnchor.href.replace(RegExp("^"+this._urlAnchor.protocol+"(\\/\\/)(?:([^@]*)?@)?"+this._urlAnchor.host),this._urlAnchor.protocol+"//"+(a?a+"@":"")+this._urlAnchor.host)}},username:{get:function(){if(!e(this._urlAnchor))return"";var a=i.exec(this._userinfo);return decodeURIComponent(a[1]||"")},set:function(a){f(a);var c=i.exec(this._userinfo),
a=[encodeURIComponent(a||"")];c[2]&&a.push(c[2]);this._userinfo=a.join(":")},enumerable:!0},password:{get:function(){if(!e(this._urlAnchor))return"";var a=i.exec(this._userinfo);return decodeURIComponent(a[2]||"")},set:function(a){f(a);var c=[i.exec(this._userinfo)[1]||""];a&&c.push(encodeURIComponent(a));this._userinfo=c.join(":")},enumerable:!0},host:{get:function(){return e(this._urlAnchor)?this._urlAnchor.host:""},set:function(a){f(a);this._urlAnchor.host=a},enumerable:!0},hostname:{get:function(){return e(this._urlAnchor)?
this._urlAnchor.hostname:""},set:function(a){f(a);this._urlAnchor.hostname=a},enumerable:!0},port:{get:function(){return e(this._urlAnchor)?this._urlAnchor.port:""},set:function(a){f(a);this._urlAnchor.port=a},enumerable:!0},pathname:{get:function(){return e(this._urlAnchor)?this._urlAnchor.pathname:""},set:function(a){f(a);this._urlAnchor.pathname=a},enumerable:!0},search:{get:function(){return e(this._urlAnchor)?this._urlAnchor.search:""},set:function(a){f(a);this._urlAnchor.search=a},enumerable:!0},
hash:{get:function(){return e(this._urlAnchor)?this._urlAnchor.hash:""},set:function(a){f(a);this._urlAnchor.hash=a},enumerable:!0}});window.URL&&window.URL.createObjectURL&&(Object.defineProperty(c,"createObjectURL",{value:window.URL.createObjectURL.bind(window.URL),enumerable:!1}),Object.defineProperty(c,"revokeObjectURL",{value:window.URL.revokeObjectURL.bind(window.URL),enumerable:!1}));window.URL=c})();define("orion/URL-shim",function(){});
define("orion/editor/util",[],function(){var g=navigator.userAgent,k=parseFloat(g.split("MSIE")[1])||void 0,j=parseFloat(g.split("Firefox/")[1]||g.split("Minefield/")[1])||void 0,b=g.indexOf("Opera")!==-1,h=parseFloat(g.split("Chrome/")[1])||void 0,f=g.indexOf("Safari")!==-1&&!h,e=parseFloat(g.split("WebKit/")[1])||void 0,d=g.indexOf("Android")!==-1,c=g.indexOf("iPad")!==-1,g=g.indexOf("iPhone")!==-1,a=c||g,i=navigator.platform.indexOf("Mac")!==-1,l=navigator.platform.indexOf("Win")!==-1,n=navigator.platform.indexOf("Linux")!==
-1;return{formatMessage:function(a){var c=arguments;return a.replace(/\$\{([^\}]+)\}/g,function(a,b){return c[(b<<0)+1]})},createElement:function(a,c){return a.createElementNS?a.createElementNS("http://www.w3.org/1999/xhtml",c):a.createElement(c)},isIE:k,isFirefox:j,isOpera:b,isChrome:h,isSafari:f,isWebkit:e,isAndroid:d,isIPad:c,isIPhone:g,isIOS:a,isMac:i,isWindows:l,isLinux:n,platformDelimiter:l?"\r\n":"\n"}});
define("orion/editor/keyBinding",["orion/editor/util"],function(g){function k(g,b,h,f,e){this.keyCode=typeof g==="string"?g.toUpperCase().charCodeAt(0):g;this.mod1=b!==void 0&&b!==null?b:!1;this.mod2=h!==void 0&&h!==null?h:!1;this.mod3=f!==void 0&&f!==null?f:!1;this.mod4=e!==void 0&&e!==null?e:!1}k.prototype={match:function(j){return this.keyCode===j.keyCode?this.mod1!==(g.isMac?j.metaKey:j.ctrlKey)?!1:this.mod2!==j.shiftKey?!1:this.mod3!==j.altKey?!1:g.isMac&&this.mod4!==j.ctrlKey?!1:!0:!1},equals:function(g){return!g?
!1:this.keyCode!==g.keyCode?!1:this.mod1!==g.mod1?!1:this.mod2!==g.mod2?!1:this.mod3!==g.mod3?!1:this.mod4!==g.mod4?!1:!0}};return{KeyBinding:k}});
define("orion/breadcrumbs",["require","orion/webui/littlelib"],function(g,k){function j(b){this._init(b)}j.prototype={_init:function(b){var h=k.node(b.container);if(!h)throw"no parent container";this._container=h;h.classList.remove("currentLocation");this._id=b.id||"eclipse.breadcrumbs";this._resource=b.resource||null;this._rootSegmentName=b.rootSegmentName;this._workspaceRootSegmentName=b.workspaceRootSegmentName;this._makeHref=b.makeHref;this.path="";this.render()},getNavigatorWorkspaceRootSegment:function(){if(this._workspaceRootSegmentName){var b;
this._resource&&this._resource.Parents?(b=document.createElement("a"),this._makeHref?this._makeHref(b,""):b.href=g.toUrl("navigate/table.html")+"#"):b=document.createElement("span");k.empty(b);b.appendChild(document.createTextNode(this._workspaceRootSegmentName));return b}return null},render:function(){var b=this._container,h=k.node(this._id);h?k.empty(h):(h=document.createElement("span"),h.id=this._id,b.appendChild(h));var f;if(f=this.getNavigatorWorkspaceRootSegment())if(f.classList.add("breadcrumb"),
h.appendChild(f),this._resource&&this._resource.Parents)f=document.createElement("span"),f.appendChild(document.createTextNode(" / ")),this.path+="/",f.classList.add("breadcrumbSeparator"),h.appendChild(f);else{f.href="";f.classList.remove("breadcrumb");f.classList.add("currentLocation");return}b=this._rootSegmentName;if(this._resource){if(this._resource.Parents)for(var e=this._resource.Parents,d=e.length;--d>=0;)f=document.createElement("a"),f.classList.add("breadcrumb"),b?(f.appendChild(document.createTextNode(b)),
b=null):f.appendChild(document.createTextNode(e[d].Name)),this.path+=e[d].Name,this._makeHref?this._makeHref(f,e[d].Location):f.href=g.toUrl("navigate/table.html")+"#"+e[d].ChildrenLocation,h.appendChild(f),f=document.createElement("span"),f.appendChild(document.createTextNode(" / ")),this.path+="/",f.classList.add("breadcrumbSeparator"),h.appendChild(f);f=document.createElement("span");b?(f.appendChild(document.createTextNode(b)),b=null):f.appendChild(document.createTextNode(this._resource.Name));
f.classList.add("currentLocation");this.path+=this._resource.Name;h.appendChild(f)}h.childNodes.length===0&&(f=document.createElement("span"),f.appendChild(document.createTextNode(b||document.title)),f.classList.add("breadcrumb"),f.classList.add("currentLocation"),h.appendChild(f))}};j.prototype.constructor=j;return{BreadCrumbs:j}});
define("orion/webui/splitter",["require","orion/webui/littlelib"],function(g,k){function j(b){this._init(b)}j.prototype={_init:function(b){this._tracking=null;this._resizeListeners=[];this._animationDelay=501;this.$node=k.node(b.node);if(!this.$node)throw"no dom node for splitter found";this.$sideNode=k.node(b.sidePanel);if(!this.$sideNode)throw"no dom node for side panel found";this.$mainNode=k.node(b.mainPanel);if(!this.$mainNode)throw"no dom node for main panel found";this._vertical=b.vertical;
this._prefix="/orion/splitter/"+(this.$node.id||document.body.id||"");if(b.toggle)this._thumb=document.createElement("div"),this.$node.appendChild(this._thumb),this._thumb.classList.add("splitThumb"),this._thumb.classList.add("splitThumbLayout");this._initializeFromStoredSettings();this._closed?(this._closed=!1,this._thumbDown()):this._adjustToSplitPosition();this.$node.style.visibility="visible";this.$mainNode.style.display="block";this.$sideNode.style.display="block";this.$node.addEventListener("mousedown",
this._mouseDown.bind(this),!1);window.addEventListener("mouseup",this._mouseUp.bind(this),!1);window.addEventListener("resize",this._resize.bind(this),!1)},toggleSidePanel:function(){this._thumbDown()},openSidePanel:function(){this._closed||this._thumbDown()},addResizeListener:function(b){this._resizeListeners.push(b)},_initializeFromStoredSettings:function(){this._closed=localStorage.getItem(this._prefix+"/toggleState")==="closed";var b;if(this._vertical){if(b=localStorage.getItem(this._prefix+"/yPosition"))this._splitTop=
parseInt(b,10)}else if(b=localStorage.getItem(this._prefix+"/xPosition"))this._splitLeft=parseInt(b,10)},_adjustToSplitPosition:function(b){var h=k.bounds(this.$node),f=k.bounds(this.$node.parentNode);if(this._vertical){this._splitHeight=h.height;if(b||!this._splitTop)this._splitTop=h.top,localStorage.setItem(this._prefix+"/yPosition",this._splitTop);b=this._splitTop;this.$node.parentNode.style.position==="relative"&&(b=this._splitTop-f.top);this.$sideNode.style.height=b+"px";this.$sideNode.style.bottom=
b-1+"px";this.$sideNode.style.display="block";this.$node.style.top=b+"px"}else{this._splitWidth=h.width;if(b||!this._splitLeft)this._splitLeft=h.left,localStorage.setItem(this._prefix+"/xPosition",this._splitLeft);b=this._splitLeft;this.$node.parentNode.style.position==="relative"&&(b=this._splitLeft-f.left);this.$sideNode.style.width=b+"px";this.$sideNode.style.right=b-1+"px";this.$sideNode.style.display="block";this.$node.style.left=b+"px"}this._resize()},_resize:function(b){var b=b||0,h=k.bounds(this.$node.parentNode),
f=k.bounds(this.$node);this._vertical?this.$mainNode.style.height=h.height-(f.top-h.top+f.height)+"px":this.$mainNode.style.width=h.width-(f.left-h.left+f.width)+"px";var e=this;window.setTimeout(function(){e._notifyResizeListeners(e.$mainNode)},b);window.setTimeout(function(){e._notifyResizeListeners(e.$sideNode)},b)},_notifyResizeListeners:function(b){for(var h=0;h<this._resizeListeners.length;h++)this._resizeListeners[h](b)},_thumbDown:function(){this._closed?(this._closed=!1,this._addAnimation(),
this._vertical?(this.$sideNode.style.height=this._splitTop+"px",this.$node.style.top=this._splitTop+"px"):(this.$sideNode.style.width=this._splitLeft+"px",this.$node.style.left=this._splitLeft+"px")):(this._closed=!0,this._addAnimation(),this._vertical?(this.$sideNode.style.top=0,this.$node.style.top="1px"):(this.$sideNode.style.width=0,this.$node.style.left="1px"));this._resize(this._animationDelay);this._removeAnimation();localStorage.setItem(this._prefix+"/toggleState",this._closed?"closed":null)},
_removeAnimation:function(){var b=this;window.setTimeout(function(){b.$sideNode.classList.remove("sidePanelLayoutAnimation");b.$mainNode.classList.remove("mainPanelLayoutAnimation");b.$node.classList.remove("splitLayoutAnimation");b._thumb.classList.remove("splitLayoutAnimation")},this._animationDelay)},_addAnimation:function(){this.$sideNode.classList.add("sidePanelLayoutAnimation");this.$mainNode.classList.add("mainPanelLayoutAnimation");this.$node.classList.add("splitLayoutAnimation");this._thumb&&
this._thumb.classList.add("splitLayoutAnimation")},_mouseDown:function(b){if(b.target===this._thumb)return k.stop(b),this._thumbDown(b);if(!this._tracking)this.$node.classList.add("splitTracking"),this.$mainNode.classList.add("panelTracking"),this.$sideNode.classList.add("panelTracking"),this._tracking=this._mouseMove.bind(this),window.addEventListener("mousemove",this._tracking),k.stop(b)},_mouseMove:function(b){if(this._tracking){var h;this._vertical?(h=this._splitTop=b.clientY,this.$node.parentNode.style.position===
"relative"&&(h=k.bounds(this.$node.parentNode),h=this._splitTop-h.top),this.$node.style.top=h+"px"):(h=this._splitLeft=b.clientX,this.$node.parentNode.style.position==="relative"&&(h=k.bounds(this.$node.parentNode),h=this._splitLeft-h.left),this.$node.style.left=h+"px");this._adjustToSplitPosition(!0);k.stop(b)}},_mouseUp:function(b){if(this._tracking)window.removeEventListener("mousemove",this._tracking),this._tracking=null,this.$node.classList.remove("splitTracking"),this.$mainNode.classList.remove("panelTracking"),
this.$sideNode.classList.remove("panelTracking"),k.stop(b)}};j.prototype.constructor=j;return{Splitter:j}});define("orion/fileUtils",["i18n!orion/nls/messages"],function(){return{makeRelative:function(g){if(!g)return g;var k=window.location.protocol+"//"+window.location.host;return g.indexOf(k)===0?g.substring(k.length):g},isAtRoot:function(g){return this.makeRelative(g).indexOf("/workspace")===0}}});
define("orion/favorites",["require","orion/fileUtils","orion/EventTarget"],function(g,k,j){function b(b){this._favorites=[];j.attach(this);this._init(b);this._initializeFavorites()}b.prototype={_init:function(b){this._registry=b.serviceRegistry;this._serviceRegistration=this._registry.registerService("orion.core.favorite",this)},_notifyListeners:function(){this.dispatchEvent({type:"favoritesChanged",navigator:this._favorites,registry:this._registry})},makeFavorites:function(b){for(var b=Array.isArray(b)?
b:[b],f=0;f<b.length;f++){var e=b[f],d=e.ChildrenLocation?e.ChildrenLocation:e.Location,d=k.makeRelative(d);this.addFavorite(e.Name,d,e.Directory)}this._storeFavorites();this._notifyListeners()},addFavoriteUrl:function(b){this.addFavorite(b,b,!1,!0)},addFavorite:function(b,f,e){this._favorites.push({name:b,path:f,directory:e,isFavorite:!0});this._favorites.sort(this._sorter);this._storeFavorites();this._notifyListeners()},removeFavorite:function(b){for(var f in this._favorites)if(this._favorites[f].path===
b){this._favorites.splice(f,1);break}this._favorites.sort(this._sorter);this._storeFavorites();this._notifyListeners()},renameFavorite:function(b,f){var e=!1,d;for(d in this._favorites)if(this._favorites[d].path===b){var c=this._favorites[d];if(c.name!==f)c.name=f,e=!0}e&&(this._favorites.sort(this._sorter),this._storeFavorites(),this._notifyListeners())},hasFavorite:function(b){for(var f in this._favorites)if(this._favorites[f].path===b)return!0;return!1},_SPECIAL_CHARS:"^$\\+[]().",queryFavorites:function(b){var f;
if(!b)return this._favorites;var e="";for(f=0;f<b.length;f++){var d=b.charAt(f);e+=d==="*"?".*":d==="?"?".?":this._SPECIAL_CHARS.indexOf(d)>=0?"\\"+d:d}e+=".*";b=RegExp(e);e=[];for(f in this._favorites)this._favorites[f].name.search(b)===0&&e.push(this._favorites[f]);return e},_initializeFavorites:function(){var b=this;this._registry.getService("orion.core.preference").getPreferences("/window/favorites").then(function(f){var e,f=f.get("navigate");typeof f==="string"&&(f=JSON.parse(f));if(f)for(e in f)f[e].isFavorite=
!0,b._favorites.push(f[e]);b._favorites.sort(b._sorter);b._notifyListeners()})},_storeFavorites:function(){var b=this._favorites;this._registry.getService("orion.core.preference").getPreferences("/window/favorites").then(function(f){f.put("navigate",b)})},_sorter:function(b,f){var e=b.name.toLowerCase(),d=f.name.toLowerCase();return e>d?1:e<d?-1:0},getFavorites:function(){return{navigator:this._favorites}}};b.prototype.constructor=b;return{FavoritesService:b}});
define("orion/widgets/themes/ThemeClass",[],function(){function g(g){this.attributes=[];this.element=document.createElement("div");this.style=this.element.style;this.className=g;this.classString="."+g+"{ "}g.prototype.className=null;g.prototype.classString=void 0;g.prototype.style=void 0;g.prototype.closeString=" }\n";g.prototype.toString=function(){return this.classString=this.classString+this.style.cssText+this.closeString};return{ThemeClass:g}});
define("orion/widgets/themes/container/ThemeSheetWriter",["orion/widgets/themes/ThemeClass"],function(g){function k(){}k.prototype.navbar="#333";k.prototype.button="#777777";k.prototype.location="#EFEFEF";k.prototype.selection="FEC";k.prototype.sidepanel="#FBFBFB";k.prototype.mainpanel="white";k.prototype.navtext="#bfbfbf";k.prototype.content="#3087B3";k.prototype.search="#444";k.prototype.toolpanel="white";k.prototype.writeNavigationStyle=function(){var j="",b=[],h=new g.ThemeClass("orionPage");
h.style.backgroundColor="#fdfdfd";h.style.width="100%";h.style.height="100%";b.push(h);h=new g.ThemeClass("topRowBanner");h.style.margin="0";h.style.border="0";h.style.backgroundColor=this.navbar;h.style.background="-webkit-gradient(linear, left top, left bottom, color-stop(0%,"+this.navbar+"), color-stop(100%,"+this.navbar+"))";h.style.background="-moz-linear-gradient(top,"+this.navbar+"0%,"+this.navbar+"100%)";h.style.height="28px";b.push(h);h=new g.ThemeClass("a");h.style.textDecoration="none";
h.style.color=this.content;b.push(h);h=new g.ThemeClass("navlink");h.style.display="inline-block";h.style.padding="2px";h.style.color=this.content;b.push(h);h=new g.ThemeClass("primaryNav");h.style.color=this.navtext;h.style.fontSize="8pt";h.style.fontWeight="normal";h.style.paddingTop="6px";h.style.verticalAlign="baseline";b.push(h);h=new g.ThemeClass("primaryNav a");h.style.fontSize="8pt";h.style.color=this.navtext;h.style.marginRight="6px";h.style.marginLeft="6px";h.style.verticalAlign="baseline";
h.style.textDecoration="none";b.push(h);h=new g.ThemeClass("primaryNav a:hover");h.style.color="#bfbfbf";h.style.cursor="hand";h.style.color="white";h.style.fontWeight="normal";b.push(h);for(var f in b)j+=b[f].toString();return j};k.prototype.writeLocationStyle=function(){var j="",b=[],h=new g.ThemeClass("titleArea");h.style.margin="0";h.style.paddingTop="5px";h.style.border="0";h.style.background=this.location;h.style.background="-webkit-gradient(linear, left top, left bottom, color-stop(0%,"+this.location+
"), color-stop(100%,"+this.location+"))";h.style.borderBottom="1px solid "+this.location;h.style.minHeight="20px";b.push(h);h=new g.ThemeClass("breadcrumb");h.style.fontSize="8pt";h.style.textDecoration="none";h.style.color=this.content;h.style.paddingTop="2px";b.push(h);h=new g.ThemeClass("a.breadcrumb:hover");h.style.textDecoration="none";h.style.borderBottom="1px dotted";h.style.color="#F58B0F";h.style.cursor="pointer";b.push(h);h=new g.ThemeClass("breadcrumbSeparator");h.style.fontSize="8pt";
h.style.textDecoration="none";h.style.color=this.navbar;h.style.fontWeight="bold";b.push(h);h=new g.ThemeClass("currentLocation");h.style.fontWeight="bold";h.style.fontSize="8pt";h.style.color=this.navbar;h.style.textDecoration="none";h.style.textWrap="normal";h.style.lineHeight="10pt";b.push(h);h=new g.ThemeClass("a.currentLocation:hover");h.style.fontWeight="bold";h.style.fontSize="10pt";h.style.color="#666666";h.style.textDecoration="none";h.style.borderBottom="0";b.push(h);h=new g.ThemeClass("navlinkonpage");
h.style.color=this.content;b.push(h);for(var f in b)j+=b[f].toString();return j};k.prototype.writeButtonStyle=function(){var j="",b=[],h=new g.ThemeClass("commandButton");h.style.color="#222";h.style.border="1px solid #dedede";h.style.backgroundColor=this.button;h.style.textAlign="center";h.style.verticalAlign="baseline";h.style.cursor="pointer";h.style.display="inline-block";h.style.padding="6px";h.style.paddingTop="4px";h.style.borderRadius="1px";h.style.lineHeight="12px";h.style.fontSize="8pt";
h.style.userSelect="none";b.push(h);h=new g.ThemeClass("commandButton:over");h.style.backgroundColor="#e6e6e6";h.style.border="1px solid #808080";b.push(h);h=new g.ThemeClass("commandMenu");h.style.color="#222";h.style.display="inline-block";h.style.verticalAlign="baseline";h.style.margin="0";h.style.fontSize="8pt";h.style.fontWeight="normal";h.style.border="1px solid #dedede";h.style.backgroundColor="#efefef";h.style.cursor="pointer";h.style.borderRadius="1px";b.push(h);h=new g.ThemeClass("commandMenuItem");
h.style.border="0";h.style.padding="0";h.style.margin="0";b.push(h);for(var f in b)j+=b[f].toString();return j};k.prototype.writeMainStyle=function(){var j="",b=[],h=new g.ThemeClass("searchbox");h.style.backgroundImage="url(../images/core_sprites.png)";h.style.backgroundRepeat="no-repeat";h.style.backgroundPosition="4px -297px";h.style.width="12px";h.style.height="12px";h.style.backgroundColor=this.search;h.style.border="1px solid "+this.search;h.style.fontSize="11px";h.style.width="15em";h.style.height=
"16px";h.style.borderRadius="10px";h.style.color="#999";h.style.padding="0";h.style.paddingLeft="20px";h.style.marginLeft="5px";h.style.marginTop="6px !important";h.style.font="7pt Lucida Sans Unicode,Lucida Grande,Verdana,Arial,Helvetica,Myriad,Tahoma,clean,sans-serif !important";b.push(h);h=new g.ThemeClass("searchbox:focus");h.style.color="white";h.style.outline="none";b.push(h);h=new g.ThemeClass("checkedRow");h.style.cssText="background-color:"+this.selection+" !important;";b.push(h);h=new g.ThemeClass("navbar-item-selected");
h.style.background=this.selection;h.style.color=this.content;b.push(h);h=new g.ThemeClass("auxpane");h.style.border="0";h.style.background=this.sidepanel;h.style.background="-webkit-gradient(linear, left top, left bottom, color-stop(0%,"+this.sidepanel+"), color-stop(100%,"+this.sidepanel+"))";h.style.background="-moz-linear-gradient(top, "+this.sidepanel+" 0%, "+this.sidepanel+" 100%)";h.style.overflowX="auto";h.style.minWidth="200px";h.style.paddingTop="16px";b.push(h);h=new g.ThemeClass("mainpane");
h.style.background=this.mainpanel;h.style.border=0;b.push(h);h=new g.ThemeClass("mainToolbar");h.style.background=this.toolpanel;h.style.height="31px";h.style.borderBottom="1px solid #ebebeb";b.push(h);for(var f in b)j+=b[f].toString();return j};k.prototype.render=function(){console.log(this.writeNavigationStyle());console.log(this.writeLocationStyle());console.log(this.writeMainStyle());console.log(this.writeButtonStyle())};k.prototype.getSheet=function(g){g.navbar.value?(this.navbar=g.navbar.value,
this.button=g.button.value,this.location=g.location.value,this.selection=g.selection.value,this.sidepanel=g.sidepanel.value,this.mainpanel=g.mainpanel.value,this.navtext=g.navtext.value,this.search=g.search.value,this.content=g.content.value,this.toolpanel=g.toolpanel.value):(this.navbar=g.navbar,this.button=g.button,this.location=g.location,this.selection=g.selection,this.sidepanel=g.sidepanel,this.mainpanel=g.mainpanel,this.navtext=g.navtext,this.search=g.search,this.content=g.content,this.toolpanel=
g.toolpanel);return this.writeNavigationStyle()+this.writeLocationStyle()+this.writeMainStyle()+this.writeButtonStyle()};return{ThemeSheetWriter:k}});
define("orion/inputCompletion/inputCompletion",[],function(){function g(g,j,b){this._inputField=g;if(typeof this._inputField==="string")this._inputField=document.getElementById(this._inputField);this._binderFunc=j;(g=b?b.group:null)||(g=this._inputField.id?this._inputField.id:"default__input__group");this._completionIdPrefix=g+"__completion__";this._proposeFromStart=b?b.proposeFromStart:!1;this._extendedProvider=b?b.extendedProvider:null;this._proposalIndex=-1;this._dismissed=!0;this._mouseDown=!1;
this._dataList=[];this._initUI();var h=this;this._completionUIContainer.addEventListener("mousedown",function(){h._mouseDown=!0});this._completionUIContainer.addEventListener("mouseup",function(){h._mouseDown=!1});this._inputField.addEventListener("blur",function(){h._mouseDown?window.setTimeout(function(){h._inputField.focus()},200):h._dismiss()});this._inputField.addEventListener("keydown",function(b){h.onKeyDown(b)});this._inputField.addEventListener("input",function(){h._proposeOn(h._inputField.value)});
this._inputField.addEventListener("focus",function(){if(h._dismissed&&h._binderFunc)h._dismissing?h._dismissing=!1:h._binderFunc&&h._binderFunc(function(b){h._bind(b);h._proposeOn(h._inputField.value)})})}g.prototype.onKeyDown=function(g){if(this._dismissed)return!0;var j=g.charCode||g.keyCode;if(j===13){if(this._proposalList&&this._proposalList.length>0&&this._proposalIndex>=0&&this._proposalIndex<this._proposalList.length)return g.preventDefault(),this._dismiss(this._proposalList[this._proposalIndex].item.value,
g.ctrlKey),g.stopPropagation(),!1}else if((j===40||j===38)&&this._proposalList&&this._proposalList.length>0)return g.preventDefault(),this._walk(j===40),g.stopPropagation(),!1;else if(j===27)return g.preventDefault(),this._dismiss(),!1;return!0};g.prototype._bind=function(g){this._dataList=g};g.prototype._getUIContainerID=function(){return this._completionIdPrefix+"UIContainer"};g.prototype._getUIProposalListId=function(){return this._completionIdPrefix+"UIProposalList"};g.prototype._initUI=function(){this._completionUIContainer=
document.getElementById(this._getUIContainerID());if(!this._completionUIContainer)this._completionUIContainer=document.createElement("div"),this._completionUIContainer.id=this._getUIContainerID(),this._completionUIContainer.style.display="none",this._completionUIContainer.className="inputCompletionContainer",this._completionUIContainer.setAttribute("role","list"),this._completionUIContainer.setAttribute("aria-atomic","true"),this._completionUIContainer.setAttribute("aria-live","assertive"),document.body.appendChild(this._completionUIContainer);
this._completionUIContainer.textContent="";this._completionUL=document.getElementById(this._getUIProposalListId());if(!this._completionUL)this._completionUL=document.createElement("ul"),this._completionUL.id=this._getUIProposalListId(),this._completionUL.className="inputCompletionUL";this._completionUL.textContent="";this._completionUIContainer.appendChild(this._completionUL)};g.prototype._createProposalLink=function(g,j,b,h){var f=document.createElement("a");f.href=require.toUrl(j);f.appendChild(this._createBoldText(g,
b,h));return f};g.prototype._createBoldText=function(g,j,b){if(j<0)return document.createTextNode(g);var h=document.createElement("span"),f;0!==j&&(f=document.createTextNode(g.substring(0,j)),h.appendChild(f));var e=document.createElement("b");h.appendChild(e);f=document.createTextNode(g.substring(j,j+b));e.appendChild(f);j+b<g.length-1&&(f=document.createTextNode(g.substring(j+b)),h.appendChild(f));return h};g.prototype._proposeOnCategory=function(g,j){if(j.length!==0){var b=this;if(g){var h=document.createElement("li");
h.className="inputCompletionLICategory";var f=document.createTextNode(g);h.appendChild(f);this._completionUL.appendChild(h)}for(f=0;f<j.length;f++){h=document.createElement("li");h.onmouseover=function(d){b._selectProposal(d.currentTarget)};h.onclick=function(d){b._dismiss(d.currentTarget.completionItem.value)};h.className="inputCompletionLINormal";h.completionItem=j[f].item;if(typeof j[f].item.value==="string"){var e=this._createBoldText(j[f].item.value,j[f].boldIndex,j[f].boldLength);h.appendChild(e)}else j[f].item.value.name&&
j[f].item.value.type==="link"&&h.appendChild(this._createProposalLink(j[f].item.value.name,j[f].item.value.value,j[f].boldIndex,j[f].boldLength));this._completionUL.appendChild(h);this._proposalList.push({item:j[f].item,domNode:h})}}};g.prototype._domNode2Index=function(g){for(var j=0;j<this._proposalList.length;j++)if(this._proposalList[j].domNode===g)return j;return-1};g.prototype._highlight=function(g,j){var b=g,h=!1;isNaN(b)||(h=!0,b=this._proposalList&&g>=0&&g<this._proposalList.length?this._proposalList[g].domNode:
null);if(b)b.className=j?"inputCompletionLISelected":"inputCompletionLINormal",j&&h&&(b.offsetTop<this._completionUIContainer.scrollTop?b.scrollIntoView(!0):b.offsetTop+b.offsetHeight>this._completionUIContainer.scrollTop+this._completionUIContainer.clientHeight&&b.scrollIntoView(!1))};g.prototype._selectProposal=function(g){var j=g;isNaN(j)&&(j=this._domNode2Index(g));if(j!==this._proposalIndex)this._highlight(this._proposalIndex,!1),this._proposalIndex=j,this._highlight(this._proposalIndex,!0)};
g.prototype._dismiss=function(g,j){if(!this._mouseDown){this._dismissed=!0;this._proposalList=null;this._proposalIndex=-1;if(typeof g==="string")this._inputField.value=g,this._dismissing=!0,this._inputField.focus();else if(g&&g.name&&g.type==="link")j?window.open(g.value):window.location.href=g.value;var b=this;window.setTimeout(function(){b._completionUIContainer.style.display="none"},200)}};g.prototype._show=function(){if(this._proposalList&&this._proposalList.length>0){for(var g=0,j=0,b=this._inputField;b;)g+=
b.offsetLeft,j+=b.offsetTop,b=b.offsetParent;this._completionUIContainer.style.display="block";this._completionUIContainer.style.top=j+this._inputField.offsetHeight+2+"px";this._completionUIContainer.style.left=g+"px";this._completionUIContainer.style.width=this._inputField.offsetWidth+"px";this._dismissed=this._mouseDown=!1}else this._dismissed=!0,this._proposalList=null,this._proposalIndex=-1,this._completionUIContainer.style.display="none"};g.prototype._walk=function(g){g=this._proposalIndex+(g?
1:-1);g<-1?g=this._proposalList.length-1:g>=this._proposalList.length&&(g=-1);this._selectProposal(g)};g.prototype._proposeOnList=function(g,j,b){for(var h="",f=[],e=j?j.length:0,d=0;d<g.length;d++)if(g[d].type==="category")this._proposeOnCategory(h,f),h=g[d].label,f=[];else{var c=!0,a=-1;if(j&&b){var i;typeof g[d].value==="string"?i=g[d].value.toLowerCase():g[d].value.name&&(i=g[d].value.name.toLowerCase());a=i.indexOf(j);a<0?c=!1:this._proposeFromStart&&(c=a===0)}c&&f.push({item:g[d],boldIndex:a,
boldLength:e})}this._proposeOnCategory(h,f)};g.prototype._proposeOn=function(g){this._completionUL.textContent="";var j=g?g.toLowerCase():null;this._proposalList=[];this._proposeOnList(this._dataList,j,!0);if(this._extendedProvider&&j){var b=this;this._extendedProvider(g,function(h){if(h)for(var f=0;f<h.length;f++)b._proposeOnList(h[f].proposals,h[f].filterForMe?j:g,h[f].filterForMe);b._show()},[])}else this._show()};g.prototype.constructor=g;return{InputCompletion:g}});
define("orion/globalSearch/nls/root/messages",{"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","Case sensitive":"Case sensitive","Regular expression":"Regular expression"});
define("orion/globalSearch/nls/messages",["orion/i18n!orion/globalSearch/nls/messages","orion/globalSearch/nls/root/messages"],function(g,k){var j={root:k};Object.keys(g).forEach(function(b){typeof j[b]==="undefined"&&(j[b]=g[b])});return j});
define("orion/webui/dialog",["i18n!orion/widgets/nls/messages","require","orion/webui/littlelib","orion/uiUtils"],function(g,k,j,b){function h(){}h.prototype={DISABLED:"disabled",CONTAINERTEMPLATE:'<div class="dialog" role="dialog"><div class="dialogTitle"><span id="title" class="dialogTitleText layoutLeft"></span><span tabindex="0" role="button" aria-label="Close" class="dialogDismiss layoutRight core-sprite-close imageSprite" id="closeDialog"></span></div><div id="dialogContent" class="dialogContent layoutBlock"></div><div id="buttons" class="dialogButtons"></div></div>',_initialize:function(){var b=
document.body;this.$frameParent=b;this.$$modalExclusions=this.$$modalExclusions||[];var e=document.createRange();e.selectNode(b);e=e.createContextualFragment(this.CONTAINERTEMPLATE);b.appendChild(e);this.$frame=b.lastChild;this.title&&j.$("#title",this.$frame).appendChild(document.createTextNode(this.title));this.$close=j.$("#closeDialog",this.$frame);var d=this;this.$close.addEventListener("click",function(){d.hide()},!1);this.$parent=j.$(".dialogContent",this.$frame);e=document.createRange();e.selectNode(this.$parent);
b=e.createContextualFragment(this.TEMPLATE);this.messages&&j.processTextNodes(b,this.messages);this.$parent.appendChild(b);this.$buttonContainer=j.$(".dialogButtons",this.$frame);this._makeButtons();this.$close.addEventListener("keydown",function(c){(c.keyCode===j.KEY.ENTER||c.keyCode===j.KEY.SPACE)&&d.hide()},!1);this.$frame.addEventListener("keydown",function(c){c.keyCode===j.KEY.ESCAPE?d.hide():c.keyCode===j.KEY.ENTER&&typeof d._defaultCallback==="function"&&d._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 f=this;this.buttons.forEach(function(e){var d=b.createButton(e.text,e.callback);if(e.id)d.id=e.id,f["$"+d.id]=d;if(e.isDefault)f._defaultCallback=e.callback,f._defaultButton=d;f.$buttonContainer.appendChild(d)})}},_makeModal:function(){var b=this;this.$frame.addEventListener("blur",function(a){b.$lastFocusedElement=a.target},
!0);this._modalListener=function(a){var c=!j.contains(b.$frame,a.target);if(c)for(var d=0;d<b.$$modalExclusions.length;d++)if(j.contains(b.$$modalExclusions[d],a.target)){c=!1;break}c&&(window.setTimeout(function(){(b.$lastFocusedElement||b.$parent).focus()},0),j.stop(a))};this.$frameParent.addEventListener("focus",this._modalListener,!0);this.$frameParent.addEventListener("click",this._modalListener,!0);var e=this.$frameParent.childNodes,d=!1;this._addedBackdrop=[];for(var c=0;c<e.length;c++){for(var a=
0;a<this.$$modalExclusions.length;a++)if(j.contains(this.$$modalExclusions[a],e[c])){d=!0;break}!d&&e[c]!==b.$frame&&e[c].classList&&!e[c].classList.contains("tooltipContainer")&&(a=e[c],a.classList.contains("modalBackdrop")||(a.classList.add("modalBackdrop"),this._addedBackdrop.push(a)))}(e=j.lastTabbable(this.$buttonContainer)||j.lastTabbable(this.$parent))&&e.addEventListener("keydown",function(a){if(a.keyCode===j.KEY.TAB){var c=b._getFirstFocusField();c&&c!==a.target&&c.focus();j.stop(a)}},!1)},
_addChildDialog:function(b){this.$$modalExclusions.push(b.$frame||b.$parent)},_bindElements:function(b){for(var e=0;e<b.childNodes.length;e++){var d=b.childNodes[e];d.id&&(this["$"+d.id]=d);this._bindElements(d)}},hide:function(){typeof this._beforeHiding==="function"&&this._beforeHiding();this._modalListener&&(this.$frameParent.removeEventListener("focus",this._modalListener,!0),this.$frameParent.removeEventListener("click",this._modalListener,!0));this.$frame.classList.remove("dialogShowing");typeof this._afterHiding===
"function"&&this._afterHiding();var b=this;this.keepAlive||window.setTimeout(function(){b.destroy()},0)},show:function(b){typeof this._beforeShowing==="function"&&this._beforeShowing();var e=j.bounds(this.$frame),d=j.bounds(document.documentElement),c;b?(c=j.bounds(b),b=c.top+c.height+4,c=c.left+4,b+e.height>d.height&&(b=Math.max(0,d.height-e.height-4)),c+e.width>d.width&&(c=Math.max(0,d.width-e.width-4))):(c=Math.max(0,(d.width-e.width)/2),b=Math.max(0,(d.height-e.height)/2));this.$lastFocusedElement=
document.activeElement;this.$frame.style.top=b+"px";this.$frame.style.left=c+"px";this.$frame.classList.add("dialogShowing");typeof this._afterShowing==="function"&&this._afterShowing();this.customFocus||this._getFirstFocusField().focus()},_getFirstFocusField:function(){return j.firstTabbable(this.$parent)||this._defaultButton||j.firstTabbable(this.$buttonContainer)||this.$close},destroy:function(){this._addedBackdrop&&this._addedBackdrop.length>0&&this._addedBackdrop.forEach(function(b){b.classList.remove("modalBackdrop")});
this.$frameParent.removeEventListener("focus",this._modalListener,!0);this.$frameParent.removeEventListener("click",this._modalListener,!0);this.$frameParent.removeChild(this.$frame);this.$parent=this.$frame=void 0}};h.prototype.constructor=h;return{Dialog:h}});
(function(){var g=["Msxml2.XMLHTTP","Microsoft.XMLHTTP","Msxml2.XMLHTTP.4.0"],k=/^\s*<\?xml(\s)+version=[\'\"](\d)*.(\d)*[\'\"](\s)*\?>/im,j=/<body[^>]*>\s*([\s\S]+)\s*<\/body>/im,b=typeof location!=="undefined"&&location.href,h=b&&location.protocol&&location.protocol.replace(/\:/,""),f=b&&location.hostname,e=b&&(location.port||void 0),d=[];define("text",[],function(){var c,a,i;typeof window!=="undefined"&&window.navigator&&window.document?a=function(a,b){var d=c.createXhr();d.open("GET",a,!0);d.onreadystatechange=
function(){d.readyState===4&&b(d.responseText)};d.send(null)}:typeof process!=="undefined"&&process.versions&&process.versions.node?(i=require.nodeRequire("fs"),a=function(a,c){var b=i.readFileSync(a,"utf8");b.indexOf("\ufeff")===0&&(b=b.substring(1));c(b)}):typeof Packages!=="undefined"&&(a=function(a,c){var b=new java.io.File(a),d=java.lang.System.getProperty("line.separator"),b=new java.io.BufferedReader(new java.io.InputStreamReader(new java.io.FileInputStream(b),"utf-8")),m,i,e="";try{m=new java.lang.StringBuffer;
(i=b.readLine())&&i.length()&&i.charAt(0)===65279&&(i=i.substring(1));for(m.append(i);(i=b.readLine())!==null;)m.append(d),m.append(i);e=String(m.toString())}finally{b.close()}c(e)});return c={version:"1.0.7",strip:function(a){if(a){var a=a.replace(k,""),c=a.match(j);c&&(a=c[1])}else a="";return a},jsEscape:function(a){return a.replace(/(['\\])/g,"\\$1").replace(/[\f]/g,"\\f").replace(/[\b]/g,"\\b").replace(/[\n]/g,"\\n").replace(/[\t]/g,"\\t").replace(/[\r]/g,"\\r")},createXhr:function(){var a,c,
b;if(typeof XMLHttpRequest!=="undefined")return new XMLHttpRequest;else for(c=0;c<3;c++){b=g[c];try{a=new ActiveXObject(b)}catch(d){}if(a){g=[b];break}}if(!a)throw Error("createXhr(): XMLHttpRequest not available");return a},get:a,parseName:function(a){var c=!1,b=a.indexOf("."),d=a.substring(0,b),a=a.substring(b+1,a.length),b=a.indexOf("!");b!==-1&&(c=a.substring(b+1,a.length),c=c==="strip",a=a.substring(0,b));return{moduleName:d,ext:a,strip:c}},xdRegExp:/^((\w+)\:)?\/\/([^\/\\]+)/,useXhr:function(a,
b,d,i){var m=c.xdRegExp.exec(a),e;if(!m)return!0;a=m[2];m=m[3];m=m.split(":");e=m[1];m=m[0];return(!a||a===b)&&(!m||m===d)&&(!e&&!m||e===i)},finishLoad:function(a,b,i,e,m){i=b?c.strip(i):i;m.isBuild&&(d[a]=i);e(i)},load:function(a,d,i,g){if(g.isBuild&&!g.inlineText)i();else{var m=c.parseName(a),r=m.moduleName+"."+m.ext,o=d.toUrl(r),x=g&&g.text&&g.text.useXhr||c.useXhr;!b||x(o,h,f,e)?c.get(o,function(b){c.finishLoad(a,m.strip,b,i,g)}):d([r],function(a){c.finishLoad(m.moduleName+"."+m.ext,m.strip,a,
i,g)})}},write:function(a,b,i){if(b in d){var e=c.jsEscape(d[b]);i.asModule(a+"!"+b,"define(function () { return '"+e+"';});\n")}},writeFile:function(a,b,d,i,m){var b=c.parseName(b),e=b.moduleName+"."+b.ext,o=d.toUrl(b.moduleName+"."+b.ext)+".js";c.load(e,d,function(){var b=function(a){return i(o,a)};b.asModule=function(a,c){return i.asModule(a,o,c)};c.write(a,e,b,m)},m)}}})})();define("text!orion/banner/banner.html",[],function(){return'<header id="banner" role="banner" class="headerLayout">\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="primaryNav layoutBlock topRowBanner">\n\t\t<a id="home" class="layoutLeft logo"></a>\n\t\t<nav id="primaryNav" class="layoutLeft" role="navigation"></nav>\n\t\t<div class="layoutRight">\n\t\t\t<div id="globalActions" class="spacingLeft layoutLeft"></div>\n\t\t\t<div id="relatedLinks" class="spacingLeft layoutLeft" style="padding-top:1px;">\n\t\t\t\t<span tabindex="0" role="button" id="relatedTrigger" class="dropdownTrigger hidden">${Related}<span class="dropdownArrowDown"></span></span>\n\t\t\t\t<ul id="relatedDropdown" class="dropdownMenu" role="menu"></ul>\n\t\t\t</div>\n\t\t\t<input type="text" id="search" autocomplete="off" class="layoutLeft spacingLeft searchbox" role="search">\n\t\t\t<div id="searchOptions" class="layoutLeft" style="padding-top:1px;"></div>\n\t\t\t<div id="userMenu" class="spacingLeft layoutLeft">\n\t\t\t\t<span id="userTrigger" tabindex="0" role="button" class="dropdownTrigger">${Options}<span class="dropdownArrowDown"></span></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<\!-- Task + resource (title) area --\>\n\t<div id="titleArea" class="layoutBlock titleArea">\n\t\t<div class="clear" style="padding-bottom:5px;display:inline;"><span id="location" class="currentLocation"></span><span id="dirty" class="currentLocation"></span></div>\n\t\t<div class="layoutRight pageNav">\n\t\t\t<img class="progressPane" id="progressPane" tabindex="0" role="progressbar"></img>\n\t\t</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="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<a href="http://wiki.eclipse.org/Orion/FAQ" target="_blank">${FAQ}</a>\n\t\t<a href="https://bugs.eclipse.org/bugs/enter_bug.cgi?product=Orion&version=2.0" target="_blank">${Report a Bug}</a>|\n\t\t<a href="http://www.eclipse.org/legal/privacy.php" target="_blank">${Privacy Policy}</a>|\n\t\t<a href="http://www.eclipse.org/legal/termsofuse.php" target="_blank">${Terms of Use}</a>|\n\t\t<a href="http://www.eclipse.org/legal/copyright.php" target="_blank">${Copyright Agent}</a>\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<div class="layoutRight" style="padding-left:7px;padding-right:7px;margin-top:3px;" id="settingsTab" style="visibility:hidden;">\n\t<div class="layoutRight core-sprite-settings" id="settingsAction" role="settings" aria-live="off" style="visibility:hidden;"></div>\n</div>\n<div class="layoutRight status" id="statusPane" role="status" aria-live="off"></div>\n<ul class="layoutRight commandList pageActions" id="pageNavigationActions"></ul>\n<div id="notificationArea" class="layoutLeft layoutBlock slideContainer">\n\t<div class="layoutLeft" id="notifications" aria-live="assertive" aria-atomic="true"></div>\n\t<div class="layoutRight"><span tabindex="0" role="button" class="layoutRight core-sprite-close imageSprite" id="closeNotifications"></span></div>\n</div>\n\t\t\n\t'});
define("text!orion/banner/slideout.html",[],function(){return'<div id="slideContainer" class="slideParameters slideContainer">\n\t<span id="pageCommandParameters" class="layoutLeft parameters"></span>\n\t<span id="pageCommandDismiss" class="layoutRight parametersDismiss"></span>\n</div>'});
define("orion/commonHTMLFragments",["require","orion/webui/littlelib","text!orion/banner/slideout.html"],function(g,k,j){return{slideoutHTMLFragment:function(b){var h=document.createElement("div");h.innerHTML=j;var f=k.$("#slideContainer",h);f.id=b+f.id;f=k.$("#pageCommandParameters",h);f.id=b+f.id;f=k.$("#pageCommandDismiss",h);f.id=b+f.id;return h.innerHTML}}});
define("orion/webui/treetable",["i18n!orion/nls/messages","orion/webui/littlelib"],function(g,k){function j(b){this._init(b)}j.prototype={_init:function(b){var h=b.parent,f=this,h=k.node(h);if(!h)throw g["no parent"];if(!b.model)throw g["no tree model"];if(!b.renderer)throw g["no renderer"];this._parent=h;this._treeModel=b.model;this._renderer=b.renderer;this._showRoot=b.showRoot===void 0?!1:b.showRoot;this._indent=b.indent===void 0?16:b.indent;this._onCollapse=b.onCollapse;this._labelColumnIndex=
b.labelColumnIndex===void 0?0:b.labelColumnIndex;this._id=b.id===void 0?"treetable":b.id;this._tableStyle=b.tableStyle;this._tableElement=b.tableElement||"table";this._tableBodyElement=b.tableBodyElement||"tbody";this._tableRowElement=b.tableRowElement||"tr";this._root=this._treeModel.getRoot(function(b){f._showRoot?(b._depth=0,f._generate([b],0)):f._treeModel.getChildren(b,function(b){f._generate(b,0)})})},_generate:function(b,h){k.empty(this._parent);var f=document.createElement(this._tableElement);
f.id=this._id;this._tableStyle&&f.classList.add(this._tableStyle);this._renderer.initTable(f,this);this._bodyElement=document.createElement(this._tableBodyElement);this._bodyElement.id=this._id+"tbody";this._generateChildren(b,h);f.appendChild(this._bodyElement);this._parent.appendChild(f);this._rowsChanged()},_generateChildren:function(b,h,f){for(var e=0;e<b.length;e++){var d=document.createElement(this._tableRowElement);d.id=this._treeModel.getId(b[e]);d._depth=h;d._item=b[e];this._renderer.render(b[e],
d);d.childNodes[this._labelColumnIndex].style.paddingLeft=this._indent*h+"px";f?(this._bodyElement.insertBefore(d,f.nextSibling),f&&(f=d)):this._bodyElement.appendChild(d)}},_rowsChanged:function(){this._renderer.rowsChanged&&this._renderer.rowsChanged()},getSelected:function(){return this._renderer.getSelected()},refresh:function(b,h,f){var e=this._treeModel.getId(b),d;if(e===this._id)this._removeChildRows(e),this._generateChildren(h,0),this._rowsChanged();else{var c=k.node(e);c?(c._item=b,c&&(f||
c._expanded)?(c._expanded=!0,this._removeChildRows(e),this._renderer.updateExpandVisuals(c,!0),h?(this._generateChildren(h,c._depth+1,c),this._rowsChanged()):(d=this,h=this._treeModel.getChildren(c._item,function(a){d._generateChildren(a,c._depth+1,c);d._rowsChanged()}))):this._renderer.updateExpandVisuals(c,!1)):console.log(g["could not find table row "]+e)}},getItem:function(b){var h=k.node(b);return h&&h._item?h._item:b},toggle:function(b){var h=k.node(b);h&&(h._expanded?(this.collapse(b),this._renderer.updateExpandVisuals(h,
!1)):(this.expand(b),this._renderer.updateExpandVisuals(h,!0)))},isExpanded:function(b){return(b=k.node(b))?b._expanded:!1},expand:function(b,h,f){var b=typeof b==="string"?b:this._treeModel.getId(b),e=k.node(b);if(e&&!e._expanded){e._expanded=!0;var d=this;this._renderer.updateExpandVisuals(e,!0);this._treeModel.getChildren(e._item,function(c){d._generateChildren(c,e._depth+1,e);d._rowsChanged();h&&h.apply(d,f)})}},_removeChildRows:function(b){for(var h=b===this._id,f=!1,e=-1,d=[],c=k.$$array(".treeTableRow",
this._parent),a=0;a<c.length;a++){var i=c[a];if(f)break;if(h)i._depth>e?d.push(i):f=!0;else if(i.id===b)h=!0,e=i._depth}for(b=0;b<d.length;b++)h=d[b],h.parentNode.removeChild(h)},collapse:function(b){var b=typeof b==="string"?b:this._treeModel.getId(b),h=k.node(b);if(h){if(!h._expanded)return;h._expanded=!1;this._renderer.updateExpandVisuals(h,!1);this._removeChildRows(b);this._rowsChanged()}this._onCollapse&&this._onCollapse(h._item)}};j.prototype.constructor=j;return{TableTree:j}});
define("orion/treeModelIterator",[],function(){var g={};g.TreeModelIterator=function(){function g(j,b){this.firstLevelChildren=j;this.reset();this._init(b)}g.prototype={_init:function(g){if(g)this.isExpanded=g.isExpanded,this.isExpandable=g.isExpandable,this.forceExpandFunc=g.forceExpandFunc},topLevel:function(g){return g.parent?g.parent===this.root:!0},_expanded:function(g){if(!g)return!0;var b=g.children&&g.children.length>0;this.isExpanded&&b&&(b=this.isExpanded(g));return b},_expandable:function(g){return!g?
!0:this.isExpandable?this.isExpandable(g):!1},_diveIn:function(g){return this._expanded(g)?(this.setCursor(g.children[0]),this.cursor()):null},_drillToLast:function(g){return this._expanded(g)?this._drillToLast(g.children[g.children.length-1]):g},_forward:function(g){if(!this._cursor)return null;var b=this._diveIn(this._cursor);if(!b){if(g&&this._expandable(this._cursor)&&this.forceExpandFunc){var h=this;return this.forceExpandFunc(this._cursor,"first",function(b){b&&h.setCursor(b)})}(b=this._findSibling(this._cursor,
!0))&&this.setCursor(b)}return b},_backward:function(g){if(!this._cursor)return null;var b=this._findSibling(this._cursor,!1);b&&b!==this._cursor.parent&&(b=this._drillToLast(b));if(g&&b&&this._expandable(b)&&this.forceExpandFunc&&b!==this._cursor.parent){var h=this;return this.forceExpandFunc(b,"last",function(b){b&&h.setCursor(b)})}b&&this.setCursor(b);return b},_findSibling:function(g,b){for(var h=this.topLevel(g),f=h?this.firstLevelChildren:g.parent.children,e=0;e<f.length;e++)if(f[e]===g)return e===
0&&!b?h?null:g.parent:e===f.length-1&&b?h?null:this._findSibling(g.parent,b):b?f[e+1]:f[e-1];return null},_inParentChain:function(g,b){for(var h=g.parent;h;){if(h===b)return!0;h=h.parent}return!1},_getTopLevelParent:function(g){if(this.topLevel(g))return g;for(g=g.parent;g;){if(this.topLevel(g))return g;g=g.parent}return null},_onCollapse:function(g){return this._expanded(g.parent)?g:this._onCollapse(g.parent)},_scan:function(g,b,h){this.setCursor(b);var f=[];for(f.push(b);;){if(this.iterate(g))f.push(this.cursor());
else break;if(h===this.cursor())return f}return null},setCursor:function(g){this._prevCursor=this._cursor;this._cursor=g},setTree:function(g){this.firstLevelChildren=g;if(this.firstLevelChildren.length>0)this.root=this.firstLevelChildren[0].parent},scan:function(g,b){var h=this.cursor(),f=this._scan(!0,g,b);f||(f=this._scan(!1,g,b));this.setCursor(h);return f},iterate:function(g,b){return g?this._forward(b):this._backward(b)},iterateOnTop:function(g,b){var h=this._findSibling(this._getTopLevelParent(this.cursor()),
g);h?this.setCursor(h):b&&this.firstLevelChildren.length>0&&this.setCursor(g?this.firstLevelChildren[0]:this.firstLevelChildren[this.firstLevelChildren.length-1])},collapse:function(g){if(!this._cursor)return null;return this._inParentChain(this._cursor,g)?(this.setCursor(g),this._cursor):null},reset:function(){this.root=this._prevCursor=this._cursor=null;if(this.firstLevelChildren.length>0)this._cursor=this.firstLevelChildren[0],this.root=this.firstLevelChildren[0].parent},cursorMoved:function(){return this._cursor!==
this._prevCursor},cursor:function(){return this._cursor},prevCursor:function(){return this._prevCursor}};return g}();return g});
define("orion/explorers/explorerNavHandler",["i18n!orion/nls/messages","orion/webui/littlelib","orion/treeModelIterator"],function(g,k,j){var g={},b=navigator.userAgent.indexOf("iPad")!==-1,h=window.navigator.platform.indexOf("Mac")!==-1;g.ExplorerNavHandler=function(){function f(b,d,c){this.explorer=b;this.model=this.explorer.model;this._navDict=d;this._listeners=[];this._selections=[];this._currentColumn=0;var a=this._getEventListeningDiv();a.tabIndex=0;a.classList.add("selectionModelContainer");
var i=this;this._modelIterator=new j.TreeModelIterator([],{isExpanded:this.isExpanded.bind(this),isExpandable:this.explorer.renderer.isExpandable?function(a){return i.explorer.renderer.isExpandable(a)}:function(a){return i.isExpandable(a)},forceExpandFunc:this.explorer.forceExpandFunc?function(a,c,b){return i.explorer.forceExpandFunc(a,c,b)}:void 0});this._init(c);(!c||c.setFocus!==!1)&&a.focus();b=function(c){if(c.target===a){if(i.explorer.preventDefaultFunc&&i.explorer.preventDefaultFunc(c,i._modelIterator.cursor()))return!0;
if(c.keyCode===k.KEY.DOWN)return i.onDownArrow(c);else if(c.keyCode===k.KEY.UP)return i.onUpArrow(c);else if(c.keyCode===k.KEY.RIGHT)return i.onRightArrow(c);else if(c.keyCode===k.KEY.LEFT)return i.onLeftArrow(c);else if(c.keyCode===k.KEY.SPACE)return i.onSpace(c);else if(c.keyCode===k.KEY.ENTER)return i.onEnter(c)}};a.addEventListener("keydown",b,!1);this._listeners.push({type:"keydown",listener:b});b=function(){if(i.explorer.onFocus)i.explorer.onFocus(!1);else i.toggleCursor(null,!1)};a.addEventListener("blur",
b,!1);this._listeners.push({type:"blur",listener:b});b=function(){if(i.explorer.onFocus)i.explorer.onFocus(!0);else i.toggleCursor(null,!0)};a.addEventListener("focus",b,!1);this._listeners.push({type:"focus",listener:b});this._parentDiv=a}f.prototype={_init:function(b){this._linearGridMove=!1;if(b)this._selectionPolicy=b.selectionPolicy,this.preventDefaultFunc=b.preventDefaultFunc,this.postDefaultFunc=b.postDefaultFunc},_ctrlKeyOn:function(b){return h?b.metaKey:b.ctrlKey},removeListeners:function(){if(this._listeners)for(var b=
0;b<this._listeners.length;b++)this._parentDiv.removeEventListener(this._listeners[b].type,this._listeners[b].listener,!1)},focus:function(){var b=this._getEventListeningDiv();b&&b.focus()},_getEventListeningDiv:function(b){return this.explorer.keyEventListeningDiv&&typeof this.explorer.keyEventListeningDiv==="function"?this.explorer.keyEventListeningDiv(b):k.node(this.explorer._parentId)},isExpandable:function(b){return!b?!1:k.node(this.explorer.renderer.expandCollapseImageId(this.model.getId(b)))?
!0:!1},isExpanded:function(b){return!b?!1:this.explorer.myTree.isExpanded(this.model.getId(b))},refreshSelection:function(b){var d=this;this.explorer.selection&&this.explorer.selection.getSelections(function(c){d._clearSelection();for(var a=0;a<c.length;a++)d._selections.push(c[a]);d._selections.length>0&&d.cursorOn(d._selections[0],!0,!1,b)})},refreshModel:function(b,d,c,a){this._currentColumn=0;this.topIterationNodes=[];this.model=d;this._navDict=b;if(this.model.getTopIterationNodes)this.topIterationNodes=
this.model.getTopIterationNodes();else if(c)this.topIterationNodes=c;this._modelIterator.setTree(this.topIterationNodes);!a&&this.explorer.selection&&this._modelIterator.reset();this.refreshSelection(!0)},getTopLevelNodes:function(){return this._modelIterator.firstLevelChildren},_inSelection:function(b){for(var d=0;d<this._selections.length;d++)if(b===this._selections[d])return d;return-1},_clearSelection:function(b){if(b)for(b=0;b<this._selections.length;b++)this._checkRow(this._selections[b],!0);
this._selections=[]},setSelection:function(b,d){if(this._selectionPolicy==="cursorOnly")d&&this.explorer.renderer._useCheckboxSelection&&this._checkRow(b,!0);else if(this._isRowSelectable(b)){if(!d||this._selectionPolicy==="singleSelection")this._clearSelection(!0),this._checkRow(b,!1),this._selections.push(b),this._lastSelection=b;else{var c=this._inSelection(b);c>=0?(this._checkRow(b,!0),this._selections.splice(c,1)):(this._checkRow(b,!1),this._selections.push(b),this._lastSelection=b)}this.explorer.selection&&
(this.explorer.renderer.storeSelections(),this.explorer.selection.setSelections(this._selections))}},moveColumn:function(b,d){b||(b=this.currentModel());var c=this._getGridChildren(b);if(c&&c.length>1||d===0&&c){d!==0&&this.toggleCursor(b,!1);var a=this._currentColumn,i=!0;a+=d;a<0?(this._linearGridMove&&d!==0&&(this._modelIterator.iterate(!1)?b=this.currentModel():i=!1),a=i?c.length-1:this._currentColumn):a>=c.length&&(this._linearGridMove&&d!==0&&(this._modelIterator.iterate(!0)?b=this.currentModel():
i=!1),a=i?0:this._currentColumn);this._currentColumn=a;d!==0&&this.toggleCursor(b,!0);return!0}return!1},_getGridChildren:function(b){return this._navDict?this._navDict.getGridNavHolder(b):null},getCurrentGrid:function(b){b||(b=this.currentModel());return(b=this._getGridChildren(b))&&b.length>0?b[this._currentColumn]:null},toggleCursor:function(b,d){var c=this.getRowDiv(b),a=this.getCurrentGrid(b);a?(c&&(d?c.classList.add("treeIterationCursorRow"):c.classList.remove("treeIterationCursorRow")),a.domNode&&
(d?a.domNode.classList.add("treeIterationCursor"):a.domNode.classList.remove("treeIterationCursor"))):c&&(d?c.classList.add("treeIterationCursorRow_Dotted"):c.classList.remove("treeIterationCursorRow_Dotted"))},currentModel:function(){return this._modelIterator.cursor()},cursorOn:function(b,d,c,a){var c=c===void 0?!1:c,i,f;if(b||d){if(f===this._modelIterator.cursor())return;i=this._modelIterator.cursor();f=b;this._modelIterator.setCursor(f)}else i=this._modelIterator.prevCursor(),f=this._modelIterator.cursor();
if(i!==f||d)if(this.toggleCursor(i,!1),!d||f)if(this.moveColumn(null,0),this.toggleCursor(f,!0),(b=this.getRowDiv())&&!a&&!this._visible(b)&&b.scrollIntoView(!c),this.explorer.onCursorChanged)this.explorer.onCursorChanged(i,f)},getSelection:function(){return this._selections},getSelectionIds:function(){for(var b=[],d=0;d<this._selections.length;d++)b.push(this.model.getId(this._selections[d]));return b},getRowDiv:function(b){b=b?b:this._modelIterator.cursor();if(!b)return null;var b=this.model.getId(b),
d=this._navDict.getValue(b);return d&&d.rowDomNode?d.rowDomNode:k.node(b)},iterate:function(b,d,c){this.topIterationNodes.length!==0&&this._modelIterator.iterate(b,d)&&(this.cursorOn(null,!1,b),c&&this.setSelection(this.currentModel(),!0))},_checkRow:function(b,d){if(this.explorer.renderer._useCheckboxSelection){var c=this.getRowDiv(b);if(c){var a=k.node(this.explorer.renderer.getCheckBoxId(c.id)),i=d?!a.checked:!0;if(i!==a.checked)this.explorer.renderer.onCheck(c,a,i,!0)}}else this._select(b,d)},
_vpWidth:function(){return window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth},_vpHeight:function(){return window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight},_getToolBarHeight:function(b){return(b=k.node(b))?k.bounds(b).height:0},_visible:function(b){if(b.offsetWidth===0||b.offsetHeight===0)return!1;var d=0;d+=this._getToolBarHeight("staticBanner");d+=this._getToolBarHeight("titleArea");d+=this._getToolBarHeight("pageToolbar");var c=
this._getEventListeningDiv(!0).getClientRects()[0],a=this._vpHeight();this._vpWidth();for(var d=c.top>d?c.top:d,c=c.bottom<a?c.bottom:a,b=b.getClientRects(),a=0,i=b.length;a<i;a++){var f=b[a];if(f.top>=d&&f.top<=c&&f.bottom>=d&&f.bottom<=c)return!0}return!1},_select:function(b){b||(b=this._modelIterator.cursor());var d=this.getRowDiv(b);d&&(this._inSelection(b)<0?d.classList.add("checkedRow"):d.classList.remove("checkedRow"))},_onModelGrid:function(b,d){var c=this._getGridChildren(b);if(c)for(var a=
0;a<c.length;a++)if(d.target===c[a].domNode)return!0;return!1},onClick:function(e,d){var c=k.node(this.explorer.renderer.expandCollapseImageId(this.model.getId(e)));if(d.target!==c&&!this._onModelGrid(e,d))if(this.cursorOn(e,!0,!1,!0),b)this.setSelection(e,!0);else if(this._ctrlKeyOn(d))this.setSelection(e,!0);else if(d.shiftKey&&this._lastSelection){if(c=this._modelIterator.scan(this._lastSelection,e)){this._clearSelection(!0);for(var a=0;a<c.length;a++)this.setSelection(c[a],!0)}}else this.setSelection(e,
!1)},onCollapse:function(b){this._modelIterator.collapse(b)&&this.cursorOn()},onUpArrow:function(b){this.iterate(!1,!1,b.shiftKey);!this._ctrlKeyOn(b)&&!b.shiftKey&&this.setSelection(this.currentModel(),!1);b.preventDefault();return!1},onDownArrow:function(b){this.iterate(!0,!1,b.shiftKey);!this._ctrlKeyOn(b)&&!b.shiftKey&&this.setSelection(this.currentModel(),!1);b.preventDefault();return!1},_shouldMoveColumn:function(b){var d=this.currentModel(),c=this._getGridChildren(d);return c&&c.length>1?this.isExpandable(d)?
this._ctrlKeyOn(b):!0:!1},onLeftArrow:function(b){if(this._shouldMoveColumn(b))return this.moveColumn(null,-1),b.preventDefault(),!0;var d=this._modelIterator.cursor();if(!d)return!1;if(this.isExpandable(d)&&this.isExpanded(d))return this.explorer.myTree.collapse(d),b.preventDefault(),!0;this._modelIterator.topLevel(d)?this.explorer.scopeUp&&typeof this.explorer.scopeUp==="function"&&this.explorer.scopeUp():(this.cursorOn(d.parent),this.setSelection(d.parent,!1))},onRightArrow:function(b){if(this._shouldMoveColumn(b))return this.moveColumn(null,
1),b.preventDefault(),!0;var d=this._modelIterator.cursor();if(!d)return!1;if(this.isExpandable(d)&&!this.isExpanded(d))return this.explorer.myTree.expand(d),b.preventDefault(),!1},_isRowSelectable:function(b){return this.explorer.isRowSelectable?this.explorer.isRowSelectable(b):!0},onSpace:function(b){this.setSelection(this.currentModel(),!0);b.preventDefault()},onEnter:function(b){var d=this.getCurrentGrid(this._modelIterator.cursor());if(d)if(d.widget)if(typeof d.onClick==="function")d.onClick();
else typeof d.widget.focus==="function"&&d.widget.focus();else{var c=document.createEvent("MouseEvents");c.initMouseEvent("click",!0,!0,window,0,0,0,0,0,this._ctrlKeyOn(b),!1,!1,!1,0,null);d.domNode.dispatchEvent(c)}else if(this.explorer.renderer.getRowActionElement&&(d=this._modelIterator.cursor()))if(d=this.explorer.renderer.getRowActionElement(this.model.getId(d)),d.href)this._ctrlKeyOn(b)?window.open(d.href):window.location.href=d.href}};return f}();g.ExplorerNavDict=function(){function b(e){this._dict=
{};this._model=e}b.prototype={addRow:function(b,d){this._dict[this._model.getId(b)]={model:b,rowDomNode:d}},getValue:function(b){return this._dict[b]},getGridNavHolder:function(b,d){if(!b)return null;var c=this._model.getId(b);if(this._dict[c]){if(!this._dict[c].gridChildren&&d)this._dict[c].gridChildren=[];return this._dict[c].gridChildren}return null},initGridNavHolder:function(b){if(!b)return null;b=this._model.getId(b);if(this._dict[b])this._dict[b].gridChildren=null}};return b}();return g});
define("orion/compare/nls/root/messages",{"Copy current change from right to left":"Copy current change from right to left","Switch to unified diff":"Switch to unified diff",Unified:"Unified","Switch to side by side diff":"Switch to side by side diff","Side by side":"Side by side","Generate link of the current diff":"Generate link of the current diff","Generate Link":"Generate Link","Next diff block":"Next diff block","Previous diff block":"Previous diff block","Next diff change":"Next diff change",
"Previous diff change":"Previous diff change","Copy the link URL:":"Copy the link URL:",Compare:"Compare","Open the compare page":"Open the compare page","fetching...":"fetching...","There are unsaved changes.":"There are unsaved changes.","ERROR: ":"ERROR: ","Compare...":"Compare...","files changed":" files changed",Location:"Location",Options:"Options","Sort by folders":"Sort by folders","Line 0 : Col 0":"Line 0 : Col 0","No Matching DiffService for location:":"No Matching DiffService for location:"});
define("orion/compare/nls/messages",["orion/i18n!orion/compare/nls/messages","orion/compare/nls/root/messages"],function(g,k){var j={root:k};Object.keys(g).forEach(function(b){typeof j[b]==="undefined"&&(j[b]=g[b])});return j});
define("orion/compare/diff-provider",["i18n!orion/compare/nls/messages","orion/Deferred"],function(g,k){function j(b,f,e){var d=new k;b[f].apply(b,e).then(function(c){d.resolve(c)},function(c){d.reject(c)});return d}function b(b,f){var e=b.getServiceReferences("orion.core.diff"),d=e;if(f)for(var d=[],c=0;c<e.length;++c)f(e[c])&&d.push(e[c]);for(var a=[],i=[],c=0;c<d.length;++c)a[c]=RegExp(d[c].getProperty("pattern")||".*"),i[c]=b.getService(d[c]);this._getService=function(c){if(c.indexOf("://")===
-1){var b=document.createElement("a");b.href=c;c=b.href}for(b=0;b<a.length;++b)if(a[b].test(c))return i[b];throw g["No Matching DiffService for location:"]+c;}}b.prototype={getDiffContent:function(b){return j(this._getService(b),"getDiffContent",arguments)},getDiffFileURI:function(b){return j(this._getService(b),"getDiffFileURI",arguments)}};return{DiffProvider:b}});
define("orion/compare/diff-parser",[],function(){var g=g||{};g.DiffParser=function(){function g(b,h){this._lineDelimiter=b?b:j?"\r\n":"\n";this._diffLineDelimiter=h?h:this._lineDelimiter;this._DEBUG=!1}var j=navigator.platform.indexOf("Win")!==-1;g.prototype={_init:function(){this._oFileContents=[];this._diffContents=[];this._oBlocks=[];this._nBlocks=[];this._hunkRanges=[];this._lastToken=" ";this._deltaMap=[];this._nFileContents=[];this._nNewLineAtEnd=this._oNewLineAtEnd=!0;this._diffContentIndex=
1},setLineDelim:function(b){this._diffLineDelimiter=this._lineDelimiter=b},getDiffArray:function(){return{array:this._diffContents,index:this._diffContentIndex}},parse:function(b,h,f,e){this._init();if(h==="")return{outPutFile:b,mapper:[]};this._oFileContents=b===""?[]:b.split(this._lineDelimiter);this._diffContents=h.split(this._diffLineDelimiter);h=this._diffContents.length;this._hunkRanges=[];for(var d=0;d<h;d++){var c=this._parseHunkRange(d);c&&this._hunkRanges.push(c)}if(0===this._hunkRanges.length)return{outPutFile:b,
mapper:[]};if(this._DEBUG){console.log("***Diff contents: \n");for(b=0;b<this._diffContents.length;b++)console.log(this._diffContents[b]);console.log("***Hunk ranges: \n");console.log(JSON.stringify(this._hunkRanges))}for(b=0;b<this._hunkRanges.length;b++)this._parseHunkBlock(b);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));(e===void 0||!e)&&this._buildNewFile();return{outPutFile:this._nFileContents.join(this._diffLineDelimiter),mapper:this._deltaMap}},_logMap:function(){for(var b=0;b<this._deltaMap.length;b++)if(console.log(JSON.stringify(this._deltaMap[b])),
this._deltaMap[b][2]>0){console.log("    **Diff content on change/add: \n");for(var h=0;h<this._deltaMap[b][0];h++)console.log("    "+this._diffContents[this._deltaMap[b][2]+h-1])}},_logNewFile:function(){for(var b=0;b<this._nFileContents.length;b++)console.log(this._nFileContents[b])},_createBlock:function(b,h,f,e){e===f&&b===" "||(f=[f,e-f,"s"],b==="-"?f[2]="r":b==="+"?f[2]="a":b==="c"&&(f[2]="c"),h.push(f))},_createMinusBlock:function(b,h,f){var e=this._oBlocks.length;e===0||b!==this._oBlocks[e-
1][0]?(this._oBlocks.push([b===0?1:b,f]),this._nBlocks.push([h,0,-2])):this._oBlocks[e-1][1]+=f},_createPlusBlock:function(b,h,f,e){var d=this._nBlocks.length;d===0||h!==this._nBlocks[d-1][0]?(this._oBlocks.push([b===0?1:b,0]),this._nBlocks.push([h,f,e])):(this._nBlocks[d-1][1]+=f,this._nBlocks[d-1][2]=e)},_parseHunkBlock:function(b){for(var h=" ",f=this._hunkRanges[b][0]+1,e=b===this._hunkRanges.length-1?this._diffContents.length:this._hunkRanges[b+1][0],d=0,c=0,a=this._hunkRanges[b][1],i=this._hunkRanges[b][3],
l=f,g=f;g<e;g++)if(0!==this._diffContents[g].length){var q=this._diffContents[g][0];if(q==="\\"&&("\\ No newline at end of file"===this._diffContents[g].substring(0,this._diffContents[g].length-1)||"\\ No newline at end of file"===this._diffContents[g]))h==="-"?this._oNewLineAtEnd=!1:h===" "?this._oNewLineAtEnd=this._nNewLineAtEnd=!1:this._nNewLineAtEnd=!1,g>f&&this._diffContents[g-1][this._diffContents[g-1].length-1]==="\r"&&(this._diffContents[g-1]=this._diffContents[g-1].substring(0,this._diffContents[g-
1].length-1));else{switch(q){case "-":case "+":case " ":break;default:continue}if(h!==q){q==="+"&&(l=g);switch(h){case " ":a=this._hunkRanges[b][1]+d;i=this._hunkRanges[b][3]+c;break;case "-":this._createMinusBlock(a,i,this._hunkRanges[b][1]+d-a);break;case "+":this._createPlusBlock(a,i,this._hunkRanges[b][3]+c-i,l)}h=q}switch(q){case "-":d++;break;case "+":c++;break;case " ":d++,c++}}}switch(h){case "-":this._createMinusBlock(a,i,this._hunkRanges[b][1]+d-a);break;case "+":this._createPlusBlock(a,
i,this._hunkRanges[b][3]+c-i,l)}},_detectConflictes:function(b,h){if(b<0)return!1;for(var f=b+h,e=b;e<f;e++){var d=this._diffContents[e];if(d.indexOf("<<<<<")>-1||d.indexOf(">>>>>")>-1)return!0}return!1},_buildMap:function(b){for(var h=this._oBlocks.length,f=this._oFileContents.length,e=0,d=1,c=0;c<h;c++)d=this._oBlocks[c][0]-d,d>0&&(this._deltaMap.push([d,d,0]),e+=d),b&&this._detectConflictes(this._nBlocks[c][2],this._nBlocks[c][1])?this._deltaMap.push([this._nBlocks[c][1],this._oBlocks[c][1],this._nBlocks[c][2]+
1,1]):this._deltaMap.push([this._nBlocks[c][1],this._oBlocks[c][1],this._nBlocks[c][2]+1]),e+=this._oBlocks[c][1],d=this._oBlocks[c][0]+this._oBlocks[c][1];0<f-d&&(this._deltaMap.push([f-d+1,f-d+1,0]),e+=f-d+1);e<f&&(d=f-e,b=this._deltaMap[this._deltaMap.length-1],b[2]===0?(b[0]+=d,b[1]+=d):b[2]===-1?this._deltaMap.push([d,d,0]):this._nNewLineAtEnd===this._oNewLineAtEnd?this._deltaMap.push([d,d,0]):(this._nNewLineAtEnd&&(b[0]+=d),this._oNewLineAtEnd&&(b[1]+=d)))},_buildNewFile:function(){for(var b=
1,h=!1,f=this._deltaMap.length,e=0;e<f;e++){h=!1;if(this._deltaMap[e][2]===0){for(var d=0;d<this._deltaMap[e][0];d++)this._nFileContents.push(this._oFileContents[b+d-1]);h=!0}else if(this._deltaMap[e][2]>0)for(d=0;d<this._deltaMap[e][0];d++)this._nFileContents.push(this._diffContents[this._deltaMap[e][2]+d-1].substring(1));b+=this._deltaMap[e][1]}this._nNewLineAtEnd&&!h&&this._nFileContents.push("")},_parseHRangeBody:function(b,h){if(0<b.indexOf(",")){var f=b.split(","),e=parseInt(f[0]),f=parseInt(f[1]);
h.push(e>=0?e:1);h.push(f>=0?f:1)}else e=parseInt(b),h.push(e>=0?e:1),h.push(1)},_parseHunkRange:function(b){var h=this._diffContents[b];if(!(8>h.length)&&"@@"===h.substring(0,2)){var h=h.substring(2),f=h.indexOf("@@");if(!(f<0)){var h=h.substring(0,f),f=h.indexOf("-"),e=h.indexOf("+");if(!(f<0||e<0))return b=[b],f<e?(h=h.substring(f+1).split("+"),this._parseHRangeBody(h[0],b),this._parseHRangeBody(h[1],b)):(h=h.substring(e+1).split("-"),this._parseHRangeBody(h[1],b),this._parseHRangeBody(h[0],b)),
b}}}};return g}();return g});
define("orion/editor/eventTarget",[],function(){function g(){}g.addMixin=function(k){var j=g.prototype,b;for(b in j)j.hasOwnProperty(b)&&(k[b]=j[b])};g.prototype={addEventListener:function(g,j,b){if(!this._eventTypes)this._eventTypes={};var h=this._eventTypes[g];h||(h=this._eventTypes[g]={level:0,listeners:[]});h.listeners.push({listener:j,useCapture:b})},dispatchEvent:function(g){var j=g.type;this._dispatchEvent("pre"+j,g);this._dispatchEvent(j,g);this._dispatchEvent("post"+j,g)},_dispatchEvent:function(g,
j){var b=this._eventTypes?this._eventTypes[g]:null;if(b){var h=b.listeners;try{if(b.level++,h)for(var f=0,e=h.length;f<e;f++)if(h[f]){var d=h[f].listener;typeof d==="function"?d.call(this,j):d.handleEvent&&typeof d.handleEvent==="function"&&d.handleEvent(j)}}finally{if(b.level--,b.compact&&b.level===0){for(f=h.length-1;f>=0;f--)h[f]||h.splice(f,1);h.length===0&&delete this._eventTypes[g];b.compact=!1}}}},isListening:function(g){return!this._eventTypes?!1:this._eventTypes[g]!==void 0},removeEventListener:function(g,
j,b){if(this._eventTypes){var h=this._eventTypes[g];if(h){for(var f=h.listeners,e=0,d=f.length;e<d;e++){var c=f[e];if(c&&c.listener===j&&c.useCapture===b){h.level!==0?(f[e]=null,h.compact=!0):f.splice(e,1);break}}f.length===0&&delete this._eventTypes[g]}}}};return{EventTarget:g}});define("orion/editor/i18n",{load:function(g,k,j){k.specified&&k.specified("orion/bootstrap")?k(["orion/i18n!"+g],function(b){j(b)}):j({})}});
define("orion/editor/nls/root/messages",{multipleAnnotations:"Multiple annotations:",line:"Line: ${0}",breakpoint:"Breakpoint",bookmark:"Bookmark",task:"Task",error:"Error",warning:"Warning",matchingSearch:"Matching Search",currentSearch:"Current Search",currentLine:"Current Line",matchingBracket:"Matching Bracket",currentBracket:"Current Bracket",Comment:"Comment","Flat outline":"Flat outline",incrementalFind:"Incremental find: ${0}",incrementalFindNotFound:"Incremental find: ${0} (not found)",find:"Find...",
undo:"Undo",redo:"Redo",cancelMode:"Cancel Current Mode",findNext:"Find Next Occurrence",findPrevious:"Find Previous Occurrence",incrementalFindKey:"Incremental Find",indentLines:"Indent Lines",unindentLines:"Unindent Lines",moveLinesUp:"Move Lines Up",moveLinesDown:"Move Lines Down",copyLinesUp:"Copy Lines Up",copyLinesDown:"Copy Lines Down",deleteLines:"Delete Lines",gotoLine:"Goto Line...",gotoLinePrompty:"Goto Line:",nextAnnotation:"Next Annotation",prevAnnotation:"Previous Annotation",expand:"Expand",
collapse:"Collapse",expandAll:"Expand All",collapseAll:"Collapse All",lastEdit:"Last Edit Location",toggleLineComment:"Toggle Line Comment",addBlockComment:"Add Block Comment",removeBlockComment:"Remove Block Comment",linkedModeEntered:"Linked Mode entered",linkedModeExited:"Linked Mode exited",syntaxError:"Syntax Error",contentAssist:"Content Assist",lineColumn:"Line ${0} : Col ${1}"});
define("orion/editor/nls/messages",["orion/editor/i18n!orion/editor/nls/messages","orion/editor/nls/root/messages"],function(g,k){var j={root:k},b;for(b in g)g.hasOwnProperty(b)&&typeof j[b]==="undefined"&&(j[b]=g[b]);return j});
define("orion/editor/contentAssist",["i18n!orion/editor/nls/messages","orion/editor/keyBinding","orion/editor/eventTarget","orion/Deferred","orion/editor/util"],function(g,k,j,b,h){var f,e,d;function c(a){this.textView=a;this.state=f;this.providers=[];var c=this;this.contentAssistListener={onModelChanging:function(a){c.isDeactivatingChange(a)?c.setState(f):c.state===e&&c.setState(d)},onScroll:function(){c.setState(f)},onSelection:function(){var a=c.state;if(a===e||a===d)c.computeProposals(),c.setState(d)}};
a.setKeyBinding(h.isMac?new k.KeyBinding(" ",!1,!1,!1,!0):new k.KeyBinding(" ",!0),"contentAssist");a.setAction("contentAssist",function(){c.activate();return!0},{name:g.contentAssist})}function a(a,c){this.contentAssist=a;this.widget=c;this.proposals=[];var b=this;this.contentAssist.addEventListener("ProposalsComputed",function(a){b.proposals=a.data.proposals;b.selectedIndex=b.proposals.length?0:-1})}function i(a,c){this.contentAssist=a;this.textView=this.contentAssist.getTextView();this.isShowing=
this.textViewListenerAdded=!1;var b=this.textView.getOptions("parent").ownerDocument;this.parentNode=typeof c==="string"?b.getElementById(c):c;if(!this.parentNode){this.parentNode=h.createElement(b,"div");this.parentNode.className="contentassist";var m=b.getElementsByTagName("body")[0];if(m)m.appendChild(this.parentNode);else throw Error("parentNode is required");}var d=this;this.textViewListener={onMouseDown:function(a){a.event.target.parentElement!==d.parentNode&&d.contentAssist.deactivate()}};
this.contentAssist.addEventListener("ProposalsComputed",function(a){d.setProposals(a.data.proposals);d.show();if(!d.textViewListenerAdded)d.textView.addEventListener("MouseDown",d.textViewListener.onMouseDown),d.textViewListenerAdded=!0});this.contentAssist.addEventListener("Deactivating",function(){d.setProposals([]);d.hide();if(d.textViewListenerAdded)d.textView.removeEventListener("MouseDown",d.textViewListener.onMouseDown),d.textViewListenerAdded=!1;d.textViewListenerAdded=!1});this.scrollListener=
function(){d.isShowing&&d.position()};b.addEventListener("scroll",this.scrollListener)}f=1;e=2;d=3;var l={selected:" selected",hr:"proposal-hr",emphasis:"proposal-emphasis",noemphasis:"proposal-noemphasis",dfault:"proposal-default"};c.prototype={apply:function(a){if(!a)return!1;var c=this.textView.getCaretOffset(),b={proposal:a,start:c,end:c};this.setState(f);this.textView.setText(a.proposal||a,c,c);this.dispatchEvent({type:"ProposalApplied",data:b});return!0},activate:function(){this.state===f&&
this.setState(e)},deactivate:function(){this.setState(f)},getTextView:function(){return this.textView},isActive:function(){return this.state===e||this.state===d},isDeactivatingChange:function(a){var c=a.removedCharCount>0&&a.addedCharCount===0,b=this.textView,b=a.start+1<=b.getModel().getCharCount()&&/^\s*$/.test(b.getText(a.start,a.start+1));return a.removedLineCount>0||a.addedLineCount>0||c&&b},setState:function(a){var c;a===e?c="Activating":a===f&&(c="Deactivating");c&&this.dispatchEvent({type:c});
this.state=a;this.onStateChange(a)},onStateChange:function(a){if(a===f){if(this.listenerAdded)this.textView.removeEventListener("ModelChanging",this.contentAssistListener.onModelChanging),this.textView.removeEventListener("Scroll",this.contentAssistListener.onScroll),this.textView.removeEventListener("Selection",this.contentAssistListener.onSelection),this.listenerAdded=!1}else if(a===e){if(!this.listenerAdded)this.textView.addEventListener("ModelChanging",this.contentAssistListener.onModelChanging),
this.textView.addEventListener("Scroll",this.contentAssistListener.onScroll),this.textView.addEventListener("Selection",this.contentAssistListener.onSelection),this.listenerAdded=!0;this.computeProposals()}},computeProposals:function(){var a=this;this._computeProposals(this.textView.getCaretOffset()).then(function(c){a.dispatchEvent({type:"ProposalsComputed",data:{proposals:c}})})},getPrefixStart:function(a){for(;a>0&&/[A-Za-z0-9_]/.test(this.textView.getText(a-1,a));)a--;return a},handleError:function(a){typeof console!==
"undefined"&&(console.log("Error retrieving content assist proposals"),console.log(a))},_computeProposals:function(a){var c=this.providers,d=this.textView,m=d.getModel(),i=d.getText(),o={line:m.getLine(m.getLineAtOffset(a)),prefix:d.getText(this.getPrefixStart(a),a),selection:d.getSelection()},e=this,c=c.map(function(c){var m=c.computeProposals||c.getProposals,d;try{typeof m==="function"&&(d=e.progress?e.progress.progress(m.apply(c,[i,a,o]),"Generating content assist proposal"):m.apply(c,[i,a,o]))}catch(f){e.handleError(f)}return b.when(d)});
return b.all(c,this.handleError).then(function(a){return a.reduce(function(a,c){return c instanceof Array?a.concat(c):a},[])})},setProviders:function(a){this.providers=a.slice(0)},setProgress:function(a){this.progress=a}};j.EventTarget.addMixin(c.prototype);a.prototype={cancel:function(){this.getContentAssist().deactivate()},getContentAssist:function(){return this.contentAssist},isActive:function(){return this.getContentAssist().isActive()},lineUp:function(){for(var a=this.selectedIndex===0?this.proposals.length-
1:this.selectedIndex-1;this.proposals[a].unselectable&&a>0;)a--;this.selectedIndex=a;this.widget&&this.widget.setSelectedIndex(this.selectedIndex);return!0},lineDown:function(){for(var a=this.selectedIndex===this.proposals.length-1?0:this.selectedIndex+1;this.proposals[a].unselectable&&a<this.proposals.length-1;)a++;this.selectedIndex=a;this.widget&&this.widget.setSelectedIndex(this.selectedIndex);return!0},enter:function(){return this.contentAssist.apply(this.proposals[this.selectedIndex]||null)},
tab:function(){return this.widget?(this.widget.createAccessible(this),this.widget.parentNode.focus(),!0):!1}};i.prototype={onClick:function(a){this.contentAssist.apply(this.getProposal(a.target));this.textView.focus()},createDiv:function(a,c,b,m){var d=b.ownerDocument,i=h.createElement(d,"div");i.id="contentoption"+m;i.setAttribute("role","option");a.style==="hr"?a=h.createElement(d,"hr"):(i.className=this.calculateClasses(a.style,c),a=d.createTextNode(this.getDisplayString(a)),c&&this.parentNode.setAttribute("aria-activedescendant",
i.id));i.appendChild(a,i);b.appendChild(i)},createAccessible:function(a){this._isAccessible||this.parentNode.addEventListener("keydown",function(c){c.preventDefault();if(c.keyCode===27)return a.cancel();else if(c.keyCode===38)return a.lineUp();else if(c.keyCode===40)return a.lineDown();else if(c.keyCode===13)return a.enter();return!1});this._isAccessible=!0},calculateClasses:function(a,c){var b=l[a];if(!b)b=l.dfault;return c?b+l.selected:b},getDisplayString:function(a){return typeof a==="string"?
a:a.description&&typeof a.description==="string"?a.description:a.proposal},getProposal:function(a){for(var c=0,b=this.parentNode.firstChild;b!==null;b=b.nextSibling){if(b===a)return this.proposals[c]||null;c++}return null},setSelectedIndex:function(a){this.selectedIndex=a;this.selectNode(this.parentNode.childNodes[this.selectedIndex])},selectNode:function(a){for(var c=this.parentNode.childNodes,b=0;b<c.length;b++){var m=c[b],d=m.className.indexOf(l.selected);if(d>=0)m.className=m.className.substring(0,
d)+m.className.substring(d+l.selected.length);m===a&&(m.className+=l.selected,this.parentNode.setAttribute("aria-activedescendant",m.id),m.focus(),m.offsetTop<this.parentNode.scrollTop?m.scrollIntoView(!0):m.offsetTop+m.offsetHeight>this.parentNode.scrollTop+this.parentNode.clientHeight&&m.scrollIntoView(!1))}},setProposals:function(a){this.proposals=a},show:function(){if(this.proposals.length===0)this.hide();else{this.parentNode.innerHTML="";for(var a=0;a<this.proposals.length;a++)this.createDiv(this.proposals[a],
a===0,this.parentNode,a);this.position();this.parentNode.onclick=this.onClick.bind(this);this.isShowing=!0}},hide:function(){this.parentNode.ownerDocument.activeElement===this.parentNode&&this.textView.focus();this.parentNode.style.display="none";this.parentNode.onclick=null;this.isShowing=!1},position:function(){var a=this.textView.getLocationAtOffset(this.textView.getCaretOffset());a.y+=this.textView.getLineHeight();this.textView.convert(a,"document","page");this.parentNode.style.position="fixed";
this.parentNode.style.left=a.x+"px";this.parentNode.style.top=a.y+"px";this.parentNode.style.display="block";this.parentNode.scrollTop=0;var c=this.parentNode.ownerDocument,b=c.documentElement.clientWidth;if(a.y+this.parentNode.offsetHeight>c.documentElement.clientHeight)this.parentNode.style.top=a.y-this.parentNode.offsetHeight-this.textView.getLineHeight()+"px";if(a.x+this.parentNode.offsetWidth>b)this.parentNode.style.left=b-this.parentNode.offsetWidth+"px"}};return{ContentAssist:c,ContentAssistMode:a,
ContentAssistWidget:i}});
define("orion/editor/undoStack",[],function(){function g(b,h,f){this.offset=b;this.text=h;this.previousText=f}function k(){this.changes=[]}function j(b,h){this.view=b;this.size=h!==void 0?h:100;this.reset();var f=b.getModel();f.getBaseModel&&(f=f.getBaseModel());this.model=f;var e=this;this._listener={onChanging:function(b){e._onChanging(b)},onDestroy:function(b){e._onDestroy(b)}};f.addEventListener("Changing",this._listener.onChanging);b.addEventListener("Destroy",this._listener.onDestroy)}g.prototype=
{undo:function(b,h){this._doUndoRedo(this.offset,this.previousText,this.text,b,h)},redo:function(b,h){this._doUndoRedo(this.offset,this.text,this.previousText,b,h)},_doUndoRedo:function(b,h,f,e,d){var c=e.getModel();if(c.mapOffset&&e.annotationModel){var a=c.mapOffset(b,!0);if(a<0)for(var i=e.annotationModel.getAnnotations(b,b+1);i.hasNext();){var l=i.next();if(l.type==="orion.annotation.folding"){l.expand();a=c.mapOffset(b,!0);break}}if(a<0)return;b=a}e.setText(h,b,b+f.length);d&&e.setSelection(b,
b+h.length)}};k.prototype={add:function(b){this.changes.push(b)},end:function(b){this.endSelection=b.getSelection();this.endCaret=b.getCaretOffset()},undo:function(b,h){for(var f=this.changes.length-1;f>=0;f--)this.changes[f].undo(b,!1);if(h){var f=this.startSelection.start,e=this.startSelection.end;b.setSelection(this.startCaret?f:e,this.startCaret?e:f)}},redo:function(b,h){for(var f=0;f<this.changes.length;f++)this.changes[f].redo(b,!1);if(h){var f=this.endSelection.start,e=this.endSelection.end;
b.setSelection(this.endCaret?f:e,this.endCaret?e:f)}},start:function(b){this.startSelection=b.getSelection();this.startCaret=b.getCaretOffset()}};j.prototype={add:function(b){this.compoundChange?this.compoundChange.add(b):(this.stack.splice(this.index,this.stack.length-this.index,b),this.index++,this.stack.length>this.size&&(this.stack.shift(),this.index--,this.cleanIndex--))},markClean:function(){this.endCompoundChange();this._commitUndo();this.cleanIndex=this.index},isClean:function(){return this.cleanIndex===
this.getSize().undo},canUndo:function(){return this.getSize().undo>0},canRedo:function(){return this.getSize().redo>0},endCompoundChange:function(){this.compoundChange&&this.compoundChange.end(this.view);this.compoundChange=void 0},getSize:function(){var b=this.index,h=this.stack.length;this._undoStart!==void 0&&b++;return{undo:b,redo:h-b}},undo:function(){this._commitUndo();if(this.index<=0)return!1;var b=this.stack[--this.index];this._ignoreUndo=!0;b.undo(this.view,!0);this._ignoreUndo=!1;return!0},
redo:function(){this._commitUndo();if(this.index>=this.stack.length)return!1;var b=this.stack[this.index++];this._ignoreUndo=!0;b.redo(this.view,!0);this._ignoreUndo=!1;return!0},reset:function(){this.index=this.cleanIndex=0;this.stack=[];this._undoStart=void 0;this._undoText="";this._undoType=0;this._ignoreUndo=!1;this._compoundChange=void 0},startCompoundChange:function(){this._commitUndo();var b=new k;this.add(b);this.compoundChange=b;this.compoundChange.start(this.view)},_commitUndo:function(){if(this._undoStart!==
void 0)this._undoType===-1?this.add(new g(this._undoStart,"",this._undoText)):this.add(new g(this._undoStart,this._undoText,"")),this._undoStart=void 0,this._undoText="",this._undoType=0},_onDestroy:function(){this.model.removeEventListener("Changing",this._listener.onChanging);this.view.removeEventListener("Destroy",this._listener.onDestroy)},_onChanging:function(b){var h=b.text,f=b.start,e=b.removedCharCount,b=b.addedCharCount;if(!this._ignoreUndo){this._undoStart!==void 0&&!(b===1&&e===0&&this._undoType===
1&&f===this._undoStart+this._undoText.length||b===0&&e===1&&this._undoType===-1&&(f+1===this._undoStart||f===this._undoStart))&&this._commitUndo();if(!this.compoundChange)if(b===1&&e===0){if(this._undoStart===void 0)this._undoStart=f;this._undoText+=h;this._undoType=1;return}else if(b===0&&e===1){h=this._undoText.length>0&&this._undoStart===f;this._undoStart=f;this._undoType=-1;h?this._undoText+=this.model.getText(f,f+e):this._undoText=this.model.getText(f,f+e)+this._undoText;return}this.add(new g(f,
h,this.model.getText(f,f+e)))}}};return{UndoStack:j}});
define("orion/edit/nls/root/messages",{"Fetching ":"Fetching ","An error occurred: ":"An error occurred: ","No File Selected":"No File Selected","There are unsaved changes.  Do you still want to navigate away?":"There are unsaved changes.  Do you still want to navigate away?","Search Files":"Search Files","Enter search term:":"Enter search term:","Searching for occurrences of ":"Searching for occurrences of ","Toggle Outliner":"Toggle Outliner","There are unsaved changes.":"There are unsaved changes.",
Save:"Save","Resource is out of sync with the server. Do you want to save it anyway?":"Resource is out of sync with the server. Do you want to save it anyway?","Save this file":"Save this file","Go to Line":"Go to Line","Go to specified line number":"Go to specified line number","Go to line:":"Go to line:",Undo:"Undo",Redo:"Redo",Find:"Find","No response from server.  Check your internet connection and try again.":"No response from server.  Check your internet connection and try again.","Saving file {0}":"Saving file {0}",
"Running {0}":"Running {0}"});define("orion/edit/nls/messages",["orion/i18n!orion/edit/nls/messages","orion/edit/nls/root/messages"],function(g,k){var j={root:k};Object.keys(g).forEach(function(b){typeof j[b]==="undefined"&&(j[b]=g[b])});return j});
define("orion/editor/annotations",["i18n!orion/editor/nls/messages","orion/editor/eventTarget"],function(g,k){function j(a,c,b){this.start=a;this.end=c;this._projectionModel=b;this.html=this._expandedHTML;this.style=this._expandedStyle;this.expanded=!0}function b(){}function h(a,c){var d=a.lastIndexOf("."),d=a.substring(d+1),e={title:g[d],style:{styleClass:"annotation "+d},html:"<div class='annotationHTML "+d+"'></div>",overviewStyle:{styleClass:"annotationOverview "+d}};c?e.lineStyle={styleClass:"annotationLine "+
d}:e.rangeStyle={styleClass:"annotationRange "+d};b.registerType(a,e)}function f(){}function e(a){this._annotations=[];var c=this;this._listener={onChanged:function(a){c._onChanged(a)}};this.setTextModel(a)}function d(a,c){this._view=a;this._annotationModel=c;var b=this;this._listener={onDestroy:function(a){b._onDestroy(a)},onLineStyle:function(a){b._onLineStyle(a)},onChanged:function(a){b._onAnnotationModelChanged(a)}};a.addEventListener("Destroy",this._listener.onDestroy);a.addEventListener("postLineStyle",
this._listener.onLineStyle);c.addEventListener("Changed",this._listener.onChanged)}j.prototype={_expandedHTML:"<div class='annotationHTML expanded'></div>",_expandedStyle:{styleClass:"annotation expanded"},_collapsedHTML:"<div class='annotationHTML collapsed'></div>",_collapsedStyle:{styleClass:"annotation collapsed"},collapse:function(){if(this.expanded){this.expanded=!1;this.html=this._collapsedHTML;this.style=this._collapsedStyle;var a=this._projectionModel,c=a.getBaseModel();this._projection=
{start:c.getLineStart(c.getLineAtOffset(this.start)+1),end:c.getLineEnd(c.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)}};b.ANNOTATION_ERROR="orion.annotation.error";b.ANNOTATION_WARNING="orion.annotation.warning";b.ANNOTATION_TASK="orion.annotation.task";b.ANNOTATION_BREAKPOINT="orion.annotation.breakpoint";
b.ANNOTATION_BOOKMARK="orion.annotation.bookmark";b.ANNOTATION_FOLDING="orion.annotation.folding";b.ANNOTATION_CURRENT_BRACKET="orion.annotation.currentBracket";b.ANNOTATION_MATCHING_BRACKET="orion.annotation.matchingBracket";b.ANNOTATION_CURRENT_LINE="orion.annotation.currentLine";b.ANNOTATION_CURRENT_SEARCH="orion.annotation.currentSearch";b.ANNOTATION_MATCHING_SEARCH="orion.annotation.matchingSearch";b.ANNOTATION_READ_OCCURRENCE="orion.annotation.readOccurrence";b.ANNOTATION_WRITE_OCCURRENCE="orion.annotation.writeOccurrence";
var c={};b.registerType=function(a,b){var d=b;if(typeof d!=="function")d=function(a,c,b){this.start=a;this.end=c;if(b)this.title=b},d.prototype=b;d.prototype.type=a;c[a]=d;return a};b.createAnnotation=function(a,c,b,d){return new (this.getType(a))(c,b,d)};b.getType=function(a){return c[a]};h(b.ANNOTATION_ERROR);h(b.ANNOTATION_WARNING);h(b.ANNOTATION_TASK);h(b.ANNOTATION_BREAKPOINT);h(b.ANNOTATION_BOOKMARK);h(b.ANNOTATION_CURRENT_BRACKET);h(b.ANNOTATION_MATCHING_BRACKET);h(b.ANNOTATION_CURRENT_SEARCH);
h(b.ANNOTATION_MATCHING_SEARCH);h(b.ANNOTATION_READ_OCCURRENCE);h(b.ANNOTATION_WRITE_OCCURRENCE);h(b.ANNOTATION_CURRENT_LINE,!0);b.registerType(b.ANNOTATION_FOLDING,j);f.addMixin=function(a){var c=f.prototype,b;for(b in c)c.hasOwnProperty(b)&&(a[b]=c[b])};f.prototype={addAnnotationType:function(a){if(!this._annotationTypes)this._annotationTypes=[];this._annotationTypes.push(a)},getAnnotationTypePriority:function(a){if(this._annotationTypes)for(var c=0;c<this._annotationTypes.length;c++)if(this._annotationTypes[c]===
a)return c+1;return 0},getAnnotationsByType:function(a,c,b){a=a.getAnnotations(c,b);for(b=[];a.hasNext();)c=a.next(),this.getAnnotationTypePriority(c.type)!==0&&b.push(c);var d=this;b.sort(function(a,c){return d.getAnnotationTypePriority(a.type)-d.getAnnotationTypePriority(c.type)});return b},isAnnotationTypeVisible:function(a){return this.getAnnotationTypePriority(a)!==0},removeAnnotationType:function(a){if(this._annotationTypes)for(var c=0;c<this._annotationTypes.length;c++)if(this._annotationTypes[c]===
a){this._annotationTypes.splice(c,1);break}}};e.prototype={addAnnotation:function(a){if(a){var c=this._annotations,b=this._binarySearch(c,a.start);c.splice(b,0,a);this.onChanged({type:"Changed",added:[a],removed:[],changed:[]})}},getTextModel:function(){return this._model},getAnnotations:function(a,c){var b=this._annotations,d,e=0,f=function(){for(;e<b.length;){var m=b[e++];if(a===m.start||(a>m.start?a<m.end:m.start<c))return m;if(m.start>=c)break}return null};d=f();return{next:function(){var a=d;
a&&(d=f());return a},hasNext:function(){return d!==null}}},modifyAnnotation:function(a){if(a&&!(this._getAnnotationIndex(a)<0))this.onChanged({type:"Changed",added:[],removed:[],changed:[a]})},onChanged:function(a){return this.dispatchEvent(a)},removeAnnotations:function(a){var c=this._annotations,b,d;if(a){b=[];for(d=c.length-1;d>=0;d--){var e=c[d];e.type===a&&c.splice(d,1);b.splice(0,0,e)}}else b=c;this.onChanged({type:"Changed",removed:b,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,c){var b=this._annotations,d,e,f,m=[];if(a)for(d=a.length-1;d>=0;d--)f=a[d],e=this._getAnnotationIndex(f),e<0||(b.splice(e,1),m.splice(0,0,f));c||(c=[]);for(d=0;d<c.length;d++)f=c[d],e=this._binarySearch(b,f.start),b.splice(e,0,f);this.onChanged({type:"Changed",removed:m,added:c,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,c){for(var b=a.length,d=-1,e;b-d>1;)e=Math.floor((b+d)/2),c<=a[e].start?b=e:d=e;return b},_getAnnotationIndex:function(a){for(var c=this._annotations,b=this._binarySearch(c,a.start);b<c.length&&c[b].start===a.start;){if(c[b]===a)return b;b++}return-1},_onChanged:function(a){var c=a.start,b=a.removedCharCount,d=this._annotations,e=c+b;if(0<d.length){for(var f={type:"Changed",
added:[],removed:[],changed:[],textModelChangedEvent:a},a=a.addedCharCount-b,b=0;b<d.length;b++){var m=d[b];m.start>=e?(m.start+=a,m.end+=a,f.changed.push(m)):m.end<=c||(m.start<c&&e<m.end?(m.end+=a,f.changed.push(m)):(d.splice(b,1),f.removed.push(m),b--))}if(f.added.length>0||f.removed.length>0||f.changed.length>0)this.onChanged(f)}}};k.EventTarget.addMixin(e.prototype);d.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,c){if(c){a||(a={});a.styleClass&&c.styleClass&&a.styleClass!==c.styleClass?a.styleClass+=" "+c.styleClass:a.styleClass=c.styleClass;var b;if(c.style){if(!a.style)a.style={};for(b in c.style)a.style[b]||(a.style[b]=c.style[b])}if(c.attributes){if(!a.attributes)a.attributes={};for(b in c.attributes)a.attributes[b]||(a.attributes[b]=c.attributes[b])}}return a},
_mergeStyleRanges:function(a,c){a||(a=[]);var b,d;for(d=0;d<a.length&&c;d++){var e=a[d];if(c.end<=e.start)break;if(!(c.start>=e.end)){b=this._mergeStyle({},e.style);b=this._mergeStyle(b,c.style);var f=[];f.push(d,1);c.start<e.start&&f.push({start:c.start,end:e.start,style:c.style});c.start>e.start&&f.push({start:e.start,end:c.start,style:e.style});f.push({start:Math.max(e.start,c.start),end:Math.min(e.end,c.end),style:b});c.end<e.end&&f.push({start:c.end,end:e.end,style:e.style});c=c.end>e.end?{start:e.end,
end:c.end,style:c.style}:null;Array.prototype.splice.apply(a,f)}}c&&(b=this._mergeStyle({},c.style),a.splice(d,0,{start:c.start,end:c.end,style:b}));return a},_onAnnotationModelChanged:function(a){function c(a){for(var m=0;m<a.length;m++)if(d.isAnnotationTypeVisible(a[m].type)){var i=a[m].start,o=a[m].end;e.getBaseModel&&(i=e.mapOffset(i,!0),o=e.mapOffset(o,!0));i!==-1&&o!==-1&&b.redrawRange(i,o)}}if(!a.textModelChangedEvent){var b=this._view;if(b){var d=this,e=b.getModel();c(a.added);c(a.removed);
c(a.changed)}}},_onDestroy:function(){this.destroy()},_onLineStyle:function(a){var c=this._annotationModel,b=a.textView.getModel(),d=c.getTextModel(),e=a.lineStart,f=a.lineStart+a.lineText.length;d!==b&&(e=b.mapOffset(e),f=b.mapOffset(f));for(c=c.getAnnotations(e,f);c.hasNext();)if(e=c.next(),this.isAnnotationTypeVisible(e.type)){if(e.rangeStyle){var f=e.start,m=e.end;d!==b&&(f=b.mapOffset(f,!0),m=b.mapOffset(m,!0));a.ranges=this._mergeStyleRanges(a.ranges,{start:f,end:m,style:e.rangeStyle})}if(e.lineStyle)a.style=
this._mergeStyle({},a.style),a.style=this._mergeStyle(a.style,e.lineStyle)}}};f.addMixin(d.prototype);return{FoldingAnnotation:j,AnnotationType:b,AnnotationTypeList:f,AnnotationModel:e,AnnotationStyler:d}});
define("orion/editor/textDND",[],function(){function g(g,j){this._view=g;this._undoStack=j;this._dragSelection=null;this._dropOffset=-1;this._dropText=null;var b=this;this._listener={onDragStart:function(h){b._onDragStart(h)},onDragEnd:function(h){b._onDragEnd(h)},onDragEnter:function(h){b._onDragEnter(h)},onDragOver:function(h){b._onDragOver(h)},onDrop:function(h){b._onDrop(h)},onDestroy:function(h){b._onDestroy(h)}};g.addEventListener("DragStart",this._listener.onDragStart);g.addEventListener("DragEnd",
this._listener.onDragEnd);g.addEventListener("DragEnter",this._listener.onDragEnter);g.addEventListener("DragOver",this._listener.onDragOver);g.addEventListener("Drop",this._listener.onDrop);g.addEventListener("Destroy",this._listener.onDestroy)}g.prototype={destroy:function(){var g=this._view;if(g)g.removeEventListener("DragStart",this._listener.onDragStart),g.removeEventListener("DragEnd",this._listener.onDragEnd),g.removeEventListener("DragEnter",this._listener.onDragEnter),g.removeEventListener("DragOver",
this._listener.onDragOver),g.removeEventListener("Drop",this._listener.onDrop),g.removeEventListener("Destroy",this._listener.onDestroy),this._view=null},_onDestroy:function(){this.destroy()},_onDragStart:function(g){var j=this._view,b=j.getSelection(),j=j.getModel();if(j.getBaseModel)b.start=j.mapOffset(b.start),b.end=j.mapOffset(b.end),j=j.getBaseModel();if(j=j.getText(b.start,b.end))this._dragSelection=b,g.event.dataTransfer.effectAllowed="copyMove",g.event.dataTransfer.setData("Text",j)},_onDragEnd:function(g){var j=
this._view;if(this._dragSelection){this._undoStack&&this._undoStack.startCompoundChange();(g=g.event.dataTransfer.dropEffect==="move")&&j.setText("",this._dragSelection.start,this._dragSelection.end);if(this._dropText){var b=this._dropText,h=this._dropOffset;if(g)if(h>=this._dragSelection.end)h-=this._dragSelection.end-this._dragSelection.start;else if(h>=this._dragSelection.start)h=this._dragSelection.start;j.setText(b,h,h);j.setSelection(h,h+b.length);this._dropText=null;this._dropOffset=-1}this._undoStack&&
this._undoStack.endCompoundChange()}this._dragSelection=null},_onDragEnter:function(g){this._onDragOver(g)},_onDragOver:function(g){var j=g.event.dataTransfer.types;if(j){var b=!this._view.getOptions("readonly");b&&(b=j.contains?j.contains("text/plain"):j.indexOf("text/plain")!==-1);if(!b)g.event.dataTransfer.dropEffect="none"}},_onDrop:function(g){var j=this._view,b=g.event.dataTransfer.getData("Text");if(b)g=j.getOffsetAtLocation(g.x,g.y),this._dragSelection?(this._dropOffset=g,this._dropText=b):
(j.setText(b,g,g),j.setSelection(g,g+b.length))}};return{TextDND:g}});
define("orion/editor/textModel",["orion/editor/eventTarget","orion/editor/util"],function(g,k){function j(b,h){this._lastLineIndex=-1;this._text=[""];this._lineOffsets=[0];this.setText(b);this.setLineDelimiter(h)}j.prototype={find:function(b){if(this._text.length>1)this._text=[this._text.join("")];var h=b.string,f=h;!b.regex&&h&&(f=h.replace(/([\\$\^*\/+?\.\(\)|{}\[\]])/g,"\\$&"));var e=null,d;if(f){var h=b.reverse,c=b.wrap,a=b.wholeWord,i=b.caseInsensitive,l=b.start||0,g=b.end,b=b.end!==void 0,j=
"";j.indexOf("g")===-1&&(j+="g");i&&j.indexOf("i")===-1&&(j+="i");a&&(f="\\b"+f+"\\b");var k=this._text[0],m,r,o=0;b&&(k=k.substring(l,g),o=l);var x=RegExp(f,j);if(h)d=function(){var a=null;for(x.lastIndex=0;;){r=x.lastIndex;m=x.exec(k);if(r===x.lastIndex)return null;if(m){if(!(m.index<l)){if(!c||a)break;l=k.length}a={start:m.index+o,end:x.lastIndex+o}}else break}if(a)l=a.start;return a};else{if(!b)x.lastIndex=l;d=function(){for(;;){r=x.lastIndex;m=x.exec(k);if(r===x.lastIndex)break;if(m)return{start:m.index+
o,end:x.lastIndex+o};if(!(r!==0&&c))break}return null}}e=d()}return{next:function(){var a=e;a&&(e=d());return a},hasNext:function(){return e!==null}}},getCharCount:function(){for(var b=0,h=0;h<this._text.length;h++)b+=this._text[h].length;return b},getLine:function(b,h){var f=this.getLineCount();if(!(0<=b&&b<f))return null;var e=this._lineOffsets[b];if(b+1<f){f=this.getText(e,this._lineOffsets[b+1]);if(h)return f;for(var e=f.length,d;(d=f.charCodeAt(e-1))===10||d===13;)e--;return f.substring(0,e)}else return this.getText(e)},
getLineAtOffset:function(b){var h=this.getCharCount();if(!(0<=b&&b<=h))return-1;var f=this.getLineCount();if(b===h)return f-1;var e,d,c=this._lastLineIndex;if(0<=c&&c<f&&(e=this._lineOffsets[c],d=c+1<f?this._lineOffsets[c+1]:h,e<=b&&b<d))return c;for(var a=f,i=-1;a-i>1;)if(c=Math.floor((a+i)/2),e=this._lineOffsets[c],d=c+1<f?this._lineOffsets[c+1]:h,b<=e)a=c;else if(b<d){a=c;break}else i=c;return this._lastLineIndex=a},getLineCount:function(){return this._lineOffsets.length},getLineDelimiter:function(){return this._lineDelimiter},
getLineEnd:function(b,h){var f=this.getLineCount();if(!(0<=b&&b<f))return-1;if(b+1<f){f=this._lineOffsets[b+1];if(h)return f;for(var e=this.getText(Math.max(this._lineOffsets[b],f-2),f),d=e.length,c;(c=e.charCodeAt(d-1))===10||c===13;)d--;return f-(e.length-d)}else return this.getCharCount()},getLineStart:function(b){return!(0<=b&&b<this.getLineCount())?-1:this._lineOffsets[b]},getText:function(b,h){b===void 0&&(b=0);h===void 0&&(h=this.getCharCount());if(b===h)return"";for(var f=0,e=0,d;e<this._text.length;){d=
this._text[e].length;if(b<=f+d)break;f+=d;e++}for(var c=f,a=e;e<this._text.length;){d=this._text[e].length;if(h<=f+d)break;f+=d;e++}if(a===e)return this._text[a].substring(b-c,h-f);c=this._text[a].substring(b-c);f=this._text[e].substring(0,h-f);return c+this._text.slice(a+1,e).join("")+f},onChanging:function(b){return this.dispatchEvent(b)},onChanged:function(b){return this.dispatchEvent(b)},setLineDelimiter:function(b,h){b==="auto"&&(b=void 0,this.getLineCount()>1&&(b=this.getText(this.getLineEnd(0),
this.getLineEnd(0,!0))));this._lineDelimiter=b?b:k.platformDelimiter;if(h){var f=this.getLineCount();if(f>1){for(var e=Array(f),d=0;d<f;d++)e[d]=this.getLine(d);this.setText(e.join(this._lineDelimiter))}}},setText:function(b,h,f){b===void 0&&(b="");h===void 0&&(h=0);f===void 0&&(f=this.getCharCount());if(!(h===f&&b==="")){for(var e=this.getLineAtOffset(h),d=this.getLineAtOffset(f),c=h,a=f-h,i=d-e,l=b.length,g=0,j=this.getLineCount(),k=0,m=0,r=0,o=[];;){k!==-1&&k<=r&&(k=b.indexOf("\r",r));m!==-1&&
m<=r&&(m=b.indexOf("\n",r));if(m===-1&&k===-1)break;r=k!==-1&&m!==-1?k+1===m?m+1:(k<m?k:m)+1:k!==-1?k+1:m+1;o.push(h+r);g++}this.onChanging({type:"Changing",text:b,start:c,removedCharCount:a,addedCharCount:l,removedLineCount:i,addedLineCount:g});o.length===0&&(k=this.getLineStart(e),d=d+1<j?this.getLineStart(d+1):this.getCharCount(),h!==k&&(b=this.getText(k,h)+b,h=k),f!==d&&(b+=this.getText(f,d),f=d));d=l-a;for(k=e+i+1;k<j;k++)this._lineOffsets[k]+=d;e=[e+1,i].concat(o);Array.prototype.splice.apply(this._lineOffsets,
e);for(d=o=0;d<this._text.length;){k=this._text[d].length;if(h<=o+k)break;o+=k;d++}j=o;for(e=d;d<this._text.length;){k=this._text[d].length;if(f<=o+k)break;o+=k;d++}k=this._text[d];h=this._text[e].substring(0,h-j);f=k.substring(f-o);e=[e,d-e+1];h&&e.push(h);b&&e.push(b);f&&e.push(f);Array.prototype.splice.apply(this._text,e);if(this._text.length===0)this._text=[""];this.onChanged({type:"Changed",start:c,removedCharCount:a,addedCharCount:l,removedLineCount:i,addedLineCount:g})}}};g.EventTarget.addMixin(j.prototype);
return{TextModel:j}});
define("orion/editor/projectionTextModel",["orion/editor/textModel","orion/editor/eventTarget"],function(g,k){function j(b){this._model=b;this._projections=[]}j.prototype={addProjection:function(b){if(b){var h=this._model,f=this._projections;b._lineIndex=h.getLineAtOffset(b.start);b._lineCount=h.getLineAtOffset(b.end)-b._lineIndex;var e=b.text;e||(e="");b._model=typeof e==="string"?new g.TextModel(e,h.getLineDelimiter()):e;var h=this.mapOffset(b.start,!0),e=b.end-b.start,d=b._lineCount,c=b._model.getCharCount(),
a=b._model.getLineCount()-1;this.onChanging({type:"Changing",text:b._model.getText(),start:h,removedCharCount:e,addedCharCount:c,removedLineCount:d,addedLineCount:a});var i=this._binarySearch(f,b.start);f.splice(i,0,b);this.onChanged({type:"Changed",start:h,removedCharCount:e,addedCharCount:c,removedLineCount:d,addedLineCount:a})}},getProjections:function(){return this._projections.slice(0)},getBaseModel:function(){return this._model},mapOffset:function(b,h){var f=this._projections,e=0,d,c;if(h){for(d=
0;d<f.length;d++){c=f[d];if(c.start>b)break;if(c.end>b)return-1;e+=c._model.getCharCount()-(c.end-c.start)}return b+e}for(d=0;d<f.length;d++){c=f[d];if(c.start>b-e)break;var a=c._model.getCharCount();if(c.start+a>b-e)return-1;e+=a-(c.end-c.start)}return b-e},removeProjection:function(b){var h,f=0;for(h=0;h<this._projections.length;h++){var e=this._projections[h];if(e===b){b=e;break}f+=e._model.getCharCount()-(e.end-e.start)}if(h<this._projections.length){var e=this._model,f=b.start+f,d=b.end-b.start,
c=b._lineCount,a=b._model.getCharCount(),i=b._model.getLineCount()-1;this.onChanging({type:"Changing",text:e.getText(b.start,b.end),start:f,removedCharCount:a,addedCharCount:d,removedLineCount:i,addedLineCount:c});this._projections.splice(h,1);this.onChanged({type:"Changed",start:f,removedCharCount:a,addedCharCount:d,removedLineCount:i,addedLineCount:c})}},_binarySearch:function(b,h){for(var f=b.length,e=-1,d;f-e>1;)d=Math.floor((f+e)/2),h<=b[d].start?f=d:e=d;return f},getCharCount:function(){for(var b=
this._model.getCharCount(),h=this._projections,f=0;f<h.length;f++){var e=h[f];b+=e._model.getCharCount()-(e.end-e.start)}return b},getLine:function(b,h){if(b<0)return null;var f=this._model,e=this._projections,d=0,c=[],a=0,i,l,g;for(i=0;i<e.length;i++){g=e[i];if(g._lineIndex>=b-d)break;l=g._model.getLineCount()-1;if(g._lineIndex+l>=b-d)if(a=b-(g._lineIndex+d),a<l)return g._model.getLine(a,h);else c.push(g._model.getLine(l));a=g.end;d+=l-g._lineCount}for(a=Math.max(a,f.getLineStart(b-d));i<e.length;i++){g=
e[i];if(g._lineIndex>b-d)break;c.push(f.getText(a,g.start));l=g._model.getLineCount()-1;if(g._lineIndex+l>b-d)return c.push(g._model.getLine(0,h)),c.join("");c.push(g._model.getText());a=g.end;d+=l-g._lineCount}e=f.getLineEnd(b-d,h);a<e&&c.push(f.getText(a,e));return c.join("")},getLineAtOffset:function(b){for(var h=this._model,f=this._projections,e=0,d=0,c=0;c<f.length;c++){var a=f[c];if(a.start>b-e)break;var i=a._model.getCharCount();if(a.start+i>b-e){f=b-(a.start+e);d+=a._model.getLineAtOffset(f);
e+=f;break}d+=a._model.getLineCount()-1-a._lineCount;e+=i-(a.end-a.start)}return h.getLineAtOffset(b-e)+d},getLineCount:function(){for(var b=this._projections,h=this._model.getLineCount(),f=0;f<b.length;f++){var e=b[f];h+=e._model.getLineCount()-1-e._lineCount}return h},getLineDelimiter:function(){return this._model.getLineDelimiter()},getLineEnd:function(b,h){if(b<0)return-1;for(var f=this._model,e=this._projections,d=0,c=0,a=0;a<e.length;a++){var i=e[a];if(i._lineIndex>b-d)break;var g=i._model.getLineCount()-
1;if(i._lineIndex+g>b-d)return i._model.getLineEnd(b-(i._lineIndex+d),h)+i.start+c;c+=i._model.getCharCount()-(i.end-i.start);d+=g-i._lineCount}return f.getLineEnd(b-d,h)+c},getLineStart:function(b){if(b<0)return-1;for(var h=this._model,f=this._projections,e=0,d=0,c=0;c<f.length;c++){var a=f[c];if(a._lineIndex>=b-e)break;var i=a._model.getLineCount()-1;if(a._lineIndex+i>=b-e)return a._model.getLineStart(b-(a._lineIndex+e))+a.start+d;d+=a._model.getCharCount()-(a.end-a.start);e+=i-a._lineCount}return h.getLineStart(b-
e)+d},getText:function(b,h){b===void 0&&(b=0);var f=this._model,e=this._projections,d=0,c=[],a,i,g;for(a=0;a<e.length;a++){i=e[a];if(i.start>b-d)break;g=i._model.getCharCount();if(i.start+g>b-d)if(h!==void 0&&i.start+g>h-d)return i._model.getText(b-(i.start+d),h-(i.start+d));else c.push(i._model.getText(b-(i.start+d))),b=i.end+d+g-(i.end-i.start);d+=g-(i.end-i.start)}var n=b-d;if(h!==void 0){for(;a<e.length;a++){i=e[a];if(i.start>h-d)break;c.push(f.getText(n,i.start));g=i._model.getCharCount();if(i.start+
g>h-d)return c.push(i._model.getText(0,h-(i.start+d))),c.join("");c.push(i._model.getText());n=i.end;d+=g-(i.end-i.start)}c.push(f.getText(n,h-d))}else{for(;a<e.length;a++)i=e[a],c.push(f.getText(n,i.start)),c.push(i._model.getText()),n=i.end;c.push(f.getText(n))}return c.join("")},_onChanging:function(b,h,f,e,d,c){for(var a=this._model,i=this._projections,g,n=0,j,k=h+f;g<i.length;g++){f=i[g];if(f.start>h)break;n+=f._model.getCharCount()-(f.end-f.start)}h+=n;for(var m=g;g<i.length;g++){f=i[g];if(f.start>
k)break;n+=f._model.getCharCount()-(f.end-f.start);j+=f._model.getLineCount()-1-f._lineCount}f=k+n;n=g;this.onChanging(h,f-h,e,d+j,c);i.splice(i,n-m);for(b=b.length-(f-h);g<i.length;g++)f=i[g],f.start+=b,f.end+=b,f._lineIndex=a.getLineAtOffset(f.start)},onChanging:function(b){return this.dispatchEvent(b)},onChanged:function(b){return this.dispatchEvent(b)},setLineDelimiter:function(b){this._model.setLineDelimiter(b)},setText:function(b,h,f){b===void 0&&(b="");h===void 0&&(h=0);var e=h,d=f,c=this._model,
a=this._projections,i=0,g=0,n,j,k,m,r,o=0;for(n=0;n<a.length;n++){j=a[n];if(j.start>h-i)break;k=j._model.getCharCount();if(j.start+k>h-i)if(f!==void 0&&j.start+k>f-i){j._model.setText(b,h-(j.start+i),f-(j.start+i));return}else o=j._model.getLineCount()-1-j._model.getLineAtOffset(h-(j.start+i)),m={projection:j,start:h-(j.start+i)},h=j.end+i+k-(j.end-j.start);g+=j._model.getLineCount()-1-j._lineCount;i+=k-(j.end-j.start)}h-=i;var x=n,o=c.getLineAtOffset(h)+g-o;if(f!==void 0)for(;n<a.length;n++){j=a[n];
if(j.start>f-i)break;k=j._model.getCharCount();if(j.start+k>f-i){g+=j._model.getLineAtOffset(f-(j.start+i));k=f-(j.start+i);f=j.end+i;r={projection:j,end:k};break}g+=j._model.getLineCount()-1-j._lineCount;i+=k-(j.end-j.start)}else{for(;n<a.length;n++)j=a[n],g+=j._model.getLineCount()-1-j._lineCount,i+=j._model.getCharCount()-(j.end-j.start);f=d=c.getCharCount()+i}f-=i;j=c.getLineAtOffset(f)+g;d-=e;for(var g=j-o,o=b.length,s=k=j=i=0;;){j!==-1&&j<=s&&(j=b.indexOf("\r",s));k!==-1&&k<=s&&(k=b.indexOf("\n",
s));if(k===-1&&j===-1)break;s=j!==-1&&k!==-1?j+1===k?k+1:(j<k?j:k)+1:j!==-1?j+1:k+1;i++}this.onChanging({type:"Changing",text:b,start:e,removedCharCount:d,addedCharCount:o,removedLineCount:g,addedLineCount:i});c.setText(b,h,f);if(m)j=m.projection,j._model.setText("",m.start);if(r)j=r.projection,j._model.setText("",0,r.end),j.start=j.end,j._lineCount=0;a.splice(x,n-x);for(b=b.length-(f-h);n<a.length;n++)j=a[n],j.start+=b,j.end+=b,j._lineIndex=c.getLineAtOffset(j.start);this.onChanged({type:"Changed",
start:e,removedCharCount:d,addedCharCount:o,removedLineCount:g,addedLineCount:i})}};k.EventTarget.addMixin(j.prototype);return{ProjectionTextModel:j}});
define("orion/editor/textView",["orion/editor/textModel","orion/editor/keyBinding","orion/editor/eventTarget","orion/editor/util"],function(g,k,j,b){function h(a,c,b,d){typeof a.addEventListener==="function"?a.addEventListener(c,b,d===!0):a.attachEvent("on"+c,b)}function f(a,c,d){if(d){c.className="";for(var d=c.attributes,i=d.length;i-- >0;)(!b.isIE||b.isIE>=9||b.isIE<9&&d[i].specified)&&c.removeAttribute(d[i].name)}if(a){if(a.styleClass)c.className=a.styleClass;if(d=a.style)for(var e in d)d.hasOwnProperty(e)&&
(c.style[e]=d[e]);if(a=a.attributes)for(var f in a)a.hasOwnProperty(f)&&c.setAttribute(f,a[f])}}function e(a){return a instanceof Array?a.slice(0):a}function d(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 b=0;b<a.length;b++)if(!d(a[b],c[b]))return!1;return!0}if(!(a instanceof Object)||!(c instanceof
Object))return!1;for(b in a)if(a.hasOwnProperty(b)){if(!c.hasOwnProperty(b))return!1;if(!d(a[b],c[b]))return!1}for(b in c)if(!a.hasOwnProperty(b))return!1;return!0}function c(a,c,b){for(var d=0,i=0,e=0,f=a.length;e<f;){d!==-1&&d<=e&&(d=a.indexOf("\r",e));i!==-1&&i<=e&&(i=a.indexOf("\n",e));var h=e,g;if(i===-1&&d===-1){c(a.substring(e));break}d!==-1&&i!==-1?d+1===i?(g=d,e=i+1):(g=d<i?d:i,e=(d<i?d:i)+1):d!==-1?(g=d,e=d+1):(g=i,e=i+1);c(a.substring(h,g));b()}}function a(a){var c,b,d,i,e=a.ownerDocument.defaultView||
a.ownerDocument.parentWindow;if(e.getComputedStyle)a=e.getComputedStyle(a,null),c=a.getPropertyValue("padding-left"),b=a.getPropertyValue("padding-top"),d=a.getPropertyValue("padding-right"),i=a.getPropertyValue("padding-bottom");else if(a.currentStyle)c=a.currentStyle.paddingLeft,b=a.currentStyle.paddingTop,d=a.currentStyle.paddingRight,i=a.currentStyle.paddingBottom;return{left:parseInt(c,10)||0,top:parseInt(b,10)||0,right:parseInt(d,10)||0,bottom:parseInt(i,10)||0}}function i(c){var b,d,i,e,f=
c._trim;if(!f){var f=a(c),h=c.ownerDocument.defaultView||c.ownerDocument.parentWindow;if(h.getComputedStyle)e=h.getComputedStyle(c,null),b=e.getPropertyValue("border-left-width"),d=e.getPropertyValue("border-top-width"),i=e.getPropertyValue("border-right-width"),e=e.getPropertyValue("border-bottom-width");else if(c.currentStyle)b=c.currentStyle.borderLeftWidth,d=c.currentStyle.borderTopWidth,i=c.currentStyle.borderRightWidth,e=c.currentStyle.borderBottomWidth;b=parseInt(b,10)||0;d=parseInt(d,10)||
0;i=parseInt(i,10)||0;e=parseInt(e,10)||0;f.left+=b;f.top+=d;f.right+=i;f.bottom+=e;c._trim=f}return f}function l(a,c,b){this.start=a;this.end=c;this.caret=b}function n(a){this.left=a.left;this.top=a.top;this.right=a.right;this.bottom=a.bottom}function q(a,c,b){this.view=a;this.lineIndex=c;this._lineDiv=b}function t(a){this._init(a)}l.prototype={clone:function(){return new l(this.start,this.end,this.caret)},collapse:function(){this.caret?this.end=this.start:this.start=this.end},extend:function(a){this.caret?
this.start=a:this.end=a;if(this.start>this.end)a=this.start,this.start=this.end,this.end=a,this.caret=!this.caret},setCaret:function(a){this.end=this.start=a;this.caret=!1},getCaret:function(){return this.caret?this.start:this.end},toString:function(){return"start="+this.start+" end="+this.end+(this.caret?" caret is at start":" caret is at end")},isEmpty:function(){return this.start===this.end},equals:function(a){return this.caret===a.caret&&this.start===a.start&&this.end===a.end}};n.prototype={toString:function(){return"{l="+
this.left+", t="+this.top+", r="+this.right+", b="+this.bottom+"}"}};q.prototype={create:function(a,c){if(!this._lineDiv){var b=this._lineDiv=this._createLine(a,c,this.lineIndex);b._line=this;return b}},_createLine:function(a,c,i){var e=this.view,h=e._model,g=h.getLine(i),l=h.getLineStart(i),y={type:"LineStyle",textView:e,lineIndex:i,lineText:g,lineStart:l};if(g.length<2E3)e.onLineStyle(y);h=c||b.createElement(a.ownerDocument,"div");if(!c||!d(c.viewStyle,y.style)){f(y.style,h,c);if(c)c._trim=null;
h.viewStyle=y.style;h.setAttribute("role","presentation")}h.lineIndex=i;i=[];this._createRanges(y.ranges,g,0,g.length,l,{tabOffset:0,ranges:i});g=" ";!e._fullSelection&&b.isIE<9&&(g="\ufeff");b.isWebkit&&(g="\u200c");i.push({text:g,style:e._metrics.largestFontStyle,ignoreChars:1});var n,p,w,j,q,g=e=0,k,t;if(c){if(p=c.modelChangedEvent)p.removedLineCount===0&&p.addedLineCount===0?(t=p.start-l,k=p.addedCharCount-p.removedCharCount):t=-1,c.modelChangedEvent=void 0;p=c.firstChild}for(l=0;l<i.length;l++){n=
i[l];j=n.text;e+=j.length;y=n.style;if(p)if(q=p.firstChild.data,w=p.viewStyle,q===j&&d(y,w)){g+=q.length;p._rectsCache=void 0;n=p=p.nextSibling;continue}else for(;p;){if(t!==-1){w=e;w>=t&&(w-=k);q=(q=p.firstChild.data)?q.length:0;if(g+q>w)break;g+=q}w=p.nextSibling;h.removeChild(p);p=w}n=this._createSpan(h,j,y,n.ignoreChars);p?h.insertBefore(n,p):h.appendChild(n);if(c)c.lineWidth=void 0}if(c)for(a=n?n.nextSibling:null;a;)w=a.nextSibling,c.removeChild(a),a=w;else a.appendChild(h);return h},_createRanges:function(a,
c,b,i,e,f){if(!(b>=i)){if(a)for(var h=0;h<a.length;h++){var g=a[h];if(!(g.end<=e+b)){var l=Math.max(e+b,g.start)-e;if(l>=i)break;var p=Math.min(e+i,g.end)-e;if(l<p){l=Math.max(b,l);p=Math.min(i,p);for(b<l&&this._createRange(c,b,l,null,f);h+1<a.length&&a[h+1].start-e===p&&d(g.style,a[h+1].style);)g=a[h+1],p=Math.min(e+i,g.end)-e,h++;this._createRange(c,l,p,g.style,f);b=p}}}b<i&&this._createRange(c,b,i,null,f)}},_createRange:function(a,c,b,d,i){if(!(c>=b)){var e=this.view._customTabSize;if(e&&e!==8)for(var f=
a.indexOf("\t",c);f!==-1&&f<b;){c<f&&(c={text:a.substring(c,f),style:d},i.ranges.push(c),i.tabOffset+=c.text.length);c=e-i.tabOffset%e;if(c>0){for(var h="\u00a0",g=1;g<c;g++)h+=" ";c={text:h,style:d,ignoreChars:c-1};i.ranges.push(c);i.tabOffset+=c.text.length}c=f+1;f=a.indexOf("\t",c)}c<b&&(c={text:a.substring(c,b),style:d},i.ranges.push(c),i.tabOffset+=c.text.length)}},_createSpan:function(a,c,d,i){var e=d&&d.tagName==="A";if(e)a.hasLink=!0;var e=e&&this.view._linksVisible?"a":"span",g=a.ownerDocument,
a=b.createElement(a.ownerDocument,e);a.appendChild(g.createTextNode(c));f(d,a);if(e==="A"){var l=this.view,y=this._getWindow();h(a,"click",function(a){return l._handleLinkClick(a?a:y.event)},!1)}a.viewStyle=d;if(i)a.ignoreChars=i;return a},_ensureCreated:function(){return this._lineDiv?this._lineDiv:this._createdDiv=this.create(this.view._clientDiv,null)},getBoundingClientRect:function(a,c){var d=this._ensureCreated(),i=this.view;if(a===void 0)return this._getLineBoundingClientRect(d,!0);var e=i._model,
f=d.ownerDocument,h=this.lineIndex,g=null;if(a<e.getLineEnd(h)){e=e.getLineStart(h);for(h=d.firstChild;h;){var l=h.firstChild,p=l.length;h.ignoreChars&&(p-=h.ignoreChars);if(e+p>a){g=a-e;if(i._isRangeRects)f=f.createRange(),f.setStart(l,g),f.setEnd(l,g+1),g=new n(f.getBoundingClientRect());else if(b.isIE)f=f.body.createTextRange(),f.moveToElementText(h),f.collapse(),f.moveEnd("character",g+1),f.moveStart("character",g),g=new n(f.getBoundingClientRect());else{var w=l.data;h.removeChild(l);h.appendChild(f.createTextNode(w.substring(0,
g)));var j=b.createElement(f,"span");j.appendChild(f.createTextNode(w.substring(g,g+1)));h.appendChild(j);h.appendChild(f.createTextNode(w.substring(g+1)));g=new n(j.getBoundingClientRect());h.innerHTML="";h.appendChild(l);this._createdDiv||(f=i._getSelection(),(e<=f.start&&f.start<e+p||e<=f.end&&f.end<e+p)&&i._updateDOMSelection())}b.isIE&&(f=d.ownerDocument.defaultView||d.ownerDocument.parentWindow,d=f.screen.logicalXDPI/f.screen.deviceXDPI,f=f.screen.logicalYDPI/f.screen.deviceYDPI,g.left*=d,g.right*=
d,g.top*=f,g.bottom*=f);break}e+=p;h=h.nextSibling}}d=this.getBoundingClientRect();if(!g)i._wrapMode?(i=this.getClientRects(),g=i[i.length-1],g.left=g.right,g.left+=d.left,g.top+=d.top,g.right+=d.left,g.bottom+=d.top):(g=new n(d),g.left=g.right);if(c||c===void 0)g.left-=d.left,g.top-=d.top,g.right-=d.left,g.bottom-=d.top;return g},_getClientRects:function(a,c){var b,d,i,e;if(!a._rectsCache){b=a.getClientRects();d=Array(b.length);for(e=0;e<b.length;e++)i=d[e]=new n(b[e]),i.left-=c.left,i.top-=c.top,
i.right-=c.left,i.bottom-=c.top;a._rectsCache=d}b=a._rectsCache;d=[b.length];for(e=0;e<b.length;e++)d[e]=new n(b[e]);return d},getClientRects:function(a){if(!this.view._wrapMode)return[this.getBoundingClientRect()];for(var c=this._ensureCreated(),b=[],d=c.firstChild,i,e=c.getBoundingClientRect();d;){for(var f=this._getClientRects(d,e),c=0;c<f.length;c++){var h=f[c],g;if(h.top!==h.bottom){var l=h.top+(h.bottom-h.top)/2;for(g=0;g<b.length;g++)if(i=b[g],i.top<=l&&l<i.bottom)break;if(g===b.length)b.push(h);
else{if(h.left<i.left)i.left=h.left;if(h.top<i.top)i.top=h.top;if(h.right>i.right)i.right=h.right;if(h.bottom>i.bottom)i.bottom=h.bottom}}}d=d.nextSibling}return a!==void 0?b[a]:b},_getLineBoundingClientRect:function(a,c){var b=new n(a.getBoundingClientRect());if(!this.view._wrapMode){b.right=b.left;for(var d=a.lastChild;d&&d.ignoreChars===d.firstChild.length;)d=d.previousSibling;if(d)d=d.getBoundingClientRect(),b.right=d.right+i(a).right}c&&(d=i(a),b.left+=d.left,b.right-=d.right);return b},getLineCount:function(){return!this.view._wrapMode?
1:this.getClientRects().length},getLineIndex:function(a){if(!this.view._wrapMode)return 0;for(var c=this.getClientRects(),a=this.getBoundingClientRect(a),a=a.top+(a.bottom-a.top)/2,b=0;b<c.length;b++)if(c[b].top<=a&&a<c[b].bottom)return b;return c.length-1},getLineStart:function(a){if(!this.view._wrapMode||a===0)return this.view._model.getLineStart(a);var c=this.getClientRects();return this.getOffset(c[a].left+1,c[a].top+1)},getOffset:function(a,c){var d=this.view,i=d._model,e=this.lineIndex,f=i.getLineStart(e),
i=i.getLineEnd(e);if(f===i)return f;var h=this._ensureCreated(),e=this.getBoundingClientRect(),g,l;if(d._wrapMode){g=this.getClientRects();if(c<g[0].top)c=g[0].top;for(var p=0;p<g.length;p++)if(l=g[p],l.top<=c&&c<l.bottom)break;if(a<l.left)a=l.left;a>l.right&&(a=l.right-1)}else a<0&&(a=0),a>e.right-e.left&&(a=e.right-e.left);var w=h.ownerDocument,p=w.defaultView||w.parentWindow,n=b.isIE?p.screen.logicalXDPI/p.screen.deviceXDPI:1,j=b.isIE?p.screen.logicalYDPI/p.screen.deviceYDPI:1,p=f,q=h.firstChild;
a:for(;q;){var k=q.firstChild,h=k.length;q.ignoreChars&&(h-=q.ignoreChars);var t,F,G;g=this._getClientRects(q,e);for(var C=0;C<g.length;C++)if(l=g[C],l.left<=a&&a<l.right&&(!d._wrapMode||l.top<=c&&c<l.bottom)){if(b.isIE||d._isRangeRects){for(var w=d._isRangeRects?w.createRange():w.body.createTextRange(),C=h,H=-1;C-H>1;){var K=Math.floor((C+H)/2);l=H+1;g=K===h-1&&q.ignoreChars?k.length:K+1;d._isRangeRects?(w.setStart(k,l),w.setEnd(k,g)):(w.moveToElementText(q),w.move("character",l),w.moveEnd("character",
g-l));g=w.getClientRects();for(var P=!1,L=0;L<g.length;L++)if(l=g[L],t=l.left*n-e.left,G=l.right*n-e.left,F=l.top*j-e.top,l=l.bottom*j-e.top,t<=a&&a<G&&(!d._wrapMode||F<=c&&c<l)){P=!0;break}P?C=K:H=K}p+=C;l=C;g=C===h-1&&q.ignoreChars?k.length:Math.min(C+1,k.length);d._isRangeRects?(w.setStart(k,l),w.setEnd(k,g)):(w.moveToElementText(q),w.move("character",l),w.moveEnd("character",g-l));l=w.getClientRects()[0];t=l.left*n-e.left;G=l.right*n-e.left;a>t+(G-t)/2&&p++}else{l=[];for(n=0;n<h;n++)l.push("<span>"),
n===h-1?l.push(k.data.substring(n)):l.push(k.data.substring(n,n+1)),l.push("</span>");q.innerHTML=l.join("");for(n=q.firstChild;n;){l=n.getBoundingClientRect();t=l.left-e.left;G=l.right-e.left;if(t<=a&&a<G){a>t+(G-t)/2&&p++;break}p++;n=n.nextSibling}if(!this._createdDiv)q.innerHTML="",q.appendChild(k),e=d._getSelection(),(p<=e.start&&e.start<p+h||p<=e.end&&e.end<p+h)&&d._updateDOMSelection()}break a}p+=h;q=q.nextSibling}return Math.min(i,Math.max(f,p))},getNextOffset:function(a,c,d){return c==="line"?
(c=this.view._model,a=c.getLineAtOffset(a),d>0?c.getLineEnd(a):c.getLineStart(a)):c==="wordend"?this._getNextOffset_W3C(a,c,d):b.isIE?this._getNextOffset_IE(a,c,d):this._getNextOffset_W3C(a,c,d)},_getNextOffset_W3C:function(a,c,b){function d(a){return 33<=a&&a<=47||58<=a&&a<=64||91<=a&&a<=94||a===96||123<=a&&a<=126}if(c==="word"||c==="wordend"){var i=this.view._model,e=i.getLineAtOffset(a),f=i.getLine(e),h=i.getLineStart(e),e=i.getLineEnd(e),i=f.length;a-=h;var g,l;if(b>0){if(a===i)return e;g=f.charCodeAt(a);
l=d(g);b=!l&&!(g===32||g===9);for(a++;a<i;){g=f.charCodeAt(a);e=d(g);if(c==="wordend"){if(!e&&l)break}else if(e&&!l)break;g=!e&&!(g===32||g===9);if(c==="wordend"){if(!g&&b)break}else if(g&&!b)break;b=g;l=e;a++}}else{if(a===0)return h;a--;g=f.charCodeAt(a);l=d(g);for(b=!l&&!(g===32||g===9);0<a;){g=f.charCodeAt(a-1);e=d(g);if(c==="wordend"){if(e&&!l)break}else if(!e&&l)break;g=!e&&!(g===32||g===9);if(c==="wordend"){if(g&&!b)break}else if(!g&&b)break;b=g;l=e;a--}}return h+a}return a+b},_getNextOffset_IE:function(a,
c,b){var d=this._ensureCreated(),i=this.view._model,e=this.lineIndex,f=0,g;g=i.getLineStart(e);var h=d.ownerDocument;if(a===i.getLineEnd(e))f=h.body.createTextRange(),f.moveToElementText(d.lastChild),g=f.text.length,f.moveEnd(c,b),f=a+f.text.length-g;else if(a===g&&b<0)f=g;else for(d=d.firstChild;d;){i=d.firstChild.length;d.ignoreChars&&(i-=d.ignoreChars);if(g+i>a){f=h.body.createTextRange();a===g&&b<0?f.moveToElementText(d.previousSibling):(f.moveToElementText(d),f.collapse(),f.moveEnd("character",
a-g));g=f.text.length;f.moveEnd(c,b);f=a+f.text.length-g;break}g=i+g;d=d.nextSibling}return f},destroy:function(){var a=this._createdDiv;if(a)a.parentNode.removeChild(a),this._createdDiv=null}};t.prototype={addRuler:function(a,c){a.setView(this);var b=this._rulers;if(c!==void 0){var d,i;for(d=0,i=0;d<b.length&&i<c;d++)a.getLocation()===b[d].getLocation()&&i++;b.splice(i,0,a);c=i}else b.push(a);this._createRuler(a,c);this._update()},computeSize:function(){var a=0,c=0,d=this._model,i=this._clientDiv;
if(!i)return{width:a,height:c};var e=i.style.width;if(b.isWebkit)i.style.width="0x7fffffffpx";for(var d=d.getLineCount(),f=0;f<d;f++){var g=this._getLine(f),h=g.getBoundingClientRect(),a=Math.max(a,h.right-h.left);c+=h.bottom-h.top;g.destroy()}if(b.isWebkit)i.style.width=e;i=this._getViewPadding();a+=i.right+i.left;c+=i.bottom+i.top;return{width:a,height:c}},convert:function(a,c,b){if(this._clientDiv){var d=this._getScroll(),i=this._getViewPadding(),e=this._viewDiv.getBoundingClientRect();c==="document"&&
(a.x!==void 0&&(a.x+=-d.x+e.left+i.left),a.y!==void 0&&(a.y+=-d.y+e.top+i.top));b==="document"&&(a.x!==void 0&&(a.x+=d.x-e.left-i.left),a.y!==void 0&&(a.y+=d.y-e.top-i.top));return a}},destroy:function(){for(var a=0;a<this._rulers.length;a++)this._rulers[a].setView(null);this.rulers=null;this._destroyView();this.onDestroy({type:"Destroy"});this._actions=this._keyBindings=this._doubleClickSelection=this._selection=this._model=this._parent=null},focus:function(){this._clientDiv&&(this._updateDOMSelection(),
b.isOpera&&this._clientDiv.blur(),this._clientDiv.focus(),this._updateDOMSelection())},hasFocus:function(){return this._hasFocus},getActionDescription:function(a){if(a=this._actions[a])return a.actionDescription},getActions:function(a){var c=[],b=this._actions,d;for(d in b)b.hasOwnProperty(d)&&(a||!b[d].defaultHandler)&&c.push(d);return c},getBottomIndex:function(a){return!this._clientDiv?0:this._getBottomIndex(a)},getBottomPixel:function(){return!this._clientDiv?0:this._getScroll().y+this._getClientHeight()},
getCaretOffset:function(){return this._getSelection().getCaret()},getClientArea:function(){if(!this._clientDiv)return{x:0,y:0,width:0,height:0};var a=this._getScroll();return{x:a.x,y:a.y,width:this._getClientWidth(),height:this._getClientHeight()}},getHorizontalPixel:function(){return!this._clientDiv?0:this._getScroll().x},getKeyBindings:function(a){for(var c=[],b=this._keyBindings,d=0;d<b.length;d++)b[d].actionID===a&&c.push(b[d].keyBinding);return c},getLineHeight:function(a){return!this._clientDiv?
0:this._getLineHeight(a)},getLineIndex:function(a){return!this._clientDiv?0:this._getLineIndex(a)},getLinePixel:function(a){return!this._clientDiv?0:this._getLinePixel(a)},getLocationAtOffset:function(a){if(!this._clientDiv)return{x:0,y:0};var c=this._model,a=Math.min(Math.max(0,a),c.getCharCount()),c=c.getLineAtOffset(a),b=this._getLine(c),a=b.getBoundingClientRect(a);b.destroy();b=a.left;c=this._getLinePixel(c)+a.top;return{x:b,y:c}},getOptions:function(){var a;if(arguments.length===0)a=this._defaultOptions();
else if(arguments.length===1){if(a=arguments[0],typeof a==="string")return e(this["_"+a])}else{a={};for(var c in arguments)arguments.hasOwnProperty(c)&&(a[arguments[c]]=void 0)}for(var b in a)a.hasOwnProperty(b)&&(a[b]=e(this["_"+b]));return a},getModel:function(){return this._model},getOffsetAtLocation:function(a,c){if(!this._clientDiv)return 0;var b=this._getLineIndex(c),d=this._getLine(b),b=d.getOffset(a,c-this._getLinePixel(b));d.destroy();return b},getRulers:function(){return this._rulers.slice(0)},
getSelection:function(){var a=this._getSelection();return{start:a.start,end:a.end}},getText:function(a,c){return this._model.getText(a,c)},getTopIndex:function(a){return!this._clientDiv?0:this._getTopIndex(a)},getTopPixel:function(){return!this._clientDiv?0:this._getScroll().y},invokeAction:function(a,c){if(this._clientDiv){var b=this._actions[a];if(b){if(!c&&b.handler&&b.handler())return;if(b.defaultHandler)return b.defaultHandler()}return!1}},isDestroyed:function(){return!this._clientDiv},onContextMenu:function(a){return this.dispatchEvent(a)},
onDragStart:function(a){return this.dispatchEvent(a)},onDrag:function(a){return this.dispatchEvent(a)},onDragEnd:function(a){return this.dispatchEvent(a)},onDragEnter:function(a){return this.dispatchEvent(a)},onDragOver:function(a){return this.dispatchEvent(a)},onDragLeave:function(a){return this.dispatchEvent(a)},onDrop:function(a){return this.dispatchEvent(a)},onDestroy:function(a){return this.dispatchEvent(a)},onLineStyle:function(a){return this.dispatchEvent(a)},onModelChanged:function(a){return this.dispatchEvent(a)},
onModelChanging:function(a){return this.dispatchEvent(a)},onModify:function(a){return this.dispatchEvent(a)},onMouseDown:function(a){return this.dispatchEvent(a)},onMouseUp:function(a){return this.dispatchEvent(a)},onMouseMove:function(a){return this.dispatchEvent(a)},onMouseOver:function(a){return this.dispatchEvent(a)},onMouseOut:function(a){return this.dispatchEvent(a)},onSelection:function(a){return this.dispatchEvent(a)},onScroll:function(a){return this.dispatchEvent(a)},onVerify:function(a){return this.dispatchEvent(a)},
onFocus:function(a){return this.dispatchEvent(a)},onBlur:function(a){return this.dispatchEvent(a)},redraw:function(){if(!(this._redrawCount>0)){var a=this._model.getLineCount();this.redrawRulers(0,a);this.redrawLines(0,a)}},redrawRulers:function(a,c){if(!(this._redrawCount>0))for(var b=this.getRulers(),d=0;d<b.length;d++)this.redrawLines(a,c,b[d])},redrawLines:function(a,c,b){if(!(this._redrawCount>0)&&(a===void 0&&(a=0),c===void 0&&(c=this._model.getLineCount()),a!==c)){var d=this._clientDiv;if(d){if(b)for(var i=
(b.getLocation()==="left"?this._leftDiv:this._rightDiv).firstChild.rows[0].cells,e=0;e<i.length;e++)if(i[e].firstChild._ruler===b){d=i[e].firstChild;break}b?d.rulerChanged=!0:this._lineHeight&&this._resetLineHeight(a,c);if(!b||b.getOverview()==="page")for(d=d.firstChild;d;){i=d.lineIndex;if(a<=i&&i<c)d.lineChanged=!0;d=d.nextSibling}if(!b&&!this._wrapMode&&a<=this._maxLineIndex&&this._maxLineIndex<c)this._checkMaxLineIndex=this._maxLineIndex,this._maxLineIndex=-1,this._maxLineWidth=0;this._queueUpdate()}}},
redrawRange:function(a,c){if(!(this._redrawCount>0)){var b=this._model;a===void 0&&(a=0);c===void 0&&(c=b.getCharCount());var d=b.getLineAtOffset(a),b=b.getLineAtOffset(Math.max(a,c-1))+1;this.redrawLines(d,b)}},removeRuler:function(a){for(var c=this._rulers,b=0;b<c.length;b++)if(c[b]===a){c.splice(b,1);a.setView(null);this._destroyRuler(a);this._update();break}},resize:function(){this._clientDiv&&this._handleResize(null)},setAction:function(a,c,b){if(a){var d=this._actions,i=d[a];i||(i=d[a]={});
i.handler=c;i.actionDescription=b}},setKeyBinding:function(a,c){for(var b=this._keyBindings,d=0;d<b.length;d++){var i=b[d];if(i.keyBinding.equals(a)){c?i.actionID=c:i.predefined?i.actionID=null:b.splice(d,1);return}}c&&b.push({keyBinding:a,actionID:c})},setCaretOffset:function(a,c){var b=this._model.getCharCount(),a=Math.max(0,Math.min(a,b));this._setSelection(new l(a,a,!1),c===void 0||c)},setHorizontalPixel:function(a){this._clientDiv&&(a=Math.max(0,a),this._scrollView(a-this._getScroll().x,0))},
setRedraw:function(a){a?--this._redrawCount===0&&this.redraw():this._redrawCount++},setModel:function(a){if(a&&a!==this._model){this._model.removeEventListener("preChanging",this._modelListener.onChanging);this._model.removeEventListener("postChanged",this._modelListener.onChanged);var c=this._model.getLineCount(),b=this._model.getCharCount(),d=a.getLineCount(),i=a.getCharCount(),e={type:"ModelChanging",text:a.getText(),start:0,removedCharCount:b,addedCharCount:i,removedLineCount:c,addedLineCount:d};
this.onModelChanging(e);this._model=a;e={type:"ModelChanged",start:0,removedCharCount:b,addedCharCount:i,removedLineCount:c,addedLineCount:d};this.onModelChanged(e);this._model.addEventListener("preChanging",this._modelListener.onChanging);this._model.addEventListener("postChanged",this._modelListener.onChanged);this._reset();this._update()}},setOptions:function(a){var c=this._defaultOptions(),b;for(b in a)if(a.hasOwnProperty(b)){var i=a[b];if(!d(this["_"+b],i)){var f=c[b]?c[b].update:null;f?f.call(this,
i):this["_"+b]=e(i)}}},setSelection:function(a,c,b){var d=a>c;if(d)var i=a,a=c,c=i;i=this._model.getCharCount();a=Math.max(0,Math.min(a,i));c=Math.max(0,Math.min(c,i));this._setSelection(new l(a,c,d),b===void 0||b)},setText:function(a,c,d){var i=c===void 0&&d===void 0;c===void 0&&(c=0);d===void 0&&(d=this._model.getCharCount());this._modifyContent({text:a,start:c,end:d,_code:!0},!i);if(i)this._columnX=-1,this._setSelection(new l(0,0,!1),!0),b.isFirefox&&this._fixCaret()},setTopIndex:function(a){this._clientDiv&&
this._scrollView(0,this._getLinePixel(Math.max(0,a))-this._getScroll().y)},setTopPixel:function(a){this._clientDiv&&this._scrollView(0,Math.max(0,a)-this._getScroll().y)},showSelection:function(){return this._showCaret(!0)},update:function(a,c){this._clientDiv&&(a&&this._updateStyle(),c===void 0||c?this._update():this._queueUpdate())},_handleRootMouseDown:function(a){if(b.isFirefox&&a.which===1)this._clientDiv.contentEditable=!1,this._ignoreBlur=(this._overlayDiv||this._clientDiv).draggable=!0;var c=
this._overlayDiv||this._clientDiv;if(b.isIE<9)c=this._viewDiv;for(var d=a.target?a.target:a.srcElement;d;){if(c===d)return;d=d.parentNode}a.preventDefault&&a.preventDefault();a.stopPropagation&&a.stopPropagation();if(!this._isW3CEvents){var i=this;this._getWindow().setTimeout(function(){i._clientDiv.focus()},0)}},_handleRootMouseUp:function(a){if(b.isFirefox&&a.which===1)this._clientDiv.contentEditable=!0,(this._overlayDiv||this._clientDiv).draggable=!1,this._fixCaret(),this._ignoreBlur=!1},_handleBlur:function(){if(!this._ignoreBlur){this._hasFocus=
!1;if(b.isIE<9&&!this._getSelection().isEmpty()){var a=this._rootDiv,c=b.createElement(a.ownerDocument,"div");a.appendChild(c);a.removeChild(c)}if(this._selDiv1)if(this._selDiv1.style.background="lightgray",this._selDiv2.style.background="lightgray",this._selDiv3.style.background="lightgray",a=this._getWindow(),c=this._selDiv1.ownerDocument,a.getSelection){c=a.getSelection();for(a=c.anchorNode;a;){if(a===this._clientDiv){c.rangeCount>0&&c.removeAllRanges();break}a=a.parentNode}}else if(c.selection){this._ignoreSelect=
!1;for(a=c.selection.createRange().parentElement();a;){if(a===this._clientDiv){c.selection.empty();break}a=a.parentNode}this._ignoreSelect=!0}if(!this._ignoreFocus)this.onBlur({type:"Blur"})}},_handleContextMenu:function(a){b.isIE&&this._lastMouseButton===3&&this._updateDOMSelection();var c=!1;if(this.isListening("ContextMenu"))c=this._createMouseEvent("ContextMenu",a),c.screenX=a.screenX,c.screenY=a.screenY,this.onContextMenu(c),c=c.defaultPrevented;if(c)return a.preventDefault&&a.preventDefault(),
!1},_handleCopy:function(a){if(!this._ignoreCopy&&this._doCopy(a))return a.preventDefault&&a.preventDefault(),!1},_handleCut:function(a){if(this._doCut(a))return a.preventDefault&&a.preventDefault(),!1},_handleDataModified:function(){this._startIME()},_handleDblclick:function(a){this._lastMouseTime=a.timeStamp?a.timeStamp:(new Date).getTime();if(this._clickCount!==2)this._clickCount=2,this._handleMouse(a)},_handleDragStart:function(a){if(b.isFirefox){var c=this;this._getWindow().setTimeout(function(){c._clientDiv.contentEditable=
!0;c._clientDiv.draggable=!1;c._ignoreBlur=!1},0)}if(this.isListening("DragStart")&&this._dragOffset!==-1)this._isMouseDown=!1,this.onDragStart(this._createMouseEvent("DragStart",a)),this._dragOffset=-1;else return a.preventDefault&&a.preventDefault(),!1},_handleDrag:function(a){if(this.isListening("Drag"))this.onDrag(this._createMouseEvent("Drag",a))},_handleDragEnd:function(a){this._dropTarget=!1;this._dragOffset=-1;if(this.isListening("DragEnd"))this.onDragEnd(this._createMouseEvent("DragEnd",
a));b.isFirefox&&(this._fixCaret(),a.dataTransfer.dropEffect==="none"&&!a.dataTransfer.mozUserCancelled&&this._fixCaret())},_handleDragEnter:function(a){var c=!0;this._dropTarget=!0;this.isListening("DragEnter")&&(c=!1,this.onDragEnter(this._createMouseEvent("DragEnter",a)));if(b.isWebkit||c)return a.preventDefault&&a.preventDefault(),!1},_handleDragOver:function(a){var c=!0;this.isListening("DragOver")&&(c=!1,this.onDragOver(this._createMouseEvent("DragOver",a)));if(b.isWebkit||c){if(c)a.dataTransfer.dropEffect=
"none";a.preventDefault&&a.preventDefault();return!1}},_handleDragLeave:function(a){this._dropTarget=!1;if(this.isListening("DragLeave"))this.onDragLeave(this._createMouseEvent("DragLeave",a))},_handleDrop:function(a){this._dropTarget=!1;if(this.isListening("Drop"))this.onDrop(this._createMouseEvent("Drop",a));a.preventDefault&&a.preventDefault();return!1},_handleFocus:function(){this._hasFocus=!0;b.isIOS&&this._lastTouchOffset!==void 0?(this.setCaretOffset(this._lastTouchOffset,!0),this._lastTouchOffset=
void 0):this._updateDOMSelection();if(this._selDiv1){var a=this._highlightRGB;this._selDiv1.style.background=a;this._selDiv2.style.background=a;this._selDiv3.style.background=a}if(!this._ignoreFocus)this.onFocus({type:"Focus"})},_handleKeyDown:function(a){var c=!1;switch(a.keyCode){case 16:case 17:case 18:case 91:c=!0;break;default:this._setLinksVisible(!1)}if(a.keyCode===229){if(this._readonly)return a.preventDefault&&a.preventDefault(),!1;c=!0;b.isSafari&&b.isMac&&a.ctrlKey&&(c=!1);c&&this._startIME()}else c||
this._commitIME();if((b.isMac||b.isLinux)&&b.isFirefox<4||b.isOpera)return this._keyDownEvent=a,!0;if(this._doAction(a))return a.preventDefault?(a.preventDefault(),a.stopPropagation()):(a.cancelBubble=!0,a.returnValue=!1,a.keyCode=0),!1},_handleKeyPress:function(a){if(b.isMac&&b.isWebkit&&(63232<=a.keyCode&&a.keyCode<=63487||a.keyCode===13||a.keyCode===8))return a.preventDefault&&a.preventDefault(),!1;if(((b.isMac||b.isLinux)&&b.isFirefox<4||b.isOpera)&&this._doAction(this._keyDownEvent))return a.preventDefault&&
a.preventDefault(),!1;var c=b.isMac?a.metaKey:a.ctrlKey;if(a.charCode!==void 0&&c)switch(a.charCode){case 99:case 118:case 120:return!0}c=!1;if(b.isMac){if(a.ctrlKey||a.metaKey)c=!0}else if(b.isFirefox){if(a.ctrlKey||a.altKey)c=!0}else a.ctrlKey^a.altKey&&(c=!0);if(!c&&(c=b.isOpera?a.which:a.charCode!==void 0?a.charCode:a.keyCode,c>31))return this._doContent(String.fromCharCode(c)),a.preventDefault&&a.preventDefault(),!1},_handleKeyUp:function(a){(b.isMac?a.metaKey:a.ctrlKey)||this._setLinksVisible(!1);
a.keyCode===13&&this._commitIME()},_handleLinkClick:function(a){if(!(b.isMac?a.metaKey:a.ctrlKey))return a.preventDefault&&a.preventDefault(),!1},_handleMouse:function(a){var c=this._getWindow(),d=!0,i=c;if(b.isIE||b.isFirefox&&!this._overlayDiv)i=this._clientDiv;if(this._overlayDiv){if(this._hasFocus)this._ignoreFocus=!0;var e=this;c.setTimeout(function(){e.focus();e._ignoreFocus=!1},0)}this._clickCount===1?(d=this._setSelectionTo(a.clientX,a.clientY,a.shiftKey,!b.isOpera&&this._hasFocus&&this.isListening("DragStart")))&&
this._setGrab(i):(this._isW3CEvents&&this._setGrab(i),this._doubleClickSelection=null,this._setSelectionTo(a.clientX,a.clientY,a.shiftKey),this._doubleClickSelection=this._getSelection());return d},_handleMouseDown:function(a){if(this._linksVisible)if((a.target||a.srcElement).tagName!=="A")this._setLinksVisible(!1);else return;this._commitIME();var c=a.which;c||(a.button===4&&(c=2),a.button===2&&(c=3),a.button===1&&(c=1));var d=c!==2&&a.timeStamp?a.timeStamp:(new Date).getTime(),i=d-this._lastMouseTime,
e=Math.abs(this._lastMouseX-a.clientX),f=Math.abs(this._lastMouseY-a.clientY),g=this._lastMouseButton===c;this._lastMouseX=a.clientX;this._lastMouseY=a.clientY;this._lastMouseTime=d;this._lastMouseButton=c;if(c===1)this._isMouseDown=!0,g&&i<=this._clickTime&&e<=this._clickDist&&f<=this._clickDist?this._clickCount++:this._clickCount=1;if(this.isListening("MouseDown")&&(d=this._createMouseEvent("MouseDown",a),this.onMouseDown(d),d.defaultPrevented)){a.preventDefault();return}if(c===1&&this._handleMouse(a)&&
(b.isIE>=9||b.isOpera||b.isChrome||b.isSafari||b.isFirefox&&!this._overlayDiv))this._hasFocus||this.focus(),a.preventDefault();b.isFirefox&&this._lastMouseButton===3&&this._updateDOMSelection()},_handleMouseOver:function(a){if(this.isListening("MouseOver"))this.onMouseOver(this._createMouseEvent("MouseOver",a))},_handleMouseOut:function(a){if(this.isListening("MouseOut"))this.onMouseOut(this._createMouseEvent("MouseOut",a))},_handleMouseMove:function(a){var c=this._isClientDiv(a);if(this.isListening("MouseMove")&&
c)this.onMouseMove(this._createMouseEvent("MouseMove",a));if(!this._dropTarget){var d=this._linksVisible||this._lastMouseMoveX!==a.clientX||this._lastMouseMoveY!==a.clientY;this._lastMouseMoveX=a.clientX;this._lastMouseMoveY=a.clientY;this._setLinksVisible(d&&!this._isMouseDown&&(b.isMac?a.metaKey:a.ctrlKey));if(!this._isW3CEvents){if(a.button===0)return this._setGrab(null),!0;if(!this._isMouseDown&&a.button===1&&(this._clickCount&1)!==0&&c)return this._clickCount=2,this._handleMouse(a,this._clickCount)}if(this._isMouseDown&&
this._dragOffset===-1){var c=a.clientX,a=a.clientY,i=this._getViewPadding(),e=this._viewDiv.getBoundingClientRect(),f=this._getClientWidth(),g=this._getClientHeight(),d=e.left+i.left,h=e.top+i.top,f=e.left+i.left+f,i=e.top+i.top+g,e=this._model,g=e.getLineAtOffset(this._getSelection().getCaret());a<h&&g!==0?this._doAutoScroll("up",c,a-h):a>i&&g!==e.getLineCount()-1?this._doAutoScroll("down",c,a-i):c<d&&!this._wrapMode?this._doAutoScroll("left",c-d,a):c>f&&!this._wrapMode?this._doAutoScroll("right",
c-f,a):(this._endAutoScroll(),this._setSelectionTo(c,a,!0))}}},_isClientDiv:function(a){for(var c=this._overlayDiv||this._clientDiv,a=a.target?a.target:a.srcElement;a;){if(c===a)return!0;a=a.parentNode}return!1},_createMouseEvent:function(a,c){var b=this.convert({x:c.clientX,y:c.clientY},"page","document");return{type:a,event:c,clickCount:this._clickCount,x:b.x,y:b.y,preventDefault:function(){this.defaultPrevented=!0}}},_handleMouseUp:function(a){var c=a.which?a.button===0:a.button===1;if(this.isListening("MouseUp")&&
(this._isClientDiv(a)||c&&this._isMouseDown))this.onMouseUp(this._createMouseEvent("MouseUp",a));if(!this._linksVisible&&c&&this._isMouseDown){if(this._dragOffset!==-1)c=this._getSelection(),c.extend(this._dragOffset),c.collapse(),this._setSelection(c,!0,!0),this._dragOffset=-1;this._isMouseDown=!1;this._endAutoScroll();this._isW3CEvents&&this._setGrab(null);b.isFirefox&&a.preventDefault()}},_handleMouseWheel:function(a){var c=this._getLineHeight(),d=0,i=0;b.isIE||b.isOpera?i=-a.wheelDelta/40*c:b.isFirefox?
(c=b.isMac?a.detail*3:Math.max(-256,Math.min(256,a.detail))*c,a.axis===a.HORIZONTAL_AXIS?d=c:i=c):b.isMac?(i=d=40,a.wheelDeltaX%120!==0&&(d=1),a.wheelDeltaY%120!==0&&(i=1),d=-a.wheelDeltaX/d,-1<d&&d<0&&(d=-1),0<d&&d<1&&(d=1),i=-a.wheelDeltaY/i,-1<i&&i<0&&(i=-1),0<i&&i<1&&(i=1)):(d=-a.wheelDeltaX,i=-a.wheelDeltaY/120*8*c);if(b.isSafari){for(c=a.target;c&&c.lineIndex===void 0;)c=c.parentNode;this._mouseWheelLine=c}c=this._getScroll();this._scrollView(d,i);d=this._getScroll();if(c.x!==d.x||c.y!==d.y)return a.preventDefault&&
a.preventDefault(),!1},_handlePaste:function(a){if(!this._ignorePaste&&this._doPaste(a)){if(b.isIE){var c=this;this._ignoreFocus=!0;this._getWindow().setTimeout(function(){c._updateDOMSelection();c._ignoreFocus=!1},0)}a.preventDefault&&a.preventDefault();return!1}},_handleResize:function(){var a=this._parent.clientWidth,c=this._parent.clientHeight;if(this._parentWidth!==a||this._parentHeight!==c)this._parentWidth!==a&&this._resetLineHeight(),this._parentWidth=a,this._parentHeight=c,b.isIE<9?this._queueUpdate():
this._update()},_handleRulerEvent:function(a){for(var c=a.target?a.target:a.srcElement,b=c.lineIndex;c&&!c._ruler;){if(b===void 0&&c.lineIndex!==void 0)b=c.lineIndex;c=c.parentNode}c=c?c._ruler:null;if(b===void 0&&c&&c.getOverview()==="document"){var b=this._getClientHeight(),d=this._model.getLineCount(),i=this._getViewPadding(),e=this._viewDiv.getBoundingClientRect(),b=Math.floor((a.clientY-e.top-this._metrics.scrollWidth)*d/(b+i.top+i.bottom-2*this._metrics.scrollWidth));0<=b&&b<d||(b=void 0)}if(c)switch(a.type){case "click":if(c.onClick)c.onClick(b,
a);break;case "dblclick":if(c.onDblClick)c.onDblClick(b,a);break;case "mousemove":if(c.onMouseMove)c.onMouseMove(b,a);break;case "mouseover":if(c.onMouseOver)c.onMouseOver(b,a);break;case "mouseout":if(c.onMouseOut)c.onMouseOut(b,a)}},_handleScroll:function(){var a=this._getScroll(),c=this._hScroll,b=this._vScroll;if(c!==a.x||b!==a.y)this._checkOverlayScroll(),this._hScroll=a.x,this._vScroll=a.y,this._commitIME(),this._update(b===a.y),this.onScroll({type:"Scroll",oldValue:{x:c,y:b},newValue:a})},
_handleSelectStart:function(a){if(this._ignoreSelect)return a&&a.preventDefault&&a.preventDefault(),!1},_getModelOffset:function(a,c){if(a){var b;b=a.tagName==="DIV"?a:a.parentNode.parentNode;var d=0,i=b.lineIndex;if(a.tagName!=="DIV")for(b=b.firstChild;b;){var e=b.firstChild;if(e===a){b.ignoreChars&&(d-=b.ignoreChars);d+=c;break}b.ignoreChars&&(d-=b.ignoreChars);d+=e.data.length;b=b.nextSibling}return Math.max(0,d)+this._model.getLineStart(i)}},_updateSelectionFromDOM:function(){var a=this._getWindow().getSelection(),
c=this._getModelOffset(a.anchorNode,a.anchorOffset),a=this._getModelOffset(a.focusNode,a.focusOffset);c===void 0||a===void 0||this._setSelection(new l(c,a),!1,!1)},_handleSelectionChange:function(){if(this._imeOffset===-1)if(b.isAndroid){var a=this._getWindow();this._selTimer&&a.clearTimeout(this._selTimer);var c=this;this._selTimer=a.setTimeout(function(){if(c._clientDiv)c._selTimer=null,c._updateSelectionFromDOM()},250)}else this._updateSelectionFromDOM()},_handleTextInput:function(a){this._imeOffset=
-1;if(b.isAndroid){for(var c=this._getWindow().getSelection(),d=c.anchorNode;d;){if(d.lineIndex!==void 0)break;d=d.parentNode}if(d){var i=this._model,e=d.lineIndex,f=i.getLine(e),g=f,h=0,i=i.getLineStart(e);if(c.rangeCount>0)c.getRangeAt(0).deleteContents(),e=d.ownerDocument.createTextNode(a.data),c.getRangeAt(0).insertNode(e),h=this._getDOMText(d,e),g=h.text,h=h.offset,e.parentNode.removeChild(e);d.lineRemoved=!0;for(d=0;f.charCodeAt(d)===g.charCodeAt(d)&&d<h;)d++;c=f.length-1;for(e=g.length-f.length;f.charCodeAt(c)===
g.charCodeAt(c+e)&&c+e>=h+a.data.length;)c--;c++;f=g.substring(d,c+e);d+=i;c+=i;this._modifyContent({text:f,start:d,end:c,_ignoreDOMSelection:!0},!0)}}else this._doContent(a.data);a.preventDefault()},_handleTouchStart:function(a){this._commitIME();var c=this._getWindow();if(this._touchScrollTimer)this._vScrollDiv.style.display="none",this._hScrollDiv.style.display="none",c.clearInterval(this._touchScrollTimer),this._touchScrollTimer=null;var d=a.touches;if(d.length===1){var d=d[0],i=d.clientX,e=d.clientY;
this._touchStartX=i;this._touchStartY=e;if(b.isAndroid&&(e<d.pageY-c.pageYOffset||i<d.pageX-c.pageXOffset))i=d.pageX-c.pageXOffset,e=d.pageY-c.pageYOffset;c=this.convert({x:i,y:e},"page","document");this._lastTouchOffset=this.getOffsetAtLocation(c.x,c.y);this._touchStartTime=a.timeStamp;this._touching=!0}},_handleTouchMove:function(a){var c=a.touches;if(c.length===1){c=c[0];this._touchCurrentX=c.clientX;this._touchCurrentY=c.clientY;if(!this._touchScrollTimer&&a.timeStamp-this._touchStartTime<200){this._vScrollDiv.style.display=
"block";if(!this._wrapMode)this._hScrollDiv.style.display="block";var b=this,d=this._getWindow();this._touchScrollTimer=d.setInterval(function(){var a=0,c=0;if(b._touching)a=b._touchStartX-b._touchCurrentX,c=b._touchStartY-b._touchCurrentY,b._touchSpeedX=a/10,b._touchSpeedY=c/10,b._touchStartX=b._touchCurrentX,b._touchStartY=b._touchCurrentY;else if(Math.abs(b._touchSpeedX)<0.1&&Math.abs(b._touchSpeedY)<0.1){b._vScrollDiv.style.display="none";b._hScrollDiv.style.display="none";d.clearInterval(b._touchScrollTimer);
b._touchScrollTimer=null;return}else a=b._touchSpeedX*10,c=b._touchSpeedY*10,b._touchSpeedX*=0.95,b._touchSpeedY*=0.95;b._scrollView(a,c)},10)}this._touchScrollTimer&&a.preventDefault()}},_handleTouchEnd:function(a){if(a.touches.length===0)this._touching=!1},_doAction:function(a){for(var c=this._keyBindings,b=0;b<c.length;b++){var d=c[b];if(d.keyBinding.match(a)){if(d.actionID&&(a=this._actions[d.actionID]))if(a.handler){if(!a.handler())return a.defaultHandler?typeof a.defaultHandler()==="boolean":
!1}else if(a.defaultHandler)return typeof a.defaultHandler()==="boolean";return!0}}return!1},_doBackspace:function(a){var c=this._getSelection();if(c.isEmpty()){var b=this._model,d=c.getCaret(),i=b.getLineAtOffset(d),e=b.getLineStart(i);if(d===e)i>0&&c.extend(b.getLineEnd(i-1));else{var f=!1;this._expandTab&&a.unit==="character"&&(d-e)%this._tabSize===0&&(f=!/[^ ]/.test(b.getText(e,d)));f?c.extend(d-this._tabSize):(b=this._getLine(i),c.extend(b.getNextOffset(d,a.unit,-1)),b.destroy())}}this._modifyContent({text:"",
start:c.start,end:c.end},!0);return!0},_doContent:function(a){var c=this._getSelection();this._modifyContent({text:a,start:c.start,end:c.end,_ignoreDOMSelection:!0},!0)},_doCopy:function(a){var c=this._getSelection();return!c.isEmpty()?this._setClipboardText(this._getBaseText(c.start,c.end),a):!0},_doCursorNext:function(a){if(!a.select&&this._clearSelection("next"))return!0;var c=this._model,b=this._getSelection(),d=b.getCaret(),i=c.getLineAtOffset(d);d===c.getLineEnd(i)?i+1<c.getLineCount()&&b.extend(c.getLineStart(i+
1)):(c=this._getLine(i),b.extend(c.getNextOffset(d,a.unit,1)),c.destroy());a.select||b.collapse();this._setSelection(b,!0);return!0},_doCursorPrevious:function(a){if(!a.select&&this._clearSelection("previous"))return!0;var c=this._model,b=this._getSelection(),d=b.getCaret(),i=c.getLineAtOffset(d);d===c.getLineStart(i)?i>0&&b.extend(c.getLineEnd(i-1)):(c=this._getLine(i),b.extend(c.getNextOffset(d,a.unit,-1)),c.destroy());a.select||b.collapse();this._setSelection(b,!0);return!0},_doCut:function(a){var c=
this._getSelection();return!c.isEmpty()?(c=this._getBaseText(c.start,c.end),this._doContent(""),this._setClipboardText(c,a)):!0},_doDelete:function(a){var c=this._getSelection();if(c.isEmpty()){var b=this._model,d=c.getCaret(),i=b.getLineAtOffset(d);d===b.getLineEnd(i)?i+1<b.getLineCount()&&c.extend(b.getLineStart(i+1)):(b=this._getLine(i),c.extend(b.getNextOffset(d,a.unit,1)),b.destroy())}this._modifyContent({text:"",start:c.start,end:c.end},!0);return!0},_doEnd:function(a){var c=this._getSelection(),
b=this._model;if(a.ctrl)c.extend(b.getCharCount());else{var d=c.getCaret(),i=b.getLineAtOffset(d);if(this._wrapMode){var e=this._getLine(i),d=e.getLineIndex(d),d=d===e.getLineCount()-1?b.getLineEnd(i):e.getLineStart(d+1)-1;e.destroy()}else d=b.getLineEnd(i);c.extend(d)}a.select||c.collapse();this._setSelection(c,!0);return!0},_doEnter:function(a){var c=this._model,b=this._getSelection();this._doContent(c.getLineDelimiter());if(a&&a.noCursor)b.end=b.start,this._setSelection(b);return!0},_doHome:function(a){var c=
this._getSelection(),b=this._model;if(a.ctrl)c.extend(0);else{var d=c.getCaret(),i=b.getLineAtOffset(d);this._wrapMode?(b=this._getLine(i),d=b.getLineIndex(d),d=b.getLineStart(d),b.destroy()):d=b.getLineStart(i);c.extend(d)}a.select||c.collapse();this._setSelection(c,!0);return!0},_doLineDown:function(a){var c=this._model,d=this._getSelection(),i=d.getCaret(),e=c.getLineAtOffset(i),f=this._getLine(e),g=this._columnX,h=1,l=!1;if(g===-1||a.wholeLine||a.select&&b.isIE)g=a.wholeLine?c.getLineEnd(e+1):
i,g=f.getBoundingClientRect(g).left;(i=f.getLineIndex(i))<f.getLineCount()-1?h=f.getClientRects(i+1).top+1:(l=e===c.getLineCount()-1,e++);l?a.select&&(d.extend(c.getCharCount()),this._setSelection(d,!0,!0)):(f.lineIndex!==e&&(f.destroy(),f=this._getLine(e)),d.extend(f.getOffset(g,h)),a.select||d.collapse(),this._setSelection(d,!0,!0));this._columnX=g;f.destroy();return!0},_doLineUp:function(a){var c=this._model,d=this._getSelection(),i=d.getCaret(),e=c.getLineAtOffset(i),f=this._getLine(e),g=this._columnX,
h=!1,l;if(g===-1||a.wholeLine||a.select&&b.isIE)g=a.wholeLine?c.getLineStart(e-1):i,g=f.getBoundingClientRect(g).left;(i=f.getLineIndex(i))>0?l=f.getClientRects(i-1).top+1:(h=e===0,h||(e--,l=this._getLineHeight(e)-1));h?a.select&&(d.extend(0),this._setSelection(d,!0,!0)):(f.lineIndex!==e&&(f.destroy(),f=this._getLine(e)),d.extend(f.getOffset(g,l)),a.select||d.collapse(),this._setSelection(d,!0,!0));this._columnX=g;f.destroy();return!0},_doPageDown:function(a){var c=this._model,d=this._getSelection(),
i=d.getCaret(),e=c.getLineAtOffset(i),f=c.getLineCount(),g=this._getScroll(),h=this._getClientHeight(),l;if(this._lineHeight){c=this._columnX;g=this._getBoundsAtOffset(i);if(c===-1||a.select&&b.isIE)c=g.left;i=this._getLineIndex(g.top+h);l=this._getLine(i);e=this._getLinePixel(i);i=l.getOffset(c,g.top+h-e);h=l.getBoundingClientRect(i);l.destroy();d.extend(i);a.select||d.collapse();this._setSelection(d,!0,!0,h.top+e-g.top);this._columnX=c;return!0}if(e<f-1){var p=this._getLineHeight(),n=Math.min(f-
e-1,Math.floor(h/p)),n=Math.max(1,n),c=this._columnX;if(c===-1||a.select&&b.isIE)l=this._getLine(e),c=l.getBoundingClientRect(i).left,l.destroy();l=this._getLine(e+n);d.extend(l.getOffset(c,0));l.destroy();a.select||d.collapse();a=f*p;i=g.y+n*p;i+h>a&&(i=a-h);this._setSelection(d,!0,!0,i-g.y);this._columnX=c}return!0},_doPageUp:function(a){var c=this._model,d=this._getSelection(),i=d.getCaret(),e=c.getLineAtOffset(i),f=this._getScroll(),g=this._getClientHeight(),h;if(this._lineHeight){c=this._columnX;
f=this._getBoundsAtOffset(i);if(c===-1||a.select&&b.isIE)c=f.left;i=this._getLineIndex(f.bottom-g);h=this._getLine(i);e=this._getLinePixel(i);i=h.getOffset(c,f.bottom-g-e);g=h.getBoundingClientRect(i);h.destroy();d.extend(i);a.select||d.collapse();this._setSelection(d,!0,!0,g.top+e-f.top);this._columnX=c;return!0}if(e>0){var l=this._getLineHeight(),g=Math.max(1,Math.min(e,Math.floor(g/l))),c=this._columnX;if(c===-1||a.select&&b.isIE)h=this._getLine(e),c=h.getBoundingClientRect(i).left,h.destroy();
h=this._getLine(e-g);d.extend(h.getOffset(c,this._getLineHeight(e-g)-1));h.destroy();a.select||d.collapse();a=Math.max(0,f.y-g*l);this._setSelection(d,!0,!0,a-f.y);this._columnX=c}return!0},_doPaste:function(a){var c=this;return this._getClipboardText(a,function(a){a&&(b.isLinux&&c._lastMouseButton===2&&(new Date).getTime()-c._lastMouseTime<=c._clickTime&&c._setSelectionTo(c._lastMouseX,c._lastMouseY),c._doContent(a))})!==null},_doScroll:function(a){var c=a.type,b=this._model,d=b.getLineCount(),a=
this._getClientHeight(),i=this._getLineHeight();d*=i;var e=this._getScroll().y,f;switch(c){case "textStart":f=0;break;case "textEnd":f=d-a;break;case "pageDown":f=e+a;break;case "pageUp":f=e-a;break;case "centerLine":c=this._getSelection(),f=b.getLineAtOffset(c.start),b=(b.getLineAtOffset(c.end)-f+1)*i,f=f*i-a/2+b/2}f!==void 0&&(f=Math.min(Math.max(0,f),d-a),this._scrollView(0,f-e));return!0},_doSelectAll:function(){var a=this._model,c=this._getSelection();c.setCaret(0);c.extend(a.getCharCount());
this._setSelection(c,!1);return!0},_doTab:function(){if(this._tabMode&&!this._readonly){var a="\t";if(this._expandTab)var c=this._model,a=this._getSelection().getCaret(),b=c.getLineAtOffset(a),c=c.getLineStart(b),a=Array(this._tabSize-(a-c)%this._tabSize+1).join(" ");this._doContent(a);return!0}},_doShiftTab:function(){return!this._tabMode||this._readonly?void 0:!0},_doTabMode:function(){this._tabMode=!this._tabMode;return!0},_doWrapMode:function(){this.setOptions({wrapMode:!this.getOptions("wrapMode")});
return!0},_autoScroll:function(){var a=this._getSelection(),c=this.convert({x:this._autoScrollX,y:this._autoScrollY},"page","document"),b=a.getCaret(),d=this._model.getLineAtOffset(b),i;if(this._autoScrollDir==="up"||this._autoScrollDir==="down")b=this._autoScrollY/this._getLineHeight(),b=b<0?Math.floor(b):Math.ceil(b),i=d,i=Math.max(0,Math.min(this._model.getLineCount()-1,i+b));else if(this._autoScrollDir==="left"||this._autoScrollDir==="right")i=this._getLineIndex(c.y),d=this._getLine(d),c.x+=d.getBoundingClientRect(b,
!1).left,d.destroy();d=this._getLine(i);a.extend(d.getOffset(c.x,c.y-this._getLinePixel(i)));d.destroy();this._setSelection(a,!0)},_autoScrollTimer:function(){this._autoScroll();var a=this;this._autoScrollTimerID=this._getWindow().setTimeout(function(){a._autoScrollTimer()},this._AUTO_SCROLL_RATE)},_calculateLineHeightTimer:function(a){if(this._lineHeight&&!this._calculateLHTimer){var c=this._model.getLineCount(),b=0;if(a){for(var a=0,d=(new Date).getTime(),i=0;b<c;)if(this._lineHeight[b]||(a++,i||
(i=b),this._lineHeight[b]=this._calculateLineHeight(b)),b++,(new Date).getTime()-d>100)break;this.redrawRulers(0,c);this._queueUpdate()}a=this._getWindow();if(b!==c){var e=this;this._calculateLHTimer=a.setTimeout(function(){e._calculateLHTimer=null;e._calculateLineHeightTimer(!0)},0)}else if(this._calculateLHTimer)a.clearTimeout(this._calculateLHTimer),this._calculateLHTimer=void 0}},_calculateLineHeight:function(a){var a=this._getLine(a),c=a.getBoundingClientRect();a.destroy();return Math.max(1,
Math.ceil(c.bottom-c.top))},_calculateMetrics:function(){var c=this._clientDiv,d=c.ownerDocument,e=b.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);f(g.style,e);e.style.position="fixed";e.style.left="-1000px";var h=b.createElement(d,"span");h.appendChild(d.createTextNode(" "));e.appendChild(h);var l=b.createElement(d,"span");l.style.fontStyle="italic";l.appendChild(d.createTextNode(" "));
e.appendChild(l);var u=b.createElement(d,"span");u.style.fontWeight="bold";u.appendChild(d.createTextNode(" "));e.appendChild(u);g=b.createElement(d,"span");g.style.fontWeight="bold";g.style.fontStyle="italic";g.appendChild(d.createTextNode(" "));e.appendChild(g);c.appendChild(e);var n=e.getBoundingClientRect(),h=h.getBoundingClientRect(),l=l.getBoundingClientRect(),u=u.getBoundingClientRect(),g=g.getBoundingClientRect(),h=h.bottom-h.top,l=l.bottom-l.top,u=u.bottom-u.top,j=g.bottom-g.top,p=0,g=n.bottom-
n.top<=0,n=Math.max(1,n.bottom-n.top);l>h&&(p=1);u>l&&(p=2);j>u&&(p=3);var w;if(p!==0){w={style:{}};if((p&1)!==0)w.style.fontStyle="italic";if((p&2)!==0)w.style.fontWeight="bold"}h=i(e);c.removeChild(e);l=a(this._viewDiv);e=b.createElement(d,"div");e.style.position="fixed";e.style.left="-1000px";e.style.paddingLeft=l.left+"px";e.style.paddingTop=l.top+"px";e.style.paddingRight=l.right+"px";e.style.paddingBottom=l.bottom+"px";e.style.width="100px";e.style.height="100px";u=b.createElement(d,"div");
u.style.width="100%";u.style.height="100%";e.appendChild(u);c.appendChild(e);d=e.getBoundingClientRect();l=u.getBoundingClientRect();e.style.overflow="hidden";u.style.height="200px";u=e.clientWidth;e.style.overflow="scroll";j=e.clientWidth;c.removeChild(e);l={left:l.left-d.left,top:l.top-d.top,right:d.right-l.right,bottom:d.bottom-l.bottom};return{lineHeight:n,largestFontStyle:w,lineTrim:h,viewPadding:l,scrollWidth:u-j,invalid:g}},_checkOverlayScroll:function(){if(b.isMac){var a=this,c=this._getWindow();
this._overlayScrollTimer&&c.clearTimeout(this._overlayScrollTimer);var d=function(){var b=a._isOverOverlayScroll();b.vertical||b.horizontal?a._overlayScrollTimer=c.setTimeout(d,200):(a._overlayScrollTimer=void 0,a._update())};this._overlayScrollTimer=c.setTimeout(d,200)}},_clearSelection:function(a){var c=this._getSelection();if(c.isEmpty())return!1;a==="next"?c.start=c.end:c.end=c.start;this._setSelection(c,!0);return!0},_commitIME:function(){if(this._imeOffset!==-1){this._scrollDiv.focus();this._clientDiv.focus();
var a=this._model,c=a.getLineAtOffset(this._imeOffset),b=a.getLineStart(c),d=this._getDOMText(this._getLineNode(c)).text,a=a.getLine(c),b=this._imeOffset-b,a=b+d.length-a.length;b!==a&&this._doContent(d.substring(b,a));this._imeOffset=-1}},_createActions:function(){var a=k.KeyBinding,c=this._keyBindings=[];c.push({actionID:"lineUp",keyBinding:new a(38),predefined:!0});c.push({actionID:"lineDown",keyBinding:new a(40),predefined:!0});c.push({actionID:"charPrevious",keyBinding:new a(37),predefined:!0});
c.push({actionID:"charNext",keyBinding:new a(39),predefined:!0});b.isMac?(c.push({actionID:"scrollPageUp",keyBinding:new a(33),predefined:!0}),c.push({actionID:"scrollPageDown",keyBinding:new a(34),predefined:!0}),c.push({actionID:"pageUp",keyBinding:new a(33,null,null,!0),predefined:!0}),c.push({actionID:"pageDown",keyBinding:new a(34,null,null,!0),predefined:!0}),c.push({actionID:"lineStart",keyBinding:new a(37,!0),predefined:!0}),c.push({actionID:"lineEnd",keyBinding:new a(39,!0),predefined:!0}),
c.push({actionID:"wordPrevious",keyBinding:new a(37,null,null,!0),predefined:!0}),c.push({actionID:"wordNext",keyBinding:new a(39,null,null,!0),predefined:!0}),c.push({actionID:"scrollTextStart",keyBinding:new a(36),predefined:!0}),c.push({actionID:"scrollTextEnd",keyBinding:new a(35),predefined:!0}),c.push({actionID:"textStart",keyBinding:new a(38,!0),predefined:!0}),c.push({actionID:"textEnd",keyBinding:new a(40,!0),predefined:!0}),c.push({actionID:"scrollPageUp",keyBinding:new a(38,null,null,null,
!0),predefined:!0}),c.push({actionID:"scrollPageDown",keyBinding:new a(40,null,null,null,!0),predefined:!0}),c.push({actionID:"lineStart",keyBinding:new a(37,null,null,null,!0),predefined:!0}),c.push({actionID:"lineEnd",keyBinding:new a(39,null,null,null,!0),predefined:!0}),c.push({actionID:"lineStart",keyBinding:new a(38,null,null,!0),predefined:!0}),c.push({actionID:"lineEnd",keyBinding:new a(40,null,null,!0),predefined:!0})):(c.push({actionID:"pageUp",keyBinding:new a(33),predefined:!0}),c.push({actionID:"pageDown",
keyBinding:new a(34),predefined:!0}),c.push({actionID:"lineStart",keyBinding:new a(36),predefined:!0}),c.push({actionID:"lineEnd",keyBinding:new a(35),predefined:!0}),c.push({actionID:"wordPrevious",keyBinding:new a(37,!0),predefined:!0}),c.push({actionID:"wordNext",keyBinding:new a(39,!0),predefined:!0}),c.push({actionID:"textStart",keyBinding:new a(36,!0),predefined:!0}),c.push({actionID:"textEnd",keyBinding:new a(35,!0),predefined:!0}));b.isFirefox&&b.isLinux&&(c.push({actionID:"lineUp",keyBinding:new a(38,
!0),predefined:!0}),c.push({actionID:"lineDown",keyBinding:new a(40,!0),predefined:!0}));c.push({actionID:"selectLineUp",keyBinding:new a(38,null,!0),predefined:!0});c.push({actionID:"selectLineDown",keyBinding:new a(40,null,!0),predefined:!0});c.push({actionID:"selectCharPrevious",keyBinding:new a(37,null,!0),predefined:!0});c.push({actionID:"selectCharNext",keyBinding:new a(39,null,!0),predefined:!0});c.push({actionID:"selectPageUp",keyBinding:new a(33,null,!0),predefined:!0});c.push({actionID:"selectPageDown",
keyBinding:new a(34,null,!0),predefined:!0});b.isMac?(c.push({actionID:"selectLineStart",keyBinding:new a(37,!0,!0),predefined:!0}),c.push({actionID:"selectLineEnd",keyBinding:new a(39,!0,!0),predefined:!0}),c.push({actionID:"selectWordPrevious",keyBinding:new a(37,null,!0,!0),predefined:!0}),c.push({actionID:"selectWordNext",keyBinding:new a(39,null,!0,!0),predefined:!0}),c.push({actionID:"selectTextStart",keyBinding:new a(36,null,!0),predefined:!0}),c.push({actionID:"selectTextEnd",keyBinding:new a(35,
null,!0),predefined:!0}),c.push({actionID:"selectTextStart",keyBinding:new a(38,!0,!0),predefined:!0}),c.push({actionID:"selectTextEnd",keyBinding:new a(40,!0,!0),predefined:!0}),c.push({actionID:"selectLineStart",keyBinding:new a(37,null,!0,null,!0),predefined:!0}),c.push({actionID:"selectLineEnd",keyBinding:new a(39,null,!0,null,!0),predefined:!0}),c.push({actionID:"selectLineStart",keyBinding:new a(38,null,!0,!0),predefined:!0}),c.push({actionID:"selectLineEnd",keyBinding:new a(40,null,!0,!0),
predefined:!0})):(b.isLinux&&(c.push({actionID:"selectWholeLineUp",keyBinding:new a(38,!0,!0),predefined:!0}),c.push({actionID:"selectWholeLineDown",keyBinding:new a(40,!0,!0),predefined:!0})),c.push({actionID:"selectLineStart",keyBinding:new a(36,null,!0),predefined:!0}),c.push({actionID:"selectLineEnd",keyBinding:new a(35,null,!0),predefined:!0}),c.push({actionID:"selectWordPrevious",keyBinding:new a(37,!0,!0),predefined:!0}),c.push({actionID:"selectWordNext",keyBinding:new a(39,!0,!0),predefined:!0}),
c.push({actionID:"selectTextStart",keyBinding:new a(36,!0,!0),predefined:!0}),c.push({actionID:"selectTextEnd",keyBinding:new a(35,!0,!0),predefined:!0}));c.push({actionID:"undo",keyBinding:new k.KeyBinding("z",!0),predefined:!0});b.isMac?c.push({actionID:"redo",keyBinding:new k.KeyBinding("z",!0,!0),predefined:!0}):c.push({actionID:"redo",keyBinding:new k.KeyBinding("y",!0),predefined:!0});c.push({actionID:"deletePrevious",keyBinding:new a(8),predefined:!0});c.push({actionID:"deletePrevious",keyBinding:new a(8,
null,!0),predefined:!0});c.push({actionID:"deleteNext",keyBinding:new a(46),predefined:!0});c.push({actionID:"deleteWordPrevious",keyBinding:new a(8,!0),predefined:!0});c.push({actionID:"deleteWordPrevious",keyBinding:new a(8,!0,!0),predefined:!0});c.push({actionID:"deleteWordNext",keyBinding:new a(46,!0),predefined:!0});c.push({actionID:"tab",keyBinding:new a(9),predefined:!0});c.push({actionID:"shiftTab",keyBinding:new a(9,null,!0),predefined:!0});c.push({actionID:"enter",keyBinding:new a(13),predefined:!0});
c.push({actionID:"enter",keyBinding:new a(13,null,!0),predefined:!0});c.push({actionID:"selectAll",keyBinding:new a("a",!0),predefined:!0});c.push({actionID:"toggleTabMode",keyBinding:new a("m",!0),predefined:!0});b.isMac&&(c.push({actionID:"deleteNext",keyBinding:new a(46,null,!0),predefined:!0}),c.push({actionID:"deleteWordPrevious",keyBinding:new a(8,null,null,!0),predefined:!0}),c.push({actionID:"deleteWordNext",keyBinding:new a(46,null,null,!0),predefined:!0}));if(!b.isFirefox){var d=b.isMac&&
b.isChrome;c.push({actionID:null,keyBinding:new a("u",!d,!1,!1,d),predefined:!0});c.push({actionID:null,keyBinding:new a("i",!d,!1,!1,d),predefined:!0});c.push({actionID:null,keyBinding:new a("b",!d,!1,!1,d),predefined:!0})}b.isFirefox&&(c.push({actionID:"copy",keyBinding:new a(45,!0),predefined:!0}),c.push({actionID:"paste",keyBinding:new a(45,null,!0),predefined:!0}),c.push({actionID:"cut",keyBinding:new a(46,null,!0),predefined:!0}));b.isMac&&(c.push({actionID:"lineStart",keyBinding:new a("a",
!1,!1,!1,!0),predefined:!0}),c.push({actionID:"lineEnd",keyBinding:new a("e",!1,!1,!1,!0),predefined:!0}),c.push({actionID:"lineUp",keyBinding:new a("p",!1,!1,!1,!0),predefined:!0}),c.push({actionID:"lineDown",keyBinding:new a("n",!1,!1,!1,!0),predefined:!0}),c.push({actionID:"charPrevious",keyBinding:new a("b",!1,!1,!1,!0),predefined:!0}),c.push({actionID:"charNext",keyBinding:new a("f",!1,!1,!1,!0),predefined:!0}),c.push({actionID:"deletePrevious",keyBinding:new a("h",!1,!1,!1,!0),predefined:!0}),
c.push({actionID:"deleteNext",keyBinding:new a("d",!1,!1,!1,!0),predefined:!0}),c.push({actionID:"deleteLineEnd",keyBinding:new a("k",!1,!1,!1,!0),predefined:!0}),b.isFirefox?(c.push({actionID:"scrollPageDown",keyBinding:new a("v",!1,!1,!1,!0),predefined:!0}),c.push({actionID:"deleteLineStart",keyBinding:new a("u",!1,!1,!1,!0),predefined:!0}),c.push({actionID:"deleteWordPrevious",keyBinding:new a("w",!1,!1,!1,!0),predefined:!0})):(c.push({actionID:"pageDown",keyBinding:new a("v",!1,!1,!1,!0),predefined:!0}),
c.push({actionID:"centerLine",keyBinding:new a("l",!1,!1,!1,!0),predefined:!0}),c.push({actionID:"enterNoCursor",keyBinding:new a("o",!1,!1,!1,!0),predefined:!0})));var i=this;this._actions={lineUp:{defaultHandler:function(){return i._doLineUp({select:!1})}},lineDown:{defaultHandler:function(){return i._doLineDown({select:!1})}},lineStart:{defaultHandler:function(){return i._doHome({select:!1,ctrl:!1})}},lineEnd:{defaultHandler:function(){return i._doEnd({select:!1,ctrl:!1})}},charPrevious:{defaultHandler:function(){return i._doCursorPrevious({select:!1,
unit:"character"})}},charNext:{defaultHandler:function(){return i._doCursorNext({select:!1,unit:"character"})}},pageUp:{defaultHandler:function(){return i._doPageUp({select:!1})}},pageDown:{defaultHandler:function(){return i._doPageDown({select:!1})}},scrollPageUp:{defaultHandler:function(){return i._doScroll({type:"pageUp"})}},scrollPageDown:{defaultHandler:function(){return i._doScroll({type:"pageDown"})}},wordPrevious:{defaultHandler:function(){return i._doCursorPrevious({select:!1,unit:"word"})}},
wordNext:{defaultHandler:function(){return i._doCursorNext({select:!1,unit:"word"})}},textStart:{defaultHandler:function(){return i._doHome({select:!1,ctrl:!0})}},textEnd:{defaultHandler:function(){return i._doEnd({select:!1,ctrl:!0})}},scrollTextStart:{defaultHandler:function(){return i._doScroll({type:"textStart"})}},scrollTextEnd:{defaultHandler:function(){return i._doScroll({type:"textEnd"})}},centerLine:{defaultHandler:function(){return i._doScroll({type:"centerLine"})}},selectLineUp:{defaultHandler:function(){return i._doLineUp({select:!0})}},
selectLineDown:{defaultHandler:function(){return i._doLineDown({select:!0})}},selectWholeLineUp:{defaultHandler:function(){return i._doLineUp({select:!0,wholeLine:!0})}},selectWholeLineDown:{defaultHandler:function(){return i._doLineDown({select:!0,wholeLine:!0})}},selectLineStart:{defaultHandler:function(){return i._doHome({select:!0,ctrl:!1})}},selectLineEnd:{defaultHandler:function(){return i._doEnd({select:!0,ctrl:!1})}},selectCharPrevious:{defaultHandler:function(){return i._doCursorPrevious({select:!0,
unit:"character"})}},selectCharNext:{defaultHandler:function(){return i._doCursorNext({select:!0,unit:"character"})}},selectPageUp:{defaultHandler:function(){return i._doPageUp({select:!0})}},selectPageDown:{defaultHandler:function(){return i._doPageDown({select:!0})}},selectWordPrevious:{defaultHandler:function(){return i._doCursorPrevious({select:!0,unit:"word"})}},selectWordNext:{defaultHandler:function(){return i._doCursorNext({select:!0,unit:"word"})}},selectTextStart:{defaultHandler:function(){return i._doHome({select:!0,
ctrl:!0})}},selectTextEnd:{defaultHandler:function(){return i._doEnd({select:!0,ctrl:!0})}},deletePrevious:{defaultHandler:function(){return i._doBackspace({unit:"character"})}},deleteNext:{defaultHandler:function(){return i._doDelete({unit:"character"})}},deleteWordPrevious:{defaultHandler:function(){return i._doBackspace({unit:"word"})}},deleteWordNext:{defaultHandler:function(){return i._doDelete({unit:"word"})}},deleteLineStart:{defaultHandler:function(){return i._doBackspace({unit:"line"})}},
deleteLineEnd:{defaultHandler:function(){return i._doDelete({unit:"line"})}},tab:{defaultHandler:function(){return i._doTab()}},shiftTab:{defaultHandler:function(){return i._doShiftTab()}},enter:{defaultHandler:function(){return i._doEnter()}},enterNoCursor:{defaultHandler:function(){return i._doEnter({noCursor:!0})}},selectAll:{defaultHandler:function(){return i._doSelectAll()}},copy:{defaultHandler:function(){return i._doCopy()}},cut:{defaultHandler:function(){return i._doCut()}},paste:{defaultHandler:function(){return i._doPaste()}},
toggleWrapMode:{defaultHandler:function(){return i._doWrapMode()}},toggleTabMode:{defaultHandler:function(){return i._doTabMode()}}}},_createRuler:function(a,c){if(this._clientDiv){var d=a.getLocation()==="left"?this._leftDiv:this._rightDiv;d.style.display="block";var i=b.createElement(d.ownerDocument,"div");i._ruler=a;i.rulerChanged=!0;i.style.position="relative";var d=d.firstChild.rows[0],e=d.cells.length,d=d.insertCell(c===void 0||c<0||c>e?e:c);d.vAlign="top";d.style.verticalAlign="top";d.style.borderWidth=
"0px";d.style.margin="0px";d.style.padding="0px";d.style.outline="none";d.appendChild(i)}},_createView:function(){if(!this._clientDiv){for(var a=this._parent;a.hasChildNodes();)a.removeChild(a.lastChild);var c=a.ownerDocument,d=b.createElement(c,"div");this._rootDiv=d;d.tabIndex=-1;d.style.position="relative";d.style.overflow="hidden";d.style.width="100%";d.style.height="100%";a.style.overflow="hidden";d.setAttribute("role","application");a.appendChild(d);a=b.createElement(c,"div");a.className="textviewLeftRuler";
this._leftDiv=a;a.tabIndex=-1;a.style.overflow="hidden";a.style.MozUserSelect="none";a.style.WebkitUserSelect="none";a.style.position="absolute";a.style.cursor="default";a.style.display="none";a.setAttribute("aria-hidden","true");var i=b.createElement(c,"table");a.appendChild(i);i.cellPadding="0px";i.cellSpacing="0px";i.border="0px";i.style.borderWidth="0px";i.style.margin="0px";i.style.padding="0px";i.style.outline="none";i.style.lineHeight="normal";i=i.insertRow(0);i.style.borderWidth="0px";i.style.margin=
"0px";i.style.padding="0px";i.style.outline="none";i.style.lineHeight="normal";d.appendChild(a);a=b.createElement(c,"div");a.className="textview";this._viewDiv=a;a.tabIndex=-1;a.style.overflow="auto";a.style.position="absolute";a.style.top="0px";a.style.bottom="0px";a.style.borderWidth="0px";a.style.margin="0px";a.style.outline="none";d.appendChild(a);var e=b.createElement(c,"div");e.className="textviewRightRuler";this._rightDiv=e;e.tabIndex=-1;e.style.display="none";e.style.overflow="hidden";e.style.MozUserSelect=
"none";e.style.WebkitUserSelect="none";e.style.position="absolute";e.style.cursor="default";e.style.right="0px";e.setAttribute("aria-hidden","true");i=b.createElement(c,"table");e.appendChild(i);i.cellPadding="0px";i.cellSpacing="0px";i.border="0px";i.style.borderWidth="0px";i.style.margin="0px";i.style.padding="0px";i.style.outline="none";i.style.lineHeight="normal";i=i.insertRow(0);i.style.borderWidth="0px";i.style.margin="0px";i.style.padding="0px";i.style.outline="none";i.style.lineHeight="normal";
d.appendChild(e);this._scrollDiv=i=b.createElement(c,"div");i.style.margin="0px";i.style.borderWidth="0px";i.style.padding="0px";a.appendChild(i);if(b.isFirefox)this._clipboardDiv=a=b.createElement(c,"div"),a.style.position="fixed",a.style.whiteSpace="pre",a.style.left="-1000px",d.appendChild(a);if(!b.isIE&&!b.isIOS)this._clipDiv=a=b.createElement(c,"div"),a.style.position="absolute",a.style.overflow="hidden",a.style.margin="0px",a.style.borderWidth="0px",a.style.padding="0px",d.appendChild(a),this._clipScrollDiv=
i=b.createElement(c,"div"),i.style.position="absolute",i.style.height="1px",i.style.top="-1000px",a.appendChild(i);this._setFullSelection(this._fullSelection,!0);a=b.createElement(c,"div");a.className="textviewContent";this._clientDiv=a;a.style.position="absolute";a.style.borderWidth="0px";a.style.margin="0px";a.style.padding="0px";a.style.outline="none";a.style.zIndex="1";a.style.WebkitUserSelect="text";a.setAttribute("spellcheck","false");if(b.isIOS||b.isAndroid)a.style.WebkitTapHighlightColor=
"transparent";(this._clipDiv||d).appendChild(a);if(b.isIOS||b.isAndroid)this._vScrollDiv=i=b.createElement(c,"div"),i.style.position="absolute",i.style.borderWidth="1px",i.style.borderColor="white",i.style.borderStyle="solid",i.style.borderRadius="4px",i.style.backgroundColor="black",i.style.opacity="0.5",i.style.margin="0px",i.style.padding="0px",i.style.outline="none",i.style.zIndex="3",i.style.width="8px",i.style.display="none",d.appendChild(i),this._hScrollDiv=i=b.createElement(c,"div"),i.style.position=
"absolute",i.style.borderWidth="1px",i.style.borderColor="white",i.style.borderStyle="solid",i.style.borderRadius="4px",i.style.backgroundColor="black",i.style.opacity="0.5",i.style.margin="0px",i.style.padding="0px",i.style.outline="none",i.style.zIndex="3",i.style.height="8px",i.style.display="none",d.appendChild(i);if(b.isFirefox&&!a.setCapture)this._overlayDiv=i=b.createElement(c,"div"),i.style.position=a.style.position,i.style.borderWidth=a.style.borderWidth,i.style.margin=a.style.margin,i.style.padding=
a.style.padding,i.style.cursor="text",i.style.zIndex="2",(this._clipDiv||d).appendChild(i);a.contentEditable="true";a.setAttribute("role","textbox");a.setAttribute("aria-multiline","true");this._setWrapMode(this._wrapMode,!0);this._setReadOnly(this._readonly);this._setThemeClass(this._themeClass,!0);this._setTabSize(this._tabSize,!0);if(!c.getElementById("_textviewStyle")&&(d="",b.isWebkit&&this._metrics.scrollWidth>0&&(d+="\n.textviewContainer ::-webkit-scrollbar-corner {background: #eeeeee;}"),
b.isFirefox&&b.isMac&&this._highlightRGB&&this._highlightRGB!=="Highlight"&&(d+="\n.textviewContainer ::-moz-selection {background: "+this._highlightRGB+";}"),d))a=b.createElement(c,"style"),a.id="_textviewStyle",i=c.getElementsByTagName("head")[0]||c.documentElement,a.appendChild(c.createTextNode(d)),i.insertBefore(a,i.firstChild);this._hookEvents();c=this._rulers;for(d=0;d<c.length;d++)this._createRuler(c[d]);this._update()}},_defaultOptions:function(){return{parent:{value:void 0,update:null},model:{value:void 0,
update:this.setModel},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},wrapMode:{value:!1,update:this._setWrapMode},themeClass:{value:void 0,update:this._setThemeClass}}},_destroyRuler:function(a){var c=a.getLocation()==="left"?this._leftDiv:this._rightDiv;if(c){for(var b=c.firstChild.rows[0],d=b.cells,i=0;i<d.length;i++)if(d[i].firstChild._ruler===
a)break;if(i!==d.length&&(b.cells[i]._ruler=void 0,b.deleteCell(i),d.length===0))c.style.display="none"}},_destroyView:function(){if(this._clientDiv){this._setGrab(null);this._unhookEvents();var a=this._getWindow();if(this._autoScrollTimerID)a.clearTimeout(this._autoScrollTimerID),this._autoScrollTimerID=null;if(this._updateTimer)a.clearTimeout(this._updateTimer),this._updateTimer=null;a=this._rootDiv;a.parentNode.removeChild(a);this._hScrollDiv=this._vScrollDiv=this._rightDiv=this._leftDiv=this._overlayDiv=
this._clientDiv=this._clipScrollDiv=this._clipDiv=this._viewDiv=this._scrollDiv=this._rootDiv=this._clipboardDiv=this._selDiv3=this._selDiv2=this._selDiv1=null}},_doAutoScroll:function(a,c,b){this._autoScrollDir=a;this._autoScrollX=c;this._autoScrollY=b;this._autoScrollTimerID||this._autoScrollTimer()},_endAutoScroll:function(){this._autoScrollTimerID&&this._getWindow().clearTimeout(this._autoScrollTimerID);this._autoScrollTimerID=this._autoScrollDir=void 0},_fixCaret:function(){var a=this._clientDiv;
if(a){var c=this._hasFocus;this._ignoreFocus=!0;c&&a.blur();a.contentEditable=!1;a.contentEditable=!0;c&&a.focus();this._ignoreFocus=!1}},_getBaseText:function(a,c){var b=this._model;b.getBaseModel&&(a=b.mapOffset(a),c=b.mapOffset(c),b=b.getBaseModel());return b.getText(a,c)},_getBottomIndex:function(a){var c=this._bottomChild;if(a&&this._getClientHeight()>this._getLineHeight()){var a=c.getBoundingClientRect(),b=this._clientDiv.getBoundingClientRect();a.bottom>b.bottom&&(c=this._getLinePrevious(c)||
c)}return c.lineIndex},_getBoundsAtOffset:function(a){var c=this._getLine(this._model.getLineAtOffset(a)),a=c.getBoundingClientRect(a),b=this._getLinePixel(c.lineIndex);a.top+=b;a.bottom+=b;c.destroy();return a},_getClientHeight:function(){var a=this._getViewPadding();return Math.max(0,this._viewDiv.clientHeight-a.top-a.bottom)},_getClientWidth:function(){var a=this._getViewPadding();return Math.max(0,this._viewDiv.clientWidth-a.left-a.right)},_getClipboardText:function(a,d){var i=this._model.getLineDelimiter(),
e,f,g=this._getWindow();if(g.clipboardData)return e=[],f=g.clipboardData.getData("Text"),c(f,function(a){e.push(a)},function(){e.push(i)}),f=e.join(""),d&&d(f),f;if(b.isFirefox){this._ignoreFocus=!0;var h=this._clipboardDiv;h.innerHTML="<pre contenteditable=''></pre>";h.firstChild.focus();var l=this,n=function(){var a=l._getTextFromElement(h);h.innerHTML="";e=[];c(a,function(a){e.push(a)},function(){e.push(i)});return e.join("")},p=!1;this._ignorePaste=!0;if(!b.isLinux||this._lastMouseButton!==2)try{p=
h.ownerDocument.execCommand("paste",!1,null)}catch(w){p=h.childNodes.length>1||h.firstChild&&h.firstChild.childNodes.length>0}this._ignorePaste=!1;if(!p)return a?(g.setTimeout(function(){l.focus();(f=n())&&d&&d(f);l._ignoreFocus=!1},0),null):(this.focus(),this._ignoreFocus=!1,"");this.focus();this._ignoreFocus=!1;(f=n())&&d&&d(f);return f}return a&&a.clipboardData?(e=[],f=a.clipboardData.getData("text/plain"),c(f,function(a){e.push(a)},function(){e.push(i)}),(f=e.join(""))&&d&&d(f),f):""},_getDOMText:function(a,
c){for(var b=a.firstChild,d="",i=0;b;){var e;if(b.ignoreChars){e=b.lastChild;for(var f=0,g=[],h=-1;e;){for(var l=e.data,n=l.length-1;n>=0;n--){var j=l.substring(n,n+1);f<b.ignoreChars&&(j===" "||j==="\u200c"||j==="\ufeff")?f++:g.push(j==="\u00a0"?"\t":j)}if(c===e)h=g.length;e=e.previousSibling}g=g.reverse().join("");h!==-1&&(i=d.length+g.length-h);d+=g}else for(e=b.firstChild;e;){if(c===e)i=d.length;d+=e.data;e=e.nextSibling}b=b.nextSibling}return{text:d,offset:i}},_getTextFromElement:function(a){var c=
a.ownerDocument,b=c.defaultView;if(!b.getSelection)return a.innerText||a.textContent;c=c.createRange();c.selectNode(a);var a=b.getSelection(),b=[],d;for(d=0;d<a.rangeCount;d++)b.push(a.getRangeAt(d));this._ignoreSelect=!0;a.removeAllRanges();a.addRange(c);c=a.toString();a.removeAllRanges();for(d=0;d<b.length;d++)a.addRange(b[d]);this._ignoreSelect=!1;return c},_getViewPadding:function(){return this._metrics.viewPadding},_getLine:function(a){var c=this._getLineNode(a);return c&&!c.lineChanged&&!c.lineRemoved?
c._line:new q(this,a)},_getLineHeight:function(a,c){if(a!==void 0&&this._lineHeight){var b=this._lineHeight[a];if(b)return b;if(c||c===void 0)return this._lineHeight[a]=this._calculateLineHeight(a)}return this._metrics.lineHeight},_getLineNode:function(a){for(var c=this._clientDiv.firstChild;c;){if(a===c.lineIndex)return c;c=c.nextSibling}},_getLineNext:function(a){for(a=a?a.nextSibling:this._clientDiv.firstChild;a&&a.lineIndex===-1;)a=a.nextSibling;return a},_getLinePrevious:function(a){for(a=a?
a.previousSibling:this._clientDiv.lastChild;a&&a.lineIndex===-1;)a=a.previousSibling;return a},_getLinePixel:function(a){a=Math.min(Math.max(0,a),this._model.getLineCount());if(this._lineHeight){var c=this._getTopIndex(),b=-this._topIndexY+this._getScroll().y;if(a>c)for(;c<a;c++)b+=this._getLineHeight(c);else for(c-=1;c>=a;c--)b-=this._getLineHeight(c);return b}return this._getLineHeight()*a},_getLineIndex:function(a){var c,b=0,d=this._model.getLineCount();if(this._lineHeight){var b=this._getTopIndex(),
i=-this._topIndexY+this._getScroll().y;if(a!==i)if(a<i)for(;a<i&&b>0;)a+=this._getLineHeight(--b);else for(c=this._getLineHeight(b);a-c>=i&&b<d-1;)a-=c,c=this._getLineHeight(++b)}else c=this._getLineHeight(),b=Math.floor(a/c);return Math.max(0,Math.min(d-1,b))},_getScroll:function(){var a=this._viewDiv;return{x:a.scrollLeft,y:a.scrollTop}},_getSelection:function(){return this._selection.clone()},_getTopIndex:function(a){var c=this._topChild;if(a&&this._getClientHeight()>this._getLineHeight()){var a=
c.getBoundingClientRect(),b=this._getViewPadding(),d=this._viewDiv.getBoundingClientRect();a.top<d.top+b.top&&(c=this._getLineNext(c)||c)}return c.lineIndex},_hookEvents:function(){var a=this;this._modelListener={onChanging:function(c){a._onModelChanging(c)},onChanged:function(c){a._onModelChanged(c)}};this._model.addEventListener("preChanging",this._modelListener.onChanging);this._model.addEventListener("postChanged",this._modelListener.onChanged);var c=this._handlers=[],d=this._clientDiv,i=this._viewDiv,
e=this._rootDiv,f=this._overlayDiv||d,g=d.ownerDocument,l=this._getWindow(),n=b.isIE?g:l;c.push({target:l,type:"resize",handler:function(c){return a._handleResize(c?c:l.event)}});c.push({target:d,type:"blur",handler:function(c){return a._handleBlur(c?c:l.event)}});c.push({target:d,type:"focus",handler:function(c){return a._handleFocus(c?c:l.event)}});c.push({target:i,type:"focus",handler:function(){d.focus()}});c.push({target:i,type:"scroll",handler:function(c){return a._handleScroll(c?c:l.event)}});
c.push({target:d,type:"textInput",handler:function(c){return a._handleTextInput(c?c:l.event)}});c.push({target:d,type:"keydown",handler:function(c){return a._handleKeyDown(c?c:l.event)}});c.push({target:d,type:"keypress",handler:function(c){return a._handleKeyPress(c?c:l.event)}});c.push({target:d,type:"keyup",handler:function(c){return a._handleKeyUp(c?c:l.event)}});c.push({target:d,type:"contextmenu",handler:function(c){return a._handleContextMenu(c?c:l.event)}});c.push({target:d,type:"copy",handler:function(c){return a._handleCopy(c?
c:l.event)}});c.push({target:d,type:"cut",handler:function(c){return a._handleCut(c?c:l.event)}});c.push({target:d,type:"paste",handler:function(c){return a._handlePaste(c?c:l.event)}});if(b.isIOS||b.isAndroid)c.push({target:g,type:"selectionchange",handler:function(c){return a._handleSelectionChange(c?c:l.event)}}),c.push({target:d,type:"touchstart",handler:function(c){return a._handleTouchStart(c?c:l.event)}}),c.push({target:d,type:"touchmove",handler:function(c){return a._handleTouchMove(c?c:l.event)}}),
c.push({target:d,type:"touchend",handler:function(c){return a._handleTouchEnd(c?c:l.event)}});else{c.push({target:d,type:"selectstart",handler:function(c){return a._handleSelectStart(c?c:l.event)}});c.push({target:d,type:"mousedown",handler:function(c){return a._handleMouseDown(c?c:l.event)}});c.push({target:d,type:"mouseover",handler:function(c){return a._handleMouseOver(c?c:l.event)}});c.push({target:d,type:"mouseout",handler:function(c){return a._handleMouseOut(c?c:l.event)}});c.push({target:n,
type:"mouseup",handler:function(c){return a._handleMouseUp(c?c:l.event)}});c.push({target:n,type:"mousemove",handler:function(c){return a._handleMouseMove(c?c:l.event)}});c.push({target:e,type:"mousedown",handler:function(c){return a._handleRootMouseDown(c?c:l.event)}});c.push({target:e,type:"mouseup",handler:function(c){return a._handleRootMouseUp(c?c:l.event)}});c.push({target:f,type:"dragstart",handler:function(c){return a._handleDragStart(c?c:l.event)}});c.push({target:f,type:"drag",handler:function(c){return a._handleDrag(c?
c:l.event)}});c.push({target:f,type:"dragend",handler:function(c){return a._handleDragEnd(c?c:l.event)}});c.push({target:f,type:"dragenter",handler:function(c){return a._handleDragEnter(c?c:l.event)}});c.push({target:f,type:"dragover",handler:function(c){return a._handleDragOver(c?c:l.event)}});c.push({target:f,type:"dragleave",handler:function(c){return a._handleDragLeave(c?c:l.event)}});c.push({target:f,type:"drop",handler:function(c){return a._handleDrop(c?c:l.event)}});c.push({target:this._clientDiv,
type:b.isFirefox?"DOMMouseScroll":"mousewheel",handler:function(c){return a._handleMouseWheel(c?c:l.event)}});if(b.isFirefox&&(!b.isWindows||b.isFirefox>=15))(i=l.MutationObserver||l.MozMutationObserver)?(this._mutationObserver=new i(function(c){a._handleDataModified(c)}),this._mutationObserver.observe(d,{subtree:!0,characterData:!0})):c.push({target:this._clientDiv,type:"DOMCharacterDataModified",handler:function(c){return a._handleDataModified(c?c:l.event)}});this._overlayDiv&&(c.push({target:this._overlayDiv,
type:"mousedown",handler:function(c){return a._handleMouseDown(c?c:l.event)}}),c.push({target:this._overlayDiv,type:"mouseover",handler:function(c){return a._handleMouseOver(c?c:l.event)}}),c.push({target:this._overlayDiv,type:"mouseout",handler:function(c){return a._handleMouseOut(c?c:l.event)}}),c.push({target:this._overlayDiv,type:"contextmenu",handler:function(c){return a._handleContextMenu(c?c:l.event)}}));this._isW3CEvents||c.push({target:this._clientDiv,type:"dblclick",handler:function(c){return a._handleDblclick(c?
c:l.event)}})}i=this._leftDiv;e=this._rightDiv;b.isIE&&c.push({target:i,type:"selectstart",handler:function(){return!1}});c.push({target:i,type:b.isFirefox?"DOMMouseScroll":"mousewheel",handler:function(c){return a._handleMouseWheel(c?c:l.event)}});c.push({target:i,type:"click",handler:function(c){a._handleRulerEvent(c?c:l.event)}});c.push({target:i,type:"dblclick",handler:function(c){a._handleRulerEvent(c?c:l.event)}});c.push({target:i,type:"mousemove",handler:function(c){a._handleRulerEvent(c?c:
l.event)}});c.push({target:i,type:"mouseover",handler:function(c){a._handleRulerEvent(c?c:l.event)}});c.push({target:i,type:"mouseout",handler:function(c){a._handleRulerEvent(c?c:l.event)}});b.isIE&&c.push({target:e,type:"selectstart",handler:function(){return!1}});c.push({target:e,type:b.isFirefox?"DOMMouseScroll":"mousewheel",handler:function(c){return a._handleMouseWheel(c?c:l.event)}});c.push({target:e,type:"click",handler:function(c){a._handleRulerEvent(c?c:l.event)}});c.push({target:e,type:"dblclick",
handler:function(c){a._handleRulerEvent(c?c:l.event)}});c.push({target:e,type:"mousemove",handler:function(c){a._handleRulerEvent(c?c:l.event)}});c.push({target:e,type:"mouseover",handler:function(c){a._handleRulerEvent(c?c:l.event)}});c.push({target:e,type:"mouseout",handler:function(c){a._handleRulerEvent(c?c:l.event)}});for(i=0;i<c.length;i++)e=c[i],h(e.target,e.type,e.handler,e.capture)},_getWindow:function(){return this._parent.ownerDocument.defaultView||this._parent.ownerDocument.parentWindow},
_init:function(a){var c=a.parent;typeof c==="string"&&(c=(a.document||document).getElementById(c));if(!c)throw"no parent";a.parent=c;a.model=a.model||new g.TextModel;var d=this._defaultOptions(),i;for(i in d)d.hasOwnProperty(i)&&(this["_"+i]=a[i]!==void 0?a[i]:d[i].value);this._rulers=[];this._selection=new l(0,0,!1);this._linksVisible=!1;this._maxLineWidth=this._redrawCount=0;this._maxLineIndex=-1;this._ignoreSelect=!0;this._hasFocus=this._ignoreFocus=!1;this._dragOffset=this._columnX=-1;this._isRangeRects=
(!b.isIE||b.isIE>=9)&&typeof c.ownerDocument.createRange().getBoundingClientRect==="function";this._isW3CEvents=c.addEventListener;this._autoScrollTimerID=this._autoScrollY=this._autoScrollX=null;this._AUTO_SCROLL_RATE=50;this._mouseUpClosure=this._moseMoveClosure=this._grabControl=null;this._clickCount=this._lastMouseTime=this._lastMouseY=this._lastMouseX=0;this._clickTime=250;this._clickDist=5;this._isMouseDown=!1;this._doubleClickSelection=null;this._vScroll=this._hScroll=0;this._imeOffset=-1;
this._createActions();this._createView()},_isOverOverlayScroll:function(){if(!b.isMac)return{};var a=this._viewDiv.getBoundingClientRect(),c=this._lastMouseMoveX,d=this._lastMouseMoveY;return{vertical:a.top<=d&&d<a.bottom&&a.right-15<=c&&c<a.right,horizontal:a.bottom-15<=d&&d<a.bottom&&a.left<=c&&c<a.right}},_modifyContent:function(a,c){if(!this._readonly||a._code)if(a.type="Verify",this.onVerify(a),!(a.text===null||a.text===void 0)){var b=this._model;try{if(a._ignoreDOMSelection)this._ignoreDOMSelection=
!0;b.setText(a.text,a.start,a.end)}finally{if(a._ignoreDOMSelection)this._ignoreDOMSelection=!1}c&&(b=this._getSelection(),b.setCaret(a.start+a.text.length),this._setSelection(b,!0));this.onModify({type:"Modify"})}},_onModelChanged:function(a){a.type="ModelChanged";this.onModelChanged(a);a.type="Changed";var c=a.start,b=a.addedCharCount,d=a.removedCharCount,i=a.addedLineCount,e=a.removedLineCount,f=this._getSelection();f.end>c&&(f.end>c&&f.start<c+d?f.setCaret(c+b):(f.start+=b-d,f.end+=b-d),this._setSelection(f,
!1,!1));c=this._model.getLineAtOffset(c);for(b=this._getLineNext();b;){d=b.lineIndex;if(c<=d&&d<=c+e)c===d&&!b.modelChangedEvent&&!b.lineRemoved?(b.modelChangedEvent=a,b.lineChanged=!0):(b.lineRemoved=!0,b.lineChanged=!1,b.modelChangedEvent=null);if(d>c+e)b.lineIndex=d+i-e,b._line.lineIndex=b.lineIndex;b=this._getLineNext(b)}if(!this._wrapMode&&c<=this._maxLineIndex&&this._maxLineIndex<=c+e)this._checkMaxLineIndex=this._maxLineIndex,this._maxLineIndex=-1,this._maxLineWidth=0;this._update()},_onModelChanging:function(a){a.type=
"ModelChanging";this.onModelChanging(a);a.type="Changing"},_queueUpdate:function(){if(!this._updateTimer&&!this._ignoreQueueUpdate){var a=this;this._updateTimer=this._getWindow().setTimeout(function(){a._updateTimer=null;a._update()},0)}},_resetLineHeight:function(a,c){if(this._wrapMode){if(a!==void 0&&c!==void 0)for(var b=a;b<c;b++)this._lineHeight[b]=void 0;else this._lineHeight=Array(this._model.getLineCount());this._calculateLineHeightTimer()}else this._lineHeight=null},_resetLineWidth:function(){var a=
this._clientDiv;if(a)for(a=a.firstChild;a;)a.lineWidth=void 0,a=a.nextSibling},_reset:function(){this._maxLineIndex=-1;this._maxLineWidth=0;this._columnX=-1;this._bottomChild=this._topChild=null;this._topIndexY=0;this._resetLineHeight();this._setSelection(new l(0,0,!1),!1,!1);if(this._viewDiv)this._viewDiv.scrollLeft=0,this._viewDiv.scrollTop=0;var a=this._clientDiv;if(a){for(var c=a.firstChild;c;)c.lineRemoved=!0,c=c.nextSibling;if(b.isFirefox)this._ignoreFocus=!1,(c=this._hasFocus)&&a.blur(),a.contentEditable=
!1,a.contentEditable=!0,c&&a.focus(),this._ignoreFocus=!1}},_scrollView:function(a,c){this._ensureCaretVisible=!1;var b=this._viewDiv;a&&(b.scrollLeft+=a);c&&(b.scrollTop+=c)},_setClipboardText:function(a,d){var i,e=this._parent.ownerDocument,f=this._getWindow();if(f.clipboardData)return i=[],c(a,function(a){i.push(a)},function(){i.push(b.platformDelimiter)}),f.clipboardData.setData("Text",i.join(""));if(d&&d.clipboardData&&(i=[],c(a,function(a){i.push(a)},function(){i.push(b.platformDelimiter)}),
d.clipboardData.setData("text/plain",i.join(""))))return!0;var g=b.createElement(e,"pre");g.style.position="fixed";g.style.left="-1000px";c(a,function(a){g.appendChild(e.createTextNode(a))},function(){g.appendChild(b.createElement(e,"br"))});g.appendChild(e.createTextNode(" "));this._clientDiv.appendChild(g);var h=e.createRange();h.setStart(g.firstChild,0);h.setEndBefore(g.lastChild);var l=f.getSelection();l.rangeCount>0&&l.removeAllRanges();l.addRange(h);var n=this,h=function(){g&&g.parentNode===
n._clientDiv&&n._clientDiv.removeChild(g);n._updateDOMSelection()},l=!1;this._ignoreCopy=!0;try{l=e.execCommand("copy",!1,null)}catch(p){}this._ignoreCopy=!1;if(!l&&d)return f.setTimeout(h,0),!1;h();return!0},_setDOMSelection:function(a,c,d,i){for(var e,f,g,h,l=0,n=a.firstChild,w,j,q=this._model.getLine(a.lineIndex).length;n;){w=n.firstChild;j=w.length;n.ignoreChars&&(j-=n.ignoreChars);if(l+j>c||l+j>=q){e=w;f=c-l;n.ignoreChars&&j>0&&f===j&&(f+=n.ignoreChars);break}l+=j;n=n.nextSibling}for(var l=0,
n=d.firstChild,k=this._model.getLine(d.lineIndex).length;n;){w=n.firstChild;j=w.length;n.ignoreChars&&(j-=n.ignoreChars);if(j+l>i||l+j>=k){g=w;h=i-l;n.ignoreChars&&j>0&&h===j&&(h+=n.ignoreChars);break}l+=j;n=n.nextSibling}this._setDOMFullSelection(a,c,q,d,i,k);if(this._hasFocus)if(c=this._getWindow(),a=this._parent.ownerDocument,c.getSelection){if(c=c.getSelection(),!(c.anchorNode===e&&c.anchorOffset===f&&c.focusNode===g&&c.focusOffset===h||c.anchorNode===g&&c.anchorOffset===h&&c.focusNode===e&&c.focusOffset===
f))a=a.createRange(),a.setStart(e,f),a.setEnd(g,h),this._ignoreSelect=!1,c.rangeCount>0&&c.removeAllRanges(),c.addRange(a),this._ignoreSelect=!0}else if(a.selection)c=a.body,a=b.createElement(a,"div"),c.appendChild(a),c.removeChild(a),a=c.createTextRange(),a.moveToElementText(e.parentNode),a.moveStart("character",f),e=c.createTextRange(),e.moveToElementText(g.parentNode),e.moveStart("character",h),a.setEndPoint("EndToStart",e),this._ignoreSelect=!1,a.select(),this._ignoreSelect=!0},_setDOMFullSelection:function(a,
c,b,d,i){if(this._selDiv1&&(b=this._selDiv1,b.style.width="0px",b.style.height="0px",b=this._selDiv2,b.style.width="0px",b.style.height="0px",b=this._selDiv3,b.style.width="0px",b.style.height="0px",!(a===d&&c===i))){var e=this._model,f=this._getViewPadding(),g=this._clientDiv.getBoundingClientRect(),h=this._viewDiv.getBoundingClientRect(),b=h.left+f.left,l=g.right,f=h.top+f.top,n=g.bottom,h=g=0;this._clipDiv?(h=this._clipDiv.getBoundingClientRect(),g=h.left-this._clipDiv.scrollLeft):(h=this._rootDiv.getBoundingClientRect(),
g=h.left);h=h.top;this._ignoreDOMSelection=!0;var a=(new q(this,a.lineIndex,a)).getBoundingClientRect(e.getLineStart(a.lineIndex)+c,!1),j=a.left,i=(new q(this,d.lineIndex,d)).getBoundingClientRect(e.getLineStart(d.lineIndex)+i,!1),c=i.left;this._ignoreDOMSelection=!1;var e=this._selDiv1,j=Math.min(l,Math.max(b,j)),D=Math.min(n,Math.max(f,a.top)),k=l,d=Math.min(n,Math.max(f,a.bottom));e.style.left=j-g+"px";e.style.top=D-h+"px";e.style.width=Math.max(0,k-j)+"px";e.style.height=Math.max(0,d-D)+"px";
if(a.top===i.top)k=Math.min(c,l),e.style.width=Math.max(0,k-j)+"px";else if(a=Math.min(n,Math.max(f,i.top)),c=Math.min(l,Math.max(b,c)),f=Math.min(n,Math.max(f,i.bottom)),n=this._selDiv3,n.style.left=b-g+"px",n.style.top=a-h+"px",n.style.width=Math.max(0,c-b)+"px",n.style.height=Math.max(0,f-a)+"px",a-d>0)f=this._selDiv2,f.style.left=b-g+"px",f.style.top=d-h+"px",f.style.width=Math.max(0,l-b)+"px",f.style.height=Math.max(0,a-d)+"px"}},_setGrab:function(a){if(a!==this._grabControl)a?(a.setCapture&&
a.setCapture(),this._grabControl=a):(this._grabControl.releaseCapture&&this._grabControl.releaseCapture(),this._grabControl=null)},_setLinksVisible:function(a){if(this._linksVisible!==a){this._linksVisible=a;if(b.isIE&&a)this._hadFocus=this._hasFocus;var c=this._clientDiv;c.contentEditable=!a;this._hadFocus&&!a&&c.focus();if(this._overlayDiv)this._overlayDiv.style.zIndex=a?"-1":"1";for(a=this._getLineNext();a;){if(a.hasLink)for(c=a.firstChild;c;){var d=c.nextSibling,i=c.viewStyle;i&&i.tagName==="A"&&
a.replaceChild(a._line._createSpan(a,c.firstChild.data,i),c);c=d}a=this._getLineNext(a)}}},_setSelection:function(a,c,b,d){if(a){this._columnX=-1;b===void 0&&(b=!0);var i=this._selection;this._selection=a;c&&this._showCaret(!1,d);b&&this._updateDOMSelection();if(!i.equals(a))this.onSelection({type:"Selection",oldValue:{start:i.start,end:i.end},newValue:{start:a.start,end:a.end}})}},_setSelectionTo:function(a,c,b,d){var i=this._model,e=this._getSelection(),c=this.convert({x:a,y:c},"page","document"),
a=this._getLineIndex(c.y);if(this._clickCount===1){i=this._getLine(a);a=i.getOffset(c.x,c.y-this._getLinePixel(a));i.destroy();if(d&&!b&&e.start<=a&&a<e.end)return this._dragOffset=a,!1;e.extend(a);b||e.collapse()}else(this._clickCount&1)===0?(i=this._getLine(a),a=i.getOffset(c.x,c.y-this._getLinePixel(a)),this._doubleClickSelection?a>=this._doubleClickSelection.start?(b=this._doubleClickSelection.start,d=i.getNextOffset(a,"wordend",1)):(b=i.getNextOffset(a,"word",-1),d=this._doubleClickSelection.end):
(b=i.getNextOffset(a,"word",-1),d=i.getNextOffset(b,"wordend",1)),i.destroy()):this._doubleClickSelection?(d=i.getLineAtOffset(this._doubleClickSelection.start),a>=d?(b=i.getLineStart(d),d=i.getLineEnd(a)):(b=i.getLineStart(a),d=i.getLineEnd(d))):(b=i.getLineStart(a),d=i.getLineEnd(a)),e.setCaret(b),e.extend(d);this._setSelection(e,!0,!0);return!0},_setFullSelection:function(a,c){this._fullSelection=a;if(b.isWebkit)this._fullSelection=!0;var d=this._clipDiv||this._rootDiv;if(d)if(this._fullSelection){if(!this._selDiv1&&
this._fullSelection&&!b.isIOS){var i=d.ownerDocument;this._highlightRGB=b.isWebkit?"transparent":"Highlight";var e=b.createElement(i,"div");this._selDiv1=e;e.style.position="absolute";e.style.borderWidth="0px";e.style.margin="0px";e.style.padding="0px";e.style.outline="none";e.style.background=this._highlightRGB;e.style.width="0px";e.style.height="0px";e.style.zIndex="0";d.appendChild(e);var f=b.createElement(i,"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=i=b.createElement(i,"div");i.style.position="absolute";i.style.borderWidth="0px";i.style.margin="0px";i.style.padding="0px";i.style.outline="none";i.style.background=this._highlightRGB;i.style.width="0px";i.style.height="0px";i.style.zIndex="0";d.appendChild(i);if(b.isFirefox&&b.isMac){d=this._getWindow().getComputedStyle(i,
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;e.style.background=
d;f.style.background=d;i.style.background=d}c||this._updateDOMSelection()}}else{if(this._selDiv1)d.removeChild(this._selDiv1),this._selDiv1=null;if(this._selDiv2)d.removeChild(this._selDiv2),this._selDiv2=null;if(this._selDiv3)d.removeChild(this._selDiv3),this._selDiv3=null}},_setReadOnly:function(a){this._readonly=a;this._clientDiv.setAttribute("aria-readonly",a?"true":"false")},_setTabSize:function(a,c){this._tabSize=a;this._customTabSize=void 0;var d=this._clientDiv;if(b.isOpera){if(d)d.style.OTabSize=
this._tabSize+""}else if(b.isWebkit>=537.1){if(d)d.style.tabSize=this._tabSize+""}else if(b.isFirefox>=4){if(d)d.style.MozTabSize=this._tabSize+""}else if(this._tabSize!==8)this._customTabSize=this._tabSize;c||(this.redrawLines(),this._resetLineWidth())},_setThemeClass:function(a,c){this._themeClass=a;var b="textviewContainer";this._themeClass&&(b+=" "+this._themeClass);this._rootDiv.className=b;this._updateStyle(c)},_setWrapMode:function(a,c){this._wrapMode=a;var b=this._clientDiv,d=this._viewDiv;
a?(b.style.whiteSpace="pre-wrap",b.style.wordWrap="break-word",d.style.overflowX="hidden",d.style.overflowY="scroll"):(b.style.whiteSpace="pre",b.style.wordWrap="normal",d.style.overflowX="auto",d.style.overflowY="auto");c||(this.redraw(),this._resetLineWidth());this._resetLineHeight()},_showCaret:function(a,c){if(this._clientDiv){var b=this._model,d=this._getSelection(),i=this._getScroll(),e=d.getCaret(),f=d.start,g=d.end,h=b.getLineAtOffset(g),l=Math.max(Math.max(f,b.getLineStart(h)),g-1),b=this._getClientWidth(),
h=this._getClientHeight(),n=b/4,j=this._getBoundsAtOffset(e===f?f:l),q=j.left,k=j.right,t=j.top,E=j.bottom;a&&!d.isEmpty()&&(j=this._getBoundsAtOffset(e===g?f:l),j.top===t?e===f?k=q+Math.min(j.right-q,b):q=k-Math.min(k-j.left,b):e===f?E=t+Math.min(j.bottom-t,h):t=E-Math.min(E-j.top,h));d=0;q<i.x&&(d=Math.min(q-i.x,-n));k>i.x+b&&(d=Math.max(k-i.x-b,n));e=0;t<i.y?e=t-i.y:E>i.y+h&&(e=E-i.y-h);c&&(c>0?e>0&&(e=Math.max(e,c)):e<0&&(e=Math.min(e,c)));return d!==0||e!==0?(this._scrollView(d,e),h!==this._getClientHeight()||
b!==this._getClientWidth()?this._showCaret():this._ensureCaretVisible=!0,!0):!1}},_startIME:function(){if(this._imeOffset===-1){var a=this._getSelection();a.isEmpty()||this._modifyContent({text:"",start:a.start,end:a.end},!0);this._imeOffset=a.start}},_unhookEvents:function(){this._model.removeEventListener("preChanging",this._modelListener.onChanging);this._model.removeEventListener("postChanged",this._modelListener.onChanged);this._modelListener=null;for(var a=0;a<this._handlers.length;a++){var c=
this._handlers[a],b=c.target,d=c.type,c=c.handler;typeof b.removeEventListener==="function"?b.removeEventListener(d,c,!1):b.detachEvent("on"+d,c)}this._handlers=null;if(this._mutationObserver)this._mutationObserver.disconnect(),this._mutationObserver=null},_updateDOMSelection:function(){if(!this._ignoreDOMSelection&&this._clientDiv){var a=this._getSelection(),c=this._model,b=c.getLineAtOffset(a.start),d=c.getLineAtOffset(a.end),i=this._getLineNext();if(i){var e=this._getLinePrevious(),f;b<i.lineIndex?
(f=i,b=0):b>e.lineIndex?(f=e,b=0):(f=this._getLineNode(b),b=a.start-c.getLineStart(b));d<i.lineIndex?a=0:d>e.lineIndex?(i=e,a=0):(i=this._getLineNode(d),a=a.end-c.getLineStart(d));this._setDOMSelection(f,b,i,a)}}},_update:function(a){if(!(this._redrawCount>0)){if(this._updateTimer)this._getWindow().clearTimeout(this._updateTimer),this._updateTimer=null,a=!1;var c=this._clientDiv;if(c){if(this._metrics.invalid)this._ignoreQueueUpdate=!0,this._updateStyle(),this._ignoreQueueUpdate=!1;var d=this._model,
i=this._getScroll(),e=this._getViewPadding(),f=d.getLineCount(),g=this._getLineHeight(),h=this._getClientWidth();if(this._wrapMode)c.style.width=h+"px";var l,n,j,B,k=0,z=0;if(this._lineHeight){for(;z<f;){j=this._getLineHeight(z);if(k+j>i.y)break;k+=j;z++}l=z;n=Math.max(0,l-1);j=d=i.y-k;l>0&&(d+=this._getLineHeight(l-1))}else B=Math.max(0,i.y)/g,l=Math.floor(B),n=Math.max(0,l-1),d=Math.round((B-n)*g),j=Math.round((B-l)*g);this._topIndexY=j;B=this._parent;var t=B.clientWidth,E=B.clientHeight;B=this._getClientHeight();
if(a){n=0;this._leftDiv&&(l=this._leftDiv.getBoundingClientRect(),n=l.right-l.left);l=h;for(this._wrapMode||(l=Math.max(this._maxLineWidth,l));z<f;)j=this._getLineHeight(z,!1),k+=j,z++;f=k}else{for(var h=this._viewDiv,i=Math.min(l+Math.floor((B+j)/g),f-1),F=Math.min(i+1,f-1),g=c.firstChild;g;){j=g.lineIndex;var G=g.nextSibling;if(!(n<=j&&j<=F)||g.lineRemoved||g.lineIndex===-1)this._mouseWheelLine===g?(g.style.display="none",g.lineIndex=-1):c.removeChild(g);g=G}var g=this._getLineNext(),G=h.ownerDocument,
C=G.createDocumentFragment();for(j=n;j<=F;j++)if(!g||g.lineIndex>j)(new q(this,j)).create(C,null);else{C.firstChild&&(c.insertBefore(C,g),C=G.createDocumentFragment());if(g&&g.lineChanged)g=(new q(this,j)).create(C,g),g.lineChanged=!1;g=this._getLineNext(g)}C.firstChild&&c.insertBefore(C,g);if(b.isWebkit&&!this._wrapMode)c.style.width="0x7fffffffpx";g=this._getLineNext();j=B+d;for(G=!1;g;){n=g.lineWidth;if(n===void 0)F=g._line.getBoundingClientRect(),n=g.lineWidth=Math.ceil(F.right-F.left),this._lineHeight&&
(this._lineHeight[g.lineIndex]=Math.ceil(F.bottom-F.top));if(this._lineHeight&&!G&&(j-=this._lineHeight[g.lineIndex],j<0))i=g.lineIndex,G=!0;if(!this._wrapMode){if(n>=this._maxLineWidth)this._maxLineWidth=n,this._maxLineIndex=g.lineIndex;if(this._checkMaxLineIndex===g.lineIndex)this._checkMaxLineIndex=-1}if(g.lineIndex===l)this._topChild=g;if(g.lineIndex===i)this._bottomChild=g;g=this._getLineNext(g)}if(this._checkMaxLineIndex!==-1&&(j=this._checkMaxLineIndex,this._checkMaxLineIndex=-1,0<=j&&j<f)){g=
new q(this,j);F=g.getBoundingClientRect();n=F.right-F.left;if(n>=this._maxLineWidth)this._maxLineWidth=n,this._maxLineIndex=j;g.destroy()}for(;z<f;)j=this._getLineHeight(z,z<=i),k+=j,z++;f=k;this._updateRuler(this._leftDiv,l,i);this._updateRuler(this._rightDiv,l,i);n=0;this._leftDiv&&(l=this._leftDiv.getBoundingClientRect(),n=l.right-l.left);i=0;this._rightDiv&&(i=this._rightDiv.getBoundingClientRect(),i=i.right-i.left);h.style.left=n+"px";h.style.right=i+"px";i=this._scrollDiv;i.style.height=f+"px";
k=h=this._getClientWidth();this._wrapMode||(k=Math.max(this._maxLineWidth,k));l=k;if((!b.isIE||b.isIE>=9)&&this._maxLineWidth>h)k+=e.right+e.left;i.style.width=k+"px";if(this._clipScrollDiv)this._clipScrollDiv.style.width=k+"px";i=this._getScroll();k=B+e.top+e.bottom;this._updateRulerSize(this._leftDiv,k);this._updateRulerSize(this._rightDiv,k)}if(this._vScrollDiv)k=B-8,z=Math.max(15,Math.ceil(Math.min(1,k/(f+e.top+e.bottom))*k)),this._vScrollDiv.style.left=n+h-8+"px",this._vScrollDiv.style.top=Math.floor(Math.max(0,
i.y*k/f))+"px",this._vScrollDiv.style.height=z+"px";if(!this._wrapMode&&this._hScrollDiv)k=h-8,z=Math.max(15,Math.ceil(Math.min(1,k/(this._maxLineWidth+e.left+e.right))*k)),this._hScrollDiv.style.left=n+Math.floor(Math.max(0,Math.floor(i.x*k/this._maxLineWidth)))+"px",this._hScrollDiv.style.top=B-9+"px",this._hScrollDiv.style.width=z+"px";F=i.x;j=this._clipDiv;k=this._overlayDiv;if(j){j.scrollLeft=F;z=n+e.left;g=e.top;a=h;n=B;F=0;G=-d;if(i.x===0)z-=e.left,a+=e.left,F=e.left;i.x+h===l&&(a+=e.right);
i.y===0&&(g-=e.top,n+=e.top,G+=e.top);i.y+B===f&&(n+=e.bottom);j.style.left=z+"px";j.style.top=g+"px";e=this._isOverOverlayScroll();j.style.right=t-a-z+(this._overlayScrollTimer&&e.vertical?15:0)+"px";j.style.bottom=E-n-g+(this._overlayScrollTimer&&e.horizontal?15:0)+"px";c.style.left=F+"px";c.style.top=G+"px";c.style.width=l+"px";c.style.height=B+d+"px";if(k)k.style.left=c.style.left,k.style.top=c.style.top,k.style.width=c.style.width,k.style.height=c.style.height}else{z=F;g=d;t=F+h;E=d+B;z===0&&
(z-=e.left);g===0&&(g-=e.top);t===l&&(t+=e.right);i.y+B===f&&(E+=e.bottom);c.style.clip="rect("+g+"px,"+t+"px,"+E+"px,"+z+"px)";c.style.left=-F+n+e.left+"px";c.style.width=(b.isWebkit?l:h+F)+"px";if(!a)c.style.top=-d+e.top+"px",c.style.height=B+d+"px";if(k&&(k.style.clip=c.style.clip,k.style.left=c.style.left,k.style.width=c.style.width,!a))k.style.top=c.style.top,k.style.height=c.style.height}this._updateDOMSelection();c=this._ensureCaretVisible;this._ensureCaretVisible=!1;B!==this._getClientHeight()&&
(this._update(),c&&this._showCaret())}}},_updateRulerSize:function(a,c){if(a){for(var b=this._topIndexY,d=this._getLineHeight(),i=a.firstChild.rows[0].cells,e=0;e<i.length;e++){var f=i[e].firstChild,g=d;f._ruler.getOverview()==="page"&&(g+=b);f.style.top=-g+"px";f.style.height=c+g+"px"}a.style.height=c+"px"}},_updateRuler:function(a,c,d){if(a)for(var a=a.firstChild.rows[0].cells,i=this._parent.ownerDocument,e=this._getLineHeight(),g=this._getViewPadding(),h=0;h<a.length;h++){var l=a[h].firstChild,
n=l._ruler;l.rulerChanged&&f(n.getRulerStyle(),l);var j,w=l.firstChild;w?(j=w,w=w.nextSibling):(j=b.createElement(i,"div"),j.style.visibility="hidden",l.appendChild(j));var q,k;if(l.rulerChanged&&j){q=-1;if(k=n.getWidestAnnotation())if(f(k.style,j),k.html)j.innerHTML=k.html;j.lineIndex=q;j.style.height=e+g.top+"px"}var z,t;if(n.getOverview()==="page"){for(n=n.getAnnotations(c,d+1);w;)q=w.lineIndex,k=w.nextSibling,(!(c<=q&&q<=d)||w.lineChanged)&&l.removeChild(w),w=k;w=l.firstChild.nextSibling;t=i.createDocumentFragment();
for(q=c;q<=d;q++)if(!w||w.lineIndex>q){z=b.createElement(i,"div");if(k=n[q]){f(k.style,z);if(k.html)z.innerHTML=k.html;z.annotation=k}z.lineIndex=q;z.style.height=this._getLineHeight(q)+"px";t.appendChild(z)}else if(t.firstChild&&(l.insertBefore(t,w),t=i.createDocumentFragment()),w)w=w.nextSibling;t.firstChild&&l.insertBefore(t,w)}else{k=this._getClientHeight();q=this._model.getLineCount();w=k+g.top+g.bottom-2*this._metrics.scrollWidth;j=e*q<w?e:w/q;if(l.rulerChanged){for(k=l.childNodes.length;k>
1;)l.removeChild(l.lastChild),k--;n=n.getAnnotations(0,q);t=i.createDocumentFragment();for(var E in n)if(q=E>>>0,!(q<0)){z=b.createElement(i,"div");k=n[E];f(k.style,z);z.style.position="absolute";z.style.top=this._metrics.scrollWidth+e+Math.floor(q*j)+"px";if(k.html)z.innerHTML=k.html;z.annotation=k;z.lineIndex=q;t.appendChild(z)}l.appendChild(t)}else if(l._oldTrackHeight!==w)for(z=l.firstChild?l.firstChild.nextSibling:null;z;)z.style.top=this._metrics.scrollWidth+e+Math.floor(z.lineIndex*j)+"px",
z=z.nextSibling;l._oldTrackHeight=w}l.rulerChanged=!1}},_updateStyle:function(a){if(!a&&b.isIE)this._rootDiv.style.lineHeight="normal";var c=this._metrics=this._calculateMetrics();this._rootDiv.style.lineHeight=b.isIE?c.lineHeight-(c.lineTrim.top+c.lineTrim.bottom)+"px":"normal";a||(this.redraw(),this._resetLineWidth())}};j.EventTarget.addMixin(t.prototype);return{TextView:t}});
define("orion/editor/tooltip",["i18n!orion/editor/nls/messages","orion/editor/textView","orion/editor/textModel","orion/editor/projectionTextModel","orion/editor/util"],function(g,k,j,b,h){function f(b){this._view=b;this._create(b.getOptions("parent").ownerDocument);b.addEventListener("Destroy",this,this.destroy)}f.getTooltip=function(b){if(!b._tooltip)b._tooltip=new f(b);return b._tooltip};f.prototype={_create:function(b){if(!this._tooltipDiv){var d=this._tooltipDiv=h.createElement(b,"div");d.className=
"textviewTooltip";d.setAttribute("aria-live","assertive");d.setAttribute("aria-atomic","true");var c=this._tooltipContents=h.createElement(b,"div");d.appendChild(c);b.body.appendChild(d);this.hide()}},_getWindow:function(){var b=this._tooltipDiv.ownerDocument;return b.defaultView||b.parentWindow},destroy:function(){if(this._tooltipDiv){this.hide();var b=this._tooltipDiv.parentNode;b&&b.removeChild(this._tooltipDiv);this._tooltipDiv=null}},hide:function(){if(this._contentsView)this._contentsView.destroy(),
this._contentsView=null;if(this._tooltipContents)this._tooltipContents.innerHTML="";if(this._tooltipDiv)this._tooltipDiv.style.visibility="hidden";var b=this._getWindow();if(this._showTimeout)b.clearTimeout(this._showTimeout),this._showTimeout=null;if(this._hideTimeout)b.clearTimeout(this._hideTimeout),this._hideTimeout=null;if(this._fadeTimeout)b.clearInterval(this._fadeTimeout),this._fadeTimeout=null},isVisible:function(){return this._tooltipDiv&&this._tooltipDiv.style.visibility==="visible"},setTarget:function(b,
d){if(this.target!==b&&(this._target=b,this.hide(),b)){var c=this;if(d===0)c.show(!0);else{var a=this._getWindow();c._showTimeout=a.setTimeout(function(){c.show(!0)},d?d:500)}}},show:function(e){if(this._target){var d=this._target.getTooltipInfo();if(d){var c=this._tooltipDiv,a=this._tooltipContents;c.style.left=c.style.right=c.style.width=c.style.height=a.style.width=a.style.height="auto";var i=d.contents;i instanceof Array&&(i=this._getAnnotationContents(i));if(typeof i==="string")a.innerHTML=i;
else if(this._isNode(i))a.appendChild(i);else if(i instanceof b.ProjectionTextModel){var f=this._view,g=f.getOptions();g.wrapMode=!1;g.parent=a;var h=g.themeClass;h?((h=h.replace("tooltip",""))&&(h=" "+h),h="tooltip"+h):h="tooltip";g.themeClass=h;g=this._contentsView=new k.TextView(g);g._clientDiv.contentEditable=!1;g.addEventListener("LineStyle",function(a){f.onLineStyle(a)});g.setModel(i);i=g.computeSize();a.style.width=i.width+20+"px";a.style.height=i.height+"px";g.resize()}else return;a=c.ownerDocument.documentElement;
d.anchor==="right"?(i=a.clientWidth-d.x,c.style.right=i+"px"):(i=parseInt(this._getNodeStyle(c,"padding-left","0"),10),i+=parseInt(this._getNodeStyle(c,"border-left-width","0"),10),i=d.x-i,c.style.left=i+"px");c.style.maxWidth=a.clientWidth-i-10+"px";i=parseInt(this._getNodeStyle(c,"padding-top","0"),10);i+=parseInt(this._getNodeStyle(c,"border-top-width","0"),10);i=d.y-i;c.style.top=i+"px";c.style.maxHeight=a.clientHeight-i-10+"px";c.style.opacity="1";c.style.visibility="visible";if(e){var j=this,
m=this._getWindow();j._hideTimeout=m.setTimeout(function(){var a=parseFloat(j._getNodeStyle(c,"opacity","1"));j._fadeTimeout=m.setInterval(function(){c.style.visibility==="visible"&&a>0?(a-=0.1,c.style.opacity=a):j.hide()},50)},5E3)}}}},_getAnnotationContents:function(e){function d(c){var b=c.title;if(b==="")return null;var d="<div>";c.html&&(d+=c.html+"&nbsp;");if(!b)b=c.end,c=a.getLineStart(a.getLineAtOffset(c.start)),b=a.getLineEnd(a.getLineAtOffset(b),!0),b=a.getText(c,b);b=b.replace(/</g,"&lt;").replace(/>/g,
"&gt;");d+="<span style='vertical-align:middle;'>"+b+"</span><div>";return d}if(e.length===0)return null;var c=this._view.getModel(),a=c.getBaseModel?c.getBaseModel():c;if(e.length===1)if(c=e[0],c.title!==void 0)return d(c);else{var e=new b.ProjectionTextModel(a),i=a.getLineStart(a.getLineAtOffset(c.start)),f=a.getCharCount();c.end!==f&&e.addProjection({start:c.end,end:f});i>0&&e.addProjection({start:0,end:i});return e}else{i="<div><em>"+g.multipleAnnotations+"</em></div>";for(f=0;f<e.length;f++)c=
e[f],(c=d(c))&&(i+=c);return i}},_getNodeStyle:function(b,d,c){var a;if(b&&(a=b.style[d],!a))if(b.currentStyle){for(a=0;(a=d.indexOf("-",a))!==-1;)d=d.substring(0,a)+d.substring(a+1,a+2).toUpperCase()+d.substring(a+2);a=b.currentStyle[d]}else a=(b=b.ownerDocument.defaultView.getComputedStyle(b,null))?b.getPropertyValue(d):null;return a||c},_isNode:function(b){return typeof Node==="object"?b instanceof Node:b&&typeof b==="object"&&typeof b.nodeType==="number"&&typeof b.nodeName==="string"}};return{Tooltip:f}});
define("orion/editor/editor","i18n!orion/editor/nls/messages,orion/editor/keyBinding,orion/editor/eventTarget,orion/editor/tooltip,orion/editor/annotations,orion/editor/util".split(","),function(g,k,j,b,h,f){function e(a){this._textViewFactory=a.textViewFactory;this._undoStackFactory=a.undoStackFactory;this._textDNDFactory=a.textDNDFactory;this._annotationFactory=a.annotationFactory;this._foldingRulerFactory=a.foldingRulerFactory;this._lineNumberRulerFactory=a.lineNumberRulerFactory;this._contentAssistFactory=
a.contentAssistFactory;this._keyBindingFactory=a.keyBindingFactory;this._statusReporter=a.statusReporter;this._domNode=a.domNode;this._foldingRuler=this._overviewRuler=this._lineNumberRuler=this._annotationRuler=this._annotationModel=this._annotationStyler=null;this._dirty=!1;this._title=this._contentAssist=null;this._keyModes=[]}function d(a){var c=this,b=Array.prototype.slice.call(arguments,1);return b.length?function(){return arguments.length?c.apply(a,b.concat(Array.prototype.slice.call(arguments))):
c.apply(a,b)}:function(){return arguments.length?c.apply(a,arguments):c.call(a)}}var c;e.prototype={destroy:function(){this.uninstallTextView();this._textViewFactory=this._undoStackFactory=this._textDNDFactory=this._annotationFactory=this._foldingRulerFactory=this._lineNumberRulerFactory=this._contentAssistFactory=this._keyBindingFactory=this._statusReporter=this._domNode=null},getAnnotationModel:function(){return this._annotationModel},getAnnotationRuler:function(){return this._annotationRuler},
getAnnotationStyler:function(){return this._annotationStyler},getFoldingRuler:function(){return this._foldingRuler},getLineNumberRuler:function(){return this._lineNumberRuler},getModel:function(){var a=this._textView.getModel();a.getBaseModel&&(a=a.getBaseModel());return a},getOverviewRuler:function(){return this._overviewRuler},getTextView:function(){return this._textView},getTitle:function(){return this._title},getKeyModes:function(){return this._keyModes},isDirty:function(){return this._dirty},
setAnnotationRulerVisible:function(a){if(this._annotationRulerVisible!==a&&(this._annotationRulerVisible=a,this._annotationRuler)){var c=this._textView;a?c.addRuler(this._annotationRuler,0):c.removeRuler(this._annotationRuler)}},setFoldingRulerVisible:function(a){if(this._foldingRulerVisible!==a&&(this._foldingRulerVisible=a,this._foldingRuler)){var c=this._textView;c.getModel().getBaseModel&&(a?c.addRuler(this._foldingRuler,100):c.removeRuler(this._foldingRuler))}},setDirty:function(a){if(this._dirty!==
a)this._dirty=a,this.onDirtyChanged({type:"DirtyChanged"})},setLineNumberRulerVisible:function(a){if(this._lineNumberRulerVisible!==a&&(this._lineNumberRulerVisible=a,this._lineNumberRuler)){var c=this._textView;a?c.addRuler(this._lineNumberRuler,1):c.removeRuler(this._lineNumberRuler)}},setOverviewRulerVisible:function(a){if(this._overviewRulerVisible!==a&&(this._overviewRulerVisible=a,this._overviewRuler)){var c=this._textView;a?c.addRuler(this._overviewRuler):c.removeRuler(this._overviewRuler)}},
mapOffset:function(a,c){var b=this._textView.getModel();b.getBaseModel&&(a=b.mapOffset(a,c));return a},getCaretOffset:function(){return this.mapOffset(this._textView.getCaretOffset())},getSelection:function(){var a=this._textView,c=a.getSelection(),a=a.getModel();if(a.getBaseModel)c.start=a.mapOffset(c.start),c.end=a.mapOffset(c.end);return c},getText:function(a,c){var b=this._textView.getModel();b.getBaseModel&&(b=b.getBaseModel());return b.getText(a,c)},_expandOffset:function(a){var c=this._textView.getModel(),
b=this._annotationModel;if(b&&c.getBaseModel)for(a=b.getAnnotations(a,a+1);a.hasNext();)c=a.next(),c.type===h.AnnotationType.ANNOTATION_FOLDING&&c.expand&&(c.expand(),b.modifyAnnotation(c))},setCaretOffset:function(a){var c=this._textView,b=c.getModel();b.getBaseModel&&(this._expandOffset(a),a=b.mapOffset(a,!0));c.setCaretOffset(a)},setText:function(a,c,b){var d=this._textView,e=d.getModel();e.getBaseModel&&(c!==void 0&&(this._expandOffset(c),c=e.mapOffset(c,!0)),b!==void 0&&(this._expandOffset(b),
b=e.mapOffset(b,!0)));d.setText(a,c,b)},setFoldingEnabled:function(a){this.setFoldingRulerVisible(a)},setSelection:function(a,c,b){var d=this._textView,e=d.getModel();e.getBaseModel&&(this._expandOffset(a),this._expandOffset(c),a=e.mapOffset(a,!0),c=e.mapOffset(c,!0));d.setSelection(a,c,b)},moveSelection:function(a,b,d,e){var f=this._textView;this.setSelection(a,b||a,!1);var b=f.getTopPixel(),g=f.getBottomPixel(),a=this.getModel().getLineAtOffset(a),a=f.getLinePixel(a);a<b||a>g?(g=Math.max(0,a-Math.floor((a<
b?3:1)*(g-b)/4)),(new c({node:f,duration:300,curve:[b,g],onAnimate:function(a){f.setTopPixel(Math.floor(a))},onEnd:function(){f.showSelection();(e===void 0||e)&&f.focus();d&&d()}})).play()):(f.showSelection(),(e===void 0||e)&&f.focus(),d&&d())},checkDirty:function(){this.setDirty(!this._undoStack.isClean())},reportStatus:function(a,c,b){this._statusReporter&&this._statusReporter(a,c,b)},_getTooltipInfo:function(a,c){var b=this._textView,d=this.getAnnotationModel();if(!d)return null;var e=this._annotationStyler;
if(!e)return null;var f=b.getOffsetAtLocation(a,c);if(f===-1)return null;f=this.mapOffset(f);e=e.getAnnotationsByType(d,f,f+1);d=[];for(f=0;f<e.length;f++)e[f].rangeStyle&&d.push(e[f]);if(d.length===0)return null;b=b.convert({x:a,y:c},"document","page");return{contents:d,anchor:"left",x:b.x+10,y:b.y+20}},_highlightCurrentLine:function(a,c){var b=this._annotationModel;if(b){var d=this._textView.getModel(),e=c?d.getLineAtOffset(c.start):-1,f=d.getLineAtOffset(a.start),g=a.start===a.end,j=!c||c.start===
c.end,o=d.getLineStart(f),k=d.getLineEnd(f);d.getBaseModel&&(o=d.mapOffset(o),k=d.mapOffset(k));d=this._currentLineAnnotation;if(!(e===f&&j&&g&&d&&d.start===o&&d.end===k)){var e=d?[d]:null,s;g&&(d=h.AnnotationType.createAnnotation(h.AnnotationType.ANNOTATION_CURRENT_LINE,o,k),s=[d]);this._currentLineAnnotation=d;b.replaceAnnotations(e,s)}}},installTextView:function(){this._textView=this._textViewFactory();if(this._undoStackFactory)this._undoStack=this._undoStackFactory.createUndoStack(this);if(this._textDNDFactory)this._textDND=
this._textDNDFactory.createTextDND(this,this._undoStack);if(this._contentAssistFactory){var a=this._contentAssistFactory.createContentAssistMode(this);this._keyModes.push(a);this._contentAssist=a.getContentAssist()}var c=this,d=this._textView,e=this;this._listener={onModelChanged:function(){e.checkDirty()},onMouseOver:function(a){e._listener.onMouseMove(a)},onMouseMove:function(a){var c=b.Tooltip.getTooltip(d);c&&c.setTarget({x:a.x,y:a.y,getTooltipInfo:function(){return e._getTooltipInfo(this.x,this.y)}})},
onMouseOut:function(){var a=b.Tooltip.getTooltip(d);a&&a.setTarget(null)},onSelection:function(a){e._updateCursorStatus();e._highlightCurrentLine(a.newValue,a.oldValue)}};d.addEventListener("ModelChanged",this._listener.onModelChanged);d.addEventListener("Selection",this._listener.onSelection);d.addEventListener("MouseOver",this._listener.onMouseOver);d.addEventListener("MouseOut",this._listener.onMouseOut);d.addEventListener("MouseMove",this._listener.onMouseMove);this._keyBindingFactory&&this._keyBindingFactory(this,
this._keyModes,this._undoStack,this._contentAssist);d.setKeyBinding(new k.KeyBinding(27),"cancelMode");d.setAction("cancelMode",function(){for(var a=!1,c=0;c<this._keyModes.length;c++)this._keyModes[c].isActive()&&(a=this._keyModes[c].cancel()||a);return a}.bind(this),{name:g.cancelMode});d.setAction("lineUp",function(){for(var a=0;a<this._keyModes.length;a++)if(this._keyModes[a].isActive())return this._keyModes[a].lineUp();return!1}.bind(this));d.setAction("lineDown",function(){for(var a=0;a<this._keyModes.length;a++)if(this._keyModes[a].isActive())return this._keyModes[a].lineDown();
return!1}.bind(this));d.setAction("enter",function(){for(var a=0;a<this._keyModes.length;a++)if(this._keyModes[a].isActive())return this._keyModes[a].enter();return!1}.bind(this));a=function(a){if(a!==void 0&&a!==-1){for(var b=this.getView().getModel(),d=this.getAnnotationModel(),e=c.mapOffset(b.getLineStart(a)),a=c.mapOffset(b.getLineEnd(a)),b=d.getAnnotations(e,a),f=null;b.hasNext();){var g=b.next();if(g.type===h.AnnotationType.ANNOTATION_BOOKMARK){f=g;break}}f?d.removeAnnotation(f):(f=h.AnnotationType.createAnnotation(h.AnnotationType.ANNOTATION_BOOKMARK,
e,a),f.title=void 0,d.addAnnotation(f))}};if(this._annotationFactory){var f=d.getModel();f.getBaseModel&&(f=f.getBaseModel());if(this._annotationModel=this._annotationFactory.createAnnotationModel(f))if(f=this._annotationStyler=this._annotationFactory.createAnnotationStyler(d,this._annotationModel))f.addAnnotationType(h.AnnotationType.ANNOTATION_CURRENT_SEARCH),f.addAnnotationType(h.AnnotationType.ANNOTATION_MATCHING_SEARCH),f.addAnnotationType(h.AnnotationType.ANNOTATION_ERROR),f.addAnnotationType(h.AnnotationType.ANNOTATION_WARNING),
f.addAnnotationType(h.AnnotationType.ANNOTATION_MATCHING_BRACKET),f.addAnnotationType(h.AnnotationType.ANNOTATION_CURRENT_BRACKET),f.addAnnotationType(h.AnnotationType.ANNOTATION_CURRENT_LINE),f.addAnnotationType(h.AnnotationType.ANNOTATION_READ_OCCURRENCE),f.addAnnotationType(h.AnnotationType.ANNOTATION_WRITE_OCCURRENCE),f.addAnnotationType("orion.annotation.highlightError");d.annotationModel=this._annotationModel;var f=this._annotationFactory.createAnnotationRulers(this._annotationModel),j=this._annotationRuler=
f.annotationRuler;if(j)j.onClick=function(a){if(a!==void 0&&a!==-1)for(var b=this.getView().getModel(),d=this.getAnnotationModel(),e=c.mapOffset(b.getLineStart(a)),a=c.mapOffset(b.getLineEnd(a)),a=d.getAnnotations(e,a);a.hasNext();)if(d=a.next(),this.isAnnotationTypeVisible(d.type)){a=c.getModel();c.onGotoLine(a.getLineAtOffset(e),d.start-e,d.end-e);break}},j.onDblClick=a,j.setMultiAnnotationOverlay({html:"<div class='annotationHTML overlay'></div>"}),j.addAnnotationType(h.AnnotationType.ANNOTATION_ERROR),
j.addAnnotationType(h.AnnotationType.ANNOTATION_WARNING),j.addAnnotationType(h.AnnotationType.ANNOTATION_TASK),j.addAnnotationType(h.AnnotationType.ANNOTATION_BOOKMARK);this.setAnnotationRulerVisible(!0);if(j=this._overviewRuler=f.overviewRuler)j.onClick=function(a){a!==void 0&&(a=d.getModel().getLineStart(a),c.moveSelection(c.mapOffset(a)))},j.addAnnotationType(h.AnnotationType.ANNOTATION_CURRENT_SEARCH),j.addAnnotationType(h.AnnotationType.ANNOTATION_MATCHING_SEARCH),j.addAnnotationType(h.AnnotationType.ANNOTATION_ERROR),
j.addAnnotationType(h.AnnotationType.ANNOTATION_WARNING),j.addAnnotationType(h.AnnotationType.ANNOTATION_TASK),j.addAnnotationType(h.AnnotationType.ANNOTATION_BOOKMARK),j.addAnnotationType(h.AnnotationType.ANNOTATION_MATCHING_BRACKET),j.addAnnotationType(h.AnnotationType.ANNOTATION_CURRENT_BRACKET),j.addAnnotationType(h.AnnotationType.ANNOTATION_CURRENT_LINE),j.addAnnotationType(h.AnnotationType.ANNOTATION_READ_OCCURRENCE),j.addAnnotationType(h.AnnotationType.ANNOTATION_WRITE_OCCURRENCE);this.setOverviewRulerVisible(!0)}if(this._lineNumberRulerFactory)this._lineNumberRuler=
this._lineNumberRulerFactory.createLineNumberRuler(this._annotationModel),this._lineNumberRuler.onDblClick=a,this.setLineNumberRulerVisible(!0);if(this._foldingRulerFactory)this._foldingRuler=this._foldingRulerFactory.createFoldingRuler(this._annotationModel),this._foldingRuler.addAnnotationType(h.AnnotationType.ANNOTATION_FOLDING),this.setFoldingRulerVisible(!1);this.dispatchEvent({type:"TextViewInstalled",textView:d})},uninstallTextView:function(){var a=this._textView;if(a)a.destroy(),this._textView=
this._undoStack=this._textDND=this._contentAssist=this._listener=this._annotationModel=this._annotationStyler=this._annotationRuler=this._overviewRuler=this._lineNumberRuler=this._foldingRuler=this._currentLineAnnotation=this._title=null,this._dirty=!1,this._keyModes=[],this.dispatchEvent({type:"TextViewUninstalled",textView:a})},_updateCursorStatus:function(){var a=this.getModel(),c=this.getCaretOffset(),b=a.getLineAtOffset(c),a=a.getLineStart(b);c-=a;for(a=0;a<this._keyModes.length;a++){var d=this._keyModes[a];
if(d.isActive()&&d.isStatusActive&&d.isStatusActive())return}this.reportStatus(f.formatMessage(g.lineColumn,b+1,c+1))},showProblems:function(a){var c=this._annotationModel;if(c){for(var b=[],d=[],e=c.getTextModel(),f=c.getAnnotations(0,e.getCharCount()),g;f.hasNext();)g=f.next(),(g.type===h.AnnotationType.ANNOTATION_ERROR||g.type===h.AnnotationType.ANNOTATION_WARNING)&&b.push(g);if(a)for(f=0;f<a.length;f++)if(g=a[f]){var j=g.description.replace(/'/g,"&#39;").replace(/"/g,"&#34;"),o=e.getLineStart(g.line-
1);g=h.AnnotationType.createAnnotation(g.severity==="error"?h.AnnotationType.ANNOTATION_ERROR:h.AnnotationType.ANNOTATION_WARNING,o+g.start-1,o+g.end,j);d.push(g)}c.replaceAnnotations(b,d)}},showOccurrences:function(a){var c=this._annotationModel;if(c){for(var b=[],d=[],e=c.getTextModel(),f=c.getAnnotations(0,e.getCharCount()),g;f.hasNext();)g=f.next(),(g.type===h.AnnotationType.ANNOTATION_READ_OCCURRENCE||g.type===h.AnnotationType.ANNOTATION_WRITE_OCCURRENCE)&&b.push(g);if(a)for(f=0;f<a.length;f++)if(g=
a[f]){var j=e.getLineStart(g.line-1);g=h.AnnotationType.createAnnotation(g.readAccess===!0?h.AnnotationType.ANNOTATION_READ_OCCURRENCE:h.AnnotationType.ANNOTATION_WRITE_OCCURRENCE,j+g.start-1,j+g.end,g.description);d.push(g)}c.replaceAnnotations(b,d)}},showSelection:function(a,c,b,d,e){typeof a==="number"?(typeof c!=="number"&&(c=a),this.moveSelection(a,c)):typeof b==="number"&&(a=this.getModel().getLineStart(b-1),typeof d==="number"&&(a+=d),typeof e!=="number"&&(e=0),this.moveSelection(a,a+e))},
setInput:function(a,c,b,d){this._title=a;this._textView&&(d?(this._undoStack.markClean(),this.checkDirty()):(c?this._textView.setText(c):b!==null&&b!==void 0&&(this._textView.setText(b),this._textView.getModel().setLineDelimiter("auto"),this._highlightCurrentLine(this._textView.getSelection())),this._undoStack.reset(),this.checkDirty(),this._textView.focus()));this.onInputChanged({type:"InputChanged",title:a,message:c,contents:b,contentsSaved:d})},onInputChanged:function(a){return this.dispatchEvent(a)},
onGotoLine:function(a,c,b){if(this._textView){var d=this.getModel(),e=d.getLineStart(a),f=0;b===void 0&&(b=0);typeof c==="string"?(a=d.getLine(a).indexOf(c),a!==-1&&(f=a,b=f+c.length)):(f=c,c=d.getLineEnd(a)-e,f=Math.min(f,c),b=Math.min(b,c));this.moveSelection(e+f,e+b)}},onDirtyChanged:function(a){return this.dispatchEvent(a)}};j.EventTarget.addMixin(e.prototype);c=function(){function a(a){this.options=a}a.prototype.play=function(){var a=typeof this.options.duration==="number"?this.options.duration:
350,c=this.options.easing||this.defaultEasing,b=this.options.onAnimate||function(){},d=this.options.onEnd||function(){},e=this.options.curve[0],f=this.options.curve[1]-e,g,h,j=-1;h=setInterval(function(){j=j===-1?(new Date).getTime():j;var k=((new Date).getTime()-j)/a;k<1?(k=c(k),g=e+k*f,b(g)):(clearInterval(h),d())},typeof this.options.rate==="number"?this.options.rate:20)};a.prototype.defaultEasing=function(a){return Math.sin(a*(Math.PI/2))};return a}();if(!Function.prototype.bind)Function.prototype.bind=
d;return{Editor:e,util:{bind:d}}});
define("orion/editor/rulers",["i18n!orion/editor/nls/messages","orion/editor/annotations","orion/editor/tooltip","orion/editor/util"],function(g,k,j,b){function h(a,c,b,d){this._location=c||"left";this._overview=b||"page";this._rulerStyle=d;this._view=null;var e=this;this._listener={onTextModelChanged:function(a){e._onTextModelChanged(a)},onAnnotationModelChanged:function(a){e._onAnnotationModelChanged(a)}};this.setAnnotationModel(a)}function f(a,c,b,d,e){h.call(this,a,c,"page",b);this._oddStyle=
d||{style:{backgroundColor:"white"}};this._evenStyle=e||{style:{backgroundColor:"white"}};this._numOfDigits=0}function e(a,c,b){h.call(this,a,c,"page",b)}function d(a,c,b){h.call(this,a,c,"document",b)}function c(a,c,b){e.call(this,a,c,b)}h.prototype={getAnnotations:function(a,c){var b=this._annotationModel;if(!b)return[];var d=this._view.getModel(),e=d.getLineStart(a),f=d.getLineEnd(c-1),g=d;d.getBaseModel&&(g=d.getBaseModel(),e=d.mapOffset(e),f=d.mapOffset(f));for(var h=[],b=this.getAnnotationsByType(b,
e,f),e=0;e<b.length;e++)for(var f=b[e],j=g.getLineAtOffset(f.start),k=g.getLineAtOffset(Math.max(f.start,f.end-1)),s=j;s<=k;s++){var v=s;if(d!==g){v=g.getLineStart(s);v=d.mapOffset(v,!0);if(v===-1)continue;v=d.getLineAtOffset(v)}if(a<=v&&v<c){var u=this._mergeAnnotation(h[v],f,s-j,k-j+1);u&&(h[v]=u)}}if(!this._multiAnnotation&&this._multiAnnotationOverlay)for(var y in h)h[y]._multiple&&(h[y].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(){},onDblClick:function(){},onMouseMove:function(a,c){var b=j.Tooltip.getTooltip(this._view);if(b&&!(b.isVisible()&&this._tooltipLineIndex===a)){this._tooltipLineIndex=
a;var d=this;b.setTarget({y:c.clientY,getTooltipInfo:function(){return d._getTooltipInfo(d._tooltipLineIndex,this.y)}})}},onMouseOver:function(a,c){this.onMouseMove(a,c)},onMouseOut:function(){var a=j.Tooltip.getTooltip(this._view);a&&a.setTarget(null)},_getTooltipInfo:function(a,c){if(a!==void 0){var b=this._view,d=b.getModel(),e=this._annotationModel,f=[];if(e){var f=d.getLineStart(a),g=d.getLineEnd(a);d.getBaseModel&&(f=d.mapOffset(f),g=d.mapOffset(g));f=this.getAnnotationsByType(e,f,g)}e=this._getTooltipContents(a,
f);if(!e)return null;e={contents:e,anchor:this.getLocation()};f=b.getClientArea();f.y=this.getOverview()==="document"?b.convert({y:c},"view","document").y:b.getLocationAtOffset(d.getLineStart(a)).y;b.convert(f,"document","page");e.x=f.x;e.y=f.y;e.anchor==="right"&&(e.x+=f.width);return e}},_getTooltipContents:function(a,c){return c},_onAnnotationModelChanged:function(a){function c(a){for(var i=0;i<a.length;i++)if(e.isAnnotationTypeVisible(a[i].type)){var f=a[i].start,g=a[i].end;d.getBaseModel&&(f=
d.mapOffset(f,!0),g=d.mapOffset(g,!0));f!==-1&&g!==-1&&b.redrawLines(d.getLineAtOffset(f),d.getLineAtOffset(Math.max(f,g-1))+1,e)}}var b=this._view;if(b){var d=b.getModel(),e=this,f=d.getLineCount();a.textModelChangedEvent?(a=a.textModelChangedEvent.start,d.getBaseModel&&(a=d.mapOffset(a,!0)),a=d.getLineAtOffset(a),b.redrawLines(a,f,e)):(c(a.added),c(a.removed),c(a.changed))}},_mergeAnnotation:function(a,c,b){a||(a={});if(b===0)if(a.html&&c.html){if(c.html!==a.html&&!a._multiple&&this._multiAnnotation)a.html=
this._multiAnnotation.html;a._multiple=!0}else a.html=c.html;a.style=this._mergeStyle(a.style,c.style);return a},_mergeStyle:function(a,c){if(c){a||(a={});a.styleClass&&c.styleClass&&a.styleClass!==c.styleClass?a.styleClass+=" "+c.styleClass:a.styleClass=c.styleClass;var b;if(c.style){if(!a.style)a.style={};for(b in c.style)a.style[b]||(a.style[b]=c.style[b])}if(c.attributes){if(!a.attributes)a.attributes={};for(b in c.attributes)a.attributes[b]||(a.attributes[b]=c.attributes[b])}}return a}};k.AnnotationTypeList.addMixin(h.prototype);
f.prototype=new h;f.prototype.getAnnotations=function(a,c){for(var b=h.prototype.getAnnotations.call(this,a,c),d=this._view.getModel(),e=a;e<c;e++){var f=e&1?this._oddStyle:this._evenStyle,g=e;d.getBaseModel&&(g=d.getLineStart(g),g=d.getBaseModel().getLineAtOffset(d.mapOffset(g)));b[e]||(b[e]={});b[e].html=g+1+"";if(!b[e].style)b[e].style=f}return b};f.prototype.getWidestAnnotation=function(){var a=this._view.getModel().getLineCount();return this.getAnnotations(a-1,a)[a-1]};f.prototype._onTextModelChanged=
function(a){var a=a.start,c=this._view.getModel(),b=((c.getBaseModel?c.getBaseModel().getLineCount():c.getLineCount())+"").length;if(this._numOfDigits!==b)this._numOfDigits=b,this._view.redrawLines(c.getLineAtOffset(a),c.getLineCount(),this)};e.prototype=new h;d.prototype=new h;d.prototype.getRulerStyle=function(){var a={style:{lineHeight:"1px",fontSize:"1px"}};return a=this._mergeStyle(a,this._rulerStyle)};d.prototype.onClick=function(a){a!==void 0&&this._view.setTopIndex(a)};d.prototype._getTooltipContents=
function(a,c){if(c.length===0){var d=this._view.getModel(),e=a;d.getBaseModel&&(e=d.getLineStart(e),e=d.getBaseModel().getLineAtOffset(d.mapOffset(e)));return b.formatMessage(g.line,e+1)}return h.prototype._getTooltipContents.call(this,a,c)};d.prototype._mergeAnnotation=function(a,c,b,d){if(b===0){if(!a)a={html:"&nbsp;",style:{style:{height:3*d+"px"}}},a.style=this._mergeStyle(a.style,c.overviewStyle);return a}};c.prototype=new e;c.prototype.onClick=function(a){if(a!==void 0){var c=this._annotationModel;
if(c){var b=this._view.getModel(),d=b.getLineStart(a),a=b.getLineEnd(a,!0);b.getBaseModel&&(d=b.mapOffset(d),a=b.mapOffset(a),b=b.getBaseModel());for(var e,c=c.getAnnotations(d,a);!e&&c.hasNext();)a=c.next(),this.isAnnotationTypeVisible(a.type)&&(e=a);e&&b.getLineAtOffset(e.start)===b.getLineAtOffset(d)&&((b=j.Tooltip.getTooltip(this._view))&&b.setTarget(null),e.expanded?e.collapse():e.expand(),this._annotationModel.modifyAnnotation(e))}}};c.prototype._getTooltipContents=function(a,c){return c.length===
1&&c[0].expanded?null:e.prototype._getTooltipContents.call(this,a,c)};c.prototype._onAnnotationModelChanged=function(a){function c(a){for(g=0;g<a.length;g++)if(f.isAnnotationTypeVisible(a[g].type)){var b=a[g].start;d.getBaseModel&&(b=d.mapOffset(b,!0));b!==-1&&(j=Math.min(j,d.getLineAtOffset(b)))}}if(a.textModelChangedEvent)e.prototype._onAnnotationModelChanged.call(this,a);else{var b=this._view;if(b){var d=b.getModel(),f=this,g,h=d.getLineCount(),j=h;c(a.added);c(a.removed);c(a.changed);a=b.getRulers();
for(g=0;g<a.length;g++)b.redrawLines(j,h,a[g])}}};return{Ruler:h,AnnotationRuler:e,LineNumberRuler:f,OverviewRuler:d,FoldingRuler:c}});
define("orion/editor/editorFeatures","i18n!orion/editor/nls/messages,orion/editor/undoStack,orion/editor/keyBinding,orion/editor/rulers,orion/editor/annotations,orion/editor/tooltip,orion/editor/textDND,orion/editor/regex,orion/editor/util".split(","),function(g,k,j,b,h,f,e,d,c){function a(){}function i(){}function l(){}function n(){}function q(){}function t(a,c,b){this.editor=a;this.textView=a.getTextView();this.undoStack=c;this._incrementalFindActive=!1;this._incrementalFindSuccess=!0;this._incrementalFindIgnoreSelection=
!1;this._incrementalFindPrefix="";this._searcher=b;this._lastEditLocation=null;this.init()}function m(a,c,b,d){this.editor=a;this.textView=a.getTextView();this.undoStack=c;this.contentAssist=b;this.linkedMode=d;this.contentAssist&&this.contentAssist.addEventListener("ProposalApplied",this.contentAssistProposalApplied.bind(this));this.init()}function r(a){this.editor=a;this.textView=a.getTextView();this.linkedModeActive=!1;this.linkedModePositions=[];this.linkedModeEscapePosition=this.linkedModeCurrentPositionIndex=
0;this.linkedModeListener={onVerify:function(a){for(var c=!1,b=0,d=0;d<this.linkedModePositions.length;++d){var i=this.linkedModePositions[d];if(c)i.offset+=b;else if(a.start>=i.offset&&a.end<=i.offset+i.length)c=i.length,i.length=a.start-i.offset+a.text.length+(i.offset+i.length-a.end),b=i.length-c,c=!0}c?this.linkedModeEscapePosition+=b:this.cancel()}.bind(this)}}a.prototype={createUndoStack:function(a){var a=a.getTextView(),c=new k.UndoStack(a,200);a.setAction("undo",function(){c.undo();return!0},
{name:g.undo});a.setAction("redo",function(){c.redo();return!0},{name:g.redo});return c}};i.prototype={createLineNumberRuler:function(a){return new b.LineNumberRuler(a,"left",{styleClass:"ruler lines"},{styleClass:"rulerLines odd"},{styleClass:"rulerLines even"})}};l.prototype={createFoldingRuler:function(a){return new b.FoldingRuler(a,"left",{styleClass:"ruler folding"})}};n.prototype={createAnnotationModel:function(a){return new h.AnnotationModel(a)},createAnnotationStyler:function(a,c){return new h.AnnotationStyler(a,
c)},createAnnotationRulers:function(a){var c=new b.AnnotationRuler(a,"left",{styleClass:"ruler annotations"}),a=new b.OverviewRuler(a,"right",{styleClass:"ruler overview"});return{annotationRuler:c,overviewRuler:a}}};q.prototype={createTextDND:function(a,c){return new e.TextDND(a.getTextView(),c)}};t.prototype={init:function(){var a=this;this._incrementalFindListener={onVerify:function(b){var i=a.editor,e=i.getModel(),f=i.mapOffset(b.start),h=i.mapOffset(b.end),f=e.getText(f,h),e=a._incrementalFindPrefix;
if((e=e.match(RegExp("^"+d.escape(f),"i")))&&e.length>0)e=a._incrementalFindPrefix+=b.text,a.editor.reportStatus(c.formatMessage(g.incrementalFind,e)),f=i.getSelection().start,(f=i.getModel().find({string:e,start:f,caseInsensitive:e.toLowerCase()===e}).next())?(a._incrementalFindSuccess=!0,a._incrementalFindIgnoreSelection=!0,i.moveSelection(f.start,f.end),a._incrementalFindIgnoreSelection=!1):(i.reportStatus(c.formatMessage(g.incrementalFindNotFound,e),"error"),a._incrementalFindSuccess=!1),b.text=
null},onSelection:function(){a._incrementalFindIgnoreSelection||a.toggleIncrementalFind()}};this._lastEditListener={onModelChanged:function(c){if(a.editor.isDirty())a._lastEditLocation=c.start+c.addedCharCount}};this.textView.addEventListener("ModelChanged",this._lastEditListener.onModelChanged);this.textView.setKeyBinding(new j.KeyBinding("k",!0),"findNext");this.textView.setAction("findNext",function(){if(this._searcher){var a=this.textView.getSelection();a.start<a.end?this._searcher.findNext(!0,
this.textView.getText(a.start,a.end)):this._searcher.findNext(!0);return!0}return!1}.bind(this),{name:g.findNext});this.textView.setKeyBinding(new j.KeyBinding("k",!0,!0),"findPrevious");this.textView.setAction("findPrevious",function(){if(this._searcher){var a=this.textView.getSelection();a.start<a.end?this._searcher.findNext(!1,this.textView.getText(a.start,a.end)):this._searcher.findNext(!1);return!0}return!1}.bind(this),{name:g.findPrevious});this.textView.setKeyBinding(new j.KeyBinding("j",!0),
"incrementalFind");this.textView.setAction("incrementalFind",function(){if(this._searcher&&this._searcher.visible())return!0;var a=this.editor;if(this._incrementalFindActive){var b=this._incrementalFindPrefix;if(b.length!==0){var d;d=0;this._incrementalFindSuccess&&(d=a.getSelection().start+1);(d=a.getModel().find({string:b,start:d,caseInsensitive:b.toLowerCase()===b}).next())?(this._incrementalFindIgnoreSelection=this._incrementalFindSuccess=!0,a.moveSelection(d.start,d.end),this._incrementalFindIgnoreSelection=
!1,a.reportStatus(c.formatMessage(g.incrementalFind,b))):(a.reportStatus(c.formatMessage(g.incrementalFindNotFound,b),"error"),this._incrementalFindSuccess=!1)}}else a.setCaretOffset(a.getCaretOffset()),this.toggleIncrementalFind();return!0}.bind(this),{name:g.incrementalFindKey});this.textView.setAction("deletePrevious",function(){if(this._incrementalFindActive){var a=this.editor,b=this._incrementalFindPrefix,b=this._incrementalFindPrefix=b.substring(0,b.length-1);if(b.length===0)return this._incrementalFindIgnoreSelection=
this._incrementalFindSuccess=!0,a.setCaretOffset(a.getSelection().start),this._incrementalFindIgnoreSelection=!1,this.toggleIncrementalFind(),!0;a.reportStatus(c.formatMessage(g.incrementalFind,b));var d=a.getModel().find({string:b,start:a.getCaretOffset()-b.length-1,reverse:!0,caseInsensitive:b.toLowerCase()===b}).next();d?(this._incrementalFindIgnoreSelection=this._incrementalFindSuccess=!0,a.moveSelection(d.start,d.end),this._incrementalFindIgnoreSelection=!1):a.reportStatus(c.formatMessage(g.incrementalFindNotFound,
b),"error");return!0}return!1}.bind(this));this.textView.setAction("tab",function(){if(this.textView.getOptions("readonly"))return!1;if(this.textView.getOptions("tabMode")){var a=this.editor,c=a.getModel(),b=a.getSelection(),d=c.getLineAtOffset(b.start),i=c.getLineAtOffset(b.end>b.start?b.end-1:b.end);if(d!==i){var e=[];e.push("");for(var f=d;f<=i;f++)e.push(c.getLine(f,!0));var f=c.getLineStart(d),c=c.getLineEnd(i,!0),g=this.textView.getOptions("tabSize","expandTab"),g=g.expandTab?Array(g.tabSize+
1).join(" "):"\t";a.setText(e.join(g),f,c);a.setSelection(f===b.start?b.start:b.start+g.length,b.end+(i-d+1)*g.length);return!0}a=a.getKeyModes();for(b=0;b<a.length;b++)if(a[b].isActive())return a[b].tab();return!1}}.bind(this));this.textView.setAction("shiftTab",function(){if(this.textView.getOptions("readonly"))return!1;if(this.textView.getOptions("tabMode")){for(var a=this.editor,c=a.getModel(),b=a.getSelection(),d=c.getLineAtOffset(b.start),i=c.getLineAtOffset(b.end>b.start?b.end-1:b.end),e=this.textView.getOptions("tabSize"),
f=Array(e+1).join(" "),g=[],h=0,l=0,j=d;j<=i;j++){var n=c.getLine(j,!0);if(c.getLineStart(j)!==c.getLineEnd(j))if(n.indexOf("\t")===0)n=n.substring(1),h++;else if(n.indexOf(f)===0)n=n.substring(e),h+=e;else return!0;j===d&&(l=h);g.push(n)}d=c.getLineStart(d);e=c.getLineEnd(i,!0);c=c.getLineStart(i);a.setText(g.join(""),d,e);g=d===b.start?b.start:b.start-l;b=Math.max(g,b.end-h+(b.end===c+1&&b.start!==b.end?1:0));a.setSelection(g,b);return!0}}.bind(this),{name:g.unindentLines});this.textView.setKeyBinding(new j.KeyBinding(38,
!1,!1,!0),"moveLinesUp");this.textView.setAction("moveLinesUp",function(){if(this.textView.getOptions("readonly"))return!1;var a=this.editor,c=a.getModel(),b=a.getSelection(),d=c.getLineAtOffset(b.start);if(d===0)return!0;var i=c.getLineAtOffset(b.end>b.start?b.end-1:b.end),e=c.getLineCount(),b=c.getLineStart(d-1),f=c.getLineStart(d),g=c.getLineEnd(i,!0),h=c.getText(f,g),l=0;i===e-1&&(i=c.getLineEnd(d-1),d=c.getLineEnd(d-1,!0),h+=c.getText(i,d),f=i,l=d-i);this.startUndo();a.setText("",f,g);a.setText(h,
b,b);a.setSelection(b,b+h.length-l);this.endUndo();return!0}.bind(this),{name:g.moveLinesUp});this.textView.setKeyBinding(new j.KeyBinding(40,!1,!1,!0),"moveLinesDown");this.textView.setAction("moveLinesDown",function(){if(this.textView.getOptions("readonly"))return!1;var a=this.editor,c=a.getModel(),b=a.getSelection(),d=c.getLineAtOffset(b.start),i=c.getLineAtOffset(b.end>b.start?b.end-1:b.end),e=c.getLineCount();if(i===e-1)return!0;var d=c.getLineStart(d),b=c.getLineEnd(i,!0),f=c.getLineEnd(i+1,
!0)-(b-d),g=0;i!==e-2?c=c.getText(d,b):(i=c.getLineEnd(i),c=c.getText(i,b)+c.getText(d,i),g+=b-i);this.startUndo();a.setText("",d,b);a.setText(c,f,f);a.setSelection(f+g,f+g+c.length);this.endUndo();return!0}.bind(this),{name:g.moveLinesDown});this.textView.setKeyBinding(new j.KeyBinding(38,!0,!1,!0),"copyLinesUp");this.textView.setAction("copyLinesUp",function(){if(this.textView.getOptions("readonly"))return!1;var a=this.editor,c=a.getModel(),b=a.getSelection(),d=c.getLineAtOffset(b.start),b=c.getLineAtOffset(b.end>
b.start?b.end-1:b.end),d=c.getLineStart(d),i=c.getLineEnd(b,!0),e=c.getLineCount(),f="",i=c.getText(d,i);b===e-1&&(i+=f=c.getLineDelimiter());a.setText(i,d,d);a.setSelection(d,d+i.length-f.length);return!0}.bind(this),{name:g.copyLinesUp});this.textView.setKeyBinding(new j.KeyBinding(40,!0,!1,!0),"copyLinesDown");this.textView.setAction("copyLinesDown",function(){if(this.textView.getOptions("readonly"))return!1;var a=this.editor,c=a.getModel(),b=a.getSelection(),d=c.getLineAtOffset(b.start),b=c.getLineAtOffset(b.end>
b.start?b.end-1:b.end),i=c.getLineStart(d),d=c.getLineEnd(b,!0),e=c.getLineCount(),f="",i=c.getText(i,d);b===e-1&&(i=(f=c.getLineDelimiter())+i);a.setText(i,d,d);a.setSelection(d+f.length,d+i.length);return!0}.bind(this),{name:g.copyLinesDown});this.textView.setKeyBinding(new j.KeyBinding("d",!0,!1,!1),"deleteLines");this.textView.setAction("deleteLines",function(){if(this.textView.getOptions("readonly"))return!1;var a=this.editor,c=a.getSelection(),b=a.getModel(),d=b.getLineAtOffset(c.start),c=b.getLineAtOffset(c.end>
c.start?c.end-1:c.end),d=b.getLineStart(d),b=b.getLineEnd(c,!0);a.setText("",d,b);return!0}.bind(this),{name:g.deleteLines});this.textView.setKeyBinding(new j.KeyBinding("l",!0),"gotoLine");this.textView.setAction("gotoLine",function(){var a=this.editor,c=a.getModel().getLineAtOffset(a.getCaretOffset());if(c=prompt(g.gotoLinePrompty,c+1))c=parseInt(c,10),a.onGotoLine(c-1,0);return!0}.bind(this),{name:g.gotoLine});this.textView.setKeyBinding(new j.KeyBinding(190,!0),"nextAnnotation");this.textView.setAction("nextAnnotation",
function(){var a=this.editor,c=a.getAnnotationModel();if(!c)return!0;for(var b=a.getModel(),d=a.getCaretOffset(),c=c.getAnnotations(d,b.getCharCount());c.hasNext();){var i=c.next();if(!(i.start<=d)&&!(i.type!==h.AnnotationType.ANNOTATION_ERROR&&i.type!==h.AnnotationType.ANNOTATION_WARNING&&i.type!==h.AnnotationType.ANNOTATION_TASK&&i.type!==h.AnnotationType.ANNOTATION_BOOKMARK)){var e=f.Tooltip.getTooltip(this.textView);if(!e){a.moveSelection(i.start);break}var g=b.getLineAtOffset(i.start),l=this.textView;
a.moveSelection(i.start,i.start,function(){setTimeout(function(){e.setTarget({getTooltipInfo:function(){var a=l.convert({x:l.getLocationAtOffset(i.start).x,y:l.getLocationAtOffset(b.getLineStart(g)).y},"document","page");return{contents:[i],x:a.x,y:a.y+Math.floor(l.getLineHeight(g)*1.33)}}},0)},0)});break}}return!0}.bind(this),{name:g.nextAnnotation});this.textView.setKeyBinding(new j.KeyBinding(188,!0),"previousAnnotation");this.textView.setAction("previousAnnotation",function(){var a=this.editor,
c=a.getAnnotationModel();if(!c)return!0;for(var b=a.getModel(),d=a.getCaretOffset(),c=c.getAnnotations(0,d),i=null;c.hasNext();){var e=c.next();e.start>=d||e.type!==h.AnnotationType.ANNOTATION_ERROR&&e.type!==h.AnnotationType.ANNOTATION_WARNING&&e.type!==h.AnnotationType.ANNOTATION_TASK&&e.type!==h.AnnotationType.ANNOTATION_BOOKMARK||(i=e)}if(i){var g=b.getLineAtOffset(i.start),l=f.Tooltip.getTooltip(this.textView);if(!l)return a.moveSelection(i.start),!0;var j=this.textView;a.moveSelection(i.start,
i.start,function(){setTimeout(function(){l.setTarget({getTooltipInfo:function(){var a=j.convert({x:j.getLocationAtOffset(i.start).x,y:j.getLocationAtOffset(b.getLineStart(g)).y},"document","page");return{contents:[i],x:a.x,y:a.y+Math.floor(j.getLineHeight(g)*1.33)}}},0)},0)})}return!0}.bind(this),{name:g.prevAnnotation});this.textView.setKeyBinding(new j.KeyBinding("e",!0,!1,!0,!1),"expand");this.textView.setAction("expand",function(){var a=this.editor,c=a.getAnnotationModel();if(!c)return!0;var b=
a.getModel(),a=a.getCaretOffset(),d=b.getLineAtOffset(a),a=b.getLineStart(d),d=b.getLineEnd(d,!0);b.getBaseModel&&(a=b.mapOffset(a),d=b.mapOffset(d),b.getBaseModel());for(var i,b=c.getAnnotations(a,d);!i&&b.hasNext();)a=b.next(),a.type===h.AnnotationType.ANNOTATION_FOLDING&&(a.expanded||(i=a));i&&!i.expanded&&(i.expand(),c.modifyAnnotation(i));return!0}.bind(this),{name:g.expand});this.textView.setKeyBinding(new j.KeyBinding("c",!0,!1,!0,!1),"collapse");this.textView.setAction("collapse",function(){var a=
this.editor,c=a.getAnnotationModel();if(!c)return!0;var b=a.getModel(),d=a.getCaretOffset(),i=b.getLineAtOffset(d),d=b.getLineStart(i),i=b.getLineEnd(i,!0);b.getBaseModel&&(d=b.mapOffset(d),i=b.mapOffset(i),b.getBaseModel());for(var e,b=c.getAnnotations(d,i);!e&&b.hasNext();)d=b.next(),d.type===h.AnnotationType.ANNOTATION_FOLDING&&(e=d);e&&e.expanded&&(a.setCaretOffset(e.start),e.collapse(),c.modifyAnnotation(e));return!0}.bind(this),{name:g.collapse});this.textView.setKeyBinding(new j.KeyBinding("e",
!0,!0,!0,!1),"expandAll");this.textView.setAction("expandAll",function(){var a=this.editor,c=a.getAnnotationModel();if(!c)return!0;var a=a.getModel(),b=c.getAnnotations(0,a.getCharCount());for(this.textView.setRedraw(!1);b.hasNext();)a=b.next(),a.type===h.AnnotationType.ANNOTATION_FOLDING&&!a.expanded&&(a.expand(),c.modifyAnnotation(a));this.textView.setRedraw(!0);return!0}.bind(this),{name:g.expandAll});this.textView.setKeyBinding(new j.KeyBinding("c",!0,!0,!0,!1),"collapseAll");this.textView.setAction("collapseAll",
function(){var a=this.editor,c=a.getAnnotationModel();if(!c)return!0;var a=a.getModel(),b=c.getAnnotations(0,a.getCharCount());for(this.textView.setRedraw(!1);b.hasNext();)a=b.next(),a.type===h.AnnotationType.ANNOTATION_FOLDING&&a.expanded&&(a.collapse(),c.modifyAnnotation(a));this.textView.setRedraw(!0);return!0}.bind(this),{name:g.collapseAll});this.textView.setKeyBinding(new j.KeyBinding("q",!c.isMac,!1,!1,c.isMac),"lastEdit");this.textView.setAction("lastEdit",function(){typeof this._lastEditLocation===
"number"&&this.editor.showSelection(this._lastEditLocation);return!0}.bind(this),{name:g.lastEdit})},toggleIncrementalFind:function(){(this._incrementalFindActive=!this._incrementalFindActive)?(this.editor.reportStatus(c.formatMessage(g.incrementalFind,this._incrementalFindPrefix)),this.textView.addEventListener("Verify",this._incrementalFindListener.onVerify),this.textView.addEventListener("Selection",this._incrementalFindListener.onSelection)):(this._incrementalFindPrefix="",this.editor.reportStatus(""),
this.textView.removeEventListener("Verify",this._incrementalFindListener.onVerify),this.textView.removeEventListener("Selection",this._incrementalFindListener.onSelection),this.textView.setCaretOffset(this.textView.getCaretOffset()))},startUndo:function(){this.undoStack&&this.undoStack.startCompoundChange()},endUndo:function(){this.undoStack&&this.undoStack.endCompoundChange()},cancel:function(){this.toggleIncrementalFind()},isActive:function(){return this._incrementalFindActive},isStatusActive:function(){return this._incrementalFindActive},
lineUp:function(){if(this._incrementalFindActive){var a=this._incrementalFindPrefix;if(a.length===0)return!1;var b=this.editor,d=b.getModel(),d=this._incrementalFindSuccess?b.getCaretOffset()-a.length-1:d.getCharCount()-1;(d=b.getModel().find({string:a,start:d,reverse:!0,caseInsensitive:a.toLowerCase()===a}).next())?(this._incrementalFindIgnoreSelection=this._incrementalFindSuccess=!0,b.moveSelection(d.start,d.end),this._incrementalFindIgnoreSelection=!1,b.reportStatus(c.formatMessage(g.incrementalFind,
a))):(b.reportStatus(c.formatMessage(g.incrementalFindNotFound,a),"error"),this._incrementalFindSuccess=!1);return!0}return!1},lineDown:function(){if(this._incrementalFindActive){var a=this._incrementalFindPrefix;if(a.length===0)return!1;var b=this.editor,d=0;this._incrementalFindSuccess&&(d=b.getSelection().start+1);(d=b.getModel().find({string:a,start:d,caseInsensitive:a.toLowerCase()===a}).next())?(this._incrementalFindIgnoreSelection=this._incrementalFindSuccess=!0,b.moveSelection(d.start,d.end),
this._incrementalFindIgnoreSelection=!1,b.reportStatus(c.formatMessage(g.incrementalFind,a))):(b.reportStatus(c.formatMessage(g.incrementalFindNotFound,a),"error"),this._incrementalFindSuccess=!1);return!0}return!1},enter:function(){return!1}};m.prototype={startUndo:function(){this.undoStack&&this.undoStack.startCompoundChange()},endUndo:function(){this.undoStack&&this.undoStack.endCompoundChange()},init:function(){function a(c,b,d){var i=c.getLineAtOffset(b),e=c.getLineAtOffset(d),f,g,h,l,j,n;for(f=
i;f>=0;f--)if(g=c.getLine(f),h=f===i?b-c.getLineStart(i):g.length,l=g.lastIndexOf("/*",h),g=g.lastIndexOf("*/",h),g>l)break;else if(l!==-1){j=c.getLineStart(f)+l;break}for(f=e;f<c.getLineCount();f++)if(g=c.getLine(f),h=f===e?d-c.getLineStart(e):0,l=g.indexOf("/*",h),g=g.indexOf("*/",h),l!==-1&&l<g)break;else if(g!==-1){n=c.getLineStart(f)+g;break}return{commentStart:j,commentEnd:n}}this.textView.setAction("lineStart",function(){for(var a=this.editor,c=a.getModel(),b=a.getCaretOffset(),d=c.getLineAtOffset(b),
i=c.getLineStart(d),c=c.getLine(d),d=0;d<c.length;d++){var e=c.charCodeAt(d);if(!(e===32||e===9))break}d+=i;return b!==d?(a.setSelection(d,d),!0):!1}.bind(this));this.textView.setKeyBinding(new j.KeyBinding(191,!0),"toggleLineComment");this.textView.setAction("toggleLineComment",function(){if(this.textView.getOptions("readonly"))return!1;for(var a=this.editor,c=a.getModel(),b=a.getSelection(),d=c.getLineAtOffset(b.start),i=c.getLineAtOffset(b.end>b.start?b.end-1:b.end),e=!0,f=[],g,h,l=d;l<=i;l++)if(g=
c.getLine(l,!0),f.push(g),!e||(h=g.indexOf("//"))===-1)e=!1;else if(h!==0){var j;for(j=0;j<h;j++)if(e=g.charCodeAt(j),!(e===32||e===9))break;e=j===h}l=c.getLineStart(d);j=c.getLineEnd(i,!0);if(e){for(e=0;e<f.length;e++)g=f[e],h=g.indexOf("//"),f[e]=g.substring(0,h)+g.substring(h+2);f=f.join("");g=c.getLineStart(i);c=l===b.start?b.start:b.start-2;b=b.end-2*(i-d+1)+(b.end===g+1?2:0)}else f.splice(0,0,""),f=f.join("//"),c=l===b.start?b.start:b.start+2,b=b.end+2*(i-d+1);a.setText(f,l,j);a.setSelection(c,
b);return!0}.bind(this),{name:g.toggleLineComment});this.textView.setKeyBinding(new j.KeyBinding(191,!0,!c.isMac,!1,c.isMac),"addBlockComment");this.textView.setAction("addBlockComment",function(){if(this.textView.getOptions("readonly"))return!1;var c=this.editor,b=c.getModel(),d=c.getSelection(),i=RegExp("/\\*|\\*/","g"),e=a(b,d.start,d.end);if(e.commentStart!==void 0&&e.commentEnd!==void 0)return!0;b=b.getText(d.start,d.end);if(b.length===0)return!0;e=b.length;b=b.replace(i,"");i=b.length;c.setText("/*"+
b+"*/",d.start,d.end);c.setSelection(d.start+2,d.end+2+(i-e));return!0}.bind(this),{name:g.addBlockComment});this.textView.setKeyBinding(new j.KeyBinding(220,!0,!c.isMac,!1,c.isMac),"removeBlockComment");this.textView.setAction("removeBlockComment",function(){if(this.textView.getOptions("readonly"))return!1;var c=this.editor,b=c.getModel(),d=c.getSelection(),i=b.getText(d.start,d.end),e,f,g;for(g=0;g<i.length;g++)if(i.substring(g,g+2)==="/*"){e=d.start+g;break}for(;g<i.length;g++)if(i.substring(g,
g+2)==="*/"){f=d.start+g;break}if(e!==void 0&&f!==void 0)c.setText(b.getText(e+2,f),e,f+2),c.setSelection(e,f);else{i=a(b,d.start,d.end);if(i.commentStart===void 0||i.commentEnd===void 0)return!0;b=b.getText(i.commentStart+2,i.commentEnd);c.setText(b,i.commentStart,i.commentEnd+2);c.setSelection(d.start-2,d.end-2)}return!0}.bind(this),{name:g.removeBlockComment})},contentAssistProposalApplied:function(a){a=a.data.proposal;if(a.positions&&this.linkedMode){for(var c=[],b=0;b<a.positions.length;++b)c[b]=
{positions:[{offset:a.positions[b].offset,length:a.positions[b].length}]};this.linkedMode.enterLinkedMode({groups:c,escapePosition:a.escapePosition})}else a.escapePosition&&this.textView.setCaretOffset(a.escapePosition);return!0},cancel:function(){return!1},isActive:function(){return!0},isStatusActive:function(){return!1},lineUp:function(){return!1},lineDown:function(){return!1},enter:function(){if(this.textView.getOptions("readonly"))return!1;var a=this.editor,c=a.getSelection();if(c.start===c.end){for(var b=
a.getModel(),d=b.getLineAtOffset(c.start),i=b.getLine(d,!0),e=b.getLineStart(d),d=0,e=c.start-e,f;d<e&&((f=i.charCodeAt(d))===32||f===9);)d++;if(d>0){for(var g=i.substring(0,d),d=e;d<i.length&&((f=i.charCodeAt(d++))===32||f===9);)c.end++;a.setText(b.getLineDelimiter()+g,c.start,c.end);return!0}}return!1},tab:function(){return!1}};r.prototype={enterLinkedMode:function(a){if(!this.linkedModeActive){this.linkedModeActive=!0;this.linkedModePositions=[];for(var c=0;c<a.groups.length;++c){var b=a.groups[c];
this.linkedModePositions[c]={offset:b.positions[0].offset,length:b.positions[0].length}}this.linkedModeEscapePosition=a.escapePosition;this.linkedModeCurrentPositionIndex=0;this.selectTextForLinkedModePosition(this.linkedModePositions[this.linkedModeCurrentPositionIndex]);this.textView.addEventListener("Verify",this.linkedModeListener.onVerify);this.textView.setKeyBinding(new j.KeyBinding(9),"nextLinkedModePosition");this.textView.setAction("nextLinkedModePosition",function(){this.linkedModeCurrentPositionIndex=
++this.linkedModeCurrentPositionIndex%this.linkedModePositions.length;this.selectTextForLinkedModePosition(this.linkedModePositions[this.linkedModeCurrentPositionIndex]);return!0}.bind(this));this.textView.setKeyBinding(new j.KeyBinding(9,!1,!0),"previousLinkedModePosition");this.textView.setAction("previousLinkedModePosition",function(){this.linkedModeCurrentPositionIndex=this.linkedModeCurrentPositionIndex>0?this.linkedModeCurrentPositionIndex-1:this.linkedModePositions.length-1;this.selectTextForLinkedModePosition(this.linkedModePositions[this.linkedModeCurrentPositionIndex]);
return!0}.bind(this));this.editor.reportStatus(g.linkedModeEntered,null,!0)}},isActive:function(){return this.linkedModeActive},isStatusActive:function(){return this.linkedModeActive},enter:function(){this.cancel();return!0},cancel:function(a){if(this.linkedModeActive)this.linkedModeActive=!1,this.textView.removeEventListener("Verify",this.linkedModeListener.onVerify),this.textView.setKeyBinding(new j.KeyBinding(9),"tab"),this.textView.setKeyBinding(new j.KeyBinding(9,!1,!0),"shiftTab"),a||this.textView.setCaretOffset(this.linkedModeEscapePosition,
!1),this.editor.reportStatus(g.linkedModeExited,null,!0)},lineUp:function(){this.cancel(!0);return!1},lineDown:function(){this.cancel(!0);return!1},selectTextForLinkedModePosition:function(a){this.textView.setSelection(a.offset,a.offset+a.length)}};return{UndoFactory:a,LineNumberRulerFactory:i,FoldingRulerFactory:l,AnnotationFactory:n,TextDNDFactory:q,TextActions:t,SourceCodeActions:m,LinkedMode:r}});define("text!orion/compare/compare-features.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/compareUtils",["orion/URITemplate"],function(g){var k=k||{};k.compareUtils=k.compareUtils||{};k.compareUtils.lookUpMapper=function(g,b,h){for(var f=0,e=0;e<g.length;e++){var d=g[e][b];d===0&&(d=1);if(h>=f&&h<f+d)return{mapperIndex:e,startFrom:f};if(e===g.length-1)break;f+=g[e][b]}return{mapperIndex:g.length-1,startFrom:f}};k.compareUtils.lookUpLineIndex=function(g,b,h){if(h===0)return 0;for(var f=0,e=0;e<h;e++)f+=g[e][b];return f};k.compareUtils.updateMapper=function(g,b,h,f,
e){if(f!==e&&(f>0||e>0)){var d=k.compareUtils.lookUpMapper(g,b,h);if(!(d.mapperIndex<0)){if(f>0)for(var c=h-d.startFrom,h=d.mapperIndex;h<g.length;h++){c=g[h][b]-c;if(f<=c){g[h][b]-=f;break}g[h][b]-=c;f-=c;c=0}e>0&&(g[d.mapperIndex][b]+=e)}}};k.compareUtils.overlapMapper=function(g,b,h,f,e){g=h+g[b]-1;g<h&&(g=h);e<f&&(e=f);return g<f||e<h?!1:!0};k.compareUtils.findFirstDiff=function(g,b,h,f){for(var e=0,d=void 0,c=0;c<g.length;c++){if(e>f)break;if(k.compareUtils.overlapMapper(g[c],b,e,h,f)&&(d={mapperIndex:c,
startFrom:e},g[c][2]!==0))break;e+=g[c][b]}return d};k.compareUtils.matchMapper=function(g,b,h,f){if(g.length===0)return h;var e=h+Math.round((f-h)/3),d=k.compareUtils.findFirstDiff(g,b,h,f),c=g[d.mapperIndex][b]===0?d.startFrom:d.startFrom+g[d.mapperIndex][b]-1,a=k.compareUtils.lookUpLineIndex(g,1-b,d.mapperIndex),i=d.startFrom-h;return g[d.mapperIndex][2]===0?a-i:e>=d.startFrom&&e<=c?a-Math.round((f-h)/3):e<d.startFrom?a-i:(g[d.mapperIndex][1-b]===0?a:a+g[d.mapperIndex][1-b]-1)-(c-h)};k.compareUtils.getMapperLineCount=
function(g){for(var b=0,h=0;h<g.length;h++)b+=Math.max(g[h][0],g[h][1]);return b};k.compareUtils.getAnnotationIndex=function(g,b){for(var h=0;h<g.length;h++)if(g[h][0]===b)return h;return-1};k.compareUtils.getAnnotationMapperIndex=function(g,b){return g[b][1]};k.compareUtils.getAnnotationIndexByMapper=function(g,b){for(var h=0;h<g.length;h++)if(g[h][1]===b)return{current:h,prev:h-1,next:h+1};return{current:-1,prev:-1,next:-1}};k.compareUtils.isMapperConflict=function(g,b){return b<0?!1:!g[b][3]?!1:
g[b][3]===1};k.compareUtils.mergeDiffBlocks=function(g,b,h,f,e,d){for(var c=0;c<b.length;c++){var a=b[c][0],i=h[b[c][1]];if(i[0]>0){for(var l="",n=0;n<i[0];n++)l=l+f[i[2]-1+n].substring(e)+d;i=g.getLineCount();a>=i&&(a=i-1);a=g.getLineStart(a);g.setText(l,a,a)}}};k.compareUtils.generateCompareHref=function(j,b){var h=require.toUrl("compare/compare.html");if(!b.conflict)b.conflict=void 0;if(!b.readonly)b.readonly=void 0;return(new g(h+"#{,resource,params*}")).expand({resource:j,params:b})};k.compareUtils.generateCompareTreeHref=
function(j,b){var h=require.toUrl("compare-tree/compare-tree.html");return(new g(h+"#{,resource,params*}")).expand({resource:j,params:b})};return k.compareUtils});
define("orion/compare/compare-features",["i18n!orion/compare/nls/messages","orion/compare/compareUtils","orion/webui/littlelib","orion/webui/splitter","text!orion/compare/compare-features.html"],function(g,k,j,b,h){var f=f||{};f.TwoWayCompareUIFactory=function(){function e(b){this._parentDivID=b.parentDivID;this._commandSpanId=b.commandSpanId;this._showTitle=b.showTitle;this._leftTitle=b.leftTitle;this._rightTitle=b.rightTitle;this._showLineStatus=b.showLineStatus}e.prototype={_init:function(){var b=
this._parentDivID+"_";this._topWidgetDiv=j.node("topWidget_id");this._topWidgetDiv.id=b+"topWidget_id";this._leftEditorParentDiv=j.node("left_editor_id");this._leftEditorParentDiv.id=b+"left_editor_id";this._rightEditorParentDiv=j.node("right_editor_id");this._rightEditorParentDiv.id=b+"right_editor_id";this._rightEditorWrapperDiv=j.node("right_editor_wrapper_id");this._rightEditorWrapperDiv.id=b+"right_editor_wrapper_id";this._leftTitleDiv=j.node("left_title_id");this._leftTitleDiv.id=b+"left_title_id";
this._rightTitleDiv=j.node("right_title_id");this._rightTitleDiv.id=b+"right_title_id";this._leftStatusDiv=j.node("left_status_id");this._leftStatusDiv.id=b+"left_status_id";this._rightStatusDiv=j.node("right_status_id");this._rightStatusDiv.id=b+"right_status_id";this._diffCanvasDiv=j.node("diff_canvas_id");this._diffCanvasDiv.id=b+"diff_canvas_id";this._splitterId=b+"orion_splitter";if(!this._showTitle)this._leftEditorParentDiv.style.top="0px",this._rightEditorWrapperDiv.style.top="0px",this._leftTitleDiv.style.height=
"0px",this._rightTitleDiv.style.height="0px";if(!this._showLineStatus)this._leftEditorParentDiv.style.marginBottom="0px",this._rightEditorWrapperDiv.style.marginBottom="0px",this._leftStatusDiv.style.height="0px",this._rightStatusDiv.style.height="0px"},_createSplitter:function(){var 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 b.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(b){return j.$(".leftPanelLayout",this._topWidgetDiv)===b},getEditorParentDiv:function(b){return b?this._leftEditorParentDiv:this._rightEditorParentDiv},getTitleDiv:function(b){return b?this._leftTitleDiv:this._rightTitleDiv},getStatusDiv:function(b){return b?this._leftStatusDiv:this._rightStatusDiv},getCommandSpanId:function(){return this._commandSpanId},
getDiffCanvasDiv:function(){return this._diffCanvasDiv}};return e}();return f});
var JsDiff=function(){function g(b){for(var c=[],a=0;a<b.length;a++)b[a]&&c.push(b[a]);return c}function k(b){b=b.replace(/&/g,"&amp;");b=b.replace(/</g,"&lt;");b=b.replace(/>/g,"&gt;");return b=b.replace(/"/g,"&quot;")}var j=function(b){this.ignoreWhitespace=b};j.prototype={diff:function(b,c){if(c==b)return[{value:c}];if(!c)return[{value:b,removed:!0}];if(!b)return[{value:c,added:!0}];var c=this.tokenize(c),b=this.tokenize(b),a=c.length,i=b.length,e=a+i,f=[{newPos:-1,components:[]}],g=this.extractCommon(f[0],
c,b,0);if(f[0].newPos+1>=a&&g+1>=i)return f[0].components;for(var h=1;h<=e;h++)for(var j=-1*h;j<=h;j+=2){var k;k=f[j-1];var o=f[j+1],g=(o?o.newPos:0)-j;k&&(f[j-1]=void 0);var x=k&&k.newPos+1<a,s=o&&0<=g&&g<i;if(!x&&!s)f[j]=void 0;else if(!x||s&&k.newPos<o.newPos?(k={newPos:o.newPos,components:o.components.slice(0)},this.pushComponent(k.components,b[g],void 0,!0)):(k={newPos:k.newPos,components:k.components.slice(0)},k.newPos++,this.pushComponent(k.components,c[k.newPos],!0,void 0)),g=this.extractCommon(k,
c,b,j),k.newPos+1>=a&&g+1>=i)return k.components;else f[j]=k}},pushComponent:function(b,c,a,i){var e=b[b.length-1];e&&e.added===a&&e.removed===i?b[b.length-1]={value:this.join(e.value,c),added:a,removed:i}:b.push({value:c,added:a,removed:i})},extractCommon:function(b,c,a,i){for(var e=c.length,f=a.length,g=b.newPos,i=g-i;g+1<e&&i+1<f&&this.equals(c[g+1],a[i+1]);)g++,i++,this.pushComponent(b.components,c[g],void 0,void 0);b.newPos=g;return i},equals:function(b,c){var a=/\S/;return this.ignoreWhitespace&&
!a.test(b)&&!a.test(c)?!0:b==c},join:function(b,c){return b+c},tokenize:function(b){return b}};var b=new j,h=new j(!1);h.tokenize=function(b){return g(b.split(/(\s+|\b)/))};var f=new j(!0);f.tokenize=function(b){return g(b.split(/([{}:;,]|\s+)/))};var e=new j;e.tokenize=function(b){return b.split(/^/m)};return{diffChars:function(d,c){return b.diff(d,c)},diffWords:function(b,c){return h.diff(b,c)},diffLines:function(b,c){return e.diff(b,c)},diffCss:function(b,c){return f.diff(b,c)},createPatch:function(b,
c,a,i,f){var g=[];g.push("Index: "+b);g.push("===================================================================");g.push("--- "+b+"\t"+i);g.push("+++ "+b+"\t"+f);b=e.diff(c,a);b.push({value:"",lines:[]});for(var a=c=0,i=[],h=f=1,j=0;j<b.length;j++){var m=b[j],k=m.lines||m.value.replace(/\n$/,"").split("\n");m.lines=k;if(m.added||m.removed){if(!c){var o=b[j-1],c=f,a=h;o&&(i.push.apply(i,o.lines.slice(-4).map(function(a){return" "+a})),c-=4,a-=4)}i.push.apply(i,k.map(function(a){return(m.added?"+":
"-")+a}));m.added?h+=k.length:f+=k.length}else c&&(k.length<=8&&j<b.length-1?i.push.apply(i,k.map(function(a){return" "+a})):(o=Math.min(k.length,4),g.push("@@ -"+c+","+(f-c+o)+" +"+a+","+(h-a+o)+" @@"),g.push.apply(g,i),g.push.apply(g,k.slice(0,o).map(function(a){return" "+a})),a=c=0,i=[])),f+=k.length,h+=k.length}b.length>1&&!/\n$/.test(b[b.length-2].value)&&g.push("\\ No newline at end of file\n");return g.join("\n")},convertChangesToXML:function(b){for(var c=[],a=0;a<b.length;a++){var i=b[a];
i.added?c.push("<ins>"):i.removed&&c.push("<del>");c.push(k(i.value));i.added?c.push("</ins>"):i.removed&&c.push("</del>")}return c.join("")}}}();if(typeof module!=="undefined")module.exports=JsDiff;typeof define==="function"&&define.amd&&define("jsdiff/diff",[],function(){return JsDiff});
define("orion/compare/jsdiffAdapter",["jsdiff/diff"],function(g){var k=k||{};k.JSDiffAdapter=function(){function j(){}j.prototype={adapt:function(b,h,f){f||(f="\n");for(var e=b.split(f),d=h.split(f),c=e[e.length-1]==="",d=d[d.length-1]==="",a=g.diffLines(b,h),b=[],h=[],i=0,l=0,j=-1,k=0,t=!0,m=0;m<a.length;m++){var r=a[m],o=r.lines||r.value.split(f),x=o.length,s=0;o.length>1&&o[o.length-1]===""&&x--;x>1&&!t&&o[0]===""&&(x--,s++);r.lines=o;if(!r.added&&!r.removed){if(i||l)b.push([i,l,j]),l=i=0,j=-1,
k+=l;b.push([x,x,0]);k+=x}else if(r.added){j===-1&&(j=h.length+1);i+=x;for(t=s;t<x+s;t++)h.push(r.lines[t])}else l+=x;t=!1;o.length>1&&o[o.length-1]===""&&(t=!0)}if(i||l)b.push([i,l,j]),k+=l;k<e.length&&e.length>1&&(f=b[b.length-1],f[2]===0?(f[0]+=1,f[1]+=1):f[2]===-1?b.push([1,1,0]):c===d?b.push([1,1,0]):(d&&(f[0]+=1),c&&(f[1]+=1)));return{mapper:b,changContents:{array:h,index:0}}},adaptCharDiff:function(b,h,f){for(var b=f?g.diffWords(b,h):g.diffChars(b,h),h=[],e=f=0,d=0,c=0,a=0;a<b.length;a++){var i=
b[a];if(!i.added&&!i.removed){if(d>0||c>0)h.push([e,e+d,f,f+c]),e+=d,f+=c,c=d=0;e+=i.value.length;f+=i.value.length}else i.added?d+=i.value.length:c+=i.value.length}(d>0||c>0)&&h.push([e,e+d,f,f+c]);return h}};return j}();return k});
define("examples/editor/textStyler",["orion/editor/annotations"],function(g){function k(a,c){this.keywords=a;this.whitespacesVisible=c;this.setText("")}function j(){k.call(this,null,!0)}function b(a){k.call(this,null,a)}function h(){k.call(this,null,!1)}function f(a,i,f){this.commentStart="/*";this.commentEnd="*/";var g=[];switch(i){case "java":g=d;break;case "js":g=e;break;case "css":g=c}this.whitespacesVisible=!1;this.detectHyperlinks=!0;this.highlightCaretLine=!1;this.detectTasks=this.foldingEnabled=
!0;this._scanner=new k(g,this.whitespacesVisible);this._firstScanner=new h;this._commentScanner=new b(this.whitespacesVisible);this._whitespaceScanner=new j;if(i==="css")this._scanner.isCSS=!0,this._firstScanner.isCSS=!0;this.view=a;this.annotationModel=f;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)}};
i=a.getModel();i.getBaseModel&&(i=i.getBaseModel());i.addEventListener("Changed",this._listener.onChanged);a.addEventListener("MouseDown",this._listener.onMouseDown);a.addEventListener("Selection",this._listener.onSelection);a.addEventListener("Destroy",this._listener.onDestroy);a.addEventListener("LineStyle",this._listener.onLineStyle);this._computeComments();this._computeFolding();a.redrawLines()}var e="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(","),
d="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(","),c="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(","),
a={styleClass:"comment"},i={styleClass:"token_multiline_comment"},l={styleClass:"token_doc_comment"},n={styleClass:"token_doc_html_markup"},q={styleClass:"token_task_tag"},t={styleClass:"token_doc_tag"},m={styleClass:"token-string"},r={styleClass:"token_number"},o={styleClass:"token_keyword"},x={styleClass:"token_space"},s={styleClass:"token_tab"},v={styleClass:"line_caret"};k.prototype={getOffset:function(){return this.offset},getStartOffset:function(){return this.startOffset},getData:function(){return this.text.substring(this.startOffset,
this.offset)},getDataLength:function(){return this.offset-this.startOffset},_default:function(a){switch(a){case 32:case 9:if(this.whitespacesVisible)return a===32?11:10;do a=this._read();while(a===32||a===9);this._unread(a);return 9;case 123:case 125:case 40:case 41:case 91:case 93:case 60:case 62:return a;default:var c=this.isCSS,b=this.offset-1;if(!c&&48<=a&&a<=57){var d=c=!1,i=!1,e=a;do if(a=this._read(),a===46&&!c)c=!0;else if(a===101&&!d)c=d=!0,a=this._read(),a!==45&&this._unread(a);else if(a===
120&&e===48&&this.offset-b===2)c=d=i=!0;else if(!(48<=a&&a<=57||i&&(65<=a&&a<=70||97<=a&&a<=102)))break;while(1);this._unread(a);return 3}if(97<=a&&a<=122||65<=a&&a<=90||a===95||45===a&&c){do a=this._read();while(97<=a&&a<=122||65<=a&&a<=90||a===95||48<=a&&a<=57||45===a&&c);this._unread(a);a=this.keywords;if(a.length>0){b=this.text.substring(b,this.offset);for(c=0;c<a.length;c++)if(this.keywords[c]===b)return 2}}return 1}},_read:function(){return this.offset<this.text.length?this.text.charCodeAt(this.offset++):
-1},_unread:function(a){a!==-1&&this.offset--},nextToken:function(){for(this.startOffset=this.offset;;){var a=this._read(),c;switch(a){case -1:return null;case 47:a=this._read();if(!this.isCSS&&a===47)for(;;)if(a=this._read(),a===-1||a===10||a===13)return this._unread(a),6;if(a===42){a=this._read();c=7;for(a===42&&(c=8);;){for(;a===42;)if(a=this._read(),a===47)return c;if(a===-1)return this._unread(a),c;a=this._read()}}this._unread(a);return 1;case 39:for(c=4;;)switch(a=this._read(),a){case 39:return c;
case 13:case 10:case -1:return this._unread(a),c;case 92:switch(a=this._read(),a){case 10:c=5;break;case 13:c=5,a=this._read(),a!==10&&this._unread(a)}}break;case 34:for(c=4;;)switch(a=this._read(),a){case 34:return c;case 13:case 10:case -1:return this._unread(a),c;case 92:switch(a=this._read(),a){case 10:c=5;break;case 13:c=5,a=this._read(),a!==10&&this._unread(a)}}break;default:return this._default(a)}}},setText:function(a){this.text=a;this.startOffset=this.offset=0}};j.prototype=new k(null);j.prototype.nextToken=
function(){for(this.startOffset=this.offset;;){var a=this._read();switch(a){case -1:return null;case 32:return 11;case 9:return 10;default:do a=this._read();while(!(a===32||a===9||a===-1));this._unread(a);return 1}}};b.prototype=new k(null);b.prototype.setType=function(a){this._type=a};b.prototype.nextToken=function(){for(this.startOffset=this.offset;;){var a=this._read();switch(a){case -1:return null;case 32:case 9:if(this.whitespacesVisible)return a===32?11:10;do a=this._read();while(a===32||a===
9);this._unread(a);return 9;case 60:if(this._type===8){do a=this._read();while(!(a===62||a===-1));if(a===62)return 12}return 1;case 64:if(this._type===8){do a=this._read();while(97<=a&&a<=122||65<=a&&a<=90||a===95||48<=a&&a<=57);this._unread(a);return 13}return 1;case 84:if((a=this._read())===79)if((a=this._read())===68)if((a=this._read())===79)if(a=this._read(),!(97<=a&&a<=122||65<=a&&a<=90||a===95||48<=a&&a<=57))return this._unread(a),14;this._unread(a);default:do a=this._read();while(!(a===32||
a===9||a===-1||a===60||a===64||a===84));this._unread(a);return 1}}};h.prototype=new k(null);h.prototype._default=function(a){for(;;)switch(a=this._read(),a){case 47:case 34:case 39:case -1:return this._unread(a),1}};f.prototype={getClassNameForToken:function(c){switch(c){case "singleLineComment":return a.styleClass;case "multiLineComment":return i.styleClass;case "docComment":return l.styleClass;case "docHtmlComment":return n.styleClass;case "tasktag":return q.styleClass;case "doctag":return t.styleClass;
case "string":return m.styleClass;case "number":return r.styleClass;case "keyword":return o.styleClass;case "space":return x.styleClass;case "tab":return s.styleClass;case "caretLine":return v.styleClass;case "rulerStyle":return"ruler";case "annotationsStyle":return;case "rulerFolding":return;case "rulerOverview":return"ruler.overview";case "rulerLines":return;case "rulerLinesEven":return"rulerLines.even";case "rulerLinesOdd":return"rulerLines.odd"}return null},destroy:function(){var a=this.view;
if(a){var c=a.getModel();c.getBaseModel&&(c=c.getBaseModel());c.removeEventListener("Changed",this._listener.onChanged);a.removeEventListener("MouseDown",this._listener.onMouseDown);a.removeEventListener("Selection",this._listener.onSelection);a.removeEventListener("Destroy",this._listener.onDestroy);a.removeEventListener("LineStyle",this._listener.onLineStyle);this.view=null}},setHighlightCaretLine:function(a){this.highlightCaretLine=a},setWhitespacesVisible:function(a){this.whitespacesVisible=a;
this._scanner.whitespacesVisible=a;this._commentScanner.whitespacesVisible=a},setDetectHyperlinks:function(a){this.detectHyperlinks=a},setFoldingEnabled:function(a){this.foldingEnabled=a},setDetectTasks:function(a){this.detectTasks=a},_binarySearch:function(a,c,b,d,i){var e;d===void 0&&(d=-1);if(i===void 0)i=a.length;for(;i-d>1;)if(e=Math.floor((i+d)/2),c<=a[e].start)i=e;else if(b&&c<a[e].end){i=e;break}else d=e;return i},_computeComments:function(){var a=this.view.getModel();a.getBaseModel&&(a=a.getBaseModel());
this.comments=this._findComments(a.getText())},_computeFolding:function(){if(this.foldingEnabled){var a=this.view.getModel();if(a.getBaseModel){var c=this.annotationModel;if(c){c.removeAnnotations(g.AnnotationType.ANNOTATION_FOLDING);for(var b=[],d=a.getBaseModel(),i=this.comments,e=0;e<i.length;e++){var f=i[e];(f=this._createFoldingAnnotation(a,d,f.start,f.end))&&b.push(f)}c.replaceAnnotations(null,b)}}}},_createFoldingAnnotation:function(a,c,b,d){var i=c.getLineAtOffset(b),c=c.getLineAtOffset(d);
return i===c?null:new (g.AnnotationType.getType(g.AnnotationType.ANNOTATION_FOLDING))(b,d,a)},_computeTasks:function(a,c,b){if(this.detectTasks){var d=this.annotationModel;if(d){var i=this.view.getModel(),e=i;i.getBaseModel&&(e=i.getBaseModel());for(var f=d.getAnnotations(c,b),i=[],h=g.AnnotationType.ANNOTATION_TASK;f.hasNext();){var l=f.next();l.type===h&&i.push(l)}f=[];l=this._commentScanner;l.setText(e.getText(c,b));for(var j;j=l.nextToken();){var n=l.getStartOffset()+c;j===14&&(j=e.getLineEnd(e.getLineAtOffset(n)),
a!==6&&(j=Math.min(j,b-this.commentEnd.length)),f.push(g.AnnotationType.createAnnotation(h,n,j,e.getText(n,j))))}d.replaceAnnotations(i,f)}}},_getLineStyle:function(a){if(this.highlightCaretLine){var c=this.view,b=c.getModel(),c=c.getSelection();if(c.start===c.end&&b.getLineAtOffset(c.start)===a)return v}return null},_getStyles:function(a,c,b){a.getBaseModel&&(b=a.mapOffset(b));for(var d=b+c.length,e=[],f=b,g=this.comments,h=this._binarySearch(g,b,!0);h<g.length;h++){if(g[h].start>=d)break;var j=
g[h].start,n=g[h].end;f<j&&this._parse(c.substring(f-b,j-b),f,e);var k=g[h].type,o;switch(k){case 8:o=l;break;case 7:o=i;break;case 5:o=m}f=Math.max(f,j);j=Math.min(d,n);(k===8||k===7)&&(this.whitespacesVisible||this.detectHyperlinks)?this._parseComment(c.substring(f-b,j-b),f,e,o,k):k===5&&this.whitespacesVisible?this._parseString(c.substring(f-b,j-b),f,e,m):e.push({start:f,end:j,style:o});f=n}f<d&&this._parse(c.substring(f-b,d-b),f,e);if(a.getBaseModel)for(c=0;c<e.length;c++)b=e[c].end-e[c].start,
e[c].start=a.mapOffset(e[c].start,!0),e[c].end=e[c].start+b;return e},_parse:function(c,b,d){var e=this._scanner;for(e.setText(c);c=e.nextToken();){var f=e.getStartOffset()+b,g=null;switch(c){case 2:g=o;break;case 3:g=r;break;case 5:case 4:if(this.whitespacesVisible){this._parseString(e.getData(),f,d,m);continue}else g=m;break;case 8:this._parseComment(e.getData(),f,d,l,c);continue;case 6:this._parseComment(e.getData(),f,d,a,c);continue;case 7:this._parseComment(e.getData(),f,d,i,c);continue;case 10:this.whitespacesVisible&&
(g=s);break;case 11:this.whitespacesVisible&&(g=x)}d.push({start:f,end:e.getOffset()+b,style:g})}},_parseComment:function(a,c,b,d,i){var e=this._commentScanner;e.setText(a);for(e.setType(i);a=e.nextToken();){var i=e.getStartOffset()+c,f=d;switch(a){case 10:this.whitespacesVisible&&(f=s);break;case 11:this.whitespacesVisible&&(f=x);break;case 12:f=n;break;case 13:f=t;break;case 14:f=q;break;default:this.detectHyperlinks&&(f=this._detectHyperlinks(e.getData(),i,b,f))}f&&b.push({start:i,end:e.getOffset()+
c,style:f})}},_parseString:function(a,c,b,d){var i=this._whitespaceScanner;for(i.setText(a);a=i.nextToken();){var e=i.getStartOffset()+c,f=d;switch(a){case 10:this.whitespacesVisible&&(f=s);break;case 11:this.whitespacesVisible&&(f=x)}f&&b.push({start:e,end:i.getOffset()+c,style:f})}},_detectHyperlinks:function(a,c,b,d){var i=null,e;if((e=a.indexOf("://"))>0){for(var i=a,f=e;f>0;){e=i.charCodeAt(f-1);if(!(97<=e&&e<=122||65<=e&&e<=90||45===e||48<=e&&e<=57))break;f--}if(f>0&&(e="\"\"''(){}[]<>".indexOf(i.substring(f-
1,f)),e!==-1&&(e&1)===0&&(e=i.lastIndexOf("\"\"''(){}[]<>".substring(e+1,e+2)))!==-1)){var g=e;e=this._clone(d);e.tagName="A";e.attributes={href:i.substring(f,g)};b.push({start:c,end:c+f,style:d});b.push({start:c+f,end:c+g,style:e});b.push({start:c+g,end:c+a.length,style:d});return null}}else a.toLowerCase().indexOf("bug#")===0&&(i="https://bugs.eclipse.org/bugs/show_bug.cgi?id="+parseInt(a.substring(4),10));return i?(e=this._clone(d),e.tagName="A",e.attributes={href:i},e):d},_clone:function(a){if(!a)return a;
var c={},b;for(b in a)a.hasOwnProperty(b)&&(c[b]=a[b]);return c},_findComments:function(a,c){var c=c||0,b=this._firstScanner,d;b.setText(a);for(var i=[];d=b.nextToken();)(d===7||d===8||d===5)&&i.push({start:b.getStartOffset()+c,end:b.getOffset()+c,type:d}),(d===6||d===7||d===8)&&this._computeTasks(d,b.getStartOffset()+c,b.getOffset()+c);return i},_findMatchingBracket:function(a,c){var b="{}()[]<>",d=a.getText(c,c+1),i=b.indexOf(d,0);if(i===-1)return-1;var e;e=i&1?b.substring(i-1,i):b.substring(i+
1,i+2);for(var f=a.getLineAtOffset(c),b=a.getLine(f),g=a.getLineStart(f),h=a.getLineEnd(f),b=this._findBrackets(d,e,b,g,g,h),h=0;h<b.length;h++)if(g=b[h]>=0?1:-1,b[h]*g-1===c){var l=1;if(i&1){for(h--;h>=0;h--)if(g=b[h]>=0?1:-1,l+=g,l===0)return b[h]*g-1;for(f-=1;f>=0;){b=a.getLine(f);g=a.getLineStart(f);h=a.getLineEnd(f);b=this._findBrackets(d,e,b,g,g,h);for(i=b.length-1;i>=0;i--)if(g=b[i]>=0?1:-1,l+=g,l===0)return b[i]*g-1;f--}}else{for(h++;h<b.length;h++)if(g=b[h]>=0?1:-1,l+=g,l===0)return b[h]*
g-1;f+=1;for(i=a.getLineCount();f<i;){b=a.getLine(f);g=a.getLineStart(f);h=a.getLineEnd(f);b=this._findBrackets(d,e,b,g,g,h);for(h=0;h<b.length;h++)if(g=b[h]>=0?1:-1,l+=g,l===0)return b[h]*g-1;f++}}break}return-1},_findBrackets:function(a,c,b,d,i,e){for(var f=[],a=a.charCodeAt(0),c=c.charCodeAt(0),g=i,h=this._scanner,l,j=this.comments,n=this._binarySearch(j,i,!0);n<j.length;n++){if(j[n].start>=e)break;l=j[n].start;var m=j[n].end;if(g<l)for(h.setText(b.substring(g-i,l-i));l=h.nextToken();)l===a?f.push(h.getStartOffset()+
g-i+d+1):l===c&&f.push(-(h.getStartOffset()+g-i+d+1));g=m}if(g<e)for(h.setText(b.substring(g-i,e-i));l=h.nextToken();)l===a?f.push(h.getStartOffset()+g-i+d+1):l===c&&f.push(-(h.getStartOffset()+g-i+d+1));return f},_onDestroy:function(){this.destroy()},_onLineStyle:function(a){if(a.textView===this.view)a.style=this._getLineStyle(a.lineIndex);a.ranges=this._getStyles(a.textView.getModel(),a.lineText,a.lineStart)},_onSelection:function(a){var c=a.oldValue,b=a.newValue,d=this.view,a=d.getModel(),i;if(this.highlightCaretLine){var e=
a.getLineAtOffset(c.start);i=a.getLineAtOffset(b.start);var f=b.start===b.end,c=c.start===c.end;e===i&&c&&f||(c&&d.redrawLines(e,e+1),(e!==i||!c)&&f&&d.redrawLines(i,i+1))}if(this.annotationModel){var c=this._bracketAnnotations,h,l;if(b.start===b.end&&(l=d.getCaretOffset())>0)l-=1,a.getBaseModel&&(l=a.mapOffset(l),a=a.getBaseModel()),a=this._findMatchingBracket(a,l),a!==-1&&(h=[g.AnnotationType.createAnnotation(g.AnnotationType.ANNOTATION_MATCHING_BRACKET,a,a+1),g.AnnotationType.createAnnotation(g.AnnotationType.ANNOTATION_CURRENT_BRACKET,
l,l+1)]);this._bracketAnnotations=h;this.annotationModel.replaceAnnotations(c,h)}},_onMouseDown:function(a){if(a.clickCount===2){var c=this.view,b=c.getModel(),d=c.getOffsetAtLocation(a.x,a.y);if(d>0){var i=d-1,e=b;b.getBaseModel&&(i=b.mapOffset(i),e=b.getBaseModel());i=this._findMatchingBracket(e,i);i!==-1&&(a.preventDefault(),a=i,b.getBaseModel&&(a=b.mapOffset(a,!0)),d>a&&(d--,a++),c.setSelection(a,d))}}},_onModelChanged:function(a){var c=a.start,b=a.removedCharCount,d=a.addedCharCount-b,i=this.view,
a=i.getModel(),e=a.getBaseModel?a.getBaseModel():a,b=c+b,f=e.getCharCount(),h=this.comments.length,l=e.getLineStart(e.getLineAtOffset(c)),j=this._binarySearch(this.comments,l,!0),n=this._binarySearch(this.comments,b,!1,j-1,h);j<h&&this.comments[j].start<=l&&l<this.comments[j].end?(l=this.comments[j].start,l>c&&(l+=d)):l=j===h&&h>0&&f-d===this.comments[h-1].end?this.comments[h-1].start:l;var m;n<h?(m=this.comments[n].end,m>c&&(m+=d),n+=1):(n=h,m=f);for(var k,f=this._findComments(e.getText(l,m),l),
h=j;h<this.comments.length;h++)k=this.comments[h],k.start>c&&(k.start+=d),k.start>c&&(k.end+=d);var o=n-j!==f.length;if(!o)for(h=0;h<f.length;h++){k=this.comments[j+h];var q=f[h];if(k.start!==q.start||k.end!==q.end||k.type!==q.type){o=!0;break}}h=[j,n-j].concat(f);Array.prototype.splice.apply(this.comments,h);o&&(h=l,k=m,a!==e&&(h=a.mapOffset(h,!0),k=a.mapOffset(k,!0)),i.redrawRange(h,k));if(this.foldingEnabled&&e!==a&&this.annotationModel){i=this.annotationModel;j=i.getAnnotations(l,m);l=[];for(m=
[];j.hasNext();)if(k=j.next(),k.type===g.AnnotationType.ANNOTATION_FOLDING){m.push(k);for(h=0;h<f.length;h++)if(k.start===f[h].start&&k.end===f[h].end)break;h===f.length?(l.push(k),k.expand()):(h=k.start,n=k.end,h>c&&(h-=d),n>c&&(n-=d),h<=c&&c<n&&h<=b&&b<n&&(h=e.getLineAtOffset(k.start),n=e.getLineAtOffset(k.end),h!==n?k.expanded||(k.expand(),i.modifyAnnotation(k)):i.removeAnnotation(k)))}c=[];for(h=0;h<f.length;h++){k=f[h];for(d=0;d<m.length;d++)if(m[d].start===k.start&&m[d].end===k.end)break;d===
m.length&&(k=this._createFoldingAnnotation(a,e,k.start,k.end))&&c.push(k)}i.replaceAnnotations(l,c)}}};return{TextStyler:f}});
define("orion/editor/textMateStyler",["orion/editor/regex"],function(g){function k(c,a){var b=a.textView._parent.ownerDocument,d=a._stylesheet=a.util.createElement(b,"style");d.appendChild(b.createTextNode(a._styleSheet(c,"",a.util)));(b.getElementsByTagName("head")[0]||b.documentElement).appendChild(d);a.textView.update(!0)}function j(c,a){var b,d=this;c.getPreferences("/settings",2).then(function(c){if(c.get("JavaScript Editor")!==void 0&&(b=JSON.parse(c.get("JavaScript Editor")))){if(d._stylesheet)d._stylesheet.parentNode.removeChild(d._stylesheet),
d._stylesheet=null;d._update(b,d,a)}})}function b(c,a){for(var b=[],d=0;d<c.length;d++)b[c[d].element]=c[d].value;d=[];d.push("");var e=b.fontFamily,e=e==="sans serif"?'"Menlo", "Consolas", "Vera Mono", "monospace"':"monospace";d.push(a+" .textviewContainer {");d.push("\u0008ackground-color:"+b.background+";");d.push("\tfont-family: "+e+";");d.push("\tfont-size: "+b.fontSize+";");d.push("\tmin-width: 50px;");d.push("\tmin-height: 50px;");d.push("\tcolor: "+b.text+";");d.push("}");d.push(a+" {");d.push("\tfont-family: "+
e+";");d.push("\tfont-size: "+b.fontSize+";");d.push("\tcolor: "+b.text+";");d.push("}");d.push(a+" .textview {");d.push("\tbackground-color: "+b.background+";");d.push("}");d.push(a+".ruler.annotations{");d.push("\tbackground-color: white;");d.push("}");d.push(a+" .ruler {");d.push("\tbackground-color: "+b.annotationRuler+";");d.push("}");d.push(a+" .rulerLines {");d.push("\tcolor: "+b.lineNumber+";");d.push("\tbackground-color: "+b.annotationRuler+";");d.push("}");d.push(a+" .rulerLines.even {");
d.push("\tcolor: "+b.lineNumber+";");d.push("\tbackground-color: "+b.annotationRuler+";");d.push("}");d.push(a+" .rulerLines.odd {");d.push("\tcolor: "+b.lineNumber+";");d.push("\tbackground-color: "+b.annotationRuler+";");d.push("}");d.push(a+" .annotationLine.currentLine {");d.push("\tbackground-color: "+b.currentLine+";");d.push("}");d.push(a+" .entity-name-tag {");d.push("color: "+b.keyword+";");d.push("}");return d.join("\n")}function h(c){var a;if(c instanceof Array){a=Array(c.length);for(var b=
0;b<c.length;b++)a[b]=h(c[b])}else for(b in a={},c)if(Object.prototype.hasOwnProperty.call(c,b)){var d=c[b];a[b]=typeof d==="object"&&d!==null?h(d):d}return a}function f(c,a,d,e,f){this.initialize(c,e);this.grammar=h(a);this.externalGrammars=d?h(d):[];this._styles={};this._tree=null;this._allGrammars={};this.preprocess(this.grammar);this._updateStylesheet=j;this._update=k;this._styleSheet=b;this.util=f}var e,d={unsupported:[{regex:/\(\?[ims\-]:/,func:function(){return"option on/off for subexp"}},
{regex:/\(\?<([=!])/,func:function(c){return c[1]==="="?"lookbehind":"negative lookbehind"}},{regex:/\(\?>/,func:function(){return"atomic group"}}],toRegExp:function(c){function a(a,c){throw Error('Unsupported regex feature "'+a+'": "'+c[0]+'" at index: '+c.index+" in "+c.input);}var b="",e,c=d.processGlobalFlag("x",c,function(a){for(var c="",b=!1,d=a.length,i=0;i<d;){var e=a.charAt(i);if(!b&&e==="#")for(;i<d&&e!=="\r"&&e!=="\n";)e=a.charAt(++i);else if(!b&&/\s/.test(e))for(;i<d&&/\s/.test(e);)e=
a.charAt(++i);else e==="\\"?(c+=e,/\s/.test(a.charAt(i+1))||(c+=a.charAt(i+1),i+=1)):(e==="["?b=!0:e==="]"&&(b=!1),c+=e),i+=1}return c}),c=d.processGlobalFlag("i",c,function(a){b+="i";return a});for(e=0;e<this.unsupported.length;e++){var f;(f=this.unsupported[e].regex.exec(c))&&a(this.unsupported[e].func(f),f)}return RegExp(c,b)},processGlobalFlag:function(c,a,b){function d(a,c){for(var b=0,e=a.length,i=-1,f=c;f<e&&i===-1;f++)switch(a.charAt(f)){case "\\":f++;break;case "(":b++;break;case ")":b--,
b===0&&(i=f)}return i}var e="(?"+c+")",c="(?"+c+":";if(a.substring(0,e.length)===e)return b(a.substring(e.length));else if(a.substring(0,c.length)===c){e=d(a,0);if(e<a.length-1)throw Error("Only a "+c+") group that encloses the entire regex is supported in: "+a);return b(a.substring(c.length,e))}return a},hasBackReference:function(c){return/\\\d+/.test(c.source)},getSubstitutedRegex:function(c,a,b){for(var b=typeof b==="undefined"?!0:!1,c=c.source.split(/(\\\d+)/g),d=[],e=0;e<c.length;e++){var f=
c[e],h=/\\(\d+)/.exec(f);h?(f=a[h[1]]||"",d.push(b?g.escape(f):f)):d.push(f)}return RegExp(d.join(""))},groupify:function(c,a){for(var b=c.source,d=b.length,e=[],f=0,g=[],h=1,j=1,k=[],x={},s={},v=0;v<d;v++){var u=e[e.length-1],y=b.charAt(v);switch(y){case "(":if(u===4)e.pop(),k.push(")"),g[g.length-1].end=v;var A=v+2<d?b.charAt(v+1)+""+b.charAt(v+2):null;if(A==="?:"||A==="?="||A==="?!"){var p;A==="?:"?p=1:(p=3,f++);e.push(p);g.push({start:v,end:-1,type:p});k.push(y);k.push(A);v+=A.length}else e.push(2),
g.push({start:v,end:-1,type:2,oldNum:h,num:j}),k.push(y),f===0&&(s[j]=null),x[h]=j,h++,j++;break;case ")":u=e.pop();u===3&&f--;g[g.length-1].end=v;k.push(y);break;case "*":case "+":case "?":case "}":var w=y,B=b.charAt(v-1),A=v-1;if(y==="}"){for(p=v-1;b.charAt(p)!=="{"&&p>=0;p--);B=b.charAt(p-1);A=p-1;w=b.substring(p,v+1)}p=g[g.length-1];if(B===")"&&(p.type===2||p.type===4)){k.splice(p.start,0,"(");k.push(w);k.push(")");y={start:p.start,end:k.length-1,type:4,num:p.num};for(B=0;B<g.length;B++)if(u=
g[B],(u.type===2||u.type===4)&&u.start>=p.start&&u.end<=A)if(u.start+=1,u.end+=1,u.num+=1,u.type===2)x[u.oldNum]=u.num;g.push(y);j++;break}default:y!=="|"&&u!==2&&u!==4&&f===0&&(e.push(4),g.push({start:v,end:-1,type:4,num:j}),k.push("("),s[j]=null,j++),k.push(y),y==="\\"&&(y=b.charAt(v+1),k.push(y),v+=1)}}for(;e.length;)e.pop(),k.push(")");var b=RegExp(k.join("")),d={},a=a||x,D;for(D in a)a.hasOwnProperty(D)&&(d[D]="\\"+a[D]);b=this.getSubstitutedRegex(b,d,!1);return[b,x,s]},complexCaptures:function(c){if(!c)return!1;
for(var a in c)if(c.hasOwnProperty(a)&&a!=="0")return!0;return!1}};f.prototype={initialize:function(c,a,b){this.textView=c;this.textView.stylerOptions=this;var d=this;this.textView&&a&&a.startup().then(function(a){e=a.preferences;d.preferences=e;d._updateStylesheet(e,b);d.storageKey=e.listenForChangedSettings(d._listener.onStorage)});this._listener={onModelChanged:function(a){d.onModelChanged(a)},onDestroy:function(a){d.onDestroy(a)},onLineStyle:function(a){d.onLineStyle(a)},onStorage:function(a){d.onStorage(a)}};
c.addEventListener("ModelChanged",this._listener.onModelChanged);c.addEventListener("Destroy",this._listener.onDestroy);c.addEventListener("LineStyle",this._listener.onLineStyle);c.redrawLines()},onDestroy:function(){this.destroy()},onStorage:function(c){c.key===this.storageKey&&this._updateStylesheet(this.preferences)},destroy:function(){if(this.textView)this.textView.removeEventListener("ModelChanged",this._listener.onModelChanged),this.textView.removeEventListener("Destroy",this._listener.onDestroy),
this.textView.removeEventListener("LineStyle",this._listener.onLineStyle),this.textView=null;this._listener=this._tree=this._styles=this.grammar=null},preprocess:function(c){for(c=[c];c.length!==0;){var a=c.pop();if(!a._resolvedRule||!a._typedRule)if(a._resolvedRule=this._resolve(a),a._typedRule=this._createTypedRule(a),this.addStyles(a.name),this.addStyles(a.contentName),this.addStylesForCaptures(a.captures),this.addStylesForCaptures(a.beginCaptures),this.addStylesForCaptures(a.endCaptures),a._resolvedRule!==
a&&c.push(a._resolvedRule),a.patterns)for(var b=0;b<a.patterns.length;b++)c.push(a.patterns[b])}},addStyles:function(c){if(c&&!this._styles[c]){this._styles[c]=[];for(var a=c.split("."),b=0;b<a.length;b++)this._styles[c].push(a.slice(0,b+1).join("-"))}},addStylesForCaptures:function(c){for(var a in c)c.hasOwnProperty(a)&&this.addStyles(c[a].name)},ContainerRule:function(){function c(a){this.rule=a;this.subrules=a.patterns}c.prototype.valueOf=function(){return"aa"};return c}(),BeginEndRule:function(){function c(a){this.rule=
a;this.beginRegex=d.toRegExp(a.begin);this.endRegex=d.toRegExp(a.end);this.subrules=a.patterns||[];this.endRegexHasBackRef=d.hasBackReference(this.endRegex);var c=d.complexCaptures(a.captures),a=d.complexCaptures(a.beginCaptures)||d.complexCaptures(a.endCaptures);if(this.isComplex=c||a)c=d.groupify(this.beginRegex),this.beginRegex=c[0],this.beginOld2New=c[1],this.beginConsuming=c[2],c=d.groupify(this.endRegex,this.beginOld2New),this.endRegex=c[0],this.endOld2New=c[1],this.endConsuming=c[2]}c.prototype.valueOf=
function(){return this.beginRegex};return c}(),MatchRule:function(){function c(a){this.rule=a;this.matchRegex=d.toRegExp(a.match);if(this.isComplex=d.complexCaptures(a.captures))a=d.groupify(this.matchRegex),this.matchRegex=a[0],this.matchOld2New=a[1],this.matchConsuming=a[2]}c.prototype.valueOf=function(){return this.matchRegex};return c}(),_createTypedRule:function(c){return c.match?new this.MatchRule(c):c.begin?new this.BeginEndRule(c):new this.ContainerRule(c)},_resolve:function(c){var a=c;if(c.include){if(c.begin||
c.end||c.match)throw Error('Unexpected regex pattern in "include" rule '+c.include);c=c.include;if(c.charAt(0)==="#"){if(a=this.grammar.repository&&this.grammar.repository[c.substring(1)],!a)throw Error("Couldn't find included rule "+c+" in grammar repository");}else if(c==="$self")a=this.grammar;else if(c==="$base")throw Error('Include "$base" is not supported');else if(a=this._allGrammars[c],!a)for(var b=0;b<this.externalGrammars.length;b++){var d=this.externalGrammars[b];if(d.scopeName===c){this.preprocess(d);
a=this._allGrammars[c]=d;break}}}return a},ContainerNode:function(){function c(a,c){this.parent=a;this.rule=c;this.children=[];this.end=this.start=null}c.prototype.addChild=function(a){this.children.push(a)};c.prototype.valueOf=function(){var a=this.rule;return"ContainerNode { "+(a.include||"")+" "+(a.name||"")+(a.comment||"")+"}"};return c}(),BeginEndNode:function(){function c(a,c,b){this.parent=a;this.rule=c;this.children=[];this.setStart(b);this.endMatch=this.end=null;this.endRegexSubstituted=
c.endRegexHasBackRef?d.getSubstitutedRegex(c.endRegex,b):null}c.prototype.addChild=function(a){this.children.push(a)};c.prototype.getIndexInParent=function(){return this.parent?this.parent.children.indexOf(this):-1};c.prototype.setStart=function(a){this.start=a.index;this.beginMatch=a};c.prototype.setEnd=function(a){a&&typeof a==="object"?(this.endMatch=a,this.end=a.index+a[0].length):(this.endMatch=null,this.end=a)};c.prototype.shiftStart=function(a){this.start+=a;this.beginMatch.index+=a};c.prototype.shiftEnd=
function(a){this.end+=a;this.endMatch&&(this.endMatch.index+=a)};c.prototype.valueOf=function(){return"{"+this.rule.beginRegex+" range="+this.start+".."+this.end+"}"};return c}(),push:function(c,a){if(a)for(var b=a.length;b>0;)c.push(a[--b])},exec:function(c,a,b){(a=c.exec(a))&&(a.index+=b);c.lastIndex=0;return a},afterMatch:function(c){return c.index+c[0].length},getEndMatch:function(c,a,b){if(c instanceof this.BeginEndNode){var d=c.rule,c=c.endRegexSubstituted||d.endRegex;return!c?null:this.exec(c,
a,b)}return null},initialParse:function(){this.textView.getModel().getCharCount();this._tree=new this.ContainerNode(null,this.grammar._typedRule);this.parse(this._tree,!1,0)},onModelChanged:function(c){var a=c.addedCharCount,b=c.removedCharCount,c=c.start;if(this._tree){var d=this.textView.getModel(),e=d.getCharCount(),d=d.getLineEnd(d.getLineAtOffset(c)-1),f=this.getFirstDamaged(d,d),d=d===-1?0:d,a=f?this.parse(f,!0,d,c,a,b):e;this.textView.redrawRange(d,a)}else this.initialParse()},getFirstDamaged:function(c,
a){if(c<0)return this._tree;for(var b=[this._tree],d=null;b.length;){var e=b.pop();if(!e.parent||this.isDamaged(e,c,a)){e instanceof this.BeginEndNode&&(d=e);for(var f=0;f<e.children.length;f++)b.push(e.children[f])}}return d||this._tree},isDamaged:function(c,a,b){return c.start<=b&&c.end>a},parse:function(c,a,b,d,e,f){var g=this.textView.getModel(),h=g.getLineStart(g.getLineCount()-1),j=g.getCharCount(),k=this.getInitialExpected(c,b),x=-1;if(a)c.repaired=!0,c.endNeedsUpdate=!0,x=(x=c.children[c.children.length-
1])?g.getLineEnd(g.getLineAtOffset(x.end+(e-f))):-1,d=g.getLineEnd(g.getLineAtOffset(d+f)),x=Math.max(x,d);for(var x=x===-1?j:x,d=k,s=c,v=!1,u=b,y=-1;s&&(!a||u<x);){var A=this.getNextMatch(g,s,u);A||(u=u>=h?j:g.getLineStart(g.getLineAtOffset(u)+1));var p=A&&A.match,w=A&&A.rule,B=A&&A.isEnd;if(A&&A.isSub){if(u=this.afterMatch(p),w instanceof this.BeginEndRule)v=!0,a&&w===d.rule&&s===d.parent?(s=d,s.setStart(p),s.repaired=!0,s.endNeedsUpdate=!0,d=this.getNextExpected(d,"begin")):(a&&(this.prune(s,d),
a=!1),p=new this.BeginEndNode(s,w,p),s.addChild(p),s=p)}else if(B||u===j){if(s instanceof this.BeginEndNode)p?(v=!0,y=Math.max(y,s.end),s.setEnd(p),u=this.afterMatch(p),a&&s===d&&s.parent===d.parent?(s.repaired=!0,delete s.endNeedsUpdate,d=this.getNextExpected(d,"end")):a&&(this.prune(s,d),a=!1)):(s.setEnd(j),delete s.endNeedsUpdate);s=s.parent}a&&u>=x&&!v&&(this.prune(c,k),a=!1)}this.removeUnrepairedChildren(c,a,b);this.cleanup(a,c,b,x,j,e,f);return a?Math.max(y,u):u},removeUnrepairedChildren:function(c,
a,b){if(a){for(var a=c.children,d=-1,e=0;e<a.length;e++){var f=a[e];if(!f.repaired&&this.isDamaged(f,b,Number.MAX_VALUE)){d=e;break}}if(d!==-1)c.children.length=d}},cleanup:function(c,a,b,d,e,f,g){if(c){c=f-g;e=this.getIntersecting(d-c+1,e);a=this.getIntersecting(b,d);for(b=0;b<e.length;b++)d=e[b],!d.repaired&&d instanceof this.BeginEndNode&&(d.shiftEnd(c),d.shiftStart(c));for(b=0;b<a.length;b++)d=a[b],d.repaired&&d.endNeedsUpdate&&d.shiftEnd(c),delete d.endNeedsUpdate,delete d.repaired}else{a=this.getIntersecting(b,
d);for(b=0;b<a.length;b++)delete a[b].repaired}},getNextMatch:function(c,a,b,d){var e=c.getLineAtOffset(b),e=c.getLineEnd(e),f=c.getText(b,e),g=[],h=[],c=[],e=[];for(this.push(g,a.rule.subrules);g.length;){var j=g.length?g.pop():null,j=j&&j._resolvedRule._typedRule;if(j instanceof this.ContainerRule&&h.indexOf(j)===-1)h.push(j),this.push(g,j.subrules);else if(!j||!d||j.matchRegex){var k=j&&this.exec(j.matchRegex||j.beginRegex,f,b);k&&(c.push(k),e.push(j))}}g=Number.MAX_VALUE;h=-1;for(j=0;j<c.length;j++)if(k=
c[j],k.index<g)g=k.index,h=j;if(!d&&(b=this.getEndMatch(a,f,b)))if(d=a.rule.applyEndPatternLast,h===-1||b.index<g||!d&&b.index===g)return{isEnd:!0,rule:a.rule,match:b};return h===-1?null:{isSub:!0,rule:e[h],match:c[h]}},getInitialExpected:function(c,a){var b,d;if(c===this._tree)for(b=0;b<c.children.length;b++){if(d=c.children[b],d.start>=a)return d}else if(c instanceof this.BeginEndNode&&c.endMatch){var e=c.endMatch.index;for(b=0;b<c.children.length;b++)if(d=c.children[b],d.start>=a)break;if(d&&d.start<
e)return d}return c},getNextExpected:function(c,a){if(a==="begin"){var b=c.children[0];return b?b:c}else if(a==="end"&&(b=c.parent)){var d=b.children[b.children.indexOf(c)+1];return d?d:b}return null},prune:function(c,a){if(a.parent===c)c.children.length=a.getIndexInParent();else if(c instanceof this.BeginEndNode)c.endMatch=null,c.end=null;if(c.parent)c.parent.children.length=c.getIndexInParent()+1},onLineStyle:function(c){this._tree||this.initialParse();var a=c.lineStart,b=this.textView.getModel(),
d=b.getLineEnd(c.lineIndex),e=b.getLineEnd(b.getLineAtOffset(a)-1),e=this.getFirstDamaged(e,e),a=this.getLineScope(b,e,a,d);c.ranges=this.toStyleRanges(a);c.ranges.sort(function(a,c){return a.start-c.start})},getLineScope:function(c,a,b,d){for(var e=b,f=this.getInitialExpected(a,b),g=[],h=[];a&&e<d;){var j=this.getNextMatch(c,a,e);if(!j)break;var k=j&&j.match,x=j&&j.rule,s=j&&j.isSub,j=j&&j.isEnd;k.index!==e&&h.push({start:e,end:k.index,node:a});if(s)e=this.afterMatch(k),x instanceof this.BeginEndRule?
(this.addBeginScope(g,k,x),a=f,f=this.getNextExpected(f,"begin")):this.addMatchScope(g,k,x);else if(j)e=this.afterMatch(k),this.addEndScope(g,k,x),f=this.getNextExpected(f,"end"),a=a.parent}e<d&&h.push({start:e,end:d,node:a});c=this.getInheritedLineScope(h,b,d);return g.concat(c)},getInheritedLineScope:function(c){for(var a=[],b=0;b<c.length;b++)for(var d=c[b],e=d.node;e;){var f=e.rule.rule,g=f.name;if(f=f.contentName||g){this.addScopeRange(a,d.start,d.end,f);break}e=e.parent}return a},addBeginScope:function(c,
a,b){var d=b.rule;this.addCapturesScope(c,a,d.beginCaptures||d.captures,b.isComplex,b.beginOld2New,b.beginConsuming)},addEndScope:function(c,a,b){var d=b.rule;this.addCapturesScope(c,a,d.endCaptures||d.captures,b.isComplex,b.endOld2New,b.endConsuming)},addMatchScope:function(c,a,b){var d=b.rule,e=d.name;(d=d.captures)?this.addCapturesScope(c,a,d,b.isComplex,b.matchOld2New,b.matchConsuming):this.addScope(c,a,e)},addScope:function(c,a,b){b&&c.push({start:a.index,end:this.afterMatch(a),scope:b})},addScopeRange:function(c,
a,b,d){d&&c.push({start:a,end:b,scope:d})},addCapturesScope:function(c,a,b,d,e,f){if(b)if(d){for(var d={1:0},g=0,h=1;a[h]!==void 0;h++)f[h]!==void 0&&(g+=a[h].length),a[h+1]!==void 0&&(d[h+1]=g);f=a.index;for(g=1;b[g];g++){var h=b[g].name,j=e[g],k=f+d[j];typeof a[j]!=="undefined"&&this.addScopeRange(c,k,k+a[j].length,h)}}else this.addScope(c,a,b[0]&&b[0].name)},getIntersecting:function(c,a){for(var b=[],d=this._tree?[this._tree]:[];d.length;){var e=d.pop(),f=!1;e instanceof this.ContainerNode?f=!0:
this.isDamaged(e,c,a)&&(f=!0,b.push(e));if(f)for(var f=e.children.length,g=0;g<f;g++)d.push(e.children[g])}return b.reverse()},toStyleRanges:function(c){for(var a=[],b=0;b<c.length;b++){var d=c[b],e=this._styles[d.scope];if(!e)throw Error("styles not found for "+d.scope);e=e.join(" ");a.push({start:d.start,end:d.end,style:{styleClass:e}})}return a}};return{RegexUtil:d,TextMateStyler:f}});
define("orion/editor/AsyncStyler",["i18n!orion/editor/nls/messages","orion/editor/annotations"],function(g,k){function j(b){return b.getProperty("objectClass").indexOf(h)!==-1&&b.getProperty("type")==="highlighter"}function b(b,d,c){this.initialize(b,d,c);this.lineStyles=[]}var h="orion.edit.highlighter",f=h+" service must be an event emitter";k.AnnotationType.registerType("orion.annotation.highlightError",{title:g.syntaxError,html:"<div class='annotationHTML error'></div>",rangeStyle:{styleClass:"annotationRange error"}});
b.prototype={initialize:function(b,d,c){this.textView=b;this.serviceRegistry=d;this.annotationModel=c;this.services=[];var a=this;this.listener={onModelChanging:function(c){a.onModelChanging(c)},onModelChanged:function(c){a.onModelChanged(c)},onDestroy:function(c){a.onDestroy(c)},onLineStyle:function(c){a.onLineStyle(c)},onStyleReady:function(c){a.onStyleReady(c)},onServiceAdded:function(c){a.onServiceAdded(c.serviceReference,a.serviceRegistry.getService(c.serviceReference))},onServiceRemoved:function(c){a.onServiceRemoved(c.serviceReference,
a.serviceRegistry.getService(c.serviceReference))}};b.addEventListener("ModelChanging",this.listener.onModelChanging);b.addEventListener("ModelChanged",this.listener.onModelChanged);b.addEventListener("Destroy",this.listener.onDestroy);b.addEventListener("LineStyle",this.listener.onLineStyle);d.addEventListener("registered",this.listener.onServiceAdded);d.addEventListener("unregistering",this.listener.onServiceRemoved);b=d.getServiceReferences(h);for(c=0;c<b.length;c++){var i=b[c];j(i)&&this.addServiceListener(d.getService(i))}},
onDestroy:function(){this.destroy()},destroy:function(){if(this.textView)this.textView.removeEventListener("ModelChanging",this.listener.onModelChanging),this.textView.removeEventListener("ModelChanged",this.listener.onModelChanged),this.textView.removeEventListener("Destroy",this.listener.onDestroy),this.textView.removeEventListener("LineStyle",this.listener.onLineStyle),this.textView=null;if(this.services){for(var b=0;b<this.services.length;b++)this.removeServiceListener(this.services[b]);this.services=
null}if(this.serviceRegistry)this.serviceRegistry.removeEventListener("registered",this.listener.onServiceAdded),this.serviceRegistry.removeEventListener("unregistering",this.listener.onServiceRemoved),this.serviceRegistry=null;this.lineStyles=this.listener=null},onModelChanging:function(b){this.startLine=this.textView.getModel().getLineAtOffset(b.start)},onModelChanged:function(b){var d=this.startLine;(b.addedLineCount||b.removedLineCount)&&Array.prototype.splice.apply(this.lineStyles,[d,b.removedLineCount].concat(this._getEmptyStyle(b.addedLineCount)))},
onStyleReady:function(b){var d=b.lineStyles||b.style,b=Number.MAX_VALUE,c=-1,a=this.textView.getModel(),i;for(i in d)d.hasOwnProperty(i)&&(this.lineStyles[i]=d[i],b=Math.min(b,i),c=Math.max(c,i));b=Math.max(b,0);c=Math.min(c,a.getLineCount());if(d=this.annotationModel){for(var f=d.getAnnotations(a.getLineStart(b),a.getLineEnd(c)),g=[];f.hasNext();){var h=f.next();h.type==="orion.annotation.highlightError"&&g.push(h)}f=[];for(h=b;h<=c;h++){i=h;var j=this.lineStyles[i],j=j&&j.errors;i=a.getLineStart(i);
if(j)for(var m=0;m<j.length;m++){var r=j[m];f.push(k.AnnotationType.createAnnotation("orion.annotation.highlightError",r.start+i,r.end+i))}}d.replaceAnnotations(g,f)}this.textView.redrawLines(b,c+1)},onLineStyle:function(b){function d(a,c){for(var b=a.length,d=[],e=0;e<b;e++){var f=a[e];d.push({start:f.start+c,end:f.end+c,style:f.style})}return d}var c=this.lineStyles[b.lineIndex];if(c)if(c.ranges)b.ranges=d(c.ranges,b.lineStart);else if(c.style)b.style=c.style},_getEmptyStyle:function(b){for(var d=
[],c=0;c<b;c++)d.push(null);return d},setContentType:function(b){this.contentType=b;if(this.services)for(b=0;b<this.services.length;b++){var d=this.services[b];if(d.setContentType){var c=this.serviceRegistry.getService("orion.page.progress");c?c.progress(d.setContentType(this.contentType),"Styling content type: "+this.contentType.id?this.contentType.id:this.contentType):d.setContentType(this.contentType)}}},onServiceAdded:function(b,d){j(b)&&this.addServiceListener(d)},onServiceRemoved:function(b,
d){this.services.indexOf(d)!==-1&&this.removeServiceListener(d)},addServiceListener:function(b){if(typeof b.addEventListener==="function"){if(b.addEventListener("orion.edit.highlighter.styleReady",this.listener.onStyleReady),this.services.push(b),b.setContentType&&this.contentType){var d=this.serviceRegistry.getService("orion.page.progress");d?d.progress(b.setContentType(this.contentType),"Styling content type: "+this.contentType.id?this.contentType.id:this.contentType):b.setContentType(this.contentType)}}else typeof console!==
"undefined"&&console.log(Error(f))},removeServiceListener:function(b){typeof b.removeEventListener==="function"?(b.removeEventListener("orion.edit.highlighter.styleReady",this.listener.onStyleReady),b=this.services.indexOf(b),b!==-1&&this.services.splice(b,1)):typeof console!=="undefined"&&console.log(Error(f))}};return b});
define("examples/editor/textStylerOptions",["orion/bootstrap","orion/editor/util"],function(g,k){function j(h){this._styler=h;this._view=this._styler.view;this._view.stylerOptions=this;var f=this;this._listener={onStorage:function(b){f._onStorage(b)}};var e=this;this._view&&g.startup().then(function(d){b=d.preferences;e.preferences=b;e._updateStylesheet(b);e.storageKey=b.listenForChangedSettings(e._listener.onStorage)})}var b;j.prototype={_getSetting:function(b,f,e){for(var d,c=0;c<b.length;c++)if(b[c].label===
f)for(var a=0;a<b[c].data.length;a++)if(b[c].data[a].label===e){d=b[c].data[a].value;break}return d},_styleSheet:function(b,f){function e(c,b){var e=i.getClassNameForToken(c);if(e){var g=d[b];a.push("."+f+" ."+e+" {");a.push("\tcolor: "+g+";");a.push("}")}}for(var d=[],c=0;c<b.length;c++)d[b[c].element]=b[c].value;var a=[];a.push("");c=d.fontFamily;c=c==="sans serif"?'"Menlo", "Consolas", "Vera Mono", "monospace"':"monospace";a.push("."+f+" {");a.push("\tfont-family: "+c+";");a.push("\tfont-size: "+
d.fontSize+";");a.push("\tcolor: "+d.text+";");a.push("}");a.push("."+f+" .textview {");a.push("\tbackground-color: "+d.background+";");a.push("}");a.push("."+f+".ruler.annotations{");a.push("\tbackground-color: red;");a.push("}");a.push("."+f+" .ruler {");a.push("\tbackground-color: "+d.annotationRuler+";");a.push("}");a.push("."+f+" .rulerLines {");a.push("\tcolor: "+d.lineNumber+";");a.push("\tbackground-color: "+d.annotationRuler+";");a.push("}");a.push("."+f+" .rulerLines.even {");a.push("\tcolor: "+
d.lineNumber+";");a.push("\tbackground-color: "+d.annotationRuler+";");a.push("}");a.push("."+f+" .rulerLines.odd {");a.push("\tcolor: "+d.lineNumber+";");a.push("\tbackground-color: "+d.annotationRuler+";");a.push("}");a.push("."+f+" .annotationLine.currentLine {");a.push("\tbackground-color: "+d.currentLine+";");a.push("}");var i=this._styler;i.getClassNameForToken&&(e("keyword","keyword"),e("string","string"),e("singleLineComment","comment"),e("multiLineComment","comment"),e("docComment","comment"),
e("docHtmlComment","comment"));return a.join("\n")},_onStorage:function(b){b.key===this.storageKey&&this._updateStylesheet(this.preferences)},_update:function(b,f,e){if(b){if(f._stylesheet)f._stylesheet.parentNode.removeChild(f._stylesheet),f._stylesheet=null;var d=f._view,c=d.getOptions("parent").ownerDocument,a=f._stylesheet=k.createElement(c,"style");a.appendChild(c.createTextNode(f._styleSheet(b,"userTheme",e)));(c.getElementsByTagName("head")[0]||c.documentElement).appendChild(a);b={themeClass:null};
d.getOptions(b);(f=b.themeClass)?((f=f.replace("userTheme",""))&&(f+=" "),f+="userTheme"):f="userTheme";b.themeClass=f;d.setOptions(b);d.update(!0)}},_updateStylesheet:function(b,f){var e,d=this;b.getPreferences("/settings",2).then(function(c){c.get("JavaScript Editor")!==void 0&&(e=JSON.parse(c.get("JavaScript Editor")),d._update(e,d,f))})}};return{TextStylerOptions:j}});
define("orion/highlight","examples/editor/textStyler,orion/editor/textMateStyler,orion/editor/AsyncStyler,examples/editor/textStylerOptions,orion/bootstrap,orion/editor/util,orion/Deferred".split(","),function(g,k,j,b,h,f,e){function d(a,c,d,n,q,t,m){function r(a,b){var f=a.getProperty("contentType"),g=a.getProperty("fileTypes");if(f)return c.isSomeExtensionOf(d,f).then(function(c){return c?a:null});else if(b&&g&&g.indexOf(b)!==-1)return f=new e,f.resolve(a),f;return null}var o=function(a){var c=
null;switch(a&&a.id){case "application/javascript":case "application/json":c=new g.TextStyler(n,"js",q);break;case "text/x-java-source":c=new g.TextStyler(n,"java",q);break;case "text/css":c=new g.TextStyler(n,"css",q)}c&&new b.TextStylerOptions(c);return c}(d);if(o)return t=new e,t.resolve(o),t;for(var o=t&&t.split(".").pop().toLowerCase(),t=a.getServiceReferences("orion.edit.highlighter"),x=[],s=[],v=0;v<t.length;v++){var u=t[v];u.getProperty("type")==="grammar"&&x.push(u.getProperty("grammar"));
(u=r(u,o))&&s.push(u)}return e.all(s,function(a){return{_error:a}}).then(function(c){for(var b,e=c.length-1;e>=0;e--){var i=c[e];if(i&&!i._error&&(m||i.getProperty("type")!=="highlighter")){b=i;break}}var g;if(b)if(c=b.getProperty("type"),c==="highlighter")g=new j(n,a,q),g.setContentType(d);else if(c==="grammar"||typeof c==="undefined")b=b.getProperty("grammar"),g=new k.TextMateStyler(n,b,x,h,f);return g})}function c(a){this.serviceRegistry=a;this.styler=null}c.prototype={setup:function(a,c,b,e,f){f=
typeof f==="undefined"?!0:f;if(this.styler)this.styler.destroy&&this.styler.destroy(),this.styler=null;var g=this;return d(this.serviceRegistry,this.serviceRegistry.getService("orion.core.contenttypes"),a,c,b,e,f).then(function(a){return g.styler=a})},getStyler:function(){return this.styler}};return{createStyler:d,SyntaxHighlighter:c}});
define("orion/compare/diffTreeNavigator",["orion/treeModelIterator","orion/compare/compareUtils","orion/editor/annotations","orion/compare/jsdiffAdapter"],function(g,k,j,b){var h={},f,e,d,c,a,i,l,n,q,t,m,r,o,x,s,v;h.DiffTreeNavigator=function(){function h(a,c,b,d,e,i){this._root={type:"root",children:[]};this._initialized=!1;this.initAll(a,c,b,d,e,i)}f="orion.annotation.diff.addedBlock";e="orion.annotation.diff.currentAddedBlock";d="orion.annotation.diff.deletedBlock";c="orion.annotation.diff.currentDeletedBlock";
a="orion.annotation.diff.blockTop";i="orion.annotation.diff.currentBlockTop";l="orion.annotation.diff.blockConflict";n="orion.annotation.diff.currentBlockConflict";q="orion.annotation.diff.addedWord";t="orion.annotation.diff.currentAddedWord";m="orion.annotation.diff.deletedWord";r="orion.annotation.diff.currentDeletedWord";o="orion.annotation.diff.emptyDeletedWordLeft";x="orion.annotation.diff.emptyDeletedWordRight";s="orion.annotation.diff.emptyAddedWordLeft";v="orion.annotation.diff.emptyAddedWordRight";
j.AnnotationType.registerType(f,{title:"",html:"",lineStyle:{styleClass:"annotationLine addedBlockDiff"}});j.AnnotationType.registerType(e,{title:"",html:"",lineStyle:{styleClass:"annotationLine currentAddedBlockDiff"}});j.AnnotationType.registerType(d,{title:"",html:"",lineStyle:{styleClass:"annotationLine deletedBlockDiff"}});j.AnnotationType.registerType(c,{title:"",html:"",lineStyle:{styleClass:"annotationLine currentDeletedBlockDiff"}});j.AnnotationType.registerType(a,{title:"",html:"",lineStyle:{styleClass:"annotationLine blockDiffTopOnly"}});
j.AnnotationType.registerType(i,{title:"",html:"",lineStyle:{styleClass:"annotationLine currentBlockDiffTopOnly"}});j.AnnotationType.registerType(l,{title:"",html:"",lineStyle:{styleClass:"annotationLine blockDiffConflict"}});j.AnnotationType.registerType(n,{title:"",html:"",lineStyle:{styleClass:"annotationLine currentBlockDiffConflict"}});j.AnnotationType.registerType(q,{title:"word added",html:"",rangeStyle:{styleClass:"annotationRange addedWordDiff"}});j.AnnotationType.registerType(t,{title:"",
html:"",rangeStyle:{styleClass:"annotationRange currentAddedWordDiff"}});j.AnnotationType.registerType(m,{title:"word deleted",html:"",rangeStyle:{styleClass:"annotationRange deletedWordDiff"}});j.AnnotationType.registerType(r,{title:"",html:"",rangeStyle:{styleClass:"annotationRange currentDeletedWordDiff"}});j.AnnotationType.registerType(o,{title:"",html:"",rangeStyle:{styleClass:"annotationRange emptyDeletedWordDiffLeft"}});j.AnnotationType.registerType(x,{title:"",html:"",rangeStyle:{styleClass:"annotationRange emptyDeletedWordDiffRight"}});
j.AnnotationType.registerType(s,{title:"",html:"",rangeStyle:{styleClass:"annotationRange emptyAddedWordDiffLeft"}});j.AnnotationType.registerType(v,{title:"",html:"",rangeStyle:{styleClass:"annotationRange emptyAddedWordDiffRight"}});h.prototype={initAll:function(a,c,b,d,e,i,f){this._charOrWordDiff=a?a:"word";if(c)this._initialized=!0;this.editorWrapper=[{editor:c,diffFeeder:d},{editor:b,diffFeeder:e}];this._curveRuler=f;(this._overviewRuler=i)&&this._overviewRuler.setDiffNavigator(this)},initMapper:function(a){if(a)for(var c=
0;c<this.editorWrapper.length;c++)this.editorWrapper[c].diffFeeder.init(this.editorWrapper[c].editor.getTextView().getModel(),a)},destroy:function(){this.initAll(this._charOrWordDiff)},renderAnnotations:function(){var a;for(a=0;a<this.editorWrapper.length;a++){this.editorWrapper[a].annoTypes=[];this.editorWrapper[a].diffFeeder.getBlockAnnoTypes(this.editorWrapper[a].annoTypes);this.editorWrapper[a].diffFeeder.getWordAnnoTypes(this.editorWrapper[a].annoTypes);for(var c=0;c<this.editorWrapper[a].annoTypes.length;c++)this.editorWrapper[a].annoTypes[c].current&&
this.editorWrapper[a].editor.getAnnotationStyler().addAnnotationType(this.editorWrapper[a].annoTypes[c].current),this.editorWrapper[a].annoTypes[c].normal&&this.editorWrapper[a].editor.getAnnotationStyler().addAnnotationType(this.editorWrapper[a].annoTypes[c].normal)}this._root.children=[];c=this.editorWrapper[0].diffFeeder.getDiffBlocks();if(!c||c.length===0)this.replaceAllAnnotations(!0,0,"block",!1,[]),this.replaceAllAnnotations(!0,1,"block",!1,[]),this.replaceAllAnnotations(!0,0,"word",!1,[]),
this.replaceAllAnnotations(!0,1,"word",!1,[]),this.replaceAllAnnotations(!0,0,"block",!0,[]),this.replaceAllAnnotations(!0,1,"block",!0,[]),this.replaceAllAnnotations(!0,0,"word",!0,[]),this.replaceAllAnnotations(!0,1,"word",!0,[]);else{var d=new b.JSDiffAdapter;for(a=0;a<c.length;a++){var e=this.generatePairBlockAnnotations(this._root,a);this._root.children.push(e);var i=this.generatePairWordAnnotations(e,a,d);if(i)e.children=i}this.replaceAllAnnotations(!1,0,"block",!0);this.replaceAllAnnotations(!1,
1,"block",!0);this.replaceAllAnnotations(!1,0,"word",!0);this.replaceAllAnnotations(!1,1,"word",!0);this.iterator=new g.TreeModelIterator(this._root.children)}},replaceAllAnnotations:function(a,c,b,d,e){if(this.editorWrapper[c].annoTypes)for(var i=0;i<this.editorWrapper[c].annoTypes.length;i++)this.editorWrapper[c].annoTypes[i].type===b&&this.replaceDiffAnnotations(this.editorWrapper[c].editor,e?e:this.editorWrapper[c].annoTypes[i].list,d?this.editorWrapper[c].annoTypes[i].normal:this.editorWrapper[c].annoTypes[i].current,
a)},getMapper:function(){return this.editorWrapper[0].diffFeeder.getMapper()},getFeeder:function(a){return a?this.editorWrapper[1].diffFeeder:this.editorWrapper[0].diffFeeder},iterateOnBlock:function(a,c){this.iterator&&(this.iterator.iterateOnTop(a,c),this.updateCurrentAnnotation(!0))},iterateOnChange:function(a){if(this.iterator){this.iterator.iterate(a);var c=this.iterator.cursor();c.type==="block"&&c.children&&c.children.length>0&&this.iterator.iterate(a);this.updateCurrentAnnotation(!0)}},gotoBlock:function(a,
c){if(this.iterator){if(a<0||a>=this._root.children.length||this._root.children.length===0)a=0;c!==void 0&&c>=0&&this._root.children[a].children&&c<this._root.children[a].children.length?this.iterator.setCursor(this._root.children[a].children[c]):this.iterator.setCursor(this._root.children[a]);this.updateCurrentAnnotation(!1);this._positionDiffBlock()}},_hitDiffAnnotation:function(a,c,b){if(b===this.editorWrapper[a].editor.getTextView()){for(var d=0;d<this._root.children.length;d++){var b=this._root.children[d],
e=a===0?b.oldA:b.newA;if(c>=e.start&&c<=e.end){d=b;if(b.children&&b.children.length>0)for(e=0;e<b.children.length;e++){var i=b.children[e],f=a===0?i.oldA:i.newA;if(c>=f.start&&c<=f.end){d=i;break}}return d}}return null}},gotoChange:function(a,c){for(var b=0;b<this.editorWrapper.length;b++){var d=this._hitDiffAnnotation(b,a,c);if(d)return this.iterator.setCursor(d),this.updateCurrentAnnotation(!1,c),!0}return!1},getCurrentBlockIndex:function(){if(!this.iterator)return-1;var a=this.iterator.cursor();
return!a?-1:a.type==="block"?a.index:a.parent.index},getCurrentPosition:function(){if(!this.iterator)return{};var a=this.iterator.cursor();return a.type==="block"?{block:a.index+1}:{block:a.parent.index+1,change:a.index+1}},getCurrentMapperIndex:function(){var a=this.getCurrentBlockIndex();a<0&&(a=0);var c=this.getFeeder().getDiffBlocks();if(!c||c.length===0)return-1;a>c.length-1&&(a=0);return c[a][1]},replaceDiffAnnotations:function(a,c,b,d){if(c&&b&&(a=a.getAnnotationModel())){for(var e=a.getAnnotations(0,
a.getTextModel().getCharCount()),i=[];d&&e.hasNext();){var f=e.next();f.type===b&&i.push(f)}a.replaceAnnotations(i,c)}},updateCurrentAnnotation:function(a,c){this.replaceAllAnnotations(!0,0,"block",!1,[]);this.replaceAllAnnotations(!0,1,"block",!1,[]);this.replaceAllAnnotations(!0,0,"word",!1,[]);this.replaceAllAnnotations(!0,1,"word",!1,[]);if(this.iterator){var b=this.iterator.cursor();if(b){var d,e,i={start:b.oldA.start,end:b.oldA.end},f={start:b.newA.start,end:b.newA.end};b.type==="word"?(d=this.editorWrapper[0].diffFeeder.getCurrentWordAnnoType(i,
this.editorWrapper[0].editor.getTextView().getModel()),e=this.editorWrapper[1].diffFeeder.getCurrentWordAnnoType(f,this.editorWrapper[1].editor.getTextView().getModel())):(d=this.editorWrapper[0].diffFeeder.getCurrentBlockAnnoType(b.index),e=this.editorWrapper[1].diffFeeder.getCurrentBlockAnnoType(b.index));d&&this.replaceDiffAnnotations(this.editorWrapper[0].editor,[new (j.AnnotationType.getType(d.current))(i.start,i.end)],d,!0);e&&this.replaceDiffAnnotations(this.editorWrapper[1].editor,[new (j.AnnotationType.getType(e.current))(f.start,
f.end)],e,!0);if(a)this.autoSelecting=!0,this.editorWrapper[0].editor.setSelection(b.oldA.start,b.oldA.end,!0),this.editorWrapper[1].editor.setSelection(b.newA.start,b.newA.end,!0),this.autoSelecting=!1;else if(c)this.autoSelecting=!0,c!==this.editorWrapper[0].editor.getTextView()&&this.editorWrapper[0].editor.setSelection(b.oldA.start,b.oldA.end,!0),c!==this.editorWrapper[1].editor.getTextView()&&this.editorWrapper[1].editor.setSelection(b.newA.start,b.newA.end,!0),this.autoSelecting=!1}}},generatePairBlockAnnotations:function(a,
c){var b=this.generateBlockDiffAnnotations(0,c),d=this.generateBlockDiffAnnotations(1,c);return{parent:a,index:c,type:"block",oldA:b,newA:d}},generatePairWordAnnotations:function(a,c,b){var d=this.editorWrapper[0].diffFeeder.getTextOnBlock(c),e=this.editorWrapper[1].diffFeeder.getTextOnBlock(c),c=null,i=0,f=0;if(d&&e&&d.text&&e.text&&d.text.length<=5E3&&e.text.length<=5E3)c=b.adaptCharDiff(d.text,e.text,this._charOrWordDiff==="word"),f=e.start,i=d.start;else return null;b=[];d=[];this.generateWordDiffAnnotations(0,
b,i,c,2,3);this.generateWordDiffAnnotations(1,d,f,c,0,1);c=[];for(i=0;i<b.length;i++)c.push({parent:a,index:i,type:"word",oldA:b[i],newA:d[i]});return c},getAnnoModelList:function(a,c,b){for(var d=0;d<this.editorWrapper[a].annoTypes.length;d++)if(this.editorWrapper[a].annoTypes[d].type===c&&this.editorWrapper[a].annoTypes[d].normal===b)return this.editorWrapper[a].annoTypes[d].list;return null},generateBlockDiffAnnotations:function(a,c){var b=this.editorWrapper[a].diffFeeder.getCurrentBlockAnnoType(c),
d=this.getAnnoModelList(a,"block",b.normal),e=this.editorWrapper[a].diffFeeder.getCharRange(c),b=j.AnnotationType.createAnnotation(b.normal,e.start,e.end);d&&d.push(b);return b},generateWordDiffAnnotations:function(a,c,b,d,e,i){if(d)for(var f=this.editorWrapper[a].diffFeeder.getCurrentWordAnnoType({start:-1,end:-1}),a=this.getAnnoModelList(a,"word",f.normal),g=0;g<d.length;g++){var h=j.AnnotationType.createAnnotation(f.normal,d[g][e]+b,d[g][i]+b);a.push(h);c.push(h)}},_updateOverviewRuler:function(){if(this._overviewRuler){var a=
this.editorWrapper[0].editor.getTextView().getTopIndex();this.editorWrapper[0].editor.getTextView().redrawLines(a,a+1,this._overviewRuler)}},_updateCurveRuler:function(){this._curveRuler&&this._curveRuler.render()},_setTextViewPosition:function(a,c){var b=a.getLineHeight(),d=a.getClientArea(),b=Math.floor(d.height/b/3);a.setTopIndex(c-b>0?c-b:0)},_positionDiffBlock:function(){var a=this.getCurrentBlockIndex();a<0&&(a=0);var c=this.getFeeder().getDiffBlocks();c.length!==0&&(this._setTextViewPosition(this.editorWrapper[0].editor.getTextView(),
c[a][0]),this.editorWrapper[0].editor!==this.editorWrapper[1].editor&&(a=k.lookUpLineIndex(this.getMapper(),0,c[a][1]),this._setTextViewPosition(this.editorWrapper[1].editor.getTextView(),a)),this._updateOverviewRuler(),this._updateCurveRuler())},matchPositionFromOverview:function(a){this._initialized&&this.gotoBlock(a<0?0:k.getAnnotationIndex(this.getFeeder().getDiffBlocks(),a))},gotoDiff:function(a,c){this.gotoChange(a,c)&&(this._updateOverviewRuler(),this._updateCurveRuler())},nextDiff:function(){this.iterateOnBlock(!0,
!0);this._positionDiffBlock()},prevDiff:function(){this.iterateOnBlock(!1,!0);this._positionDiffBlock()},nextChange:function(){this.iterateOnChange(!0);this._positionDiffBlock()},prevChange:function(){this.iterateOnChange(!1);this._positionDiffBlock()}};return h}();h.DiffBlockFeeder=function(){function a(){}a.prototype={getWordAnnoTypes:function(a){this._mapperColumnIndex===0?a.push({type:"word",current:t,normal:q,list:[]}):a.push({type:"word",current:r,normal:m,list:[]});a.push({type:"word",current:o});
a.push({type:"word",current:x});a.push({type:"word",current:s});a.push({type:"word",current:v})},getCurrentWordAnnoType:function(a,c){return a.start===a.end&&c?this._mapperColumnIndex===0?{current:this._repositionEmptyWord(a,c),normal:q}:{current:this._repositionEmptyWord(a,c),normal:m}:this._mapperColumnIndex===0?{current:t,normal:q}:{current:r,normal:m}},_repositionEmptyWord:function(a,c){var b=c.getLineAtOffset(a.start),d=c.getLineStart(b),e=c.getLineEnd(b);if(d!==e){if(a.start===e)return a.start--,
this._mapperColumnIndex===0?v:x;a.end++}else if(b>0&&(b--,d=c.getLineStart(b),e=c.getLineEnd(b),d!==e))return a.start=e-1,a.end=e,this._mapperColumnIndex===0?v:x;return this._mapperColumnIndex===0?s:o},getMapper:function(){return this._mapper},getDiffBlocks:function(){return this._diffBlocks},getDiffBlockH:function(a){if(!this._diffBlocks||this._diffBlocks.length===0)return-1;a=this._diffBlocks[a][1];return a===-1?0:this._mapper[a][this._mapperColumnIndex]},getOverviewLineCount:function(){return this._textModel.getLineCount()},
getLineNumber:function(a){return a},getCharRange:function(a){if(!this._diffBlocks||this._diffBlocks.length===0)return null;var c=this._diffBlocks[a][0],b=c+this._mapper[this._diffBlocks[a][1]][this._mapperColumnIndex]-1,a=this._textModel.getLineStart(c);if(b<c)return{start:a,end:a};c=this._textModel.getLineEnd(b,!0);return{start:a,end:c}},getTextOnBlock:function(a){if(!this._diffBlocks||this._diffBlocks.length===0)return null;a=this.getCharRange(a);return{start:a.start,text:this._textModel.getText(a.start,
a.end)}},isMapperEmpty:function(){return this._mapper.length===0}};return a}();h.TwoWayDiffBlockFeeder=function(){function b(a,c,d){this._mapperColumnIndex=d;this.init(a,c)}b.prototype=new h.DiffBlockFeeder;b.prototype.init=function(a,c){this._textModel=a;this._diffBlocks=void 0;if(c){this._mapper=c;this._diffBlocks=[];for(var b=0,d=0;d<this._mapper.length;d++)this._mapper[d][2]!==0&&this._diffBlocks.push([b,d]),b+=this._mapper[d][this._mapperColumnIndex]}};b.prototype.getBlockAnnoTypes=function(b){this._mapperColumnIndex===
0?b.push({type:"block",normal:f,current:e,list:[]}):b.push({type:"block",normal:d,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{normal:a,current:i};else if(k.isMapperConflict(this.getMapper(),b))return{normal:l,current:n};else if(this._mapperColumnIndex===
0)return{type:"block",normal:f,current:e,list:[]};return{type:"block",normal:d,current:c,list:[]}};return b}();h.inlineDiffBlockFeeder=function(){function a(c,b){this._mapperColumnIndex=b;this.init(c)}a.prototype=new h.DiffBlockFeeder;a.prototype.setModel=function(a){this._textModel=a};a.prototype.init=function(a){this._diffBlocks=void 0;if(a){this._mapper=a;this._diffBlocks=[];this._gapBlocks=[];for(var c=a=0,b=0;b<this._mapper.length;b++){if(this._mapper[b][2]!==0){if(this._mapperColumnIndex===
0){var d=a+this._mapper[b][1];this._diffBlocks.push([d,b]);this._gapBlocks.push([d,d+this._mapper[b][0],c])}else this._diffBlocks.push([a,b]),this._gapBlocks.push([a,a+this._mapper[b][1],c]);a+=this._mapper[b][0]+this._mapper[b][1]}else this._gapBlocks.push([a,a+this._mapper[b][this._mapperColumnIndex],c]),a+=this._mapper[b][this._mapperColumnIndex];c+=this._mapper[b][this._mapperColumnIndex]}}};a.prototype.getBlockAnnoTypes=function(a){this._mapperColumnIndex===0?a.push({type:"block",normal:f,current:e,
list:[]}):a.push({type:"block",normal:d,current:c,list:[]});a.push({type:"block",normal:l,current:n,list:[]})};a.prototype.getCurrentBlockAnnoType=function(a){if(!this._diffBlocks||this._diffBlocks.length===0)return null;a=this._diffBlocks[a][1];if(this._mapper[a][this._mapperColumnIndex]===0)return{current:t,normal:q};else if(k.isMapperConflict(this.getMapper(),a))return{normal:l,current:n};else if(this._mapperColumnIndex===0)return{type:"block",normal:f,current:e,list:[]};return{type:"block",normal:d,
current:c,list:[]}};a.prototype.getDiffBlockH=function(a){if(!this._diffBlocks||this._diffBlocks.length===0)return-1;a=this._diffBlocks[a][1];return this._mapper[a][0]+this._mapper[a][1]};a.prototype.getLineNumber=function(a){for(var c=0;c<this._gapBlocks.length;c++)if(this._gapBlocks[c][0]!==this._gapBlocks[c][1]&&a>=this._gapBlocks[c][0]&&a<this._gapBlocks[c][1])return a-this._gapBlocks[c][0]+this._gapBlocks[c][2];return-1};return a}();return h});
define("orion/compare/compare-rulers",["orion/compare/compareUtils","orion/compare/diffTreeNavigator"],function(g){var k=k||{};k.CompareRuler=function(){function g(b,h,f){this._location=b||"left";this._overview=h||"page";this._rulerStyle=f;this._editor=null;var e=this;this._listener={onModelChanged:function(b){e._onModelChanged(b)}}}g.prototype={setView:function(b){this._onModelChanged&&this._editor&&this._editor.removeEventListener("ModelChanged",this._listener.onModelChanged);this._editor=b;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(b,g){for(var f=[],e=b;e<g;e++){var d=this.getStyle(e);d&&(f[e]={html:this.getHTML(e),style:d})}return f},getWidestAnnotation:function(){return{html:this.getHTML(-1),
style:this.getStyle(-1)}},getRulerStyle:function(){return this.getStyle(void 0)}};return g}();k.LineNumberCompareRuler=function(){function g(b,h,f,e,d,c){k.CompareRuler.call(this,f,"page",e);this._diffNavigator=b;this._oddStyle=d||{style:{backgroundColor:"white"}};this._evenStyle=c||{style:{backgroundColor:"white"}};this._numOfDigits=0;this._mapperColumnIndex=h}g.prototype=new k.CompareRuler;g.prototype.getStyle=function(b){return b===void 0?this._rulerStyle:this._evenStyle};g.prototype.getHTML=function(b){var g=
this._editor.getModel(),f=this._diffNavigator.getFeeder(this._mapperColumnIndex===0);return!f?"":b===-1?g.getLineCount():f.getLineNumber?(b=f.getLineNumber(b),b===-1?"":b+1):b+1};g.prototype._onModelChanged=function(b){var b=b.start,g=this._editor.getModel(),f=g.getLineCount(),e=(f+"").length;if(this._numOfDigits!==e)this._numOfDigits=e,this._editor.redrawLines(g.getLineAtOffset(b),f,this)};return g}();k.CompareOverviewRuler=function(){function j(b,g,f,e){this._diffNavigator=f;this._onClick=e;k.CompareRuler.call(this,
b,"document",g)}j.prototype=new k.CompareRuler;j.prototype.getStyle=function(b){var h,f;if(b===void 0)h=this._rulerStyle||{},f=h.style||(h.style={}),f.lineHeight="1px",f.fontSize="1px",f.width="14px";else if(h=b!==-1?{styleClass:"annotationOverview breakpoint"}:{},f=h.style||(h.style={}),f.cursor="pointer",f.width="8px",f.left="2px",this._editor.getModel(),b>=0){var e;if(this._diffNavigator&&this._diffNavigator.getFeeder())e=this._diffNavigator.getFeeder().getDiffBlocks();else return null;b=g.getAnnotationIndex(e,
b);if(b===-1)return null;e=g.getAnnotationMapperIndex(e,b);var d;d=this._diffNavigator.getMapper();if(e=g.isMapperConflict(d,e))f.border="1px #FF0000 solid";if(b===this._diffNavigator.getCurrentBlockIndex())f.backgroundColor=e?"red":"blue";b=this._diffNavigator.getFeeder().getDiffBlockH(b);e=this._diffNavigator.getFeeder().getOverviewLineCount();if(b<0)return null;d=this._editor.getClientArea();b=Math.floor(d.height*b/e);b<2&&(b=2);f.height=b+"px"}else return f.height="3px";return h};j.prototype.setDiffNavigator=
function(b){this._diffNavigator=b};j.prototype.getHTML=function(){return"&nbsp;"};j.prototype.onClick=function(b){b!==void 0&&this._onClick(b,this)};j.prototype._onModelChanged=function(){this._editor.getModel().getLineCount()>0&&this._editor.redrawLines(0,1,this)};return j}();k.CompareCurveRuler=function(){function j(b){this._canvasDiv=b;this._mapper=void 0;this._initialized=!1}j.prototype={init:function(b,g,f,e){this._initing=this._initialized=!0;this._mapper=b;this._leftEditor=g;this._rightEditor=
f;this._leftTextView=g.getTextView();this._rightTextView=f.getTextView();this._diffNavigator=e;this.render()},matchPositionFrom:function(b){var h=b?this._leftTextView:this._rightTextView,f=b?this._rightTextView:this._leftTextView,e=h.getTopIndex(),h=h.getBottomIndex(),b=g.matchMapper(this._mapper,b?0:1,e,h);f.setTopIndex(b)},copyToLeft:function(){if(this._diffNavigator.iterator){var b=this._diffNavigator.iterator.cursor();b&&this._leftTextView.setText(this._rightTextView.getText(b.oldA.start,b.oldA.end),
b.newA.start,b.newA.end)}},render:function(){if(this._mapper){var b=this._canvasDiv.getContext("2d");b.clearRect(0,0,this._canvasDiv.width,this._canvasDiv.height);b.strokeStyle="#AAAAAA";b.lineWidth=1;b.beginPath();var h=this._leftTextView.getTopIndex(),f=this._leftTextView.getBottomIndex(),e=this._rightTextView.getTopIndex(),d=this._rightTextView.getBottomIndex();this._leftLineH=this._leftTextView.getLineHeight();this._rightLineH=this._rightTextView.getLineHeight();for(var c=0,a=0,i=!1,l=0;l<this._mapper.length;l++){if(this._mapper[l][2]!==
0)if(g.overlapMapper(this._mapper[l],0,c,h,f)||g.overlapMapper(this._mapper[l],1,a,e,d))this._renderCurve(l,c,a,this._canvasDiv,b,h,f,e,d),i=!0;else if(i)break;c+=this._mapper[l][0];a+=this._mapper[l][1]}b.stroke()}},_renderCurve:function(b,g,f,e,d){var c=this._mapper[b],g=this._leftTextView.getLinePixel(g+c[0]/2)+c[0]%2*this._leftLineH/3-this._leftTextView.getTopPixel(),f=this._rightTextView.getLinePixel(f+c[1]/2)+c[1]%2*this._rightLineH/3-this._rightTextView.getTopPixel(),e=e.parentNode.clientWidth;
b===this._diffNavigator.getCurrentMapperIndex()?(d.stroke(),d.strokeStyle="#000",d.lineWidth=1,d.beginPath(),d.moveTo(0,g),d.bezierCurveTo(e/3,g,e*0.666,f,e,f),d.stroke(),d.strokeStyle="#AAAAAA",d.lineWidth=1,d.beginPath()):(d.moveTo(0,g),d.bezierCurveTo(e/3,g,e*0.666,f,e,f),d.stroke())},onChanged:function(b){if(b.removedLineCount!==b.addedLineCount)this._initing||g.updateMapper(this._mapper,0,this._leftTextView.getModel().getLineAtOffset(b.start),b.removedLineCount,b.addedLineCount),this._initing=
!1,(b.removedLineCount>0||b.addedLineCount>0)&&this.render()}};return j}();return k});
define("orion/git/util",["i18n!git/nls/gitmessages"],function(){function g(g){for(var f=0;f<b.length;f++)if(g.type===b[f])return!0;return!1}function k(b){for(var f=0;f<j.length;f++)if(b.type===j[f])return!0;return!1}var j=["Missing","Modified","Untracked","Conflicting"],b=["Added","Changed","Removed"];return{statusUILocation:"git/git-status2.html",isStaged:g,isUnstaged:k,isChange:function(b){return g(b)||k(b)},hasStagedChanges:function(g){for(var f=0;f<b.length;f++)if(g[b[f]].length>0)return!0;return!1},
hasUnstagedChanges:function(b){for(var f=0;f<j.length;f++)if(b[j[f]].length>0)return!0;return!1}}});
define("orion/git/gitPreferenceStorage",["orion/Deferred"],function(g){function k(g){this._prefix="/git/credentials";this._preferenceService=g.getService("orion.core.preference")}k.prototype={put:function(j,b){var h={gitSshUsername:"",gitSshPassword:"",gitPrivateKey:"",gitPassphrase:""};if(b!==void 0){if(b.gitSshUsername!==void 0&&b.gitSshUsername!==null)h.gitSshUsername=b.gitSshUsername;if(b.gitSshPassword!==void 0&&b.gitSshPassword!==null)h.gitSshPassword=b.gitSshPassword;if(b.gitPrivateKey!==void 0&&
b.gitPrivateKey!==null)h.gitPrivateKey=b.gitPrivateKey;if(b.gitPassphrase!==void 0&&b.gitPassphrase!==null)h.gitPassphrase=b.gitPassphrase}var f=new g;this._preferenceService.getPreferences(this._prefix,2).then(function(b){var d=b.get("settings");d===void 0?f.reject():d.enabled?(b.put(j,h),f.resolve()):f.reject()});return f},get:function(j){var b={gitSshUsername:"",gitSshPassword:"",gitPrivateKey:"",gitPassphrase:""},h=new g;this._preferenceService.getPreferences(this._prefix,2).then(function(f){var e=
f.get("settings");e===void 0?h.reject():e.enabled?(f=f.get(j),f!==void 0?h.resolve(f):h.resolve(b)):h.reject()});return h},isEnabled:function(){var j=new g;this._preferenceService.getPreferences(this._prefix,2).then(function(b){b=b.get("settings");b===void 0?j.resolve(!1):j.resolve(b.enabled)});return j},enable:function(){var j=new g;this._preferenceService.getPreferences(this._prefix,2).then(function(b){b.put("settings",{enabled:!0});j.resolve()});return j},disable:function(){var j=new g;this._preferenceService.getPreferences(this._prefix,
2).then(function(b){b.put("settings",{enabled:!1});j.resolve()});return j},remove:function(j){var b=new g;this._preferenceService.getPreferences(this._prefix,2).then(function(g){g.remove(j);b.resolve()});return b},getRepositories:function(){var j=new g;this._preferenceService.getPreferences(this._prefix,2).then(function(b){for(var g=[],b=b.keys(),f=0;f<b.length;++f)b[f]!=="settings"&&g.push(b[f]);j.resolve(g)});return j}};return k.prototype.constructor=k});
define("orion/git/widgets/ConfirmPushDialog",["i18n!git/nls/gitmessages","orion/webui/dialog"],function(g,k){function j(b){this._init(b)}j.prototype=new k.Dialog;j.prototype.TEMPLATE='<div id="header"></div>';j.prototype._init=function(b){var h=this;this.title="Git Push";this.modal=!0;this.messages=g;this.location=b.location;this.dialog2=b.dialog;this.func=b.func;this.buttons=[];this.buttons.push({callback:function(){h.destroy();h.dialog2.show()},text:"More"});this.buttons.push({callback:function(){h.destroy();
h.func()},text:"OK"});this._initialize()};j.prototype._bindToDom=function(){var b=this.$header;b.appendChild(document.createTextNode("You are going to push to the following remote: "+this.location));b.appendChild(document.createElement("br"));b.appendChild(document.createTextNode(" Click More to push to another remote or OK to push to default."))};j.prototype.constructor=j;return{ConfirmPushDialog:j}});
define("orion/git/widgets/ReviewRequestDialog",["i18n!git/nls/gitmessages","orion/webui/dialog"],function(g,k){function j(b){this._init(b)}j.prototype=new k.Dialog;j.prototype.TEMPLATE='<div><div id="treeContentPane" style="padding: 8px"><label for="reviewReqUrl">${Paste link in email or IM}</label><br><input id="reviewReqUrl" style="width: 50em" value=""/></div><div id="newBranchPane" style="padding: 8px"><label for="reviewerName">${Send the link to the reviewer}</label><br><input id="reviewerName" style="width: 30em"  value=""/></div></div>';
j.prototype._init=function(b){var h=this;this.title=b.title||g["Contribution Review Request"];this.modal=!0;this.messages=g;this.url=b.url;this.func=b.func;this.buttons=[];this.buttons.push({callback:function(){h.destroy();h.func(h.$reviewerName.value)},text:"Submit"});this._initialize()};j.prototype._bindToDom=function(){this.$reviewReqUrl.value=this.url};j.prototype.constructor=j;return{ReviewRequestDialog:j}});
define("orion/git/widgets/GitCredentialsDialog",["i18n!git/nls/gitmessages","orion/git/gitPreferenceStorage","orion/webui/dialog"],function(g,k,j){function b(b){this._init(b)}b.prototype=new j.Dialog;b.prototype.TEMPLATE='<div id="gitCredentialsLabel" style="padding: 8px">${Repository URL:}<strong id="url"></strong></div><div id="gitSshUsernameRow" style="padding: 8px"><label id="gitSshUsernameLabel" for="gitSshUsername">${Username:}</label><input id="gitSshUsername" value=""></div><div id="gitSshPasswordRow" style="padding: 8px"><input id="isSshPassword" type="radio" name="isSshPassword" checked value="password"/><label id="gitSshPasswordLabel" for="gitSshPassword" style="padding: 0 8px">${Ssh password:}</label><input type="password" id="gitSshPassword" value="" style="width: 30em"></div><div style="padding: 8px"><div id="gitPrivateKeyRow"><input id="isPrivateKey" type="radio" name="isSshPassword" value="privateKey" style="vertical-align: top"/><label id="gitPrivateKeyLabel" for="gitPrivateKey" style="padding: 0 8px; vertical-align: top">${Private key:}</label><textarea id="gitPrivateKey" value=""></textarea></div><div id="gitPrivateKeyFileRow" style="padding-left: 8em"><label id="gitPrivateKeyFileLabel" for="gitPrivateKeyFile">${Private key file (optional):}</label><br><input id="gitPrivateKeyFile" multiple="false" type="file" size="53" label="Browse..."></div><div id="gitPassphraseRow" style="padding-left: 8em"><label id="gitPassphraseLabel" for="gitPassphrase">${Passphrase (optional):}</label><br><input type="password" id="gitPassphrase" value="" style="width: 30em"></div></div><div id="gitSaveCredentialsRow" style="padding: 8px"><img id="gitSaveCredentialsInfo" src="/images/info.gif""><input id="gitSaveCredentials" type="checkbox" name="gitSaveCredentials"><label id="gitSaveCredentialsLabel" for="gitSaveCredentials">${Don\'t prompt me again:}</label></div>';
b.prototype._init=function(b){var f=this;this.title=b.title||g["Git Credentials"];this.modal=!0;this.messages=g;this.options=b;if(!this.options.username&&!this.options.password&&!this.options.privatekey&&!this.options.passphrase)this.options.username=!0,this.options.password=!0,this.options.privatekey=!0,this.options.passphrase=!0;if(b.serviceRegistry)this._sshService=b.serviceRegistry.getService("orion.net.ssh"),this._progressService=b.serviceRegistry.getService("orion.page.progress");this.buttons=
[];this.buttons.push({callback:function(){f.destroy();f._execute()},text:"OK",isDefault:!0});this._initialize()};b.prototype._bindToDom=function(){var b=this;if(!this.options.username)this.$gitSshUsernameRow.style.display="none";if(!this.options.password)this.$gitSshPasswordRow.style.display="none";if(!this.options.privatekey)this.$gitPrivateKeyRow.style.display="none",this.$gitPrivateKeyFileRow.style.display="none";if(!this.options.passphrase)this.$gitPassphraseRow.style.display="none";if(this.options.errordata&&
this.options.errordata.Url)this.$gitCredentialsLabel.style.display="block",this.$url.textContent=this.options.errordata.Url;if(this.options.errordata&&this.options.errordata.User&&this.options.errordata.User!=="")this.$gitSshUsername.value=this.options.errordata.User,this.$gitSshUsernameRow.style.display="none",setTimeout(function(){b.$gitSshPassword.focus()},400);(new k(this.options.serviceRegistry)).isEnabled().then(function(f){if(!f)b.$gitSaveCredentials.style.display="none",b.$gitSaveCredentialsLabel.style.display=
"none",b.$gitSaveCredentialsInfo.style.display="none"});this.$gitSshPassword.addEventListener("focus",function(){b.$isSshPassword.checked=!0});this.$gitPrivateKey.addEventListener("focus",function(){b.$isPrivateKey.checked=!0});this.$gitPrivateKeyFile.addEventListener("focus",function(){b.$isPrivateKey.checked=!0});this.$gitPassphrase.addEventListener("focus",function(){b.$isPrivateKey.checked=!0});this.$gitPrivateKeyFile.addEventListener("change",function(f){b.privateKeyFile=f.target.files[0]})};
b.prototype._execute=function(){var b=this,f=this.$gitPrivateKey.value,e=this.$url.textContent,d=function(a){if(b._sshService)b._sshService.getKnownHosts().then(function(c){if(b.options.func){var d=typeof b.options.failedOperation==="undefined"?b.options.errordata.failedOperation:b.options.failedOperation;d!=="undefined"&&b._progressService.removeOperation(d);b.options.func({gitSshUsername:b.$gitSshUsername.value,gitSshPassword:b.$isSshPassword.checked?b.$gitSshPassword.value:"",gitPrivateKey:b.$isPrivateKey.checked?
a:"",gitPassphrase:b.$isPrivateKey.checked?b.$gitPassphrase.value:"",knownHosts:c})}});else if(b.options.func){var c=typeof b.options.failedOperation==="undefined"?b.options.errordata.failedOperation:b.options.failedOperation;c!=="undefined"&&b._progressService.removeOperation(c);b.options.func({gitSshUsername:b.$gitSshUsername.value,gitSshPassword:b.$gitSshPassword.value,gitPrivateKey:a,gitPassphrase:b.$gitPassphrase.value,knownHosts:b.$gitSshKnownHosts.value})}};if(this.privateKeyFile){var c=new FileReader;
c.onload=function(){return function(a){f=a.target.result;a=new k(b.options.serviceRegistry);b.$gitSaveCredentials.checked?a.put(e,{gitPrivateKey:f,gitPassphrase:b.$gitPassphrase.value}).then(function(){d(f)}):d(f)}}(this.privateKeyFile);c.readAsText(this.privateKeyFile)}else f.length>0?(c=new k(b.options.serviceRegistry),b.$gitSaveCredentials.checked?c.put(e,{gitPrivateKey:f,gitPassphrase:b.$gitPassphrase.value}).then(function(){d(f)}):d(f)):(c=new k(b.options.serviceRegistry),b.$gitSaveCredentials.checked?
c.put(e,{gitSshUsername:b.$gitSshUsername.value,gitSshPassword:b.$gitSshPassword.value}).then(function(){d(f)}):d(f))};b.prototype.constructor=b;return{GitCredentialsDialog:b}});
define("orion/git/widgets/OpenCommitDialog",["i18n!git/nls/gitmessages","orion/i18nUtil","orion/Deferred","orion/webui/dialog","orion/webui/littlelib"],function(g,k,j,b,h){function f(b){this._init(b)}f.prototype=new b.Dialog;f.prototype.TEMPLATE='<div><label for="resourceName">${Type the commit name (sha1):}</label></div><div><input type="text" id="resourceName"></div><div id="results" style="max-height:400px; height:auto; overflow-y:auto;"></div>';f.prototype._init=function(b){var d=this;this.title=
b.title||g["Find Commit"];this.modal=!0;this.messages=g;this.SEARCH_DELAY=500;this.timeoutId=null;this.time=0;this.serviceRegistry=b.serviceRegistry;if(!this.serviceRegistry)throw Error("Missing required argument: serviceRegistry");this.repositories=b.repositories;if(!this.repositories)throw Error("Missing required argument: repositories");this.commitName=b.commitName;this.buttons=[];this.buttons.push({callback:function(){d.destroy();d._execute()},text:"OK"});this._initialize()};f.prototype._bindToDom=
function(){var b=this;this.$resourceName.addEventListener("input",function(){b.time=+new Date;b.timeoutId&&clearTimeout(b.timeoutId);b.timeoutId=setTimeout(b._checkSearch.bind(b),0)},!1);this.$resourceName.addEventListener("keydown",function(d){if(d.keyCode===h.KEY.ENTER){var c=h.$("a",b.$results);c&&(h.stop(d),window.open(c.href),b.hide())}},!1);this.$resourceName.value=this.commitName};f.prototype._checkSearch=function(){clearTimeout(this.timeoutId);var b=(new Date).getTime();b-this.time>this.SEARCH_DELAY?
(this.time=b,this._doSearch()):this.timeoutId=setTimeout(this._checkSearch.bind(this),50)};f.prototype._findCommitLocation=function(b,d,c){var a=this;c||(c=new j);b.length>0?this.serviceRegistry.getService("orion.page.progress").progress(a.serviceRegistry.getService("orion.git.provider").doGitLog("/gitapi/commit/"+d+b[0].ContentLocation+"?page=1&pageSize=1"),"Getting commit details "+d).then(function(a){c.resolve(a.Children[0])},function(){a._findCommitLocation(b.slice(1),d,c)}):c.reject();return c};
f.prototype._doSearch=function(){var b=this,d=this.$resourceName&&this.$resourceName.value;if(d){var c=document.createElement("div");c.appendChild(document.createTextNode(g["Searching..."]));h.empty(this.$results);this.$results.appendChild(c);this.serviceRegistry.getService("orion.page.message").setProgressMessage(g["Looking for the commit"]);this._findCommitLocation(this.repositories,d).then(function(a){h.empty(b.$results);b._displayCommit(a,b.$results);b.serviceRegistry.getService("orion.page.message").setProgressMessage("")},
function(){var a=document.createElement("div");a.appendChild(document.createTextNode("No commits found"));h.empty(b.$results);b.$results.appendChild(a);b.serviceRegistry.getService("orion.page.message").setProgressMessage("")})}};f.prototype._displayCommit=function(b,d){var c=this,a=document.createElement("div");a.style.padding="10px";a.style.maxWidth="480px";h.empty(d);d.appendChild(a);var i=b.Message.split(/(\r?\n|$)/)[0],f=document.createElement("a");f.className="navlinkonpage";f.href="/git/git-commit.html#"+
b.Location+"?page=1&pageSize=1";f.textContent=i;a.appendChild(f);f.addEventListener("mouseup",function(a){a.button===0&&!a.ctrlKey&&!a.metaKey&&c.hide()},!1);f.addEventListener("keyup",function(a){a.keyCode===h.KEY.ENTER&&c.hide()},!1);f=document.createElement("div");f.style.paddingTop="15px";a.appendChild(f);f=document.createElement("div");a.appendChild(f);i=document.createElement("div");a.appendChild(i);if(b.AuthorImage){a=document.createElement("div");a.style["float"]="left";var j=new Image;j.src=
b.AuthorImage;j.name=b.AuthorName;j.className="git-author-icon";a.appendChild(j);f.appendChild(a)}a=document.createElement("span");a.textContent=k.formatMessage(g[" authored by ${0} {${1}) on ${2}"],b.AuthorName,b.AuthorEmail,(new Date(b.Time)).toLocaleString());i.appendChild(a);f=document.createElement("div");i.appendChild(f);a=document.createElement("span");a.textContent=k.formatMessage(g["committed by 0 (1)"],b.CommitterName,b.CommitterEmail);i.appendChild(a);f=document.createElement("div");f.style.paddingTop=
"15px";i.appendChild(f);a=document.createElement("span");a.textContent=g["commit:"]+b.Name;i.appendChild(a);if(b.Parents&&b.Parents.length>0)f=document.createElement("div"),i.appendChild(f),d=document.createElement("span"),d.textContent=g["parent:"],a=document.createElement("a"),a.className="navlinkonpage",a.href="/git/git-commit.html#"+b.Parents[0].Location+"?page=1&pageSize=1",a.textContent=b.Parents[0].Name,d.appendChild(a),a.addEventListener("mouseup",function(a){a.button===0&&!a.ctrlKey&&!a.metaKey&&
c.hide()},!1),a.addEventListener("keyup",function(a){a.keyCode===h.KEY.ENTER&&c.hide()},!1),i.appendChild(d)};f.prototype._beforeHiding=function(){clearTimeout(this._timeoutId)};f.prototype.constructor=f;return{OpenCommitDialog:f}});
define("orion/git/widgets/CommitDialog",["i18n!git/nls/gitmessages","orion/webui/dialog"],function(g,k){function j(b){this._init(b)}j.prototype=new k.Dialog;j.prototype.TEMPLATE='<div style="display: none; padding-top: 10px; padding-bottom: 10px;" id="commitInfoBar"><strong id="commitInfo"></strong></div><div style="padding:4px"><label id="commitMessageLabel" for="commitMessage">${Message:}</label><input id="commitMessage" style="width: 30em" value=""></div><div style="padding:4px"><label id="amendLabel" for="amend">${Amend:}</label><input id="amend" type="checkbox"></div><div style="padding:4px"><label id="committerNameLabel" for="committerName">${Committer Name:}</label><input id="committerName" style="width: 30em" value=""></div><div style="padding:4px"><label id="committerEmailLabel" for="committerEmail">${Committer Email:}</label><input id="committerEmail" style="width: 30em" value=""></div><div style="padding:4px"><label id="authorNameLabel" for="authorName">${Author Name:}</label><input id="authorName" style="width: 30em" value=""></div><div style="padding:4px"><label id="authorEmailLabel" for="authorEmail">${Author Email:}</label><input id="authorEmail" style="width: 30em" value=""></div>';j.prototype._init=
function(b){var h=this;this.title=g["Commit Changes"];this.modal=!0;this.messages=g;this.options=b;this.buttons=[];this.buttons.push({callback:function(){h._execute()},text:"OK",id:"commitChangesButton"});this._initialize()};j.prototype._bindToDom=function(){var b=this;if(this.options.body.Message)this.$commitMessage.value=this.options.body.Message;this.$commitMessage.addEventListener("keyup",function(){b._validate()});if(this.options.body.Amend)this.$amend.checked=!0;if(this.options.body.CommitterName)this.$committerName.value=
this.options.body.CommitterName;this.$committerName.addEventListener("keyup",function(){b._validate()});if(this.options.body.CommitterEmail)this.$committerEmail.value=this.options.body.CommitterEmail;this.$committerEmail.addEventListener("keyup",function(){b._validate()});if(this.options.body.AuthorName)this.$authorName.value=this.options.body.AuthorName;this.$authorName.addEventListener("keyup",function(){b._validate()});if(this.options.body.AuthorEmail)this.$authorEmail.value=this.options.body.AuthorEmail;
this.$authorEmail.addEventListener("keyup",function(){b._validate()});this._validate()};j.prototype._validate=function(){this.$commitMessage.value?this.$committerName.value?this.$committerEmail.value?this.$authorName.value?this.$authorEmail.value?(this.$commitInfoBar.style.display="none",this.$commitChangesButton.classList.remove(this.DISABLED)):(this.$commitInfoBar.style.display="block",this.$commitChangesButton.classList.add(this.DISABLED),this.$commitInfo.textContent=g["The author mail is required."]):
(this.$commitInfoBar.style.display="block",this.$commitChangesButton.classList.add(this.DISABLED),this.$commitInfo.textContent=g["The author name is required."]):(this.$commitInfoBar.style.display="block",this.$commitChangesButton.classList.add(this.DISABLED),this.$commitInfo.textContent=g["The committer mail is required."]):(this.$commitInfoBar.style.display="block",this.$commitChangesButton.classList.add(this.DISABLED),this.$commitInfo.textContent=g["The committer name is required."]):(this.$commitInfoBar.style.display=
"block",this.$commitChangesButton.classList.add(this.DISABLED),this.$commitInfo.textContent=g["The commit message is required."])};j.prototype._execute=function(){if(!this.$commitChangesButton.classList.contains(this.DISABLED)){if(this.options.func){var b={};b.Message=this.$commitMessage.value;b.Amend=this.$amend.checked?!0:!1;b.CommitterName=this.$committerName.value;b.CommitterEmail=this.$committerEmail.value;b.AuthorName=this.$authorName.value;b.AuthorEmail=this.$authorEmail.value;this.options.func(b)}this.hide()}};
j.prototype.constructor=j;return{CommitDialog:j}});
define("orion/git/widgets/ApplyPatchDialog",["i18n!git/nls/gitmessages","orion/webui/dialog"],function(g,k){function j(b){this._init(b)}j.prototype=new k.Dialog;j.prototype.TEMPLATE='<div style="padding:4px"><input type="radio" name="radio" value="urlRadio" id="urlRadio" checked/>URL:<input type="text" name="url" id="url"/></div><div style="padding:4px"><input type="radio" name="radio" value="fileRadio" id="fileRadio"/>File:<input type="file" name="selectedFile" id="selectedFile" class="uploadChooser" /></div>';j.prototype._init=
function(b){var h=this;this.title=g["Apply Patch"];this.modal=!0;this.messages=g;this.options=b;this.buttons=[];this.buttons.push({callback:function(){h._applyPatch()},text:"OK"});this._initialize()};j.prototype._bindToDom=function(){};j.prototype._applyPatch=function(){var b=new FormData;b.append("uploadedfile",this.$selectedFile.files[0]);b.append("url",this.$url.value);b.append("radio",this.$fileRadio.checked?"fileRadio":"urlRadio");this.req=new XMLHttpRequest;this.req.open("post",this.options.diffLocation);
this.req.onreadystatechange=this.handleReadyState.bind(this);this.req.send(b)};j.prototype.handleReadyState=function(){this.req.readyState===4&&this.hide()};j.prototype.constructor=j;return{ApplyPatchDialog:j}});
define("orion/operation",["orion/xhr","orion/Deferred"],function(g,k){function j(b,f){g("GET",b,{headers:{"Orion-Version":"1"},timeout:15E3}).then(function(e){e=e.response?JSON.parse(e.response):null;f.progress(e);!e.type||e.type==="loadstart"||e.type==="progress"?setTimeout(function(){j(b,f)},2E3):(e.type==="error"||e.type==="abort"?f.reject(e.Result):f.resolve(e.Result.JsonData),e.Location||g("DELETE",b,{headers:{"Orion-Version":"1"},timeout:15E3}))},function(b){var d=b;if(b.responseText!==void 0){d=
b.responseText;try{d=JSON.parse(b.responseText)}catch(c){}}d.Message!==void 0?(d.HttpCode=d.HttpCode===void 0?b.status:d.HttpCode,d.Severity=d.Severity===void 0?"Error":d.Severity,f.reject(d)):f.reject({Severity:"Error",Message:d,HttpCode:b.status})})}function b(b,f){f.then(null,function(e){e instanceof Error&&e.name==="Cancel"&&g("PUT",b,{headers:{"Orion-Version":"1"},data:JSON.stringify({abort:!0}),timeout:15E3})})}return{handle:function(g){var f=new k;b(g,f);j(g,f);return f}}});
define("orion/git/gitClient",["require","orion/xhr","orion/Deferred","orion/operation"],function(g,k,j,b){var h=h||{};h.GitService=function(){function f(b){if(b)this._serviceRegistry=b,this._serviceRegistration=b.registerService("orion.git.provider",this),this._sshService=b.getService("orion.net.ssh")}f.prototype={checkGitService:function(){},cloneGitRepository:function(b,d,c,a,i,f,h,q,t){var m=this,r={};if(b)r.Name=b;if(c)r.Path=c;if(d)r.GitUrl=d;r.Location=a;if(i)r.GitSshUsername=i;if(f)r.GitSshPassword=
f;if(h)r.GitSshKnownHost=h;if(q)r.GitSshPrivateKey=q;if(t)r.GitSshPassphrase=t;var b=g.toUrl("gitapi/clone/._"),b=b.substring(0,b.length-2),o=new j;k("POST",b,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify(r)}).then(function(a){m._getGitServiceResponse(o,a)},function(a){m._handleGitServiceResponseError(o,a)});return o},removeGitRepository:function(b){var d=this,c=new j;k("DELETE",b,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},
timeout:15E3,handleAs:"json"}).then(function(a){d._getGitServiceResponse(c,a)},function(a){d._handleGitServiceResponseError(c,a)});return c},getGitStatus:function(b){var d=this,c=new j;k("GET",b,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json"}).then(function(a){d._getGitServiceResponse(c,a)},function(a){d._handleGitServiceResponseError(c,a)});return c},stage:function(b){var d=this,c=new j;k("PUT",b,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},
timeout:15E3,handleAs:"json"}).then(function(a){d._getGitServiceResponse(c,a)},function(a){d._handleGitServiceResponseError(c,a)});return c},stageMultipleFiles:function(b,d){var c=this,a=new j;k("PUT",b,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify({Path:d})}).then(function(b){c._getGitServiceResponse(a,b)},function(b){c._handleGitServiceResponseError(a,b)});return a},unstageAll:function(b,d){var c=this,a=new j;k("POST",b,{headers:{"Orion-Version":"1",
"Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify({Reset:d})}).then(function(b){c._getGitServiceResponse(a,b)},function(b){c._handleGitServiceResponseError(a,b)});return a},unstage:function(b,d){var c=this,a=new j;k("POST",b,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify({Path:d})}).then(function(b){c._getGitServiceResponse(a,b)},function(b){c._handleGitServiceResponseError(a,b)});return a},checkoutPath:function(b,
d){var c=this,a=new j;k("PUT",b,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify({Path:d,RemoveUntracked:"true"})}).then(function(b){c._getGitServiceResponse(a,b)},function(b){c._handleGitServiceResponseError(a,b)});return a},commitAll:function(b,d,c){var a=this,i=new j;k("POST",b,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json",data:c}).then(function(c){a._getGitServiceResponse(i,c)},function(c){a._handleGitServiceResponseError(i,
c)});return i},getGitClone:function(b){var d=this,c=new j;k("GET",b,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json"}).then(function(a){d._getGitServiceResponse(c,a)},function(a){d._handleGitServiceResponseError(c,a)});return c},getGitCloneConfig:function(b){var d=this,c=new j;k("GET",b,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json"}).then(function(a){d._getGitServiceResponse(c,a)},function(a){d._handleGitServiceResponseError(c,
a)});return c},getGitBranch:function(b){var d=this,c=new j;k("GET",b,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json"}).then(function(a){d._getGitServiceResponse(c,a)},function(a){d._handleGitServiceResponseError(c,a)});return c},getGitRemote:function(b){var d=this,c=new j;k("GET",b,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json"}).then(function(a){d._getGitServiceResponse(c,a)},function(a){d._handleGitServiceResponseError(c,
a)});return c},checkoutBranch:function(b,d){var c=this,a=new j;k("PUT",b,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify({Branch:d})}).then(function(b){c._getGitServiceResponse(a,b)},function(b){c._handleGitServiceResponseError(a,b)});return a},resetIndex:function(b,d){var c=this,a=new j;k("POST",b,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify({Commit:d,Reset:"HARD"})}).then(function(b){c._getGitServiceResponse(a,
b)},function(b){c._handleGitServiceResponseError(a,b)});return a},addBranch:function(b,d,c){var a=this,i={};if(d)i.Name=d;if(c)i.Branch=c;var f=new j;k("POST",b,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify(i)}).then(function(c){a._getGitServiceResponse(f,c)},function(c){a._handleGitServiceResponseError(f,c)});return f},removeBranch:function(b){var d=this,c=new j;k("DELETE",b,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},
timeout:15E3,handleAs:"json"}).then(function(a){d._getGitServiceResponse(c,a)},function(a){d._handleGitServiceResponseError(c,a)});return c},addRemote:function(b,d,c){var a=this,i=new j;k("POST",b,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify({Remote:d,RemoteURI:c})}).then(function(c){a._getGitServiceResponse(i,c)},function(c){a._handleGitServiceResponseError(i,c)});return i},removeRemote:function(b){var d=this,c=new j;k("DELETE",b,
{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json"}).then(function(a){d._getGitServiceResponse(c,a)},function(a){d._handleGitServiceResponseError(c,a)});return c},doGitLog:function(b){var d=this,c=new j;k("GET",b,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json"}).then(function(a){d._getGitServiceResponse(c,a)},function(a){d._handleGitServiceResponseError(c,a)});return c},getDiff:function(b,d){var c=this,a=new j;k("POST",
b,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify({New:d})}).then(function(b){c._getGitServiceResponse(a,b)},function(b){c._handleGitServiceResponseError(a,b)});return a},doFetch:function(b,d,c,a,i,f,g){var h=this,t=new j;k("POST",b,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify({Fetch:"true",Force:d,GitSshUsername:c,GitSshPassword:a,GitSshKnownHost:i,GitSshPrivateKey:f,GitSshPassphrase:g})}).then(function(a){h._getGitServiceResponse(t,
a)},function(a){h._handleGitServiceResponseError(t,a)});return t},doPull:function(b,d,c,a,i,f,g){var h=this,t=new j;k("POST",b,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify({Pull:"true",Force:d,GitSshUsername:c,GitSshPassword:a,GitSshKnownHost:i,GitSshPrivateKey:f,GitSshPassphrase:g})}).then(function(a){h._getGitServiceResponse(t,a)},function(a){h._handleGitServiceResponseError(t,a)});return t},doMerge:function(b,d,c){var a=this,i=new j;
k("POST",b,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify({Merge:d,Squash:c})}).then(function(c){a._getGitServiceResponse(i,c)},function(c){a._handleGitServiceResponseError(i,c)});return i},doCherryPick:function(b,d){var c=this,a=new j;k("POST",b,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify({"Cherry-Pick":d})}).then(function(b){c._getGitServiceResponse(a,b)},function(b){c._handleGitServiceResponseError(a,
b)});return a},doRebase:function(b,d,c){var a=this,i={};i.Rebase=d;if(c)i.Operation=c;var f=new j;k("POST",b,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify(i)}).then(function(c){a._getGitServiceResponse(f,c)},function(c){a._handleGitServiceResponseError(f,c)});return f},doPush:function(b,d,c,a,i,f,g,h,t){var m=this,r=new j;k("POST",b,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify({PushSrcRef:d,
PushTags:c,Force:a,GitSshUsername:i,GitSshPassword:f,GitSshKnownHost:g,GitSshPrivateKey:h,GitSshPassphrase:t})}).then(function(a){m._getGitServiceResponse(r,a)},function(a){m._handleGitServiceResponseError(r,a)});return r},getLog:function(b,d){var c=this,a=new j,i=new j;k("POST",b,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify({New:d})}).then(function(a){i.resolve(a.xhr.getResponseHeader("Location"))},function(b){c._handleGitServiceResponseError(a,
b)});i.then(function(b){k("GET",b,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json"}).then(function(b){c._getGitServiceResponse(a,b)},function(b){c._handleGitServiceResponseError(a,b)})});return a},getDefaultRemoteBranch:function(b){var d=this,c=new j,a=new j;k("GET",b,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json"}).then(function(c){d._getGitServiceResponse(a,c)},function(a){d._handleGitServiceResponseError(c,a)});
a.then(function(a){k("GET",a.Children[0].Location,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json"}).then(function(a){d._getGitServiceResponse(c,a)},function(a){d._handleGitServiceResponseError(c,a)})});return c},doAddTag:function(b,d){var c=this,a=new j;k("PUT",b,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify({Name:d})}).then(function(b){c._getGitServiceResponse(a,b)},function(b){c._handleGitServiceResponseError(a,
b)});return a},doRemoveTag:function(b){var d=this,c=new j;k("DELETE",b,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json"}).then(function(a){d._getGitServiceResponse(c,a)},function(a){d._handleGitServiceResponseError(c,a)});return c},checkoutTag:function(b,d,c){var a=this,i=new j;k("PUT",b,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify({Tag:d,Branch:c})}).then(function(c){a._getGitServiceResponse(i,
c)},function(c){a._handleGitServiceResponseError(i,c)});return i},addCloneConfigurationProperty:function(b,d,c){var a=this,i=new j;k("POST",b,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify({Key:d,Value:c})}).then(function(c){a._getGitServiceResponse(i,c)},function(c){a._handleGitServiceResponseError(i,c)});return i},editCloneConfigurationProperty:function(b,d){var c=this,a=new j;k("PUT",b,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},
timeout:15E3,handleAs:"json",data:JSON.stringify({Value:d})}).then(function(b){c._getGitServiceResponse(a,b)},function(b){c._handleGitServiceResponseError(a,b)});return a},deleteCloneConfigurationProperty:function(b){var d=this,c=new j;k("DELETE",b,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json"}).then(function(a){d._getGitServiceResponse(c,a)},function(a){d._handleGitServiceResponseError(c,a)});return c},sendCommitReviewRequest:function(b,d,c,a,i,f){var g=
this,h=new j;k("POST",d,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify({ReviewReqCommit:b,ReviewReqUrl:a,ReviewReqNotifyLogin:c,ReviewReqAuthorName:i,ReviewMessage:f})}).then(function(a){g._getGitServiceResponse(h,a)},function(a){g._handleGitServiceResponseError(h,a)});return h},_getGitServiceResponse:function(e,d){var c=d.response?JSON.parse(d.response):null;if(d.xhr&&d.xhr.status===202){var a=b.handle(c.Location);a.then(e.resolve,function(a){a.failedOperation=
c.Location;e.reject(a)},e.progress);e.then(null,function(c){a.reject(c)})}else e.resolve(c)},_handleGitServiceResponseError:function(b,d){b.reject(d)}};return f}();return h});
define("orion/links",[],function(){function g(g){this._init(g)}g.prototype={_init:function(g){this._registry=g.serviceRegistry;this._serviceRegistration=this._registry.registerService("orion.core.textlink",this)},_replaceLink:function(g,j,b,h,f){var e=g.search(b);e>0&&(j.appendChild(document.createTextNode(g.substring(0,e))),g=g.substring(e));var b=g.replace(b,""),e=g.substring(0,g.length-b.length),d=e.split(" ",h);if(d.length===h){for(var g=document.createElement("a"),c=0;c<h;c++)f=f.replace("%"+
(c+1),d[c]);g.setAttribute("href",f);g.textContent=e;j.appendChild(g);g=b}return g},addLinks:function(g,j){var b=j||document.createElement("div"),h=this._registry.getServiceReferences("orion.core.linkScanner");if(h.length>0)for(var f=h[0],h=RegExp(f.getProperty("pattern"),"i"),e=f.getProperty("words"),f=f.getProperty("anchor"),d=g.search(h);d>=0;)g=this._replaceLink(g,b,h,e,f),d=g.search(h);g.length>0&&b.appendChild(document.createTextNode(g));return b}};g.prototype.constructor=g;return{TextLinkService:g}});
define("orion/contentTypes",[],function(){function g(b,e){function d(a,c,b,d){var b=c.filename.indexOf(b)>=0,e=c.extension.indexOf(d)>=0;if(b||e)if(!a||b&&a.extension.indexOf(d)>=0)return c;return a}for(var c=b&&b.split(".").pop(),a=null,i=0;i<e.length;i++){var g=e[i];d(a,g,b,c)===g&&(a=g)}return a}function k(f){this.serviceRegistry=f;this.map=function(e){function d(a){return a===null||typeof a==="undefined"?[]:a instanceof Array?a:[a]}for(var e=e.getServiceReferences(b).concat(e.getServiceReferences(h)),
c={},a=0;a<e.length;a++)for(var f=d(e[a].getProperty("contentTypes")),g=0;g<f.length;g++){var j=f[g];c[j.id]||(c[j.id]={id:j.id,name:j.name,image:j.image,"extends":j["extends"],extension:d(j.extension),filename:d(j.filename)})}return c}(f);f.registerService(j,this)}var j="orion.core.contenttypes",b="orion.core.contenttype",h="orion.file.contenttype";k.prototype={getContentTypes:function(){var b=this.getContentTypesMap(),e=[],d;for(d in b)b.hasOwnProperty(d)&&e.push(b[d]);return e},getContentTypesMap:function(){return this.map},
getFileContentType:function(b){return g(b.Name,this.getContentTypes())},getFilenameContentType:function(b){return g(b,this.getContentTypes())},getContentType:function(b){return this.map[b]||null},isExtensionOf:function(b,e){b=typeof b==="string"?this.getContentType(b):b;e=typeof e==="string"?this.getContentType(e):e;if(!b||!e)return!1;if(b.id===e.id)return!0;else for(var d=b,c={};d&&(d=this.getContentType(d["extends"]));){if(d.id===e.id)return!0;if(c[d.id])throw Error("Cycle: "+d.id);c[d.id]=!0}return!1},
isSomeExtensionOf:function(b,e){for(var d=0;d<e.length;d++)if(this.isExtensionOf(b,e[d]))return!0;return!1}};return{ContentTypeService:k,getFilenameContentType:g}});
define("orion/PageUtil",[],function(){var g=/^http[s]?/i;return{matchResourceParameters:function(g){var g=g||window.location.toString(),j={resource:""},b=g.indexOf("#");if(b!==-1&&(g=g.substring(b+1),g.length!==0)){g=g.split(",");Object.defineProperty(j,"resourceRaw",{value:g[0]});j.resource=decodeURIComponent(g[0]);for(b=1;b<g.length;b++){var h=/([^=]*)(=?)(.*)/.exec(g[b]),f=decodeURIComponent(h[1]||""),h=decodeURIComponent(h[3]||"");f!==""&&f!=="resource"&&(j[f]=h)}}return j},validateURLScheme:function(k,
j){var b=k;if(k.indexOf("://")===-1){var h=document.createElement("a");h.href=k;b=h.href}h=!1;return(h=j?j.some(function(f){return RegExp("^"+f+":","i").test(b)}):g.test(b))?k:(console.log("Illegal URL Scheme: '"+k+"'"),"")}}});
define("orion/commands","i18n!orion/nls/messages,require,orion/uiUtils,orion/PageUtil,orion/webui/littlelib,orion/webui/dropdown,orion/webui/tooltip,orion/explorers/navigationUtils".split(","),function(g,k,j,b,h,f,e,d){function c(a,c,b,d,e){this.commandService=a;this.handler=c;this.items=b;this.userData=d;this.command=e;if(e.parameters)this.parameters=e.parameters.makeCopy();this.id=e.id}function a(a){this._commandList={};this._contributionsByScopeId={};this._activeBindings={};this._urlBindings={};
this._init(a);this._parameterCollector=null}function i(a,c,b){c.classList.add("commandImage");var d;a.imageClass?(d=document.createElement("span"),c.appendChild(d),d.classList.add(a.spriteClass),d.classList.add(a.imageClass)):(d=new Image,d.alt=a.name,d.name=b,d.id=b,d.src=a.image,c.appendChild(d));return d}function l(a){this._init(a)}function n(a,c,b,d,e,i,f){this.keyCode=typeof a==="string"?a.toUpperCase().charCodeAt(0):a;this.mod1=c!==void 0&&c!==null?c:!1;this.mod2=b!==void 0&&b!==null?b:!1;this.mod3=
d!==void 0&&d!==null?d:!1;this.mod4=e!==void 0&&e!==null?e:!1;this.domScope=h.node(i);this.scopeName=f||(i?i.id:null)}function q(a,c){this.token=a;this.parameterName=c}function t(a,c,b,d,e){this.name=a;this.type=c;this.label=b;this.value=d;this.lines=e||1}function m(a,c,b){this._storeParameters(a);this._hasOptionalParameters=c&&c.hasOptionalParameters;this._options=c;this.optionsRequested=!1;this.getParameters=b;this.clientCollect=c&&c.clientCollect}var r=window.navigator.platform.indexOf("Mac")!==
-1;c.prototype={collectsParameters:function(){return this.commandService&&this.commandService.collectsParameters()},makeCopy:function(a){var b=new c(this.commandService,this.handler,this.items,this.userData,this.command);b.domNode=this.domNode;b.domParent=this.domParent;if(a)b.parameters=a.makeCopy();else if(this.parameters)b.parameters=this.parameters.makeCopy();return b}};c.prototype.constructor=c;a.prototype={_init:function(a){this._registry=a.serviceRegistry;this._serviceRegistration=this._registry.registerService("orion.page.command",
this);this._defaultSelectionService=a.selection;var c=this;window.document.addEventListener("keydown",function(a){a=a||window.event;if(function(a){if(r){if(a.metaKey&&!a.altKey)return!a.shiftKey&&!a.ctrlKey&&(a.keyCode===65||a.keyCode===67||a.keyCode===86||a.keyCode===88||a.keyCode===90)?!0:!1}else{if(a.ctrlKey&&!a.altKey)return!a.shiftKey&&(a.keyCode===65||a.keyCode===67||a.keyCode===86||a.keyCode===88||a.keyCode===90)?!0:!1;if(a.altKey&&!a.ctrlKey)return!1}if(a["char"])return a["char"].length>0;
else if(a.charCode||a.keyCode)switch(a=a.charCode||a.keyCode,a){case 8:case 9:case 13:case 46:return!0;default:return a>=32&&a<112||a>123}return!1}(a)){if(a.target.contentEditable==="true")return;var b=a.target.nodeName.toLowerCase();if(b==="input")switch(a.target.type.toLowerCase()){case "text":case "password":case "search":case "color":case "date":case "datetime":case "datetime-local":case "email":case "month":case "number":case "range":case "tel":case "time":case "url":case "week":return}else if(b===
"textarea")return}c._processKey(a)},!1)},_processKey:function(a){function c(a){window.document.all?a.keyCode=0:(a.preventDefault(),a.stopPropagation())}for(var b in this._activeBindings)if(this._activeBindings[b]&&this._activeBindings[b].keyBinding&&this._activeBindings[b].command&&this._activeBindings[b].keyBinding.match(a)){var d=this._activeBindings[b],e=d.invocation;if(e)if(d=d.command,d.hrefCallback){c(a);a=d.hrefCallback.call(e.handler||window,e);a.then?a.then(function(a){window.open(a)}):window.open(a);
break}else if(d.callback){c(a);var i=this;window.setTimeout(function(){i._invoke(e)},0);break}}},processURL:function(a){for(var c in this._urlBindings)if(this._urlBindings[c]&&this._urlBindings[c].urlBinding&&this._urlBindings[c].command){var b=this._urlBindings[c].urlBinding.match(a);if(b){var d=this._urlBindings[c],e=d.command,i=d.invocation;if(i&&i.parameters&&e.callback){i.parameters.setValue(b.parameterName,b.parameterValue);var f=this;window.setTimeout(function(){f._invoke(i)},0);break}}}},
findCommand:function(a){return this._commandList[a]},runCommand:function(a,b,d,e){b?(a=this._commandList[a])&&(a.visibleWhen?a.visibleWhen(b):1)&&a.callback&&this._invoke(new c(this,d,b,null,a),e):(b=this._urlBindings[a])&&b.command&&b.command.callback&&this._invoke(b.invocation,e)},getSelectionService:function(){return this._defaultSelectionService},setParameterCollector:function(a){this._parameterCollector=a},openParameterCollector:function(a,c,b){this._parameterCollector&&(this._parameterCollector.close(),
this._parameterCollector.open(a,c,b))},closeParameterCollector:function(){this._parameterCollector&&this._parameterCollector.close()},collectsParameters:function(){return this._parameterCollector},_invoke:function(a,c){return this._collectAndInvoke(a.makeCopy(c),!1)},_collectAndInvoke:function(a,c){if(a)if(this._parameterCollector&&a.parameters&&a.parameters.hasParameters()&&(c||a.parameters.shouldCollectParameters())){var b=!1;a.parameters.updateParameters(a);b=this._parameterCollector.collectParameters(a);
if(!b){var d=new e.Tooltip({node:a.domNode,trigger:"click",position:["below","right","above","left"]}),b=d.contentContainer();b.classList.add("parameterPopup");var i=window.document.activeElement,f=this._parameterCollector.getFillFunction(a,function(){i&&i.focus();d.destroy()})(b);d.show();window.setTimeout(function(){f.focus();f.select()},0);b=!0}b||a.command.callback.call(a.handler||window,a)}else a.command.callback.call(a.handler||window,a);else window.console.log("Client attempted to invoke command without an available (rendered) command invocation")},
collectParameters:function(a){this._collectAndInvoke(a,!0)},showKeyBindings:function(a){var c={},b,d,e,i;for(i in this._activeBindings)if((d=this._activeBindings[i])&&d.keyBinding&&d.command)d.keyBinding.scopeName?(c[d.keyBinding.scopeName]||(c[d.keyBinding.scopeName]=[]),c[d.keyBinding.scopeName].push(d)):(b=j.getUserKeyString(d.keyBinding),e=document.createElement("span"),e.role="listitem",e.appendChild(document.createTextNode(b+" = "+d.command.name)),e.appendChild(document.createElement("br")),
a.appendChild(e));for(var f in c)if(c[f].length&&c[f].length>0){b=document.createElement("h2");a.appendChild(b);b.appendChild(document.createTextNode(f));for(i=0;i<c[f].length;i++)d=c[f][i],b=j.getUserKeyString(d.keyBinding),e=document.createElement("span"),e.role="listitem",e.appendChild(document.createTextNode(b+" = "+d.command.name)),e.appendChild(document.createElement("br")),a.appendChild(e)}},addCommand:function(a){this._commandList[a.id]=a},addCommandGroup:function(a,c,b,d,e,i){this._contributionsByScopeId[a]||
(this._contributionsByScopeId[a]={});a=this._contributionsByScopeId[a];e&&(a=this._createEntryForPath(a,e));if(a[c]){if(d)a[c].title=d;if(b)a[c].position=b;a[c].emptyGroupMessage=i}else a[c]={title:d,position:b,emptyGroupMessage:i,children:{}},a.sortedContributions=null},_createEntryForPath:function(a,c){if(c)for(var b=c.split("/"),d=0;d<b.length;d++)if(b[d].length>1)a[b[d]]||(a[b[d]]={position:0,children:{}}),a=a[b[d]].children;return a},registerSelectionService:function(a,c){this._contributionsByScopeId[a]||
(this._contributionsByScopeId[a]={});this._contributionsByScopeId[a].localSelectionService=c},registerCommandContribution:function(a,c,b,d,e,i,f){this._contributionsByScopeId[a]||(this._contributionsByScopeId[a]={});a=this._contributionsByScopeId[a];d&&(a=this._createEntryForPath(a,d));a[c]={position:b};i&&(b=this._commandList[c])&&(this._activeBindings[c]={command:b,keyBinding:i,bindingOnly:e});f&&(b=this._commandList[c])&&(this._urlBindings[c]={command:b,urlBinding:f,bindingOnly:e});a.sortedContributions=
null},_checkForTrailingSeparator:function(a,c,b){var d;if(c==="tool"||c==="button")if((d=a.childNodes.length>0?a.childNodes[a.childNodes.length-1]:null)&&d.classList.contains("commandSeparator"))return b?(a.removeChild(d),!1):!0;if(c==="menu"&&(a=h.$$array("li > *",a),a.length>0&&a[a.length-1].classList.contains("dropdownSeparator")))if(d=a[a.length-1],b)d.parentNode.parentNode.removeChild(d.parentNode);else return!0;return!1},renderCommands:function(a,c,b,d,e,i,f){if(typeof a!=="string")throw"a scope id for rendering must be specified";
c=h.node(c);if(!c)throw"no parent";var g=this._contributionsByScopeId[a];if(!b&&g){var b=g.localSelectionService||this._defaultSelectionService,j=this;b&&b.getSelections(function(b){j.renderCommands(a,c,b,d,e,i)})}else g&&(this._render(this._contributionsByScopeId[a],c,b,d,e||"button",i,f),this._checkForTrailingSeparator(c,e,!0))},destroy:function(a){a=h.node(a);if(!a)throw"no parent";for(;a.hasChildNodes();){var c=a.firstChild;c.commandTooltip&&c.commandTooltip.destroy();c.emptyGroupTooltip&&c.emptyGroupTooltip.destroy();
this.destroy(c);a.removeChild(c)}},_render:function(a,b,i,f,g,h,j){var l=a.sortedContributions;if(!l){var l=[],k=!1,n;for(n in a)if(!a.hasOwnProperty||a.hasOwnProperty(n)){var m=a[n];if(m&&typeof m.position==="number")m.id=n,l.push(m),k=!0}if(k)l.sort(function(a,c){return a.position-c.position}),a.sortedContributions=l}for(a=0;a<l.length;a++){var q;if(l[a].children&&Object.getOwnPropertyNames(l[a].children).length>0){var m=l[a],k=l[a].children,r=this,t;if(g==="tool"||g==="button")if(m.title){t=this._createDropdownMenu(b,
m.title);j&&d.generateNavGrid(j,t.menuButton);var F=k,G=m;window.setTimeout(function(){r._render(F,t.menu,i,f,"menu",h,j);r._checkForTrailingSeparator(t.menu,"menu",!0);if(t.menu.childNodes.length===0)if(G.emptyGroupMessage){if(!t.menuButton.emptyGroupTooltip)t.menuButton.emptyGroupTooltip=new e.Tooltip({node:t.menuButton,text:G.emptyGroupMessage,trigger:"click",position:["below","right","above","left"]})}else j&&d.removeNavGrid(j,t.menuButton),t.menu.parentNode&&t.menu.parentNode.removeChild(t.menu),
t.destroyButton&&t.destroyButton.parentNode&&t.destroyButton.parentNode.removeChild(t.destroyButton);else t.menuButton.style.visibility="visible"},0)}else{var C;b.childNodes.length>0&&!this._checkForTrailingSeparator(b,g)&&(C=this.generateSeparatorImage(b));r._render(k,b,i,f,g,h,j);b.childNodes.length>0&&b.childNodes[b.childNodes.length-1]!==C&&(C=this.generateSeparatorImage(b))}else m.title?(n=document.createElement("li"),b.appendChild(n),m=this._createDropdownMenu(n,m.title,!0),r._render(k,m.menu,
i,f,"menu",h,j),m.menu.childNodes.length===0&&b.removeChild(n)):(b.childNodes.length>0&&this._generateMenuSeparator(b),r._render(k,b,i,f,g,h,j),this._generateMenuSeparator(b))}else{n=(k=this._commandList[l[a].id])?!0:!1;var H=null,H=null;if(k){q=new c(this,f,i,h,k);q.domParent=b;m=n&&(k.visibleWhen?k.visibleWhen(i):!0);if(this._activeBindings[k.id]&&this._activeBindings[k.id].keyBinding)H=this._activeBindings[k.id],H.invocation=m?q:null,H.bindingOnly&&(n=!1);if(this._urlBindings[k.id]&&this._urlBindings[k.id].urlBinding)H=
this._urlBindings[k.id],H.invocation=m?q:null,H.bindingOnly&&(n=!1);n=n&&m}if(n)if(k.choiceCallback){g==="tool"||g==="button"?(n=b,m=!1,b.nodeName.toLowerCase()==="ul"&&(n=document.createElement("li"),b.appendChild(n))):(n=b,m=!0);var K=this;this._createDropdownMenu(n,k.name,m,function(a){this.populateChoicesMenu(a,i,f,h,K)}.bind(k))}else g==="tool"?(n="tool"+k.id+a,k._addTool(b,n,q,j)):g==="button"?(n="button"+k.id+a,k._addButton(b,n,q,j)):g==="menu"&&k._addMenuItem(b,q,j)}}},_createDropdownMenu:function(a,
c,b,d){var a=h.node(a),e,i=document.createElement("span");i.classList.add("dropdownTrigger");b?(i.classList.add("dropdownMenuItem"),e="dropdownSubMenu",b="dropdownArrowRight",i.tabIndex=0,i.role="menuitem"):(i.classList.add("commandButton"),b="dropdownArrowDown",i.tabIndex=0,i.role="button");c=document.createTextNode(c);i.appendChild(c);c=document.createElement("span");c.classList.add(b);i.appendChild(c);b=a;a.nodeName.toLowerCase()==="ul"?(b=document.createElement("li"),a.appendChild(b),a=b):(i.classList.add("commandMargins"),
a=i);b.appendChild(i);e&&b.classList.add(e);e=document.createElement("ul");b.appendChild(e);e.classList.add("dropdownMenu");i.dropdown=new f.Dropdown({dropdown:e,populate:d});e.dropdown=i.dropdown;return{menuButton:i,menu:e,dropdown:i.dropdown,destroyButton:a}},_generateCheckedMenuItem:function(a,c,b,d){var e=document.createElement("li");a.appendChild(e);a=document.createElement("label");a.classList.add("dropdownMenuItem");var i=document.createElement("input");i.type="checkbox";i.role="menuitem";
i.checked=b;i.classList.add("checkedMenuItem");a.appendChild(i);c=document.createTextNode(c);a.appendChild(c);e.appendChild(a);i.addEventListener("change",d,!1)},_generateMenuSeparator:function(a){if(!this._checkForTrailingSeparator(a,"menu")){var c=document.createElement("li");c.classList.add("dropdownSeparator");var b=document.createElement("span");b.classList.add("dropdownSeparator");c.appendChild(b);a.appendChild(c)}},generateSeparatorImage:function(a){var c;c=a.nodeName.toLowerCase()==="ul"?
document.createElement("li"):document.createElement("span");a.appendChild(c);c.classList.add("core-sprite-sep");c.classList.add("imageSprite");c.classList.add("commandSeparator");return c}};a.prototype.constructor=a;l.prototype={_init:function(a){this.id=a.id;this.name=a.name;this.tooltip=a.tooltip||a.name;this.callback=a.callback;this.hrefCallback=a.hrefCallback;this.choiceCallback=a.choiceCallback;this.image=a.image||k.toUrl("images/none.png");this.imageClass=a.imageClass;this.spriteClass=a.spriteClass||
"commandSprite";this.visibleWhen=a.visibleWhen;this.parameters=a.parameters},_addTool:function(a,c,b,f){b.handler=b.handler||this;var g;if(this.hrefCallback){if(g=this._makeLink(a,b,"commandLink"),!g)return}else g=document.createElement("span"),g.tabIndex=f?-1:0,g.role="button",this.hasImage()?(i(this,g,c),this.name&&g.setAttribute("aria-label",this.name)):(c=window.document.createTextNode(this.name),g.appendChild(c),g.classList.add("commandMissingImageButton"),g.classList.add("commandButton")),this._hookCallback(g,
b);b.domNode=g;b.domParent=a;if(this.tooltip)g.commandTooltip=new e.Tooltip({node:g,text:this.tooltip,position:["above","below","right","left"]});a.nodeName.toLowerCase()==="ul"?(c=document.createElement("li"),a.appendChild(c),a=c):g.classList.add("commandMargins");a.appendChild(g);d.generateNavGrid(f,b.domNode)},_addButton:function(a,c,b,f){b.handler=b.handler||this;var g;if(this.hrefCallback)g=this._makeLink(a,b,"commandLink");else if(!this.name&&this.hasImage()){if(g=document.createElement("span"),
g.tabIndex=0,g.role="button",i(this,g,c),this.tooltip&&g.setAttribute("aria-label",this.tooltip),this._hookCallback(g,b),this.tooltip)g.commandTooltip=new e.Tooltip({node:g,text:this.tooltip,position:["above","below","right","left"]})}else g=this._makeButton(a,b,"commandButton"),this._hookCallback(g,b);b.domParent=a;a.nodeName.toLowerCase()==="ul"?(c=document.createElement("li"),a.appendChild(c),a=c):g.classList.add("commandMargins");a.appendChild(g);d.generateNavGrid(f,b.domNode)},_addMenuItem:function(a,
c,b){c.domParent=a;var e,i=a.dropdown;this.hrefCallback?e=this._makeLink(a,c,"dropdownMenuItem",["right","left","above","below"]):(e=this._makeButton(a,c,"dropdownMenuItem",["right","left","above","below"]),this.callback&&this._hookCallback(e,c,function(){i.close(!0)}));e.role="menuitem";d.generateNavGrid(b,c.domNode);a.nodeName.toLowerCase()==="ul"?(c=document.createElement("li"),a.appendChild(c),a=c):e.classList.add("commandMargins");a.appendChild(e)},_makeButton:function(a,c,b,d){a=document.createElement("span");
a.role="button";a.tabIndex=0;a.id=this.name;var i=document.createTextNode(this.name);a.appendChild(i);b&&a.classList.add(b);if(this.tooltip)a.commandTooltip=new e.Tooltip({node:a,text:this.tooltip,position:d||["above","below","right","left"]});return c.domNode=a},_makeLink:function(a,c,b,d){var i=document.createElement("a");i.id=this.name;b&&i.classList.add(b);i.appendChild(document.createTextNode(this.name));if(this.hrefCallback)a=this.hrefCallback.call(c.handler,c),a.then?a.then(function(a){i.href=
a}):i.href=a?a:"#";if(this.tooltip)i.commandTooltip=new e.Tooltip({node:i,text:this.tooltip,position:d||["above","below","right","left"]});return c.domNode=i},_hookCallback:function(a,c,b,d){a.addEventListener("click",function(a){b&&b();c.commandService._invoke(c);d&&d();h.stop(a)},!1);a.addEventListener("keydown",function(a){if(a.keyCode===h.KEY.ENTER||a.keyCode===h.KEY.SPACE)b&&b(),c.commandService._invoke(c),d&&d(),h.stop(a)},!1)},populateChoicesMenu:function(a,c,b,d,e){b=this.getChoices(c,b,d);
for(d=0;d<b.length;d++){var i=b[d];if(i.name){var f=document.createElement("li");a.appendChild(f);var g=document.createElement("span");g.tabIndex=0;g.role="menuitem";g.classList.add("dropdownMenuItem");var j=document.createTextNode(i.name);g.appendChild(j);f.appendChild(g);g.choice=i;g.addEventListener("click",function(a){a.target.choice&&a.target.choice.callback.call(a.target.choice,c)},!1);g.addEventListener("keydown",function(a){(a.keyCode===h.KEY.ENTER||a.keyCode===h.KEY.SPACE)&&a.target.choice&&
a.target.choice.callback.call(a.target.choice,c)},!1)}else e._generateMenuSeparator(a)}},getChoices:function(a,c,b){return this.choiceCallback?this.choiceCallback.call(c,a,b):null},makeChoiceCallback:function(a,c){return function(b){a.callback&&a.callback.call(a,c,b)}},hasImage:function(){return this.imageClass||this.image!==k.toUrl("images/none.png")}};l.prototype.constructor=l;n.prototype={match:function(a){if(this.keyCode===a.keyCode){if(this.mod1!==(r?a.metaKey:a.ctrlKey))return!1;if(this.mod2!==
a.shiftKey)return!1;if(this.mod3!==a.altKey)return!1;if(r&&this.mod4!==a.ctrlKey)return!1;if(!this.domScope)return!0;for(a=a.target;a;){if(a===window.document)break;if(a===this.domScope)return!0;a=a.parentNode}}return!1},equals:function(a){return!a?!1:this.keyCode!==a.keyCode?!1:this.mod1!==a.mod1?!1:this.mod2!==a.mod2?!1:this.mod3!==a.mod3?!1:this.mod4!==a.mod4?!1:this.domScope!==a.domScope?!1:!0}};n.prototype.constructor=n;q.prototype={match:function(a){a=b.matchResourceParameters(a);return typeof a[this.token]!==
"undefined"?(this.parameterValue=a[this.token],this):null}};q.prototype.constructor=q;t.prototype={optionsRequested:function(){return this.optionsRequested}};t.prototype.constructor=t;m.prototype={_storeParameters:function(a){this.parameterTable=null;if(a){this.parameterTable={};for(var c=0;c<a.length;c++)this.parameterTable[a[c].name]=a[c]}},updateParameters:function(a){typeof this.getParameters==="function"&&this._storeParameters(this.getParameters(a))},hasParameters:function(){return this.parameterTable!==
null},shouldCollectParameters:function(){return!this.clientCollect&&this.hasParameters()},parameterNamed:function(a){return this.parameterTable[a]},valueFor:function(a){return(a=this.parameterTable[a])?a.value:null},setValue:function(a,c){var b=this.parameterTable[a];if(b)b.value=c},forEach:function(a){for(var c in this.parameterTable)this.parameterTable[c].type&&this.parameterTable[c].name&&a(this.parameterTable[c])},makeCopy:function(){var a=[];this.forEach(function(c){c=new t(c.name,c.type,c.label,
c.value,c.lines);a.push(c)});var c=new m(a,this._options,this.getParameters);c.clientCollect=this.clientCollect;return c},hasOptionalParameters:function(){return this._hasOptionalParameters}};m.prototype.constructor=m;return{CommandService:a,CommandKeyBinding:n,Command:l,CommandInvocation:c,URLBinding:q,ParametersDescription:m,CommandParameter:t}});
define("orion/operationsCommands",["i18n!orion/operations/nls/messages","require","orion/webui/littlelib","orion/commands"],function(g,k,j,b){var h={};(function(){var f=!1;h.updateNavTools=function(b,d,c,a,i){var h=b.getService("orion.page.command"),k=j.node(c);if(k)h.destroy(k);else throw g["could not find toolbar "]+c;h.renderCommands(c,k,i,d,"button");if(a&&(c=j.node(a)))h.destroy(c),h.renderCommands(a,c,null,d,"button");f||(f=!0,b.getService("orion.page.selection").addEventListener("selectionChanged",
function(c){var i=j.node(a);if(i){var f=b.getService("orion.page.command");f.destroy(i);f.renderCommands(a,i,c.selections,d,"button")}}))};h.createOperationsCommands=function(e,d,c){function a(a){return!a.operation||!a.operation.type?!1:a.operation.type==="loadstart"||a.operation.type==="progress"}var i=new b.Command({name:g["Remove Completed"],tooltip:g["Remove all completed operations"],id:"eclipse.removeCompletedOperations",callback:function(){c.removeCompletedOperations().then(function(){d.loadOperations.bind(d)()})},
visibleWhen:function(){return!0}});e.addCommand(i);i=new b.Command({name:g.Remove,tooltip:g["Remove operations from the operations list."],imageClass:"core-sprite-delete",id:"eclipse.removeOperation",callback:function(a){for(var a=Array.isArray(a.items)?a.items:[a.items],b=0;b<a.length;b++){var e=a[b];c.removeOperation.bind(c)(e.Location).then(function(){d.loadOperations.bind(d)()},function(){d.loadOperations.bind(d)()})}},visibleWhen:function(c){if(!Array.isArray(c)||c.length===0)return!a(c);for(var b in c)if(a(c[b]))return!1;
return!0}});e.addCommand(i);i=new b.Command({name:g.Cancel,tooltip:g["Cancel operations from the operations list."],imageClass:"core-sprite-stop",id:"eclipse.cancelOperation",callback:function(a){for(var a=Array.isArray(a.items)?a.items:[a.items],c=0;c<a.length;c++){var b=a[c];b.deferred&&b.deferred.cancel()}},visibleWhen:function(c){if(!Array.isArray(c)||c.length===0)return a(c)&&(c.operation&&c.operation.cancelable?!0:!1);for(var b in c)if(!a(c[b])||!c[b].operation||!c[b].operation.cancelable)return!1;
return!0}});e.addCommand(i)}})();return h});
define("orion/webui/dialogs/OperationsDialog",["i18n!orion/operations/nls/messages","require","orion/webui/littlelib","orion/webui/popupdialog","orion/operationsCommands"],function(g,k,j,b,h){function f(b){this._options=b}f.prototype=new b.PopupDialog;f.prototype.TEMPLATE='<table style="width: 360px;"><tr><td><h2>Recent operations</h2></td><td style="text-align: right;"><a id="allOperationsLink">All Operations</a></td></tr></table><span id="operationsExist"><span class="secondaryColumn" id="myOperationsListEmpty">No operations running on this page.</span><table id="myOperationsList" style="display: none;"></table></span><span class="secondaryColumn" id="operationsDontExist">No operations running.</span>';f.prototype._init=
function(b){this._myOperations=[];this._operationsDeferreds=[];this._commandService=b.serviceRegistry.getService("orion.page.command");h.createOperationsCommands(this._commandService);this._commandService.registerCommandContribution("operationsDialogItems","eclipse.cancelOperation",1);this._initialize(b.triggerNode)};f.prototype._bindToDom=function(){this.$allOperationsLink.href=k.toUrl("operations/list.html");this._setOperationsVisibility()};f.prototype.setOperations=function(b,d){this._myOperations||
this._init(this._options);this._myOperations=[];this._operationsDeferreds=[];if(b)for(var c in b)this._myOperations.push(b[c]),this._operationsDeferreds.push(d[c]);this._renderOperations()};f.prototype.parseProgressResult=function(b){if(!b)return{};b=b.responseText||b;try{b=JSON.parse(b)}catch(d){}var c={Message:b.Message||b,Severity:b.Severity};if(b.DetailedMessage&&b.DetailedMessage!==c.Message)c.DetailedMessage=b.DetailedMessage;return c};f.prototype._renderOperations=function(){this._renderOperationsTable(this.$myOperationsList,
this._myOperations,this._operationsDeferreds)};f.prototype._renderOperationsTable=function(b,d,c){j.empty(b);for(var a=0;a<d.length;a++){var i=d[a],f=document.createElement("tr"),h=document.createElement("td");h.style.paddingLeft="5px;";h.style.paddingRight="5px;";h.textContent=i.Name;f.appendChild(h);var k=document.createElement("div");h.appendChild(k);h=document.createElement("span");k.appendChild(h);h.classList.add("imageSprite");var t=document.createElement("span");t.classList.add("primaryColumn");
k.appendChild(t);t.appendChild(document.createTextNode(i.Name));switch(i.type){case "Warning":h.classList.add("core-sprite-warning");h.setAttribute("aria-label",g["Operation resulted in a warning."]);break;case "error":h.classList.add("core-sprite-error");h.setAttribute("aria-label",g["Operation resulted in an error."]);break;case "loadstart":case "progress":h.classList.add("core-sprite-start");h.setAttribute("aria-label",g["Operation is running."]);break;case "abort":h.classList.add("core-sprite-stop");
h.setAttribute("aria-label",g["Operation is canceled."]);break;case "load":case "loadend":h.classList.add("core-sprite-ok"),h.setAttribute("aria-label","Operation ok.")}if(i.error)h=i.error.Message||i.error,i.error.DetailedMessage&&i.error.DetailedMessage!==""&&(h+=": "+i.error.DetailedMessage),k.appendChild(document.createElement("br")),t=document.createElement("span"),t.classList.add("secondaryColumn"),t.style.marginLeft="18px;",k.appendChild(t),t.textContent=h;h=document.createElement("span");
k.appendChild(h);this._commandService.renderCommands("operationsDialogItems",k,{operation:i,deferred:c[a]},this,"tool");b.appendChild(f)}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(g,k,j,b,h){function f(d,c){if(!this._progressPane){this._progressPane=b.node(d);this._operationsDialog=new h.OperationsDialog({triggerNode:this._progressPane,serviceRegistry:c});var a=this;this._progressPane.addEventListener("keydown",function(c){(c.charOrCode===" "||c.keyCode===b.KEY.ENTER)&&a._operationsDialog.show()})}}function e(b,c,a){this._serviceRegistry=
b;this._serviceRegistration=b.registerService("orion.page.progress",this);this._operationsClient=c;this._operations={};this._operationDeferrds={};this._operationsIndex=0;this._lastIconClass=this._lastOperation=null;this._progressMonitorClass=a}f.prototype={_switchIconTo:function(b){this._lastIconClass&&this._progressPane.classList.remove(this._lastIconClass);this._lastIconClass=b;this._progressPane.classList.add(this._lastIconClass)},generateOperationsInfo:function(b,c){var a={},e;for(e in b)b[e].progressMonitor||
(a[e]=b[e]);if(this._isEmpty(a))this._switchIconTo("progressPane_empty"),this._progressPane.title=g.Operations,this._progressPane.alt=g.Operations,this._progressPane.hasAttribute("aria-valuetext")&&this._progressPane.removeAttribute("aria-valuetext");else{var f="";for(e in a){var h=a[e];if(h.type&&(h.type==="loadstart"||h.type==="progress")){f="running";break}}switch(f){case "running":this._progressPane.title=g["Operations running"];this._progressPane.alt=g["Operations running"];this._progressPane.setAttribute("aria-valuetext",
g["Operations running"]);this._switchIconTo("progressPane_running");break;case "warning":this._progressPane.title=g["Some operations finished with warning"];this._progressPane.alt=g["Some operations finished with warning"];this._progressPane.setAttribute("aria-valuetext",g["Some operations finished with warning"]);this._switchIconTo("progressPane_warning");break;case "error":this._progressPane.title=g["Some operations finished with error"];this._progressPane.alt=g["Some operations finished with error"];
this._progressPane.setAttribute("aria-valuetext",g["Some operations finished with error"]);this._switchIconTo("progressPane_error");break;default:this._progressPane.title=g.Operations,this._progressPane.alt=g.Operations,this._progressPane.hasAttribute("aria-valuetext")&&this._progressPane.removeAttribute("aria-valuetext"),this._switchIconTo("progressPane_operations")}}this._operationsDialog.setOperations(a,c)},_isEmpty:function(b){for(var c in b)return!1;return!0}};f.prototype.constructon=f;e.prototype=
{init:function(b){if(!this._progressMonitorClass)this._progressMonitorTool=new f(b,this._serviceRegistry)},progress:function(b,c,a){var e=this,f=this._operationsIndex++;!a&&this._progressMonitorClass&&(a=new this._progressMonitorClass,a.begin(c));b.then(function(){if(e._operations[f]){var g=e._operations[f];if(c)g.Name=c;e._lastOperation=g;g.type="loadend";if(a)g.progressMonitor=a;e.writeOperation.bind(e)(f,g,b);g.Location||e._removeOperationFromTheList.bind(e)(f)}},function(g){if(e._operations[f]){var h=
e._operations[f];if(c)h.Name=c;if(a)h.progressMonitor=a;e._lastOperation=h;h.type=g.canceled?"abort":"error";h.error=g;e.writeOperation.bind(e)(f,h,b);h.Location||e._removeOperationFromTheList.bind(e)(f)}},function(g){if(c)g.Name=c;if(a)g.progressMonitor=a;e.writeOperation.bind(e)(f,g,b)});return b},removeOperation:function(b){for(var c in this._operations)if(this._operations[c].Location&&this._operations[c].Location===b){this._removeOperationFromTheList(c);break}this._operationsClient.removeOperation.bind(this._operationsClient)(b)},
_removeOperationFromTheList:function(b){var c=this._operations[b].progressMonitor;delete this._operations[b];delete this._operationDeferrds[b];c?c.done():this._progressMonitorTool.generateOperationsInfo(this._operations,this._operationDeferrds)},removeCompletedOperations:function(){for(var b in this._operations){var c=this._operations[b];if(c.type&&c.type!=="loadstart"&&c.type!=="progress")(c=this._operations[b].progressMonitor)&&c.done(),delete this._operations[b],delete this._operationDeferrds[b]}this._progressMonitorTool.generateOperationsInfo(operations,
this._operationDeferrds)},setProgressResult:function(b){this._serviceRegistry.getService("orion.page.message").setProgressResult(b)},showWhile:function(b,c){c&&this._serviceRegistry.getService("orion.page.message").setProgressMessage(c);var a=this;b.then(function(){a._serviceRegistry.getService("orion.page.message").setProgressMessage("")},function(c){a.setProgressResult.bind(a)(c);return c});return this.progress(b,c)},writeOperation:function(b,c,a){this._operations[b]=c;this._operationDeferrds[b]=
a;c.Location&&serviceRegistry.getService("orion.core.preference").getPreferences("/operations").then(function(a){a.put(c.Location,{Name:c.Name,expires:c.expires})});c.progressMonitor?c.progressMonitor.progress(c.Name):this._progressMonitorTool.generateOperationsInfo(this._operations,this._operationDeferrds)}};e.prototype.constructor=e;return{ProgressService:e}});
define("orion/extensionCommands","require,orion/Deferred,orion/commands,orion/editor/regex,orion/contentTypes,orion/URITemplate,orion/i18nUtil,orion/URL-shim".split(","),function(g,k,j,b,h,f,e){var d={},c=(new URL(g.toUrl("."),window.location)).href.slice(0,-1);d._cloneItemWithoutChildren=function i(c){if(c===null||typeof c!=="object")return c;var b=c.constructor(),d;for(d in c)d!=="children"&&d!=="Children"&&(b[d]=i(c[d]));return b};d._createOpenWithCommands=function(c){function b(c,d){for(var e=
c.getServiceReferences("orion.navigate.openWith"),i=[],f=0;f<e.length;f++){var g=e[f];g.getProperty("editor")===d.id&&(g=g.getProperty("contentType"),g instanceof Array?i=i.concat(g):g!==null&&typeof g!=="undefined"&&i.push(g))}return i}for(var d=function(){for(var b=c.getServiceReferences("orion.edit.editor"),d=[],e=0;e<b.length;e++){var f=b[e],g=f.getProperty("id");d.push({id:g,name:f.getProperty("name"),nameKey:f.getProperty("nameKey"),nls:f.getProperty("nls"),uriTemplate:f.getProperty("orionTemplate")||
f.getProperty("uriTemplate")})}return d}(),e=function(c){for(c=c.getServiceReferences("orion.navigate.openWith.default");0<c.length;)return{editor:c[0].getProperty("editor")};return null}(c),f=[],g=0;g<d.length;g++){var h=d[g],j=e&&e.editor===h.id,k=b(c,h);k.length&&f.push({properties:{name:h.name||h.id,nameKey:h.nameKey,id:"eclipse.openWithCommand."+h.id,tooltip:h.name,tooltipKey:h.nameKey,contentType:k,uriTemplate:h.uriTemplate,nls:h.nls,forceSingleItem:!0,isEditor:j?"default":"editor"},service:{}})}return f};
d._makeValidator=function(b,d,e,g){function j(c,b,d,e){var f=d.match,i;if(b.indexOf("|")>=0)return i=b.substring(0,b.indexOf("|")),b=b.substring(b.indexOf("|")+1),j(c,i,d,e)?!0:j(c,b,d,e);else if(b.indexOf(":")>=0)return i=b.substring(0,b.indexOf(":")),b=b.substring(b.indexOf(":")+1),c[i]?j(c[i],b,d,e):!1;else{a:{i=!1;var g;if(c[b]){if(f)if(typeof f==="string"){if(!typeof(c[b]==="string")){d=!1;break a}if(d.variableName){if(f=RegExp(f).exec(c[b]))i=f[0],g=d.variableMatchPosition==="before"?c[b].substring(0,
f.index):d.variableMatchPosition==="after"?c[b].substring(f.index+i.length):d.variableMatchPosition==="only"?i:c[b],i=!0}else{d=RegExp(f).test(c[b]);break a}}else c[b]===f&&(g=c[b],i=!0);else g=c[b],i=!0;if(i&&d.variableName&&(e[d.variableName]=g,e.itemCached=c,d.replacements))for(c=0;c<d.replacements.length;c++)b=!1,d.replacements[c].pattern?e[d.variableName]=e[d.variableName].replace(RegExp(d.replacements[c].pattern),d.replacements[c].replacement||""):b=!0,b&&window.console.log("Invalid replacements specified in validation property.  "+
d.replacements[c]);d=i}else d=!1}return d}}return{info:b,validationFunction:function(c){typeof g==="function"&&(c=g.call(this,c));if(c){if(Array.isArray(c)){if((this.info.forceSingleItem||this.info.uriTemplate)&&c.length!==1)return!1;if(c.length<1)return!1}else c=[c];for(var d=0;d<c.length;d++){var f;a:{var l=c[d],k=e;if(this.info.validationProperties)for(f=0;f<this.info.validationProperties.length;f++){var v=this.info.validationProperties[f];if(v.source){if(!j(l,v.source,v,this)){f=!1;break a}}else{window.console.log("Invalid validationProperties in "+
b.id+".  No source property specified.");f=!1;break a}}if(this.info.contentType&&k){v=!1;if(l=h.getFilenameContentType(l.Name,k))for(f=0;f<this.info.contentType.length;f++)if(l.id===this.info.contentType[f]){v=!0;break}f=v}else f=!0}if(!f)return!1}return!0}return!1},generatesURI:function(){return!!this.info.uriTemplate},getURI:function(b){if(this.info.uriTemplate){var d={},e;for(e in b)b.hasOwnProperty(e)&&(d[e]=b[e]);if(this.info.validationProperties)for(e=0;e<this.info.validationProperties.length;e++){var i=
this.info.validationProperties[e];i.source&&i.variableName&&(this.itemCached===b&&this[i.variableName]||j(b,i.source,i,this),b[i.variableName]?window.console.log("Variable name "+i.variableName+" in the extension "+this.info.id+" conflicts with an existing property in the item metadata."):d[i.variableName]=this[i.variableName])}d.OrionHome=c;b=new f(this.info.uriTemplate);return window.decodeURIComponent(b.expand(d))}return null}}};d._createCommandOptions=function(c,b,f,g,h,j){function r(e,k){var v=
d._makeValidator(c,f,g,j);e.visibleWhen=v.validationFunction.bind(v);if(h)if(v.generatesURI.bind(v)())e.hrefCallback=function(c){c=Array.isArray(c.items)?c.items[0]:c.items;return v.getURI.bind(v)(c)};else{var o=c;e.callback=function(c){var i;if(o.forceSingleItem)c=Array.isArray(c.items)?c.items[0]:c.items,i=d._cloneItemWithoutChildren(c);else if(Array.isArray(c.items)){i=[];for(var g=0;g<c.items.length;g++)i.push(d._cloneItemWithoutChildren(c.items[g]))}else i=d._cloneItemWithoutChildren(c.items);
if(f)var h=f.getService("orion.page.progress");b.run?h?h.progress(b.run(i),"Running command: "+e.name):b.run(i):f&&(h?h.progress(f.getService(b).run(i),"Running command: "+e.name):f.getService(b).run(i))}}k.resolve(e)}var o=new k;c.nls?e.getMessageBundle(c.nls).then(function(b){r({name:c.nameKey?b[c.nameKey]:c.name,image:c.image,id:c.id||c.name,tooltip:c.tooltipKey?b[c.tooltipKey]:c.tooltip,isEditor:c.isEditor},o)}):r({name:c.name,image:c.image,id:c.id||c.name,tooltip:c.tooltip,isEditor:c.isEditor},
o);return o};d.getOpenWithCommands=function(c){var b=[],d;for(d in c._commandList){var e=c._commandList[d];e.isEditor&&b.push(e)}return b};return d});
define("orion/section",["orion/webui/littlelib","orion/selection","orion/commands","orion/commonHTMLFragments"],function(g,k,j,b){function h(e,d){var c=this;this._expandImageClass="core-sprite-openarrow";this._collapseImageClass="core-sprite-closedarrow";this._twistieSpriteClass="modelDecorationSprite";if(!d.id)throw Error("Missing required argument: id");this.id=d.id;if(!d.title)throw Error("Missing required argument: title");var a=d.useAuxStyle?["sectionWrapper","sectionWrapperAux","toolComposite"]:
["sectionWrapper","toolComposite"];this.domNode=document.createElement("div");e.appendChild(this.domNode);for(var f=0;f<a.length;f++)this.domNode.classList.add(a[f]);this.domNode.id=d.id;if(d.canHide)this.twistie=document.createElement("span"),this.twistie.classList.add("modelDecorationSprite"),this.twistie.classList.add("layoutLeft"),this.twistie.classList.add("sectionTitle"),this.domNode.style.cursor="pointer",this.domNode.appendChild(this.twistie),this.domNode.tabIndex=0,this.domNode.addEventListener("click",
function(a){(a.target===c.titleNode||a.target===c.twistie)&&c._changeExpandedState()},!1),this.domNode.addEventListener("keydown",function(a){a.keyCode===g.KEY.ENTER&&(a.target===c.domNode||a.target===c.titleNode||a.target===c.twistie)&&c._changeExpandedState()},!1);if(d.iconClass){var h=document.createElement("span");h.classList.add("sectionIcon");this.domNode.appendChild(h);(Array.isArray(d.iconClass)?d.iconClass:[d.iconClass]).forEach(function(a){h.classList.add(a)})}this.titleNode=document.createElement("div");
this.titleNode.id=d.id+"Title";this.titleNode.classList.add("sectionAnchor");this.titleNode.classList.add("sectionTitle");this.titleNode.classList.add("layoutLeft");this.domNode.appendChild(this.titleNode);this.titleNode.textContent=d.title;if(typeof d.getItemCount==="function")a=document.createElement("div"),a.classList.add("layoutLeft"),a.classList.add("sectionItemCount"),this.domNode.appendChild(a),a.textContent=d.getItemCount(this);this._progressNode=document.createElement("div");this._progressNode.id=
d.id+"Progress";this._progressNode.classList.add("sectionProgress");this._progressNode.classList.add("sectionTitle");this._progressNode.classList.add("layoutLeft");this._progressNode.style.visibility="hidden";this._progressNode.textContent="...";this.domNode.appendChild(this._progressNode);a=document.createElement("div");a.id=d.id+"FilterSearchBox";this.domNode.appendChild(a);this._toolActionsNode=document.createElement("div");this._toolActionsNode.id=d.id+"ToolActionsArea";this._toolActionsNode.classList.add("layoutRight");
this._toolActionsNode.classList.add("sectionActions");this.domNode.appendChild(this._toolActionsNode);this.actionsNode=document.createElement("div");this.actionsNode.id=d.id+"ActionArea";this.actionsNode.classList.add("layoutRight");this.actionsNode.classList.add("sectionActions");this.domNode.appendChild(this.actionsNode);this.selectionNode=document.createElement("div");this.selectionNode.id=d.id+"SelectionArea";this.selectionNode.classList.add("layoutRight");this.selectionNode.classList.add("sectionActions");
this.domNode.appendChild(this.selectionNode);d.slideout&&(a=b.slideoutHTMLFragment(d.id),f=document.createRange(),f.selectNode(this.domNode),a=f.createContextualFragment(a),this.domNode.appendChild(a));this._contentParent=document.createElement("div");this._contentParent.id=this.id+"Content";this._contentParent.role="region";this._contentParent.classList.add("sectionTable");this._contentParent.setAttribute("aria-labelledby",this.titleNode.id);e.appendChild(this._contentParent);d.content&&this.setContent(d.content);
this.hidden=d.hidden;if(typeof d.onExpandCollapse==="function")this._onExpandCollapse=d.onExpandCollapse;this._preferenceService=d.preferenceService;this._contentParent.style.display="none";if(this._preferenceService){var j=this;this._preferenceService.getPreferences("/window/views").then(function(a){a=a.get(j.id);if(a!==void 0)j.hidden=!a;if(!j.hidden)j._contentParent.style.display="block";j._updateExpandedState(!j.hidden,!1)})}else{if(!this.hidden)this._contentParent.style.display="block";this._updateExpandedState(!this.hidden,
!1)}this._commandService=d.commandService;this._lastMonitor=0;this._loading={}}function f(b){this._section=b;this._id=++b._lastMonitor}h.prototype={setTitle:function(b){this.titleNode.textContent=b},setContent:function(b){typeof b==="string"?this._contentParent.innerHTML=b:(this._contentParent.innerHTML="",this._contentParent.appendChild(b))},getContentElement:function(){return this._contentParent},createProgressMonitor:function(){return new f(this)},_setMonitorMessage:function(b,d){this._progressNode.style.visibility=
"visible";this._loading[b]=d;var c="",a;for(a in this._loading)c!==""&&(c+="\n"),c+=this._loading[a];this._progressNode.title=c},_monitorDone:function(b){delete this._loading[b];var b="",d;for(d in this._loading)b!==""&&(b+="\n"),b+=this._loading[d];this._progressNode.title=b;if(b==="")this._progressNode.style.visibility="hidden"},_changeExpandedState:function(){this.hidden?(this._contentParent.style.display="block",this.hidden=!1):(this._contentParent.style.display="none",this.hidden=!0);this._updateExpandedState(!this.hidden,
!0)},_updateExpandedState:function(b,d){var c=this.twistie,a=this.id;c&&(c.classList.add(b?this._expandImageClass:this._collapseImageClass),c.classList.remove(b?this._collapseImageClass:this._expandImageClass));this._preferenceService&&d&&this._preferenceService.getPreferences("/window/views").then(function(c){c.put(a,b)});this._onExpandCollapse&&this._onExpandCollapse(b,this)}};h.prototype.constructor=h;f.prototype={begin:function(b){this.status=b;this._section._setMonitorMessage(this.id,b)},worked:function(b){this.status=
b;this._section._setMonitorMessage(this.id,b)},done:function(b){this.status=b;this._section._monitorDone(this.id)}};f.prototype.constructor=f;return{Section:h}});
define("orion/explorers/explorer","i18n!orion/nls/messages,require,orion/webui/littlelib,orion/webui/treetable,orion/explorers/explorerNavHandler,orion/commands".split(","),function(g,k,j,b,h,f){var e={};e.Explorer=function(){function d(c,a,b){this.registry=c;this.renderer=b;this.selection=a;this.myTree=null}d.prototype={changedItem:function(c,a){this.myTree&&this.myTree.refresh.bind(this.myTree)(c,a,!0)},updateCommands:function(c){this.myTree&&this.myTree._renderer.updateCommands.bind(this.myTree._renderer)(c)},
makeNewItemPlaceHolder:function(c,a,b){c=this.getRow(c);if(b)return c=c.childNodes[b],c.appendChild(document.createElement("br")),b=document.createElement("span"),b.id=a+"placeHolderRow",c.appendChild(b),{tempNode:b,refNode:b};if(c){b=document.createElement("tr");b.id=a+"placeHolderRow";var d=document.createElement("td");d.id=a+"placeHolderCol";b.appendChild(d);c.appendChild(b);b=j.node(a+"placeHolderRow");c=j.node(a+"placeHolderCol");if(b&&c)return{tempNode:b,refNode:c}}return null},getRow:function(c){if(c=
this.model.getId(c))return j.node(c)},collapseAll:function(){for(var c=this._navHandler.getTopLevelNodes(),a=0;a<c.length;a++)this.myTree.collapse(c[a])},expandAll:function(c){if(c)this._expandRecursively(c);else if(this._navHandler)for(var c=this._navHandler.getTopLevelNodes(),a=0;a<c.length;a++)this._expandRecursively(c[a])},_expandRecursively:function(c){if(this._navHandler&&this._navHandler.isExpandable(c)){var a=this;this.myTree.expand(c,function(){a.model.getChildren(c,function(c){if(!(c===
void 0||c===null))for(var b=c.length,d=0;d<b;d++)a._expandRecursively(c[d])})})}},createTree:function(c,a,d){this.selection&&this.selection.setSelections([]);this.getNavHandler()&&this.getNavHandler()._clearSelection();var e=c+"innerTree",f=j.node(e);f&&j.empty(f);if(a)a.rootId=e;this.model=a;this._parentId=c;this._treeOptions=d;if(!d||d&&!d.noSelection)this.selectionPolicy=d?d.selectionPolicy:"",this._navDict=new h.ExplorerNavDict(this.model);this.myTree=new b.TableTree({id:e,model:a,parent:c,labelColumnIndex:this.renderer.getLabelColumnIndex(),
renderer:this.renderer,showRoot:d?!!d.showRoot:!1,indent:d?d.indent:void 0,onCollapse:d?d.onCollapse:void 0,tableElement:d?d.tableElement:void 0,tableBodyElement:d?d.tableBodyElement:void 0,tableRowElement:d?d.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 c=this.getNavHandler(),a=[];
if(c&&this.getNavDict())for(var b=c.getSelection(),d=0;d<b.length;d++){var e=c.getRowDiv(b[d]);e&&e.parentNode&&(e=this.getNavDict().getValue(this.model.getId(b[d])),e.model&&a.push(e.model))}this.selection.setSelections(a)}},getRootPath:function(){return this.model&&this.model.root?this.model.root.Location:null},initNavHandler:function(){var c=this._treeOptions;if(!c||c&&!c.noSelection){if(!this.getNavHandler())this._navHandler=new h.ExplorerNavHandler(this,this._navDict,{setFocus:c&&c.setFocus,
selectionPolicy:c?c.selectionPolicy:null});var a=this;this.model.getRoot(function(b){b instanceof Array?a.getNavHandler().refreshModel(a.getNavDict(),a.model,b):b.children&&b.children instanceof Array&&a.getNavHandler().refreshModel(a.getNavDict(),a.model,b.children);c&&c.setFocus&&a.getNavHandler().cursorOn(null,!1,!1,!0)})}},_lastHash:null,checkbox:!1};return d}();e.createExplorerCommands=function(b,c){function a(a){return typeof a.getItemCount==="function"?a.getItemCount()>0?c?c(a):!0:!1:!1}var e=
new f.Command({tooltip:g["Expand all"],imageClass:"core-sprite-expandAll",id:"orion.explorer.expandAll",groupId:"orion.explorerGroup",visibleWhen:function(c){return a(c)},callback:function(a){a.items.expandAll()}}),h=new f.Command({tooltip:g["Collapse all"],imageClass:"core-sprite-collapseAll",id:"orion.explorer.collapseAll",groupId:"orion.explorerGroup",visibleWhen:function(c){return a(c)},callback:function(a){a.items.collapseAll()}});b.addCommand(e);b.addCommand(h)};e.ExplorerModel=function(){function b(c,
a,d){this.rootPath=c;this.fetchItems=a;this.idPrefix=d||""}b.prototype={destroy:function(){},getRoot:function(c){var a=this;this.fetchItems(this.rootPath).then(function(b){a.root=b;c(b)})},getChildren:function(c,a){c.Children?a(c.Children):c.ChildrenLocation?this.fetchItems(c.ChildrenLocation).then(function(b){c.Children=b;a(b)}):a([])},getId:function(c){if(c.Location===this.root.Location)return this.rootId;for(var c=c.Location.replace(/[\\\/]/g,""),a=this.idPrefix,b=0;b<c.length;b++)a+=c[b].match(/[^\.\:\-\_0-9A-Za-z]/g)?
c.charCodeAt(b):c[b];return a}};return b}();e.ExplorerFlatModel=function(){function b(c,a,d){this.rootPath=c;this.fetchItems=a;this.root=d}b.prototype=new e.ExplorerModel;b.prototype.getRoot=function(c){if(this.root)c(this.root);else{var a=this;this.fetchItems(this.rootPath).then(function(b){a.root=b;c(b)})}};b.prototype.getChildren=function(c,a){c===this.root?a(this.root):a([])};return b}();e.ExplorerRenderer=function(){function b(c,a){this.explorer=a;this._init(c);this._expandImageClass="core-sprite-openarrow";
this._collapseImageClass="core-sprite-closedarrow";this._twistieSpriteClass="modelDecorationSprite"}b.prototype={_init:function(c){if(c){this._useCheckboxSelection=c.checkbox===void 0?!1:c.checkbox;this.selectionPolicy=c.singleSelection?"singleSelection":"";this._cachePrefix=c.cachePrefix;this.getCheckedFunc=c.getCheckedFunc;this.onCheckedFunc=c.onCheckedFunc;this._highlightSelection=!0;this._treeTableClass=c.treeTableClass||"treetable";if(c.highlightSelection===!1)this._highlightSelection=!1;if(!this.actionScopeId)this.actionScopeId=
c.actionScopeId}},getLabelColumnIndex:function(){return this.explorer.checkbox?1:0},initTable:function(c,a){this.tableTree=a;j.empty(c);this._treeTableClass&&c.classList.add(this._treeTableClass);this.renderTableHeader(c)},getActionsColumn:function(c,a,b,d,e){var b=b||"tool",f=this.explorer.registry.getService("orion.page.command"),g=document.createElement("td");g.id=a.id+"actionswrapper";d&&g.classList.add(d);this.actionScopeId?f.renderCommands(this.actionScopeId,g,c,this.explorer,b,null,e&&this.explorer.getNavDict()?
this.explorer.getNavDict().getGridNavHolder(c,!0):null):window.console.log("Warning, no action scope was specified.  No commands rendered.");return g},initCheckboxColumn:function(){if(this._useCheckboxSelection)return document.createElement("th")},getCheckboxColumn:function(c,a){if(this._useCheckboxSelection){var b=document.createElement("td"),d=document.createElement("span");d.id=this.getCheckBoxId(a.id);d.classList.add("core-sprite-check");d.classList.add("selectionCheckmarkSprite");d.rowId=a.id;
if(this.getCheckedFunc)d.checked=this.getCheckedFunc(c),d.checked?(this._highlightSelection&&a.classList.add("checkedRow"),d.classList.add("core-sprite-check_on")):(this._highlightSelection&&a.classList.remove("checkedRow"),d.classList.remove("core-sprite-check_on"));b.appendChild(d);var e=this;d.addEventListener("click",function(c){e.onCheck(a,c.target,c.target.checked?!1:!0,!0)},!1);return b}},getCheckBoxId:function(c){return c+"selectedState"},onCheck:function(c,a,b,d,e){(a.checked=b)?a.classList.add("core-sprite-check_on"):
a.classList.remove("core-sprite-check_on");if(this.onCheckedFunc)this.onCheckedFunc(a.rowId,b,d);this.explorer.getNavHandler()&&e&&this.explorer.getNavHandler().setSelection(this.explorer.getNavDict().getValue(c.id).model,!0)},storeSelections:function(){if(this.explorer.getNavHandler()){var c=this.explorer.getNavHandler().getSelectionIds(),a=this._getUIStatePreferencePath();a&&window.sessionStorage&&(window.sessionStorage[a+"selection"]=JSON.stringify(c))}},_restoreSelections:function(c){c=window.sessionStorage[c+
"selection"];typeof c==="string"&&(c=c.length>0?JSON.parse(c):null);var a;if(c&&this.explorer.getNavDict()){var b=[];for(a=0;a<c.length;a++){var d=this.explorer.getNavDict().getValue(c[a]);if(d&&d.rowDomNode&&d.model&&(b.push(d.model),this._highlightSelection&&d.rowDomNode.classList.add("checkedRow"),d=j.node(this.getCheckBoxId(d.rowDomNode.id))))d.checked=!0,d.classList.add("core-sprite-check_on")}this.explorer.selection&&(this.explorer.selection.setSelections(b),this.explorer.getNavHandler()&&this.explorer.getNavHandler().refreshSelection())}},
_storeExpansions:function(c){window.sessionStorage[c+"expanded"]=JSON.stringify(this._expanded)},_restoreExpansions:function(c){var a=!1,b=window.sessionStorage[c+"expanded"];typeof b==="string"&&(b=b.length>0?JSON.parse(b):null);var d;if(b)for(d=0;d<b.length;d++)if(j.node(b[d])){this._expanded.push(b[d]);var e=this;this.tableTree.expand(b[d],function(){e._restoreSelections(c)});a=!0}return!a},_getUIStatePreferencePath:function(){if(this.explorer){var c=this.explorer.getRootPath();if(this._cachePrefix&&
c)return"/"+this._cachePrefix+"/"+c.replace(/[^\.\:\-\_0-9A-Za-z]/g,"")+"/uiState"}return null},expandCollapseImageId:function(c){return c+"__expand"},updateExpandVisuals:function(c,a){var b=j.node(this.expandCollapseImageId(c.id));b&&(b.classList.add(a?this._expandImageClass:this._collapseImageClass),b.classList.remove(a?this._collapseImageClass:this._expandImageClass))},getExpandImage:function(c,a,b,d){var e=document.createElement("span");e.id=this.expandCollapseImageId(c.id);a.appendChild(e);e.classList.add(this._twistieSpriteClass);
e.classList.add(this._collapseImageClass);if(b){var f=document.createElement("span");a.appendChild(f);f.classList.add(d||"imageSprite");f.classList.add(b)}var g=this;e.onclick=function(){g.tableTree.toggle(c.id);if(g.tableTree.isExpanded(c.id))g._expanded.push(c.id);else for(var a in g._expanded)if(g._expanded[a]===c.id){g._expanded.splice(a,1);break}(a=g._getUIStatePreferencePath())&&window.sessionStorage&&g._storeExpansions(a)};return e},render:function(c,a){a.classList.add("navRow");this.renderRow(c,
a)},rowsChanged:function(){this.explorer.selectionPolicy!=="cursorOnly"&&(this.explorer.refreshSelection(),this.explorer.initNavHandler())},updateCommands:function(){for(var c=this.explorer.registry,a=j.$$array(".treeTableRow"),b=0;b<a.length;b++){var d=a[b],e=j.node(d.id+"actionswrapper"),f=c.getService("orion.page.command");f.destroy(e);this.actionScopeId&&f.renderCommands(this.actionScopeId,e,d._item,this.explorer,"tool")}},_initializeUIState:function(){this._expanded=[];var c=this._getUIStatePreferencePath();
c&&window.sessionStorage&&this._restoreExpansions(c)&&this._restoreSelections(c)}};return b}();e.SelectionRenderer=function(){function b(c,a){this._init(c);this.explorer=a}b.prototype=new e.ExplorerRenderer;b.prototype.renderTableHeader=function(c){var a=document.createElement("thead"),b=document.createElement("tr");a.classList.add("navTableHeading");this._useCheckboxSelection&&b.appendChild(this.initCheckboxColumn(c));for(var d=0,e=this.getCellHeaderElement(d);e;)e.innerHTML.length>0&&e.classList.add("navColumn"),
b.appendChild(e),e=this.getCellHeaderElement(++d);a.appendChild(b);c.appendChild(a)};b.prototype.renderRow=function(c,a){a.verticalAlign="baseline";a.classList.add("treeTableRow");var b=this.explorer.getNavDict();if(b){b.addRow(c,a);var d=this;a.addEventListener("click",function(a){if(d.explorer.getNavHandler())d.explorer.getNavHandler().onClick(c,a)},!1)}if(b=this.getCheckboxColumn(c,a))b.classList.add("checkColumn"),a.appendChild(b);for(var b=0,e=this.getCellElement(b,c,a);e;)a.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,c,a)};b.prototype.getCellHeaderElement=function(){};b.prototype.getCellElement=function(){};return b}();e.SimpleFlatModel=function(){function b(c,a,d){this.items=c;this.getKey=d;this.idPrefix=a;this.root={children:c}}b.prototype=new e.ExplorerModel;b.prototype.getRoot=
function(c){c(this.root)};b.prototype.destroy=function(){};b.prototype.getId=function(c){for(var c=this.getKey(c).replace(/[\\\/]/g,""),a="",b=0;b<c.length;b++)a+=c[b].match(/[^\.\:\-\_0-9A-Za-z]/g)?c.charCodeAt(b):c[b];return this.idPrefix+a};b.prototype.getChildren=function(c,a){c===this.root?a(this.items):a([])};return b}();return e});
define("orion/git/widgets/RemotePrompterDialog",["i18n!git/nls/gitmessages","orion/webui/dialog","orion/explorers/explorer","orion/selection"],function(g,k,j,b){function h(b,c){this.explorer=c;this._init(b)}function f(b){this._init(b)}var e=function(){function b(c,a,d,e){this.gitClient=c;this.rootPath=a;this.fetchItems=d;this.root=e?e:null}b.prototype=new j.ExplorerModel;b.prototype.getRoot=function(c){var a=this;this.root?c(this.root):this.fetchItems(this.rootPath).then(function(b){a.root=b;c(b)})};
b.prototype.getIdentity=function(c){c.Location?(c=c.Location,c=c.replace(/[^\.\:\-\_0-9A-Za-z]/g,"")):c="ROOT";return c};b.prototype.getChildren=function(c,a){c.children=[];if(c.Children){for(var b=0;b<c.Children.length;b++)c.Children[b].parent=c,c.children[b]=c.Children[b];a(c.Children)}else c.BranchLocation&&c.RemoteLocation?(c.children=[{GroupNode:"true",Location:c.BranchLocation,Name:"Branches",parent:c},{GroupNode:"true",Location:c.RemoteLocation,BranchLocation:c.BranchLocation,Name:"Remotes",
parent:c},{GroupNode:"true",Location:c.TagLocation,Name:"Tags",parent:c}],a(c.children)):c.GroupNode?this.gitClient.getGitBranch(c.Location).then(function(b){c.children=b.Children;for(var d=0;d<b.Children.length;d++)b.Children[d].parent=c;a(b.Children)}):c.Type==="Remote"&&this.gitClient.getGitBranch(c.Location).then(function(b){c.children=b.Children;for(var d=0;d<b.Children.length;d++)b.Children[d].parent=c;a(b.Children)})};return b}();h.prototype=new j.SelectionRenderer;h.prototype.constructor=
h;h.prototype.getLabelColumnIndex=function(){return 0};h.prototype.getCellElement=function(b,c,a){var e=document.createElement("td");a.appendChild(e);b=document.createElement("span");b.id=a.id+"navSpan";e.appendChild(b);b.className="mainNavColumn singleNavColumn";(c.children||c.Children||c.GroupNode||c.Type==="Remote"||c.BranchLocation&&c.RemoteLocation)&&this.getExpandImage(a,b);a=c.Name;c.Type==="RemoteTrackingBranch"&&!c.Id&&(a=c.Name+g[" [New branch]"]);b.appendChild(document.createTextNode(a))};
f.prototype=new k.Dialog;f.prototype.TEMPLATE='<div><div id="treeContentPane" style="width:25em; min-height: 25em; max-height: 30em; height: auto; overflow-y: auto; padding: 8px"></div><div id="newBranchPane" style="padding: 8px"><label for="newBranch">${New Branch:}</label><input id="newBranch" value="" disabled=true/></div></div>';f.prototype._init=function(b){var c=this;this.title=b.title||g["Choose a Folder"];this.modal=!0;this.messages=g;this.func=b.func;this.treeRoot=b.treeRoot;this.gitClient=
b.gitClient;this.hideNewBranch=b.hideNewBranch;this.serviceRegistry=b.serviceRegistry;this.buttons=[];this.buttons.push({callback:function(){c.$remoteOk.classList.contains(this.DISABLED)||(c.destroy(),c._execute.bind(c)())},text:"OK",isDefault:!0,id:"remoteOk"})};f.prototype._bindToDom=function(){var b=this;this.$newBranch.addEventListener("input",function(){b._validate()});if(this.hideNewBranch)this.$newBranchPane.style.display="none"};f.prototype._beforeShowing=function(){this._initialize();this._loadRemoteChildren()};
f.prototype._afterShowing=function(){this.$treeContentPane.focus();this._validate()};f.prototype._loadRemoteChildren=function(){this._createTree(new e(this.gitClient,null,this.gitClient.getGitClone,this.treeRoot))};f.prototype._createTree=function(d){var c=this,a=this.serviceRegistry.getService("orion.remotePrompter.selection");a||(a=new b.Selection(this.serviceRegistry,"orion.remotePrompter.selection"));var e=new h({checkbox:!1,singleSelection:!0,treeTableClass:"directoryPrompter"});this.explorer=
new j.Explorer(this.serviceRegistry,a,e);e.explorer=this.explorer;this.explorer.createTree("treeContentPane",d);a.addEventListener("selectionChanged",function(a){c.$newBranch.disabled=a.selection&&a.selection.Type==="Remote"?!1:!0;c._validate(a.selection)})};f.prototype._validate=function(b){var c=function(a){a&&a.Type==="RemoteTrackingBranch"?this.$remoteOk.classList.remove(this.DISABLED):a&&a.Type==="Remote"&&this.$newBranch.value!==""?this.$remoteOk.classList.remove(this.DISABLED):this.$remoteOk.classList.add(this.DISABLED)};
b?c.bind(this)(b):this.serviceRegistry.getService("orion.remotePrompter.selection").getSelection(c.bind(this))};f.prototype._execute=function(){var b=this;this.serviceRegistry.getService("orion.remotePrompter.selection").getSelection(function(c){if(b.func)if(c.Type==="RemoteTrackingBranch")b.func(c,c.parent);else{var a=c.CloneLocation.substring(c.CloneLocation.indexOf(c.CloneLocation.split("/")[3])),e={};e.parent=c;e.FullName="refs/remotes/"+c.Name+"/"+b.$newBranch.value;e.Name=c.Name+"/"+b.$newBranch.value;
e.Type="RemoteTrackingBranch";e.Location="/gitapi/remote/"+c.Name+"/"+encodeURIComponent(b.$newBranch.value)+"/"+a;b.func(null,c,e)}})};f.prototype.constructor=f;return{RemotePrompterDialog:f}});
define("orion/explorers/explorer-table","i18n!orion/navigate/nls/messages,require,orion/Deferred,orion/webui/littlelib,orion/i18nUtil,orion/fileUtils,orion/explorers/explorer".split(","),function(g,k,j,b,h,f,e){function d(a,c,b,d,e,f){this.registry=a;this.root=c;this.fileClient=b;this.idPrefix=d||"";this.excludeFiles=!!e;this.excludeFolders=!!f}function c(a){this.registry=a.serviceRegistry;this.treeRoot=a.treeRoot;this.selection=a.selection;this.fileClient=a.fileClient;this.excludeFiles=a.excludeFiles;
this.excludeFolders=a.excludeFolders;this.parentId=a.parentId;this.renderer=a.rendererFactory(this);this.dragAndDrop=a.dragAndDrop;this.myTree=this.model=null;this._hookedDrag=this.checkbox=!1;var c=this.renderer;this.registry&&this.registry.registerService("orion.cm.managedservice",{updated:function(a){c.setTarget(a&&a["links.newtab"]!=="undefined"?a["links.newtab"]?"_blank":"_self":"_self")}},{pid:"nav.config"})}d.prototype=new e.ExplorerModel;d.prototype.getRoot=function(a){a(this.root)};d.prototype.processParent=
function(a,c){if(this.excludeFiles||this.excludeFolders){var b=[],d;for(d in c)if(!(c[d].Directory?this.excludeFolders:this.excludeFiles))b.push(c[d]),c[d].parent=a;c=b}else for(b in c)c[b].parent=a;a.children=c;a.children.sort(function(a,c){var b=a.Directory;if(b!==c.Directory)return b?-1:1;var b=a.Name&&a.Name.toLowerCase(),d=c.Name&&c.Name.toLowerCase();return b<d?-1:b>d?1:0});return c};d.prototype.getChildren=function(a,c){var b=this;a.children?c(a.children):a.Directory!==void 0&&a.Directory===
!1?c([]):a.Location?this.registry.getService("orion.page.progress").progress(this.fileClient.fetchChildren(a.ChildrenLocation),"Fetching children of "+a.Name).then(function(d){c(b.processParent(a,d))}):c([])};d.prototype.constructor=d;c.prototype=new e.Explorer;c.prototype._makeDropTarget=function(a,c,d){function e(a,c,b,d,f,i){c=c||"";if(a.isFile)b.Location.indexOf("/workspace")===0?d.registry.getService("orion.page.message").setProgressResult({Severity:"Error",Message:g["You cannot copy files directly into the workspace.  Create a folder first."]}):
a.file(function(a){f(b,a,d,a.name.indexOf(".zip")===a.name.length-4&&window.confirm(h.formatMessage(g["Unzip ${0}?"],a.name)))});else if(a.isDirectory){var j=a.createReader(),l=function(b){j.readEntries(function(g){for(var h=0;h<g.length;h++)e(g[h],c+a.name+"/",b,d,f,i)})},k=d.registry.getService("orion.page.progress");b.Location.indexOf("/workspace")===0?k.progress(i.createProject(b.ChildrenLocation,a.name),"Initializing project "+a.name).then(function(a){d.loadResourceList(d.treeRoot.Path,!0);k.progress(i.read(a.ContentLocation,
!0),"Loading project info "+a.name).then(function(a){l(a)})}):k.progress(i.createFolder(b.Location,a.name),"Creating folder "+a.name).then(function(a){d.changedItem(b,!0);l(a)})}}if(this.dragAndDrop){var f=this,j=this.dragAndDrop,k=function(a){c.classList.remove("dragOver");a.preventDefault();a.stopPropagation()};if(d)this._oldDragLeave&&c.removeEventListener("dragleave",this._oldDragLeave,!1),this._oldDragLeave=k;c.addEventListener("dragleave",k,!1);k=function(a){if(a.dataTransfer.effectAllowed===
"all"||a.dataTransfer.effectAllowed==="uninitialized"||a.dataTransfer.effectAllowed.indexOf("copy")>=0)a.dataTransfer.dropEffect="copy";c.classList.add("dragOver");b.stop(a)};if(d)this._oldDragEnter&&c.removeEventListener("dragenter",this._oldDragEnter,!1),this._oldDragEnter=k;c.addEventListener("dragenter",k,!1);k=function(a){if(a.dataTransfer.effectAllowed==="all"||a.dataTransfer.effectAllowed==="uninitialized"||a.dataTransfer.effectAllowed.indexOf("copy")>=0)a.dataTransfer.dropEffect="copy";b.stop(a)};
if(d&&!this._oldDragOver)c.addEventListener("dragover",k,!1),this._oldDragOver=k;k=function(d){c.classList.remove("dragOver");if(d.dataTransfer.items&&d.dataTransfer.items.length>0)for(var l=0;l<d.dataTransfer.items.length;l++){var k=null;typeof d.dataTransfer.items[l].getAsEntry==="function"?k=d.dataTransfer.items[l].getAsEntry():typeof d.dataTransfer.items[l].webkitGetAsEntry==="function"&&(k=d.dataTransfer.items[l].webkitGetAsEntry());k&&e(k,null,a,f,j,f.fileClient)}else if(d.dataTransfer.files&&
d.dataTransfer.files.length>0)for(l=0;l<d.dataTransfer.files.length;l++)k=d.dataTransfer.files[l],!k.length&&(!k.type||k.type==="")?f.registry.getService("orion.page.message").setProgressResult({Severity:"Error",Message:h.formatMessage(g["Did not drop ${0}.  Folder drop is not supported in this browser."],k.name)}):a.Location.indexOf("/workspace")===0?f.registry.getService("orion.page.message").setProgressResult({Severity:"Error",Message:g["You cannot copy files directly into the workspace.  Create a folder first."]}):
j(a,k,f,k.name.indexOf(".zip")===k.name.length-4&&window.confirm(h.formatMessage(g["Unzip ${0}?"],k.name)));b.stop(d)};if(d)this._oldDrop&&c.removeEventListener("drop",this._oldDrop,!1),this._oldDrop=k;c.addEventListener("drop",k,!1)}};c.prototype.changedItem=function(a,c){var b=this;this.registry.getService("orion.page.progress").progress(this.fileClient.fetchChildren(a.ChildrenLocation),"Fetching children of "+a.Name).then(function(d){d=b.model.processParent(a,d);b.getNavHandler();b.myTree.refresh.bind(b.myTree)(a,
d,c)})};c.prototype.isExpanded=function(a){return this.renderer.tableTree.isExpanded(this.model.getId(a))};c.prototype.getNameNode=function(a){if(a=this.model.getId(a))return b.node(a+"NameLink")};c.prototype.scopeUp=function(){if(this.treeRoot&&this.treeRoot.Parents)if(this.treeRoot.Parents.length===0)window.location.href="#";else if(this.treeRoot.Parents[0].ChildrenLocation)window.location.href="#"+this.treeRoot.Parents[0].ChildrenLocation};c.prototype.loadResourceList=function(a,c,b){a=f.makeRelative(a);
if(c||a!==this._lastPath){this._lastPath=a;var d=this;(c||a!==this.treeRoot.Path)&&this.load(this.fileClient.loadWorkspace(a),"Loading "+a,function(){d.treeRoot.Path=a;typeof b==="function"&&b()})}};c.prototype.load=function(a,c,e){var f=b.node(this.parentId),h=b.node("progress");if(!h)h=document.createElement("div"),h.id="progress",b.empty(f),f.appendChild(h);b.empty(h);var k=setTimeout(function(){b.empty(h);h.appendChild(document.createTextNode(c))},500),m=this;j.when(a,function(a){m.treeRoot={};
clearTimeout(k);for(var c in a)m.treeRoot[c]=a[c];m.model=new d(m.registry,m.treeRoot,m.fileClient,m.parentId,m.excludeFiles,m.excludeFolders);m.model.processParent(m.treeRoot,a.Children);if(m.dragAndDrop)m._hookedDrag?m._makeDropTarget(m.treeRoot,f,!0):(a=(a=f&&("draggable"in f||"ondragstart"in f&&"ondrop"in f))&&!(!window.File||!window.FileList||!window.FileReader),m._hookedDrag=!0,a?m._makeDropTarget(m.treeRoot,f,!0):(m.dragAndDrop=null,window.console.log("Local file drag and drop is not supported in this browser.")));
m.createTree(m.parentId,m.model,{setFocus:!0,selectionPolicy:m.renderer.selectionPolicy,onCollapse:function(a){if(m.getNavHandler())m.getNavHandler().onCollapse(a)}});if(typeof e==="function")try{e()}catch(b){m.registry&&m.registry.getService("orion.page.message").setErrorMessage(b)}if(typeof m.onchange==="function")m.onchange(m.treeRoot)},function(a){clearTimeout(k);if(a.status&&a.status!==401){try{a=JSON.parse(a.responseText)}catch(c){}b.empty(h);h.appendChild(document.createTextNode(g["Sorry, an error occurred: "]+
a.Message))}else m.registry.getService("orion.page.message").setProgressResult(a)})};c.prototype.onchange=function(){};c.prototype.constructor=c;return{FileExplorer:c,FileModel:d}});
define("orion/webui/dialogs/DirectoryPrompterDialog","i18n!orion/widgets/nls/messages,orion/webui/littlelib,orion/webui/dialog,orion/fileUtils,orion/selection,orion/explorers/navigationUtils,orion/explorers/explorer,orion/explorers/explorer-table".split(","),function(g,k,j,b,h,f,e,d){function c(a,c){this.explorer=c;this._init(a)}function a(a){this._init(a)}c.prototype=new e.SelectionRenderer;c.prototype.constructor=c;c.prototype.getLabelColumnIndex=function(){return 0};c.prototype.getCellElement=
function(a,c,b){a=document.createElement("td");b.appendChild(a);var d=document.createElement("span");d.id=b.id+"navSpan";a.appendChild(d);d.className="mainNavColumn singleNavColumn";this.getExpandImage(b,d);d.appendChild(document.createTextNode(c.Name))};a.prototype=new j.Dialog;a.prototype.TEMPLATE='<div id="message" style="width: 25em; padding-bottom: 5px;"></div><div id="directoryTree" class="explorerTreeClass" style="width:25em; min-height: 25em; max-height:30em; height: auto; overflow-y: auto;"></div>';
a.prototype._init=function(a){this.title=a.title||g["Choose a Folder"];this.modal=!0;this.buttons=[{text:g.OK,isDefault:!0,callback:this.done.bind(this)}];this.customFocus=!0;this._fileClient=a.fileClient;this._serviceRegistry=a.serviceRegistry;this._message=a.message||"";this._func=a.func;this._initialize()};a.prototype._bindToDom=function(){this.loadFolderList("/");this._message?this.$message.appendChild(document.createTextNode(this._message)):this.$message.style.display="none";this.$directoryTree.focus()};
a.prototype.loadFolderList=function(a){a=b.makeRelative(a);this.selection=new h.Selection(this._serviceRegistry,"orion.directoryPrompter.selection");this.explorer=new d.FileExplorer({treeRoot:{children:[]},selection:this.selection,serviceRegistry:this._serviceRegistry,fileClient:this._fileClient,parentId:"directoryTree",excludeFiles:!0,rendererFactory:function(a){return new c({checkbox:!1,singleSelection:!0,treeTableClass:"directoryPrompter"},a)}});this.explorer.loadResourceList(a,!0,null)};a.prototype.done=
function(){this.selection.getSelection(function(a){this.hide();this._func(a)}.bind(this))};a.prototype.constructor=a;return{DirectoryPrompterDialog:a}});
define("orion/git/widgets/CloneGitRepositoryDialog",["i18n!git/nls/gitmessages","orion/webui/dialogs/DirectoryPrompterDialog","orion/webui/dialog"],function(g,k,j){function b(b){this._init(b)}b.prototype=new j.Dialog;b.prototype.TEMPLATE='<span id="basicPane"><div style="padding: 8px"><label for="gitUrl">${Repository URL:}</label><input id="gitUrl" style="width: 50em" value=""/></div><div style="padding: 8px; text-align: right;"><a id="advancedLink" href="javascript:">${Choose target location}</a><a id="advancedLinkHide" href="javascript:" style="display: none">${Default target location}</a></div></span><span id="advancedPane" style="display: none;"><div style="padding: 8px"><input id="isNewProject" type="radio" name="isNewProject" checked value="new"/><label for="gitName" style="padding: 0 8px">${New folder:}</label><input id="gitName" value=""></div><div style="padding: 8px"><input id="isExistingProject" type="radio" name="isNewProject" value="existing"/><label for="gitPath" style="padding: 0 8px">${Existing directory:}</label><input id="gitPath" type="hidden" value=""><span id="shownGitPath" style="padding-right: 24px"></span><a id="changeGitPath" href="javascript:">${Change...}</a></div></span>';b.prototype._init=
function(b){var f=this;this.title=b.title?b.title:g["Clone Git Repository"];this.modal=!0;this.messages=g;this.advancedShown=!1;this.alwaysShowAdvanced=b.alwaysShowAdvanced;this.advancedOnly=b.advancedOnly;this.url=b.url;this.serviceRegistry=b.serviceRegistry;this.fileClient=b.fileClient;this.func=b.func;this.buttons=[];this.buttons.push({callback:function(){f.destroy();f._execute()},text:"OK"});this._initialize()};b.prototype._bindToDom=function(){var b=this;if(this.url)this.$gitUrl.value=this.url;
if(this.advancedOnly)this.$basicPane.style.display="none",this.$advancedPane.style.display="",setTimeout(function(){b.$gitName.focus()},400);this.$changeGitPath.addEventListener("click",function(){b._openDirectoryPickerDialog()});this.$isExistingProject.addEventListener("click",function(){b._checkNewExisting()});this.$isNewProject.addEventListener("click",function(){b._checkNewExisting()});this.$gitName.addEventListener("focus",function(){b._showNewProject()});this.$advancedLink.addEventListener("click",
function(){b._showAdvanced()});this.$advancedLinkHide.addEventListener("click",function(){b._hideAdvanced()});this.alwaysShowAdvanced&&this._showAdvanced()};b.prototype._execute=function(){this.func&&this.func(this.advancedOnly?void 0:this.$gitUrl.value,this.advancedShown&&this.$isNewProject.checked?void 0:this.$gitPath.value,this.advancedShown&&!this.$isNewProject.checked?void 0:this.$gitName.value)};b.prototype._showAdvanced=function(){this.advancedShown=!0;this.$advancedPane.style.display="";this.$advancedLink.style.display=
"none";this.$advancedLinkHide.style.display=""};b.prototype._hideAdvanced=function(){this.advancedShown=!1;this.$advancedPane.style.display="none";this.$advancedLink.style.display="";this.$advancedLinkHide.style.display="none"};b.prototype._checkNewExisting=function(){this.$isExistingProject.checked?this._openDirectoryPickerDialog():this.$gitName.focus()};b.prototype._showNewProject=function(){this.$isNewProject.checked=!0};b.prototype._openDirectoryPickerDialog=function(){function b(d){var c=document.createElement("a");
c.href=require.toUrl("navigate/table.html")+"#"+d.ChildrenLocation;c.textContent=d.Name;return c}var f=this;this.$isExistingProject.checked=!0;var e=new k.DirectoryPrompterDialog({title:g["Choose a Folder"],serviceRegistry:this.serviceRegistry,fileClient:this.fileClient,func:function(d){if(d&&d.Location){for(f.$gitPath.value=d.Location;f.$shownGitPath.hasChildNodes();)f.$shownGitPath.removeChild(f.$shownGitPath.lastChild);for(f.$shownGitPath.appendChild(b(d));d.parent&&d.parent.Location!=="/";)f.$shownGitPath.insertBefore(document.createTextNode("/"),
f.$shownGitPath.firstChild),f.$shownGitPath.insertBefore(b(d.parent),f.$shownGitPath.firstChild),d=d.parent}}});this._addChildDialog(e);e.show()};b.prototype.constructor=b;return{CloneGitRepositoryDialog:b}});
define("orion/git/gitCommands","i18n!git/nls/gitmessages,require,orion/Deferred,orion/i18nUtil,orion/webui/littlelib,orion/commands,orion/git/util,orion/compare/compareUtils,orion/git/gitPreferenceStorage,orion/git/widgets/ConfirmPushDialog,orion/git/widgets/RemotePrompterDialog,orion/git/widgets/ReviewRequestDialog,orion/git/widgets/CloneGitRepositoryDialog,orion/git/widgets/GitCredentialsDialog,orion/git/widgets/OpenCommitDialog,orion/git/widgets/CommitDialog,orion/git/widgets/ApplyPatchDialog,orion/URL-shim".split(","),function(g,
k,j,b,h,f,e,d,c,a,i,l,n,q,t,m,r){var o={};(function(){function x(a){var c;try{c=JSON.parse(a.responseText)}catch(b){c={Message:g["Problem while performing the action"]}}c.HttpCode=a.status;return c}var s=!1;o.updateNavTools=function(a,c,b,d,e,f){var g=h.node(b),i=a.getService("orion.page.command");if(g)i.destroy(g);else throw"could not find toolbar "+b;i.renderCommands(b,g,e,c,"button");if(f&&(b=h.node(f)))i.destroy(b),i.renderCommands(f,b,e,c,"button");if(d&&(e=h.node(d)))i.destroy(d),i.renderCommands(d,
e,null,c,"button");s||(s=!0,a.getService("orion.page.selection").addEventListener("selectionChanged",function(a){var b=h.node(d);b&&(i.destroy(b),i.renderCommands(d,b,a.selections,c,"button"))}))};o.handleKnownHostsError=function(a,c,d,e){if(confirm(b.formatMessage(g["Would you like to add ${0} key for host ${1} to continue operation? Key fingerpt is ${2}."],c.KeyType,c.Host,c.HostFingerprint))){var f=a.getService("orion.net.ssh");f.addKnownHosts(c.Host+" "+c.KeyType+" "+c.HostKey).then(function(){f.getKnownHosts().then(function(c){d.knownHosts=
c;typeof d.failedOperation!=="undefined"&&a.getService("orion.page.progress").removeOperation(d.failedOperation);e(d)})})}};o.handleSshAuthenticationError=function(a,b,d,e,f){var b=b?b.Url:void 0,g=function(){(new q.GitCredentialsDialog({title:f,serviceRegistry:a,func:e,errordata:d.errordata,failedOperation:d.failedOperation})).show()};d.gitSshUsername&&d.gitSshUsername!==""||d.gitSshPassword&&d.gitSshPassword!==""||d.gitPrivateKey&&d.gitPrivateKey!==""?g():(new c(a)).get(b).then(function(c){c.gitPrivateKey!==
""||c.gitSshUsername!==""||c.gitSshPassword!==""?(typeof d.failedOperation!=="undefined"&&a.getService("orion.page.progress").removeOperation(d.failedOperation),e({knownHosts:d.knownHosts,gitSshUsername:c.gitSshUsername,gitSshPassword:c.gitSshPassword,gitPrivateKey:c.gitPrivateKey,gitPassphrase:c.gitPassphrase})):g()},g)};o.getDefaultSshOptions=function(a,c){var b=new j,d=a.getService("orion.net.ssh"),e=c&&!c.optionsRequested?c.valueFor("sshuser"):"",f=c&&!c.optionsRequested?c.valueFor("sshpassword"):
"";d.getKnownHosts().then(function(a){b.resolve({knownHosts:a,gitSshUsername:e,gitSshPassword:f,gitPrivateKey:"",gitPassphrase:""})});return b};o.handleProgressServiceResponse=function(a,c,b,d,e,f){a&&a.status!==void 0&&(a=x(a));if(!a||a.HttpCode===void 0)d&&d(a);else switch(a.HttpCode){case 401:if(a.JsonData)c.errordata=a.JsonData;if(a.failedOperation)c.failedOperation=a.failedOperation;o.handleSshAuthenticationError(b,a.JsonData,c,e,f);break;case 400:if(a.JsonData&&a.JsonData.HostKey){if(a.failedOperation)c.failedOperation=
a.failedOperation;o.handleKnownHostsError(b,a.JsonData,c,e);break}default:c=[],c.Severity="Error",c.HTML=!1,c.Message=a.DetailedMessage?a.DetailedMessage:a.Message,b.getService("orion.page.message").setProgressResult(c),d&&d(a)}};o.gatherSshCredentials=function(a,d,e){var f=new j,i;if(d.items.RemoteLocation!==void 0)i=d.items.RemoteLocation[0].GitUrl;else if(d.items.GitUrl!==void 0)i=d.items.GitUrl;else if(d.items.errorData!==void 0)i=d.items.errorData.Url;else if(d.items.toRef!==void 0)i=d.items.toRef.RemoteLocation[0].GitUrl;
var h=function(c){a.getService("orion.net.ssh").getKnownHosts().then(function(a){d.sshObject=c;f.resolve({knownHosts:a,gitSshUsername:c.gitSshUsername,gitSshPassword:c.gitSshPassword,gitPrivateKey:c.gitPrivateKey,gitPassphrase:c.gitPassphrase})})},l=d.errorData;if(l&&l.HostKey)return confirm(b.formatMessage(g["Would you like to add ${0} key for host ${1} to continue operation? Key fingerpt is ${2}."],l.KeyType,l.Host,l.HostFingerprint))&&a.getService("orion.net.ssh").addKnownHosts(l.Host+" "+l.KeyType+
" "+l.HostKey).then(function(){d.sshObject&&(d.sshObject.gitSshUsername!==""||d.sshObject.gitSshPassword!==""||d.sshObject.gitPrivateKey!=="")?h({gitSshUsername:"",gitSshPassword:"",gitPrivateKey:"",gitPassphrase:""}):(new c(a)).get(i).then(function(a){h(a)},function(){h({gitSshUsername:"",gitSshPassword:"",gitPrivateKey:"",gitPassphrase:""})})}),f;var k=function(){if(!d.parameters&&!d.optionsRequested)h({gitSshUsername:"",gitSshPassword:"",gitPrivateKey:"",gitPassphrase:""});else if(d.parameters&&
!d.optionsRequested){var b=d.parameters?d.parameters.valueFor("sshuser"):"",f=d.parameters?d.parameters.valueFor("sshpassword"):"",g=d.parameters&&d.parameters.valueFor("saveCredentials")?d.parameters.valueFor("saveCredentials"):!1,j=new c(a);g?j.put(i,{gitSshUsername:b,gitSshPassword:f}).then(function(){h({gitSshUsername:b,gitSshPassword:f,gitPrivateKey:"",gitPassphrase:""})}):h({gitSshUsername:b,gitSshPassword:f,gitPrivateKey:"",gitPassphrase:""})}else(new q.GitCredentialsDialog({title:e,serviceRegistry:a,
func:h,errordata:l})).show()};d.sshObject&&(d.sshObject.gitSshUsername!==""||d.sshObject.gitSshPassword!==""||d.sshObject.gitPrivateKey!=="")?k():(new c(a)).get(i).then(function(a){a.gitPrivateKey!==""||a.gitSshUsername!==""||a.gitSshPassword!==""?h(a):k()},k);return f};o.handleGitServiceResponse=function(a,c,b,d){a&&a.status!==void 0&&(a=x(a));if(!a||!a.HttpCode)b&&b(a);else switch(a.HttpCode){case 401:d(a);break;case 400:if(a.JsonData&&a.JsonData.HostKey){d(a);break}default:d=[],d.Severity="Error",
d.HTML=!1,d.Message=a.DetailedMessage?a.DetailedMessage:a.Message,c.getService("orion.page.message").setProgressResult(d),b&&b(a)}};o.createFileCommands=function(h,m,n){function q(a){var c={Severity:"Error",HTML:!1};try{var b=JSON.parse(a.responseText);c.Message=b.DetailedMessage?b.DetailedMessage:b.Message?b.Message:g["Problem while performing the action"]}catch(d){c.Message=g["Problem while performing the action"]}h.getService("orion.page.message").setProgressResult(c)}var p=new f.ParametersDescription([new f.CommandParameter("name",
"text",g["Local Branch Name:"])]),p=new f.Command({name:g.Checkout,tooltip:g["Checkout the current tag, creating a local branch based on its contents."],imageClass:"git-sprite-checkout",spriteClass:"gitCommandSprite",id:"eclipse.checkoutTag",parameters:p,callback:function(a){var c=a.items,d=function(a,c,d){h.getService("orion.page.progress").showWhile(h.getService("orion.git.provider").checkoutTag(a,c,d),b.formatMessage(g["Checking out tag ${0}"],d)).then(function(){n.changedItem()},q)},e=c.Repository!==
null?c.Repository.Location:c.CloneLocation;a.parameters.valueFor("name")&&!a.parameters.optionsRequested&&d(e,c.Name,a.parameters.valueFor("name"))},visibleWhen:function(a){return a.Type==="Tag"}});m.addCommand(p);p=new f.Command({name:g.Checkout,tooltip:g["Checkout the branch or corresponding local branch and make it active. If the remote tracking branch does not have a corresponding local branch, the local branch will be created first."],imageClass:"git-sprite-checkout",spriteClass:"gitCommandSprite",
id:"eclipse.checkoutBranch",callback:function(a){var c=a.items,d=h.getService("orion.git.provider"),e=h.getService("orion.page.message"),f=h.getService("orion.page.progress");e.setProgressMessage(c.Name?b.formatMessage(g["Checking out branch ${0}..."],c.Name):g["Checking out branch..."]);c.Type==="Branch"?f.progress(d.checkoutBranch(c.CloneLocation,c.Name),"Checking out branch "+c.Name).then(function(){e.setProgressResult(g["Branch checked out."]);n.changedItem(c.parent)},function(a){q(a)}):f.progress(d.addBranch(c.Repository!==
null?c.Repository.BranchLocation:c.parent.parent.BranchLocation,null,c.Name),"Adding branch "+c.Name).then(function(a){f.progress(d.checkoutBranch(a.CloneLocation,a.Name),"Checking out branch "+c.Name).then(function(){e.setProgressResult(g["Branch checked out."]);n.changedItem(c.Repository?c.Repository.BranchLocation:c.parent.parent.parent)},function(a){q(a)})},function(a){q(a)})},visibleWhen:function(a){return a.Type==="Branch"||a.Type==="RemoteTrackingBranch"}});m.addCommand(p);p=new f.ParametersDescription([new f.CommandParameter("name",
"text","Name:")]);p=new f.Command({name:g["New Branch"],tooltip:g["Add a new local branch to the repository"],imageClass:"core-sprite-add",id:"eclipse.addBranch",parameters:p,callback:function(a){var c=a.items,b=h.getService("orion.page.progress"),d=function(a,d){b.progress(h.getService("orion.git.provider").addBranch(a,d),"Adding branch "+d).then(function(){n.changedItem(c)},q)},e;e=c.Type==="Clone"?c.BranchLocation:c.Location;a.parameters.valueFor("name")&&!a.parameters.optionsRequested&&d(e,a.parameters.valueFor("name"))},
visibleWhen:function(a){return a.GroupNode&&a.Name==="Branches"||a.Type==="Clone"&&n.parentId==="artifacts"}});m.addCommand(p);p=new f.Command({name:g.Delete,tooltip:g["Delete the local branch from the repository"],imageClass:"core-sprite-delete",id:"eclipse.removeBranch",callback:function(a){var c=a.items,a=h.getService("orion.page.progress");confirm(b.formatMessage(g["Are you sure you want to delete branch ${0}?"],c.Name))&&a.progress(h.getService("orion.git.provider").removeBranch(c.Location),
"Removing branch "+c.Name).then(function(){n.changedItem?n.changedItem(c.parent):n.displayBranches&&n.displayBranches(c.ParentLocation,null)},q)},visibleWhen:function(a){return a.Type==="Branch"&&!a.Current}});m.addCommand(p);p=new f.Command({name:g.Delete,tooltip:g["Delete the remote tracking branch from the repository"],imageClass:"core-sprite-delete",id:"eclipse.removeRemoteBranch",callback:function(a){var c=a.items,d=h.getService("orion.page.progress");confirm(b.formatMessage(g["You're going to delete remote branch ${0} and push the change."],
c.Name)+"\n\n"+g["Are you sure?"])&&o.getDefaultSshOptions(h).then(function(a){var b=arguments.callee,e=h.getService("orion.git.provider"),f=h.getService("orion.page.message"),e=d.progress(e.doPush(c.Location,"",!1,!1,a.gitSshUsername,a.gitSshPassword,a.knownHosts,a.gitPrivateKey,a.gitPassphrase),g["Removing remote branch: "]+c.Name);f.createProgressMonitor(e,g["Removing remote branch: "]+c.Name);e.then(function(d){o.handleProgressServiceResponse(d,a,h,function(a){a.Result.Severity=="Ok"&&n.changedItem(c.parent)},
b,g["Delete Remote Branch"])},function(d){o.handleProgressServiceResponse(d,a,h,function(){},b,g["Removing remote branch: "]+c.Name)})})},visibleWhen:function(a){return a.Type==="RemoteTrackingBranch"}});m.addCommand(p);p=new f.ParametersDescription([new f.CommandParameter("name","text","Name:"),new f.CommandParameter("url","url","Url:")]);p=new f.Command({name:g["New Remote"],tooltip:g["Add a new remote to the repository"],imageClass:"core-sprite-add",id:"eclipse.addRemote",parameters:p,callback:function(a){var c=
a.items,b=h.getService("orion.page.progress"),d=function(a,d,e){b.progress(h.getService("orion.git.provider").addRemote(a,d,e),"Adding remote "+a).then(function(){n.changedItem(c)},q)},e;e=c.Type==="Clone"?c.RemoteLocation:c.Location;a.parameters.valueFor("name")&&a.parameters.valueFor("url")&&d(e,a.parameters.valueFor("name"),a.parameters.valueFor("url"))},visibleWhen:function(a){return a.GroupNode&&a.Name==="Remotes"||a.Type==="Clone"&&n.parentId==="artifacts"}});m.addCommand(p);p=new f.Command({name:g.Delete,
tooltip:g["Delete the remote from the repository"],imageClass:"core-sprite-delete",id:"eclipse.removeRemote",callback:function(a){var c=a.items;confirm(b.formatMessage(g["Are you sure you want to delete remote ${0}?"],c.Name))&&h.getService("orion.page.progress").progress(h.getService("orion.git.provider").removeRemote(c.Location),"Removing remote "+c.Name).then(function(){n.changedItem(c.parent)},q)},visibleWhen:function(a){return a.Type==="Remote"}});m.addCommand(p);p=new f.Command({name:g.Pull,
tooltip:g["Pull from the repository"],imageClass:"git-sprite-pull",spriteClass:"gitCommandSprite",id:"eclipse.orion.git.pull",callback:function(a){var c=a.items,b=c.Location,d=c.Name;o.getDefaultSshOptions(h).then(function(a){var e=arguments.callee,f=h.getService("orion.git.provider"),i=h.getService("orion.page.message"),f=h.getService("orion.page.progress").progress(f.doPull(b,!1,a.gitSshUsername,a.gitSshPassword,a.knownHosts,a.gitPrivateKey,a.gitPassphrase),g["Pulling: "]+d);i.createProgressMonitor(f,
g["Pulling: "]+d);var j;f.then(function(b){o.handleProgressServiceResponse(b,a,h,function(){c.Type==="Clone"&&n.changedItem(c)},e,"Pull Git Repository")},function(b){if(j)b.failedOperation=j;o.handleProgressServiceResponse(b,a,h,function(){n.changedItem(c)},e,g["Pull Git Repository"])},function(a){j=a.Location})})},visibleWhen:function(a){return a.Type==="Clone"}});m.addCommand(p);p=new f.Command({name:g["Git Log"],tooltip:g["Open the log for the branch"],id:"eclipse.openGitLog",imageClass:"git-sprite-log",
spriteClass:"gitCommandSprite",hrefCallback:function(a){a=a.items;return k.toUrl("git/git-log.html")+"#"+a.CommitLocation+"?page=1"},visibleWhen:function(a){return a.Type==="Branch"||a.Type==="RemoteTrackingBranch"}});m.addCommand(p);p=new f.Command({name:g["Git Log"],tooltip:g["Open the log for the repository"],id:"eclipse.openGitLogAll",imageClass:"git-sprite-log",spriteClass:"gitCommandSprite",hrefCallback:function(a){return k.toUrl("git/git-log.html")+"#"+a.items.CommitLocation+"?page=1"},visibleWhen:function(a){return!a.CommitLocation||
!a.StatusLocation?!1:!0}});m.addCommand(p);p=new f.Command({name:g["Git Status"],tooltip:g["Open the status for the repository"],id:"eclipse.openGitStatus",imageClass:"git-sprite-status",spriteClass:"gitCommandSprite",hrefCallback:function(a){return k.toUrl(e.statusUILocation)+"#"+a.items.StatusLocation},visibleWhen:function(a){return!a.StatusLocation?!1:!0}});m.addCommand(p);p=new f.Command({name:g["Show in Navigator"],tooltip:g["Show the repository folder in the file navigator"],id:"eclipse.openCloneContent",
hrefCallback:function(a){return k.toUrl("navigate/table.html")+"#"+a.items.ContentLocation+"?depth=1"},visibleWhen:function(a){return!a.ContentLocation?!1:!0}});m.addCommand(p);p=new f.Command({name:g["Compare With Each Other"],imageClass:"git-sprite-open_compare",spriteClass:"gitCommandSprite",id:"eclipse.compareGitCommits",hrefCallback:function(a){a=a.items;return h.getService("orion.page.progress").progress(h.getService("orion.git.provider").getDiff(a[1].DiffLocation,a[0].Name),"Generating Diff for "+
a[0].Name+" and "+a[1].Name).then(function(a){return d.generateCompareHref(a,{readonly:!0})})},visibleWhen:function(a){return n.isDirectory?!1:Array.isArray(a)&&a.length===2&&a[0].Type==="Commit"&&a[1].Type==="Commit"?!0:!1}});m.addCommand(p);p=new f.Command({name:g["Compare With Working Tree"],imageClass:"git-sprite-open_compare",spriteClass:"gitCommandSprite",id:"eclipse.compareWithWorkingTree",hrefCallback:function(a){return d.generateCompareHref(a.items.DiffLocation,{})},visibleWhen:function(a){return a.Type===
"Commit"&&a.ContentLocation!==null&&!n.isDirectory}});m.addCommand(p);p=new f.Command({name:g.Open,id:"eclipse.openGitCommit",hrefCallback:function(a){return k.toUrl("edit/edit.html")+"#"+a.items.ContentLocation},visibleWhen:function(a){return a.Type==="Commit"&&a.ContentLocation!=null&&!n.isDirectory}});m.addCommand(p);p=new f.Command({name:g.Fetch,tooltip:g["Fetch from the remote"],imageClass:"git-sprite-fetch",spriteClass:"gitCommandSprite",id:"eclipse.orion.git.fetch",callback:function(a){var b=
a.items,d=b.Location,e=b.Name,i=function(a,b){a.JsonData.HostKey?(b.parameters=null,b.errorData=a.JsonData,b.errorData.failedOperation=a.failedOperation,m.collectParameters(b)):b.optionsRequested?(b.errorData=a.JsonData,b.errorData.failedOperation=a.failedOperation,m.collectParameters(b)):(new c(h)).isEnabled().then(function(c){b.parameters=c?a.JsonData.User?new f.ParametersDescription([new f.CommandParameter("sshpassword","password",g["SSH Password:"]),new f.CommandParameter("saveCredentials","boolean",
g["Don't prompt me again:"])],{hasOptionalParameters:!0}):new f.ParametersDescription([new f.CommandParameter("sshuser","text",g["SSH User Name:"]),new f.CommandParameter("sshpassword","password",g["SSH Password:"]),new f.CommandParameter("saveCredentials","boolean",g["Don't prompt me again:"])],{hasOptionalParameters:!0}):a.JsonData.User?new f.ParametersDescription([new f.CommandParameter("sshpassword","password",g["SSH Password:"])],{hasOptionalParameters:!0}):new f.ParametersDescription([new f.CommandParameter("sshuser",
"text",g["SSH User Name:"]),new f.CommandParameter("sshpassword","password",g["SSH Password:"])],{hasOptionalParameters:!0});b.errorData=a.JsonData;b.errorData.failedOperation=a.failedOperation;m.collectParameters(b)})},j=function(){a.parameters&&a.parameters.optionsRequested?(a.parameters=null,a.optionsRequested=!0,m.collectParameters(a)):(a.errorData&&a.errorData.failedOperation&&h.getService("orion.page.progress").removeOperation(a.errorData.failedOperation),o.gatherSshCredentials(h,a).then(function(c){var f=
h.getService("orion.git.provider"),j=h.getService("orion.page.message"),c=h.getService("orion.page.progress").progress(f.doFetch(d,!1,c.gitSshUsername,c.gitSshPassword,c.knownHosts,c.gitPrivateKey,c.gitPassphrase),g["Fetching remote: "]+e);j.createProgressMonitor(c,g["Fetching remote: "]+e);c.then(function(c){o.handleGitServiceResponse(c,h,function(){n.changedItem(b)},function(c){i(c,a)})},function(c){o.handleGitServiceResponse(c,h,function(){n.changedItem(b)},function(c){i(c,a)})})}))};if(a.items.GitUrl)j();
else{var l=h.getService("orion.git.provider"),k=h.getService("orion.page.progress");k.progress(l.getGitRemote(d),"Getting remote details "+e).then(function(c){k.progress(l.getGitClone(c.CloneLocation),"Getting git repository information "+c.Name).then(function(c){a.items.GitUrl=c.Children[0].GitUrl;j()},q)},q)}},visibleWhen:function(a){return a.Type==="RemoteTrackingBranch"?!0:a.Type==="Remote"?!0:a.Type==="Commit"&&a.toRef&&a.toRef.Type==="RemoteTrackingBranch"?!0:!1}});m.addCommand(p);p=new f.Command({name:g["Force Fetch"],
imageClass:"git-sprite-fetch",spriteClass:"gitCommandSprite",tooltip:g["Fetch from the remote branch into your remote tracking branch overriding its current content"],id:"eclipse.orion.git.fetchForce",callback:function(a){if(confirm(g["You're going to override content of the remote tracking branch. This can cause the branch to lose commits."]+"\n\n"+g["Are you sure?"])){var b=a.items,d=b.Location,e=b.Name,i=function(a,b){a.JsonData.HostKey?(b.parameters=null,b.errorData=a.JsonData,b.errorData.failedOperation=
a.failedOperation,m.collectParameters(b)):b.optionsRequested?(b.errorData=a.JsonData,m.collectParameters(b)):(new c(h)).isEnabled().then(function(c){b.parameters=c?a.JsonData.User?new f.ParametersDescription([new f.CommandParameter("sshpassword","password",g["SSH Password:"]),new f.CommandParameter("saveCredentials","boolean",g["Don't prompt me again:"])],{hasOptionalParameters:!0}):new f.ParametersDescription([new f.CommandParameter("sshuser","text",g["SSH User Name:"]),new f.CommandParameter("sshpassword",
"password",g["SSH Password:"]),new f.CommandParameter("saveCredentials","boolean",g["Don't prompt me again:"])],{hasOptionalParameters:!0}):a.JsonData.User?new f.ParametersDescription([new f.CommandParameter("sshpassword","password",g["SSH Password:"])],{hasOptionalParameters:!0}):new f.ParametersDescription([new f.CommandParameter("sshuser","text",g["SSH User Name:"]),new f.CommandParameter("sshpassword","password",g["SSH Password:"])],{hasOptionalParameters:!0});b.errorData=a.JsonData;b.errorData.failedOperation=
a.failedOperation;m.collectParameters(b)})},j=function(){a.parameters&&a.parameters.optionsRequested?(a.parameters=null,a.optionsRequested=!0,m.collectParameters(a)):(a.errorData&&a.errorData.failedOperation&&h.getService("orion.page.progress").removeOperation(a.errorData.failedOperation),o.gatherSshCredentials(h,a).then(function(c){var f=h.getService("orion.git.provider"),j=h.getService("orion.page.progress"),l=h.getService("orion.page.message"),c=j.progress(f.doFetch(d,!0,c.gitSshUsername,c.gitSshPassword,
c.knownHosts,c.gitPrivateKey,c.gitPassphrase),g["Fetching remote: "]+e);l.createProgressMonitor(c,g["Fetching remote: "]+e);c.then(function(c){o.handleGitServiceResponse(c,h,function(){n.changedItem(b)},function(c){i(c,a)})},function(c){o.handleGitServiceResponse(c,h,function(){n.changedItem(b)},function(c){i(c,a)})})}))};if(a.items.GitUrl)j();else{var l=h.getService("orion.git.provider");l.getGitRemote(d).then(function(c){l.getGitClone(c.CloneLocation).then(function(c){a.items.GitUrl=c.Children[0].GitUrl;
j()})})}}},visibleWhen:function(a){return a.Type==="RemoteTrackingBranch"?!0:a.Type==="Remote"?!0:a.Type==="Commit"&&a.toRef&&a.toRef.Type==="RemoteTrackingBranch"?!0:!1}});m.addCommand(p);p=new f.Command({name:g.Merge,tooltip:g["Merge the content from the branch to your active branch"],imageClass:"git-sprite-merge",spriteClass:"gitCommandSprite",id:"eclipse.orion.git.merge",callback:function(a){var c=a.items,a=h.getService("orion.git.provider"),d=h.getService("orion.page.progress"),f=h.getService("orion.page.message");
d.progress(a.doMerge(c.HeadLocation,c.Name,!1),"Merging "+c.Name).then(function(a){var d={};if(a.Result==="FAST_FORWARD"||a.Result==="ALREADY_UP_TO_DATE")d.Severity="Ok",d.HTML=!1,d.Message=a.Result;else if(a.Result){var i=c.HeadLocation.replace("commit/HEAD","status");d.Severity="Warning";d.HTML=!0;d.Message="<span>"+a.Result;if(a.FailingPaths){var h="",j=!0,l;for(l in a.FailingPaths)j||(h+=", "),j=!1,h+=l;j||(d.Message+=". "+b.formatMessage(g["Failing paths: ${0}"],h))}d.Message+=b.formatMessage(g[". Go to ${0}."],
'<a href="'+k.toUrl(e.statusUILocation)+"#"+i+'">'+g["Git Status page"]+"</a>")+"</span>"}else if(a.error)i=c.HeadLocation.replace("commit/HEAD","status"),d.Severity="Error",a.error.responseText&&JSON.parse(a.error.responseText)?(a=JSON.parse(a.error.responseText),d.Message=a.DetailedMessage?a.DetailedMessage:a.Message):d.Message=a.error.message,d.HTML=!0,d.Message="<span>"+d.Message+b.formatMessage(g[". Go to ${0}."],'<a href="'+k.toUrl(e.statusUILocation)+"#"+i+'">'+g["Git Status page"]+"</a>")+
"</span>";f.setProgressResult(d);n.changedItem(c)},function(a,d){var f=[],i=c.HeadLocation.replace("commit/HEAD","status");f.Severity="Error";f.HTML=!0;f.Message="<span>"+JSON.stringify(d.xhr.responseText).DetailedMessage+b.formatMessage(g[". Go to ${0}."],'<a href="'+k.toUrl(e.statusUILocation)+"#"+i+'">'+g["Git Status page"]+"</a>")+".</span>";h.getService("orion.page.message").setProgressResult(f);n.changedItem(c)})},visibleWhen:function(a){return a.Type==="RemoteTrackingBranch"?!0:a.Type==="Branch"&&
!a.Current?!0:a.Type==="Commit"&&a.toRef&&a.toRef.Type==="RemoteTrackingBranch"?!0:!1}});m.addCommand(p);p=new f.Command({name:g["Merge Squash"],tooltip:g["Squash the content of the branch to the index"],imageClass:"git-sprite-merge_squash",spriteClass:"gitCommandSprite",id:"eclipse.orion.git.mergeSquash",callback:function(a){var c=a.items,a=h.getService("orion.git.provider"),d=h.getService("orion.page.progress"),f=h.getService("orion.page.message");d.progress(a.doMerge(c.HeadLocation,c.Name,!0),
"Merging "+c.Name).then(function(a){var d=[];if(a.Result==="FAST_FORWARD_SQUASHED"||a.Result==="ALREADY_UP_TO_DATE")d.Severity="Ok",d.HTML=!1,d.Message=a.Result;else if(a.Result){var i=c.HeadLocation.replace("commit/HEAD","status");d.Severity="Warning";d.HTML=!0;d.Message="<span>"+a.Result+b.formatMessage(g[". Go to ${0}."],'<a href="'+k.toUrl(e.statusUILocation)+"#"+i+'">'+g["Git Status page"]+"</a>")+"</span>"}else if(a.error)i=c.HeadLocation.replace("commit/HEAD","status"),d.Severity="Error",a.error.responseText&&
JSON.parse(a.error.responseText)?(a=JSON.parse(a.error.responseText),d.Message=a.DetailedMessage?a.DetailedMessage:a.Message):d.Message=a.error.message,d.HTML=!0,d.Message="<span>"+d.Message+b.formatMessage(g[". Go to ${0}."],'<a href="'+k.toUrl(e.statusUILocation)+"#"+i+'">'+g["Git Status page"]+"</a>")+"</span>";f.setProgressResult(d);n.changedItem(c)},function(a,d){var f=[],i=c.HeadLocation.replace("commit/HEAD","status");f.Severity="Error";f.HTML=!0;f.Message="<span>"+JSON.stringify(d.xhr.responseText).DetailedMessage+
b.formatMessage(g[". Go to ${0}."],'<a href="'+k.toUrl(e.statusUILocation)+"#"+i+'">'+g["Git Status page"]+"</a>")+".</span>";h.getService("orion.page.message").setProgressResult(f);n.changedItem(c)})},visibleWhen:function(a){return a.Type==="RemoteTrackingBranch"?!0:a.Type==="Branch"&&!a.Current?!0:a.Type==="Commit"&&a.toRef&&a.toRef.Type==="RemoteTrackingBranch"?!0:!1}});m.addCommand(p);p=new f.Command({name:g.Rebase,tooltip:g["Rebase your commits by removing them from the active branch, starting the active branch again based on the latest state of the selected branch "]+
"and applying each commit again to the updated active branch.",id:"eclipse.orion.git.rebase",imageClass:"git-sprite-rebase",spriteClass:"gitCommandSprite",callback:function(a){var c=a.items,a=h.getService("orion.page.message"),d=h.getService("orion.page.progress").progress(h.getService("orion.git.provider").doRebase(c.HeadLocation,c.Name,"BEGIN"),c.Name?g["Rebase on top of "]+c.Name:g.Rebase);a.createProgressMonitor(d,c.Name?g["Rebase on top of "]+c.Name:g.Rebase);d.then(function(a){var d=[],f=c.HeadLocation.replace("commit/HEAD",
"status");a.Result==="OK"||a.Result==="FAST_FORWARD"||a.Result==="UP_TO_DATE"?(d.Severity="Ok",d.HTML=!1,d.Message=a.Result):a.Result==="STOPPED"?(d.Severity="Warning",d.HTML=!0,d.Message="<span>"+a.Result+g[". Some conflicts occurred. Please resolve them and continue, skip patch or abort rebasing"]+b.formatMessage(g[". Go to ${0}."],'<a href="'+k.toUrl(e.statusUILocation)+"#"+f+'">'+g["Git Status page"]+"</a>")+".</span>"):a.Result==="FAILED_WRONG_REPOSITORY_STATE"?(d.Severity="Error",d.HTML=!0,
d.Message="<span>"+a.Result+g[". Repository state is invalid (i.e. already during rebasing)"]+b.formatMessage(". Go to ${0}.",'<a href="'+k.toUrl(e.statusUILocation)+"#"+f+'">'+g["Git Status page"]+"</a>")+".</span>"):a.Result==="FAILED_UNMERGED_PATHS"?(d.Severity="Error",d.HTML=!0,d.Message="<span>"+a.Result+g[". Repository contains unmerged paths"]+b.formatMessage(g[". Go to ${0}."],'<a href="'+k.toUrl(e.statusUILocation)+"#"+f+'">'+g["Git Status page"]+"</a>")+".</span>"):a.Result==="FAILED_PENDING_CHANGES"?
(d.Severity="Error",d.HTML=!0,d.Message="<span>"+a.Result+g[". Repository contains pending changes. Please commit or stash them"]+b.formatMessage(g[". Go to ${0}."],'<a href="'+k.toUrl(e.statusUILocation)+"#"+f+'">Git Status page</a>')+".</span>"):(d.Severity="Warning",d.HTML=!0,d.Message="<span>"+a.Result+b.formatMessage(g[". Go to ${0}."],'<a href="'+k.toUrl(e.statusUILocation)+"#"+f+'">'+g["Git Status page"]+"</a>")+".</span>");h.getService("orion.page.message").setProgressResult(d);n.changedItem(c)},
q)},visibleWhen:function(a){this.tooltip=g["Rebase your commits by removing them from the active branch, "]+g["starting the active branch again based on the latest state of '"]+a.Name+"' "+g["and applying each commit again to the updated active branch."];return a.Type==="RemoteTrackingBranch"||a.Type==="Branch"&&!a.Current}});m.addCommand(p);p=new f.Command({name:g["Push All"],tooltip:g["Push commits and tags from your local branch into the remote branch"],imageClass:"git-sprite-push",spriteClass:"gitCommandSprite",
id:"eclipse.orion.git.push",callback:function(b){var d=b.targetBranch,e,l=b.items;if(l.toRef)l=l.toRef;l.CloneLocation.split("/");var k=function(a,b){a.JsonData.HostKey?(b.parameters=null,b.errorData=a.JsonData,b.errorData.failedOperation=a.failedOperation,m.collectParameters(b)):b.optionsRequested?(b.errorData=a.JsonData,b.errorData.failedOperation=a.failedOperation,m.collectParameters(b)):(new c(h)).isEnabled().then(function(c){b.parameters=c?a.JsonData.User?new f.ParametersDescription([new f.CommandParameter("sshpassword",
"password",g["SSH Password:"]),new f.CommandParameter("saveCredentials","boolean",g["Don't prompt me again:"])],{hasOptionalParameters:!0}):new f.ParametersDescription([new f.CommandParameter("sshuser","text",g["SSH User Name:"]),new f.CommandParameter("sshpassword","password",g["SSH Password:"]),new f.CommandParameter("saveCredentials","boolean",g["Don't prompt me again:"])],{hasOptionalParameters:!0}):a.JsonData.User?new f.ParametersDescription([new f.CommandParameter("sshpassword","password",g["SSH Password:"])],
{hasOptionalParameters:!0}):new f.ParametersDescription([new f.CommandParameter("sshuser","text",g["SSH User Name:"]),new f.CommandParameter("sshpassword","password",g["SSH Password:"])],{hasOptionalParameters:!0});b.errorData=a.JsonData;b.errorData.failedOperation=a.failedOperation;m.collectParameters(b)})};if(b.parameters&&b.parameters.optionsRequested)b.parameters=null,b.optionsRequested=!0,m.collectParameters(b);else{var p=h.getService("orion.git.provider"),q=h.getService("orion.page.progress");
b.errorData&&b.errorData.failedOperation&&q.removeOperation(b.errorData.failedOperation);var t=function(a,c,d,e,f){var i=h.getService("orion.page.message"),a=q.progress(p.doPush(c,d,!0,f,a.gitSshUsername,a.gitSshPassword,a.knownHosts,a.gitPrivateKey,a.gitPassphrase),g["Pushing remote: "]+e);i.createProgressMonitor(a,g["Pushing remote: "]+e);a.then(function(a){o.handleGitServiceResponse(a,h,function(){n.changedItem()},function(a){k(a,b)})},function(a){o.handleGitServiceResponse(a,h,function(){n.changedItem()},
function(a){k(a,b)})})};q.progress(p.getGitClone(l.CloneLocation),"Getting git repository details "+l.Name).then(function(c){var f=c.Children[0].RemoteLocation,k=c.Children[0].ConfigLocation,m=function(a){handleProgressServiceResponse(a,{},h)};o.gatherSshCredentials(h,b).then(function(c){var n=new j;if(l.RemoteLocation.length===1&&l.RemoteLocation[0].Children.length===1)n=q.progress(p.getGitRemote(f),"Getting git remote details "+l.Name);else{var o={};o.Children=l.RemoteLocation;n.resolve(o)}n.then(function(f){d?
t(c,d.Location,"HEAD",d.Name,!1):(f=new i.RemotePrompterDialog({title:g["Choose Branch"],serviceRegistry:h,gitClient:p,treeRoot:{Children:f.Children},hideNewBranch:!1,func:function(a,d,f){e=a===null?f:a;var g="branch."+l.Name+".remote";q.progress(p.addCloneConfigurationProperty(k,g,e.parent.Name),"Adding git configuration property "+l.Name).then(function(){b.targetBranch=e;t(c,e.Location,"HEAD",e.Name,!1)},function(a){a.status===409?p.getGitCloneConfig(k).then(function(a){if(a.Children)for(var d=
0;d<a.Children.length;d++)if(a.Children[d].Key===g){q.progress(p.editCloneConfigurationProperty(a.Children[d].Location,e.parent.Name),"Updating configuration property "+e.parent.Name).then(function(){b.targetBranch=e;t(c,e.Location,"HEAD",e.Name,!1)},m);break}},m):m(erry)})}}),l.RemoteLocation.length===1&&l.RemoteLocation[0].Children.length===1&&(f=new a.ConfirmPushDialog({title:g["Choose Branch"],serviceRegistry:h,gitClient:p,dialog:f,location:l.RemoteLocation[0].Children[0].Name,func:function(){b.targetBranch=
l.RemoteLocation[0].Children[0];t(c,l.RemoteLocation[0].Children[0].Location,"HEAD",l.Name,!1)}})),f.show())})})})}},visibleWhen:function(a){return a.toRef?a.RepositoryPath===""&&a.toRef.Type==="Branch"&&a.toRef.Current&&a.toRef.RemoteLocation:a.Type==="Branch"&&a.Current&&a.RemoteLocation}});m.addCommand(p);p=new f.Command({name:g["Force Push All"],tooltip:g["Push commits and tags from your local branch into the remote branch overriding its current content"],imageClass:"git-sprite-push",spriteClass:"gitCommandSprite",
id:"eclipse.orion.git.pushForce",callback:function(b){var d=b.confirmedWarnings,e=b.targetBranch;if(!d)if(confirm(g["You're going to override content of the remote branch. This can cause the remote repository to lose commits."]+"\n\n"+g["Are you sure?"]))d=b.confirmedWarnings=!0;else return;var l,k=b.items;if(k.toRef)k=k.toRef;var p=k.CloneLocation.split("/"),q=function(a,b){a.JsonData.HostKey?(b.parameters=null,b.errorData=a.JsonData,m.collectParameters(b)):b.optionsRequested?(b.errorData=a.JsonData,
m.collectParameters(b)):(new c(h)).isEnabled().then(function(c){b.parameters=c?a.JsonData.User?new f.ParametersDescription([new f.CommandParameter("sshpassword","password",g["SSH Password:"]),new f.CommandParameter("saveCredentials","boolean",g["Don't prompt me again:"])],{hasOptionalParameters:!0}):new f.ParametersDescription([new f.CommandParameter("sshuser","text",g["SSH User Name:"]),new f.CommandParameter("sshpassword","password",g["SSH Password:"]),new f.CommandParameter("saveCredentials","boolean",
g["Don't prompt me again:"])],{hasOptionalParameters:!0}):a.JsonData.User?new f.ParametersDescription([new f.CommandParameter("sshpassword","password",g["SSH Password:"])],{hasOptionalParameters:!0}):new f.ParametersDescription([new f.CommandParameter("sshuser","text",g["SSH User Name:"]),new f.CommandParameter("sshpassword","password",g["SSH Password:"])],{hasOptionalParameters:!0});b.errorData=a.JsonData;m.collectParameters(b)})};if(b.parameters&&b.parameters.optionsRequested)b.parameters=null,
b.optionsRequested=!0,m.collectParameters(b);else{var t=h.getService("orion.git.provider"),r=h.getService("orion.page.progress"),s=function(a,c,d,e,f){var i=h.getService("orion.page.message"),a=r.progress(t.doPush(c,d,!0,f,a.gitSshUsername,a.gitSshPassword,a.knownHosts,a.gitPrivateKey,a.gitPassphrase),g["Pushing remote: "]+e);i.createProgressMonitor(a,g["Pushing remote: "]+e);a.then(function(a){o.handleGitServiceResponse(a,h,function(){n.changedItem()},function(a){q(a,b)})},function(a){o.handleGitServiceResponse(a,
h,function(){n.changedItem(k)},function(a){q(a,b)})})};r.progress(t.getGitClone(k.CloneLocation),"Getting git repository details "+k.Name).then(function(c){var d=c.Children[0].RemoteLocation,f=c.Children[0].ConfigLocation;o.gatherSshCredentials(h,b).then(function(c){var m=new j;if(k.RemoteLocation.length===1&&k.RemoteLocation[0].Children.length===1)m=r.progress(t.getGitRemote(d),"Getting remote details "+k.Name);else{var n={};n.Children=k.RemoteLocation;m.resolve(n)}m.then(function(d){e?s(c,e.Location,
"HEAD",e.Name,!0):(d=new i.RemotePrompterDialog({title:g["Choose Branch"],serviceRegistry:h,gitClient:t,treeRoot:{Children:d.Children},hideNewBranch:!1,func:function(a,d,e){l=a===null?e:a;var g="/gitapi/config/branch."+k.Name+".remote/clone/file/"+p[4];r.progress(t.addCloneConfigurationProperty(f,"branch."+k.Name+".remote",l.parent.Name),"Setting git configuration property "+k.Name).then(function(){b.targetBranch=l;s(c,l.Location,"HEAD",l.Name,!0)},function(a){a.status===409&&r.progres(t.editCloneConfigurationProperty(g,
l.parent.Name),"Setting git configuration property "+l.parent.Name).then(function(){b.targetBranch=l;s(c,l.Location,"HEAD",l.Name,!0)})})}}),k.RemoteLocation.length===1&&k.RemoteLocation[0].Children.length===1&&(d=new a.ConfirmPushDialog({title:g["Choose Branch"],serviceRegistry:h,gitClient:t,dialog:d,location:k.RemoteLocation[0].Children[0].Name,func:function(){b.targetBranch=k.RemoteLocation[0].Children[0];s(c,k.RemoteLocation[0].Children[0].Location,"HEAD",k.Location,!0)}})),d.startup(),d.show())})})})}},
visibleWhen:function(a){if(a.toRef)return a.RepositoryPath===""&&a.toRef.Type==="Branch"&&a.toRef.Current&&a.toRef.RemoteLocation}});m.addCommand(p);p=new f.Command({name:g["< Previous Page"],tooltip:g["Show previous page of git log"],id:"eclipse.orion.git.previousLogPage",hrefCallback:function(a){return k.toUrl("git/git-log.html")+"#"+a.items.PreviousLocation},visibleWhen:function(a){return a.Type==="RemoteTrackingBranch"||a.toRef!==null&&a.toRef.Type==="Branch"||a.RepositoryPath!==null?a.PreviousLocation!==
void 0:!1}});m.addCommand(p);p=new f.Command({name:g["Next Page >"],tooltip:g["Show next page of git log"],id:"eclipse.orion.git.nextLogPage",hrefCallback:function(a){return k.toUrl("git/git-log.html")+"#"+a.items.NextLocation},visibleWhen:function(a){return a.Type==="RemoteTrackingBranch"||a.toRef!==null&&a.toRef.Type==="Branch"||a.RepositoryPath!==null?a.NextLocation!==void 0:!1}});m.addCommand(p);p=new f.Command({name:g["< Previous Page"],tooltip:g["Show previous page of git tags"],id:"eclipse.orion.git.previousTagPage",
hrefCallback:function(a){return k.toUrl("git/git-repository.html")+"#"+a.items.PreviousLocation},visibleWhen:function(a){return a.Type==="Tag"?a.PreviousLocation!==void 0:!1}});m.addCommand(p);p=new f.Command({name:g["Next Page >"],tooltip:g["Show next page of git tags"],id:"eclipse.orion.git.nextTagPage",hrefCallback:function(a){return k.toUrl("git/git-repository.html")+"#"+a.items.NextLocation},visibleWhen:function(a){return a.Type==="Tag"?a.NextLocation!==void 0:!1}});m.addCommand(p);p=new f.Command({name:g.Reset,
tooltip:g["Reset your active branch to the state of the selected branch. Discard all staged and unstaged changes."],id:"eclipse.orion.git.resetIndex",imageClass:"git-sprite-reset",spriteClass:"gitCommandSprite",callback:function(a){var c=a.items;if(confirm(g["The content of your active branch will be replaced with "]+c.Name+". "+g["All unstaged and staged changes will be discarded and cannot be recovered. Are you sure?"])){var a=h.getService("orion.git.provider"),b=h.getService("orion.page.message"),
a=h.getService("orion.page.progress").progress(a.resetIndex(c.IndexLocation,c.Name),"Resetting git index for "+c.Name);b.createProgressMonitor(a,g["Resetting index..."]);a.then(function(){n.changedItem(c);b.setProgressResult({Severity:"Info",HTML:!1,Message:"Ok"})},function(a){var c={Severity:"Error",HTML:!1};c.Message=a.message;b.setProgressResult(c)})}},visibleWhen:function(a){return a.Type==="RemoteTrackingBranch"}});m.addCommand(p);p=new f.ParametersDescription([new f.CommandParameter("name",
"text",g["Name:"])]);p=new f.Command({name:g.Tag,tooltip:g["Create a tag for the commit"],imageClass:"git-sprite-tag",spriteClass:"gitCommandSprite",id:"eclipse.orion.git.addTag",parameters:p,callback:function(a){var c=a.items,b=function(a,b){h.getService("orion.page.progress").progress(h.getService("orion.git.provider").doAddTag(a,b),"Adding tag "+b).then(function(){n.changedItem(c)},q)},d=c.Location;a.parameters.valueFor("name")&&!a.parameters.optionsRequested&&b(d,a.parameters.valueFor("name"))},
visibleWhen:function(a){return a.Type==="Commit"}});m.addCommand(p);p=new f.Command({name:g.Delete,tooltip:g["Delete the tag from the repository"],imageClass:"core-sprite-delete",id:"eclipse.removeTag",callback:function(a){var c=a.items;confirm(b.formatMessage(g["Are you sure you want to delete tag ${0}?"],c.Name))&&h.getService("orion.page.progress").progress(h.getService("orion.git.provider").doRemoveTag(c.Location),"Removing tag "+c.Name).then(function(){n.changedItem(c.parent)},q)},visibleWhen:function(a){return a.Type===
"Tag"}});m.addCommand(p);p=new f.ParametersDescription([new f.CommandParameter("reviewer","text",g["Reviewer name"])],{hasOptionalParameters:!0});p=new f.Command({name:g["Ask for review"],tooltip:g["Ask for review tooltip"],imageClass:"core-sprite-tag",id:"eclipse.orion.git.askForReviewCommand",parameters:p,callback:function(a){var c=h.getService("orion.page.progress"),b=function(a){var c=document.createElement("a");c.href=a;c.protocol==="ssh:"&&(c=a.indexOf("@"),c!==-1&&(a="ssh://"+a.substr(c+1)));
return a},d=function(d){var e=a.items,f=e.Location.replace(e.Name,"HEAD"),g=e.AuthorName,i=e.Name,j=e.Message;c.progress(h.getService("orion.git.provider").getGitClone(e.CloneLocation),"Getting repository details "+e.Name).then(function(a){window.location.href.split("#");var l=(new URL(k.toUrl("."),window.location)).href.slice(0,-1),a=b(a.Children[0].GitUrl),l=l+"/git/reviewRequest.html#"+a+"_"+e.Name;c.progress(h.getService("orion.git.provider").sendCommitReviewRequest(i,f,d,l,g,j),"Sending review request for "+
i).then(function(a){var c={Severity:"Ok",HTML:!1};c.Message=a.Result;h.getService("orion.page.message").setProgressResult(c)},q)})};if(a.parameters.valueFor("reviewer")&&!a.parameters.optionsRequested)d(a.parameters.valueFor("reviewer"));else{var e=a.items;c.progress(h.getService("orion.git.provider").getGitClone(e.CloneLocation),"Getting git details "+e.Name).then(function(a){window.location.href.split("#");var c=(new URL(k.toUrl("."),window.location)).href.slice(0,-1),a=b(a.Children[0].GitUrl);
(new l.ReviewRequestDialog({title:g["Contribution Review Request"],url:c+"/git/reviewRequest.html#"+a+"_"+e.Name,func:d})).show()},q)}},visibleWhen:function(a){return a.Type==="Commit"}});m.addCommand(p);p=new f.Command({name:g["Cherry-Pick"],tooltip:g["Apply the change introduced by the commit to your active branch"],id:"eclipse.orion.git.cherryPick",imageClass:"git-sprite-cherry_pick",spriteClass:"gitCommandSprite",callback:function(a){var c=a.items,a=h.getService("orion.page.progress"),d=h.getService("orion.git.provider"),
f=c.Location.replace(c.Name,"HEAD");a.progress(d.doCherryPick(f,c.Name),"Cherry picking "+c.Name).then(function(a){var d=[],f=c.Location.replace("commit/"+c.Name,"status");if(a.Result==="OK")d.Severity="Ok",a.HeadUpdated?(d.HTML=!1,d.Message=a.Result):(d.HTML=!0,d.Message="<span>"+g["Nothing changed."]+"</span>");else if(a.Result==="CONFLICTING")d.Severity="Warning",d.HTML=!0,d.Message="<span>"+a.Result+g[". Some conflicts occurred"]+ +b.formatMessage(g[". Go to ${0}."],'<a href="'+k.toUrl(e.statusUILocation)+
"#"+f+'">'+g["Git Status page"]+"</a>")+".</span>";else if(a.Result==="FAILED"){d.Severity="Error";d.HTML=!0;d.Message="<span>"+a.Result;if(a.FailingPaths){var i="",j=!0,l;for(l in a.FailingPaths)j||(i+=", "),j=!1,i+=l;j||(d.Message+=". "+b.formatMessage(g["Failing paths: ${0}"],i))}d.Message+=b.formatMessage(g[". Go to ${0}."],'<a href="'+k.toUrl(e.statusUILocation)+"#"+f+'">'+g["Git Status page"]+"</a>")+".</span>"}else d.Severity="Warning",d.HTML=!1,d.Message=a.Result;h.getService("orion.page.message").setProgressResult(d)},
q)},visibleWhen:function(a){return a.Type==="Commit"}});m.addCommand(p)};o.createGitClonesCommands=function(a,d,e,i,h,l){function k(c){var b={Severity:"Error",HTML:!1};try{var d=JSON.parse(c.responseText);b.Message=d.DetailedMessage?d.DetailedMessage:d.Message?d.Message:g["Problem while performing the action"]}catch(e){b.Message=g["Problem while performing the action"]}a.getService("orion.page.message").setProgressResult(b)}i=new f.ParametersDescription([new f.CommandParameter("key","text",g["Key:"]),
new f.CommandParameter("value","text",g["Value:"])]);i=new f.Command({name:g["New Configuration Entry"],tooltip:"Add a new entry to the repository configuration",imageClass:"core-sprite-add",id:"eclipse.orion.git.addConfigEntryCommand",parameters:i,callback:function(c){var b=c.items,d=a.getService("orion.git.provider"),f=a.getService("orion.page.progress");c.parameters.valueFor("key")&&c.parameters.valueFor("value")&&f.progress(d.addCloneConfigurationProperty(b.ConfigLocation,c.parameters.valueFor("key"),
c.parameters.valueFor("value")),"Setting configuration propetry: "+c.parameters.valueFor("key")).then(function(){e.changedItem(b)},k)}});d.addCommand(i);i=new f.ParametersDescription([new f.CommandParameter("value","text",g["Value:"])]);i=new f.Command({name:g.Edit,tooltip:g["Edit the configuration entry"],imageClass:"core-sprite-edit",id:"eclipse.orion.git.editConfigEntryCommand",parameters:i,callback:function(c){var b=c.items,d=a.getService("orion.git.provider"),f=a.getService("orion.page.progress");
c.parameters.valueFor("value")&&f.progress(d.editCloneConfigurationProperty(b.Location,c.parameters.valueFor("value")),"Editing configuration property "+b.Key).then(function(){e.changedItem(b)},k)},visibleWhen:function(a){return a.Key&&a.Value&&a.Location}});d.addCommand(i);i=new f.Command({name:g.Delete,tooltip:g["Delete the configuration entry"],imageClass:"core-sprite-delete",id:"eclipse.orion.git.deleteConfigEntryCommand",callback:function(c){var d=c.items,c=a.getService("orion.git.provider"),
f=a.getService("orion.page.progress");confirm(b.formatMessage(g["Are you sure you want to delete ${0}?"],d.Key))&&f.progress(c.deleteCloneConfigurationProperty(d.Location),"Deleting configuration property "+d.Key).then(function(){e.changedItem(d)},k)},visibleWhen:function(a){return a.Key&&a.Value&&a.Location}});d.addCommand(i);i=new f.ParametersDescription([new f.CommandParameter("url","url",g["Repository URL:"])],{hasOptionalParameters:!0});i=new f.Command({name:g["Clone Repository"],tooltip:g["Clone an existing Git repository to a folder"],
id:"eclipse.cloneGitRepository",parameters:i,callback:function(c){var b=a.getService("orion.git.provider"),d=a.getService("orion.page.progress"),f=function(c,f,i){o.getDefaultSshOptions(a).then(function(h){var j=arguments.callee,l=d.progress(b.cloneGitRepository(i,c,f,e.defaultPath,h.gitSshUsername,h.gitSshPassword,h.knownHosts,h.gitPrivateKey,h.gitPassphrase),"Cloning repository "+i);a.getService("orion.page.message").createProgressMonitor(l,g["Cloning repository: "]+c);l.then(function(c){o.handleProgressServiceResponse(c,
h,a,function(){e.changedItem&&e.changedItem()},j,g["Clone Git Repository"])},function(c){o.handleProgressServiceResponse(c,h,a,function(){},j,g["Clone Git Repository"])})})};c.parameters.valueFor("url")&&!c.parameters.optionsRequested?f(c.parameters.valueFor("url")):(new n.CloneGitRepositoryDialog({serviceRegistry:a,fileClient:l,url:c.parameters.valueFor("url"),alwaysShowAdvanced:c.parameters.optionsRequested,func:f})).show()},visibleWhen:function(){return!0}});d.addCommand(i);i=new f.Command({name:g["Clone Repository"],
tooltip:g["Clone an existing Git repository to a folder"],id:"eclipse.cloneGitRepositoryReviewReq",callback:function(c){var b=a.getService("orion.git.provider"),d=a.getService("orion.page.progress");(new n.CloneGitRepositoryDialog({serviceRegistry:a,fileClient:l,url:c.userData,alwaysShowAdvanced:!1,func:function(c,f,i){o.getDefaultSshOptions(a).then(function(h){var j=arguments.callee,l=d.progress(b.cloneGitRepository(i,c,f,e.defaultPath,h.gitSshUsername,h.gitSshPassword,h.knownHosts,h.gitPrivateKey,
h.gitPassphrase),"Cloning git repository "+i);a.getService("orion.page.message").createProgressMonitor(l,g["Cloning repository: "]+c);l.then(function(c){o.handleProgressServiceResponse(c,h,a,function(){e.changedItem&&e.changedItem()},j,g["Clone Git Repository"])},function(c){o.handleProgressServiceResponse(c,h,a,function(){},j,g["Clone Git Repository"])})})}})).show()},visibleWhen:function(){return!0}});d.addCommand(i);i=new f.Command({name:g["Add Remote"],tooltip:g["Add a new remote to the repository"],
id:"eclipse.addRemoteReviewRequestCommand",imageClass:"git-sprite-fetch",spriteClass:"gitCommandSprite",callback:function(b){if(b.parameters&&b.parameters.valueFor("remoteName"))b.remoteName=b.parameters.valueFor("remoteName");var i=function(b,e){b.JsonData.HostKey?(e.parameters=null,e.errorData=b.JsonData,d.collectParameters(e)):e.optionsRequested?(e.errorData=b.JsonData,d.collectParameters(e)):(new c(a)).isEnabled().then(function(a){e.parameters=a?b.JsonData.User?new f.ParametersDescription([new f.CommandParameter("sshpassword",
"password",g["SSH Password:"]),new f.CommandParameter("saveCredentials","boolean",g["Don't prompt me again:"])],{hasOptionalParameters:!0}):new f.ParametersDescription([new f.CommandParameter("sshuser","text",g["SSH User Name:"]),new f.CommandParameter("sshpassword","password",g["SSH Password:"]),new f.CommandParameter("saveCredentials","boolean",g["Don't prompt me again:"])],{hasOptionalParameters:!0}):b.JsonData.User?new f.ParametersDescription([new f.CommandParameter("sshpassword","password",g["SSH Password:"])],
{hasOptionalParameters:!0}):new f.ParametersDescription([new f.CommandParameter("sshuser","text",g["SSH User Name:"]),new f.CommandParameter("sshpassword","password",g["SSH Password:"])],{hasOptionalParameters:!0});e.errorData=b.JsonData;d.collectParameters(e)})};if(b.parameters&&b.parameters.optionsRequested)b.parameters=null,b.optionsRequested=!0,d.collectParameters(b);else{var h=function(c,d,f){var h=a.getService("orion.page.progress");h.progress(a.getService("orion.git.provider").addRemote(c,
d,b.userData),"Adding git remote "+d).then(function(){o.gatherSshCredentials(a,b).then(function(c){a.getService("orion.git.provider").getGitRemote(f.RemoteLocation).then(function(j){for(var l,m=0;m<j.Children.length;m++)j.Children[m].Name===d&&(l=j.Children[m]);var n=a.getService("orion.git.provider"),j=a.getService("orion.page.message"),m=h.progress(n.doFetch(l.Location,!1,c.gitSshUsername,c.gitSshPassword,c.knownHosts,c.gitPrivateKey,c.gitPassphrase),"Fetching remote "+d);j.createProgressMonitor(m,
g["Fetching remote: "]+l.Location);m.then(function(c){o.handleGitServiceResponse(c,a,function(){h.progress(n.getGitRemote(l.Location),"Getting remote details "+d).then(function(){e.changedItem(f)},k)},function(a){i(a,b)})},function(c){o.handleGitServiceResponse(c,a,function(){e.changedItem(f)},function(a){i(a,b)})})})})},k)};b.remoteName?h(b.items.RemoteLocation,b.remoteName,b.items):(b.parameters=new f.ParametersDescription([new f.CommandParameter("remoteName","text",g["Remote Name:"])],{hasOptionalParameters:!1}),
d.collectParameters(b))}},visibleWhen:function(){return!0}});d.addCommand(i);i=new f.ParametersDescription([new f.CommandParameter("folderName","text",g["New folder:"])],{hasOptionalParameters:!0});i=new f.Command({name:g["Init Repository"],tooltip:g["Create a new Git repository in a new folder"],id:"eclipse.initGitRepository",parameters:i,callback:function(c){var b=a.getService("orion.git.provider"),d=a.getService("orion.page.progress"),f=function(c,f,i){o.getDefaultSshOptions(a).then(function(h){var j=
arguments.callee,l=d.progress(b.cloneGitRepository(i,c,f,e.defaultPath),g["Initializing repository: "]+i);a.getService("orion.page.message").createProgressMonitor(l,g["Initializing repository: "]+i);l.then(function(c){o.handleProgressServiceResponse(c,h,a,function(){e.changedItem&&e.changedItem()},j,g["Init Git Repository"])},function(c){o.handleProgressServiceResponse(c,h,a,function(){},j,g["Init Git Repository"])})})};c.parameters.valueFor("folderName")&&!c.parameters.optionsRequested?f(null,null,
c.parameters.valueFor("folderName")):(new n.CloneGitRepositoryDialog({serviceRegistry:a,title:g["Init Git Repository"],fileClient:l,advancedOnly:!0,func:f})).show()},visibleWhen:function(){return!0}});d.addCommand(i);i=new f.Command({name:g.Delete,tooltip:g["Delete the repository"],imageClass:"core-sprite-delete",id:"eclipse.git.deleteClone",visibleWhen:function(a){return a.Type==="Clone"},callback:function(c){var d=c.items,c=a.getService("orion.git.provider"),f=a.getService("orion.page.progress");
if(Array.isArray(d)){if(confirm(b.formatMessage(g["Are you sure you want do delete ${0} repositories?"],d.length)))for(var i=0,h=0;h<d.length;h++)f.progress(c.removeGitRepository(d[h].Location),"Removing repository "+d.Name).then(function(){i++;i>=d.length&&e.changedItem&&e.changedItem()},k)}else confirm(b.formatMessage(g["Are you sure you want to delete ${0}?"],d.Name))&&f.progress(c.removeGitRepository(d.Location),"Removing repository "+d.Name).then(function(){e.changedItem&&e.changedItem()},k)}});
d.addCommand(i);i=new f.Command({name:g["Apply Patch"],tooltip:g["Apply a patch on the selected repository"],id:"eclipse.orion.git.applyPatch",imageClass:"git-sprite-apply_patch",spriteClass:"gitCommandSprite",callback:function(a){a=a.items;Array.isArray(a)&&(a=a.length>1?{}:a[0]);(new r.ApplyPatchDialog({title:g["Apply Patch"],diffLocation:a.DiffLocation})).show()},visibleWhen:function(a){return a.Type==="Clone"}});d.addCommand(i);i=new f.ParametersDescription([new f.CommandParameter("commitName",
"text",g["Commit name:"])],{hasOptionalParameters:!0});i=new f.Command({name:g["Open Commit"],tooltip:g["Open the commit with the given name"],id:"eclipse.orion.git.openCommitCommand",imageClass:"git-sprite-apply_patch",spriteClass:"gitCommandSprite",parameters:i,callback:function(c){var b=a.getService("orion.page.progress"),d=function(e,f,i){i==null&&(i=new j);e.length>0?b.progress(a.getService("orion.git.provider").doGitLog("/gitapi/commit/"+c.parameters.valueFor("commitName")+e[0].ContentLocation+
"?page=1&pageSize=1",null,null,g["Looking for the commit"]),"Looking for commit "+c.parameters.valueFor("commitName")).then(function(a){i.resolve(a.Children[0].Location)},function(){d(e.slice(1),f,i)}):i.reject();return i},e=function(b){c.parameters.optionsRequested?(new t.OpenCommitDialog({repositories:b,serviceRegistry:a,commitName:c.parameters.valueFor("commitName")})).show():(a.getService("orion.page.message").setProgressMessage(g["Looking for the commit"]),d(b,c.parameters.valueFor("commitName")).then(function(a){a!==
null&&window.open("/git/git-commit.html#"+a+"?page=1&pageSize=1")},function(){var c=[];c.Severity="warning";c.HTML=!1;c.Message=g["No commits found"];a.getService("orion.page.message").setProgressResult(c)}))};if(c.items.Type==="Clone"){var f=[c.items];e(f)}else c.items.CloneLocation?b.progress(a.getService("orion.git.provider").getGitClone(c.items.CloneLocation),"Getting git repository details").then(function(a){e(a.Children)}):(f=c.items,e(f))},visibleWhen:function(a){return a.Type==="Clone"||a.CloneLocation||
a.length>1&&a[0].Type==="Clone"}});d.addCommand(i)};o.createGitStatusCommands=function(a,c,b){function d(c){var b={Severity:"Error",HTML:!1};try{var e=JSON.parse(c.responseText);b.Message=e.DetailedMessage?e.DetailedMessage:e.Message?e.Message:g["Problem while performing the action"]}catch(f){b.Message=g["Problem while performing the action"]}a.getService("orion.page.message").setProgressResult(b)}function i(a){Array.isArray(a)||(a=[a]);return a}function h(c,e){var f=a.getService("orion.page.message"),
i=a.getService("orion.page.progress").progress(a.getService("orion.git.provider").doRebase(c,"",e),"Rebasing git repository");f.createProgressMonitor(i,e);i.then(function(c){if(c.Result==="OK"||c.Result==="ABORTED"||c.Result==="FAST_FORWARD"||c.Result==="UP_TO_DATE"){var d=[];d.Severity="Ok";d.HTML=!1;d.Message=c.Result;a.getService("orion.page.message").setProgressResult(d);b.changedItem({})}if(c.Result==="STOPPED")d=[],d.Severity="Warning",d.HTML=!1,d.Message=c.Result+g[". Repository still contains conflicts."],
a.getService("orion.page.message").setProgressResult(d),b.changedItem({});else if(c.Result==="FAILED_UNMERGED_PATHS")d=[],d.Severity="Error",d.HTML=!1,d.Message=c.Result+g[". Repository contains unmerged paths. Resolve conflicts first."],a.getService("orion.page.message").setProgressResult(d)},d)}var j=new f.Command({name:g.Stage,tooltip:g["Stage the change"],imageClass:"git-sprite-stage",spriteClass:"gitCommandSprite",id:"eclipse.orion.git.stageCommand",callback:function(c){var e=i(c.items),f=a.getService("orion.page.message"),
h=a.getService("orion.page.progress");if(e.length===1)c=h.progress(a.getService("orion.git.provider").stage(e[0].indexURI),g["Staging changes"]),f.createProgressMonitor(c,g["Staging changes"]);else{for(var j=[],l=0;l<e.length;l++)j[l]=e[l].name;c=h.progress(a.getService("orion.git.provider").stageMultipleFiles(c.userData.Clone.IndexLocation,j),g["Staging changes"]);f.createProgressMonitor(c,"Staging changes")}c.then(function(){b.changedItem(e)},d)},visibleWhen:function(a){a=i(a);if(a.length===0)return!1;
for(var c=0;c<a.length;c++)if(!e.isChange(a[c])||e.isStaged(a[c]))return!1;return!0}});c.addCommand(j);j=new f.Command({name:g.Unstage,tooltip:g["Unstage the change"],imageClass:"git-sprite-unstage",spriteClass:"gitCommandSprite",id:"eclipse.orion.git.unstageCommand",callback:function(c){var e=i(c.items),f=a.getService("orion.page.message"),h=a.getService("orion.page.progress");if(e.length===1)c=h.progress(a.getService("orion.git.provider").unstage(e[0].indexURI,e[0].name),"Unstaging changes");else{for(var j=
[],l=0;l<e.length;l++)j[l]=e[l].name;c=h.progress(a.getService("orion.git.provider").unstage(c.userData.Clone.IndexLocation,j),"Unstaging changes")}f.createProgressMonitor(c,g["Staging changes"]);c.then(function(){b.changedItem(e)},d)},visibleWhen:function(a){a=i(a);if(a.length===0)return!1;for(var c=0;c<a.length;c++)if(!e.isChange(a[c])||!e.isStaged(a[c]))return!1;return!0}});c.addCommand(j);j=new f.ParametersDescription([new f.CommandParameter("name","text",g["Commit message:"],"",4),new f.CommandParameter("amend",
"boolean",g["Amend:"],!1)],{hasOptionalParameters:!0});j=new f.Command({name:"Commit",tooltip:"Commit",id:"eclipse.orion.git.commitCommand",parameters:j,callback:function(c){var e=c.items.status,f=function(c){var f=a.getService("orion.page.message"),c=a.getService("orion.page.progress").progress(a.getService("orion.git.provider").commitAll(e.Clone.HeadLocation,null,JSON.stringify(c)),g["Committing changes"]);f.createProgressMonitor(c,g["Committing changes"]);c.then(function(){b.changedItem(e)},d)},
i={};i.Message=c.parameters.valueFor("name");i.Amend=c.parameters.valueFor("amend");for(var h=e.Clone.Config,j=0;j<h.length;j++)if(h[j].Key==="user.name")i.CommitterName=h[j].Value,i.AuthorName=h[j].Value;else if(h[j].Key==="user.email")i.CommitterEmail=h[j].Value,i.AuthorEmail=h[j].Value;i.Message&&i.CommitterName&&i.CommitterEmail&&!c.parameters.optionsRequested?f(i):(new m.CommitDialog({body:i,func:f})).show()},visibleWhen:function(){return!0}});c.addCommand(j);j=new f.Command({name:g.Reset,tooltip:g["Reset the branch, discarding all staged and unstaged changes"],
imageClass:"core-sprite-refresh",id:"eclipse.orion.git.resetCommand",callback:function(c){var e=c.items;a.getService("orion.page.dialog").confirm(g["All unstaged and staged changes in the working directory and index will be discarded and cannot be recovered."]+"\n"+g["Are you sure you want to continue?"],function(c){if(c){var c=a.getService("orion.page.message"),f=a.getService("orion.page.progress").progress(a.getService("orion.git.provider").unstageAll(e.IndexLocation,"HARD"),g["Resetting local changes"]);
c.createProgressMonitor(f,g["Resetting local changes"]);f.then(function(){b.changedItem(e)},d)}})},visibleWhen:function(a){return e.hasStagedChanges(a)||e.hasUnstagedChanges(a)}});c.addCommand(j);j=new f.Command({name:g.Checkout,tooltip:g["Checkout files, discarding all changes"],imageClass:"git-sprite-checkout",spriteClass:"gitCommandSprite",id:"eclipse.orion.git.checkoutCommand",callback:function(c){var e=i(c.items);a.getService("orion.page.dialog").confirm(g["Your changes to the selected files will be discarded and cannot be recovered."]+
"\n"+g["Are you sure you want to continue?"],function(f){if(f){for(var f=a.getService("orion.page.message"),i=a.getService("orion.page.progress"),h=[],j=0;j<e.length;j++)h[j]=e[j].name;i=i.progress(a.getService("orion.git.provider").checkoutPath(c.userData.Clone.Location,h),g["Resetting local changes"]);f.createProgressMonitor(i,g["Resetting local changes"]);i.then(function(){b.changedItem(e)},d)}})},visibleWhen:function(a){a=i(a);if(a.length===0)return!1;for(var c=0;c<a.length;c++)if(!e.isChange(a[c])||
e.isStaged(a[c]))return!1;return!0}});c.addCommand(j);j=new f.Command({name:g["Show Patch"],tooltip:g["Show workspace changes as a patch"],imageClass:"git-sprite-diff",spriteClass:"gitCommandSprite",id:"eclipse.orion.git.showPatchCommand",hrefCallback:function(a){for(var c=i(a.items),a=a.userData.Clone.DiffLocation+"?parts=diff",b=0;b<c.length;b++)a+="&Path=",a+=c[b].name;return a},visibleWhen:function(a){a=i(a);if(a.length===0)return!1;for(var c=0;c<a.length;c++)if(e.isStaged(a[c]))return!1;return!0}});
c.addCommand(j);j=new f.Command({name:g.Continue,tooltip:g["Contibue Rebase"],id:"eclipse.orion.git.rebaseContinueCommand",callback:function(a){return h(a.items.Clone.HeadLocation,"CONTINUE")},visibleWhen:function(a){return a.RepositoryState.indexOf("REBASING")!==-1}});c.addCommand(j);j=new f.Command({name:g["Skip Patch"],tooltip:g["Skip Patch"],id:"eclipse.orion.git.rebaseSkipPatchCommand",callback:function(a){return h(a.items.Clone.HeadLocation,"SKIP")},visibleWhen:function(a){return a.RepositoryState.indexOf("REBASING")!==
-1}});c.addCommand(j);j=new f.Command({name:g.Abort,tooltip:g["Abort Rebase"],id:"eclipse.orion.git.rebaseAbortCommand",callback:function(a){return h(a.items.Clone.HeadLocation,"ABORT")},visibleWhen:function(a){return a.RepositoryState.indexOf("REBASING")!==-1}});c.addCommand(j)}})();return o});
define("orion/searchUtils","i18n!orion/nls/messages,require,orion/editor/regex,orion/commands,orion/PageUtil,orion/URITemplate".split(","),function(g,k,j,b,h,f){function e(c,a,b){var d="";b&&(d="^");if(d=j.parse("/"+d+c.searchStr+"/"))b=d.pattern,d=d.flags,d.indexOf("i")===-1&&!a.caseSensitive&&(d+="i"),c.regExp={pattern:b,flags:d},c.wildCard=!0}var d=d||{};d.searchUtils=d.searchUtils||{};d.searchUtils.ALL_FILE_TYPE="*.*";d.searchUtils.doSearch=function(c,a,b,e){if(c){var f=!0;b==="*"&&(b="");b===
""&&(f=e&&e.type!==d.searchUtils.ALL_FILE_TYPE);if(f){b!==""&&d.searchUtils.addRecentSearch(a,b,e?e.regEx:!1);var c=c.createSearchParams(b,!1,!1,e),h=d.searchUtils.generateSearchHref(c);d.searchUtils.getOpenSearchPref(a,function(a){a?window.open(h):window.location=h})}}else window.alert(g["Can't search: no search service is available"])};d.searchUtils.generateSearchHelper=function(c,a){var b=c.keyword,f=b,g={};c.fileType&&c.fileType!==d.searchUtils.ALL_FILE_TYPE&&b===""&&(f="*."+c.fileType);if(c.regEx)g.searchStr=
b,e(g,c,a);else{var h=b.indexOf("*")>-1,j=b.indexOf("?")>-1;h&&(b=b.split("*").join(".*"));j&&(b=b.split("?").join("."));!h&&!j&&!c.nameSearch?(g.searchStr=c.caseSensitive?b.split("\\").join(""):b.split("\\").join("").toLowerCase(),g.wildCard=!1):(g.searchStr=c.caseSensitive?b:b.toLowerCase(),e(g,c,a),g.wildCard=!0)}g.searchStrLength=g.searchStr.length;return{params:c,inFileQuery:g,displayedSearchTerm:f}};d.searchUtils.convertSearchParams=function(c){if(c.rows!==void 0)c.rows=parseInt(c.rows);if(c.start!==
void 0)c.start=parseInt(c.start);if(typeof c.regEx==="string")c.regEx=c.regEx.toLowerCase()==="true";if(typeof c.caseSensitive==="string")c.caseSensitive=c.caseSensitive.toLowerCase()==="true";if(typeof c.nameSearch==="string")c.nameSearch=c.nameSearch.toLowerCase()==="true"};d.searchUtils.copySearchParams=function(c,a){var b={},d;for(d in c)if(c[d]!==void 0&&c[d]!==null&&(a||d!=="replace"))b[d]=c[d];return b};d.searchUtils.generateSearchHref=function(c){var a=k.toUrl("search/search.html"),c=d.searchUtils.copySearchParams(c,
!0),b=c.resource;c.resource=void 0;return(new f(a+"#{,resource,params*}")).expand({resource:b,params:c})};d.searchUtils.generateFindURLBinding=function(c,a,b,d){c={find:a.searchStr,regEx:a.wildCard?!0:void 0,caseSensitive:c.caseSensitive?!0:void 0,replaceWith:typeof d==="string"?d:void 0,atLine:typeof b==="number"?b:void 0};return","+(new f("{,params*}")).expand({params:c})};d.searchUtils.convertFindURLBinding=function(c){if(typeof c.regEx==="string")c.regEx=c.regEx.toLowerCase()==="true";if(typeof c.caseSensitive===
"string")c.caseSensitive=c.caseSensitive.toLowerCase()==="true";if(typeof c.atLine==="string")c.atLine=parseInt(c.atLine)};d.searchUtils.replaceRegEx=function(c,a,b){return c.replace(RegExp(a.pattern,a.flags),b)};d.searchUtils.replaceStringLiteral=function(c,a,b){a=j.parse("/"+a+"/gim");return d.searchUtils.replaceRegEx(c,a,b)};d.searchUtils.searchOnelineLiteral=function(c,a,b){var d;d=0;for(var e=!1,f=[];;)if(d=a.indexOf(c.searchStr,d),d<0)break;else{f.push({startIndex:d,length:c.searchStrLength});
e=!0;if(b)break;d+=c.searchStrLength}return e?f:null};d.searchUtils.findRegExp=function(c,a,b,d){if(!a)return null;b=b||"";b+=(b.indexOf("g")===-1?"g":"")+(b.indexOf("m")===-1?"m":"");var e=null;return(e=RegExp(a,b).exec(c.substring(d)))&&{startIndex:e.index+d,length:e[0].length}};d.searchUtils.searchOnelineRegEx=function(c,a,b){for(var e=0,f=!1,g=[];;)if(e=d.searchUtils.findRegExp(a,c.regExp.pattern,c.regExp.flags,e)){g.push(e);f=!0;if(b)break;e=e.startIndex+e.length}else break;return f?g:null};
d.searchUtils.generateNewContents=function(c,a,b,e,f,g){if(e&&a){if(!c)b.contents=[];for(var h=0;h<a.length;h++){for(var j=a[h],k=!1,o=!1,x=[],s,v=0,u=0;u<e.children.length;u++)if(e.children[u].lineNumber-1===h){v=u;for(k=0;k<e.children[u].matches.length;k++)e.children[u+k].checked!==!1&&x.push(k);o=x.length>0;s=e.children[u].matches;k=!0;break}if(k){if(o){x=d.searchUtils.replaceCheckedMatches(j,f,s,x,g);j=x.replacedStr;for(k=0;k<e.children[v].matches.length;k++)e.children[v+k].newMatches=x.newMatches}else for(k=
0;k<e.children[v].matches.length;k++)e.children[v+k].newMatches=e.children[v+k].matches;c?b.contents[h]=j:b.contents.push(j)}else c||b.contents.push(j)}}};d.searchUtils.generateMatchContext=function(c,a,b){var d=[],e=c*2+1,f;a.length<=e?(f=0,c=a.length-1):(f=b-c,f<0?(f=0,c=f+e-1):(c=b+c,c>a.length-1&&(c=a.length-1,f=c-e+1)));for(e=f;e<=c;e++)d.push({context:a[e],current:e===b});return d};d.searchUtils.splitFile=function(c){for(var a=0,b=0,d=0,e=0,f=[];;){a!==-1&&a<=d&&(a=c.indexOf("\r",d));b!==-1&&
b<=d&&(b=c.indexOf("\n",d));if(b===-1&&a===-1){f.push(c.substring(e));break}var g=1;a!==-1&&b!==-1?a+1===b?(g=2,d=b+1):d=(a<b?a:b)+1:d=a!==-1?a+1:b+1;f.push(c.substring(e,d-g));e=d}return f};d.searchUtils.searchWithinFile=function(c,a,b,e,f,g){b=d.searchUtils.splitFile(b);if(f)a.contents=b;if(a){a.children=[];for(var h=e=0;h<b.length;h++){var j=b[h];if(j&&j.length>0){var k=g?j:j.toLowerCase();if(k=c.wildCard?d.searchUtils.searchOnelineRegEx(c,k):d.searchUtils.searchOnelineLiteral(c,k)){var o=h+1;
if(f)for(var x=0;x<k.length;x++){var s=x+1,s={parent:a,checked:a.checked,type:"detail",matches:k,lineNumber:o,matchNumber:s,name:j,location:a.location+"-"+o+"-"+s};a.children.push(s)}else s={parent:a,context:d.searchUtils.generateMatchContext(2,b,h),checked:a.checked,type:"detail",matches:k,lineNumber:o,name:j,location:a.location+"-"+o},a.children.push(s);e+=k.length}}}a.totalMatches=e}};d.searchUtils.replaceCheckedMatches=function(c,a,b,d,e){for(var f=0,g="",h=[],j=0;j<b.length;j++){f!==b[j].startIndex&&
(g+=c.substring(f,b[j].startIndex));if(b[j].length)e=b[j].length;for(var f=!1,k=0;k<d.length;k++)if(d[k]===j){f=!0;break}f?(h.push({startIndex:g.length,length:a.length}),g+=a):(h.push({startIndex:g.length,length:e}),g+=c.substring(b[j].startIndex,b[j].startIndex+e));f=b[j].startIndex+e}f<c.length&&(g+=c.substring(f));return{replacedStr:g,newMatches:h}};d.searchUtils.fullPathNameByMeta=function(c){var a=c.length,b="";if(a>0)for(a-=1;a>-1;a--)b=b+(b===""?"":"/")+c[a].Name;return b};d.searchUtils.path2FolderName=
function(c,a,b){return c.substring(0,c.length-a.length-(b?0:1))};d.searchUtils._storeRecentSearch=function(c,a){c.getService("orion.core.preference").getPreferences("/window/favorites").then(function(c){c.put("recentSearch",a)})};d.searchUtils.addRecentSearch=function(c,a,b){typeof a==="string"&&a&&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===a)return;
e.length>=20&&e.splice(19,e.length-20+1)}else e=[];e.splice(0,0,{name:a,regEx:b});d.searchUtils._storeRecentSearch(c,e)})};d.searchUtils.getSearches=function(c,a,b){c.getService("orion.core.preference").getPreferences("/window/favorites").then(function(c){c=c.get(a);typeof c==="string"&&(c=JSON.parse(c));c&&b&&b(c)})};d.searchUtils.getMixedSearches=function(c,a,b,e){c.getService("orion.core.preference").getPreferences("/window/favorites").then(function(c){var f,g=c.get("recentSearch");typeof g===
"string"&&(g=JSON.parse(g));if(a)for(f in c=c.get("search"),typeof c==="string"&&(c=JSON.parse(c)),c)if(b){var h=d.searchUtils.parseQueryStr(c[f].query);g.some(function(a){return h.searchStrTitle===a.name})||g.push({name:h.searchStrTitle,label:c[f].name})}else g.push({name:null,label:c[f].name,value:c[f].query});g&&e&&e(g)})};d.searchUtils.getOpenSearchPref=function(c,a){c.getService("orion.core.preference").getPreferences("/cm/configurations").then(function(c){c=c.get("nav.config");a(c&&c["links.newtab"]!==
"undefined"?c["links.newtab"]?!0:!1:!1)})};d.searchUtils.setOpenSearchPref=function(c,a){c.getService("orion.core.preference").getPreferences("/window/favorites").then(function(c){c.put("openSearchPref",{openInNewTab:a})})};return d.searchUtils});
define("orion/crawler/searchCrawler","i18n!orion/crawler/nls/messages,require,orion/i18nUtil,orion/searchUtils,orion/contentTypes,orion/Deferred".split(","),function(g,k,j,b,h,f){function e(d,c,a,e){this.registry=d;this.fileClient=c;this.fileLocations=[];this.fileSkeleton=[];this._totalCounter=this._hitCounter=0;this._searchOnName=e&&e.searchOnName;this._buildSkeletonOnly=e&&e.buildSkeletonOnly;this._fetchChildrenCallBack=e&&e.fetchChildrenCallBack;this._searchParams=a;this.searchHelper=this._searchOnName||
this._buildSkeletonOnly?null:b.generateSearchHelper(a);this._location=e&&e.location;this._childrenLocation=e&&e.childrenLocation?e.childrenLocation:this._location}e.prototype.search=function(b){var c=this.registry.getService("orion.core.contenttypes");this._onSearchComplete=b;var a=this;this.registry.getService("orion.page.dialog").confirm(g["The search term on this location will not use indexed files."]+"\n"+g["It will take longer time. Do you want to proceed?"],function(b){b&&c.getContentTypes().then(function(c){a.contentTypesCache=
c;a._visitRecursively(a._childrenLocation).then(function(){a._sort(a.fileLocations);a._onSearchComplete({response:{numFound:a.fileLocations.length,docs:a.fileLocations}})})})})};e.prototype.searchName=function(d,c){if(d)this.searchHelper=b.generateSearchHelper(d,!0);if(c)this.onSearchNameComplete=c;var a=[];this._sort(this.fileSkeleton);if(this.fileSkeleton.length>0){for(var e=0;e<this.fileSkeleton.length;e++){var f=this.fileSkeleton[e].Name.toLowerCase();if(this.searchHelper.inFileQuery.wildCard?
b.searchOnelineRegEx(this.searchHelper.inFileQuery,f,!0):b.searchOnelineLiteral(this.searchHelper.inFileQuery,f,!0))if(a.push(this.fileSkeleton[e]),a.length>=this.searchHelper.params.rows)break}this.onSearchNameComplete({response:{numFound:a.length,docs:a}})}};e.prototype.buildSkeleton=function(b,c){this._buildingSkeleton=!0;var a=this.registry.getService("orion.core.contenttypes"),e=this;b();a.getContentTypes().then(function(a){e.contentTypesCache=a;e._visitRecursively(e._childrenLocation).then(function(){e._buildingSkeleton=
!1;c();e.searchHelper&&!e._buildSkeletonOnly&&e.searchName()})})};e.prototype._searchCompleted=function(){console.log("Search Completed.")};e.prototype._searchFiles=function(){var b=[],c;if(this.fileLocations.length>0){c=this;for(var a=0;a<c.fileLocations.length;a++)b.push(c._sniffSearch(c.fileLocations[a]))}return f.all(b)};e.prototype._sort=function(b){b.sort(function(c,a){var b=c.Name&&c.Name.toLowerCase(),d=a.Name&&a.Name.toLowerCase();return b<d?-1:b>d?1:0})};e.prototype._onFileType=function(d){return this.searchHelper.params.fileType?
this.searchHelper.params.fileType===b.ALL_FILE_TYPE?!0:d.extension.indexOf(this.searchHelper.params.fileType)>=0:!0};e.prototype._visitRecursively=function(b){var c=[],a=this;this._fetchChildrenCallBack&&this._fetchChildrenCallBack(b);var e=a.registry.getService("orion.page.progress");return(e?e.progress(a.fileClient.fetchChildren(b),"Crawling search for children of "+b):a.fileClient.fetchChildren(b)).then(function(b){for(var d=0;d<b.length;d++)if(b[d].Directory!==void 0&&b[d].Directory===!1)if(a._searchOnName)c.push(a._buildSingleSkeleton(b[d]));
else if(a._buildSkeletonOnly)c.push(a._buildSingleSkeleton(b[d]));else{var e=h.getFilenameContentType(b[d].Name,a.contentTypesCache);e&&(e["extends"]==="text/plain"||e.id==="text/plain")&&a._onFileType(e)&&c.push(a._sniffSearch(b[d]))}else b[d].Location&&c.push(a._visitRecursively(b[d].ChildrenLocation));return f.all(c)})};e.prototype._hitOnceWithinFile=function(d){d=this._searchParams.caseSensitive?d:d.toLowerCase();return this.searchHelper.inFileQuery.wildCard?b.searchOnelineRegEx(this.searchHelper.inFileQuery,
d,!0):b.searchOnelineLiteral(this.searchHelper.inFileQuery,d,!0)};e.prototype._reportSingleHit=function(b){b.LastModified=b.LocalTimeStamp;this.fileLocations.push(b);this._hitCounter++;this._sort(this.fileLocations);this._onSearchComplete({response:{numFound:this.fileLocations.length,docs:this.fileLocations}},!0)};e.prototype._sniffSearch=function(b){this._totalCounter++;var c=this;if(this.searchHelper.params.keyword==="")this._reportSingleHit(b),this.registry.getService("orion.page.message").setProgressResult({Message:j.formatMessage(g["${0} files found out of ${1}"],
this._hitCounter,this._totalCounter)});else return this.registry.getService("orion.page.progress").progress(c.fileClient.read(b.Location),"Reading file "+b.Location).then(function(a){c._hitOnceWithinFile(a)&&c._reportSingleHit(b);c.registry.getService("orion.page.message").setProgressResult({Message:j.formatMessage(g["${0} files found out of ${1}"],c._hitCounter,c._totalCounter)})},function(a){console.error("Error loading file content: "+a.message)})};e.prototype._buildSingleSkeleton=function(b){this._totalCounter++;
this.fileSkeleton.push(b);this.searchHelper&&!this._buildSkeletonOnly&&this._totalCounter%100===0&&this.searchName();b=new f;b.resolve(this._totalCounter);return b};e.prototype.constructor=e;return{SearchCrawler:e}});
define("orion/searchClient","i18n!orion/search/nls/messages,require,orion/webui/littlelib,orion/i18nUtil,orion/searchUtils,orion/crawler/searchCrawler".split(","),function(g,k,j,b,h,f){function e(b){this.registry=b.serviceRegistry;this._commandService=b.commandService;(this._fileService=b.fileService)||console.error("No file service on search client")}e.prototype={search:function(b,c,a){var e=function(a){for(var c=[],b=0;b<a.response.docs.length;b++){var d=a.response.docs[b];c.push({name:d.Name,path:d.Location,
folderName:h.path2FolderName(d.Path?d.Path:d.Location,d.Name),directory:d.Directory,lineNumber:d.LineNumber})}return c};if(this._crawler&&b.nameSearch)this._crawler.searchName(b,function(c){a(e(c),null)});else try{this.registry.getService("orion.page.progress").progress(this._fileService.search(b),"Searching "+b.keyword).then(function(c){var f=b.keyword,f=f.substring(f.indexOf("}")+1),f=f.substring(f.indexOf(":")+1);a(e(c),f)},function(c){a(null,null,c)})}catch(g){typeof g==="string"&&g.indexOf("search")>
-1&&this._crawler?this._crawler.searchName(b,function(c){a(e(c),null)}):typeof g==="string"&&g.indexOf("search")>-1&&!b.nameSearch?(new f.SearchCrawler(this.registry,this._fileService,b,{childrenLocation:this.getChildrenLocation()})).search(function(c){a(e(c),null)}):this.registry.getService("orion.page.message").setErrorMessage(g)}},getFileService:function(){return this._fileService},setCrawler:function(b){this._crawler=b},handleError:function(b,c){console.error(b);j.empty(c);c.appendChild(document.createTextNode(b));
return b},setLocationByMetaData:function(d,c){var a="",e=null;this._searchRootLocation=this._fileService.fileServiceRootURL(d.Location);c&&d&&d.Parents&&d.Parents.length>0?e=c.index==="last"?d.Parents[d.Parents.length-1]:d.Parents[0]:d&&d.Directory&&d.Location&&d.Parents&&(e=d);if(e)this.setLocationbyURL(e.Location),a=e.Name,this._childrenLocation=e.ChildrenLocation;else if(d)this.setLocationbyURL(this._searchRootLocation),a=this._fileService.fileServiceName(d.Location),this._childrenLocation=d.ChildrenLocation;
e=j.node("search");a||(a="");if(e&&e.placeholder){e.value="";var f=b.formatMessage(g["Search ${0}"],a);e.placeholder=f.length>30?f.substring(0,27)+"...":b.formatMessage(g["Search ${0}"],a)}if(e&&e.title)e.title=g["Type a keyword or wild card to search in "]+a},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,c,a,e){a=a?this.getSearchRootLocation():this.getSearchLocation();return c?{resource:a,sort:"NameLower asc",rows:100,start:0,nameSearch:!0,keyword:b}:{resource:a,sort:"Path asc",
rows:40,start:0,caseSensitive:e?e.caseSensitive:void 0,regEx:e?e.regEx:void 0,fileType:e?e.type:void 0,keyword:b}},defaultRenderer:{makeRenderFunction:function(d,c,a,e,f){function h(a){return!d?!0:(a=d.getFilenameContentType(a))&&(a["extends"]==="text/plain"||a.id==="text/plain")?!0:!1}return function(d,t,m){if(m)j.empty(c),d=document.createElement("div"),d.appendChild(document.createTextNode(g["Search failed."])),c.appendChild(d),typeof e==="function"&&e(c);else{var m=function(){function a(c,b){var d=
b.folderName?b.folderName:b.path,e=document.createElement("span");e.id=d.replace(/[^a-zA-Z0-9_\.:\-]/g,"");e.appendChild(document.createTextNode(" - "+d+" "));c.appendChild(e)}var c={};return function(b,d){var e=d.name;if(c.hasOwnProperty(e)){a(b,d);var f=c[e];typeof f==="function"&&(c[e]=null,f())}else c[e]=function(){a(b,d)}}}(),r=!1;j.empty(c);if(d&&d.length>0){var o=document.createElement("table");o.setAttribute("role","presentation");for(var x=0;x<d.length;x++){var s=d[x],v;if(!r&&(r=!0,a))v=
o.insertRow(0).insertCell(0),v.textContent=a;v=o.insertRow(-1).insertCell(0);v.colspan=2;f&&f(v);var u=document.createElement("a");u.appendChild(document.createTextNode(s.name));s.LineNumber&&u.appendChild(document.createTextNode(" (Line "+s.LineNumber+")"));var y=s.location;s.isExternalResource?y=s.path:(y=s.directory?k.toUrl("navigate/table.html")+"#"+s.path:h(s.name)?k.toUrl("edit/edit.html")+"#"+s.path:s.path,y==="#"&&(y=""));u.setAttribute("href",y);u.setAttribute("aria-describedby",(s.folderName?
s.folderName:s.path).replace(/[^a-zA-Z0-9_\.:\-]/g,""));u.style.verticalAlign="middle";v.appendChild(u);m(v,s)}c.appendChild(o);typeof e==="function"&&e(c)}!r&&t&&(d=b.formatMessage(g["No matches found for ${0}"],t),j.empty(c),c.appendChild(document.createTextNode(d)),typeof e==="function"&&e(c))}}}}};e.prototype.constructor=e;return{Searcher:e}});
define("orion/webui/dialogs/OpenResourceDialog","i18n!orion/widgets/nls/messages,orion/crawler/searchCrawler,orion/contentTypes,require,orion/webui/littlelib,orion/webui/dialog".split(","),function(g,k,j,b,h,f){function e(b){this._init(b)}e.prototype=new f.Dialog;e.prototype.TEMPLATE='<div role="search"><div><label 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="'+
b.toUrl("../../../images/progress_running.gif")+'" class="progressPane_running_dialog" id="crawlingProgress"></img></div><div id="favresults" style="max-height:400px; height:auto; overflow-y:auto;"></div><div id="results" style="max-height:400px; height:auto; overflow-y:auto;" aria-live="off"></div><div id="statusbar"></div></div>';e.prototype._init=function(b){this.title=b.title||g["Find File Named"];this.modal=!0;this.messages=g;this._searcher=b.searcher;this._progress=b.progress;this._onHide=b.onHide;
this._contentTypeService=new j.ContentTypeService(this._searcher.registry);if(!this._searcher)throw Error("Missing required argument: searcher");this._searchDelay=b.searchDelay||500;this._time=0;this._searcher.setCrawler(null);this._forceUseCrawler=!1;this._searchOnRoot=!0;this._fileService=this._searcher.getFileService();if(!this._fileService)throw Error(g["Missing required argument: fileService"]);this._searchRenderer=b.searchRenderer;if(!this._searchRenderer||typeof this._searchRenderer.makeRenderFunction!==
"function")throw Error(g["Missing required argument: searchRenderer"]);this._favService=b.favoriteService;if(!this._favService)throw Error(g["Missing required argument: favService"]);this._initialize()};e.prototype._bindToDom=function(b){var c=this;c.$crawlingProgress.style.display="none";this.$fileName.setAttribute("placeholder",g.Search);this.$fileName.addEventListener("input",function(){c._time=+new Date;c._timeoutId&&clearTimeout(c._timeoutId);c._timeoutId=setTimeout(c.checkSearch.bind(c),0)},
!1);this.$fileName.addEventListener("keydown",function(a){if(a.keyCode===h.KEY.ENTER){var b=h.$("a",c.$results);b&&(h.stop(a),window.open(b.href),c.hide())}},!1);b.addEventListener("keydown",function(a){var b,d,e,f,g;if(a.keyCode===h.KEY.DOWN||a.keyCode===h.KEY.UP)d=h.$$array("a",c.$results),b=h.$$array("a",c.$favresults),e=document.activeElement,g=d.indexOf(e),f=b.indexOf(e),a.keyCode===h.KEY.DOWN?f>=0?(f<b.length-1?b[f+1]:d.length>0?d[0]:b[0]).focus():g>=0?(g<d.length-1?d[g+1]:b.length>0?b[0]:d[0]).focus():
(d.length>0||b.length>0)&&(-1<b.length-1?b[0]:d[0]).focus():f>=0?(e=c.$fileName,(f>0?b[f-1]:e).focus()):g>=0?(e=c.$fileName,(g>0?d[g-1]:b.length>0?b[b.length-1]:e).focus()):d.length>0?d[d.length-1].focus():b.length>0&&b[b.length-1].focus(),h.stop(a)});b.addEventListener("mouseup",function(a){a.target.focus()},!1);this.populateFavorites();setTimeout(function(){if(c._forceUseCrawler||!c._fileService.getService(c._searcher.getSearchLocation()).search){var a=c._searchOnRoot?c._searcher.getSearchRootLocation():
c._searcher.getChildrenLocation(),a=new k.SearchCrawler(c._searcher.registry,c._fileService,"",{searchOnName:!0,location:a});c._searcher.setCrawler(a);a.buildSkeleton(function(){c.$crawlingProgress.style.display="inline";c.$progress.appendChild(document.createTextNode(g["Building file skeleton..."]))},function(){c.$crawlingProgress.style.display="none";c.$progress.removeChild(c.$progress.lastChild)})}},0)};e.prototype.populateFavorites=function(){var b=document.createElement("div");b.appendChild(document.createTextNode(g["Populating favorites&#x2026;"]));
h.empty(this.$favresults);this.$favresults.appendChild(b);this._progress?this._progress.progress(this._favService.getFavorites(),"Getting favorites").then(this.showFavorites()):this._favService.getFavorites().then(this.showFavorites());this._favService.addEventListener("favoritesChanged",this.showFavorites())};e.prototype.showFavorites=function(){var b=this;return function(c){if(c.navigator)c=c.navigator;b._searchRenderer.makeRenderFunction(b._contentTypeService,b.$favresults,!1,b.decorateResult.bind(b),
b.showFavoritesImage)(c);if(c&&c.length>0)c=document.createElement("div"),c.style.borderBottom="1px dashed #BBBBBB",c.style.padding="5px",b.$favresults.appendChild(c)}};e.prototype.showFavoritesImage=function(d){var c=new Image;c.classList.add("modelDecorationSprite");c.classList.add("core-sprite-makeFavorite");c.src=b.toUrl("images/none.png");c.title=g.Favorite;d.appendChild(c);c.style.verticalAlign="middle"};e.prototype.checkSearch=function(){clearTimeout(this._timeoutId);var b=(new Date).getTime();
b-this._time>this._searchDelay?(this._time=b,this.doSearch()):this._timeoutId=setTimeout(this.checkSearch.bind(this),50)};e.prototype.doSearch=function(){var b=this.$fileName.value,c=this.showFavorites();this._progress?this._progress.progress(this._favService.queryFavorites(b),"Getting favorites for: "+b).then(function(a){c(a)}):this._favService.queryFavorites(b).then(function(a){c(a)});if(b){var a=document.createElement("div");a.appendChild(document.createTextNode(g["Searching..."]));h.empty(this.$favresults);
this.$results.appendChild(a);var e=this;setTimeout(function(){var a=e._searcher.createSearchParams(b,!0,e._searchOnRoot),c=e._searchRenderer.makeRenderFunction(e._contentTypeService,e.$results,!1,e.decorateResult.bind(e));e._searcher.search(a,!1,c)},0)}};e.prototype.decorateResult=function(b){for(var c=this,b=h.$$array("a",b),a=0;a<b.length;a++){var e=b[a];e.addEventListener("mouseup",function(a){a.button===0&&!a.ctrlKey&&!a.metaKey&&c.hide()},!1);e.addEventListener("keyup",function(a){a.keyCode===
h.KEY.ENTER&&c.hide()},!1)}};e.prototype._beforeHiding=function(){clearTimeout(this._timeoutId)};e.prototype._afterHiding=function(){this._onHide&&this._onHide()};e.prototype.constructor=e;return{OpenResourceDialog:e}});
define("orion/globalSearch/advSearchOptContainer",["i18n!orion/globalSearch/nls/messages","require","orion/searchUtils","orion/contentTypes","orion/i18nUtil"],function(g,k,j,b,h){function f(b,c,a,f){this._inputField=b;if(typeof this._inputField==="string")this._inputField=document.getElementById(this._inputField);(b=f?f.group:null)||(b=this._inputField.id?this._inputField.id:"default__dropDown__group");this._idPrefix=b+"__dropDown__";this.containerId=this._idPrefix+"UIContainer";this._dismissed=!0;
var g=this;this._optRenderer=new e(c,a,function(){g.dismiss();g._inputField.focus()});this._initUI()}function e(b,c,a){this._searcher=b;this._serviceRegistry=c;this._cancelCallBack=a}f.prototype._initUI=function(){this._optUIContainer=document.getElementById(this.containerId);if(!this._optUIContainer)this._optUIContainer=document.createElement("div"),this._optUIContainer.id=this.containerId,this._optUIContainer.style.display="none",this._optUIContainer.className="advSearchOptContainer",document.body.appendChild(this._optUIContainer),
this._optRenderer.render(this._optUIContainer)};f.prototype.dismiss=function(){this._dismissed=!0;this._optUIContainer.style.display="none"};f.prototype.show=function(b){for(var c=0,a=0,e=this._inputField;e;)c+=e.offsetLeft,a+=e.offsetTop,e=e.offsetParent;this._optUIContainer.style.display="block";this._optUIContainer.style.top=a+this._inputField.offsetHeight+2+"px";this._optUIContainer.style.left=c+"px";this._optUIContainer.style.width=this._inputField.offsetWidth+"px";this._optRenderer._searchBox.value=
b;this._optRenderer._searchBox.focus();this._dismissed=this._mouseDown=!1};f.prototype.toggle=function(){this._dismissed?this.show(this._inputField.value):this.dismiss()};f.prototype.constructor=f;e.prototype.getOptions=function(){return{searchStr:this._searchBox.value,caseSensitive:this._caseSensitiveCB.checked,regEx:this._regExCB.checked,type:this._fileTypes.options[this._fileTypes.selectedIndex].value}};e.prototype.render=function(d,c){this._parentDiv=d;if(typeof this._parentDiv==="string")this._parentDiv=
document.getElementById(this._parentDiv);var a=this._serviceRegistry.getService("orion.core.contenttypes");if(a){var e=this;a.getContentTypes().then(function(a){e.contentTypesCache=a;e._render(c)})}else a=new b.ContentTypeService(this._serviceRegistry),this.contentTypesCache=a.getContentTypes(),this._render(c)};e.prototype._render=function(b){b?this._renderHTML(b):this._renderRaw()};e.prototype._submitSearch=function(){var b=this.getOptions();j.doSearch(this._searcher,this._serviceRegistry,b.searchStr,
b)};e.prototype._initControls=function(){this._searchBox=document.getElementById("advSearchInput");this._fileTypes=document.getElementById("advSearchTypes");this._caseSensitiveCB=document.getElementById("advSearchCaseSensitive");this._regExCB=document.getElementById("advSearchRegEx");this._submitButton=document.getElementById("advSearchSubmit");for(var b=[{label:g["All types"],value:j.ALL_FILE_TYPE}],c=0;c<this.contentTypesCache.length;c++)if(this.contentTypesCache[c]["extends"]==="text/plain"||this.contentTypesCache[c].id===
"text/plain")for(var a=0;a<this.contentTypesCache[c].extension.length;a++)b.push({label:this.contentTypesCache[c].extension[a],value:this.contentTypesCache[c].extension[a]});for(c=0;c<b.length;c++){var a=document.createElement("option"),e=document.createTextNode(b[c].label);a.appendChild(e);this._fileTypes.appendChild(a);a.value=b[c].value}var f=this;this._searchBox.addEventListener("keydown",function(a){a=a.charCode||a.keyCode;a===13&&f._submitSearch();a===27&&f._cancelCallBack&&f._cancelCallBack()});
this._fileTypes.addEventListener("change",function(){var a=f._fileTypes.options[f._fileTypes.selectedIndex].value;f._searchBox.placeholder=a===j.ALL_FILE_TYPE?g["Type a search term"]:h.formatMessage(g["All ${0} files"],a)});this._submitButton.onclick=function(){f._submitSearch()}};e.prototype._initHTMLLabels=function(){document.getElementById("advSearchLabel").appendChild(document.createTextNode(g["Files that contain:"]));document.getElementById("advSearchInput").placeholder=g["Type a search term"];
document.getElementById("advSearchTypeLabel").appendChild(document.createTextNode(g["File type:"]));document.getElementById("advSearchCaseSensitiveLabel").appendChild(document.createTextNode(g["Case sensitive"]));document.getElementById("advSearchRegExLabel").appendChild(document.createTextNode(g["Regular expression"]));document.getElementById("advSearchSubmit").value=g.Search};e.prototype._renderHTML=function(b){var c=this,a=new XMLHttpRequest;a.open("GET",k.toUrl(b),!0);a.onreadystatechange=function(){if(this.readyState===
4&&this.status===200)c._parentDiv.innerHTML=this.responseText,c._initHTMLLabels(),c._initControls()};a.send()};e.prototype._htmlTemplate='<ul class="advSearchOptUL"><li class="advSearchOptLILabel"><label>'+g["Files that contain:"]+'</label></li><li class="advSearchOptLIControl"><input type="text" id="advSearchInput" placeholder="'+g["Type a search term"]+'"></input></li><li class="advSearchOptLIControl"><label>'+g["File type:"]+'</label><select id="advSearchTypes"></select></li><li class="advSearchOptLIControl"><label>'+
g["Case sensitive"]+'</label><input type="checkbox" id="advSearchCaseSensitive"></input></li><li class="advSearchOptLIControl"><label>'+g["Regular expression"]+'</label><input type="checkbox" id="advSearchRegEx"></input></li><li class="advSearchOptLIControl"><input type="button" class="advSearchOptButton" id="advSearchSubmit" value="'+g.Search+'"></input></li></ul>';e.prototype._renderRaw=function(){this._parentDiv.innerHTML=this._htmlTemplate;this._initControls()};e.prototype.constructor=e;return{advSearchOptContainer:f,
advSearchOptRenderer:e}});
define("orion/searchAndReplace/textSearcher","i18n!orion/search/nls/messages,require,orion/webui/littlelib,orion/editor/annotations,orion/commands,orion/searchUtils".split(","),function(g,k,j,b){var h=h||{};h.TextSearcher=function(){function f(b,d,c,a){this._editor=b;this._commandService=d;this._undoStack=c;this._wrapSearch=this._ignoreCase=this._showAllOccurrence=!0;this._wholeWord=!1;this._incremental=!0;this._useRegExp=!1;this._findAfterReplace=!0;this._reverse=!1;this.isMac=navigator.platform.indexOf("Mac")!==
-1;this._timer=this._searchRange=null;this._searchOnRange=!1;this._lastSearchString="";var f=this;this._listeners={onEditorFocus:function(a){f.removeCurrentAnnotation(a)}};this.setOptions(a)}f.prototype={_createActionTable:function(){var e=this;this._commandService.openParameterCollector("pageNavigationActions",function(d){var c=document.createElement("input");c.type="text";c.name=g["Find:"];c.id="localSearchFindWith";c.placeholder=g["Find With"];c.onkeyup=function(a){return e._handleKeyUp(a)};c.onkeydown=
function(a){return e._handleKeyDown(a,!0)};d.appendChild(c);e.createButton("Next",d,function(){e.findNext(!0)});e.createButton("Previous",d,function(){e.findNext(!1)});var a=document.createElement("input");a.type="text";a.name=g["ReplaceWith:"];a.id="localSearchReplaceWith";a.placeholder=g["Replace With"];a.classList.add("searchCmdGroupMargin");a.onkeydown=function(a){return e._handleKeyDown(a,!1)};d.appendChild(a);e.createButton(g.Replace,d,function(){e.replace()});e.createButton(g["Replace All"],
d,function(){e.replaceAll()});a=document.createElement("div");d.appendChild(a);a.classList.add("findOptionsDiv");var f=e._commandService._createDropdownMenu(a,g.Options);f.menuButton.classList.add("findSlideoutMenu");e._commandService._generateCheckedMenuItem(f.menu,g["Show all"],e._showAllOccurrence,function(a){a=a.target.checked;e.setOptions({showAllOccurrence:a});a?e.markAllOccurrences(!0):(a=e._editor.getAnnotationModel())&&a.removeAnnotations(b.AnnotationType.ANNOTATION_MATCHING_SEARCH);f.dropdown.close(!0)});
e._commandService._generateCheckedMenuItem(f.menu,g["Case sensitive"],!e._ignoreCase,function(a){e.setOptions({ignoreCase:!a.target.checked});f.dropdown.close(!0);e.findNext(!0,null,!0)});e._commandService._generateCheckedMenuItem(f.menu,g["Wrap search"],e._wrapSearch,function(a){e.setOptions({wrapSearch:a.target.checked});f.dropdown.close(!0)});e._commandService._generateCheckedMenuItem(f.menu,g["Incremental search"],e._incremental,function(a){e.setOptions({incremental:a.target.checked});f.dropdown.close(!0)});
e._commandService._generateCheckedMenuItem(f.menu,g["Whole Word"],e._wholeWord,function(a){e.setOptions({wholeWord:a.target.checked});f.dropdown.close(!0);e.findNext(!0,null,!0)});e._commandService._generateCheckedMenuItem(f.menu,g["Regular expression"],e._useRegExp,function(a){e.setOptions({useRegExp:a.target.checked});f.dropdown.close(!0);e.findNext(!0,null,!0)});e._commandService._generateCheckedMenuItem(f.menu,g["Find after replace"],e._findAfterReplace,function(a){e.setOptions({findAfterReplace:a.target.checked});
f.dropdown.close(!0)});return c},function(){e.closeUI()})},visible:function(){return document.getElementById("localSearchFindWith")?!0:!1},_handleKeyUp:function(){if(this._incremental&&!this._keyUpHandled)this._noSelection?this._noSelection=!1:this.findNext(!0,null,!0);this._keyUpHandled=!1;return!0},_handleKeyDown:function(b,d){var c=(this.isMac?b.metaKey:b.ctrlKey)&&!b.altKey&&!b.shiftKey;if(c&&b.keyCode===70)return this._keyUpHandled=d,b.stopPropagation&&b.stopPropagation(),b.cancelBubble=!0,!1;
if((this.isMac?b.metaKey:b.ctrlKey)&&!b.altKey&&b.keyCode===75||b.keyCode===13)return b.stopPropagation&&b.stopPropagation(),b.cancelBubble=!0,this.findNext(!b.shiftKey),this._keyUpHandled=d,!1;if(c&&b.keyCode===82)return b.stopPropagation&&b.stopPropagation(),b.cancelBubble=!0,d||this.replace(),this._keyUpHandled=d,!1;return b.keyCode===27?(this.closeUI(),this._keyUpHandled=d,!1):!0},closeUI:function(){this.visible()&&this._commandService.closeParameterCollector();this._editor.getTextView().removeEventListener("Focus",
this._listeners.onEditorFocus);this._editor.getTextView().focus();var e=this._editor.getAnnotationModel();e&&(e.removeAnnotations(b.AnnotationType.ANNOTATION_CURRENT_SEARCH),e.removeAnnotations(b.AnnotationType.ANNOTATION_MATCHING_SEARCH))},removeCurrentAnnotation:function(){var e=this._editor.getAnnotationModel();e&&e.removeAnnotations(b.AnnotationType.ANNOTATION_CURRENT_SEARCH)},createButton:function(b,d,c){var a=document.createElement("span");a.tabIndex=0;a.role="button";a.addEventListener("click",
c.bind(this),!1);var f=this;a.addEventListener("keydown",function(a){a.keyCode===j.KEY.ENTER||a.keyCode===j.KEY.SPACE?c.bind(f)():a.keyCode===j.KEY.ESCAPE&&f.closeUI()});a.appendChild(document.createTextNode(b));a.classList.add("findSlideoutButton");d.appendChild(a)},buildToolBar:function(b,d){this._keyUpHandled=!0;this._editor.getTextView().addEventListener("Focus",this._listeners.onEditorFocus);var c=document.getElementById("localSearchFindWith");if(this.visible())b.length>0?c.value=b:this._noSelection=
!0;else{this._createActionTable();if(typeof d==="string")document.getElementById("localSearchReplaceWith").value=d;c=document.getElementById("localSearchFindWith");c.value=b}window.setTimeout(function(){c.select();c.focus()},10)},setOptions:function(b){if(b){if(b.showAllOccurrence===!0||b.showAllOccurrence===!1)this._showAllOccurrence=b.showAllOccurrence;if(b.ignoreCase===!0||b.ignoreCase===!1)this._ignoreCase=b.ignoreCase;if(b.wrapSearch===!0||b.wrapSearch===!1)this._wrapSearch=b.wrapSearch;if(b.wholeWord===
!0||b.wholeWord===!1)this._wholeWord=b.wholeWord;if(b.incremental===!0||b.incremental===!1)this._incremental=b.incremental;if(b.useRegExp===!0||b.useRegExp===!1)this._useRegExp=b.useRegExp;if(b.findAfterReplace===!0||b.findAfterReplace===!1)this._findAfterReplace=b.findAfterReplace;if(b.reverse===!0||b.reverse===!1)this._reverse=b.reverse;if(b.toolBarId)this._toolBarId=b.toolBarId;if(b.searchRange)this._searchRange=b.searchRange;if(b.searchOnRange===!0||b.searchOnRange===!1)this._searchOnRange=b.searchOnRange}},
getSearchStartIndex:function(b,d){var c=this._editor.getCaretOffset();if(b){var a=this._editor.getSelection(),f=a.end>a.start?a.end-a.start:0;return!d?c-f-1>0?c-f-1:0:a.end>0?a.end:0}return c>0?c:0},findNext:function(b,d,c){this.setOptions({reverse:!b});var a=document.getElementById("localSearchFindWith"),c=this.getSearchStartIndex(c?!0:!b);d||(d=a?a.value:this._lastSearchString);return this._doFind(d,c,!b,this._wrapSearch)},startUndo:function(){this._undoStack&&this._undoStack.startCompoundChange()},
endUndo:function(){this._undoStack&&this._undoStack.endCompoundChange()},_doReplace:function(b,d,c,a){var f=this._editor;if(this._useRegExp){if(c=f.getText().substring(b,d).replace(RegExp(c,this._ignoreCase?"i":""),a))f.setText(c,b,d),f.setSelection(b,b+c.length,!0)}else f.setText(a,b,d),f.setSelection(b,b+a.length,!0)},replace:function(){this.startUndo();var b=document.getElementById("localSearchReplaceWith").value,d=this._editor,c=d.getSelection(),a=document.getElementById("localSearchFindWith").value,
c=c?c.start:0;a&&(d=d.getModel().find({string:a,start:c,reverse:!1,wrap:this._wrapSearch,regex:this._useRegExp,wholeWord:this._wholeWord,caseInsensitive:this._ignoreCase}).next())&&this._doReplace(d.start,d.end,a,b);this.endUndo();this._findAfterReplace&&a&&this._doFind(a,this.getSearchStartIndex(!1),!1,this._wrapSearch)},_doFind:function(e,d,c,a){var f=this._editor,h=f.getAnnotationModel();if(!e)return h&&(h.removeAnnotations(b.AnnotationType.ANNOTATION_CURRENT_SEARCH),h.removeAnnotations(b.AnnotationType.ANNOTATION_MATCHING_SEARCH)),
null;this._lastSearchString=e;var j=f.getModel().find({string:e,start:d,reverse:c,wrap:a,regex:this._useRegExp,wholeWord:this._wholeWord,caseInsensitive:this._ignoreCase}).next();if(!this._replacingAll&&(j?this._editor.reportStatus(""):this._editor.reportStatus(g["Not found"],"error"),this.visible()&&(e=b.AnnotationType.ANNOTATION_CURRENT_SEARCH,h&&(h.removeAnnotations(e),j&&h.addAnnotation(b.AnnotationType.createAnnotation(e,j.start,j.end))),this._showAllOccurrence))){this._timer&&window.clearTimeout(this._timer);
var k=this;this._timer=window.setTimeout(function(){k.markAllOccurrences(j);k._timer=null},500)}j&&f.moveSelection(j.start,j.end,null,!1);return j},replaceAll:function(){var b=document.getElementById("localSearchFindWith").value;if(b){this._replacingAll=!0;var d=this._editor;d.reportStatus("");d.reportStatus(g["Replacing all..."],"progress");var c=document.getElementById("localSearchReplaceWith").value,a=this;window.setTimeout(function(){for(var f=0,h=0;;){if(!a._doFind(b,f))break;h++;h===1&&a.startUndo();
f=d.getSelection();a._doReplace(f.start,f.end,b,c);f=a.getSearchStartIndex(!0,!0)}h>0&&a.endUndo();d.reportStatus("","progress");f>0?d.reportStatus(g["Replaced "]+h+g[" matches"]):d.reportStatus(g["Nothing replaced"],"error");a._replacingAll=!1},100)}},markAllOccurrences:function(e){var d=this._editor.getAnnotationModel();if(d){for(var c=b.AnnotationType.ANNOTATION_MATCHING_SEARCH,a=d.getAnnotations(0,d.getTextModel().getCharCount()),f=[],g;a.hasNext();){var h=a.next();h.type===c&&f.push(h)}a=document.getElementById("localSearchFindWith").value;
if(e&&a){a=this._editor.getModel().find({string:a,regex:this._useRegExp,wholeWord:this._wholeWord,caseInsensitive:this._ignoreCase});for(g=[];a.hasNext();)e=a.next(),g.push(b.AnnotationType.createAnnotation(c,e.start,e.end))}d.replaceAnnotations(f,g)}}};return f}();return h});
define("orion/PageLinks",["require","orion/Deferred","orion/PageUtil","orion/URITemplate","orion/URL-shim"],function(g,k,j,b){function h(f,e){for(var d=f.getServiceReferences(e||"orion.page.link"),c=j.matchResourceParameters(window.location.href),a={OrionHome:(new URL(g.toUrl("."),window.location)).href.slice(0,-1),Location:c.resource},c=[],i=0;i<d.length;i++){for(var h={},n=d[i].getPropertyKeys(),q=0;q<n.length;q++)h[n[q]]=d[i].getProperty(n[q]);if(h.uriTemplate&&h.nls&&(h.name||h.nameKey)){var t=
new k;g(["i18n!"+h.nls],function(c){var d=new b(h.uriTemplate),d=window.decodeURIComponent(d.expand(a)),d=j.validateURLScheme(d);h.href=d;h.textContent=h.nameKey?c[h.nameKey]:h.name;t.resolve(h)});c.push(t)}else if(h.uriTemplate&&h.name)n=new b(h.uriTemplate),n=window.decodeURIComponent(n.expand(a)),n=j.validateURLScheme(n),h.href=n,h.textContent=h.name,c.push((new k).resolve(h))}return k.all(c)}return{createPageLinks:function(b,e){return h(b,e).then(function(b){return b.map(function(b){var a=b.href,
b=b.textContent,d=document.createElement("a");d.href=a;d.target="_self";d.classList.add("targetSelector");d.textContent=b;return d})})},getPageLinksInfo:h}});
define("orion/widgets/UserMenu",["i18n!orion/widgets/nls/messages","require","orion/webui/littlelib","orion/PageLinks"],function(g,k,j,b){function h(b){this._init(b)}h.prototype={_init:function(b){this._dropdownNode=j.node(b.dropdownNode);if(!this._dropdownNode)throw"no dom node for dropdown found";this._dropdown=b.dropdown;this._serviceRegistry=b.serviceRegistry;this.authenticatedServices={};this.unauthenticatedServices={}},isSingleService:function(){return this.length(this.unauthenticatedServices)+
this.length(this.authenticatedServices)===1},hasServices:function(){return this.length(this.unauthenticatedServices)+this.length(this.authenticatedServices)>0},length:function(b){var e=0,d;for(d in b)b.hasOwnProperty(d)&&e++;return e},_makeMenuItem:function(b,e){var d=document.createElement("span");d.role="menuitem";d.tabIndex=0;var c=document.createTextNode(b);d.appendChild(c);d.classList.add("dropdownMenuItem");d.addEventListener("click",e,!1);d.addEventListener("keydown",function(a){(a.keyCode===
j.KEY.ENTER||a.keyCode===j.KEY.SPACE)&&e()},!1);return d},_renderAuthenticatedService:function(b){var e=this,d=this.authenticatedServices[b].authService;if(d&&d.logout){var c=document.createElement("li"),a=this._makeMenuItem(g["Sign Out"],function(){d.logout().then(function(){e.addUserItem(b,d,e.authenticatedServices[b].label);localStorage.removeItem(b);localStorage.removeItem("lastLogin");for(var a=localStorage.length-1;a>=0;a--){var c=localStorage.key(a);c&&c.indexOf("/orion/preferences/user")===
0&&localStorage.removeItem(c)}d.getAuthForm(window.location.href).then(function(a){window.location=a})})});c.appendChild(a);this._dropdownNode.appendChild(c)}},renderServices:function(){function f(b){d[b]||(d[b]=e.createDocumentFragment());return d[b]}var e=document,d=[];b.getPageLinksInfo(this._serviceRegistry,"orion.page.link.user").then(function(b){this._dropdown.empty();b.forEach(function(a){var b=f(typeof a.category==="number"?a.category:1),c=e.createElement("li"),d=e.createElement("a");d.role=
"menuitem";d.classList.add("dropdownMenuItem");d.href=a.href;d.textContent=a.textContent;c.appendChild(d);b.appendChild(c)});if(this.keyAssistFunction){var b=document.createElement("li"),a=this._makeMenuItem(g["Keyboard Shortcuts"],this.keyAssistFunction);a.classList.add("key-assist-menuitem");b.appendChild(a);f(0).appendChild(b)}var h=this;d.sort(function(a,b){return a-b}).forEach(function(a,b){if(b<d.length-1){var c=document.createElement("li");c.classList.add("dropdownSeparator");var e=document.createElement("span");
e.classList.add("dropdownSeparator");c.appendChild(e);a.appendChild(c)}h._dropdownNode.appendChild(a)});if(this.isSingleService())for(var j in this.authenticatedServices)this.authenticatedServices.hasOwnProperty(j)&&this._renderAuthenticatedService(j,0)}.bind(this))},setKeyAssist:function(b){this.keyAssistFunction=b;this.renderServices()},addUserItem:function(b,e,d,c){c?(this.unauthenticatedServices[b]&&delete this.unauthenticatedServices[b],this.authenticatedServices[b]={authService:e,label:d,data:c}):
(this.authenticatedServices[b]&&delete this.authenticatedServices[b],this.unauthenticatedServices[b]=this.unauthenticatedServices[b]?{authService:e,label:d,pending:this.unauthenticatedServices[b].pending}:{authService:e,label:d});this.renderServices()}};h.prototype.constructor=h;return{UserMenu:h}});
define("orion/globalCommands","i18n!orion/nls/messages,require,orion/commonHTMLFragments,orion/commands,orion/parameterCollectors,orion/extensionCommands,orion/uiUtils,orion/editor/keyBinding,orion/breadcrumbs,orion/webui/littlelib,orion/webui/splitter,orion/webui/dropdown,orion/webui/tooltip,orion/favorites,orion/contentTypes,orion/URITemplate,orion/PageUtil,orion/widgets/themes/container/ThemeSheetWriter,orion/searchUtils,orion/inputCompletion/inputCompletion,orion/globalSearch/advSearchOptContainer,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".split(","),function(g,
k,j,b,h,f,e,d,c,a,i,l,n,q,t,m,r,o,x,s,v,u,y,A,p,w,B,D){function z(a,b){if(a.getLabel)return a.getLabel();else{var c=new u;c.resolve(b.properties.name);return c}}function M(b){a.node("progressPane").setAttribute("aria-label",g["Operations - Press spacebar to show current operations"]);(b=b.getService("orion.page.progress"))&&b.init.bind(b)("progressPane")}function E(a,b){var c=a.getService("orion.core.auth");c!==null&&c.getUser().then(function(a){var c;a.Name?c=document.createTextNode(a.Name):a.login&&
(c=document.createTextNode(a.login));c&&(b.childNodes.length>0?b.childNodes[0].nodeType===3?b.replaceChild(c,b.childNodes[0]):b.insertBefore(c,b.childNodes[0]):b.appendChild(c))})}function F(b,c){var d=b.getServiceReferences("orion.core.auth");R=[];if(a.node("userMenu")){var e=a.node("userDropdown"),f=new l.Dropdown({dropdown:e}),h=new y.UserMenu({dropdownNode:e,dropdown:f,serviceRegistry:b}),e=a.node("userTrigger");new n.Tooltip({node:e,text:g.Options,position:["below","left"]});E(b,e);h.setKeyAssist(c);
for(e=0;e<d.length;e++){var f=d[e],i=b.getService(f);z(i,f).then(function(a){i.getKey().then(function(b){R.push(b);i.getUser().then(function(c){h.addUserItem(b,i,a,c)},function(c,d){h.addUserItem(b,i,a,d)});window.addEventListener("storage",function(){N[b]!==localStorage.getItem(b)&&(N[b]=localStorage.getItem(b),i.getUser().then(function(c){h.addUserItem(b,i,a,c)},function(){h.addUserItem(b,i,a)}))},!1)})})}}}function G(b){var c=document.createElement("span");c.id="advancedSearchDropDown";a.node("searchOptions").appendChild(c);
c.tabIndex=0;c.classList.add("advancedSearchDecorationSprite");c.classList.add("core-sprite-openarrow");c.title=g["Advanced search"];c.onclick=function(){b.toggle()};c.addEventListener("keydown",function(a){(a.charCode||a.keyCode)===13&&b.toggle()});c.classList.add("bannerMenuSearchOptions")}function C(b,c){var d=a.node("relatedDropdown");J||(J=new l.Dropdown({dropdown:d}));b._addMenuItem(d,c)}function H(c,d,e,g,h){var i,j=c.getServiceReferences("orion.page.link.related");j.length<=0||a.node("relatedLinks")&&
u.when(function(){if(i)return i;var a=c.getService("orion.core.contenttypes");a||(a=new t.ContentTypeService(c),a=c.getService("orion.core.contenttypes"));return a.getContentTypes().then(function(a){return i=a})}(),function(){var k;a.node("relatedLinks")&&J&&(J.close(),J.empty());for(var l=[],m=0;m<j.length;m++){var n={},p,o=j[m].getPropertyKeys();for(p=0;p<o.length;p++)n[o[p]]=j[m].getProperty(o[p]);if(n.id){var q=function(a){if(a)if(!a.visibleWhen||a.visibleWhen(d)){var c=new b.CommandInvocation(g,
d,d,null,a);C(a,c)}else typeof h==="function"&&(k||(k=h()),u.when(k,function(c){c&&d===S&&(!a.visibleWhen||a.visibleWhen(c))&&C(a,new b.CommandInvocation(g,c,c,null,a))}))},w=null;p=null;if(e.indexOf(n.id)<0)if((n.nls&&n.nameKey||n.name)&&n.uriTemplate)p=f._createCommandOptions(n,j[m],c,i,!0),l.push(p),p.then(function(a){a=new b.Command(a);q(a)});else{if(!w&&(w=g.findCommand(n.id))){q(w);continue}if(!w){var t=c.getServiceReferences("orion.navigate.command");for(p=0;p<t.length;p++)if(t[p].getProperty("id")===
n.id){for(var n={},o=t[p].getPropertyKeys(),B=0;B<o.length;B++)n[o[B]]=t[p].getProperty(o[B]);p=f._createCommandOptions(n,t[p],c,i,!0);l.push(p);p.then(function(a){w=new b.Command(a);q(w)});break}}}}}u.all(l,function(a){return a}).then(function(){var b=a.node("relatedTrigger");if(J&&b)b.style.visibility=J.getItems().length===0?"hidden":"visible"})})}function K(b){var c=a.node("globalActions");c&&(b.destroy(c),b.renderCommands(c.id,c,{},{},"tool"))}function P(a){a.getPreferences("/themes",2).then(function(a){var b=
a.get("selected");if(b&&(b=JSON.parse(b),a=a.get("styles"))){var a=JSON.parse(a),c;for(c in a)if(a[c].name===b.selected){c=a[c];c=(new o.ThemeSheetWriter).getSheet(c);b=document.createElement("STYLE");b.appendChild(document.createTextNode(c));(document.getElementsByTagName("HEAD")[0]||document.documentElement).appendChild(b);break}}})}function L(b){var c={},d=null;typeof b==="string"&&(b=a.node(b));b||(b=a.node("pageActions"));for(var e=b;e&&e.classList;){if(e.classList.contains("toolComposite")){d=
e;break}e=e.parentNode}if(b.classList.contains("commandMarker"))c.commandNode=b;if(d&&(c.slideContainer=a.$(".slideParameters",d),c.parameterArea=a.$(".parameters",d),c.dismissArea=a.$(".parametersDismiss",d),c.notifications=a.$("#notificationArea",d),d.parentNode&&(c.toolbarTarget=a.$(".toolbarTarget",d.parentNode),c.toolbarTarget)))b=a.bounds(d),c.toolbarTargetY=b.height+1;return c}function Q(b){if(b.toolbarTarget&&b.toolbarTargetY){var c=0,d;b.notifications&&b.notifications.classList.contains("slideContainerActive")&&
(d=a.bounds(b.notifications),c+=d.height);b.slideContainer&&b.slideContainer.classList.contains("slideContainerActive")&&(d=a.bounds(b.slideContainer),c+=d.height);c>0&&(c+=8);b.toolbarTarget.style.top=b.toolbarTargetY+c+"px";b.toolbarTarget.style.bottom=0}}var m=function(a){var b=document.createElement("a");b.href=a;return b.href}(k.toUrl("auth/NotifyAuthentication.html")),N={},R=[],J,S,T=[],I,O=null;return{addSettings:function(b){var c=document.getElementById("settingsTab"),d=document.getElementById("settingsAction"),
e=!1,f;c.style.visibility="";d.style.visibility="";d.onclick=function(){if(!e){e=!0;c.style.backgroundColor="#555";c.style.zIndex="99";c.style.borderTopRightRadius="3px";c.style.borderTopLeftRadius="3px";d.className="core-sprite-settings-white";c.id="settingsNode";d.id="settingsButton";var g=document.getElementById("innerPanels"),h=g.getBoundingClientRect(),i=c.getBoundingClientRect();f?f.style.visibility="visible":(f=document.createElement("div"),f.className="settingsPanel",f.style.width="150px",
f.style.height="150px",f.style.backgroundColor="#555",f.style.zIndex="99",f.style.top=i.top-h.top+24-4+"px",f.id="settingsPanel",f.style.borderTopLeftRadius="3px",f.style.borderBottomRightRadius="3px",f.style.borderBottomLeftRadius="3px",g.appendChild(f),a.addAutoDismiss([d,c,f],function(){d.className="core-sprite-settings";c.style.backgroundColor="white";f.style.visibility="hidden";e=!1}));a.empty(f);b.appendTo(f)}}},generateBanner:function(c,f,l,m,o,t,r,z){function C(b){b.registerService("orion.cm.managedservice",
{updated:function(b){for(var b=b&&b["links.newtab"]!=="undefined"?b["links.newtab"]?"_blank":"_self":"_self",c=a.$$array(".targetSelector"),d=0;d<c.length;d++)c[d].target=b}},{pid:"nav.config"})}P(m);m=a.node(c);if(!m)throw g["could not find banner parent, id was "]+c;c=document.createRange();c.selectNode(m);c=c.createContextualFragment(w);a.processTextNodes(c,g);m.firstChild?m.insertBefore(c,m.firstChild):m.appendChild(c);c=a.node("home");c.href=k.toUrl("navigate/table.html");c.setAttribute("aria-label",
g["Orion Home"]);a.node("progressPane").src=k.toUrl("images/none.png");if(c=a.node("pageToolbar"))c.classList.add("toolbarLayout"),c.innerHTML=D+j.slideoutHTMLFragment("mainToolbar");(c=a.node("closeNotifications"))&&c.setAttribute("aria-label",g["Close notification"]);if(c=a.node("footer"))c.innerHTML=B,a.processTextNodes(c,g);l.setParameterCollector(new h.CommandParameterCollector(L,Q));var y=document.createElement("div");y.id="keyAssist";y.style.display="none";y.classList.add("keyAssistFloat");
y.role="list";y.setAttribute("aria-atomic","true");y.setAttribute("aria-live","assertive");document.body.appendChild(y);document.addEventListener("keydown",function(b){if(b.charOrCode===a.KEY.ESCAPE)y.style.display="none"},!1);a.addAutoDismiss([y],function(){y.style.display="none"});var H=a.node("primaryNav");H&&A.createPageLinks(f,"orion.page.link").then(function(a){a.forEach(function(a){H.appendChild(a)})});var E=a.node("search");if(!E)throw"failed to generate HTML for banner";E.setAttribute("placeholder",
g.Search);new n.Tooltip({node:E,text:g["Type a keyword or wild card to search in root"],position:["below","left"]});var N=new v.advSearchOptContainer(E,o,f,{group:"advancedSearch"});new s.InputCompletion(E,function(a){x.getMixedSearches(f,!0,!1,function(b){var c,d=[],e=!1,f=!1;for(c in b)b[c].label&&b[c].value?(e||(d.push({type:"category",label:g["Saved searches"]}),e=!0),d.push({type:"proposal",value:{name:b[c].label,value:k.toUrl("search/search.html")+"#"+b[c].value,type:"link"}})):(f||(d.push({type:"category",
label:g["Recent searches"]}),f=!0),d.push({type:"proposal",label:b[c].name,value:b[c].name}));a(d)})},{group:"globalSearch",extendedProvider:function(a,b){var c=f.getServiceReferences("orion.search.proposal");if(!c||c.length===0)b(null);else{var d=[];c.forEach(function(b){var c=b.getProperty("filterForMe");d.push(f.getService(b).run(a).then(function(a){for(var b={filterForMe:c,proposals:[]},d=0;d<a.length;d++){b.proposals.push({type:"category",label:a[d].category});for(var e=0;e<a[d].datalist.length;e++)b.proposals.push({type:"proposal",
label:a[d].datalist[e],value:a[d].datalist[e]})}return b}))});u.all(d).then(function(a){b(a)})}}});E.addEventListener("keydown",function(a){a.defaultPrevented||(a.charCode||a.keyCode)===13&&x.doSearch(o,f,E.value)});G(N);a.addAutoDismiss([a.node(N.containerId),a.node("advancedSearchDropDown")],function(){N.dismiss()});if(c=a.$(".split")){var m=a.$(".sidePanelLayout"),J=a.$(".mainPanelLayout");if(m&&J)O={side:m,main:J},O.splitter=new i.Splitter({node:c,sidePanel:m,mainPanel:J,toggle:!0}),c=new b.Command({name:g["Toggle side panel"],
tooltip:g["Open or close the side panel"],id:"orion.toggleSidePane",callback:function(){O.splitter.toggleSidePanel()}}),l.addCommand(c),l.registerCommandContribution("pageActions","orion.toggleSidePane",1,null,!0,new b.CommandKeyBinding("o",!0)),r&&(O.splitter.addResizeListener(function(a){r&&a===J&&r.getTextView().resize()}),r.getTextView().setKeyBinding(new d.KeyBinding("o",!0),"toggleOutliner"),r.getTextView().setAction("toggleOutliner",function(){O.splitter.toggleSidePanel();return!0},{name:g["Toggle Outliner"]}))}c=
new b.Command({name:g["Make Favorite"],tooltip:g["Add to the favorites list"],imageClass:"core-sprite-makeFavorite",id:"orion.makeFavorite",visibleWhen:function(a){a=Array.isArray(a)?a:[a];if(a.length===0)return!1;for(var b=0;b<a.length;b++)if(!a[b].Location)return!1;return!0},callback:function(a){for(var a=Array.isArray(a.items)?a.items:[a.items],b=f.getService("orion.core.favorite"),c=f.getService("orion.page.progress"),d=function(a){return function(d){d?f.getService("orion.page.message").setMessage(a.Name+
g[" is already a favorite."],2E3):c.progress(b.makeFavorites(a),"Making favorite "+a.Name)}},e=0;e<a.length;e++){var h=a[e];c.progress(b.hasFavorite(h.ChildrenLocation||h.Location),"Checking favorite "+h.Name).then(d(h))}}});l.addCommand(c);var I=function(a,b,c){var d=b.getService("orion.core.favorite"),e=b.getService("orion.page.progress");d||(d=new q.FavoritesService({serviceRegistry:b}),d=b.getService("orion.core.favorite"));var f=new p.OpenResourceDialog({searcher:a,progress:e,searchRenderer:a.defaultRenderer,
favoriteService:d,onHide:function(){c&&c.getTextView().focus()}});window.setTimeout(function(){f.show()},0)},c=new b.Command({name:g["Find File Named..."],tooltip:g["Choose a file by name and open an editor on it"],id:"eclipse.openResource",callback:function(){I(o,f,r)}});r&&(r.getTextView().setKeyBinding(new d.KeyBinding("f",!0,!0,!1),c.id),r.getTextView().setAction(c.id,function(){I(o,f,r);return!0},c));l.addCommand(c);l.registerCommandContribution("globalActions","eclipse.openResource",100,null,
!0,new b.CommandKeyBinding("f",!0,!0));c=new b.Command({name:g["Global search"],tooltip:g["Global search"],id:"eclipse.globalSearch",callback:function(){var b=a.node("search");b&&b.focus()}});r&&(r.getTextView().setKeyBinding(new d.KeyBinding("h",!0,!1,!0),c.id),r.getTextView().setAction(c.id,function(){var b=r.getSelection(),c=null;b.end>b.start&&(c=r.getModel().getText(b.start,b.end));if(b=a.node("search")){if(c)b.value=c;b.focus()}return!0},c));l.addCommand(c);l.registerCommandContribution("globalActions",
"eclipse.globalSearch",101,null,!0,new b.CommandKeyBinding("h",!0,!1,!0));c=new b.Command({name:g["Toggle banner and footer"],tooltip:g["Hide or show the page banner and footer"],id:"orion.toggleTrim",callback:function(){var b=a.node("banner"),c=a.node("footer"),d=a.$(".content-fixedHeight");b.style.display==="none"?(b.style.display="block",c.style.display="block",d.classList.remove("content-fixedHeight-maximized")):(b.style.display="none",c.style.display="none",d.classList.add("content-fixedHeight-maximized"));
r&&r.getTextView().resize();return!0}});l.addCommand(c);l.registerCommandContribution("globalActions","orion.toggleTrim",100,null,!0,new b.CommandKeyBinding("m",!0,!0));r&&(r.getTextView().setKeyBinding(new b.CommandKeyBinding("m",!0,!0),c.id),r.getTextView().setAction(c.id,c.callback,c));z&&z.addHandler({isActive:function(){return y.style.display==="block"},cancel:function(){return this.isActive()?(y.style.display="none",!0):!1}});z=new b.Command({name:g["System Configuration Details"],tooltip:g["System Config Tooltip"],
id:"orion.configDetailsPage",hrefCallback:function(){return k.toUrl("help/about.html")}});l.addCommand(z);l.registerCommandContribution("globalActions","orion.configDetailsPage",100,null,!0,new b.CommandKeyBinding(112,!0,!0));z=new b.Command({name:g["Background Operations"],tooltip:g["Background Operations Tooltip"],id:"orion.backgroundOperations",hrefCallback:function(){return k.toUrl("operations/list.html")}});l.addCommand(z);l.registerCommandContribution("globalActions","orion.backgroundOperations",
100,null,!0,new b.CommandKeyBinding("o",!0,!0));z=new b.Command({name:g["Show Keys"],tooltip:g["Show a list of all the keybindings on this page"],id:"eclipse.keyAssist",callback:function(){if(y.style.display==="none"){var b;a.empty(y);if(r){b=document.createElement("h2");b.appendChild(document.createTextNode(g.Editor));y.appendChild(b);b=r.getTextView().getActions(!1);for(var c=0;c<b.length;c++){var d=b[c],f=d,h=r.getTextView(),i=h.getActionDescription(d);if(i&&i.name)f=i.name;d=h.getKeyBindings(d);
for(h=0;h<d.length;h++){var i=e.getUserKeyString(d[h]),j=document.createElement("span");j.role="listitem";j.appendChild(document.createTextNode(i+" = "+f));j.appendChild(document.createElement("br"));y.appendChild(j)}}}b=document.createElement("h2");b.appendChild(document.createTextNode(g.Global));y.appendChild(b);l.showKeyBindings(y);y.style.display="block"}else y.style.display="none";return!0}});l.addCommand(z);l.registerCommandContribution("globalActions","eclipse.keyAssist",100,null,!0,new b.CommandKeyBinding(191,
!1,!0));r&&(c=window.navigator.platform.indexOf("Mac")!==-1,r.getTextView().setKeyBinding(new b.CommandKeyBinding(191,!1,!0,!c,c),z.id),r.getTextView().setAction(z.id,z.callback,z));K(l);F(f,z.callback);M(f);window.addEventListener("hashchange",function(){l.processURL(window.location.href)},!1);window.setTimeout(function(){C(f)},0)},getToolbarElements:L,getMainSplitter:function(){return O},layoutToolbarElements:Q,setPageTarget:function(b){var d,e,f=b.breadcrumbRootName;b.target?(b.searchService&&
b.searchService.setLocationByMetaData(b.target),b.fileService&&!b.breadcrumbTarget&&(e=f?f+" ":"",e+=b.fileService.fileServiceName(b.target.Location),f=null),d=b.name||b.target.Name,S=b.target,H(b.serviceRegistry,b.target,T,b.commandService,b.makeAlternate)):(b.breadcrumbTarget||(f=f||b.task||b.name),d=b.name);(I=b.title)||(I=d?d+" - "+b.task:b.task);window.document.title=I;a.empty(a.node("location"));new c.BreadCrumbs({container:"location",resource:b.breadcrumbTarget||b.target,rootSegmentName:f,
workspaceRootSegmentName:e,makeHref:b.makeBreadcrumbLink})},setDirtyIndicator:function(b){if(I)I.charAt(0)==="*"&&!b&&(I=I.substring(1)),b&&I.charAt(0)!=="*"&&(I="*"+I),window.document.title=I;var c=a.node("dirty");if(c)c.textContent=b?"*":""},setPageCommandExclusions:function(a){T=a},notifyAuthenticationSite:m}});
define("orion/status",["require","orion/webui/littlelib","orion/globalCommands"],function(g,k,j){function b(b,e,d,c,a){this._serviceRegistry=b;this._serviceRegistration=b.registerService("orion.page.message",this);this._operationsClient=e;this.notificationContainerDomId=a;this.domId=d;this.progressDomId=c||d;this._hookedClose=!1}function h(b,e,d,c){this.statusService=b;this.progressId=e;if(d){this.deferred=d;this.begin(c);var a=this;d.then(function(){a.done.bind(a)()},function(){a.done.bind(a)()})}}
b.prototype={_init:function(){var b=k.node("closeNotifications"),e=this;b&&!this._hookedClose&&(b.addEventListener("click",function(){e.setProgressMessage("")},!1),b.addEventListener("keydown",function(b){(b.keyCode===k.KEY.ENTER||b.keyCode===k.KEY.SPACE)&&e.setProgressMessage("")},!1))},_getNotifierElements:function(){if(!this._notifierElements)this._notifierElements=j.getToolbarElements(this.notificationContainerDomId);return this._notifierElements},setMessage:function(b,e,d){this._init();this.currentMessage=
b;var c=k.node(this.domId);if(typeof d==="boolean"){var a=this,g=c.getAttribute("aria-live");c.setAttribute("aria-live",d?"polite":"off");window.setTimeout(function(){b===a.currentMessage&&(k.empty(c),c.appendChild(document.createTextNode(b)),window.setTimeout(function(){c.setAttribute("aria-live",g)},100))},100)}else k.empty(c),c.appendChild(document.createTextNode(b));typeof e==="number"&&(a=this,window.setTimeout(function(){b===a.currentMessage&&(k.empty(c),c.appendChild(document.createTextNode("")))},
e))},setErrorMessage:function(b){this.currentMessage=b;this._init();var e=b.responseText||b.message||b;try{e=JSON.parse(e)}catch(d){}var b=e.Message||e,c="red";if(e.Severity)switch(e.Severity){case "Warning":c="#FFCC00";break;case "Error":c="red";break;case "Info":case "Ok":c="green"}e=document.createElement("span");e.style.color=c;e.appendChild(document.createTextNode(b));b=k.node(this.domId);k.empty(b);b.appendChild(e)},setProgressMessage:function(b){this._init();this.currentMessage=b;var e=document.createElement("span");
e.classList.add("imageSprite");e.classList.add("core-sprite-progress");var d=k.node(this.progressDomId);k.empty(d);d.appendChild(e);d.appendChild(document.createTextNode(b));e=k.node(this.notificationContainerDomId);e.classList.add("progressNormal");if(b&&b.length>0)e.classList.add("slideContainerActive");else if(this._progressMonitors&&this._progressMonitors.length>0)return this._renderOngoingMonitors();else e.classList.remove("slideContainerActive");j.layoutToolbarElements(this._getNotifierElements())},
setProgressResult:function(b){this.currentMessage=b;var e=b.responseText||b;try{e=JSON.parse(e)}catch(d){}this._init();var c=e.Message||e,a="core-sprite-info",g="progressInfo",h=document.createElement("span");h.classList.add("imageSprite");b=[];if(e.Severity)switch(e.Severity){case "Warning":a="core-sprite-warning";g="progressWarning";b.push("progressInfo");b.push("progressError");b.push("progressNormal");break;case "Error":a="core-sprite-error";g="progressError";b.push("progressWarning");b.push("progressInfo");
b.push("progressNormal");break;default:b.push("progressWarning"),b.push("progressError"),b.push("progressNormal")}h.classList.add(a);var n=k.node(this.progressDomId),a=k.node(this.notificationContainerDomId);k.empty(n);n.appendChild(h);e.HTML?(e=document.createElement("span"),e.innerHTML=c,n.appendChild(e)):n.appendChild(document.createTextNode("   "+c));if(g&&this.progressDomId!==this.domId){a.classList.add(g);for(c=0;c<b.length;c++)a.classList.remove(b[c])}a.classList.add("slideContainerActive");
j.layoutToolbarElements(this._getNotifierElements())},showWhile:function(b,e){var d=this;if(e){d.setProgressMessage(e);var c=function(){e===d.currentMessage&&d.setProgressMessage("")};b.then(c,c)}return b},_lastProgressId:0,_progressMonitors:{length:0},createProgressMonitor:function(b,e){return new h(this,++this._lastProgressId,b,e)},_renderOngoingMonitors:function(){if(this._progressMonitors.length>0){var b="",e=!0,d;for(d in this._progressMonitors)this._progressMonitors[d].status&&(e||(b+=", "),
b+=this._progressMonitors[d].status,e=!1);this.setProgressMessage(b)}else this.setProgressMessage("")},_beginProgressMonitor:function(b){this._progressMonitors[b.progressId]=b;this._progressMonitors.length++;this._renderOngoingMonitors()},_workedProgressMonitor:function(b){this._progressMonitors[b.progressId]=b;this._renderOngoingMonitors()},_doneProgressMonitor:function(b){delete this._progressMonitors[b.progressId];this._progressMonitors.length--;b.status?this.setProgressResult(b.status):this._renderOngoingMonitors()}};
b.prototype.constructor=b;h.prototype.begin=function(b){this.status=b;this.statusService._beginProgressMonitor(this)};h.prototype.done=function(b){this.status=b;this.statusService._doneProgressMonitor(this)};h.prototype.worked=function(b){this.status=b;this.statusService._workedProgressMonitor(this)};h.prototype.constructor=h;return{StatusReportingService:b,ProgressMonitor:h}});
define("orion/editorCommands","i18n!orion/edit/nls/messages,orion/i18nUtil,orion/webui/littlelib,orion/Deferred,orion/URITemplate,orion/commands,orion/globalCommands,orion/extensionCommands,orion/contentTypes,orion/editor/keyBinding,orion/editor/undoStack,orion/searchUtils,orion/PageUtil".split(","),function(g,k,j,b,h,f,e,d,c,a,i,l,n){var e={},q=null;e.EditorCommandFactory=function(){function e(a,b,c,d,f,g,h,i){this.serviceRegistry=a;this.commandService=b;this.fileClient=c;this.inputManager=d;this.toolbarId=
f;this.pageNavId=h;this.isReadOnly=g;this._searcher=i}e.prototype={generateEditorCommands:function(e){function i(a){if(q)return q;var b=a.getService("orion.core.contenttypes");b||(b=new c.ContentTypeService(a),b=a.getService("orion.core.contenttypes"));return b.getContentTypes().then(function(a){return q=a})}function o(b){var c=new a.KeyBinding;a.KeyBinding.apply(c,b);return c}function t(a){var b={Severity:"Error"};a.status===0?b.Message=g["No response from server.  Check your internet connection and try again."]:
b=a;(a=serviceRegistry.getService("orion.page.message"))?a.setProgressResult(b):window.console.log(b)}if(!this.isReadOnly){e.getTextView().setKeyBinding(new a.KeyBinding("s",!0),"save");var s=this;this.inputManager.onSave?e.getTextView().setAction("save",function(){var a=e.getText();s.inputManager.onSave(s.inputManager.getInput(),a,function(){e.setInput(s.inputManager.getInput(),null,a,!0);s.inputManager.afterSave&&s.inputManager.afterSave()},function(a){a.log=!0});return!0},{name:g.Save}):e.getTextView().setAction("save",
function(){var a=e.getText(),b={ETag:s.inputManager.getFileMetadata().ETag},b=s.fileClient.write(s.inputManager.getInput(),a,b),c=s.serviceRegistry.getService("orion.page.progress");c&&c.progress(b,k.formatMessage(g["Saving file {0}"],s.inputManager.getInput()));b.then(function(b){s.inputManager.getFileMetadata().ETag=b.ETag;e.setInput(s.inputManager.getInput(),null,a,!0);s.inputManager.afterSave&&s.inputManager.afterSave()},function(b){b.status===412?confirm(g["Resource is out of sync with the server. Do you want to save it anyway?"])&&
(b=s.fileClient.write(s.inputManager.getInput(),a),c&&c.progress(b,k.formatMessage(g["Saving file {0}"],s.inputManager.getInput())),b.then(function(b){s.inputManager.getFileMetadata().ETag=b.ETag;e.setInput(s.inputManager.getInput(),null,a,!0);s.inputManager.afterSave&&s.inputManager.afterSave()},t)):t(b)});return!0},{name:g.Save});this.commandService.addCommand(new f.Command({name:g.Save,tooltip:g["Save this file"],id:"orion.save",callback:function(){e.getTextView().invokeAction("save")}}));this.commandService.registerCommandContribution(this.toolbarId,
"orion.save",1,null,!1,new f.CommandKeyBinding("s",!0));var v=new f.ParametersDescription([new f.CommandParameter("line","number","Line:")],{hasOptionalParameters:!1},function(){var a=e.getModel().getLineAtOffset(e.getCaretOffset())+1;return[new f.CommandParameter("line","number","Line:",a.toString())]}),v=new f.Command({name:g["Go to Line"],tooltip:g["Go to specified line number"],id:"orion.gotoLine",parameters:v,callback:function(a){var b=e.getModel();a.parameters&&a.parameters.valueFor("line")?
a=a.parameters.valueFor("line"):(a=b.getLineAtOffset(e.getCaretOffset()),(a=prompt(g["Go to line:"],a+1))&&(a=parseInt(a,10)));if(a)e.onGotoLine(a-1,0)}});this.commandService.addCommand(v);this.commandService.registerCommandContribution(this.pageNavId,"orion.gotoLine",1,null,!0,new f.CommandKeyBinding("l",!0),new f.URLBinding("gotoLine","line"));e.getTextView().setKeyBinding(new a.KeyBinding("l",!0),"gotoLine");e.getTextView().setAction("gotoLine",function(){s.commandService.runCommand("orion.gotoLine");
return!0},v);var v=new f.ParametersDescription([new f.CommandParameter("find","text","Find:")],{clientCollect:!0},function(){var a=e.getSelection(),b="";a.end>a.start&&(b=e.getModel().getText(a.start,a.end));return[new f.CommandParameter("find","text","Find:",b)]}),u=this,v=new f.Command({name:g.Find,tooltip:g.Find,id:"orion.editor.find",parameters:v,callback:function(a){if(u._searcher){var b="",c=null,d=e.getSelection();d.end>d.start?b=e.getModel().getText(d.start,d.end):a.parameters&&a.parameters.valueFor("find")&&
(b=a.parameters.valueFor("find"),c=n.matchResourceParameters(),l.convertFindURLBinding(c));c?(u._searcher.setOptions({useRegExp:c.regEx,ignoreCase:!c.caseSensitive}),c.atLine?(a=e.getModel().getLineStart(c.atLine-1),e.moveSelection(a,a,function(){u._searcher.buildToolBar(b,c.replaceWith);u._searcher.findNext(!0)},focus)):(u._searcher.buildToolBar(b,c.replaceWith),u._searcher.findNext(!0))):u._searcher.buildToolBar(b);return!0}return!1}});this.commandService.addCommand(v);this.commandService.registerCommandContribution(this.pageNavId,
"orion.editor.find",2,null,!0,new f.CommandKeyBinding("f",!0),new f.URLBinding("find","find"));e.getTextView().setKeyBinding(new a.KeyBinding("f",!0),"find");e.getTextView().setAction("find",function(){s.commandService.runCommand("orion.editor.find");return!0},v);var y=this.serviceRegistry.getServiceReferences("orion.edit.command"),A=this.inputManager,p=this.serviceRegistry.getService("orion.page.progress"),w=function(a,b,c){c.callback=function(){e=this;var c=e.getSelection(),d=e.getModel(),f=d.getText(),
i=function(a){a&&a.text?(e.setText(a.text),a.selection&&(e.setSelection(a.selection.start,a.selection.end),e.getTextView().focus())):typeof a==="string"&&(e.setText(a,c.start,c.end),e.setSelection(c.start,c.start+a.length),e.getTextView().focus())};p.progress(b.run(d.getText(c.start,c.end),f,c,A.getInput()),k.formatMessage(g["Running {0}"],a.name)).then(function(b){if(b&&b.uriTemplate){var c=(new h(b.uriTemplate)).expand(A.getFileMetadata()),d=document.createElement("iframe");d.id=a.id;d.name=a.id;
d.type="text/html";d.sandbox="allow-scripts allow-same-origin";d.frameborder=1;d.src=c;d.className="delegatedUI";if(b.width)d.style.width=b.width;if(b.height)d.style.height=b.height;window.document.body.appendChild(d);window.addEventListener("message",function L(b){b.source===d.contentWindow&&typeof b.data==="string"&&(b=JSON.parse(b.data),b.pageService==="orion.page.delegatedUI"&&b.source===a.id&&(b.cancelled||b.result&&i(b.result),window.removeEventListener("message",L,!1),window.document.body.removeChild(d)))},
!1)}else i(b)});return!0};c.callback=c.callback.bind(e);return new f.Command(c)};b.when(i(this.serviceRegistry),function(){var a=[],c=100;y.forEach(function(b){for(var f=s.serviceRegistry.getService(b),g={},h=b.getPropertyKeys(),i=0;i<h.length;i++)g[h[i]]=b.getProperty(h[i]);g.forceSingleItem=!0;b=d._createCommandOptions(g,b,s.serviceRegistry,q,!1,function(){return A.getFileMetadata()});a.push(b);b.then(function(a){a=w(g,f,a);s.commandService.addCommand(a);s.commandService.registerCommandContribution(s.toolbarId,
a.id,c);if(g.key){var b=e.getTextView();b.setKeyBinding(o(g.key),a.id);b.setAction(a.id,a.callback,a)}});c++});b.all(a,function(a){return{_error:a}}).then(function(){if(A.getFileMetadata()){var a=j.node("pageActions");a&&(s.commandService.destroy(a),s.commandService.renderCommands(a.id,a,e,e,"button"));if(a=j.node("pageNavigationActions"))s.commandService.destroy(a),s.commandService.renderCommands(a.id,a,e,e,"button")}})})}}};return e}();e.UndoCommandFactory=function(){function a(b,c,d){this.serviceRegistry=
b;this.commandService=c;this.toolbarId=d}a.prototype={createUndoStack:function(a){var b=new i.UndoStack(a.getTextView(),200),c=new f.Command({name:g.Undo,id:"orion.undo",callback:function(){this.getTextView().invokeAction("undo")}});a.getTextView().setAction("undo",function(){b.undo();return!0},c);this.commandService.addCommand(c);c=new f.Command({name:g.Redo,id:"orion.redo",callback:function(){this.getTextView().invokeAction("redo")}});a.getTextView().setAction("redo",function(){b.redo();return!0},
c);this.commandService.addCommand(c);this.commandService.registerCommandContribution(this.toolbarId,"orion.undo",400,null,!0,a.getTextView().getKeyBindings("undo")[0]);this.commandService.registerCommandContribution(this.toolbarId,"orion.redo",401,null,!0,a.getTextView().getKeyBindings("redo")[0]);return b}};return a}();return e});
define("orion/compare/compare-container","i18n!orion/compare/nls/messages,require,orion/Deferred,orion/webui/littlelib,orion/compare/diff-parser,orion/compare/compare-rulers,orion/editor/contentAssist,orion/editorCommands,orion/editor/editor,orion/editor/editorFeatures,orion/globalCommands,orion/commands,orion/editor/textModel,orion/editor/textView,orion/compare/compare-features,orion/compare/compareUtils,orion/compare/diff-provider,orion/compare/jsdiffAdapter,orion/highlight,orion/compare/diffTreeNavigator,orion/searchAndReplace/textSearcher,orion/fileClient".split(","),function(g,
k,j,b,h,f,e,d,c,a,i,l,n,q,t,m,r,o,x,s,v,u){var y={};y.DefaultDiffProvider=function(){function a(b){this.serviceRegistry=b;this._diffProvider=new r.DiffProvider(b)}a.prototype={_resolveTwoFiles:function(a,b,c){var d=this;j.all([d._getContentType(a),d._getContentType(b)],function(a){return{_error:a}}).then(function(e){if(Array.isArray(e)&&e.length===2&&e[0]&&e[1]){e[0]._error&&c&&c(e[0]._error);e[1]._error&&c&&c(e[1]._error);var f=e[0],e=e[1];d.callBack({baseFile:{URL:a,Name:d._resolveFileName(a),Type:f},
newFile:{URL:b,Name:d._resolveFileName(b),Type:e},diff:d._diffContent})}else f=a?d._resolveFileName(a):"",e=b?d._resolveFileName(b):"",d.callBack({baseFile:{URL:a,Name:f,Type:null},newFile:{URL:b,Name:e,Type:null},diff:d._diffContent})})},_resolveDiff:function(a,b,c,d){if(b)this._resolveTwoFiles(b,a,d);else if(this._diffProvider){var e=this;e._diffProvider.getDiffContent(a).then(function(b){e._diffContent=e._hasConflicts?b.split("diff --git")[1]:b;c?e.callBack({diff:e._diffContent}):e._resolveComplexFileURL(a)},
d)}else console.log("A diff provider is needed for compound diff URL")},_resolveFileName:function(a){return a.split("?")[0]},_getContentType:function(a){a=this._resolveFileName(a);return this.serviceRegistry.getService("orion.core.contenttypes").getFilenameContentType(a)},_resolveComplexFileURL:function(a,b){var c=this;this._diffProvider.getDiffFileURI(a).then(function(a){c._resolveTwoFiles(a.Old,a.New,b)},b)},provide:function(a,b,c,d,e,f){this.callBack=e;this._hasConflicts=d;this._resolveDiff(a,
b,c,f)}};return a}();y.CompareStyler=function(){function a(b){this._syntaxHighlither=new x.SyntaxHighlighter(b)}a.prototype={highlight:function(a,b,c,d,e){this._syntaxHighlither.setup(b,c.getTextView(),null,a,!1).then(function(){d&&e&&(c.setAnnotationRulerVisible(!1),d._highlighterLoaded++,d._highlighterLoaded===e&&(d._diffNavigator.renderAnnotations(),d._diffNavigator.gotoBlock(d.options.blockNumber-1,d.options.changeNumber-1)))})}};return a}();y.CompareContainer=function(){function a(){this._diffParser=
new h.DiffParser}a.prototype={_clearOptions:function(){this.options={};this.options.baseFile={URL:"",Name:"",Type:""};this.options.newFile={URL:"",Name:"",Type:""};this.options.blockNumber=1;this.options.changeNumber=0},setOptions:function(a,b){b&&this._clearOptions();if(a)this.options.mapper=a.mapper?a.mapper:this.options.mapper,this.options.commandSpanId=typeof a.commandSpanId==="string"?a.commandSpanId:this.options.commandSpanId,this.options.generateLink=a.generateLink!==void 0&&a.generateLink!==
null?a.generateLink:this.options.generateLink,this.options.editableInComparePage=a.editableInComparePage!==void 0&&a.editableInComparePage!==null?a.editableInComparePage:this.options.editableInComparePage,this.options.gridRenderer=a.gridRenderer||this.options.gridRenderer,this.options.readonly=a.readonly!==void 0&&a.readonly!==null?a.readonly:this.options.readonly,this.options.onPage=a.onPage!==void 0&&a.onPage!==null?a.onPage:this.options.onPage,this.options.wordLevelNav=a.wordLevelNav!==void 0&&
a.wordLevelNav!==null?a.wordLevelNav:this.options.wordLevelNav,this.options.charDiff=a.charDiff!==void 0&&a.charDiff!==null?a.charDiff:this.options.charDiff,this.options.hasConflicts=a.hasConflicts!==void 0&&a.hasConflicts!==null?a.hasConflicts:this.options.hasConflicts,this.options.diffProvider=a.diffProvider?a.diffProvider:this.options.diffProvider,this.options.resource=a.resource?a.resource:this.options.resource,this.options.compareTo=a.compareTo?a.compareTo:this.options.compareTo,this.options.baseFile.URL=
a.baseFile&&a.baseFile.URL?a.baseFile.URL:this.options.baseFile.URL,this.options.baseFile.Name=a.baseFile&&typeof a.baseFile.Name==="string"?a.baseFile.Name:this.options.baseFile.Name,this.options.baseFile.Type=a.baseFile&&a.baseFile.Type?a.baseFile.Type:this.options.baseFile.Type,this.options.baseFile.Content=a.baseFile&&typeof a.baseFile.Content==="string"?a.baseFile.Content:this.options.baseFile.Content,this.options.newFile.URL=a.newFile&&a.newFile.URL?a.newFile.URL:this.options.newFile.URL,this.options.newFile.Name=
a.newFile&&typeof a.newFile.Name==="string"?a.newFile.Name:this.options.newFile.Name,this.options.newFile.Type=a.newFile&&a.newFile.Type?a.newFile.Type:this.options.newFile.Type,this.options.newFile.Content=a.newFile&&typeof a.newFile.Content==="string"?a.newFile.Content:this.options.newFile.Content,this.options.diffURL=a.diffURL?a.diffURL:this.options.diffURL,this.options.diffContent=a.diffContent?a.diffContent:this.options.diffContent,this.options.diffArray=a.diffArray?a.diffArray:this.options.diffArray,
this.options.blockNumber=a.blockNumber?a.blockNumber:this.options.blockNumber,this.options.changeNumber=a.changeNumber?a.changeNumber:this.options.changeNumber,this.options.onSave=a.onSave?a.onSave:this.options.onSave,this.options.callback=a.callback?a.callback:this.options.callback,this._errorCallback=a.errorCallback?a.errorCallback:this._errorCallback,this.options.onSetTitle=a.onSetTitle?a.onSetTitle:this.options.onSetTitle,this.options.toggler=a.toggler?a.toggler:this.options.toggler},initCommands:function(){var a=
this.getCommandSpanId();if(a){var b=new l.Command({name:g["Copy current change from right to left"],tooltip:g["Copy current change from right to left"],imageClass:"core-sprite-leftarrow",id:"orion.compare.copyToLeft",groupId:"orion.compareGroup",callback:function(a){a.items.copyToLeft()}}),c=new l.Command({tooltip:g["Switch to unified diff"],name:g.Unified,id:"orion.compare.toggle2Inline",groupId:"orion.compareGroup",visibleWhen:function(a){return a.options.toggler&&a.options.toggler.widgetType===
"twoWay"},callback:function(a){a.items.options.toggler.toggle()}}),d=new l.Command({tooltip:g["Switch to side by side diff"],name:g["Side by side"],id:"orion.compare.toggle2TwoWay",groupId:"orion.compareGroup",visibleWhen:function(a){return a.options.toggler&&a.options.toggler.widgetType==="inline"},callback:function(a){a.items.options.toggler.toggle()}}),e=new l.Command({tooltip:g["Generate link of the current diff"],name:g["Generate Link"],id:"orion.compare.generateLink",groupId:"orion.compareGroup",
visibleWhen:function(a){return a.options.resource&&a.options.generateLink},callback:function(a){a.items.generateLink()}}),f=new l.Command({tooltip:g["Open the compare page"],name:g.Compare,id:"orion.compare.openComparePage",groupId:"orion.compareGroup",visibleWhen:function(a){return a.options.resource&&!a.options.generateLink},hrefCallback:function(a){return a.items.openComparePage()}}),h=new l.Command({name:g["Next diff block"],tooltip:g["Next diff block"],imageClass:"core-sprite-move_down",id:"orion.compare.nextDiff",
groupId:"orion.compareGroup",callback:function(a){a.items.nextDiff()}}),i=new l.Command({name:g["Previous diff block"],tooltip:g["Previous diff block"],imageClass:"core-sprite-move_up",id:"orion.compare.prevDiff",groupId:"orion.compareGroup",callback:function(a){a.items.prevDiff()}}),j=new l.Command({name:g["Next diff change"],tooltip:g["Next diff change"],imageClass:"core-sprite-move_down",id:"orion.compare.nextChange",groupId:"orion.compareGroup",callback:function(a){a.items.nextChange()}}),k=new l.Command({name:g["Previous diff change"],
tooltip:g["Previous diff change"],imageClass:"core-sprite-move_up",id:"orion.compare.prevChange",groupId:"orion.compareGroup",callback:function(a){a.items.prevChange(a)}});this._commandService.addCommand(b);this._commandService.addCommand(d);this._commandService.addCommand(c);this._commandService.addCommand(e);this._commandService.addCommand(f);this._commandService.addCommand(h);this._commandService.addCommand(i);this._commandService.addCommand(j);this._commandService.addCommand(k);this._commandService.registerCommandContribution(a,
"orion.compare.openComparePage",107);this._commandService.registerCommandContribution(a,"orion.compare.generateLink",108,null,!1,new l.CommandKeyBinding("l",!0,!0));this.options.readonly||this._commandService.registerCommandContribution(a,"orion.compare.copyToLeft",109,null,!1,new l.CommandKeyBinding(37,!0,!1,!0));this._commandService.registerCommandContribution(a,"orion.compare.toggle2Inline",110);this._commandService.registerCommandContribution(a,"orion.compare.toggle2TwoWay",111);this._commandService.registerCommandContribution(a,
"orion.compare.nextDiff",112,null,!1,new l.CommandKeyBinding(40,!0));this._commandService.registerCommandContribution(a,"orion.compare.prevDiff",113,null,!1,new l.CommandKeyBinding(38,!0));this.options.wordLevelNav?(this._commandService.registerCommandContribution(a,"orion.compare.nextChange",114,null,!1,new l.CommandKeyBinding(40,!0,!0)),this._commandService.registerCommandContribution(a,"orion.compare.prevChange",115,null,!1,new l.CommandKeyBinding(38,!0,!0))):(this._commandService.registerCommandContribution(a,
"orion.compare.nextChange",114,null,!0,new l.CommandKeyBinding(40,!0,!0)),this._commandService.registerCommandContribution(a,"orion.compare.prevChange",115,null,!0,new l.CommandKeyBinding(38,!0,!0)))}},getCommandSpanId:function(){var a=this.options.commandSpanId;!a&&this.getDefaultCommandSpanId&&(a=this.getDefaultCommandSpanId());return a},renderCommands:function(){var a=this.getCommandSpanId();a&&(b.empty(b.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),this._commandService.renderCommands(a,a,this,this,"tool",null,this.options.gridRenderer.navGridHolder)):(this._commandService.renderCommands(a,a,this,this,"tool",null,this.options.gridRenderer.navGridHolder),this.options.gridRenderer.additionalCmdRender(this.options.gridRenderer.navGridHolder)):
this._commandService.renderCommands(a,a,this,this,"tool",null,this.options.gridRenderer.navGridHolder)):this._commandService.renderCommands(a,a,this,this,"tool",null))},generateLink:function(){var a=this.getCurrentDiffPos(),a=m.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});prompt(g["Copy the link URL:"],a)},openComparePage:function(){var a=this.getCurrentDiffPos();
return m.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})},getCurrentDiffPos:function(){return this._diffNavigator.getCurrentPosition()},nextDiff:function(){this._diffNavigator.nextDiff()},prevDiff:function(){this._diffNavigator.prevDiff()},nextChange:function(){this._diffNavigator.nextChange()},prevChange:function(){this._diffNavigator.prevChange()},
clearContent:function(){if(this.options.baseFile)this.options.baseFile.Content=null;if(this.options.newFile)this.options.newFile.Content=null},_getLineDelim:function(){return"\n"},resolveDiffByProvider:function(a){if(this.options.diffProvider){var b=this;b.options.diffProvider.provide(b.options.resource,b.options.compareTo,a,b.options.hasConflicts,function(c){b.options.baseFile.URL=c.baseFile&&typeof c.baseFile.URL==="string"?c.baseFile.URL:b.options.baseFile.URL;b.options.baseFile.Name=c.baseFile&&
typeof c.baseFile.Name==="string"?c.baseFile.Name:b.options.baseFile.Name;b.options.baseFile.Type=c.baseFile&&typeof c.baseFile.Type==="object"?c.baseFile.Type:b.options.baseFile.Type;b.options.baseFile.Content=c.baseFile&&typeof c.baseFile.Content==="string"?c.baseFile.Content:b.options.baseFile.Content;b.options.newFile.URL=c.newFile&&typeof c.newFile.URL==="string"?c.newFile.URL:b.options.newFile.URL;b.options.newFile.Name=c.newFile&&typeof c.newFile.Name==="string"?c.newFile.Name:b.options.newFile.Name;
b.options.newFile.Type=c.newFile&&typeof c.newFile.Type==="object"?c.newFile.Type:b.options.newFile.Type;b.options.newFile.Content=c.newFile&&typeof c.newFile.Content==="string"?c.newFile.Content:b.options.newFile.Content;b.options.diffContent=typeof c.diff==="string"?c.diff:b.options.diffContent;a||typeof b.options.baseFile.Content==="string"?b.setEditor(a):(b.options.callback&&b.options.callback(b.options.baseFile.Name,b.options.newFile.Name),b.getFilesContents(b.options.diffContent?[b.options.baseFile]:
[b.options.baseFile,b.options.newFile]).then(function(){var a=this.setEditor();this._onLoadContents&&this._onLoadContents(a)}.bind(b)))},b.options.errorCallback)}else console.log("A diff provider is needed for Complex diff URL")},resolveDiffByContents:function(a){if(typeof this.options.baseFile.Content==="string"&&typeof this.options.newFile.Content==="string"){if(!this.options.diffContent&&!this._mapper)this.options.diffContent="";this._onLoadContents&&this._onLoadContents();this.setEditor(a);return!0}else return!1},
getFilesContents:function(a){var b=[];a.forEach(function(a){b.push(this._loadSingleFile(a))}.bind(this));return j.all(b,function(a){return{_error:a}})},_loadSingleFile:function(a){return this._registry.getService("orion.page.progress").progress(this._fileClient.read(a.URL),"Getting contents of "+a.URL).then(function(b){a.Content=b;return a}.bind(this),function(b,c){b.status===404?a.Content="":this.errorCallback&&this.errorCallback(b,c);return a}.bind(this))},parseMapper: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(b){a=(new o.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}}},startup:function(a,b){this._onLoadContents=b;this.options.resource?this.resolveDiffByProvider(a):this.resolveDiffByContents(a)}};return a}();y.TwoWayCompareContainer=function(){function e(a,c,d,h){this._diffNavigator=new s.DiffTreeNavigator("word");this._registry=a;this._commandService=this._registry.getService("orion.page.command");
this._fileClient=new u.FileClient(a);this._searchService=this._registry.getService("orion.core.search");this._progress=this._registry.getService("orion.page.progress");this._uiFactory=d;if(!this._uiFactory)this._uiFactory=new t.TwoWayCompareUIFactory({parentDivID:c,showTitle:!1,showLineStatus:!1}),this._uiFactory.buildUI();this._viewLoadedCounter=0;this.setOptions(h,!0);var j=this,k=this._uiFactory.getTitleDiv(!0);k&&b.empty(k);var l=this._uiFactory.getTitleDiv(!1);l&&b.empty(l);if(!this.options.callback)this.options.callback=
function(a,b){k&&l&&(k.appendChild(document.createTextNode(b)),l.appendChild(document.createTextNode(a)))};if(!this._errorCallback)this._errorCallback=function(a,b){if(k&&l){var c=typeof a.message==="string"?a.message:b.xhr.statusText;k.appendChild(document.createTextNode(c));l.appendChild(document.createTextNode(c));k.style.color="red";l.style.color="red"}};this._leftEditorDiv=this._uiFactory.getEditorParentDiv(!0);this._rightEditorDiv=this._uiFactory.getEditorParentDiv(!1);this.initCommands();this._inputManager=
{filePath:"",getInput:function(){return this.filePath},setDirty:function(a){i.setDirtyIndicator(a)},getFileMetadata:function(){return this._fileMetadata},setInput:function(a){if(this.onSetTitle)this.onSetTitle(a,function(a){this.setTitle(a)}.bind(this),function(b){console.error("Error loading file metadata: "+b.message);this.setTitle(a)}.bind(this));else j._progress.progress(j._fileClient.read(a,!0),"Getting file metadata "+a).then(function(a){this._fileMetadata=a;this.setTitle(a.Location,a)}.bind(this),
function(b){console.error("Error loading file metadata: "+b.message);this.setTitle(a)}.bind(this));this.lastFilePath=a},setTitle:function(b,c){var d;if(c)d=c.Name;i.setPageTarget({task:g.Compare,name:d,target:c,serviceRegistry:a,commandService:this._commandService,searchService:this._searchService,fileService:this._fileClient});b.charAt(0)==="*"?(i.setDirtyIndicator(!0),b.substring(1)):i.setDirtyIndicator(!1)},afterSave:function(){j.startup(!0)}};if(this.options.onSave)this._inputManager.onSave=this.options.onSave;
if(this.options.onSetTitle)this._inputManager.onSetTitle=this.options.onSetTitle;this._curveRuler=new f.CompareCurveRuler(this._uiFactory.getDiffCanvasDiv());this._highlighter=[];this._highlighter.push(new y.CompareStyler(this._registry));this._highlighter.push(new y.CompareStyler(this._registry));this.initEditorContainers("\n",g["fetching..."],g["fetching..."],[])}e.prototype=new y.CompareContainer;e.prototype.initEditorContainers=function(a,c,d,e,h){this._leftEditor=this.createEditorContainer(c,
a,e,0,this._leftEditorDiv,this._uiFactory.getStatusDiv(!0),this.options.readonly,h,this.options.newFile);if(this.options.onPage&&(c=b.node("pageActions")))this._commandService.destroy(c),this._commandService.renderCommands(c.id,c,this._leftEditor,this._leftEditor,"button");this._leftTextView=this._leftEditor.getTextView();this._rightEditor=this.createEditorContainer(d,a,e,1,this._rightEditorDiv,this._uiFactory.getStatusDiv(!1),!0,h,this.options.baseFile);this._rightTextView=this._rightEditor.getTextView();
var i=this;this._overviewRuler=new f.CompareOverviewRuler("right",{styleClass:"ruler overview"},null,function(a){i._diffNavigator.matchPositionFromOverview(a)});window.onbeforeunload=function(){if(i._leftEditor.isDirty())return g["There are unsaved changes."]}};e.prototype.getDefaultCommandSpanId=function(){return this._uiFactory.getCommandSpanId()};e.prototype.gotoDiff=function(a,b,c){c=c?this._leftTextView:this._rightTextView;this._diffNavigator.gotoDiff(c.getModel().getLineStart(a)+b,c)};e.prototype.gotoMatch=
function(a,b,c,d,e,f){if(!this.onScroll)this.onScroll=e;if(!this.onLoad)this.onLoad=f;a=this._leftTextView.getModel().getLineStart(a)+c.startIndex;this._leftEditor.moveSelection(a,a)};e.prototype.copyToLeft=function(){this._curveRuler.copyToLeft()};e.prototype.resizeEditors=function(){this._leftTextView&&this._leftTextView.resize();this._rightTextView&&this._rightTextView.resize()};e.prototype.getSplitter=function(){return this._uiFactory.getSplitter()};e.prototype.createEditorContainer=function(b,
e,f,h,i,j,k,l,m){var o=this,t=new n.TextModel(b,e),s="",b=k?new a.UndoFactory:new d.UndoCommandFactory(o._registry,o._commandService,"pageActions"),e=new a.AnnotationFactory,r=new c.Editor({textViewFactory:function(){var a=new q.TextView({parent:i,model:t,readonly:k,tabSize:4});o._viewLoadedCounter++;o._viewLoadedCounter===2&&o._diffNavigator.matchPositionFromOverview(-1);if(o.onLoad)o.onLoad();var b=o.getSplitter();if(b){var c=h===0;b.addResizeListener(function(b){if(b){var d=!1;(d=o._uiFactory.isLeftPane(b)?
c:!c)&&a.resize()}})}return a},undoStackFactory:b,annotationFactory:e,keyBindingFactory:function(b,c,e,f){if(k)o._commandService.addCommandGroup("pageActions","orion.editorActions.unlabeled",200);else{var g=new v.TextSearcher(b,o._commandService,e);(new d.EditorCommandFactory(o._registry,o._commandService,o._fileClient,o._inputManager,"pageActions",k,"pageNavigationActions",g)).generateEditorCommands(b);g=new a.TextActions(b,e);c.push(g);b=new a.SourceCodeActions(b,e,f);c.push(b)}},statusReporter:function(a,
b){if(j)s=b?g["ERROR: "]+a:a,j.textContent=""+s},domNode:i});r.installTextView();r.setOverviewRulerVisible(!1);if(!k){var x=this._inputManager;r.addEventListener("DirtyChanged",function(){x.setDirty(r.isDirty())})}var u=r.getTextView();l&&m&&typeof m.Name==="string"&&typeof m.Type==="string"&&(r.setInput(m.Name),this._highlighter[h].highlight(m.Name,m.Type,r));u.addEventListener("Selection",function(a){!(a.newValue&&a.newValue.start!==a.newValue.end)&&!o._diffNavigator.autoSelecting&&o._diffNavigator.editorWrapper[0].diffFeeder&&
(a=u.getCaretOffset(),o._diffNavigator.gotoDiff(a,u))});h===0?(u.getModel().addEventListener("Changed",function(a){o._curveRuler.onChanged(a)}),u.addEventListener("Scroll",function(){o._curveRuler&&(o._curveRuler.matchPositionFrom(!0),o._curveRuler.render());if(o.onScroll)o.onScroll()})):u.addEventListener("Scroll",function(){o._curveRuler&&o._curveRuler.render()});return r};e.prototype.destroy=function(){this._leftTextView&&(this._diffNavigator.destroy(),this._leftEditor.destroy(),this._rightEditor.destroy(),
this._uiFactory.destroy())};e.prototype.addRulers=function(){if(this._rightTextView&&this._leftTextView&&!this._hasRuler)this._leftTextViewRuler=new f.LineNumberCompareRuler(this._diffNavigator,0,"left",{styleClass:"ruler lines"},{styleClass:"rulerLines odd"},{styleClass:"rulerLines even"}),this._rightTextViewRuler=new f.LineNumberCompareRuler(this._diffNavigator,0,"left",{styleClass:"ruler lines"},{styleClass:"rulerLines odd"},{styleClass:"rulerLines even"}),this._leftTextView.addRuler(this._leftTextViewRuler),
this._rightTextView.addRuler(this._rightTextViewRuler),this._rightTextView.addRuler(this._overviewRuler),this._hasRuler=!0};e.prototype.setEditor=function(a){var b=this.options.baseFile.Content,c=this.options.newFile.Content,d=this.options.diffContent;c?d=this.parseMapper(b,c,d,this.options.hasConflicts,!0):(d=this.parseMapper(b,c,d,this.options.hasConflicts,a),c=d.output);this._highlighterLoaded=0;if(this._leftEditor)if(a)this._diffNavigator.initMapper(d.mapper),this._curveRuler.init(d.mapper,this._leftEditor,
this._rightEditor,this._diffNavigator),this.renderCommands(),this._leftTextView.redrawRange(),this._rightTextView.redrawRange();else{var a=new s.TwoWayDiffBlockFeeder(this._rightTextView.getModel(),d.mapper,1),e=new s.TwoWayDiffBlockFeeder(this._leftTextView.getModel(),d.mapper,0);this._diffNavigator.initAll(this.options.charDiff?"char":"word",this._rightEditor,this._leftEditor,a,e,this._overviewRuler,this._curveRuler);this._curveRuler.init(d.mapper,this._leftEditor,this._rightEditor,this._diffNavigator);
this._inputManager.filePath=this.options.newFile.URL;this._rightEditor.setInput(this.options.baseFile.Name,null,b);this._leftEditor.setInput(this.options.newFile.Name,null,c);this._highlighter[0].highlight(this.options.newFile.Name,this.options.newFile.Type,this._leftEditor,this,2);this._highlighter[1].highlight(this.options.baseFile.Name,this.options.baseFile.Type,this._rightEditor,this,2);this.renderCommands();this.addRulers();this.options.readonly||this._inputManager.setInput(this.options.newFile.URL,
this._leftEditor)}else this.initEditorContainers(d.delim,c,b,d.mapper,!0);this._viewLoadedCounter>1&&this._diffNavigator.gotoBlock(this.options.blockNumber-1,this.options.changeNumber-1);b=this._leftTextView.getModel().getLineCount()*this._leftTextView.getLineHeight()+5;c=this._rightTextView.getModel().getLineCount()*this._rightTextView.getLineHeight()+5;return b>c?b:c};return e}();y.InlineCompareContainer=function(){function d(a,c,e){this._diffNavigator=new s.DiffTreeNavigator("word");this._registry=
a;this._commandService=this._registry.getService("orion.page.command");this._fileClient=new u.FileClient(a);this._statusService=this._registry.getService("orion.page.message");this._progress=this._registry.getService("orion.page.progress");this.setOptions(e,!0);this.setOptions({readonly:!0});var f=this;if(!this.options.callback)this.options.callback=function(){var a=b.node("fileNameInViewer");if(a)b.empty(a),a.appendChild(document.createTextNode(f._diffTitle)),a.style.color="#6d6d6d";f._statusService.setProgressMessage("")};
if(!this._errorCallback)this._errorCallback=function(a,b){var c=[];c.Severity="Error";c.HTML=!1;try{var d=JSON.parse(a.responseText);c.Message=d.DetailedMessage?d.DetailedMessage:d.Message}catch(e){c.Message=typeof a.message==="string"?a.message:b.xhr.statusText}this._statusService.setProgressResult(c)};this.initCommands();this._highlighter=[];this._highlighter.push(new y.CompareStyler(this._registry));this._editorDivId=c;this.initEditorContainers("","\n",[],[]);this.hasContent=!1}d.prototype=new y.CompareContainer;
d.prototype.addRulers=function(){if(this._textView&&!this._hasRuler)this._textView.addRuler(this._rulerOrigin),this._textView.addRuler(this._rulerNew),this._textView.addRuler(this._overviewRuler),this._hasRuler=!0};d.prototype.removeRulers=function(){if(this._textView&&this._hasRuler)this._textView.removeRuler(this._rulerOrigin),this._textView.removeRuler(this._rulerNew),this._textView.removeRuler(this._overviewRuler),this._hasRuler=!1};d.prototype.destroyEditor=function(){this._textView&&(this._diffNavigator.destroy(),
this._textView.setText(""),this.removeRulers());this.hasContent=!1};d.prototype.destroy=function(){this._textView&&(this._diffNavigator.destroy(),this._textView.destroy())};d.prototype.createEditorContainer=function(d,e,g,h,i,j){var k=b.node(this._editorDivId),l=this,m=new n.TextModel(d,e),d=new a.UndoFactory,e=new a.AnnotationFactory,d=new c.Editor({textViewFactory:function(){return new q.TextView({parent:k,model:m,readonly:!0,tabSize:4})},undoStackFactory:d,annotationFactory:e,keyBindingFactory:function(){},
statusReporter:function(){},domNode:k});d.installTextView();d.setOverviewRulerVisible(!1);d.setAnnotationRulerVisible(!1);i&&j&&d.setInput(j.Name);var o=d.getTextView();this._rulerOrigin=new f.LineNumberCompareRuler(this._diffNavigator,1,"left",{styleClass:"ruler lines"},{styleClass:"rulerLines odd"},{styleClass:"rulerLines even"});this._rulerNew=new f.LineNumberCompareRuler(this._diffNavigator,0,"left",{styleClass:"ruler lines"},{styleClass:"rulerLines odd"},{styleClass:"rulerLines even"});this._overviewRuler=
new f.CompareOverviewRuler("right",{styleClass:"ruler overview"},null,function(a){l._diffNavigator.matchPositionFromOverview(a)});o.addEventListener("Selection",function(a){!(a.newValue&&a.newValue.start!==a.newValue.end)&&!l._diffNavigator.autoSelecting&&l._diffNavigator.editorWrapper[0].diffFeeder&&(a=o.getCaretOffset(),l._diffNavigator.gotoDiff(a,o))});return d};d.prototype.initEditorContainers=function(a,b,c,d){this._editor=this.createEditorContainer(b,a,c,d,this.options.newFile);this._textView=
this._editor.getTextView()};d.prototype._initDiffPosition=function(a){var b=a.getModel();if(b&&b.getAnnotations&&(b=b.getAnnotations(),b.length>0)){var b=b[0][0],c=a.getLineHeight(),d=a.getClientArea(),c=Math.floor(d.height/c/3);a.setTopIndex(b-c>0?b-c:0)}};d.prototype.setDiffTitle=function(a){this._diffTitle=a};d.prototype.setEditor=function(){var a=this.options.baseFile.Content,b=this.options.newFile.Content,c=this.options.diffContent;this.hasContent=!0;b=this.parseMapper(a,b,c,this.options.hasConflicts,
!this.options.toggler);this._highlighterLoaded=0;this._textView?(this._textView.getModel().setText(a),a=new s.inlineDiffBlockFeeder(b.mapper,1),c=new s.inlineDiffBlockFeeder(b.mapper,0),m.mergeDiffBlocks(this._textView.getModel(),c.getDiffBlocks(),b.mapper,b.diffArray.array,b.diffArray.index,this._diffParser._lineDelimiter),a.setModel(this._textView.getModel()),c.setModel(this._textView.getModel()),this._diffNavigator.initAll(this.options.charDiff?"char":"word",this._editor,this._editor,a,c,this._overviewRuler),
this._highlighter[0].highlight(this.options.baseFile.Name,this.options.baseFile.Type,this._editor,this,1),this.renderCommands(),this.addRulers(),a=this._textView.getTopIndex(),this._textView.redrawLines(a,a+1,this._overviewRuler),this._textView.redrawLines(a,a+1,this._rulerOrigin),this._textView.redrawLines(a,a+1,this._rulerNew),this._diffNavigator.gotoBlock(this.options.blockNumber-1,this.options.changeNumber-1)):this.initEditorContainers(b.delim,a,b.mapper,b.diffArray,!0);return this._textView.getLineHeight()*
this._textView.getModel().getLineCount()+5};d.prototype.setConflicting=function(a){this._conflcit=a};return d}();y.toggleableCompareContainer=function(){function a(b,c,d,e){if(e)e.toggler=this;d==="inline"?(this.widgetType="inline",this._widget=new y.InlineCompareContainer(b,c,e)):(this.widgetType="twoWay",this._widget=new y.TwoWayCompareContainer(b,c,null,e));this._parentDivId=c;this._serviceRegistry=b}a.prototype={startup:function(a){this._widget.startup(!1,a)},toggle:function(){var a=this._widget.options,
c=this._widget.getCurrentDiffPos();a.blockNumber=c.block;a.changeNumber=c.change;this._widget.destroy();b.empty(b.node(this._parentDivId));this.widgetType==="inline"?(this.widgetType="twoWay",this._widget=new y.TwoWayCompareContainer(this._serviceRegistry,this._parentDivId,null,a)):(this.widgetType="inline",this._widget=new y.InlineCompareContainer(this._serviceRegistry,this._parentDivId,a));this._widget.setEditor()}};return a}();return y});
define("orion/git/gitCommitExplorer","i18n!git/nls/gitmessages,orion/section,orion/explorers/explorer,orion/PageUtil,orion/i18nUtil,orion/webui/littlelib,orion/globalCommands,orion/compare/diff-provider,orion/compare/compare-container,orion/git/gitCommands,orion/Deferred".split(","),function(g,k,j,b,h,f,e,d,c,a){d={};d.GitCommitExplorer=function(){function d(a,b,c,e,f,g,h,i){this.parentId=f;this.registry=a;this.commandService=b;this.linkService=c;this.selection=e;this.parentId=f;this.toolbarId=g;
this.selectionToolsId=h;this.checkbox=!1;this.actionScopeId=i;j.createExplorerCommands(b)}d.prototype.handleError=function(a){var b={Severity:"Error",HTML:!1};try{var c=JSON.parse(a.responseText);b.Message=c.DetailedMessage?c.DetailedMessage:c.Message}catch(d){b.Message=a.message}this.registry.getService("orion.page.message").setProgressResult(b);a.status===404&&(this.initTitleBar(),this.displayCommit())};d.prototype.changedItem=function(){this.redisplay()};d.prototype.redisplay=function(){this.display(b.matchResourceParameters().resource)};
d.prototype.display=function(b){var c=this,d=this.registry.getService("orion.page.progress");d.showWhile(this.registry.getService("orion.git.provider").getGitClone(b),"Getting repository details").then(function(b){if(b.Children.length===0)c.initTitleBar(),c.displayCommit();else if(b.Children.length===1&&b.Children[0].Type==="Commit"){var e=b.Children;d.progress(c.registry.getService("orion.git.provider").getGitClone(b.CloneLocation),"Getting repository details "+b.Name).then(function(b){b=b.Children;
c.initTitleBar(e[0],b[0]);c.displayCommit(e[0]);c.displayTags(e[0]);c.displayDiffs(e[0]);e[0].CloneLocation=b[0].Location;a.updateNavTools(c.registry,c,"pageActions","selectionTools",e[0])},function(a){c.handleError(a)})}d.setProgressMessage("")},function(a){c.handleError(a)})};d.prototype.initTitleBar=function(a,b){var c={};a.GitUrl=b.GitUrl;a.ContentLocation=b.ContentLocation;if(a)c={},c.Name=a.Name,c.Parents=[],c.Parents[0]={},c.Parents[0].Name=b.Name,c.Parents[0].Location=b.Location,c.Parents[0].ChildrenLocation=
b.Location,c.Parents[1]={},c.Parents[1].Name=g.Repositories;e.setPageTarget({task:"Commit",target:a,breadcrumbTarget:c,makeBreadcrumbLink:function(a,b){a.href="/git/git-repository.html#"+(b?b:"")},serviceRegistry:this.registry,commandService:this.commandService})};d.prototype.displayCommit=function(a){var b=f.node("table");f.empty(b);if(a){var c=document.createElement("div");c.className="sectionTable";b.appendChild(c);b=document.createElement("div");b.className="mainPadding";b.id="commitNode";c.appendChild(b);
c=document.createElement("div");c.className="sectionTableItem";b.appendChild(c);var b=this._splitCommitMessage(a.Message),d=document.createElement("div");d.style.paddingBottom="15px";this.registry.getService("orion.core.textlink").addLinks(b[0],d);c.appendChild(d);if(b[1]!==null)d=document.createElement("pre"),d.style.paddingBottom="15px",d.style.marginTop="0px",this.registry.getService("orion.core.textlink").addLinks(b[1],d),c.appendChild(d);b=document.createElement("div");b.appendChild(document.createTextNode(h.formatMessage(g["commit: 0"],
a.Name)));c.appendChild(b);if(a.Parents&&a.Parents.length>0)b=document.createElement("div"),b.style.paddingBottom="15px",d=document.createElement("a"),d.className="pnavlinkonpage",d.href="/git/git-commit.html#"+a.Parents[0].Location+"?page=1&pageSize=1",d.textContent=h.formatMessage(g["parent: 0"],a.Parents[0].Name),b.appendChild(d),c.appendChild(b);if(a.AuthorImage)b=document.createElement("div"),b.style["float"]="left",d=new Image,d.src=a.AuthorImage,d.name=a.AuthorName,d.className="git-author-icon-small",
b.appendChild(d),c.appendChild(b);b=document.createElement("div");d=document.createElement("div");d.appendChild(document.createTextNode(h.formatMessage(g["authored by 0 (1) on 2"],a.AuthorName,a.AuthorEmail,(new Date(a.Time)).toLocaleString())));b.appendChild(d);d=document.createElement("div");d.appendChild(document.createTextNode(h.formatMessage(g["committed by 0 (1)"],a.CommitterName,a.CommitterEmail)));b.appendChild(d);c.appendChild(b)}else new k.Section(b,{id:"commitSection",title:g["No Commits"],
iconClass:"core-sprite-file"})};d.prototype._splitCommitMessage=function(a){var b=!1,c=a.split(/(\r?\n|$)/)[0].trim();c.length>100&&(b=c.indexOf(" ",90),c=c.substring(0,b!==-1?b:100),b=!0);a=a.substring(c.length+1,a.length).trim();a=a.length>0?b?"..."+a:a:null;c+=b?"...":"";return[c,a]};d.prototype.displayTags=function(a){var b=a.Tags,c=f.node("table"),c=new k.Section(c,{id:"tagSection",title:b&&b.length>0?g["Tags:"]:g["No Tags"],iconClass:["gitImageSprite","git-sprite-tag"],slideout:!0,content:'<div id="tagNode"></div>',
canHide:!0,preferenceService:this.registry.getService("orion.core.preference")});this.commandService.registerCommandContribution(c.actionsNode.id,"eclipse.orion.git.addTag",100);this.commandService.renderCommands(c.actionsNode.id,c.actionsNode,a,this,"button");if(b||!(b.length>0))for(a=0;a<b.length&&a<10;a++)this.renderTag(b[a])};d.prototype.renderTag=function(a){var b=f.node("tagNode"),c=document.createElement("div");c.className="sectionTableItem";b.appendChild(c);b=document.createElement("div");
b.className="sectionTableItem";c.appendChild(b);c=document.createElement("div");c.className="stretch";b.appendChild(c);var d=document.createElement("span");d.textContent=a.Name;c.appendChild(d);c=document.createElement("div");c.className="sectionTableItemActions";b.appendChild(c);this.commandService.renderCommands(this.actionScopeId,c,a,this,"tool",!1)};d.prototype.displayDiffs=function(a){var b=this,d=a.Diffs,a=f.node("table"),a=new k.Section(a,{id:"diffSection",title:g.Diffs,content:'<div id="diffNode"></div>',
canHide:!0,preferenceService:this.registry.getService("orion.core.preference")});this.commandService.registerCommandContribution(a.actionsNode.id,"orion.explorer.expandAll",100);this.commandService.registerCommandContribution(a.actionsNode.id,"orion.explorer.collapseAll",200);var e="diffSectionItemActionArea";DiffModel=function(){function a(){}a.prototype={destroy:function(){},getRoot:function(a){a(d)},getChildren:function(a,b){if(a instanceof Array&&a.length>0)b(a);else if(a.Type==="Diff"){if(!a.children)a.children=
[],a.children.push({parent:a,DiffLocation:a.DiffLocation});b(a.children)}else b([])},getId:function(a){return a instanceof Array&&a.length>0?"diffRoot":a.Type==="Diff"?"diff"+a.DiffLocation:"diffWidget"+a.DiffLocation}};return a}();DiffRenderer=function(){function a(b,c){this._init(b);this.options=b;this.explorer=c;this.registry=b.registry}a.prototype=new j.SelectionRenderer;a.prototype.getCellElement=function(a,d,e){switch(a){case 0:if(d.Type==="Diff"){var a=document.createElement("td"),g=document.createElement("div");
g.className="sectionTableItem";a.appendChild(g);var h=d.OldPath,i="git-sprite-file";d.ChangeType==="ADD"?(h=d.NewPath,i="git-sprite-addition"):d.ChangeType==="DELETE"&&(i="git-sprite-removal");this.getExpandImage(e,g,"gitImageSprite",i);e=document.createElement("span");e.className="gitMainDescription";e.textContent=h;g.appendChild(e)}else{a=document.createElement("td");a.colSpan=2;g=document.createElement("div");g.className="sectionTableItem";a.appendChild(g);e=document.createElement("div");e.className=
"sectionExplorerActions";g.appendChild(e);var j=document.createElement("span");j.id="diff"+d.parent.DiffLocation+"DiffActionWrapper";e.appendChild(j);var k=document.createElement("span");k.id="diff"+d.parent.DiffLocation+"CompareWidgetActionWrapper";e.appendChild(k);e=document.createElement("div");e.id="diffArea_"+d.parent.DiffLocation;e.style.height="420px";e.style.border="1px solid lightgray";e.style.overflow="hidden";g.appendChild(e);var l=this.explorer.getNavDict()?this.explorer.getNavDict().getGridNavHolder(d,
!0):null;window.setTimeout(function(){var a=new c.DefaultDiffProvider(b.registry);(new c.toggleableCompareContainer(b.registry,"diffArea_"+d.parent.DiffLocation,"inline",{gridRenderer:{navGridHolder:l,additionalCmdRender:function(a){b.commandService.destroy(j.id);b.commandService.renderCommands("itemLevelCommands",j.id,d.parent,b,"tool",!1,a)},before:!0},commandSpanId:k.id,diffProvider:a,hasConflicts:!1,readonly:!0,resource:d.parent.DiffLocation,callback:function(){}})).startup(function(a){var b=
420;a<b&&(b=a);f.node("diffArea_"+d.parent.DiffLocation).style.height=b+"px"})},500)}return a}};return a}();DiffNavigator=function(){function a(b,c,d,f){this.registry=b;this.checkbox=!1;this.parentId=d;this.selection=c;this.actionScopeId=f;this.renderer=new DiffRenderer({registry:this.registry,actionScopeId:e,cachePrefix:"DiffNavigator",checkbox:!1},this);this.createTree(this.parentId,new DiffModel,{})}a.prototype=new j.Explorer;a.prototype.isRowSelectable=function(){return!1};a.prototype.getItemCount=
function(){return d.length};return a}();var h=new DiffNavigator(this.registry,null,"diffNode",e);this.commandService.renderCommands(a.actionsNode.id,a.actionsNode.id,h,h,"button")};return d}();return d});var eclipse;
define("git/git-commit","i18n!git/nls/gitmessages,require,orion/bootstrap,orion/status,orion/progress,orion/commands,orion/dialogs,orion/selection,orion/fileClient,orion/operationsClient,orion/searchClient,orion/globalCommands,orion/git/gitCommitExplorer,orion/git/gitCommands,orion/git/gitClient,orion/links,orion/contentTypes,orion/PageUtil".split(","),function(g,k,j,b,h,f,e,d,c,a,i,l,n,q,t,m,r,o){j.startup().then(function(j){var s=j.serviceRegistry,v=j.preferences;new e.DialogService(s);new d.Selection(s);
var j=new f.CommandService({serviceRegistry:s}),u=new a.OperationsClient(s);new b.StatusReportingService(s,u,"statusPane","notifications","notificationArea");new h.ProgressService(s,u);u=new m.TextLinkService({serviceRegistry:s});new t.GitService(s);var y=new c.FileClient(s);new r.ContentTypeService(s);var A=new i.Searcher({serviceRegistry:s,commandService:j,fileService:y}),p=new n.GitCommitExplorer(s,j,u,null,"artifacts","pageActions",null,"itemLevelCommands");l.generateBanner("orion-git-commit",
s,j,v,A,p);q.createFileCommands(s,j,p,"pageActions","selectionTools");q.createGitClonesCommands(s,j,p,"pageActions","selectionTools",y);j.addCommandGroup("pageActions","eclipse.gitGroup",100);j.registerCommandContribution("pageActions","eclipse.orion.git.cherryPick",100,"eclipse.gitGroup");j.registerCommandContribution("pageActions","eclipse.orion.git.askForReviewCommand",101,"eclipse.gitGroup");j.registerCommandContribution("pageActions","eclipse.orion.git.openCommitCommand",102,"eclipse.gitGroup",
!0,new f.CommandKeyBinding("h",!0,!0));j.registerCommandContribution("itemLevelCommands","eclipse.removeTag",1E3);s=new f.Command({name:g["Working Directory Version"],tooltip:g["View the working directory version of the file"],imageClass:"git-sprite-open_compare",spriteClass:"gitCommandSprite",id:"eclipse.orion.git.diff.showCurrent",hrefCallback:function(a){return k.toUrl("edit/edit.html")+"#"+a.items.ContentLocation},visibleWhen:function(a){return a.Type==="Diff"}});j.addCommand(s);j.registerCommandContribution("itemLevelCommands",
"eclipse.orion.git.diff.showCurrent",2E3);s=o.matchResourceParameters();p.display(s.resource);window.addEventListener("hashchange",function(){var a=o.matchResourceParameters();p.display(a.resource)},!1)})});