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

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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


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


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


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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

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

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

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

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

 Contributors: IBM Corporation - initial API and implementation

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

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

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

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

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


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


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

 Contributors: IBM Corporation - initial API and implementation

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

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

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

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

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

 Contributors: IBM Corporation - initial API and implementation 

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

 Contributors:
 IBM Corporation - initial API and implementation

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

 Contributors:
 IBM Corporation - initial API and implementation

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

 Contributors:
 IBM Corporation - initial API and implementation
 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) 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) 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
*/
(function(k,j){typeof define==="function"&&define.amd?define("orion/Deferred",[],j):typeof exports==="object"?module.exports=j():(k.orion=k.orion||{},k.orion.Deferred=j())})(this,function(){function k(){for(var b;b=d.shift()||f.shift();)b();c=!1}function j(b,e){(e?f:d).push(b);c||(c=!0,e?setTimeout(k,0):k())}function i(b){return function(){b.apply(null,arguments)}}function a(){}function g(){var b=Error("Cancel");b.name="Cancel";return b}function h(){function b(){for(var b;b=d.shift();){var l=b.deferred,
p=c==="resolved"?"resolve":"reject";if(typeof b[p]==="function")try{var o=b[p](e);o&&typeof o.then==="function"?(l.cancel=o.cancel||a,o.then(i(l.resolve),i(l.reject),l.progress)):l.resolve(o)}catch(u){l.reject(u)}else l[p](e)}}var e,c,d=[],f=this;this.reject=function(a){c||(c="rejected",e=a,d.length&&j(b));return f.promise};this.resolve=function(a){c||(c="resolved",e=a,d.length&&j(b));return f.promise};this.progress=function(b){c||d.forEach(function(l){l.progress&&l.progress(b)});return f.promise};
this.cancel=function(){c||f.reject(g())};this.then=function(e,l,p){var e={resolve:e,reject:l,progress:p,deferred:new h},o=e.deferred,u=this.cancel.bind(this),a=function(){j(function(){(o.cancel===a?u:o.cancel)()},!0)};o.cancel=a;l=o.promise;l.cancel=function(){o.cancel()};d.push(e);c&&j(b,!0);return l};this.promise={then:this.then,cancel:this.cancel}}var d=[],f=[],c=!1;h.all=function(b,e){function c(b,e){l||(f[b]=e,--d===0&&p.resolve(f))}function a(b,u){if(!l){if(e)try{c(b,e(u));return}catch(d){u=
d}p.reject(u)}}var d=b.length,f=[],l=!1,p=new h;p.then(null,function(){l=!0;b.forEach(function(l){l.cancel&&l.cancel()})});d===0?p.resolve(f):b.forEach(function(l,b){l.then(c.bind(null,b),a.bind(null,b))});return p.promise};h.when=function(b,e,c,a){var d;if(!(b&&typeof b.then==="function"))d=new h,d.resolve(b),b=d.promise;return b.then(e,c,a)};return h});
define("orion/EventTarget",[],function(){function k(){this._namedListeners={}}k.prototype={dispatchEvent:function(j){if(!j.type)throw Error("unspecified type");var i=this._namedListeners[j.type];i&&i.forEach(function(a){try{typeof a==="function"?a(j):a.handleEvent(j)}catch(g){typeof console!=="undefined"&&console.log(g)}});return!j.defaultPrevented},addEventListener:function(j,i){if(typeof i==="function"||i.handleEvent)this._namedListeners[j]=this._namedListeners[j]||[],this._namedListeners[j].push(i)},
removeEventListener:function(j,i){var a=this._namedListeners[j];if(a)for(var g=0;g<a.length;g++)if(a[g]===i){a.length===1?delete this._namedListeners[j]:a.splice(g,1);break}}};k.prototype.constructor=k;k.attach=function(j){var i=new k;j.dispatchEvent=i.dispatchEvent.bind(i);j.addEventListener=i.addEventListener.bind(i);j.removeEventListener=i.removeEventListener.bind(i)};return k});
define("orion/serviceregistry",["orion/Deferred","orion/EventTarget"],function(k,j){function i(a,c,b){this._properties=b||{};this._properties["service.id"]=a;this._properties.objectClass=c;this._properties["service.names"]=c}function a(a,c,b){this._serviceId=a;this._serviceReference=c;this._internalRegistry=b}function g(a,c){function b(b){return function(){var e;try{if(!c())throw Error("Service was unregistered");var d=a[b].apply(a,Array.prototype.slice.call(arguments));if(d&&typeof d.then==="function")return d;
else e=new k,e.resolve(d)}catch(g){e=new k,e.reject(g)}return e.promise}}for(var e in a)typeof a[e]==="function"&&(this[e]=b(e))}function h(a,c){this.type=a;this.serviceReference=c}function d(){this._entries=[];this._namedReferences={};this._serviceEventTarget=new j;var a=this;this._internalRegistry={isRegistered:function(c){return a._entries[c]?!0:!1},unregisterService:function(c){var b=a._entries[c];if(!b)throw Error("already unregistered");var e=b.reference;a._serviceEventTarget.dispatchEvent(new h("unregistering",
e));a._entries[c]=null;e.getProperty("objectClass").forEach(function(b){for(var c=a._namedReferences[b],d=0;d<c.length;d++)if(c[d]===e){c.length===1?delete a._namedReferences[b]:c.splice(d,1);break}})},modifyService:function(c){c=a._entries[c];if(!c)throw Error("already unregistered");a._serviceEventTarget.dispatchEvent(new h("modified",c.reference))}}}i.prototype={getPropertyKeys:function(){var a=[],c;for(c in this._properties)this._properties.hasOwnProperty(c)&&a.push(c);return a},getProperty:function(a){return this._properties[a]}};
i.prototype.constructor=i;a.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(a){var c=this._serviceReference._properties;this._serviceReference._properties=a||{};a["service.id"]=this._serviceId;a.objectClass=c.objectClass;a["service.names"]=c["service.names"];this._internalRegistry.modifyService(this._serviceId)}};
a.prototype.constructor=a;d.prototype={getService:function(a){var c;if(typeof a==="string")(a=this._namedReferences[a])&&a.some(function(b){c=this._entries[b.getProperty("service.id")].service;return!!c},this);else if(a=this._entries[a.getProperty("service.id")])c=a.service;return c||null},getServiceReferences:function(a){if(a)return this._namedReferences[a]?this._namedReferences[a]:[];var c=[];this._entries.forEach(function(b){b&&c.push(b.reference)});return c},registerService:function(d,c,b){if(typeof c===
"undefined"||c===null)throw Error("invalid service");typeof d==="string"?d=[d]:Array.isArray(d)||(d=[]);var e=this._entries.length,m=new i(e,d,b),n=this._namedReferences;d.forEach(function(b){n[b]=n[b]||[];n[b].push(m)});d=new g(c,this._internalRegistry.isRegistered.bind(null,e));this._entries.push({reference:m,service:d});d=this._internalRegistry;this._serviceEventTarget.dispatchEvent(new h("registered",m));return new a(e,m,d)},addEventListener:function(a,c){this._serviceEventTarget.addEventListener(a,
c)},removeEventListener:function(a,c){this._serviceEventTarget.removeEventListener(a,c)}};d.prototype.constructor=d;return{ServiceRegistry:d}});
define("orion/xhr",["orion/Deferred"],function(k){function j(i,a,g,h){var d=typeof g.response!=="undefined"?g.response:g.responseText,f;try{f=g.status}catch(c){f=0}i={args:a,response:d,responseText:typeof d==="string"?d:null,status:f,url:i,xhr:g};if(typeof h!=="undefined")i.error=h;return i}return function(i,a,g){var g=g||{},h=arguments.length>3&&arguments[3]?arguments[3]:new XMLHttpRequest,d=new k,f=g.headers||{},c=g.log||!1,b;typeof f["X-Requested-With"]==="undefined"&&(f["X-Requested-With"]="XMLHttpRequest");
if(typeof g.data!=="undefined"&&(i==="POST"||i==="PUT"))b=g.data;if(typeof g.responseType==="string")h.responseType=g.responseType;h.onprogress=function(b){b.xhr=h;d.progress(b)};h.onreadystatechange=function(){if(h.readyState===4){var b=j(a,g,h),e=h.status;200<=e&&e<400?d.resolve(b):(c&&typeof console!=="undefined"&&console.log(Error(h.statusText)),d.reject(b))}};try{h.open(i,a,!0);if(typeof g.timeout==="number")if(typeof h.timeout==="number")h.timeout=g.timeout,h.addEventListener("timeout",function(){d.reject(j(a,
g,h,"Timeout exceeded"))});else{var e=setTimeout(function(){d.reject(j(a,g,h,"Timeout exceeded"))},g.timeout);d.then(clearTimeout.bind(null,e),clearTimeout.bind(null,e))}Object.keys(f).forEach(function(b){h.setRequestHeader(b,f[b])});h.send(b)}catch(m){d.reject(j(a,g,h,m))}return d.promise}});
define("orion/preferences",["require","orion/Deferred","orion/xhr"],function(k,j,i){function a(b,e){this._name=b;this._providers=e;this._flushPending=!1;this._cached=null;this._stores=[];this._dirty=[]}function g(b,e){return{get:function(c,a){if(e===0)return null;var d=localStorage.getItem(b+c);if(d===null)return null;d=JSON.parse(d);return a||e===-1||d._expires&&d._expires>(new Date).getTime()?(delete d._expires,d):null},set:function(c,a){if(e!==0){if(e!==-1)a._expires=(new Date).getTime()+1E3*e;
if(Object.keys(a).length===0)localStorage.removeItem(b+c);else{var d=JSON.stringify(a);localStorage.setItem(b+c,d);delete a._expires}}},remove:function(e){localStorage.removeItem(b+e)}}}function h(b){this._currentPromises={};this._cache=new g("/orion/preferences/user",3600);this._service=null;this.available=function(){if(!this._service){var e=b.getServiceReferences("orion.core.preference.provider");if(e.length>0)this._service=b.getService(e[0])}return!!this._service}}function d(b){this._location=
b;this._currentPromise=null;this._cache=new g("/orion/preferences/default",3600)}function f(){this._cache=new g("/orion/preferences/local",-1)}function c(b,e){this._userProvider=new h(b);this._localProvider=new f;e=e||"defaults.pref";e.indexOf("://")===-1&&(e=k.toUrl(e));this._defaultsProvider=new d(e);this._serviceRegistration=b.registerService("orion.core.preference",this)}a.prototype={_flush:function(){for(var b=[],e=0;e<this._stores.length;++e){var c=this._stores[e];this._dirty.indexOf(c)!==-1&&
b.push(this._providers[e].put(this._name,c))}this._dirty=[];return j.all(b)},_scheduleFlush:function(b){this._dirty.indexOf(b)===-1&&this._dirty.push(b);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 b=0;b<this._stores.length;++b){var e=this._stores[b],c;for(c in e)e.hasOwnProperty(c)&&typeof this._cached[c]==="undefined"&&(this._cached[c]=
e[c])}}return this._cached},keys:function(){return Object.keys(this._getCached())},get:function(b){return this._getCached()[b]},put:function(b,e){if(this._stores.length!==0){var c=this._stores[0];if(c[b]!==e)c[b]=e,this._cached=null,this._scheduleFlush(c)}},remove:function(b){for(var e=0;e<this._stores.length;++e){var c=this._stores[e];if(c.hasOwnProperty(b))return delete c[b],this._cached=null,this._scheduleFlush(c),!0}return!1},clear:function(){for(var b=0;b<this._stores.length;++b)this._stores[b]=
{},this._scheduleFlush(this._stores[b]);this._cached=null},sync:function(b){if(this._flushPending)return this._flushPending=!1,this._flush();for(var e=this,c=[],a=0;a<this._providers.length;++a)c.push(this._providers[a].get(this._name,b).then(function(b){return function(c){e._stores[b]=c}}(a)));return j.all(c).then(function(){e._cached=null;e._getCached()})},flush:function(){this._flush()}};h.prototype={get:function(b,e){if(this._currentPromises[b])return this._currentPromises[b];var c=new j,a=null;
e?this._cache.remove(b):a=this._cache.get(b);if(a!==null)c.resolve(a);else{this._currentPromises[b]=c;var d=this;this._service.get(b).then(function(e){d._cache.set(b,e);delete d._currentPromises[b];c.resolve(e)},function(e){e.status===404?(e={},d._cache.set(b,e),delete d._currentPromises[b],c.resolve(e)):(delete d._currentPromises[b],c.resolve(d._cache.get(b,!0)||{}))})}return c},put:function(b,e){this._cache.set(b,e);return this._service.put(b,e)}};d.prototype={get:function(b,e){if(this._currentPromise)return this._currentPromise;
var c=new j,a=null;e?this._cache.remove(b):a=this._cache.get(b);if(a!==null)c.resolve(a);else{this._currentPromise=c;var d=this;i("GET",this._location,{headers:{"Orion-Version":"1"},timeout:15E3}).then(function(e){e=JSON.parse(e.response);d._cache.set(b,e[b]||{});d._currentPromise=null;c.resolve(e[b]||{})},function(e){e.xhr.status===401||e.xhr.status===404?(d._cache.set(b,{}),d._currentPromise=null,c.resolve({})):(d._currentPromise=null,e=d._cache.get(b,!0),e!==null?c.resolve(e[b]||{}):c.resolve({}))})}return c},
put:function(){var b=new j;b.resolve();return b}};f.prototype={get:function(b){var e=new j,b=this._cache.get(b);b!==null?e.resolve(b):e.resolve({});return e},put:function(b,e){var c=new j;this._cache.set(b,e);c.resolve();return c}};c.DEFAULT_SCOPE=1;c.LOCAL_SCOPE=2;c.USER_SCOPE=4;c.prototype={listenForChangedSettings:function(b){window.addEventListener("storage",b,!1);return"/orion/preferences/local/settings"},getPreferences:function(b,e){if(!e||typeof e!=="number"||e>7||e<1)e=c.DEFAULT_SCOPE|c.LOCAL_SCOPE|
c.USER_SCOPE;var d=[];c.USER_SCOPE&e&&this._userProvider.available()&&d.push(this._userProvider);c.LOCAL_SCOPE&e&&d.push(this._localProvider);c.DEFAULT_SCOPE&e&&d.push(this._defaultsProvider);var f=new a(b,d);return f.sync().then(function(){return f})},getSetting:function(b,e,c){for(var a,d=0;d<b.length;d++)if(b[d].label===e)for(var f=0;f<b[d].data.length;f++)if(b[d].data[f].label===c){a=b[d].data[f].value;break}return a}};return{PreferencesService:c}});
define("orion/pluginregistry",["orion/Deferred","orion/EventTarget"],function(k,j){function i(c,b){var e=Object.keys(c),a=Object.keys(b);if(e.length!==a.length)return!1;e.sort();a.sort();for(var d=0,f=e.length;d<f;d++){var g=e[d];if(g!==a[d])return!1;var l=c[g],g=b[g];if(l!==g&&JSON.stringify(l)!==JSON.stringify(g))return!1}return!0}function a(c){if(c.indexOf("://")===-1){var b=document.createElement("a");b.href=c;return b.href}return c}function g(c){var b=null;return{key:function(e){return(b=b||
Object.keys(c))[e]},getItem:function(b){return c[b]},setItem:function(e,a){c[e]=a;b=null},removeItem:function(e){delete c[e];b=null},clear:function(){(b=b||Object.keys(c)).forEach(function(b){delete c[b]}.bind(this));b=null}}}function h(c,b){return{type:c,plugin:b}}function d(c,b,e){function a(l,b,o){if(!G)return(new k).reject(Error("plugin not connected"));var c=w++,p=new k;p.then(null,function(l){x==="active"&&l instanceof Error&&l.name==="Cancel"&&e.postMessage({id:c,cancel:l.message||"Cancel"},
G)});A[String(c)]=p;e.postMessage({id:c,serviceId:l,method:b,params:o},G);return p.promise}function d(l){var b={};if(l.methods&&(l.methods.forEach(function(e){b[e]=function(){var b=Array.prototype.slice.call(arguments);return x==="active"?a(l.serviceId,e,b):o.start({"transient":!0}).then(function(){return a(l.serviceId,e,b)})}}),b.addEventListener&&b.removeEventListener)){var e=new j;b.dispatchEvent=e.dispatchEvent.bind(e);var c=b.addEventListener;b.addEventListener=function(l,b){e._namedListeners[l]||
c(l);e.addEventListener(l,b)};var p=b.removeEventListener;b.removeEventListener=function(l,b){e.removeEventListener(l,b);e._namedListeners[l]&&p(l)}}return b}function f(l){var b=JSON.parse(JSON.stringify(l.properties));b.__plugin__=c;l=l.names||l.type||[];Array.isArray(l)||(l=[l]);b.objectClass=l;return b}function g(l){var b=d(l),o=f(l),o=e.registerService(l.names||l.type,b,o);F[l.serviceId]={registration:o,proxy:b}}function l(){e.persist(c,{created:u,headers:s,services:v,autostart:t,lastModified:y})}
function p(l){var b;try{if(l.method)if("manifest"===l.method||"plugin"===l.method){var c=l.params[0];D({headers:c.headers,services:c.services}).then(function(){I.resolve(o)})}else if("dispatchEvent"===l.method){var a=F[l.serviceId].proxy;a.dispatchEvent.apply(a,l.params)}else if("progress"===l.method)b=A[String(l.requestId)],b.progress.apply(b,l.params);else if("timeout"===l.method)I&&I.reject(l.error);else throw Error("Bad response method: "+l.method);else if(b=A[String(l.id)],delete A[String(l.id)],
l.error){var p=e.handleServiceError(o,l.error);b.reject(p)}else b.resolve(l.result)}catch(u){console.log("Plugin._responseHandler "+u)}}var o=this,b=b||{},u=b.created||(new Date).getTime(),s=b.headers||{},v=b.services||[],t=b.autostart,y=b.lastModified||0,x="installed",z,I,G,F={},w=0,A={},D;this._persist=l;this._resolve=function(){x="resolved";e.dispatchEvent(new h("resolved",o))};this._getAutostart=function(){return t};this._getCreated=function(){return u};this.getLocation=function(){return c};this.getHeaders=
function(){return JSON.parse(JSON.stringify(s))};this.getName=function(){var l=this.getHeaders();return l?l.name||"":null};this.getVersion=function(){var l=this.getHeaders();return l?l.version||"0.0.0":null};this.getLastModified=function(){return y};this.getServiceReferences=function(){var l=[];Object.keys(F).forEach(function(b){l.push(F[b].registration.getReference())});return l};this.getState=function(){return x};this.start=function(b){if(x==="uninstalled")return(new k).reject(Error("Plugin is uninstalled"));
if(z)return z.promise.then(this.start.bind(this,b));if(x==="active")return(new k).resolve();if(!b||!b["transient"]){var a=b&&b.lazy?"lazy":"started";a!==t&&(t=a,l())}a=e.getState();if(a!=="starting"&&a!=="active")return b["transient"]?(new k).reject(Error("start transient error")):(new k).resolve();if(x==="installed")try{this._resolve()}catch(u){return(new k).reject(u)}x==="resolved"&&v.forEach(function(l){g(l)});if(b&&b.lazy)return x!=="starting"&&(x="starting",e.dispatchEvent(new h("lazy activation",
o))),(new k).resolve();var d=new k;z=d;x="starting";e.dispatchEvent(new h("starting",o));I=new k;G=e.connect(c,p);I.then(function(){I=null;x="active";e.dispatchEvent(new h("started",o));z=null;d.resolve()},function(){I=null;x="stopping";e.dispatchEvent(new h("stopping",o));Object.keys(F).forEach(function(l){F[l].registration.unregister();delete F[l]});e.disconnect(G);G=null;x="resolved";z=null;e.dispatchEvent(new h("stopped",o));d.reject(Error("plugin activation error"))});return d.promise};this.stop=
function(b){if(x==="uninstalled")return(new k).reject(Error("Plugin is uninstalled"));if(z)return z.promise.then(this.stop.bind(this,b));if((!b||!b["transient"])&&"stopped"!==t)t="stopped",l();if(x!=="active"&&x!=="starting")return(new k).resolve();z=b=new k;x="stopping";e.dispatchEvent(new h("stopping",o));Object.keys(F).forEach(function(l){F[l].registration.unregister();delete F[l]});G&&(e.disconnect(G),G=null);x="resolved";z=null;e.dispatchEvent(new h("stopped",o));b.resolve();return b.promise};
D=function(b){if(x==="uninstalled")return(new k).reject(Error("Plugin is uninstalled"));if(!b)return y===0&&(y=(new Date).getTime(),l()),e.loadManifest(c).then(D);var a=s,u=v,d=t;s=b.headers||{};v=b.services||{};t=b.autostart||t;b.lastModified?y=b.lastModified:(y=(new Date).getTime(),l());if(i(s,a)&&i(v,u)&&t===d)return(new k).resolve();if(x==="active"||x==="starting"){var m=[];Object.keys(v).forEach(function(l){var b=v[l];m.push(l);var e=F[l];if(e){if(i(b.methods,Object.keys(e.proxy))){var l=f(b),
o=e.registration.getReference(),c={};o.getPropertyKeys().forEach(function(l){c[l]=o.getProperty(l)});i(l,c)||e.registration.setProperties(l);return}e.registration.unregister();delete F[l]}g(b)});Object.keys(F).forEach(function(l){m.indexOf(l)===-1&&(F[l].registration.unregister(),delete F[l])})}x==="active"&&(e.disconnect(G),I=new k,G=e.connect(c,p),I.then(function(){I=null},function(){I=null;x="stopping";e.dispatchEvent(new h("stopping"),o);Object.keys(F).forEach(function(l){F[l].registration.unregister();
delete F[l]});e.disconnect(G);G=null;x="resolved";e.dispatchEvent(new h("stopped",o))}));return(new k).resolve()};this.update=function(l){return D(l).then(function(){e.dispatchEvent(new h("updated",o))})};this.uninstall=function(){if(x==="uninstalled")return(new k).reject(Error("Plugin is uninstalled"));if(x==="active"||x==="starting"||x==="stopping")return this.stop().then(this.uninstall.bind(this),this.uninstall.bind(this));e.removePlugin(this);x="uninstalled";e.dispatchEvent(new h("uninstalled",
o));return(new k).resolve()}}var f=/^http[s]?/i;return{Plugin:d,PluginRegistry:function(c,b){function e(l){var b=l.source;q.some(function(e){if(b===e.target){if(typeof e.useStructuredClone==="undefined")e.useStructuredClone=typeof l.data!=="string";e.handler(e.useStructuredClone?l.data:JSON.parse(l.data));return!0}})}var b=b||{},m=b.storage||localStorage;m.getItem||(m=g(m));var n="installed",r=[],q=[],l=new j,p={},o={registerService:c.registerService.bind(c),connect:function(l,e,o){function c(l){l=
Error(l);l.name="timeout";e({method:"timeout",error:l})}var a={handler:e,url:l},p=setTimeout(c.bind(null,"Load timeout for: "+l),o||15E3),d=document.createElement("iframe");d.name=l+"_"+(new Date).getTime();if(!b.visible)d.style.display="none",d.style.visibility="hidden";d.src=l;d.onload=function(){clearTimeout(p);setTimeout(c.bind(null,"Plugin handshake timeout for: "+l),5E3)};d.sandbox="allow-scripts allow-same-origin";document.body.appendChild(d);a.target=d.contentWindow;a.close=function(){d&&
(document.body.removeChild(d),d=null)};q.push(a);return a},disconnect:function(l){for(var b=0;b<q.length;b++)if(l===q[b]){q.splice(b,1);try{l.close()}catch(e){}break}},removePlugin:function(l){for(var b=0;b<r.length;b++)if(l===r[b]){r.splice(b,1);break}m.removeItem("plugin."+l.getLocation())},persist:function(l,b){m.setItem("plugin."+l,JSON.stringify(b))},postMessage:function(l,b){b.target.postMessage(b.useStructuredClone?l:JSON.stringify(l),b.url)},dispatchEvent:function(b){try{l.dispatchEvent(b)}catch(e){console&&
console.log("PluginRegistry.dispatchEvent "+e)}},loadManifest:function(l){var b=new k,e=o.connect(l,function(l){e&&l.method&&("manifest"===l.method||"plugin"===l.method?(l=l.params[0],o.disconnect(e),e=null,b.resolve(l)):"timeout"===l.method&&(o.disconnect(e),e=null,b.reject(l.error)))});return b.promise},getState:function(){return n},handleServiceError:function(l,b){if(b&&b.status===401){var e=l.getHeaders(),o=l.getName()||l.getLocation(),c=document.createElement("span");c.appendChild(document.createTextNode("Authentication required for: "+
o+"."));if(e.login)c.appendChild(document.createTextNode(" ")),o=document.createElement("a"),o.target="_blank",o.textContent="Login",o.href=e.login,f.test(o.href)?(c.appendChild(o),c.appendChild(document.createTextNode(" and re-try the request."))):console.log("Illegal Login URL: "+e.login);return{Severity:"Error",HTML:!0,Message:(new XMLSerializer).serializeToString(c)}}if(b.__isError){var a=b,b=Error(a.message);Object.keys(a).forEach(function(l){b[l]=a[l]});delete b.__isError}return b}};this.getLocation=
function(){return"System"};this.getHeaders=function(){return{}};this.getName=function(){return"System"};this.getVersion=function(){return"0.0.0"};this.getLastModified=function(){return 0};this.getState=o.getState;this.init=function(){if(!(n==="starting"||n==="active"||n==="stopping")){addEventListener("message",e,!1);for(var l=[],c=0,p=m.length;c<p;c++)l.push(m.key(c));l.forEach(function(l){if(l.indexOf("plugin.")===0){var b=l.substring(7),l=JSON.parse(m.getItem(l));l.created&&r.push(new d(b,l,o))}});
r.sort(function(l,b){return l._getCreated()<b._getCreated()?-1:1});b.plugins&&Object.keys(b.plugins).forEach(function(l){l=a(l);if(!this.getPlugin(l)){var e=b.plugins[l],e=typeof e==="object"||{};e.autostart=e.autostart||b.defaultAutostart||"lazy";r.push(new d(l,e,o))}}.bind(this));n="starting"}};this.start=function(){n!=="starting"&&this.init();if(n!=="starting")return(new k).reject("Cannot start framework. Framework is already "+n+".");var l=[],b=(new Date).getTime();r.forEach(function(e){var o=
e._getAutostart();e.getLastModified()===0?l.push(e.update().then(function(){if("started"===o)return e.start({"transient":!0});if("lazy"===o)return e.start({lazy:!0,"transient":!0});e._resolve()})):"started"===o?l.push(e.start({"transient":!0})):"lazy"===o?(l.push(e.start({lazy:!0,"transient":!0})),b>e.getLastModified()+864E5&&e.update()):e._resolve()});return k.all(l,function(l){console.log("PluginRegistry.stop "+l)}).then(function(){n="active"})};this.stop=function(){if(n!=="starting"&&n!=="active")return(new k).reject("Cannot stop registry. Registry is already "+
n+".");n="stopping";var l=[];r.forEach(function(b){l.push(b.stop({"transient":!0}))});return k.all(l,function(l){console.log("PluginRegistry.stop "+l)}).then(function(){removeEventListener("message",e);n="resolved"})};this.update=function(){this.stop().then(this.start.bind(this))};this.uninstall=function(){return(new k).reject("Cannot uninstall registry")};this.installPlugin=function(l,b){var l=a(l),e=this.getPlugin(l);if(e)return(new k).resolve(e);if(p[l])return p[l];if(b)return e=new d(l,b,o),r.push(e),
e._persist(),o.dispatchEvent(new h("installed",e)),(new k).resolve(e);var c=o.loadManifest(l).then(function(b){e=new d(l,b,o);r.push(e);e._persist();delete p[l];o.dispatchEvent(new h("installed",e));return e},function(b){delete p[l];throw b;});return p[l]=c};this.getPlugins=function(){return r.slice()};this.getPlugin=function(l){var b=null,l=a(l);r.some(function(e){if(l===e.getLocation())return b=e,!0});return b};this.addEventListener=l.addEventListener.bind(l);this.removeEventListener=l.removeEventListener.bind(l);
this.resolvePlugins=function(){var l=!0;r.forEach(function(b){l=l&&b._resolve()});return l}}}});
define("orion/serviceTracker",[],function(){function k(a,g){function h(b){var e=b.getProperty("service.id"),a=this.addingService(b);a&&(f[e]=b,c[e]=a)}function d(b){var e=b.getProperty("service.id"),a=c[e];delete f[e];delete c[e];this.removedService(b,a)}this.serviceRegistry=a;var f={},c={},b=j,e,m;this.close=function(){if(b!==i)throw"Already closed";b=j;a.removeEventListener("registered",e);a.removeEventListener("unregistering",m);m=e=null;var c=this;this.getServiceReferences().forEach(function(b){d.call(c,
b)});if(typeof this.onClose==="function")this.onClose()};this.getServiceReferences=function(){return f.length?Object.keys(f).map(function(b){return f[b]}):null};this.open=function(){if(b!==j)throw"Already open";b=i;var c=this;e=function(b){if(b.serviceReference.getProperty("objectClass").indexOf(g)!==-1&&(h.call(c,b.serviceReference),typeof c.onServiceAdded==="function"))return c.onServiceAdded(b.serviceReference,c.serviceRegistry.getService(b.serviceReference))};m=function(b){b.serviceReference.getProperty("objectClass").indexOf(g)!==
-1&&d.call(c,b.serviceReference)};a.addEventListener("registered",e);a.addEventListener("unregistering",m);a.getServiceReferences(g).forEach(function(b){h.call(c,b)});if(typeof this.onOpen==="function")this.onOpen()}}var j=0,i=1;k.prototype={addingService:function(a){return this.serviceRegistry.getService(a)},onOpen:null,onClose:null,onServiceAdded:null,removedService:function(){}};return k});
define("orion/config",["orion/Deferred","orion/serviceTracker"],function(k,j){var i,a,g,h,d,f="pid";i=function(b,e,c){function a(l,b,c){b.forEach(function(a,d){try{var m=l[d].getProperty("__plugin__"),f=m&&e.getPlugin(m);(!m||f&&f.getState()==="active")&&b[d].updated(c)}catch(g){typeof console!=="undefined"&&console.log(g)}})}j.call(this,b,"orion.cm.managedservice");var d={},g={},l=function(l){var e=[];l.plugin.getServiceReferences().forEach(function(l){if(l.getProperty("objectClass").indexOf("orion.cm.managedservice")!==
-1){var a=l.getProperty(f),l=b.getService(l);a&&l&&(a=(a=c._find(a))&&a.getProperties(),e.push(l.updated(a)))}});return k.all(e)};this.addingService=function(l){var e=l.getProperty(f),c=b.getService(l);if(!e||!c)return null;d[e]||(d[e]=[]);g[e]||(g[e]=[]);d[e].push(l);g[e].push(c);return c};this.onServiceAdded=function(l,b){var e=l.getProperty(f),e=c._find(e);a([l],[b],e&&e.getProperties())};this.onOpen=function(){e.addEventListener("started",l)};this.onClose=function(){e.removeEventListener("started",
l)};this.notifyUpdated=function(l){var b=l.getPid();a(d[b]||[],g[b]||[],l.getProperties())};this.notifyDeleted=function(l){l=l.getPid();a(d[l]||[],g[l]||[],null)};this.removedService=function(l,b){var e=l.getProperty(f),c=d[e],a=g[e];c.length>1?c.splice(c.indexOf(l),1):delete d[e];a.length>1?a.splice(a.indexOf(b),1):delete g[e]}};a=function(){function b(b,c,a){this.store=new g(this,a);this.configAdmin=new h(this,this.store);this.tracker=new i(b,c,this.store)}b.prototype={getConfigurationAdmin:function(){var b=
this;return this.configAdmin._init().then(function(c){b.tracker.open();return c})},notifyDeleted:function(b){this.tracker.notifyDeleted(b)},notifyUpdated:function(b){this.tracker.notifyUpdated(b)}};return b}();h=function(){function b(b,c){this.factory=b;this.store=c}b.prototype={_init:function(){var b=this;return this.store._init().then(function(){return b})},getConfiguration:function(b){return this.store.get(b)},listConfigurations:function(){return this.store.list()}};return b}();var c="/cm/configurations";
g=function(){function b(b,a){this.factory=b;this.prefsService=a;this.configs=Object.create(null);this.pref=null;var g=this;this.initPromise=this.prefsService.getPreferences(c).then(function(b){g.pref=b;b.keys().forEach(function(e){if(!g.configs[e]){var l=b.get(e);typeof l==="object"&&l!==null&&Object.keys(l).length>0&&(l[f]=e,g.configs[e]=new d(g.factory,g,l))}})})}b.prototype={_init:function(){return this.initPromise},_find:function(b){return this.configs[b]||null},get:function(b){var c=this._find(b);
c||(c=new d(this.factory,this,b),this.configs[b]=c);return c},list:function(){var b=this,c=[];this.pref.keys().forEach(function(a){(a=b._find(a))&&a.getProperties()!==null&&c.push(a)});return c},remove:function(b){this.pref.remove(b);delete this.configs[b]},save:function(b,c){this.pref.put(b,c.getProperties(!0)||{})}};return b}();d=function(){function b(b){for(var e={},c=Object.keys(b),a=0;a<c.length;a++){var l=c[a],p=b[l];e[l]=p instanceof Array?p.slice():p}return e}function e(e,c,a){this.factory=
e;this.store=c;if(a!==null&&typeof a==="object")this.pid=a[f],e=b(a),delete e[f],this.properties=e;else if(typeof a==="string")this.pid=a,this.properties=null;else throw Error("Invalid pid/properties "+a);}e.prototype={_checkRemoved:function(){if(this._removed)throw Error("Configuration was removed");},getPid:function(){this._checkRemoved();return this.pid},getProperties:function(e){this._checkRemoved();var c=null;if(this.properties&&(c=b(this.properties),!e))c[f]=this.pid;return c},remove:function(){this._checkRemoved();
this.factory.notifyDeleted(this);this.store.remove(this.pid);this._removed=!0},update:function(e){this._checkRemoved();e=b(e);delete e[f];this.properties=e;this.store.save(this.pid,this);this.factory.notifyUpdated(this)},toString:function(){return"[ConfigImpl pid: "+this.pid+", properties: "+JSON.stringify(this.properties)+"]"}};return e}();return{ConfigurationAdminFactory:a}});
define("orion/bootstrap","require,orion/Deferred,orion/serviceregistry,orion/preferences,orion/pluginregistry,orion/config".split(","),function(k,j,i,a,g,h){var d;return{startup:function(){if(d)return d;d=new j;var f=window.serviceRegistry=new i.ServiceRegistry,c=new a.PreferencesService(f);return c.getPreferences("/plugins").then(function(b){var e={plugins:{}};b.keys().forEach(function(c){var a=k.toUrl(c);e.plugins[a]=b[c]});var a=window.pluginRegistry=new g.PluginRegistry(f,e);return a.start().then(function(){if(f.getServiceReferences("orion.core.preference.provider").length>
0)return c.getPreferences("/plugins",c.USER_SCOPE).then(function(b){var e=[];b.keys().forEach(function(b){b=k.toUrl(b);a.getPlugin(b)||e.push(a.installPlugin(b,{autostart:"lazy"}).then(function(l){return l.update().then(function(){return l.start({lazy:!0})})}))});return j.all(e,function(b){console.log(b)})})}).then(function(){return(new h.ConfigurationAdminFactory(f,a,c)).getConfigurationAdmin().then(f.registerService.bind(f,"orion.cm.configadmin"))}).then(function(){var b=f.getService("orion.core.auth");
if(b){var e=b.getUser().then(function(l){if(l)localStorage.setItem("lastLogin",(new Date).getTime());else return b.getAuthForm(window.location.href).then(function(l){window.location=l})}),c=localStorage.getItem("lastLogin");if(!c||c<(new Date).getTime()-9E5)return e}}).then(function(){var b={serviceRegistry:f,preferences:c,pluginRegistry:a};d.resolve(b);return b})})}}});
(function(){function k(a,h,d,f,c,b){h[a]&&(d.push(a),(h[a]===!0||h[a]===1)&&f.push(c+a+"/"+b))}function j(a,h,d,f,c){h=f+h+"/"+c;require._fileExists(a.toUrl(h))&&d.push(h)}var i=/(^.*(^|\/)nls(\/|$))([^\/]*)\/?([^\/]*)/,a={};define("i18n",{version:"1.0.0",load:function(g,h,d,f){var f=f||{},c=i.exec(g),b=c[1],e=c[4],m=c[5],n=e.split("-"),r=[],q={},l,p,o="";c[5]?(b=c[1],g=b+m):(m=c[4],e=f.locale||(f.locale=typeof navigator==="undefined"?"root":(navigator.language||navigator.userLanguage||"root").toLowerCase()),
n=e.split("-"));if(f.isBuild){r.push(g);j(h,"root",r,b,m);for(l=0;p=n[l];l++)o+=(o?"-":"")+p,j(h,o,r,b,m);h(r,function(){d()})}else h([g],function(e){var c=[];k("root",e,c,r,b,m);for(l=0;p=n[l];l++)o+=(o?"-":"")+p,k(o,e,c,r,b,m);h(r,function(){var l,o;for(l=c.length-1;l>-1&&(p=c[l]);l--){o=e[p];if(o===!0||o===1)o=h(b+p+"/"+m);var f=q,g=void 0;for(g in o)!(g in a)&&!(g in f)&&(f[g]=o[g])}d(q)})})}})})();
define("orion/i18n",[],function(){return{load:function(k,j,i,a){var a=a||{},g=/(^.*(?:^|\/)nls(?:\/|$))([^\/]*)\/?([^\/]*)/,h=g.exec(k);if(h)if(j.defined(k))i(j(k));else if(a.isBuild||a.isTest)i({});else{var d=h[1],f=h[3]?h[2]:"",c=h[3]||h[2];j(["orion/bootstrap"],function(b){b.startup().then(function(b){var m=b.serviceRegistry,b=m.getServiceReferences("orion.i18n.message");if(f)b.some(function(b){return k===b.getProperty("name")?(m.getService(b).getMessageBundle().then(function(l){i(l)},function(){i({})}),
!0):!1})||i({});else{var n={},r;b.forEach(function(b){var l=b.getProperty("name");if((h=g.exec(l))&&d===h[1]&&c===(h[3]||h[2]))if(f=h[3]?h[2]:""){if((b=a.locale||(typeof navigator!=="undefined"?navigator.language||navigator.userLanguage:null))&&b.indexOf(f)===0)n[f]=!0,j.specified(l)||define(l,["orion/i18n!"+l],function(l){return l})}else r=b});j.specified(k)?i(n):r?m.getService(r).getMessageBundle().then(function(b){Object.keys(n).forEach(function(l){typeof b[l]==="undefined"&&(b[l]=n[l])});define(k,
[],b);i(b)},function(){define(k,[],n);i(n)}):(define(k,[],n),i(n))}})})}else i(null)}}});
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(k,j){var i={root:j};Object.keys(k).forEach(function(a){typeof i[a]==="undefined"&&(i[a]=k[a])});return i});
define("orion/webui/littlelib",["require"],function(){function k(a,c){c||(c=document);return c.querySelectorAll(a)}function j(a,c){var b=a.compareDocumentPosition(c);return a===c||Boolean(b&16)}function i(a){if(a.tabIndex>=0)return a;if(a.hasChildNodes())for(var c=0;c<a.childNodes.length;c++){var b=i(a.childNodes[c]);if(b)return b}return null}function a(d){if(d.tabIndex>=0)return d;if(d.hasChildNodes())for(var c=d.childNodes.length-1;c>=0;c--){var b=a(d.childNodes[c]);if(b)return b}return null}function g(a,
c){if(a.nodeType===3){var b=h.exec(a.nodeValue);b&&b.length>1&&a.parentNode.replaceChild(document.createTextNode(c[b[1]]||b[1]),a)}if(a.hasChildNodes())for(b=0;b<a.childNodes.length;b++)g(a.childNodes[b],c)}var h=/\$\{([^\}]+)\}/,d=[];return{$:function(a,c){c||(c=document);return c.querySelector(a)},$$:k,$$array:function(a,c){return Array.prototype.slice.call(k(a,c))},node:function(a){var c=a;typeof a==="string"&&(c=document.getElementById(a));return c},contains:j,bounds:function(a){a=a.getBoundingClientRect();
return{left:a.left+document.body.scrollLeft,top:a.top+document.body.scrollTop,width:a.width,height:a.height}},empty:function(a){for(;a.hasChildNodes();)a.removeChild(a.firstChild)},firstTabbable:i,lastTabbable:a,stop:function(a){window.document.all?a.keyCode=0:(a.preventDefault(),a.stopPropagation())},processTextNodes:g,addAutoDismiss:function(a,c){d.length===0&&document.addEventListener("click",function(b){for(var e=[],c=0;c<d.length;c++){for(var a=d[c].excludeNodes,f=d[c].dismiss,g=!1,l=!0,p=0;p<
a.length;p++)if((g=document.compareDocumentPosition(document,a[p])!==1)&&j(a[p],b.target)){l=!1;break}l&&(f(),g=document.compareDocumentPosition(document,a[p])!==1);g&&e.push(d[c])}d=e},!0);d.push({excludeNodes:a,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/selection",["orion/EventTarget"],function(k){function j(i,a){a||(a="orion.page.selection");this._serviceRegistry=i;k.attach(this);this._serviceRegistration=i.registerService(a,this);this._selections=null}j.prototype={getSelection:function(i){i(this._getSingleSelection())},getSelections:function(i){i(this._selections||[])},_getSingleSelection:function(){return this._selections&&this._selections.length>0?this._selections[0]:null},setSelections:function(i){var a=this._selections;this._selections=
Array.isArray(i)?i.length>0?i:null:i?[i]:null;a!==this._selections&&this.dispatchEvent({type:"selectionChanged",selection:this._getSingleSelection(),selections:this._selections})}};j.prototype.constructor=j;return{Selection:j}});
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(k,j){var i={root:j};Object.keys(k).forEach(function(a){typeof i[a]==="undefined"&&(i[a]=k[a])});return i});
define("orion/operations/nls/root/messages",{More:"More","No Matching OperationService for location:":"No Matching OperationService for location:","No operations services registered.":"No operations services registered.","could not find toolbar ":"could not find toolbar ","Remove Completed":"Remove Completed","Remove all completed operations":"Remove all completed operations",Remove:"Remove","Remove operations from the operations list.":"Remove operations from the operations list.",Cancel:"Cancel",
"Cancel operations from the operations list.":"Cancel operations from the operations list.","Operation resulted in a warning.":"Operation resulted in a warning.","Operation resulted in an error.":"Operation resulted in an error.","Operation is running.":"Operation is running.","Operation is canceled.":"Operation is canceled.","Operation failed.":"Operation failed.",Name:"Name",Actions:"Actions",Status:"Status",Scheduled:"Scheduled"});
define("orion/operations/nls/messages",["orion/i18n!orion/operations/nls/messages","orion/operations/nls/root/messages"],function(k,j){var i={root:j};Object.keys(k).forEach(function(a){typeof i[a]==="undefined"&&(i[a]=k[a])});return i});
define("orion/webui/tooltip",["require","orion/webui/littlelib"],function(k,j){function i(a){this._init(a)}i.prototype={_init:function(a){this._node=j.node(a.node);if(!this._node)throw"no dom node for tooltip found";this._position=a.position||["right","above","below","left"];this._text=a.text;this._hideDelay=a.hideDelay===void 0?200:a.hideDelay;this._tailSize=a.tailSize||10;this._trigger=a.trigger||"mouseover";this._afterShowing=a.afterShowing;this._afterHiding=a.afterHiding;var g=this;if(this._trigger===
"click")this._showDelay=0,this._node.addEventListener("click",function(a){a.target===g._node&&(g.show(),j.stop(a))},!1);else if(this._trigger==="mouseover"){this._showDelay=a.showDelay===void 0?1E3:a.showDelay;a=["mouseout","click"];this._node.addEventListener("mouseover",function(a){j.contains(g._node,a.target)&&(g.show(),j.stop(a))},!1);for(var h=0;h<a.length;h++)this._node.addEventListener(a[h],function(a){j.contains(g._node,a.target)&&g.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 a=this;j.addAutoDismiss([this._tip,this._node],function(){a.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(a._timeout)window.clearTimeout(a._timeout),a._timeout=null;a._tip.addEventListener("mouseout",function(g){j.contains(a._tip,g.target)&&(a.hide(),j.stop(g))},!1)},!1)}return this._tip},_positionTip:function(a,g){this._makeTipNode();if(this._tailBorder)this._tip.removeChild(this._tailBorder),this._tailBorder=null,this._tip.removeChild(this._tail),this._tail=null;a==="left"?this._tipInner.classList.add("left"):
this._tipInner.classList.remove("left");var h=j.bounds(this._node),d=j.bounds(this._tipInner),f;switch(a){case "above":f=h.top-d.height-this._tailSize-1;h=h.left-this._tailSize;break;case "below":f=h.top+h.height+this._tailSize+1;h=h.left-this._tailSize;break;case "left":f=h.top-this._tailSize/2;h=h.left-d.width-this._tailSize-1;break;default:f=h.top-this._tailSize/2,h=h.left+h.width+this._tailSize+1}var c=j.bounds(document.documentElement);if(f+d.height>c.height)if(g)f=c.height-d.height-1;else return!1;
if(h+d.width>c.width)if(g)h=c.width-d.width-1;else return!1;if(h<0)if(g)h=4;else return!1;if(f<0)if(g)f=4;else return!1;this._tailBorder=document.createElement("span");this._tailBorder.classList.add("tooltipTailBorderFrom"+a);this._tail=document.createElement("span");this._tail.classList.add("tooltipTailFrom"+a);a==="above"||a==="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=f+"px";this._tip.style.left=h+"px";this._tip.style.width=d.width+"px";this._tip.style.height=d.height+"px";return!0},contentContainer:function(){this._makeTipNode();return this._tipInner},show:function(){if(!this._tip||!this._tip.classList.contains("tooltipShowing")){var a=this;if(this._timeout)window.clearTimeout(this._timeout),this._timeout=null;this._timeout=window.setTimeout(function(){for(var g=!1,h=0;!g&&h<a._position.length;)g=a._positionTip(a._position[h]),
h++;g||a._positionTip(a._position[0],!0);a._tip.classList.add("tooltipShowing");a._afterShowing&&a._afterShowing()},this._showDelay)}},hide:function(a){if(this._timeout)window.clearTimeout(this._timeout),this._timeout=null;if(this._tip&&this._tip.classList.contains("tooltipShowing")){if(a===void 0)a=this._hideDelay;var g=this;this._timeout=window.setTimeout(function(){g._tip.classList.remove("tooltipShowing");g._afterHiding&&g._afterHiding()},a)}},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}};i.prototype.constructor=i;return{Tooltip:i}});
define("orion/widgets/nls/root/messages",{"no input":"no input","no output":"no output","Choose a Folder":"Choose a Folder",OK:"OK",Profile:"Profile","Sign out":"Sign out","N/A":"N/A","logged in since ":"logged in since ","Sign in":"Sign in","Authentication required!":"Authentication required!","Name:":"Name:","Plug-ins":"Plug-ins"," <No available services or timed out, check URL and try reloading>":" <No available services or timed out, check URL and try reloading>",Properties:"Properties"," (Service Id: ":" (Service Id: ",
Services:"Services","SFTP Transfer":"SFTP Transfer","Remote host:":"Remote host:","Port:":"SFTP Port:","Remote path:":"Remote path:","User name:":"User name:","Password:":"Password:","Start Transfer":"Start Transfer","Location:":"Location:","orion.sftpConnections":"orion.sftpConnections","Drag a file here":"Drag a file here","unzip zips":"Unzip *.zip files","or if you prefer":"(or upload a file using the buttons below)",Upload:"Upload","Browse...":"Browse...","Import a file or zip":"Import a file or zip",
"Missing required argument: searchRenderer":"Missing required argument: searchRenderer","Missing required argument: favService":"Missing required argument: favService","Find File Named":"Find File Named","Type the name of a file to open (? = any character, * = any string):":"Type the name of a file to open (? = any character, * = any string):",Search:"Search","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(k,j){var i={root:j};Object.keys(k).forEach(function(a){typeof i[a]==="undefined"&&(i[a]=k[a])});return i});
define("orion/webui/popupdialog",["i18n!orion/widgets/nls/messages","require","orion/webui/littlelib","orion/webui/tooltip"],function(k,j,i,a){function g(){}g.prototype={_initialize:function(g,d,f,c,b){this._tooltip=new a.Tooltip({node:g,hideDelay:b||0,afterShowing:this._afterShowingFunction(d).bind(this),afterHiding:f,trigger:c?c:"click"});this.$parent=this._tooltip.contentContainer();this.$parent.role="dialog";g=document.createRange();g.selectNode(this.$parent);g=g.createContextualFragment(this.TEMPLATE);
this.messages&&i.processTextNodes(g,k);this.$parent.appendChild(g);var e=this._tooltip;this.$parent.addEventListener("keydown",function(b){b.keyCode===i.KEY.ESCAPE&&e.hide()},!1);this._bindElements(this.$parent);typeof this._bindToDom==="function"&&this._bindToDom(this.$parent)},_bindElements:function(a){for(var d=0;d<a.childNodes.length;d++){var f=a.childNodes[d];f.id&&(this["$"+f.id]=f);this._bindElements(f)}},_afterShowingFunction:function(a){return function(){a&&a.bind(this)();if(!this.customFocus){var d=
i.firstTabbable(this.$parent);d&&d.focus()}}},hide:function(){this._tooltip.hide()},show:function(){this._tooltip.show()}};g.prototype.constructor=g;return{PopupDialog:g}});define("orion/dialogs",[],function(){function k(j){this._serviceRegistry=j;this._serviceRegistration=j.registerService("orion.page.dialog",this)}k.prototype={confirm:function(j,i){i(window.confirm(j))},openFiles:function(){}};k.prototype.constructor=k;return{DialogService:k}});
define("orion/uiUtils",["i18n!orion/nls/messages","orion/webui/littlelib"],function(k,j){function i(a){var g=window.navigator.platform.indexOf("Mac")!==-1;return g&&a.metaKey||!g&&a.ctrlKey}return{getUserKeyString:function(a){var g="",h=navigator.platform.indexOf("Mac")!==-1;a.mod1&&(g+=h?"Cmd+":"Ctrl+");a.mod2&&(g+="Shift+");a.mod3&&(g+="Alt+");a.mod4&&h&&(g+="Ctrl+");if(a.alphaKey)return g+a.alphaKey;for(var d in j.KEY)if(typeof(j.KEY[d]==="number")&&j.KEY[d]===a.keyCode)return g+d;var f;switch(a.keyCode){case 59:f=
a.mod2?":":";";break;case 61:f=a.mod2?"+":"=";break;case 188:f=a.mod2?"<":",";break;case 190:f=a.mod2?">":".";break;case 191:f=a.mod2?"?":"/";break;case 192:f=a.mod2?"~":"`";break;case 219:f=a.mod2?"{":"[";break;case 220:f=a.mod2?"|":"\\";break;case 221:f=a.mod2?"}":"]";break;case 222:f=a.mod2?'"':"'"}return f?g+f:a.keyCode>=112&&a.keyCode<=123?g+"F"+(a.keyCode-111):g+String.fromCharCode(a.keyCode)},getUserText:function(a,g,h,d,f,c,b,e,m){var n=!1,b=function(b){return function(l){if(!n){var e=j.node(a),
o=e.value;if(e)if(b&&l.keyCode===j.KEY.ESCAPE){if(h)g.style.display="inline";e.parentNode.removeChild(e);n=!0;c&&c()}else if(!(b&&l.keyCode!==j.KEY.ENTER)){if(o.length===0||!m&&o===d){if(h)g.style.display="inline"}else f(o);n=!0;e.parentNode&&e.parentNode.removeChild(e);c&&c()}}}},r=document.createElement("input");r.id=a;r.value=d||"";g.parentNode.insertBefore(r,g.nextSibling);r.classList.add("userEditBoxPrompt");if(h)g.style.display="none";r.addEventListener("keydown",b(!0),!1);r.addEventListener("blur",
b(!1),!1);window.setTimeout(function(){r.focus();if(d){var b=j.node(a),l=e?d.indexOf(e):-1;if(l>0)if(b.createTextRange)b=b.createTextRange(),b.collapse(!0),b.moveStart("character",0),b.moveEnd("character",l),b.select();else if(b.setSelectionRange)b.setSelectionRange(0,l);else{if(b.selectionStart!==void 0)b.selectionStart=0,b.selectionEnd=l}else b.select()}},0)},openInNewWindow:i,followLink:function(a,g){g&&i(g)?window.open(a):window.location=a},createButton:function(a,g){var h=document.createElement("span");
h.role="button";h.tabIndex=0;h.appendChild(document.createTextNode(a));h.className="commandButton commandMargins";h.addEventListener("click",function(a){g();j.stop(a)},!1);h.addEventListener("keydown",function(a){if(a.keyCode===j.KEY.ENTER||a.keyCode===j.KEY.SPACE)g(),j.stop(a)},!1);return h}}});
define("orion/webui/dropdown",["require","orion/webui/littlelib"],function(k,j){function i(a){this._init(a)}i.prototype={_init:function(a){this._dropdownNode=j.node(a.dropdown);if(!this._dropdownNode)throw"no dom node for dropdown found";this._triggerNode=j.$(".dropdownTrigger",this._dropdownNode.parentNode);if(!this._triggerNode)throw"no dom node for dropdown trigger found";this._populate=a.populate;var g=this;this._triggerNode.addEventListener("click",function(a){g.toggle()&&j.stop(a)},!1);this._triggerNode.tagName.toLowerCase()===
"span"&&this._triggerNode.addEventListener("keydown",function(a){if(a.keyCode===j.KEY.ENTER||a.keyCode===j.KEY.SPACE)g.toggle(),j.stop(a)},!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 a=this.getItems();if(a.length>0){if(!this._hookedAutoDismiss)j.addAutoDismiss([this._triggerNode,
this._dropdownNode],this.close.bind(this)),this._hookedAutoDismiss=!0;this._positionDropdown();this._triggerNode.classList.add("dropdownTriggerOpen");this._dropdownNode.classList.add("dropdownMenuOpen");a[0].focus();return!0}return!1},_positionDropdown:function(){this._dropdownNode.style.left="";var a=j.bounds(this._dropdownNode),g=j.bounds(this._boundingNode(this._triggerNode));if(a.left+a.width>g.left+g.width)this._dropdownNode.style.right=0},_boundingNode:function(a){return a.style.right!==""||
a.style.position==="absolute"||!a.parentNode||!a.parentNode.style?a:this._boundingNode(a.parentNode)},close:function(a){this._triggerNode.classList.remove("dropdownTriggerOpen");this._dropdownNode.classList.remove("dropdownMenuOpen");a&&this._triggerNode.focus();return!0},getItems:function(){var a=[],g=this;j.$$array("li:not(.dropdownSeparator) > .dropdownMenuItem",this._dropdownNode,!0).forEach(function(h){h.parentNode.parentNode===g._dropdownNode&&a.push(h)});return a},empty:function(){var a=this;
j.$$array("li",this._dropdownNode).forEach(function(g){g.parentNode===a._dropdownNode&&g.parentNode.removeChild(g)})},_dropdownKeyDown:function(a){if(a.keyCode===j.KEY.UP||a.keyCode===j.KEY.DOWN||a.keyCode===j.KEY.RIGHT||a.keyCode===j.KEY.ENTER||a.keyCode===j.KEY.LEFT){var g=this.getItems(),h=document.activeElement;if(g.length&&g.length>0&&h){var d=g.indexOf(h);d>=0&&(a.keyCode===j.KEY.UP&&d>0?(d--,g[d].focus()):a.keyCode===j.KEY.DOWN&&d<g.length-1?(d++,g[d].focus()):a.keyCode===j.KEY.ENTER||a.keyCode===
j.KEY.RIGHT?h.classList.contains("dropdownTrigger")&&h.dropdown&&h.dropdown.open():a.keyCode===j.KEY.LEFT&&h.parentNode.parentNode.classList.contains("dropdownMenuOpen")&&this.close(!0),j.stop(a))}}else a.keyCode===j.KEY.ESCAPE&&(this.close(!0),j.stop(a))}};i.prototype.constructor=i;return{Dropdown:i}});
define("orion/explorers/navigationUtils",[],function(){function k(i,a){if(!j&&i)i.push({domNode:a}),a.tabIndex=-1,a.style.outline="none"}var j=navigator.userAgent.indexOf("iPad")!==-1;return{addNavGrid:function(i,a,g){i&&(i=i.getGridNavHolder(a,!0))&&k(i,g)},generateNavGrid:k,removeNavGrid:function(i,a){if(i)for(var g=0;g<i.length;g++)if(i[g].domNode===a){i.splice(g,1);break}}}});
define("orion/fileUtils",["i18n!orion/nls/messages"],function(){return{makeRelative:function(k){if(!k)return k;var j=window.location.protocol+"//"+window.location.host;return k.indexOf(j)===0?k.substring(j.length):k},isAtRoot:function(k){return this.makeRelative(k).indexOf("/workspace")===0}}});
define("orion/favorites",["require","orion/fileUtils","orion/EventTarget"],function(k,j,i){function a(a){this._favorites=[];i.attach(this);this._init(a);this._initializeFavorites()}a.prototype={_init:function(a){this._registry=a.serviceRegistry;this._serviceRegistration=this._registry.registerService("orion.core.favorite",this)},_notifyListeners:function(){this.dispatchEvent({type:"favoritesChanged",navigator:this._favorites,registry:this._registry})},makeFavorites:function(a){for(var a=Array.isArray(a)?
a:[a],h=0;h<a.length;h++){var d=a[h],f=d.ChildrenLocation?d.ChildrenLocation:d.Location,f=j.makeRelative(f);this.addFavorite(d.Name,f,d.Directory)}this._storeFavorites();this._notifyListeners()},addFavoriteUrl:function(a){this.addFavorite(a,a,!1,!0)},addFavorite:function(a,h,d){this._favorites.push({name:a,path:h,directory:d,isFavorite:!0});this._favorites.sort(this._sorter);this._storeFavorites();this._notifyListeners()},removeFavorite:function(a){for(var h in this._favorites)if(this._favorites[h].path===
a){this._favorites.splice(h,1);break}this._favorites.sort(this._sorter);this._storeFavorites();this._notifyListeners()},renameFavorite:function(a,h){var d=!1,f;for(f in this._favorites)if(this._favorites[f].path===a){var c=this._favorites[f];if(c.name!==h)c.name=h,d=!0}d&&(this._favorites.sort(this._sorter),this._storeFavorites(),this._notifyListeners())},hasFavorite:function(a){for(var h in this._favorites)if(this._favorites[h].path===a)return!0;return!1},_SPECIAL_CHARS:"^$\\+[]().",queryFavorites:function(a){var h;
if(!a)return this._favorites;var d="";for(h=0;h<a.length;h++){var f=a.charAt(h);d+=f==="*"?".*":f==="?"?".?":this._SPECIAL_CHARS.indexOf(f)>=0?"\\"+f:f}d+=".*";a=RegExp(d);d=[];for(h in this._favorites)this._favorites[h].name.search(a)===0&&d.push(this._favorites[h]);return d},_initializeFavorites:function(){var a=this;this._registry.getService("orion.core.preference").getPreferences("/window/favorites").then(function(h){var d,h=h.get("navigate");typeof h==="string"&&(h=JSON.parse(h));if(h)for(d in h)h[d].isFavorite=
!0,a._favorites.push(h[d]);a._favorites.sort(a._sorter);a._notifyListeners()})},_storeFavorites:function(){var a=this._favorites;this._registry.getService("orion.core.preference").getPreferences("/window/favorites").then(function(h){h.put("navigate",a)})},_sorter:function(a,h){var d=a.name.toLowerCase(),f=h.name.toLowerCase();return d>f?1:d<f?-1:0},getFavorites:function(){return{navigator:this._favorites}}};a.prototype.constructor=a;return{FavoritesService:a}});
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(k,j){var i={root:j};Object.keys(k).forEach(function(a){typeof i[a]==="undefined"&&(i[a]=k[a])});return i});
define("orion/operationsClient",["i18n!orion/operations/nls/messages","orion/Deferred"],function(k,j){function i(a,f,c){return a[f].apply(a,c)}function a(a){this._location=a}function g(){var a=new j;a.reject(k["No Matching OperationService for location:"]+this._location);return a}function h(d){this._services=[];this._patterns=[];this._operationListeners=[];this._currentLongpollingIds=[];this._preferenceService=d.getService("orion.core.preference");for(var f=d.getServiceReferences("orion.core.operation"),
c=0;c<f.length;c++){var b=d.getService(f[c]);this._services[c]=b;b=f[c].getProperty("pattern")||".*";b[0]!=="^"&&(b="^"+b);this._patterns[c]=RegExp(b)}this._getService=function(b){if(!b)return this._services[0];for(var c=0;c<this._patterns.length;++c)if(this._patterns[c].test(b))return this._services[c];return new a(b)}}a.prototype={getOperation:g,getOperations:g,removeCompletedOperations:g,removeOperation:g,cancelOperation:g};a.prototype.constructor=a;h.prototype={getOperations:function(){var a=
new j;if(this._operations)return a.resolve(this._operations),a;var f=this;this._preferenceService.getPreferences("/operations").then(function(c){f._operations=c;a.resolve(f._operations)});return a},getOperation:function(a){return i(this._getService(a),"getOperation",arguments)},removeCompletedOperations:function(){for(var a=[],f=this,c=0;c<this._services.length;c++){var b=this._patterns[c],e=new j;a[c]=e.promise;i(this._services[c],"removeCompletedOperations").then(function(e){return function(a){Array.isArray(a)&&
f.getOperations.bind(f)().then(function(c){for(var d=c.keys(),l=0;l<d.length;l++){var p=d[l];b.test(p)&&a.indexOf(p)<0&&c.remove(p)}e.resolve()})}}(e),function(b){return function(e){b.reject(e)}}(e))}return j.all(a)},removeOperation:function(a){var f=this;return i(this._getService(a),"removeOperation",arguments).then(function(){f.getOperations.bind(f)().then(function(c){c.remove(a)})},function(a){return a},function(a){return a})}};h.prototype.constructor=h;return{OperationsClient:h}});
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(k,j){var i={root:j};Object.keys(k).forEach(function(a){typeof i[a]==="undefined"&&(i[a]=k[a])});return i});
define("orion/editor/regex",[],function(){return{escape:function(k){return k.replace(/([\\$\^*\/+?\.\(\)|{}\[\]])/g,"\\$&")},parse:function(k){return(k=/^\s*\/(.+)\/([gim]{0,3})\s*$/.exec(k))?{pattern:k[1],flags:k[2]}:null}}});
define("orion/URITemplate",[],function(){function k(a){this._text=a}function j(a,b){if(b==="U")return encodeURIComponent(a).replace(/[!'()*]/g,function(b){return"%"+b.charCodeAt(0).toString(16).toUpperCase()});if(b==="U+R")return encodeURI(a).replace(/%5B/g,"[").replace(/%5D/g,"]");if(b==="U+R-,")return encodeURI(a).replace(/%5B/g,"[").replace(/%5D/g,"]").replace(/,/g,"%2C");throw Error("Unknown allowed character set: "+b);}function i(a,b,e){for(var d=[],f=0;f<a.length;f++)typeof a[f]!=="undefined"&&
d.push(j(a[f],b));return d.join(e)}function a(a,b,e,d){for(var f=Object.keys(a),g=[],h=0;h<f.length;h++)typeof a[f[h]]!=="undefined"&&g.push(j(f[h],b)+e+j(a[f[h]],b));return g.join(d)}function g(a){if(a.length===0)throw Error("Invalid Expression: 0 length expression");(this._operator=d[a[0]])?a=a.substring(1):this._operator=d.NUL;for(var b=[],e=a.split(","),m=0;m<e.length;m++){var g=e[m].match(f);if(g===null)throw Error("Bad VarSpec: "+a);b.push({name:g[1],explode:!!g[2],prefix:g[3]?parseInt(g[3],
10):-1})}this._varSpecList=b}function h(a){for(var b=[],e=0,d=a.indexOf("{",e);d!==-1;){b.push(new k(a.substring(e,d)));e=a.indexOf("}",d+1);if(e===-1)throw Error("Invalid template: "+a);b.push(new g(a.substring(d+1,e)));e+=1;d=a.indexOf("{",e)}b.push(new k(a.substring(e)));this._templateComponents=b}var d={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-,"}},f=/^((?:(?:[a-zA-Z0-9_])|(?:%[0-9A-F][0-9A-F]))(?:(?:[a-zA-Z0-9_.])|(?:%[0-9A-F][0-9A-F]))*)(?:(\*)|:([0-9]+))?$/;k.prototype={expand:function(){return encodeURI(this._text)}};g.prototype={expand:function(c){for(var b=[],e=
0;e<this._varSpecList.length;e++){var d=this._varSpecList[e],f=d.name,g=c[f],h=typeof g;if(h!=="undefined"&&g!==null){var l=b.length===0?this._operator.first:this._operator.sep;if(h==="string")this._operator.named&&(l+=j(f,"U+R"),l+=g.length===0?this._operator.ifemp:"="),d.prefix!==-1&&d.prefix<g.length&&(g=g.substring(0,d.prefix)),l+=j(g,this._operator.allow);else if(Array.isArray(g))d.explode?l+=i(g,this._operator.allow,this._operator.sep):(this._operator.named&&(l+=j(f,"U+R"),l+=g.length===0?this._operator.ifemp:
"="),l+=i(g,this._operator.allow,","));else if(h==="object")d.explode?l+=a(g,this._operator.allow,"=",this._operator.sep):(this._operator.named&&(l+=j(f,"U+R"),l+=Object.keys(g).length===0?this._operator.ifemp:"="),l+=a(g,this._operator.allow,",",","));else throw Error("bad param type: "+f+" : "+h);b.push(l)}}return b.join("")}};h.prototype={expand:function(a){for(var b=[],e=0;e<this._templateComponents.length;e++)b.push(this._templateComponents[e].expand(a));return b.join("")}};return h});
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(k,j){var i={root:j};Object.keys(k).forEach(function(a){typeof i[a]==="undefined"&&(i[a]=k[a])});return i});
define("orion/parameterCollectors",["i18n!orion/nls/messages","require","orion/webui/littlelib"],function(k,j,i){function a(a,h){this._activeContainer=null;this._getElementsFunction=a;this._toolbarLayoutFunction=h}a.prototype={close:function(){if(this._activeElements){this._activeElements.parameterArea&&i.empty(this._activeElements.parameterArea);this._activeElements.slideContainer&&this._activeElements.slideContainer.classList.remove("slideContainerActive");this._activeElements.dismissArea&&i.empty(this._activeElements.dismissArea);
this._activeElements.commandNode&&this._activeElements.commandNode.classList.remove("activeCommand");this._toolbarLayoutFunction(this._activeElements);if(this._activeElements.onClose)this._activeElements.onClose();if(this._oldFocusNode)this._oldFocusNode.focus(),this._oldFocusNode=null}this._activeElements=null},open:function(a,h,d){typeof a==="string"&&(a=i.node(a));if(this._activeElements&&this._activeElements.slideContainer&&this._activeElements.commandNode===a)return this._activeElements.focusNode&&
this._activeElements.focusNode.focus(),!0;this.close();this._activeElements=null;if((this._activeElements=this._getElementsFunction(a))&&this._activeElements.parameterArea&&this._activeElements.slideContainer){this._activeElements.onClose=d;var f=h(this._activeElements.parameterArea,this._activeElements.dismissArea);if(!f)return!1;this._activeElements.focusNode=f;a=i.$$array("#closebox",this._activeElements.dismissArea||this._activeElements.parameterArea);if(a.length===0){h=this._activeElements.dismissArea||
this._activeElements.parameterArea;a=document.createElement("span");a.id="closebox";a.role="button";a.tabIndex=0;a.classList.add("imageSprite");a.classList.add("core-sprite-close");a.classList.add("dismiss");a.title=k.Close;h.appendChild(a);var c=this;a.addEventListener("click",function(){c.close()},!1);a.addEventListener("keydown",function(b){(b.keyCode===i.KEY.ENTER||b.keyCode===i.KEY.SPACE)&&c.close()},!1)}this._activeElements.slideContainer.classList.add("slideContainerActive");this._toolbarLayoutFunction(this._activeElements);
if(f)this._oldFocusNode=window.document.activeElement,window.setTimeout(function(){f.focus();f.select()},0);this._activeElements.commandNode&&this._activeElements.commandNode.classList.add("activeCommand");return!0}return!1},_collectAndCall:function(a,h){i.$$array("input",h).forEach(function(d){d.type==="checkbox"?a.parameters.setValue(d.parameterName,d.checked):d.type!=="button"&&a.parameters.setValue(d.parameterName,d.value.trim())});i.$$array("textArea",h).forEach(function(d){a.parameters.setValue(d.parameterName,
d.value.trim())});a.command.callback&&a.command.callback.call(a.handler,a)},collectParameters:function(a){return a.parameters?(a.domNode&&a.domNode.classList.add("commandMarker"),this.open(a.domNode||a.domParent,this.getFillFunction(a))):!1},getFillFunction:function(a,h){var d=this;return function(f,c){var b=null,e=function(){h&&h();d.close()},m=function(l){l.keyCode===i.KEY.ENTER&&d._collectAndCall(a,f);if(l.keyCode===i.KEY.ESCAPE||l.keyCode===i.KEY.ENTER)e(),i.stop(l)};a.parameters.forEach(function(l){var a=
null;if(l.label)a=document.createElement("label"),a.classList.add("parameterInput"),a.setAttribute("for",l.name+"parameterCollector"),a.textContent=l.label,f.appendChild(a);var c=l.name+"parameterCollector",d=a||f;if(l.type==="text"&&typeof l.lines==="number"&&l.lines>1)a=document.createElement("textarea"),a.rows=l.lines,a.type="textarea",a.id=c,d.appendChild(a),m=function(l){l.keyCode===i.KEY.ESCAPE&&(e(),i.stop(l))};else if(l.type==="boolean"){if(a=document.createElement("input"),a.type="checkbox",
a.id=c,d.appendChild(a),l.value)a.checked=!0}else if(a=document.createElement("input"),a.type=l.type,a.id=c,d.appendChild(a),l.value)a.value=l.value;a.classList.add("parameterInput");a.classList.add("parameterInput"+a.type);a.setAttribute("speech","speech");a.setAttribute("x-webkit-speech","x-webkit-speech");a.parameterName=l.name;b||(b=a);a.addEventListener("keydown",m,!1)});var n=c;if(!n)n=document.createElement("span"),n.className="layoutRight parametersDismiss",f.appendChild(n);var r=function(l){l._collectAndCall(a,
f);e()},q=function(l,b){var a=document.createElement("span");a.role="button";a.tabIndex=0;b.appendChild(a);l&&a.appendChild(document.createTextNode(l));a.classList.add("dismiss");return a};if(a.parameters.hasOptionalParameters()){a.parameters.optionsRequested=!1;var l=q(k.More,n);l.addEventListener("click",function(){a.parameters.optionsRequested=!0;r(d)},!1);l.addEventListener("keydown",function(l){if(l.keyCode===i.KEY.ENTER||l.keyCode===i.KEY.SPACE)a.parameters.optionsRequested=!0,r(d)},!1)}l=q(k.Submit,
n);l.addEventListener("click",function(){r(d)},!1);l.addEventListener("keydown",function(l){(l.keyCode===i.KEY.ENTER||l.keyCode===i.KEY.SPACE)&&r(d)},!1);n=q(null,n);n.id="closebox";n.classList.add("imageSprite");n.classList.add("core-sprite-close");n.title=k.Close;n.addEventListener("click",function(){e()},!1);n.addEventListener("keydown",function(l){(l.keyCode===i.KEY.ENTER||l.keyCode===i.KEY.SPACE)&&e()},!1);return b}}};a.prototype.constructor=a;return{CommandParameterCollector:a}});
(function(){function k(b){return b?b.slice(1).split("&"):[]}function j(b){return b.length===0?"":"?"+b.join("&")}function i(b){var a=/([^=]*)(?:=?)(.*)/.exec(b),b=a[1]?decodeURIComponent(a[1]):"",a=a[2]?decodeURIComponent(a[2]):"";return[b,a]}function a(b){var a=encodeURIComponent(b[0]);b[1]&&(a+="="+encodeURIComponent(b[1]));return a}function g(b,a){var e="",l=[],c=0;return{next:function(){if(e!==b.search)e=b.search,l=k(e);if(c<l.length){var o=i(l[c++]);switch(a){case "keys":return o[0];case "values":return o[1];
case "keys+values":return[o[0],o[1]];default:throw new TypeError;}}throw m;}}}function h(b){if(typeof b!=="string")throw new TypeError;}function d(b){var a=b.protocol;return!a||a===":"||a==="http:"&&!b.hostname?!1:!0}function f(b){Object.defineProperty(this,"_anchor",{value:b})}function c(b,a){b=b||"";if(typeof b!=="string")throw new TypeError("url");a=a?a.href||a:"";if(typeof a!=="string")throw new TypeError("base");Object.defineProperty(this,"_input",{value:b,writable:!0});var e=document.implementation.createHTMLDocument("");
if(a){var l=e.createElement("a");l.href=a;if(l.protocol.length<2||!l.host)throw Error("InvalidStateError");var c=e.createElement("base");c.href=l.href;e.head.appendChild(c)}var o=e.createElement("a");o.href=b;e.body.appendChild(o);Object.defineProperty(this,"_urlAnchor",{value:o});var u=new f(o);Object.defineProperty(this,"query",{get:function(){return d(o)?u:null},enumerable:!0})}try{if(typeof window.URL==="function"&&window.URL.length!==0&&(new window.URL("http://www.w3.org")).protocol==="http:")return}catch(b){}var e=
/([^:]*):?(.*)/,m=typeof StopIteration!=="undefined"?StopIteration:Error("Stop Iteration");Object.defineProperties(f.prototype,{get:{value:function(b){h(b);var a;k(this._anchor.search).some(function(e){e=i(e);if(e[0]===b)return a=e[1],!0});return a},enumerable:!0},set:{value:function(b,e){h(b);h(e);var c=k(this._anchor.search);c.some(function(l,p){var o=i(l);if(o[0]===b)return o[1]=e,c[p]=a(o),!0})||c.push(a([b,e]));this._anchor.search=j(c)},enumerable:!0},has:{value:function(b){h(b);return k(this._anchor.search).some(function(a){if(i(a)[0]===
b)return!0})},enumerable:!0},"delete":{value:function(b){h(b);var a=k(this._anchor.search),e=a.filter(function(l){return i(l)[0]!==b});return e.length!==a.length?(this._anchor.search=j(e),!0):!1},enumerable:!0},clear:{value:function(){this._anchor.search=""},enumerable:!0},forEach:{value:function(b,a){if(typeof b!=="function")throw new TypeError;var e=g(this._anchor,"keys+values");try{for(;;){var l=e.next();b.call(a,l[1],l[0],this)}}catch(c){if(c!==m)throw c;}},enumerable:!0},keys:{value:function(){return g(this._anchor,
"keys")},enumerable:!0},values:{value:function(){return g(this._anchor,"values")},enumerable:!0},items:{value:function(){return g(this._anchor,"keys+values")}},size:{get:function(){return k(this._anchor.search).length},enumerable:!0},getAll:{value:function(b){h(b);var a=[];k(this._anchor.search).forEach(function(e){e=i(e);e[0]===b&&a.push(e[1])});return a},enumerable:!0},append:{value:function(b,e){h(b);h(e);var c=k(this._anchor.search);c.push(a([b,e]));this._anchor.search=j(c)},enumerable:!0}});
Object.defineProperties(c.prototype,{href:{get:function(){return d(this._urlAnchor)?this._urlAnchor.href:this._input},set:function(b){h(b);this._input=b;this._urlAnchor.href=b},enumerable:!0},origin:{get:function(){return d(this._urlAnchor)?this._urlAnchor.protocol+"//"+this._urlAnchor.host:""},enumerable:!0},protocol:{get:function(){return d(this._urlAnchor)?this._urlAnchor.protocol:":"},set:function(b){h(b);this._urlAnchor.protocol=b},enumerable:!0},_userinfo:{get:function(){return!d(this._urlAnchor)?
"":RegExp("^"+this._urlAnchor.protocol+"(\\/\\/)(?:([^@]*)?@)?"+this._urlAnchor.host).exec(this._urlAnchor.href)[2]||""},set:function(b){h(b);this._urlAnchor.href=this._urlAnchor.href.replace(RegExp("^"+this._urlAnchor.protocol+"(\\/\\/)(?:([^@]*)?@)?"+this._urlAnchor.host),this._urlAnchor.protocol+"//"+(b?b+"@":"")+this._urlAnchor.host)}},username:{get:function(){if(!d(this._urlAnchor))return"";var b=e.exec(this._userinfo);return decodeURIComponent(b[1]||"")},set:function(b){h(b);var a=e.exec(this._userinfo),
b=[encodeURIComponent(b||"")];a[2]&&b.push(a[2]);this._userinfo=b.join(":")},enumerable:!0},password:{get:function(){if(!d(this._urlAnchor))return"";var b=e.exec(this._userinfo);return decodeURIComponent(b[2]||"")},set:function(b){h(b);var a=[e.exec(this._userinfo)[1]||""];b&&a.push(encodeURIComponent(b));this._userinfo=a.join(":")},enumerable:!0},host:{get:function(){return d(this._urlAnchor)?this._urlAnchor.host:""},set:function(b){h(b);this._urlAnchor.host=b},enumerable:!0},hostname:{get:function(){return d(this._urlAnchor)?
this._urlAnchor.hostname:""},set:function(b){h(b);this._urlAnchor.hostname=b},enumerable:!0},port:{get:function(){return d(this._urlAnchor)?this._urlAnchor.port:""},set:function(b){h(b);this._urlAnchor.port=b},enumerable:!0},pathname:{get:function(){return d(this._urlAnchor)?this._urlAnchor.pathname:""},set:function(b){h(b);this._urlAnchor.pathname=b},enumerable:!0},search:{get:function(){return d(this._urlAnchor)?this._urlAnchor.search:""},set:function(b){h(b);this._urlAnchor.search=b},enumerable:!0},
hash:{get:function(){return d(this._urlAnchor)?this._urlAnchor.hash:""},set:function(b){h(b);this._urlAnchor.hash=b},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/breadcrumbs",["require","orion/webui/littlelib"],function(k,j){function i(a){this._init(a)}i.prototype={_init:function(a){var g=j.node(a.container);if(!g)throw"no parent container";this._container=g;g.classList.remove("currentLocation");this._id=a.id||"eclipse.breadcrumbs";this._resource=a.resource||null;this._rootSegmentName=a.rootSegmentName;this._workspaceRootSegmentName=a.workspaceRootSegmentName;this._makeHref=a.makeHref;this.path="";this.render()},getNavigatorWorkspaceRootSegment:function(){if(this._workspaceRootSegmentName){var a;
this._resource&&this._resource.Parents?(a=document.createElement("a"),this._makeHref?this._makeHref(a,""):a.href=k.toUrl("navigate/table.html")+"#"):a=document.createElement("span");j.empty(a);a.appendChild(document.createTextNode(this._workspaceRootSegmentName));return a}return null},render:function(){var a=this._container,g=j.node(this._id);g?j.empty(g):(g=document.createElement("span"),g.id=this._id,a.appendChild(g));var h;if(h=this.getNavigatorWorkspaceRootSegment())if(h.classList.add("breadcrumb"),
g.appendChild(h),this._resource&&this._resource.Parents)h=document.createElement("span"),h.appendChild(document.createTextNode(" / ")),this.path+="/",h.classList.add("breadcrumbSeparator"),g.appendChild(h);else{h.href="";h.classList.remove("breadcrumb");h.classList.add("currentLocation");return}a=this._rootSegmentName;if(this._resource){if(this._resource.Parents)for(var d=this._resource.Parents,f=d.length;--f>=0;)h=document.createElement("a"),h.classList.add("breadcrumb"),a?(h.appendChild(document.createTextNode(a)),
a=null):h.appendChild(document.createTextNode(d[f].Name)),this.path+=d[f].Name,this._makeHref?this._makeHref(h,d[f].Location):h.href=k.toUrl("navigate/table.html")+"#"+d[f].ChildrenLocation,g.appendChild(h),h=document.createElement("span"),h.appendChild(document.createTextNode(" / ")),this.path+="/",h.classList.add("breadcrumbSeparator"),g.appendChild(h);h=document.createElement("span");a?(h.appendChild(document.createTextNode(a)),a=null):h.appendChild(document.createTextNode(this._resource.Name));
h.classList.add("currentLocation");this.path+=this._resource.Name;g.appendChild(h)}g.childNodes.length===0&&(h=document.createElement("span"),h.appendChild(document.createTextNode(a||document.title)),h.classList.add("breadcrumb"),h.classList.add("currentLocation"),g.appendChild(h))}};i.prototype.constructor=i;return{BreadCrumbs:i}});
define("orion/webui/splitter",["require","orion/webui/littlelib"],function(k,j){function i(a){this._init(a)}i.prototype={_init:function(a){this._tracking=null;this._resizeListeners=[];this._animationDelay=501;this.$node=j.node(a.node);if(!this.$node)throw"no dom node for splitter found";this.$sideNode=j.node(a.sidePanel);if(!this.$sideNode)throw"no dom node for side panel found";this.$mainNode=j.node(a.mainPanel);if(!this.$mainNode)throw"no dom node for main panel found";this._vertical=a.vertical;
this._prefix="/orion/splitter/"+(this.$node.id||document.body.id||"");if(a.toggle)this._thumb=document.createElement("div"),this.$node.appendChild(this._thumb),this._thumb.classList.add("splitThumb"),this._thumb.classList.add("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(a){this._resizeListeners.push(a)},_initializeFromStoredSettings:function(){this._closed=localStorage.getItem(this._prefix+"/toggleState")==="closed";var a;if(this._vertical){if(a=localStorage.getItem(this._prefix+"/yPosition"))this._splitTop=
parseInt(a,10)}else if(a=localStorage.getItem(this._prefix+"/xPosition"))this._splitLeft=parseInt(a,10)},_adjustToSplitPosition:function(a){var g=j.bounds(this.$node),h=j.bounds(this.$node.parentNode);if(this._vertical){this._splitHeight=g.height;if(a||!this._splitTop)this._splitTop=g.top,localStorage.setItem(this._prefix+"/yPosition",this._splitTop);a=this._splitTop;this.$node.parentNode.style.position==="relative"&&(a=this._splitTop-h.top);this.$sideNode.style.height=a+"px";this.$sideNode.style.bottom=
a-1+"px";this.$sideNode.style.display="block";this.$node.style.top=a+"px"}else{this._splitWidth=g.width;if(a||!this._splitLeft)this._splitLeft=g.left,localStorage.setItem(this._prefix+"/xPosition",this._splitLeft);a=this._splitLeft;this.$node.parentNode.style.position==="relative"&&(a=this._splitLeft-h.left);this.$sideNode.style.width=a+"px";this.$sideNode.style.right=a-1+"px";this.$sideNode.style.display="block";this.$node.style.left=a+"px"}this._resize()},_resize:function(a){var a=a||0,g=j.bounds(this.$node.parentNode),
h=j.bounds(this.$node);this._vertical?this.$mainNode.style.height=g.height-(h.top-g.top+h.height)+"px":this.$mainNode.style.width=g.width-(h.left-g.left+h.width)+"px";var d=this;window.setTimeout(function(){d._notifyResizeListeners(d.$mainNode)},a);window.setTimeout(function(){d._notifyResizeListeners(d.$sideNode)},a)},_notifyResizeListeners:function(a){for(var g=0;g<this._resizeListeners.length;g++)this._resizeListeners[g](a)},_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 a=this;window.setTimeout(function(){a.$sideNode.classList.remove("sidePanelLayoutAnimation");a.$mainNode.classList.remove("mainPanelLayoutAnimation");a.$node.classList.remove("splitLayoutAnimation");a._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(a){if(a.target===this._thumb)return j.stop(a),this._thumbDown(a);if(!this._tracking)this.$node.classList.add("splitTracking"),this.$mainNode.classList.add("panelTracking"),this.$sideNode.classList.add("panelTracking"),this._tracking=this._mouseMove.bind(this),window.addEventListener("mousemove",this._tracking),j.stop(a)},_mouseMove:function(a){if(this._tracking){var g;this._vertical?(g=this._splitTop=a.clientY,this.$node.parentNode.style.position===
"relative"&&(g=j.bounds(this.$node.parentNode),g=this._splitTop-g.top),this.$node.style.top=g+"px"):(g=this._splitLeft=a.clientX,this.$node.parentNode.style.position==="relative"&&(g=j.bounds(this.$node.parentNode),g=this._splitLeft-g.left),this.$node.style.left=g+"px");this._adjustToSplitPosition(!0);j.stop(a)}},_mouseUp:function(a){if(this._tracking)window.removeEventListener("mousemove",this._tracking),this._tracking=null,this.$node.classList.remove("splitTracking"),this.$mainNode.classList.remove("panelTracking"),
this.$sideNode.classList.remove("panelTracking"),j.stop(a)}};i.prototype.constructor=i;return{Splitter:i}});
define("orion/widgets/themes/ThemeClass",[],function(){function k(j){this.attributes=[];this.element=document.createElement("div");this.style=this.element.style;this.className=j;this.classString="."+j+"{ "}k.prototype.className=null;k.prototype.classString=void 0;k.prototype.style=void 0;k.prototype.closeString=" }\n";k.prototype.toString=function(){return this.classString=this.classString+this.style.cssText+this.closeString};return{ThemeClass:k}});
define("orion/widgets/themes/container/ThemeSheetWriter",["orion/widgets/themes/ThemeClass"],function(k){function j(){}j.prototype.navbar="#333";j.prototype.button="#777777";j.prototype.location="#EFEFEF";j.prototype.selection="FEC";j.prototype.sidepanel="#FBFBFB";j.prototype.mainpanel="white";j.prototype.navtext="#bfbfbf";j.prototype.content="#3087B3";j.prototype.search="#444";j.prototype.toolpanel="white";j.prototype.writeNavigationStyle=function(){var i="",a=[],g=new k.ThemeClass("orionPage");
g.style.backgroundColor="#fdfdfd";g.style.width="100%";g.style.height="100%";a.push(g);g=new k.ThemeClass("topRowBanner");g.style.margin="0";g.style.border="0";g.style.backgroundColor=this.navbar;g.style.background="-webkit-gradient(linear, left top, left bottom, color-stop(0%,"+this.navbar+"), color-stop(100%,"+this.navbar+"))";g.style.background="-moz-linear-gradient(top,"+this.navbar+"0%,"+this.navbar+"100%)";g.style.height="28px";a.push(g);g=new k.ThemeClass("a");g.style.textDecoration="none";
g.style.color=this.content;a.push(g);g=new k.ThemeClass("navlink");g.style.display="inline-block";g.style.padding="2px";g.style.color=this.content;a.push(g);g=new k.ThemeClass("primaryNav");g.style.color=this.navtext;g.style.fontSize="8pt";g.style.fontWeight="normal";g.style.paddingTop="6px";g.style.verticalAlign="baseline";a.push(g);g=new k.ThemeClass("primaryNav a");g.style.fontSize="8pt";g.style.color=this.navtext;g.style.marginRight="6px";g.style.marginLeft="6px";g.style.verticalAlign="baseline";
g.style.textDecoration="none";a.push(g);g=new k.ThemeClass("primaryNav a:hover");g.style.color="#bfbfbf";g.style.cursor="hand";g.style.color="white";g.style.fontWeight="normal";a.push(g);for(var h in a)i+=a[h].toString();return i};j.prototype.writeLocationStyle=function(){var i="",a=[],g=new k.ThemeClass("titleArea");g.style.margin="0";g.style.paddingTop="5px";g.style.border="0";g.style.background=this.location;g.style.background="-webkit-gradient(linear, left top, left bottom, color-stop(0%,"+this.location+
"), color-stop(100%,"+this.location+"))";g.style.borderBottom="1px solid "+this.location;g.style.minHeight="20px";a.push(g);g=new k.ThemeClass("breadcrumb");g.style.fontSize="8pt";g.style.textDecoration="none";g.style.color=this.content;g.style.paddingTop="2px";a.push(g);g=new k.ThemeClass("a.breadcrumb:hover");g.style.textDecoration="none";g.style.borderBottom="1px dotted";g.style.color="#F58B0F";g.style.cursor="pointer";a.push(g);g=new k.ThemeClass("breadcrumbSeparator");g.style.fontSize="8pt";
g.style.textDecoration="none";g.style.color=this.navbar;g.style.fontWeight="bold";a.push(g);g=new k.ThemeClass("currentLocation");g.style.fontWeight="bold";g.style.fontSize="8pt";g.style.color=this.navbar;g.style.textDecoration="none";g.style.textWrap="normal";g.style.lineHeight="10pt";a.push(g);g=new k.ThemeClass("a.currentLocation:hover");g.style.fontWeight="bold";g.style.fontSize="10pt";g.style.color="#666666";g.style.textDecoration="none";g.style.borderBottom="0";a.push(g);g=new k.ThemeClass("navlinkonpage");
g.style.color=this.content;a.push(g);for(var h in a)i+=a[h].toString();return i};j.prototype.writeButtonStyle=function(){var i="",a=[],g=new k.ThemeClass("commandButton");g.style.color="#222";g.style.border="1px solid #dedede";g.style.backgroundColor=this.button;g.style.textAlign="center";g.style.verticalAlign="baseline";g.style.cursor="pointer";g.style.display="inline-block";g.style.padding="6px";g.style.paddingTop="4px";g.style.borderRadius="1px";g.style.lineHeight="12px";g.style.fontSize="8pt";
g.style.userSelect="none";a.push(g);g=new k.ThemeClass("commandButton:over");g.style.backgroundColor="#e6e6e6";g.style.border="1px solid #808080";a.push(g);g=new k.ThemeClass("commandMenu");g.style.color="#222";g.style.display="inline-block";g.style.verticalAlign="baseline";g.style.margin="0";g.style.fontSize="8pt";g.style.fontWeight="normal";g.style.border="1px solid #dedede";g.style.backgroundColor="#efefef";g.style.cursor="pointer";g.style.borderRadius="1px";a.push(g);g=new k.ThemeClass("commandMenuItem");
g.style.border="0";g.style.padding="0";g.style.margin="0";a.push(g);for(var h in a)i+=a[h].toString();return i};j.prototype.writeMainStyle=function(){var i="",a=[],g=new k.ThemeClass("searchbox");g.style.backgroundImage="url(../images/core_sprites.png)";g.style.backgroundRepeat="no-repeat";g.style.backgroundPosition="4px -297px";g.style.width="12px";g.style.height="12px";g.style.backgroundColor=this.search;g.style.border="1px solid "+this.search;g.style.fontSize="11px";g.style.width="15em";g.style.height=
"16px";g.style.borderRadius="10px";g.style.color="#999";g.style.padding="0";g.style.paddingLeft="20px";g.style.marginLeft="5px";g.style.marginTop="6px !important";g.style.font="7pt Lucida Sans Unicode,Lucida Grande,Verdana,Arial,Helvetica,Myriad,Tahoma,clean,sans-serif !important";a.push(g);g=new k.ThemeClass("searchbox:focus");g.style.color="white";g.style.outline="none";a.push(g);g=new k.ThemeClass("checkedRow");g.style.cssText="background-color:"+this.selection+" !important;";a.push(g);g=new k.ThemeClass("navbar-item-selected");
g.style.background=this.selection;g.style.color=this.content;a.push(g);g=new k.ThemeClass("auxpane");g.style.border="0";g.style.background=this.sidepanel;g.style.background="-webkit-gradient(linear, left top, left bottom, color-stop(0%,"+this.sidepanel+"), color-stop(100%,"+this.sidepanel+"))";g.style.background="-moz-linear-gradient(top, "+this.sidepanel+" 0%, "+this.sidepanel+" 100%)";g.style.overflowX="auto";g.style.minWidth="200px";g.style.paddingTop="16px";a.push(g);g=new k.ThemeClass("mainpane");
g.style.background=this.mainpanel;g.style.border=0;a.push(g);g=new k.ThemeClass("mainToolbar");g.style.background=this.toolpanel;g.style.height="31px";g.style.borderBottom="1px solid #ebebeb";a.push(g);for(var h in a)i+=a[h].toString();return i};j.prototype.render=function(){console.log(this.writeNavigationStyle());console.log(this.writeLocationStyle());console.log(this.writeMainStyle());console.log(this.writeButtonStyle())};j.prototype.getSheet=function(i){i.navbar.value?(this.navbar=i.navbar.value,
this.button=i.button.value,this.location=i.location.value,this.selection=i.selection.value,this.sidepanel=i.sidepanel.value,this.mainpanel=i.mainpanel.value,this.navtext=i.navtext.value,this.search=i.search.value,this.content=i.content.value,this.toolpanel=i.toolpanel.value):(this.navbar=i.navbar,this.button=i.button,this.location=i.location,this.selection=i.selection,this.sidepanel=i.sidepanel,this.mainpanel=i.mainpanel,this.navtext=i.navtext,this.search=i.search,this.content=i.content,this.toolpanel=
i.toolpanel);return this.writeNavigationStyle()+this.writeLocationStyle()+this.writeMainStyle()+this.writeButtonStyle()};return{ThemeSheetWriter:j}});
define("orion/inputCompletion/inputCompletion",[],function(){function k(j,i,a){this._inputField=j;if(typeof this._inputField==="string")this._inputField=document.getElementById(this._inputField);this._binderFunc=i;(j=a?a.group:null)||(j=this._inputField.id?this._inputField.id:"default__input__group");this._completionIdPrefix=j+"__completion__";this._proposeFromStart=a?a.proposeFromStart:!1;this._extendedProvider=a?a.extendedProvider:null;this._proposalIndex=-1;this._dismissed=!0;this._mouseDown=!1;
this._dataList=[];this._initUI();var g=this;this._completionUIContainer.addEventListener("mousedown",function(){g._mouseDown=!0});this._completionUIContainer.addEventListener("mouseup",function(){g._mouseDown=!1});this._inputField.addEventListener("blur",function(){g._mouseDown?window.setTimeout(function(){g._inputField.focus()},200):g._dismiss()});this._inputField.addEventListener("keydown",function(a){g.onKeyDown(a)});this._inputField.addEventListener("input",function(){g._proposeOn(g._inputField.value)});
this._inputField.addEventListener("focus",function(){if(g._dismissed&&g._binderFunc)g._dismissing?g._dismissing=!1:g._binderFunc&&g._binderFunc(function(a){g._bind(a);g._proposeOn(g._inputField.value)})})}k.prototype.onKeyDown=function(j){if(this._dismissed)return!0;var i=j.charCode||j.keyCode;if(i===13){if(this._proposalList&&this._proposalList.length>0&&this._proposalIndex>=0&&this._proposalIndex<this._proposalList.length)return j.preventDefault(),this._dismiss(this._proposalList[this._proposalIndex].item.value,
j.ctrlKey),j.stopPropagation(),!1}else if((i===40||i===38)&&this._proposalList&&this._proposalList.length>0)return j.preventDefault(),this._walk(i===40),j.stopPropagation(),!1;else if(i===27)return j.preventDefault(),this._dismiss(),!1;return!0};k.prototype._bind=function(j){this._dataList=j};k.prototype._getUIContainerID=function(){return this._completionIdPrefix+"UIContainer"};k.prototype._getUIProposalListId=function(){return this._completionIdPrefix+"UIProposalList"};k.prototype._initUI=function(){this._completionUIContainer=
document.getElementById(this._getUIContainerID());if(!this._completionUIContainer)this._completionUIContainer=document.createElement("div"),this._completionUIContainer.id=this._getUIContainerID(),this._completionUIContainer.style.display="none",this._completionUIContainer.className="inputCompletionContainer",this._completionUIContainer.setAttribute("role","list"),this._completionUIContainer.setAttribute("aria-atomic","true"),this._completionUIContainer.setAttribute("aria-live","assertive"),document.body.appendChild(this._completionUIContainer);
this._completionUIContainer.textContent="";this._completionUL=document.getElementById(this._getUIProposalListId());if(!this._completionUL)this._completionUL=document.createElement("ul"),this._completionUL.id=this._getUIProposalListId(),this._completionUL.className="inputCompletionUL";this._completionUL.textContent="";this._completionUIContainer.appendChild(this._completionUL)};k.prototype._createProposalLink=function(j,i,a,g){var h=document.createElement("a");h.href=require.toUrl(i);h.appendChild(this._createBoldText(j,
a,g));return h};k.prototype._createBoldText=function(j,i,a){if(i<0)return document.createTextNode(j);var g=document.createElement("span"),h;0!==i&&(h=document.createTextNode(j.substring(0,i)),g.appendChild(h));var d=document.createElement("b");g.appendChild(d);h=document.createTextNode(j.substring(i,i+a));d.appendChild(h);i+a<j.length-1&&(h=document.createTextNode(j.substring(i+a)),g.appendChild(h));return g};k.prototype._proposeOnCategory=function(j,i){if(i.length!==0){var a=this;if(j){var g=document.createElement("li");
g.className="inputCompletionLICategory";var h=document.createTextNode(j);g.appendChild(h);this._completionUL.appendChild(g)}for(h=0;h<i.length;h++){g=document.createElement("li");g.onmouseover=function(d){a._selectProposal(d.currentTarget)};g.onclick=function(d){a._dismiss(d.currentTarget.completionItem.value)};g.className="inputCompletionLINormal";g.completionItem=i[h].item;if(typeof i[h].item.value==="string"){var d=this._createBoldText(i[h].item.value,i[h].boldIndex,i[h].boldLength);g.appendChild(d)}else i[h].item.value.name&&
i[h].item.value.type==="link"&&g.appendChild(this._createProposalLink(i[h].item.value.name,i[h].item.value.value,i[h].boldIndex,i[h].boldLength));this._completionUL.appendChild(g);this._proposalList.push({item:i[h].item,domNode:g})}}};k.prototype._domNode2Index=function(j){for(var i=0;i<this._proposalList.length;i++)if(this._proposalList[i].domNode===j)return i;return-1};k.prototype._highlight=function(j,i){var a=j,g=!1;isNaN(a)||(g=!0,a=this._proposalList&&j>=0&&j<this._proposalList.length?this._proposalList[j].domNode:
null);if(a)a.className=i?"inputCompletionLISelected":"inputCompletionLINormal",i&&g&&(a.offsetTop<this._completionUIContainer.scrollTop?a.scrollIntoView(!0):a.offsetTop+a.offsetHeight>this._completionUIContainer.scrollTop+this._completionUIContainer.clientHeight&&a.scrollIntoView(!1))};k.prototype._selectProposal=function(j){var i=j;isNaN(i)&&(i=this._domNode2Index(j));if(i!==this._proposalIndex)this._highlight(this._proposalIndex,!1),this._proposalIndex=i,this._highlight(this._proposalIndex,!0)};
k.prototype._dismiss=function(j,i){if(!this._mouseDown){this._dismissed=!0;this._proposalList=null;this._proposalIndex=-1;if(typeof j==="string")this._inputField.value=j,this._dismissing=!0,this._inputField.focus();else if(j&&j.name&&j.type==="link")i?window.open(j.value):window.location.href=j.value;var a=this;window.setTimeout(function(){a._completionUIContainer.style.display="none"},200)}};k.prototype._show=function(){if(this._proposalList&&this._proposalList.length>0){for(var j=0,i=0,a=this._inputField;a;)j+=
a.offsetLeft,i+=a.offsetTop,a=a.offsetParent;this._completionUIContainer.style.display="block";this._completionUIContainer.style.top=i+this._inputField.offsetHeight+2+"px";this._completionUIContainer.style.left=j+"px";this._completionUIContainer.style.width=this._inputField.offsetWidth+"px";this._dismissed=this._mouseDown=!1}else this._dismissed=!0,this._proposalList=null,this._proposalIndex=-1,this._completionUIContainer.style.display="none"};k.prototype._walk=function(j){j=this._proposalIndex+(j?
1:-1);j<-1?j=this._proposalList.length-1:j>=this._proposalList.length&&(j=-1);this._selectProposal(j)};k.prototype._proposeOnList=function(j,i,a){for(var g="",h=[],d=i?i.length:0,f=0;f<j.length;f++)if(j[f].type==="category")this._proposeOnCategory(g,h),g=j[f].label,h=[];else{var c=!0,b=-1;if(i&&a){var e;typeof j[f].value==="string"?e=j[f].value.toLowerCase():j[f].value.name&&(e=j[f].value.name.toLowerCase());b=e.indexOf(i);b<0?c=!1:this._proposeFromStart&&(c=b===0)}c&&h.push({item:j[f],boldIndex:b,
boldLength:d})}this._proposeOnCategory(g,h)};k.prototype._proposeOn=function(j){this._completionUL.textContent="";var i=j?j.toLowerCase():null;this._proposalList=[];this._proposeOnList(this._dataList,i,!0);if(this._extendedProvider&&i){var a=this;this._extendedProvider(j,function(g){if(g)for(var h=0;h<g.length;h++)a._proposeOnList(g[h].proposals,g[h].filterForMe?i:j,g[h].filterForMe);a._show()},[])}else this._show()};k.prototype.constructor=k;return{InputCompletion:k}});
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(k,j){var i={root:j};Object.keys(k).forEach(function(a){typeof i[a]==="undefined"&&(i[a]=k[a])});return i});
define("orion/webui/dialog",["i18n!orion/widgets/nls/messages","require","orion/webui/littlelib","orion/uiUtils"],function(k,j,i,a){function g(){}g.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 a=
document.body;this.$frameParent=a;this.$$modalExclusions=this.$$modalExclusions||[];var d=document.createRange();d.selectNode(a);d=d.createContextualFragment(this.CONTAINERTEMPLATE);a.appendChild(d);this.$frame=a.lastChild;this.title&&i.$("#title",this.$frame).appendChild(document.createTextNode(this.title));this.$close=i.$("#closeDialog",this.$frame);var f=this;this.$close.addEventListener("click",function(){f.hide()},!1);this.$parent=i.$(".dialogContent",this.$frame);d=document.createRange();d.selectNode(this.$parent);
a=d.createContextualFragment(this.TEMPLATE);this.messages&&i.processTextNodes(a,this.messages);this.$parent.appendChild(a);this.$buttonContainer=i.$(".dialogButtons",this.$frame);this._makeButtons();this.$close.addEventListener("keydown",function(a){(a.keyCode===i.KEY.ENTER||a.keyCode===i.KEY.SPACE)&&f.hide()},!1);this.$frame.addEventListener("keydown",function(a){a.keyCode===i.KEY.ESCAPE?f.hide():a.keyCode===i.KEY.ENTER&&typeof f._defaultCallback==="function"&&f._defaultCallback()},!1);this._bindElements(this.$parent);
typeof this._bindToDom==="function"&&this._bindToDom(this.$parent);this.modal&&this._makeModal()},_makeButtons:function(){if(this.$buttonContainer&&Array.isArray(this.buttons)){var g=this;this.buttons.forEach(function(d){var f=a.createButton(d.text,d.callback);if(d.id)f.id=d.id,g["$"+f.id]=f;if(d.isDefault)g._defaultCallback=d.callback,g._defaultButton=f;g.$buttonContainer.appendChild(f)})}},_makeModal:function(){var a=this;this.$frame.addEventListener("blur",function(b){a.$lastFocusedElement=b.target},
!0);this._modalListener=function(b){var c=!i.contains(a.$frame,b.target);if(c)for(var d=0;d<a.$$modalExclusions.length;d++)if(i.contains(a.$$modalExclusions[d],b.target)){c=!1;break}c&&(window.setTimeout(function(){(a.$lastFocusedElement||a.$parent).focus()},0),i.stop(b))};this.$frameParent.addEventListener("focus",this._modalListener,!0);this.$frameParent.addEventListener("click",this._modalListener,!0);var d=this.$frameParent.childNodes,f=!1;this._addedBackdrop=[];for(var c=0;c<d.length;c++){for(var b=
0;b<this.$$modalExclusions.length;b++)if(i.contains(this.$$modalExclusions[b],d[c])){f=!0;break}!f&&d[c]!==a.$frame&&d[c].classList&&!d[c].classList.contains("tooltipContainer")&&(b=d[c],b.classList.contains("modalBackdrop")||(b.classList.add("modalBackdrop"),this._addedBackdrop.push(b)))}(d=i.lastTabbable(this.$buttonContainer)||i.lastTabbable(this.$parent))&&d.addEventListener("keydown",function(b){if(b.keyCode===i.KEY.TAB){var c=a._getFirstFocusField();c&&c!==b.target&&c.focus();i.stop(b)}},!1)},
_addChildDialog:function(a){this.$$modalExclusions.push(a.$frame||a.$parent)},_bindElements:function(a){for(var d=0;d<a.childNodes.length;d++){var f=a.childNodes[d];f.id&&(this["$"+f.id]=f);this._bindElements(f)}},hide:function(){typeof this._beforeHiding==="function"&&this._beforeHiding();this._modalListener&&(this.$frameParent.removeEventListener("focus",this._modalListener,!0),this.$frameParent.removeEventListener("click",this._modalListener,!0));this.$frame.classList.remove("dialogShowing");typeof this._afterHiding===
"function"&&this._afterHiding();var a=this;this.keepAlive||window.setTimeout(function(){a.destroy()},0)},show:function(a){typeof this._beforeShowing==="function"&&this._beforeShowing();var d=i.bounds(this.$frame),f=i.bounds(document.documentElement),c;a?(c=i.bounds(a),a=c.top+c.height+4,c=c.left+4,a+d.height>f.height&&(a=Math.max(0,f.height-d.height-4)),c+d.width>f.width&&(c=Math.max(0,f.width-d.width-4))):(c=Math.max(0,(f.width-d.width)/2),a=Math.max(0,(f.height-d.height)/2));this.$lastFocusedElement=
document.activeElement;this.$frame.style.top=a+"px";this.$frame.style.left=c+"px";this.$frame.classList.add("dialogShowing");typeof this._afterShowing==="function"&&this._afterShowing();this.customFocus||this._getFirstFocusField().focus()},_getFirstFocusField:function(){return i.firstTabbable(this.$parent)||this._defaultButton||i.firstTabbable(this.$buttonContainer)||this.$close},destroy:function(){this._addedBackdrop&&this._addedBackdrop.length>0&&this._addedBackdrop.forEach(function(a){a.classList.remove("modalBackdrop")});
this.$frameParent.removeEventListener("focus",this._modalListener,!0);this.$frameParent.removeEventListener("click",this._modalListener,!0);this.$frameParent.removeChild(this.$frame);this.$parent=this.$frame=void 0}};g.prototype.constructor=g;return{Dialog:g}});
(function(){var k=["Msxml2.XMLHTTP","Microsoft.XMLHTTP","Msxml2.XMLHTTP.4.0"],j=/^\s*<\?xml(\s)+version=[\'\"](\d)*.(\d)*[\'\"](\s)*\?>/im,i=/<body[^>]*>\s*([\s\S]+)\s*<\/body>/im,a=typeof location!=="undefined"&&location.href,g=a&&location.protocol&&location.protocol.replace(/\:/,""),h=a&&location.hostname,d=a&&(location.port||void 0),f=[];define("text",[],function(){var c,b,e;typeof window!=="undefined"&&window.navigator&&window.document?b=function(b,a){var e=c.createXhr();e.open("GET",b,!0);e.onreadystatechange=
function(){e.readyState===4&&a(e.responseText)};e.send(null)}:typeof process!=="undefined"&&process.versions&&process.versions.node?(e=require.nodeRequire("fs"),b=function(b,a){var c=e.readFileSync(b,"utf8");c.indexOf("\ufeff")===0&&(c=c.substring(1));a(c)}):typeof Packages!=="undefined"&&(b=function(b,a){var e=new java.io.File(b),c=java.lang.System.getProperty("line.separator"),e=new java.io.BufferedReader(new java.io.InputStreamReader(new java.io.FileInputStream(e),"utf-8")),l,p,o="";try{l=new java.lang.StringBuffer;
(p=e.readLine())&&p.length()&&p.charAt(0)===65279&&(p=p.substring(1));for(l.append(p);(p=e.readLine())!==null;)l.append(c),l.append(p);o=String(l.toString())}finally{e.close()}a(o)});return c={version:"1.0.7",strip:function(b){if(b){var b=b.replace(j,""),a=b.match(i);a&&(b=a[1])}else b="";return b},jsEscape:function(b){return b.replace(/(['\\])/g,"\\$1").replace(/[\f]/g,"\\f").replace(/[\b]/g,"\\b").replace(/[\n]/g,"\\n").replace(/[\t]/g,"\\t").replace(/[\r]/g,"\\r")},createXhr:function(){var b,a,
e;if(typeof XMLHttpRequest!=="undefined")return new XMLHttpRequest;else for(a=0;a<3;a++){e=k[a];try{b=new ActiveXObject(e)}catch(c){}if(b){k=[e];break}}if(!b)throw Error("createXhr(): XMLHttpRequest not available");return b},get:b,parseName:function(b){var a=!1,e=b.indexOf("."),c=b.substring(0,e),b=b.substring(e+1,b.length),e=b.indexOf("!");e!==-1&&(a=b.substring(e+1,b.length),a=a==="strip",b=b.substring(0,e));return{moduleName:c,ext:b,strip:a}},xdRegExp:/^((\w+)\:)?\/\/([^\/\\]+)/,useXhr:function(b,
a,e,d){var l=c.xdRegExp.exec(b),p;if(!l)return!0;b=l[2];l=l[3];l=l.split(":");p=l[1];l=l[0];return(!b||b===a)&&(!l||l===e)&&(!p&&!l||p===d)},finishLoad:function(b,a,e,d,l){e=a?c.strip(e):e;l.isBuild&&(f[b]=e);d(e)},load:function(b,e,f,i){if(i.isBuild&&!i.inlineText)f();else{var l=c.parseName(b),p=l.moduleName+"."+l.ext,o=e.toUrl(p),u=i&&i.text&&i.text.useXhr||c.useXhr;!a||u(o,g,h,d)?c.get(o,function(a){c.finishLoad(b,l.strip,a,f,i)}):e([p],function(b){c.finishLoad(l.moduleName+"."+l.ext,l.strip,b,
f,i)})}},write:function(b,a,e){if(a in f){var d=c.jsEscape(f[a]);e.asModule(b+"!"+a,"define(function () { return '"+d+"';});\n")}},writeFile:function(b,a,e,d,l){var a=c.parseName(a),p=a.moduleName+"."+a.ext,o=e.toUrl(a.moduleName+"."+a.ext)+".js";c.load(p,e,function(){var a=function(b){return d(o,b)};a.asModule=function(b,l){return d.asModule(b,o,l)};c.write(b,p,a,l)},l)}}})})();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(k,j,i){return{slideoutHTMLFragment:function(a){var g=document.createElement("div");g.innerHTML=i;var h=j.$("#slideContainer",g);h.id=a+h.id;h=j.$("#pageCommandParameters",g);h.id=a+h.id;h=j.$("#pageCommandDismiss",g);h.id=a+h.id;return g.innerHTML}}});
define("orion/webui/treetable",["i18n!orion/nls/messages","orion/webui/littlelib"],function(k,j){function i(a){this._init(a)}i.prototype={_init:function(a){var g=a.parent,h=this,g=j.node(g);if(!g)throw k["no parent"];if(!a.model)throw k["no tree model"];if(!a.renderer)throw k["no renderer"];this._parent=g;this._treeModel=a.model;this._renderer=a.renderer;this._showRoot=a.showRoot===void 0?!1:a.showRoot;this._indent=a.indent===void 0?16:a.indent;this._onCollapse=a.onCollapse;this._labelColumnIndex=
a.labelColumnIndex===void 0?0:a.labelColumnIndex;this._id=a.id===void 0?"treetable":a.id;this._tableStyle=a.tableStyle;this._tableElement=a.tableElement||"table";this._tableBodyElement=a.tableBodyElement||"tbody";this._tableRowElement=a.tableRowElement||"tr";this._root=this._treeModel.getRoot(function(a){h._showRoot?(a._depth=0,h._generate([a],0)):h._treeModel.getChildren(a,function(a){h._generate(a,0)})})},_generate:function(a,g){j.empty(this._parent);var h=document.createElement(this._tableElement);
h.id=this._id;this._tableStyle&&h.classList.add(this._tableStyle);this._renderer.initTable(h,this);this._bodyElement=document.createElement(this._tableBodyElement);this._bodyElement.id=this._id+"tbody";this._generateChildren(a,g);h.appendChild(this._bodyElement);this._parent.appendChild(h);this._rowsChanged()},_generateChildren:function(a,g,h){for(var d=0;d<a.length;d++){var f=document.createElement(this._tableRowElement);f.id=this._treeModel.getId(a[d]);f._depth=g;f._item=a[d];this._renderer.render(a[d],
f);f.childNodes[this._labelColumnIndex].style.paddingLeft=this._indent*g+"px";h?(this._bodyElement.insertBefore(f,h.nextSibling),h&&(h=f)):this._bodyElement.appendChild(f)}},_rowsChanged:function(){this._renderer.rowsChanged&&this._renderer.rowsChanged()},getSelected:function(){return this._renderer.getSelected()},refresh:function(a,g,h){var d=this._treeModel.getId(a),f;if(d===this._id)this._removeChildRows(d),this._generateChildren(g,0),this._rowsChanged();else{var c=j.node(d);c?(c._item=a,c&&(h||
c._expanded)?(c._expanded=!0,this._removeChildRows(d),this._renderer.updateExpandVisuals(c,!0),g?(this._generateChildren(g,c._depth+1,c),this._rowsChanged()):(f=this,g=this._treeModel.getChildren(c._item,function(b){f._generateChildren(b,c._depth+1,c);f._rowsChanged()}))):this._renderer.updateExpandVisuals(c,!1)):console.log(k["could not find table row "]+d)}},getItem:function(a){var g=j.node(a);return g&&g._item?g._item:a},toggle:function(a){var g=j.node(a);g&&(g._expanded?(this.collapse(a),this._renderer.updateExpandVisuals(g,
!1)):(this.expand(a),this._renderer.updateExpandVisuals(g,!0)))},isExpanded:function(a){return(a=j.node(a))?a._expanded:!1},expand:function(a,g,h){var a=typeof a==="string"?a:this._treeModel.getId(a),d=j.node(a);if(d&&!d._expanded){d._expanded=!0;var f=this;this._renderer.updateExpandVisuals(d,!0);this._treeModel.getChildren(d._item,function(a){f._generateChildren(a,d._depth+1,d);f._rowsChanged();g&&g.apply(f,h)})}},_removeChildRows:function(a){for(var g=a===this._id,h=!1,d=-1,f=[],c=j.$$array(".treeTableRow",
this._parent),b=0;b<c.length;b++){var e=c[b];if(h)break;if(g)e._depth>d?f.push(e):h=!0;else if(e.id===a)g=!0,d=e._depth}for(a=0;a<f.length;a++)g=f[a],g.parentNode.removeChild(g)},collapse:function(a){var a=typeof a==="string"?a:this._treeModel.getId(a),g=j.node(a);if(g){if(!g._expanded)return;g._expanded=!1;this._renderer.updateExpandVisuals(g,!1);this._removeChildRows(a);this._rowsChanged()}this._onCollapse&&this._onCollapse(g._item)}};i.prototype.constructor=i;return{TableTree:i}});
define("orion/treeModelIterator",[],function(){var k={};k.TreeModelIterator=function(){function j(i,a){this.firstLevelChildren=i;this.reset();this._init(a)}j.prototype={_init:function(i){if(i)this.isExpanded=i.isExpanded,this.isExpandable=i.isExpandable,this.forceExpandFunc=i.forceExpandFunc},topLevel:function(i){return i.parent?i.parent===this.root:!0},_expanded:function(i){if(!i)return!0;var a=i.children&&i.children.length>0;this.isExpanded&&a&&(a=this.isExpanded(i));return a},_expandable:function(i){return!i?
!0:this.isExpandable?this.isExpandable(i):!1},_diveIn:function(i){return this._expanded(i)?(this.setCursor(i.children[0]),this.cursor()):null},_drillToLast:function(i){return this._expanded(i)?this._drillToLast(i.children[i.children.length-1]):i},_forward:function(i){if(!this._cursor)return null;var a=this._diveIn(this._cursor);if(!a){if(i&&this._expandable(this._cursor)&&this.forceExpandFunc){var g=this;return this.forceExpandFunc(this._cursor,"first",function(a){a&&g.setCursor(a)})}(a=this._findSibling(this._cursor,
!0))&&this.setCursor(a)}return a},_backward:function(i){if(!this._cursor)return null;var a=this._findSibling(this._cursor,!1);a&&a!==this._cursor.parent&&(a=this._drillToLast(a));if(i&&a&&this._expandable(a)&&this.forceExpandFunc&&a!==this._cursor.parent){var g=this;return this.forceExpandFunc(a,"last",function(a){a&&g.setCursor(a)})}a&&this.setCursor(a);return a},_findSibling:function(i,a){for(var g=this.topLevel(i),h=g?this.firstLevelChildren:i.parent.children,d=0;d<h.length;d++)if(h[d]===i)return d===
0&&!a?g?null:i.parent:d===h.length-1&&a?g?null:this._findSibling(i.parent,a):a?h[d+1]:h[d-1];return null},_inParentChain:function(i,a){for(var g=i.parent;g;){if(g===a)return!0;g=g.parent}return!1},_getTopLevelParent:function(i){if(this.topLevel(i))return i;for(i=i.parent;i;){if(this.topLevel(i))return i;i=i.parent}return null},_onCollapse:function(i){return this._expanded(i.parent)?i:this._onCollapse(i.parent)},_scan:function(i,a,g){this.setCursor(a);var h=[];for(h.push(a);;){if(this.iterate(i))h.push(this.cursor());
else break;if(g===this.cursor())return h}return null},setCursor:function(i){this._prevCursor=this._cursor;this._cursor=i},setTree:function(i){this.firstLevelChildren=i;if(this.firstLevelChildren.length>0)this.root=this.firstLevelChildren[0].parent},scan:function(i,a){var g=this.cursor(),h=this._scan(!0,i,a);h||(h=this._scan(!1,i,a));this.setCursor(g);return h},iterate:function(i,a){return i?this._forward(a):this._backward(a)},iterateOnTop:function(i,a){var g=this._findSibling(this._getTopLevelParent(this.cursor()),
i);g?this.setCursor(g):a&&this.firstLevelChildren.length>0&&this.setCursor(i?this.firstLevelChildren[0]:this.firstLevelChildren[this.firstLevelChildren.length-1])},collapse:function(i){if(!this._cursor)return null;return this._inParentChain(this._cursor,i)?(this.setCursor(i),this._cursor):null},reset:function(){this.root=this._prevCursor=this._cursor=null;if(this.firstLevelChildren.length>0)this._cursor=this.firstLevelChildren[0],this.root=this.firstLevelChildren[0].parent},cursorMoved:function(){return this._cursor!==
this._prevCursor},cursor:function(){return this._cursor},prevCursor:function(){return this._prevCursor}};return j}();return k});
define("orion/explorers/explorerNavHandler",["i18n!orion/nls/messages","orion/webui/littlelib","orion/treeModelIterator"],function(k,j,i){var k={},a=navigator.userAgent.indexOf("iPad")!==-1,g=window.navigator.platform.indexOf("Mac")!==-1;k.ExplorerNavHandler=function(){function h(a,f,c){this.explorer=a;this.model=this.explorer.model;this._navDict=f;this._listeners=[];this._selections=[];this._currentColumn=0;var b=this._getEventListeningDiv();b.tabIndex=0;b.classList.add("selectionModelContainer");
var e=this;this._modelIterator=new i.TreeModelIterator([],{isExpanded:this.isExpanded.bind(this),isExpandable:this.explorer.renderer.isExpandable?function(b){return e.explorer.renderer.isExpandable(b)}:function(b){return e.isExpandable(b)},forceExpandFunc:this.explorer.forceExpandFunc?function(b,a,c){return e.explorer.forceExpandFunc(b,a,c)}:void 0});this._init(c);(!c||c.setFocus!==!1)&&b.focus();a=function(a){if(a.target===b){if(e.explorer.preventDefaultFunc&&e.explorer.preventDefaultFunc(a,e._modelIterator.cursor()))return!0;
if(a.keyCode===j.KEY.DOWN)return e.onDownArrow(a);else if(a.keyCode===j.KEY.UP)return e.onUpArrow(a);else if(a.keyCode===j.KEY.RIGHT)return e.onRightArrow(a);else if(a.keyCode===j.KEY.LEFT)return e.onLeftArrow(a);else if(a.keyCode===j.KEY.SPACE)return e.onSpace(a);else if(a.keyCode===j.KEY.ENTER)return e.onEnter(a)}};b.addEventListener("keydown",a,!1);this._listeners.push({type:"keydown",listener:a});a=function(){if(e.explorer.onFocus)e.explorer.onFocus(!1);else e.toggleCursor(null,!1)};b.addEventListener("blur",
a,!1);this._listeners.push({type:"blur",listener:a});a=function(){if(e.explorer.onFocus)e.explorer.onFocus(!0);else e.toggleCursor(null,!0)};b.addEventListener("focus",a,!1);this._listeners.push({type:"focus",listener:a});this._parentDiv=b}h.prototype={_init:function(a){this._linearGridMove=!1;if(a)this._selectionPolicy=a.selectionPolicy,this.preventDefaultFunc=a.preventDefaultFunc,this.postDefaultFunc=a.postDefaultFunc},_ctrlKeyOn:function(a){return g?a.metaKey:a.ctrlKey},removeListeners:function(){if(this._listeners)for(var a=
0;a<this._listeners.length;a++)this._parentDiv.removeEventListener(this._listeners[a].type,this._listeners[a].listener,!1)},focus:function(){var a=this._getEventListeningDiv();a&&a.focus()},_getEventListeningDiv:function(a){return this.explorer.keyEventListeningDiv&&typeof this.explorer.keyEventListeningDiv==="function"?this.explorer.keyEventListeningDiv(a):j.node(this.explorer._parentId)},isExpandable:function(a){return!a?!1:j.node(this.explorer.renderer.expandCollapseImageId(this.model.getId(a)))?
!0:!1},isExpanded:function(a){return!a?!1:this.explorer.myTree.isExpanded(this.model.getId(a))},refreshSelection:function(a){var f=this;this.explorer.selection&&this.explorer.selection.getSelections(function(c){f._clearSelection();for(var b=0;b<c.length;b++)f._selections.push(c[b]);f._selections.length>0&&f.cursorOn(f._selections[0],!0,!1,a)})},refreshModel:function(a,f,c,b){this._currentColumn=0;this.topIterationNodes=[];this.model=f;this._navDict=a;if(this.model.getTopIterationNodes)this.topIterationNodes=
this.model.getTopIterationNodes();else if(c)this.topIterationNodes=c;this._modelIterator.setTree(this.topIterationNodes);!b&&this.explorer.selection&&this._modelIterator.reset();this.refreshSelection(!0)},getTopLevelNodes:function(){return this._modelIterator.firstLevelChildren},_inSelection:function(a){for(var f=0;f<this._selections.length;f++)if(a===this._selections[f])return f;return-1},_clearSelection:function(a){if(a)for(a=0;a<this._selections.length;a++)this._checkRow(this._selections[a],!0);
this._selections=[]},setSelection:function(a,f){if(this._selectionPolicy==="cursorOnly")f&&this.explorer.renderer._useCheckboxSelection&&this._checkRow(a,!0);else if(this._isRowSelectable(a)){if(!f||this._selectionPolicy==="singleSelection")this._clearSelection(!0),this._checkRow(a,!1),this._selections.push(a),this._lastSelection=a;else{var c=this._inSelection(a);c>=0?(this._checkRow(a,!0),this._selections.splice(c,1)):(this._checkRow(a,!1),this._selections.push(a),this._lastSelection=a)}this.explorer.selection&&
(this.explorer.renderer.storeSelections(),this.explorer.selection.setSelections(this._selections))}},moveColumn:function(a,f){a||(a=this.currentModel());var c=this._getGridChildren(a);if(c&&c.length>1||f===0&&c){f!==0&&this.toggleCursor(a,!1);var b=this._currentColumn,e=!0;b+=f;b<0?(this._linearGridMove&&f!==0&&(this._modelIterator.iterate(!1)?a=this.currentModel():e=!1),b=e?c.length-1:this._currentColumn):b>=c.length&&(this._linearGridMove&&f!==0&&(this._modelIterator.iterate(!0)?a=this.currentModel():
e=!1),b=e?0:this._currentColumn);this._currentColumn=b;f!==0&&this.toggleCursor(a,!0);return!0}return!1},_getGridChildren:function(a){return this._navDict?this._navDict.getGridNavHolder(a):null},getCurrentGrid:function(a){a||(a=this.currentModel());return(a=this._getGridChildren(a))&&a.length>0?a[this._currentColumn]:null},toggleCursor:function(a,f){var c=this.getRowDiv(a),b=this.getCurrentGrid(a);b?(c&&(f?c.classList.add("treeIterationCursorRow"):c.classList.remove("treeIterationCursorRow")),b.domNode&&
(f?b.domNode.classList.add("treeIterationCursor"):b.domNode.classList.remove("treeIterationCursor"))):c&&(f?c.classList.add("treeIterationCursorRow_Dotted"):c.classList.remove("treeIterationCursorRow_Dotted"))},currentModel:function(){return this._modelIterator.cursor()},cursorOn:function(a,f,c,b){var c=c===void 0?!1:c,e,m;if(a||f){if(m===this._modelIterator.cursor())return;e=this._modelIterator.cursor();m=a;this._modelIterator.setCursor(m)}else e=this._modelIterator.prevCursor(),m=this._modelIterator.cursor();
if(e!==m||f)if(this.toggleCursor(e,!1),!f||m)if(this.moveColumn(null,0),this.toggleCursor(m,!0),(a=this.getRowDiv())&&!b&&!this._visible(a)&&a.scrollIntoView(!c),this.explorer.onCursorChanged)this.explorer.onCursorChanged(e,m)},getSelection:function(){return this._selections},getSelectionIds:function(){for(var a=[],f=0;f<this._selections.length;f++)a.push(this.model.getId(this._selections[f]));return a},getRowDiv:function(a){a=a?a:this._modelIterator.cursor();if(!a)return null;var a=this.model.getId(a),
f=this._navDict.getValue(a);return f&&f.rowDomNode?f.rowDomNode:j.node(a)},iterate:function(a,f,c){this.topIterationNodes.length!==0&&this._modelIterator.iterate(a,f)&&(this.cursorOn(null,!1,a),c&&this.setSelection(this.currentModel(),!0))},_checkRow:function(a,f){if(this.explorer.renderer._useCheckboxSelection){var c=this.getRowDiv(a);if(c){var b=j.node(this.explorer.renderer.getCheckBoxId(c.id)),e=f?!b.checked:!0;if(e!==b.checked)this.explorer.renderer.onCheck(c,b,e,!0)}}else this._select(a,f)},
_vpWidth:function(){return window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth},_vpHeight:function(){return window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight},_getToolBarHeight:function(a){return(a=j.node(a))?j.bounds(a).height:0},_visible:function(a){if(a.offsetWidth===0||a.offsetHeight===0)return!1;var f=0;f+=this._getToolBarHeight("staticBanner");f+=this._getToolBarHeight("titleArea");f+=this._getToolBarHeight("pageToolbar");var c=
this._getEventListeningDiv(!0).getClientRects()[0],b=this._vpHeight();this._vpWidth();for(var f=c.top>f?c.top:f,c=c.bottom<b?c.bottom:b,a=a.getClientRects(),b=0,e=a.length;b<e;b++){var m=a[b];if(m.top>=f&&m.top<=c&&m.bottom>=f&&m.bottom<=c)return!0}return!1},_select:function(a){a||(a=this._modelIterator.cursor());var f=this.getRowDiv(a);f&&(this._inSelection(a)<0?f.classList.add("checkedRow"):f.classList.remove("checkedRow"))},_onModelGrid:function(a,f){var c=this._getGridChildren(a);if(c)for(var b=
0;b<c.length;b++)if(f.target===c[b].domNode)return!0;return!1},onClick:function(d,f){var c=j.node(this.explorer.renderer.expandCollapseImageId(this.model.getId(d)));if(f.target!==c&&!this._onModelGrid(d,f))if(this.cursorOn(d,!0,!1,!0),a)this.setSelection(d,!0);else if(this._ctrlKeyOn(f))this.setSelection(d,!0);else if(f.shiftKey&&this._lastSelection){if(c=this._modelIterator.scan(this._lastSelection,d)){this._clearSelection(!0);for(var b=0;b<c.length;b++)this.setSelection(c[b],!0)}}else this.setSelection(d,
!1)},onCollapse:function(a){this._modelIterator.collapse(a)&&this.cursorOn()},onUpArrow:function(a){this.iterate(!1,!1,a.shiftKey);!this._ctrlKeyOn(a)&&!a.shiftKey&&this.setSelection(this.currentModel(),!1);a.preventDefault();return!1},onDownArrow:function(a){this.iterate(!0,!1,a.shiftKey);!this._ctrlKeyOn(a)&&!a.shiftKey&&this.setSelection(this.currentModel(),!1);a.preventDefault();return!1},_shouldMoveColumn:function(a){var f=this.currentModel(),c=this._getGridChildren(f);return c&&c.length>1?this.isExpandable(f)?
this._ctrlKeyOn(a):!0:!1},onLeftArrow:function(a){if(this._shouldMoveColumn(a))return this.moveColumn(null,-1),a.preventDefault(),!0;var f=this._modelIterator.cursor();if(!f)return!1;if(this.isExpandable(f)&&this.isExpanded(f))return this.explorer.myTree.collapse(f),a.preventDefault(),!0;this._modelIterator.topLevel(f)?this.explorer.scopeUp&&typeof this.explorer.scopeUp==="function"&&this.explorer.scopeUp():(this.cursorOn(f.parent),this.setSelection(f.parent,!1))},onRightArrow:function(a){if(this._shouldMoveColumn(a))return this.moveColumn(null,
1),a.preventDefault(),!0;var f=this._modelIterator.cursor();if(!f)return!1;if(this.isExpandable(f)&&!this.isExpanded(f))return this.explorer.myTree.expand(f),a.preventDefault(),!1},_isRowSelectable:function(a){return this.explorer.isRowSelectable?this.explorer.isRowSelectable(a):!0},onSpace:function(a){this.setSelection(this.currentModel(),!0);a.preventDefault()},onEnter:function(a){var f=this.getCurrentGrid(this._modelIterator.cursor());if(f)if(f.widget)if(typeof f.onClick==="function")f.onClick();
else typeof f.widget.focus==="function"&&f.widget.focus();else{var c=document.createEvent("MouseEvents");c.initMouseEvent("click",!0,!0,window,0,0,0,0,0,this._ctrlKeyOn(a),!1,!1,!1,0,null);f.domNode.dispatchEvent(c)}else if(this.explorer.renderer.getRowActionElement&&(f=this._modelIterator.cursor()))if(f=this.explorer.renderer.getRowActionElement(this.model.getId(f)),f.href)this._ctrlKeyOn(a)?window.open(f.href):window.location.href=f.href}};return h}();k.ExplorerNavDict=function(){function a(d){this._dict=
{};this._model=d}a.prototype={addRow:function(a,f){this._dict[this._model.getId(a)]={model:a,rowDomNode:f}},getValue:function(a){return this._dict[a]},getGridNavHolder:function(a,f){if(!a)return null;var c=this._model.getId(a);if(this._dict[c]){if(!this._dict[c].gridChildren&&f)this._dict[c].gridChildren=[];return this._dict[c].gridChildren}return null},initGridNavHolder:function(a){if(!a)return null;a=this._model.getId(a);if(this._dict[a])this._dict[a].gridChildren=null}};return a}();return k});
define("orion/problems",["orion/EventTarget"],function(k){function j(i){this._serviceRegistry=i;k.attach(this);this._serviceRegistration=i.registerService("orion.core.marker",this)}j.prototype={_setProblems:function(i){this.problems=i;this.dispatchEvent({type:"problemsChanged",problems:i})}};j.prototype.constructor=j;return{ProblemService:j}});
define("orion/editor/eventTarget",[],function(){function k(){}k.addMixin=function(j){var i=k.prototype,a;for(a in i)i.hasOwnProperty(a)&&(j[a]=i[a])};k.prototype={addEventListener:function(j,i,a){if(!this._eventTypes)this._eventTypes={};var g=this._eventTypes[j];g||(g=this._eventTypes[j]={level:0,listeners:[]});g.listeners.push({listener:i,useCapture:a})},dispatchEvent:function(j){var i=j.type;this._dispatchEvent("pre"+i,j);this._dispatchEvent(i,j);this._dispatchEvent("post"+i,j)},_dispatchEvent:function(j,
i){var a=this._eventTypes?this._eventTypes[j]:null;if(a){var g=a.listeners;try{if(a.level++,g)for(var h=0,d=g.length;h<d;h++)if(g[h]){var f=g[h].listener;typeof f==="function"?f.call(this,i):f.handleEvent&&typeof f.handleEvent==="function"&&f.handleEvent(i)}}finally{if(a.level--,a.compact&&a.level===0){for(h=g.length-1;h>=0;h--)g[h]||g.splice(h,1);g.length===0&&delete this._eventTypes[j];a.compact=!1}}}},isListening:function(j){return!this._eventTypes?!1:this._eventTypes[j]!==void 0},removeEventListener:function(j,
i,a){if(this._eventTypes){var g=this._eventTypes[j];if(g){for(var h=g.listeners,d=0,f=h.length;d<f;d++){var c=h[d];if(c&&c.listener===i&&c.useCapture===a){g.level!==0?(h[d]=null,g.compact=!0):h.splice(d,1);break}}h.length===0&&delete this._eventTypes[j]}}}};return{EventTarget:k}});define("orion/editor/i18n",{load:function(k,j,i){j.specified&&j.specified("orion/bootstrap")?j(["orion/i18n!"+k],function(a){i(a)}):i({})}});
define("orion/editor/nls/root/messages",{multipleAnnotations:"Multiple annotations:",line:"Line: ${0}",breakpoint:"Breakpoint",bookmark:"Bookmark",task:"Task",error:"Error",warning:"Warning",matchingSearch:"Matching Search",currentSearch:"Current Search",currentLine:"Current Line",matchingBracket:"Matching Bracket",currentBracket:"Current Bracket",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(k,j){var i={root:j},a;for(a in k)k.hasOwnProperty(a)&&typeof i[a]==="undefined"&&(i[a]=k[a]);return i});
define("orion/editor/util",[],function(){var k=navigator.userAgent,j=parseFloat(k.split("MSIE")[1])||void 0,i=parseFloat(k.split("Firefox/")[1]||k.split("Minefield/")[1])||void 0,a=k.indexOf("Opera")!==-1,g=parseFloat(k.split("Chrome/")[1])||void 0,h=k.indexOf("Safari")!==-1&&!g,d=parseFloat(k.split("WebKit/")[1])||void 0,f=k.indexOf("Android")!==-1,c=k.indexOf("iPad")!==-1,k=k.indexOf("iPhone")!==-1,b=c||k,e=navigator.platform.indexOf("Mac")!==-1,m=navigator.platform.indexOf("Win")!==-1,n=navigator.platform.indexOf("Linux")!==
-1;return{formatMessage:function(b){var a=arguments;return b.replace(/\$\{([^\}]+)\}/g,function(b,e){return a[(e<<0)+1]})},createElement:function(b,a){return b.createElementNS?b.createElementNS("http://www.w3.org/1999/xhtml",a):b.createElement(a)},isIE:j,isFirefox:i,isOpera:a,isChrome:g,isSafari:h,isWebkit:d,isAndroid:f,isIPad:c,isIPhone:k,isIOS:b,isMac:e,isWindows:m,isLinux:n,platformDelimiter:m?"\r\n":"\n"}});
define("orion/editor/undoStack",[],function(){function k(a,g,h){this.offset=a;this.text=g;this.previousText=h}function j(){this.changes=[]}function i(a,g){this.view=a;this.size=g!==void 0?g:100;this.reset();var h=a.getModel();h.getBaseModel&&(h=h.getBaseModel());this.model=h;var d=this;this._listener={onChanging:function(a){d._onChanging(a)},onDestroy:function(a){d._onDestroy(a)}};h.addEventListener("Changing",this._listener.onChanging);a.addEventListener("Destroy",this._listener.onDestroy)}k.prototype=
{undo:function(a,g){this._doUndoRedo(this.offset,this.previousText,this.text,a,g)},redo:function(a,g){this._doUndoRedo(this.offset,this.text,this.previousText,a,g)},_doUndoRedo:function(a,g,h,d,f){var c=d.getModel();if(c.mapOffset&&d.annotationModel){var b=c.mapOffset(a,!0);if(b<0)for(var e=d.annotationModel.getAnnotations(a,a+1);e.hasNext();){var m=e.next();if(m.type==="orion.annotation.folding"){m.expand();b=c.mapOffset(a,!0);break}}if(b<0)return;a=b}d.setText(g,a,a+h.length);f&&d.setSelection(a,
a+g.length)}};j.prototype={add:function(a){this.changes.push(a)},end:function(a){this.endSelection=a.getSelection();this.endCaret=a.getCaretOffset()},undo:function(a,g){for(var h=this.changes.length-1;h>=0;h--)this.changes[h].undo(a,!1);if(g){var h=this.startSelection.start,d=this.startSelection.end;a.setSelection(this.startCaret?h:d,this.startCaret?d:h)}},redo:function(a,g){for(var h=0;h<this.changes.length;h++)this.changes[h].redo(a,!1);if(g){var h=this.endSelection.start,d=this.endSelection.end;
a.setSelection(this.endCaret?h:d,this.endCaret?d:h)}},start:function(a){this.startSelection=a.getSelection();this.startCaret=a.getCaretOffset()}};i.prototype={add:function(a){this.compoundChange?this.compoundChange.add(a):(this.stack.splice(this.index,this.stack.length-this.index,a),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 a=this.index,g=this.stack.length;this._undoStart!==void 0&&a++;return{undo:a,redo:g-a}},undo:function(){this._commitUndo();if(this.index<=0)return!1;var a=this.stack[--this.index];this._ignoreUndo=!0;a.undo(this.view,!0);this._ignoreUndo=!1;return!0},
redo:function(){this._commitUndo();if(this.index>=this.stack.length)return!1;var a=this.stack[this.index++];this._ignoreUndo=!0;a.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 a=new j;this.add(a);this.compoundChange=a;this.compoundChange.start(this.view)},_commitUndo:function(){if(this._undoStart!==
void 0)this._undoType===-1?this.add(new k(this._undoStart,"",this._undoText)):this.add(new k(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(a){var g=a.text,h=a.start,d=a.removedCharCount,a=a.addedCharCount;if(!this._ignoreUndo){this._undoStart!==void 0&&!(a===1&&d===0&&this._undoType===
1&&h===this._undoStart+this._undoText.length||a===0&&d===1&&this._undoType===-1&&(h+1===this._undoStart||h===this._undoStart))&&this._commitUndo();if(!this.compoundChange)if(a===1&&d===0){if(this._undoStart===void 0)this._undoStart=h;this._undoText+=g;this._undoType=1;return}else if(a===0&&d===1){g=this._undoText.length>0&&this._undoStart===h;this._undoStart=h;this._undoType=-1;g?this._undoText+=this.model.getText(h,h+d):this._undoText=this.model.getText(h,h+d)+this._undoText;return}this.add(new k(h,
g,this.model.getText(h,h+d)))}}};return{UndoStack:i}});
define("orion/editor/annotations",["i18n!orion/editor/nls/messages","orion/editor/eventTarget"],function(k,j){function i(b,a,c){this.start=b;this.end=a;this._projectionModel=c;this.html=this._expandedHTML;this.style=this._expandedStyle;this.expanded=!0}function a(){}function g(b,e){var c=b.lastIndexOf("."),c=b.substring(c+1),d={title:k[c],style:{styleClass:"annotation "+c},html:"<div class='annotationHTML "+c+"'></div>",overviewStyle:{styleClass:"annotationOverview "+c}};e?d.lineStyle={styleClass:"annotationLine "+
c}:d.rangeStyle={styleClass:"annotationRange "+c};a.registerType(b,d)}function h(){}function d(b){this._annotations=[];var a=this;this._listener={onChanged:function(b){a._onChanged(b)}};this.setTextModel(b)}function f(b,a){this._view=b;this._annotationModel=a;var c=this;this._listener={onDestroy:function(b){c._onDestroy(b)},onLineStyle:function(b){c._onLineStyle(b)},onChanged:function(b){c._onAnnotationModelChanged(b)}};b.addEventListener("Destroy",this._listener.onDestroy);b.addEventListener("postLineStyle",
this._listener.onLineStyle);a.addEventListener("Changed",this._listener.onChanged)}i.prototype={_expandedHTML:"<div class='annotationHTML expanded'></div>",_expandedStyle:{styleClass:"annotation expanded"},_collapsedHTML:"<div class='annotationHTML collapsed'></div>",_collapsedStyle:{styleClass:"annotation collapsed"},collapse:function(){if(this.expanded){this.expanded=!1;this.html=this._collapsedHTML;this.style=this._collapsedStyle;var b=this._projectionModel,a=b.getBaseModel();this._projection=
{start:a.getLineStart(a.getLineAtOffset(this.start)+1),end:a.getLineEnd(a.getLineAtOffset(this.end),!0)};b.addProjection(this._projection)}},expand:function(){if(!this.expanded)this.expanded=!0,this.html=this._expandedHTML,this.style=this._expandedStyle,this._projectionModel.removeProjection(this._projection)}};a.ANNOTATION_ERROR="orion.annotation.error";a.ANNOTATION_WARNING="orion.annotation.warning";a.ANNOTATION_TASK="orion.annotation.task";a.ANNOTATION_BREAKPOINT="orion.annotation.breakpoint";
a.ANNOTATION_BOOKMARK="orion.annotation.bookmark";a.ANNOTATION_FOLDING="orion.annotation.folding";a.ANNOTATION_CURRENT_BRACKET="orion.annotation.currentBracket";a.ANNOTATION_MATCHING_BRACKET="orion.annotation.matchingBracket";a.ANNOTATION_CURRENT_LINE="orion.annotation.currentLine";a.ANNOTATION_CURRENT_SEARCH="orion.annotation.currentSearch";a.ANNOTATION_MATCHING_SEARCH="orion.annotation.matchingSearch";a.ANNOTATION_READ_OCCURRENCE="orion.annotation.readOccurrence";a.ANNOTATION_WRITE_OCCURRENCE="orion.annotation.writeOccurrence";
var c={};a.registerType=function(b,a){var d=a;if(typeof d!=="function")d=function(b,a,e){this.start=b;this.end=a;if(e)this.title=e},d.prototype=a;d.prototype.type=b;c[b]=d;return b};a.createAnnotation=function(b,a,c,d){return new (this.getType(b))(a,c,d)};a.getType=function(b){return c[b]};g(a.ANNOTATION_ERROR);g(a.ANNOTATION_WARNING);g(a.ANNOTATION_TASK);g(a.ANNOTATION_BREAKPOINT);g(a.ANNOTATION_BOOKMARK);g(a.ANNOTATION_CURRENT_BRACKET);g(a.ANNOTATION_MATCHING_BRACKET);g(a.ANNOTATION_CURRENT_SEARCH);
g(a.ANNOTATION_MATCHING_SEARCH);g(a.ANNOTATION_READ_OCCURRENCE);g(a.ANNOTATION_WRITE_OCCURRENCE);g(a.ANNOTATION_CURRENT_LINE,!0);a.registerType(a.ANNOTATION_FOLDING,i);h.addMixin=function(b){var a=h.prototype,c;for(c in a)a.hasOwnProperty(c)&&(b[c]=a[c])};h.prototype={addAnnotationType:function(b){if(!this._annotationTypes)this._annotationTypes=[];this._annotationTypes.push(b)},getAnnotationTypePriority:function(b){if(this._annotationTypes)for(var a=0;a<this._annotationTypes.length;a++)if(this._annotationTypes[a]===
b)return a+1;return 0},getAnnotationsByType:function(b,a,c){b=b.getAnnotations(a,c);for(c=[];b.hasNext();)a=b.next(),this.getAnnotationTypePriority(a.type)!==0&&c.push(a);var d=this;c.sort(function(b,a){return d.getAnnotationTypePriority(b.type)-d.getAnnotationTypePriority(a.type)});return c},isAnnotationTypeVisible:function(b){return this.getAnnotationTypePriority(b)!==0},removeAnnotationType:function(b){if(this._annotationTypes)for(var a=0;a<this._annotationTypes.length;a++)if(this._annotationTypes[a]===
b){this._annotationTypes.splice(a,1);break}}};d.prototype={addAnnotation:function(b){if(b){var a=this._annotations,c=this._binarySearch(a,b.start);a.splice(c,0,b);this.onChanged({type:"Changed",added:[b],removed:[],changed:[]})}},getTextModel:function(){return this._model},getAnnotations:function(b,a){var c=this._annotations,d,f=0,g=function(){for(;f<c.length;){var l=c[f++];if(b===l.start||(b>l.start?b<l.end:l.start<a))return l;if(l.start>=a)break}return null};d=g();return{next:function(){var b=d;
b&&(d=g());return b},hasNext:function(){return d!==null}}},modifyAnnotation:function(b){if(b&&!(this._getAnnotationIndex(b)<0))this.onChanged({type:"Changed",added:[],removed:[],changed:[b]})},onChanged:function(b){return this.dispatchEvent(b)},removeAnnotations:function(b){var a=this._annotations,c,d;if(b){c=[];for(d=a.length-1;d>=0;d--){var f=a[d];f.type===b&&a.splice(d,1);c.splice(0,0,f)}}else c=a;this.onChanged({type:"Changed",removed:c,added:[],changed:[]})},removeAnnotation:function(b){if(b&&
(b=this._getAnnotationIndex(b),!(b<0)))this.onChanged({type:"Changed",removed:this._annotations.splice(b,1),added:[],changed:[]})},replaceAnnotations:function(b,a){var c=this._annotations,d,f,g,l=[];if(b)for(d=b.length-1;d>=0;d--)g=b[d],f=this._getAnnotationIndex(g),f<0||(c.splice(f,1),l.splice(0,0,g));a||(a=[]);for(d=0;d<a.length;d++)g=a[d],f=this._binarySearch(c,g.start),c.splice(f,0,g);this.onChanged({type:"Changed",removed:l,added:a,changed:[]})},setTextModel:function(b){this._model&&this._model.removeEventListener("Changed",
this._listener.onChanged);(this._model=b)&&this._model.addEventListener("Changed",this._listener.onChanged)},_binarySearch:function(b,a){for(var c=b.length,d=-1,f;c-d>1;)f=Math.floor((c+d)/2),a<=b[f].start?c=f:d=f;return c},_getAnnotationIndex:function(b){for(var a=this._annotations,c=this._binarySearch(a,b.start);c<a.length&&a[c].start===b.start;){if(a[c]===b)return c;c++}return-1},_onChanged:function(b){var a=b.start,c=b.removedCharCount,d=this._annotations,f=a+c;if(0<d.length){for(var g={type:"Changed",
added:[],removed:[],changed:[],textModelChangedEvent:b},b=b.addedCharCount-c,c=0;c<d.length;c++){var l=d[c];l.start>=f?(l.start+=b,l.end+=b,g.changed.push(l)):l.end<=a||(l.start<a&&f<l.end?(l.end+=b,g.changed.push(l)):(d.splice(c,1),g.removed.push(l),c--))}if(g.added.length>0||g.removed.length>0||g.changed.length>0)this.onChanged(g)}}};j.EventTarget.addMixin(d.prototype);f.prototype={destroy:function(){var b=this._view;if(b)b.removeEventListener("Destroy",this._listener.onDestroy),b.removeEventListener("LineStyle",
this._listener.onLineStyle),this.view=null;(b=this._annotationModel)&&b.removeEventListener("Changed",this._listener.onChanged)},_mergeStyle:function(b,a){if(a){b||(b={});b.styleClass&&a.styleClass&&b.styleClass!==a.styleClass?b.styleClass+=" "+a.styleClass:b.styleClass=a.styleClass;var c;if(a.style){if(!b.style)b.style={};for(c in a.style)b.style[c]||(b.style[c]=a.style[c])}if(a.attributes){if(!b.attributes)b.attributes={};for(c in a.attributes)b.attributes[c]||(b.attributes[c]=a.attributes[c])}}return b},
_mergeStyleRanges:function(b,a){b||(b=[]);var c,d;for(d=0;d<b.length&&a;d++){var f=b[d];if(a.end<=f.start)break;if(!(a.start>=f.end)){c=this._mergeStyle({},f.style);c=this._mergeStyle(c,a.style);var g=[];g.push(d,1);a.start<f.start&&g.push({start:a.start,end:f.start,style:a.style});a.start>f.start&&g.push({start:f.start,end:a.start,style:f.style});g.push({start:Math.max(f.start,a.start),end:Math.min(f.end,a.end),style:c});a.end<f.end&&g.push({start:a.end,end:f.end,style:f.style});a=a.end>f.end?{start:f.end,
end:a.end,style:a.style}:null;Array.prototype.splice.apply(b,g)}}a&&(c=this._mergeStyle({},a.style),b.splice(d,0,{start:a.start,end:a.end,style:c}));return b},_onAnnotationModelChanged:function(b){function a(b){for(var l=0;l<b.length;l++)if(d.isAnnotationTypeVisible(b[l].type)){var e=b[l].start,o=b[l].end;f.getBaseModel&&(e=f.mapOffset(e,!0),o=f.mapOffset(o,!0));e!==-1&&o!==-1&&c.redrawRange(e,o)}}if(!b.textModelChangedEvent){var c=this._view;if(c){var d=this,f=c.getModel();a(b.added);a(b.removed);
a(b.changed)}}},_onDestroy:function(){this.destroy()},_onLineStyle:function(b){var a=this._annotationModel,c=b.textView.getModel(),d=a.getTextModel(),f=b.lineStart,g=b.lineStart+b.lineText.length;d!==c&&(f=c.mapOffset(f),g=c.mapOffset(g));for(a=a.getAnnotations(f,g);a.hasNext();)if(f=a.next(),this.isAnnotationTypeVisible(f.type)){if(f.rangeStyle){var g=f.start,l=f.end;d!==c&&(g=c.mapOffset(g,!0),l=c.mapOffset(l,!0));b.ranges=this._mergeStyleRanges(b.ranges,{start:g,end:l,style:f.rangeStyle})}if(f.lineStyle)b.style=
this._mergeStyle({},b.style),b.style=this._mergeStyle(b.style,f.lineStyle)}}};h.addMixin(f.prototype);return{FoldingAnnotation:i,AnnotationType:a,AnnotationTypeList:h,AnnotationModel:d,AnnotationStyler:f}});
define("orion/editor/textDND",[],function(){function k(j,i){this._view=j;this._undoStack=i;this._dragSelection=null;this._dropOffset=-1;this._dropText=null;var a=this;this._listener={onDragStart:function(g){a._onDragStart(g)},onDragEnd:function(g){a._onDragEnd(g)},onDragEnter:function(g){a._onDragEnter(g)},onDragOver:function(g){a._onDragOver(g)},onDrop:function(g){a._onDrop(g)},onDestroy:function(g){a._onDestroy(g)}};j.addEventListener("DragStart",this._listener.onDragStart);j.addEventListener("DragEnd",
this._listener.onDragEnd);j.addEventListener("DragEnter",this._listener.onDragEnter);j.addEventListener("DragOver",this._listener.onDragOver);j.addEventListener("Drop",this._listener.onDrop);j.addEventListener("Destroy",this._listener.onDestroy)}k.prototype={destroy:function(){var j=this._view;if(j)j.removeEventListener("DragStart",this._listener.onDragStart),j.removeEventListener("DragEnd",this._listener.onDragEnd),j.removeEventListener("DragEnter",this._listener.onDragEnter),j.removeEventListener("DragOver",
this._listener.onDragOver),j.removeEventListener("Drop",this._listener.onDrop),j.removeEventListener("Destroy",this._listener.onDestroy),this._view=null},_onDestroy:function(){this.destroy()},_onDragStart:function(j){var i=this._view,a=i.getSelection(),i=i.getModel();if(i.getBaseModel)a.start=i.mapOffset(a.start),a.end=i.mapOffset(a.end),i=i.getBaseModel();if(i=i.getText(a.start,a.end))this._dragSelection=a,j.event.dataTransfer.effectAllowed="copyMove",j.event.dataTransfer.setData("Text",i)},_onDragEnd:function(j){var i=
this._view;if(this._dragSelection){this._undoStack&&this._undoStack.startCompoundChange();(j=j.event.dataTransfer.dropEffect==="move")&&i.setText("",this._dragSelection.start,this._dragSelection.end);if(this._dropText){var a=this._dropText,g=this._dropOffset;if(j)if(g>=this._dragSelection.end)g-=this._dragSelection.end-this._dragSelection.start;else if(g>=this._dragSelection.start)g=this._dragSelection.start;i.setText(a,g,g);i.setSelection(g,g+a.length);this._dropText=null;this._dropOffset=-1}this._undoStack&&
this._undoStack.endCompoundChange()}this._dragSelection=null},_onDragEnter:function(j){this._onDragOver(j)},_onDragOver:function(j){var i=j.event.dataTransfer.types;if(i){var a=!this._view.getOptions("readonly");a&&(a=i.contains?i.contains("text/plain"):i.indexOf("text/plain")!==-1);if(!a)j.event.dataTransfer.dropEffect="none"}},_onDrop:function(j){var i=this._view,a=j.event.dataTransfer.getData("Text");if(a)j=i.getOffsetAtLocation(j.x,j.y),this._dragSelection?(this._dropOffset=j,this._dropText=a):
(i.setText(a,j,j),i.setSelection(j,j+a.length))}};return{TextDND:k}});
define("orion/syntaxchecker",["orion/Deferred"],function(k){return{SyntaxChecker:function(){function j(i,a){this.registry=i;this.editor=a}j.prototype={checkSyntax:function(i,a,g,h){function d(c,b){function e(b,a,l){b=a.getProperty("contentType");return d.isSomeExtensionOf(l,b).then(function(b){return b?a:null})}for(var d=c.getService("orion.core.contenttypes"),f=c.getServiceReferences("orion.edit.validator"),g=[],h=0;h<f.length;h++){var l=f[h],p=l.getProperty("pattern");l.getProperty("contentType")?
g.push(e(c,l,b)):p&&RegExp(p).test(a)&&(p=new k,p.resolve(l),g.push(p))}return k.all(g,function(b){return{_error:b}}).then(function(b){for(var a=[],l=0;l<b.length;l++){var c=b[l];c&&!c._error&&a.push(c)}return a})}if(i&&!g){var f=this;d(this.registry,i).then(function(c){for(var b=function(b){return b.problems||b.errors},e=[],d=f.registry.getService("orion.page.progress"),g=0;g<c.length;g++)e.push(d.progress(f.registry.getService(c[g]).checkSyntax(a,h),"Validating "+a).then(b));k.all(e,function(b){return{_error:b}}).then(function(b){var a=
[];for(g=0;g<b.length;g++){var l=b[g];l._error||(f._fixup(l),a=a.concat(l))}f.registry.getService("orion.core.marker")._setProblems(a)})})}},_fixup:function(i){for(var a=this.editor.getModel(),g=0;g<i.length;g++){var h=i[g];h.description=h.description||h.reason;h.severity=h.severity||"error";h.start=typeof h.start==="number"?h.start:h.character;h.end=typeof h.end==="number"?h.end:h.start+1;var d=a.getLine(h.line-1,!1).length;h.start=Math.max(1,h.start);h.start=Math.min(h.start,d);h.end=Math.min(h.end,
d);h.end=Math.max(h.start,h.end)}}};return j}()}});
define("orion/editor/textModel",["orion/editor/eventTarget","orion/editor/util"],function(k,j){function i(a,g){this._lastLineIndex=-1;this._text=[""];this._lineOffsets=[0];this.setText(a);this.setLineDelimiter(g)}i.prototype={find:function(a){if(this._text.length>1)this._text=[this._text.join("")];var g=a.string,h=g;!a.regex&&g&&(h=g.replace(/([\\$\^*\/+?\.\(\)|{}\[\]])/g,"\\$&"));var d=null,f;if(h){var g=a.reverse,c=a.wrap,b=a.wholeWord,e=a.caseInsensitive,m=a.start||0,n=a.end,a=a.end!==void 0,i=
"";i.indexOf("g")===-1&&(i+="g");e&&i.indexOf("i")===-1&&(i+="i");b&&(h="\\b"+h+"\\b");var j=this._text[0],l,p,o=0;a&&(j=j.substring(m,n),o=m);var u=RegExp(h,i);if(g)f=function(){var b=null;for(u.lastIndex=0;;){p=u.lastIndex;l=u.exec(j);if(p===u.lastIndex)return null;if(l){if(!(l.index<m)){if(!c||b)break;m=j.length}b={start:l.index+o,end:u.lastIndex+o}}else break}if(b)m=b.start;return b};else{if(!a)u.lastIndex=m;f=function(){for(;;){p=u.lastIndex;l=u.exec(j);if(p===u.lastIndex)break;if(l)return{start:l.index+
o,end:u.lastIndex+o};if(!(p!==0&&c))break}return null}}d=f()}return{next:function(){var b=d;b&&(d=f());return b},hasNext:function(){return d!==null}}},getCharCount:function(){for(var a=0,g=0;g<this._text.length;g++)a+=this._text[g].length;return a},getLine:function(a,g){var h=this.getLineCount();if(!(0<=a&&a<h))return null;var d=this._lineOffsets[a];if(a+1<h){h=this.getText(d,this._lineOffsets[a+1]);if(g)return h;for(var d=h.length,f;(f=h.charCodeAt(d-1))===10||f===13;)d--;return h.substring(0,d)}else return this.getText(d)},
getLineAtOffset:function(a){var g=this.getCharCount();if(!(0<=a&&a<=g))return-1;var h=this.getLineCount();if(a===g)return h-1;var d,f,c=this._lastLineIndex;if(0<=c&&c<h&&(d=this._lineOffsets[c],f=c+1<h?this._lineOffsets[c+1]:g,d<=a&&a<f))return c;for(var b=h,e=-1;b-e>1;)if(c=Math.floor((b+e)/2),d=this._lineOffsets[c],f=c+1<h?this._lineOffsets[c+1]:g,a<=d)b=c;else if(a<f){b=c;break}else e=c;return this._lastLineIndex=b},getLineCount:function(){return this._lineOffsets.length},getLineDelimiter:function(){return this._lineDelimiter},
getLineEnd:function(a,g){var h=this.getLineCount();if(!(0<=a&&a<h))return-1;if(a+1<h){h=this._lineOffsets[a+1];if(g)return h;for(var d=this.getText(Math.max(this._lineOffsets[a],h-2),h),f=d.length,c;(c=d.charCodeAt(f-1))===10||c===13;)f--;return h-(d.length-f)}else return this.getCharCount()},getLineStart:function(a){return!(0<=a&&a<this.getLineCount())?-1:this._lineOffsets[a]},getText:function(a,g){a===void 0&&(a=0);g===void 0&&(g=this.getCharCount());if(a===g)return"";for(var h=0,d=0,f;d<this._text.length;){f=
this._text[d].length;if(a<=h+f)break;h+=f;d++}for(var c=h,b=d;d<this._text.length;){f=this._text[d].length;if(g<=h+f)break;h+=f;d++}if(b===d)return this._text[b].substring(a-c,g-h);c=this._text[b].substring(a-c);h=this._text[d].substring(0,g-h);return c+this._text.slice(b+1,d).join("")+h},onChanging:function(a){return this.dispatchEvent(a)},onChanged:function(a){return this.dispatchEvent(a)},setLineDelimiter:function(a,g){a==="auto"&&(a=void 0,this.getLineCount()>1&&(a=this.getText(this.getLineEnd(0),
this.getLineEnd(0,!0))));this._lineDelimiter=a?a:j.platformDelimiter;if(g){var h=this.getLineCount();if(h>1){for(var d=Array(h),f=0;f<h;f++)d[f]=this.getLine(f);this.setText(d.join(this._lineDelimiter))}}},setText:function(a,g,h){a===void 0&&(a="");g===void 0&&(g=0);h===void 0&&(h=this.getCharCount());if(!(g===h&&a==="")){for(var d=this.getLineAtOffset(g),f=this.getLineAtOffset(h),c=g,b=h-g,e=f-d,m=a.length,n=0,i=this.getLineCount(),j=0,l=0,p=0,o=[];;){j!==-1&&j<=p&&(j=a.indexOf("\r",p));l!==-1&&
l<=p&&(l=a.indexOf("\n",p));if(l===-1&&j===-1)break;p=j!==-1&&l!==-1?j+1===l?l+1:(j<l?j:l)+1:j!==-1?j+1:l+1;o.push(g+p);n++}this.onChanging({type:"Changing",text:a,start:c,removedCharCount:b,addedCharCount:m,removedLineCount:e,addedLineCount:n});o.length===0&&(j=this.getLineStart(d),f=f+1<i?this.getLineStart(f+1):this.getCharCount(),g!==j&&(a=this.getText(j,g)+a,g=j),h!==f&&(a+=this.getText(h,f),h=f));f=m-b;for(j=d+e+1;j<i;j++)this._lineOffsets[j]+=f;d=[d+1,e].concat(o);Array.prototype.splice.apply(this._lineOffsets,
d);for(f=o=0;f<this._text.length;){j=this._text[f].length;if(g<=o+j)break;o+=j;f++}i=o;for(d=f;f<this._text.length;){j=this._text[f].length;if(h<=o+j)break;o+=j;f++}j=this._text[f];g=this._text[d].substring(0,g-i);h=j.substring(h-o);d=[d,f-d+1];g&&d.push(g);a&&d.push(a);h&&d.push(h);Array.prototype.splice.apply(this._text,d);if(this._text.length===0)this._text=[""];this.onChanged({type:"Changed",start:c,removedCharCount:b,addedCharCount:m,removedLineCount:e,addedLineCount:n})}}};k.EventTarget.addMixin(i.prototype);
return{TextModel:i}});
define("orion/editor/projectionTextModel",["orion/editor/textModel","orion/editor/eventTarget"],function(k,j){function i(a){this._model=a;this._projections=[]}i.prototype={addProjection:function(a){if(a){var g=this._model,h=this._projections;a._lineIndex=g.getLineAtOffset(a.start);a._lineCount=g.getLineAtOffset(a.end)-a._lineIndex;var d=a.text;d||(d="");a._model=typeof d==="string"?new k.TextModel(d,g.getLineDelimiter()):d;var g=this.mapOffset(a.start,!0),d=a.end-a.start,f=a._lineCount,c=a._model.getCharCount(),
b=a._model.getLineCount()-1;this.onChanging({type:"Changing",text:a._model.getText(),start:g,removedCharCount:d,addedCharCount:c,removedLineCount:f,addedLineCount:b});var e=this._binarySearch(h,a.start);h.splice(e,0,a);this.onChanged({type:"Changed",start:g,removedCharCount:d,addedCharCount:c,removedLineCount:f,addedLineCount:b})}},getProjections:function(){return this._projections.slice(0)},getBaseModel:function(){return this._model},mapOffset:function(a,g){var h=this._projections,d=0,f,c;if(g){for(f=
0;f<h.length;f++){c=h[f];if(c.start>a)break;if(c.end>a)return-1;d+=c._model.getCharCount()-(c.end-c.start)}return a+d}for(f=0;f<h.length;f++){c=h[f];if(c.start>a-d)break;var b=c._model.getCharCount();if(c.start+b>a-d)return-1;d+=b-(c.end-c.start)}return a-d},removeProjection:function(a){var g,h=0;for(g=0;g<this._projections.length;g++){var d=this._projections[g];if(d===a){a=d;break}h+=d._model.getCharCount()-(d.end-d.start)}if(g<this._projections.length){var d=this._model,h=a.start+h,f=a.end-a.start,
c=a._lineCount,b=a._model.getCharCount(),e=a._model.getLineCount()-1;this.onChanging({type:"Changing",text:d.getText(a.start,a.end),start:h,removedCharCount:b,addedCharCount:f,removedLineCount:e,addedLineCount:c});this._projections.splice(g,1);this.onChanged({type:"Changed",start:h,removedCharCount:b,addedCharCount:f,removedLineCount:e,addedLineCount:c})}},_binarySearch:function(a,g){for(var h=a.length,d=-1,f;h-d>1;)f=Math.floor((h+d)/2),g<=a[f].start?h=f:d=f;return h},getCharCount:function(){for(var a=
this._model.getCharCount(),g=this._projections,h=0;h<g.length;h++){var d=g[h];a+=d._model.getCharCount()-(d.end-d.start)}return a},getLine:function(a,g){if(a<0)return null;var h=this._model,d=this._projections,f=0,c=[],b=0,e,m,n;for(e=0;e<d.length;e++){n=d[e];if(n._lineIndex>=a-f)break;m=n._model.getLineCount()-1;if(n._lineIndex+m>=a-f)if(b=a-(n._lineIndex+f),b<m)return n._model.getLine(b,g);else c.push(n._model.getLine(m));b=n.end;f+=m-n._lineCount}for(b=Math.max(b,h.getLineStart(a-f));e<d.length;e++){n=
d[e];if(n._lineIndex>a-f)break;c.push(h.getText(b,n.start));m=n._model.getLineCount()-1;if(n._lineIndex+m>a-f)return c.push(n._model.getLine(0,g)),c.join("");c.push(n._model.getText());b=n.end;f+=m-n._lineCount}d=h.getLineEnd(a-f,g);b<d&&c.push(h.getText(b,d));return c.join("")},getLineAtOffset:function(a){for(var g=this._model,h=this._projections,d=0,f=0,c=0;c<h.length;c++){var b=h[c];if(b.start>a-d)break;var e=b._model.getCharCount();if(b.start+e>a-d){h=a-(b.start+d);f+=b._model.getLineAtOffset(h);
d+=h;break}f+=b._model.getLineCount()-1-b._lineCount;d+=e-(b.end-b.start)}return g.getLineAtOffset(a-d)+f},getLineCount:function(){for(var a=this._projections,g=this._model.getLineCount(),h=0;h<a.length;h++){var d=a[h];g+=d._model.getLineCount()-1-d._lineCount}return g},getLineDelimiter:function(){return this._model.getLineDelimiter()},getLineEnd:function(a,g){if(a<0)return-1;for(var h=this._model,d=this._projections,f=0,c=0,b=0;b<d.length;b++){var e=d[b];if(e._lineIndex>a-f)break;var m=e._model.getLineCount()-
1;if(e._lineIndex+m>a-f)return e._model.getLineEnd(a-(e._lineIndex+f),g)+e.start+c;c+=e._model.getCharCount()-(e.end-e.start);f+=m-e._lineCount}return h.getLineEnd(a-f,g)+c},getLineStart:function(a){if(a<0)return-1;for(var g=this._model,h=this._projections,d=0,f=0,c=0;c<h.length;c++){var b=h[c];if(b._lineIndex>=a-d)break;var e=b._model.getLineCount()-1;if(b._lineIndex+e>=a-d)return b._model.getLineStart(a-(b._lineIndex+d))+b.start+f;f+=b._model.getCharCount()-(b.end-b.start);d+=e-b._lineCount}return g.getLineStart(a-
d)+f},getText:function(a,g){a===void 0&&(a=0);var h=this._model,d=this._projections,f=0,c=[],b,e,m;for(b=0;b<d.length;b++){e=d[b];if(e.start>a-f)break;m=e._model.getCharCount();if(e.start+m>a-f)if(g!==void 0&&e.start+m>g-f)return e._model.getText(a-(e.start+f),g-(e.start+f));else c.push(e._model.getText(a-(e.start+f))),a=e.end+f+m-(e.end-e.start);f+=m-(e.end-e.start)}var n=a-f;if(g!==void 0){for(;b<d.length;b++){e=d[b];if(e.start>g-f)break;c.push(h.getText(n,e.start));m=e._model.getCharCount();if(e.start+
m>g-f)return c.push(e._model.getText(0,g-(e.start+f))),c.join("");c.push(e._model.getText());n=e.end;f+=m-(e.end-e.start)}c.push(h.getText(n,g-f))}else{for(;b<d.length;b++)e=d[b],c.push(h.getText(n,e.start)),c.push(e._model.getText()),n=e.end;c.push(h.getText(n))}return c.join("")},_onChanging:function(a,g,h,d,f,c){for(var b=this._model,e=this._projections,m,n=0,i,j=g+h;m<e.length;m++){h=e[m];if(h.start>g)break;n+=h._model.getCharCount()-(h.end-h.start)}g+=n;for(var l=m;m<e.length;m++){h=e[m];if(h.start>
j)break;n+=h._model.getCharCount()-(h.end-h.start);i+=h._model.getLineCount()-1-h._lineCount}h=j+n;n=m;this.onChanging(g,h-g,d,f+i,c);e.splice(e,n-l);for(a=a.length-(h-g);m<e.length;m++)h=e[m],h.start+=a,h.end+=a,h._lineIndex=b.getLineAtOffset(h.start)},onChanging:function(a){return this.dispatchEvent(a)},onChanged:function(a){return this.dispatchEvent(a)},setLineDelimiter:function(a){this._model.setLineDelimiter(a)},setText:function(a,g,h){a===void 0&&(a="");g===void 0&&(g=0);var d=g,f=h,c=this._model,
b=this._projections,e=0,m=0,n,i,j,l,p,o=0;for(n=0;n<b.length;n++){i=b[n];if(i.start>g-e)break;j=i._model.getCharCount();if(i.start+j>g-e)if(h!==void 0&&i.start+j>h-e){i._model.setText(a,g-(i.start+e),h-(i.start+e));return}else o=i._model.getLineCount()-1-i._model.getLineAtOffset(g-(i.start+e)),l={projection:i,start:g-(i.start+e)},g=i.end+e+j-(i.end-i.start);m+=i._model.getLineCount()-1-i._lineCount;e+=j-(i.end-i.start)}g-=e;var u=n,o=c.getLineAtOffset(g)+m-o;if(h!==void 0)for(;n<b.length;n++){i=b[n];
if(i.start>h-e)break;j=i._model.getCharCount();if(i.start+j>h-e){m+=i._model.getLineAtOffset(h-(i.start+e));j=h-(i.start+e);h=i.end+e;p={projection:i,end:j};break}m+=i._model.getLineCount()-1-i._lineCount;e+=j-(i.end-i.start)}else{for(;n<b.length;n++)i=b[n],m+=i._model.getLineCount()-1-i._lineCount,e+=i._model.getCharCount()-(i.end-i.start);h=f=c.getCharCount()+e}h-=e;i=c.getLineAtOffset(h)+m;f-=d;for(var m=i-o,o=a.length,s=j=i=e=0;;){i!==-1&&i<=s&&(i=a.indexOf("\r",s));j!==-1&&j<=s&&(j=a.indexOf("\n",
s));if(j===-1&&i===-1)break;s=i!==-1&&j!==-1?i+1===j?j+1:(i<j?i:j)+1:i!==-1?i+1:j+1;e++}this.onChanging({type:"Changing",text:a,start:d,removedCharCount:f,addedCharCount:o,removedLineCount:m,addedLineCount:e});c.setText(a,g,h);if(l)i=l.projection,i._model.setText("",l.start);if(p)i=p.projection,i._model.setText("",0,p.end),i.start=i.end,i._lineCount=0;b.splice(u,n-u);for(a=a.length-(h-g);n<b.length;n++)i=b[n],i.start+=a,i.end+=a,i._lineIndex=c.getLineAtOffset(i.start);this.onChanged({type:"Changed",
start:d,removedCharCount:f,addedCharCount:o,removedLineCount:m,addedLineCount:e})}};j.EventTarget.addMixin(i.prototype);return{ProjectionTextModel:i}});
define("orion/editor/keyBinding",["orion/editor/util"],function(k){function j(i,a,g,h,d){this.keyCode=typeof i==="string"?i.toUpperCase().charCodeAt(0):i;this.mod1=a!==void 0&&a!==null?a:!1;this.mod2=g!==void 0&&g!==null?g:!1;this.mod3=h!==void 0&&h!==null?h:!1;this.mod4=d!==void 0&&d!==null?d:!1}j.prototype={match:function(i){return this.keyCode===i.keyCode?this.mod1!==(k.isMac?i.metaKey:i.ctrlKey)?!1:this.mod2!==i.shiftKey?!1:this.mod3!==i.altKey?!1:k.isMac&&this.mod4!==i.ctrlKey?!1:!0:!1},equals:function(i){return!i?
!1:this.keyCode!==i.keyCode?!1:this.mod1!==i.mod1?!1:this.mod2!==i.mod2?!1:this.mod3!==i.mod3?!1:this.mod4!==i.mod4?!1:!0}};return{KeyBinding:j}});
define("orion/editor/contentAssist",["i18n!orion/editor/nls/messages","orion/editor/keyBinding","orion/editor/eventTarget","orion/Deferred","orion/editor/util"],function(k,j,i,a,g){var h,d,f;function c(b){this.textView=b;this.state=h;this.providers=[];var a=this;this.contentAssistListener={onModelChanging:function(b){a.isDeactivatingChange(b)?a.setState(h):a.state===d&&a.setState(f)},onScroll:function(){a.setState(h)},onSelection:function(){var b=a.state;if(b===d||b===f)a.computeProposals(),a.setState(f)}};
b.setKeyBinding(g.isMac?new j.KeyBinding(" ",!1,!1,!1,!0):new j.KeyBinding(" ",!0),"contentAssist");b.setAction("contentAssist",function(){a.activate();return!0},{name:k.contentAssist})}function b(b,a){this.contentAssist=b;this.widget=a;this.proposals=[];var c=this;this.contentAssist.addEventListener("ProposalsComputed",function(b){c.proposals=b.data.proposals;c.selectedIndex=c.proposals.length?0:-1})}function e(b,a){this.contentAssist=b;this.textView=this.contentAssist.getTextView();this.isShowing=
this.textViewListenerAdded=!1;var c=this.textView.getOptions("parent").ownerDocument;this.parentNode=typeof a==="string"?c.getElementById(a):a;if(!this.parentNode){this.parentNode=g.createElement(c,"div");this.parentNode.className="contentassist";var l=c.getElementsByTagName("body")[0];if(l)l.appendChild(this.parentNode);else throw Error("parentNode is required");}var e=this;this.textViewListener={onMouseDown:function(b){b.event.target.parentElement!==e.parentNode&&e.contentAssist.deactivate()}};
this.contentAssist.addEventListener("ProposalsComputed",function(b){e.setProposals(b.data.proposals);e.show();if(!e.textViewListenerAdded)e.textView.addEventListener("MouseDown",e.textViewListener.onMouseDown),e.textViewListenerAdded=!0});this.contentAssist.addEventListener("Deactivating",function(){e.setProposals([]);e.hide();if(e.textViewListenerAdded)e.textView.removeEventListener("MouseDown",e.textViewListener.onMouseDown),e.textViewListenerAdded=!1;e.textViewListenerAdded=!1});this.scrollListener=
function(){e.isShowing&&e.position()};c.addEventListener("scroll",this.scrollListener)}h=1;d=2;f=3;var m={selected:" selected",hr:"proposal-hr",emphasis:"proposal-emphasis",noemphasis:"proposal-noemphasis",dfault:"proposal-default"};c.prototype={apply:function(b){if(!b)return!1;var a=this.textView.getCaretOffset(),c={proposal:b,start:a,end:a};this.setState(h);this.textView.setText(b.proposal||b,a,a);this.dispatchEvent({type:"ProposalApplied",data:c});return!0},activate:function(){this.state===h&&
this.setState(d)},deactivate:function(){this.setState(h)},getTextView:function(){return this.textView},isActive:function(){return this.state===d||this.state===f},isDeactivatingChange:function(b){var a=b.removedCharCount>0&&b.addedCharCount===0,c=this.textView,c=b.start+1<=c.getModel().getCharCount()&&/^\s*$/.test(c.getText(b.start,b.start+1));return b.removedLineCount>0||b.addedLineCount>0||a&&c},setState:function(b){var a;b===d?a="Activating":b===h&&(a="Deactivating");a&&this.dispatchEvent({type:a});
this.state=b;this.onStateChange(b)},onStateChange:function(b){if(b===h){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(b===d){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 b=this;this._computeProposals(this.textView.getCaretOffset()).then(function(a){b.dispatchEvent({type:"ProposalsComputed",data:{proposals:a}})})},getPrefixStart:function(b){for(;b>0&&/[A-Za-z0-9_]/.test(this.textView.getText(b-1,b));)b--;return b},handleError:function(b){typeof console!==
"undefined"&&(console.log("Error retrieving content assist proposals"),console.log(b))},_computeProposals:function(b){var c=this.providers,e=this.textView,l=e.getModel(),p=e.getText(),o={line:l.getLine(l.getLineAtOffset(b)),prefix:e.getText(this.getPrefixStart(b),b),selection:e.getSelection()},u=this,c=c.map(function(l){var c=l.computeProposals||l.getProposals,e;try{typeof c==="function"&&(e=u.progress?u.progress.progress(c.apply(l,[p,b,o]),"Generating content assist proposal"):c.apply(l,[p,b,o]))}catch(d){u.handleError(d)}return a.when(e)});
return a.all(c,this.handleError).then(function(b){return b.reduce(function(b,a){return a instanceof Array?b.concat(a):b},[])})},setProviders:function(b){this.providers=b.slice(0)},setProgress:function(b){this.progress=b}};i.EventTarget.addMixin(c.prototype);b.prototype={cancel:function(){this.getContentAssist().deactivate()},getContentAssist:function(){return this.contentAssist},isActive:function(){return this.getContentAssist().isActive()},lineUp:function(){for(var b=this.selectedIndex===0?this.proposals.length-
1:this.selectedIndex-1;this.proposals[b].unselectable&&b>0;)b--;this.selectedIndex=b;this.widget&&this.widget.setSelectedIndex(this.selectedIndex);return!0},lineDown:function(){for(var b=this.selectedIndex===this.proposals.length-1?0:this.selectedIndex+1;this.proposals[b].unselectable&&b<this.proposals.length-1;)b++;this.selectedIndex=b;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}};e.prototype={onClick:function(b){this.contentAssist.apply(this.getProposal(b.target));this.textView.focus()},createDiv:function(b,a,c,l){var e=c.ownerDocument,o=g.createElement(e,"div");o.id="contentoption"+l;o.setAttribute("role","option");b.style==="hr"?b=g.createElement(e,"hr"):(o.className=this.calculateClasses(b.style,a),b=e.createTextNode(this.getDisplayString(b)),a&&this.parentNode.setAttribute("aria-activedescendant",
o.id));o.appendChild(b,o);c.appendChild(o)},createAccessible:function(b){this._isAccessible||this.parentNode.addEventListener("keydown",function(a){a.preventDefault();if(a.keyCode===27)return b.cancel();else if(a.keyCode===38)return b.lineUp();else if(a.keyCode===40)return b.lineDown();else if(a.keyCode===13)return b.enter();return!1});this._isAccessible=!0},calculateClasses:function(b,a){var c=m[b];if(!c)c=m.dfault;return a?c+m.selected:c},getDisplayString:function(b){return typeof b==="string"?
b:b.description&&typeof b.description==="string"?b.description:b.proposal},getProposal:function(b){for(var a=0,c=this.parentNode.firstChild;c!==null;c=c.nextSibling){if(c===b)return this.proposals[a]||null;a++}return null},setSelectedIndex:function(b){this.selectedIndex=b;this.selectNode(this.parentNode.childNodes[this.selectedIndex])},selectNode:function(b){for(var a=this.parentNode.childNodes,c=0;c<a.length;c++){var l=a[c],e=l.className.indexOf(m.selected);if(e>=0)l.className=l.className.substring(0,
e)+l.className.substring(e+m.selected.length);l===b&&(l.className+=m.selected,this.parentNode.setAttribute("aria-activedescendant",l.id),l.focus(),l.offsetTop<this.parentNode.scrollTop?l.scrollIntoView(!0):l.offsetTop+l.offsetHeight>this.parentNode.scrollTop+this.parentNode.clientHeight&&l.scrollIntoView(!1))}},setProposals:function(b){this.proposals=b},show:function(){if(this.proposals.length===0)this.hide();else{this.parentNode.innerHTML="";for(var b=0;b<this.proposals.length;b++)this.createDiv(this.proposals[b],
b===0,this.parentNode,b);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 b=this.textView.getLocationAtOffset(this.textView.getCaretOffset());b.y+=this.textView.getLineHeight();this.textView.convert(b,"document","page");this.parentNode.style.position="fixed";
this.parentNode.style.left=b.x+"px";this.parentNode.style.top=b.y+"px";this.parentNode.style.display="block";this.parentNode.scrollTop=0;var a=this.parentNode.ownerDocument,c=a.documentElement.clientWidth;if(b.y+this.parentNode.offsetHeight>a.documentElement.clientHeight)this.parentNode.style.top=b.y-this.parentNode.offsetHeight-this.textView.getLineHeight()+"px";if(b.x+this.parentNode.offsetWidth>c)this.parentNode.style.left=c-this.parentNode.offsetWidth+"px"}};return{ContentAssist:c,ContentAssistMode:b,
ContentAssistWidget:e}});
define("orion/editor/textView",["orion/editor/textModel","orion/editor/keyBinding","orion/editor/eventTarget","orion/editor/util"],function(k,j,i,a){function g(b,a,c,e){typeof b.addEventListener==="function"?b.addEventListener(a,c,e===!0):b.attachEvent("on"+a,c)}function h(b,c,e){if(e){c.className="";for(var e=c.attributes,d=e.length;d-- >0;)(!a.isIE||a.isIE>=9||a.isIE<9&&e[d].specified)&&c.removeAttribute(e[d].name)}if(b){if(b.styleClass)c.className=b.styleClass;if(e=b.style)for(var f in e)e.hasOwnProperty(f)&&(c.style[f]=
e[f]);if(b=b.attributes)for(var g in b)b.hasOwnProperty(g)&&c.setAttribute(g,b[g])}}function d(b){return b instanceof Array?b.slice(0):b}function f(b,a){if(b===a)return!0;if(b&&!a||!b&&a)return!1;if(b&&b.constructor===String||a&&a.constructor===String)return!1;if(b instanceof Array||a instanceof Array){if(!(b instanceof Array&&a instanceof Array))return!1;if(b.length!==a.length)return!1;for(var c=0;c<b.length;c++)if(!f(b[c],a[c]))return!1;return!0}if(!(b instanceof Object)||!(a instanceof Object))return!1;
for(c in b)if(b.hasOwnProperty(c)){if(!a.hasOwnProperty(c))return!1;if(!f(b[c],a[c]))return!1}for(c in a)if(!b.hasOwnProperty(c))return!1;return!0}function c(b,a,c){for(var e=0,d=0,f=0,g=b.length;f<g;){e!==-1&&e<=f&&(e=b.indexOf("\r",f));d!==-1&&d<=f&&(d=b.indexOf("\n",f));var m=f,h;if(d===-1&&e===-1){a(b.substring(f));break}e!==-1&&d!==-1?e+1===d?(h=e,f=d+1):(h=e<d?e:d,f=(e<d?e:d)+1):e!==-1?(h=e,f=e+1):(h=d,f=d+1);a(b.substring(m,h));c()}}function b(b){var a,c,e,d,f=b.ownerDocument.defaultView||
b.ownerDocument.parentWindow;if(f.getComputedStyle)b=f.getComputedStyle(b,null),a=b.getPropertyValue("padding-left"),c=b.getPropertyValue("padding-top"),e=b.getPropertyValue("padding-right"),d=b.getPropertyValue("padding-bottom");else if(b.currentStyle)a=b.currentStyle.paddingLeft,c=b.currentStyle.paddingTop,e=b.currentStyle.paddingRight,d=b.currentStyle.paddingBottom;return{left:parseInt(a,10)||0,top:parseInt(c,10)||0,right:parseInt(e,10)||0,bottom:parseInt(d,10)||0}}function e(a){var c,e,d,f,g=
a._trim;if(!g){var g=b(a),m=a.ownerDocument.defaultView||a.ownerDocument.parentWindow;if(m.getComputedStyle)f=m.getComputedStyle(a,null),c=f.getPropertyValue("border-left-width"),e=f.getPropertyValue("border-top-width"),d=f.getPropertyValue("border-right-width"),f=f.getPropertyValue("border-bottom-width");else if(a.currentStyle)c=a.currentStyle.borderLeftWidth,e=a.currentStyle.borderTopWidth,d=a.currentStyle.borderRightWidth,f=a.currentStyle.borderBottomWidth;c=parseInt(c,10)||0;e=parseInt(e,10)||
0;d=parseInt(d,10)||0;f=parseInt(f,10)||0;g.left+=c;g.top+=e;g.right+=d;g.bottom+=f;a._trim=g}return g}function m(b,a,c){this.start=b;this.end=a;this.caret=c}function n(b){this.left=b.left;this.top=b.top;this.right=b.right;this.bottom=b.bottom}function r(b,a,c){this.view=b;this.lineIndex=a;this._lineDiv=c}function q(b){this._init(b)}m.prototype={clone:function(){return new m(this.start,this.end,this.caret)},collapse:function(){this.caret?this.end=this.start:this.start=this.end},extend:function(b){this.caret?
this.start=b:this.end=b;if(this.start>this.end)b=this.start,this.start=this.end,this.end=b,this.caret=!this.caret},setCaret:function(b){this.end=this.start=b;this.caret=!1},getCaret:function(){return this.caret?this.start:this.end},toString:function(){return"start="+this.start+" end="+this.end+(this.caret?" caret is at start":" caret is at end")},isEmpty:function(){return this.start===this.end},equals:function(b){return this.caret===b.caret&&this.start===b.start&&this.end===b.end}};n.prototype={toString:function(){return"{l="+
this.left+", t="+this.top+", r="+this.right+", b="+this.bottom+"}"}};r.prototype={create:function(b,a){if(!this._lineDiv){var c=this._lineDiv=this._createLine(b,a,this.lineIndex);c._line=this;return c}},_createLine:function(b,c,e){var d=this.view,g=d._model,m=g.getLine(e),t=g.getLineStart(e),n={type:"LineStyle",textView:d,lineIndex:e,lineText:m,lineStart:t};if(m.length<2E3)d.onLineStyle(n);g=c||a.createElement(b.ownerDocument,"div");if(!c||!f(c.viewStyle,n.style)){h(n.style,g,c);if(c)c._trim=null;
g.viewStyle=n.style;g.setAttribute("role","presentation")}g.lineIndex=e;e=[];this._createRanges(n.ranges,m,0,m.length,t,{tabOffset:0,ranges:e});m=" ";!d._fullSelection&&a.isIE<9&&(m="\ufeff");a.isWebkit&&(m="\u200c");e.push({text:m,style:d._metrics.largestFontStyle,ignoreChars:1});var i,j,k,r,q,m=d=0,w,A;if(c){if(j=c.modelChangedEvent)j.removedLineCount===0&&j.addedLineCount===0?(A=j.start-t,w=j.addedCharCount-j.removedCharCount):A=-1,c.modelChangedEvent=void 0;j=c.firstChild}for(t=0;t<e.length;t++){i=
e[t];r=i.text;d+=r.length;n=i.style;if(j)if(q=j.firstChild.data,k=j.viewStyle,q===r&&f(n,k)){m+=q.length;j._rectsCache=void 0;i=j=j.nextSibling;continue}else for(;j;){if(A!==-1){k=d;k>=A&&(k-=w);q=(q=j.firstChild.data)?q.length:0;if(m+q>k)break;m+=q}k=j.nextSibling;g.removeChild(j);j=k}i=this._createSpan(g,r,n,i.ignoreChars);j?g.insertBefore(i,j):g.appendChild(i);if(c)c.lineWidth=void 0}if(c)for(b=i?i.nextSibling:null;b;)k=b.nextSibling,c.removeChild(b),b=k;else b.appendChild(g);return g},_createRanges:function(b,
a,c,e,d,g){if(!(c>=e)){if(b)for(var m=0;m<b.length;m++){var h=b[m];if(!(h.end<=d+c)){var n=Math.max(d+c,h.start)-d;if(n>=e)break;var i=Math.min(d+e,h.end)-d;if(n<i){n=Math.max(c,n);i=Math.min(e,i);for(c<n&&this._createRange(a,c,n,null,g);m+1<b.length&&b[m+1].start-d===i&&f(h.style,b[m+1].style);)h=b[m+1],i=Math.min(d+e,h.end)-d,m++;this._createRange(a,n,i,h.style,g);c=i}}}c<e&&this._createRange(a,c,e,null,g)}},_createRange:function(b,a,c,e,d){if(!(a>=c)){var f=this.view._customTabSize;if(f&&f!==8)for(var g=
b.indexOf("\t",a);g!==-1&&g<c;){a<g&&(a={text:b.substring(a,g),style:e},d.ranges.push(a),d.tabOffset+=a.text.length);a=f-d.tabOffset%f;if(a>0){for(var m="\u00a0",h=1;h<a;h++)m+=" ";a={text:m,style:e,ignoreChars:a-1};d.ranges.push(a);d.tabOffset+=a.text.length}a=g+1;g=b.indexOf("\t",a)}a<c&&(a={text:b.substring(a,c),style:e},d.ranges.push(a),d.tabOffset+=a.text.length)}},_createSpan:function(b,c,e,d){var f=e&&e.tagName==="A";if(f)b.hasLink=!0;var f=f&&this.view._linksVisible?"a":"span",m=b.ownerDocument,
b=a.createElement(b.ownerDocument,f);b.appendChild(m.createTextNode(c));h(e,b);if(f==="A"){var t=this.view,n=this._getWindow();g(b,"click",function(b){return t._handleLinkClick(b?b:n.event)},!1)}b.viewStyle=e;if(d)b.ignoreChars=d;return b},_ensureCreated:function(){return this._lineDiv?this._lineDiv:this._createdDiv=this.create(this.view._clientDiv,null)},getBoundingClientRect:function(b,c){var e=this._ensureCreated(),d=this.view;if(b===void 0)return this._getLineBoundingClientRect(e,!0);var f=d._model,
g=e.ownerDocument,m=this.lineIndex,h=null;if(b<f.getLineEnd(m)){f=f.getLineStart(m);for(m=e.firstChild;m;){var i=m.firstChild,j=i.length;m.ignoreChars&&(j-=m.ignoreChars);if(f+j>b){h=b-f;if(d._isRangeRects)g=g.createRange(),g.setStart(i,h),g.setEnd(i,h+1),h=new n(g.getBoundingClientRect());else if(a.isIE)g=g.body.createTextRange(),g.moveToElementText(m),g.collapse(),g.moveEnd("character",h+1),g.moveStart("character",h),h=new n(g.getBoundingClientRect());else{var k=i.data;m.removeChild(i);m.appendChild(g.createTextNode(k.substring(0,
h)));var r=a.createElement(g,"span");r.appendChild(g.createTextNode(k.substring(h,h+1)));m.appendChild(r);m.appendChild(g.createTextNode(k.substring(h+1)));h=new n(r.getBoundingClientRect());m.innerHTML="";m.appendChild(i);this._createdDiv||(g=d._getSelection(),(f<=g.start&&g.start<f+j||f<=g.end&&g.end<f+j)&&d._updateDOMSelection())}a.isIE&&(g=e.ownerDocument.defaultView||e.ownerDocument.parentWindow,e=g.screen.logicalXDPI/g.screen.deviceXDPI,g=g.screen.logicalYDPI/g.screen.deviceYDPI,h.left*=e,h.right*=
e,h.top*=g,h.bottom*=g);break}f+=j;m=m.nextSibling}}e=this.getBoundingClientRect();if(!h)d._wrapMode?(d=this.getClientRects(),h=d[d.length-1],h.left=h.right,h.left+=e.left,h.top+=e.top,h.right+=e.left,h.bottom+=e.top):(h=new n(e),h.left=h.right);if(c||c===void 0)h.left-=e.left,h.top-=e.top,h.right-=e.left,h.bottom-=e.top;return h},_getClientRects:function(b,a){var c,e,d,f;if(!b._rectsCache){c=b.getClientRects();e=Array(c.length);for(f=0;f<c.length;f++)d=e[f]=new n(c[f]),d.left-=a.left,d.top-=a.top,
d.right-=a.left,d.bottom-=a.top;b._rectsCache=e}c=b._rectsCache;e=[c.length];for(f=0;f<c.length;f++)e[f]=new n(c[f]);return e},getClientRects:function(b){if(!this.view._wrapMode)return[this.getBoundingClientRect()];for(var a=this._ensureCreated(),c=[],e=a.firstChild,d,f=a.getBoundingClientRect();e;){for(var g=this._getClientRects(e,f),a=0;a<g.length;a++){var m=g[a],h;if(m.top!==m.bottom){var n=m.top+(m.bottom-m.top)/2;for(h=0;h<c.length;h++)if(d=c[h],d.top<=n&&n<d.bottom)break;if(h===c.length)c.push(m);
else{if(m.left<d.left)d.left=m.left;if(m.top<d.top)d.top=m.top;if(m.right>d.right)d.right=m.right;if(m.bottom>d.bottom)d.bottom=m.bottom}}}e=e.nextSibling}return b!==void 0?c[b]:c},_getLineBoundingClientRect:function(b,a){var c=new n(b.getBoundingClientRect());if(!this.view._wrapMode){c.right=c.left;for(var d=b.lastChild;d&&d.ignoreChars===d.firstChild.length;)d=d.previousSibling;if(d)d=d.getBoundingClientRect(),c.right=d.right+e(b).right}a&&(d=e(b),c.left+=d.left,c.right-=d.right);return c},getLineCount:function(){return!this.view._wrapMode?
1:this.getClientRects().length},getLineIndex:function(b){if(!this.view._wrapMode)return 0;for(var a=this.getClientRects(),b=this.getBoundingClientRect(b),b=b.top+(b.bottom-b.top)/2,c=0;c<a.length;c++)if(a[c].top<=b&&b<a[c].bottom)return c;return a.length-1},getLineStart:function(b){if(!this.view._wrapMode||b===0)return this.view._model.getLineStart(b);var a=this.getClientRects();return this.getOffset(a[b].left+1,a[b].top+1)},getOffset:function(b,c){var e=this.view,d=e._model,f=this.lineIndex,g=d.getLineStart(f),
d=d.getLineEnd(f);if(g===d)return g;var m=this._ensureCreated(),f=this.getBoundingClientRect(),h,n;if(e._wrapMode){h=this.getClientRects();if(c<h[0].top)c=h[0].top;for(var i=0;i<h.length;i++)if(n=h[i],n.top<=c&&c<n.bottom)break;if(b<n.left)b=n.left;b>n.right&&(b=n.right-1)}else b<0&&(b=0),b>f.right-f.left&&(b=f.right-f.left);var j=m.ownerDocument,i=j.defaultView||j.parentWindow,k=a.isIE?i.screen.logicalXDPI/i.screen.deviceXDPI:1,r=a.isIE?i.screen.logicalYDPI/i.screen.deviceYDPI:1,i=g,q=m.firstChild;
a:for(;q;){var A=q.firstChild,m=A.length;q.ignoreChars&&(m-=q.ignoreChars);var D,E,H;h=this._getClientRects(q,f);for(var B=0;B<h.length;B++)if(n=h[B],n.left<=b&&b<n.right&&(!e._wrapMode||n.top<=c&&c<n.bottom)){if(a.isIE||e._isRangeRects){for(var j=e._isRangeRects?j.createRange():j.body.createTextRange(),B=m,C=-1;B-C>1;){var S=Math.floor((B+C)/2);n=C+1;h=S===m-1&&q.ignoreChars?A.length:S+1;e._isRangeRects?(j.setStart(A,n),j.setEnd(A,h)):(j.moveToElementText(q),j.move("character",n),j.moveEnd("character",
h-n));h=j.getClientRects();for(var T=!1,O=0;O<h.length;O++)if(n=h[O],D=n.left*k-f.left,H=n.right*k-f.left,E=n.top*r-f.top,n=n.bottom*r-f.top,D<=b&&b<H&&(!e._wrapMode||E<=c&&c<n)){T=!0;break}T?B=S:C=S}i+=B;n=B;h=B===m-1&&q.ignoreChars?A.length:Math.min(B+1,A.length);e._isRangeRects?(j.setStart(A,n),j.setEnd(A,h)):(j.moveToElementText(q),j.move("character",n),j.moveEnd("character",h-n));n=j.getClientRects()[0];D=n.left*k-f.left;H=n.right*k-f.left;b>D+(H-D)/2&&i++}else{n=[];for(k=0;k<m;k++)n.push("<span>"),
k===m-1?n.push(A.data.substring(k)):n.push(A.data.substring(k,k+1)),n.push("</span>");q.innerHTML=n.join("");for(k=q.firstChild;k;){n=k.getBoundingClientRect();D=n.left-f.left;H=n.right-f.left;if(D<=b&&b<H){b>D+(H-D)/2&&i++;break}i++;k=k.nextSibling}if(!this._createdDiv)q.innerHTML="",q.appendChild(A),f=e._getSelection(),(i<=f.start&&f.start<i+m||i<=f.end&&f.end<i+m)&&e._updateDOMSelection()}break a}i+=m;q=q.nextSibling}return Math.min(d,Math.max(g,i))},getNextOffset:function(b,c,e){return c==="line"?
(c=this.view._model,b=c.getLineAtOffset(b),e>0?c.getLineEnd(b):c.getLineStart(b)):c==="wordend"?this._getNextOffset_W3C(b,c,e):a.isIE?this._getNextOffset_IE(b,c,e):this._getNextOffset_W3C(b,c,e)},_getNextOffset_W3C:function(b,a,c){function e(b){return 33<=b&&b<=47||58<=b&&b<=64||91<=b&&b<=94||b===96||123<=b&&b<=126}if(a==="word"||a==="wordend"){var d=this.view._model,f=d.getLineAtOffset(b),g=d.getLine(f),m=d.getLineStart(f),f=d.getLineEnd(f),d=g.length;b-=m;var h,n;if(c>0){if(b===d)return f;h=g.charCodeAt(b);
n=e(h);c=!n&&!(h===32||h===9);for(b++;b<d;){h=g.charCodeAt(b);f=e(h);if(a==="wordend"){if(!f&&n)break}else if(f&&!n)break;h=!f&&!(h===32||h===9);if(a==="wordend"){if(!h&&c)break}else if(h&&!c)break;c=h;n=f;b++}}else{if(b===0)return m;b--;h=g.charCodeAt(b);n=e(h);for(c=!n&&!(h===32||h===9);0<b;){h=g.charCodeAt(b-1);f=e(h);if(a==="wordend"){if(f&&!n)break}else if(!f&&n)break;h=!f&&!(h===32||h===9);if(a==="wordend"){if(h&&!c)break}else if(!h&&c)break;c=h;n=f;b--}}return m+b}return b+c},_getNextOffset_IE:function(b,
a,c){var e=this._ensureCreated(),d=this.view._model,f=this.lineIndex,g=0,m;m=d.getLineStart(f);var h=e.ownerDocument;if(b===d.getLineEnd(f))g=h.body.createTextRange(),g.moveToElementText(e.lastChild),m=g.text.length,g.moveEnd(a,c),g=b+g.text.length-m;else if(b===m&&c<0)g=m;else for(e=e.firstChild;e;){d=e.firstChild.length;e.ignoreChars&&(d-=e.ignoreChars);if(m+d>b){g=h.body.createTextRange();b===m&&c<0?g.moveToElementText(e.previousSibling):(g.moveToElementText(e),g.collapse(),g.moveEnd("character",
b-m));m=g.text.length;g.moveEnd(a,c);g=b+g.text.length-m;break}m=d+m;e=e.nextSibling}return g},destroy:function(){var b=this._createdDiv;if(b)b.parentNode.removeChild(b),this._createdDiv=null}};q.prototype={addRuler:function(b,a){b.setView(this);var c=this._rulers;if(a!==void 0){var e,d;for(e=0,d=0;e<c.length&&d<a;e++)b.getLocation()===c[e].getLocation()&&d++;c.splice(d,0,b);a=d}else c.push(b);this._createRuler(b,a);this._update()},computeSize:function(){var b=0,c=0,e=this._model,d=this._clientDiv;
if(!d)return{width:b,height:c};var f=d.style.width;if(a.isWebkit)d.style.width="0x7fffffffpx";for(var e=e.getLineCount(),g=0;g<e;g++){var m=this._getLine(g),h=m.getBoundingClientRect(),b=Math.max(b,h.right-h.left);c+=h.bottom-h.top;m.destroy()}if(a.isWebkit)d.style.width=f;d=this._getViewPadding();b+=d.right+d.left;c+=d.bottom+d.top;return{width:b,height:c}},convert:function(b,a,c){if(this._clientDiv){var e=this._getScroll(),d=this._getViewPadding(),f=this._viewDiv.getBoundingClientRect();a==="document"&&
(b.x!==void 0&&(b.x+=-e.x+f.left+d.left),b.y!==void 0&&(b.y+=-e.y+f.top+d.top));c==="document"&&(b.x!==void 0&&(b.x+=e.x-f.left-d.left),b.y!==void 0&&(b.y+=e.y-f.top-d.top));return b}},destroy:function(){for(var b=0;b<this._rulers.length;b++)this._rulers[b].setView(null);this.rulers=null;this._destroyView();this.onDestroy({type:"Destroy"});this._actions=this._keyBindings=this._doubleClickSelection=this._selection=this._model=this._parent=null},focus:function(){this._clientDiv&&(this._updateDOMSelection(),
a.isOpera&&this._clientDiv.blur(),this._clientDiv.focus(),this._updateDOMSelection())},hasFocus:function(){return this._hasFocus},getActionDescription:function(b){if(b=this._actions[b])return b.actionDescription},getActions:function(b){var a=[],c=this._actions,e;for(e in c)c.hasOwnProperty(e)&&(b||!c[e].defaultHandler)&&a.push(e);return a},getBottomIndex:function(b){return!this._clientDiv?0:this._getBottomIndex(b)},getBottomPixel:function(){return!this._clientDiv?0:this._getScroll().y+this._getClientHeight()},
getCaretOffset:function(){return this._getSelection().getCaret()},getClientArea:function(){if(!this._clientDiv)return{x:0,y:0,width:0,height:0};var b=this._getScroll();return{x:b.x,y:b.y,width:this._getClientWidth(),height:this._getClientHeight()}},getHorizontalPixel:function(){return!this._clientDiv?0:this._getScroll().x},getKeyBindings:function(b){for(var a=[],c=this._keyBindings,e=0;e<c.length;e++)c[e].actionID===b&&a.push(c[e].keyBinding);return a},getLineHeight:function(b){return!this._clientDiv?
0:this._getLineHeight(b)},getLineIndex:function(b){return!this._clientDiv?0:this._getLineIndex(b)},getLinePixel:function(b){return!this._clientDiv?0:this._getLinePixel(b)},getLocationAtOffset:function(b){if(!this._clientDiv)return{x:0,y:0};var a=this._model,b=Math.min(Math.max(0,b),a.getCharCount()),a=a.getLineAtOffset(b),c=this._getLine(a),b=c.getBoundingClientRect(b);c.destroy();c=b.left;a=this._getLinePixel(a)+b.top;return{x:c,y:a}},getOptions:function(){var b;if(arguments.length===0)b=this._defaultOptions();
else if(arguments.length===1){if(b=arguments[0],typeof b==="string")return d(this["_"+b])}else{b={};for(var a in arguments)arguments.hasOwnProperty(a)&&(b[arguments[a]]=void 0)}for(var c in b)b.hasOwnProperty(c)&&(b[c]=d(this["_"+c]));return b},getModel:function(){return this._model},getOffsetAtLocation:function(b,a){if(!this._clientDiv)return 0;var c=this._getLineIndex(a),e=this._getLine(c),c=e.getOffset(b,a-this._getLinePixel(c));e.destroy();return c},getRulers:function(){return this._rulers.slice(0)},
getSelection:function(){var b=this._getSelection();return{start:b.start,end:b.end}},getText:function(b,a){return this._model.getText(b,a)},getTopIndex:function(b){return!this._clientDiv?0:this._getTopIndex(b)},getTopPixel:function(){return!this._clientDiv?0:this._getScroll().y},invokeAction:function(b,a){if(this._clientDiv){var c=this._actions[b];if(c){if(!a&&c.handler&&c.handler())return;if(c.defaultHandler)return c.defaultHandler()}return!1}},isDestroyed:function(){return!this._clientDiv},onContextMenu:function(b){return this.dispatchEvent(b)},
onDragStart:function(b){return this.dispatchEvent(b)},onDrag:function(b){return this.dispatchEvent(b)},onDragEnd:function(b){return this.dispatchEvent(b)},onDragEnter:function(b){return this.dispatchEvent(b)},onDragOver:function(b){return this.dispatchEvent(b)},onDragLeave:function(b){return this.dispatchEvent(b)},onDrop:function(b){return this.dispatchEvent(b)},onDestroy:function(b){return this.dispatchEvent(b)},onLineStyle:function(b){return this.dispatchEvent(b)},onModelChanged:function(b){return this.dispatchEvent(b)},
onModelChanging:function(b){return this.dispatchEvent(b)},onModify:function(b){return this.dispatchEvent(b)},onMouseDown:function(b){return this.dispatchEvent(b)},onMouseUp:function(b){return this.dispatchEvent(b)},onMouseMove:function(b){return this.dispatchEvent(b)},onMouseOver:function(b){return this.dispatchEvent(b)},onMouseOut:function(b){return this.dispatchEvent(b)},onSelection:function(b){return this.dispatchEvent(b)},onScroll:function(b){return this.dispatchEvent(b)},onVerify:function(b){return this.dispatchEvent(b)},
onFocus:function(b){return this.dispatchEvent(b)},onBlur:function(b){return this.dispatchEvent(b)},redraw:function(){if(!(this._redrawCount>0)){var b=this._model.getLineCount();this.redrawRulers(0,b);this.redrawLines(0,b)}},redrawRulers:function(b,a){if(!(this._redrawCount>0))for(var c=this.getRulers(),e=0;e<c.length;e++)this.redrawLines(b,a,c[e])},redrawLines:function(b,a,c){if(!(this._redrawCount>0)&&(b===void 0&&(b=0),a===void 0&&(a=this._model.getLineCount()),b!==a)){var e=this._clientDiv;if(e){if(c)for(var d=
(c.getLocation()==="left"?this._leftDiv:this._rightDiv).firstChild.rows[0].cells,f=0;f<d.length;f++)if(d[f].firstChild._ruler===c){e=d[f].firstChild;break}c?e.rulerChanged=!0:this._lineHeight&&this._resetLineHeight(b,a);if(!c||c.getOverview()==="page")for(e=e.firstChild;e;){d=e.lineIndex;if(b<=d&&d<a)e.lineChanged=!0;e=e.nextSibling}if(!c&&!this._wrapMode&&b<=this._maxLineIndex&&this._maxLineIndex<a)this._checkMaxLineIndex=this._maxLineIndex,this._maxLineIndex=-1,this._maxLineWidth=0;this._queueUpdate()}}},
redrawRange:function(b,a){if(!(this._redrawCount>0)){var c=this._model;b===void 0&&(b=0);a===void 0&&(a=c.getCharCount());var e=c.getLineAtOffset(b),c=c.getLineAtOffset(Math.max(b,a-1))+1;this.redrawLines(e,c)}},removeRuler:function(b){for(var a=this._rulers,c=0;c<a.length;c++)if(a[c]===b){a.splice(c,1);b.setView(null);this._destroyRuler(b);this._update();break}},resize:function(){this._clientDiv&&this._handleResize(null)},setAction:function(b,a,c){if(b){var e=this._actions,d=e[b];d||(d=e[b]={});
d.handler=a;d.actionDescription=c}},setKeyBinding:function(b,a){for(var c=this._keyBindings,e=0;e<c.length;e++){var d=c[e];if(d.keyBinding.equals(b)){a?d.actionID=a:d.predefined?d.actionID=null:c.splice(e,1);return}}a&&c.push({keyBinding:b,actionID:a})},setCaretOffset:function(b,a){var c=this._model.getCharCount(),b=Math.max(0,Math.min(b,c));this._setSelection(new m(b,b,!1),a===void 0||a)},setHorizontalPixel:function(b){this._clientDiv&&(b=Math.max(0,b),this._scrollView(b-this._getScroll().x,0))},
setRedraw:function(b){b?--this._redrawCount===0&&this.redraw():this._redrawCount++},setModel:function(b){if(b&&b!==this._model){this._model.removeEventListener("preChanging",this._modelListener.onChanging);this._model.removeEventListener("postChanged",this._modelListener.onChanged);var a=this._model.getLineCount(),c=this._model.getCharCount(),e=b.getLineCount(),d=b.getCharCount(),f={type:"ModelChanging",text:b.getText(),start:0,removedCharCount:c,addedCharCount:d,removedLineCount:a,addedLineCount:e};
this.onModelChanging(f);this._model=b;f={type:"ModelChanged",start:0,removedCharCount:c,addedCharCount:d,removedLineCount:a,addedLineCount:e};this.onModelChanged(f);this._model.addEventListener("preChanging",this._modelListener.onChanging);this._model.addEventListener("postChanged",this._modelListener.onChanged);this._reset();this._update()}},setOptions:function(b){var a=this._defaultOptions(),c;for(c in b)if(b.hasOwnProperty(c)){var e=b[c];if(!f(this["_"+c],e)){var g=a[c]?a[c].update:null;g?g.call(this,
e):this["_"+c]=d(e)}}},setSelection:function(b,a,c){var e=b>a;if(e)var d=b,b=a,a=d;d=this._model.getCharCount();b=Math.max(0,Math.min(b,d));a=Math.max(0,Math.min(a,d));this._setSelection(new m(b,a,e),c===void 0||c)},setText:function(b,c,e){var d=c===void 0&&e===void 0;c===void 0&&(c=0);e===void 0&&(e=this._model.getCharCount());this._modifyContent({text:b,start:c,end:e,_code:!0},!d);if(d)this._columnX=-1,this._setSelection(new m(0,0,!1),!0),a.isFirefox&&this._fixCaret()},setTopIndex:function(b){this._clientDiv&&
this._scrollView(0,this._getLinePixel(Math.max(0,b))-this._getScroll().y)},setTopPixel:function(b){this._clientDiv&&this._scrollView(0,Math.max(0,b)-this._getScroll().y)},showSelection:function(){return this._showCaret(!0)},update:function(b,a){this._clientDiv&&(b&&this._updateStyle(),a===void 0||a?this._update():this._queueUpdate())},_handleRootMouseDown:function(b){if(a.isFirefox&&b.which===1)this._clientDiv.contentEditable=!1,this._ignoreBlur=(this._overlayDiv||this._clientDiv).draggable=!0;var c=
this._overlayDiv||this._clientDiv;if(a.isIE<9)c=this._viewDiv;for(var e=b.target?b.target:b.srcElement;e;){if(c===e)return;e=e.parentNode}b.preventDefault&&b.preventDefault();b.stopPropagation&&b.stopPropagation();if(!this._isW3CEvents){var d=this;this._getWindow().setTimeout(function(){d._clientDiv.focus()},0)}},_handleRootMouseUp:function(b){if(a.isFirefox&&b.which===1)this._clientDiv.contentEditable=!0,(this._overlayDiv||this._clientDiv).draggable=!1,this._fixCaret(),this._ignoreBlur=!1},_handleBlur:function(){if(!this._ignoreBlur){this._hasFocus=
!1;if(a.isIE<9&&!this._getSelection().isEmpty()){var b=this._rootDiv,c=a.createElement(b.ownerDocument,"div");b.appendChild(c);b.removeChild(c)}if(this._selDiv1)if(this._selDiv1.style.background="lightgray",this._selDiv2.style.background="lightgray",this._selDiv3.style.background="lightgray",b=this._getWindow(),c=this._selDiv1.ownerDocument,b.getSelection){c=b.getSelection();for(b=c.anchorNode;b;){if(b===this._clientDiv){c.rangeCount>0&&c.removeAllRanges();break}b=b.parentNode}}else if(c.selection){this._ignoreSelect=
!1;for(b=c.selection.createRange().parentElement();b;){if(b===this._clientDiv){c.selection.empty();break}b=b.parentNode}this._ignoreSelect=!0}if(!this._ignoreFocus)this.onBlur({type:"Blur"})}},_handleContextMenu:function(b){a.isIE&&this._lastMouseButton===3&&this._updateDOMSelection();var c=!1;if(this.isListening("ContextMenu"))c=this._createMouseEvent("ContextMenu",b),c.screenX=b.screenX,c.screenY=b.screenY,this.onContextMenu(c),c=c.defaultPrevented;if(c)return b.preventDefault&&b.preventDefault(),
!1},_handleCopy:function(b){if(!this._ignoreCopy&&this._doCopy(b))return b.preventDefault&&b.preventDefault(),!1},_handleCut:function(b){if(this._doCut(b))return b.preventDefault&&b.preventDefault(),!1},_handleDataModified:function(){this._startIME()},_handleDblclick:function(b){this._lastMouseTime=b.timeStamp?b.timeStamp:(new Date).getTime();if(this._clickCount!==2)this._clickCount=2,this._handleMouse(b)},_handleDragStart:function(b){if(a.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",b)),this._dragOffset=-1;else return b.preventDefault&&b.preventDefault(),!1},_handleDrag:function(b){if(this.isListening("Drag"))this.onDrag(this._createMouseEvent("Drag",b))},_handleDragEnd:function(b){this._dropTarget=!1;this._dragOffset=-1;if(this.isListening("DragEnd"))this.onDragEnd(this._createMouseEvent("DragEnd",
b));a.isFirefox&&(this._fixCaret(),b.dataTransfer.dropEffect==="none"&&!b.dataTransfer.mozUserCancelled&&this._fixCaret())},_handleDragEnter:function(b){var c=!0;this._dropTarget=!0;this.isListening("DragEnter")&&(c=!1,this.onDragEnter(this._createMouseEvent("DragEnter",b)));if(a.isWebkit||c)return b.preventDefault&&b.preventDefault(),!1},_handleDragOver:function(b){var c=!0;this.isListening("DragOver")&&(c=!1,this.onDragOver(this._createMouseEvent("DragOver",b)));if(a.isWebkit||c){if(c)b.dataTransfer.dropEffect=
"none";b.preventDefault&&b.preventDefault();return!1}},_handleDragLeave:function(b){this._dropTarget=!1;if(this.isListening("DragLeave"))this.onDragLeave(this._createMouseEvent("DragLeave",b))},_handleDrop:function(b){this._dropTarget=!1;if(this.isListening("Drop"))this.onDrop(this._createMouseEvent("Drop",b));b.preventDefault&&b.preventDefault();return!1},_handleFocus:function(){this._hasFocus=!0;a.isIOS&&this._lastTouchOffset!==void 0?(this.setCaretOffset(this._lastTouchOffset,!0),this._lastTouchOffset=
void 0):this._updateDOMSelection();if(this._selDiv1){var b=this._highlightRGB;this._selDiv1.style.background=b;this._selDiv2.style.background=b;this._selDiv3.style.background=b}if(!this._ignoreFocus)this.onFocus({type:"Focus"})},_handleKeyDown:function(b){var c=!1;switch(b.keyCode){case 16:case 17:case 18:case 91:c=!0;break;default:this._setLinksVisible(!1)}if(b.keyCode===229){if(this._readonly)return b.preventDefault&&b.preventDefault(),!1;c=!0;a.isSafari&&a.isMac&&b.ctrlKey&&(c=!1);c&&this._startIME()}else c||
this._commitIME();if((a.isMac||a.isLinux)&&a.isFirefox<4||a.isOpera)return this._keyDownEvent=b,!0;if(this._doAction(b))return b.preventDefault?(b.preventDefault(),b.stopPropagation()):(b.cancelBubble=!0,b.returnValue=!1,b.keyCode=0),!1},_handleKeyPress:function(b){if(a.isMac&&a.isWebkit&&(63232<=b.keyCode&&b.keyCode<=63487||b.keyCode===13||b.keyCode===8))return b.preventDefault&&b.preventDefault(),!1;if(((a.isMac||a.isLinux)&&a.isFirefox<4||a.isOpera)&&this._doAction(this._keyDownEvent))return b.preventDefault&&
b.preventDefault(),!1;var c=a.isMac?b.metaKey:b.ctrlKey;if(b.charCode!==void 0&&c)switch(b.charCode){case 99:case 118:case 120:return!0}c=!1;if(a.isMac){if(b.ctrlKey||b.metaKey)c=!0}else if(a.isFirefox){if(b.ctrlKey||b.altKey)c=!0}else b.ctrlKey^b.altKey&&(c=!0);if(!c&&(c=a.isOpera?b.which:b.charCode!==void 0?b.charCode:b.keyCode,c>31))return this._doContent(String.fromCharCode(c)),b.preventDefault&&b.preventDefault(),!1},_handleKeyUp:function(b){(a.isMac?b.metaKey:b.ctrlKey)||this._setLinksVisible(!1);
b.keyCode===13&&this._commitIME()},_handleLinkClick:function(b){if(!(a.isMac?b.metaKey:b.ctrlKey))return b.preventDefault&&b.preventDefault(),!1},_handleMouse:function(b){var c=this._getWindow(),e=!0,d=c;if(a.isIE||a.isFirefox&&!this._overlayDiv)d=this._clientDiv;if(this._overlayDiv){if(this._hasFocus)this._ignoreFocus=!0;var f=this;c.setTimeout(function(){f.focus();f._ignoreFocus=!1},0)}this._clickCount===1?(e=this._setSelectionTo(b.clientX,b.clientY,b.shiftKey,!a.isOpera&&this._hasFocus&&this.isListening("DragStart")))&&
this._setGrab(d):(this._isW3CEvents&&this._setGrab(d),this._doubleClickSelection=null,this._setSelectionTo(b.clientX,b.clientY,b.shiftKey),this._doubleClickSelection=this._getSelection());return e},_handleMouseDown:function(b){if(this._linksVisible)if((b.target||b.srcElement).tagName!=="A")this._setLinksVisible(!1);else return;this._commitIME();var c=b.which;c||(b.button===4&&(c=2),b.button===2&&(c=3),b.button===1&&(c=1));var e=c!==2&&b.timeStamp?b.timeStamp:(new Date).getTime(),d=e-this._lastMouseTime,
f=Math.abs(this._lastMouseX-b.clientX),g=Math.abs(this._lastMouseY-b.clientY),m=this._lastMouseButton===c;this._lastMouseX=b.clientX;this._lastMouseY=b.clientY;this._lastMouseTime=e;this._lastMouseButton=c;if(c===1)this._isMouseDown=!0,m&&d<=this._clickTime&&f<=this._clickDist&&g<=this._clickDist?this._clickCount++:this._clickCount=1;if(this.isListening("MouseDown")&&(e=this._createMouseEvent("MouseDown",b),this.onMouseDown(e),e.defaultPrevented)){b.preventDefault();return}if(c===1&&this._handleMouse(b)&&
(a.isIE>=9||a.isOpera||a.isChrome||a.isSafari||a.isFirefox&&!this._overlayDiv))this._hasFocus||this.focus(),b.preventDefault();a.isFirefox&&this._lastMouseButton===3&&this._updateDOMSelection()},_handleMouseOver:function(b){if(this.isListening("MouseOver"))this.onMouseOver(this._createMouseEvent("MouseOver",b))},_handleMouseOut:function(b){if(this.isListening("MouseOut"))this.onMouseOut(this._createMouseEvent("MouseOut",b))},_handleMouseMove:function(b){var c=this._isClientDiv(b);if(this.isListening("MouseMove")&&
c)this.onMouseMove(this._createMouseEvent("MouseMove",b));if(!this._dropTarget){var e=this._linksVisible||this._lastMouseMoveX!==b.clientX||this._lastMouseMoveY!==b.clientY;this._lastMouseMoveX=b.clientX;this._lastMouseMoveY=b.clientY;this._setLinksVisible(e&&!this._isMouseDown&&(a.isMac?b.metaKey:b.ctrlKey));if(!this._isW3CEvents){if(b.button===0)return this._setGrab(null),!0;if(!this._isMouseDown&&b.button===1&&(this._clickCount&1)!==0&&c)return this._clickCount=2,this._handleMouse(b,this._clickCount)}if(this._isMouseDown&&
this._dragOffset===-1){var c=b.clientX,b=b.clientY,d=this._getViewPadding(),f=this._viewDiv.getBoundingClientRect(),g=this._getClientWidth(),m=this._getClientHeight(),e=f.left+d.left,h=f.top+d.top,g=f.left+d.left+g,d=f.top+d.top+m,f=this._model,m=f.getLineAtOffset(this._getSelection().getCaret());b<h&&m!==0?this._doAutoScroll("up",c,b-h):b>d&&m!==f.getLineCount()-1?this._doAutoScroll("down",c,b-d):c<e&&!this._wrapMode?this._doAutoScroll("left",c-e,b):c>g&&!this._wrapMode?this._doAutoScroll("right",
c-g,b):(this._endAutoScroll(),this._setSelectionTo(c,b,!0))}}},_isClientDiv:function(b){for(var a=this._overlayDiv||this._clientDiv,b=b.target?b.target:b.srcElement;b;){if(a===b)return!0;b=b.parentNode}return!1},_createMouseEvent:function(b,a){var c=this.convert({x:a.clientX,y:a.clientY},"page","document");return{type:b,event:a,clickCount:this._clickCount,x:c.x,y:c.y,preventDefault:function(){this.defaultPrevented=!0}}},_handleMouseUp:function(b){var c=b.which?b.button===0:b.button===1;if(this.isListening("MouseUp")&&
(this._isClientDiv(b)||c&&this._isMouseDown))this.onMouseUp(this._createMouseEvent("MouseUp",b));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);a.isFirefox&&b.preventDefault()}},_handleMouseWheel:function(b){var c=this._getLineHeight(),e=0,d=0;a.isIE||a.isOpera?d=-b.wheelDelta/40*c:a.isFirefox?
(c=a.isMac?b.detail*3:Math.max(-256,Math.min(256,b.detail))*c,b.axis===b.HORIZONTAL_AXIS?e=c:d=c):a.isMac?(d=e=40,b.wheelDeltaX%120!==0&&(e=1),b.wheelDeltaY%120!==0&&(d=1),e=-b.wheelDeltaX/e,-1<e&&e<0&&(e=-1),0<e&&e<1&&(e=1),d=-b.wheelDeltaY/d,-1<d&&d<0&&(d=-1),0<d&&d<1&&(d=1)):(e=-b.wheelDeltaX,d=-b.wheelDeltaY/120*8*c);if(a.isSafari){for(c=b.target;c&&c.lineIndex===void 0;)c=c.parentNode;this._mouseWheelLine=c}c=this._getScroll();this._scrollView(e,d);e=this._getScroll();if(c.x!==e.x||c.y!==e.y)return b.preventDefault&&
b.preventDefault(),!1},_handlePaste:function(b){if(!this._ignorePaste&&this._doPaste(b)){if(a.isIE){var c=this;this._ignoreFocus=!0;this._getWindow().setTimeout(function(){c._updateDOMSelection();c._ignoreFocus=!1},0)}b.preventDefault&&b.preventDefault();return!1}},_handleResize:function(){var b=this._parent.clientWidth,c=this._parent.clientHeight;if(this._parentWidth!==b||this._parentHeight!==c)this._parentWidth!==b&&this._resetLineHeight(),this._parentWidth=b,this._parentHeight=c,a.isIE<9?this._queueUpdate():
this._update()},_handleRulerEvent:function(b){for(var a=b.target?b.target:b.srcElement,c=a.lineIndex;a&&!a._ruler;){if(c===void 0&&a.lineIndex!==void 0)c=a.lineIndex;a=a.parentNode}a=a?a._ruler:null;if(c===void 0&&a&&a.getOverview()==="document"){var c=this._getClientHeight(),e=this._model.getLineCount(),d=this._getViewPadding(),f=this._viewDiv.getBoundingClientRect(),c=Math.floor((b.clientY-f.top-this._metrics.scrollWidth)*e/(c+d.top+d.bottom-2*this._metrics.scrollWidth));0<=c&&c<e||(c=void 0)}if(a)switch(b.type){case "click":if(a.onClick)a.onClick(c,
b);break;case "dblclick":if(a.onDblClick)a.onDblClick(c,b);break;case "mousemove":if(a.onMouseMove)a.onMouseMove(c,b);break;case "mouseover":if(a.onMouseOver)a.onMouseOver(c,b);break;case "mouseout":if(a.onMouseOut)a.onMouseOut(c,b)}},_handleScroll:function(){var b=this._getScroll(),a=this._hScroll,c=this._vScroll;if(a!==b.x||c!==b.y)this._checkOverlayScroll(),this._hScroll=b.x,this._vScroll=b.y,this._commitIME(),this._update(c===b.y),this.onScroll({type:"Scroll",oldValue:{x:a,y:c},newValue:b})},
_handleSelectStart:function(b){if(this._ignoreSelect)return b&&b.preventDefault&&b.preventDefault(),!1},_getModelOffset:function(b,a){if(b){var c;c=b.tagName==="DIV"?b:b.parentNode.parentNode;var e=0,d=c.lineIndex;if(b.tagName!=="DIV")for(c=c.firstChild;c;){var f=c.firstChild;if(f===b){c.ignoreChars&&(e-=c.ignoreChars);e+=a;break}c.ignoreChars&&(e-=c.ignoreChars);e+=f.data.length;c=c.nextSibling}return Math.max(0,e)+this._model.getLineStart(d)}},_updateSelectionFromDOM:function(){var b=this._getWindow().getSelection(),
a=this._getModelOffset(b.anchorNode,b.anchorOffset),b=this._getModelOffset(b.focusNode,b.focusOffset);a===void 0||b===void 0||this._setSelection(new m(a,b),!1,!1)},_handleSelectionChange:function(){if(this._imeOffset===-1)if(a.isAndroid){var b=this._getWindow();this._selTimer&&b.clearTimeout(this._selTimer);var c=this;this._selTimer=b.setTimeout(function(){if(c._clientDiv)c._selTimer=null,c._updateSelectionFromDOM()},250)}else this._updateSelectionFromDOM()},_handleTextInput:function(b){this._imeOffset=
-1;if(a.isAndroid){for(var c=this._getWindow().getSelection(),e=c.anchorNode;e;){if(e.lineIndex!==void 0)break;e=e.parentNode}if(e){var d=this._model,f=e.lineIndex,g=d.getLine(f),m=g,h=0,d=d.getLineStart(f);if(c.rangeCount>0)c.getRangeAt(0).deleteContents(),f=e.ownerDocument.createTextNode(b.data),c.getRangeAt(0).insertNode(f),h=this._getDOMText(e,f),m=h.text,h=h.offset,f.parentNode.removeChild(f);e.lineRemoved=!0;for(e=0;g.charCodeAt(e)===m.charCodeAt(e)&&e<h;)e++;c=g.length-1;for(f=m.length-g.length;g.charCodeAt(c)===
m.charCodeAt(c+f)&&c+f>=h+b.data.length;)c--;c++;g=m.substring(e,c+f);e+=d;c+=d;this._modifyContent({text:g,start:e,end:c,_ignoreDOMSelection:!0},!0)}}else this._doContent(b.data);b.preventDefault()},_handleTouchStart:function(b){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 e=b.touches;if(e.length===1){var e=e[0],d=e.clientX,f=e.clientY;
this._touchStartX=d;this._touchStartY=f;if(a.isAndroid&&(f<e.pageY-c.pageYOffset||d<e.pageX-c.pageXOffset))d=e.pageX-c.pageXOffset,f=e.pageY-c.pageYOffset;c=this.convert({x:d,y:f},"page","document");this._lastTouchOffset=this.getOffsetAtLocation(c.x,c.y);this._touchStartTime=b.timeStamp;this._touching=!0}},_handleTouchMove:function(b){var a=b.touches;if(a.length===1){a=a[0];this._touchCurrentX=a.clientX;this._touchCurrentY=a.clientY;if(!this._touchScrollTimer&&b.timeStamp-this._touchStartTime<200){this._vScrollDiv.style.display=
"block";if(!this._wrapMode)this._hScrollDiv.style.display="block";var c=this,e=this._getWindow();this._touchScrollTimer=e.setInterval(function(){var b=0,a=0;if(c._touching)b=c._touchStartX-c._touchCurrentX,a=c._touchStartY-c._touchCurrentY,c._touchSpeedX=b/10,c._touchSpeedY=a/10,c._touchStartX=c._touchCurrentX,c._touchStartY=c._touchCurrentY;else if(Math.abs(c._touchSpeedX)<0.1&&Math.abs(c._touchSpeedY)<0.1){c._vScrollDiv.style.display="none";c._hScrollDiv.style.display="none";e.clearInterval(c._touchScrollTimer);
c._touchScrollTimer=null;return}else b=c._touchSpeedX*10,a=c._touchSpeedY*10,c._touchSpeedX*=0.95,c._touchSpeedY*=0.95;c._scrollView(b,a)},10)}this._touchScrollTimer&&b.preventDefault()}},_handleTouchEnd:function(b){if(b.touches.length===0)this._touching=!1},_doAction:function(b){for(var a=this._keyBindings,c=0;c<a.length;c++){var e=a[c];if(e.keyBinding.match(b)){if(e.actionID&&(b=this._actions[e.actionID]))if(b.handler){if(!b.handler())return b.defaultHandler?typeof b.defaultHandler()==="boolean":
!1}else if(b.defaultHandler)return typeof b.defaultHandler()==="boolean";return!0}}return!1},_doBackspace:function(b){var a=this._getSelection();if(a.isEmpty()){var c=this._model,e=a.getCaret(),d=c.getLineAtOffset(e),f=c.getLineStart(d);if(e===f)d>0&&a.extend(c.getLineEnd(d-1));else{var g=!1;this._expandTab&&b.unit==="character"&&(e-f)%this._tabSize===0&&(g=!/[^ ]/.test(c.getText(f,e)));g?a.extend(e-this._tabSize):(c=this._getLine(d),a.extend(c.getNextOffset(e,b.unit,-1)),c.destroy())}}this._modifyContent({text:"",
start:a.start,end:a.end},!0);return!0},_doContent:function(b){var a=this._getSelection();this._modifyContent({text:b,start:a.start,end:a.end,_ignoreDOMSelection:!0},!0)},_doCopy:function(b){var a=this._getSelection();return!a.isEmpty()?this._setClipboardText(this._getBaseText(a.start,a.end),b):!0},_doCursorNext:function(b){if(!b.select&&this._clearSelection("next"))return!0;var a=this._model,c=this._getSelection(),e=c.getCaret(),d=a.getLineAtOffset(e);e===a.getLineEnd(d)?d+1<a.getLineCount()&&c.extend(a.getLineStart(d+
1)):(a=this._getLine(d),c.extend(a.getNextOffset(e,b.unit,1)),a.destroy());b.select||c.collapse();this._setSelection(c,!0);return!0},_doCursorPrevious:function(b){if(!b.select&&this._clearSelection("previous"))return!0;var a=this._model,c=this._getSelection(),e=c.getCaret(),d=a.getLineAtOffset(e);e===a.getLineStart(d)?d>0&&c.extend(a.getLineEnd(d-1)):(a=this._getLine(d),c.extend(a.getNextOffset(e,b.unit,-1)),a.destroy());b.select||c.collapse();this._setSelection(c,!0);return!0},_doCut:function(b){var a=
this._getSelection();return!a.isEmpty()?(a=this._getBaseText(a.start,a.end),this._doContent(""),this._setClipboardText(a,b)):!0},_doDelete:function(b){var a=this._getSelection();if(a.isEmpty()){var c=this._model,e=a.getCaret(),d=c.getLineAtOffset(e);e===c.getLineEnd(d)?d+1<c.getLineCount()&&a.extend(c.getLineStart(d+1)):(c=this._getLine(d),a.extend(c.getNextOffset(e,b.unit,1)),c.destroy())}this._modifyContent({text:"",start:a.start,end:a.end},!0);return!0},_doEnd:function(b){var a=this._getSelection(),
c=this._model;if(b.ctrl)a.extend(c.getCharCount());else{var e=a.getCaret(),d=c.getLineAtOffset(e);if(this._wrapMode){var f=this._getLine(d),e=f.getLineIndex(e),e=e===f.getLineCount()-1?c.getLineEnd(d):f.getLineStart(e+1)-1;f.destroy()}else e=c.getLineEnd(d);a.extend(e)}b.select||a.collapse();this._setSelection(a,!0);return!0},_doEnter:function(b){var a=this._model,c=this._getSelection();this._doContent(a.getLineDelimiter());if(b&&b.noCursor)c.end=c.start,this._setSelection(c);return!0},_doHome:function(b){var a=
this._getSelection(),c=this._model;if(b.ctrl)a.extend(0);else{var e=a.getCaret(),d=c.getLineAtOffset(e);this._wrapMode?(c=this._getLine(d),e=c.getLineIndex(e),e=c.getLineStart(e),c.destroy()):e=c.getLineStart(d);a.extend(e)}b.select||a.collapse();this._setSelection(a,!0);return!0},_doLineDown:function(b){var c=this._model,e=this._getSelection(),d=e.getCaret(),f=c.getLineAtOffset(d),g=this._getLine(f),m=this._columnX,h=1,n=!1;if(m===-1||b.wholeLine||b.select&&a.isIE)m=b.wholeLine?c.getLineEnd(f+1):
d,m=g.getBoundingClientRect(m).left;(d=g.getLineIndex(d))<g.getLineCount()-1?h=g.getClientRects(d+1).top+1:(n=f===c.getLineCount()-1,f++);n?b.select&&(e.extend(c.getCharCount()),this._setSelection(e,!0,!0)):(g.lineIndex!==f&&(g.destroy(),g=this._getLine(f)),e.extend(g.getOffset(m,h)),b.select||e.collapse(),this._setSelection(e,!0,!0));this._columnX=m;g.destroy();return!0},_doLineUp:function(b){var c=this._model,e=this._getSelection(),d=e.getCaret(),f=c.getLineAtOffset(d),g=this._getLine(f),m=this._columnX,
h=!1,n;if(m===-1||b.wholeLine||b.select&&a.isIE)m=b.wholeLine?c.getLineStart(f-1):d,m=g.getBoundingClientRect(m).left;(d=g.getLineIndex(d))>0?n=g.getClientRects(d-1).top+1:(h=f===0,h||(f--,n=this._getLineHeight(f)-1));h?b.select&&(e.extend(0),this._setSelection(e,!0,!0)):(g.lineIndex!==f&&(g.destroy(),g=this._getLine(f)),e.extend(g.getOffset(m,n)),b.select||e.collapse(),this._setSelection(e,!0,!0));this._columnX=m;g.destroy();return!0},_doPageDown:function(b){var c=this._model,e=this._getSelection(),
d=e.getCaret(),f=c.getLineAtOffset(d),g=c.getLineCount(),m=this._getScroll(),h=this._getClientHeight(),n;if(this._lineHeight){c=this._columnX;m=this._getBoundsAtOffset(d);if(c===-1||b.select&&a.isIE)c=m.left;d=this._getLineIndex(m.top+h);n=this._getLine(d);f=this._getLinePixel(d);d=n.getOffset(c,m.top+h-f);h=n.getBoundingClientRect(d);n.destroy();e.extend(d);b.select||e.collapse();this._setSelection(e,!0,!0,h.top+f-m.top);this._columnX=c;return!0}if(f<g-1){var i=this._getLineHeight(),j=Math.min(g-
f-1,Math.floor(h/i)),j=Math.max(1,j),c=this._columnX;if(c===-1||b.select&&a.isIE)n=this._getLine(f),c=n.getBoundingClientRect(d).left,n.destroy();n=this._getLine(f+j);e.extend(n.getOffset(c,0));n.destroy();b.select||e.collapse();b=g*i;d=m.y+j*i;d+h>b&&(d=b-h);this._setSelection(e,!0,!0,d-m.y);this._columnX=c}return!0},_doPageUp:function(b){var c=this._model,e=this._getSelection(),d=e.getCaret(),f=c.getLineAtOffset(d),g=this._getScroll(),m=this._getClientHeight(),h;if(this._lineHeight){c=this._columnX;
g=this._getBoundsAtOffset(d);if(c===-1||b.select&&a.isIE)c=g.left;d=this._getLineIndex(g.bottom-m);h=this._getLine(d);f=this._getLinePixel(d);d=h.getOffset(c,g.bottom-m-f);m=h.getBoundingClientRect(d);h.destroy();e.extend(d);b.select||e.collapse();this._setSelection(e,!0,!0,m.top+f-g.top);this._columnX=c;return!0}if(f>0){var n=this._getLineHeight(),m=Math.max(1,Math.min(f,Math.floor(m/n))),c=this._columnX;if(c===-1||b.select&&a.isIE)h=this._getLine(f),c=h.getBoundingClientRect(d).left,h.destroy();
h=this._getLine(f-m);e.extend(h.getOffset(c,this._getLineHeight(f-m)-1));h.destroy();b.select||e.collapse();b=Math.max(0,g.y-m*n);this._setSelection(e,!0,!0,b-g.y);this._columnX=c}return!0},_doPaste:function(b){var c=this;return this._getClipboardText(b,function(b){b&&(a.isLinux&&c._lastMouseButton===2&&(new Date).getTime()-c._lastMouseTime<=c._clickTime&&c._setSelectionTo(c._lastMouseX,c._lastMouseY),c._doContent(b))})!==null},_doScroll:function(b){var a=b.type,c=this._model,e=c.getLineCount(),b=
this._getClientHeight(),d=this._getLineHeight();e*=d;var f=this._getScroll().y,g;switch(a){case "textStart":g=0;break;case "textEnd":g=e-b;break;case "pageDown":g=f+b;break;case "pageUp":g=f-b;break;case "centerLine":a=this._getSelection(),g=c.getLineAtOffset(a.start),c=(c.getLineAtOffset(a.end)-g+1)*d,g=g*d-b/2+c/2}g!==void 0&&(g=Math.min(Math.max(0,g),e-b),this._scrollView(0,g-f));return!0},_doSelectAll:function(){var b=this._model,a=this._getSelection();a.setCaret(0);a.extend(b.getCharCount());
this._setSelection(a,!1);return!0},_doTab:function(){if(this._tabMode&&!this._readonly){var b="\t";if(this._expandTab)var a=this._model,b=this._getSelection().getCaret(),c=a.getLineAtOffset(b),a=a.getLineStart(c),b=Array(this._tabSize-(b-a)%this._tabSize+1).join(" ");this._doContent(b);return!0}},_doShiftTab:function(){return!this._tabMode||this._readonly?void 0:!0},_doTabMode:function(){this._tabMode=!this._tabMode;return!0},_doWrapMode:function(){this.setOptions({wrapMode:!this.getOptions("wrapMode")});
return!0},_autoScroll:function(){var b=this._getSelection(),a=this.convert({x:this._autoScrollX,y:this._autoScrollY},"page","document"),c=b.getCaret(),e=this._model.getLineAtOffset(c),d;if(this._autoScrollDir==="up"||this._autoScrollDir==="down")c=this._autoScrollY/this._getLineHeight(),c=c<0?Math.floor(c):Math.ceil(c),d=e,d=Math.max(0,Math.min(this._model.getLineCount()-1,d+c));else if(this._autoScrollDir==="left"||this._autoScrollDir==="right")d=this._getLineIndex(a.y),e=this._getLine(e),a.x+=e.getBoundingClientRect(c,
!1).left,e.destroy();e=this._getLine(d);b.extend(e.getOffset(a.x,a.y-this._getLinePixel(d)));e.destroy();this._setSelection(b,!0)},_autoScrollTimer:function(){this._autoScroll();var b=this;this._autoScrollTimerID=this._getWindow().setTimeout(function(){b._autoScrollTimer()},this._AUTO_SCROLL_RATE)},_calculateLineHeightTimer:function(b){if(this._lineHeight&&!this._calculateLHTimer){var a=this._model.getLineCount(),c=0;if(b){for(var b=0,e=(new Date).getTime(),d=0;c<a;)if(this._lineHeight[c]||(b++,d||
(d=c),this._lineHeight[c]=this._calculateLineHeight(c)),c++,(new Date).getTime()-e>100)break;this.redrawRulers(0,a);this._queueUpdate()}b=this._getWindow();if(c!==a){var f=this;this._calculateLHTimer=b.setTimeout(function(){f._calculateLHTimer=null;f._calculateLineHeightTimer(!0)},0)}else if(this._calculateLHTimer)b.clearTimeout(this._calculateLHTimer),this._calculateLHTimer=void 0}},_calculateLineHeight:function(b){var b=this._getLine(b),a=b.getBoundingClientRect();b.destroy();return Math.max(1,
Math.ceil(a.bottom-a.top))},_calculateMetrics:function(){var c=this._clientDiv,d=c.ownerDocument,f=a.createElement(d,"div");f.style.lineHeight="normal";var g={type:"LineStyle",textView:this,0:0,lineText:this._model.getLine(0),lineStart:0};this.onLineStyle(g);h(g.style,f);f.style.position="fixed";f.style.left="-1000px";var m=a.createElement(d,"span");m.appendChild(d.createTextNode(" "));f.appendChild(m);var n=a.createElement(d,"span");n.style.fontStyle="italic";n.appendChild(d.createTextNode(" "));
f.appendChild(n);var t=a.createElement(d,"span");t.style.fontWeight="bold";t.appendChild(d.createTextNode(" "));f.appendChild(t);g=a.createElement(d,"span");g.style.fontWeight="bold";g.style.fontStyle="italic";g.appendChild(d.createTextNode(" "));f.appendChild(g);c.appendChild(f);var i=f.getBoundingClientRect(),m=m.getBoundingClientRect(),n=n.getBoundingClientRect(),t=t.getBoundingClientRect(),g=g.getBoundingClientRect(),m=m.bottom-m.top,n=n.bottom-n.top,t=t.bottom-t.top,j=g.bottom-g.top,k=0,g=i.bottom-
i.top<=0,i=Math.max(1,i.bottom-i.top);n>m&&(k=1);t>n&&(k=2);j>t&&(k=3);var r;if(k!==0){r={style:{}};if((k&1)!==0)r.style.fontStyle="italic";if((k&2)!==0)r.style.fontWeight="bold"}m=e(f);c.removeChild(f);n=b(this._viewDiv);f=a.createElement(d,"div");f.style.position="fixed";f.style.left="-1000px";f.style.paddingLeft=n.left+"px";f.style.paddingTop=n.top+"px";f.style.paddingRight=n.right+"px";f.style.paddingBottom=n.bottom+"px";f.style.width="100px";f.style.height="100px";t=a.createElement(d,"div");
t.style.width="100%";t.style.height="100%";f.appendChild(t);c.appendChild(f);d=f.getBoundingClientRect();n=t.getBoundingClientRect();f.style.overflow="hidden";t.style.height="200px";t=f.clientWidth;f.style.overflow="scroll";j=f.clientWidth;c.removeChild(f);n={left:n.left-d.left,top:n.top-d.top,right:d.right-n.right,bottom:d.bottom-n.bottom};return{lineHeight:i,largestFontStyle:r,lineTrim:m,viewPadding:n,scrollWidth:t-j,invalid:g}},_checkOverlayScroll:function(){if(a.isMac){var b=this,c=this._getWindow();
this._overlayScrollTimer&&c.clearTimeout(this._overlayScrollTimer);var e=function(){var a=b._isOverOverlayScroll();a.vertical||a.horizontal?b._overlayScrollTimer=c.setTimeout(e,200):(b._overlayScrollTimer=void 0,b._update())};this._overlayScrollTimer=c.setTimeout(e,200)}},_clearSelection:function(b){var a=this._getSelection();if(a.isEmpty())return!1;b==="next"?a.start=a.end:a.end=a.start;this._setSelection(a,!0);return!0},_commitIME:function(){if(this._imeOffset!==-1){this._scrollDiv.focus();this._clientDiv.focus();
var b=this._model,a=b.getLineAtOffset(this._imeOffset),c=b.getLineStart(a),e=this._getDOMText(this._getLineNode(a)).text,b=b.getLine(a),c=this._imeOffset-c,b=c+e.length-b.length;c!==b&&this._doContent(e.substring(c,b));this._imeOffset=-1}},_createActions:function(){var b=j.KeyBinding,c=this._keyBindings=[];c.push({actionID:"lineUp",keyBinding:new b(38),predefined:!0});c.push({actionID:"lineDown",keyBinding:new b(40),predefined:!0});c.push({actionID:"charPrevious",keyBinding:new b(37),predefined:!0});
c.push({actionID:"charNext",keyBinding:new b(39),predefined:!0});a.isMac?(c.push({actionID:"scrollPageUp",keyBinding:new b(33),predefined:!0}),c.push({actionID:"scrollPageDown",keyBinding:new b(34),predefined:!0}),c.push({actionID:"pageUp",keyBinding:new b(33,null,null,!0),predefined:!0}),c.push({actionID:"pageDown",keyBinding:new b(34,null,null,!0),predefined:!0}),c.push({actionID:"lineStart",keyBinding:new b(37,!0),predefined:!0}),c.push({actionID:"lineEnd",keyBinding:new b(39,!0),predefined:!0}),
c.push({actionID:"wordPrevious",keyBinding:new b(37,null,null,!0),predefined:!0}),c.push({actionID:"wordNext",keyBinding:new b(39,null,null,!0),predefined:!0}),c.push({actionID:"scrollTextStart",keyBinding:new b(36),predefined:!0}),c.push({actionID:"scrollTextEnd",keyBinding:new b(35),predefined:!0}),c.push({actionID:"textStart",keyBinding:new b(38,!0),predefined:!0}),c.push({actionID:"textEnd",keyBinding:new b(40,!0),predefined:!0}),c.push({actionID:"scrollPageUp",keyBinding:new b(38,null,null,null,
!0),predefined:!0}),c.push({actionID:"scrollPageDown",keyBinding:new b(40,null,null,null,!0),predefined:!0}),c.push({actionID:"lineStart",keyBinding:new b(37,null,null,null,!0),predefined:!0}),c.push({actionID:"lineEnd",keyBinding:new b(39,null,null,null,!0),predefined:!0}),c.push({actionID:"lineStart",keyBinding:new b(38,null,null,!0),predefined:!0}),c.push({actionID:"lineEnd",keyBinding:new b(40,null,null,!0),predefined:!0})):(c.push({actionID:"pageUp",keyBinding:new b(33),predefined:!0}),c.push({actionID:"pageDown",
keyBinding:new b(34),predefined:!0}),c.push({actionID:"lineStart",keyBinding:new b(36),predefined:!0}),c.push({actionID:"lineEnd",keyBinding:new b(35),predefined:!0}),c.push({actionID:"wordPrevious",keyBinding:new b(37,!0),predefined:!0}),c.push({actionID:"wordNext",keyBinding:new b(39,!0),predefined:!0}),c.push({actionID:"textStart",keyBinding:new b(36,!0),predefined:!0}),c.push({actionID:"textEnd",keyBinding:new b(35,!0),predefined:!0}));a.isFirefox&&a.isLinux&&(c.push({actionID:"lineUp",keyBinding:new b(38,
!0),predefined:!0}),c.push({actionID:"lineDown",keyBinding:new b(40,!0),predefined:!0}));c.push({actionID:"selectLineUp",keyBinding:new b(38,null,!0),predefined:!0});c.push({actionID:"selectLineDown",keyBinding:new b(40,null,!0),predefined:!0});c.push({actionID:"selectCharPrevious",keyBinding:new b(37,null,!0),predefined:!0});c.push({actionID:"selectCharNext",keyBinding:new b(39,null,!0),predefined:!0});c.push({actionID:"selectPageUp",keyBinding:new b(33,null,!0),predefined:!0});c.push({actionID:"selectPageDown",
keyBinding:new b(34,null,!0),predefined:!0});a.isMac?(c.push({actionID:"selectLineStart",keyBinding:new b(37,!0,!0),predefined:!0}),c.push({actionID:"selectLineEnd",keyBinding:new b(39,!0,!0),predefined:!0}),c.push({actionID:"selectWordPrevious",keyBinding:new b(37,null,!0,!0),predefined:!0}),c.push({actionID:"selectWordNext",keyBinding:new b(39,null,!0,!0),predefined:!0}),c.push({actionID:"selectTextStart",keyBinding:new b(36,null,!0),predefined:!0}),c.push({actionID:"selectTextEnd",keyBinding:new b(35,
null,!0),predefined:!0}),c.push({actionID:"selectTextStart",keyBinding:new b(38,!0,!0),predefined:!0}),c.push({actionID:"selectTextEnd",keyBinding:new b(40,!0,!0),predefined:!0}),c.push({actionID:"selectLineStart",keyBinding:new b(37,null,!0,null,!0),predefined:!0}),c.push({actionID:"selectLineEnd",keyBinding:new b(39,null,!0,null,!0),predefined:!0}),c.push({actionID:"selectLineStart",keyBinding:new b(38,null,!0,!0),predefined:!0}),c.push({actionID:"selectLineEnd",keyBinding:new b(40,null,!0,!0),
predefined:!0})):(a.isLinux&&(c.push({actionID:"selectWholeLineUp",keyBinding:new b(38,!0,!0),predefined:!0}),c.push({actionID:"selectWholeLineDown",keyBinding:new b(40,!0,!0),predefined:!0})),c.push({actionID:"selectLineStart",keyBinding:new b(36,null,!0),predefined:!0}),c.push({actionID:"selectLineEnd",keyBinding:new b(35,null,!0),predefined:!0}),c.push({actionID:"selectWordPrevious",keyBinding:new b(37,!0,!0),predefined:!0}),c.push({actionID:"selectWordNext",keyBinding:new b(39,!0,!0),predefined:!0}),
c.push({actionID:"selectTextStart",keyBinding:new b(36,!0,!0),predefined:!0}),c.push({actionID:"selectTextEnd",keyBinding:new b(35,!0,!0),predefined:!0}));c.push({actionID:"undo",keyBinding:new j.KeyBinding("z",!0),predefined:!0});a.isMac?c.push({actionID:"redo",keyBinding:new j.KeyBinding("z",!0,!0),predefined:!0}):c.push({actionID:"redo",keyBinding:new j.KeyBinding("y",!0),predefined:!0});c.push({actionID:"deletePrevious",keyBinding:new b(8),predefined:!0});c.push({actionID:"deletePrevious",keyBinding:new b(8,
null,!0),predefined:!0});c.push({actionID:"deleteNext",keyBinding:new b(46),predefined:!0});c.push({actionID:"deleteWordPrevious",keyBinding:new b(8,!0),predefined:!0});c.push({actionID:"deleteWordPrevious",keyBinding:new b(8,!0,!0),predefined:!0});c.push({actionID:"deleteWordNext",keyBinding:new b(46,!0),predefined:!0});c.push({actionID:"tab",keyBinding:new b(9),predefined:!0});c.push({actionID:"shiftTab",keyBinding:new b(9,null,!0),predefined:!0});c.push({actionID:"enter",keyBinding:new b(13),predefined:!0});
c.push({actionID:"enter",keyBinding:new b(13,null,!0),predefined:!0});c.push({actionID:"selectAll",keyBinding:new b("a",!0),predefined:!0});c.push({actionID:"toggleTabMode",keyBinding:new b("m",!0),predefined:!0});a.isMac&&(c.push({actionID:"deleteNext",keyBinding:new b(46,null,!0),predefined:!0}),c.push({actionID:"deleteWordPrevious",keyBinding:new b(8,null,null,!0),predefined:!0}),c.push({actionID:"deleteWordNext",keyBinding:new b(46,null,null,!0),predefined:!0}));if(!a.isFirefox){var e=a.isMac&&
a.isChrome;c.push({actionID:null,keyBinding:new b("u",!e,!1,!1,e),predefined:!0});c.push({actionID:null,keyBinding:new b("i",!e,!1,!1,e),predefined:!0});c.push({actionID:null,keyBinding:new b("b",!e,!1,!1,e),predefined:!0})}a.isFirefox&&(c.push({actionID:"copy",keyBinding:new b(45,!0),predefined:!0}),c.push({actionID:"paste",keyBinding:new b(45,null,!0),predefined:!0}),c.push({actionID:"cut",keyBinding:new b(46,null,!0),predefined:!0}));a.isMac&&(c.push({actionID:"lineStart",keyBinding:new b("a",
!1,!1,!1,!0),predefined:!0}),c.push({actionID:"lineEnd",keyBinding:new b("e",!1,!1,!1,!0),predefined:!0}),c.push({actionID:"lineUp",keyBinding:new b("p",!1,!1,!1,!0),predefined:!0}),c.push({actionID:"lineDown",keyBinding:new b("n",!1,!1,!1,!0),predefined:!0}),c.push({actionID:"charPrevious",keyBinding:new b("b",!1,!1,!1,!0),predefined:!0}),c.push({actionID:"charNext",keyBinding:new b("f",!1,!1,!1,!0),predefined:!0}),c.push({actionID:"deletePrevious",keyBinding:new b("h",!1,!1,!1,!0),predefined:!0}),
c.push({actionID:"deleteNext",keyBinding:new b("d",!1,!1,!1,!0),predefined:!0}),c.push({actionID:"deleteLineEnd",keyBinding:new b("k",!1,!1,!1,!0),predefined:!0}),a.isFirefox?(c.push({actionID:"scrollPageDown",keyBinding:new b("v",!1,!1,!1,!0),predefined:!0}),c.push({actionID:"deleteLineStart",keyBinding:new b("u",!1,!1,!1,!0),predefined:!0}),c.push({actionID:"deleteWordPrevious",keyBinding:new b("w",!1,!1,!1,!0),predefined:!0})):(c.push({actionID:"pageDown",keyBinding:new b("v",!1,!1,!1,!0),predefined:!0}),
c.push({actionID:"centerLine",keyBinding:new b("l",!1,!1,!1,!0),predefined:!0}),c.push({actionID:"enterNoCursor",keyBinding:new b("o",!1,!1,!1,!0),predefined:!0})));var d=this;this._actions={lineUp:{defaultHandler:function(){return d._doLineUp({select:!1})}},lineDown:{defaultHandler:function(){return d._doLineDown({select:!1})}},lineStart:{defaultHandler:function(){return d._doHome({select:!1,ctrl:!1})}},lineEnd:{defaultHandler:function(){return d._doEnd({select:!1,ctrl:!1})}},charPrevious:{defaultHandler:function(){return d._doCursorPrevious({select:!1,
unit:"character"})}},charNext:{defaultHandler:function(){return d._doCursorNext({select:!1,unit:"character"})}},pageUp:{defaultHandler:function(){return d._doPageUp({select:!1})}},pageDown:{defaultHandler:function(){return d._doPageDown({select:!1})}},scrollPageUp:{defaultHandler:function(){return d._doScroll({type:"pageUp"})}},scrollPageDown:{defaultHandler:function(){return d._doScroll({type:"pageDown"})}},wordPrevious:{defaultHandler:function(){return d._doCursorPrevious({select:!1,unit:"word"})}},
wordNext:{defaultHandler:function(){return d._doCursorNext({select:!1,unit:"word"})}},textStart:{defaultHandler:function(){return d._doHome({select:!1,ctrl:!0})}},textEnd:{defaultHandler:function(){return d._doEnd({select:!1,ctrl:!0})}},scrollTextStart:{defaultHandler:function(){return d._doScroll({type:"textStart"})}},scrollTextEnd:{defaultHandler:function(){return d._doScroll({type:"textEnd"})}},centerLine:{defaultHandler:function(){return d._doScroll({type:"centerLine"})}},selectLineUp:{defaultHandler:function(){return d._doLineUp({select:!0})}},
selectLineDown:{defaultHandler:function(){return d._doLineDown({select:!0})}},selectWholeLineUp:{defaultHandler:function(){return d._doLineUp({select:!0,wholeLine:!0})}},selectWholeLineDown:{defaultHandler:function(){return d._doLineDown({select:!0,wholeLine:!0})}},selectLineStart:{defaultHandler:function(){return d._doHome({select:!0,ctrl:!1})}},selectLineEnd:{defaultHandler:function(){return d._doEnd({select:!0,ctrl:!1})}},selectCharPrevious:{defaultHandler:function(){return d._doCursorPrevious({select:!0,
unit:"character"})}},selectCharNext:{defaultHandler:function(){return d._doCursorNext({select:!0,unit:"character"})}},selectPageUp:{defaultHandler:function(){return d._doPageUp({select:!0})}},selectPageDown:{defaultHandler:function(){return d._doPageDown({select:!0})}},selectWordPrevious:{defaultHandler:function(){return d._doCursorPrevious({select:!0,unit:"word"})}},selectWordNext:{defaultHandler:function(){return d._doCursorNext({select:!0,unit:"word"})}},selectTextStart:{defaultHandler:function(){return d._doHome({select:!0,
ctrl:!0})}},selectTextEnd:{defaultHandler:function(){return d._doEnd({select:!0,ctrl:!0})}},deletePrevious:{defaultHandler:function(){return d._doBackspace({unit:"character"})}},deleteNext:{defaultHandler:function(){return d._doDelete({unit:"character"})}},deleteWordPrevious:{defaultHandler:function(){return d._doBackspace({unit:"word"})}},deleteWordNext:{defaultHandler:function(){return d._doDelete({unit:"word"})}},deleteLineStart:{defaultHandler:function(){return d._doBackspace({unit:"line"})}},
deleteLineEnd:{defaultHandler:function(){return d._doDelete({unit:"line"})}},tab:{defaultHandler:function(){return d._doTab()}},shiftTab:{defaultHandler:function(){return d._doShiftTab()}},enter:{defaultHandler:function(){return d._doEnter()}},enterNoCursor:{defaultHandler:function(){return d._doEnter({noCursor:!0})}},selectAll:{defaultHandler:function(){return d._doSelectAll()}},copy:{defaultHandler:function(){return d._doCopy()}},cut:{defaultHandler:function(){return d._doCut()}},paste:{defaultHandler:function(){return d._doPaste()}},
toggleWrapMode:{defaultHandler:function(){return d._doWrapMode()}},toggleTabMode:{defaultHandler:function(){return d._doTabMode()}}}},_createRuler:function(b,c){if(this._clientDiv){var e=b.getLocation()==="left"?this._leftDiv:this._rightDiv;e.style.display="block";var d=a.createElement(e.ownerDocument,"div");d._ruler=b;d.rulerChanged=!0;d.style.position="relative";var e=e.firstChild.rows[0],f=e.cells.length,e=e.insertCell(c===void 0||c<0||c>f?f:c);e.vAlign="top";e.style.verticalAlign="top";e.style.borderWidth=
"0px";e.style.margin="0px";e.style.padding="0px";e.style.outline="none";e.appendChild(d)}},_createView:function(){if(!this._clientDiv){for(var b=this._parent;b.hasChildNodes();)b.removeChild(b.lastChild);var c=b.ownerDocument,e=a.createElement(c,"div");this._rootDiv=e;e.tabIndex=-1;e.style.position="relative";e.style.overflow="hidden";e.style.width="100%";e.style.height="100%";b.style.overflow="hidden";e.setAttribute("role","application");b.appendChild(e);b=a.createElement(c,"div");b.className="textviewLeftRuler";
this._leftDiv=b;b.tabIndex=-1;b.style.overflow="hidden";b.style.MozUserSelect="none";b.style.WebkitUserSelect="none";b.style.position="absolute";b.style.cursor="default";b.style.display="none";b.setAttribute("aria-hidden","true");var d=a.createElement(c,"table");b.appendChild(d);d.cellPadding="0px";d.cellSpacing="0px";d.border="0px";d.style.borderWidth="0px";d.style.margin="0px";d.style.padding="0px";d.style.outline="none";d.style.lineHeight="normal";d=d.insertRow(0);d.style.borderWidth="0px";d.style.margin=
"0px";d.style.padding="0px";d.style.outline="none";d.style.lineHeight="normal";e.appendChild(b);b=a.createElement(c,"div");b.className="textview";this._viewDiv=b;b.tabIndex=-1;b.style.overflow="auto";b.style.position="absolute";b.style.top="0px";b.style.bottom="0px";b.style.borderWidth="0px";b.style.margin="0px";b.style.outline="none";e.appendChild(b);var f=a.createElement(c,"div");f.className="textviewRightRuler";this._rightDiv=f;f.tabIndex=-1;f.style.display="none";f.style.overflow="hidden";f.style.MozUserSelect=
"none";f.style.WebkitUserSelect="none";f.style.position="absolute";f.style.cursor="default";f.style.right="0px";f.setAttribute("aria-hidden","true");d=a.createElement(c,"table");f.appendChild(d);d.cellPadding="0px";d.cellSpacing="0px";d.border="0px";d.style.borderWidth="0px";d.style.margin="0px";d.style.padding="0px";d.style.outline="none";d.style.lineHeight="normal";d=d.insertRow(0);d.style.borderWidth="0px";d.style.margin="0px";d.style.padding="0px";d.style.outline="none";d.style.lineHeight="normal";
e.appendChild(f);this._scrollDiv=d=a.createElement(c,"div");d.style.margin="0px";d.style.borderWidth="0px";d.style.padding="0px";b.appendChild(d);if(a.isFirefox)this._clipboardDiv=b=a.createElement(c,"div"),b.style.position="fixed",b.style.whiteSpace="pre",b.style.left="-1000px",e.appendChild(b);if(!a.isIE&&!a.isIOS)this._clipDiv=b=a.createElement(c,"div"),b.style.position="absolute",b.style.overflow="hidden",b.style.margin="0px",b.style.borderWidth="0px",b.style.padding="0px",e.appendChild(b),this._clipScrollDiv=
d=a.createElement(c,"div"),d.style.position="absolute",d.style.height="1px",d.style.top="-1000px",b.appendChild(d);this._setFullSelection(this._fullSelection,!0);b=a.createElement(c,"div");b.className="textviewContent";this._clientDiv=b;b.style.position="absolute";b.style.borderWidth="0px";b.style.margin="0px";b.style.padding="0px";b.style.outline="none";b.style.zIndex="1";b.style.WebkitUserSelect="text";b.setAttribute("spellcheck","false");if(a.isIOS||a.isAndroid)b.style.WebkitTapHighlightColor=
"transparent";(this._clipDiv||e).appendChild(b);if(a.isIOS||a.isAndroid)this._vScrollDiv=d=a.createElement(c,"div"),d.style.position="absolute",d.style.borderWidth="1px",d.style.borderColor="white",d.style.borderStyle="solid",d.style.borderRadius="4px",d.style.backgroundColor="black",d.style.opacity="0.5",d.style.margin="0px",d.style.padding="0px",d.style.outline="none",d.style.zIndex="3",d.style.width="8px",d.style.display="none",e.appendChild(d),this._hScrollDiv=d=a.createElement(c,"div"),d.style.position=
"absolute",d.style.borderWidth="1px",d.style.borderColor="white",d.style.borderStyle="solid",d.style.borderRadius="4px",d.style.backgroundColor="black",d.style.opacity="0.5",d.style.margin="0px",d.style.padding="0px",d.style.outline="none",d.style.zIndex="3",d.style.height="8px",d.style.display="none",e.appendChild(d);if(a.isFirefox&&!b.setCapture)this._overlayDiv=d=a.createElement(c,"div"),d.style.position=b.style.position,d.style.borderWidth=b.style.borderWidth,d.style.margin=b.style.margin,d.style.padding=
b.style.padding,d.style.cursor="text",d.style.zIndex="2",(this._clipDiv||e).appendChild(d);b.contentEditable="true";b.setAttribute("role","textbox");b.setAttribute("aria-multiline","true");this._setWrapMode(this._wrapMode,!0);this._setReadOnly(this._readonly);this._setThemeClass(this._themeClass,!0);this._setTabSize(this._tabSize,!0);if(!c.getElementById("_textviewStyle")&&(e="",a.isWebkit&&this._metrics.scrollWidth>0&&(e+="\n.textviewContainer ::-webkit-scrollbar-corner {background: #eeeeee;}"),
a.isFirefox&&a.isMac&&this._highlightRGB&&this._highlightRGB!=="Highlight"&&(e+="\n.textviewContainer ::-moz-selection {background: "+this._highlightRGB+";}"),e))b=a.createElement(c,"style"),b.id="_textviewStyle",d=c.getElementsByTagName("head")[0]||c.documentElement,b.appendChild(c.createTextNode(e)),d.insertBefore(b,d.firstChild);this._hookEvents();c=this._rulers;for(e=0;e<c.length;e++)this._createRuler(c[e]);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(b){var a=b.getLocation()==="left"?this._leftDiv:this._rightDiv;if(a){for(var c=a.firstChild.rows[0],e=c.cells,d=0;d<e.length;d++)if(e[d].firstChild._ruler===
b)break;if(d!==e.length&&(c.cells[d]._ruler=void 0,c.deleteCell(d),e.length===0))a.style.display="none"}},_destroyView:function(){if(this._clientDiv){this._setGrab(null);this._unhookEvents();var b=this._getWindow();if(this._autoScrollTimerID)b.clearTimeout(this._autoScrollTimerID),this._autoScrollTimerID=null;if(this._updateTimer)b.clearTimeout(this._updateTimer),this._updateTimer=null;b=this._rootDiv;b.parentNode.removeChild(b);this._hScrollDiv=this._vScrollDiv=this._rightDiv=this._leftDiv=this._overlayDiv=
this._clientDiv=this._clipScrollDiv=this._clipDiv=this._viewDiv=this._scrollDiv=this._rootDiv=this._clipboardDiv=this._selDiv3=this._selDiv2=this._selDiv1=null}},_doAutoScroll:function(b,a,c){this._autoScrollDir=b;this._autoScrollX=a;this._autoScrollY=c;this._autoScrollTimerID||this._autoScrollTimer()},_endAutoScroll:function(){this._autoScrollTimerID&&this._getWindow().clearTimeout(this._autoScrollTimerID);this._autoScrollTimerID=this._autoScrollDir=void 0},_fixCaret:function(){var b=this._clientDiv;
if(b){var a=this._hasFocus;this._ignoreFocus=!0;a&&b.blur();b.contentEditable=!1;b.contentEditable=!0;a&&b.focus();this._ignoreFocus=!1}},_getBaseText:function(b,a){var c=this._model;c.getBaseModel&&(b=c.mapOffset(b),a=c.mapOffset(a),c=c.getBaseModel());return c.getText(b,a)},_getBottomIndex:function(b){var a=this._bottomChild;if(b&&this._getClientHeight()>this._getLineHeight()){var b=a.getBoundingClientRect(),c=this._clientDiv.getBoundingClientRect();b.bottom>c.bottom&&(a=this._getLinePrevious(a)||
a)}return a.lineIndex},_getBoundsAtOffset:function(b){var a=this._getLine(this._model.getLineAtOffset(b)),b=a.getBoundingClientRect(b),c=this._getLinePixel(a.lineIndex);b.top+=c;b.bottom+=c;a.destroy();return b},_getClientHeight:function(){var b=this._getViewPadding();return Math.max(0,this._viewDiv.clientHeight-b.top-b.bottom)},_getClientWidth:function(){var b=this._getViewPadding();return Math.max(0,this._viewDiv.clientWidth-b.left-b.right)},_getClipboardText:function(b,e){var d=this._model.getLineDelimiter(),
f,g,m=this._getWindow();if(m.clipboardData)return f=[],g=m.clipboardData.getData("Text"),c(g,function(b){f.push(b)},function(){f.push(d)}),g=f.join(""),e&&e(g),g;if(a.isFirefox){this._ignoreFocus=!0;var h=this._clipboardDiv;h.innerHTML="<pre contenteditable=''></pre>";h.firstChild.focus();var n=this,i=function(){var b=n._getTextFromElement(h);h.innerHTML="";f=[];c(b,function(b){f.push(b)},function(){f.push(d)});return f.join("")},j=!1;this._ignorePaste=!0;if(!a.isLinux||this._lastMouseButton!==2)try{j=
h.ownerDocument.execCommand("paste",!1,null)}catch(k){j=h.childNodes.length>1||h.firstChild&&h.firstChild.childNodes.length>0}this._ignorePaste=!1;if(!j)return b?(m.setTimeout(function(){n.focus();(g=i())&&e&&e(g);n._ignoreFocus=!1},0),null):(this.focus(),this._ignoreFocus=!1,"");this.focus();this._ignoreFocus=!1;(g=i())&&e&&e(g);return g}return b&&b.clipboardData?(f=[],g=b.clipboardData.getData("text/plain"),c(g,function(b){f.push(b)},function(){f.push(d)}),(g=f.join(""))&&e&&e(g),g):""},_getDOMText:function(b,
a){for(var c=b.firstChild,e="",d=0;c;){var f;if(c.ignoreChars){f=c.lastChild;for(var g=0,m=[],h=-1;f;){for(var n=f.data,i=n.length-1;i>=0;i--){var j=n.substring(i,i+1);g<c.ignoreChars&&(j===" "||j==="\u200c"||j==="\ufeff")?g++:m.push(j==="\u00a0"?"\t":j)}if(a===f)h=m.length;f=f.previousSibling}m=m.reverse().join("");h!==-1&&(d=e.length+m.length-h);e+=m}else for(f=c.firstChild;f;){if(a===f)d=e.length;e+=f.data;f=f.nextSibling}c=c.nextSibling}return{text:e,offset:d}},_getTextFromElement:function(b){var a=
b.ownerDocument,c=a.defaultView;if(!c.getSelection)return b.innerText||b.textContent;a=a.createRange();a.selectNode(b);var b=c.getSelection(),c=[],e;for(e=0;e<b.rangeCount;e++)c.push(b.getRangeAt(e));this._ignoreSelect=!0;b.removeAllRanges();b.addRange(a);a=b.toString();b.removeAllRanges();for(e=0;e<c.length;e++)b.addRange(c[e]);this._ignoreSelect=!1;return a},_getViewPadding:function(){return this._metrics.viewPadding},_getLine:function(b){var a=this._getLineNode(b);return a&&!a.lineChanged&&!a.lineRemoved?
a._line:new r(this,b)},_getLineHeight:function(b,a){if(b!==void 0&&this._lineHeight){var c=this._lineHeight[b];if(c)return c;if(a||a===void 0)return this._lineHeight[b]=this._calculateLineHeight(b)}return this._metrics.lineHeight},_getLineNode:function(b){for(var a=this._clientDiv.firstChild;a;){if(b===a.lineIndex)return a;a=a.nextSibling}},_getLineNext:function(b){for(b=b?b.nextSibling:this._clientDiv.firstChild;b&&b.lineIndex===-1;)b=b.nextSibling;return b},_getLinePrevious:function(b){for(b=b?
b.previousSibling:this._clientDiv.lastChild;b&&b.lineIndex===-1;)b=b.previousSibling;return b},_getLinePixel:function(b){b=Math.min(Math.max(0,b),this._model.getLineCount());if(this._lineHeight){var a=this._getTopIndex(),c=-this._topIndexY+this._getScroll().y;if(b>a)for(;a<b;a++)c+=this._getLineHeight(a);else for(a-=1;a>=b;a--)c-=this._getLineHeight(a);return c}return this._getLineHeight()*b},_getLineIndex:function(b){var a,c=0,e=this._model.getLineCount();if(this._lineHeight){var c=this._getTopIndex(),
d=-this._topIndexY+this._getScroll().y;if(b!==d)if(b<d)for(;b<d&&c>0;)b+=this._getLineHeight(--c);else for(a=this._getLineHeight(c);b-a>=d&&c<e-1;)b-=a,a=this._getLineHeight(++c)}else a=this._getLineHeight(),c=Math.floor(b/a);return Math.max(0,Math.min(e-1,c))},_getScroll:function(){var b=this._viewDiv;return{x:b.scrollLeft,y:b.scrollTop}},_getSelection:function(){return this._selection.clone()},_getTopIndex:function(b){var a=this._topChild;if(b&&this._getClientHeight()>this._getLineHeight()){var b=
a.getBoundingClientRect(),c=this._getViewPadding(),e=this._viewDiv.getBoundingClientRect();b.top<e.top+c.top&&(a=this._getLineNext(a)||a)}return a.lineIndex},_hookEvents:function(){var b=this;this._modelListener={onChanging:function(a){b._onModelChanging(a)},onChanged:function(a){b._onModelChanged(a)}};this._model.addEventListener("preChanging",this._modelListener.onChanging);this._model.addEventListener("postChanged",this._modelListener.onChanged);var c=this._handlers=[],e=this._clientDiv,d=this._viewDiv,
f=this._rootDiv,m=this._overlayDiv||e,h=e.ownerDocument,n=this._getWindow(),i=a.isIE?h:n;c.push({target:n,type:"resize",handler:function(a){return b._handleResize(a?a:n.event)}});c.push({target:e,type:"blur",handler:function(a){return b._handleBlur(a?a:n.event)}});c.push({target:e,type:"focus",handler:function(a){return b._handleFocus(a?a:n.event)}});c.push({target:d,type:"focus",handler:function(){e.focus()}});c.push({target:d,type:"scroll",handler:function(a){return b._handleScroll(a?a:n.event)}});
c.push({target:e,type:"textInput",handler:function(a){return b._handleTextInput(a?a:n.event)}});c.push({target:e,type:"keydown",handler:function(a){return b._handleKeyDown(a?a:n.event)}});c.push({target:e,type:"keypress",handler:function(a){return b._handleKeyPress(a?a:n.event)}});c.push({target:e,type:"keyup",handler:function(a){return b._handleKeyUp(a?a:n.event)}});c.push({target:e,type:"contextmenu",handler:function(a){return b._handleContextMenu(a?a:n.event)}});c.push({target:e,type:"copy",handler:function(a){return b._handleCopy(a?
a:n.event)}});c.push({target:e,type:"cut",handler:function(a){return b._handleCut(a?a:n.event)}});c.push({target:e,type:"paste",handler:function(a){return b._handlePaste(a?a:n.event)}});if(a.isIOS||a.isAndroid)c.push({target:h,type:"selectionchange",handler:function(a){return b._handleSelectionChange(a?a:n.event)}}),c.push({target:e,type:"touchstart",handler:function(a){return b._handleTouchStart(a?a:n.event)}}),c.push({target:e,type:"touchmove",handler:function(a){return b._handleTouchMove(a?a:n.event)}}),
c.push({target:e,type:"touchend",handler:function(a){return b._handleTouchEnd(a?a:n.event)}});else{c.push({target:e,type:"selectstart",handler:function(a){return b._handleSelectStart(a?a:n.event)}});c.push({target:e,type:"mousedown",handler:function(a){return b._handleMouseDown(a?a:n.event)}});c.push({target:e,type:"mouseover",handler:function(a){return b._handleMouseOver(a?a:n.event)}});c.push({target:e,type:"mouseout",handler:function(a){return b._handleMouseOut(a?a:n.event)}});c.push({target:i,
type:"mouseup",handler:function(a){return b._handleMouseUp(a?a:n.event)}});c.push({target:i,type:"mousemove",handler:function(a){return b._handleMouseMove(a?a:n.event)}});c.push({target:f,type:"mousedown",handler:function(a){return b._handleRootMouseDown(a?a:n.event)}});c.push({target:f,type:"mouseup",handler:function(a){return b._handleRootMouseUp(a?a:n.event)}});c.push({target:m,type:"dragstart",handler:function(a){return b._handleDragStart(a?a:n.event)}});c.push({target:m,type:"drag",handler:function(a){return b._handleDrag(a?
a:n.event)}});c.push({target:m,type:"dragend",handler:function(a){return b._handleDragEnd(a?a:n.event)}});c.push({target:m,type:"dragenter",handler:function(a){return b._handleDragEnter(a?a:n.event)}});c.push({target:m,type:"dragover",handler:function(a){return b._handleDragOver(a?a:n.event)}});c.push({target:m,type:"dragleave",handler:function(a){return b._handleDragLeave(a?a:n.event)}});c.push({target:m,type:"drop",handler:function(a){return b._handleDrop(a?a:n.event)}});c.push({target:this._clientDiv,
type:a.isFirefox?"DOMMouseScroll":"mousewheel",handler:function(a){return b._handleMouseWheel(a?a:n.event)}});if(a.isFirefox&&(!a.isWindows||a.isFirefox>=15))(d=n.MutationObserver||n.MozMutationObserver)?(this._mutationObserver=new d(function(a){b._handleDataModified(a)}),this._mutationObserver.observe(e,{subtree:!0,characterData:!0})):c.push({target:this._clientDiv,type:"DOMCharacterDataModified",handler:function(a){return b._handleDataModified(a?a:n.event)}});this._overlayDiv&&(c.push({target:this._overlayDiv,
type:"mousedown",handler:function(a){return b._handleMouseDown(a?a:n.event)}}),c.push({target:this._overlayDiv,type:"mouseover",handler:function(a){return b._handleMouseOver(a?a:n.event)}}),c.push({target:this._overlayDiv,type:"mouseout",handler:function(a){return b._handleMouseOut(a?a:n.event)}}),c.push({target:this._overlayDiv,type:"contextmenu",handler:function(a){return b._handleContextMenu(a?a:n.event)}}));this._isW3CEvents||c.push({target:this._clientDiv,type:"dblclick",handler:function(a){return b._handleDblclick(a?
a:n.event)}})}d=this._leftDiv;f=this._rightDiv;a.isIE&&c.push({target:d,type:"selectstart",handler:function(){return!1}});c.push({target:d,type:a.isFirefox?"DOMMouseScroll":"mousewheel",handler:function(a){return b._handleMouseWheel(a?a:n.event)}});c.push({target:d,type:"click",handler:function(a){b._handleRulerEvent(a?a:n.event)}});c.push({target:d,type:"dblclick",handler:function(a){b._handleRulerEvent(a?a:n.event)}});c.push({target:d,type:"mousemove",handler:function(a){b._handleRulerEvent(a?a:
n.event)}});c.push({target:d,type:"mouseover",handler:function(a){b._handleRulerEvent(a?a:n.event)}});c.push({target:d,type:"mouseout",handler:function(a){b._handleRulerEvent(a?a:n.event)}});a.isIE&&c.push({target:f,type:"selectstart",handler:function(){return!1}});c.push({target:f,type:a.isFirefox?"DOMMouseScroll":"mousewheel",handler:function(a){return b._handleMouseWheel(a?a:n.event)}});c.push({target:f,type:"click",handler:function(a){b._handleRulerEvent(a?a:n.event)}});c.push({target:f,type:"dblclick",
handler:function(a){b._handleRulerEvent(a?a:n.event)}});c.push({target:f,type:"mousemove",handler:function(a){b._handleRulerEvent(a?a:n.event)}});c.push({target:f,type:"mouseover",handler:function(a){b._handleRulerEvent(a?a:n.event)}});c.push({target:f,type:"mouseout",handler:function(a){b._handleRulerEvent(a?a:n.event)}});for(d=0;d<c.length;d++)f=c[d],g(f.target,f.type,f.handler,f.capture)},_getWindow:function(){return this._parent.ownerDocument.defaultView||this._parent.ownerDocument.parentWindow},
_init:function(b){var c=b.parent;typeof c==="string"&&(c=(b.document||document).getElementById(c));if(!c)throw"no parent";b.parent=c;b.model=b.model||new k.TextModel;var e=this._defaultOptions(),d;for(d in e)e.hasOwnProperty(d)&&(this["_"+d]=b[d]!==void 0?b[d]:e[d].value);this._rulers=[];this._selection=new m(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=
(!a.isIE||a.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(!a.isMac)return{};var b=this._viewDiv.getBoundingClientRect(),c=this._lastMouseMoveX,e=this._lastMouseMoveY;return{vertical:b.top<=e&&e<b.bottom&&b.right-15<=c&&c<b.right,horizontal:b.bottom-15<=e&&e<b.bottom&&b.left<=c&&c<b.right}},_modifyContent:function(b,a){if(!this._readonly||b._code)if(b.type="Verify",this.onVerify(b),!(b.text===null||b.text===void 0)){var c=this._model;try{if(b._ignoreDOMSelection)this._ignoreDOMSelection=
!0;c.setText(b.text,b.start,b.end)}finally{if(b._ignoreDOMSelection)this._ignoreDOMSelection=!1}a&&(c=this._getSelection(),c.setCaret(b.start+b.text.length),this._setSelection(c,!0));this.onModify({type:"Modify"})}},_onModelChanged:function(b){b.type="ModelChanged";this.onModelChanged(b);b.type="Changed";var a=b.start,c=b.addedCharCount,e=b.removedCharCount,d=b.addedLineCount,f=b.removedLineCount,g=this._getSelection();g.end>a&&(g.end>a&&g.start<a+e?g.setCaret(a+c):(g.start+=c-e,g.end+=c-e),this._setSelection(g,
!1,!1));a=this._model.getLineAtOffset(a);for(c=this._getLineNext();c;){e=c.lineIndex;if(a<=e&&e<=a+f)a===e&&!c.modelChangedEvent&&!c.lineRemoved?(c.modelChangedEvent=b,c.lineChanged=!0):(c.lineRemoved=!0,c.lineChanged=!1,c.modelChangedEvent=null);if(e>a+f)c.lineIndex=e+d-f,c._line.lineIndex=c.lineIndex;c=this._getLineNext(c)}if(!this._wrapMode&&a<=this._maxLineIndex&&this._maxLineIndex<=a+f)this._checkMaxLineIndex=this._maxLineIndex,this._maxLineIndex=-1,this._maxLineWidth=0;this._update()},_onModelChanging:function(b){b.type=
"ModelChanging";this.onModelChanging(b);b.type="Changing"},_queueUpdate:function(){if(!this._updateTimer&&!this._ignoreQueueUpdate){var b=this;this._updateTimer=this._getWindow().setTimeout(function(){b._updateTimer=null;b._update()},0)}},_resetLineHeight:function(b,a){if(this._wrapMode){if(b!==void 0&&a!==void 0)for(var c=b;c<a;c++)this._lineHeight[c]=void 0;else this._lineHeight=Array(this._model.getLineCount());this._calculateLineHeightTimer()}else this._lineHeight=null},_resetLineWidth:function(){var b=
this._clientDiv;if(b)for(b=b.firstChild;b;)b.lineWidth=void 0,b=b.nextSibling},_reset:function(){this._maxLineIndex=-1;this._maxLineWidth=0;this._columnX=-1;this._bottomChild=this._topChild=null;this._topIndexY=0;this._resetLineHeight();this._setSelection(new m(0,0,!1),!1,!1);if(this._viewDiv)this._viewDiv.scrollLeft=0,this._viewDiv.scrollTop=0;var b=this._clientDiv;if(b){for(var c=b.firstChild;c;)c.lineRemoved=!0,c=c.nextSibling;if(a.isFirefox)this._ignoreFocus=!1,(c=this._hasFocus)&&b.blur(),b.contentEditable=
!1,b.contentEditable=!0,c&&b.focus(),this._ignoreFocus=!1}},_scrollView:function(b,a){this._ensureCaretVisible=!1;var c=this._viewDiv;b&&(c.scrollLeft+=b);a&&(c.scrollTop+=a)},_setClipboardText:function(b,e){var d,f=this._parent.ownerDocument,g=this._getWindow();if(g.clipboardData)return d=[],c(b,function(b){d.push(b)},function(){d.push(a.platformDelimiter)}),g.clipboardData.setData("Text",d.join(""));if(e&&e.clipboardData&&(d=[],c(b,function(b){d.push(b)},function(){d.push(a.platformDelimiter)}),
e.clipboardData.setData("text/plain",d.join(""))))return!0;var m=a.createElement(f,"pre");m.style.position="fixed";m.style.left="-1000px";c(b,function(b){m.appendChild(f.createTextNode(b))},function(){m.appendChild(a.createElement(f,"br"))});m.appendChild(f.createTextNode(" "));this._clientDiv.appendChild(m);var h=f.createRange();h.setStart(m.firstChild,0);h.setEndBefore(m.lastChild);var n=g.getSelection();n.rangeCount>0&&n.removeAllRanges();n.addRange(h);var i=this,h=function(){m&&m.parentNode===
i._clientDiv&&i._clientDiv.removeChild(m);i._updateDOMSelection()},n=!1;this._ignoreCopy=!0;try{n=f.execCommand("copy",!1,null)}catch(j){}this._ignoreCopy=!1;if(!n&&e)return g.setTimeout(h,0),!1;h();return!0},_setDOMSelection:function(b,c,e,d){for(var f,g,m,h,n=0,i=b.firstChild,j,k,r=this._model.getLine(b.lineIndex).length;i;){j=i.firstChild;k=j.length;i.ignoreChars&&(k-=i.ignoreChars);if(n+k>c||n+k>=r){f=j;g=c-n;i.ignoreChars&&k>0&&g===k&&(g+=i.ignoreChars);break}n+=k;i=i.nextSibling}for(var n=0,
i=e.firstChild,q=this._model.getLine(e.lineIndex).length;i;){j=i.firstChild;k=j.length;i.ignoreChars&&(k-=i.ignoreChars);if(k+n>d||n+k>=q){m=j;h=d-n;i.ignoreChars&&k>0&&h===k&&(h+=i.ignoreChars);break}n+=k;i=i.nextSibling}this._setDOMFullSelection(b,c,r,e,d,q);if(this._hasFocus)if(c=this._getWindow(),b=this._parent.ownerDocument,c.getSelection){if(c=c.getSelection(),!(c.anchorNode===f&&c.anchorOffset===g&&c.focusNode===m&&c.focusOffset===h||c.anchorNode===m&&c.anchorOffset===h&&c.focusNode===f&&c.focusOffset===
g))b=b.createRange(),b.setStart(f,g),b.setEnd(m,h),this._ignoreSelect=!1,c.rangeCount>0&&c.removeAllRanges(),c.addRange(b),this._ignoreSelect=!0}else if(b.selection)c=b.body,b=a.createElement(b,"div"),c.appendChild(b),c.removeChild(b),b=c.createTextRange(),b.moveToElementText(f.parentNode),b.moveStart("character",g),f=c.createTextRange(),f.moveToElementText(m.parentNode),f.moveStart("character",h),b.setEndPoint("EndToStart",f),this._ignoreSelect=!1,b.select(),this._ignoreSelect=!0},_setDOMFullSelection:function(b,
a,c,e,d){if(this._selDiv1&&(c=this._selDiv1,c.style.width="0px",c.style.height="0px",c=this._selDiv2,c.style.width="0px",c.style.height="0px",c=this._selDiv3,c.style.width="0px",c.style.height="0px",!(b===e&&a===d))){var f=this._model,g=this._getViewPadding(),m=this._clientDiv.getBoundingClientRect(),h=this._viewDiv.getBoundingClientRect(),c=h.left+g.left,n=m.right,g=h.top+g.top,i=m.bottom,h=m=0;this._clipDiv?(h=this._clipDiv.getBoundingClientRect(),m=h.left-this._clipDiv.scrollLeft):(h=this._rootDiv.getBoundingClientRect(),
m=h.left);h=h.top;this._ignoreDOMSelection=!0;var b=(new r(this,b.lineIndex,b)).getBoundingClientRect(f.getLineStart(b.lineIndex)+a,!1),j=b.left,d=(new r(this,e.lineIndex,e)).getBoundingClientRect(f.getLineStart(e.lineIndex)+d,!1),a=d.left;this._ignoreDOMSelection=!1;var f=this._selDiv1,j=Math.min(n,Math.max(c,j)),k=Math.min(i,Math.max(g,b.top)),q=n,e=Math.min(i,Math.max(g,b.bottom));f.style.left=j-m+"px";f.style.top=k-h+"px";f.style.width=Math.max(0,q-j)+"px";f.style.height=Math.max(0,e-k)+"px";
if(b.top===d.top)q=Math.min(a,n),f.style.width=Math.max(0,q-j)+"px";else if(b=Math.min(i,Math.max(g,d.top)),a=Math.min(n,Math.max(c,a)),g=Math.min(i,Math.max(g,d.bottom)),i=this._selDiv3,i.style.left=c-m+"px",i.style.top=b-h+"px",i.style.width=Math.max(0,a-c)+"px",i.style.height=Math.max(0,g-b)+"px",b-e>0)g=this._selDiv2,g.style.left=c-m+"px",g.style.top=e-h+"px",g.style.width=Math.max(0,n-c)+"px",g.style.height=Math.max(0,b-e)+"px"}},_setGrab:function(b){if(b!==this._grabControl)b?(b.setCapture&&
b.setCapture(),this._grabControl=b):(this._grabControl.releaseCapture&&this._grabControl.releaseCapture(),this._grabControl=null)},_setLinksVisible:function(b){if(this._linksVisible!==b){this._linksVisible=b;if(a.isIE&&b)this._hadFocus=this._hasFocus;var c=this._clientDiv;c.contentEditable=!b;this._hadFocus&&!b&&c.focus();if(this._overlayDiv)this._overlayDiv.style.zIndex=b?"-1":"1";for(b=this._getLineNext();b;){if(b.hasLink)for(c=b.firstChild;c;){var e=c.nextSibling,d=c.viewStyle;d&&d.tagName==="A"&&
b.replaceChild(b._line._createSpan(b,c.firstChild.data,d),c);c=e}b=this._getLineNext(b)}}},_setSelection:function(b,a,c,e){if(b){this._columnX=-1;c===void 0&&(c=!0);var d=this._selection;this._selection=b;a&&this._showCaret(!1,e);c&&this._updateDOMSelection();if(!d.equals(b))this.onSelection({type:"Selection",oldValue:{start:d.start,end:d.end},newValue:{start:b.start,end:b.end}})}},_setSelectionTo:function(b,a,c,e){var d=this._model,f=this._getSelection(),a=this.convert({x:b,y:a},"page","document"),
b=this._getLineIndex(a.y);if(this._clickCount===1){d=this._getLine(b);b=d.getOffset(a.x,a.y-this._getLinePixel(b));d.destroy();if(e&&!c&&f.start<=b&&b<f.end)return this._dragOffset=b,!1;f.extend(b);c||f.collapse()}else(this._clickCount&1)===0?(d=this._getLine(b),b=d.getOffset(a.x,a.y-this._getLinePixel(b)),this._doubleClickSelection?b>=this._doubleClickSelection.start?(c=this._doubleClickSelection.start,e=d.getNextOffset(b,"wordend",1)):(c=d.getNextOffset(b,"word",-1),e=this._doubleClickSelection.end):
(c=d.getNextOffset(b,"word",-1),e=d.getNextOffset(c,"wordend",1)),d.destroy()):this._doubleClickSelection?(e=d.getLineAtOffset(this._doubleClickSelection.start),b>=e?(c=d.getLineStart(e),e=d.getLineEnd(b)):(c=d.getLineStart(b),e=d.getLineEnd(e))):(c=d.getLineStart(b),e=d.getLineEnd(b)),f.setCaret(c),f.extend(e);this._setSelection(f,!0,!0);return!0},_setFullSelection:function(b,c){this._fullSelection=b;if(a.isWebkit)this._fullSelection=!0;var e=this._clipDiv||this._rootDiv;if(e)if(this._fullSelection){if(!this._selDiv1&&
this._fullSelection&&!a.isIOS){var d=e.ownerDocument;this._highlightRGB=a.isWebkit?"transparent":"Highlight";var f=a.createElement(d,"div");this._selDiv1=f;f.style.position="absolute";f.style.borderWidth="0px";f.style.margin="0px";f.style.padding="0px";f.style.outline="none";f.style.background=this._highlightRGB;f.style.width="0px";f.style.height="0px";f.style.zIndex="0";e.appendChild(f);var g=a.createElement(d,"div");this._selDiv2=g;g.style.position="absolute";g.style.borderWidth="0px";g.style.margin=
"0px";g.style.padding="0px";g.style.outline="none";g.style.background=this._highlightRGB;g.style.width="0px";g.style.height="0px";g.style.zIndex="0";e.appendChild(g);this._selDiv3=d=a.createElement(d,"div");d.style.position="absolute";d.style.borderWidth="0px";d.style.margin="0px";d.style.padding="0px";d.style.outline="none";d.style.background=this._highlightRGB;d.style.width="0px";d.style.height="0px";d.style.zIndex="0";e.appendChild(d);if(a.isFirefox&&a.isMac){e=this._getWindow().getComputedStyle(d,
null).getPropertyValue("background-color");switch(e){case "rgb(119, 141, 168)":e="rgb(199, 208, 218)";break;case "rgb(127, 127, 127)":e="rgb(198, 198, 198)";break;case "rgb(255, 193, 31)":e="rgb(250, 236, 115)";break;case "rgb(243, 70, 72)":e="rgb(255, 176, 139)";break;case "rgb(255, 138, 34)":e="rgb(255, 209, 129)";break;case "rgb(102, 197, 71)":e="rgb(194, 249, 144)";break;case "rgb(140, 78, 184)":e="rgb(232, 184, 255)";break;default:e="rgb(180, 213, 255)"}this._highlightRGB=e;f.style.background=
e;g.style.background=e;d.style.background=e}c||this._updateDOMSelection()}}else{if(this._selDiv1)e.removeChild(this._selDiv1),this._selDiv1=null;if(this._selDiv2)e.removeChild(this._selDiv2),this._selDiv2=null;if(this._selDiv3)e.removeChild(this._selDiv3),this._selDiv3=null}},_setReadOnly:function(b){this._readonly=b;this._clientDiv.setAttribute("aria-readonly",b?"true":"false")},_setTabSize:function(b,c){this._tabSize=b;this._customTabSize=void 0;var e=this._clientDiv;if(a.isOpera){if(e)e.style.OTabSize=
this._tabSize+""}else if(a.isWebkit>=537.1){if(e)e.style.tabSize=this._tabSize+""}else if(a.isFirefox>=4){if(e)e.style.MozTabSize=this._tabSize+""}else if(this._tabSize!==8)this._customTabSize=this._tabSize;c||(this.redrawLines(),this._resetLineWidth())},_setThemeClass:function(b,a){this._themeClass=b;var c="textviewContainer";this._themeClass&&(c+=" "+this._themeClass);this._rootDiv.className=c;this._updateStyle(a)},_setWrapMode:function(b,a){this._wrapMode=b;var c=this._clientDiv,e=this._viewDiv;
b?(c.style.whiteSpace="pre-wrap",c.style.wordWrap="break-word",e.style.overflowX="hidden",e.style.overflowY="scroll"):(c.style.whiteSpace="pre",c.style.wordWrap="normal",e.style.overflowX="auto",e.style.overflowY="auto");a||(this.redraw(),this._resetLineWidth());this._resetLineHeight()},_showCaret:function(b,a){if(this._clientDiv){var c=this._model,e=this._getSelection(),d=this._getScroll(),f=e.getCaret(),g=e.start,m=e.end,h=c.getLineAtOffset(m),n=Math.max(Math.max(g,c.getLineStart(h)),m-1),c=this._getClientWidth(),
h=this._getClientHeight(),i=c/4,j=this._getBoundsAtOffset(f===g?g:n),k=j.left,r=j.right,q=j.top,D=j.bottom;b&&!e.isEmpty()&&(j=this._getBoundsAtOffset(f===m?g:n),j.top===q?f===g?r=k+Math.min(j.right-k,c):k=r-Math.min(r-j.left,c):f===g?D=q+Math.min(j.bottom-q,h):q=D-Math.min(D-j.top,h));e=0;k<d.x&&(e=Math.min(k-d.x,-i));r>d.x+c&&(e=Math.max(r-d.x-c,i));f=0;q<d.y?f=q-d.y:D>d.y+h&&(f=D-d.y-h);a&&(a>0?f>0&&(f=Math.max(f,a)):f<0&&(f=Math.min(f,a)));return e!==0||f!==0?(this._scrollView(e,f),h!==this._getClientHeight()||
c!==this._getClientWidth()?this._showCaret():this._ensureCaretVisible=!0,!0):!1}},_startIME:function(){if(this._imeOffset===-1){var b=this._getSelection();b.isEmpty()||this._modifyContent({text:"",start:b.start,end:b.end},!0);this._imeOffset=b.start}},_unhookEvents:function(){this._model.removeEventListener("preChanging",this._modelListener.onChanging);this._model.removeEventListener("postChanged",this._modelListener.onChanged);this._modelListener=null;for(var b=0;b<this._handlers.length;b++){var a=
this._handlers[b],c=a.target,e=a.type,a=a.handler;typeof c.removeEventListener==="function"?c.removeEventListener(e,a,!1):c.detachEvent("on"+e,a)}this._handlers=null;if(this._mutationObserver)this._mutationObserver.disconnect(),this._mutationObserver=null},_updateDOMSelection:function(){if(!this._ignoreDOMSelection&&this._clientDiv){var b=this._getSelection(),a=this._model,c=a.getLineAtOffset(b.start),e=a.getLineAtOffset(b.end),d=this._getLineNext();if(d){var f=this._getLinePrevious(),g;c<d.lineIndex?
(g=d,c=0):c>f.lineIndex?(g=f,c=0):(g=this._getLineNode(c),c=b.start-a.getLineStart(c));e<d.lineIndex?b=0:e>f.lineIndex?(d=f,b=0):(d=this._getLineNode(e),b=b.end-a.getLineStart(e));this._setDOMSelection(g,c,d,b)}}},_update:function(b){if(!(this._redrawCount>0)){if(this._updateTimer)this._getWindow().clearTimeout(this._updateTimer),this._updateTimer=null,b=!1;var c=this._clientDiv;if(c){if(this._metrics.invalid)this._ignoreQueueUpdate=!0,this._updateStyle(),this._ignoreQueueUpdate=!1;var e=this._model,
d=this._getScroll(),f=this._getViewPadding(),g=e.getLineCount(),m=this._getLineHeight(),h=this._getClientWidth();if(this._wrapMode)c.style.width=h+"px";var n,i,j,k,q=0,w=0;if(this._lineHeight){for(;w<g;){j=this._getLineHeight(w);if(q+j>d.y)break;q+=j;w++}n=w;i=Math.max(0,n-1);j=e=d.y-q;n>0&&(e+=this._getLineHeight(n-1))}else k=Math.max(0,d.y)/m,n=Math.floor(k),i=Math.max(0,n-1),e=Math.round((k-i)*m),j=Math.round((k-n)*m);this._topIndexY=j;k=this._parent;var A=k.clientWidth,D=k.clientHeight;k=this._getClientHeight();
if(b){i=0;this._leftDiv&&(n=this._leftDiv.getBoundingClientRect(),i=n.right-n.left);n=h;for(this._wrapMode||(n=Math.max(this._maxLineWidth,n));w<g;)j=this._getLineHeight(w,!1),q+=j,w++;g=q}else{for(var h=this._viewDiv,d=Math.min(n+Math.floor((k+j)/m),g-1),E=Math.min(d+1,g-1),m=c.firstChild;m;){j=m.lineIndex;var H=m.nextSibling;if(!(i<=j&&j<=E)||m.lineRemoved||m.lineIndex===-1)this._mouseWheelLine===m?(m.style.display="none",m.lineIndex=-1):c.removeChild(m);m=H}var m=this._getLineNext(),H=h.ownerDocument,
B=H.createDocumentFragment();for(j=i;j<=E;j++)if(!m||m.lineIndex>j)(new r(this,j)).create(B,null);else{B.firstChild&&(c.insertBefore(B,m),B=H.createDocumentFragment());if(m&&m.lineChanged)m=(new r(this,j)).create(B,m),m.lineChanged=!1;m=this._getLineNext(m)}B.firstChild&&c.insertBefore(B,m);if(a.isWebkit&&!this._wrapMode)c.style.width="0x7fffffffpx";m=this._getLineNext();j=k+e;for(H=!1;m;){i=m.lineWidth;if(i===void 0)E=m._line.getBoundingClientRect(),i=m.lineWidth=Math.ceil(E.right-E.left),this._lineHeight&&
(this._lineHeight[m.lineIndex]=Math.ceil(E.bottom-E.top));if(this._lineHeight&&!H&&(j-=this._lineHeight[m.lineIndex],j<0))d=m.lineIndex,H=!0;if(!this._wrapMode){if(i>=this._maxLineWidth)this._maxLineWidth=i,this._maxLineIndex=m.lineIndex;if(this._checkMaxLineIndex===m.lineIndex)this._checkMaxLineIndex=-1}if(m.lineIndex===n)this._topChild=m;if(m.lineIndex===d)this._bottomChild=m;m=this._getLineNext(m)}if(this._checkMaxLineIndex!==-1&&(j=this._checkMaxLineIndex,this._checkMaxLineIndex=-1,0<=j&&j<g)){m=
new r(this,j);E=m.getBoundingClientRect();i=E.right-E.left;if(i>=this._maxLineWidth)this._maxLineWidth=i,this._maxLineIndex=j;m.destroy()}for(;w<g;)j=this._getLineHeight(w,w<=d),q+=j,w++;g=q;this._updateRuler(this._leftDiv,n,d);this._updateRuler(this._rightDiv,n,d);i=0;this._leftDiv&&(n=this._leftDiv.getBoundingClientRect(),i=n.right-n.left);d=0;this._rightDiv&&(d=this._rightDiv.getBoundingClientRect(),d=d.right-d.left);h.style.left=i+"px";h.style.right=d+"px";d=this._scrollDiv;d.style.height=g+"px";
q=h=this._getClientWidth();this._wrapMode||(q=Math.max(this._maxLineWidth,q));n=q;if((!a.isIE||a.isIE>=9)&&this._maxLineWidth>h)q+=f.right+f.left;d.style.width=q+"px";if(this._clipScrollDiv)this._clipScrollDiv.style.width=q+"px";d=this._getScroll();q=k+f.top+f.bottom;this._updateRulerSize(this._leftDiv,q);this._updateRulerSize(this._rightDiv,q)}if(this._vScrollDiv)q=k-8,w=Math.max(15,Math.ceil(Math.min(1,q/(g+f.top+f.bottom))*q)),this._vScrollDiv.style.left=i+h-8+"px",this._vScrollDiv.style.top=Math.floor(Math.max(0,
d.y*q/g))+"px",this._vScrollDiv.style.height=w+"px";if(!this._wrapMode&&this._hScrollDiv)q=h-8,w=Math.max(15,Math.ceil(Math.min(1,q/(this._maxLineWidth+f.left+f.right))*q)),this._hScrollDiv.style.left=i+Math.floor(Math.max(0,Math.floor(d.x*q/this._maxLineWidth)))+"px",this._hScrollDiv.style.top=k-9+"px",this._hScrollDiv.style.width=w+"px";E=d.x;j=this._clipDiv;q=this._overlayDiv;if(j){j.scrollLeft=E;w=i+f.left;m=f.top;b=h;i=k;E=0;H=-e;if(d.x===0)w-=f.left,b+=f.left,E=f.left;d.x+h===n&&(b+=f.right);
d.y===0&&(m-=f.top,i+=f.top,H+=f.top);d.y+k===g&&(i+=f.bottom);j.style.left=w+"px";j.style.top=m+"px";f=this._isOverOverlayScroll();j.style.right=A-b-w+(this._overlayScrollTimer&&f.vertical?15:0)+"px";j.style.bottom=D-i-m+(this._overlayScrollTimer&&f.horizontal?15:0)+"px";c.style.left=E+"px";c.style.top=H+"px";c.style.width=n+"px";c.style.height=k+e+"px";if(q)q.style.left=c.style.left,q.style.top=c.style.top,q.style.width=c.style.width,q.style.height=c.style.height}else{w=E;m=e;A=E+h;D=e+k;w===0&&
(w-=f.left);m===0&&(m-=f.top);A===n&&(A+=f.right);d.y+k===g&&(D+=f.bottom);c.style.clip="rect("+m+"px,"+A+"px,"+D+"px,"+w+"px)";c.style.left=-E+i+f.left+"px";c.style.width=(a.isWebkit?n:h+E)+"px";if(!b)c.style.top=-e+f.top+"px",c.style.height=k+e+"px";if(q&&(q.style.clip=c.style.clip,q.style.left=c.style.left,q.style.width=c.style.width,!b))q.style.top=c.style.top,q.style.height=c.style.height}this._updateDOMSelection();c=this._ensureCaretVisible;this._ensureCaretVisible=!1;k!==this._getClientHeight()&&
(this._update(),c&&this._showCaret())}}},_updateRulerSize:function(b,a){if(b){for(var c=this._topIndexY,e=this._getLineHeight(),d=b.firstChild.rows[0].cells,f=0;f<d.length;f++){var g=d[f].firstChild,m=e;g._ruler.getOverview()==="page"&&(m+=c);g.style.top=-m+"px";g.style.height=a+m+"px"}b.style.height=a+"px"}},_updateRuler:function(b,c,e){if(b)for(var b=b.firstChild.rows[0].cells,d=this._parent.ownerDocument,f=this._getLineHeight(),g=this._getViewPadding(),m=0;m<b.length;m++){var n=b[m].firstChild,
i=n._ruler;n.rulerChanged&&h(i.getRulerStyle(),n);var j,k=n.firstChild;k?(j=k,k=k.nextSibling):(j=a.createElement(d,"div"),j.style.visibility="hidden",n.appendChild(j));var r,q;if(n.rulerChanged&&j){r=-1;if(q=i.getWidestAnnotation())if(h(q.style,j),q.html)j.innerHTML=q.html;j.lineIndex=r;j.style.height=f+g.top+"px"}var w,A;if(i.getOverview()==="page"){for(i=i.getAnnotations(c,e+1);k;)r=k.lineIndex,q=k.nextSibling,(!(c<=r&&r<=e)||k.lineChanged)&&n.removeChild(k),k=q;k=n.firstChild.nextSibling;A=d.createDocumentFragment();
for(r=c;r<=e;r++)if(!k||k.lineIndex>r){w=a.createElement(d,"div");if(q=i[r]){h(q.style,w);if(q.html)w.innerHTML=q.html;w.annotation=q}w.lineIndex=r;w.style.height=this._getLineHeight(r)+"px";A.appendChild(w)}else if(A.firstChild&&(n.insertBefore(A,k),A=d.createDocumentFragment()),k)k=k.nextSibling;A.firstChild&&n.insertBefore(A,k)}else{q=this._getClientHeight();r=this._model.getLineCount();k=q+g.top+g.bottom-2*this._metrics.scrollWidth;j=f*r<k?f:k/r;if(n.rulerChanged){for(q=n.childNodes.length;q>
1;)n.removeChild(n.lastChild),q--;i=i.getAnnotations(0,r);A=d.createDocumentFragment();for(var D in i)if(r=D>>>0,!(r<0)){w=a.createElement(d,"div");q=i[D];h(q.style,w);w.style.position="absolute";w.style.top=this._metrics.scrollWidth+f+Math.floor(r*j)+"px";if(q.html)w.innerHTML=q.html;w.annotation=q;w.lineIndex=r;A.appendChild(w)}n.appendChild(A)}else if(n._oldTrackHeight!==k)for(w=n.firstChild?n.firstChild.nextSibling:null;w;)w.style.top=this._metrics.scrollWidth+f+Math.floor(w.lineIndex*j)+"px",
w=w.nextSibling;n._oldTrackHeight=k}n.rulerChanged=!1}},_updateStyle:function(b){if(!b&&a.isIE)this._rootDiv.style.lineHeight="normal";var c=this._metrics=this._calculateMetrics();this._rootDiv.style.lineHeight=a.isIE?c.lineHeight-(c.lineTrim.top+c.lineTrim.bottom)+"px":"normal";b||(this.redraw(),this._resetLineWidth())}};i.EventTarget.addMixin(q.prototype);return{TextView:q}});
define("orion/editor/tooltip",["i18n!orion/editor/nls/messages","orion/editor/textView","orion/editor/textModel","orion/editor/projectionTextModel","orion/editor/util"],function(k,j,i,a,g){function h(a){this._view=a;this._create(a.getOptions("parent").ownerDocument);a.addEventListener("Destroy",this,this.destroy)}h.getTooltip=function(a){if(!a._tooltip)a._tooltip=new h(a);return a._tooltip};h.prototype={_create:function(a){if(!this._tooltipDiv){var f=this._tooltipDiv=g.createElement(a,"div");f.className=
"textviewTooltip";f.setAttribute("aria-live","assertive");f.setAttribute("aria-atomic","true");var c=this._tooltipContents=g.createElement(a,"div");f.appendChild(c);a.body.appendChild(f);this.hide()}},_getWindow:function(){var a=this._tooltipDiv.ownerDocument;return a.defaultView||a.parentWindow},destroy:function(){if(this._tooltipDiv){this.hide();var a=this._tooltipDiv.parentNode;a&&a.removeChild(this._tooltipDiv);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 a=this._getWindow();if(this._showTimeout)a.clearTimeout(this._showTimeout),this._showTimeout=null;if(this._hideTimeout)a.clearTimeout(this._hideTimeout),this._hideTimeout=null;if(this._fadeTimeout)a.clearInterval(this._fadeTimeout),this._fadeTimeout=null},isVisible:function(){return this._tooltipDiv&&this._tooltipDiv.style.visibility==="visible"},setTarget:function(a,
f){if(this.target!==a&&(this._target=a,this.hide(),a)){var c=this;if(f===0)c.show(!0);else{var b=this._getWindow();c._showTimeout=b.setTimeout(function(){c.show(!0)},f?f:500)}}},show:function(d){if(this._target){var f=this._target.getTooltipInfo();if(f){var c=this._tooltipDiv,b=this._tooltipContents;c.style.left=c.style.right=c.style.width=c.style.height=b.style.width=b.style.height="auto";var e=f.contents;e instanceof Array&&(e=this._getAnnotationContents(e));if(typeof e==="string")b.innerHTML=e;
else if(this._isNode(e))b.appendChild(e);else if(e instanceof a.ProjectionTextModel){var g=this._view,h=g.getOptions();h.wrapMode=!1;h.parent=b;var i=h.themeClass;i?((i=i.replace("tooltip",""))&&(i=" "+i),i="tooltip"+i):i="tooltip";h.themeClass=i;h=this._contentsView=new j.TextView(h);h._clientDiv.contentEditable=!1;h.addEventListener("LineStyle",function(b){g.onLineStyle(b)});h.setModel(e);e=h.computeSize();b.style.width=e.width+20+"px";b.style.height=e.height+"px";h.resize()}else return;b=c.ownerDocument.documentElement;
f.anchor==="right"?(e=b.clientWidth-f.x,c.style.right=e+"px"):(e=parseInt(this._getNodeStyle(c,"padding-left","0"),10),e+=parseInt(this._getNodeStyle(c,"border-left-width","0"),10),e=f.x-e,c.style.left=e+"px");c.style.maxWidth=b.clientWidth-e-10+"px";e=parseInt(this._getNodeStyle(c,"padding-top","0"),10);e+=parseInt(this._getNodeStyle(c,"border-top-width","0"),10);e=f.y-e;c.style.top=e+"px";c.style.maxHeight=b.clientHeight-e-10+"px";c.style.opacity="1";c.style.visibility="visible";if(d){var k=this,
l=this._getWindow();k._hideTimeout=l.setTimeout(function(){var b=parseFloat(k._getNodeStyle(c,"opacity","1"));k._fadeTimeout=l.setInterval(function(){c.style.visibility==="visible"&&b>0?(b-=0.1,c.style.opacity=b):k.hide()},50)},5E3)}}}},_getAnnotationContents:function(d){function f(a){var c=a.title;if(c==="")return null;var e="<div>";a.html&&(e+=a.html+"&nbsp;");if(!c)c=a.end,a=b.getLineStart(b.getLineAtOffset(a.start)),c=b.getLineEnd(b.getLineAtOffset(c),!0),c=b.getText(a,c);c=c.replace(/</g,"&lt;").replace(/>/g,
"&gt;");e+="<span style='vertical-align:middle;'>"+c+"</span><div>";return e}if(d.length===0)return null;var c=this._view.getModel(),b=c.getBaseModel?c.getBaseModel():c;if(d.length===1)if(c=d[0],c.title!==void 0)return f(c);else{var d=new a.ProjectionTextModel(b),e=b.getLineStart(b.getLineAtOffset(c.start)),g=b.getCharCount();c.end!==g&&d.addProjection({start:c.end,end:g});e>0&&d.addProjection({start:0,end:e});return d}else{e="<div><em>"+k.multipleAnnotations+"</em></div>";for(g=0;g<d.length;g++)c=
d[g],(c=f(c))&&(e+=c);return e}},_getNodeStyle:function(a,f,c){var b;if(a&&(b=a.style[f],!b))if(a.currentStyle){for(b=0;(b=f.indexOf("-",b))!==-1;)f=f.substring(0,b)+f.substring(b+1,b+2).toUpperCase()+f.substring(b+2);b=a.currentStyle[f]}else b=(a=a.ownerDocument.defaultView.getComputedStyle(a,null))?a.getPropertyValue(f):null;return b||c},_isNode:function(a){return typeof Node==="object"?a instanceof Node:a&&typeof a==="object"&&typeof a.nodeType==="number"&&typeof a.nodeName==="string"}};return{Tooltip:h}});
define("orion/editor/rulers",["i18n!orion/editor/nls/messages","orion/editor/annotations","orion/editor/tooltip","orion/editor/util"],function(k,j,i,a){function g(b,a,c,d){this._location=a||"left";this._overview=c||"page";this._rulerStyle=d;this._view=null;var f=this;this._listener={onTextModelChanged:function(b){f._onTextModelChanged(b)},onAnnotationModelChanged:function(b){f._onAnnotationModelChanged(b)}};this.setAnnotationModel(b)}function h(b,a,c,d,f){g.call(this,b,a,"page",c);this._oddStyle=
d||{style:{backgroundColor:"white"}};this._evenStyle=f||{style:{backgroundColor:"white"}};this._numOfDigits=0}function d(b,a,c){g.call(this,b,a,"page",c)}function f(b,a,c){g.call(this,b,a,"document",c)}function c(b,a,c){d.call(this,b,a,c)}g.prototype={getAnnotations:function(b,a){var c=this._annotationModel;if(!c)return[];var d=this._view.getModel(),f=d.getLineStart(b),g=d.getLineEnd(a-1),h=d;d.getBaseModel&&(h=d.getBaseModel(),f=d.mapOffset(f),g=d.mapOffset(g));for(var i=[],c=this.getAnnotationsByType(c,
f,g),f=0;f<c.length;f++)for(var g=c[f],j=h.getLineAtOffset(g.start),k=h.getLineAtOffset(Math.max(g.start,g.end-1)),s=j;s<=k;s++){var v=s;if(d!==h){v=h.getLineStart(s);v=d.mapOffset(v,!0);if(v===-1)continue;v=d.getLineAtOffset(v)}if(b<=v&&v<a){var t=this._mergeAnnotation(i[v],g,s-j,k-j+1);t&&(i[v]=t)}}if(!this._multiAnnotation&&this._multiAnnotationOverlay)for(var y in i)i[y]._multiple&&(i[y].html+=this._multiAnnotationOverlay.html);return i},getAnnotationModel:function(){return this._annotationModel},
getLocation:function(){return this._location},getOverview:function(){return this._overview},getRulerStyle:function(){return this._rulerStyle},getView:function(){return this._view},getWidestAnnotation:function(){return null},setAnnotationModel:function(b){this._annotationModel&&this._annotationModel.removEventListener("Changed",this._listener.onAnnotationModelChanged);(this._annotationModel=b)&&this._annotationModel.addEventListener("Changed",this._listener.onAnnotationModelChanged)},setMultiAnnotation:function(b){this._multiAnnotation=
b},setMultiAnnotationOverlay:function(b){this._multiAnnotationOverlay=b},setView:function(b){this._onTextModelChanged&&this._view&&this._view.removeEventListener("ModelChanged",this._listener.onTextModelChanged);this._view=b;this._onTextModelChanged&&this._view&&this._view.addEventListener("ModelChanged",this._listener.onTextModelChanged)},onClick:function(){},onDblClick:function(){},onMouseMove:function(b,a){var c=i.Tooltip.getTooltip(this._view);if(c&&!(c.isVisible()&&this._tooltipLineIndex===b)){this._tooltipLineIndex=
b;var d=this;c.setTarget({y:a.clientY,getTooltipInfo:function(){return d._getTooltipInfo(d._tooltipLineIndex,this.y)}})}},onMouseOver:function(b,a){this.onMouseMove(b,a)},onMouseOut:function(){var b=i.Tooltip.getTooltip(this._view);b&&b.setTarget(null)},_getTooltipInfo:function(b,a){if(b!==void 0){var c=this._view,d=c.getModel(),f=this._annotationModel,g=[];if(f){var g=d.getLineStart(b),h=d.getLineEnd(b);d.getBaseModel&&(g=d.mapOffset(g),h=d.mapOffset(h));g=this.getAnnotationsByType(f,g,h)}f=this._getTooltipContents(b,
g);if(!f)return null;f={contents:f,anchor:this.getLocation()};g=c.getClientArea();g.y=this.getOverview()==="document"?c.convert({y:a},"view","document").y:c.getLocationAtOffset(d.getLineStart(b)).y;c.convert(g,"document","page");f.x=g.x;f.y=g.y;f.anchor==="right"&&(f.x+=g.width);return f}},_getTooltipContents:function(b,a){return a},_onAnnotationModelChanged:function(b){function a(b){for(var e=0;e<b.length;e++)if(f.isAnnotationTypeVisible(b[e].type)){var g=b[e].start,h=b[e].end;d.getBaseModel&&(g=
d.mapOffset(g,!0),h=d.mapOffset(h,!0));g!==-1&&h!==-1&&c.redrawLines(d.getLineAtOffset(g),d.getLineAtOffset(Math.max(g,h-1))+1,f)}}var c=this._view;if(c){var d=c.getModel(),f=this,g=d.getLineCount();b.textModelChangedEvent?(b=b.textModelChangedEvent.start,d.getBaseModel&&(b=d.mapOffset(b,!0)),b=d.getLineAtOffset(b),c.redrawLines(b,g,f)):(a(b.added),a(b.removed),a(b.changed))}},_mergeAnnotation:function(b,a,c){b||(b={});if(c===0)if(b.html&&a.html){if(a.html!==b.html&&!b._multiple&&this._multiAnnotation)b.html=
this._multiAnnotation.html;b._multiple=!0}else b.html=a.html;b.style=this._mergeStyle(b.style,a.style);return b},_mergeStyle:function(b,a){if(a){b||(b={});b.styleClass&&a.styleClass&&b.styleClass!==a.styleClass?b.styleClass+=" "+a.styleClass:b.styleClass=a.styleClass;var c;if(a.style){if(!b.style)b.style={};for(c in a.style)b.style[c]||(b.style[c]=a.style[c])}if(a.attributes){if(!b.attributes)b.attributes={};for(c in a.attributes)b.attributes[c]||(b.attributes[c]=a.attributes[c])}}return b}};j.AnnotationTypeList.addMixin(g.prototype);
h.prototype=new g;h.prototype.getAnnotations=function(b,a){for(var c=g.prototype.getAnnotations.call(this,b,a),d=this._view.getModel(),f=b;f<a;f++){var h=f&1?this._oddStyle:this._evenStyle,l=f;d.getBaseModel&&(l=d.getLineStart(l),l=d.getBaseModel().getLineAtOffset(d.mapOffset(l)));c[f]||(c[f]={});c[f].html=l+1+"";if(!c[f].style)c[f].style=h}return c};h.prototype.getWidestAnnotation=function(){var b=this._view.getModel().getLineCount();return this.getAnnotations(b-1,b)[b-1]};h.prototype._onTextModelChanged=
function(b){var b=b.start,a=this._view.getModel(),c=((a.getBaseModel?a.getBaseModel().getLineCount():a.getLineCount())+"").length;if(this._numOfDigits!==c)this._numOfDigits=c,this._view.redrawLines(a.getLineAtOffset(b),a.getLineCount(),this)};d.prototype=new g;f.prototype=new g;f.prototype.getRulerStyle=function(){var b={style:{lineHeight:"1px",fontSize:"1px"}};return b=this._mergeStyle(b,this._rulerStyle)};f.prototype.onClick=function(b){b!==void 0&&this._view.setTopIndex(b)};f.prototype._getTooltipContents=
function(b,c){if(c.length===0){var d=this._view.getModel(),f=b;d.getBaseModel&&(f=d.getLineStart(f),f=d.getBaseModel().getLineAtOffset(d.mapOffset(f)));return a.formatMessage(k.line,f+1)}return g.prototype._getTooltipContents.call(this,b,c)};f.prototype._mergeAnnotation=function(b,a,c,d){if(c===0){if(!b)b={html:"&nbsp;",style:{style:{height:3*d+"px"}}},b.style=this._mergeStyle(b.style,a.overviewStyle);return b}};c.prototype=new d;c.prototype.onClick=function(b){if(b!==void 0){var a=this._annotationModel;
if(a){var c=this._view.getModel(),d=c.getLineStart(b),b=c.getLineEnd(b,!0);c.getBaseModel&&(d=c.mapOffset(d),b=c.mapOffset(b),c=c.getBaseModel());for(var f,a=a.getAnnotations(d,b);!f&&a.hasNext();)b=a.next(),this.isAnnotationTypeVisible(b.type)&&(f=b);f&&c.getLineAtOffset(f.start)===c.getLineAtOffset(d)&&((c=i.Tooltip.getTooltip(this._view))&&c.setTarget(null),f.expanded?f.collapse():f.expand(),this._annotationModel.modifyAnnotation(f))}}};c.prototype._getTooltipContents=function(b,a){return a.length===
1&&a[0].expanded?null:d.prototype._getTooltipContents.call(this,b,a)};c.prototype._onAnnotationModelChanged=function(b){function a(b){for(h=0;h<b.length;h++)if(g.isAnnotationTypeVisible(b[h].type)){var c=b[h].start;f.getBaseModel&&(c=f.mapOffset(c,!0));c!==-1&&(i=Math.min(i,f.getLineAtOffset(c)))}}if(b.textModelChangedEvent)d.prototype._onAnnotationModelChanged.call(this,b);else{var c=this._view;if(c){var f=c.getModel(),g=this,h,l=f.getLineCount(),i=l;a(b.added);a(b.removed);a(b.changed);b=c.getRulers();
for(h=0;h<b.length;h++)c.redrawLines(i,l,b[h])}}};return{Ruler:g,AnnotationRuler:d,LineNumberRuler:h,OverviewRuler:f,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(k,j,i,a,g,h,d,f,c){function b(){}function e(){}function m(){}function n(){}function r(){}function q(b,a,c){this.editor=b;this.textView=b.getTextView();this.undoStack=a;this._incrementalFindActive=!1;this._incrementalFindSuccess=!0;this._incrementalFindIgnoreSelection=
!1;this._incrementalFindPrefix="";this._searcher=c;this._lastEditLocation=null;this.init()}function l(b,a,c,e){this.editor=b;this.textView=b.getTextView();this.undoStack=a;this.contentAssist=c;this.linkedMode=e;this.contentAssist&&this.contentAssist.addEventListener("ProposalApplied",this.contentAssistProposalApplied.bind(this));this.init()}function p(b){this.editor=b;this.textView=b.getTextView();this.linkedModeActive=!1;this.linkedModePositions=[];this.linkedModeEscapePosition=this.linkedModeCurrentPositionIndex=
0;this.linkedModeListener={onVerify:function(b){for(var a=!1,c=0,e=0;e<this.linkedModePositions.length;++e){var d=this.linkedModePositions[e];if(a)d.offset+=c;else if(b.start>=d.offset&&b.end<=d.offset+d.length)a=d.length,d.length=b.start-d.offset+b.text.length+(d.offset+d.length-b.end),c=d.length-a,a=!0}a?this.linkedModeEscapePosition+=c:this.cancel()}.bind(this)}}b.prototype={createUndoStack:function(b){var b=b.getTextView(),a=new j.UndoStack(b,200);b.setAction("undo",function(){a.undo();return!0},
{name:k.undo});b.setAction("redo",function(){a.redo();return!0},{name:k.redo});return a}};e.prototype={createLineNumberRuler:function(b){return new a.LineNumberRuler(b,"left",{styleClass:"ruler lines"},{styleClass:"rulerLines odd"},{styleClass:"rulerLines even"})}};m.prototype={createFoldingRuler:function(b){return new a.FoldingRuler(b,"left",{styleClass:"ruler folding"})}};n.prototype={createAnnotationModel:function(b){return new g.AnnotationModel(b)},createAnnotationStyler:function(b,a){return new g.AnnotationStyler(b,
a)},createAnnotationRulers:function(b){var c=new a.AnnotationRuler(b,"left",{styleClass:"ruler annotations"}),b=new a.OverviewRuler(b,"right",{styleClass:"ruler overview"});return{annotationRuler:c,overviewRuler:b}}};r.prototype={createTextDND:function(b,a){return new d.TextDND(b.getTextView(),a)}};q.prototype={init:function(){var b=this;this._incrementalFindListener={onVerify:function(a){var e=b.editor,d=e.getModel(),g=e.mapOffset(a.start),h=e.mapOffset(a.end),g=d.getText(g,h),d=b._incrementalFindPrefix;
if((d=d.match(RegExp("^"+f.escape(g),"i")))&&d.length>0)d=b._incrementalFindPrefix+=a.text,b.editor.reportStatus(c.formatMessage(k.incrementalFind,d)),g=e.getSelection().start,(g=e.getModel().find({string:d,start:g,caseInsensitive:d.toLowerCase()===d}).next())?(b._incrementalFindSuccess=!0,b._incrementalFindIgnoreSelection=!0,e.moveSelection(g.start,g.end),b._incrementalFindIgnoreSelection=!1):(e.reportStatus(c.formatMessage(k.incrementalFindNotFound,d),"error"),b._incrementalFindSuccess=!1),a.text=
null},onSelection:function(){b._incrementalFindIgnoreSelection||b.toggleIncrementalFind()}};this._lastEditListener={onModelChanged:function(a){if(b.editor.isDirty())b._lastEditLocation=a.start+a.addedCharCount}};this.textView.addEventListener("ModelChanged",this._lastEditListener.onModelChanged);this.textView.setKeyBinding(new i.KeyBinding("k",!0),"findNext");this.textView.setAction("findNext",function(){if(this._searcher){var b=this.textView.getSelection();b.start<b.end?this._searcher.findNext(!0,
this.textView.getText(b.start,b.end)):this._searcher.findNext(!0);return!0}return!1}.bind(this),{name:k.findNext});this.textView.setKeyBinding(new i.KeyBinding("k",!0,!0),"findPrevious");this.textView.setAction("findPrevious",function(){if(this._searcher){var b=this.textView.getSelection();b.start<b.end?this._searcher.findNext(!1,this.textView.getText(b.start,b.end)):this._searcher.findNext(!1);return!0}return!1}.bind(this),{name:k.findPrevious});this.textView.setKeyBinding(new i.KeyBinding("j",!0),
"incrementalFind");this.textView.setAction("incrementalFind",function(){if(this._searcher&&this._searcher.visible())return!0;var b=this.editor;if(this._incrementalFindActive){var a=this._incrementalFindPrefix;if(a.length!==0){var e;e=0;this._incrementalFindSuccess&&(e=b.getSelection().start+1);(e=b.getModel().find({string:a,start:e,caseInsensitive:a.toLowerCase()===a}).next())?(this._incrementalFindIgnoreSelection=this._incrementalFindSuccess=!0,b.moveSelection(e.start,e.end),this._incrementalFindIgnoreSelection=
!1,b.reportStatus(c.formatMessage(k.incrementalFind,a))):(b.reportStatus(c.formatMessage(k.incrementalFindNotFound,a),"error"),this._incrementalFindSuccess=!1)}}else b.setCaretOffset(b.getCaretOffset()),this.toggleIncrementalFind();return!0}.bind(this),{name:k.incrementalFindKey});this.textView.setAction("deletePrevious",function(){if(this._incrementalFindActive){var b=this.editor,a=this._incrementalFindPrefix,a=this._incrementalFindPrefix=a.substring(0,a.length-1);if(a.length===0)return this._incrementalFindIgnoreSelection=
this._incrementalFindSuccess=!0,b.setCaretOffset(b.getSelection().start),this._incrementalFindIgnoreSelection=!1,this.toggleIncrementalFind(),!0;b.reportStatus(c.formatMessage(k.incrementalFind,a));var e=b.getModel().find({string:a,start:b.getCaretOffset()-a.length-1,reverse:!0,caseInsensitive:a.toLowerCase()===a}).next();e?(this._incrementalFindIgnoreSelection=this._incrementalFindSuccess=!0,b.moveSelection(e.start,e.end),this._incrementalFindIgnoreSelection=!1):b.reportStatus(c.formatMessage(k.incrementalFindNotFound,
a),"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 b=this.editor,a=b.getModel(),c=b.getSelection(),e=a.getLineAtOffset(c.start),d=a.getLineAtOffset(c.end>c.start?c.end-1:c.end);if(e!==d){var f=[];f.push("");for(var g=e;g<=d;g++)f.push(a.getLine(g,!0));var g=a.getLineStart(e),a=a.getLineEnd(d,!0),h=this.textView.getOptions("tabSize","expandTab"),h=h.expandTab?Array(h.tabSize+
1).join(" "):"\t";b.setText(f.join(h),g,a);b.setSelection(g===c.start?c.start:c.start+h.length,c.end+(d-e+1)*h.length);return!0}b=b.getKeyModes();for(c=0;c<b.length;c++)if(b[c].isActive())return b[c].tab();return!1}}.bind(this));this.textView.setAction("shiftTab",function(){if(this.textView.getOptions("readonly"))return!1;if(this.textView.getOptions("tabMode")){for(var b=this.editor,a=b.getModel(),c=b.getSelection(),e=a.getLineAtOffset(c.start),d=a.getLineAtOffset(c.end>c.start?c.end-1:c.end),f=this.textView.getOptions("tabSize"),
g=Array(f+1).join(" "),h=[],m=0,n=0,l=e;l<=d;l++){var i=a.getLine(l,!0);if(a.getLineStart(l)!==a.getLineEnd(l))if(i.indexOf("\t")===0)i=i.substring(1),m++;else if(i.indexOf(g)===0)i=i.substring(f),m+=f;else return!0;l===e&&(n=m);h.push(i)}e=a.getLineStart(e);f=a.getLineEnd(d,!0);a=a.getLineStart(d);b.setText(h.join(""),e,f);h=e===c.start?c.start:c.start-n;c=Math.max(h,c.end-m+(c.end===a+1&&c.start!==c.end?1:0));b.setSelection(h,c);return!0}}.bind(this),{name:k.unindentLines});this.textView.setKeyBinding(new i.KeyBinding(38,
!1,!1,!0),"moveLinesUp");this.textView.setAction("moveLinesUp",function(){if(this.textView.getOptions("readonly"))return!1;var b=this.editor,a=b.getModel(),c=b.getSelection(),e=a.getLineAtOffset(c.start);if(e===0)return!0;var d=a.getLineAtOffset(c.end>c.start?c.end-1:c.end),f=a.getLineCount(),c=a.getLineStart(e-1),g=a.getLineStart(e),h=a.getLineEnd(d,!0),m=a.getText(g,h),n=0;d===f-1&&(d=a.getLineEnd(e-1),e=a.getLineEnd(e-1,!0),m+=a.getText(d,e),g=d,n=e-d);this.startUndo();b.setText("",g,h);b.setText(m,
c,c);b.setSelection(c,c+m.length-n);this.endUndo();return!0}.bind(this),{name:k.moveLinesUp});this.textView.setKeyBinding(new i.KeyBinding(40,!1,!1,!0),"moveLinesDown");this.textView.setAction("moveLinesDown",function(){if(this.textView.getOptions("readonly"))return!1;var b=this.editor,a=b.getModel(),c=b.getSelection(),e=a.getLineAtOffset(c.start),d=a.getLineAtOffset(c.end>c.start?c.end-1:c.end),f=a.getLineCount();if(d===f-1)return!0;var e=a.getLineStart(e),c=a.getLineEnd(d,!0),g=a.getLineEnd(d+1,
!0)-(c-e),h=0;d!==f-2?a=a.getText(e,c):(d=a.getLineEnd(d),a=a.getText(d,c)+a.getText(e,d),h+=c-d);this.startUndo();b.setText("",e,c);b.setText(a,g,g);b.setSelection(g+h,g+h+a.length);this.endUndo();return!0}.bind(this),{name:k.moveLinesDown});this.textView.setKeyBinding(new i.KeyBinding(38,!0,!1,!0),"copyLinesUp");this.textView.setAction("copyLinesUp",function(){if(this.textView.getOptions("readonly"))return!1;var b=this.editor,a=b.getModel(),c=b.getSelection(),e=a.getLineAtOffset(c.start),c=a.getLineAtOffset(c.end>
c.start?c.end-1:c.end),e=a.getLineStart(e),d=a.getLineEnd(c,!0),f=a.getLineCount(),g="",d=a.getText(e,d);c===f-1&&(d+=g=a.getLineDelimiter());b.setText(d,e,e);b.setSelection(e,e+d.length-g.length);return!0}.bind(this),{name:k.copyLinesUp});this.textView.setKeyBinding(new i.KeyBinding(40,!0,!1,!0),"copyLinesDown");this.textView.setAction("copyLinesDown",function(){if(this.textView.getOptions("readonly"))return!1;var b=this.editor,a=b.getModel(),c=b.getSelection(),e=a.getLineAtOffset(c.start),c=a.getLineAtOffset(c.end>
c.start?c.end-1:c.end),d=a.getLineStart(e),e=a.getLineEnd(c,!0),f=a.getLineCount(),g="",d=a.getText(d,e);c===f-1&&(d=(g=a.getLineDelimiter())+d);b.setText(d,e,e);b.setSelection(e+g.length,e+d.length);return!0}.bind(this),{name:k.copyLinesDown});this.textView.setKeyBinding(new i.KeyBinding("d",!0,!1,!1),"deleteLines");this.textView.setAction("deleteLines",function(){if(this.textView.getOptions("readonly"))return!1;var b=this.editor,a=b.getSelection(),c=b.getModel(),e=c.getLineAtOffset(a.start),a=c.getLineAtOffset(a.end>
a.start?a.end-1:a.end),e=c.getLineStart(e),c=c.getLineEnd(a,!0);b.setText("",e,c);return!0}.bind(this),{name:k.deleteLines});this.textView.setKeyBinding(new i.KeyBinding("l",!0),"gotoLine");this.textView.setAction("gotoLine",function(){var b=this.editor,a=b.getModel().getLineAtOffset(b.getCaretOffset());if(a=prompt(k.gotoLinePrompty,a+1))a=parseInt(a,10),b.onGotoLine(a-1,0);return!0}.bind(this),{name:k.gotoLine});this.textView.setKeyBinding(new i.KeyBinding(190,!0),"nextAnnotation");this.textView.setAction("nextAnnotation",
function(){var b=this.editor,a=b.getAnnotationModel();if(!a)return!0;for(var c=b.getModel(),e=b.getCaretOffset(),a=a.getAnnotations(e,c.getCharCount());a.hasNext();){var d=a.next();if(!(d.start<=e)&&!(d.type!==g.AnnotationType.ANNOTATION_ERROR&&d.type!==g.AnnotationType.ANNOTATION_WARNING&&d.type!==g.AnnotationType.ANNOTATION_TASK&&d.type!==g.AnnotationType.ANNOTATION_BOOKMARK)){var f=h.Tooltip.getTooltip(this.textView);if(!f){b.moveSelection(d.start);break}var m=c.getLineAtOffset(d.start),n=this.textView;
b.moveSelection(d.start,d.start,function(){setTimeout(function(){f.setTarget({getTooltipInfo:function(){var b=n.convert({x:n.getLocationAtOffset(d.start).x,y:n.getLocationAtOffset(c.getLineStart(m)).y},"document","page");return{contents:[d],x:b.x,y:b.y+Math.floor(n.getLineHeight(m)*1.33)}}},0)},0)});break}}return!0}.bind(this),{name:k.nextAnnotation});this.textView.setKeyBinding(new i.KeyBinding(188,!0),"previousAnnotation");this.textView.setAction("previousAnnotation",function(){var b=this.editor,
a=b.getAnnotationModel();if(!a)return!0;for(var c=b.getModel(),e=b.getCaretOffset(),a=a.getAnnotations(0,e),d=null;a.hasNext();){var f=a.next();f.start>=e||f.type!==g.AnnotationType.ANNOTATION_ERROR&&f.type!==g.AnnotationType.ANNOTATION_WARNING&&f.type!==g.AnnotationType.ANNOTATION_TASK&&f.type!==g.AnnotationType.ANNOTATION_BOOKMARK||(d=f)}if(d){var m=c.getLineAtOffset(d.start),n=h.Tooltip.getTooltip(this.textView);if(!n)return b.moveSelection(d.start),!0;var l=this.textView;b.moveSelection(d.start,
d.start,function(){setTimeout(function(){n.setTarget({getTooltipInfo:function(){var b=l.convert({x:l.getLocationAtOffset(d.start).x,y:l.getLocationAtOffset(c.getLineStart(m)).y},"document","page");return{contents:[d],x:b.x,y:b.y+Math.floor(l.getLineHeight(m)*1.33)}}},0)},0)})}return!0}.bind(this),{name:k.prevAnnotation});this.textView.setKeyBinding(new i.KeyBinding("e",!0,!1,!0,!1),"expand");this.textView.setAction("expand",function(){var b=this.editor,a=b.getAnnotationModel();if(!a)return!0;var c=
b.getModel(),b=b.getCaretOffset(),e=c.getLineAtOffset(b),b=c.getLineStart(e),e=c.getLineEnd(e,!0);c.getBaseModel&&(b=c.mapOffset(b),e=c.mapOffset(e),c.getBaseModel());for(var d,c=a.getAnnotations(b,e);!d&&c.hasNext();)b=c.next(),b.type===g.AnnotationType.ANNOTATION_FOLDING&&(b.expanded||(d=b));d&&!d.expanded&&(d.expand(),a.modifyAnnotation(d));return!0}.bind(this),{name:k.expand});this.textView.setKeyBinding(new i.KeyBinding("c",!0,!1,!0,!1),"collapse");this.textView.setAction("collapse",function(){var b=
this.editor,a=b.getAnnotationModel();if(!a)return!0;var c=b.getModel(),e=b.getCaretOffset(),d=c.getLineAtOffset(e),e=c.getLineStart(d),d=c.getLineEnd(d,!0);c.getBaseModel&&(e=c.mapOffset(e),d=c.mapOffset(d),c.getBaseModel());for(var f,c=a.getAnnotations(e,d);!f&&c.hasNext();)e=c.next(),e.type===g.AnnotationType.ANNOTATION_FOLDING&&(f=e);f&&f.expanded&&(b.setCaretOffset(f.start),f.collapse(),a.modifyAnnotation(f));return!0}.bind(this),{name:k.collapse});this.textView.setKeyBinding(new i.KeyBinding("e",
!0,!0,!0,!1),"expandAll");this.textView.setAction("expandAll",function(){var b=this.editor,a=b.getAnnotationModel();if(!a)return!0;var b=b.getModel(),c=a.getAnnotations(0,b.getCharCount());for(this.textView.setRedraw(!1);c.hasNext();)b=c.next(),b.type===g.AnnotationType.ANNOTATION_FOLDING&&!b.expanded&&(b.expand(),a.modifyAnnotation(b));this.textView.setRedraw(!0);return!0}.bind(this),{name:k.expandAll});this.textView.setKeyBinding(new i.KeyBinding("c",!0,!0,!0,!1),"collapseAll");this.textView.setAction("collapseAll",
function(){var b=this.editor,a=b.getAnnotationModel();if(!a)return!0;var b=b.getModel(),c=a.getAnnotations(0,b.getCharCount());for(this.textView.setRedraw(!1);c.hasNext();)b=c.next(),b.type===g.AnnotationType.ANNOTATION_FOLDING&&b.expanded&&(b.collapse(),a.modifyAnnotation(b));this.textView.setRedraw(!0);return!0}.bind(this),{name:k.collapseAll});this.textView.setKeyBinding(new i.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:k.lastEdit})},toggleIncrementalFind:function(){(this._incrementalFindActive=!this._incrementalFindActive)?(this.editor.reportStatus(c.formatMessage(k.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 b=this._incrementalFindPrefix;if(b.length===0)return!1;var a=this.editor,e=a.getModel(),e=this._incrementalFindSuccess?a.getCaretOffset()-b.length-1:e.getCharCount()-1;(e=a.getModel().find({string:b,start:e,reverse:!0,caseInsensitive:b.toLowerCase()===b}).next())?(this._incrementalFindIgnoreSelection=this._incrementalFindSuccess=!0,a.moveSelection(e.start,e.end),this._incrementalFindIgnoreSelection=!1,a.reportStatus(c.formatMessage(k.incrementalFind,
b))):(a.reportStatus(c.formatMessage(k.incrementalFindNotFound,b),"error"),this._incrementalFindSuccess=!1);return!0}return!1},lineDown:function(){if(this._incrementalFindActive){var b=this._incrementalFindPrefix;if(b.length===0)return!1;var a=this.editor,e=0;this._incrementalFindSuccess&&(e=a.getSelection().start+1);(e=a.getModel().find({string:b,start:e,caseInsensitive:b.toLowerCase()===b}).next())?(this._incrementalFindIgnoreSelection=this._incrementalFindSuccess=!0,a.moveSelection(e.start,e.end),
this._incrementalFindIgnoreSelection=!1,a.reportStatus(c.formatMessage(k.incrementalFind,b))):(a.reportStatus(c.formatMessage(k.incrementalFindNotFound,b),"error"),this._incrementalFindSuccess=!1);return!0}return!1},enter:function(){return!1}};l.prototype={startUndo:function(){this.undoStack&&this.undoStack.startCompoundChange()},endUndo:function(){this.undoStack&&this.undoStack.endCompoundChange()},init:function(){function b(a,c,e){var d=a.getLineAtOffset(c),f=a.getLineAtOffset(e),g,h,m,n,l,i;for(g=
d;g>=0;g--)if(h=a.getLine(g),m=g===d?c-a.getLineStart(d):h.length,n=h.lastIndexOf("/*",m),h=h.lastIndexOf("*/",m),h>n)break;else if(n!==-1){l=a.getLineStart(g)+n;break}for(g=f;g<a.getLineCount();g++)if(h=a.getLine(g),m=g===f?e-a.getLineStart(f):0,n=h.indexOf("/*",m),h=h.indexOf("*/",m),n!==-1&&n<h)break;else if(h!==-1){i=a.getLineStart(g)+h;break}return{commentStart:l,commentEnd:i}}this.textView.setAction("lineStart",function(){for(var b=this.editor,a=b.getModel(),c=b.getCaretOffset(),e=a.getLineAtOffset(c),
d=a.getLineStart(e),a=a.getLine(e),e=0;e<a.length;e++){var f=a.charCodeAt(e);if(!(f===32||f===9))break}e+=d;return c!==e?(b.setSelection(e,e),!0):!1}.bind(this));this.textView.setKeyBinding(new i.KeyBinding(191,!0),"toggleLineComment");this.textView.setAction("toggleLineComment",function(){if(this.textView.getOptions("readonly"))return!1;for(var b=this.editor,a=b.getModel(),c=b.getSelection(),e=a.getLineAtOffset(c.start),d=a.getLineAtOffset(c.end>c.start?c.end-1:c.end),f=!0,g=[],h,m,n=e;n<=d;n++)if(h=
a.getLine(n,!0),g.push(h),!f||(m=h.indexOf("//"))===-1)f=!1;else if(m!==0){var l;for(l=0;l<m;l++)if(f=h.charCodeAt(l),!(f===32||f===9))break;f=l===m}n=a.getLineStart(e);l=a.getLineEnd(d,!0);if(f){for(f=0;f<g.length;f++)h=g[f],m=h.indexOf("//"),g[f]=h.substring(0,m)+h.substring(m+2);g=g.join("");h=a.getLineStart(d);a=n===c.start?c.start:c.start-2;c=c.end-2*(d-e+1)+(c.end===h+1?2:0)}else g.splice(0,0,""),g=g.join("//"),a=n===c.start?c.start:c.start+2,c=c.end+2*(d-e+1);b.setText(g,n,l);b.setSelection(a,
c);return!0}.bind(this),{name:k.toggleLineComment});this.textView.setKeyBinding(new i.KeyBinding(191,!0,!c.isMac,!1,c.isMac),"addBlockComment");this.textView.setAction("addBlockComment",function(){if(this.textView.getOptions("readonly"))return!1;var a=this.editor,c=a.getModel(),e=a.getSelection(),d=RegExp("/\\*|\\*/","g"),f=b(c,e.start,e.end);if(f.commentStart!==void 0&&f.commentEnd!==void 0)return!0;c=c.getText(e.start,e.end);if(c.length===0)return!0;f=c.length;c=c.replace(d,"");d=c.length;a.setText("/*"+
c+"*/",e.start,e.end);a.setSelection(e.start+2,e.end+2+(d-f));return!0}.bind(this),{name:k.addBlockComment});this.textView.setKeyBinding(new i.KeyBinding(220,!0,!c.isMac,!1,c.isMac),"removeBlockComment");this.textView.setAction("removeBlockComment",function(){if(this.textView.getOptions("readonly"))return!1;var a=this.editor,c=a.getModel(),e=a.getSelection(),d=c.getText(e.start,e.end),f,g,h;for(h=0;h<d.length;h++)if(d.substring(h,h+2)==="/*"){f=e.start+h;break}for(;h<d.length;h++)if(d.substring(h,
h+2)==="*/"){g=e.start+h;break}if(f!==void 0&&g!==void 0)a.setText(c.getText(f+2,g),f,g+2),a.setSelection(f,g);else{d=b(c,e.start,e.end);if(d.commentStart===void 0||d.commentEnd===void 0)return!0;c=c.getText(d.commentStart+2,d.commentEnd);a.setText(c,d.commentStart,d.commentEnd+2);a.setSelection(e.start-2,e.end-2)}return!0}.bind(this),{name:k.removeBlockComment})},contentAssistProposalApplied:function(b){b=b.data.proposal;if(b.positions&&this.linkedMode){for(var a=[],c=0;c<b.positions.length;++c)a[c]=
{positions:[{offset:b.positions[c].offset,length:b.positions[c].length}]};this.linkedMode.enterLinkedMode({groups:a,escapePosition:b.escapePosition})}else b.escapePosition&&this.textView.setCaretOffset(b.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 b=this.editor,a=b.getSelection();if(a.start===a.end){for(var c=
b.getModel(),e=c.getLineAtOffset(a.start),d=c.getLine(e,!0),f=c.getLineStart(e),e=0,f=a.start-f,g;e<f&&((g=d.charCodeAt(e))===32||g===9);)e++;if(e>0){for(var h=d.substring(0,e),e=f;e<d.length&&((g=d.charCodeAt(e++))===32||g===9);)a.end++;b.setText(c.getLineDelimiter()+h,a.start,a.end);return!0}}return!1},tab:function(){return!1}};p.prototype={enterLinkedMode:function(b){if(!this.linkedModeActive){this.linkedModeActive=!0;this.linkedModePositions=[];for(var a=0;a<b.groups.length;++a){var c=b.groups[a];
this.linkedModePositions[a]={offset:c.positions[0].offset,length:c.positions[0].length}}this.linkedModeEscapePosition=b.escapePosition;this.linkedModeCurrentPositionIndex=0;this.selectTextForLinkedModePosition(this.linkedModePositions[this.linkedModeCurrentPositionIndex]);this.textView.addEventListener("Verify",this.linkedModeListener.onVerify);this.textView.setKeyBinding(new i.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 i.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(k.linkedModeEntered,null,!0)}},isActive:function(){return this.linkedModeActive},isStatusActive:function(){return this.linkedModeActive},enter:function(){this.cancel();return!0},cancel:function(b){if(this.linkedModeActive)this.linkedModeActive=!1,this.textView.removeEventListener("Verify",this.linkedModeListener.onVerify),this.textView.setKeyBinding(new i.KeyBinding(9),"tab"),this.textView.setKeyBinding(new i.KeyBinding(9,!1,!0),"shiftTab"),b||this.textView.setCaretOffset(this.linkedModeEscapePosition,
!1),this.editor.reportStatus(k.linkedModeExited,null,!0)},lineUp:function(){this.cancel(!0);return!1},lineDown:function(){this.cancel(!0);return!1},selectTextForLinkedModePosition:function(b){this.textView.setSelection(b.offset,b.offset+b.length)}};return{UndoFactory:b,LineNumberRulerFactory:e,FoldingRulerFactory:m,AnnotationFactory:n,TextDNDFactory:r,TextActions:q,SourceCodeActions:l,LinkedMode:p}});
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(k,j,i,a,g,h){function d(b){this._textViewFactory=b.textViewFactory;this._undoStackFactory=b.undoStackFactory;this._textDNDFactory=b.textDNDFactory;this._annotationFactory=b.annotationFactory;this._foldingRulerFactory=b.foldingRulerFactory;this._lineNumberRulerFactory=b.lineNumberRulerFactory;this._contentAssistFactory=
b.contentAssistFactory;this._keyBindingFactory=b.keyBindingFactory;this._statusReporter=b.statusReporter;this._domNode=b.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 f(b){var a=this,c=Array.prototype.slice.call(arguments,1);return c.length?function(){return arguments.length?a.apply(b,c.concat(Array.prototype.slice.call(arguments))):
a.apply(b,c)}:function(){return arguments.length?a.apply(b,arguments):a.call(b)}}var c;d.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 b=this._textView.getModel();b.getBaseModel&&(b=b.getBaseModel());return b},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(b){if(this._annotationRulerVisible!==b&&(this._annotationRulerVisible=b,this._annotationRuler)){var a=this._textView;b?a.addRuler(this._annotationRuler,0):a.removeRuler(this._annotationRuler)}},setFoldingRulerVisible:function(b){if(this._foldingRulerVisible!==b&&(this._foldingRulerVisible=b,this._foldingRuler)){var a=this._textView;a.getModel().getBaseModel&&(b?a.addRuler(this._foldingRuler,100):a.removeRuler(this._foldingRuler))}},setDirty:function(b){if(this._dirty!==
b)this._dirty=b,this.onDirtyChanged({type:"DirtyChanged"})},setLineNumberRulerVisible:function(b){if(this._lineNumberRulerVisible!==b&&(this._lineNumberRulerVisible=b,this._lineNumberRuler)){var a=this._textView;b?a.addRuler(this._lineNumberRuler,1):a.removeRuler(this._lineNumberRuler)}},setOverviewRulerVisible:function(b){if(this._overviewRulerVisible!==b&&(this._overviewRulerVisible=b,this._overviewRuler)){var a=this._textView;b?a.addRuler(this._overviewRuler):a.removeRuler(this._overviewRuler)}},
mapOffset:function(b,a){var c=this._textView.getModel();c.getBaseModel&&(b=c.mapOffset(b,a));return b},getCaretOffset:function(){return this.mapOffset(this._textView.getCaretOffset())},getSelection:function(){var b=this._textView,a=b.getSelection(),b=b.getModel();if(b.getBaseModel)a.start=b.mapOffset(a.start),a.end=b.mapOffset(a.end);return a},getText:function(b,a){var c=this._textView.getModel();c.getBaseModel&&(c=c.getBaseModel());return c.getText(b,a)},_expandOffset:function(b){var a=this._textView.getModel(),
c=this._annotationModel;if(c&&a.getBaseModel)for(b=c.getAnnotations(b,b+1);b.hasNext();)a=b.next(),a.type===g.AnnotationType.ANNOTATION_FOLDING&&a.expand&&(a.expand(),c.modifyAnnotation(a))},setCaretOffset:function(b){var a=this._textView,c=a.getModel();c.getBaseModel&&(this._expandOffset(b),b=c.mapOffset(b,!0));a.setCaretOffset(b)},setText:function(b,a,c){var d=this._textView,f=d.getModel();f.getBaseModel&&(a!==void 0&&(this._expandOffset(a),a=f.mapOffset(a,!0)),c!==void 0&&(this._expandOffset(c),
c=f.mapOffset(c,!0)));d.setText(b,a,c)},setFoldingEnabled:function(b){this.setFoldingRulerVisible(b)},setSelection:function(b,a,c){var d=this._textView,f=d.getModel();f.getBaseModel&&(this._expandOffset(b),this._expandOffset(a),b=f.mapOffset(b,!0),a=f.mapOffset(a,!0));d.setSelection(b,a,c)},moveSelection:function(b,a,d,f){var g=this._textView;this.setSelection(b,a||b,!1);var a=g.getTopPixel(),h=g.getBottomPixel(),b=this.getModel().getLineAtOffset(b),b=g.getLinePixel(b);b<a||b>h?(h=Math.max(0,b-Math.floor((b<
a?3:1)*(h-a)/4)),(new c({node:g,duration:300,curve:[a,h],onAnimate:function(b){g.setTopPixel(Math.floor(b))},onEnd:function(){g.showSelection();(f===void 0||f)&&g.focus();d&&d()}})).play()):(g.showSelection(),(f===void 0||f)&&g.focus(),d&&d())},checkDirty:function(){this.setDirty(!this._undoStack.isClean())},reportStatus:function(b,a,c){this._statusReporter&&this._statusReporter(b,a,c)},_getTooltipInfo:function(b,a){var c=this._textView,d=this.getAnnotationModel();if(!d)return null;var f=this._annotationStyler;
if(!f)return null;var g=c.getOffsetAtLocation(b,a);if(g===-1)return null;g=this.mapOffset(g);f=f.getAnnotationsByType(d,g,g+1);d=[];for(g=0;g<f.length;g++)f[g].rangeStyle&&d.push(f[g]);if(d.length===0)return null;c=c.convert({x:b,y:a},"document","page");return{contents:d,anchor:"left",x:c.x+10,y:c.y+20}},_highlightCurrentLine:function(b,a){var c=this._annotationModel;if(c){var d=this._textView.getModel(),f=a?d.getLineAtOffset(a.start):-1,h=d.getLineAtOffset(b.start),l=b.start===b.end,i=!a||a.start===
a.end,j=d.getLineStart(h),k=d.getLineEnd(h);d.getBaseModel&&(j=d.mapOffset(j),k=d.mapOffset(k));d=this._currentLineAnnotation;if(!(f===h&&i&&l&&d&&d.start===j&&d.end===k)){var f=d?[d]:null,s;l&&(d=g.AnnotationType.createAnnotation(g.AnnotationType.ANNOTATION_CURRENT_LINE,j,k),s=[d]);this._currentLineAnnotation=d;c.replaceAnnotations(f,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 b=this._contentAssistFactory.createContentAssistMode(this);this._keyModes.push(b);this._contentAssist=b.getContentAssist()}var c=this,d=this._textView,f=this;this._listener={onModelChanged:function(){f.checkDirty()},onMouseOver:function(b){f._listener.onMouseMove(b)},onMouseMove:function(b){var c=a.Tooltip.getTooltip(d);c&&c.setTarget({x:b.x,y:b.y,getTooltipInfo:function(){return f._getTooltipInfo(this.x,this.y)}})},
onMouseOut:function(){var b=a.Tooltip.getTooltip(d);b&&b.setTarget(null)},onSelection:function(b){f._updateCursorStatus();f._highlightCurrentLine(b.newValue,b.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 j.KeyBinding(27),"cancelMode");d.setAction("cancelMode",function(){for(var b=!1,a=0;a<this._keyModes.length;a++)this._keyModes[a].isActive()&&(b=this._keyModes[a].cancel()||b);return b}.bind(this),{name:k.cancelMode});d.setAction("lineUp",function(){for(var b=0;b<this._keyModes.length;b++)if(this._keyModes[b].isActive())return this._keyModes[b].lineUp();return!1}.bind(this));d.setAction("lineDown",function(){for(var b=0;b<this._keyModes.length;b++)if(this._keyModes[b].isActive())return this._keyModes[b].lineDown();
return!1}.bind(this));d.setAction("enter",function(){for(var b=0;b<this._keyModes.length;b++)if(this._keyModes[b].isActive())return this._keyModes[b].enter();return!1}.bind(this));b=function(b){if(b!==void 0&&b!==-1){for(var a=this.getView().getModel(),d=this.getAnnotationModel(),f=c.mapOffset(a.getLineStart(b)),b=c.mapOffset(a.getLineEnd(b)),a=d.getAnnotations(f,b),h=null;a.hasNext();){var m=a.next();if(m.type===g.AnnotationType.ANNOTATION_BOOKMARK){h=m;break}}h?d.removeAnnotation(h):(h=g.AnnotationType.createAnnotation(g.AnnotationType.ANNOTATION_BOOKMARK,
f,b),h.title=void 0,d.addAnnotation(h))}};if(this._annotationFactory){var h=d.getModel();h.getBaseModel&&(h=h.getBaseModel());if(this._annotationModel=this._annotationFactory.createAnnotationModel(h))if(h=this._annotationStyler=this._annotationFactory.createAnnotationStyler(d,this._annotationModel))h.addAnnotationType(g.AnnotationType.ANNOTATION_CURRENT_SEARCH),h.addAnnotationType(g.AnnotationType.ANNOTATION_MATCHING_SEARCH),h.addAnnotationType(g.AnnotationType.ANNOTATION_ERROR),h.addAnnotationType(g.AnnotationType.ANNOTATION_WARNING),
h.addAnnotationType(g.AnnotationType.ANNOTATION_MATCHING_BRACKET),h.addAnnotationType(g.AnnotationType.ANNOTATION_CURRENT_BRACKET),h.addAnnotationType(g.AnnotationType.ANNOTATION_CURRENT_LINE),h.addAnnotationType(g.AnnotationType.ANNOTATION_READ_OCCURRENCE),h.addAnnotationType(g.AnnotationType.ANNOTATION_WRITE_OCCURRENCE),h.addAnnotationType("orion.annotation.highlightError");d.annotationModel=this._annotationModel;var h=this._annotationFactory.createAnnotationRulers(this._annotationModel),i=this._annotationRuler=
h.annotationRuler;if(i)i.onClick=function(b){if(b!==void 0&&b!==-1)for(var a=this.getView().getModel(),d=this.getAnnotationModel(),f=c.mapOffset(a.getLineStart(b)),b=c.mapOffset(a.getLineEnd(b)),b=d.getAnnotations(f,b);b.hasNext();)if(d=b.next(),this.isAnnotationTypeVisible(d.type)){b=c.getModel();c.onGotoLine(b.getLineAtOffset(f),d.start-f,d.end-f);break}},i.onDblClick=b,i.setMultiAnnotationOverlay({html:"<div class='annotationHTML overlay'></div>"}),i.addAnnotationType(g.AnnotationType.ANNOTATION_ERROR),
i.addAnnotationType(g.AnnotationType.ANNOTATION_WARNING),i.addAnnotationType(g.AnnotationType.ANNOTATION_TASK),i.addAnnotationType(g.AnnotationType.ANNOTATION_BOOKMARK);this.setAnnotationRulerVisible(!0);if(i=this._overviewRuler=h.overviewRuler)i.onClick=function(b){b!==void 0&&(b=d.getModel().getLineStart(b),c.moveSelection(c.mapOffset(b)))},i.addAnnotationType(g.AnnotationType.ANNOTATION_CURRENT_SEARCH),i.addAnnotationType(g.AnnotationType.ANNOTATION_MATCHING_SEARCH),i.addAnnotationType(g.AnnotationType.ANNOTATION_ERROR),
i.addAnnotationType(g.AnnotationType.ANNOTATION_WARNING),i.addAnnotationType(g.AnnotationType.ANNOTATION_TASK),i.addAnnotationType(g.AnnotationType.ANNOTATION_BOOKMARK),i.addAnnotationType(g.AnnotationType.ANNOTATION_MATCHING_BRACKET),i.addAnnotationType(g.AnnotationType.ANNOTATION_CURRENT_BRACKET),i.addAnnotationType(g.AnnotationType.ANNOTATION_CURRENT_LINE),i.addAnnotationType(g.AnnotationType.ANNOTATION_READ_OCCURRENCE),i.addAnnotationType(g.AnnotationType.ANNOTATION_WRITE_OCCURRENCE);this.setOverviewRulerVisible(!0)}if(this._lineNumberRulerFactory)this._lineNumberRuler=
this._lineNumberRulerFactory.createLineNumberRuler(this._annotationModel),this._lineNumberRuler.onDblClick=b,this.setLineNumberRulerVisible(!0);if(this._foldingRulerFactory)this._foldingRuler=this._foldingRulerFactory.createFoldingRuler(this._annotationModel),this._foldingRuler.addAnnotationType(g.AnnotationType.ANNOTATION_FOLDING),this.setFoldingRulerVisible(!1);this.dispatchEvent({type:"TextViewInstalled",textView:d})},uninstallTextView:function(){var b=this._textView;if(b)b.destroy(),this._textView=
this._undoStack=this._textDND=this._contentAssist=this._listener=this._annotationModel=this._annotationStyler=this._annotationRuler=this._overviewRuler=this._lineNumberRuler=this._foldingRuler=this._currentLineAnnotation=this._title=null,this._dirty=!1,this._keyModes=[],this.dispatchEvent({type:"TextViewUninstalled",textView:b})},_updateCursorStatus:function(){var b=this.getModel(),a=this.getCaretOffset(),c=b.getLineAtOffset(a),b=b.getLineStart(c);a-=b;for(b=0;b<this._keyModes.length;b++){var d=this._keyModes[b];
if(d.isActive()&&d.isStatusActive&&d.isStatusActive())return}this.reportStatus(h.formatMessage(k.lineColumn,c+1,a+1))},showProblems:function(b){var a=this._annotationModel;if(a){for(var c=[],d=[],f=a.getTextModel(),h=a.getAnnotations(0,f.getCharCount()),i;h.hasNext();)i=h.next(),(i.type===g.AnnotationType.ANNOTATION_ERROR||i.type===g.AnnotationType.ANNOTATION_WARNING)&&c.push(i);if(b)for(h=0;h<b.length;h++)if(i=b[h]){var j=i.description.replace(/'/g,"&#39;").replace(/"/g,"&#34;"),k=f.getLineStart(i.line-
1);i=g.AnnotationType.createAnnotation(i.severity==="error"?g.AnnotationType.ANNOTATION_ERROR:g.AnnotationType.ANNOTATION_WARNING,k+i.start-1,k+i.end,j);d.push(i)}a.replaceAnnotations(c,d)}},showOccurrences:function(b){var a=this._annotationModel;if(a){for(var c=[],d=[],f=a.getTextModel(),h=a.getAnnotations(0,f.getCharCount()),i;h.hasNext();)i=h.next(),(i.type===g.AnnotationType.ANNOTATION_READ_OCCURRENCE||i.type===g.AnnotationType.ANNOTATION_WRITE_OCCURRENCE)&&c.push(i);if(b)for(h=0;h<b.length;h++)if(i=
b[h]){var j=f.getLineStart(i.line-1);i=g.AnnotationType.createAnnotation(i.readAccess===!0?g.AnnotationType.ANNOTATION_READ_OCCURRENCE:g.AnnotationType.ANNOTATION_WRITE_OCCURRENCE,j+i.start-1,j+i.end,i.description);d.push(i)}a.replaceAnnotations(c,d)}},showSelection:function(b,a,c,d,f){typeof b==="number"?(typeof a!=="number"&&(a=b),this.moveSelection(b,a)):typeof c==="number"&&(b=this.getModel().getLineStart(c-1),typeof d==="number"&&(b+=d),typeof f!=="number"&&(f=0),this.moveSelection(b,b+f))},
setInput:function(b,a,c,d){this._title=b;this._textView&&(d?(this._undoStack.markClean(),this.checkDirty()):(a?this._textView.setText(a):c!==null&&c!==void 0&&(this._textView.setText(c),this._textView.getModel().setLineDelimiter("auto"),this._highlightCurrentLine(this._textView.getSelection())),this._undoStack.reset(),this.checkDirty(),this._textView.focus()));this.onInputChanged({type:"InputChanged",title:b,message:a,contents:c,contentsSaved:d})},onInputChanged:function(b){return this.dispatchEvent(b)},
onGotoLine:function(b,a,c){if(this._textView){var d=this.getModel(),f=d.getLineStart(b),g=0;c===void 0&&(c=0);typeof a==="string"?(b=d.getLine(b).indexOf(a),b!==-1&&(g=b,c=g+a.length)):(g=a,a=d.getLineEnd(b)-f,g=Math.min(g,a),c=Math.min(c,a));this.moveSelection(f+g,f+c)}},onDirtyChanged:function(b){return this.dispatchEvent(b)}};i.EventTarget.addMixin(d.prototype);c=function(){function b(b){this.options=b}b.prototype.play=function(){var b=typeof this.options.duration==="number"?this.options.duration:
350,a=this.options.easing||this.defaultEasing,c=this.options.onAnimate||function(){},d=this.options.onEnd||function(){},f=this.options.curve[0],g=this.options.curve[1]-f,h,i,j=-1;i=setInterval(function(){j=j===-1?(new Date).getTime():j;var k=((new Date).getTime()-j)/b;k<1?(k=a(k),h=f+k*g,c(h)):(clearInterval(i),d())},typeof this.options.rate==="number"?this.options.rate:20)};b.prototype.defaultEasing=function(b){return Math.sin(b*(Math.PI/2))};return b}();if(!Function.prototype.bind)Function.prototype.bind=
f;return{Editor:d,util:{bind:f}}});
define("orion/contentTypes",[],function(){function k(a,d){function f(b,a,c,e){var c=a.filename.indexOf(c)>=0,d=a.extension.indexOf(e)>=0;if(c||d)if(!b||c&&b.extension.indexOf(e)>=0)return a;return b}for(var c=a&&a.split(".").pop(),b=null,e=0;e<d.length;e++){var g=d[e];f(b,g,a,c)===g&&(b=g)}return b}function j(h){this.serviceRegistry=h;this.map=function(d){function f(b){return b===null||typeof b==="undefined"?[]:b instanceof Array?b:[b]}for(var d=d.getServiceReferences(a).concat(d.getServiceReferences(g)),c=
{},b=0;b<d.length;b++)for(var e=f(d[b].getProperty("contentTypes")),h=0;h<e.length;h++){var i=e[h];c[i.id]||(c[i.id]={id:i.id,name:i.name,image:i.image,"extends":i["extends"],extension:f(i.extension),filename:f(i.filename)})}return c}(h);h.registerService(i,this)}var i="orion.core.contenttypes",a="orion.core.contenttype",g="orion.file.contenttype";j.prototype={getContentTypes:function(){var a=this.getContentTypesMap(),d=[],f;for(f in a)a.hasOwnProperty(f)&&d.push(a[f]);return d},getContentTypesMap:function(){return this.map},
getFileContentType:function(a){return k(a.Name,this.getContentTypes())},getFilenameContentType:function(a){return k(a,this.getContentTypes())},getContentType:function(a){return this.map[a]||null},isExtensionOf:function(a,d){a=typeof a==="string"?this.getContentType(a):a;d=typeof d==="string"?this.getContentType(d):d;if(!a||!d)return!1;if(a.id===d.id)return!0;else for(var f=a,c={};f&&(f=this.getContentType(f["extends"]));){if(f.id===d.id)return!0;if(c[f.id])throw Error("Cycle: "+f.id);c[f.id]=!0}return!1},
isSomeExtensionOf:function(a,d){for(var f=0;f<d.length;f++)if(this.isExtensionOf(a,d[f]))return!0;return!1}};return{ContentTypeService:j,getFilenameContentType:k}});
define("orion/PageUtil",[],function(){var k=/^http[s]?/i;return{matchResourceParameters:function(j){var j=j||window.location.toString(),i={resource:""},a=j.indexOf("#");if(a!==-1&&(j=j.substring(a+1),j.length!==0)){j=j.split(",");Object.defineProperty(i,"resourceRaw",{value:j[0]});i.resource=decodeURIComponent(j[0]);for(a=1;a<j.length;a++){var g=/([^=]*)(=?)(.*)/.exec(j[a]),h=decodeURIComponent(g[1]||""),g=decodeURIComponent(g[3]||"");h!==""&&h!=="resource"&&(i[h]=g)}}return i},validateURLScheme:function(j,
i){var a=j;if(j.indexOf("://")===-1){var g=document.createElement("a");g.href=j;a=g.href}g=!1;return(g=i?i.some(function(g){return RegExp("^"+g+":","i").test(a)}):k.test(a))?j:(console.log("Illegal URL Scheme: '"+j+"'"),"")}}});
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(k,j,i,a,g,h,d,f){function c(b,a,c,e,d){this.commandService=b;this.handler=a;this.items=c;this.userData=e;this.command=d;if(d.parameters)this.parameters=d.parameters.makeCopy();this.id=d.id}function b(b){this._commandList={};this._contributionsByScopeId={};this._activeBindings={};this._urlBindings={};
this._init(b);this._parameterCollector=null}function e(b,a,c){a.classList.add("commandImage");var e;b.imageClass?(e=document.createElement("span"),a.appendChild(e),e.classList.add(b.spriteClass),e.classList.add(b.imageClass)):(e=new Image,e.alt=b.name,e.name=c,e.id=c,e.src=b.image,a.appendChild(e));return e}function m(b){this._init(b)}function n(b,a,c,e,d,f,h){this.keyCode=typeof b==="string"?b.toUpperCase().charCodeAt(0):b;this.mod1=a!==void 0&&a!==null?a:!1;this.mod2=c!==void 0&&c!==null?c:!1;this.mod3=
e!==void 0&&e!==null?e:!1;this.mod4=d!==void 0&&d!==null?d:!1;this.domScope=g.node(f);this.scopeName=h||(f?f.id:null)}function r(b,a){this.token=b;this.parameterName=a}function q(b,a,c,e,d){this.name=b;this.type=a;this.label=c;this.value=e;this.lines=d||1}function l(b,a,c){this._storeParameters(b);this._hasOptionalParameters=a&&a.hasOptionalParameters;this._options=a;this.optionsRequested=!1;this.getParameters=c;this.clientCollect=a&&a.clientCollect}var p=window.navigator.platform.indexOf("Mac")!==
-1;c.prototype={collectsParameters:function(){return this.commandService&&this.commandService.collectsParameters()},makeCopy:function(b){var a=new c(this.commandService,this.handler,this.items,this.userData,this.command);a.domNode=this.domNode;a.domParent=this.domParent;if(b)a.parameters=b.makeCopy();else if(this.parameters)a.parameters=this.parameters.makeCopy();return a}};c.prototype.constructor=c;b.prototype={_init:function(b){this._registry=b.serviceRegistry;this._serviceRegistration=this._registry.registerService("orion.page.command",
this);this._defaultSelectionService=b.selection;var a=this;window.document.addEventListener("keydown",function(b){b=b||window.event;if(function(b){if(p){if(b.metaKey&&!b.altKey)return!b.shiftKey&&!b.ctrlKey&&(b.keyCode===65||b.keyCode===67||b.keyCode===86||b.keyCode===88||b.keyCode===90)?!0:!1}else{if(b.ctrlKey&&!b.altKey)return!b.shiftKey&&(b.keyCode===65||b.keyCode===67||b.keyCode===86||b.keyCode===88||b.keyCode===90)?!0:!1;if(b.altKey&&!b.ctrlKey)return!1}if(b["char"])return b["char"].length>0;
else if(b.charCode||b.keyCode)switch(b=b.charCode||b.keyCode,b){case 8:case 9:case 13:case 46:return!0;default:return b>=32&&b<112||b>123}return!1}(b)){if(b.target.contentEditable==="true")return;var c=b.target.nodeName.toLowerCase();if(c==="input")switch(b.target.type.toLowerCase()){case "text":case "password":case "search":case "color":case "date":case "datetime":case "datetime-local":case "email":case "month":case "number":case "range":case "tel":case "time":case "url":case "week":return}else if(c===
"textarea")return}a._processKey(b)},!1)},_processKey:function(b){function a(b){window.document.all?b.keyCode=0:(b.preventDefault(),b.stopPropagation())}for(var c in this._activeBindings)if(this._activeBindings[c]&&this._activeBindings[c].keyBinding&&this._activeBindings[c].command&&this._activeBindings[c].keyBinding.match(b)){var e=this._activeBindings[c],d=e.invocation;if(d)if(e=e.command,e.hrefCallback){a(b);b=e.hrefCallback.call(d.handler||window,d);b.then?b.then(function(b){window.open(b)}):window.open(b);
break}else if(e.callback){a(b);var f=this;window.setTimeout(function(){f._invoke(d)},0);break}}},processURL:function(b){for(var a in this._urlBindings)if(this._urlBindings[a]&&this._urlBindings[a].urlBinding&&this._urlBindings[a].command){var c=this._urlBindings[a].urlBinding.match(b);if(c){var e=this._urlBindings[a],d=e.command,f=e.invocation;if(f&&f.parameters&&d.callback){f.parameters.setValue(c.parameterName,c.parameterValue);var g=this;window.setTimeout(function(){g._invoke(f)},0);break}}}},
findCommand:function(b){return this._commandList[b]},runCommand:function(b,a,e,d){a?(b=this._commandList[b])&&(b.visibleWhen?b.visibleWhen(a):1)&&b.callback&&this._invoke(new c(this,e,a,null,b),d):(a=this._urlBindings[b])&&a.command&&a.command.callback&&this._invoke(a.invocation,d)},getSelectionService:function(){return this._defaultSelectionService},setParameterCollector:function(b){this._parameterCollector=b},openParameterCollector:function(b,a,c){this._parameterCollector&&(this._parameterCollector.close(),
this._parameterCollector.open(b,a,c))},closeParameterCollector:function(){this._parameterCollector&&this._parameterCollector.close()},collectsParameters:function(){return this._parameterCollector},_invoke:function(b,a){return this._collectAndInvoke(b.makeCopy(a),!1)},_collectAndInvoke:function(b,a){if(b)if(this._parameterCollector&&b.parameters&&b.parameters.hasParameters()&&(a||b.parameters.shouldCollectParameters())){var c=!1;b.parameters.updateParameters(b);c=this._parameterCollector.collectParameters(b);
if(!c){var e=new d.Tooltip({node:b.domNode,trigger:"click",position:["below","right","above","left"]}),c=e.contentContainer();c.classList.add("parameterPopup");var f=window.document.activeElement,g=this._parameterCollector.getFillFunction(b,function(){f&&f.focus();e.destroy()})(c);e.show();window.setTimeout(function(){g.focus();g.select()},0);c=!0}c||b.command.callback.call(b.handler||window,b)}else b.command.callback.call(b.handler||window,b);else window.console.log("Client attempted to invoke command without an available (rendered) command invocation")},
collectParameters:function(b){this._collectAndInvoke(b,!0)},showKeyBindings:function(b){var a={},c,e,d,f;for(f in this._activeBindings)if((e=this._activeBindings[f])&&e.keyBinding&&e.command)e.keyBinding.scopeName?(a[e.keyBinding.scopeName]||(a[e.keyBinding.scopeName]=[]),a[e.keyBinding.scopeName].push(e)):(c=i.getUserKeyString(e.keyBinding),d=document.createElement("span"),d.role="listitem",d.appendChild(document.createTextNode(c+" = "+e.command.name)),d.appendChild(document.createElement("br")),
b.appendChild(d));for(var g in a)if(a[g].length&&a[g].length>0){c=document.createElement("h2");b.appendChild(c);c.appendChild(document.createTextNode(g));for(f=0;f<a[g].length;f++)e=a[g][f],c=i.getUserKeyString(e.keyBinding),d=document.createElement("span"),d.role="listitem",d.appendChild(document.createTextNode(c+" = "+e.command.name)),d.appendChild(document.createElement("br")),b.appendChild(d)}},addCommand:function(b){this._commandList[b.id]=b},addCommandGroup:function(b,a,c,e,d,f){this._contributionsByScopeId[b]||
(this._contributionsByScopeId[b]={});b=this._contributionsByScopeId[b];d&&(b=this._createEntryForPath(b,d));if(b[a]){if(e)b[a].title=e;if(c)b[a].position=c;b[a].emptyGroupMessage=f}else b[a]={title:e,position:c,emptyGroupMessage:f,children:{}},b.sortedContributions=null},_createEntryForPath:function(b,a){if(a)for(var c=a.split("/"),e=0;e<c.length;e++)if(c[e].length>1)b[c[e]]||(b[c[e]]={position:0,children:{}}),b=b[c[e]].children;return b},registerSelectionService:function(b,a){this._contributionsByScopeId[b]||
(this._contributionsByScopeId[b]={});this._contributionsByScopeId[b].localSelectionService=a},registerCommandContribution:function(b,a,c,e,d,f,g){this._contributionsByScopeId[b]||(this._contributionsByScopeId[b]={});b=this._contributionsByScopeId[b];e&&(b=this._createEntryForPath(b,e));b[a]={position:c};f&&(c=this._commandList[a])&&(this._activeBindings[a]={command:c,keyBinding:f,bindingOnly:d});g&&(c=this._commandList[a])&&(this._urlBindings[a]={command:c,urlBinding:g,bindingOnly:d});b.sortedContributions=
null},_checkForTrailingSeparator:function(b,a,c){var e;if(a==="tool"||a==="button")if((e=b.childNodes.length>0?b.childNodes[b.childNodes.length-1]:null)&&e.classList.contains("commandSeparator"))return c?(b.removeChild(e),!1):!0;if(a==="menu"&&(b=g.$$array("li > *",b),b.length>0&&b[b.length-1].classList.contains("dropdownSeparator")))if(e=b[b.length-1],c)e.parentNode.parentNode.removeChild(e.parentNode);else return!0;return!1},renderCommands:function(b,a,c,e,d,f,h){if(typeof b!=="string")throw"a scope id for rendering must be specified";
a=g.node(a);if(!a)throw"no parent";var m=this._contributionsByScopeId[b];if(!c&&m){var c=m.localSelectionService||this._defaultSelectionService,i=this;c&&c.getSelections(function(c){i.renderCommands(b,a,c,e,d,f)})}else m&&(this._render(this._contributionsByScopeId[b],a,c,e,d||"button",f,h),this._checkForTrailingSeparator(a,d,!0))},destroy:function(b){b=g.node(b);if(!b)throw"no parent";for(;b.hasChildNodes();){var a=b.firstChild;a.commandTooltip&&a.commandTooltip.destroy();a.emptyGroupTooltip&&a.emptyGroupTooltip.destroy();
this.destroy(a);b.removeChild(a)}},_render:function(b,a,e,g,h,m,i){var n=b.sortedContributions;if(!n){var n=[],l=!1,j;for(j in b)if(!b.hasOwnProperty||b.hasOwnProperty(j)){var k=b[j];if(k&&typeof k.position==="number")k.id=j,n.push(k),l=!0}if(l)n.sort(function(b,a){return b.position-a.position}),b.sortedContributions=n}for(b=0;b<n.length;b++){var q;if(n[b].children&&Object.getOwnPropertyNames(n[b].children).length>0){var k=n[b],l=n[b].children,r=this,p;if(h==="tool"||h==="button")if(k.title){p=this._createDropdownMenu(a,
k.title);i&&f.generateNavGrid(i,p.menuButton);var E=l,H=k;window.setTimeout(function(){r._render(E,p.menu,e,g,"menu",m,i);r._checkForTrailingSeparator(p.menu,"menu",!0);if(p.menu.childNodes.length===0)if(H.emptyGroupMessage){if(!p.menuButton.emptyGroupTooltip)p.menuButton.emptyGroupTooltip=new d.Tooltip({node:p.menuButton,text:H.emptyGroupMessage,trigger:"click",position:["below","right","above","left"]})}else i&&f.removeNavGrid(i,p.menuButton),p.menu.parentNode&&p.menu.parentNode.removeChild(p.menu),
p.destroyButton&&p.destroyButton.parentNode&&p.destroyButton.parentNode.removeChild(p.destroyButton);else p.menuButton.style.visibility="visible"},0)}else{var B;a.childNodes.length>0&&!this._checkForTrailingSeparator(a,h)&&(B=this.generateSeparatorImage(a));r._render(l,a,e,g,h,m,i);a.childNodes.length>0&&a.childNodes[a.childNodes.length-1]!==B&&(B=this.generateSeparatorImage(a))}else k.title?(j=document.createElement("li"),a.appendChild(j),k=this._createDropdownMenu(j,k.title,!0),r._render(l,k.menu,
e,g,"menu",m,i),k.menu.childNodes.length===0&&a.removeChild(j)):(a.childNodes.length>0&&this._generateMenuSeparator(a),r._render(l,a,e,g,h,m,i),this._generateMenuSeparator(a))}else{j=(l=this._commandList[n[b].id])?!0:!1;var C=null,C=null;if(l){q=new c(this,g,e,m,l);q.domParent=a;k=j&&(l.visibleWhen?l.visibleWhen(e):!0);if(this._activeBindings[l.id]&&this._activeBindings[l.id].keyBinding)C=this._activeBindings[l.id],C.invocation=k?q:null,C.bindingOnly&&(j=!1);if(this._urlBindings[l.id]&&this._urlBindings[l.id].urlBinding)C=
this._urlBindings[l.id],C.invocation=k?q:null,C.bindingOnly&&(j=!1);j=j&&k}if(j)if(l.choiceCallback){h==="tool"||h==="button"?(j=a,k=!1,a.nodeName.toLowerCase()==="ul"&&(j=document.createElement("li"),a.appendChild(j))):(j=a,k=!0);var S=this;this._createDropdownMenu(j,l.name,k,function(b){this.populateChoicesMenu(b,e,g,m,S)}.bind(l))}else h==="tool"?(j="tool"+l.id+b,l._addTool(a,j,q,i)):h==="button"?(j="button"+l.id+b,l._addButton(a,j,q,i)):h==="menu"&&l._addMenuItem(a,q,i)}}},_createDropdownMenu:function(b,
a,c,e){var b=g.node(b),d,f=document.createElement("span");f.classList.add("dropdownTrigger");c?(f.classList.add("dropdownMenuItem"),d="dropdownSubMenu",c="dropdownArrowRight",f.tabIndex=0,f.role="menuitem"):(f.classList.add("commandButton"),c="dropdownArrowDown",f.tabIndex=0,f.role="button");a=document.createTextNode(a);f.appendChild(a);a=document.createElement("span");a.classList.add(c);f.appendChild(a);c=b;b.nodeName.toLowerCase()==="ul"?(c=document.createElement("li"),b.appendChild(c),b=c):(f.classList.add("commandMargins"),
b=f);c.appendChild(f);d&&c.classList.add(d);d=document.createElement("ul");c.appendChild(d);d.classList.add("dropdownMenu");f.dropdown=new h.Dropdown({dropdown:d,populate:e});d.dropdown=f.dropdown;return{menuButton:f,menu:d,dropdown:f.dropdown,destroyButton:b}},_generateCheckedMenuItem:function(b,a,c,e){var d=document.createElement("li");b.appendChild(d);b=document.createElement("label");b.classList.add("dropdownMenuItem");var f=document.createElement("input");f.type="checkbox";f.role="menuitem";
f.checked=c;f.classList.add("checkedMenuItem");b.appendChild(f);a=document.createTextNode(a);b.appendChild(a);d.appendChild(b);f.addEventListener("change",e,!1)},_generateMenuSeparator:function(b){if(!this._checkForTrailingSeparator(b,"menu")){var a=document.createElement("li");a.classList.add("dropdownSeparator");var c=document.createElement("span");c.classList.add("dropdownSeparator");a.appendChild(c);b.appendChild(a)}},generateSeparatorImage:function(b){var a;a=b.nodeName.toLowerCase()==="ul"?
document.createElement("li"):document.createElement("span");b.appendChild(a);a.classList.add("core-sprite-sep");a.classList.add("imageSprite");a.classList.add("commandSeparator");return a}};b.prototype.constructor=b;m.prototype={_init:function(b){this.id=b.id;this.name=b.name;this.tooltip=b.tooltip||b.name;this.callback=b.callback;this.hrefCallback=b.hrefCallback;this.choiceCallback=b.choiceCallback;this.image=b.image||j.toUrl("images/none.png");this.imageClass=b.imageClass;this.spriteClass=b.spriteClass||
"commandSprite";this.visibleWhen=b.visibleWhen;this.parameters=b.parameters},_addTool:function(b,a,c,g){c.handler=c.handler||this;var h;if(this.hrefCallback){if(h=this._makeLink(b,c,"commandLink"),!h)return}else h=document.createElement("span"),h.tabIndex=g?-1:0,h.role="button",this.hasImage()?(e(this,h,a),this.name&&h.setAttribute("aria-label",this.name)):(a=window.document.createTextNode(this.name),h.appendChild(a),h.classList.add("commandMissingImageButton"),h.classList.add("commandButton")),this._hookCallback(h,
c);c.domNode=h;c.domParent=b;if(this.tooltip)h.commandTooltip=new d.Tooltip({node:h,text:this.tooltip,position:["above","below","right","left"]});b.nodeName.toLowerCase()==="ul"?(a=document.createElement("li"),b.appendChild(a),b=a):h.classList.add("commandMargins");b.appendChild(h);f.generateNavGrid(g,c.domNode)},_addButton:function(b,a,c,g){c.handler=c.handler||this;var h;if(this.hrefCallback)h=this._makeLink(b,c,"commandLink");else if(!this.name&&this.hasImage()){if(h=document.createElement("span"),
h.tabIndex=0,h.role="button",e(this,h,a),this.tooltip&&h.setAttribute("aria-label",this.tooltip),this._hookCallback(h,c),this.tooltip)h.commandTooltip=new d.Tooltip({node:h,text:this.tooltip,position:["above","below","right","left"]})}else h=this._makeButton(b,c,"commandButton"),this._hookCallback(h,c);c.domParent=b;b.nodeName.toLowerCase()==="ul"?(a=document.createElement("li"),b.appendChild(a),b=a):h.classList.add("commandMargins");b.appendChild(h);f.generateNavGrid(g,c.domNode)},_addMenuItem:function(b,
a,c){a.domParent=b;var e,d=b.dropdown;this.hrefCallback?e=this._makeLink(b,a,"dropdownMenuItem",["right","left","above","below"]):(e=this._makeButton(b,a,"dropdownMenuItem",["right","left","above","below"]),this.callback&&this._hookCallback(e,a,function(){d.close(!0)}));e.role="menuitem";f.generateNavGrid(c,a.domNode);b.nodeName.toLowerCase()==="ul"?(a=document.createElement("li"),b.appendChild(a),b=a):e.classList.add("commandMargins");b.appendChild(e)},_makeButton:function(b,a,c,e){b=document.createElement("span");
b.role="button";b.tabIndex=0;b.id=this.name;var f=document.createTextNode(this.name);b.appendChild(f);c&&b.classList.add(c);if(this.tooltip)b.commandTooltip=new d.Tooltip({node:b,text:this.tooltip,position:e||["above","below","right","left"]});return a.domNode=b},_makeLink:function(b,a,c,e){var f=document.createElement("a");f.id=this.name;c&&f.classList.add(c);f.appendChild(document.createTextNode(this.name));if(this.hrefCallback)b=this.hrefCallback.call(a.handler,a),b.then?b.then(function(b){f.href=
b}):f.href=b?b:"#";if(this.tooltip)f.commandTooltip=new d.Tooltip({node:f,text:this.tooltip,position:e||["above","below","right","left"]});return a.domNode=f},_hookCallback:function(b,a,c,e){b.addEventListener("click",function(b){c&&c();a.commandService._invoke(a);e&&e();g.stop(b)},!1);b.addEventListener("keydown",function(b){if(b.keyCode===g.KEY.ENTER||b.keyCode===g.KEY.SPACE)c&&c(),a.commandService._invoke(a),e&&e(),g.stop(b)},!1)},populateChoicesMenu:function(b,a,c,e,d){c=this.getChoices(a,c,e);
for(e=0;e<c.length;e++){var f=c[e];if(f.name){var h=document.createElement("li");b.appendChild(h);var m=document.createElement("span");m.tabIndex=0;m.role="menuitem";m.classList.add("dropdownMenuItem");var i=document.createTextNode(f.name);m.appendChild(i);h.appendChild(m);m.choice=f;m.addEventListener("click",function(b){b.target.choice&&b.target.choice.callback.call(b.target.choice,a)},!1);m.addEventListener("keydown",function(b){(b.keyCode===g.KEY.ENTER||b.keyCode===g.KEY.SPACE)&&b.target.choice&&
b.target.choice.callback.call(b.target.choice,a)},!1)}else d._generateMenuSeparator(b)}},getChoices:function(b,a,c){return this.choiceCallback?this.choiceCallback.call(a,b,c):null},makeChoiceCallback:function(b,a){return function(c){b.callback&&b.callback.call(b,a,c)}},hasImage:function(){return this.imageClass||this.image!==j.toUrl("images/none.png")}};m.prototype.constructor=m;n.prototype={match:function(b){if(this.keyCode===b.keyCode){if(this.mod1!==(p?b.metaKey:b.ctrlKey))return!1;if(this.mod2!==
b.shiftKey)return!1;if(this.mod3!==b.altKey)return!1;if(p&&this.mod4!==b.ctrlKey)return!1;if(!this.domScope)return!0;for(b=b.target;b;){if(b===window.document)break;if(b===this.domScope)return!0;b=b.parentNode}}return!1},equals:function(b){return!b?!1:this.keyCode!==b.keyCode?!1:this.mod1!==b.mod1?!1:this.mod2!==b.mod2?!1:this.mod3!==b.mod3?!1:this.mod4!==b.mod4?!1:this.domScope!==b.domScope?!1:!0}};n.prototype.constructor=n;r.prototype={match:function(b){b=a.matchResourceParameters(b);return typeof b[this.token]!==
"undefined"?(this.parameterValue=b[this.token],this):null}};r.prototype.constructor=r;q.prototype={optionsRequested:function(){return this.optionsRequested}};q.prototype.constructor=q;l.prototype={_storeParameters:function(b){this.parameterTable=null;if(b){this.parameterTable={};for(var a=0;a<b.length;a++)this.parameterTable[b[a].name]=b[a]}},updateParameters:function(b){typeof this.getParameters==="function"&&this._storeParameters(this.getParameters(b))},hasParameters:function(){return this.parameterTable!==
null},shouldCollectParameters:function(){return!this.clientCollect&&this.hasParameters()},parameterNamed:function(b){return this.parameterTable[b]},valueFor:function(b){return(b=this.parameterTable[b])?b.value:null},setValue:function(b,a){var c=this.parameterTable[b];if(c)c.value=a},forEach:function(b){for(var a in this.parameterTable)this.parameterTable[a].type&&this.parameterTable[a].name&&b(this.parameterTable[a])},makeCopy:function(){var b=[];this.forEach(function(a){a=new q(a.name,a.type,a.label,
a.value,a.lines);b.push(a)});var a=new l(b,this._options,this.getParameters);a.clientCollect=this.clientCollect;return a},hasOptionalParameters:function(){return this._hasOptionalParameters}};l.prototype.constructor=l;return{CommandService:b,CommandKeyBinding:n,Command:m,CommandInvocation:c,URLBinding:r,ParametersDescription:l,CommandParameter:q}});
define("orion/operationsCommands",["i18n!orion/operations/nls/messages","require","orion/webui/littlelib","orion/commands"],function(k,j,i,a){var g={};(function(){var h=!1;g.updateNavTools=function(a,f,c,b,e){var g=a.getService("orion.page.command"),n=i.node(c);if(n)g.destroy(n);else throw k["could not find toolbar "]+c;g.renderCommands(c,n,e,f,"button");if(b&&(c=i.node(b)))g.destroy(c),g.renderCommands(b,c,null,f,"button");h||(h=!0,a.getService("orion.page.selection").addEventListener("selectionChanged",
function(c){var e=i.node(b);if(e){var g=a.getService("orion.page.command");g.destroy(e);g.renderCommands(b,e,c.selections,f,"button")}}))};g.createOperationsCommands=function(d,f,c){function b(b){return!b.operation||!b.operation.type?!1:b.operation.type==="loadstart"||b.operation.type==="progress"}var e=new a.Command({name:k["Remove Completed"],tooltip:k["Remove all completed operations"],id:"eclipse.removeCompletedOperations",callback:function(){c.removeCompletedOperations().then(function(){f.loadOperations.bind(f)()})},
visibleWhen:function(){return!0}});d.addCommand(e);e=new a.Command({name:k.Remove,tooltip:k["Remove operations from the operations list."],imageClass:"core-sprite-delete",id:"eclipse.removeOperation",callback:function(b){for(var b=Array.isArray(b.items)?b.items:[b.items],a=0;a<b.length;a++){var e=b[a];c.removeOperation.bind(c)(e.Location).then(function(){f.loadOperations.bind(f)()},function(){f.loadOperations.bind(f)()})}},visibleWhen:function(a){if(!Array.isArray(a)||a.length===0)return!b(a);for(var c in a)if(b(a[c]))return!1;
return!0}});d.addCommand(e);e=new a.Command({name:k.Cancel,tooltip:k["Cancel operations from the operations list."],imageClass:"core-sprite-stop",id:"eclipse.cancelOperation",callback:function(b){for(var b=Array.isArray(b.items)?b.items:[b.items],a=0;a<b.length;a++){var c=b[a];c.deferred&&c.deferred.cancel()}},visibleWhen:function(a){if(!Array.isArray(a)||a.length===0)return b(a)&&(a.operation&&a.operation.cancelable?!0:!1);for(var c in a)if(!b(a[c])||!a[c].operation||!a[c].operation.cancelable)return!1;
return!0}});d.addCommand(e)}})();return g});
define("orion/webui/dialogs/OperationsDialog",["i18n!orion/operations/nls/messages","require","orion/webui/littlelib","orion/webui/popupdialog","orion/operationsCommands"],function(k,j,i,a,g){function h(a){this._options=a}h.prototype=new a.PopupDialog;h.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>';h.prototype._init=
function(a){this._myOperations=[];this._operationsDeferreds=[];this._commandService=a.serviceRegistry.getService("orion.page.command");g.createOperationsCommands(this._commandService);this._commandService.registerCommandContribution("operationsDialogItems","eclipse.cancelOperation",1);this._initialize(a.triggerNode)};h.prototype._bindToDom=function(){this.$allOperationsLink.href=j.toUrl("operations/list.html");this._setOperationsVisibility()};h.prototype.setOperations=function(a,f){this._myOperations||
this._init(this._options);this._myOperations=[];this._operationsDeferreds=[];if(a)for(var c in a)this._myOperations.push(a[c]),this._operationsDeferreds.push(f[c]);this._renderOperations()};h.prototype.parseProgressResult=function(a){if(!a)return{};a=a.responseText||a;try{a=JSON.parse(a)}catch(f){}var c={Message:a.Message||a,Severity:a.Severity};if(a.DetailedMessage&&a.DetailedMessage!==c.Message)c.DetailedMessage=a.DetailedMessage;return c};h.prototype._renderOperations=function(){this._renderOperationsTable(this.$myOperationsList,
this._myOperations,this._operationsDeferreds)};h.prototype._renderOperationsTable=function(a,f,c){i.empty(a);for(var b=0;b<f.length;b++){var e=f[b],g=document.createElement("tr"),h=document.createElement("td");h.style.paddingLeft="5px;";h.style.paddingRight="5px;";h.textContent=e.Name;g.appendChild(h);var j=document.createElement("div");h.appendChild(j);h=document.createElement("span");j.appendChild(h);h.classList.add("imageSprite");var q=document.createElement("span");q.classList.add("primaryColumn");
j.appendChild(q);q.appendChild(document.createTextNode(e.Name));switch(e.type){case "Warning":h.classList.add("core-sprite-warning");h.setAttribute("aria-label",k["Operation resulted in a warning."]);break;case "error":h.classList.add("core-sprite-error");h.setAttribute("aria-label",k["Operation resulted in an error."]);break;case "loadstart":case "progress":h.classList.add("core-sprite-start");h.setAttribute("aria-label",k["Operation is running."]);break;case "abort":h.classList.add("core-sprite-stop");
h.setAttribute("aria-label",k["Operation is canceled."]);break;case "load":case "loadend":h.classList.add("core-sprite-ok"),h.setAttribute("aria-label","Operation ok.")}if(e.error)h=e.error.Message||e.error,e.error.DetailedMessage&&e.error.DetailedMessage!==""&&(h+=": "+e.error.DetailedMessage),j.appendChild(document.createElement("br")),q=document.createElement("span"),q.classList.add("secondaryColumn"),q.style.marginLeft="18px;",j.appendChild(q),q.textContent=h;h=document.createElement("span");
j.appendChild(h);this._commandService.renderCommands("operationsDialogItems",j,{operation:e,deferred:c[b]},this,"tool");a.appendChild(g)}this._setOperationsVisibility()};h.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"};h.prototype.constructor=h;return{OperationsDialog:h}});
define("orion/progress",["i18n!orion/nls/messages","require","orion/Deferred","orion/webui/littlelib","orion/webui/dialogs/OperationsDialog"],function(k,j,i,a,g){function h(d,c){if(!this._progressPane){this._progressPane=a.node(d);this._operationsDialog=new g.OperationsDialog({triggerNode:this._progressPane,serviceRegistry:c});var b=this;this._progressPane.addEventListener("keydown",function(c){(c.charOrCode===" "||c.keyCode===a.KEY.ENTER)&&b._operationsDialog.show()})}}function d(a,c,b){this._serviceRegistry=
a;this._serviceRegistration=a.registerService("orion.page.progress",this);this._operationsClient=c;this._operations={};this._operationDeferrds={};this._operationsIndex=0;this._lastIconClass=this._lastOperation=null;this._progressMonitorClass=b}h.prototype={_switchIconTo:function(a){this._lastIconClass&&this._progressPane.classList.remove(this._lastIconClass);this._lastIconClass=a;this._progressPane.classList.add(this._lastIconClass)},generateOperationsInfo:function(a,c){var b={},e;for(e in a)a[e].progressMonitor||
(b[e]=a[e]);if(this._isEmpty(b))this._switchIconTo("progressPane_empty"),this._progressPane.title=k.Operations,this._progressPane.alt=k.Operations,this._progressPane.hasAttribute("aria-valuetext")&&this._progressPane.removeAttribute("aria-valuetext");else{var d="";for(e in b){var g=b[e];if(g.type&&(g.type==="loadstart"||g.type==="progress")){d="running";break}}switch(d){case "running":this._progressPane.title=k["Operations running"];this._progressPane.alt=k["Operations running"];this._progressPane.setAttribute("aria-valuetext",
k["Operations running"]);this._switchIconTo("progressPane_running");break;case "warning":this._progressPane.title=k["Some operations finished with warning"];this._progressPane.alt=k["Some operations finished with warning"];this._progressPane.setAttribute("aria-valuetext",k["Some operations finished with warning"]);this._switchIconTo("progressPane_warning");break;case "error":this._progressPane.title=k["Some operations finished with error"];this._progressPane.alt=k["Some operations finished with error"];
this._progressPane.setAttribute("aria-valuetext",k["Some operations finished with error"]);this._switchIconTo("progressPane_error");break;default:this._progressPane.title=k.Operations,this._progressPane.alt=k.Operations,this._progressPane.hasAttribute("aria-valuetext")&&this._progressPane.removeAttribute("aria-valuetext"),this._switchIconTo("progressPane_operations")}}this._operationsDialog.setOperations(b,c)},_isEmpty:function(a){for(var c in a)return!1;return!0}};h.prototype.constructon=h;d.prototype=
{init:function(a){if(!this._progressMonitorClass)this._progressMonitorTool=new h(a,this._serviceRegistry)},progress:function(a,c,b){var e=this,d=this._operationsIndex++;!b&&this._progressMonitorClass&&(b=new this._progressMonitorClass,b.begin(c));a.then(function(){if(e._operations[d]){var g=e._operations[d];if(c)g.Name=c;e._lastOperation=g;g.type="loadend";if(b)g.progressMonitor=b;e.writeOperation.bind(e)(d,g,a);g.Location||e._removeOperationFromTheList.bind(e)(d)}},function(g){if(e._operations[d]){var h=
e._operations[d];if(c)h.Name=c;if(b)h.progressMonitor=b;e._lastOperation=h;h.type=g.canceled?"abort":"error";h.error=g;e.writeOperation.bind(e)(d,h,a);h.Location||e._removeOperationFromTheList.bind(e)(d)}},function(g){if(c)g.Name=c;if(b)g.progressMonitor=b;e.writeOperation.bind(e)(d,g,a)});return a},removeOperation:function(a){for(var c in this._operations)if(this._operations[c].Location&&this._operations[c].Location===a){this._removeOperationFromTheList(c);break}this._operationsClient.removeOperation.bind(this._operationsClient)(a)},
_removeOperationFromTheList:function(a){var c=this._operations[a].progressMonitor;delete this._operations[a];delete this._operationDeferrds[a];c?c.done():this._progressMonitorTool.generateOperationsInfo(this._operations,this._operationDeferrds)},removeCompletedOperations:function(){for(var a in this._operations){var c=this._operations[a];if(c.type&&c.type!=="loadstart"&&c.type!=="progress")(c=this._operations[a].progressMonitor)&&c.done(),delete this._operations[a],delete this._operationDeferrds[a]}this._progressMonitorTool.generateOperationsInfo(operations,
this._operationDeferrds)},setProgressResult:function(a){this._serviceRegistry.getService("orion.page.message").setProgressResult(a)},showWhile:function(a,c){c&&this._serviceRegistry.getService("orion.page.message").setProgressMessage(c);var b=this;a.then(function(){b._serviceRegistry.getService("orion.page.message").setProgressMessage("")},function(a){b.setProgressResult.bind(b)(a);return a});return this.progress(a,c)},writeOperation:function(a,c,b){this._operations[a]=c;this._operationDeferrds[a]=
b;c.Location&&serviceRegistry.getService("orion.core.preference").getPreferences("/operations").then(function(b){b.put(c.Location,{Name:c.Name,expires:c.expires})});c.progressMonitor?c.progressMonitor.progress(c.Name):this._progressMonitorTool.generateOperationsInfo(this._operations,this._operationDeferrds)}};d.prototype.constructor=d;return{ProgressService:d}});
define("orion/section",["orion/webui/littlelib","orion/selection","orion/commands","orion/commonHTMLFragments"],function(k,j,i,a){function g(d,f){var c=this;this._expandImageClass="core-sprite-openarrow";this._collapseImageClass="core-sprite-closedarrow";this._twistieSpriteClass="modelDecorationSprite";if(!f.id)throw Error("Missing required argument: id");this.id=f.id;if(!f.title)throw Error("Missing required argument: title");var b=f.useAuxStyle?["sectionWrapper","sectionWrapperAux","toolComposite"]:
["sectionWrapper","toolComposite"];this.domNode=document.createElement("div");d.appendChild(this.domNode);for(var e=0;e<b.length;e++)this.domNode.classList.add(b[e]);this.domNode.id=f.id;if(f.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(b){(b.target===c.titleNode||b.target===c.twistie)&&c._changeExpandedState()},!1),this.domNode.addEventListener("keydown",function(b){b.keyCode===k.KEY.ENTER&&(b.target===c.domNode||b.target===c.titleNode||b.target===c.twistie)&&c._changeExpandedState()},!1);if(f.iconClass){var g=document.createElement("span");g.classList.add("sectionIcon");this.domNode.appendChild(g);(Array.isArray(f.iconClass)?f.iconClass:[f.iconClass]).forEach(function(b){g.classList.add(b)})}this.titleNode=document.createElement("div");
this.titleNode.id=f.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=f.title;if(typeof f.getItemCount==="function")b=document.createElement("div"),b.classList.add("layoutLeft"),b.classList.add("sectionItemCount"),this.domNode.appendChild(b),b.textContent=f.getItemCount(this);this._progressNode=document.createElement("div");this._progressNode.id=
f.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);b=document.createElement("div");b.id=f.id+"FilterSearchBox";this.domNode.appendChild(b);this._toolActionsNode=document.createElement("div");this._toolActionsNode.id=f.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=f.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=f.id+"SelectionArea";this.selectionNode.classList.add("layoutRight");this.selectionNode.classList.add("sectionActions");
this.domNode.appendChild(this.selectionNode);f.slideout&&(b=a.slideoutHTMLFragment(f.id),e=document.createRange(),e.selectNode(this.domNode),b=e.createContextualFragment(b),this.domNode.appendChild(b));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);d.appendChild(this._contentParent);f.content&&this.setContent(f.content);
this.hidden=f.hidden;if(typeof f.onExpandCollapse==="function")this._onExpandCollapse=f.onExpandCollapse;this._preferenceService=f.preferenceService;this._contentParent.style.display="none";if(this._preferenceService){var h=this;this._preferenceService.getPreferences("/window/views").then(function(b){b=b.get(h.id);if(b!==void 0)h.hidden=!b;if(!h.hidden)h._contentParent.style.display="block";h._updateExpandedState(!h.hidden,!1)})}else{if(!this.hidden)this._contentParent.style.display="block";this._updateExpandedState(!this.hidden,
!1)}this._commandService=f.commandService;this._lastMonitor=0;this._loading={}}function h(a){this._section=a;this._id=++a._lastMonitor}g.prototype={setTitle:function(a){this.titleNode.textContent=a},setContent:function(a){typeof a==="string"?this._contentParent.innerHTML=a:(this._contentParent.innerHTML="",this._contentParent.appendChild(a))},getContentElement:function(){return this._contentParent},createProgressMonitor:function(){return new h(this)},_setMonitorMessage:function(a,f){this._progressNode.style.visibility=
"visible";this._loading[a]=f;var c="",b;for(b in this._loading)c!==""&&(c+="\n"),c+=this._loading[b];this._progressNode.title=c},_monitorDone:function(a){delete this._loading[a];var a="",f;for(f in this._loading)a!==""&&(a+="\n"),a+=this._loading[f];this._progressNode.title=a;if(a==="")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(a,f){var c=this.twistie,b=this.id;c&&(c.classList.add(a?this._expandImageClass:this._collapseImageClass),c.classList.remove(a?this._collapseImageClass:this._expandImageClass));this._preferenceService&&f&&this._preferenceService.getPreferences("/window/views").then(function(c){c.put(b,a)});this._onExpandCollapse&&this._onExpandCollapse(a,this)}};g.prototype.constructor=g;h.prototype={begin:function(a){this.status=a;this._section._setMonitorMessage(this.id,a)},worked:function(a){this.status=
a;this._section._setMonitorMessage(this.id,a)},done:function(a){this.status=a;this._section._monitorDone(this.id)}};h.prototype.constructor=h;return{Section:g}});
define("orion/explorers/explorer","i18n!orion/nls/messages,require,orion/webui/littlelib,orion/webui/treetable,orion/explorers/explorerNavHandler,orion/commands".split(","),function(k,j,i,a,g,h){var d={};d.Explorer=function(){function d(a,b,e){this.registry=a;this.renderer=e;this.selection=b;this.myTree=null}d.prototype={changedItem:function(a,b){this.myTree&&this.myTree.refresh.bind(this.myTree)(a,b,!0)},updateCommands:function(a){this.myTree&&this.myTree._renderer.updateCommands.bind(this.myTree._renderer)(a)},
makeNewItemPlaceHolder:function(a,b,e){a=this.getRow(a);if(e)return a=a.childNodes[e],a.appendChild(document.createElement("br")),e=document.createElement("span"),e.id=b+"placeHolderRow",a.appendChild(e),{tempNode:e,refNode:e};if(a){e=document.createElement("tr");e.id=b+"placeHolderRow";var d=document.createElement("td");d.id=b+"placeHolderCol";e.appendChild(d);a.appendChild(e);e=i.node(b+"placeHolderRow");a=i.node(b+"placeHolderCol");if(e&&a)return{tempNode:e,refNode:a}}return null},getRow:function(a){if(a=
this.model.getId(a))return i.node(a)},collapseAll:function(){for(var a=this._navHandler.getTopLevelNodes(),b=0;b<a.length;b++)this.myTree.collapse(a[b])},expandAll:function(a){if(a)this._expandRecursively(a);else if(this._navHandler)for(var a=this._navHandler.getTopLevelNodes(),b=0;b<a.length;b++)this._expandRecursively(a[b])},_expandRecursively:function(a){if(this._navHandler&&this._navHandler.isExpandable(a)){var b=this;this.myTree.expand(a,function(){b.model.getChildren(a,function(a){if(!(a===
void 0||a===null))for(var c=a.length,d=0;d<c;d++)b._expandRecursively(a[d])})})}},createTree:function(c,b,e){this.selection&&this.selection.setSelections([]);this.getNavHandler()&&this.getNavHandler()._clearSelection();var d=c+"innerTree",f=i.node(d);f&&i.empty(f);if(b)b.rootId=d;this.model=b;this._parentId=c;this._treeOptions=e;if(!e||e&&!e.noSelection)this.selectionPolicy=e?e.selectionPolicy:"",this._navDict=new g.ExplorerNavDict(this.model);this.myTree=new a.TableTree({id:d,model:b,parent:c,labelColumnIndex:this.renderer.getLabelColumnIndex(),
renderer:this.renderer,showRoot:e?!!e.showRoot:!1,indent:e?e.indent:void 0,onCollapse:e?e.onCollapse:void 0,tableElement:e?e.tableElement:void 0,tableBodyElement:e?e.tableBodyElement:void 0,tableRowElement:e?e.tableRowElement:void 0});this.renderer._initializeUIState();this.selectionPolicy==="cursorOnly"&&this.initNavHandler()},getNavHandler:function(){return this._navHandler},getNavDict:function(){return this._navDict},refreshSelection:function(){if(this.selection){var a=this.getNavHandler(),b=[];
if(a&&this.getNavDict())for(var e=a.getSelection(),d=0;d<e.length;d++){var f=a.getRowDiv(e[d]);f&&f.parentNode&&(f=this.getNavDict().getValue(this.model.getId(e[d])),f.model&&b.push(f.model))}this.selection.setSelections(b)}},getRootPath:function(){return this.model&&this.model.root?this.model.root.Location:null},initNavHandler:function(){var a=this._treeOptions;if(!a||a&&!a.noSelection){if(!this.getNavHandler())this._navHandler=new g.ExplorerNavHandler(this,this._navDict,{setFocus:a&&a.setFocus,
selectionPolicy:a?a.selectionPolicy:null});var b=this;this.model.getRoot(function(e){e instanceof Array?b.getNavHandler().refreshModel(b.getNavDict(),b.model,e):e.children&&e.children instanceof Array&&b.getNavHandler().refreshModel(b.getNavDict(),b.model,e.children);a&&a.setFocus&&b.getNavHandler().cursorOn(null,!1,!1,!0)})}},_lastHash:null,checkbox:!1};return d}();d.createExplorerCommands=function(a,c){function b(b){return typeof b.getItemCount==="function"?b.getItemCount()>0?c?c(b):!0:!1:!1}var e=
new h.Command({tooltip:k["Expand all"],imageClass:"core-sprite-expandAll",id:"orion.explorer.expandAll",groupId:"orion.explorerGroup",visibleWhen:function(a){return b(a)},callback:function(b){b.items.expandAll()}}),d=new h.Command({tooltip:k["Collapse all"],imageClass:"core-sprite-collapseAll",id:"orion.explorer.collapseAll",groupId:"orion.explorerGroup",visibleWhen:function(a){return b(a)},callback:function(b){b.items.collapseAll()}});a.addCommand(e);a.addCommand(d)};d.ExplorerModel=function(){function a(c,
b,e){this.rootPath=c;this.fetchItems=b;this.idPrefix=e||""}a.prototype={destroy:function(){},getRoot:function(a){var b=this;this.fetchItems(this.rootPath).then(function(e){b.root=e;a(e)})},getChildren:function(a,b){a.Children?b(a.Children):a.ChildrenLocation?this.fetchItems(a.ChildrenLocation).then(function(e){a.Children=e;b(e)}):b([])},getId:function(a){if(a.Location===this.root.Location)return this.rootId;for(var a=a.Location.replace(/[\\\/]/g,""),b=this.idPrefix,e=0;e<a.length;e++)b+=a[e].match(/[^\.\:\-\_0-9A-Za-z]/g)?
a.charCodeAt(e):a[e];return b}};return a}();d.ExplorerFlatModel=function(){function a(c,b,e){this.rootPath=c;this.fetchItems=b;this.root=e}a.prototype=new d.ExplorerModel;a.prototype.getRoot=function(a){if(this.root)a(this.root);else{var b=this;this.fetchItems(this.rootPath).then(function(e){b.root=e;a(e)})}};a.prototype.getChildren=function(a,b){a===this.root?b(this.root):b([])};return a}();d.ExplorerRenderer=function(){function a(c,b){this.explorer=b;this._init(c);this._expandImageClass="core-sprite-openarrow";
this._collapseImageClass="core-sprite-closedarrow";this._twistieSpriteClass="modelDecorationSprite"}a.prototype={_init:function(a){if(a){this._useCheckboxSelection=a.checkbox===void 0?!1:a.checkbox;this.selectionPolicy=a.singleSelection?"singleSelection":"";this._cachePrefix=a.cachePrefix;this.getCheckedFunc=a.getCheckedFunc;this.onCheckedFunc=a.onCheckedFunc;this._highlightSelection=!0;this._treeTableClass=a.treeTableClass||"treetable";if(a.highlightSelection===!1)this._highlightSelection=!1;if(!this.actionScopeId)this.actionScopeId=
a.actionScopeId}},getLabelColumnIndex:function(){return this.explorer.checkbox?1:0},initTable:function(a,b){this.tableTree=b;i.empty(a);this._treeTableClass&&a.classList.add(this._treeTableClass);this.renderTableHeader(a)},getActionsColumn:function(a,b,e,d,f){var e=e||"tool",g=this.explorer.registry.getService("orion.page.command"),h=document.createElement("td");h.id=b.id+"actionswrapper";d&&h.classList.add(d);this.actionScopeId?g.renderCommands(this.actionScopeId,h,a,this.explorer,e,null,f&&this.explorer.getNavDict()?
this.explorer.getNavDict().getGridNavHolder(a,!0):null):window.console.log("Warning, no action scope was specified.  No commands rendered.");return h},initCheckboxColumn:function(){if(this._useCheckboxSelection)return document.createElement("th")},getCheckboxColumn:function(a,b){if(this._useCheckboxSelection){var e=document.createElement("td"),d=document.createElement("span");d.id=this.getCheckBoxId(b.id);d.classList.add("core-sprite-check");d.classList.add("selectionCheckmarkSprite");d.rowId=b.id;
if(this.getCheckedFunc)d.checked=this.getCheckedFunc(a),d.checked?(this._highlightSelection&&b.classList.add("checkedRow"),d.classList.add("core-sprite-check_on")):(this._highlightSelection&&b.classList.remove("checkedRow"),d.classList.remove("core-sprite-check_on"));e.appendChild(d);var f=this;d.addEventListener("click",function(a){f.onCheck(b,a.target,a.target.checked?!1:!0,!0)},!1);return e}},getCheckBoxId:function(a){return a+"selectedState"},onCheck:function(a,b,e,d,f){(b.checked=e)?b.classList.add("core-sprite-check_on"):
b.classList.remove("core-sprite-check_on");if(this.onCheckedFunc)this.onCheckedFunc(b.rowId,e,d);this.explorer.getNavHandler()&&f&&this.explorer.getNavHandler().setSelection(this.explorer.getNavDict().getValue(a.id).model,!0)},storeSelections:function(){if(this.explorer.getNavHandler()){var a=this.explorer.getNavHandler().getSelectionIds(),b=this._getUIStatePreferencePath();b&&window.sessionStorage&&(window.sessionStorage[b+"selection"]=JSON.stringify(a))}},_restoreSelections:function(a){a=window.sessionStorage[a+
"selection"];typeof a==="string"&&(a=a.length>0?JSON.parse(a):null);var b;if(a&&this.explorer.getNavDict()){var e=[];for(b=0;b<a.length;b++){var d=this.explorer.getNavDict().getValue(a[b]);if(d&&d.rowDomNode&&d.model&&(e.push(d.model),this._highlightSelection&&d.rowDomNode.classList.add("checkedRow"),d=i.node(this.getCheckBoxId(d.rowDomNode.id))))d.checked=!0,d.classList.add("core-sprite-check_on")}this.explorer.selection&&(this.explorer.selection.setSelections(e),this.explorer.getNavHandler()&&this.explorer.getNavHandler().refreshSelection())}},
_storeExpansions:function(a){window.sessionStorage[a+"expanded"]=JSON.stringify(this._expanded)},_restoreExpansions:function(a){var b=!1,e=window.sessionStorage[a+"expanded"];typeof e==="string"&&(e=e.length>0?JSON.parse(e):null);var d;if(e)for(d=0;d<e.length;d++)if(i.node(e[d])){this._expanded.push(e[d]);var f=this;this.tableTree.expand(e[d],function(){f._restoreSelections(a)});b=!0}return!b},_getUIStatePreferencePath:function(){if(this.explorer){var a=this.explorer.getRootPath();if(this._cachePrefix&&
a)return"/"+this._cachePrefix+"/"+a.replace(/[^\.\:\-\_0-9A-Za-z]/g,"")+"/uiState"}return null},expandCollapseImageId:function(a){return a+"__expand"},updateExpandVisuals:function(a,b){var e=i.node(this.expandCollapseImageId(a.id));e&&(e.classList.add(b?this._expandImageClass:this._collapseImageClass),e.classList.remove(b?this._collapseImageClass:this._expandImageClass))},getExpandImage:function(a,b,e,d){var f=document.createElement("span");f.id=this.expandCollapseImageId(a.id);b.appendChild(f);f.classList.add(this._twistieSpriteClass);
f.classList.add(this._collapseImageClass);if(e){var g=document.createElement("span");b.appendChild(g);g.classList.add(d||"imageSprite");g.classList.add(e)}var h=this;f.onclick=function(){h.tableTree.toggle(a.id);if(h.tableTree.isExpanded(a.id))h._expanded.push(a.id);else for(var b in h._expanded)if(h._expanded[b]===a.id){h._expanded.splice(b,1);break}(b=h._getUIStatePreferencePath())&&window.sessionStorage&&h._storeExpansions(b)};return f},render:function(a,b){b.classList.add("navRow");this.renderRow(a,
b)},rowsChanged:function(){this.explorer.selectionPolicy!=="cursorOnly"&&(this.explorer.refreshSelection(),this.explorer.initNavHandler())},updateCommands:function(){for(var a=this.explorer.registry,b=i.$$array(".treeTableRow"),e=0;e<b.length;e++){var d=b[e],f=i.node(d.id+"actionswrapper"),g=a.getService("orion.page.command");g.destroy(f);this.actionScopeId&&g.renderCommands(this.actionScopeId,f,d._item,this.explorer,"tool")}},_initializeUIState:function(){this._expanded=[];var a=this._getUIStatePreferencePath();
a&&window.sessionStorage&&this._restoreExpansions(a)&&this._restoreSelections(a)}};return a}();d.SelectionRenderer=function(){function a(c,b){this._init(c);this.explorer=b}a.prototype=new d.ExplorerRenderer;a.prototype.renderTableHeader=function(a){var b=document.createElement("thead"),e=document.createElement("tr");b.classList.add("navTableHeading");this._useCheckboxSelection&&e.appendChild(this.initCheckboxColumn(a));for(var d=0,f=this.getCellHeaderElement(d);f;)f.innerHTML.length>0&&f.classList.add("navColumn"),
e.appendChild(f),f=this.getCellHeaderElement(++d);b.appendChild(e);a.appendChild(b)};a.prototype.renderRow=function(a,b){b.verticalAlign="baseline";b.classList.add("treeTableRow");var e=this.explorer.getNavDict();if(e){e.addRow(a,b);var d=this;b.addEventListener("click",function(b){if(d.explorer.getNavHandler())d.explorer.getNavHandler().onClick(a,b)},!1)}if(e=this.getCheckboxColumn(a,b))e.classList.add("checkColumn"),b.appendChild(e);for(var e=0,f=this.getCellElement(e,a,b);f;)b.appendChild(f),e===
0?this.getPrimColumnStyle?f.classList.add(this.getPrimColumnStyle()):f.classList.add("navColumn"):this.getSecondaryColumnStyle?f.classList.add(this.getSecondaryColumnStyle()):f.classList.add("secondaryColumn"),f=this.getCellElement(++e,a,b)};a.prototype.getCellHeaderElement=function(){};a.prototype.getCellElement=function(){};return a}();d.SimpleFlatModel=function(){function a(c,b,e){this.items=c;this.getKey=e;this.idPrefix=b;this.root={children:c}}a.prototype=new d.ExplorerModel;a.prototype.getRoot=
function(a){a(this.root)};a.prototype.destroy=function(){};a.prototype.getId=function(a){for(var a=this.getKey(a).replace(/[\\\/]/g,""),b="",e=0;e<a.length;e++)b+=a[e].match(/[^\.\:\-\_0-9A-Za-z]/g)?a.charCodeAt(e):a[e];return this.idPrefix+b};a.prototype.getChildren=function(a,b){a===this.root?b(this.items):b([])};return a}();return d});
define("orion/outliner","i18n!orion/nls/messages,orion/Deferred,orion/webui/littlelib,orion/uiUtils,orion/section,orion/explorers/explorer,orion/commands,orion/URITemplate,orion/EventTarget".split(","),function(k,j,i,a,g,h,d,f,c){function b(b,a,c,e){this.explorer=a;this._init(b);this.title=c;this.selectionService=e}function e(a,c,e){this.registry=a;this.renderer=new b({checkbox:!1,treeTableClass:"outlineExplorer"},this,e,c)}function m(b,a){this.items=b;this.root={children:b};this.root.outlinerId=
a;this.idItemMap={}}function n(b){this._init(b)}function r(b){this._serviceRegistry=b.serviceRegistry;this._preferences=b.preferences;c.attach(this);this._serviceRegistration=this._serviceRegistry.registerService("orion.edit.outline",this);this._outlinePref=this._preferences.getPreferences("/edit/outline");this._provider=new j;this._providerResolved=!1}b.prototype=h.SelectionRenderer.prototype;b.prototype.constructor=b;b.prototype.getLabelColumnIndex=function(){return 0};b.prototype.getCellElement=
function(b,a,c){a&&(b=document.createElement("span"),c.appendChild(b),a.className&&b.classList.add(a.className),a.children&&this.getExpandImage(c,b),a.href?this._createLink(a.label,a.href,b):a.line||a.column||a.start?(c=(new f("#{,resource,params*}")).expand({resource:this.title,params:a}),this._createLink(a.label,c,b)):a.label&&b.appendChild(document.createTextNode(a.label)))};b.prototype._createLink=function(b,c,e){var d=document.createElement("a");e.appendChild(d);this.selectionService?d.style.cursor=
"pointer":d.href=c;d.classList.add("navlinkonpage");d.appendChild(document.createTextNode(b));if(this.selectionService){var f=this.selectionService;d.addEventListener("click",function(b){a.openInNewWindow(b)?a.followLink(c,b):f.setSelections(c)},!1)}return d};e.prototype=h.Explorer.prototype;e.prototype.constructor=e;m.prototype.constructor=m;m.prototype.getRoot=function(b){b(this.root)};m.prototype.destroy=function(){};m.prototype.getId=function(b){if(b.outlinerId)return b.outlinerId;var a=b.label.replace(/[\\\/\.\:\-\_]/g,
"");this.idItemMap[a]&&this.idItemMap[a]!==b||i.node(a)?(a=(new Date).getTime().toString(),this.idItemMap[a]=b,b.outlinerId=a):this.idItemMap[a]=b;return a};m.prototype.getChildren=function(b,a){if(b.children){for(var c=0;c<b.children.length;c++)b.children[c].parent=b;a(b.children)}else a([])};m.prototype.doExpansions=function(b){for(var a=0;a<this.root.children.length;a++)this.root.children[a].children&&b.expand(this.root.children[a])};n.prototype={_init:function(b){var a=b.parent,a=i.node(a);if(!a)throw"no parent";
if(!b.outlineService)throw"no outline service";this._parent=a;this._serviceRegistry=b.serviceRegistry;this._outlineService=b.outlineService;this._commandService=b.commandService;this._selectionService=b.selectionService;this._onSelectedProvider=b.onSelectedProvider;var c=this;j.when(c._outlineService,function(b){b.addEventListener("outline",function(b){c.providerId=b.providerId;c._renderHeadingAndMenu(c.outlineProviders);c._renderOutline(b.outline,b.title)})});this._commandService.addCommand(new d.Command({name:k.Switch,
tooltip:k["Switch the type of outliner used"],id:"eclipse.edit.outline.switch",visibleWhen:function(){return!0},choiceCallback:this._menuCallback.bind(this)}))},outlineChanged:function(b,a,c){var e=this;this._serviceRegistry.getService("orion.page.progress").progress(b.getOutline(c,a),"Getting outline for "+a).then(function(b){e._renderOutline(b,a)})},setSelectedProvider:function(b){this.providerId=b.getProperty("id");this.providerName=b.getProperty("name");this._onSelectedProvider&&this._onSelectedProvider(b)},
setOutlineProviders:function(b){this.outlineProviders=b;this._renderHeadingAndMenu(this.outlineProviders)},_renderOutline:function(b,a){i.node("outlinerHeading")||this._renderHeadingAndMenu();var c=i.node("outlineSectionContent");i.empty(c);if(b=b instanceof Array?b:[b])c=new m(b),this.explorer=new e(this._serviceRegistry,this._selectionService,a),this.explorer.createTree("outlineSectionContent",c,{selectionPolicy:"cursorOnly",setFocus:!1}),c.doExpansions(this.explorer.myTree)},_menuCallback:function(){for(var b=
[],a=0;a<this.outlineProviders.length;a++){var c=this.outlineProviders[a],e=c.displayName||c.getProperty("name")||c.name+c.serviceId||"undefined",d=c.getProperty("id")===this.providerId?"* ":"";b.push({name:d+e,callback:this.setSelectedProvider.bind(this,c)})}return b},_renderHeadingAndMenu:function(b){if(!this.outlineSection)this.outlineSection=new g.Section(this._parent,{id:"outlinerHeading",title:k.Outliner,content:'<div id="outlineSectionContent"></div>',useAuxStyle:!0}),this._commandService.registerCommandContribution(this.outlineSection.selectionNode.id,
"eclipse.edit.outline.switch",1);this._commandService.destroy(this.outlineSection.selectionNode.id);b.length>1&&this._commandService.renderCommands(this.outlineSection.selectionNode.id,this.outlineSection.selectionNode.id,{},this,"button")}};n.prototype.constructor=n;r.prototype={setOutlineProviders:function(b){this.providers=b;var a=this;j.when(this._outlinePref,function(c){for(var e,d=0;d<b.length;d++)if(e=b[d],c.get("outlineProvider")===b[d].getProperty("id"))break;e&&a.setProvider(e)})},setProvider:function(b){if(this._providerResolved)this._provider=
new j;this._provider.resolve(b);this._providerResolved=!0;var a=b.getProperty("id");a&&this._outlinePref.then(function(b){b.put("outlineProvider",a)})},getProvider:function(){return this._provider.promise},emitOutline:function(b,a){var c=this;j.when(this.getProvider(),function(e){c._serviceRegistry.getService("orion.page.progress").progress(c._serviceRegistry.getService(e).getOutline(b,a),"Getting outline for "+a+" from "+e.displayName).then(function(b){b&&c.dispatchEvent({type:"outline",outline:b,
title:a,providerId:e.getProperty("id")})})})}};r.prototype.constructor=r;return{Outliner:n,OutlineService:r}});
define("orion/searchUtils","i18n!orion/nls/messages,require,orion/editor/regex,orion/commands,orion/PageUtil,orion/URITemplate".split(","),function(k,j,i,a,g,h){function d(a,b,e){var d="";e&&(d="^");if(d=i.parse("/"+d+a.searchStr+"/"))e=d.pattern,d=d.flags,d.indexOf("i")===-1&&!b.caseSensitive&&(d+="i"),a.regExp={pattern:e,flags:d},a.wildCard=!0}var f=f||{};f.searchUtils=f.searchUtils||{};f.searchUtils.ALL_FILE_TYPE="*.*";f.searchUtils.doSearch=function(a,b,e,d){if(a){var g=!0;e==="*"&&(e="");e===
""&&(g=d&&d.type!==f.searchUtils.ALL_FILE_TYPE);if(g){e!==""&&f.searchUtils.addRecentSearch(b,e,d?d.regEx:!1);var a=a.createSearchParams(e,!1,!1,d),h=f.searchUtils.generateSearchHref(a);f.searchUtils.getOpenSearchPref(b,function(b){b?window.open(h):window.location=h})}}else window.alert(k["Can't search: no search service is available"])};f.searchUtils.generateSearchHelper=function(a,b){var e=a.keyword,g=e,h={};a.fileType&&a.fileType!==f.searchUtils.ALL_FILE_TYPE&&e===""&&(g="*."+a.fileType);if(a.regEx)h.searchStr=
e,d(h,a,b);else{var i=e.indexOf("*")>-1,j=e.indexOf("?")>-1;i&&(e=e.split("*").join(".*"));j&&(e=e.split("?").join("."));!i&&!j&&!a.nameSearch?(h.searchStr=a.caseSensitive?e.split("\\").join(""):e.split("\\").join("").toLowerCase(),h.wildCard=!1):(h.searchStr=a.caseSensitive?e:e.toLowerCase(),d(h,a,b),h.wildCard=!0)}h.searchStrLength=h.searchStr.length;return{params:a,inFileQuery:h,displayedSearchTerm:g}};f.searchUtils.convertSearchParams=function(a){if(a.rows!==void 0)a.rows=parseInt(a.rows);if(a.start!==
void 0)a.start=parseInt(a.start);if(typeof a.regEx==="string")a.regEx=a.regEx.toLowerCase()==="true";if(typeof a.caseSensitive==="string")a.caseSensitive=a.caseSensitive.toLowerCase()==="true";if(typeof a.nameSearch==="string")a.nameSearch=a.nameSearch.toLowerCase()==="true"};f.searchUtils.copySearchParams=function(a,b){var e={},d;for(d in a)if(a[d]!==void 0&&a[d]!==null&&(b||d!=="replace"))e[d]=a[d];return e};f.searchUtils.generateSearchHref=function(a){var b=j.toUrl("search/search.html"),a=f.searchUtils.copySearchParams(a,
!0),e=a.resource;a.resource=void 0;return(new h(b+"#{,resource,params*}")).expand({resource:e,params:a})};f.searchUtils.generateFindURLBinding=function(a,b,e,d){a={find:b.searchStr,regEx:b.wildCard?!0:void 0,caseSensitive:a.caseSensitive?!0:void 0,replaceWith:typeof d==="string"?d:void 0,atLine:typeof e==="number"?e:void 0};return","+(new h("{,params*}")).expand({params:a})};f.searchUtils.convertFindURLBinding=function(a){if(typeof a.regEx==="string")a.regEx=a.regEx.toLowerCase()==="true";if(typeof a.caseSensitive===
"string")a.caseSensitive=a.caseSensitive.toLowerCase()==="true";if(typeof a.atLine==="string")a.atLine=parseInt(a.atLine)};f.searchUtils.replaceRegEx=function(a,b,e){return a.replace(RegExp(b.pattern,b.flags),e)};f.searchUtils.replaceStringLiteral=function(a,b,e){b=i.parse("/"+b+"/gim");return f.searchUtils.replaceRegEx(a,b,e)};f.searchUtils.searchOnelineLiteral=function(a,b,e){var d;d=0;for(var f=!1,g=[];;)if(d=b.indexOf(a.searchStr,d),d<0)break;else{g.push({startIndex:d,length:a.searchStrLength});
f=!0;if(e)break;d+=a.searchStrLength}return f?g:null};f.searchUtils.findRegExp=function(a,b,e,d){if(!b)return null;e=e||"";e+=(e.indexOf("g")===-1?"g":"")+(e.indexOf("m")===-1?"m":"");var f=null;return(f=RegExp(b,e).exec(a.substring(d)))&&{startIndex:f.index+d,length:f[0].length}};f.searchUtils.searchOnelineRegEx=function(a,b,e){for(var d=0,g=!1,h=[];;)if(d=f.searchUtils.findRegExp(b,a.regExp.pattern,a.regExp.flags,d)){h.push(d);g=!0;if(e)break;d=d.startIndex+d.length}else break;return g?h:null};
f.searchUtils.generateNewContents=function(a,b,e,d,g,h){if(d&&b){if(!a)e.contents=[];for(var i=0;i<b.length;i++){for(var j=b[i],k=!1,o=!1,u=[],s,v=0,t=0;t<d.children.length;t++)if(d.children[t].lineNumber-1===i){v=t;for(k=0;k<d.children[t].matches.length;k++)d.children[t+k].checked!==!1&&u.push(k);o=u.length>0;s=d.children[t].matches;k=!0;break}if(k){if(o){u=f.searchUtils.replaceCheckedMatches(j,g,s,u,h);j=u.replacedStr;for(k=0;k<d.children[v].matches.length;k++)d.children[v+k].newMatches=u.newMatches}else for(k=
0;k<d.children[v].matches.length;k++)d.children[v+k].newMatches=d.children[v+k].matches;a?e.contents[i]=j:e.contents.push(j)}else a||e.contents.push(j)}}};f.searchUtils.generateMatchContext=function(a,b,e){var d=[],f=a*2+1,g;b.length<=f?(g=0,a=b.length-1):(g=e-a,g<0?(g=0,a=g+f-1):(a=e+a,a>b.length-1&&(a=b.length-1,g=a-f+1)));for(f=g;f<=a;f++)d.push({context:b[f],current:f===e});return d};f.searchUtils.splitFile=function(a){for(var b=0,e=0,d=0,f=0,g=[];;){b!==-1&&b<=d&&(b=a.indexOf("\r",d));e!==-1&&
e<=d&&(e=a.indexOf("\n",d));if(e===-1&&b===-1){g.push(a.substring(f));break}var h=1;b!==-1&&e!==-1?b+1===e?(h=2,d=e+1):d=(b<e?b:e)+1:d=b!==-1?b+1:e+1;g.push(a.substring(f,d-h));f=d}return g};f.searchUtils.searchWithinFile=function(a,b,e,d,g,h){e=f.searchUtils.splitFile(e);if(g)b.contents=e;if(b){b.children=[];for(var i=d=0;i<e.length;i++){var j=e[i];if(j&&j.length>0){var k=h?j:j.toLowerCase();if(k=a.wildCard?f.searchUtils.searchOnelineRegEx(a,k):f.searchUtils.searchOnelineLiteral(a,k)){var o=i+1;
if(g)for(var u=0;u<k.length;u++){var s=u+1,s={parent:b,checked:b.checked,type:"detail",matches:k,lineNumber:o,matchNumber:s,name:j,location:b.location+"-"+o+"-"+s};b.children.push(s)}else s={parent:b,context:f.searchUtils.generateMatchContext(2,e,i),checked:b.checked,type:"detail",matches:k,lineNumber:o,name:j,location:b.location+"-"+o},b.children.push(s);d+=k.length}}}b.totalMatches=d}};f.searchUtils.replaceCheckedMatches=function(a,b,e,d,f){for(var g=0,h="",i=[],j=0;j<e.length;j++){g!==e[j].startIndex&&
(h+=a.substring(g,e[j].startIndex));if(e[j].length)f=e[j].length;for(var g=!1,k=0;k<d.length;k++)if(d[k]===j){g=!0;break}g?(i.push({startIndex:h.length,length:b.length}),h+=b):(i.push({startIndex:h.length,length:f}),h+=a.substring(e[j].startIndex,e[j].startIndex+f));g=e[j].startIndex+f}g<a.length&&(h+=a.substring(g));return{replacedStr:h,newMatches:i}};f.searchUtils.fullPathNameByMeta=function(a){var b=a.length,e="";if(b>0)for(b-=1;b>-1;b--)e=e+(e===""?"":"/")+a[b].Name;return e};f.searchUtils.path2FolderName=
function(a,b,e){return a.substring(0,a.length-b.length-(e?0:1))};f.searchUtils._storeRecentSearch=function(a,b){a.getService("orion.core.preference").getPreferences("/window/favorites").then(function(a){a.put("recentSearch",b)})};f.searchUtils.addRecentSearch=function(a,b,e){typeof b==="string"&&b&&a.getService("orion.core.preference").getPreferences("/window/favorites").then(function(d){var g,d=d.get("recentSearch");typeof d==="string"&&(d=JSON.parse(d));if(d){for(g in d)if(d[g].name===b)return;
d.length>=20&&d.splice(19,d.length-20+1)}else d=[];d.splice(0,0,{name:b,regEx:e});f.searchUtils._storeRecentSearch(a,d)})};f.searchUtils.getSearches=function(a,b,e){a.getService("orion.core.preference").getPreferences("/window/favorites").then(function(a){a=a.get(b);typeof a==="string"&&(a=JSON.parse(a));a&&e&&e(a)})};f.searchUtils.getMixedSearches=function(a,b,e,d){a.getService("orion.core.preference").getPreferences("/window/favorites").then(function(a){var c,g=a.get("recentSearch");typeof g===
"string"&&(g=JSON.parse(g));if(b)for(c in a=a.get("search"),typeof a==="string"&&(a=JSON.parse(a)),a)if(e){var h=f.searchUtils.parseQueryStr(a[c].query);g.some(function(b){return h.searchStrTitle===b.name})||g.push({name:h.searchStrTitle,label:a[c].name})}else g.push({name:null,label:a[c].name,value:a[c].query});g&&d&&d(g)})};f.searchUtils.getOpenSearchPref=function(a,b){a.getService("orion.core.preference").getPreferences("/cm/configurations").then(function(a){a=a.get("nav.config");b(a&&a["links.newtab"]!==
"undefined"?a["links.newtab"]?!0:!1:!1)})};f.searchUtils.setOpenSearchPref=function(a,b){a.getService("orion.core.preference").getPreferences("/window/favorites").then(function(a){a.put("openSearchPref",{openInNewTab:b})})};return f.searchUtils});
define("orion/searchAndReplace/textSearcher","i18n!orion/search/nls/messages,require,orion/webui/littlelib,orion/editor/annotations,orion/commands,orion/searchUtils".split(","),function(k,j,i,a){var g=g||{};g.TextSearcher=function(){function g(a,f,c,b){this._editor=a;this._commandService=f;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 e=this;this._listeners={onEditorFocus:function(b){e.removeCurrentAnnotation(b)}};this.setOptions(b)}g.prototype={_createActionTable:function(){var d=this;this._commandService.openParameterCollector("pageNavigationActions",function(f){var c=document.createElement("input");c.type="text";c.name=k["Find:"];c.id="localSearchFindWith";c.placeholder=k["Find With"];c.onkeyup=function(b){return d._handleKeyUp(b)};c.onkeydown=
function(b){return d._handleKeyDown(b,!0)};f.appendChild(c);d.createButton("Next",f,function(){d.findNext(!0)});d.createButton("Previous",f,function(){d.findNext(!1)});var b=document.createElement("input");b.type="text";b.name=k["ReplaceWith:"];b.id="localSearchReplaceWith";b.placeholder=k["Replace With"];b.classList.add("searchCmdGroupMargin");b.onkeydown=function(b){return d._handleKeyDown(b,!1)};f.appendChild(b);d.createButton(k.Replace,f,function(){d.replace()});d.createButton(k["Replace All"],
f,function(){d.replaceAll()});b=document.createElement("div");f.appendChild(b);b.classList.add("findOptionsDiv");var e=d._commandService._createDropdownMenu(b,k.Options);e.menuButton.classList.add("findSlideoutMenu");d._commandService._generateCheckedMenuItem(e.menu,k["Show all"],d._showAllOccurrence,function(b){b=b.target.checked;d.setOptions({showAllOccurrence:b});b?d.markAllOccurrences(!0):(b=d._editor.getAnnotationModel())&&b.removeAnnotations(a.AnnotationType.ANNOTATION_MATCHING_SEARCH);e.dropdown.close(!0)});
d._commandService._generateCheckedMenuItem(e.menu,k["Case sensitive"],!d._ignoreCase,function(b){d.setOptions({ignoreCase:!b.target.checked});e.dropdown.close(!0);d.findNext(!0,null,!0)});d._commandService._generateCheckedMenuItem(e.menu,k["Wrap search"],d._wrapSearch,function(b){d.setOptions({wrapSearch:b.target.checked});e.dropdown.close(!0)});d._commandService._generateCheckedMenuItem(e.menu,k["Incremental search"],d._incremental,function(b){d.setOptions({incremental:b.target.checked});e.dropdown.close(!0)});
d._commandService._generateCheckedMenuItem(e.menu,k["Whole Word"],d._wholeWord,function(b){d.setOptions({wholeWord:b.target.checked});e.dropdown.close(!0);d.findNext(!0,null,!0)});d._commandService._generateCheckedMenuItem(e.menu,k["Regular expression"],d._useRegExp,function(b){d.setOptions({useRegExp:b.target.checked});e.dropdown.close(!0);d.findNext(!0,null,!0)});d._commandService._generateCheckedMenuItem(e.menu,k["Find after replace"],d._findAfterReplace,function(b){d.setOptions({findAfterReplace:b.target.checked});
e.dropdown.close(!0)});return c},function(){d.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(a,f){var c=(this.isMac?a.metaKey:a.ctrlKey)&&!a.altKey&&!a.shiftKey;if(c&&a.keyCode===70)return this._keyUpHandled=f,a.stopPropagation&&a.stopPropagation(),a.cancelBubble=!0,!1;
if((this.isMac?a.metaKey:a.ctrlKey)&&!a.altKey&&a.keyCode===75||a.keyCode===13)return a.stopPropagation&&a.stopPropagation(),a.cancelBubble=!0,this.findNext(!a.shiftKey),this._keyUpHandled=f,!1;if(c&&a.keyCode===82)return a.stopPropagation&&a.stopPropagation(),a.cancelBubble=!0,f||this.replace(),this._keyUpHandled=f,!1;return a.keyCode===27?(this.closeUI(),this._keyUpHandled=f,!1):!0},closeUI:function(){this.visible()&&this._commandService.closeParameterCollector();this._editor.getTextView().removeEventListener("Focus",
this._listeners.onEditorFocus);this._editor.getTextView().focus();var d=this._editor.getAnnotationModel();d&&(d.removeAnnotations(a.AnnotationType.ANNOTATION_CURRENT_SEARCH),d.removeAnnotations(a.AnnotationType.ANNOTATION_MATCHING_SEARCH))},removeCurrentAnnotation:function(){var d=this._editor.getAnnotationModel();d&&d.removeAnnotations(a.AnnotationType.ANNOTATION_CURRENT_SEARCH)},createButton:function(a,f,c){var b=document.createElement("span");b.tabIndex=0;b.role="button";b.addEventListener("click",
c.bind(this),!1);var e=this;b.addEventListener("keydown",function(b){b.keyCode===i.KEY.ENTER||b.keyCode===i.KEY.SPACE?c.bind(e)():b.keyCode===i.KEY.ESCAPE&&e.closeUI()});b.appendChild(document.createTextNode(a));b.classList.add("findSlideoutButton");f.appendChild(b)},buildToolBar:function(a,f){this._keyUpHandled=!0;this._editor.getTextView().addEventListener("Focus",this._listeners.onEditorFocus);var c=document.getElementById("localSearchFindWith");if(this.visible())a.length>0?c.value=a:this._noSelection=
!0;else{this._createActionTable();if(typeof f==="string")document.getElementById("localSearchReplaceWith").value=f;c=document.getElementById("localSearchFindWith");c.value=a}window.setTimeout(function(){c.select();c.focus()},10)},setOptions:function(a){if(a){if(a.showAllOccurrence===!0||a.showAllOccurrence===!1)this._showAllOccurrence=a.showAllOccurrence;if(a.ignoreCase===!0||a.ignoreCase===!1)this._ignoreCase=a.ignoreCase;if(a.wrapSearch===!0||a.wrapSearch===!1)this._wrapSearch=a.wrapSearch;if(a.wholeWord===
!0||a.wholeWord===!1)this._wholeWord=a.wholeWord;if(a.incremental===!0||a.incremental===!1)this._incremental=a.incremental;if(a.useRegExp===!0||a.useRegExp===!1)this._useRegExp=a.useRegExp;if(a.findAfterReplace===!0||a.findAfterReplace===!1)this._findAfterReplace=a.findAfterReplace;if(a.reverse===!0||a.reverse===!1)this._reverse=a.reverse;if(a.toolBarId)this._toolBarId=a.toolBarId;if(a.searchRange)this._searchRange=a.searchRange;if(a.searchOnRange===!0||a.searchOnRange===!1)this._searchOnRange=a.searchOnRange}},
getSearchStartIndex:function(a,f){var c=this._editor.getCaretOffset();if(a){var b=this._editor.getSelection(),e=b.end>b.start?b.end-b.start:0;return!f?c-e-1>0?c-e-1:0:b.end>0?b.end:0}return c>0?c:0},findNext:function(a,f,c){this.setOptions({reverse:!a});var b=document.getElementById("localSearchFindWith"),c=this.getSearchStartIndex(c?!0:!a);f||(f=b?b.value:this._lastSearchString);return this._doFind(f,c,!a,this._wrapSearch)},startUndo:function(){this._undoStack&&this._undoStack.startCompoundChange()},
endUndo:function(){this._undoStack&&this._undoStack.endCompoundChange()},_doReplace:function(a,f,c,b){var e=this._editor;if(this._useRegExp){if(c=e.getText().substring(a,f).replace(RegExp(c,this._ignoreCase?"i":""),b))e.setText(c,a,f),e.setSelection(a,a+c.length,!0)}else e.setText(b,a,f),e.setSelection(a,a+b.length,!0)},replace:function(){this.startUndo();var a=document.getElementById("localSearchReplaceWith").value,f=this._editor,c=f.getSelection(),b=document.getElementById("localSearchFindWith").value,
c=c?c.start:0;b&&(f=f.getModel().find({string:b,start:c,reverse:!1,wrap:this._wrapSearch,regex:this._useRegExp,wholeWord:this._wholeWord,caseInsensitive:this._ignoreCase}).next())&&this._doReplace(f.start,f.end,b,a);this.endUndo();this._findAfterReplace&&b&&this._doFind(b,this.getSearchStartIndex(!1),!1,this._wrapSearch)},_doFind:function(d,f,c,b){var e=this._editor,g=e.getAnnotationModel();if(!d)return g&&(g.removeAnnotations(a.AnnotationType.ANNOTATION_CURRENT_SEARCH),g.removeAnnotations(a.AnnotationType.ANNOTATION_MATCHING_SEARCH)),
null;this._lastSearchString=d;var h=e.getModel().find({string:d,start:f,reverse:c,wrap:b,regex:this._useRegExp,wholeWord:this._wholeWord,caseInsensitive:this._ignoreCase}).next();if(!this._replacingAll&&(h?this._editor.reportStatus(""):this._editor.reportStatus(k["Not found"],"error"),this.visible()&&(d=a.AnnotationType.ANNOTATION_CURRENT_SEARCH,g&&(g.removeAnnotations(d),h&&g.addAnnotation(a.AnnotationType.createAnnotation(d,h.start,h.end))),this._showAllOccurrence))){this._timer&&window.clearTimeout(this._timer);
var i=this;this._timer=window.setTimeout(function(){i.markAllOccurrences(h);i._timer=null},500)}h&&e.moveSelection(h.start,h.end,null,!1);return h},replaceAll:function(){var a=document.getElementById("localSearchFindWith").value;if(a){this._replacingAll=!0;var f=this._editor;f.reportStatus("");f.reportStatus(k["Replacing all..."],"progress");var c=document.getElementById("localSearchReplaceWith").value,b=this;window.setTimeout(function(){for(var e=0,g=0;;){if(!b._doFind(a,e))break;g++;g===1&&b.startUndo();
e=f.getSelection();b._doReplace(e.start,e.end,a,c);e=b.getSearchStartIndex(!0,!0)}g>0&&b.endUndo();f.reportStatus("","progress");e>0?f.reportStatus(k["Replaced "]+g+k[" matches"]):f.reportStatus(k["Nothing replaced"],"error");b._replacingAll=!1},100)}},markAllOccurrences:function(d){var f=this._editor.getAnnotationModel();if(f){for(var c=a.AnnotationType.ANNOTATION_MATCHING_SEARCH,b=f.getAnnotations(0,f.getTextModel().getCharCount()),e=[],g;b.hasNext();){var h=b.next();h.type===c&&e.push(h)}b=document.getElementById("localSearchFindWith").value;
if(d&&b){b=this._editor.getModel().find({string:b,regex:this._useRegExp,wholeWord:this._wholeWord,caseInsensitive:this._ignoreCase});for(g=[];b.hasNext();)d=b.next(),g.push(a.AnnotationType.createAnnotation(c,d.start,d.end))}f.replaceAnnotations(e,g)}}};return g}();return g});
define("orion/PageLinks",["require","orion/Deferred","orion/PageUtil","orion/URITemplate","orion/URL-shim"],function(k,j,i,a){function g(g,d){for(var f=g.getServiceReferences(d||"orion.page.link"),c=i.matchResourceParameters(window.location.href),b={OrionHome:(new URL(k.toUrl("."),window.location)).href.slice(0,-1),Location:c.resource},c=[],e=0;e<f.length;e++){for(var m={},n=f[e].getPropertyKeys(),r=0;r<n.length;r++)m[n[r]]=f[e].getProperty(n[r]);if(m.uriTemplate&&m.nls&&(m.name||m.nameKey)){var q=
new j;k(["i18n!"+m.nls],function(c){var e=new a(m.uriTemplate),e=window.decodeURIComponent(e.expand(b)),e=i.validateURLScheme(e);m.href=e;m.textContent=m.nameKey?c[m.nameKey]:m.name;q.resolve(m)});c.push(q)}else if(m.uriTemplate&&m.name)n=new a(m.uriTemplate),n=window.decodeURIComponent(n.expand(b)),n=i.validateURLScheme(n),m.href=n,m.textContent=m.name,c.push((new j).resolve(m))}return j.all(c)}return{createPageLinks:function(a,d){return g(a,d).then(function(a){return a.map(function(a){var b=a.href,
a=a.textContent,e=document.createElement("a");e.href=b;e.target="_self";e.classList.add("targetSelector");e.textContent=a;return e})})},getPageLinksInfo:g}});
define("orion/widgets/UserMenu",["i18n!orion/widgets/nls/messages","require","orion/webui/littlelib","orion/PageLinks"],function(k,j,i,a){function g(a){this._init(a)}g.prototype={_init:function(a){this._dropdownNode=i.node(a.dropdownNode);if(!this._dropdownNode)throw"no dom node for dropdown found";this._dropdown=a.dropdown;this._serviceRegistry=a.serviceRegistry;this.authenticatedServices={};this.unauthenticatedServices={}},isSingleService:function(){return this.length(this.unauthenticatedServices)+
this.length(this.authenticatedServices)===1},hasServices:function(){return this.length(this.unauthenticatedServices)+this.length(this.authenticatedServices)>0},length:function(a){var d=0,f;for(f in a)a.hasOwnProperty(f)&&d++;return d},_makeMenuItem:function(a,d){var f=document.createElement("span");f.role="menuitem";f.tabIndex=0;var c=document.createTextNode(a);f.appendChild(c);f.classList.add("dropdownMenuItem");f.addEventListener("click",d,!1);f.addEventListener("keydown",function(b){(b.keyCode===
i.KEY.ENTER||b.keyCode===i.KEY.SPACE)&&d()},!1);return f},_renderAuthenticatedService:function(a){var d=this,f=this.authenticatedServices[a].authService;if(f&&f.logout){var c=document.createElement("li"),b=this._makeMenuItem(k["Sign Out"],function(){f.logout().then(function(){d.addUserItem(a,f,d.authenticatedServices[a].label);localStorage.removeItem(a);localStorage.removeItem("lastLogin");for(var b=localStorage.length-1;b>=0;b--){var c=localStorage.key(b);c&&c.indexOf("/orion/preferences/user")===
0&&localStorage.removeItem(c)}f.getAuthForm(window.location.href).then(function(b){window.location=b})})});c.appendChild(b);this._dropdownNode.appendChild(c)}},renderServices:function(){function g(a){f[a]||(f[a]=d.createDocumentFragment());return f[a]}var d=document,f=[];a.getPageLinksInfo(this._serviceRegistry,"orion.page.link.user").then(function(a){this._dropdown.empty();a.forEach(function(b){var a=g(typeof b.category==="number"?b.category:1),c=d.createElement("li"),e=d.createElement("a");e.role=
"menuitem";e.classList.add("dropdownMenuItem");e.href=b.href;e.textContent=b.textContent;c.appendChild(e);a.appendChild(c)});if(this.keyAssistFunction){var a=document.createElement("li"),b=this._makeMenuItem(k["Keyboard Shortcuts"],this.keyAssistFunction);b.classList.add("key-assist-menuitem");a.appendChild(b);g(0).appendChild(a)}var e=this;f.sort(function(b,a){return b-a}).forEach(function(b,a){if(a<f.length-1){var c=document.createElement("li");c.classList.add("dropdownSeparator");var d=document.createElement("span");
d.classList.add("dropdownSeparator");c.appendChild(d);b.appendChild(c)}e._dropdownNode.appendChild(b)});if(this.isSingleService())for(var i in this.authenticatedServices)this.authenticatedServices.hasOwnProperty(i)&&this._renderAuthenticatedService(i,0)}.bind(this))},setKeyAssist:function(a){this.keyAssistFunction=a;this.renderServices()},addUserItem:function(a,d,f,c){c?(this.unauthenticatedServices[a]&&delete this.unauthenticatedServices[a],this.authenticatedServices[a]={authService:d,label:f,data:c}):
(this.authenticatedServices[a]&&delete this.authenticatedServices[a],this.unauthenticatedServices[a]=this.unauthenticatedServices[a]?{authService:d,label:f,pending:this.unauthenticatedServices[a].pending}:{authService:d,label:f});this.renderServices()}};g.prototype.constructor=g;return{UserMenu:g}});
define("examples/editor/textStyler",["orion/editor/annotations"],function(k){function j(b,a){this.keywords=b;this.whitespacesVisible=a;this.setText("")}function i(){j.call(this,null,!0)}function a(b){j.call(this,null,b)}function g(){j.call(this,null,!1)}function h(b,e,h){this.commentStart="/*";this.commentEnd="*/";var m=[];switch(e){case "java":m=f;break;case "js":m=d;break;case "css":m=c}this.whitespacesVisible=!1;this.detectHyperlinks=!0;this.highlightCaretLine=!1;this.detectTasks=this.foldingEnabled=
!0;this._scanner=new j(m,this.whitespacesVisible);this._firstScanner=new g;this._commentScanner=new a(this.whitespacesVisible);this._whitespaceScanner=new i;if(e==="css")this._scanner.isCSS=!0,this._firstScanner.isCSS=!0;this.view=b;this.annotationModel=h;this._bracketAnnotations=void 0;var l=this;this._listener={onChanged:function(b){l._onModelChanged(b)},onDestroy:function(b){l._onDestroy(b)},onLineStyle:function(b){l._onLineStyle(b)},onMouseDown:function(b){l._onMouseDown(b)},onSelection:function(b){l._onSelection(b)}};
e=b.getModel();e.getBaseModel&&(e=e.getBaseModel());e.addEventListener("Changed",this._listener.onChanged);b.addEventListener("MouseDown",this._listener.onMouseDown);b.addEventListener("Selection",this._listener.onSelection);b.addEventListener("Destroy",this._listener.onDestroy);b.addEventListener("LineStyle",this._listener.onLineStyle);this._computeComments();this._computeFolding();b.redrawLines()}var d="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(","),
f="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(","),
b={styleClass:"comment"},e={styleClass:"token_multiline_comment"},m={styleClass:"token_doc_comment"},n={styleClass:"token_doc_html_markup"},r={styleClass:"token_task_tag"},q={styleClass:"token_doc_tag"},l={styleClass:"token-string"},p={styleClass:"token_number"},o={styleClass:"token_keyword"},u={styleClass:"token_space"},s={styleClass:"token_tab"},v={styleClass:"line_caret"};j.prototype={getOffset:function(){return this.offset},getStartOffset:function(){return this.startOffset},getData:function(){return this.text.substring(this.startOffset,
this.offset)},getDataLength:function(){return this.offset-this.startOffset},_default:function(b){switch(b){case 32:case 9:if(this.whitespacesVisible)return b===32?11:10;do b=this._read();while(b===32||b===9);this._unread(b);return 9;case 123:case 125:case 40:case 41:case 91:case 93:case 60:case 62:return b;default:var a=this.isCSS,c=this.offset-1;if(!a&&48<=b&&b<=57){var e=a=!1,d=!1,f=b;do if(b=this._read(),b===46&&!a)a=!0;else if(b===101&&!e)a=e=!0,b=this._read(),b!==45&&this._unread(b);else if(b===
120&&f===48&&this.offset-c===2)a=e=d=!0;else if(!(48<=b&&b<=57||d&&(65<=b&&b<=70||97<=b&&b<=102)))break;while(1);this._unread(b);return 3}if(97<=b&&b<=122||65<=b&&b<=90||b===95||45===b&&a){do b=this._read();while(97<=b&&b<=122||65<=b&&b<=90||b===95||48<=b&&b<=57||45===b&&a);this._unread(b);b=this.keywords;if(b.length>0){c=this.text.substring(c,this.offset);for(a=0;a<b.length;a++)if(this.keywords[a]===c)return 2}}return 1}},_read:function(){return this.offset<this.text.length?this.text.charCodeAt(this.offset++):
-1},_unread:function(b){b!==-1&&this.offset--},nextToken:function(){for(this.startOffset=this.offset;;){var b=this._read(),a;switch(b){case -1:return null;case 47:b=this._read();if(!this.isCSS&&b===47)for(;;)if(b=this._read(),b===-1||b===10||b===13)return this._unread(b),6;if(b===42){b=this._read();a=7;for(b===42&&(a=8);;){for(;b===42;)if(b=this._read(),b===47)return a;if(b===-1)return this._unread(b),a;b=this._read()}}this._unread(b);return 1;case 39:for(a=4;;)switch(b=this._read(),b){case 39:return a;
case 13:case 10:case -1:return this._unread(b),a;case 92:switch(b=this._read(),b){case 10:a=5;break;case 13:a=5,b=this._read(),b!==10&&this._unread(b)}}break;case 34:for(a=4;;)switch(b=this._read(),b){case 34:return a;case 13:case 10:case -1:return this._unread(b),a;case 92:switch(b=this._read(),b){case 10:a=5;break;case 13:a=5,b=this._read(),b!==10&&this._unread(b)}}break;default:return this._default(b)}}},setText:function(b){this.text=b;this.startOffset=this.offset=0}};i.prototype=new j(null);i.prototype.nextToken=
function(){for(this.startOffset=this.offset;;){var b=this._read();switch(b){case -1:return null;case 32:return 11;case 9:return 10;default:do b=this._read();while(!(b===32||b===9||b===-1));this._unread(b);return 1}}};a.prototype=new j(null);a.prototype.setType=function(b){this._type=b};a.prototype.nextToken=function(){for(this.startOffset=this.offset;;){var b=this._read();switch(b){case -1:return null;case 32:case 9:if(this.whitespacesVisible)return b===32?11:10;do b=this._read();while(b===32||b===
9);this._unread(b);return 9;case 60:if(this._type===8){do b=this._read();while(!(b===62||b===-1));if(b===62)return 12}return 1;case 64:if(this._type===8){do b=this._read();while(97<=b&&b<=122||65<=b&&b<=90||b===95||48<=b&&b<=57);this._unread(b);return 13}return 1;case 84:if((b=this._read())===79)if((b=this._read())===68)if((b=this._read())===79)if(b=this._read(),!(97<=b&&b<=122||65<=b&&b<=90||b===95||48<=b&&b<=57))return this._unread(b),14;this._unread(b);default:do b=this._read();while(!(b===32||
b===9||b===-1||b===60||b===64||b===84));this._unread(b);return 1}}};g.prototype=new j(null);g.prototype._default=function(b){for(;;)switch(b=this._read(),b){case 47:case 34:case 39:case -1:return this._unread(b),1}};h.prototype={getClassNameForToken:function(a){switch(a){case "singleLineComment":return b.styleClass;case "multiLineComment":return e.styleClass;case "docComment":return m.styleClass;case "docHtmlComment":return n.styleClass;case "tasktag":return r.styleClass;case "doctag":return q.styleClass;
case "string":return l.styleClass;case "number":return p.styleClass;case "keyword":return o.styleClass;case "space":return u.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 b=this.view;
if(b){var a=b.getModel();a.getBaseModel&&(a=a.getBaseModel());a.removeEventListener("Changed",this._listener.onChanged);b.removeEventListener("MouseDown",this._listener.onMouseDown);b.removeEventListener("Selection",this._listener.onSelection);b.removeEventListener("Destroy",this._listener.onDestroy);b.removeEventListener("LineStyle",this._listener.onLineStyle);this.view=null}},setHighlightCaretLine:function(b){this.highlightCaretLine=b},setWhitespacesVisible:function(b){this.whitespacesVisible=b;
this._scanner.whitespacesVisible=b;this._commentScanner.whitespacesVisible=b},setDetectHyperlinks:function(b){this.detectHyperlinks=b},setFoldingEnabled:function(b){this.foldingEnabled=b},setDetectTasks:function(b){this.detectTasks=b},_binarySearch:function(b,a,c,e,d){var f;e===void 0&&(e=-1);if(d===void 0)d=b.length;for(;d-e>1;)if(f=Math.floor((d+e)/2),a<=b[f].start)d=f;else if(c&&a<b[f].end){d=f;break}else e=f;return d},_computeComments:function(){var b=this.view.getModel();b.getBaseModel&&(b=b.getBaseModel());
this.comments=this._findComments(b.getText())},_computeFolding:function(){if(this.foldingEnabled){var b=this.view.getModel();if(b.getBaseModel){var a=this.annotationModel;if(a){a.removeAnnotations(k.AnnotationType.ANNOTATION_FOLDING);for(var c=[],e=b.getBaseModel(),d=this.comments,f=0;f<d.length;f++){var g=d[f];(g=this._createFoldingAnnotation(b,e,g.start,g.end))&&c.push(g)}a.replaceAnnotations(null,c)}}}},_createFoldingAnnotation:function(b,a,c,e){var d=a.getLineAtOffset(c),a=a.getLineAtOffset(e);
return d===a?null:new (k.AnnotationType.getType(k.AnnotationType.ANNOTATION_FOLDING))(c,e,b)},_computeTasks:function(b,a,c){if(this.detectTasks){var e=this.annotationModel;if(e){var d=this.view.getModel(),f=d;d.getBaseModel&&(f=d.getBaseModel());for(var g=e.getAnnotations(a,c),d=[],h=k.AnnotationType.ANNOTATION_TASK;g.hasNext();){var i=g.next();i.type===h&&d.push(i)}g=[];i=this._commentScanner;i.setText(f.getText(a,c));for(var m;m=i.nextToken();){var j=i.getStartOffset()+a;m===14&&(m=f.getLineEnd(f.getLineAtOffset(j)),
b!==6&&(m=Math.min(m,c-this.commentEnd.length)),g.push(k.AnnotationType.createAnnotation(h,j,m,f.getText(j,m))))}e.replaceAnnotations(d,g)}}},_getLineStyle:function(b){if(this.highlightCaretLine){var a=this.view,c=a.getModel(),a=a.getSelection();if(a.start===a.end&&c.getLineAtOffset(a.start)===b)return v}return null},_getStyles:function(b,a,c){b.getBaseModel&&(c=b.mapOffset(c));for(var d=c+a.length,f=[],g=c,h=this.comments,i=this._binarySearch(h,c,!0);i<h.length;i++){if(h[i].start>=d)break;var j=
h[i].start,k=h[i].end;g<j&&this._parse(a.substring(g-c,j-c),g,f);var n=h[i].type,o;switch(n){case 8:o=m;break;case 7:o=e;break;case 5:o=l}g=Math.max(g,j);j=Math.min(d,k);(n===8||n===7)&&(this.whitespacesVisible||this.detectHyperlinks)?this._parseComment(a.substring(g-c,j-c),g,f,o,n):n===5&&this.whitespacesVisible?this._parseString(a.substring(g-c,j-c),g,f,l):f.push({start:g,end:j,style:o});g=k}g<d&&this._parse(a.substring(g-c,d-c),g,f);if(b.getBaseModel)for(a=0;a<f.length;a++)c=f[a].end-f[a].start,
f[a].start=b.mapOffset(f[a].start,!0),f[a].end=f[a].start+c;return f},_parse:function(a,c,d){var f=this._scanner;for(f.setText(a);a=f.nextToken();){var g=f.getStartOffset()+c,h=null;switch(a){case 2:h=o;break;case 3:h=p;break;case 5:case 4:if(this.whitespacesVisible){this._parseString(f.getData(),g,d,l);continue}else h=l;break;case 8:this._parseComment(f.getData(),g,d,m,a);continue;case 6:this._parseComment(f.getData(),g,d,b,a);continue;case 7:this._parseComment(f.getData(),g,d,e,a);continue;case 10:this.whitespacesVisible&&
(h=s);break;case 11:this.whitespacesVisible&&(h=u)}d.push({start:g,end:f.getOffset()+c,style:h})}},_parseComment:function(b,a,c,e,d){var f=this._commentScanner;f.setText(b);for(f.setType(d);b=f.nextToken();){var d=f.getStartOffset()+a,g=e;switch(b){case 10:this.whitespacesVisible&&(g=s);break;case 11:this.whitespacesVisible&&(g=u);break;case 12:g=n;break;case 13:g=q;break;case 14:g=r;break;default:this.detectHyperlinks&&(g=this._detectHyperlinks(f.getData(),d,c,g))}g&&c.push({start:d,end:f.getOffset()+
a,style:g})}},_parseString:function(b,a,c,e){var d=this._whitespaceScanner;for(d.setText(b);b=d.nextToken();){var f=d.getStartOffset()+a,g=e;switch(b){case 10:this.whitespacesVisible&&(g=s);break;case 11:this.whitespacesVisible&&(g=u)}g&&c.push({start:f,end:d.getOffset()+a,style:g})}},_detectHyperlinks:function(b,a,c,e){var d=null,f;if((f=b.indexOf("://"))>0){for(var d=b,g=f;g>0;){f=d.charCodeAt(g-1);if(!(97<=f&&f<=122||65<=f&&f<=90||45===f||48<=f&&f<=57))break;g--}if(g>0&&(f="\"\"''(){}[]<>".indexOf(d.substring(g-
1,g)),f!==-1&&(f&1)===0&&(f=d.lastIndexOf("\"\"''(){}[]<>".substring(f+1,f+2)))!==-1)){var h=f;f=this._clone(e);f.tagName="A";f.attributes={href:d.substring(g,h)};c.push({start:a,end:a+g,style:e});c.push({start:a+g,end:a+h,style:f});c.push({start:a+h,end:a+b.length,style:e});return null}}else b.toLowerCase().indexOf("bug#")===0&&(d="https://bugs.eclipse.org/bugs/show_bug.cgi?id="+parseInt(b.substring(4),10));return d?(f=this._clone(e),f.tagName="A",f.attributes={href:d},f):e},_clone:function(b){if(!b)return b;
var a={},c;for(c in b)b.hasOwnProperty(c)&&(a[c]=b[c]);return a},_findComments:function(b,a){var a=a||0,c=this._firstScanner,e;c.setText(b);for(var d=[];e=c.nextToken();)(e===7||e===8||e===5)&&d.push({start:c.getStartOffset()+a,end:c.getOffset()+a,type:e}),(e===6||e===7||e===8)&&this._computeTasks(e,c.getStartOffset()+a,c.getOffset()+a);return d},_findMatchingBracket:function(b,a){var c="{}()[]<>",e=b.getText(a,a+1),d=c.indexOf(e,0);if(d===-1)return-1;var f;f=d&1?c.substring(d-1,d):c.substring(d+
1,d+2);for(var g=b.getLineAtOffset(a),c=b.getLine(g),h=b.getLineStart(g),i=b.getLineEnd(g),c=this._findBrackets(e,f,c,h,h,i),i=0;i<c.length;i++)if(h=c[i]>=0?1:-1,c[i]*h-1===a){var m=1;if(d&1){for(i--;i>=0;i--)if(h=c[i]>=0?1:-1,m+=h,m===0)return c[i]*h-1;for(g-=1;g>=0;){c=b.getLine(g);h=b.getLineStart(g);i=b.getLineEnd(g);c=this._findBrackets(e,f,c,h,h,i);for(d=c.length-1;d>=0;d--)if(h=c[d]>=0?1:-1,m+=h,m===0)return c[d]*h-1;g--}}else{for(i++;i<c.length;i++)if(h=c[i]>=0?1:-1,m+=h,m===0)return c[i]*
h-1;g+=1;for(d=b.getLineCount();g<d;){c=b.getLine(g);h=b.getLineStart(g);i=b.getLineEnd(g);c=this._findBrackets(e,f,c,h,h,i);for(i=0;i<c.length;i++)if(h=c[i]>=0?1:-1,m+=h,m===0)return c[i]*h-1;g++}}break}return-1},_findBrackets:function(b,a,c,e,d,f){for(var g=[],b=b.charCodeAt(0),a=a.charCodeAt(0),h=d,i=this._scanner,m,j=this.comments,l=this._binarySearch(j,d,!0);l<j.length;l++){if(j[l].start>=f)break;m=j[l].start;var k=j[l].end;if(h<m)for(i.setText(c.substring(h-d,m-d));m=i.nextToken();)m===b?g.push(i.getStartOffset()+
h-d+e+1):m===a&&g.push(-(i.getStartOffset()+h-d+e+1));h=k}if(h<f)for(i.setText(c.substring(h-d,f-d));m=i.nextToken();)m===b?g.push(i.getStartOffset()+h-d+e+1):m===a&&g.push(-(i.getStartOffset()+h-d+e+1));return g},_onDestroy:function(){this.destroy()},_onLineStyle:function(b){if(b.textView===this.view)b.style=this._getLineStyle(b.lineIndex);b.ranges=this._getStyles(b.textView.getModel(),b.lineText,b.lineStart)},_onSelection:function(b){var a=b.oldValue,c=b.newValue,e=this.view,b=e.getModel(),d;if(this.highlightCaretLine){var f=
b.getLineAtOffset(a.start);d=b.getLineAtOffset(c.start);var g=c.start===c.end,a=a.start===a.end;f===d&&a&&g||(a&&e.redrawLines(f,f+1),(f!==d||!a)&&g&&e.redrawLines(d,d+1))}if(this.annotationModel){var a=this._bracketAnnotations,h,i;if(c.start===c.end&&(i=e.getCaretOffset())>0)i-=1,b.getBaseModel&&(i=b.mapOffset(i),b=b.getBaseModel()),b=this._findMatchingBracket(b,i),b!==-1&&(h=[k.AnnotationType.createAnnotation(k.AnnotationType.ANNOTATION_MATCHING_BRACKET,b,b+1),k.AnnotationType.createAnnotation(k.AnnotationType.ANNOTATION_CURRENT_BRACKET,
i,i+1)]);this._bracketAnnotations=h;this.annotationModel.replaceAnnotations(a,h)}},_onMouseDown:function(b){if(b.clickCount===2){var a=this.view,c=a.getModel(),e=a.getOffsetAtLocation(b.x,b.y);if(e>0){var d=e-1,f=c;c.getBaseModel&&(d=c.mapOffset(d),f=c.getBaseModel());d=this._findMatchingBracket(f,d);d!==-1&&(b.preventDefault(),b=d,c.getBaseModel&&(b=c.mapOffset(b,!0)),e>b&&(e--,b++),a.setSelection(b,e))}}},_onModelChanged:function(b){var a=b.start,c=b.removedCharCount,e=b.addedCharCount-c,d=this.view,
b=d.getModel(),f=b.getBaseModel?b.getBaseModel():b,c=a+c,g=f.getCharCount(),h=this.comments.length,i=f.getLineStart(f.getLineAtOffset(a)),m=this._binarySearch(this.comments,i,!0),j=this._binarySearch(this.comments,c,!1,m-1,h);m<h&&this.comments[m].start<=i&&i<this.comments[m].end?(i=this.comments[m].start,i>a&&(i+=e)):i=m===h&&h>0&&g-e===this.comments[h-1].end?this.comments[h-1].start:i;var l;j<h?(l=this.comments[j].end,l>a&&(l+=e),j+=1):(j=h,l=g);for(var n,g=this._findComments(f.getText(i,l),i),
h=m;h<this.comments.length;h++)n=this.comments[h],n.start>a&&(n.start+=e),n.start>a&&(n.end+=e);var o=j-m!==g.length;if(!o)for(h=0;h<g.length;h++){n=this.comments[m+h];var r=g[h];if(n.start!==r.start||n.end!==r.end||n.type!==r.type){o=!0;break}}h=[m,j-m].concat(g);Array.prototype.splice.apply(this.comments,h);o&&(h=i,n=l,b!==f&&(h=b.mapOffset(h,!0),n=b.mapOffset(n,!0)),d.redrawRange(h,n));if(this.foldingEnabled&&f!==b&&this.annotationModel){d=this.annotationModel;m=d.getAnnotations(i,l);i=[];for(l=
[];m.hasNext();)if(n=m.next(),n.type===k.AnnotationType.ANNOTATION_FOLDING){l.push(n);for(h=0;h<g.length;h++)if(n.start===g[h].start&&n.end===g[h].end)break;h===g.length?(i.push(n),n.expand()):(h=n.start,j=n.end,h>a&&(h-=e),j>a&&(j-=e),h<=a&&a<j&&h<=c&&c<j&&(h=f.getLineAtOffset(n.start),j=f.getLineAtOffset(n.end),h!==j?n.expanded||(n.expand(),d.modifyAnnotation(n)):d.removeAnnotation(n)))}a=[];for(h=0;h<g.length;h++){n=g[h];for(e=0;e<l.length;e++)if(l[e].start===n.start&&l[e].end===n.end)break;e===
l.length&&(n=this._createFoldingAnnotation(b,f,n.start,n.end))&&a.push(n)}d.replaceAnnotations(i,a)}}};return{TextStyler:h}});
define("orion/editor/textMateStyler",["orion/editor/regex"],function(k){function j(a,b){var e=b.textView._parent.ownerDocument,d=b._stylesheet=b.util.createElement(e,"style");d.appendChild(e.createTextNode(b._styleSheet(a,"",b.util)));(e.getElementsByTagName("head")[0]||e.documentElement).appendChild(d);b.textView.update(!0)}function i(a,b){var e,d=this;a.getPreferences("/settings",2).then(function(a){if(a.get("JavaScript Editor")!==void 0&&(e=JSON.parse(a.get("JavaScript Editor")))){if(d._stylesheet)d._stylesheet.parentNode.removeChild(d._stylesheet),
d._stylesheet=null;d._update(e,d,b)}})}function a(a,b){for(var e=[],d=0;d<a.length;d++)e[a[d].element]=a[d].value;d=[];d.push("");var f=e.fontFamily,f=f==="sans serif"?'"Menlo", "Consolas", "Vera Mono", "monospace"':"monospace";d.push(b+" .textviewContainer {");d.push("\u0008ackground-color:"+e.background+";");d.push("\tfont-family: "+f+";");d.push("\tfont-size: "+e.fontSize+";");d.push("\tmin-width: 50px;");d.push("\tmin-height: 50px;");d.push("\tcolor: "+e.text+";");d.push("}");d.push(b+" {");d.push("\tfont-family: "+
f+";");d.push("\tfont-size: "+e.fontSize+";");d.push("\tcolor: "+e.text+";");d.push("}");d.push(b+" .textview {");d.push("\tbackground-color: "+e.background+";");d.push("}");d.push(b+".ruler.annotations{");d.push("\tbackground-color: white;");d.push("}");d.push(b+" .ruler {");d.push("\tbackground-color: "+e.annotationRuler+";");d.push("}");d.push(b+" .rulerLines {");d.push("\tcolor: "+e.lineNumber+";");d.push("\tbackground-color: "+e.annotationRuler+";");d.push("}");d.push(b+" .rulerLines.even {");
d.push("\tcolor: "+e.lineNumber+";");d.push("\tbackground-color: "+e.annotationRuler+";");d.push("}");d.push(b+" .rulerLines.odd {");d.push("\tcolor: "+e.lineNumber+";");d.push("\tbackground-color: "+e.annotationRuler+";");d.push("}");d.push(b+" .annotationLine.currentLine {");d.push("\tbackground-color: "+e.currentLine+";");d.push("}");d.push(b+" .entity-name-tag {");d.push("color: "+e.keyword+";");d.push("}");return d.join("\n")}function g(a){var b;if(a instanceof Array){b=Array(a.length);for(var e=
0;e<a.length;e++)b[e]=g(a[e])}else for(e in b={},a)if(Object.prototype.hasOwnProperty.call(a,e)){var d=a[e];b[e]=typeof d==="object"&&d!==null?g(d):d}return b}function h(c,b,e,d,f){this.initialize(c,d);this.grammar=g(b);this.externalGrammars=e?g(e):[];this._styles={};this._tree=null;this._allGrammars={};this.preprocess(this.grammar);this._updateStylesheet=i;this._update=j;this._styleSheet=a;this.util=f}var d,f={unsupported:[{regex:/\(\?[ims\-]:/,func:function(){return"option on/off for subexp"}},
{regex:/\(\?<([=!])/,func:function(a){return a[1]==="="?"lookbehind":"negative lookbehind"}},{regex:/\(\?>/,func:function(){return"atomic group"}}],toRegExp:function(a){function b(b,a){throw Error('Unsupported regex feature "'+b+'": "'+a[0]+'" at index: '+a.index+" in "+a.input);}var e="",d,a=f.processGlobalFlag("x",a,function(b){for(var a="",c=!1,e=b.length,d=0;d<e;){var f=b.charAt(d);if(!c&&f==="#")for(;d<e&&f!=="\r"&&f!=="\n";)f=b.charAt(++d);else if(!c&&/\s/.test(f))for(;d<e&&/\s/.test(f);)f=
b.charAt(++d);else f==="\\"?(a+=f,/\s/.test(b.charAt(d+1))||(a+=b.charAt(d+1),d+=1)):(f==="["?c=!0:f==="]"&&(c=!1),a+=f),d+=1}return a}),a=f.processGlobalFlag("i",a,function(b){e+="i";return b});for(d=0;d<this.unsupported.length;d++){var g;(g=this.unsupported[d].regex.exec(a))&&b(this.unsupported[d].func(g),g)}return RegExp(a,e)},processGlobalFlag:function(a,b,e){function d(b,a){for(var c=0,e=b.length,f=-1,g=a;g<e&&f===-1;g++)switch(b.charAt(g)){case "\\":g++;break;case "(":c++;break;case ")":c--,
c===0&&(f=g)}return f}var f="(?"+a+")",a="(?"+a+":";if(b.substring(0,f.length)===f)return e(b.substring(f.length));else if(b.substring(0,a.length)===a){f=d(b,0);if(f<b.length-1)throw Error("Only a "+a+") group that encloses the entire regex is supported in: "+b);return e(b.substring(a.length,f))}return b},hasBackReference:function(a){return/\\\d+/.test(a.source)},getSubstitutedRegex:function(a,b,e){for(var e=typeof e==="undefined"?!0:!1,a=a.source.split(/(\\\d+)/g),d=[],f=0;f<a.length;f++){var g=
a[f],h=/\\(\d+)/.exec(g);h?(g=b[h[1]]||"",d.push(e?k.escape(g):g)):d.push(g)}return RegExp(d.join(""))},groupify:function(a,b){for(var e=a.source,d=e.length,f=[],g=0,h=[],i=1,j=1,k=[],u={},s={},v=0;v<d;v++){var t=f[f.length-1],y=e.charAt(v);switch(y){case "(":if(t===4)f.pop(),k.push(")"),h[h.length-1].end=v;var x=v+2<d?e.charAt(v+1)+""+e.charAt(v+2):null;if(x==="?:"||x==="?="||x==="?!"){var z;x==="?:"?z=1:(z=3,g++);f.push(z);h.push({start:v,end:-1,type:z});k.push(y);k.push(x);v+=x.length}else f.push(2),
h.push({start:v,end:-1,type:2,oldNum:i,num:j}),k.push(y),g===0&&(s[j]=null),u[i]=j,i++,j++;break;case ")":t=f.pop();t===3&&g--;h[h.length-1].end=v;k.push(y);break;case "*":case "+":case "?":case "}":var I=y,G=e.charAt(v-1),x=v-1;if(y==="}"){for(z=v-1;e.charAt(z)!=="{"&&z>=0;z--);G=e.charAt(z-1);x=z-1;I=e.substring(z,v+1)}z=h[h.length-1];if(G===")"&&(z.type===2||z.type===4)){k.splice(z.start,0,"(");k.push(I);k.push(")");y={start:z.start,end:k.length-1,type:4,num:z.num};for(G=0;G<h.length;G++)if(t=
h[G],(t.type===2||t.type===4)&&t.start>=z.start&&t.end<=x)if(t.start+=1,t.end+=1,t.num+=1,t.type===2)u[t.oldNum]=t.num;h.push(y);j++;break}default:y!=="|"&&t!==2&&t!==4&&g===0&&(f.push(4),h.push({start:v,end:-1,type:4,num:j}),k.push("("),s[j]=null,j++),k.push(y),y==="\\"&&(y=e.charAt(v+1),k.push(y),v+=1)}}for(;f.length;)f.pop(),k.push(")");var e=RegExp(k.join("")),d={},b=b||u,F;for(F in b)b.hasOwnProperty(F)&&(d[F]="\\"+b[F]);e=this.getSubstitutedRegex(e,d,!1);return[e,u,s]},complexCaptures:function(a){if(!a)return!1;
for(var b in a)if(a.hasOwnProperty(b)&&b!=="0")return!0;return!1}};h.prototype={initialize:function(a,b,e){this.textView=a;this.textView.stylerOptions=this;var f=this;this.textView&&b&&b.startup().then(function(b){d=b.preferences;f.preferences=d;f._updateStylesheet(d,e);f.storageKey=d.listenForChangedSettings(f._listener.onStorage)});this._listener={onModelChanged:function(b){f.onModelChanged(b)},onDestroy:function(b){f.onDestroy(b)},onLineStyle:function(b){f.onLineStyle(b)},onStorage:function(b){f.onStorage(b)}};
a.addEventListener("ModelChanged",this._listener.onModelChanged);a.addEventListener("Destroy",this._listener.onDestroy);a.addEventListener("LineStyle",this._listener.onLineStyle);a.redrawLines()},onDestroy:function(){this.destroy()},onStorage:function(a){a.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(a){for(a=[a];a.length!==0;){var b=a.pop();if(!b._resolvedRule||!b._typedRule)if(b._resolvedRule=this._resolve(b),b._typedRule=this._createTypedRule(b),this.addStyles(b.name),this.addStyles(b.contentName),this.addStylesForCaptures(b.captures),this.addStylesForCaptures(b.beginCaptures),this.addStylesForCaptures(b.endCaptures),b._resolvedRule!==
b&&a.push(b._resolvedRule),b.patterns)for(var e=0;e<b.patterns.length;e++)a.push(b.patterns[e])}},addStyles:function(a){if(a&&!this._styles[a]){this._styles[a]=[];for(var b=a.split("."),e=0;e<b.length;e++)this._styles[a].push(b.slice(0,e+1).join("-"))}},addStylesForCaptures:function(a){for(var b in a)a.hasOwnProperty(b)&&this.addStyles(a[b].name)},ContainerRule:function(){function a(b){this.rule=b;this.subrules=b.patterns}a.prototype.valueOf=function(){return"aa"};return a}(),BeginEndRule:function(){function a(b){this.rule=
b;this.beginRegex=f.toRegExp(b.begin);this.endRegex=f.toRegExp(b.end);this.subrules=b.patterns||[];this.endRegexHasBackRef=f.hasBackReference(this.endRegex);var c=f.complexCaptures(b.captures),b=f.complexCaptures(b.beginCaptures)||f.complexCaptures(b.endCaptures);if(this.isComplex=c||b)c=f.groupify(this.beginRegex),this.beginRegex=c[0],this.beginOld2New=c[1],this.beginConsuming=c[2],c=f.groupify(this.endRegex,this.beginOld2New),this.endRegex=c[0],this.endOld2New=c[1],this.endConsuming=c[2]}a.prototype.valueOf=
function(){return this.beginRegex};return a}(),MatchRule:function(){function a(b){this.rule=b;this.matchRegex=f.toRegExp(b.match);if(this.isComplex=f.complexCaptures(b.captures))b=f.groupify(this.matchRegex),this.matchRegex=b[0],this.matchOld2New=b[1],this.matchConsuming=b[2]}a.prototype.valueOf=function(){return this.matchRegex};return a}(),_createTypedRule:function(a){return a.match?new this.MatchRule(a):a.begin?new this.BeginEndRule(a):new this.ContainerRule(a)},_resolve:function(a){var b=a;if(a.include){if(a.begin||
a.end||a.match)throw Error('Unexpected regex pattern in "include" rule '+a.include);a=a.include;if(a.charAt(0)==="#"){if(b=this.grammar.repository&&this.grammar.repository[a.substring(1)],!b)throw Error("Couldn't find included rule "+a+" in grammar repository");}else if(a==="$self")b=this.grammar;else if(a==="$base")throw Error('Include "$base" is not supported');else if(b=this._allGrammars[a],!b)for(var e=0;e<this.externalGrammars.length;e++){var d=this.externalGrammars[e];if(d.scopeName===a){this.preprocess(d);
b=this._allGrammars[a]=d;break}}}return b},ContainerNode:function(){function a(b,c){this.parent=b;this.rule=c;this.children=[];this.end=this.start=null}a.prototype.addChild=function(b){this.children.push(b)};a.prototype.valueOf=function(){var b=this.rule;return"ContainerNode { "+(b.include||"")+" "+(b.name||"")+(b.comment||"")+"}"};return a}(),BeginEndNode:function(){function a(b,c,d){this.parent=b;this.rule=c;this.children=[];this.setStart(d);this.endMatch=this.end=null;this.endRegexSubstituted=
c.endRegexHasBackRef?f.getSubstitutedRegex(c.endRegex,d):null}a.prototype.addChild=function(b){this.children.push(b)};a.prototype.getIndexInParent=function(){return this.parent?this.parent.children.indexOf(this):-1};a.prototype.setStart=function(b){this.start=b.index;this.beginMatch=b};a.prototype.setEnd=function(b){b&&typeof b==="object"?(this.endMatch=b,this.end=b.index+b[0].length):(this.endMatch=null,this.end=b)};a.prototype.shiftStart=function(b){this.start+=b;this.beginMatch.index+=b};a.prototype.shiftEnd=
function(b){this.end+=b;this.endMatch&&(this.endMatch.index+=b)};a.prototype.valueOf=function(){return"{"+this.rule.beginRegex+" range="+this.start+".."+this.end+"}"};return a}(),push:function(a,b){if(b)for(var e=b.length;e>0;)a.push(b[--e])},exec:function(a,b,e){(b=a.exec(b))&&(b.index+=e);a.lastIndex=0;return b},afterMatch:function(a){return a.index+a[0].length},getEndMatch:function(a,b,e){if(a instanceof this.BeginEndNode){var d=a.rule,a=a.endRegexSubstituted||d.endRegex;return!a?null:this.exec(a,
b,e)}return null},initialParse:function(){this.textView.getModel().getCharCount();this._tree=new this.ContainerNode(null,this.grammar._typedRule);this.parse(this._tree,!1,0)},onModelChanged:function(a){var b=a.addedCharCount,e=a.removedCharCount,a=a.start;if(this._tree){var d=this.textView.getModel(),f=d.getCharCount(),d=d.getLineEnd(d.getLineAtOffset(a)-1),g=this.getFirstDamaged(d,d),d=d===-1?0:d,b=g?this.parse(g,!0,d,a,b,e):f;this.textView.redrawRange(d,b)}else this.initialParse()},getFirstDamaged:function(a,
b){if(a<0)return this._tree;for(var e=[this._tree],d=null;e.length;){var f=e.pop();if(!f.parent||this.isDamaged(f,a,b)){f instanceof this.BeginEndNode&&(d=f);for(var g=0;g<f.children.length;g++)e.push(f.children[g])}}return d||this._tree},isDamaged:function(a,b,e){return a.start<=e&&a.end>b},parse:function(a,b,e,d,f,g){var h=this.textView.getModel(),i=h.getLineStart(h.getLineCount()-1),j=h.getCharCount(),k=this.getInitialExpected(a,e),u=-1;if(b)a.repaired=!0,a.endNeedsUpdate=!0,u=(u=a.children[a.children.length-
1])?h.getLineEnd(h.getLineAtOffset(u.end+(f-g))):-1,d=h.getLineEnd(h.getLineAtOffset(d+g)),u=Math.max(u,d);for(var u=u===-1?j:u,d=k,s=a,v=!1,t=e,y=-1;s&&(!b||t<u);){var x=this.getNextMatch(h,s,t);x||(t=t>=i?j:h.getLineStart(h.getLineAtOffset(t)+1));var z=x&&x.match,I=x&&x.rule,G=x&&x.isEnd;if(x&&x.isSub){if(t=this.afterMatch(z),I instanceof this.BeginEndRule)v=!0,b&&I===d.rule&&s===d.parent?(s=d,s.setStart(z),s.repaired=!0,s.endNeedsUpdate=!0,d=this.getNextExpected(d,"begin")):(b&&(this.prune(s,d),
b=!1),z=new this.BeginEndNode(s,I,z),s.addChild(z),s=z)}else if(G||t===j){if(s instanceof this.BeginEndNode)z?(v=!0,y=Math.max(y,s.end),s.setEnd(z),t=this.afterMatch(z),b&&s===d&&s.parent===d.parent?(s.repaired=!0,delete s.endNeedsUpdate,d=this.getNextExpected(d,"end")):b&&(this.prune(s,d),b=!1)):(s.setEnd(j),delete s.endNeedsUpdate);s=s.parent}b&&t>=u&&!v&&(this.prune(a,k),b=!1)}this.removeUnrepairedChildren(a,b,e);this.cleanup(b,a,e,u,j,f,g);return b?Math.max(y,t):t},removeUnrepairedChildren:function(a,
b,e){if(b){for(var b=a.children,d=-1,f=0;f<b.length;f++){var g=b[f];if(!g.repaired&&this.isDamaged(g,e,Number.MAX_VALUE)){d=f;break}}if(d!==-1)a.children.length=d}},cleanup:function(a,b,d,f,g,h,i){if(a){a=h-i;g=this.getIntersecting(f-a+1,g);b=this.getIntersecting(d,f);for(d=0;d<g.length;d++)f=g[d],!f.repaired&&f instanceof this.BeginEndNode&&(f.shiftEnd(a),f.shiftStart(a));for(d=0;d<b.length;d++)f=b[d],f.repaired&&f.endNeedsUpdate&&f.shiftEnd(a),delete f.endNeedsUpdate,delete f.repaired}else{b=this.getIntersecting(d,
f);for(d=0;d<b.length;d++)delete b[d].repaired}},getNextMatch:function(a,b,d,f){var g=a.getLineAtOffset(d),g=a.getLineEnd(g),h=a.getText(d,g),i=[],j=[],a=[],g=[];for(this.push(i,b.rule.subrules);i.length;){var k=i.length?i.pop():null,k=k&&k._resolvedRule._typedRule;if(k instanceof this.ContainerRule&&j.indexOf(k)===-1)j.push(k),this.push(i,k.subrules);else if(!k||!f||k.matchRegex){var o=k&&this.exec(k.matchRegex||k.beginRegex,h,d);o&&(a.push(o),g.push(k))}}i=Number.MAX_VALUE;j=-1;for(k=0;k<a.length;k++)if(o=
a[k],o.index<i)i=o.index,j=k;if(!f&&(d=this.getEndMatch(b,h,d)))if(f=b.rule.applyEndPatternLast,j===-1||d.index<i||!f&&d.index===i)return{isEnd:!0,rule:b.rule,match:d};return j===-1?null:{isSub:!0,rule:g[j],match:a[j]}},getInitialExpected:function(a,b){var d,f;if(a===this._tree)for(d=0;d<a.children.length;d++){if(f=a.children[d],f.start>=b)return f}else if(a instanceof this.BeginEndNode&&a.endMatch){var g=a.endMatch.index;for(d=0;d<a.children.length;d++)if(f=a.children[d],f.start>=b)break;if(f&&f.start<
g)return f}return a},getNextExpected:function(a,b){if(b==="begin"){var d=a.children[0];return d?d:a}else if(b==="end"&&(d=a.parent)){var f=d.children[d.children.indexOf(a)+1];return f?f:d}return null},prune:function(a,b){if(b.parent===a)a.children.length=b.getIndexInParent();else if(a instanceof this.BeginEndNode)a.endMatch=null,a.end=null;if(a.parent)a.parent.children.length=a.getIndexInParent()+1},onLineStyle:function(a){this._tree||this.initialParse();var b=a.lineStart,d=this.textView.getModel(),
f=d.getLineEnd(a.lineIndex),g=d.getLineEnd(d.getLineAtOffset(b)-1),g=this.getFirstDamaged(g,g),b=this.getLineScope(d,g,b,f);a.ranges=this.toStyleRanges(b);a.ranges.sort(function(b,a){return b.start-a.start})},getLineScope:function(a,b,d,f){for(var g=d,h=this.getInitialExpected(b,d),i=[],j=[];b&&g<f;){var k=this.getNextMatch(a,b,g);if(!k)break;var o=k&&k.match,u=k&&k.rule,s=k&&k.isSub,k=k&&k.isEnd;o.index!==g&&j.push({start:g,end:o.index,node:b});if(s)g=this.afterMatch(o),u instanceof this.BeginEndRule?
(this.addBeginScope(i,o,u),b=h,h=this.getNextExpected(h,"begin")):this.addMatchScope(i,o,u);else if(k)g=this.afterMatch(o),this.addEndScope(i,o,u),h=this.getNextExpected(h,"end"),b=b.parent}g<f&&j.push({start:g,end:f,node:b});a=this.getInheritedLineScope(j,d,f);return i.concat(a)},getInheritedLineScope:function(a){for(var b=[],d=0;d<a.length;d++)for(var f=a[d],g=f.node;g;){var h=g.rule.rule,i=h.name;if(h=h.contentName||i){this.addScopeRange(b,f.start,f.end,h);break}g=g.parent}return b},addBeginScope:function(a,
b,d){var f=d.rule;this.addCapturesScope(a,b,f.beginCaptures||f.captures,d.isComplex,d.beginOld2New,d.beginConsuming)},addEndScope:function(a,b,d){var f=d.rule;this.addCapturesScope(a,b,f.endCaptures||f.captures,d.isComplex,d.endOld2New,d.endConsuming)},addMatchScope:function(a,b,d){var f=d.rule,g=f.name;(f=f.captures)?this.addCapturesScope(a,b,f,d.isComplex,d.matchOld2New,d.matchConsuming):this.addScope(a,b,g)},addScope:function(a,b,d){d&&a.push({start:b.index,end:this.afterMatch(b),scope:d})},addScopeRange:function(a,
b,d,f){f&&a.push({start:b,end:d,scope:f})},addCapturesScope:function(a,b,d,f,g,h){if(d)if(f){for(var f={1:0},i=0,j=1;b[j]!==void 0;j++)h[j]!==void 0&&(i+=b[j].length),b[j+1]!==void 0&&(f[j+1]=i);h=b.index;for(i=1;d[i];i++){var j=d[i].name,k=g[i],o=h+f[k];typeof b[k]!=="undefined"&&this.addScopeRange(a,o,o+b[k].length,j)}}else this.addScope(a,b,d[0]&&d[0].name)},getIntersecting:function(a,b){for(var d=[],f=this._tree?[this._tree]:[];f.length;){var g=f.pop(),h=!1;g instanceof this.ContainerNode?h=!0:
this.isDamaged(g,a,b)&&(h=!0,d.push(g));if(h)for(var h=g.children.length,i=0;i<h;i++)f.push(g.children[i])}return d.reverse()},toStyleRanges:function(a){for(var b=[],d=0;d<a.length;d++){var f=a[d],g=this._styles[f.scope];if(!g)throw Error("styles not found for "+f.scope);g=g.join(" ");b.push({start:f.start,end:f.end,style:{styleClass:g}})}return b}};return{RegexUtil:f,TextMateStyler:h}});
define("orion/editor/AsyncStyler",["i18n!orion/editor/nls/messages","orion/editor/annotations"],function(k,j){function i(a){return a.getProperty("objectClass").indexOf(g)!==-1&&a.getProperty("type")==="highlighter"}function a(a,f,c){this.initialize(a,f,c);this.lineStyles=[]}var g="orion.edit.highlighter",h=g+" service must be an event emitter";j.AnnotationType.registerType("orion.annotation.highlightError",{title:k.syntaxError,html:"<div class='annotationHTML error'></div>",rangeStyle:{styleClass:"annotationRange error"}});
a.prototype={initialize:function(a,f,c){this.textView=a;this.serviceRegistry=f;this.annotationModel=c;this.services=[];var b=this;this.listener={onModelChanging:function(a){b.onModelChanging(a)},onModelChanged:function(a){b.onModelChanged(a)},onDestroy:function(a){b.onDestroy(a)},onLineStyle:function(a){b.onLineStyle(a)},onStyleReady:function(a){b.onStyleReady(a)},onServiceAdded:function(a){b.onServiceAdded(a.serviceReference,b.serviceRegistry.getService(a.serviceReference))},onServiceRemoved:function(a){b.onServiceRemoved(a.serviceReference,
b.serviceRegistry.getService(a.serviceReference))}};a.addEventListener("ModelChanging",this.listener.onModelChanging);a.addEventListener("ModelChanged",this.listener.onModelChanged);a.addEventListener("Destroy",this.listener.onDestroy);a.addEventListener("LineStyle",this.listener.onLineStyle);f.addEventListener("registered",this.listener.onServiceAdded);f.addEventListener("unregistering",this.listener.onServiceRemoved);a=f.getServiceReferences(g);for(c=0;c<a.length;c++){var e=a[c];i(e)&&this.addServiceListener(f.getService(e))}},
onDestroy:function(){this.destroy()},destroy:function(){if(this.textView)this.textView.removeEventListener("ModelChanging",this.listener.onModelChanging),this.textView.removeEventListener("ModelChanged",this.listener.onModelChanged),this.textView.removeEventListener("Destroy",this.listener.onDestroy),this.textView.removeEventListener("LineStyle",this.listener.onLineStyle),this.textView=null;if(this.services){for(var a=0;a<this.services.length;a++)this.removeServiceListener(this.services[a]);this.services=
null}if(this.serviceRegistry)this.serviceRegistry.removeEventListener("registered",this.listener.onServiceAdded),this.serviceRegistry.removeEventListener("unregistering",this.listener.onServiceRemoved),this.serviceRegistry=null;this.lineStyles=this.listener=null},onModelChanging:function(a){this.startLine=this.textView.getModel().getLineAtOffset(a.start)},onModelChanged:function(a){var f=this.startLine;(a.addedLineCount||a.removedLineCount)&&Array.prototype.splice.apply(this.lineStyles,[f,a.removedLineCount].concat(this._getEmptyStyle(a.addedLineCount)))},
onStyleReady:function(a){var f=a.lineStyles||a.style,a=Number.MAX_VALUE,c=-1,b=this.textView.getModel(),e;for(e in f)f.hasOwnProperty(e)&&(this.lineStyles[e]=f[e],a=Math.min(a,e),c=Math.max(c,e));a=Math.max(a,0);c=Math.min(c,b.getLineCount());if(f=this.annotationModel){for(var g=f.getAnnotations(b.getLineStart(a),b.getLineEnd(c)),h=[];g.hasNext();){var i=g.next();i.type==="orion.annotation.highlightError"&&h.push(i)}g=[];for(i=a;i<=c;i++){e=i;var k=this.lineStyles[e],k=k&&k.errors;e=b.getLineStart(e);
if(k)for(var l=0;l<k.length;l++){var p=k[l];g.push(j.AnnotationType.createAnnotation("orion.annotation.highlightError",p.start+e,p.end+e))}}f.replaceAnnotations(h,g)}this.textView.redrawLines(a,c+1)},onLineStyle:function(a){function f(b,a){for(var c=b.length,d=[],f=0;f<c;f++){var g=b[f];d.push({start:g.start+a,end:g.end+a,style:g.style})}return d}var c=this.lineStyles[a.lineIndex];if(c)if(c.ranges)a.ranges=f(c.ranges,a.lineStart);else if(c.style)a.style=c.style},_getEmptyStyle:function(a){for(var f=
[],c=0;c<a;c++)f.push(null);return f},setContentType:function(a){this.contentType=a;if(this.services)for(a=0;a<this.services.length;a++){var f=this.services[a];if(f.setContentType){var c=this.serviceRegistry.getService("orion.page.progress");c?c.progress(f.setContentType(this.contentType),"Styling content type: "+this.contentType.id?this.contentType.id:this.contentType):f.setContentType(this.contentType)}}},onServiceAdded:function(a,f){i(a)&&this.addServiceListener(f)},onServiceRemoved:function(a,
f){this.services.indexOf(f)!==-1&&this.removeServiceListener(f)},addServiceListener:function(a){if(typeof a.addEventListener==="function"){if(a.addEventListener("orion.edit.highlighter.styleReady",this.listener.onStyleReady),this.services.push(a),a.setContentType&&this.contentType){var f=this.serviceRegistry.getService("orion.page.progress");f?f.progress(a.setContentType(this.contentType),"Styling content type: "+this.contentType.id?this.contentType.id:this.contentType):a.setContentType(this.contentType)}}else typeof console!==
"undefined"&&console.log(Error(h))},removeServiceListener:function(a){typeof a.removeEventListener==="function"?(a.removeEventListener("orion.edit.highlighter.styleReady",this.listener.onStyleReady),a=this.services.indexOf(a),a!==-1&&this.services.splice(a,1)):typeof console!=="undefined"&&console.log(Error(h))}};return a});
define("examples/editor/textStylerOptions",["orion/bootstrap","orion/editor/util"],function(k,j){function i(g){this._styler=g;this._view=this._styler.view;this._view.stylerOptions=this;var h=this;this._listener={onStorage:function(a){h._onStorage(a)}};var d=this;this._view&&k.startup().then(function(f){a=f.preferences;d.preferences=a;d._updateStylesheet(a);d.storageKey=a.listenForChangedSettings(d._listener.onStorage)})}var a;i.prototype={_getSetting:function(a,h,d){for(var f,c=0;c<a.length;c++)if(a[c].label===
h)for(var b=0;b<a[c].data.length;b++)if(a[c].data[b].label===d){f=a[c].data[b].value;break}return f},_styleSheet:function(a,h){function d(a,c){var d=e.getClassNameForToken(a);if(d){var g=f[c];b.push("."+h+" ."+d+" {");b.push("\tcolor: "+g+";");b.push("}")}}for(var f=[],c=0;c<a.length;c++)f[a[c].element]=a[c].value;var b=[];b.push("");c=f.fontFamily;c=c==="sans serif"?'"Menlo", "Consolas", "Vera Mono", "monospace"':"monospace";b.push("."+h+" {");b.push("\tfont-family: "+c+";");b.push("\tfont-size: "+
f.fontSize+";");b.push("\tcolor: "+f.text+";");b.push("}");b.push("."+h+" .textview {");b.push("\tbackground-color: "+f.background+";");b.push("}");b.push("."+h+".ruler.annotations{");b.push("\tbackground-color: red;");b.push("}");b.push("."+h+" .ruler {");b.push("\tbackground-color: "+f.annotationRuler+";");b.push("}");b.push("."+h+" .rulerLines {");b.push("\tcolor: "+f.lineNumber+";");b.push("\tbackground-color: "+f.annotationRuler+";");b.push("}");b.push("."+h+" .rulerLines.even {");b.push("\tcolor: "+
f.lineNumber+";");b.push("\tbackground-color: "+f.annotationRuler+";");b.push("}");b.push("."+h+" .rulerLines.odd {");b.push("\tcolor: "+f.lineNumber+";");b.push("\tbackground-color: "+f.annotationRuler+";");b.push("}");b.push("."+h+" .annotationLine.currentLine {");b.push("\tbackground-color: "+f.currentLine+";");b.push("}");var e=this._styler;e.getClassNameForToken&&(d("keyword","keyword"),d("string","string"),d("singleLineComment","comment"),d("multiLineComment","comment"),d("docComment","comment"),
d("docHtmlComment","comment"));return b.join("\n")},_onStorage:function(a){a.key===this.storageKey&&this._updateStylesheet(this.preferences)},_update:function(a,h,d){if(a){if(h._stylesheet)h._stylesheet.parentNode.removeChild(h._stylesheet),h._stylesheet=null;var f=h._view,c=f.getOptions("parent").ownerDocument,b=h._stylesheet=j.createElement(c,"style");b.appendChild(c.createTextNode(h._styleSheet(a,"userTheme",d)));(c.getElementsByTagName("head")[0]||c.documentElement).appendChild(b);a={themeClass:null};
f.getOptions(a);(h=a.themeClass)?((h=h.replace("userTheme",""))&&(h+=" "),h+="userTheme"):h="userTheme";a.themeClass=h;f.setOptions(a);f.update(!0)}},_updateStylesheet:function(a,h){var d,f=this;a.getPreferences("/settings",2).then(function(a){a.get("JavaScript Editor")!==void 0&&(d=JSON.parse(a.get("JavaScript Editor")),f._update(d,f,h))})}};return{TextStylerOptions:i}});
define("orion/highlight","examples/editor/textStyler,orion/editor/textMateStyler,orion/editor/AsyncStyler,examples/editor/textStylerOptions,orion/bootstrap,orion/editor/util,orion/Deferred".split(","),function(k,j,i,a,g,h,d){function f(b,c,f,n,r,q,l){function p(b,a){var g=b.getProperty("contentType"),h=b.getProperty("fileTypes");if(g)return c.isSomeExtensionOf(f,g).then(function(a){return a?b:null});else if(a&&h&&h.indexOf(a)!==-1)return g=new d,g.resolve(b),g;return null}var o=function(b){var c=
null;switch(b&&b.id){case "application/javascript":case "application/json":c=new k.TextStyler(n,"js",r);break;case "text/x-java-source":c=new k.TextStyler(n,"java",r);break;case "text/css":c=new k.TextStyler(n,"css",r)}c&&new a.TextStylerOptions(c);return c}(f);if(o)return q=new d,q.resolve(o),q;for(var o=q&&q.split(".").pop().toLowerCase(),q=b.getServiceReferences("orion.edit.highlighter"),u=[],s=[],v=0;v<q.length;v++){var t=q[v];t.getProperty("type")==="grammar"&&u.push(t.getProperty("grammar"));
(t=p(t,o))&&s.push(t)}return d.all(s,function(b){return{_error:b}}).then(function(a){for(var c,d=a.length-1;d>=0;d--){var e=a[d];if(e&&!e._error&&(l||e.getProperty("type")!=="highlighter")){c=e;break}}var k;if(c)if(a=c.getProperty("type"),a==="highlighter")k=new i(n,b,r),k.setContentType(f);else if(a==="grammar"||typeof a==="undefined")c=c.getProperty("grammar"),k=new j.TextMateStyler(n,c,u,g,h);return k})}function c(b){this.serviceRegistry=b;this.styler=null}c.prototype={setup:function(b,a,c,d,g){g=
typeof g==="undefined"?!0:g;if(this.styler)this.styler.destroy&&this.styler.destroy(),this.styler=null;var h=this;return f(this.serviceRegistry,this.serviceRegistry.getService("orion.core.contenttypes"),b,a,c,d,g).then(function(b){return h.styler=b})},getStyler:function(){return this.styler}};return{createStyler:f,SyntaxHighlighter:c}});
define("orion/i18nUtil",["require","orion/Deferred"],function(k,j){function i(a){if(a=localStorage.getItem("orion/messageBundle/"+a))if(a=JSON.parse(a),a._expires&&a._expires>(new Date).getTime())return delete a._expires,a;return null}var a={};return{getMessageBundle:function(g){function h(){k(["i18n!"+g],function(b){if(b){var a=g;b._expires=(new Date).getTime()+9E5;localStorage.setItem("orion/messageBundle/"+a,JSON.stringify(b));delete b._expires}d.resolve(b)})}if(a[g])return a[g];var d=new j;a[g]=
d;var f=i(g);if(f)return d.resolve(f),d;try{k([g],h)}catch(c){k(["orion/i18n!"+g],h)}return d},formatMessage:function(a){var h=arguments;return a.replace(/\$\{([^\}]+)\}/g,function(a,f){return h[(f<<0)+1]})}}});
define("orion/fileClient",["i18n!orion/navigate/nls/messages","orion/Deferred","orion/i18nUtil"],function(k,j,i){function a(a,f,c){if(!a[f])throw f+k[" is not supported in this file system"];return a[f].apply(a,c)}function g(d,f,c,b){if(!d.readBlob)throw k["source file service does not support binary read"];if(!c.writeBlob)throw k["target file service does not support binary write"];if(f[f.length-1]!=="/")return a(d,"readBlob",[f]).then(function(d){return a(c,"writeBlob",[b,d])});var e=b.substring(0,
b.length-1),h=decodeURIComponent(e.substring(e.lastIndexOf("/")+1)),e=e.substring(0,e.lastIndexOf("/")+1);return a(c,"createFolder",[e,h]).then(function(){},function(){}).then(function(){return a(d,"fetchChildren",[f]).then(function(a){for(var e=[],f=0;f<a.length;++f){var h=a[f].Location,i=h;a[f].Directory&&(i=h.substring(0,h.length-1));i=decodeURIComponent(i.substring(i.lastIndexOf("/")+1));i=b+encodeURIComponent(i);a[f].Directory&&(i+="/");e[f]=g(d,h,c,i)}return j.all(e)})})}function h(a,f){function c(b){var a=
new j;a.reject(k["No Matching FileService for location:"]+b);return a}var b=a.getServiceReferences("orion.core.file"),e=b;if(f)for(var e=[],g=0;g<b.length;++g)f(b[g])&&e.push(b[g]);for(var h=[],r=[],q=[],l=[],p={fetchChildren:function(){var b=new j;b.resolve(l);return b},createWorkspace:function(){var b=new j;b.reject(k["no file service"]);return b},loadWorkspaces:function(){var b=new j;b.reject(k["no file service"]);return b},loadWorkspace:function(){var b=new j;window.setTimeout(function(){b.resolve({Directory:!0,
Length:0,LocalTimeStamp:0,Name:k["File Servers"],Location:"/",Children:l,ChildrenLocation:"/"})},100);return b},search:c,createProject:c,createFolder:c,createFile:c,deleteFile:c,moveFile:c,copyFile:c,read:c,write:c},b=0;b<e.length;++b)l[b]={Directory:!0,Length:0,LocalTimeStamp:0,Location:e[b].getProperty("top"),ChildrenLocation:e[b].getProperty("top"),Name:e[b].getProperty("Name")},g=e[b].getProperty("pattern")||".*",g[0]!=="^"&&(g="^"+g),h[b]=RegExp(g),r[b]=a.getService(e[b]),q[b]=e[b].getProperty("Name"),
e[b].getProperty("NameKey")&&e[b].getProperty("nls")&&i.getMessageBundle(e[b].getProperty("nls")).then(function(b,a){l[b].Name=a[e[b].getProperty("NameKey")];q[b]=a[e[b].getProperty("NameKey")]}.bind(this,b));this._getServiceIndex=function(b){if(b==="/")return-1;else if(!b||b.length&&b.length===0)return r[0]?0:-1;for(var a=0;a<h.length;++a)if(h[a].test(b))return a;throw k["No Matching FileService for location:"]+b;};this._getService=function(b){b=this._getServiceIndex(b);return b===-1?p:r[b]};this._getServiceName=
function(b){b=this._getServiceIndex(b);return b===-1?p.Name:q[b]};this._getServiceRootURL=function(b){b=this._getServiceIndex(b);return b===-1?p.Location:l[b].Location}}h.prototype={getService:function(a){return this._getService(a)},fileServiceName:function(a){return this._getServiceName(a)},fileServiceRootURL:function(a){return this._getServiceRootURL(a)},fetchChildren:function(d){return a(this._getService(d),"fetchChildren",arguments)},createWorkspace:function(d){return a(this._getService(),"createWorkspace",
arguments)},loadWorkspaces:function(){return a(this._getService(),"loadWorkspaces",arguments)},loadWorkspace:function(d){return a(this._getService(d),"loadWorkspace",arguments)},createProject:function(d,f,c,b){return a(this._getService(d),"createProject",arguments)},createFolder:function(d,f){return a(this._getService(d),"createFolder",arguments)},createFile:function(d,f){return a(this._getService(d),"createFile",arguments)},deleteFile:function(d){return a(this._getService(d),"deleteFile",arguments)},
moveFile:function(d,f,c){var b=this._getService(d),e=this._getService(f);if(b===e)return a(b,"moveFile",arguments);var h=d[d.length-1]==="/",i=f;i[i.length-1]!=="/"&&(i+="/");if(c)i+=encodeURIComponent(c);else{var j=d;h&&(j=j.substring(0,j.length-1));i+=j.substring(j.lastIndexOf("/")+1)}h&&i[i.length-1]!=="/"&&(i+="/");return g(b,d,e,i).then(function(){return a(b,"deleteFile",[d])})},copyFile:function(d,f,c){var b=this._getService(d),e=this._getService(f);if(b===e)return a(b,"copyFile",arguments);
var h=d[d.length-1]==="/",i=f;i[i.length-1]!=="/"&&(i+="/");if(c)i+=encodeURIComponent(c);else{var j=d;h&&(j=j.substring(0,j.length-1));i+=j.substring(j.lastIndexOf("/")+1)}h&&i[i.length-1]!=="/"&&(i+="/");return g(b,d,e,i)},read:function(d,f){return a(this._getService(d),"read",arguments)},write:function(d,f,c){return a(this._getService(d),"write",arguments)},remoteImport:function(d,f){return a(this._getService(d),"remoteImport",arguments)},remoteExport:function(d,f){return a(this._getService(d),
"remoteExport",arguments)},search:function(d){return a(this._getService(d.resource),"search",arguments)}};h.prototype.constructor=h;return{FileClient:h}});
define("orion/crawler/searchCrawler","i18n!orion/crawler/nls/messages,require,orion/i18nUtil,orion/searchUtils,orion/contentTypes,orion/Deferred".split(","),function(k,j,i,a,g,h){function d(d,c,b,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=b;this.searchHelper=this._searchOnName||
this._buildSkeletonOnly?null:a.generateSearchHelper(b);this._location=e&&e.location;this._childrenLocation=e&&e.childrenLocation?e.childrenLocation:this._location}d.prototype.search=function(a){var c=this.registry.getService("orion.core.contenttypes");this._onSearchComplete=a;var b=this;this.registry.getService("orion.page.dialog").confirm(k["The search term on this location will not use indexed files."]+"\n"+k["It will take longer time. Do you want to proceed?"],function(a){a&&c.getContentTypes().then(function(a){b.contentTypesCache=
a;b._visitRecursively(b._childrenLocation).then(function(){b._sort(b.fileLocations);b._onSearchComplete({response:{numFound:b.fileLocations.length,docs:b.fileLocations}})})})})};d.prototype.searchName=function(d,c){if(d)this.searchHelper=a.generateSearchHelper(d,!0);if(c)this.onSearchNameComplete=c;var b=[];this._sort(this.fileSkeleton);if(this.fileSkeleton.length>0){for(var e=0;e<this.fileSkeleton.length;e++){var g=this.fileSkeleton[e].Name.toLowerCase();if(this.searchHelper.inFileQuery.wildCard?
a.searchOnelineRegEx(this.searchHelper.inFileQuery,g,!0):a.searchOnelineLiteral(this.searchHelper.inFileQuery,g,!0))if(b.push(this.fileSkeleton[e]),b.length>=this.searchHelper.params.rows)break}this.onSearchNameComplete({response:{numFound:b.length,docs:b}})}};d.prototype.buildSkeleton=function(a,c){this._buildingSkeleton=!0;var b=this.registry.getService("orion.core.contenttypes"),d=this;a();b.getContentTypes().then(function(b){d.contentTypesCache=b;d._visitRecursively(d._childrenLocation).then(function(){d._buildingSkeleton=
!1;c();d.searchHelper&&!d._buildSkeletonOnly&&d.searchName()})})};d.prototype._searchCompleted=function(){console.log("Search Completed.")};d.prototype._searchFiles=function(){var a=[],c;if(this.fileLocations.length>0){c=this;for(var b=0;b<c.fileLocations.length;b++)a.push(c._sniffSearch(c.fileLocations[b]))}return h.all(a)};d.prototype._sort=function(a){a.sort(function(a,b){var d=a.Name&&a.Name.toLowerCase(),f=b.Name&&b.Name.toLowerCase();return d<f?-1:d>f?1:0})};d.prototype._onFileType=function(d){return this.searchHelper.params.fileType?
this.searchHelper.params.fileType===a.ALL_FILE_TYPE?!0:d.extension.indexOf(this.searchHelper.params.fileType)>=0:!0};d.prototype._visitRecursively=function(a){var c=[],b=this;this._fetchChildrenCallBack&&this._fetchChildrenCallBack(a);var d=b.registry.getService("orion.page.progress");return(d?d.progress(b.fileClient.fetchChildren(a),"Crawling search for children of "+a):b.fileClient.fetchChildren(a)).then(function(a){for(var d=0;d<a.length;d++)if(a[d].Directory!==void 0&&a[d].Directory===!1)if(b._searchOnName)c.push(b._buildSingleSkeleton(a[d]));
else if(b._buildSkeletonOnly)c.push(b._buildSingleSkeleton(a[d]));else{var e=g.getFilenameContentType(a[d].Name,b.contentTypesCache);e&&(e["extends"]==="text/plain"||e.id==="text/plain")&&b._onFileType(e)&&c.push(b._sniffSearch(a[d]))}else a[d].Location&&c.push(b._visitRecursively(a[d].ChildrenLocation));return h.all(c)})};d.prototype._hitOnceWithinFile=function(d){d=this._searchParams.caseSensitive?d:d.toLowerCase();return this.searchHelper.inFileQuery.wildCard?a.searchOnelineRegEx(this.searchHelper.inFileQuery,
d,!0):a.searchOnelineLiteral(this.searchHelper.inFileQuery,d,!0)};d.prototype._reportSingleHit=function(a){a.LastModified=a.LocalTimeStamp;this.fileLocations.push(a);this._hitCounter++;this._sort(this.fileLocations);this._onSearchComplete({response:{numFound:this.fileLocations.length,docs:this.fileLocations}},!0)};d.prototype._sniffSearch=function(a){this._totalCounter++;var c=this;if(this.searchHelper.params.keyword==="")this._reportSingleHit(a),this.registry.getService("orion.page.message").setProgressResult({Message:i.formatMessage(k["${0} files found out of ${1}"],
this._hitCounter,this._totalCounter)});else return this.registry.getService("orion.page.progress").progress(c.fileClient.read(a.Location),"Reading file "+a.Location).then(function(b){c._hitOnceWithinFile(b)&&c._reportSingleHit(a);c.registry.getService("orion.page.message").setProgressResult({Message:i.formatMessage(k["${0} files found out of ${1}"],c._hitCounter,c._totalCounter)})},function(b){console.error("Error loading file content: "+b.message)})};d.prototype._buildSingleSkeleton=function(a){this._totalCounter++;
this.fileSkeleton.push(a);this.searchHelper&&!this._buildSkeletonOnly&&this._totalCounter%100===0&&this.searchName();a=new h;a.resolve(this._totalCounter);return a};d.prototype.constructor=d;return{SearchCrawler:d}});
define("orion/searchClient","i18n!orion/search/nls/messages,require,orion/webui/littlelib,orion/i18nUtil,orion/searchUtils,orion/crawler/searchCrawler".split(","),function(k,j,i,a,g,h){function d(a){this.registry=a.serviceRegistry;this._commandService=a.commandService;(this._fileService=a.fileService)||console.error("No file service on search client")}d.prototype={search:function(a,c,b){var d=function(b){for(var a=[],c=0;c<b.response.docs.length;c++){var d=b.response.docs[c];a.push({name:d.Name,path:d.Location,
folderName:g.path2FolderName(d.Path?d.Path:d.Location,d.Name),directory:d.Directory,lineNumber:d.LineNumber})}return a};if(this._crawler&&a.nameSearch)this._crawler.searchName(a,function(a){b(d(a),null)});else try{this.registry.getService("orion.page.progress").progress(this._fileService.search(a),"Searching "+a.keyword).then(function(c){var g=a.keyword,g=g.substring(g.indexOf("}")+1),g=g.substring(g.indexOf(":")+1);b(d(c),g)},function(a){b(null,null,a)})}catch(i){typeof i==="string"&&i.indexOf("search")>
-1&&this._crawler?this._crawler.searchName(a,function(a){b(d(a),null)}):typeof i==="string"&&i.indexOf("search")>-1&&!a.nameSearch?(new h.SearchCrawler(this.registry,this._fileService,a,{childrenLocation:this.getChildrenLocation()})).search(function(a){b(d(a),null)}):this.registry.getService("orion.page.message").setErrorMessage(i)}},getFileService:function(){return this._fileService},setCrawler:function(a){this._crawler=a},handleError:function(a,c){console.error(a);i.empty(c);c.appendChild(document.createTextNode(a));
return a},setLocationByMetaData:function(d,c){var b="",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),b=e.Name,this._childrenLocation=e.ChildrenLocation;else if(d)this.setLocationbyURL(this._searchRootLocation),b=this._fileService.fileServiceName(d.Location),this._childrenLocation=d.ChildrenLocation;
e=i.node("search");b||(b="");if(e&&e.placeholder){e.value="";var g=a.formatMessage(k["Search ${0}"],b);e.placeholder=g.length>30?g.substring(0,27)+"...":a.formatMessage(k["Search ${0}"],b)}if(e&&e.title)e.title=k["Type a keyword or wild card to search in "]+b},setLocationbyURL:function(a){this._searchLocation=a},setRootLocationbyURL:function(a){this._searchRootLocation=a},setChildrenLocationbyURL:function(a){this._childrenLocation=a},getSearchLocation:function(){return this._searchLocation?this._searchLocation:
this._fileService.fileServiceRootURL()},getSearchRootLocation:function(){return this._searchRootLocation?this._searchRootLocation:this._fileService.fileServiceRootURL()},getChildrenLocation:function(){return this._childrenLocation?this._childrenLocation:this._fileService.fileServiceRootURL()},createSearchParams:function(a,c,b,d){b=b?this.getSearchRootLocation():this.getSearchLocation();return c?{resource:b,sort:"NameLower asc",rows:100,start:0,nameSearch:!0,keyword:a}:{resource:b,sort:"Path asc",
rows:40,start:0,caseSensitive:d?d.caseSensitive:void 0,regEx:d?d.regEx:void 0,fileType:d?d.type:void 0,keyword:a}},defaultRenderer:{makeRenderFunction:function(d,c,b,e,g){function h(b){return!d?!0:(b=d.getFilenameContentType(b))&&(b["extends"]==="text/plain"||b.id==="text/plain")?!0:!1}return function(d,f,l){if(l)i.empty(c),d=document.createElement("div"),d.appendChild(document.createTextNode(k["Search failed."])),c.appendChild(d),typeof e==="function"&&e(c);else{var l=function(){function b(a,c){var d=
c.folderName?c.folderName:c.path,e=document.createElement("span");e.id=d.replace(/[^a-zA-Z0-9_\.:\-]/g,"");e.appendChild(document.createTextNode(" - "+d+" "));a.appendChild(e)}var a={};return function(c,d){var e=d.name;if(a.hasOwnProperty(e)){b(c,d);var f=a[e];typeof f==="function"&&(a[e]=null,f())}else a[e]=function(){b(c,d)}}}(),p=!1;i.empty(c);if(d&&d.length>0){var o=document.createElement("table");o.setAttribute("role","presentation");for(var u=0;u<d.length;u++){var s=d[u],v;if(!p&&(p=!0,b))v=
o.insertRow(0).insertCell(0),v.textContent=b;v=o.insertRow(-1).insertCell(0);v.colspan=2;g&&g(v);var t=document.createElement("a");t.appendChild(document.createTextNode(s.name));s.LineNumber&&t.appendChild(document.createTextNode(" (Line "+s.LineNumber+")"));var y=s.location;s.isExternalResource?y=s.path:(y=s.directory?j.toUrl("navigate/table.html")+"#"+s.path:h(s.name)?j.toUrl("edit/edit.html")+"#"+s.path:s.path,y==="#"&&(y=""));t.setAttribute("href",y);t.setAttribute("aria-describedby",(s.folderName?
s.folderName:s.path).replace(/[^a-zA-Z0-9_\.:\-]/g,""));t.style.verticalAlign="middle";v.appendChild(t);l(v,s)}c.appendChild(o);typeof e==="function"&&e(c)}!p&&f&&(d=a.formatMessage(k["No matches found for ${0}"],f),i.empty(c),c.appendChild(document.createTextNode(d)),typeof e==="function"&&e(c))}}}}};d.prototype.constructor=d;return{Searcher:d}});
define("orion/webui/dialogs/OpenResourceDialog","i18n!orion/widgets/nls/messages,orion/crawler/searchCrawler,orion/contentTypes,require,orion/webui/littlelib,orion/webui/dialog".split(","),function(k,j,i,a,g,h){function d(a){this._init(a)}d.prototype=new h.Dialog;d.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="'+
a.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>';d.prototype._init=function(a){this.title=a.title||k["Find File Named"];this.modal=!0;this.messages=k;this._searcher=a.searcher;this._progress=a.progress;this._onHide=a.onHide;
this._contentTypeService=new i.ContentTypeService(this._searcher.registry);if(!this._searcher)throw Error("Missing required argument: searcher");this._searchDelay=a.searchDelay||500;this._time=0;this._searcher.setCrawler(null);this._forceUseCrawler=!1;this._searchOnRoot=!0;this._fileService=this._searcher.getFileService();if(!this._fileService)throw Error(k["Missing required argument: fileService"]);this._searchRenderer=a.searchRenderer;if(!this._searchRenderer||typeof this._searchRenderer.makeRenderFunction!==
"function")throw Error(k["Missing required argument: searchRenderer"]);this._favService=a.favoriteService;if(!this._favService)throw Error(k["Missing required argument: favService"]);this._initialize()};d.prototype._bindToDom=function(a){var c=this;c.$crawlingProgress.style.display="none";this.$fileName.setAttribute("placeholder",k.Search);this.$fileName.addEventListener("input",function(){c._time=+new Date;c._timeoutId&&clearTimeout(c._timeoutId);c._timeoutId=setTimeout(c.checkSearch.bind(c),0)},
!1);this.$fileName.addEventListener("keydown",function(b){if(b.keyCode===g.KEY.ENTER){var a=g.$("a",c.$results);a&&(g.stop(b),window.open(a.href),c.hide())}},!1);a.addEventListener("keydown",function(b){var a,d,f,h,i;if(b.keyCode===g.KEY.DOWN||b.keyCode===g.KEY.UP)d=g.$$array("a",c.$results),a=g.$$array("a",c.$favresults),f=document.activeElement,i=d.indexOf(f),h=a.indexOf(f),b.keyCode===g.KEY.DOWN?h>=0?(h<a.length-1?a[h+1]:d.length>0?d[0]:a[0]).focus():i>=0?(i<d.length-1?d[i+1]:a.length>0?a[0]:d[0]).focus():
(d.length>0||a.length>0)&&(-1<a.length-1?a[0]:d[0]).focus():h>=0?(f=c.$fileName,(h>0?a[h-1]:f).focus()):i>=0?(f=c.$fileName,(i>0?d[i-1]:a.length>0?a[a.length-1]:f).focus()):d.length>0?d[d.length-1].focus():a.length>0&&a[a.length-1].focus(),g.stop(b)});a.addEventListener("mouseup",function(b){b.target.focus()},!1);this.populateFavorites();setTimeout(function(){if(c._forceUseCrawler||!c._fileService.getService(c._searcher.getSearchLocation()).search){var b=c._searchOnRoot?c._searcher.getSearchRootLocation():
c._searcher.getChildrenLocation(),b=new j.SearchCrawler(c._searcher.registry,c._fileService,"",{searchOnName:!0,location:b});c._searcher.setCrawler(b);b.buildSkeleton(function(){c.$crawlingProgress.style.display="inline";c.$progress.appendChild(document.createTextNode(k["Building file skeleton..."]))},function(){c.$crawlingProgress.style.display="none";c.$progress.removeChild(c.$progress.lastChild)})}},0)};d.prototype.populateFavorites=function(){var a=document.createElement("div");a.appendChild(document.createTextNode(k["Populating favorites&#x2026;"]));
g.empty(this.$favresults);this.$favresults.appendChild(a);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())};d.prototype.showFavorites=function(){var a=this;return function(c){if(c.navigator)c=c.navigator;a._searchRenderer.makeRenderFunction(a._contentTypeService,a.$favresults,!1,a.decorateResult.bind(a),
a.showFavoritesImage)(c);if(c&&c.length>0)c=document.createElement("div"),c.style.borderBottom="1px dashed #BBBBBB",c.style.padding="5px",a.$favresults.appendChild(c)}};d.prototype.showFavoritesImage=function(d){var c=new Image;c.classList.add("modelDecorationSprite");c.classList.add("core-sprite-makeFavorite");c.src=a.toUrl("images/none.png");c.title=k.Favorite;d.appendChild(c);c.style.verticalAlign="middle"};d.prototype.checkSearch=function(){clearTimeout(this._timeoutId);var a=(new Date).getTime();
a-this._time>this._searchDelay?(this._time=a,this.doSearch()):this._timeoutId=setTimeout(this.checkSearch.bind(this),50)};d.prototype.doSearch=function(){var a=this.$fileName.value,c=this.showFavorites();this._progress?this._progress.progress(this._favService.queryFavorites(a),"Getting favorites for: "+a).then(function(b){c(b)}):this._favService.queryFavorites(a).then(function(b){c(b)});if(a){var b=document.createElement("div");b.appendChild(document.createTextNode(k["Searching..."]));g.empty(this.$favresults);
this.$results.appendChild(b);var d=this;setTimeout(function(){var b=d._searcher.createSearchParams(a,!0,d._searchOnRoot),c=d._searchRenderer.makeRenderFunction(d._contentTypeService,d.$results,!1,d.decorateResult.bind(d));d._searcher.search(b,!1,c)},0)}};d.prototype.decorateResult=function(a){for(var c=this,a=g.$$array("a",a),b=0;b<a.length;b++){var d=a[b];d.addEventListener("mouseup",function(b){b.button===0&&!b.ctrlKey&&!b.metaKey&&c.hide()},!1);d.addEventListener("keyup",function(b){b.keyCode===
g.KEY.ENTER&&c.hide()},!1)}};d.prototype._beforeHiding=function(){clearTimeout(this._timeoutId)};d.prototype._afterHiding=function(){this._onHide&&this._onHide()};d.prototype.constructor=d;return{OpenResourceDialog:d}});
define("orion/extensionCommands","require,orion/Deferred,orion/commands,orion/editor/regex,orion/contentTypes,orion/URITemplate,orion/i18nUtil,orion/URL-shim".split(","),function(k,j,i,a,g,h,d){var f={},c=(new URL(k.toUrl("."),window.location)).href.slice(0,-1);f._cloneItemWithoutChildren=function e(a){if(a===null||typeof a!=="object")return a;var c=a.constructor(),d;for(d in a)d!=="children"&&d!=="Children"&&(c[d]=e(a[d]));return c};f._createOpenWithCommands=function(a){function c(a,d){for(var e=
a.getServiceReferences("orion.navigate.openWith"),f=[],g=0;g<e.length;g++){var h=e[g];h.getProperty("editor")===d.id&&(h=h.getProperty("contentType"),h instanceof Array?f=f.concat(h):h!==null&&typeof h!=="undefined"&&f.push(h))}return f}for(var d=function(){for(var c=a.getServiceReferences("orion.edit.editor"),d=[],f=0;f<c.length;f++){var g=c[f],h=g.getProperty("id");d.push({id:h,name:g.getProperty("name"),nameKey:g.getProperty("nameKey"),nls:g.getProperty("nls"),uriTemplate:g.getProperty("orionTemplate")||
g.getProperty("uriTemplate")})}return d}(),f=function(a){for(a=a.getServiceReferences("orion.navigate.openWith.default");0<a.length;)return{editor:a[0].getProperty("editor")};return null}(a),g=[],h=0;h<d.length;h++){var i=d[h],j=f&&f.editor===i.id,k=c(a,i);k.length&&g.push({properties:{name:i.name||i.id,nameKey:i.nameKey,id:"eclipse.openWithCommand."+i.id,tooltip:i.name,tooltipKey:i.nameKey,contentType:k,uriTemplate:i.uriTemplate,nls:i.nls,forceSingleItem:!0,isEditor:j?"default":"editor"},service:{}})}return g};
f._makeValidator=function(a,d,f,i){function j(a,c,d,e){var f=d.match,g;if(c.indexOf("|")>=0)return g=c.substring(0,c.indexOf("|")),c=c.substring(c.indexOf("|")+1),j(a,g,d,e)?!0:j(a,c,d,e);else if(c.indexOf(":")>=0)return g=c.substring(0,c.indexOf(":")),c=c.substring(c.indexOf(":")+1),a[g]?j(a[g],c,d,e):!1;else{a:{g=!1;var h;if(a[c]){if(f)if(typeof f==="string"){if(!typeof(a[c]==="string")){d=!1;break a}if(d.variableName){if(f=RegExp(f).exec(a[c]))g=f[0],h=d.variableMatchPosition==="before"?a[c].substring(0,
f.index):d.variableMatchPosition==="after"?a[c].substring(f.index+g.length):d.variableMatchPosition==="only"?g:a[c],g=!0}else{d=RegExp(f).test(a[c]);break a}}else a[c]===f&&(h=a[c],g=!0);else h=a[c],g=!0;if(g&&d.variableName&&(e[d.variableName]=h,e.itemCached=a,d.replacements))for(a=0;a<d.replacements.length;a++)c=!1,d.replacements[a].pattern?e[d.variableName]=e[d.variableName].replace(RegExp(d.replacements[a].pattern),d.replacements[a].replacement||""):c=!0,c&&window.console.log("Invalid replacements specified in validation property.  "+
d.replacements[a]);d=g}else d=!1}return d}}return{info:a,validationFunction:function(c){typeof i==="function"&&(c=i.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 h;a:{var k=c[d],m=f;if(this.info.validationProperties)for(h=0;h<this.info.validationProperties.length;h++){var v=this.info.validationProperties[h];if(v.source){if(!j(k,v.source,v,this)){h=!1;break a}}else{window.console.log("Invalid validationProperties in "+
a.id+".  No source property specified.");h=!1;break a}}if(this.info.contentType&&m){v=!1;if(k=g.getFilenameContentType(k.Name,m))for(h=0;h<this.info.contentType.length;h++)if(k.id===this.info.contentType[h]){v=!0;break}h=v}else h=!0}if(!h)return!1}return!0}return!1},generatesURI:function(){return!!this.info.uriTemplate},getURI:function(a){if(this.info.uriTemplate){var d={},e;for(e in a)a.hasOwnProperty(e)&&(d[e]=a[e]);if(this.info.validationProperties)for(e=0;e<this.info.validationProperties.length;e++){var f=
this.info.validationProperties[e];f.source&&f.variableName&&(this.itemCached===a&&this[f.variableName]||j(a,f.source,f,this),a[f.variableName]?window.console.log("Variable name "+f.variableName+" in the extension "+this.info.id+" conflicts with an existing property in the item metadata."):d[f.variableName]=this[f.variableName])}d.OrionHome=c;a=new h(this.info.uriTemplate);return window.decodeURIComponent(a.expand(d))}return null}}};f._createCommandOptions=function(a,c,g,h,i,k){function p(d,j){var o=
f._makeValidator(a,g,h,k);d.visibleWhen=o.validationFunction.bind(o);if(i)if(o.generatesURI.bind(o)())d.hrefCallback=function(a){a=Array.isArray(a.items)?a.items[0]:a.items;return o.getURI.bind(o)(a)};else{var p=a;d.callback=function(a){var e;if(p.forceSingleItem)a=Array.isArray(a.items)?a.items[0]:a.items,e=f._cloneItemWithoutChildren(a);else if(Array.isArray(a.items)){e=[];for(var h=0;h<a.items.length;h++)e.push(f._cloneItemWithoutChildren(a.items[h]))}else e=f._cloneItemWithoutChildren(a.items);
if(g)var i=g.getService("orion.page.progress");c.run?i?i.progress(c.run(e),"Running command: "+d.name):c.run(e):g&&(i?i.progress(g.getService(c).run(e),"Running command: "+d.name):g.getService(c).run(e))}}j.resolve(d)}var o=new j;a.nls?d.getMessageBundle(a.nls).then(function(c){p({name:a.nameKey?c[a.nameKey]:a.name,image:a.image,id:a.id||a.name,tooltip:a.tooltipKey?c[a.tooltipKey]:a.tooltip,isEditor:a.isEditor},o)}):p({name:a.name,image:a.image,id:a.id||a.name,tooltip:a.tooltip,isEditor:a.isEditor},
o);return o};f.getOpenWithCommands=function(a){var c=[],d;for(d in a._commandList){var f=a._commandList[d];f.isEditor&&c.push(f)}return c};return f});
define("orion/globalSearch/advSearchOptContainer",["i18n!orion/globalSearch/nls/messages","require","orion/searchUtils","orion/contentTypes","orion/i18nUtil"],function(k,j,i,a,g){function h(a,c,b,e){this._inputField=a;if(typeof this._inputField==="string")this._inputField=document.getElementById(this._inputField);(a=e?e.group:null)||(a=this._inputField.id?this._inputField.id:"default__dropDown__group");this._idPrefix=a+"__dropDown__";this.containerId=this._idPrefix+"UIContainer";this._dismissed=!0;
var g=this;this._optRenderer=new d(c,b,function(){g.dismiss();g._inputField.focus()});this._initUI()}function d(a,c,b){this._searcher=a;this._serviceRegistry=c;this._cancelCallBack=b}h.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)};h.prototype.dismiss=function(){this._dismissed=!0;this._optUIContainer.style.display="none"};h.prototype.show=function(a){for(var c=0,b=0,d=this._inputField;d;)c+=d.offsetLeft,b+=d.offsetTop,d=d.offsetParent;this._optUIContainer.style.display="block";this._optUIContainer.style.top=b+this._inputField.offsetHeight+2+"px";this._optUIContainer.style.left=c+"px";this._optUIContainer.style.width=this._inputField.offsetWidth+"px";this._optRenderer._searchBox.value=
a;this._optRenderer._searchBox.focus();this._dismissed=this._mouseDown=!1};h.prototype.toggle=function(){this._dismissed?this.show(this._inputField.value):this.dismiss()};h.prototype.constructor=h;d.prototype.getOptions=function(){return{searchStr:this._searchBox.value,caseSensitive:this._caseSensitiveCB.checked,regEx:this._regExCB.checked,type:this._fileTypes.options[this._fileTypes.selectedIndex].value}};d.prototype.render=function(d,c){this._parentDiv=d;if(typeof this._parentDiv==="string")this._parentDiv=
document.getElementById(this._parentDiv);var b=this._serviceRegistry.getService("orion.core.contenttypes");if(b){var e=this;b.getContentTypes().then(function(a){e.contentTypesCache=a;e._render(c)})}else b=new a.ContentTypeService(this._serviceRegistry),this.contentTypesCache=b.getContentTypes(),this._render(c)};d.prototype._render=function(a){a?this._renderHTML(a):this._renderRaw()};d.prototype._submitSearch=function(){var a=this.getOptions();i.doSearch(this._searcher,this._serviceRegistry,a.searchStr,
a)};d.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 a=[{label:k["All types"],value:i.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 b=0;b<this.contentTypesCache[c].extension.length;b++)a.push({label:this.contentTypesCache[c].extension[b],value:this.contentTypesCache[c].extension[b]});for(c=0;c<a.length;c++){var b=document.createElement("option"),d=document.createTextNode(a[c].label);b.appendChild(d);this._fileTypes.appendChild(b);b.value=a[c].value}var h=this;this._searchBox.addEventListener("keydown",function(a){a=a.charCode||a.keyCode;a===13&&h._submitSearch();a===27&&h._cancelCallBack&&h._cancelCallBack()});
this._fileTypes.addEventListener("change",function(){var a=h._fileTypes.options[h._fileTypes.selectedIndex].value;h._searchBox.placeholder=a===i.ALL_FILE_TYPE?k["Type a search term"]:g.formatMessage(k["All ${0} files"],a)});this._submitButton.onclick=function(){h._submitSearch()}};d.prototype._initHTMLLabels=function(){document.getElementById("advSearchLabel").appendChild(document.createTextNode(k["Files that contain:"]));document.getElementById("advSearchInput").placeholder=k["Type a search term"];
document.getElementById("advSearchTypeLabel").appendChild(document.createTextNode(k["File type:"]));document.getElementById("advSearchCaseSensitiveLabel").appendChild(document.createTextNode(k["Case sensitive"]));document.getElementById("advSearchRegExLabel").appendChild(document.createTextNode(k["Regular expression"]));document.getElementById("advSearchSubmit").value=k.Search};d.prototype._renderHTML=function(a){var c=this,b=new XMLHttpRequest;b.open("GET",j.toUrl(a),!0);b.onreadystatechange=function(){if(this.readyState===
4&&this.status===200)c._parentDiv.innerHTML=this.responseText,c._initHTMLLabels(),c._initControls()};b.send()};d.prototype._htmlTemplate='<ul class="advSearchOptUL"><li class="advSearchOptLILabel"><label>'+k["Files that contain:"]+'</label></li><li class="advSearchOptLIControl"><input type="text" id="advSearchInput" placeholder="'+k["Type a search term"]+'"></input></li><li class="advSearchOptLIControl"><label>'+k["File type:"]+'</label><select id="advSearchTypes"></select></li><li class="advSearchOptLIControl"><label>'+
k["Case sensitive"]+'</label><input type="checkbox" id="advSearchCaseSensitive"></input></li><li class="advSearchOptLIControl"><label>'+k["Regular expression"]+'</label><input type="checkbox" id="advSearchRegEx"></input></li><li class="advSearchOptLIControl"><input type="button" class="advSearchOptButton" id="advSearchSubmit" value="'+k.Search+'"></input></li></ul>';d.prototype._renderRaw=function(){this._parentDiv.innerHTML=this._htmlTemplate;this._initControls()};d.prototype.constructor=d;return{advSearchOptContainer:h,
advSearchOptRenderer:d}});
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(k,
j,i,a,g,h,d,f,c,b,e,m,n,r,q,l,p,o,u,s,v,t,y,x,z,I,G,F){function w(a,b){if(a.getLabel)return a.getLabel();else{var c=new t;c.resolve(b.properties.name);return c}}function A(a){b.node("progressPane").setAttribute("aria-label",k["Operations - Press spacebar to show current operations"]);(a=a.getService("orion.page.progress"))&&a.init.bind(a)("progressPane")}function D(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 E(a,c){var d=a.getServiceReferences("orion.core.auth");J=[];if(b.node("userMenu")){var e=b.node("userDropdown"),f=new m.Dropdown({dropdown:e}),g=new y.UserMenu({dropdownNode:e,dropdown:f,serviceRegistry:a}),e=b.node("userTrigger");new n.Tooltip({node:e,text:k.Options,position:["below","left"]});D(a,e);g.setKeyAssist(c);
for(e=0;e<d.length;e++){var f=d[e],h=a.getService(f);w(h,f).then(function(a){h.getKey().then(function(b){J.push(b);h.getUser().then(function(c){g.addUserItem(b,h,a,c)},function(c,d){g.addUserItem(b,h,a,d)});window.addEventListener("storage",function(){V[b]!==localStorage.getItem(b)&&(V[b]=localStorage.getItem(b),h.getUser().then(function(c){g.addUserItem(b,h,a,c)},function(){g.addUserItem(b,h,a)}))},!1)})})}}}function H(a){var c=document.createElement("span");c.id="advancedSearchDropDown";b.node("searchOptions").appendChild(c);
c.tabIndex=0;c.classList.add("advancedSearchDecorationSprite");c.classList.add("core-sprite-openarrow");c.title=k["Advanced search"];c.onclick=function(){a.toggle()};c.addEventListener("keydown",function(b){(b.charCode||b.keyCode)===13&&a.toggle()});c.classList.add("bannerMenuSearchOptions")}function B(a,c){var d=b.node("relatedDropdown");N||(N=new m.Dropdown({dropdown:d}));a._addMenuItem(d,c)}function C(c,d,e,f,g){var i,j=c.getServiceReferences("orion.page.link.related");j.length<=0||b.node("relatedLinks")&&
t.when(function(){if(i)return i;var a=c.getService("orion.core.contenttypes");a||(a=new q.ContentTypeService(c),a=c.getService("orion.core.contenttypes"));return a.getContentTypes().then(function(a){return i=a})}(),function(){var k;b.node("relatedLinks")&&N&&(N.close(),N.empty());for(var l=[],m=0;m<j.length;m++){var n={},o,q=j[m].getPropertyKeys();for(o=0;o<q.length;o++)n[q[o]]=j[m].getProperty(q[o]);if(n.id){var p=function(b){if(b)if(!b.visibleWhen||b.visibleWhen(d)){var c=new a.CommandInvocation(f,
d,d,null,b);B(b,c)}else typeof g==="function"&&(k||(k=g()),t.when(k,function(c){c&&d===R&&(!b.visibleWhen||b.visibleWhen(c))&&B(b,new a.CommandInvocation(f,c,c,null,b))}))},r=null;o=null;if(e.indexOf(n.id)<0)if((n.nls&&n.nameKey||n.name)&&n.uriTemplate)o=h._createCommandOptions(n,j[m],c,i,!0),l.push(o),o.then(function(b){b=new a.Command(b);p(b)});else{if(!r&&(r=f.findCommand(n.id))){p(r);continue}if(!r){var aa=c.getServiceReferences("orion.navigate.command");for(o=0;o<aa.length;o++)if(aa[o].getProperty("id")===
n.id){for(var n={},q=aa[o].getPropertyKeys(),s=0;s<q.length;s++)n[q[s]]=aa[o].getProperty(q[s]);o=h._createCommandOptions(n,aa[o],c,i,!0);l.push(o);o.then(function(b){r=new a.Command(b);p(r)});break}}}}}t.all(l,function(a){return a}).then(function(){var a=b.node("relatedTrigger");if(N&&a)a.style.visibility=N.getItems().length===0?"hidden":"visible"})})}function S(a){var c=b.node("globalActions");c&&(a.destroy(c),a.renderCommands(c.id,c,{},{},"tool"))}function T(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 O(a){var c={},d=null;typeof a==="string"&&(a=b.node(a));a||(a=b.node("pageActions"));for(var e=a;e&&e.classList;){if(e.classList.contains("toolComposite")){d=
e;break}e=e.parentNode}if(a.classList.contains("commandMarker"))c.commandNode=a;if(d&&(c.slideContainer=b.$(".slideParameters",d),c.parameterArea=b.$(".parameters",d),c.dismissArea=b.$(".parametersDismiss",d),c.notifications=b.$("#notificationArea",d),d.parentNode&&(c.toolbarTarget=b.$(".toolbarTarget",d.parentNode),c.toolbarTarget)))a=b.bounds(d),c.toolbarTargetY=a.height+1;return c}function U(a){if(a.toolbarTarget&&a.toolbarTargetY){var c=0,d;a.notifications&&a.notifications.classList.contains("slideContainerActive")&&
(d=b.bounds(a.notifications),c+=d.height);a.slideContainer&&a.slideContainer.classList.contains("slideContainerActive")&&(d=b.bounds(a.slideContainer),c+=d.height);c>0&&(c+=8);a.toolbarTarget.style.top=a.toolbarTargetY+c+"px";a.toolbarTarget.style.bottom=0}}var l=function(a){var b=document.createElement("a");b.href=a;return b.href}(j.toUrl("auth/NotifyAuthentication.html")),V={},J=[],N,R,W=[],L,X=null;return{addSettings:function(a){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),b.addAutoDismiss([d,c,f],function(){d.className="core-sprite-settings";c.style.backgroundColor="white";f.style.visibility="hidden";e=!1}));b.empty(f);a.appendTo(f)}}},generateBanner:function(c,h,l,m,o,q,p,w){function B(a){a.registerService("orion.cm.managedservice",
{updated:function(a){for(var a=a&&a["links.newtab"]!=="undefined"?a["links.newtab"]?"_blank":"_self":"_self",c=b.$$array(".targetSelector"),d=0;d<c.length;d++)c[d].target=a}},{pid:"nav.config"})}T(m);m=b.node(c);if(!m)throw k["could not find banner parent, id was "]+c;c=document.createRange();c.selectNode(m);c=c.createContextualFragment(I);b.processTextNodes(c,k);m.firstChild?m.insertBefore(c,m.firstChild):m.appendChild(c);c=b.node("home");c.href=j.toUrl("navigate/table.html");c.setAttribute("aria-label",
k["Orion Home"]);b.node("progressPane").src=j.toUrl("images/none.png");if(c=b.node("pageToolbar"))c.classList.add("toolbarLayout"),c.innerHTML=F+i.slideoutHTMLFragment("mainToolbar");(c=b.node("closeNotifications"))&&c.setAttribute("aria-label",k["Close notification"]);if(c=b.node("footer"))c.innerHTML=G,b.processTextNodes(c,k);l.setParameterCollector(new g.CommandParameterCollector(O,U));var C=document.createElement("div");C.id="keyAssist";C.style.display="none";C.classList.add("keyAssistFloat");
C.role="list";C.setAttribute("aria-atomic","true");C.setAttribute("aria-live","assertive");document.body.appendChild(C);document.addEventListener("keydown",function(a){if(a.charOrCode===b.KEY.ESCAPE)C.style.display="none"},!1);b.addAutoDismiss([C],function(){C.style.display="none"});var D=b.node("primaryNav");D&&x.createPageLinks(h,"orion.page.link").then(function(a){a.forEach(function(a){D.appendChild(a)})});var y=b.node("search");if(!y)throw"failed to generate HTML for banner";y.setAttribute("placeholder",
k.Search);new n.Tooltip({node:y,text:k["Type a keyword or wild card to search in root"],position:["below","left"]});var J=new v.advSearchOptContainer(y,o,h,{group:"advancedSearch"});new s.InputCompletion(y,function(a){u.getMixedSearches(h,!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:k["Saved searches"]}),e=!0),d.push({type:"proposal",value:{name:b[c].label,value:j.toUrl("search/search.html")+"#"+b[c].value,type:"link"}})):(f||(d.push({type:"category",
label:k["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=h.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(h.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}))});t.all(d).then(function(a){b(a)})}}});y.addEventListener("keydown",function(a){a.defaultPrevented||(a.charCode||a.keyCode)===13&&u.doSearch(o,h,y.value)});H(J);b.addAutoDismiss([b.node(J.containerId),b.node("advancedSearchDropDown")],function(){J.dismiss()});if(c=b.$(".split")){var m=b.$(".sidePanelLayout"),K=b.$(".mainPanelLayout");if(m&&K)X={side:m,main:K},X.splitter=new e.Splitter({node:c,sidePanel:m,mainPanel:K,toggle:!0}),c=new a.Command({name:k["Toggle side panel"],
tooltip:k["Open or close the side panel"],id:"orion.toggleSidePane",callback:function(){X.splitter.toggleSidePanel()}}),l.addCommand(c),l.registerCommandContribution("pageActions","orion.toggleSidePane",1,null,!0,new a.CommandKeyBinding("o",!0)),p&&(X.splitter.addResizeListener(function(a){p&&a===K&&p.getTextView().resize()}),p.getTextView().setKeyBinding(new f.KeyBinding("o",!0),"toggleOutliner"),p.getTextView().setAction("toggleOutliner",function(){X.splitter.toggleSidePanel();return!0},{name:k["Toggle Outliner"]}))}c=
new a.Command({name:k["Make Favorite"],tooltip:k["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=h.getService("orion.core.favorite"),c=h.getService("orion.page.progress"),d=function(a){return function(d){d?h.getService("orion.page.message").setMessage(a.Name+
k[" is already a favorite."],2E3):c.progress(b.makeFavorites(a),"Making favorite "+a.Name)}},e=0;e<a.length;e++){var f=a[e];c.progress(b.hasFavorite(f.ChildrenLocation||f.Location),"Checking favorite "+f.Name).then(d(f))}}});l.addCommand(c);var L=function(a,b,c){var d=b.getService("orion.core.favorite"),e=b.getService("orion.page.progress");d||(d=new r.FavoritesService({serviceRegistry:b}),d=b.getService("orion.core.favorite"));var f=new z.OpenResourceDialog({searcher:a,progress:e,searchRenderer:a.defaultRenderer,
favoriteService:d,onHide:function(){c&&c.getTextView().focus()}});window.setTimeout(function(){f.show()},0)},c=new a.Command({name:k["Find File Named..."],tooltip:k["Choose a file by name and open an editor on it"],id:"eclipse.openResource",callback:function(){L(o,h,p)}});p&&(p.getTextView().setKeyBinding(new f.KeyBinding("f",!0,!0,!1),c.id),p.getTextView().setAction(c.id,function(){L(o,h,p);return!0},c));l.addCommand(c);l.registerCommandContribution("globalActions","eclipse.openResource",100,null,
!0,new a.CommandKeyBinding("f",!0,!0));c=new a.Command({name:k["Global search"],tooltip:k["Global search"],id:"eclipse.globalSearch",callback:function(){var a=b.node("search");a&&a.focus()}});p&&(p.getTextView().setKeyBinding(new f.KeyBinding("h",!0,!1,!0),c.id),p.getTextView().setAction(c.id,function(){var a=p.getSelection(),c=null;a.end>a.start&&(c=p.getModel().getText(a.start,a.end));if(a=b.node("search")){if(c)a.value=c;a.focus()}return!0},c));l.addCommand(c);l.registerCommandContribution("globalActions",
"eclipse.globalSearch",101,null,!0,new a.CommandKeyBinding("h",!0,!1,!0));c=new a.Command({name:k["Toggle banner and footer"],tooltip:k["Hide or show the page banner and footer"],id:"orion.toggleTrim",callback:function(){var a=b.node("banner"),c=b.node("footer"),d=b.$(".content-fixedHeight");a.style.display==="none"?(a.style.display="block",c.style.display="block",d.classList.remove("content-fixedHeight-maximized")):(a.style.display="none",c.style.display="none",d.classList.add("content-fixedHeight-maximized"));
p&&p.getTextView().resize();return!0}});l.addCommand(c);l.registerCommandContribution("globalActions","orion.toggleTrim",100,null,!0,new a.CommandKeyBinding("m",!0,!0));p&&(p.getTextView().setKeyBinding(new a.CommandKeyBinding("m",!0,!0),c.id),p.getTextView().setAction(c.id,c.callback,c));w&&w.addHandler({isActive:function(){return C.style.display==="block"},cancel:function(){return this.isActive()?(C.style.display="none",!0):!1}});w=new a.Command({name:k["System Configuration Details"],tooltip:k["System Config Tooltip"],
id:"orion.configDetailsPage",hrefCallback:function(){return j.toUrl("help/about.html")}});l.addCommand(w);l.registerCommandContribution("globalActions","orion.configDetailsPage",100,null,!0,new a.CommandKeyBinding(112,!0,!0));w=new a.Command({name:k["Background Operations"],tooltip:k["Background Operations Tooltip"],id:"orion.backgroundOperations",hrefCallback:function(){return j.toUrl("operations/list.html")}});l.addCommand(w);l.registerCommandContribution("globalActions","orion.backgroundOperations",
100,null,!0,new a.CommandKeyBinding("o",!0,!0));w=new a.Command({name:k["Show Keys"],tooltip:k["Show a list of all the keybindings on this page"],id:"eclipse.keyAssist",callback:function(){if(C.style.display==="none"){var a;b.empty(C);if(p){a=document.createElement("h2");a.appendChild(document.createTextNode(k.Editor));C.appendChild(a);a=p.getTextView().getActions(!1);for(var c=0;c<a.length;c++){var e=a[c],f=e,g=p.getTextView(),h=g.getActionDescription(e);if(h&&h.name)f=h.name;e=g.getKeyBindings(e);
for(g=0;g<e.length;g++){var h=d.getUserKeyString(e[g]),i=document.createElement("span");i.role="listitem";i.appendChild(document.createTextNode(h+" = "+f));i.appendChild(document.createElement("br"));C.appendChild(i)}}}a=document.createElement("h2");a.appendChild(document.createTextNode(k.Global));C.appendChild(a);l.showKeyBindings(C);C.style.display="block"}else C.style.display="none";return!0}});l.addCommand(w);l.registerCommandContribution("globalActions","eclipse.keyAssist",100,null,!0,new a.CommandKeyBinding(191,
!1,!0));p&&(c=window.navigator.platform.indexOf("Mac")!==-1,p.getTextView().setKeyBinding(new a.CommandKeyBinding(191,!1,!0,!c,c),w.id),p.getTextView().setAction(w.id,w.callback,w));S(l);E(h,w.callback);A(h);window.addEventListener("hashchange",function(){l.processURL(window.location.href)},!1);window.setTimeout(function(){B(h)},0)},getToolbarElements:O,getMainSplitter:function(){return X},layoutToolbarElements:U,setPageTarget:function(a){var d,e,f=a.breadcrumbRootName;a.target?(a.searchService&&
a.searchService.setLocationByMetaData(a.target),a.fileService&&!a.breadcrumbTarget&&(e=f?f+" ":"",e+=a.fileService.fileServiceName(a.target.Location),f=null),d=a.name||a.target.Name,R=a.target,C(a.serviceRegistry,a.target,W,a.commandService,a.makeAlternate)):(a.breadcrumbTarget||(f=f||a.task||a.name),d=a.name);(L=a.title)||(L=d?d+" - "+a.task:a.task);window.document.title=L;b.empty(b.node("location"));new c.BreadCrumbs({container:"location",resource:a.breadcrumbTarget||a.target,rootSegmentName:f,
workspaceRootSegmentName:e,makeHref:a.makeBreadcrumbLink})},setDirtyIndicator:function(a){if(L)L.charAt(0)==="*"&&!a&&(L=L.substring(1)),a&&L.charAt(0)!=="*"&&(L="*"+L),window.document.title=L;var c=b.node("dirty");if(c)c.textContent=a?"*":""},setPageCommandExclusions:function(a){W=a},notifyAuthenticationSite:l}});
define("orion/status",["require","orion/webui/littlelib","orion/globalCommands"],function(k,j,i){function a(a,d,f,c,b){this._serviceRegistry=a;this._serviceRegistration=a.registerService("orion.page.message",this);this._operationsClient=d;this.notificationContainerDomId=b;this.domId=f;this.progressDomId=c||f;this._hookedClose=!1}function g(a,d,f,c){this.statusService=a;this.progressId=d;if(f){this.deferred=f;this.begin(c);var b=this;f.then(function(){b.done.bind(b)()},function(){b.done.bind(b)()})}}
a.prototype={_init:function(){var a=j.node("closeNotifications"),d=this;a&&!this._hookedClose&&(a.addEventListener("click",function(){d.setProgressMessage("")},!1),a.addEventListener("keydown",function(a){(a.keyCode===j.KEY.ENTER||a.keyCode===j.KEY.SPACE)&&d.setProgressMessage("")},!1))},_getNotifierElements:function(){if(!this._notifierElements)this._notifierElements=i.getToolbarElements(this.notificationContainerDomId);return this._notifierElements},setMessage:function(a,d,f){this._init();this.currentMessage=
a;var c=j.node(this.domId);if(typeof f==="boolean"){var b=this,e=c.getAttribute("aria-live");c.setAttribute("aria-live",f?"polite":"off");window.setTimeout(function(){a===b.currentMessage&&(j.empty(c),c.appendChild(document.createTextNode(a)),window.setTimeout(function(){c.setAttribute("aria-live",e)},100))},100)}else j.empty(c),c.appendChild(document.createTextNode(a));typeof d==="number"&&(b=this,window.setTimeout(function(){a===b.currentMessage&&(j.empty(c),c.appendChild(document.createTextNode("")))},
d))},setErrorMessage:function(a){this.currentMessage=a;this._init();var d=a.responseText||a.message||a;try{d=JSON.parse(d)}catch(f){}var a=d.Message||d,c="red";if(d.Severity)switch(d.Severity){case "Warning":c="#FFCC00";break;case "Error":c="red";break;case "Info":case "Ok":c="green"}d=document.createElement("span");d.style.color=c;d.appendChild(document.createTextNode(a));a=j.node(this.domId);j.empty(a);a.appendChild(d)},setProgressMessage:function(a){this._init();this.currentMessage=a;var d=document.createElement("span");
d.classList.add("imageSprite");d.classList.add("core-sprite-progress");var f=j.node(this.progressDomId);j.empty(f);f.appendChild(d);f.appendChild(document.createTextNode(a));d=j.node(this.notificationContainerDomId);d.classList.add("progressNormal");if(a&&a.length>0)d.classList.add("slideContainerActive");else if(this._progressMonitors&&this._progressMonitors.length>0)return this._renderOngoingMonitors();else d.classList.remove("slideContainerActive");i.layoutToolbarElements(this._getNotifierElements())},
setProgressResult:function(a){this.currentMessage=a;var d=a.responseText||a;try{d=JSON.parse(d)}catch(f){}this._init();var c=d.Message||d,b="core-sprite-info",e="progressInfo",g=document.createElement("span");g.classList.add("imageSprite");a=[];if(d.Severity)switch(d.Severity){case "Warning":b="core-sprite-warning";e="progressWarning";a.push("progressInfo");a.push("progressError");a.push("progressNormal");break;case "Error":b="core-sprite-error";e="progressError";a.push("progressWarning");a.push("progressInfo");
a.push("progressNormal");break;default:a.push("progressWarning"),a.push("progressError"),a.push("progressNormal")}g.classList.add(b);var k=j.node(this.progressDomId),b=j.node(this.notificationContainerDomId);j.empty(k);k.appendChild(g);d.HTML?(d=document.createElement("span"),d.innerHTML=c,k.appendChild(d)):k.appendChild(document.createTextNode("   "+c));if(e&&this.progressDomId!==this.domId){b.classList.add(e);for(c=0;c<a.length;c++)b.classList.remove(a[c])}b.classList.add("slideContainerActive");
i.layoutToolbarElements(this._getNotifierElements())},showWhile:function(a,d){var f=this;if(d){f.setProgressMessage(d);var c=function(){d===f.currentMessage&&f.setProgressMessage("")};a.then(c,c)}return a},_lastProgressId:0,_progressMonitors:{length:0},createProgressMonitor:function(a,d){return new g(this,++this._lastProgressId,a,d)},_renderOngoingMonitors:function(){if(this._progressMonitors.length>0){var a="",d=!0,f;for(f in this._progressMonitors)this._progressMonitors[f].status&&(d||(a+=", "),
a+=this._progressMonitors[f].status,d=!1);this.setProgressMessage(a)}else this.setProgressMessage("")},_beginProgressMonitor:function(a){this._progressMonitors[a.progressId]=a;this._progressMonitors.length++;this._renderOngoingMonitors()},_workedProgressMonitor:function(a){this._progressMonitors[a.progressId]=a;this._renderOngoingMonitors()},_doneProgressMonitor:function(a){delete this._progressMonitors[a.progressId];this._progressMonitors.length--;a.status?this.setProgressResult(a.status):this._renderOngoingMonitors()}};
a.prototype.constructor=a;g.prototype.begin=function(a){this.status=a;this.statusService._beginProgressMonitor(this)};g.prototype.done=function(a){this.status=a;this.statusService._doneProgressMonitor(this)};g.prototype.worked=function(a){this.status=a;this.statusService._workedProgressMonitor(this)};g.prototype.constructor=g;return{StatusReportingService:a,ProgressMonitor:g}});
define("orion/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(k,j,i,a,g,h,d,f,c,b,e,m,n){var d={},r=null;d.EditorCommandFactory=function(){function d(a,b,c,e,f,g,h,i){this.serviceRegistry=a;this.commandService=b;this.fileClient=c;this.inputManager=e;this.toolbarId=
f;this.pageNavId=h;this.isReadOnly=g;this._searcher=i}d.prototype={generateEditorCommands:function(d){function e(a){if(r)return r;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 r=a})}function o(a){var c=new b.KeyBinding;b.KeyBinding.apply(c,a);return c}function q(a){var b={Severity:"Error"};a.status===0?b.Message=k["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){d.getTextView().setKeyBinding(new b.KeyBinding("s",!0),"save");var s=this;this.inputManager.onSave?d.getTextView().setAction("save",function(){var a=d.getText();s.inputManager.onSave(s.inputManager.getInput(),a,function(){d.setInput(s.inputManager.getInput(),null,a,!0);s.inputManager.afterSave&&s.inputManager.afterSave()},function(a){a.log=!0});return!0},{name:k.Save}):d.getTextView().setAction("save",
function(){var a=d.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,j.formatMessage(k["Saving file {0}"],s.inputManager.getInput()));b.then(function(b){s.inputManager.getFileMetadata().ETag=b.ETag;d.setInput(s.inputManager.getInput(),null,a,!0);s.inputManager.afterSave&&s.inputManager.afterSave()},function(b){b.status===412?confirm(k["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,j.formatMessage(k["Saving file {0}"],s.inputManager.getInput())),b.then(function(b){s.inputManager.getFileMetadata().ETag=b.ETag;d.setInput(s.inputManager.getInput(),null,a,!0);s.inputManager.afterSave&&s.inputManager.afterSave()},q)):q(b)});return!0},{name:k.Save});this.commandService.addCommand(new h.Command({name:k.Save,tooltip:k["Save this file"],id:"orion.save",callback:function(){d.getTextView().invokeAction("save")}}));this.commandService.registerCommandContribution(this.toolbarId,
"orion.save",1,null,!1,new h.CommandKeyBinding("s",!0));var v=new h.ParametersDescription([new h.CommandParameter("line","number","Line:")],{hasOptionalParameters:!1},function(){var a=d.getModel().getLineAtOffset(d.getCaretOffset())+1;return[new h.CommandParameter("line","number","Line:",a.toString())]}),v=new h.Command({name:k["Go to Line"],tooltip:k["Go to specified line number"],id:"orion.gotoLine",parameters:v,callback:function(a){var b=d.getModel();a.parameters&&a.parameters.valueFor("line")?
a=a.parameters.valueFor("line"):(a=b.getLineAtOffset(d.getCaretOffset()),(a=prompt(k["Go to line:"],a+1))&&(a=parseInt(a,10)));if(a)d.onGotoLine(a-1,0)}});this.commandService.addCommand(v);this.commandService.registerCommandContribution(this.pageNavId,"orion.gotoLine",1,null,!0,new h.CommandKeyBinding("l",!0),new h.URLBinding("gotoLine","line"));d.getTextView().setKeyBinding(new b.KeyBinding("l",!0),"gotoLine");d.getTextView().setAction("gotoLine",function(){s.commandService.runCommand("orion.gotoLine");
return!0},v);var v=new h.ParametersDescription([new h.CommandParameter("find","text","Find:")],{clientCollect:!0},function(){var a=d.getSelection(),b="";a.end>a.start&&(b=d.getModel().getText(a.start,a.end));return[new h.CommandParameter("find","text","Find:",b)]}),t=this,v=new h.Command({name:k.Find,tooltip:k.Find,id:"orion.editor.find",parameters:v,callback:function(a){if(t._searcher){var b="",c=null,e=d.getSelection();e.end>e.start?b=d.getModel().getText(e.start,e.end):a.parameters&&a.parameters.valueFor("find")&&
(b=a.parameters.valueFor("find"),c=n.matchResourceParameters(),m.convertFindURLBinding(c));c?(t._searcher.setOptions({useRegExp:c.regEx,ignoreCase:!c.caseSensitive}),c.atLine?(a=d.getModel().getLineStart(c.atLine-1),d.moveSelection(a,a,function(){t._searcher.buildToolBar(b,c.replaceWith);t._searcher.findNext(!0)},focus)):(t._searcher.buildToolBar(b,c.replaceWith),t._searcher.findNext(!0))):t._searcher.buildToolBar(b);return!0}return!1}});this.commandService.addCommand(v);this.commandService.registerCommandContribution(this.pageNavId,
"orion.editor.find",2,null,!0,new h.CommandKeyBinding("f",!0),new h.URLBinding("find","find"));d.getTextView().setKeyBinding(new b.KeyBinding("f",!0),"find");d.getTextView().setAction("find",function(){s.commandService.runCommand("orion.editor.find");return!0},v);var y=this.serviceRegistry.getServiceReferences("orion.edit.command"),x=this.inputManager,z=this.serviceRegistry.getService("orion.page.progress"),I=function(a,b,c){c.callback=function(){d=this;var c=d.getSelection(),e=d.getModel(),f=e.getText(),
h=function(a){a&&a.text?(d.setText(a.text),a.selection&&(d.setSelection(a.selection.start,a.selection.end),d.getTextView().focus())):typeof a==="string"&&(d.setText(a,c.start,c.end),d.setSelection(c.start,c.start+a.length),d.getTextView().focus())};z.progress(b.run(e.getText(c.start,c.end),f,c,x.getInput()),j.formatMessage(k["Running {0}"],a.name)).then(function(b){if(b&&b.uriTemplate){var c=(new g(b.uriTemplate)).expand(x.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 O(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&&h(b.result),window.removeEventListener("message",O,!1),window.document.body.removeChild(d)))},
!1)}else h(b)});return!0};c.callback=c.callback.bind(d);return new h.Command(c)};a.when(e(this.serviceRegistry),function(){var b=[],c=100;y.forEach(function(a){for(var e=s.serviceRegistry.getService(a),g={},h=a.getPropertyKeys(),i=0;i<h.length;i++)g[h[i]]=a.getProperty(h[i]);g.forceSingleItem=!0;a=f._createCommandOptions(g,a,s.serviceRegistry,r,!1,function(){return x.getFileMetadata()});b.push(a);a.then(function(a){a=I(g,e,a);s.commandService.addCommand(a);s.commandService.registerCommandContribution(s.toolbarId,
a.id,c);if(g.key){var b=d.getTextView();b.setKeyBinding(o(g.key),a.id);b.setAction(a.id,a.callback,a)}});c++});a.all(b,function(a){return{_error:a}}).then(function(){if(x.getFileMetadata()){var a=i.node("pageActions");a&&(s.commandService.destroy(a),s.commandService.renderCommands(a.id,a,d,d,"button"));if(a=i.node("pageNavigationActions"))s.commandService.destroy(a),s.commandService.renderCommands(a.id,a,d,d,"button")}})})}}};return d}();d.UndoCommandFactory=function(){function a(b,c,d){this.serviceRegistry=
b;this.commandService=c;this.toolbarId=d}a.prototype={createUndoStack:function(a){var b=new e.UndoStack(a.getTextView(),200),c=new h.Command({name:k.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 h.Command({name:k.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 d});
define("orion/edit/syntaxmodel",["orion/serviceTracker"],function(k){function j(a){return(a=a.getProperty("contentType"))?Array.isArray(a)?a:[a]:null}function i(h){var d=this.contentTypesMap={},f=new k(h,a),c=new k(h,g),b=this.notifySyntaxModelListeners.bind(this);f.addingService=function(a){var b=h.getService(a);(a=j(a))&&a.forEach(function(a){var c=d[a];c?c.push(b):d[a]=[b]})};f.removedService=function(a,b){var c=j(a);c&&c.forEach(function(a){var a=d.hasOwnProperty(a.id)?d[a.id]:null,c=a.indexOf(b);
c!==-1&&a.splice(c,1)})};c.addingService=function(a){var c=h.getService(a);j(a)&&(typeof c.addEventListener!=="function"?console.log(Error("A "+g+' service must provide an "addEventListener" method')):c.addEventListener("orion.edit.syntaxmodel.modelReady",b))};c.removedService=function(a,c){c&&typeof c.removeEventListener==="function"&&c.removeEventListener("orion.edit.syntaxmodel.modelReady",b)};f.open();c.open()}var a="orion.edit.syntaxmodel.listener",g="orion.edit.syntaxmodel.provider";i.prototype.notifySyntaxModelListeners=
function(a){var d=a.contentType,f=a.syntaxModel;typeof d!=="string"?console.log(Error('SyntaxModelReadyEvent must provide a "contentType" field')):(a=this.contentTypesMap.hasOwnProperty(d)?this.contentTypesMap[d]:null)&&a.forEach(function(a){a.setSyntaxModel(f)})};return i});
define("orion/widgets/themes/editor/ThemeData",[],function(){function k(){}function j(){this.styles=[];var a=new k;a.name="Eclipse";a.annotationRuler="white";a.background="white";a.comment="green";a.keyword="#7f0055";a.text="darkSlateGray";a.string="blue";a.overviewRuler="white";a.lineNumberOdd="#444";a.lineNumberEven="#444";a.lineNumber="#444";a.currentLine="#EAF2FE";a.tag="darkorange";a.attribute="cadetBlue";a.fontSize="10pt";this.styles.push(a);a=new k;a.name="Prospecto";a.annotationRuler="white";
a.background="white";a.comment="#3C802C";a.keyword="#CC4C07";a.text="#333";a.string="#446FBD";a.overviewRuler="white";a.lineNumberOdd="silver";a.lineNumberEven="silver";a.lineNumber="silver";a.currentLine="#EAF2FE";a.tag="#CC4C07";a.attribute="cadetBlue";a.fontSize="10pt";this.styles.push(a);a=new k;a.name="Blue";a.annotationRuler="lavender";a.background="aliceBlue";a.comment="indigo";a.keyword="cornFlowerBlue";a.text="navy";a.string="cornFlowerBlue";a.overviewRuler="lavender";a.lineNumberOdd="darkSlateGray";
a.lineNumberEven="darkSlateGray";a.lineNumber="darkSlateGray";a.currentLine="white";a.tag="cornFlowerBlue";a.attribute="cadetBlue";a.fontSize="10pt";this.styles.push(a);a=new k;a.name="Ambience";a.annotationRuler="#3D3D3D";a.background="#202020";a.comment="mediumslateblue";a.keyword="cornFlowerBlue";a.text="darkseagreen";a.string="lightcoral";a.overviewRuler="white";a.lineNumberOdd="black";a.lineNumberEven="black";a.lineNumber="black";a.currentLine="lightcyan";a.tag="cornFlowerBlue";a.attribute="cadetBlue";
a.fontSize="10pt";this.styles.push(a);a=new k;a.name="Tierra";a.annotationRuler="moccasin";a.background="lemonchiffon";a.comment="darkseagreen";a.keyword="darkred";a.text="#555555";a.string="orangered";a.overviewRuler="moccasin";a.lineNumberOdd="chocolate";a.lineNumberEven="chocolate";a.lineNumber="chocolate";a.currentLine="#baa289";a.tag="darkred";a.attribute="cadetBlue";a.fontSize="10pt";this.styles.push(a);a=new k;a.name="Nimbus";a.annotationRuler="#444";a.background="dimgray";a.comment="darkseagreen";
a.keyword="darkorange";a.text="white";a.string="cornflowerblue";a.overviewRuler="#444";a.lineNumberOdd="#aaa";a.lineNumberEven="#aaa";a.lineNumber="#aaa";a.currentLine="#aabfbb";a.tag="darkorange";a.attribute="cadetBlue";a.fontSize="10pt";this.styles.push(a);a=new k;a.name="Adelante";a.annotationRuler="#E2D2B2";a.background="#F1E7C8";a.comment="#5D774E";a.keyword="#AF473B";a.text="dimgray";a.string="#DE5D3B";a.overviewRuler="#E2D2B2";a.lineNumberOdd="#AF473B";a.lineNumberEven="#AF473B";a.lineNumber=
"#AF473B";a.currentLine="#9e937b";a.tag="#AF473B";a.attribute="cadetBlue";a.fontSize="10pt";this.styles.push(a);a=new k;a.name="Raspberry Pi";a.annotationRuler="seashell";a.background="seashell";a.comment="#66B32F";a.keyword="#E73E36";a.text="dimgray";a.string="darkorange";a.overviewRuler="seashell";a.lineNumberOdd="#E73E36";a.lineNumberEven="#E73E36";a.lineNumber="#E73E36";a.currentLine="#F5B1AE";a.tag="#E73E36";a.attribute="cadetBlue";a.fontSize="10pt";this.styles.push(a)}function i(){return this.styles}
k.prototype.name="prospecto";k.prototype.annotationRuler="darkSlateGray";k.prototype.background="#EFEFEF";k.prototype.comment="#3C802C";k.prototype.keyword="#CC4C07";k.prototype.text="#333";k.prototype.string="#446FBD";k.prototype.overviewRuler="#FBFBFB";k.prototype.lineNumberOdd="white";k.prototype.lineNumberEven="white";k.prototype.lineNumber="silver";k.prototype.tag="#CC4C07";k.prototype.attribute="cadetBlue";k.prototypefontSize="10pt";j.prototype.styles=[];j.prototype.getStyles=i;j.prototype.fontSettable=
!0;j.prototype.getThemeStorageInfo=function(){return{storage:"/themes",styleset:"editorstyles",defaultTheme:"Prospecto"}};j.prototype.parseToXML=function(a){try{var g=null;if(window.DOMParser){var g=(new DOMParser).parseFromString(a,"text/xml"),h=g.getElementsByTagName("parsererror");return!h||!h.length||!h[0].childNodes.length?g:null}else return g=new ActiveXObject("Microsoft.XMLDOM"),g.async=!1,g.loadXML(a),g}catch(d){}};j.prototype.selectFontSize=function(a){console.log("fontsize: "+a)};j.prototype.importTheme=
function(a){console.log("import theme");console.log(a);var g=this.parseToXML(a.parameters.valueFor("name")),h=new k;h.name=g.getElementsByTagName("colorTheme")[0].attributes[1].value;h.annotationRuler=g.getElementsByTagName("background")[0].attributes[0].value;h.background=g.getElementsByTagName("background")[0].attributes[0].value;h.comment=g.getElementsByTagName("singleLineComment")[0].attributes[0].value;h.keyword=g.getElementsByTagName("keyword")[0].attributes[0].value;h.text=g.getElementsByTagName("foreground")[0].attributes[0].value;
h.string=g.getElementsByTagName("string")[0].attributes[0].value;h.overviewRuler=g.getElementsByTagName("background")[0].attributes[0].value;h.lineNumberOdd=g.getElementsByTagName("lineNumber")[0].attributes[0].value;h.lineNumberEven=g.getElementsByTagName("lineNumber")[0].attributes[0].value;h.lineNumber=g.getElementsByTagName("lineNumber")[0].attributes[0].value;h.currentLine=g.getElementsByTagName("selectionBackground")[0].attributes[0].value;a.items.styles.push(h);a.items.updateThemePicker(h.name);
a.items.select(h.name)};j.prototype.processSettings=function(a,g){a.fontSize||(a.fontSize={value:"10pt"});g.getPreferences("/settings",2).then(function(g){g.put("JavaScript Editor",JSON.stringify([{element:"fontFamily",value:"sans serif"},{element:"fontSize",value:a.fontSize.value},{element:"fontWeight",value:"normal"},{element:"text",value:a.text.value},{element:"background",value:a.background.value},{element:"string",value:a.string.value},{element:"annotationRuler",value:a.annotationRuler.value},
{element:"comment",value:a.comment.value},{element:"keyword",value:a.keyword.value},{element:"overviewRuler",value:a.overviewRuler.value},{element:"annotationRuler",value:a.annotationRuler.value},{element:"lineNumber",value:a.lineNumber.value},{element:"currentLine",value:a.currentLine.value},{element:"attribute",value:a.attribute.value}]))})};j.prototype.getViewData=function(){var a={top:10,left:10,width:400,height:350},g=a.left,h=a.top;a.shapes=[{type:"TEXT",name:"Line Numbers",label:"1",x:g+20,
y:h+20,fill:"darkSlateGray",family:"lineNumber",font:"9pt sans-serif"},{type:"RECTANGLE",name:"Background",x:g+46,y:h,width:290,height:a.height,family:"background",fill:"white"},{type:"TEXT",name:"Strings",label:"'text/javascript'",x:g+134,y:h+20,fill:"darkorange",family:"string",font:"9pt sans-serif"},{type:"TEXT",name:"Foreground",label:"=",x:g+124,y:h+20,fill:"darkSlateGray",family:"text",font:"9pt sans-serif"},{type:"RECTANGLE",name:"Current Line",x:g+46,y:h+87,width:290,height:18,family:"currentLine",
fill:"#eaf2fd"},{type:"TEXT",name:"HTML Attribute",label:"type",x:g+98,y:h+20,fill:"darkGray",family:"attribute",font:"9pt sans-serif"},{type:"RECTANGLE",name:"Overview Ruler",x:g+336,y:h,width:14,height:a.height,family:"overviewRuler",fill:"white"},{type:"TEXT",name:"Comments",label:"/* comment */",x:g+75,y:h+40,fill:"darkSeaGreen",family:"comment",font:"9pt sans-serif"},{type:"TEXT",name:"HTML Tag",label:"<script",x:g+55,y:h+20,fill:"darkorange",family:"keyword",font:"9pt sans-serif"},{type:"TEXT",
name:"HTML Tag",label:">",x:g+213,y:h+20,fill:"darkorange",family:"keyword",font:"9pt sans-serif"},{type:"RECTANGLE",name:"Current Line",x:g+46,y:h+87,width:290,height:18,family:"currentLine",fill:"#eaf2fd"},{type:"TEXT",name:"Strings",label:"'Result'",x:g+164,y:h+80,fill:"cornflowerBlue",family:"string",font:"9pt sans-serif"},{type:"TEXT",name:"Foreground",label:"multiply(a,b){",x:g+120,y:h+60,fill:"darkSlateGray",family:"text",font:"9pt sans-serif"},{type:"TEXT",name:"keywords",label:"function",
x:g+75,y:h+60,fill:"darkorange",family:"keyword",font:"9pt sans-serif"},{type:"TEXT",name:"Keywords",label:"var",x:g+95,y:h+80,fill:"darkorange",family:"keyword",font:"9pt sans-serif"},{type:"TEXT",name:"Foreground",label:"output = ",x:g+115,y:h+80,fill:"darkSlateGray",family:"text",font:"9pt sans-serif"},{type:"TEXT",name:"Foreground",label:";",x:g+205,y:h+80,fill:"darkSlateGray",family:"text",font:"9pt sans-serif"},{type:"TEXT",name:"keywords",label:"var",x:g+95,y:h+100,fill:"darkorange",family:"keyword",
font:"9pt sans-serif"},{type:"TEXT",name:"Foreground",label:"result = a*b;",x:g+115,y:h+100,fill:"darkSlateGray",family:"text",font:"9pt sans-serif"},{type:"TEXT",name:"keywords",label:"return",x:g+95,y:h+120,fill:"darkorange",family:"keyword",font:"9pt sans-serif"},{type:"TEXT",name:"Foreground",label:"output + result;",x:g+135,y:h+120,fill:"darkSlateGray",family:"text",font:"9pt sans-serif"},{type:"TEXT",name:"Foreground",label:"}",x:g+75,y:h+140,fill:"darkSlateGray",family:"text",font:"9pt sans-serif"},
{type:"TEXT",name:"HTML Tag",label:"<\/script>",x:g+55,y:h+160,fill:"darkorange",family:"keyword",font:"9pt sans-serif"},{type:"TEXT",name:"HTML Tag",label:"<style",x:g+55,y:h+200,fill:"darkorange",family:"keyword",font:"9pt sans-serif"},{type:"TEXT",name:"HTML Attribute",label:"type",x:g+95,y:h+200,fill:"darkGray",family:"attribute",font:"9pt sans-serif"},{type:"TEXT",name:"Foreground",label:"=",x:g+121,y:h+200,fill:"darkSlateGray",family:"text",font:"9pt sans-serif"},{type:"TEXT",name:"Strings",
label:"'text/css'",x:g+131,y:h+200,fill:"darkorange",family:"string",font:"9pt sans-serif"},{type:"TEXT",name:"HTML Tag",label:">",x:g+180,y:h+200,fill:"darkorange",family:"keyword",font:"9pt sans-serif"},{type:"TEXT",name:"CSS Class Name",label:".some-class",x:g+75,y:h+220,fill:"darkorange",family:"keyword",font:"9pt sans-serif"},{type:"TEXT",name:"CSS Class Name",label:"{",x:g+145,y:h+220,fill:"darkSlateGray",family:"text",font:"9pt sans-serif"},{type:"TEXT",name:"CSS Attribute",label:"color:",
x:g+95,y:h+240,fill:"darkSlateGray",family:"text",font:"9pt sans-serif"},{type:"TEXT",name:"CSS Value",label:"#123456",x:g+130,y:h+240,fill:"darkSlateGray",family:"string",font:"9pt sans-serif"},{type:"TEXT",name:"CSS Text",label:";",x:g+180,y:h+240,fill:"darkSlateGray",family:"text",font:"9pt sans-serif"},{type:"TEXT",name:"CSS Class Name",label:"}",x:g+75,y:h+260,fill:"darkSlateGray",family:"text",font:"9pt sans-serif"},{type:"TEXT",name:"HTML Tag",label:"</style>",x:g+55,y:h+280,fill:"darkorange",
family:"keyword",font:"9pt sans-serif"},{type:"RECTANGLE",name:"Annotation Ruler",x:g,y:h,width:46,height:a.height,family:"annotationRuler",fill:"white"}];for(var d=0;d<16;d++)a.shapes.push({type:"TEXT",name:"Line Numbers",label:d+1,x:g+20,y:h+20*d+20,fill:"darkSlateGray",family:"lineNumber",font:"9pt sans-serif"});return a};return{ThemeData:j,getStyles:i}});
define("orion/settings/nls/root/messages",{"Plugin Description":"Plugin Description",Create:"Create","Loading...":"Loading...","Label:":"Label:",Title:"Title",Plugins:"Plugins","User Profile":"User Profile","JavaScript Editor":"JavaScript Editor",General:"General",Navigation:"Navigation","Open in same tab":"Open in same tab","Open in new tab":"Open in new tab",Links:"Links",Font:"Font",Family:"Family","Sans Serif":"Sans Serif",Serif:"Serif",Size:"Size","8pt":"8pt","9pt":"9pt","10pt":"10pt","12pt":"12pt",
Color:"Color",Background:"Background",Strings:"Strings","String Types":"String Types",blue:"blue",Weight:"Weight",Normal:"Normal",Bold:"Bold",Comments:"Comments","Comment Types":"Comment Types",green:"green",Keywords:"Keywords","Keyword Types":"Keyword Types",darkred:"darkred",Categories:"Categories",Username:"Username","Full Name":"Full Name","Email Address":"Email Address","Email Confirmed":"Email Confirmed",Account:"Account","Current Password":"Current Password","New Password":"New Password","Verify Password":"Verify Password",
Password:"Password",OpenId:"OpenId",AOL:"AOL",Yahoo:"Yahoo",Google:"Google",Unlink:"Unlink",Link:"Link",Unlinked:"Unlinked",Linked:"Linked","Linked Accounts":"Linked Accounts","Git Email Address":"Git Email Address","Git Username":"Git Username","Git Credentials Storage":"Git Credentials Storage",Update:"Update","Update Profile Settings":"Update Profile Settings","Update Git Credentials":"Update Git Credentials","User profile data successfully updated.":"User profile data successfully updated.","Git Credentials successfully updated.":"Git Credentials successfully updated.",
"Edit Plugin JavaScript":"Edit Plugin JavaScript","Install Plugin":"Install Plugin","Plugin Name:":"Plugin Name:","Author Name:":"Author Name:","Licence:":"Licence:","Description:":"Description:","A plugin for Eclipse Orion":"A plugin for Eclipse Orion","Plugin Link":"Plugin Link",Install:"Install","Install a plugin by specifying its URL":"Install a plugin by specifying its URL","Plugin URL:":"Plugin URL:",Disable:"Disable",DisableTooltip:"Disable the plugin",Enable:"Enable",EnableTooltip:"Enable the plugin",
"Reload all":"Reload all","Reload all installed plugins":"Reload all installed plugins","Create a new Orion Plugin":"Create a new Orion Plugin",Reload:"Reload","Reload the plugin":"Reload the plugin",Delete:"Delete","Delete this plugin from the configuration":"Delete this plugin from the configuration","Type a plugin url here ...":"Type a plugin url here ...","Installed ":"Installed ","Installing ":"Installing ","Already installed":"Already installed"," plugin":" plugin","Reloaded ":"Reloaded ","Uninstalled ":"Uninstalled ",
"Are you sure you want to uninstall '":"Are you sure you want to uninstall '",Services:"Services",Value:"Value","JavaScript Object":"JavaScript Object","click here, then check javascript console to drill down":"click here, then check javascript console to drill down",Item:"Item","Git Config":"Git Config","Clear Git Credentials":"Clear Git Credentials","Enable Storage":"Enable Storage","Please be aware that your credentials will be stored persistently in the browser.":"Please be aware that your credentials will be stored persistently in the browser.",
"Do you wish to enable the Key Storage?":"Do you wish to enable the Key Storage?",general:"General",validation:"Validation","Deleted git credentials for ${0}":"Deleted git credentials for ${0}"});define("orion/settings/nls/messages",["orion/i18n!orion/settings/nls/messages","orion/settings/nls/root/messages"],function(k,j){var i={root:j};Object.keys(k).forEach(function(a){typeof i[a]==="undefined"&&(i[a]=k[a])});return i});
define("orion/objects",[],function(){return{mixin:function(k){Array.prototype.slice.call(arguments,1).forEach(function(j){for(var i=Object.keys(j),a=0;a<i.length;a++){var g=i[a];k[g]=j[g]}})}}});
define("orion/widgets/input/Select",["orion/objects","orion/webui/littlelib"],function(k,j){function i(a,g){this.node=g||document.createElement("div");this.node.innerHTML=this.templateString;this.mylabel=j.$(".setting-label",this.node);this.select=j.$(".setting-control",this.node);this.options=a.options}k.mixin(i.prototype,{templateString:'<select class="setting-control" id="selection"></select>',addOptions:function(a){var g=document.createElement("option");g.value=a.value;g.appendChild(document.createTextNode(typeof a.label===
"string"?a.label:a.value));if(a.selected)g.selected="selected";this.select.appendChild(g)},show:function(){this.postCreate()},postCreate:function(){this.options.forEach(this.addOptions.bind(this));this.select.addEventListener("change",this.change.bind(this))},destroy:function(){if(this.node)j.empty(this.node),this.node=this.select=null},setStorageItem:function(){},getSelected:function(){return this.select.value},getSelectedIndex:function(){return this.select.selectedIndex},setSelectedIndex:function(a){this.select.selectedIndex=
a},change:function(){var a=this.select.value;this.category?this.setStorageItem(this.category,this.item,this.element,a,this.ui):this.setStorageItem(a)}});return i});
define("orion/widgets/themes/editor/MiniThemeChooser",["i18n!orion/settings/nls/messages","require","orion/widgets/themes/editor/ThemeData","orion/widgets/input/Select"],function(k,j,i,a){function g(a,c){this.preferences=a;this.textview=c;this.themeData=new i.ThemeData;this.initializeStorage()}function h(a,c){for(var b=c.parentNode;b!==null;){if(b===a)return!0;b=b.parentNode}return!1}function d(){}g.prototype.template='<div id="themeContainer"><div id="pickercontainer" style="display:block;"><span class="settingsPanelLabel">Theme:</span><div id="themepicker"></div></div><div id="sizecontainer"><span class="settingsPanelLabel">Font Size:</span><div id="fontsizepicker"></div></div></div>';
g.prototype.isDescendant=h;g.prototype.removeSettings=function(a){if(!h(this.container,a.target)&&(this.destroy(),window.removeEventListener(this.listener),this.container))this.container.parentNode.removeChild(this.container),this.container=null};g.prototype.onRemove=function(a){this.removeCall=a};g.prototype.appendTo=function(a){this.container=a;a.innerHTML=this.template;this.addFontSizePicker();this.addThemePicker()};g.prototype.selectTheme=function(a){var c=this.themeData.getThemeStorageInfo(),
b=this.themeData,d,g,h=this;this.preferences.getPreferences(c.storage,2).then(function(i){if(!i.get("selected")&&!a){a=c.defaultTheme;var j=b.getStyles();i.put(c.styleset,JSON.stringify(j))}if(a){d={selected:a};if(j=i.get("editorstyles")){var j=JSON.parse(j),k;for(k in j)if(j[k].name===a){g=j[k];break}}i.put("selected",JSON.stringify(d));h.setThemeData(g)}})};g.prototype.setThemeData=function(a){var c,b=this.textview;this.preferences.getPreferences("/settings",2).then(function(d){a&&(c=[{element:"fontFamily",
value:"sans serif"},{element:"fontSize",value:a.fontSize},{element:"fontWeight",value:"normal"},{element:"text",value:a.text},{element:"background",value:a.background},{element:"string",value:a.string},{element:"annotationRuler",value:a.annotationRuler},{element:"comment",value:a.comment},{element:"keyword",value:a.keyword},{element:"overviewRuler",value:a.overviewRuler},{element:"annotationRuler",value:a.annotationRuler},{element:"lineNumber",value:a.lineNumber},{element:"currentLine",value:a.currentLine},
{element:"attribute",value:a.attribute}],d.put("JavaScript Editor",JSON.stringify(c)),b.stylerOptions&&b.stylerOptions._update(c,b.stylerOptions))})};g.prototype.initializeStorage=function(){this.themeData.getThemeStorageInfo();this.selectTheme()};g.prototype.selectFontSize=function(a){this.themeData.getThemeStorageInfo();var c=this.textview;this.preferences.getPreferences("/settings",2).then(function(b){var d=b.get("JavaScript Editor");if(d){var d=JSON.parse(d),g;for(g in d)if(d[g].element==="fontSize"){d[g].value=
a;break}}b.put("JavaScript Editor",JSON.stringify(d));var b=document.querySelectorAll(".userTheme"),h;for(h in b)if(b[h].style)b[h].style.fontSize=a;b=document.querySelectorAll(".textviewContainer");for(h in b)if(b[h].style)b[h].style.fontSize=a;c.update(!0)})};g.prototype.addFontSizePicker=function(){var d=this,c="10pt";this.themeData.getThemeStorageInfo();this.preferences.getPreferences("/settings",2).then(function(b){if(b=b.get("JavaScript Editor")){var b=JSON.parse(b),e;for(e in b)if(b[e].element===
"fontSize"){c=b[e].value;break}}e=document.getElementById("fontsizepicker");for(var b=[],g=8;g<19;g++){var h={value:g+"pt",label:g+"pt"};if(h.label===c)h.selected=!0;this.fontSize=c;b.push(h)}this.sizeSelect=new a({options:b},e);this.sizeSelect.setStorageItem=d.selectFontSize.bind(d);this.sizeSelect.show()})};g.prototype.setUpPicker=function(d){var c=this.themeData.getThemeStorageInfo(),b=[],e=d.get("selected");e&&(e=JSON.parse(e));(d=d.get(c.styleset))&&(d=JSON.parse(d));if(!d)d=this.styleset;e||
(e={selected:"Prospecto"});if(d)for(var g in d){c={value:d[g].name,label:d[g].name};if(e&&d[g].name===e.selected)c.selected=!0;b.push(c);this.styles=d}e=document.getElementById("themepicker");this.themeSelect=new a({options:b},e);this.themeSelect.setStorageItem=this.selectTheme.bind(this);this.themeSelect.show()};g.prototype.addThemePicker=function(){this.preferences.getPreferences(this.themeData.getThemeStorageInfo().storage,2).then(this.setUpPicker.bind(this))};g.prototype.destroy=d;return{MiniThemeChooser:g,
destroy:d}});
define("orion/edit/dispatcher",["orion/edit/dispatcher"],function(){function k(j,i,a){this.serviceRegistry=j;this.editor=i;this.contentType=a;this.contentTypeService=j.getService("orion.core.contenttypes");this.serviceReferences={};var g=this;this.listener={onServiceAdded:function(a){g._onServiceAdded(a.serviceReference)},onServiceRemoved:function(a){g._onServiceRemoved(a.serviceReference)}};this.serviceRegistry.addEventListener("registered",this.listener.onServiceAdded);this.serviceRegistry.addEventListener("unregistering",this.listener.onServiceRemoved);
this._init()}k.prototype={_init:function(){var j=this;this.editor.getTextView()?this._wire(this.serviceRegistry):this.editor.addEventListener("TextViewInstalled",function(){j._wire(j.serviceRegistry)})},_wire:function(j){for(var j=j.getServiceReferences("orion.edit.model"),i=0;i<j.length;i++)this._wireServiceReference(j[i])},_wireServiceReference:function(j){var i=j.getProperty("contentType");if(typeof i!==void 0&&i!==null){var a=this;this.contentTypeService.isSomeExtensionOf(this.contentType,i).then(function(g){g&&
a._wireService(j,a.serviceRegistry.getService(j))})}},_wireService:function(j,i){var a=j.getProperty("types"),g=this.editor.getTextView();if(a){for(var h=0;h<a.length;h++){var d=a[h],f=i["on"+d];f&&this._wireServiceMethod(j,i,f,g,d)}this._initService(i,g)}},_wireServiceMethod:function(j,i,a,g,h){i=function(d){a(d).then()};j=j.getProperty("service.id");this.serviceReferences[j]=this.serviceReferences[j]||[];this.serviceReferences[j].push([g,h,i]);g.addEventListener(h,i)},_onServiceRemoved:function(j){var j=
j.getProperty("service.id"),i=this.serviceReferences[j];if(i){for(var a=0;a<i.length;a++){var g=i[a];g[0].removeEventListener(g[1],g[2])}delete this.serviceReferences[j]}},_onServiceAdded:function(j){j.getProperty("objectClass").indexOf("orion.edit.model")!==-1&&this._wireServiceReference(j)},_initService:function(j,i){var a=j.onModelChanging;if(typeof a==="function"){var g=i.getModel(),h=g.getText(),g={type:"Changing",text:h,start:0,removedCharCount:0,addedCharCount:h.length,removedLineCount:0,addedLineCount:g.getLineCount()};
a.call(j,g)}}};return{Dispatcher:k}});
define("edit/setup","i18n!orion/edit/nls/messages,require,orion/Deferred,orion/webui/littlelib,orion/selection,orion/status,orion/progress,orion/dialogs,orion/commands,orion/favorites,orion/fileClient,orion/operationsClient,orion/searchClient,orion/globalCommands,orion/outliner,orion/problems,orion/editor/contentAssist,orion/editorCommands,orion/editor/editorFeatures,orion/editor/editor,orion/syntaxchecker,orion/editor/textView,orion/editor/textModel,orion/editor/projectionTextModel,orion/editor/keyBinding,orion/searchAndReplace/textSearcher,orion/edit/dispatcher,orion/contentTypes,orion/PageUtil,orion/highlight,orion/i18nUtil,orion/edit/syntaxmodel,orion/widgets/themes/editor/MiniThemeChooser".split(","),function(k,
j,i,a,g,h,d,f,c,b,e,m,n,r,q,l,p,o,u,s,v,t,y,x,z,I,G,F,w,A,D,E,H){var B=B||{};B.setUpEditor=function(j,B,T){function O(a,b){var c=j.getServiceReferences("orion.edit.outliner");K=[];var d;for(d=0;d<c.length;d++){var e=c[d],f=e.getProperty("contentType"),g=e.getProperty("pattern"),h=!1;f?h=f.some(function(b){return W.isExtensionOf(a,b)}):g&&RegExp(g).test(b)&&(h=!0);h&&K.push(e)}c=[];for(d=0;d<K.length;d++)if(K[d].getProperty("nameKey")&&K[d].getProperty("nls")){e=new i;c.push(e);var k=K[d];D.getMessageBundle(k.getProperty("nls")).then(function(a){this.provider.displayName=
a[k.getProperty("nameKey")];this.deferred.resolve()}.bind({provider:k,deferred:e}),e.reject)}else K[d].displayName=K[d].getProperty("name");c.length===0?(R.setOutlineProviders(K),$&&$.setOutlineProviders(K)):i.all(c,function(a){return a}).then(function(){R.setOutlineProviders(K);$&&$.setOutlineProviders(K)})}var U=window.document,V,J,N,R,W,L;(function(){V=new g.Selection(j);var a=new m.OperationsClient(j);N=new h.StatusReportingService(j,a,"statusPane","notifications","notificationArea");L=new d.ProgressService(j,
a);new f.DialogService(j);J=new c.CommandService({serviceRegistry:j,selection:V});new l.ProblemService(j);R=new q.OutlineService({serviceRegistry:j,preferences:B});new b.FavoritesService({serviceRegistry:j});W=new F.ContentTypeService(j)})();var X=a.node("outline"),ca=a.node("editor"),P=a.node("searchFloat"),da=new A.SyntaxHighlighter(j);new E(j);var Y=new e.FileClient(j),Z=new n.Searcher({serviceRegistry:j,commandService:J,fileService:Y}),ea,Q={lastFilePath:"",setInput:function(b,c){function d(a){try{return a=
JSON.parse(a.responseText),a.Message}catch(b){}return a.responseText}b&&b[0]!=="#"&&(b="#"+b);var e=w.matchResourceParameters(b),f=e.resource;(function(a,b){for(var c=0;c<b.length;c++){var d=b[c];a[d]&&(a[d]=parseInt(a[d],10))}})(e,["start","end","line","offset","length"]);if(f){if(f===this.lastFilePath)c.showSelection(e.start,e.end,e.line,e.offset,e.length);else{c.getTextView()||c.installTextView();var g=setTimeout(function(){c.setInput(f,k["Fetching "]+f,null)},800),h=this,l=function(d,i){var k;
if(i){h._fileMetadata=i;if(k=a.node("pageActions"))J.destroy(k),J.renderCommands(k.id,k,i,c,"button");if(k=a.node("pageNavigationActions"))J.destroy(k),J.renderCommands(k.id,k,c,c,"button");h.setTitle(i.Location);h._contentType=W.getFileContentType(i);k=i.Name}else h._fileMetadata=null,h.setTitle(f),h._contentType=W.getFilenameContentType(h.getTitle()),k=h.getTitle();var l=new H.MiniThemeChooser(B,c.getTextView());r.addSettings(l);r.setPageTarget({task:"Coding",name:k,target:i,makeAlternate:function(){if(i.Parents&&
i.Parents.length>0)return L.progress(Y.read(i.Parents[0].Location,!0),"Getting metadata of "+i.Parents[0].Location)},serviceRegistry:j,commandService:J,searchService:Z,fileService:Y});r.setDirtyIndicator(!1);da.setup(h._contentType,c.getTextView(),c.getAnnotationModel(),f,!0).then(function(){var a=da.getStyler();c.setFoldingEnabled(a&&a.foldingEnabled);O(h._contentType,b);ea||(ea=new G.Dispatcher(j,c,h._contentType));c.setInput(f,null,d);c.showSelection(e.start,e.end,e.line,e.offset,e.length);J.processURL(window.location.href)});
clearTimeout(g)};(new i.all([L.progress(Y.read(f),"Reading "+f),L.progress(Y.read(f,!0),"Reading metedata of "+f)],function(a){return{_error:a}})).then(function(a){var b=a[0],a=a[1];clearTimeout(g);b._error&&(console.error("HTTP status code: ",b._error.status),b=k["An error occurred: "]+d(b._error));a._error&&console.error("Error loading file metadata: "+d(a._error));l(b,a)})}this.lastFilePath=f}else c.setInput(k["No File Selected"],"",null)},getInput:function(){return this.lastFilePath},setTitle:function(a){var b=
a.lastIndexOf("/");b!==-1&&(a=a.substring(b+1));this._lastTitle=a},getTitle:function(){return this._lastTitle},getFileMetadata:function(){return this._fileMetadata},getContentType:function(){return this._contentType},setDirty:function(a){r.setDirtyIndicator(a)},hashChanged:function(a){var b=this.getInput();V.setSelections(window.location.hash);var c=window.location.hash,d=this.getInput(),b=w.matchResourceParameters(b).resource!==w.matchResourceParameters(d).resource,d=w.matchResourceParameters(d).resource===
w.matchResourceParameters(c).resource;!b&&!d?(this._lastHash=c,window.location.hash=this._lastHash[0]==="#"?this._lastHash.substring(1):this._lastHash):(b&&this.setInput(c,a),this._lastHash=c)},shouldGoToURI:function(a,b){if(a.isDirty()){var c=w.matchResourceParameters("#"+this.lastFilePath).resource,d=w.matchResourceParameters(b).resource;if(c!==d)return window.confirm(k["There are unsaved changes.  Do you still want to navigate away?"])}return!0}},fa={handlers:[],addHandler:function(a){this.handlers.push(a)},
cancel:function(){return!1},isActive:function(){for(var a=0;a<this.handlers.length;a++)if(this.handlers[a].isActive())return!0;return!1},lineUp:function(){return!1},lineDown:function(){return!1},enter:function(){return!1},tab:function(){for(var a=0;a<this.handlers.length;a++)if(this.handlers[a].isActive())return this.handlers[a].tab()}},ba={handlers:[],addHandler:function(a){this.handlers.push(a)},cancel:function(){for(var a=!1,b=0;b<this.handlers.length;b++)a=this.handlers[b].cancel()||a;return a},
isActive:function(){for(var a=0;a<this.handlers.length;a++)if(this.handlers[a].isActive())return!0;return!1},lineUp:function(){return!1},lineDown:function(){return!1},enter:function(){return!1},tab:function(){return!1}},ga=T?null:{createContentAssistMode:function(a){var b=j.getService("orion.page.progress"),c=new p.ContentAssist(a.getTextView());c.addEventListener("Activating",function(){for(var d=Q.getContentType(),e=a.getTitle(),f=j.getServiceReferences("orion.edit.contentAssist"),g=[],h=0;h<f.length;h++){var i=
f[h],k=i.getProperty("contentType"),l=i.getProperty("pattern");(k&&W.isSomeExtensionOf(d,k)||l&&RegExp(l).test(e))&&g.push(j.getService(i))}c.setProviders(g);c.setProgress(b)});var d=new p.ContentAssistWidget(c,"contentassist");return new p.ContentAssistMode(c,d)}},ha=new u.AnnotationFactory,M=new s.Editor({textViewFactory:function(){return new t.TextView({parent:ca,model:new x.ProjectionTextModel(new y.TextModel),tabSize:4,readonly:T})},undoStackFactory:new o.UndoCommandFactory(j,J,"pageActions"),
textDNDFactory:new u.TextDNDFactory,annotationFactory:ha,foldingRulerFactory:new u.FoldingRulerFactory,lineNumberRulerFactory:new u.LineNumberRulerFactory,contentAssistFactory:ga,keyBindingFactory:function(b,c,d,e){c.push(fa);var f=new I.TextSearcher(b,J,d),g=new u.TextActions(b,d,f);c.push(g);g=new u.LinkedMode(b);c.push(g);d=new u.SourceCodeActions(b,d,e,g);c.push(d);(new o.EditorCommandFactory(j,J,Y,Q,"pageActions",T,"pageNavigationActions",f)).generateEditorCommands(b);c.push(ba);b.getTextView().setKeyBinding(new z.KeyBinding("w",
!0,!1,!0),"toggleWrapMode");b.getTextView().setKeyBinding(new z.KeyBinding("h",!0),"searchFiles");b.getTextView().setAction("searchFiles",function(){window.setTimeout(function(){var c=b.getTextView(),d=c.getSelection(),e="";d.end>d.start&&(e=c.getText().substring(d.start,d.end));e.length<=0&&(e=prompt(k["Enter search term:"],e));if(e)U.addEventListener("keydown",function(c){if(c.charOrCode===a.KEY.ESCAPE)P.style.display="none",a.$$array("a",P).indexOf(U.activeElement)!==-1&&b.getTextView().focus()},
!1),fa.addHandler({isActive:function(){return P.style.display==="block"},tab:function(){return this.isActive()?(a.$("a",P).focus(),!0):!1}}),ba.addHandler({isActive:function(){return P.style.display==="block"},cancel:function(){return this.isActive()?(P.style.display="none",!0):!1}}),P.appendChild(U.createTextNode(k["Searching for occurrences of "])),c=U.createElement("b"),P.appendChild(c),c.appendChild(U.createTextNode('"'+e+'"...')),P.style.display="block",e=Z.createSearchParams(e,!1,!0),e.sort=
"Name asc",c=Z.defaultRenderer.makeRenderFunction(null,P,!1),Z.search(e,Q.getInput(),c)},0);return!0},{name:k["Search Files"]})},statusReporter:function(a,b,c){b==="progress"?N.setProgressMessage(a):b==="error"?N.setErrorMessage(a):N.setMessage(a,null,c)},domNode:ca});j.getService("orion.core.marker").addEventListener("problemsChanged",function(a){M.showProblems(a.problems)});M.addEventListener("DirtyChanged",function(){Q.setDirty(M.isDirty())});V.addEventListener("selectionChanged",function(a){a=
a.selection;Q.shouldGoToURI(M,a)&&Q.setInput(a,M)});window.addEventListener("hashchange",function(){Q.hashChanged(M)},!1);Q.setInput(window.location.hash,M);r.generateBanner("orion-editor",j,J,B,Z,M,M,ba);J.registerCommandContribution("pageActions","orion.makeFavorite",2);var ia=new v.SyntaxChecker(j,M);M.addEventListener("InputChanged",function(a){ia.checkSyntax(Q.getContentType(),a.title,a.message,a.contents)});var K,$=new q.Outliner({parent:X,serviceRegistry:j,outlineService:j.getService("orion.edit.outline"),
commandService:J,selectionService:V,onSelectedProvider:function(a){R.setProvider(a);R.emitOutline(M.getText(),M.getTitle())}});K&&$.setOutlineProviders(K);M.addEventListener("InputChanged",function(){R.emitOutline(M.getText(),M.getTitle())});window.onbeforeunload=function(){if(M.isDirty())return k["There are unsaved changes."]}};return B});define("edit/edit",["orion/bootstrap","edit/setup"],function(k,j){k.startup().then(function(i){j.setUpEditor(i.serviceRegistry,i.preferences,!1)})});